Commit Graph

33 Commits

Author SHA1 Message Date
Michael Natterer 9f3052583b app: remove gimp_session_write_position()
and un-overengineer the session position accuracy code a bit.
2016-05-21 00:00:07 +02:00
Michael Natterer 843866e7e7 app: make things behave more reasonable with multiple monitors
There is now a preference option that determines whether windows
should be opened on the same monitor as before. It should be disabled
when the machine gets monitors plugged/unplugged dynamically ("laptop")
and enabled when there is a static multi-monitor setup ("wokstation").
This is merely the current simplistic policy on top of the newly added
underlying infrastructure:

- pass integer monitor numbers around in all places where we already
  pass around a GdkScreen. Pass the "current" monitor to these changed
  APIs, where "current" is either the monitor where the action-triggering
  widget is, or if that is unavailable the monitor where the mouse is.

- add gimp_widget_get_monitor() in order to easily get to the monitor,
  just like gtk_widget_get_screen().

- add screen and monitor parameters in some places that were missed
  before.

- in sessionrc, save all window positions relative to the window's
  monitor, and save the monitor separately, if it's not the screen's
  primary monitor.

- when restoring window positions, use the stored monitor when the new
  prefs options says so (use the screen's primary monitor if there is
  no stored monitor), otherwise use current monitor that is now passed
  around.
2014-05-02 03:01:23 +02:00
Martin Nordholts b4ed281f9a app: Call gimp_session_info_aux_set_list() generically
gimp_session_info_aux_set_list() is not a per-GimpDialogRestoreFunc
thing.
2011-05-31 23:15:38 +02:00
Martin Nordholts 93fd257c52 app: Give configure event info to gimp_session_info_read_geometry()
When we get to gimp_dialog_factory_dialog_configure() and do
gimp_session_info_read_geometry(), the window geometry has not yet
been updated, i.e. gimp_session_info_read_geometry() gives the session
info the size of the *previous* configure event.

Solve this by giving gimp_session_info_read_geometry() the configure
event so it can use that size when availble.

If we don't do this change, then we get bogus values of the size of
image window when repeatedly switching between single- and
multi-window mode.
2011-05-27 22:33:55 +02:00
Martin Nordholts 396d5fd5e8 app: Add a 'restore_func' to GimpDialogFactoryEntry
In gimp_session_info_restore() there is code to create a dialog from a
session info. GimpSessionInfo lives in the widgets module. Thus we
can't add restoration code that depends on a higher level module. In
particular, we can't add code to restore docks in an GimpImageWindow
since GimpImageWindow lives in the display module. And we need such
code to be able to restore a single-window mode session.

Since dialogs are defined in the dialogs module, it makes sense to
also have the code that restores a dialog in that module.

So, add a 'restore_func' member to GimpRestoreDialogFunc of type
GimpRestoreDialogFunc and move the code there.
2011-05-27 21:55:41 +02:00
Martin Nordholts 6d421f9d4d app: Add and use gimp_session_info_get_info_with_widget()
Add and use helper function
gimp_session_info_get_info_with_widget(). Might need it for
GimpImageWindow later...
2011-05-09 19:55:51 +02:00
Martin Nordholts 49d951d49e app: Introduce error margin in sessionrc in test cases
Introduce a few pixels of error margin in sessionrc, otherwise the
tests are too fragile, widgets have a tendency to change size a bit
and window managers have a tendency to move windows a bit.

Still needs more work, should probably do the same on book positions
too...
2010-06-19 23:55:35 +02:00
Martin Nordholts 677b977776 app: Make class documentation be picked up by gtk-doc 2009-10-10 22:01:06 +02:00
Martin Nordholts 94d95e4db2 app: Make GimpSessionInfo members private
Make GimpSessionInfo members private but put them in a shared header
file so gimpsessioninfo-dock.c can access them too.
2009-09-20 17:06:36 +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 6460385553 app: Add docs to GimpSessionInfo related classes 2009-09-20 10:26:32 +02: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
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
Sven Neumann 39377e970e themes/Default/gtkrc reduced minimum dock width to 200 pixels.
2008-03-22  Sven Neumann  <sven@gimp.org>

	* themes/Default/gtkrc
	* app/widgets/gimpmenudock.c: reduced minimum dock width to 200
	pixels.

	* etc/sessionrc: use -0 instead of -1, just like in X geometry
	strings. Changed default dock sizes to be taller but less wide.

	* app/widgets/gimpsessioninfo.c: changed code to parse -0 from 
