pike.git / src / post_modules / GTK2 / source / gladexml.pre

version» Context lines:

pike.git/src/post_modules/GTK2/source/gladexml.pre:65:   /*    id=g_signal_connect_data(G_OBJECT(object),signal_name,    G_CALLBACK(pgtk2_signal_func_wrapper),b,    (GClosureNotify)pgtk2_free_signal_data,    G_CONNECT_SWAPPED);   */    gc=g_cclosure_new_swap(G_CALLBACK(pgtk2_signal_func_wrapper),b,    (GClosureNotify)pgtk2_free_signal_data);    g_closure_set_marshal(gc,pgtk2_marshaller);    id=g_signal_connect_closure(G_OBJECT(object),signal_name,gc,1); +  g_object_set_data(G_OBJECT(object),"signal-data",b);   }   %}      //! Glade is a free GUI builder for GTK2+ and Gnome. It's normally used to   //! create C-code, but can also produce code for other languages. Libglade   //! is a utility library that builds the GI from the Glade XML save files.   //! This module uses libglade and allows you to easily make GUI designs to be   //! used with your Pike applications.      void create(string filename_or_buffer, ?int size, ?string root, ?string domain)
pike.git/src/post_modules/GTK2/source/gladexml.pre:164:    widget=GTK_WIDGET(get_gobject(o1));    if (!widget)    Pike_error("GladeXML->get_widget_name: Invalid argument 1, wanted GTK2 object of type WIDGET.\n");    s=glade_get_widget_name(widget);    pgtk2_pop_n_elems(args);    push_text(s);    g_free((void *)s);    }   }    + int get_signal_id(GTK2.Widget widget) + //! Used to get the signal id attached to a GladeXML object. + { +  pgtk2_verify_inited(); +  { +  int id; +  struct object *o1; +  GtkWidget *w; +  struct signal_data *sd; +  +  get_all_args("get_signal_id",args,"%o",&o1); +  w=GTK_WIDGET(get_gobject(o1)); +  if (!w) +  Pike_error("GladeXML->get_signal_id: Invalid argument 1, wanted GTK2 object of type WIDGET.\n"); +  sd=g_object_get_data(G_OBJECT(w),"signal-data"); +  if (sd) +  push_int(sd->signal_id); +  else +  push_int(-1); +  } + } +    void signal_autoconnect(mapping(string:function) callbacks, mixed data)   //! Try to connect functions to all signals in the interface. The mapping   //! should consist of handler name : function pairs. The data argument will   //! be saved and sent as the first argument to all callback functions.   {    pgtk2_verify_inited();    if (args!=2 || Pike_sp[-args].type!=PIKE_T_MAPPING)    Pike_error("GTK2.GladeXML->signal_autoconnect: Invalid arguments, expected (mapping,mixed)\n");    glade_xml_signal_autoconnect_full(GLADE_XML(THIS->obj),pgtk2__signal_connect,&args);    RETURN_THIS();   }      endrequire;