File: Matrix.h

package info (click to toggle)
gridengine 8.1.9%2Bdfsg-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 56,880 kB
  • sloc: ansic: 432,689; java: 87,068; cpp: 31,958; sh: 29,429; jsp: 7,757; perl: 6,336; xml: 5,828; makefile: 4,701; csh: 3,928; ruby: 2,221; tcl: 1,676; lisp: 669; yacc: 519; python: 503; lex: 361; javascript: 200
file content (983 lines) | stat: -rw-r--r-- 32,173 bytes parent folder | download | duplicates (6)
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
/*
 * Copyright(c) 1992 Bell Communications Research, Inc. (Bellcore)
 * Copyright(c) 1995-99 Andrew Lister
 *
 *                        All rights reserved
 * Permission to use, copy, modify and distribute this material for
 * any purpose and without fee is hereby granted, provided that the
 * above copyright notice and this permission notice appear in all
 * copies, and that the name of Bellcore not be used in advertising
 * or publicity pertaining to this material without the specific,
 * prior written permission of an authorized representative of
 * Bellcore.
 *
 * BELLCORE MAKES NO REPRESENTATIONS AND EXTENDS NO WARRANTIES, EX-
 * PRESS OR IMPLIED, WITH RESPECT TO THE SOFTWARE, INCLUDING, BUT
 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR ANY PARTICULAR PURPOSE, AND THE WARRANTY AGAINST IN-
 * FRINGEMENT OF PATENTS OR OTHER INTELLECTUAL PROPERTY RIGHTS.  THE
 * SOFTWARE IS PROVIDED "AS IS", AND IN NO EVENT SHALL BELLCORE OR
 * ANY OF ITS AFFILIATES BE LIABLE FOR ANY DAMAGES, INCLUDING ANY
 * LOST PROFITS OR OTHER INCIDENTAL OR CONSEQUENTIAL DAMAGES RELAT-
 * ING TO THE SOFTWARE.
 *
 * MatrixWidget Author: Andrew Wason, Bellcore, aw@bae.bellcore.com
 *
 * $Id: Matrix.h,v 1.1 2001-07-18 11:05:59 root Exp $
 */

#ifndef _Xbae_Matrix_h
#define _Xbae_Matrix_h

/*
 * Matrix Widget public include file
 */

#include <Xm/Xm.h>
#include <X11/Core.h>
#include "patchlevel.h"

/*
 * A few definitions we like to use, but those with R4 won't have.
 * From Xfuncproto.h in R5.
 */

#ifndef XlibSpecificationRelease
# ifndef _XFUNCPROTOBEGIN
#   ifdef __cplusplus                      /* for C++ V2.0 */
#     define _XFUNCPROTOBEGIN extern "C" {
#     define _XFUNCPROTOEND }
#   else
#     define _XFUNCPROTOBEGIN
#     define _XFUNCPROTOEND
#   endif
# endif /* _XFUNCPROTOBEGIN */
#else
#include <X11/Xfuncproto.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

