Commit Graph

129 Commits

Author SHA1 Message Date
Michael Natterer c6b6031f31 Bug 758049 - Please add canvas flipping
Enable flipping in the canvas rotate transform matrix, and add some
menu items to control it. Rename the "Rotate" menu to "Flip & Rotate".
2015-11-13 18:51:32 +01:00
Michael Natterer 91fbc3af01 Bug 734573 - Zoom to selection
Implement View -> Zoom -> Zoom to Selection using
gimp_display_shell_scale_to_rectangle()
2015-10-18 15:26:17 +02:00
Simon Budig c344a0950e app: add absolute actions to the display rotation 2015-05-17 04:13:43 +02:00
Simon Budig 6ce2a2b3ad app: more actions for display rotation 2015-05-17 04:13:43 +02:00
Michael Natterer 65a65947d9 app, libgimp: replace GTK_STOCK_FOO by icon names
unless it's a stock ID used for an action button, will address that
later.
2014-05-11 22:49:22 +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 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
Michael Natterer f885085bcf app: view_close_cmd_callback(): no need to check the shell for != NULL 2013-07-03 09:19:22 +02:00
Michael Natterer 977a194923 app: add a rotate dialog to rotate to exact degrees 2013-04-20 23:22:14 +02:00
Michael Natterer 1a755b2dbe app: add a View -> Rotate menu
Which so far has "Reset", "90°", "-90°" and "180°" entries.
2013-04-20 22:16:50 +02:00
Michael Natterer 59f67e0503 app: simpler code in view_close_cmd_callback() 2012-12-12 23:25:45 +01:00
Jehan 2ad8634c06 Bug 685559 - view-close action modified to close only an image view.
view-close was closing also toolbox docks if they had the focus. Now
this action will close only the current active image view (if any),
whatever the window which has actual focus.
Additionally all other view actions are available on dock focus.
2012-12-12 15:50:08 +09:00
Michael Natterer d294cfb8b2 app: remove the legacy projection construction code 2012-05-19 00:06:03 +02:00
Michael Natterer 0a68527edc app: move the GimpWindowStrategy interface from display/ to widgets/ 2012-01-30 23:33:21 +01:00
Michael Natterer 325bce54a7 app: port dockable showing to using GimpWindowStrategy API
so it works right in SWM. Fixed actions/, tools/, and app/ for now.
2012-01-30 23:24:44 +01:00
Michael Natterer a116681982 app: move all GimpGroupLayer members to a private struct 2011-02-03 22:30:22 +01:00
Martin Nordholts 11b1300b6f app: Introduce gimp_dialog_factory_get_singleton()
Instead of including dialogs/dialogs.h everywhere, introduce
gimp_dialog_factory_get_singleton(). The dialog factory singleton is
still initialized by dialogs.c though.

Right now the assumption is that we never will have another dialog
factory instance around. There were so many problems before when we
had four of them, so let's just keep one of them around.
2010-02-28 23:23:24 +01:00
Martin Nordholts 99bf62e303 app: For view actions, only set if not already set
If we don't check if a state has already been applied in a toggle
action, we will apply it twice. The first time when it is toggled, the
second time when we get notified about a change in the underlying
property (which we caused ourselves).
2010-02-28 15:22:56 +01:00
Martin Nordholts 4a4d6abe56 app: Add and use return_if_no_shell() 2010-02-28 15:22:56 +01:00
Martin Nordholts 8b458fb591 app: Merge "toplevel" and "dock" dialog factories
Merge "toplevel" and "dock" dialog factories. The end goal is to have
only one dialog factory.
2010-02-20 09:28:26 +01:00
Michael Natterer 2005fd1a68 Move "projection" and "graph" to GimpImagePrivate 2010-02-03 21:46:09 +01:00
Martin Nordholts ed2d178da3 app: Get rid of config -> display module dependency
In order to make a clear separation between the core modules and the
UI modules, move the necessary enums from display-enums.h and
widgets-enums.h to config-enums.h and the files
gimpdisplayoptions.[ch] from the display to the config module. This
removes the config -> display dependency.

This change has three main benefits
 * It lets us remove includes of display files from the config module
 * We don't have to link gimp-console and test-config with a subset of
   object files from the display module
 * It is reflected in devel-docs/gimp-module-dependencies.svg that the
   application is made up of core modules and UI modules and that no
   core module depends on any UI module
