Commit Graph

139 Commits

Author SHA1 Message Date
Martin Nordholts deb07e812d app: Introduce gimp_dialog_factory_set_put_in_dockables()
Change gimp_dialog_factory_set_constructor() to
gimp_dialog_factory_set_put_in_dockables() order to narrow the
interface a bit. We can make both
gimp_dialog_factory_set_put_in_dockables() and the
GimpDialogConstructor typedef internal this way.

The main reason we do this is because we want to get rid of a
dependency on factory->p->new_dock_func. Eventually we want to
construct docks just like we construct other widgets in the factory,
so new_dock_func will be removed.

Also improve readability of code such as making it explicit that
gimp_dialog_factory_put_in_dockable_constructor() is just an extended
version of gimp_dialog_factory_default_constructor().
2010-01-16 17:54:56 +01:00
Martin Nordholts be653a7110 app: Seal GimpDockable and add necessary getters and setters 2010-01-05 00:32:35 +01:00
Martin Nordholts 90d7ffde1a app: Make all GimpDialogFactory members private
Add necessary trivial API that allows us to make remaining
GimpDialogFactory instance members private, and make them private.
2009-12-20 20:21:26 +01:00
Martin Nordholts b8fe7278c8 app: Add GimpDialogFactoryPrivate
Add and use GimpDialogFactoryPrivate for the members that are not used
by clients. Remove initialiation in _init() for member put in the
private struct, the struct is zeroed for us.
2009-12-20 12:30:59 +01:00
Martin Nordholts 1ed1f5e31d app: Format static function prototypes in widgets/gimpdialogfactory.c 2009-12-20 12:28:12 +01:00
Martin Nordholts 2b7f8f7a7e app: Inline gimp_dialog_factory_show_toolbox()
Merge gimp_dialog_factory_show_toolbox() into the only caller
windows_show_toolbox() to get rid of one non-generic GimpDialogFactory
function.
2009-12-19 09:23:47 +01:00
Martin Nordholts c08c6e21e0 app: Add gimp_dialog_factory_dock_new() 2009-12-01 22:18:04 +01:00
Martin Nordholts 95bab5da5f app: gimp_dialog_factory_dock_new() -> _dock_with_window_new() 2009-12-01 21:42:24 +01:00
Martin Nordholts e81c4f44de app: Allow more than one dock inside a dock window
Put a GimpDockColumns inside GimpDockWindow so that there can be more
than one dock inside a dock window. For now,
gimp_dock_window_get_dock() returns the first dock. Eventually need to
return all docks and refactor the other code as needed.
2009-10-25 13:10:08 +01:00
Martin Nordholts ff6a787757 app: Add gimp_dialog_factory_dock_window_new()
Add gimp_dialog_factory_dock_window_new() since we need to be able to
create only dock windows when going from single-window mode back to
multi-window.
2009-10-25 12:24:54 +01:00
Michael Natterer 1a23b9ecf2 Build with GSEAL_ENABLE and #undef it where accessors are missing 2009-10-17 20:20:39 +02:00
Martin Nordholts 4acbda8b35 app: Add more verbose "dialog-factory" debug output 2009-10-04 02:10:11 +02:00
Martin Nordholts 4f7693acf0 app: Make GimpDock a GtkVBox
Make GimpDock be a GtkVBox instead of a GimpDockWindow. This means we
can now put a GimpDock anywhere, including inside an image window.

In order to do this we need to:

 * Separate dock and dock window creation in the dialog factory and
   add a couple of new dock window constructors

 * Change gimp_dialog_factory_dock_new() to not only create a dock,
   but also create a dock window and then combine those two

 * Change the dock constructor to take a GimpUIManager since they
   depend on that during their construction. We get the ui manager
   from the dock window, but we can't create the dock *inside* the
   dock window, we have to add the dock later. So we create the dock
   window first and then pass its ui manager to the dock constructors

 * Make some other minor adaptions, mostly with
   gimp_dock_window_from_dock() and gimp_dock_window_get_dock()