/* Resources:
 * Name                        Class                        RepType                Default Value
 * ----                        -----                        -------                -------------
 * allowColumnResize        ColumnResize                Boolean                False
 * altRowCount                AltRowCount                int                1
 * boldLabels                BoldLabels                Boolean                False
 * buttonLabels                ButtonLabels                Boolean                False
 * buttonLabelBackground Color                        Pixel                dynamic
 * calcCursorPosition        CalcCursorPosition        Boolean                False
 * cellBackgrounds        Colors                        PixelTable        NULL
 * cellHighlightThickness HighlightThickness        HorizontalDimension 2
 * cellMarginHeight        MarginHeight                VerticalDimension   5
 * cellMarginWidth        MarginWidth                HorizontalDimension 5
 * cells                Cells                        StringTable        NULL
 * cellShadowThickness        ShadowThickness                Dimension        2
 * cellShadowType        ShadowType                unsigned char        SHADOW_OUT
 * cellShadowTypes        CellShadowTypes                ShadowTypeTable NULL
 * cellUserData                CellUserData                UserDataTable        NULL
 * clipWindow                XmCClipWindow                Widget                NULL (get only)
 * colors                Colors                        PixelTable        NULL
 * columnAlignments        Alignments                AlignmentArray        dynamic
 * columnButtonLabels        ButtonLabels                BooleanArray        NULL
 * columnLabelAlignments Alignments                AlignmentArray        dynamic
 * columnLabelColor        Color                        Pixel                dynamic
 * columnLabels                Labels                        StringArray        NULL
 * columnMaxLengths        ColumnMaxLengths        MaxLengthArray        NULL
 * columnShadowTypes        ShadowTypes                ShadowTypeArray NULL
 * columnUserData        UserDatas                UserDataArray        NULL
 * columnWidths                ColumnWidths                WidthArray        NULL
 * columns                Columns                        int                0
 * defaultActionCallback Callback               Callback        NULL
 * doubleClickInterval  Interval                int             dynamic
 * drawCellCallback        Callback                Callback        NULL
 * enterCellCallback        Callback                Callback        NULL
 * evenRowBackground        Background                Pixel                dynamic
 * fill                        Fill                        Boolean                False
 * fixedColumns                FixedColumns                Dimension        0
 * fixedRows                FixedRows                Dimension        0
 * fontList                FontList                FontList        fixed
 * labelFont                FontList                FontList        fixed
 * gridLineColor        Color                        Pixel                dynamic
 * gridType                GridType                GridType        XmGRID_CELL_LINE
 * highlightedCells        HighlightedCells        HighlightTable        dynamic
 * horizonalScrollBar        HorizonalScrollBar        Widget                NULL (get only)
 * horizontalScrollBarDisplayPolicy
 *                        XmCMatrixScrollBarDisplayPolicy
 *                                                unsigned char        AS_NEEDED
 * labelActivateCallback Callback                Callback        NULL
 * leaveCellCallback        Callback                Callback        NULL
 * leftColumn           LeftColumn              int             0
 * modifyVerifyCallback        Callback                Callback        NULL
 * oddRowBackground        Background                Pixel                NULL
 * processDragCallback        Callback                Callback        NULL
 * resizeCallback        Callback                Callback        NULL
 * resizeColumnCallback        Callback                Callback        NULL
 * reverseSelect        reverseSelect                Boolean                False
 * rowButtonLabels                ButtonLabels                BooleanArray        NULL
 * rowLabelAlignment        Alignment                Alignment        XmALIGNMENT_END
 * rowLabelColor        Color                        Pixel                dynamic
 * rowLabelWidth        RowLabelWidth                Short                dynamic
 * rowLabels                Labels                        StringArray        NULL
 * rowShadowTypes        ShadowTypes                ShadowTypeArray NULL
 * rowUserData                UserDatas                UserDataArray        NULL
 * rows                        Rows                        int                0
 * selectCellCallback        Callback                Callback        NULL
 * selectedBackground        Color                        Pixel                dynamic
 * selectedCells        SelectedCells                BooleanTable        dynamic
 * selectedForeground        Color                        Pixel                dynamic
 * selectScrollVisible        SelectScrollVisible        Boolean                True
 * space                Space                        Dimension        6
 * shadowType                ShadowType                unsigned char        SHADOW_IN
 * textBackground        Backgound                Pixel           dynamic
 * textField                TextField                Widget                NULL (get only)
 * textShadowThickness        TextShadowThickness        Dimension        0
 * textTranslations        Translations                TranslationTable dynamic
 * topRow                TopRow                        int                0
 * trailingFixedColumns        TrailingFixedColumns        Dimension        0
 * trailingFixedRows        TrailingFixedRows        Dimension        0
 * traverseCellCallback        Callback                Callback        NULL
 * traverseFixedCells        TraverseFixedCells        Boolean                False
 * verticalScrollBar        VerticalScrollBar        Widget                NULL (get only)
 * verticalScrollBarDisplayPolicy
 *                        XmCMatrixScrollBarDisplayPolicy
 *                                                unsigned char        AS_NEEDED
 * visibleColumns        VisibleColumns                Dimension        0
 * visibleRows                VisibleRows                Dimension        0
 * writeCellCallback        Callback                Callback        NULL
 */