2010-02-01 21:56:48 +01:00
Martin Nordholts 66197c5d11 app: global_dock_window_factory -> global_dock_factory
Rename back global_dock_window_factory to
global_dock_factory. Renaming to global_dock_window_factory was done
under the assumption that there would be a separate factory that would
create non-toplevel dockables, but I don't expect this to happen in
the forseeable future.
2010-01-19 22:40:06 +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
Michael Natterer efcc28a018 Use GtkAdjustment's accessors 2009-10-09 21:19:06 +02:00
Michael Natterer c5b856f16f Use gimp_display_get_image() instead of display->image 2009-10-06 19:20:44 +02:00
Michael Natterer d1ded0617f More gimp_display_get_shell() instead of display->shell 2009-10-05 19:58:03 +02:00
Michael Natterer 8ba18309eb Use display->gimp intead of display->image->gimp 2009-10-04 20:05:28 +02:00
Michael Natterer ac98c2c234 Use gimp_display_get_shell() instead of directly accessing it 2009-10-04 19:56:39 +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 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 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 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 c39dfab87c Don't access image->width and ->height directly 2009-09-03 01:03:29 +02:00
Michael Natterer d442379d5e Change GimpProjectable::update to GimpProjectable:invalidate
The only purpose of this change is to avoid having the "update"
signal twice on GimpGroupLayer (from GimpDrawable and from
GimpProjectable). Switch back to normal g_signal_connect()
in the projection.
2009-08-26 13:06:55 +02:00
Michael Natterer 6934a0d2eb Make sure all group layers' projections switch to GEGL with the main projection 2009-08-24 22:38:16 +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
Martin Nordholts 1dd185c397 Bug 560903 – Explicit zooming with e.g. '1' should handle
zoom-focus better

* app/display/display-enums.h: Added
GIMP_ZOOM_FOCUS_RETAIN_CENTERING_ELSE_BEST_GUESS.

* app/display/gimpdisplayshell-scale.c
(gimp_display_shell_scale_get_zoom_focus): Take the new enum into
account; if the image is centered, keep it centered, else use the
best-guess method.

* app/actions/view-commands.c (view_zoom_explicit_cmd_callback):
Use the new enum for explicit zooming.

* app/display/display-enums.c: Regenerated.

svn path=/trunk/; revision=27653
2008-11-15 10:24:56 +00:00
Michael Natterer 138781daf9 commit some #if 0'ed experimental code.
2008-10-12  Michael Natterer  <mitch@gimp.org>

	* app/gegl/gimpoperationadditionmode.c: commit some #if 0'ed
	experimental code.

	* app/actions/view-commands.c (view_use_gegl_cmd_callback): use
	gimp_image_update(), simply exposing the shell doesn't reconstruct
	the projection.


svn path=/trunk/; revision=27247
2008-10-12 19:01:22 +00:00
Michael Natterer ef1df223a8 add a "use_gegl" boolean member.
2008-10-11  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpprojection.h: add a "use_gegl" boolean member.

	* app/core/gimpprojection-construct.c (gimp_projection_construct):
	use the boolean instead of hardcoding FALSE.

	* app/actions/view-actions.c
	* app/actions/view-commands.[ch]: add a "Use GEGL" action and
	callback which sets the boolean and exposes the display.

	* menus/image-menu.xml.in: add it to the "View" menu.


