Commit Graph

3207 Commits

Author SHA1 Message Date
Nelson A. de Oliveira c4588f1209 Bug 575911 - Add 'Rule of fifths' crop guide overlay
Implement a rule of fifths guideline for GIMP. See
http://markhancock.blogspot.com/2006/03/address-basic-composition.html
for more info.
2010-06-24 08:37:09 +02:00
Michael Natterer bbd4038e98 app: make sure all tool options widgets are properly destroyed
...and with them all references their widgets keep (which are a lot).

Take ownership of the widget after creating it, so it can be reliably
unrefed upon exit.
2010-06-23 22:48:53 +02:00
Michael Natterer 94e757df51 app: don't leak options->language; add finalize() to free it 2010-06-22 23:06:35 +02:00
Michael Natterer 170f0bed00 app: use a GimpOverlayFrame for the text style editor
so it gets round corners and doesn't look so old school.
2010-06-12 23:49:55 +02:00
Michael Natterer 434bfbd6fa app: rename GimpToolOverlay to GimpOverlayDialog
because it's only used by tools currently, but not related to them in
any way.
2010-06-03 22:32:30 +02:00
Michael Natterer a3b93151aa app: some #if 0'ed testing code I occasionally need for debugging
(so I don't have to constantly add/remove it, will get rid of it
before 2.8)
2010-06-03 22:16:08 +02:00
Michael Natterer 02b8eea086 app: restrict sample point drawing to the exposed region
With the same limitation as for guides in the last commit.
2010-05-02 15:58:51 +02:00
Michael Natterer 6e4be79bef app: restrict grid and guide drawing to the exposed region
Doesn't really clip yet for guide drawing, but at least doesn't bother
to draw them when they are outside the expose region's bounding box.
2010-05-02 15:40:11 +02:00
Alexia Death 06c1b290d0 app: Add tool preset editor to controll what elements get applied
I had to remove the asserrt in tool preset constructor, because with it
it wasnt possible to initalize an empty model object for the editor.
At init time the gimp object passed to the constructor is not yet available.
2010-04-24 17:55:54 +03:00
Michael Natterer 8d3a5099f8 app: turn a g_warning() into a g_return_if_fail() 2010-04-22 17:17:02 +02:00
Michael Natterer 5b28d04674 app: queue the draw timeout only if paused_count reaches zero 2010-04-22 17:15:08 +02:00
Michael Natterer 2f5d2bc85f Bug 616342 - gimp crashes on startup if you have a contextrc file from 2.6
Remove the draw timeout in GObject::dispose() to be safe.
2010-04-22 16:45:44 +02:00
Michael Natterer 56e4585f70 app: finally apply tool presets when one is seleced
currently respects the fact that FG/BG are always global and the
global brush,pattern,... settings from gimprc. This should probably
not change, but rather be overridable on a per-preset basis as
suggested.
2010-04-21 20:56:49 +02:00
Michael Natterer 94181ce538 app: don't overwrite all tool options' "tool" and "paint-info"
with bogus values from contextrc, we want them to always match the
tool option's type.
2010-04-21 20:43:27 +02:00
Michael Natterer d47aa2ba52 app: change to the preset's tool when a tool preset is selected
but don't set any tool options yet because that is a lot more tricky.
2010-04-20 20:11:37 +02:00
Michael Natterer 547c92d0f6 Bug 541586 - Tool options not saved/loaded correctly?
Don't overwrite the entire context part of all tool options with
values from contextrc, or we will end up with one tool option set to a
non-default values affecting all other tool options that were at their
default value in the next gimp session.
2010-04-18 12:47:18 +02:00
Michael Natterer 93645e9083 app: cosmetic cleanup 2010-04-01 22:29:08 +02:00
Michael Natterer 91cce1c81b app: add size control for text spans, does not work as expected yet 2010-03-28 21:38:31 +02:00
Michael Natterer d66b6134a0 app: micro cleanups 2010-03-20 22:25:58 +01:00
Alexia Death 69e28668a1 app: Tune redraw limit to sane bounds 2010-03-19 23:25:22 +02:00
Michael Natterer 08193e8b56 Limit the draw tool's redraw framerate to about 29 FPS using a timeout 2010-03-19 21:08:41 +01:00
Alexia Death 054bd341bd app: fix incomplete revert 2010-03-19 21:21:01 +02:00
Alexia Death 1e8ec625df Revert "app: Fix the code that disables outline to be a bit neater"
This reverts commit 58d82dcadc.
2010-03-19 21:21:01 +02:00
Alexia Death 656eb53aad Revert "app: Do not show brush outline when painting"
This reverts commit 031dc8e68a.
2010-03-19 21:21:01 +02:00
Michael Natterer f9e68fe0ee Fix undo when going back from a modified text layer to an editable one
My earlier change to using gimp_drawable_push_undo() here was a very
bad idea. Go back to using gimp_image_undo_push_drawable_mod(), but
make use of its new tile-copying feature so the problem that made me
do the earlier change is fixed too. See comments in the changed code.
2010-03-18 10:32:52 +01:00
Øyvind Kolås 63824d7153 app: use a blacklist instead of whitelist for gegl op categories
The set of core GEGL ops that GIMP does not want to see falls into a
well defined set of categories. Blacklisting allows freedom in choosing
new and better categorisation for GEGL ops.
2010-03-17 23:48:18 +00:00
Alexia Death 58d82dcadc app: Fix the code that disables outline to be a bit neater 2010-03-17 00:36:19 +02:00
Alexia Death 031dc8e68a app: Do not show brush outline when painting
It takes resourses and jsut gets in the way of seeing the real brush
2010-03-16 23:48:56 +02:00
Alexia Death bd2f852ac1 app: make off-canvas changes have effect on brush outline 2010-03-16 21:53:34 +02:00
Alexia Death 44a5a34d7e app: Make brush boundaries dynamic aswell 2010-03-15 02:55:15 +02:00
Alexia Death e85220f8f9 app: Add an option to explicity turn off airbrush rate
This was decided in a discussion with guiguru on irc
some time ago. However, one element is missing. The
rate slider needs to be disabled when motion only is
enabled, because it has no effect.
2010-03-14 17:28:08 +02:00
Alexia Death 861179b452 app: Rename so-called airbrush pressure to Flow
Top reasons for this are, that pressure is already
used as input for dynamcs and the fact that flow of
paint makes much more sense.
2010-03-14 17:23:49 +02:00
Michael Natterer 3e3613bef7 app: allow for more fine-grained baseline and kerning adjustments
In theory for now, by changing the parameters of
GimpTextProxy::change_baseline() and ::change_kerning()
from gint to gdouble.
2010-03-08 21:57:29 +01:00
Michael Natterer 98a2b0210f app: fix crash introduced by layout offset refactoring
Need to call gimp_text_tool_ensure_layou() in gimp_text_tool_draw()
explicitely now, because we don't redundantly call the
get_cursor_rect() function any more when there is a selection.
2010-03-07 17:34:49 +01:00
Michael Natterer a5409e2872 app: allow to pick text layers with the text tool
When the button_press is not in the currently edited text layer, and
not on any rectangle handle, try to pick a text layer.
2010-03-07 12:41:15 +01:00
Michael Natterer 6650693d29 app: move gimp_image_pick_layer() to its own file
and add a (still unused) text layer picking function.
2010-03-07 01:55:31 +01:00
Michael Natterer cda52f946c app: minor code cleanup (add local variable to improve readability) 2010-03-07 01:19:32 +01:00
Michael Natterer 2e5de8f6ab app: pass the cursor's PangoRectangle to gimp_draw_tool_draw_text_cursor()
and let the drawing function decide everything instead of doing some
cursor extents fiddling in the text tool.
2010-03-07 01:15:04 +01:00
Michael Natterer b9405d046a app: fix some corner cases in gimp_text_tool_button_release()
- request "click" releases instead of trying to detect them ourselves,
  but keep a minimum reasonable text layer size anyway (reduce it from
  20 to 3 pixels though).
