Compare commits

...

121 Commits

Author SHA1 Message Date
Tristan Van Berkom
0599c19340 * configure.ac, NEWS: Rolling Glade 3.8.1 2011-10-11 16:02:49 -04:00
Tristan Van Berkom
53e9b98cd9 * gladeui/glade-project.c: Fix glade_project_notify_has_child() to notify
that the children are gone only when the last item on that level disappears.

	Fixes bug 651673
2011-10-09 17:58:16 -04:00
Tristan Van Berkom
f26029149b Removed unused variable 2011-10-09 15:07:25 -04:00
Tristan Van Berkom
60e086b072 * gladeui/glade-property.c, gladeui/glade-xml-utils.c:
Fix a bug on the GtkComboBoxText (and probably others) when adding
	a special char (like '&') in an item's name: every characters following
	the special char disappeared while writting the xml file.

	Bug 654609.
2011-10-09 14:58:01 -04:00
Tristan Van Berkom
41bb4cabac * gladeui/glade-widget.c: Fixed glade_widget_hide() in the case that the project is
already gone.

	* gladeui/glade-command.c: Fixed glade_command_remove() to push the command on the
	  right GladeProject pointer.
2011-10-09 14:23:27 -04:00
Tristan Van Berkom
ab138983db Fixing previous commit to work for glade_gtk_widget_action_activate() 2011-10-09 14:07:42 -04:00
Tristan Van Berkom
8eaae6b309 * plugins/gtk+/glade-gtk.c: Fixed add/remove parent commands so that they work with
parentless widget references (i.e. you can add a parent to a GtkToolItemGroup's label widget
	or a GtkButton's image widget, or remove the parent of a child of a label-widget, etc).
2011-10-09 14:05:59 -04:00
Tristan Van Berkom
d8cbb8a2c1 * gladeui/glade-command.[ch]: Exposed glade_command_add() internal command so that
plugins can create command groups that play with adding/removing widgets inline without
	creating copies of them.
2011-10-09 14:05:59 -04:00
Tristan Van Berkom
db64c0238f * plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Ensure 'related-action'
and 'use-action-appearance' are serialized in the right order.

Conflicts:

	ChangeLog
	plugins/gtk+/glade-gtk.c
	plugins/gtk+/gtk+.xml.in
2011-10-09 13:30:37 -04:00
Tristan Van Berkom
653d02e290 * gladeui/glade-widget-adaptor.c: Implemented a generic ->depends() routine
to ensure that liststores are serialized before treemodelfilters which refer to them.
2011-10-09 13:27:52 -04:00
Javier Jardón
90be878744 gladeui/glade-utils.c: Correctly detect the required devhelp version 2011-04-29 20:01:41 +01:00
Tristan Van Berkom
fa8430c02a * configure.ac, NEWS: Rolling Glade 3.8. 2011-04-04 21:36:13 +09:00
Tristan Van Berkom
e036946b1d Added missing files to POTFILES.in 2011-04-04 21:29:32 +09:00
Tristan Van Berkom
7011fe70eb * removing glade-previewer.c from POTFILES.in 2011-04-04 21:22:03 +09:00
Tristan Van Berkom
322fd577e4 * plugins/gtk+/icons/*: Backported all the new icons. 2011-04-04 19:09:30 +09:00
Tristan Van Berkom
9d0178abd3 * gladeui/glade-project.[ch], gladeui/glade-widget.c: Backported glade_project_check_reordered() 2011-04-04 18:28:12 +09:00
Tristan Van Berkom
c2721dad58 Fixed ChangeLog 2011-04-04 17:54:21 +09:00
Tristan Van Berkom
7b06523620 Backporting GladeBaseEditor fixes from master 2011-04-04 17:53:31 +09:00
Tristan Van Berkom
6280a622f4 * Backed out 'preview' feature from glade-3-8 branch. 2011-04-04 16:39:07 +09:00
Tristan Van Berkom
a3a759c4f8 Fixed typo regarding signal_class->version_since_major/minor. 2011-02-25 17:34:34 +09:00
Tristan Van Berkom
b65e7d935f * gladeui/glade-widget.c: Make glade_widget_rebuild() use glade_widget_add/remove
instead of glade_widget_replace().
2011-02-05 16:30:53 +09:00
Tristan Van Berkom
94995cb196 * plugins/gtk+/gtk+.xml.in: Disabling irrelevant properties for GtkScaleButton 2011-02-05 16:29:47 +09:00
Tristan Van Berkom
2d2f2e8f3a * src/glade-window.c: Removed user manual link from Help menu, it's not online
as far as I know and no work was done on it, the current user manual needs work
	  and is just not useful in it's current state.

Conflicts:

	ChangeLog
	src/glade-window.c
2011-02-04 03:47:36 +09:00
Tristan Van Berkom
808026f04c * gladeui/glade-project.c: Fixed GladeProject to only ever report widgets that are
actually in the project from the GtkTreeModel interface.

Conflicts:

	ChangeLog
	gladeui/glade-project.c
2011-02-03 18:18:29 +09:00
Tristan Van Berkom
ea43dd1e72 * gladeui/glade-widget.[ch], gladeui/glade-project.c, gladeui/glade-utils.c: Now update
the GladeWidget's project pointer when going in and out of a project.
2011-02-03 17:58:09 +09:00
Tristan Van Berkom
735d8d7905 * plugins/gtk+/glade-model-data.c: Avoid committing the data if the data did not
change... committing the data when there is no change can cause the editor to
	  load itself, this editor does not deal with that well. Fixes crasher bug 622839.

Conflicts:

	ChangeLog
	plugins/gtk+/glade-model-data.c
2011-01-29 19:11:38 +09:00
Tristan Van Berkom
e8d3cac9dc * 41 files: Fixed typo in LGPL License file headers. 2011-01-24 17:37:35 +09:00
Tristan Van Berkom
159c553aa0 * plugins/gtk+/glade-column-types.c: Fixed crash when user performs Drag'n'Drop of
< enter column here > and no columns are yet added (fixes bug 633943).

Conflicts:

	plugins/gtk+/glade-column-types.c
2011-01-23 13:50:18 +09:00
Tristan Van Berkom
4991b8e4b6 * plugins/gtk+/gtk+.xml.in: Removing treeview's internal GtkTreeSelection from the
palette (its only available as an internal widget to a treeview).
2011-01-19 01:37:46 +09:00
Tristan Van Berkom
77f326149d * plugins/gtk+/gtk+.xml.in: Made GtkEntry icon properties save-always, fixes bug 629900. 2011-01-13 20:03:23 +09:00
Tristan Van Berkom
c10f72fd38 * plugins/gtk+/glade-attributes.c: Fixed mismatching PangoAttributeType with GType,
closes bug 597045.

Conflicts:

	ChangeLog
	plugins/gtk+/glade-attributes.c
2011-01-13 18:41:45 +09:00
Tristan Van Berkom
ec886835d3 Fixed some typos in glade-widget-adaptor.c 2011-01-12 17:33:31 +09:00
Takeshi AIHANA
fb5acabaee Updated Japanese translation. 2011-01-10 09:51:48 +09:00
Tristan Van Berkom
2917d90b9d * plugins/gtk+/glade-gtk.c: Fixed GtkMenuToolButton to save the "menu" child properly 2011-01-09 15:59:33 +09:00
Tristan Van Berkom
56822f3acd * gladeui/glade-editor.c: Make query dialog come with a "Create" button instead
of an "OK" button, closes bug 503621.

Conflicts:

	ChangeLog
	gladeui/glade-editor.c
2011-01-09 15:58:55 +09:00
Tristan Van Berkom
88d395d008 * plugins/Makefile.am, plugins/glade-tool-item-group-editor.[ch], plugins/gtk+.xml.in,
plugins/glade-gtk.c: Added support for editing GtkToolPalette.

Conflicts:

	ChangeLog
	plugins/gtk+/Makefile.am
	plugins/gtk+/glade-gtk.c
	plugins/gtk+/gtk+.xml.in
2011-01-09 01:06:10 +09:00
Tristan Van Berkom
e4009a9ddc Updated configure.ac for 3.7.3 2011-01-06 20:06:40 +09:00
Tristan Van Berkom
a6f96e8648 Added glade-design-view to POTFILES.in 2011-01-06 19:51:19 +09:00
Tristan Van Berkom
703465fee1 * NEWS: Rolling 3.7.3 2011-01-06 19:45:59 +09:00
Tristan Van Berkom
52e604e579 * gladeui/glade-project.c, gladeui/glade-id-allocator.c: Dont index unallocated
memory when releasing a widget name that was never allocated (this can happen
	  for loaded widgets with a number), fixes crash when setting naming policy for
	  glom_developer.glade.

Conflicts:

	ChangeLog
	gladeui/glade-id-allocator.c
	gladeui/glade-name-context.c
	gladeui/glade-project.c
2011-01-04 00:15:42 +09:00
Tristan Van Berkom
7e38b699a5 Removed some debug print form backend. 2010-12-31 15:33:34 +09:00
Tristan Van Berkom
506f362439 * plugins/gtk+/gtk+.xml.in: Setting "can-focus" as "save-always" for all widgets (bug 638079).
Conflicts:

	plugins/gtk+/gtk+.xml.in
2010-12-31 15:12:21 +09:00
Tristan Van Berkom
439a0023ea * m4/python.m4: Applying patch to allow better builds on win32, patch by Dieter Verfaillie,
bug 634978.
2010-12-31 14:05:40 +09:00
Tristan Van Berkom
b7871f94c7 Reordering ChangeLog. 2010-12-31 13:48:30 +09:00
Tristan Van Berkom
82876113e4 * gladeui/glade-property.c: Fixed glade_property_dup() to not incidentally sync the property
object's value as a consequence of dupping (backend uses this to write properties with custom
	  values and does not expect that).
2010-12-31 13:47:56 +09:00
Tristan Van Berkom
931d990a57 * plugins/gtk+/glade-gtk.c: Fixed loaded state of use-action-appearance so that it always
loads as FALSE if there is no "related-action" at load time.
2010-12-31 13:47:55 +09:00
Tristan Van Berkom
81e607ffe9 * gladeui/glade-project.c: Further fixing project dispose cycle, still leaking a little
bit of memory for large projects but no crashes.
2010-12-31 13:47:55 +09:00
Christian Persch
01632029de Use locale-independent strtod & dtostr
Bug #616787.
2010-12-30 17:37:35 +01:00
Tristan Van Berkom
3b687eacd3 Fixing action editor to disallow actions children of actions. 2010-12-30 23:49:26 +09:00
Tristan Van Berkom
a8efde750c Cleanup action editor. 2010-12-30 23:43:04 +09:00
Tristan Van Berkom
7562be851e * plugins/gtk+/glade-gtk.c, plugins/gtk+/gtk+.xml.in: Added editor to edit
GtkAction/GtkActionGroup hierarchies.
2010-12-30 23:37:01 +09:00
Tristan Van Berkom
52718afdab * gladeui/glade-base-editor.c: Remove restriction for only GtkContainer widgets. 2010-12-30 23:36:00 +09:00
Tristan Van Berkom
2b0b886a49 * plugins/gtk+/glade-tool-button-editor.c: Fixed unbalanced refcount of a sizegroup in the
toolbutton editor.
2010-12-30 22:30:49 +09:00
Tristan Van Berkom
433e15951b * gladeui/glade-base-editor.c, gladeui/glade-command.c: Avoid setting a null name on a widget. 2010-12-30 22:16:30 +09:00
Tristan Van Berkom
2206156612 * plugins/gtk+/gtk+.xml.in: Updated catalog for 2.22 and 2.24 symbols. 2010-12-30 21:28:06 +09:00
Tristan Van Berkom
b05518e3f0 * gladeui/Makefile.am, gladeui/glade-project.c: Changed glade-previewer install name
to glade-3-previewer, reserving the former name for parallel installable 3.10.
2010-12-29 20:54:01 +09:00
Tristan Van Berkom
3e75c62574 * gladeui/glade-design-view.c: Made loading progress bar nicer looking and ellipsizing. 2010-12-29 20:47:25 +09:00
Tristan Van Berkom
97463172d8 * gladeui/Makefile.am, gladeui/glade.h, gladeui/glade-clipboard.c, gladeui/glade-app.[ch],
src/glade-window.c, gladeui/glade-clipboard-view.[ch]:
	Removed GladeClipboradView completely.
2010-12-28 14:56:32 +09:00
Tristan Van Berkom
9432e094df * gladeui/glade-project.c: Fixed glade-project to unset the loading flag when
loading project dependancies are not satisfied and there is an early return.
2010-12-27 14:04:41 +09:00
Tristan Van Berkom
062bbde424 Slightly modified notebook tab progress bar style (give it a good width) 2010-12-22 17:30:58 +09:00
Tristan Van Berkom
af7f4a36e6 * gladeui/glade-project.c: Added "parse-began" signal
* gladeui/glade-design-view.c: Hide workspace and show load progress
	  while loading so that one cannot access project widgets during the load
	  (insensitive workspace was problematic and causing some loaded project
	  windows to be permanently insensitive).

	* src/glade-window.c: Avoid any messups during project load, cannot close
	  projects while they are loading, etc.
2010-12-22 17:13:41 +09:00
Tristan Van Berkom
20f158b9b0 * gladeui/glade-project.[ch]: Removed dialog and added "load-progress" signal
* gladeui/glade-app.c: Protect against commands executed on loading projects

	* src/glade-window.c: Added load progressbar to notebook tabs.
2010-12-22 12:40:50 +09:00
Tristan Van Berkom
3f7e53b942 Added loading objects dialog with progress and cancel.
* src/main.c: Display window before loading command line specified projects.

	* gladeui/glade-project.[ch]: Added dialog that pops up when about to load
	  a large project with glade_project_push_project() to push the progress and
	  glade_project_load_cancelled() to check and abort while loading the project.

	* gladeui/glade-widget.c, gladeui/glade-widget-adaptor.c: Push progress and
	  abort loading when project indicates the user cancelled the load.
2010-12-21 13:30:37 +09:00
Tristan Van Berkom
63fe388d55 * gladeui/glade-editor-property.c, gladeui/glade-property.c, gladeui/glade-widget.c,
plugins/gtk+/glade-gtk.c: Fixing some discrepincies searching for properties as
	  regular properties or packing properties. Now the conflicting "position" property
	  on a GtkPaned widget packed into a GtkBox widget works properly (bug 637475).
2010-12-20 18:47:56 +09:00
Tristan Van Berkom
57901749ee * gladeui/glade-editor.c: Fixed class header of GladeEditor to update when
widgets unload (patch by Marco Diego Aurélio Mesquita, bug 637541).
2010-12-20 17:23:48 +09:00
Tristan Van Berkom
325320f27d * gladeui/glade-project.c: Applying Marco Diego Aurélio Mesquita's patch to
make the project preview only preview toplevels.
2010-12-20 17:13:52 +09:00
Tristan Van Berkom
b4ab27e262 * plugins/gtk+/glade-label-editor.c: Dont add invisible properties to the editor,
instead the invisible editor-property gets tied to the life-cycle of the table
	  it would have been added to (since recently glade_editor_property() explicitly
	  shows/hides properties according to if thier widget actually has an instance
	  of the property).
2010-12-20 17:04:51 +09:00
Tristan Van Berkom
7f8dc0d8b6 * plugins/gtk+/glade-gtk.c, plugins/gtk+/glade-column-types.[ch]: Added
glade_column_type_new() to create a GladeColumnType struct properly using
	  g_slice_new0(). An occurance of allocating the struct with g_new0 was causing
	  Glade to crash when freeing the block with g_slice_free (bug 637563). Many
	  big thanks to Benjamin Otte for tracking down the problem.
2010-12-20 16:51:41 +09:00
Tristan Van Berkom
607b0dde4c Fixed unused variables in GladeWidget source 2010-12-20 16:48:35 +09:00
Tristan Van Berkom
124736281b Removed debug prints from GladeProject 2010-12-20 16:48:06 +09:00
Benjamin Otte
d2b6edef65 small build fix
A clean checkout could fail to find the lib when run with make -j
2010-12-20 03:37:46 +01:00
Tristan Van Berkom
301a3aa6de Moved unparenting of all widgets back to GladeProject at dispose time.
This ensures that the deepest children are finalized first.
2010-12-20 11:35:37 +09:00
Tristan Van Berkom
327b18ec94 * gladeui/glade-widget.[ch]: Hide glade_widget_set_object(), improved reference count
balancing and fixed segfaults upon closing projects that contain filechooser dialogs
	  referenced by filechooserbuttons.
2010-12-19 20:07:12 +09:00
Tristan Van Berkom
d0a49f682b Small code cleanup in GladeProject. 2010-12-19 20:05:50 +09:00
Tristan Van Berkom
b38d37e96a * plugins/gtk+/glade-gtk.c: Removed alpha_sort_box_children(), project needs to be
sorted with box children by position, loading process depends on this.
2010-12-19 20:05:23 +09:00
Tristan Van Berkom
480d402d19 * plugins/gtk+/glade-gtk.c: Fix alpha_sort_box_children() to give a consistent
order to placeholders (bug 637534 fix by Marco Diego Aurélio Mesquita).
2010-12-19 17:09:22 +09:00
Tristan Van Berkom
61325a5c4c * gladeui/glade-editor-property.c: Unload currently loaded property in
glade_editor_property_load_by_widget() when a NULL widget is specified or the property
	  is not found.
2010-12-18 19:35:47 +09:00
Tristan Van Berkom
243ab18c43 * gladeui/glade-editor-property.c: Hide editor properties when the property is not available
on the widget, bug 585299, fix by Marco Diego Aurélio Mesquita.
2010-12-18 19:30:11 +09:00
Tristan Van Berkom
0b9def155b * src/Makefile.am, gladeui/Makefile.am, plugins/gtk+/Makefile.am, plugins/gnome/Makefile.am:
Fixed makefiles as per bug 521713 (patch initially by Daniel Macks).
2010-12-18 19:26:40 +09:00
Tristan Van Berkom
b0ab43c801 * plugins/gtk+/glade-gtk.c, po/*.po: Fixed 'controled' typo with updates to po files, patch
by Matt Woelfel for bug 633957.
2010-12-18 02:31:42 +09:00
Tristan Van Berkom
300eeca773 * plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Alphabetically sort GtkBox children for save. 2010-12-17 23:50:02 +09:00
Tristan Van Berkom
9fd4f17e81 * gladeui/glade-property-class.c: Properly order object properties 2010-12-17 23:49:23 +09:00
Tristan Van Berkom
c508145370 * gladeui/glade-project.c: Restore proper sorting of objects at save time. 2010-12-17 22:58:08 +09:00
Tristan Van Berkom
495612a733 * plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Added support for deprecated GtkOptionMenu. 2010-12-17 22:13:38 +09:00
Tristan Van Berkom
557b5c67a5 Removing ugly line in NEWS 2010-12-17 22:12:16 +09:00
Tristan Van Berkom
d170b2d1cc * NEWS, configure.ac: Rolling 3.7.2. 2010-12-17 20:41:31 +09:00
Tristan Van Berkom
f23270380f Readded 3.8 files to POTFILES.in (for 3.8 branch only). 2010-12-17 20:13:19 +09:00
Tristan Van Berkom
70dd8d1bf6 Added windows thingy for previewer build. 2010-12-17 19:24:02 +09:00
Tristan Van Berkom
3b823d7d6a Added version check to avoid warnings with GTK+ 2.20 2010-12-17 19:23:45 +09:00
Tristan Van Berkom
08e54efcdc * gladeui/glade-project.c: Fixed crasher when adjusting project naming policy (bug 622528,
thanks goes to Sébastien Granjoux and Martin Schlemmer for looking at this one).
2010-12-17 18:52:50 +09:00
Tristan Van Berkom
cf7931adc5 * plugins/gtk+/glade-gtk.c: Fixed crashes when textview's buffer is deleted, fix
by Martin Schlemmer, bug 609748.
2010-12-17 18:28:53 +09:00
Tristan Van Berkom
4effe1cac4 * plugins/gtk+/glade-gtk.c:
- Defensively avoid crash when setting entry icon tooltips
	  - Add version check macro to compile with GTK+ 2.20
2010-12-17 18:12:31 +09:00
Tristan Van Berkom
34331cd71b * gladeui/glade-app.[ch]: Added glade_app_queue_selection_changed()
* gladeui/glade-command.c: queue selection changes when widgets are added, this
	  avoids synchrounously poking the model when the selection changes various times
	  in a command sequence such as changing a menu item's type.

	* gladeui/glade-base-editor.c: Dont call glade_command_create/delete() directly
	  in change-type, keep delegating this work to build-child/delete-child signals.

	* gladeui/glade-widget.[ch]: Added glade_widget_is_ancestor()

	* gladeui/glade-utils.c: Change glade_util_find_iter_by_widget() to use
	  glade_widget_is_ancestor() and speed up searches a little this way.
2010-12-17 17:30:54 +09:00
Tristan Van Berkom
8fb79754c9 * plugins/gtk+/gtk+.xml.in: default adjustment page size -> 0 (bug 585085). 2010-12-17 05:17:49 +09:00
Tristan Van Berkom
97825010ee * gladeui/glade-project.c: Removing frame shadow (and label) from project preferences (bug 574098). 2010-12-17 05:10:47 +09:00
Tristan Van Berkom
9582a157a2 * plugins/gtk+/gtk+.xml.in: Setting dialog type-hint default to Dialog (closes old bug 459917) 2010-12-17 05:02:25 +09:00
Tristan Van Berkom
ffb7166ef6 * gladeui/glade-project.[ch], gladeui/glade-app.[ch], src/glade-window.c: Removed notion
of project "instance_count" which is now unused.
2010-12-17 04:44:23 +09:00
Tristan Van Berkom
3ecf6f0a35 * plugins/gtk+/glade-gtk.c: Fixed floating project menus when context menu is fired (bug 141714). 2010-12-17 03:58:21 +09:00
Tristan Van Berkom
a609d62e17 Removing false warning 2010-12-17 01:33:43 +09:00
Tristan Van Berkom
94b9708039 * gladeui/glade-inspector.c:
- Avoid changing project selection when selection is cleared, selection get's cleared
	    when the user changes a widget name and a filter is applied (removing the entry from
	    the filtered model), avoiding syncing project selection avoids making the editor disappear
	    when the user changes a widget name (fixes bug 604322).
	  - Also plugged some leaked objects retrieved by gtk_tree_model_get().

	* gladeui/glade-editor-table.c: Fire a warning when entry is edited with no widget
	  loaded, also change the ->loading flag strategy for blocking signal emission instead.
2010-12-17 01:23:47 +09:00
Tristan Van Berkom
be7e578b27 * plugins/gtk+/glade-gtk.c: Set added treeviewcolumns to fixed sizing mode if the
treeview is set to use fixed height mode (closing bug 596480).
2010-12-16 18:18:26 +09:00
Tristan Van Berkom
d2807e9d69 * gladeui/glade-base-editor.c: Fixed glade_base_editor_dispose to not access the signal
editor, it's automatically destroyed as being a child of the editor.
2010-12-16 17:55:22 +09:00
Tristan Van Berkom
0c15328aea * plugins/gtk+/glade-gtk.c, plugins/gtk+/gtk+.xml.in: Fixed GtkComboBox to handle cell-layout
children as well as the possible internal entry (fixes bug 581580).
2010-12-16 17:26:08 +09:00
Tristan Van Berkom
536dc86f76 * gladeui/glade-project.c: Notify iter changes when the widget name changes, increment project
iter stamp before notifying row-inserted (old iters are invalid, the new iter persists),
	  fixed leaked GtkTreePath when rows are inserted.
2010-12-16 16:41:46 +09:00
Tristan Van Berkom
d186619925 * plugins/gtk+/glade-gtk.c: Avoid using gtk_combo_box_set_entry_text_column directly (build
for GTK+ 2.20).
2010-12-16 16:32:54 +09:00
Tristan Van Berkom
7ed8ee7730 * plugins/gtk+/glade-gtk.c: Fixed crash with notebook rebuilding children (bug 365462). 2010-12-16 03:33:25 +09:00
Tristan Van Berkom
7b25280b75 * gladeui/glade-palette.c: Add a label in a box to the palette items to avoid
the evil ellipsization.
2010-12-16 03:18:55 +09:00
Tristan Van Berkom
3eba9346de * plugins/gtk+/gtk+.xml.in: Ignore "resize-mode" property incase of crashes
(as reported in bug 622996).
2010-12-16 02:18:57 +09:00
Tristan Van Berkom
21bb93cf75 * plugins/gtk+/glade-gtk.c, plugins/gtk+/gtk+.xml.in: Avoid warnings when
loading glade files.
2010-12-16 02:05:09 +09:00
Tristan Van Berkom
22e8957174 * gladeui/glade-project.c: Fix glade_project_fix_object_props() to copy the
list which risks changing order while iterating.
2010-12-16 02:04:06 +09:00
Tristan Van Berkom
88024f46f2 * plugins/gtk+/glade-gtk.c: Make sure any manually created glade widgets pass
through glade_widget_add_child() and get a proper ref from the parent (fixing
	  more last minute crahsers).

	* gladeui/glade-utils.c: Fixed crasher bug 628233 partially using patch by
	  ramz <ramanathan.nitt@gmail.com>.
2010-12-16 00:33:59 +09:00
Tristan Van Berkom
93d6327cf5 * gladeui/glade-widget.c, gladeui/glade-project.c: Fixed some final things with
new GInitiallyUnowned strategy, push superuser mode at dispose time so that
	  the plugin doesnt screw up, also hold a ref to widgets being rebuilt since
	  they can go out and into the project.
2010-12-15 23:45:03 +09:00
Tristan Van Berkom
f2f736731e removed g_print trace from GladeWidget 2010-12-15 21:47:37 +09:00
Tristan Van Berkom
058a7f5706 * gladeui/glade-widget.[ch], gladeui/glade-project.c, plugins/gtk+/glade-gtk.c: Cleanup
object ref count cycles, now GladeProject just releases all widgets from the project
	  and keeps a reference to the GladeWidget instead of the GObject, GladeWidget is now
	  GInitiallyUnowned and GladeProject assumes ownership when objects are added to the
	  project (glade-gtk.c in this patch avoids needlessly adding a widget to the project
	  that will be implicitly added, now glade-gtk.c does not directly manually add any
	  widgets to the project).
2010-12-15 21:45:58 +09:00
Tristan Van Berkom
ed31894162 Minor code cleanup in glade-command.c 2010-12-15 21:42:42 +09:00
Tristan Van Berkom
719ecc982f * plugins/gtk+/glade-gtk.c: Fixed errors when undoing the addition of notebook pages.
The problem at length was an issue of orphaned project widgets left in the project model.
2010-12-15 19:44:29 +09:00
Tristan Van Berkom
754eaa2ec5 * gladeui/glade-project.c: Cleanup glade_project_remove_object(), make sure row_deleted is
fired before modifying internal data structures (and dont use the glade_util_ function
	  to find a widget iter).
2010-12-15 19:43:18 +09:00
Tristan Van Berkom
c263759544 Fixed double declaration of LT_LIBRARIES 2010-12-15 19:40:17 +09:00
Tristan Van Berkom
182217c3e1 Fixing makefile and pre-bumping the version. 2010-12-15 01:50:12 +09:00
Tristan Van Berkom
2245d7778c Revert " * gladeui/Makefile.am, gladeui/glade-custom.[ch]: Removed support for old"
This reverts commit b6dd2b5baac587473c7a929f968c314c28a9242f.

Conflicts:

	plugins/gtk+/gtk+.xml.in
2010-12-14 16:30:22 +09:00
Tristan Van Berkom
478f59e812 Revert " * configure.ac: Require GTK+ 3.0 and change package domain from glade3 -> glade"
This reverts commit 9240c83dddcedaa3dd482418020622b288c6915f.

Conflicts:

	ChangeLog
	configure.ac
	gladeui/Makefile.am
	plugins/gtk+/gtk+.xml.in
2010-12-14 16:21:45 +09:00
268 changed files with 10183 additions and 5196 deletions

421
ChangeLog
View File

@ -1,9 +1,407 @@
2011-10-11 Tristan Van Berkom <tvb@gnome.org>
* help/Makefile.am: Make help dir use 'glade3' name
instead of 'glade' (for bug 646997).
2011-10-10 Tristan Van Berkom <tvb@gnome.org>
* configure.ac, NEWS: Rolling Glade 3.8.1
2011-10-09 Tristan Van Berkom <tvb@gnome.org>
* gladeui/glade-project.c: Fix glade_project_notify_has_child() to notify
that the children are gone only when the last item on that level disappears.
Fixes bug 651673
2011-10-09 Fabien Parent <parent.f@gmail.com>
* gladeui/glade-property.c, gladeui/glade-xml-utils.c:
Fix a bug on the GtkComboBoxText (and probably others) when adding
a special char (like '&') in an item's name: every characters following
the special char disappeared while writting the xml file.
Bug 654609.
2011-10-04 Tristan Van Berkom <tvb@gnome.org>
* plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Ensure 'related-action'
and 'use-action-appearance' are serialized in the right order.
* gladeui/glade-widget-adaptor.c: Implemented a generic ->depends() routine
to ensure that liststores are serialized before treemodelfilters which refer to them (bug 657164).
* gladeui/glade-command.[ch]: Exposed glade_command_add() internal command so that
plugins can create command groups that play with adding/removing widgets inline without
creating copies of them.
* plugins/gtk+/glade-gtk.c: Fixed add/remove parent commands so that they work with
parentless widget references (i.e. you can add a parent to a GtkToolItemGroup's label widget
or a GtkButton's image widget, or remove the parent of a child of a label-widget, etc).
* gladeui/glade-widget.c: Fixed glade_widget_hide() in the case that the project is
already gone.
* gladeui/glade-command.c: Fixed glade_command_remove() to push the command on the
right GladeProject pointer.
2011-04-29 Javier Jardón <jjardon@gnome.org>
* gladeui/glade-utils.c: Correctly detect the required devhelp version
2011-04-04 Tristan Van Berkom <tristanvb@openismus.com>
* configure.ac, NEWS: Rolling Glade 3.8.
* Backed out 'preview' feature from glade-3-8 branch.
* gladeui/glade-base-editor.c: Backported fixes from master.
* gladeui/glade-project.[ch], gladeui/glade-widget.c: Backported glade_project_check_reordered()
* plugins/gtk+/icons/*: Backported all the new icons.
* removing glade-previewer.c from POTFILES.in
2011-02-05 Tristan Van Berkom <tristanvb@openismus.com>
* plugins/gtk+/gtk+.xml.in: Disabling irrelevant properties for GtkScaleButton
* gladeui/glade-widget.c: Make glade_widget_rebuild() use glade_widget_add/remove
instead of glade_widget_replace().
2011-02-03 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-project.c: Fixed GladeProject to only ever report widgets that are
actually in the project from the GtkTreeModel interface.
* gladeui/glade-widget.[ch], gladeui/glade-project.c, gladeui/glade-utils.c: Now update
the GladeWidget's project pointer when going in and out of a project.
* src/glade-window.c: Removed user manual link from Help menu, it's not online
as far as I know and no work was done on it, the current user manual needs work
and is just not useful in it's current state.
2011-01-29 Tristan Van Berkom <tristanvb@openismus.com>
* plugins/gtk+/glade-model-data.c: Avoid committing the data if the data did not
change... committing the data when there is no change can cause the editor to
load itself, this editor does not deal with that well. Fixes crasher bug 622839.
2011-01-24 Tristan Van Berkom <tristanvb@openismus.com>
* 41 files: Fixed typo in LGPL License file headers.
2011-01-19 Tristan Van Berkom <tristanvb@openismus.com>
* plugins/gtk+/gtk+.xml.in: Removing treeview's internal GtkTreeSelection from the
palette (its only available as an internal widget to a treeview).
2011-01-13 Tristan Van Berkom <tristanvb@openismus.com>
* plugins/gtk+/glade-attributes.c: Fixed mismatching PangoAttributeType with GType,
closes bug 597045.
* plugins/gtk+/gtk+.xml.in: Made GtkEntry icon properties save-always, fixes bug 629900.
2011-01-09 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-editor.c: Make query dialog come with a "Create" button instead
of an "OK" button, closes bug 503621.
* plugins/gtk+/glade-gtk.c: Fixed GtkMenuToolButton to save the "menu" child properly
* plugins/gtk+/glade-column-types.c: Fixed crash when user performs Drag'n'Drop of
< enter column here > and no columns are yet added (fixes bug 633943).
2011-01-08 Tristan Van Berkom <tristanvb@openismus.com>
* plugins/Makefile.am, plugins/glade-tool-item-group-editor.[ch], plugins/gtk+.xml.in,
plugins/glade-gtk.c: Added support for editing GtkToolPalette.
2011-01-06 Tristan Van Berkom <tristanvb@openismus.com>
* NEWS: Rolling 3.7.3
2011-01-03 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-project.c, gladeui/glade-id-allocator.c: Dont index unallocated
memory when releasing a widget name that was never allocated (this can happen
for loaded widgets with a number), fixes crash when setting naming policy for
glom_developer.glade.
2010-12-31 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-project.c: Further fixing project dispose cycle, still leaking a little
bit of memory for large projects but no crashes.
* plugins/gtk+/glade-gtk.c: Fixed loaded state of use-action-appearance so that it always
loads as FALSE if there is no "related-action" at load time (closes bug 582882).
* gladeui/glade-property.c: Fixed glade_property_dup() to not incidentally sync the property
object's value as a consequence of dupping (backend uses this to write properties with custom
values and does not expect that).
* m4/python.m4: Applying patch to allow better builds on win32, patch by Dieter Verfaillie,
bug 634978.
* plugins/gtk+/gtk+.xml.in: Setting "can-focus" as "save-always" for all widgets (bug 638079).
2010-12-30 Christian Persch <chpe@gnome.org>
* plugins/gtk+/glade-attributes.c: Use locale-independent strtod &
dtostr. Fixes bug 616787
2010-12-30 Tristan Van Berkom <tristanvb@openismus.com>
* plugins/gtk+/gtk+.xml.in: Updated catalog for 2.22 and 2.24 symbols.
* gladeui/glade-base-editor.c, gladeui/glade-command.c: Avoid setting a null name on a widget.
* plugins/gtk+/glade-tool-button-editor.c: Fixed unbalanced refcount of a sizegroup in the
toolbutton editor.
* gladeui/glade-base-editor.c: Remove restriction for only GtkContainer widgets.
* plugins/gtk+/glade-gtk.c, plugins/gtk+/gtk+.xml.in: Added editor to edit
GtkAction/GtkActionGroup hierarchies.
2010-12-29 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-design-view.c: Made loading progress bar nicer looking and ellipsizing.
* gladeui/Makefile.am, gladeui/glade-project.c: Changed glade-previewer install name
to glade-3-previewer, reserving the former name for parallel installable 3.10.
2010-12-28 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/Makefile.am, gladeui/glade.h, gladeui/glade-clipboard.c, gladeui/glade-app.[ch],
src/glade-window.c, gladeui/glade-clipboard-view.[ch]:
Removed GladeClipboradView completely.
2010-12-27 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-project.c: Fixed glade-project to unset the loading flag when
loading project dependancies are not satisfied and there is an early return.
2010-12-22 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-project.[ch]: Removed dialog and added "load-progress" signal
* gladeui/glade-app.c: Protect against commands executed on loading projects
* src/glade-window.c: Added load progressbar to notebook tabs.
* gladeui/glade-project.c: Added "parse-began" signal
* gladeui/glade-design-view.c: Hide workspace and show load progress
while loading so that one cannot access project widgets during the load
(insensitive workspace was problematic and causing some loaded project
windows to be permanently insensitive).
* src/glade-window.c: Avoid any messups during project load, cannot close
projects while they are loading, etc.
2010-12-21 Tristan Van Berkom <tristanvb@openismus.com>
Added loading objects dialog with progress and cancel.
* src/main.c: Display window before loading command line specified projects.
* gladeui/glade-project.[ch]: Added dialog that pops up when about to load
a large project with glade_project_push_project() to push the progress and
glade_project_load_cancelled() to check and abort while loading the project.
* gladeui/glade-widget.c, gladeui/glade-widget-adaptor.c: Push progress and
abort loading when project indicates the user cancelled the load.
2010-12-20 Tristan Van Berkom <tristanvb@openismus.com>
* plugins/gtk+/glade-label-editor.c: Dont add invisible properties to the editor,
instead the invisible editor-property gets tied to the life-cycle of the table
it would have been added to (since recently glade_editor_property() explicitly
shows/hides properties according to if thier widget actually has an instance
of the property).
* plugins/gtk+/glade-gtk.c, plugins/gtk+/glade-column-types.[ch]: Added
glade_column_type_new() to create a GladeColumnType struct properly using
g_slice_new0(). An occurance of allocating the struct with g_new0 was causing
Glade to crash when freeing the block with g_slice_free (bug 637563). Many
big thanks to Benjamin Otte for tracking down the problem.
* gladeui/glade-project.c: Applying Marco Diego Aurélio Mesquita's patch to
make the project preview only preview toplevels.
* gladeui/glade-editor.c: Fixed class header of GladeEditor to update when
widgets unload (patch by Marco Diego Aurélio Mesquita, bug 637541).
* gladeui/glade-editor-property.c, gladeui/glade-property.c, gladeui/glade-widget.c,
plugins/gtk+/glade-gtk.c: Fixing some discrepincies searching for properties as
regular properties or packing properties. Now the conflicting "position" property
on a GtkPaned widget packed into a GtkBox widget works properly (bug 637475).
2010-12-19 Tristan Van Berkom <tristanvb@openismus.com>
* plugins/gtk+/glade-gtk.c: Fix alpha_sort_box_children() to give a consistent
order to placeholders (bug 637534 fix by Marco Diego Aurélio Mesquita).
* plugins/gtk+/glade-gtk.c: Removed alpha_sort_box_children(), project needs to be
sorted with box children by position, loading process depends on this.
* gladeui/glade-widget.[ch]: Hide glade_widget_set_object(), improved reference count
balancing and fixed segfaults upon closing projects that contain filechooser dialogs
referenced by filechooserbuttons.
2010-12-18 Tristan Van Berkom <tristanvb@openismus.com>
* src/Makefile.am, gladeui/Makefile.am, plugins/gtk+/Makefile.am, plugins/gnome/Makefile.am:
Fixed makefiles as per bug 521713 (patch initially by Daniel Macks).
* gladeui/glade-editor-property.c: Hide editor properties when the property is not available
on the widget, bug 585299, fix by Marco Diego Aurélio Mesquita.
* gladeui/glade-editor-property.c: Unload currently loaded property in
glade_editor_property_load_by_widget() when a NULL widget is specified or the property
is not found.
2010-12-17 Tristan Van Berkom <tristanvb@openismus.com>
* plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Added support for deprecated GtkOptionMenu.
* gladeui/glade-project.c: Restore proper sorting of objects at save time.
* gladeui/glade-property-class.c: Properly order object properties
* plugins/gtk+/gtk+.xml.in, plugins/gtk+/glade-gtk.c: Alphabetically sort GtkBox children for save.
* plugins/gtk+/glade-gtk.c, po/*.po: Fixed 'controled' typo with updates to po files, patch
by Matt Woelfel for bug 633957.
2010-12-17 Tristan Van Berkom <tristanvb@openismus.com>
* NEWS, configure.ac: Rolling 3.7.2.
2010-12-17 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-app.[ch]: Added glade_app_queue_selection_changed()
* gladeui/glade-command.c: queue selection changes when widgets are added, this
avoids synchrounously poking the model when the selection changes various times
in a command sequence such as changing a menu item's type.
* gladeui/glade-base-editor.c: Dont call glade_command_create/delete() directly
in change-type, keep delegating this work to build-child/delete-child signals.
* gladeui/glade-widget.[ch]: Added glade_widget_is_ancestor()
* gladeui/glade-utils.c: Change glade_util_find_iter_by_widget() to use
glade_widget_is_ancestor() and speed up searches a little this way.
* plugins/gtk+/glade-gtk.c:
- Defensively avoid crash when setting entry icon tooltips
- Add version check macro to compile with GTK+ 2.20
* plugins/gtk+/glade-gtk.c: Fixed crashes when textview's buffer is deleted, fix
by Martin Schlemmer, bug 609748.
* gladeui/glade-project.c: Fixed crasher when adjusting project naming policy (bug 622528,
thanks goes to Sébastien Granjoux and Martin Schlemmer for looking at this one).
2010-12-16 Tristan Van Berkom <tristanvb@openismus.com>
* plugins/gtk+/glade-gtk.c: Avoid using gtk_combo_box_set_entry_text_column directly (build
for GTK+ 2.20).
* gladeui/glade-project.c: Notify iter changes when the widget name changes, increment project
iter stamp before notifying row-inserted (old iters are invalid, the new iter persists),
fixed leaked GtkTreePath when rows are inserted.
* plugins/gtk+/glade-gtk.c, plugins/gtk+/gtk+.xml.in: Fixed GtkComboBox to handle cell-layout
children as well as the possible internal entry (fixes bug 581580).
* gladeui/glade-base-editor.c: Fixed glade_base_editor_dispose to not access the signal
editor, it's automatically destroyed as being a child of the editor.
* plugins/gtk+/glade-gtk.c: Set added treeviewcolumns to fixed sizing mode if the
treeview is set to use fixed height mode (closing bug 596480).
* gladeui/glade-inspector.c:
- Avoid changing project selection when selection is cleared, selection get's cleared
when the user changes a widget name and a filter is applied (removing the entry from
the filtered model), avoiding syncing project selection avoids making the editor disappear
when the user changes a widget name (fixes bug 604322).
- Also plugged some leaked objects retrieved by gtk_tree_model_get().
* gladeui/glade-editor-table.c: Fire a warning when entry is edited with no widget
loaded, also change the ->loading flag strategy for blocking signal emission instead.
* plugins/gtk+/glade-gtk.c: Fixed floating project menus when context menu is fired (bug 141714).
* gladeui/glade-project.[ch], gladeui/glade-app.[ch], src/glade-window.c: Removed notion
of project "instance_count" which is now unused.
* plugins/gtk+/gtk+.xml.in: Setting dialog type-hint default to Dialog (closes old bug 459917)
* gladeui/glade-project.c: Removing frame shadow (and label) from project preferences (bug 574098).
* plugins/gtk+/gtk+.xml.in: default adjustment page size -> 0 (bug 585085).
2010-12-15 Tristan Van Berkom <tristanvb@openismus.com>
* gladeui/glade-project.c: Cleanup glade_project_remove_object(), make sure row_deleted is
fired before modifying internal data structures (and dont use the glade_util_ function
to find a widget iter).
* plugins/gtk+/glade-gtk.c: Fixed errors when undoing the addition of notebook pages.
The problem at length was an issue of orphaned project widgets left in the project model.
* gladeui/glade-widget.[ch], gladeui/glade-project.c, plugins/gtk+/glade-gtk.c: Cleanup
object ref count cycles, now GladeProject just releases all widgets from the project
and keeps a reference to the GladeWidget instead of the GObject, GladeWidget is now
GInitiallyUnowned and GladeProject assumes ownership when objects are added to the
project (glade-gtk.c in this patch avoids needlessly adding a widget to the project
that will be implicitly added, now glade-gtk.c does not directly manually add any
widgets to the project).
* gladeui/glade-widget.c, gladeui/glade-project.c: Fixed some final things with
new GInitiallyUnowned strategy, push superuser mode at dispose time so that
the plugin doesnt screw up, also hold a ref to widgets being rebuilt since
they can go out and into the project.
* plugins/gtk+/glade-gtk.c: Make sure any manually created glade widgets pass
through glade_widget_add_child() and get a proper ref from the parent (fixing
more last minute crahsers).
* gladeui/glade-utils.c: Fixed crasher bug 628233 partially using patch by
ramz <ramanathan.nitt@gmail.com>.
* gladeui/glade-project.c: Fix glade_project_fix_object_props() to copy the
list which risks changing order while iterating.
* plugins/gtk+/glade-gtk.c, plugins/gtk+/gtk+.xml.in: Avoid warnings when
loading glade files.
* plugins/gtk+/gtk+.xml.in: Ignore "resize-mode" property incase of crashes
(as reported in bug 622996).
* gladeui/glade-palette.c: Add a label in a box to the palette items to avoid
the evil ellipsization.
* plugins/gtk+/glade-gtk.c: Fixed crash with notebook rebuilding children (bug 365462).
2010-12-14 Tristan Van Berkom <tristanvb@openismus.com>
* Reverted 3.0 commit, now targetting this branch to the final GTK+ 2.x chapter
* Reverted the commit that removes the old fashioned "Custom Widget" handling.
2010-11-12 Johannes Schmid <jhs@gnome.org>
* gladeui/glade-project.c:
project-model: Don't be picky about non-existing children
It is sometimes possible that children are added before their parents
in the tree. We simply ignore that for now as it doesn't
in the tree. We simply ignore that for now as it doesn't
cause any harm in the tree model.
2010-10-12 Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
@ -78,7 +476,7 @@
* configure.ac: Require GTK+ 3.0 and change package domain from glade3 -> glade
* src/Makefile.am, gladeui/Makefile.am: application 'glade-3' -> 'glade',
* src/Makefile.am, gladeui/Makefile.am: application 'glade-3' -> 'glade',
library libgladeui-1 -> libgladeui-2
* plugins/Makefile.am, plugins/gnome/*: Removed libgnomeui support.
@ -86,11 +484,6 @@
* plugins/gtk/gtk+.xml.in, plugins/gtk/glade-gtk.c: Removed all reference to
deprecated GTK+ widgets (anything removed in 3.0).
* gladeui/Makefile.am, gladeui/glade-custom.[ch]: Removed support for old
fashioned custom widgets from glade-2.
* plugins/python/Makefile.am: Fixed to link with new core library (libgladeui-2).
2010-06-10 Javier Jardón <jjardon@gnome.org>
* m4/python.m4: quote the definition of AM_CHECK_PYMOD
@ -1975,7 +2368,7 @@
on ia64 platform (bug 530143).
2008-05-05 Tristan Van Berkom <tvb@gnome.org>
* gladeui/glade-editor-property.c: Avoid feedback loops when committing properties,
fixes bug 527896.
@ -2000,7 +2393,7 @@
2008-04-17 Juan Pablo Ugarte <juanpablougarte@gmail.com>
* gladeui/glade-property-class.[ch]: added glade_property_class_compare()
* gladeui/glade-editor-property.c: use new compare function in
glade_editor_property_commit() instead of g_param_values_cmp()
since GBoxed comparison is not well defined.
@ -2048,7 +2441,7 @@
* gladeui/glade-project.c, gladeui/glade-project.h: fix some mistakes,
added translator comments to new strings
* src/glade-window.c: Added padding on top of undocked tools, removed
custom label handling of widget name.
@ -2065,7 +2458,7 @@
* gladeui/glade-editor-property.c, gladeui/glade-editor-property.h:
Loaded and watched the new support_warning on GladeProperty
* gladeui/glade-widget.c, gladeui/glade-widget.h: Keep a support-warning
property around as metadata updated by GladeProject.
@ -2080,18 +2473,18 @@
Preferences dialog is not modal anymore ;-)
* gladeui/glade-signal.c: Removed a bogus return.
2008-04-09 Tristan Van Berkom <tvb@gnome.org>
* NEWS, configure.ac: Rolling 3.5.2. quick bugfix release
* gladeui/glade-widget-adaptor.c: oops, was parsing booleans
as doubles, fixed bugs with builder-unsupported and deprecated.
2008-04-09 Tristan Van Berkom <tvb@gnome.org>
* NEWS, configure.ac: Rolling 3.5.1.
* plugins/gtk+/gtk+.xml.in: Filled in all since, deprecated and
builder-unsupported properties.

81
NEWS
View File

@ -1,3 +1,84 @@
===========
Glade 3.8.1
===========
- Correctly detect the required devhelp version (Javier Jardón)
- Sort objects in output by property reference, ensures a
GtkTreeModelFilter gets serialized after its 'child-model' (fixes bug 657164)
- Fixed crashers when performing "Remove Parent" (bug 657338)
- Ensure 'use-action-appearance' is serialized
before 'related-action' (bug 658497)
- Properly escape special characters while serializing
property values (bug 654609 - Fabien Parent)
- Fix GladeProject to notify "row-has-child-toggled", (fixes bug 651673).
===========
Glade 3.8.0
===========
- Added support for GtkToolPalette and GtkToolItemGroup
- Fixed 633943, 503621, 629900, 597045, 622839,
- Removed User Manual link from Glade frontend (since the user manual
is still empty and not online anywhere).
- Backed out preview feature from 3.8.
- Included all the icons by Florent Thévenet (including some icons
made by Dolean Samuel).
===========
Glade 3.7.3
===========
- Fixed 'controled' typo with updates to po files, patch
by Matt Woelfel for bug 633957
- Added support for deprecated GtkOptionMenu.
- Restore proper order of glade file at save time.
- Hide editor properties when the property is not available
on the widget, bug 585299, fix by Marco Diego Aurélio Mesquita.
- Fixed makefiles as per bug 521713 (patch initially by Daniel Macks)
- Fixed mixups of properties/packing properties bug 637475.
- Fixed class header of GladeEditor to update when
widgets unload (patch by Marco Diego Aurélio Mesquita, bug 637541).
- Fixed nasty crasher with column types, bug 637563, fix by Benjamin Otte.
- Added progress bar to notebook tabs while loading projects.
- Removed GladeClipboradView completely.
- Added custom editor for editing GtkActionGroup and its child actions.
- Use locale-independent strtod & dtostr. bug 616787, fix by Christian Persch.
- Applying patch to allow better builds on win32, patch by Dieter Verfaillie,
bug 634978.
- Fixed loaded state of use-action-appearance so that it always
loads as FALSE if there is no "related-action" at load time (closes bug 582882).
- Fixed other misc bugs.
===========
Glade 3.7.2
===========
- Use gtk_show_uri() instead of previous custom code in place (Javier Jardón)
- Fixed user/developer url locations (Javier Jardón)
- Fixed ComboBox and IconView to include basic actions in the popup menu
- Revived the "misc" column on the project data model (now the inspector shows
whether a widget is an internal child or a frame's label or such, again).
- Expose GtkAssistant:complete packing property (bug 529595).
- Implemented Preview feature, Glade now includes a project previewing program
that is accessible in the UI and runs as a child process (Marco Diego Aurélio Mesquita).
- Ignore "resize-mode" property incase of crashes (as reported in bug 622996).
- Fixed crash with notebook rebuilding children (bug 365462).
- Fixed crasher bug 628233 (based on patch by: ramz <ramanathan.nitt@gmail.com>).
- GladeWidget is now GInitiallyUnowned (now refcounts balance again at project close time).
- Fixed errors when undoing the addition of notebook pages.
- Default adjustment page size -> 0 (bug 585085).
- Removing frame shadow (and label) from project preferences (bug 574098).
- Setting dialog type-hint default to Dialog (closes old bug 459917).
- Fixed floating project menus when context menu is fired (bug 141714).
- Removed notion of project "instance_count" (which is by now unused).
- Avoid clearing the project selection from the inspector (fixing bug 604322).
- Set added treeviewcolumns to fixed sizing mode if the treeview is set to use
fixed height mode (closing bug 596480).
- Fixed GtkComboBox to handle cell-layout children as well as the possible internal
entry (fixes bug 581580)
- Notify GtkTreeIter changes when the widget name changes (now the inspector updates
when a widget name is changed automatically).
- Fixed crasher when adjusting project naming policy (bug 622528, thanks goes to
Sébastien Granjoux and Martin Schlemmer for looking at this one).
- Fixed crashes when textview's buffer is deleted, fix by Martin Schlemmer, bug 609748.
- Defensively avoid crash when setting entry icon tooltips on an entry with no icons set.
===========
Glade 3.7.1

View File

@ -3,11 +3,11 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.52)
m4_define(glade_major_version, 3)
m4_define(glade_minor_version, 7)
m4_define(glade_minor_version, 8)
m4_define(glade_micro_version, 1)
m4_define(glade_version, glade_major_version.glade_minor_version.glade_micro_version)
AC_INIT([glade], [glade_version],
AC_INIT([glade3], [glade_version],
[http://bugzilla.gnome.org/enter_bug.cgi?product=glade3])
AC_CONFIG_HEADERS([config.h])
@ -53,8 +53,8 @@ AM_PROG_LIBTOOL
# If any interfaces have been removed since the last public release, then set GLADE_AGE to 0.
# Reference: http://www.gnu.org/software/libtool/manual.html#Versioning
GLADE_REVISION=0
GLADE_CURRENT=0
GLADE_AGE=0
GLADE_CURRENT=12
GLADE_AGE=1
GLADE_CURRENT_MINUS_AGE=`expr $GLADE_CURRENT - $GLADE_AGE`
AC_SUBST(GLADE_REVISION)
AC_SUBST(GLADE_CURRENT)
@ -121,39 +121,9 @@ GTK_DOC_CHECK(1.9)
dnl ================================================================
dnl Check for gtk+
dnl ================================================================
# Which gtk+ API version to compile against
AC_MSG_CHECKING([which gtk+ version to compile against])
AC_ARG_WITH([gtk],
[AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 3.0)])],
[case "$with_gtk" in
2.0|3.0) ;;
*) AC_MSG_ERROR([invalid gtk version specified]) ;;
esac],
[with_gtk=3.0])
AC_MSG_RESULT([$with_gtk])
case "$with_gtk" in
2.0) GTK_API_VERSION=2.0
GTK_REQUIRED=2.14.0
;;
3.0) GTK_API_VERSION=3.0
GTK_REQUIRED=2.90.0
;;
esac
PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.24 gthread-2.0 libxml-2.0 >= 2.4.0])
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_CFLAGS)
AC_SUBST([GTK_API_VERSION])
AM_CONDITIONAL([HAVE_GTK_2],[test "$with_gtk" = "2.0"])
AM_CONDITIONAL([HAVE_GTK_3],[test "$with_gtk" = "3.0"])
PKG_CHECK_MODULES([GTK],[
gtk+-$GTK_API_VERSION >= $GTK_REQUIRED
libxml-2.0 >= 2.4.0
])
dnl ================================================================
dnl Check for the unix print widgets in gtk+
@ -162,6 +132,25 @@ LIBS=$GTK_LIBS
AC_CHECK_FUNCS(gtk_print_unix_dialog_new,[have_unix_print=yes]; break,[have_unix_print=no])
AM_CONDITIONAL(HAVE_GTK_UNIX_PRINT, test x"$have_unix_print" = "xyes")
dnl ================================================================
dnl Check for optional gnome libs
dnl ================================================================
AC_ARG_ENABLE(gnome,
AS_HELP_STRING([--disable-gnome], [disable gnome catalog]),
check_gnome=$enableval, check_gnome=yes)
if test x"$check_gnome" = x"yes"; then
PKG_CHECK_MODULES(GNOME, [libbonoboui-2.0 libgnomeui-2.0],
[have_gnome=yes],[have_gnome=no])
AC_SUBST(GNOME_LIBS)
AC_SUBST(GNOME_CFLAGS)
else
have_gnome=no
fi
AM_CONDITIONAL(BUILD_GNOME, test x"$have_gnome" = "xyes")
dnl ================================================================
dnl Python for optional python dev libs
dnl ================================================================
@ -260,10 +249,6 @@ if test "x$_gdk_tgt" = xquartz; then
AC_SUBST(IGE_MAC_CFLAGS)
fi
AC_SUBST([GLADE_PREFIX])
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CXXFLAGS])
@ -291,12 +276,16 @@ data/icons/hicolor/scalable/apps/Makefile
gladeui/Makefile
gladeui/gladeui.rc
src/Makefile
src/glade.rc
src/glade-3.rc
plugins/Makefile
plugins/gtk+/Makefile
plugins/gtk+/icons/Makefile
plugins/gtk+/icons/16x16/Makefile
plugins/gtk+/icons/22x22/Makefile
plugins/gnome/Makefile
plugins/gnome/icons/Makefile
plugins/gnome/icons/16x16/Makefile
plugins/gnome/icons/22x22/Makefile
plugins/python/Makefile
po/Makefile.in
doc/Makefile
@ -312,8 +301,8 @@ Configuration:
Source code location: ${srcdir}
Compiler: ${CC}
GTK+ version: $with_gtk
GTK+ UNIX Print Widgets: ${have_unix_print}
GNOME UI Widgets: ${have_gnome}
PYTHON Widgets support: ${have_python}
Build Reference Manual: ${enable_gtk_doc}

View File

@ -2,7 +2,6 @@
glade_app_get_type
glade_clipboard_get_type
glade_clipboard_view_get_type
glade_command_get_type
glade_editor_get_type
glade_editor_property_get_type

View File

@ -1,58 +1,29 @@
## Previewer
bin_PROGRAMS = glade-previewer
lib_LTLIBRARIES = libgladeui-2.la
glade_previewer_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
-DGLADE_GNOMEHELPDIR="\"$(HELP_DIR)\""
$(AM_CPPFLAGS)
glade_previewer_CFLAGS = \
$(GTK_CFLAGS) \
$(IGE_MAC_CFLAGS) \
$(WARN_CFLAGS) \
$(AM_CFLAGS)
glade_previewer_LDFLAGS = $(AM_LDFLAGS)
glade_previewer_LDADD = $(top_builddir)/gladeui/libgladeui-2.la $(IGE_MAC_LIBS)
glade_previewer_SOURCES = \
glade-previewer.c
if NATIVE_WIN32
glade_previewer_LDADD += glade-win32-res.o
if !GLADE_UNSTABLE
glade_previewer_LDFLAGS += -mwindows
endif
endif
glade-win32-res.o: glade-previewer.rc
$(WINDRES) $< $@
## Rest of the UI ;)
lib_LTLIBRARIES = libgladeui-1.la
common_defines = \
-DG_LOG_DOMAIN=\"GladeUI\" \
-DGLADE_DATADIR="\"$(pkgdatadir)\"" \
-DGLADE_LIBDIR="\"$(pkglibdir)\"" \
-DGLADE_CATALOGSDIR="\"$(pkgdatadir)/catalogs\""\
-DGLADE_MODULESDIR="\"$(pkglibdir)/modules\"" \
-DGLADE_PLUGINSDIR="\"$(pkglibdir)/plugins\"" \
-DGLADE_PIXMAPSDIR="\"$(pkgdatadir)/pixmaps\"" \
-DGLADE_LOCALEDIR="\"$(datadir)/locale\""\
-DGLADE_BINDIR="\"$(bindir)\""
-DGLADE_LOCALEDIR="\"$(datadir)/locale\"" \
-DGLADE_BINDIR="\"$(bindir)\""
BUILT_SOURCES = glade-marshallers.c glade-marshallers.h
EXTRA_DIST = glade-marshallers.list gladeui.rc.in icon-naming-spec.c glade-previewer.rc.in
EXTRA_DIST = glade-marshallers.list gladeui.rc.in icon-naming-spec.c
# The glade-3 core library
libgladeui_2_la_SOURCES = \
libgladeui_1_la_SOURCES = \
glade-widget-adaptor.c \
glade-debug.c \
glade-project.c \
glade-parameter.c \
glade-placeholder.c \
glade-custom.c \
glade-inspector.c \
glade-xml-utils.c \
glade-palette.c \
@ -72,7 +43,6 @@ libgladeui_2_la_SOURCES = \
glade-signal.c \
glade-signal-editor.c \
glade-clipboard.c \
glade-clipboard-view.c \
glade-command.c \
glade-id-allocator.c \
glade-id-allocator.h \
@ -92,24 +62,24 @@ libgladeui_2_la_SOURCES = \
glade-editor-table.c \
glade-cell-renderer-icon.c
libgladeui_2_la_CPPFLAGS = \
libgladeui_1_la_CPPFLAGS = \
$(common_defines) \
-I$(top_srcdir) \
-I$(top_builddir) \
$(AM_CPPFLAGS)
libgladeui_2_la_CFLAGS = \
$(GTK_CFLAGS) \
$(IGE_MAC_BUNDLE_FLAG) \
$(IGE_MAC_CFLAGS) \
$(WARN_CFLAGS) \
$(AM_CPPFLAGS)
libgladeui_1_la_CFLAGS = \
$(AM_CFLAGS)
libgladeui_2_la_LDFLAGS = -version-info $(GLADE_CURRENT):$(GLADE_REVISION):$(GLADE_AGE) $(AM_LDFLAGS)
libgladeui_2_la_LIBADD = $(GTK_LIBS) $(IGE_MAC_LIBS)
libgladeui_1_la_LDFLAGS = -version-info $(GLADE_CURRENT):$(GLADE_REVISION):$(GLADE_AGE) $(AM_LDFLAGS)
libgladeui_1_la_LIBADD = $(GTK_LIBS) $(IGE_MAC_LIBS)
libgladeuiincludedir=$(includedir)/libgladeui-2.0/gladeui
libgladeuiincludedir=$(includedir)/libgladeui-1.0/gladeui
libgladeuiinclude_HEADERS = \
glade.h \
glade-debug.h \
@ -117,6 +87,7 @@ libgladeuiinclude_HEADERS = \
glade-inspector.h \
glade-parameter.h \
glade-placeholder.h \
glade-custom.h \
glade-editor.h \
glade-editor-property.h \
glade-signal-editor.h \
@ -129,7 +100,6 @@ libgladeuiinclude_HEADERS = \
glade-property-class.h \
glade-utils.h \
glade-clipboard.h \
glade-clipboard-view.h \
glade-command.h \
glade-app.h \
glade-builtins.h \
@ -149,12 +119,12 @@ libgladeuiinclude_HEADERS = \
if PLATFORM_WIN32
libgladeui_2_la_LDFLAGS += -no-undefined
libgladeui_1_la_LDFLAGS += -no-undefined
endif
if NATIVE_WIN32
libgladeui_2_la_LDFLAGS += -Wl,gladeui-win32-res.o -export-symbols gladeui.def
libgladeui_2_la_DEPENDENCIES = gladeui-win32-res.o gladeui.def
libgladeui_1_la_LDFLAGS += -Wl,gladeui-win32-res.o -export-symbols gladeui.def
libgladeui_1_la_DEPENDENCIES = gladeui-win32-res.o gladeui.def
endif
gladeui-win32-res.o: gladeui.rc

View File

@ -33,7 +33,6 @@
*/
#include "glade.h"
#include "glade-clipboard-view.h"
#include "glade-debug.h"
#include "glade-cursor.h"
#include "glade-catalog.h"
@ -94,6 +93,8 @@ struct _GladeAppPrivate
GList *undo_list, *redo_list; /* Lists of buttons to refresh in update-ui signal */
GladePointerMode pointer_mode; /* Current mode for the pointer in the workspace */
guint selection_changed_id; /* for queue_selection_changed() */
};
static guint glade_app_signals[LAST_SIGNAL] = { 0 };
@ -101,6 +102,7 @@ static guint glade_app_signals[LAST_SIGNAL] = { 0 };
/* installation paths */
static gchar *catalogs_dir = NULL;
static gchar *modules_dir = NULL;
static gchar *plugins_dir = NULL;
static gchar *pixmaps_dir = NULL;
static gchar *locale_dir = NULL;
static gchar *bin_dir = NULL;
@ -302,13 +304,6 @@ glade_app_signal_editor_created_default (GladeApp *app, GladeSignalEditor *signa
glade_signal_editor_construct_signals_list (signal_editor);
}
static gboolean
clipboard_view_on_delete_cb (GtkWidget *clipboard_view, GdkEvent *e, GladeApp *app)
{
glade_util_hide_window (GTK_WINDOW (clipboard_view));
return TRUE;
}
static GKeyFile *
glade_app_config_load (GladeApp *app)
{
@ -340,6 +335,15 @@ glade_app_get_modules_dir (void)
return modules_dir;
}
const gchar *
glade_app_get_plugins_dir (void)
{
glade_init_check ();
return plugins_dir;
}
const gchar *
glade_app_get_pixmaps_dir (void)
{
@ -391,6 +395,7 @@ build_package_paths (void)
#else
catalogs_dir = g_strdup (GLADE_CATALOGSDIR);
modules_dir = g_strdup (GLADE_MODULESDIR);
plugins_dir = g_strdup (GLADE_PLUGINSDIR);
pixmaps_dir = g_strdup (GLADE_PIXMAPSDIR);
locale_dir = g_strdup (GLADE_LOCALEDIR);
bin_dir = g_strdup (GLADE_BINDIR);
@ -453,11 +458,6 @@ glade_app_init (GladeApp *app)
/* Create clipboard */
app->priv->clipboard = glade_clipboard_new ();
app->priv->clipboard->view = glade_clipboard_view_new (app->priv->clipboard);
gtk_window_set_title (GTK_WINDOW (app->priv->clipboard->view), _("Clipboard"));
g_signal_connect_after (G_OBJECT (app->priv->clipboard->view), "delete_event",
G_CALLBACK (clipboard_view_on_delete_cb),
app);
/* Load the configuration file */
app->priv->config = glade_app_config_load (app);
@ -810,13 +810,6 @@ glade_app_get_clipboard (void)
return app->priv->clipboard;
}
GtkWidget *
glade_app_get_clipboard_view (void)
{
GladeApp *app = glade_app_get ();
return app->priv->clipboard->view;
}
GladeProject *
glade_app_get_project (void)
{
@ -930,50 +923,6 @@ glade_app_hide_properties (void)
}
void
glade_app_update_instance_count (GladeProject *project)
{
GladeApp *app;
GList *l;
gint temp, max = 0, i = 0, uncounted_projects = 0;
gchar *project_name;
g_return_if_fail (GLADE_IS_PROJECT (project));
if (glade_project_get_instance_count (project) > 0)
return;
project_name = glade_project_get_name (project);
app = glade_app_get ();
for (l = app->priv->projects; l; l = l->next)
{
GladeProject *prj = GLADE_PROJECT (l->data);
gchar *name = glade_project_get_name (project);
if (prj != project && !g_utf8_collate (name, project_name))
{
i++;
temp = MAX (glade_project_get_instance_count (prj) + 1, i);
max = MAX (temp, max);
if (glade_project_get_instance_count (prj) < 1)
uncounted_projects++;
}
g_free (name);
}
g_free (project_name);
/* Dont reset the initially opened project */
if (uncounted_projects > 1 || g_list_find (app->priv->projects, project) == NULL)
{
glade_project_set_instance_count (project, MAX (max, i));
}
}
void
glade_app_add_project (GladeProject *project)
{
@ -991,7 +940,6 @@ glade_app_add_project (GladeProject *project)
glade_app_set_project (project);
return;
}
glade_app_update_instance_count (project);
/* Take a reference for GladeApp here... */
app->priv->projects = g_list_append (app->priv->projects,
@ -1160,10 +1108,9 @@ glade_app_command_copy (void)
gboolean failed = FALSE;
app = glade_app_get();
if (app->priv->active_project == NULL)
{
if (app->priv->active_project == NULL ||
glade_project_is_loading (app->priv->active_project))
return;
}
for (list = glade_app_get_selection ();
list && list->data; list = list->next)
@ -1203,7 +1150,8 @@ glade_app_command_cut (void)
gboolean failed = FALSE;
app = glade_app_get();
if (app->priv->active_project == NULL)
if (app->priv->active_project == NULL ||
glade_project_is_loading (app->priv->active_project))
return;
for (list = glade_app_get_selection ();
@ -1245,9 +1193,17 @@ glade_app_command_paste (GladePlaceholder *placeholder)
GladeFixed *fixed = NULL;
app = glade_app_get();
if (app->priv->active_project == NULL)
if (app->priv->active_project == NULL ||
glade_project_is_loading (app->priv->active_project))
return;
if (placeholder)
{
if (glade_placeholder_get_project (placeholder) == NULL ||
glade_project_is_loading (glade_placeholder_get_project (placeholder)))
return;
}
list = glade_project_selection_get (app->priv->active_project);
clipboard = glade_app_get_clipboard ();
@ -1368,7 +1324,8 @@ glade_app_command_delete (void)
gboolean failed = FALSE;
app = glade_app_get();
if (app->priv->active_project == NULL)
if (app->priv->active_project == NULL ||
glade_project_is_loading (app->priv->active_project))
return;
for (list = glade_app_get_selection ();
@ -1653,6 +1610,25 @@ glade_app_selection_changed (void)
}
}
static gboolean
selection_change_idle (GladeApp *app)
{
glade_app_selection_changed ();
app->priv->selection_changed_id = 0;
return FALSE;
}
void
glade_app_queue_selection_changed (void)
{
GladeApp *app = glade_app_get ();
if (app->priv->selection_changed_id == 0)
app->priv->selection_changed_id =
g_idle_add ((GSourceFunc)selection_change_idle, app);
}
GladeApp*
glade_app_new (void)
{

View File

@ -105,14 +105,12 @@ gboolean glade_app_get_catalog_version (const gchar *name, gint *major
GList *glade_app_get_catalogs (void);
GladeCatalog *glade_app_get_catalog (const gchar *name);
GladeEditor* glade_app_get_editor (void);
GladePalette* glade_app_get_palette (void);
GladeClipboard* glade_app_get_clipboard (void);
GtkWidget* glade_app_get_clipboard_view (void);
GladeProject* glade_app_get_project (void);
@ -166,9 +164,6 @@ void glade_app_set_accel_group (GtkAccelGroup *accel_group);
GtkAccelGroup *glade_app_get_accel_group (void);
void glade_app_update_instance_count (GladeProject *project);
GtkWidget *glade_app_undo_button_new (void);
GtkWidget *glade_app_redo_button_new (void);
@ -196,6 +191,8 @@ void glade_app_selection_clear (gboolean emit_signal);
void glade_app_selection_changed (void);
void glade_app_queue_selection_changed (void);
/* package paths */
const gchar *glade_app_get_catalogs_dir (void) G_GNUC_CONST;

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
/*
* Copyright (C) 2008 Tristan Van Berkom.
*
* This library is free software; you can redistribute it and/or it
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.

View File

@ -2,7 +2,7 @@
/*
* Copyright (C) 2010 Tristan Van Berkom.
*
* This library is free software; you can redistribute it and/or it
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.

View File

@ -1,388 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* glade-clipboard-view.c - The View for the Clipboard.
*
* Copyright (C) 2001 The GNOME Foundation.
*
* Author(s):
* Archit Baweja <bighead@users.sourceforge.net>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/**
* SECTION:glade-clipboard-view
* @Short_Description: A widget to view and control the #GladeClipboard.
*
* The #GladeClipboardView is a widget to view the #GladeWidget objects
* in the #GladeClipboard; the user can paste or delete objects on the clipboard.
*/
#include <glib/gi18n-lib.h>
#include "glade.h"
#include "glade-clipboard.h"
#include "glade-clipboard-view.h"
#include "glade-widget.h"
#include "glade-widget-adaptor.h"
#include "glade-popup.h"
const gint GLADE_CLIPBOARD_VIEW_WIDTH = 230;
const gint GLADE_CLIPBOARD_VIEW_HEIGHT = 200;
static void
glade_clipboard_view_class_init (GladeClipboardViewClass *klass)
{
}
static void
glade_clipboard_view_init (GladeClipboardView *view)
{
view->widget = NULL;
view->clipboard = NULL;
view->model = NULL;
}
GType
glade_clipboard_view_get_type ()
{
static GType type = 0;
if (!type) {
static const GTypeInfo info = {
sizeof (GladeClipboardViewClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) glade_clipboard_view_class_init,
(GClassFinalizeFunc) NULL,
NULL,
sizeof (GladeClipboardView),
0,
(GInstanceInitFunc) glade_clipboard_view_init
};
type = g_type_register_static (GTK_TYPE_WINDOW, "GladeClipboardView", &info, 0);
}
return type;
}
static void
gcv_foreach_add_selection (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data)
{
GladeWidget *widget = NULL;
GladeClipboardView *view = (GladeClipboardView *)data;
gtk_tree_model_get (model, iter, 0, &widget, -1);
glade_clipboard_selection_add (view->clipboard, (widget));
}
static void
glade_clipboard_view_selection_changed_cb (GtkTreeSelection *sel,
GladeClipboardView *view)
{
if (view->updating == FALSE)
{
glade_clipboard_selection_clear (view->clipboard);
gtk_tree_selection_selected_foreach
(sel, gcv_foreach_add_selection, view);
}
}
static void
glade_clipboard_view_populate_model (GladeClipboardView *view)
{
GladeClipboard *clipboard;
GtkTreeModel *model;
GladeWidget *widget;
GList *list;
GtkTreeIter iter;
clipboard = GLADE_CLIPBOARD (view->clipboard);
model = GTK_TREE_MODEL (view->model);
for (list = clipboard->widgets; list; list = list->next)
{
widget = list->data;
view->updating = TRUE;
gtk_list_store_append (GTK_LIST_STORE (model), &iter);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, 0, widget, -1);
view->updating = FALSE;
}
}
static void
glade_clipboard_view_cell_function (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
GtkTreeModel *tree_model,
GtkTreeIter *iter,
gpointer data)
{
gboolean is_icon = GPOINTER_TO_INT (data);
GladeWidget *widget;
gtk_tree_model_get (tree_model, iter, 0, &widget, -1);
g_return_if_fail (GLADE_IS_WIDGET (widget));
g_return_if_fail (widget->name != NULL);
if (is_icon)
g_object_set (G_OBJECT (cell),
"icon-name", widget->adaptor->icon_name,
"stock-size", GTK_ICON_SIZE_MENU,
NULL);
else
g_object_set (G_OBJECT (cell),
"text", widget->name,
NULL);
}
static gint
glade_clipboard_view_button_press_cb (GtkWidget *widget,
GdkEventButton *event,
GladeClipboardView *view)
{
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
GtkTreePath *path = NULL;
gboolean handled = FALSE;
if (event->window == gtk_tree_view_get_bin_window (tree_view) &&
gtk_tree_view_get_path_at_pos (tree_view,
(gint) event->x, (gint) event->y,
&path, NULL,
NULL, NULL) && path != NULL)
{
GtkTreeIter iter;
GladeWidget *widget = NULL;
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (view->model),
&iter, path))
{
/* Alright, now we can obtain
* the widget from the iter.
*/
gtk_tree_model_get (GTK_TREE_MODEL (view->model), &iter,
0, &widget, -1);
if (widget != NULL &&
event->button == 3)
{
glade_popup_clipboard_pop (widget, event);
handled = TRUE;
}
gtk_tree_path_free (path);
}
}
return handled;
}
static void
glade_clipboard_view_create_tree_view (GladeClipboardView *view)
{
GtkTreeSelection *sel;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
view->widget =
gtk_tree_view_new_with_model (GTK_TREE_MODEL (view->model));
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_title (column, _("Widget"));
renderer = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, renderer, FALSE);
gtk_tree_view_column_set_cell_data_func (column, renderer,
glade_clipboard_view_cell_function,
GINT_TO_POINTER (1), NULL);
renderer = gtk_cell_renderer_text_new ();
g_object_set (G_OBJECT (renderer),
"xpad", 6, NULL);
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_cell_data_func (column, renderer,
glade_clipboard_view_cell_function,
GINT_TO_POINTER (0), NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (view->widget), column);
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view->widget));
gtk_tree_selection_set_mode (sel, GTK_SELECTION_MULTIPLE);
g_signal_connect_data (G_OBJECT (sel), "changed",
G_CALLBACK (glade_clipboard_view_selection_changed_cb),
view, NULL, 0);
/* Popup menu */
g_signal_connect (G_OBJECT (view->widget), "button-press-event",
G_CALLBACK (glade_clipboard_view_button_press_cb), view);
}
static void
glade_clipboard_view_construct (GladeClipboardView *view)
{
GtkWidget *scrolled_window, *viewport;
view->model = gtk_list_store_new (1, G_TYPE_POINTER);
glade_clipboard_view_populate_model (view);
glade_clipboard_view_create_tree_view (view);
glade_clipboard_view_refresh_sel (view);
viewport = gtk_viewport_new (NULL, NULL);
gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_OUT);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type
(GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN);
gtk_container_set_border_width (GTK_CONTAINER (scrolled_window),
6);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (scrolled_window), view->widget);
gtk_container_add (GTK_CONTAINER (viewport), scrolled_window);
gtk_container_add (GTK_CONTAINER (view), viewport);
gtk_window_set_default_size (GTK_WINDOW (view),
GLADE_CLIPBOARD_VIEW_WIDTH,
GLADE_CLIPBOARD_VIEW_HEIGHT);
gtk_window_set_type_hint (GTK_WINDOW (view), GDK_WINDOW_TYPE_HINT_UTILITY);
gtk_widget_show_all (scrolled_window);
return;
}
/**
* glade_clipboard_view_new:
* @clipboard: a #GladeClipboard
*
* Create a new #GladeClipboardView widget for @clipboard.
*
* Returns: a new #GladeClipboardView cast to be a #GtkWidget
*/
GtkWidget *
glade_clipboard_view_new (GladeClipboard *clipboard)
{
GladeClipboardView *view;
g_return_val_if_fail (GLADE_IS_CLIPBOARD (clipboard), NULL);
view = g_object_new (GLADE_TYPE_CLIPBOARD_VIEW, NULL);
view->clipboard = clipboard;
glade_clipboard_view_construct (view);
return GTK_WIDGET (view);
}
/**
* glade_clipboard_view_add:
* @view: a #GladeClipboardView
* @widget: a #GladeWidget
*
* Adds @widget to @view.
*/
void
glade_clipboard_view_add (GladeClipboardView *view, GladeWidget *widget)
{
GtkTreeIter iter;
g_return_if_fail (GLADE_IS_CLIPBOARD_VIEW (view));
g_return_if_fail (GLADE_IS_WIDGET (widget));
view->updating = TRUE;
gtk_list_store_append (view->model, &iter);
gtk_list_store_set (view->model, &iter, 0, widget, -1);
view->updating = FALSE;
}
/**
* glade_cliboard_view_remove:
* @view: a #GladeClipboardView
* @widget: a #GladeWidget
*
* Removes @widget from @view.
*/
void
glade_clipboard_view_remove (GladeClipboardView *view, GladeWidget *widget)
{
GtkTreeIter iter;
GtkTreeModel *model;
GladeWidget *clip_widget;
g_return_if_fail (GLADE_IS_CLIPBOARD_VIEW (view));
g_return_if_fail (GLADE_IS_WIDGET (widget));
model = GTK_TREE_MODEL (view->model);
if (gtk_tree_model_get_iter_first (model, &iter))
{
do
{
gtk_tree_model_get (model, &iter, 0, &clip_widget, -1);
if (widget == clip_widget)
break;
}
while (gtk_tree_model_iter_next (model, &iter));
}
view->updating = TRUE;
gtk_list_store_remove (view->model, &iter);
view->updating = FALSE;
}
/**
* glade_clipboard_view_refresh_sel:
* @view: a #GladeClipboardView
*
* Synchronizes the treeview selection to the clipboard selection.
*/
void
glade_clipboard_view_refresh_sel (GladeClipboardView *view)
{
GladeWidget *widget;
GtkTreeSelection *sel;
GList *list;
GtkTreeIter *iter;
g_return_if_fail (GLADE_IS_CLIPBOARD_VIEW (view));
if (view->updating) return;
view->updating = TRUE;
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view->widget));
gtk_tree_selection_unselect_all (sel);
for (list = view->clipboard->selection;
list && list->data; list = list->next)
{
widget = list->data;
if ((iter = glade_util_find_iter_by_widget
(GTK_TREE_MODEL (view->model), widget, 0)) != NULL)
{
gtk_tree_selection_select_iter (sel, iter);
/* gtk_tree_iter_free (iter); */
}
}
view->updating = FALSE;
}

