From a4762fbff4739fbf0373c5528eb3a9855aa9299b Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Tue, 25 Jul 2000 23:59:38 +0000 Subject: update to reflect text widget changes. 2000-07-25 Havoc Pennington * gtk/testtext.c, gtk/testtextbuffer.c: update to reflect text widget changes. * gtk/gtktextview.h: To be consistent with usage of "line" throughout the API to mean "newline-terminated thingy", change MOVEMENT_LINE to be MOVEMENT_WRAPPED_LINE, and MOVEMENT_PARAGRAPH to MOVEMENT_LINE. (GtkTextView): Add flags for default editability, and whether to show the cursor. Add functions to get/set that. Add (gtk_text_view_get_iter_location): new function * gtk/gtktexttypes.h: Move GtkTextLine typedef from here to gtktextlayout.h (g_convert): Add g_convert temporarily, will go in glib in a bit * gtk/gtktexttagtable.h: include gtktexttag.h, and define GtkTextTagTableForeach instead of brokenly using GHFunc. Change gtk_text_tag_table_foreach() so it doesn't use GHFunc. * gtk/gtktexttagprivate.h: Remove GtkTextStyleValues from here, moved to public header. * gtk/gtktexttag.h: Rename the "elide" attribute of tags to "invisible", since "elide" was a bad name. (gtk_text_tag_get_priority): Added (GtkTextStyleValues): put this in public header, along with functions to use it. * gtk/gtktextmarkprivate.h: Include more headers, since we no longer include gtktextbtree.h. * gtk/gtktextmark.h: Add gtk_text_mark_ref, gtk_text_mark_unref, gtk_text_mark_deleted * gtk/gtktextlayout.h: Don't include the "really private" headers, only buffer/iter. Forward declare GtkTextLIne and GtkTextLineData to make this possible. Now we only need to install gtktextlayout.h, not gtktextbtree.h and gtktext*private.h. (However the Makefile.am isn't changed yet because of the logistics of merging gtk-hp-patches piecemeal) * gtk/gtktextiterprivate.h: include btree header, so it compiles; rename gtk_text_iter_get_line to gtk_text_iter_get_text_line since gtk_text_iter_get_line is now used in the public API for a different purpose. * gtk/gtktextiter.h: Clean up function names to be more consistent. Always call char offset "offset" and byte index "index". A "line" is always a line number. (gtk_text_iter_is_last): new function, more efficient than the existing way to check (gtk_text_iter_is_first): new function, also more efficient (gtk_text_iter_up_lines, gtk_text_iter_down_lines): Remove these (gtk_text_iter_next_char, gtk_text_iter_prev_char): Renamed from gtk_text_iter_forward_char, etc. (gtk_text_iter_forward_to_tag_toggle): Renamed from forward_find_tag_toggle, since this isn't a linear search (GtkTextCharPredicate): rename from GtkTextViewCharPredicate (gtk_text_iter_forward_search, gtk_text_iter_backward_search): New functions, search for a buffer substring. * gtk/gtktextbuffer.h: Add fields to store whether a paste is interactive and default editable (since we need to store that info until we receive the selection data). Remove all the _at_char and at_line etc. versions of functions; only have iterator versions. Add _interactive() versions of functions, that consider the editability of text. (FIXME add interactive flag to the insert/delete signals per Darin's suggestion) (gtk_text_buffer_get_tag_table): new function, demand-creates the tag table if necessary Remove declaration of gtk_text_buffer_get_iter_from_string (_gtk_text_buffer_get_btree): private/internal function, added. * gtk/gtktextbtree.h: Remove forward decl of GtkTextLineData. (gtk_text_line_is_last): new function --- gtk/gtktexttagprivate.h | 93 ------------------------------------------------- 1 file changed, 93 deletions(-) (limited to 'gtk/gtktexttagprivate.h') diff --git a/gtk/gtktexttagprivate.h b/gtk/gtktexttagprivate.h index c19ddf275..d8ec06fe8 100644 --- a/gtk/gtktexttagprivate.h +++ b/gtk/gtktexttagprivate.h @@ -13,99 +13,6 @@ void gtk_text_style_values_fill_from_tags (GtkTextStyleValues *values, void gtk_text_tag_array_sort (GtkTextTag **tag_array_p, guint len); -/* - * Style object created by folding a set of tags together - */ - -typedef struct _GtkTextAppearance GtkTextAppearance; - -struct _GtkTextAppearance -{ - GdkColor bg_color; - GdkColor fg_color; - GdkBitmap *bg_stipple; - GdkBitmap *fg_stipple; - - guint underline : 4; /* PangoUnderline */ - guint overstrike : 1; - - /* Whether to use background-related values; this is irrelevant for - * the values struct when in a tag, but is used for the composite - * values struct; it's true if any of the tags being composited - * had background stuff set. */ - guint draw_bg : 1; - - /* This is only used when we are actually laying out and rendering - * a paragraph; not when a GtkTextAppearance is part of a - * GtkTextStyleValues. - */ - guint inside_selection : 1; -}; - -struct _GtkTextStyleValues -{ - guint refcount; - - GtkTextAppearance appearance; - - gint border_width; - GtkShadowType relief; - GtkJustification justify; - GtkTextDirection direction; - - PangoFontDescription *font_desc; - - /* lMargin1 */ - gint left_margin; - - /* lMargin2 */ - gint left_wrapped_line_margin; - - /* super/subscript offset, can be negative */ - gint offset; - - gint right_margin; - - gint pixels_above_lines; - - gint pixels_below_lines; - - gint pixels_inside_wrap; - - GtkTextTabArray *tab_array; - - GtkWrapMode wrap_mode; /* How to handle wrap-around for this tag. - * Must be GTK_WRAPMODE_CHAR, - * GTK_WRAPMODE_NONE, GTK_WRAPMODE_WORD - */ - - gchar *language; - - /* hide the text */ - guint elide : 1; - - /* Background is fit to full line height rather than - * baseline +/- ascent/descent (font height) */ - guint bg_full_height : 1; - - /* can edit this text */ - guint editable : 1; - - /* colors are allocated etc. */ - guint realized : 1; - - guint pad1 : 1; - guint pad2 : 1; - guint pad3 : 1; - guint pad4 : 1; -}; - -GtkTextStyleValues *gtk_text_style_values_new (void); -void gtk_text_style_values_copy (GtkTextStyleValues *src, - GtkTextStyleValues *dest); -void gtk_text_style_values_unref (GtkTextStyleValues *values); -void gtk_text_style_values_ref (GtkTextStyleValues *values); - /* ensure colors are allocated, etc. for drawing */ void gtk_text_style_values_realize (GtkTextStyleValues *values, GdkColormap *cmap, -- cgit v1.2.1