static VALUE rg_m_send_notify(int argc, VALUE *argv, VALUE self) { VALUE requestor, selection, target, property, time; if (argc == 5) { rb_scan_args(argc, argv, "50", &requestor, &selection, &target, &property, &time); gdk_selection_send_notify(RVAL2GDKNATIVEWINDOW(requestor), RVAL2ATOM(selection), RVAL2ATOM(target), NIL_P(property) ? GDK_NONE : RVAL2ATOM(property), NUM2INT(time)); } else { #if GTK_CHECK_VERSION(2,2,0) VALUE display = Qnil; rb_scan_args(argc, argv, "60", &display, &requestor, &selection, &target, &property, &time); gdk_selection_send_notify_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2GDKNATIVEWINDOW(requestor), RVAL2ATOM(selection), RVAL2ATOM(target), NIL_P(property) ? GDK_NONE : RVAL2ATOM(property), NUM2INT(time)); #else rb_raise(rb_eArgError, "Wrong number of arguments: %d", argc); #endif } return self; }
static void process_dnd_source_selection_req(GdkWindow *window, GdkEventSelection* event) { GdkWindow *requestor = GLASS_GDK_SELECTION_EVENT_GET_REQUESTOR(event); gboolean is_data_set = FALSE; if (event->target == TARGET_UTF8_STRING_ATOM || event->target == TARGET_MIME_TEXT_PLAIN_ATOM) { is_data_set = dnd_source_set_utf8_string(requestor, event->property); } else if (event->target == TARGET_STRING_ATOM) { is_data_set = dnd_source_set_string(requestor, event->property); // } else if (event->target == TARGET_COMPOUND_TEXT_ATOM) { // XXX compound text } else if (target_is_image(event->target)) { is_data_set = dnd_source_set_image(requestor, event->property, event->target); } else if (event->target == TARGET_MIME_URI_LIST_ATOM) { is_data_set = dnd_source_set_uri_list(requestor, event->property); } else { is_data_set = dnd_source_set_raw(requestor, event->property, event->target); } gdk_selection_send_notify(event->requestor, event->selection, event->target, (is_data_set) ? event->property : GDK_NONE, event->time); }
static VALUE rg_m_send_notify(int argc, VALUE *argv, VALUE self) { VALUE requestor, selection, target, property, time; if (argc == 5) { rb_scan_args(argc, argv, "50", &requestor, &selection, &target, &property, &time); gdk_selection_send_notify(RVAL2GDKNATIVEWINDOW(requestor), RVAL2ATOM(selection), RVAL2ATOM(target), NIL_P(property) ? GDK_NONE : RVAL2ATOM(property), NUM2INT(time)); } else { VALUE display = Qnil; rb_scan_args(argc, argv, "60", &display, &requestor, &selection, &target, &property, &time); gdk_selection_send_notify_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2GDKNATIVEWINDOW(requestor), RVAL2ATOM(selection), RVAL2ATOM(target), NIL_P(property) ? GDK_NONE : RVAL2ATOM(property), NUM2INT(time)); } return self; }