summaryrefslogtreecommitdiff
path: root/gtk/gtktextdisplay.c
Commit message (Collapse)AuthorAgeFilesLines
* textview: Replace pixbufs by texturesMatthias Clasen2017-11-291-6/+12
| | | | | | | | This affects a few apis, such as gtk_text_iter_get_pixbuf, gtk_text_buffer_insert_pixbuf and GtkTextBuffer::insert-pixbuf, which have all been replaced by texture equivalents. Update all callers.
* textview: Make the semi-private headrs really privateBenjamin Otte2017-11-111-2/+1
| | | | | | Rename the files to have the private.h ending. And remove gtktextdisplay.h from the installed files.
* textdisplay: Remove widgets parameter from gtk_text_layout_drawTimm Bäder2017-10-101-15/+3
| | | | All calls in gtk+ were passing NULL anyway.
* gtktextdisplay: remove unused codeNelson Benítez León2017-06-051-9/+0
| | | | | | | In render_para() function, which is called for every text line that needs to be drawn. https://bugzilla.gnome.org/show_bug.cgi?id=783397
* Use GdkRGBA for text attributesMatthias Clasen2016-11-011-18/+7
| | | | | | Now that GtkTextAttributes is private, we can clean this struct up a bit. The first step is to switch from GdkColor to GdkRGBA, and adapt all users.
* Remove some more GdkColor propertieswip/baedert/boxTimm Bäder2016-10-201-25/+2
|
* Add private header for GtkTextViewEmmanuele Bassi2016-10-171-3/+1
| | | | | This allows us to declare the symbols that are currently used inside gtktextdisplay.c without incurring in the wrath of the compiler.
* API: stylecontext: Remove state argument from gettersBenjamin Otte2016-10-161-7/+5
| | | | The argument must always be the current state.
* text view: Improve text renderingMatthias Clasen2015-11-101-13/+15
| | | | | | | Use the text CSS node for rendering text, and the selection node for rendering selected text, avoid gtk_style_context_save, update states of all CSS nodes, and use the proper states when querying style properties.
* textview: Use a CSS node for selection renderingMatthias Clasen2015-11-101-9/+7
| | | | | | | Use a CSS node with name selection, like we do for entries and labels. Unlike those widgets, we currently don't user gtk_render_background, but just use the background color. That will require more effort.
* textdisplay: save/restore when using different state flagsBenjamin Otte2015-11-091-3/+8
| | | | | Also, never use gtk_widget_get_state_flags() when we want gtk_style_context_get_state()
* Don't use g_slist_next in gtktextdisplay.cMatthias Clasen2015-10-201-1/+1
| | | | We generally use ->next directly.
* GtkTextDisplay: Use pango renderer alpha supportMatthias Clasen2015-08-141-12/+27
| | | | | We don't need to store our own copy of the colors anymore, now that PangoRenderer can do alpha.
* textview: add support for underline and strikethrough colorsChristian Hergert2015-03-171-2/+19
| | | | | | | | | | | | | | | | | | | | 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
* gtktextdisplay: Optimize GtkStyleContext usageJasper St. Pierre2014-11-261-1/+5
|
* stylecontext: Deprecate functionsBenjamin Otte2014-10-031-0/+4
| | | | | | | | | | | - gtk_style_context_get_background_color() - gtk_style_context_get_border_color() Those functions shouldn't be used anymore, because they don't represent anything from the CSS styling we support. The background color often isn't used due to background images and there are actually 4 different border colors (1 for each side) - if there isn't also a border image in use.
* Deprecate GdkColorMatthias Clasen2014-05-221-0/+2
| | | | | It has been replaced by GdkRGBA. Time to make it official. http://bugzilla.gnome.org/show_bug.cgi?id=636695
* gtk: Add get_type() function declarations for private objectsBenjamin Otte2012-10-021-0/+2
| | | | | | | | | I'm adding a bunch of fixes for gcc complaining about -Wmissing-declarations. This set of patches makes private classes in gtk/*.c that use G_DEFINE_TYPE() safe by adding definitions for the get_type() function that can't be made static.
* Revert part of "textview: Remove extra magic for drawing children"Benjamin Otte2012-04-101-4/+21
| | | | | | | | | | This partially reverts commit df37446f9b4116887865b7ecfddeb535fbc0eacb. The commit changed API that was public (or at least semi-public) and it's not worth changing that. The original bug should still be fixed. https://bugzilla.gnome.org/show_bug.cgi?id=673839
* textview: Remove extra magic for drawing childrenBenjamin Otte2012-04-071-21/+4
| | | | | | | | Instead, just draw the children. The cairo code will keep track of things, so there's no need to track things. Also, the old code was doing it wrong. https://bugzilla.gnome.org/show_bug.cgi?id=672544
* Change FSF AddressJavier Jardón2012-02-271-2/+1
|
* textdisplay: Use the widget state flags as a base for drawingRui Matos2012-01-091-3/+2
|
* textdisplay: use g_list_free_fullIgnacio Casal Quinteiro2012-01-011-4/+1
|
* Introduce gtk_render_insertion_cursorPaolo Borelli2011-12-011-52/+9
| | | | | | | | | The new function provides an API that takes the PangoLayout and index as input params, this way it handles strong and weak cursors internally factoring out all code duplicated in the widgets that need to render cursors. https://bugzilla.gnome.org/show_bug.cgi?id=640317
* Use the split-cursor setting for textview cursorsPaolo Borelli2011-12-011-19/+36
| | | | | | | | | | Explicitely check the split-cursor setting when drawing the textview insertion cursor instead of relying on the cursor_direction set in the textlayout. This makes the cursor drawin code more uniform with other widgets in preparation to refactoring the cursor drawing code in a shared function. https://bugzilla.gnome.org/show_bug.cgi?id=640317
* Rework GtkTextView cursor code.Paolo Borelli2011-12-011-42/+44
| | | | | | | | 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
* Tiny cleanup.Paolo Borelli2011-12-011-5/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=640317
* Added internal GdkRGBA support for GtkTextTag::paragraph-background-rgbaTristan Van Berkom2011-05-061-3/+3
| | | | | Added the remaining implementation bits for rendering paragraph backgrounds with rgba values and updated the test case.
* Handled error_color with GdkRGBA in gtktextdisplay.c.Tristan Van Berkom2011-05-061-15/+26
|
* Fixed textview rendering regression.Tristan Van Berkom2011-05-061-14/+2
| | | | | | | | Background color was not painted on the whole tagged segment after line breaking, this was due to the default ->prepare_run() function wiping the internal PangoColors clean... fixed this by unconditionally setting local rgba colors from prepare_run instead of comparing them and bailing out.
* Added GdkRGBA properties to GtkTextTag.Tristan Van Berkom2011-05-061-61/+39
| | | | | | | | | | | | 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.
* textview: Remove x/y arguments from render_para() funcBenjamin Otte2011-02-201-21/+17
| | | | | We were only passing 0 anyway and it's easy to translate the cairo context in use instead of passing x/y coordinates.
* textview: Translate the cairo context instead of keeping y valueBenjamin Otte2011-02-201-5/+8
| | | | | | | | This avoids overflow when transforming a large value to a pango unit. To reproduce the problem: seq 200000 > test.txt && tets/print-editor test.txt Then scroll to around line 140.000 to see it (depends on font size of course).
* Move the get_cursor_color in GtkStyleContextPaolo Borelli2011-01-291-3/+4
| | | | | | | Move the private get_cursor_color method belongs to StyleContext. Change the api so that retrieving both primary and secondary color is possible. I left the method private for now, though it should probably be public as all the other getters.
* Use GtkRGBA for the cursor color priv api.Paolo Borelli2011-01-291-2/+2
|
* Port gtk_draw_insertion_cursor to GtkStyleContextMatthias Clasen2011-01-241-0/+2
|
* gtk: no need to add GTK_STYLE_FLAG_FOCUSED to the widget's state flagsMichael Natterer2011-01-211-3/+0
| | | | because they correctly contain that flag now if the widget has focus.
* Port GtkTextDisplay to StyleContext.Paolo Borelli2011-01-101-62/+117
| | | | | | Use the new StyleContext and StateFlags to draw the text https://bugzilla.gnome.org/show_bug.cgi?id=639105
* Obtain the fg color from the rendererPaolo Borelli2011-01-091-22/+6
| | | | | | | | prepare_run must have been called before draw_shape, so we can avoid fiddling the the (deprecated) style and state and just use the color alredy set on the renderer. https://bugzilla.gnome.org/show_bug.cgi?id=639079
* textview: Fix clip usageJosé Aliste2010-10-031-3/+4
| | | | | | | The previous code used cairo_clip_extents() and interpreted its parameters wrong. https://bugzilla.gnome.org/show_bug.cgi?id=631203
* API: Get rid of gtk_draw_insertion_cursor()Benjamin Otte2010-09-261-3/+3
| | | | | and rename gtk_cairo_draw_insertion_cursor() to gtk_draw_insertion_cursor().
* textview: API: change gtk_text_layout_draw() to take a cairo_tBenjamin Otte2010-09-261-38/+12
| | | | This simplifies the API a lot and allows more magic to happen later.
* gtk/gtktextdisplay.c: use accessor functions to access GtkWidgetJavier Jardón2010-08-221-13/+23
|
* textview: Make cursor display againBenjamin Otte2010-08-191-0/+6
| | | | | The code for initializing the clip rectangle was accidentally deleted in a previous patch. Put it back.
* textview: Fix rendering of embedded imagesBenjamin Otte2010-08-161-16/+5
|
* Add call to cairo_destroy() to gtk_text_layout_draw()Kristian Rietveld2010-08-101-0/+2
|
* textview: Replace GdkGC * argument with gpointerBenjamin Otte2010-08-101-1/+1
| | | | | | The argument is unused. That's also the reason why we can pass NULL instead of the real GC in the caller.
* textview: Make the PangoRenderer use Cairo exclusivelyBenjamin Otte2010-08-101-131/+207
| | | | No more gdkpango usage, no more GdkGC required, yay!
* API: Remove GtkTextTag's stipple propertiesBenjamin Otte2010-08-101-26/+0
| | | | | They seem pretty much unused and the only reason why GtkTextView uses a GdkPangoRenderer and not a PangoCairoRenderer.
* textview: Draw selection background with CairoBenjamin Otte2010-07-261-48/+53
|