Commit Graph

193 Commits

Author SHA1 Message Date
f50b215d16 app: add a default impl of GimpImageMapTool::reset()
and chain up where possible instead of duplicating that code.
2014-05-16 16:22:31 +02:00
23037b5230 app: convert all stock IDs kept around by the core by icon names
Particularly GimpViewable's stock_id. Make sure old config files
containing stock IDs are still properly parsed.
2014-05-07 01:01:56 +02:00
84ce7f1a9a app: add a "Gamma hack" toggle to the GimpImageMap dialog 2014-05-04 20:42:58 +02:00
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
a53c2f8b30 app: cancel the active tool before going brightness/contrast->levels->curves
because changing tools now automatically commits the old tool.
2014-04-18 21:15:46 +02:00
88e4d7e468 app: commit ongoing tool operations on tool change instead of cancelling
On tool change, we used to simply halt tools before switching to the
new one, which meant losing ongoing live-previewed tool changes, like
transforms, warps and color corrections. This change makes them being
applied to the image instead before switching to the new tool:

Add enum value GIMP_TOOL_ACTION_COMMIT that is passed to
GimpTool::control() before tool switching. Handle the new enum value
in all tools, and actually commit the previewed stuff. This changes
the behavior of GimpCageTool, GimpImageMapTool, GimpTransformTool and
GimpWarpTool.
2014-04-04 22:34:26 +02:00
ad8d12ed69 app: add "response" signal to GimpToolGui
and connect to it instead of to gimp_tool_gui_get_dialog()'s signal.
One more step towards on-the-fly embedding/detaching.
2013-06-07 23:45:11 +02:00
9a811d276e app: add gimp_tool_gui_set_alternative_button_order() and use it
Also make some of GimpToolGui's memory management proper, there was
no leak but it needs to be proper in order to add runtime switching
between dialog and overlay.
2013-06-07 15:18:24 +02:00
88387d6e8d app: remove the "shell" parameter from gimp_tool_dialog_new() and gui_new() 2013-06-07 12:19:42 +02:00
7abbd38a25 app: use a GimpToolGui in GimpImageMapTool
instead of implementing both dialog types manually.
2013-06-07 10:28:41 +02:00
822057a4ff app: call gimp_color_tool_disable() when an old op's options_table dies
so gimp_image_map_tool_color_picked() isn't called any longer on clicks.
Add a warning there in case it happens anyway because this is always a
programming error.
2013-05-31 02:50:17 +02:00
0a2b86e534 app: fix parameter name of gimp_image_map_tool_add_color_picker()
It's a "tooltip", and used as such, not a "help_id".
2013-05-30 23:25:39 +02:00
b8558f8859 app: add coordinates to GimpColorTool's and GimpImageMapTool's "picked"
signals and vfuncs. This is currently unused, but GEGL operations
can soon pick coordinates just like they can pick colors.
2013-05-30 19:29:36 +02:00
9072bf331a app: rename GimpImageMapConfig to GimpSettings
It was misnamed from the beginning and has no relation to GimpImageMap
except that it happens to be used by GimpImageMapTools. Now it feels
less weird to potentially use it for other settings too.
2013-05-25 15:26:18 +02:00
ef917b2c5c app: add an "area" parameter to gimp_image_map_apply()
and only update the drawable in that area if it's not NULL. Useful for
expensive interactive operations like warp, where the tool exactly
knows which area has changed.
2013-05-18 01:45:01 +02:00
e3180de960 app: remove GimpPickable implementation from GimpImageMap
It's not needed because we don't modify the drawable's
pixels any more.
2013-05-17 02:02:28 +02:00
ac5428787e Bug 598523 - Protect hidden layers from editing
Don't allow tool operations on invisible items, just like we do for
group layers or locked items.

Cleaned up and enhanced the patch a bit --Mitch
2013-05-13 23:29:43 +02:00
f6ec4f4af2 app: remove the image map tool overlay before hiding it again
Which means I have given up finding that last bug (for now).
2013-04-28 14:57:57 +02:00
595f52bf09 app: more cleanup in GimpImageMapTool's overlay dialog handling
gimp_image_map_tool_initialize(): clean up adding the overlay.

gimp_image_map_tool_dialog_hide(): hide the overlay before removing it.
2013-04-25 22:46:05 +02:00
8230e948a8 app: allow to call gimp_image_map_tool_dialog_hide() multiple times
don't try to remove a GimpOverlayDialog from the canvas twice.
2013-04-25 22:23:32 +02:00
a80795e222 app: remove "GeglRectangle visible" from gimp_image_map_apply()
because we now use a filter and the image projection updates
the visible part only.
2013-04-22 00:29:38 +02:00
b71ffeca60 app: do more stuff generically in gimp_image_map_tool_initialize()
- reset the config object if it exists
- trigger the first preview of the filter
- remove the same stuff from all subclasses
2013-04-16 23:28:02 +02:00
9bb4c3d484 app: pull some GEGL operation logic from subclasses into GimpImageMapTool
- connect to the config object's notify generically and update the preview
- allow to properly exchange the operation at runtime to remove major
  uglyness from GimpOperationTool
- return undo_desc from GimpImageMapTool::get_operation() so we have
  proper strings in the undo history, not always "GEGL operation"
