File: GEditTBP.h

package info (click to toggle)
xmbdfed 4.5patch1-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,672 kB
  • ctags: 2,433
  • sloc: ansic: 36,282; makefile: 101
file content (155 lines) | stat: -rw-r--r-- 3,538 bytes parent folder | download
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
/*
 * Copyright 2001 Computing Research Labs, New Mexico State University
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
 * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
 * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
#ifndef _h_XmuttGEditToolboxP
#define _h_XmuttGEditToolboxP

/*
 * $Id: GEditTBP.h,v 1.6 2001/09/19 21:00:41 mleisher Exp $
 */

#include <stdio.h>
#include <Xm/XmP.h>
#if (XmVERSION == 1) && (XmREVISION >= 2)
#include <Xm/PrimitiveP.h>
#elif (XmVERSION == 2)
#include <X11/CoreP.h>
#include <Xm/PrimitiveP.h>
#endif
#include <X11/Xmu/Atoms.h>
#include "GEditTB.h"

#ifdef __cplusplus
extern "C" {
#endif

/*
 * A simple structure representing the buttons on the toolbox.
 */
typedef struct {
    char *help;
    int x;
    int y;
    Pixmap pixmap;
    Region region;
    int other_toggles[2];
    Boolean set;
    Boolean toggle;
} _XmuttGEditTBoxButton;

typedef struct {
    int x;
    int y;
    Region region;
} _XmuttGEditTBoxColor;

/*
 * Class and instance structures.
 */
typedef struct _XmuttGlyphEditTBoxClassPart {
    Pixmap draw;
    Pixmap move;
    Pixmap copy;
    Pixmap fliph;
    Pixmap flipv;
    Pixmap shear;
    Pixmap rleft;
    Pixmap rright;
    Pixmap rotate;
    Pixmap uleft;
    Pixmap up;
    Pixmap uright;
    Pixmap left;
    Pixmap right;
    Pixmap dleft;
    Pixmap down;
    Pixmap dright;
    int refcnt;
    XtPointer extension;
} XmuttGlyphEditTBoxClassPart;

typedef struct _XmuttGlyphEditTBoxClassRec {
    CoreClassPart core_class;
    XmPrimitiveClassPart primitive_class;
    XmuttGlyphEditTBoxClassPart gedittb_class;
} XmuttGlyphEditTBoxClassRec;

typedef struct {
    /*
     * Public members.
     */
    XtCallbackList help;
    XtCallbackList activate;

    bdf_bitmap_t *gimage;

    unsigned long *colors;

    /*
     * Private members.
     */
    GC gc;
    GC fillgc;
    GC armgc;
    GC armfillgc;
    GC tsgc;
    GC bsgc;

    int cidx;

    XtIntervalId timer;
    int timer_button;
    int timer_count;

    Pixel arm_color;

    Region image_region;

    int pressed;
    int last;

    XPoint *points;
    unsigned long points_size;
    unsigned long points_used;

    /*
     * Width and height of the color spots.
     */
    int cbw;
    int cbh;

    _XmuttGEditTBoxColor cols[16];
    _XmuttGEditTBoxButton buttons[18];

    Boolean hasfocus;
} XmuttGlyphEditTBoxPart;

typedef struct _XmuttGlyphEditTBoxRec {
    CorePart core;
    XmPrimitivePart primitive;
    XmuttGlyphEditTBoxPart gedittb;
} XmuttGlyphEditTBoxRec;

#ifdef __cplusplus
}
#endif

#endif /* _h_XmuttGEditToolboxP */