Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / DtTerm / TermPrim / TermPrimSelectP.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* 
24 ** $XConsortium: TermPrimSelectP.h /main/1 1996/04/21 19:19:31 drk $
25 */
26 /*                                                                      *
27  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
28  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
29  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
30  * (c) Copyright 1993, 1994 Novell, Inc.                                *
31  */
32 #ifndef   _Dt_TermPrimSelectP_h
33 #define   _Dt_TermPrimSelectP_h
34
35 #include <Xm/Xm.h>
36 #include "TermPrimSelect.h"
37
38 typedef enum { scanLeft, scanRight } TermScanDirection;
39
40 typedef struct _termSelectRec
41 {
42     XEvent *event;
43     String *params;
44     Cardinal *num_params;
45 } _TermSelectRec;
46
47 typedef struct _TermSelectPrimary
48 {
49     Atom    target;
50     Time    time;
51     int     num_chars;
52     int     ref_count;
53 } _TermSelectPrimaryRec;
54
55 typedef int selectPosition;
56
57 typedef struct _TermSelectionHint
58 {
59     int x;
60     int y;
61 } TermSelectionHint;
62
63 /* 
64 ** Selection specific information.
65 */
66 typedef struct _termSelectInfoRec
67 {    
68     Boolean               ownPrimary;   /* do we own the primary selection? */
69     Time                  primaryTime;  /* time primary selection acquired  */
70     TermSelectType        selectType;   /* rectanglar selection ?           */
71     short                 scanArraySize;
72     XmTextScanType       *scanArray;    /* possible values for scanType     */
73     XmTextScanType        scanType;     /* line, word, character, all       */
74     XtIntervalId          selectID;     /* AppTimeOut ID                    */
75     short                 rows;         /* rows,cols current buffer useful  */
76     short                 columns;      /* for converting position->row,col */
77     XmTextPosition        anchor;       /* anchor for extending selecions   */
78     XmTextPosition        begin;        /* upper left corner of selection   */
79     XmTextPosition        end;          /* lower right corner of selection  */
80     XmTextPosition        origBegin;    /* upper left corner of selection   */
81     XmTextPosition        origEnd;      /* lower right corner of selection  */
82     TermScanDirection     extendDir;    /* direction to extend selection    */
83     TermScanDirection     direction;    /* select right or left?            */
84     Time                  lastTime;     /* time of last button press        */
85     Boolean               extending;    /* true if extending selection      */
86     int                   threshold;    /* minimum # of pixels moved        */
87     TermSelectionHint     hint;         /* initial coordinates of selection */
88     TermSelectionHint     extend;       /* coordinates of extend event      */
89     Boolean               cancel;       /* used to end scroll selection     */
90     Boolean               isScrollUp;   /* scroll selection direction       */
91     Boolean               sel_start;    /* doing selection (True) or drag   */
92 } TermSelectInfoRec;
93
94 #ifdef     __cplusplus
95 extern "C" {
96 #endif  /* __cplusplus */
97
98 static Time
99 getServerTime
100 (
101      Widget w
102 );
103
104 static void
105 setScanType
106 (
107     Widget  w,
108     XEvent *event
109 );
110
111 typedef struct {
112     Widget widget;
113     XmTextPosition insert_pos;
114     int num_chars;
115     Time timestamp;
116     Boolean move;
117 } _DtTermDropTransferRec;
118
119 #ifndef _XmConst
120 #define _XmConst /**/
121 #endif
122
123 void
124 _DtTermPrimSelect2ButtonMouse(
125         Widget w,
126         XEvent *event,
127         char **params,
128         Cardinal *num_params 
129 );
130
131 #ifdef  __cplusplus
132 } /* close scope of 'extern "C"'... */
133 #endif  /* __cplusplus */
134
135 #endif /* _Dt_TermPrimSelectP_h */
136 /* DON'T ADD ANYTHING AFTER THIS #endif... */