the
	sessionrc file and to deal more correctly with negative offsets.


svn path=/trunk/; revision=25169
2008-03-22 01:10:51 +00:00
Michael Natterer 736b651d24 app/widgets/gimpsessioninfo.[ch] app/widgets/gimpsessioninfoaux.[ch]
2007-05-24  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpsessioninfo.[ch]
	* app/widgets/gimpsessioninfoaux.[ch]
	* app/widgets/gimpsessioninfobook.[ch]
	* app/widgets/gimpsessioninfodock.c
	* app/widgets/gimpsessioninfodockable.[ch]: cleanup.


svn path=/trunk/; revision=22606
2007-05-24 20:42:56 +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
Michael Natterer 616ba659f3 removed lots of code...
2007-05-24  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpsessioninfo.[ch]: removed lots of code...

	* app/widgets/Makefile.am
	* app/widgets/gimpsessioninfoaux.[ch]
	* app/widgets/gimpsessioninfobook.[ch]
	* app/widgets/gimpsessioninfodockable.[ch]: ...and added it here.
	Also allocate all structs using GSLice.

	* app/widgets/gimpcoloreditor.c
	* app/widgets/gimpcursorview.c
	* app/widgets/gimpdataeditor.c
	* app/widgets/gimpdialogfactory.c
	* app/widgets/gimpdocked.c
	* app/widgets/gimphistogrameditor.c
	* app/widgets/gimpmenudock.c
	* app/widgets/gimppaletteeditor.c: changed accordingly.


svn path=/trunk/; revision=22603
2007-05-24 19:22:06 +00:00
Sven Neumann 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +00:00
Michael Natterer 5236dc6f13 app/actions/dockable-actions.c app/actions/dockable-commands.[ch]
2006-01-17  Michael Natterer  <mitch@gimp.org>

	* app/actions/dockable-actions.c
	* app/actions/dockable-commands.[ch]
	* app/dialogs/dialogs-constructors.[ch]
	* app/dialogs/dialogs.c
	* app/display/gimpdisplayshell-layer-select.c
	* app/widgets/gimpbrusheditor.[ch]
	* app/widgets/gimpbrushfactoryview.h
	* app/widgets/gimpbufferview.[ch]
	* app/widgets/gimpchanneltreeview.c
	* app/widgets/gimpcomponenteditor.[ch]
	* app/widgets/gimpcontainerbox.c
	* app/widgets/gimpcontainercombobox.[ch]
	* app/widgets/gimpcontainereditor.[ch]
	* app/widgets/gimpcontainerentry.[ch]
	* app/widgets/gimpcontainergridview.[ch]
	* app/widgets/gimpcontainerpopup.[ch]
	* app/widgets/gimpcontainertreeview.[ch]
	* app/widgets/gimpcontainerview.[ch]
	* app/widgets/gimpdatafactoryview.[ch]
	* app/widgets/gimpdevicestatus.c
	* app/widgets/gimpdialogfactory.[ch]
	* app/widgets/gimpdocumentview.[ch]
	* app/widgets/gimpfontview.[ch]
	* app/widgets/gimpgradienteditor.[ch]
	* app/widgets/gimpimageview.[ch]
	* app/widgets/gimpitemtreeview.[ch]
	* app/widgets/gimplayertreeview.c
	* app/widgets/gimpmenudock.c
	* app/widgets/gimppatternfactoryview.[ch]
	* app/widgets/gimppropwidgets.[ch]
	* app/widgets/gimpselectioneditor.[ch]
	* app/widgets/gimpsessioninfo.[ch]
	* app/widgets/gimptemplateview.[ch]
	* app/widgets/gimptooloptionseditor.c
	* app/widgets/gimptoolview.[ch]
	* app/widgets/gimpundoeditor.[ch]
	* app/widgets/gimpviewablebox.c
	* app/widgets/gimpviewablebutton.[ch]
	* app/widgets/gimpviewabledialog.[ch]
	* app/widgets/gimpviewrenderer.c: change the word "preview" to
	"view" whereever we talk about GimpView or GimpViewRenderer
	objects or their sizes. Ther were renamed from "Preview" a long
	time ago and we had a preview/view naming mess ever since.
