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

version» Context lines:

pike.git/src/post_modules/GTK2/source/global.pre:170:   }      void applet_widget_gtk_main()   //! Special corba main loop for gnome panel applets   {    applet_widget_gtk_main();   }   */   endrequire;    + require gnome_vfs; + void gnome_vfs_init() + //! Initialize gnome-vfs. Usually done automatically by gnome_init(). + { +  gnome_vfs_init(); + } + endrequire; +    %{   static gchar **get_argv( int *argc_ret, int an )   {    struct array *a;    int argc;    gchar **data;    if( Pike_sp[-an].type != PIKE_T_ARRAY )    Pike_error("Expected array\n");    a = Pike_sp[-an].u.array;    if (!a->size)
pike.git/src/post_modules/GTK2/source/global.pre:283:    pgtk_setup_gtk( args );   }         void main()   //! Start GTK in blocking mode.<br />   //! Doing this disables asynchronous I/O in pike.<br />   //! You can return -1 from main in pike to run GTK (and the rest of   //! pike) in asynchronous mode.   { +  my_pop_n_elems(args);    gtk_main();   }      void main_quit()   //! Exit from the gtk_main function on the next iteration.   { -  +  my_pop_n_elems(args);    gtk_main_quit();   }      int main_level()   //! Return the current recursion depth.   { -  +  my_pop_n_elems(args);    push_int( gtk_main_level() );   }      int main_iteration_do(int block)   //! Run one iteration in the mainloop. If block is true, wait for an   //! event before returning.   {    INT_TYPE n;    get_all_args( "gtk_main_iteration_do", args, "%i", &n ); -  +  my_pop_n_elems(args);    push_int( g_main_iteration( n ) );   }      int true()   //! Always returns true.   { -  +  my_pop_n_elems(args);    push_int(1);   }      int false()   //! Always returns false.   { -  +  my_pop_n_elems(args);    push_int(0);   }      void grab_add(GTK2.Widget widget)   //! Grab a widget.   {    struct object *o;    get_all_args("gtk_grab_add",args,"%o",&o);    gtk_grab_add(GTK_WIDGET(get_gobject(o)));    my_pop_n_elems(args);
pike.git/src/post_modules/GTK2/source/global.pre:359:    * TODO: Add an atexit() that restores the screensaver.    */    static int timeout_save, dpms_off;   %}      void saver_disable( )   //! Disable the screensaver.   //! This is a low-level X11 function, and thus only works when GDK uses X11   {    int interval, prefer_blank, allow_exp; +  my_pop_n_elems(args);    XGetScreenSaver(GDK_DISPLAY(),    &timeout_save, &interval, &prefer_blank, &allow_exp);    if (timeout_save)    XSetScreenSaver(GDK_DISPLAY(), 0, interval, prefer_blank, allow_exp);      #ifdef HAVE_XDPMS    if (DPMSQueryExtension(GDK_DISPLAY(), &interval, &interval))    {    CARD16 state;    DPMSInfo(GDK_DISPLAY(), &state, &dpms_off);    if (dpms_off)    DPMSDisable(mDisplay); /* monitor powersave off */    }   #endif   }      void saver_enable( )   //! Enable the screensaver again after @[saver_disable] has been called.   //! This is a low-level X11 function, and thus only works when GDK uses X11.   { -  +  my_pop_n_elems(args);    if( timeout_save )    {    int dummy, interval, prefer_blank, allow_exp;    XGetScreenSaver(GDK_DISPLAY(),    &dummy, &interval, &prefer_blank, &allow_exp);    XSetScreenSaver(GDK_DISPLAY(),    timeout_save, interval, prefer_blank, allow_exp);    }      #ifdef HAVE_XDPMS
pike.git/src/post_modules/GTK2/source/global.pre:407:      void move_cursor( int dx, int dy )   //! Move the mouse-cursor dx,dy pixels, relative to it's current position.   //! This will generate a normal motion event.   //!   //! Note that this is a low-level X11 function, and thus only works   //! when GDK uses X11.   {    INT_TYPE x, y;    get_all_args( "move_cursor", args, "%i%i", &x, &y ); -  +  my_pop_n_elems(args);    XWarpPointer( GDK_DISPLAY(), None, None, 0, 0, 0, 0, x, y );   }      void move_cursor_abs( GDK2.Window w, int dx, int dy )   //! Move the mouse-cursor to x,y, relative to the upper left corner of   //! the specified window. This will generate a normal motion event.   //!   //! Note that this is a low-level X11 function, and thus only works   //! when GDK uses X11.   {    INT_TYPE x, y;    struct object *o;    GdkWindowPrivate *priv;    get_all_args("move_cursor_abs",args,"%o%i%i",&o,&x,&y);    priv = (GdkWindowPrivate *)get_gdkobject( o, window );    if( !priv )    Pike_error("No window specified!\n");    XWarpPointer(GDK_DISPLAY(),None,priv->xwindow,0,0,0,0,x,y); -  +  my_pop_n_elems(args);   }      endrequire; /* x11 */      require gtk22;   array(mapping(string:mixed)) get_formats()   //! Get information about the image formats supported.   {    GSList *gsl,*gs2;    gchar **gca;
pike.git/src/post_modules/GTK2/source/global.pre:515:   //! Parses an image file far enough to determine its format   //! and size.   {    GdkPixbufFormat *gpf;    gchar **gca;    int j,k;    char *filename;    int width,height;       get_all_args("get_file_info",args,"%s",&filename); -  my_pop_n_elems(args); +     gpf=gdk_pixbuf_get_file_info(filename,&width,&height); -  +  my_pop_n_elems(args);    k=0; -  +     push_text("name");    push_text(gdk_pixbuf_format_get_name(gpf));    k++;       push_text("description");    push_text(gdk_pixbuf_format_get_description(gpf));    k++;       push_text("mime_types");    gca=gdk_pixbuf_format_get_mime_types(gpf);
pike.git/src/post_modules/GTK2/source/global.pre:587:       f_aggregate_mapping(k*2);   }      void set_default_icon(GDK2.Pixbuf icon)   //! Sets an icon to be used as fallback for windows that haven't had set_icon()   //! called on them from a pixbuf.   {    struct object *o1;    get_all_args("set_default_icon",args,"%o",&o1); -  my_pop_n_elems(args); +     gtk_window_set_default_icon(GDK_PIXBUF(get_gobject(o1))); -  +  my_pop_n_elems(args);   }   endrequire;      require gtk22;   void set_default_icon_from_file(string filename)   //! Sets an icon to be used as fallback for windows that haven't had   //! set_icon_list() called on them from a file on disk.   {    struct svalue *sv;    get_all_args("set_default_icon_from_file",args,"%*",&sv); -  my_pop_n_elems(args); +     gtk_window_set_default_icon_from_file(PGTK_GETSTR(sv),NULL); -  +  my_pop_n_elems(args);   }   endrequire;      void set_default_icon_list(array(GDK2.Pixbuf) list)   //! Sets an icon list to be used as fallback for windows that haven't had   //! set_icon_list() called on them to set up a window-specific icon list. This   //! function allows you to set up the icon for all windows in your app at once.   {   }   
pike.git/src/post_modules/GTK2/source/global.pre:629:    my_pop_n_elems(args);   }   endrequire;      array(GTK2.Widget) list_toplevels()   //! Returns a list of all existing toplevel windows.   {    GList *gl=gtk_window_list_toplevels();    GList *g2=gl;    int i=0; +  my_pop_n_elems(args);    while (g2) {    push_gobject(g2->data);    i++;    g2=g_list_next(g2);    }    f_aggregate(i);    g_list_free(gl);   }      array(GDK2.Pixbuf) get_default_icon_list()   //! Gets the value set by set_default_icon_list().   {    GList *gl=gtk_window_get_default_icon_list();    GList *g2=gl;    int i=0; -  +  my_pop_n_elems(args);    while (g2) {    push_gobject(g2->data);    g_object_ref(GDK_PIXBUF(g2->data));    i++;    g2=g_list_next(g2);    }    f_aggregate(i);    g_list_free(gl);   }