When font, size or color were changed, set the text buffer's current
insert_tags just as we already do for the bold, italic etc. toggle
buttons. Changed gimp_text_style_editor_list_tags() to also return
the tags for font, size or color.
One possible way to decrease the incompatibilities
between letter spacing in a tagged gtk_text_buffer
and in an equivalent pango_layout
Remove also a valgrind reported invalid write in
gimptextbuffer.c
Change the generated tag names to use #rrggbb notation and compare the
colors on an 8 bit basis to make sure the comparison and the tag names
exist in the same set of values (otherwise the text buffer gets into
an inconsistent state that can even lead to crashes).
and also #define the names of the properties we (ab)use, so we don't
have to use magic strings all over the place, and we don't have to use
g_object_get() either.
- 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.
Instead, keep a list of tags to explicitely remove around (the list of
unchecked toggles), and remove only these tags, so the tags that have
no widget in the UI are not affected by the insert_tags logic.
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.
because it breaks the invariant that the pango layout used for
navigating in the on-canvas editor must be a 1:1 view on the text
buffer used for editing. Will have to fix that somehow...
The copy doesn't do anything yet, but this will enable us to do
transformations on the buffer contents before turning them into
markup, and the other way around.
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.
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.
instead of using the toggles only to change the style of selected text.
Introduces a list of "insert tags" in GimpTextBuffer that is applied
on newly inserted text if it exists. Clear the list on each content
or cursor/selection change, so we always display wthe style at the
cursor unless the buttons were clicked explicitely.
- keep around tags for styles in GimpTextBuffer. For now only bold,
italic, underline and strikethrough.
- add GimpTextStyleEditor, a widget which allows setting tags on
a GimpTextBuffer's selection.
- add serialize/deserialize code to/from pango markup using
GtkTextBuffer's rich text (de)serialization infrastructure.
Doesn't produce or handle <span> yet.
Pull all text buffer utility functions as methods and use
GimpTextBuffer all over the place instead of GtkTextBuffer.
Some actually usefuly features coming soon...