Keep the config values around even if compiled without MyPaint brush
support, so we remember the values between sessions of differently
compiled GIMP versions.
Add new tool GimpHandleTransformTool which allows to freely place up
to 4 handles on the image, then move any one of them, which transforms
the image so that the remaining handles keep their position.
Did quite some cleanup on the code before pushing --Mitch
Since the first action of the list can be run directly with Enter while
the entry is focused, hitting "Down" means one wants to select the next
item of the list. So let's jump directly to the second item on the first
"Down" key pressed.
- add gimp_image_get,get_xcf_compat_mode()
- add a compat toggle to GimpFileDialog which is shown and sensitive
only for a save (not export), and if the image structure allows
to save an old version at all. The button also has a tooltip
which explains why it is sensitive and what it does
- add "gboolean xcf_compat" to file_save_dialog_save_image()
- in file_save_dialog_save_image(), call image_set_xcf_compat_mode(TRUE)
only around the call to file_save() and set it to FALSE after saving
- in xcf_save_invoker(), honor the image's XCF compat flag and save an
RLE-compressed XCF if possible
The above is very convoluted and doesn't pass the "xcf_compat" boolean
directly because we can't change the parameters of gimp-xcf-save, and
because the gimp-xcf-save might be called indirectly.
I now normalize with g_str_tokenize_and_fold() which uses standard
Unicode normalization.
I don't use g_str_match_string() directly though, because I want to
run additional checks to order the results by relevance. For instance
I still want actions whose labels starts with the search string to be
at the top, and results with same order as search token before those
with a different order. Then results with match in the tooltip. Finally
I also returns results with partial match in the label, and the rest in
the tooltip, though at the bottom of the list.
Other than that, this returns the same results as g_str_match_string()
with a similar algorithm. In particular now we only match the start of
tokens (a substring in the middle of a token won't match anymore).
I kept the small 2-character trick matching the first letters of the
first 2 words of the label, but I got rid of the fuzzy search (that none
really found ever relevant anyway).
The page is shown by default in unstable but needs --show-playground
in stable versions. There is nothing yet on that page. Also, the icon
needs improvement...
gimp_directory_file(), gimp_data_directory_file() etc. The new
functions take a variable list of path elements to the file,
the list has to be NULL-terminated. Remove the newly added
gimp_personal_rc_gfile(). Start using the new functions in app/.
- 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()
instead of passing N_()-strings; and remove gettext() calls on these
strings when using them. Reduces complexitx, and fixes double- and
untranslated strings. Also enables to treat properties of GIMP and
GEGL objects the same way, which was totally broken before.
Add a "monitor" parameter and return something reasonable, instead
of a useless resolution average of all the screen's monitors. Also
require a screen to be passed now.
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.
GIMP_ADD_foo_MASK -> GIMP_ADD_MASK_foo
GIMP_foo_MODE -> GIMP_BLEND_foo
GIMP_foo_CLONE -> GIMP_CLONE_foo
GIMP_foo -> GIMP_DODGE_BURN_TYPE_foo
GIMP_foo -> GIMP_TRANSFER_foo
Add compat values for the old names and compat code to script-fu
and pygimp.
If the passed dialog is a GimpColorProfileChooserDialog, handle its
"response" signal automatically and also destroy it when the combo box
is destroyed (before we leaked all dialogs). Remove the same callback
from all places using GimpColorProfileComboBox.
and improve gimp_color_profile_combo_box_set_active() to get the
profile's label from the ICC file if no label was provided. Simplifies
all its callers and removes code duplication.
which returns a string meant to label the profile in the GUI, it's
either the profile's description, its model, or "(unnamed profile)" as
a fallback. Use the function instead of duplicating that logic
inconsistently and imcompletely all over the place.
This is useful for debugging though current consensus is that the finale
user should not care about the technical name of an action.
I did also some minor code cleanup when setting up the model columns.
Fix various bugs, improve code design and efficiency, change feature
name, update the feature up to our standards (now uses GIMP preferences,
session management, less overwhelming settings...).
Also now action history is tightly tied to GimpAction and logs all
action activation (however it activates, and the show_unavailable
parameter also applies to history).
Search algorithm greatly improved with basic tokenization, better
ordering, filtering, etc.
Port selection/path stroking to using the PDB-controllable
paint options that live in GimpPDBContext.
Change gimp_item_stroke()'s "use_default_values" boolean which was
introduced at a time where we had no better way by a GimpPaintOptions
parameter. If a non-NULL paint_options is passed (when called from the
PDB), use it for stroking; if NULL is passed, use the actual paint
tool options from the GUI (when called from the menus or the stroke
dialog). In the PDB wrappers, get the right paint options object from
the PDB context associated with the calling plug-in.
* Add a dialog with Preview, Apply, and Reset buttons instead of
depending only on hidden keyboard shortcuts.
* Change default paint mode to Unknown.
* Disable engine list when there is only one engine available.
* Hide useless Anti-Alias toggle.
* Write to selection instead of the layer mask.
Follows updated save+export specification.
For renamed actions (file-export and file-export-to respectively to
file-export-as and file-export to mimick file-save*), menurc from
GIMP 2.8 will be correctly migrated.
This mitigates the pain of having to confirm quitting when images have
only be exported but not saved: Introduce a <Primary>D shortcut in the
quit dialog and tell about it using a hint label at the bottom, so
quitting with dirty images is now a matter of pressing <Primary>Q
<Primary>D which is much easier to memorize than <Primary>Q
<Mnemonic>D.
Install a cell_data_func for the dirty image list's text renderer abd
construct the label manually, using the same string and logic as in
the close dialog.
Along with this change, the snap preferences have been moved from
GimpDisplayConfig to GimpDisplayOptions, where it makes much more sense.
One of the consequences is that there is no need to duplicate these
values in GimpDisplayShell anymore to differenciate defaults and
current settings.
...for Non-XCF files.
When the entered extension in save or export is on the other group,
add a link to the warning dialog which allows to jump directly to the
export or save dialog, with the same filename pre-entered.
Current implementation had 2 issues, fixed by this commit:
1/ after the file save dialog is closed, the image would not close.
2/ if you switched the visible tab before saving the new image, it
would save and close the visible tab, instead of the expected one.
For conversions that have no dither options (like RGB -> GRAY or u8 ->
u16), always preserve text editability, for conversions that have
dither options (like RGB -> INDEXED or u16 -> u8), give the user the
choice whether to enable dithering.
Add buttons to offset by width/2 and height/2 separately. This rarely
used dialog's main purpose is making textures, and it doesn't hurt
if it does this a little better at the expense of a little clutter.
Only auto-add .xcf if it's a save (not an export) dialog, instead do
not auto-add anything and ask the user to enter an extension, that's
less mysterious than saving in the last-exported format which the user
maybe doesn't remember or want.
by having two booleans "export_backward" and "export_forward" in the
api instead of just an "export" one that would destroy the "imported
from" state. This change fixes the state of the "Overwrite" menu item,
so it stays visible until the file got either saved or exported to
another filename.
This also reverts commit a4beeecf2b, so
Ctrl-S is always invokable even if invisible.
when window positions aren't automatically saved.
Save "hide-docks" and "single-window-mode" in sessionrc instead of
gimprc, so a session layout is always saved either completely or not
at all. Also change "last-tip-shown" saving a bit so all three
session-saved gimprc properties are implemented the same.
Rememeber if image windows are opened because we want the
gimp_session_info_restore() code to run for the single-image window
once that code is in place.
In gimp_session_info_restore() there is code to create a dialog from a
session info. GimpSessionInfo lives in the widgets module. Thus we
can't add restoration code that depends on a higher level module. In
particular, we can't add code to restore docks in an GimpImageWindow
since GimpImageWindow lives in the display module. And we need such
code to be able to restore a single-window mode session.
Since dialogs are defined in the dialogs module, it makes sense to
also have the code that restores a dialog in that module.
So, add a 'restore_func' member to GimpRestoreDialogFunc of type
GimpRestoreDialogFunc and move the code there.
Add image_window boolean to GimpDialogFactoryEntry and rename
FOREIGN_NOT_HIDEABLE() to IMAGE_WINDOW(). We need to treat image
windows a bit special when we restore a single-window mode session.
Add "gboolean merge_active_group" to gimp_image_merge_visible_layers()
and pass FALSE from the PDB wrapper so plug-in invoked layer merging
always acts on the toplevel container as it did in 2.6. Do the same
when opening an image as layer.
Also, added a "Merge within active group only" toggle to the merge
layers dialog and pass it down to the core, but default to TRUE here
so.
We should handle import-URI and export-URI at a lower level so
e.g. the import URI is reset when gimp_dnd_xds_save_image() is
used.
This change also simplifies unit testing.
by integrating their label instead of requiring one externally. This
way we get rid of some more labels in the tool options. Also clean up
tool options further (add more spin scales, and some general
reordering and spacing cleanup).
because the packing options are different for GtkH/VBox and GtkBox
itself which is now instantiable. Instead, always use
gtk_box_pack_start() and specify expanding explicitely.
When we are going to open new image windows, unset the transient
window. We don't need it since we will use gdk_window_raise() to
keep the dialog on top. And if we don't do it, then the dialog
will pull the image window it was invoked from on top of all the
new opened image windows, and we don't want that to happen.
Patch heavily inspiried by hack from Massimo Valentini.
Also add a manual test case for the fix. (I don't think there is GTK+
API to automate it).
Session manage empty- and single-image window separately. So when
starting up, the default 2.6 UI is the same. But when enabling
single-window mode, the image window will become much larger then the
empty-image window. These conceptually different windows will then
from that point be session managed separately: switching mode switches
size of the image window.
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.
In GIMP 2.6 dockrc did not contain the factory entries for the session
infos, so set that up manually if needed. Also take the opportunity to
add a copyright notice to dialogs.c since tha file is almost rewritten
by now...
Added two new widgets, GimpDeviceInfoEditor, which is an editor/view
widget for GimpDeviceInfo, and GimpDeviceEditor, which is an editor
widget for all devices. Both are pretty much ugly right now and look a
lot like the old GtkInputDialog, but are at least internally cleaned
up and easily changable code and ui wise. Consider this a completely
intermediate state.
Also cleaned up GimpDeviceInfo so it's possible to have a proper
view on it, and did the needed changes to the preferences dialog
to use the new stuff.
Get rid of 'global_toolbox_factory' and manage everything dock-related
with 'global_dock_factory'. The whole of 'global_toolbox_factory' was
a big special-case and getting rid of it makes it easier to extend the
session management with e.g. single-window mode dock functionality.
To get rid of 'global_toolbox_factory' we, roughly, have to
* Replace 'global_toolbox_factory' with 'global_dock_factory'
everywhere. We can also get rid of lots of code that did special
things for the "toolbox" factory.
* Make the use or interaction with the toolbox explicit in some
places. For example, a function gimp_dock_window_has_toolbox() has
been introduced.
* Make GimpSessionInfoDock have an 'identifier' parameter so we can
differentiate between the "gimp-dock" and "gimp-toolbox" dock
types.
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.
Let dock windows have proper GimpDialogFactory entries. This allows us
to get rid of a lot of ugly mostly duplicated code. This also makes us
ready the merge the dock window and toolbox factories which will soon
be done. A few things should be noted:
* We adjust the wrap box aspect ratio in the toolbox to avoid having
the toolbox dock window explode
* We make sure that we still can handle sessionrc files from GIMP 2.6
and older
Instead of having one dock constructor per dialog factory, put entries
for the normal dock and the toolbox dock in the dock window
factory. To do this we also need to merge the dock and normal dialog
constructors into one function protptype.
This takes us one step closer to be able to merge the
global_dock_window_factory and the global_toolbox_factory into one.
The long term goal: Support multi-column dock windows with one of the
docks being the toolbox. In this situation we can't have the toolbox
dock created by a separate dialog factory, that is too messy.
Instead of having gimp_dialog_factory_set_put_in_dockables() with all
the cruft that leads to we can use the 'dockable' member on
GimpDialogFactoryEntry. This is a general strategy that the code base
is being moved in: try to keep information per-entry rather than
per-factory.
Change gimp_dialog_factory_set_constructor() to
gimp_dialog_factory_set_put_in_dockables() order to narrow the
interface a bit. We can make both
gimp_dialog_factory_set_put_in_dockables() and the
GimpDialogConstructor typedef internal this way.
The main reason we do this is because we want to get rid of a
dependency on factory->p->new_dock_func. Eventually we want to
construct docks just like we construct other widgets in the factory,
so new_dock_func will be removed.
Also improve readability of code such as making it explicit that
gimp_dialog_factory_put_in_dockable_constructor() is just an extended
version of gimp_dialog_factory_default_constructor().
Move all macros definitions at the top and decorate struct
initialization values with the corresponding member names. Also do
some whitespace adjustments.
Move the Image Selection Menu from GimpMenuDock to
GimpDockWindow. That is, if a dock window contains many docks then
they will share the same Image Selection Menu.
To do this we need to move around quite a bit of code. Move the
"context", "dialog-factory" and "ui-manager" properties from GimpDock
to GimpToolbox, GimpMenuDock doesn't need it any longer. Turn the
GimpDock getters for these properties into wrappers that go to the
GimpDockWindow properties. In some places, most notably GimpToolbox
construction, we use the GimpToolbox values of these properties, but
most of the time it works fine to just use the GimpDockWindow
properties. GimpDock::setup() and set/get_aux_info() have also been
moved to GimpDockWindow since the only aux info for docks was for the
image selection menu.
Also, we don't bother porting gimp_menu_dock_destroy() to
GimpDockWindow, but we leave the code around. If this is a problem, it
will show.
In places where the pattern
if (show)
gtk_widget_show (widget);
else
gtk_widget_hide (widget);
is used, change to
gtk_widget_set_visible (widget, show);
Also do some other minor cleanups.
Add a "allow-dockbook-absence" property to the GimpDockWindow which is
set to TRUE for the dock window for the toolbox so that it is not
kiled when the last dockbook is removed.
Make GimpDock be a GtkVBox instead of a GimpDockWindow. This means we
can now put a GimpDock anywhere, including inside an image window.
In order to do this we need to:
* Separate dock and dock window creation in the dialog factory and
add a couple of new dock window constructors
* Change gimp_dialog_factory_dock_new() to not only create a dock,
but also create a dock window and then combine those two
* Change the dock constructor to take a GimpUIManager since they
depend on that during their construction. We get the ui manager
from the dock window, but we can't create the dock *inside* the
dock window, we have to add the dock later. So we create the dock
window first and then pass its ui manager to the dock constructors
* Make some other minor adaptions, mostly with
gimp_dock_window_from_dock() and gimp_dock_window_get_dock()
Simplify the code a bit by replacing the 'toplevel_entry' and
'dockable_entry' members in GimpSessionInfo with a single
'factory_entry'. We compensate for this by adding a 'dockable'
gboolean to GimpDialogFactoryEntry.
Begin to consider GimpObject::name as private and always use
gimp_object_get_name(). Change gimp_object_get_name() to take an
untyped pointer so we don't have to do so awfully many casts. There is
a runtime check for the type inside the function anyway.
* app/core/gimpimage.[ch]: make the parent parameter public in
add_layer(), add_layers(), add_channel() and add_vectors().
* app/vectors/gimpvectors-import.[ch]: add parent parameters to
the vectors import functions.
* app/core/gimpchannelundo.[ch]
* app/core/gimplayerundo.[ch]
* app/vectors/gimpvectorsundo.[ch]
* app/core/gimpimage-undo-push.[ch]: remember the parent item when
removing layers, channels and vectors.
* app/actions/channels-commands.c
* app/actions/debug-commands.c
* app/actions/edit-commands.c
* app/actions/layers-commands.c
* app/actions/vectors-commands.c
* app/core/gimp-edit.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-quick-mask.c
* app/core/gimplayer-floating-sel.c
* app/core/gimpselection.c
* app/core/gimptemplate.c
* app/dialogs/file-open-dialog.c
* app/display/gimpdisplayshell-dnd.c
* app/text/gimptext-compat.c
* app/tools/gimptexttool.c
* app/tools/gimpvectortool.c
* app/widgets/gimptoolbox-dnd.c
* app/xcf/xcf-load.c
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/paths.pdb
* tools/pdbgen/pdb/vectors.pdb: pass NULL as parent item to above
functions and add FIXMEs all over the place because there is some
more hacking needed to make adding with index = -1 (on top of the
current item) work again.
* app/pdb/image-cmds.c
* app/pdb/paths-cmds.c
* app/pdb/vectors-cmds.c: regenerated.
* app/core/gimpimage-duplicate.c: duplicate the original image's
tree structure in the copy.
* app/widgets/gimpitemtreeview.[ch]: add parent to GimpAddItemFunc,
add utility function gimp_item_tree_view_get_drop_index() which
figures where to add something dropped to an item tree.
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c: changed accordingly, using above
new GimpItemTreeView API.