Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

open-axiom repository from github

24005 views
1
/*
2
Copyright (C) 1991-2002, The Numerical ALgorithms Group Ltd.
3
All rights reserved.
4
Copyright (C) 2007-2008, Gabriel Dos Reis.
5
All rights reserved.
6
7
Redistribution and use in source and binary forms, with or without
8
modification, are permitted provided that the following conditions are
9
met:
10
11
- Redistributions of source code must retain the above copyright
12
notice, this list of conditions and the following disclaimer.
13
14
- Redistributions in binary form must reproduce the above copyright
15
notice, this list of conditions and the following disclaimer in
16
the documentation and/or other materials provided with the
17
distribution.
18
19
- Neither the name of The Numerical ALgorithms Group Ltd. nor the
20
names of its contributors may be used to endorse or promote products
21
derived from this software without specific prior written permission.
22
23
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
24
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
26
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
27
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
*/
35
36
37
/*
38
to be included in control.c for drawing the colormap and
39
process.c for getting the mouse input
40
*/
41
42
#define controlMASK (ButtonPressMask + ButtonReleaseMask + ExposureMask)
43
#define potMASK (ButtonPressMask + ButtonReleaseMask + ButtonMotionMask + LeaveWindowMask)
44
#define buttonMASK (ButtonPressMask + ButtonReleaseMask + ButtonMotionMask + LeaveWindowMask)
45
#define colorMASK (ButtonPressMask + ButtonReleaseMask + ButtonMotionMask + LeaveWindowMask)
46
47
48
#define mouseWait 50
49
/* make mouse grab for stationary mouse on a potentiometer slower */
50
51
#define controlCreateMASK CWBackPixel | CWBorderPixel | CWEventMask |CWCursor |CWColormap | CWOverrideRedirect
52
#define buttonCreateMASK CWEventMask
53
#define messageCreateMASK 0
54
#define colormapCreateMASK CWEventMask
55
56
#define controlWidth 300
57
#define controlHeight 400
58
#define quitWidth 63
59
#define quitHeight 107
60
#define saveWidth 63
61
#define saveHeight 107
62
#define borderWidth 22
63
#define borderHeight 45
64
65
66
#define controlCursorForeground monoColor(4)
67
#define controlCursorBackground monoColor(54)
68
#define controlTitleColor monoColor(36)
69
#define controlPotHeaderColor monoColor(52)
70
#define controlColorColor monoColor(13)
71
#define controlColorSignColor monoColor(22)
72
73
#define headerHeight headerFont->max_bounds.ascent
74
#define controlMessageHeight globalFont->max_bounds.ascent +globalFont->max_bounds.descent+4
75
76
#define potA 25 /* y coordinate of line dividing
77
potentiometers from stuff above it */
78
#define potB 173 /* y coordinate of line dividing
79
potentiometers from title */
80
81
#define cmapA 233 /* y coordinate of line dividing
82
colormap from stuff above it */
83
84
#define butA ((cp->buttonQueue[render]).buttonY - 5)
85
86
#define closeL ((cp->buttonQueue[closeAll]).buttonX - 5)
87
#define closeA ((cp->buttonQueue[closeAll]).buttonY - 5)
88
89
#define controlMessageY 181
90
#define controlMessageColor monoColor(68)
91
92
#define offColor 13
93
#define onColor 98
94
#define modeColor 44
95
96
#define colormapX 21
97
#define colormapY 240
98
#define colormapW 290
99
#define colormapH 48
100
#define colorWidth 8
101
#define colorHeight 8
102
#define colorOffset 3
103
#define colorOffsetX 24
104
#define colorOffsetY 16
105
#define colorPointer 16
106
107