summaryrefslogtreecommitdiff
path: root/gtk/gtktext.h
diff options
context:
space:
mode:
authorOwen Taylor <owt1@cornell.edu>1998-03-01 05:11:05 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-03-01 05:11:05 +0000
commit9205edae41b7fdcdda29e8a47739c56f34834f0f (patch)
tree8f2a329df7aaa39bc746eadf55b45c42fe4bf3d2 /gtk/gtktext.h
parentd491547e869c5b918e998e1c68449d2d0e742ada (diff)
downloadgtk+-9205edae41b7fdcdda29e8a47739c56f34834f0f.tar.gz
gtk/gtkentry.[ch] gtktext.c gtkeditable.[ch]
Sat Feb 28 23:58:54 1998 Owen Taylor <owt1@cornell.edu> * gtk/gtkentry.[ch] gtktext.c gtkeditable.[ch] Created a new base widget type Editable for the entry and text widgets, which encapsulates most of the selection and clipboard handling stuff, plus some common signals. Changed the Entry widget extensively to support this, but the interface and appearance should be the same. Changed the Text widget moderately to support this. It now supports: - Selection style cut and paste - Clipboard style cut and paste - Emacs style key bindings (~same as Entry) - Word motion - "changed" signal There are definitely still some bugs in the new stuff. * gtkfilesel.c gtkspinbutton.c testgtk.c: small changes to fit the new interface more exactly.
Diffstat (limited to 'gtk/gtktext.h')
-rw-r--r--gtk/gtktext.h34
1 files changed, 7 insertions, 27 deletions
diff --git a/gtk/gtktext.h b/gtk/gtktext.h
index 7ae0cd12fc..d10c63a200 100644
--- a/gtk/gtktext.h
+++ b/gtk/gtktext.h
@@ -21,7 +21,7 @@
#include <gdk/gdk.h>
#include <gtk/gtkadjustment.h>
-#include <gtk/gtkwidget.h>
+#include <gtk/gtkeditable.h>
#ifdef __cplusplus
@@ -38,8 +38,6 @@ typedef struct _GtkPropertyMark GtkPropertyMark;
typedef struct _GtkText GtkText;
typedef struct _GtkTextClass GtkTextClass;
-typedef void (*GtkTextFunction) (GtkText *text);
-
struct _GtkPropertyMark
{
/* Position in list. */
@@ -54,7 +52,7 @@ struct _GtkPropertyMark
struct _GtkText
{
- GtkWidget widget;
+ GtkEditable editable;
GdkWindow *text_area;
@@ -66,8 +64,6 @@ struct _GtkText
GdkPixmap* line_wrap_bitmap;
GdkPixmap* line_arrow_bitmap;
- GdkIC ic;
-
/* GAPPED TEXT SEGMENT */
/* The text, a single segment of text a'la emacs, with a gap
@@ -96,24 +92,17 @@ struct _GtkText
/* First visible horizontal pixel. */
guint first_onscreen_hor_pixel;
/* First visible vertical pixel. */
- guint first_onscreen_ver_pixel;
+ guint first_onscreen_ver_pixel;
/* FLAGS */
/* True iff the cursor has been placed yet. */
guint has_cursor : 1;
- /* True iff this buffer is editable. (Allowing a cursor to be placed). */
- guint is_editable : 1;
/* True iff this buffer is wrapping lines, otherwise it is using a
* horizontal scrollbar. */
guint line_wrap : 1;
/* Frozen, don't do updates. @@@ fixme */
guint freeze : 1;
- /* Whether a selection. */
- guint has_selection : 1;
- /* Whether the selection is in the clipboard. */
- guint own_selection : 1;
- /* Whether it has been realized yet. */
/* TEXT PROPERTIES */
@@ -155,20 +144,11 @@ struct _GtkText
GList *tab_stops;
gint default_tab_width;
- /* Key bindings */
-
- GtkTextFunction control_keys[26];
- GtkTextFunction alt_keys[26];
-
- /* Selection nonsense. */
-
- guint selection_start;
- guint selection_stop;
};
struct _GtkTextClass
{
- GtkWidgetClass parent_class;
+ GtkEditableClass parent_class;
};
@@ -197,9 +177,9 @@ gint gtk_text_backward_delete (GtkText *text,
gint gtk_text_forward_delete (GtkText *text,
guint nchars);
-gchar * gtk_text_get_chars (GtkText *text,
- guint index,
- guint nchars);
+void gtk_text_select_region (GtkText *entry,
+ guint start,
+ guint end);
#define GTK_TEXT_INDEX(t, index) \
((index) < (t)->gap_position ? (t)->text[index] : \