eb05362005-11-05Henrik Grubbström (Grubba) /* -*- C -*- */
1a05542005-07-28Martin Nilsson class GDK2.Event; //! Gdk events. %{ #define GTK_GDKEVENT(X) ((GdkEvent *)X) #define RETURN_NIL() do{ my_pop_n_elems( args );push_int( 0 );Pike_sp[-1].subtype=1;return; } while(0) #define RETURN_INT(X) do { my_pop_n_elems( args );push_int( X ); return; } while(0) #define RETURN_FLOAT(X) do { my_pop_n_elems( args );push_float( X ); return; } while(0) #define RETURN_STRING(X) do { my_pop_n_elems( args );push_string( X ); return; } while(0) #define RETURN_ATOM(X) do { my_pop_n_elems( args );push_atom( X ); return; } while(0) static int last_event_time; int pgtk_last_event_time() { return last_event_time; } %} void destroy() //! Destructor. { if( THIS->obj ) g_free( THIS->obj ); THIS->obj = 0;
3d76632005-11-03Lance Dillon  my_pop_n_elems(args); push_int(0);
1a05542005-07-28Martin Nilsson } mixed _index(string ind) //! Return an index. { struct pike_string *index; GdkEvent *e = (GdkEvent *)THIS->obj; if(!e) Pike_error("No event\n"); get_all_args( "`[]", args, "%S", &index ); last_event_time = gdk_event_get_time( e ); switch( e->type ) { case GDK_NOTHING:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("nothing"));
1a05542005-07-28Martin Nilsson  break; case GDK_DELETE:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("delete"));
1a05542005-07-28Martin Nilsson  break; case GDK_DESTROY:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("destroy"));
1a05542005-07-28Martin Nilsson  break; case GDK_EXPOSE:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("expose")); if( is_same_string(index,_STR("count")) ) RETURN_INT( e->expose.count ); if( is_same_string(index,_STR("x")) ) RETURN_INT( e->expose.area.x ); if( is_same_string(index,_STR("y")) ) RETURN_INT( e->expose.area.y ); if( is_same_string(index,_STR("width")) ) RETURN_INT( e->expose.area.width ); if( is_same_string(index,_STR("height")) ) RETURN_INT( e->expose.area.height );
1a05542005-07-28Martin Nilsson  break; case GDK_MOTION_NOTIFY:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("motion")); if( is_same_string(index,_STR("x")) ) RETURN_FLOAT( e->motion.x ); if( is_same_string(index,_STR("y")) ) RETURN_FLOAT( e->motion.y ); if( is_same_string(index,_STR("x_root")) ) RETURN_FLOAT( e->motion.x_root ); if( is_same_string(index,_STR("y_root")) ) RETURN_FLOAT( e->motion.y_root ); if( is_same_string(index,_STR("state")) ) RETURN_INT( e->motion.state );
1a05542005-07-28Martin Nilsson /* if( index == s_xtilt ) RETURN_FLOAT( e->motion.xtilt ); */ /* if( index == s_ytilt ) RETURN_FLOAT( e->motion.ytilt ); */ /* if( index == s_pressure ) RETURN_FLOAT( e->motion.pressure ); */ /* if( index == s_deviceid ) RETURN_INT( e->motion.deviceid ); */ break; case GDK_BUTTON_PRESS:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("button_press"));
1a05542005-07-28Martin Nilsson  case GDK_BUTTON_RELEASE:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("button_release"));
1a05542005-07-28Martin Nilsson  case GDK_2BUTTON_PRESS:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("2button_press"));
1a05542005-07-28Martin Nilsson  case GDK_3BUTTON_PRESS:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("3button_press")); if( is_same_string(index,_STR("x")) ) RETURN_FLOAT(e->button.x); if( is_same_string(index,_STR("y")) ) RETURN_FLOAT(e->button.y);
1a05542005-07-28Martin Nilsson /* if( index == s_pressure ) RETURN_FLOAT(e->button.pressure); */ /* if( index == s_xtilt ) RETURN_FLOAT(e->button.xtilt); */ /* if( index == s_ytilt ) RETURN_FLOAT(e->button.ytilt); */ /* if( index == s_deviceid ) RETURN_INT(e->button.deviceid); */
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("state")) ) RETURN_INT(e->button.state); if( is_same_string(index,_STR("button")) ) RETURN_INT(e->button.button); if( is_same_string(index,_STR("x_root")) ) RETURN_FLOAT(e->button.x_root); if( is_same_string(index,_STR("y_root")) ) RETURN_FLOAT(e->button.y_root);
1a05542005-07-28Martin Nilsson  break; case GDK_KEY_PRESS:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("key_press"));
1a05542005-07-28Martin Nilsson  case GDK_KEY_RELEASE:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("key_release")); if( is_same_string(index,_STR("state")) ) RETURN_INT(e->key.state); if( is_same_string(index,_STR("keyval")) ) RETURN_INT(e->key.keyval);
1a05542005-07-28Martin Nilsson  if(e->key.string)
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("data")) )
1a05542005-07-28Martin Nilsson  RETURN_STRING(make_shared_binary_string(e->key.string,e->key.length)); break; case GDK_ENTER_NOTIFY:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("enter_notify"));
1a05542005-07-28Martin Nilsson  case GDK_LEAVE_NOTIFY:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("leave_notify")); if( is_same_string(index,_STR("detail")) ) RETURN_INT(e->crossing.detail); if( is_same_string(index,_STR("mode")) ) RETURN_INT(e->crossing.mode ); if( is_same_string(index,_STR("focus")) ) RETURN_INT(e->crossing.focus ); if( is_same_string(index,_STR("state")) ) RETURN_INT(e->crossing.state ); if( is_same_string(index,_STR("x_root")) ) RETURN_FLOAT(e->crossing.x_root ); if( is_same_string(index,_STR("y_root")) ) RETURN_FLOAT(e->crossing.y_root ); if( is_same_string(index,_STR("x")) ) RETURN_FLOAT(e->crossing.x ); if( is_same_string(index,_STR("y")) ) RETURN_FLOAT(e->crossing.y );
1a05542005-07-28Martin Nilsson  break; case GDK_FOCUS_CHANGE:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("focus")); if( is_same_string(index,_STR("in")) ) RETURN_INT( e->focus_change.in );
1a05542005-07-28Martin Nilsson  break; case GDK_CONFIGURE:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("configure"));
1a05542005-07-28Martin Nilsson  case GDK_MAP:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("map"));
1a05542005-07-28Martin Nilsson  case GDK_UNMAP:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("unmap")); if( is_same_string(index,_STR("x")) ) RETURN_INT(e->configure.x); if( is_same_string(index,_STR("y")) ) RETURN_INT(e->configure.x); if( is_same_string(index,_STR("width")) ) RETURN_INT(e->configure.width); if( is_same_string(index,_STR("height")) ) RETURN_INT(e->configure.height);
1a05542005-07-28Martin Nilsson  break; case GDK_PROPERTY_NOTIFY:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("property")); if( is_same_string(index,_STR("atom")) ) RETURN_ATOM( e->property.atom ); if( is_same_string(index,_STR("state")) ) RETURN_INT( e->property.state );
1a05542005-07-28Martin Nilsson  break; case GDK_SELECTION_CLEAR:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("selection_clear"));
1a05542005-07-28Martin Nilsson  case GDK_SELECTION_REQUEST:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("selection_request"));
1a05542005-07-28Martin Nilsson  case GDK_SELECTION_NOTIFY:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("selection_notify")); if( is_same_string(index,_STR("selection")) ) RETURN_ATOM( e->selection.selection ); if( is_same_string(index,_STR("target")) ) RETURN_ATOM( e->selection.target ); if( is_same_string(index,_STR("property")) ) RETURN_ATOM( e->selection.property ); if( is_same_string(index,_STR("requestor")) ) RETURN_INT( e->selection.requestor );
1a05542005-07-28Martin Nilsson  break; case GDK_PROXIMITY_IN:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("proximity_in"));
1a05542005-07-28Martin Nilsson /* if( index == s_deviceid ) RETURN_INT( e->proximity.deviceid ); */ break; case GDK_PROXIMITY_OUT:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("proximity_out"));
1a05542005-07-28Martin Nilsson /* if( index == s_deviceid ) RETURN_INT( e->proximity.deviceid ); */ break; case GDK_CLIENT_EVENT:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("client")); if( is_same_string(index,_STR("message_type")) ) RETURN_ATOM( e->client.message_type ); if( is_same_string(index,_STR("data_format")) ) RETURN_INT(e->client.data_format); if( is_same_string(index,_STR("data")) )
1a05542005-07-28Martin Nilsson  { pop_n_elems( args ); switch( e->client.data_format ) { case 8: push_string( make_shared_binary_string( e->client.data.b, 20 ) ); break; case 16: push_string(make_shared_binary_string1((const p_wchar1 *)e->client.data.s, 10)); break; case 32: push_Xpseudo32bitstring( e->client.data.l, 5 ); break; } return; } break; case GDK_VISIBILITY_NOTIFY:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("visibility")); if( is_same_string(index,_STR("state")) ) RETURN_INT( e->visibility.state );
1a05542005-07-28Martin Nilsson  break; case GDK_NO_EXPOSE:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("noexpose"));
1a05542005-07-28Martin Nilsson  break; case GDK_DRAG_ENTER:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("drag_enter"));
1a05542005-07-28Martin Nilsson  case GDK_DRAG_LEAVE:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("drag_leave"));
1a05542005-07-28Martin Nilsson  case GDK_DRAG_MOTION:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("drag_motion"));
1a05542005-07-28Martin Nilsson  case GDK_DRAG_STATUS:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("drag_status"));
1a05542005-07-28Martin Nilsson  case GDK_DROP_START:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("drop_start"));
1a05542005-07-28Martin Nilsson  case GDK_DROP_FINISHED:
4ffbb02006-01-17Martin Nilsson  if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("drop_finished")); if( is_same_string(index,_STR("send_event")) ) RETURN_INT( e->dnd.send_event ); if( is_same_string(index,_STR("x_root")) ) RETURN_INT( e->dnd.x_root ); if( is_same_string(index,_STR("y_root")) ) RETURN_INT( e->dnd.y_root ); if( is_same_string(index,_STR("context")) )
1a05542005-07-28Martin Nilsson  { pop_n_elems( args ); push_gdkobject( e->dnd.context, drag_context); return; } break; } RETURN_NIL(); } string _sprintf(int flag) { int mode = 0; if(args>0 && Pike_sp[-args].type == PIKE_T_INT) mode = Pike_sp[-args].u.integer; pop_n_elems( args ); if(mode != 'O') { push_undefined(); return; }
9fb5032006-01-14Martin Nilsson  ref_push_string( _STR("GDK2.Event(") ); ref_push_string( _STR("type") ); pgdk_event__index( 1 ); ref_push_string( _STR(")") );
1a05542005-07-28Martin Nilsson  f_add( 3 ); } mixed cast(string to) //! Cast to different types. { struct svalue *osp = Pike_sp-args; char *a; GdkEvent *e = (GdkEvent *)THIS->obj; if(!e) Pike_error("No event\n");
4ffbb02006-01-17Martin Nilsson  if( !args || !is_same_string(Pike_sp[-args].u.string,_STR("mapping")) )
1a05542005-07-28Martin Nilsson  Pike_error("Can only cast to mapping\n"); pop_n_elems( args ); switch(e->type) { case GDK_NOTHING:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("nothing"));
1a05542005-07-28Martin Nilsson  break; case GDK_DELETE:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("delete"));
1a05542005-07-28Martin Nilsson  break; case GDK_DESTROY:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("destroy"));
1a05542005-07-28Martin Nilsson  break; case GDK_EXPOSE:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("expose")); ref_push_string(_STR("count")); push_int(e->expose.count); ref_push_string(_STR("x")); push_int(e->expose.area.x); ref_push_string(_STR("y")); push_int(e->expose.area.y); ref_push_string(_STR("width")); push_int(e->expose.area.width); ref_push_string(_STR("height")); push_int(e->expose.area.height);
1a05542005-07-28Martin Nilsson  break; case GDK_MOTION_NOTIFY:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("motion")); ref_push_string(_STR("x")); push_float(e->motion.x); ref_push_string(_STR("y")); push_float(e->motion.y);
1a05542005-07-28Martin Nilsson /* ref_push_string(s_pressure);push_float(e->motion.pressure); */ /* ref_push_string(s_xtilt); push_float(e->motion.xtilt); */ /* ref_push_string(s_ytilt); push_float(e->motion.ytilt); */ /* ref_push_string(s_deviceid);push_int(e->motion.deviceid); */
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("state")); push_int(e->motion.state); ref_push_string(_STR("is_hint")); push_int(e->motion.is_hint); ref_push_string(_STR("x_root")); push_float(e->motion.x_root); ref_push_string(_STR("y_root")); push_float(e->motion.y_root);
1a05542005-07-28Martin Nilsson  break; case GDK_BUTTON_PRESS:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("button_press"));
1a05542005-07-28Martin Nilsson  goto press_event; case GDK_2BUTTON_PRESS:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("2button_press"));
1a05542005-07-28Martin Nilsson  goto press_event; case GDK_3BUTTON_PRESS:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("3button_press"));
1a05542005-07-28Martin Nilsson  goto press_event; case GDK_BUTTON_RELEASE:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("button_release"));
1a05542005-07-28Martin Nilsson  press_event:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("time")); push_int(e->button.time); ref_push_string(_STR("x")); push_float(e->button.x); ref_push_string(_STR("y")); push_float(e->button.y);
1a05542005-07-28Martin Nilsson /* ref_push_string(s_pressure);push_float(e->button.pressure); */ /* ref_push_string(s_xtilt); push_float(e->button.xtilt); */ /* ref_push_string(s_ytilt); push_float(e->button.ytilt); */ /* ref_push_string(s_deviceid);push_int(e->button.deviceid); */
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("state")); push_int(e->button.state); ref_push_string(_STR("button")); push_int(e->button.button); ref_push_string(_STR("x_root")); push_float(e->button.x_root); ref_push_string(_STR("y_root")); push_float(e->button.y_root);
1a05542005-07-28Martin Nilsson  break; case GDK_KEY_PRESS:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("key_press"));
1a05542005-07-28Martin Nilsson  goto key_event; case GDK_KEY_RELEASE:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("key_release"));
1a05542005-07-28Martin Nilsson  key_event:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("time")); push_int(e->key.time); ref_push_string(_STR("state")); push_int(e->key.state); ref_push_string(_STR("keyval")); push_int(e->key.keyval);
1a05542005-07-28Martin Nilsson  if(e->key.string) {
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("data"));
1a05542005-07-28Martin Nilsson  push_string(make_shared_binary_string(e->key.string, e->key.length)); } break; case GDK_ENTER_NOTIFY:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("enter_notify"));
1a05542005-07-28Martin Nilsson  goto enter_event; case GDK_LEAVE_NOTIFY:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("leave_notify"));
1a05542005-07-28Martin Nilsson  enter_event:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("detail")); push_int(e->crossing.detail); ref_push_string(_STR("mode")); push_int(e->crossing.mode ); ref_push_string(_STR("focus")); push_int(e->crossing.focus ); ref_push_string(_STR("state")); push_int(e->crossing.state ); ref_push_string(_STR("x_root")); push_float(e->crossing.x_root ); ref_push_string(_STR("y_root")); push_float(e->crossing.y_root ); ref_push_string(_STR("x")); push_float(e->crossing.x ); ref_push_string(_STR("y")); push_float(e->crossing.y );
1a05542005-07-28Martin Nilsson  break; case GDK_FOCUS_CHANGE:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("focus")); ref_push_string(_STR("in")); push_int( e->focus_change.in );
1a05542005-07-28Martin Nilsson  break; case GDK_CONFIGURE:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("configure"));
1a05542005-07-28Martin Nilsson  goto configure_event; case GDK_MAP:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("map"));
1a05542005-07-28Martin Nilsson  goto configure_event; case GDK_UNMAP:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("unmap"));
1a05542005-07-28Martin Nilsson  configure_event:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("x")); push_int(e->configure.x); ref_push_string(_STR("y")); push_int(e->configure.x); ref_push_string(_STR("width")); push_int(e->configure.width); ref_push_string(_STR("height")); push_int(e->configure.height);
1a05542005-07-28Martin Nilsson  break; case GDK_PROPERTY_NOTIFY:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("property")); ref_push_string(_STR("atom")); push_atom( e->property.atom ); ref_push_string(_STR("state")); push_int( e->property.state );
1a05542005-07-28Martin Nilsson  break; case GDK_SELECTION_CLEAR:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("selection_clear"));
1a05542005-07-28Martin Nilsson  goto selection_event; case GDK_SELECTION_REQUEST:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("selection_request"));
1a05542005-07-28Martin Nilsson  goto selection_event; case GDK_SELECTION_NOTIFY:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("selection_notify"));
1a05542005-07-28Martin Nilsson  selection_event:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("selection")); push_atom( e->selection.selection ); ref_push_string(_STR("target")); push_atom( e->selection.target ); ref_push_string(_STR("property")); push_atom( e->selection.property ); ref_push_string(_STR("requestor")); push_int( e->selection.requestor );
1a05542005-07-28Martin Nilsson  break; case GDK_PROXIMITY_IN:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("proximity_in"));
1a05542005-07-28Martin Nilsson /* ref_push_string(s_deviceid ); push_int( e->proximity.deviceid ); */ break; case GDK_PROXIMITY_OUT:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("proximity_out"));
1a05542005-07-28Martin Nilsson /* ref_push_string(s_deviceid ); push_int( e->proximity.deviceid ); */ break; case GDK_CLIENT_EVENT:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("client")); ref_push_string(_STR("message_type"));
1a05542005-07-28Martin Nilsson  push_atom( e->client.message_type );
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("data_format")); push_int(e->client.data_format); ref_push_string(_STR("data "));
1a05542005-07-28Martin Nilsson  switch( e->client.data_format ) { case 8: push_string( make_shared_binary_string( e->client.data.b, 20 ) ); break; case 16: push_string(make_shared_binary_string1((const p_wchar1 *)e->client.data.s, 10)); break; case 32: push_Xpseudo32bitstring( e->client.data.l, 5 ); break; } break; case GDK_VISIBILITY_NOTIFY:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("visibility")); ref_push_string(_STR("state")); push_int( e->visibility.state );
1a05542005-07-28Martin Nilsson  break; case GDK_NO_EXPOSE:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("noexpose"));
1a05542005-07-28Martin Nilsson  break; case GDK_DRAG_ENTER:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("drag_enter"));
1a05542005-07-28Martin Nilsson  goto dnd_event; case GDK_DRAG_LEAVE:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("drag_leave"));
1a05542005-07-28Martin Nilsson  goto dnd_event; case GDK_DRAG_MOTION:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("drag_motion"));
1a05542005-07-28Martin Nilsson  goto dnd_event; case GDK_DRAG_STATUS:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("drag_status"));
1a05542005-07-28Martin Nilsson  goto dnd_event; case GDK_DROP_START:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("drop_start"));
1a05542005-07-28Martin Nilsson  goto dnd_event; case GDK_DROP_FINISHED:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("type")); ref_push_string(_STR("drop_finished"));
1a05542005-07-28Martin Nilsson  dnd_event:
4ffbb02006-01-17Martin Nilsson  ref_push_string(_STR("send_event")); push_int( e->dnd.send_event ); ref_push_string(_STR("x_root")); push_int( e->dnd.x_root ); ref_push_string(_STR("y_root")); push_int( e->dnd.y_root ); ref_push_string(_STR("context"));push_gdkobject( e->dnd.context, drag_context);
1a05542005-07-28Martin Nilsson  break; } f_aggregate_mapping( Pike_sp - osp ); }