* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include "config.h"
+#undef GTK_DISABLE_DEPRECATED
+
+#include <config.h>
#undef G_LOG_DOMAIN
gtk_widget_get_screen (widget));
gtk_window_set_title (GTK_WINDOW (window), "Toolbar test");
- gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
NULL, toolbar);
gtk_container_add (GTK_CONTAINER (window), toolbar);
+
+ gtk_widget_set_size_request (toolbar, 200, -1);
}
if (!GTK_WIDGET_VISIBLE (window))
GtkWidget *sw;
GtkWidget *src;
GtkWidget *snap;
- GtkWidget *vbox;
GtkWidget *hbox;
+ GtkWidget *vbox;
GtkWidget *button;
struct GetImageData *gid;
gid,
g_free);
- vbox = gtk_vbox_new (FALSE, 0);
+ hbox = gtk_hbox_new (FALSE, 0);
- gtk_container_add (GTK_CONTAINER (window), vbox);
+ gtk_container_add (GTK_CONTAINER (window), hbox);
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw),
src);
- gtk_box_pack_start (GTK_BOX (vbox),
+ gtk_box_pack_start (GTK_BOX (hbox),
sw, TRUE, TRUE, 0);
- hbox = gtk_hbox_new (FALSE, 3);
+ vbox = gtk_vbox_new (FALSE, 3);
snap = gtk_widget_new (GTK_TYPE_IMAGE, NULL);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), snap);
- gtk_box_pack_end (GTK_BOX (hbox), sw, FALSE, FALSE, 5);
+ gtk_box_pack_end (GTK_BOX (vbox), sw, FALSE, FALSE, 5);
button = gtk_button_new_with_label ("Get image from drawable");
G_CALLBACK (take_snapshot),
gid);
- gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
- gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
gtk_widget_show_all (window);
}
frame = gtk_frame_new ("Internationalized Label");
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
- "French (Français) Bonjour, Salut\n"
- "Korean (한글) 안녕하세요, 안녕하십니까\n"
- "Russian (Русский) Здравствуйте!\n"
- "Chinese (Simplified) <span lang=\"zh-cn\">元气 开发</span>\n"
- "Chinese (Traditional) <span lang=\"zh-tw\">元氣 開發</span>\n"
- "Japanese <span lang=\"ja\">元気 開発</span>");
+ "French (Fran\303\247ais) Bonjour, Salut\n"
+ "Korean (\355\225\234\352\270\200) \354\225\210\353\205\225\355\225\230\354\204\270\354\232\224, \354\225\210\353\205\225\355\225\230\354\213\255\353\213\210\352\271\214\n"
+ "Russian (\320\240\321\203\321\201\321\201\320\272\320\270\320\271) \320\227\320\264\321\200\320\260\320\262\321\201\321\202\320\262\321\203\320\271\321\202\320\265!\n"
+ "Chinese (Simplified) <span lang=\"zh-cn\">\345\205\203\346\260\224 \345\274\200\345\217\221</span>\n"
+ "Chinese (Traditional) <span lang=\"zh-tw\">\345\205\203\346\260\243 \351\226\213\347\231\274</span>\n"
+ "Japanese <span lang=\"ja\">\345\205\203\346\260\227 \351\226\213\347\231\272</span>");
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_container_add (GTK_CONTAINER (frame), label);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Bidirection Label");
- label = gtk_label_new ("Arabic السلام عليكم\n"
- "Hebrew שלום");
- gtk_widget_set_direction (label, GTK_TEXT_DIR_RTL);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT);
+ label = gtk_label_new ("\342\200\217Arabic \330\247\331\204\330\263\331\204\330\247\331\205 \330\271\331\204\331\212\331\203\331\205\n"
+ "\342\200\217Hebrew \327\251\327\234\327\225\327\235");
gtk_container_add (GTK_CONTAINER (frame), label);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Underlined label");
label = gtk_label_new ("This label is underlined!\n"
- "This one is underlined (こんにちは) in quite a funky fashion");
+ "This one is underlined (\343\201\223\343\202\223\343\201\253\343\201\241\343\201\257) in quite a funky fashion");
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_label_set_pattern (GTK_LABEL (label), "_________________________ _ _________ _ _____ _ __ __ ___ ____ _____");
gtk_container_add (GTK_CONTAINER (frame), label);
gtk_widget_destroy (window);
}
+/*
+ * Resize Grips
+ */
+static gboolean
+grippy_button_press (GtkWidget *area, GdkEventButton *event, GdkWindowEdge edge)
+{
+ if (event->type == GDK_BUTTON_PRESS)
+ {
+ if (event->button == 1)
+ gtk_window_begin_resize_drag (GTK_WINDOW (gtk_widget_get_toplevel (area)), edge,
+ event->button, event->x_root, event->y_root,
+ event->time);
+ else if (event->button == 2)
+ gtk_window_begin_move_drag (GTK_WINDOW (gtk_widget_get_toplevel (area)),
+ event->button, event->x_root, event->y_root,
+ event->time);
+ }
+ return TRUE;
+}
+
+static gboolean
+grippy_expose (GtkWidget *area, GdkEventExpose *event, GdkWindowEdge edge)
+{
+ gtk_paint_resize_grip (area->style,
+ area->window,
+ GTK_WIDGET_STATE (area),
+ &event->area,
+ area,
+ "statusbar",
+ edge,
+ 0, 0,
+ area->allocation.width,
+ area->allocation.height);
+
+ return TRUE;
+}
+
+static void
+create_resize_grips (GtkWidget *widget)
+{
+ static GtkWidget *window = NULL;
+ GtkWidget *area;
+ GtkWidget *hbox, *vbox;
+ if (!window)
+ {
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+
+ gtk_window_set_screen (GTK_WINDOW (window),
+ gtk_widget_get_screen (widget));
+
+ gtk_window_set_title (GTK_WINDOW (window), "resize grips");
+
+ g_signal_connect (window, "destroy",
+ G_CALLBACK (gtk_widget_destroyed),
+ &window);
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (window), vbox);
+
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
+
+ /* North west */
+ area = gtk_drawing_area_new ();
+ gtk_widget_add_events (area, GDK_BUTTON_PRESS_MASK);
+ gtk_box_pack_start (GTK_BOX (hbox), area, TRUE, TRUE, 0);
+ g_signal_connect (area, "expose_event", G_CALLBACK (grippy_expose),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_NORTH_WEST));
+ g_signal_connect (area, "button_press_event", G_CALLBACK (grippy_button_press),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_NORTH_WEST));
+
+ /* North */
+ area = gtk_drawing_area_new ();
+ gtk_widget_add_events (area, GDK_BUTTON_PRESS_MASK);
+ gtk_box_pack_start (GTK_BOX (hbox), area, TRUE, TRUE, 0);
+ g_signal_connect (area, "expose_event", G_CALLBACK (grippy_expose),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_NORTH));
+ g_signal_connect (area, "button_press_event", G_CALLBACK (grippy_button_press),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_NORTH));
+
+ /* North east */
+ area = gtk_drawing_area_new ();
+ gtk_widget_add_events (area, GDK_BUTTON_PRESS_MASK);
+ gtk_box_pack_start (GTK_BOX (hbox), area, TRUE, TRUE, 0);
+ g_signal_connect (area, "expose_event", G_CALLBACK (grippy_expose),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_NORTH_EAST));
+ g_signal_connect (area, "button_press_event", G_CALLBACK (grippy_button_press),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_NORTH_EAST));
+
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
+
+ /* West */
+ area = gtk_drawing_area_new ();
+ gtk_widget_add_events (area, GDK_BUTTON_PRESS_MASK);
+ gtk_box_pack_start (GTK_BOX (hbox), area, TRUE, TRUE, 0);
+ g_signal_connect (area, "expose_event", G_CALLBACK (grippy_expose),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_WEST));
+ g_signal_connect (area, "button_press_event", G_CALLBACK (grippy_button_press),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_WEST));
+
+ /* Middle */
+ area = gtk_drawing_area_new ();
+ gtk_box_pack_start (GTK_BOX (hbox), area, TRUE, TRUE, 0);
+
+ /* East */
+ area = gtk_drawing_area_new ();
+ gtk_widget_add_events (area, GDK_BUTTON_PRESS_MASK);
+ gtk_box_pack_start (GTK_BOX (hbox), area, TRUE, TRUE, 0);
+ g_signal_connect (area, "expose_event", G_CALLBACK (grippy_expose),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_EAST));
+ g_signal_connect (area, "button_press_event", G_CALLBACK (grippy_button_press),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_EAST));
+
+
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
+
+ /* South west */
+ area = gtk_drawing_area_new ();
+ gtk_widget_add_events (area, GDK_BUTTON_PRESS_MASK);
+ gtk_box_pack_start (GTK_BOX (hbox), area, TRUE, TRUE, 0);
+ g_signal_connect (area, "expose_event", G_CALLBACK (grippy_expose),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_SOUTH_WEST));
+ g_signal_connect (area, "button_press_event", G_CALLBACK (grippy_button_press),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_SOUTH_WEST));
+ /* South */
+ area = gtk_drawing_area_new ();
+ gtk_widget_add_events (area, GDK_BUTTON_PRESS_MASK);
+ gtk_box_pack_start (GTK_BOX (hbox), area, TRUE, TRUE, 0);
+ g_signal_connect (area, "expose_event", G_CALLBACK (grippy_expose),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_SOUTH));
+ g_signal_connect (area, "button_press_event", G_CALLBACK (grippy_button_press),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_SOUTH));
+
+ /* South east */
+ area = gtk_drawing_area_new ();
+ gtk_widget_add_events (area, GDK_BUTTON_PRESS_MASK);
+ gtk_box_pack_start (GTK_BOX (hbox), area, TRUE, TRUE, 0);
+ g_signal_connect (area, "expose_event", G_CALLBACK (grippy_expose),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_SOUTH_EAST));
+ g_signal_connect (area, "button_press_event", G_CALLBACK (grippy_button_press),
+ GINT_TO_POINTER (GDK_WINDOW_EDGE_SOUTH_EAST));
+ }
+
+ if (!GTK_WIDGET_VISIBLE (window))
+ gtk_widget_show_all (window);
+ else
+ gtk_widget_destroy (window);
+}
+
/*
* Saved Position
*/
window = g_object_connect (gtk_widget_new (GTK_TYPE_WINDOW,
"type", GTK_WINDOW_TOPLEVEL,
- "x", upositionx,
- "y", upositiony,
"title", "Saved Position",
NULL),
"signal::configure_event", uposition_configure, NULL,
NULL);
+ gtk_window_move (GTK_WINDOW (window), upositionx, upositiony);
+
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (widget));
return menu;
}
+static GtkWidget*
+create_table_menu (GdkScreen *screen, gint cols, gint rows, gboolean tearoff)
+{
+ GtkWidget *menu;
+ GtkWidget *menuitem;
+ GtkWidget *submenu;
+ GtkWidget *image;
+ char buf[32];
+ int i, j;
+
+ menu = gtk_menu_new ();
+ gtk_menu_set_screen (GTK_MENU (menu), screen);
+
+ j = 0;
+ if (tearoff)
+ {
+ menuitem = gtk_tearoff_menu_item_new ();
+ gtk_menu_attach (GTK_MENU (menu), menuitem, 0, cols, j, j + 1);
+ gtk_widget_show (menuitem);
+ j++;
+ }
+
+ menuitem = gtk_menu_item_new_with_label ("items");
+ gtk_menu_attach (GTK_MENU (menu), menuitem, 0, cols, j, j + 1);
+
+ submenu = gtk_menu_new ();
+ gtk_menu_set_screen (GTK_MENU (submenu), screen);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
+ gtk_widget_show (menuitem);
+ j++;
+
+ /* now fill the items submenu */
+ image = gtk_image_new_from_stock (GTK_STOCK_HELP,
+ GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image);
+ menuitem = gtk_image_menu_item_new_with_label ("Image");
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 1, 0, 1);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("x");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 1, 2, 0, 1);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("x");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 1, 1, 2);
+ gtk_widget_show (menuitem);
+
+ image = gtk_image_new_from_stock (GTK_STOCK_HELP,
+ GTK_ICON_SIZE_MENU);
+ gtk_widget_show (image);
+ menuitem = gtk_image_menu_item_new_with_label ("Image");
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (menuitem), image);
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 1, 2, 1, 2);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_radio_menu_item_new_with_label (NULL, "Radio");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 1, 2, 3);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("x");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 1, 2, 2, 3);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("x");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 1, 3, 4);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_radio_menu_item_new_with_label (NULL, "Radio");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 1, 2, 3, 4);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_check_menu_item_new_with_label ("Check");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 1, 4, 5);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("x");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 1, 2, 4, 5);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("x");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 1, 5, 6);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_check_menu_item_new_with_label ("Check");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 1, 2, 5, 6);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("1. Inserted normally (8)");
+ gtk_widget_show (menuitem);
+ gtk_menu_shell_insert (GTK_MENU_SHELL (submenu), menuitem, 8);
+
+ menuitem = gtk_menu_item_new_with_label ("2. Inserted normally (2)");
+ gtk_widget_show (menuitem);
+ gtk_menu_shell_insert (GTK_MENU_SHELL (submenu), menuitem, 2);
+
+ menuitem = gtk_menu_item_new_with_label ("3. Inserted normally (0)");
+ gtk_widget_show (menuitem);
+ gtk_menu_shell_insert (GTK_MENU_SHELL (submenu), menuitem, 0);
+
+ menuitem = gtk_menu_item_new_with_label ("4. Inserted normally (-1)");
+ gtk_widget_show (menuitem);
+ gtk_menu_shell_insert (GTK_MENU_SHELL (submenu), menuitem, -1);
+
+ /* end of items submenu */
+
+ menuitem = gtk_menu_item_new_with_label ("spanning");
+ gtk_menu_attach (GTK_MENU (menu), menuitem, 0, cols, j, j + 1);
+
+ submenu = gtk_menu_new ();
+ gtk_menu_set_screen (GTK_MENU (submenu), screen);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
+ gtk_widget_show (menuitem);
+ j++;
+
+ /* now fill the spanning submenu */
+ menuitem = gtk_menu_item_new_with_label ("a");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 2, 0, 1);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("b");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 2, 3, 0, 2);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("c");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 1, 1, 3);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("d");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 1, 2, 1, 2);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("e");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 1, 3, 2, 3);
+ gtk_widget_show (menuitem);
+ /* end of spanning submenu */
+
+ menuitem = gtk_menu_item_new_with_label ("left");
+ gtk_menu_attach (GTK_MENU (menu), menuitem, 0, 1, j, j + 1);
+ submenu = gtk_menu_new ();
+ gtk_menu_set_screen (GTK_MENU (submenu), screen);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("Empty");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 1, 0, 1);
+ submenu = gtk_menu_new ();
+ gtk_menu_set_screen (GTK_MENU (submenu), screen);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("right");
+ gtk_menu_attach (GTK_MENU (menu), menuitem, 1, 2, j, j + 1);
+ submenu = gtk_menu_new ();
+ gtk_menu_set_screen (GTK_MENU (submenu), screen);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), submenu);
+ gtk_widget_show (menuitem);
+
+ menuitem = gtk_menu_item_new_with_label ("Empty");
+ gtk_menu_attach (GTK_MENU (submenu), menuitem, 0, 1, 0, 1);
+ gtk_widget_show (menuitem);
+
+ j++;
+
+ for (; j < rows; j++)
+ for (i = 0; i < cols; i++)
+ {
+ sprintf (buf, "(%d %d)", i, j);
+ menuitem = gtk_menu_item_new_with_label (buf);
+ gtk_menu_attach (GTK_MENU (menu), menuitem, i, i + 1, j, j + 1);
+ gtk_widget_show (menuitem);
+ }
+
+ menuitem = gtk_menu_item_new_with_label ("1. Inserted normally (8)");
+ gtk_menu_shell_insert (GTK_MENU_SHELL (menu), menuitem, 8);
+ gtk_widget_show (menuitem);
+ menuitem = gtk_menu_item_new_with_label ("2. Inserted normally (2)");
+ gtk_menu_shell_insert (GTK_MENU_SHELL (menu), menuitem, 2);
+ gtk_widget_show (menuitem);
+ menuitem = gtk_menu_item_new_with_label ("3. Inserted normally (0)");
+ gtk_menu_shell_insert (GTK_MENU_SHELL (menu), menuitem, 0);
+ gtk_widget_show (menuitem);
+ menuitem = gtk_menu_item_new_with_label ("4. Inserted normally (-1)");
+ gtk_menu_shell_insert (GTK_MENU_SHELL (menu), menuitem, -1);
+ gtk_widget_show (menuitem);
+
+ return menu;
+}
+
static void
create_menus (GtkWidget *widget)
{
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
gtk_widget_show (menuitem);
+
+ menu = create_table_menu (screen, 2, 50, TRUE);
+
+ menuitem = gtk_menu_item_new_with_label ("table");
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
+ gtk_widget_show (menuitem);
menuitem = gtk_menu_item_new_with_label ("foo");
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (screen, 3, 5, TRUE));
g_message ("ItemFactory: activated \"%s\"", gtk_item_factory_path_from_widget (widget));
}
-/* This file was automatically generated by the make-inline-pixbuf program.
- * It contains inline RGB image data.
- */
-static const guchar apple[] =
-{
- /* File magic (1197763408) */
- 0x47, 0x64, 0x6b, 0x50,
- /* Format of following stuff (0) */
- 0x00, 0x00, 0x00, 0x00,
- /* Rowstride (64) */
- 0x00, 0x00, 0x00, 0x40,
- /* Width (16) */
- 0x00, 0x00, 0x00, 0x10,
- /* Height (16) */
- 0x00, 0x00, 0x00, 0x10,
- /* Has an alpha channel (TRUE) */
- 0x01,
- /* Colorspace (0 == RGB, no other options implemented) (0) */
- 0x00, 0x00, 0x00, 0x00,
- /* Number of channels (4) */
- 0x00, 0x00, 0x00, 0x04,
- /* Bits per sample (8) */
- 0x00, 0x00, 0x00, 0x08,
- /* Image data */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x14, 0x0f, 0x04,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x61, 0x6d, 0x5b, 0x2b, 0x6e, 0x7c, 0x61, 0xd9,
- 0x71, 0x80, 0x63, 0xd7, 0x5f, 0x6b, 0x5b, 0x35, 0x00, 0x00, 0x00, 0x00,
- 0x3a, 0x35, 0x28, 0x8f, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x60, 0x6c, 0x5c, 0x07, 0x6d, 0x7b, 0x61, 0xd8,
- 0x75, 0x84, 0x65, 0xf6, 0x76, 0x86, 0x66, 0xf7, 0x6a, 0x77, 0x60, 0xec,
- 0x5e, 0x6a, 0x58, 0x47, 0x1c, 0x1a, 0x13, 0xa2, 0x4b, 0x47, 0x30, 0x07,
- 0x55, 0x4e, 0x33, 0x21, 0x48, 0x3e, 0x2a, 0x08, 0xd0, 0xb8, 0x84, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69, 0x76, 0x5f, 0x74,
- 0x75, 0x84, 0x65, 0xf3, 0x67, 0x75, 0x5e, 0xc4, 0x69, 0x62, 0x55, 0x75,
- 0x94, 0x50, 0x50, 0x69, 0x75, 0x5c, 0x52, 0xb2, 0x69, 0x38, 0x34, 0xa2,
- 0xa7, 0x5b, 0x53, 0xea, 0xa3, 0x52, 0x4f, 0xff, 0x90, 0x47, 0x42, 0xfa,
- 0x76, 0x44, 0x36, 0xb9, 0x59, 0x38, 0x29, 0x3c, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x6b, 0x5a, 0x09,
- 0x69, 0x76, 0x5e, 0xb0, 0x5f, 0x6b, 0x59, 0x57, 0x9a, 0x4b, 0x4d, 0x5b,
- 0xb8, 0x5f, 0x63, 0xfa, 0xcc, 0x7d, 0x7e, 0xff, 0xc5, 0x69, 0x68, 0xff,
- 0xc7, 0x6b, 0x67, 0xff, 0xc5, 0x6f, 0x67, 0xff, 0xba, 0x5e, 0x5a, 0xff,
- 0xb1, 0x4d, 0x4d, 0xff, 0x92, 0x4b, 0x42, 0xff, 0x6a, 0x3e, 0x30, 0xfc,
- 0x5c, 0x3b, 0x27, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x5d, 0x69, 0x57, 0x09, 0x5d, 0x69, 0x57, 0x09, 0x92, 0x47, 0x46, 0x1e,
- 0xba, 0x65, 0x64, 0xf4, 0xe7, 0xbf, 0xc0, 0xff, 0xdf, 0xa5, 0xa3, 0xff,
- 0xd4, 0x84, 0x81, 0xff, 0xd1, 0x7c, 0x76, 0xff, 0xc9, 0x78, 0x6d, 0xff,
- 0xbb, 0x6a, 0x5d, 0xff, 0xb3, 0x5a, 0x52, 0xff, 0x9f, 0x4b, 0x47, 0xff,
- 0x78, 0x45, 0x35, 0xff, 0x5f, 0x3c, 0x28, 0xfa, 0x53, 0x5a, 0x38, 0x24,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xa1, 0x54, 0x4d, 0x8c, 0xcf, 0x8e, 0x89, 0xff, 0xe3, 0xb1, 0xae, 0xff,
- 0xd8, 0x94, 0x8e, 0xff, 0xd3, 0x8a, 0x82, 0xff, 0xcf, 0x80, 0x76, 0xff,
- 0xc4, 0x75, 0x67, 0xff, 0xb7, 0x6c, 0x5c, 0xff, 0xab, 0x5e, 0x51, 0xff,
- 0x9c, 0x4c, 0x46, 0xff, 0x7e, 0x4a, 0x3a, 0xff, 0x5c, 0x3c, 0x26, 0xff,
- 0x58, 0x3d, 0x28, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xa2, 0x59, 0x4f, 0xc3, 0xcd, 0x8e, 0x88, 0xff,
- 0xd3, 0x93, 0x8c, 0xff, 0xd0, 0x8c, 0x83, 0xff, 0xcc, 0x84, 0x79, 0xff,
- 0xc7, 0x7c, 0x6e, 0xff, 0xbc, 0x73, 0x61, 0xff, 0xb1, 0x6b, 0x59, 0xff,
- 0xa3, 0x5f, 0x4f, 0xff, 0x93, 0x50, 0x44, 0xff, 0x78, 0x48, 0x35, 0xff,
- 0x59, 0x3b, 0x25, 0xff, 0x4f, 0x3d, 0x28, 0x4f, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9b, 0x5b, 0x4d, 0xbc,
- 0xbd, 0x7e, 0x72, 0xff, 0xc6, 0x86, 0x7a, 0xff, 0xc5, 0x7f, 0x72, 0xff,
- 0xc2, 0x7b, 0x6c, 0xff, 0xbf, 0x77, 0x63, 0xff, 0xb7, 0x72, 0x5b, 0xff,
- 0xa9, 0x6b, 0x53, 0xff, 0x9a, 0x60, 0x4b, 0xff, 0x8b, 0x56, 0x41, 0xff,
- 0x6a, 0x44, 0x2e, 0xff, 0x53, 0x38, 0x21, 0xfd, 0x42, 0x4b, 0x2e, 0x1a,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x8e, 0x57, 0x48, 0x6e, 0xa6, 0x6b, 0x5a, 0xff, 0xb3, 0x74, 0x62, 0xff,
- 0xb8, 0x75, 0x61, 0xff, 0xba, 0x76, 0x61, 0xff, 0xb7, 0x74, 0x5c, 0xff,
- 0xae, 0x6e, 0x54, 0xff, 0x9f, 0x67, 0x4c, 0xff, 0x90, 0x5d, 0x43, 0xff,
- 0x79, 0x4d, 0x38, 0xff, 0x5c, 0x3d, 0x25, 0xff, 0x50, 0x39, 0x23, 0xb8,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x78, 0x52, 0x43, 0x07, 0x92, 0x5c, 0x47, 0xdc,
- 0x9e, 0x64, 0x4e, 0xff, 0xa8, 0x6b, 0x52, 0xff, 0xaa, 0x6d, 0x53, 0xff,
- 0xa7, 0x6d, 0x50, 0xff, 0x9c, 0x67, 0x4a, 0xff, 0x8e, 0x5d, 0x41, 0xff,
- 0x7d, 0x54, 0x3a, 0xff, 0x6a, 0x4b, 0x32, 0xff, 0x51, 0x39, 0x23, 0xff,
- 0x28, 0x20, 0x12, 0x77, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x6f, 0x4a, 0x37, 0x2a, 0x81, 0x54, 0x3d, 0xec, 0x8b, 0x5a, 0x41, 0xff,
- 0x8b, 0x5a, 0x3f, 0xff, 0x85, 0x56, 0x3c, 0xff, 0x7d, 0x52, 0x38, 0xff,
- 0x77, 0x51, 0x33, 0xff, 0x6f, 0x4e, 0x34, 0xff, 0x5f, 0x45, 0x2c, 0xff,
- 0x2e, 0x21, 0x14, 0xff, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x92,
- 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x11, 0x0b, 0x08, 0xb4,
- 0x50, 0x37, 0x25, 0xfe, 0x6d, 0x49, 0x2f, 0xff, 0x52, 0x37, 0x22, 0xff,
- 0x50, 0x37, 0x21, 0xff, 0x66, 0x45, 0x2b, 0xff, 0x60, 0x46, 0x2c, 0xff,
- 0x2d, 0x22, 0x16, 0xff, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xd2,
- 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
- 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x64, 0x09, 0x0a, 0x07, 0xa4,
- 0x00, 0x00, 0x00, 0xbd, 0x00, 0x00, 0x00, 0xbe, 0x00, 0x00, 0x00, 0xc4,
- 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x9d, 0x00, 0x00, 0x00, 0x6c,
- 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0d,
- 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06,
- 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00
-};
+/* GdkPixbuf RGBA C-Source image dump */
+
+static const guint8 apple[] =
+{ ""
+ /* Pixbuf magic (0x47646b50) */
+ "GdkP"
+ /* length: header (24) + pixel_data (2304) */
+ "\0\0\11\30"
+ /* pixdata_type (0x1010002) */
+ "\1\1\0\2"
+ /* rowstride (96) */
+ "\0\0\0`"
+ /* width (24) */
+ "\0\0\0\30"
+ /* height (24) */
+ "\0\0\0\30"
+ /* pixel_data: */
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\26\24"
+ "\17\11\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0`m"
+ "[pn{a\344hv_\345_k[`\0\0\0\0\0\0\0\0\0\0\0\0D>/\305\0\0\0_\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0`l[Blza\373s\202d\354w\206g\372p~c"
+ "\374`l[y\0\0\0\0[S\77/\27\25\17\335\0\0\0\20\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0`l\\\20iw_\356y\211h\373x\207g\364~\216i\364u\204e\366gt"
+ "_\374^jX\241A;-_\0\0\0~\0\0\0\0SM4)SM21B9&\22\320\270\204\1\320\270\204"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0eq"
+ "]\212r\200c\366v\205f\371jx_\323_kY\232_kZH^jY\26]iW\211@G9\272:6%j\220"
+ "\211]\320\221\211`\377\212\203Z\377~xP\377mkE\331]^;|/0\37\21\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ly`\40p~b\360lz`\353^kY\246["
+ "eT<\216\200Z\203\227\211_\354\234\217c\377\232\217b\362\232\220c\337"
+ "\243\233k\377\252\241p\377\250\236p\377\241\225h\377\231\214_\377\210"
+ "\202U\377srI\377[]:\355KO0U\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0i"
+ "v^\200`lY\211^jY\"\0\0\0\0\221\204\\\273\250\233r\377\302\267\224\377"
+ "\311\300\237\377\272\256\204\377\271\256\177\377\271\257\200\377\267"
+ "\260\177\377\260\251x\377\250\236l\377\242\225e\377\226\213]\377~zP\377"
+ "ff@\377QT5\377LR2d\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0]iW(\0\0\0\0\0\0\0"
+ "\0\213\203[v\253\240t\377\334\326\301\377\344\340\317\377\321\312\253"
+ "\377\303\271\217\377\300\270\213\377\277\267\210\377\272\264\203\377"
+ "\261\255z\377\250\242n\377\243\232h\377\232\220`\377\210\202V\377nnE"
+ "\377SW6\377RX6\364Za<\34\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0b]@\20"
+ "\234\222e\362\304\274\232\377\337\333\306\377\332\325\273\377\311\302"
+ "\232\377\312\303\236\377\301\273\216\377\300\271\212\377\270\264\200"
+ "\377\256\253v\377\246\243n\377\236\232h\377\230\220`\377\213\203V\377"
+ "wvL\377X]:\377KR0\377NU5v\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\212"
+ "\203Zl\242\234l\377\321\315\260\377\331\324\271\377\320\313\251\377\307"
+ "\301\232\377\303\276\224\377\300\272\214\377\274\267\206\377\264\260"
+ "|\377\253\251s\377\244\243n\377\232\230e\377\223\216^\377\207\200U\377"
+ "ttJ\377[_<\377HO/\377GN0\200\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\210\204Y\240\245\237o\377\316\310\253\377\310\303\237\377\304\300\230"
+ "\377\303\277\225\377\277\272\216\377\274\270\210\377\266\263\200\377"
+ "\256\254v\377\247\246p\377\237\236j\377\227\226d\377\215\212[\377\203"
+ "\177T\377qsH\377X]8\377FN.\377DK-\200\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\207\204X\257\244\240o\377\300\275\231\377\301\275\226\377\274"
+ "\270\213\377\274\270\214\377\267\264\205\377\264\262\200\377\260\256"
+ "z\377\251\251s\377\243\244n\377\231\232g\377\220\222`\377\210\211Y\377"
+ "|}Q\377hlC\377PU3\377CK,\377DL/Y\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\205\204X\220\232\230h\377\261\260\204\377\266\264\212\377\261\260"
+ "\201\377\263\260\200\377\260\257}\377\256\256x\377\253\254t\377\244\246"
+ "o\377\233\236i\377\221\224b\377\211\214\\\377\202\204V\377txM\377]b>"
+ "\377HP0\377@H+\373CJ-\25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0xxO>"
+ "\215\215_\377\237\237r\377\247\247x\377\247\247t\377\252\252w\377\252"
+ "\252u\377\252\253t\377\243\246o\377\235\240j\377\223\230c\377\213\217"
+ "]\377\201\206V\377x}P\377gkD\377RY5\377BI,\377AI,\262\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\202\205W\312\216\220`\377\230"
+ "\232g\377\234\236i\377\236\241l\377\241\244n\377\240\244m\377\232\237"
+ "i\377\223\230c\377\212\221]\377\200\210W\377v|P\377jnG\377Za>\377HP2"
+ "\377=D)\377HQ1:\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0wzQ6\177\201U\371\206\211Z\377\216\222`\377\220\225a\377\220\225b\377"
+ "\220\226a\377\213\221_\377\204\213Z\377{\203R\377ryN\377iqH\377^fA\377"
+ "R[;\377BJ-\3778@'\317\0\0\0>\0\0\0\36\0\0\0\7\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0ptJTw|Q\371z\177R\377}\202T\377|\203T\377z\200"
+ "R\377v|O\377pwL\377jpF\377dlB\377`hB\377Yb@\377LT6\377<C*\377\11\12\6"
+ "\376\0\0\0\347\0\0\0\262\0\0\0Y\0\0\0\32\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\\`=UgnE\370hnG\377gmE\377djB\377]d>\377[c<\377Y"
+ "b<\377Zc>\377V_>\377OW8\377BK/\377\16\20\12\377\0\0\0\377\0\0\0\377\0"
+ "\0\0\374\0\0\0\320\0\0\0I\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\1\0\0\0\40\22\24\15\260@D+\377W`;\377OV5\377.3\36\377.3\37\377IP0"
+ "\377RZ7\377PZ8\3776=&\377\14\15\10\377\0\0\0\377\0\0\0\377\0\0\0\377"
+ "\0\0\0\347\0\0\0\217\0\0\0""4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\20\0\0\0P\0\0\0\252\7\10\5\346\7\7\5\375\0\0\0\377\0\0"
+ "\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\377\0\0\0\374\0"
+ "\0\0\336\0\0\0\254\0\0\0i\0\0\0""2\0\0\0\10\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\11\0\0\0\40\0\0\0D\0\0\0m\0\0\0"
+ "\226\0\0\0\234\0\0\0\234\0\0\0\244\0\0\0\246\0\0\0\232\0\0\0\202\0\0"
+ "\0i\0\0\0T\0\0\0,\0\0\0\15\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+ "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0\6\0\0\0"
+ "\16\0\0\0\22\0\0\0\24\0\0\0\23\0\0\0\17\0\0\0\14\0\0\0\13\0\0\0\10\0"
+ "\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"};
static void
{ "/_Preferences/Shape/_Rectangle", NULL, gtk_ifactory_cb, 0, "/Preferences/Shape/Square" },
{ "/_Preferences/Shape/_Oval", NULL, gtk_ifactory_cb, 0, "/Preferences/Shape/Rectangle" },
{ "/_Preferences/Shape/_Image", NULL, gtk_ifactory_cb, 0, "<ImageItem>", apple },
+ { "/_Preferences/Coffee", NULL, gtk_ifactory_cb, 0, "<CheckItem>" },
+ { "/_Preferences/Toast", NULL, gtk_ifactory_cb, 0, "<CheckItem>" },
+ { "/_Preferences/Marshmallow Froot Loops", NULL, gtk_ifactory_cb, 0, "<CheckItem>" },
/* For testing deletion of menus */
{ "/_Preferences/Should_NotAppear", NULL, 0, 0, "<Branch>" },
"/Preferences/Shape/Oval")),
TRUE);
+ /* preselect /Preferences/Coffee
+ */
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_item_factory_get_item (item_factory,
+ "/Preferences/Coffee")),
+ TRUE);
+
+ /* preselect /Preferences/Marshmallow Froot Loops and set it insensitive
+ */
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (gtk_item_factory_get_item (item_factory,
+ "/Preferences/Marshmallow Froot Loops")),
+ TRUE);
+ gtk_widget_set_sensitive (GTK_WIDGET (gtk_item_factory_get_item (item_factory,
+ "/Preferences/Marshmallow Froot Loops")),
+ FALSE);
+
/* Test how tooltips (ugh) work on menu items
*/
tooltips = gtk_tooltips_new ();
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic ("Button 2 (_A)");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
- button = gtk_button_new_with_mnemonic ("Button 3 (_ф)");
+ button = gtk_button_new_with_mnemonic ("Button 3 (_\321\204)");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
- button = gtk_button_new_with_mnemonic ("Button 4 (_Ф)");
+ button = gtk_button_new_with_mnemonic ("Button 4 (_\320\244)");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic ("Button 6 (_b)");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
GdkScreen *screen = gtk_widget_get_screen (widget);
make_message_dialog (screen, &info, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, GTK_RESPONSE_OK);
- make_message_dialog (screen, &warning, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, GTK_RESPONSE_OK);
+ make_message_dialog (screen, &warning, GTK_MESSAGE_WARNING, GTK_BUTTONS_CLOSE, GTK_RESPONSE_CLOSE);
make_message_dialog (screen, &error, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK_CANCEL, GTK_RESPONSE_OK);
- make_message_dialog (screen, &question, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, GTK_RESPONSE_YES);
+ make_message_dialog (screen, &question, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, GTK_RESPONSE_NO);
}
/*
gtk_box_pack_start (GTK_BOX (box2), hbox, TRUE, TRUE, 0);
entry = gtk_entry_new ();
- gtk_entry_set_text (GTK_ENTRY (entry), "hello world السلام عليكم");
+ gtk_entry_set_text (GTK_ENTRY (entry), "hello world \330\247\331\204\330\263\331\204\330\247\331\205 \330\271\331\204\331\212\331\203\331\205");
gtk_editable_select_region (GTK_EDITABLE (entry), 0, 5);
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
gtk_widget_destroy (window);
}
+/* GtkEventBox */
+
+
+static void
+event_box_label_pressed (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data)
+{
+ g_print ("clicked on event box\n");
+}
+
+static void
+event_box_button_clicked (GtkWidget *widget,
+ GtkWidget *button,
+ gpointer user_data)
+{
+ g_print ("pushed button\n");
+}
+
+static void
+event_box_toggle_visible_window (GtkWidget *checkbutton,
+ GtkEventBox *event_box)
+{
+ gtk_event_box_set_visible_window (event_box,
+ GTK_TOGGLE_BUTTON(checkbutton)->active);
+}
+
+static void
+event_box_toggle_above_child (GtkWidget *checkbutton,
+ GtkEventBox *event_box)
+{
+ gtk_event_box_set_above_child (event_box,
+ GTK_TOGGLE_BUTTON(checkbutton)->active);
+}
+
+static void
+create_event_box (GtkWidget *widget)
+{
+ static GtkWidget *window = NULL;
+ GtkWidget *box1;
+ GtkWidget *box2;
+ GtkWidget *hbox;
+ GtkWidget *vbox;
+ GtkWidget *button;
+ GtkWidget *separator;
+ GtkWidget *event_box;
+ GtkWidget *label;
+ GtkWidget *visible_window_check;
+ GtkWidget *above_child_check;
+ GdkColor color;
+
+ if (!window)
+ {
+ color.red = 0;
+ color.blue = 65535;
+ color.green = 0;
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_screen (GTK_WINDOW (window),
+ gtk_widget_get_screen (widget));
+
+ g_signal_connect (window, "destroy",
+ G_CALLBACK (gtk_widget_destroyed),
+ &window);
+
+ gtk_window_set_title (GTK_WINDOW (window), "event box");
+ gtk_container_set_border_width (GTK_CONTAINER (window), 0);
+
+ box1 = gtk_vbox_new (FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (window), box1);
+ gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &color);
+
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (box1), hbox, TRUE, FALSE, 0);
+
+ event_box = gtk_event_box_new ();
+ gtk_box_pack_start (GTK_BOX (hbox), event_box, TRUE, FALSE, 0);
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (event_box), vbox);
+ g_signal_connect (event_box, "button_press_event",
+ G_CALLBACK (event_box_label_pressed),
+ NULL);
+
+ label = gtk_label_new ("Click on this label");
+ gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, FALSE, 0);
+
+ button = gtk_button_new_with_label ("button in eventbox");
+ gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, FALSE, 0);
+ g_signal_connect (button, "clicked",
+ G_CALLBACK (event_box_button_clicked),
+ NULL);
+
+
+ visible_window_check = gtk_check_button_new_with_label("Visible Window");
+ gtk_box_pack_start (GTK_BOX (box1), visible_window_check, FALSE, TRUE, 0);
+ g_signal_connect (visible_window_check, "toggled",
+ G_CALLBACK (event_box_toggle_visible_window), event_box);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (visible_window_check), FALSE);
+
+ above_child_check = gtk_check_button_new_with_label("Above Child");
+ gtk_box_pack_start (GTK_BOX (box1), above_child_check, FALSE, TRUE, 0);
+ g_signal_connect (above_child_check, "toggled",
+ G_CALLBACK (event_box_toggle_above_child), event_box);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (above_child_check), FALSE);
+
+ separator = gtk_hseparator_new ();
+ gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
+
+ box2 = gtk_vbox_new (FALSE, 10);
+ gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
+ gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);
+
+ button = gtk_button_new_with_label ("close");
+ g_signal_connect_swapped (button, "clicked",
+ G_CALLBACK (gtk_widget_destroy),
+ window);
+ gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
+ GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
+ gtk_widget_grab_default (button);
+ }
+
+ if (!GTK_WIDGET_VISIBLE (window))
+ gtk_widget_show_all (window);
+ else
+ gtk_widget_destroy (window);
+}
+
+
/*
* GtkSizeGroup
*/
G_CALLBACK (spin_button_time_output_func),
NULL);
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE);
- gtk_widget_set_size_request (spinner, 55, -1);
+ gtk_entry_set_width_chars (GTK_ENTRY (spinner), 5);
gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0);
vbox2 = gtk_vbox_new (FALSE, 0);
G_CALLBACK (spin_button_month_output_func),
NULL);
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE);
- gtk_widget_set_size_request (spinner, 85, -1);
+ gtk_entry_set_width_chars (GTK_ENTRY (spinner), 9);
gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0);
vbox2 = gtk_vbox_new (FALSE, 0);
G_CALLBACK (spin_button_hex_output_func),
NULL);
gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spinner), TRUE);
- gtk_widget_set_size_request (spinner, 55, -1);
+ gtk_entry_set_width_chars (GTK_ENTRY (spinner), 4);
gtk_box_pack_start (GTK_BOX (vbox2), spinner, FALSE, TRUE, 0);
frame = gtk_frame_new ("Accelerated");
GTK_POLICY_AUTOMATIC);
list = gtk_list_new ();
- gtk_list_set_selection_mode (GTK_LIST (list), GTK_SELECTION_EXTENDED);
+ gtk_list_set_selection_mode (GTK_LIST (list), GTK_SELECTION_SINGLE);
gtk_scrolled_window_add_with_viewport
(GTK_SCROLLED_WINDOW (scrolled_win), list);
gtk_container_set_focus_vadjustment
if (!window)
{
- GtkWidget *options_hbox;
- GtkWidget *check_button;
+ GtkWidget *picker;
+ GtkWidget *hbox;
+ GtkWidget *label;
- window = gtk_color_selection_dialog_new ("color selection dialog");
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (widget));
- gtk_widget_show (GTK_COLOR_SELECTION_DIALOG (window)->help_button);
-
- gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE);
-
g_signal_connect (window, "destroy",
- G_CALLBACK(gtk_widget_destroyed),
+ G_CALLBACK (gtk_widget_destroyed),
&window);
- options_hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), options_hbox, FALSE, FALSE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (options_hbox), 10);
-
- check_button = gtk_check_button_new_with_label ("Show Opacity");
- gtk_box_pack_start (GTK_BOX (options_hbox), check_button, FALSE, FALSE, 0);
- g_signal_connect (check_button, "toggled",
- G_CALLBACK (opacity_toggled_cb), window);
-
- check_button = gtk_check_button_new_with_label ("Show Palette");
- gtk_box_pack_end (GTK_BOX (options_hbox), check_button, FALSE, FALSE, 0);
- g_signal_connect (check_button, "toggled",
- G_CALLBACK (palette_toggled_cb), window);
-
- g_signal_connect (GTK_COLOR_SELECTION_DIALOG (window)->colorsel,
- "color_changed",
- G_CALLBACK (color_selection_changed),
- window);
+ gtk_window_set_title (GTK_WINDOW (window), "GtkColorButton");
+ gtk_container_set_border_width (GTK_CONTAINER (window), 0);
- g_signal_connect (GTK_COLOR_SELECTION_DIALOG (window)->ok_button,
- "clicked",
- G_CALLBACK (color_selection_ok),
- window);
+ hbox = gtk_hbox_new (FALSE, 8);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
+ gtk_container_add (GTK_CONTAINER (window), hbox);
+
+ label = gtk_label_new ("Pick a color");
+ gtk_container_add (GTK_CONTAINER (hbox), label);
- g_signal_connect_swapped (GTK_COLOR_SELECTION_DIALOG (window)->cancel_button,
- "clicked",
- G_CALLBACK (gtk_widget_destroy),
- window);
+ picker = gtk_color_button_new ();
+ gtk_color_button_set_use_alpha (GTK_COLOR_BUTTON (picker), TRUE);
+ gtk_container_add (GTK_CONTAINER (hbox), picker);
}
if (!GTK_WIDGET_VISIBLE (window))
if (!window)
{
- window = gtk_font_selection_dialog_new ("Font Selection Dialog");
+ GtkWidget *picker;
+ GtkWidget *hbox;
+ GtkWidget *label;
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (widget));
- gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_MOUSE);
-
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&window);
- g_signal_connect (GTK_FONT_SELECTION_DIALOG (window)->ok_button,
- "clicked", G_CALLBACK (font_selection_ok),
- GTK_FONT_SELECTION_DIALOG (window));
- g_signal_connect_swapped (GTK_FONT_SELECTION_DIALOG (window)->cancel_button,
- "clicked", G_CALLBACK (gtk_widget_destroy),
- window);
+ gtk_window_set_title (GTK_WINDOW (window), "GtkFontButton");
+ gtk_container_set_border_width (GTK_CONTAINER (window), 0);
+
+ hbox = gtk_hbox_new (FALSE, 8);
+ gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
+ gtk_container_add (GTK_CONTAINER (window), hbox);
+
+ label = gtk_label_new ("Pick a font");
+ gtk_container_add (GTK_CONTAINER (hbox), label);
+
+ picker = gtk_font_button_new ();
+ gtk_font_button_set_use_font (GTK_FONT_BUTTON (picker), TRUE);
+ gtk_container_add (GTK_CONTAINER (hbox), picker);
}
if (!GTK_WIDGET_VISIBLE (window))
- gtk_widget_show (window);
+ gtk_widget_show_all (window);
else
gtk_widget_destroy (window);
}
notebook_homogeneous (GtkToggleButton *button,
GtkNotebook *notebook)
{
- g_object_set (G_OBJECT (notebook), "homogeneous", button->active, NULL);
+ g_object_set (notebook, "homogeneous", button->active, NULL);
}
static void
void
toggle_resize (GtkWidget *widget, GtkWidget *child)
{
- GtkPaned *paned = GTK_PANED (child->parent);
- gboolean is_child1 = (child == paned->child1);
- gboolean resize, shrink;
-
- resize = is_child1 ? paned->child1_resize : paned->child2_resize;
- shrink = is_child1 ? paned->child1_shrink : paned->child2_shrink;
-
- gtk_widget_ref (child);
- gtk_container_remove (GTK_CONTAINER (child->parent), child);
- if (is_child1)
- gtk_paned_pack1 (paned, child, !resize, shrink);
- else
- gtk_paned_pack2 (paned, child, !resize, shrink);
- gtk_widget_unref (child);
+ GtkContainer *container = GTK_CONTAINER (gtk_widget_get_parent (child));
+ GValue value = { 0, };
+ g_value_init (&value, G_TYPE_BOOLEAN);
+ gtk_container_child_get_property (container, child, "resize", &value);
+ g_value_set_boolean (&value, !g_value_get_boolean (&value));
+ gtk_container_child_set_property (container, child, "resize", &value);
}
void
toggle_shrink (GtkWidget *widget, GtkWidget *child)
{
- GtkPaned *paned = GTK_PANED (child->parent);
- gboolean is_child1 = (child == paned->child1);
- gboolean resize, shrink;
-
- resize = is_child1 ? paned->child1_resize : paned->child2_resize;
- shrink = is_child1 ? paned->child1_shrink : paned->child2_shrink;
-
- gtk_widget_ref (child);
- gtk_container_remove (GTK_CONTAINER (child->parent), child);
- if (is_child1)
- gtk_paned_pack1 (paned, child, resize, !shrink);
- else
- gtk_paned_pack2 (paned, child, resize, !shrink);
- gtk_widget_unref (child);
+ GtkContainer *container = GTK_CONTAINER (gtk_widget_get_parent (child));
+ GValue value = { 0, };
+ g_value_init (&value, G_TYPE_BOOLEAN);
+ gtk_container_child_get_property (container, child, "shrink", &value);
+ g_value_set_boolean (&value, !g_value_get_boolean (&value));
+ gtk_container_child_set_property (container, child, "shrink", &value);
}
static void
"maximized" : "not maximized", ", ",
(event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN) ?
"fullscreen" : "not fullscreen",
+ (event->new_window_state & GDK_WINDOW_STATE_ABOVE) ?
+ "above" : "not above", ", ",
+ (event->new_window_state & GDK_WINDOW_STATE_BELOW) ?
+ "below" : "not below", ", ",
NULL);
gtk_label_set_text (GTK_LABEL (label), msg);
return hbox;
}
+void
+keep_window_above (GtkToggleButton *togglebutton, gpointer data)
+{
+ GtkWidget *button = g_object_get_data (G_OBJECT (togglebutton), "radio");
+
+ gtk_window_set_keep_above (GTK_WINDOW (data),
+ gtk_toggle_button_get_active (togglebutton));
+
+ if (gtk_toggle_button_get_active (togglebutton))
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE);
+}
+
+void
+keep_window_below (GtkToggleButton *togglebutton, gpointer data)
+{
+ GtkWidget *button = g_object_get_data (G_OBJECT (togglebutton), "radio");
+
+ gtk_window_set_keep_below (GTK_WINDOW (data),
+ gtk_toggle_button_get_active (togglebutton));
+
+ if (gtk_toggle_button_get_active (togglebutton))
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE);
+}
+
+
static GtkWidget*
get_state_controls (GtkWidget *window)
{
GtkWidget *vbox;
GtkWidget *button;
+ GtkWidget *button_above;
+ GtkWidget *button_below;
vbox = gtk_vbox_new (FALSE, 0);
window,
G_CONNECT_SWAPPED);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
-
+
+ button_above = gtk_toggle_button_new_with_label ("Keep above");
+ g_signal_connect (button_above,
+ "toggled",
+ G_CALLBACK (keep_window_above),
+ window);
+ gtk_box_pack_start (GTK_BOX (vbox), button_above, FALSE, FALSE, 0);
+
+ button_below = gtk_toggle_button_new_with_label ("Keep below");
+ g_signal_connect (button_below,
+ "toggled",
+ G_CALLBACK (keep_window_below),
+ window);
+ gtk_box_pack_start (GTK_BOX (vbox), button_below, FALSE, FALSE, 0);
+
+ g_object_set_data (G_OBJECT (button_above), "radio", button_below);
+ g_object_set_data (G_OBJECT (button_below), "radio", button_above);
+
button = gtk_button_new_with_label ("Hide (withdraw)");
g_signal_connect_object (button,
"clicked",
allow_shrink_callback (GtkWidget *widget,
gpointer data)
{
- g_object_set (G_OBJECT (g_object_get_data (data, "target")),
+ g_object_set (g_object_get_data (data, "target"),
"allow_shrink",
GTK_TOGGLE_BUTTON (widget)->active,
NULL);
allow_grow_callback (GtkWidget *widget,
gpointer data)
{
- g_object_set (G_OBJECT (g_object_get_data (data, "target")),
+ g_object_set (g_object_get_data (data, "target"),
"allow_grow",
GTK_TOGGLE_BUTTON (widget)->active,
NULL);
struct {
char *label;
- void (*func) ();
+ void (*func) (GtkWidget *widget);
gboolean do_not_benchmark;
} buttons[] =
{
+#ifdef G_OS_WIN32
+ /* dog slow on NT, no working at all on 9x */
+ { "big windows", create_big_windows, TRUE },
+#else
{ "big windows", create_big_windows },
+#endif
{ "button box", create_button_box },
{ "buttons", create_buttons },
{ "check buttons", create_check_buttons },
{ "color selection", create_color_selection },
{ "ctree", create_ctree },
{ "cursors", create_cursors },
- { "dialog", create_dialog },
- { "display & screen", create_display_screen },
+ { "dialog", create_dialog, TRUE },
+ { "display & screen", create_display_screen, TRUE },
{ "entry", create_entry },
+ { "event box", create_event_box },
{ "event watcher", create_event_watcher },
{ "file selection", create_file_selection },
{ "flipping", create_flipping },
{ "focus", create_focus },
{ "font selection", create_font_selection },
{ "gamma curve", create_gamma_curve, TRUE },
- { "gridded geometry", create_gridded_geometry, TRUE },
+ { "gridded geometry", create_gridded_geometry },
{ "handle box", create_handle_box },
{ "image from drawable", create_get_image },
{ "image", create_image },
{ "range controls", create_range_controls },
{ "rc file", create_rc_file },
{ "reparent", create_reparent },
+ { "resize grips", create_resize_grips },
{ "rulers", create_rulers },
{ "saved position", create_saved_position },
{ "scrolled windows", create_scrolled_windows },
if (g_file_test ("../gdk-pixbuf/libpixbufloader-pnm.la",
G_FILE_TEST_EXISTS))
{
- putenv ("GDK_PIXBUF_MODULE_FILE=../gdk-pixbuf/gdk-pixbuf.loaders");
- putenv ("GTK_IM_MODULE_FILE=../modules/input/gtk.immodules");
+ g_setenv ("GDK_PIXBUF_MODULE_FILE", "../gdk-pixbuf/gdk-pixbuf.loaders", TRUE);
+ g_setenv ("GTK_IM_MODULE_FILE", "../modules/input/gtk.immodules", TRUE);
}
}
}
static void
-bench_iteration (void (* fn) ())
+bench_iteration (GtkWidget *widget, void (* fn) (GtkWidget *widget))
{
- fn (); /* on */
+ fn (widget); /* on */
while (g_main_context_iteration (NULL, FALSE));
- fn (); /* off */
+ fn (widget); /* off */
while (g_main_context_iteration (NULL, FALSE));
}
void
-do_real_bench (void (* fn) (), char *name, int num)
+do_real_bench (GtkWidget *widget, void (* fn) (GtkWidget *widget), char *name, int num)
{
GTimeVal tv0, tv1;
double dt_first;
}
g_get_current_time (&tv0);
- bench_iteration (fn);
+ bench_iteration (widget, fn);
g_get_current_time (&tv1);
dt_first = ((double)tv1.tv_sec - tv0.tv_sec) * 1000.0
g_get_current_time (&tv0);
for (n = 0; n < num - 1; n++)
- bench_iteration (fn);
+ bench_iteration (widget, fn);
g_get_current_time (&tv1);
dt = ((double)tv1.tv_sec - tv0.tv_sec) * 1000.0
+ (tv1.tv_usec - tv0.tv_usec) / 1000.0;
do_bench (char* what, int num)
{
int i;
- void (* fn) ();
+ GtkWidget *widget;
+ void (* fn) (GtkWidget *widget);
fn = NULL;
+ widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
if (g_ascii_strcasecmp (what, "ALL") == 0)
{
for (i = 0; i < nbuttons; i++)
{
if (!buttons[i].do_not_benchmark)
- do_real_bench (buttons[i].func, buttons[i].label, num);
+ do_real_bench (widget, buttons[i].func, buttons[i].label, num);
}
return;
if (!fn)
g_print ("Can't bench: \"%s\" not found.\n", what);
else
- do_real_bench (fn, buttons[i].label, num);
+ do_real_bench (widget, fn, buttons[i].label, num);
}
}
if (file_exists ("testgtkrc"))
gtk_rc_add_default_file ("testgtkrc");
+ g_set_application_name ("GTK+ Test Program");
+
gtk_init (&argc, &argv);
/* benchmarking