2009-09-26 16:21:10 +02:00
Martin Nordholts acc8765e0a app: Update a few GimpDock related comments 2009-09-26 14:38:33 +02:00
Martin Nordholts c9d8aafb68 app: Change a few GIMP_IS_DOCK to GIMP_IS_DOCK_WINDOW
In many places we are interested in wether or not we have a dock
window, not a dock. This is in preparation for making GimpDock a
non-GimpDockWindow.
2009-09-26 14:26:49 +02:00
Martin Nordholts 62dde84e43 app: Change GimpDialogFactory signals to "dock-window-added/removed"
Change the GimpDialogFactory signals "dock-added" and "dock-removed"
to "dock-window-added" and "dock-window-removed". Doing this makes
sense for a couple of reasons. First of all, the dialog factory is
built around top-levels. Second of all, the listeners to the signals
(such as the "recently closed docks" construct) work on a
gtk-window-level, not a dock level.

This change is a preparation for when GimpDock will stop being a
GimpDockWindow.
2009-09-26 13:11:42 +02:00
Martin Nordholts ae39604a64 app: Add more dialog-factory debug output 2009-09-20 19:30:10 +02:00
Martin Nordholts 8bfcd14f9a app: Add GimpSessionInfo getters and setters 2009-09-20 14:51:03 +02:00
Martin Nordholts 7cac9dff67 app: gimp_session_info_set/get_geometry -> apply/read_geometry()
Rename gimp_session_info_set_geometry() to
gimp_session_info_apply_geometry() and gimp_session_info_get_geometry
to gimp_session_info_read_geometry(). The old functions were not
getters and setters and thus the names were misleading.
2009-09-20 13:17:27 +02:00
Martin Nordholts 4ab58d2e77 app: Have only one GimpDialogFactoryEntry member in GimpSessionInfo
Simplify the code a bit by replacing the 'toplevel_entry' and
'dockable_entry' members in GimpSessionInfo with a single
'factory_entry'. We compensate for this by adding a 'dockable'
gboolean to GimpDialogFactoryEntry.
2009-09-20 12:24:41 +02:00
Martin Nordholts 44d5728d7b app: Add and use factory entry related getters for GimpSessionInfo
Add GimpSessionInfo getters for a bunch of dialog factory entry
fields. This moves much of the GimpDock special casing to a common
place and also reduces direct access to session info fields.
2009-09-20 11:43:41 +02:00
Martin Nordholts 8d86735f20 app: Increase scope of 'info' in gimp_dialog_factory_add_dialog()
Increase scope of 'info' in gimp_dialog_factory_add_dialog() so we can
use it at the end of the function.
2009-09-20 11:33:22 +02:00
Martin Nordholts 09b04c62c9 app: Introduce and use gimp_dialog_factory_dialog_sane()
Collect common error checking in a new helper function
gimp_dialog_factory_dialog_sane().
2009-09-20 10:25:13 +02:00
Michael Natterer 2c43da09e0 Random doc fixes 2009-09-14 21:39:46 +02:00
Martin Nordholts 2ac7cedbfc app: Make GimpDockbook instance data private
Make GimpDockbook instance data private and add necessary getters and
setters.
2009-09-13 16:30:09 +02:00
Michael Natterer a3558e3cb8 Remove GIMP_OBJECT() casts when calling gimp_object_get_name() 2009-08-31 22:47:18 +02:00
Martin Nordholts 957cf2cfa9 app: Always use gimp_object_get_name()
Begin to consider GimpObject::name as private and always use
gimp_object_get_name(). Change gimp_object_get_name() to take an
untyped pointer so we don't have to do so awfully many casts. There is
a runtime check for the type inside the function anyway.
2009-08-29 12:41:29 +02:00
Martin Nordholts cfbcdbd207 app: Add WM debug output 2009-07-20 13:16:30 +02:00
Martin Nordholts b2b2b41e62 Get rid of artificial compiler warnings
Get rid of artificial compiler warnings generated with the #warning
directive. They pollute the build output and don't work as incentives
for fixing stuff.
2009-07-20 12:47:59 +02:00
Michael Natterer d9448730f9 Bug 555025 – Action GEGL box widgets weirdness
2009-03-28  Michael Natterer  <mitch@gimp.org>

	Bug 555025 – Action GEGL box widgets weirdness

	Must not set GDK_HINT_MIN_SIZE if we don't actually set a minimum
	size, or the window will be shrinkable to zero and it won't
	expand automatically when its contents' requisition grows.

	* app/widgets/gimpdialogfactory.[ch]: add hackish API
	gimp_dialog_factory_set,get_has_min_size() because GTK+ itself
	has no API for querying a window's GdkWindowHints.

	(gimp_dialog_factory_set_user_pos): set GDK_HINT_MIN_SIZE only if
	the window was being marked as having a minimum size using above
	new API.

	* app/widgets/gimptoolbox.c (gimp_toolbox_set_geometry)
	* app/display/gimpdisplayshell.c (gimp_display_shell_style_set):
	call gimp_dialog_factory_set_has_min_size (window, TRUE).