View File

@ -1,52 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef __GLADE_CLIPBOARD_VIEW_H__
#define __GLADE_CLIPBOARD_VIEW_H__
#include <gladeui/glade.h>
G_BEGIN_DECLS
#define GLADE_TYPE_CLIPBOARD_VIEW (glade_clipboard_view_get_type ())
#define GLADE_CLIPBOARD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_CLIPBOARD_VIEW, GladeClipboardView))
#define GLADE_CLIPBOARD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_CLIPBOARD_VIEW, GladeClipboardViewClass))
#define GLADE_IS_CLIPBOARD_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_CLIPBOARD_VIEW))
#define GLADE_IS_CLIPBOARD_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_CLIPBOARD_VIEW))
#define GLADE_CLIPBOARD_VIEW_GET_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), GLADE_TYPE_CLIPBOARD_VIEW, GladeClipboardViewClass))
typedef struct _GladeClipboardView GladeClipboardView;
typedef struct _GladeClipboardViewClass GladeClipboardViewClass;
struct _GladeClipboardView
{
GtkWindow parent_instance;
GtkWidget *widget; /* The GtkTreeView widget */
GtkListStore *model; /* The GtkListStore model for the View */
GladeClipboard *clipboard; /* The Clipboard for which this is a view */
gboolean updating; /* Prevent feedback from treeview when changing
* the selecion. */
};
struct _GladeClipboardViewClass
{
GtkWindowClass parent_class;
};
GType glade_clipboard_view_get_type (void) G_GNUC_CONST;
GtkWidget *glade_clipboard_view_new (GladeClipboard *clipboard);
void glade_clipboard_view_add (GladeClipboardView *view,
GladeWidget *widget);
void glade_clipboard_view_remove (GladeClipboardView *view,
GladeWidget *widget);
void glade_clipboard_view_refresh_sel (GladeClipboardView *view);
G_END_DECLS
#endif /* __GLADE_CLIPBOARD_VIEW_H__ */