#ifndef XmNallowColumnResize
#define XmNallowColumnResize                "allowColumnResize"
#endif
#ifndef XmNaltRowCount
#define XmNaltRowCount                        "altRowCount"
#endif
#ifndef XmNboldLabels
#define XmNboldLabels                        "boldLabels"
#endif
#ifndef XmNbuttonLabels
#define XmNbuttonLabels                        "buttonLabels"
#endif
#ifndef XmNbuttonLabelBackground
#define XmNbuttonLabelBackground        "buttonLabelBackground"
#endif
#ifndef XmNcalcCursorPosition
#define XmNcalcCursorPosition                "calcCursorPosition"
#endif
#ifndef XmNcellBackgrounds
#define XmNcellBackgrounds                "cellBackgrounds"
#endif
#ifndef XmNcellHighlightThickness
#define XmNcellHighlightThickness        "cellHighlightThickness"
#endif
#ifndef XmNcellMarginHeight
#define XmNcellMarginHeight                "cellMarginHeight"
#endif
#ifndef XmNcellMarginWidth
#define XmNcellMarginWidth                "cellMarginWidth"
#endif
#ifndef XmNcellShadowType
#define XmNcellShadowType                "cellShadowType"
#endif
#ifndef XmNcellShadowTypes
#define XmNcellShadowTypes                "cellShadowTypes"
#endif
#ifndef XmNcellShadowThickness
#define XmNcellShadowThickness                "cellShadowThickness"
#endif
#ifndef XmNcellUserData
#define XmNcellUserData                        "cellUserData"
#endif
#if CELL_WIDGETS
#ifndef XmNcellWidgets
#define XmNcellWidgets                        "cellWidgets"
#endif
#endif
#ifndef XmNcells
#define XmNcells                        "cells"
#endif
#ifndef XmNcolors
#define XmNcolors                        "colors"
#endif
#ifndef XmNcolumnAlignments
#define XmNcolumnAlignments                "columnAlignments"
#endif
#ifndef XmNcolumnButtonLabels
#define XmNcolumnButtonLabels                "columnButtonLabels"
#endif
#ifndef XmNcolumnLabelAlignments
#define XmNcolumnLabelAlignments        "columnLabelAlignments"
#endif
#ifndef XmNcolumnLabelBackground
#define XmNcolumnLabelBackground        "columnLabelBackground"
#endif
#ifndef XmNcolumnLabelColor
#define XmNcolumnLabelColor                "columnLabelColor"
#endif
#ifndef XmNcolumnLabels
#define XmNcolumnLabels                        "columnLabels"
#endif
#ifndef XmNcolumnMaxLengths
#define XmNcolumnMaxLengths                "columnMaxLengths"
#endif
#ifndef XmNcolumnShadowTypes
#define XmNcolumnShadowTypes                "columnShadowTypes"
#endif
#ifndef XmNcolumnUserData
#define XmNcolumnUserData                "columnUserData"
#endif
#ifndef XmNcolumnWidths
#define XmNcolumnWidths                        "columnWidths"
#endif
#ifndef XmNdrawCellCallback
#define XmNdrawCellCallback                "drawCellCallback"
#endif
#ifndef XmNenterCellCallback
#define XmNenterCellCallback                "enterCellCallback"
#endif
#ifndef XmNevenRowBackground
#define XmNevenRowBackground                "evenRowBackground"
#endif
#ifndef XmNfill
#define XmNfill                                "fill"
#endif
#ifndef XmNfixedColumns
#define XmNfixedColumns                        "fixedColumns"
#endif
#ifndef XmNfixedRows
#define XmNfixedRows                        "fixedRows"
#endif
#ifndef XmNgridLineColor
#define XmNgridLineColor                "gridLineColor"
#endif
#ifndef XmNgridType
#define XmNgridType                        "gridType"
#endif
#if XmVersion >= 1002
#ifndef XmNhighlightedCells
#define XmNhighlightedCells                "highlightedCells"
#endif
#endif
#ifndef XmNhorizontalScrollBarDisplayPolicy
#define XmNhorizontalScrollBarDisplayPolicy "horizontalScrollBarDisplayPolicy"
#endif
#ifndef XmNlabelActivateCallback
#define XmNlabelActivateCallback        "labelActivateCallback"
#endif
#ifndef XmNlabelFont
#define XmNlabelFont                        "labelFont"
#endif
#ifndef XmNleaveCellCallback
#define XmNleaveCellCallback                "leaveCellCallback"
#endif
#ifndef XmNleftColumn
#define XmNleftColumn                        "leftColumn"
#endif
#ifndef XmNoddRowBackground
#define XmNoddRowBackground                "oddRowBackground"
#endif
#if XmVersion > 1001
#ifndef XmNprocessDragCallback
#define XmNprocessDragCallback                "processDragCallback"
#endif
#endif
#ifndef XmNresizeCallback
#define XmNresizeCallback               "resizeCallback"
#endif
#ifndef XmNresizeColumnCallback
#define XmNresizeColumnCallback                "resizeColumnCallback"
#endif
#ifndef XmNreverseSelect
#define XmNreverseSelect                "reverseSelect"
#endif
#ifndef XmNrowButtonLabels
#define XmNrowButtonLabels                "rowButtonLabels"
#endif
#ifndef XmNrowLabelAlignment
#define XmNrowLabelAlignment                "rowLabelAlignment"
#endif
#ifndef XmNrowLabelWidth
#define XmNrowLabelWidth                "rowLabelWidth"
#endif
#ifndef XmNrowLabelBackground
#define XmNrowLabelBackground                "rowLabelBackground"
#endif
#ifndef XmNrowLabelColor
#define XmNrowLabelColor                "rowLabelColor"
#endif
#ifndef XmNrowLabels
#define XmNrowLabels                        "rowLabels"
#endif
#ifndef XmNrowShadowTypes
#define XmNrowShadowTypes                "rowShadowTypes"
#endif
#ifndef XmNrowUserData
#define XmNrowUserData                        "rowUserData"
#endif
#ifndef XmNselectedCells
#define XmNselectedCells                "selectedCells"
#endif
#ifndef XmNselectedBackground
#define XmNselectedBackground                "selectedBackground"
#endif
#ifndef XmNselectCellCallback
#define XmNselectCellCallback                "selectCellCallback"
#endif
#ifndef XmNselectedForeground
#define XmNselectedForeground                "selectedForeground"
#endif
#ifndef XmNselectScrollVisible
#define XmNselectScrollVisible                "selectScrollVisible"
#endif
#ifndef XmNtextBackground
#define XmNtextBackground                "textBackground"
#endif
#ifndef XmNtextField
#define XmNtextField                        "textField"
#endif
#ifndef XmNtopRow
#define XmNtopRow                        "topRow"
#endif
#ifndef XmNtrailingAttachedBottom
#define XmNtrailingAttachedBottom        "trailingAttachedBottom"
#endif
#ifndef XmNtrailingAttachedRight
#define XmNtrailingAttachedRight        "trailingAttachedRight"
#endif
#ifndef XmNtrailingFixedColumns
#define XmNtrailingFixedColumns                "trailingFixedColumns"
#endif
#ifndef XmNtrailingFixedRows
#define XmNtrailingFixedRows                "trailingFixedRows"
#endif
#ifndef XmNleftColumn
#define XmNleftColumn                        "leftColumn"
#endif
#ifndef XmNtextShadowThickness
#define XmNtextShadowThickness                "textShadowThickness"
#endif
#ifndef XmNtraverseCellCallback
#define XmNtraverseCellCallback                "traverseCellCallback"
#endif
#ifndef XmNtraverseFixedCells
#define XmNtraverseFixedCells                "traverseFixedCells"
#endif
#ifndef XmNverticalScrollBarDisplayPolicy
#define XmNverticalScrollBarDisplayPolicy "verticalScrollBarDisplayPolicy"
#endif
#ifndef XmNvisibleColumns
#define XmNvisibleColumns                "visibleColumns"
#endif
#ifndef XmNvisibleRows
#define XmNvisibleRows                        "visibleRows"
#endif
#ifndef XmNwriteCellCallback
#define XmNwriteCellCallback                "writeCellCallback"
#endif


