aboutsummaryrefslogtreecommitdiff
path: root/vendor/x11iraf/obm/ObmW/TableP.h
blob: 352fb2787eb6eb1f8ffb80f096b3a5b08c7311e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/***********************************************************************

                             Table widget 
       		Copyright by Vladimir T. Romanovski
			 All rights reserved.
			
This  library is desined  for  free,  non-commercial  software  creation. 
It is changeable and can be improved. The author would greatly appreciate 
any  advises, new  components  and  patches  of  the  existing  programs.
Commercial  usage is  also  possible  with  participation of it's author.

*************************************************************************/

#ifndef _XawTableP_h
#define _XawTableP_h

/***********************************************************************
 *
 * Table Widget Private Data
 *
 ***********************************************************************/


#include <X11/Xraw/ContainerP.h>
#include <X11/Xraw/Table.h>
#include <X11/Xraw/xraw_table.h>

/* New fields for the Table widget class record */

typedef struct {int foo;} TableClassPart;

/* Full class record declaration */
typedef struct _TableClassRec {
    CoreClassPart       core_class;
    CompositeClassPart  composite_class;
    ConstraintClassPart constraint_class;
    ContainerClassPart  container_class;
    TableClassPart	table_class;
} TableClassRec;

#define MAX_ROWS 50

typedef struct _NormalReverseGC {
  int   used;
  Pixel fore;
  Pixel back;
  GC    normal;
  GC    reverse;
}NormalReverseGC;

typedef struct _ShadowGC {
  int   used;
  Pixel back;
  GC    top;
  GC    bottom;
}ShadowGC;



/* New fields for the Table widget record */
typedef struct {
    /* ------------------------ resources -----------------------*/
    Pixel	  row_fore;
    Pixel	  column_fore;
    Pixel	  edit_fore;
    Pixel	  edit_back;
    Boolean       row_oriented;
    Boolean       editable;
    Boolean       literal;

    int           mask_number;
    int           columns;
    int           rows;
    Dimension     tab_margin;
    Dimension     row_margin;
    Dimension     col_margin;
    Dimension	  internal_width;
    Dimension	  internal_height;
    Dimension     label_shadow_thickness;
    unsigned char encoding;

    /* Default Values */
    Pixel	  foreground;
    XtJustify	  justify;
    XFontStruct	 *font;
    int           width;

    /* Allowance CallbackList */
    XtCallbackList   allow_add_row;
    XtCallbackList   allow_add_column;
    XtCallbackList   allow_delete_column;
    XtCallbackList   allow_delete_row;
    XtCallbackList   allow_delete_table;

    /* Information CallbackList */
    XtCallbackList   add_row;
    XtCallbackList   add_column;
    XtCallbackList   changed_cell;
    XtCallbackList   create_table;
    XtCallbackList   delete_column;
    XtCallbackList   delete_row;
    XtCallbackList   delete_table;
    XtCallbackList   what_cell;
    XtCallbackList   changed_column_width;
    XtCallbackList   changed_row_height;

    Widget           v_scroll;
    Widget           h_scroll;

    int              row_height;
    int              column_default_width;
    int              literal_width;

    /* ------------------------ private state -----------------------*/

    int         no_refigure;   /* no re-layout while > 0 */
    int         no_redraw;     /* no re-draw while > 0 */
    Boolean     was_resized;


    XawTableColumn column_data;
    
    Dimension   prefer_width;
    Dimension   prefer_height;
    Widget      edit;
    int         edit_row;
    int         edit_column;
    XawTableCell   cell_own;
    XawTableCell   table_stuff;

    GC          row_gc;        /* Intrinsics sharedable GC */
    GC          column_gc;     /* Intrinsics sharedable GC */

    GC          normal;        /* Table sharedable GC */
    GC          reverse;       /* Table sharedable GC */
    GC          top;
    GC          bottom;

    GC          edit_top;
    GC          edit_bottom;
    
    NormalReverseGC *normal_hash_table;
    ShadowGC        *shadow_hash_table;
    int              mask_hash_table;

    Atom             selections[30];
    int              num_selections;
} TablePart;

/****************************************************************
 *
 * Full instance record declaration
 *
 ****************************************************************/

typedef struct _TableRec {
    CorePart	   core;
    CompositePart  composite;
    ConstraintPart constraint;
    ContainerPart  container;
    TablePart	   table;
} TableRec;

extern TableClassRec tableClassRec;

#endif /* _XawTableP_h */