View File

@ -36,7 +36,6 @@
#include <glib/gi18n-lib.h>
#include "glade.h"
#include "glade-clipboard-view.h"
#include "glade-clipboard.h"
#include "glade-widget.h"
#include "glade-placeholder.h"
@ -89,7 +88,6 @@ static void
glade_clipboard_init (GladeClipboard *clipboard)
{
clipboard->widgets = NULL;
clipboard->view = NULL;
clipboard->selection = NULL;
clipboard->has_selection = FALSE;
}
@ -186,17 +184,8 @@ glade_clipboard_add (GladeClipboard *clipboard, GList *widgets)
clipboard->widgets =
g_list_prepend (clipboard->widgets,
g_object_ref (G_OBJECT (widget)));
/*
* Update view.
*/
glade_clipboard_selection_add (clipboard, widget);
if (clipboard->view)
{
glade_clipboard_view_add
(GLADE_CLIPBOARD_VIEW (clipboard->view), widget);
glade_clipboard_view_refresh_sel
(GLADE_CLIPBOARD_VIEW (clipboard->view));
}
}
}
@ -221,13 +210,6 @@ glade_clipboard_remove (GladeClipboard *clipboard, GList *widgets)
clipboard->widgets =
g_list_remove (clipboard->widgets, widget);
glade_clipboard_selection_remove (clipboard, widget);
/*
* If there is a view present, update it.
*/
if (clipboard->view)
glade_clipboard_view_remove
(GLADE_CLIPBOARD_VIEW (clipboard->view), widget);
g_object_unref (G_OBJECT (widget));
}
@ -240,8 +222,6 @@ glade_clipboard_remove (GladeClipboard *clipboard, GList *widgets)
{
glade_clipboard_selection_add
(clipboard, GLADE_WIDGET (list->data));
glade_clipboard_view_refresh_sel
(GLADE_CLIPBOARD_VIEW (clipboard->view));
}
}