#ifndef XmCAlignments
#define XmCAlignments                        "Alignments"
#endif
#ifndef XmCAltRowCount
#define XmCAltRowCount                        "AltRowCount"
#endif
#ifndef XmCBoldLabels
#define XmCBoldLabels                        "BoldLabels"
#endif
#ifndef XmCButtonLabels
#define XmCButtonLabels                        "ButtonLabels"
#endif
#ifndef XmCCalcCursorPosition
#define XmCCalcCursorPosition                "CalcCursorPosition"
#endif
#ifndef XmCCells
#define XmCCells                        "Cells"
#endif
#ifndef XmCCellShadowTypes
#define XmCCellShadowTypes                "CellShadowTypes"
#endif
#ifndef XmCCellUserData
#define XmCCellUserData                        "CellUserData"
#endif
#if CELL_WIDGETS
#ifndef XmCCellWidgets
#define XmCCellWidgets                        "CellWidgets"
#endif
#endif
#ifndef XmCColors
#define XmCColors                        "Colors"
#endif
#ifndef XmCColumnMaxLengths
#define XmCColumnMaxLengths                "ColumnMaxLengths"
#endif
#ifndef XmCColumnResize
#define XmCColumnResize                        "ColumnResize"
#endif
#ifndef XmCColumnWidths
#define XmCColumnWidths                        "ColumnWidths"
#endif
#ifndef XmCFill
#define XmCFill                                "Fill"
#endif
#ifndef XmCFixedColumns
#define XmCFixedColumns                        "FixedColumns"
#endif
#ifndef XmCFixedRows
#define XmCFixedRows                        "FixedRows"
#endif
#ifndef XmCGridType
#define XmCGridType                        "GridType"
#endif
#if XmVersion >= 1002
#ifndef XmCHighlightedCells
#define XmCHighlightedCells                "HighlightedCells"
#endif
#endif
#ifndef XmCLabels
#define XmCLabels                        "Labels"
#endif
#ifndef XmCLeftColumn
#define XmCLeftColumn                        "LeftColumn"
#endif
#ifndef XmCMatrixScrollBarDisplayPolicy
#define XmCMatrixScrollBarDisplayPolicy        "MatrixScrollBarDisplayPolicy"
#endif
#ifndef XmCReverseSelect
#define XmCReverseSelect                "ReverseSelect"
#endif
#ifndef XmCRowLabelWidth
#define XmCRowLabelWidth                "RowLabelWidth"
#endif
#ifndef XmCSelectedCells
#define XmCSelectedCells                "SelectedCells"
#endif
#ifndef XmCSelectScrollVisible
#define XmCSelectScrollVisible                "SelectScrollVisible"
#endif
#ifndef XmCShadowTypes
#define XmCShadowTypes                        "ShadowTypes"
#endif
#ifndef XmCTextBackground
#define XmCTextBackground                "TextBackground"
#endif
#ifndef XmCTextField
#define XmCTextField                        "TextField"
#endif
#ifndef XmCTextShadowThickness
#define XmCTextShadowThickness                "TextShadowThickness"
#endif
#ifndef XmCTraverseFixedCells
#define XmCTraverseFixedCells                "TraverseFixedCells"
#endif
#ifndef XmCTopRow
#define XmCTopRow                        "TopRow"
#endif
#ifndef XmCTrailingAttachedBottom
#define XmCTrailingAttachedBottom        "TrailingAttachedBottom"
#endif
#ifndef XmCTrailingAttachedRight
#define XmCTrailingAttachedRight        "TrailingAttachedRight"
#endif
#ifndef XmCTrailingFixedColumns
#define XmCTrailingFixedColumns                "TrailingFixedColumns"
#endif
#ifndef XmCTrailingFixedRows
#define XmCTrailingFixedRows                "TrailingFixedRows"
#endif
#ifndef XmCUserDatas
#define XmCUserDatas                        "UserDatas"
#endif
#ifndef XmCVisibleColumns
#define XmCVisibleColumns                "VisibleColumns"
#endif
#ifndef XmCVisibleRows
#define XmCVisibleRows                        "VisibleRows"
#endif

