Commit Graph

3440 Commits

Author SHA1 Message Date
Michael Natterer bb852184e1 app: pass the drop_path to GimpContainerTreeView::drop_possible()
Together with some more refactoring, this will soon enable smarter
layer group dnd behavior.
2009-12-28 21:10:04 +01:00
Martin Nordholts ad56949d5b app: Make gimp_tool_options_editor_new() use only g_object_new()
In preparation for cleaning up the dialog factory stuff, start making
dockable constructable with just g_object_new(). First out is
gimp_tool_options_editor_new(). Move code from that function into
gimp_tool_options_editor_constructor() and add the necessary "gimp"
GObject property. The regression test
"/gimp-ui/tool-options-editor-updates" still passes after the
refactoring, of course.
2009-12-24 17:50:39 +01:00
Martin Nordholts 0f7c373f3b app: Add gimp_tool_options_editor_get_tool_options()
Add gimp_tool_options_editor_get_tool_options() for unit testing
purposes.
2009-12-24 17:50:39 +01:00
Martin Nordholts cf5d4953fd app: Add GimpToolOptionsEditorPrivate
Add GimpToolOptionsEditorPrivate and format static function
prototypes.
2009-12-23 22:39:47 +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 8699511bbd app: global_dock_window_factory -> global_dock_factory
With GimpDock not being a toplevel any longer, it makes more sense to
name global_dock_factory global_dock_window_factory. Do that.
2009-12-20 14:41:02 +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 ef6bd20c3b app: When paned widget is removed, clear drag handler
When paned widget is removed, clear drag handler. Not clearing was a
copy and paste mistake.
2009-12-17 19:51:13 +01:00
Alexia Death 60705f79e9 app: Making spacing available as dynamic parameter
Spacing is now dynamically controllable. Unlike other parameters it
made little sense to scale down from default spacing so it scales between
current and maximum spacing.
2009-12-13 22:46:09 +02:00
Martin Nordholts 65c5541faf app: Don't crash when detaching dockables from image window
Don't crash when detaching dockables from the image window. This
scenario only occurs in single-window mode. We solve it by using
global variables and checking for NULL for src_dock_window; there is
no dock window when detaching from the image window.

The use of global variables is meant to be temporary.
2009-12-10 19:30:49 +01:00
Michael Natterer c02d28643f app: fix gimp_button_menu_position() to not add the y position twice
Fixes commit 4822ca0d6d from ages ago,
does nobody around here actually *use* master?
2009-12-10 12:20:03 +01:00
Martin Nordholts 34ad9dad1a app: Session manage multi-column dock windows
Introduce GimpSessionInfoDock and session manage multi-column dock
windows. We are still backwards compatible with sessionrc, the only
difference is that a "session-info" entry now can have multiple "dock"
entries.

Also make ond dock window multi-column in the regression test
app/tests/test-session-management.c and adjust positions and image
selection menus a bit.
2009-12-06 14:49:53 +01:00
Martin Nordholts bfd91ebdb7 app: Append in gimp_dock_columns_add_dock()
Append new docks to the GimpDockColumns list to preserve the order of
addition. This will become important when we serialize the docks into
sessionrc.
2009-12-06 14:36:57 +01:00
Martin Nordholts 482f31cd3f app: Add GimpMenuFactoryPrivate
Add GimpMenuFactoryPrivate. Note that we don't introduce a Gimp-getter
since the menu factory is globally accesible and we want to have as
much control as possible in who can get the Gimp instance.
2009-12-06 10:23:05 +01:00
Martin Nordholts 3bb15eac78 app: Move out dock window logic from gimp_session_info_dock_restore()
Move out dock window logic, most notably aux info, from
gimp_session_info_dock_restore() and put it in
gimp_session_info_restore() where it belongs.
2009-12-05 22:43:32 +01:00
Martin Nordholts 1bf84999e4 Move the Image Selection Menu to GimpDockWindow
Move the Image Selection Menu from GimpMenuDock to
GimpDockWindow. That is, if a dock window contains many docks then
they will share the same Image Selection Menu.

