Commit graph

3978 commits

Author SHA1 Message Date
Michael Natterer 86e09e03d6 app: make sure GimpToolPresetEditor is in a sane state initially
even if an object got set on it at construction time.
2011-06-06 22:38:51 +02:00
Alexia Death 6b3c398f09 app: prevent segfault on startup when in swm and preset editor is active 2011-06-05 15:12:57 +03:00
Michael Natterer ea27c7bc83 app: add the MIN4() and MAX4() macros to gimp-utils.h
instead of having them in 5 .c files.
2011-06-04 17:16:21 +02:00
Michael Natterer 1bff2c8df2 app: sprinkle const qualifiers in the tool event callback functions 2011-05-31 23:18:11 +02:00
Martin Nordholts bed298be13 app: Remember column width in multi-column dock windows 2011-05-31 23:15:39 +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 6fc587c643 app: Add GimpSessionManaged
Add a GimpSessionManaged interface to generalize
gimp_session_info_aux_get_list() and gimp_session_info_aux_set_list().
2011-05-31 23:15:14 +02:00
Michael Natterer edad544e73 app: don't redundantly check for (foo && GIMP_IS_FOO (foo)) in GimpSessionInfo 2011-05-30 23:39:39 +02:00
Martin Nordholts 10aa3921a0 app: Rememeber if image windows are opened
Rememeber if image windows are opened because we want the
gimp_session_info_restore() code to run for the single-image window
once that code is in place.
2011-05-28 16:18:34 +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
Massimo Valentini 71bedb0ccd app: clear current path from the context after copying it
otherwise the first time it is drawn twice.
2011-05-26 20:17:21 +02:00
Martin Nordholts 2d5ffd4f2e app: Add the concept of 'side' of a dock
Add GimpDockContainer::get_dock_side() and write that info in the
sessionrc file. In single-window mode, a dock can be either on the
left or right side of the image window. In a dock window however, the
side concept doesn't apply ('side' has nothing to do with what column
a dock is in in a GimpDockColumns)
2011-05-19 20:57:40 +02:00
Michael Natterer ab0b88b5db app: replace the last GtkObject members by GtkAdjustment
Also get rid of some unneeded GTK_ADJUSTMENT() casts and replace some
local GtkObject veriables by GtkAdjustment.
2011-05-15 17:00:41 +02:00
Martin Nordholts cf4a4bf5a6 app: Make gimp_session_info_dock_restore() take a GimpDockContainer 2011-05-13 21:25:39 +02:00
Martin Nordholts 7edf717bae app: Add image_window boolean to GimpDialogFactoryEntry
Add image_window boolean to GimpDialogFactoryEntry and rename
FOREIGN_NOT_HIDEABLE() to IMAGE_WINDOW(). We need to treat image
windows a bit special when we restore a single-window mode session.
2011-05-13 21:25:39 +02:00
Martin Nordholts 0f19471e22 app: Make GimpDockContainer::get_docks() return a new list
Make GimpDockContainer::get_docks() return a new list and not just a
pointer to a list so that GimpImageWindow can implement it (who needs
to merge its two GimpDockColumns lists).
2011-05-13 21:04:23 +02:00
Martin Nordholts 00c2d15a3a app: Add GimpDockContainer::add_dock()
Add GimpDockContainer::add_dock() and use it in
gimp_session_info_dock_restore().
2011-05-13 21:04:23 +02:00
Martin Nordholts ab1b50ad4a app: Add GimpDockContainer::get_ui_manager()
Add GimpDockContainer::get_ui_manager() and make GimpDockWindow
implement it. Primary client is session restoration code.
2011-05-13 18:56:41 +02:00
Michael Natterer 896e29c5f1 app: gimp_session_info_dock_restore(): remove empty dockbooks after restoring
so we don't end up with empty windows if restoring all dockables in
the dock failed.
2011-05-12 21:23:07 +02:00
Michael Natterer 6bf7f7e429 app: ref the session info in gimp_dialog_factory_add_session_info()
and unref it in the callers after adding it. That's the proper way of
doing it and fixes another warning when restoring a dock fails.
2011-05-12 21:23:07 +02:00
Michael Natterer 9e60dd547d app: keep a ref to the session info in gimp_session_info_restore()
because failing to restore a dock can destroy the newly created dock
and implicitly unref the session info.
2011-05-12 21:23:06 +02:00
Michael Natterer 68a56a861e app: gimp_session_info_book_restore(): don't set a non-existing current page
Don't set the first page of the restored dockbook active if there are
less than two pages. Also add a comment that explains why we return
the dockbook even though we know that all its dockables failed to
restore.
2011-05-12 21:23:06 +02:00
Michael Natterer 80cf95319e app: gimp_session_info_dockable_restore(): don't return existing singletons
Instead, return NULL. The singleton dockable can't be restored in this
dock because it's already open in another dock.
2011-05-12 21:23:06 +02:00
Martin Nordholts c70dc8f86d app: Add NULL check in gimp_dock_container_get_docks() 2011-05-12 06:51:40 +02:00
Michael Natterer 3184c0f339 app: use g_object_bind_property() to set sensitivity here too 2011-05-11 11:43:19 +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 4b9243fc60 app: Make GimpDockWindow implement GimpDockContainer
Make GimpDockWindow implement the GimpDockContainer interface. The
plan is to make GimpImageWindow also implement the GimpDockContainer
interface when we start to session manage docks in single-window mode.
2011-05-09 19:55:51 +02:00
Martin Nordholts 2287b6e008 app: Add a GimpDockContainer interface
We now have to classes that contain docks, GimpDockWindow and
GimpImageWindow (in single-window mode). Introduce a GimpDockContainer
interface so we can cope with these in an abstract way.
2011-05-09 19:43:28 +02:00
Martin Nordholts 1d12dc8e86 app: Sort widgets/widgets-types.h 2011-05-09 18:37:40 +02:00
Michael Natterer 85c0fd1166 app: replace gimp_dock_get_dock_columns() by gtk_widget_get_ancestor() 2011-05-04 22:41:40 +02:00
Michael Natterer 909e7833a3 app: remove some more -Wunused-but-set-variable 2011-05-02 13:53:58 +02:00
Michael Natterer c35ff719a7 app/libgimp*: remove stuff found by -Wunused-but-set-variable 2011-05-01 23:23:19 +02:00
Michael Natterer cc47b2a600 libgimpwidgets/color: move the cairo color utility functions to libgimpcolor
Add CAIRO_CFLAGS to a lot of Makefiles to make this possible, and
because they pull in cairo via the libgimp headers.
2011-04-28 15:50:39 +02:00
Michael Natterer 2af539020b app: don't include individual files from libgimp* 2011-04-28 14:23:33 +02:00
Martin Nordholts 4988a97257 app: Add gimp_dock_set_id() 2011-04-21 19:57:14 +02:00
Martin Nordholts c84d26667b app: Add missing gimp_dock_get_id() implementation 2011-04-21 18:59:12 +02:00
Martin Nordholts f75f61779c app: GimpSessionInfoDock::identifier -> dock_type
Rename GimpSessionInfoDock::identifier to dock_type, because it isn't
really an identifier; there might be several instance with dock_type
being "gimp-dock". This is a preparation for adding an actual
'identifier' member.
2011-04-21 18:59:12 +02:00
Michael Natterer 4a8fa1ab2a app: make GimpSpinScale RTL aware 2011-04-20 20:12:21 +02:00
Alexandre Prokoudine ae2ab1ff3b Fixed a typo
The brush editor used to say "Spahe" instead of "Shape".
2011-04-20 13:20:42 +04:00
Michael Natterer 3edf0cb531 app: GimpSpinScale: don't create two cairo_t in expose() 2011-04-20 00:43:30 +02:00
Michael Natterer 3bf15d32e6 app: use GimpSpinScales in GimpBrushEditor 2011-04-18 22:27:43 +02:00
Michael Natterer 6dd463fb02 app: gimp_spin_scale_change_value(): remove "+ lower" from step calculation
It was never noticed because lower is 0.0 or 1.0 in all use cases.
2011-04-18 21:21:45 +02:00
Michael Natterer bfcecd2ef0 app: GimpBrushFactoryView: use a GimpSpinScale for spacing
and use the new scale_limits API to restrict the scale to 1..200 while
the actual range is 1..5000.
2011-04-18 21:04:05 +02:00
Michael Natterer d300ec6556 app: add a "scale_limit" API to GimpSpinScale
which allows to restrict the scale to a range that is smaller than
that of the model GtkAdjustment. This way we can enter large values in
the entry or by dragging beyond the end of the scale, but keep a
reasonably usable scale range for "normal" values.
2011-04-18 21:01:48 +02:00
Michael Natterer bc56060148 app: GimpLayerTreeView: use a GimpSpinScale for opacity 2011-04-18 20:41:02 +02:00
Michael Natterer 26d50b533b app: gimp_item_tree_view_add_options(): allow NULL labels
and pack the options widget into the vbox directly.
2011-04-18 20:40:10 +02:00
Mikael Magnusson 854dd5b6ad app: correct cast for spinbutton 2011-04-16 11:52:49 +02:00
Michael Natterer 924d647284 app: set GimpSpinScale to numeric-only input
It's the right thing to do, but also works around focus issues in SWM,
at least while the widget has the focus.
2011-04-16 02:09:37 +02:00
Michael Natterer 7e6c026790 Globally use GDK_KEY_foo, remove the compat defines from widgets-enums.h 2011-04-11 23:43:03 +02:00