#ifndef XmRStringArray
#define XmRStringArray                        "StringArray"
#endif
#ifndef XmRBooleanArray
#define XmRBooleanArray                        "BooleanArray"
#endif
#ifndef XmRAlignmentArray
#define XmRAlignmentArray                "AlignmentArray"
#endif
#ifndef XmRBooleanTable
#define XmRBooleanTable                        "BooleanTable"
#endif
#ifndef XmRCellTable
#define XmRCellTable                        "CellTable"
#endif
#ifndef XmRWidgetTable
#define XmRWidgetTable                        "WidgetTable"
#endif
#ifndef XmRGridType
#define XmRGridType                        "GridType"
#endif
#if XmVersion >= 1002
#ifndef XmRHighlightTable
#define XmRHighlightTable                "HighlightTable"
#endif
#endif
#ifndef XmRMatrixScrollBarDisplayPolicy
#define XmRMatrixScrollBarDisplayPolicy "MatrixScrollBarDisplayPolicy"
#endif
#ifndef XmRMaxLengthArray
#define XmRMaxLengthArray                "MaxLengthArray"
#endif
#ifndef XmRPixelTable
#define XmRPixelTable                        "PixelTable"
#endif
#ifndef XmRShadowTypeTable
#define XmRShadowTypeTable                "ShadowTypeTable"
#endif
#ifndef XmRShadowTypeArray
#define XmRShadowTypeArray                "ShadowTypeArray"
#endif
#ifndef XmRUserDataTable
#define XmRUserDataTable                "UserDataTable"
#endif
#ifndef XmRUserDataArray
#define XmRUserDataArray                "UserDataArray"
#endif
#ifndef XmRWidthArray
#define XmRWidthArray                        "WidthArray"
#endif


#ifndef XbaeIsXbaeMatrix
#define XbaeIsXbaeMatrix( w)        XtIsSubclass(w, xbaeMatrixWidgetClass)
#endif /* XbaeIsXbaeMatrix */

/* Class record constants */

externalref WidgetClass xbaeMatrixWidgetClass;