2006-01-17 10:08:50 +00:00
Sven Neumann 489aebab5e app/core/gimp-gui.h app/core/gimp-utils.h app/core/gimpimage-undo.h
2005-09-27  Sven Neumann  <sven@gimp.org>

	* app/core/gimp-gui.h
	* app/core/gimp-utils.h
	* app/core/gimpimage-undo.h
	* app/text/gimptextlayer.h
	* app/widgets/gimpeditor.h
	* app/widgets/gimpmenufactory.h
	* app/widgets/gimpmessagedialog.h
	* app/widgets/gimpsessioninfo.h
	* app/widgets/gimptooldialog.h
	* app/widgets/gimpviewabledialog.h: use G_GNUC_NULL_TERMINATED
	where appropriate.
2005-09-27 17:31:32 +00:00
Michael Natterer 3592a58d96 new file holding the opaque typedefs for libgimpconfig. Includes
2005-01-25  Michael Natterer  <mitch@gimp.org>

	* libgimpconfig/gimpconfigtypes.h: new file holding the opaque
	typedefs for libgimpconfig. Includes "libgimpbase/gimpbasetypes.h"

	* libgimpconfig/Makefile.am: added the new file. Removed stuff
	that is not needed.

	* libgimpconfig/gimpconfigwriter.h
	* libgimpconfig/gimpconfig-iface.h: removed typedefs here.

	* libgimpconfig/gimpconfig-deserialize.c
	* libgimpconfig/gimpconfig-iface.c
	* libgimpconfig/gimpconfig-serialize.c
	* libgimpconfig/gimpconfig-utils.c
	* libgimpconfig/gimpconfig.h
	* libgimpconfig/gimpconfigwriter.c: include it before including
	any other libgimpconfig stuff.

	* app/config/config-types.h: #include "libgimpbase/gimpbasetypes.h"

	* app/config/gimpconfig-utils.h: changed include guards to
	__APP_GIMP_CONFIG_UTILS_H__.

	* app/dialogs/tips-parser.c: include <glib-object.h> instead of
	just <glib.h>.

	* app/tools/gimphistogramoptions.c
	* app/tools/gimptextoptions.c: include "config/gimpconfig-utils.h"

	* app/widgets/gimpdialogfactory.h
	* app/widgets/gimpsessioninfo.h: removed inclusion of
	"libgimpbase/gimpbasetypes.h".
2005-01-25 20:30:20 +00:00
William Skaggs 1cee9b7298 continuing commit after broken pipe 2005-01-25 19:11:26 +00:00
Sven Neumann a4ac4de072 app/config/gimpconfig-deserialize.c removed redundant casts.
2004-07-08  Sven Neumann  <sven@gimp.org>

	* app/config/gimpconfig-deserialize.c
	* app/config/gimpconfig-serialize.c: removed redundant casts.

	* app/widgets/gimpsessioninfo.[ch]: added convenience functions to
	get and set aux-info based on object properties.

	* app/widgets/gimphistogrameditor.c: use the new functions to save
	a histogram's channel and scale in the sessionrc.
2004-07-08 00:09:41 +00:00
Michael Natterer 47f5d86688 Made session management multiscreen aware:
2003-11-13  Michael Natterer  <mitch@gimp.org>

	Made session management multiscreen aware:

	* app/widgets/gimpsessioninfo.[ch]: added "gint screen" member
	to struct GimpSessionInfo.

	(gimp_session_info_get_geometry): ask the window for its screen.
	(gimp_session_info_restore): place the window on the remembered
	screen if the screen exists.

	(gimp_session_info_save)
	(gimp_session_info_deserialize): extended "open-on-exit" property
	to include the screen number (e.g. "(open-on-exit 1)" for screen 1).

	This change breaks everybody's sessionrc again...
