int clip_GDK_DRAGGETPROTOCOL(ClipMachine * cm) { guint32 xid = _clip_parni(cm, 1); GdkDragProtocol protocol ; CHECKARG(1, NUMERIC_t); _clip_retni(cm, gdk_drag_get_protocol(xid, &protocol)); _clip_storni(cm, protocol, 2, 0); return 0; err: return 1; }
static VALUE rg_s_get_protocol(int argc, VALUE *argv, G_GNUC_UNUSED VALUE self) { VALUE xid; GdkDragProtocol prot; GdkNativeWindow ret; if (argc == 1) { rb_scan_args(argc, argv, "10", &xid); ret = gdk_drag_get_protocol(RVAL2GDKNATIVEWINDOW(xid), &prot); } else { VALUE display; rb_scan_args(argc, argv, "20", &display, &xid); ret = gdk_drag_get_protocol_for_display(GDK_DISPLAY_OBJECT(RVAL2GOBJ(display)), RVAL2GDKNATIVEWINDOW(xid), &prot); } return rb_ary_new3(2, GENUM2RVAL(prot, GDK_TYPE_DRAG_PROTOCOL), GDKNATIVEWINDOW2RVAL(ret)); }