Commit Graph

12209 Commits

Author SHA1 Message Date
Michael Natterer bb8daa49a3 Present the toplevel not the shell 2009-09-28 22:55:55 +02:00
Michael Natterer 87001c1b3a gtk_window_present() the toplevel, not the shell 2009-09-28 22:55:54 +02:00
Michael Natterer 54edc20113 Add missing #include "gimpimagewindow.h" 2009-09-28 22:55:54 +02:00
Michael Natterer 45f4a99339 Don't set any options in gimp_display_shell_new()
All options are properly set when the shell is set active in its image
window.
2009-09-28 22:55:54 +02:00
Michael Natterer 1273a63eab Update the shell's appearance when it is set active in the image window 2009-09-28 22:55:53 +02:00
Michael Natterer 16038023a5 Remove some dead code and fix some comments 2009-09-28 22:55:53 +02:00
Michael Natterer a8876834e8 Move the remaining menubar signal connections from the shell to the window 2009-09-28 22:55:53 +02:00
Michael Natterer 375a25dd24 Destroy the toplevel, not the shell in gimp_display_delete()
Also add disabled code that removes the display from an image window
that has more then one display.
2009-09-28 22:55:53 +02:00
Michael Natterer f7f58d57be gtk_window_present() the toplevel, not the shell 2009-09-28 22:55:52 +02:00
Michael Natterer accdd3d8a1 Go via the toplevel to get to the menubar manager 2009-09-28 22:55:52 +02:00
Michael Natterer 6c76120561 Move "show-statusbar" next to "show-menubar" 2009-09-28 22:55:52 +02:00
Michael Natterer fbc3b2f0c1 Get rid of image window FIXMEs
Add code that properly uses the statusbar in the toplevel image window
instead of assuming that the shell and the window are the same object.
Add new FIXME because it will break when switching between two
displays of one toplevel that both have active progress messages.
2009-09-28 22:55:52 +02:00
Michael Natterer fa43c8797e Add gimp_statusbar_override/restore_window_title()
Which sets/unsets the title of an iconified toplevel image window to
the current progress message (if any). Use the new functions when the
window is (de)iconified. Not exactly the high art of programming, but
much better than the hacks in gimpdisplayshell-progress.c that are now
removed.
2009-09-28 22:55:52 +02:00
Michael Natterer 892f9f8876 Add gimp_image_window_is_iconified() and use it in GimpImageWindow 2009-09-28 22:55:51 +02:00
Michael Natterer 5b5e4e039a Add gimp_image_window_add_display() and use it
This API is most likely not final, but enables adding the vbox of
shell widgets to the image window's vbox *after* the shell constructor
returns. Seems to work nicely :-)
2009-09-28 22:55:51 +02:00
Michael Natterer bcef4f275d gimp_display_shell_fill_idle() present the toplevel not the shell
Not sure if this one should go to the image window...
2009-09-28 22:55:51 +02:00
Michael Natterer 32783d7228 Move shrink_wrap() from the display to the window
Also fix all callers. This clearly needs more cleanup.
2009-09-28 22:55:50 +02:00
Michael Natterer 8c2934f626 Remove dead and forgotten declaration of gimp_display_shell_update_icon() 2009-09-28 22:55:50 +02:00
Michael Natterer d5b1542808 Add some forgotten casts, fixes (harmless) compile warnings 2009-09-28 22:55:50 +02:00
Michael Natterer abc5e270b3 Go via the toplevel to update the image window's ui manager 2009-09-28 22:55:49 +02:00
Michael Natterer 7f064f694e Get rid of the shell's window-state-event handler
Move the last remaining function to the window. It doesn't actually
belong there, but it's better than the handler in the wrong place.
Added FIXME as reminder.
2009-09-28 22:55:49 +02:00
Michael Natterer 4f60240a04 Move updating the "view-fullscreen" actions to the proper place
Update the actions in gimp_display_shell_appearance_update() and remove
all action code from the window-state-event handlers.
2009-09-28 22:55:49 +02:00
Michael Natterer 8b5b36751d Move updating the shell's appearance to the right window state event handler
The shell's handler is going to go away, so move this call to
the image window.
2009-09-28 22:55:48 +02:00
Michael Natterer 5c048e0108 Reindent static prototypes 2009-09-28 22:55:48 +02:00
Michael Natterer d015a704b3 Move GtkWidget::configure_event() impl from the shell to the window
Still has a FIXME for later, but is in the right place now.
2009-09-28 22:55:48 +02:00
Michael Natterer c475b1b3be Update widget packing ASCII art to not include image window widgets 2009-09-28 22:55:48 +02:00
Michael Natterer a5945740e0 Move GtkWidget::delete_event() impl from the shell to the window
Still has a FIXME but is in the right place now at least
2009-09-28 22:55:47 +02:00
Michael Natterer b11c3355cb Implement GObject::constructor()
For now, simply assert that all required construct properties are set.
2009-09-28 22:55:47 +02:00
Michael Natterer 1ae5632753 Turn "popup-manager" into a construct-only property and pass it accordingly 2009-09-28 22:55:47 +02:00
Michael Natterer 7b62cb3b00 Turn "display" into a construct-only property and pass it accordingly 2009-09-28 22:55:47 +02:00
Michael Natterer d2f43f1604 Finally fully enable the image window's active_display mechanism
Don't set the window's active_display manually in gimp_display_shell_new(),
setting it properly after construction in gimp_display_new() works fine
now. Enable all disabled code in gimp_image_window_set_active_display().
2009-09-28 22:55:47 +02:00
Michael Natterer fdd55d37cb Move the last window-related NIW code from the shell to the image window 2009-09-28 22:55:46 +02:00
Michael Natterer 2762100885 Show the shell after it has been associated with its image window, not before
...so the image window's session management has a chance to set
the window's size.
2009-09-28 22:55:46 +02:00
Michael Natterer cf14f1ce62 Go via the tolevel to get to the image window's statusbar 2009-09-28 22:55:45 +02:00
Michael Natterer 8b5a692099 Remove display_factory member from GimpDisplayShell 2009-09-28 22:55:45 +02:00
Michael Natterer 9c5e44c566 Move the window part of gimp_display_shell_fill() to GimpImageWindow 2009-09-28 22:55:45 +02:00
Michael Natterer 4cc8f8e6f8 Move the window part of gimp_display_shell_empty() to GimpImageWindow 2009-09-28 22:55:44 +02:00
Michael Natterer c7fdac4894 gimp_display_set_image(): emit notify::image only if the image changed 2009-09-28 22:55:44 +02:00
Michael Natterer e5d8067a87 Unref the menubar_manager in finalize() 2009-09-28 22:55:44 +02:00
Michael Natterer 8086bc8e68 Pass the display_factory to the image window 2009-09-28 22:55:43 +02:00
Michael Natterer e9c7b47284 Add "display-factory" construct-only property of type GimpDialogFactory 2009-09-28 22:55:43 +02:00
Michael Natterer e7e8759710 Move image window related functions together (menubar and statusbar) 2009-09-28 22:55:43 +02:00
Michael Natterer 5804e80ad0 Get rid of all image window FIXMEs
Replace duplicated ugly macro constructs by proper utility functions
that do the right thing wrt GimpImageWindow being the new toplevel.
2009-09-28 22:55:43 +02:00
Michael Natterer 0b12978761 Go via gtk_widget_get_toplevel() to get to the statusbar 2009-09-28 22:55:42 +02:00
Michael Natterer ac254f293d Don't use the menubar_manager to set the quickmask toggle's tooltip 2009-09-28 22:55:42 +02:00
Michael Natterer 88ee13db56 Go via the toplevel to get to the statusbar for setting coords
Only a visible shell can produce cursor coordinates, so no need
to check for the image window's active display.
2009-09-28 22:55:42 +02:00
Michael Natterer 7e8a767e88 Add notify callback for GimpDisplay's "image" property
Will be used to do NIW things later.
2009-09-28 22:55:41 +02:00
Michael Natterer fc75f38c03 Make gimp_statusbar_new() a void function and set a shell dynamically 2009-09-28 22:55:41 +02:00
Michael Natterer 82aa4084ab Add gimp_statusbar_set_shell()
Reconnect signals when a new shell is set; reorganize internal code to
not set up permanent connections to one specific shell.
2009-09-28 22:55:41 +02:00
Michael Natterer 571cdd47ed Set the window role and "resizable" on GimpImageWindow, not on the shell 2009-09-28 22:55:40 +02:00
Michael Natterer a9b617235f Make the scale dialog transient to the shell's toplevel 2009-09-28 22:55:40 +02:00
Michael Natterer 1bbcd8f7b5 Add "icon" property to GimpDisplayShell
Set it instead of setting the window icon and connect GimpImageWindow
to the notification.
2009-09-28 22:55:40 +02:00
Michael Natterer 660c333b55 Add "title" and "status" properties to GimpSisplayShell
Set the properties when updating title and status. In GimpImageWindow,
connect to notifications of the properties to update window title and
statusbar.
2009-09-28 22:55:39 +02:00
Michael Natterer 5112bc497d Remove gimp_display_shell_title() because it was completely empty 2009-09-28 22:55:39 +02:00
Michael Natterer 3547a25390 Add a GimpDisplayShell::scaled() handler to GimpImageWindow
...which is connected to the window's active display. Remove updating
the window's menubar_manager from GimpDisplayShell's scaled()
impl. Had to hack around a bit with the new API to set the window's
active display because they are still the same widget.
2009-09-28 22:55:39 +02:00
Michael Natterer a82169ee13 Keep around an "active_display" member in GimpImageWindow
And add gimp_image_window_set_active_display(). Call the new function
when creating a shell. Will all be done by the means of a GimpContext
later, but is a step to get rid of FIXME hacks.
2009-09-28 22:55:39 +02:00
Michael Natterer 03fcc99bbf Move the GtkWidget::style_set() handler to GimpImageWindow
...and remove it from GimpDisplayShell completely.
2009-09-28 22:55:38 +02:00
Michael Natterer 10b98034d4 Move the statusbar to GimpImageWindow
As with the menubar, port some code properly, and add some
horrible /* FIXME image window */ hacks to make it work.
2009-09-28 22:55:38 +02:00
Michael Natterer 6793d68769 Move the menubar and the menubar_manager to GimpImageWindow
Also move some of their related code and update other code to
go via gtk_widget_get_toplevel(), but also add some horrid temp
/* FIXME image window */ hacks.
2009-09-28 22:55:38 +02:00
Michael Natterer 44f9fcbf6f Move the rc style string for the fullscreen menubar to GimpImageWindow 2009-09-28 22:55:37 +02:00
Michael Natterer 1823494122 Keep the main_vbox around in the GimpImageWindow struct (temp hack) 2009-09-28 22:55:37 +02:00
Michael Natterer 639c427429 Use gtk_widget_get_toplevel() to get to a display's "iconified" state
Don't assume that shell->window is the toplevel GdkWindow, go thorugh
gtk_widget_get_toplevel() instead.
2009-09-28 22:55:37 +02:00
Michael Natterer 90ef404d98 Move more window managing code to GimpImageWindow
Move the code that (de)iconifies the docks together with an empty
image window from GimpDisplayShell to GimpImageWindow.
2009-09-28 22:55:37 +02:00
Michael Natterer be93e6564a Move the fullscreen API from GimpDisplayShell to GimpImageWindow
Also remove GimpDisplayShell's "window_state" member. Use
gtk_widget_get_toplvel() to get to the GimpImageWindow when we need a
display shell's fullscreen state.
2009-09-28 22:55:37 +02:00
Michael Natterer fb046b097d Add GtkWidget::window_state_event() implementation to GimpImageWindow
Keep an own window_state member around and update it accordingly.
Chain up in GimpDisplayShell's window_state_event() impl.
2009-09-28 22:55:36 +02:00
Michael Natterer 7c66b4c43d Support GimpImageWindow as action callback user_data 2009-09-28 22:55:36 +02:00
Michael Natterer fcf09eea62 Add gimp_image_window_get_active_display()
Should probably be refactored into something involving a GimpContext,
but it's good enough as intermediate step.
2009-09-28 22:55:35 +02:00
Michael Natterer dc436b6f86 Add menubar_manager member and "menu-factory" construct-only property
Create the menubar_manager when the construct property is set, assert
for its presence in constructor(). Pass the newly required construct
property to g_object_new() in gimp_display_shell_new().
2009-09-28 22:55:35 +02:00
Michael Natterer aad8fbad3e Derive GimpDisplayShell from GimpImageWindow
This is just a refactoring step, later the image window will have one
or many display shells.
2009-09-28 22:55:35 +02:00
Michael Natterer b83a58b64e Add new toplevel window class GimpImageWindow
This one will be the toplevel where GimpDisplayShells live in
once they are no toplevels any longer.
2009-09-28 22:55:35 +02:00
Martin Nordholts c39b8758d5 app: Make dock actions like "Show Image Selection" work
Take into account that the toplevel is not a dock any longer but a
dock window.
2009-09-27 17:12:18 +02:00
Martin Nordholts c7b8a67cfd app: Don't kill the toolbox window when removing the last dockbook
Add a "allow-dockbook-absence" property to the GimpDockWindow which is
set to TRUE for the dock window for the toolbox so that it is not
kiled when the last dockbook is removed.
2009-09-27 14:15:03 +02:00
Martin Nordholts f3f19ac35f app: Make tool selection work again
The toolbox toplevel is no longer the dock, do some minor adjustments
to compensate for this, namely sending the toolbox (which is a dock)
as data to callbacks.
2009-09-27 13:54:45 +02:00
Martin Nordholts 9fa51f70f4 Add a Single-window mode
Add a single-window mode that can be toggled from 'Windows ->
Single-window mode'. No code is yet hooked to the mode though.
2009-09-26 18:28:41 +02:00
Martin Nordholts 1f098e5777 app: Add GimpDockColumns
Add a new widget GimpDockColumns inheriting from GtkHBox that will
contain several GimpDocks making it possible to have columns of
dockables.
2009-09-26 16:49:14 +02:00
Martin Nordholts 9106c75b14 app: Remove temporary GimpDockWindow property prefixes
With GimpDock and GimpDockWindow being separate they can share
property names.
2009-09-26 16:25:30 +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 5447938d5c app: Fix bogus cast in dock-actions.c 2009-09-26 16:13:42 +02:00
Martin Nordholts b00c9b87f5 app: Minor code formating 2009-09-26 15:39:10 +02:00
Martin Nordholts c47c397332 app: Add and use gimp_dock_window_set_dock()
Add and use gimp_dock_window_set_dock() in preparation for making
GimpDock a non-GimpDockWindow.
2009-09-26 15:38:08 +02:00
Martin Nordholts 12a0ea1063 app: Destory the dock window from the dock window, not the dock 2009-09-26 15:26:05 +02:00
Martin Nordholts 0be33be0dc app: Add missing #include "widgets/gimpdockwindow.h" 2009-09-26 15:18:33 +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 3cd7c5a6cd app/tests: Do role tests on the dock windows, not the docks 2009-09-26 12:48:44 +02:00
Michael Natterer 01bafc6ea8 Move variables to local scopes and some minor cleanup 2009-09-22 21:41:24 +02:00
Michael Natterer e306df220a Fix typo in comment 2009-09-22 21:39:32 +02:00
Michael Natterer 295f345b2e Guard against g_file_info_get_icon() returning NULL
It can return NULL, but should not for a proper gvfs backend; add a
returning NULL.
2009-09-22 20:25:11 +02:00
Michael Natterer a40f2b9037 Fix and optimize gimp_group_layer_duplicate()
Make sure the duplicated group layer actually has a properly set up
tile manager taken from its projection, and not just a dumb copy of
the original group's tiles. Also optimizes away useless calls to
gimp_group_layer_update_size().
2009-09-21 22:36:26 +02:00
Michael Natterer 43cf8e9259 Make "merge visible layers" work on the right container
(gimp_image_merge_visible_layers): merge the visible layers in the
active layer's group. We can't possibly merge across different groups
anyway because there is no logical place to add the merged layer.
Moreoever, this change makes the group behave more like a sub-image,
which is our metaphor anyway.
2009-09-21 20:30:10 +02:00
Michael Natterer e79c3c9bd7 Allow merging down a group layer
There is no reason to disallow this, the merged-down group layer will
simply disappear from the image just as a normal layer, and its
projection composited with the layer below.
2009-09-21 19:21:03 +02:00
Michael Natterer 90893cea84 Add "layers-merge-group" action, callback and menu items 2009-09-21 19:17:02 +02:00
Michael Natterer 170054a36e Add gimp_image_merge_group_layer()
The new function replaces a group layer by a normal one that looks
exactly the same.
2009-09-21 19:08:04 +02:00
Michael Natterer 13e39d7e2c Fix precondition check when duplicating group layers
(gimp_group_layer_duplicate): change the allowed type of the duplicate
from GIMP_TYPE_GROUP_LAYER to GIMP_TYPE_DRAWABLE. The former was
simply a braino when copying and modifying the GimpLayer code.
2009-09-21 18:41:54 +02:00
Michael Natterer 098a0e4491 Make sure the layer preview's border is correct after removing a mask
(gimp_layer_tree_view_mask_update): call
gimp_layer_tree_view_update_borders() unconditionally; not only when a
mask has been added, but also when it has been removed.
2009-09-21 10:43:26 +02:00
Sven Neumann fa628b580a Revert part of commit c8853243ea
g_str_equal() is a hash function and should not be used instead of
strcmp() as it doesn't provide a proper signature.
2009-09-20 20:34:32 +02:00
Alexander Jones 3af6b2ea3c Bug 593501 - Canvas Size dialog defaults to fixed aspect ratio
Default to non-fixed aspect ratio in Canvas Size dialog. It doesn't
make sense to deault to fixed aspect ratio here.
2009-09-20 20:25:32 +02:00
Martin Nordholts 02c8835e2c app: Make gimp_dock_window_get_dock() public 2009-09-20 20:21:45 +02:00
Martin Nordholts 3ebad746ee app: Add GimpUIManager property to GimpDock
Add GimpUIManager property to GimpDock. We need it later when the
GimpDock stops being a GimpDockWindow.
2009-09-20 19:30:16 +02:00