typedef struct _XbaeMatrixClassRec *XbaeMatrixWidgetClass;
typedef struct _XbaeMatrixRec *XbaeMatrixWidget;

/*
 * Prototype wrapper
 */
#ifndef P
#if defined(__STDC__) || defined (__cplusplus)
#define P(x)                x
#else
#define P(x)                ()
#define const
#define volatile
#endif
#endif

/*
 * External interfaces to class methods
 */
_XFUNCPROTOBEGIN

extern void XbaeMatrixAddColumns P((Widget, int, String *, String *, short *,
                                     int *, unsigned char *, unsigned char *,
                                     Pixel *, int));
extern void XbaeMatrixAddRows P((Widget,  int , String *, String *,
                                  Pixel *, int));
extern void XbaeMatrixCancelEdit P((Widget, Boolean));
extern Boolean XbaeMatrixCommitEdit P((Widget, Boolean));
extern void XbaeMatrixDeleteColumns P((Widget, int, int));
extern void XbaeMatrixDeleteRows P((Widget, int, int));
extern void XbaeMatrixDeselectAll P((Widget));
extern void XbaeMatrixDeselectCell P((Widget, int, int));
extern void XbaeMatrixDeselectColumn P((Widget, int));
extern void XbaeMatrixDeselectRow P((Widget, int));
extern void XbaeMatrixEditCell P((Widget, int, int));
extern void XbaeMatrixFirstSelectedCell P((Widget, int *, int *));
extern int XbaeMatrixFirstSelectedColumn P((Widget));
extern int XbaeMatrixFirstSelectedRow P((Widget));
extern String XbaeMatrixGetCell P((Widget, int, int));
extern XtPointer XbaeMatrixGetCellUserData P((Widget, int, int));
extern XtPointer XbaeMatrixGetColumnUserData P((Widget, int));
extern void XbaeMatrixGetCurrentCell P((Widget, int *, int *));
extern int XbaeMatrixGetEventRowColumn P((Widget, XEvent *, int *, int *));
extern Boolean XbaeMatrixEventToXY P((Widget, XEvent *, int *, int *));
extern Boolean XbaeMatrixRowColToXY P((Widget, int, int, int *, int *));
extern int XbaeMatrixGetNumSelected P((Widget));
extern XtPointer XbaeMatrixGetRowUserData P((Widget, int));
extern Boolean XbaeMatrixIsCellSelected P((Widget, int, int));
extern Boolean XbaeMatrixIsColumnSelected P((Widget, int));
extern Boolean XbaeMatrixIsRowSelected P((Widget, int));
extern void XbaeMatrixRefresh P((Widget));
extern void XbaeMatrixRefreshCell P((Widget, int, int));
extern void XbaeMatrixRefreshColumn P((Widget, int));
extern void XbaeMatrixRefreshRow P((Widget, int));
extern void XbaeMatrixSelectAll P((Widget));
extern void XbaeMatrixSelectCell P((Widget, int, int));
extern void XbaeMatrixSelectColumn P((Widget, int));
extern void XbaeMatrixSelectRow P((Widget, int));
#if XmVersion >= 1002
extern void XbaeMatrixHighlightCell P((Widget, int, int));
extern void XbaeMatrixHighlightRow P((Widget, int));
extern void XbaeMatrixHighlightColumn P((Widget, int));
extern void XbaeMatrixUnhighlightCell P((Widget, int, int));
extern void XbaeMatrixUnhighlightRow P((Widget, int));
extern void XbaeMatrixUnhighlightColumn P((Widget, int));
extern void XbaeMatrixUnhighlightAll P((Widget));
#endif
extern void XbaeMatrixSetCell P((Widget, int, int, const String));
extern void XbaeMatrixSetCellBackground P((Widget, int, int, Pixel));
extern void XbaeMatrixSetCellColor P((Widget, int, int, Pixel));
extern void XbaeMatrixSetCellUserData P((Widget, int, int, XtPointer));
#if CELL_WIDGETS
extern void XbaeMatrixSetCellWidget P((Widget, int, int, Widget));
#endif
extern void XbaeMatrixSetColumnBackgrounds P((Widget, int, Pixel *, int));
extern void XbaeMatrixSetColumnColors P((Widget, int, Pixel *, int));
extern void XbaeMatrixSetColumnUserData P((Widget, int, XtPointer));
extern void XbaeMatrixSetRowBackgrounds P((Widget, int, Pixel *, int));
extern void XbaeMatrixSetRowColors P((Widget, int , Pixel *, int));
extern void XbaeMatrixSetRowUserData P((Widget, int, XtPointer));
extern int XbaeMatrixVisibleColumns P((Widget));
extern int XbaeMatrixVisibleRows P((Widget));
extern int XbaeMatrixNumColumns P((Widget));
extern int XbaeMatrixNumRows P((Widget));
extern void XbaeMatrixDisableRedisplay P((Widget));
extern void XbaeMatrixEnableRedisplay P((Widget, Boolean));
extern void XbaeMatrixMakeCellVisible P((Widget, int, int));
extern Boolean XbaeMatrixIsRowVisible P((Widget, int));
extern Boolean XbaeMatrixIsColumnVisible P((Widget, int));
extern Boolean XbaeMatrixIsCellVisible P((Widget, int, int));
extern void XbaeMatrixVisibleCells P((Widget, int *, int *, int *, int *));
extern String XbaeMatrixGetColumnLabel P((Widget, int));
extern String XbaeMatrixGetRowLabel P((Widget, int));
extern void XbaeMatrixSetColumnLabel P((Widget, int, String));
extern void XbaeMatrixSetRowLabel P((Widget, int, String));
extern Widget XbaeCreateMatrix P((Widget, String, ArgList, Cardinal));
_XFUNCPROTOEND