To do this we need to move around quite a bit of code. Move the
"context", "dialog-factory" and "ui-manager" properties from GimpDock
to GimpToolbox, GimpMenuDock doesn't need it any longer. Turn the
GimpDock getters for these properties into wrappers that go to the
GimpDockWindow properties. In some places, most notably GimpToolbox
construction, we use the GimpToolbox values of these properties, but
most of the time it works fine to just use the GimpDockWindow
properties. GimpDock::setup() and set/get_aux_info() have also been
moved to GimpDockWindow since the only aux info for docks was for the
image selection menu.

Also, we don't bother porting gimp_menu_dock_destroy() to
GimpDockWindow, but we leave the code around. If this is a problem, it
will show.
2009-12-05 21:21:24 +01:00
Martin Nordholts cb854e6ad7 app: Only do necessary init in gimp_dock_window_init()
The private instance data struct is zeroed out for us so we don't need
to assign NULL, FALSE and 0 to private instance data members in
gimp_dock_window_init().
2009-12-05 12:38:55 +01:00
Martin Nordholts df44751292 app: Add GimpMenuDockPrivate
Add GimpMenuDockPrivate which requires two new trivial getters.
2009-12-05 09:54:40 +01:00
Martin Nordholts d33f643f6b app: Move GimpDockWindow::"font-scale" style property to GimpDock
To make the smaller font in docks also apply in single-window mode,
move the GimpDockWindow::font-scale style property to GimpDock. We use
the GimpDockWindow approach, so now each GimpDock has a name of the
form "gimp-internal-dock-<id>". We add "internal" to avoid clashing
with the GimpDockWindow legacy id "gimp-dock-<id>".
2009-12-03 23:08:30 +01:00
Martin Nordholts 5ae5ef0f9f app: dock_ID -> dock_window_ID in gimp_dock_window_init() 2009-12-03 21:51:56 +01:00
Martin Nordholts 4ccb650435 Exterminate GimpDockSeparator
Remove all GimpDockSeparator-related code. Seems pointless to keep
even the stuff in gtkrc.
2009-12-02 20:40:39 +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 7b85cf4de8 app: Use a GdkWindow instead of GimpDockSeparators for dockable DND
Make drag-and-drop rearrangement of dockables happen directly in the
existing widget hierarchy so we don't have to use special, ugly
widgets (read GimpDockSeparator:s) for that.

More specifically, make edges of dockables and dockbooks have the same
semantics as the GimpDockSeparators had. We put a highlight colored
GdkWindow on top of the widget in question to highlight these special
drop areas. This GdkWindow is not taken into consideration in the GTK+
drag-and-drop code, so it does not interupt the DND interaction.

To achive this, there is a problem we must solve: Drag events in GTK+
are propagated inwards and out, but we sometimes want ancenstor
widgets to take care of drop events. We solve this by introducing the
concept of "drag handlers". A drag handler is asked if it will handle
a given drag event, and if it will, a client will let the drag event
be propagated upwards in the widget hierarchy. Right now, the
GimpPanedBox is the only "drag handler". The code could be generalized
more but it doesn't feel worth it at this point.

The size of the special drop area is 5px, the same size as the default
GtkPaned handles. This is because the plan is to later use these
handles as drop areas too.

Other changes of interest are:
 * We need to take care of "drag-motion", "drag-drop" and widget
   highlightning ourselves. We can not use the GtkDestDefaults
   conveniences with gtk_drag_dest_set() any longer since we need more
   control.
 * Make the drop callback pass the insert index directly instead of a
   GimpDockSeparator
 * Add some GIMP_LOG() debug output for DND
 * Disable the GimpDockSeparator code in GimpToolbox
2009-11-29 18:22:12 +01:00
Martin Nordholts 9ea1d490a4 app: Make gimp_paned_box_remove_widget() more destruction friendly
When closing a GimpDockWindow, the GtkBox code might already have
removed the widget. In that case we don't need to do anything.
2009-11-29 15:07:40 +01:00
Martin Nordholts e4e7bf8471 app: Add and use gimp_highlight_widget()
Add gimp_highlight_widget() so we can simplify
gimp_dockbook_tab_drag_motion() a bit.
2009-11-28 19:12:39 +01:00
Michael Natterer b45454bc6c Make the popup arrow look sane again
Render the arrow to a temp GdkPixmap, turn it into a GdkPixbuf and set
the pixbuf as icon on the GtkEntry.
2009-11-15 21:35:34 +01:00
Martin Nordholts a685508713 app: Make GimpDockColumns listen to "dock-removed"
Make GimpDockColumns listen to "dock-removed", not "dockbook-removed",
when trying to figure out when to destroy itself. Fixes some crashes
when rearranging the UI, for example when doing this step-by-step:

1. Have two dock windows with one dockable each, say A and B
2. Move A to B's dock window and make it multi-column
3. Try to detach B, will result in a crash
2009-11-15 21:26:17 +01:00
Michael Natterer 79563b99c2 Use GtkEntry's icon feature instead of reimplementing our own popup arrow
Removes tons of code but looks ugly because it uses GTK_STOCK_GO_DOWN
currently, will fix that. Also did some random small cleanups and
removed unused members from the instance struct.
2009-11-15 20:30:57 +01:00
Martin Nordholts b5eae26c4b app: gimp_dock_columns_dock_book_remove() -> _removed() 2009-11-15 19:51:15 +01:00
Martin Nordholts 13bac61020 app: Move g_list_copy() out from gimp_dock_columns_get_docks()
Move g_list_copy() out from gimp_dock_columns_get_docks(). Fixes at
least one memory leak (in gimp_dock_window_get_dock()) and feels nicer
and more flexible.
2009-11-15 19:21:57 +01:00
Martin Nordholts 8a473663d5 app: Fix gimp_dock_separator_get_insert_pos(), we must return an index
The insert position for new column in GimpDockColumns was sometimes
wrong, the problem was in gimp_dock_separator_get_insert_pos() not
return an index but a GtkAnchorType. Convert from GtkAnchorType to an
insert index.
2009-11-15 16:10:59 +01:00
Martin Nordholts ae2f595f12 app: Remove empty GimpDocks from GimpDockColumns 2009-11-15 15:57:49 +01:00
Martin Nordholts 12530bfcf1 app: Add GimpDockColumns "dock-added" and "dock-removed" signals 2009-11-15 15:57:49 +01:00
Michael Natterer 0715c58c13 Fix the find_widget_under_pointer() code to build with GSEAL_ENABLE 2009-11-11 21:01:21 +01:00
Michael Natterer e4d8a36080 Store the active dynamics with the input device
Also remove cruft #include <stdio.h>
2009-11-07 17:39:02 +01:00
Michael Natterer 2651c2517b Bail our from expose() when the event doesn't come from entry->text_area 2009-11-06 12:04:58 +01:00
Michael Natterer dd3c1d5eb5 Use the standard system mouse cursor over the popup arrow 2009-11-05 22:48:11 +01:00
Martin Nordholts 397650bc46 app: Remove #include "gimpdockseparator.h" in gimpwidgets-utils.c 2009-10-31 20:56:28 +01:00
Michael Natterer 22767ca7b8 Seal GimpData completely and add the missing accessors 2009-10-31 18:48:38 +01:00
Michael Natterer 398607ee94 Bug 599765 - F1 key on gimp-tool-align in menu have wrong link and it open gimp-tool-move
Add help ID "gimp-tool-align" and use it for the align tool.
2009-10-27 18:54:34 +01:00
Martin Nordholts 624bb78c4c app: Move down gimp_dock_window_from_dock() in the file
Move down gimp_dock_window_from_dock() in the file as it is a special
kind of function.
2009-10-26 07:52:07 +01:00
Martin Nordholts dd96705549 app: Allow multi-column dock windows by drag-and-drop
When dropping a dockable on a dock separator on the side of e.g. a
dock window, a new column of dockables will be created. This allows
multi-column dock window setups.
2009-10-25 23:34:43 +01:00
Martin Nordholts d3bb3e7f99 app: Add and use gimp_dockbook_drag_source_to_dockable() 2009-10-25 23:02:05 +01:00
Martin Nordholts 2b622f99cd app: gimp_dock_separator_get_anchor() -> _get_insert_pos() 2009-10-25 22:25:06 +01:00
Martin Nordholts be8e0045ac app: Add gimp_dock_window_get_docks()
Add gimp_dock_window_get_docks() and get rid of trailing whitespace.
2009-10-25 21:50:08 +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