svn path=/trunk/; revision=28224
2009-03-28 13:19:53 +00:00
Michael Natterer d85fb156b5 app/widgets/gimpblobeditor.c app/widgets/gimpbrushselect.c
2009-03-22  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpblobeditor.c
	* app/widgets/gimpbrushselect.c
	* app/widgets/gimpcolorbar.c
	* app/widgets/gimpcolordialog.c
	* app/widgets/gimpcolorframe.c
	* app/widgets/gimpcontainergridview.c
	* app/widgets/gimpcontainerpopup.c
	* app/widgets/gimpcontainertreeview.c
	* app/widgets/gimpcontrollereditor.c
	* app/widgets/gimpcontrollerlist.c
	* app/widgets/gimpcursor.c
	* app/widgets/gimpcurveview.c
	* app/widgets/gimpdasheditor.c
	* app/widgets/gimpdialogfactory.c
	* app/widgets/gimpdnd-xds.c
	* app/widgets/gimpdockable.c
	* app/widgets/gimperrordialog.c
	* app/widgets/gimpfgbgeditor.c
	* app/widgets/gimpfgbgview.c
	* app/widgets/gimpfiledialog.c
	* app/widgets/gimpfontselect.c
	* app/widgets/gimpgradienteditor.c
	* app/widgets/gimpgradientselect.c
	* app/widgets/gimphandlebar.c
	* app/widgets/gimphistogrambox.c
	* app/widgets/gimphistogramview.c
	* app/widgets/gimpmessagedialog.c
	* app/widgets/gimpnavigationview.c
	* app/widgets/gimppaletteselect.c
	* app/widgets/gimppaletteview.c
	* app/widgets/gimppatternselect.c
	* app/widgets/gimpprogressbox.c
	* app/widgets/gimpprogressdialog.c
	* app/widgets/gimpscalebutton.c
	* app/widgets/gimpselectiondata.c
	* app/widgets/gimpsessioninfo.c
	* app/widgets/gimpsettingsbox.c
	* app/widgets/gimpstrokeeditor.c
	* app/widgets/gimptexteditor.c
	* app/widgets/gimptoolbox.c
	* app/widgets/gimpuimanager.c
	* app/widgets/gimpview-popup.c
	* app/widgets/gimpview.c
	* app/widgets/gimpviewabledialog.c
	* app/widgets/gimpwidgets-utils.c: use accessors for various
	members of GTK+ structures that don't exist any longer when
	GSEAL_ENABLE is defined.


svn path=/trunk/; revision=28193
2009-03-22 16:35:53 +00:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Martin Nordholts 7c96452329 Make instance members private.
* app/widgets/gimpdock.[ch]: Make instance members private.

(gimp_dock_get_context)
(gimp_dock_get_dialog_factory)
(gimp_dock_get_dockbooks)
(gimp_dock_get_main_vbox)
(gimp_dock_get_vbox)
(gimp_dock_get_id): New getters.

