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$nR@$$D$R@$D$R@D$<$D$R@D$($D$Q@$D$R@D$8$D$Q@D$,n$D$R@\$D$R@D$0HL$84$D$Q@D$4L$l$4$D$Q@T$<4$T$D$4$L$0D$ $T$($0D$,l$ D$D$D$`@D$R@$PT$($|$ D$D$@D$R@$|$ ,$D$D$@D$R@|$,$F4$~\$`L[^_]&'D$D$vUWVSt$0D$D$R@$$D$R@$D$R@l$lj4$|$4$\$0[^_]Jv'WVS\$$t$ -lj$[<$D$ D$D$R@\$$t$ [^_t&SD$($htv'[$su[Ð$A@9Ð%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%rK%|rK%xrK%trK%prK%lrK%hrK%drK%`rK%\rK%XrK%TrK%sK%sK% sK%sK%sK%sK%rK%rK%rK%rK%rK%rK%LsK%HsK%DsK%@sK%3.16.6%s, Running against GTK+ %d.%d.%dAbout GTK+ Code Demostitlegtk3-demologo-icon-namedocumentersauthorsProgram to demonstrate GTK+ functions.commentshttp://www.gtk.orgwebsitelicense-type(C) 1997-2013 The GTK+ TeamcopyrightversionGTK+ Code Demosprogram-namemessageinfobarYou activated radio action: "%s". Current value: %sCursor at row %d column %d - %d chars in documentApplication Classdocument-open/application/application.uigridcontentsstatusbuttonmenutooltoolmenuclickedchangedmark-set/application/menus.uiappmenumenubargtk-application-prefer-dark-themeorg.gtk.Demo2org.gtk.Democolorstartupactivatetitlebarfalseshapes'oval'boldaboutfile1logonewopensavesave-asquitdarkGVariant (~  #$$'(+++,,----...12355566789=@ABBDDDDEEFGGHHIJKNNOPPQRSSTUWWYZ[\\]^_`acceghikkmnoqssuuwzz{{|cQ L k vILv:ȢBr : v:dyI{ d v(d>ww? >w vPw QLBLv0|v:QLl'l vxn:  v pK v3XtwvexwvкO: v'ۑL'v88C8 8v(8&@GA &@ v0@JF9JvJva{va vaoe& o vo}v(y\:Q(L04CEC= 4vHLv0? v* *v@+N  v |1"  v+sQ+L,,1Q, L, ,Q ,L0,8,Kp 8, vH,8= 8 v8fD֢Nf vfNW^ N vXG[[x GvPY4H Y vhV9csVvh&Xǣj&v&KK v(Kٲ  ٲvL"_ v 8  v xY wQx Lx x4}K xv0xezN@NwezvxzK_LKv`rz  v(b{ vvd^  v"( " v0|,D6Lv$L v v  v %x|Q%L%%+ %v&H 9r_H vHP||P vP^n` ^v^Fc] FcvXchd6S hvhCqOu C vP OQL| vUE vmF.2|mv-x v `.Gڔ `. vp.b8wbv(boFovo;}2 ;}vP}%  vQ Ll!Q L0lw0v@LQL̷зo) з v;,- vgԵgLhy_ v)I vII^ I vXaG?aG vpGgwv9jv/` v(j.V' j. vx.)8rA)8v08iڲ i vi3_ v,, ,vHj; j vxdxpQdLt(  v ؍L v  KNw v % 0 % v% 6 V 6 v6 qM ̖ qM vM c jSwc vc r +Lr vr  |1  v  [m v 8 ȁQ8 LD L Y L vX V V v` `P_ v    v    v 3  3 v3 w Lm w v(w Ђ .wЂ v c5pQ L  v # v f WLf vx  cQ L @ `Sx @ vP R(L v $ 6$ v0  Q L  O{Q L $ L$ v8  application/imenus.ui
_New app.new <Primary>n _Open app.open _Save app.save <Primary>s Save _As... app.save-as <Primary>s
_Quit app.quit <Primary>q
_Preferences
_Prefer Dark Theme app.dark _Hide Titlebar when maximized win.titlebar _Color
_Red app.color red <Primary>r _Green app.color green <Primary>g _Blue app.color blue <Primary>b
_Shape
_Square win.shape square <Primary>s _Rectangle win.shape rectangle <Primary>r _Oval win.shape oval <Primary>o
_Bold win.bold <Primary>b
_Help _About win.about <Primary>a
(uuay)gtk.css/* You can edit the text in this window to change the * appearance of this Window. * Be careful, if you screw it up, nothing might be visible * anymore. :) */ /* This CSS resets all properties to their defaults values * and overrides all user settings and the theme in use */ @import url("resource://css_pixbufs/reset.css"); @import url("resource://css_pixbufs/cssview.css"); @keyframes move-the-image { 0% { background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%; } 3.125% { background-position: 55.19% 76.11%, 72.14% 64.79%, 76.11% 44.81%, 64.79% 27.86%, 44.81% 23.89%, 27.86% 35.21%, 23.89% 55.19%, 35.21% 72.14%, 0% 0%; } 6.25% { background-position: 60.79% 76.04%, 76.04% 60.79%, 76.04% 39.21%, 60.79% 23.96%, 39.21% 23.96%, 23.96% 39.21%, 23.96% 60.79%, 39.21% 76.04%, 0% 0%; } 9.375% { background-position: 66.46% 74.64%, 79.06% 55.78%, 74.64% 33.54%, 55.78% 20.94%, 33.54% 25.36%, 20.94% 44.22%, 25.36% 66.46%, 44.22% 79.06%, 0% 0%; } 12.5% { background-position: 71.84% 71.84%, 80.89% 50.00%, 71.84% 28.16%, 50.00% 19.11%, 28.16% 28.16%, 19.11% 50.00%, 28.16% 71.84%, 50.00% 80.89%, 0% 0%; } 15.625% { background-position: 76.55% 67.74%, 81.32% 43.77%, 67.74% 23.45%, 43.77% 18.68%, 23.45% 32.26%, 18.68% 56.23%, 32.26% 76.55%, 56.23% 81.32%, 0% 0%; } 18.75% { background-position: 80.21% 62.51%, 80.21% 37.49%, 62.51% 19.79%, 37.49% 19.79%, 19.79% 37.49%, 19.79% 62.51%, 37.49% 80.21%, 62.51% 80.21%, 0% 0%; } 21.875% { background-position: 82.54% 56.47%, 77.58% 31.57%, 56.47% 17.46%, 31.57% 22.42%, 17.46% 43.53%, 22.42% 68.43%, 43.53% 82.54%, 68.43% 77.58%, 0% 0%; } 25% { background-position: 83.33% 50.00%, 73.57% 26.43%, 50.00% 16.67%, 26.43% 26.43%, 16.67% 50.00%, 26.43% 73.57%, 50.00% 83.33%, 73.57% 73.57%, 0% 0%; } 28.125% { background-position: 82.54% 43.53%, 68.43% 22.42%, 43.53% 17.46%, 22.42% 31.57%, 17.46% 56.47%, 31.57% 77.58%, 56.47% 82.54%, 77.58% 68.43%, 0% 0%; } 31.25% { background-position: 80.21% 37.49%, 62.51% 19.79%, 37.49% 19.79%, 19.79% 37.49%, 19.79% 62.51%, 37.49% 80.21%, 62.51% 80.21%, 80.21% 62.51%, 0% 0%; } 34.375% { background-position: 76.55% 32.26%, 56.23% 18.68%, 32.26% 23.45%, 18.68% 43.77%, 23.45% 67.74%, 43.77% 81.32%, 67.74% 76.55%, 81.32% 56.23%, 0% 0%; } 37.5% { background-position: 71.84% 28.16%, 50.00% 19.11%, 28.16% 28.16%, 19.11% 50.00%, 28.16% 71.84%, 50.00% 80.89%, 71.84% 71.84%, 80.89% 50.00%, 0% 0%; } 40.625% { background-position: 66.46% 25.36%, 44.22% 20.94%, 25.36% 33.54%, 20.94% 55.78%, 33.54% 74.64%, 55.78% 79.06%, 74.64% 66.46%, 79.06% 44.22%, 0% 0%; } 43.75% { background-position: 60.79% 23.96%, 39.21% 23.96%, 23.96% 39.21%, 23.96% 60.79%, 39.21% 76.04%, 60.79% 76.04%, 76.04% 60.79%, 76.04% 39.21%, 0% 0%; } 46.875% { background-position: 55.19% 23.89%, 35.21% 27.86%, 23.89% 44.81%, 27.86% 64.79%, 44.81% 76.11%, 64.79% 72.14%, 76.11% 55.19%, 72.14% 35.21%, 0% 0%; } 50% { background-position: 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 0% 0%; } 53.125% { background-position: 45.44% 27.07%, 30.57% 37.01%, 27.07% 54.56%, 37.01% 69.43%, 54.56% 72.93%, 69.43% 62.99%, 72.93% 45.44%, 62.99% 30.57%, 0% 0%; } 56.25% { background-position: 41.65% 29.85%, 29.85% 41.65%, 29.85% 58.35%, 41.65% 70.15%, 58.35% 70.15%, 70.15% 58.35%, 70.15% 41.65%, 58.35% 29.85%, 0% 0%; } 59.375% { background-position: 38.68% 33.06%, 30.02% 46.03%, 33.06% 61.32%, 46.03% 69.98%, 61.32% 66.94%, 69.98% 53.97%, 66.94% 38.68%, 53.97% 30.02%, 0% 0%; } 62.5% { background-position: 36.49% 36.49%, 30.89% 50.00%, 36.49% 63.51%, 50.00% 69.11%, 63.51% 63.51%, 69.11% 50.00%, 63.51% 36.49%, 50.00% 30.89%, 0% 0%; } 65.625% { background-position: 34.97% 39.96%, 32.28% 53.53%, 39.96% 65.03%, 53.53% 67.72%, 65.03% 60.04%, 67.72% 46.47%, 60.04% 34.97%, 46.47% 32.28%, 0% 0%; } 68.75% { background-position: 34.02% 43.38%, 34.02% 56.62%, 43.38% 65.98%, 56.62% 65.98%, 65.98% 56.62%, 65.98% 43.38%, 56.62% 34.02%, 43.38% 34.02%, 0% 0%; } 71.875% { background-position: 33.50% 46.72%, 36.01% 59.35%, 46.72% 66.50%, 59.35% 63.99%, 66.50% 53.28%, 63.99% 40.65%, 53.28% 33.50%, 40.65% 36.01%, 0% 0%; } 75% { background-position: 33.33% 50.00%, 38.21% 61.79%, 50.00% 66.67%, 61.79% 61.79%, 66.67% 50.00%, 61.79% 38.21%, 50.00% 33.33%, 38.21% 38.21%, 0% 0%; } 78.125% { background-position: 33.50% 53.28%, 40.65% 63.99%, 53.28% 66.50%, 63.99% 59.35%, 66.50% 46.72%, 59.35% 36.01%, 46.72% 33.50%, 36.01% 40.65%, 0% 0%; } 81.25% { background-position: 34.02% 56.62%, 43.38% 65.98%, 56.62% 65.98%, 65.98% 56.62%, 65.98% 43.38%, 56.62% 34.02%, 43.38% 34.02%, 34.02% 43.38%, 0% 0%; } 84.375% { background-position: 34.97% 60.04%, 46.47% 67.72%, 60.04% 65.03%, 67.72% 53.53%, 65.03% 39.96%, 53.53% 32.28%, 39.96% 34.97%, 32.28% 46.47%, 0% 0%; } 87.5% { background-position: 36.49% 63.51%, 50.00% 69.11%, 63.51% 63.51%, 69.11% 50.00%, 63.51% 36.49%, 50.00% 30.89%, 36.49% 36.49%, 30.89% 50.00%, 0% 0%; } 90.625% { background-position: 38.68% 66.94%, 53.97% 69.98%, 66.94% 61.32%, 69.98% 46.03%, 61.32% 33.06%, 46.03% 30.02%, 33.06% 38.68%, 30.02% 53.97%, 0% 0%; } 93.75% { background-position: 41.65% 70.15%, 58.35% 70.15%, 70.15% 58.35%, 70.15% 41.65%, 58.35% 29.85%, 41.65% 29.85%, 29.85% 41.65%, 29.85% 58.35%, 0% 0%; } 96.875% { background-position: 45.44% 72.93%, 62.99% 69.43%, 72.93% 54.56%, 69.43% 37.01%, 54.56% 27.07%, 37.01% 30.57%, 27.07% 45.44%, 30.57% 62.99%, 0% 0%; } 100% { background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%; } } @keyframes size-the-image { 0% { background-size: 96px, 12px, 96px, 12px, 96px, 12px, 96px, 12px, auto } 100% { background-size: 12px, 96px, 12px, 96px, 12px, 96px, 12px, 96px, auto } } GtkWindow { background-image: url("resource://css_pixbufs/apple-red.png"), url("resource://css_pixbufs/gnome-applets.png"), url("resource://css_pixbufs/gnome-calendar.png"), url("resource://css_pixbufs/gnome-foot.png"), url("resource://css_pixbufs/gnome-gmush.png"), url("resource://css_pixbufs/gnome-gimp.png"), url("resource://css_pixbufs/gnome-gsame.png"), url("resource://css_pixbufs/gnu-keys.png"), url("resource://css_pixbufs/background.jpg"); background-position: 50.00% 75.00%, 67.68% 67.68%, 75.00% 50.00%, 67.68% 32.32%, 50.00% 25.00%, 32.32% 32.32%, 25.00% 50.00%, 32.32% 67.68%, 0% 0%; background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat; animation: move-the-image infinite linear 3s, size-the-image infinite alternate ease-in-out 0.75s; } /* Make the text editor has a nice style */ .view, .scrollbar, .pane-separator { color: black; background-color: rgba(255,255,255,0.5); } .view:selected { background-color: rgba(127,127,255,0.5); } (uuay)clipboard.ch)/* Clipboard * * GtkClipboard is used for clipboard handling. This demo shows how to * copy and paste text to and from the clipboard. * * It also shows how to transfer images via the clipboard or via * drag-and-drop, and how to make clipboard contents persist after * the application exits. Clipboard persistence requires a clipboard * manager to run. */ #include #include #include static GtkWidget *window = NULL; void copy_button_clicked (GtkWidget *button, gpointer user_data) { GtkWidget *entry; GtkClipboard *clipboard; entry = GTK_WIDGET (user_data); /* Get the clipboard object */ clipboard = gtk_widget_get_clipboard (entry, GDK_SELECTION_CLIPBOARD); /* Set clipboard text */ gtk_clipboard_set_text (clipboard, gtk_entry_get_text (GTK_ENTRY (entry)), -1); } void paste_received (GtkClipboard *clipboard, const gchar *text, gpointer user_data) { GtkWidget *entry; entry = GTK_WIDGET (user_data); /* Set the entry text */ if(text) gtk_entry_set_text (GTK_ENTRY (entry), text); } void paste_button_clicked (GtkWidget *button, gpointer user_data) { GtkWidget *entry; GtkClipboard *clipboard; entry = GTK_WIDGET (user_data); /* Get the clipboard object */ clipboard = gtk_widget_get_clipboard (entry, GDK_SELECTION_CLIPBOARD); /* Request the contents of the clipboard, contents_received will be called when we do get the contents. */ gtk_clipboard_request_text (clipboard, paste_received, entry); } static GdkPixbuf * get_image_pixbuf (GtkImage *image) { const gchar *icon_name; GtkIconSize size; GtkIconTheme *icon_theme; int width; switch (gtk_image_get_storage_type (image)) { case GTK_IMAGE_PIXBUF: return g_object_ref (gtk_image_get_pixbuf (image)); case GTK_IMAGE_ICON_NAME: gtk_image_get_icon_name (image, &icon_name, &size); icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (image))); gtk_icon_size_lookup (size, &width, NULL); return gtk_icon_theme_load_icon (icon_theme, icon_name, width, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL); default: g_warning ("Image storage type %d not handled", gtk_image_get_storage_type (image)); return NULL; } } static void drag_begin (GtkWidget *widget, GdkDragContext *context, gpointer data) { GdkPixbuf *pixbuf; pixbuf = get_image_pixbuf (GTK_IMAGE (data)); gtk_drag_set_icon_pixbuf (context, pixbuf, -2, -2); g_object_unref (pixbuf); } void drag_data_get (GtkWidget *widget, GdkDragContext *context, GtkSelectionData *selection_data, guint info, guint time, gpointer data) { GdkPixbuf *pixbuf; pixbuf = get_image_pixbuf (GTK_IMAGE (data)); gtk_selection_data_set_pixbuf (selection_data, pixbuf); g_object_unref (pixbuf); } static void drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint info, guint32 time, gpointer data) { GdkPixbuf *pixbuf; if (gtk_selection_data_get_length (selection_data) > 0) { pixbuf = gtk_selection_data_get_pixbuf (selection_data); gtk_image_set_from_pixbuf (GTK_IMAGE (data), pixbuf); g_object_unref (pixbuf); } } static void copy_image (GtkMenuItem *item, gpointer data) { GtkClipboard *clipboard; GdkPixbuf *pixbuf; clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); pixbuf = get_image_pixbuf (GTK_IMAGE (data)); gtk_clipboard_set_image (clipboard, pixbuf); g_object_unref (pixbuf); } static void paste_image (GtkMenuItem *item, gpointer data) { GtkClipboard *clipboard; GdkPixbuf *pixbuf; clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); pixbuf = gtk_clipboard_wait_for_image (clipboard); if (pixbuf) { gtk_image_set_from_pixbuf (GTK_IMAGE (data), pixbuf); g_object_unref (pixbuf); } } static gboolean button_press (GtkWidget *widget, GdkEventButton *button, gpointer data) { GtkWidget *menu; GtkWidget *item; if (button->button != GDK_BUTTON_SECONDARY) return FALSE; menu = gtk_menu_new (); item = gtk_menu_item_new_with_mnemonic (_("_Copy")); g_signal_connect (item, "activate", G_CALLBACK (copy_image), data); gtk_widget_show (item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); item = gtk_menu_item_new_with_mnemonic (_("_Paste")); g_signal_connect (item, "activate", G_CALLBACK (paste_image), data); gtk_widget_show (item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 3, button->time); return TRUE; } GtkWidget * do_clipboard (GtkWidget *do_widget) { if (!window) { GtkWidget *vbox, *hbox; GtkWidget *label; GtkWidget *entry, *button; GtkWidget *ebox, *image; GtkClipboard *clipboard; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Clipboard demo"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_container_add (GTK_CONTAINER (window), vbox); label = gtk_label_new ("\"Copy\" will copy the text\nin the entry to the clipboard"); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); gtk_container_set_border_width (GTK_CONTAINER (hbox), 8); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); /* Create the first entry */ entry = gtk_entry_new (); gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0); /* Create the button */ button = gtk_button_new_with_mnemonic (_("_Copy")); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); g_signal_connect (button, "clicked", G_CALLBACK (copy_button_clicked), entry); label = gtk_label_new ("\"Paste\" will paste the text from the clipboard to the entry"); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); gtk_container_set_border_width (GTK_CONTAINER (hbox), 8); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); /* Create the second entry */ entry = gtk_entry_new (); gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0); /* Create the button */ button = gtk_button_new_with_mnemonic (_("_Paste")); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); g_signal_connect (button, "clicked", G_CALLBACK (paste_button_clicked), entry); label = gtk_label_new ("Images can be transferred via the clipboard, too"); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); gtk_container_set_border_width (GTK_CONTAINER (hbox), 8); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); /* Create the first image */ image = gtk_image_new_from_icon_name ("dialog-warning", GTK_ICON_SIZE_BUTTON); ebox = gtk_event_box_new (); gtk_container_add (GTK_CONTAINER (ebox), image); gtk_container_add (GTK_CONTAINER (hbox), ebox); /* make ebox a drag source */ gtk_drag_source_set (ebox, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_COPY); gtk_drag_source_add_image_targets (ebox); g_signal_connect (ebox, "drag-begin", G_CALLBACK (drag_begin), image); g_signal_connect (ebox, "drag-data-get", G_CALLBACK (drag_data_get), image); /* accept drops on ebox */ gtk_drag_dest_set (ebox, GTK_DEST_DEFAULT_ALL, NULL, 0, GDK_ACTION_COPY); gtk_drag_dest_add_image_targets (ebox); g_signal_connect (ebox, "drag-data-received", G_CALLBACK (drag_data_received), image); /* context menu on ebox */ g_signal_connect (ebox, "button-press-event", G_CALLBACK (button_press), image); /* Create the second image */ image = gtk_image_new_from_icon_name ("process-stop", GTK_ICON_SIZE_BUTTON); ebox = gtk_event_box_new (); gtk_container_add (GTK_CONTAINER (ebox), image); gtk_container_add (GTK_CONTAINER (hbox), ebox); /* make ebox a drag source */ gtk_drag_source_set (ebox, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_COPY); gtk_drag_source_add_image_targets (ebox); g_signal_connect (ebox, "drag-begin", G_CALLBACK (drag_begin), image); g_signal_connect (ebox, "drag-data-get", G_CALLBACK (drag_data_get), image); /* accept drops on ebox */ gtk_drag_dest_set (ebox, GTK_DEST_DEFAULT_ALL, NULL, 0, GDK_ACTION_COPY); gtk_drag_dest_add_image_targets (ebox); g_signal_connect (ebox, "drag-data-received", G_CALLBACK (drag_data_received), image); /* context menu on ebox */ g_signal_connect (ebox, "button-press-event", G_CALLBACK (button_press), image); /* tell the clipboard manager to make the data persistent */ clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); gtk_clipboard_set_can_store (clipboard, NULL, 0); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)css_shadows.c/* CSS Theming/Shadows * * This demo shows how to use CSS shadows. */ #include static GtkWidget *window = NULL; static void show_parsing_error (GtkCssProvider *provider, GtkCssSection *section, const GError *error, GtkTextBuffer *buffer) { GtkTextIter start, end; const char *tag_name; gtk_text_buffer_get_iter_at_line_index (buffer, &start, gtk_css_section_get_start_line (section), gtk_css_section_get_start_position (section)); gtk_text_buffer_get_iter_at_line_index (buffer, &end, gtk_css_section_get_end_line (section), gtk_css_section_get_end_position (section)); if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED)) tag_name = "warning"; else tag_name = "error"; gtk_text_buffer_apply_tag_by_name (buffer, tag_name, &start, &end); } static void css_text_changed (GtkTextBuffer *buffer, GtkCssProvider *provider) { GtkTextIter start, end; char *text; gtk_text_buffer_get_start_iter (buffer, &start); gtk_text_buffer_get_end_iter (buffer, &end); gtk_text_buffer_remove_all_tags (buffer, &start, &end); text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); gtk_css_provider_load_from_data (provider, text, -1, NULL); g_free (text); gtk_style_context_reset_widgets (gdk_screen_get_default ()); } static void apply_css (GtkWidget *widget, GtkStyleProvider *provider) { gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT); if (GTK_IS_CONTAINER (widget)) gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider); } GtkWidget * create_toolbar (void) { GtkWidget *toolbar; GtkToolItem *item; toolbar = gtk_toolbar_new (); gtk_widget_set_valign (toolbar, GTK_ALIGN_CENTER); item = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "go-next"); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1); item = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "go-previous"); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1); item = gtk_tool_button_new (NULL, "Hello World"); gtk_tool_item_set_is_important (item, TRUE); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1); return toolbar; } GtkWidget * do_css_shadows (GtkWidget *do_widget) { if (!window) { GtkWidget *paned, *container, *child; GtkStyleProvider *provider; GtkTextBuffer *text; GBytes *bytes; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget)); gtk_window_set_default_size (GTK_WINDOW (window), 400, 300); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL); gtk_container_add (GTK_CONTAINER (window), paned); child = create_toolbar (); gtk_container_add (GTK_CONTAINER (paned), child); text = gtk_text_buffer_new (NULL); gtk_text_buffer_create_tag (text, "warning", "underline", PANGO_UNDERLINE_SINGLE, NULL); gtk_text_buffer_create_tag (text, "error", "underline", PANGO_UNDERLINE_ERROR, NULL); provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ()); container = gtk_scrolled_window_new (NULL, NULL); gtk_container_add (GTK_CONTAINER (paned), container); child = gtk_text_view_new_with_buffer (text); gtk_container_add (GTK_CONTAINER (container), child); g_signal_connect (text, "changed", G_CALLBACK (css_text_changed), provider); bytes = g_resources_lookup_data ("/css_shadows/gtk.css", 0, NULL); gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes)); g_bytes_unref (bytes); g_signal_connect (provider, "parsing-error", G_CALLBACK (show_parsing_error), gtk_text_view_get_buffer (GTK_TEXT_VIEW (child))); apply_css (window, provider); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)sizegroup.c/* Size Groups * * GtkSizeGroup provides a mechanism for grouping a number of * widgets together so they all request the same amount of space. * This is typically useful when you want a column of widgets to * have the same size, but you can't use a GtkTable widget. * * Note that size groups only affect the amount of space requested, * not the size that the widgets finally receive. If you want the * widgets in a GtkSizeGroup to actually be the same size, you need * to pack them in such a way that they get the size they request * and not more. For example, if you are packing your widgets * into a table, you would not include the GTK_FILL flag. */ #include #include static GtkWidget *window = NULL; /* Convenience function to create a combo box holding a number of strings */ GtkWidget * create_combo_box (const char **strings) { GtkWidget *combo_box; const char **str; combo_box = gtk_combo_box_text_new (); for (str = strings; *str; str++) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), *str); gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0); return combo_box; } static void add_row (GtkGrid *table, int row, GtkSizeGroup *size_group, const char *label_text, const char **options) { GtkWidget *combo_box; GtkWidget *label; label = gtk_label_new_with_mnemonic (label_text); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_END); gtk_widget_set_hexpand (label, TRUE); gtk_grid_attach (table, label, 0, row, 1, 1); combo_box = create_combo_box (options); gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo_box); gtk_size_group_add_widget (size_group, combo_box); gtk_grid_attach (table, combo_box, 1, row, 1, 1); } static void toggle_grouping (GtkToggleButton *check_button, GtkSizeGroup *size_group) { GtkSizeGroupMode new_mode; /* GTK_SIZE_GROUP_NONE is not generally useful, but is useful * here to show the effect of GTK_SIZE_GROUP_HORIZONTAL by * contrast. */ if (gtk_toggle_button_get_active (check_button)) new_mode = GTK_SIZE_GROUP_HORIZONTAL; else new_mode = GTK_SIZE_GROUP_NONE; gtk_size_group_set_mode (size_group, new_mode); } GtkWidget * do_sizegroup (GtkWidget *do_widget) { GtkWidget *content_area; GtkWidget *table; GtkWidget *frame; GtkWidget *vbox; GtkWidget *check_button; GtkSizeGroup *size_group; static const char *color_options[] = { "Red", "Green", "Blue", NULL }; static const char *dash_options[] = { "Solid", "Dashed", "Dotted", NULL }; static const char *end_options[] = { "Square", "Round", "Arrow", NULL }; if (!window) { window = gtk_dialog_new_with_buttons ("GtkSizeGroup", GTK_WINDOW (do_widget), 0, _("_Close"), GTK_RESPONSE_NONE, NULL); gtk_window_set_resizable (GTK_WINDOW (window), FALSE); g_signal_connect (window, "response", G_CALLBACK (gtk_widget_destroy), NULL); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); content_area = gtk_dialog_get_content_area (GTK_DIALOG (window)); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); g_object_set_data_full (G_OBJECT (window), "size-group", size_group, g_object_unref); /* Create one frame holding color options */ frame = gtk_frame_new ("Color Options"); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); table = gtk_grid_new (); gtk_container_set_border_width (GTK_CONTAINER (table), 5); gtk_grid_set_row_spacing (GTK_GRID (table), 5); gtk_grid_set_column_spacing (GTK_GRID (table), 10); gtk_container_add (GTK_CONTAINER (frame), table); add_row (GTK_GRID (table), 0, size_group, "_Foreground", color_options); add_row (GTK_GRID (table), 1, size_group, "_Background", color_options); /* And another frame holding line style options */ frame = gtk_frame_new ("Line Options"); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); table = gtk_grid_new (); gtk_container_set_border_width (GTK_CONTAINER (table), 5); gtk_grid_set_row_spacing (GTK_GRID (table), 5); gtk_grid_set_column_spacing (GTK_GRID (table), 10); gtk_container_add (GTK_CONTAINER (frame), table); add_row (GTK_GRID (table), 0, size_group, "_Dashing", dash_options); add_row (GTK_GRID (table), 1, size_group, "_Line ends", end_options); /* And a check button to turn grouping on and off */ check_button = gtk_check_button_new_with_mnemonic ("_Enable grouping"); gtk_box_pack_start (GTK_BOX (vbox), check_button, FALSE, FALSE, 0); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE); g_signal_connect (check_button, "toggled", G_CALLBACK (toggle_grouping), size_group); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else gtk_widget_destroy (window); return window; } (uuay)listbox/<UCgnome-foot.pngd PNG  IHDR/0#gAMA1_ IDATxYkly=wfvvfܗ)QŪl#HqdmT i4N A(n ] l<8v*#%RDY$MJ>?2T ,T\0s _e/ׇ o>Н:qj^ڷo߉mXpd WMjo1W[?kll,cСT*5:6M$eW2ob x3}3}xgPUjI3&c+wM& rտ%v{v$+Q):ښNƘUOdΑ/R7ODzHKR"xDb!zKAHiY0 RedLU(fyQݵr]] Cj6ѪU!J-a>奂Jz|q 琈E0ym{A=J|7xx#luS6}Wz6#gޘ%r[%-Mi|Zov,e |YQp"z}_wԪ_hUvyc ѦY|)B&_; qիtMb\^cϏ& G}F+8nu;hdhp6Zbew7%5 3 3j`*-nxw-8ph$Rwmcg.#\ٚmd몂g Kdj,J(*}k_z~'H^sk#-dz7vq5_VONKF8%5*'Qc]Xioiٟĥûo岹#vDP0Ƕ`YoozVYT?/l$,D!M%c-V0̟lV+T%drL\0y?mlВ'FGL%4D2IEM MF>Oy3׳ݽ}X|wo_o,l biuS/#[(=948Ǡ`zz{a[aYGPIg,# Hu^-Cm]X_;+{>VWU mX0, ϣ4C<ЪW`Y"Fni|e̤Pk $>\|r=N"6  CJYǒb!ǶZ@MC#\V˫V)c=vjn̻ [5 VIa[xAqD1׶ XYZd2gr[AWfD/Wk3GiZeyx'eBD1D8%kkeL%OO<^-Fޜ$ 1-;єdhF$EmS'eQ]Ӊm0M,g2x8v,~7|/jf0ֽ%ю^0l8$-I (J=j;.XaZbMo;MC| -Q8<<  static GtkBuilder *builder; static gint count = 0; static void change_direction (GtkRevealer *revealer) { gboolean revealed; revealed = gtk_revealer_get_child_revealed (revealer); gtk_revealer_set_reveal_child (revealer, !revealed); } static guint timeout = 0; static gboolean reveal_one (gpointer data) { gchar *name; GtkRevealer *revealer; name = g_strdup_printf ("revealer%d", count); revealer = (GtkRevealer *)gtk_builder_get_object (builder, name); gtk_revealer_set_reveal_child (revealer, TRUE); g_signal_connect (revealer, "notify::child-revealed", G_CALLBACK (change_direction), NULL); count++; if (count >= 9) { timeout = 0; return FALSE; } else return TRUE; } static void response_cb (GtkWidget *dialog, gint response_id, gpointer data) { if (timeout != 0) { g_source_remove (timeout); timeout = 0; } gtk_widget_destroy (dialog); } GtkWidget * do_revealer (GtkWidget *do_widget) { static GtkWidget *window = NULL; GError *err = NULL; if (!window) { builder = gtk_builder_new (); gtk_builder_add_from_resource (builder, "/revealer/revealer.ui", &err); if (err) { g_error ("ERROR: %s\n", err->message); return NULL; } gtk_builder_connect_signals (builder, NULL); window = GTK_WIDGET (gtk_builder_get_object (builder, "dialog1")); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); g_signal_connect (window, "response", G_CALLBACK (response_cb), NULL); } if (!gtk_widget_get_visible (window)) { count = 0; timeout = g_timeout_add (690, reveal_one, NULL); gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)reset.css/* @import this colorsheet to get the default values for every property. * This is useful when writing special CSS tests that should not be * inluenced by themes - not even the default ones. * Keep in mind that the output will be very ugly and not look like * anything GTK. * Also, when adding new style properties, please add them here. */ * { color: inherit; font-size: inherit; background-color: initial; font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; text-shadow: inherit; icon-shadow: inherit; box-shadow: initial; margin-top: initial; margin-left: initial; margin-bottom: initial; margin-right: initial; padding-top: initial; padding-left: initial; padding-bottom: initial; padding-right: initial; border-top-style: initial; border-top-width: initial; border-left-style: initial; border-left-width: initial; border-bottom-style: initial; border-bottom-width: initial; border-right-style: initial; border-right-width: initial; border-top-left-radius: initial; border-top-right-radius: initial; border-bottom-right-radius: initial; border-bottom-left-radius: initial; outline-style: initial; outline-width: initial; outline-offset: initial; background-clip: initial; background-origin: initial; background-size: initial; background-position: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: initial; outline-color: initial; background-repeat: initial; background-image: initial; border-image-source: initial; border-image-repeat: initial; border-image-slice: initial; border-image-width: initial; transition-property: initial; transition-duration: initial; transition-timing-function: initial; transition-delay: initial; engine: initial; gtk-key-bindings: initial; -GtkWidget-focus-line-width: 0; -GtkWidget-focus-padding: 0; -GtkNotebook-initial-gap: 0; } (uuay)gnome-applets.png PNG  IHDR00WgAMA abKGD pHYs``zxEtIME ( IDATxYuګg㐢9ҖdkMіI@ӒF 'P q^b=F I6<Yk I @L٢hQ#҈Ԉξw5}(e<) ={#qs$L.KgK v\&H a-'r#pUVW cs1,'og])6˽~ @c[ : (&POsp3_:z|dxp4Ȓ4':NZeMo}ߘ]XY3B|y@.ρ|sy޽_$,H( <ϱ]vX[>G/nN(9&P*/=ra0**,!!IRB_쯹 +baGRR/dS*?{ķ+}5,)nj]R7 4%Mb$%NRUS/.Cȥw}TT*S)K覉a訪,ɿ$4!c8!c8ŕ;%l3j>?w\R*)U*eR4Q5EQd.$邕}(8ˆLKzk}}^o| Ǟ{_꺎ii J ib)2 ,S)Ұt+N9voinʲhF ,Q*WɃYӻ໱/ ,QT$uMes;B6x@Ldp edY)2cPUwH2xId Y\'N*$2YzRra/ۥ'}x"K3,#R,,f4%C|&+!4#R$EcyI(Wpz`Rӿ*2 {AަXS#it2EDa@xv| €(KӘ$Iӄ4MIqyxq7/ӱ]TMR.?݌mj8ꮰQݕw\s|}K" C(&j54z^z;Flj☡a\Ͽ/xAډHdOA@{xظݱpm ױ|;>( g}}3gޣ^gV\,rIݮ= +]iE!Bs=_feNt=/~SJ uD*] U(Cǧ/ֱ]xg"e]iJr|qXZ\4?ȓ?JLN& >]CܵGf׮a'2,bychl!{>A!I8V==X6M�{8*f9 xWJ%Iqˬ?ÿ4X= I,ϒ)aF1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GZ%X\gqao.κ<=stؗŷD>Rz{D)>t|cDQDE$IB) jlr!.-h68r mh6:O|=|?k8VۯGkY$ Ks$Ii2 DQD(A0;3#8~|޲Gfnрtww|LN\B<[?~+? q;h6xO|| \),T*cPJ!GUG @NI!:>rC t]qB̀f3'G'~~OwָcJBeH)B0L}BCkspFYufm_]^!tuG/4GK9RT*8Bnׅ!ֲHE0Dx<RzD⯟},BxX~+~u2c}U/dxkR1뽑V@D¿)i>ed!0 ihQJM H)WIFfIoZGn&js\*x-'FkHd$v>iRΎ1fZE'2zkܠ9Ph-'PX,0Okb–IL&&;|7W 9rUˣ_ρmw#$I SZk8- $sV2[/H)d$J81Sŗ <.diZOZ_rљ#Ϝ9R 9HӔ4M}cJGQV[l4K`MI&|^B»x #define SHADOW_OFFSET_X 7 #define SHADOW_OFFSET_Y 7 #define SHADOW_RADIUS 5 static void draw_shadow_box (cairo_t *cr, GdkRectangle rect, double radius, double transparency) { cairo_pattern_t *pattern; double x0, x1, x2, x3; double y0, y1, y2, y3; x0 = rect.x; x1 = rect.x + radius; x2 = rect.x + rect.width - radius; x3 = rect.x + rect.width; y0 = rect.y; y1 = rect.y + radius; y2 = rect.y + rect.height - radius; y3 = rect.y + rect.height; /* Fill non-border part */ cairo_set_source_rgba (cr, 0, 0, 0, transparency); cairo_rectangle (cr, x1, y1, x2 - x1, y2 - y1); cairo_fill (cr); /* Upper border */ pattern = cairo_pattern_create_linear (0, y0, 0, y1); cairo_pattern_add_color_stop_rgba (pattern, 0.0, 0.0, 0, 0, 0.0); cairo_pattern_add_color_stop_rgba (pattern, 1.0, 0.0, 0, 0, transparency); cairo_set_source (cr, pattern); cairo_pattern_destroy (pattern); cairo_rectangle (cr, x1, y0, x2 - x1, y1 - y0); cairo_fill (cr); /* Bottom border */ pattern = cairo_pattern_create_linear (0, y2, 0, y3); cairo_pattern_add_color_stop_rgba (pattern, 0.0, 0.0, 0, 0, transparency); cairo_pattern_add_color_stop_rgba (pattern, 1.0, 0.0, 0, 0, 0.0); cairo_set_source (cr, pattern); cairo_pattern_destroy (pattern); cairo_rectangle (cr, x1, y2, x2 - x1, y3 - y2); cairo_fill (cr); /* Left border */ pattern = cairo_pattern_create_linear (x0, 0, x1, 0); cairo_pattern_add_color_stop_rgba (pattern, 0.0, 0.0, 0, 0, 0.0); cairo_pattern_add_color_stop_rgba (pattern, 1.0, 0.0, 0, 0, transparency); cairo_set_source (cr, pattern); cairo_pattern_destroy (pattern); cairo_rectangle (cr, x0, y1, x1 - x0, y2 - y1); cairo_fill (cr); /* Right border */ pattern = cairo_pattern_create_linear (x2, 0, x3, 0); cairo_pattern_add_color_stop_rgba (pattern, 0.0, 0.0, 0, 0, transparency); cairo_pattern_add_color_stop_rgba (pattern, 1.0, 0.0, 0, 0, 0.0); cairo_set_source (cr, pattern); cairo_pattern_destroy (pattern); cairo_rectangle (cr, x2, y1, x3 - x2, y2 - y1); cairo_fill (cr); /* NW corner */ pattern = cairo_pattern_create_radial (x1, y1, 0, x1, y1, radius); cairo_pattern_add_color_stop_rgba (pattern, 0.0, 0.0, 0, 0, transparency); cairo_pattern_add_color_stop_rgba (pattern, 1.0, 0.0, 0, 0, 0.0); cairo_set_source (cr, pattern); cairo_pattern_destroy (pattern); cairo_rectangle (cr, x0, y0, x1 - x0, y1 - y0); cairo_fill (cr); /* NE corner */ pattern = cairo_pattern_create_radial (x2, y1, 0, x2, y1, radius); cairo_pattern_add_color_stop_rgba (pattern, 0.0, 0.0, 0, 0, transparency); cairo_pattern_add_color_stop_rgba (pattern, 1.0, 0.0, 0, 0, 0.0); cairo_set_source (cr, pattern); cairo_pattern_destroy (pattern); cairo_rectangle (cr, x2, y0, x3 - x2, y1 - y0); cairo_fill (cr); /* SW corner */ pattern = cairo_pattern_create_radial (x1, y2, 0, x1, y2, radius); cairo_pattern_add_color_stop_rgba (pattern, 0.0, 0.0, 0, 0, transparency); cairo_pattern_add_color_stop_rgba (pattern, 1.0, 0.0, 0, 0, 0.0); cairo_set_source (cr, pattern); cairo_pattern_destroy (pattern); cairo_rectangle (cr, x0, y2, x1 - x0, y3 - y2); cairo_fill (cr); /* SE corner */ pattern = cairo_pattern_create_radial (x2, y2, 0, x2, y2, radius); cairo_pattern_add_color_stop_rgba (pattern, 0.0, 0.0, 0, 0, transparency); cairo_pattern_add_color_stop_rgba (pattern, 1.0, 0.0, 0, 0, 0.0); cairo_set_source (cr, pattern); cairo_pattern_destroy (pattern); cairo_rectangle (cr, x2, y2, x3 - x2, y3 - y2); cairo_fill (cr); } static gboolean draw_callback (GtkWidget *widget, cairo_t *cr, gpointer data) { GdkRectangle rect; gtk_widget_get_allocation (widget, &rect); rect.x += SHADOW_OFFSET_X; rect.y += SHADOW_OFFSET_Y; rect.width -= SHADOW_OFFSET_X; rect.height -= SHADOW_OFFSET_Y; draw_shadow_box (cr, rect, SHADOW_RADIUS, 0.4); return FALSE; } GtkWidget * do_transparent (GtkWidget *do_widget) { static GtkWidget *window = NULL; if (!window) { GtkWidget *view; GtkWidget *sw; GtkWidget *overlay; GtkWidget *entry; GtkCssProvider *provider; gchar *css; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_default_size (GTK_WINDOW (window), 450, 450); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_window_set_title (GTK_WINDOW (window), "Transparent"); gtk_container_set_border_width (GTK_CONTAINER (window), 0); view = gtk_text_view_new (); sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (sw), view); overlay = gtk_overlay_new (); gtk_container_add (GTK_CONTAINER (overlay), sw); gtk_container_add (GTK_CONTAINER (window), overlay); entry = gtk_entry_new (); provider = gtk_css_provider_new (); css = g_strdup_printf ("* { border-width: 0px %dpx %dpx 0px; }", SHADOW_OFFSET_X, SHADOW_OFFSET_Y); gtk_css_provider_load_from_data (provider, css, -1, NULL); g_free (css); gtk_style_context_add_provider (gtk_widget_get_style_context (entry), GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); g_signal_connect (entry, "draw", G_CALLBACK (draw_callback), NULL); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry); gtk_widget_set_halign (entry, GTK_ALIGN_CENTER); gtk_widget_set_valign (entry, GTK_ALIGN_START); gtk_widget_show_all (overlay); } if (!gtk_widget_get_visible (window)) { gtk_widget_show (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)background.jpgVJFIFHHCreated with The GIMPC    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222"8!1AQ"a2q#BR3rbC1 ?T[C GzFh ʎ^h| lFT{(v4 TQ|Q ¡KHylmUw$"G4dvEL C1H2;ށY $=3Y4pVM'UDkYR#B@X㘧X"A8$rB Kиd֩1`Np˛MTDL~)oϊ%%FQ"-ó<P \(@E/zg[}ST-ɌpD* $EV$~7U ` {U-yZTꍻk :ԃD!7@`5{~(1`vֲ0ݤ}N[ͰPb"7"1 rfV $Oo~Pe5'HqTfڠXEgU27?)7fW]ۉ?mos9 hb$CYQG-3]:sRH;սXf$}YڶB[Pr$G N,T4hx>iFER*@=sb;k|*(O>(P$S aN<2UpXK&v^*=Fse{]t߭e-胯WeqM@~t{ u-ҳqmAjX&O5@W ڝyp*ʾ;hrI =C!9g(ǚ 3X:46P c h46P1:Hd{ EDnH:XE; Pn- OZxB2Ց1#>H1Hӏ(3b]0H:TɽԶ(L#ɥZùa{im-ZKPm?.ucʁRKT-[npX3 k-9\x CSnDSڣNrQ(~(`K UuQv)aseTI2)e+a{$W>৐;U ߎi+P꣰t= :{p8ULZ*k$My N_q&^MFy:N嶽Ř0PtUBuH=Ywz̈%)PzpX!\\'jt9 W\*i$ ' WOhl/K{@`d~h`@2y)K,-UB} ) c梳gdbDH)B@M>GYh -剃<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A$F5UFpX7Hf׶\6vKq>)A m>P f {(^>PH>)L<9ղXAYE_VITT̘biQQ=z|,2P*P\dR[y$N⢂(Y$qvE-?޶6n\8}^womc Ѵ{y1\EtonsEZ*?UGlbR.w :W%D&1Q{z MHwwn8^Z l)$5 Z|S?4!-+V( \ĉ1Y%wi-ALU]axX-+r}6UOj RVia*JݲOrP% Yై5@팪b;H@2\" e(PHzWp"ډ1t8;,++\c5O4 t6B:4Urv(qU<- r>;QM'<_IϨ lg( $ncof6ӥ*e B^~hP:f5QqSݸ.3l QBTsFtœ f9WPyEk :'&OmtzyLXzS>N;iReUq/En~ہ@үQY-qL3q2k/\ A⹺wf׻q&893,H␲Rg,4UWP\P@B2b`KF_oimP/к#gAUSXˀ<8fŲI&gj Gڎ0YV  UP{2a汶 2y 5T[]?LL3$r; j95PPX2Z3q'PҰiR/{{@Ы@H9l* @TfX !e)ɢ2ϘXi@*d1YP0,>f_u$# F` yrN>ؤg%R~)U 2ۍNPlG n2,]V!)R.NG~ G:ɊtLkY_$*[v$h a=iF. @'02IcX$ӥ@ ?j5`ANyWǸ`a-)N⋹!f{M#x۞Oڛ ,dyB[9?4WrA#T(uuay)entry_buffer.c/* Entry/Entry Buffer * * GtkEntryBuffer provides the text content in a GtkEntry. * */ #include #include static GtkWidget *window = NULL; GtkWidget * do_entry_buffer (GtkWidget *do_widget) { GtkWidget *content_area; GtkWidget *vbox; GtkWidget *label; GtkWidget *entry; GtkEntryBuffer *buffer; if (!window) { window = gtk_dialog_new_with_buttons ("GtkEntryBuffer", GTK_WINDOW (do_widget), 0, _("_Close"), GTK_RESPONSE_NONE, NULL); gtk_window_set_resizable (GTK_WINDOW (window), FALSE); g_signal_connect (window, "response", G_CALLBACK (gtk_widget_destroy), NULL); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); content_area = gtk_dialog_get_content_area (GTK_DIALOG (window)); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "Entries share a buffer. Typing in one is reflected in the other."); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); /* Create a buffer */ buffer = gtk_entry_buffer_new (NULL, 0); /* Create our first entry */ entry = gtk_entry_new_with_buffer (buffer); gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); /* Create the second entry */ entry = gtk_entry_new_with_buffer (buffer); gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE); gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); g_object_unref (buffer); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else gtk_widget_destroy (window); return window; } (uuay)sidebar.cl /* Stack Sidebar * * GtkStackSidebar provides an automatic sidebar widget to control * navigation of a GtkStack object. This widget automatically updates it * content based on what is presently available in the GtkStack object, * and using the "title" child property to set the display labels. */ #include #include static GtkWidget *window = NULL; GtkWidget * do_sidebar (GtkWidget *do_widget) { GtkWidget *sidebar; GtkWidget *stack; GtkWidget *box; GtkWidget *widget; GtkWidget *header; const gchar* pages[] = { "Welcome to GTK+", "GtkStackSidebar Widget", "Automatic navigation", "Consistent appearance", "Scrolling", "Page 6", "Page 7", "Page 8", "Page 9", NULL }; const gchar *c = NULL; guint i; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_resizable (GTK_WINDOW (window), TRUE); gtk_widget_set_size_request (window, 500, 350); header = gtk_header_bar_new (); gtk_header_bar_set_show_close_button (GTK_HEADER_BAR(header), TRUE); gtk_window_set_titlebar (GTK_WINDOW(window), header); gtk_window_set_title (GTK_WINDOW(window), "Stack Sidebar demo"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); sidebar = gtk_stack_sidebar_new (); gtk_box_pack_start (GTK_BOX (box), sidebar, FALSE, FALSE, 0); stack = gtk_stack_new (); gtk_stack_set_transition_type (GTK_STACK (stack), GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN); gtk_stack_sidebar_set_stack (GTK_STACK_SIDEBAR (sidebar), GTK_STACK (stack)); /* Separator between sidebar and stack */ widget = gtk_separator_new (GTK_ORIENTATION_VERTICAL); gtk_box_pack_start (GTK_BOX(box), widget, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), stack, TRUE, TRUE, 0); for (i=0; (c = *(pages+i)) != NULL; i++ ) { if (i == 0) { widget = gtk_image_new_from_icon_name ("help-about", GTK_ICON_SIZE_MENU); gtk_image_set_pixel_size (GTK_IMAGE (widget), 256); } else { widget = gtk_label_new (c); } gtk_stack_add_named (GTK_STACK (stack), widget, c); gtk_container_child_set (GTK_CONTAINER (stack), widget, "title", c, NULL); } gtk_container_add (GTK_CONTAINER (window), box); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else gtk_widget_destroy (window); return window; } (uuay)main.ui
Aboutapp.about
_Quitapp.quit<Primary>q
800600FalseGTK+ DemoTrueFalseTrueTruecenterTruewin.runTrueRunstartTrueFalse0True120TrueTruenevernone150TrueTruetreestoreFalsebrowsecolumn41FalseTrue0TrueTrueTrueTrueFalseTrueTruenoneTrueTrue202022FalsewordFalseTrueTrueFalse_InfoTrueTrueFalseTrueTruenoneTrueTrue2020FalseFalse1TrueTrueFalseSource1FalseTrueTrue1 (uuay)popover.ui3 Item 1 Item 2 Item 3 Item 4 Item 5 Item 6 Item 7 Item 8 Item 9 Item 10 False True False vertical 6 True True edit-find edit-clear False True 0 True True in True True True liststore1 False False 2 0 False True 1 (uuay)event_axes.c'/* Event Axes * * Demonstrates advanced handling of event information from exotic * input devices. * * On one hand, this snippet demonstrates management of input axes, * those contain additional information for the pointer other than * X/Y coordinates. * * Input axes are dependent on hardware devices, on linux/unix you * can see the device axes through xinput list . Each time * a different hardware device is used to move the pointer, the * master device will be updated to match the axes it provides, * these changes can be tracked through GdkDevice::changed, or * checking gdk_event_get_source_device(). * * On the other hand, this demo handles basic multitouch events, * each event coming from an specific touchpoint will contain a * GdkEventSequence that's unique for its lifetime, so multiple * touchpoints can be tracked. */ #include typedef struct { GdkDevice *last_source; GHashTable *axes; /* axis label atom -> value */ GdkRGBA color; gdouble x; gdouble y; } AxesInfo; typedef struct { AxesInfo *pointer_info; GHashTable *touch_info; /* GdkEventSequence -> AxesInfo */ } EventData; const gchar *colors[] = { "black", "orchid", "fuchsia", "indigo", "thistle", "sienna", "azure", "plum", "lime", "navy", "maroon", "burlywood" }; static guint cur_color = 0; static AxesInfo * axes_info_new (void) { AxesInfo *info; info = g_new0 (AxesInfo, 1); gdk_rgba_parse (&info->color, colors[cur_color]); info->axes = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_free); cur_color = (cur_color + 1) % G_N_ELEMENTS (colors); return info; } static void axes_info_free (AxesInfo *info) { g_hash_table_destroy (info->axes); g_free (info); } static gboolean axes_info_lookup (AxesInfo *info, const gchar *axis_label, gdouble *value) { gdouble *val; GdkAtom atom; atom = gdk_atom_intern (axis_label, FALSE); if (atom == GDK_NONE) return FALSE; val = g_hash_table_lookup (info->axes, GDK_ATOM_TO_POINTER (atom)); if (!val) return FALSE; *value = *val; return TRUE; } static EventData * event_data_new (void) { EventData *data; data = g_new0 (EventData, 1); data->touch_info = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) axes_info_free); return data; } static void event_data_free (EventData *data) { if (data->pointer_info) axes_info_free (data->pointer_info); g_hash_table_destroy (data->touch_info); g_free (data); } static void update_axes_from_event (GdkEvent *event, EventData *data) { GdkDevice *device, *source_device; GdkEventSequence *sequence; gdouble x, y, value; GList *l, *axes; AxesInfo *info; device = gdk_event_get_device (event); source_device = gdk_event_get_source_device (event); sequence = gdk_event_get_event_sequence (event); if (event->type == GDK_TOUCH_END) { g_hash_table_remove (data->touch_info, sequence); return; } else if (event->type == GDK_LEAVE_NOTIFY) { if (data->pointer_info) axes_info_free (data->pointer_info); data->pointer_info = NULL; return; } if (!sequence) { if (!data->pointer_info) data->pointer_info = axes_info_new (); info = data->pointer_info; } else { info = g_hash_table_lookup (data->touch_info, sequence); if (!info) { info = axes_info_new (); g_hash_table_insert (data->touch_info, sequence, info); } } if (info->last_source != source_device) { g_hash_table_remove_all (info->axes); info->last_source = source_device; } if (event->type == GDK_TOUCH_BEGIN || event->type == GDK_TOUCH_UPDATE || event->type == GDK_MOTION_NOTIFY || event->type == GDK_BUTTON_PRESS || event->type == GDK_BUTTON_RELEASE) { axes = gdk_device_list_axes (device); if (sequence && event->touch.emulating_pointer) { if (data->pointer_info) axes_info_free (data->pointer_info); data->pointer_info = NULL; } for (l = axes; l; l = l->next) { gdouble *ptr; /* All those event types are compatible wrt axes position in the struct */ if (!gdk_device_get_axis_value (device, event->motion.axes, l->data, &value)) continue; ptr = g_new0 (gdouble, 1); *ptr = value; g_hash_table_insert (info->axes, GDK_ATOM_TO_POINTER (l->data), ptr); } g_list_free (axes); } if (gdk_event_get_coords (event, &x, &y)) { info->x = x; info->y = y; } } static gboolean event_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data) { update_axes_from_event (event, user_data); gtk_widget_queue_draw (widget); return FALSE; } static void render_arrow (cairo_t *cr, gdouble x_diff, gdouble y_diff, const gchar *label) { cairo_save (cr); cairo_set_source_rgb (cr, 0, 0, 0); cairo_new_path (cr); cairo_move_to (cr, 0, 0); cairo_line_to (cr, x_diff, y_diff); cairo_stroke (cr); cairo_move_to (cr, x_diff, y_diff); cairo_show_text (cr, label); cairo_restore (cr); } static void draw_axes_info (cairo_t *cr, AxesInfo *info, GtkAllocation *allocation) { gdouble pressure, tilt_x, tilt_y, wheel; cairo_save (cr); cairo_set_line_width (cr, 1); gdk_cairo_set_source_rgba (cr, &info->color); cairo_move_to (cr, 0, info->y); cairo_line_to (cr, allocation->width, info->y); cairo_move_to (cr, info->x, 0); cairo_line_to (cr, info->x, allocation->height); cairo_stroke (cr); cairo_translate (cr, info->x, info->y); if (axes_info_lookup (info, "Abs Pressure", &pressure)) { cairo_pattern_t *pattern; pattern = cairo_pattern_create_radial (0, 0, 0, 0, 0, 100); cairo_pattern_add_color_stop_rgba (pattern, pressure, 1, 0, 0, pressure); cairo_pattern_add_color_stop_rgba (pattern, 1, 0, 0, 1, 0); cairo_set_source (cr, pattern); cairo_arc (cr, 0, 0, 100, 0, 2 * G_PI); cairo_fill (cr); cairo_pattern_destroy (pattern); } if (axes_info_lookup (info, "Abs Tilt X", &tilt_x) && axes_info_lookup (info, "Abs Tilt Y", &tilt_y)) render_arrow (cr, tilt_x * 100, tilt_y * 100, "Tilt"); if (axes_info_lookup (info, "Abs Wheel", &wheel)) { cairo_save (cr); cairo_set_line_width (cr, 10); cairo_set_source_rgba (cr, 0, 0, 0, 0.5); cairo_new_sub_path (cr); cairo_arc (cr, 0, 0, 100, 0, wheel * 2 * G_PI); cairo_stroke (cr); cairo_restore (cr); } cairo_restore (cr); } static void draw_device_info (GtkWidget *widget, cairo_t *cr, GdkEventSequence *sequence, gint *y, AxesInfo *info) { PangoLayout *layout; GString *string; gint height; cairo_save (cr); string = g_string_new (NULL); g_string_append_printf (string, "Source: %s", gdk_device_get_name (info->last_source)); if (sequence) g_string_append_printf (string, "\nSequence: %d", GPOINTER_TO_UINT (sequence)); cairo_move_to (cr, 10, *y); layout = gtk_widget_create_pango_layout (widget, string->str); pango_cairo_show_layout (cr, layout); cairo_stroke (cr); pango_layout_get_pixel_size (layout, NULL, &height); gdk_cairo_set_source_rgba (cr, &info->color); cairo_set_line_width (cr, 10); cairo_move_to (cr, 0, *y); *y = *y + height; cairo_line_to (cr, 0, *y); cairo_stroke (cr); cairo_restore (cr); g_object_unref (layout); g_string_free (string, TRUE); } static gboolean draw_cb (GtkWidget *widget, cairo_t *cr, gpointer user_data) { EventData *data = user_data; GtkAllocation allocation; AxesInfo *touch_info; GHashTableIter iter; gpointer key, value; gint y = 0; gtk_widget_get_allocation (widget, &allocation); /* Draw Abs info */ if (data->pointer_info) draw_axes_info (cr, data->pointer_info, &allocation); g_hash_table_iter_init (&iter, data->touch_info); while (g_hash_table_iter_next (&iter, NULL, &value)) { touch_info = value; draw_axes_info (cr, touch_info, &allocation); } /* Draw name, color legend and misc data */ if (data->pointer_info) draw_device_info (widget, cr, NULL, &y, data->pointer_info); g_hash_table_iter_init (&iter, data->touch_info); while (g_hash_table_iter_next (&iter, &key, &value)) { touch_info = value; draw_device_info (widget, cr, key, &y, touch_info); } return FALSE; } GtkWidget * do_event_axes (GtkWidget *toplevel) { static GtkWidget *window = NULL; EventData *event_data; GtkWidget *box; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 400, 400); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); box = gtk_event_box_new (); gtk_container_add (GTK_CONTAINER (window), box); gtk_widget_add_events (box, GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_SMOOTH_SCROLL_MASK | GDK_TOUCH_MASK); event_data = event_data_new (); g_object_set_data_full (G_OBJECT (box), "gtk-demo-event-data", event_data, (GDestroyNotify) event_data_free); g_signal_connect (box, "event", G_CALLBACK (event_cb), event_data); g_signal_connect (box, "draw", G_CALLBACK (draw_cb), event_data); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)floppybuddy.gif`GIF89aPF  !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~ぁ=v{! NETSCAPE2.0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3jȱǏ CIdA(S\rɅNjI̗ cJϞ@&΃EE4eSF@TL}Z 4TIb͚P vX(Dːյj7)֩VU{n*4YR{5*ʹ ,hq |PJ|]x'ФsWZ_Sޙ'[}u[[E%č_O|9sϥ.PassSWo8yguh` w%V"h rY]ɗփvN(ǁd`]&L%Db'\~ rуxvڌԈҍ&x!AjFd("6DP8%JUqE[V``)eH_qy&[kx'QG)"}y~`1Uh!;)ZބNNf꒤v*iI+¤ҨhꥄVkj*t뎵*+Od!U_Dlv5`u]6k؎4-MfҷyfbnWJ5Ӣc$K~n 7G,T!This space for rent...! ,L> H*\ȰÇ#JHŋ3jȱǏ CIdA(S\rɅNjI̗ cJϞ@H 2hJ2rD)@*0.O[vDٕ@Xsjj׶l6$٫w5mW)9-͢{,ҁEgu8 5|bSCJ%x3|Cf ۸Icqhq}vmBN-8(U/gys_9qٵ^?9yï>d|p_M6~ϕv(ބ`.} W!*I؅І9gNAȚkhq8S)5Hgf>$JBHL:mh:QIe!I6 $0JY$dHX'umAh긑*9|jB昉aрx&be1aJYziviJ:*A*=ҫꚔ,Bk$KO9Ūl}<WL%*QMi.W~HS•;Rvն;m_2xn~).kn2zk0 .9,o[.fw#! ,L> H*\ȰÇ#JHŋ3jȱǏ CIdA(S\rɅNjI̗ cJϞ@&΃EE4eSF@TL}Z 4TIb͚P vX(Dːյj7)֩VU{n*4YR{5*ʹ ,hq |PJ|]x'ФsWZ_Sޙ'[}u[[E%č_O|9sϥ.PassSWo8yguh` w%V"h rY]ɗփvN(ǁd`]&L%Db'\~ rуxvڌԈҍ&x!AjFd("6DP8%JUqE[V``)eH_qy&[kx'QG)"}y~`1Uh!;)ZބNNf꒤v*iI+¤ҨhꥄVkj*t뎵*+Od!U_Dlv5`u]6k؎4-MfҷyfbnWJ5Ӣc$K~n 7G,T!This GIF file was assembled with GIF Construction Set from: Alchemy Mindworks Inc. P.O. Box 500 Beeton, Ontario L0G 1A0 CANADA. This comment block will not appear in files created with a registered version of GIF Construction Set;(uuay)stack/Hentry_completion.c /* Entry/Entry Completion * * GtkEntryCompletion provides a mechanism for adding support for * completion in GtkEntry. * */ #include #include static GtkWidget *window = NULL; /* Creates a tree model containing the completions */ GtkTreeModel * create_completion_model (void) { GtkListStore *store; GtkTreeIter iter; store = gtk_list_store_new (1, G_TYPE_STRING); /* Append one word */ gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, 0, "GNOME", -1); /* Append another word */ gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, 0, "total", -1); /* And another word */ gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, 0, "totally", -1); return GTK_TREE_MODEL (store); } GtkWidget * do_entry_completion (GtkWidget *do_widget) { GtkWidget *content_area; GtkWidget *vbox; GtkWidget *label; GtkWidget *entry; GtkEntryCompletion *completion; GtkTreeModel *completion_model; if (!window) { window = gtk_dialog_new_with_buttons ("GtkEntryCompletion", GTK_WINDOW (do_widget), 0, _("_Close"), GTK_RESPONSE_NONE, NULL); gtk_window_set_resizable (GTK_WINDOW (window), FALSE); g_signal_connect (window, "response", G_CALLBACK (gtk_widget_destroy), NULL); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); content_area = gtk_dialog_get_content_area (GTK_DIALOG (window)); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "Completion demo, try writing total or gnome for example."); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); /* Create our entry */ entry = gtk_entry_new (); gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0); /* Create the completion object */ completion = gtk_entry_completion_new (); /* Assign the completion to the entry */ gtk_entry_set_completion (GTK_ENTRY (entry), completion); g_object_unref (completion); /* Create a tree model and use it as the completion model */ completion_model = create_completion_model (); gtk_entry_completion_set_model (completion, completion_model); g_object_unref (completion_model); /* Use model column 0 as the text column */ gtk_entry_completion_set_text_column (completion, 0); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else gtk_widget_destroy (window); return window; } (uuay)gnome-gsame.pngPNG  IHDR00WgAMA1_^IDATxYdWy[{U3ӳ3a0+f1F !HI7x,g~Swoߟk03֫6Y,bMWr?[?;j1񪴜S|zoY|쳷S;s%>sj\3Җ\+A {?+%y2 P/=S .>٘cƘ2j;_ 'VF;k wN;njYo9-dG-ӿw?ӟ=B()9 4&0L.~$%KL(K~| _ѹ|h#B4xۍKx`Fi猆F?Ikm!qcQ%7 BY`x)uJRc|'g8w:{S@6s:.&R0 =y;zRJß[޲t_}&[i؋.YoKU!Ejg;*sf[)y@E ^G٠L^B6v@$9J@YJ@cp@hs;}jP `8V\Ib+~fժR9֘0r#?chEb5USб2wdЙBDEF(ՠ-4ƶu ra"nR͜>Y1U @2q{78asC^,yr\ģ'\kW!WbJCvFdIJjDS2B #l\S8IMJV@]e߳83lu2mu6ZYÿvW녙th6jLLX{wNgy=;wd#lm'Y,}T[ 6NsD:bj^tG)ǟ{Mo󙝇{.[Fxt+(M AElZET'12nF/"QlҜ02J+%Am D)C~l"oKm! dn[yǹOyԣ%!)RjV)5jK)kRJ8L]" i昭nil M3"݄"OZVc6F.[#7UPxSDq[kSkmbst!D@<ߪv:;f4ZG(9Α) /Í#$'eZbkAx>.v^ @^޶ֶMkmZ+1Ba1BITn+$:vgjT3p$(c'h3Mr&&4 HPiz6%t N;jZkT!Xp55afvVhCE4Mb"Ռ7N:!hk3\ Jr$PF;* 6|k1L5!D0?9uY>@1nRIiĒ:6/ʉ Ɉ2ֶhQ8r\g*h^1b!D`E`3U @=v޴V0M "I $ 2.f[ `uu{W[Bkg^ ,hkB$Z;֎$W|?Ԭ7pGjz}أO<,mFWu̥O]{l#3-R=И^ZI+~`6t kur>dZ֒8Ɋ3T̬\3*_;w.6?:p`f9zDgnĮKk)ԆfBXJ Zztx{n޿w5g1IT+dy&,#I0 |$[7 n[H^ѷΏN8%>Zq^sw~) !zvb(pd:H(4IyFRE IZQ=.TZpZ%^+x:򖛿!If)I>3\Gh)cTZ)cGQz@զ2rGKkkHuNIApn˅^R7a@ݡ.QuԽ];vuZ!T}jQNRT+UfXC 0&' B?LKRnsu^\yJ yv~1qFCbðpq1 !B@K)m!)W.|;}?QS 4,JV~ okwN33^zb8)q]Yx2a%b !TVTRqr)egi9#o$4Ea,Q<ׄQ\|+eƽ®z@$GIL/c&J~TN\^VmR1h!e/4OQ ]$q]_x^Dh1'{&o f@&`%4j.)!DF 4n)4ιJڻ0n^@eB'qa_|9?R5-oL Jkgѣ␰4`aaA}l6fxӾVn_LLy^8 +)," }MR]gU/mCCҀ/ \KylA[_/M-uǽv%Jy#҄Dv @tpPKQq?66*y |tKRRUVen~bՊ5.emmqAI}y`=Nm+_ϾNiJg3ޤW e)q+|%Ķ;^s1aIENDB`(uuay)iconview_edit.c"/* Icon View/Editing and Drag-and-Drop * * The GtkIconView widget supports Editing and Drag-and-Drop. * This example also demonstrates using the generic GtkCellLayout * interface to set up cell renderers in an icon view. */ #include #include static GtkWidget *window = NULL; enum { COL_TEXT, NUM_COLS }; static void fill_store (GtkListStore *store) { GtkTreeIter iter; const gchar *text[] = { "Red", "Green", "Blue", "Yellow" }; gint i; /* First clear the store */ gtk_list_store_clear (store); for (i = 0; i < 4; i++) { gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COL_TEXT, text[i], -1); } } static GtkListStore * create_store (void) { GtkListStore *store; store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING); return store; } static void set_cell_color (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) { gchar *text; GdkRGBA color; guint32 pixel = 0; GdkPixbuf *pixbuf; gtk_tree_model_get (tree_model, iter, COL_TEXT, &text, -1); if (!text) return; if (gdk_rgba_parse (&color, text)) pixel = ((gint)(color.red * 255)) << 24 | ((gint)(color.green * 255)) << 16 | ((gint)(color.blue * 255)) << 8 | ((gint)(color.alpha * 255)); g_free (text); pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 24, 24); gdk_pixbuf_fill (pixbuf, pixel); g_object_set (cell, "pixbuf", pixbuf, NULL); g_object_unref (pixbuf); } static void edited (GtkCellRendererText *cell, gchar *path_string, gchar *text, gpointer data) { GtkTreeModel *model; GtkTreeIter iter; GtkTreePath *path; model = gtk_icon_view_get_model (GTK_ICON_VIEW (data)); path = gtk_tree_path_new_from_string (path_string); gtk_tree_model_get_iter (model, &iter, path); gtk_list_store_set (GTK_LIST_STORE (model), &iter, COL_TEXT, text, -1); gtk_tree_path_free (path); } GtkWidget * do_iconview_edit (GtkWidget *do_widget) { if (!window) { GtkWidget *icon_view; GtkListStore *store; GtkCellRenderer *renderer; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Editing and Drag-and-Drop"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); store = create_store (); fill_store (store); icon_view = gtk_icon_view_new_with_model (GTK_TREE_MODEL (store)); g_object_unref (store); gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_view), GTK_SELECTION_SINGLE); gtk_icon_view_set_item_orientation (GTK_ICON_VIEW (icon_view), GTK_ORIENTATION_HORIZONTAL); gtk_icon_view_set_columns (GTK_ICON_VIEW (icon_view), 2); gtk_icon_view_set_reorderable (GTK_ICON_VIEW (icon_view), TRUE); renderer = gtk_cell_renderer_pixbuf_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (icon_view), renderer, TRUE); gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (icon_view), renderer, set_cell_color, NULL, NULL); renderer = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (icon_view), renderer, TRUE); g_object_set (renderer, "editable", TRUE, NULL); g_signal_connect (renderer, "edited", G_CALLBACK (edited), icon_view); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (icon_view), renderer, "text", COL_TEXT, NULL); gtk_container_add (GTK_CONTAINER (window), icon_view); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)editable_cells.c./* Tree View/Editable Cells * * This demo demonstrates the use of editable cells in a GtkTreeView. If * you're new to the GtkTreeView widgets and associates, look into * the GtkListStore example first. It also shows how to use the * GtkCellRenderer::editing-started signal to do custom setup of the * editable widget. * * The cell renderers used in this demo are GtkCellRendererText, * GtkCellRendererCombo and GtkCellRendererProgress. */ #include #include #include static GtkWidget *window = NULL; typedef struct { gint number; gchar *product; gint yummy; } Item; enum { COLUMN_ITEM_NUMBER, COLUMN_ITEM_PRODUCT, COLUMN_ITEM_YUMMY, NUM_ITEM_COLUMNS }; enum { COLUMN_NUMBER_TEXT, NUM_NUMBER_COLUMNS }; static GArray *articles = NULL; static void add_items (void) { Item foo; g_return_if_fail (articles != NULL); foo.number = 3; foo.product = g_strdup ("bottles of coke"); foo.yummy = 20; g_array_append_vals (articles, &foo, 1); foo.number = 5; foo.product = g_strdup ("packages of noodles"); foo.yummy = 50; g_array_append_vals (articles, &foo, 1); foo.number = 2; foo.product = g_strdup ("packages of chocolate chip cookies"); foo.yummy = 90; g_array_append_vals (articles, &foo, 1); foo.number = 1; foo.product = g_strdup ("can vanilla ice cream"); foo.yummy = 60; g_array_append_vals (articles, &foo, 1); foo.number = 6; foo.product = g_strdup ("eggs"); foo.yummy = 10; g_array_append_vals (articles, &foo, 1); } static GtkTreeModel * create_items_model (void) { gint i = 0; GtkListStore *model; GtkTreeIter iter; /* create array */ articles = g_array_sized_new (FALSE, FALSE, sizeof (Item), 1); add_items (); /* create list store */ model = gtk_list_store_new (NUM_ITEM_COLUMNS, G_TYPE_INT, G_TYPE_STRING, G_TYPE_INT, G_TYPE_BOOLEAN); /* add items */ for (i = 0; i < articles->len; i++) { gtk_list_store_append (model, &iter); gtk_list_store_set (model, &iter, COLUMN_ITEM_NUMBER, g_array_index (articles, Item, i).number, COLUMN_ITEM_PRODUCT, g_array_index (articles, Item, i).product, COLUMN_ITEM_YUMMY, g_array_index (articles, Item, i).yummy, -1); } return GTK_TREE_MODEL (model); } static GtkTreeModel * create_numbers_model (void) { #define N_NUMBERS 10 gint i = 0; GtkListStore *model; GtkTreeIter iter; /* create list store */ model = gtk_list_store_new (NUM_NUMBER_COLUMNS, G_TYPE_STRING, G_TYPE_INT); /* add numbers */ for (i = 0; i < N_NUMBERS; i++) { char str[2]; str[0] = '0' + i; str[1] = '\0'; gtk_list_store_append (model, &iter); gtk_list_store_set (model, &iter, COLUMN_NUMBER_TEXT, str, -1); } return GTK_TREE_MODEL (model); #undef N_NUMBERS } static void add_item (GtkWidget *button, gpointer data) { Item foo; GtkTreeIter current, iter; GtkTreePath *path; GtkTreeModel *model; GtkTreeViewColumn *column; GtkTreeView *treeview = (GtkTreeView *)data; g_return_if_fail (articles != NULL); foo.number = 0; foo.product = g_strdup ("Description here"); foo.yummy = 50; g_array_append_vals (articles, &foo, 1); /* Insert a new row below the current one */ gtk_tree_view_get_cursor (treeview, &path, NULL); model = gtk_tree_view_get_model (treeview); if (path) { gtk_tree_model_get_iter (model, ¤t, path); gtk_tree_path_free (path); gtk_list_store_insert_after (GTK_LIST_STORE (model), &iter, ¤t); } else { gtk_list_store_insert (GTK_LIST_STORE (model), &iter, -1); } /* Set the data for the new row */ gtk_list_store_set (GTK_LIST_STORE (model), &iter, COLUMN_ITEM_NUMBER, foo.number, COLUMN_ITEM_PRODUCT, foo.product, COLUMN_ITEM_YUMMY, foo.yummy, -1); /* Move focus to the new row */ path = gtk_tree_model_get_path (model, &iter); column = gtk_tree_view_get_column (treeview, 0); gtk_tree_view_set_cursor (treeview, path, column, FALSE); gtk_tree_path_free (path); } static void remove_item (GtkWidget *widget, gpointer data) { GtkTreeIter iter; GtkTreeView *treeview = (GtkTreeView *)data; GtkTreeModel *model = gtk_tree_view_get_model (treeview); GtkTreeSelection *selection = gtk_tree_view_get_selection (treeview); if (gtk_tree_selection_get_selected (selection, NULL, &iter)) { gint i; GtkTreePath *path; path = gtk_tree_model_get_path (model, &iter); i = gtk_tree_path_get_indices (path)[0]; gtk_list_store_remove (GTK_LIST_STORE (model), &iter); g_array_remove_index (articles, i); gtk_tree_path_free (path); } } static gboolean separator_row (GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { GtkTreePath *path; gint idx; path = gtk_tree_model_get_path (model, iter); idx = gtk_tree_path_get_indices (path)[0]; gtk_tree_path_free (path); return idx == 5; } static void editing_started (GtkCellRenderer *cell, GtkCellEditable *editable, const gchar *path, gpointer data) { gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (editable), separator_row, NULL, NULL); } static void cell_edited (GtkCellRendererText *cell, const gchar *path_string, const gchar *new_text, gpointer data) { GtkTreeModel *model = (GtkTreeModel *)data; GtkTreePath *path = gtk_tree_path_new_from_string (path_string); GtkTreeIter iter; gint column = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (cell), "column")); gtk_tree_model_get_iter (model, &iter, path); switch (column) { case COLUMN_ITEM_NUMBER: { gint i; i = gtk_tree_path_get_indices (path)[0]; g_array_index (articles, Item, i).number = atoi (new_text); gtk_list_store_set (GTK_LIST_STORE (model), &iter, column, g_array_index (articles, Item, i).number, -1); } break; case COLUMN_ITEM_PRODUCT: { gint i; gchar *old_text; gtk_tree_model_get (model, &iter, column, &old_text, -1); g_free (old_text); i = gtk_tree_path_get_indices (path)[0]; g_free (g_array_index (articles, Item, i).product); g_array_index (articles, Item, i).product = g_strdup (new_text); gtk_list_store_set (GTK_LIST_STORE (model), &iter, column, g_array_index (articles, Item, i).product, -1); } break; } gtk_tree_path_free (path); } static void add_columns (GtkTreeView *treeview, GtkTreeModel *items_model, GtkTreeModel *numbers_model) { GtkCellRenderer *renderer; /* number column */ renderer = gtk_cell_renderer_combo_new (); g_object_set (renderer, "model", numbers_model, "text-column", COLUMN_NUMBER_TEXT, "has-entry", FALSE, "editable", TRUE, NULL); g_signal_connect (renderer, "edited", G_CALLBACK (cell_edited), items_model); g_signal_connect (renderer, "editing-started", G_CALLBACK (editing_started), NULL); g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_ITEM_NUMBER)); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, "Number", renderer, "text", COLUMN_ITEM_NUMBER, NULL); /* product column */ renderer = gtk_cell_renderer_text_new (); g_object_set (renderer, "editable", TRUE, NULL); g_signal_connect (renderer, "edited", G_CALLBACK (cell_edited), items_model); g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_ITEM_PRODUCT)); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, "Product", renderer, "text", COLUMN_ITEM_PRODUCT, NULL); /* yummy column */ renderer = gtk_cell_renderer_progress_new (); g_object_set_data (G_OBJECT (renderer), "column", GINT_TO_POINTER (COLUMN_ITEM_YUMMY)); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, "Yummy", renderer, "value", COLUMN_ITEM_YUMMY, NULL); } GtkWidget * do_editable_cells (GtkWidget *do_widget) { if (!window) { GtkWidget *vbox; GtkWidget *hbox; GtkWidget *sw; GtkWidget *treeview; GtkWidget *button; GtkTreeModel *items_model; GtkTreeModel *numbers_model; /* create window, etc */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Shopping list"); gtk_container_set_border_width (GTK_CONTAINER (window), 5); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Shopping list (you can edit the cells!)"), FALSE, FALSE, 0); sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_ETCHED_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0); /* create models */ items_model = create_items_model (); numbers_model = create_numbers_model (); /* create tree view */ treeview = gtk_tree_view_new_with_model (items_model); gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)), GTK_SELECTION_SINGLE); add_columns (GTK_TREE_VIEW (treeview), items_model, numbers_model); g_object_unref (numbers_model); g_object_unref (items_model); gtk_container_add (GTK_CONTAINER (sw), treeview); /* some buttons */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); button = gtk_button_new_with_label ("Add item"); g_signal_connect (button, "clicked", G_CALLBACK (add_item), treeview); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0); button = gtk_button_new_with_label ("Remove item"); g_signal_connect (button, "clicked", G_CALLBACK (remove_item), treeview); gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0); gtk_window_set_default_size (GTK_WINDOW (window), 320, 200); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)spinner.c /* Spinner * * GtkSpinner allows to show that background activity is on-going. * */ #include #include static GtkWidget *window = NULL; static GtkWidget *spinner_sensitive = NULL; static GtkWidget *spinner_unsensitive = NULL; static void on_play_clicked (GtkButton *button, gpointer user_data) { gtk_spinner_start (GTK_SPINNER (spinner_sensitive)); gtk_spinner_start (GTK_SPINNER (spinner_unsensitive)); } static void on_stop_clicked (GtkButton *button, gpointer user_data) { gtk_spinner_stop (GTK_SPINNER (spinner_sensitive)); gtk_spinner_stop (GTK_SPINNER (spinner_unsensitive)); } GtkWidget * do_spinner (GtkWidget *do_widget) { GtkWidget *content_area; GtkWidget *vbox; GtkWidget *hbox; GtkWidget *button; GtkWidget *spinner; if (!window) { window = gtk_dialog_new_with_buttons ("GtkSpinner", GTK_WINDOW (do_widget), 0, _("_Close"), GTK_RESPONSE_NONE, NULL); gtk_window_set_resizable (GTK_WINDOW (window), FALSE); g_signal_connect (window, "response", G_CALLBACK (gtk_widget_destroy), NULL); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); content_area = gtk_dialog_get_content_area (GTK_DIALOG (window)); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); /* Sensitive */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); spinner = gtk_spinner_new (); gtk_container_add (GTK_CONTAINER (hbox), spinner); gtk_container_add (GTK_CONTAINER (hbox), gtk_entry_new ()); gtk_container_add (GTK_CONTAINER (vbox), hbox); spinner_sensitive = spinner; /* Disabled */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); spinner = gtk_spinner_new (); gtk_container_add (GTK_CONTAINER (hbox), spinner); gtk_container_add (GTK_CONTAINER (hbox), gtk_entry_new ()); gtk_container_add (GTK_CONTAINER (vbox), hbox); spinner_unsensitive = spinner; gtk_widget_set_sensitive (hbox, FALSE); button = gtk_button_new_with_label (_("Play")); g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (on_play_clicked), spinner); gtk_container_add (GTK_CONTAINER (vbox), button); button = gtk_button_new_with_label (_("Stop")); g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (on_stop_clicked), spinner); gtk_container_add (GTK_CONTAINER (vbox), button); /* Start by default to test for: * https://bugzilla.gnome.org/show_bug.cgi?id=598496 */ on_play_clicked (NULL, NULL); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else gtk_widget_destroy (window); return window; } (uuay)popover.c/* Popovers * * A bubble-like window containing contextual information or options. * GtkPopovers can be attached to any widget, and will be displayed * within the same window, but on top of all its content. */ #include static void toggle_changed_cb (GtkToggleButton *button, GtkWidget *popover) { gtk_widget_set_visible (popover, gtk_toggle_button_get_active (button)); } static GtkWidget * create_popover (GtkWidget *parent, GtkWidget *child, GtkPositionType pos) { GtkWidget *popover; popover = gtk_popover_new (parent); gtk_popover_set_position (GTK_POPOVER (popover), pos); gtk_container_add (GTK_CONTAINER (popover), child); gtk_container_set_border_width (GTK_CONTAINER (popover), 6); gtk_widget_show (child); return popover; } static GtkWidget * create_complex_popover (GtkWidget *parent, GtkPositionType pos) { GtkWidget *popover, *window, *content; GtkBuilder *builder; builder = gtk_builder_new (); gtk_builder_add_from_resource (builder, "/popover/popover.ui", NULL); window = GTK_WIDGET (gtk_builder_get_object (builder, "window")); content = gtk_bin_get_child (GTK_BIN (window)); g_object_ref (content); gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (content)), content); gtk_widget_destroy (window); g_object_unref (builder); popover = create_popover (parent, content, GTK_POS_BOTTOM); g_object_unref (content); gtk_widget_set_size_request (popover, 200, -1); gtk_widget_set_vexpand (popover, TRUE); gtk_widget_set_margin_start (popover, 10); gtk_widget_set_margin_end (popover, 10); gtk_widget_set_margin_bottom (popover, 10); return popover; } static void entry_size_allocate_cb (GtkEntry *entry, GtkAllocation *allocation, gpointer user_data) { GtkEntryIconPosition popover_pos; GtkPopover *popover = user_data; cairo_rectangle_int_t rect; if (gtk_widget_is_visible (GTK_WIDGET (popover))) { popover_pos = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (entry), "popover-icon-pos")); gtk_entry_get_icon_area (entry, popover_pos, &rect); gtk_popover_set_pointing_to (GTK_POPOVER (popover), &rect); } } static void entry_icon_press_cb (GtkEntry *entry, GtkEntryIconPosition icon_pos, GdkEvent *event, gpointer user_data) { GtkWidget *popover = user_data; cairo_rectangle_int_t rect; gtk_entry_get_icon_area (entry, icon_pos, &rect); gtk_popover_set_pointing_to (GTK_POPOVER (popover), &rect); gtk_widget_show (popover); g_object_set_data (G_OBJECT (entry), "popover-icon-pos", GUINT_TO_POINTER (icon_pos)); } static void day_selected_cb (GtkCalendar *calendar, gpointer user_data) { cairo_rectangle_int_t rect; GtkAllocation allocation; GtkWidget *popover; GdkEvent *event; event = gtk_get_current_event (); if (event->type != GDK_BUTTON_PRESS) return; gdk_window_coords_to_parent (event->button.window, event->button.x, event->button.y, &event->button.x, &event->button.y); gtk_widget_get_allocation (GTK_WIDGET (calendar), &allocation); rect.x = event->button.x - allocation.x; rect.y = event->button.y - allocation.y; rect.width = rect.height = 1; popover = create_popover (GTK_WIDGET (calendar), gtk_entry_new (), GTK_POS_BOTTOM); gtk_popover_set_pointing_to (GTK_POPOVER (popover), &rect); gtk_widget_show (popover); gdk_event_free (event); } GtkWidget * do_popover (GtkWidget *do_widget) { static GtkWidget *window = NULL; GtkWidget *popover, *box, *widget; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 24); gtk_container_set_border_width (GTK_CONTAINER (box), 24); gtk_container_add (GTK_CONTAINER (window), box); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); widget = gtk_toggle_button_new_with_label ("Button"); popover = create_popover (widget, gtk_label_new ("This popover does not grab input"), GTK_POS_TOP); gtk_popover_set_modal (GTK_POPOVER (popover), FALSE); g_signal_connect (widget, "toggled", G_CALLBACK (toggle_changed_cb), popover); gtk_container_add (GTK_CONTAINER (box), widget); widget = gtk_entry_new (); popover = create_complex_popover (widget, GTK_POS_TOP); gtk_entry_set_icon_from_icon_name (GTK_ENTRY (widget), GTK_ENTRY_ICON_PRIMARY, "edit-find"); gtk_entry_set_icon_from_icon_name (GTK_ENTRY (widget), GTK_ENTRY_ICON_SECONDARY, "edit-clear"); g_signal_connect (widget, "icon-press", G_CALLBACK (entry_icon_press_cb), popover); g_signal_connect (widget, "size-allocate", G_CALLBACK (entry_size_allocate_cb), popover); gtk_container_add (GTK_CONTAINER (box), widget); widget = gtk_calendar_new (); g_signal_connect (widget, "day-selected", G_CALLBACK (day_selected_cb), NULL); gtk_container_add (GTK_CONTAINER (box), widget); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)images/)css_shadows/ Szcss_accordion/>upickers.cf /* Pickers * * These widgets are mainly intended for use in preference dialogs. * They allow to select colors, fonts, files, directories and applications. */ #include GtkWidget * do_pickers (GtkWidget *do_widget) { static GtkWidget *window = NULL; GtkWidget *table, *label, *picker; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Pickers"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_container_set_border_width (GTK_CONTAINER (window), 10); table = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (table), 3); gtk_grid_set_column_spacing (GTK_GRID (table), 10); gtk_container_add (GTK_CONTAINER (window), table); gtk_container_set_border_width (GTK_CONTAINER (table), 10); label = gtk_label_new ("Color:"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); gtk_widget_set_hexpand (label, TRUE); picker = gtk_color_button_new (); gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1); gtk_grid_attach (GTK_GRID (table), picker, 1, 0, 1, 1); label = gtk_label_new ("Font:"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); gtk_widget_set_hexpand (label, TRUE); picker = gtk_font_button_new (); gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1); gtk_grid_attach (GTK_GRID (table), picker, 1, 1, 1, 1); label = gtk_label_new ("File:"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); gtk_widget_set_hexpand (label, TRUE); picker = gtk_file_chooser_button_new ("Pick a File", GTK_FILE_CHOOSER_ACTION_OPEN); gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1); gtk_grid_attach (GTK_GRID (table), picker, 1, 2, 1, 1); label = gtk_label_new ("Folder:"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); picker = gtk_file_chooser_button_new ("Pick a Folder", GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); gtk_grid_attach (GTK_GRID (table), label, 0, 3, 1, 1); gtk_grid_attach (GTK_GRID (table), picker, 1, 3, 1, 1); label = gtk_label_new ("Mail:"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); gtk_widget_set_hexpand (label, TRUE); picker = gtk_app_chooser_button_new ("x-scheme-handler/mailto"); gtk_app_chooser_button_set_show_dialog_item (GTK_APP_CHOOSER_BUTTON (picker), TRUE); gtk_grid_attach (GTK_GRID (table), label, 0, 4, 1, 1); gtk_grid_attach (GTK_GRID (table), picker, 1, 4, 1, 1); } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)listbox.c-/* List Box * * GtkListBox allows lists with complicated layouts, using * regular widgets supporting sorting and filtering. * */ #include #include #include static GdkPixbuf *avatar_pixbuf_other; static GtkWidget *window = NULL; #define GTK_TYPE_MESSAGE (gtk_message_get_type ()) #define GTK_MESSAGE(message) (G_TYPE_CHECK_INSTANCE_CAST ((message), GTK_TYPE_MESSAGE, GtkMessage)) #define GTK_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MESSAGE, GtkMessageClass)) #define GTK_IS_MESSAGE(message) (G_TYPE_CHECK_INSTANCE_TYPE ((message), GTK_TYPE_MESSAGE)) #define GTK_IS_MESSAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MESSAGE)) #define GTK_MESSAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MESSAGE, GtkMessageClass)) #define GTK_TYPE_MESSAGE_ROW (gtk_message_row_get_type ()) #define GTK_MESSAGE_ROW(message_row) (G_TYPE_CHECK_INSTANCE_CAST ((message_row), GTK_TYPE_MESSAGE_ROW, GtkMessageRow)) #define GTK_MESSAGE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MESSAGE_ROW, GtkMessageRowClass)) #define GTK_IS_MESSAGE_ROW(message_row) (G_TYPE_CHECK_INSTANCE_TYPE ((message_row), GTK_TYPE_MESSAGE_ROW)) #define GTK_IS_MESSAGE_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MESSAGE_ROW)) #define GTK_MESSAGE_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MESSAGE_ROW, GtkMessageRowClass)) typedef struct _GtkMessage GtkMessage; typedef struct _GtkMessageClass GtkMessageClass; typedef struct _GtkMessageRow GtkMessageRow; typedef struct _GtkMessageRowClass GtkMessageRowClass; typedef struct _GtkMessageRowPrivate GtkMessageRowPrivate; struct _GtkMessage { GObject parent; guint id; char *sender_name; char *sender_nick; char *message; gint64 time; guint reply_to; char *resent_by; int n_favorites; int n_reshares; }; struct _GtkMessageClass { GObjectClass parent_class; }; struct _GtkMessageRow { GtkListBoxRow parent; GtkMessageRowPrivate *priv; }; struct _GtkMessageRowClass { GtkListBoxRowClass parent_class; }; struct _GtkMessageRowPrivate { GtkMessage *message; GtkRevealer *details_revealer; GtkImage *avatar_image; GtkWidget *extra_buttons_box; GtkLabel *content_label; GtkLabel *source_name; GtkLabel *source_nick; GtkLabel *short_time_label; GtkLabel *detailed_time_label; GtkBox *resent_box; GtkLinkButton *resent_by_button; GtkLabel *n_favorites_label; GtkLabel *n_reshares_label; GtkButton *expand_button; }; GType gtk_message_get_type (void) G_GNUC_CONST; GType gtk_message_row_get_type (void) G_GNUC_CONST; G_DEFINE_TYPE (GtkMessage, gtk_message, G_TYPE_OBJECT); static void gtk_message_class_init (GtkMessageClass *klass) { } static void gtk_message_init (GtkMessage *msg) { } static void gtk_message_parse (GtkMessage *msg, const char *str) { char **strv; int i; strv = g_strsplit (str, "|", 0); i = 0; msg->id = strtol (strv[i++], NULL, 10); msg->sender_name = g_strdup (strv[i++]); msg->sender_nick = g_strdup (strv[i++]); msg->message = g_strdup (strv[i++]); msg->time = strtol (strv[i++], NULL, 10); if (strv[i]) { msg->reply_to = strtol (strv[i++], NULL, 10); if (strv[i]) { if (*strv[i]) msg->resent_by = g_strdup (strv[i]); i++; if (strv[i]) { msg->n_favorites = strtol (strv[i++], NULL, 10); if (strv[i]) { msg->n_reshares = strtol (strv[i++], NULL, 10); } } } } g_strfreev (strv); } static GtkMessage * gtk_message_new (const char *str) { GtkMessage *msg; msg = g_object_new (gtk_message_get_type (), NULL); gtk_message_parse (msg, str); return msg; } G_DEFINE_TYPE_WITH_PRIVATE (GtkMessageRow, gtk_message_row, GTK_TYPE_LIST_BOX_ROW); static void gtk_message_row_update (GtkMessageRow *row) { GtkMessageRowPrivate *priv = row->priv; GDateTime *t; char *s; gtk_label_set_text (priv->source_name, priv->message->sender_name); gtk_label_set_text (priv->source_nick, priv->message->sender_nick); gtk_label_set_text (priv->content_label, priv->message->message); t = g_date_time_new_from_unix_utc (priv->message->time); s = g_date_time_format (t, "%e %b %y"); gtk_label_set_text (priv->short_time_label, s); g_free (s); s = g_date_time_format (t, "%X - %e %b %Y"); gtk_label_set_text (priv->detailed_time_label, s); g_free (s); gtk_widget_set_visible (GTK_WIDGET(priv->n_favorites_label), priv->message->n_favorites != 0); s = g_strdup_printf ("%d\nFavorites", priv->message->n_favorites); gtk_label_set_markup (priv->n_favorites_label, s); g_free (s); gtk_widget_set_visible (GTK_WIDGET(priv->n_reshares_label), priv->message->n_reshares != 0); s = g_strdup_printf ("%d\nReshares", priv->message->n_reshares); gtk_label_set_markup (priv->n_reshares_label, s); g_free (s); gtk_widget_set_visible (GTK_WIDGET (priv->resent_box), priv->message->resent_by != NULL); if (priv->message->resent_by) gtk_button_set_label (GTK_BUTTON (priv->resent_by_button), priv->message->resent_by); if (strcmp (priv->message->sender_nick, "@GTKtoolkit") == 0) gtk_image_set_from_icon_name (priv->avatar_image, "gtk3-demo", GTK_ICON_SIZE_DND); else gtk_image_set_from_pixbuf (priv->avatar_image, avatar_pixbuf_other); } static void gtk_message_row_expand (GtkMessageRow *row) { GtkMessageRowPrivate *priv = row->priv; gboolean expand; expand = !gtk_revealer_get_reveal_child (priv->details_revealer); gtk_revealer_set_reveal_child (priv->details_revealer, expand); if (expand) gtk_button_set_label (priv->expand_button, "Hide"); else gtk_button_set_label (priv->expand_button, "Expand"); } static void expand_clicked (GtkMessageRow *row, GtkButton *button) { gtk_message_row_expand (row); } static void reshare_clicked (GtkMessageRow *row, GtkButton *button) { GtkMessageRowPrivate *priv = row->priv; priv->message->n_reshares++; gtk_message_row_update (row); } static void favorite_clicked (GtkMessageRow *row, GtkButton *button) { GtkMessageRowPrivate *priv = row->priv; priv->message->n_favorites++; gtk_message_row_update (row); } static void gtk_message_row_state_flags_changed (GtkWidget *widget, GtkStateFlags previous_state_flags) { GtkMessageRowPrivate *priv = GTK_MESSAGE_ROW (widget)->priv; GtkStateFlags flags; flags = gtk_widget_get_state_flags (widget); gtk_widget_set_visible (priv->extra_buttons_box, flags & (GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED)); GTK_WIDGET_CLASS (gtk_message_row_parent_class)->state_flags_changed (widget, previous_state_flags); } static void gtk_message_row_class_init (GtkMessageRowClass *klass) { GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); gtk_widget_class_set_template_from_resource (widget_class, "/listbox/listbox.ui"); gtk_widget_class_bind_template_child_private (widget_class, GtkMessageRow, content_label); gtk_widget_class_bind_template_child_private (widget_class, GtkMessageRow, source_name); gtk_widget_class_bind_template_child_private (widget_class, GtkMessageRow, source_nick); gtk_widget_class_bind_template_child_private (widget_class, GtkMessageRow, short_time_label); gtk_widget_class_bind_template_child_private (widget_class, GtkMessageRow, detailed_time_label); gtk_widget_class_bind_template_child_private (widget_class, GtkMessageRow, extra_buttons_box); gtk_widget_class_bind_template_child_private (widget_class, GtkMessageRow, details_revealer); gtk_widget_class_bind_template_child_private (widget_class, GtkMessageRow, avatar_image); gtk_widget_class_bind_template_child_private (widget_class, GtkMessageRow, resent_box); gtk_widget_class_bind_template_child_private (widget_class, GtkMessageRow, resent_by_button); gtk_widget_class_bind_template_child_private (widget_class, GtkMessageRow, n_reshares_label); gtk_widget_class_bind_template_child_private (widget_class, GtkMessageRow, n_favorites_label); gtk_widget_class_bind_template_child_private (widget_class, GtkMessageRow, expand_button); gtk_widget_class_bind_template_callback (widget_class, expand_clicked); gtk_widget_class_bind_template_callback (widget_class, reshare_clicked); gtk_widget_class_bind_template_callback (widget_class, favorite_clicked); widget_class->state_flags_changed = gtk_message_row_state_flags_changed; } static void gtk_message_row_init (GtkMessageRow *row) { row->priv = gtk_message_row_get_instance_private (row); gtk_widget_init_template (GTK_WIDGET (row)); } static GtkMessageRow * gtk_message_row_new (GtkMessage *message) { GtkMessageRow *row; row = g_object_new (gtk_message_row_get_type (), NULL); row->priv->message = message; gtk_message_row_update (row); return row; } static int gtk_message_row_sort (GtkMessageRow *a, GtkMessageRow *b, gpointer data) { return a->priv->message->time - b->priv->message->time; } static void row_activated (GtkListBox *listbox, GtkListBoxRow *row) { gtk_message_row_expand (GTK_MESSAGE_ROW (row)); } GtkWidget * do_listbox (GtkWidget *do_widget) { GtkWidget *scrolled, *listbox, *vbox, *label; GtkMessage *message; GtkMessageRow *row; GBytes *data; char **lines; int i; if (!window) { avatar_pixbuf_other = gdk_pixbuf_new_from_resource_at_scale ("/listbox/apple-red.png", 32, 32, FALSE, NULL); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "List Box"); gtk_window_set_default_size (GTK_WINDOW (window), 400, 600); /* NULL window variable when window is closed */ g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_container_add (GTK_CONTAINER (window), vbox); label = gtk_label_new ("Messages from Gtk+ and friends"); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); scrolled = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX (vbox), scrolled, TRUE, TRUE, 0); listbox = gtk_list_box_new (); gtk_container_add (GTK_CONTAINER (scrolled), listbox); gtk_list_box_set_sort_func (GTK_LIST_BOX (listbox), (GtkListBoxSortFunc)gtk_message_row_sort, listbox, NULL); gtk_list_box_set_activate_on_single_click (GTK_LIST_BOX (listbox), FALSE); g_signal_connect (listbox, "row-activated", G_CALLBACK (row_activated), NULL); gtk_widget_show_all (vbox); data = g_resources_lookup_data ("/listbox/messages.txt", 0, NULL); lines = g_strsplit (g_bytes_get_data (data, NULL), "\n", 0); for (i = 0; lines[i] != NULL && *lines[i]; i++) { message = gtk_message_new (lines[i]); row = gtk_message_row_new (message); gtk_widget_show (GTK_WIDGET (row)); gtk_container_add (GTK_CONTAINER (listbox), GTK_WIDGET (row)); } g_strfreev (lines); } if (!gtk_widget_get_visible (window)) gtk_widget_show (window); else gtk_widget_destroy (window); return window; } (uuay)theming.ui7 6 vertical True False True False False True False False Normal True True edit-find False True False True False False Active True True edit-find True False True False True False False Insensitive True True edit-find False True False True False Raised True True edit-find-symbolic False True False True False Raised Active True True edit-find-symbolic True False True False True False False Insensitive Active True edit-find True True False True False True False True True Search... edit-find-symbolic False False True False True True False True False horizontal center center Hi, I am a button False True True True False False True 0 And I'm another button False True True True False False True 1 This is a button party! False True True True False False True 2 True False True 1 False True False False Normal True list-add-symbolic False True False True False False Normal True list-add-symbolic False True False True False False Active True list-remove-symbolic True False True False True False False Active True list-remove-symbolic True False True False True False False False Insensitive True edit-find-symbolic False True False True False False False Insensitive Active True go-up-symbolic True False True (uuay)gestures.c/* Gestures * * Perform gestures on touchscreens and other input devices. This * demo reacts to long presses and swipes from all devices, plus * multi-touch rotate and zoom gestures. */ #include static GtkWidget *window = NULL; static GtkGesture *rotate = NULL; static GtkGesture *zoom = NULL; static gdouble swipe_x = 0; static gdouble swipe_y = 0; static gboolean long_pressed = FALSE; static void swipe_gesture_swept (GtkGestureSwipe *gesture, gdouble velocity_x, gdouble velocity_y, GtkWidget *widget) { swipe_x = velocity_x / 10; swipe_y = velocity_y / 10; gtk_widget_queue_draw (widget); } static void long_press_gesture_pressed (GtkGestureLongPress *gesture, gdouble x, gdouble y, GtkWidget *widget) { long_pressed = TRUE; gtk_widget_queue_draw (widget); } static void long_press_gesture_end (GtkGesture *gesture, GdkEventSequence *sequence, GtkWidget *widget) { long_pressed = FALSE; gtk_widget_queue_draw (widget); } static void rotation_angle_changed (GtkGestureRotate *gesture, gdouble angle, gdouble delta, GtkWidget *widget) { gtk_widget_queue_draw (widget); } static void zoom_scale_changed (GtkGestureZoom *gesture, gdouble scale, GtkWidget *widget) { gtk_widget_queue_draw (widget); } static gboolean drawing_area_draw (GtkWidget *widget, cairo_t *cr) { GtkAllocation allocation; gtk_widget_get_allocation (widget, &allocation); if (swipe_x != 0 || swipe_y != 0) { cairo_save (cr); cairo_set_line_width (cr, 6); cairo_move_to (cr, allocation.width / 2, allocation.height / 2); cairo_rel_line_to (cr, swipe_x, swipe_y); cairo_set_source_rgba (cr, 1, 0, 0, 0.5); cairo_stroke (cr); cairo_restore (cr); } if (gtk_gesture_is_recognized (rotate) || gtk_gesture_is_recognized (zoom)) { cairo_pattern_t *pat; cairo_matrix_t matrix; gdouble angle, scale; cairo_matrix_init_translate (&matrix, allocation.width / 2, allocation.height / 2); cairo_save (cr); angle = gtk_gesture_rotate_get_angle_delta (GTK_GESTURE_ROTATE (rotate)); cairo_matrix_rotate (&matrix, angle); scale = gtk_gesture_zoom_get_scale_delta (GTK_GESTURE_ZOOM (zoom)); cairo_matrix_scale (&matrix, scale, scale); cairo_set_matrix (cr, &matrix); cairo_rectangle (cr, -100, -100, 200, 200); pat = cairo_pattern_create_linear (-100, 0, 200, 0); cairo_pattern_add_color_stop_rgb (pat, 0, 0, 0, 1); cairo_pattern_add_color_stop_rgb (pat, 1, 1, 0, 0); cairo_set_source (cr, pat); cairo_fill (cr); cairo_restore (cr); cairo_pattern_destroy (pat); } if (long_pressed) { cairo_save (cr); cairo_arc (cr, allocation.width / 2, allocation.height / 2, 50, 0, 2 * G_PI); cairo_set_source_rgba (cr, 0, 1, 0, 0.5); cairo_stroke (cr); cairo_restore (cr); } return TRUE; } GtkWidget * do_gestures (GtkWidget *do_widget) { GtkWidget *drawing_area; GtkGesture *gesture; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 400, 400); gtk_window_set_title (GTK_WINDOW (window), "Gestures demo"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); drawing_area = gtk_drawing_area_new (); gtk_container_add (GTK_CONTAINER (window), drawing_area); gtk_widget_add_events (drawing_area, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_TOUCH_MASK); g_signal_connect (drawing_area, "draw", G_CALLBACK (drawing_area_draw), NULL); /* Swipe */ gesture = gtk_gesture_swipe_new (drawing_area); g_signal_connect (gesture, "swipe", G_CALLBACK (swipe_gesture_swept), drawing_area); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); g_object_weak_ref (G_OBJECT (drawing_area), (GWeakNotify) g_object_unref, gesture); /* Long press */ gesture = gtk_gesture_long_press_new (drawing_area); g_signal_connect (gesture, "pressed", G_CALLBACK (long_press_gesture_pressed), drawing_area); g_signal_connect (gesture, "end", G_CALLBACK (long_press_gesture_end), drawing_area); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); g_object_weak_ref (G_OBJECT (drawing_area), (GWeakNotify) g_object_unref, gesture); /* Rotate */ rotate = gesture = gtk_gesture_rotate_new (drawing_area); g_signal_connect (gesture, "angle-changed", G_CALLBACK (rotation_angle_changed), drawing_area); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); g_object_weak_ref (G_OBJECT (drawing_area), (GWeakNotify) g_object_unref, gesture); /* Zoom */ zoom = gesture = gtk_gesture_zoom_new (drawing_area); g_signal_connect (gesture, "scale-changed", G_CALLBACK (zoom_scale_changed), drawing_area); gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER (gesture), GTK_PHASE_BUBBLE); g_object_weak_ref (G_OBJECT (drawing_area), (GWeakNotify) g_object_unref, gesture); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)images.c6/* Images * * GtkImage is used to display an image; the image can be in a number of formats. * Typically, you load an image into a GdkPixbuf, then display the pixbuf. * * This demo code shows some of the more obscure cases, in the simple * case a call to gtk_image_new_from_file() is all you need. * * If you want to put image data in your program as a C variable, * use the make-inline-pixbuf program that comes with GTK+. * This way you won't need to depend on loading external files, your * application binary can be self-contained. */ #include #include #include #include static GtkWidget *window = NULL; static GdkPixbufLoader *pixbuf_loader = NULL; static guint load_timeout = 0; static GInputStream * image_stream = NULL; static void progressive_prepared_callback (GdkPixbufLoader *loader, gpointer data) { GdkPixbuf *pixbuf; GtkWidget *image; image = GTK_WIDGET (data); pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); /* Avoid displaying random memory contents, since the pixbuf * isn't filled in yet. */ gdk_pixbuf_fill (pixbuf, 0xaaaaaaff); gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf); } static void progressive_updated_callback (GdkPixbufLoader *loader, gint x, gint y, gint width, gint height, gpointer data) { GtkWidget *image; GdkPixbuf *pixbuf; image = GTK_WIDGET (data); /* We know the pixbuf inside the GtkImage has changed, but the image * itself doesn't know this; so give it a hint by setting the pixbuf * again. Queuing a redraw used to be sufficient, but nowadays GtkImage * uses GtkIconHelper which caches the pixbuf state and will just redraw * from the cache. */ pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (image)); g_object_ref (pixbuf); gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf); g_object_unref (pixbuf); } static gint progressive_timeout (gpointer data) { GtkWidget *image; image = GTK_WIDGET (data); /* This shows off fully-paranoid error handling, so looks scary. * You could factor out the error handling code into a nice separate * function to make things nicer. */ if (image_stream) { gssize bytes_read; guchar buf[256]; GError *error = NULL; bytes_read = g_input_stream_read (image_stream, buf, 256, NULL, &error); if (bytes_read < 0) { GtkWidget *dialog; dialog = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Failure reading image file 'alphatest.png': %s", error->message); g_error_free (error); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); g_object_unref (image_stream); image_stream = NULL; gtk_widget_show (dialog); load_timeout = 0; return FALSE; /* uninstall the timeout */ } if (!gdk_pixbuf_loader_write (pixbuf_loader, buf, bytes_read, &error)) { GtkWidget *dialog; dialog = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Failed to load image: %s", error->message); g_error_free (error); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); g_object_unref (image_stream); image_stream = NULL; gtk_widget_show (dialog); load_timeout = 0; return FALSE; /* uninstall the timeout */ } if (bytes_read == 0) { /* Errors can happen on close, e.g. if the image * file was truncated we'll know on close that * it was incomplete. */ error = NULL; if (!g_input_stream_close (image_stream, NULL, &error)) { GtkWidget *dialog; dialog = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Failed to load image: %s", error->message); g_error_free (error); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show (dialog); g_object_unref (image_stream); image_stream = NULL; g_object_unref (pixbuf_loader); pixbuf_loader = NULL; load_timeout = 0; return FALSE; /* uninstall the timeout */ } g_object_unref (image_stream); image_stream = NULL; /* Errors can happen on close, e.g. if the image * file was truncated we'll know on close that * it was incomplete. */ error = NULL; if (!gdk_pixbuf_loader_close (pixbuf_loader, &error)) { GtkWidget *dialog; dialog = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Failed to load image: %s", error->message); g_error_free (error); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show (dialog); g_object_unref (pixbuf_loader); pixbuf_loader = NULL; load_timeout = 0; return FALSE; /* uninstall the timeout */ } g_object_unref (pixbuf_loader); pixbuf_loader = NULL; } } else { GError *error = NULL; image_stream = g_resources_open_stream ("/images/alphatest.png", 0, &error); if (image_stream == NULL) { GtkWidget *dialog; dialog = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", error->message); g_error_free (error); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show (dialog); load_timeout = 0; return FALSE; /* uninstall the timeout */ } if (pixbuf_loader) { gdk_pixbuf_loader_close (pixbuf_loader, NULL); g_object_unref (pixbuf_loader); } pixbuf_loader = gdk_pixbuf_loader_new (); g_signal_connect (pixbuf_loader, "area-prepared", G_CALLBACK (progressive_prepared_callback), image); g_signal_connect (pixbuf_loader, "area-updated", G_CALLBACK (progressive_updated_callback), image); } /* leave timeout installed */ return TRUE; } static void start_progressive_loading (GtkWidget *image) { /* This is obviously totally contrived (we slow down loading * on purpose to show how incremental loading works). * The real purpose of incremental loading is the case where * you are reading data from a slow source such as the network. * The timeout simply simulates a slow data source by inserting * pauses in the reading process. */ load_timeout = gdk_threads_add_timeout (150, progressive_timeout, image); g_source_set_name_by_id (load_timeout, "[gtk+] progressive_timeout"); } static void cleanup_callback (GObject *object, gpointer data) { if (load_timeout) { g_source_remove (load_timeout); load_timeout = 0; } if (pixbuf_loader) { gdk_pixbuf_loader_close (pixbuf_loader, NULL); g_object_unref (pixbuf_loader); pixbuf_loader = NULL; } if (image_stream) { g_object_unref (image_stream); image_stream = NULL; } } static void toggle_sensitivity_callback (GtkWidget *togglebutton, gpointer user_data) { GtkContainer *container = user_data; GList *list; GList *tmp; list = gtk_container_get_children (container); tmp = list; while (tmp != NULL) { /* don't disable our toggle */ if (GTK_WIDGET (tmp->data) != togglebutton) gtk_widget_set_sensitive (GTK_WIDGET (tmp->data), !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (togglebutton))); tmp = tmp->next; } g_list_free (list); } GtkWidget * do_images (GtkWidget *do_widget) { GtkWidget *frame; GtkWidget *vbox; GtkWidget *image; GtkWidget *label; GtkWidget *button; GIcon *gicon; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Images"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); g_signal_connect (window, "destroy", G_CALLBACK (cleanup_callback), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 8); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_container_add (GTK_CONTAINER (window), vbox); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "Image loaded from a file"); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_widget_set_halign (frame, GTK_ALIGN_CENTER); gtk_widget_set_valign (frame, GTK_ALIGN_CENTER); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); image = gtk_image_new_from_icon_name ("gtk3-demo", GTK_ICON_SIZE_DIALOG); gtk_container_add (GTK_CONTAINER (frame), image); /* Animation */ label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "Animation loaded from a file"); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_widget_set_halign (frame, GTK_ALIGN_CENTER); gtk_widget_set_valign (frame, GTK_ALIGN_CENTER); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); image = gtk_image_new_from_resource ("/images/floppybuddy.gif"); gtk_container_add (GTK_CONTAINER (frame), image); /* Symbolic icon */ label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "Symbolic themed icon"); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_widget_set_halign (frame, GTK_ALIGN_CENTER); gtk_widget_set_valign (frame, GTK_ALIGN_CENTER); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gicon = g_themed_icon_new_with_default_fallbacks ("battery-caution-charging-symbolic"); image = gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_DIALOG); gtk_container_add (GTK_CONTAINER (frame), image); /* Progressive */ label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "Progressive image loading"); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_widget_set_halign (frame, GTK_ALIGN_CENTER); gtk_widget_set_valign (frame, GTK_ALIGN_CENTER); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); /* Create an empty image for now; the progressive loader * will create the pixbuf and fill it in. */ image = gtk_image_new_from_pixbuf (NULL); gtk_container_add (GTK_CONTAINER (frame), image); start_progressive_loading (image); /* Sensitivity control */ button = gtk_toggle_button_new_with_mnemonic ("_Insensitive"); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); g_signal_connect (button, "toggled", G_CALLBACK (toggle_sensitivity_callback), vbox); } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)iconview.c#/* Icon View/Icon View Basics * * The GtkIconView widget is used to display and manipulate icons. * It uses a GtkTreeModel for data storage, so the list store * example might be helpful. */ #include #include #include static GtkWidget *window = NULL; #define FOLDER_NAME "/iconview/gnome-fs-directory.png" #define FILE_NAME "/iconview/gnome-fs-regular.png" enum { COL_PATH, COL_DISPLAY_NAME, COL_PIXBUF, COL_IS_DIRECTORY, NUM_COLS }; static GdkPixbuf *file_pixbuf, *folder_pixbuf; gchar *parent; GtkToolItem *up_button; /* Loads the images for the demo and returns whether the operation succeeded */ static void load_pixbufs (void) { if (file_pixbuf) return; /* already loaded earlier */ file_pixbuf = gdk_pixbuf_new_from_resource (FILE_NAME, NULL); /* resources must load successfully */ g_assert (file_pixbuf); folder_pixbuf = gdk_pixbuf_new_from_resource (FOLDER_NAME, NULL); g_assert (folder_pixbuf); } static void fill_store (GtkListStore *store) { GDir *dir; const gchar *name; GtkTreeIter iter; /* First clear the store */ gtk_list_store_clear (store); /* Now go through the directory and extract all the file * information */ dir = g_dir_open (parent, 0, NULL); if (!dir) return; name = g_dir_read_name (dir); while (name != NULL) { gchar *path, *display_name; gboolean is_dir; /* We ignore hidden files that start with a '.' */ if (name[0] != '.') { path = g_build_filename (parent, name, NULL); is_dir = g_file_test (path, G_FILE_TEST_IS_DIR); display_name = g_filename_to_utf8 (name, -1, NULL, NULL, NULL); gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COL_PATH, path, COL_DISPLAY_NAME, display_name, COL_IS_DIRECTORY, is_dir, COL_PIXBUF, is_dir ? folder_pixbuf : file_pixbuf, -1); g_free (path); g_free (display_name); } name = g_dir_read_name (dir); } g_dir_close (dir); } static gint sort_func (GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data) { gboolean is_dir_a, is_dir_b; gchar *name_a, *name_b; int ret; /* We need this function because we want to sort * folders before files. */ gtk_tree_model_get (model, a, COL_IS_DIRECTORY, &is_dir_a, COL_DISPLAY_NAME, &name_a, -1); gtk_tree_model_get (model, b, COL_IS_DIRECTORY, &is_dir_b, COL_DISPLAY_NAME, &name_b, -1); if (!is_dir_a && is_dir_b) ret = 1; else if (is_dir_a && !is_dir_b) ret = -1; else { ret = g_utf8_collate (name_a, name_b); } g_free (name_a); g_free (name_b); return ret; } static GtkListStore * create_store (void) { GtkListStore *store; store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_BOOLEAN); /* Set sort column and function */ gtk_tree_sortable_set_default_sort_func (GTK_TREE_SORTABLE (store), sort_func, NULL, NULL); gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store), GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, GTK_SORT_ASCENDING); return store; } static void item_activated (GtkIconView *icon_view, GtkTreePath *tree_path, gpointer user_data) { GtkListStore *store; gchar *path; GtkTreeIter iter; gboolean is_dir; store = GTK_LIST_STORE (user_data); gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, tree_path); gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, COL_PATH, &path, COL_IS_DIRECTORY, &is_dir, -1); if (!is_dir) { g_free (path); return; } /* Replace parent with path and re-fill the model*/ g_free (parent); parent = path; fill_store (store); /* Sensitize the up button */ gtk_widget_set_sensitive (GTK_WIDGET (up_button), TRUE); } static void up_clicked (GtkToolItem *item, gpointer user_data) { GtkListStore *store; gchar *dir_name; store = GTK_LIST_STORE (user_data); dir_name = g_path_get_dirname (parent); g_free (parent); parent = dir_name; fill_store (store); /* Maybe de-sensitize the up button */ gtk_widget_set_sensitive (GTK_WIDGET (up_button), strcmp (parent, "/") != 0); } static void home_clicked (GtkToolItem *item, gpointer user_data) { GtkListStore *store; store = GTK_LIST_STORE (user_data); g_free (parent); parent = g_strdup (g_get_home_dir ()); fill_store (store); /* Sensitize the up button */ gtk_widget_set_sensitive (GTK_WIDGET (up_button), TRUE); } static void close_window(void) { gtk_widget_destroy (window); window = NULL; g_object_unref (file_pixbuf); file_pixbuf = NULL; g_object_unref (folder_pixbuf); folder_pixbuf = NULL; } GtkWidget * do_iconview (GtkWidget *do_widget) { if (!window) { GtkWidget *sw; GtkWidget *icon_view; GtkListStore *store; GtkWidget *vbox; GtkWidget *tool_bar; GtkToolItem *home_button; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size (GTK_WINDOW (window), 650, 400); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "GtkIconView demo"); g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL); load_pixbufs (); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), vbox); tool_bar = gtk_toolbar_new (); gtk_box_pack_start (GTK_BOX (vbox), tool_bar, FALSE, FALSE, 0); up_button = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_label (GTK_TOOL_BUTTON (up_button), _("_Up")); gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (up_button), TRUE); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (up_button), "go-up"); gtk_tool_item_set_is_important (up_button, TRUE); gtk_widget_set_sensitive (GTK_WIDGET (up_button), FALSE); gtk_toolbar_insert (GTK_TOOLBAR (tool_bar), up_button, -1); home_button = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_label (GTK_TOOL_BUTTON (home_button), _("_Home")); gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (home_button), TRUE); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (home_button), "go-home"); gtk_tool_item_set_is_important (home_button, TRUE); gtk_toolbar_insert (GTK_TOOLBAR (tool_bar), home_button, -1); sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_ETCHED_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0); /* Create the store and fill it with the contents of '/' */ parent = g_strdup ("/"); store = create_store (); fill_store (store); icon_view = gtk_icon_view_new_with_model (GTK_TREE_MODEL (store)); gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_view), GTK_SELECTION_MULTIPLE); g_object_unref (store); /* Connect to the "clicked" signal of the "Up" tool button */ g_signal_connect (up_button, "clicked", G_CALLBACK (up_clicked), store); /* Connect to the "clicked" signal of the "Home" tool button */ g_signal_connect (home_button, "clicked", G_CALLBACK (home_clicked), store); /* We now set which model columns that correspond to the text * and pixbuf of each item */ gtk_icon_view_set_text_column (GTK_ICON_VIEW (icon_view), COL_DISPLAY_NAME); gtk_icon_view_set_pixbuf_column (GTK_ICON_VIEW (icon_view), COL_PIXBUF); /* Connect to the "item-activated" signal */ g_signal_connect (icon_view, "item-activated", G_CALLBACK (item_activated), store); gtk_container_add (GTK_CONTAINER (sw), icon_view); gtk_widget_grab_focus (icon_view); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)floppybuddy.gif`GIF89aPF  !!!"""###$$$%%%&&&'''((()))***+++,,,---...///000111222333444555666777888999:::;;;<<<===>>>???@@@AAABBBCCCDDDEEEFFFGGGHHHIIIJJJKKKLLLMMMNNNOOOPPPQQQRRRSSSTTTUUUVVVWWWXXXYYYZZZ[[[\\\]]]^^^___```aaabbbcccdddeeefffggghhhiiijjjkkklllmmmnnnooopppqqqrrrssstttuuuvvvwwwxxxyyyzzz{{{|||}}}~~~ぁ=v{! NETSCAPE2.0! ,L> H*\ȰÇ#JHŋ3jȱǏ CIdA(S\rɅNjI̗ cJϞ@H 2hJ2rD)@*0.O[vDٕ@Xsjj׶l6$٫w5mW)9-͢{,ҁEgu8 5|bSCJ%x3|Cf ۸Icqhq}vmBN-8(U/gys_9qٵ^?9yï>d|p_M6~ϕv(ބ`.} W!*I؅І9gNAȚkhq8S)5Hgf>$JBHL:mh:QIe!I6 $0JY$dHX'umAh긑*9|jB昉aрx&be1aJYziviJ:*A*=ҫꚔ,Bk$KO9Ūl}<WL%*QMi.W~HS•;Rvն;m_2xn~).kn2zk0 .9,o[.fw#! ,L> H*\ȰÇ#JHŋ3jȱǏ CIdA(S\rɅNjI̗ cJϞ@&΃EE4eSF@TL}Z 4TIb͚P vX(Dːյj7)֩VU{n*4YR{5*ʹ ,hq |PJ|]x'ФsWZ_Sޙ'[}u[[E%č_O|9sϥ.PassSWo8yguh` w%V"h rY]ɗփvN(ǁd`]&L%Db'\~ rуxvڌԈҍ&x!AjFd("6DP8%JUqE[V``)eH_qy&[kx'QG)"}y~`1Uh!;)ZބNNf꒤v*iI+¤ҨhꥄVkj*t뎵*+Od!U_Dlv5`u]6k؎4-MfҷyfbnWJ5Ӣc$K~n 7G,T!This GIF file was assembled by CDavis with GIF Constru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S\rɅNjI̗ cJϞ@&΃EE4eSF@TL}Z 4TIb͚P vX(Dːյj7)֩VU{n*4YR{5*ʹ ,hq |PJ|]x'ФsWZ_Sޙ'[}u[[E%č_O|9sϥ.PassSWo8yguh` w%V"h rY]ɗփvN(ǁd`]&L%Db'\~ rуxvڌԈҍ&x!AjFd("6DP8%JUqE[V``)eH_qy&[kx'QG)"}y~`1Uh!;)ZބNNf꒤v*iI+¤ҨhꥄVkj*t뎵*+Od!U_Dlv5`u]6k؎4-MfҷyfbnWJ5Ӣc$K~n 7G,T!This GIF file was assembled with GIF Construction Set from: Alchemy Mindworks Inc. P.O. Box 500 Beeton, Ontario L0G 1A0 CANADA. This comment block will not appear in files created with a registered version of GIF Construction Set;(uuay)gnome-fs-directory.png$GdkP$00Kz^˼tvf$}}x)*$$||zyyzyyxwwvvu;<2_üusqqpppoonmmlly{gt|nZ\Uj}i{~hy|fx{ez}gz}fx{ey{fx{dx{ewycuycor]oq]lnZoqartctvdvwgvwgvwevwevwgy{kxyixyhvwey{j{|l{|k|~m~p}~mq|~mx\^Otwaps^or^nq\mo[nq]mo[mo[mp\mp[lo[knZZ[JikWfiVegUcfSceSdgTceSceScfSceSbeSRUD%&vvnbdR_bP^`O]`N]_N^`O]`N]_N]_N]_N]_NAB6gj]wxn_aO]_N[^M[]LZ]L[^MZ\LZ]LY[JY\K?A4BB;ʷɴɳdzï®®tMNEɳƳƳŰ}q34-~Ƴůï®|}pűİï®yzmκ͹̸̷˷ʶɵȳDzƲűݯ®wxkκ͹̷̶˶ʵɴȳDzŲıð¯vxk͸̷ʶ˵ʵȴDzƱŰİï®uvi˶ʵɴɴȳDzƱŰİï®rshɴȳdzDzƱŰįï®pqfȲDZƱŰįí¬mobŰİĮí¬lnajl_ik_hj^hj]hj]  ~}~hj]  ~}}|hj] ~}{{z{fh\ !}|zyyy{egZ&(~~|{yxxxyzceY+)~}}|zywwwxy{bdX/!)~}}|zyxwwwyz{bdW/ &~}||{zyxxyyz||bdX* {}m{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BpŸb&~i[ -IsmL y }EВe#@7w[Sx|r}ۿ,-*C;sh|hnkM͗Vȧi9d| Q>qgqq Az[4 e5'Fn,F,Dj؀BS #3 S3NS[bɷ#,NwC}yGS?8nb;q 'qF>9cbgKVZKMAt1`wTSk.GzT{*/$|QIFi;Q_Wftwvunb"bۄBͼ՞^KJOret@tKb5ע׿t;t]> \E;Ap1<vsqd$8GuVҳDtU *_`k<%T :ڸ Y +. ~n@qͰ3|+FAu 50d`qf"B.xQNH$T$c[M2>pKη&3@^Rwՙ2nu qAz[{E A|yA)I)$O L{SqOeIv!vgD9tIN [91"4Ǧhd;[[.) [C̯6 *Tj@]<mZx6[ȩᦙ5@U΁ 0p(\ 8]ۻĒ,rkwk /a\aH\mЉie^5sDA4\ϜK4# MSKTOÉKi={b)4s-mv}r6ަԘ63mҏ |]ktw[jRl.u!'ˌh\0@.EGL/ gx81l> X?cS!QC #include #include /* The ChangeDisplayInfo structure corresponds to a toplevel window and * holds pointers to widgets inside the toplevel window along with other * information about the contents of the window. * This is a common organizational structure in real applications. */ typedef struct _ChangeDisplayInfo ChangeDisplayInfo; struct _ChangeDisplayInfo { GtkWidget *window; GtkSizeGroup *size_group; GtkTreeModel *display_model; GdkDisplay *current_display; }; /* These enumerations provide symbolic names for the columns * in the two GtkListStore models. */ enum { DISPLAY_COLUMN_NAME, DISPLAY_COLUMN_DISPLAY, DISPLAY_NUM_COLUMNS }; enum { SCREEN_COLUMN_NUMBER, SCREEN_COLUMN_SCREEN, SCREEN_NUM_COLUMNS }; /* Finds the toplevel window under the mouse pointer, if any. */ static GtkWidget * find_toplevel_at_pointer (GdkDisplay *display) { GdkWindow *pointer_window; GtkWidget *widget = NULL; pointer_window = gdk_device_get_window_at_position (gtk_get_current_event_device (), NULL, NULL); /* The user data field of a GdkWindow is used to store a pointer * to the widget that created it. */ if (pointer_window) { gpointer widget_ptr; gdk_window_get_user_data (pointer_window, &widget_ptr); widget = widget_ptr; } return widget ? gtk_widget_get_toplevel (widget) : NULL; } static gboolean button_release_event_cb (GtkWidget *widget, GdkEventButton *event, gboolean *clicked) { *clicked = TRUE; return TRUE; } /* Asks the user to click on a window, then waits for them click * the mouse. When the mouse is released, returns the toplevel * window under the pointer, or NULL, if there is none. */ static GtkWidget * query_for_toplevel (GdkScreen *screen, const char *prompt) { GdkDisplay *display = gdk_screen_get_display (screen); GtkWidget *popup, *label, *frame; GdkCursor *cursor; GtkWidget *toplevel = NULL; popup = gtk_window_new (GTK_WINDOW_POPUP); gtk_window_set_screen (GTK_WINDOW (popup), screen); gtk_window_set_modal (GTK_WINDOW (popup), TRUE); gtk_window_set_position (GTK_WINDOW (popup), GTK_WIN_POS_CENTER); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); gtk_container_add (GTK_CONTAINER (popup), frame); label = gtk_label_new (prompt); g_object_set (label, "margin", 10, NULL); gtk_container_add (GTK_CONTAINER (frame), label); gtk_widget_show_all (popup); cursor = gdk_cursor_new_for_display (display, GDK_CROSSHAIR); if (gdk_device_grab (gtk_get_current_event_device (), gtk_widget_get_window (popup), GDK_OWNERSHIP_NONE, FALSE, GDK_BUTTON_RELEASE_MASK, cursor, GDK_CURRENT_TIME) == GDK_GRAB_SUCCESS) { gboolean clicked = FALSE; g_signal_connect (popup, "button-release-event", G_CALLBACK (button_release_event_cb), &clicked); /* Process events until clicked is set by button_release_event_cb. * We pass in may_block=TRUE since we want to wait if there * are no events currently. */ while (!clicked) g_main_context_iteration (NULL, TRUE); toplevel = find_toplevel_at_pointer (gdk_screen_get_display (screen)); if (toplevel == popup) toplevel = NULL; } g_object_unref (cursor); gtk_widget_destroy (popup); gdk_flush (); /* Really release the grab */ return toplevel; } /* Prompts the user for a toplevel window to move, and then moves * that window to the currently selected display */ static void query_change_display (ChangeDisplayInfo *info) { GdkScreen *screen = gtk_widget_get_screen (info->window); GtkWidget *toplevel; toplevel = query_for_toplevel (screen, "Please select the toplevel\n" "to move to the new screen"); if (toplevel) gtk_window_set_screen (GTK_WINDOW (toplevel), gdk_display_get_screen (info->current_display, 0)); else gdk_display_beep (gdk_screen_get_display (screen)); } /* Called when the user clicks on a button in our dialog or * closes the dialog through the window manager. Unless the * "Change" button was clicked, we destroy the dialog. */ static void response_cb (GtkDialog *dialog, gint response_id, ChangeDisplayInfo *info) { if (response_id == GTK_RESPONSE_OK) query_change_display (info); else gtk_widget_destroy (GTK_WIDGET (dialog)); } /* Called when the user clicks on "Open..." in the display * frame. Prompts for a new display, and then opens a connection * to that display. */ static void open_display_cb (GtkWidget *button, ChangeDisplayInfo *info) { GtkWidget *content_area; GtkWidget *dialog; GtkWidget *display_entry; GtkWidget *dialog_label; gchar *new_screen_name = NULL; GdkDisplay *result = NULL; dialog = gtk_dialog_new_with_buttons ("Open Display", GTK_WINDOW (info->window), GTK_DIALOG_MODAL, _("_Cancel"), GTK_RESPONSE_CANCEL, _("_OK"), GTK_RESPONSE_OK, NULL); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); display_entry = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (display_entry), TRUE); dialog_label = gtk_label_new ("Please enter the name of\nthe new display\n"); content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); gtk_container_add (GTK_CONTAINER (content_area), dialog_label); gtk_container_add (GTK_CONTAINER (content_area), display_entry); gtk_widget_grab_focus (display_entry); gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (dialog))); while (!result) { gint response_id = gtk_dialog_run (GTK_DIALOG (dialog)); if (response_id != GTK_RESPONSE_OK) break; new_screen_name = gtk_editable_get_chars (GTK_EDITABLE (display_entry), 0, -1); if (strcmp (new_screen_name, "") != 0) { result = gdk_display_open (new_screen_name); if (!result) { gchar *error_msg = g_strdup_printf ("Can't open display :\n\t%s\nplease try another one\n", new_screen_name); gtk_label_set_text (GTK_LABEL (dialog_label), error_msg); g_free (error_msg); } g_free (new_screen_name); } } gtk_widget_destroy (dialog); } /* Called when the user clicks on the "Close" button in the * "Display" frame. Closes the selected display. */ static void close_display_cb (GtkWidget *button, ChangeDisplayInfo *info) { if (info->current_display) gdk_display_close (info->current_display); } /* Called when the selected row in the display list changes. * Updates info->current_display, then refills the list of * screens. */ static void display_changed_cb (GtkTreeSelection *selection, ChangeDisplayInfo *info) { GtkTreeModel *model; GtkTreeIter iter; if (info->current_display) g_object_unref (info->current_display); if (gtk_tree_selection_get_selected (selection, &model, &iter)) gtk_tree_model_get (model, &iter, DISPLAY_COLUMN_DISPLAY, &info->current_display, -1); else info->current_display = NULL; } /* This function is used both for creating the "Display" and * "Screen" frames, since they have a similar structure. The * caller hooks up the right context for the value returned * in tree_view, and packs any relevant buttons into button_vbox. */ static void create_frame (ChangeDisplayInfo *info, const char *title, GtkWidget **frame, GtkWidget **tree_view, GtkWidget **button_vbox) { GtkTreeSelection *selection; GtkWidget *scrollwin; GtkWidget *hbox; *frame = gtk_frame_new (title); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_container_set_border_width (GTK_CONTAINER (hbox), 8); gtk_container_add (GTK_CONTAINER (*frame), hbox); scrollwin = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollwin), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrollwin), GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (hbox), scrollwin, TRUE, TRUE, 0); *tree_view = gtk_tree_view_new (); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (*tree_view), FALSE); gtk_container_add (GTK_CONTAINER (scrollwin), *tree_view); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (*tree_view)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE); *button_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_box_pack_start (GTK_BOX (hbox), *button_vbox, FALSE, FALSE, 0); if (!info->size_group) info->size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); gtk_size_group_add_widget (GTK_SIZE_GROUP (info->size_group), *button_vbox); } /* If we have a stack of buttons, it often looks better if their contents * are left-aligned, rather than centered. This function creates a button * and left-aligns it contents. */ GtkWidget * left_align_button_new (const char *label) { GtkWidget *button = gtk_button_new_with_mnemonic (label); GtkWidget *child = gtk_bin_get_child (GTK_BIN (button)); gtk_widget_set_halign (child, GTK_ALIGN_START); gtk_widget_set_valign (child, GTK_ALIGN_CENTER); return button; } /* Creates the "Display" frame in the main window. */ GtkWidget * create_display_frame (ChangeDisplayInfo *info) { GtkWidget *frame; GtkWidget *tree_view; GtkWidget *button_vbox; GtkTreeViewColumn *column; GtkTreeSelection *selection; GtkWidget *button; create_frame (info, "Display", &frame, &tree_view, &button_vbox); button = left_align_button_new ("_Open..."); g_signal_connect (button, "clicked", G_CALLBACK (open_display_cb), info); gtk_box_pack_start (GTK_BOX (button_vbox), button, FALSE, FALSE, 0); button = left_align_button_new ("_Close"); g_signal_connect (button, "clicked", G_CALLBACK (close_display_cb), info); gtk_box_pack_start (GTK_BOX (button_vbox), button, FALSE, FALSE, 0); info->display_model = (GtkTreeModel *)gtk_list_store_new (DISPLAY_NUM_COLUMNS, G_TYPE_STRING, GDK_TYPE_DISPLAY); gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), info->display_model); column = gtk_tree_view_column_new_with_attributes ("Name", gtk_cell_renderer_text_new (), "text", DISPLAY_COLUMN_NAME, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)); g_signal_connect (selection, "changed", G_CALLBACK (display_changed_cb), info); return frame; } /* Called when one of the currently open displays is closed. * Remove it from our list of displays. */ static void display_closed_cb (GdkDisplay *display, gboolean is_error, ChangeDisplayInfo *info) { GtkTreeIter iter; gboolean valid; for (valid = gtk_tree_model_get_iter_first (info->display_model, &iter); valid; valid = gtk_tree_model_iter_next (info->display_model, &iter)) { GdkDisplay *tmp_display; gtk_tree_model_get (info->display_model, &iter, DISPLAY_COLUMN_DISPLAY, &tmp_display, -1); if (tmp_display == display) { gtk_list_store_remove (GTK_LIST_STORE (info->display_model), &iter); break; } } } /* Adds a new display to our list of displays, and connects * to the "closed" signal so that we can remove it from the * list of displays again. */ static void add_display (ChangeDisplayInfo *info, GdkDisplay *display) { const gchar *name = gdk_display_get_name (display); GtkTreeIter iter; gtk_list_store_append (GTK_LIST_STORE (info->display_model), &iter); gtk_list_store_set (GTK_LIST_STORE (info->display_model), &iter, DISPLAY_COLUMN_NAME, name, DISPLAY_COLUMN_DISPLAY, display, -1); g_signal_connect (display, "closed", G_CALLBACK (display_closed_cb), info); } /* Called when a new display is opened */ static void display_opened_cb (GdkDisplayManager *manager, GdkDisplay *display, ChangeDisplayInfo *info) { add_display (info, display); } /* Adds all currently open displays to our list of displays, * and set up a signal connection so that we'll be notified * when displays are opened in the future as well. */ static void initialize_displays (ChangeDisplayInfo *info) { GdkDisplayManager *manager = gdk_display_manager_get (); GSList *displays = gdk_display_manager_list_displays (manager); GSList *tmp_list; for (tmp_list = displays; tmp_list; tmp_list = tmp_list->next) add_display (info, tmp_list->data); g_slist_free (tmp_list); g_signal_connect (manager, "display-opened", G_CALLBACK (display_opened_cb), info); } /* Cleans up when the toplevel is destroyed; we remove the * connections we use to track currently open displays, then * free the ChangeDisplayInfo structure. */ static void destroy_info (ChangeDisplayInfo *info) { GdkDisplayManager *manager = gdk_display_manager_get (); GSList *displays = gdk_display_manager_list_displays (manager); GSList *tmp_list; g_signal_handlers_disconnect_by_func (manager, display_opened_cb, info); for (tmp_list = displays; tmp_list; tmp_list = tmp_list->next) g_signal_handlers_disconnect_by_func (tmp_list->data, display_closed_cb, info); g_slist_free (tmp_list); g_object_unref (info->size_group); g_object_unref (info->display_model); if (info->current_display) g_object_unref (info->current_display); g_free (info); } static void destroy_cb (GObject *object, ChangeDisplayInfo **info) { destroy_info (*info); *info = NULL; } /* Main entry point. If the dialog for this demo doesn't yet exist, creates * it. Otherwise, destroys it. */ GtkWidget * do_changedisplay (GtkWidget *do_widget) { static ChangeDisplayInfo *info = NULL; if (!info) { GtkWidget *content_area; GtkWidget *vbox; GtkWidget *frame; info = g_new0 (ChangeDisplayInfo, 1); info->window = gtk_dialog_new_with_buttons ("Change Screen or display", GTK_WINDOW (do_widget), 0, _("_Close"), GTK_RESPONSE_CLOSE, "Change", GTK_RESPONSE_OK, NULL); gtk_window_set_default_size (GTK_WINDOW (info->window), 300, 400); g_signal_connect (info->window, "response", G_CALLBACK (response_cb), info); g_signal_connect (info->window, "destroy", G_CALLBACK (destroy_cb), &info); content_area = gtk_dialog_get_content_area (GTK_DIALOG (info->window)); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0); frame = create_display_frame (info); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); initialize_displays (info); gtk_widget_show_all (info->window); return info->window; } else { gtk_widget_destroy (info->window); return NULL; } } (uuay)brick.pngPNG  IHDRT*sBIT|d pHYs tEXtSoftwarewww.inkscape.org<0IDATxiՕ ' FW|byH[PE3"r,ؚĢ3d'`f2#Jw <)";h&Г|TUWT,3i ]Dv~ m稾f@S(z\[H(ңS>ADfn]-umυp.Pf$V &AmvR,?x6(S E"mGh}_o*HV7EɊDږPCyߖQ=ৎX ?@V$ք JPUΩ{Q^:YHd4:B6t-S/%[UgtEz=qGO(&{/z"`/U}`H#1t "ȤĽ4+<侔U07.SUܼ"ߨcF"*"o=쿁CӼDdEܣUΆEa16P("r0ބۀSU:HA 7{U C UuyFDn⼹X7RHY |ZU{ Eԙ޾Dd]Ȕeo0#_h]"f"";R'$8vXguETuzuow!i6"2;P6ög!ɽӀ]XT`Hc LzsU'pb `cTuNcԍD"Ep)0~MTc$iw{vjผcp-|Xwt; ;H:gQEU]H]"NFUW `.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Zp'pqM&dm=L|ݟοT-RlRN9@$]2kN sy ϝdy%bgTk"r%(xTUtx ئ`U5U$WMC'eQ# T6.ˈ$S>V~$xjFc!M\xKHG5G|\80xó#)lu=&[$ґ UuiH"ZF&g} 5#:A=zO%? >ኘv.t^YvN$)b<)/"$1gBzG"{"T;oXݰEafμhȪ@)C>{;UR{ZH$@ 84G"+)ݣ9-8&_;˔ѻQ07Vd(2>y$q*3tD7fr pNT6t%XdKZ`4٪:D"K zR霝\8&pZH$AC 3Ӱe^bݠ-t M15()l;D,/E.x$O a; ڴ7B T9H$،-.B>IENDB`(uuay)toolpalette.cCl/* Tool Palette * * A tool palette widget shows groups of toolbar items as a grid of icons * or a list of names. */ #include #include static GtkWidget *window = NULL; static void load_icon_items (GtkToolPalette *palette); static void load_toggle_items (GtkToolPalette *palette); static void load_special_items (GtkToolPalette *palette); typedef struct _CanvasItem CanvasItem; struct _CanvasItem { GdkPixbuf *pixbuf; gdouble x, y; }; static gboolean drag_data_requested_for_drop = FALSE; static CanvasItem *drop_item = NULL; static GList *canvas_items = NULL; /********************************/ /* ====== Canvas drawing ====== */ /********************************/ static CanvasItem* canvas_item_new (GtkWidget *widget, GtkToolButton *button, gdouble x, gdouble y) { CanvasItem *item = NULL; const gchar *icon_name; GdkPixbuf *pixbuf; GtkIconTheme *icon_theme; int width; icon_name = gtk_tool_button_get_icon_name (button); icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget)); gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &width, NULL); pixbuf = gtk_icon_theme_load_icon (icon_theme, icon_name, width, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL); if (pixbuf) { item = g_slice_new0 (CanvasItem); item->pixbuf = pixbuf; item->x = x; item->y = y; } return item; } static void canvas_item_free (CanvasItem *item) { g_object_unref (item->pixbuf); g_slice_free (CanvasItem, item); } static void canvas_item_draw (const CanvasItem *item, cairo_t *cr, gboolean preview) { gdouble cx = gdk_pixbuf_get_width (item->pixbuf); gdouble cy = gdk_pixbuf_get_height (item->pixbuf); gdk_cairo_set_source_pixbuf (cr, item->pixbuf, item->x - cx * 0.5, item->y - cy * 0.5); if (preview) cairo_paint_with_alpha (cr, 0.6); else cairo_paint (cr); } static gboolean canvas_draw (GtkWidget *widget, cairo_t *cr) { GList *iter; cairo_set_source_rgb (cr, 1, 1, 1); cairo_paint (cr); for (iter = canvas_items; iter; iter = iter->next) canvas_item_draw (iter->data, cr, FALSE); if (drop_item) canvas_item_draw (drop_item, cr, TRUE); return TRUE; } /*****************************/ /* ====== Palette DnD ====== */ /*****************************/ static void palette_drop_item (GtkToolItem *drag_item, GtkToolItemGroup *drop_group, gint x, gint y) { GtkWidget *drag_group = gtk_widget_get_parent (GTK_WIDGET (drag_item)); GtkToolItem *drop_item = gtk_tool_item_group_get_drop_item (drop_group, x, y); gint drop_position = -1; if (drop_item) drop_position = gtk_tool_item_group_get_item_position (GTK_TOOL_ITEM_GROUP (drop_group), drop_item); if (GTK_TOOL_ITEM_GROUP (drag_group) != drop_group) { gboolean homogeneous, expand, fill, new_row; g_object_ref (drag_item); gtk_container_child_get (GTK_CONTAINER (drag_group), GTK_WIDGET (drag_item), "homogeneous", &homogeneous, "expand", &expand, "fill", &fill, "new-row", &new_row, NULL); gtk_container_remove (GTK_CONTAINER (drag_group), GTK_WIDGET (drag_item)); gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (drop_group), drag_item, drop_position); gtk_container_child_set (GTK_CONTAINER (drop_group), GTK_WIDGET (drag_item), "homogeneous", homogeneous, "expand", expand, "fill", fill, "new-row", new_row, NULL); g_object_unref (drag_item); } else gtk_tool_item_group_set_item_position (GTK_TOOL_ITEM_GROUP (drop_group), drag_item, drop_position); } static void palette_drop_group (GtkToolPalette *palette, GtkToolItemGroup *drag_group, GtkToolItemGroup *drop_group) { gint drop_position = -1; if (drop_group) drop_position = gtk_tool_palette_get_group_position (palette, drop_group); gtk_tool_palette_set_group_position (palette, drag_group, drop_position); } static void palette_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection, guint info, guint time, gpointer data) { GtkAllocation allocation; GtkToolItemGroup *drop_group = NULL; GtkWidget *drag_palette = gtk_drag_get_source_widget (context); GtkWidget *drag_item = NULL; while (drag_palette && !GTK_IS_TOOL_PALETTE (drag_palette)) drag_palette = gtk_widget_get_parent (drag_palette); if (drag_palette) { drag_item = gtk_tool_palette_get_drag_item (GTK_TOOL_PALETTE (drag_palette), selection); drop_group = gtk_tool_palette_get_drop_group (GTK_TOOL_PALETTE (widget), x, y); } if (GTK_IS_TOOL_ITEM_GROUP (drag_item)) palette_drop_group (GTK_TOOL_PALETTE (drag_palette), GTK_TOOL_ITEM_GROUP (drag_item), drop_group); else if (GTK_IS_TOOL_ITEM (drag_item) && drop_group) { gtk_widget_get_allocation (GTK_WIDGET (drop_group), &allocation); palette_drop_item (GTK_TOOL_ITEM (drag_item), drop_group, x - allocation.x, y - allocation.y); } } /********************************/ /* ====== Passive Canvas ====== */ /********************************/ static void passive_canvas_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection, guint info, guint time, gpointer data) { /* find the tool button, which is the source of this DnD operation */ GtkWidget *palette = gtk_drag_get_source_widget (context); CanvasItem *canvas_item = NULL; GtkWidget *tool_item = NULL; while (palette && !GTK_IS_TOOL_PALETTE (palette)) palette = gtk_widget_get_parent (palette); if (palette) tool_item = gtk_tool_palette_get_drag_item (GTK_TOOL_PALETTE (palette), selection); g_assert (NULL == drop_item); /* append a new canvas item when a tool button was found */ if (GTK_IS_TOOL_ITEM (tool_item)) canvas_item = canvas_item_new (widget, GTK_TOOL_BUTTON (tool_item), x, y); if (canvas_item) { canvas_items = g_list_append (canvas_items, canvas_item); gtk_widget_queue_draw (widget); } } /************************************/ /* ====== Interactive Canvas ====== */ /************************************/ static gboolean interactive_canvas_drag_motion (GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, gpointer data) { if (drop_item) { /* already have a drop indicator - just update position */ drop_item->x = x; drop_item->y = y; gtk_widget_queue_draw (widget); gdk_drag_status (context, GDK_ACTION_COPY, time); } else { /* request DnD data for creating a drop indicator */ GdkAtom target = gtk_drag_dest_find_target (widget, context, NULL); if (!target) return FALSE; drag_data_requested_for_drop = FALSE; gtk_drag_get_data (widget, context, target, time); } return TRUE; } static void interactive_canvas_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection, guint info, guint time, gpointer data) { /* find the tool button which is the source of this DnD operation */ GtkWidget *palette = gtk_drag_get_source_widget (context); GtkWidget *tool_item = NULL; CanvasItem *item; while (palette && !GTK_IS_TOOL_PALETTE (palette)) palette = gtk_widget_get_parent (palette); if (palette) tool_item = gtk_tool_palette_get_drag_item (GTK_TOOL_PALETTE (palette), selection); /* create a canvas item when a tool button was found */ g_assert (NULL == drop_item); if (!GTK_IS_TOOL_ITEM (tool_item)) return; if (drop_item) { canvas_item_free (drop_item); drop_item = NULL; } item = canvas_item_new (widget, GTK_TOOL_BUTTON (tool_item), x, y); /* Either create a new item or just create a preview item, depending on why the drag data was requested. */ if(drag_data_requested_for_drop) { canvas_items = g_list_append (canvas_items, item); drop_item = NULL; gtk_drag_finish (context, TRUE, FALSE, time); } else { drop_item = item; gdk_drag_status (context, GDK_ACTION_COPY, time); } gtk_widget_queue_draw (widget); } static gboolean interactive_canvas_drag_drop (GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, gpointer data) { GdkAtom target = gtk_drag_dest_find_target (widget, context, NULL); if (!target) return FALSE; drag_data_requested_for_drop = TRUE; gtk_drag_get_data (widget, context, target, time); return FALSE; } static void interactive_canvas_drag_leave (gpointer data) { if (drop_item) { GtkWidget *widget = GTK_WIDGET (data); canvas_item_free (drop_item); drop_item = NULL; if (widget) gtk_widget_queue_draw (widget); } } static void on_combo_orientation_changed (GtkComboBox *combo_box, gpointer user_data) { GtkToolPalette *palette = GTK_TOOL_PALETTE (user_data); GtkScrolledWindow *sw; GtkTreeModel *model = gtk_combo_box_get_model (combo_box); GtkTreeIter iter; gint val = 0; sw = GTK_SCROLLED_WINDOW (gtk_widget_get_parent (GTK_WIDGET (palette))); if (!gtk_combo_box_get_active_iter (combo_box, &iter)) return; gtk_tree_model_get (model, &iter, 1, &val, -1); gtk_orientable_set_orientation (GTK_ORIENTABLE (palette), val); if (val == GTK_ORIENTATION_HORIZONTAL) gtk_scrolled_window_set_policy (sw, GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); else gtk_scrolled_window_set_policy (sw, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); } static void on_combo_style_changed (GtkComboBox *combo_box, gpointer user_data) { GtkToolPalette *palette = GTK_TOOL_PALETTE (user_data); GtkTreeModel *model = gtk_combo_box_get_model (combo_box); GtkTreeIter iter; gint val = 0; if (!gtk_combo_box_get_active_iter (combo_box, &iter)) return; gtk_tree_model_get (model, &iter, 1, &val, -1); if (val == -1) gtk_tool_palette_unset_style (palette); else gtk_tool_palette_set_style (palette, val); } GtkWidget * do_toolpalette (GtkWidget *do_widget) { GtkWidget *box = NULL; GtkWidget *hbox = NULL; GtkWidget *combo_orientation = NULL; GtkListStore *orientation_model = NULL; GtkWidget *combo_style = NULL; GtkListStore *style_model = NULL; GtkCellRenderer *cell_renderer = NULL; GtkTreeIter iter; GtkWidget *palette = NULL; GtkWidget *palette_scroller = NULL; GtkWidget *notebook = NULL; GtkWidget *contents = NULL; GtkWidget *contents_scroller = NULL; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Tool Palette"); gtk_window_set_default_size (GTK_WINDOW (window), 200, 600); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_container_set_border_width (GTK_CONTAINER (window), 8); /* Add widgets to control the ToolPalette appearance: */ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_container_add (GTK_CONTAINER (window), box); /* Orientation combo box: */ orientation_model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT); gtk_list_store_append (orientation_model, &iter); gtk_list_store_set (orientation_model, &iter, 0, "Horizontal", 1, GTK_ORIENTATION_HORIZONTAL, -1); gtk_list_store_append (orientation_model, &iter); gtk_list_store_set (orientation_model, &iter, 0, "Vertical", 1, GTK_ORIENTATION_VERTICAL, -1); combo_orientation = gtk_combo_box_new_with_model (GTK_TREE_MODEL (orientation_model)); cell_renderer = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_orientation), cell_renderer, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_orientation), cell_renderer, "text", 0, NULL); gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo_orientation), &iter); gtk_box_pack_start (GTK_BOX (box), combo_orientation, FALSE, FALSE, 0); /* Style combo box: */ style_model = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT); gtk_list_store_append (style_model, &iter); gtk_list_store_set (style_model, &iter, 0, "Text", 1, GTK_TOOLBAR_TEXT, -1); gtk_list_store_append (style_model, &iter); gtk_list_store_set (style_model, &iter, 0, "Both", 1, GTK_TOOLBAR_BOTH, -1); gtk_list_store_append (style_model, &iter); gtk_list_store_set (style_model, &iter, 0, "Both: Horizontal", 1, GTK_TOOLBAR_BOTH_HORIZ, -1); gtk_list_store_append (style_model, &iter); gtk_list_store_set (style_model, &iter, 0, "Icons", 1, GTK_TOOLBAR_ICONS, -1); gtk_list_store_append (style_model, &iter); gtk_list_store_set (style_model, &iter, 0, "Default", 1, -1, /* A custom meaning for this demo. */ -1); combo_style = gtk_combo_box_new_with_model (GTK_TREE_MODEL (style_model)); cell_renderer = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo_style), cell_renderer, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_style), cell_renderer, "text", 0, NULL); gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo_style), &iter); gtk_box_pack_start (GTK_BOX (box), combo_style, FALSE, FALSE, 0); /* Add hbox */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); gtk_box_pack_start (GTK_BOX (box), hbox, TRUE, TRUE, 0); /* Add and fill the ToolPalette: */ palette = gtk_tool_palette_new (); load_icon_items (GTK_TOOL_PALETTE (palette)); load_toggle_items (GTK_TOOL_PALETTE (palette)); load_special_items (GTK_TOOL_PALETTE (palette)); palette_scroller = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (palette_scroller), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_container_set_border_width (GTK_CONTAINER (palette_scroller), 6); gtk_widget_set_hexpand (palette_scroller, TRUE); gtk_container_add (GTK_CONTAINER (palette_scroller), palette); gtk_container_add (GTK_CONTAINER (hbox), palette_scroller); gtk_widget_show_all (box); /* Connect signals: */ g_signal_connect (combo_orientation, "changed", G_CALLBACK (on_combo_orientation_changed), palette); g_signal_connect (combo_style, "changed", G_CALLBACK (on_combo_style_changed), palette); /* Keep the widgets in sync: */ on_combo_orientation_changed (GTK_COMBO_BOX (combo_orientation), palette); /* ===== notebook ===== */ notebook = gtk_notebook_new (); gtk_container_set_border_width (GTK_CONTAINER (notebook), 6); gtk_box_pack_end (GTK_BOX(hbox), notebook, FALSE, FALSE, 0); /* ===== DnD for tool items ===== */ g_signal_connect (palette, "drag-data-received", G_CALLBACK (palette_drag_data_received), NULL); gtk_tool_palette_add_drag_dest (GTK_TOOL_PALETTE (palette), palette, GTK_DEST_DEFAULT_ALL, GTK_TOOL_PALETTE_DRAG_ITEMS | GTK_TOOL_PALETTE_DRAG_GROUPS, GDK_ACTION_MOVE); /* ===== passive DnD dest ===== */ contents = gtk_drawing_area_new (); gtk_widget_set_app_paintable (contents, TRUE); g_object_connect (contents, "signal::draw", canvas_draw, NULL, "signal::drag-data-received", passive_canvas_drag_data_received, NULL, NULL); gtk_tool_palette_add_drag_dest (GTK_TOOL_PALETTE (palette), contents, GTK_DEST_DEFAULT_ALL, GTK_TOOL_PALETTE_DRAG_ITEMS, GDK_ACTION_COPY); contents_scroller = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (contents_scroller), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_container_add (GTK_CONTAINER (contents_scroller), contents); gtk_container_set_border_width (GTK_CONTAINER (contents_scroller), 6); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), contents_scroller, gtk_label_new ("Passive DnD Mode")); /* ===== interactive DnD dest ===== */ contents = gtk_drawing_area_new (); gtk_widget_set_app_paintable (contents, TRUE); g_object_connect (contents, "signal::draw", canvas_draw, NULL, "signal::drag-motion", interactive_canvas_drag_motion, NULL, "signal::drag-data-received", interactive_canvas_drag_data_received, NULL, "signal::drag-leave", interactive_canvas_drag_leave, contents, "signal::drag-drop", interactive_canvas_drag_drop, NULL, NULL); gtk_tool_palette_add_drag_dest (GTK_TOOL_PALETTE (palette), contents, GTK_DEST_DEFAULT_HIGHLIGHT, GTK_TOOL_PALETTE_DRAG_ITEMS, GDK_ACTION_COPY); contents_scroller = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (contents_scroller), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_container_add (GTK_CONTAINER (contents_scroller), contents); gtk_container_set_border_width (GTK_CONTAINER (contents_scroller), 6); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), contents_scroller, gtk_label_new ("Interactive DnD Mode")); } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } static void load_icon_items (GtkToolPalette *palette) { GList *contexts; GList *l; GtkIconTheme *icon_theme; icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (palette))); contexts = gtk_icon_theme_list_contexts (icon_theme); for (l = contexts; l; l = g_list_next (l)) { gchar *context = l->data; GList *icon_names; GList *ll; const guint max_icons = 10; guint icons_count = 0; GtkWidget *group = gtk_tool_item_group_new (context); gtk_container_add (GTK_CONTAINER (palette), group); if (g_strcmp0 (context, "Animations") == 0) continue; g_message ("Got context '%s'", context); icon_names = gtk_icon_theme_list_icons (icon_theme, context); icon_names = g_list_sort (icon_names, (GCompareFunc) strcmp); for (ll = icon_names; ll; ll = g_list_next (ll)) { GtkToolItem *item; gchar *id = ll->data; if (g_str_equal (id, "emblem-desktop")) continue; if (g_str_has_suffix (id, "-symbolic")) continue; g_message ("Got id '%s'", id); item = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), id); gtk_tool_item_set_tooltip_text (GTK_TOOL_ITEM (item), id); gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1); /* Prevent us having an insane number of icons: */ ++icons_count; if(icons_count >= max_icons) break; } g_list_free_full (icon_names, g_free); } g_list_free_full (contexts, g_free); } static void load_toggle_items (GtkToolPalette *palette) { GSList *toggle_group = NULL; GtkToolItem *item; GtkWidget *group; char *label; int i; group = gtk_tool_item_group_new ("Radio Item"); gtk_container_add (GTK_CONTAINER (palette), group); for (i = 1; i <= 10; ++i) { label = g_strdup_printf ("#%d", i); item = gtk_radio_tool_button_new (toggle_group); gtk_tool_button_set_label (GTK_TOOL_BUTTON (item), label); g_free (label); gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1); toggle_group = gtk_radio_tool_button_get_group (GTK_RADIO_TOOL_BUTTON (item)); } } static GtkToolItem * create_entry_item (const char *text) { GtkToolItem *item; GtkWidget *entry; entry = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (entry), text); gtk_entry_set_width_chars (GTK_ENTRY (entry), 5); item = gtk_tool_item_new (); gtk_container_add (GTK_CONTAINER (item), entry); return item; } static void load_special_items (GtkToolPalette *palette) { GtkToolItem *item; GtkWidget *group; GtkWidget *label_button; group = gtk_tool_item_group_new (NULL); label_button = gtk_button_new_with_label ("Advanced Features"); gtk_widget_show (label_button); gtk_tool_item_group_set_label_widget (GTK_TOOL_ITEM_GROUP (group), label_button); gtk_container_add (GTK_CONTAINER (palette), group); item = create_entry_item ("homogeneous=FALSE"); gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1); gtk_container_child_set (GTK_CONTAINER (group), GTK_WIDGET (item), "homogeneous", FALSE, NULL); item = create_entry_item ("homogeneous=FALSE, expand=TRUE"); gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1); gtk_container_child_set (GTK_CONTAINER (group), GTK_WIDGET (item), "homogeneous", FALSE, "expand", TRUE, NULL); item = create_entry_item ("homogeneous=FALSE, expand=TRUE, fill=FALSE"); gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1); gtk_container_child_set (GTK_CONTAINER (group), GTK_WIDGET (item), "homogeneous", FALSE, "expand", TRUE, "fill", FALSE, NULL); item = create_entry_item ("homogeneous=FALSE, expand=TRUE, new-row=TRUE"); gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1); gtk_container_child_set (GTK_CONTAINER (group), GTK_WIDGET (item), "homogeneous", FALSE, "expand", TRUE, "new-row", TRUE, NULL); item = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "go-up"); gtk_tool_item_set_tooltip_text (item, "Show on vertical palettes only"); gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1); gtk_tool_item_set_visible_horizontal (item, FALSE); item = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "go-next"); gtk_tool_item_set_tooltip_text (item, "Show on horizontal palettes only"); gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1); gtk_tool_item_set_visible_vertical (item, FALSE); item = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "edit-delete"); gtk_tool_item_set_tooltip_text (item, "Do not show at all"); gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1); gtk_widget_set_no_show_all (GTK_WIDGET (item), TRUE); item = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "view-fullscreen"); gtk_tool_item_set_tooltip_text (item, "Expanded this item"); gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1); gtk_container_child_set (GTK_CONTAINER (group), GTK_WIDGET (item), "homogeneous", FALSE, "expand", TRUE, NULL); item = gtk_tool_button_new (NULL, NULL); gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "help-browser"); gtk_tool_item_set_tooltip_text (item, "A regular item"); gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1); } (uuay)revealer/Pcss_basics.css%/* You can edit the text in this window to change the * appearance of this Window. * Be careful, if you screw it up, nothing might be visible * anymore. :) */ /* This CSS resets all properties to their defaults values * and overrides all user settings and the theme in use */ @import url("resource://css_basics/reset.css"); /* Set a very futuristic style by default */ * { color: green; font-family: Monospace; border: 1px solid; } /* Make sure selections are visible */ :selected { background-color: darkGreen; color: black; } (uuay)gnome-calendar.png PNG  IHDR00WgAMA1_ zIDATx]lWwvvwNvc7֤}B"TDAVT臢ҨQ Ayh)BB R>ѠTb'󹉿];wwfa7N*Du5;wN;Nnn0;x}?&Ex @twRJ"T!@QW @ a H_(yJ6'C""a$ BuZ BiM* *=ܪD;ϏweBB E*es8N2H)A6/O^ZJ)[?J%#/hl34*aH(ω|>*c76 $2'\O6.8y}B1aᅊmsu'X aHB|rןP(J(^)RԑRDJNDΗ^ac_kG-VVW6l |#bhm!ne~ye9FhfA^G#7)rp$^<|] QJ"py2 KV^o $ʈ C;Qؐ{Iȥnc2}8ڭ;rk LdGui 8ƃ@ "Z!&7ֽ@^xO,k*)-l ]o[fMCz8@o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get *window = NULL; static GtkWidget *da; static GdkRGBA color; static GtkWidget *frame; /* draw callback for the drawing area */ static gboolean draw_callback (GtkWidget *widget, cairo_t *cr, gpointer data) { gdk_cairo_set_source_rgba (cr, &color); cairo_paint (cr); return TRUE; } static void response_cb (GtkDialog *dialog, gint response_id, gpointer user_data) { if (response_id == GTK_RESPONSE_OK) { gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog), &color); } gtk_widget_destroy (GTK_WIDGET (dialog)); } static void change_color_callback (GtkWidget *button, gpointer data) { GtkWidget *dialog; dialog = gtk_color_chooser_dialog_new ("Changing color", GTK_WINDOW (window)); gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (dialog), &color); g_signal_connect (dialog, "response", G_CALLBACK (response_cb), NULL); gtk_widget_show_all (dialog); } GtkWidget * do_colorsel (GtkWidget *do_widget) { GtkWidget *vbox; GtkWidget *button; if (!window) { color.red = 0; color.blue = 1; color.green = 0; color.alpha = 1; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Color Chooser"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_container_set_border_width (GTK_CONTAINER (window), 8); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_container_add (GTK_CONTAINER (window), vbox); /* * Create the color swatch area */ frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); da = gtk_drawing_area_new (); g_signal_connect (da, "draw", G_CALLBACK (draw_callback), NULL); /* set a minimum size */ gtk_widget_set_size_request (da, 200, 200); gtk_container_add (GTK_CONTAINER (frame), da); button = gtk_button_new_with_mnemonic ("_Change the above color"); gtk_widget_set_halign (button, GTK_ALIGN_END); gtk_widget_set_valign (button, GTK_ALIGN_CENTER); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); g_signal_connect (button, "clicked", G_CALLBACK (change_color_callback), NULL); } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)menus.c/* Menus * * There are several widgets involved in displaying menus. The * GtkMenuBar widget is a menu bar, which normally appears horizontally * at the top of an application, but can also be layed out vertically. * The GtkMenu widget is the actual menu that pops up. Both GtkMenuBar * and GtkMenu are subclasses of GtkMenuShell; a GtkMenuShell contains * menu items (GtkMenuItem). Each menu item contains text and/or images * and can be selected by the user. * * There are several kinds of menu item, including plain GtkMenuItem, * GtkCheckMenuItem which can be checked/unchecked, GtkRadioMenuItem * which is a check menu item that's in a mutually exclusive group, * GtkSeparatorMenuItem which is a separator bar, GtkTearoffMenuItem * which allows a GtkMenu to be torn off, and GtkImageMenuItem which * can place a GtkImage or other widget next to the menu text. * * A GtkMenuItem can have a submenu, which is simply a GtkMenu to pop * up when the menu item is selected. Typically, all menu items in a menu bar * have submenus. * * GtkUIManager provides a higher-level interface for creating menu bars * and menus; while you can construct menus manually, most people don't * do that. There's a separate demo for GtkUIManager. */ #include #include #include static GtkWidget * create_menu (gint depth) { GtkWidget *menu; GtkWidget *menuitem; GSList *group; char buf[32]; int i, j; if (depth < 1) return NULL; menu = gtk_menu_new (); group = NULL; for (i = 0, j = 1; i < 5; i++, j++) { sprintf (buf, "item %2d - %d", depth, j); menuitem = gtk_radio_menu_item_new_with_label (group, buf); group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (menuitem)); gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem); gtk_widget_show (menuitem); if (i == 3) gtk_widget_set_sensitive (menuitem, FALSE); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (depth - 1)); } return menu; } static void change_orientation (GtkWidget *button, GtkWidget *menubar) { GtkWidget *parent; GtkOrientation orientation; parent = gtk_widget_get_parent (menubar); orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (parent)); gtk_orientable_set_orientation (GTK_ORIENTABLE (parent), 1 - orientation); if (orientation == GTK_ORIENTATION_VERTICAL) g_object_set (menubar, "pack-direction", GTK_PACK_DIRECTION_TTB, NULL); else g_object_set (menubar, "pack-direction", GTK_PACK_DIRECTION_LTR, NULL); } static GtkWidget *window = NULL; GtkWidget * do_menus (GtkWidget *do_widget) { GtkWidget *box; GtkWidget *box1; GtkWidget *box2; GtkWidget *button; if (!window) { GtkWidget *menubar; GtkWidget *menu; GtkWidget *menuitem; GtkAccelGroup *accel_group; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Menus"); g_signal_connect (window, "destroy", G_CALLBACK(gtk_widget_destroyed), &window); accel_group = gtk_accel_group_new (); gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); gtk_container_set_border_width (GTK_CONTAINER (window), 0); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_container_add (GTK_CONTAINER (window), box); gtk_widget_show (box); box1 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (box), box1); gtk_widget_show (box1); menubar = gtk_menu_bar_new (); gtk_box_pack_start (GTK_BOX (box1), menubar, FALSE, TRUE, 0); gtk_widget_show (menubar); menu = create_menu (2); menuitem = gtk_menu_item_new_with_label ("test\nline2"); 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 (3)); gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem); gtk_widget_show (menuitem); menuitem = gtk_menu_item_new_with_label ("bar"); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), create_menu (4)); gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem); gtk_widget_show (menuitem); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0); gtk_widget_show (box2); button = gtk_button_new_with_label ("Flip"); g_signal_connect (button, "clicked", G_CALLBACK (change_orientation), menubar); gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); gtk_widget_show (button); 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_can_default (button, TRUE); gtk_widget_grab_default (button); gtk_widget_show (button); } if (!gtk_widget_get_visible (window)) { gtk_widget_show (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)drawingarea.cZ!/* Drawing Area * * GtkDrawingArea is a blank area where you can draw custom displays * of various kinds. * * This demo has two drawing areas. The checkerboard area shows * how you can just draw something; all you have to do is write * a signal handler for expose_event, as shown here. * * The "scribble" area is a bit more advanced, and shows how to handle * events such as button presses and mouse motion. Click the mouse * and drag in the scribble area to draw squiggles. Resize the window * to clear the area. */ #include static GtkWidget *window = NULL; /* Pixmap for scribble area, to store current scribbles */ static cairo_surface_t *surface = NULL; /* Create a new surface of the appropriate size to store our scribbles */ static gboolean scribble_configure_event (GtkWidget *widget, GdkEventConfigure *event, gpointer data) { GtkAllocation allocation; cairo_t *cr; if (surface) cairo_surface_destroy (surface); gtk_widget_get_allocation (widget, &allocation); surface = gdk_window_create_similar_surface (gtk_widget_get_window (widget), CAIRO_CONTENT_COLOR, allocation.width, allocation.height); /* Initialize the surface to white */ cr = cairo_create (surface); cairo_set_source_rgb (cr, 1, 1, 1); cairo_paint (cr); cairo_destroy (cr); /* We've handled the configure event, no need for further processing. */ return TRUE; } /* Redraw the screen from the surface */ static gboolean scribble_draw (GtkWidget *widget, cairo_t *cr, gpointer data) { cairo_set_source_surface (cr, surface, 0, 0); cairo_paint (cr); return FALSE; } /* Draw a rectangle on the screen */ static void draw_brush (GtkWidget *widget, gdouble x, gdouble y) { GdkRectangle update_rect; cairo_t *cr; update_rect.x = x - 3; update_rect.y = y - 3; update_rect.width = 6; update_rect.height = 6; /* Paint to the surface, where we store our state */ cr = cairo_create (surface); gdk_cairo_rectangle (cr, &update_rect); cairo_fill (cr); cairo_destroy (cr); /* Now invalidate the affected region of the drawing area. */ gdk_window_invalidate_rect (gtk_widget_get_window (widget), &update_rect, FALSE); } static gboolean scribble_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer data) { if (surface == NULL) return FALSE; /* paranoia check, in case we haven't gotten a configure event */ if (event->button == GDK_BUTTON_PRIMARY) draw_brush (widget, event->x, event->y); /* We've handled the event, stop processing */ return TRUE; } static gboolean scribble_motion_notify_event (GtkWidget *widget, GdkEventMotion *event, gpointer data) { int x, y; GdkModifierType state; if (surface == NULL) return FALSE; /* paranoia check, in case we haven't gotten a configure event */ /* This call is very important; it requests the next motion event. * If you don't call gdk_window_get_pointer() you'll only get * a single motion event. The reason is that we specified * GDK_POINTER_MOTION_HINT_MASK to gtk_widget_set_events(). * If we hadn't specified that, we could just use event->x, event->y * as the pointer location. But we'd also get deluged in events. * By requesting the next event as we handle the current one, * we avoid getting a huge number of events faster than we * can cope. */ gdk_window_get_device_position (event->window, event->device, &x, &y, &state); if (state & GDK_BUTTON1_MASK) draw_brush (widget, x, y); /* We've handled it, stop processing */ return TRUE; } static gboolean checkerboard_draw (GtkWidget *da, cairo_t *cr, gpointer data) { gint i, j, xcount, ycount, width, height; #define CHECK_SIZE 10 #define SPACING 2 /* At the start of a draw handler, a clip region has been set on * the Cairo context, and the contents have been cleared to the * widget's background color. The docs for * gdk_window_begin_paint_region() give more details on how this * works. */ xcount = 0; width = gtk_widget_get_allocated_width (da); height = gtk_widget_get_allocated_height (da); i = SPACING; while (i < width) { j = SPACING; ycount = xcount % 2; /* start with even/odd depending on row */ while (j < height) { if (ycount % 2) cairo_set_source_rgb (cr, 0.45777, 0, 0.45777); else cairo_set_source_rgb (cr, 1, 1, 1); /* If we're outside the clip, this will do nothing. */ cairo_rectangle (cr, i, j, CHECK_SIZE, CHECK_SIZE); cairo_fill (cr); j += CHECK_SIZE + SPACING; ++ycount; } i += CHECK_SIZE + SPACING; ++xcount; } /* return TRUE because we've handled this event, so no * further processing is required. */ return TRUE; } static void close_window (void) { window = NULL; if (surface) cairo_surface_destroy (surface); surface = NULL; } GtkWidget * do_drawingarea (GtkWidget *do_widget) { GtkWidget *frame; GtkWidget *vbox; GtkWidget *da; GtkWidget *label; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Drawing Area"); g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL); gtk_container_set_border_width (GTK_CONTAINER (window), 8); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_container_add (GTK_CONTAINER (window), vbox); /* * Create the checkerboard area */ label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "Checkerboard pattern"); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); da = gtk_drawing_area_new (); /* set a minimum size */ gtk_widget_set_size_request (da, 100, 100); gtk_container_add (GTK_CONTAINER (frame), da); g_signal_connect (da, "draw", G_CALLBACK (checkerboard_draw), NULL); /* * Create the scribble area */ label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "Scribble area"); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0); da = gtk_drawing_area_new (); /* set a minimum size */ gtk_widget_set_size_request (da, 100, 100); gtk_container_add (GTK_CONTAINER (frame), da); /* Signals used to handle backing surface */ g_signal_connect (da, "draw", G_CALLBACK (scribble_draw), NULL); g_signal_connect (da,"configure-event", G_CALLBACK (scribble_configure_event), NULL); /* Event signals */ g_signal_connect (da, "motion-notify-event", G_CALLBACK (scribble_motion_notify_event), NULL); g_signal_connect (da, "button-press-event", G_CALLBACK (scribble_button_press_event), NULL); /* Ask to receive events the drawing area doesn't normally * subscribe to */ gtk_widget_set_events (da, gtk_widget_get_events (da) | GDK_LEAVE_NOTIFY_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else gtk_widget_destroy (window); return window; } (uuay)printing.c/* Printing * * GtkPrintOperation offers a simple API to support printing * in a cross-platform way. * */ #include #include /* In points */ #define HEADER_HEIGHT (10*72/25.4) #define HEADER_GAP (3*72/25.4) typedef struct { gchar *resourcename; gdouble font_size; gint lines_per_page; gchar **lines; gint num_lines; gint num_pages; } PrintData; static void begin_print (GtkPrintOperation *operation, GtkPrintContext *context, gpointer user_data) { PrintData *data = (PrintData *)user_data; GBytes *bytes; int i; double height; height = gtk_print_context_get_height (context) - HEADER_HEIGHT - HEADER_GAP; data->lines_per_page = floor (height / data->font_size); bytes = g_resources_lookup_data (data->resourcename, 0, NULL); data->lines = g_strsplit (g_bytes_get_data (bytes, NULL), "\n", 0); g_bytes_unref (bytes); i = 0; while (data->lines[i] != NULL) i++; data->num_lines = i; data->num_pages = (data->num_lines - 1) / data->lines_per_page + 1; gtk_print_operation_set_n_pages (operation, data->num_pages); } static void draw_page (GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer user_data) { PrintData *data = (PrintData *)user_data; cairo_t *cr; PangoLayout *layout; gint text_width, text_height; gdouble width; gint line, i; PangoFontDescription *desc; gchar *page_str; cr = gtk_print_context_get_cairo_context (context); width = gtk_print_context_get_width (context); cairo_rectangle (cr, 0, 0, width, HEADER_HEIGHT); cairo_set_source_rgb (cr, 0.8, 0.8, 0.8); cairo_fill_preserve (cr); cairo_set_source_rgb (cr, 0, 0, 0); cairo_set_line_width (cr, 1); cairo_stroke (cr); layout = gtk_print_context_create_pango_layout (context); desc = pango_font_description_from_string ("sans 14"); pango_layout_set_font_description (layout, desc); pango_font_description_free (desc); pango_layout_set_text (layout, data->resourcename, -1); pango_layout_get_pixel_size (layout, &text_width, &text_height); if (text_width > width) { pango_layout_set_width (layout, width); pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_START); pango_layout_get_pixel_size (layout, &text_width, &text_height); } cairo_move_to (cr, (width - text_width) / 2, (HEADER_HEIGHT - text_height) / 2); pango_cairo_show_layout (cr, layout); page_str = g_strdup_printf ("%d/%d", page_nr + 1, data->num_pages); pango_layout_set_text (layout, page_str, -1); g_free (page_str); pango_layout_set_width (layout, -1); pango_layout_get_pixel_size (layout, &text_width, &text_height); cairo_move_to (cr, width - text_width - 4, (HEADER_HEIGHT - text_height) / 2); pango_cairo_show_layout (cr, layout); g_object_unref (layout); layout = gtk_print_context_create_pango_layout (context); desc = pango_font_description_from_string ("monospace"); pango_font_description_set_size (desc, data->font_size * PANGO_SCALE); pango_layout_set_font_description (layout, desc); pango_font_description_free (desc); cairo_move_to (cr, 0, HEADER_HEIGHT + HEADER_GAP); line = page_nr * data->lines_per_page; for (i = 0; i < data->lines_per_page && line < data->num_lines; i++) { pango_layout_set_text (layout, data->lines[line], -1); pango_cairo_show_layout (cr, layout); cairo_rel_move_to (cr, 0, data->font_size); line++; } g_object_unref (layout); } static void end_print (GtkPrintOperation *operation, GtkPrintContext *context, gpointer user_data) { PrintData *data = (PrintData *)user_data; g_free (data->resourcename); g_strfreev (data->lines); g_free (data); } GtkWidget * do_printing (GtkWidget *do_widget) { GtkPrintOperation *operation; GtkPrintSettings *settings; PrintData *data; GError *error = NULL; operation = gtk_print_operation_new (); data = g_new0 (PrintData, 1); data->resourcename = g_strdup ("/sources/printing.c"); data->font_size = 12.0; g_signal_connect (G_OBJECT (operation), "begin-print", G_CALLBACK (begin_print), data); g_signal_connect (G_OBJECT (operation), "draw-page", G_CALLBACK (draw_page), data); g_signal_connect (G_OBJECT (operation), "end-print", G_CALLBACK (end_print), data); gtk_print_operation_set_use_full_page (operation, FALSE); gtk_print_operation_set_unit (operation, GTK_UNIT_POINTS); gtk_print_operation_set_embed_page_setup (operation, TRUE); settings = gtk_print_settings_new (); gtk_print_settings_set (settings, GTK_PRINT_SETTINGS_OUTPUT_BASENAME, "gtk-demo"); gtk_print_operation_set_print_settings (operation, settings); gtk_print_operation_run (operation, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, GTK_WINDOW (do_widget), &error); g_object_unref (operation); g_object_unref (settings); if (error) { GtkWidget *dialog; dialog = gtk_message_dialog_new (GTK_WINDOW (do_widget), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", error->message); g_error_free (error); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show (dialog); } return NULL; } (uuay)gnome-calendar.png PNG  IHDR00WgAMA1_ zIDATx]lWwvvwNvc7֤}B"TDAVT臢ҨQ Ayh)BB R>ѠTb'󹉿];wwfa7N*Du5;wN;Nnn0;x}?&Ex @twRJ"T!@QW @ a H_(yJ6'C""a$ BuZ BiM* *=ܪD;ϏweBB E*es8N2H)A6/O^ZJ)[?J%#/hl34*aH(ω|>*c76 $2'\O6.8y}B1aᅊmsu'X aHB|rןP(J(^)RԑRDJNDΗ^ac_kG-VVW6l |#bhm!ne~ye9FhfA^G#7)rp$^<|] QJ"py2 KV^o $ʈ C;Qؐ{Iȥnc2}8ڭ;rk LdGui 8ƃ@ "Z!&7ֽ@^xO,k*)-l ]o[fMCz8@oܸ K;7ę v(d6LJxh-`Oˌ]5MdU`PHw@1c; 9D5#M@.}@7vg):?yyF+C ? lSKl =˓R)/fYZ)JgDeYZXbbGF@o84ށX5e!J:OS)N)w3ccdYv 180H+Mm֢@QNtR|'C^_Cgzt%eTkÐZ25;5эIXخh&BrĻt[jEZjc'ak*ͮa1yKTu]T%onl(r  ~ضrC4d'Ƅ:o!:zGcXd&zI} !ҩh+-G7 I4[=`ŵ $Mce_ܿ'F{1>7wccۀ^k1.Z\10ŁNVdf9v)c|t=< 3ccL̔1E94y0nzz=Du:3 static GtkWidget *window = NULL; static void search_entry_destroyed (GtkWidget *widget) { window = NULL; } static void search_changed_cb (GtkSearchEntry *entry, GtkLabel *result_label) { const char *text; text = gtk_entry_get_text (GTK_ENTRY (entry)); g_message ("search changed: %s", text); gtk_label_set_text (result_label, text ? text : ""); } static void changed_cb (GtkEditable *editable) { const char *text; text = gtk_entry_get_text (GTK_ENTRY (editable)); g_message ("changed: %s", text); } static gboolean window_key_press_event_cb (GtkWidget *widget, GdkEvent *event, GtkSearchBar *bar) { return gtk_search_bar_handle_event (bar, event); } static void search_changed (GtkSearchEntry *entry, GtkLabel *label) { gtk_label_set_text (label, "search-changed"); } static void next_match (GtkSearchEntry *entry, GtkLabel *label) { gtk_label_set_text (label, "next-match"); } static void previous_match (GtkSearchEntry *entry, GtkLabel *label) { gtk_label_set_text (label, "previous-match"); } static void stop_search (GtkSearchEntry *entry, GtkLabel *label) { gtk_label_set_text (label, "stop-search"); } GtkWidget * do_search_entry2 (GtkWidget *do_widget) { GtkWidget *vbox; GtkWidget *hbox; GtkWidget *label; GtkWidget *entry; GtkWidget *container; GtkWidget *searchbar; GtkWidget *button; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Search Entry #2"); gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget)); gtk_window_set_resizable (GTK_WINDOW (window), TRUE); gtk_widget_set_size_request (window, 200, -1); g_signal_connect (window, "destroy", G_CALLBACK (search_entry_destroyed), &window); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_container_set_border_width (GTK_CONTAINER (vbox), 0); entry = gtk_search_entry_new (); container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); gtk_widget_set_halign (container, GTK_ALIGN_CENTER); gtk_box_pack_start (GTK_BOX (container), entry, FALSE, FALSE, 0); searchbar = gtk_search_bar_new (); gtk_search_bar_connect_entry (GTK_SEARCH_BAR (searchbar), GTK_ENTRY (entry)); gtk_search_bar_set_show_close_button (GTK_SEARCH_BAR (searchbar), FALSE); gtk_container_add (GTK_CONTAINER (searchbar), container); gtk_box_pack_start (GTK_BOX (vbox), searchbar, FALSE, FALSE, 0); /* Hook the search bar to key presses */ g_signal_connect (window, "key-press-event", G_CALLBACK (window_key_press_event_cb), searchbar); /* Help */ label = gtk_label_new ("Start Typing to search"); gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0); /* Toggle button */ button = gtk_toggle_button_new_with_label ("Search"); g_object_bind_property (button, "active", searchbar, "search-mode-enabled", G_BINDING_BIDIRECTIONAL); gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0); /* Result */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox), 0); label = gtk_label_new ("Result:"); gtk_label_set_xalign (GTK_LABEL (label), 0.0); gtk_widget_set_margin_start (label, 6); gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); label = gtk_label_new (""); gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); g_signal_connect (entry, "search-changed", G_CALLBACK (search_changed_cb), label); g_signal_connect (entry, "changed", G_CALLBACK (changed_cb), label); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox), 0); label = gtk_label_new ("Signal:"); gtk_label_set_xalign (GTK_LABEL (label), 0.0); gtk_widget_set_margin_start (label, 6); gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); label = gtk_label_new (""); gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); g_signal_connect (entry, "search-changed", G_CALLBACK (search_changed), label); g_signal_connect (entry, "next-match", G_CALLBACK (next_match), label); g_signal_connect (entry, "previous-match", G_CALLBACK (previous_match), label); g_signal_connect (entry, "stop-search", G_CALLBACK (stop_search), label); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)button_box.c/* Button Boxes * * The Button Box widgets are used to arrange buttons with padding. */ #include #include static GtkWidget * create_bbox (gint horizontal, char *title, gint spacing, gint layout) { GtkWidget *frame; GtkWidget *bbox; GtkWidget *button; frame = gtk_frame_new (title); if (horizontal) bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); else bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL); gtk_container_set_border_width (GTK_CONTAINER (bbox), 5); gtk_container_add (GTK_CONTAINER (frame), bbox); gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout); gtk_box_set_spacing (GTK_BOX (bbox), spacing); button = gtk_button_new_with_label (_("OK")); gtk_container_add (GTK_CONTAINER (bbox), button); button = gtk_button_new_with_label (_("Cancel")); gtk_container_add (GTK_CONTAINER (bbox), button); button = gtk_button_new_with_label (_("Help")); gtk_container_add (GTK_CONTAINER (bbox), button); return frame; } GtkWidget * do_button_box (GtkWidget *do_widget) { static GtkWidget *window = NULL; GtkWidget *main_vbox; GtkWidget *vbox; GtkWidget *hbox; GtkWidget *frame_horz; GtkWidget *frame_vert; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Button Boxes"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_container_set_border_width (GTK_CONTAINER (window), 10); main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), main_vbox); frame_horz = gtk_frame_new ("Horizontal Button Boxes"); gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz, TRUE, TRUE, 10); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 10); gtk_container_add (GTK_CONTAINER (frame_horz), vbox); gtk_box_pack_start (GTK_BOX (vbox), create_bbox (TRUE, "Spread", 40, GTK_BUTTONBOX_SPREAD), TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox), create_bbox (TRUE, "Edge", 40, GTK_BUTTONBOX_EDGE), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (vbox), create_bbox (TRUE, "Start", 40, GTK_BUTTONBOX_START), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (vbox), create_bbox (TRUE, "End", 40, GTK_BUTTONBOX_END), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (vbox), create_bbox (TRUE, "Center", 40, GTK_BUTTONBOX_CENTER), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (vbox), create_bbox (TRUE, "Expand", 0, GTK_BUTTONBOX_EXPAND), TRUE, TRUE, 5); frame_vert = gtk_frame_new ("Vertical Button Boxes"); gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert, TRUE, TRUE, 10); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_container_add (GTK_CONTAINER (frame_vert), hbox); gtk_box_pack_start (GTK_BOX (hbox), create_bbox (FALSE, "Spread", 10, GTK_BUTTONBOX_SPREAD), TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), create_bbox (FALSE, "Edge", 10, GTK_BUTTONBOX_EDGE), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (hbox), create_bbox (FALSE, "Start", 10, GTK_BUTTONBOX_START), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (hbox), create_bbox (FALSE, "End", 10, GTK_BUTTONBOX_END), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (hbox), create_bbox (FALSE, "Center", 10, GTK_BUTTONBOX_CENTER), TRUE, TRUE, 5); gtk_box_pack_start (GTK_BOX (hbox), create_bbox (FALSE, "Expand", 0, GTK_BUTTONBOX_EXPAND), TRUE, TRUE, 5); } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)ui/search_entry.c"/* Entry/Search Entry * * GtkEntry allows to display icons and progress information. * This demo shows how to use these features in a search entry. */ #include #include static GtkWidget *window = NULL; static GtkWidget *menu = NULL; static GtkWidget *notebook = NULL; static guint search_progress_id = 0; static guint finish_search_id = 0; static void show_find_button (void) { gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 0); } static void show_cancel_button (void) { gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook), 1); } static gboolean search_progress (gpointer data) { gtk_entry_progress_pulse (GTK_ENTRY (data)); return G_SOURCE_CONTINUE; } static void search_progress_done (GtkEntry *entry) { gtk_entry_set_progress_fraction (entry, 0.0); } static gboolean finish_search (GtkButton *button) { show_find_button (); g_source_remove (search_progress_id); search_progress_id = 0; return FALSE; } static gboolean start_search_feedback (gpointer data) { search_progress_id = g_timeout_add_full (G_PRIORITY_DEFAULT, 100, (GSourceFunc)search_progress, data, (GDestroyNotify)search_progress_done); return FALSE; } static void start_search (GtkButton *button, GtkEntry *entry) { show_cancel_button (); search_progress_id = g_timeout_add_seconds (1, (GSourceFunc)start_search_feedback, entry); finish_search_id = g_timeout_add_seconds (15, (GSourceFunc)finish_search, button); } static void stop_search (GtkButton *button, gpointer data) { g_source_remove (finish_search_id); finish_search (button); } static void clear_entry (GtkEntry *entry) { gtk_entry_set_text (entry, ""); } static void search_by_name (GtkWidget *item, GtkEntry *entry) { gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, "Search by name\n" "Click here to change the search type"); gtk_entry_set_placeholder_text (entry, "name"); } static void search_by_description (GtkWidget *item, GtkEntry *entry) { gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, "Search by description\n" "Click here to change the search type"); gtk_entry_set_placeholder_text (entry, "description"); } static void search_by_file (GtkWidget *item, GtkEntry *entry) { gtk_entry_set_icon_tooltip_text (entry, GTK_ENTRY_ICON_PRIMARY, "Search by file name\n" "Click here to change the search type"); gtk_entry_set_placeholder_text (entry, "file name"); } GtkWidget * create_search_menu (GtkWidget *entry) { GtkWidget *menu; GtkWidget *item; menu = gtk_menu_new (); item = gtk_menu_item_new_with_mnemonic ("Search by _name"); g_signal_connect (item, "activate", G_CALLBACK (search_by_name), entry); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); item = gtk_menu_item_new_with_mnemonic ("Search by _description"); g_signal_connect (item, "activate", G_CALLBACK (search_by_description), entry); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); item = gtk_menu_item_new_with_mnemonic ("Search by _file name"); g_signal_connect (item, "activate", G_CALLBACK (search_by_file), entry); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_show_all (menu); return menu; } static void icon_press_cb (GtkEntry *entry, gint position, GdkEventButton *event, gpointer data) { if (position == GTK_ENTRY_ICON_PRIMARY) gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, event->button, event->time); } static void activate_cb (GtkEntry *entry, GtkButton *button) { if (search_progress_id != 0) return; start_search (button, entry); } static void search_entry_destroyed (GtkWidget *widget) { if (finish_search_id != 0) g_source_remove (finish_search_id); if (search_progress_id != 0) g_source_remove (search_progress_id); window = NULL; } static void entry_populate_popup (GtkEntry *entry, GtkMenu *menu, gpointer user_data) { GtkWidget *item; GtkWidget *search_menu; gboolean has_text; has_text = gtk_entry_get_text_length (entry) > 0; item = gtk_separator_menu_item_new (); gtk_widget_show (item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); item = gtk_menu_item_new_with_mnemonic ("C_lear"); gtk_widget_show (item); g_signal_connect_swapped (item, "activate", G_CALLBACK (clear_entry), entry); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_set_sensitive (item, has_text); search_menu = create_search_menu (GTK_WIDGET (entry)); item = gtk_menu_item_new_with_label ("Search by"); gtk_widget_show (item); gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), search_menu); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); } GtkWidget * do_search_entry (GtkWidget *do_widget) { GtkWidget *content_area; GtkWidget *vbox; GtkWidget *hbox; GtkWidget *label; GtkWidget *entry; GtkWidget *button; GtkWidget *find_button; GtkWidget *cancel_button; if (!window) { window = gtk_dialog_new_with_buttons ("Search Entry", GTK_WINDOW (do_widget), 0, _("_Close"), GTK_RESPONSE_NONE, NULL); gtk_window_set_resizable (GTK_WINDOW (window), FALSE); g_signal_connect (window, "response", G_CALLBACK (gtk_widget_destroy), NULL); g_signal_connect (window, "destroy", G_CALLBACK (search_entry_destroyed), &window); content_area = gtk_dialog_get_content_area (GTK_DIALOG (window)); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "Search entry demo"); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox), 0); /* Create our entry */ entry = gtk_search_entry_new (); gtk_box_pack_start (GTK_BOX (hbox), entry, FALSE, FALSE, 0); /* Create the find and cancel buttons */ notebook = gtk_notebook_new (); gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); gtk_box_pack_start (GTK_BOX (hbox), notebook, FALSE, FALSE, 0); find_button = gtk_button_new_with_label ("Find"); g_signal_connect (find_button, "clicked", G_CALLBACK (start_search), entry); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), find_button, NULL); gtk_widget_show (find_button); cancel_button = gtk_button_new_with_label ("Cancel"); g_signal_connect (cancel_button, "clicked", G_CALLBACK (stop_search), NULL); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), cancel_button, NULL); gtk_widget_show (cancel_button); /* Set up the search icon */ search_by_name (NULL, GTK_ENTRY (entry)); /* Set up the clear icon */ g_signal_connect (entry, "icon-press", G_CALLBACK (icon_press_cb), NULL); g_signal_connect (entry, "activate", G_CALLBACK (activate_cb), NULL); /* Create the menu */ menu = create_search_menu (entry); gtk_menu_attach_to_widget (GTK_MENU (menu), entry, NULL); /* add accessible alternatives for icon functionality */ g_signal_connect (entry, "populate-popup", G_CALLBACK (entry_populate_popup), NULL); /* Give the focus to the close button */ button = gtk_dialog_get_widget_for_response (GTK_DIALOG (window), GTK_RESPONSE_NONE); gtk_widget_grab_focus (button); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (menu); gtk_widget_destroy (window); window = NULL; } return window; } (uuay)reset.css/* @import this colorsheet to get the default values for every property. * This is useful when writing special CSS tests that should not be * inluenced by themes - not even the default ones. * Keep in mind that the output will be very ugly and not look like * anything GTK. * Also, when adding new style properties, please add them here. */ * { color: inherit; font-size: inherit; background-color: initial; font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; text-shadow: inherit; icon-shadow: inherit; box-shadow: initial; margin-top: initial; margin-left: initial; margin-bottom: initial; margin-right: initial; padding-top: initial; padding-left: initial; padding-bottom: initial; padding-right: initial; border-top-style: initial; border-top-width: initial; border-left-style: initial; border-left-width: initial; border-bottom-style: initial; border-bottom-width: initial; border-right-style: initial; border-right-width: initial; border-top-left-radius: initial; border-top-right-radius: initial; border-bottom-right-radius: initial; border-bottom-left-radius: initial; outline-style: initial; outline-width: initial; outline-offset: initial; background-clip: initial; background-origin: initial; background-size: initial; background-position: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: initial; outline-color: initial; background-repeat: initial; background-image: initial; border-image-source: initial; border-image-repeat: initial; border-image-slice: initial; border-image-width: initial; transition-property: initial; transition-duration: initial; transition-timing-function: initial; transition-delay: initial; engine: initial; gtk-key-bindings: initial; -GtkWidget-focus-line-width: 0; -GtkWidget-focus-padding: 0; -GtkNotebook-initial-gap: 0; } (uuay)apple-red.png PNG  IHDR00WgAMA a IDATx[]Wyk9s8 N)JڄڨB>pE WK R@@@BqS+8v3sk}>31^|֞9e{^tvy_Tz߇} r޽cksM?p<p+E>*ܾ֏ W]vfgvw>yv!'+_dLom]aD֭G7L#ͯ굿>tbލW-,.{>E,&+֬h /ڳ{^>߄z;?/ ;po}U.tKGŇf6)o]EZ91|}~ W--7C4 ;%씍ozۍ! g|aNgnMo,VKU!@0G|׶nڱk5pJog&;W5B8tpao;[6:׽O\ 2R wͮr|Ο=ZEB|[aղ,ꭿw~x VmB)Fhcݷ}\In}GSefc"vԪg/-3j"`wogpr>Aqow;7O ̄ & AXA۰ض8pS9pMNwnmჃja~n,v?s{v}7ُOP v4!tTUMOh[( 0 :4uȢ(;'yn9?Scbጙ!|'/͛7+Wu_իNH)D^'jFĪBĐ,h.%49 0ofH_ CSv&/ʁnzhɖtJ?ܽ^q6]^~ӣ&5)G1!@2 ĺۖzf r\饊6?7=_ޓwַ/;w'W7y'^jc wzCDqbO1H!޴a f曖cP26,dhRЀص0hO~ί{r/VOMVl^}5#ey_\3*1D7*Jx*4+Dƨ$",X^SxAJpǏvpǏ8Gݍ׮YmeM޲zr\ǎ1?L NɈq X4L Iz!u$Dw!P!X(3J⺫~w>*;o; fLթѦO{ A?MtzU:z47"qsHNDS@8ɜn5A75e<3atH` _ v:,~J;I`U"* af#Pp wD0US"Vka`9zT5^W/8Ognl?P2⠥Qs8;A T"J9%3^]vݫ )%@_jBxɘ9w'fT(0 -/lpaAAi#aEN0NKm7]E;tz`@~$Zɘ`xD^1CQƱoN@pu,@z%jS6:ઔEk)e  "`h "TFPv,GbrJ>5ZS TP'4QuGlb*-+18ʨ>L Uǣ",*V1,E, *U;Ή@&D "Ǐљ&}a5\ )"JF0U3 sh БB+isa+  J)-M:&Xɸ "y4âd-TrD@#Ȱ(q@S<ܶwŧULЛYE*J.D B#%Cdb`#j0#qZUT)h}7kCPK VfZaoI@PB iA ֩#  F Q>JdŽP1IP"XTlXE"ia"Z@<hsaЎgyhCL_) LMttzb|[{v0Fԕ*A"E" 'U(G3.ElPSZsD %;١B1rch&3Ԅ%$D9FbwƓ963{;ydb vXs<2N80qY?fza\!9zTr;O97c2~ie8]щblE˜ |\IENDB`(uuay)stack.cv/* Stack * * GtkStack is a container that shows a single child at a time, * with nice transitions when the visible child changes. * * GtkStackSwitcher adds buttons to control which child is visible. */ #include static GtkBuilder *builder; GtkWidget * do_stack (GtkWidget *do_widget) { static GtkWidget *window = NULL; GError *err = NULL; if (!window) { builder = gtk_builder_new (); gtk_builder_add_from_resource (builder, "/stack/stack.ui", &err); if (err) { g_error ("ERROR: %s\n", err->message); return NULL; } gtk_builder_connect_signals (builder, NULL); window = GTK_WIDGET (gtk_builder_get_object (builder, "window1")); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)css_accordion.css;@import url("resource://css_accordion/reset.css"); * { transition-property: color, background-color, border-color, background-image, padding, border-width; transition-duration: 1s; font: Cantarell 20px; } GtkWindow { background: linear-gradient(153deg, #151515, #151515 5px, transparent 5px) 0 0, linear-gradient(333deg, #151515, #151515 5px, transparent 5px) 10px 5px, linear-gradient(153deg, #222, #222 5px, transparent 5px) 0 5px, linear-gradient(333deg, #222, #222 5px, transparent 5px) 10px 10px, linear-gradient(90deg, #1b1b1b, #1b1b1b 10px, transparent 10px), linear-gradient(#1d1d1d, #1d1d1d 25%, #1a1a1a 25%, #1a1a1a 50%, transparent 50%, transparent 75%, #242424 75%, #242424); background-color: #131313; background-size: 20px 20px; } .button { color: black; background-color: #bbb; border-style: solid; border-width: 2px 0 2px 2px; border-color: #333; padding: 12px 4px; } .button:first-child { border-radius: 5px 0 0 5px; } .button:last-child { border-radius: 0 5px 5px 0; border-width: 2px; } .button:hover { padding: 12px 48px; background-color: #4870bc; } .button *:hover { color: white; } .button:hover:active, .button:active { background-color: #993401; } (uuay)glarea.c)/* OpenGL Area * * GtkGLArea is a widget that allows custom drawing using OpenGL calls. */ #include #include #include static GtkWidget *demo_window = NULL; /* the GtkGLArea widget */ static GtkWidget *gl_area = NULL; enum { X_AXIS, Y_AXIS, Z_AXIS, N_AXIS }; /* Rotation angles on each axis */ static float rotation_angles[N_AXIS] = { 0.0 }; /* The object we are drawing */ static const GLfloat vertex_data[] = { 0.f, 0.5f, 0.f, 1.f, 0.5f, -0.366f, 0.f, 1.f, -0.5f, -0.366f, 0.f, 1.f, }; /* Initialize the GL buffers */ static void init_buffers (GLuint *vao_out, GLuint *buffer_out) { GLuint vao, buffer; /* We only use one VAO, so we always keep it bound */ glGenVertexArrays (1, &vao); glBindVertexArray (vao); /* This is the buffer that holds the vertices */ glGenBuffers (1, &buffer); glBindBuffer (GL_ARRAY_BUFFER, buffer); glBufferData (GL_ARRAY_BUFFER, sizeof (vertex_data), vertex_data, GL_STATIC_DRAW); glBindBuffer (GL_ARRAY_BUFFER, 0); if (vao_out != NULL) *vao_out = vao; if (buffer_out != NULL) *buffer_out = buffer; } /* Create and compile a shader */ static GLuint create_shader (int type, const char *src) { GLuint shader; int status; shader = glCreateShader (type); glShaderSource (shader, 1, &src, NULL); glCompileShader (shader); glGetShaderiv (shader, GL_COMPILE_STATUS, &status); if (status == GL_FALSE) { int log_len; char *buffer; glGetShaderiv (shader, GL_INFO_LOG_LENGTH, &log_len); buffer = g_malloc (log_len + 1); glGetShaderInfoLog (shader, log_len, NULL, buffer); g_warning ("Compile failure in %s shader:\n%s\n", type == GL_VERTEX_SHADER ? "vertex" : "fragment", buffer); g_free (buffer); glDeleteShader (shader); return 0; } return shader; } /* Initialize the shaders and link them into a program */ static void init_shaders (GLuint *program_out, GLuint *mvp_out) { GLuint vertex, fragment; GLuint program = 0; GLuint mvp = 0; int status; GBytes *source; source = g_resources_lookup_data ("/glarea/glarea-vertex.glsl", 0, NULL); vertex = create_shader (GL_VERTEX_SHADER, g_bytes_get_data (source, NULL)); g_bytes_unref (source); if (vertex == 0) { *program_out = 0; return; } source = g_resources_lookup_data ("/glarea/glarea-fragment.glsl", 0, NULL); fragment = create_shader (GL_FRAGMENT_SHADER, g_bytes_get_data (source, NULL)); g_bytes_unref (source); if (fragment == 0) { glDeleteShader (vertex); *program_out = 0; return; } program = glCreateProgram (); glAttachShader (program, vertex); glAttachShader (program, fragment); glLinkProgram (program); glGetProgramiv (program, GL_LINK_STATUS, &status); if (status == GL_FALSE) { int log_len; char *buffer; glGetProgramiv (program, GL_INFO_LOG_LENGTH, &log_len); buffer = g_malloc (log_len + 1); glGetProgramInfoLog (program, log_len, NULL, buffer); g_warning ("Linking failure:\n%s\n", buffer); g_free (buffer); glDeleteProgram (program); program = 0; goto out; } /* Get the location of the "mvp" uniform */ mvp = glGetUniformLocation (program, "mvp"); glDetachShader (program, vertex); glDetachShader (program, fragment); out: glDeleteShader (vertex); glDeleteShader (fragment); if (program_out != NULL) *program_out = program; if (mvp_out != NULL) *mvp_out = mvp; } static void compute_mvp (float *res, float phi, float theta, float psi) { float x = phi * (G_PI / 180.f); float y = theta * (G_PI / 180.f); float z = psi * (G_PI / 180.f); float c1 = cosf (x), s1 = sinf (x); float c2 = cosf (y), s2 = sinf (y); float c3 = cosf (z), s3 = sinf (z); float c3c2 = c3 * c2; float s3c1 = s3 * c1; float c3s2s1 = c3 * s2 * s1; float s3s1 = s3 * s1; float c3s2c1 = c3 * s2 * c1; float s3c2 = s3 * c2; float c3c1 = c3 * c1; float s3s2s1 = s3 * s2 * s1; float c3s1 = c3 * s1; float s3s2c1 = s3 * s2 * c1; float c2s1 = c2 * s1; float c2c1 = c2 * c1; /* initialize to the identity matrix */ res[0] = 1.f; res[4] = 0.f; res[8] = 0.f; res[12] = 0.f; res[1] = 0.f; res[5] = 1.f; res[9] = 0.f; res[13] = 0.f; res[2] = 0.f; res[6] = 0.f; res[10] = 1.f; res[14] = 0.f; res[3] = 0.f; res[7] = 0.f; res[11] = 0.f; res[15] = 1.f; /* apply all three rotations using the three matrices: * * ⎡ c3 s3 0 ⎤ ⎡ c2 0 -s2 ⎤ ⎡ 1 0 0 ⎤ * ⎢ -s3 c3 0 ⎥ ⎢ 0 1 0 ⎥ ⎢ 0 c1 s1 ⎥ * ⎣ 0 0 1 ⎦ ⎣ s2 0 c2 ⎦ ⎣ 0 -s1 c1 ⎦ */ res[0] = c3c2; res[4] = s3c1 + c3s2s1; res[8] = s3s1 - c3s2c1; res[12] = 0.f; res[1] = -s3c2; res[5] = c3c1 - s3s2s1; res[9] = c3s1 + s3s2c1; res[13] = 0.f; res[2] = s2; res[6] = -c2s1; res[10] = c2c1; res[14] = 0.f; res[3] = 0.f; res[7] = 0.f; res[11] = 0.f; res[15] = 1.f; } static GLuint position_buffer; static GLuint program; static GLuint mvp_location; /* We need to set up our state when we realize the GtkGLArea widget */ static void realize (GtkWidget *widget) { gtk_gl_area_make_current (GTK_GL_AREA (widget)); if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL) return; init_buffers (&position_buffer, NULL); init_shaders (&program, &mvp_location); } /* We should tear down the state when unrealizing */ static void unrealize (GtkWidget *widget) { gtk_gl_area_make_current (GTK_GL_AREA (widget)); if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL) return; glDeleteBuffers (1, &position_buffer); glDeleteProgram (program); } static void draw_triangle (void) { float mvp[16]; /* Compute the model view projection matrix using the * rotation angles specified through the GtkRange widgets */ compute_mvp (mvp, rotation_angles[X_AXIS], rotation_angles[Y_AXIS], rotation_angles[Z_AXIS]); /* Use our shaders */ glUseProgram (program); /* Update the "mvp" matrix we use in the shader */ glUniformMatrix4fv (mvp_location, 1, GL_FALSE, &mvp[0]); /* Use the vertices in our buffer */ glBindBuffer (GL_ARRAY_BUFFER, position_buffer); glEnableVertexAttribArray (0); glVertexAttribPointer (0, 4, GL_FLOAT, GL_FALSE, 0, 0); /* Draw the three vertices as a triangle */ glDrawArrays (GL_TRIANGLES, 0, 3); /* We finished using the buffers and program */ glDisableVertexAttribArray (0); glBindBuffer (GL_ARRAY_BUFFER, 0); glUseProgram (0); } static gboolean render (GtkGLArea *area, GdkGLContext *context) { if (gtk_gl_area_get_error (area) != NULL) return FALSE; /* Clear the viewport */ glClearColor (0.5, 0.5, 0.5, 1.0); glClear (GL_COLOR_BUFFER_BIT); /* Draw our object */ draw_triangle (); /* Flush the contents of the pipeline */ glFlush (); return TRUE; } static void on_axis_value_change (GtkAdjustment *adjustment, gpointer data) { int axis = GPOINTER_TO_INT (data); g_assert (axis >= 0 && axis < N_AXIS); /* Update the rotation angle */ rotation_angles[axis] = gtk_adjustment_get_value (adjustment); /* Update the contents of the GL drawing area */ gtk_widget_queue_draw (gl_area); } static GtkWidget * create_axis_slider (int axis) { GtkWidget *box, *label, *slider; GtkAdjustment *adj; const char *text; box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE); switch (axis) { case X_AXIS: text = "X axis"; break; case Y_AXIS: text = "Y axis"; break; case Z_AXIS: text = "Z axis"; break; default: g_assert_not_reached (); } label = gtk_label_new (text); gtk_container_add (GTK_CONTAINER (box), label); gtk_widget_show (label); adj = gtk_adjustment_new (0.0, 0.0, 360.0, 1.0, 12.0, 0.0); g_signal_connect (adj, "value-changed", G_CALLBACK (on_axis_value_change), GINT_TO_POINTER (axis)); slider = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adj); gtk_container_add (GTK_CONTAINER (box), slider); gtk_widget_set_hexpand (slider, TRUE); gtk_widget_show (slider); gtk_widget_show (box); return box; } static void close_window (GtkWidget *widget) { /* Reset the state */ demo_window = NULL; gl_area = NULL; rotation_angles[X_AXIS] = 0.0; rotation_angles[Y_AXIS] = 0.0; rotation_angles[Z_AXIS] = 0.0; } GtkWidget * create_glarea_window (GtkWidget *do_widget) { GtkWidget *window, *box, *button, *controls; int i; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "GtkGLArea - Golden Triangle"); gtk_window_set_default_size (GTK_WINDOW (window), 400, 600); gtk_container_set_border_width (GTK_CONTAINER (window), 12); g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE); gtk_box_set_spacing (GTK_BOX (box), 6); gtk_container_add (GTK_CONTAINER (window), box); gl_area = gtk_gl_area_new (); gtk_widget_set_hexpand (gl_area, TRUE); gtk_widget_set_vexpand (gl_area, TRUE); gtk_container_add (GTK_CONTAINER (box), gl_area); /* We need to initialize and free GL resources, so we use * the realize and unrealize signals on the widget */ g_signal_connect (gl_area, "realize", G_CALLBACK (realize), NULL); g_signal_connect (gl_area, "unrealize", G_CALLBACK (unrealize), NULL); /* The main "draw" call for GtkGLArea */ g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL); controls = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE); gtk_container_add (GTK_CONTAINER (box), controls); gtk_widget_set_hexpand (controls, TRUE); for (i = 0; i < N_AXIS; i++) gtk_container_add (GTK_CONTAINER (controls), create_axis_slider (i)); button = gtk_button_new_with_label ("Quit"); gtk_widget_set_hexpand (button, TRUE); gtk_container_add (GTK_CONTAINER (box), button); g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window); return window; } GtkWidget* do_glarea (GtkWidget *do_widget) { if (demo_window == NULL) demo_window = create_glarea_window (do_widget); if (!gtk_widget_get_visible (demo_window)) gtk_widget_show_all (demo_window); else gtk_widget_destroy (demo_window); return demo_window; } (uuay)combobox.c3/* Combo Boxes * * The GtkComboBox widget allows to select one option out of a list. * The GtkComboBoxEntry additionally allows the user to enter a value * that is not in the list of options. * * How the options are displayed is controlled by cell renderers. */ #include #include enum { ICON_NAME_COL, TEXT_COL }; static GtkTreeModel * create_icon_store (void) { const gchar *icon_names[6] = { "dialog-warning", "process-stop", "document-new", "edit-clear", NULL, "document-open" }; const gchar *labels[6] = { N_("Warning"), N_("Stop"), N_("New"), N_("Clear"), NULL, N_("Open") }; GtkWidget *cellview; GtkTreeIter iter; GtkListStore *store; gint i; cellview = gtk_cell_view_new (); store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); for (i = 0; i < G_N_ELEMENTS (icon_names); i++) { if (icon_names[i]) { gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, ICON_NAME_COL, icon_names[i], TEXT_COL, _(labels[i]), -1); } else { gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, ICON_NAME_COL, NULL, TEXT_COL, "separator", -1); } } gtk_widget_destroy (cellview); return GTK_TREE_MODEL (store); } /* A GtkCellLayoutDataFunc that demonstrates how one can control * sensitivity of rows. This particular function does nothing * useful and just makes the second row insensitive. */ static void set_sensitive (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) { GtkTreePath *path; gint *indices; gboolean sensitive; path = gtk_tree_model_get_path (tree_model, iter); indices = gtk_tree_path_get_indices (path); sensitive = indices[0] != 1; gtk_tree_path_free (path); g_object_set (cell, "sensitive", sensitive, NULL); } /* A GtkTreeViewRowSeparatorFunc that demonstrates how rows can be * rendered as separators. This particular function does nothing * useful and just turns the fourth row into a separator. */ static gboolean is_separator (GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { GtkTreePath *path; gboolean result; path = gtk_tree_model_get_path (model, iter); result = gtk_tree_path_get_indices (path)[0] == 4; gtk_tree_path_free (path); return result; } static GtkTreeModel * create_capital_store (void) { struct { gchar *group; gchar *capital; } capitals[] = { { "A - B", NULL }, { NULL, "Albany" }, { NULL, "Annapolis" }, { NULL, "Atlanta" }, { NULL, "Augusta" }, { NULL, "Austin" }, { NULL, "Baton Rouge" }, { NULL, "Bismarck" }, { NULL, "Boise" }, { NULL, "Boston" }, { "C - D", NULL }, { NULL, "Carson City" }, { NULL, "Charleston" }, { NULL, "Cheyenne" }, { NULL, "Columbia" }, { NULL, "Columbus" }, { NULL, "Concord" }, { NULL, "Denver" }, { NULL, "Des Moines" }, { NULL, "Dover" }, { "E - J", NULL }, { NULL, "Frankfort" }, { NULL, "Harrisburg" }, { NULL, "Hartford" }, { NULL, "Helena" }, { NULL, "Honolulu" }, { NULL, "Indianapolis" }, { NULL, "Jackson" }, { NULL, "Jefferson City" }, { NULL, "Juneau" }, { "K - O" }, { NULL, "Lansing" }, { NULL, "Lincoln" }, { NULL, "Little Rock" }, { NULL, "Madison" }, { NULL, "Montgomery" }, { NULL, "Montpelier" }, { NULL, "Nashville" }, { NULL, "Oklahoma City" }, { NULL, "Olympia" }, { NULL, "P - S" }, { NULL, "Phoenix" }, { NULL, "Pierre" }, { NULL, "Providence" }, { NULL, "Raleigh" }, { NULL, "Richmond" }, { NULL, "Sacramento" }, { NULL, "Salem" }, { NULL, "Salt Lake City" }, { NULL, "Santa Fe" }, { NULL, "Springfield" }, { NULL, "St. Paul" }, { "T - Z", NULL }, { NULL, "Tallahassee" }, { NULL, "Topeka" }, { NULL, "Trenton" }, { NULL, NULL } }; GtkTreeIter iter, iter2; GtkTreeStore *store; gint i; store = gtk_tree_store_new (1, G_TYPE_STRING); for (i = 0; capitals[i].group || capitals[i].capital; i++) { if (capitals[i].group) { gtk_tree_store_append (store, &iter, NULL); gtk_tree_store_set (store, &iter, 0, capitals[i].group, -1); } else if (capitals[i].capital) { gtk_tree_store_append (store, &iter2, &iter); gtk_tree_store_set (store, &iter2, 0, capitals[i].capital, -1); } } return GTK_TREE_MODEL (store); } static void is_capital_sensitive (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) { gboolean sensitive; sensitive = !gtk_tree_model_iter_has_child (tree_model, iter); g_object_set (cell, "sensitive", sensitive, NULL); } static void fill_combo_entry (GtkWidget *combo) { gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "One"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "Two"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "2\302\275"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "Three"); } /* A simple validating entry */ #define TYPE_MASK_ENTRY (mask_entry_get_type ()) #define MASK_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MASK_ENTRY, MaskEntry)) #define MASK_ENTRY_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), TYPE_MASK_ENTRY, MaskEntryClass)) #define IS_MASK_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MASK_ENTRY)) #define IS_MASK_ENTRY_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), TYPE_MASK_ENTRY)) #define MASK_ENTRY_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), TYPE_MASK_ENTRY, MaskEntryClass)) typedef struct _MaskEntry MaskEntry; struct _MaskEntry { GtkEntry entry; gchar *mask; }; typedef struct _MaskEntryClass MaskEntryClass; struct _MaskEntryClass { GtkEntryClass parent_class; }; static void mask_entry_editable_init (GtkEditableInterface *iface); G_DEFINE_TYPE_WITH_CODE (MaskEntry, mask_entry, GTK_TYPE_ENTRY, G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE, mask_entry_editable_init)); static void mask_entry_set_background (MaskEntry *entry) { if (entry->mask) { if (!g_regex_match_simple (entry->mask, gtk_entry_get_text (GTK_ENTRY (entry)), 0, 0)) { PangoAttrList *attrs; attrs = pango_attr_list_new (); pango_attr_list_insert (attrs, pango_attr_foreground_new (65535, 32767, 32767)); gtk_entry_set_attributes (GTK_ENTRY (entry), attrs); pango_attr_list_unref (attrs); return; } } gtk_entry_set_attributes (GTK_ENTRY (entry), NULL); } static void mask_entry_changed (GtkEditable *editable) { mask_entry_set_background (MASK_ENTRY (editable)); } static void mask_entry_init (MaskEntry *entry) { entry->mask = NULL; } static void mask_entry_class_init (MaskEntryClass *klass) { } static void mask_entry_editable_init (GtkEditableInterface *iface) { iface->changed = mask_entry_changed; } GtkWidget * do_combobox (GtkWidget *do_widget) { static GtkWidget *window = NULL; GtkWidget *vbox, *frame, *box, *combo, *entry; GtkTreeModel *model; GtkCellRenderer *renderer; GtkTreePath *path; GtkTreeIter iter; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Combo boxes"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_container_set_border_width (GTK_CONTAINER (window), 10); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); gtk_container_add (GTK_CONTAINER (window), vbox); /* A combobox demonstrating cell renderers, separators and * insensitive rows */ frame = gtk_frame_new ("Items with icons"); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_set_border_width (GTK_CONTAINER (box), 5); gtk_container_add (GTK_CONTAINER (frame), box); model = create_icon_store (); combo = gtk_combo_box_new_with_model (model); g_object_unref (model); gtk_container_add (GTK_CONTAINER (box), combo); renderer = gtk_cell_renderer_pixbuf_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, FALSE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer, "icon-name", ICON_NAME_COL, NULL); gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combo), renderer, set_sensitive, NULL, NULL); renderer = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer, "text", TEXT_COL, NULL); gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combo), renderer, set_sensitive, NULL, NULL); gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (combo), is_separator, NULL, NULL); gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0); /* A combobox demonstrating trees. */ frame = gtk_frame_new ("Where are we ?"); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_set_border_width (GTK_CONTAINER (box), 5); gtk_container_add (GTK_CONTAINER (frame), box); model = create_capital_store (); combo = gtk_combo_box_new_with_model (model); g_object_unref (model); gtk_container_add (GTK_CONTAINER (box), combo); renderer = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), renderer, "text", 0, NULL); gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combo), renderer, is_capital_sensitive, NULL, NULL); path = gtk_tree_path_new_from_indices (0, 8, -1); gtk_tree_model_get_iter (model, &iter, path); gtk_tree_path_free (path); gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combo), &iter); /* A GtkComboBoxEntry with validation. */ frame = gtk_frame_new ("Editable"); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_set_border_width (GTK_CONTAINER (box), 5); gtk_container_add (GTK_CONTAINER (frame), box); combo = gtk_combo_box_text_new_with_entry (); fill_combo_entry (combo); gtk_container_add (GTK_CONTAINER (box), combo); entry = g_object_new (TYPE_MASK_ENTRY, NULL); MASK_ENTRY (entry)->mask = "^([0-9]*|One|Two|2\302\275|Three)$"; gtk_container_remove (GTK_CONTAINER (combo), gtk_bin_get_child (GTK_BIN (combo))); gtk_container_add (GTK_CONTAINER (combo), entry); /* A combobox with string IDs */ frame = gtk_frame_new ("String IDs"); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_set_border_width (GTK_CONTAINER (box), 5); gtk_container_add (GTK_CONTAINER (frame), box); combo = gtk_combo_box_text_new (); gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "never", "Not visible"); gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "when-active", "Visible when active"); gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), "always", "Always visible"); gtk_container_add (GTK_CONTAINER (box), combo); entry = gtk_entry_new (); g_object_bind_property (combo, "active-id", entry, "text", G_BINDING_BIDIRECTIONAL); gtk_container_add (GTK_CONTAINER (box), entry); } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)builder/Zcss_multiplebgs.cn/* CSS Theming/Multiple Backgrounds * * Gtk themes are written using CSS. Every widget is build of multiple items * that you can style very similarly to a regular website. * */ #include static GtkWidget *window = NULL; static void show_parsing_error (GtkCssProvider *provider, GtkCssSection *section, const GError *error, GtkTextBuffer *buffer) { GtkTextIter start, end; const char *tag_name; gtk_text_buffer_get_iter_at_line_index (buffer, &start, gtk_css_section_get_start_line (section), gtk_css_section_get_start_position (section)); gtk_text_buffer_get_iter_at_line_index (buffer, &end, gtk_css_section_get_end_line (section), gtk_css_section_get_end_position (section)); if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED)) tag_name = "warning"; else tag_name = "error"; gtk_text_buffer_apply_tag_by_name (buffer, tag_name, &start, &end); } static void css_text_changed (GtkTextBuffer *buffer, GtkCssProvider *provider) { GtkTextIter start, end; char *text; gtk_text_buffer_get_start_iter (buffer, &start); gtk_text_buffer_get_end_iter (buffer, &end); gtk_text_buffer_remove_all_tags (buffer, &start, &end); text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); gtk_css_provider_load_from_data (provider, text, -1, NULL); g_free (text); gtk_style_context_reset_widgets (gdk_screen_get_default ()); } static gboolean drawing_area_draw (GtkWidget *widget, cairo_t *cr) { GtkStyleContext *context = gtk_widget_get_style_context (widget); gtk_render_background (context, cr, 0, 0, gtk_widget_get_allocated_width (widget), gtk_widget_get_allocated_height (widget)); gtk_render_frame (context, cr, 0, 0, gtk_widget_get_allocated_width (widget), gtk_widget_get_allocated_height (widget)); return FALSE; } static void apply_css (GtkWidget *widget, GtkStyleProvider *provider) { gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT); if (GTK_IS_CONTAINER (widget)) gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider); } GtkWidget * do_css_multiplebgs (GtkWidget *do_widget) { if (!window) { GtkWidget *paned, *container, *child; GtkStyleProvider *provider; GtkTextBuffer *text; GBytes *bytes; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget)); gtk_window_set_default_size (GTK_WINDOW (window), 400, 300); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); container = gtk_overlay_new (); gtk_widget_add_events (container, GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK); gtk_container_add (GTK_CONTAINER (window), container); child = gtk_drawing_area_new (); gtk_widget_set_name (child, "canvas"); g_signal_connect (child, "draw", G_CALLBACK (drawing_area_draw), NULL); gtk_container_add (GTK_CONTAINER (container), child); child = gtk_button_new (); gtk_widget_add_events (child, GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK); gtk_overlay_add_overlay (GTK_OVERLAY (container), child); gtk_widget_set_name (child, "bricks-button"); gtk_widget_set_halign (child, GTK_ALIGN_CENTER); gtk_widget_set_valign (child, GTK_ALIGN_CENTER); gtk_widget_set_size_request (child, 250, 84); paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL); gtk_overlay_add_overlay (GTK_OVERLAY (container), paned); /* Need a filler so we get a handle */ child = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (paned), child); text = gtk_text_buffer_new (NULL); gtk_text_buffer_create_tag (text, "warning", "underline", PANGO_UNDERLINE_SINGLE, NULL); gtk_text_buffer_create_tag (text, "error", "underline", PANGO_UNDERLINE_ERROR, NULL); provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ()); container = gtk_scrolled_window_new (NULL, NULL); gtk_container_add (GTK_CONTAINER (paned), container); child = gtk_text_view_new_with_buffer (text); gtk_container_add (GTK_CONTAINER (container), child); g_signal_connect (text, "changed", G_CALLBACK (css_text_changed), provider); bytes = g_resources_lookup_data ("/css_multiplebgs/css_multiplebgs.css", 0, NULL); gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes)); g_bytes_unref (bytes); g_signal_connect (provider, "parsing-error", G_CALLBACK (show_parsing_error), gtk_text_view_get_buffer (GTK_TEXT_VIEW (child))); apply_css (window, provider); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)messages.txt1|GTK+ and friends|@GTKtoolkit|GTK+ 3.8.0 (STABLE) released: wayland, Multi-application Broadway, improved CSS support and more ... http://ur1.ca/d6yms #gtk #gtk3|1364338800|0||4|2 2|Daniel Svensson|@dsvensson|Bringing an application up to the new features in GTK 3.x = tons of negative diffs, awesome work by @GTKtoolkit devs <3|1382565600|0|GTK+ and friends|0|1 3|GTK+ and friends|@GTKtoolkit|GLib status update and a warning: http://ur1.ca/awsm1 #glib|1384383600 4|GTK+ and friends|@GTKtoolkit|GProperty status: http://ur1.ca/awslh #glib|1384383300 5|GTK+ and friends|@GTKtoolkit|GTK+ 3.6.2 (STABLE) available: http://ur1.ca/awsl2 #gtk #gtk3|1384383000 6|GTK+ and friends|@GTKtoolkit|GLib 2.34.2 (STABLE) available: http://ur1.ca/awskn #glib|1384383000 7|GTK+ and friends|@GTKtoolkit|GTK+ 3.6.0 (STABLE) released: http://ur1.ca/aj4e0 #gtk #gtk3|1381528800 8|GTK+ and friends|@GTKtoolkit|GLib 2.34.0 (STABLE) released: http://ur1.ca/aj4du #glib|1381522800 (uuay)glarea-vertex.glslx#version 330 layout(location = 0) in vec4 position; uniform mat4 mvp; void main() { gl_Position = mvp * position; } (uuay)offscreen_window.c0L/* Offscreen Windows/Rotated Button * * Offscreen windows can be used to transform parts of a widget * hierarchy. Note that the rotated button is fully functional. */ #include #include #define GTK_TYPE_ROTATED_BIN (gtk_rotated_bin_get_type ()) #define GTK_ROTATED_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ROTATED_BIN, GtkRotatedBin)) #define GTK_ROTATED_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_ROTATED_BIN, GtkRotatedBinClass)) #define GTK_IS_ROTATED_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ROTATED_BIN)) #define GTK_IS_ROTATED_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ROTATED_BIN)) #define GTK_ROTATED_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_ROTATED_BIN, GtkRotatedBinClass)) typedef struct _GtkRotatedBin GtkRotatedBin; typedef struct _GtkRotatedBinClass GtkRotatedBinClass; struct _GtkRotatedBin { GtkContainer container; GtkWidget *child; GdkWindow *offscreen_window; gdouble angle; }; struct _GtkRotatedBinClass { GtkContainerClass parent_class; }; GType gtk_rotated_bin_get_type (void) G_GNUC_CONST; GtkWidget* gtk_rotated_bin_new (void); void gtk_rotated_bin_set_angle (GtkRotatedBin *bin, gdouble angle); /*** implementation ***/ static void gtk_rotated_bin_realize (GtkWidget *widget); static void gtk_rotated_bin_unrealize (GtkWidget *widget); static void gtk_rotated_bin_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural); static void gtk_rotated_bin_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural); static void gtk_rotated_bin_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static gboolean gtk_rotated_bin_damage (GtkWidget *widget, GdkEventExpose *event); static gboolean gtk_rotated_bin_draw (GtkWidget *widget, cairo_t *cr); static void gtk_rotated_bin_add (GtkContainer *container, GtkWidget *child); static void gtk_rotated_bin_remove (GtkContainer *container, GtkWidget *widget); static void gtk_rotated_bin_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); static GType gtk_rotated_bin_child_type (GtkContainer *container); G_DEFINE_TYPE (GtkRotatedBin, gtk_rotated_bin, GTK_TYPE_CONTAINER); static void to_child (GtkRotatedBin *bin, double widget_x, double widget_y, double *x_out, double *y_out) { GtkAllocation child_area; double x, y, xr, yr; double c, s; double w, h; s = sin (bin->angle); c = cos (bin->angle); gtk_widget_get_allocation (bin->child, &child_area); w = c * child_area.width + s * child_area.height; h = s * child_area.width + c * child_area.height; x = widget_x; y = widget_y; x -= (w - child_area.width) / 2; y -= (h - child_area.height) / 2; x -= child_area.width / 2; y -= child_area.height / 2; xr = x * c + y * s; yr = y * c - x * s; x = xr; y = yr; x += child_area.width / 2; y += child_area.height / 2; *x_out = x; *y_out = y; } static void to_parent (GtkRotatedBin *bin, double offscreen_x, double offscreen_y, double *x_out, double *y_out) { GtkAllocation child_area; double x, y, xr, yr; double c, s; double w, h; s = sin (bin->angle); c = cos (bin->angle); gtk_widget_get_allocation (bin->child, &child_area); w = c * child_area.width + s * child_area.height; h = s * child_area.width + c * child_area.height; x = offscreen_x; y = offscreen_y; x -= child_area.width / 2; y -= child_area.height / 2; xr = x * c - y * s; yr = x * s + y * c; x = xr; y = yr; x += child_area.width / 2; y += child_area.height / 2; x -= (w - child_area.width) / 2; y -= (h - child_area.height) / 2; *x_out = x; *y_out = y; } static void gtk_rotated_bin_class_init (GtkRotatedBinClass *klass) { GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass); widget_class->realize = gtk_rotated_bin_realize; widget_class->unrealize = gtk_rotated_bin_unrealize; widget_class->get_preferred_width = gtk_rotated_bin_get_preferred_width; widget_class->get_preferred_height = gtk_rotated_bin_get_preferred_height; widget_class->size_allocate = gtk_rotated_bin_size_allocate; widget_class->draw = gtk_rotated_bin_draw; g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET), GTK_TYPE_ROTATED_BIN, g_cclosure_new (G_CALLBACK (gtk_rotated_bin_damage), NULL, NULL)); container_class->add = gtk_rotated_bin_add; container_class->remove = gtk_rotated_bin_remove; container_class->forall = gtk_rotated_bin_forall; container_class->child_type = gtk_rotated_bin_child_type; } static void gtk_rotated_bin_init (GtkRotatedBin *bin) { gtk_widget_set_has_window (GTK_WIDGET (bin), TRUE); } GtkWidget * gtk_rotated_bin_new (void) { return g_object_new (GTK_TYPE_ROTATED_BIN, NULL); } static GdkWindow * pick_offscreen_child (GdkWindow *offscreen_window, double widget_x, double widget_y, GtkRotatedBin *bin) { GtkAllocation child_area; double x, y; if (bin->child && gtk_widget_get_visible (bin->child)) { to_child (bin, widget_x, widget_y, &x, &y); gtk_widget_get_allocation (bin->child, &child_area); if (x >= 0 && x < child_area.width && y >= 0 && y < child_area.height) return bin->offscreen_window; } return NULL; } static void offscreen_window_to_parent (GdkWindow *offscreen_window, double offscreen_x, double offscreen_y, double *parent_x, double *parent_y, GtkRotatedBin *bin) { to_parent (bin, offscreen_x, offscreen_y, parent_x, parent_y); } static void offscreen_window_from_parent (GdkWindow *window, double parent_x, double parent_y, double *offscreen_x, double *offscreen_y, GtkRotatedBin *bin) { to_child (bin, parent_x, parent_y, offscreen_x, offscreen_y); } static void gtk_rotated_bin_realize (GtkWidget *widget) { GtkRotatedBin *bin = GTK_ROTATED_BIN (widget); GtkAllocation allocation; GtkStyleContext *context; GdkWindow *window; GdkWindowAttr attributes; gint attributes_mask; guint border_width; GtkRequisition child_requisition; gtk_widget_set_realized (widget, TRUE); gtk_widget_get_allocation (widget, &allocation); border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); attributes.x = allocation.x + border_width; attributes.y = allocation.y + border_width; attributes.width = allocation.width - 2 * border_width; attributes.height = allocation.height - 2 * border_width; attributes.window_type = GDK_WINDOW_CHILD; attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_SCROLL_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK; attributes.visual = gtk_widget_get_visual (widget); attributes.wclass = GDK_INPUT_OUTPUT; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); gtk_widget_set_window (widget, window); gdk_window_set_user_data (window, widget); g_signal_connect (window, "pick-embedded-child", G_CALLBACK (pick_offscreen_child), bin); attributes.window_type = GDK_WINDOW_OFFSCREEN; child_requisition.width = child_requisition.height = 0; if (bin->child && gtk_widget_get_visible (bin->child)) { GtkAllocation child_allocation; gtk_widget_get_allocation (bin->child, &child_allocation); attributes.width = child_allocation.width; attributes.height = child_allocation.height; } bin->offscreen_window = gdk_window_new (gdk_screen_get_root_window (gtk_widget_get_screen (widget)), &attributes, attributes_mask); gdk_window_set_user_data (bin->offscreen_window, widget); if (bin->child) gtk_widget_set_parent_window (bin->child, bin->offscreen_window); gdk_offscreen_window_set_embedder (bin->offscreen_window, window); g_signal_connect (bin->offscreen_window, "to-embedder", G_CALLBACK (offscreen_window_to_parent), bin); g_signal_connect (bin->offscreen_window, "from-embedder", G_CALLBACK (offscreen_window_from_parent), bin); context = gtk_widget_get_style_context (widget); gtk_style_context_set_background (context, window); gtk_style_context_set_background (context, bin->offscreen_window); gdk_window_show (bin->offscreen_window); } static void gtk_rotated_bin_unrealize (GtkWidget *widget) { GtkRotatedBin *bin = GTK_ROTATED_BIN (widget); gdk_window_set_user_data (bin->offscreen_window, NULL); gdk_window_destroy (bin->offscreen_window); bin->offscreen_window = NULL; GTK_WIDGET_CLASS (gtk_rotated_bin_parent_class)->unrealize (widget); } static GType gtk_rotated_bin_child_type (GtkContainer *container) { GtkRotatedBin *bin = GTK_ROTATED_BIN (container); if (bin->child) return G_TYPE_NONE; return GTK_TYPE_WIDGET; } static void gtk_rotated_bin_add (GtkContainer *container, GtkWidget *widget) { GtkRotatedBin *bin = GTK_ROTATED_BIN (container); if (!bin->child) { gtk_widget_set_parent_window (widget, bin->offscreen_window); gtk_widget_set_parent (widget, GTK_WIDGET (bin)); bin->child = widget; } else g_warning ("GtkRotatedBin cannot have more than one child\n"); } static void gtk_rotated_bin_remove (GtkContainer *container, GtkWidget *widget) { GtkRotatedBin *bin = GTK_ROTATED_BIN (container); gboolean was_visible; was_visible = gtk_widget_get_visible (widget); if (bin->child == widget) { gtk_widget_unparent (widget); bin->child = NULL; if (was_visible && gtk_widget_get_visible (GTK_WIDGET (container))) gtk_widget_queue_resize (GTK_WIDGET (container)); } } static void gtk_rotated_bin_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data) { GtkRotatedBin *bin = GTK_ROTATED_BIN (container); g_return_if_fail (callback != NULL); if (bin->child) (*callback) (bin->child, callback_data); } void gtk_rotated_bin_set_angle (GtkRotatedBin *bin, gdouble angle) { g_return_if_fail (GTK_IS_ROTATED_BIN (bin)); bin->angle = angle; gtk_widget_queue_resize (GTK_WIDGET (bin)); gdk_window_geometry_changed (bin->offscreen_window); } static void gtk_rotated_bin_size_request (GtkWidget *widget, GtkRequisition *requisition) { GtkRotatedBin *bin = GTK_ROTATED_BIN (widget); GtkRequisition child_requisition; double s, c; double w, h; guint border_width; child_requisition.width = 0; child_requisition.height = 0; if (bin->child && gtk_widget_get_visible (bin->child)) gtk_widget_get_preferred_size ( (bin->child), &child_requisition, NULL); s = sin (bin->angle); c = cos (bin->angle); w = c * child_requisition.width + s * child_requisition.height; h = s * child_requisition.width + c * child_requisition.height; border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); requisition->width = border_width * 2 + w; requisition->height = border_width * 2 + h; } static void gtk_rotated_bin_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) { GtkRequisition requisition; gtk_rotated_bin_size_request (widget, &requisition); *minimum = *natural = requisition.width; } static void gtk_rotated_bin_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) { GtkRequisition requisition; gtk_rotated_bin_size_request (widget, &requisition); *minimum = *natural = requisition.height; } static void gtk_rotated_bin_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkRotatedBin *bin = GTK_ROTATED_BIN (widget); guint border_width; gint w, h; gdouble s, c; gtk_widget_set_allocation (widget, allocation); border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); w = allocation->width - border_width * 2; h = allocation->height - border_width * 2; if (gtk_widget_get_realized (widget)) gdk_window_move_resize (gtk_widget_get_window (widget), allocation->x + border_width, allocation->y + border_width, w, h); if (bin->child && gtk_widget_get_visible (bin->child)) { GtkRequisition child_requisition; GtkAllocation child_allocation; s = sin (bin->angle); c = cos (bin->angle); gtk_widget_get_preferred_size (bin->child, &child_requisition, NULL); child_allocation.x = 0; child_allocation.y = 0; child_allocation.height = child_requisition.height; if (c == 0.0) child_allocation.width = h / s; else if (s == 0.0) child_allocation.width = w / c; else child_allocation.width = MIN ((w - s * child_allocation.height) / c, (h - c * child_allocation.height) / s); if (gtk_widget_get_realized (widget)) gdk_window_move_resize (bin->offscreen_window, child_allocation.x, child_allocation.y, child_allocation.width, child_allocation.height); child_allocation.x = child_allocation.y = 0; gtk_widget_size_allocate (bin->child, &child_allocation); } } static gboolean gtk_rotated_bin_damage (GtkWidget *widget, GdkEventExpose *event) { gdk_window_invalidate_rect (gtk_widget_get_window (widget), NULL, FALSE); return TRUE; } static gboolean gtk_rotated_bin_draw (GtkWidget *widget, cairo_t *cr) { GtkRotatedBin *bin = GTK_ROTATED_BIN (widget); GdkWindow *window; gdouble s, c; gdouble w, h; window = gtk_widget_get_window (widget); if (gtk_cairo_should_draw_window (cr, window)) { cairo_surface_t *surface; GtkAllocation child_area; if (bin->child && gtk_widget_get_visible (bin->child)) { surface = gdk_offscreen_window_get_surface (bin->offscreen_window); gtk_widget_get_allocation (bin->child, &child_area); /* transform */ s = sin (bin->angle); c = cos (bin->angle); w = c * child_area.width + s * child_area.height; h = s * child_area.width + c * child_area.height; cairo_translate (cr, (w - child_area.width) / 2, (h - child_area.height) / 2); cairo_translate (cr, child_area.width / 2, child_area.height / 2); cairo_rotate (cr, bin->angle); cairo_translate (cr, -child_area.width / 2, -child_area.height / 2); /* clip */ cairo_rectangle (cr, 0, 0, gdk_window_get_width (bin->offscreen_window), gdk_window_get_height (bin->offscreen_window)); cairo_clip (cr); /* paint */ cairo_set_source_surface (cr, surface, 0, 0); cairo_paint (cr); } } if (gtk_cairo_should_draw_window (cr, bin->offscreen_window)) { gtk_render_background (gtk_widget_get_style_context (widget), cr, 0, 0, gdk_window_get_width (bin->offscreen_window), gdk_window_get_height (bin->offscreen_window)); if (bin->child) gtk_container_propagate_draw (GTK_CONTAINER (widget), bin->child, cr); } return FALSE; } /*** ***/ static void scale_changed (GtkRange *range, GtkRotatedBin *bin) { gtk_rotated_bin_set_angle (bin, gtk_range_get_value (range)); } static GtkWidget *window = NULL; GtkWidget * do_offscreen_window (GtkWidget *do_widget) { if (!window) { GtkWidget *bin, *vbox, *scale, *button; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Rotated widget"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_container_set_border_width (GTK_CONTAINER (window), 10); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, G_PI/2, 0.01); gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE); button = gtk_button_new_with_label ("A Button"); bin = gtk_rotated_bin_new (); g_signal_connect (scale, "value-changed", G_CALLBACK (scale_changed), bin); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), bin, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER (bin), button); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)flowbox.c3/* Flow Box * * GtkFlowBox allows flexible and responsive grids which reflow * as needed and support sorting and filtering. * * The children of a GtkFlowBox are regular widgets */ #include #include #include static GtkWidget *window = NULL; static gboolean draw_color (GtkWidget *drawingarea, cairo_t *cr, const char *color_name) { GdkRGBA rgba; if (gdk_rgba_parse (&rgba, color_name)) { gdk_cairo_set_source_rgba (cr, &rgba); cairo_paint (cr); } return FALSE; } static GtkWidget * color_swatch_new (const gchar *color) { GtkWidget *button, *area; button = gtk_button_new (); area = gtk_drawing_area_new (); g_signal_connect (area, "draw", G_CALLBACK (draw_color), (gpointer) color); gtk_widget_set_size_request (area, 24, 24); gtk_container_add (GTK_CONTAINER (button), area); gtk_widget_show_all (button); return button; } GtkWidget * do_flowbox (GtkWidget *do_widget) { GtkWidget *scrolled, *flowbox; const gchar *colors[] = { "AliceBlue", "AntiqueWhite", "AntiqueWhite1", "AntiqueWhite2", "AntiqueWhite3", "AntiqueWhite4", "aqua", "aquamarine", "aquamarine1", "aquamarine2", "aquamarine3", "aquamarine4", "azure", "azure1", "azure2", "azure3", "azure4", "beige", "bisque", "bisque1", "bisque2", "bisque3", "bisque4", "black", "BlanchedAlmond", "blue", "blue1", "blue2", "blue3", "blue4", "BlueViolet", "brown", "brown1", "brown2", "brown3", "brown4", "burlywood", "burlywood1", "burlywood2", "burlywood3", "burlywood4", "CadetBlue", "CadetBlue1", "CadetBlue2", "CadetBlue3", "CadetBlue4", "chartreuse", "chartreuse1", "chartreuse2", "chartreuse3", "chartreuse4", "chocolate", "chocolate1", "chocolate2", "chocolate3", "chocolate4", "coral", "coral1", "coral2", "coral3", "coral4", "CornflowerBlue", "cornsilk", "cornsilk1", "cornsilk2", "cornsilk3", "cornsilk4", "crimson", "cyan", "cyan1", "cyan2", "cyan3", "cyan4", "DarkBlue", "DarkCyan", "DarkGoldenrod", "DarkGoldenrod1", "DarkGoldenrod2", "DarkGoldenrod3", "DarkGoldenrod4", "DarkGray", "DarkGreen", "DarkGrey", "DarkKhaki", "DarkMagenta", "DarkOliveGreen", "DarkOliveGreen1", "DarkOliveGreen2", "DarkOliveGreen3", "DarkOliveGreen4", "DarkOrange", "DarkOrange1", "DarkOrange2", "DarkOrange3", "DarkOrange4", "DarkOrchid", "DarkOrchid1", "DarkOrchid2", "DarkOrchid3", "DarkOrchid4", "DarkRed", "DarkSalmon", "DarkSeaGreen", "DarkSeaGreen1", "DarkSeaGreen2", "DarkSeaGreen3", "DarkSeaGreen4", "DarkSlateBlue", "DarkSlateGray", "DarkSlateGray1", "DarkSlateGray2", "DarkSlateGray3", "DarkSlateGray4", "DarkSlateGrey", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepPink1", "DeepPink2", "DeepPink3", "DeepPink4", "DeepSkyBlue", "DeepSkyBlue1", "DeepSkyBlue2", "DeepSkyBlue3", "DeepSkyBlue4", "DimGray", "DimGrey", "DodgerBlue", "DodgerBlue1", "DodgerBlue2", "DodgerBlue3", "DodgerBlue4", "firebrick", "firebrick1", "firebrick2", "firebrick3", "firebrick4", "FloralWhite", "ForestGreen", "fuchsia", "gainsboro", "GhostWhite", "gold", "gold1", "gold2", "gold3", "gold4", "goldenrod", "goldenrod1", "goldenrod2", "goldenrod3", "goldenrod4", "gray", "gray0", "gray1", "gray10", "gray100", "gray11", "gray12", "gray13", "gray14", "gray15", "gray16", "gray17", "gray18", "gray19", "gray2", "gray20", "gray21", "gray22", "gray23", "gray24", "gray25", "gray26", "gray27", "gray28", "gray29", "gray3", "gray30", "gray31", "gray32", "gray33", "gray34", "gray35", "gray36", "gray37", "gray38", "gray39", "gray4", "gray40", "gray41", "gray42", "gray43", "gray44", "gray45", "gray46", "gray47", "gray48", "gray49", "gray5", "gray50", "gray51", "gray52", "gray53", "gray54", "gray55", "gray56", "gray57", "gray58", "gray59", "gray6", "gray60", "gray61", "gray62", "gray63", "gray64", "gray65", "gray66", "gray67", "gray68", "gray69", "gray7", "gray70", "gray71", "gray72", "gray73", "gray74", "gray75", "gray76", "gray77", "gray78", "gray79", "gray8", "gray80", "gray81", "gray82", "gray83", "gray84", "gray85", "gray86", "gray87", "gray88", "gray89", "gray9", "gray90", "gray91", "gray92", "gray93", "gray94", "gray95", "gray96", "gray97", "gray98", "gray99", "green", "green1", "green2", "green3", "green4", "GreenYellow", "grey", "grey0", "grey1", "grey10", "grey100", "grey11", "grey12", "grey13", "grey14", "grey15", "grey16", "grey17", "grey18", "grey19", "grey2", "grey20", "grey21", "grey22", "grey23", "grey24", "grey25", "grey26", "grey27", "grey28", "grey29", "grey3", "grey30", "grey31", "grey32", "grey33", "grey34", "grey35", "grey36", "grey37", "grey38", "grey39", "grey4", "grey40", "grey41", "grey42", "grey43", "grey44", "grey45", "grey46", "grey47", "grey48", "grey49", "grey5", "grey50", "grey51", "grey52", "grey53", "grey54", "grey55", "grey56", "grey57", "grey58", "grey59", "grey6", "grey60", "grey61", "grey62", "grey63", "grey64", "grey65", "grey66", "grey67", "grey68", "grey69", "grey7", "grey70", "grey71", "grey72", "grey73", "grey74", "grey75", "grey76", "grey77", "grey78", "grey79", "grey8", "grey80", "grey81", "grey82", "grey83", "grey84", "grey85", "grey86", "grey87", "grey88", "grey89", "grey9", "grey90", "grey91", "grey92", "grey93", "grey94", "grey95", "grey96", "grey97", "grey98", "grey99", "honeydew", "honeydew1", "honeydew2", "honeydew3", "honeydew4", "HotPink", "HotPink1", "HotPink2", "HotPink3", "HotPink4", "IndianRed", "IndianRed1", "IndianRed2", "IndianRed3", "IndianRed4", "indigo", "ivory", "ivory1", "ivory2", "ivory3", "ivory4", "khaki", "khaki1", "khaki2", "khaki3", "khaki4", "lavender", "LavenderBlush", "LavenderBlush1", "LavenderBlush2", "LavenderBlush3", "LavenderBlush4", "LawnGreen", "LemonChiffon", "LemonChiffon1", "LemonChiffon2", "LemonChiffon3", "LemonChiffon4", "LightBlue", "LightBlue1", "LightBlue2", "LightBlue3", "LightBlue4", "LightCoral", "LightCyan", "LightCyan1", "LightCyan2", "LightCyan3", "LightCyan4", "LightGoldenrod", "LightGoldenrod1", "LightGoldenrod2", "LightGoldenrod3", "LightGoldenrod4", "LightGoldenrodYellow", "LightGray", "LightGreen", "LightGrey", "LightPink", "LightPink1", "LightPink2", "LightPink3", "LightPink4", "LightSalmon", "LightSalmon1", "LightSalmon2", "LightSalmon3", "LightSalmon4", "LightSeaGreen", "LightSkyBlue", "LightSkyBlue1", "LightSkyBlue2", "LightSkyBlue3", "LightSkyBlue4", "LightSlateBlue", "LightSlateGray", "LightSlateGrey", "LightSteelBlue", "LightSteelBlue1", "LightSteelBlue2", "LightSteelBlue3", "LightSteelBlue4", "LightYellow", "LightYellow1", "LightYellow2", "LightYellow3", "LightYellow4", "lime", "LimeGreen", "linen", "magenta", "magenta1", "magenta2", "magenta3", "magenta4", "maroon", "maroon1", "maroon2", "maroon3", "maroon4", "MediumAquamarine", "MediumBlue", "MediumOrchid", "MediumOrchid1", "MediumOrchid2", "MediumOrchid3", "MediumOrchid4", "MediumPurple", "MediumPurple1", "MediumPurple2", "MediumPurple3", "MediumPurple4", "MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise", "MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "MistyRose1", "MistyRose2", "MistyRose3", "MistyRose4", "moccasin", "NavajoWhite", "NavajoWhite1", "NavajoWhite2", "NavajoWhite3", "NavajoWhite4", "navy", "NavyBlue", "OldLace", "olive", "OliveDrab", "OliveDrab1", "OliveDrab2", "OliveDrab3", "OliveDrab4", "orange", "orange1", "orange2", "orange3", "orange4", "OrangeRed", "OrangeRed1", "OrangeRed2", "OrangeRed3", "OrangeRed4", "orchid", "orchid1", "orchid2", "orchid3", "orchid4", "PaleGoldenrod", "PaleGreen", "PaleGreen1", "PaleGreen2", "PaleGreen3", "PaleGreen4", "PaleTurquoise", "PaleTurquoise1", "PaleTurquoise2", "PaleTurquoise3", "PaleTurquoise4", "PaleVioletRed", "PaleVioletRed1", "PaleVioletRed2", "PaleVioletRed3", "PaleVioletRed4", "PapayaWhip", "PeachPuff", "PeachPuff1", "PeachPuff2", "PeachPuff3", "PeachPuff4", "peru", "pink", "pink1", "pink2", "pink3", "pink4", "plum", "plum1", "plum2", "plum3", "plum4", "PowderBlue", "purple", "purple1", "purple2", "purple3", "purple4", "red", "red1", "red2", "red3", "red4", "RosyBrown", "RosyBrown1", "RosyBrown2", "RosyBrown3", "RosyBrown4", "RoyalBlue", "RoyalBlue1", "RoyalBlue2", "RoyalBlue3", "RoyalBlue4", "SaddleBrown", "salmon", "salmon1", "salmon2", "salmon3", "salmon4", "SandyBrown", "SeaGreen", "SeaGreen1", "SeaGreen2", "SeaGreen3", "SeaGreen4", "seashell", "seashell1", "seashell2", "seashell3", "seashell4", "sienna", "sienna1", "sienna2", "sienna3", "sienna4", "silver", "SkyBlue", "SkyBlue1", "SkyBlue2", "SkyBlue3", "SkyBlue4", "SlateBlue", "SlateBlue1", "SlateBlue2", "SlateBlue3", "SlateBlue4", "SlateGray", "SlateGray1", "SlateGray2", "SlateGray3", "SlateGray4", "SlateGrey", "snow", "snow1", "snow2", "snow3", "snow4", "SpringGreen", "SpringGreen1", "SpringGreen2", "SpringGreen3", "SpringGreen4", "SteelBlue", "SteelBlue1", "SteelBlue2", "SteelBlue3", "SteelBlue4", "tan", "tan1", "tan2", "tan3", "tan4", "teal", "thistle", "thistle1", "thistle2", "thistle3", "thistle4", "tomato", "tomato1", "tomato2", "tomato3", "tomato4", "turquoise", "turquoise1", "turquoise2", "turquoise3", "turquoise4", "violet", "VioletRed", "VioletRed1", "VioletRed2", "VioletRed3", "VioletRed4", "wheat", "wheat1", "wheat2", "wheat3", "wheat4", "white", "WhiteSmoke", "yellow", "yellow1", "yellow2", "yellow3", "yellow4", "YellowGreen", NULL }; gint i; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Flow Box"); gtk_window_set_default_size (GTK_WINDOW (window), 400, 600); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); scrolled = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); flowbox = gtk_flow_box_new (); gtk_widget_set_valign (flowbox, GTK_ALIGN_START); gtk_flow_box_set_max_children_per_line (GTK_FLOW_BOX (flowbox), 30); gtk_flow_box_set_selection_mode (GTK_FLOW_BOX (flowbox), GTK_SELECTION_NONE); gtk_container_add (GTK_CONTAINER (scrolled), flowbox); gtk_container_add (GTK_CONTAINER (window), scrolled); for (i = 0; colors[i]; i++) { gtk_container_add (GTK_CONTAINER (flowbox), color_swatch_new (colors[i])); } gtk_widget_show_all (scrolled); } if (!gtk_widget_get_visible (window)) gtk_widget_show (window); else gtk_widget_destroy (window); return window; } (uuay)gnome-gimp.pngR PNG  IHDR00WgAMA1_ IDATxYk]u>{9w޶gllc#ǯ_Qܹu7up,+ k, !]?w @u ܴry=>ّ/$~IDhxm~Gȱ=fR.w'{ˡC"_"#acv*KDv ܂VK6Wztl0[; . 9<ckGn΍lR;y介~ &/xԙ ~w:$\":An(EFW~#AcR)ĭ4\OKs{&R@*=tӪW|B$BDp-xgp7zK~RH ѢrW\OBy񟟞Ǔ4++ݟ~xWQ,Z`olRZ2-v hJC g@ 0`O\!8 3v3X 0zE_s]^fvy\o<ЦMz^0o-[~ c8ȤDIdR!,j9ic_[6#)fݼaÆm޼!!Dqbb?=ȶKF|/b``{ޏ5kǐJǖ-[ƪP*VR1Z[Jz3WpdTMdldS*wx===m۶GǽfIo&q<?ժxWh~~vi^{m?8رcꫯBJVR R*( h֒Ʊ='20I.gN;HCyQyBvr''=Z vڅF3'`Fm<3={e&$A;IIJ({f0$GV (mb 0V:@rhrrB,_ѣGP,šs@>q߃a֭\SOhnRf}uՙ0l#٩T*-uM08O*ܝ=== fFehZ(J(9ϝ93'0n~i(RJT 8{}Π^  &VfX &fgseג3|߇Ð(Bp hPڇo}+ex~ԅSHJkZm IښU@BfÜ_Lkqaya!mU'mhـ=`6`f,? Vl$j ApY)rԇs1ro}c}ɞi4˲waE{{zz0 Q.GbCZITPy>=erJkLL]TIq3|fnqTux+ֺZT (ðJa I\CYV AAlIHc뚶p2z y5@4<5}nב˦pM?qx^R{dyZIΜG&SHrk@+ĄnNF sqnb}3VZZkRv;[P!`if[`f9;;{xHISiFJ* CiTJ0;W<.^Z@d-(B/Stz@n/5̘jg<9덎]` ۼqL |,H6ՆBT,T*7BO="Sgr0}SK0H3zjSU^uWu~NLW̧0iORIENDB`(uuay)stack.ui False GtkStack True False True stack center 0 0 1 1 True True crossfade True False 20 20 gtk3-demo page1 Page 1 Page 2 True True False 0 True center center page2 Page 2 True False center center True page3 face-laugh-symbolic 0 1 1 1 (uuay)css_accordion.c /* CSS Theming/CSS Accordion * * A simple accordion demo written using CSS transitions and multiple backgrounds * */ #include static GtkWidget *window = NULL; static void apply_css (GtkWidget *widget, GtkStyleProvider *provider) { gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT); if (GTK_IS_CONTAINER (widget)) gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider); } GtkWidget * do_css_accordion (GtkWidget *do_widget) { if (!window) { GtkWidget *container, *child; GtkStyleProvider *provider; GBytes *bytes; gsize data_size; const guint8 *data; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget)); gtk_window_set_default_size (GTK_WINDOW (window), 600, 300); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_widget_set_halign (container, GTK_ALIGN_CENTER); gtk_widget_set_valign (container, GTK_ALIGN_CENTER); gtk_container_add (GTK_CONTAINER (window), container); child = gtk_button_new_with_label ("This"); gtk_container_add (GTK_CONTAINER (container), child); child = gtk_button_new_with_label ("Is"); gtk_container_add (GTK_CONTAINER (container), child); child = gtk_button_new_with_label ("A"); gtk_container_add (GTK_CONTAINER (container), child); child = gtk_button_new_with_label ("CSS"); gtk_container_add (GTK_CONTAINER (container), child); child = gtk_button_new_with_label ("Accordion"); gtk_container_add (GTK_CONTAINER (container), child); child = gtk_button_new_with_label (":-)"); gtk_container_add (GTK_CONTAINER (container), child); provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ()); bytes = g_resources_lookup_data ("/css_accordion/css_accordion.css", 0, NULL); data = g_bytes_get_data (bytes, &data_size); gtk_css_provider_load_from_data (GTK_CSS_PROVIDER (provider), (gchar *)data, data_size, NULL); g_bytes_unref (bytes); apply_css (window, provider); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)hypertext.c$/* Text Widget/Hypertext * * Usually, tags modify the appearance of text in the view, e.g. making it * bold or colored or underlined. But tags are not restricted to appearance. * They can also affect the behavior of mouse and key presses, as this demo * shows. */ #include #include /* Inserts a piece of text into the buffer, giving it the usual * appearance of a hyperlink in a web browser: blue and underlined. * Additionally, attaches some data on the tag, to make it recognizable * as a link. */ static void insert_link (GtkTextBuffer *buffer, GtkTextIter *iter, gchar *text, gint page) { GtkTextTag *tag; tag = gtk_text_buffer_create_tag (buffer, NULL, "foreground", "blue", "underline", PANGO_UNDERLINE_SINGLE, NULL); g_object_set_data (G_OBJECT (tag), "page", GINT_TO_POINTER (page)); gtk_text_buffer_insert_with_tags (buffer, iter, text, -1, tag, NULL); } /* Fills the buffer with text and interspersed links. In any real * hypertext app, this method would parse a file to identify the links. */ static void show_page (GtkTextBuffer *buffer, gint page) { GtkTextIter iter; gtk_text_buffer_set_text (buffer, "", 0); gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0); if (page == 1) { gtk_text_buffer_insert (buffer, &iter, "Some text to show that simple ", -1); insert_link (buffer, &iter, "hypertext", 3); gtk_text_buffer_insert (buffer, &iter, " can easily be realized with ", -1); insert_link (buffer, &iter, "tags", 2); gtk_text_buffer_insert (buffer, &iter, ".", -1); } else if (page == 2) { gtk_text_buffer_insert (buffer, &iter, "A tag is an attribute that can be applied to some range of text. " "For example, a tag might be called \"bold\" and make the text inside " "the tag bold. However, the tag concept is more general than that; " "tags don't have to affect appearance. They can instead affect the " "behavior of mouse and key presses, \"lock\" a range of text so the " "user can't edit it, or countless other things.\n", -1); insert_link (buffer, &iter, "Go back", 1); } else if (page == 3) { GtkTextTag *tag; tag = gtk_text_buffer_create_tag (buffer, NULL, "weight", PANGO_WEIGHT_BOLD, NULL); gtk_text_buffer_insert_with_tags (buffer, &iter, "hypertext:\n", -1, tag, NULL); gtk_text_buffer_insert (buffer, &iter, "machine-readable text that is not sequential but is organized " "so that related items of information are connected.\n", -1); insert_link (buffer, &iter, "Go back", 1); } } /* Looks at all tags covering the position of iter in the text view, * and if one of them is a link, follow it by showing the page identified * by the data attached to it. */ static void follow_if_link (GtkWidget *text_view, GtkTextIter *iter) { GSList *tags = NULL, *tagp = NULL; tags = gtk_text_iter_get_tags (iter); for (tagp = tags; tagp != NULL; tagp = tagp->next) { GtkTextTag *tag = tagp->data; gint page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page")); if (page != 0) { show_page (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)), page); break; } } if (tags) g_slist_free (tags); } /* Links can be activated by pressing Enter. */ static gboolean key_press_event (GtkWidget *text_view, GdkEventKey *event) { GtkTextIter iter; GtkTextBuffer *buffer; switch (event->keyval) { case GDK_KEY_Return: case GDK_KEY_KP_Enter: buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); gtk_text_buffer_get_iter_at_mark (buffer, &iter, gtk_text_buffer_get_insert (buffer)); follow_if_link (text_view, &iter); break; default: break; } return FALSE; } /* Links can also be activated by clicking or tapping. */ static gboolean event_after (GtkWidget *text_view, GdkEvent *ev) { GtkTextIter start, end, iter; GtkTextBuffer *buffer; gdouble ex, ey; gint x, y; if (ev->type == GDK_BUTTON_RELEASE) { GdkEventButton *event; event = (GdkEventButton *)ev; if (event->button != GDK_BUTTON_PRIMARY) return FALSE; ex = event->x; ey = event->y; } else if (ev->type == GDK_TOUCH_END) { GdkEventTouch *event; event = (GdkEventTouch *)ev; ex = event->x; ey = event->y; } else return FALSE; buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); /* we shouldn't follow a link if the user has selected something */ gtk_text_buffer_get_selection_bounds (buffer, &start, &end); if (gtk_text_iter_get_offset (&start) != gtk_text_iter_get_offset (&end)) return FALSE; gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view), GTK_TEXT_WINDOW_WIDGET, ex, ey, &x, &y); gtk_text_view_get_iter_at_location (GTK_TEXT_VIEW (text_view), &iter, x, y); follow_if_link (text_view, &iter); return TRUE; } static gboolean hovering_over_link = FALSE; static GdkCursor *hand_cursor = NULL; static GdkCursor *regular_cursor = NULL; /* Looks at all tags covering the position (x, y) in the text view, * and if one of them is a link, change the cursor to the "hands" cursor * typically used by web browsers. */ static void set_cursor_if_appropriate (GtkTextView *text_view, gint x, gint y) { GSList *tags = NULL, *tagp = NULL; GtkTextIter iter; gboolean hovering = FALSE; gtk_text_view_get_iter_at_location (text_view, &iter, x, y); tags = gtk_text_iter_get_tags (&iter); for (tagp = tags; tagp != NULL; tagp = tagp->next) { GtkTextTag *tag = tagp->data; gint page = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (tag), "page")); if (page != 0) { hovering = TRUE; break; } } if (hovering != hovering_over_link) { hovering_over_link = hovering; if (hovering_over_link) gdk_window_set_cursor (gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT), hand_cursor); else gdk_window_set_cursor (gtk_text_view_get_window (text_view, GTK_TEXT_WINDOW_TEXT), regular_cursor); } if (tags) g_slist_free (tags); } /* Update the cursor image if the pointer moved. */ static gboolean motion_notify_event (GtkWidget *text_view, GdkEventMotion *event) { gint x, y; gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (text_view), GTK_TEXT_WINDOW_WIDGET, event->x, event->y, &x, &y); set_cursor_if_appropriate (GTK_TEXT_VIEW (text_view), x, y); return FALSE; } GtkWidget * do_hypertext (GtkWidget *do_widget) { static GtkWidget *window = NULL; if (!window) { GtkWidget *view; GtkWidget *sw; GtkTextBuffer *buffer; hand_cursor = gdk_cursor_new_for_display (gtk_widget_get_display (do_widget), GDK_HAND2); regular_cursor = gdk_cursor_new_for_display (gtk_widget_get_display (do_widget), GDK_XTERM); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_default_size (GTK_WINDOW (window), 450, 450); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_window_set_title (GTK_WINDOW (window), "Hypertext"); gtk_container_set_border_width (GTK_CONTAINER (window), 0); view = gtk_text_view_new (); gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD); g_signal_connect (view, "key-press-event", G_CALLBACK (key_press_event), NULL); g_signal_connect (view, "event-after", G_CALLBACK (event_after), NULL); g_signal_connect (view, "motion-notify-event", G_CALLBACK (motion_notify_event), NULL); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (window), sw); gtk_container_add (GTK_CONTAINER (sw), view); show_page (buffer, 1); gtk_widget_show_all (sw); } if (!gtk_widget_get_visible (window)) { gtk_widget_show (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)css_basics/. css_pixbufs/avg5}0y6gnome-foot.pngd PNG  IHDR/0#gAMA1_ IDATxYkly=wfvvfܗ)QŪl#HqdmT i4N A(n ] l<8v*#%RDY$MJ>?2T ,T\0s _e/ׇ o>Н:qj^ڷo߉mXpd WMjo1W[?kll,cСT*5:6M$eW2ob x3}3}xgPUjI3&c+wM& rտ%v{v$+Q):ښNƘUOdΑ/R7ODzHKR"xDb!zKAHiY0 RedLU(fyQݵr]] Cj6ѪU!J-a>奂Jz|q 琈E0ym{A=J|7xx#luS6}Wz6#gޘ%r[%-Mi|Zov,e |YQp"z}_wԪ_hUvyc ѦY|)B&_; qիtMb\^cϏ& G}F+8nu;hdhp6Zbew7%5 3 3j`*-nxw-8ph$Rwmcg.#\ٚmd몂g Kdj,J(*}k_z~'H^sk#-dz7vq5_VONKF8%5*'Qc]Xioiٟĥûo岹#vDP0Ƕ`YoozVYT?/l$,D!M%c-V0̟lV+T%drL\0y?mlВ'FGL%4D2IEM MF>Oy3׳ݽ}X|wo_o,l biuS/#[(=948Ǡ`zz{a[aYGPIg,# Hu^-Cm]X_;+{>VWU mX0, ϣ4C<ЪW`Y"Fni|e̤Pk $>\|r=N"6  CJYǒb!ǶZ@MC#\V˫V)c=vjn̻ [5 VIa[xAqD1׶ XYZd2gr[AWfD/Wk3GiZeyx'eBD1D8%kkeL%OO<^-Fޜ$ 1-;єdhF$EmS'eQ]Ӊm0M,g2x8v,~7|/jf0ֽ%ю^0l8$-I (J=j;.XaZbMo;MC| -Q8<<  static GtkBuilder *builder; G_MODULE_EXPORT void quit_activate (GtkAction *action) { GtkWidget *window; window = GTK_WIDGET (gtk_builder_get_object (builder, "window1")); gtk_widget_destroy (window); } G_MODULE_EXPORT void about_activate (GtkAction *action) { GtkWidget *about_dlg; about_dlg = GTK_WIDGET (gtk_builder_get_object (builder, "aboutdialog1")); gtk_dialog_run (GTK_DIALOG (about_dlg)); gtk_widget_hide (about_dlg); } G_MODULE_EXPORT void help_activate (GtkAction *action) { g_print ("Help not available\n"); } GtkWidget * do_builder (GtkWidget *do_widget) { static GtkWidget *window = NULL; GError *err = NULL; GtkWidget *toolbar; if (!window) { builder = gtk_builder_new (); gtk_builder_add_from_resource (builder, "/builder/demo.ui", &err); if (err) { g_error ("ERROR: %s\n", err->message); return NULL; } gtk_builder_connect_signals (builder, NULL); window = GTK_WIDGET (gtk_builder_get_object (builder, "window1")); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); toolbar = GTK_WIDGET (gtk_builder_get_object (builder, "toolbar1")); gtk_style_context_add_class (gtk_widget_get_style_context (toolbar), "primary-toolbar"); } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)revealer.ui_& False 5 dialog 300 300 Revealer False vertical 2 False end _Close True True True True False True 1 False True end 0 True False center center True 2000 crossfade True face-cool-symbolic 6 2 2 True 2000 slide-up True face-cool-symbolic 6 2 1 True 2000 slide-right True face-cool-symbolic 6 3 2 True 2000 slide-down True face-cool-symbolic 6 2 3 True 2000 slide-left True face-cool-symbolic 6 1 2 True 2000 slide-up True face-cool-symbolic 6 2 0 True 2000 slide-right True face-cool-symbolic 6 4 2 True 2000 slide-down True face-cool-symbolic 6 2 4 True 2000 slide-left True face-cool-symbolic 6 0 2 False True 1 button1 (uuay)/A K_L|jw{- sN9brick2.png)PNG  IHDRsBIT|d pHYs>>"tEXtSoftwarewww.inkscape.org< IDATxySk Z)(Id[![,hE[dkRVWv06<gky?0|>yss^$z&eߏ~}$ifa;K<.3{;1`cࣄ]ƓYnKsιyBAf%M` ^s"{m|X l&Ɋq9'`f?P> t9WҘpC31fv(MܧsιF" _0oG,iV-ؠ;< ݟ;\ʄnf {Fx֒?5yy}s^Lt٥5y%*WHz sHB^X+DHI# ʔkIHNl:s>nf6H8baPj3[0LI"%Y$չA%Ms.Z\kW%*~~nfk$*7sιbjKfv4KFU%EQ+$]t9犩%VuU%#m{B>:wιTyB7O#سuU)~Ul`ıv[9\quw%T"P,yIHAz؍sιAԑSL3OdexH=%]+i$}VsMsJ-BAW+*z9{~+9\yUSPY[l`ı 妃p9>¶&{3; EiAAD8q9n.Y=G ɒ׶랒nm:sN $lk`\##]4Y'錦p9F -{{O~.m#?͝sT=+fI7u$E\?[Rq9N &b&Ŏ S@R[q9H =[=*ׄe%ifd mHIz@sΥWGkcHh%/ E0NJp9׿>g/x ^HC4*`SI7ԿsιԑЯ"]2Q"I;Rޒ\AG lw9džMf6cf2B+Hq[:~/wrXIk%no$[IY?sG fv5a=T3;)Ϗ"b0mp3r=+D3$TjF9\yCB77qxkf6H'n ~zW^p$&Gv+Q6,iip]9z Ӌwnz^ݑYe,swdz41`E UM}zE? $隊w9b& 3KA9tIQx+1WOK^ f(`M_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GsE}T+ =i]+ JIDATʶz2OG8s5`y`Fi2p0pK+ v'ImvzKK5eS U]힧LƙYU+&SuӁ-U;ekpL'&?@jtuk\`EIg[*%/M藑-⏸b)/)}Yf)akwVٚQ Ie# q |PzdRV+Mo\SaWW I$n?&YE%tIӀ?|rPYEF@Ff]TTw#13%ssszPS)}0-y=54eJwKkst `X^7-5 ńu&)Qn*Deޓ})5>LiW消>rW ƲbqcA:mҒ]ff3ͪkd}̖$84["|gVT?4_%me'uJ5?>F`h$9IK,I) ثhCӉG٘lMs.ro[_|1ꊶd<"̝{d =gz`+t,97Uz죠l ߠ¶3Cs:$2I6sYzىKn7c|s΍n',|68RWt4sn( K_`#cix2w97%tI"lXv=g9\2Hz0R?xp'`cIӚ9\`C"4K6KM&Jz@s֎;IL?Xjp 'ssEDB4EҶF<<L+9 )nf6'5 )n`GI5sιԓ }-pZ: 9\>>Bot,<|F҅MsEB`f_~,馃q9*0w}pNHf*]# r9FOBdfK^F6 0'Iz6=s.Qл`EBr_ XXׁtࡎٯ7HY{9~RU7-`IENDB`(uuay)gtk.css/* You can edit the text in this window to change the * appearance of this Window. * Be careful, if you screw it up, nothing might be visible * anymore. :) */ /* This CSS resets all properties to their defaults values * and overrides all user settings and the theme in use */ @import url("resource://css_shadows/reset.css"); @import url("resource://css_shadows/cssview.css"); /* Get a nice background for the window */ .background { background-color: #4870bc; background-image: linear-gradient(to left, transparent, rgba(255,255,255,.07) 50%, transparent 50%), linear-gradient(to left, transparent, rgba(255,255,255,.13) 50%, transparent 50%), linear-gradient(to left, transparent, transparent 50%, rgba(255,255,255,.17) 50%), linear-gradient(to left, transparent, transparent 50%, rgba(255,255,255,.19) 50%); background-size: 29px, 59px, 73px, 109px; } .button { color: black; padding: 10px; border-radius: 5px; transition: all 250ms ease-in; border: 1px transparent solid; } .button:hover { text-shadow: 3px 3px 5px alpha(black, 0.75); icon-shadow: 3px 3px 5px alpha(black, 0.75); box-shadow: 3px 3px 5px alpha(black, 0.5) inset; border: solid 1px alpha(black, 0.75); } .button:active { padding: 11px 9px 9px 11px; text-shadow: 1px 1px 2.5px alpha(black, 0.6); icon-shadow: 1px 1px 2.5px alpha(black, 0.6); } (uuay)application.c1/* Application Class * * Demonstrates a simple application. * * This examples uses GtkApplication, GtkApplicationWindow, GtkBuilder * as well as GMenu and GResource. Due to the way GtkApplication is structured, * it is run as a separate process. */ #include "config.h" #include #ifdef STANDALONE static void show_action_dialog (GSimpleAction *action) { const gchar *name; GtkWidget *dialog; name = g_action_get_name (G_ACTION (action)); dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, "You activated action: \"%s\"", name); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show (dialog); } static void show_action_infobar (GSimpleAction *action, GVariant *parameter, gpointer window) { GtkWidget *infobar; GtkWidget *message; gchar *text; const gchar *name; const gchar *value; name = g_action_get_name (G_ACTION (action)); value = g_variant_get_string (parameter, NULL); message = g_object_get_data (G_OBJECT (window), "message"); infobar = g_object_get_data (G_OBJECT (window), "infobar"); text = g_strdup_printf ("You activated radio action: \"%s\".\n" "Current value: %s", name, value); gtk_label_set_text (GTK_LABEL (message), text); gtk_widget_show (infobar); g_free (text); } static void activate_action (GSimpleAction *action, GVariant *parameter, gpointer user_data) { show_action_dialog (action); } static void activate_toggle (GSimpleAction *action, GVariant *parameter, gpointer user_data) { GVariant *state; show_action_dialog (action); state = g_action_get_state (G_ACTION (action)); g_action_change_state (G_ACTION (action), g_variant_new_boolean (!g_variant_get_boolean (state))); g_variant_unref (state); } static void activate_radio (GSimpleAction *action, GVariant *parameter, gpointer user_data) { show_action_infobar (action, parameter, user_data); g_action_change_state (G_ACTION (action), parameter); } static void activate_about (GSimpleAction *action, GVariant *parameter, gpointer user_data) { GtkWidget *window = user_data; const gchar *authors[] = { "Peter Mattis", "Spencer Kimball", "Josh MacDonald", "and many more...", NULL }; const gchar *documentors[] = { "Owen Taylor", "Tony Gale", "Matthias Clasen ", "and many more...", NULL }; gtk_show_about_dialog (GTK_WINDOW (window), "program-name", "GTK+ Code Demos", "version", g_strdup_printf ("%s,\nRunning against GTK+ %d.%d.%d", PACKAGE_VERSION, gtk_get_major_version (), gtk_get_minor_version (), gtk_get_micro_version ()), "copyright", "(C) 1997-2013 The GTK+ Team", "license-type", GTK_LICENSE_LGPL_2_1, "website", "http://www.gtk.org", "comments", "Program to demonstrate GTK+ functions.", "authors", authors, "documenters", documentors, "logo-icon-name", "gtk3-demo", "title", "About GTK+ Code Demos", NULL); } static void activate_quit (GSimpleAction *action, GVariant *parameter, gpointer user_data) { GtkApplication *app = user_data; GtkWidget *win; GList *list, *next; list = gtk_application_get_windows (app); while (list) { win = list->data; next = list->next; gtk_widget_destroy (GTK_WIDGET (win)); list = next; } } static void update_statusbar (GtkTextBuffer *buffer, GtkStatusbar *statusbar) { gchar *msg; gint row, col; gint count; GtkTextIter iter; /* clear any previous message, underflow is allowed */ gtk_statusbar_pop (statusbar, 0); count = gtk_text_buffer_get_char_count (buffer); gtk_text_buffer_get_iter_at_mark (buffer, &iter, gtk_text_buffer_get_insert (buffer)); row = gtk_text_iter_get_line (&iter); col = gtk_text_iter_get_line_offset (&iter); msg = g_strdup_printf ("Cursor at row %d column %d - %d chars in document", row, col, count); gtk_statusbar_push (statusbar, 0, msg); g_free (msg); } static void mark_set_callback (GtkTextBuffer *buffer, const GtkTextIter *new_location, GtkTextMark *mark, gpointer data) { update_statusbar (buffer, GTK_STATUSBAR (data)); } static void change_theme_state (GSimpleAction *action, GVariant *state, gpointer user_data) { GtkSettings *settings = gtk_settings_get_default (); g_object_set (G_OBJECT (settings), "gtk-application-prefer-dark-theme", g_variant_get_boolean (state), NULL); g_simple_action_set_state (action, state); } static void change_titlebar_state (GSimpleAction *action, GVariant *state, gpointer user_data) { GtkWindow *window = user_data; gtk_window_set_hide_titlebar_when_maximized (GTK_WINDOW (window), g_variant_get_boolean (state)); g_simple_action_set_state (action, state); } static void change_radio_state (GSimpleAction *action, GVariant *state, gpointer user_data) { g_simple_action_set_state (action, state); } static GActionEntry app_entries[] = { { "new", activate_action, NULL, NULL, NULL }, { "open", activate_action, NULL, NULL, NULL }, { "save", activate_action, NULL, NULL, NULL }, { "save-as", activate_action, NULL, NULL, NULL }, { "quit", activate_quit, NULL, NULL, NULL }, { "dark", activate_toggle, NULL, "false", change_theme_state } }; static GActionEntry win_entries[] = { { "titlebar", activate_toggle, NULL, "false", change_titlebar_state }, { "shape", activate_radio, "s", "'oval'", change_radio_state }, { "bold", activate_toggle, NULL, "false", NULL }, { "about", activate_about, NULL, NULL, NULL }, { "file1", activate_action, NULL, NULL, NULL }, { "logo", activate_action, NULL, NULL, NULL } }; static void clicked_cb (GtkWidget *widget, GtkWidget *info) { gtk_widget_hide (info); } static void startup (GApplication *app) { GtkBuilder *builder; GMenuModel *appmenu; GMenuModel *menubar; builder = gtk_builder_new (); gtk_builder_add_from_resource (builder, "/application/menus.ui", NULL); appmenu = (GMenuModel *)gtk_builder_get_object (builder, "appmenu"); menubar = (GMenuModel *)gtk_builder_get_object (builder, "menubar"); gtk_application_set_app_menu (GTK_APPLICATION (app), appmenu); gtk_application_set_menubar (GTK_APPLICATION (app), menubar); g_object_unref (builder); } static void activate (GApplication *app) { GtkBuilder *builder; GtkWidget *window; GtkWidget *grid; GtkWidget *contents; GtkWidget *status; GtkWidget *message; GtkWidget *button; GtkWidget *infobar; GtkWidget *menutool; GMenuModel *toolmenu; GtkTextBuffer *buffer; window = gtk_application_window_new (GTK_APPLICATION (app)); gtk_window_set_title (GTK_WINDOW (window), "Application Class"); gtk_window_set_icon_name (GTK_WINDOW (window), "document-open"); gtk_window_set_default_size (GTK_WINDOW (window), 200, 200); g_action_map_add_action_entries (G_ACTION_MAP (window), win_entries, G_N_ELEMENTS (win_entries), window); builder = gtk_builder_new (); gtk_builder_add_from_resource (builder, "/application/application.ui", NULL); grid = (GtkWidget *)gtk_builder_get_object (builder, "grid"); contents = (GtkWidget *)gtk_builder_get_object (builder, "contents"); status = (GtkWidget *)gtk_builder_get_object (builder, "status"); message = (GtkWidget *)gtk_builder_get_object (builder, "message"); button = (GtkWidget *)gtk_builder_get_object (builder, "button"); infobar = (GtkWidget *)gtk_builder_get_object (builder, "infobar"); menutool = (GtkWidget *)gtk_builder_get_object (builder, "menutool"); toolmenu = (GMenuModel *)gtk_builder_get_object (builder, "toolmenu"); g_object_set_data (G_OBJECT (window), "message", message); g_object_set_data (G_OBJECT (window), "infobar", infobar); gtk_container_add (GTK_CONTAINER (window), grid); gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (menutool), gtk_menu_new_from_model (toolmenu)); gtk_widget_grab_focus (contents); g_signal_connect (button, "clicked", G_CALLBACK (clicked_cb), infobar); /* Show text widget info in the statusbar */ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (contents)); g_signal_connect_object (buffer, "changed", G_CALLBACK (update_statusbar), status, 0); g_signal_connect_object (buffer, "mark-set", G_CALLBACK (mark_set_callback), status, 0); update_statusbar (buffer, GTK_STATUSBAR (status)); gtk_widget_show_all (window); g_object_unref (builder); } int main (int argc, char *argv[]) { GtkApplication *app; GSettings *settings; GAction *action; gtk_init (NULL, NULL); app = gtk_application_new ("org.gtk.Demo2", 0); settings = g_settings_new ("org.gtk.Demo"); g_action_map_add_action_entries (G_ACTION_MAP (app), app_entries, G_N_ELEMENTS (app_entries), app); action = g_settings_create_action (settings, "color"); g_action_map_add_action (G_ACTION_MAP (app), action); g_signal_connect (app, "startup", G_CALLBACK (startup), NULL); g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); g_application_run (G_APPLICATION (app), 0, NULL); return 0; } #else /* !STANDALONE */ static gboolean name_seen; static GtkWidget *placeholder; static void on_name_appeared (GDBusConnection *connection, const gchar *name, const gchar *name_owner, gpointer user_data) { name_seen = TRUE; } static void on_name_vanished (GDBusConnection *connection, const gchar *name, gpointer user_data) { if (!name_seen) return; if (placeholder) { gtk_widget_destroy (placeholder); g_object_unref (placeholder); placeholder = NULL; } } #ifdef G_OS_WIN32 #define APP_EXTENSION ".exe" #else #define APP_EXTENSION #endif GtkWidget * do_application (GtkWidget *toplevel) { static guint watch = 0; if (watch == 0) watch = g_bus_watch_name (G_BUS_TYPE_SESSION, "org.gtk.Demo2", 0, on_name_appeared, on_name_vanished, NULL, NULL); if (placeholder == NULL) { const gchar *command; GError *error = NULL; if (g_file_test ("./gtk3-demo-application" APP_EXTENSION, G_FILE_TEST_IS_EXECUTABLE)) command = "./gtk3-demo-application" APP_EXTENSION; else command = "gtk3-demo-application"; if (!g_spawn_command_line_async (command, &error)) { g_warning ("%s", error->message); g_error_free (error); } placeholder = gtk_label_new (""); g_object_ref_sink (placeholder); } else { g_dbus_connection_call_sync (g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL), "org.gtk.Demo2", "/org/gtk/Demo2", "org.gtk.Actions", "Activate", g_variant_new ("(sava{sv})", "quit", NULL, NULL), NULL, 0, G_MAXINT, NULL, NULL); } return placeholder; } #endif (uuay)listbox.uinL True False True False Email message True True False Embed message True (uuay)background.jpgVJFIFHHCreated with The GIMPC    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222"8!1AQ"a2q#BR3rbC1 ?T[C GzFh ʎ^h| lFT{(v4 TQ|Q ¡KHylmUw$"G4dvEL C1H2;ށY $=3Y4pVM'UDkYR#B@X㘧X"A8$rB Kиd֩1`Np˛MTDL~)oϊ%%FQ"-ó<P \(@E/zg[}ST-ɌpD* $EV$~7U ` {U-yZTꍻk :ԃD!7@`5{~(1`vֲ0ݤ}N[ͰPb"7"1 rfV $Oo~Pe5'HqTfڠXEgU27?)7fW]ۉ?mos9 hb$CYQG-3]:sRH;սXf$}YڶB[Pr$G N,T4hx>iFER*@=sb;k|*(O>(P$S aN<2UpXK&v^*=Fse{]t߭e-胯WeqM@~t{ u-ҳqmAjX&O5@W ڝyp*ʾ;hrI =C!9g(ǚ 3X:46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demo shows how to use PangoCairo to draw rotated and transformed * text. The right pane shows a rotated GtkLabel widget. * * In both cases, a custom PangoCairo shape renderer is installed to draw * a red heard using cairo drawing operations instead of the Unicode heart * character. */ #include #include static GtkWidget *window = NULL; #define HEART "♥" const char text[] = "I ♥ GTK+"; static void fancy_shape_renderer (cairo_t *cr, PangoAttrShape *attr, gboolean do_path, gpointer data) { double x, y; cairo_get_current_point (cr, &x, &y); cairo_translate (cr, x, y); cairo_scale (cr, (double) attr->ink_rect.width / PANGO_SCALE, (double) attr->ink_rect.height / PANGO_SCALE); switch (GPOINTER_TO_UINT (attr->data)) { case 0x2665: /* U+2665 BLACK HEART SUIT */ { cairo_move_to (cr, .5, .0); cairo_line_to (cr, .9, -.4); cairo_curve_to (cr, 1.1, -.8, .5, -.9, .5, -.5); cairo_curve_to (cr, .5, -.9, -.1, -.8, .1, -.4); cairo_close_path (cr); } break; } if (!do_path) { cairo_set_source_rgb (cr, 1., 0., 0.); cairo_fill (cr); } } PangoAttrList * create_fancy_attr_list_for_layout (PangoLayout *layout) { PangoAttrList *attrs; PangoFontMetrics *metrics; int ascent; PangoRectangle ink_rect, logical_rect; const char *p; /* Get font metrics and prepare fancy shape size */ metrics = pango_context_get_metrics (pango_layout_get_context (layout), pango_layout_get_font_description (layout), NULL); ascent = pango_font_metrics_get_ascent (metrics); logical_rect.x = 0; logical_rect.width = ascent; logical_rect.y = -ascent; logical_rect.height = ascent; ink_rect = logical_rect; pango_font_metrics_unref (metrics); /* Set fancy shape attributes for all hearts */ attrs = pango_attr_list_new (); for (p = text; (p = strstr (p, HEART)); p += strlen (HEART)) { PangoAttribute *attr; attr = pango_attr_shape_new_with_data (&ink_rect, &logical_rect, GUINT_TO_POINTER (g_utf8_get_char (p)), NULL, NULL); attr->start_index = p - text; attr->end_index = attr->start_index + strlen (HEART); pango_attr_list_insert (attrs, attr); } return attrs; } static gboolean rotated_text_draw (GtkWidget *widget, cairo_t *cr, gpointer data) { #define RADIUS 150 #define N_WORDS 5 #define FONT "Serif 18" PangoContext *context; PangoLayout *layout; PangoFontDescription *desc; cairo_pattern_t *pattern; PangoAttrList *attrs; double device_radius; int width, height; int i; /* Create a cairo context and set up a transformation matrix so that the user * space coordinates for the centered square where we draw are [-RADIUS, RADIUS], * [-RADIUS, RADIUS]. * We first center, then change the scale. */ width = gtk_widget_get_allocated_width (widget); height = gtk_widget_get_allocated_height (widget); device_radius = MIN (width, height) / 2.; cairo_translate (cr, device_radius + (width - 2 * device_radius) / 2, device_radius + (height - 2 * device_radius) / 2); cairo_scale (cr, device_radius / RADIUS, device_radius / RADIUS); /* Create and a subtle gradient source and use it. */ pattern = cairo_pattern_create_linear (-RADIUS, -RADIUS, RADIUS, RADIUS); cairo_pattern_add_color_stop_rgb (pattern, 0., .5, .0, .0); cairo_pattern_add_color_stop_rgb (pattern, 1., .0, .0, .5); cairo_set_source (cr, pattern); /* Create a PangoContext and set up our shape renderer */ context = gtk_widget_create_pango_context (widget); pango_cairo_context_set_shape_renderer (context, fancy_shape_renderer, NULL, NULL); /* Create a PangoLayout, set the text, font, and attributes */ layout = pango_layout_new (context); pango_layout_set_text (layout, text, -1); desc = pango_font_description_from_string (FONT); pango_layout_set_font_description (layout, desc); attrs = create_fancy_attr_list_for_layout (layout); pango_layout_set_attributes (layout, attrs); pango_attr_list_unref (attrs); /* Draw the layout N_WORDS times in a circle */ for (i = 0; i < N_WORDS; i++) { int width, height; /* Inform Pango to re-layout the text with the new transformation matrix */ pango_cairo_update_layout (cr, layout); pango_layout_get_pixel_size (layout, &width, &height); cairo_move_to (cr, - width / 2, - RADIUS * .9); pango_cairo_show_layout (cr, layout); /* Rotate for the next turn */ cairo_rotate (cr, G_PI*2 / N_WORDS); } /* free the objects we created */ pango_font_description_free (desc); g_object_unref (layout); g_object_unref (context); cairo_pattern_destroy (pattern); return FALSE; } GtkWidget * do_rotated_text (GtkWidget *do_widget) { if (!window) { GtkWidget *box; GtkWidget *drawing_area; GtkWidget *label; PangoLayout *layout; PangoAttrList *attrs; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Rotated Text"); gtk_window_set_default_size (GTK_WINDOW (window), 4 * RADIUS, 2 * RADIUS); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_set_homogeneous (GTK_BOX (box), TRUE); gtk_container_add (GTK_CONTAINER (window), box); /* Add a drawing area */ drawing_area = gtk_drawing_area_new (); gtk_container_add (GTK_CONTAINER (box), drawing_area); gtk_style_context_add_class (gtk_widget_get_style_context (drawing_area), GTK_STYLE_CLASS_VIEW); g_signal_connect (drawing_area, "draw", G_CALLBACK (rotated_text_draw), NULL); /* And a label */ label = gtk_label_new (text); gtk_container_add (GTK_CONTAINER (box), label); gtk_label_set_angle (GTK_LABEL (label), 45); /* Set up fancy stuff on the label */ layout = gtk_label_get_layout (GTK_LABEL (label)); pango_cairo_context_set_shape_renderer (pango_layout_get_context (layout), fancy_shape_renderer, NULL, NULL); attrs = create_fancy_attr_list_for_layout (layout); gtk_label_set_attributes (GTK_LABEL (label), attrs); pango_attr_list_unref (attrs); } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)headerbar.c /* Header Bar * * GtkHeaderBar is a container that is suitable for implementing * window titlebars. One of its features is that it can position * a title (and optional subtitle) centered with regard to the * full width, regardless of variable-width content at the left * or right. * * It is commonly used with gtk_window_set_titlebar() */ #include GtkWidget * do_headerbar (GtkWidget *do_widget) { static GtkWidget *window = NULL; GtkWidget *header; GtkWidget *button; GtkWidget *box; GtkWidget *image; GIcon *icon; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_window_set_default_size (GTK_WINDOW (window), 600, 400); header = gtk_header_bar_new (); gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (header), TRUE); gtk_header_bar_set_title (GTK_HEADER_BAR (header), "Welcome to Facebook - Log in, sign up or learn more"); gtk_header_bar_set_has_subtitle (GTK_HEADER_BAR (header), FALSE); button = gtk_button_new (); icon = g_themed_icon_new ("mail-send-receive-symbolic"); image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_BUTTON); g_object_unref (icon); gtk_container_add (GTK_CONTAINER (button), image); gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_style_context_add_class (gtk_widget_get_style_context (box), "linked"); button = gtk_button_new (); gtk_container_add (GTK_CONTAINER (button), gtk_image_new_from_icon_name ("pan-start-symbolic", GTK_ICON_SIZE_BUTTON)); gtk_container_add (GTK_CONTAINER (box), button); button = gtk_button_new (); gtk_container_add (GTK_CONTAINER (button), gtk_image_new_from_icon_name ("pan-end-symbolic", GTK_ICON_SIZE_BUTTON)); gtk_container_add (GTK_CONTAINER (box), button); gtk_header_bar_pack_start (GTK_HEADER_BAR (header), box); gtk_window_set_titlebar (GTK_WINDOW (window), header); gtk_container_add (GTK_CONTAINER (window), gtk_text_view_new ()); } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)demo.ui0 John Doe 25 This is the John Doe row Mary Unknown 50 This is the Mary Unknown row Copy Copy selected object into the clipboard gtk-copy Cut Cut selected object into the clipboard gtk-cut EditMenu _Edit FileMenu _File New Create a new file gtk-new Open Open a file gtk-open Paste Paste object from the Clipboard gtk-paste Quit Quit the program gtk-quit Save True Save a file gtk-save SaveAs Save with a different name gtk-save-as HelpMenu _Help About gtk-about Help gtk-help GtkBuilder demo gtk3-demo 250 440 GtkBuilder demo True True The menubar False True The toolbar False 1 automatic in True automatic True liststore1 3 Name list A list of person with name, surname and age columns Name 0 Surname 1 Age 2 2 True False 3 (uuay)overlay.ca/* Overlay * * Stack widgets in static positions over a main widget */ #include GtkWidget * do_overlay (GtkWidget *do_widget) { static GtkWidget *window = NULL; if (!window) { GtkWidget *view; GtkWidget *sw; GtkWidget *overlay; GtkWidget *entry; GtkWidget *label; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_default_size (GTK_WINDOW (window), 450, 450); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_window_set_title (GTK_WINDOW (window), "Overlay"); gtk_container_set_border_width (GTK_CONTAINER (window), 0); view = gtk_text_view_new (); sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (sw), view); overlay = gtk_overlay_new (); gtk_container_add (GTK_CONTAINER (overlay), sw); gtk_container_add (GTK_CONTAINER (window), overlay); entry = gtk_entry_new (); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry); gtk_widget_set_halign (entry, GTK_ALIGN_END); gtk_widget_set_valign (entry, GTK_ALIGN_END); label = gtk_label_new ("Hello world"); gtk_widget_set_halign (label, GTK_ALIGN_END); gtk_widget_set_valign (label, GTK_ALIGN_END); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label); gtk_widget_set_margin_start (label, 20); gtk_widget_set_margin_end (label, 20); gtk_widget_set_margin_top (label, 5); gtk_widget_set_margin_bottom (label, 5); entry = gtk_entry_new (); gtk_widget_set_halign (entry, GTK_ALIGN_START); gtk_widget_set_valign (entry, GTK_ALIGN_END); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry); label = gtk_label_new ("Hello world"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_END); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label); gtk_widget_set_margin_start (label, 20); gtk_widget_set_margin_end (label, 20); gtk_widget_set_margin_top (label, 5); gtk_widget_set_margin_bottom (label, 5); entry = gtk_entry_new (); gtk_widget_set_halign (entry, GTK_ALIGN_END); gtk_widget_set_valign (entry, GTK_ALIGN_START); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry); label = gtk_label_new ("Hello world"); gtk_widget_set_halign (label, GTK_ALIGN_END); gtk_widget_set_valign (label, GTK_ALIGN_START); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label); gtk_widget_set_margin_start (label, 20); gtk_widget_set_margin_end (label, 20); gtk_widget_set_margin_top (label, 5); gtk_widget_set_margin_bottom (label, 5); entry = gtk_entry_new (); gtk_widget_set_halign (entry, GTK_ALIGN_START); gtk_widget_set_valign (entry, GTK_ALIGN_START); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry); label = gtk_label_new ("Hello world"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_START); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label); gtk_widget_set_margin_start (label, 20); gtk_widget_set_margin_end (label, 20); gtk_widget_set_margin_top (label, 5); gtk_widget_set_margin_bottom (label, 5); entry = gtk_entry_new (); gtk_widget_set_halign (entry, GTK_ALIGN_END); gtk_widget_set_valign (entry, GTK_ALIGN_CENTER); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry); label = gtk_label_new ("Hello world"); gtk_widget_set_halign (label, GTK_ALIGN_END); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label); gtk_widget_set_margin_start (label, 20); gtk_widget_set_margin_end (label, 20); gtk_widget_set_margin_top (label, 5); gtk_widget_set_margin_bottom (label, 5); entry = gtk_entry_new (); gtk_widget_set_halign (entry, GTK_ALIGN_START); gtk_widget_set_valign (entry, GTK_ALIGN_CENTER); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry); label = gtk_label_new ("Hello world"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label); gtk_widget_set_margin_start (label, 20); gtk_widget_set_margin_end (label, 20); gtk_widget_set_margin_top (label, 5); gtk_widget_set_margin_bottom (label, 5); entry = gtk_entry_new (); gtk_widget_set_halign (entry, GTK_ALIGN_CENTER); gtk_widget_set_valign (entry, GTK_ALIGN_START); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry); label = gtk_label_new ("Hello world"); gtk_widget_set_halign (label, GTK_ALIGN_CENTER); gtk_widget_set_valign (label, GTK_ALIGN_START); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label); gtk_widget_set_margin_start (label, 20); gtk_widget_set_margin_end (label, 20); gtk_widget_set_margin_top (label, 5); gtk_widget_set_margin_bottom (label, 5); entry = gtk_entry_new (); gtk_widget_set_halign (entry, GTK_ALIGN_CENTER); gtk_widget_set_valign (entry, GTK_ALIGN_END); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry); label = gtk_label_new ("Hello world"); gtk_widget_set_halign (label, GTK_ALIGN_CENTER); gtk_widget_set_valign (label, GTK_ALIGN_END); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label); gtk_widget_set_margin_start (label, 10); gtk_widget_set_margin_end (label, 10); gtk_widget_set_margin_top (label, 5); gtk_widget_set_margin_bottom (label, 5); entry = gtk_entry_new (); gtk_widget_set_halign (entry, GTK_ALIGN_CENTER); gtk_widget_set_valign (entry, GTK_ALIGN_CENTER); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), entry); label = gtk_label_new ("Hello world"); gtk_widget_set_halign (label, GTK_ALIGN_CENTER); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); gtk_overlay_add_overlay (GTK_OVERLAY (overlay), label); gtk_widget_show_all (overlay); } if (!gtk_widget_get_visible (window)) { gtk_widget_show (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)cssview.css/* Make the text editor has a nice style */ .view { color: #2e3436; font: Monospace; background-color: alpha(white, 0.30); } .view:selected { color: white; background-color: #4a90d9; } .scrollbar.trough, .scrollbars-junction { background-color: alpha(white, 0.80); } .scrollbar.slider { border-width: 3px; border-style: solid; border-radius: 10px; border-color: transparent; background-clip: padding-box; background-color: #999; } .scrollbar.slider:prelight { background-color: #555; } .pane-separator { background-color: alpha(white, 0.80); background-image: linear-gradient(transparent, transparent 1px, #999 1px, #999 4px, transparent 4px); background-size: 40px auto; background-repeat: no-repeat; background-position: center; } .pane-separator:prelight { background-image: linear-gradient(transparent, transparent 1px, #555 1px, #555 4px, transparent 4px); } (uuay)theming_style_classes.c/* CSS Theming/Style Classes * * GTK+ uses CSS for theming. Style classes can be associated * with widgets to inform the theme about intended rendering. * * This demo shows some common examples where theming features * of GTK+ are used for certain effects: primary toolbars, * inline toolbars and linked buttons. */ #include static GtkWidget *window = NULL; GtkWidget * do_theming_style_classes (GtkWidget *do_widget) { GtkWidget *grid; GtkBuilder *builder; GError *err = NULL; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Style Classes"); gtk_container_set_border_width (GTK_CONTAINER (window), 12); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); builder = gtk_builder_new (); gtk_builder_add_from_resource (builder, "/theming_style_classes/theming.ui", NULL); if (err) { g_error ("ERROR: %s\n", err->message); return NULL; } grid = (GtkWidget *)gtk_builder_get_object (builder, "grid"); gtk_widget_show_all (grid); gtk_container_add (GTK_CONTAINER (window), grid); g_object_unref (builder); } if (!gtk_widget_get_visible (window)) { gtk_widget_show (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)textview.cb/* Text Widget/Multiple Views * * The GtkTextView widget displays a GtkTextBuffer. One GtkTextBuffer * can be displayed by multiple GtkTextViews. This demo has two views * displaying a single buffer, and shows off the widget's text * formatting features. * */ #include #include /* for exit() */ static void easter_egg_callback (GtkWidget *button, gpointer data); static void create_tags (GtkTextBuffer *buffer) { /* Create a bunch of tags. Note that it's also possible to * create tags with gtk_text_tag_new() then add them to the * tag table for the buffer, gtk_text_buffer_create_tag() is * just a convenience function. Also note that you don't have * to give tags a name; pass NULL for the name to create an * anonymous tag. * * In any real app, another useful optimization would be to create * a GtkTextTagTable in advance, and reuse the same tag table for * all the buffers with the same tag set, instead of creating * new copies of the same tags for every buffer. * * Tags are assigned default priorities in order of addition to the * tag table. That is, tags created later that affect the same text * property affected by an earlier tag will override the earlier * tag. You can modify tag priorities with * gtk_text_tag_set_priority(). */ gtk_text_buffer_create_tag (buffer, "heading", "weight", PANGO_WEIGHT_BOLD, "size", 15 * PANGO_SCALE, NULL); gtk_text_buffer_create_tag (buffer, "italic", "style", PANGO_STYLE_ITALIC, NULL); gtk_text_buffer_create_tag (buffer, "bold", "weight", PANGO_WEIGHT_BOLD, NULL); gtk_text_buffer_create_tag (buffer, "big", /* points times the PANGO_SCALE factor */ "size", 20 * PANGO_SCALE, NULL); gtk_text_buffer_create_tag (buffer, "xx-small", "scale", PANGO_SCALE_XX_SMALL, NULL); gtk_text_buffer_create_tag (buffer, "x-large", "scale", PANGO_SCALE_X_LARGE, NULL); gtk_text_buffer_create_tag (buffer, "monospace", "family", "monospace", NULL); gtk_text_buffer_create_tag (buffer, "blue_foreground", "foreground", "blue", NULL); gtk_text_buffer_create_tag (buffer, "red_background", "background", "red", NULL); gtk_text_buffer_create_tag (buffer, "big_gap_before_line", "pixels_above_lines", 30, NULL); gtk_text_buffer_create_tag (buffer, "big_gap_after_line", "pixels_below_lines", 30, NULL); gtk_text_buffer_create_tag (buffer, "double_spaced_line", "pixels_inside_wrap", 10, NULL); gtk_text_buffer_create_tag (buffer, "not_editable", "editable", FALSE, NULL); gtk_text_buffer_create_tag (buffer, "word_wrap", "wrap_mode", GTK_WRAP_WORD, NULL); gtk_text_buffer_create_tag (buffer, "char_wrap", "wrap_mode", GTK_WRAP_CHAR, NULL); gtk_text_buffer_create_tag (buffer, "no_wrap", "wrap_mode", GTK_WRAP_NONE, NULL); gtk_text_buffer_create_tag (buffer, "center", "justification", GTK_JUSTIFY_CENTER, NULL); gtk_text_buffer_create_tag (buffer, "right_justify", "justification", GTK_JUSTIFY_RIGHT, NULL); gtk_text_buffer_create_tag (buffer, "wide_margins", "left_margin", 50, "right_margin", 50, NULL); gtk_text_buffer_create_tag (buffer, "strikethrough", "strikethrough", TRUE, NULL); gtk_text_buffer_create_tag (buffer, "underline", "underline", PANGO_UNDERLINE_SINGLE, NULL); gtk_text_buffer_create_tag (buffer, "double_underline", "underline", PANGO_UNDERLINE_DOUBLE, NULL); gtk_text_buffer_create_tag (buffer, "superscript", "rise", 10 * PANGO_SCALE, /* 10 pixels */ "size", 8 * PANGO_SCALE, /* 8 points */ NULL); gtk_text_buffer_create_tag (buffer, "subscript", "rise", -10 * PANGO_SCALE, /* 10 pixels */ "size", 8 * PANGO_SCALE, /* 8 points */ NULL); gtk_text_buffer_create_tag (buffer, "rtl_quote", "wrap_mode", GTK_WRAP_WORD, "direction", GTK_TEXT_DIR_RTL, "indent", 30, "left_margin", 20, "right_margin", 20, NULL); } static void insert_text (GtkTextBuffer *buffer) { GtkTextIter iter; GtkTextIter start, end; GdkPixbuf *pixbuf; GtkIconTheme *icon_theme; icon_theme = gtk_icon_theme_get_default (); pixbuf = gtk_icon_theme_load_icon (icon_theme, "gtk3-demo", 32, GTK_ICON_LOOKUP_GENERIC_FALLBACK, NULL); g_assert (pixbuf); /* get start of buffer; each insertion will revalidate the * iterator to point to just after the inserted text. */ gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0); gtk_text_buffer_insert (buffer, &iter, "The text widget can display text with all kinds of nifty attributes. " "It also supports multiple views of the same buffer; this demo is " "showing the same buffer in two places.\n\n", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "Font styles. ", -1, "heading", NULL); gtk_text_buffer_insert (buffer, &iter, "For example, you can have ", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "italic", -1, "italic", NULL); gtk_text_buffer_insert (buffer, &iter, ", ", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "bold", -1, "bold", NULL); gtk_text_buffer_insert (buffer, &iter, ", or ", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "monospace (typewriter)", -1, "monospace", NULL); gtk_text_buffer_insert (buffer, &iter, ", or ", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "big", -1, "big", NULL); gtk_text_buffer_insert (buffer, &iter, " text. ", -1); gtk_text_buffer_insert (buffer, &iter, "It's best not to hardcode specific text sizes; you can use relative " "sizes as with CSS, such as ", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "xx-small", -1, "xx-small", NULL); gtk_text_buffer_insert (buffer, &iter, " or ", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "x-large", -1, "x-large", NULL); gtk_text_buffer_insert (buffer, &iter, " to ensure that your program properly adapts if the user changes the " "default font size.\n\n", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "Colors. ", -1, "heading", NULL); gtk_text_buffer_insert (buffer, &iter, "Colors such as ", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "a blue foreground", -1, "blue_foreground", NULL); gtk_text_buffer_insert (buffer, &iter, " or ", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "a red background", -1, "red_background", NULL); gtk_text_buffer_insert (buffer, &iter, " or even ", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "a blue foreground on red background", -1, "blue_foreground", "red_background", NULL); gtk_text_buffer_insert (buffer, &iter, " (select that to read it) can be used.\n\n", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "Underline, strikethrough, and rise. ", -1, "heading", NULL); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "Strikethrough", -1, "strikethrough", NULL); gtk_text_buffer_insert (buffer, &iter, ", ", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "underline", -1, "underline", NULL); gtk_text_buffer_insert (buffer, &iter, ", ", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "double underline", -1, "double_underline", NULL); gtk_text_buffer_insert (buffer, &iter, ", ", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "superscript", -1, "superscript", NULL); gtk_text_buffer_insert (buffer, &iter, ", and ", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "subscript", -1, "subscript", NULL); gtk_text_buffer_insert (buffer, &iter, " are all supported.\n\n", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "Images. ", -1, "heading", NULL); gtk_text_buffer_insert (buffer, &iter, "The buffer can have images in it: ", -1); gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf); gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf); gtk_text_buffer_insert_pixbuf (buffer, &iter, pixbuf); gtk_text_buffer_insert (buffer, &iter, " for example.\n\n", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "Spacing. ", -1, "heading", NULL); gtk_text_buffer_insert (buffer, &iter, "You can adjust the amount of space before each line.\n", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "This line has a whole lot of space before it.\n", -1, "big_gap_before_line", "wide_margins", NULL); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "You can also adjust the amount of space after each line; " "this line has a whole lot of space after it.\n", -1, "big_gap_after_line", "wide_margins", NULL); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "You can also adjust the amount of space between wrapped lines; " "this line has extra space between each wrapped line in the same " "paragraph. To show off wrapping, some filler text: the quick " "brown fox jumped over the lazy dog. Blah blah blah blah blah " "blah blah blah blah.\n", -1, "double_spaced_line", "wide_margins", NULL); gtk_text_buffer_insert (buffer, &iter, "Also note that those lines have extra-wide margins.\n\n", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "Editability. ", -1, "heading", NULL); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "This line is 'locked down' and can't be edited by the user - just " "try it! You can't delete this line.\n\n", -1, "not_editable", NULL); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "Wrapping. ", -1, "heading", NULL); gtk_text_buffer_insert (buffer, &iter, "This line (and most of the others in this buffer) is word-wrapped, " "using the proper Unicode algorithm. Word wrap should work in all " "scripts and languages that GTK+ supports. Let's make this a long " "paragraph to demonstrate: blah blah blah blah blah blah blah blah " "blah blah blah blah blah blah blah blah blah blah blah\n\n", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "This line has character-based wrapping, and can wrap between any two " "character glyphs. Let's make this a long paragraph to demonstrate: " "blah blah blah blah blah blah blah blah blah blah blah blah blah blah " "blah blah blah blah blah\n\n", -1, "char_wrap", NULL); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "This line has all wrapping turned off, so it makes the horizontal " "scrollbar appear.\n\n\n", -1, "no_wrap", NULL); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "Justification. ", -1, "heading", NULL); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "\nThis line has center justification.\n", -1, "center", NULL); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "This line has right justification.\n", -1, "right_justify", NULL); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "\nThis line has big wide margins. Text text text text text text text " "text text text text text text text text text text text text text text " "text text text text text text text text text text text text text text " "text.\n", -1, "wide_margins", NULL); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "Internationalization. ", -1, "heading", NULL); gtk_text_buffer_insert (buffer, &iter, "You can put all sorts of Unicode text in the buffer.\n\nGerman " "(Deutsch S\303\274d) Gr\303\274\303\237 Gott\nGreek " "(\316\225\316\273\316\273\316\267\316\275\316\271\316\272\316\254) " "\316\223\316\265\316\271\316\254 \317\203\316\261\317\202\nHebrew " "\327\251\327\234\327\225\327\235\nJapanese " "(\346\227\245\346\234\254\350\252\236)\n\nThe widget properly handles " "bidirectional text, word wrapping, DOS/UNIX/Unicode paragraph separators, " "grapheme boundaries, and so on using the Pango internationalization " "framework.\n", -1); gtk_text_buffer_insert (buffer, &iter, "Here's a word-wrapped quote in a right-to-left language:\n", -1); gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "\331\210\331\202\330\257 \330\250\330\257\330\243 " "\330\253\331\204\330\247\330\253 \331\205\331\206 " "\330\243\331\203\330\253\330\261 \330\247\331\204\331\205\330\244\330\263\330\263\330\247\330\252 " "\330\252\331\202\330\257\331\205\330\247 \331\201\331\212 " "\330\264\330\250\331\203\330\251 \330\247\331\203\330\263\331\212\331\210\331\206 " "\330\250\330\261\330\247\331\205\330\254\331\207\330\247 " "\331\203\331\205\331\206\330\270\331\205\330\247\330\252 " "\331\204\330\247 \330\252\330\263\330\271\331\211 \331\204\331\204\330\261\330\250\330\255\330\214 " "\330\253\331\205 \330\252\330\255\331\210\331\204\330\252 " "\331\201\331\212 \330\247\331\204\330\263\331\206\331\210\330\247\330\252 " "\330\247\331\204\330\256\331\205\330\263 \330\247\331\204\331\205\330\247\330\266\331\212\330\251 " "\330\245\331\204\331\211 \331\205\330\244\330\263\330\263\330\247\330\252 " "\331\205\330\247\331\204\331\212\330\251 \331\205\331\206\330\270\331\205\330\251\330\214 " "\331\210\330\250\330\247\330\252\330\252 \330\254\330\262\330\241\330\247 " "\331\205\331\206 \330\247\331\204\331\206\330\270\330\247\331\205 " "\330\247\331\204\331\205\330\247\331\204\331\212 \331\201\331\212 " "\330\250\331\204\330\257\330\247\331\206\331\207\330\247\330\214 " "\331\210\331\204\331\203\331\206\331\207\330\247 \330\252\330\252\330\256\330\265\330\265 " "\331\201\331\212 \330\256\330\257\331\205\330\251 \331\202\330\267\330\247\330\271 " "\330\247\331\204\331\205\330\264\330\261\331\210\330\271\330\247\330\252 " "\330\247\331\204\330\265\330\272\331\212\330\261\330\251. \331\210\330\243\330\255\330\257 " "\330\243\331\203\330\253\330\261 \331\207\330\260\331\207 " "\330\247\331\204\331\205\330\244\330\263\330\263\330\247\330\252 " "\331\206\330\254\330\247\330\255\330\247 \331\207\331\210 " "\302\273\330\250\330\247\331\206\331\203\331\210\330\263\331\210\331\204\302\253 " "\331\201\331\212 \330\250\331\210\331\204\331\212\331\201\331\212\330\247.\n\n", -1, "rtl_quote", NULL); gtk_text_buffer_insert (buffer, &iter, "You can put widgets in the buffer: Here's a button: ", -1); gtk_text_buffer_create_child_anchor (buffer, &iter); gtk_text_buffer_insert (buffer, &iter, " and a menu: ", -1); gtk_text_buffer_create_child_anchor (buffer, &iter); gtk_text_buffer_insert (buffer, &iter, " and a scale: ", -1); gtk_text_buffer_create_child_anchor (buffer, &iter); gtk_text_buffer_insert (buffer, &iter, " and an animation: ", -1); gtk_text_buffer_create_child_anchor (buffer, &iter); gtk_text_buffer_insert (buffer, &iter, " finally a text entry: ", -1); gtk_text_buffer_create_child_anchor (buffer, &iter); gtk_text_buffer_insert (buffer, &iter, ".\n", -1); gtk_text_buffer_insert (buffer, &iter, "\n\nThis demo doesn't demonstrate all the GtkTextBuffer features; " "it leaves out, for example: invisible/hidden text, tab stops, " "application-drawn areas on the sides of the widget for displaying " "breakpoints and such...", -1); /* Apply word_wrap tag to whole buffer */ gtk_text_buffer_get_bounds (buffer, &start, &end); gtk_text_buffer_apply_tag_by_name (buffer, "word_wrap", &start, &end); g_object_unref (pixbuf); } static gboolean find_anchor (GtkTextIter *iter) { while (gtk_text_iter_forward_char (iter)) { if (gtk_text_iter_get_child_anchor (iter)) return TRUE; } return FALSE; } static void attach_widgets (GtkTextView *text_view) { GtkTextIter iter; GtkTextBuffer *buffer; int i; buffer = gtk_text_view_get_buffer (text_view); gtk_text_buffer_get_start_iter (buffer, &iter); i = 0; while (find_anchor (&iter)) { GtkTextChildAnchor *anchor; GtkWidget *widget; anchor = gtk_text_iter_get_child_anchor (&iter); if (i == 0) { widget = gtk_button_new_with_label ("Click Me"); g_signal_connect (widget, "clicked", G_CALLBACK (easter_egg_callback), NULL); } else if (i == 1) { widget = gtk_combo_box_text_new (); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 1"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 2"); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 3"); } else if (i == 2) { widget = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, NULL); gtk_range_set_range (GTK_RANGE (widget), 0, 100); gtk_widget_set_size_request (widget, 70, -1); } else if (i == 3) { widget = gtk_image_new_from_resource ("/textview/floppybuddy.gif"); } else if (i == 4) { widget = gtk_entry_new (); } else { widget = NULL; /* avoids a compiler warning */ g_assert_not_reached (); } gtk_text_view_add_child_at_anchor (text_view, widget, anchor); gtk_widget_show_all (widget); ++i; } } GtkWidget * do_textview (GtkWidget *do_widget) { static GtkWidget *window = NULL; if (!window) { GtkWidget *vpaned; GtkWidget *view1; GtkWidget *view2; GtkWidget *sw; GtkTextBuffer *buffer; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_default_size (GTK_WINDOW (window), 450, 450); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_window_set_title (GTK_WINDOW (window), "TextView"); gtk_container_set_border_width (GTK_CONTAINER (window), 0); vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL); gtk_container_set_border_width (GTK_CONTAINER(vpaned), 5); gtk_container_add (GTK_CONTAINER (window), vpaned); /* For convenience, we just use the autocreated buffer from * the first text view; you could also create the buffer * by itself with gtk_text_buffer_new(), then later create * a view widget. */ view1 = gtk_text_view_new (); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view1)); view2 = gtk_text_view_new_with_buffer (buffer); sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_paned_add1 (GTK_PANED (vpaned), sw); gtk_container_add (GTK_CONTAINER (sw), view1); sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_paned_add2 (GTK_PANED (vpaned), sw); gtk_container_add (GTK_CONTAINER (sw), view2); create_tags (buffer); insert_text (buffer); attach_widgets (GTK_TEXT_VIEW (view1)); attach_widgets (GTK_TEXT_VIEW (view2)); gtk_widget_show_all (vpaned); } if (!gtk_widget_get_visible (window)) { gtk_widget_show (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } static void recursive_attach_view (int depth, GtkTextView *view, GtkTextChildAnchor *anchor) { GtkWidget *child_view, *frame; if (depth > 4) return; child_view = gtk_text_view_new_with_buffer (gtk_text_view_get_buffer (view)); /* Frame is to add a black border around each child view */ frame = gtk_frame_new (NULL); gtk_container_add (GTK_CONTAINER (frame), child_view); gtk_text_view_add_child_at_anchor (view, frame, anchor); recursive_attach_view (depth + 1, GTK_TEXT_VIEW (child_view), anchor); } static void easter_egg_callback (GtkWidget *button, gpointer data) { static GtkWidget *window = NULL; gpointer window_ptr; GtkTextBuffer *buffer; GtkWidget *view; GtkTextIter iter; GtkTextChildAnchor *anchor; GtkWidget *sw; if (window) { gtk_window_present (GTK_WINDOW (window)); return; } buffer = gtk_text_buffer_new (NULL); gtk_text_buffer_get_start_iter (buffer, &iter); gtk_text_buffer_insert (buffer, &iter, "This buffer is shared by a set of nested text views.\n Nested view:\n", -1); anchor = gtk_text_buffer_create_child_anchor (buffer, &iter); gtk_text_buffer_insert (buffer, &iter, "\nDon't do this in real applications, please.\n", -1); view = gtk_text_view_new_with_buffer (buffer); recursive_attach_view (0, GTK_TEXT_VIEW (view), anchor); g_object_unref (buffer); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add (GTK_CONTAINER (window), sw); gtk_container_add (GTK_CONTAINER (sw), view); window_ptr = &window; g_object_add_weak_pointer (G_OBJECT (window), window_ptr); gtk_window_set_default_size (GTK_WINDOW (window), 300, 400); gtk_widget_show_all (window); } (uuay)css_multiplebgs/+Rm\;assistant.c/* Assistant * * Demonstrates a sample multi-step assistant. Assistants are used to divide * an operation into several simpler sequential steps, and to guide the user * through these steps. */ #include static GtkWidget *assistant = NULL; static GtkWidget *progress_bar = NULL; static gboolean apply_changes_gradually (gpointer data) { gdouble fraction; /* Work, work, work... */ fraction = gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (progress_bar)); fraction += 0.05; if (fraction < 1.0) { gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progress_bar), fraction); return G_SOURCE_CONTINUE; } else { /* Close automatically once changes are fully applied. */ gtk_widget_destroy (assistant); assistant = NULL; return G_SOURCE_REMOVE; } } static void on_assistant_apply (GtkWidget *widget, gpointer data) { /* Start a timer to simulate changes taking a few seconds to apply. */ g_timeout_add (100, apply_changes_gradually, NULL); } static void on_assistant_close_cancel (GtkWidget *widget, gpointer data) { GtkWidget **assistant = (GtkWidget **) data; gtk_widget_destroy (*assistant); *assistant = NULL; } static void on_assistant_prepare (GtkWidget *widget, GtkWidget *page, gpointer data) { gint current_page, n_pages; gchar *title; current_page = gtk_assistant_get_current_page (GTK_ASSISTANT (widget)); n_pages = gtk_assistant_get_n_pages (GTK_ASSISTANT (widget)); title = g_strdup_printf ("Sample assistant (%d of %d)", current_page + 1, n_pages); gtk_window_set_title (GTK_WINDOW (widget), title); g_free (title); /* The fourth page (counting from zero) is the progress page. The * user clicked Apply to get here so we tell the assistant to commit, * which means the changes up to this point are permanent and cannot * be cancelled or revisited. */ if (current_page == 3) gtk_assistant_commit (GTK_ASSISTANT (widget)); } static void on_entry_changed (GtkWidget *widget, gpointer data) { GtkAssistant *assistant = GTK_ASSISTANT (data); GtkWidget *current_page; gint page_number; const gchar *text; page_number = gtk_assistant_get_current_page (assistant); current_page = gtk_assistant_get_nth_page (assistant, page_number); text = gtk_entry_get_text (GTK_ENTRY (widget)); if (text && *text) gtk_assistant_set_page_complete (assistant, current_page, TRUE); else gtk_assistant_set_page_complete (assistant, current_page, FALSE); } static void create_page1 (GtkWidget *assistant) { GtkWidget *box, *label, *entry; box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); gtk_container_set_border_width (GTK_CONTAINER (box), 12); label = gtk_label_new ("You must fill out this entry to continue:"); gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0); entry = gtk_entry_new (); gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); gtk_box_pack_start (GTK_BOX (box), entry, TRUE, TRUE, 0); g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (on_entry_changed), assistant); gtk_widget_show_all (box); gtk_assistant_append_page (GTK_ASSISTANT (assistant), box); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), box, "Page 1"); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), box, GTK_ASSISTANT_PAGE_INTRO); } static void create_page2 (GtkWidget *assistant) { GtkWidget *box, *checkbutton; box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_container_set_border_width (GTK_CONTAINER (box), 12); checkbutton = gtk_check_button_new_with_label ("This is optional data, you may continue " "even if you do not check this"); gtk_box_pack_start (GTK_BOX (box), checkbutton, FALSE, FALSE, 0); gtk_widget_show_all (box); gtk_assistant_append_page (GTK_ASSISTANT (assistant), box); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), box, TRUE); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), box, "Page 2"); } static void create_page3 (GtkWidget *assistant) { GtkWidget *label; label = gtk_label_new ("This is a confirmation page, press 'Apply' to apply changes"); gtk_widget_show (label); gtk_assistant_append_page (GTK_ASSISTANT (assistant), label); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), label, GTK_ASSISTANT_PAGE_CONFIRM); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), label, TRUE); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), label, "Confirmation"); } static void create_page4 (GtkWidget *assistant) { progress_bar = gtk_progress_bar_new (); gtk_widget_set_halign (progress_bar, GTK_ALIGN_CENTER); gtk_widget_set_valign (progress_bar, GTK_ALIGN_CENTER); gtk_widget_show (progress_bar); gtk_assistant_append_page (GTK_ASSISTANT (assistant), progress_bar); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), progress_bar, GTK_ASSISTANT_PAGE_PROGRESS); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), progress_bar, "Applying changes"); /* This prevents the assistant window from being * closed while we're "busy" applying changes. */ gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), progress_bar, FALSE); } GtkWidget* do_assistant (GtkWidget *do_widget) { if (!assistant) { assistant = gtk_assistant_new (); gtk_window_set_default_size (GTK_WINDOW (assistant), -1, 300); gtk_window_set_screen (GTK_WINDOW (assistant), gtk_widget_get_screen (do_widget)); create_page1 (assistant); create_page2 (assistant); create_page3 (assistant); create_page4 (assistant); g_signal_connect (G_OBJECT (assistant), "cancel", G_CALLBACK (on_assistant_close_cancel), &assistant); g_signal_connect (G_OBJECT (assistant), "close", G_CALLBACK (on_assistant_close_cancel), &assistant); g_signal_connect (G_OBJECT (assistant), "apply", G_CALLBACK (on_assistant_apply), NULL); g_signal_connect (G_OBJECT (assistant), "prepare", G_CALLBACK (on_assistant_prepare), NULL); } if (!gtk_widget_get_visible (assistant)) gtk_widget_show (assistant); else { gtk_widget_destroy (assistant); assistant = NULL; } return assistant; } (uuay)apple-red.png PNG  IHDR00WgAMA a IDATx[]Wyk9s8 N)JڄڨB>pE WK R@@@BqS+8v3sk}>31^|֞9e{^tvy_Tz߇} r޽cksM?p<p+E>*ܾ֏ W]vfgvw>yv!'+_dLom]aD֭G7L#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z@<hsaЎgyhCL_) LMttzb|[{v0Fԕ*A"E" 'U(G3.ElPSZsD %;١B1rch&3Ԅ%$D9FbwƓ963{;ydb vXs<2N80qY?fza\!9zTr;O97c2~ie8]щblE˜ |\IENDB`(uuay)css_pixbufs.c/* CSS Theming/Animated Backgrounds * * This demo is done in honour of the Pixbufs demo further down. * It is done exclusively with CSS as the background of the window. */ #include static GtkWidget *window = NULL; static void show_parsing_error (GtkCssProvider *provider, GtkCssSection *section, const GError *error, GtkTextBuffer *buffer) { GtkTextIter start, end; const char *tag_name; gtk_text_buffer_get_iter_at_line_index (buffer, &start, gtk_css_section_get_start_line (section), gtk_css_section_get_start_position (section)); gtk_text_buffer_get_iter_at_line_index (buffer, &end, gtk_css_section_get_end_line (section), gtk_css_section_get_end_position (section)); if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED)) tag_name = "warning"; else tag_name = "error"; gtk_text_buffer_apply_tag_by_name (buffer, tag_name, &start, &end); } static void css_text_changed (GtkTextBuffer *buffer, GtkCssProvider *provider) { GtkTextIter start, end; char *text; gtk_text_buffer_get_start_iter (buffer, &start); gtk_text_buffer_get_end_iter (buffer, &end); gtk_text_buffer_remove_all_tags (buffer, &start, &end); text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); gtk_css_provider_load_from_data (provider, text, -1, NULL); g_free (text); gtk_style_context_reset_widgets (gdk_screen_get_default ()); } static void apply_css (GtkWidget *widget, GtkStyleProvider *provider) { gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT); if (GTK_IS_CONTAINER (widget)) gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider); } GtkWidget * do_css_pixbufs (GtkWidget *do_widget) { if (!window) { GtkWidget *paned, *container, *child; GtkStyleProvider *provider; GtkTextBuffer *text; GBytes *bytes; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget)); gtk_window_set_default_size (GTK_WINDOW (window), 400, 300); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); paned = gtk_paned_new (GTK_ORIENTATION_VERTICAL); gtk_container_add (GTK_CONTAINER (window), paned); /* Need a filler so we get a handle */ child = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (paned), child); text = gtk_text_buffer_new (NULL); gtk_text_buffer_create_tag (text, "warning", "underline", PANGO_UNDERLINE_SINGLE, NULL); gtk_text_buffer_create_tag (text, "error", "underline", PANGO_UNDERLINE_ERROR, NULL); provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ()); container = gtk_scrolled_window_new (NULL, NULL); gtk_container_add (GTK_CONTAINER (paned), container); child = gtk_text_view_new_with_buffer (text); gtk_container_add (GTK_CONTAINER (container), child); g_signal_connect (text, "changed", G_CALLBACK (css_text_changed), provider); bytes = g_resources_lookup_data ("/css_pixbufs/gtk.css", 0, NULL); gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes)); g_bytes_unref (bytes); g_signal_connect (provider, "parsing-error", G_CALLBACK (show_parsing_error), gtk_text_view_get_buffer (GTK_TEXT_VIEW (child))); apply_css (window, provider); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)infobar.c/* Info bar * * Info bar widgets are used to report important messages to the user. */ #include #include static GtkWidget *window = NULL; static void on_bar_response (GtkInfoBar *info_bar, gint response_id, gpointer user_data) { GtkWidget *dialog; if (response_id == GTK_RESPONSE_CLOSE) { gtk_widget_hide (GTK_WIDGET (info_bar)); return; } dialog = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "You clicked a button on an info bar"); gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "Your response has id %d", response_id); g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog); gtk_widget_show_all (dialog); } GtkWidget * do_infobar (GtkWidget *do_widget) { GtkWidget *frame; GtkWidget *bar; GtkWidget *vbox; GtkWidget *vbox2; GtkWidget *label; GtkWidget *actions; GtkWidget *button; if (!window) { actions = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Info Bars"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_container_set_border_width (GTK_CONTAINER (window), 8); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), vbox); bar = gtk_info_bar_new (); gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0); gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_INFO); label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_INFO"); gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0); button = gtk_toggle_button_new_with_label ("Message"); g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL); gtk_container_add (GTK_CONTAINER (actions), button); bar = gtk_info_bar_new (); gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0); gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_WARNING); label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_WARNING"); gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0); button = gtk_toggle_button_new_with_label ("Warning"); g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL); gtk_container_add (GTK_CONTAINER (actions), button); bar = gtk_info_bar_new_with_buttons (_("_OK"), GTK_RESPONSE_OK, NULL); gtk_info_bar_set_show_close_button (GTK_INFO_BAR (bar), TRUE); g_signal_connect (bar, "response", G_CALLBACK (on_bar_response), window); gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0); gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_QUESTION); label = gtk_label_new ("This is\nan info bar with message type\nGTK_MESSAGE_QUESTION"); gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0); button = gtk_toggle_button_new_with_label ("Question"); g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL); gtk_container_add (GTK_CONTAINER (actions), button); bar = gtk_info_bar_new (); gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0); gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_ERROR); label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_ERROR"); gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0); button = gtk_toggle_button_new_with_label ("Error"); g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL); gtk_container_add (GTK_CONTAINER (actions), button); bar = gtk_info_bar_new (); gtk_box_pack_start (GTK_BOX (vbox), bar, FALSE, FALSE, 0); gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_OTHER); label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_OTHER"); gtk_box_pack_start (GTK_BOX (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label, FALSE, FALSE, 0); button = gtk_toggle_button_new_with_label ("Other"); g_object_bind_property (button, "active", bar, "visible", G_BINDING_BIDIRECTIONAL); gtk_container_add (GTK_CONTAINER (actions), button); frame = gtk_frame_new ("Info bars"); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 8); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8); gtk_container_add (GTK_CONTAINER (frame), vbox2); /* Standard message dialog */ label = gtk_label_new ("An example of different info bars"); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0); gtk_widget_show_all (actions); gtk_box_pack_start (GTK_BOX (vbox2), actions, FALSE, FALSE, 0); } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)textscroll.c/* Text Widget/Automatic Scrolling * * This example demonstrates how to use the gravity of * GtkTextMarks to keep a text view scrolled to the bottom * while appending text. */ #include /* Scroll to the end of the buffer. */ static gboolean scroll_to_end (GtkTextView *textview) { GtkTextBuffer *buffer; GtkTextIter iter; GtkTextMark *mark; char *spaces; char *text; static int count; buffer = gtk_text_view_get_buffer (textview); /* Get "end" mark. It's located at the end of buffer because * of right gravity */ mark = gtk_text_buffer_get_mark (buffer, "end"); gtk_text_buffer_get_iter_at_mark (buffer, &iter, mark); /* and insert some text at its position, the iter will be * revalidated after insertion to point to the end of inserted text */ spaces = g_strnfill (count++, ' '); gtk_text_buffer_insert (buffer, &iter, "\n", -1); gtk_text_buffer_insert (buffer, &iter, spaces, -1); text = g_strdup_printf ("Scroll to end scroll to end scroll " "to end scroll to end %d", count); gtk_text_buffer_insert (buffer, &iter, text, -1); g_free (spaces); g_free (text); /* Now scroll the end mark onscreen. */ gtk_text_view_scroll_mark_onscreen (textview, mark); /* Emulate typewriter behavior, shift to the left if we * are far enough to the right. */ if (count > 150) count = 0; return G_SOURCE_CONTINUE; } /* Scroll to the bottom of the buffer. */ static gboolean scroll_to_bottom (GtkTextView *textview) { GtkTextBuffer *buffer; GtkTextIter iter; GtkTextMark *mark; char *spaces; char *text; static int count; buffer = gtk_text_view_get_buffer (textview); /* Get end iterator */ gtk_text_buffer_get_end_iter (buffer, &iter); /* and insert some text at it, the iter will be revalidated * after insertion to point to the end of inserted text */ spaces = g_strnfill (count++, ' '); gtk_text_buffer_insert (buffer, &iter, "\n", -1); gtk_text_buffer_insert (buffer, &iter, spaces, -1); text = g_strdup_printf ("Scroll to bottom scroll to bottom scroll " "to bottom scroll to bottom %d", count); gtk_text_buffer_insert (buffer, &iter, text, -1); g_free (spaces); g_free (text); /* Move the iterator to the beginning of line, so we don't scroll * in horizontal direction */ gtk_text_iter_set_line_offset (&iter, 0); /* and place the mark at iter. the mark will stay there after we * insert some text at the end because it has left gravity. */ mark = gtk_text_buffer_get_mark (buffer, "scroll"); gtk_text_buffer_move_mark (buffer, mark, &iter); /* Scroll the mark onscreen. */ gtk_text_view_scroll_mark_onscreen (textview, mark); /* Shift text back if we got enough to the right. */ if (count > 40) count = 0; return G_SOURCE_CONTINUE; } static guint setup_scroll (GtkTextView *textview, gboolean to_end) { GtkTextBuffer *buffer; GtkTextIter iter; buffer = gtk_text_view_get_buffer (textview); gtk_text_buffer_get_end_iter (buffer, &iter); if (to_end) { /* If we want to scroll to the end, including horizontal scrolling, * then we just create a mark with right gravity at the end of the * buffer. It will stay at the end unless explicitly moved with * gtk_text_buffer_move_mark. */ gtk_text_buffer_create_mark (buffer, "end", &iter, FALSE); /* Add scrolling timeout. */ return g_timeout_add (50, (GSourceFunc) scroll_to_end, textview); } else { /* If we want to scroll to the bottom, but not scroll horizontally, * then an end mark won't do the job. Just create a mark so we can * use it with gtk_text_view_scroll_mark_onscreen, we'll position it * explicitly when needed. Use left gravity so the mark stays where * we put it after inserting new text. */ gtk_text_buffer_create_mark (buffer, "scroll", &iter, TRUE); /* Add scrolling timeout. */ return g_timeout_add (100, (GSourceFunc) scroll_to_bottom, textview); } } static void remove_timeout (GtkWidget *window, gpointer timeout) { g_source_remove (GPOINTER_TO_UINT (timeout)); } static void create_text_view (GtkWidget *hbox, gboolean to_end) { GtkWidget *swindow; GtkWidget *textview; guint timeout; swindow = gtk_scrolled_window_new (NULL, NULL); gtk_box_pack_start (GTK_BOX (hbox), swindow, TRUE, TRUE, 0); textview = gtk_text_view_new (); gtk_container_add (GTK_CONTAINER (swindow), textview); timeout = setup_scroll (GTK_TEXT_VIEW (textview), to_end); /* Remove the timeout in destroy handler, so we don't try to * scroll destroyed widget. */ g_signal_connect (textview, "destroy", G_CALLBACK (remove_timeout), GUINT_TO_POINTER (timeout)); } GtkWidget * do_textscroll (GtkWidget *do_widget) { static GtkWidget *window = NULL; if (!window) { GtkWidget *hbox; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_window_set_default_size (GTK_WINDOW (window), 600, 400); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE); gtk_container_add (GTK_CONTAINER (window), hbox); create_text_view (hbox, TRUE); create_text_view (hbox, FALSE); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else gtk_widget_destroy (window); return window; } (uuay)gnu-keys.png PNG  IHDR00WgAMA aIDATxkt]e゙[rr-M&i4IoŦC;DgPQTTguleP^Ҧ-msk~9Im}y|)̗:~yy}.qK\2C^Fd"弋Kt᪵UrL+ͷRu-YVV^zU+W (=ݽo `L-(`Fy9&NaYV왳vmۏ:/L/zefB01o2jy_8Pϱup H)B0qm_[ ȿV;@V(\{^fr(6 IG{x3cKս( *H$|)T4h?]ȂeneY9kjx4Jbd+W^y%լhB L  [|aIl2F~~+&OG @Uө|A< _ 8nSOn$I1UfV^~<`wn~ t4'8͞-ZXYyށT{߽ۿ_qǎR\RȬJ Il[8y%e^UQ5Mc_EVvϕxK"yn /﮻iK,554k>+cY=\mOw0 xmO~/P Be``}r!ʊ)- 3blя[i%hF*$LcuTcP⒊;>u{)j0%yyB` p㉸퇿]WWWwBǁQ`rJn'7†jB4E4Lo߫4kp$/w]MP5b$q|tb嗱kҲr=elt_="GeG7tM0M'߽;~rt]G"IA4¡0hhlzFF 3:$ccc$IFc8z9zG BB&Mرc<.馛)/+W||f9pEQP <.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.$邕}(8ˆLKzk}}^o| Ǟ{_꺎ii J ib)2 ,S)Ұt+N9voinʲhF ,Q*WɃYӻ໱/ ,QT$uMes;B6x@Ldp edY)2cPUwH2xId Y\'N*$2YzRra/ۥ'}x"K3,#R,,f4%C|&+!4#R$EcyI(Wpz`Rӿ*2 {AަXS#it2EDa@xv| €(KӘ$Iӄ4MIqyxq7/ӱ]TMR.?݌mj8ꮰQݕw\s|}K" C(&j54z^z;Flj☡a\Ͽ/xAډHdOA@{xظݱpm ױ|;>( g}}3gޣ^gV\,rIݮ= +]iE!Bs=_feNt=/~SJ uD*] U(Cǧ/ֱ]xg"e]iJr|qXZ\4?ȓ?JLN& >]CܵGf׮a'2,bychl!{>A!I8V==X6M�{8*f9 xWJ%Iqˬ?ÿ4X= I,ϒ)aF1AA1iS2M8V#lľW_}N`nvCCyȲ Ο'==? ʪ!q#2%äJozw}yusl^[[[a RNZ1l{ &'%BR 45$&Ŭq% $ } ZZ\4c>{`˲fFFF5A (lvnzSo}͖mwszr;BAk*"$ i"+2*aP_K˫/ߚ8juj'F!%{T;%IUUZa*W):r0體 RVjhɩ19nZoO>.^n(HpZFFmfQ{l CM쯡j*#JwKt72y?\v♶ ' m멅# V,ˆg C3TEsuM!YQU)#m+_܈?%! @C^>kR(uc3e՞]lA_x)n/o+uhZQ`Q,<liOU cg7yA|527]B9p @xq bo?ڧE~p{ ցtc Ř5.a[A}/ ef b\GYD@6$-<E/E,E=<VD8q//.!<+dM`PV<}Cvwb}HB&*za+9B{z4zQ$Pr8C7ze^)|oթ {y շX~o$QajmӢ "EBbxvPZs|EkS؎%_X{.^52* @NwBhJiO{]XdZ8'Z O YG2Ad;@zooAkIENDB`(uuay)offscreen_window2.c|E/* Offscreen Windows/Effects * * Offscreen windows can be used to render elements multiple times to achieve * various effects. */ #include #include #define GTK_TYPE_MIRROR_BIN (gtk_mirror_bin_get_type ()) #define GTK_MIRROR_BIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MIRROR_BIN, GtkMirrorBin)) #define GTK_MIRROR_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MIRROR_BIN, GtkMirrorBinClass)) #define GTK_IS_MIRROR_BIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MIRROR_BIN)) #define GTK_IS_MIRROR_BIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MIRROR_BIN)) #define GTK_MIRROR_BIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MIRROR_BIN, GtkMirrorBinClass)) typedef struct _GtkMirrorBin GtkMirrorBin; typedef struct _GtkMirrorBinClass GtkMirrorBinClass; struct _GtkMirrorBin { GtkContainer container; GtkWidget *child; GdkWindow *offscreen_window; }; struct _GtkMirrorBinClass { GtkContainerClass parent_class; }; GType gtk_mirror_bin_get_type (void) G_GNUC_CONST; GtkWidget* gtk_mirror_bin_new (void); /*** implementation ***/ static void gtk_mirror_bin_realize (GtkWidget *widget); static void gtk_mirror_bin_unrealize (GtkWidget *widget); static void gtk_mirror_bin_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural); static void gtk_mirror_bin_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural); static void gtk_mirror_bin_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static gboolean gtk_mirror_bin_damage (GtkWidget *widget, GdkEventExpose *event); static gboolean gtk_mirror_bin_draw (GtkWidget *widget, cairo_t *cr); static void gtk_mirror_bin_add (GtkContainer *container, GtkWidget *child); static void gtk_mirror_bin_remove (GtkContainer *container, GtkWidget *widget); static void gtk_mirror_bin_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); static GType gtk_mirror_bin_child_type (GtkContainer *container); G_DEFINE_TYPE (GtkMirrorBin, gtk_mirror_bin, GTK_TYPE_CONTAINER); static void to_child (GtkMirrorBin *bin, double widget_x, double widget_y, double *x_out, double *y_out) { *x_out = widget_x; *y_out = widget_y; } static void to_parent (GtkMirrorBin *bin, double offscreen_x, double offscreen_y, double *x_out, double *y_out) { *x_out = offscreen_x; *y_out = offscreen_y; } static void gtk_mirror_bin_class_init (GtkMirrorBinClass *klass) { GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass); widget_class->realize = gtk_mirror_bin_realize; widget_class->unrealize = gtk_mirror_bin_unrealize; widget_class->get_preferred_width = gtk_mirror_bin_get_preferred_width; widget_class->get_preferred_height = gtk_mirror_bin_get_preferred_height; widget_class->size_allocate = gtk_mirror_bin_size_allocate; widget_class->draw = gtk_mirror_bin_draw; g_signal_override_class_closure (g_signal_lookup ("damage-event", GTK_TYPE_WIDGET), GTK_TYPE_MIRROR_BIN, g_cclosure_new (G_CALLBACK (gtk_mirror_bin_damage), NULL, NULL)); container_class->add = gtk_mirror_bin_add; container_class->remove = gtk_mirror_bin_remove; container_class->forall = gtk_mirror_bin_forall; container_class->child_type = gtk_mirror_bin_child_type; } static void gtk_mirror_bin_init (GtkMirrorBin *bin) { gtk_widget_set_has_window (GTK_WIDGET (bin), TRUE); } GtkWidget * gtk_mirror_bin_new (void) { return g_object_new (GTK_TYPE_MIRROR_BIN, NULL); } static GdkWindow * pick_offscreen_child (GdkWindow *offscreen_window, double widget_x, double widget_y, GtkMirrorBin *bin) { GtkAllocation child_area; double x, y; if (bin->child && gtk_widget_get_visible (bin->child)) { to_child (bin, widget_x, widget_y, &x, &y); gtk_widget_get_allocation (bin->child, &child_area); if (x >= 0 && x < child_area.width && y >= 0 && y < child_area.height) return bin->offscreen_window; } return NULL; } static void offscreen_window_to_parent (GdkWindow *offscreen_window, double offscreen_x, double offscreen_y, double *parent_x, double *parent_y, GtkMirrorBin *bin) { to_parent (bin, offscreen_x, offscreen_y, parent_x, parent_y); } static void offscreen_window_from_parent (GdkWindow *window, double parent_x, double parent_y, double *offscreen_x, double *offscreen_y, GtkMirrorBin *bin) { to_child (bin, parent_x, parent_y, offscreen_x, offscreen_y); } static void gtk_mirror_bin_realize (GtkWidget *widget) { GtkMirrorBin *bin = GTK_MIRROR_BIN (widget); GtkAllocation allocation; GtkStyleContext *context; GdkWindow *window; GdkWindowAttr attributes; gint attributes_mask; guint border_width; GtkRequisition child_requisition; gtk_widget_set_realized (widget, TRUE); gtk_widget_get_allocation (widget, &allocation); border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); attributes.x = allocation.x + border_width; attributes.y = allocation.y + border_width; attributes.width = allocation.width - 2 * border_width; attributes.height = allocation.height - 2 * border_width; attributes.window_type = GDK_WINDOW_CHILD; attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK | GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_SCROLL_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK; attributes.visual = gtk_widget_get_visual (widget); attributes.wclass = GDK_INPUT_OUTPUT; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask); gtk_widget_set_window (widget, window); gdk_window_set_user_data (window, widget); g_signal_connect (window, "pick-embedded-child", G_CALLBACK (pick_offscreen_child), bin); attributes.window_type = GDK_WINDOW_OFFSCREEN; child_requisition.width = child_requisition.height = 0; if (bin->child && gtk_widget_get_visible (bin->child)) { GtkAllocation child_allocation; gtk_widget_get_allocation (bin->child, &child_allocation); attributes.width = child_allocation.width; attributes.height = child_allocation.height; } bin->offscreen_window = gdk_window_new (gdk_screen_get_root_window (gtk_widget_get_screen (widget)), &attributes, attributes_mask); gdk_window_set_user_data (bin->offscreen_window, widget); if (bin->child) gtk_widget_set_parent_window (bin->child, bin->offscreen_window); gdk_offscreen_window_set_embedder (bin->offscreen_window, window); g_signal_connect (bin->offscreen_window, "to-embedder", G_CALLBACK (offscreen_window_to_parent), bin); g_signal_connect (bin->offscreen_window, "from-embedder", G_CALLBACK (offscreen_window_from_parent), bin); context = gtk_widget_get_style_context (widget); gtk_style_context_set_background (context, window); gtk_style_context_set_background (context, bin->offscreen_window); gdk_window_show (bin->offscreen_window); } static void gtk_mirror_bin_unrealize (GtkWidget *widget) { GtkMirrorBin *bin = GTK_MIRROR_BIN (widget); gdk_window_set_user_data (bin->offscreen_window, NULL); gdk_window_destroy (bin->offscreen_window); bin->offscreen_window = NULL; GTK_WIDGET_CLASS (gtk_mirror_bin_parent_class)->unrealize (widget); } static GType gtk_mirror_bin_child_type (GtkContainer *container) { GtkMirrorBin *bin = GTK_MIRROR_BIN (container); if (bin->child) return G_TYPE_NONE; return GTK_TYPE_WIDGET; } static void gtk_mirror_bin_add (GtkContainer *container, GtkWidget *widget) { GtkMirrorBin *bin = GTK_MIRROR_BIN (container); if (!bin->child) { gtk_widget_set_parent_window (widget, bin->offscreen_window); gtk_widget_set_parent (widget, GTK_WIDGET (bin)); bin->child = widget; } else g_warning ("GtkMirrorBin cannot have more than one child\n"); } static void gtk_mirror_bin_remove (GtkContainer *container, GtkWidget *widget) { GtkMirrorBin *bin = GTK_MIRROR_BIN (container); gboolean was_visible; was_visible = gtk_widget_get_visible (widget); if (bin->child == widget) { gtk_widget_unparent (widget); bin->child = NULL; if (was_visible && gtk_widget_get_visible (GTK_WIDGET (container))) gtk_widget_queue_resize (GTK_WIDGET (container)); } } static void gtk_mirror_bin_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data) { GtkMirrorBin *bin = GTK_MIRROR_BIN (container); g_return_if_fail (callback != NULL); if (bin->child) (*callback) (bin->child, callback_data); } static void gtk_mirror_bin_size_request (GtkWidget *widget, GtkRequisition *requisition) { GtkMirrorBin *bin = GTK_MIRROR_BIN (widget); GtkRequisition child_requisition; guint border_width; child_requisition.width = 0; child_requisition.height = 0; if (bin->child && gtk_widget_get_visible (bin->child)) gtk_widget_get_preferred_size ( (bin->child), &child_requisition, NULL); border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); requisition->width = border_width * 2 + child_requisition.width + 10; requisition->height = border_width * 2 + child_requisition.height * 2 + 10; } static void gtk_mirror_bin_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) { GtkRequisition requisition; gtk_mirror_bin_size_request (widget, &requisition); *minimum = *natural = requisition.width; } static void gtk_mirror_bin_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) { GtkRequisition requisition; gtk_mirror_bin_size_request (widget, &requisition); *minimum = *natural = requisition.width; } static void gtk_mirror_bin_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkMirrorBin *bin = GTK_MIRROR_BIN (widget); gint w, h; guint border_width; gtk_widget_set_allocation (widget, allocation); border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); w = allocation->width - border_width * 2; h = allocation->height - border_width * 2; if (gtk_widget_get_realized (widget)) gdk_window_move_resize (gtk_widget_get_window (widget), allocation->x + border_width, allocation->y + border_width, w, h); if (bin->child && gtk_widget_get_visible (bin->child)) { GtkRequisition child_requisition; GtkAllocation child_allocation; gtk_widget_get_preferred_size (bin->child, &child_requisition, NULL); child_allocation.x = 0; child_allocation.y = 0; child_allocation.height = child_requisition.height; child_allocation.width = child_requisition.width; if (gtk_widget_get_realized (widget)) gdk_window_move_resize (bin->offscreen_window, allocation->x + border_width, allocation->y + border_width, child_allocation.width, child_allocation.height); gtk_widget_size_allocate (bin->child, &child_allocation); } } static gboolean gtk_mirror_bin_damage (GtkWidget *widget, GdkEventExpose *event) { gdk_window_invalidate_rect (gtk_widget_get_window (widget), NULL, FALSE); return TRUE; } static gboolean gtk_mirror_bin_draw (GtkWidget *widget, cairo_t *cr) { GtkMirrorBin *bin = GTK_MIRROR_BIN (widget); GdkWindow *window; window = gtk_widget_get_window (widget); if (gtk_cairo_should_draw_window (cr, window)) { cairo_surface_t *surface; cairo_matrix_t matrix; cairo_pattern_t *mask; int height; if (bin->child && gtk_widget_get_visible (bin->child)) { surface = gdk_offscreen_window_get_surface (bin->offscreen_window); height = gdk_window_get_height (bin->offscreen_window); /* paint the offscreen child */ cairo_set_source_surface (cr, surface, 0, 0); cairo_paint (cr); cairo_matrix_init (&matrix, 1.0, 0.0, 0.3, 1.0, 0.0, 0.0); cairo_matrix_scale (&matrix, 1.0, -1.0); cairo_matrix_translate (&matrix, -10, - 3 * height - 10); cairo_transform (cr, &matrix); cairo_set_source_surface (cr, surface, 0, height); /* create linear gradient as mask-pattern to fade out the source */ mask = cairo_pattern_create_linear (0.0, height, 0.0, 2*height); cairo_pattern_add_color_stop_rgba (mask, 0.0, 0.0, 0.0, 0.0, 0.0); cairo_pattern_add_color_stop_rgba (mask, 0.25, 0.0, 0.0, 0.0, 0.01); cairo_pattern_add_color_stop_rgba (mask, 0.5, 0.0, 0.0, 0.0, 0.25); cairo_pattern_add_color_stop_rgba (mask, 0.75, 0.0, 0.0, 0.0, 0.5); cairo_pattern_add_color_stop_rgba (mask, 1.0, 0.0, 0.0, 0.0, 1.0); /* paint the reflection */ cairo_mask (cr, mask); cairo_pattern_destroy (mask); } } else if (gtk_cairo_should_draw_window (cr, bin->offscreen_window)) { gtk_render_background (gtk_widget_get_style_context (widget), cr, 0, 0, gdk_window_get_width (bin->offscreen_window), gdk_window_get_height (bin->offscreen_window)); if (bin->child) gtk_container_propagate_draw (GTK_CONTAINER (widget), bin->child, cr); } return FALSE; } /*** ***/ static GtkWidget *window = NULL; GtkWidget * do_offscreen_window2 (GtkWidget *do_widget) { if (!window) { GtkWidget *bin, *vbox; GtkWidget *hbox, *entry, *applybutton, *backbutton; GtkSizeGroup *group; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Effects"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_container_set_border_width (GTK_CONTAINER (window), 10); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); bin = gtk_mirror_bin_new (); group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); backbutton = gtk_button_new (); gtk_container_add (GTK_CONTAINER (backbutton), gtk_image_new_from_icon_name ("go-previous", 4)); gtk_size_group_add_widget (group, backbutton); entry = gtk_entry_new (); gtk_size_group_add_widget (group, entry); applybutton = gtk_button_new_with_label (_("Apply")); gtk_size_group_add_widget (group, applybutton); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_box_pack_start (GTK_BOX (vbox), bin, TRUE, TRUE, 0); gtk_container_add (GTK_CONTAINER (bin), hbox); gtk_box_pack_start (GTK_BOX (hbox), backbutton, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), applybutton, FALSE, FALSE, 0); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)application.uih horizontal fill True document-open application-exit app.quit 0 0 True fill True True True fill True center _OK True 0 1 in fill fill True True 0 2 fill True True 0 3 File1 win.file1 (uuay)iconview/(Wcss_basics.c/* CSS Theming/CSS Basics * * Gtk themes are written using CSS. Every widget is build of multiple items * that you can style very similarly to a regular website. * */ #include static GtkWidget *window = NULL; static void show_parsing_error (GtkCssProvider *provider, GtkCssSection *section, const GError *error, GtkTextBuffer *buffer) { GtkTextIter start, end; const char *tag_name; gtk_text_buffer_get_iter_at_line_index (buffer, &start, gtk_css_section_get_start_line (section), gtk_css_section_get_start_position (section)); gtk_text_buffer_get_iter_at_line_index (buffer, &end, gtk_css_section_get_end_line (section), gtk_css_section_get_end_position (section)); if (g_error_matches (error, GTK_CSS_PROVIDER_ERROR, GTK_CSS_PROVIDER_ERROR_DEPRECATED)) tag_name = "warning"; else tag_name = "error"; gtk_text_buffer_apply_tag_by_name (buffer, tag_name, &start, &end); } static void css_text_changed (GtkTextBuffer *buffer, GtkCssProvider *provider) { GtkTextIter start, end; char *text; gtk_text_buffer_get_start_iter (buffer, &start); gtk_text_buffer_get_end_iter (buffer, &end); gtk_text_buffer_remove_all_tags (buffer, &start, &end); text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE); gtk_css_provider_load_from_data (provider, text, -1, NULL); g_free (text); gtk_style_context_reset_widgets (gdk_screen_get_default ()); } static void apply_css (GtkWidget *widget, GtkStyleProvider *provider) { gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT); if (GTK_IS_CONTAINER (widget)) gtk_container_forall (GTK_CONTAINER (widget), (GtkCallback) apply_css, provider); } GtkWidget * do_css_basics (GtkWidget *do_widget) { if (!window) { GtkWidget *container, *child; GtkStyleProvider *provider; GtkTextBuffer *text; GBytes *bytes; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget)); gtk_window_set_default_size (GTK_WINDOW (window), 400, 300); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); text = gtk_text_buffer_new (NULL); gtk_text_buffer_create_tag (text, "warning", "underline", PANGO_UNDERLINE_SINGLE, NULL); gtk_text_buffer_create_tag (text, "error", "underline", PANGO_UNDERLINE_ERROR, NULL); provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ()); container = gtk_scrolled_window_new (NULL, NULL); gtk_container_add (GTK_CONTAINER (window), container); child = gtk_text_view_new_with_buffer (text); gtk_container_add (GTK_CONTAINER (container), child); g_signal_connect (text, "changed", G_CALLBACK (css_text_changed), provider); bytes = g_resources_lookup_data ("/css_basics/css_basics.css", 0, NULL); gtk_text_buffer_set_text (text, g_bytes_get_data (bytes, NULL), g_bytes_get_size (bytes)); g_bytes_unref (bytes); g_signal_connect (provider, "parsing-error", G_CALLBACK (show_parsing_error), gtk_text_view_get_buffer (GTK_TEXT_VIEW (child))); apply_css (window, provider); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)panes.cX/* Paned Widgets * * The GtkHPaned and GtkVPaned Widgets divide their content * area into two panes with a divider in between that the * user can adjust. A separate child is placed into each * pane. * * There are a number of options that can be set for each pane. * This test contains both a horizontal (HPaned) and a vertical * (VPaned) widget, and allows you to adjust the options for * each side of each widget. */ #include void toggle_resize (GtkWidget *widget, GtkWidget *child) { GtkWidget *parent; GtkPaned *paned; gboolean is_child1; gboolean resize, shrink; parent = gtk_widget_get_parent (child); paned = GTK_PANED (parent); is_child1 = (child == gtk_paned_get_child1 (paned)); gtk_container_child_get (GTK_CONTAINER (paned), child, "resize", &resize, "shrink", &shrink, NULL); g_object_ref (child); gtk_container_remove (GTK_CONTAINER (parent), child); if (is_child1) gtk_paned_pack1 (paned, child, !resize, shrink); else gtk_paned_pack2 (paned, child, !resize, shrink); g_object_unref (child); } void toggle_shrink (GtkWidget *widget, GtkWidget *child) { GtkWidget *parent; GtkPaned *paned; gboolean is_child1; gboolean resize, shrink; parent = gtk_widget_get_parent (child); paned = GTK_PANED (parent); is_child1 = (child == gtk_paned_get_child1 (paned)); gtk_container_child_get (GTK_CONTAINER (paned), child, "resize", &resize, "shrink", &shrink, NULL); g_object_ref (child); gtk_container_remove (GTK_CONTAINER (parent), child); if (is_child1) gtk_paned_pack1 (paned, child, resize, !shrink); else gtk_paned_pack2 (paned, child, resize, !shrink); g_object_unref (child); } GtkWidget * create_pane_options (GtkPaned *paned, const gchar *frame_label, const gchar *label1, const gchar *label2) { GtkWidget *child1, *child2; GtkWidget *frame; GtkWidget *table; GtkWidget *label; GtkWidget *check_button; child1 = gtk_paned_get_child1 (paned); child2 = gtk_paned_get_child2 (paned); frame = gtk_frame_new (frame_label); gtk_container_set_border_width (GTK_CONTAINER (frame), 4); table = gtk_grid_new (); gtk_container_add (GTK_CONTAINER (frame), table); label = gtk_label_new (label1); gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1); check_button = gtk_check_button_new_with_mnemonic ("_Resize"); gtk_grid_attach (GTK_GRID (table), check_button, 0, 1, 1, 1); g_signal_connect (check_button, "toggled", G_CALLBACK (toggle_resize), child1); check_button = gtk_check_button_new_with_mnemonic ("_Shrink"); gtk_grid_attach (GTK_GRID (table), check_button, 0, 2, 1, 1); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE); g_signal_connect (check_button, "toggled", G_CALLBACK (toggle_shrink), child1); label = gtk_label_new (label2); gtk_grid_attach (GTK_GRID (table), label, 1, 0, 1, 1); check_button = gtk_check_button_new_with_mnemonic ("_Resize"); gtk_grid_attach (GTK_GRID (table), check_button, 1, 1, 1, 1); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE); g_signal_connect (check_button, "toggled", G_CALLBACK (toggle_resize), child2); check_button = gtk_check_button_new_with_mnemonic ("_Shrink"); gtk_grid_attach (GTK_GRID (table), check_button, 1, 2, 1, 1); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button), TRUE); g_signal_connect (check_button, "toggled", G_CALLBACK (toggle_shrink), child2); return frame; } GtkWidget * do_panes (GtkWidget *do_widget) { static GtkWidget *window = NULL; GtkWidget *frame; GtkWidget *hpaned; GtkWidget *vpaned; GtkWidget *button; GtkWidget *vbox; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_window_set_title (GTK_WINDOW (window), "Panes"); gtk_container_set_border_width (GTK_CONTAINER (window), 0); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), vbox); vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL); gtk_box_pack_start (GTK_BOX (vbox), vpaned, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER(vpaned), 5); hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); gtk_paned_add1 (GTK_PANED (vpaned), hpaned); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN); gtk_widget_set_size_request (frame, 60, 60); gtk_paned_add1 (GTK_PANED (hpaned), frame); button = gtk_button_new_with_mnemonic ("_Hi there"); gtk_container_add (GTK_CONTAINER(frame), button); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN); gtk_widget_set_size_request (frame, 80, 60); gtk_paned_add2 (GTK_PANED (hpaned), frame); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN); gtk_widget_set_size_request (frame, 60, 80); gtk_paned_add2 (GTK_PANED (vpaned), frame); /* Now create toggle buttons to control sizing */ gtk_box_pack_start (GTK_BOX (vbox), create_pane_options (GTK_PANED (hpaned), "Horizontal", "Left", "Right"), FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), create_pane_options (GTK_PANED (vpaned), "Vertical", "Top", "Bottom"), FALSE, FALSE, 0); gtk_widget_show_all (vbox); } if (!gtk_widget_get_visible (window)) { gtk_widget_show (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)css_multiplebgs.css/* You can edit the text in this window to change the * appearance of this Window. * Be careful, if you screw it up, nothing might be visible * anymore. :) */ /* This CSS resets all properties to their defaults values * and overrides all user settings and the theme in use */ @import url("resource://css_multiplebgs/reset.css"); @import url("resource://css_multiplebgs/cssview.css"); #canvas { transition-property: background-color, background-image; transition-duration: 0.5s; background-color: #4870bc; } /* The gradients below are adapted versions of Lea Verou's CSS3 patterns, * licensed under the MIT license: * Copyright (c) 2011 Lea Verou, http://lea.verou.me/ * * See https://github.com/LeaVerou/CSS3-Patterns-Gallery */ /********** * Bricks * **********/ /* @define-color brick_hi #d42; @define-color brick_lo #b42; @define-color brick_hi_backdrop #888; @define-color brick_lo_backdrop #999; #canvas { background-color: #999; background-image: linear-gradient(205deg, @brick_lo, @brick_lo 23px, transparent 23px), linear-gradient(25deg, @brick_hi, @brick_hi 23px, transparent 23px), linear-gradient(205deg, @brick_lo, @brick_lo 23px, transparent 23px), linear-gradient(25deg, @brick_hi, @brick_hi 23px, transparent 23px); background-size: 58px 58px; background-position: 0px 6px, 4px 31px, 29px 35px, 34px 2px; } #canvas:backdrop { background-color: #444; background-image: linear-gradient(205deg, @brick_lo_backdrop, @brick_lo_backdrop 23px, transparent 23px), linear-gradient(25deg, @brick_hi_backdrop, @brick_hi_backdrop 23px, transparent 23px), linear-gradient(205deg, @brick_lo_backdrop, @brick_lo_backdrop 23px, transparent 23px), linear-gradient(25deg, @brick_hi_backdrop, @brick_hi_backdrop 23px, transparent 23px); background-size: 58px 58px; background-position: 0px 6px, 4px 31px, 29px 35px, 34px 2px; } */ /* #bricks-button { background-color: #eef; background-image: -gtk-scaled(url('resource:///css_multiplebgs/brick.png'),url('resource:///css_multiplebgs/brick2.png')); background-repeat: no-repeat; background-position: center; } */ /********** * Tartan * **********/ /* @define-color tartan_bg #662e2c; @define-color tartan_bg_backdrop #333; #canvas { background-color: @tartan_bg; background-image: repeating-linear-gradient(transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px), repeating-linear-gradient(90deg, transparent, transparent 50px, rgba(0,0,0,.4) 50px, rgba(0,0,0,.4) 53px, transparent 53px, transparent 63px, rgba(0,0,0,.4) 63px, rgba(0,0,0,.4) 66px, transparent 66px, transparent 116px, rgba(0,0,0,.5) 116px, rgba(0,0,0,.5) 166px, rgba(255,255,255,.2) 166px, rgba(255,255,255,.2) 169px, rgba(0,0,0,.5) 169px, rgba(0,0,0,.5) 179px, rgba(255,255,255,.2) 179px, rgba(255,255,255,.2) 182px, rgba(0,0,0,.5) 182px, rgba(0,0,0,.5) 232px, transparent 232px), repeating-linear-gradient(-55deg, transparent, transparent 1px, rgba(0,0,0,.2) 1px, rgba(0,0,0,.2) 4px, transparent 4px, transparent 19px, rgba(0,0,0,.2) 19px, rgba(0,0,0,.2) 24px, transparent 24px, transparent 51px, rgba(0,0,0,.2) 51px, rgba(0,0,0,.2) 54px, transparent 54px, transparent 74px); } #canvas:backdrop { background-color: @tartan_bg_backdrop; } */ /*********** * Stripes * ***********/ /* @define-color base_bg #4870bc; @define-color backdrop_bg #555; #canvas { background-color: @base_bg; background-image: linear-gradient(to left, transparent, rgba(255,255,255,.07) 50%, transparent 50%), linear-gradient(to left, transparent, rgba(255,255,255,.13) 50%, transparent 50%), linear-gradient(to left, transparent, transparent 50%, rgba(255,255,255,.17) 50%), linear-gradient(to left, transparent, transparent 50%, rgba(255,255,255,.19) 50%); background-size: 29px, 59px, 73px, 109px; } #canvas:backdrop { background-color: @backdrop_bg; } */ /*************** * Lined Paper * ***************/ /* #canvas { background-color: #fff; background-image: linear-gradient(90deg, transparent 79px, alpha(#f98195, 0.40) 79px, #f98195 80px, alpha(#f98195, 0.40) 81px, transparent 81px), linear-gradient(alpha(#77c5cf, 0.60), alpha(#77c5cf, 0.60) 1px, transparent 1px); background-size: 100% 36px; } #canvas:backdrop { background-color: #f1f2f4; background-image: linear-gradient(90deg, transparent 79px, alpha(#999, 0.40) 79px, #999 80px, alpha(#999, 0.40) 81px, transparent 81px), linear-gradient(alpha(#bbb, 0.60), alpha(#bbb, 0.60) 1px, transparent 1px); } */ (uuay)expander.c /* Expander * * GtkExpander allows to provide additional content that is initially hidden. * This is also known as "disclosure triangle". * */ #include #include static GtkWidget *window = NULL; GtkWidget * do_expander (GtkWidget *do_widget) { GtkWidget *content_area; GtkWidget *vbox; GtkWidget *label; GtkWidget *expander; if (!window) { window = gtk_dialog_new_with_buttons ("GtkExpander", GTK_WINDOW (do_widget), 0, _("_Close"), GTK_RESPONSE_NONE, NULL); gtk_window_set_resizable (GTK_WINDOW (window), FALSE); g_signal_connect (window, "response", G_CALLBACK (gtk_widget_destroy), NULL); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); content_area = gtk_dialog_get_content_area (GTK_DIALOG (window)); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0); gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); label = gtk_label_new ("Expander demo. Click on the triangle for details."); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); /* Create the expander */ expander = gtk_expander_new ("Details"); gtk_box_pack_start (GTK_BOX (vbox), expander, FALSE, FALSE, 0); label = gtk_label_new ("Details can be shown or hidden."); gtk_container_add (GTK_CONTAINER (expander), label); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else gtk_widget_destroy (window); return window; } (uuay)dialog.c/* Dialog and Message Boxes * * Dialog widgets are used to pop up a transient window for user feedback. */ #include #include static GtkWidget *window = NULL; static GtkWidget *entry1 = NULL; static GtkWidget *entry2 = NULL; static void message_dialog_clicked (GtkButton *button, gpointer user_data) { GtkWidget *dialog; static gint i = 1; dialog = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_OK_CANCEL, "This message box has been popped up the following\n" "number of times:"); gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%d", i); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); i++; } static void interactive_dialog_clicked (GtkButton *button, gpointer user_data) { GtkWidget *content_area; GtkWidget *dialog; GtkWidget *hbox; GtkWidget *image; GtkWidget *table; GtkWidget *local_entry1; GtkWidget *local_entry2; GtkWidget *label; gint response; dialog = gtk_dialog_new_with_buttons ("Interactive Dialog", GTK_WINDOW (window), GTK_DIALOG_MODAL| GTK_DIALOG_DESTROY_WITH_PARENT, _("_OK"), GTK_RESPONSE_OK, "_Cancel", GTK_RESPONSE_CANCEL, NULL); content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_container_set_border_width (GTK_CONTAINER (hbox), 8); gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 0); image = gtk_image_new_from_icon_name ("dialog-question", GTK_ICON_SIZE_DIALOG); gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); table = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (table), 4); gtk_grid_set_column_spacing (GTK_GRID (table), 4); gtk_box_pack_start (GTK_BOX (hbox), table, TRUE, TRUE, 0); label = gtk_label_new_with_mnemonic ("_Entry 1"); gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1); local_entry1 = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (local_entry1), gtk_entry_get_text (GTK_ENTRY (entry1))); gtk_grid_attach (GTK_GRID (table), local_entry1, 1, 0, 1, 1); gtk_label_set_mnemonic_widget (GTK_LABEL (label), local_entry1); label = gtk_label_new_with_mnemonic ("E_ntry 2"); gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1); local_entry2 = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (local_entry2), gtk_entry_get_text (GTK_ENTRY (entry2))); gtk_grid_attach (GTK_GRID (table), local_entry2, 1, 1, 1, 1); gtk_label_set_mnemonic_widget (GTK_LABEL (label), local_entry2); gtk_widget_show_all (hbox); response = gtk_dialog_run (GTK_DIALOG (dialog)); if (response == GTK_RESPONSE_OK) { gtk_entry_set_text (GTK_ENTRY (entry1), gtk_entry_get_text (GTK_ENTRY (local_entry1))); gtk_entry_set_text (GTK_ENTRY (entry2), gtk_entry_get_text (GTK_ENTRY (local_entry2))); } gtk_widget_destroy (dialog); } GtkWidget * do_dialog (GtkWidget *do_widget) { GtkWidget *frame; GtkWidget *vbox; GtkWidget *vbox2; GtkWidget *hbox; GtkWidget *button; GtkWidget *table; GtkWidget *label; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Dialogs"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_container_set_border_width (GTK_CONTAINER (window), 8); frame = gtk_frame_new ("Dialogs"); gtk_container_add (GTK_CONTAINER (window), frame); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_container_add (GTK_CONTAINER (frame), vbox); /* Standard message dialog */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); button = gtk_button_new_with_mnemonic ("_Message Dialog"); g_signal_connect (button, "clicked", G_CALLBACK (message_dialog_clicked), NULL); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 0); /* Interactive dialog*/ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); button = gtk_button_new_with_mnemonic ("_Interactive Dialog"); g_signal_connect (button, "clicked", G_CALLBACK (interactive_dialog_clicked), NULL); gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); table = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (table), 4); gtk_grid_set_column_spacing (GTK_GRID (table), 4); gtk_box_pack_start (GTK_BOX (hbox), table, FALSE, FALSE, 0); label = gtk_label_new_with_mnemonic ("_Entry 1"); gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1); entry1 = gtk_entry_new (); gtk_grid_attach (GTK_GRID (table), entry1, 1, 0, 1, 1); gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry1); label = gtk_label_new_with_mnemonic ("E_ntry 2"); gtk_grid_attach (GTK_GRID (table), label, 0, 1, 1, 1); entry2 = gtk_entry_new (); gtk_grid_attach (GTK_GRID (table), entry2, 1, 1, 1, 1); } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)tree_store.cbC/* Tree View/Tree Store * * The GtkTreeStore is used to store data in tree form, to be * used later on by a GtkTreeView to display it. This demo builds * a simple GtkTreeStore and displays it. If you're new to the * GtkTreeView widgets and associates, look into the GtkListStore * example first. * */ #include static GtkWidget *window = NULL; /* TreeItem structure */ typedef struct _TreeItem TreeItem; struct _TreeItem { const gchar *label; gboolean alex; gboolean havoc; gboolean tim; gboolean owen; gboolean dave; gboolean world_holiday; /* shared by the European hackers */ TreeItem *children; }; /* columns */ enum { HOLIDAY_NAME_COLUMN = 0, ALEX_COLUMN, HAVOC_COLUMN, TIM_COLUMN, OWEN_COLUMN, DAVE_COLUMN, VISIBLE_COLUMN, WORLD_COLUMN, NUM_COLUMNS }; /* tree data */ static TreeItem january[] = { {"New Years Day", TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL }, {"Presidential Inauguration", FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, NULL }, {"Martin Luther King Jr. day", FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, NULL }, { NULL } }; static TreeItem february[] = { { "Presidents' Day", FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, NULL }, { "Groundhog Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Valentine's Day", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, NULL }, { NULL } }; static TreeItem march[] = { { "National Tree Planting Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "St Patrick's Day", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, NULL }, { NULL } }; static TreeItem april[] = { { "April Fools' Day", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, NULL }, { "Army Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Earth Day", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, NULL }, { "Administrative Professionals' Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { NULL } }; static TreeItem may[] = { { "Nurses' Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "National Day of Prayer", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Mothers' Day", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, NULL }, { "Armed Forces Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Memorial Day", TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL }, { NULL } }; static TreeItem june[] = { { "June Fathers' Day", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, NULL }, { "Juneteenth (Liberation of Slaves)", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Flag Day", FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, NULL }, { NULL } }; static TreeItem july[] = { { "Parents' Day", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, NULL }, { "Independence Day", FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, NULL }, { NULL } }; static TreeItem august[] = { { "Air Force Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Coast Guard Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Friendship Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { NULL } }; static TreeItem september[] = { { "Grandparents' Day", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, NULL }, { "Citizenship Day or Constitution Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Labor Day", TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL }, { NULL } }; static TreeItem october[] = { { "National Children's Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Bosses' Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Sweetest Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Mother-in-Law's Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Navy Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Columbus Day", FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, NULL }, { "Halloween", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, NULL }, { NULL } }; static TreeItem november[] = { { "Marine Corps Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Veterans' Day", TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL }, { "Thanksgiving", FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, NULL }, { NULL } }; static TreeItem december[] = { { "Pearl Harbor Remembrance Day", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { "Christmas", TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, NULL }, { "Kwanzaa", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL }, { NULL } }; static TreeItem toplevel[] = { {"January", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, january}, {"February", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, february}, {"March", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, march}, {"April", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, april}, {"May", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, may}, {"June", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, june}, {"July", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, july}, {"August", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, august}, {"September", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, september}, {"October", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, october}, {"November", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, november}, {"December", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, december}, {NULL} }; static GtkTreeModel * create_model (void) { GtkTreeStore *model; GtkTreeIter iter; TreeItem *month = toplevel; /* create tree store */ model = gtk_tree_store_new (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); /* add data to the tree store */ while (month->label) { TreeItem *holiday = month->children; gtk_tree_store_append (model, &iter, NULL); gtk_tree_store_set (model, &iter, HOLIDAY_NAME_COLUMN, month->label, ALEX_COLUMN, FALSE, HAVOC_COLUMN, FALSE, TIM_COLUMN, FALSE, OWEN_COLUMN, FALSE, DAVE_COLUMN, FALSE, VISIBLE_COLUMN, FALSE, WORLD_COLUMN, FALSE, -1); /* add children */ while (holiday->label) { GtkTreeIter child_iter; gtk_tree_store_append (model, &child_iter, &iter); gtk_tree_store_set (model, &child_iter, HOLIDAY_NAME_COLUMN, holiday->label, ALEX_COLUMN, holiday->alex, HAVOC_COLUMN, holiday->havoc, TIM_COLUMN, holiday->tim, OWEN_COLUMN, holiday->owen, DAVE_COLUMN, holiday->dave, VISIBLE_COLUMN, TRUE, WORLD_COLUMN, holiday->world_holiday, -1); holiday++; } month++; } return GTK_TREE_MODEL (model); } static void item_toggled (GtkCellRendererToggle *cell, gchar *path_str, gpointer data) { GtkTreeModel *model = (GtkTreeModel *)data; GtkTreePath *path = gtk_tree_path_new_from_string (path_str); GtkTreeIter iter; gboolean toggle_item; gint *column; column = g_object_get_data (G_OBJECT (cell), "column"); /* get toggled iter */ gtk_tree_model_get_iter (model, &iter, path); gtk_tree_model_get (model, &iter, column, &toggle_item, -1); /* do something with the value */ toggle_item ^= 1; /* set new value */ gtk_tree_store_set (GTK_TREE_STORE (model), &iter, column, toggle_item, -1); /* clean up */ gtk_tree_path_free (path); } static void add_columns (GtkTreeView *treeview) { gint col_offset; GtkCellRenderer *renderer; GtkTreeViewColumn *column; GtkTreeModel *model = gtk_tree_view_get_model (treeview); /* column for holiday names */ renderer = gtk_cell_renderer_text_new (); g_object_set (renderer, "xalign", 0.0, NULL); col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, "Holiday", renderer, "text", HOLIDAY_NAME_COLUMN, NULL); column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); /* alex column */ renderer = gtk_cell_renderer_toggle_new (); g_object_set (renderer, "xalign", 0.0, NULL); g_object_set_data (G_OBJECT (renderer), "column", (gint *)ALEX_COLUMN); g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model); col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, "Alex", renderer, "active", ALEX_COLUMN, "visible", VISIBLE_COLUMN, "activatable", WORLD_COLUMN, NULL); column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1); gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); /* havoc column */ renderer = gtk_cell_renderer_toggle_new (); g_object_set (renderer, "xalign", 0.0, NULL); g_object_set_data (G_OBJECT (renderer), "column", (gint *)HAVOC_COLUMN); g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model); col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, "Havoc", renderer, "active", HAVOC_COLUMN, "visible", VISIBLE_COLUMN, NULL); column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1); gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); /* tim column */ renderer = gtk_cell_renderer_toggle_new (); g_object_set (renderer, "xalign", 0.0, NULL); g_object_set_data (G_OBJECT (renderer), "column", (gint *)TIM_COLUMN); g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model); col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, "Tim", renderer, "active", TIM_COLUMN, "visible", VISIBLE_COLUMN, "activatable", WORLD_COLUMN, NULL); column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1); gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); /* owen column */ renderer = gtk_cell_renderer_toggle_new (); g_object_set (renderer, "xalign", 0.0, NULL); g_object_set_data (G_OBJECT (renderer), "column", (gint *)OWEN_COLUMN); g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model); col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, "Owen", renderer, "active", OWEN_COLUMN, "visible", VISIBLE_COLUMN, NULL); column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1); gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); /* dave column */ renderer = gtk_cell_renderer_toggle_new (); g_object_set (renderer, "xalign", 0.0, NULL); g_object_set_data (G_OBJECT (renderer), "column", (gint *)DAVE_COLUMN); g_signal_connect (renderer, "toggled", G_CALLBACK (item_toggled), model); col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview), -1, "Dave", renderer, "active", DAVE_COLUMN, "visible", VISIBLE_COLUMN, NULL); column = gtk_tree_view_get_column (GTK_TREE_VIEW (treeview), col_offset - 1); gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE); } GtkWidget * do_tree_store (GtkWidget *do_widget) { if (!window) { GtkWidget *vbox; GtkWidget *sw; GtkWidget *treeview; GtkTreeModel *model; /* create window, etc */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Card planning sheet"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Jonathan's Holiday Card Planning Sheet"), FALSE, FALSE, 0); sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_ETCHED_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0); /* create model */ model = create_model (); /* create tree view */ treeview = gtk_tree_view_new_with_model (model); g_object_unref (model); gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview)), GTK_SELECTION_MULTIPLE); add_columns (GTK_TREE_VIEW (treeview)); gtk_container_add (GTK_CONTAINER (sw), treeview); /* expand all rows after the treeview widget has been realized */ g_signal_connect (treeview, "realize", G_CALLBACK (gtk_tree_view_expand_all), NULL); gtk_window_set_default_size (GTK_WINDOW (window), 650, 400); } if (!gtk_widget_get_visible (window)) gtk_widget_show_all (window); else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)links.c /* Links * * GtkLabel can show hyperlinks. The default action is to call * gtk_show_uri() on their URI, but it is possible to override * this with a custom handler. */ #include static void response_cb (GtkWidget *dialog, gint response_id, gpointer data) { gtk_widget_destroy (dialog); } static gboolean activate_link (GtkWidget *label, const gchar *uri, gpointer data) { if (g_strcmp0 (uri, "keynav") == 0) { GtkWidget *dialog; GtkWidget *parent; parent = gtk_widget_get_toplevel (label); dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (parent), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "The term keynav is a shorthand for " "keyboard navigation and refers to the process of using " "a program (exclusively) via keyboard input."); gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); gtk_window_present (GTK_WINDOW (dialog)); g_signal_connect (dialog, "response", G_CALLBACK (response_cb), NULL); return TRUE; } return FALSE; } static GtkWidget *window = NULL; GtkWidget * do_links (GtkWidget *do_widget) { GtkWidget *label; if (!window) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Links"); gtk_container_set_border_width (GTK_CONTAINER (window), 12); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); label = gtk_label_new ("Some text may be marked up\n" "as hyperlinks, which can be clicked\n" "or activated via keynav\n" "and they work fine with other markup, like when\n" "searching on " "Go" "og" "le" "."); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); g_signal_connect (label, "activate-link", G_CALLBACK (activate_link), NULL); gtk_container_add (GTK_CONTAINER (window), label); gtk_widget_show (label); } if (!gtk_widget_get_visible (window)) { gtk_widget_show (window); } else { gtk_widget_destroy (window); window = NULL; } return window; } (uuay)gnome-gsame.pngPNG  IHDR00WgAMA1_^IDATxYdWy[{U3ӳ3a0+f1F !HI7x,g~Swoߟk03֫6Y,bMWr?[?;j1񪴜S|zoY|쳷S;s%>sj\3Җ\+A {?+%y2 P/=S .>٘cƘ2j;_ 'VF;k wN;njYo9-dG-ӿw?ӟ=B()9 4&0L.~$%KL(K~| _ѹ|h#B4xۍKx`Fi猆F?Ikm!qcQ%7 BY`x)uJRc|'g8w:{S@6s:.&R0 =y;zRJß[޲t_}&[i؋.YoKU!Ejg;*sf[)y@E ^G٠L^B6v@$9J@YJ@cp@hs;}jP `8V\Ib+~fժR9֘0r#?chEb5USб2wdЙBDEF(ՠ-4ƶu ra"nR͜>Y1U @2q{78asC^,yr\ģ'\kW!WbJCvFdIJjDS2B #l\S8IMJV@]e߳83lu2mu6ZYÿvW녙th6jLLX{wNgy=;wd#lm'Y,}T[ 6NsD:bj^tG)ǟ{Mo󙝇{.[Fxt+(M AElZET'12nF/"QlҜ02J+%Am D)C~l"oKm! dn[yǹOyԣ%!)RjV)5jK)kRJ8L]" i昭nil M3"݄"OZVc6F.[#7UPxSDq[kSkmbst!D@<ߪv:;f4ZG(9Α) /Í#$'eZbkAx>.v^ @^޶ֶMkmZ+1Ba1BITn+$:vgjT3p$(c'h3Mr&&4 HPiz6%t N;jZkT!Xp55afvVhCE4Mb"Ռ7N:!hk3\ Jr$PF;* 6|k1L5!D0?9uY>@1nRIiĒ:6/ʉ Ɉ2ֶhQ8r\g*h^1b!D`E`3U @=v޴V0M "I $ 2.f[ `uu{W[Bkg^ ,hkB$Z;֎$W|?Ԭ7pGjz}أO<,mFWu̥O]{l#3-R=И^ZI+~`6t kur>dZ֒8Ɋ3T̬\3*_;w.6?:p`f9zDgnĮKk)ԆfBXJ Zztx{n޿w5g1IT+dy&,#I0 |$[7 n[H^ѷΏN8%>Zq^sw~) !zvb(pd:H(4IyFRE IZQ=.TZpZ%^+x:򖛿!If)I>3\Gh)cTZ)cGQz@զ2rGKkkHuNIApn˅^R7a@ݡ.QuԽ];vuZ!T}jQNRT+UfXC 0&' B?LKRnsu^\yJ yv~1qFCbðpq1 !B@K)m!)W.|;}?QS 4,JV~ okwN33^zb8)q]Yx2a%b !TVTRqr)egi9#o$4Ea,Q<ׄQ\|+eƽ®z@$GIL/c&J~TN\^VmR1h!e/4OQ ]$q]_x^Dh1'{&o f@&`%4j.)!DF 4n)4ιJڻ0n^@eB'qa_|9?R5-oL Jkgѣ␰4`aaA}l6fxӾVn_LLy^8 +)," }MR]gU/mCCҀ/ \KylA[_/M-uǽv%Jy#҄Dv @tpPKQq?66*y |tKRRUVen~bՊ5.emmqAI}y`=Nm+_ϾNiJg3ޤW e)q+|%Ķ;^s1aIENDB`(uuay)textview/'pixbufs.c/* Pixbufs * * A GdkPixbuf represents an image, normally in RGB or RGBA format. * Pixbufs are normally used to load files from disk and perform * image scaling. * * This demo is not all that educational, but looks cool. It was written * by Extreme Pixbuf Hacker Federico Mena Quintero. It also shows * off how to use GtkDrawingArea to do a simple animation. * * Look at the Image demo for additional pixbuf usage examples. * */ #include #include #include #define BACKGROUND_NAME "/pixbufs/background.jpg" static const char *image_names[] = { "/pixbufs/apple-red.png", "/pixbufs/gnome-applets.png", "/pixbufs/gnome-calendar.png", "/pixbufs/gnome-foot.png", "/pixbufs/gnome-gmush.png", "/pixbufs/gnome-gimp.png", "/pixbufs/gnome-gsame.png", "/pixbufs/gnu-keys.png" }; #define N_IMAGES G_N_ELEMENTS (image_names) /* demo window */ static GtkWidget *window = NULL; /* Current frame */ static GdkPixbuf *frame; /* Background image */ static GdkPixbuf *background; static gint back_width, back_height; /* Images */ static GdkPixbuf *images[N_IMAGES]; /* Widgets */ static GtkWidget *da; /* Loads the images for the demo and returns whether the operation succeeded */ static gboolean load_pixbufs (GError **error) { gint i; if (background) return TRUE; /* already loaded earlier */ background = gdk_pixbuf_new_from_resource (BACKGROUND_NAME, error); if (!background) return FALSE; /* Note that "error" was filled with a GError */ back_width = gdk_pixbuf_get_width (background); back_height = gdk_pixbuf_get_height (background); for (i = 0; i < N_IMAGES; i++) { images[i] = gdk_pixbuf_new_from_resource (image_names[i], error); if (!images[i]) return FALSE; /* Note that "error" was filled with a GError */ } return TRUE; } /* Expose callback for the drawing area */ static gint draw_cb (GtkWidget *widget, cairo_t *cr, gpointer data) { gdk_cairo_set_source_pixbuf (cr, frame, 0, 0); cairo_paint (cr); return TRUE; } #define CYCLE_TIME 3000000 /* 3 seconds */ static gint64 start_time; /* Handler to regenerate the frame */ static gboolean on_tick (GtkWidget *widget, GdkFrameClock *frame_clock, gpointer data) { gint64 current_time; double f; int i; double xmid, ymid; double radius; gdk_pixbuf_copy_area (background, 0, 0, back_width, back_height, frame, 0, 0); if (start_time == 0) start_time = gdk_frame_clock_get_frame_time (frame_clock); current_time = gdk_frame_clock_get_frame_time (frame_clock); f = ((current_time - start_time) % CYCLE_TIME) / (double)CYCLE_TIME; xmid = back_width / 2.0; ymid = back_height / 2.0; radius = MIN (xmid, ymid) / 2.0; for (i = 0; i < N_IMAGES; i++) { double ang; int xpos, ypos; int iw, ih; double r; GdkRectangle r1, r2, dest; double k; ang = 2.0 * G_PI * (double) i / N_IMAGES - f * 2.0 * G_PI; iw = gdk_pixbuf_get_width (images[i]); ih = gdk_pixbuf_get_height (images[i]); r = radius + (radius / 3.0) * sin (f * 2.0 * G_PI); xpos = floor (xmid + r * cos (ang) - iw / 2.0 + 0.5); ypos = floor (ymid + r * sin (ang) - ih / 2.0 + 0.5); k = (i & 1) ? sin (f * 2.0 * G_PI) : cos (f * 2.0 * G_PI); k = 2.0 * k * k; k = MAX (0.25, k); r1.x = xpos; r1.y = ypos; r1.width = iw * k; r1.height = ih * k; r2.x = 0; r2.y = 0; r2.width = back_width; r2.height = back_height; if (gdk_rectangle_intersect (&r1, &r2, &dest)) gdk_pixbuf_composite (images[i], frame, dest.x, dest.y, dest.width, dest.height, xpos, ypos, k, k, GDK_INTERP_NEAREST, ((i & 1) ? MAX (127, fabs (255 * sin (f * 2.0 * G_PI))) : MAX (127, fabs (255 * cos (f * 2.0 * G_PI))))); } gtk_widget_queue_draw (da); return G_SOURCE_CONTINUE; } GtkWidget * do_pixbufs (GtkWidget *do_widget) { if (!window) { GError *error; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Pixbufs"); gtk_window_set_resizable (GTK_WINDOW (window), FALSE); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); error = NULL; if (!load_pixbufs (&error)) { GtkWidget *dialog; dialog = gtk_message_dialog_new (GTK_WINDOW (window), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Failed to load an image: %s", error->message); g_error_free (error); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show (dialog); } else { gtk_widget_set_size_request (window, back_width, back_height); frame = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, back_width, back_height); da = gtk_drawing_area_new (); g_signal_connect (da, "draw", G_CALLBACK (draw_cb), NULL); gtk_container_add (GTK_CONTAINER (window), da); gtk_widget_add_tick_callback (da, on_tick, NULL, NULL); } } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); } else { gtk_widget_destroy (window); window = NULL; g_object_unref (frame); } return window; } (uuay)reset.css/* @import this colorsheet to get the default values for every property. * This is useful when writing special CSS tests that should not be * inluenced by themes - not even the default ones. * Keep in mind that the output will be very ugly and not look like * anything GTK. * Also, when adding new style properties, please add them here. */ * { color: inherit; font-size: inherit; background-color: initial; font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; text-shadow: inherit; icon-shadow: inherit; box-shadow: initial; margin-top: initial; margin-left: initial; margin-bottom: initial; margin-right: initial; padding-top: initial; padding-left: initial; padding-bottom: initial; padding-right: initial; border-top-style: initial; border-top-width: initial; border-left-style: initial; border-left-width: initial; border-bottom-style: initial; border-bottom-width: initial; border-right-style: initial; border-right-width: initial; border-top-left-radius: initial; border-top-right-radius: initial; border-bottom-right-radius: initial; border-bottom-left-radius: initial; outline-style: initial; outline-width: initial; outline-offset: initial; background-clip: initial; background-origin: initial; background-size: initial; background-position: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: initial; outline-color: initial; background-repeat: initial; background-image: initial; border-image-source: initial; border-image-repeat: initial; border-image-slice: initial; border-image-width: initial; transition-property: initial; transition-duration: initial; transition-timing-function: initial; transition-delay: initial; engine: initial; gtk-key-bindings: initial; -GtkWidget-focus-line-width: 0; -GtkWidget-focus-padding: 0; -GtkNotebook-initial-gap: 0; } (uuay)cssview.css/* Make the text editor has a nice style */ .view { color: #2e3436; font: Monospace; background-color: alpha(white, 0.30); } .view:selected { color: white; background-color: #4a90d9; } .scrollbar.trough, .scrollbars-junction { background-color: alpha(white, 0.80); } .scrollbar.slider { border-width: 3px; border-style: solid; border-radius: 10px; border-color: transparent; background-clip: padding-box; background-color: #999; } .scrollbar.slider:prelight { background-color: #555; } .pane-separator { background-color: alpha(white, 0.80); background-image: linear-gradient(transparent, transparent 1px, #999 1px, #999 4px, transparent 4px); background-size: 40px auto; background-repeat: no-repeat; background-position: center; } .pane-separator:prelight { background-image: linear-gradient(transparent, transparent 1px, #555 1px, #555 4px, transparent 4px); } (uuay)pixbufs/bV /MGrflist_store.c*/* Tree View/List Store * * The GtkListStore is used to store data in list form, to be used * later on by a GtkTreeView to display it. This demo builds a * simple GtkListStore and displays it. * */ #include static GtkWidget *window = NULL; static GtkTreeModel *model = NULL; static guint timeout = 0; typedef struct { const gboolean fixed; const guint number; const gchar *severity; const gchar *description; } Bug; enum { COLUMN_FIXED, COLUMN_NUMBER, COLUMN_SEVERITY, COLUMN_DESCRIPTION, COLUMN_PULSE, COLUMN_ICON, COLUMN_ACTIVE, COLUMN_SENSITIVE, NUM_COLUMNS }; static Bug data[] = { { FALSE, 60482, "Normal", "scrollable notebooks and hidden tabs" }, { FALSE, 60620, "Critical", "gdk_window_clear_area (gdkwindow-win32.c) is not thread-safe" }, { FALSE, 50214, "Major", "Xft support does not clean up correctly" }, { TRUE, 52877, "Major", "GtkFileSelection needs a refresh method. " }, { FALSE, 56070, "Normal", "Can't click button after setting in sensitive" }, { TRUE, 56355, "Normal", "GtkLabel - Not all changes propagate correctly" }, { FALSE, 50055, "Normal", "Rework width/height computations for TreeView" }, { FALSE, 58278, "Normal", "gtk_dialog_set_response_sensitive () doesn't work" }, { FALSE, 55767, "Normal", "Getters for all setters" }, { FALSE, 56925, "Normal", "Gtkcalender size" }, { FALSE, 56221, "Normal", "Selectable label needs right-click copy menu" }, { TRUE, 50939, "Normal", "Add shift clicking to GtkTextView" }, { FALSE, 6112, "Enhancement","netscape-like collapsable toolbars" }, { FALSE, 1, "Normal", "First bug :=)" }, }; static gboolean spinner_timeout (gpointer data) { GtkTreeIter iter; guint pulse; if (model == NULL) return G_SOURCE_REMOVE; gtk_tree_model_get_iter_first (model, &iter); gtk_tree_model_get (model, &iter, COLUMN_PULSE, &pulse, -1); if (pulse == G_MAXUINT) pulse = 0; else pulse++; gtk_list_store_set (GTK_LIST_STORE (model), &iter, COLUMN_PULSE, pulse, COLUMN_ACTIVE, TRUE, -1); return G_SOURCE_CONTINUE; } static GtkTreeModel * create_model (void) { gint i = 0; GtkListStore *store; GtkTreeIter iter; /* create list store */ store = gtk_list_store_new (NUM_COLUMNS, G_TYPE_BOOLEAN, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); /* add data to the list store */ for (i = 0; i < G_N_ELEMENTS (data); i++) { gchar *icon_name; gboolean sensitive; if (i == 1 || i == 3) icon_name = "battery-caution-charging-symbolic"; else icon_name = NULL; if (i == 3) sensitive = FALSE; else sensitive = TRUE; gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, COLUMN_FIXED, data[i].fixed, COLUMN_NUMBER, data[i].number, COLUMN_SEVERITY, data[i].severity, COLUMN_DESCRIPTION, data[i].description, COLUMN_PULSE, 0, COLUMN_ICON, icon_name, COLUMN_ACTIVE, FALSE, COLUMN_SENSITIVE, sensitive, -1); } return GTK_TREE_MODEL (store); } static void fixed_toggled (GtkCellRendererToggle *cell, gchar *path_str, gpointer data) { GtkTreeModel *model = (GtkTreeModel *)data; GtkTreeIter iter; GtkTreePath *path = gtk_tree_path_new_from_string (path_str); gboolean fixed; /* get toggled iter */ gtk_tree_model_get_iter (model, &iter, path); gtk_tree_model_get (model, &iter, COLUMN_FIXED, &fixed, -1); /* do something with the value */ fixed ^= 1; /* set new value */ gtk_list_store_set (GTK_LIST_STORE (model), &iter, COLUMN_FIXED, fixed, -1); /* clean up */ gtk_tree_path_free (path); } static void add_columns (GtkTreeView *treeview) { GtkCellRenderer *renderer; GtkTreeViewColumn *column; GtkTreeModel *model = gtk_tree_view_get_model (treeview); /* column for fixed toggles */ renderer = gtk_cell_renderer_toggle_new (); g_signal_connect (renderer, "toggled", G_CALLBACK (fixed_toggled), model); column = gtk_tree_view_column_new_with_attributes ("Fixed?", renderer, "active", COLUMN_FIXED, NULL); /* set this column to a fixed sizing (of 50 pixels) */ gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (column), GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (column), 50); gtk_tree_view_append_column (treeview, column); /* column for bug numbers */ renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes ("Bug number", renderer, "text", COLUMN_NUMBER, NULL); gtk_tree_view_column_set_sort_column_id (column, COLUMN_NUMBER); gtk_tree_view_append_column (treeview, column); /* column for severities */ renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes ("Severity", renderer, "text", COLUMN_SEVERITY, NULL); gtk_tree_view_column_set_sort_column_id (column, COLUMN_SEVERITY); gtk_tree_view_append_column (treeview, column); /* column for description */ renderer = gtk_cell_renderer_text_new (); column = gtk_tree_view_column_new_with_attributes ("Description", renderer, "text", COLUMN_DESCRIPTION, NULL); gtk_tree_view_column_set_sort_column_id (column, COLUMN_DESCRIPTION); gtk_tree_view_append_column (treeview, column); /* column for spinner */ renderer = gtk_cell_renderer_spinner_new (); column = gtk_tree_view_column_new_with_attributes ("Spinning", renderer, "pulse", COLUMN_PULSE, "active", COLUMN_ACTIVE, NULL); gtk_tree_view_column_set_sort_column_id (column, COLUMN_PULSE); gtk_tree_view_append_column (treeview, column); /* column for symbolic icon */ renderer = gtk_cell_renderer_pixbuf_new (); column = gtk_tree_view_column_new_with_attributes ("Symbolic icon", renderer, "icon-name", COLUMN_ICON, "sensitive", COLUMN_SENSITIVE, NULL); gtk_tree_view_column_set_sort_column_id (column, COLUMN_ICON); gtk_tree_view_append_column (treeview, column); } static gboolean window_closed (GtkWidget *widget, GdkEvent *event, gpointer user_data) { model = NULL; window = NULL; if (timeout != 0) { g_source_remove (timeout); timeout = 0; } return FALSE; } GtkWidget * do_list_store (GtkWidget *do_widget) { if (!window) { GtkWidget *vbox; GtkWidget *label; GtkWidget *sw; GtkWidget *treeview; /* create window, etc */ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "GtkListStore demo"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); gtk_container_set_border_width (GTK_CONTAINER (window), 8); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); gtk_container_add (GTK_CONTAINER (window), vbox); label = gtk_label_new ("This is the bug list (note: not based on real data, it would be nice to have a nice ODBC interface to bugzilla or so, though)."); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_ETCHED_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0); /* create tree model */ model = create_model (); /* create tree view */ treeview = gtk_tree_view_new_with_model (model); gtk_tree_view_set_search_column (GTK_TREE_VIEW (treeview), COLUMN_DESCRIPTION); g_object_unref (model); gtk_container_add (GTK_CONTAINER (sw), treeview); /* add columns to the tree view */ add_columns (GTK_TREE_VIEW (treeview)); /* finish & show */ gtk_window_set_default_size (GTK_WINDOW (window), 280, 250); g_signal_connect (window, "delete-event", G_CALLBACK (window_closed), NULL); } if (!gtk_widget_get_visible (window)) { gtk_widget_show_all (window); if (timeout == 0) { /* FIXME this should use the animation-duration instead */ timeout = g_timeout_add (80, spinner_timeout, NULL); } } else { gtk_widget_destroy (window); window = NULL; if (timeout != 0) { g_source_remove (timeout); timeout = 0; } } return window; } (uuay)gnu-keys.png PNG  IHDR00WgAMA aIDATxkt]e゙[rr-M&i4IoŦC;DgPQTTguleP^Ҧ-msk~9Im}y|)̗:~yy}.qK\2C^Fd"弋Kt᪵UrL+ͷRu-YVV^zU+W (=ݽo `L-(`Fy9&NaYV왳vmۏ:/L/zefB01o2jy_8Pϱup H)B0qm_[ ȿV;@V(\{^fr(6 IG{x3cKս( *H$|)T4h?]ȂeneY9kjx4Jbd+W^y%լhB L  [|aIl2F~~+&OG @Uө|A< _ 8nSOn$I1UfV^~<`wn~ t4'8͞-ZXYyށT{߽ۿ_qǎR\RȬJ Il[8y%e^UQ5Mc_EVvϕxK"yn /﮻iK,554k>+cY=\mOw0 xmO~/P Be``}r!ʊ)- 3blя[i%hF*$LcuTcP⒊;>u{)j0%yyB` p㉸퇿]WWWwBǁQ`rJn'7†jB4E4Lo߫4kp$/w]MP5b$q|tb嗱kҲr=elt_="GeG7tM0M'߽;~rt]G"IA4¡0hhlzFF 3:$ccc$IFc8z9zG BB&Mرc<.馛)/+W||f9pEQP <.ӿxb&8ҊoRinm&77Jj-_Ƽy9s4gΝ"JY8R"}qʦa&j`A4Mlذk\k  ԾZolDUUt]_}}RL7^L@G>2EUPu.+ZJBz{zof$6JEE% ;.' ˪g΂HC "Yz@0H__/CA=ơCعs'K,acض͑#u}ctL%Oxɼ@QQQov(G&]]]]Pe1HSPX+0LښhhlॗvHũcH.iiiq,*QUΞսGbYAx|;w$;7p(*斪yϝxd0 x _bf/H_y_|'<9Bcǎ8y3˙;gPs &pl}G3RK v5V>3tZ͆O~7^/f(=>.\wI àa&M/}TM#;+#?EQQ*̟;˗zΎNod*Iii2~n}.**gdh+HOjo.a 7\rY"&6>55<.<ץ-?žp7QZVi o=B:==Xu,KpUܱAR{`?wE 'OP6ן"#QtM! 12CʛKco}wc) R0u #%'4 U?>D"Yy_?? ,kf:ōm[+k&pmTTT,]=[(x3SE_8R88I*"@+_FW\=|v4 ,\W M -郵ugsrm7d mݽ횪BP@(hB;u…5?=x'uyjS_kOYpݡ:+>6M>۾d;O5;{}#6//oY''UTTT3L'lK}ACRJ%A kBg[ԌT4hzo>JhBkVjUSÙL DUU;?vTaYvȡc=gN7=='yiT]m-mV 3KhqCowL&0 NCDz.L\Τ/y۽e˗rsM5.b$ Dcx}k+V.Ng{cC#4y/x'QV]ʫYZZꍌ Y{Q~WRnaswkwD"&w?K\{;$誂IENDB`(uuay)reset.css/* @import this colorsheet to get the default values for every property. * This is useful when writing special CSS tests that should not be * inluenced by themes - not even the default ones. * Keep in mind that the output will be very ugly and not look like * anything GTK. * Also, when adding new style properties, please add them here. */ * { color: inherit; font-size: inherit; background-color: initial; font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; text-shadow: inherit; icon-shadow: inherit; box-shadow: initial; margin-top: initial; margin-left: initial; margin-bottom: initial; margin-right: initial; padding-top: initial; padding-left: initial; padding-bottom: initial; padding-right: initial; border-top-style: initial; border-top-width: initial; border-left-style: initial; border-left-width: initial; border-bottom-style: initial; border-bottom-width: initial; border-right-style: initial; border-right-width: initial; border-top-left-radius: initial; border-top-right-radius: initial; border-bottom-right-radius: initial; border-bottom-left-radius: initial; outline-style: initial; outline-width: initial; outline-offset: initial; background-clip: initial; background-origin: initial; background-size: initial; background-position: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: initial; outline-color: initial; background-repeat: initial; background-image: initial; border-image-source: initial; border-image-repeat: initial; border-image-slice: initial; border-image-width: initial; transition-property: initial; transition-duration: initial; transition-timing-function: initial; transition-delay: initial; engine: initial; gtk-key-bindings: initial; -GtkWidget-focus-line-width: 0; -GtkWidget-focus-padding: 0; -GtkNotebook-initial-gap: 0; } (uuay)popover/glarea/Dgnome-gimp.pngR PNG  IHDR00WgAMA1_ IDATxYk]u>{9w޶gllc#ǯ_Qܹu7up,+ k, !]?w @u ܴry=>ّ/$~IDhxm~Gȱ=fR.w'{ˡC"_"#acv*KDv ܂VK6Wztl0[; . 9<ckGn΍lR;y介~ &/xԙ ~w:$\":An(EFW~#AcR)ĭ4\OKs{&R@*=tӪW|B$BDp-xgp7zK~RH ѢrW\OBy񟟞Ǔ4++ݟ~xWQ,Z`olRZ2-v hJC g@ 0`O\!8 3v3X 0zE_s]^fvy\o<ЦMz^0o-[~ c8ȤDIdR!,j9ic_[6#)fݼaÆm޼!!Dqbb?=ȶKF|/b``{ޏ5kǐJǖ-[ƪP*VR1Z[Jz3WpdTMdldS*wx===m۶GǽfIo&q<?ժxWh~~vi^{m?8رcꫯBJVR R*( h֒Ʊ='20I.gN;HCyQyBvr''=Z vڅF3'`Fm<3={e&$A;IIJ({f0$GV (mb 0V:@rhrrB,_ѣGP,šs@>q߃a֭\SOhnRf}uՙ0l#٩T*-uM08O*ܝ=== fFehZ(J(9ϝ93'0n~i(RJT 8{}Π^  &VfX &fgseג3|߇Ð(Bp hPڇo}+ex~ԅSHJkZm IښU@BfÜ_Lkqaya!mU'mhـ=`6`f,? Vl$j ApY)rԇs1ro}c}ɞi4˲waE{{zz0 Q.GbCZITPy>=erJkLL]TIq3|fnqTux+ֺZT (ðJa I\CYV AAlIHc뚶p2z y5@4<5}nב˦pM?qx^R{dyZIΜG&SHrk@+ĄnNF sqnb}3VZZkRv;[P!`if[`f9;;{xHISiFJ* CiTJ0;W<.^Z@d-(B/Stz@n/5̘jg<9덎]` ۼqL |,H6ՆBT,T*7BO="Sgr0}SK0H3zjSU^uWu~NLW̧0iORIENDB`(uuay)@cK@`K!@Unknown error_matherr(): %s in %s(%g, %g) (retval=%g) Argument domain error (DOMAIN)Argument singularity (SIGN)Overflow range error (OVERFLOW)The result is too small to be represented (UNDERFLOW)Total loss of significance (TLOSS)Partial loss of significance (PLOSS)ZKZK[K$[K\[K[KMingw-w64 runtime failure: Address %p has no image-section VirtualQuery failed for %d bytes at address %p VirtualProtect failed with code 0x%x Unknown pseudo relocation protocol version %d. Unknown pseudo relocation bit size %d. GCC: (GNU) 4.9.1GCC: (GNU) 4.9.2GCC: (GNU) 4.9.2GCC: (GNU) 4.9.2GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.2GCC: (GNU) 4.9.1GCC: (GNU) 4.9.1GCC: (GNU) 4.9.2p } Tr q } r Tq ~ s pq H~ 8s q ~ Ts q 0 s t @#@;`#@txV(@*@'ʹֻ,@K 0@#GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/crtexe.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt@charsize_t{unsigned intintuintptr_twchar_tshort unsigned intlong intlong long intsizetypelong unsigned intunsigned char_EXCEPTION_RECORDP9ExceptionCodeExceptionFlagsExceptionAddressu NumberParametersExceptionInformationzA _CONTEXT+ContextFlags,Dr0-Dr1.Dr2/ Dr30Dr61Dr72FloatSave3'SegGs4SegFs5SegEs6SegDs7Edi9Esi:Ebx;Edx<Ecx=Eax>Ebp?Eip@SegCsAEFlagsBEspCSegSsDExtendedRegistersEB WINBOOLn BYTEzx WORD{ DWORD|cfloat LPBYTE signed charshort intlong long unsigned int LONG_PTR6. ULONG_PTR7c PVOID9CHARLONG.LPSTR7PLONGpHANDLE|9ULONGLONG:EXCEPTION_ROUTINE   u ; uPEXCEPTION_ROUTINE8_FLOATING_SAVE_AREApControlWordStatusWordTagWord ErrorOffset! ErrorSelector"DataOffset#DataSelector$RegisterArea%Cr0NpxState&l'WOFLOATING_SAVE_AREA'>SWCONTEXTFAPCONTEXTHtSdWEXCEPTION_RECORDPEXCEPTION_RECORD_EXCEPTION_POINTERSContextRecordc /Next dprev d_EXCEPTION_REGISTRATION_RECORD d j/ Handler handler  FiberData uVersion _NT_TIB XExceptionList dStackBase uStackLimit uSubSystemTib u ArbitraryUserPointer uSelf XNT_TIB PNT_TIB }^_IMAGE_DOS_HEADER@ e_magice_cblpe_cpe_crlce_cparhdre_minalloc e_maxalloc e_sse_spe_csume_ipe_cse_lfarlce_ovnoe_res e_oemid$e_oeminfo&e_res2 (e_lfanew< W W IMAGE_DOS_HEADERPIMAGE_DOS_HEADER+ _IMAGE_FILE_HEADERK MachineLNumberOfSectionsMTimeDateStampNPointerToSymbolTableONumberOfSymbolsP SizeOfOptionalHeaderQCharacteristicsRIMAGE_FILE_HEADERS1 _IMAGE_DATA_DIRECTORY^ VirtualAddressSizeIMAGE_DATA_DIRECTORY _IMAGE_OPTIONAL_HEADER8 Magic& >+BaseOfData}6 $v(*#,.R0G248h<@ DFHkLPTX\]8 `^ H WIMAGE_OPTIONAL_HEADER32{ PIMAGE_OPTIONAL_HEADER32 { _IMAGE_OPTIONAL_HEADER64:Magic& >+}6 $v(*#,.R0G248h<@ DFHkPX`hl]8 pPIMAGE_OPTIONAL_HEADER64[ _IMAGE_NT_HEADERSSignatureFileHeader OptionalHeaderH PIMAGE_NT_HEADERS32aPIMAGE_NT_HEADERS PIMAGE_TLS_CALLBACK9/ u  u5 D HINSTANCE__hunused HINSTANCEyD PTOP_LEVEL_EXCEPTION_FILTER/ LPTOP_LEVEL_EXCEPTION_FILTER_STARTUPINFOADcb lpReserved!lpDesktop"lpTitle# dwX$dwY%dwXSize&dwYSize'dwXCountChars( dwYCountChars)$dwFillAttribute*(dwFlags+,wShowWindow,0cbReserved2-2lpReserved2. 4hStdInput/8hStdOutput0<hStdError1@ STARTUPINFOA2 STARTUPINFOIKOdouble long doubles _invalid_parameter_handler     tagCOINITBASE COINITBASE_MULTITHREADEDVARENUM VT_EMPTYVT_NULLVT_I2VT_I4VT_R4VT_R8VT_CYVT_DATEVT_BSTRVT_DISPATCH VT_ERROR VT_BOOL VT_VARIANT VT_UNKNOWN VT_DECIMALVT_I1VT_UI1VT_UI2VT_UI4VT_I8VT_UI8VT_INTVT_UINTVT_VOIDVT_HRESULTVT_PTRVT_SAFEARRAYVT_CARRAYVT_USERDEFINEDVT_LPSTRVT_LPWSTRVT_RECORD$VT_INT_PTR%VT_UINT_PTR&VT_FILETIMEVT_BLOBVT_STREAMVT_STORAGEVT_STREAMED_OBJECTVT_STORED_OBJECTVT_BLOB_OBJECTVT_CFVT_CLSIDVT_VERSIONED_STREAMVT_BSTR_BLOBVT_VECTOR VT_ARRAYVT_BYREFVT_RESERVEDVT_ILLEGALVT_ILLEGALMASKEDVT_TYPEMASK _PVFV m _PIFV I newmode _startupinfo  __uninitialized__initializing__initialized _exception {utype |name }uarg1 ~Targ2 Tretval T{_TCHAR __readfsdwordc!Offsetc"retc _InterlockedExchange.!Target!Value. #. _InterlockedCompareExchange.d$!ExChange.$.%_TEB&NtCurrentTebd'InterlockedCompareExchange)())Exchange)()#'InterlockedExchange#)Target#)Value#*duplicate_ppstrings{!ac!av{"avlC"i"nC+"lC,__mingw_invalidParameterHandlerq@ -expressionq-functionr-files-linet -pReservedu.check_managed_app]z"pDOSHeader_ "pPEHeader`"pNTHeader32ah "pNTHeader64b:/pre_c_init~@)0 @12,3?3Q3e@4b@!5t24n@!5t 6@ "4@!5t17 @"8t,pre_cpp_init0@Cz7j@Y"5t`K5t`K5t`K5t`K/__tmainCRTStartup@3~9lpszCommandLine~U:StartupInfo09inDoubleQuote; o9lock_free99fiberid99nested"c?@30@@>>@A@@*>W>F@:B=@XCa>C>81X3N%3ZN3d;pJ3o6o@"4z@"85tw7@"5tw7O@"5tv2$#Cd@ > @Dd@ $>@E@5t E@5tv5t25tv6@"E@8t4@#5t@6@0#6@<#6@F#6@f#40@p#95tO4R@#O8t8t4@#e8t8t6@#Fy@5tuGWinMainCRTStartup@Hret6@#I@zGmainCRTStartup@ Hret6@#I@z:argcK`K:argvQC`K:envpRC`K:argretU`K:mainretV `K:managedappW`K:has_cctorX`K:startinfoY`KJ__globallocalestatusLJ_imp___fmode-QJ_dowildcard4J_newmode nJ_imp____initenv v{J_imp___acmdln {CJ__native_startup_state O#J__native_startup_lock qwKJ_image_base__' J_imp___commode2QJ_fmode1LJ__xi_a:J__xi_z;LJ__xc_a<J__xc_z=J__dyn_tls_init_callback@ J__onexitbeginB8 J__onexitendC8 Jmingw_app_typeEM__mingw_winmain_hInstanceGhdKM__mingw_winmain_lpCmdLineH~dKM__mingw_winmain_nShowCmdI@@J__mingw_oldexcpt_handlerZMmingw_pcinitfKMmingw_pcppinitgKJ_MINGW_INSTALL_DEBUG_MATHERRiNmingw_initltsdrot_forceWNmingw_initltsdyn_forceXNmingw_initltssuo_forceYNmingw_initcharmaxZO__set_app_type ! P_encode_pointer 9 " 9Q_setargv O__mingw_setusermatherr >" >"D" S" S"P__getmainargs " Q { { "Pstrlen6" uRmalloc 9" Smemcpy9" 9  WT_pei386_runtime_relocator\P_set_invalid_parameter_handler t0# tT_fpreset)T__mainLPmain f# C CT_cexit7O_amsg_exit # O_initterm6# 8 8 Uexit 2# T__security_init_cookiei2qGNU C 4.9.2 -mms-bitfields -mtune=generic -march=pentiumpro -g -O2 -fvisibility=hiddenapplication-standalone.c/home/vagrant/ruby-gnome2.win32/gdk3/tmp/windows/gtk+/gtk+-3.16.6/demos/gtk-democharsize_t{unsigned intintshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charsigned charshort intguint32&gint64,*guint64-long long unsigned intgsize;gchar.glong0gint1gboolean2gulong6Sguint7gfloat9Ifloatgdouble:adoublegpointerMGQuark$GError*_GError , domain. code/ 50 GData$ _GDataGList% _GList 'A data)k next*A prev+AS long doubleGVariant "~ _GVariantnGType ~GValue _GValue j g_type m data zGTypeClass  _GTypeClass g_type GTypeInstance ( _GTypeInstance Rg_class Rd pv_int qv_uint r.v_long sv_ulong t v_int64 uv_uint64 vv_float w;v_double xRv_pointer yki GGClosure J_GClosure =q meta_marshal_nouse n_guards n_fnotifiers  n_inotifiers in_inotify floating derivative_flag in_marshal is_invalid  marshal  data k notifiers  GClosureNotifyData KW_GClosureNotifyData  data k notify GCallback VGClosureNotify _k X.^kk.= 7G_CONNECT_AFTERG_CONNECT_SWAPPEDGConnectFlags GObject[_GObject  g_type_instance q qdataYGInitiallyUnowned[LG_APPLICATION_FLAGS_NONEG_APPLICATION_IS_SERVICEG_APPLICATION_IS_LAUNCHERG_APPLICATION_HANDLES_OPENG_APPLICATION_HANDLES_COMMAND_LINEG_APPLICATION_SEND_ENVIRONMENTG_APPLICATION_NON_UNIQUE GApplicationFlagsGActionMap3 _GActionMapGSimpleAction6 _GSimpleActionGAction7 _GActionGApplication8# _GApplication,R /L 1 GSettings;c _GSettings? AL B GMenuModel> _GMenuModel L > GActionEntry) _GActionEntry 7` name9{ G;  parameter_type?{ A{ change_stateC  paddingH { { kf  GGApplicationPrivate) _GApplicationPrivate  ;GSettingsPrivate* _GSettingsPrivateR  GMenuModelPrivate}* _GMenuModelPrivate   GTK_MESSAGE_INFOGTK_MESSAGE_WARNINGGTK_MESSAGE_QUESTIONGTK_MESSAGE_ERRORGTK_MESSAGE_OTHERGtkMessageTypeJ GtkBuilder# _GtkBuilder[ ]L _  GtkSettings*% _GtkSettings/S 1L 4a GtkWidget.d _GtkWidget   GtkWindow0 _GtkWindow5 bin7 9 GtkWidgetPrivateB _GtkWidgetPrivateS  GtkApplication' _GtkApplication+Q - 0 GtkApplicationPrivate)n _GtkApplicationPrivateQ   GtkContainer. _GtkContainer2 4S 7 GtkContainerPrivate/ _GtkContainerPrivate  GtkBin.&_GtkBin2O =4 7tGtkBinPrivate/d _GtkBinPrivateOGtkWindowPrivate. _GtkWindowPrivatez2GTK_DIALOG_MODALGTK_DIALOG_DESTROY_WITH_PARENTGTK_DIALOG_USE_HEADER_BARGtkDialogFlags6DUGTK_LICENSE_UNKNOWNGTK_LICENSE_CUSTOMGTK_LICENSE_GPL_2_0GTK_LICENSE_GPL_3_0GTK_LICENSE_LGPL_2_1GTK_LICENSE_LGPL_3_0GTK_LICENSE_BSDGTK_LICENSE_MIT_X11GTK_LICENSE_ARTISTICGTK_LICENSE_GPL_2_0_ONLY GTK_LICENSE_GPL_3_0_ONLY GTK_LICENSE_LGPL_2_1_ONLY GTK_LICENSE_LGPL_3_0_ONLY GtkMisc .d_GtkMisc 2  4S  7GtkMiscPrivate / _GtkMiscPrivateGtkLabel!0_GtkLabel!6 misc!8U !; GtkLabelPrivate!1 _GtkLabelPrivateGtkBox"/:_GtkBox"3c ="5 "8GtkBoxPrivate"0x _GtkBoxPrivatecGtkTextIter#@_GtkTextIter8$F dummy1$Lk dummy2$Mk dummy3$N dummy4$O dummy5$P dummy6$Q dummy7$R dummy8$S dummy9$Tk dummy10$Uk$ dummy11$V( dummy12$W, dummy13$Y0 dummy14$Zk4GtkTextBuffer$B_GtkTextBuffer%N %PL %Ri GtkBuilderPrivate) _GtkBuilderPrivateGtkToolItem&)$_GtkToolItem&-R &/ &2GtkToolItemPrivate&+l _GtkToolItemPrivateRGtkToolButton''_GtkToolButton '+ '- '0GtkToolButtonPrivate') _GtkToolButtonPrivateGtkMenuToolButton((_GtkMenuToolButton$(+R (- (0 GtkMenuToolButtonPrivate()r _GtkMenuToolButtonPrivateR)VGTK_BUTTONS_NONEGTK_BUTTONS_OKGTK_BUTTONS_CLOSEGTK_BUTTONS_CANCELGTK_BUTTONS_YES_NOGTK_BUTTONS_OK_CANCELGtkButtonsType)]GtkSettingsPrivate)L _GtkSettingsPrivate2GtkStatusbar*-{_GtkStatusbar*1 parent_widget*3, *6GtkStatusbarPrivate*. _GtkStatusbarPrivategGtkTextMark+;_GtkTextMark+E6 +GL segment+Jk GtkTextBufferPrivate%KR _GtkTextBufferPrivate6GtkTextView,n_GtkTextView,r ,t ,xGtkTextViewPrivate,o _GtkTextViewPrivate clicked_cb`@ P info m@(show_action_dialogp@{2P{  name{ dialog +!|@(tP!@ )t0t2t0t 2t$P@!@G) tst?P@"tt 0t0t0#@)tsactivate_action=@ $P={ ${>$W?k@PPactivate_about]@S-$P]{ ${^$W_k%aa &authorsc-H&documentorsk-\'i@)'p@)'w@)!@)ZtP@tP@t stv#J@*ttQ@tQ@t Q@tQ@tQ@tQ@t 4t$wQ@t(dQ@t,[Q@t04Q@t4+Q@t8Ht<Q@t\tQ@tQ@tQ@tP@t0{=Gchange_radio_state`@$P{ $މ$Wke@H*(show_action_infobar&#)P&{ ){')a(k*infobar* +5+ *text,*name-{*value.{activate_radioSp@$PS{ ${T$WUk,@W-I-h-.@//// / !@(ts!@t*tvt0!@* twtQ@!@*?twtQ@!@)gtQ@t\tX!@*tutX!@)tw#@*tX0@+change_titlebar_state @9K$P{ $щ$Wk1aԒ ?!:@)+,ts!F@P+Atw0Y@H*activate_toggleE`@L $PE{ ${F$WGk1I^!p@PPs!x@+ts!@)+tv'@+!@+ts0@+update_statusbar@$ostatusbar msg row col count&iter!@+twt0!@,tv!@J,tv!@w,tvts!@,ts!@,(ts!@)NtR@tvt u!5@-ptwt0ts#=@*ts2GP@2#3app 4builder 5a 4grid =4contents \4status p55 4button 4infobar 4menutool 4toolmenuD 5o!c@5- t!u@a- tvtNR@!@- tvt`R@!@- tvtt!@-!tvt@@@t6t v'@/.!@F.F!tstnR@t0!@.e!tstR@!@.!tstR@!@.!tstR@!"@.!tstQ@!6@.!tstR@!J@."tstQ@!\@."tstR@!p@.>"tstR@!@.e"tvtQ@tX!@."tvtQ@tu!@."tvt\!@."tT!@#/"tP!@S/"tH!@G)'#tLtR@t`@t ut0t0!@w/=#tH!:@/s#tutR@t@t wt0!^@/#tutR@t@t wt0!j@ #tutw!r@/#tv0@0mark_set_callback@ f$$o6new_location0mark{datak @  startup@vv%app  builder D4appmenuD n4menubarD '@/.!@F.$tstR@t0!@.%tstR@!@.4%tstR@!@0P%tvtu!@M0l%tvtw0@0change_theme_state @L &$P{ $‰$Wk1h'3@{0!=@)+%ts!Y@0&twtR@t 00l@H*activate_quitp@6&$P{ ${$Wk&app  win  listA nextA!@0&t'@07mainM1@(3argcM3argvM 4appO 5hP 55PQ S!<1@ 1]'t0t0t2t LtH!P1@D1{'tS@t0!^1@n1't(S@!|1@-'tstA@t6t s!1@1'tvt5S@!1@1'ts!1@G).(tst;S@t@t 0t0t0!1@G)i(tstCS@tP@t 0t0t0#2@1tst0t0 (G&app_entries(A@&win_entries(@@@8gtk_widget_hide( 9g_action_get_name-?{ ) 9gtk_message_dialog_new)c G)  {:;g_signal_connect_data  )k{k78gtk_widget_show) 1A>1 9gtk_application_newO n1{9g_settings_newN 1{;g_settings_create_action@ 1 {=g_action_map_add_actionR1`  >g_application_run  RGNU C 4.9.2 -mms-bitfields -mtune=generic -march=pentiumpro -g -O2 -fvisibility=hiddendemo_resources.c/home/vagrant/ruby-gnome2.win32/gdk3/tmp/windows/gtk+/gtk+-3.16.6/demos/gtk-democharunsigned intintshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charsigned charguint8Eshort intlong long unsigned intgsize;floatdoublegpointerM long doubleGResource_GResourceeGStaticResource3_GStaticResource5 data7 data_len8 resource9 next: padding;    data  alignment  ptr  e $ demo_get_resource`@!@tA@resource_constructorTa 2@_/2@tA@resource_destructorYa@2@O2@5tA@demo_resource_data S@static_resource`A@g_static_resource_get_resource~g_static_resource_initz5g_static_resource_fini| GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/atonexit.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt@1 charunsigned intintshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charfloatsigned charshort intlong long unsigned int_onexit_t(double long doubletagCOINITBASE COINITBASE_MULTITHREADED VARENUM VT_EMPTY VT_NULL VT_I2 VT_I4 VT_R4 VT_R8 VT_CY VT_DATE VT_BSTR VT_DISPATCH VT_ERROR VT_BOOL VT_VARIANT VT_UNKNOWN VT_DECIMAL VT_I1 VT_UI1 VT_UI2 VT_UI4 VT_I8 VT_UI8 VT_INT VT_UINT VT_VOID VT_HRESULT VT_PTR VT_SAFEARRAY VT_CARRAY VT_USERDEFINED VT_LPSTR VT_LPWSTR VT_RECORD$ VT_INT_PTR% VT_UINT_PTR& VT_FILETIME VT_BLOB VT_STREAM VT_STORAGE VT_STREAMED_OBJECT VT_STORED_OBJECT VT_BLOB_OBJECT VT_CF VT_CLSID VT_VERSIONED_STREAM VT_BSTR_BLOB VT_VECTOR VT_ARRAY VT_BYREF VT_RESERVED VT_ILLEGAL VT_ILLEGALMASKED VT_TYPEMASK_PVFV mingw_onexit!@ func! onexitbegin#h onexitend$lretval%f@5@V(t8@5@5@i^tthtl&@7@H@t8]@t atexit8p@ func8@t__onexitbegin$dK__onexitend dK_imp___onexit/ _decode_pointerNVN_locki__dllonexit_encode_pointerNN_unlockp GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/gccmain.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt@< charunsigned intintptrdiff_tshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charfloatsigned charshort intlong long unsigned intdouble long doubletagCOINITBASECOINITBASE_MULTITHREADEDVARENUMVT_EMPTYVT_NULLVT_I2VT_I4VT_R4VT_R8VT_CYVT_DATEVT_BSTRVT_DISPATCH VT_ERROR VT_BOOL VT_VARIANT VT_UNKNOWN VT_DECIMALVT_I1VT_UI1VT_UI2VT_UI4VT_I8VT_UI8VT_INTVT_UINTVT_VOIDVT_HRESULTVT_PTRVT_SAFEARRAYVT_CARRAYVT_USERDEFINEDVT_LPSTRVT_LPWSTRVT_RECORD$VT_INT_PTR%VT_UINT_PTR&VT_FILETIMEVT_BLOBVT_STREAMVT_STORAGEVT_STREAMED_OBJECTVT_STORED_OBJECTVT_BLOB_OBJECTVT_CFVT_CLSIDVT_VERSIONED_STREAMVT_BSTR_BLOBVT_VECTOR VT_ARRAYVT_BYREFVT_RESERVEDVT_ILLEGALVT_ILLEGALMASKEDVT_TYPEMASK func_ptr  __do_global_dtors@, pA@ __do_global_ctors @F* nptrs"9 i#9 @t@__main5 @L, @ initialized2 `Kp__CTOR_LIST__ e__DTOR_LIST__ eatexitTN GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/natstart.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt4 charunsigned intintshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charfloatsigned charshort intlong long unsigned intdouble long doubletagCOINITBASECOINITBASE_MULTITHREADEDVARENUMdVT_EMPTYVT_NULLVT_I2VT_I4VT_R4VT_R8VT_CYVT_DATEVT_BSTRVT_DISPATCH VT_ERROR VT_BOOL VT_VARIANT VT_UNKNOWN VT_DECIMALVT_I1VT_UI1VT_UI2VT_UI4VT_I8VT_UI8VT_INTVT_UINTVT_VOIDVT_HRESULTVT_PTRVT_SAFEARRAYVT_CARRAYVT_USERDEFINEDVT_LPSTRVT_LPWSTRVT_RECORD$VT_INT_PTR%VT_UINT_PTR&VT_FILETIMEVT_BLOBVT_STREAMVT_STORAGEVT_STREAMED_OBJECTVT_STORED_OBJECTVT_BLOB_OBJECTVT_CFVT_CLSIDVT_VERSIONED_STREAMVT_BSTR_BLOBVT_VECTOR VT_ARRAYVT_BYREFVT_RESERVEDVT_ILLEGALVT_ILLEGALMASKEDVT_TYPEMASK__uninitialized__initializing__initializedd__native_startup_state ,dK __native_startup_lock(dK  __native_dllmain_reason 'A@ __native_vcclrit_reason 'A@ GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/wildcard.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt _dowildcard $`Kint@ GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/charmax.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt0 @F charunsigned intintshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charfloatsigned charshort intlong long unsigned intdouble long doubletagCOINITBASECOINITBASE_MULTITHREADEDVARENUMvVT_EMPTYVT_NULLVT_I2VT_I4VT_R4VT_R8VT_CYVT_DATEVT_BSTRVT_DISPATCH VT_ERROR VT_BOOL VT_VARIANT VT_UNKNOWN VT_DECIMALVT_I1VT_UI1VT_UI2VT_UI4VT_I8VT_UI8VT_INTVT_UINTVT_VOIDVT_HRESULTVT_PTRVT_SAFEARRAYVT_CARRAYVT_USERDEFINEDVT_LPSTRVT_LPWSTRVT_RECORD$VT_INT_PTR%VT_UINT_PTR&VT_FILETIMEVT_BLOBVT_STREAMVT_STORAGEVT_STREAMED_OBJECTVT_STORED_OBJECTVT_BLOB_OBJECTVT_CFVT_CLSIDVT_VERSIONED_STREAMVT_BSTR_BLOBVT_VECTOR VT_ARRAYVT_BYREFVT_RESERVEDVT_ILLEGALVT_ILLEGALMASKEDVT_TYPEMASK_PIFV my_lconv_init0 @ 7 @ mingw_initcharmax (`K _charmaxA@ __mingw_pinitvK GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/dllargv.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt@ @$charunsigned intintshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charfloatsigned charshort intlong long unsigned intdouble long double_setargv@ @/  GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/gs_support.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crtP @7vcharunsigned intintshort unsigned intlong intlong long intsizetypelong unsigned intunsigned chardoublefloat long doublex_EXCEPTION_RECORDP"ExceptionCodeExceptionFlagsrExceptionAddress NumberParametersExceptionInformation_CONTEXT+ContextFlags,Dr0-Dr1.Dr2/ Dr30Dr61Dr72FloatSave3SegGs4SegFs5SegEs6SegDs7Edi9Esi:Ebx;Edx<Ecx=Eax>Ebp?Eip@SegCsAEFlagsBEspCSegSsDExtendedRegistersE BYTEz? DWORD|*signed charshort intlong long unsigned int UINT_PTR5 ULONG_PTR7* PVOID" LONG LONGLONG  lLowPart& LowPart& _LARGE_INTEGER DulQuadPart3 LARGE_INTEGER_FLOATING_SAVE_AREApControlWordStatusWordTagWord ErrorOffset! ErrorSelector"DataOffset#DataSelector$RegisterArea%Cr0NpxState&lO FLOATING_SAVE_AREA' CONTEXTF$ PCONTEXTH/ EXCEPTION_RECORDx PEXCEPTION_RECORDb/_EXCEPTION_POINTERSHContextRecord EXCEPTION_POINTERSh_FILETIMEdwLowDateTimeεdwHighDateTimeϵ FILETIME NTSTATUS&Pft_scalar!ft_struct" FT#%__security_init_cookie2P @cookie4systime5PPperfctr6X @tP @tX__report_gsfailureg!@eStackCookiegcookieiuhU!@2t0e!@FtZK!@[t|!@( ueGS_ExceptionRecord%/@cKGS_ContextRecord&@`KGS_ExceptionPointers(ZK __security_cookie,A@ __security_cookie_complement-A@!abort@GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/_newmode.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crtw_newmodecKintGNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/tlssup.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt!@charunsigned intintuintptr_tshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charULONG>WINBOOLnBOOLrDWORD|>floatLPVOIDdsigned charshort intlong long unsigned intULONG_PTR7>PVOIDdHANDLE|dPIMAGE_TLS_CALLBACK917L _IMAGE_TLS_DIRECTORY32E StartAddressOfRawDataF EndAddressOfRawDataG AddressOfIndexH AddressOfCallBacksI SizeOfZeroFillJ CharacteristicsKIMAGE_TLS_DIRECTORY32LLIMAGE_TLS_DIRECTORY]_PVFVU[ __dyn_tls_initR R R RpfuncTpsUH__dyn_tls_dtor!@C'!@ttt\__dyn_tls_init@12!@~w"@"w"@" \"@tt1t__tlregdtors`"@funcsH__xd_aEH,K__xd_zFH0K_tls_index)fcK_tls_start/,K_tls_end0,K__xl_a2K__xl_z3(K_tls_used5K,_CRT_MTM__dyn_tls_init_callbackmZK__xl_cn K__xl_d$Kmingw_initltsdrot_forcecKmingw_initltsdyn_forcecKmingw_initltssuo_forcecK __mingw_TLScallbacksGNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/cinitexe.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crtcharunsigned intintshort unsigned intlong intlong long intsizetypelong unsigned intunsigned char_PVFVSYFj__xi_a Z K__xi_z ZK__xc_a ZK__xc_z ZK5GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/merr.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crtp"@charunsigned intintshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charfloatsigned charshort intlong long unsigned intdouble long doubletagCOINITBASECOINITBASE_MULTITHREADEDVARENUMnVT_EMPTYVT_NULLVT_I2VT_I4VT_R4VT_R8VT_CYVT_DATEVT_BSTRVT_DISPATCH VT_ERROR VT_BOOL VT_VARIANT VT_UNKNOWN VT_DECIMALVT_I1VT_UI1VT_UI2VT_UI4VT_I8VT_UI8VT_INTVT_UINTVT_VOIDVT_HRESULTVT_PTRVT_SAFEARRAYVT_CARRAYVT_USERDEFINEDVT_LPSTRVT_LPWSTRVT_RECORD$VT_INT_PTR%VT_UINT_PTR&VT_FILETIMEVT_BLOBVT_STREAMVT_STORAGEVT_STREAMED_OBJECTVT_STORED_OBJECTVT_BLOB_OBJECTVT_CFVT_CLSIDVT_VERSIONED_STREAMVT_BSTR_BLOBVT_VECTOR VT_ARRAYVT_BYREFVT_RESERVEDVT_ILLEGALVT_ILLEGALMASKEDVT_TYPEMASK_iobuf X_ptrY_cntZ_base[_flag\ _file]_charbuf^_bufsiz__tmpfname` FILEbn_exception {Xtype|name}Xarg1~arg2retval^ fUserMathErr w}   __mingw_raise_matherrp"@KtypnameXa1a2rsltexP"@tP __mingw_setusermatherr"@afw"@_matherr"@[pexcept%type'X& %#@tZKstUserMathErr ccK_imp___iob[__setusermatherr wfprintfy2 2 XcGNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/CRT_fp10.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt0#@_fpreset 0#@GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/mingw_helpers.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt@#@Ncharunsigned intintshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charfloatsigned charshort intlong long unsigned intdouble long doubletagCOINITBASECOINITBASE_MULTITHREADEDVARENUMsVT_EMPTYVT_NULLVT_I2VT_I4VT_R4VT_R8VT_CYVT_DATEVT_BSTRVT_DISPATCH VT_ERROR VT_BOOL VT_VARIANT VT_UNKNOWN VT_DECIMALVT_I1VT_UI1VT_UI2VT_UI4VT_I8VT_UI8VT_INTVT_UINTVT_VOIDVT_HRESULTVT_PTRVT_SAFEARRAYVT_CARRAYVT_USERDEFINEDVT_LPSTRVT_LPWSTRVT_RECORD$VT_INT_PTR%VT_UINT_PTR&VT_FILETIMEVT_BLOBVT_STREAMVT_STORAGEVT_STREAMED_OBJECTVT_STORED_OBJECTVT_BLOB_OBJECTVT_CFVT_CLSIDVT_VERSIONED_STREAMVT_BSTR_BLOBVT_VECTOR VT_ARRAYVT_BYREFVT_RESERVEDVT_ILLEGALVT_ILLEGALMASKEDVT_TYPEMASK_decode_pointerS@#@codedptrS_encode_pointerSP#@ptrS mingw_app_typecK9GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/pseudo-reloc.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt`#@t __gnuc_va_list__builtin_va_listcharva_listsize_t{"unsigned intintptrdiff_t2short unsigned intlong intlong long intsizetypelong unsigned intunsigned charBYTEzWORD{KDWORD|floatPBYTELPBYTELPVOIDsigned charshort intlong long unsigned intULONG_PTR7SIZE_TRPVOID _MEMORY_BASIC_INFORMATIONE, BaseAddressFq AllocationBaseGq AllocationProtectH RegionSizeIc StateJ ProtectK TypeLMEMORY_BASIC_INFORMATIONM~ ]  fPhysicalAddressgVirtualSizeh _IMAGE_SECTION_HEADER(d NameeM Misci] VirtualAddressj SizeOfRawDatak PointerToRawDatal PointerToRelocationsm PointerToLinenumbersn NumberOfRelocationso NumberOfLinenumbersp" Characteristicsq$PIMAGE_SECTION_HEADERrdouble long doubletagCOINITBASECOINITBASE_MULTITHREADEDVARENUMVT_EMPTYVT_NULLVT_I2VT_I4VT_R4VT_R8VT_CYVT_DATEVT_BSTRVT_DISPATCH VT_ERROR VT_BOOL VT_VARIANT VT_UNKNOWN VT_DECIMALVT_I1VT_UI1VT_UI2VT_UI4VT_I8VT_UI8VT_INTVT_UINTVT_VOIDVT_HRESULTVT_PTRVT_SAFEARRAYVT_CARRAYVT_USERDEFINEDVT_LPSTRVT_LPWSTRVT_RECORD$VT_INT_PTR%VT_UINT_PTR&VT_FILETIMEVT_BLOBVT_STREAMVT_STORAGEVT_STREAMED_OBJECTVT_STORED_OBJECTVT_BLOB_OBJECTVT_CFVT_CLSIDVT_VERSIONED_STREAMVT_BSTR_BLOBVT_VECTOR VT_ARRAYVT_BYREFVT_RESERVEDVT_ILLEGALVT_ILLEGALMASKEDVT_TYPEMASK_iobuf 1_ptr ~_cnt 2_base ~_flag 2 _file 2_charbuf 2_bufsiz !2_tmpfname "~FILE $;daddend<target=runtime_pseudo_reloc_item_v1>= FsymGtargetHflagsIruntime_pseudo_reloc_item_v2J L magic1Mmagic2NversionOruntime_pseudo_reloc_v2P t old_protectsec_starthash4 __write_memory addrsrclenb,oldprotcall_unprotect2do_pseudo_reloc* start*end*base*addr_imp,9reldata,9reloc_target-9v2_hdr. r/ o_ newvald d__report_errorS`#@Q5 msgS5 argpS#@K t[K t1 tK#@+ t ts!#@; "#mark_section_writable $addr%b,%h%i2& #@O^ ' 9 ' ' ( D( @)  *@ #@ '^ / +(j D)s )| $@ tv!>$@,l$@uC t tL-%@[ t@ t s%@ s t0\K%@ t[K.%@ t[K tv-$@ tv tL$@ tv t t,%@s t@ t u"%@( tv t t,M%@s< t u.&@ t[K tL tv#restore_modified_sections %i2%b,%oldprot/_pei386_runtime_relocator&@0was_init2cK1mSecs2 * b&@2 2 2! +). ( (? D)O \ )d )s 3'@D)~ +( D4 D'@ g' % ' 9 ' N + 5 5 ) a .T'@ R Q4* %(@8,' u ' ' +85 5 ) .:(@ R Q2* g(@X' ' '  +X5 5 )  .|(@ R Q1* (@x' + ' ? ' _ +x5 5 ) r .(@ 6P R Q4'@  t\K.(@ tX\K*^ a'@+) ( D( @-'@_ tL-'@p t @.(@ t[K!8&@the_secscKt maxSections2cK 178_imp___iob [8__RUNTIME_PSEUDO_RELOC_LIST__08__RUNTIME_PSEUDO_RELOC_LIST_END__18_image_base__29__builtin_fwrite fwrite"::":":;vfprintf }2::5 :1_GetPEImageBase?memcpy:::>__mingw_GetSectionCount2QGNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/xtxtmode.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt_fmodecKintH }GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/crt_handler.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt(@Ucharunsigned intintshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charW_EXCEPTION_RECORDPExceptionCodeExceptionFlagsQExceptionAddress NumberParametersExceptionInformationG_CONTEXT+ContextFlags,Dr0-Dr1.Dr2/ Dr30Dr61Dr72FloatSave3SegGs4SegFs5SegEs6SegDs7Edi9Esi:Ebx;Edx<Ecx=Eax>Ebp?Eip@SegCsAEFlagsBEspCSegSsDExtendedRegistersE BYTEz@ DWORD|+floatsigned charshort intlong long unsigned int ULONG_PTR7+ PVOID LONG_FLOATING_SAVE_AREApControlWordStatusWordTagWord ErrorOffset! ErrorSelector"DataOffset#DataSelector$RegisterArea%Cr0NpxState&l  O FLOATING_SAVE_AREA'     CONTEXTF PCONTEXTHA  W  EXCEPTION_RECORDW PEXCEPTION_RECORDW_EXCEPTION_POINTERSpContextRecord0 EXCEPTION_POINTERS PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTERdouble long doubletagCOINITBASECOINITBASE_MULTITHREADEDVARENUM. VT_EMPTYVT_NULLVT_I2VT_I4VT_R4VT_R8VT_CYVT_DATEVT_BSTRVT_DISPATCH VT_ERROR VT_BOOL VT_VARIANT VT_UNKNOWN VT_DECIMALVT_I1VT_UI1VT_UI2VT_UI4VT_I8VT_UI8VT_INTVT_UINTVT_VOIDVT_HRESULTVT_PTRVT_SAFEARRAYVT_CARRAYVT_USERDEFINEDVT_LPSTRVT_LPWSTRVT_RECORD$VT_INT_PTR%VT_UINT_PTR&VT_FILETIMEVT_BLOBVT_STREAMVT_STORAGEVT_STREAMED_OBJECTVT_STORED_OBJECTVT_BLOB_OBJECTVT_CFVT_CLSIDVT_VERSIONED_STREAMVT_BSTR_BLOBVT_VECTOR VT_ARRAYVT_BYREFVT_RESERVEDVT_ILLEGALVT_ILLEGALMASKEDVT_TYPEMASK __p_sig_fn_t0B H S _gnu_exception_handler_gnu_exception_handler@4(@ exception_data old_handlerB actionIreset_fpu)@" t;t05)@ t;)@" 4 t8t0)@D t8)@" ^ t8t0)@" x t8t1)@? *@" t4t0*@ t44*@" t4t1T*@" t;t1t*@" t8t1__mingw_oldexcpt_handler+cKsignal<. ? . _fpreset)$ GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/tlsthrd.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt*@'charsize_t{unsigned intintshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charWINBOOLnWORD{DWORD|6floatLPVOID\signed charshort intlong long unsigned intULONG_PTR76LONG HANDLE|\_LIST_ENTRYC4FlinkD4BlinkE4LIST_ENTRYF_RTL_CRITICAL_SECTION_DEBUG ETypemCreatorBackTraceIndexmCriticalSectionProcessLocksList:EntryCountyContentionCountyFlagsyCreatorBackTraceIndexHighmSpareWORDm_RTL_CRITICAL_SECTIONDebugInfoLockCountRecursionCountOwningThread LockSemaphoreSpinCountEPRTL_CRITICAL_SECTION_DEBUG MRTL_CRITICAL_SECTIONECRITICAL_SECTIONdouble long double__mingwthr_key_ty __mingwthr_key  key y dtor! next"  \ a__mingwthr_run_key_dtorsbkeypdvaluel*@mu*@!P%*@tv*@dtcK*@tcK___w64_mingwthr_add_key_dtor)*@wkey)ydtor)new_key+C+@t1t<8+@tcKV+@tcKa___w64_mingwthr_remove_key_dtor@p+@key@yprev_keyBwcur_keyC+@tcK+@tcK+@+@tcK__mingw_TLScallbacky^,@hDllHandleyreasonzyreserved{#,@R,@5,@z,@_,@tcK,@tcK__mingwthr_cs0cK__mingwthr_cs_initcK key_dtor_list&cK calloc\ !free \GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/tlsmcrt.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt_CRT_MT A@int*GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/pseudo-reloc-list.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt3__RUNTIME_PSEUDO_RELOC_LIST_END__dKchar__RUNTIME_PSEUDO_RELOC_LIST__dK5 GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/crt/pesect.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt,@Kcharsize_t{unsigned intintshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charWINBOOLnBYTEzJWORD{DWORD|5floatPBYTElLPVOID[signed charshort intlong long unsigned intLONG_PTR6 ULONG_PTR75DWORD_PTRLONG l@) _IMAGE_DOS_HEADER@ e_magicx e_cblpx e_cpx e_crlcx e_cparhdrx e_minallocx e_maxallocx e_ssx e_spx e_csumx e_ipx e_csx e_lfarlcx e_ovnox e_res e_oemidx$ e_oeminfox& e_res2( e_lfanew#<x)x) IMAGE_DOS_HEADER@PIMAGE_DOS_HEADER@ _IMAGE_FILE_HEADERK MachineLx NumberOfSectionsMx 'N PointerToSymbolTableO NumberOfSymbolsP SizeOfOptionalHeaderQx ?RxIMAGE_FILE_HEADERS _IMAGE_DATA_DIRECTORY Z SizeIMAGE_DATA_DIRECTORY _IMAGE_OPTIONAL_HEADERW Magicx MajorLinkerVersionl MinorLinkerVersionl SizeOfCode SizeOfInitializedData SizeOfUninitializedData AddressOfEntryPoint BaseOfCode BaseOfData ImageBase SectionAlignment FileAlignment$ MajorOperatingSystemVersionx( MinorOperatingSystemVersionx* MajorImageVersionx, MinorImageVersionx. MajorSubsystemVersionx0 MinorSubsystemVersionx2 Win32VersionValue4 SizeOfImage8 SizeOfHeaders< CheckSum@ SubsystemxD DllCharacteristicsxF SizeOfStackReserveH SizeOfStackCommitL SizeOfHeapReserveP SizeOfHeapCommitT LoaderFlagsX NumberOfRvaAndSizes\ DataDirectoryW`g)IMAGE_OPTIONAL_HEADER32PIMAGE_OPTIONAL_HEADER32PIMAGE_OPTIONAL_HEADER _IMAGE_NT_HEADERS( Signature FileHeader OptionalHeadergIMAGE_NT_HEADERS32PIMAGE_NT_HEADERS32_ IMAGE_NT_HEADERS ( PIMAGE_NT_HEADERS C f PhysicalAddressg VirtualSizeh _IMAGE_SECTION_HEADER(d Namee0 Misci  Zj SizeOfRawDatak PointerToRawDatal PointerToRelocationsm PointerToLinenumbersn NumberOfRelocationsox NumberOfLinenumberspx" ?q$PIMAGE_SECTION_HEADERr  b ?c OriginalFirstThunkd _IMAGE_IMPORT_DESCRIPTORa  'f ForwarderChainh Namei FirstThunkjIMAGE_IMPORT_DESCRIPTORk PIMAGE_IMPORT_DESCRIPTORl  double long double_ValidateImageBase]J OpDOSHeader5~ pOptHeader ,@~   , 27 z ,@   , 7 ,@J _FindPESection- ,@=& O-rva-5/~ '0 Oi1b_FindPESectionByNameC 0-@pNameCOE5F~ G iH J-@O   , 7 !j-@J "P#E-@ $tw!-@$ts$tw$t8 %__mingw_GetSectionForAddressb -@PpbOd&rvae -@h  , 7 !-@J "P!.@ "t"t__mingw_GetSectionCountp .@+3Or5s~ ' ".@v  , 7 !:.@J "P_FindPESectionExec P.@weNoO5~ $( Ri7' S.@( ( , 7 !z.@J "P_GetPEImageBase.@*@O' .@H H , 7 !.@J "P_IsNonwritableInCurrentImage]/@TpTargetO&rvaTargeta t /@` ` , 7 !/@J "P!:/@ "t"t__mingw_enum_import_library_names`/@iOš5~ &importDescİ  &importsStartRVAƄ h/@x x , 7 !/@J "P!/@ "t$ts)_image_base__*strlen6+,strncmpL+++QGNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/misc/mingw_matherr.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt>_MINGW_INSTALL_DEBUG_MATHERRA@int}GNU C 4.9.1 -m32 -mtune=generic -march=pentiumpro -g -O2 -std=gnu99../../mingw-w64-crt/misc/invalid_parameter_handler.c/build/buildd/mingw-w64-3.2.0/build/i686-w64-mingw32-i686-w64-mingw32-crt0@charunsigned intintuintptr_twchar_tshort unsigned intlong intlong long intsizetypelong unsigned intunsigned charfloatsigned charshort intlong long unsigned intLONG_PTR63PVOIDLONG3PLONGpdouble long double ????E  tagCOINITBASE| COINITBASE_MULTITHREADED VARENUM VT_EMPTY VT_NULL VT_I2 VT_I4 VT_R4 VT_R8 VT_CY VT_DATE VT_BSTR VT_DISPATCH VT_ERROR VT_BOOL VT_VARIANT VT_UNKNOWN VT_DECIMAL VT_I1 VT_UI1 VT_UI2 VT_UI4 VT_I8 VT_UI8 VT_INT VT_UINT VT_VOID VT_HRESULT VT_PTR VT_SAFEARRAY VT_CARRAY VT_USERDEFINED VT_LPSTR VT_LPWSTR VT_RECORD$ VT_INT_PTR% VT_UINT_PTR& VT_FILETIME VT_BLOB VT_STREAM VT_STORAGE VT_STREAMED_OBJECT VT_STORED_OBJECT VT_BLOB_OBJECT VT_CF VT_CLSID VT_VERSIONED_STREAM VT_BSTR_BLOB VT_VECTOR VT_ARRAY VT_BYREF VT_RESERVED VT_ILLEGAL VT_ILLEGALMASKED VT_TYPEMASK _InterlockedExchange3PTargetPValue3V3InterlockedExchange#Target#Value#mingw_get_invalid_parameter_handler0@mingw_set_invalid_parameter_handler0@ rnew_handler[0@ {dK0@ $A2dKhandlerdK_imp___set_invalid_parameter_handler A@_imp___get_invalid_parameter_handlerA@% $ > : ;I I : ; : ;I8  : ;I8   : ; : ; I & 'I II!I/ !I/ : ; : ;I I8 ' : ;  : ; I8 'I'&I : ; (  : ; : ;  : ; : ; I .?: ;'I !: ;I"4: ;I#5I$: ;I%<&.?: ;'I '.?: ; 'I (: ; I): ; I*.: ;' + ,.: ; '@B-: ; I..: ;'I /.: ; 'I@B01RUX Y 1 U241341415B6171894: ; I:4: ; I; U<1X Y =1X Y>1? @1A1RUX Y B1RUX YC1X YD1X Y EFG.?: ; 'I@BH4: ; I IB1J4: ; I?<K5L!M4: ; I?N4: ;I?<O.?: ; '<P.?: ; 'I<Q.?: ; 'I<R.?: ;'I<S.?'I4<T.?: ; '<U.?: ;'<% U$ > : ;I I: ; I &I : ;  : ; I8 : ; I8 ' <  : ; : ;I8  : ;  : ; II!I/  : ; I 8  : ; I 8 'I5I : ; (  : ;.: ; '@B: ; I: ; IB1B 4: ; I!1"#1$: ; I%4: ; I&4: ; I'1(.: ; ' ): ; I*4: ; I+4: ; I,1X Y -1. /410B114: ; I2.: ;'@B3: ;I44: ;I54: ;I6: ; I7.?: ;'I@B8.?: ;'<9.?: ; 'I<:;.?: ;'I<<.?: ; 'I<=.?: ; '<>.?: ; 'I<% U$ > : ; I < I&I : ;  : ; I8  : ;  : ; I I !I/.?: ;'I@B1B.: ;'@B4: ; I4: ;I.?: ; 'I<I.?: ; '<.?: ; '<% $ >  : ; I I'I' : ;  (  : ; .?: ; 'I@B : ; I 4: ; I4: ; I11B14: ; I?'II4: ; I?<.?: ; 'I<.?: ; '<.?: ; '<% $ > : ;I I' : ; (  : ; : ; I .?: ; '@B 4: ; I 4: ; I 1B.?: ; '@BB1I!4: ; I?<.?: ;'I<I% $ >  : ; (  : ; : ; : ; I4: ; I? 5I  I 5% 4: ; I?$ > % $ >  I'I : ; (  : ;: ; I .: ; 'I@B B 4: ; I?% $ > .?: ; 'I@B% $ >  I : ; : ;I8  : ;I8   : ; : ; I : ;I  : ;  : ; I : ;II!I/ !I/ : ;  : ; I8  : ;  : ; I.?: ; '@B4: ; I4: ; IB: ; I15I&I 4: ; I?!.?: ;'<% 4: ; I?$ > % $ > : ;I I : ; I'I  : ; : ;I8 ' .?: ; 'I  : ; I4: ; I.: ; 'I@B: ; I1B.1n@B141 1 41.?: ; 'I@B: ; I4: ; I4: ; I?&I4: ; I?< .?: ; 'I<% $ > : ; I I'I!I/ 4: ; I?% $ >  I : ; (  : ; : ;  : ; I8 : ; I &I 'I I .?: ; '@B: ; I4: ; IBB1.?: ; 'I@B4: ; I1I!4: ; I?<.?: ; '<.?: ;'I<% .?: ; '@B% $ >   : ; (  : ;.?: ; 'I@B: ; I 4: ; I?% : ; I I$ > : ;I I &  : ; : ;I8 I !I/  : ; : ;I : ; (  : ; : ;  : ; I8  : ;  : ; : ; I.: ;' : ;I4: ;I .: ; '@B: ; I4: ; I1 B!1"&I#.: ; ' $: ; I%4: ; I&.1@B'1(41)41*1RUX Y+ U,B-.1/.?: ;'@B04: ;I14: ;I213 41RUX Y54167!84: ; I?<9.?: ; n'I<:I;.?: ;'I<<.?: ;'<=.?: ; 'I<>.?: ; 'I<?.?'I4<% 4: ; I?$ > % $ >  I : ; : ;I8  : ;I8   : ; : ; I : ;I I !I/ !I/'II : ; (  : ;'.?: ; n'I@: ; I4: ; I1B114: ; I?.?: ; 'I<.?: ; '<% $ > : ;I : ; I : ; : ;I8  I  : ;  : ; I8 ' I 5I.: ; ' 4: ; I .1@B41 B.?: ; 'I@B: ; I4: ; I111RUX Y  U414: ; I .?: ;'I<!.?: ;'<% 4: ; I?$ > % 4: ; I?$ > % $ > : ;I : ; I II!I/  : ; : ;I8 : ;I8  : ; : ;I : ;I I8 .?: ; 'I : ; I4: ; I4: ; I.1@B14141B1.?: ; 'I@B: ; I: ; I4: ; I: ; I1RUX Y 1 U!1"#1$B%&I&4: ; I'1RUX Y (4: ; I)4: ; I?<*.?: ; 'I<+I,.?: ; 'I<% 4: ; I?$ > % $ > : ;I : ; I I'I &I  : ;  (  : ; .?: ;'I : ;I5I.?: ; 'I : ; I.: ; 'I@B.: ; 'I@B: ; I1X Y 114: ; I'I4: ; I?'I ../../mingw-w64-crt/crt/build/buildd/mingw-w64-3.2.0/debian/tmp/usr/i686-w64-mingw32/include/psdk_inc/build/buildd/mingw-w64-3.2.0/debian/tmp/usr/i686-w64-mingw32/include../../mingw-w64-crt/includecrtexe.cintrin-impl.h_mingw.hwinnt.hminwindef.hbasetsd.herrhandlingapi.hprocessthreadsapi.hstdlib.hcombaseapi.hwtypes.hinternal.hmath.htchar.hinterlockedapi.hctype.hstring.hprocess.h@ <-z~.YdzZ lgg2`~Jf~<=]]0;$pN8$*@47@}fz. <xf1z JuX .Π܅YN_S1 u< K;[M#+>g8@f_dZS] @+fzt~J <_z< <_z< /usr/share/mingw-w64/include/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/lib/glib-2.0/include/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/include/glib-2.0/glib/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/include/glib-2.0/gobject/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/include/glib-2.0/gio../../gtk../../gtk/deprecatedapplication.c_mingw.hglibconfig.hgtypes.hgquark.hgerror.hgdataset.hglist.hgvariant.hgtype.hgvalue.hgclosure.hgsignal.hgobject.hgioenums.hgiotypes.hgapplication.hgsettings.hgmenumodel.hgactionmap.hgtkenums.hgtktypes.hgtkbuilder.hgtksettings.hgtkwidget.hgtkwindow.hgtkapplication.hgtkcontainer.hgtkbin.hgtkdialog.hgtkaboutdialog.hgtkmisc.hgtklabel.hgtkbox.hgtktexttag.hgtktextiter.hgtktextbuffer.hgtktoolitem.hgtktoolbutton.hgtkmenutoolbutton.hgtkmessagedialog.hgtkstatusbar.hgtktextmark.hgtktextview.hgaction.hgtkmain.hgstrfuncs.hgsimpleaction.hgmem.hgtkapplicationwindow.hgtkmenu.h`@~N0y5((4X~tZKZLY/Y/> sf?e~XMv;/KWt F:0N;/Zw91. t/vY/KYKY/YKYKY/YKZL>0I/$Ks~.tOY/;/H0Ksfv$eO-//>} J1@],=s/ZH0x00w x9 /home/vagrant/ruby-gnome2.win32/glib2/vendor/local/lib/glib-2.0/include/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/include/glib-2.0/glib/home/vagrant/ruby-gnome2.win32/glib2/vendor/local/include/glib-2.0/giodemo_resources.cglibconfig.hgtypes.hgiotypes.hgresource.h@= 2@=@2@= ../../mingw-w64-crt/crt/build/buildd/mingw-w64-3.2.0/debian/tmp/usr/i686-w64-mingw32/include../../mingw-w64-crt/includeatonexit.ccombaseapi.hwtypes.hstdlib.hinternal.h@!O:LhsYZ;/u< 2=;Y ../../mingw-w64-crt/crt/build/buildd/mingw-w64-3.2.0/debian/tmp/usr/i686-w64-mingw32/includegccmain.ccombaseapi.hwtypes.h_mingw.hstdlib.h@]/?cOKi]Lr]w. /build/buildd/mingw-w64-3.2.0/debian/tmp/usr/i686-w64-mingw32/include../../mingw-w64-crt/crt../../mingw-w64-crt/includecombaseapi.hwtypes.hnatstart.cinternal.h?9 ../../mingw-w64-crt/crtwildcard.c ../../mingw-w64-crt/crt/build/buildd/mingw-w64-3.2.0/debian/tmp/usr/i686-w64-mingw32/include../../mingw-w64-crt/includecharmax.ccombaseapi.hwtypes.hinternal.h0 @N8 ../../mingw-w64-crt/crtdllargv.c@ @ ../../mingw-w64-crt/crt/build/buildd/mingw-w64-3.2.0/debian/tmp/usr/i686-w64-mingw32/includegs_support.cwinnt.hminwindef.hbasetsd.hstdlib.hP @2yUv tdKM5gY"ft= <qte XY?9 ../../mingw-w64-crt/crt_newmode.c ../../mingw-w64-crt/crt/build/buildd/mingw-w64-3.2.0/debian/tmp/usr/i686-w64-mingw32/includetlssup.c_mingw.hminwindef.hbasetsd.hwinnt.h!@V,LLLKGKMGNKYy?U"J8O9 ../../mingw-w64-crt/crtCRT_fp10.c0#@  ../../mingw-w64-crt/crt/build/buildd/mingw-w64-3.2.0/debian/tmp/usr/i686-w64-mingw32/includemingw_helpers.ccombaseapi.hwtypes.h@#@ ../../mingw-w64-crt/crt/build/buildd/mingw-w64-3.2.0/debian/tmp/usr/i686-w64-mingw32/includepseudo-reloc.cvadefs.h_mingw.hminwindef.hbasetsd.hwinnt.hcombaseapi.hwtypes.hstdio.hstdlib.h`#@JHL/<fgӤ-/k!u>/(8txw*vL,edtwftY!~֦ fvX" >rJA)fx&?+,X<v,L ../../mingw-w64-crt/crt/build/buildd/mingw-w64-3.2.0/debian/tmp/usr/i686-w64-mingw32/includecrt_handler.cwinnt.hminwindef.hbasetsd.herrhandlingapi.hcombaseapi.hwtypes.hsignal.h(@t <=Mq<>Hbt=MX`=Z>It=_zm,V ../../mingw-w64-crt/crt/build/buildd/mingw-w64-3.2.0/debian/tmp/usr/i686-w64-mingw32/includetlsthrd.c_mingw.hminwindef.hbasetsd.hwinnt.hminwinbase.hstdlib.h*@zdv0x< JmtO=-/1Mq/vhV?hq?g->tXNTNJicAL s<Juhr 1*8 ../../mingw-w64-crt/crttlsmcrt.cHB ../../mingw-w64-crt/crtpseudo-reloc-list.c ../../mingw-w64-crt/crt/build/buildd/mingw-w64-3.2.0/debian/tmp/usr/i686-w64-mingw32/includepesect.c_mingw.hminwindef.hbasetsd.hwinnt.hstring.h,@ =39tP tP.?IuqdR/lRx.SPYsPyPU0UW W0 909> >T0TY Yt0ty y0y0010iS<=P=UVPSPS&202ARXfR0&2R2:P:=R=APXmPRcKPPP P  PP#<"P PP#<"p PP#<"# ..1P12$..1P12@xx{S{}M_R_} #<"[zPM_0_xQR S PS0VV^fP SSQ0 PPPPP  0V:IV S KR PSdKH. p =d`@@1@2@@@ 2@32@@2@S2@iow4?dt   +/25??d  '&1@Jr}#.2<R]cm.file-gcrtexe.cj  0 _envp_argv_argc_argret _mainret   .textY.data.bss  # q+6 ES _ 5j u  .file>gcygming-crtbegin.c P .textU.data.bss .rdata"j .jcr.fileng` p   ` p #  :` K ]P  g@t  _startup    p  _main! .text`F.data@ .bss .rdata$|!# 2#q _+6 (ES _5 j u l.filegdemo_resources.c   " @" -.text .data.bss  ".ctors"A@".dtors".rdata U V ?6H0E S |j u, \.text .idata$7 .idata$5.idata$4.idata$6@feat.00.text .idata$7 .idata$5.idata$4.idata$6@feat.00.text .idata$7 .idata$5.idata$4.idata$6@feat.00.text .idata$7 .idata$5.idata$4 .idata$6x@feat.00.text .idata$7 .idata$5.idata$4.idata$6`@feat.00.text .idata$7 .idata$5.idata$4.idata$6L@feat.00.text .idata$7 .idata$5.idata$4.idata$68@feat.00.text .idata$7 .idata$5.idata$4.idata$6 @feat.00.text .idata$7 .idata$5.idata$4.idata$6@feat.00.text .idata$7 .idata$5.idata$4.idata$6@feat.00.text .idata$7 .idata$5.idata$4.idata$6@feat.00.text( .idata$7 .idata$5.idata$4.idata$6@feat.00.text0 .idata$7| .idata$5.idata$4.idata$6@feat.00.text8 .idata$7x .idata$5.idata$4.idata$6l@feat.00.text@ .idata$7t .idata$5.idata$4.idata$6H@feat.00.textH .idata$7p .idata$5.idata$4.idata$60@feat.00.textP .idata$7l .idata$5.idata$4.idata$6@feat.00.textX .idata$7h .idata$5.idata$4.idata$6@feat.00.text` .idata$7d .idata$5.idata$4.idata$6@feat.00.texth .idata$7` .idata$5.idata$4.idata$6@feat.00.textp .idata$7\ .idata$5.idata$4.idata$6@feat.00.textx .idata$7X .idata$5.idata$4.idata$6@feat.00.text .idata$7T .idata$5.idata$4.idata$6x@feat.00.text .idata$7P .idata$5.idata$4.idata$6`@feat.00.text .idata$7L .idata$5.idata$4.idata$6H@feat.00.text .idata$7H .idata$5|.idata$4.idata$60@feat.00.text .idata$7D .idata$5x.idata$4.idata$6@feat.00.text .idata$7@ .idata$5t.idata$4.idata$6@feat.00.text .idata$7< .idata$5p.idata$4.idata$6@feat.00.text .idata$78 .idata$5l.idata$4.idata$6@feat.00.text .idata$74 .idata$5h.idata$4.idata$6@feat.00.text .idata$70 .idata$5d.idata$4.idata$6@feat.00.text .idata$7, .idata$5`.idata$4.idata$6t@feat.00.text .idata$7( .idata$5\.idata$4.idata$6T@feat.00.text .idata$7$ .idata$5X.idata$4.idata$6<@feat.00.text .idata$7 .idata$5T.idata$4.idata$6@feat.00.text .idata$7 .idata$5.idata$4L.idata$6 @feat.00.text .idata$7 .idata$5.idata$4H.idata$6@feat.00.text.idata$7 .idata$5 .idata$4D.idata$6@feat.00.text.idata$7 .idata$5.idata$4@.idata$6@feat.00.text.idata$7 .idata$5.idata$4<.idata$6@feat.00.text.idata$7 .idata$5.idata$48.idata$6@feat.00.text .idata$7 .idata$5.idata$44.idata$6@feat.00.text(.idata$7 .idata$5.idata$40.idata$6\@feat.00.text0.idata$7 .idata$5.idata$4,.idata$6@@feat.00.text8.idata$7 .idata$5.idata$4(.idata$6(@feat.00.text@.idata$7 .idata$5.idata$4$.idata$6@feat.00.textH.idata$7 .idata$5.idata$4 .idata$6@feat.00.textP.idata$7D.idata$5L.idata$4.idata$6 @feat.00.textX.idata$7@.idata$5H.idata$4.idata$6 @feat.00.text`.idata$7<.idata$5D.idata$4|.idata$6 @feat.00.texth.idata$78.idata$5@.idata$4x.idata$6 @feat.00.textp.idata$74.idata$5<.idata$4t.idata$6 @feat.00.textx.idata$70.idata$58.idata$4p.idata$6 @feat.00.text.idata$7.idata$50.idata$4h.idata$6 @feat.00.text.idata$7.idata$5,.idata$4d.idata$6 @feat.00.text.idata$7.idata$5(.idata$4`.idata$6t @feat.00.text.idata$7 .idata$5$.idata$4\.idata$6\ @feat.00.text.idata$7.idata$5 .idata$4X.idata$6H @feat.00.text.idata$7.idata$5.idata$4T.idata$6< @feat.00.filegatonexit.cL _atexitp .text.data.bss :Z  a+f)6x S1  j u X.file1ggccmain.cZ _p.59351m ___main  .text .data.bss a  p  +T6 S< j u `.fileEgnatstart.c.text0.data.bss$f R 6S4 _ j0 .fileWgwildcard.c.text0.data.bss$l  ,6S CjD .fileogcharmax.c0 .text0.data.bss(.CRT$XICl @ 6 SF jX u@ $.filegdllargv.c@ .text@.data.bss,q  96 S$ Rjl ud $.fileggs_support.cP   @!@3 .textP7.data.bss@P.rdata s 3  +6( Sv _ j u .fileg_newmode.c.text.data.bss|  ,6HSw Cj .filegtlssup.cI \ ___xd_a,___xd_z0o` .text.data.bss.CRT$XLD$.CRT$XLC .rdata .CRT$XDZ0.CRT$XDA,.tls.CRT$XLZ(.CRT$XLA.tls$ZZZ.tls$AAA} # +6` S _ j u l.filegcinitexe.c.textp.data.bss.CRT$XCZ.CRT$XCA.CRT$XIZ.CRT$XIA i  [6S Cj .file%gmerr.c|p    .textp.data.bss.rdata 4$ 9  p+& 6 S  j u T.file<gCRT_fp10.c0 _fpreset0 .text0.data.bss] c ,6 S Sj u $.fileSgmingw_helpers.c@ P .text@.data.bss>  6 SN j u 4.filevgpseudo-reloc.c`   !.8 S.text`t?.data.bss .rdata ; =b 9+9 w6 ES  _  j  u, .filegxtxtmode.c.text.data.bssx Q ,6S Cj  .filegcrt_handler.cc .text .data.bssV L } + b60 SU B_ j4 u H.filegtlsthrd.c}  p  .text'#.data.bss  (-  +6P E0S ZjH uD .filegtlsmcrt.c.text.data.bssʹ  ,6pS Bj\ .fileg$.text.data.bss . ,6S3 Ljp .file gpesect.c8 S g w0    P   ` .textK".data.bssֻ 9c  E+6 ES _ Tj u@ .filegmingw_matherr.c.text, .data.bss Q ,6S> Ij .text, .data.bss.idata$7,.idata$5.idata$4L.idata$6 .text4 .data.bss.idata$7(.idata$5.idata$4H.idata$6 .text< .data.bss.idata$7$.idata$5 .idata$4D.idata$6 .textD .data.bss.idata$7 .idata$5.idata$4@.idata$6 .textL .data.bss.idata$7.idata$5.idata$4<.idata$6 .textT .data.bss.idata$7.idata$5.idata$48.idata$6 .text\ .data.bss.idata$7.idata$5.idata$44.idata$6 .textd .data.bss.idata$7.idata$5.idata$40.idata$6 .textl .data.bss.idata$7 .idata$5.idata$4,.idata$6 .textt .data.bss.idata$7.idata$5.idata$4(.idata$6 .text| .data.bss.idata$7.idata$5.idata$4$.idata$6 .text .data.bss.idata$7.idata$5.idata$4 .idata$6 .text .data.bss.idata$7.idata$5.idata$4.idata$6 .text .data.bss.idata$7.idata$5.idata$4.idata$6 .text .data.bss.idata$7.idata$5.idata$4.idata$6 .text .data.bss.idata$7.idata$5.idata$4.idata$6 .text .data.bss.idata$7.idata$5.idata$4 .idata$6z .text .data.bss.idata$7.idata$5.idata$4.idata$6p .text .data.bss.idata$7.idata$5.idata$4.idata$6f .text .data.bss.idata$7.idata$5.idata$4.idata$6X .text .data.bss.idata$7.idata$5.idata$4.idata$6N .text .data.bss.idata$7.idata$5.idata$4.idata$6: .text .data.bss.idata$7.idata$5.idata$4.idata$6( .text .data.bss.idata$7.idata$5.idata$4.idata$6 .text .data.bss.idata$7.idata$5.idata$4.idata$6 .text .data.bss.idata$7.idata$5.idata$4.idata$6 .fileg*  _handlerO  o    .text .data.bss  } h+#6 S nj u 4.filegfakehnamefthunk.text!.data.bss.idata$2d.idata$4.idata$5.file gfake.text!.data.bss.idata$4P.idata$5.idata$70 .filegfakehnamefthunkT.text!.data.bss.idata$2P.idata$4.idata$5T.file'gfake.text!.data.bss.idata$4.idata$5.idata$7 .filegcygming-crtend.c`" .text!.data.bss.jcr`""j .text.data.bss.idata$7.idata$5.idata$4.idata$6 .text.data.bss.idata$7.idata$5.idata$4.idata$6 .text.data.bss.idata$7.idata$5.idata$4.idata$6 .text.data.bss.idata$7.idata$5.idata$4.idata$6 .text.data.bss.idata$7.idata$5.idata$4.idata$6 .text.data.bss.idata$7.idata$5.idata$4.idata$6 .text.data.bss.idata$7.idata$5.idata$4.idata$6 .text.data.bss.idata$7.idata$5.idata$4.idata$6h .text.data.bss.idata$7.idata$5.idata$4.idata$6N .text.data.bss.idata$7.idata$5.idata$4.idata$66 .text.data.bss.idata$7.idata$5.idata$4.idata$6 .text.data.bss.idata$7.idata$5|.idata$4.idata$6 .text.data.bss.idata$7.idata$5x.idata$4.idata$6 .text.data.bss.idata$7.idata$5t.idata$4.idata$6 .text.data.bss.idata$7|.idata$5p.idata$4.idata$6 .text.data.bss.idata$7x.idata$5l.idata$4.idata$6 .text.data.bss.idata$7t.idata$5h.idata$4.idata$6 .text.data.bss.idata$7p.idata$5d.idata$4.idata$6 .text.data.bss.idata$7l.idata$5`.idata$4.idata$6| .text.data.bss.idata$7h.idata$5\.idata$4.idata$6h .text.data.bss.idata$7d.idata$5X.idata$4.idata$6P .text.data.bss.idata$7`.idata$5T.idata$4.idata$68 .idata$2.idata$5T.idata$4.idata$2.idata$5.idata$4 .idata$2(.idata$5.idata$4T.idata$2<.idata$58.idata$4p.idata$4.idata$5.idata$7 .idata$4P.idata$5.idata$7 .idata$4l.idata$54.idata$7.idata$4.idata$5P.idata$7H__cexit  ^K1pH  eh` "___xi_a _freet     ) Z i h       (  9  M b      ___xl_c    # B \ x         ___xl_z(  $ H  8 ( Y _g_free i __unlock<      x       $ = W c $p X   L `      2JH a n\   p,!?`b  x  ,__dll__h   _fwritel  !1@@ X iu  ___xc_a_memcpy\  tt(<Z^Kxh x,T @%2  A___xl_a___xl_d$Z"h\ $  __CRT_MT @  9 _fprintf|  I  `l|@  0   0L"[`x   _calloc    __fmode H9 Jp      - <dUsX    (0  6__lock  Nx  gD}TdX ___xc_z  __end__ 2lL c  p_signalT  _mallocd  "  9,K@Xf8  @ $_abort4  H6[ px  <     ,'|Dd~   ___xi_z(P 3_strncmpD  Kht  68 JPe0|  l-_strlenL  =Vlp d_exit  T(@8Y(  qp  P  0    3  S _Sleep@4l   (     < ,! !A!,  K!  j!!X!!!  !.debug_aranges.debug_info.debug_abbrev.debug_line.debug_frame.debug_str.debug_loc.debug_ranges___mingw_invalidParameterHandler_pre_c_init_managedapp_pre_cpp_init_startinfo___tmainCRTStartup_has_cctor_WinMainCRTStartup_mainCRTStartup.CRT$XCAA.CRT$XIAA.debug_info.debug_abbrev.debug_loc.debug_aranges.debug_ranges.debug_line.debug_str.rdata$zzz.debug_frame___JCR_LIST_____gcc_register_frame___gcc_deregister_frame_clicked_cb_show_action_dialog_activate_action_activate_about_change_radio_state_activate_radio_change_titlebar_state_activate_toggle_update_statusbar_activate_win_entries_mark_set_callback_change_theme_state_activate_quit_app_entries.text.startupapplication-standalone.c_demo_get_resource_static_resource_resource_constructor_resource_destructor_demo_resource_data.text.exit_mingw_onexit___do_global_dtors___do_global_ctors_initialized_my_lconv_init__setargv___security_init_cookie.data$__security_cookie.data$__security_cookie_complement___report_gsfailure_GS_ExceptionRecord_GS_ContextRecord_GS_ExceptionPointers___dyn_tls_dtor@12___dyn_tls_init@12___tlregdtor___mingw_raise_matherr_stUserMathErr___mingw_setusermatherr__matherr_CSWTCH.5__fpreset__decode_pointer__encode_pointer___report_error___write_memory.part.0_maxSections_the_secs__pei386_runtime_relocator_was_init.60640__gnu_exception_handler@4___mingwthr_run_key_dtors.part.0___mingwthr_cs_key_dtor_list____w64_mingwthr_add_key_dtor___mingwthr_cs_init____w64_mingwthr_remove_key_dtor___mingw_TLScallbackpseudo-reloc-list.c__ValidateImageBase.part.0__ValidateImageBase__FindPESection__FindPESectionByName___mingw_GetSectionForAddress___mingw_GetSectionCount__FindPESectionExec__GetPEImageBase__IsNonwritableInCurrentImage___mingw_enum_import_library_names_mingw_get_invalid_parameter_handler__get_invalid_parameter_handler_mingw_set_invalid_parameter_handler__set_invalid_parameter_handlerinvalid_parameter_handler.c___JCR_END___register_frame_ctor.ctors.65535_VirtualProtect@16___RUNTIME_PSEUDO_RELOC_LIST____imp__gtk_builder_new_gtk_application_get_windows__imp__gtk_builder_add_from_resource_QueryPerformanceCounter@4_g_object_unref__data_start_____DTOR_LIST____imp__VirtualProtect@16__imp___acmdln___setusermatherr_UnhandledExceptionFilter@4.weak.__Jv_RegisterClasses.___gcc_register_frame__imp___onexit__imp__GetLastError@0_SetUnhandledExceptionFilter@4__imp__VirtualQuery@12__imp__gtk_widget_hide_g_variant_new_boolean___tls_start_____native_startup_lock__imp__g_settings_new__imp__gtk_init_abi_check_gtk_label_set_text__imp__TlsGetValue@4__imp__InitializeCriticalSection@4__imp__gtk_menu_tool_button_set_menu_DeleteCriticalSection@4__rt_psrelocs_start__imp__abort__dll_characteristics____size_of_stack_commit____imp___fmode__imp__gtk_menu_new_from_model__size_of_stack_reserve____major_subsystem_version_____crt_xl_start____newmode___crt_xi_start____imp___amsg_exit_gtk_get_major_version___crt_xi_end____head_libgtk_3_0_dll__imp__gtk_label_set_text_gtk_application_new_gtk_statusbar_push_g_action_map_add_action_entries_GetLastError@0__imp__gtk_settings_get_default_gtk_init_abi_check__imp__QueryPerformanceCounter@4_g_object_get_data_gtk_widget_show_all_gtk_get_minor_version_VirtualQuery@12_libgtk_3_0_dll_iname_mingw_initltsdrot_force__imp__gtk_statusbar_push__imp___iob__dowildcard__imp__gtk_application_new_GetModuleHandleA@4__imp__strncmp__imp__g_signal_connect_object_gtk_settings_get_default__bss_start_____RUNTIME_PSEUDO_RELOC_LIST_END___g_settings_create_action__size_of_heap_commit___g_action_change_state___onexitend__imp__GetCurrentProcess@0__imp__gtk_text_view_get_buffer_gtk_builder_get_object_mingw_pcinit_g_variant_get_string__imp__GetProcAddress@8_GetProcAddress@8___crt_xp_start____MINGW_INSTALL_DEBUG_MATHERR__imp__gtk_application_set_menubar_gtk_window_set_title__imp__gtk_text_buffer_get_insert_gtk_application_window_new__imp__gtk_window_set_icon_name___crt_xp_end____imp__signal_gtk_message_dialog_new__minor_os_version___GetTickCount@0__image_base___libgio_2_0_0_dll_iname_g_variant_unref__imp__exit_gtk_window_set_icon_name__section_alignment____imp__gtk_widget_grab_focus__imp__gtk_text_buffer_get_iter_at_mark__imp__gtk_container_add__imp__GetStartupInfoA@4__IAT_end____imp____lconv_init__imp__gtk_text_iter_get_line__RUNTIME_PSEUDO_RELOC_LIST____tls_start_g_object_set_data__imp__gtk_get_major_version___native_startup_state__imp__gtk_application_get_windows__imp__g_action_change_state__imp__g_object_set_data__data_end_____getmainargs__imp__g_action_get_name__CTOR_LIST____imp__gtk_application_set_app_menu_g_settings_new___onexitbegin___set_app_type_g_variant_get_boolean__charmax___mingw_winmain_lpCmdLine__bss_end___g_static_resource_init___security_cookie_complement___crt_xc_end___gtk_widget_grab_focus__tls_index__imp__GetTickCount@0_gtk_text_buffer_get_char_count__imp__g_application_run___crt_xc_start___g_action_map_add_action__imp__gtk_window_set_title__imp__gtk_widget_destroy_gtk_widget_destroy__lib32_libkernel32_a_iname___CTOR_LIST____imp__GetCurrentProcessId@0_mingw_app_type__imp__g_action_get_state__initterm__imp__g_static_resource_fini_gtk_builder_new__imp__TerminateProcess@8__rt_psrelocs_size_GetStartupInfoA@4__imp__g_signal_connect_data_g_strdup_printf__imp__gtk_text_buffer_get_char_count_gtk_text_view_get_buffer_GetCurrentProcessId@0__imp____dllonexit__imp__gtk_show_about_dialog__imp__memcpy_gtk_application_set_app_menu__file_alignment___gtk_window_set_default_size__imp___unlock__head_lib32_libmsvcrt_a__imp__LeaveCriticalSection@4_gtk_show_about_dialog_gtk_container_add__imp__malloc___mingw_pinit__imp__g_variant_get_string__major_os_version____lib32_libmsvcrt_a_iname_g_application_run__imp__g_static_resource_init__head_libgio_2_0_0_dll_gtk_menu_new_from_model__imp__g_object_unref__IAT_start____imp__gtk_application_window_new_g_signal_connect_data_gtk_window_set_hide_titlebar_when_maximized__tls_end__imp____initenv__imp___get_invalid_parameter_handler__imp__GetModuleHandleA@4__imp__g_strdup_printf___dllonexit__imp__gtk_window_set_hide_titlebar_when_maximized__imp___lock__DTOR_LIST____imp__fprintf_TerminateProcess@8_EnterCriticalSection@4__imp___initterm_GetCurrentThreadId@0__size_of_heap_reserve_____crt_xt_start_____ImageBase__subsystem___gtk_text_buffer_get_insert__imp__strlen_g_action_get_name__imp__g_variant_get_boolean___mingw_oldexcpt_handler__imp__calloc_libgobject_2_0_0_dll_iname__imp__gtk_statusbar_pop___native_vcclrit_reason__imp__gtk_text_iter_get_line_offset__Jv_RegisterClasses__imp__GetSystemTimeAsFileTime@4_gtk_get_micro_version___lconv_init__imp__g_object_set_gtk_builder_add_from_resource__amsg_exit__imp____getmainargs__imp__g_variant_new_boolean__imp__gtk_get_micro_version__imp__g_settings_create_action___mingw_winmain_nShowCmd___native_dllmain_reason___tls_end___gtk_application_set_menubar_GetSystemTimeAsFileTime@4_mingw_pcppinit__head_libglib_2_0_0_dll_g_signal_connect_object_GetCurrentProcess@0_mingw_initltssuo_force_InitializeCriticalSection@4__imp__free__imp__gtk_widget_show_all__imp__SetUnhandledExceptionFilter@4__imp___set_invalid_parameter_handler__major_image_version____loader_flags___gtk_widget_show__imp__UnhandledExceptionFilter@4_g_action_get_state__head_lib32_libkernel32_a__imp__g_variant_unref___chkstk_ms__imp__gtk_window_set_default_size__rt_psrelocs_end__imp__gtk_builder_get_object__imp___cexit__minor_subsystem_version____minor_image_version____imp__Sleep@4__imp__vfprintf_libglib_2_0_0_dll_iname__imp____set_app_type___mingw_winmain_hInstance_g_object_set__imp__gtk_message_dialog_new_mingw_initltsdyn_force__imp__GetCurrentThreadId@0_TlsGetValue@4__imp__DeleteCriticalSection@4___security_cookie_LeaveCriticalSection@4__imp__g_object_get_data_gtk_text_iter_get_line_gtk_menu_tool_button_set_menu_gtk_statusbar_pop_gtk_text_buffer_get_iter_at_mark__imp__g_free__imp__g_action_map_add_action_entries__imp__gtk_widget_show__RUNTIME_PSEUDO_RELOC_LIST_END___g_static_resource_get_resource___dyn_tls_init_callback_g_static_resource_fini_mingw_initcharmax__imp____setusermatherr__tls_used_g_simple_action_set_state__head_libgobject_2_0_0_dll___crt_xt_end____imp__g_action_map_add_action__imp__g_simple_action_set_state_vfprintf_gtk_text_iter_get_line_offset__imp__gtk_get_minor_version__imp__EnterCriticalSection@4__imp__g_static_resource_get_resource__imp__fwrite_gtk_widget_hide