]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktextlayout.h
filechooserbutton: Don't duplicate tests for GTK_RESPONSE_DELETE_EVENT
[~andy/gtk] / gtk / gtktextlayout.h
index 36a6efb51f66162fdc42fe4ecfaf5d55fcb1af19..819aaf23692e196e8e1da55a8d872cd289f2ca09 100644 (file)
@@ -23,8 +23,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  *
  * Original Tk license:
  *
@@ -89,8 +88,7 @@
 #error "You are not supposed to be including this file; the equivalent public API is in gtktextview.h"
 #endif
 
-#include <gtk/gtktextbuffer.h>
-#include <gtk/gtktextiter.h>
+#include <gtk/gtk.h>
 
 G_BEGIN_DECLS
 
@@ -110,7 +108,6 @@ typedef struct _GtkTextLineData GtkTextLineData;
 typedef struct _GtkTextLayout         GtkTextLayout;
 typedef struct _GtkTextLayoutClass    GtkTextLayoutClass;
 typedef struct _GtkTextLineDisplay    GtkTextLineDisplay;
-typedef struct _GtkTextCursorDisplay  GtkTextCursorDisplay;
 typedef struct _GtkTextAttrAppearance GtkTextAttrAppearance;
 
 struct _GtkTextLayout
@@ -174,6 +171,8 @@ struct _GtkTextLayout
   PangoAttrList *preedit_attrs;
   gint preedit_len;
   gint preedit_cursor;
+
+  guint overwrite_mode : 1;
 };
 
 struct _GtkTextLayoutClass
@@ -209,11 +208,14 @@ struct _GtkTextLayoutClass
                                  gint               x,
                                  gint               y);
 
+  void (*invalidate_cursors)    (GtkTextLayout     *layout,
+                                 const GtkTextIter *start,
+                                 const GtkTextIter *end);
+
   /* Padding for future expansion */
   void (*_gtk_reserved1) (void);
   void (*_gtk_reserved2) (void);
   void (*_gtk_reserved3) (void);
-  void (*_gtk_reserved4) (void);
 };
 
 struct _GtkTextAttrAppearance
@@ -221,20 +223,12 @@ struct _GtkTextAttrAppearance
   PangoAttribute attr;
   GtkTextAppearance appearance;
 };
-struct _GtkTextCursorDisplay
-{
-  gint x;
-  gint y;
-  gint height;
-  guint is_strong : 1;
-  guint is_weak : 1;
-};
+
 struct _GtkTextLineDisplay
 {
   PangoLayout *layout;
-  GSList *cursors;
-  GSList *shaped_objects;      /* Only for backwards compatibility */
-  
+  GArray *cursors;      /* indexes of cursors in the PangoLayout */
+
   GtkTextDirection direction;
 
   gint width;                   /* Width of layout */
@@ -250,11 +244,22 @@ struct _GtkTextLineDisplay
   gint bottom_margin;
   gint insert_index;           /* Byte index of insert cursor within para or -1 */
 
-  gboolean size_only;
   GtkTextLine *line;
+  
+  GdkColor *pg_bg_color;
+
+  GdkRectangle block_cursor;
+  guint cursors_invalid : 1;
+  guint has_block_cursor : 1;
+  guint cursor_at_line_end : 1;
+  guint size_only : 1;
+
+  GdkRGBA *pg_bg_rgba;
 };
 
-extern PangoAttrType gtk_text_attr_appearance_type;
+#ifdef GTK_COMPILATION
+extern G_GNUC_INTERNAL PangoAttrType gtk_text_attr_appearance_type;
+#endif
 
 GType         gtk_text_layout_get_type    (void) G_GNUC_CONST;
 
@@ -269,6 +274,8 @@ void               gtk_text_layout_set_contexts          (GtkTextLayout     *lay
                                                          PangoContext      *rtl_context);
 void               gtk_text_layout_set_cursor_direction  (GtkTextLayout     *layout,
                                                           GtkTextDirection   direction);
+void              gtk_text_layout_set_overwrite_mode    (GtkTextLayout     *layout,
+                                                         gboolean           overwrite);
 void               gtk_text_layout_set_keyboard_direction (GtkTextLayout     *layout,
                                                           GtkTextDirection keyboard_dir);
 void               gtk_text_layout_default_style_changed (GtkTextLayout     *layout);
@@ -325,6 +332,9 @@ void gtk_text_layout_get_iter_at_position (GtkTextLayout     *layout,
 void gtk_text_layout_invalidate        (GtkTextLayout     *layout,
                                         const GtkTextIter *start,
                                         const GtkTextIter *end);
+void gtk_text_layout_invalidate_cursors(GtkTextLayout     *layout,
+                                        const GtkTextIter *start,
+                                        const GtkTextIter *end);
 void gtk_text_layout_free_line_data    (GtkTextLayout     *layout,
                                         GtkTextLine       *line,
                                         GtkTextLineData   *line_data);
@@ -351,6 +361,10 @@ void     gtk_text_layout_changed              (GtkTextLayout     *layout,
                                                gint               y,
                                                gint               old_height,
                                                gint               new_height);
+void     gtk_text_layout_cursors_changed      (GtkTextLayout     *layout,
+                                               gint               y,
+                                               gint               old_height,
+                                               gint               new_height);
 void     gtk_text_layout_get_iter_location    (GtkTextLayout     *layout,
                                                const GtkTextIter *iter,
                                                GdkRectangle      *rect);
@@ -366,6 +380,8 @@ void     gtk_text_layout_get_cursor_locations (GtkTextLayout     *layout,
                                                GtkTextIter       *iter,
                                                GdkRectangle      *strong_pos,
                                                GdkRectangle      *weak_pos);
+gboolean _gtk_text_layout_get_block_cursor    (GtkTextLayout     *layout,
+                                              GdkRectangle      *pos);
 gboolean gtk_text_layout_clamp_iter_to_vrange (GtkTextLayout     *layout,
                                                GtkTextIter       *iter,
                                                gint               top,