Commit Graph

346 Commits

Author SHA1 Message Date
Michael Natterer 0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
More than 2000 lines of code less in app/, instead of

if (instance->member)
  {
    g_object_unref/g_free/g_whatever (instance->member);
    instance->member = NULL;
  }

we now simply use

g_clear_object/pointer (&instance->member);
2017-07-15 18:42:44 +02:00
Michael Natterer a3c65e6d17 app: get rid of including menus/ stuff from widgets/ and other places
Add GimpMenuFactory can always be found in a GimpDialogManager, use
gimp_dialog_factory_get_menu_factory() where we have a dialog factory
instead of accessing "global_menu_factory" or redundantly passing a
menu factory around where we already pass around a dialog factory.
2016-11-23 19:38:44 +01:00
Michael Natterer 328e4eff18 app: add gimp_progress_set_text_literal()
and use it instead of set_text (progress, "%s", literal_message);
2014-07-20 23:32:19 +02:00
Michael Natterer a6601d563b app: some GimpProgress cleanup
- change start() and set_text() to use "format" and "..." instead of
  "message", allowing to format progress messages in place
- s/cancelable/cancellable/
- move "cancellable" to be the second argument of start()
2014-07-12 23:45:20 +02:00
Michael Natterer 9b341d05bb app: remove GimpArea and use cairo_region_t instead
This may or may not remove some logic that avoids drawing tiny update
regions, and may or may not improve things or make them worse. Will
add code that actually tile-aligns update areas later.
2014-05-31 01:26:06 +02:00
Michael Natterer 8356003fa2 app: pass the startup monitor to displays opened from the copmmand line
Change gimp_get_display_name() to also return the screen, and its
implementation in the GUI to return the initial monitor during
startup. Retrieve that information in app.c using a weird callback
construct and pass the monitor to file_open_from_command_line().

Half-related, add screen and monitor parameters to GimpDisplayShell
and use these initial values for calculating the canvas's initial
extents.

The image windows still don't position themselves correctly though
because we have no mechanism for that whatsoever just yet, but we now
at least pass the needed monitor information to the right objects.
2014-05-03 00:54:20 +02:00
Michael Natterer 7f23fbec34 app: add screen and monitor to all display and image window constructors
so they appear on the proper monitor as well.
2014-05-02 20:21:41 +02:00
Michael Natterer b3a9a6a3e3 Bug 55367 - Rotated view of the canvas (view is rotated, not image contents)
First version of display rotation, inspired by gimp-painter.
The rotation always happens around the image's center.