* app/actions/actions.c
* app/actions/dockable-actions.c
* app/actions/dockable-commands.c
* app/actions/windows-actions.c
* app/menus/windows-menu.c
* app/widgets/gimpdialogfactory.c
* app/widgets/gimpdock.c
* app/widgets/gimpdock.h
* app/widgets/gimpdockable.c
* app/widgets/gimpdockbook.c
* app/widgets/gimpdockseparator.c
* app/widgets/gimpimagedock.c
* app/widgets/gimpmenudock.c
* app/widgets/gimpsessioninfo-book.c
* app/widgets/gimpsessioninfo-dock.c
* app/widgets/gimpsessioninfo-dockable.c
* app/widgets/gimptoolbox-color-area.c
* app/widgets/gimptoolbox-dnd.c
* app/widgets/gimptoolbox-image-area.c
* app/widgets/gimptoolbox-indicator-area.c
* app/widgets/gimptoolbox.c: Use new getters.

svn path=/trunk/; revision=27881
2009-01-04 10:28:31 +00:00
Sven Neumann 4260576f0e to be on the safe side, always show hidden dialogs when the Tab key is
2008-10-24  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpdialogfactory.c 
(gimp_dialog_factories_toggle):
	to be on the safe side, always show hidden dialogs when the Tab
	key is used. It should not be possible to get a Tab key-press
	while all displays are iconified, but you never know ...


svn path=/trunk/; revision=27385
2008-10-24 07:16:06 +00:00
Sven Neumann bf97ad3102 Bug 556896 – Dialogs don't get minimized with single image window
2008-10-24  Sven Neumann  <sven@gimp.org>

	Bug 556896 – Dialogs don't get minimized with single image 
window

	* app/widgets/gimpdialogfactory.[ch]: renamed the new methods to
	gimp_dialog_factories_{show|hide}_with_display().
	Remember if the dialogs were hidden using
	gimp_dialog_factories_hide_with_display() or using
	gimp_dialog_factories_toggle() and keep this into account when
	making them visible again. This ensures that dialogs that were
	hidden using the Tab key won't be shown when the image window is
	uniconified.

	* app/display/gimpdisplayshell.c
	(gimp_display_shell_window_state_event): changed accordingly.


svn path=/trunk/; revision=27384
2008-10-24 06:48:56 +00:00
Sven Neumann 45b41a76d1 Bug 556896 – Dialogs don't get minimized with single image window
2008-10-23  Sven Neumann  <sven@gimp.org>

	Bug 556896 – Dialogs don't get minimized with single image 
window

	* app/display/gimpdisplay-foreach.[ch]: added utility function 
to
	get the number of visible (not withdrawn or iconified) displays.

	* app/widgets/gimpdialogfactory.[ch]: added functions to hide 
and
	show the dock windows. Changed gimp_dialog_factories_toggle() to
	use the new functions.

	* app/display/gimpdisplayshell.c
	(gimp_display_shell_window_state_event): hide the docks if the
	last display is iconified. Unhide them if a display is
	uniconified. Probably needs more work ...


svn path=/trunk/; revision=27374
2008-10-23 08:39:46 +00:00
Sven Neumann ce4c2c3bfc let new docks appear at the pointer position.
2008-10-14  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpdialogfactory.c 
(gimp_dialog_factory_add_dialog):
	let new docks appear at the pointer position.


svn path=/trunk/; revision=27282
2008-10-14 21:39:14 +00:00
Martin Nordholts 958de4c297 Bug 554125 – Tab key doesn't hide utility windows when there is no
image open.
	
* app/widgets/gimpdialogfactory.[ch]: Add 'toggle_visibility' to
GimpDialogFactory and as a parameter to gimp_dialog_factory_new(),
and set it there.

(gimp_dialog_factories_hide_foreach): Don't hide dialogs belonging
to factories with toggle_visibility FALSE.

* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_tool_events): Move no-image event
handling to a new helper function, and make pressing Tab hide
windows.

* app/dialogs/dialogs.c (dialogs_init): Allow toggling visibility
for all factories except the display-factory.

svn path=/trunk/; revision=27077
2008-09-29 15:42:56 +00:00
Michael Natterer a4ff76a5ac remove some casts that were always useless and are even more useless now
2008-09-29  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpdialogfactory.c
	(gimp_dialog_factories_show_foreach)
	(gimp_dialog_factories_hide_foreach): remove some casts that were
	always useless and are even more useless now after the recent
	readability improvement.


svn path=/trunk/; revision=27075
2008-09-29 11:08:42 +00:00
Martin Nordholts 6e876e8f7c Increase readability with widget = list->data.
* app/widgets/gimpdialogfactory.c
(gimp_dialog_factories_show_foreach)
(gimp_dialog_factories_hide_foreach): Increase readability with
widget = list->data.

svn path=/trunk/; revision=27068
2008-09-28 07:46:48 +00:00
Michael Natterer ff5310a4ea Implement the presistent menu of recently closed docks, still somewhat
2008-05-16  Michael Natterer  <mitch@gimp.org>

	Implement the presistent menu of recently closed docks, still
	somewhat hackish but fully functional. Fixes bug #132744.

	* app/actions/dialogs-actions.c
	* app/actions/dialogs-commands.[ch]
	* menus/image-menu.xml.in: remove the menu items that were
	creating the hardcoded preconfigured docks.

	* app/dialogs/dialogs.[ch]: add GimpContainer of recently closed
	docks and API to load and save it.

	* app/gui/session.c: call the recent dock load and save functions.

	* app/widgets/gimpsessioninfo.[ch]: implement the GimpConfig interface
	and (de)serialize via proper interface methods.

	* app/gui/session.c
	* app/widgets/gimpdialogfactory.c: use the GimpConfig API
	to (de)serialize session infos and added the code that was
	formerly in the info's (de)serialize functions but didn't belong
	there.

	* app/widgets/gimpaction.[ch]: add "max-width-chars" property and
	set it on proxy menu item labels.

	* app/actions/windows-actions.[ch]
	* app/actions/windows-commands.[ch]
	* app/menus/windows-menu.c: add actions and menu of recently
	closed docks and code to restore the dock when the menu items are
	selected. Use above new action property to ensure a minimum
	width of the menu.

	* app/widgets/gimpmenudock.c: use '-' instead of '|' for
	separating notebooks in the window title. Menu items don't like	'|'.

	* app/widgets/gimpdock.c: removed the confirmation dialog when
	closing docks and simply add them to the recent docks container.
	This code is totally misplaced and will move to another file soon.


svn path=/trunk/; revision=25671
2008-05-16 16:06:42 +00:00
Michael Natterer 5766498fff Made session info serialization independent from widgets so it can be used
2008-05-14  Michael Natterer  <mitch@gimp.org>

	Made session info serialization independent from widgets so it can
	be used on stored dock layouts which are not open:

	* app/widgets/gimpsessioninfo-book.[ch]
	* app/widgets/gimpsessioninfo-dock.[ch]
	* app/widgets/gimpsessioninfo-dockable.[ch]: add from_widget()
	functions which return newly allocated session info structs.
	Changed serialize() functions to take these structs instead of
	widgets. Changed deserialize() functions to return the structs
	instead of appending them to lists in their parent structs. Don't
	free anything in restore().

	* app/widgets/gimpsessioninfo-aux.[ch]
	(gimp_session_info_aux_serialize): take a GList of aux_info
	instead of a widget.

	* app/widgets/gimpsessioninfo.[ch]: add new functions get_info()
	which collects above session info details from dialogs and
	clear_info() which clears that info. Call clear_info() from
	finalize(). Don't free anything in restore().

	* app/widgets/gimpdialogfactory.c
	(gimp_dialog_factories_save_foreach): collect the session info
	detials from the dialogs before serializing because serialize()
	doesn't know about the widget any longer. Clear the infos after
	serializing.

	(gimp_dialog_factories_restore_foreach): clear the session info
	details after creating the dialogs because restore() doesn't clear
	the info by itself any longer.