- ignore RELEASE_CANCEL when selecting, we can't undo that yet.
- properly handle RELEASE_CANCEL when creating new lext layers (don't
  leave a dead overlay style editor around).
2010-03-07 00:53:32 +01:00
Michael Natterer a077d618ea app: no need any more to block drawing before non-text changes to the proxy 2010-03-07 00:21:51 +01:00
Michael Natterer 44f6d074a3 app: call gimp_text_tool_block_drawing() in proxy_notify()
so we also correctly handle non-text and non-markup changes (e.g. via
tool options). This is not exactly the right place to call
block_drawing(), but all places which change change the actual content
(and thus un-sync buffer and layout cursor posotions) already block
drawing before the actual buffer change happens.
2010-03-07 00:15:32 +01:00
Michael Natterer 2934095816 app: use gimp_text_layout_get_offsets()
instead of duplicating GimpTextLayout's positioning logic in two
different incomplete ways. Also gets rid of the unrelated offset
return values of gimp_text_tool_editor_get_cursor_rect().
2010-03-07 00:11:05 +01:00
Michael Natterer e9f85b3afc app: block text buffer signals around copying to the clipboard
so the copying doesn't produce an undo step. Same fix as applied
earlier in button_press().
2010-03-05 10:53:09 +01:00
Michael Natterer 076948b4b7 app: don't leave drawing blocked in the error case 2010-03-05 10:50:50 +01:00
Michael Natterer 5284c9c836 app: fix text tool drawing for good this time (hopefully)
Earlier I claimed that drawing would work now because we make sure
that buffer and layout are always in sync. This was nonsense. In fact,
we constantly ran into the sutiation where the buffer was modified,
and we were drawing with the previous layout. It's unclear why this
didn't cause drawing artifacts, but it did cause e.g. the cursor
temporarily jumping to the next position while editing in the middle
of text (especially visible at line ends).

