2 * DO NOT EDIT THIS FILE - it is generated by Glade.
18 /* This is an internally used function to create pixmaps. */
19 static GtkWidget* create_dummy_pixmap (GtkWidget *widget,
20 gboolean gnome_pixmap);
23 lookup_widget (GtkWidget *widget,
24 const gchar *widget_name)
26 GtkWidget *parent, *found_widget;
30 if (GTK_IS_MENU (widget))
31 parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
33 parent = widget->parent;
39 found_widget = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (widget),
42 g_warning ("Widget not found: %s", widget_name);
46 /* This is a dummy pixmap we use when a pixmap can't be found. */
47 static char *dummy_pixmap_xpm[] = {
48 /* columns rows colors chars-per-pixel */
56 /* This is an internally used function to create pixmaps. */
58 create_dummy_pixmap (GtkWidget *widget,
59 gboolean gnome_pixmap)
61 GdkColormap *colormap;
68 return gnome_pixmap_new_from_xpm_d (dummy_pixmap_xpm);
71 colormap = gtk_widget_get_colormap (widget);
72 gdkpixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &mask,
73 NULL, dummy_pixmap_xpm);
74 if (gdkpixmap == NULL)
75 g_error ("Couldn't create replacement pixmap.");
76 pixmap = gtk_pixmap_new (gdkpixmap, mask);
77 gdk_pixmap_unref (gdkpixmap);
78 gdk_bitmap_unref (mask);
82 /* This is an internally used function to create pixmaps. */
84 create_pixmap (GtkWidget *widget,
85 const gchar *filename,
86 gboolean gnome_pixmap)
89 GdkColormap *colormap;
94 if (!filename || !filename[0])
95 return create_dummy_pixmap (widget, gnome_pixmap);
97 pathname = gnome_pixmap_file (filename);
100 g_warning (_("Couldn't find pixmap file: %s"), filename);
101 return create_dummy_pixmap (widget, gnome_pixmap);
106 pixmap = gnome_pixmap_new_from_file (pathname);
111 colormap = gtk_widget_get_colormap (widget);
112 gdkpixmap = gdk_pixmap_colormap_create_from_xpm (NULL, colormap, &mask,
114 if (gdkpixmap == NULL)
116 g_warning (_("Couldn't create pixmap from file: %s"), pathname);
118 return create_dummy_pixmap (widget, gnome_pixmap);
122 pixmap = gtk_pixmap_new (gdkpixmap, mask);
123 gdk_pixmap_unref (gdkpixmap);
124 gdk_bitmap_unref (mask);
128 /* This is an internally used function to create imlib images. */
130 create_image (const gchar *filename)
132 GdkImlibImage *image;
135 pathname = gnome_pixmap_file (filename);
138 g_warning (_("Couldn't find pixmap file: %s"), filename);
142 image = gdk_imlib_load_image (pathname);