Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / lib / DtTerm / TermPrim / TermPrimSelectP.h
1 /* 
2 ** $XConsortium: TermPrimSelectP.h /main/1 1996/04/21 19:19:31 drk $
3 */
4 /*                                                                      *
5  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
6  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
7  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
8  * (c) Copyright 1993, 1994 Novell, Inc.                                *
9  */
10 #ifndef   _Dt_TermPrimSelectP_h
11 #define   _Dt_TermPrimSelectP_h
12
13 #include <Xm/Xm.h>
14 #include "TermPrimSelect.h"
15
16 typedef enum { scanLeft, scanRight } TermScanDirection;
17
18 typedef struct _termSelectRec
19 {
20     XEvent *event;
21     String *params;
22     Cardinal *num_params;
23 } _TermSelectRec;
24
25 typedef struct _TermSelectPrimary
26 {
27     Atom    target;
28     Time    time;
29     int     num_chars;
30     int     ref_count;
31 } _TermSelectPrimaryRec;
32
33 typedef int selectPosition;
34
35 typedef struct _TermSelectionHint
36 {
37     int x;
38     int y;
39 } TermSelectionHint;
40
41 /* 
42 ** Selection specific information.
43 */
44 typedef struct _termSelectInfoRec
45 {    
46     Boolean               ownPrimary;   /* do we own the primary selection? */
47     Time                  primaryTime;  /* time primary selection acquired  */
48     TermSelectType        selectType;   /* rectanglar selection ?           */
49     short                 scanArraySize;
50     XmTextScanType       *scanArray;    /* possible values for scanType     */
51     XmTextScanType        scanType;     /* line, word, character, all       */
52     XtIntervalId          selectID;     /* AppTimeOut ID                    */
53     short                 rows;         /* rows,cols current buffer useful  */
54     short                 columns;      /* for converting position->row,col */
55     XmTextPosition        anchor;       /* anchor for extending selecions   */
56     XmTextPosition        begin;        /* upper left corner of selection   */
57     XmTextPosition        end;          /* lower right corner of selection  */
58     XmTextPosition        origBegin;    /* upper left corner of selection   */
59     XmTextPosition        origEnd;      /* lower right corner of selection  */
60     TermScanDirection     extendDir;    /* direction to extend selection    */
61     TermScanDirection     direction;    /* select right or left?            */
62     Time                  lastTime;     /* time of last button press        */
63     Boolean               extending;    /* true if extending selection      */
64     int                   threshold;    /* minimum # of pixels moved        */
65     TermSelectionHint     hint;         /* initial coordinates of selection */
66     TermSelectionHint     extend;       /* coordinates of extend event      */
67     Boolean               cancel;       /* used to end scroll selection     */
68     Boolean               isScrollUp;   /* scroll selection direction       */
69     Boolean               sel_start;    /* doing selection (True) or drag   */
70 } TermSelectInfoRec;
71
72 #ifdef     __cplusplus
73 extern "C" {
74 #endif  /* __cplusplus */
75
76 static Time
77 getServerTime
78 (
79      Widget w
80 );
81
82 static void
83 setScanType
84 (
85     Widget  w,
86     XEvent *event
87 );
88
89 typedef struct {
90     Widget widget;
91     XmTextPosition insert_pos;
92     int num_chars;
93     Time timestamp;
94     Boolean move;
95 } _DtTermDropTransferRec;
96
97 #ifndef _XmConst
98 #define _XmConst /**/
99 #endif
100
101 void
102 _DtTermPrimSelect2ButtonMouse(
103         Widget w,
104         XEvent *event,
105         char **params,
106         Cardinal *num_params 
107 );
108
109 #ifdef  __cplusplus
110 } /* close scope of 'extern "C"'... */
111 #endif  /* __cplusplus */
112
113 #endif /* _Dt_TermPrimSelectP_h */
114 /* DON'T ADD ANYTHING AFTER THIS #endif... */