Several underlying problems existed: first, we now modify the buffer
from outside the text tool (from GimpTextStyleEditor) where we can't
pause the tool; second, proxy changes are handled asymetrically
(property changes are queued and processed all together in an idle
function) so we can't pause/resume drawing across the entire operation
because it has many beginnings and only one end.

Therefore:

- add gimp_text_tool_block_drawing()/unblock_drawing(), where block()
  can be called as many times as needed, and a single unblock()
  enables drawing again. block() also clears the layout, because it
  served its purpose (it was just used to pause drawing, and we know
  the buffer will change, so kill it).
- connect to GtkTextBuffer::begin-user-action and call block() from
  the callback, so we undraw stuff and kill the cached layout before
  any buffer change happens.
- call unblock() at the end of gimp_text_tool_apply() because then
  the text and the buffer are in sync again, the tool is undrawn and
  we can safely create the layout again to draw our stuff.
- also call block()/unblock() from some other places, like when a
  new text layer is created.
- get rid of *all* calls to draw_tool_pause()/resume() around buffer
  modifications, they are not needed any longer.
- add calls to begin/end_user_action() where they were missing.
2010-03-04 23:47:23 +01:00
Michael Natterer e54a05f78f app: get rid of gimp_text_tool_idle_apply()
and make gimp_text_tool_apply() itself the idle function. Might seem
like a bad idea, but is needed by an upcoming drawing refactoring.
2010-03-04 23:10:23 +01:00
Michael Natterer bbd2d521f1 app: rename "spacing" to "kerning" because that's what it does 2010-03-03 10:48:42 +01:00
Michael Natterer 080f1a6ce4 app: fix editing text layers which don't contain markup
In gimp_text_tool_connect(), set either text *or* markup on the
buffer, or the latter will always override the former (now that text
and markup are mutually exclusive in GimpText).
2010-03-03 01:15:27 +01:00
Michael Natterer 9a9d7489d1 app: make undo compression in the text tool work again
- in GimpText, make "text" and "markup" mutually exclusive, so that
  whenever one is set to non-NULL, the other is cleared automatically.
- add gimp_text_buffer_has_markup() which returns TRUE if any char
  in the buffer is tagged.
- in the text tool, only set "markup" on the text proxy if there is
  actually markup in the buffer, and set "text" otherwise.

This way we don't push "text" *and* "markup" undos on each keystroke,
and undo compression works the way it did before.
2010-03-02 21:54:24 +01:00
Michael Natterer 9c4864e789 app: optimize away redundant and expensive text layer re-rendering
- Add signal GimpText::changed() and emit it from
  GObject::dispatch_properties_changed() after all notifications have
  been emitted, so "changed" is emitted only once for any number of
  properties set within a g_object_freeze/thaw_notify() pair.