typedef unsigned char        Alignment;
typedef Alignment *        AlignmentArray;
typedef String *        StringTable;
typedef short                 Width;
typedef Width *                WidthArray;
typedef int                 MaxLength;
typedef MaxLength *        MaxLengthArray;

/*
 * cell shadow types
 */
 
enum
{
    XmGRID_NONE                    = 0x00,
    XmGRID_CELL_LINE            = 0x02,
    XmGRID_CELL_SHADOW            = 0x03,
    XmGRID_ROW_LINE            = 0x04,
    XmGRID_ROW_SHADOW            = 0x05,
    XmGRID_COLUMN_LINE            = 0x08,
    XmGRID_COLUMN_SHADOW    = 0x09,

    /* Deprecated types. Use will cause
     * a run-time warning to be issued. */
    XmGRID_LINE                    = 0x20,
    XmGRID_SHADOW_IN            = 0x40,
    XmGRID_SHADOW_OUT            = 0x80
};


/*
 * Enumeration for Matrix ScrollBar Display Policy
 */
enum
{
    XmDISPLAY_NONE,
    XmDISPLAY_AS_NEEDED,
    XmDISPLAY_STATIC
};


/*
 * Enumeration for type of a cell
 */
typedef enum {
    FixedCell, NonFixedCell, RowLabelCell, ColumnLabelCell
} CellType;

#if XmVersion >= 1002
/*
 * Enumeration for highlight reason/location
 */
enum {
    HighlightNone        = 0x0000,
    HighlightCell        = 0x0001,
    HighlightRow        = 0x0002,
    HighlightColumn        = 0x0004,
    HighlightOther        = 0x0008,
    UnhighlightCell        = 0x0010,
    UnhighlightRow        = 0x0020,
    UnhighlightColumn        = 0x0040,
    UnhighlightAll        = UnhighlightCell | UnhighlightRow | UnhighlightColumn
};
#endif

/*
 * Callback reasons.  Try to stay out of range of the Motif XmCR_* reasons.
 */
typedef enum _XbaeReasonType
{
    XbaeModifyVerifyReason = 102,
    XbaeEnterCellReason,
    XbaeLeaveCellReason,
    XbaeTraverseCellReason,
    XbaeSelectCellReason,
    XbaeDrawCellReason,
    XbaeWriteCellReason,
    XbaeResizeReason,
    XbaeResizeColumnReason,
    XbaeDefaultActionReason,
    XbaeProcessDragReason,
    XbaeLabelActivateReason
}
XbaeReasonType;

/*
 * DrawCell types.
 */
typedef enum
{
    XbaeString=1,
    XbaePixmap
}
XbaeCellType;

/*
 * The 'Any' struct which can be used in callbacks used with different
 * Callback structs but only need to access its 4 members
 */
typedef struct _XbaeMatrixAnyCallbackStruct
{
    XbaeReasonType reason;
    XEvent *event;
    int row;
    int column;
}
XbaeMatrixAnyCallbackStruct;
    
/*
 * Struct passed to modifyVerifyCallback
 */
typedef struct _XbaeMatrixModifyVerifyCallbackStruct
{
    XbaeReasonType reason;
    XEvent *event;
    int row;
    int column;
    XmTextVerifyCallbackStruct *verify;
    const char *prev_text;
}
XbaeMatrixModifyVerifyCallbackStruct;

