当前位置: 首页>>代码示例>>C++>>正文


C++ DragData::draggingSourceOperationMask方法代码示例

本文整理汇总了C++中DragData::draggingSourceOperationMask方法的典型用法代码示例。如果您正苦于以下问题:C++ DragData::draggingSourceOperationMask方法的具体用法?C++ DragData::draggingSourceOperationMask怎么用?C++ DragData::draggingSourceOperationMask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DragData的用法示例。


在下文中一共展示了DragData::draggingSourceOperationMask方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: webkitWebViewBaseStartDrag

void webkitWebViewBaseStartDrag(WebKitWebViewBase* webViewBase, const DragData& dragData, PassRefPtr<ShareableBitmap> dragImage)
{
    WebKitWebViewBasePrivate* priv = webViewBase->priv;

    RefPtr<DataObjectGtk> dataObject = adoptRef(dragData.platformData());
    GRefPtr<GtkTargetList> targetList = adoptGRef(PasteboardHelper::defaultPasteboardHelper()->targetListForDataObject(dataObject.get()));
    GUniquePtr<GdkEvent> currentEvent(gtk_get_current_event());
    GdkDragContext* context = gtk_drag_begin(GTK_WIDGET(webViewBase),
                                             targetList.get(),
                                             dragOperationToGdkDragActions(dragData.draggingSourceOperationMask()),
                                             1, /* button */
                                             currentEvent.get());
    priv->dragAndDropHelper.startedDrag(context, dataObject.get());


    // A drag starting should prevent a double-click from happening. This might
    // happen if a drag is followed very quickly by another click (like in the DRT).
    priv->clickCounter.reset();

    if (dragImage) {
        RefPtr<cairo_surface_t> image(dragImage->createCairoSurface());
        priv->dragIcon.setImage(image.get());
        priv->dragIcon.useForDrag(context);
    } else
        gtk_drag_set_icon_default(context);
}
开发者ID:chenbk85,项目名称:webkit2-wincairo,代码行数:26,代码来源:WebKitWebViewBase.cpp

示例2: encodeDataObject

void ArgumentCoder<DragData>::encode(ArgumentEncoder* encoder, const DragData& dragData)
{
    encoder->encode(dragData.clientPosition());
    encoder->encode(dragData.globalPosition());
    encoder->encode(static_cast<uint64_t>(dragData.draggingSourceOperationMask()));
    encoder->encode(static_cast<uint64_t>(dragData.flags()));

    DataObjectGtk* platformData = dragData.platformData();
    encoder->encode(static_cast<bool>(platformData));
    if (platformData)
        encodeDataObject(encoder, platformData);
}
开发者ID:CannedFish,项目名称:deepin-webkit,代码行数:12,代码来源:ArgumentCodersGtk.cpp

示例3: startDrag

void DragAndDropHandler::startDrag(const DragData& dragData, PassRefPtr<ShareableBitmap> dragImage)
{
    RefPtr<DataObjectGtk> dataObject = adoptRef(dragData.platformData());
    GRefPtr<GtkTargetList> targetList = adoptGRef(PasteboardHelper::defaultPasteboardHelper()->targetListForDataObject(dataObject.get()));
    GUniquePtr<GdkEvent> currentEvent(gtk_get_current_event());

    GdkDragContext* context = gtk_drag_begin(m_page.viewWidget(), targetList.get(), dragOperationToGdkDragActions(dragData.draggingSourceOperationMask()),
        GDK_BUTTON_PRIMARY, currentEvent.get());
    m_draggingDataObjects.set(context, dataObject.get());

    if (dragImage) {
        RefPtr<cairo_surface_t> image(dragImage->createCairoSurface());
        m_dragIcon.setImage(image.get());
        m_dragIcon.useForDrag(context);
    } else
        gtk_drag_set_icon_default(context);
}
开发者ID:sinoory,项目名称:webv8,代码行数:17,代码来源:DragAndDropHandler.cpp


注:本文中的DragData::draggingSourceOperationMask方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。