I started from mitch's patch (though code changed so it was not working,
yet I ended up with quite a different direction).
Modified from original proposition in #498:
* Do not mix opacity and brush size in a same action, one on horizontal
movement, the other on vertical. The problem is that it's hard to stay
perfectly horizontal or vertical, so you nearly necessarily change one
while changing the other and this would be frustrating.
* Do not just use modifiers, but modifiers + right click. The logics is
that left (or whatever is the first button) click is for the tool
actions. The middle click for navigation (panning, rotation, and even
layer navigation now). Right click for now is only for menu. With this
change, let's use right click for various settings-related changes
too. Also we already have people complaining with things like canvas
rotation happening unexpectedly even though it requires button clicks.
Imagine an action just made of modifiers! Many people would hit these
by mistake all the time!
* Focus on brush size only for now. Instead of just calling the action
repetitively with the "SElECT_NEXT" action as proposed in the original
patch by mitch, let's compute the actual size between the press and
release. This would allow to have a real visual hint and also would
make it a lot more useful and meaningful to be an on-canvas change.
Say you want to reproduce a stroke size on canvas. You can click the
center and expand to retrieve approximately the size without computing
it in pixels.
Limitations and future work:
* This is a first draft and I still want to test if it works well with
the "lock brush to view" and with scale factor > 1.
* I want to associate this with work done for #7034 so that visual hint
still appear even when we have no visual hint set.
* I am not so fond of with the way we use enum actions which doesn't
really make satisfying logics (I hacked a bit over it, but it's
getting ugly). I'm considering creating int/double actions to really
set some values with exact numbers through actions.
* Right now we need to stop the right click first. I want to be able to
stop the brush sizing with releasing Alt too.
* It would be nice to make this all more customizable, which is why I
called internal variable "mod1_setting". The goal will be to have
other types of actions possibly. Also it could be deactivatable for
people really not liking these or hitting these by mistake (while not
needing these). Same for the navigation shorcuts.
* Similarly the right-click menu could be deactivatable or switched to
other actions conditionally (through Preferences). It is doubtful how
useful it is (compared to using the same menus on top of the GUI)
though I don't want to just delete the option because some people
would clearly be used to it.
* I think we should start breaking down the whole tool events code a bit
more, in particular the function gimp_display_shell_canvas_tool_events().
* For more settings, a small on-canvas GUI could be of interest where
you could customize various values through sliders and buttons, and
also where you could put your favorite brushes or dynamics or whatnot.
It's not replacing the more complete dockable but could be a nice
quick version for fast editing.
As the name implies, this is an action to toggle the paint dynamics ON
and OFF which can be a huge time saver when painting and needing to
switch between dynamics and non-dynamics painting.
I have not been adding this action in the "dynamics-action" group
because these are only used for the dynamics dockable menu. Also it
looks like the context actions are not visible in the action search (I
can't recall why, but I think there was a reason), yet you can still set
a shortcut.
Should we create a new "paint-action" group maybe?
Change all action callbacks so they can be invoked by a GAction:
- add GimpActionCallback typedef:
void (* cb) (GimpAction*, GVariant*, gpointer)
- change all action callbacks to the GimpActionCallback signature
- add "gimp-activate" and "gimp-change-state" signals to GimpAction,
with the same signature as the resp. GAction signals
- remove all other custom action signals and only use the new
GimpAction signals
- pass around appropriate GVariants containing booleans, int32,
strings
- badly hack around to force a GimpProcedure pointer into a
uint64 variant
- remove all G_CALLBACK() casts from all action callbacks,
they all have the same signature now
which returns an array of modes in the order they would appear in a
GimpLayerModeContext's UI (like tool options or the layers dialog),
without the separators.
Use it in context-commands.c and layers-commands.c instead of static
(and outdated) arrays for the actions that cycle through modes.
with proper value names. Mark most values as _BROKEN because they use
weird alpha compositing that has to die. Move GimpLayerModeEffects to
libgimpbase, deprecate it, and set it as compat enum for GimpLayerMode.
Add the GimpLayerModeEffects values as compat constants to script-fu
and pygimp.
GIMP's OVERLAY mode was identical to SOFTLIGHT. This commit fixes the
issue and introduces a NEW_OVERLAY mode and enum value.
- change gimp:overlay-mode to be a real (svg-ish) overlay mode
- when compositing, map OVERLAY to gimp:softlight-mode
- when compisiting, map NEW_OVERLAY to gimp:overlay-mode
- bump the XCF version when NEW_OVERLAY is used
- map OVERLAY to SOFTLIGHT when loading and saving XCF
- map OVERLAY to softlight in all PDB setters
- map OVERLAY to softlight when deserializing a GimpContext
- change all paint mode menus to show an entry for NEW_OVERLAY
instead of OVERLAY
- change PSP, PSD and OpenRaster to use NEW_OVERLAY
These changes should (redundantly) make sure that no OVERLAY enum
value is used in the core any longer because it gets mapped to
SOFTLIGHT at all entry points, with the downside of introducing a
setter/getter asymmetry when OVERLAY was set in a PDB api.
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.
We only have one dialog factory now, and
gimp_dialog_factory_from_name() doesn't provide compile-time type
safety, so use global_dialog_factory directly instead.
* app/actions/actions.h: added prototype for action_message()
* app/actions/actions.c: removed static keyword from action_message()
removed private prototype for action_message()
made action_message() use icons for objects derived from GimpViewable
* app/actions/context-commands.c:
context_brush_radius_cmd_callback()
context_brush_angle_cmd_callback()
context_paint_mode_cmd_callback()
context_brush_shape_cmd_callback()
call acton_message(), these callbacks had use cases where they could not
use generic code
* app/tools/gimpcoloroptions.c: added "average-radius" blurb
and mark for translarion
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
2008-09-10 Michael Natterer <mitch@gimp.org>
* app/actions/context-actions.c: made action labels more
consistent, use '°' instead of 'degrees'.
* app/actions/context-commands.c: cosmetic change in macro
parameters.
svn path=/trunk/; revision=26913
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
2006-10-15 Michael Natterer <mitch@gimp.org>
Applied slightly modified patch from Martin Nordholts which
implements more fine-grained steps for actions. Fixes bug #165612.
* app/actions/actions-types.h: add additional values to
enum GimpActionSelectType.
* app/actions/actions.[ch] (action_select_value)
(action_select_property): handle them here and added "small_inc"
and "delta_factor" parameters.
* app/actions/context-actions.c: added small and percent actions
for the brush radius.
* app/actions/context-commands.c
* app/actions/layers-commands.c
* app/actions/tools-commands.c
* app/actions/view-commands.c: pass small and percent increase
values to the action_select_foo() functions.
* app/actions/context-commands.c (context_brush_radius_cmd_callback):
make sure we don't end up with 1.1, 2.1 etc brush radius values.
2006-06-07 Michael Natterer <mitch@gimp.org>
* app/actions/context-commands.c: cosmetic cleanup.
* app/core/core-types.h: move the GimpGuide typedef to the
"misc objects" section.
* app/tools/gimpforegroundselecttool.c: cosmetic cleanup.
* app/tools/gimpmeasuretool.c (gimp_measure_tool_cursor_update):
use the new corner and side cursors instead of using X cursors.
* app/display/gimpdisplayshell-callbacks.c
(gimp_display_shell_canvas_tool_events): renamed local variable
"update_cursor" to "update_sw_cursor", it has confused me too
often...
2006-05-28 Michael Natterer <mitch@gimp.org>
Applied patch from David Gowers which adds actions to select
palette and colormap colors with actions. Modified the patch quite
a bit. Fixes bug #130123.
* app/widgets/gimpcolormapeditor.[ch]
* app/widgets/gimppaletteeditor.[ch]: add functions get_index()
which gets the currently selected color's index (optionally the
index of a passed color), set_index() which sets the selected
color by index, and max_index() which returns the maximum possible
color index.
* app/dialogs/dialogs-constructors.c: changed accordingly.
* app/actions/context-actions.c
* app/actions/context-commands.[ch]: actions and callbacks which
use the new functions.
2005-04-27 Sven Neumann <sven@gimp.org>
* app/actions/context-actions.c
* app/actions/context-commands.[ch]: applied a patch from Aron
Stansvik that adds actions to control hue, saturation and value
of the foreground and background colors.
2005-02-20 Sven Neumann <sven@gimp.org>
* app/actions/context-actions.c
* app/actions/context-commands.c[ch]: added actions to control the
average radius of color picker tools (bug #167765).
* app/actions/tool-options-actions.c: fixed a typo in a comment.
2004-09-07 Michael Natterer <mitch@gimp.org>
* app/actions/context-actions.c
* app/actions/context-commands.[ch]: applied a heavily modified
patch from David Gowers which adds actions to modify the context's
paint_mode. Fixes bug #151471.
* menus/image-menu.xml.in: added them to the (commentd out)
"Context" submenu.
2004-08-05 Michael Natterer <mitch@gimp.org>
* app/actions/context-actions.c
* app/actions/context-commands.[ch]
* menus/image-menu.xml.in: added actions, callbacks and menu items
for the brush shape and spikes.
2004-06-25 Michael Natterer <mitch@gimp.org>
* app/actions/context-actions.c: added GIMP_ACTION_SELECT_SET
actions which set a generated brush's properties directly.
* app/actions/context-commands.c: adjust the range of possible
brush radius and aspect_ratio values to be actually usable.
2004-06-18 Michael Natterer <mitch@gimp.org>
* app/actions/context-actions.c
* app/actions/context-commands.[ch]: added tons of new actions to
modify the current FG/BG color's RGB components.
Added new enum value GIMP_CONTEXT_SELECT_SET which allows to set
values, not only increase/decrease them.
Changed context_select_value() utility function to interpret
GimpEnumAction::value being >= GIMP_CONTEXT_SELECT_SET as settings
in a range from 0 to 1000. Yes, that's a hack...
2004-06-15 Michael Natterer <mitch@gimp.org>
* app/actions/Makefile.am
* app/actions/context-actions.[ch]
* app/actions/context-commands.[ch]: added new action group to
modify all GimpContext properties. So far there are actions to
cycle through the lists of brushes, patterns etc., to change the
opacity, to swap and default colors and to edit generated brushes.
* app/actions/actions.c: register the new "context" action group.
* app/actions/tools-actions.c
* app/actions/tools-commands.[ch]: removed "tools-default-colors"
and "tools-swap-colors" actions and callbacks because they are
in the "context" action group now.
* app/menus/menus.c: add the "context" group to the <Image> and
<Dock> UI managers.
* menus/image-menu.xml.in: changed accordingly. Added a temporary
"Context" menu to test and debug the new actions.