Pull all text buffer utility functions as methods and use
GimpTextBuffer all over the place instead of GtkTextBuffer.
Some actually usefuly features coming soon...
Add a "hide-docks" config and connect the Windows->Hide docks menu
item to it. Also connect the image window to the config property so it
can hide/show its docks when it needs to.
Also add and use a utility function
gimp_image_window_keep_canvas_pos() to ensure that the image in the
window remains fixed when toggling visiblity of docks. One problem:
When GimpDrawTool is active on the canvas, there is flicker. The end
position is correct though.
Also add regression testing for this fix to test-ui.c
Update image window side docks visiblity from the image window itself
instead of from the ui configurer. The image window has a dependency
to the config object anyway, so no need to complicate things.
Set "selecting" to TRUE only when we are definitely in selecting mode
(when there is actually a text layer to click on). This commit also
makes the setting of the "selecting" state much simpler and obvious.
Switch to a completely new PangoLayout managing stategy: The drawing
code relies on text_tool->layout being a view on text_tool->text_buffer,
if they get out of sync, drawing is b0rk.
Therefore, split the update_layout() function into clear_layout()
(which kill the layout) and ensure_layout() (which creates the layout
if it doesn't exist).
Whenever the buffer gets modified, pause the draw tool before the
modification so the old cursor/selection undraw, then clear the
layout. Resuming the draw tool will automatically re-create the layout
for the buffer's new contents.
Also switch off any clipping for cursor and selection, so we can at
least see that our input has some effect, even if we don't actually
see the edited text because it's out-of-layer.
Apply the fix for Xlib evilness (non-filled rectangles and circles are
drawn one pixel larger) only for non-filled things, filled drawing is
right by default.
so it's correct for all kinds of mixed text directions. Still looks
like crap because all the rectangles are separate, but should be
logically correct now.
and get rid of the brainfuck idea that app/ has to use _gimp_unit_foo()
functions, passing a gimp pointer. Instead, simply use the libgimpbase
API all over the place. Should we ever allow more than one gimp instance,
they will simply have to share one unit database.
- when the layer becomes modified, completely shut down the text tool
completely instead of leaving it in some bastard hybrid
half-attached state.
- when re-editing a modified layer (like after confirming the edit in
the dialog), push a *drawable* undo, not a drawable_mod undo because
the latter only refs the layer's tiles and doesn't copy them, so when
the text layer re-render happens to not change the layer's size, it
would overwrite the modified pixels without any chance of ever going
back.
Unrelated:
- in button_press(), fix my recent fix for the condition that triggers a
mouse-select and set the "seleting" state to FALSE when the
condition is not met.
- in confirm_response(), don't check if the proxy exists because its
existence is an invariant.
- drop the layout in gimp_text_tool_halt()
- reinitialize the tool completely when clicking another display
- therefore, have to recreate the layout in button_press() instead
of bailing out if it doesn't exist
Add Windows→Hide docks menu item. We don't remove the hardcoding of
having Tab trigger it though, because gtk_accelerator_valid() returns
FALSE for GDK_tab. This means that if the user changes keyboard
shortcut for the menu item, both the user shortcut and the hardcoded
shortcut will work. We remove gimp_dialog_factories_toggle() and make
clients activate the action instead to toggle dock visibility.
Take the X position of the lines into account when navigating up and
down by lines, so we end up at the right x-pos also for centered and
right-aligned lines.