home *** CD-ROM | disk | FTP | other *** search
/ IRIS Development Option 6.2 / IRIS_Development_Option_6.2_814-0478-001.iso / dist / dev.idb / usr / include / abi / Xm / TextP.h.z / TextP.h
C/C++ Source or Header  |  1996-03-14  |  11KB  |  273 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992, 1993, 1994 OPEN SOFTWARE FOUNDATION, INC. 
  3.  * ALL RIGHTS RESERVED 
  4. */ 
  5. /* 
  6.  * Motif Release 1.2.4
  7. */ 
  8. /*   $RCSfile: TextP.h,v $ $Revision: 1.3 $ $Date: 1994/04/20 01:40:20 $ */
  9. /*
  10. *  (c) Copyright 1989, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  11. /*
  12. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  13. #ifndef _XmTextP_h
  14. #define _XmTextP_h
  15.  
  16. #include <Xm/PrimitiveP.h>
  17. #include <Xm/TextOutP.h>
  18. #include <Xm/TextInP.h>
  19.  
  20. typedef struct _InputRec *Input;
  21. typedef struct _OutputRec *Output;
  22.  
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26.  
  27. #define TEXTWIDGETCLASS    "Text"    /* Resource class for the text widget. */
  28.  
  29. #define GetSrc(widget)  (((XmTextWidget) (widget))->text.source)
  30.  
  31. #ifndef MIN
  32. #define MIN(x,y)    ((x) < (y) ? (x) : (y))
  33. #endif /* MIN */
  34.  
  35. typedef struct {
  36.     XtPointer        extension;    /* Pointer to extension record */
  37. } XmTextClassPart;
  38.  
  39. typedef struct _XmTextClassRec {
  40.     CoreClassPart core_class;
  41.     XmPrimitiveClassPart primitive_class;
  42.     XmTextClassPart text_class;
  43. } XmTextClassRec;
  44.  
  45. externalref XmTextClassRec    xmTextClassRec;
  46.  
  47. typedef struct {
  48.     XmTextPosition start;    /* First position in this line. */
  49.     Boolean changed;        /* TRUE if something in this line changed. */
  50.     XmTextPosition changed_position; /* First position within the line that
  51.                     has changed, if any. */
  52.     Boolean past_end;        /* TRUE if this line is past the end of any */
  53.                 /* line actually on the screen. */
  54.     LineTableExtra extra;    /* Extra info the output module keeps. */
  55. } LineRec, *Line;
  56.  
  57. typedef struct _XmTextLineTableRec{
  58.     unsigned int start_pos:31;
  59.     unsigned int virt_line:1;
  60. } XmTextLineTableRec, *XmTextLineTable;
  61.  
  62. typedef struct {
  63.     XmTextPosition from, to;    /* Information on one range to repaint. */
  64. } RangeRec;
  65.  
  66. typedef struct {
  67.     Cardinal number;        /* Number of ranges defined. */
  68.     Cardinal maximum;        /* Number of ranges we have space for. */
  69.     RangeRec *range;        /* Pointer to array of ranges. */
  70. } Ranges;
  71.  
  72.  
  73. /*
  74.  * Structure for main text info. 
  75.  */
  76.  
  77. typedef struct _XmTextPart {
  78.     XmTextSource source;           /* The source for this widget. */
  79.     XtCallbackList activate_callback;      /* command activate callback. */
  80.     XtCallbackList focus_callback;       /* Focus callback. */
  81.     XtCallbackList losing_focus_callback;  /* Losing focus callback. */
  82.     XtCallbackList value_changed_callback; /* Value changed callback. */
  83.     XtCallbackList modify_verify_callback; /* Verify value to change callback.*/
  84.     XtCallbackList wcs_modify_verify_callback; /* Verify value to change 
  85.                         * callback.*/
  86.     XtCallbackList motion_verify_callback; /* Insert cursor position 
  87.                           change callback. */
  88.     XtCallbackList gain_primary_callback; /* Gained ownership of Primary
  89.                          Selection */
  90.     XtCallbackList lose_primary_callback; /* Lost ownership of Primary
  91.                          Selection */
  92.     char *value;            /* The sring value in the widget */
  93.     wchar_t *wc_value;              /* Pointer for wchar_t value set by app */
  94.     Dimension margin_height;        /* height between text borders and text */
  95.     Dimension margin_width;         /* width between text borders and text */
  96.     Position cursor_position_x;     /* x pixel location of cursor */
  97.     OutputCreateProc output_create; /* Routine to create the output portion. */
  98.     InputCreateProc input_create;   /* Routine to create the input portion. */
  99.     /* The naming incongruity amongst the next three items was introduced */
  100.     /* due to a collision with top_position as used as a Form constraint; */
  101.     /* It has no other implications. */
  102.     XmTextPosition top_character;    /* First position to display. */
  103.     XmTextPosition bottom_position; /* Last position to display. */
  104.     XmTextPosition cursor_position; /* Location of the insertion point. */
  105.     int max_length;            /* Sets the max. length of string */
  106.     int edit_mode;            /* Sets the line editing mode
  107.                        (i.e. sinlge_line, multi_line, ...) */
  108.     Boolean auto_show_cursor_position; /* If true, automatically try to show
  109.                       the cursor position whenever it
  110.                       changes. */
  111.     Boolean editable;          /* Determines if text is editable */
  112.     Boolean verify_bell;       /* Determines if bell is sounded when verify
  113.                    *  callback returns doit - False
  114.                                    */
  115.     Boolean add_mode;          /* Determines the state of add moder */
  116.     Boolean traversed;            /* Flag used with losing focus verification to
  117.                      indicate a traversal key pressed event */
  118.     Boolean in_redisplay;      /* Whether currently in the redisplay proc. */
  119.     Boolean needs_redisplay;      /* Whether we need to repaint or refigure. */
  120.     Boolean in_refigure_lines;      /* Whether currently in refigurelines proc. */
  121.     Boolean needs_refigure_lines; /* Whether we need to refigure. */
  122.     Boolean in_setvalues;         /* Use to reduce unnecessary redisplays and
  123.                      geometry requsets */
  124.     Boolean in_resize;          /* Make sure there are no geometry requests
  125.                      while we are in resize procedure. */
  126.     Boolean in_expose;          /* Make sure there are no geometry requests
  127.                      while we are in expose procedure. */
  128.     Boolean highlight_changed;      /* Whether highlighting recently changed. */
  129.     Boolean pendingoff;         /* TRUE if we shouldn't do pending delete on
  130.                                    the current selection. */
  131.     char char_size;             /* number of bytes for storing a character */
  132.  
  133.     OnOrOff on_or_off;          /* used to halt unecessary motion verify
  134.                      callback calls during primary moves.*/
  135.     Output output;           /* The output portion. */
  136.     Input input;           /* The input portion. */
  137.  
  138.     XmTextPosition first_position; /* First legal position in the source. */
  139.     XmTextPosition last_position;  /* Last legal position in the source. */
  140.     XmTextPosition forget_past;       /* Forget all about positions past this. */
  141.     XmTextPosition force_display;  /* Force this position to be displayed. */
  142.     XmTextPosition new_top;       /* Desired new top position. */
  143.     XmTextPosition last_top_char;  /* unused - available. */
  144.     XmTextPosition dest_position;  /* Location of the destination point. */
  145.     int disable_depth;           /* How many levels of disable we've done. */
  146.  
  147.     int pending_scroll;        /* Number of lines we want to scroll. */
  148.     int total_lines;        /* Total number of lines in the text widget */
  149.     int top_line;        /* Line number of the top visible line */
  150.     int vsbar_scrolling;    /* scrolling using the vertical scrollbar */
  151.  
  152.     Cardinal number_lines;    /* Number of line table entries. */
  153.     Cardinal maximum_lines;    /* Maximum number of line table entries. */
  154.     Line line;            /* Pointer to array of line table entries. */
  155.  
  156.     Ranges repaint;        /* Info on the repaint ranges. */
  157.     _XmHighlightData highlight;    /* Info on the highlighting regions. */
  158.     _XmHighlightData old_highlight;/* Old value of above. */
  159.     Widget inner_widget;    /* Pointer to widget which actually contains
  160.                    text (may be same or different from
  161.                    this record).  */
  162.     XmTextLineTable line_table;
  163.     unsigned int table_size;
  164.     unsigned int table_index;
  165. } XmTextPart;
  166.  
  167. typedef struct _XmTextRec {
  168.     CorePart    core;
  169.     XmPrimitivePart primitive;
  170.     XmTextPart text;
  171. } XmTextRec;
  172.  
  173.  
  174. /********    Private Function Declarations    ********/
  175. #ifdef _NO_PROTO
  176.  
  177. extern XmTextPosition _XmTextFindScroll() ;
  178. extern int _XmTextGetTotalLines() ;
  179. extern XmTextLineTable _XmTextGetLineTable() ;
  180. extern void _XmTextRealignLineTable() ;
  181. extern unsigned int _XmTextGetTableIndex() ;
  182. extern void _XmTextUpdateLineTable() ;
  183. extern void _XmTextMarkRedraw() ;
  184. extern LineNum _XmTextNumLines() ;
  185. extern void _XmTextLineInfo() ;
  186. extern LineNum _XmTextPosToLine() ;
  187. extern void _XmTextInvalidate() ;
  188. extern void _XmTextSetTopCharacter() ;
  189. extern int _XmTextCountCharacters() ;
  190. extern void _XmTextSetCursorPosition() ;
  191. extern void _XmTextDisableRedisplay() ;
  192. extern void _XmTextEnableRedisplay() ;
  193.  
  194. #else
  195.  
  196. extern XmTextPosition _XmTextFindScroll( 
  197.                         XmTextWidget widget,
  198.                         XmTextPosition start,
  199.                         int delta) ;
  200. extern int _XmTextGetTotalLines( 
  201.                         Widget widget) ;
  202. extern XmTextLineTable _XmTextGetLineTable( 
  203.                         Widget widget,
  204.                         int *total_lines) ;
  205. extern void _XmTextRealignLineTable( 
  206.                         XmTextWidget widget,
  207.                         XmTextLineTable *temp_table,
  208.                         int *temp_table_size,
  209.                         register unsigned int cur_index,
  210.                         register XmTextPosition cur_start,
  211.                         register XmTextPosition cur_end) ;
  212. extern unsigned int _XmTextGetTableIndex(
  213.             XmTextWidget widget,
  214.             XmTextPosition pos) ;
  215. extern void _XmTextUpdateLineTable( 
  216.                         Widget widget,
  217.                         XmTextPosition start,
  218.                         XmTextPosition end,
  219.                         XmTextBlock block,
  220. #if NeedWidePrototypes
  221.                         int update) ;
  222. #else
  223.                         Boolean update) ;
  224. #endif /* NeedWidePrototypes */
  225. extern void _XmTextMarkRedraw( 
  226.                         XmTextWidget widget,
  227.                         XmTextPosition left,
  228.                         XmTextPosition right) ;
  229. extern LineNum _XmTextNumLines( 
  230.                         XmTextWidget widget) ;
  231. extern void _XmTextLineInfo( 
  232.                         XmTextWidget widget,
  233.                         LineNum line,
  234.                         XmTextPosition *startpos,
  235.                         LineTableExtra *extra) ;
  236. extern LineNum _XmTextPosToLine( 
  237.                         XmTextWidget widget,
  238.                         XmTextPosition position) ;
  239. extern void _XmTextInvalidate( 
  240.                         XmTextWidget widget,
  241.                         XmTextPosition position,
  242.                         XmTextPosition topos,
  243.                         long delta) ;
  244. extern void _XmTextSetTopCharacter(
  245.                       Widget widget,
  246.                       XmTextPosition top_character) ;
  247. extern int _XmTextCountCharacters( 
  248.                         char *str,
  249.                         int num_count_bytes) ;
  250. extern void _XmTextSetCursorPosition( 
  251.                         Widget widget,
  252.                         XmTextPosition position) ;
  253. extern void _XmTextDisableRedisplay( 
  254.                         XmTextWidget widget,
  255. #if NeedWidePrototypes
  256.                         int losesbackingstore) ;
  257. #else
  258.                         Boolean losesbackingstore) ;
  259. #endif /* NeedWidePrototypes */
  260. extern void _XmTextEnableRedisplay( 
  261.                         XmTextWidget widget) ;
  262.  
  263. #endif /* _NO_PROTO */
  264. /********    End Private Function Declarations    ********/
  265.  
  266.  
  267. #ifdef __cplusplus
  268. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  269. #endif
  270.  
  271. #endif /* _XmTextP_h */
  272. /* DON't ADD STUFF AFTER THIS #endif */
  273.