svn path=/trunk/; revision=25657
2008-05-13 23:43:57 +00:00
Michael Natterer 0b0d0aad78 turn into a GimpObject subclass. No logical changes yet.
2008-05-13  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpsessioninfo.[ch]: turn into a GimpObject
	subclass. No logical changes yet.

	* app/widgets/widgets-types.h
	* app/widgets/gimpdialogfactory.c: changed accordingly.


svn path=/trunk/; revision=25655
2008-05-13 21:17:11 +00:00
Michael Natterer fb904ad1cb add signals "dock-added" and "dock-removed".
2008-05-10  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpdialogfactory.[ch]: add signals "dock-added" and
	"dock-removed".

	(gimp_dialog_factory_add_dialog)
	(gimp_dialog_factory_remove_dialog): emit them when docks get
	added and removed.


svn path=/trunk/; revision=25629
2008-05-10 19:11:18 +00:00
Michael Natterer 231497046d set GDK_HINT_MIN_SIZE on dialogs which had no previous sessionrc entry.
2008-04-08  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpdialogfactory.c
	(gimp_dialog_factory_set_user_pos): set GDK_HINT_MIN_SIZE on
	dialogs which had no previous sessionrc entry. Fixes the minimum
	size of the very first empty display of a new GIMP installation
	and shouldn't have any ill effects on other windows.


svn path=/trunk/; revision=25409
2008-04-08 08:26:48 +00:00
Sven Neumann 809f4fe608 focus the image window after all docks have been created.
2008-03-25  Sven Neumann  <sven@gimp.org>

	* app/gui/gui.c (gui_restore_after_callback): focus the image
	window after all docks have been created.

	* app/widgets/gimpdock.c (gimp_dock_init): unset focus-on-map on
	all dock windows.

	* app/widgets/gimpdialogfactory.c
	(gimp_dialog_factories_show_foreach): removed the focus hacks here
	as they are not any longer needed.

svn path=/trunk/; revision=25216
2008-03-25 10:00:33 +00:00
Michael Natterer 391d78fe30 don't set the dialog's window geometry if it is already visible. Fixes
2008-03-23  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpdialogfactory.c (gimp_dialog_factory_add_dialog):
	don't set the dialog's window geometry if it is already visible.
	Fixes empty display moving and shouldn't affect anything else
	since we always want to position dialogs before they are shown.


svn path=/trunk/; revision=25184
2008-03-23 18:36:16 +00:00
Michael Natterer f9f24c59f0 cleanup (move variables to local scopes), improve debugging outout.
2008-03-23  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpdialogfactory.c: cleanup (move variables to
	local scopes), improve debugging outout.

	(gimp_dialog_factory_remove_dialog): disconnect signal handlers
	and unset any session management data which is attached to the
	widget, so this function can really be used to remove a dialog
	from the factory.


svn path=/trunk/; revision=25176
2008-03-23 13:33:19 +00:00
Michael Natterer f4621424a7 add DIALOG_FACTORY log domain.
2007-11-18  Michael Natterer  <mitch@gimp.org>

	* app/gimp-log.[ch]: add DIALOG_FACTORY log domain.

	* app/widgets/gimpdialogfactory.c: port debug output to GIMP_LOG().


svn path=/trunk/; revision=24185
2007-11-18 17:40:24 +00:00
Michael Natterer 2bf21338a3 removed more code and cleaned up the API.
2007-05-24  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpsessioninfo.[ch]: removed more code and cleaned
	up the API.

	* app/widgets/Makefile.am
	* app/widgets/gimpsessioninfodock.[ch]: added the removed code here.

	* app/widgets/gimpdialogfactory.c: changed accordingly.


svn path=/trunk/; revision=22604
2007-05-24 20:06:34 +00:00