Commit Graph

15 Commits

Author SHA1 Message Date
Michael Natterer adb826fb39 app: allow filter actions to have hardcoded default operation settings
by encoding them directly in the string attached to all filter
actions. The code now supports both "gegl:some-operation" and
"gegl:some-operation\n<serialized config>".

Add "default_settings" to GimpGeglProcedure to store the settings of
the invoking action, much like the "default_run_mode" member.

Change filters-commands.c to parse the new operation string, create
GimpGeglProcedures with the deserialized settings, and use those
settings when the procedures are ran.

Change the filter history to be smarter about what is already in the
history, there can now be several different procedures with the same
name.

Remove the dilate and erode actions from the drawable group, and add
them to filters, they are just special cases of value-propagate with
fixed settings.
2017-06-03 22:08:43 +02:00
Michael Natterer 383419926b app: add member "default_run_mode" to GimpGeglProcedure
which determines if a filter is applied directly (RUN_NONINTERACTIVE)
or asynchronously using GimpOperationTool (RUN_INTERACTIVE).

Split filter actions in two groups, one for direct apply and one for
interactive apply, which have separate callbacks that create
GimpGeglProcedures with the right default_run_mode set.

(After doing this distinction automatically based on the existance of
editable properties, I figured will might want direct apply also for
filters that do have properties, such as e.g. dilate and erode, which
are just value-propagate with some constant property values)
2017-05-31 23:48:22 +02:00
Michael Natterer 9d502791d0 app: rename procedure_commands_run_procedure()
to procedure_commands_run_procedure_async(). Add a new
procedure_commands_run_procedure() that calls the procedure
synchronously, needed later.
2017-05-31 23:48:22 +02:00
Michael Natterer ed2fb2944f app: add a "settings" argument to GimpGeglProcedure
which gets added automatically by procedure_commands_get_display_args().

Move the non-interactive and run-with-last-vals code to
gimp_gegl_procedure_execute() (not execute_async()) because it makes
more sence to call it synchronously anyway (not implemented yet).

This commit should change no behavior.
2017-05-31 23:48:22 +02:00
Michael Natterer 06a5b2fa3f app: bring dialog titles and help IDs to GEGL filter dialogs
Add "title" and "help_id" parameters and members/properties to
GimpToolDialog, GimpToolGui, GimpOperationTool. Also make the order of
parameters more consistent.
2016-01-17 20:17:07 +01:00
Michael Natterer 3831f62495 Bug 759316 - "Recently used" menu not updated with gegl filters
Add GimpGeglProceure to keep track of recently used GEGL operations in
the filter history. The new procedure also takes care of running the
op in the GEGL tool, so filters-commands.c is almost empty now.

Change gimp-filter-history.c to find procedures by name instead of
comparing pointers.

The only thing missing now is rerunning a GEGL op with the last
settings (not just showing its UI).
2016-01-04 15:07:30 +01:00
Michael Natterer dda06ac065 app: move some code in actions/ to new utility file procedure-commands.c 2016-01-02 00:39:20 +01:00
Michael Natterer e0ab721361 app: rename GimpPlugInAction to GimpProcedureAction
and make the filter history keep around a list of GimpProcedures
instead of GimpPlugInProcedures. Still WIP and unfinished...
2016-01-01 20:05:32 +01:00
Michael Natterer ac50da2ad4 Bug 759316 - "Recently used" menu not updated with gegl filters
This preparation commit only moves code around and renames it, the
history is still a list of plug-ins only:

- move app/core/gimp-filter-history.c
  to app/plug-in/gimppluginmanager-history.c and clean it up
- move the actions that create the submenus under "Filters"
  from the "plug-in" to the "filters" action group
- move the code that creates and updates the history actions
  to the "filters" action group
- add menu setup code for the "filters" menu
- move the "history-changed" signal from GimpPlugInManager to Gimp
2015-12-30 20:04:58 +01:00
Michael Natterer 413846475f app: make GimpOperationTool manage an icon name for the GUI
and add an icon_name parameter to gimp_operation_tool_set_operation().
2014-05-22 23:29:59 +02:00
Michael Natterer cf3010394b app: strip the ellipsis from the GEGL filter dialog labels
We recycle the menu item's label, and ellipsis are just wrong in a
dialog title.
2013-03-09 20:19:32 +01:00
Michael Natterer cf37aa7dba app: add a GimpSettingsBox to all GEGL operation filter dialogs
so they store all recently used settings, and explicitly added ones,
just like the color tools.
2012-05-02 17:50:49 +02:00
Michael Natterer 1921fa7de3 app: always create a new tool in filters_filter_cmd_callback()
Things will get more complicated in GimpOperationTool soon, and we
don't want to mess around with reconfiguring *everything* in the tool.
2012-05-02 17:50:43 +02:00
Michael Natterer f5e1dc5bf5 app: clean up includes in filters-commands.c 2012-05-02 17:46:16 +02:00
Michael Natterer 96357dbfd3 app: add infrastructure to invoke GEGL filters from a menu item
and for fun add pixelize and gaussian blur to Filters -> Blur.
2012-05-02 17:46:16 +02:00