- Connect GimpTextLayer to "changed" instead of "notify" so we aviod
  lots of expensive re-rendering when multiple properties are set
  at once.
- Connect GimpTextTool to "notify" *and* "changed", and move some
  common code to the "changed" callback (e.g. we don't need to
  re-frame the item for each set property).
2010-03-02 17:44:31 +01:00
Michael Natterer 6d4f2c3431 Bug 565001 - Text-Tool crashes when edit a 2.4.2 version xcf
Need to convert to text->box_unit, not text->unit.
2010-03-02 15:24:17 +01:00
Michael Natterer 1fb61b8515 app: make sure mouse-selecting doesn't push an undo step
GtkTextBuffer emits "end-user-action" after something has been copied
to the clipboard. Work around that bug.
2010-03-02 13:04:37 +01:00
Michael Natterer 78ea82df1f app: simplify mouse selection by using iters instead of indices
This also removes the evil code dupication added yesterday, and is
generally less and cleaner code.
2010-03-02 12:23:29 +01:00
Michael Natterer aeac58089b app: add a font selector to the text style editor
Selects fonts just fine, but has no effect on the text yet.
2010-03-02 00:12:27 +01:00
Michael Natterer f214b4f9b7 app: oper_update(): if we are not in proximity, set the function to DEAD
so all hovering is undrawn. oper_update() is called with proximity ==
FALSE when the pointer leaves the canvas, either to the outside or
into an overlay widget, so this is exactly the right thing to do (and
is probably missing from a lot of other tools too).
2010-03-01 23:34:52 +01:00
Michael Natterer 8a1a19fc32 app: argh forgot one more place
Time for a refactoring that pulls the forgotten code into one common
place.
2010-03-01 21:39:26 +01:00
Michael Natterer 3d1f677b4f app: fix cursor placement and selecting by mouse when there is manual kerning
Forgot to convert the layout coords to buffer offsets functions when
porting everything to the new iter/index conversion functions in
GimpTextBuffer.
2010-03-01 21:19:08 +01:00
Michael Natterer f8ac0c61ab app: make manual kerning / character spacing work
Add gimp_text_buffer_get_iter_at_index() which does the reverse thing
than the already existing function gimp_text_buffer_get_iter_index().
Use the new function when cursor-navigation lines. Add "gboolean
layout_index" to both functions, which if TRUE indicates that the
passed in/out index is an index into the PangoLayout's content rather
than the text buffer's. When dealing with layout indices, take into
account the additional characters we insert into the serialized markup
(and thus the layout) for each character that is tagged with spacing.
2010-03-01 16:27:34 +01:00
Michael Natterer ff50b52c72 app: use gtk_text_buffer_delete_interactive()
instead of just gtk_text_buffer_delete() so "end-user-action" is
emitted and everything is updated.
2010-03-01 16:03:48 +01:00
Martin Nordholts 11b1300b6f app: Introduce gimp_dialog_factory_get_singleton()
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.
2010-02-28 23:23:24 +01:00
Martin Nordholts 947e28596f app: Remove gimp_dialog_factory_from_name()
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.
2010-02-28 20:02:45 +01:00
Michael Natterer 783e04013a app: make letter spacing work when there is no selection 2010-02-28 17:56:20 +01:00
Michael Natterer 9af58d8c43 app: remove redundant call to gimp_text_buffer_set_text() 2010-02-28 17:19:36 +01:00
Michael Natterer 65216b939d app: group text buffer changes by user actions
Use gtk_text_buffer_begin_user_action() and end_user_action() to group
all text buffer operations triggered by a single editing operation.
Connect to the buffer's "end-user-action" signal instead of to
"changed", "apply-tag" and "remove-tag" separately, so we only update
the text proxy once per user editing.
2010-02-28 17:15:06 +01:00
Michael Natterer 84d33e4316 app: make image-coords overlay widgets work fine at any zoom factor
Add anchor and spacing parameters to the shell overlay API, so
overlays can be positioned on each side of a point in image space,
with configurable spacing in display space.
2010-02-28 14:48:47 +01:00
Michael Natterer 1c8b01f012 app: make the text style editor aware of the image's resolution
Needed for adding proper text size controls.
2010-02-28 14:20:56 +01:00
Michael Natterer d88949547d app: make the change_spacing() call only act on the cursor position
if there is no selection, instead of on the rest of the buffer.
2010-02-28 13:58:08 +01:00
Michael Natterer 8399eefc95 app: make sure the text style box is repositioned on *each* rectangle change 2010-02-28 13:49:51 +01:00
Alexia Death 45c835aaa2 app: Add API to remove all background curves from the curve view
Also, use this change in cuves tool.
2010-02-27 19:22:48 +02:00
Michael Natterer 1e26bb1348 app: support baseline changing via Alt+Up and Alt+Down
Add a list of available baseline tags to GimpTextBuffer and
automatically create baseline tags as needed. They get serialized as
<span rise="value">, so add attribute and value parameters to the
buffer's tag_to_name() and name_to_tag() functions. Properly managing
the rise's amount is a TODO, currently each keystroke changes the
baseline by 1024 pango units, which might be whatever depending on the
output grid.
2010-02-27 18:00:39 +01:00
Michael Natterer 4171d9c774 app: add signals bindings to change baseline and spacing
Bind them to Alt+up/down/left/right and connect to the signals in
the text tool editor. The callbacks do nothing yet.
2010-02-27 13:14:28 +01:00
Michael Natterer 9766f65132 app: almost fix changing layers
Still leaves artifacts, but it's much better than before.
2010-02-26 21:22:10 +01:00
Michael Natterer 8af94be7a0 app: move the style overlay a few pixels
so it intersects less with the rectangle handles.
2010-02-26 19:56:53 +01:00
Alexandre Prokoudine b040220ebc Marked forgotten user visible message for translation 2010-02-26 04:36:50 +03:00
Michael Natterer 6c556698e5 app: add gimp_text_buffer_insert() and use it
Does nothing special yet, but will soon apply the currently active
tags to the inserted text.
2010-02-26 02:34:01 +01:00
Michael Natterer ebfbc5a030 app: make sure the style editor moves with the text layer 2010-02-26 02:10:03 +01:00
Michael Natterer c0358d8122 app: restore text box moving functionality, it got lost a few commits back 2010-02-26 01:57:51 +01:00
Michael Natterer 9cff2365b1 app: enable editing text styles
- create a GimpTextStyleEditor on the canvas when editing text.
- sync "text" and "markup" between proxy and text, not only "text.
- connect to chages to text marks on the buffer.
2010-02-26 01:36:31 +01:00
Michael Natterer dbe54e3f05 app: rename GimpTextTool::text_buffer to just ::buffer 2010-02-25 17:49:33 +01:00
Michael Natterer 0b4bdc5613 app: add GimpTextBuffer, a GtkTextBuffer subclass
Pull all text buffer utility functions as methods and use
GimpTextBuffer all over the place instead of GtkTextBuffer.
Some actually usefuly features coming soon...
2010-02-25 17:41:10 +01:00
Michael Natterer 261bb2c598 app: configure the IM overlay's opacity explicitely 2010-02-24 01:37:15 +01:00
Michael Natterer 97db8b9b42 app: add function gimp_text_tool_editor_get_iter_index()
which returns the byte index at a GtkTextIter, and use it all over the
place.
2010-02-24 00:18:50 +01:00
Michael Natterer 14158b982a app: clean up comments 2010-02-24 00:03:15 +01:00
Michael Natterer a17ede4ce0 app: fix crash caused by bogus value of text_tool->selecting
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.
2010-02-23 23:46:09 +01:00
Michael Natterer f9bee0d42f app: fix XOR cursor drawing artifacts
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.
2010-02-23 23:22:03 +01:00
Michael Natterer 088368079c app: make the coordinates display in the curve view configurable
Add API for X and Y ranges, default to 0.0..1.0 and configure the view
for 0..255 in the curves tool.
2010-02-23 11:39:35 +01:00
Michael Natterer 6224e3d5f7 app: pause/resume the draw tool at some more reasonable places 2010-02-23 10:27:35 +01:00
Michael Natterer a66cc1639b app: i hate unsigned integers 2010-02-21 23:36:25 +01:00
Michael Natterer 7c63af506e app: don't "fix" the extents of filled rectangles and circles
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.
2010-02-21 20:41:48 +01:00
Michael Natterer b6db793e6f app: remove the old selection code, the new one works now and is correct 2010-02-21 20:41:17 +01:00
Michael Natterer 51dc42bdd9 app: use the line's y coords for selection rendering, not the char's
so the selection rectangles have a least the same height.
2010-02-21 20:25:17 +01:00
Michael Natterer 4ec38099e5 app: render the selection char-by-char
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.
2010-02-21 20:11:13 +01:00
Michael Natterer 4295b1712c app: keep the "use-editor" setting consistent
When the editor is closed explicitely, set "use-editor" to FALSE
2010-02-21 18:59:51 +01:00
Michael Natterer 3befe0df59 app: #include "libgimpbase/gimpbase.h" 2010-02-21 17:35:04 +01:00
Michael Natterer 0908e53148 app: use the new unit conversion functions
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.
2010-02-21 16:46:39 +01:00
Michael Natterer 41a277f040 Bug 565001 - Text-Tool crashes when edit a 2.4.2 version xcf
Convert the rectangle size from pixels to units before setting it as
box-width and box-height on the text object.
2010-02-21 14:33:33 +01:00
Michael Natterer f13204e0a4 app: fix the transition to modified text layer and back
- 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.
2010-02-21 12:04:19 +01:00
Michael Natterer 5150f3c8f6 app: when connecting the text object, also set its text on the buffer
and don't do it in editor_start(), which caused an undo to be pushed.
2010-02-21 02:00:57 +01:00
Michael Natterer a6ca7e184c app: more text tool
- 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
2010-02-21 01:39:38 +01:00
Michael Natterer 9a3dbbb6ef app: consistent IM callback names 2010-02-20 23:33:58 +01:00
Michael Natterer b5b6d37742 app: move the entire mouse-selection apparatus to gimptexttool-editor.[ch] 2010-02-20 23:20:18 +01:00
Michael Natterer 75f7e25e3a app: don't call update_layout() from buffer_changed()
because the layout gets updated anyway when the model changes, and the
buffer is not the model, its changes are applied to the model.
2010-02-20 22:48:51 +01:00
Michael Natterer 6c3e385cac app: fix line navigation for lines that are not left-aligned
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.
2010-02-20 22:18:38 +01:00
Michael Natterer e91f27a0fd app: simplify selection drawing a lot 2010-02-20 22:11:06 +01:00
Michael Natterer bd151ac84e app: add background curves when editing the R, B or G curve
Show the other two RGB channels in the background.
2010-02-20 20:32:19 +01:00
Michael Natterer 42de0453da app: when disconnecting from the text layer, also empty our text buffer
or the remaining text will be added to the next text layer which is
created.
2010-02-20 19:43:17 +01:00
Michael Natterer 487336fc09 app: remove gimp_text_tool_update_proxy()
and move its code into gimp_text_tool_buffer_changed() which was its
only caller.
2010-02-20 19:31:27 +01:00
Michael Natterer c91b026384 app: re-add gimp_text_tool_editor_get_text()
Return the entire buffer and use it in even more places than before to
get rid code duplication.
2010-02-20 19:25:07 +01:00
Michael Natterer ec0f3bdcb8 app: buncha more text tool fixes
- hide the generated "empty" menu item in the IM submenu
- pause/resume the text tool around all selection/cursor/buffer changes
  (fixes most drawing artifacts)