2003-11-13 15:50:23 +00:00
Michael Natterer 2b0c05131f renamed gimp_dialog_factories_idle() and _unidle() to
2003-10-13  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpdialogfactory.[ch]: renamed
	gimp_dialog_factories_idle() and _unidle() to
	gimp_dialog_factories_set_busy() and _unset_busy().
	Added utility function gimp_dialog_factory_set_widget_data() and
	public API gimp_dialog_factory_from_widget() so we don't need to
	g_object_[set|get]_data() with magic keys all over the place.

	* app/widgets/gimpsessioninfo.c
	* app/gui/dialogs-commands.c
	* app/gui/dialogs-menu.c
	* app/gui/gui-vtable.c: changed accordingly.

	* app/widgets/gimpsessioninfo.c: remember active page of all dock
	notebooks in sessionrc.

	* app/widgets/gimpsessioninfo.h: cleaned up the session info structs.
2003-10-13 11:57:50 +00:00
Michael Natterer 158aa7f2b3 added utility function gimp_session_info_aux_new().
2003-10-11  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpsessioninfo.[ch]: added utility function
	gimp_session_info_aux_new().

	* app/widgets/gimpcoloreditor.c
	* app/widgets/gimpdataeditor.c
	* app/widgets/gimpimagedock.c (get_aux_info): use it.
2003-10-11 17:05:48 +00:00
Michael Natterer b136228de9 app/widgets/widgets-types.h added new struct GimpSessionInfoAux which
2003-10-11  Michael Natterer  <mitch@gimp.org>

	* app/widgets/widgets-types.h
	* app/widgets/gimpsessioninfo.[ch]: added new struct
	GimpSessionInfoAux which contains "gchar *name" and "gchar *value".
	Changed sessionrc "aux-info" format again to be really extendable
	this time. Also breaks everybody's sessionrc again.

	* app/widgets/gimpimagedock.c
	* etc/sessionrc: changed accordingly.

	Implemented the stuff suggested in bug #122964. Fixes bug #122964
	and bug #52206:

	* app/widgets/gimpdataeditor.[ch]: replaced the "Gimp" member by a
	"GimpDataFactory" and changed gimp_data_editor_construct()
	accordingly. Implement GimpDockedInterface::set_aux_info() and
	get_aux_info() and remember the currently edited data across
	sessions.

	* app/gui/gradient-editor-commands.c
	* app/gui/gradient-editor-menu.c
	* app/widgets/gimpbrusheditor.c
	* app/widgets/gimpgradienteditor.c
	* app/widgets/gimppaletteeditor.c: changed accordingly.

	* app/widgets/gimpcoloreditor.c: remember the active color
	selector across sessions.
2003-10-11 16:50:35 +00:00
Michael Natterer 87480880c3 Cleaned up session management and changed the format of sessionrc in a way
2003-10-10  Michael Natterer  <mitch@gimp.org>

	Cleaned up session management and changed the format of sessionrc
	in a way that allows extensions without changing the format during
	the 2.0 cycle:

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpsessioninfo.[ch]: new files implementing the whole
	GimpSessionInfo stuff (parsing, saving, restoring, utility functions).
	Save / parse the position of GimpDock's panes (bug #122964).

	* app/widgets/gimpdialogfactory.[ch]: removed saving, restoring
	and session related utility functions and use the ones from
	the new files above.

	* app/gui/session.c: removed parsing and use the new stuff.

	* app/widgets/gimpdock.[ch]: added new virtual functions
	GimpDock::set_aux_info() and GimpDock::get_aux_info():

	* app/widgets/gimpimagedock.c: implement them and handle the
	"auto_follow_active" and "show_image_menu" properties.

	* app/widgets/gimpdockable.[ch]: added the same virtual functions
	to the GimpDockable class. Enables forward-compatible per-dockable
	session management (bug #122964).

	* app/gui/dialogs-commands.c
	* app/gui/gui.c: changed accordingly.

	* etc/sessionrc: ditto. Look at this file and update your own
	sessionrc manually if you don't want to lose it.
2003-10-10 15:59:12 +00:00