diff --git a/src/post_modules/GTK2/source/gdkevent.pre b/src/post_modules/GTK2/source/gdkevent.pre index 3a44b0bb91250106bc995ec8412a06c47b08350f..fc2724e17b3aef7332241ab6c0e3e2c981cf2730 100644 --- a/src/post_modules/GTK2/source/gdkevent.pre +++ b/src/post_modules/GTK2/source/gdkevent.pre @@ -9,6 +9,7 @@ class GDK2.Event; #define RETURN_NIL() do{ pgtk2_pop_n_elems( args );push_undefined();return; } while(0) #define RETURN_INT(X) do { pgtk2_pop_n_elems( args );push_int( X ); return; } while(0) #define RETURN_FLOAT(X) do { pgtk2_pop_n_elems( args );push_float( X ); return; } while(0) +#define REF_RETURN_STRING(X) do { pgtk2_pop_n_elems( args );ref_push_string( X ); return; } while(0) #define RETURN_STRING(X) do { pgtk2_pop_n_elems( args );push_string( X ); return; } while(0) #define RETURN_ATOM(X) do { pgtk2_pop_n_elems( args );push_atom( X ); return; } while(0) @@ -40,17 +41,17 @@ mixed _index(string ind) switch( e->type ) { case GDK_NOTHING: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("nothing")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("nothing")); break; case GDK_DELETE: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("delete")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("delete")); break; case GDK_DESTROY: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("destroy")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("destroy")); break; case GDK_EXPOSE: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("expose")); + if( is_same_string(index,_STR("type")) ) REF_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 ); @@ -59,7 +60,7 @@ mixed _index(string ind) break; case GDK_MOTION_NOTIFY: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("motion")); + if( is_same_string(index,_STR("type")) ) REF_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 ); @@ -72,13 +73,13 @@ mixed _index(string ind) break; case GDK_BUTTON_PRESS: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("button_press")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("button_press")); case GDK_BUTTON_RELEASE: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("button_release")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("button_release")); case GDK_2BUTTON_PRESS: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("2button_press")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("2button_press")); case GDK_3BUTTON_PRESS: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("3button_press")); + if( is_same_string(index,_STR("type")) ) REF_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); /* if( index == s_pressure ) RETURN_FLOAT(e->button.pressure); */ @@ -92,9 +93,9 @@ mixed _index(string ind) break; case GDK_KEY_PRESS: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("key_press")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("key_press")); case GDK_KEY_RELEASE: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("key_release")); + if( is_same_string(index,_STR("type")) ) REF_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); if(e->key.string) @@ -103,9 +104,9 @@ mixed _index(string ind) break; case GDK_ENTER_NOTIFY: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("enter_notify")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("enter_notify")); case GDK_LEAVE_NOTIFY: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("leave_notify")); + if( is_same_string(index,_STR("type")) ) REF_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 ); @@ -117,16 +118,16 @@ mixed _index(string ind) break; case GDK_FOCUS_CHANGE: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("focus")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("focus")); if( is_same_string(index,_STR("in")) ) RETURN_INT( e->focus_change.in ); break; case GDK_CONFIGURE: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("configure")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("configure")); case GDK_MAP: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("map")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("map")); case GDK_UNMAP: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("unmap")); + if( is_same_string(index,_STR("type")) ) REF_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.y); if( is_same_string(index,_STR("width")) ) RETURN_INT(e->configure.width); @@ -134,17 +135,17 @@ mixed _index(string ind) break; case GDK_PROPERTY_NOTIFY: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("property")); + if( is_same_string(index,_STR("type")) ) REF_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 ); break; case GDK_SELECTION_CLEAR: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("selection_clear")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("selection_clear")); case GDK_SELECTION_REQUEST: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("selection_request")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("selection_request")); case GDK_SELECTION_NOTIFY: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("selection_notify")); + if( is_same_string(index,_STR("type")) ) REF_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 ); @@ -152,17 +153,17 @@ mixed _index(string ind) break; case GDK_PROXIMITY_IN: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("proximity_in")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("proximity_in")); /* if( index == s_deviceid ) RETURN_INT( e->proximity.deviceid ); */ break; case GDK_PROXIMITY_OUT: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("proximity_out")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("proximity_out")); /* if( index == s_deviceid ) RETURN_INT( e->proximity.deviceid ); */ break; case GDK_CLIENT_EVENT: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("client")); + if( is_same_string(index,_STR("type")) ) REF_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")) ) @@ -185,26 +186,26 @@ mixed _index(string ind) break; case GDK_VISIBILITY_NOTIFY: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("visibility")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("visibility")); if( is_same_string(index,_STR("state")) ) RETURN_INT( e->visibility.state ); break; case GDK_NO_EXPOSE: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("noexpose")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("noexpose")); break; case GDK_DRAG_ENTER: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("drag_enter")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("drag_enter")); case GDK_DRAG_LEAVE: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("drag_leave")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("drag_leave")); case GDK_DRAG_MOTION: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("drag_motion")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("drag_motion")); case GDK_DRAG_STATUS: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("drag_status")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("drag_status")); case GDK_DROP_START: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("drop_start")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("drop_start")); case GDK_DROP_FINISHED: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("drop_finished")); + if( is_same_string(index,_STR("type")) ) REF_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 ); @@ -216,7 +217,7 @@ mixed _index(string ind) } break; case GDK_SCROLL: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("scroll")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("scroll")); if (is_same_string(index,_STR("x"))) RETURN_INT(e->scroll.x); if (is_same_string(index,_STR("y"))) RETURN_INT(e->scroll.y); if (is_same_string(index,_STR("direction"))) RETURN_INT(e->scroll.direction); @@ -225,25 +226,25 @@ mixed _index(string ind) break; case GDK_WINDOW_STATE: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("window_state")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("window_state")); if( is_same_string(index,_STR("changed")) ) RETURN_INT(e->window_state.changed_mask); if( is_same_string(index,_STR("new_state")) ) RETURN_INT(e->window_state.new_window_state); break; case GDK_SETTING: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("setting")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("setting")); if( is_same_string(index,_STR("action")) ) RETURN_INT(e->setting.action); if( is_same_string(index,_STR("name")) ) RETURN_STRING(make_shared_binary_string(e->setting.name,strlen(e->setting.name))); break; #ifdef HAVE_GTK26 case GDK_OWNER_CHANGE: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("owner_change")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("owner_change")); if( is_same_string(index,_STR("selection")) ) RETURN_ATOM(e->owner_change.selection); break; #endif #ifdef HAVE_GTK28 case GDK_GRAB_BROKEN: - if( is_same_string(index,_STR("type")) ) RETURN_STRING(_STR("setting")); + if( is_same_string(index,_STR("type")) ) REF_RETURN_STRING(_STR("setting")); if( is_same_string(index,_STR("keyboard")) ) RETURN_INT(e->grab_broken.keyboard); if( is_same_string(index,_STR("implicit")) ) RETURN_INT(e->grab_broken.implicit); break; @@ -483,6 +484,7 @@ mixed cast(string to) ref_push_string(_STR("y_root")); push_int( e->dnd.y_root ); ref_push_string(_STR("context"));push_gdkobject( e->dnd.context, drag_context, 0); break; + } f_aggregate_mapping( Pike_sp - osp ); }