2010-02-20 16:18:41 +01:00
Michael Natterer 2e0f4e8938 app: make the preedit overlay better readable (text/base instead of fg/bg) 2010-02-20 15:37:54 +01:00
Michael Natterer 4704c18739 app: implement IM preedit using an overlay widget
This has several advantages:

- it's always readable, no matter how sick font/colors are.
- it does not mess up the buffer, which is a model that should not
  contain temporary edit states.
- preediting does not clutter undo.
- it fixes the remaining bugs in the old preediting code because that
  code is completely gone now.
2010-02-20 15:15:53 +01:00
Martin Nordholts 8b458fb591 app: Merge "toplevel" and "dock" dialog factories
Merge "toplevel" and "dock" dialog factories. The end goal is to have
only one dialog factory.
2010-02-20 09:28:26 +01:00
Michael Natterer a8a732f753 app: fix IM context reset
- Reset the IM context in much more situations, like on button_press
  and when the text editor is initialized and halted (pretty much what
  GtkTextView does).
- As a consequence, halt the rectangle text tool after the text tool
  in control() because cancelling the IM preedit might cause a
  re-framing of the layer because it resized.
- pause()/resume() the draw tool around gimp_text_tool_halt() so we
  definitely avoid drawing atrifacts when the text tool is shut down
  in the middle of an IM preedit. That pause/resume pair should have
  been there from the beginning actually.