- simplify all get_operation() implementations
2013-04-16 22:06:48 +02:00
9994a4d514 app: remove the notify::use-gegl callback from GimpImageMapTool 2013-04-16 20:38:40 +02:00
e3b2a54da7 app: add a stock_id to GimpImageMap and use it for its filter
Refactor GimpImageMapTool and GimpOperationTool to set the stock_id,
and to be a bit smarter with the image map's undo string.
2013-04-16 20:32:58 +02:00
1e17f0aed1 app: port GimpImageMap to use the new drawable filters
which makes live update more responsive and removes tons of code, but
adds a delay with progress when finally committing the effect.
2013-04-12 14:35:27 +02:00
69c897a118 app: fix crash in GEGL tool when an operation specific tool was used before
gimp_image_map_tool_initialize(): add the saved settings combo only if
we have a config object.
2013-03-09 20:16:24 +01:00
908f727f0a Chain up unconditionally in GObject::constructed()
It's supported since GLib 2.28.
2012-11-12 21:51:22 +01:00
e546f2b43b Bug 683462 - cropping with rectangular select tool leaves misaligned...
Reset the tool on image changes again, but not if only the active
drawable changes, so keep bug #678890 closed:

Introduce new dirty flag GIMP_DIRTY_ACTIVE_DRAWABLE and set it on all
tools' dirty_mask except for rect select. Check the new flag when
reseting the active tool because of a drawable change.
2012-09-06 23:55:35 +02:00
078128bb09 Bug 678890 - Selection box handles do not respond after changing layer
Make sure that temporarily setting/unsetting tool->control's "preserve
tool across image changes" does not mess up the default value:

Introduce gimp_tool_control_push/pop_preserve() which restores the old
state automatically, and use it in all tools, instead of saying
set_preserve(TRUE/FALSE) around image changes.
2012-07-26 18:17:01 +02:00
e7e8c9ef0a app: don't call gimp_image_flush() when cancelling GimpImageMapTool
because the tool might be cancelled from some other place opening an
undo group, so flushing the image would update menus and whatnot while
that other operation is running, with unforeseeable side
effects. Also, flusing the image here is not needed because we didn't
change anything in the image. Instead, make sure manually that the
display is updated correctly after restoring GimpImageMapTool's
temporary editing.
2012-05-05 21:47:17 +02:00
50439e812e app: move GimpLevelTool's color picking stuff into GimpImageMapTool
so all subclasses can use it.
2012-05-02 17:51:22 +02:00
9031cdc645 app: add a ton of parameters to GimpImageMapTool::get_settings_ui()
so they can be passed in instead of being looked up in the class
struct, which enables freely configuring the settings stuff from
subclasses, such as soon GimpOperationTool.
2012-05-02 17:50:48 +02:00
e8cc9d1bf5 app: turn gimp_image_map_tool_add_settings_gui() into a virtual function
and change it to return the settings ui, not add it.
2012-05-02 17:50:42 +02:00
89d525c970 app: remove legacy support from GimpImageMap 2012-05-02 17:50:40 +02:00
98226d0b36 app: remove legayc support from GimpImageMapTool 2012-05-02 17:50:40 +02:00
8008b75411 app: forgot the GimpImageType -> Babl change in pick_color() here 2012-05-02 17:50:39 +02:00
08dd7901b1 app: allow to opionally not implement GimpImageMapTool::map()
it's not needed for many tools that have no legacy implementation.
2012-05-02 17:45:45 +02:00
6600bb8347 app: silence a harmless critical warning
Executing Desaturate... or Posterize... used to print:

Gimp-Widgets-CRITICAL **: gimp_settings_box_add_current: assertion
`GIMP_IS_SETTINGS_BOX (box)' failed
2012-03-18 18:30:28 +01:00
3e336199b9 app: use gtk_box_new() 2011-09-30 11:29:11 +02:00
624e99041b app: remove unused variable in gimp_image_map_tool_initialize() 2011-09-24 16:20:50 +02:00
71af0311de Bug 645120 - Disable color tools overlay dialogs 2011-08-05 01:59:49 +02:00
c35ff719a7 app/libgimp*: remove stuff found by -Wunused-but-set-variable 2011-05-01 23:23:19 +02:00
880572860a app: move shutdown code from gimp_image_map_tool_response() to control(HALT) 2011-04-01 22:56:33 +02:00
7c60bb5181 app: use more of the new GDK_KEY_foo key names
and move the compat defines from display-enums.h to widgets-enums.h
2011-03-29 17:24:08 +02:00
6378e9fc4d app: rename member GimpImageMapTool->shell to ->dialog
"shell" has confused me once too often today...
2011-03-20 18:27:11 +01:00
4149452279 Bug 643155 - Tool dialogs don't stay on top of the image window
Change the "GtkWidget *parent" parameter of GimpToolDialog to
"GimpDisplayShell". Also add API gimp_tool_dialog_set_shell() so an
existing dialog can be used on different images. Make sure the dialog
closes when the shell is unmapped (like when switching tabs in SWM),
and make the dialog transient for the toplevel GimpImageWindow.

Change all tool dialog users accordingly.
2011-03-20 18:15:42 +01:00
1f5e180334 app: move GimpToolDialog from app/widgets/ to app/display/
Zero logic changes yet, just a rename.
2011-03-20 13:34:03 +01:00
18b9ba1c87 app: Add some comment documentation to code 2011-02-07 03:29:23 +02:00
503a9cebce app: implement GObject::constructed() instead of ::constructor() 2011-01-13 10:06:07 +01:00