summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Makefile.am3
-rw-r--r--plugins/glade-catalog.dtd103
-rw-r--r--plugins/gnome/Makefile.am44
-rw-r--r--plugins/gnome/bonobo.xml.in70
-rw-r--r--plugins/gnome/canvas.xml.in80
-rw-r--r--plugins/gnome/glade-gnome.c1746
-rw-r--r--plugins/gnome/gnome.xml.in390
-rw-r--r--plugins/gnome/icons/16x16/Makefile.am31
-rw-r--r--plugins/gnome/icons/16x16/bonobodock.pngbin0 -> 142 bytes
-rw-r--r--plugins/gnome/icons/16x16/bonobodockitem.pngbin0 -> 156 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomeabout.pngbin0 -> 221 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomeapp.pngbin0 -> 168 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomeappbar.pngbin0 -> 113 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomecanvas.pngbin0 -> 108 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomecolorpicker.pngbin0 -> 199 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomedateedit.pngbin0 -> 164 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomedialog.pngbin0 -> 206 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomedruid.pngbin0 -> 150 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomedruidpageedge.pngbin0 -> 150 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomedruidpagestandard.pngbin0 -> 155 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomeentry.pngbin0 -> 153 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomefileentry.pngbin0 -> 164 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomefontpicker.pngbin0 -> 291 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomehref.pngbin0 -> 121 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomeiconentry.pngbin0 -> 204 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomeiconlist.pngbin0 -> 241 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomeiconselection.pngbin0 -> 224 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomemessagebox.pngbin0 -> 229 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomepixmap.pngbin0 -> 268 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomepixmapentry.pngbin0 -> 164 bytes
-rw-r--r--plugins/gnome/icons/16x16/gnomepropertybox.pngbin0 -> 224 bytes
-rw-r--r--plugins/gnome/icons/22x22/Makefile.am31
-rw-r--r--plugins/gnome/icons/22x22/bonobodock.pngbin0 -> 147 bytes
-rw-r--r--plugins/gnome/icons/22x22/bonobodockitem.pngbin0 -> 174 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomeabout.pngbin0 -> 236 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomeapp.pngbin0 -> 181 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomeappbar.pngbin0 -> 122 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomecanvas.pngbin0 -> 115 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomecolorpicker.pngbin0 -> 168 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomedateedit.pngbin0 -> 177 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomedialog.pngbin0 -> 283 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomedruid.pngbin0 -> 143 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomedruidpageedge.pngbin0 -> 143 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomedruidpagestandard.pngbin0 -> 143 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomeentry.pngbin0 -> 170 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomefileentry.pngbin0 -> 177 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomefontpicker.pngbin0 -> 175 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomehref.pngbin0 -> 150 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomeiconentry.pngbin0 -> 226 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomeiconlist.pngbin0 -> 265 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomeiconselection.pngbin0 -> 274 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomemessagebox.pngbin0 -> 310 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomepixmap.pngbin0 -> 269 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomepixmapentry.pngbin0 -> 177 bytes
-rw-r--r--plugins/gnome/icons/22x22/gnomepropertybox.pngbin0 -> 263 bytes
-rw-r--r--plugins/gnome/icons/Makefile.am3
-rw-r--r--plugins/gtk+/Makefile.am44
-rw-r--r--plugins/gtk+/glade-gtk.c5871
-rw-r--r--plugins/gtk+/glade-gtk.h31
-rw-r--r--plugins/gtk+/gtk+.xml.in1418
-rw-r--r--plugins/gtk+/icons/.cvsignore2
-rw-r--r--plugins/gtk+/icons/16x16/Makefile.am89
-rw-r--r--plugins/gtk+/icons/16x16/aboutdialog.pngbin0 -> 221 bytes
-rw-r--r--plugins/gtk+/icons/16x16/accellabel.pngbin0 -> 113 bytes
-rw-r--r--plugins/gtk+/icons/16x16/alignment.pngbin0 -> 141 bytes
-rw-r--r--plugins/gtk+/icons/16x16/arrow.pngbin0 -> 124 bytes
-rw-r--r--plugins/gtk+/icons/16x16/aspectframe.pngbin0 -> 188 bytes
-rw-r--r--plugins/gtk+/icons/16x16/button.pngbin0 -> 220 bytes
-rw-r--r--plugins/gtk+/icons/16x16/calendar.pngbin0 -> 152 bytes
-rw-r--r--plugins/gtk+/icons/16x16/checkbutton.pngbin0 -> 155 bytes
-rw-r--r--plugins/gtk+/icons/16x16/checkmenuitem.pngbin0 -> 177 bytes
-rw-r--r--plugins/gtk+/icons/16x16/clist.pngbin0 -> 148 bytes
-rw-r--r--plugins/gtk+/icons/16x16/colorbutton.pngbin0 -> 199 bytes
-rw-r--r--plugins/gtk+/icons/16x16/colorselection.pngbin0 -> 312 bytes
-rw-r--r--plugins/gtk+/icons/16x16/colorselectiondialog.pngbin0 -> 332 bytes
-rw-r--r--plugins/gtk+/icons/16x16/combo.pngbin0 -> 157 bytes
-rw-r--r--plugins/gtk+/icons/16x16/combobox.pngbin0 -> 153 bytes
-rw-r--r--plugins/gtk+/icons/16x16/comboboxentry.pngbin0 -> 153 bytes
-rw-r--r--plugins/gtk+/icons/16x16/curve.pngbin0 -> 222 bytes
-rw-r--r--plugins/gtk+/icons/16x16/custom.pngbin0 -> 130 bytes
-rw-r--r--plugins/gtk+/icons/16x16/default.pngbin0 -> 215 bytes
-rw-r--r--plugins/gtk+/icons/16x16/dialog.pngbin0 -> 212 bytes
-rw-r--r--plugins/gtk+/icons/16x16/drawingarea.pngbin0 -> 384 bytes
-rw-r--r--plugins/gtk+/icons/16x16/entry.pngbin0 -> 113 bytes
-rw-r--r--plugins/gtk+/icons/16x16/eventbox.pngbin0 -> 223 bytes
-rw-r--r--plugins/gtk+/icons/16x16/expander.pngbin0 -> 141 bytes
-rw-r--r--plugins/gtk+/icons/16x16/filechooserbutton.pngbin0 -> 234 bytes
-rw-r--r--plugins/gtk+/icons/16x16/filechooserdialog.pngbin0 -> 160 bytes
-rw-r--r--plugins/gtk+/icons/16x16/fileselection.pngbin0 -> 160 bytes
-rw-r--r--plugins/gtk+/icons/16x16/fileselectiondialog.pngbin0 -> 160 bytes
-rw-r--r--plugins/gtk+/icons/16x16/fixed.pngbin0 -> 128 bytes
-rw-r--r--plugins/gtk+/icons/16x16/fontbutton.pngbin0 -> 291 bytes
-rw-r--r--plugins/gtk+/icons/16x16/fontselection.pngbin0 -> 286 bytes
-rw-r--r--plugins/gtk+/icons/16x16/fontselectiondialog.pngbin0 -> 322 bytes
-rw-r--r--plugins/gtk+/icons/16x16/frame.pngbin0 -> 128 bytes
-rw-r--r--plugins/gtk+/icons/16x16/gammacurve.pngbin0 -> 222 bytes
-rw-r--r--plugins/gtk+/icons/16x16/gtktextview.pngbin0 -> 1419 bytes
-rw-r--r--plugins/gtk+/icons/16x16/handlebox.pngbin0 -> 156 bytes
-rw-r--r--plugins/gtk+/icons/16x16/hbox.pngbin0 -> 106 bytes
-rw-r--r--plugins/gtk+/icons/16x16/hbuttonbox.pngbin0 -> 128 bytes
-rw-r--r--plugins/gtk+/icons/16x16/hpaned.pngbin0 -> 107 bytes
-rw-r--r--plugins/gtk+/icons/16x16/hruler.pngbin0 -> 127 bytes
-rw-r--r--plugins/gtk+/icons/16x16/hscale.pngbin0 -> 165 bytes
-rw-r--r--plugins/gtk+/icons/16x16/hscrollbar.pngbin0 -> 145 bytes
-rw-r--r--plugins/gtk+/icons/16x16/hseparator.pngbin0 -> 97 bytes
-rw-r--r--plugins/gtk+/icons/16x16/iconview.pngbin0 -> 241 bytes
-rw-r--r--plugins/gtk+/icons/16x16/image.pngbin0 -> 367 bytes
-rw-r--r--plugins/gtk+/icons/16x16/imagemenuitem.pngbin0 -> 181 bytes
-rw-r--r--plugins/gtk+/icons/16x16/inputdialog.pngbin0 -> 192 bytes
-rw-r--r--plugins/gtk+/icons/16x16/label.pngbin0 -> 113 bytes
-rw-r--r--plugins/gtk+/icons/16x16/layout.pngbin0 -> 159 bytes
-rw-r--r--plugins/gtk+/icons/16x16/list.pngbin0 -> 126 bytes
-rw-r--r--plugins/gtk+/icons/16x16/listitem.pngbin0 -> 94 bytes
-rw-r--r--plugins/gtk+/icons/16x16/menu.pngbin0 -> 147 bytes
-rw-r--r--plugins/gtk+/icons/16x16/menubar.pngbin0 -> 155 bytes
-rw-r--r--plugins/gtk+/icons/16x16/menuitem.pngbin0 -> 114 bytes
-rw-r--r--plugins/gtk+/icons/16x16/menutoolbutton.pngbin0 -> 156 bytes
-rw-r--r--plugins/gtk+/icons/16x16/messagedialog.pngbin0 -> 229 bytes
-rw-r--r--plugins/gtk+/icons/16x16/notebook.pngbin0 -> 166 bytes
-rw-r--r--plugins/gtk+/icons/16x16/optionmenu.pngbin0 -> 153 bytes
-rw-r--r--plugins/gtk+/icons/16x16/progressbar.pngbin0 -> 240 bytes
-rw-r--r--plugins/gtk+/icons/16x16/radiobutton.pngbin0 -> 285 bytes
-rw-r--r--plugins/gtk+/icons/16x16/radiomenuitem.pngbin0 -> 239 bytes
-rw-r--r--plugins/gtk+/icons/16x16/radiotoolbutton.pngbin0 -> 281 bytes
-rw-r--r--plugins/gtk+/icons/16x16/ruler.pngbin0 -> 127 bytes
-rw-r--r--plugins/gtk+/icons/16x16/scrolledwindow.pngbin0 -> 254 bytes
-rw-r--r--plugins/gtk+/icons/16x16/separatormenuitem.pngbin0 -> 114 bytes
-rw-r--r--plugins/gtk+/icons/16x16/separatortoolitem.pngbin0 -> 89 bytes
-rw-r--r--plugins/gtk+/icons/16x16/spinbutton.pngbin0 -> 155 bytes
-rw-r--r--plugins/gtk+/icons/16x16/statusbar.pngbin0 -> 107 bytes
-rw-r--r--plugins/gtk+/icons/16x16/table.pngbin0 -> 112 bytes
-rw-r--r--plugins/gtk+/icons/16x16/textview.pngbin0 -> 131 bytes
-rw-r--r--plugins/gtk+/icons/16x16/togglebutton.pngbin0 -> 217 bytes
-rw-r--r--plugins/gtk+/icons/16x16/toggletoolbutton.pngbin0 -> 150 bytes
-rw-r--r--plugins/gtk+/icons/16x16/toolbar.pngbin0 -> 284 bytes
-rw-r--r--plugins/gtk+/icons/16x16/toolbutton.pngbin0 -> 141 bytes
-rw-r--r--plugins/gtk+/icons/16x16/toolitem.pngbin0 -> 127 bytes
-rw-r--r--plugins/gtk+/icons/16x16/treeview.pngbin0 -> 148 bytes
-rw-r--r--plugins/gtk+/icons/16x16/vbox.pngbin0 -> 137 bytes
-rw-r--r--plugins/gtk+/icons/16x16/vbuttonbox.pngbin0 -> 124 bytes
-rw-r--r--plugins/gtk+/icons/16x16/viewport.pngbin0 -> 156 bytes
-rw-r--r--plugins/gtk+/icons/16x16/vpaned.pngbin0 -> 137 bytes
-rw-r--r--plugins/gtk+/icons/16x16/vruler.pngbin0 -> 150 bytes
-rw-r--r--plugins/gtk+/icons/16x16/vscale.pngbin0 -> 177 bytes
-rw-r--r--plugins/gtk+/icons/16x16/vscrollbar.pngbin0 -> 260 bytes
-rw-r--r--plugins/gtk+/icons/16x16/vseparator.pngbin0 -> 99 bytes
-rw-r--r--plugins/gtk+/icons/16x16/window.pngbin0 -> 146 bytes
-rw-r--r--plugins/gtk+/icons/22x22/Makefile.am89
-rw-r--r--plugins/gtk+/icons/22x22/aboutdialog.pngbin0 -> 236 bytes
-rw-r--r--plugins/gtk+/icons/22x22/accellabel.pngbin0 -> 131 bytes
-rw-r--r--plugins/gtk+/icons/22x22/alignment.pngbin0 -> 160 bytes
-rw-r--r--plugins/gtk+/icons/22x22/arrow.pngbin0 -> 134 bytes
-rw-r--r--plugins/gtk+/icons/22x22/aspectframe.pngbin0 -> 229 bytes
-rw-r--r--plugins/gtk+/icons/22x22/button.pngbin0 -> 181 bytes
-rw-r--r--plugins/gtk+/icons/22x22/calendar.pngbin0 -> 161 bytes
-rw-r--r--plugins/gtk+/icons/22x22/checkbutton.pngbin0 -> 179 bytes
-rw-r--r--plugins/gtk+/icons/22x22/checkmenuitem.pngbin0 -> 202 bytes
-rw-r--r--plugins/gtk+/icons/22x22/clist.pngbin0 -> 158 bytes
-rw-r--r--plugins/gtk+/icons/22x22/colorbutton.pngbin0 -> 168 bytes
-rw-r--r--plugins/gtk+/icons/22x22/colorselection.pngbin0 -> 458 bytes
-rw-r--r--plugins/gtk+/icons/22x22/colorselectiondialog.pngbin0 -> 467 bytes
-rw-r--r--plugins/gtk+/icons/22x22/combo.pngbin0 -> 164 bytes
-rw-r--r--plugins/gtk+/icons/22x22/combobox.pngbin0 -> 263 bytes
-rw-r--r--plugins/gtk+/icons/22x22/comboboxentry.pngbin0 -> 170 bytes
-rw-r--r--plugins/gtk+/icons/22x22/curve.pngbin0 -> 235 bytes
-rw-r--r--plugins/gtk+/icons/22x22/custom.pngbin0 -> 138 bytes
-rw-r--r--plugins/gtk+/icons/22x22/default.pngbin0 -> 116 bytes
-rw-r--r--plugins/gtk+/icons/22x22/dialog.pngbin0 -> 283 bytes
-rw-r--r--plugins/gtk+/icons/22x22/drawingarea.pngbin0 -> 689 bytes
-rw-r--r--plugins/gtk+/icons/22x22/entry.pngbin0 -> 125 bytes
-rw-r--r--plugins/gtk+/icons/22x22/eventbox.pngbin0 -> 223 bytes
-rw-r--r--plugins/gtk+/icons/22x22/expander.pngbin0 -> 152 bytes
-rw-r--r--plugins/gtk+/icons/22x22/filechooserbutton.pngbin0 -> 198 bytes
-rw-r--r--plugins/gtk+/icons/22x22/filechooserdialog.pngbin0 -> 234 bytes
-rw-r--r--plugins/gtk+/icons/22x22/fileselection.pngbin0 -> 234 bytes
-rw-r--r--plugins/gtk+/icons/22x22/fixed.pngbin0 -> 122 bytes
-rw-r--r--plugins/gtk+/icons/22x22/fontbutton.pngbin0 -> 175 bytes
-rw-r--r--plugins/gtk+/icons/22x22/fontselection.pngbin0 -> 281 bytes
-rw-r--r--plugins/gtk+/icons/22x22/fontselectiondialog.pngbin0 -> 321 bytes
-rw-r--r--plugins/gtk+/icons/22x22/frame.pngbin0 -> 143 bytes
-rw-r--r--plugins/gtk+/icons/22x22/gammacurve.pngbin0 -> 235 bytes
-rw-r--r--plugins/gtk+/icons/22x22/handlebox.pngbin0 -> 174 bytes
-rw-r--r--plugins/gtk+/icons/22x22/hbox.pngbin0 -> 114 bytes
-rw-r--r--plugins/gtk+/icons/22x22/hbuttonbox.pngbin0 -> 136 bytes
-rw-r--r--plugins/gtk+/icons/22x22/hpaned.pngbin0 -> 118 bytes
-rw-r--r--plugins/gtk+/icons/22x22/hruler.pngbin0 -> 138 bytes
-rw-r--r--plugins/gtk+/icons/22x22/hscale.pngbin0 -> 172 bytes
-rw-r--r--plugins/gtk+/icons/22x22/hscrollbar.pngbin0 -> 155 bytes
-rw-r--r--plugins/gtk+/icons/22x22/hseparator.pngbin0 -> 101 bytes
-rw-r--r--plugins/gtk+/icons/22x22/iconview.pngbin0 -> 265 bytes
-rw-r--r--plugins/gtk+/icons/22x22/image.pngbin0 -> 269 bytes
-rw-r--r--plugins/gtk+/icons/22x22/imagemenuitem.pngbin0 -> 185 bytes
-rw-r--r--plugins/gtk+/icons/22x22/inputdialog.pngbin0 -> 214 bytes
-rw-r--r--plugins/gtk+/icons/22x22/label.pngbin0 -> 205 bytes
-rw-r--r--plugins/gtk+/icons/22x22/layout.pngbin0 -> 186 bytes
-rw-r--r--plugins/gtk+/icons/22x22/list.pngbin0 -> 135 bytes
-rw-r--r--plugins/gtk+/icons/22x22/listitem.pngbin0 -> 95 bytes
-rw-r--r--plugins/gtk+/icons/22x22/menu.pngbin0 -> 164 bytes
-rw-r--r--plugins/gtk+/icons/22x22/menubar.pngbin0 -> 183 bytes
-rw-r--r--plugins/gtk+/icons/22x22/menuitem.pngbin0 -> 127 bytes
-rw-r--r--plugins/gtk+/icons/22x22/menutoolbutton.pngbin0 -> 185 bytes
-rw-r--r--plugins/gtk+/icons/22x22/messagedialog.pngbin0 -> 310 bytes
-rw-r--r--plugins/gtk+/icons/22x22/notebook.pngbin0 -> 175 bytes
-rw-r--r--plugins/gtk+/icons/22x22/optionmenu.pngbin0 -> 171 bytes
-rw-r--r--plugins/gtk+/icons/22x22/progressbar.pngbin0 -> 138 bytes
-rw-r--r--plugins/gtk+/icons/22x22/radiobutton.pngbin0 -> 257 bytes
-rw-r--r--plugins/gtk+/icons/22x22/radiomenuitem.pngbin0 -> 323 bytes
-rw-r--r--plugins/gtk+/icons/22x22/radiotoolbutton.pngbin0 -> 362 bytes
-rw-r--r--plugins/gtk+/icons/22x22/ruler.pngbin0 -> 138 bytes
-rw-r--r--plugins/gtk+/icons/22x22/scrolledwindow.pngbin0 -> 339 bytes
-rw-r--r--plugins/gtk+/icons/22x22/separatormenuitem.pngbin0 -> 127 bytes
-rw-r--r--plugins/gtk+/icons/22x22/separatortoolitem.pngbin0 -> 96 bytes
-rw-r--r--plugins/gtk+/icons/22x22/spinbutton.pngbin0 -> 206 bytes
-rw-r--r--plugins/gtk+/icons/22x22/statusbar.pngbin0 -> 116 bytes
-rw-r--r--plugins/gtk+/icons/22x22/table.pngbin0 -> 120 bytes
-rw-r--r--plugins/gtk+/icons/22x22/textview.pngbin0 -> 148 bytes
-rw-r--r--plugins/gtk+/icons/22x22/togglebutton.pngbin0 -> 200 bytes
-rw-r--r--plugins/gtk+/icons/22x22/toggletoolbutton.pngbin0 -> 149 bytes
-rw-r--r--plugins/gtk+/icons/22x22/toolbar.pngbin0 -> 187 bytes
-rw-r--r--plugins/gtk+/icons/22x22/toolbutton.pngbin0 -> 149 bytes
-rw-r--r--plugins/gtk+/icons/22x22/toolitem.pngbin0 -> 132 bytes
-rw-r--r--plugins/gtk+/icons/22x22/treeview.pngbin0 -> 158 bytes
-rw-r--r--plugins/gtk+/icons/22x22/vbox.pngbin0 -> 142 bytes
-rw-r--r--plugins/gtk+/icons/22x22/vbuttonbox.pngbin0 -> 134 bytes
-rw-r--r--plugins/gtk+/icons/22x22/viewport.pngbin0 -> 186 bytes
-rw-r--r--plugins/gtk+/icons/22x22/vpaned.pngbin0 -> 143 bytes
-rw-r--r--plugins/gtk+/icons/22x22/vruler.pngbin0 -> 158 bytes
-rw-r--r--plugins/gtk+/icons/22x22/vscale.pngbin0 -> 164 bytes
-rw-r--r--plugins/gtk+/icons/22x22/vscrollbar.pngbin0 -> 344 bytes
-rw-r--r--plugins/gtk+/icons/22x22/vseparator.pngbin0 -> 107 bytes
-rw-r--r--plugins/gtk+/icons/22x22/window.pngbin0 -> 169 bytes
-rw-r--r--plugins/gtk+/icons/Makefile.am3
232 files changed, 10048 insertions, 0 deletions
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
new file mode 100644
index 00000000..a65e7a2b
--- /dev/null
+++ b/plugins/Makefile.am
@@ -0,0 +1,3 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = gtk+ gnome
diff --git a/plugins/glade-catalog.dtd b/plugins/glade-catalog.dtd
new file mode 100644
index 00000000..5a77c3f1
--- /dev/null
+++ b/plugins/glade-catalog.dtd
@@ -0,0 +1,103 @@
+<!ELEMENT glade-catalog (glade-widget-classes?,
+ glade-widget-group*)>
+
+<!ATTLIST glade-catalog name CDATA #REQUIRED
+ library CDATA #IMPLIED
+ requires CDATA #IMPLIED>
+
+<!ELEMENT glade-widget-classes (glade-widget-class+)>
+
+<!ELEMENT glade-widget-class (post-create-function?,
+ get-internal-child-function?,
+ child-property-applies-function?,
+ properties?,
+ children?,
+ packing-defaults?)>
+
+<!ATTLIST glade-widget-class toplevel CDATA #IMPLIED
+ name CDATA #REQUIRED
+ generic-name CDATA #IMPLIED
+ title CDATA #IMPLIED>
+
+<!ELEMENT properties (property+)>
+
+<!ELEMENT property (spec?,
+ type?,
+ tooltip?,
+ parameters?,
+ set-function?,
+ get-function?,
+ verify-function?)>
+
+<!ATTLIST property id CDATA #REQUIRED
+ name CDATA #IMPLIED
+ default CDATA #IMPLIED
+ query CDATA #IMPLIED
+ common CDATA #IMPLIED
+ disabled CDATA #IMPLIED
+ visible CDATA #IMPLIED
+ optional CDATA #IMPLIED
+ optional-default CDATA #IMPLIED
+ translatable CDATA #IMPLIED>
+
+<!ELEMENT set-function (#PCDATA)>
+<!ELEMENT get-function (#PCDATA)>
+<!ELEMENT spec (#PCDATA)>
+<!ELEMENT tooltip (#PCDATA)>
+<!ELEMENT verify-function (#PCDATA)>
+
+<!ELEMENT parameters (parameter+)>
+
+<!ELEMENT parameter EMPTY>
+
+<!ATTLIST parameter key CDATA #REQUIRED
+ value CDATA #REQUIRED>
+
+<!ELEMENT children (child+)>
+
+<!ELEMENT child (type,
+ add-child-function?,
+ remove-child-function?,
+ get-children-function?,
+ get-all-children-function?,
+ set-property-function?,
+ get-property-function?,
+ replace-child-function?,
+ fill-empty-function?,
+ properties?)>
+
+<!ELEMENT type (#PCDATA)>
+<!ELEMENT add-child-function (#PCDATA)>
+<!ELEMENT remove-child-function (#PCDATA)>
+<!ELEMENT get-children-function (#PCDATA)>
+<!ELEMENT get-all-children-function (#PCDATA)>
+<!ELEMENT set-prop-function (#PCDATA)>
+<!ELEMENT get-prop-function (#PCDATA)>
+<!ELEMENT fill-empty-function (#PCDATA)>
+<!ELEMENT replace-child-function (#PCDATA)>
+
+<!ELEMENT post-create-function (#PCDATA)>
+<!ELEMENT get-internal-child-function (#PCDATA)>
+<!ELEMENT child-property-applies-function (#PCDATA)>
+
+<!ELEMENT glade-widget-group (default-palette-state?,
+ glade-widget-class-ref+)>
+
+<!ATTLIST glade-widget-group name CDATA #REQUIRED
+ title CDATA #REQUIRED>
+
+<!ELEMENT default-palette-state EMPTY>
+<!ATTLIST default-palette-state expanded CDATA #IMPLIED>
+
+<!ELEMENT glade-widget-class-ref EMPTY>
+<!ATTLIST glade-widget-class-ref name CDATA #REQUIRED>
+
+<!ELEMENT packing-defaults (parent-class+)>
+
+<!ELEMENT parent-class (child-property+)>
+<!ATTLIST parent-class name CDATA #REQUIRED>
+
+<!ELEMENT child-property EMPTY>
+<!ATTLIST child-property id CDATA #REQUIRED
+ default CDATA #REQUIRED>
+
diff --git a/plugins/gnome/Makefile.am b/plugins/gnome/Makefile.am
new file mode 100644
index 00000000..879751ef
--- /dev/null
+++ b/plugins/gnome/Makefile.am
@@ -0,0 +1,44 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = icons
+
+libgladeui = $(top_builddir)/gladeui/libgladeui-1.la
+
+
+# libgladegnome
+
+gladegnome_LTLIBRARIES = libgladegnome.la
+gladegnomedir = $(pkglibdir)/modules
+
+libgladegnome_la_SOURCES = glade-gnome.c
+libgladegnome_la_CPPFLAGS = $(AM_CPPFLAGS)
+libgladegnome_la_CFLAGS = \
+ -g -Wall \
+ -I$(top_srcdir)/gladeui \
+ -I$(top_builddir)/gladeui \
+ -I$(top_srcdir)/plugins/gtk+ \
+ $(GNOME_CFLAGS) \
+ $(AM_CPPFLAGS)
+libgladegnome_la_LDFLAGS = -module -avoid-version $(GNOME_LIBS) $(AM_LDFLAGS)
+libgladegnome_la_LIBADD = $(libgladeui) $(GLADE_LIBS)
+
+if WITH_WIN32
+ libgladegnome_la_LDFLAGS += -no-undefined
+endif
+
+
+# catalog data
+
+catalogsdir = $(pkgdatadir)/catalogs
+catalogs_DATA = bonobo.xml \
+ canvas.xml \
+ gnome.xml \
+ bonobo.xml.in \
+ canvas.xml.in \
+ gnome.xml.in
+@INTLTOOL_XML_NOMERGE_RULE@
+
+
+CLEANFILES = bonobo.xml canvas.xml gnome.xml
+
+EXTRA_DIST = $(catalogs_DATA)
diff --git a/plugins/gnome/bonobo.xml.in b/plugins/gnome/bonobo.xml.in
new file mode 100644
index 00000000..9e9eddf2
--- /dev/null
+++ b/plugins/gnome/bonobo.xml.in
@@ -0,0 +1,70 @@
+<glade-catalog name="bonobo" library="gladegnome" depends="gnome" domain="glade-3">
+ <glade-widget-classes>
+ <glade-widget-class name="BonoboDock" generic-name="bonobodock" title="Bonobo Dock">
+ <set-property-function>glade_gnome_bonobodock_set_property</set-property-function>
+ <add-child-function>glade_gnome_bonobodock_add_child</add-child-function>
+ <remove-child-function>glade_gnome_bonobodock_remove_child</remove-child-function>
+ <replace-child-function>glade_gnome_bonobodock_replace_child</replace-child-function>
+ <get-children-function>glade_gnome_bonobodock_get_children</get-children-function>
+ <child-set-property-function>glade_gnome_bonobodock_set_child_property</child-set-property-function>
+ <child-get-property-function>glade_gnome_bonobodock_get_child_property</child-get-property-function>
+ <properties>
+ <property id="allow-floating" name="Allow Floating">
+ <tooltip>If floating dock iteam are allowed</tooltip>
+ <spec>glade_standard_boolean_spec</spec>
+ </property>
+ </properties>
+
+ <packing-properties>
+ <property id="placement">
+ <spec>glade_gnome_bonobo_dock_placement_spec</spec>
+ <displayable-values>
+ <value id="BONOBO_DOCK_LEFT" _name="Left"/>
+ <value id="BONOBO_DOCK_RIGHT" _name="Right"/>
+ <value id="BONOBO_DOCK_TOP" _name="Top"/>
+ <value id="BONOBO_DOCK_BOTTOM" _name="Bottom"/>
+ <value id="BONOBO_DOCK_FLOATING" _name="Floating"/>
+ </displayable-values>
+ </property>
+ <property id="band" name="Band">
+ <spec>glade_standard_int_spec</spec>
+ </property>
+ <property id="position" name="Position">
+ <spec>glade_standard_int_spec</spec>
+ </property>
+ <property id="offset" name="Offset">
+ <spec>glade_standard_int_spec</spec>
+ </property>
+ <property id="behavior">
+ <spec>glade_gnome_bonobo_dock_item_behavior_spec</spec>
+ <displayable-values>
+ <value id="BONOBO_DOCK_ITEM_BEH_EXCLUSIVE" _name="Exclusive"/>
+ <value id="BONOBO_DOCK_ITEM_BEH_NEVER_FLOATING" _name="Never Floating"/>
+ <value id="BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL" _name="Never Vertical"/>
+ <value id="BONOBO_DOCK_ITEM_BEH_NEVER_HORIZONTAL" _name="Never Horizontal"/>
+ <value id="BONOBO_DOCK_ITEM_BEH_LOCKED" _name="Locked"/>
+ </displayable-values>
+ </property>
+ </packing-properties>
+ </glade-widget-class>
+ <glade-widget-class name="BonoboDockItem" generic-name="bonobodockitem" title="Bonobo Dock Item">
+ <properties>
+ <property id="shadow">
+ <displayable-values>
+ <value id="GTK_SHADOW_NONE" _name="None"/>
+ <value id="GTK_SHADOW_IN" _name="In"/>
+ <value id="GTK_SHADOW_OUT" _name="Out"/>
+ <value id="GTK_SHADOW_ETCHED_IN" _name="Etched In"/>
+ <value id="GTK_SHADOW_ETCHED_OUT" _name="Etched Out"/>
+ </displayable-values>
+ </property>
+ <property id="orientation">
+ <displayable-values>
+ <value id="GTK_ORIENTATION_HORIZONTAL" _name="Horizontal"/>
+ <value id="GTK_ORIENTATION_VERTICAL" _name="Vertical"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+ </glade-widget-classes>
+</glade-catalog>
diff --git a/plugins/gnome/canvas.xml.in b/plugins/gnome/canvas.xml.in
new file mode 100644
index 00000000..5e2db28d
--- /dev/null
+++ b/plugins/gnome/canvas.xml.in
@@ -0,0 +1,80 @@
+<glade-catalog name="canvas" library="gladegnome" depends="gnome" domain="glade-3">
+ <glade-widget-classes>
+ <glade-widget-class name="GnomeCanvas" generic-name="gnomecanvas" title="Gnome Canvas">
+ <set-property-function>glade_gnome_canvas_set_property</set-property-function>
+ <properties>
+ <property id="scroll-x1" _name="Min X">
+ <_tooltip>The minimum x coordinate</_tooltip>
+ <spec>glade_standard_float_spec</spec>
+ </property>
+ <property id="scroll-y1" _name="Min Y">
+ <_tooltip>The minimum y coordinate</_tooltip>
+ <spec>glade_standard_float_spec</spec>
+ </property>
+ <property id="scroll-x2" _name="Max X">
+ <_tooltip>The maximum x coordinate</_tooltip>
+ <spec>glade_standard_float_spec</spec>
+ </property>
+ <property id="scroll-y2" _name="Max Y">
+ <_tooltip>The maximum y coordinate</_tooltip>
+ <spec>glade_standard_float_spec</spec>
+ </property>
+ <property id="pixels-per-unit" _name="Pixels per unit">
+ <_tooltip>The number of pixels corresponding to one unit</_tooltip>
+ <spec>glade_standard_float_spec</spec>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <!-- This is deprecated -->
+ <glade-widget-class name="GnomeIconList" generic-name="gnomeiconlist" title="Gnome Icon List">
+ <post-create-function>glade_gnome_icon_list_post_create</post-create-function>
+ <set-property-function>glade_gnome_icon_list_set_property</set-property-function>
+ <properties>
+ <property id="scroll-x1" disabled="True"/>
+ <property id="scroll-y1" disabled="True"/>
+ <property id="scroll-x2" disabled="True"/>
+ <property id="scroll-y2" disabled="True"/>
+ <property id="pixels-per-unit" disabled="True"/>
+ <property id="selection-mode" _name="Selection Mode">
+ <_tooltip>The selection mode</_tooltip>
+ <spec>glade_gnome_icon_list_selection_mode_spec</spec>
+ <displayable-values>
+ <value id="GTK_SELECTION_SINGLE" _name="Single"/>
+ <value id="GTK_SELECTION_BROWSE" _name="Browse"/>
+ <value id="GTK_SELECTION_MULTIPLE" _name="Multiple"/>
+ </displayable-values>
+ </property>
+ <property id="icon-width" _name="Icon Width" default="78">
+ <_tooltip>The width of each icon</_tooltip>
+ <spec>glade_standard_int_spec</spec>
+ </property>
+ <property id="row-spacing" _name="Row Spacing" default="4">
+ <_tooltip>The number of pixels between rows of icons</_tooltip>
+ <spec>glade_standard_int_spec</spec>
+ </property>
+ <property id="column-spacing" _name="Column Spacing" default="2">
+ <_tooltip>The number of pixels between columns of icons</_tooltip>
+ <spec>glade_standard_int_spec</spec>
+ </property>
+ <property id="text-spacing" _name="Text Spacing" default="2">
+ <_tooltip>The number of pixels between the text and the icon</_tooltip>
+ <spec>glade_standard_int_spec</spec>
+ </property>
+ <property id="text-editable" _name="Text Editable" ignore="True">
+ <_tooltip>If the icon text can be edited by the user</_tooltip>
+ <spec>glade_standard_boolean_spec</spec>
+ </property>
+ <property id="text-static" _name="Text Static" ignore="True">
+ <_tooltip>If the icon text is static, in which case it will not be copied by the GnomeIconList</_tooltip>
+ <spec>glade_standard_boolean_spec</spec>
+ </property>
+ </properties>
+ </glade-widget-class>
+ </glade-widget-classes>
+
+ <glade-widget-group name="gnome-canvas" _title="GNOME Canvas">
+ <glade-widget-class-ref name="GnomeCanvas"/>
+ <glade-widget-class-ref name="GnomeIconList"/>
+ </glade-widget-group>
+</glade-catalog>
diff --git a/plugins/gnome/glade-gnome.c b/plugins/gnome/glade-gnome.c
new file mode 100644
index 00000000..893145f7
--- /dev/null
+++ b/plugins/gnome/glade-gnome.c
@@ -0,0 +1,1746 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006 Juan Pablo Ugarte.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Authors:
+ * Juan Pablo Ugarte <juanpablougarte@gmail.com>
+ */
+
+#include <config.h>
+
+#include <glade.h>
+#include <glade-editor-property.h>
+#include <glade-gtk.h>
+
+#include <libbonoboui.h>
+#include <libgnome/libgnome.h>
+#include <libgnomeui/libgnomeui.h>
+
+#ifdef G_OS_WIN32
+#define GLADEGNOME_API __declspec(dllexport)
+#else
+#define GLADEGNOME_API
+#endif
+
+/* This function does absolutely nothing
+ * (and is for use in overriding post_create functions).
+ */
+void GLADEGNOME_API
+empty (GObject *container, GladeCreateReason reason)
+{
+}
+
+/* Catalog init function */
+void GLADEGNOME_API
+glade_gnomeui_init ()
+{
+ gchar *argv[2] = {"glade-3", NULL};
+ GtkStockItem items [] = {
+ { GNOME_STOCK_TIMER, "Gnome Timer", 0, },
+ { GNOME_STOCK_TIMER_STOP, "Gnome Timer stop", 0, },
+ { GNOME_STOCK_TRASH, "Gnome Trash", 0, },
+ { GNOME_STOCK_TRASH_FULL, "Gnome Trash Full", 0, },
+ { GNOME_STOCK_SCORES, "Gnome Scores", 0, },
+ { GNOME_STOCK_ABOUT, "Gnome About", 0, },
+ { GNOME_STOCK_BLANK, "Gnome Blank", 0, },
+ { GNOME_STOCK_VOLUME, "Gnome Volume", 0, },
+ { GNOME_STOCK_MIDI, "Gnome Midi", 0, },
+ { GNOME_STOCK_MIC, "Gnome Mic", 0, },
+ { GNOME_STOCK_LINE_IN, "Gnome Line In", 0, },
+ { GNOME_STOCK_MAIL, "Gnome Mail", 0, },
+ { GNOME_STOCK_MAIL_RCV, "Gnome Mail Recive", 0, },
+ { GNOME_STOCK_MAIL_SND, "Gnome Mail Send", 0, },
+ { GNOME_STOCK_MAIL_RPL, "Gnome Mail Reply", 0, },
+ { GNOME_STOCK_MAIL_FWD, "Gnome Mail Foward", 0, },
+ { GNOME_STOCK_MAIL_NEW, "Gnome Mail New", 0, },
+ { GNOME_STOCK_ATTACH, "Gnome Attach", 0, },
+ { GNOME_STOCK_BOOK_RED, "Gnome Book Red", 0, },
+ { GNOME_STOCK_BOOK_GREEN, "Gnome Book Green", 0, },
+ { GNOME_STOCK_BOOK_BLUE, "Gnome Book Blue", 0, },
+ { GNOME_STOCK_BOOK_YELLOW, "Gnome Book Yellow", 0, },
+ { GNOME_STOCK_BOOK_OPEN, "Gnome Book Open", 0, },
+ { GNOME_STOCK_MULTIPLE_FILE, "Gnome Multiple File", 0, },
+ { GNOME_STOCK_NOT, "Gnome Not", 0, },
+ { GNOME_STOCK_TABLE_BORDERS, "Gnome Table Borders", 0, },
+ { GNOME_STOCK_TABLE_FILL, "Gnome Table Fill", 0, },
+ { GNOME_STOCK_TEXT_INDENT, "Gnome Indent", 0, },
+ { GNOME_STOCK_TEXT_UNINDENT, "Gnome Unindent", 0, },
+ { GNOME_STOCK_TEXT_BULLETED_LIST, "Gnome Bulleted List", 0, },
+ { GNOME_STOCK_TEXT_NUMBERED_LIST, "Gnome Numbered List", 0, }
+ };
+
+ gnome_program_init ("glade-3", "1.0",
+ LIBGNOMEUI_MODULE, 1, argv,
+ GNOME_PARAM_NONE);
+
+ gtk_stock_add (items, sizeof (items) / sizeof (GtkStockItem));
+
+ glade_standard_stock_append_prefix ("gnome-stock-");
+}
+
+/* GnomeApp */
+void GLADEGNOME_API
+glade_gnome_app_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ static GladeWidgetAdaptor *menubar_adaptor = NULL, *dock_item_adaptor;
+ GnomeApp *app = GNOME_APP (object);
+ GladeWidget *gapp = glade_widget_get_from_gobject (object);
+ GladeProject *project = glade_widget_get_project (gapp);
+ GladeWidget *gdock, *gdock_item, *gmenubar;
+
+ gtk_window_set_default_size (GTK_WINDOW (object), 440, 250);
+
+ /* Add BonoboDock */
+ gdock = glade_widget_adaptor_create_internal
+ (gapp, G_OBJECT (app->dock),
+ "dock",
+ glade_widget_get_name (gapp),
+ FALSE,
+ GLADE_CREATE_LOAD);
+
+ if (reason != GLADE_CREATE_USER) return;
+
+ /* Add MenuBar */
+ if (menubar_adaptor == NULL)
+ {
+ dock_item_adaptor = glade_widget_adaptor_get_by_type (BONOBO_TYPE_DOCK_ITEM);
+ menubar_adaptor = glade_widget_adaptor_get_by_type (GTK_TYPE_MENU_BAR);
+ }
+
+ /* DockItem */
+ gdock_item = glade_widget_adaptor_create_widget (dock_item_adaptor, FALSE,
+ "parent", gdock,
+ "project", project, NULL);
+ glade_widget_add_child (gdock, gdock_item, FALSE);
+ glade_widget_pack_property_set (gdock_item, "behavior",
+ BONOBO_DOCK_ITEM_BEH_EXCLUSIVE |
+ BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL |
+ BONOBO_DOCK_ITEM_BEH_LOCKED);
+ /* MenuBar */
+ gmenubar = glade_widget_adaptor_create_widget (menubar_adaptor, FALSE,
+ "parent", gdock_item,
+ "project", project, NULL);
+
+ glade_widget_add_child (gdock_item, gmenubar, FALSE);
+
+ /* Add Client Area placeholder */
+ bonobo_dock_set_client_area (BONOBO_DOCK (app->dock),
+ glade_placeholder_new());
+
+ /* Add StatusBar */
+ glade_widget_property_set (gapp, "has-statusbar", TRUE);
+}
+
+GObject * GLADEGNOME_API
+glade_gnome_app_get_internal_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *name)
+{
+ GObject *child = NULL;
+ GnomeApp *app = GNOME_APP (object);
+ GladeWidget *gapp = glade_widget_get_from_gobject (object);
+
+ if (strcmp ("dock", name) == 0)
+ child = G_OBJECT (app->dock);
+ else if (strcmp ("appbar", name) == 0)
+ {
+ child = G_OBJECT (app->statusbar);
+ if (child == NULL)
+ {
+ /*
+ Create appbar, libglade handle this as an internal
+ widget but appbar is not created by GnomeApp.
+ So we need to create it here for loading purpouses since
+ "has-statusbar" property is not saved in the .glade file.
+ */
+ glade_widget_property_set (gapp, "has-statusbar", TRUE);
+ child = G_OBJECT (app->statusbar);
+ }
+ }
+
+ return child;
+}
+
+GList * GLADEGNOME_API
+glade_gnome_app_get_children (GladeWidgetAdaptor *adaptor,
+ GObject *object)
+{
+ GnomeApp *app = GNOME_APP (object);
+ GList *list = NULL;
+
+ if (app->dock) list = g_list_append (list, G_OBJECT (app->dock));
+ if (app->statusbar) list = g_list_append (list, G_OBJECT (app->statusbar));
+ if (app->contents) list = g_list_append (list, G_OBJECT (app->contents));
+
+ return list;
+}
+
+void GLADEGNOME_API
+glade_gnome_app_set_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ GnomeApp *app = GNOME_APP (container);
+
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ gtk_container_child_set_property (GTK_CONTAINER (app->vbox),
+ (GNOME_IS_APPBAR (child))
+ ? gtk_widget_get_parent (GTK_WIDGET (child))
+ : GTK_WIDGET (child),
+ property_name,
+ value);
+}
+
+void GLADEGNOME_API
+glade_gnome_app_get_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ GnomeApp *app = GNOME_APP (container);
+
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ gtk_container_child_get_property (GTK_CONTAINER (app->vbox),
+ (GNOME_IS_APPBAR (child))
+ ? gtk_widget_get_parent (GTK_WIDGET (child))
+ : GTK_WIDGET (child),
+ property_name,
+ value);
+}
+
+static void
+glade_gnome_app_set_has_statusbar (GObject *object, const GValue *value)
+{
+ GnomeApp *app = GNOME_APP (object);
+ GladeWidget *gapp = glade_widget_get_from_gobject (object), *gbar;
+
+ if (g_value_get_boolean (value))
+ {
+ if (app->statusbar == NULL)
+ {
+ GtkWidget *bar = gnome_appbar_new (TRUE, TRUE,
+ GNOME_PREFERENCES_NEVER);
+
+ gnome_app_set_statusbar (app, bar);
+
+ gbar = glade_widget_adaptor_create_internal
+ (gapp, G_OBJECT (bar), "appbar",
+ glade_widget_get_name (gapp),
+ FALSE, GLADE_CREATE_USER);
+
+ glade_widget_set_parent (gbar, gapp);
+ glade_widget_pack_property_set (gbar, "expand", FALSE);
+ }
+ }
+ else
+ {
+ if (app->statusbar)
+ {
+ /* FIXME: we need to destroy GladeWidgets too */
+ glade_project_remove_object (glade_widget_get_project (gapp),
+ G_OBJECT (app->statusbar));
+ gtk_container_remove (GTK_CONTAINER (app->vbox),
+ gtk_widget_get_parent (app->statusbar));
+ app->statusbar = NULL;
+ }
+ }
+}
+
+
+void GLADEGNOME_API
+glade_gnome_app_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "has-statusbar"))
+ glade_gnome_app_set_has_statusbar (object, value);
+ else if (!strcmp (id, "enable-layout-config"))
+ /* do nothing */;
+ else
+ GWA_GET_CLASS (GTK_TYPE_WINDOW)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+/* GnomeAppBar */
+GType GLADEGNOME_API
+gnome_app_bar_get_type ()
+{
+ return gnome_appbar_get_type ();
+}
+
+void GLADEGNOME_API
+glade_gnome_app_bar_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ gnome_appbar_set_status (GNOME_APPBAR (object), _("Status Message."));
+}
+
+/* GnomeDateEdit */
+static void
+glade_gnome_date_edit_set_no_show_all (GtkWidget *widget, gpointer data)
+{
+ gtk_widget_set_no_show_all (widget, TRUE);
+}
+
+void GLADEGNOME_API
+glade_gnome_date_edit_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ /* DateEdit's "dateedit-flags" property hides/shows some widgets so we
+ * need to explicitly tell that they should not be affected by
+ * gtk_widget_show_all() (its, for example, called after a paste)
+ */
+ gtk_container_foreach (GTK_CONTAINER (object),
+ glade_gnome_date_edit_set_no_show_all, NULL);
+}
+
+/* GnomeDruid */
+static GladeWidget *
+glade_gnome_druid_add_page (GladeWidget *gdruid, gboolean edge)
+{
+ GladeWidget *gpage;
+ static GladeWidgetAdaptor *dps_adaptor = NULL, *dpe_adaptor;
+ GladeProject *project = glade_widget_get_project (gdruid);
+
+ if (dps_adaptor == NULL)
+ {
+ dps_adaptor = glade_widget_adaptor_get_by_type (GNOME_TYPE_DRUID_PAGE_STANDARD);
+ dpe_adaptor = glade_widget_adaptor_get_by_type (GNOME_TYPE_DRUID_PAGE_EDGE);
+ }
+
+ gpage = glade_widget_adaptor_create_widget (edge ? dpe_adaptor : dps_adaptor, FALSE,
+ "parent", gdruid,
+ "project", project, NULL);
+
+ glade_widget_add_child (gdruid, gpage, FALSE);
+
+ return gpage;
+}
+
+void GLADEGNOME_API
+glade_gnome_druid_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GladeWidget *gdruid, *gpage;
+
+ if (reason != GLADE_CREATE_USER) return;
+
+ gdruid = glade_widget_get_from_gobject (object);
+
+ /* Add Start Page */
+ gpage = glade_gnome_druid_add_page (gdruid, TRUE);
+ glade_widget_property_set (gpage, "position", GNOME_EDGE_START);
+
+ /* Add Standard Pages */
+ glade_gnome_druid_add_page (gdruid, FALSE);
+
+ /* Add Finish Page */
+ gpage = glade_gnome_druid_add_page (gdruid, TRUE);
+ glade_widget_property_set (gpage, "position", GNOME_EDGE_FINISH);
+}
+
+static gboolean
+glade_gnome_druid_page_cb (GnomeDruidPage *druidpage,
+ GtkWidget *widget,
+ gpointer user_data)
+{
+ GnomeDruid *druid = GNOME_DRUID (widget);
+ GList *children, *l;
+ gboolean next = TRUE, back = TRUE;
+
+ children = l = gtk_container_get_children (GTK_CONTAINER (druid));
+ while (l)
+ {
+ if (druidpage == l->data) break;
+ l = l->next;
+ }
+
+ if (GPOINTER_TO_INT (user_data))
+ {
+ if (l->next)
+ {
+ gnome_druid_set_page (druid, (GnomeDruidPage *) l->next->data);
+ next = l->next->next != NULL;
+ }
+ }
+ else
+ {
+ if (l->prev)
+ {
+ gnome_druid_set_page (druid, (GnomeDruidPage *) l->prev->data);
+ back = l->prev->prev != NULL;
+ }
+ }
+
+ g_list_free (children);
+
+ gnome_druid_set_buttons_sensitive (druid, back, next, TRUE, TRUE);
+
+ return TRUE;
+}
+
+void GLADEGNOME_API
+glade_gnome_druid_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child)
+{
+ g_return_if_fail (GNOME_IS_DRUID_PAGE (child));
+
+ /*
+ Disconnect handlers just in case this child was already added
+ in another druid.
+ */
+ g_signal_handlers_disconnect_matched (child, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
+ glade_gnome_druid_page_cb, NULL);
+
+ gnome_druid_append_page (GNOME_DRUID (container), GNOME_DRUID_PAGE (child));
+
+ g_signal_connect (child, "next", G_CALLBACK (glade_gnome_druid_page_cb),
+ GINT_TO_POINTER (TRUE));
+ g_signal_connect (child, "back", G_CALLBACK (glade_gnome_druid_page_cb),
+ GINT_TO_POINTER (FALSE));
+}
+
+void GLADEGNOME_API
+glade_gnome_druid_remove_child (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child)
+{
+ g_return_if_fail (GNOME_IS_DRUID_PAGE (child));
+
+ g_signal_handlers_disconnect_matched (child, G_SIGNAL_MATCH_FUNC, 0, 0, NULL,
+ glade_gnome_druid_page_cb, NULL);
+
+ gtk_container_remove (GTK_CONTAINER (container), GTK_WIDGET (child));
+}
+
+static void
+glade_gnome_druid_insert_page (GnomeDruid *druid, GnomeDruidPage *page, gint pos)
+{
+ GList *children, *l;
+ GnomeDruidPage *back_page = NULL;
+ gint i = 0;
+
+ children = l = gtk_container_get_children (GTK_CONTAINER (druid));
+ while (l)
+ {
+ i++;
+ if (i >= pos)
+ {
+ back_page = (GnomeDruidPage *) l->data;
+ break;
+ }
+ l = l->next;
+ }
+
+ gnome_druid_insert_page (druid, back_page, page);
+
+ g_list_free (children);
+}
+
+static gint
+glade_gnome_druid_get_page_position (GnomeDruid *druid, GnomeDruidPage *page)
+{
+ GList *children, *l;
+ gint i = 0;
+
+ children = l = gtk_container_get_children (GTK_CONTAINER (druid));
+ while (l)
+ {
+ GnomeDruidPage *current = (GnomeDruidPage *) l->data;
+ if (current == page) break;
+ i++;
+ l = l->next;
+ }
+
+ g_list_free (children);
+
+ return i;
+}
+
+void GLADEGNOME_API
+glade_gnome_druid_set_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ g_return_if_fail (GNOME_IS_DRUID_PAGE (child));
+
+ if (strcmp (property_name, "position") == 0)
+ {
+ gint position = g_value_get_int (value);
+
+ if (position < 0)
+ {
+ position = glade_gnome_druid_get_page_position
+ (GNOME_DRUID (container),
+ GNOME_DRUID_PAGE (child));
+ g_value_set_int (value, position);
+ }
+
+ g_object_ref (child);
+ gtk_container_remove (GTK_CONTAINER (container), GTK_WIDGET (child));
+ glade_gnome_druid_insert_page (GNOME_DRUID (container),
+ GNOME_DRUID_PAGE (child),
+ position);
+ g_object_unref (child);
+ }
+ else
+ /* Chain Up */
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->child_set_property (adaptor,
+ container,
+ child,
+ property_name,
+ value);
+}
+
+void GLADEGNOME_API
+glade_gnome_druid_get_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ g_return_if_fail (GNOME_IS_DRUID_PAGE (child));
+
+ if (strcmp (property_name, "position") == 0)
+ g_value_set_int (value, glade_gnome_druid_get_page_position (
+ GNOME_DRUID (container),
+ GNOME_DRUID_PAGE (child)));
+ else
+ /* Chain Up */
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->child_get_property (adaptor,
+ container,
+ child,
+ property_name,
+ value);
+}
+
+/* GnomeDruidPageStandard */
+void GLADEGNOME_API
+glade_gnome_dps_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GladeWidget *gpage, *gvbox;
+ GObject *vbox;
+
+ gpage = glade_widget_get_from_gobject (object);
+ vbox = G_OBJECT (GNOME_DRUID_PAGE_STANDARD (object)->vbox);
+ gvbox = glade_widget_adaptor_create_internal (gpage, vbox, "vbox",
+ glade_widget_get_name (gpage),
+ FALSE, GLADE_CREATE_LOAD);
+
+ if (reason == GLADE_CREATE_USER)
+ glade_widget_property_set (gvbox, "size", 1);
+}
+
+GObject * GLADEGNOME_API
+glade_gnome_dps_get_internal_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *name)
+{
+ GObject *child = NULL;
+
+ if (strcmp (name, "vbox") == 0)
+ child = G_OBJECT (GNOME_DRUID_PAGE_STANDARD (object)->vbox);
+
+ return child;
+}
+
+GList * GLADEGNOME_API
+glade_gnome_dps_get_children (GladeWidgetAdaptor *adaptor,
+ GObject *object)
+{
+ GnomeDruidPageStandard *page = GNOME_DRUID_PAGE_STANDARD (object);
+ GList *list = NULL;
+
+ if (page->vbox) list = g_list_append (list, G_OBJECT (page->vbox));
+
+ return list;
+}
+
+static void
+glade_gnome_dps_set_color_common (GObject *object,
+ const gchar *property_name,
+ const GValue *value)
+{
+ GladeProperty *prop;
+ const gchar *color_str;
+ GValue *color;
+
+ if ((color_str = g_value_get_string (value)) == NULL) return;
+
+ prop = glade_widget_get_property (glade_widget_get_from_gobject (object),
+ property_name);
+
+ color = glade_property_class_make_gvalue_from_string (prop->klass,
+ color_str, NULL);
+ if (color) glade_property_set_value (prop, color);
+}
+
+void GLADEGNOME_API
+glade_gnome_dps_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+
+ if (!strcmp (id, "background"))
+ glade_gnome_dps_set_color_common (object, "background-gdk", value);
+ else if (!strcmp (id, "contents-background"))
+ glade_gnome_dps_set_color_common (object, "contents-background-gdk", value);
+ else if (!strcmp (id, "logo-background"))
+ glade_gnome_dps_set_color_common (object, "logo-background-gdk", value);
+ else if (!strcmp (id, "title-foreground"))
+ glade_gnome_dps_set_color_common (object, "title-foreground-gdk", value);
+ else
+ /* Skip GNOME_TYPE_DRUID_PAGE since we didnt register an
+ * adaptor for that abstract class.
+ */
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+
+/* GnomeDruidPageEdge */
+static GType
+glade_gnome_dpe_position_get_type (void)
+{
+ static GType etype = 0;
+ if (etype == 0) {
+ static const GEnumValue values[] = {
+ { GNOME_EDGE_START, "GNOME_EDGE_START", "Edge Start"},
+ { GNOME_EDGE_FINISH, "GNOME_EDGE_FINISH", "Edge Finish"},
+ { GNOME_EDGE_OTHER, "GNOME_EDGE_OTHER", "Edge Other"},
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("GladeGnomeDruidPagePosition", values);
+ }
+ return etype;
+}
+
+GParamSpec * GLADEGNOME_API
+glade_gnome_dpe_position_spec (void)
+{
+ return g_param_spec_enum ("position", _("Position"),
+ _("The position in the druid"),
+ glade_gnome_dpe_position_get_type (),
+ GNOME_EDGE_OTHER, G_PARAM_READWRITE);
+}
+
+void GLADEGNOME_API
+glade_gnome_dpe_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+
+{
+ GnomeDruidPageEdge *page = GNOME_DRUID_PAGE_EDGE (object);
+ const gchar *text = NULL;
+ GObject *pixbuf = NULL;
+ GdkColor *color = NULL;
+
+ if (G_VALUE_HOLDS (value, G_TYPE_STRING))
+ text = g_value_get_string (value);
+ else if (G_VALUE_HOLDS (value, GDK_TYPE_PIXBUF))
+ pixbuf = g_value_get_object (value);
+ else if (G_VALUE_HOLDS (value, GDK_TYPE_COLOR))
+ color = (GdkColor *) g_value_get_boxed (value);
+
+ if (!strcmp (id, "title"))
+ {
+ if (text) gnome_druid_page_edge_set_title (page, text);
+ }
+ else if (!strcmp (id, "text"))
+ {
+ if (text) gnome_druid_page_edge_set_text (page, text);
+ }
+ else if (!strcmp (id, "title-foreground"))
+ {
+ if (color) gnome_druid_page_edge_set_title_color (page, color);
+ }
+ else if (!strcmp (id, "text-foreground"))
+ {
+ if (color) gnome_druid_page_edge_set_text_color (page, color);
+ }
+ else if (!strcmp (id, "background"))
+ {
+ if (color) gnome_druid_page_edge_set_bg_color (page, color);
+ }
+ else if (!strcmp (id, "contents-background"))
+ {
+ if (color) gnome_druid_page_edge_set_textbox_color (page, color);
+ }
+ else if (!strcmp (id, "logo-background"))
+ {
+ if (color) gnome_druid_page_edge_set_logo_bg_color (page, color);
+ }
+ else if (!strcmp (id, "logo"))
+ gnome_druid_page_edge_set_logo (page, GDK_PIXBUF (pixbuf));
+ else if (!strcmp (id, "watermark"))
+ gnome_druid_page_edge_set_watermark (page, GDK_PIXBUF (pixbuf));
+ else if (!strcmp (id, "top-watermark"))
+ gnome_druid_page_edge_set_top_watermark (page, GDK_PIXBUF (pixbuf));
+ else if (!strcmp (id, "position"));
+ else
+ /* Skip GNOME_TYPE_DRUID_PAGE since we didnt register an
+ * adaptor for that abstract class.
+ */
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+/* GnomeIconEntry */
+void GLADEGNOME_API
+glade_gnome_icon_entry_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "max-saved"))
+ gnome_icon_entry_set_max_saved (GNOME_ICON_ENTRY (object),
+ g_value_get_uint (value));
+ else
+ GWA_GET_CLASS (GTK_TYPE_VBOX)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+/* GnomeCanvas */
+typedef enum
+{
+ CANVAS_X1,
+ CANVAS_Y1,
+ CANVAS_X2,
+ CANVAS_Y2
+}GnomeCanvasCoordinate;
+
+static void
+glade_gnome_canvas_set_coordinate_common (GObject *object,
+ const GValue *value,
+ GnomeCanvasCoordinate coordinate)
+{
+ gdouble x1, y1, x2, y2;
+
+ gnome_canvas_get_scroll_region (GNOME_CANVAS (object),
+ &x1, &y1, &x2, &y2);
+
+ switch (coordinate)
+ {
+ case CANVAS_X1:
+ x1 = g_value_get_float (value);
+ break;
+ case CANVAS_Y1:
+ y1 = g_value_get_float (value);
+ break;
+ case CANVAS_X2:
+ x2 = g_value_get_float (value);
+ break;
+ case CANVAS_Y2:
+ y2 = g_value_get_float (value);
+ break;
+ }
+
+ gnome_canvas_set_scroll_region (GNOME_CANVAS (object), x1, y1, x2, y2);
+}
+
+void GLADEGNOME_API
+glade_gnome_canvas_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "pixels-per-unit"))
+ gnome_canvas_set_pixels_per_unit (GNOME_CANVAS (object),
+ g_value_get_float (value));
+ else if (!strcmp (id, "scroll-x1"))
+ glade_gnome_canvas_set_coordinate_common (object, value, CANVAS_X1);
+ else if (!strcmp (id, "scroll-x2"))
+ glade_gnome_canvas_set_coordinate_common (object, value, CANVAS_X2);
+ else if (!strcmp (id, "scroll-y1"))
+ glade_gnome_canvas_set_coordinate_common (object, value, CANVAS_Y1);
+ else if (!strcmp (id, "scroll-y2"))
+ glade_gnome_canvas_set_coordinate_common (object, value, CANVAS_Y2);
+ else
+ GWA_GET_CLASS (GTK_TYPE_LAYOUT)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+/* GnomeDialog */
+static void
+glade_gnome_dialog_add_button (GladeWidget *gaction_area,
+ GObject *action_area,
+ const gchar *stock)
+{
+ GladeProject *project = glade_widget_get_project (gaction_area);
+ static GladeWidgetAdaptor *button_adaptor = NULL;
+ GladeWidget *gbutton;
+ GObject *button;
+ GEnumClass *eclass;
+ GEnumValue *eval;
+
+ if (button_adaptor == NULL)
+ button_adaptor = glade_widget_adaptor_get_by_type (GTK_TYPE_BUTTON);
+
+ gbutton = glade_widget_adaptor_create_widget (button_adaptor, FALSE,
+ "parent", gaction_area,
+ "project", project, FALSE);
+
+ eclass = g_type_class_ref (glade_standard_stock_get_type ());
+ if ((eval = g_enum_get_value_by_nick (eclass, stock)) != NULL)
+ {
+ glade_widget_property_set (gbutton, "glade-type", GLADEGTK_BUTTON_STOCK);
+ glade_widget_property_set (gbutton, "stock", eval->value);
+ }
+ g_type_class_unref (eclass);
+
+ button = glade_widget_get_object (gbutton);
+
+ glade_widget_adaptor_add (glade_widget_get_adaptor (gaction_area),
+ action_area, button);
+}
+
+void GLADEGNOME_API
+glade_gnome_dialog_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GladeWidget *gdialog = glade_widget_get_from_gobject (object);
+ GnomeDialog *dialog = GNOME_DIALOG (object);
+ GladeWidget *gvbox, *gaction_area;
+ GtkWidget *separator;
+
+ /* Ignore close signal */
+ g_signal_connect (object, "close", G_CALLBACK (gtk_true), NULL);
+
+ if (GNOME_IS_PROPERTY_BOX (object))
+ {
+ GnomePropertyBox *pbox = GNOME_PROPERTY_BOX (object);
+
+ gaction_area = glade_widget_adaptor_create_internal
+ (gdialog, G_OBJECT (pbox->notebook), "notebook",
+ glade_widget_get_name (gdialog),
+ FALSE, GLADE_CREATE_LOAD);
+ if (reason == GLADE_CREATE_USER)
+ glade_widget_property_set (gaction_area, "pages", 3);
+ return;
+ }
+
+ /* vbox internal child */
+ gvbox = glade_widget_adaptor_create_internal
+ (gdialog, G_OBJECT (dialog->vbox), "vbox",
+ glade_widget_get_name (gdialog),
+ FALSE, GLADE_CREATE_LOAD);
+
+ glade_widget_property_set (gvbox, "size", 0);
+
+ /* action area */
+ dialog->action_area = gtk_hbutton_box_new ();
+ gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog->action_area),
+ GTK_BUTTONBOX_END);
+
+ gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->action_area,
+ FALSE, TRUE, 0);
+ gtk_widget_show (dialog->action_area);
+
+ /* separator */
+ separator = gtk_hseparator_new ();
+ gtk_box_pack_end (GTK_BOX (dialog->vbox), separator,
+ FALSE, TRUE, GNOME_PAD_SMALL);
+ gtk_widget_show (separator);
+
+ /* action area internal child */
+ gaction_area =
+ glade_widget_adaptor_create_internal (gvbox,
+ G_OBJECT (dialog->action_area),
+ "action_area",
+ glade_widget_get_name (gvbox),
+ FALSE, GLADE_CREATE_LOAD);
+
+ glade_widget_property_set (gaction_area, "size", 0);
+
+ if (reason != GLADE_CREATE_USER) return;
+
+ /* Add a couple of buttons */
+ if (GNOME_IS_MESSAGE_BOX (object))
+ {
+ glade_gnome_dialog_add_button (gaction_area,
+ G_OBJECT (dialog->action_area),
+ "gtk-ok");
+ glade_widget_property_set (gaction_area, "size", 1);
+ }
+ else
+ {
+ glade_gnome_dialog_add_button (gaction_area,
+ G_OBJECT (dialog->action_area),
+ "gtk-cancel");
+ glade_gnome_dialog_add_button (gaction_area,
+ G_OBJECT (dialog->action_area),
+ "gtk-ok");
+ glade_widget_property_set (gaction_area, "size", 2);
+ glade_widget_property_set (gvbox, "size", 3);
+ }
+}
+
+GObject * GLADEGNOME_API
+glade_gnome_dialog_get_internal_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *name)
+{
+ GObject *child = NULL;
+
+ if (strcmp (name, "vbox") == 0)
+ child = G_OBJECT (GNOME_DIALOG (object)->vbox);
+ else if (GNOME_IS_PROPERTY_BOX (object) && strcmp (name, "notebook") == 0)
+ child = G_OBJECT (GNOME_PROPERTY_BOX (object)->notebook);
+
+ return child;
+}
+
+GList * GLADEGNOME_API
+glade_gnome_dialog_get_children (GladeWidgetAdaptor *adaptor,
+ GObject *object)
+{
+ GnomeDialog *dialog = GNOME_DIALOG (object);
+ GList *list = NULL;
+
+ if (dialog->vbox) list = g_list_append (list, G_OBJECT (dialog->vbox));
+
+ if (GNOME_IS_PROPERTY_BOX (object))
+ {
+ GnomePropertyBox *pbox = GNOME_PROPERTY_BOX (object);
+ if (pbox->notebook)
+ list = g_list_append (list, G_OBJECT (pbox->notebook));
+ }
+
+ return list;
+}
+
+/* GnomeAbout */
+void GLADEGNOME_API
+glade_gnome_about_dialog_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (object), GTK_RESPONSE_CLOSE, FALSE);
+}
+
+void GLADEGNOME_API
+glade_gnome_about_dialog_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "name") ||
+ !strcmp (id, "version"))
+ {
+ if (g_value_get_string (value))
+ g_object_set_property (object, id, value);
+ }
+ else
+ GWA_GET_CLASS (GTK_TYPE_DIALOG)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+/* GnomeMessageBox */
+typedef enum {
+ GLADE_GNOME_MESSAGE_BOX_INFO,
+ GLADE_GNOME_MESSAGE_BOX_WARNING,
+ GLADE_GNOME_MESSAGE_BOX_ERROR,
+ GLADE_GNOME_MESSAGE_BOX_QUESTION,
+ GLADE_GNOME_MESSAGE_BOX_GENERIC
+}GladeGnomeMessageBoxType;
+
+static GType
+glade_gnome_message_box_type_get_type (void)
+{
+ static GType etype = 0;
+ if (etype == 0) {
+ static const GEnumValue values[] = {
+ { GLADE_GNOME_MESSAGE_BOX_INFO, "GNOME_MESSAGE_BOX_INFO", "info"},
+ { GLADE_GNOME_MESSAGE_BOX_WARNING, "GNOME_MESSAGE_BOX_WARNING", "warning"},
+ { GLADE_GNOME_MESSAGE_BOX_ERROR, "GNOME_MESSAGE_BOX_ERROR", "error"},
+ { GLADE_GNOME_MESSAGE_BOX_QUESTION, "GNOME_MESSAGE_BOX_QUESTION", "question"},
+ { GLADE_GNOME_MESSAGE_BOX_GENERIC, "GNOME_MESSAGE_BOX_GENERIC", "generic"},
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("GladeGnomeMessageBoxType", values);
+ }
+ return etype;
+}
+
+GParamSpec * GLADEGNOME_API
+glade_gnome_message_box_type_spec (void)
+{
+ return g_param_spec_enum ("message_box_type", _("Message box type"),
+ _("The type of the message box"),
+ glade_gnome_message_box_type_get_type (),
+ 0, G_PARAM_READWRITE);
+}
+
+static gchar *
+glade_gnome_message_get_str (GladeGnomeMessageBoxType val)
+{
+ switch (val)
+ {
+ case GLADE_GNOME_MESSAGE_BOX_INFO:
+ return "info";
+ case GLADE_GNOME_MESSAGE_BOX_WARNING:
+ return "warning";
+ case GLADE_GNOME_MESSAGE_BOX_ERROR:
+ return "error";
+ case GLADE_GNOME_MESSAGE_BOX_QUESTION:
+ return "question";
+ case GLADE_GNOME_MESSAGE_BOX_GENERIC:
+ return "generic";
+ }
+ return "";
+}
+
+static void
+glade_gnome_message_clean (GObject *object)
+{
+ GtkContainer *container = GTK_CONTAINER (GNOME_DIALOG (object)->vbox);
+ GList *children, *l;
+
+ children = gtk_container_get_children (container);
+
+ for (l = children; l; l = l->next)
+ {
+ GtkWidget *child = (GtkWidget *) l->data;
+
+ if (GTK_IS_HBOX (child))
+ {
+ gtk_container_remove (container, child);
+ break;
+ }
+ }
+
+ g_list_free (children);
+}
+
+static void
+glade_gnome_message_box_set_type (GObject *object, const GValue *value)
+{
+ gchar *message, *type;
+
+ glade_gnome_message_clean (object);
+ glade_widget_property_get (glade_widget_get_from_gobject (object),
+ "message", &message);
+ type = glade_gnome_message_get_str (g_value_get_enum (value));
+ gnome_message_box_construct (GNOME_MESSAGE_BOX (object),
+ message, type, NULL);
+}
+
+static void
+glade_gnome_message_box_set_message (GObject *object, const GValue *value)
+{
+ GladeGnomeMessageBoxType type;
+
+ glade_gnome_message_clean (object);
+ glade_widget_property_get (glade_widget_get_from_gobject (object),
+ "message-box-type", &type);
+ gnome_message_box_construct (GNOME_MESSAGE_BOX (object),
+ g_value_get_string (value),
+ glade_gnome_message_get_str (type),
+ NULL);
+}
+
+void GLADEGNOME_API
+glade_gnome_message_box_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "message-box-type"))
+ glade_gnome_message_box_set_type (object, value);
+ else if (!strcmp (id, "message"))
+ glade_gnome_message_box_set_message (object, value);
+ else
+ GWA_GET_CLASS (GNOME_TYPE_DIALOG)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+/* GnomeEntry & GnomeFileEntry */
+/* GnomeFileEntry is not derived from GnomeEntry... but hey!!! they should :) */
+GObject * GLADEGNOME_API
+glade_gnome_entry_get_internal_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *name)
+{
+ GObject *child = NULL;
+
+ if (strcmp (name, "entry") == 0)
+ {
+ if (GNOME_IS_ENTRY (object))
+ child = G_OBJECT (gnome_entry_gtk_entry (GNOME_ENTRY (object)));
+ else
+ child = G_OBJECT (gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (object)));
+ }
+
+ return child;
+}
+
+void GLADEGNOME_API
+glade_gnome_entry_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GladeWidget *gentry;
+ GObject *child;
+
+ child = glade_gnome_entry_get_internal_child (adaptor, object, "entry");
+
+ gentry = glade_widget_get_from_gobject (object);
+ glade_widget_adaptor_create_internal (gentry,
+ child, "entry",
+ glade_widget_get_name (gentry),
+ FALSE, reason);
+}
+
+GList * GLADEGNOME_API
+glade_gnome_entry_get_children (GladeWidgetAdaptor *adaptor,
+ GObject *object)
+{
+ GList *list = NULL;
+ GtkWidget *entry;
+
+ if (GNOME_IS_ENTRY (object))
+ entry = gnome_entry_gtk_entry (GNOME_ENTRY (object));
+ else
+ entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (object));
+
+ if (entry) list = g_list_append (list, G_OBJECT (entry));
+
+ return list;
+}
+
+void GLADEGNOME_API
+glade_gnome_entry_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "max-saved"))
+ gnome_entry_set_max_saved (GNOME_ENTRY (object), g_value_get_int (value));
+ else
+ GWA_GET_CLASS (GTK_TYPE_COMBO)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+void GLADEGNOME_API
+glade_gnome_file_entry_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ GtkWidget *entry;
+
+ if (!strcmp (id, "max-saved"))
+ {
+ entry = gnome_file_entry_gnome_entry (GNOME_FILE_ENTRY (object));
+ gnome_entry_set_max_saved (GNOME_ENTRY (entry), g_value_get_int (value));
+ }
+ else
+ GWA_GET_CLASS (GTK_TYPE_VBOX)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+/* GnomePixmapEntry */
+void GLADEGNOME_API
+glade_gnome_pixmap_entry_set_do_preview (GObject *object, GValue *value)
+{
+ gnome_pixmap_entry_set_preview (GNOME_PIXMAP_ENTRY (object),
+ g_value_get_boolean (value));
+}
+
+/* GnomeFontPicker */
+static void
+glade_gnome_font_picker_set_mode (GObject *object, const GValue *value)
+{
+ GladeWidget *ggfp, *gchild;
+ GnomeFontPicker *gfp;
+ GnomeFontPickerMode mode;
+ GObject *child;
+
+ mode = g_value_get_enum (value);
+ if (mode == GNOME_FONT_PICKER_MODE_UNKNOWN) return;
+
+ gfp = GNOME_FONT_PICKER (object);
+ child = G_OBJECT (gnome_font_picker_uw_get_widget (gfp));
+ if (child && (gchild = glade_widget_get_from_gobject (child)))
+ glade_project_remove_object (glade_widget_get_project (gchild),
+ child);
+
+ gnome_font_picker_set_mode (gfp, mode);
+
+ ggfp = glade_widget_get_from_gobject (object);
+ switch (mode)
+ {
+ const gchar *reason;
+ case GNOME_FONT_PICKER_MODE_FONT_INFO:
+ glade_widget_property_set_sensitive (ggfp, "show-size", TRUE, NULL);
+ glade_widget_property_set_sensitive (ggfp, "use-font-in-label", TRUE, NULL);
+ glade_widget_property_set_sensitive (ggfp, "label-font-size", TRUE, NULL);
+ break;
+ case GNOME_FONT_PICKER_MODE_USER_WIDGET:
+ gnome_font_picker_uw_set_widget (gfp, glade_placeholder_new ());
+ case GNOME_FONT_PICKER_MODE_PIXMAP:
+ reason = _("This property is valid only in font information mode");
+ glade_widget_property_set_sensitive (ggfp, "show-size", FALSE, reason);
+ glade_widget_property_set_sensitive (ggfp, "use-font-in-label", FALSE, reason);
+ glade_widget_property_set_sensitive (ggfp, "label-font-size", FALSE, reason);
+ default: break;
+ }
+}
+
+void GLADEGNOME_API
+glade_gnome_font_picker_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "mode"))
+ glade_gnome_font_picker_set_mode (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_BUTTON)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+GList * GLADEGNOME_API
+glade_gnome_font_picker_get_children (GladeWidgetAdaptor *adaptor,
+ GObject *object)
+{
+ GtkWidget *child;
+
+ if ((child = gnome_font_picker_uw_get_widget (GNOME_FONT_PICKER (object))))
+ return g_list_append (NULL, G_OBJECT (child));
+ else
+ return NULL;
+}
+
+void GLADEGNOME_API
+glade_gnome_font_picker_add_child (GladeWidgetAdaptor *adaptor,
+ GtkWidget *container,
+ GtkWidget *child)
+{
+ gnome_font_picker_uw_set_widget (GNOME_FONT_PICKER (container), child);
+}
+
+void GLADEGNOME_API
+glade_gnome_font_picker_remove_child (GladeWidgetAdaptor *adaptor,
+ GtkWidget *container,
+ GtkWidget *child)
+{
+ gnome_font_picker_uw_set_widget (GNOME_FONT_PICKER (container), glade_placeholder_new ());
+}
+
+void GLADEGNOME_API
+glade_gnome_font_picker_replace_child (GladeWidgetAdaptor *adaptor,
+ GtkWidget *container,
+ GtkWidget *current,
+ GtkWidget *new_widget)
+{
+ gnome_font_picker_uw_set_widget (GNOME_FONT_PICKER (container), new_widget);
+}
+
+/* GnomeIconList */
+void GLADEGNOME_API
+glade_gnome_icon_list_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ /* Freeze the widget so we dont get the signals that cause a segfault */
+ gnome_icon_list_freeze (GNOME_ICON_LIST (object));
+}
+
+static GType
+glade_gnome_icon_list_selection_mode_get_type (void)
+{
+ static GType etype = 0;
+ if (etype == 0) {
+ static const GEnumValue values[] = {
+ { GTK_SELECTION_SINGLE, "GTK_SELECTION_SINGLE", "Single"},
+ { GTK_SELECTION_BROWSE, "GTK_SELECTION_BROWSE", "Browse"},
+ { GTK_SELECTION_MULTIPLE, "GTK_SELECTION_MULTIPLE", "Multiple"},
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("GladeGnomeIconListSelectionMode", values);
+ }
+ return etype;
+}
+
+GParamSpec * GLADEGNOME_API
+glade_gnome_icon_list_selection_mode_spec (void)
+{
+ return g_param_spec_enum ("selection_mode", _("Selection Mode"),
+ _("Choose the Selection Mode"),
+ glade_gnome_icon_list_selection_mode_get_type (),
+ GTK_SELECTION_SINGLE, G_PARAM_READWRITE);
+}
+
+void GLADEGNOME_API
+glade_gnome_icon_list_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "selection-mode"))
+ gnome_icon_list_set_selection_mode (GNOME_ICON_LIST (object),
+ g_value_get_enum (value));
+ else if (!strcmp (id, "icon-width"))
+ gnome_icon_list_set_icon_width (GNOME_ICON_LIST (object),
+ g_value_get_int (value));
+ else if (!strcmp (id, "row-spacing"))
+ gnome_icon_list_set_row_spacing (GNOME_ICON_LIST (object),
+ g_value_get_int (value));
+ else if (!strcmp (id, "column-spacing"))
+ gnome_icon_list_set_col_spacing (GNOME_ICON_LIST (object),
+ g_value_get_int (value));
+ else if (!strcmp (id, "text-spacing"))
+ gnome_icon_list_set_text_spacing (GNOME_ICON_LIST (object),
+ g_value_get_int (value));
+ else
+ GWA_GET_CLASS (GNOME_TYPE_CANVAS)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+/* GnomePixmap */
+static gint
+glade_gnome_pixmap_set_filename_common (GObject *object)
+{
+ GladeWidget *gp;
+ gint width, height;
+
+ gp = glade_widget_get_from_gobject (object);
+ glade_widget_property_get (gp, "scaled-width", &width);
+ glade_widget_property_get (gp, "scaled-height", &height);
+
+ if (width && height)
+ {
+ GladeProperty *property = glade_widget_get_property (gp, "filename");
+ gchar *file = glade_property_class_make_string_from_gvalue
+ (property->klass, property->value);
+ if (file)
+ {
+ gnome_pixmap_load_file_at_size (GNOME_PIXMAP (object),
+ file, width, height);
+ g_free (file);
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
+static void
+glade_gnome_pixmap_set_scaled_common (GObject *object,
+ const GValue *value,
+ const gchar *property)
+{
+ if (glade_gnome_pixmap_set_filename_common (object))
+ {
+ GladeWidget *gp = glade_widget_get_from_gobject (object);
+ gint val2, val = g_value_get_int (value);
+ GObject *pixbuf;
+
+ glade_widget_property_get (gp, "filename", &pixbuf);
+ glade_widget_property_set (gp, "filename", pixbuf);
+
+ if (val)
+ {
+ glade_widget_property_get (gp, property, &val2);
+ if (val2 == 0)
+ glade_widget_property_set (gp, property, val);
+ }
+ else
+ glade_widget_property_set (gp, property, 0);
+ }
+}
+
+void GLADEGNOME_API
+glade_gnome_pixmap_set_scaled_width (GObject *object, GValue *value)
+{
+ glade_gnome_pixmap_set_scaled_common (object, value, "scaled-height");
+}
+
+void GLADEGNOME_API
+glade_gnome_pixmap_set_scaled_height (GObject *object, GValue *value)
+{
+ glade_gnome_pixmap_set_scaled_common (object, value, "scaled-width");
+}
+
+
+void GLADEGNOME_API
+glade_gnome_pixmap_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "filename"))
+ {
+ if (glade_gnome_pixmap_set_filename_common (object))
+ gtk_image_set_from_pixbuf (GTK_IMAGE(object),
+ GDK_PIXBUF (g_value_get_object (value)));
+ }
+ else if (!strcmp (id, "scaled-width") ||
+ !strcmp (id, "scaled-height"))
+ glade_gnome_pixmap_set_scaled_common (object, value, id);
+ else
+ GWA_GET_CLASS (GTK_TYPE_IMAGE)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+
+/*
+ BBBB OOOO NN NN OOOO BBBB OOOO
+ BB B OO OO NNN NN OO OO BB B OO OO
+ BBBB OO OO NN N NN OO OO BBBB OO OO
+ BB B OO OO NN NNN OO OO BB B OO OO
+ BBBB OOOO NN NN OOOO BBBB OOOO
+*/
+
+/* GladeGnomeBonoboDockPlacement */
+static GType
+glade_gnome_bonobo_dock_placement_get_type (void)
+{
+ static GType etype = 0;
+ if (etype == 0) {
+ static const GEnumValue values[] = {
+ { BONOBO_DOCK_TOP, "BONOBO_DOCK_TOP", "Top"},
+ { BONOBO_DOCK_RIGHT, "BONOBO_DOCK_RIGHT", "Right"},
+ { BONOBO_DOCK_BOTTOM, "BONOBO_DOCK_BOTTOM", "Bottom"},
+ { BONOBO_DOCK_LEFT, "BONOBO_DOCK_LEFT", "Left"},
+ { BONOBO_DOCK_FLOATING, "BONOBO_DOCK_FLOATING", "Floating"},
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("GladeGnomeBonoboDockPlacement", values);
+ }
+ return etype;
+}
+
+GParamSpec * GLADEGNOME_API
+glade_gnome_bonobo_dock_placement_spec (void)
+{
+ return g_param_spec_enum ("placement", _("Placement"),
+ _("Choose the BonoboDockPlacement type"),
+ glade_gnome_bonobo_dock_placement_get_type (),
+ 0, G_PARAM_READWRITE);
+}
+
+/* GladeGnomeBonoboDockItemBehavior */
+static GType
+glade_gnome_bonobo_dock_item_behavior_get_type (void)
+{
+ static GType etype = 0;
+ if (etype == 0) {
+ static const GFlagsValue values[] = {
+ /*BONOBO_DOCK_ITEM_BEH_NORMAL is 0 so we do not include it. */
+ { BONOBO_DOCK_ITEM_BEH_EXCLUSIVE, "BONOBO_DOCK_ITEM_BEH_EXCLUSIVE", "Exclusive"},
+ { BONOBO_DOCK_ITEM_BEH_NEVER_FLOATING, "BONOBO_DOCK_ITEM_BEH_NEVER_FLOATING", "Never Floating"},
+ { BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL, "BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL", "Never Vertical"},
+ { BONOBO_DOCK_ITEM_BEH_NEVER_HORIZONTAL, "BONOBO_DOCK_ITEM_BEH_NEVER_HORIZONTAL", "Never Horizontal"},
+ { BONOBO_DOCK_ITEM_BEH_LOCKED, "BONOBO_DOCK_ITEM_BEH_LOCKED", "Locked"},
+ { 0, NULL, NULL }
+ };
+ etype = g_flags_register_static ("GladeGnomeBonoboDockItemBehavior", values);
+ }
+ return etype;
+}
+
+GParamSpec * GLADEGNOME_API
+glade_gnome_bonobo_dock_item_behavior_spec (void)
+{
+ return g_param_spec_flags ("behavior", _("Behavior"),
+ _("Choose the BonoboDockItemBehavior type"),
+ glade_gnome_bonobo_dock_item_behavior_get_type (),
+ 0, G_PARAM_READWRITE);
+}
+
+/* GtkPackType */
+GParamSpec * GLADEGNOME_API
+glade_gnome_gtk_pack_type_spec (void)
+{
+ return g_param_spec_enum ("pack_type", _("Pack Type"),
+ _("Choose the Pack Type"),
+ g_type_from_name ("GtkPackType"),
+ 0, G_PARAM_READWRITE);
+}
+
+/* BonoboDockBand convenience functions */
+static BonoboDockBand *
+glade_gnome_bdb_get_band (GList *bands, GtkWidget *widget)
+{
+ GList *l;
+
+ for (l = bands; l; l = l->next)
+ {
+ BonoboDockBand *band = (BonoboDockBand *) l->data;
+ GList *cl;
+ for (cl = band->children; cl; cl = cl->next)
+ {
+ BonoboDockBandChild *child = (BonoboDockBandChild *) cl->data;
+ if (child->widget == widget) return band;
+ }
+ }
+
+ return NULL;
+}
+
+static BonoboDockBand *
+glade_gnome_bd_get_band (BonoboDock *dock, GtkWidget *widget)
+{
+ BonoboDockBand *retval = NULL;
+
+ if ((retval = glade_gnome_bdb_get_band (dock->top_bands, widget)) ||
+ (retval = glade_gnome_bdb_get_band (dock->bottom_bands, widget)) ||
+ (retval = glade_gnome_bdb_get_band (dock->right_bands, widget)) ||
+ (retval = glade_gnome_bdb_get_band (dock->left_bands, widget)));
+
+ return retval;
+}
+
+/* BonoboDock */
+void GLADEGNOME_API
+glade_gnome_bonobodock_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ if (BONOBO_IS_DOCK_ITEM (child))
+ bonobo_dock_add_item (BONOBO_DOCK (object), BONOBO_DOCK_ITEM (child),
+ 0,0,0,0, TRUE);
+ else if (GTK_IS_WIDGET (child))
+ bonobo_dock_set_client_area (BONOBO_DOCK (object), GTK_WIDGET (child));
+}
+
+void GLADEGNOME_API
+glade_gnome_bonobodock_remove_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ BonoboDockBand *band;
+
+ band = glade_gnome_bd_get_band (BONOBO_DOCK (object), GTK_WIDGET (child));
+
+ gtk_container_remove (GTK_CONTAINER (band), GTK_WIDGET (child));
+}
+
+GList * GLADEGNOME_API
+glade_gnome_bonobodock_get_children (GladeWidgetAdaptor *adaptor,
+ GObject *object)
+{
+ GList *list = NULL, *l;
+ GtkWidget *client_area;
+ BonoboDockLayout *layout;
+
+ layout = bonobo_dock_get_layout (BONOBO_DOCK (object));
+ client_area = bonobo_dock_get_client_area (BONOBO_DOCK (object));
+
+ for (l = layout->items; l; l = l->next)
+ {
+ BonoboDockLayoutItem *li = (BonoboDockLayoutItem *) l->data;
+ list = g_list_prepend (list, li->item);
+ }
+
+ if (client_area)
+ list = g_list_prepend (list, client_area);
+
+ return g_list_reverse (list);
+}
+
+void GLADEGNOME_API
+glade_gnome_bonobodock_replace_child (GladeWidgetAdaptor *adaptor,
+ GtkWidget *container,
+ GtkWidget *current,
+ GtkWidget *new_widget)
+{
+ bonobo_dock_set_client_area (BONOBO_DOCK (container), new_widget);
+}
+
+static gboolean
+glade_gnome_bonobodockitem_get_props (BonoboDock *doc,
+ BonoboDockItem *item,
+ BonoboDockPlacement *placement,
+ guint *band_num,
+ guint *band_position,
+ guint *offset)
+{
+ BonoboDockLayout *layout = bonobo_dock_get_layout (doc);
+ GList *l;
+
+ for (l = layout->items; l; l = l->next)
+ {
+ BonoboDockLayoutItem *li = (BonoboDockLayoutItem *) l->data;
+ if (li->item == item)
+ {
+ *placement = li->placement;
+ *band_num = li->position.docked.band_num;
+ *band_position = li->position.docked.band_position;
+ *offset = li->position.docked.offset;
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+void GLADEGNOME_API
+glade_gnome_bonobodock_set_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ BonoboDock *dock;
+ BonoboDockItem *item;
+ BonoboDockPlacement placement;
+ guint band_num, band_position, offset;
+ BonoboDockBand *band;
+ GtkWidget *wchild;
+ gboolean new_band = FALSE;
+
+ if (!BONOBO_IS_DOCK_ITEM (child))
+ /* Ignore packing properties of client area */
+ return;
+
+ dock = BONOBO_DOCK (container);
+ item = BONOBO_DOCK_ITEM (child);
+
+ if (strcmp ("behavior", property_name) == 0)
+ {
+ bonobo_dock_item_set_behavior (item, g_value_get_flags (value));
+ return;
+ }
+
+ wchild = GTK_WIDGET (child);
+ glade_gnome_bonobodockitem_get_props (dock, item, &placement, &band_num,
+ &band_position, &offset);
+
+ if (strcmp ("placement", property_name) == 0)
+ placement = g_value_get_enum (value);
+ else if (strcmp ("position", property_name) == 0)
+ band_position = g_value_get_int (value);
+ else if (strcmp ("band", property_name) == 0)
+ band_num = g_value_get_int (value);
+ else if (strcmp ("offset", property_name) == 0)
+ offset = g_value_get_int (value);
+ else
+ {
+ g_warning ("No BonoboDock set packing property support for '%s'.", property_name);
+ return;
+ }
+
+ if ((band = glade_gnome_bd_get_band (dock, wchild)))
+ {
+ g_object_ref (child);
+ gtk_container_remove (GTK_CONTAINER (band), wchild);
+
+ if (band->num_children == 0)
+ {
+ new_band = TRUE;
+ gtk_container_remove (GTK_CONTAINER (container), GTK_WIDGET(band));
+ }
+
+ bonobo_dock_add_item (dock, item, placement, band_num,
+ band_position, offset, new_band);
+ bonobo_dock_item_set_behavior (item, item->behavior);
+ g_object_unref (child);
+ }
+ else
+ g_warning ("BonoboDockItem's band not found.\n");
+}
+
+void GLADEGNOME_API
+glade_gnome_bonobodock_get_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ BonoboDockPlacement placement;
+ guint band_num, band_position, offset;
+
+ if (!BONOBO_IS_DOCK_ITEM (child))
+ /* Ignore packing properties of client area,
+ *
+ * FIXME: packing properties should actually be removed
+ * from client area children using glade_widget_remove_property();
+ */
+ return;
+
+ if (strcmp ("behavior", property_name) == 0)
+ {
+ g_value_set_flags (value, BONOBO_DOCK_ITEM (child)->behavior);
+ return;
+ }
+
+ glade_gnome_bonobodockitem_get_props (BONOBO_DOCK (container),
+ BONOBO_DOCK_ITEM (child),
+ &placement, &band_num,
+ &band_position, &offset);
+
+ if (strcmp ("placement", property_name) == 0)
+ g_value_set_enum (value, placement);
+ else if (strcmp ("position", property_name) == 0)
+ g_value_set_int (value, band_position);
+ else if (strcmp ("band", property_name) == 0)
+ g_value_set_int (value, band_num);
+ else if (strcmp ("offset", property_name) == 0)
+ g_value_set_int (value, offset);
+}
+
+void GLADEGNOME_API
+glade_gnome_bonobodock_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "allow-floating"))
+ bonobo_dock_allow_floating_items (BONOBO_DOCK (object),
+ g_value_get_boolean (value));
+ else
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor,
+ object,
+ id, value);
+}
diff --git a/plugins/gnome/gnome.xml.in b/plugins/gnome/gnome.xml.in
new file mode 100644
index 00000000..d08a712e
--- /dev/null
+++ b/plugins/gnome/gnome.xml.in
@@ -0,0 +1,390 @@
+<glade-catalog name="gnome" library="gladegnome" depends="gtk+" domain="glade-3" book="libgnomeui">
+ <init-function>glade_gnomeui_init</init-function>
+ <glade-widget-classes>
+ <glade-widget-class name="GnomeApp" generic-name="gnomeapp" title="Gnome App">
+ <post-create-function>glade_gnome_app_post_create</post-create-function>
+ <get-internal-child-function>glade_gnome_app_get_internal_child</get-internal-child-function>
+ <get-children-function>glade_gnome_app_get_children</get-children-function>
+ <child-set-property-function>glade_gnome_app_set_child_property</child-set-property-function>
+ <child-get-property-function>glade_gnome_app_get_child_property</child-get-property-function>
+ <set-property-function>glade_gnome_app_set_property</set-property-function>
+
+ <properties>
+ <property id="has-statusbar" _name="StatusBar" save="False">
+ <tooltip>If the window has a statusbar</tooltip>
+ <spec>glade_standard_boolean_spec</spec>
+ </property>
+ <property id="enable-layout-config" _name="Store Config">
+ <tooltip>If the layout is saved and restored automatically</tooltip>
+ <spec>glade_standard_boolean_spec</spec>
+ </property>
+ </properties>
+ <packing-properties>
+ <property id="position" _name="Position">
+ <spec>glade_standard_int_spec</spec>
+ </property>
+ <property id="padding" _name="Padding">
+ <spec>glade_standard_int_spec</spec>
+ </property>
+ <property id="expand" _name="Expand">
+ <spec>glade_standard_boolean_spec</spec>
+ </property>
+ <property id="fill" _name="Fill">
+ <spec>glade_standard_boolean_spec</spec>
+ </property>
+ <property id="pack-type">
+ <spec>glade_gnome_gtk_pack_type_spec</spec>
+ <displayable-values>
+ <value id="GTK_PACK_START" _name="Start"/>
+ <value id="GTK_PACK_END" _name="End"/>
+ </displayable-values>
+ </property>
+ </packing-properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GnomeDruid" generic-name="gnomedruid" title="Gnome Druid">
+ <post-create-function>glade_gnome_druid_post_create</post-create-function>
+ <add-child-function>glade_gnome_druid_add_child</add-child-function>
+ <remove-child-function>glade_gnome_druid_remove_child</remove-child-function>
+ <child-set-property-function>glade_gnome_druid_set_child_property</child-set-property-function>
+ <child-get-property-function>glade_gnome_druid_get_child_property</child-get-property-function>
+
+ <packing-properties>
+ <property id="position" _name="Position" default="-1" save="False">
+ <spec>glade_standard_int_spec</spec>
+ </property>
+ </packing-properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GnomeDruidPageEdge" generic-name="gnomedruidpageedge" title="Gnome Druid Page Edge">
+ <set-property-function>glade_gnome_dpe_set_property</set-property-function>
+ <properties>
+ <property id="position" _name="Position">
+ <spec>glade_gnome_dpe_position_spec</spec>
+ <_tooltip>Used to pass around information about the position of a GnomeDruidPage within the overall GnomeDruid. This enables the correct "surrounding" content for the page to be drawn</_tooltip>
+ <displayable-values>
+ <value id="GNOME_EDGE_START" _name="Start"/>
+ <value id="GNOME_EDGE_FINISH" _name="End"/>
+ <value id="GNOME_EDGE_OTHER" _name="Other"/>
+ </displayable-values>
+ </property>
+ <property id="title" _name="Title" translatable="True">
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>2</visible-lines>
+ </property>
+ <property id="text" _name="Text" translatable="True">
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>4</visible-lines>
+ </property>
+ <property id="title-foreground" _name="Title Foreground Color" default="#FFFFFF">
+ <spec>glade_standard_gdkcolor_spec</spec>
+ </property>
+ <property id="text-foreground" _name="Text Foreground Color" default="#000000">
+ <spec>glade_standard_gdkcolor_spec</spec>
+ </property>
+ <property id="background" _name="Background Color" default="#4B6983">
+ <spec>glade_standard_gdkcolor_spec</spec>
+ </property>
+ <property id="contents-background" _name="Contents Background Color" default="#DCDAD5">
+ <spec>glade_standard_gdkcolor_spec</spec>
+ </property>
+ <property id="logo-background" _name="Logo Background Color" default="#4B6983">
+ <spec>glade_standard_gdkcolor_spec</spec>
+ </property>
+ <property id="logo" _name="Logo">
+ <spec>glade_standard_pixbuf_spec</spec>
+ </property>
+ <property id="watermark" _name="Watermark">
+ <spec>glade_standard_pixbuf_spec</spec>
+ </property>
+ <property id="top-watermark" _name="Top Watermark">
+ <spec>glade_standard_pixbuf_spec</spec>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GnomeDruidPageStandard" generic-name="gnomedruidpagestandard" title="Gnome Druid Page Standard">
+ <post-create-function>glade_gnome_dps_post_create</post-create-function>
+ <get-internal-child-function>glade_gnome_dps_get_internal_child</get-internal-child-function>
+ <get-children-function>glade_gnome_dps_get_children</get-children-function>
+ <set-property-function>glade_gnome_dps_set_property</set-property-function>
+
+ <properties>
+ <property id="title" translatable="True">
+ <visible-lines>2</visible-lines>
+ </property>
+
+ <property id="background-set" disabled="True"/>
+ <property id="background" visible="False" save="False" default="#4B6983"/>
+ <property id="contents-background-set" disabled="True"/>
+ <property id="contents-background" visible="False" save="False" default="#DCDAD5"/>
+ <property id="logo-background-set" disabled="True"/>
+ <property id="logo-background" visible="False" save="False" default="#4B6983"/>
+ <property id="title-foreground-set" disabled="True"/>
+ <property id="title-foreground" visible="False" save="False" default="#FFFFFF"/>
+ </properties>
+ </glade-widget-class>
+
+
+ <glade-widget-class name="GnomeIconSelection" generic-name="gnomeiconselection" title="Gnome Icon Selection">
+ <properties>
+ <property id="size" visible="False" query="False" ignore="True"/>
+ </properties>
+ </glade-widget-class>
+ <glade-widget-class name="GnomeIconEntry" generic-name="gnomeiconentry" title="Gnome Icon Entry">
+ <set-property-function>glade_gnome_icon_entry_set_property</set-property-function>
+ <properties>
+ <property id="max-saved" _name="Max Saved">
+ <spec>glade_standard_uint_spec</spec>
+ <tooltip>The maximum number of history entries saved.</tooltip>
+ </property>
+ <property id="size" visible="False" query="False" ignore="True"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GnomeHRef" generic-name="gnomehref" title="Gnome HRef"/>
+
+ <glade-widget-class name="GnomeDateEdit" generic-name="gnomedateedit" title="Gnome Date Edit">
+ <post-create-function>glade_gnome_date_edit_post_create</post-create-function>
+ <properties>
+ <property id="time" disabled="True"/>
+ <property id="size" visible="False" query="False" ignore="True"/>
+ <property id="dateedit-flags">
+ <displayable-values>
+ <value id="GNOME_DATE_EDIT_SHOW_TIME" _name="Show Time"/>
+ <value id="GNOME_DATE_EDIT_24_HR" _name="24-Hour Format"/>
+ <value id="GNOME_DATE_EDIT_WEEK_STARTS_ON_MONDAY" _name="Monday First"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GnomeAppBar" generic-name="gnomeappbar" title="Gnome App Bar">
+ <post-create-function>glade_gnome_app_bar_post_create</post-create-function>
+ <properties>
+ <property id="has-progress" default="True" ignore="True"/>
+ <property id="has-status" default="True" ignore="True"/>
+ <property id="size" visible="False" query="False" ignore="True"/>
+ <property id="interactivity">
+ <displayable-values>
+ <value id="GNOME_PREFERENCES_NEVER" _name="Never"/>
+ <value id="GNOME_PREFERENCES_USER" _name="User"/>
+ <value id="GNOME_PREFERENCES_ALWAYS" _name="Always"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <!-- Deprecated Widget Classes :) -->
+ <glade-widget-class name="GnomeDialog" generic-name="gnomedialog" title="Gnome Dialog">
+ <post-create-function>glade_gnome_dialog_post_create</post-create-function>
+ <get-internal-child-function>glade_gnome_dialog_get_internal_child</get-internal-child-function>
+ <get-children-function>glade_gnome_dialog_get_children</get-children-function>
+ </glade-widget-class>
+
+ <glade-widget-class name="GnomeAbout" generic-name="gnomeabout" title="Gnome About">
+ <post-create-function>glade_gnome_about_dialog_post_create</post-create-function>
+ <set-property-function>glade_gnome_about_dialog_set_property</set-property-function>
+ <properties>
+ <property id="name" _name="Program Name"/>
+ <property id="version" _name="Program Version"/>
+ <property id="comments" translatable="True">
+ <visible-lines>4</visible-lines>
+ </property>
+ <property id="copyright" translatable="True">
+ <visible-lines>4</visible-lines>
+ </property>
+ <property id="translator-credits" translatable="True">
+ <visible-lines>4</visible-lines>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GnomeMessageBox" generic-name="gnomemessagebox" title="Gnome Message Box">
+ <set-property-function>glade_gnome_message_box_set_property</set-property-function>
+ <properties>
+ <property id="message-box-type">
+ <spec>glade_gnome_message_box_type_spec</spec>
+ <displayable-values>
+ <value id="GNOME_MESSAGE_BOX_INFO" _name="Information"/>
+ <value id="GNOME_MESSAGE_BOX_WARNING" _name="Warning"/>
+ <value id="GNOME_MESSAGE_BOX_ERROR" _name="Error"/>
+ <value id="GNOME_MESSAGE_BOX_QUESTION" _name="Question"/>
+ <value id="GNOME_MESSAGE_BOX_GENERIC" _name="Generic"/>
+ </displayable-values>
+ </property>
+ <property id="message" _name="Message">
+ <spec>glade_standard_string_spec</spec>
+ <tooltip>The message to display</tooltip>
+ </property>
+ </properties>
+ </glade-widget-class>
+ <glade-widget-class name="GnomePropertyBox" generic-name="gnomepropertybox" title="Gnome Property Box"/>
+
+ <glade-widget-class name="GnomeEntry" generic-name="gnomeentry" title="Gnome Entry">
+ <post-create-function>glade_gnome_entry_post_create</post-create-function>
+ <get-internal-child-function>glade_gnome_entry_get_internal_child</get-internal-child-function>
+ <get-children-function>glade_gnome_entry_get_children</get-children-function>
+ <set-property-function>glade_gnome_entry_set_property</set-property-function>
+ <properties>
+ <property id="gtk-entry" disabled="True"/>
+ <property id="max-saved" _name="Max Saved">
+ <spec>glade_standard_int_spec</spec>
+ <_tooltip>The maximum number of history entries saved</_tooltip>
+ </property>
+ <property id="size" visible="False" query="False" ignore="True"/>
+ </properties>
+
+ <packing-properties>
+ <property id="expand" disabled="True"/>
+ <property id="fill" disabled="True"/>
+ <property id="pack-type" disabled="True"/>
+ <property id="padding" disabled="True"/>
+ <property id="position" disabled="True"/>
+ </packing-properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GnomeFileEntry" generic-name="gnomefileentry" title="Gnome File Entry">
+ <post-create-function>glade_gnome_entry_post_create</post-create-function>
+ <get-internal-child-function>glade_gnome_entry_get_internal_child</get-internal-child-function>
+ <get-children-function>glade_gnome_entry_get_children</get-children-function>
+ <set-property-function>glade_gnome_file_entry_set_property</set-property-function>
+ <properties>
+ <property id="max-saved" _name="Max Saved">
+ <spec>glade_standard_int_spec</spec>
+ <_tooltip>The maximum number of history entries saved</_tooltip>
+ </property>
+ <property id="size" visible="False" query="False" ignore="True"/>
+ <property id="filechooser-action">
+ <displayable-values>
+ <value id="GTK_FILE_CHOOSER_ACTION_OPEN" _name="Open"/>
+ <value id="GTK_FILE_CHOOSER_ACTION_SAVE" _name="Save"/>
+ <value id="GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER" _name="Select Folder"/>
+ <value id="GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER" _name="Create Folder"/>
+ </displayable-values>
+ </property>
+ </properties>
+ <packing-properties>
+ <property id="expand" disabled="True"/>
+ <property id="fill" disabled="True"/>
+ <property id="pack-type" disabled="True"/>
+ <property id="padding" disabled="True"/>
+ <property id="position" disabled="True"/>
+ </packing-properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GnomePixmapEntry" generic-name="gnomepixmapentry" title="Gnome Pixmap Entry">
+ <packing-properties>
+ <property id="expand" disabled="True"/>
+ <property id="fill" disabled="True"/>
+ <property id="pack-type" disabled="True"/>
+ <property id="padding" disabled="True"/>
+ <property id="position" disabled="True"/>
+ </packing-properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GnomeColorPicker" generic-name="gnomecolorpicker" title="Gnome Color Picker">
+ <post-create-function>empty</post-create-function>
+ <properties>
+ <property id="use-underline" disabled="True"/>
+ <property id="label" disabled="True"/>
+ <property id="glade-type" disabled="True"/>
+ <property id="stock" disabled="True"/>
+ <property id="red" disabled="True"/>
+ <property id="green" disabled="True"/>
+ <property id="blue" disabled="True"/>
+ <property id="alpha" disabled="True"/>
+ <property id="dither" _name="Dither"/>
+ <property id="use-alpha" _name="Use Alpha"/>
+ <property id="title" _name="Title"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GnomeFontPicker" generic-name="gnomefontpicker" title="Gnome Font Picker">
+ <post-create-function>empty</post-create-function>
+ <get-children-function>glade_gnome_font_picker_get_children</get-children-function>
+ <add-child-function>glade_gnome_font_picker_add_child</add-child-function>
+ <remove-child-function>glade_gnome_font_picker_remove_child</remove-child-function>
+ <replace-child-function>glade_gnome_font_picker_replace_child</replace-child-function>
+ <set-property-function>glade_gnome_font_picker_set_property</set-property-function>
+
+ <properties>
+ <property id="use-underline" disabled="True"/>
+ <property id="label" disabled="True"/>
+ <property id="glade-type" disabled="True"/>
+ <property id="stock" disabled="True"/>
+ <property id="font-name" disabled="True"/>
+ <property id="mode">
+ <displayable-values>
+ <value id="GNOME_FONT_PICKER_MODE_PIXMAP" _name="Pixmap"/>
+ <value id="GNOME_FONT_PICKER_MODE_FONT_INFO" _name="Font Information"/>
+ <value id="GNOME_FONT_PICKER_MODE_USER_WIDGET" _name="User Widget"/>
+ <value id="GNOME_FONT_PICKER_MODE_UNKNOWN" _name="Unknown"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GnomePixmap" generic-name="gnomepixmap" title="Gnome Pixmap">
+ <post-create-function>empty</post-create-function>
+ <set-property-function>glade_gnome_pixmap_set_property</set-property-function>
+ <properties>
+ <property id="stock" disabled="True"/>
+ <property id="icon-name" disabled="True"/>
+ <property id="glade-stock" disabled="True"/>
+ <property id="glade-type" disabled="True"/>
+ <property id="pixbuf" disabled="True"/>
+ <property id="icon-size" disabled="True"/>
+ <property id="pixel-size" disabled="True"/>
+ <property id="filename" _name="File">
+ <spec>glade_standard_pixbuf_spec</spec>
+ <_tooltip>The pixmap file</_tooltip>
+ </property>
+ <property id="scaled-width" _name="Scaled Width">
+ <spec>glade_standard_int_spec</spec>
+ <_tooltip>The width to scale the pixmap to</_tooltip>
+ </property>
+ <property id="scaled-height" _name="Scaled Height">
+ <spec>glade_standard_int_spec</spec>
+ <_tooltip>The height to scale the pixmap to</_tooltip>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <!-- Unsupported Classes
+ Deprecated and not suported by libglade:
+ * GnomeScores
+
+ These are not widget classes:
+ * GnomeClient
+ * GnomeMdi, GnomeMdiChild, GnomeMdiGenericChild
+ * GnomeCanvasItem, GnomeIconTextItem -->
+ </glade-widget-classes>
+
+ <glade-widget-group name="gnomeui-base" _title="GNOME User Interface">
+
+ <glade-widget-class-ref name="GnomeApp"/>
+ <glade-widget-class-ref name="GnomeDruid"/>
+ <glade-widget-class-ref name="GnomeIconSelection"/>
+ <glade-widget-class-ref name="GnomeHRef"/>
+ <glade-widget-class-ref name="GnomeDateEdit"/>
+ <glade-widget-class-ref name="GnomeIconEntry"/>
+ <glade-widget-class-ref name="GnomeAppBar"/>
+ </glade-widget-group>
+
+ <glade-widget-group name="gnomeui-obsolete" _title="GNOME UI Obsolete">
+
+ <default-palette-state expanded="False" />
+
+ <glade-widget-class-ref name="GnomeDialog"/>
+ <glade-widget-class-ref name="GnomeAbout"/>
+ <glade-widget-class-ref name="GnomeMessageBox"/>
+ <glade-widget-class-ref name="GnomePropertyBox"/>
+ <glade-widget-class-ref name="GnomeEntry"/>
+ <glade-widget-class-ref name="GnomeFileEntry"/>
+ <glade-widget-class-ref name="GnomePixmapEntry"/>
+ <glade-widget-class-ref name="GnomeColorPicker"/>
+ <glade-widget-class-ref name="GnomeFontPicker"/>
+ <glade-widget-class-ref name="GnomePixmap"/>
+ </glade-widget-group>
+</glade-catalog>
diff --git a/plugins/gnome/icons/16x16/Makefile.am b/plugins/gnome/icons/16x16/Makefile.am
new file mode 100644
index 00000000..985dd7c0
--- /dev/null
+++ b/plugins/gnome/icons/16x16/Makefile.am
@@ -0,0 +1,31 @@
+## Process this file with automake to produce Makefile.in
+
+iconsdir = $(pkgdatadir)/pixmaps/16x16
+
+icons_DATA = \
+ bonobodock.png \
+ bonobodockitem.png \
+ gnomehref.png \
+ gnomeapp.png \
+ gnomeappbar.png \
+ gnomecanvas.png \
+ gnomedateedit.png \
+ gnomeiconentry.png \
+ gnomeiconselection.png \
+ gnomedruid.png \
+ gnomedruidpageedge.png \
+ gnomedruidpagestandard.png \
+ gnomepixmap.png \
+ gnomepropertybox.png \
+ gnomecolorpicker.png \
+ gnomepixmapentry.png \
+ gnomeabout.png \
+ gnomeentry.png \
+ gnomeappbar.png \
+ gnomedialog.png \
+ gnomefileentry.png \
+ gnomefontpicker.png \
+ gnomeiconlist.png \
+ gnomemessagebox.png
+
+EXTRA_DIST = $(icons_DATA)
diff --git a/plugins/gnome/icons/16x16/bonobodock.png b/plugins/gnome/icons/16x16/bonobodock.png
new file mode 100644
index 00000000..eb8025f0
--- /dev/null
+++ b/plugins/gnome/icons/16x16/bonobodock.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/bonobodockitem.png b/plugins/gnome/icons/16x16/bonobodockitem.png
new file mode 100644
index 00000000..a56584e5
--- /dev/null
+++ b/plugins/gnome/icons/16x16/bonobodockitem.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomeabout.png b/plugins/gnome/icons/16x16/gnomeabout.png
new file mode 100644
index 00000000..2e64933e
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomeabout.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomeapp.png b/plugins/gnome/icons/16x16/gnomeapp.png
new file mode 100644
index 00000000..ee23fee5
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomeapp.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomeappbar.png b/plugins/gnome/icons/16x16/gnomeappbar.png
new file mode 100644
index 00000000..b8297ce8
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomeappbar.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomecanvas.png b/plugins/gnome/icons/16x16/gnomecanvas.png
new file mode 100644
index 00000000..5df4e274
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomecanvas.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomecolorpicker.png b/plugins/gnome/icons/16x16/gnomecolorpicker.png
new file mode 100644
index 00000000..49c077db
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomecolorpicker.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomedateedit.png b/plugins/gnome/icons/16x16/gnomedateedit.png
new file mode 100644
index 00000000..ec4e622f
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomedateedit.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomedialog.png b/plugins/gnome/icons/16x16/gnomedialog.png
new file mode 100644
index 00000000..ae70aec0
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomedialog.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomedruid.png b/plugins/gnome/icons/16x16/gnomedruid.png
new file mode 100644
index 00000000..23821b0e
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomedruid.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomedruidpageedge.png b/plugins/gnome/icons/16x16/gnomedruidpageedge.png
new file mode 100644
index 00000000..23821b0e
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomedruidpageedge.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomedruidpagestandard.png b/plugins/gnome/icons/16x16/gnomedruidpagestandard.png
new file mode 100644
index 00000000..78018d9c
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomedruidpagestandard.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomeentry.png b/plugins/gnome/icons/16x16/gnomeentry.png
new file mode 100644
index 00000000..a76ad8bf
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomeentry.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomefileentry.png b/plugins/gnome/icons/16x16/gnomefileentry.png
new file mode 100644
index 00000000..ec4e622f
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomefileentry.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomefontpicker.png b/plugins/gnome/icons/16x16/gnomefontpicker.png
new file mode 100644
index 00000000..8fa2d501
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomefontpicker.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomehref.png b/plugins/gnome/icons/16x16/gnomehref.png
new file mode 100644
index 00000000..cdc839e9
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomehref.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomeiconentry.png b/plugins/gnome/icons/16x16/gnomeiconentry.png
new file mode 100644
index 00000000..413d2b3a
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomeiconentry.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomeiconlist.png b/plugins/gnome/icons/16x16/gnomeiconlist.png
new file mode 100644
index 00000000..48439286
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomeiconlist.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomeiconselection.png b/plugins/gnome/icons/16x16/gnomeiconselection.png
new file mode 100644
index 00000000..2f7b08ad
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomeiconselection.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomemessagebox.png b/plugins/gnome/icons/16x16/gnomemessagebox.png
new file mode 100644
index 00000000..c3643f16
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomemessagebox.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomepixmap.png b/plugins/gnome/icons/16x16/gnomepixmap.png
new file mode 100644
index 00000000..7c13c07b
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomepixmap.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomepixmapentry.png b/plugins/gnome/icons/16x16/gnomepixmapentry.png
new file mode 100644
index 00000000..ec4e622f
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomepixmapentry.png
Binary files differ
diff --git a/plugins/gnome/icons/16x16/gnomepropertybox.png b/plugins/gnome/icons/16x16/gnomepropertybox.png
new file mode 100644
index 00000000..32f27900
--- /dev/null
+++ b/plugins/gnome/icons/16x16/gnomepropertybox.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/Makefile.am b/plugins/gnome/icons/22x22/Makefile.am
new file mode 100644
index 00000000..3e1629b7
--- /dev/null
+++ b/plugins/gnome/icons/22x22/Makefile.am
@@ -0,0 +1,31 @@
+## Process this file with automake to produce Makefile.in
+
+iconsdir = $(pkgdatadir)/pixmaps/22x22
+
+icons_DATA = \
+ bonobodock.png \
+ bonobodockitem.png \
+ gnomehref.png \
+ gnomeapp.png \
+ gnomeappbar.png \
+ gnomecanvas.png \
+ gnomedateedit.png \
+ gnomeiconentry.png \
+ gnomeiconselection.png \
+ gnomedruid.png \
+ gnomedruidpageedge.png \
+ gnomedruidpagestandard.png \
+ gnomepixmap.png \
+ gnomepropertybox.png \
+ gnomecolorpicker.png \
+ gnomepixmapentry.png \
+ gnomeabout.png \
+ gnomeentry.png \
+ gnomeappbar.png \
+ gnomedialog.png \
+ gnomefileentry.png \
+ gnomefontpicker.png \
+ gnomeiconlist.png \
+ gnomemessagebox.png
+
+EXTRA_DIST = $(icons_DATA)
diff --git a/plugins/gnome/icons/22x22/bonobodock.png b/plugins/gnome/icons/22x22/bonobodock.png
new file mode 100644
index 00000000..e98ed3dc
--- /dev/null
+++ b/plugins/gnome/icons/22x22/bonobodock.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/bonobodockitem.png b/plugins/gnome/icons/22x22/bonobodockitem.png
new file mode 100644
index 00000000..a66fd065
--- /dev/null
+++ b/plugins/gnome/icons/22x22/bonobodockitem.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomeabout.png b/plugins/gnome/icons/22x22/gnomeabout.png
new file mode 100644
index 00000000..00152359
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomeabout.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomeapp.png b/plugins/gnome/icons/22x22/gnomeapp.png
new file mode 100644
index 00000000..fc6acbe1
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomeapp.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomeappbar.png b/plugins/gnome/icons/22x22/gnomeappbar.png
new file mode 100644
index 00000000..85af74fc
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomeappbar.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomecanvas.png b/plugins/gnome/icons/22x22/gnomecanvas.png
new file mode 100644
index 00000000..1911b513
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomecanvas.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomecolorpicker.png b/plugins/gnome/icons/22x22/gnomecolorpicker.png
new file mode 100644
index 00000000..ff4676ac
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomecolorpicker.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomedateedit.png b/plugins/gnome/icons/22x22/gnomedateedit.png
new file mode 100644
index 00000000..7945a480
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomedateedit.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomedialog.png b/plugins/gnome/icons/22x22/gnomedialog.png
new file mode 100644
index 00000000..575ebf5d
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomedialog.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomedruid.png b/plugins/gnome/icons/22x22/gnomedruid.png
new file mode 100644
index 00000000..78daffa3
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomedruid.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomedruidpageedge.png b/plugins/gnome/icons/22x22/gnomedruidpageedge.png
new file mode 100644
index 00000000..78daffa3
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomedruidpageedge.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomedruidpagestandard.png b/plugins/gnome/icons/22x22/gnomedruidpagestandard.png
new file mode 100644
index 00000000..03010e63
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomedruidpagestandard.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomeentry.png b/plugins/gnome/icons/22x22/gnomeentry.png
new file mode 100644
index 00000000..89d0fa1f
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomeentry.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomefileentry.png b/plugins/gnome/icons/22x22/gnomefileentry.png
new file mode 100644
index 00000000..7945a480
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomefileentry.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomefontpicker.png b/plugins/gnome/icons/22x22/gnomefontpicker.png
new file mode 100644
index 00000000..79a88eb2
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomefontpicker.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomehref.png b/plugins/gnome/icons/22x22/gnomehref.png
new file mode 100644
index 00000000..58a78904
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomehref.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomeiconentry.png b/plugins/gnome/icons/22x22/gnomeiconentry.png
new file mode 100644
index 00000000..e90c5561
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomeiconentry.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomeiconlist.png b/plugins/gnome/icons/22x22/gnomeiconlist.png
new file mode 100644
index 00000000..fcf5bcb3
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomeiconlist.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomeiconselection.png b/plugins/gnome/icons/22x22/gnomeiconselection.png
new file mode 100644
index 00000000..80711e98
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomeiconselection.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomemessagebox.png b/plugins/gnome/icons/22x22/gnomemessagebox.png
new file mode 100644
index 00000000..df878d30
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomemessagebox.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomepixmap.png b/plugins/gnome/icons/22x22/gnomepixmap.png
new file mode 100644
index 00000000..414ae1c4
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomepixmap.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomepixmapentry.png b/plugins/gnome/icons/22x22/gnomepixmapentry.png
new file mode 100644
index 00000000..7945a480
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomepixmapentry.png
Binary files differ
diff --git a/plugins/gnome/icons/22x22/gnomepropertybox.png b/plugins/gnome/icons/22x22/gnomepropertybox.png
new file mode 100644
index 00000000..a36f7c3f
--- /dev/null
+++ b/plugins/gnome/icons/22x22/gnomepropertybox.png
Binary files differ
diff --git a/plugins/gnome/icons/Makefile.am b/plugins/gnome/icons/Makefile.am
new file mode 100644
index 00000000..bd39c36e
--- /dev/null
+++ b/plugins/gnome/icons/Makefile.am
@@ -0,0 +1,3 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = 16x16 22x22
diff --git a/plugins/gtk+/Makefile.am b/plugins/gtk+/Makefile.am
new file mode 100644
index 00000000..2200ee4c
--- /dev/null
+++ b/plugins/gtk+/Makefile.am
@@ -0,0 +1,44 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = icons
+
+libgladeui = $(top_builddir)/gladeui/libgladeui-1.la
+
+
+# libgladegtk
+
+gladegtk_LTLIBRARIES = libgladegtk.la
+gladegtkdir = $(pkglibdir)/modules
+
+libgladegtk_la_CPPLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
+ $(AM_CPPFLAGS)
+
+libgladegtk_la_CFLAGS = \
+ -g -Wall \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/gladeui \
+ -I$(top_builddir)/gladeui \
+ $(GTK_CFLAGS) \
+ $(AM_CFLAGS)
+
+libgladegtk_la_SOURCES = glade-gtk.c glade-gtk.h
+libgladegtk_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
+libgladegtk_la_LIBADD = $(libgladeui) $(GTK_LIBS)
+
+if WITH_WIN32
+ libgladegtk_la_LDFLAGS += -no-undefined
+endif
+
+
+# catalog data
+
+catalogsdir = $(pkgdatadir)/catalogs
+catalogs_DATA = gtk+.xml gtk+.xml.in
+@INTLTOOL_XML_NOMERGE_RULE@
+
+
+CLEANFILES = gtk+.xml
+
+EXTRA_DIST = $(catalogs_DATA)
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
new file mode 100644
index 00000000..fdceffce
--- /dev/null
+++ b/plugins/gtk+/glade-gtk.c
@@ -0,0 +1,5871 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2001 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Authors:
+ * Chema Celorio <chema@celorio.com>
+ * Tristan Van Berkom <tvb@gnome.org>
+ * Juan Pablo Ugarte <juanpablougarte@gmail.com>
+ */
+
+#include <config.h>
+
+#include "glade-gtk.h"
+
+#include <glade-editor-property.h>
+#include <glade-base-editor.h>
+#include <fixed_bg.xpm>
+
+#include <gtk/gtk.h>
+#include <glib/gi18n-lib.h>
+#include <string.h>
+#include <stdlib.h>
+
+/* --------------------------------- Constants ------------------------------ */
+#define FIXED_DEFAULT_CHILD_WIDTH 100
+#define FIXED_DEFAULT_CHILD_HEIGHT 60
+
+
+/* -------------------------------- ParamSpecs ------------------------------ */
+/*
+GtkImageMenuItem GnomeUI "stock_item" property special case:
+
+"stock_item" property is added by glade2 gnome support and makes reference to
+GNOMEUIINFO_MENU_* macros. This set-function maps these properties to
+existing non deprecated gtk ones.
+*/
+typedef enum {
+ GNOMEUIINFO_MENU_NONE,
+ /* The 'File' menu */
+ GNOMEUIINFO_MENU_NEW_ITEM,
+ GNOMEUIINFO_MENU_NEW_SUBTREE,
+ GNOMEUIINFO_MENU_OPEN_ITEM,
+ GNOMEUIINFO_MENU_SAVE_ITEM,
+ GNOMEUIINFO_MENU_SAVE_AS_ITEM,
+ GNOMEUIINFO_MENU_REVERT_ITEM,
+ GNOMEUIINFO_MENU_PRINT_ITEM,
+ GNOMEUIINFO_MENU_PRINT_SETUP_ITEM,
+ GNOMEUIINFO_MENU_CLOSE_ITEM,
+ GNOMEUIINFO_MENU_EXIT_ITEM,
+ GNOMEUIINFO_MENU_QUIT_ITEM,
+ /* The "Edit" menu */
+ GNOMEUIINFO_MENU_CUT_ITEM,
+ GNOMEUIINFO_MENU_COPY_ITEM,
+ GNOMEUIINFO_MENU_PASTE_ITEM,
+ GNOMEUIINFO_MENU_SELECT_ALL_ITEM,
+ GNOMEUIINFO_MENU_CLEAR_ITEM,
+ GNOMEUIINFO_MENU_UNDO_ITEM,
+ GNOMEUIINFO_MENU_REDO_ITEM,
+ GNOMEUIINFO_MENU_FIND_ITEM,
+ GNOMEUIINFO_MENU_FIND_AGAIN_ITEM,
+ GNOMEUIINFO_MENU_REPLACE_ITEM,
+ GNOMEUIINFO_MENU_PROPERTIES_ITEM,
+ /* The Settings menu */
+ GNOMEUIINFO_MENU_PREFERENCES_ITEM,
+ /* The Windows menu */
+ GNOMEUIINFO_MENU_NEW_WINDOW_ITEM,
+ GNOMEUIINFO_MENU_CLOSE_WINDOW_ITEM,
+ /* And the "Help" menu */
+ GNOMEUIINFO_MENU_ABOUT_ITEM,
+ /* The "Game" menu */
+ GNOMEUIINFO_MENU_NEW_GAME_ITEM,
+ GNOMEUIINFO_MENU_PAUSE_GAME_ITEM,
+ GNOMEUIINFO_MENU_RESTART_GAME_ITEM,
+ GNOMEUIINFO_MENU_UNDO_MOVE_ITEM,
+ GNOMEUIINFO_MENU_REDO_MOVE_ITEM,
+ GNOMEUIINFO_MENU_HINT_ITEM,
+ GNOMEUIINFO_MENU_SCORES_ITEM,
+ GNOMEUIINFO_MENU_END_GAME_ITEM,
+ /* Some standard menus */
+ GNOMEUIINFO_MENU_FILE_TREE,
+ GNOMEUIINFO_MENU_EDIT_TREE,
+ GNOMEUIINFO_MENU_VIEW_TREE,
+ GNOMEUIINFO_MENU_SETTINGS_TREE,
+ GNOMEUIINFO_MENU_FILES_TREE,
+ GNOMEUIINFO_MENU_WINDOWS_TREE,
+ GNOMEUIINFO_MENU_HELP_TREE,
+ GNOMEUIINFO_MENU_GAME_TREE
+} GladeGtkGnomeUIInfoEnum;
+
+static GType
+glade_gtk_gnome_ui_info_get_type (void)
+{
+ static GType etype = 0;
+ if (etype == 0) {
+ static const GEnumValue values[] = {
+ { GNOMEUIINFO_MENU_NONE, "GNOMEUIINFO_MENU_NONE", NULL},
+ /* The 'File' menu */
+ { GNOMEUIINFO_MENU_NEW_ITEM, "GNOMEUIINFO_MENU_NEW_ITEM", "gtk-new"},
+ { GNOMEUIINFO_MENU_OPEN_ITEM, "GNOMEUIINFO_MENU_OPEN_ITEM", "gtk-open"},
+ { GNOMEUIINFO_MENU_SAVE_ITEM, "GNOMEUIINFO_MENU_SAVE_ITEM", "gtk-save"},
+ { GNOMEUIINFO_MENU_SAVE_AS_ITEM, "GNOMEUIINFO_MENU_SAVE_AS_ITEM", "gtk-save-as"},
+ { GNOMEUIINFO_MENU_REVERT_ITEM, "GNOMEUIINFO_MENU_REVERT_ITEM", "gtk-revert-to-saved"},
+ { GNOMEUIINFO_MENU_PRINT_ITEM, "GNOMEUIINFO_MENU_PRINT_ITEM", "gtk-print"},
+ { GNOMEUIINFO_MENU_PRINT_SETUP_ITEM, "GNOMEUIINFO_MENU_PRINT_SETUP_ITEM", NULL},
+ { GNOMEUIINFO_MENU_CLOSE_ITEM, "GNOMEUIINFO_MENU_CLOSE_ITEM", "gtk-close"},
+ { GNOMEUIINFO_MENU_EXIT_ITEM, "GNOMEUIINFO_MENU_EXIT_ITEM", "gtk-quit"},
+ { GNOMEUIINFO_MENU_QUIT_ITEM, "GNOMEUIINFO_MENU_QUIT_ITEM", "gtk-quit"},
+ /* The "Edit" menu */
+ { GNOMEUIINFO_MENU_CUT_ITEM, "GNOMEUIINFO_MENU_CUT_ITEM", "gtk-cut"},
+ { GNOMEUIINFO_MENU_COPY_ITEM, "GNOMEUIINFO_MENU_COPY_ITEM", "gtk-copy"},
+ { GNOMEUIINFO_MENU_PASTE_ITEM, "GNOMEUIINFO_MENU_PASTE_ITEM", "gtk-paste"},
+ { GNOMEUIINFO_MENU_SELECT_ALL_ITEM, "GNOMEUIINFO_MENU_SELECT_ALL_ITEM", NULL},
+ { GNOMEUIINFO_MENU_CLEAR_ITEM, "GNOMEUIINFO_MENU_CLEAR_ITEM", "gtk-clear"},
+ { GNOMEUIINFO_MENU_UNDO_ITEM, "GNOMEUIINFO_MENU_UNDO_ITEM", "gtk-undo"},
+ { GNOMEUIINFO_MENU_REDO_ITEM, "GNOMEUIINFO_MENU_REDO_ITEM", "gtk-redo"},
+ { GNOMEUIINFO_MENU_FIND_ITEM, "GNOMEUIINFO_MENU_FIND_ITEM", "gtk-find"},
+ { GNOMEUIINFO_MENU_FIND_AGAIN_ITEM, "GNOMEUIINFO_MENU_FIND_AGAIN_ITEM", NULL},
+ { GNOMEUIINFO_MENU_REPLACE_ITEM, "GNOMEUIINFO_MENU_REPLACE_ITEM", "gtk-find-and-replace"},
+ { GNOMEUIINFO_MENU_PROPERTIES_ITEM, "GNOMEUIINFO_MENU_PROPERTIES_ITEM", "gtk-properties"},
+ /* The Settings menu */
+ { GNOMEUIINFO_MENU_PREFERENCES_ITEM, "GNOMEUIINFO_MENU_PREFERENCES_ITEM", "gtk-preferences"},
+ /* The Windows menu */
+ { GNOMEUIINFO_MENU_NEW_WINDOW_ITEM, "GNOMEUIINFO_MENU_NEW_WINDOW_ITEM", NULL},
+ { GNOMEUIINFO_MENU_CLOSE_WINDOW_ITEM, "GNOMEUIINFO_MENU_CLOSE_WINDOW_ITEM", NULL},
+ /* And the "Help" menu */
+ { GNOMEUIINFO_MENU_ABOUT_ITEM, "GNOMEUIINFO_MENU_ABOUT_ITEM", "gtk-about"},
+ /* The "Game" menu */
+ { GNOMEUIINFO_MENU_NEW_GAME_ITEM, "GNOMEUIINFO_MENU_NEW_GAME_ITEM", NULL},
+ { GNOMEUIINFO_MENU_PAUSE_GAME_ITEM, "GNOMEUIINFO_MENU_PAUSE_GAME_ITEM", NULL},
+ { GNOMEUIINFO_MENU_RESTART_GAME_ITEM, "GNOMEUIINFO_MENU_RESTART_GAME_ITEM", NULL},
+ { GNOMEUIINFO_MENU_UNDO_MOVE_ITEM, "GNOMEUIINFO_MENU_UNDO_MOVE_ITEM", NULL},
+ { GNOMEUIINFO_MENU_REDO_MOVE_ITEM, "GNOMEUIINFO_MENU_REDO_MOVE_ITEM", NULL},
+ { GNOMEUIINFO_MENU_HINT_ITEM, "GNOMEUIINFO_MENU_HINT_ITEM", NULL},
+ { GNOMEUIINFO_MENU_SCORES_ITEM, "GNOMEUIINFO_MENU_SCORES_ITEM", NULL},
+ { GNOMEUIINFO_MENU_END_GAME_ITEM, "GNOMEUIINFO_MENU_END_GAME_ITEM", NULL},
+ /* Some standard menus */
+ { GNOMEUIINFO_MENU_FILE_TREE, "GNOMEUIINFO_MENU_FILE_TREE", NULL},
+ { GNOMEUIINFO_MENU_EDIT_TREE, "GNOMEUIINFO_MENU_EDIT_TREE", NULL},
+ { GNOMEUIINFO_MENU_VIEW_TREE, "GNOMEUIINFO_MENU_VIEW_TREE", NULL},
+ { GNOMEUIINFO_MENU_SETTINGS_TREE, "GNOMEUIINFO_MENU_SETTINGS_TREE", NULL},
+ { GNOMEUIINFO_MENU_FILES_TREE, "GNOMEUIINFO_MENU_FILES_TREE", NULL},
+ { GNOMEUIINFO_MENU_WINDOWS_TREE, "GNOMEUIINFO_MENU_WINDOWS_TREE", NULL},
+ { GNOMEUIINFO_MENU_HELP_TREE, "GNOMEUIINFO_MENU_HELP_TREE", NULL},
+ { GNOMEUIINFO_MENU_GAME_TREE, "GNOMEUIINFO_MENU_GAME_TREE", NULL},
+ { 0, NULL, NULL }
+ };
+ etype = g_enum_register_static ("GladeGtkGnomeUIInfo", values);
+ }
+ return etype;
+}
+
+GParamSpec * GLADEGTK_API
+glade_gtk_gnome_ui_info_spec (void)
+{
+ return g_param_spec_enum ("gnomeuiinfo", _("GnomeUIInfo"),
+ _("Choose the GnomeUIInfo stock item"),
+ glade_gtk_gnome_ui_info_get_type (),
+ 0, G_PARAM_READWRITE);
+}
+
+GType GLADEGTK_API
+glade_gtk_image_type_get_type (void)
+{
+ static GType etype = 0;
+ if (etype == 0) {
+ static GEnumValue values[] = {
+ { GLADEGTK_IMAGE_FILENAME, "a", "glade-gtk-image-filename" },
+ { GLADEGTK_IMAGE_STOCK, "b", "glade-gtk-image-stock" },
+ { GLADEGTK_IMAGE_ICONTHEME, "c", "glade-gtk-image-icontheme" },
+ { 0, NULL, NULL }
+ };
+ values[GLADEGTK_IMAGE_FILENAME].value_name = _("Filename");
+ values[GLADEGTK_IMAGE_STOCK].value_name = _("Stock");
+ values[GLADEGTK_IMAGE_ICONTHEME].value_name = _("Icon Theme");
+
+ etype = g_enum_register_static ("GladeGtkImageType", values);
+ }
+ return etype;
+}
+
+GType GLADEGTK_API
+glade_gtk_button_type_get_type (void)
+{
+ static GType etype = 0;
+ if (etype == 0) {
+ static GEnumValue values[] = {
+ { GLADEGTK_BUTTON_LABEL, "a", "glade-gtk-button-label" },
+ { GLADEGTK_BUTTON_STOCK, "b", "glade-gtk-button-stock" },
+ { GLADEGTK_BUTTON_CONTAINER, "c", "glade-gtk-button-container" },
+ { 0, NULL, NULL }
+ };
+ values[GLADEGTK_BUTTON_LABEL].value_name = _("Label");
+ values[GLADEGTK_BUTTON_STOCK].value_name = _("Stock");
+ values[GLADEGTK_BUTTON_CONTAINER].value_name = _("Container");
+
+ etype = g_enum_register_static ("GladeGtkButtonType", values);
+ }
+ return etype;
+}
+
+GParamSpec * GLADEGTK_API
+glade_gtk_image_type_spec (void)
+{
+ return g_param_spec_enum ("type", _("Method"),
+ _("The method to use to edit this image"),
+ glade_gtk_image_type_get_type (),
+ 1, G_PARAM_READWRITE);
+}
+
+GParamSpec * GLADEGTK_API
+glade_gtk_button_type_spec (void)
+{
+ return g_param_spec_enum ("type", _("Method"),
+ _("The method to use to edit this button"),
+ glade_gtk_button_type_get_type (),
+ 0, G_PARAM_READWRITE);
+}
+
+
+/* This function does absolutely nothing
+ * (and is for use in overriding post_create functions).
+ */
+void GLADEGTK_API
+empty (GObject *container, GladeCreateReason reason)
+{
+}
+
+
+/* ----------------------------- GtkWidget ------------------------------ */
+void GLADEGTK_API
+glade_gtk_widget_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "tooltip"))
+ {
+ GladeWidget *glade_widget = glade_widget_get_from_gobject (object);
+ GladeProject *project = glade_widget_get_project (glade_widget);
+ GtkTooltips *tooltips = glade_project_get_tooltips (project);
+ const gchar *tooltip;
+
+ /* TODO: handle GtkToolItems with gtk_tool_item_set_tooltip() */
+ tooltip = g_value_get_string (value);
+ if (tooltip && *tooltip)
+ gtk_tooltips_set_tip (tooltips, GTK_WIDGET (object), tooltip, NULL);
+ else
+ gtk_tooltips_set_tip (tooltips, GTK_WIDGET (object), NULL, NULL);
+ }
+ else
+ GWA_GET_CLASS (G_TYPE_OBJECT)->set_property (adaptor, object, id, value);
+}
+
+void GLADEGTK_API
+glade_gtk_widget_get_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ GValue *value)
+{
+ if (!strcmp (id, "tooltip"))
+ {
+ GtkTooltipsData *tooltips_data = gtk_tooltips_data_get (GTK_WIDGET (object));
+
+ g_value_reset (value);
+ g_value_set_string (value,
+ tooltips_data ? tooltips_data->tip_text : NULL);
+ }
+ else
+ GWA_GET_CLASS (G_TYPE_OBJECT)->get_property (adaptor, object, id, value);
+}
+
+/* ----------------------------- GtkContainer ------------------------------ */
+void GLADEGTK_API
+glade_gtk_container_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GladeCreateReason reason)
+{
+ GList *children;
+ g_return_if_fail (GTK_IS_CONTAINER (container));
+
+ if (reason == GLADE_CREATE_USER)
+ {
+ if ((children = gtk_container_get_children (GTK_CONTAINER (container))) == NULL)
+ gtk_container_add (GTK_CONTAINER (container), glade_placeholder_new ());
+ else
+ g_list_free (children);
+ }
+}
+
+void GLADEGTK_API
+glade_gtk_container_replace_child (GladeWidgetAdaptor *adaptor,
+ GtkWidget *container,
+ GtkWidget *current,
+ GtkWidget *new_widget)
+{
+ GParamSpec **param_spec;
+ GValue *value;
+ guint nproperties;
+ guint i;
+
+ if (current->parent != container)
+ return;
+
+ param_spec = gtk_container_class_list_child_properties
+ (G_OBJECT_GET_CLASS (container), &nproperties);
+ value = g_malloc0 (sizeof(GValue) * nproperties);
+
+ for (i = 0; i < nproperties; i++) {
+ g_value_init (&value[i], param_spec[i]->value_type);
+ gtk_container_child_get_property
+ (GTK_CONTAINER (container), current, param_spec[i]->name, &value[i]);
+ }
+
+ gtk_container_remove (GTK_CONTAINER (container), current);
+ gtk_container_add (GTK_CONTAINER (container), new_widget);
+
+ for (i = 0; i < nproperties; i++) {
+ gtk_container_child_set_property
+ (GTK_CONTAINER (container), new_widget, param_spec[i]->name, &value[i]);
+ }
+
+ for (i = 0; i < nproperties; i++)
+ g_value_unset (&value[i]);
+
+ g_free (param_spec);
+ g_free (value);
+}
+
+void GLADEGTK_API
+glade_gtk_container_add_child (GladeWidgetAdaptor *adaptor,
+ GtkWidget *container,
+ GtkWidget *child)
+{
+ /* Get a placeholder out of the way before adding the child if its a GtkBin
+ */
+ if (GTK_IS_BIN (container) && GTK_BIN (container)->child != NULL &&
+ GLADE_IS_PLACEHOLDER (GTK_BIN (container)->child))
+ gtk_container_remove (GTK_CONTAINER (container), GTK_BIN (container)->child);
+
+ gtk_container_add (GTK_CONTAINER (container), child);
+}
+
+void GLADEGTK_API
+glade_gtk_container_remove_child (GladeWidgetAdaptor *adaptor,
+ GtkWidget *container,
+ GtkWidget *child)
+{
+ gtk_container_remove (GTK_CONTAINER (container), child);
+
+ /* If this is the last one, add a placeholder by default.
+ */
+ if (gtk_container_get_children (GTK_CONTAINER (container)) == NULL)
+ gtk_container_add (GTK_CONTAINER (container), glade_placeholder_new ());
+}
+
+void GLADEGTK_API
+glade_gtk_container_set_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ const GValue *value)
+{
+ gtk_container_child_set_property (GTK_CONTAINER (container),
+ GTK_WIDGET (child),
+ property_name, value);
+}
+
+void GLADEGTK_API
+glade_gtk_container_get_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ gtk_container_child_get_property (GTK_CONTAINER (container),
+ GTK_WIDGET (child),
+ property_name, value);
+}
+
+
+GList * GLADEGTK_API
+glade_gtk_container_get_children (GladeWidgetAdaptor *adaptor,
+ GtkContainer *container)
+{
+ return glade_util_container_get_all_children (container);
+}
+
+/* ----------------------------- GtkBox ------------------------------ */
+typedef struct {
+ GtkWidget *widget;
+ gint position;
+} GladeGtkBoxChild;
+
+static GList *glade_gtk_box_original_positions = NULL;
+
+static gboolean
+glade_gtk_box_configure_child (GladeFixed *fixed,
+ GladeWidget *child,
+ GdkRectangle *rect,
+ GtkWidget *box)
+{
+ GList *list;
+ GtkBoxChild *bchild;
+ gint point, trans_point, span,
+ iter_span, position, old_position,
+ offset, orig_offset;
+ gboolean found = FALSE;
+
+ if (GTK_IS_HBOX (box) || GTK_IS_HBUTTON_BOX (box))
+ {
+ point = fixed->mouse_x;
+ span = GTK_WIDGET (child->object)->allocation.width;
+ offset = rect->x;
+ orig_offset = fixed->child_x_origin;
+ }
+ else
+ {
+ point = fixed->mouse_y;
+ span = GTK_WIDGET (child->object)->allocation.height;
+ offset = rect->y;
+ orig_offset = fixed->child_y_origin;
+ }
+
+ glade_widget_pack_property_get
+ (child, "position", &old_position);
+
+ for (list = GTK_BOX (box)->children; list; list = list->next)
+ {
+ bchild = list->data;
+
+ if (bchild->widget == GTK_WIDGET (child->object))
+ continue;
+
+ /* Find the widget in the box where the center of
+ * this rectangle fits... and set the position to that
+ * position.
+ */
+
+ if (GTK_IS_HBOX (box) || GTK_IS_HBUTTON_BOX (box))
+ {
+ gtk_widget_translate_coordinates
+ (GTK_WIDGET (box), bchild->widget,
+ point, 0, &trans_point, NULL);
+
+ iter_span = bchild->widget->allocation.width;
+ }
+ else
+ {
+ gtk_widget_translate_coordinates
+ (GTK_WIDGET (box), bchild->widget,
+ 0, point, NULL, &trans_point);
+ iter_span = bchild->widget->allocation.height;
+ }
+
+#if 0
+ gtk_container_child_get (GTK_CONTAINER (box),
+ bchild->widget,
+ "position", &position, NULL);
+ g_print ("widget: %p pos %d, point %d, trans_point %d, iter_span %d\n",
+ bchild->widget, position, point, trans_point, iter_span);
+#endif
+
+ if (iter_span <= span)
+ {
+ found = trans_point >= 0 && trans_point < iter_span;
+ }
+ else
+ {
+ if (offset > orig_offset)
+ found = trans_point >= iter_span - span &&
+ trans_point < iter_span;
+ else if (offset < orig_offset)
+ found = trans_point >= 0 &&
+ trans_point < span;
+ }
+
+ if (found)
+ {
+ gtk_container_child_get (GTK_CONTAINER (box),
+ bchild->widget,
+ "position", &position, NULL);
+
+#if 0
+ g_print ("setting position of %s from %d to %d, "
+ "(point %d iter_span %d)\n",
+ child->name, old_position, position, trans_point, iter_span);
+#endif
+
+ glade_widget_pack_property_set
+ (child, "position", position);
+
+ break;
+ }
+
+ }
+ return TRUE;
+}
+
+static gboolean
+glade_gtk_box_configure_begin (GladeFixed *fixed,
+ GladeWidget *child,
+ GtkWidget *box)
+{
+ GList *list;
+ GtkBoxChild *bchild;
+
+ g_assert (glade_gtk_box_original_positions == NULL);
+
+ for (list = GTK_BOX (box)->children; list; list = list->next)
+ {
+ GladeGtkBoxChild *gbchild;
+ GladeWidget *gchild;
+
+ bchild = list->data;
+ if ((gchild = glade_widget_get_from_gobject (bchild->widget)) == NULL)
+ continue;
+
+ gbchild = g_new0 (GladeGtkBoxChild, 1);
+ gbchild->widget = bchild->widget;
+ glade_widget_pack_property_get (gchild, "position",
+ &gbchild->position);
+
+ glade_gtk_box_original_positions =
+ g_list_prepend (glade_gtk_box_original_positions, gbchild);
+ }
+
+ return TRUE;
+}
+
+static gboolean
+glade_gtk_box_configure_end (GladeFixed *fixed,
+ GladeWidget *child,
+ GtkWidget *box)
+{
+ GList *list, *l;
+ GList *prop_list = NULL;
+
+ for (list = GTK_BOX (box)->children; list; list = list->next)
+ {
+ GtkBoxChild *bchild = list->data;
+
+ for (l = glade_gtk_box_original_positions; l; l = l->next)
+ {
+ GladeGtkBoxChild *gbchild = l->data;
+ GladeWidget *gchild =
+ glade_widget_get_from_gobject (gbchild->widget);
+
+
+ if (bchild->widget == gbchild->widget)
+ {
+ GCSetPropData *prop_data = g_new0 (GCSetPropData, 1);
+ prop_data->property =
+ glade_widget_get_pack_property
+ (gchild, "position");
+
+ prop_data->old_value = g_new0 (GValue, 1);
+ prop_data->new_value = g_new0 (GValue, 1);
+
+ glade_property_get_value (prop_data->property,
+ prop_data->new_value);
+
+ g_value_init (prop_data->old_value, G_TYPE_INT);
+ g_value_set_int (prop_data->old_value, gbchild->position);
+
+ prop_list = g_list_prepend (prop_list, prop_data);
+ break;
+ }
+ }
+ }
+
+ glade_command_push_group (_("Ordering children of %s"),
+ GLADE_WIDGET (fixed)->name);
+ glade_property_push_superuser ();
+ if (prop_list)
+ glade_command_set_properties_list (GLADE_WIDGET (fixed)->project,
+ prop_list);
+ glade_property_pop_superuser ();
+ glade_command_pop_group ();
+
+ for (l = glade_gtk_box_original_positions; l; l = l->next)
+ g_free (l->data);
+
+ glade_gtk_box_original_positions =
+ (g_list_free (glade_gtk_box_original_positions), NULL);
+
+
+ return TRUE;
+}
+
+void GLADEGTK_API
+glade_gtk_box_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GladeCreateReason reason)
+{
+ GladeWidget *gwidget =
+ glade_widget_get_from_gobject (container);
+
+ /* Implement drag in GtkBox but not resize.
+ */
+ g_object_set (gwidget,
+ "can-resize", FALSE,
+ "use-placeholders", TRUE,
+ NULL);
+
+ g_signal_connect (G_OBJECT (gwidget), "configure-child",
+ G_CALLBACK (glade_gtk_box_configure_child), container);
+
+ g_signal_connect (G_OBJECT (gwidget), "configure-begin",
+ G_CALLBACK (glade_gtk_box_configure_begin), container);
+
+ g_signal_connect (G_OBJECT (gwidget), "configure-end",
+ G_CALLBACK (glade_gtk_box_configure_end), container);
+
+}
+
+static gint
+sort_box_children (GtkWidget *widget_a, GtkWidget *widget_b)
+{
+ GtkWidget *box;
+ GladeWidget *gwidget_a, *gwidget_b;
+ gint position_a, position_b;
+
+ gwidget_a = glade_widget_get_from_gobject (widget_a);
+ gwidget_b = glade_widget_get_from_gobject (widget_b);
+
+ box = gtk_widget_get_parent (widget_a);
+
+ if (gwidget_a)
+ glade_widget_pack_property_get
+ (gwidget_a, "position", &position_a);
+ else
+ gtk_container_child_get (GTK_CONTAINER (box),
+ widget_a,
+ "position", &position_a,
+ NULL);
+
+ if (gwidget_b)
+ glade_widget_pack_property_get
+ (gwidget_b, "position", &position_b);
+ else
+ gtk_container_child_get (GTK_CONTAINER (box),
+ widget_b,
+ "position", &position_b,
+ NULL);
+ return position_a - position_b;
+}
+
+void GLADEGTK_API
+glade_gtk_box_set_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ GladeWidget *gbox, *gchild, *gchild_iter;
+ GList *children, *list;
+ gboolean is_position;
+ gint old_position, iter_position, new_position;
+ static gboolean recursion = FALSE;
+
+ g_return_if_fail (GTK_IS_BOX (container));
+ g_return_if_fail (GTK_IS_WIDGET (child));
+ g_return_if_fail (property_name != NULL || value != NULL);
+
+ gbox = glade_widget_get_from_gobject (container);
+ gchild = glade_widget_get_from_gobject (child);
+
+ g_return_if_fail (GLADE_IS_WIDGET (gbox));
+
+ /* Get old position */
+ if ((is_position = (strcmp (property_name, "position") == 0)) != FALSE)
+ {
+ gtk_container_child_get (GTK_CONTAINER (container),
+ GTK_WIDGET (child),
+ property_name, &old_position, NULL);
+
+
+ /* Get the real value */
+ new_position = g_value_get_int (value);
+
+ }
+
+ if (is_position && recursion == FALSE)
+ {
+ children = glade_widget_adaptor_get_children
+ (gbox->adaptor, container);
+
+ children = g_list_sort (children, (GCompareFunc)sort_box_children);
+
+ for (list = children; list; list = list->next)
+ {
+ if ((gchild_iter =
+ glade_widget_get_from_gobject (list->data)) == NULL)
+ continue;
+
+ if (gchild_iter == gchild)
+ {
+ gtk_box_reorder_child (GTK_BOX (container),
+ GTK_WIDGET (child),
+ new_position);
+ continue;
+ }
+
+ /* Get the old value from glade */
+ glade_widget_pack_property_get
+ (gchild_iter, "position", &iter_position);
+
+ /* Search for the child at the old position and update it */
+ if (iter_position == new_position &&
+ glade_property_superuser () == FALSE)
+ {
+ /* Update glade with the real value */
+ recursion = TRUE;
+ glade_widget_pack_property_set
+ (gchild_iter, "position", old_position);
+ recursion = FALSE;
+ continue;
+ }
+ else
+ {
+ gtk_box_reorder_child (GTK_BOX (container),
+ GTK_WIDGET (list->data),
+ iter_position);
+ }
+ }
+
+ for (list = children; list; list = list->next)
+ {
+ if ((gchild_iter =
+ glade_widget_get_from_gobject (list->data)) == NULL)
+ continue;
+
+ /* Refresh values yet again */
+ glade_widget_pack_property_get
+ (gchild_iter, "position", &iter_position);
+
+ gtk_box_reorder_child (GTK_BOX (container),
+ GTK_WIDGET (list->data),
+ iter_position);
+
+ }
+
+ if (children)
+ g_list_free (children);
+ }
+
+ /* Chain Up */
+ if (is_position == FALSE)
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->child_set_property (adaptor,
+ container,
+ child,
+ property_name,
+ value);
+
+ gtk_container_check_resize (GTK_CONTAINER (container));
+
+}
+
+
+void GLADEGTK_API
+glade_gtk_box_get_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ GValue *value)
+{
+ if (!strcmp (id, "size"))
+ {
+ GtkBox *box = GTK_BOX (object);
+
+ g_value_reset (value);
+ g_value_set_int (value, g_list_length (box->children));
+ }
+ else
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->get_property (adaptor, object, id, value);
+}
+
+static gint
+glade_gtk_box_get_first_blank (GtkBox *box)
+{
+ GList *child;
+ GladeWidget *gwidget;
+ gint position;
+
+ for (child = box->children, position = 0;
+ child && child->data;
+ child = child->next, position++)
+ {
+ GtkWidget *widget = ((GtkBoxChild *) (child->data))->widget;
+
+ if ((gwidget = glade_widget_get_from_gobject (widget)) != NULL)
+ {
+ gint gwidget_position;
+ GladeProperty *property =
+ glade_widget_get_property (gwidget, "position");
+ gwidget_position = g_value_get_int (property->value);
+
+ if (gwidget_position > position)
+ return position;
+ }
+ }
+ return position;
+}
+
+static void
+glade_gtk_box_set_size (GObject *object, const GValue *value)
+{
+ GtkBox *box;
+ GList *child;
+ guint new_size, old_size, i;
+
+ box = GTK_BOX (object);
+ g_return_if_fail (GTK_IS_BOX (box));
+
+ old_size = g_list_length (box->children);
+ new_size = g_value_get_int (value);
+
+ if (old_size == new_size)
+ return;
+
+ /* Ensure placeholders first...
+ */
+ for (i = 0; i < new_size; i++)
+ {
+ if (g_list_length(box->children) < (i + 1))
+ {
+ GtkWidget *placeholder = glade_placeholder_new ();
+ gint blank = glade_gtk_box_get_first_blank (box);
+
+ gtk_container_add (GTK_CONTAINER (box), placeholder);
+ gtk_box_reorder_child (box, placeholder, blank);
+ }
+ }
+
+ /* The box has shrunk. Remove the widgets that are on those slots */
+ for (child = g_list_last (box->children);
+ child && old_size > new_size;
+ child = g_list_last (box->children), old_size--)
+ {
+ GtkWidget *child_widget = ((GtkBoxChild *) (child->data))->widget;
+
+ /* Refuse to remove any widgets that are either GladeWidget objects
+ * or internal to the hierarchic entity (may be a composite widget,
+ * not all internal widgets have GladeWidgets).
+ */
+ if (glade_widget_get_from_gobject (child_widget) ||
+ GLADE_IS_PLACEHOLDER (child_widget) == FALSE)
+ break;
+
+ g_object_ref (G_OBJECT (child_widget));
+ gtk_container_remove (GTK_CONTAINER (box), child_widget);
+ gtk_widget_destroy (child_widget);
+ }
+}
+
+void GLADEGTK_API
+glade_gtk_box_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "size"))
+ glade_gtk_box_set_size (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor, object, id, value);
+}
+
+static gboolean
+glade_gtk_box_verify_size (GObject *object, const GValue *value)
+{
+ GtkBox *box = GTK_BOX(object);
+ GList *child;
+ gint old_size = g_list_length (box->children);
+ gint new_size = g_value_get_int (value);
+
+ for (child = g_list_last (box->children);
+ child && old_size > new_size;
+ child = g_list_previous (child), old_size--)
+ {
+ GtkWidget *widget = ((GtkBoxChild *) (child->data))->widget;
+ if (glade_widget_get_from_gobject (widget) != NULL)
+ /* In this case, refuse to shrink */
+ return FALSE;
+ }
+ return new_size >= 0;
+}
+
+
+gboolean GLADEGTK_API
+glade_gtk_box_verify_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "size"))
+ return glade_gtk_box_verify_size (object, value);
+ else if (GWA_GET_CLASS (GTK_TYPE_CONTAINER)->verify_property)
+ return GWA_GET_CLASS (GTK_TYPE_CONTAINER)->verify_property (adaptor, object,
+ id, value);
+
+ return TRUE;
+}
+
+void GLADEGTK_API
+glade_gtk_box_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ GladeWidget *gbox, *gchild;
+ GladeProject *project;
+ gint num_children;
+
+ g_return_if_fail (GTK_IS_BOX (object));
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ gbox = glade_widget_get_from_gobject (object);
+ project = glade_widget_get_project (gbox);
+
+ /*
+ Try to remove the last placeholder if any, this way GtkBox`s size
+ will not be changed.
+ */
+ if (glade_widget_superuser () == FALSE &&
+ !GLADE_IS_PLACEHOLDER (child))
+ {
+ GList *l;
+ GtkBox *box = GTK_BOX (object);
+
+ for (l = g_list_last (box->children); l; l = g_list_previous (l))
+ {
+ GtkWidget *child_widget = ((GtkBoxChild *) (l->data))->widget;
+ if (GLADE_IS_PLACEHOLDER (child_widget))
+ {
+ gtk_container_remove (GTK_CONTAINER (box), child_widget);
+ break;
+ }
+ }
+ }
+
+ gtk_container_add (GTK_CONTAINER (object), GTK_WIDGET (child));
+
+ num_children = g_list_length (GTK_BOX (object)->children);
+ glade_widget_property_set (gbox, "size", num_children);
+
+ gchild = glade_widget_get_from_gobject (child);
+
+ /* Packing props arent around when parenting during a glade_widget_dup() */
+ if (gchild && gchild->packing_properties)
+ glade_widget_pack_property_set (gchild, "position", num_children - 1);
+}
+
+GObject * GLADEGTK_API
+glade_gtk_box_get_internal_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *name)
+{
+ GList *children, *l;
+ GObject *child = NULL;
+
+ g_return_val_if_fail (GTK_IS_BOX (object), NULL);
+
+ children = l = gtk_container_get_children (GTK_CONTAINER (object));
+
+ while (l)
+ {
+ GladeWidget *gw = glade_widget_get_from_gobject (l->data);
+
+ if (gw && gw->internal && strcmp (gw->internal, name) == 0)
+ {
+ child = G_OBJECT (l->data);
+ break;
+ }
+
+ l= l->next;
+ }
+ g_list_free (children);
+
+ return child;
+}
+
+void GLADEGTK_API
+glade_gtk_box_remove_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ GladeWidget *gbox;
+ gint size;
+
+ g_return_if_fail (GTK_IS_BOX (object));
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ gbox = glade_widget_get_from_gobject (object);
+
+ gtk_container_remove (GTK_CONTAINER (object), GTK_WIDGET (child));
+
+ if (glade_widget_superuser () == FALSE)
+ {
+ glade_widget_property_get (gbox, "size", &size);
+ glade_widget_property_set (gbox, "size", size);
+ }
+}
+
+
+/* ----------------------------- GtkTable ------------------------------ */
+typedef struct {
+ /* comparable part: */
+ GladeWidget *widget;
+ gint left_attach;
+ gint right_attach;
+ gint top_attach;
+ gint bottom_attach;
+} GladeGtkTableChild;
+
+typedef enum {
+ DIR_UP,
+ DIR_DOWN,
+ DIR_LEFT,
+ DIR_RIGHT
+} GladeTableDir;
+
+#define TABLE_CHILD_CMP_SIZE (sizeof (GladeWidget *) + (sizeof (gint) * 4))
+
+static GladeGtkTableChild table_edit = { 0, };
+static GladeGtkTableChild table_cur_attach = { 0, };
+
+
+/* Takes a point (x or y depending on 'row') relative to
+ * table, and returns the row or column in which the point
+ * was found.
+ */
+static gint
+glade_gtk_table_get_row_col_from_point (GtkTable *table,
+ gboolean row,
+ gint point)
+{
+ GtkTableChild *tchild;
+ GList *list;
+ gint span, trans_point, size, base, end;
+
+ for (list = table->children; list; list = list->next)
+ {
+ tchild = list->data;
+
+ if (row)
+ gtk_widget_translate_coordinates
+ (GTK_WIDGET (table), tchild->widget,
+ 0, point, NULL, &trans_point);
+ else
+ gtk_widget_translate_coordinates
+ (GTK_WIDGET (table), tchild->widget,
+ point, 0, &trans_point, NULL);
+
+ /* Find any widget in our row/column
+ */
+ end = row ?
+ tchild->widget->allocation.height :
+ tchild->widget->allocation.width;
+
+ if (trans_point >= 0 &&
+ /* should be trans_point < end ... test FIXME ! */
+ trans_point < end)
+ {
+ base = row ? tchild->top_attach : tchild->left_attach;
+ size = row ? (tchild->widget->allocation.height) :
+ (tchild->widget->allocation.width);
+ span = row ? (tchild->bottom_attach - tchild->top_attach) :
+ (tchild->right_attach - tchild->left_attach);
+
+ return base + (trans_point * span / size);
+ }
+ }
+
+ return -1;
+}
+
+
+static gboolean
+glade_gtk_table_point_crosses_threshold (GtkTable *table,
+ gboolean row,
+ gint num,
+ GladeTableDir dir,
+ gint point)
+{
+
+ GtkTableChild *tchild;
+ GList *list;
+ gint span, trans_point, size, rowcol_size, base;
+
+ for (list = table->children; list; list = list->next)
+ {
+ tchild = list->data;
+
+ /* Find any widget in our row/column
+ */
+ if ((row && num >= tchild->top_attach && num < tchild->bottom_attach) ||
+ (!row && num >= tchild->left_attach && num < tchild->right_attach))
+ {
+
+ if (row)
+ gtk_widget_translate_coordinates
+ (GTK_WIDGET (table), tchild->widget,
+ 0, point, NULL, &trans_point);
+ else
+ gtk_widget_translate_coordinates
+ (GTK_WIDGET (table), tchild->widget,
+ point, 0, &trans_point, NULL);
+
+ span = row ? (tchild->bottom_attach - tchild->top_attach) :
+ (tchild->right_attach - tchild->left_attach);
+ size = row ? (tchild->widget->allocation.height) :
+ (tchild->widget->allocation.width);
+
+ base = row ? tchild->top_attach : tchild->left_attach;
+ rowcol_size = size / span;
+ trans_point -= (num - base) * rowcol_size;
+
+#if 0
+ g_print ("dir: %s, widget size: %d, rowcol size: %d, "
+ "requested rowcol: %d, widget base rowcol: %d, trim: %d, "
+ "widget point: %d, thresh: %d\n",
+ dir == DIR_UP ? "up" : dir == DIR_DOWN ? "down" :
+ dir == DIR_LEFT ? "left" : "right",
+ size, rowcol_size, num, base, (num - base) * rowcol_size,
+ trans_point,
+ dir == DIR_UP || dir == DIR_LEFT ?
+ (rowcol_size / 2) :
+ (rowcol_size / 2));
+#endif
+ switch (dir)
+ {
+ case DIR_UP:
+ case DIR_LEFT:
+ return trans_point <= (rowcol_size / 2);
+ case DIR_DOWN:
+ case DIR_RIGHT:
+ return trans_point >= (rowcol_size / 2);
+ default:
+ break;
+ }
+ }
+
+ }
+ return FALSE;
+}
+
+static gboolean
+glade_gtk_table_get_attachments (GladeFixed *fixed,
+ GtkTable *table,
+ GdkRectangle *rect,
+ GladeGtkTableChild *configure)
+{
+ gint center_x, center_y, row, column;
+ center_x = rect->x + (rect->width / 2);
+ center_y = rect->y + (rect->height / 2);
+
+ column = glade_gtk_table_get_row_col_from_point
+ (table, FALSE, center_x);
+
+ row = glade_gtk_table_get_row_col_from_point
+ (table, TRUE, center_y);
+
+ /* its a start, now try to grow when the rect extents
+ * reach at least half way into the next row/column
+ */
+ configure->left_attach = column;
+ configure->right_attach = column + 1;
+ configure->top_attach = row;
+ configure->bottom_attach = row +1;
+
+ if (column >= 0 && row >= 0)
+ {
+
+ /* Check and expand left
+ */
+ while (configure->left_attach > 0)
+ {
+ if (rect->x < fixed->child_x_origin &&
+ fixed->operation != GLADE_CURSOR_DRAG &&
+ GLADE_FIXED_CURSOR_LEFT (fixed->operation) == FALSE)
+ break;
+
+ if (glade_gtk_table_point_crosses_threshold
+ (table, FALSE, configure->left_attach -1,
+ DIR_LEFT, rect->x) == FALSE)
+ break;
+
+ configure->left_attach--;
+ }
+
+ /* Check and expand right
+ */
+ while (configure->right_attach < (table->ncols))
+ {
+ if (rect->x + rect->width >
+ fixed->child_x_origin + fixed->child_width_origin &&
+ fixed->operation != GLADE_CURSOR_DRAG &&
+ GLADE_FIXED_CURSOR_RIGHT (fixed->operation) == FALSE)
+ break;
+
+ if (glade_gtk_table_point_crosses_threshold
+ (table, FALSE, configure->right_attach,
+ DIR_RIGHT, rect->x + rect->width) == FALSE)
+ break;
+
+ configure->right_attach++;
+ }
+
+ /* Check and expand top
+ */
+ while (configure->top_attach > 0)
+ {
+ if (rect->y < fixed->child_y_origin &&
+ fixed->operation != GLADE_CURSOR_DRAG &&
+ GLADE_FIXED_CURSOR_TOP (fixed->operation) == FALSE)
+ break;
+
+ if (glade_gtk_table_point_crosses_threshold
+ (table, TRUE, configure->top_attach -1,
+ DIR_UP, rect->y) == FALSE)
+ break;
+
+ configure->top_attach--;
+ }
+
+ /* Check and expand bottom
+ */
+ while (configure->bottom_attach < (table->nrows))
+ {
+ if (rect->y + rect->height >
+ fixed->child_y_origin + fixed->child_height_origin &&
+ fixed->operation != GLADE_CURSOR_DRAG &&
+ GLADE_FIXED_CURSOR_BOTTOM (fixed->operation) == FALSE)
+ break;
+
+ if (glade_gtk_table_point_crosses_threshold
+ (table, TRUE, configure->bottom_attach,
+ DIR_DOWN, rect->y + rect->height) == FALSE)
+ break;
+
+ configure->bottom_attach++;
+ }
+ }
+
+ /* Keep the same row/col span when performing a drag
+ */
+ if (fixed->operation == GLADE_CURSOR_DRAG)
+ {
+ gint col_span = table_edit.right_attach - table_edit.left_attach;
+ gint row_span = table_edit.bottom_attach - table_edit.top_attach;
+
+ if (rect->x < fixed->child_x_origin)
+ configure->right_attach = configure->left_attach + col_span;
+ else
+ configure->left_attach = configure->right_attach - col_span;
+
+ if (rect->y < fixed->child_y_origin)
+ configure->bottom_attach = configure->top_attach + row_span;
+ else
+ configure->top_attach = configure->bottom_attach - row_span;
+ } else if (fixed->operation == GLADE_CURSOR_RESIZE_RIGHT) {
+ configure->left_attach = table_edit.left_attach;
+ configure->top_attach = table_edit.top_attach;
+ configure->bottom_attach = table_edit.bottom_attach;
+ } else if (fixed->operation == GLADE_CURSOR_RESIZE_LEFT) {
+ configure->right_attach = table_edit.right_attach;
+ configure->top_attach = table_edit.top_attach;
+ configure->bottom_attach = table_edit.bottom_attach;
+ } else if (fixed->operation == GLADE_CURSOR_RESIZE_TOP) {
+ configure->left_attach = table_edit.left_attach;
+ configure->right_attach = table_edit.right_attach;
+ configure->bottom_attach = table_edit.bottom_attach;
+ } else if (fixed->operation == GLADE_CURSOR_RESIZE_BOTTOM) {
+ configure->left_attach = table_edit.left_attach;
+ configure->right_attach = table_edit.right_attach;
+ configure->top_attach = table_edit.top_attach;
+ }
+
+ return column >= 0 && row >= 0;
+}
+
+static gboolean
+glade_gtk_table_configure_child (GladeFixed *fixed,
+ GladeWidget *child,
+ GdkRectangle *rect,
+ GtkWidget *table)
+{
+ GladeGtkTableChild configure = { child, };
+
+ /* Sometimes we are unable to find a widget in the appropriate column,
+ * usually because a placeholder hasnt had its size allocation yet.
+ */
+ if (glade_gtk_table_get_attachments (fixed, GTK_TABLE (table), rect, &configure))
+ {
+ if (memcmp (&configure, &table_cur_attach, TABLE_CHILD_CMP_SIZE) != 0)
+ {
+
+ glade_property_push_superuser ();
+ glade_widget_pack_property_set (child, "left-attach",
+ configure.left_attach);
+ glade_widget_pack_property_set (child, "right-attach",
+ configure.right_attach);
+ glade_widget_pack_property_set (child, "top-attach",
+ configure.top_attach);
+ glade_widget_pack_property_set (child, "bottom-attach",
+ configure.bottom_attach);
+ glade_property_pop_superuser ();
+
+ memcpy (&table_cur_attach, &configure, TABLE_CHILD_CMP_SIZE);
+ }
+ }
+ return TRUE;
+}
+
+
+static gboolean
+glade_gtk_table_configure_begin (GladeFixed *fixed,
+ GladeWidget *child,
+ GtkWidget *table)
+{
+
+ table_edit.widget = child;
+
+ glade_widget_pack_property_get (child, "left-attach",
+ &table_edit.left_attach);
+ glade_widget_pack_property_get (child, "right-attach",
+ &table_edit.right_attach);
+ glade_widget_pack_property_get (child, "top-attach",
+ &table_edit.top_attach);
+ glade_widget_pack_property_get (child, "bottom-attach",
+ &table_edit.bottom_attach);
+
+ memcpy (&table_cur_attach, &table_edit, TABLE_CHILD_CMP_SIZE);
+
+ return TRUE;
+}
+
+static gboolean
+glade_gtk_table_configure_end (GladeFixed *fixed,
+ GladeWidget *child,
+ GtkWidget *table)
+{
+ GladeGtkTableChild new_child = { child, };
+
+ glade_widget_pack_property_get (child, "left-attach",
+ &new_child.left_attach);
+ glade_widget_pack_property_get (child, "right-attach",
+ &new_child.right_attach);
+ glade_widget_pack_property_get (child, "top-attach",
+ &new_child.top_attach);
+ glade_widget_pack_property_get (child, "bottom-attach",
+ &new_child.bottom_attach);
+
+ /* Compare the meaningfull part of the current edit. */
+ if (memcmp (&new_child, &table_edit, TABLE_CHILD_CMP_SIZE) != 0)
+ {
+ GValue left_attach_value = { 0, };
+ GValue right_attach_value = { 0, };
+ GValue top_attach_value = { 0, };
+ GValue bottom_attach_value = { 0, };
+
+ GValue new_left_attach_value = { 0, };
+ GValue new_right_attach_value = { 0, };
+ GValue new_top_attach_value = { 0, };
+ GValue new_bottom_attach_value = { 0, };
+
+ GladeProperty *left_attach_prop, *right_attach_prop,
+ *top_attach_prop, *bottom_attach_prop;
+
+ left_attach_prop = glade_widget_get_pack_property (child, "left-attach");
+ right_attach_prop = glade_widget_get_pack_property (child, "right-attach");
+ top_attach_prop = glade_widget_get_pack_property (child, "top-attach");
+ bottom_attach_prop = glade_widget_get_pack_property (child, "bottom-attach");
+
+ g_return_val_if_fail (GLADE_IS_PROPERTY (left_attach_prop), FALSE);
+ g_return_val_if_fail (GLADE_IS_PROPERTY (right_attach_prop), FALSE);
+ g_return_val_if_fail (GLADE_IS_PROPERTY (top_attach_prop), FALSE);
+ g_return_val_if_fail (GLADE_IS_PROPERTY (bottom_attach_prop), FALSE);
+
+ glade_property_get_value (left_attach_prop, &new_left_attach_value);
+ glade_property_get_value (right_attach_prop, &new_right_attach_value);
+ glade_property_get_value (top_attach_prop, &new_top_attach_value);
+ glade_property_get_value (bottom_attach_prop, &new_bottom_attach_value);
+
+ g_value_init (&left_attach_value, G_TYPE_UINT);
+ g_value_init (&right_attach_value, G_TYPE_UINT);
+ g_value_init (&top_attach_value, G_TYPE_UINT);
+ g_value_init (&bottom_attach_value, G_TYPE_UINT);
+
+ g_value_set_uint (&left_attach_value, table_edit.left_attach);
+ g_value_set_uint (&right_attach_value, table_edit.right_attach);
+ g_value_set_uint (&top_attach_value, table_edit.top_attach);
+ g_value_set_uint (&bottom_attach_value, table_edit.bottom_attach);
+
+ glade_command_push_group (_("Placing %s inside %s"),
+ child->name,
+ GLADE_WIDGET (fixed)->name);
+ glade_command_set_properties
+ (left_attach_prop, &left_attach_value, &new_left_attach_value,
+ right_attach_prop, &right_attach_value, &new_right_attach_value,
+ top_attach_prop, &top_attach_value, &new_top_attach_value,
+ bottom_attach_prop, &bottom_attach_value, &new_bottom_attach_value,
+ NULL);
+ glade_command_pop_group ();
+
+ g_value_unset (&left_attach_value);
+ g_value_unset (&right_attach_value);
+ g_value_unset (&top_attach_value);
+ g_value_unset (&bottom_attach_value);
+ g_value_unset (&new_left_attach_value);
+ g_value_unset (&new_right_attach_value);
+ g_value_unset (&new_top_attach_value);
+ g_value_unset (&new_bottom_attach_value);
+ }
+
+ return TRUE;
+}
+
+void GLADEGTK_API
+glade_gtk_table_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GladeCreateReason reason)
+{
+ GladeWidget *gwidget =
+ glade_widget_get_from_gobject (container);
+
+ g_object_set (gwidget, "use-placeholders", TRUE, NULL);
+
+ g_signal_connect (G_OBJECT (gwidget), "configure-child",
+ G_CALLBACK (glade_gtk_table_configure_child), container);
+
+ g_signal_connect (G_OBJECT (gwidget), "configure-begin",
+ G_CALLBACK (glade_gtk_table_configure_begin), container);
+
+ g_signal_connect (G_OBJECT (gwidget), "configure-end",
+ G_CALLBACK (glade_gtk_table_configure_end), container);
+}
+
+static gboolean
+glade_gtk_table_has_child (GtkTable *table, guint left_attach, guint top_attach)
+{
+ GList *list;
+
+ for (list = table->children; list && list->data; list = list->next)
+ {
+ GtkTableChild *child = list->data;
+
+ if (left_attach >= child->left_attach && left_attach < child->right_attach &&
+ top_attach >= child->top_attach && top_attach < child->bottom_attach)
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static gboolean
+glade_gtk_table_widget_exceeds_bounds (GtkTable *table, gint n_rows, gint n_cols)
+{
+ GList *list;
+ for (list = table->children; list && list->data; list = list->next)
+ {
+ GtkTableChild *child = list->data;
+ if (GLADE_IS_PLACEHOLDER(child->widget) == FALSE &&
+ (child->right_attach > n_cols ||
+ child->bottom_attach > n_rows))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static void
+glade_gtk_table_refresh_placeholders (GtkTable *table)
+{
+ GList *list, *toremove = NULL;
+ gint i, j;
+
+ for (list = table->children; list && list->data; list = list->next)
+ {
+ GtkTableChild *child = list->data;
+
+ if (GLADE_IS_PLACEHOLDER (child->widget))
+ toremove = g_list_prepend (toremove, child->widget);
+ }
+
+ if (toremove)
+ {
+ for (list = toremove; list; list = list->next)
+ gtk_container_remove (GTK_CONTAINER (table),
+ GTK_WIDGET (list->data));
+ g_list_free (toremove);
+ }
+
+ for (i = 0; i < table->ncols; i++)
+ for (j = 0; j < table->nrows; j++)
+ if (glade_gtk_table_has_child (table, i, j) == FALSE)
+ gtk_table_attach_defaults (table,
+ glade_placeholder_new (),
+ i, i + 1, j, j + 1);
+
+ gtk_container_check_resize (GTK_CONTAINER (table));
+}
+
+
+void GLADEGTK_API
+glade_gtk_table_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ g_return_if_fail (GTK_IS_TABLE (object));
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ gtk_container_add (GTK_CONTAINER (object), GTK_WIDGET (child));
+
+ glade_gtk_table_refresh_placeholders (GTK_TABLE (object));
+}
+
+void GLADEGTK_API
+glade_gtk_table_remove_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ g_return_if_fail (GTK_IS_TABLE (object));
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ gtk_container_remove (GTK_CONTAINER (object), GTK_WIDGET (child));
+
+ glade_gtk_table_refresh_placeholders (GTK_TABLE (object));
+}
+
+void GLADEGTK_API
+glade_gtk_table_replace_child (GladeWidgetAdaptor *adaptor,
+ GtkWidget *container,
+ GtkWidget *current,
+ GtkWidget *new_widget)
+{
+ g_return_if_fail (GTK_IS_TABLE (container));
+ g_return_if_fail (GTK_IS_WIDGET (current));
+ g_return_if_fail (GTK_IS_WIDGET (new_widget));
+
+ /* Chain Up */
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->replace_child (adaptor,
+ G_OBJECT (container),
+ G_OBJECT (current),
+ G_OBJECT (new_widget));
+
+ /* If we are replacing a GladeWidget, we must refresh placeholders
+ * because the widget may have spanned multiple rows/columns, we must
+ * not do so in the case we are pasting multiple widgets into a table,
+ * where destroying placeholders results in default packing properties
+ * (since the remaining placeholder templates no longer exist, only the
+ * first pasted widget would have proper packing properties).
+ */
+ if (glade_widget_get_from_gobject (new_widget) == FALSE)
+ glade_gtk_table_refresh_placeholders (GTK_TABLE (container));
+
+}
+
+static void
+glade_gtk_table_set_n_common (GObject *object, const GValue *value, gboolean for_rows)
+{
+ GladeWidget *widget;
+ GtkTable *table;
+ guint new_size, old_size;
+
+ table = GTK_TABLE (object);
+ g_return_if_fail (GTK_IS_TABLE (table));
+
+ new_size = g_value_get_uint (value);
+ old_size = for_rows ? table->nrows : table->ncols;
+
+ if (new_size < 1)
+ return;
+
+ if (glade_gtk_table_widget_exceeds_bounds
+ (table,
+ for_rows ? new_size : table->nrows,
+ for_rows ? table->ncols : new_size))
+ /* Refuse to shrink if it means orphaning widgets */
+ return;
+
+ widget = glade_widget_get_from_gobject (GTK_WIDGET (table));
+ g_return_if_fail (widget != NULL);
+
+ if (for_rows)
+ gtk_table_resize (table, new_size, table->ncols);
+ else
+ gtk_table_resize (table, table->nrows, new_size);
+
+ /* Fill table with placeholders */
+ glade_gtk_table_refresh_placeholders (table);
+
+ if (new_size < old_size)
+ {
+ /* Remove from the bottom up */
+ GList *list;
+ GList *list_to_free = NULL;
+
+ for (list = table->children; list && list->data; list = list->next)
+ {
+ GtkTableChild *child = list->data;
+ guint start = for_rows ? child->top_attach : child->left_attach;
+ guint end = for_rows ? child->bottom_attach : child->right_attach;
+
+ /* We need to completely remove it */
+ if (start >= new_size)
+ {
+ list_to_free = g_list_prepend (list_to_free, child->widget);
+ continue;
+ }
+
+ /* If the widget spans beyond the new border,
+ * we should resize it to fit on the new table */
+ if (end > new_size)
+ gtk_container_child_set
+ (GTK_CONTAINER (table), GTK_WIDGET (child),
+ for_rows ? "bottom_attach" : "right_attach",
+ new_size, NULL);
+ }
+
+ if (list_to_free)
+ {
+ for (list = g_list_first(list_to_free);
+ list && list->data;
+ list = list->next)
+ {
+ g_object_ref (G_OBJECT (list->data));
+ gtk_container_remove (GTK_CONTAINER (table),
+ GTK_WIDGET(list->data));
+ /* This placeholder is no longer valid, force destroy */
+ gtk_widget_destroy (GTK_WIDGET(list->data));
+ }
+ g_list_free (list_to_free);
+ }
+ gtk_table_resize (table,
+ for_rows ? new_size : table->nrows,
+ for_rows ? table->ncols : new_size);
+ }
+}
+
+void GLADEGTK_API
+glade_gtk_table_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "n-rows"))
+ glade_gtk_table_set_n_common (object, value, TRUE);
+ else if (!strcmp (id, "n-columns"))
+ glade_gtk_table_set_n_common (object, value, FALSE);
+ else
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor, object,
+ id, value);
+}
+
+static gboolean
+glade_gtk_table_verify_n_common (GObject *object, const GValue *value, gboolean for_rows)
+{
+ GtkTable *table = GTK_TABLE(object);
+ guint new_size = g_value_get_uint (value);
+
+ if (glade_gtk_table_widget_exceeds_bounds
+ (table,
+ for_rows ? new_size : table->nrows,
+ for_rows ? table->ncols : new_size))
+ /* Refuse to shrink if it means orphaning widgets */
+ return FALSE;
+
+ return TRUE;
+}
+
+gboolean GLADEGTK_API
+glade_gtk_table_verify_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "n-rows"))
+ return glade_gtk_table_verify_n_common (object, value, TRUE);
+ else if (!strcmp (id, "n-columns"))
+ return glade_gtk_table_verify_n_common (object, value, FALSE);
+ else if (GWA_GET_CLASS (GTK_TYPE_CONTAINER)->verify_property)
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->verify_property (adaptor, object,
+ id, value);
+
+ return TRUE;
+}
+
+void GLADEGTK_API
+glade_gtk_table_set_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ g_return_if_fail (GTK_IS_TABLE (container));
+ g_return_if_fail (GTK_IS_WIDGET (child));
+ g_return_if_fail (property_name != NULL && value != NULL);
+
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->child_set_property (adaptor,
+ container, child,
+ property_name, value);
+
+ if (strcmp (property_name, "bottom-attach") == 0 ||
+ strcmp (property_name, "left-attach") == 0 ||
+ strcmp (property_name, "right-attach") == 0 ||
+ strcmp (property_name, "top-attach") == 0)
+ {
+ /* Refresh placeholders */
+ glade_gtk_table_refresh_placeholders (GTK_TABLE (container));
+ }
+
+}
+
+static gboolean
+glade_gtk_table_verify_attach_common (GObject *object,
+ GValue *value,
+ guint *val,
+ const gchar *prop,
+ guint *prop_val,
+ const gchar *parent_prop,
+ guint *parent_val)
+{
+ GladeWidget *widget, *parent;
+
+ widget = glade_widget_get_from_gobject (object);
+ g_return_val_if_fail (GLADE_IS_WIDGET (widget), TRUE);
+ parent = glade_widget_get_parent (widget);
+ g_return_val_if_fail (GLADE_IS_WIDGET (parent), TRUE);
+
+ *val = g_value_get_uint (value);
+ glade_widget_property_get (widget, prop, prop_val);
+ glade_widget_property_get (parent, parent_prop, parent_val);
+
+ return FALSE;
+}
+
+static gboolean
+glade_gtk_table_verify_left_top_attach (GObject *object,
+ GValue *value,
+ const gchar *prop,
+ const gchar *parent_prop)
+{
+ guint val, prop_val, parent_val;
+
+ if (glade_gtk_table_verify_attach_common (object, value, &val,
+ prop, &prop_val,
+ parent_prop, &parent_val))
+ return FALSE;
+
+ if (val >= parent_val || val >= prop_val)
+ return FALSE;
+
+ return TRUE;
+}
+
+static gboolean
+glade_gtk_table_verify_right_bottom_attach (GObject *object,
+ GValue *value,
+ const gchar *prop,
+ const gchar *parent_prop)
+{
+ guint val, prop_val, parent_val;
+
+ if (glade_gtk_table_verify_attach_common (object, value, &val,
+ prop, &prop_val,
+ parent_prop, &parent_val))
+ return FALSE;
+
+ if (val <= prop_val || val > parent_val)
+ return FALSE;
+
+ return TRUE;
+}
+
+gboolean GLADEGTK_API
+glade_gtk_table_child_verify_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *id,
+ GValue *value)
+{
+ if (!strcmp (id, "left-attach"))
+ return glade_gtk_table_verify_left_top_attach (child,
+ value,
+ "right-attach",
+ "n-columns");
+ else if (!strcmp (id, "right-attach"))
+ return glade_gtk_table_verify_right_bottom_attach (child,
+ value,
+ "left-attach",
+ "n-columns");
+ else if (!strcmp (id, "top-attach"))
+ return glade_gtk_table_verify_left_top_attach (child,
+ value,
+ "bottom-attach",
+ "n-rows");
+ else if (!strcmp (id, "bottom-attach"))
+ return glade_gtk_table_verify_right_bottom_attach (child,
+ value,
+ "top-attach",
+ "n-rows");
+ else if (GWA_GET_CLASS (GTK_TYPE_CONTAINER)->child_verify_property)
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->child_verify_property (adaptor,
+ container, child,
+ id, value);
+
+ return TRUE;
+}
+
+/* ----------------------------- GtkFrame ------------------------------ */
+void GLADEGTK_API
+glade_gtk_frame_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *frame,
+ GladeCreateReason reason)
+{
+ static GladeWidgetAdaptor *label_adaptor = NULL, *alignment_adaptor = NULL;
+ GladeWidget *gframe, *glabel, *galignment;
+ GtkWidget *label;
+ gchar *label_text;
+
+ if (reason != GLADE_CREATE_USER)
+ return;
+
+ g_return_if_fail (GTK_IS_FRAME (frame));
+ gframe = glade_widget_get_from_gobject (frame);
+ g_return_if_fail (GLADE_IS_WIDGET (gframe));
+
+ /* If we didnt put this object here or if frame is an aspect frame... */
+ if (((label = gtk_frame_get_label_widget (GTK_FRAME (frame))) == NULL ||
+ (glade_widget_get_from_gobject (label) == NULL)) &&
+ (GTK_IS_ASPECT_FRAME (frame) == FALSE))
+ {
+
+ if (label_adaptor == NULL)
+ label_adaptor = glade_widget_adaptor_get_by_type (GTK_TYPE_LABEL);
+ if (alignment_adaptor == NULL)
+ alignment_adaptor = glade_widget_adaptor_get_by_type (GTK_TYPE_ALIGNMENT);
+
+ /* add label (as an internal child) */
+ glabel = glade_widget_adaptor_create_widget (label_adaptor, FALSE,
+ "parent", gframe,
+ "project", glade_widget_get_project (gframe),
+ NULL);
+
+ label_text = g_strdup_printf ("<b>%s</b>", glade_widget_get_name (gframe));
+
+ glade_widget_property_set (glabel, "label", label_text);
+ glade_widget_property_set (glabel, "use-markup", "TRUE");
+
+ g_object_set_data (glabel->object, "special-child-type", "label_item");
+ gtk_frame_set_label_widget (GTK_FRAME (frame), GTK_WIDGET (glabel->object));
+ gtk_widget_show (GTK_WIDGET (glabel->object));
+ g_free (label_text);
+
+ /* add alignment */
+ galignment = glade_widget_adaptor_create_widget (alignment_adaptor, FALSE,
+ "parent", gframe,
+ "project", glade_widget_get_project (gframe),
+ NULL);
+
+ glade_widget_property_set (galignment, "left-padding", 12);
+ gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (galignment->object));
+ gtk_widget_show (GTK_WIDGET (galignment->object));
+ }
+
+ /* Chain Up */
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->post_create (adaptor, frame, reason);
+}
+
+void GLADEGTK_API
+glade_gtk_frame_replace_child (GladeWidgetAdaptor *adaptor,
+ GtkWidget *container,
+ GtkWidget *current,
+ GtkWidget *new_widget)
+{
+ gchar *special_child_type;
+
+ special_child_type =
+ g_object_get_data (G_OBJECT (current), "special-child-type");
+
+ if (special_child_type && !strcmp (special_child_type, "label_item"))
+ {
+ g_object_set_data (G_OBJECT (new_widget), "special-child-type", "label_item");
+ gtk_frame_set_label_widget (GTK_FRAME (container), new_widget);
+ return;
+ }
+
+ /* Chain Up */
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->replace_child (adaptor,
+ G_OBJECT (container),
+ G_OBJECT (current),
+ G_OBJECT (new_widget));
+}
+
+void GLADEGTK_API
+glade_gtk_frame_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ gchar *special_child_type;
+
+ special_child_type = g_object_get_data (child, "special-child-type");
+
+ if (special_child_type &&
+ !strcmp (special_child_type, "label_item"))
+ {
+ gtk_frame_set_label_widget (GTK_FRAME (object),
+ GTK_WIDGET (child));
+ }
+ else
+ {
+ gtk_container_add (GTK_CONTAINER (object),
+ GTK_WIDGET (child));
+ }
+}
+
+/* ----------------------------- GtkNotebook ------------------------------ */
+typedef struct
+{
+ gint pages;
+
+ GList *children;
+ GList *tabs;
+
+ GList *extra_children;
+ GList *extra_tabs;
+} NotebookChildren;
+
+static gboolean glade_gtk_notebook_setting_position = FALSE;
+
+static gint
+notebook_child_compare_func (GtkWidget *widget_a, GtkWidget *widget_b)
+{
+ GladeWidget *gwidget_a, *gwidget_b;
+ gint pos_a = 0, pos_b = 0;
+
+ gwidget_a = glade_widget_get_from_gobject (widget_a);
+ gwidget_b = glade_widget_get_from_gobject (widget_b);
+
+ g_assert (gwidget_a && gwidget_b);
+
+ glade_widget_pack_property_get (gwidget_a, "position", &pos_a);
+ glade_widget_pack_property_get (gwidget_b, "position", &pos_b);
+
+ return pos_a - pos_b;
+}
+
+static gint
+notebook_find_child (GtkWidget *check,
+ gpointer cmp_pos_p)
+{
+ GladeWidget *gcheck;
+ gint position = 0, cmp_pos = GPOINTER_TO_INT (cmp_pos_p);
+
+ gcheck = glade_widget_get_from_gobject (check);
+ g_assert (gcheck);
+
+ glade_widget_pack_property_get (gcheck, "position", &position);
+
+ return position - cmp_pos;
+}
+
+static gint
+notebook_search_tab (GtkNotebook *notebook,
+ GtkWidget *tab)
+{
+ GtkWidget *page;
+ gint i;
+
+ for (i = 0; i < gtk_notebook_get_n_pages (notebook); i++)
+ {
+ page = gtk_notebook_get_nth_page (notebook, i);
+
+ if (tab == gtk_notebook_get_tab_label (notebook, page))
+ return i;
+ }
+ g_critical ("Unable to find tab position in a notebook");
+ return -1;
+}
+
+static GtkWidget *
+notebook_get_filler (NotebookChildren *nchildren, gboolean page)
+{
+ GtkWidget *widget = NULL;
+
+ if (page && nchildren->extra_children)
+ {
+ widget = nchildren->extra_children->data;
+ nchildren->extra_children =
+ g_list_remove (nchildren->extra_children, widget);
+ g_assert (widget);
+ }
+ else if (!page && nchildren->extra_tabs)
+ {
+ widget = nchildren->extra_tabs->data;
+ nchildren->extra_tabs =
+ g_list_remove (nchildren->extra_tabs, widget);
+ g_assert (widget);
+ }
+
+ if (widget == NULL)
+ {
+ /* Need explicit reference here */
+ widget = glade_placeholder_new ();
+
+ g_object_ref (G_OBJECT (widget));
+
+ if (!page)
+ g_object_set_data (G_OBJECT (widget),
+ "special-child-type", "tab");
+
+ }
+ return widget;
+}
+
+static GtkWidget *
+notebook_get_page (NotebookChildren *nchildren, gint position)
+{
+ GList *node;
+ GtkWidget *widget = NULL;
+
+ if ((node = g_list_find_custom
+ (nchildren->children,
+ GINT_TO_POINTER (position),
+ (GCompareFunc)notebook_find_child)) != NULL)
+ {
+ widget = node->data;
+ nchildren->children =
+ g_list_remove (nchildren->children, widget);
+ }
+ else
+ widget = notebook_get_filler (nchildren, TRUE);
+
+ return widget;
+}
+
+static GtkWidget *
+notebook_get_tab (NotebookChildren *nchildren, gint position)
+{
+ GList *node;
+ GtkWidget *widget = NULL;
+
+ if ((node = g_list_find_custom
+ (nchildren->tabs,
+ GINT_TO_POINTER (position),
+ (GCompareFunc)notebook_find_child)) != NULL)
+ {
+ widget = node->data;
+ nchildren->tabs =
+ g_list_remove (nchildren->tabs, widget);
+ }
+ else
+ widget = notebook_get_filler (nchildren, FALSE);
+
+ return widget;
+}
+
+static NotebookChildren *
+glade_gtk_notebook_extract_children (GtkWidget *notebook)
+{
+ NotebookChildren *nchildren;
+ gchar *special_child_type;
+ GList *list, *children =
+ glade_util_container_get_all_children (GTK_CONTAINER (notebook));
+ GladeWidget *gchild;
+ GtkWidget *page;
+ gint position = 0;
+
+ nchildren = g_new0 (NotebookChildren, 1);
+ nchildren->pages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook));
+
+ /* Ref all the project widgets and build returned list first */
+ for (list = children; list; list = list->next)
+ {
+ if ((gchild = glade_widget_get_from_gobject (list->data)) != NULL)
+ {
+ special_child_type =
+ g_object_get_data (G_OBJECT (list->data),
+ "special-child-type");
+
+ glade_widget_pack_property_get (gchild, "position", &position);
+
+ g_object_ref (G_OBJECT (list->data));
+
+ /* Sort it into the proper struct member
+ */
+ if (special_child_type == NULL)
+ {
+ if (g_list_find_custom (nchildren->children,
+ GINT_TO_POINTER (position),
+ (GCompareFunc)notebook_find_child))
+ nchildren->extra_children =
+ g_list_insert_sorted
+ (nchildren->extra_children, list->data,
+ (GCompareFunc)notebook_child_compare_func);
+ else
+ nchildren->children =
+ g_list_insert_sorted
+ (nchildren->children, list->data,
+ (GCompareFunc)notebook_child_compare_func);
+ } else {
+ if (g_list_find_custom (nchildren->tabs,
+ GINT_TO_POINTER (position),
+ (GCompareFunc)notebook_find_child))
+ nchildren->extra_tabs =
+ g_list_insert_sorted
+ (nchildren->extra_tabs, list->data,
+ (GCompareFunc)notebook_child_compare_func);
+ else
+ nchildren->tabs =
+ g_list_insert_sorted
+ (nchildren->tabs, list->data,
+ (GCompareFunc)notebook_child_compare_func);
+ }
+ }
+ }
+
+ /* Remove all pages, resulting in the unparenting of all widgets including tab-labels.
+ */
+ while (gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)) > 0)
+ {
+ page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), 0);
+
+ /* Explicitly remove the tab label first */
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), page, NULL);
+ gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), 0);
+ }
+
+ if (children)
+ g_list_free (children);
+
+ return nchildren;
+}
+
+static void
+glade_gtk_notebook_insert_children (GtkWidget *notebook, NotebookChildren *nchildren)
+{
+ gint i;
+
+ /*********************************************************
+ INSERT PAGES
+ *********************************************************/
+ for (i = 0; i < nchildren->pages; i++)
+ {
+ GtkWidget *page = notebook_get_page (nchildren, i);
+ GtkWidget *tab = notebook_get_tab (nchildren, i);
+
+ gtk_notebook_insert_page (GTK_NOTEBOOK (notebook), page, NULL, i);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook), page, tab);
+
+ g_object_unref (G_OBJECT (page));
+ g_object_unref (G_OBJECT (tab));
+ }
+
+ /* Free the original lists now */
+ if (nchildren->children)
+ g_list_free (nchildren->children);
+
+ if (nchildren->tabs)
+ g_list_free (nchildren->tabs);
+
+ if (nchildren->children ||
+ nchildren->tabs ||
+ nchildren->extra_children ||
+ nchildren->extra_tabs)
+ g_critical ("Unbalanced children when inserting notebook children"
+ " (pages: %d tabs: %d extra pages: %d extra tabs %d)",
+ g_list_length (nchildren->children),
+ g_list_length (nchildren->tabs),
+ g_list_length (nchildren->extra_children),
+ g_list_length (nchildren->extra_tabs));
+
+ g_free (nchildren);
+}
+
+static void
+glade_gtk_notebook_switch_page (GtkNotebook *notebook,
+ GtkNotebookPage *page,
+ guint page_num,
+ gpointer user_data)
+{
+ GladeWidget *gnotebook = glade_widget_get_from_gobject (notebook);
+
+ glade_widget_property_set (gnotebook, "page", page_num);
+
+}
+
+
+void GLADEGTK_API
+glade_gtk_notebook_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *notebook,
+ GladeCreateReason reason)
+{
+ gtk_notebook_popup_disable (GTK_NOTEBOOK (notebook));
+
+ g_signal_connect (G_OBJECT (notebook), "switch-page",
+ G_CALLBACK (glade_gtk_notebook_switch_page), NULL);
+}
+
+static gint
+glade_gtk_notebook_get_first_blank_page (GtkNotebook *notebook)
+{
+ GladeWidget *gwidget;
+ GtkWidget *widget;
+ gint position;
+
+ for (position = 0; position < gtk_notebook_get_n_pages (notebook); position++)
+ {
+ widget = gtk_notebook_get_nth_page (notebook, position);
+ if ((gwidget = glade_widget_get_from_gobject (widget)) != NULL)
+ {
+ GladeProperty *property =
+ glade_widget_get_property (gwidget, "position");
+ gint gwidget_position = g_value_get_int (property->value);
+
+ if ((gwidget_position - position) > 0)
+ return position;
+ }
+ }
+ return position;
+}
+
+static void
+glade_gtk_notebook_set_n_pages (GObject *object, const GValue *value)
+{
+ GladeWidget *widget;
+ GtkNotebook *notebook;
+ GtkWidget *child_widget, *tab_widget;
+ gint new_size, i;
+ gint old_size;
+
+ notebook = GTK_NOTEBOOK (object);
+ g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
+
+ widget = glade_widget_get_from_gobject (GTK_WIDGET (notebook));
+ g_return_if_fail (widget != NULL);
+
+ new_size = g_value_get_int (value);
+
+ /* Ensure base size of notebook */
+ if (glade_widget_superuser () == FALSE)
+ {
+ for (i = gtk_notebook_get_n_pages (notebook); i < new_size; i++)
+ {
+ gint position = glade_gtk_notebook_get_first_blank_page (notebook);
+ GtkWidget *placeholder = glade_placeholder_new ();
+ GtkWidget *tab_placeholder = glade_placeholder_new ();
+
+ gtk_notebook_insert_page (notebook, placeholder,
+ NULL, position);
+
+ gtk_notebook_set_tab_label (notebook, placeholder, tab_placeholder);
+ g_object_set_data (G_OBJECT (tab_placeholder), "special-child-type", "tab");
+ }
+ }
+
+ old_size = gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook));
+
+ /*
+ * Thing to remember is that GtkNotebook starts the
+ * page numbers from 0, not 1 (C-style). So we need to do
+ * old_size-1, where we're referring to "nth" widget.
+ */
+ while (old_size > new_size) {
+ /* Get the last widget. */
+ child_widget = gtk_notebook_get_nth_page (notebook, old_size-1);
+ tab_widget = gtk_notebook_get_tab_label (notebook, child_widget);
+
+ /*
+ * If we got it, and its not a placeholder, remove it
+ * from project.
+ */
+ if (glade_widget_get_from_gobject (child_widget) ||
+ glade_widget_get_from_gobject (tab_widget))
+ break;
+
+ gtk_notebook_remove_page (notebook, old_size-1);
+ old_size--;
+ }
+}
+
+void GLADEGTK_API
+glade_gtk_notebook_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "pages"))
+ glade_gtk_notebook_set_n_pages (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor, object,
+ id, value);
+}
+
+static gboolean
+glade_gtk_notebook_verify_n_pages (GObject *object, const GValue *value)
+{
+ GtkNotebook *notebook = GTK_NOTEBOOK(object);
+ GtkWidget *child_widget, *tab_widget;
+ gint old_size, new_size = g_value_get_int (value);
+
+ for (old_size = gtk_notebook_get_n_pages (notebook);
+ old_size > new_size; old_size--) {
+ /* Get the last widget. */
+ child_widget = gtk_notebook_get_nth_page (notebook, old_size-1);
+ tab_widget = gtk_notebook_get_tab_label (notebook, child_widget);
+
+ /*
+ * If we got it, and its not a placeholder, remove it
+ * from project.
+ */
+ if (glade_widget_get_from_gobject (child_widget) ||
+ glade_widget_get_from_gobject (tab_widget))
+ return FALSE;
+ }
+ return TRUE;
+}
+
+gboolean GLADEGTK_API
+glade_gtk_notebook_verify_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "pages"))
+ return glade_gtk_notebook_verify_n_pages (object, value);
+ else if (GWA_GET_CLASS (GTK_TYPE_CONTAINER)->verify_property)
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->verify_property (adaptor, object,
+ id, value);
+
+ return TRUE;
+}
+
+void GLADEGTK_API
+glade_gtk_notebook_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ GtkNotebook *notebook;
+ gint num_page, position = 0;
+ GtkWidget *last_page;
+ GladeWidget *gwidget;
+ gchar *special_child_type;
+
+ notebook = GTK_NOTEBOOK (object);
+
+ num_page = gtk_notebook_get_n_pages (notebook);
+
+ /* Just append pages blindly when loading/dupping
+ */
+ if (glade_widget_superuser ())
+ {
+ special_child_type = g_object_get_data (child, "special-child-type");
+ if (special_child_type &&
+ !strcmp (special_child_type, "tab"))
+ {
+ last_page = gtk_notebook_get_nth_page (notebook, num_page - 1);
+ gtk_notebook_set_tab_label (notebook, last_page,
+ GTK_WIDGET (child));
+ }
+ else
+ {
+ gtk_container_add (GTK_CONTAINER (object), GTK_WIDGET (child));
+
+ gwidget = glade_widget_get_from_gobject (object);
+ glade_widget_property_set (gwidget, "pages", num_page + 1);
+
+ gwidget = glade_widget_get_from_gobject (child);
+ if (gwidget && gwidget->packing_properties)
+ glade_widget_pack_property_set (gwidget, "position", num_page);
+ }
+ }
+ else
+ {
+ NotebookChildren *nchildren;
+
+ /* Just destroy placeholders */
+ if (GLADE_IS_PLACEHOLDER (child))
+ {
+ if (GTK_OBJECT_FLOATING (child))
+ gtk_object_sink (GTK_OBJECT (child));
+ else
+ g_object_unref (G_OBJECT (child));
+ }
+ else
+ {
+ gwidget = glade_widget_get_from_gobject (child);
+ g_assert (gwidget);
+
+ glade_widget_pack_property_get (gwidget, "position", &position);
+
+ nchildren = glade_gtk_notebook_extract_children (GTK_WIDGET (notebook));
+
+ if (g_object_get_data (child, "special-child-type") != NULL)
+ {
+ if (g_list_find_custom (nchildren->tabs,
+ GINT_TO_POINTER (position),
+ (GCompareFunc)notebook_find_child))
+ nchildren->extra_tabs =
+ g_list_insert_sorted
+ (nchildren->extra_tabs, child,
+ (GCompareFunc)notebook_child_compare_func);
+ else
+ nchildren->tabs =
+ g_list_insert_sorted
+ (nchildren->tabs, child,
+ (GCompareFunc)notebook_child_compare_func);
+ }
+ else
+ {
+ if (g_list_find_custom (nchildren->children,
+ GINT_TO_POINTER (position),
+ (GCompareFunc)notebook_find_child))
+ nchildren->extra_children =
+ g_list_insert_sorted
+ (nchildren->extra_children, child,
+ (GCompareFunc)notebook_child_compare_func);
+ else
+ nchildren->children =
+ g_list_insert_sorted
+ (nchildren->children, child,
+ (GCompareFunc)notebook_child_compare_func);
+ }
+
+ /* Takes an explicit reference when sitting on the list */
+ g_object_ref (child);
+
+ glade_gtk_notebook_insert_children (GTK_WIDGET (notebook), nchildren);
+ }
+ }
+}
+
+void GLADEGTK_API
+glade_gtk_notebook_remove_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ NotebookChildren *nchildren;
+
+ nchildren = glade_gtk_notebook_extract_children (GTK_WIDGET (object));
+
+ if (g_list_find (nchildren->children, child))
+ {
+ nchildren->children =
+ g_list_remove (nchildren->children, child);
+ g_object_unref (child);
+ }
+ else if (g_list_find (nchildren->extra_children, child))
+ {
+ nchildren->extra_children =
+ g_list_remove (nchildren->extra_children, child);
+ g_object_unref (child);
+ }
+ else if (g_list_find (nchildren->tabs, child))
+ {
+ nchildren->tabs =
+ g_list_remove (nchildren->tabs, child);
+ g_object_unref (child);
+ }
+ else if (g_list_find (nchildren->extra_tabs, child))
+ {
+ nchildren->extra_tabs =
+ g_list_remove (nchildren->extra_tabs, child);
+ g_object_unref (child);
+ }
+
+ glade_gtk_notebook_insert_children (GTK_WIDGET (object), nchildren);
+
+}
+
+void GLADEGTK_API
+glade_gtk_notebook_replace_child (GladeWidgetAdaptor *adaptor,
+ GtkWidget *container,
+ GtkWidget *current,
+ GtkWidget *new_widget)
+{
+ GtkNotebook *notebook;
+ GladeWidget *gcurrent, *gnew;
+ gint position = 0;
+
+ notebook = GTK_NOTEBOOK (container);
+
+ if ((gcurrent = glade_widget_get_from_gobject (current)) != NULL)
+ glade_widget_pack_property_get (gcurrent, "position", &position);
+ else
+ {
+ g_assert (GLADE_IS_PLACEHOLDER (current));
+
+ if ((position = gtk_notebook_page_num (notebook, current)) < 0)
+ {
+ position = notebook_search_tab (notebook, current);
+ g_assert (position >= 0);
+ }
+ }
+
+ if (g_object_get_data (G_OBJECT (current), "special-child-type"))
+ g_object_set_data (G_OBJECT (new_widget), "special-child-type", "tab");
+
+ glade_gtk_notebook_remove_child (adaptor,
+ G_OBJECT (container),
+ G_OBJECT (current));
+
+ if (GLADE_IS_PLACEHOLDER (new_widget) == FALSE)
+ {
+ gnew = glade_widget_get_from_gobject (new_widget);
+
+ glade_gtk_notebook_add_child (adaptor,
+ G_OBJECT (container),
+ G_OBJECT (new_widget));
+
+ if (glade_widget_pack_property_set (gnew, "position", position) == FALSE)
+ g_critical ("No position property found on new widget");
+ }
+ else
+ gtk_widget_destroy (GTK_WIDGET (new_widget));
+}
+
+gboolean GLADEGTK_API
+glade_gtk_notebook_child_verify_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *id,
+ GValue *value)
+{
+ if (!strcmp (id, "position"))
+ return g_value_get_int (value) >= 0 &&
+ g_value_get_int (value) <
+ gtk_notebook_get_n_pages (GTK_NOTEBOOK (container));
+ else if (GWA_GET_CLASS (GTK_TYPE_CONTAINER)->child_verify_property)
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->child_verify_property (adaptor,
+ container, child,
+ id, value);
+
+ return TRUE;
+}
+
+void GLADEGTK_API
+glade_gtk_notebook_set_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ const GValue *value)
+{
+ NotebookChildren *nchildren;
+
+ if (strcmp (property_name, "position") == 0)
+ {
+ /* If we are setting this internally, avoid feedback. */
+ if (glade_gtk_notebook_setting_position ||
+ glade_widget_superuser ())
+ return;
+
+ /* Just rebuild the notebook, property values are already set at this point */
+ nchildren = glade_gtk_notebook_extract_children (GTK_WIDGET (container));
+ glade_gtk_notebook_insert_children (GTK_WIDGET (container), nchildren);
+ }
+ /* packing properties are unsupported on tabs ... except "position" */
+ else if (g_object_get_data (child, "special-child-type") == NULL)
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->child_set_property (adaptor,
+ container, child,
+ property_name, value);
+}
+
+void GLADEGTK_API
+glade_gtk_notebook_get_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ gint position;
+
+ if (strcmp (property_name, "position") == 0)
+ {
+ if (g_object_get_data (child, "special-child-type") != NULL)
+ {
+ if ((position = notebook_search_tab (GTK_NOTEBOOK (container),
+ GTK_WIDGET (child))) >= 0)
+ g_value_set_int (value, position);
+ else
+ g_value_set_int (value, 0);
+ }
+ else
+ gtk_container_child_get_property (GTK_CONTAINER (container),
+ GTK_WIDGET (child),
+ property_name,
+ value);
+ }
+ /* packing properties are unsupported on tabs ... except "position" */
+ else if (g_object_get_data (child, "special-child-type") == NULL)
+ gtk_container_child_get_property (GTK_CONTAINER (container),
+ GTK_WIDGET (child),
+ property_name,
+ value);
+}
+
+
+
+/* ----------------------------- GtkPaned ------------------------------ */
+void GLADEGTK_API
+glade_gtk_paned_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *paned,
+ GladeCreateReason reason)
+{
+ g_return_if_fail (GTK_IS_PANED (paned));
+
+ if (reason == GLADE_CREATE_USER && gtk_paned_get_child1 (GTK_PANED (paned)) == NULL)
+ gtk_paned_add1 (GTK_PANED (paned), glade_placeholder_new ());
+
+ if (reason == GLADE_CREATE_USER && gtk_paned_get_child2 (GTK_PANED (paned)) == NULL)
+ gtk_paned_add2 (GTK_PANED (paned), glade_placeholder_new ());
+}
+
+void GLADEGTK_API
+glade_gtk_paned_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ GtkPaned *paned;
+ GtkWidget *child1, *child2;
+ gboolean loading;
+
+ g_return_if_fail (GTK_IS_PANED (object));
+
+ paned = GTK_PANED (object);
+ loading = glade_util_object_is_loading (object);
+
+ child1 = gtk_paned_get_child1 (paned);
+ child2 = gtk_paned_get_child2 (paned);
+
+ if (loading == FALSE)
+ {
+ /* Remove a placeholder */
+ if (child1 && GLADE_IS_PLACEHOLDER (child1))
+ {
+ gtk_container_remove (GTK_CONTAINER (object), child1);
+ child1 = NULL;
+ }
+ else if (child2 && GLADE_IS_PLACEHOLDER (child2))
+ {
+ gtk_container_remove (GTK_CONTAINER (object), child2);
+ child2 = NULL;
+ }
+ }
+
+ /* Add the child */
+ if (child1 == NULL)
+ gtk_paned_add1 (paned, GTK_WIDGET (child));
+ else if (child2 == NULL)
+ gtk_paned_add2 (paned, GTK_WIDGET (child));
+
+ if (GLADE_IS_PLACEHOLDER (child) == FALSE && loading)
+ {
+ GladeWidget *gchild = glade_widget_get_from_gobject (child);
+
+ if (gchild && gchild->packing_properties)
+ {
+ if (child1 == NULL)
+ glade_widget_pack_property_set (gchild, "first", TRUE);
+ else if (child2 == NULL)
+ glade_widget_pack_property_set (gchild, "first", FALSE);
+ }
+ }
+}
+
+void GLADEGTK_API
+glade_gtk_paned_remove_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ gtk_container_remove (GTK_CONTAINER (object), GTK_WIDGET (child));
+
+ glade_gtk_paned_post_create (adaptor, object, GLADE_CREATE_USER);
+}
+
+void GLADEGTK_API
+glade_gtk_paned_set_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ const GValue *value)
+{
+ if (strcmp (property_name, "first") == 0)
+ {
+ GtkPaned *paned = GTK_PANED (container);
+ gboolean first = g_value_get_boolean (value);
+ GtkWidget *place, *wchild = GTK_WIDGET (child);
+
+ place = (first) ? gtk_paned_get_child1 (paned) :
+ gtk_paned_get_child2 (paned);
+
+ if (place && GLADE_IS_PLACEHOLDER (place))
+ gtk_container_remove (GTK_CONTAINER (container), place);
+
+ g_object_ref (child);
+ gtk_container_remove (GTK_CONTAINER (container), wchild);
+ if (first)
+ gtk_paned_add1 (paned, wchild);
+ else
+ gtk_paned_add2 (paned, wchild);
+ g_object_unref (child);
+
+ /* Ensure placeholders */
+ if ((place = gtk_paned_get_child1 (paned)) == NULL)
+ gtk_paned_add1 (paned, glade_placeholder_new ());
+
+ if ((place = gtk_paned_get_child2 (paned)) == NULL)
+ gtk_paned_add2 (paned, glade_placeholder_new ());
+ }
+ else
+ /* Chain Up */
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->child_set_property (adaptor,
+ container, child,
+ property_name, value);
+}
+
+void GLADEGTK_API
+glade_gtk_paned_get_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ if (strcmp (property_name, "first") == 0)
+ g_value_set_boolean (value, GTK_WIDGET (child) ==
+ gtk_paned_get_child1 (GTK_PANED (container)));
+ else
+ /* Chain Up */
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->child_get_property (adaptor,
+ container, child,
+ property_name, value);
+}
+
+/* ----------------------------- GtkExpander ------------------------------ */
+void GLADEGTK_API
+glade_gtk_expander_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *expander,
+ GladeCreateReason reason)
+{
+ static GladeWidgetAdaptor *wadaptor = NULL;
+ GladeWidget *gexpander, *glabel;
+ GtkWidget *label;
+
+ if (wadaptor == NULL)
+ wadaptor = glade_widget_adaptor_get_by_type (GTK_TYPE_LABEL);
+
+ if (reason != GLADE_CREATE_USER) return;
+
+ g_return_if_fail (GTK_IS_EXPANDER (expander));
+ gexpander = glade_widget_get_from_gobject (expander);
+ g_return_if_fail (GLADE_IS_WIDGET (gexpander));
+
+ /* If we didnt put this object here... */
+ if ((label = gtk_expander_get_label_widget (GTK_EXPANDER (expander))) == NULL ||
+ (glade_widget_get_from_gobject (label) == NULL))
+ {
+ glabel = glade_widget_adaptor_create_widget (wadaptor, FALSE,
+ "parent", gexpander,
+ "project", glade_widget_get_project (gexpander),
+ NULL);
+
+ glade_widget_property_set (glabel, "label", "expander");
+
+ g_object_set_data (glabel->object, "special-child-type", "label_item");
+ gtk_expander_set_label_widget (GTK_EXPANDER (expander),
+ GTK_WIDGET (glabel->object));
+
+ gtk_widget_show (GTK_WIDGET (glabel->object));
+ }
+
+ gtk_expander_set_expanded (GTK_EXPANDER (expander), TRUE);
+
+ gtk_container_add (GTK_CONTAINER (expander), glade_placeholder_new ());
+
+}
+
+void GLADEGTK_API
+glade_gtk_expander_replace_child (GladeWidgetAdaptor *adaptor,
+ GtkWidget *container,
+ GtkWidget *current,
+ GtkWidget *new_widget)
+{
+ gchar *special_child_type;
+
+ special_child_type =
+ g_object_get_data (G_OBJECT (current), "special-child-type");
+
+ if (special_child_type && !strcmp (special_child_type, "label_item"))
+ {
+ g_object_set_data (G_OBJECT (new_widget), "special-child-type", "label_item");
+ gtk_expander_set_label_widget (GTK_EXPANDER (container), new_widget);
+ return;
+ }
+
+ /* Chain Up */
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->replace_child (adaptor,
+ G_OBJECT (container),
+ G_OBJECT (current),
+ G_OBJECT (new_widget));
+}
+
+
+void GLADEGTK_API
+glade_gtk_expander_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ gchar *special_child_type;
+
+ special_child_type = g_object_get_data (child, "special-child-type");
+
+ if (special_child_type &&
+ !strcmp (special_child_type, "label_item"))
+ {
+ gtk_expander_set_label_widget (GTK_EXPANDER (object),
+ GTK_WIDGET (child));
+ }
+ else
+ /* Chain Up */
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->add (adaptor, object, child);
+}
+
+void GLADEGTK_API
+glade_gtk_expander_remove_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ gchar *special_child_type;
+
+ special_child_type = g_object_get_data (child, "special-child-type");
+ if (special_child_type &&
+ !strcmp (special_child_type, "label_item"))
+ {
+ gtk_expander_set_label_widget (GTK_EXPANDER (object),
+ glade_placeholder_new ());
+ }
+ else
+ {
+ gtk_container_remove (GTK_CONTAINER (object),
+ GTK_WIDGET (child));
+ gtk_container_add (GTK_CONTAINER (object),
+ glade_placeholder_new ());
+ }
+}
+
+/* -------------------------------- GtkEntry -------------------------------- */
+static void
+glade_gtk_entry_changed (GtkEditable *editable, GladeWidget *gentry)
+{
+ const gchar *text, *text_prop;
+ GladeProperty *prop;
+
+ text = gtk_entry_get_text (GTK_ENTRY (editable));
+
+ glade_widget_property_get (gentry, "text", &text_prop);
+
+ if (strcmp (text, text_prop))
+ if ((prop = glade_widget_get_property (gentry, "text")))
+ glade_command_set_property (prop, text);
+}
+
+void GLADEGTK_API
+glade_gtk_entry_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GladeWidget *gentry;
+
+ g_return_if_fail (GTK_IS_ENTRY (object));
+ gentry = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GLADE_IS_WIDGET (gentry));
+
+ g_signal_connect (object, "changed",
+ G_CALLBACK (glade_gtk_entry_changed), gentry);
+}
+
+/* ----------------------------- GtkFixed/GtkLayout ------------------------------ */
+static void
+glade_gtk_fixed_layout_finalize(GdkPixmap *backing)
+{
+ g_object_unref(backing);
+}
+
+static void
+glade_gtk_fixed_layout_realize (GtkWidget *widget)
+{
+ GdkPixmap *backing =
+ gdk_pixmap_colormap_create_from_xpm_d (NULL, gtk_widget_get_colormap (widget),
+ NULL, NULL, fixed_bg_xpm);
+
+ if (GTK_IS_LAYOUT (widget))
+ gdk_window_set_back_pixmap (GTK_LAYOUT (widget)->bin_window, backing, FALSE);
+ else
+ gdk_window_set_back_pixmap (widget->window, backing, FALSE);
+
+ /* For cleanup later
+ */
+ g_object_weak_ref(G_OBJECT(widget),
+ (GWeakNotify)glade_gtk_fixed_layout_finalize, backing);
+}
+
+void GLADEGTK_API
+glade_gtk_fixed_layout_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ /* This is needed at least to set a backing pixmap. */
+ GTK_WIDGET_UNSET_FLAGS(object, GTK_NO_WINDOW);
+
+ /* For backing pixmap
+ */
+ g_signal_connect_after(object, "realize",
+ G_CALLBACK(glade_gtk_fixed_layout_realize), NULL);
+}
+
+void GLADEGTK_API
+glade_gtk_fixed_layout_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ g_return_if_fail (GTK_IS_CONTAINER (object));
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ gtk_container_add (GTK_CONTAINER (object), GTK_WIDGET (child));
+}
+
+void GLADEGTK_API
+glade_gtk_fixed_layout_remove_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ g_return_if_fail (GTK_IS_CONTAINER (object));
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ gtk_container_add (GTK_CONTAINER (object), GTK_WIDGET (child));
+}
+
+/* ----------------------------- GtkWindow ------------------------------ */
+void GLADEGTK_API
+glade_gtk_window_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GtkWindow *window = GTK_WINDOW (object);
+
+ g_return_if_fail (GTK_IS_WINDOW (window));
+
+ /* Chain her up first */
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->post_create (adaptor, object, reason);
+
+ gtk_window_set_default_size (window, 440, 250);
+}
+
+/* ----------------------------- GtkDialog(s) ------------------------------ */
+void GLADEGTK_API
+glade_gtk_dialog_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GtkDialog *dialog = GTK_DIALOG (object);
+ GladeWidget *widget;
+ GladeWidget *vbox_widget, *actionarea_widget, *colorsel, *fontsel;
+ GladeWidget *save_button = NULL, *close_button = NULL, *ok_button = NULL,
+ *cancel_button = NULL, *help_button = NULL, *apply_button = NULL;
+
+ g_return_if_fail (GTK_IS_DIALOG (dialog));
+
+ widget = glade_widget_get_from_gobject (GTK_WIDGET (dialog));
+ if (!widget)
+ return;
+
+
+ if (reason == GLADE_CREATE_USER)
+ {
+ /* HIG complient border-width defaults on dialogs */
+ glade_widget_property_set (widget, "border-width", 5);
+ }
+
+ if (GTK_IS_INPUT_DIALOG (object))
+ {
+ save_button = glade_widget_adaptor_create_internal
+ (widget, G_OBJECT (GTK_INPUT_DIALOG (dialog)->save_button),
+ "save_button", "inputdialog", FALSE, reason);
+
+ close_button = glade_widget_adaptor_create_internal
+ (widget, G_OBJECT (GTK_INPUT_DIALOG (dialog)->close_button),
+ "close_button", "inputdialog", FALSE, reason);
+
+ }
+ else if (GTK_IS_FILE_SELECTION (object))
+ {
+ ok_button = glade_widget_adaptor_create_internal
+ (widget, G_OBJECT (GTK_FILE_SELECTION (object)->ok_button),
+ "ok_button", "filesel", FALSE, reason);
+
+ cancel_button = glade_widget_adaptor_create_internal
+ (widget, G_OBJECT (GTK_FILE_SELECTION (object)->cancel_button),
+ "cancel_button", "filesel", FALSE, reason);
+ }
+ else if (GTK_IS_COLOR_SELECTION_DIALOG (object))
+ {
+ ok_button = glade_widget_adaptor_create_internal
+ (widget, G_OBJECT (GTK_COLOR_SELECTION_DIALOG (object)->ok_button),
+ "ok_button", "colorsel", FALSE, reason);
+
+ cancel_button = glade_widget_adaptor_create_internal
+ (widget, G_OBJECT (GTK_COLOR_SELECTION_DIALOG (object)->cancel_button),
+ "cancel_button", "colorsel", FALSE, reason);
+
+ help_button = glade_widget_adaptor_create_internal
+ (widget, G_OBJECT (GTK_COLOR_SELECTION_DIALOG (object)->help_button),
+ "help_button", "colorsel", FALSE, reason);
+
+ colorsel = glade_widget_adaptor_create_internal
+ (widget, G_OBJECT (GTK_COLOR_SELECTION_DIALOG (object)->colorsel),
+ "color_selection", "colorsel", FALSE, reason);
+
+ /* Set this to 1 at load time, if there are any children then
+ * size will adjust appropriately (otherwise the default "3" gets
+ * set and we end up with extra placeholders).
+ */
+ if (reason == GLADE_CREATE_LOAD)
+ glade_widget_property_set (colorsel, "size", 1);
+
+ }
+ else if (GTK_IS_FONT_SELECTION_DIALOG (object))
+ {
+ ok_button = glade_widget_adaptor_create_internal
+ (widget, G_OBJECT (GTK_FONT_SELECTION_DIALOG (object)->ok_button),
+ "ok_button", "fontsel", FALSE, reason);
+
+ apply_button = glade_widget_adaptor_create_internal
+ (widget, G_OBJECT (GTK_FONT_SELECTION_DIALOG (object)->apply_button),
+ "apply_button", "fontsel", FALSE, reason);
+
+ cancel_button = glade_widget_adaptor_create_internal
+ (widget, G_OBJECT (GTK_FONT_SELECTION_DIALOG (object)->cancel_button),
+ "cancel_button", "fontsel", FALSE, reason);
+
+ fontsel = glade_widget_adaptor_create_internal
+ (widget, G_OBJECT (GTK_FONT_SELECTION_DIALOG (object)->fontsel),
+ "font_selection", "fontsel", FALSE, reason);
+
+ /* Set this to 1 at load time, if there are any children then
+ * size will adjust appropriately (otherwise the default "3" gets
+ * set and we end up with extra placeholders).
+ */
+ if (reason == GLADE_CREATE_LOAD)
+ glade_widget_property_set (fontsel, "size", 2);
+ }
+ else
+ {
+ vbox_widget = glade_widget_adaptor_create_internal
+ (widget, G_OBJECT(dialog->vbox),
+ "vbox", "dialog", FALSE, reason);
+
+ actionarea_widget = glade_widget_adaptor_create_internal
+ (vbox_widget, G_OBJECT(dialog->action_area),
+ "action_area", "dialog", FALSE, reason);
+
+ /* These properties are controlled by the GtkDialog style properties:
+ * "content-area-border", "button-spacing" and "action-area-border",
+ * so we must disable thier use.
+ */
+ glade_widget_remove_property (vbox_widget, "border-width");
+ glade_widget_remove_property (actionarea_widget, "border-width");
+ glade_widget_remove_property (actionarea_widget, "spacing");
+
+ /* Only set these on the original create. */
+ if (reason == GLADE_CREATE_USER)
+ {
+
+ /* HIG complient spacing defaults on dialogs */
+ glade_widget_property_set (vbox_widget, "spacing", 2);
+
+ if (GTK_IS_MESSAGE_DIALOG (object))
+ glade_widget_property_set (vbox_widget, "size", 2);
+ else if (GTK_IS_ABOUT_DIALOG (object))
+ glade_widget_property_set (vbox_widget, "size", 3);
+ else if (GTK_IS_FILE_CHOOSER_DIALOG (object))
+ glade_widget_property_set (vbox_widget, "size", 3);
+ else
+ glade_widget_property_set (vbox_widget, "size", 2);
+
+ glade_widget_property_set (actionarea_widget, "size", 2);
+ glade_widget_property_set (actionarea_widget, "layout-style", GTK_BUTTONBOX_END);
+ }
+ }
+
+ /* set a reasonable default size for a dialog */
+ if (GTK_IS_MESSAGE_DIALOG (dialog))
+ gtk_window_set_default_size (GTK_WINDOW (object), 400, 115);
+ else
+ gtk_window_set_default_size (GTK_WINDOW (dialog), 320, 260);
+}
+
+
+GtkWidget * GLADEGTK_API
+glade_gtk_dialog_get_internal_child (GladeWidgetAdaptor *adaptor,
+ GtkDialog *dialog,
+ const gchar *name)
+{
+ GtkWidget *child = NULL;
+
+ g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
+
+ if (GTK_IS_INPUT_DIALOG (dialog))
+ {
+ if (strcmp ("close_button", name) == 0)
+ child = GTK_INPUT_DIALOG (dialog)->close_button;
+ else if (strcmp ("save_button", name) == 0)
+ child = GTK_INPUT_DIALOG (dialog)->save_button;
+ }
+ else if (GTK_IS_FILE_SELECTION (dialog))
+ {
+ if (strcmp ("ok_button", name) == 0)
+ child = GTK_FILE_SELECTION (dialog)->ok_button;
+ else if (strcmp ("cancel_button", name) == 0)
+ child = GTK_FILE_SELECTION (dialog)->cancel_button;
+ }
+ else if (GTK_IS_COLOR_SELECTION_DIALOG (dialog))
+ {
+ if (strcmp ("ok_button", name) == 0)
+ child = GTK_COLOR_SELECTION_DIALOG (dialog)->ok_button;
+ else if (strcmp ("cancel_button", name) == 0)
+ child = GTK_COLOR_SELECTION_DIALOG (dialog)->cancel_button;
+ else if (strcmp ("help_button", name) == 0)
+ child = GTK_COLOR_SELECTION_DIALOG (dialog)->help_button;
+ else if (strcmp ("color_selection", name) == 0)
+ child = GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel;
+ }
+ else if (GTK_IS_FONT_SELECTION_DIALOG (dialog))
+ {
+ if (strcmp ("ok_button", name) == 0)
+ child = GTK_FONT_SELECTION_DIALOG (dialog)->ok_button;
+ else if (strcmp ("apply_button", name) == 0)
+ child = GTK_FONT_SELECTION_DIALOG (dialog)->apply_button;
+ else if (strcmp ("cancel_button", name) == 0)
+ child = GTK_FONT_SELECTION_DIALOG (dialog)->cancel_button;
+ else if (strcmp ("font_selection", name) == 0)
+ child = GTK_FONT_SELECTION_DIALOG (dialog)->fontsel;
+ }
+ else
+ {
+ /* Default generic dialog handling
+ */
+ if (strcmp ("vbox", name) == 0)
+ child = dialog->vbox;
+ else if (strcmp ("action_area", name) == 0)
+ child = dialog->action_area;
+ }
+
+ return child;
+}
+
+GList * GLADEGTK_API
+glade_gtk_dialog_get_children (GladeWidgetAdaptor *adaptor,
+ GtkDialog *dialog)
+{
+ GList *list = NULL;
+
+ g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
+
+ list = glade_util_container_get_all_children (GTK_CONTAINER (dialog));
+
+ if (GTK_IS_INPUT_DIALOG (dialog))
+ {
+ list = g_list_prepend (list, GTK_INPUT_DIALOG (dialog)->close_button);
+ list = g_list_prepend (list, GTK_INPUT_DIALOG (dialog)->save_button);
+ }
+ else if (GTK_IS_FILE_SELECTION (dialog))
+ {
+ list = g_list_prepend (list, GTK_FILE_SELECTION (dialog)->ok_button);
+ list = g_list_prepend (list, GTK_FILE_SELECTION (dialog)->cancel_button);
+ }
+ else if (GTK_IS_COLOR_SELECTION_DIALOG (dialog))
+ {
+ list = g_list_prepend (list, GTK_COLOR_SELECTION_DIALOG (dialog)->ok_button);
+ list = g_list_prepend (list, GTK_COLOR_SELECTION_DIALOG (dialog)->cancel_button);
+ list = g_list_prepend (list, GTK_COLOR_SELECTION_DIALOG (dialog)->help_button);
+ list = g_list_prepend (list, GTK_COLOR_SELECTION_DIALOG (dialog)->colorsel);
+ }
+ else if (GTK_IS_FONT_SELECTION_DIALOG (dialog))
+ {
+ list = g_list_prepend (list, GTK_FONT_SELECTION_DIALOG (dialog)->ok_button);
+ list = g_list_prepend (list, GTK_FONT_SELECTION_DIALOG (dialog)->apply_button);
+ list = g_list_prepend (list, GTK_FONT_SELECTION_DIALOG (dialog)->cancel_button);
+ list = g_list_prepend (list, GTK_FONT_SELECTION_DIALOG (dialog)->fontsel);
+ }
+ return list;
+}
+
+
+void GLADEGTK_API
+glade_gtk_dialog_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (GTK_IS_MESSAGE_DIALOG (object) && !strcmp (id, "image"))
+ {
+ /* Gtk+ 2.10 crashes when you unset the image of
+ * a message dialog, so we dont ever unset it.
+ */
+ if (g_value_get_object (value))
+ gtk_message_dialog_set_image (GTK_MESSAGE_DIALOG (object),
+ GTK_WIDGET (g_value_get_object (value)));
+ }
+ else
+ GWA_GET_CLASS (GTK_TYPE_WINDOW)->set_property (adaptor, object,
+ id, value);
+}
+
+
+/* ----------------------------- GtkFontButton ------------------------------ */
+/* Use the font-buttons launch dialog to actually set the font-name
+ * glade property through the glade-command api.
+ */
+static void
+glade_gtk_font_button_refresh_font_name (GtkFontButton *button,
+ GladeWidget *gbutton)
+{
+ GladeProperty *property;
+
+ if ((property =
+ glade_widget_get_property (gbutton, "font-name")) != NULL)
+ glade_command_set_property (property,
+ gtk_font_button_get_font_name (button));
+}
+
+
+/* ----------------------------- GtkColorButton ------------------------------ */
+static void
+glade_gtk_color_button_refresh_color (GtkColorButton *button,
+ GladeWidget *gbutton)
+{
+ GladeProperty *property;
+ GdkColor color = { 0, };
+
+ if ((property = glade_widget_get_property (gbutton, "color")) != NULL)
+ glade_command_set_property (property, &color);
+}
+
+/* ----------------------------- GtkButton ------------------------------ */
+static void
+glade_gtk_button_disable_label (GladeWidget *gwidget)
+{
+ glade_widget_property_set (gwidget, "use-underline", FALSE);
+
+ glade_widget_property_set_sensitive
+ (gwidget, "label", FALSE,
+ _("This only applies with label type buttons"));
+
+ glade_widget_property_set_sensitive
+ (gwidget, "use-underline", FALSE,
+ _("This only applies with label type buttons"));
+}
+
+static void
+glade_gtk_button_disable_stock (GladeWidget *gwidget)
+{
+ glade_widget_property_set (gwidget, "use-stock", FALSE);
+ glade_widget_property_set (gwidget, "stock", 0);
+
+ glade_widget_property_set_sensitive
+ (gwidget, "stock", FALSE,
+ _("This only applies with stock type buttons"));
+
+ glade_widget_property_set_sensitive
+ (gwidget, "image-position", FALSE,
+ _("This only applies with stock type buttons"));
+
+}
+
+static void
+glade_gtk_button_restore_container (GladeWidget *gwidget)
+{
+ GtkWidget *child = GTK_BIN (gwidget->object)->child;
+ if (child && glade_widget_get_from_gobject (child) == NULL)
+ gtk_container_remove (GTK_CONTAINER (gwidget->object), child);
+
+ if (GTK_BIN (gwidget->object)->child == NULL)
+ gtk_container_add (GTK_CONTAINER (gwidget->object),
+ glade_placeholder_new ());
+}
+
+static void
+glade_gtk_button_post_create_parse_finished (GladeProject *project,
+ GObject *button)
+{
+ gboolean use_stock = FALSE;
+ gchar *label = NULL;
+ GEnumValue *eval;
+ GEnumClass *eclass;
+ GladeWidget *gbutton = glade_widget_get_from_gobject (button);
+ GladeCreateReason reason;
+
+ eclass = g_type_class_ref (GLADE_TYPE_STOCK);
+
+ g_object_set_data (button, "glade-button-post-ran", GINT_TO_POINTER (1));
+ reason = GPOINTER_TO_INT (g_object_get_data (button, "glade-reason"));
+
+ glade_widget_property_get (gbutton, "use-stock", &use_stock);
+ glade_widget_property_get (gbutton, "label", &label);
+
+ if (GTK_BIN (button)->child != NULL &&
+ glade_widget_get_from_gobject (GTK_BIN (button)->child) != NULL)
+ {
+ glade_widget_property_set (gbutton, "glade-type", GLADEGTK_BUTTON_CONTAINER);
+ }
+ else if (use_stock)
+ {
+ if (label != NULL && strcmp (label, "glade-none") != 0 &&
+ (eval = g_enum_get_value_by_nick (eclass, label)) != NULL)
+ {
+ g_object_set_data (G_OBJECT (gbutton), "stock",
+ GINT_TO_POINTER (eval->value));
+
+ glade_widget_property_set (gbutton, "stock", eval->value);
+ }
+
+ glade_widget_property_set (gbutton, "glade-type", GLADEGTK_BUTTON_STOCK);
+ }
+ else
+ /* Fallback to label type */
+ glade_widget_property_set (gbutton, "glade-type", GLADEGTK_BUTTON_LABEL);
+
+ g_type_class_unref (eclass);
+}
+
+void GLADEGTK_API
+glade_gtk_button_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *button,
+ GladeCreateReason reason)
+{
+ GladeWidget *gbutton = glade_widget_get_from_gobject (button);
+
+ g_return_if_fail (GTK_IS_BUTTON (button));
+ g_return_if_fail (GLADE_IS_WIDGET (gbutton));
+
+ if (GTK_IS_FONT_BUTTON (button))
+ g_signal_connect
+ (button, "font-set",
+ G_CALLBACK (glade_gtk_font_button_refresh_font_name), gbutton);
+ else if (GTK_IS_COLOR_BUTTON (button))
+ g_signal_connect
+ (button, "color-set",
+ G_CALLBACK (glade_gtk_color_button_refresh_color), gbutton);
+
+
+ if (GTK_IS_COLOR_BUTTON (button) ||
+ GTK_IS_FONT_BUTTON (button))
+ return;
+
+ /* Internal buttons get there stock stuff introspected. */
+ if (reason == GLADE_CREATE_USER && gbutton->internal == NULL)
+ {
+ g_object_set_data (button, "glade-button-post-ran", GINT_TO_POINTER (1));
+
+ glade_widget_property_set (gbutton, "glade-type", GLADEGTK_BUTTON_LABEL);
+ glade_project_selection_set (GLADE_PROJECT (gbutton->project),
+ G_OBJECT (button), TRUE);
+ }
+ else
+ {
+ g_object_set_data (button, "glade-reason", GINT_TO_POINTER (reason));
+ g_signal_connect (glade_widget_get_project (gbutton),
+ "parse-finished",
+ G_CALLBACK (glade_gtk_button_post_create_parse_finished),
+ button);
+ }
+}
+
+static void
+glade_gtk_button_set_type (GObject *object, const GValue *value)
+{
+ GladeWidget *gwidget;
+ GladeGtkButtonType type;
+
+ gwidget = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GTK_IS_BUTTON (object));
+ g_return_if_fail (GLADE_IS_WIDGET (gwidget));
+
+ /* Exit if we're still loading project objects
+ */
+ if (GPOINTER_TO_INT (g_object_get_data
+ (object, "glade-button-post-ran")) == 0)
+ return;
+
+ type = g_value_get_enum (value);
+
+ switch (type)
+ {
+ case GLADEGTK_BUTTON_LABEL:
+ glade_widget_property_set_sensitive (gwidget, "label", TRUE, NULL);
+ glade_widget_property_set_sensitive (gwidget, "use-underline", TRUE, NULL);
+ glade_gtk_button_disable_stock (gwidget);
+ break;
+ case GLADEGTK_BUTTON_STOCK:
+ glade_widget_property_set (gwidget, "use-stock", TRUE);
+ glade_widget_property_set_sensitive (gwidget, "stock", TRUE, NULL);
+ glade_widget_property_set_sensitive (gwidget, "image-position", TRUE, NULL);
+ glade_gtk_button_disable_label (gwidget);
+ break;
+ case GLADEGTK_BUTTON_CONTAINER:
+
+ if (GPOINTER_TO_INT (g_object_get_data
+ (object, "button-type-initially-set")) != 0)
+ {
+ /* Skip this on the initial setting */
+ glade_gtk_button_disable_label (gwidget);
+ glade_gtk_button_disable_stock (gwidget);
+ }
+ else
+ {
+ /* Initially setting container mode after a load is
+ * a delicate dance.
+ */
+ glade_widget_property_set (gwidget, "label", NULL);
+
+ glade_widget_property_set_sensitive
+ (gwidget, "stock", FALSE,
+ _("This only applies with stock type buttons"));
+
+ glade_widget_property_set_sensitive
+ (gwidget, "image-position", FALSE,
+ _("This only applies with stock type buttons"));
+
+ glade_widget_property_set_sensitive
+ (gwidget, "label", FALSE,
+ _("This only applies with label type buttons"));
+
+ glade_widget_property_set_sensitive
+ (gwidget, "use-underline", FALSE,
+ _("This only applies with label type buttons"));
+ }
+ glade_widget_property_set (gwidget, "label", NULL);
+ glade_gtk_button_restore_container (gwidget);
+ break;
+ }
+ g_object_set_data (object, "button-type-initially-set", GINT_TO_POINTER (1));
+}
+
+static void
+glade_gtk_button_set_stock (GObject *object, const GValue *value)
+{
+ GladeWidget *gwidget;
+ GEnumClass *eclass;
+ GEnumValue *eval;
+ gint val;
+
+ gwidget = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GTK_IS_BUTTON (object));
+ g_return_if_fail (GLADE_IS_WIDGET (gwidget));
+
+ /* Exit if we're still loading project objects
+ */
+ if (GPOINTER_TO_INT (g_object_get_data
+ (object, "glade-button-post-ran")) == 0)
+ return;
+
+ val = g_value_get_enum (value);
+ if (val == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (gwidget), "stock")))
+ return;
+ g_object_set_data (G_OBJECT (gwidget), "stock", GINT_TO_POINTER (val));
+
+ eclass = g_type_class_ref (G_VALUE_TYPE (value));
+ if ((eval = g_enum_get_value (eclass, val)) != NULL)
+ {
+ /* setting to "none", ensure an appropriate label */
+ if (val == 0)
+ glade_widget_property_set (gwidget, "label", NULL);
+ else
+ {
+ if (GTK_BIN (object)->child)
+ {
+ /* Here we would delete the coresponding GladeWidget from
+ * the project (like we created it and added it), but this
+ * screws up the undo stack, so instead we keep the stock
+ * button insensitive while ther are usefull children in the
+ * button.
+ */
+ gtk_container_remove (GTK_CONTAINER (object),
+ GTK_BIN (object)->child);
+ }
+
+ /* Here we should remove any previously added GladeWidgets manualy
+ * and from the project, not to leak them.
+ */
+ glade_widget_property_set (gwidget, "label", eval->value_nick);
+ }
+ }
+ g_type_class_unref (eclass);
+}
+
+void GLADEGTK_API
+glade_gtk_button_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "glade-type"))
+ glade_gtk_button_set_type (object, value);
+ else if (!strcmp (id, "stock"))
+ glade_gtk_button_set_stock (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor, object,
+ id, value);
+}
+
+void GLADEGTK_API
+glade_gtk_button_replace_child (GladeWidgetAdaptor *adaptor,
+ GtkWidget *container,
+ GtkWidget *current,
+ GtkWidget *new_widget)
+{
+ GladeWidget *gbutton = glade_widget_get_from_gobject (container);
+
+ g_return_if_fail (GLADE_IS_WIDGET (gbutton));
+
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->replace_child (adaptor,
+ G_OBJECT (container),
+ G_OBJECT (current),
+ G_OBJECT (new_widget));
+
+ if (GLADE_IS_PLACEHOLDER (new_widget))
+ glade_widget_property_set_sensitive (gbutton, "glade-type", TRUE, NULL);
+ else
+ glade_widget_property_set_sensitive (gbutton, "glade-type", FALSE,
+ _("You must remove any children before "
+ "you can set the type"));
+
+}
+
+void GLADEGTK_API
+glade_gtk_button_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ GladeWidget *gwidget;
+
+ if (GTK_BIN (object)->child)
+ gtk_container_remove (GTK_CONTAINER (object),
+ GTK_BIN (object)->child);
+
+ gtk_container_add (GTK_CONTAINER (object), GTK_WIDGET (child));
+
+ if (GLADE_IS_PLACEHOLDER (child) == FALSE)
+ {
+ gwidget = glade_widget_get_from_gobject (object);
+ glade_widget_property_set_sensitive (gwidget, "glade-type", FALSE,
+ _("You must remove any children before "
+ "you can set the type"));
+ }
+}
+
+void GLADEGTK_API
+glade_gtk_button_remove_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ GladeWidget *gwidget = glade_widget_get_from_gobject (object);
+
+ gtk_container_remove (GTK_CONTAINER (object), GTK_WIDGET (child));
+ gtk_container_add (GTK_CONTAINER (object), glade_placeholder_new());
+
+ glade_widget_property_set_sensitive (gwidget, "glade-type", TRUE, NULL);
+}
+
+/* ----------------------------- GtkImage ------------------------------ */
+static void
+glade_gtk_image_disable_filename (GladeWidget *gwidget)
+{
+ glade_widget_property_set (gwidget, "pixbuf", NULL);
+ glade_widget_property_set_sensitive (gwidget, "pixbuf", FALSE,
+ _("This only applies with file type images"));
+}
+
+static void
+glade_gtk_image_disable_icon_name (GladeWidget *gwidget)
+{
+ glade_widget_property_reset (gwidget, "icon-name");
+ glade_widget_property_set_sensitive (gwidget, "icon-name", FALSE,
+ _("This only applies to Icon Theme type images"));
+}
+
+static void
+glade_gtk_image_disable_stock (GladeWidget *gwidget)
+{
+ glade_widget_property_set (gwidget, "glade-stock", NULL);
+ glade_widget_property_set (gwidget, "stock", NULL);
+ glade_widget_property_set_sensitive (gwidget, "glade-stock", FALSE,
+ _("This only applies with stock type images"));
+}
+
+static void
+glade_gtk_image_pixel_size_changed (GladeProperty *property,
+ GValue *old_value,
+ GValue *value,
+ GladeWidget *gimage)
+{
+ gint size = g_value_get_int (value);
+ glade_widget_property_set_sensitive
+ (gimage, "icon-size", size < 0 ? TRUE : FALSE,
+ _("Pixel Size takes precedence over Icon Size; "
+ "if you want to use Icon Size, set Pixel size to -1"));
+}
+
+static void
+glade_gtk_image_parse_finished (GladeProject *project, GladeWidget *gimage)
+{
+ GladeProperty *property;
+ gint size;
+
+ if (glade_widget_property_default (gimage, "icon-name") == FALSE)
+ glade_widget_property_set (gimage, "glade-type", GLADEGTK_IMAGE_ICONTHEME);
+ else if (glade_widget_property_default (gimage, "stock") == FALSE)
+ glade_widget_property_set (gimage, "glade-type", GLADEGTK_IMAGE_STOCK);
+ else if (glade_widget_property_default (gimage, "pixbuf") == FALSE)
+ glade_widget_property_set (gimage, "glade-type", GLADEGTK_IMAGE_FILENAME);
+ else
+ glade_widget_property_reset (gimage, "glade-type");
+
+ if ((property = glade_widget_get_property (gimage, "pixel-size")) == NULL)
+ return;
+
+ glade_widget_property_get (gimage, "pixel-size", &size);
+
+ if (size >= 0)
+ glade_widget_property_set_sensitive (gimage, "icon-size", FALSE,
+ _("Pixel Size takes precedence over Icon size"));
+
+ g_signal_connect (G_OBJECT (property), "value-changed",
+ G_CALLBACK (glade_gtk_image_pixel_size_changed),
+ gimage);
+}
+
+void GLADEGTK_API
+glade_gtk_image_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GladeWidget *gimage;
+
+ if (reason == GLADE_CREATE_LOAD)
+ {
+ gimage = glade_widget_get_from_gobject (object);
+
+ g_signal_connect (glade_widget_get_project (gimage),
+ "parse-finished",
+ G_CALLBACK (glade_gtk_image_parse_finished),
+ gimage);
+ }
+}
+
+static void
+glade_gtk_image_set_icon_name (GObject *object, const GValue *value)
+{
+ GladeWidget *gimage;
+ gint icon_size;
+
+ g_return_if_fail (GTK_IS_IMAGE (object));
+ gimage = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GLADE_IS_WIDGET (gimage));
+
+ glade_widget_property_get (gimage, "icon-size", &icon_size);
+
+ gtk_image_set_from_icon_name (GTK_IMAGE (object),
+ g_value_get_string (value),
+ icon_size);
+}
+
+static void
+glade_gtk_image_refresh (GladeWidget *gwidget, const gchar *property)
+{
+ gpointer p;
+ glade_widget_property_set_sensitive (gwidget, property, TRUE, NULL);
+ glade_widget_property_get (gwidget, property, &p);
+ glade_widget_property_set (gwidget, property, p);
+}
+
+static void
+glade_gtk_image_set_type (GObject *object, const GValue *value)
+{
+ GladeWidget *gwidget;
+ GladeGtkImageType type;
+
+ gwidget = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GTK_IS_IMAGE (object));
+ g_return_if_fail (GLADE_IS_WIDGET (gwidget));
+
+ /* Exit if we're still loading project objects */
+ if (glade_util_object_is_loading (object)) return;
+
+ switch ((type = g_value_get_enum (value)))
+ {
+ case GLADEGTK_IMAGE_STOCK:
+ glade_gtk_image_disable_filename (gwidget);
+ glade_gtk_image_disable_icon_name (gwidget);
+ glade_gtk_image_refresh (gwidget, "glade-stock");
+ break;
+
+ case GLADEGTK_IMAGE_ICONTHEME:
+ glade_gtk_image_disable_filename (gwidget);
+ glade_gtk_image_disable_stock (gwidget);
+ glade_gtk_image_refresh (gwidget, "icon-name");
+ break;
+
+ case GLADEGTK_IMAGE_FILENAME:
+ default:
+ glade_gtk_image_disable_stock (gwidget);
+ glade_gtk_image_disable_icon_name (gwidget);
+ glade_gtk_image_refresh (gwidget, "pixbuf");
+ break;
+ }
+}
+
+/* This basicly just sets the virtual "glade-stock" property
+ * based on the image's "stock" property (for glade file loading purposes)
+ */
+static void
+glade_gtk_image_set_stock (GObject *object, const GValue *value)
+{
+ GladeWidget *gwidget;
+ gchar *str;
+ gint icon_size;
+
+ g_return_if_fail (GTK_IS_IMAGE (object));
+ gwidget = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GLADE_IS_WIDGET (gwidget));
+
+ if ((str = g_value_dup_string (value)) &&
+ glade_util_object_is_loading (object))
+ {
+ GEnumClass *eclass = g_type_class_ref (GLADE_TYPE_STOCK);
+ GEnumValue *eval;
+
+ if ((eval = g_enum_get_value_by_nick (eclass, str)) != NULL)
+ glade_widget_property_set (gwidget, "glade-stock",
+ eval->value);
+ g_type_class_unref (eclass);
+ }
+
+ if (str == NULL && glade_widget_superuser ()) return;
+
+ /* Set the real property */
+ glade_widget_property_get (gwidget, "icon-size", &icon_size);
+ gtk_image_set_from_stock (GTK_IMAGE (object), str, icon_size);
+
+ /* Sometimes it gets recursive around here, valgrind says
+ * we should dup a string for this purpose ;-)
+ */
+ g_free (str);
+}
+
+static void
+glade_gtk_image_set_glade_stock (GObject *object, const GValue *value)
+{
+ GladeWidget *gwidget;
+ GEnumClass *eclass;
+ GEnumValue *eval;
+ gint val;
+
+ g_return_if_fail (GTK_IS_IMAGE (object));
+ gwidget = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GLADE_IS_WIDGET (gwidget));
+
+ val = g_value_get_enum (value);
+ eclass = g_type_class_ref (G_VALUE_TYPE (value));
+ if ((eval = g_enum_get_value (eclass, val)) != NULL)
+ {
+ if (val == 0)
+ glade_widget_property_reset (gwidget, "stock");
+ else
+ glade_widget_property_set (gwidget, "stock", eval->value_nick);
+
+ }
+ g_type_class_unref (eclass);
+}
+
+void GLADEGTK_API
+glade_gtk_image_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "glade-type"))
+ glade_gtk_image_set_type (object, value);
+ else if (!strcmp (id, "stock"))
+ glade_gtk_image_set_stock (object, value);
+ else if (!strcmp (id, "glade-stock"))
+ glade_gtk_image_set_glade_stock (object, value);
+ else if (!strcmp (id, "icon-name"))
+ glade_gtk_image_set_icon_name (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_WIDGET)->set_property (adaptor, object,
+ id, value);
+}
+
+/* ----------------------------- GtkMenuShell ------------------------------ */
+void GLADEGTK_API
+glade_gtk_menu_shell_add_item (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+
+ g_return_if_fail (GTK_IS_MENU_SHELL (object));
+ g_return_if_fail (GTK_IS_MENU_ITEM (child));
+
+ gtk_menu_shell_append (GTK_MENU_SHELL (object), GTK_WIDGET (child));
+}
+
+
+void GLADEGTK_API
+glade_gtk_menu_shell_remove_item (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ g_return_if_fail (GTK_IS_MENU_SHELL (object));
+ g_return_if_fail (GTK_IS_MENU_ITEM (child));
+
+ gtk_container_remove (GTK_CONTAINER (object), GTK_WIDGET (child));
+}
+
+static gint
+glade_gtk_menu_shell_get_item_position (GObject *container, GObject *child)
+{
+ gint position = 0;
+ GList *list = GTK_MENU_SHELL (container)->children;
+
+ while (list)
+ {
+ if (G_OBJECT (list->data) == child) break;
+
+ list = list->next;
+ position++;
+ }
+
+ return position;
+}
+
+void GLADEGTK_API
+glade_gtk_menu_shell_get_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ g_return_if_fail (GTK_IS_MENU_SHELL (container));
+ g_return_if_fail (GTK_IS_MENU_ITEM (child));
+
+ if (strcmp (property_name, "position") == 0)
+ {
+ g_value_set_int (value,
+ glade_gtk_menu_shell_get_item_position (container,
+ child));
+ }
+ else
+ /* Chain Up */
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->child_get_property (adaptor,
+ container,
+ child,
+ property_name,
+ value);
+}
+
+void GLADEGTK_API
+glade_gtk_menu_shell_set_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ g_return_if_fail (GTK_IS_MENU_SHELL (container));
+ g_return_if_fail (GTK_IS_MENU_ITEM (child));
+ g_return_if_fail (property_name != NULL || value != NULL);
+
+ if (strcmp (property_name, "position") == 0)
+ {
+ GladeWidget *gitem;
+ gint position;
+
+ gitem = glade_widget_get_from_gobject (child);
+ g_return_if_fail (GLADE_IS_WIDGET (gitem));
+
+ position = g_value_get_int (value);
+
+ if (position < 0)
+ {
+ position = glade_gtk_menu_shell_get_item_position (container, child);
+ g_value_set_int (value, position);
+ }
+
+ g_object_ref (child);
+ gtk_container_remove (GTK_CONTAINER (container), GTK_WIDGET (child));
+ gtk_menu_shell_insert (GTK_MENU_SHELL (container), GTK_WIDGET (child), position);
+ g_object_unref (child);
+
+ }
+ else
+ /* Chain Up */
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->child_set_property (adaptor,
+ container, child,
+ property_name, value);
+}
+
+static gchar *
+glade_gtk_menu_shell_get_display_name (GladeBaseEditor *editor,
+ GladeWidget *gchild,
+ gpointer user_data)
+{
+ GObject *child = glade_widget_get_object (gchild);
+ gchar *name;
+
+ if (GTK_IS_SEPARATOR_MENU_ITEM (child))
+ name = _("<separator>");
+ else
+ glade_widget_property_get (gchild, "label", &name);
+
+ return g_strdup (name);
+}
+
+static GladeWidget *
+glade_gtk_menu_shell_item_get_parent (GladeWidget *gparent, GObject *parent)
+{
+ GtkWidget *submenu;
+
+ if ((submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (parent))))
+ gparent = glade_widget_get_from_gobject (submenu);
+ else
+ gparent = glade_command_create (glade_widget_adaptor_get_by_type (GTK_TYPE_MENU),
+ gparent, NULL, glade_widget_get_project (gparent));
+ return gparent;
+}
+
+static GladeWidget *
+glade_gtk_menu_shell_build_child (GladeBaseEditor *editor,
+ GladeWidget *gparent,
+ GType type,
+ gpointer data)
+{
+ GObject *parent = glade_widget_get_object (gparent);
+ GladeWidget *gitem_new;
+
+ if (GTK_IS_SEPARATOR_MENU_ITEM (parent))
+ return NULL;
+
+ /* Get or build real parent */
+ if (GTK_IS_MENU_ITEM (parent))
+ gparent = glade_gtk_menu_shell_item_get_parent (gparent, parent);
+
+ /* Build child */
+ gitem_new = glade_command_create (glade_widget_adaptor_get_by_type (type),
+ gparent, NULL,
+ glade_widget_get_project (gparent));
+
+ if (type != GTK_TYPE_SEPARATOR_MENU_ITEM)
+ {
+ glade_widget_property_set (gitem_new, "label",
+ glade_widget_get_name (gitem_new));
+ glade_widget_property_set (gitem_new, "use-underline", TRUE);
+ }
+
+ return gitem_new;
+}
+
+static gboolean
+glade_gtk_menu_shell_delete_child (GladeBaseEditor *editor,
+ GladeWidget *gparent,
+ GladeWidget *gchild,
+ gpointer data)
+{
+ GObject *item = glade_widget_get_object (gparent);
+ GtkWidget *submenu = NULL;
+ GList list = {0, };
+ gint n_children;
+
+ if (GTK_IS_MENU_ITEM (item) &&
+ (submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (item))))
+ {
+ GList *l = gtk_container_get_children (GTK_CONTAINER (submenu));
+ n_children = g_list_length (l);
+ g_list_free (l);
+ }
+
+ if (submenu && n_children == 1)
+ list.data = glade_widget_get_parent (gchild);
+ else
+ list.data = gchild;
+
+ /* Remove widget */
+ glade_command_delete (&list);
+
+ return TRUE;
+}
+
+static gboolean
+glade_gtk_menu_shell_move_child (GladeBaseEditor *editor,
+ GladeWidget *gparent,
+ GladeWidget *gchild,
+ gpointer data)
+{
+ GObject *parent = glade_widget_get_object (gparent);
+ GList list = {0, };
+
+ if (GTK_IS_SEPARATOR_MENU_ITEM (parent)) return FALSE;
+
+ if (GTK_IS_MENU_ITEM (parent))
+ gparent = glade_gtk_menu_shell_item_get_parent (gparent, parent);
+
+ if (gparent != glade_widget_get_parent (gchild))
+ {
+ list.data = gchild;
+ glade_command_dnd (&list, gparent, NULL);
+ }
+
+ return TRUE;
+}
+
+static gboolean
+glade_gtk_menu_shell_change_type (GladeBaseEditor *editor,
+ GladeWidget *gchild,
+ GType type,
+ gpointer data)
+{
+ GObject *child = glade_widget_get_object (gchild);
+
+ if (type == GTK_TYPE_SEPARATOR_MENU_ITEM &&
+ gtk_menu_item_get_submenu (GTK_MENU_ITEM (child)))
+ return TRUE;
+
+ return FALSE;
+}
+
+static void
+glade_gtk_menu_shell_child_selected (GladeBaseEditor *editor,
+ GladeWidget *gchild,
+ gpointer data)
+{
+ GObject *child = glade_widget_get_object (gchild);
+ GType type = G_OBJECT_TYPE (child);
+
+ glade_base_editor_add_label (editor, "Menu Item");
+
+ glade_base_editor_add_default_properties (editor, gchild);
+
+ if (GTK_IS_SEPARATOR_MENU_ITEM (child)) return;
+
+ glade_base_editor_add_label (editor, "Properties");
+
+ glade_base_editor_add_properties (editor, gchild, "label", "tooltip", NULL);
+
+ if (type == GTK_TYPE_IMAGE_MENU_ITEM)
+ {
+ GtkWidget *image;
+ GladeWidget *internal;
+
+ glade_base_editor_add_properties (editor, gchild, "stock", NULL);
+
+ if ((image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (child))))
+ {
+ if ((internal = glade_widget_get_from_gobject (image)) &&
+ internal->internal)
+ {
+ glade_base_editor_add_label
+ (editor, "Internal Image Properties");
+ glade_base_editor_add_properties
+ (editor, internal, "glade-type", "pixbuf",
+ "glade-stock", "icon-name", NULL);
+ }
+ }
+ }
+ else if (type == GTK_TYPE_CHECK_MENU_ITEM)
+ glade_base_editor_add_properties (editor, gchild,
+ "active", "draw-as-radio",
+ "inconsistent", NULL);
+ else if (type == GTK_TYPE_RADIO_MENU_ITEM)
+ glade_base_editor_add_properties (editor, gchild,
+ "active", "group", NULL);
+}
+
+static void
+glade_gtk_menu_shell_launch_editor (GObject *object, gchar *title)
+{
+ GladeBaseEditor *editor;
+ GtkWidget *window;
+
+ /* Editor */
+ editor = glade_base_editor_new (object, TRUE,
+ _("Normal"), GTK_TYPE_MENU_ITEM,
+ _("Image"), GTK_TYPE_IMAGE_MENU_ITEM,
+ _("Check"), GTK_TYPE_CHECK_MENU_ITEM,
+ _("Radio"), GTK_TYPE_RADIO_MENU_ITEM,
+ _("Separator"), GTK_TYPE_SEPARATOR_MENU_ITEM,
+ NULL);
+
+ glade_base_editor_add_popup_items (editor,
+ _("Add Item"), GTK_TYPE_MENU_ITEM, FALSE,
+ _("Add Child Item"), GTK_TYPE_MENU_ITEM, TRUE,
+ _("Add Separator"), GTK_TYPE_SEPARATOR_MENU_ITEM, FALSE,
+ NULL);
+
+ g_signal_connect (editor, "get-display-name", G_CALLBACK (glade_gtk_menu_shell_get_display_name), NULL);
+ g_signal_connect (editor, "child-selected", G_CALLBACK (glade_gtk_menu_shell_child_selected), NULL);
+ g_signal_connect (editor, "change-type", G_CALLBACK (glade_gtk_menu_shell_change_type), NULL);
+ g_signal_connect (editor, "build-child", G_CALLBACK (glade_gtk_menu_shell_build_child), NULL);
+ g_signal_connect (editor, "delete-child", G_CALLBACK (glade_gtk_menu_shell_delete_child), NULL);
+ g_signal_connect (editor, "move-child", G_CALLBACK (glade_gtk_menu_shell_move_child), NULL);
+
+ gtk_widget_show (GTK_WIDGET (editor));
+
+ window = glade_base_editor_pack_new_window (editor, title,
+ _("<big><b>Tips:</b></big>\n"
+ " * Right click over the treeview to add items.\n"
+ " * Press Delete to remove the selected item.\n"
+ " * Drag &amp; Drop to reorder.\n"
+ " * Type column is editable."));
+ gtk_widget_show (window);
+}
+
+/* ----------------------------- GtkMenuItem(s) ------------------------------ */
+GList * GLADEGTK_API
+glade_gtk_menu_item_get_submenu (GladeWidgetAdaptor *adaptor,
+ GObject *object)
+{
+ GList *list = NULL;
+ GtkWidget *child;
+
+ g_return_val_if_fail (GTK_IS_MENU_ITEM (object), NULL);
+
+ child = gtk_menu_item_get_submenu (GTK_MENU_ITEM (object));
+
+ if (child) list = g_list_append (list, child);
+
+ return list;
+}
+
+void GLADEGTK_API
+glade_gtk_menu_item_add_submenu (GladeWidgetAdaptor *adaptor,
+ GObject *object, GObject *child)
+{
+ g_return_if_fail (GTK_IS_MENU_ITEM (object));
+ g_return_if_fail (GTK_IS_MENU (child));
+
+ if (GTK_IS_SEPARATOR_MENU_ITEM (object))
+ {
+ g_warning ("You shouldn't try to add a GtkMenu to a GtkSeparatorMenuItem");
+ return;
+ }
+
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (object), GTK_WIDGET (child));
+}
+
+void GLADEGTK_API
+glade_gtk_menu_item_remove_submenu (GladeWidgetAdaptor *adaptor,
+ GObject *object, GObject *child)
+{
+ g_return_if_fail (GTK_IS_MENU_ITEM (object));
+ g_return_if_fail (GTK_IS_MENU (child));
+
+ gtk_menu_item_remove_submenu (GTK_MENU_ITEM (object));
+}
+
+#define glade_return_if_re_entrancy(o,p,v) \
+ if ((v) == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (o), p))) return; g_object_set_data (G_OBJECT (o), p, GINT_TO_POINTER ((v)))
+
+void GLADEGTK_API
+glade_gtk_menu_item_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GladeWidget *gitem, *gimage;
+
+ g_return_if_fail (GTK_IS_MENU_ITEM (object));
+ gitem = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GLADE_IS_WIDGET (gitem));
+
+ if (GTK_IS_SEPARATOR_MENU_ITEM (object)) return;
+
+ if (gtk_bin_get_child (GTK_BIN (object)) == NULL)
+ {
+ GtkWidget *label = gtk_label_new ("");
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_container_add (GTK_CONTAINER (object), label);
+ }
+
+ if (GTK_IS_IMAGE_MENU_ITEM (object))
+ {
+ gboolean use_stock;
+
+ glade_widget_property_get (gitem, "use-stock", &use_stock);
+ if (use_stock)
+ {
+ GEnumClass *eclass;
+ GEnumValue *eval;
+ gchar *label;
+
+ glade_widget_property_get (gitem, "label", &label);
+
+ eclass = g_type_class_ref (GLADE_TYPE_STOCK);
+ eval = g_enum_get_value_by_nick (eclass, label);
+ if (eval)
+ glade_widget_property_set(gitem, "stock", eval->value);
+
+ glade_widget_property_set (gitem, "use-underline", TRUE);
+ }
+ else
+ {
+ if (reason == GLADE_CREATE_USER)
+ {
+ GtkWidget *image = gtk_image_new ();
+
+ gimage = glade_widget_adaptor_create_internal
+ (gitem, G_OBJECT (image),
+ "image", "menu-item", FALSE, reason);
+ gtk_image_menu_item_set_image
+ (GTK_IMAGE_MENU_ITEM (object), image);
+ }
+ }
+ }
+}
+
+static void
+glade_gtk_menu_item_set_label (GObject *object, const GValue *value)
+{
+ GladeWidget *gitem;
+ GtkWidget *label;
+ gboolean use_underline, use_stock;
+ const gchar *label_str, *last_label_str;
+
+ g_return_if_fail (GTK_IS_MENU_ITEM (object));
+ gitem = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GLADE_IS_WIDGET (gitem));
+
+ if (GTK_IS_SEPARATOR_MENU_ITEM (object)) return;
+
+ label_str = g_value_get_string (value);
+
+ last_label_str = g_object_get_data (G_OBJECT (gitem), "label");
+ if (last_label_str)
+ if (strcmp(label_str, last_label_str) == 0) return;
+ g_object_set_data_full (G_OBJECT (gitem), "label", g_strdup(label_str), g_free);
+
+ if (GTK_IS_IMAGE_MENU_ITEM (object))
+ {
+ glade_widget_property_get (gitem, "use-stock", &use_stock);
+
+ if (use_stock)
+ {
+ GtkWidget *image;
+ GEnumClass *eclass;
+ GEnumValue *eval;
+
+ eclass = g_type_class_ref (GLADE_TYPE_STOCK);
+ eval = g_enum_get_value_by_nick (eclass, label_str);
+
+ if (eval)
+ {
+ label_str = eval->value_name;
+
+ image = gtk_image_new_from_stock (eval->value_nick, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (object), image);
+ }
+
+ g_type_class_unref (eclass);
+ }
+ }
+
+ label = gtk_bin_get_child (GTK_BIN (object));
+ gtk_label_set_text (GTK_LABEL (label), label_str);
+
+ glade_widget_property_get (gitem, "use-underline", &use_underline);
+ gtk_label_set_use_underline (GTK_LABEL (label), use_underline);
+}
+
+static void
+glade_gtk_menu_item_set_use_underline (GObject *object, const GValue *value)
+{
+ GtkMenuItem *item;
+ GtkWidget *label;
+
+ g_return_if_fail (GTK_IS_MENU_ITEM (object));
+
+ item = GTK_MENU_ITEM (object);
+
+ if (GTK_IS_SEPARATOR_MENU_ITEM (item)) return;
+
+ label = gtk_bin_get_child (GTK_BIN (item));
+
+ gtk_label_set_use_underline (GTK_LABEL (label), g_value_get_boolean (value));
+}
+
+GObject * GLADEGTK_API
+glade_gtk_image_menu_item_get_internal_child (GladeWidgetAdaptor *adaptor,
+ GObject *parent,
+ const gchar *name);
+
+static void
+glade_gtk_menu_item_set_stock_item (GObject *object, const GValue *value)
+{
+ GladeWidget *gitem, *gimage;
+ GEnumClass *eclass;
+ GEnumValue *eval;
+ gint val;
+ gchar *label, *icon;
+ GObject *image;
+ gboolean is_image_item;
+
+ g_return_if_fail (GTK_IS_MENU_ITEM (object));
+
+ if ((val = g_value_get_enum (value)) == GNOMEUIINFO_MENU_NONE)
+ return;
+
+ eclass = g_type_class_ref (G_VALUE_TYPE (value));
+ if ((eval = g_enum_get_value (eclass, val)) == NULL)
+ {
+ g_type_class_unref (eclass);
+ return;
+ }
+
+ g_type_class_unref (eclass);
+
+ /* set use-underline */
+ gitem = glade_widget_get_from_gobject (object);
+ glade_widget_property_set (gitem, "use-underline", TRUE);
+
+ is_image_item = GTK_IS_IMAGE_MENU_ITEM (object);
+
+ /* If tts a GtkImageMenuItem */
+ if (is_image_item && eval->value_nick)
+ {
+ glade_widget_property_set (gitem, "use-stock", TRUE);
+ glade_widget_property_set (gitem, "label", eval->value_nick);
+ return;
+ }
+
+ icon = NULL;
+ switch (val)
+ {
+ case GNOMEUIINFO_MENU_PRINT_SETUP_ITEM:
+ icon = "gtk-print";
+ label = _("Print S_etup");
+ break;
+ case GNOMEUIINFO_MENU_FIND_AGAIN_ITEM:
+ icon = "gtk-find";
+ label = _("Find Ne_xt");
+ break;
+ case GNOMEUIINFO_MENU_UNDO_MOVE_ITEM:
+ icon = "gtk-undo";
+ label = _("_Undo Move");
+ break;
+ case GNOMEUIINFO_MENU_REDO_MOVE_ITEM:
+ icon = "gtk-redo";
+ label = _("_Redo Move");
+ break;
+ case GNOMEUIINFO_MENU_SELECT_ALL_ITEM:
+ label = _("Select _All");
+ break;
+ case GNOMEUIINFO_MENU_NEW_GAME_ITEM:
+ label = _("_New Game");
+ break;
+ case GNOMEUIINFO_MENU_PAUSE_GAME_ITEM:
+ label = _("_Pause game");
+ break;
+ case GNOMEUIINFO_MENU_RESTART_GAME_ITEM:
+ label = _("_Restart Game");
+ break;
+ case GNOMEUIINFO_MENU_HINT_ITEM:
+ label = _("_Hint");
+ break;
+ case GNOMEUIINFO_MENU_SCORES_ITEM:
+ label = _("_Scores...");
+ break;
+ case GNOMEUIINFO_MENU_END_GAME_ITEM:
+ label = _("_End Game");
+ break;
+ case GNOMEUIINFO_MENU_NEW_WINDOW_ITEM:
+ label = _("Create New _Window");
+ break;
+ case GNOMEUIINFO_MENU_CLOSE_WINDOW_ITEM:
+ label = _("_Close This Window");
+ break;
+ case GNOMEUIINFO_MENU_FILE_TREE:
+ label = _("_File");
+ break;
+ case GNOMEUIINFO_MENU_EDIT_TREE:
+ label = _("_Edit");
+ break;
+ case GNOMEUIINFO_MENU_VIEW_TREE:
+ label = _("_View");
+ break;
+ case GNOMEUIINFO_MENU_SETTINGS_TREE:
+ label = _("_Settings");
+ break;
+ case GNOMEUIINFO_MENU_FILES_TREE:
+ label = _("Fi_les");
+ break;
+ case GNOMEUIINFO_MENU_WINDOWS_TREE:
+ label = _("_Windows");
+ break;
+ case GNOMEUIINFO_MENU_HELP_TREE:
+ label = _("_Help");
+ break;
+ case GNOMEUIINFO_MENU_GAME_TREE:
+ label = _("_Game");
+ break;
+ default:
+ return;
+ break;
+ }
+
+ if (is_image_item && icon)
+ {
+ eclass = g_type_class_ref (GLADE_TYPE_STOCK);
+ eval = g_enum_get_value_by_nick (eclass, icon);
+ g_type_class_unref (eclass);
+
+ image = glade_gtk_image_menu_item_get_internal_child
+ (gitem->adaptor, object, "image");
+
+ gimage = glade_widget_get_from_gobject (image);
+ glade_widget_property_set (gimage, "icon-size", GTK_ICON_SIZE_MENU);
+ glade_widget_property_set (gimage, "glade-stock", eval->value);
+ }
+
+ glade_widget_property_set (gitem, "label", label);
+}
+
+void GLADEGTK_API
+glade_gtk_menu_item_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "use-underline"))
+ glade_gtk_menu_item_set_use_underline (object, value);
+ else if (!strcmp (id, "label"))
+ glade_gtk_menu_item_set_label (object, value);
+ else if (!strcmp (id, "stock-item"))
+ glade_gtk_menu_item_set_stock_item (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor, object,
+ id, value);
+}
+
+GObject * GLADEGTK_API
+glade_gtk_image_menu_item_get_internal_child (GladeWidgetAdaptor *adaptor,
+ GObject *parent,
+ const gchar *name)
+{
+ GtkWidget *image;
+ GObject *child = NULL;
+
+ if (GTK_IS_IMAGE_MENU_ITEM (parent) && strcmp (name, "image") == 0)
+ {
+ image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (parent));
+ if (image == NULL)
+ {
+ GladeWidget *gitem, *gimage;
+
+ gitem = glade_widget_get_from_gobject (parent);
+ image = gtk_image_new ();
+
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (parent), image);
+
+ gimage = glade_widget_adaptor_create_internal
+ (gitem, G_OBJECT (image), "image", "menu-item",
+ FALSE, GLADE_CREATE_LOAD);
+ }
+ child = G_OBJECT (image);
+ }
+
+ return child;
+}
+
+static void
+glade_gtk_image_menu_item_set_use_stock (GObject *object, const GValue *value)
+{
+ GladeWidget *gitem, *gimage;
+ gboolean use_stock;
+ GtkWidget *image;
+
+ g_return_if_fail (GTK_IS_IMAGE_MENU_ITEM (object));
+ gitem = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GLADE_IS_WIDGET (gitem));
+
+ use_stock = g_value_get_boolean (value);
+
+ glade_return_if_re_entrancy (gitem, "use-stock", use_stock);
+
+ if ((image = gtk_image_menu_item_get_image (GTK_IMAGE_MENU_ITEM (object))))
+ if(glade_widget_get_from_gobject (G_OBJECT(image)))
+ {
+ glade_project_remove_object (glade_widget_get_project (gitem), G_OBJECT(image));
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (object), NULL);
+ }
+
+ if (use_stock)
+ {
+ glade_widget_property_set_sensitive (gitem, "label", FALSE,
+ _("This does not apply with stock items"));
+ }
+ else
+ {
+ image = gtk_image_new ();
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (object), image);
+ gimage = glade_widget_adaptor_create_internal
+ (gitem, G_OBJECT (image), "image", "menu-item", FALSE,
+ GLADE_CREATE_LOAD);
+ glade_project_add_object (glade_widget_get_project (gitem),
+ NULL, G_OBJECT (image));
+
+ glade_widget_property_set_sensitive (gitem, "label", TRUE, NULL);
+ }
+}
+
+static void
+glade_gtk_image_menu_item_set_stock (GObject *object, const GValue *value)
+{
+ GladeWidget *gitem;
+ GEnumClass *eclass;
+ GEnumValue *eval;
+ gint val;
+
+ g_return_if_fail (GTK_IS_IMAGE_MENU_ITEM (object));
+ gitem = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GLADE_IS_WIDGET (gitem));
+
+ val = g_value_get_enum (value);
+
+ glade_return_if_re_entrancy (gitem, "stock", val);
+
+ glade_widget_property_set (gitem, "use-stock", val);
+
+ eclass = g_type_class_ref (GLADE_TYPE_STOCK);
+ eval = g_enum_get_value (eclass, val);
+ if (eval && val)
+ glade_widget_property_set (gitem, "label", eval->value_nick);
+
+ g_type_class_unref (eclass);
+}
+
+void GLADEGTK_API
+glade_gtk_image_menu_item_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "stock"))
+ glade_gtk_image_menu_item_set_stock (object, value);
+ else if (!strcmp (id, "use-stock"))
+ glade_gtk_image_menu_item_set_use_stock (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_MENU_ITEM)->set_property (adaptor, object,
+ id, value);
+}
+
+static void
+glade_gtk_radio_menu_item_set_group (GObject *object, const GValue *value)
+{
+ GObject *val;
+
+ g_return_if_fail (GTK_IS_RADIO_MENU_ITEM (object));
+
+ if ((val = g_value_get_object (value)))
+ {
+ GSList *group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (val));
+
+ if (! g_slist_find (group, GTK_RADIO_MENU_ITEM (object)))
+ gtk_radio_menu_item_set_group (GTK_RADIO_MENU_ITEM (object), group);
+ }
+}
+
+void GLADEGTK_API
+glade_gtk_radio_menu_item_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+
+ if (!strcmp (id, "group"))
+ glade_gtk_radio_menu_item_set_group (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_MENU_ITEM)->set_property (adaptor, object,
+ id, value);
+}
+
+
+/* ----------------------------- GtkMenuBar ------------------------------ */
+static GladeWidget *
+glade_gtk_menu_bar_append_new_submenu (GladeWidget *parent, GladeProject *project)
+{
+ static GladeWidgetAdaptor *submenu_adaptor = NULL;
+ GladeWidget *gsubmenu;
+
+ if (submenu_adaptor == NULL)
+ submenu_adaptor = glade_widget_adaptor_get_by_type (GTK_TYPE_MENU);
+
+ gsubmenu = glade_widget_adaptor_create_widget (submenu_adaptor, FALSE,
+ "parent", parent,
+ "project", project,
+ NULL);
+
+ glade_widget_add_child (parent, gsubmenu, FALSE);
+
+ return gsubmenu;
+}
+
+static GladeWidget *
+glade_gtk_menu_bar_append_new_item (GladeWidget *parent,
+ GladeProject *project,
+ const gchar *label,
+ gboolean use_stock)
+{
+ static GladeWidgetAdaptor *item_adaptor = NULL, *image_item_adaptor, *separator_adaptor;
+ GladeWidget *gitem;
+
+ if (item_adaptor == NULL)
+ {
+ item_adaptor = glade_widget_adaptor_get_by_type (GTK_TYPE_MENU_ITEM);
+ image_item_adaptor = glade_widget_adaptor_get_by_type (GTK_TYPE_IMAGE_MENU_ITEM);
+ separator_adaptor = glade_widget_adaptor_get_by_type (GTK_TYPE_SEPARATOR_MENU_ITEM);
+ }
+
+ if (label)
+ {
+ gitem = glade_widget_adaptor_create_widget ((use_stock) ? image_item_adaptor : item_adaptor,
+ FALSE, "parent", parent,
+ "project", project,
+ NULL);
+
+ glade_widget_property_set (gitem, "use-underline", TRUE);
+
+ if (use_stock)
+ {
+ GEnumClass *eclass;
+ GEnumValue *eval;
+
+ eclass = g_type_class_ref (GLADE_TYPE_STOCK);
+ eval = g_enum_get_value_by_nick (eclass, label);
+
+ if (eval)
+ glade_widget_property_set (gitem, "stock", eval->value);
+
+ g_type_class_unref (eclass);
+ }
+ else
+ {
+ glade_widget_property_set (gitem, "label", label);
+ }
+ }
+ else
+ {
+ gitem = glade_widget_adaptor_create_widget (separator_adaptor,
+ FALSE, "parent", parent,
+ "project", project,
+ NULL);
+ }
+
+ glade_widget_add_child (parent, gitem, FALSE);
+
+ return gitem;
+}
+
+void GLADEGTK_API
+glade_gtk_menu_bar_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GladeProject *project;
+ GladeWidget *gmenubar, *gitem, *gsubmenu;
+
+ if (reason != GLADE_CREATE_USER) return;
+
+ g_return_if_fail (GTK_IS_MENU_BAR (object));
+ gmenubar = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GLADE_IS_WIDGET (gmenubar));
+
+ project = glade_widget_get_project (gmenubar);
+
+ /* File */
+ gitem = glade_gtk_menu_bar_append_new_item (gmenubar, project, _("_File"), FALSE);
+ gsubmenu = glade_gtk_menu_bar_append_new_submenu (gitem, project);
+ glade_gtk_menu_bar_append_new_item (gsubmenu, project, "gtk-new", TRUE);
+ glade_gtk_menu_bar_append_new_item (gsubmenu, project, "gtk-open", TRUE);
+ glade_gtk_menu_bar_append_new_item (gsubmenu, project, "gtk-save", TRUE);
+ glade_gtk_menu_bar_append_new_item (gsubmenu, project, "gtk-save-as", TRUE);
+ glade_gtk_menu_bar_append_new_item (gsubmenu, project, NULL, FALSE);
+ glade_gtk_menu_bar_append_new_item (gsubmenu, project, "gtk-quit", TRUE);
+
+ /* Edit */
+ gitem = glade_gtk_menu_bar_append_new_item (gmenubar, project, _("_Edit"), FALSE);
+ gsubmenu = glade_gtk_menu_bar_append_new_submenu (gitem, project);
+ glade_gtk_menu_bar_append_new_item (gsubmenu, project, "gtk-cut", TRUE);
+ glade_gtk_menu_bar_append_new_item (gsubmenu, project, "gtk-copy", TRUE);
+ glade_gtk_menu_bar_append_new_item (gsubmenu, project, "gtk-paste", TRUE);
+ glade_gtk_menu_bar_append_new_item (gsubmenu, project, "gtk-delete", TRUE);
+
+ /* View */
+ gitem = glade_gtk_menu_bar_append_new_item (gmenubar, project, _("_View"), FALSE);
+
+ /* Help */
+ gitem = glade_gtk_menu_bar_append_new_item (gmenubar, project, _("_Help"), FALSE);
+ gsubmenu = glade_gtk_menu_bar_append_new_submenu (gitem, project);
+ glade_gtk_menu_bar_append_new_item (gsubmenu, project, "gtk-about", TRUE);
+}
+
+void GLADEGTK_API
+glade_gtk_menu_bar_launch_editor (GladeWidgetAdaptor *adaptor, GObject *menubar)
+{
+ glade_gtk_menu_shell_launch_editor (menubar, _("Menu Bar Editor"));
+}
+
+/* ------------------------------ GtkMenu -------------------------------- */
+void GLADEGTK_API
+glade_gtk_menu_launch_editor (GladeWidgetAdaptor *adaptor, GObject *menu)
+{
+ glade_gtk_menu_shell_launch_editor (menu, _("Menu Editor"));
+}
+
+/* ----------------------------- GtkToolBar ------------------------------ */
+void GLADEGTK_API
+glade_gtk_toolbar_get_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ g_return_if_fail (GTK_IS_TOOLBAR (container));
+ if (GTK_IS_TOOL_ITEM (child) == FALSE) return;
+
+ if (strcmp (property_name, "position") == 0)
+ {
+ g_value_set_int (value,
+ gtk_toolbar_get_item_index (GTK_TOOLBAR (container),
+ GTK_TOOL_ITEM (child)));
+ }
+ else
+ /* Chain Up */
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->child_get_property (adaptor,
+ container, child,
+ property_name, value);
+}
+
+void GLADEGTK_API
+glade_gtk_toolbar_set_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ g_return_if_fail (GTK_IS_TOOLBAR (container));
+ g_return_if_fail (GTK_IS_TOOL_ITEM (child));
+
+ g_return_if_fail (property_name != NULL || value != NULL);
+
+ if (strcmp (property_name, "position") == 0)
+ {
+ GtkToolbar *toolbar = GTK_TOOLBAR (container);
+ gint position, size;
+
+ position = g_value_get_int (value);
+ size = gtk_toolbar_get_n_items (toolbar);
+
+ if (position >= size) position = size - 1;
+
+ g_object_ref (child);
+ gtk_container_remove (GTK_CONTAINER (container), GTK_WIDGET (child));
+ gtk_toolbar_insert (toolbar, GTK_TOOL_ITEM (child), position);
+ g_object_unref (child);
+ }
+ else
+ /* Chain Up */
+ GWA_GET_CLASS
+ (GTK_TYPE_CONTAINER)->child_set_property (adaptor,
+ container, child,
+ property_name, value);
+}
+
+void GLADEGTK_API
+glade_gtk_toolbar_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *object, GObject *child)
+{
+ GtkToolbar *toolbar;
+ GtkToolItem *item;
+
+ g_return_if_fail (GTK_IS_TOOLBAR (object));
+ g_return_if_fail (GTK_IS_TOOL_ITEM (child));
+
+ toolbar = GTK_TOOLBAR (object);
+ item = GTK_TOOL_ITEM (child);
+
+ gtk_toolbar_insert (toolbar, item, -1);
+
+ if (glade_util_object_is_loading (object))
+ {
+ GladeWidget *gchild = glade_widget_get_from_gobject (child);
+
+ /* Packing props arent around when parenting during a glade_widget_dup() */
+ if (gchild && gchild->packing_properties)
+ glade_widget_pack_property_set (gchild, "position",
+ gtk_toolbar_get_item_index (toolbar, item));
+ }
+}
+
+void GLADEGTK_API
+glade_gtk_toolbar_remove_child (GladeWidgetAdaptor *adaptor,
+ GObject *object, GObject *child)
+{
+ gtk_container_remove (GTK_CONTAINER (object), GTK_WIDGET (child));
+}
+
+static gchar *
+glade_gtk_toolbar_get_display_name (GladeBaseEditor *editor,
+ GladeWidget *gchild,
+ gpointer user_data)
+{
+ GObject *child = glade_widget_get_object (gchild);
+ gchar *name;
+
+ if (GTK_IS_SEPARATOR_TOOL_ITEM (child))
+ name = _("<separator>");
+ else
+ if (GTK_IS_TOOL_BUTTON (child))
+ {
+ glade_widget_property_get (gchild, "label", &name);
+ if (name == NULL || strlen (name) == 0)
+ glade_widget_property_get (gchild, "stock-id", &name);
+ }
+ else
+ name = _("<custom>");
+
+ return g_strdup (name);
+}
+
+static void
+glade_gtk_toolbar_child_selected (GladeBaseEditor *editor,
+ GladeWidget *gchild,
+ gpointer data)
+{
+ GObject *child = glade_widget_get_object (gchild);
+ GType type = G_OBJECT_TYPE (child);
+
+ glade_base_editor_add_label (editor, "Tool Item");
+
+ glade_base_editor_add_default_properties (editor, gchild);
+
+ glade_base_editor_add_label (editor, "Properties");
+
+ glade_base_editor_add_properties (editor, gchild,
+ "visible-horizontal",
+ "visible-vertical",
+ NULL);
+
+ if (type == GTK_TYPE_SEPARATOR_TOOL_ITEM) return;
+
+ if (GTK_IS_TOOL_BUTTON (child))
+ glade_base_editor_add_properties (editor, gchild,
+ "label",
+ "glade-type",
+ "icon",
+ "glade-stock",
+ "icon-name",
+ NULL);
+
+ if (type == GTK_TYPE_RADIO_TOOL_BUTTON)
+ glade_base_editor_add_properties (editor, gchild,
+ "group", "active", NULL);
+}
+
+void GLADEGTK_API
+glade_gtk_toolbar_launch_editor (GladeWidgetAdaptor *adaptor,
+ GObject *toolbar)
+{
+ GladeBaseEditor *editor;
+ GtkWidget *window;
+ /* Editor */
+ editor = glade_base_editor_new (toolbar, FALSE,
+ _("Button"), GTK_TYPE_TOOL_BUTTON,
+ _("Toggle"), GTK_TYPE_TOGGLE_TOOL_BUTTON,
+ _("Radio"), GTK_TYPE_RADIO_TOOL_BUTTON,
+ _("Menu"), GTK_TYPE_MENU_TOOL_BUTTON,
+ _("Item"), GTK_TYPE_TOOL_ITEM,
+ _("Separator"), GTK_TYPE_SEPARATOR_TOOL_ITEM,
+ NULL);
+
+ glade_base_editor_add_popup_items (editor,
+ _("Add Tool Button"), GTK_TYPE_TOOL_BUTTON, FALSE,
+ _("Add Toggle Button"), GTK_TYPE_TOGGLE_TOOL_BUTTON, FALSE,
+ _("Add Radio Button"), GTK_TYPE_RADIO_TOOL_BUTTON, FALSE,
+ _("Add Menu Button"), GTK_TYPE_MENU_TOOL_BUTTON, FALSE,
+ _("Add Tool Item"), GTK_TYPE_TOOL_ITEM, FALSE,
+ _("Add Separator"), GTK_TYPE_SEPARATOR_TOOL_ITEM, FALSE,
+ NULL);
+
+ g_signal_connect (editor, "get-display-name", G_CALLBACK (glade_gtk_toolbar_get_display_name), NULL);
+ g_signal_connect (editor, "child-selected", G_CALLBACK (glade_gtk_toolbar_child_selected), NULL);
+
+ gtk_widget_show (GTK_WIDGET (editor));
+
+ window = glade_base_editor_pack_new_window (editor, _("Tool Bar Editor"), NULL);
+ gtk_widget_show (window);
+}
+
+/* ----------------------------- GtkToolItem ------------------------------ */
+void GLADEGTK_API
+glade_gtk_tool_item_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ g_return_if_fail (GTK_IS_TOOL_ITEM (object));
+
+ if (GTK_IS_SEPARATOR_TOOL_ITEM (object)) return;
+
+ if (reason == GLADE_CREATE_USER &&
+ gtk_bin_get_child (GTK_BIN (object)) == NULL)
+ gtk_container_add (GTK_CONTAINER (object),
+ glade_placeholder_new ());
+}
+
+/* ----------------------------- GtkToolButton ------------------------------ */
+static void
+glade_gtk_tool_button_set_type (GObject *object, const GValue *value)
+{
+ GladeWidget *gbutton;
+
+ g_return_if_fail (GTK_IS_TOOL_BUTTON (object));
+ gbutton = glade_widget_get_from_gobject (object);
+
+ glade_widget_property_set_sensitive (gbutton, "icon", FALSE,
+ _("This only applies with file type images"));
+ glade_widget_property_set_sensitive (gbutton, "glade-stock", FALSE,
+ _("This only applies with stock type images"));
+ glade_widget_property_set_sensitive (gbutton, "icon-name", FALSE,
+ _("This only applies to Icon Theme type images"));
+
+ switch (g_value_get_enum (value))
+ {
+ case GLADEGTK_IMAGE_FILENAME:
+ glade_widget_property_set_sensitive (gbutton, "icon",
+ TRUE, NULL);
+ glade_widget_property_set (gbutton, "glade-stock", NULL);
+ glade_widget_property_set (gbutton, "icon-name", NULL);
+ break;
+ case GLADEGTK_IMAGE_STOCK:
+ glade_widget_property_set_sensitive (gbutton, "glade-stock",
+ TRUE, NULL);
+ glade_widget_property_set (gbutton, "icon", NULL);
+ glade_widget_property_set (gbutton, "icon-name", NULL);
+ break;
+ case GLADEGTK_IMAGE_ICONTHEME:
+ glade_widget_property_set_sensitive (gbutton, "icon-name",
+ TRUE, NULL);
+ glade_widget_property_set (gbutton, "icon", NULL);
+ glade_widget_property_set (gbutton, "glade-stock", NULL);
+ break;
+ }
+}
+
+static void
+glade_gtk_tool_button_set_label (GObject *object, const GValue *value)
+{
+ const gchar *label;
+
+ g_return_if_fail (GTK_IS_TOOL_BUTTON (object));
+
+ label = g_value_get_string (value);
+
+ if (label && strlen (label) == 0) label = NULL;
+
+ gtk_tool_button_set_label (GTK_TOOL_BUTTON (object), label);
+}
+
+static void
+glade_gtk_tool_button_set_stock_id (GObject *object, const GValue *value)
+{
+ GladeWidget *gbutton;
+ GEnumClass *eclass;
+ GEnumValue *eval;
+ const gchar *stock_id;
+
+ g_return_if_fail (GTK_IS_TOOL_BUTTON (object));
+ gbutton = glade_widget_get_from_gobject (object);
+
+ if ((stock_id = g_value_get_string (value)))
+ {
+ eclass = g_type_class_ref (GLADE_TYPE_STOCK_IMAGE);
+
+ if ((eval = g_enum_get_value_by_nick (eclass, stock_id)) != NULL)
+ glade_widget_property_set (gbutton, "glade-stock", eval->value);
+ else
+ {
+ glade_widget_property_set (gbutton, "glade-stock",
+ "gtk-missing-image");
+ g_warning ("Invalid stock-id '%s' found in toolbutton", stock_id);
+ }
+
+ glade_widget_property_set (gbutton, "glade-type", GLADEGTK_IMAGE_STOCK);
+
+ g_type_class_unref (eclass);
+ }
+
+ if (stock_id && strlen (stock_id) == 0) stock_id = NULL;
+
+ gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON (object), stock_id);
+}
+
+static void
+glade_gtk_tool_button_set_glade_stock (GObject *object, const GValue *value)
+{
+ GladeWidget *gbutton;
+ GEnumClass *eclass;
+ GEnumValue *eval;
+ gint val;
+
+ g_return_if_fail (GTK_IS_TOOL_BUTTON (object));
+ gbutton = glade_widget_get_from_gobject (object);
+
+ val = g_value_get_enum (value);
+
+ if (val)
+ {
+ eclass = g_type_class_ref (GLADE_TYPE_STOCK_IMAGE);
+
+ if ((eval = g_enum_get_value (eclass, val)) != NULL)
+ glade_widget_property_set (gbutton, "stock-id", eval->value_nick);
+ else
+ {
+ glade_widget_property_set (gbutton, "stock-id", "gtk-missing-image");
+ g_warning ("Invalid glade stock id '%d' found in toolbutton", val);
+ }
+ g_type_class_unref (eclass);
+ }
+ else
+ glade_widget_property_set (gbutton, "stock-id", NULL);
+}
+
+static void
+glade_gtk_tool_button_set_icon (GObject *object, const GValue *value)
+{
+ GladeWidget *gbutton;
+ GObject *pixbuf;
+ GtkWidget *image = NULL;
+
+ g_return_if_fail (GTK_IS_TOOL_BUTTON (object));
+ gbutton = glade_widget_get_from_gobject (object);
+
+ if ((pixbuf = g_value_get_object (value)))
+ {
+ image = gtk_image_new_from_pixbuf (GDK_PIXBUF (pixbuf));
+ glade_widget_property_set (gbutton, "glade-type", GLADEGTK_IMAGE_FILENAME);
+ }
+
+ gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (object), image);
+}
+
+static void
+glade_gtk_tool_button_set_icon_name (GObject *object, const GValue *value)
+{
+ GladeWidget *gbutton;
+ const gchar *name;
+
+ g_return_if_fail (GTK_IS_TOOL_BUTTON (object));
+
+ if ((name = g_value_get_string (value)))
+ {
+ gbutton = glade_widget_get_from_gobject (object);
+ glade_widget_property_set (gbutton, "glade-type", GLADEGTK_IMAGE_ICONTHEME);
+ }
+
+ if (name && strlen (name) == 0) name = NULL;
+
+ gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (object), name);
+}
+
+void GLADEGTK_API
+glade_gtk_tool_button_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "glade-type"))
+ glade_gtk_tool_button_set_type (object, value);
+ else if (!strcmp (id, "glade-stock"))
+ glade_gtk_tool_button_set_glade_stock (object, value);
+ else if (!strcmp (id, "icon-name"))
+ glade_gtk_tool_button_set_icon_name (object, value);
+ else if (!strcmp (id, "icon"))
+ glade_gtk_tool_button_set_icon (object, value);
+ else if (!strcmp (id, "stock-id"))
+ glade_gtk_tool_button_set_stock_id (object, value);
+ else if (!strcmp (id, "label"))
+ glade_gtk_tool_button_set_label (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_TOOL_ITEM)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+/* ----------------------------- GtkLabel ------------------------------ */
+static void
+glade_gtk_label_set_label (GObject *object, const GValue *value)
+{
+ GladeWidget *glabel;
+ gboolean use_markup = FALSE, use_underline = FALSE;
+
+ g_return_if_fail (GTK_IS_LABEL (object));
+ glabel = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GLADE_IS_WIDGET (glabel));
+
+ glade_widget_property_get (glabel, "use-markup", &use_markup);
+
+ if (use_markup)
+ gtk_label_set_markup (GTK_LABEL (object), g_value_get_string (value));
+ else
+ gtk_label_set_text (GTK_LABEL (object), g_value_get_string (value));
+
+ glade_widget_property_get (glabel, "use-underline", &use_underline);
+ if (use_underline)
+ gtk_label_set_use_underline (GTK_LABEL (object), use_underline);
+}
+
+void GLADEGTK_API
+glade_gtk_label_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "label"))
+ glade_gtk_label_set_label (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_WIDGET)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+/* ----------------------------- GtkTextView ------------------------------ */
+static void
+glade_gtk_text_view_changed (GtkTextBuffer *buffer, GladeWidget *gtext)
+{
+ const gchar *text_prop;
+ GladeProperty *prop;
+ gchar *text;
+
+ g_object_get (buffer, "text", &text, NULL);
+
+ glade_widget_property_get (gtext, "text", &text_prop);
+
+ if (strcmp (text, text_prop))
+ if ((prop = glade_widget_get_property (gtext, "text")))
+ glade_command_set_property (prop, text);
+
+ g_free (text);
+}
+
+static gboolean
+glade_gtk_text_view_stop_double_click (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer user_data)
+{
+ /* Return True if the event is double or triple click */
+ return (event->type == GDK_2BUTTON_PRESS ||
+ event->type == GDK_3BUTTON_PRESS);
+}
+
+void GLADEGTK_API
+glade_gtk_text_view_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GtkTextBuffer *buffy = gtk_text_buffer_new (NULL);
+ GladeWidget *gtext;
+
+ g_return_if_fail (GTK_IS_TEXT_VIEW (object));
+ gtext = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GLADE_IS_WIDGET (gtext));
+
+ gtk_text_view_set_buffer (GTK_TEXT_VIEW (object), buffy);
+ g_signal_connect (buffy, "changed",
+ G_CALLBACK (glade_gtk_text_view_changed),
+ gtext);
+
+ g_object_unref (G_OBJECT (buffy));
+
+ /* Glade3 hangs when a TextView gets a double click. So we stop them */
+ g_signal_connect (object, "button-press-event",
+ G_CALLBACK (glade_gtk_text_view_stop_double_click),
+ NULL);
+}
+
+static void
+glade_gtk_text_view_set_text (GObject *object, const GValue *value)
+{
+ GtkTextBuffer *buffy;
+ GladeWidget *gtext;
+ const gchar *text;
+
+ g_return_if_fail (GTK_IS_TEXT_VIEW (object));
+ gtext = glade_widget_get_from_gobject (object);
+ g_return_if_fail (GLADE_IS_WIDGET (gtext));
+
+ buffy = gtk_text_view_get_buffer (GTK_TEXT_VIEW (object));
+
+ if ((text = g_value_get_string (value)) == NULL) return;
+
+ g_signal_handlers_block_by_func (buffy, glade_gtk_text_view_changed, gtext);
+ gtk_text_buffer_set_text (buffy, text, -1);
+ g_signal_handlers_unblock_by_func (buffy, glade_gtk_text_view_changed, gtext);
+}
+
+void GLADEGTK_API
+glade_gtk_text_view_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "text"))
+ glade_gtk_text_view_set_text (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+
+/* ----------------------------- GtkComboBox ------------------------------ */
+void GLADEGTK_API
+glade_gtk_combo_box_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GtkCellRenderer *cell;
+ GtkListStore *store;
+
+ g_return_if_fail (GTK_IS_COMBO_BOX (object));
+
+ /* Add store */
+ store = gtk_list_store_new (1, G_TYPE_STRING);
+ gtk_combo_box_set_model (GTK_COMBO_BOX (object), GTK_TREE_MODEL (store));
+ g_object_unref (store);
+
+ /* Add cell renderer */
+ cell = gtk_cell_renderer_text_new ();
+ gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (object), cell, TRUE);
+ gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (object), cell,
+ "text", 0, NULL);
+}
+
+static void
+glade_gtk_combo_box_set_items (GObject *object, const GValue *value)
+{
+ GtkComboBox *combo;
+ gchar **split;
+ gint i;
+
+ g_return_if_fail (GTK_IS_COMBO_BOX (object));
+
+ combo = GTK_COMBO_BOX (object);
+
+ /* Empty the combo box */
+ gtk_list_store_clear (GTK_LIST_STORE (gtk_combo_box_get_model (combo)));
+
+ /* Refill the combo box */
+ split = g_value_get_boxed (value);
+
+ if (split)
+ for (i = 0; split[i] != NULL; i++)
+ if (split[i][0] != '\0')
+ gtk_combo_box_append_text (combo, split[i]);
+}
+
+void GLADEGTK_API
+glade_gtk_combo_box_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "items"))
+ glade_gtk_combo_box_set_items (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+/* ----------------------------- GtkComboBoxEntry ------------------------------ */
+void GLADEGTK_API
+glade_gtk_combo_box_entry_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GladeWidget *gcombo = glade_widget_get_from_gobject (object);
+
+ /* Chain up */
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->post_create (adaptor, object, reason);
+
+ glade_widget_adaptor_create_internal
+ (gcombo, G_OBJECT (GTK_BIN (object)->child),
+ "entry", "comboboxentry", FALSE, reason);
+}
+
+GObject * GLADEGTK_API
+glade_gtk_combo_box_entry_get_internal_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *name)
+{
+ GObject *child = NULL;
+ g_return_val_if_fail (GTK_IS_COMBO_BOX_ENTRY (object), NULL);
+
+ if (strcmp ("entry", name) == 0)
+ child = G_OBJECT (gtk_bin_get_child (GTK_BIN (object)));
+
+ return child;
+}
+
+/* ----------------------------- GtkSpinButton ------------------------------ */
+static void
+glade_gtk_spin_button_set_adjustment (GObject *object, const GValue *value)
+{
+ GObject *adjustment;
+ GtkAdjustment *adj;
+
+ g_return_if_fail (GTK_IS_SPIN_BUTTON (object));
+
+ adjustment = g_value_get_object (value);
+
+ if (adjustment && GTK_IS_ADJUSTMENT (adjustment))
+ {
+ adj = GTK_ADJUSTMENT (adjustment);
+ gtk_spin_button_set_adjustment (GTK_SPIN_BUTTON (object), adj);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (object), adj->value);
+ }
+}
+
+void GLADEGTK_API
+glade_gtk_spin_button_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "adjustment"))
+ glade_gtk_spin_button_set_adjustment (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_ENTRY)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+/* ----------------------------- GtkTreeView ------------------------------ */
+void GLADEGTK_API
+glade_gtk_tree_view_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GtkWidget *tree_view = GTK_WIDGET (object);
+ GtkTreeStore *store;
+ GtkCellRenderer *renderer;
+ GtkTreeViewColumn *column;
+
+ store = gtk_tree_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
+
+ gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (store));
+ g_object_unref (G_OBJECT (store));
+
+ renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes
+ ("Column 1", renderer, "text", 0, NULL);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
+
+ renderer = gtk_cell_renderer_text_new ();
+ column = gtk_tree_view_column_new_with_attributes
+ ("Column 2", renderer, "text", 1, NULL);
+ gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
+}
+
+
+/* ----------------------------- GtkCombo ------------------------------ */
+void GLADEGTK_API
+glade_gtk_combo_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GladeWidget *gcombo, *gentry, *glist;
+
+ g_return_if_fail (GTK_IS_COMBO (object));
+
+ if ((gcombo = glade_widget_get_from_gobject (object)) == NULL)
+ return;
+
+ gentry = glade_widget_adaptor_create_internal
+ (gcombo, G_OBJECT (GTK_COMBO (object)->entry),
+ "entry", "combo", FALSE, reason);
+
+ /* We mark this 'anarchist' since its outside of the hierarchy */
+ glist = glade_widget_adaptor_create_internal
+ (gcombo, G_OBJECT (GTK_COMBO (object)->list),
+ "list", "combo", TRUE, reason);
+
+}
+
+GObject * GLADEGTK_API
+glade_gtk_combo_get_internal_child (GladeWidgetAdaptor *adaptor,
+ GtkCombo *combo,
+ const gchar *name)
+{
+ GObject *child = NULL;
+
+ g_return_val_if_fail (GTK_IS_COMBO (combo), NULL);
+
+ if (strcmp ("list", name) == 0)
+ child = G_OBJECT (combo->list);
+ else if (strcmp ("entry", name) == 0)
+ child = G_OBJECT (combo->entry);
+
+ return child;
+}
+
+GList * GLADEGTK_API
+glade_gtk_combo_get_children (GtkCombo *combo)
+{
+ GList *list = NULL;
+
+ g_return_val_if_fail (GTK_IS_COMBO (combo), NULL);
+
+ list = glade_util_container_get_all_children (GTK_CONTAINER (combo));
+
+ /* Ensure that we only return one 'combo->list' */
+ if (g_list_find (list, combo->list) == NULL)
+ list = g_list_append (list, combo->list);
+
+ return list;
+}
+
+/* ----------------------------- GtkListItem ------------------------------ */
+void GLADEGTK_API
+glade_gtk_list_item_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GtkWidget *label;
+
+ g_return_if_fail (GTK_IS_LIST_ITEM (object));
+
+ label = gtk_label_new ("");
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_misc_set_padding (GTK_MISC (label), 0, 1);
+
+ gtk_container_add (GTK_CONTAINER (object), label);
+ gtk_widget_show (label);
+}
+
+static void
+glade_gtk_list_item_set_label (GObject *object, const GValue *value)
+{
+ GtkWidget *label;
+
+ g_return_if_fail (GTK_IS_LIST_ITEM (object));
+
+ label = GTK_BIN (object)->child;
+
+ gtk_label_set_text (GTK_LABEL (label), g_value_get_string (value));
+}
+
+static void
+glade_gtk_list_item_get_label (GObject *object, GValue *value)
+{
+ GtkWidget *label;
+
+ g_return_if_fail (GTK_IS_LIST_ITEM (object));
+
+ label = GTK_BIN (object)->child;
+
+ g_value_set_string (value, gtk_label_get_text (GTK_LABEL (label)));
+}
+
+void GLADEGTK_API
+glade_gtk_list_item_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ const GValue *value)
+{
+ if (!strcmp (id, "label"))
+ glade_gtk_list_item_set_label (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+void GLADEGTK_API
+glade_gtk_list_item_get_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *id,
+ GValue *value)
+{
+ if (!strcmp (id, "label"))
+ glade_gtk_list_item_get_label (object, value);
+ else
+ GWA_GET_CLASS (GTK_TYPE_CONTAINER)->set_property (adaptor,
+ object,
+ id, value);
+}
+
+
+void GLADEGTK_API
+glade_gtk_listitem_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ g_return_if_fail (GTK_IS_CONTAINER (object));
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ gtk_container_add (GTK_CONTAINER (object), GTK_WIDGET (child));
+}
+
+void GLADEGTK_API
+glade_gtk_listitem_remove_child (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GObject *child)
+{
+ g_return_if_fail (GTK_IS_CONTAINER (object));
+ g_return_if_fail (GTK_IS_WIDGET (child));
+
+ gtk_container_add (GTK_CONTAINER (object), GTK_WIDGET (child));
+}
+
+/* ------------------------------ GtkAssistant ------------------------------ */
+static void
+glade_gtk_assistant_append_new_page (GladeWidget *parent,
+ GladeProject *project,
+ const gchar *label,
+ GtkAssistantPageType type)
+{
+ static GladeWidgetAdaptor *adaptor = NULL;
+ GladeWidget *page;
+
+ if (adaptor == NULL)
+ adaptor = glade_widget_adaptor_get_by_type (GTK_TYPE_LABEL);
+
+ page = glade_widget_adaptor_create_widget (adaptor, FALSE,
+ "parent", parent,
+ "project", project,
+ NULL);
+
+ glade_widget_add_child (parent, page, FALSE);
+
+ glade_widget_property_set (page, "label", label);
+ glade_widget_pack_property_set (page, "page-type", type);
+}
+/*
+ GtkAssistant is a very weird widget, why is it derived from GtkWindow
+ instead of GtkNotebook I do not know!
+
+ If there is no GTK_ASSISTANT_PAGE_CONFIRM, GtkAssistant abort when trying to
+ update its navigation buttons!
+*/
+static void
+glade_gtk_assistant_update_page_type (GtkAssistant *assistant)
+{
+ gint i, current, pages;
+ GtkWidget *page;
+
+ current = gtk_assistant_get_current_page (assistant);
+ pages = gtk_assistant_get_n_pages (assistant) - 1;
+ if (pages < 0) return;
+
+ /* Last Page */
+ page = gtk_assistant_get_nth_page (assistant, pages);
+ gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONFIRM);
+
+ /* First page */
+ page = gtk_assistant_get_nth_page (assistant, 0);
+ gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_INTRO);
+
+ /* In betwen pages */
+ for (i = 1; i < pages; i++)
+ {
+ page = gtk_assistant_get_nth_page (assistant, i);
+ gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT);
+
+ }
+
+ /* Now we have set page-type in every page, force button update */
+ for (i = 0; i <= pages; i++)
+ {
+ page = gtk_assistant_get_nth_page (assistant, i);
+ gtk_assistant_set_page_complete (assistant, page, TRUE);
+ gtk_assistant_set_current_page (assistant, i);
+ gtk_assistant_update_buttons_state (assistant);
+ }
+
+ if (current >= 0) gtk_assistant_set_current_page (assistant, current);
+}
+
+static gint
+glade_gtk_assistant_get_page (GtkAssistant *assistant, GtkWidget *page)
+{
+ gint i, pages = gtk_assistant_get_n_pages (assistant);
+
+ for (i = 0; i < pages; i++)
+ if (gtk_assistant_get_nth_page (assistant, i) == page)
+ return i;
+
+ return -1;
+}
+
+static void
+glade_gtk_assistant_update_position (GtkAssistant *assistant)
+{
+ gint i, pages = gtk_assistant_get_n_pages (assistant);
+
+ for (i = 0; i < pages; i++)
+ {
+ GtkWidget *page = gtk_assistant_get_nth_page (assistant, i);
+ GladeWidget *gpage = glade_widget_get_from_gobject (G_OBJECT (page));
+ if (gpage) glade_widget_pack_property_set (gpage, "position", i);
+ }
+}
+
+static void
+glade_gtk_assistant_parse_finished (GladeProject *project,
+ GObject *object)
+{
+ GtkAssistant *assistant = GTK_ASSISTANT (object);
+ gint pages = gtk_assistant_get_n_pages (assistant);
+
+ if (pages)
+ {
+ gtk_assistant_set_current_page (assistant, 0);
+ glade_widget_property_set (glade_widget_get_from_gobject (object),
+ "size", pages);
+ }
+}
+
+void GLADEGTK_API
+glade_gtk_assistant_post_create (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ GladeCreateReason reason)
+{
+ GladeWidget *parent = glade_widget_get_from_gobject (object);
+ GladeProject *project = glade_widget_get_project (parent);
+
+ if (reason == GLADE_CREATE_LOAD)
+ {
+ g_signal_connect (project, "parse-finished",
+ G_CALLBACK (glade_gtk_assistant_parse_finished),
+ object);
+ return;
+ }
+
+ if (reason == GLADE_CREATE_USER)
+ {
+ glade_gtk_assistant_append_new_page (parent, project,
+ _("Introduction page"),
+ GTK_ASSISTANT_PAGE_INTRO);
+
+ glade_gtk_assistant_append_new_page (parent, project,
+ _("Content page"),
+ GTK_ASSISTANT_PAGE_CONTENT);
+
+ glade_gtk_assistant_append_new_page (parent, project,
+ _("Confirm page"),
+ GTK_ASSISTANT_PAGE_CONFIRM);
+
+ gtk_assistant_set_current_page (GTK_ASSISTANT (object), 0);
+
+ glade_widget_property_set (parent, "size", 3);
+ }
+
+ gtk_window_set_default_size (GTK_WINDOW (object), 440, 250);
+}
+
+void GLADEGTK_API
+glade_gtk_assistant_add_child (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child)
+{
+ GtkAssistant *assistant = GTK_ASSISTANT (container);
+ GtkWidget *widget = GTK_WIDGET (child);
+
+ gtk_assistant_append_page (assistant, widget);
+}
+
+void GLADEGTK_API
+glade_gtk_assistant_remove_child (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child)
+{
+ GtkAssistant *assistant = GTK_ASSISTANT (container);
+ GladeWidget *gassistant = glade_widget_get_from_gobject (container);
+
+ gtk_container_remove (GTK_CONTAINER (container), GTK_WIDGET (child));
+ glade_widget_property_set (gassistant, "size",
+ gtk_assistant_get_n_pages (assistant));
+}
+
+void GLADEGTK_API
+glade_gtk_assistant_replace_child (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *current,
+ GObject *new_object)
+{
+ GtkAssistant *assistant = GTK_ASSISTANT (container);
+ GtkWidget *page = GTK_WIDGET (new_object), *old_page = GTK_WIDGET (current);
+ gint pos = glade_gtk_assistant_get_page (assistant, old_page);
+ gboolean set_current = gtk_assistant_get_current_page (assistant) == pos;
+
+ gtk_container_remove (GTK_CONTAINER (container), old_page);
+
+ gtk_assistant_insert_page (assistant, page, pos);
+ glade_gtk_assistant_update_page_type (assistant);
+
+ if (set_current) gtk_assistant_set_current_page (assistant, pos);
+}
+
+gboolean GLADEGTK_API
+glade_gtk_assistant_verify_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *property_name,
+ const GValue *value)
+{
+ if (strcmp (property_name, "size") == 0)
+ return g_value_get_int (value) >
+ gtk_assistant_get_n_pages (GTK_ASSISTANT (object));
+
+ /* Chain Up */
+ if (GWA_GET_CLASS (GTK_TYPE_WINDOW)->verify_property == NULL)
+ return TRUE;
+ return GWA_GET_CLASS (GTK_TYPE_WINDOW)->verify_property (adaptor,
+ object,
+ property_name,
+ value);
+}
+
+void GLADEGTK_API
+glade_gtk_assistant_set_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *property_name,
+ const GValue *value)
+{
+ if (strcmp (property_name, "size") == 0)
+ {
+ GtkAssistant *assistant = GTK_ASSISTANT (object);
+ gint size, i;
+
+ for (i = gtk_assistant_get_n_pages (GTK_ASSISTANT (object)),
+ size = g_value_get_int (value); i < size; i++)
+ gtk_assistant_append_page (assistant, glade_placeholder_new ());
+
+ glade_gtk_assistant_update_page_type (assistant);
+
+ return;
+ }
+
+ /* Chain Up */
+ GWA_GET_CLASS (GTK_TYPE_WINDOW)->set_property (adaptor,
+ object,
+ property_name,
+ value);
+}
+
+void GLADEGTK_API
+glade_gtk_assistant_get_property (GladeWidgetAdaptor *adaptor,
+ GObject *object,
+ const gchar *property_name,
+ GValue *value)
+{
+ if (strcmp (property_name, "size") == 0)
+ {
+ g_value_set_int (value,
+ gtk_assistant_get_n_pages (GTK_ASSISTANT (object)));
+ return;
+ }
+
+ /* Chain Up */
+ GWA_GET_CLASS (GTK_TYPE_WINDOW)->get_property (adaptor,
+ object,
+ property_name,
+ value);
+}
+
+void GLADEGTK_API
+glade_gtk_assistant_set_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ const GValue *value)
+{
+ if (strcmp (property_name, "position") == 0)
+ {
+ GtkAssistant *assistant = GTK_ASSISTANT (container);
+ GtkWidget *widget = GTK_WIDGET (child);
+ gint pos, size;
+ gboolean set_current;
+
+ if ((pos = g_value_get_int (value)) < 0);
+ set_current = gtk_assistant_get_current_page (assistant) ==
+ glade_gtk_assistant_get_page (assistant, widget);
+
+ size = gtk_assistant_get_n_pages (assistant);
+
+ g_object_ref (child);
+ gtk_container_remove (GTK_CONTAINER (container), widget);
+ gtk_assistant_insert_page (assistant, widget, pos);
+ g_object_unref (child);
+
+ if (set_current) gtk_assistant_set_current_page (assistant, pos);
+
+ glade_gtk_assistant_update_page_type (assistant);
+
+ glade_gtk_assistant_update_position (assistant);
+
+ return;
+ }
+
+ /* Chain Up */
+ GWA_GET_CLASS (GTK_TYPE_WINDOW)->child_set_property (adaptor,
+ container,
+ child,
+ property_name,
+ value);
+}
+
+void GLADEGTK_API
+glade_gtk_assistant_get_child_property (GladeWidgetAdaptor *adaptor,
+ GObject *container,
+ GObject *child,
+ const gchar *property_name,
+ GValue *value)
+{
+ if (strcmp (property_name, "position") == 0)
+ {
+ gint pos;
+ pos = glade_gtk_assistant_get_page (GTK_ASSISTANT (container),
+ GTK_WIDGET (child));
+ if (pos >= 0) g_value_set_int (value, pos);
+ return;
+ }
+
+ /* Chain Up */
+ GWA_GET_CLASS (GTK_TYPE_WINDOW)->child_get_property (adaptor,
+ container,
+ child,
+ property_name,
+ value);
+}
diff --git a/plugins/gtk+/glade-gtk.h b/plugins/gtk+/glade-gtk.h
new file mode 100644
index 00000000..d5666cdc
--- /dev/null
+++ b/plugins/gtk+/glade-gtk.h
@@ -0,0 +1,31 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+#ifndef __GLADE_GTK_H__
+#define __GLADE_GTK_H__
+
+#include <glade.h>
+#include <glib-object.h>
+
+#ifdef G_OS_WIN32
+#define GLADEGTK_API __declspec(dllexport)
+#else
+#define GLADEGTK_API
+#endif
+
+/* Types */
+
+typedef enum {
+ GLADEGTK_IMAGE_FILENAME = 0,
+ GLADEGTK_IMAGE_STOCK,
+ GLADEGTK_IMAGE_ICONTHEME
+} GladeGtkImageType;
+
+typedef enum {
+ GLADEGTK_BUTTON_LABEL = 0,
+ GLADEGTK_BUTTON_STOCK,
+ GLADEGTK_BUTTON_CONTAINER
+} GladeGtkButtonType;
+
+GType GLADEGTK_API glade_gtk_image_type_get_type (void);
+GType GLADEGTK_API glade_gtk_button_type_get_type (void);
+
+#endif /* __GLADE_GTK_H__ */
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
new file mode 100644
index 00000000..7fdcca4b
--- /dev/null
+++ b/plugins/gtk+/gtk+.xml.in
@@ -0,0 +1,1418 @@
+<glade-catalog name="gtk+" library="gladegtk" domain="glade-3" book="gtk">
+ <glade-widget-classes>
+
+ <glade-widget-class name="GtkWidget" _title="Widget">
+
+ <set-property-function>glade_gtk_widget_set_property</set-property-function>
+ <get-property-function>glade_gtk_widget_get_property</get-property-function>
+
+ <properties>
+ <property id="visible" default="True" common="True" ignore="True"/>
+ <property id="width-request" common="True" optional="True" optional-default="False" default="0"/>
+ <property id="height-request" common="True" optional="True" optional-default="False" default="0"/>
+ <property id="no-show-all" weight="4.6" ignore="True"/>
+
+ <property common="True" id="tooltip" _name="Tooltip" default="" translatable="True" weight="4.5">
+ <spec>glade_standard_string_spec</spec>
+ <_tooltip>A tooltip text for this widget</_tooltip>
+ </property>
+
+ <property common="True" id="extension-events">
+ <displayable-values>
+ <value id="GDK_EXTENSION_EVENTS_NONE" _name="None"/>
+ <value id="GDK_EXTENSION_EVENTS_ALL" _name="All"/>
+ <value id="GDK_EXTENSION_EVENTS_CURSOR" _name="Cursor"/>
+ </displayable-values>
+ </property>
+
+ <property common="True" id="events" ignore="True">
+ <displayable-values>
+ <value id="GDK_EXPOSURE_MASK" _name="Exposure"/>
+ <value id="GDK_POINTER_MOTION_MASK" _name="Pointer Motion"/>
+ <value id="GDK_POINTER_MOTION_HINT_MASK" _name="Pointer Motion Hint"/>
+ <value id="GDK_BUTTON_MOTION_MASK" _name="Button Motion"/>
+ <value id="GDK_BUTTON1_MOTION_MASK" _name="Button 1 Motion"/>
+ <value id="GDK_BUTTON2_MOTION_MASK" _name="Button 2 Motion"/>
+ <value id="GDK_BUTTON3_MOTION_MASK" _name="Button 3 Motion"/>
+ <value id="GDK_BUTTON_PRESS_MASK" _name="Button Press"/>
+ <value id="GDK_BUTTON_RELEASE_MASK" _name="Button Release"/>
+ <value id="GDK_KEY_PRESS_MASK" _name="Key Press"/>
+ <value id="GDK_KEY_RELEASE_MASK" _name="Key Release"/>
+ <value id="GDK_ENTER_NOTIFY_MASK" _name="Enter Notify"/>
+ <value id="GDK_LEAVE_NOTIFY_MASK" _name="Leave Notify"/>
+ <value id="GDK_FOCUS_CHANGE_MASK" _name="Focus Change"/>
+ <value id="GDK_STRUCTURE_MASK" _name="Structure"/>
+ <value id="GDK_PROPERTY_CHANGE_MASK" _name="Property Change"/>
+ <value id="GDK_VISIBILITY_NOTIFY_MASK" _name="Visibility Notify"/>
+ <value id="GDK_PROXIMITY_IN_MASK" _name="Proximity In"/>
+ <value id="GDK_PROXIMITY_OUT_MASK" _name="Proximity Out"/>
+ <value id="GDK_SUBSTRUCTURE_MASK" _name="Substructure"/>
+ <value id="GDK_SCROLL_MASK" _name="Scroll"/>
+ <value id="GDK_ALL_EVENTS_MASK" _name="All Events"/>
+ </displayable-values>
+ </property>
+
+ <property id="name" disabled="True"/>
+ <property id="parent" disabled="True"/>
+ <property id="style" disabled="True"/>
+ <property id="sensitive" ignore="True"/>
+ <property id="has-default" ignore="True" common="True"/>
+
+
+ <!-- Atk name and description properties -->
+ <property id="accessible-name" _name="Accessible Name" ignore="True" atk-property="True" translatable="True">
+ <_tooltip>Object instance's name formatted for assistive technology access</_tooltip>
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>2</visible-lines>
+ </property>
+
+ <property id="accessible-description" _name="Accessible Description" ignore="True" atk-property="True" translatable="True">
+ <_tooltip>Description of an object, formatted for assistive technology access</_tooltip>
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>2</visible-lines>
+ </property>
+ </properties>
+
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkContainer" _title="Container">
+ <post-create-function>glade_gtk_container_post_create</post-create-function>
+
+ <add-child-function>glade_gtk_container_add_child</add-child-function>
+ <remove-child-function>glade_gtk_container_remove_child</remove-child-function>
+ <replace-child-function>glade_gtk_container_replace_child</replace-child-function>
+ <child-set-property-function>glade_gtk_container_set_child_property</child-set-property-function>
+ <child-get-property-function>glade_gtk_container_get_child_property</child-get-property-function>
+ <get-children-function>glade_gtk_container_get_children</get-children-function>
+
+ <properties>
+ <property id="border-width" common="True" weight="2.5"/>
+ <property id="resize-mode" common="True" weight="4.7">
+ <displayable-values>
+ <value id="GTK_RESIZE_PARENT" _name="Parent"/>
+ <value id="GTK_RESIZE_QUEUE" _name="Queue"/>
+ <value id="GTK_RESIZE_IMMEDIATE" _name="Immediate"/>
+ </displayable-values>
+ </property>
+ <property id="child" disabled="True"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkBox" _title="Box" fixed="True">
+ <post-create-function>glade_gtk_box_post_create</post-create-function>
+ <get-internal-child-function>glade_gtk_box_get_internal_child</get-internal-child-function>
+ <set-property-function>glade_gtk_box_set_property</set-property-function>
+ <get-property-function>glade_gtk_box_get_property</get-property-function>
+ <add-child-function>glade_gtk_box_add_child</add-child-function>
+ <remove-child-function>glade_gtk_box_remove_child</remove-child-function>
+ <child-set-property-function>glade_gtk_box_set_child_property</child-set-property-function>
+
+ <properties>
+ <property id="size" _name="Number of items" query="True" default="3" save="False">
+ <spec>glade_standard_int_spec</spec>
+ <_tooltip>The number of items in the box</_tooltip>
+ <verify-function>glade_gtk_box_verify_size</verify-function>
+ </property>
+ </properties>
+
+ <packing-properties>
+ <property id="position" weight="0"/>
+ <property id="padding" transfer-on-paste="True" weight="0.5"/>
+ <property id="expand" transfer-on-paste="True"/>
+ <property id="fill" transfer-on-paste="True"/>
+ <property id="pack-type" transfer-on-paste="True">
+ <displayable-values>
+ <value id="GTK_PACK_START" _name="Start"/>
+ <value id="GTK_PACK_END" _name="End"/>
+ </displayable-values>
+ </property>
+ </packing-properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkWindow" generic-name="window" _title="Window" toplevel="True">
+ <post-create-function>glade_gtk_window_post_create</post-create-function>
+
+ <properties>
+ <property id="visible" default="False"/>
+ <property common="True" id="gravity">
+ <displayable-values>
+ <value id="GDK_GRAVITY_NORTH_WEST" _name="North West"/>
+ <value id="GDK_GRAVITY_NORTH" _name="North"/>
+ <value id="GDK_GRAVITY_NORTH_EAST" _name="North East"/>
+ <value id="GDK_GRAVITY_WEST" _name="West"/>
+ <value id="GDK_GRAVITY_CENTER" _name="Center"/>
+ <value id="GDK_GRAVITY_EAST" _name="East"/>
+ <value id="GDK_GRAVITY_SOUTH_WEST" _name="South West"/>
+ <value id="GDK_GRAVITY_SOUTH" _name="South"/>
+ <value id="GDK_GRAVITY_SOUTH_EAST" _name="South East"/>
+ <value id="GDK_GRAVITY_STATIC" _name="Static"/>
+ </displayable-values>
+ </property>
+ <property id="modal" ignore="True"/>
+ <property id="default-width" default="0" optional="True" optional-default="False"/>
+ <property id="default-height" default="0" optional="True" optional-default="False"/>
+ <property id="type-hint" ignore="True">
+ <displayable-values>
+ <value id="GDK_WINDOW_TYPE_HINT_NORMAL" _name="Normal"/>
+ <value id="GDK_WINDOW_TYPE_HINT_DIALOG" _name="Dialog"/>
+ <value id="GDK_WINDOW_TYPE_HINT_MENU" _name="Menu"/>
+ <value id="GDK_WINDOW_TYPE_HINT_TOOLBAR" _name="Toolbar"/>
+ <value id="GDK_WINDOW_TYPE_HINT_SPLASHSCREEN" _name="Splash Screen"/>
+ <value id="GDK_WINDOW_TYPE_HINT_UTILITY" _name="Utility"/>
+ <value id="GDK_WINDOW_TYPE_HINT_DOCK" _name="Dock"/>
+ <value id="GDK_WINDOW_TYPE_HINT_DESKTOP" _name="Desktop"/>
+ <value id="GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU" _name="Drop Down Menu"/>
+ <value id="GDK_WINDOW_TYPE_HINT_POPUP_MENU" _name="Popup Menu"/>
+ <value id="GDK_WINDOW_TYPE_HINT_TOOLTIP" _name="Tooltip"/>
+ <value id="GDK_WINDOW_TYPE_HINT_NOTIFICATION" _name="Notification"/>
+ <value id="GDK_WINDOW_TYPE_HINT_COMBO" _name="Combo"/>
+ <value id="GDK_WINDOW_TYPE_HINT_DND" _name="Drag and Drop"/>
+ </displayable-values>
+ </property>
+ <property id="type" ignore="True">
+ <displayable-values>
+ <value id="GTK_WINDOW_TOPLEVEL" _name="Top Level"/>
+ <value id="GTK_WINDOW_POPUP" _name="Popup"/>
+ </displayable-values>
+ </property>
+ <property id="allow-shrink" disabled="True" />
+ <property id="allow-grow" disabled="True" />
+ <property id="resize-mode" disabled="True" />
+ <property id="screen" disabled="True" />
+ <property id="role"/>
+ <property id="icon-name"/>
+ <property id="resizable" ignore="True" />
+ <property id="decorated" ignore="True" />
+ <property id="title" ignore="True" translatable="True"/>
+ <property id="window-position" ignore="True">
+ <displayable-values>
+ <value id="GTK_WIN_POS_NONE" _name="None"/>
+ <value id="GTK_WIN_POS_CENTER" _name="Center"/>
+ <value id="GTK_WIN_POS_MOUSE" _name="Mouse"/>
+ <value id="GTK_WIN_POS_CENTER_ALWAYS" _name="Always Center"/>
+ <value id="GTK_WIN_POS_CENTER_ON_PARENT" _name="Center on Parent"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkMenuShell" _title="Menu Shell">
+ <post-create-function>empty</post-create-function>
+ <add-child-function>glade_gtk_menu_shell_add_item</add-child-function>
+ <remove-child-function>glade_gtk_menu_shell_remove_item</remove-child-function>
+ <child-set-property-function>glade_gtk_menu_shell_set_child_property</child-set-property-function>
+ <child-get-property-function>glade_gtk_menu_shell_get_child_property</child-get-property-function>
+ <packing-properties>
+ <property id="position" _name="Position" default="-1" save="False">
+ <spec>glade_standard_int_spec</spec>
+ <_tooltip>The position of the menu item in the menu shell</_tooltip>
+ </property>
+ </packing-properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkMenuItem" generic-name="menuitem" _title="Menu Item">
+ <post-create-function>glade_gtk_menu_item_post_create</post-create-function>
+ <get-children-function>glade_gtk_menu_item_get_submenu</get-children-function>
+ <set-property-function>glade_gtk_menu_item_set_property</set-property-function>
+ <add-child-function>glade_gtk_menu_item_add_submenu</add-child-function>
+ <remove-child-function>glade_gtk_menu_item_remove_submenu</remove-child-function>
+ <properties>
+ <property id="label" _name="Label" translatable="True">
+ <_tooltip>The text of the menu item</_tooltip>
+ <spec>glade_standard_string_spec</spec>
+ </property>
+ <property id="use-underline" _name="Use Underline">
+ <spec>glade_standard_boolean_spec</spec>
+ </property>
+ <!-- Atk click property -->
+ <property id="atk-click" _name="Click" ignore="True" atk-action="True">
+ <_tooltip>Set the desctription of the Click atk action</_tooltip>
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>2</visible-lines>
+ </property>
+ <!--
+ This property is added by glade2 gnome support and makes reference to
+ GNOMEUIINFO_MENU_* macros. The set-property-function maps these properties to
+ existing non deprecated gtk ones
+ -->
+ <property id="stock-item" visible="False" save="False">
+ <spec>glade_gtk_gnome_ui_info_spec</spec>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkCheckMenuItem" generic-name="checkmenuitem" _title="Check Menu Item"/>
+
+ <glade-widget-class name="GtkRadioMenuItem" generic-name="radiomenuitem" _title="Radio Menu Item">
+ <set-property-function>glade_gtk_radio_menu_item_set_property</set-property-function>
+ <properties>
+ <property id="draw-as-radio" default="True"/>
+ <property id="inconsistent" visible="False" save="False" default="False"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkImageMenuItem" generic-name="imagemenuitem" _title="Image Menu Item">
+ <get-internal-child-function>glade_gtk_image_menu_item_get_internal_child</get-internal-child-function>
+ <set-property-function>glade_gtk_image_menu_item_set_property</set-property-function>
+ <properties>
+ <property id="use-stock" visible="False">
+ <spec>glade_standard_boolean_spec</spec>
+ </property>
+ <property id="stock" _name="Stock Item" save="False">
+ <_tooltip>A stock item, select None to choose a custom image and label</_tooltip>
+ <spec>glade_standard_stock_spec</spec>
+ </property>
+ <property id="image" disabled="True" />
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkSeparatorMenuItem" generic-name="separatormenuitem" _title="Separator Menu Item">
+ <properties>
+ <property id="label" visible="False"/>
+ <property id="use-underline" visible="False"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkMenuBar" generic-name="menubar" _title="Menu Bar">
+ <post-create-function>glade_gtk_menu_bar_post_create</post-create-function>
+ <launch-editor-function>glade_gtk_menu_bar_launch_editor</launch-editor-function>
+ <!-- menubar is a container you can't add placeholders to it -->
+ <properties>
+ <property id="child-pack-direction">
+ <displayable-values>
+ <value id="GTK_PACK_DIRECTION_LTR" _name="Left to Right"/>
+ <value id="GTK_PACK_DIRECTION_RTL" _name="Right to Left"/>
+ <value id="GTK_PACK_DIRECTION_TTB" _name="Top to Bottom"/>
+ <value id="GTK_PACK_DIRECTION_BTT" _name="Bottom to Top"/>
+ </displayable-values>
+ </property>
+ <property id="pack-direction">
+ <displayable-values>
+ <value id="GTK_PACK_DIRECTION_LTR" _name="Left to Right"/>
+ <value id="GTK_PACK_DIRECTION_RTL" _name="Right to Left"/>
+ <value id="GTK_PACK_DIRECTION_TTB" _name="Top to Bottom"/>
+ <value id="GTK_PACK_DIRECTION_BTT" _name="Bottom to Top"/>
+ </displayable-values>
+ </property>
+ </properties>
+ <packing-defaults>
+ <parent-class name="GtkVBox">
+ <child-property id="expand" default="false"/>
+ </parent-class>
+ </packing-defaults>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkToolbar" generic-name="toolbar" _title="Tool Bar">
+ <post-create-function>empty</post-create-function>
+ <launch-editor-function>glade_gtk_toolbar_launch_editor</launch-editor-function>
+ <add-child-function>glade_gtk_toolbar_add_child</add-child-function>
+ <remove-child-function>glade_gtk_toolbar_remove_child</remove-child-function>
+ <child-set-property-function>glade_gtk_toolbar_set_child_property</child-set-property-function>
+ <child-get-property-function>glade_gtk_toolbar_get_child_property</child-get-property-function>
+
+ <properties>
+ <property id="orientation">
+ <displayable-values>
+ <value id="GTK_ORIENTATION_HORIZONTAL" _name="Horizontal"/>
+ <value id="GTK_ORIENTATION_VERTICAL" _name="Vertical"/>
+ </displayable-values>
+ </property>
+ <property id="toolbar-style">
+ <displayable-values>
+ <value id="GTK_TOOLBAR_ICONS" _name="Icons"/>
+ <value id="GTK_TOOLBAR_TEXT" _name="Text"/>
+ <value id="GTK_TOOLBAR_BOTH" _name="Both"/>
+ <value id="GTK_TOOLBAR_BOTH_HORIZ" _name="Both Horizontal"/>
+ </displayable-values>
+ </property>
+ </properties>
+
+ <packing-properties>
+ <property id="position" _name="Position" default="-1" save="False">
+ <spec>glade_standard_int_spec</spec>
+ <_tooltip>The position of the tool item in the toolbar</_tooltip>
+ </property>
+ <property id="expand" transfer-on-paste="True"/>
+ <property id="homogeneous" transfer-on-paste="True"/>
+ </packing-properties>
+
+ <packing-defaults>
+ <parent-class name="GtkVBox">
+ <child-property id="expand" default="false"/>
+ </parent-class>
+ </packing-defaults>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkToolItem" generic-name="toolitem" title="GtkToolItem">
+ <post-create-function>glade_gtk_tool_item_post_create</post-create-function>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkSeparatorToolItem" generic-name="separatortoolitem" _title="Separator Tool Item"/>
+
+ <glade-widget-class name="GtkToolButton" generic-name="toolbutton" _title="Tool Button">
+
+ <set-property-function>glade_gtk_tool_button_set_property</set-property-function>
+ <properties>
+ <property id="icon-widget" disabled="True"/>
+ <property id="label-widget" disabled="True"/>
+ <property id="glade-type" _name="Image Type" save="False">
+ <spec>glade_gtk_image_type_spec</spec>
+ </property>
+ <property id="glade-stock" _name="Stock Image" save="False">
+ <spec>glade_standard_stock_image_spec</spec>
+ </property>
+ <property id="icon" _name="File Name">
+ <spec>glade_standard_pixbuf_spec</spec>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkToggleToolButton" generic-name="toggletoolbutton" _title="Toggle Tool Button"/>
+
+ <glade-widget-class name="GtkRadioToolButton" generic-name="radiotoolbutton" _title="Radio Tool Button"/>
+
+ <glade-widget-class name="GtkMenuToolButton" generic-name="menutoolbutton" _title="Menu Tool Button"/>
+
+ <glade-widget-class name="GtkHandleBox" generic-name="handlebox" _title="Handle Box">
+ <properties>
+ <property id="handle-position">
+ <displayable-values>
+ <value id="GTK_POS_LEFT" _name="Left"/>
+ <value id="GTK_POS_RIGHT" _name="Right"/>
+ <value id="GTK_POS_TOP" _name="Top"/>
+ <value id="GTK_POS_BOTTOM" _name="Bottom"/>
+ </displayable-values>
+ </property>
+ <property id="shadow" disabled="True"/>
+ <property id="shadow-type">
+ <displayable-values>
+ <value id="GTK_SHADOW_NONE" _name="None"/>
+ <value id="GTK_SHADOW_IN" _name="In"/>
+ <value id="GTK_SHADOW_OUT" _name="Out"/>
+ <value id="GTK_SHADOW_ETCHED_IN" _name="Etched In"/>
+ <value id="GTK_SHADOW_ETCHED_OUT" _name="Etched Out"/>
+ </displayable-values>
+ </property>
+ <property id="snap-edge">
+ <displayable-values>
+ <value id="GTK_POS_LEFT" _name="Left"/>
+ <value id="GTK_POS_RIGHT" _name="Right"/>
+ <value id="GTK_POS_TOP" _name="Top"/>
+ <value id="GTK_POS_BOTTOM" _name="Bottom"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkLabel" generic-name="label" _title="Label">
+ <set-property-function>glade_gtk_label_set_property</set-property-function>
+
+ <properties>
+ <property id="selectable" ignore="True"/>
+ <property id="pattern" default=""/>
+ <property id="max-width-chars" _name="Maximun Width"/>
+ <property id="label" default="label" translatable="True">
+ <visible-lines>2</visible-lines>
+ </property>
+ <property id="justify">
+ <displayable-values>
+ <value id="GTK_JUSTIFY_LEFT" _name="Left"/>
+ <value id="GTK_JUSTIFY_RIGHT" _name="Right"/>
+ <value id="GTK_JUSTIFY_CENTER" _name="Center"/>
+ <value id="GTK_JUSTIFY_FILL" _name="Fill"/>
+ </displayable-values>
+ </property>
+ <property id="ellipsize">
+ <displayable-values>
+ <value id="PANGO_ELLIPSIZE_NONE" _name="None"/>
+ <value id="PANGO_ELLIPSIZE_START" _name="Start"/>
+ <value id="PANGO_ELLIPSIZE_MIDDLE" _name="Middle"/>
+ <value id="PANGO_ELLIPSIZE_END" _name="End"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkEntry" generic-name="entry" _title="Text Entry">
+ <post-create-function>glade_gtk_entry_post_create</post-create-function>
+ <properties>
+ <property id="text" translatable="True"/>
+
+ <!-- Atk activate property -->
+ <property id="atk-activate" _name="Activate" ignore="True" atk-action="True">
+ <_tooltip>Set the desctription of the Activate atk action</_tooltip>
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>2</visible-lines>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkTextView" generic-name="textview" _title="Text View">
+ <post-create-function>glade_gtk_text_view_post_create</post-create-function>
+ <set-property-function>glade_gtk_text_view_set_property</set-property-function>
+
+ <properties>
+ <!-- Text of the textview -->
+ <property id="text" _name="Text" translatable="True">
+ <_tooltip>Set the text in the view's text buffer</_tooltip>
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>2</visible-lines>
+ </property>
+ <property id="justification">
+ <displayable-values>
+ <value id="GTK_JUSTIFY_LEFT" _name="Left"/>
+ <value id="GTK_JUSTIFY_RIGHT" _name="Right"/>
+ <value id="GTK_JUSTIFY_CENTER" _name="Center"/>
+ <value id="GTK_JUSTIFY_FILL" _name="Fill"/>
+ </displayable-values>
+ </property>
+ <property id="wrap-mode">
+ <displayable-values>
+ <value id="GTK_WRAP_NONE" _name="None"/>
+ <value id="GTK_WRAP_CHAR" _name="Character"/>
+ <value id="GTK_WRAP_WORD" _name="Word"/>
+ <value id="GTK_WRAP_WORD_CHAR" _name="Word Character"/>
+ </displayable-values>
+ </property>
+ <property id="buffer" disabled="True"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkButton" generic-name="button" _title="Button">
+ <post-create-function>glade_gtk_button_post_create</post-create-function>
+ <add-child-function>glade_gtk_button_add_child</add-child-function>
+ <remove-child-function>glade_gtk_button_remove_child</remove-child-function>
+ <replace-child-function>glade_gtk_button_replace_child</replace-child-function>
+ <set-property-function>glade_gtk_button_set_property</set-property-function>
+
+ <properties>
+ <property id="image" disabled="True"/>
+ <property id="use-stock" visible="False"/>
+
+ <property id="label" default="button" translatable="True">
+ <visible-lines>2</visible-lines>
+ </property>
+
+ <property id="use-underline" weight="1.5"/>
+
+ <property id="stock" _name="Stock Button" save="False" weight="1.6">
+ <spec>glade_standard_stock_spec</spec>
+ <_tooltip>The stock item for this button</_tooltip>
+ </property>
+
+ <property id="image-position" weight="1.7">
+ <displayable-values>
+ <value id="GTK_POS_LEFT" _name="Left"/>
+ <value id="GTK_POS_RIGHT" _name="Right"/>
+ <value id="GTK_POS_TOP" _name="Top"/>
+ <value id="GTK_POS_BOTTOM" _name="Bottom"/>
+ </displayable-values>
+ </property>
+
+
+ <property id="glade-type" _name="Edit Type" save="False" weight="0">
+ <spec>glade_gtk_button_type_spec</spec>
+ </property>
+
+ <property id="response-id" _name="Response ID" default="0" common="False" ignore="True">
+ <spec>glade_standard_int_spec</spec>
+ <_tooltip>The response ID of this button in a dialog (it's NOT useful if this button is not in a GtkDialog)</_tooltip>
+ </property>
+
+ <property id="relief">
+ <displayable-values>
+ <value id="GTK_RELIEF_NORMAL" _name="Normal"/>
+ <value id="GTK_RELIEF_HALF" _name="Half"/>
+ <value id="GTK_RELIEF_NONE" _name="None"/>
+ </displayable-values>
+ </property>
+
+ <!-- Atk click property -->
+ <property id="atk-click" _name="Click" ignore="True" atk-action="True">
+ <_tooltip>Set the desctription of the Click atk action</_tooltip>
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>2</visible-lines>
+ </property>
+
+ <!-- Atk press property -->
+ <property id="atk-press" _name="Press" ignore="True" atk-action="True">
+ <_tooltip>Set the desctription of the Press atk action</_tooltip>
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>2</visible-lines>
+ </property>
+
+ <!-- Atk release property -->
+ <property id="atk-release" _name="Release" ignore="True" atk-action="True">
+ <_tooltip>Set the desctription of the Release atk action</_tooltip>
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>2</visible-lines>
+ </property>
+ </properties>
+
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkToggleButton" generic-name="togglebutton" _title="Toggle Button">
+ <properties>
+ <property id="label" default="togglebutton"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkCheckButton" generic-name="checkbutton" _title="Check Button">
+ <properties>
+ <property id="label" default="checkbutton"/>
+ <property id="draw-indicator" default="True"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkSpinButton" generic-name="spinbutton" _title="Spin Button">
+ <post-create-function>empty</post-create-function>
+ <set-property-function>glade_gtk_spin_button_set_property</set-property-function>
+ <properties>
+ <property id="text" disabled="True"/>
+ <property id="value" disabled="True"/>
+ <property id="can-focus" default="True"/>
+ <property id="adjustment" default="0 0 100 1 10 10"/>
+ <property id="update-policy">
+ <displayable-values>
+ <value id="GTK_UPDATE_ALWAYS" _name="Always"/>
+ <value id="GTK_UPDATE_IF_VALID" _name="If Valid"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkRadioButton" generic-name="radiobutton" _title="Radio Button">
+ <properties>
+ <property id="label" default="radiobutton"/>
+ <property id="draw-indicator" default="True"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkFileChooserButton" generic-name="filechooserbutton" _title="File Chooser Button">
+ <properties>
+ <property id="title" translatable="True"/>
+ <property id="size" disabled="True"/>
+ <property id="dialog" disabled="True"/>
+ <property id="action">
+ <displayable-values>
+ <value id="GTK_FILE_CHOOSER_ACTION_SAVE" _name="Save"/>
+ <value id="GTK_FILE_CHOOSER_ACTION_OPEN" _name="Open"/>
+ <value id="GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER" _name="Select Folder"/>
+ <value id="GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER" _name="Create Folder"/>
+ </displayable-values>
+ </property>
+ <property id="extra-widget" disabled="True" />
+ <property id="preview-widget" disabled="True" />
+ <property id="filter" disabled="True" />
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkColorButton" generic-name="colorbutton" _title="Color Button">
+ <properties>
+ <property id="title" translatable="True"/>
+ <property id="color" default="Black"/>
+
+ <!-- These props dont apply to color buttons -->
+ <property id="glade-type" disabled="True"/>
+ <property id="label" disabled="True"/>
+ <property id="use-underline" disabled="True"/>
+ <property id="stock" disabled="True"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkFontButton" generic-name="fontbutton" _title="Font Button">
+ <properties>
+ <property id="title" translatable="True"/>
+
+ <!-- These props dont apply to font buttons -->
+ <property id="glade-type" disabled="True"/>
+ <property id="label" disabled="True"/>
+ <property id="use-underline" disabled="True"/>
+ <property id="stock" disabled="True"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkComboBox" generic-name="combobox" _title="Combo Box">
+ <post-create-function>glade_gtk_combo_box_post_create</post-create-function>
+ <set-property-function>glade_gtk_combo_box_set_property</set-property-function>
+ <properties>
+ <property id="active" ignore="True"/>
+ <property id="column-span-column" ignore="True"/>
+ <property id="row-span-column" ignore="True"/>
+ <property id="items" _name="Items" translatable="True">
+ <spec>glade_standard_strv_spec</spec>
+ <_tooltip>The items in this combo box</_tooltip>
+ </property>
+
+ <!-- Atk press property -->
+ <property id="atk-press" _name="Press" ignore="True" atk-action="True">
+ <_tooltip>Set the desctription of the Press atk action</_tooltip>
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>2</visible-lines>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkComboBoxEntry" generic-name="comboboxentry" _title="Combo Box Entry">
+ <post-create-function>glade_gtk_combo_box_entry_post_create</post-create-function>
+ <get-internal-child-function>glade_gtk_combo_box_entry_get_internal_child</get-internal-child-function>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkTreeView" generic-name="treeview" _title="Tree View">
+ <post-create-function>glade_gtk_tree_view_post_create</post-create-function>
+ <properties>
+ <property id="enable-grid-lines" ignore="True">
+ <displayable-values>
+ <value id="GTK_TREE_VIEW_GRID_LINES_NONE" _name="None"/>
+ <value id="GTK_TREE_VIEW_GRID_LINES_HORIZONTAL" _name="Horizontal"/>
+ <value id="GTK_TREE_VIEW_GRID_LINES_VERTICAL" _name="Vertical"/>
+ <value id="GTK_TREE_VIEW_GRID_LINES_BOTH" _name="Horizontal and Vertical"/>
+ </displayable-values>
+ </property>
+ <property id="hadjustment" disabled="True"/>
+ <property id="vadjustment" disabled="True"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkIconView" generic-name="iconview" _title="Icon View" />
+
+ <glade-widget-class name="GtkProgressBar" generic-name="progressbar" _title="Progress Bar">
+ <properties>
+ <property id="text" translatable="True"/>
+ <property id="activity-blocks" disabled="True"/>
+ <property id="activity-step" disabled="True"/>
+ <property id="adjustment" disabled="True"/>
+ <property id="bar-style" disabled="True"/>
+ <property id="orientation">
+ <displayable-values>
+ <value id="GTK_PROGRESS_LEFT_TO_RIGHT" _name="Left to Right"/>
+ <value id="GTK_PROGRESS_RIGHT_TO_LEFT" _name="Right to Left"/>
+ <value id="GTK_PROGRESS_BOTTOM_TO_TOP" _name="Bottom to Top"/>
+ <value id="GTK_PROGRESS_TOP_TO_BOTTOM" _name="Top to Bottom"/>
+ </displayable-values>
+ </property>
+ <property id="ellipsize">
+ <displayable-values>
+ <value id="PANGO_ELLIPSIZE_NONE" _name="None"/>
+ <value id="PANGO_ELLIPSIZE_START" _name="Start"/>
+ <value id="PANGO_ELLIPSIZE_MIDDLE" _name="Middle"/>
+ <value id="PANGO_ELLIPSIZE_END" _name="End"/>
+ </displayable-values>
+ </property>
+ <property id="bar-style">
+ <displayable-values>
+ <value id="GTK_PROGRESS_CONTINUOUS" _name="Continuous"/>
+ <value id="GTK_PROGRESS_DISCRETE" _name="Discrete"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkImage" generic-name="image" _title="Image">
+ <post-create-function>glade_gtk_image_post_create</post-create-function>
+ <set-property-function>glade_gtk_image_set_property</set-property-function>
+ <properties>
+ <property id="stock" visible="False" default="gtk-missing-image"/>
+ <property id="glade-type" _name="Edit Type" save="False" weight="0">
+ <spec>glade_gtk_image_type_spec</spec>
+ </property>
+ <property id="pixbuf-animation" disabled="True"/>
+ <property id="file" disabled="True"/>
+ <property id="pixmap" disabled="True"/>
+ <property id="image" disabled="True"/>
+ <property id="mask" disabled="True"/>
+ <property id="pixbuf" _name="File Name"/>
+ <property id="glade-stock" _name="Stock Image" save="False" weight="1.5" default="gtk-missing-image">
+ <_tooltip>A builtin stock image</_tooltip>
+ <spec>glade_standard_stock_image_spec</spec>
+ <_tooltip>The stock item for this image</_tooltip>
+ </property>
+ <property id="icon-name" _name="Icon Name" weight="1.6"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkDialog" generic-name="dialog" _title="Dialog Box">
+ <post-create-function>glade_gtk_dialog_post_create</post-create-function>
+ <get-internal-child-function>glade_gtk_dialog_get_internal_child</get-internal-child-function>
+ <get-children-function>glade_gtk_dialog_get_children</get-children-function>
+ <set-property-function>glade_gtk_dialog_set_property</set-property-function>
+ <properties>
+ <property id="default-width" default="0" optional="True" optional-default="False"/>
+ <property id="default-height" default="0" optional="True" optional-default="False"/>
+ <property id="has-separator" default="False"/>
+ </properties>
+
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkHBox" generic-name="hbox" _title="Horizontal Box"/>
+ <glade-widget-class name="GtkVBox" generic-name="vbox" _title="Vertical Box"/>
+
+ <glade-widget-class name="GtkTable" generic-name="table" _title="Table" fixed="True">
+ <post-create-function>glade_gtk_table_post_create</post-create-function>
+ <child-set-property-function>glade_gtk_table_set_child_property</child-set-property-function>
+ <child-verify-function>glade_gtk_table_child_verify_property</child-verify-function>
+ <add-child-function>glade_gtk_table_add_child</add-child-function>
+ <remove-child-function>glade_gtk_table_remove_child</remove-child-function>
+ <replace-child-function>glade_gtk_table_replace_child</replace-child-function>
+ <set-property-function>glade_gtk_table_set_property</set-property-function>
+ <verify-property-function>glade_gtk_table_verify_property</verify-property-function>
+
+ <properties>
+ <property id="n-rows" default="3" query="True"/>
+ <property id="n-columns" default="3" query="True"/>
+ </properties>
+
+ <packing-properties>
+ <property id="x-options" transfer-on-paste="True">
+ <displayable-values>
+ <value id="GTK_EXPAND" _name="Expand"/>
+ <value id="GTK_SHRINK" _name="Shrink"/>
+ <value id="GTK_FILL" _name="Fill"/>
+ </displayable-values>
+ </property>
+ <property id="y-options" transfer-on-paste="True">
+ <displayable-values>
+ <value id="GTK_EXPAND" _name="Expand"/>
+ <value id="GTK_SHRINK" _name="Shrink"/>
+ <value id="GTK_FILL" _name="Fill"/>
+ </displayable-values>
+ </property>
+ <property id="x-padding" transfer-on-paste="True"/>
+ <property id="y-padding" transfer-on-paste="True"/>
+ </packing-properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkPaned" _title="Paned">
+ <post-create-function>glade_gtk_paned_post_create</post-create-function>
+ <add-child-function>glade_gtk_paned_add_child</add-child-function>
+ <remove-child-function>glade_gtk_paned_remove_child</remove-child-function>
+ <child-set-property-function>glade_gtk_paned_set_child_property</child-set-property-function>
+ <child-get-property-function>glade_gtk_paned_get_child_property</child-get-property-function>
+ <packing-properties>
+ <property id="resize" transfer-on-paste="True"/>
+ <property id="shrink" transfer-on-paste="True"/>
+ <!--
+ Whether to add the child to the top/left or bottom/right pane.
+ This virtual property is used to remember child position in undo/redo.
+ -->
+ <property id="first" save="False" visible="False">
+ <spec>glade_standard_boolean_spec</spec>
+ </property>
+ </packing-properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkHPaned" generic-name="hpaned" _title="Horizontal Panes"/>
+
+ <glade-widget-class name="GtkVPaned" generic-name="vpaned" _title="Vertical Panes"/>
+
+ <glade-widget-class name="GtkNotebook" generic-name="notebook" _title="Notebook">
+ <post-create-function>glade_gtk_notebook_post_create</post-create-function>
+ <add-child-function>glade_gtk_notebook_add_child</add-child-function>
+ <remove-child-function>glade_gtk_notebook_remove_child</remove-child-function>
+ <replace-child-function>glade_gtk_notebook_replace_child</replace-child-function>
+ <child-set-property-function>glade_gtk_notebook_set_child_property</child-set-property-function>
+ <child-get-property-function>glade_gtk_notebook_get_child_property</child-get-property-function>
+ <child-verify-property-function>glade_gtk_notebook_child_verify_property</child-verify-property-function>
+ <special-child-type>type</special-child-type>
+ <set-property-function>glade_gtk_notebook_set_property</set-property-function>
+ <verify-property-function>glade_gtk_notebook_verify_property</verify-property-function>
+
+ <properties>
+ <property id="page" save="False">
+ <_tooltip>Set the current page (strictly for editing purposes)</_tooltip>
+ </property>
+
+ <property id="pages" _name="Number of pages" save="False" default="3" query="True">
+ <spec>glade_standard_int_spec</spec>
+ <_tooltip>The number of pages in the notebook</_tooltip>
+ </property>
+ <property id="tab-pos">
+ <displayable-values>
+ <value id="GTK_POS_LEFT" _name="Left"/>
+ <value id="GTK_POS_RIGHT" _name="Right"/>
+ <value id="GTK_POS_TOP" _name="Top"/>
+ <value id="GTK_POS_BOTTOM" _name="Bottom"/>
+ </displayable-values>
+ </property>
+ </properties>
+
+ <packing-properties>
+ <property id="tab-label" disabled="True"/>
+ <property id="tab-pack">
+ <displayable-values>
+ <value id="GTK_PACK_START" _name="Start"/>
+ <value id="GTK_PACK_END" _name="End"/>
+ </displayable-values>
+ </property>
+ <property id="position">
+ <verify-function>glade_gtk_notebook_verify_position</verify-function>
+ </property>
+ </packing-properties>
+ </glade-widget-class>
+
+
+ <glade-widget-class name="GtkAlignment" generic-name="alignment" _title="Alignment"/>
+
+ <glade-widget-class name="GtkFrame" generic-name="frame" _title="Frame">
+ <post-create-function>glade_gtk_frame_post_create</post-create-function>
+ <add-child-function>glade_gtk_frame_add_child</add-child-function>
+ <replace-child-function>glade_gtk_frame_replace_child</replace-child-function>
+ <special-child-type>type</special-child-type>
+
+ <properties>
+ <property id="label" disabled="True"/>
+ <property id="shadow" disabled="True"/>
+ <property id="label-widget" disabled="True"/>
+ <property id="label-xalign" default="0.0"/>
+ <property id="shadow-type" default="GTK_SHADOW_NONE">
+ <displayable-values>
+ <value id="GTK_SHADOW_NONE" _name="None"/>
+ <value id="GTK_SHADOW_IN" _name="In"/>
+ <value id="GTK_SHADOW_OUT" _name="Out"/>
+ <value id="GTK_SHADOW_ETCHED_IN" _name="Etched In"/>
+ <value id="GTK_SHADOW_ETCHED_OUT" _name="Etched Out"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkAspectFrame" generic-name="aspectframe" _title="Aspect Frame"/>
+
+ <glade-widget-class name="GtkRange" _title="Range">
+ <properties>
+ <property id="adjustment" default="0 0 100 1 10 10"/>
+ <property id="update-policy">
+ <displayable-values>
+ <value id="GTK_UPDATE_CONTINUOUS" _name="Continuous"/>
+ <value id="GTK_UPDATE_DISCONTINUOUS" _name="Discontinuous"/>
+ <value id="GTK_UPDATE_DELAYED" _name="Delayed"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkScale" _title="Scale">
+ <properties>
+ <property id="value-pos">
+ <displayable-values>
+ <value id="GTK_POS_LEFT" _name="Left"/>
+ <value id="GTK_POS_RIGHT" _name="Right"/>
+ <value id="GTK_POS_TOP" _name="Top"/>
+ <value id="GTK_POS_BOTTOM" _name="Bottom"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+ <glade-widget-class name="GtkHScale" generic-name="hscale" _title="Horizontal Scale"/>
+
+ <glade-widget-class name="GtkVScale" generic-name="vscale" _title="Vertical Scale"/>
+
+ <glade-widget-class name="GtkCalendar" generic-name="calendar" _title="Calendar"/>
+
+ <glade-widget-class name="GtkMenu" generic-name="menu" _title="Popup Menu" toplevel="True">
+ <!-- We do not want glade_gtk_container_post_create be executed -->
+ <post-create-function>empty</post-create-function>
+ <launch-editor-function>glade_gtk_menu_launch_editor</launch-editor-function>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkHScrollbar" generic-name="hscrollbar" _title="Horizontal Scrollbar"/>
+
+ <glade-widget-class name="GtkVScrollbar" generic-name="vscrollbar" _title="Vertical Scrollbar"/>
+
+ <glade-widget-class name="GtkButtonBox" _title="Button Box">
+ <properties>
+ <property id="layout-style">
+ <displayable-values>
+ <value id="GTK_BUTTONBOX_DEFAULT_STYLE" _name="Default"/>
+ <value id="GTK_BUTTONBOX_SPREAD" _name="Spread"/>
+ <value id="GTK_BUTTONBOX_EDGE" _name="Edge"/>
+ <value id="GTK_BUTTONBOX_START" _name="Start"/>
+ <value id="GTK_BUTTONBOX_END" _name="End"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkHButtonBox" generic-name="hbuttonbox" _title="Horizontal Button Box"/>
+
+ <glade-widget-class name="GtkVButtonBox" generic-name="vbuttonbox" _title="Vertical Button Box"/>
+
+ <glade-widget-class name="GtkHSeparator" generic-name="hseparator" _title="Horizontal Separator">
+
+ <packing-defaults>
+ <parent-class name="GtkVBox">
+ <child-property id="expand" default="false"/>
+ </parent-class>
+ </packing-defaults>
+
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkVSeparator" generic-name="vseparator" _title="Vertical Separator">
+ <packing-defaults>
+ <parent-class name="GtkHBox">
+ <child-property id="expand" default="false"/>
+ </parent-class>
+ </packing-defaults>
+ </glade-widget-class>
+ <glade-widget-class name="GtkStatusbar" generic-name="statusbar" _title="Status Bar">
+ <properties>
+ <property id="size" disabled="True" />
+ </properties>
+ <packing-defaults>
+ <parent-class name="GtkVBox">
+ <child-property id="expand" default="false"/>
+ </parent-class>
+ </packing-defaults>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkAccelLabel" generic-name="accellabel" _title="Accel Label"/>
+
+ <glade-widget-class name="GtkArrow" generic-name="arrow" _title="Arrow">
+ <properties>
+ <property id="arrow-type">
+ <displayable-values>
+ <value id="GTK_ARROW_UP" _name="Up"/>
+ <value id="GTK_ARROW_DOWN" _name="Down"/>
+ <value id="GTK_ARROW_LEFT" _name="Left"/>
+ <value id="GTK_ARROW_RIGHT" _name="Right"/>
+ </displayable-values>
+ </property>
+ <property id="shadow-type">
+ <displayable-values>
+ <value id="GTK_SHADOW_NONE" _name="None"/>
+ <value id="GTK_SHADOW_IN" _name="In"/>
+ <value id="GTK_SHADOW_OUT" _name="Out"/>
+ <value id="GTK_SHADOW_ETCHED_IN" _name="Etched In"/>
+ <value id="GTK_SHADOW_ETCHED_OUT" _name="Etched Out"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkLayout" generic-name="layout" _title="Layout" fixed="True">
+ <post-create-function>glade_gtk_fixed_layout_post_create</post-create-function>
+ <add-child-function>glade_gtk_fixed_layout_add_child</add-child-function>
+ <remove-child-function>glade_gtk_fixed_layout_remove_child</remove-child-function>
+ <properties>
+ <property id="hadjustment" disabled="True"/>
+ <property id="vadjustment" disabled="True"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkFixed" generic-name="fixed" _title="Fixed" fixed="True">
+ <post-create-function>glade_gtk_fixed_layout_post_create</post-create-function>
+ <add-child-function>glade_gtk_fixed_layout_add_child</add-child-function>
+ <remove-child-function>glade_gtk_fixed_layout_remove_child</remove-child-function>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkDrawingArea" generic-name="drawingarea" _title="Drawing Area"/>
+
+ <glade-widget-class name="GtkEventBox" generic-name="eventbox" _title="Event Box"/>
+
+ <glade-widget-class name="GtkExpander" generic-name="expander" _title="Expander">
+ <post-create-function>glade_gtk_expander_post_create</post-create-function>
+ <add-child-function>glade_gtk_expander_add_child</add-child-function>
+ <remove-child-function>glade_gtk_expander_remove_child</remove-child-function>
+ <replace-child-function>glade_gtk_expander_replace_child</replace-child-function>
+ <special-child-type>type</special-child-type>
+
+ <properties>
+ <property id="label" disabled="True"/>
+ <property id="label-widget" disabled="True"/>
+
+ <!-- Atk activate property -->
+ <property id="atk-activate" _name="Activate" ignore="True" atk-action="True">
+ <_tooltip>Set the desctription of the Activate atk action</_tooltip>
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>2</visible-lines>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkViewport" generic-name="viewport" _title="Viewport">
+ <properties>
+ <property id="hadjustment" disabled="True"/>
+ <property id="vadjustment" disabled="True"/>
+ <property id="shadow-type">
+ <displayable-values>
+ <value id="GTK_SHADOW_NONE" _name="None"/>
+ <value id="GTK_SHADOW_IN" _name="In"/>
+ <value id="GTK_SHADOW_OUT" _name="Out"/>
+ <value id="GTK_SHADOW_ETCHED_IN" _name="Etched In"/>
+ <value id="GTK_SHADOW_ETCHED_OUT" _name="Etched Out"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkScrolledWindow" generic-name="scrolledwindow" _title="Scrolled Window">
+ <properties>
+ <property id="hadjustment" disabled="True"/>
+ <property id="vadjustment" disabled="True"/>
+ <property id="window-placement-set" ignore="True"/>
+ <property id="shadow-type">
+ <displayable-values>
+ <value id="GTK_SHADOW_NONE" _name="None"/>
+ <value id="GTK_SHADOW_IN" _name="In"/>
+ <value id="GTK_SHADOW_OUT" _name="Out"/>
+ <value id="GTK_SHADOW_ETCHED_IN" _name="Etched In"/>
+ <value id="GTK_SHADOW_ETCHED_OUT" _name="Etched Out"/>
+ </displayable-values>
+ </property>
+ <property id="hscrollbar-policy" default="GTK_POLICY_AUTOMATIC">
+ <displayable-values>
+ <value id="GTK_POLICY_ALWAYS" _name="Always"/>
+ <value id="GTK_POLICY_AUTOMATIC" _name="Automatic"/>
+ <value id="GTK_POLICY_NEVER" _name="Never"/>
+ </displayable-values>
+ </property>
+ <property id="vscrollbar-policy" default="GTK_POLICY_AUTOMATIC">
+ <displayable-values>
+ <value id="GTK_POLICY_ALWAYS" _name="Always"/>
+ <value id="GTK_POLICY_AUTOMATIC" _name="Automatic"/>
+ <value id="GTK_POLICY_NEVER" _name="Never"/>
+ </displayable-values>
+ </property>
+ <property id="window-placement">
+ <displayable-values>
+ <value id="GTK_CORNER_TOP_LEFT" _name="Top Left"/>
+ <value id="GTK_CORNER_BOTTOM_LEFT" _name="Bottom Left"/>
+ <value id="GTK_CORNER_TOP_RIGHT" _name="Top Right"/>
+ <value id="GTK_CORNER_BOTTOM_RIGHT" _name="Bottom Right"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <!-- NOT AVAILABLES ON WIN32
+ <glade-widget-class name="GtkPlug" generic-name="plug" _title="Plug"/>
+ <glade-widget-class name="GtkSocket" generic-name="socket" _title="Socket"/>
+ -->
+
+ <glade-widget-class name="GtkAboutDialog" generic-name="aboutdialog" _title="About Dialog">
+ <properties>
+ <property id="copyright" translatable="True">
+ <visible-lines>2</visible-lines>
+ </property>
+ <property id="comments" translatable="True">
+ <visible-lines>2</visible-lines>
+ </property>
+ <property id="license" translatable="True">
+ <visible-lines>2</visible-lines>
+ </property>
+ <property id="website-label" translatable="True">
+ <visible-lines>2</visible-lines>
+ </property>
+
+ <!-- It is disputable whether this should really be translatable -->
+ <property id="translator-credits" translatable="True">
+ <_tooltip>You can mark this as translatable and set one name/address if you want to show a translation specific translator, otherwise you should list all translators and unmark this string for translation</_tooltip>
+ <visible-lines>2</visible-lines>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkColorSelectionDialog" generic-name="colorselectiondialog" _title="Color Selection Dialog"/>
+
+ <glade-widget-class name="GtkFileChooserDialog" generic-name="filechooserdialog" _title="File Chooser Dialog">
+ <properties>
+ <property id="action">
+ <displayable-values>
+ <value id="GTK_FILE_CHOOSER_ACTION_OPEN" _name="Open"/>
+ <value id="GTK_FILE_CHOOSER_ACTION_SAVE" _name="Save"/>
+ <value id="GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER" _name="Select Folder"/>
+ <value id="GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER" _name="Create Folder"/>
+ </displayable-values>
+ </property>
+ <property id="extra-widget" disabled="True" />
+ <property id="preview-widget" disabled="True" />
+ <property id="filter" disabled="True" />
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkFontSelectionDialog" generic-name="fontselectiondialog" _title="Font Selection Dialog"/>
+
+ <glade-widget-class name="GtkInputDialog" generic-name="inputdialog" _title="Input Dialog"/>
+
+ <glade-widget-class name="GtkMessageDialog" generic-name="messagedialog" _title="Message Dialog">
+ <properties>
+ <property id="default-width" default="0" optional="True" optional-default="False"/>
+ <property id="default-height" default="0" optional="True" optional-default="False"/>
+
+ <property common="True" id="sensitive"/>
+ <property common="True" id="can-default"/>
+ <property common="True" id="has-default"/>
+ <property common="True" id="can-focus"/>
+ <property id="message-type">
+ <displayable-values>
+ <value id="GTK_MESSAGE_INFO" _name="Info"/>
+ <value id="GTK_MESSAGE_WARNING" _name="Warning"/>
+ <value id="GTK_MESSAGE_QUESTION" _name="Question"/>
+ <value id="GTK_MESSAGE_ERROR" _name="Error"/>
+ </displayable-values>
+ </property>
+ <property id="buttons">
+ <displayable-values>
+ <value id="GTK_BUTTONS_NONE" _name="None"/>
+ <value id="GTK_BUTTONS_OK" _name="Ok"/>
+ <value id="GTK_BUTTONS_CLOSE" _name="Close"/>
+ <value id="GTK_BUTTONS_CANCEL" _name="Cancel"/>
+ <value id="GTK_BUTTONS_YES_NO" _name="Yes, No"/>
+ <value id="GTK_BUTTONS_OK_CANCEL" _name="Ok, Cancel"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkRuler" generic-name="ruler" _title="Ruler">
+ <properties>
+ <property default="10.0" id="upper"/>
+ <property default="5.0" id="position"/>
+ <property default="10.0" id="max-size"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkHRuler" generic-name="hruler" _title="Horizontal Ruler"/>
+
+ <glade-widget-class name="GtkVRuler" generic-name="vruler" _title="Vertical Ruler"/>
+
+ <glade-widget-class name="GtkCombo" generic-name="combo" _title="Combo">
+ <post-create-function>glade_gtk_combo_post_create</post-create-function>
+ <get-internal-child-function>glade_gtk_combo_get_internal_child</get-internal-child-function>
+ <get-children-function>glade_gtk_combo_get_children</get-children-function>
+
+ <properties>
+ <property id="size" disabled="True"/>
+
+ <!-- Atk press property -->
+ <property id="atk-press" _name="Press" ignore="True" atk-action="True">
+ <_tooltip>Set the desctription of the Press atk action</_tooltip>
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>2</visible-lines>
+ </property>
+ </properties>
+
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkOptionMenu" generic-name="optionmenu" _title="Option Menu">
+ <properties>
+ <!-- Atk press property -->
+ <property id="atk-press" _name="Press" ignore="True" atk-action="True">
+ <_tooltip>Set the desctription of the Press atk action</_tooltip>
+ <spec>glade_standard_string_spec</spec>
+ <visible-lines>2</visible-lines>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkList" generic-name="list" _title="List">
+ <add-child-function>glade_gtk_listitem_add_child</add-child-function>
+ <remove-child-function>glade_gtk_listitem_remove_child</remove-child-function>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkListItem" generic-name="listitem" _title="List Item">
+ <post-create-function>glade_gtk_list_item_post_create</post-create-function>
+ <set-property-function>glade_gtk_list_item_set_property</set-property-function>
+ <get-property-function>glade_gtk_list_item_get_property</get-property-function>
+ <properties>
+ <property id="label" _name="Label" translatable="True">
+ <spec>glade_standard_string_spec</spec>
+ <_tooltip>The text to display</_tooltip>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkCList" generic-name="clist" _title="Columned List"/>
+
+ <glade-widget-class name="GtkColorSelection" generic-name="colorselection" _title="Color Selection"/>
+
+ <glade-widget-class name="GtkFontSelection" generic-name="fontselection" _title="Font Selection"/>
+
+ <glade-widget-class name="GtkCurve" generic-name="curve" _title="Curve">
+ <properties>
+ <property id="curve-type" default="GTK_CURVE_TYPE_SPLINE">
+ <displayable-values>
+ <value id="GTK_CURVE_TYPE_LINEAR" _name="Linear"/>
+ <value id="GTK_CURVE_TYPE_SPLINE" _name="Spline"/>
+ <value id="GTK_CURVE_TYPE_FREE" _name="Free"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkGammaCurve" generic-name="gammacurve" _title="Gamma Curve"/>
+
+ <glade-widget-class name="GtkFileSelection" generic-name="fileselection" _title="File Selection"/>
+ <glade-widget-class name="Custom" generic-name="custom" _title="Custom widget">
+ <properties>
+ <property id="creation-function"/>
+ <property id="string1"/>
+ <property id="string2"/>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkAssistant" generic-name="assistant" _title="Assistant">
+ <post-create-function>glade_gtk_assistant_post_create</post-create-function>
+ <add-child-function>glade_gtk_assistant_add_child</add-child-function>
+ <remove-child-function>glade_gtk_assistant_remove_child</remove-child-function>
+ <replace-child-function>glade_gtk_assistant_replace_child</replace-child-function>
+ <set-property-function>glade_gtk_assistant_set_property</set-property-function>
+ <get-property-function>glade_gtk_assistant_get_property</get-property-function>
+ <verify-property-function>glade_gtk_assistant_verify_property</verify-property-function>
+ <child-set-property-function>glade_gtk_assistant_set_child_property</child-set-property-function>
+ <child-get-property-function>glade_gtk_assistant_get_child_property</child-get-property-function>
+ <properties>
+ <property save="False" id="size" _name="Size">
+ <_tooltip>Number of pages</_tooltip>
+ <spec>glade_standard_int_spec</spec>
+ </property>
+ </properties>
+ <packing-properties>
+ <property id="complete" disabled="True"/>
+ <property id="page-type" ignore="True">
+ <displayable-values>
+ <value id="GTK_ASSISTANT_PAGE_CONTENT" _name="Content"/>
+ <value id="GTK_ASSISTANT_PAGE_INTRO" _name="Intro"/>
+ <value id="GTK_ASSISTANT_PAGE_CONFIRM" _name="Confirm"/>
+ <value id="GTK_ASSISTANT_PAGE_SUMMARY" _name="Summary"/>
+ <value id="GTK_ASSISTANT_PAGE_PROGRESS" _name="Progress"/>
+ </displayable-values>
+ </property>
+ <property save="False" id="position" name="Position">
+ <spec>glade_standard_int_spec</spec>
+ <_tooltip>The page position in the Assistant</_tooltip>
+ </property>
+ </packing-properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkLinkButton" generic-name="linkbutton" _title="Link Button"/>
+
+ <glade-widget-class name="GtkPageSetupUnixDialog" generic-name="pagesetupdialog" _title="Page Setup Dialog"/>
+ <glade-widget-class name="GtkPrintUnixDialog" generic-name="printdialog" _title="Print Dialog"/>
+
+ <glade-widget-class name="GtkRecentChooserWidget" generic-name="recentchooser" _title="Recent Chooser">
+ <properties>
+ <property id="size" disabled="True"/>
+ <property id="sort-type">
+ <displayable-values>
+ <value id="GTK_RECENT_SORT_NONE" _name="None"/>
+ <value id="GTK_RECENT_SORT_MRU" _name="Most Recently Used first"/>
+ <value id="GTK_RECENT_SORT_LRU" _name="Least Recently Used first"/>
+ <value id="GTK_RECENT_SORT_CUSTOM" _name="Custom"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+
+ <glade-widget-class name="GtkRecentChooserDialog" generic-name="recentchooserdialog" _title="Recent Chooser Dialog">
+ <properties>
+ <property id="sort-type">
+ <displayable-values>
+ <value id="GTK_RECENT_SORT_NONE" _name="None"/>
+ <value id="GTK_RECENT_SORT_MRU" _name="Most Recently Used first"/>
+ <value id="GTK_RECENT_SORT_LRU" _name="Least Recently Used first"/>
+ <value id="GTK_RECENT_SORT_CUSTOM" _name="Custom"/>
+ </displayable-values>
+ </property>
+ </properties>
+ </glade-widget-class>
+ </glade-widget-classes>
+
+ <glade-widget-group name="gtk-toplevels" _title="Toplevels">
+ <glade-widget-class-ref name="GtkWindow"/>
+ <glade-widget-class-ref name="GtkDialog"/>
+ <glade-widget-class-ref name="GtkAboutDialog"/>
+ <glade-widget-class-ref name="GtkColorSelectionDialog"/>
+ <glade-widget-class-ref name="GtkFileChooserDialog"/>
+ <glade-widget-class-ref name="GtkFontSelectionDialog"/>
+ <glade-widget-class-ref name="GtkInputDialog"/>
+ <glade-widget-class-ref name="GtkMessageDialog"/>
+ <glade-widget-class-ref name="GtkPageSetupUnixDialog"/>
+ <glade-widget-class-ref name="GtkPrintUnixDialog"/>
+ <glade-widget-class-ref name="GtkRecentChooserDialog"/>
+ <glade-widget-class-ref name="GtkAssistant"/>
+ </glade-widget-group>
+
+ <glade-widget-group name="gtk-containers" _title="Containers">
+ <glade-widget-class-ref name="GtkHBox"/>
+ <glade-widget-class-ref name="GtkVBox"/>
+ <glade-widget-class-ref name="GtkTable"/>
+ <glade-widget-class-ref name="GtkNotebook"/>
+ <glade-widget-class-ref name="GtkFrame"/>
+ <glade-widget-class-ref name="GtkAspectFrame"/>
+ <glade-widget-class-ref name="GtkMenuBar"/>
+ <glade-widget-class-ref name="GtkToolbar"/>
+ <glade-widget-class-ref name="GtkHPaned"/>
+ <glade-widget-class-ref name="GtkVPaned"/>
+ <glade-widget-class-ref name="GtkHButtonBox"/>
+ <glade-widget-class-ref name="GtkVButtonBox"/>
+ <glade-widget-class-ref name="GtkLayout"/>
+ <glade-widget-class-ref name="GtkFixed"/>
+ <glade-widget-class-ref name="GtkEventBox"/>
+ <glade-widget-class-ref name="GtkExpander"/>
+ <glade-widget-class-ref name="GtkViewport"/>
+ <glade-widget-class-ref name="GtkScrolledWindow"/>
+ <glade-widget-class-ref name="GtkAlignment"/>
+ </glade-widget-group>
+
+ <glade-widget-group name="gtk-control-display" _title="Control and Display">
+
+ <glade-widget-class-ref name="GtkButton"/>
+ <glade-widget-class-ref name="GtkToggleButton"/>
+ <glade-widget-class-ref name="GtkCheckButton"/>
+ <glade-widget-class-ref name="GtkSpinButton"/>
+ <glade-widget-class-ref name="GtkRadioButton"/>
+ <glade-widget-class-ref name="GtkFileChooserButton"/>
+ <glade-widget-class-ref name="GtkColorButton"/>
+ <glade-widget-class-ref name="GtkFontButton"/>
+ <glade-widget-class-ref name="GtkLinkButton"/>
+
+ <glade-widget-class-ref name="GtkImage"/>
+ <glade-widget-class-ref name="GtkLabel"/>
+ <glade-widget-class-ref name="GtkAccelLabel"/>
+ <glade-widget-class-ref name="GtkEntry"/>
+ <glade-widget-class-ref name="GtkTextView"/>
+
+ <glade-widget-class-ref name="GtkHScale"/>
+ <glade-widget-class-ref name="GtkVScale"/>
+ <glade-widget-class-ref name="GtkHScrollbar"/>
+ <glade-widget-class-ref name="GtkVScrollbar"/>
+
+ <glade-widget-class-ref name="GtkComboBox"/>
+ <glade-widget-class-ref name="GtkComboBoxEntry"/>
+ <glade-widget-class-ref name="GtkProgressBar"/>
+
+ <glade-widget-class-ref name="GtkTreeView"/>
+ <glade-widget-class-ref name="GtkIconView"/>
+
+ <glade-widget-class-ref name="GtkHandleBox"/>
+ <glade-widget-class-ref name="GtkStatusbar"/>
+
+ <glade-widget-class-ref name="GtkCalendar"/>
+ <glade-widget-class-ref name="GtkMenu"/>
+ <glade-widget-class-ref name="GtkHSeparator"/>
+ <glade-widget-class-ref name="GtkVSeparator"/>
+ <glade-widget-class-ref name="GtkArrow"/>
+ <glade-widget-class-ref name="GtkDrawingArea"/>
+
+ <glade-widget-class-ref name="GtkRecentChooserWidget"/>
+ </glade-widget-group>
+
+ <glade-widget-group name="gtk-obsolete" _title="Gtk+ Obsolete">
+
+ <default-palette-state expanded="False" />
+
+ <glade-widget-class-ref name="GtkCombo"/>
+ <glade-widget-class-ref name="GtkOptionMenu"/>
+ <glade-widget-class-ref name="GtkHRuler"/>
+ <glade-widget-class-ref name="GtkVRuler"/>
+ <glade-widget-class-ref name="GtkList"/>
+ <glade-widget-class-ref name="GtkCList"/>
+ <glade-widget-class-ref name="GtkColorSelection"/>
+ <glade-widget-class-ref name="GtkFontSelection"/>
+ <glade-widget-class-ref name="GtkCurve"/>
+ <glade-widget-class-ref name="GtkGammaCurve"/>
+ <glade-widget-class-ref name="GtkFileSelection"/>
+ <glade-widget-class-ref name="Custom"/>
+ </glade-widget-group>
+</glade-catalog>
diff --git a/plugins/gtk+/icons/.cvsignore b/plugins/gtk+/icons/.cvsignore
new file mode 100644
index 00000000..b840c218
--- /dev/null
+++ b/plugins/gtk+/icons/.cvsignore
@@ -0,0 +1,2 @@
+Makefile.in
+Makefile \ No newline at end of file
diff --git a/plugins/gtk+/icons/16x16/Makefile.am b/plugins/gtk+/icons/16x16/Makefile.am
new file mode 100644
index 00000000..4af8d58a
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/Makefile.am
@@ -0,0 +1,89 @@
+## Process this file with automake to produce Makefile.in
+
+iconsdir = $(pkgdatadir)/pixmaps/16x16
+
+icons_DATA = \
+ alignment.png \
+ aspectframe.png \
+ accellabel.png \
+ arrow.png \
+ aboutdialog.png \
+ button.png \
+ combobox.png \
+ comboboxentry.png \
+ colorbutton.png \
+ calendar.png \
+ checkbutton.png \
+ checkmenuitem.png \
+ colorselection.png \
+ colorselectiondialog.png \
+ combo.png \
+ curve.png \
+ custom.png \
+ clist.png \
+ dialog.png \
+ drawingarea.png \
+ entry.png \
+ eventbox.png \
+ expander.png \
+ fileselection.png \
+ filechooserdialog.png \
+ filechooserbutton.png \
+ fixed.png \
+ fontselection.png \
+ fontbutton.png \
+ fontselectiondialog.png \
+ frame.png \
+ gammacurve.png \
+ handlebox.png \
+ hbox.png \
+ hbuttonbox.png \
+ hpaned.png \
+ hruler.png \
+ hscale.png \
+ hscrollbar.png \
+ hseparator.png \
+ iconview.png \
+ image.png \
+ inputdialog.png \
+ imagemenuitem.png \
+ label.png \
+ layout.png \
+ list.png \
+ listitem.png \
+ menu.png \
+ menuitem.png \
+ menutoolbutton.png \
+ menubar.png \
+ messagedialog.png \
+ notebook.png \
+ optionmenu.png \
+ progressbar.png \
+ radiobutton.png \
+ radiomenuitem.png \
+ radiotoolbutton.png \
+ ruler.png \
+ scrolledwindow.png \
+ spinbutton.png \
+ statusbar.png \
+ separatormenuitem.png \
+ separatortoolitem.png \
+ table.png \
+ textview.png \
+ togglebutton.png \
+ toolbar.png \
+ treeview.png \
+ toolitem.png \
+ toolbutton.png \
+ toggletoolbutton.png \
+ vbox.png \
+ vbuttonbox.png \
+ viewport.png \
+ vpaned.png \
+ vruler.png \
+ vscale.png \
+ vscrollbar.png \
+ vseparator.png \
+ window.png
+
+EXTRA_DIST = $(icons_DATA)
diff --git a/plugins/gtk+/icons/16x16/aboutdialog.png b/plugins/gtk+/icons/16x16/aboutdialog.png
new file mode 100644
index 00000000..2e64933e
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/aboutdialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/accellabel.png b/plugins/gtk+/icons/16x16/accellabel.png
new file mode 100644
index 00000000..bfb41cab
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/accellabel.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/alignment.png b/plugins/gtk+/icons/16x16/alignment.png
new file mode 100644
index 00000000..6e4d0729
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/alignment.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/arrow.png b/plugins/gtk+/icons/16x16/arrow.png
new file mode 100644
index 00000000..d4fe2f24
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/arrow.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/aspectframe.png b/plugins/gtk+/icons/16x16/aspectframe.png
new file mode 100644
index 00000000..2a1f0491
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/aspectframe.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/button.png b/plugins/gtk+/icons/16x16/button.png
new file mode 100644
index 00000000..a8cb6ccf
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/button.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/calendar.png b/plugins/gtk+/icons/16x16/calendar.png
new file mode 100644
index 00000000..db199fe4
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/calendar.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/checkbutton.png b/plugins/gtk+/icons/16x16/checkbutton.png
new file mode 100644
index 00000000..94a7d2ae
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/checkbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/checkmenuitem.png b/plugins/gtk+/icons/16x16/checkmenuitem.png
new file mode 100644
index 00000000..0314ca4c
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/checkmenuitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/clist.png b/plugins/gtk+/icons/16x16/clist.png
new file mode 100644
index 00000000..74aa4f33
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/clist.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/colorbutton.png b/plugins/gtk+/icons/16x16/colorbutton.png
new file mode 100644
index 00000000..49c077db
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/colorbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/colorselection.png b/plugins/gtk+/icons/16x16/colorselection.png
new file mode 100644
index 00000000..8e68eb33
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/colorselection.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/colorselectiondialog.png b/plugins/gtk+/icons/16x16/colorselectiondialog.png
new file mode 100644
index 00000000..489993eb
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/colorselectiondialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/combo.png b/plugins/gtk+/icons/16x16/combo.png
new file mode 100644
index 00000000..55fad234
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/combo.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/combobox.png b/plugins/gtk+/icons/16x16/combobox.png
new file mode 100644
index 00000000..f940ba17
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/combobox.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/comboboxentry.png b/plugins/gtk+/icons/16x16/comboboxentry.png
new file mode 100644
index 00000000..a76ad8bf
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/comboboxentry.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/curve.png b/plugins/gtk+/icons/16x16/curve.png
new file mode 100644
index 00000000..bd65d534
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/curve.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/custom.png b/plugins/gtk+/icons/16x16/custom.png
new file mode 100644
index 00000000..4f15f868
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/custom.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/default.png b/plugins/gtk+/icons/16x16/default.png
new file mode 100644
index 00000000..ebd23733
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/default.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/dialog.png b/plugins/gtk+/icons/16x16/dialog.png
new file mode 100644
index 00000000..0d5cf63b
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/dialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/drawingarea.png b/plugins/gtk+/icons/16x16/drawingarea.png
new file mode 100644
index 00000000..b76a6fe0
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/drawingarea.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/entry.png b/plugins/gtk+/icons/16x16/entry.png
new file mode 100644
index 00000000..d1d0c6fa
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/entry.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/eventbox.png b/plugins/gtk+/icons/16x16/eventbox.png
new file mode 100644
index 00000000..e3f48e02
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/eventbox.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/expander.png b/plugins/gtk+/icons/16x16/expander.png
new file mode 100644
index 00000000..a410114a
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/expander.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/filechooserbutton.png b/plugins/gtk+/icons/16x16/filechooserbutton.png
new file mode 100644
index 00000000..aec37f30
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/filechooserbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/filechooserdialog.png b/plugins/gtk+/icons/16x16/filechooserdialog.png
new file mode 100644
index 00000000..39a9fdd4
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/filechooserdialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/fileselection.png b/plugins/gtk+/icons/16x16/fileselection.png
new file mode 100644
index 00000000..39a9fdd4
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/fileselection.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/fileselectiondialog.png b/plugins/gtk+/icons/16x16/fileselectiondialog.png
new file mode 100644
index 00000000..39a9fdd4
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/fileselectiondialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/fixed.png b/plugins/gtk+/icons/16x16/fixed.png
new file mode 100644
index 00000000..632f3db2
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/fixed.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/fontbutton.png b/plugins/gtk+/icons/16x16/fontbutton.png
new file mode 100644
index 00000000..8fa2d501
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/fontbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/fontselection.png b/plugins/gtk+/icons/16x16/fontselection.png
new file mode 100644
index 00000000..f0b91baa
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/fontselection.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/fontselectiondialog.png b/plugins/gtk+/icons/16x16/fontselectiondialog.png
new file mode 100644
index 00000000..fd37e9fd
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/fontselectiondialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/frame.png b/plugins/gtk+/icons/16x16/frame.png
new file mode 100644
index 00000000..4c138882
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/frame.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/gammacurve.png b/plugins/gtk+/icons/16x16/gammacurve.png
new file mode 100644
index 00000000..bd65d534
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/gammacurve.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/gtktextview.png b/plugins/gtk+/icons/16x16/gtktextview.png
new file mode 100644
index 00000000..db9953dc
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/gtktextview.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/handlebox.png b/plugins/gtk+/icons/16x16/handlebox.png
new file mode 100644
index 00000000..a56584e5
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/handlebox.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/hbox.png b/plugins/gtk+/icons/16x16/hbox.png
new file mode 100644
index 00000000..dc65efd8
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/hbox.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/hbuttonbox.png b/plugins/gtk+/icons/16x16/hbuttonbox.png
new file mode 100644
index 00000000..bedcf633
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/hbuttonbox.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/hpaned.png b/plugins/gtk+/icons/16x16/hpaned.png
new file mode 100644
index 00000000..89c7179e
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/hpaned.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/hruler.png b/plugins/gtk+/icons/16x16/hruler.png
new file mode 100644
index 00000000..ead5074d
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/hruler.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/hscale.png b/plugins/gtk+/icons/16x16/hscale.png
new file mode 100644
index 00000000..be3dfe61
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/hscale.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/hscrollbar.png b/plugins/gtk+/icons/16x16/hscrollbar.png
new file mode 100644
index 00000000..1c3fd316
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/hscrollbar.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/hseparator.png b/plugins/gtk+/icons/16x16/hseparator.png
new file mode 100644
index 00000000..7ba5235d
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/hseparator.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/iconview.png b/plugins/gtk+/icons/16x16/iconview.png
new file mode 100644
index 00000000..48439286
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/iconview.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/image.png b/plugins/gtk+/icons/16x16/image.png
new file mode 100644
index 00000000..8a351fcd
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/image.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/imagemenuitem.png b/plugins/gtk+/icons/16x16/imagemenuitem.png
new file mode 100644
index 00000000..cfca370c
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/imagemenuitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/inputdialog.png b/plugins/gtk+/icons/16x16/inputdialog.png
new file mode 100644
index 00000000..4b875985
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/inputdialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/label.png b/plugins/gtk+/icons/16x16/label.png
new file mode 100644
index 00000000..d9bf150b
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/label.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/layout.png b/plugins/gtk+/icons/16x16/layout.png
new file mode 100644
index 00000000..ccfd8d37
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/layout.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/list.png b/plugins/gtk+/icons/16x16/list.png
new file mode 100644
index 00000000..e43577b2
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/list.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/listitem.png b/plugins/gtk+/icons/16x16/listitem.png
new file mode 100644
index 00000000..76eb0a2d
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/listitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/menu.png b/plugins/gtk+/icons/16x16/menu.png
new file mode 100644
index 00000000..76a23179
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/menu.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/menubar.png b/plugins/gtk+/icons/16x16/menubar.png
new file mode 100644
index 00000000..1d6f587e
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/menubar.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/menuitem.png b/plugins/gtk+/icons/16x16/menuitem.png
new file mode 100644
index 00000000..14d81749
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/menuitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/menutoolbutton.png b/plugins/gtk+/icons/16x16/menutoolbutton.png
new file mode 100644
index 00000000..4c97e7ff
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/menutoolbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/messagedialog.png b/plugins/gtk+/icons/16x16/messagedialog.png
new file mode 100644
index 00000000..c3643f16
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/messagedialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/notebook.png b/plugins/gtk+/icons/16x16/notebook.png
new file mode 100644
index 00000000..6285a782
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/notebook.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/optionmenu.png b/plugins/gtk+/icons/16x16/optionmenu.png
new file mode 100644
index 00000000..a76ad8bf
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/optionmenu.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/progressbar.png b/plugins/gtk+/icons/16x16/progressbar.png
new file mode 100644
index 00000000..dbb9ede0
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/progressbar.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/radiobutton.png b/plugins/gtk+/icons/16x16/radiobutton.png
new file mode 100644
index 00000000..c332ad65
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/radiobutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/radiomenuitem.png b/plugins/gtk+/icons/16x16/radiomenuitem.png
new file mode 100644
index 00000000..27764c4e
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/radiomenuitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/radiotoolbutton.png b/plugins/gtk+/icons/16x16/radiotoolbutton.png
new file mode 100644
index 00000000..f224fcb7
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/radiotoolbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/ruler.png b/plugins/gtk+/icons/16x16/ruler.png
new file mode 100644
index 00000000..ead5074d
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/ruler.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/scrolledwindow.png b/plugins/gtk+/icons/16x16/scrolledwindow.png
new file mode 100644
index 00000000..b2f3a613
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/scrolledwindow.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/separatormenuitem.png b/plugins/gtk+/icons/16x16/separatormenuitem.png
new file mode 100644
index 00000000..45ce1d0b
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/separatormenuitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/separatortoolitem.png b/plugins/gtk+/icons/16x16/separatortoolitem.png
new file mode 100644
index 00000000..d020aa7d
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/separatortoolitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/spinbutton.png b/plugins/gtk+/icons/16x16/spinbutton.png
new file mode 100644
index 00000000..2c854d3e
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/spinbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/statusbar.png b/plugins/gtk+/icons/16x16/statusbar.png
new file mode 100644
index 00000000..bd0ff941
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/statusbar.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/table.png b/plugins/gtk+/icons/16x16/table.png
new file mode 100644
index 00000000..be9f7498
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/table.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/textview.png b/plugins/gtk+/icons/16x16/textview.png
new file mode 100644
index 00000000..832a5bf4
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/textview.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/togglebutton.png b/plugins/gtk+/icons/16x16/togglebutton.png
new file mode 100644
index 00000000..ead436ff
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/togglebutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/toggletoolbutton.png b/plugins/gtk+/icons/16x16/toggletoolbutton.png
new file mode 100644
index 00000000..94c97490
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/toggletoolbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/toolbar.png b/plugins/gtk+/icons/16x16/toolbar.png
new file mode 100644
index 00000000..21e34541
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/toolbar.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/toolbutton.png b/plugins/gtk+/icons/16x16/toolbutton.png
new file mode 100644
index 00000000..74ea6dcc
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/toolbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/toolitem.png b/plugins/gtk+/icons/16x16/toolitem.png
new file mode 100644
index 00000000..231c2638
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/toolitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/treeview.png b/plugins/gtk+/icons/16x16/treeview.png
new file mode 100644
index 00000000..74aa4f33
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/treeview.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/vbox.png b/plugins/gtk+/icons/16x16/vbox.png
new file mode 100644
index 00000000..73c8213c
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/vbox.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/vbuttonbox.png b/plugins/gtk+/icons/16x16/vbuttonbox.png
new file mode 100644
index 00000000..d37d4df5
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/vbuttonbox.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/viewport.png b/plugins/gtk+/icons/16x16/viewport.png
new file mode 100644
index 00000000..f2813f75
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/viewport.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/vpaned.png b/plugins/gtk+/icons/16x16/vpaned.png
new file mode 100644
index 00000000..03363b06
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/vpaned.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/vruler.png b/plugins/gtk+/icons/16x16/vruler.png
new file mode 100644
index 00000000..b927c155
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/vruler.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/vscale.png b/plugins/gtk+/icons/16x16/vscale.png
new file mode 100644
index 00000000..d5e77fd5
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/vscale.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/vscrollbar.png b/plugins/gtk+/icons/16x16/vscrollbar.png
new file mode 100644
index 00000000..fd87b3e5
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/vscrollbar.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/vseparator.png b/plugins/gtk+/icons/16x16/vseparator.png
new file mode 100644
index 00000000..6c07eda8
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/vseparator.png
Binary files differ
diff --git a/plugins/gtk+/icons/16x16/window.png b/plugins/gtk+/icons/16x16/window.png
new file mode 100644
index 00000000..dfbe790e
--- /dev/null
+++ b/plugins/gtk+/icons/16x16/window.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/Makefile.am b/plugins/gtk+/icons/22x22/Makefile.am
new file mode 100644
index 00000000..34975783
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/Makefile.am
@@ -0,0 +1,89 @@
+## Process this file with automake to produce Makefile.in
+
+iconsdir = $(pkgdatadir)/pixmaps/22x22
+
+icons_DATA = \
+ alignment.png \
+ aspectframe.png \
+ accellabel.png \
+ arrow.png \
+ aboutdialog.png \
+ button.png \
+ combobox.png \
+ comboboxentry.png \
+ colorbutton.png \
+ calendar.png \
+ checkbutton.png \
+ checkmenuitem.png \
+ colorselection.png \
+ colorselectiondialog.png \
+ combo.png \
+ curve.png \
+ custom.png \
+ clist.png \
+ dialog.png \
+ drawingarea.png \
+ entry.png \
+ eventbox.png \
+ expander.png \
+ fileselection.png \
+ filechooserdialog.png \
+ filechooserbutton.png \
+ fixed.png \
+ fontselection.png \
+ fontbutton.png \
+ fontselectiondialog.png \
+ frame.png \
+ gammacurve.png \
+ handlebox.png \
+ hbox.png \
+ hbuttonbox.png \
+ hpaned.png \
+ hruler.png \
+ hscale.png \
+ hscrollbar.png \
+ hseparator.png \
+ iconview.png \
+ image.png \
+ imagemenuitem.png \
+ inputdialog.png \
+ label.png \
+ layout.png \
+ list.png \
+ listitem.png \
+ menu.png \
+ menuitem.png \
+ menubar.png \
+ menutoolbutton.png \
+ messagedialog.png \
+ notebook.png \
+ optionmenu.png \
+ progressbar.png \
+ radiobutton.png \
+ ruler.png \
+ radiomenuitem.png \
+ radiotoolbutton.png \
+ scrolledwindow.png \
+ spinbutton.png \
+ statusbar.png \
+ separatormenuitem.png \
+ separatortoolitem.png \
+ table.png \
+ textview.png \
+ togglebutton.png \
+ toolbar.png \
+ treeview.png \
+ toolitem.png \
+ toolbutton.png \
+ toggletoolbutton.png \
+ vbox.png \
+ vbuttonbox.png \
+ viewport.png \
+ vpaned.png \
+ vruler.png \
+ vscale.png \
+ vscrollbar.png \
+ vseparator.png \
+ window.png
+
+EXTRA_DIST = $(icons_DATA)
diff --git a/plugins/gtk+/icons/22x22/aboutdialog.png b/plugins/gtk+/icons/22x22/aboutdialog.png
new file mode 100644
index 00000000..00152359
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/aboutdialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/accellabel.png b/plugins/gtk+/icons/22x22/accellabel.png
new file mode 100644
index 00000000..1b1e7c59
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/accellabel.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/alignment.png b/plugins/gtk+/icons/22x22/alignment.png
new file mode 100644
index 00000000..8f78d828
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/alignment.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/arrow.png b/plugins/gtk+/icons/22x22/arrow.png
new file mode 100644
index 00000000..ea133096
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/arrow.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/aspectframe.png b/plugins/gtk+/icons/22x22/aspectframe.png
new file mode 100644
index 00000000..2f2939f1
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/aspectframe.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/button.png b/plugins/gtk+/icons/22x22/button.png
new file mode 100644
index 00000000..842a4328
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/button.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/calendar.png b/plugins/gtk+/icons/22x22/calendar.png
new file mode 100644
index 00000000..bd297c4e
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/calendar.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/checkbutton.png b/plugins/gtk+/icons/22x22/checkbutton.png
new file mode 100644
index 00000000..2d05343c
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/checkbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/checkmenuitem.png b/plugins/gtk+/icons/22x22/checkmenuitem.png
new file mode 100644
index 00000000..a59a9c06
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/checkmenuitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/clist.png b/plugins/gtk+/icons/22x22/clist.png
new file mode 100644
index 00000000..ab19494e
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/clist.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/colorbutton.png b/plugins/gtk+/icons/22x22/colorbutton.png
new file mode 100644
index 00000000..ff4676ac
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/colorbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/colorselection.png b/plugins/gtk+/icons/22x22/colorselection.png
new file mode 100644
index 00000000..76a015ca
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/colorselection.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/colorselectiondialog.png b/plugins/gtk+/icons/22x22/colorselectiondialog.png
new file mode 100644
index 00000000..9c4a3ba2
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/colorselectiondialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/combo.png b/plugins/gtk+/icons/22x22/combo.png
new file mode 100644
index 00000000..19d5a883
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/combo.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/combobox.png b/plugins/gtk+/icons/22x22/combobox.png
new file mode 100644
index 00000000..3fc3436b
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/combobox.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/comboboxentry.png b/plugins/gtk+/icons/22x22/comboboxentry.png
new file mode 100644
index 00000000..89d0fa1f
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/comboboxentry.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/curve.png b/plugins/gtk+/icons/22x22/curve.png
new file mode 100644
index 00000000..d4412862
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/curve.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/custom.png b/plugins/gtk+/icons/22x22/custom.png
new file mode 100644
index 00000000..473f6a89
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/custom.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/default.png b/plugins/gtk+/icons/22x22/default.png
new file mode 100644
index 00000000..dda2ad7f
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/default.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/dialog.png b/plugins/gtk+/icons/22x22/dialog.png
new file mode 100644
index 00000000..575ebf5d
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/dialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/drawingarea.png b/plugins/gtk+/icons/22x22/drawingarea.png
new file mode 100644
index 00000000..6803cc6d
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/drawingarea.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/entry.png b/plugins/gtk+/icons/22x22/entry.png
new file mode 100644
index 00000000..443e4c2c
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/entry.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/eventbox.png b/plugins/gtk+/icons/22x22/eventbox.png
new file mode 100644
index 00000000..00b93b1e
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/eventbox.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/expander.png b/plugins/gtk+/icons/22x22/expander.png
new file mode 100644
index 00000000..6a8ae07a
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/expander.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/filechooserbutton.png b/plugins/gtk+/icons/22x22/filechooserbutton.png
new file mode 100644
index 00000000..6b5c7734
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/filechooserbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/filechooserdialog.png b/plugins/gtk+/icons/22x22/filechooserdialog.png
new file mode 100644
index 00000000..b51dc1d8
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/filechooserdialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/fileselection.png b/plugins/gtk+/icons/22x22/fileselection.png
new file mode 100644
index 00000000..b51dc1d8
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/fileselection.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/fixed.png b/plugins/gtk+/icons/22x22/fixed.png
new file mode 100644
index 00000000..e6d5ece8
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/fixed.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/fontbutton.png b/plugins/gtk+/icons/22x22/fontbutton.png
new file mode 100644
index 00000000..79a88eb2
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/fontbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/fontselection.png b/plugins/gtk+/icons/22x22/fontselection.png
new file mode 100644
index 00000000..c1ae1881
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/fontselection.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/fontselectiondialog.png b/plugins/gtk+/icons/22x22/fontselectiondialog.png
new file mode 100644
index 00000000..38e76171
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/fontselectiondialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/frame.png b/plugins/gtk+/icons/22x22/frame.png
new file mode 100644
index 00000000..8be0acd7
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/frame.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/gammacurve.png b/plugins/gtk+/icons/22x22/gammacurve.png
new file mode 100644
index 00000000..d4412862
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/gammacurve.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/handlebox.png b/plugins/gtk+/icons/22x22/handlebox.png
new file mode 100644
index 00000000..a66fd065
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/handlebox.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/hbox.png b/plugins/gtk+/icons/22x22/hbox.png
new file mode 100644
index 00000000..eef38243
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/hbox.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/hbuttonbox.png b/plugins/gtk+/icons/22x22/hbuttonbox.png
new file mode 100644
index 00000000..538a2fb9
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/hbuttonbox.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/hpaned.png b/plugins/gtk+/icons/22x22/hpaned.png
new file mode 100644
index 00000000..b186b261
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/hpaned.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/hruler.png b/plugins/gtk+/icons/22x22/hruler.png
new file mode 100644
index 00000000..85d2470f
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/hruler.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/hscale.png b/plugins/gtk+/icons/22x22/hscale.png
new file mode 100644
index 00000000..307f45cd
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/hscale.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/hscrollbar.png b/plugins/gtk+/icons/22x22/hscrollbar.png
new file mode 100644
index 00000000..7330cc3c
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/hscrollbar.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/hseparator.png b/plugins/gtk+/icons/22x22/hseparator.png
new file mode 100644
index 00000000..cc3ead86
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/hseparator.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/iconview.png b/plugins/gtk+/icons/22x22/iconview.png
new file mode 100644
index 00000000..fcf5bcb3
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/iconview.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/image.png b/plugins/gtk+/icons/22x22/image.png
new file mode 100644
index 00000000..414ae1c4
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/image.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/imagemenuitem.png b/plugins/gtk+/icons/22x22/imagemenuitem.png
new file mode 100644
index 00000000..5f5a3492
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/imagemenuitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/inputdialog.png b/plugins/gtk+/icons/22x22/inputdialog.png
new file mode 100644
index 00000000..23be2ca3
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/inputdialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/label.png b/plugins/gtk+/icons/22x22/label.png
new file mode 100644
index 00000000..952520b1
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/label.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/layout.png b/plugins/gtk+/icons/22x22/layout.png
new file mode 100644
index 00000000..1ed9807f
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/layout.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/list.png b/plugins/gtk+/icons/22x22/list.png
new file mode 100644
index 00000000..80ad0215
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/list.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/listitem.png b/plugins/gtk+/icons/22x22/listitem.png
new file mode 100644
index 00000000..ebd4873a
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/listitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/menu.png b/plugins/gtk+/icons/22x22/menu.png
new file mode 100644
index 00000000..d9c9020f
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/menu.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/menubar.png b/plugins/gtk+/icons/22x22/menubar.png
new file mode 100644
index 00000000..9edfbbc2
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/menubar.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/menuitem.png b/plugins/gtk+/icons/22x22/menuitem.png
new file mode 100644
index 00000000..b14b1452
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/menuitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/menutoolbutton.png b/plugins/gtk+/icons/22x22/menutoolbutton.png
new file mode 100644
index 00000000..8db5d314
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/menutoolbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/messagedialog.png b/plugins/gtk+/icons/22x22/messagedialog.png
new file mode 100644
index 00000000..df878d30
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/messagedialog.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/notebook.png b/plugins/gtk+/icons/22x22/notebook.png
new file mode 100644
index 00000000..8aeebe74
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/notebook.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/optionmenu.png b/plugins/gtk+/icons/22x22/optionmenu.png
new file mode 100644
index 00000000..fcb2a63a
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/optionmenu.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/progressbar.png b/plugins/gtk+/icons/22x22/progressbar.png
new file mode 100644
index 00000000..202aeadb
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/progressbar.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/radiobutton.png b/plugins/gtk+/icons/22x22/radiobutton.png
new file mode 100644
index 00000000..080f4b0a
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/radiobutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/radiomenuitem.png b/plugins/gtk+/icons/22x22/radiomenuitem.png
new file mode 100644
index 00000000..67b9aec2
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/radiomenuitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/radiotoolbutton.png b/plugins/gtk+/icons/22x22/radiotoolbutton.png
new file mode 100644
index 00000000..78f245fb
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/radiotoolbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/ruler.png b/plugins/gtk+/icons/22x22/ruler.png
new file mode 100644
index 00000000..85d2470f
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/ruler.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/scrolledwindow.png b/plugins/gtk+/icons/22x22/scrolledwindow.png
new file mode 100644
index 00000000..d88b4344
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/scrolledwindow.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/separatormenuitem.png b/plugins/gtk+/icons/22x22/separatormenuitem.png
new file mode 100644
index 00000000..0c80495e
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/separatormenuitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/separatortoolitem.png b/plugins/gtk+/icons/22x22/separatortoolitem.png
new file mode 100644
index 00000000..4bd093ef
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/separatortoolitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/spinbutton.png b/plugins/gtk+/icons/22x22/spinbutton.png
new file mode 100644
index 00000000..9693ac83
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/spinbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/statusbar.png b/plugins/gtk+/icons/22x22/statusbar.png
new file mode 100644
index 00000000..ee0aa60d
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/statusbar.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/table.png b/plugins/gtk+/icons/22x22/table.png
new file mode 100644
index 00000000..be61044b
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/table.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/textview.png b/plugins/gtk+/icons/22x22/textview.png
new file mode 100644
index 00000000..b957492e
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/textview.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/togglebutton.png b/plugins/gtk+/icons/22x22/togglebutton.png
new file mode 100644
index 00000000..e22086a3
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/togglebutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/toggletoolbutton.png b/plugins/gtk+/icons/22x22/toggletoolbutton.png
new file mode 100644
index 00000000..4bee9a00
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/toggletoolbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/toolbar.png b/plugins/gtk+/icons/22x22/toolbar.png
new file mode 100644
index 00000000..b003fa40
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/toolbar.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/toolbutton.png b/plugins/gtk+/icons/22x22/toolbutton.png
new file mode 100644
index 00000000..9133dc06
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/toolbutton.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/toolitem.png b/plugins/gtk+/icons/22x22/toolitem.png
new file mode 100644
index 00000000..2f6433b0
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/toolitem.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/treeview.png b/plugins/gtk+/icons/22x22/treeview.png
new file mode 100644
index 00000000..ab19494e
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/treeview.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/vbox.png b/plugins/gtk+/icons/22x22/vbox.png
new file mode 100644
index 00000000..209d9c7f
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/vbox.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/vbuttonbox.png b/plugins/gtk+/icons/22x22/vbuttonbox.png
new file mode 100644
index 00000000..f241e680
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/vbuttonbox.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/viewport.png b/plugins/gtk+/icons/22x22/viewport.png
new file mode 100644
index 00000000..79806057
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/viewport.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/vpaned.png b/plugins/gtk+/icons/22x22/vpaned.png
new file mode 100644
index 00000000..f318a2cb
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/vpaned.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/vruler.png b/plugins/gtk+/icons/22x22/vruler.png
new file mode 100644
index 00000000..b66f9641
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/vruler.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/vscale.png b/plugins/gtk+/icons/22x22/vscale.png
new file mode 100644
index 00000000..611b5c93
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/vscale.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/vscrollbar.png b/plugins/gtk+/icons/22x22/vscrollbar.png
new file mode 100644
index 00000000..ba2807fb
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/vscrollbar.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/vseparator.png b/plugins/gtk+/icons/22x22/vseparator.png
new file mode 100644
index 00000000..0f078316
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/vseparator.png
Binary files differ
diff --git a/plugins/gtk+/icons/22x22/window.png b/plugins/gtk+/icons/22x22/window.png
new file mode 100644
index 00000000..b0e939f4
--- /dev/null
+++ b/plugins/gtk+/icons/22x22/window.png
Binary files differ
diff --git a/plugins/gtk+/icons/Makefile.am b/plugins/gtk+/icons/Makefile.am
new file mode 100644
index 00000000..bd39c36e
--- /dev/null
+++ b/plugins/gtk+/icons/Makefile.am
@@ -0,0 +1,3 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = 16x16 22x22