2010-02-19 20:13:25 +01:00
Michael Natterer a8548fa7fd app: remove member text_tool->preedit_len
because it is always strlen(text_tool->preedit_string)
2010-02-19 20:13:24 +01:00
Michael Natterer 99b3af1cd2 app: re-frame the layer on each text change
because just about any text change can also change the text layer size.
2010-02-19 20:13:22 +01:00
Michael Natterer 5feec1dd9f app: some signal handling/updating fixes that also make undo mostly work
- most importantly, when the text changes and we set the buffer (as
  happens when undoing), block the "changed" signal on the *buffer*
  and not on the proxy (which doesn't even have a "changed"
  signal). This was apparently something that happened during the
  on-canvas editor merging.
- don't update the proxy when the layout changes, that's the wrong way
  around. Instead, update the layout whenever the proxy changes,
  remove lots of calls to update_layout() from the text editor and let
  the "changed" callback on the buffer do its job of updating
  everything.
2010-02-19 20:13:21 +01:00
Michael Natterer 92ba7b262a app: remove "return" at the end of a void function 2010-02-19 20:13:19 +01:00
Michael Natterer 21e2462b2c app: only resize the text layer if the rectangle size has actually changed
Like when the user just clicked a handle and didn't actually move it.
2010-02-19 20:13:18 +01:00
Michael Natterer 9f03c457e1 app: no reason to translate the newly created text layer
because a few lines up we set its offsets correctly before adding it
to the image.
2010-02-19 20:13:17 +01:00
Michael Natterer e4d63ce11a app: don't create new text layers on double and triple clicks 2010-02-19 20:13:16 +01:00
Michael Natterer c69459f13e app: adapt button_release() to the new realities
Like that we start selecting on the very first click on an unframed
text layer alreadyand that we ignore clicks in dead space which had
unexpected results before. Also update all comments and move them
into the function.
2010-02-19 20:13:14 +01:00
Michael Natterer 7e3b090c32 app: request and process key_release events
Feed them into the text editor's IM context and into the proxy text
view's key bindings. Fixes input methods (e.g. entering of unicode
sequences seems to work flawlessly now).
2010-02-18 20:50:37 +01:00
Michael Natterer c0aa4498d2 app: add intrastructure to send key_release events to tools
The code is 100% identical to the key_press handling and simply
dispatches key_release events too tools which selected them via
GimpToolControl.
2010-02-18 20:50:11 +01:00
Michael Natterer e616ebad4d app: move tons of code out of the line iter loop
when drawing the selection and preedit underline (there is no reason
to calculate constants again for each line)
2010-02-18 20:16:11 +01:00
Michael Natterer becc85683c app: remove "mark_set" callback
There is no reason to recreate the layout when the cursor or selection
bound move, so remove the entire callback and all the signal
blocking/unblocking.
2010-02-18 19:53:44 +01:00
Michael Natterer fa6e9e6653 app: avoid to do things twice when double or triple clicks arrive
In button_press(), don't frame the item again and switch to selecting
mode on double and triple click events, we already did that when
receiving the normal button-press. Also clarify a comment.
2010-02-18 19:44:52 +01:00
Michael Natterer 051deba82d app: more minor cleanups 2010-02-18 11:47:16 +01:00
Michael Natterer 2ca9aab14c app: get rid of one indentation level in gimp_text_tool_motion() 2010-02-18 11:34:08 +01:00
Michael Natterer 3d0f2d8d1b app: clean up text editing members of struct GimpTextTool 2010-02-18 09:51:45 +01:00
Michael Natterer 5c9b660c24 app: turn text editing debug spew into proper GIMP_LOG() output 2010-02-18 09:39:25 +01:00
Michael Natterer 5794041ceb app: turn off clipping for the text cursor and the preedit strings
so they are visible also when partly out-of-layer.
2010-02-18 09:27:08 +01:00
Michael Natterer 468ea629a6 app: use image and rect_tool utility functions instead of duplicating them
and some random cleanups
2010-02-18 09:13:27 +01:00
Michael Natterer 838f2d567d app: cleanup 2010-02-17 21:39:33 +01:00
Michael Natterer 8f27ec48c6 app: split the text editor code out to a separate file 2010-02-17 21:24:09 +01:00
Martin Nordholts 50ef39a01f app: Make gimpgegltool.c compile 2010-02-17 20:45:20 +01:00
Michael Natterer 31659758d1 app: do the setting of the text box mode properly
- remove the button again.
- add a "box-mode" property to GimpTextOptions and a combo box.
- let the normal options -> proxy -> text mechanism do the setting.
- make sure we update the rectangle in some more situations.
- add utility function gimp_text_tool_frame_item().
2010-02-17 20:28:13 +01:00
Michael Natterer d28ed195a3 app: make the "Dynamic Text Box" button insensitive by default 2010-02-17 20:28:13 +01:00
Sven Neumann dbae9c58a0 Bug 610282 - GEGL Operation tool's help-id
Assign a help ID to the GEGL tool.
2010-02-17 19:23:10 +01:00
Michael Natterer 2dc577d606 app: clean up the text options notify callback 2010-02-17 16:05:45 +01:00
Michael Natterer 8574f4c4e8 app: allow to set the text layer back to dynamic resizing
Add a "Dynamic Text Box" button to the tool options which sets the
text box' mode back to dynamically resizing with the text.  This badly
needs UI review but is at least possible now.
2010-02-17 15:50:03 +01:00
Michael Natterer 9974fe36d1 app: improve cursor movement by positions when there is a selection
Port over the patch I did for GtkTextView and move *to* the end of the
selection and not *from* it when there is a selection and we are
moving by characters.
2010-02-17 13:17:46 +01:00
Michael Natterer 3efd20de77 app: move gimp_text_tool_set_layer() to the public functions 2010-02-17 13:08:53 +01:00
Michael Natterer dd1ec8ff9d app: rename editor related functions
so the on-canvas editor's functions are just called "editor" because
it's the default and the dialog's functions are called "editor_dialog".
2010-02-17 12:03:18 +01:00
Michael Natterer 94d9dca2a3 app: more text tool fixes
- bail out and don't warn like crazy in draw() when there is no text.
- fix crash in button_press() when clicking a modified text layer
  bring up the confirm dialog and thus didn't set text_tool->text.
