|
Packit |
b099d7 |
/*
|
|
Packit |
b099d7 |
* Motif
|
|
Packit |
b099d7 |
*
|
|
Packit |
b099d7 |
* Copyright (c) 1987-2012, The Open Group. All rights reserved.
|
|
Packit |
b099d7 |
*
|
|
Packit |
b099d7 |
* These libraries and programs are free software; you can
|
|
Packit |
b099d7 |
* redistribute them and/or modify them under the terms of the GNU
|
|
Packit |
b099d7 |
* Lesser General Public License as published by the Free Software
|
|
Packit |
b099d7 |
* Foundation; either version 2 of the License, or (at your option)
|
|
Packit |
b099d7 |
* any later version.
|
|
Packit |
b099d7 |
*
|
|
Packit |
b099d7 |
* These libraries and programs are distributed in the hope that
|
|
Packit |
b099d7 |
* they will be useful, but WITHOUT ANY WARRANTY; without even the
|
|
Packit |
b099d7 |
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
Packit |
b099d7 |
* PURPOSE. See the GNU Lesser General Public License for more
|
|
Packit |
b099d7 |
* details.
|
|
Packit |
b099d7 |
*
|
|
Packit |
b099d7 |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit |
b099d7 |
* License along with these librararies and programs; if not, write
|
|
Packit |
b099d7 |
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
|
|
Packit |
b099d7 |
* Floor, Boston, MA 02110-1301 USA
|
|
Packit |
b099d7 |
*/
|
|
Packit |
b099d7 |
/*
|
|
Packit |
b099d7 |
* HISTORY
|
|
Packit |
b099d7 |
*/
|
|
Packit |
b099d7 |
/* $XConsortium: TextP.h /main/16 1996/05/21 12:09:47 pascale $ */
|
|
Packit |
b099d7 |
/* (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
|
|
Packit |
b099d7 |
/* (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
|
|
Packit |
b099d7 |
/*
|
|
Packit |
b099d7 |
* (c) Copyright 1995 FUJITSU LIMITED
|
|
Packit |
b099d7 |
* This is source code modified by FUJITSU LIMITED under the Joint
|
|
Packit |
b099d7 |
* Development Agreement for the CDEnext PST.
|
|
Packit |
b099d7 |
* This is unpublished proprietary source code of FUJITSU LIMITED
|
|
Packit |
b099d7 |
*/
|
|
Packit |
b099d7 |
#ifndef _XmTextP_h
|
|
Packit |
b099d7 |
#define _XmTextP_h
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#include <Xm/PrimitiveP.h>
|
|
Packit |
b099d7 |
#include <Xm/TextOutP.h>
|
|
Packit |
b099d7 |
#include <Xm/TextInP.h>
|
|
Packit |
b099d7 |
#include <Xm/TransferT.h>
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
typedef struct _InputRec *Input;
|
|
Packit |
b099d7 |
typedef struct _OutputRec *Output;
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#ifdef __cplusplus
|
|
Packit |
b099d7 |
extern "C" {
|
|
Packit |
b099d7 |
#endif
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#define NODELTA LONG_MAX
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#define TEXTWIDGETCLASS "Text" /* Resource class for the text widget. */
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#define GetSrc(widget) (((XmTextWidget) (widget))->text.source)
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
typedef struct {
|
|
Packit |
b099d7 |
XtPointer extension; /* Pointer to extension record */
|
|
Packit |
b099d7 |
} XmTextClassPart;
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
typedef struct _XmTextClassRec {
|
|
Packit |
b099d7 |
CoreClassPart core_class;
|
|
Packit |
b099d7 |
XmPrimitiveClassPart primitive_class;
|
|
Packit |
b099d7 |
XmTextClassPart text_class;
|
|
Packit |
b099d7 |
} XmTextClassRec;
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
externalref XmTextClassRec xmTextClassRec;
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
typedef struct {
|
|
Packit |
b099d7 |
XmTextPosition start; /* First position in this line. */
|
|
Packit |
b099d7 |
Boolean changed; /* TRUE if something in this line changed. */
|
|
Packit |
b099d7 |
XmTextPosition changed_position; /* First position within the line that
|
|
Packit |
b099d7 |
has changed, if any. */
|
|
Packit |
b099d7 |
Boolean past_end; /* TRUE if this line is past the end of any */
|
|
Packit |
b099d7 |
/* line actually on the screen. */
|
|
Packit |
b099d7 |
LineTableExtra extra; /* Extra info the output module keeps. */
|
|
Packit |
b099d7 |
} LineRec, *Line;
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
typedef struct _XmTextLineTableRec{
|
|
Packit |
b099d7 |
unsigned int start_pos:31;
|
|
Packit |
b099d7 |
unsigned int virt_line:1;
|
|
Packit |
b099d7 |
} XmTextLineTableRec, *XmTextLineTable;
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
typedef struct {
|
|
Packit |
b099d7 |
XmTextPosition from, to; /* Information on one range to repaint. */
|
|
Packit |
b099d7 |
} RangeRec;
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
typedef struct {
|
|
Packit |
b099d7 |
Cardinal number; /* Number of ranges defined. */
|
|
Packit |
b099d7 |
Cardinal maximum; /* Number of ranges we have space for. */
|
|
Packit |
b099d7 |
RangeRec *range; /* Pointer to array of ranges. */
|
|
Packit |
b099d7 |
} Ranges;
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
/*
|
|
Packit |
b099d7 |
* The data for on-the-spot support.
|
|
Packit |
b099d7 |
*/
|
|
Packit |
b099d7 |
typedef struct _OnTheSpotDataTW {
|
|
Packit |
b099d7 |
XmTextPosition start;
|
|
Packit |
b099d7 |
XmTextPosition end;
|
|
Packit |
b099d7 |
XmTextPosition cursor;
|
|
Packit |
b099d7 |
XmTextPosition over_len;
|
|
Packit |
b099d7 |
XmTextPosition over_maxlen;
|
|
Packit |
b099d7 |
char *over_str;
|
|
Packit |
b099d7 |
int under_preedit;
|
|
Packit |
b099d7 |
Boolean under_verify_preedit;
|
|
Packit |
b099d7 |
Boolean verify_commit;
|
|
Packit |
b099d7 |
int pad;
|
|
Packit |
b099d7 |
} OnTheSpotDataRecTW, *OnTheSpotDataTW;
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#define PreStartTW(tw) ((tw)->text.onthespot->start)
|
|
Packit |
b099d7 |
#define PreEndTW(tw) ((tw)->text.onthespot->end)
|
|
Packit |
b099d7 |
#define PreCursorTW(tw) ((tw)->text.onthespot->cursor)
|
|
Packit |
b099d7 |
#define PreOverLen(tw) ((tw)->text.onthespot->over_len)
|
|
Packit |
b099d7 |
#define PreOverMaxLen(tw) ((tw)->text.onthespot->over_maxlen)
|
|
Packit |
b099d7 |
#define PreOverStr(tw) ((tw)->text.onthespot->over_str)
|
|
Packit |
b099d7 |
#define PreUnder(tw) ((tw)->text.onthespot->under_preedit)
|
|
Packit |
b099d7 |
#define UnderVerifyPreedit(tw) ((tw)->text.onthespot->under_verify_preedit)
|
|
Packit |
b099d7 |
#define VerifyCommitNeeded(tw) ((tw)->text.onthespot->verify_commit)
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
/*
|
|
Packit |
b099d7 |
* Structure for main text info.
|
|
Packit |
b099d7 |
*/
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
typedef struct _XmTextPart {
|
|
Packit |
b099d7 |
XmTextSource source; /* The source for this widget. */
|
|
Packit |
b099d7 |
XtCallbackList activate_callback; /* command activate callback. */
|
|
Packit |
b099d7 |
XtCallbackList focus_callback; /* Focus callback. */
|
|
Packit |
b099d7 |
XtCallbackList losing_focus_callback; /* Losing focus callback. */
|
|
Packit |
b099d7 |
XtCallbackList value_changed_callback; /* Value changed callback. */
|
|
Packit |
b099d7 |
XtCallbackList modify_verify_callback; /* Verify value to change callback.*/
|
|
Packit |
b099d7 |
XtCallbackList wcs_modify_verify_callback; /* Verify value to change
|
|
Packit |
b099d7 |
* callback.*/
|
|
Packit |
b099d7 |
XtCallbackList motion_verify_callback; /* Insert cursor position
|
|
Packit |
b099d7 |
change callback. */
|
|
Packit |
b099d7 |
XtCallbackList gain_primary_callback; /* Gained ownership of Primary
|
|
Packit |
b099d7 |
Selection */
|
|
Packit |
b099d7 |
XtCallbackList lose_primary_callback; /* Lost ownership of Primary
|
|
Packit |
b099d7 |
Selection */
|
|
Packit |
b099d7 |
char *value; /* The sring value in the widget */
|
|
Packit |
b099d7 |
wchar_t *wc_value; /* Pointer for wchar_t value set by app */
|
|
Packit |
b099d7 |
Dimension margin_height; /* height between text borders and text */
|
|
Packit |
b099d7 |
Dimension margin_width; /* width between text borders and text */
|
|
Packit |
b099d7 |
Position cursor_position_x; /* x pixel location of cursor */
|
|
Packit |
b099d7 |
OutputCreateProc output_create; /* Routine to create the output portion. */
|
|
Packit |
b099d7 |
InputCreateProc input_create; /* Routine to create the input portion. */
|
|
Packit |
b099d7 |
/* The naming incongruity amongst the next three items was introduced */
|
|
Packit |
b099d7 |
/* due to a collision with top_position as used as a Form constraint; */
|
|
Packit |
b099d7 |
/* It has no other implications. */
|
|
Packit |
b099d7 |
XmTextPosition top_character; /* First position to display. */
|
|
Packit |
b099d7 |
XmTextPosition bottom_position; /* Last position to display. */
|
|
Packit |
b099d7 |
XmTextPosition cursor_position; /* Location of the insertion point. */
|
|
Packit |
b099d7 |
int max_length; /* Sets the max. length of string */
|
|
Packit |
b099d7 |
int edit_mode; /* Sets the line editing mode
|
|
Packit |
b099d7 |
(i.e. sinlge_line, multi_line, ...) */
|
|
Packit |
b099d7 |
Boolean auto_show_cursor_position; /* If true, automatically try to show
|
|
Packit |
b099d7 |
the cursor position whenever it
|
|
Packit |
b099d7 |
changes. */
|
|
Packit |
b099d7 |
Boolean editable; /* Determines if text is editable */
|
|
Packit |
b099d7 |
Boolean verify_bell; /* Determines if bell is sounded when verify
|
|
Packit |
b099d7 |
* callback returns doit - False
|
|
Packit |
b099d7 |
*/
|
|
Packit |
b099d7 |
Boolean add_mode; /* Determines the state of add moder */
|
|
Packit |
b099d7 |
Boolean traversed; /* Flag used with losing focus verification to
|
|
Packit |
b099d7 |
indicate a traversal key pressed event */
|
|
Packit |
b099d7 |
Boolean in_redisplay; /* Whether currently in the redisplay proc. */
|
|
Packit |
b099d7 |
Boolean needs_redisplay; /* Whether we need to repaint or refigure. */
|
|
Packit |
b099d7 |
Boolean in_refigure_lines; /* Whether currently in refigurelines proc. */
|
|
Packit |
b099d7 |
Boolean needs_refigure_lines; /* Whether we need to refigure. */
|
|
Packit |
b099d7 |
Boolean in_setvalues; /* Use to reduce unnecessary redisplays and
|
|
Packit |
b099d7 |
geometry requsets */
|
|
Packit |
b099d7 |
Boolean in_resize; /* Make sure there are no geometry requests
|
|
Packit |
b099d7 |
while we are in resize procedure. */
|
|
Packit |
b099d7 |
Boolean in_expose; /* Make sure there are no geometry requests
|
|
Packit |
b099d7 |
while we are in expose procedure. */
|
|
Packit |
b099d7 |
Boolean highlight_changed; /* Whether highlighting recently changed. */
|
|
Packit |
b099d7 |
Boolean pendingoff; /* TRUE if we shouldn't do pending delete on
|
|
Packit |
b099d7 |
the current selection. */
|
|
Packit |
b099d7 |
char char_size; /* number of bytes for storing a character */
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
OnOrOff on_or_off; /* used to halt unecessary motion verify
|
|
Packit |
b099d7 |
callback calls during primary moves.*/
|
|
Packit |
b099d7 |
Output output; /* The output portion. */
|
|
Packit |
b099d7 |
Input input; /* The input portion. */
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
XmTextPosition first_position; /* First legal position in the source. */
|
|
Packit |
b099d7 |
XmTextPosition last_position; /* Last legal position in the source. */
|
|
Packit |
b099d7 |
XmTextPosition forget_past; /* Forget all about positions past this. */
|
|
Packit |
b099d7 |
XmTextPosition force_display; /* Force this position to be displayed. */
|
|
Packit |
b099d7 |
XmTextPosition new_top; /* Desired new top position. */
|
|
Packit |
b099d7 |
XmTextPosition last_top_char; /* unused - available. */
|
|
Packit |
b099d7 |
XmTextPosition dest_position; /* Location of the destination point. */
|
|
Packit |
b099d7 |
int disable_depth; /* How many levels of disable we've done. */
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
int pending_scroll; /* Number of lines we want to scroll. */
|
|
Packit |
b099d7 |
int total_lines; /* Total number of lines in the text widget */
|
|
Packit |
b099d7 |
int top_line; /* Line number of the top visible line */
|
|
Packit |
b099d7 |
int vsbar_scrolling; /* scrolling using the vertical scrollbar */
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
Cardinal number_lines; /* Number of line table entries. */
|
|
Packit |
b099d7 |
Cardinal maximum_lines; /* Maximum number of line table entries. */
|
|
Packit |
b099d7 |
Line line; /* Pointer to array of line table entries. */
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
Ranges repaint; /* Info on the repaint ranges. */
|
|
Packit |
b099d7 |
_XmHighlightData highlight; /* Info on the highlighting regions. */
|
|
Packit |
b099d7 |
_XmHighlightData old_highlight;/* Old value of above. */
|
|
Packit |
b099d7 |
Widget inner_widget; /* Pointer to widget which actually contains
|
|
Packit |
b099d7 |
text (may be same or different from
|
|
Packit |
b099d7 |
this record). */
|
|
Packit |
b099d7 |
XmTextLineTable line_table;
|
|
Packit |
b099d7 |
unsigned int table_size;
|
|
Packit |
b099d7 |
unsigned int table_index;
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
XtCallbackList destination_callback; /* Selection destination cb */
|
|
Packit |
b099d7 |
int hsbar_scrolling;/* scroring using the horizontal scrollbar */
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
OnTheSpotDataTW onthespot; /* On the spot preedit style support. */
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
XtTranslations tm_table;
|
|
Packit |
b099d7 |
} XmTextPart;
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
typedef struct _XmTextRec {
|
|
Packit |
b099d7 |
CorePart core;
|
|
Packit |
b099d7 |
XmPrimitivePart primitive;
|
|
Packit |
b099d7 |
XmTextPart text;
|
|
Packit |
b099d7 |
} XmTextRec;
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#ifdef __cplusplus
|
|
Packit |
b099d7 |
} /* Close scope of 'extern "C"' declaration which encloses file. */
|
|
Packit |
b099d7 |
#endif
|
|
Packit |
b099d7 |
|
|
Packit |
b099d7 |
#endif /* _XmTextP_h */
|
|
Packit |
b099d7 |
/* DON't ADD STUFF AFTER THIS #endif */
|