svn path=/trunk/; revision=27242
2008-10-11 19:17:42 +00:00
Michael Natterer 5503e6a055 Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h had a
2008-10-09  Michael Natterer  <mitch@gimp.org>

	Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h
	had a GEGL dependency (they will have in the next commit, but I
	wanted to keep the commit separate).

	* app/dialogs/Makefile.am
	* app/file/Makefile.am
	* app/gui/Makefile.am
	* app/menus/Makefile.am
	* app/paint/Makefile.am
	* app/plug-in/Makefile.am
	* app/text/Makefile.am
	* app/vectors/Makefile.am
	* app/widgets/Makefile.am
	* app/xcf/Makefile.am: add GEGL_CFLAGS.

	* app/actions/*.c
	* app/core/*.c
	* app/dialogs/*.c
	* app/display/*.c
	* app/file/*.c
	* app/gui/*.c
	* app/menus/*.c
	* app/paint/*.c
	* app/pdb/gimppdb-utils.c
	* app/pdb/gimpprocedure.c
	* app/plug-in/*.c
	* app/text/*.c
	* app/tools/*.c
	* app/vectors/*.c
	* app/widgets/*.c
	* app/xcf/*.c: add <gegl.h> or replace <glib-object.h> by <gegl.h>
	to all files which include a drawable subclass or gimpimage.h

	* tools/pdbgen/app.pl: include <gegl.h> instead of <glib-object.h>
	in all generated files.

	* app/pdb/*-cmds.c: regenerated.

	* data/images/gimp-splash.png: the goat is still sleeping.
	By Aurore Derriennic.


svn path=/trunk/; revision=27202
2008-10-09 20:24:04 +00:00
Martin Nordholts 259801e34e Bug 553534 – centering issues after image scaling and setting zoom
to 100%

* app/display/display-enums.h: Added a GimpZoomFocus enum with
'best guess', 'pointer' or 'image center' values.

* app/display/gimpdisplayshell-scale.[ch]
(gimp_display_shell_scale): Take a GimpZoomFocus parameter and
pass it on to

(gimp_display_shell_scale_get_zoom_focus): which returns the
requested zoom focus point if one was given, else makes a best
guess.

* app/actions/view-commands.c
* app/display/gimpstatusbar.c
* app/display/gimpnavigationeditor.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-scale-dialog.c: For explicit-zoom
commands like "zoom to 100%", always use the image center as the
zoom focus point. For all other zooming, continue to use the
best-guess method.

* app/display/display-enums.c: Regenerated.

svn path=/trunk/; revision=27104
2008-10-02 14:53:35 +00:00
Martin Nordholts 80ff2e82c3 Explain that this function needs to be used with care since it is risky.
2008-08-16  Martin Nordholts  <martinn@svn.gnome.org>

	* app/display/gimpdisplayshell-scroll.c
	(gimp_display_shell_scroll_center_image_on_next_size_allocate):
	Explain that this function needs to be used with care since it is
	risky.

	* app/display/gimpdisplayshell.c
	(gimp_display_shell_new)
	(gimp_display_shell_fill): Clarify that it is safe to use the
	risky function.

	(gimp_display_shell_configure_event): Make proper comparisions (<=
	not =) and explain that usage of the risky function is safe.

	(gimp_display_shell_shrink_wrap): Always call
	gimp_display_shell_scroll_center_image() and let size-requests be
	handled by GimpDisplayShell::configure_event().

	* app/actions/view-commands.c (view_shrink_wrap_cmd_callback): No
	need to center anything explicitly any longer.

svn path=/trunk/; revision=26607
2008-08-16 18:25:32 +00:00
Martin Nordholts b9acd50751 Also handle the case when only the offset is wrong. Not pretty but simple.
2008-08-16  Martin Nordholts  <martinn@svn.gnome.org>

	* app/actions/view-commands.c (view_shrink_wrap_cmd_callback):
	Also handle the case when only the offset is wrong. Not pretty but
	simple.

svn path=/trunk/; revision=26592
2008-08-16 13:53:18 +00:00
Sven Neumann f9ebb8c9fd app/display/Makefile.am app/display/gimpdisplayshell-scale.[ch] split
2008-08-16  Sven Neumann  <sven@gimp.org>

	* app/display/Makefile.am
	* app/display/gimpdisplayshell-scale.[ch]
	* app/display/gimpdisplayshell-scale-dialog.[ch]: split scale
	dialog into a new file.

	* app/actions/view-commands.c: changed accordingly.

svn path=/trunk/; revision=26590
2008-08-16 11:51:10 +00:00
Martin Nordholts aff80d1cf8 We need to center the image after a Shrink Wrap.
2008-08-10  Martin Nordholts  <martinn@svn.gnome.org>

	* app/actions/view-commands.c (view_shrink_wrap_cmd_callback): We
	need to center the image after a Shrink Wrap.

svn path=/trunk/; revision=26472
2008-08-10 07:40:03 +00:00
Martin Nordholts 368c855c90 Add keyboard shortcut support for reseting to default value of e.g. brush
2008-05-31  Martin Nordholts  <martinn@svn.gnome.org>

	Add keyboard shortcut support for reseting to default value of
	e.g. brush scale. Fixes bug #493030.

	* app/actions/actions.[ch]: Make action_select_value() take a
	default-parameter and add support for it. Also use default_value
	from gint and gdouble param specs.

	* app/actions/actions-types.h: Added
	GIMP_ACTION_SELECT_SET_TO_DEFAULT.

	* app/actions/tools-actions.c: Add _SET_TO_DEFAULT actions.

	* app/actions/view-commands.c:
	* app/actions/layers-commands.c:
	* app/actions/context-commands.c: Pass defaults to
	action_select_property().

svn path=/trunk/; revision=25874
2008-05-31 20:05:03 +00:00
Michael Natterer f8e5aa31bd Never shrink the empty display when filling it, only grow:
2008-03-23  Michael Natterer  <mitch@gimp.org>

	Never shrink the empty display when filling it, only grow:

	* app/display/gimpdisplayshell.[ch]
	* app/display/gimpdisplayshell-scale.[ch]: add "gboolean
	grow_only" parameters to shrink_wrap() APIs which restricts
	resizing of the window to growing.

	* app/display/gimpdisplayshell-scale.[ch]
	(gimp_displaY_shell_scale_resize): remove boolean "redisplay"
	parameter because is was always passed as TRUE. Add boolean
	"grow_only" instead and pass it on to shrink_wrap()

	* app/actions/view-commands.c
	* app/display/gimpdisplayshell-handlers.c: pass grow_only = FALSE.

	* app/display/gimpdisplayshell.c (gimp_display_shell_idle_fill):
	pass grow_only = TRUE.


svn path=/trunk/; revision=25178
2008-03-23 15:16:44 +00:00
Michael Natterer ca0fa8964c remove useless include.
2008-03-19  Michael Natterer  <mitch@gimp.org>

	* app/actions/view-commands.c: remove useless include.


svn path=/trunk/; revision=25129
2008-03-19 19:24:52 +00:00
Michael Natterer cee3baea0f First draft of the "no image open" window, which is implemented as a
2008-03-18  Michael Natterer  <mitch@gimp.org>

	First draft of the "no image open" window, which is implemented as
	a display without image (a view with NULL model). Didn't change
	the display's appearance yet so I can first make sure the display
	without image works properly in all details before hiding these
	details.

	* app/core/gimp-gui.[ch]: add "gimp" parameter to display_create()
	and allow "image" to be NULL.

	* app/core/gimpcontext.c (gimp_context_real_set_display): a
	display's image can be NULL now.

	* app/display/gimpdisplay.[ch]: add Gimp and GimpDisplayConfig
	members.  Add Gimp parameter to gimp_display_shell_new(). Changed
	gimp_display_reconnect() to gimp_display_set_image() and allow to
	set a NULL image.

	* app/gui/gui-vtable.c (gui_display_create): if there is a single
	display without an image, call gimp_display_set_image() on that
	display instead of creating a new one.

	* app/display/gimpdisplayshell-close.c: if the last display is
	closed, don't close it but make it empty. Factored out that code
	to gimp_display_shell_really_close().

	* app/display/gimpdisplayshell-dnd.c: when dropping uris on an
	empty display, open the first one into that display and the other
	ones as layers of the newly opened image. This is consistent with
	dropping on an existing image but maybe needs some discussion.

	* app/display/gimpdisplayshell-callbacks.c: bail out early in the
	tool event callback so tools never have to deal with empty
	displays. In expose(), draw the drop zone on the empty display.

	* app/display/gimpdisplayshell-title.c: set the empty display's
	title to "Gimp - Drop Files".

	* app/display/gimpdisplay-foreach.c
	* app/display/gimpdisplay-handlers.c
	* app/display/gimpdisplayshell-appearance.c
	* app/display/gimpdisplayshell-autoscroll.c
	* app/display/gimpdisplayshell-callbacks.c
	* app/display/gimpdisplayshell-cursor.c
	* app/display/gimpdisplayshell-dnd.c
	* app/display/gimpdisplayshell-draw.c
	* app/display/gimpdisplayshell-filter-dialog.c
	* app/display/gimpdisplayshell-handlers.c
	* app/display/gimpdisplayshell-layer-select.c
	* app/display/gimpdisplayshell-preview.c
	* app/display/gimpdisplayshell-render.c
	* app/display/gimpdisplayshell-scale.c
	* app/display/gimpdisplayshell-scroll.c
	* app/display/gimpdisplayshell-selection.c
	* app/display/gimpdisplayshell-title.c
	* app/display/gimpdisplayshell.c
	* app/display/gimpnavigationeditor.c
	* app/display/gimpstatusbar.c: use display->gimp and
	display->config instead of going via the image. Guard against
	empty displays in some few places (most places can't be
	called). Where needed, use the canvas' dimensions instead of the
	image's dimensions so scroll offsets and scrollbars still have
	sane values instead of the last image's ones.

	* app/actions/actions.c (action_data_get_gimp)
	(action_data_get_context): use display->gimp instead of
	display->image->gimp.

	* app/actions/edit-commands.c (edit_paste_cmd_callback): redirect
	to "paste as new" if there is an empty display.

	* app/actions/tools-commands.c (tools_select_cmd_callback): don't
	initialize the new tool on an empty display.

	* app/actions/view-actions.c (view_actions_update): changed lots
	of sensitivity settings to be insensitive when there is no image
	(instead of no display).

	* app/actions/view-commands.c: use the display's config object
	instead of gimp's.


svn path=/trunk/; revision=25113
2008-03-18 21:22:21 +00:00