summaryrefslogtreecommitdiff
path: root/gtk/gtktextlayout.c
Commit message (Collapse)AuthorAgeFilesLines
* textview: Track differences between ink and logical rectsBenjamin Otte2016-03-211-4/+24
| | | | | | | This way, we can ensure that we queue redraws on the full ink rect. This is particularly visible for squiggly underlines in spell checking. https://bugzilla.gnome.org/show_bug.cgi?id=763741
* text view: Improve tag pointer trackingMatthias Clasen2016-02-101-15/+24
| | | | | | | | | A problem that has been observed in polari is that links in tags are clickable all the way into the margin. This problem is caused by gtk_text_view_get_iter_at_position ignoring the return value of pango_layout_xy_to_index. Instead, pass it back as a boolean return value. This is technically an API break, but we've allowed ourselves to change return types from void to gboolean before.
* Don't use g_slist_next in gtktextlayout.cMatthias Clasen2015-10-201-1/+1
| | | | We generally use ->next directly.
* Split off a private header for GtkTextBufferMatthias Clasen2015-10-151-0/+1
| | | | This avoids polluting the installed header with private symbols.
* text view: add padding and marginSebastien Lafargue2015-08-171-3/+14
| | | | | | | Add API to set top and bottom margins, and add the CSS padding from the theme to the programmatically set margins. https://bugzilla.gnome.org/show_bug.cgi?id=406159
* GtkTextView: Support font featuresMatthias Clasen2015-07-291-2/+10
| | | | | Add a ::font-features attribute to GtkTextTag, and support font features when inserting Pango markup into a text buffer.
* Fix a cornercase crashMatthias Clasen2015-05-281-1/+2
| | | | | | | | If gtk_text_layout_move_cursor_visually is called with a count of 0, we were passing NULL to a free function that can't handle it. Don't do that. https://bugzilla.gnome.org/show_bug.cgi?id=750058
* textview: add support for underline and strikethrough colorsChristian Hergert2015-03-171-3/+77
| | | | | | | | | | | | | | | | | | | | This commit adds the GtkTextTag:underline-rgba and :strikethrough-rgba properties and the necessary plumbing to apply these colors in GtkTextLayout. With this change, you can alter the color of underlines including those of type PANGO_UNDERLINE_ERROR. You might want to alter the underline color to differentiate between spelling and grammer mistakes. In code editors, it is convenient to differentiate between errors and warnings. Note that the GtkTextAppearance struct is public ABI and has no spare room for new fields, so we are resorting to some tricky packing to store the colors in the unused pixel field of the fg_color and bg_color structs. This packing is accomplished by the macros in gtktextattributesprivate.h. Signed-off-by: Christian Hergert <christian@hergert.me> https://bugzilla.gnome.org/show_bug.cgi?id=402168
* gtktextlayout: fix to quiet a warningSebastien Lafargue2014-12-181-1/+1
| | | | | | | Gcc complains about a possible use of a not initialised widget ref ( which can't happen in reality ) https://bugzilla.gnome.org/show_bug.cgi?id=741702
* gtktextlayout: fix for right margin with RTL textSebastien Lafargue2014-12-181-2/+4
| | | | | | | | | When a RTL paragraph is not set to wrap, the right margin is not respected because of the margins counted twice so we replace display->width by PIXEL_BOUND (extents.width), the same quantity without the margins. https://bugzilla.gnome.org/show_bug.cgi?id=741702
* GtkTextView: Add fallback and letter-spacing supportMatthias Clasen2014-12-041-0/+18
| | | | | | | Add support for the Pango attributes controlling font fallback and letter spacing to GtkTextTag. https://bugzilla.gnome.org/show_bug.cgi?id=740954
* GtkTextView: use GSliceSébastien Wilmet2014-07-201-1/+1
| | | | | | GSlice is better for allocating structs. https://bugzilla.gnome.org/show_bug.cgi?id=733407
* Deprecate GdkColorMatthias Clasen2014-05-221-0/+4
| | | | | It has been replaced by GdkRGBA. Time to make it official. http://bugzilla.gnome.org/show_bug.cgi?id=636695
* docs: use Returns: consistentlyWilliam Jon McCann2014-02-191-5/+5
| | | | Instead of Return value:
* docs: use apostrophes in *n'tWilliam Jon McCann2014-02-071-1/+1
|
* docs: use proper apostropheWilliam Jon McCann2014-02-071-4/+4
| | | | https://wiki.gnome.org/Design/OS/Typography
* gtk: Use new macros for defining private dataEmmanuele Bassi2013-07-091-4/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=702996
* textlayout: avoid double-free when adding preedit colorDaiki Ueno2013-07-091-0/+10
| | | | | | | | In add_preedit_attrs, don't free foreground/background colors already set in the underlying text attributes (style). They will be free'd by release_style. https://bugzilla.gnome.org/show_bug.cgi?id=703533
* Remove an unused private functionMatthias Clasen2013-05-051-39/+0
| | | | | _gtk_text_layout_get_line_xrange was not exported and not used inside GTK+ either.
* textlayout: respect preedit color attributeDaiki Ueno2013-01-311-6/+14
| | | | | | | gtk_text_renderer_prepare_run now checks appearance.rgba, rather than appearance.{fg_color,bg_color}. https://bugzilla.gnome.org/show_bug.cgi?id=692766
* Add custom va_marshallers in some placesAlexander Larsson2012-03-051-0/+2
| | | | This is a slight performance optimization in the common case.
* Change FSF AddressJavier Jardón2012-02-271-2/+1
|
* gtktextlayout: use g_slice for GtkTextLineDisplayIgnacio Casal Quinteiro2011-12-251-2/+2
|
* textlayout: cleanupIgnacio Casal Quinteiro2011-12-181-49/+47
| | | | Use g_clear_object, move unrefs to dispose and reorganize code
* Use gtk_text_layout_get_iter_at_linePaolo Borelli2011-12-181-21/+11
| | | | | We already have a gtk_text_layout_get_iter_at_line wrapper that takes care of getting the btree from the layout, we may as well use it.
* Remove useless get_iter_at_line calls.Paolo Borelli2011-12-181-14/+1
| | | | | No need to call _gtk_text_btree_get_iter_at_line right before calling totally_invisible_line, since it is the first thing it does itself.
* Rework GtkTextView cursor code.Paolo Borelli2011-12-011-50/+6
| | | | | | | | Move the handling of primary/secondary cursors to gtktextdisplay, which makes code simpler and more consistent to how GtkLabel and GtkEntry draw cursors, which is useful in preparation to further refactoring. https://bugzilla.gnome.org/show_bug.cgi?id=640317
* Added internal GdkRGBA support for GtkTextTag::paragraph-background-rgbaTristan Van Berkom2011-05-061-1/+9
| | | | | Added the remaining implementation bits for rendering paragraph backgrounds with rgba values and updated the test case.
* Added GdkRGBA properties to GtkTextTag.Tristan Van Berkom2011-05-061-2/+26
| | | | | | | | | | | | This now allows text view to render text with alpha values in the text foreground and backgrounds, the work is almost complete, currently the error-underline-color is still a GdkColor style property and since we use only GdkRGBA for rendering it needs to be converted and applied, probably a new rgba version of the style property should also be introduced. This commit adds tests/testtextview that must be run from the tests/ directory to show translucent text in action.
* gtktexttag: Move public members to private headerJavier Jardón2011-01-031-5/+5
| | | | And fix gail to not poke at GtkTextTag internals
* Get rid of unused shaped_object list in _GtkTextLineDisplayPaolo Borelli2010-11-021-7/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=631076
* Remove GtkObject completelyMatthias Clasen2010-09-261-1/+1
|
* Move GtkSizeRequest into GtkWidgetBenjamin Otte2010-09-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't make sense to keep them separate as GtkSizeRequest requires a GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have one without the other. It also makes the code a lot easier because no casts are required when calling functions. Also, the names would translate to gtk_widget_get_width() and people agreed that this would be a too generic name, so a "preferred" was added to the names. So this patch moves the functions: gtk_size_request_get_request_mode() => gtk_widget_get_request_mode() gtk_size_request_get_width() => gtk_widget_get_preferred_width() gtk_size_request_get_height() => gtk_widget_get_preferred_height() gtk_size_request_get_size() => gtk_widget_get_preferred_size() gtk_size_request_get_width_for_height() => gtk_widget_get_preferred_width_for_height() gtk_size_request_get_height_for_width() => gtk_widget_get_preferred_height_for_width() ... and moves the corresponding vfuncs to the GtkWidgetClass. The patch also renames the implementations of the vfuncs in widgets to include the word "preferrred".
* Use gtk_size_request_get_size() instead deprecated ↵Javier Jardón2010-09-131-2/+3
| | | | | | gtk_widget_get_child_requisition() Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629177
* Get rid of the rest of variables exported from libgtkTor Lillqvist2010-09-081-2/+2
| | | | | | | | | | | | | | | | | | | | Especially the gtk_*_type ones in gtktexttypes.h were mentioned in gtk.symbols presumably by accident. That header isn't even installed, so no way can they be supposed to be public. gtk_text_attr_appearance_type is from the installed but "semi-private" gtktextlayout.h, so drop that one too from gtk.symbols for now. The use of gtk_text_unknown_char_utf8 is bit of a mess. Code in a few files knew implicitly that it is three bytes. Define a symbolic name for the length of it instead. Add an exported function gtk_text_unknown_char_utf8_gtk_tests_only() that returns a pointer to it just for the sake of gtk/tests/textbuffer.c. Prefix the variable with an underscore. I doubt the usefulness of the test_utf8() in textbuffer.c. If it could be dropped, gtk_text_unknown_char_utf8_gtk_tests_only() could be dropped, too.
* API: Remove GtkTextTag's stipple propertiesBenjamin Otte2010-08-101-12/+0
| | | | | They seem pretty much unused and the only reason why GtkTextView uses a GdkPangoRenderer and not a PangoCairoRenderer.
* gtk/: fully remove gtkalias hacksJavier Jardón2010-07-101-4/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=623845
* [annotations] Add allow-noneJohan Dahlin2010-02-191-2/+2
| | | | | | | | This commit was created using a script that searched for all docstrings containing a parameter and the string 'or %NULL'. Gdk backends and demos excluded as they are not part of a public API https://bugzilla.gnome.org/show_bug.cgi?id=610474
* [introspection] Merge in Gtk-custom.c annotationsColin Walters2009-12-161-0/+10
| | | | | | | | The Gtk-custom.c file in gir-repository contained a number of introspection annotations. Merge those into the GTK source files. Some documentation was moved from the tmpl/ files to accomodate the addition of annotations.
* Handle child widgets correctly with multiple viewsMatthias Clasen2009-09-271-30/+33
| | | | This was broken by an RTL fix in April.
* Fix handling of child widgets in the presence of bidi textItay Perl2009-05-031-15/+35
| | | | | GtkTextLayout incorrectly assumed that pango iterates in logical order. Fixes bug 580814.
* Bug 567468 – no check for trailing != NULL inClaudio Saavedra2009-01-121-1/+2
| | | | | | | | | | | | | | | 2009-01-12 Claudio Saavedra <csaavedra@igalia.com> Bug 567468 – no check for trailing != NULL in gtk_text_layout_get_iter_at_position() * gtk/gtktextlayout.c: (gtk_text_layout_get_iter_at_position): Check for trailing to be non-NULL. * gtk/gtktextview.c: (gtk_text_view_get_iter_at_position): document that trailing may be NULL. svn path=/trunk/; revision=22090
* doc fixesMatthias Clasen2008-12-291-16/+16
| | | | svn path=/trunk/; revision=21987
* consistently chain up using GTK_FOO_CLASS(parent_class)->bar(instance)Michael Natterer2008-08-121-8/+5
| | | | | | | | | | | 2008-08-12 Michael Natterer <mitch@imendio.com> * gtk/*.c: consistently chain up using GTK_FOO_CLASS(parent_class)->bar(instance) instead of (*GTK_FOO_CLASS(parent_class))->bar(instance). svn path=/trunk/; revision=21085
* gtk/gtktext.c gtk/gtktextbuffer.c gtk/gtktextlayout.cSven Neumann2008-08-081-4/+4
| | | | | | | | | | | | | | | | | | | | 2008-08-08 Sven Neumann <sven@gimp.org> * gtk/gtktext.c * gtk/gtktextbuffer.c * gtk/gtktextlayout.c * gtk/gtktexttagtable.c * gtk/gtktextview.c * gtk/gtktipsquery.c * gtk/gtktoolbar.c * gtk/gtktoolitem.c * gtk/gtktreeitem.c * gtk/gtktreemodelfilter.c * gtk/gtktreemodelsort.c * gtk/gtktreeviewcolumn.c: use canonical signal names. svn path=/trunk/; revision=21045
* Revert name changeCody Russell2008-07-011-1/+1
| | | | svn path=/trunk/; revision=20724
* Practically everything changed.Cody Russell2008-06-301-1/+1
| | | | | | | | | | | | | 2008-06-30 Cody Russell <bratsche@gnome.org> * Practically everything changed. Change all references of GIMP Toolkit (and variations of it) to GTK+ Toolkit, showing no mercy at all to our beloved ancestry. (#540529) svn path=/trunk/; revision=20709
* Include "config.h" instead of <config.h> Command used: find -nameJohan Dahlin2008-06-221-1/+1
| | | | | | | | | | | | 2008-06-21 Johan Dahlin <jdahlin@async.com.br> * *.[ch]: Include "config.h" instead of <config.h> Command used: find -name \*.[ch]|xargs perl -p -i -e 's/^#include <config.h>/#include "config.h"/g' Rubberstamped by Mitch and Tim svn path=/trunk/; revision=20669
* gtk/gtkcontainer.c gtk/gtkexpander.c gtk/gtkframe.c gtk/gtklabel.cMichael Natterer2008-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 2008-02-06 Michael Natterer <mitch@imendio.com> * gtk/gtkcontainer.c * gtk/gtkexpander.c * gtk/gtkframe.c * gtk/gtklabel.c * gtk/gtkmain.c * gtk/gtkmenu.c * gtk/gtkmenuitem.c * gtk/gtkmenushell.c * gtk/gtknotebook.c * gtk/gtkseparatortoolitem.c * gtk/gtksocket.c * gtk/gtktextlayout.c * gtk/gtktoggletoolbutton.c * gtk/gtktoolbutton.c * gtk/gtktoolitem.c * gtk/gtktree.c * gtk/gtktreeitem.c: replace "foo && GTK_IS_FOO (foo)" by simply "GTK_IS_FOO (foo)". svn path=/trunk/; revision=19481
* Use gtk_text_buffer_get_insert instead of get_mark. Fixes Bug 497164.Paolo Borelli2007-11-171-9/+4
| | | | | | | | | | | | 2007-11-17 Paolo Borelli <pborelli@katamail.com> * gtk/gtktextbuffer.c: * gtk/gtktextlayout.c: * gtk/gtktextview.c: Use gtk_text_buffer_get_insert instead of get_mark. Fixes Bug 497164. svn path=/trunk/; revision=18997