View File

@ -860,7 +860,7 @@ glade_command_set_name (GladeWidget *widget, const gchar* name)
GladeCommand *cmd;
g_return_if_fail (GLADE_IS_WIDGET (widget));
g_return_if_fail (name != NULL);
g_return_if_fail (name && name[0]);
/* Dont spam the queue with false name changes.
*/
@ -973,10 +973,11 @@ get_all_parentless_reffed_widgets (GList *reffed, GladeWidget *widget)
* while newly added widgets will prefer packing defaults.
*
*/
static void
glade_command_add (GList *widgets,
GladeWidget *parent,
GladePlaceholder *placeholder,
void
glade_command_add (GList *widgets,
GladeWidget *parent,
GladePlaceholder *placeholder,
GladeProject *project,
gboolean pasting)
{
GladeCommandAddRemove *me;
@ -1237,7 +1238,7 @@ glade_command_remove (GList *widgets)
glade_command_check_group (GLADE_COMMAND (me));
if (glade_command_add_remove_execute (GLADE_COMMAND (me)))
glade_project_push_undo (GLADE_PROJECT (widget->project), GLADE_COMMAND (me));
glade_project_push_undo (me->project, GLADE_COMMAND (me));
else
g_object_unref (G_OBJECT (me));
@ -1401,7 +1402,7 @@ glade_command_add_execute (GladeCommandAddRemove *me)
glade_widget_show (cdata->widget);
}
glade_app_selection_changed ();
glade_app_queue_selection_changed ();
}
return TRUE;
@ -1709,7 +1710,7 @@ glade_command_clipboard_add_remove_collapse (GladeCommand *this_cmd, GladeComman
* @adaptor: A #GladeWidgetAdaptor
* @parent: the parent #GladeWidget to add the new widget to.
* @placeholder: the placeholder which will be substituted by the widget
* @project: the project his widget belongs to.
* @project: the project this widget belongs to.
*
* Creates a new widget using @adaptor and put in place of the @placeholder
* in the @project
@ -1735,12 +1736,11 @@ glade_command_create(GladeWidgetAdaptor *adaptor, GladeWidget *parent, GladePlac
return NULL;
}
widgets = g_list_prepend(widgets, widget);
glade_command_push_group(_("Create %s"), g_list_length (widgets) == 1 ? widget->name : _("multiple"));
glade_command_add(widgets, parent, placeholder, FALSE);
glade_command_push_group(_("Create %s"), widget->name);
glade_command_add(widgets, parent, placeholder, project, FALSE);
glade_command_pop_group();
if (widgets)
g_list_free(widgets);
g_list_free(widgets);
return widget;
}
@ -1891,17 +1891,20 @@ glade_command_paste(GList *widgets, GladeWidget *parent, GladePlaceholder *place
{
GList *list, *copied_widgets = NULL;
GladeWidget *copied_widget = NULL;
/* GladeProject *target_project; */
GladeProject *target_project;
GladeWidget *placeholder_parent = NULL;
gboolean exact;
g_return_if_fail (widgets != NULL);
placeholder_parent = placeholder ? glade_placeholder_get_parent (placeholder) : NULL;
/* if (placeholder && GTK_IS_WINDOW (widget->object) == FALSE) */
/* target_project = glade_placeholder_get_project (placeholder); */
/* else if (parent && GTK_IS_WINDOW (widget->object) == FALSE) */
/* target_project = glade_widget_get_project (parent); */
/* else */
/* target_project = glade_app_get_project(); */
if (placeholder_parent && GTK_IS_WINDOW (placeholder_parent->object) == FALSE)
target_project = glade_placeholder_get_project (placeholder);
else if (parent && GTK_IS_WINDOW (parent->object) == FALSE)
target_project = glade_widget_get_project (parent);
else
target_project = glade_app_get_project();
for (list = widgets; list && list->data; list = list->next)
{
@ -1917,8 +1920,7 @@ glade_command_paste(GList *widgets, GladeWidget *parent, GladePlaceholder *place
* are not satisfied by the paste list.
*/
glade_command_add(copied_widgets, parent, placeholder, TRUE);
glade_command_add(copied_widgets, parent, placeholder, target_project, TRUE);
glade_command_pop_group();
if (copied_widgets)
@ -1938,15 +1940,26 @@ glade_command_paste(GList *widgets, GladeWidget *parent, GladePlaceholder *place
void
glade_command_dnd(GList *widgets, GladeWidget *parent, GladePlaceholder *placeholder)
{
GladeWidget *widget;
GladeWidget *widget;
GladeWidget *placeholder_parent;
GladeProject *target_project;
g_return_if_fail (widgets != NULL);
placeholder_parent = placeholder ? glade_placeholder_get_parent (placeholder) : NULL;
if (placeholder_parent && GTK_IS_WINDOW (placeholder_parent->object) == FALSE)
target_project = glade_placeholder_get_project (placeholder);
else if (parent && GTK_IS_WINDOW (parent->object) == FALSE)
target_project = glade_widget_get_project (parent);
else
target_project = glade_app_get_project();
widget = widgets->data;
glade_command_push_group(_("Drag-n-Drop from %s to %s"),
parent->name, g_list_length (widgets) == 1 ? widget->name : _("multiple"));
glade_command_remove(widgets);
glade_command_add(widgets, parent, placeholder, TRUE);
glade_command_add(widgets, parent, placeholder, target_project, TRUE);
glade_command_pop_group();
}

View File

@ -121,7 +121,14 @@ void glade_command_lock_widget (GladeWidget *widget,
void glade_command_unlock_widget (GladeWidget *widget);
/************************ create/delete ******************************/
/************************ create/add/delete ******************************/
void glade_command_add (GList *widgets,
GladeWidget *parent,
GladePlaceholder *placeholder,
GladeProject *project,
gboolean pasting);
void glade_command_delete (GList *widgets);

281
gladeui/glade-custom.c Normal file
View File

@ -0,0 +1,281 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* glade-custom.c - An emulation of a custom widget used to
* support the glade-2 style custom widget.
*
* Copyright (C) 2005 The GNOME Foundation.
*
* Author(s):
* Tristan Van Berkom <tvb@gnome.org>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <glib/gi18n-lib.h>
#include "glade-custom.h"
enum
{
PROP_0,
PROP_CREATION,
PROP_STR1,
PROP_STR2,
PROP_INT1,
PROP_INT2
};
static GtkWidgetClass *parent_class = NULL;
/* Ignore properties.
*/
static void
glade_custom_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
}
static void
glade_custom_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
}
static void
glade_custom_finalize (GObject *object)
{
GladeCustom *custom;
g_return_if_fail (GLADE_IS_CUSTOM (object));
custom = GLADE_CUSTOM (object);
/* custom->custom_pixmap can be NULL if the custom
* widget is destroyed before it's realized */
if (custom->custom_pixmap)
g_object_unref (custom->custom_pixmap);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
glade_custom_send_configure (GladeCustom *custom)
{
GtkWidget *widget;
GtkAllocation allocation;
GdkEvent *event = gdk_event_new (GDK_CONFIGURE);
widget = GTK_WIDGET (custom);
event->configure.window = g_object_ref (gtk_widget_get_window (widget));
event->configure.send_event = TRUE;
gtk_widget_get_allocation (widget, &allocation);
event->configure.x = allocation.x;
event->configure.y = allocation.y;
event->configure.width = allocation.width;
event->configure.height = allocation.height;
gtk_widget_event (widget, event);
gdk_event_free (event);
}
static void
glade_custom_realize (GtkWidget *widget)
{
GladeCustom *custom;
GtkAllocation allocation;
GdkWindow *window;
GdkWindowAttr attributes;
gint attributes_mask;
g_return_if_fail (GLADE_IS_CUSTOM (widget));
custom = GLADE_CUSTOM (widget);
gtk_widget_set_realized (widget, TRUE);
attributes.window_type = GDK_WINDOW_CHILD;
gtk_widget_get_allocation (widget, &allocation);
attributes.x = allocation.x;
attributes.y = allocation.y;
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.colormap = gtk_widget_get_colormap (widget);
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
gtk_widget_set_window (widget, window);
gdk_window_set_user_data (window, custom);
gtk_widget_style_attach (widget);
glade_custom_send_configure (custom);
if (!custom->custom_pixmap)
{
custom->custom_pixmap =
gdk_pixmap_colormap_create_from_xpm_d
(NULL, gtk_widget_get_colormap (GTK_WIDGET (custom)),
NULL, NULL, custom_xpm);
g_assert(G_IS_OBJECT(custom->custom_pixmap));
}
gdk_window_set_back_pixmap (gtk_widget_get_window (GTK_WIDGET (custom)), custom->custom_pixmap, FALSE);
}
static void
glade_custom_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
{
g_return_if_fail (GLADE_IS_CUSTOM (widget));
g_return_if_fail (allocation != NULL);
gtk_widget_set_allocation (widget, allocation);
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (gtk_widget_get_window (widget),
allocation->x, allocation->y,
allocation->width, allocation->height);
glade_custom_send_configure (GLADE_CUSTOM (widget));
}
}
static gboolean
glade_custom_expose (GtkWidget *widget, GdkEventExpose *event)
{
GtkStyle *style;
GdkGC *light_gc;
GdkGC *dark_gc;
gint w, h;
g_return_val_if_fail (GLADE_IS_CUSTOM (widget), FALSE);
style = gtk_widget_get_style (widget);
light_gc = style->light_gc[GTK_STATE_NORMAL];
dark_gc = style->dark_gc[GTK_STATE_NORMAL];
gdk_drawable_get_size (event->window, &w, &h);
gdk_draw_line (event->window, light_gc, 0, 0, w - 1, 0);
gdk_draw_line (event->window, light_gc, 0, 0, 0, h - 1);
gdk_draw_line (event->window, dark_gc, 0, h - 1, w - 1, h - 1);
gdk_draw_line (event->window, dark_gc, w - 1, 0, w - 1, h - 1);
return FALSE;
}
static void
glade_custom_init (GladeCustom *custom)
{
custom->custom_pixmap = NULL;
gtk_widget_set_size_request (GTK_WIDGET (custom),
GLADE_CUSTOM_WIDTH_REQ,
GLADE_CUSTOM_HEIGHT_REQ);
gtk_widget_show (GTK_WIDGET (custom));
}
static void
glade_custom_class_init (GladeCustomClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = glade_custom_finalize;
object_class->set_property = glade_custom_set_property;
object_class->get_property = glade_custom_get_property;
widget_class->realize = glade_custom_realize;
widget_class->size_allocate = glade_custom_size_allocate;
widget_class->expose_event = glade_custom_expose;
g_object_class_install_property
(object_class, PROP_CREATION,
g_param_spec_string
("creation-function", _("Creation Function"),
_("The function which creates this widget"),
NULL, G_PARAM_READWRITE));
g_object_class_install_property
(object_class, PROP_STR1,
g_param_spec_string
("string1", _("String 1"),
_("The first string argument to pass to the function"),
NULL, G_PARAM_READWRITE));
g_object_class_install_property
(object_class, PROP_STR2,
g_param_spec_string
("string2", _("String 2"),
_("The second string argument to pass to the function"),
NULL, G_PARAM_READWRITE));
g_object_class_install_property
(object_class, PROP_INT1,
g_param_spec_int
("int1", _("Integer 1"),
_("The first integer argument to pass to the function"),
G_MININT, G_MAXINT, 0, G_PARAM_READWRITE));
g_object_class_install_property
(object_class, PROP_INT2,
g_param_spec_int
("int2", _("Integer 2"),
_("The second integer argument to pass to the function"),
G_MININT, G_MAXINT, 0, G_PARAM_READWRITE));
}
GType
custom_get_type (void)
{
static GType custom_type = 0;
if (!custom_type)
{
static const GTypeInfo custom_info =
{
sizeof (GladeCustomClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) glade_custom_class_init,
(GClassFinalizeFunc) NULL,
NULL, /* class_data */
sizeof (GladeCustom),
0, /* n_preallocs */
(GInstanceInitFunc) glade_custom_init,
};
custom_type =
g_type_register_static (GTK_TYPE_WIDGET,
"Custom",
&custom_info, 0);
}
return custom_type;
}

62
gladeui/glade-custom.h Normal file
View File

@ -0,0 +1,62 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
#ifndef __GLADE_CUSTOM_H__
#define __GLADE_CUSTOM_H__
#include <gladeui/glade.h>
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define GLADE_TYPE_CUSTOM (custom_get_type ())
#define GLADE_CUSTOM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_CUSTOM, GladeCustom))
#define GLADE_CUSTOM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_CUSTOM, GladeCustomClass))
#define GLADE_IS_CUSTOM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_CUSTOM))
#define GLADE_IS_CUSTOM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_CUSTOM))
#define GLADE_CUSTOM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GLADE_TYPE_CUSTOM, GladeCustomClass))
#define GLADE_CUSTOM_WIDTH_REQ 20
#define GLADE_CUSTOM_HEIGHT_REQ 20
/* taken from glade 2 */
static char * custom_xpm[] = {
"8 8 4 1",
" c None",
". c #BBBBBB",
"+ c #D6D6D6",
"@ c #6B5EFF",
".+..+...",
"+..@@@..",
"..@...++",
"..@...++",
"+.@..+..",
".++@@@..",
"..++....",
"..++...."};
typedef struct _GladeCustom GladeCustom;
typedef struct _GladeCustomClass GladeCustomClass;
struct _GladeCustom
{
GtkWidget widget;
GdkPixmap *custom_pixmap;
};
struct _GladeCustomClass
{
GtkWidgetClass parent_class;
};
/* Since the class is called Custom and not GladeCustom,
* glade-widget-class will search for custom_get_type() instead
* if glade_custom_get_type()
*/
GType custom_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __GLADE_CUSTOM_H__ */

View File

@ -57,6 +57,11 @@ struct _GladeDesignViewPrivate
GtkWidget *layout;
GladeProject *project;
GtkWidget *scrolled_window;
GtkWidget *progress;
GtkWidget *progress_window;
};
static GtkVBoxClass *parent_class = NULL;
@ -64,15 +69,53 @@ static GtkVBoxClass *parent_class = NULL;
G_DEFINE_TYPE(GladeDesignView, glade_design_view, GTK_TYPE_VBOX)
static void
glade_design_view_parse_began (GladeProject *project,
GladeDesignView *view)
{
gtk_widget_hide (view->priv->scrolled_window);
gtk_widget_show (view->priv->progress_window);
}
static void
glade_design_view_parse_finished (GladeProject *project,
GladeDesignView *view)
{
gtk_widget_hide (view->priv->progress_window);
gtk_widget_show (view->priv->scrolled_window);
}
static void
glade_design_view_load_progress (GladeProject *project,
gint total,
gint step,
GladeDesignView *view)
{
gchar *path;
gchar *str;
path = glade_utils_replace_home_dir_with_tilde (glade_project_get_path (project));
str = g_strdup_printf (_("Loading %s: loaded %d of %d objects"), path, step, total);
gtk_progress_bar_set_text (GTK_PROGRESS_BAR (view->priv->progress), str);
g_free (str);
g_free (path);
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (view->priv->progress), step * 1.0 / total);
}
static void
glade_design_view_set_project (GladeDesignView *view, GladeProject *project)
{
g_return_if_fail (GLADE_IS_PROJECT (project));
view->priv->project = project;
g_object_set_data (G_OBJECT (view->priv->project), GLADE_DESIGN_VIEW_KEY, view);
g_signal_connect (project, "parse-began", G_CALLBACK (glade_design_view_parse_began), view);
g_signal_connect (project, "parse-finished", G_CALLBACK (glade_design_view_parse_finished), view);
g_signal_connect (project, "load-progress", G_CALLBACK (glade_design_view_load_progress), view);
g_object_set_data (G_OBJECT (view->priv->project), GLADE_DESIGN_VIEW_KEY, view);
}
static void
@ -112,28 +155,49 @@ glade_design_view_get_property (GObject *object,
static void
glade_design_view_init (GladeDesignView *view)
{
GtkWidget *sw;
GtkWidget *viewport;
GtkWidget *viewport, *filler, *align;
view->priv = GLADE_DESIGN_VIEW_GET_PRIVATE (view);
view->priv->project = NULL;
view->priv->layout = glade_design_layout_new ();
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
view->priv->scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (view->priv->scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view->priv->scrolled_window),
GTK_SHADOW_IN);
viewport = gtk_viewport_new (NULL, NULL);
gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
gtk_container_add (GTK_CONTAINER (viewport), view->priv->layout);
gtk_container_add (GTK_CONTAINER (sw), viewport);
gtk_container_add (GTK_CONTAINER (view->priv->scrolled_window), viewport);
gtk_widget_show (sw);
gtk_widget_show (view->priv->scrolled_window);
gtk_widget_show (viewport);
gtk_widget_show (view->priv->layout);
gtk_box_pack_start (GTK_BOX (view), sw, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (view), view->priv->scrolled_window, TRUE, TRUE, 0);
/* The progress window */
view->priv->progress_window = gtk_vbox_new (FALSE, 0);
filler = gtk_label_new (NULL);
gtk_widget_show (filler);
gtk_box_pack_start (GTK_BOX (view->priv->progress_window), filler, TRUE, TRUE, 0);
align = gtk_alignment_new (0.5, 0.5, 0.75, 1.0);
gtk_widget_show (align);
gtk_box_pack_start (GTK_BOX (view->priv->progress_window), align, FALSE, TRUE, 0);
view->priv->progress = gtk_progress_bar_new ();
gtk_progress_bar_set_ellipsize (GTK_PROGRESS_BAR (view->priv->progress), PANGO_ELLIPSIZE_END);
gtk_widget_show (view->priv->progress);
gtk_container_add (GTK_CONTAINER (align), view->priv->progress);
filler = gtk_label_new (NULL);
gtk_widget_show (filler);
gtk_box_pack_start (GTK_BOX (view->priv->progress_window), filler, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (view), view->priv->progress_window, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (view), 0);
}

View File

@ -7,7 +7,7 @@
* Authors:
* Tristan Van Berkom <tvb@gnome.org>
*
* This library is free software; you can redistribute it and/or it
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.

View File

@ -7,7 +7,7 @@
* Authors:
* Tristan Van Berkom <tvb@gnome.org>
*
* This library is free software; you can redistribute it and/or it
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.

View File

@ -3765,9 +3765,27 @@ glade_editor_property_load_by_widget (GladeEditorProperty *eprop,
if (widget)
{
/* properties are allowed to be missing on some internal widgets */
property = glade_widget_get_property (widget, eprop->klass->id);
if (eprop->klass->packing)
property = glade_widget_get_pack_property (widget, eprop->klass->id);
else
property = glade_widget_get_property (widget, eprop->klass->id);
glade_editor_property_load (eprop, property);
if (property)
{
g_assert (eprop->klass == property->klass);
gtk_widget_show (GTK_WIDGET (eprop));
gtk_widget_show (GTK_WIDGET (eprop->item_label));
}
else
{
gtk_widget_hide (GTK_WIDGET (eprop));
gtk_widget_hide (GTK_WIDGET (eprop->item_label));
}
}
else
glade_editor_property_load (eprop, NULL);
}

View File

@ -37,6 +37,20 @@ G_DEFINE_TYPE_WITH_CODE (GladeEditorTable, glade_editor_table, GTK_TYPE_TABLE,
G_IMPLEMENT_INTERFACE (GLADE_TYPE_EDITABLE,
glade_editor_table_editable_init));
#define BLOCK_NAME_ENTRY_CB(table) \
do { if (table->name_entry) \
g_signal_handlers_block_by_func (G_OBJECT (table->name_entry), \
G_CALLBACK (widget_name_edited), table); \
} while (0);
#define UNBLOCK_NAME_ENTRY_CB(table) \
do { if (table->name_entry) \
g_signal_handlers_unblock_by_func (G_OBJECT (table->name_entry), \
G_CALLBACK (widget_name_edited), table); \
} while (0);
static void
glade_editor_table_class_init (GladeEditorTableClass *klass)
{
@ -107,6 +121,29 @@ glade_editor_table_grab_focus (GtkWidget *widget)
GTK_WIDGET_CLASS (glade_editor_table_parent_class)->grab_focus (widget);
}
static void
widget_name_edited (GtkWidget *editable, GladeEditorTable *table)
{
GladeWidget *widget;
gchar *new_name;
g_return_if_fail (GTK_IS_EDITABLE (editable));
g_return_if_fail (GLADE_IS_EDITOR_TABLE (table));
if (table->loaded_widget == NULL)
{
g_warning ("Name entry edited with no loaded widget in editor %p!\n",
table);
return;
}
widget = table->loaded_widget;
new_name = gtk_editable_get_chars (GTK_EDITABLE (editable), 0, -1);
if (glade_project_available_widget_name (widget->project, widget, new_name))
glade_command_set_name (widget, new_name);
g_free (new_name);
}
static void
widget_name_changed (GladeWidget *widget,
@ -116,10 +153,12 @@ widget_name_changed (GladeWidget *widget,
if (!gtk_widget_get_mapped (GTK_WIDGET (table)))
return;
table->loading = TRUE;
if (table->name_entry)
{
BLOCK_NAME_ENTRY_CB (table);
gtk_entry_set_text (GTK_ENTRY (table->name_entry), table->loaded_widget->name);
table->loading = FALSE;
UNBLOCK_NAME_ENTRY_CB (table);
}
}
@ -142,12 +181,9 @@ glade_editor_table_load (GladeEditable *editable,
GList *list;
/* abort mission */
if ((!table->loaded_widget && !widget) ||
(table->loaded_widget && table->loaded_widget == widget))
if (table->loaded_widget == widget)
return;
table->loading = TRUE;
if (table->loaded_widget)
{
g_signal_handlers_disconnect_by_func (G_OBJECT (table->loaded_widget),
@ -161,6 +197,8 @@ glade_editor_table_load (GladeEditable *editable,
table->loaded_widget = widget;
BLOCK_NAME_ENTRY_CB (table);
if (table->loaded_widget)
{
g_signal_connect (G_OBJECT (table->loaded_widget), "notify::name",
@ -178,14 +216,14 @@ glade_editor_table_load (GladeEditable *editable,
else if (table->name_entry)
gtk_entry_set_text (GTK_ENTRY (table->name_entry), "");
UNBLOCK_NAME_ENTRY_CB (table);
/* Sync up properties, even if widget is NULL */
for (list = table->properties; list; list = list->next)
{
property = list->data;
glade_editor_property_load_by_widget (property, widget);
}
table->loading = FALSE;
}
static void
@ -330,26 +368,6 @@ append_items (GladeEditorTable *table,
table->properties = g_list_reverse (table->properties);
}
static void
widget_name_edited (GtkWidget *editable, GladeEditorTable *table)
{
GladeWidget *widget;
gchar *new_name;
g_return_if_fail (GTK_IS_EDITABLE (editable));
g_return_if_fail (GLADE_IS_EDITOR_TABLE (table));
if (table->loading) return;
widget = table->loaded_widget;
new_name = gtk_editable_get_chars (GTK_EDITABLE (editable), 0, -1);
if (glade_project_available_widget_name (widget->project, widget, new_name))
glade_command_set_name (widget, new_name);
g_free (new_name);
}
static void
append_name_field (GladeEditorTable *table)
{

View File

@ -69,9 +69,6 @@ struct _GladeEditorTable
* the general tab, a packing tab or the query popup ?
*/
gboolean loading; /* Avoid recursion while loading values into widgets
*/
gint rows;
};

View File

@ -346,6 +346,7 @@ glade_editor_update_class_field (GladeEditor *editor)
}
else
{
gtk_widget_hide (editor->class_icon);
gtk_widget_hide (editor->warning);
gtk_label_set_text (GTK_LABEL (editor->class_label), _("Properties"));
}
@ -722,6 +723,9 @@ glade_editor_load_widget_real (GladeEditor *editor, GladeWidget *widget)
editor->loaded_widget = NULL;
/* Clear class header */
glade_editor_update_class_field (editor);
g_object_notify (G_OBJECT (editor), "widget");
return;
}
@ -818,41 +822,44 @@ query_dialog_style_set_cb (GtkWidget *dialog,
gboolean
glade_editor_query_dialog (GladeEditor *editor, GladeWidget *widget)
{
GtkWidget *dialog, *editable, *content_area;
gchar *title;
gint answer;
gboolean retval = TRUE;
GladeWidgetAdaptor *adaptor;
GtkWidget *dialog, *editable, *content_area;
GtkWidget *create;
gchar *title;
gint answer;
gboolean retval = TRUE;
title = g_strdup_printf (_("Create a %s"), widget->adaptor->name);
g_return_val_if_fail (GLADE_IS_WIDGET (widget), FALSE);
adaptor = glade_widget_get_adaptor (widget);
title = g_strdup_printf (_("Create a %s"), adaptor->name);
dialog = gtk_dialog_new_with_buttons (title, NULL,
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT |
GTK_DIALOG_NO_SEPARATOR,
GTK_DIALOG_MODAL |
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
g_free (title);
create = gtk_button_new_with_mnemonic (_("Crea_te"));
gtk_widget_show (create);
gtk_widget_set_can_default (create, TRUE);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), create, GTK_RESPONSE_OK);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_CANCEL, -1);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
editable = glade_editor_get_editable_by_adaptor (editor,
widget->adaptor,
GLADE_PAGE_QUERY);
editable = (GtkWidget *) glade_widget_adaptor_create_editable (adaptor, GLADE_PAGE_QUERY);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_box_pack_start (GTK_BOX (content_area),
editable, FALSE, FALSE, 6);
gtk_box_pack_start (GTK_BOX (content_area), editable, FALSE, FALSE, 6);
glade_editable_load (GLADE_EDITABLE (editable), widget);
g_signal_connect (dialog, "style-set",
G_CALLBACK (query_dialog_style_set_cb),
NULL);
g_signal_connect (dialog, "style-set",
G_CALLBACK (query_dialog_style_set_cb), NULL);
answer = gtk_dialog_run (GTK_DIALOG (dialog));
@ -864,8 +871,6 @@ glade_editor_query_dialog (GladeEditor *editor, GladeWidget *widget)
if (answer == GTK_RESPONSE_CANCEL)
retval = FALSE;
gtk_container_remove (GTK_CONTAINER (content_area), editable);
gtk_widget_destroy (dialog);
return retval;
}

View File

@ -152,10 +152,23 @@ void
glade_id_allocator_release (GladeIDAllocator *allocator,
guint id)
{
guint word_idx;
g_return_if_fail (allocator != NULL);
id = id > 0 ? id - 1 : 0;
allocator->data[id >> 5] |= 1 << (id & 31);
/* Allocated ids start with 1 */
if (id > 0)
{
id = id - 1;
word_idx = id >> 5;
/* Tollerate releasing ids that were never allocated with the allocator
* or are out of range... when we load Glade files with huge numbers it happens
* that loaded unallocated ids are out of range
*/
if (word_idx < allocator->n_words)
allocator->data[word_idx] |= 1 << (id & 31);
}
}
#ifdef GLADE_ID_ALLOCATOR_TEST

View File

@ -578,30 +578,50 @@ static void
selection_foreach_func (GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data)
GList **selection)
{
GObject* object;
gtk_tree_model_get (model, iter, GLADE_PROJECT_MODEL_COLUMN_OBJECT, &object, -1);
if (object)
glade_app_selection_add (object, FALSE);
{
*selection = g_list_prepend (*selection, object);
g_object_unref (object);
}
}
static void
selection_changed_cb (GtkTreeSelection *selection,
GladeInspector *inspector)
{
GList *sel = NULL, *l;
gtk_tree_selection_selected_foreach (selection,
(GtkTreeSelectionForeachFunc)selection_foreach_func,
&sel);
/* We dont modify the project selection for a change that
* leaves us with no selection.
*
* This is typically because the user is changing the name
* of a widget and the filter is active, the new name causes
* the row to go out of the model and the selection to be
* cleared, if we clear the selection we remove the editor
* that the user is trying to type into.
*/
if (!sel)
return;
g_signal_handlers_block_by_func (inspector->priv->project,
G_CALLBACK (project_selection_changed_cb),
inspector);
glade_app_selection_clear (FALSE);
gtk_tree_selection_selected_foreach (selection,
selection_foreach_func,
inspector);
for (l = sel; l; l = l->next)
glade_app_selection_add (G_OBJECT (l->data), FALSE);
glade_app_selection_changed ();
g_list_free (sel);
g_signal_handlers_unblock_by_func (inspector->priv->project,
G_CALLBACK (project_selection_changed_cb),
@ -648,7 +668,8 @@ button_press_cb (GtkWidget *widget,
GLADE_PROJECT_MODEL_COLUMN_OBJECT, &object, -1);
if (widget != NULL)
glade_popup_widget_pop (glade_widget_get_from_gobject (object), event, TRUE);
glade_popup_widget_pop (glade_widget_get_from_gobject (object),
event, TRUE);
else
glade_popup_simple_pop (event);
@ -864,6 +885,7 @@ glade_inspector_get_selected_items (GladeInspector *inspector)
gtk_tree_model_get (GTK_TREE_MODEL (priv->project), &iter,
GLADE_PROJECT_MODEL_COLUMN_OBJECT, &object, -1);
g_object_unref (object);
items = g_list_prepend (items, glade_widget_get_from_gobject (object));
}

View File

@ -3,6 +3,7 @@ VOID:POINTER
VOID:STRING,ULONG,UINT,STRING
VOID:OBJECT
VOID:STRING
VOID:INT,INT
VOID:OBJECT,OBJECT
VOID:OBJECT,BOOLEAN
VOID:STRING,STRING,STRING

View File

@ -4,7 +4,7 @@
*
* Copyright (C) 2008 Tristan Van Berkom.
*
* This library is free software; you can redistribute it and/or it
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
@ -43,7 +43,7 @@ struct _GladeNameContext {
GladeNameContext *
glade_name_context_new (void)
{
GladeNameContext *context = g_new0 (GladeNameContext, 1);
GladeNameContext *context = g_slice_new0 (GladeNameContext);
context->name_allocators = g_hash_table_new_full (g_str_hash,
g_str_equal,
@ -65,7 +65,7 @@ glade_name_context_destroy (GladeNameContext *context)
g_hash_table_destroy (context->name_allocators);
g_hash_table_destroy (context->names);
g_free (context);
g_slice_free (GladeNameContext, context);
}
gchar *
@ -117,10 +117,12 @@ glade_name_context_dual_new_name (GladeNameContext *context,
const gchar *base_name)
{
GladeIDAllocator *id_allocator;
GList *free_ids = NULL, *l;
const gchar *number;
gchar *name = NULL, *freeme = NULL;
guint i = 1;
guint i;
gboolean found = FALSE;
g_return_val_if_fail (context != NULL, NULL);
g_return_val_if_fail (another_context != NULL, NULL);
g_return_val_if_fail (base_name && base_name[0], NULL);
@ -130,11 +132,11 @@ glade_name_context_dual_new_name (GladeNameContext *context,
--number;
if (*number)
{
{
freeme = g_strndup (base_name, number - base_name);
base_name = freeme;
}
id_allocator = g_hash_table_lookup (context->name_allocators, base_name);
if (id_allocator == NULL)
@ -143,15 +145,28 @@ glade_name_context_dual_new_name (GladeNameContext *context,
g_hash_table_insert (context->name_allocators,
g_strdup (base_name), id_allocator);
}
do
{
while (!found)
{
g_free (name);
i = glade_id_allocator_allocate (id_allocator);
name = g_strdup_printf ("%s%u", base_name, i);
}
while (glade_name_context_has_name (context, name) ||
glade_name_context_has_name (another_context, name));
if (!(glade_name_context_has_name (context, name) ||
glade_name_context_has_name (another_context, name)))
found = TRUE;
else
free_ids = g_list_prepend (free_ids, GUINT_TO_POINTER (i));
}
/* Release all the ids that were not hits */
for (l = free_ids; l; l = l->next)
{
i = GPOINTER_TO_UINT (l->data);
glade_id_allocator_release (id_allocator, i);
}
g_list_free (free_ids);
g_free (freeme);
return name;
@ -221,17 +236,12 @@ glade_name_context_release_name (GladeNameContext *context,
}
while (TRUE);
/* if there is a number - then we have to unallocate it... */
if (ch == 0) return;
base_name = g_strdup (name);
*(base_name + (first_number - name)) = 0;
if ((id_allocator =
g_hash_table_lookup (context->name_allocators, base_name)) != NULL)
{
id = (int) strtol (first_number, &end_number, 10);
if (*end_number == 0)
glade_id_allocator_release (id_allocator, id);

View File

@ -562,15 +562,35 @@ glade_palette_item_button_press (GtkWidget *button,
static GtkWidget*
glade_palette_new_item (GladePalette *palette, GladeWidgetAdaptor *adaptor)
{
GtkWidget *item, *button;
GtkWidget *item, *button, *label;
#if GTK_CHECK_VERSION (2, 24, 0)
GtkWidget *box;
#endif
item = (GtkWidget *)gtk_toggle_tool_button_new ();
g_object_set_data (G_OBJECT (item), "glade-widget-adaptor", adaptor);
button = gtk_bin_get_child (GTK_BIN (item));
g_assert (GTK_IS_BUTTON (button));
/* Add a box to avoid the ellipsize on the items
* (old versions expect a label as the label widget, too bad for them)
*/
#if GTK_CHECK_VERSION (2, 24, 0)
box = gtk_hbox_new (FALSE, 0);
label = gtk_label_new (adaptor->title);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_widget_show (label);
gtk_widget_show (box);
gtk_container_add (GTK_CONTAINER (box), label);
gtk_tool_button_set_label_widget (GTK_TOOL_BUTTON (item), box);
#else
label = gtk_label_new (adaptor->title);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_widget_show (label);
gtk_tool_button_set_label_widget (GTK_TOOL_BUTTON (item), label);
#endif
gtk_tool_button_set_label (GTK_TOOL_BUTTON (item), adaptor->title);
glade_palette_item_refresh (item);
/* Update selection when the item is pushed */
@ -760,6 +780,8 @@ glade_palette_init (GladePalette *palette)
gtk_widget_show (sw);
gtk_widget_show (priv->toolpalette);
glade_palette_update_appearance (palette);
gtk_widget_set_no_show_all (GTK_WIDGET (palette), TRUE);
}

View File

@ -1,333 +0,0 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2010 Marco Diego Aurélio Mesquita
*
* 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:
* Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
*/
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
static void
display_help_and_quit (const GOptionEntry *entries)
{
GOptionContext *context;
context = g_option_context_new (_("- previews a glade UI definition"));
g_option_context_add_main_entries (context, entries, NULL);
g_option_context_add_group (context, gtk_get_option_group (TRUE));
g_print ("%s\n", g_option_context_get_help (context, TRUE, NULL));
g_option_context_free (context);
exit (1);
}
static void
parse_arguments (int argc, char **argv, gchar **toplevel_name, gchar **file_name)
{
*toplevel_name = NULL;
*file_name = NULL;
gboolean listen = FALSE;
gboolean version = FALSE;
GError *error = NULL;
GOptionEntry entries[] =
{
{ "filename", 'f', G_OPTION_FLAG_FILENAME|G_OPTION_FLAG_OPTIONAL_ARG,
G_OPTION_ARG_FILENAME, file_name, _("Name of the file to preview"), "FILENAME" },
{ "toplevel", 't', G_OPTION_FLAG_OPTIONAL_ARG,
G_OPTION_ARG_STRING, toplevel_name, _("Name of the toplevel to preview"), "TOPLEVELNAME" },
{ "listen", 'l', 0, G_OPTION_ARG_NONE, &listen, _("Listen standard input"), NULL },
{ "version", 'v', 0, G_OPTION_ARG_NONE, &version, _("Display previewer version"), NULL },
{ NULL }
};
if (!gtk_init_with_args (&argc, &argv, _("- previews a glade UI definition"),
entries, NULL, &error))
{
g_printerr (_("%s\nRun '%s --help' to see a full list of available command line"
"options.\n"), error->message, argv[0]);
g_error_free (error);
exit(1);
}
if (version)
{
g_print ("glade-previewer " VERSION "\n");
exit (0);
}
if (listen && *file_name != NULL)
{
g_printerr (_("--listen and --filename must not be simultaneously specified.\n"));
display_help_and_quit (entries);
}
if (!listen && *file_name == NULL)
{
g_printerr (_("Either --listen or --filename must be specified.\n"));
display_help_and_quit (entries);
}
}
static GtkWidget *
get_toplevel (gchar *name, gchar *string, gsize length)
{
GError *error = NULL;
GtkWidget *toplevel = NULL;
GtkWidget *window = NULL;
GtkBuilder *builder;
GObject *object;
GSList *objects;
builder = gtk_builder_new ();
if (!gtk_builder_add_from_string (builder, string, length, &error))
{
g_printerr (_("Couldn't load builder definition: %s"), error->message);
g_error_free (error);
exit (1);
}
if (name == NULL)
{
objects = gtk_builder_get_objects (builder);
/* Iterate trough objects and search for a window or widget */
while (objects != NULL)
{
if (GTK_IS_WIDGET (objects->data) && toplevel == NULL)
{
toplevel = GTK_WIDGET(objects->data);
}
if (GTK_IS_WINDOW (objects->data))
{
window = GTK_WIDGET(objects->data);
break;
}
objects = objects->next;
}
if (window != NULL)
{
toplevel = window;
}
else if (toplevel == NULL)
{
g_printerr (_("UI definition has no previewable widgets.\n"));
exit (1);
}
} else {
object = gtk_builder_get_object (builder, name);
if (object == NULL)
{
g_printerr (_("Object %s not found in UI definition.\n"), name);
exit (1);
}
if (!GTK_IS_WIDGET(object))
{
g_printerr (_("Object is not previewable.\n"));
exit (1);
}
toplevel = GTK_WIDGET(object);
}
g_object_unref (builder);
return toplevel;
}
static void
preview_widget (gchar *name, gchar *buffer, gsize length)
{
GtkWidget *widget;
GtkWidget *widget_parent;
GtkWidget *window;
widget = get_toplevel (name, buffer, length);
if (GTK_IS_WINDOW (widget))
{
window = widget;
} else {
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), _("Preview"));
/* Reparenting snippet */
g_object_ref(widget);
widget_parent = gtk_widget_get_parent (widget);
if (widget_parent != NULL) gtk_container_remove(GTK_CONTAINER(widget_parent), widget);
gtk_container_add(GTK_CONTAINER(window), widget);
g_object_unref(widget);
}
g_signal_connect (GTK_OBJECT (window), "destroy", G_CALLBACK (gtk_main_quit), NULL);
gtk_widget_show_all (window);
}
static GIOChannel *
channel_from_stream (gint stream)
{
GIOChannel *channel;
#ifdef WINDOWS
channel = g_io_channel_win32_new_fd (stream);
#else
channel = g_io_channel_unix_new (stream);
#endif
return channel;
}
static void
preview_file (gchar *toplevel_name, gchar *file_name)
{
gchar *buffer;
gsize length;
GError *error = NULL;
GIOChannel *input;
gint stream;
stream = fileno (fopen (file_name, "r"));
input = channel_from_stream (stream);
if (g_io_channel_read_to_end (input, &buffer, &length, &error) != G_IO_STATUS_NORMAL)
{
g_printerr (_("Error: %s.\n"), error->message);
g_error_free (error);
exit (1);
}
preview_widget (toplevel_name, buffer, length);
g_free (buffer);
g_io_channel_unref (input);
}
static gchar *
read_buffer (GIOChannel *source)
{
gchar *buffer;
gchar *token;
gchar *tmp;
GError *error = NULL;
if (g_io_channel_read_line (source, &token, NULL, NULL, &error) != G_IO_STATUS_NORMAL)
{
g_printerr (_("Error: %s.\n"), error->message);
g_error_free (error);
exit (1);
}
/* Check for quit token */
if (g_strcmp0 ("<quit>", token) == 0)
{
g_free (token);
return NULL;
}
/* Loop to load the UI */
buffer = g_strdup(token);
do
{
g_free (token);
if (g_io_channel_read_line (source, &token, NULL, NULL, &error) != G_IO_STATUS_NORMAL)
{
g_printerr (_("Error: %s.\n"), error->message);
g_error_free (error);
exit (1);
}
tmp = buffer;
buffer = g_strconcat (buffer, token, NULL);
g_free (tmp);
} while (g_strcmp0 ("</interface>\n", token) != 0);
g_free (token);
return buffer;
}
static gboolean
on_data_incoming (GIOChannel *source, GIOCondition condition, gpointer data)
{
gchar *buffer;
gsize length;
gchar *toplevel_name = (gchar*)data;
buffer = read_buffer (source);
if (buffer == NULL)
{
gtk_main_quit ();
return FALSE;
}
if (condition & G_IO_HUP)
{
g_printerr (_("Broken pipe!\n"));
exit (1);
}
length = strlen (buffer);
preview_widget (toplevel_name, buffer, length);
g_free (buffer);
return TRUE;
}
static void
start_listener (gchar *toplevel_name)
{
GIOChannel *input;
gint stream;
stream = fileno (stdin);
input = channel_from_stream (stream);
g_io_add_watch (input, G_IO_IN|G_IO_HUP, on_data_incoming, toplevel_name);
}
int main (int argc, char **argv)
{
gchar *file_name;
gchar *toplevel_name;
gtk_set_locale ();
parse_arguments (argc, argv, &toplevel_name, &file_name);
if (file_name != NULL)
{
preview_file (toplevel_name, file_name);
} else {
start_listener (toplevel_name);
}
gtk_main ();
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -91,13 +91,13 @@ GType glade_project_get_type (void) G_GNUC_CONST;
GladeProject *glade_project_new (void);
GladeProject *glade_project_load (const gchar *path);
gboolean glade_project_load_from_file (GladeProject *project,
const gchar *path);
gboolean glade_project_save (GladeProject *project,
const gchar *path,
GError **error);
void glade_project_preview (GladeProject *project, GladeWidget *gwidget);
const gchar *glade_project_get_path (GladeProject *project);
gchar *glade_project_get_name (GladeProject *project);
@ -181,15 +181,9 @@ gchar *glade_project_resource_fullpath (GladeProject *project,
gboolean glade_project_is_loading (GladeProject *project);
time_t glade_project_get_file_mtime (GladeProject *project);
guint glade_project_get_instance_count (GladeProject *project);
void glade_project_set_instance_count (GladeProject *project, guint instance_count);
gboolean glade_project_get_modified (GladeProject *project);
gboolean glade_project_get_previewable (GladeProject *project);
void glade_project_set_format (GladeProject *project, GladeProjectFormat format);
GladeProjectFormat glade_project_get_format (GladeProject *project);
@ -221,6 +215,14 @@ void glade_project_update_signal_support_warning (GladeWidget *widget,
gchar *glade_project_display_dependencies (GladeProject *project);
void glade_project_check_reordered (GladeProject *project,
GladeWidget *parent,
GList *old_order);
void glade_project_push_progress (GladeProject *project);
gboolean glade_project_load_cancelled (GladeProject *project);
void glade_project_cancel_load (GladeProject *project);
G_END_DECLS
#endif /* __GLADE_PROJECT_H__ */

View File

@ -674,7 +674,7 @@ glade_property_class_make_objects_from_string (GladePropertyClass *property_clas
}
g_strfreev (split);
}
return objects;
return g_list_reverse (objects);
}
/**

View File

@ -111,8 +111,9 @@ glade_property_dup_impl (GladeProperty *template_prop, GladeWidget *widget)
else
g_value_copy (template_prop->value, property->value);
/* Need value in place here ... */
glade_property_set_enabled (property, template_prop->enabled);
property->enabled = template_prop->enabled;
property->state = template_prop->state;
glade_property_set_sensitive (property, template_prop->sensitive,
template_prop->insensitive_tooltip);
@ -129,7 +130,8 @@ glade_property_equals_value_impl (GladeProperty *property,
if (property->widget)
{
project = glade_widget_get_project (property->widget);
fmt = glade_project_get_format (project);
if (project)
fmt = glade_project_get_format (project);
}
return !glade_property_class_compare (property->klass, property->value, value, fmt);
@ -245,7 +247,8 @@ glade_property_set_value_impl (GladeProperty *property, const GValue *value)
#if 0
{
g_print ("***************************************************\n");
g_print ("Setting property %s on %s ..\n",
g_print ("Setting %s property %s on %s ..\n",
property->klass->packing ? "packing" : "normal",
property->klass->id,
property->widget ? property->widget->name : "unknown");
@ -288,11 +291,12 @@ glade_property_set_value_impl (GladeProperty *property, const GValue *value)
/* Add/Remove references from widget ref stacks here
* (before assigning the value)
*/
if (property->widget && changed && glade_property_class_is_object
(property->klass, glade_project_get_format (project)))
if (property->widget && changed &&
glade_property_class_is_object (property->klass,
project ? glade_project_get_format (project) :
GLADE_PROJECT_FORMAT_GTKBUILDER))
glade_property_update_prop_refs (property, property->value, value);
/* Make a copy of the old value */
g_value_init (&old_value, G_VALUE_TYPE (property->value));
g_value_copy (property->value, &old_value);
@ -351,8 +355,8 @@ glade_property_sync_impl (GladeProperty *property)
* (other properties may be used for convenience in the plugin).
*/
if ((property->klass->packing &&
property != glade_widget_get_pack_property (property->widget, property->klass->id)) ||
property != glade_widget_get_property (property->widget, property->klass->id))
!glade_widget_get_pack_property (property->widget, property->klass->id)) ||
!glade_widget_get_property (property->widget, property->klass->id))
return;
property->syncing++;
@ -1104,7 +1108,7 @@ glade_property_write (GladeProperty *property,
GladeProjectFormat fmt;
GladeXmlNode *prop_node;
GladeProject *project;
gchar *name, *value, *tmp;
gchar *name, *value;
g_return_if_fail (GLADE_IS_PROPERTY (property));
g_return_if_fail (node != NULL);
@ -1147,13 +1151,6 @@ glade_property_write (GladeProperty *property,
* funcs that may not like NULL.
*/
value = g_strdup ("");
else
{
/* Escape the string so that it will be parsed as it should. */
tmp = value;
value = g_markup_escape_text (value, -1);
g_free (tmp);
}
/* Now dump the node values... */
prop_node = glade_xml_node_new (context, GLADE_XML_TAG_PROPERTY);

View File

@ -420,6 +420,77 @@ glade_util_compare_stock_labels (gconstpointer a, gconstpointer b)
return retval;
}
/**
* glade_util_gtk_combo_func:
* @data:
*
* TODO: write me
*
* Returns:
*/
gchar *
glade_util_gtk_combo_func (gpointer data)
{
GtkListItem * listitem = data;
/* I needed to pinch this as well - Damon. */
static const gchar *gtk_combo_string_key = "gtk-combo-string-value";
GtkWidget *label;
gchar *ltext = NULL;
ltext = (gchar *) g_object_get_data (G_OBJECT (listitem),
gtk_combo_string_key);
if (!ltext) {
label = gtk_bin_get_child (GTK_BIN (listitem));
if (!label || !GTK_IS_LABEL (label))
return NULL;
ltext = (gchar*) gtk_label_get_text (GTK_LABEL (label));
}
return ltext;
}
/* These are pinched from gtkcombo.c */
/**
* glade_util_gtk_combo_find:
* @combo:
*
* TODO: write me
*
* Returns:
*/
gpointer /* GtkListItem * */
glade_util_gtk_combo_find (GtkCombo * combo)
{
gchar *text;
gchar *ltext;
GList *clist;
gsize len;
int (*string_compare) (const char *, const char *, gsize);
if (combo->case_sensitive)
string_compare = strncmp;
else
string_compare = g_ascii_strncasecmp;
text = (gchar*) gtk_entry_get_text (GTK_ENTRY (combo->entry));
len = text ? strlen (text) : 0;
clist = GTK_LIST (combo->list)->children;
while (clist && clist->data) {
ltext = glade_util_gtk_combo_func (GTK_LIST_ITEM (clist->data));
if (!ltext)
continue;
if (!(*string_compare) (ltext, text, len))
return (GtkListItem *) clist->data;
clist = clist->next;
}
return NULL;
}
/**
* glade_util_hide_window:
* @window: a #GtkWindow
@ -1023,7 +1094,7 @@ glade_util_find_iter (GtkTreeModel *model,
gint column)
{
GtkTreeIter *retval = NULL;
GObject* object;
GObject* object = NULL;
GtkTreeIter *next;
g_return_val_if_fail (GTK_IS_TREE_MODEL (model), NULL);
@ -1034,23 +1105,38 @@ glade_util_find_iter (GtkTreeModel *model,
while (retval == NULL)
{
GladeWidget *widget;
gtk_tree_model_get (model, next, column, &object, -1);
if (object == glade_widget_get_object (findme))
if (object &&
gtk_tree_model_get_column_type (model, column) == G_TYPE_OBJECT)
g_object_unref (object);
widget = glade_widget_get_from_gobject (object);
if (widget == findme)
{
retval = gtk_tree_iter_copy (next);
break;
}
else if (gtk_tree_model_iter_has_child (model, next))
else if (glade_widget_is_ancestor (findme, widget))
{
GtkTreeIter child;
gtk_tree_model_iter_children (model, &child, next);
if ((retval = glade_util_find_iter
(model, &child, findme, column)) != NULL)
break;
if (gtk_tree_model_iter_has_child (model, next))
{
GtkTreeIter child;
gtk_tree_model_iter_children (model, &child, next);
if ((retval = glade_util_find_iter
(model, &child, findme, column)) != NULL)
break;
}
/* Only search the branches where the searched widget
* is actually a child of the this row, optimize the
* searching this way
*/
break;
}
g_object_unref (object);
if (!gtk_tree_model_iter_next (model, next))
break;
}
@ -1540,7 +1626,7 @@ glade_util_have_devhelp (void)
{
/* Devhelp 0.12 required.
*/
if (major >= 0 && minor >= 12)
if (major >= 2 || (major >= 0 && minor >= 12))
have_devhelp = 1;
else
g_message (DEVHELP_OLD_MESSAGE);
@ -1710,7 +1796,7 @@ glade_util_object_is_loading (GObject *object)
project = glade_widget_get_project (widget);
return glade_project_is_loading (project);
return project && glade_project_is_loading (project);
}
/**
@ -2186,52 +2272,6 @@ glade_utils_hijack_key_press (GtkWindow *win,
}
/* copied from gedit */
gchar *
glade_utils_replace_home_dir_with_tilde (const gchar *uri)
{
gchar *tmp;
gchar *home;
g_return_val_if_fail (uri != NULL, NULL);
/* Note that g_get_home_dir returns a const string */
tmp = (gchar *)g_get_home_dir ();
if (tmp == NULL)
return g_strdup (uri);
home = g_filename_to_utf8 (tmp, -1, NULL, NULL, NULL);
if (home == NULL)
return g_strdup (uri);
if (strcmp (uri, home) == 0)
{
g_free (home);
return g_strdup ("~");
}
tmp = home;
home = g_strdup_printf ("%s/", tmp);
g_free (tmp);
if (g_str_has_prefix (uri, home))
{
gchar *res;
res = g_strdup_printf ("~/%s", uri + strlen (home));
g_free (home);
return res;
}
g_free (home);
return g_strdup (uri);
}
void
glade_utils_cairo_draw_line (cairo_t *cr,
@ -2276,3 +2316,54 @@ glade_utils_cairo_draw_rectangle (cairo_t *cr,
cairo_stroke (cr);
}
}
/* copied from gedit */
gchar *
glade_utils_replace_home_dir_with_tilde (const gchar *path)
{
#ifdef G_OS_UNIX
gchar *tmp;
gchar *home;
g_return_val_if_fail (path != NULL, NULL);
/* Note that g_get_home_dir returns a const string */
tmp = (gchar *) g_get_home_dir ();
if (tmp == NULL)
return g_strdup (path);
home = g_filename_to_utf8 (tmp, -1, NULL, NULL, NULL);
if (home == NULL)
return g_strdup (path);
if (strcmp (path, home) == 0)
{
g_free (home);
return g_strdup ("~");
}
tmp = home;
home = g_strdup_printf ("%s/", tmp);
g_free (tmp);
if (g_str_has_prefix (path, home))
{
gchar *res;
res = g_strdup_printf ("~/%s", path + strlen (home));
g_free (home);
return res;
}
g_free (home);
return g_strdup (path);
#else
return g_strdup (path);
#endif
}

View File

@ -49,6 +49,10 @@ gint glade_util_compare_stock_labels (gconstpointer a, gconstpointe
void glade_util_hide_window (GtkWindow *window);
gchar *glade_util_gtk_combo_func (gpointer data);
gpointer glade_util_gtk_combo_find (GtkCombo *combo);
GtkWidget *glade_util_file_dialog_new (const gchar *title,
GladeProject *project,
@ -155,8 +159,6 @@ gint glade_utils_hijack_key_press (GtkWindow *win,
gpointer user_data);
gchar *glade_utils_replace_home_dir_with_tilde (const gchar *uri);
void glade_utils_cairo_draw_line (cairo_t *cr,
GdkColor *color,
gint x1,
@ -173,6 +175,8 @@ void glade_utils_cairo_draw_rectangle (cairo_t *cr,
gint width,
gint height);
gchar *glade_utils_replace_home_dir_with_tilde (const gchar *path);
G_END_DECLS
#endif /* __GLADE_UTILS_H__ */

View File

@ -394,10 +394,10 @@ gwa_clone_parent_properties (GladeWidgetAdaptor *adaptor, gboolean is_packing)
parent_adaptor->priv->catalog))
{
pclass->version_since_major =
pclass->version_since_major = 0;
pclass->version_since_minor = 0;
pclass->builder_since_major =
pclass->builder_since_major = 0;
pclass->builder_since_minor = 0;
}
properties = g_list_prepend (properties, pclass);
@ -548,7 +548,7 @@ gwa_inherit_signals (GladeWidgetAdaptor *adaptor)
if (strcmp (adaptor->priv->catalog,
parent_adaptor->priv->catalog))
signal->version_since_major =
signal->version_since_major = 0;
signal->version_since_minor = 0;
else
{
signal->version_since_major =
@ -862,7 +862,29 @@ glade_widget_adaptor_object_depends (GladeWidgetAdaptor *adaptor,
GladeWidget *widget,
GladeWidget *another)
{
return FALSE;
gboolean depends = FALSE;
GList *l;
for (l = another->prop_refs; !depends && l; l = l->next)
{
GladeProperty *property = l->data;
GladeWidget *prop_widget = property->widget;
/* If one of the properties that reference @another is
* owned by @widget then @widget depends on @another
*/
if (prop_widget == widget)
depends = TRUE;
/* Or if the widget that owns a property which references
* @another is somewhere inside @widget... then @widget
* also depends on @another.
*/
else if (glade_widget_is_ancestor (prop_widget, widget))
depends = TRUE;
}
return depends;
}
static void
@ -930,6 +952,9 @@ glade_widget_adaptor_object_read_widget (GladeWidgetAdaptor *adaptor,
{
if (glade_xml_node_verify_silent (iter_node, GLADE_XML_TAG_CHILD))
glade_widget_read_child (widget, iter_node);
if (glade_project_load_cancelled (widget->project))
return;
}
}

View File

@ -63,8 +63,11 @@ static void glade_widget_set_adaptor (GladeWidget *w
GladeWidgetAdaptor *adaptor);
static void glade_widget_set_properties (GladeWidget *widget,
GList *properties);
static gboolean glade_window_is_embedded (GtkWindow *window);
static gboolean glade_widget_embed (GladeWidget *widget);
static gboolean glade_window_is_embedded (GtkWindow *window);
static gboolean glade_widget_embed (GladeWidget *widget);
static void glade_widget_set_object (GladeWidget *gwidget,
GObject *new_object,
gboolean destroy);
enum
{
@ -102,7 +105,7 @@ static guint glade_widget_signals[LAST_SIGNAL] = {0};
static GQuark glade_widget_name_quark = 0;
G_DEFINE_TYPE (GladeWidget, glade_widget, G_TYPE_OBJECT)
G_DEFINE_TYPE (GladeWidget, glade_widget, G_TYPE_INITIALLY_UNOWNED)
/*******************************************************************************
GladeWidget class methods
@ -126,6 +129,8 @@ glade_widget_add_child_impl (GladeWidget *widget,
GladeWidget *child,
gboolean at_mouse)
{
g_object_ref (child);
/* Safe to set the parent first... setting it afterwards
* creates packing properties, and that is not always
* desirable.
@ -162,6 +167,10 @@ glade_widget_remove_child_impl (GladeWidget *widget,
{
glade_widget_adaptor_remove
(widget->adaptor, widget->object, child->object);
child->parent = NULL;
g_object_unref (child);
}
static void
@ -174,6 +183,8 @@ glade_widget_replace_child_impl (GladeWidget *widget,
if (gnew_widget)
{
g_object_ref (gnew_widget);
gnew_widget->parent = widget;
/* Set packing actions first so we have access from the plugin
@ -181,8 +192,13 @@ glade_widget_replace_child_impl (GladeWidget *widget,
glade_widget_set_packing_actions (gnew_widget, widget);
}
if (gold_widget && gold_widget != gnew_widget)
gold_widget->parent = NULL;
if (gold_widget)
{
g_object_unref (gold_widget);
if (gold_widget != gnew_widget)
gold_widget->parent = NULL;
}
glade_widget_adaptor_replace_child
(widget->adaptor, widget->object,
@ -521,7 +537,7 @@ glade_widget_build_object (GladeWidget *widget,
if (reason == GLADE_CREATE_LOAD)
{
object = glade_widget_adaptor_construct_object (widget->adaptor, 0, NULL);
glade_widget_set_object (widget, object);
glade_widget_set_object (widget, object, TRUE);
return object;
}
@ -536,7 +552,8 @@ glade_widget_build_object (GladeWidget *widget,
free_params (params, n_params);
glade_widget_set_object (widget, object);
/* Dont destroy toplevels when rebuilding, handle that separately */
glade_widget_set_object (widget, object, reason != GLADE_CREATE_REBUILD);
if (template)
params = glade_widget_template_params (widget, FALSE, &n_params);
@ -736,9 +753,9 @@ glade_widget_constructor (GType type,
if (gwidget->object == NULL)
{
object = glade_widget_build_object(gwidget,
gwidget->construct_template,
gwidget->construct_reason);
object = glade_widget_build_object (gwidget,
gwidget->construct_template,
gwidget->construct_reason);
}
/* Copy sync parentless widget props here after a dup
@ -802,6 +819,11 @@ glade_widget_finalize (GObject *object)
g_return_if_fail (GLADE_IS_WIDGET (object));
#if 0
/* A good way to check if refcounts are balancing at project close time */
g_print ("Finalizing widget %s\n", widget->name);
#endif
g_free (widget->name);
g_free (widget->internal);
g_free (widget->support_warning);
@ -812,7 +834,17 @@ glade_widget_finalize (GObject *object)
if (widget->pack_props_hash)
g_hash_table_destroy (widget->pack_props_hash);
G_OBJECT_CLASS(glade_widget_parent_class)->finalize(object);
G_OBJECT_CLASS (glade_widget_parent_class)->finalize(object);
}
static void
reset_object_property (GladeProperty *property,
GladeProject *project)
{
if (glade_property_class_is_object (property->klass,
project ? glade_project_get_format (project) :
GLADE_PROJECT_FORMAT_LIBGLADE))
glade_property_reset (property);
}
static void
@ -820,46 +852,52 @@ glade_widget_dispose (GObject *object)
{
GladeWidget *widget = GLADE_WIDGET (object);
g_return_if_fail (GLADE_IS_WIDGET (object));
glade_widget_push_superuser ();
/* At this point, any callbacks on "object" generated by destroy
* wont come with a GladeWidget
*/
g_object_set_qdata (G_OBJECT (object), glade_widget_name_quark, NULL);
/* We do not keep a reference to internal widgets */
if (widget->internal == NULL)
/* Release references by way of object properties... */
while (widget->prop_refs)
{
if (GTK_IS_OBJECT (widget->object))
gtk_object_destroy (GTK_OBJECT (widget->object));
else
g_object_unref (widget->object);
GladeProperty *property = GLADE_PROPERTY (widget->prop_refs->data);
glade_property_set (property, NULL);
}
if (widget->properties)
g_list_foreach (widget->properties, (GFunc)reset_object_property, widget->project);
/* We have to make sure properties release thier references on other widgets first
* hence the reset (for object properties) */
if (widget->properties)
{
g_list_foreach (widget->properties, (GFunc)g_object_unref, NULL);
g_list_free (widget->properties);
widget->properties = NULL;
}
glade_widget_set_object (widget, NULL, TRUE);
if (widget->packing_properties)
{
g_list_foreach (widget->packing_properties, (GFunc)g_object_unref, NULL);
g_list_free (widget->packing_properties);
widget->packing_properties = NULL;
}
if (widget->actions)
{
g_list_foreach (widget->actions, (GFunc)g_object_unref, NULL);
g_list_free (widget->actions);
widget->actions = NULL;
}
if (widget->packing_actions)
{
g_list_foreach (widget->packing_actions, (GFunc)g_object_unref, NULL);
g_list_free (widget->packing_actions);
widget->packing_actions = NULL;
}
glade_widget_pop_superuser ();
G_OBJECT_CLASS (glade_widget_parent_class)->dispose (object);
}
@ -886,7 +924,7 @@ glade_widget_set_real_property (GObject *object,
break;
case PROP_OBJECT:
if (g_value_get_object (value))
glade_widget_set_object (widget, g_value_get_object (value));
glade_widget_set_object (widget, g_value_get_object (value), TRUE);
break;
case PROP_PROJECT:
glade_widget_set_project (widget, GLADE_PROJECT (g_value_get_object (value)));
@ -1298,8 +1336,7 @@ glade_widget_copy_packing_props (GladeWidget *parent,
for (l = child->packing_properties; l && l->data; l = l->next)
{
dup_prop = GLADE_PROPERTY(l->data);
orig_prop =
glade_widget_get_property (template_widget, dup_prop->klass->id);
orig_prop = glade_widget_get_pack_property (template_widget, dup_prop->klass->id);
glade_property_set_value (dup_prop, orig_prop->value);
}
}
@ -1889,57 +1926,6 @@ glade_widget_get_from_gobject (gpointer object)
return g_object_get_qdata (G_OBJECT (object), glade_widget_name_quark);
}
static void
glade_widget_debug_real (GladeWidget *widget, int indent)
{
g_print ("%*sGladeWidget at %p\n", indent, "", widget);
g_print ("%*sname = [%s]\n", indent, "", widget->name ? widget->name : "-");
g_print ("%*sinternal = [%s]\n", indent, "", widget->internal ? widget->internal : "-");
g_print ("%*sgobject = %p [%s]\n",
indent, "", widget->object, G_OBJECT_TYPE_NAME (widget->object));
if (GTK_IS_WIDGET (widget->object))
g_print ("%*sgtkwidget->parent = %p\n", indent, "",
gtk_widget_get_parent (GTK_WIDGET(widget->object)));
if (GTK_IS_CONTAINER (widget->object)) {
GList *children, *l;
children = glade_util_container_get_all_children
(GTK_CONTAINER (widget->object));
for (l = children; l; l = l->next) {
GtkWidget *widget_gtk = GTK_WIDGET (l->data);
GladeWidget *widget = glade_widget_get_from_gobject (widget_gtk);
if (widget) {
glade_widget_debug_real (widget, indent + 2);
} else if (GLADE_IS_PLACEHOLDER (widget_gtk)) {
g_print ("%*sGtkWidget child %p is a placeholder.\n",
indent + 2, "", widget_gtk);
} else {
g_print ("%*sGtkWidget child %p [%s] has no glade widget.\n",
indent + 2, "",
widget_gtk, G_OBJECT_TYPE_NAME (widget_gtk));
}
}
if (!children)
g_print ("%*shas no children\n", indent, "");
g_list_free (children);
} else {
g_print ("%*snot a container\n", indent, "");
}
g_print ("\n");
}
/**
* glade_widget_debug:
* @widget: a #GladeWidget
*
* Prints some information about a #GladeWidget, currently
* this is unmaintained.
*/
static void
glade_widget_debug (GladeWidget *widget)
{
glade_widget_debug_real (widget, 0);
}
static void
glade_widget_add_to_layout (GladeWidget *widget, GtkWidget *layout)
{
@ -1963,6 +1949,7 @@ glade_widget_show (GladeWidget *widget)
GladeDesignView *view;
GtkWidget *layout;
GladeProperty *property;
GladeProject *project;
g_return_if_fail (GLADE_IS_WIDGET (widget));
@ -1984,16 +1971,14 @@ glade_widget_show (GladeWidget *widget)
return;
}
project = glade_widget_get_project (widget);
if (!project) return;
view = glade_design_view_get_from_project (glade_widget_get_project (widget));
if (!view)
return;
view = glade_design_view_get_from_project (project);
if (!view) return;
layout = GTK_WIDGET (glade_design_view_get_layout (view));
if (!layout)
return;
if (!layout) return;
if (gtk_widget_get_realized (layout))
glade_widget_add_to_layout (widget, layout);
@ -2026,8 +2011,12 @@ glade_widget_hide (GladeWidget *widget)
{
GladeDesignView *view;
GtkWidget *layout;
if ((view = glade_design_view_get_from_project (glade_widget_get_project (widget))) != NULL)
GladeProject *project;
project = glade_widget_get_project (widget);
if (project &&
(view = glade_design_view_get_from_project (project)) != NULL)
{
GtkWidget *child;
@ -2349,15 +2338,33 @@ glade_widget_rebuild (GladeWidget *gwidget)
{
GObject *new_object, *old_object;
GladeWidgetAdaptor *adaptor;
GladeProject *project = NULL;
GList *children;
gboolean reselect = FALSE, inproject;
GList *restore_properties = NULL;
GList *save_properties, *l;
GList *save_properties, *l;
GladeWidget *parent = NULL;
g_return_if_fail (GLADE_IS_WIDGET (gwidget));
adaptor = gwidget->adaptor;
if (gwidget->project &&
glade_project_has_object (gwidget->project, gwidget->object))
project = gwidget->project;
if (gwidget->parent &&
glade_widget_adaptor_has_child (gwidget->parent->adaptor,
gwidget->parent->object,
gwidget->object))
parent = gwidget->parent;
g_object_ref (gwidget);
/* Extract and keep the child hierarchies aside... */
children = glade_widget_extract_children (gwidget);
/* Here we take care removing the widget from the project and
* the selection before rebuilding the instance.
*/
@ -2365,22 +2372,19 @@ glade_widget_rebuild (GladeWidget *gwidget)
(glade_project_has_object
(gwidget->project, gwidget->object) ? TRUE : FALSE) : FALSE;
if (inproject)
if (project)
{
if (glade_project_is_selected (gwidget->project,
gwidget->object))
if (glade_project_is_selected (project, gwidget->object))
{
reselect = TRUE;
glade_project_selection_remove
(gwidget->project, gwidget->object, FALSE);
(project, gwidget->object, FALSE);
}
glade_project_remove_object (gwidget->project, gwidget->object);
glade_project_remove_object (project, gwidget->object);
}
/* Extract and keep the child hierarchies aside... */
children = glade_widget_extract_children (gwidget);
/* parentless_widget and object properties that reffer to this widget should be unset before transfering */
/* parentless_widget and object properties that reffer to this widget
* should be unset before transfering */
l = g_list_copy (gwidget->properties);
save_properties = g_list_copy (gwidget->prop_refs);
save_properties = g_list_concat (l, save_properties);
@ -2410,26 +2414,25 @@ glade_widget_rebuild (GladeWidget *gwidget)
}
g_list_free (save_properties);
/* Remove old object from parent
*/
if (parent)
glade_widget_remove_child (parent, gwidget);
/* Hold a reference to the old widget while we transport properties
* and children from it
*/
old_object = g_object_ref(glade_widget_get_object (gwidget));
new_object = glade_widget_build_object(gwidget, gwidget, GLADE_CREATE_REBUILD);
old_object = g_object_ref (glade_widget_get_object (gwidget));
new_object = glade_widget_build_object (gwidget, gwidget, GLADE_CREATE_REBUILD);
/* Only call this once the object has a proper GladeWidget */
glade_widget_adaptor_post_create (adaptor, new_object, GLADE_CREATE_REBUILD);
/* Replace old object with new object in parent
*/
if (gwidget->parent)
glade_widget_replace (gwidget->parent,
old_object, new_object);
/* Must call dispose for cases like dialogs and toplevels */
if (g_type_is_a (adaptor->type, GTK_TYPE_OBJECT))
gtk_object_destroy (GTK_OBJECT (old_object));
if (GTK_IS_WINDOW (old_object))
gtk_widget_destroy (GTK_WIDGET (old_object));
else
g_object_run_dispose (G_OBJECT (old_object));
g_object_unref (old_object);
/* Reparent any children of the old object to the new object
* (this function will consume and free the child list).
@ -2437,7 +2440,12 @@ glade_widget_rebuild (GladeWidget *gwidget)
glade_widget_push_superuser ();
glade_widget_insert_children (gwidget, children);
glade_widget_pop_superuser ();
/* Add new object to parent
*/
if (parent)
glade_widget_add_child (parent, gwidget, FALSE);
/* Custom properties aren't transfered in build_object, since build_object
* is only concerned with object creation.
*/
@ -2465,23 +2473,24 @@ glade_widget_rebuild (GladeWidget *gwidget)
/* Sync packing.
*/
glade_widget_sync_packing_props (gwidget);
if (gwidget->parent)
glade_widget_sync_packing_props (gwidget);
/* If the widget was in a project (and maybe the selection), then
* restore that stuff.
*/
if (inproject)
if (project)
{
glade_project_add_object (gwidget->project, NULL,
gwidget->object);
glade_project_add_object (project, NULL, gwidget->object);
if (reselect)
glade_project_selection_add
(gwidget->project, gwidget->object, TRUE);
glade_project_selection_add (project, gwidget->object, TRUE);
}
/* We shouldnt show if its not already visible */
if (gwidget->visible)
glade_widget_show (gwidget);
g_object_unref (gwidget);
}
/**
@ -3256,14 +3265,34 @@ glade_widget_child_set_property (GladeWidget *widget,
const gchar *property_name,
const GValue *value)
{
GList *old_order = NULL;
g_return_if_fail (GLADE_IS_WIDGET (widget));
g_return_if_fail (GLADE_IS_WIDGET (child));
g_return_if_fail (property_name != NULL && value != NULL);
if (widget->project &&
widget->in_project)
old_order = glade_widget_get_children (widget);
glade_widget_adaptor_child_set_property (widget->adaptor,
widget->object,
child->object,
property_name, value);
/* After setting a child property... it's possible the order of children
* in the parent has been effected.
*
* If this is the case then we need to signal the GladeProject that
* it's rows have been reordered so that any connected views update
* themselves properly.
*/
if (widget->project &&
widget->in_project)
glade_project_check_reordered (widget->project, widget, old_order);
g_list_free (old_order);
}
/**
@ -3320,60 +3349,73 @@ glade_widget_event_private (GtkWidget *widget,
return FALSE;
}
/**
* glade_widget_set_object:
* @gwidget: A #GladeWidget
* @new_object: the new #GObject for @gwidget
*
* Set the runtime object for this GladeWidget wrapper
* (this is used deep in the core and is probably unsafe
* to use elsewhere).
*/
void
glade_widget_set_object (GladeWidget *gwidget, GObject *new_object)
static void
glade_widget_set_object (GladeWidget *gwidget, GObject *new_object, gboolean destroy)
{
GladeWidgetAdaptor *adaptor;
GObject *old_object;
g_return_if_fail (GLADE_IS_WIDGET (gwidget));
g_return_if_fail (G_IS_OBJECT (new_object));
g_return_if_fail (g_type_is_a (G_OBJECT_TYPE (new_object),
g_return_if_fail (new_object == NULL ||
g_type_is_a (G_OBJECT_TYPE (new_object),
gwidget->adaptor->type));
adaptor = gwidget->adaptor;
old_object = gwidget->object;
/* Add internal reference to new widget if its not internal */
if (gwidget->internal)
gwidget->object = G_OBJECT(new_object);
else if (GTK_IS_OBJECT (new_object))
gwidget->object = g_object_ref (G_OBJECT(new_object));
else
/* If this is a base GObject; assume ownership of the initial ref count */
gwidget->object = new_object;
g_object_set_qdata (G_OBJECT (new_object), glade_widget_name_quark, gwidget);
if (gwidget->object == new_object)
return;
if (g_type_is_a (gwidget->adaptor->type, GTK_TYPE_WIDGET))
adaptor = gwidget->adaptor;
old_object = gwidget->object;
gwidget->object = new_object;
if (new_object)
{
/* Disable any built-in DnD
*/
gtk_drag_dest_unset (GTK_WIDGET (new_object));
gtk_drag_source_unset (GTK_WIDGET (new_object));
/* Add internal reference to new widget if its not internal */
if (gwidget->internal == NULL)
{
/* Assume ownership of floating objects */
if (g_object_is_floating (new_object))
g_object_ref_sink (new_object);
}
g_object_set_qdata (G_OBJECT (new_object), glade_widget_name_quark, gwidget);
/* Take care of drawing selection directly on widgets
* for the time being
*/
glade_widget_connect_signal_handlers
(GTK_WIDGET(new_object),
G_CALLBACK (glade_widget_event_private),
gwidget);
if (g_type_is_a (gwidget->adaptor->type, GTK_TYPE_WIDGET))
{
/* Disable any built-in DnD
*/
gtk_drag_dest_unset (GTK_WIDGET (new_object));
gtk_drag_source_unset (GTK_WIDGET (new_object));
/* Take care of drawing selection directly on widgets
* for the time being
*/
glade_widget_connect_signal_handlers
(GTK_WIDGET(new_object),
G_CALLBACK (glade_widget_event_private),
gwidget);
}
}
/* Remove internal reference to old widget */
if (gwidget->internal == NULL && old_object) {
if (old_object)
{
/* From this point on, the GladeWidget is no longer retrievable with
* glade_widget_get_from_gobject() */
g_object_set_qdata (G_OBJECT (old_object), glade_widget_name_quark, NULL);
g_object_unref (G_OBJECT (old_object));
if (gwidget->internal == NULL)
{
#if _YOU_WANT_TO_LOOK_AT_PROJECT_REFCOUNT_BALANCING_
g_print ("Killing '%s::%s' widget's object with reference count %d\n",
gwidget->adaptor->name, gwidget->name ? gwidget->name : "(unknown)",
old_object->ref_count);
#endif
if (GTK_IS_WINDOW (old_object) && destroy)
gtk_widget_destroy (GTK_WIDGET (old_object));
else
g_object_unref (old_object);
}
}
g_object_notify (G_OBJECT (gwidget), "object");
}
@ -3744,6 +3786,9 @@ void
glade_widget_read_child (GladeWidget *widget,
GladeXmlNode *node)
{
if (glade_project_load_cancelled (widget->project))
return;
glade_widget_adaptor_read_child (widget->adaptor, widget, node);
}
@ -3765,12 +3810,15 @@ glade_widget_read (GladeProject *project,
GladeWidget *widget = NULL;
gchar *klass, *id;
glade_widget_push_superuser ();
if (glade_project_load_cancelled (project))
return NULL;
if (!glade_xml_node_verify
(node, GLADE_XML_TAG_WIDGET (glade_project_get_format (project))))
return NULL;
glade_widget_push_superuser ();
if ((klass =
glade_xml_get_property_string_required
(node, GLADE_XML_TAG_CLASS, NULL)) != NULL)
@ -3799,7 +3847,7 @@ glade_widget_read (GladeProject *project,
"internal child %s of %s",
internal,
glade_widget_get_name (parent));
return FALSE;
goto out;
}
if (!(widget =
@ -3829,8 +3877,11 @@ glade_widget_read (GladeProject *project,
g_free (klass);
}
out:
glade_widget_pop_superuser ();
glade_project_push_progress (project);
return widget;
}
@ -3999,6 +4050,35 @@ glade_widget_write (GladeWidget *widget,
}
/**
* gtk_widget_is_ancestor:
* @widget: a #GladeWidget
* @ancestor: another #GladeWidget
*
* Determines whether @widget is somewhere inside @ancestor, possibly with
* intermediate containers.
*
* Return value: %TRUE if @ancestor contains @widget as a child,
* grandchild, great grandchild, etc.
**/
gboolean
glade_widget_is_ancestor (GladeWidget *widget,
GladeWidget *ancestor)
{
g_return_val_if_fail (GLADE_IS_WIDGET (widget), FALSE);
g_return_val_if_fail (GLADE_IS_WIDGET (ancestor), FALSE);
while (widget)
{
if (widget->parent == ancestor)
return TRUE;
widget = widget->parent;
}
return FALSE;
}
static gint glade_widget_su_stack = 0;
/**

View File

@ -23,7 +23,7 @@ typedef struct _GladeWidgetClass GladeWidgetClass;
struct _GladeWidget
{
GObject parent_instance;
GInitiallyUnowned parent_instance;
GladeWidgetAdaptor *adaptor; /* An adaptor class for the object type */
@ -48,11 +48,6 @@ struct _GladeWidget
* Internal children cannot be deleted.
*/
gboolean anarchist; /* Some composite widgets have internal children
* that are not part of the same hierarchy; hence 'anarchists',
* typicly a popup window or its child (we need to mark
* them so we can avoid bookkeeping packing props on them etc.).
*/
GObject *object; /* A pointer to the object that was created.
* if it is a GtkWidget; it is shown as a "view"
@ -84,10 +79,6 @@ struct _GladeWidget
GHashTable *signals; /* A table with a GPtrArray of GladeSignals (signal handlers),
* indexed by its name */
gboolean visible; /* Local copy of widget visibility, we need to keep track of this
* since the objects copy may be invalid due to a rebuild.
*/
GList *prop_refs; /* List of properties in the project who's value are `this object'
* (this is used to set/unset those properties when the object is
* added/removed from the project).
@ -112,12 +103,24 @@ struct _GladeWidget
GladeWidget *construct_template;
GladeCreateReason construct_reason;
gchar *construct_internal;
gboolean construct_exact;
guint construct_exact : 1;
guint visible : 1; /* Local copy of widget visibility, we need to keep track of this
* since the objects copy may be invalid due to a rebuild.
*/
guint anarchist : 1; /* Some composite widgets have internal children
* that are not part of the same hierarchy; hence 'anarchists',
* typicly a popup window or its child (we need to mark
* them so we can avoid bookkeeping packing props on them etc.).
*/
guint in_project : 1; /* Whether the widget is currently actually in the project */
};
struct _GladeWidgetClass
{
GObjectClass parent_class;
GInitiallyUnownedClass parent_class;
void (*add_child) (GladeWidget *, GladeWidget *, gboolean);
void (*remove_child) (GladeWidget *, GladeWidget *);
@ -273,6 +276,10 @@ GladeEditorProperty *glade_widget_create_editor_property (GladeWidget *w
gboolean use_command);
gchar *glade_widget_generate_path_name (GladeWidget *widget);
gboolean glade_widget_is_ancestor (GladeWidget *widget,
GladeWidget *ancestor);
/*******************************************************************************
Project, object property references
*******************************************************************************/
@ -394,9 +401,6 @@ void glade_widget_set_internal (GladeWidget *widget,
const gchar *internal);
G_CONST_RETURN gchar *glade_widget_get_internal (GladeWidget *widget);
void glade_widget_set_object (GladeWidget *gwidget,
GObject *new_object);
GObject *glade_widget_get_object (GladeWidget *widget);

View File

@ -121,9 +121,15 @@ glade_xml_get_content (GladeXmlNode *node_in)
void
glade_xml_set_content (GladeXmlNode *node_in, const gchar *content)
{
xmlNodePtr node = (xmlNodePtr) node_in;
xmlNodePtr node = (xmlNodePtr) node_in;
xmlChar *content_encoded;
xmlNodeSetContent(node, BAD_CAST(content));
g_return_if_fail (node != NULL);
g_return_if_fail (node->doc != NULL);
content_encoded = xmlEncodeSpecialChars (node->doc, BAD_CAST (content));
xmlNodeSetContent (node, BAD_CAST (content_encoded));
xmlFree (content_encoded);
}
/*

View File

@ -37,7 +37,6 @@
#include <gladeui/glade-editor-property.h>
#include <gladeui/glade-palette.h>
#include <gladeui/glade-clipboard.h>
#include <gladeui/glade-clipboard-view.h>
#include <gladeui/glade-inspector.h>
#include <gladeui/glade-placeholder.h>
#include <gladeui/glade-utils.h>

View File

@ -2,7 +2,7 @@
include $(top_srcdir)/gnome-doc-utils.make
dist-hook: doc-dist-hook
DOC_MODULE = glade
DOC_MODULE = glade3
DOC_INCLUDES = legal.xml
DOC_FIGURES = figures/main-window.png

View File

@ -45,9 +45,11 @@ AC_MSG_CHECKING(for headers required to compile python extensions)
dnl deduce PYTHON_INCLUDES
py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
if test "x$PYTHON_INCLUDES" == x; then
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
if test "$py_prefix" != "$py_exec_prefix"; then
PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
fi
fi
AC_SUBST(PYTHON_INCLUDES)
dnl check if the headers exist:

View File

@ -2,6 +2,10 @@
SUBDIRS = gtk+
if BUILD_GNOME
SUBDIRS += gnome
endif
if BUILD_PYTHON
SUBDIRS += python
endif

47
plugins/gnome/Makefile.am Normal file
View File

@ -0,0 +1,47 @@
## 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 = \
-DG_LOG_DOMAIN=\"GladeUI-GNOME\" \
-I$(top_srcdir) \
-I$(top_builddir) \
-I$(top_srcdir)/plugins/gtk+ \
$(GNOME_CFLAGS) \
$(PLUGINS_WARN_CFLAGS) \
$(AM_CPPFLAGS)
libgladegnome_la_CFLAGS = \
$(AM_CFLAGS)
libgladegnome_la_LDFLAGS = -module -avoid-version $(GNOME_LIBS) $(AM_LDFLAGS)
libgladegnome_la_LIBADD = $(libgladeui) $(GLADE_LIBS)
if PLATFORM_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)

View File

@ -0,0 +1,56 @@
<glade-catalog name="bonobo"
library="gladegnome"
supports="libglade"
depends="gnome"
domain="glade3">
<glade-widget-classes>
<glade-widget-class name="BonoboDock" generic-name="dock" 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="dockitem" title="Bonobo Dock Item"/>
</glade-widget-classes>
</glade-catalog>

View File

@ -0,0 +1,88 @@
<glade-catalog name="canvas"
icon-prefix="gnome"
library="gladegnome"
supports="libglade"
depends="gnome"
domain="glade3">
<glade-widget-classes>
<glade-widget-class name="GnomeCanvas" generic-name="canvas" _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="iconlist" _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">
<parameter-spec>
<type>GParamEnum</type>
<value-type>GnomeIconListMode</value-type>
</parameter-spec>
<_tooltip>The selection mode</_tooltip>
<displayable-values>
<value id="GNOME_ICON_LIST_ICONS" _name="List Icons"/>
<value id="GNOME_ICON_LIST_TEXT_BELOW" _name="Text Below"/>
<value id="GNOME_ICON_LIST_TEXT_RIGHT" _name="Text Right"/>
</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>

1736
plugins/gnome/glade-gnome.c Normal file

File diff suppressed because it is too large Load Diff

384
plugins/gnome/gnome.xml.in Normal file
View File

@ -0,0 +1,384 @@
<glade-catalog name="gnome"
library="gladegnome"
supports="libglade"
depends="gtk+"
domain="glade3"
book="libgnomeui">
<init-function>glade_gnomeui_init</init-function>
<glade-widget-classes>
<glade-widget-class name="GnomeApp" generic-name="app" _title="GNOME App" default-width="440" default-height="250">
<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>
</property>
</packing-properties>
</glade-widget-class>
<glade-widget-class name="GnomeDruid" generic-name="druid" _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="druidpageedge" _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="druidpagestandard" _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="iconselection" _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="iconentry" _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="href" _title="GNOME HRef"/>
<glade-widget-class name="GnomeDateEdit" generic-name="dateedit" _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"/>
<value id="GNOME_DATE_EDIT_DISPLAY_SECONDS" _name="Display Seconds"/>
</displayable-values>
</property>
</properties>
</glade-widget-class>
<glade-widget-class name="GnomeAppBar" generic-name="appbar" _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="dialog" _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="about" _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="messagebox" _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="propertybox" _title="GNOME Property Box"/>
<glade-widget-class name="GnomeEntry" generic-name="entry" 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="fileentry" _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"/>
</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="pixmapentry" _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="colorpicker" _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="fontpicker" _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="pixmap" _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>

View File

@ -0,0 +1,30 @@
## Process this file with automake to produce Makefile.in
iconsdir = $(pkgdatadir)/pixmaps/hicolor/16x16/actions
icons_DATA = \
widget-gnome-about.png \
widget-gnome-app.png \
widget-gnome-appbar.png \
widget-bonobo-dock.png \
widget-bonobo-dockitem.png \
widget-gnome-canvas.png \
widget-gnome-colorpicker.png \
widget-gnome-dateedit.png \
widget-gnome-dialog.png \
widget-gnome-druid.png \
widget-gnome-druidpageedge.png \
widget-gnome-druidpagestandard.png \
widget-gnome-entry.png \
widget-gnome-fileentry.png \
widget-gnome-fontpicker.png \
widget-gnome-href.png \
widget-gnome-iconentry.png \
widget-gnome-iconlist.png \
widget-gnome-iconselection.png \
widget-gnome-messagebox.png \
widget-gnome-pixmap.png \
widget-gnome-pixmapentry.png \
widget-gnome-propertybox.png
EXTRA_DIST = $(icons_DATA)

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

View File

@ -0,0 +1,31 @@
## Process this file with automake to produce Makefile.in
iconsdir = $(pkgdatadir)/pixmaps/hicolor/22x22/actions
icons_DATA = \
widget-gnome-about.png \
widget-gnome-app.png \
widget-gnome-appbar.png \
widget-bonobo-dock.png \
widget-bonobo-dockitem.png \
widget-gnome-canvas.png \
widget-gnome-colorpicker.png \
widget-gnome-dateedit.png \
widget-gnome-dialog.png \
widget-gnome-druid.png \
widget-gnome-druidpageedge.png \
widget-gnome-druidpagestandard.png \
widget-gnome-entry.png \
widget-gnome-fileentry.png \
widget-gnome-fontpicker.png \
widget-gnome-href.png \
widget-gnome-iconentry.png \
widget-gnome-iconlist.png \
widget-gnome-iconselection.png \
widget-gnome-messagebox.png \
widget-gnome-pixmap.png \
widget-gnome-pixmapentry.png \
widget-gnome-propertybox.png
EXTRA_DIST = $(icons_DATA)

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

View File

@ -0,0 +1,3 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = 16x16 22x22

Some files were not shown because too many files have changed in this diff Show More