/*
 * Struct passed to enterCellCallback
 */
typedef struct _XbaeMatrixEnterCellCallbackStruct
{
    XbaeReasonType reason;
    XEvent *event;
    int row;
    int column;
    int position;
    String pattern;
    Boolean auto_fill;
    Boolean convert_case;
    Boolean overwrite_mode;
    Boolean select_text;
    Boolean map;
    Cardinal num_params;
    String *params;
    Boolean doit;

}
XbaeMatrixEnterCellCallbackStruct;

/*
 * Struct passed to leaveCellCallback
 */
typedef struct _XbaeMatrixLeaveCellCallbackStruct
{
    XbaeReasonType reason;
    XEvent *event;
    int row;
    int column;
    String value;
    Boolean doit;
}
XbaeMatrixLeaveCellCallbackStruct;

/*
 * Struct passed to traverseCellCallback
 */
typedef struct _XbaeMatrixTraverseCellCallbackStruct
{
    XbaeReasonType reason;
    XEvent *event;
    int row;
    int column;
    int next_row;
    int next_column;
    int fixed_rows;
    int fixed_columns;
    int trailing_fixed_rows;
    int trailing_fixed_columns;
    int num_rows;
    int num_columns;
    String param;
    XrmQuark qparam;
}
XbaeMatrixTraverseCellCallbackStruct;

/*
 * Struct passed to selectCellCallback
 */
typedef struct _XbaeMatrixSelectCellCallbackStruct
{
    XbaeReasonType reason;
    XEvent *event;
    int row;
    int column;
    Boolean **selected_cells;
    String **cells;
    Cardinal num_params;
    String *params;
}
XbaeMatrixSelectCellCallbackStruct;

/*
 * Struct passed to drawCellCallback
 */
typedef struct _XbaeMatrixDrawCellCallbackStruct
{
    XbaeReasonType reason;
    XEvent *event;
    int row;
    int column;
    int width;
    int height;
    XbaeCellType type;
    String string;
    Pixmap pixmap;
    Pixmap mask;
    Pixel foreground;
    Pixel background;
    int depth;
}
XbaeMatrixDrawCellCallbackStruct;

/*
 * Struct passed to writeCellCallback
 */
typedef struct _XbaeMatrixWriteCellCallbackStruct
{
    XbaeReasonType reason;
    XEvent *event;
    int row;
    int column;
    XbaeCellType type;
    String string;
    Pixmap pixmap;
    Pixmap mask;
}
XbaeMatrixWriteCellCallbackStruct;


/*
 * Struct passed to resizeCallback
 */
typedef struct _XbaeMatrixResizeCallbackStruct
{
    XbaeReasonType reason;
    XEvent *event;
    int row;
    int column;
    Dimension width;
    Dimension height;
}
XbaeMatrixResizeCallbackStruct;

/*
 * Struct passed to resizeColumnCallback
 *
 */
typedef struct _XbaeMatrixResizeColumnCallbackStruct
{
    XbaeReasonType reason;
    XEvent *event;
    int row;
    int column;
    int which;
    int columns;    
    short *column_widths;
}
XbaeMatrixResizeColumnCallbackStruct;

#if XmVersion > 1001
/*
 * Struct passed to processDragCallback
 */
typedef struct _XbaeMatrixProcessDragCallbackStruct
{
    XbaeReasonType reason;
    XEvent *event;
    int row;
    int column;
    String string;
    XbaeCellType type;
    Pixmap pixmap;
    Pixmap mask;
    Cardinal num_params;
    String *params;
}
XbaeMatrixProcessDragCallbackStruct;
#endif

/*
 * Struct passed to defaultActionCallback
 */
typedef struct _XbaeMatrixDefaultActionCallbackStruct
{
    XbaeReasonType reason;
    XEvent *event;
    int row;
    int column;
}
XbaeMatrixDefaultActionCallbackStruct;

/*
 * Struct passed to labelActivateCallback
 */
typedef struct _XbaeMatrixLabelActivateCallbackStruct
{
    XbaeReasonType reason;
    XEvent *event;
    int row;
    int column;
    Boolean row_label;
    String label;
}
XbaeMatrixLabelActivateCallbackStruct;


/* provide clean-up for those with R4 */
#ifndef XlibSpecificationRelease
# undef _Xconst
# undef _XFUNCPROTOBEGIN
# undef _XFUNCPROTOEND
#endif

#ifdef __cplusplus
}  /* Close scope of 'extern "C"' declaration which encloses file. */
#endif

#endif /* _Xbae_Matrix_h */