The only "UI" for rotating is currently shift+middle-drag and
shift+space-drag. Control constrains the angle to 15 degrees
and is currently the only way to go back to "no rotation".
2013-04-20 15:11:01 +02:00
Michael Natterer 97af52c465 Bug 686544 - Opening new image window doesn't restore docks
Call gimp_dialog_factory_show_with_display() in gimp_display_new(), we
otherwise do this only when the ICONIFIED state of an image window
changes.
2013-02-27 23:26:49 +01:00
Ville Skyttä 6b0d1038cc Bug 692641 - Various spelling fixes 2013-01-27 18:59:02 +01:00
Michael Natterer a9353cd3a2 app: use g_get_monotonic_time() also for limiting display flushing 2012-10-06 18:01:41 +02:00
Michael Natterer f70bc837fa app: remove gimpdisplay-utils.[ch], move its only function to gimpdisplay.[ch] 2012-02-11 17:57:27 +01:00
Michael Natterer f4af9b549e Globally switch to saying "window_id" instead of just "window"
when dealing with native window handles. Also get rid of using
GdkNativeWindow and simply consistently use guint32 all over the
place. This is more obvious and consistent and keeps the diff to the
gtk3-port branch smaller.
2011-02-06 12:07:55 +01:00
Michael Natterer c79deb40dd app: don't use a timeout for delaying display flushing
because it might never be called. Instead, check the time since
the last flush_now and make sure they are at least 20 ms apart.
2010-10-11 23:33:33 +02:00
Michael Natterer be2037ce03 app: limit realtime image updates to about 50 fps
which increases responsiveness while painting quite a bit.
2010-10-11 22:49:10 +02:00
Michael Natterer ddc63de6d6 app: remove "gboolean use_offsets" from gimpdisplayshell-transform.[ch] 2010-09-23 19:24:04 +02:00
Michael Natterer 8671860945 app: move "image" member of GimpDisplay to the private struct 2010-02-28 16:15:59 +01:00
Martin Nordholts bf830398a5 app: Cleanup GimpImageWindow and dependencies, only one dialog factory
Cleanup GimpImageWindow and dependencies like GimpDisplay, there is
only one dialog factory now.
2010-02-20 11:09:51 +01:00
Michael Natterer c9b9b8e18e Increating and decreasing the display count were swapped 2010-02-03 22:59:50 +01:00
Michael Natterer 0b2c804e9d Move "disp_count" and "instance_count" to GimpImagePrivate
and add the neccessary API to access and modify them.
2010-02-03 21:22:00 +01:00
Martin Nordholts f3235e6f45 app: Add "dock-factory" property to GimpImageWindow
With the introduction of a single-window mode, not only dock windows
needs to be able to create docks, the image window also needs to. So
give it a "dock-factory" property.
2009-12-08 19:49:13 +01:00
Martin Nordholts fdf2454666 app: Add gimp_image_window_new/destroy()
Add gimp_image_window_new/destroy() so we have a central place where
the Gimp::image_windows list is managed.
2009-10-25 22:02:38 +01:00
Martin Nordholts b9214fd3cf app: Add "gimp" property to GimpImageWindow 2009-10-25 21:44:23 +01:00
Michael Natterer dd0575edb4 Move refing/unrefing the image to gimp_display_set_image()
and don't do it in gimp_display_connect()/disconnect() because
set_image() is the natural place to do it.
2009-10-07 21:13:39 +02:00
Michael Natterer 067cfe9ff0 Move a call to gimp_display_shell_connect() around
from gimp_display_shell_reconnect() to gimp_display_set_image()
because it makes unsetting and setting an image in
gimp_display_set_image() more symmetric.
2009-10-07 20:11:48 +02:00
Michael Natterer 1ae5d6ad8d Use the local shell variable and don't call get_shell() again 2009-10-07 19:59:54 +02:00
Michael Natterer 6ad76d226e Use gimp_display_set_image() in gimp_display_new()
instead of manually calling gimp_display_connect(). Make
gimp_display_set_image() handle displays in construction
(which don't have a shell yet).
2009-10-07 19:42:08 +02:00
Michael Natterer 23cd244c65 Make display->instance private, add an accessor and use it everywhere 2009-10-06 09:16:46 +02:00
Michael Natterer 5d70d60927 Move the display ID to the private struct 2009-10-05 20:10:00 +02:00
Michael Natterer c339125d7d Add private struct and move "shell" and "update_areas" there 2009-10-05 20:06:13 +02:00
Michael Natterer 297d205269 Use gimp_display_get_shell() also in gimpdisplay.c 2009-10-05 19:27:04 +02:00
Michael Natterer 161f1346db Create the new display ID in set_property() not in gimp_display_new()
Make the ID a read-only property and set it when the "gimp"
construct-only property gets set. Removes code from gimp_display_new()
where it doesn't belong.
2009-10-04 22:00:04 +02:00
Michael Natterer 18cbe3422e Add getters for "gimp", "image" and "shell" 2009-10-04 19:39:22 +02:00
Michael Natterer 4a0b826493 (gimp_display_new): add a local "shell" variable for more readable code 2009-10-04 19:30:32 +02:00
Michael Natterer 31a41c2b3d Use gimp_display_shell_present() instead of gtk_window_present() 2009-10-04 19:27:58 +02:00
Michael Natterer dee0afed79 Move the statusbar back to GimpDisplayShell
Keeping it in GimpImageWindow was a bad idea because
- it wasted space
- it produced evil code because
- it conceptually didn't belong there
2009-10-04 15:33:03 +02:00
Martin Nordholts 301e5c2c34 app: Maintain a list of GimpImageWindow:s on an app instance level 2009-10-04 02:10:11 +02:00
Michael Natterer f6fd3aed51 Move GimpDisplayShell's expose functions to separate files 2009-10-02 23:55:26 +02:00
Michael Natterer 3d13f8d4d5 Tweak display finding logic of previous commit a bit
(gimp_display_new): add the new shell to the active display's image
window, not the first display's.
2009-10-02 21:50:02 +02:00
Michael Natterer 3106b66186 Finally enable multiple images in one window
(gimp_display_new): if single-window-mode is active, put the new shell
into the first display's image window.
2009-10-02 21:15:07 +02:00
Michael Natterer 625885eb9d Make sure the shell is really destroyed when removing it from the window
Explicitely call gtk_widget_destroy() to break whatever reference
cycles so the shell really goes away.
2009-10-01 19:44:13 +02:00
Michael Natterer ee2fdbcf8f Enable some #if 0'ed code and use the just added API
gimp_display_delete(): remove shells from image windows with more than
one shell instead of destroying the window.
2009-09-29 23:01:33 +02:00
Michael Natterer 1c430a2b19 Move all GimpImageWindow members to a private struct
Add accessor functions for publically available members and visibility
functions for menubar and statusbar.
2009-09-29 21:44:43 +02:00
Michael Natterer 59274856ad Derive GimpDisplayShell from GtkVBox instead of GimpImageWindow
...and pack the widget into a separately created GimpImageWindow.
2009-09-29 20:56:14 +02:00
Michael Natterer 253b8e2cbe Use gimp_display_shell_get_window() instead of gtk_widget_get_toplevel()
The new function does the right thing, unlike get_toplevel() which
returns the shell itself if it is not in a window. Check the return
value of get_window() for being non-NULL.
2009-09-29 20:32:26 +02:00
Michael Natterer 35739c743c Change GimpImageWindow API to speak in shells, not displays
A widget container should keep around child widgets, not whatever
objects that just have widgets.
2009-09-28 22:55:55 +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 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 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 c7fdac4894 gimp_display_set_image(): emit notify::image only if the image changed 2009-09-28 22:55:44 +02:00