- pull setting the right text on text_tool->text_buffer into
  gimp_text_tool_canvas_editor() (fixes editing after confirming a
  modified text layer edit).
- add lots of missing calls to gimp_text_tool_set_layer() so the
  tool will actually start editing.
2010-02-17 11:57:32 +01:00
Michael Natterer 1fa6497922 app: don't try to hide a NULL transform dialog 2010-02-17 09:52:15 +01:00
Michael Natterer c2a8f51768 app: lots of text tool fixes
- Add gimp_text_tool_halt() to shut down the tool and call it
  from gimp_tool_control(HALT).
- call control(HALT) when escape is pressed to reset the tool
  (can finally switch to other tools again now).
- fix button_press() to handle clicks on already existing
  text layers well.
- also button_press(): fix the condition that sets the previously
  existing text on the canvas editor so we don't end up with weird
  ui states where displayed and internally used text differ.
- remove some redundant code.
2010-02-16 22:48:27 +01:00
Simon Budig 7bfa3272ab Give a hint what pressing shift over a vector handle does. 2010-02-09 23:21:42 +01:00
Michael Natterer 09c897262e Move all undo-related members to GimpImagePrivate
Also add some new API to access them.
2010-02-04 20:06:49 +01:00
Michael Natterer b6ce5d075d Remove macros SCREEN_XRES() and SCREEN_YRES()
and add gimp_display_shell_get_screen_resolution() instead. The times
when these macros were used in inner loops have long passed.
2010-02-03 19:50:46 +01:00
Michael Natterer 08b7709535 Bug 604820 - GEGL Operation "path" crashes GIMP
Blacklist "gegl:path".
2010-01-31 17:36:56 +01:00