void Ctrl::DndInit() { GtkWidget *w = top->window; gpointer id = (gpointer)(uintptr_t)top->id; g_signal_connect(w, "drag-begin", G_CALLBACK(GtkDragBegin), id); g_signal_connect(w, "drag-data-delete", G_CALLBACK(GtkDragDelete), id); g_signal_connect(w, "drag-data-get", G_CALLBACK(GtkDragGetData), id); g_signal_connect(w, "drag-data-received", G_CALLBACK(GtkDragDataReceived), id); g_signal_connect(w, "drag-drop", G_CALLBACK(GtkDragDrop), id); g_signal_connect(w, "drag-end", G_CALLBACK(GtkDragEnd), id); g_signal_connect(w, "drag-failed", G_CALLBACK(GtkDragFailed), id); g_signal_connect(w, "drag-leave", G_CALLBACK(GtkDragLeave), id); g_signal_connect(w, "drag-motion", G_CALLBACK(GtkDragMotion), id); gtk_drag_dest_set(w, GtkDestDefaults(0), NULL, 0, GdkDragAction(GDK_ACTION_COPY|GDK_ACTION_MOVE)); }
GtkWidget* pp_layout_nup_pageview_new (Layout_NUp *layout) { pp_Layout_NUp_PageView *pageview; pageview = PP_LAYOUT_NUP_PAGEVIEW(g_object_new (pp_layout_nup_pageview_get_type (), NULL)); gtk_drag_dest_set(GTK_WIDGET(pageview), GtkDestDefaults(GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP), dnd_file_drop_types, dnd_file_drop_types_count, GdkDragAction(GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)); g_signal_connect(G_OBJECT(pageview), "drag_data_received", G_CALLBACK(get_dnd_data), NULL); pageview->layout=layout; return GTK_WIDGET (pageview); }