From 6bfd69db2e44eeb3a13c70853652b0b4fa050995 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Fri, 26 May 2000 08:45:57 +0000 Subject: Ajout de variables et d'options permettant la gestion de la saisie de texte, focus, selection, etc. --- generic/WidgetInfo.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) (limited to 'generic/WidgetInfo.h') diff --git a/generic/WidgetInfo.h b/generic/WidgetInfo.h index 63d0b62..c6b631b 100644 --- a/generic/WidgetInfo.h +++ b/generic/WidgetInfo.h @@ -50,6 +50,44 @@ #define INTERNAL_NEED_REPICK 8 +/* + * The following structure provides information about the selection and + * the insertion cursor. It is needed by only a few items, such as + * those that display text. It is shared by the generic canvas code + * and the item-specific code, but most of the fields should be written + * only by the canvas generic code. + */ +typedef struct _TextInfo { + ZnColor sel_color; /* Background color for selected text. + * Read-only to items.*/ + Item sel_item; /* Pointer to selected item. ZN_NO_ITEM + * means that the widget doesn't own the + * selection. Writable by items. */ + int sel_first; /* Index of first selected character. + * Writable by items. */ + int sel_last; /* Index of last selected character. + * Writable by items. */ + Item anchor_item; /* Item corresponding to sel_anchor: not + * necessarily sel_item. Read-only to items. */ + int sel_anchor; /* Fixed end of selection (i.e. "select to" + * operation will use this as one end of the + * selection). Writable by items. */ + ZnColor insert_color; /* Used to draw vertical bar for insertion + * cursor. Read-only to items. */ + int insert_width; /* Total width of insertion cursor. Read-only + * to items. */ + Item focus_item; /* Item that currently has the input focus, + * or ZN_NO_ITEM if no such item. Read-only to + * items. */ + ZnBool got_focus; /* True means that the widget has the input + * focus. Read-only to items.*/ + ZnBool cursor_on; /* True means that an insertion cursor should + * be displayed in focus_item. Read-only to + * items.*/ + struct _ColorGradient *sel_relief; + struct _ColorGradient *insert_relief; +} TextInfo; + typedef struct _WidgetInfo { Tcl_Interp *interp; /* Interpreter associated with widget. */ Tcl_Command cmd; /* Token for zinc widget command. */ @@ -127,7 +165,8 @@ typedef struct _WidgetInfo { /* Zinc private resources */ int width; /* Actual window dimension. */ int height; - + int inset; /* Border and highlight width */ + /* Graphic variables */ Display *dpy; /* The display of the widget window. */ Screen *screen; @@ -147,6 +186,19 @@ typedef struct _WidgetInfo { ZnList work_pts; /* Temporary point lists. */ ZnList work_xpts; + /* Text management */ + TextInfo text_info; + int insert_on_time; + int insert_off_time; + Tcl_TimerToken blink_handler; + char *take_focus; + int highlight_width; /* Width in pixels of highlight to draw + * around widget when it has the focus. + * = 0 means don't draw a highlight. */ + ZnColor highlight_bg_color; /* Color for drawing traversal highlight + * area when highlight is off. */ + ZnColor highlight_color; /* Color for drawing traversal highlight.*/ + /* Perf measurement variables. */ ZnBool monitoring; int num_updates; -- cgit v1.1