Debian Codegraph @

sys/machine.cpp

raw symbols SCIP
1 /* machine.cpp
2 *
3 * Copyright (C) 1992-2005,2011-2013,2015,2016,2019-2021 Paul Boersma
4 *
5 * This code is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 *
10 * This code is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this work. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include "machine.h"cxx . . $ `<file>/sys/machine.h`/
20 #include "melder.h"cxx . . $ `<file>/melder/melder.h`/
21
22 #define LookAndFeel_MOTIFcxx . . $ `sys/machine.cpp:22:9`! 0
23 #define LookAndFeel_SGIcxx . . $ `sys/machine.cpp:23:9`! 1
24 #define LookAndFeel_CDEcxx . . $ `sys/machine.cpp:24:9`! 2
25 #define LookAndFeel_SOLARIScxx . . $ `sys/machine.cpp:25:9`! 3
26 #define LookAndFeel_HPcxx . . $ `sys/machine.cpp:26:9`! 4
27 #define LookAndFeel_SUN4cxx . . $ `sys/machine.cpp:27:9`! 5
28 #define LookAndFeel_MACcxx . . $ `sys/machine.cpp:28:9`! 6
29 #define LookAndFeel_WIN32cxx . . $ `sys/machine.cpp:29:9`! 7
30 #define LookAndFeel_LINUXcxx . . $ `sys/machine.cpp:30:9`! 8
31 #define LookAndFeel_COCOAcxx . . $ `sys/machine.cpp:31:9`! 9
32 #define LookAndFeel_CHROMEcxx . . $ `sys/machine.cpp:32:9`! 10
33
34 static int lookAndFeelcxx . . $ lookAndFeel.;
35
36 int Machine_getMenuBarTopcxx . . $ Machine_getMenuBarTop(b126dc7c1de90089). () {
37 static int tops [] = {
38 0, // Motif
39 0, // SGI
40 0, // CDE
41 0, // Solaris
42 0, // HP
43 0, // Sun4
44 0, // Mac
45 0, // Win32
46 0, // Linux
47 0, // Cocoa
48 30, // Chrome
49 };
50 return tops [lookAndFeelcxx . . $ lookAndFeel.];
51 }
52
53 int Machine_getMenuBarBottomcxx . . $ Machine_getMenuBarBottom(b126dc7c1de90089). () {
54 static int bottoms [] = {
55 26, // Motif
56 24, // SGI
57 28, // CDE
58 26, // Solaris
59 26, // HP
60 26, // Sun4
61 36, // Mac
62 0, // Win32
63 30, // Linux
64 36, // Cocoa
65 60, // Chrome
66 };
67 return bottoms [lookAndFeelcxx . . $ lookAndFeel.];
68 }
69
70 int Machine_getTitleBarHeightcxx . . $ Machine_getTitleBarHeight(b126dc7c1de90089). () {
71 static int heights [] = { /* Mostly copied from menu-bar height. */
72 26, // Motif
73 24, // SGI
74 28, // CDE
75 26, // Solaris
76 26, // HP
77 26, // Sun4
78 22, // Mac
79 20, // Win32
80 30, // Linux
81 22, // Cocoa
82 30, // Chrome
83 };
84 return heights [lookAndFeelcxx . . $ lookAndFeel.];
85 }
86
87 int Machine_getScrollBarWidthcxx . . $ Machine_getScrollBarWidth(b126dc7c1de90089). () {
88 static int widths [] = {
89 22, // Motif
90 22, // SGI
91 22, // CDE
92 22, // Solaris
93 22, // HP
94 22, // Sun4
95 16, // Mac
96 17, // Win32
97 18, // Linux
98 16, // Cocoa
99 24, // Chrome
100 };
101 return widths [lookAndFeelcxx . . $ lookAndFeel.];
102 }
103
104 int Machine_getTextHeightcxx . . $ Machine_getTextHeight(b126dc7c1de90089). () {
105 static int heights [] = {
106 29, // Motif
107 29, // SGI
108 25, // CDE
109 29, // Solaris
110 29, // HP
111 29, // Sun4
112 22, // Mac
113 20, // Win32
114 25, // Linux
115 23, // Cocoa
116 31, // Chrome
117 };
118 return heights [lookAndFeelcxx . . $ lookAndFeel.];
119 }
120
121 int Machine_getButtonHeightcxx . . $ Machine_getButtonHeight(b126dc7c1de90089). () {
122 static int heights [] = {
123 20, // Motif
124 20, // SGI
125 20, // CDE
126 20, // Solaris
127 20, // HP
128 20, // Sun4
129 20, // Mac
130 20, // Win32
131 30, // Linux
132 20, // Cocoa
133 40, // Chrome
134 };
135 return heights [lookAndFeelcxx . . $ lookAndFeel.];
136 }
137
138 void Machine_initLookAndFeelcxx . . $ Machine_initLookAndFeel(c759356ac01a31e7). (int argc, char **argv) {
139 /*
140 Determining the appropriate look-and-feel: the default depends on the client machine.
141 */
142 #if defined (macintosh)
143 lookAndFeel = LookAndFeel_COCOA;
144 return;
145 #elif defined (_WIN32)
146 lookAndFeel = LookAndFeel_WIN32;
147 return;
148 #elif defined (linuxcxx . . $ `<built-in>:480:9`!)
149 #if defined (chrome)
150 lookAndFeel = LookAndFeel_CHROME;
151 #else
152 lookAndFeelcxx . . $ lookAndFeel. = LookAndFeel_LINUXcxx . . $ `sys/machine.cpp:30:9`!;
153 #endif
154 #endif
155
156 /*
157 Command line may override the look-and-feel.
158 */
159 if (argc > 1) {
160 if (strequcxx . . $ `melder/melder_string32.h:69:9`! (argv [1], "-sgi")) lookAndFeelcxx . . $ lookAndFeel. = LookAndFeel_SGIcxx . . $ `sys/machine.cpp:23:9`!;
161 else if (strequcxx . . $ `melder/melder_string32.h:69:9`! (argv [1], "-motif")) lookAndFeelcxx . . $ lookAndFeel. = LookAndFeel_MOTIFcxx . . $ `sys/machine.cpp:22:9`!;
162 else if (strequcxx . . $ `melder/melder_string32.h:69:9`! (argv [1], "-cde")) lookAndFeelcxx . . $ lookAndFeel. = LookAndFeel_CDEcxx . . $ `sys/machine.cpp:24:9`!;
163 else if (strequcxx . . $ `melder/melder_string32.h:69:9`! (argv [1], "-solaris")) lookAndFeelcxx . . $ lookAndFeel. = LookAndFeel_SOLARIScxx . . $ `sys/machine.cpp:25:9`!;
164 else if (strequcxx . . $ `melder/melder_string32.h:69:9`! (argv [1], "-hp")) lookAndFeelcxx . . $ lookAndFeel. = LookAndFeel_HPcxx . . $ `sys/machine.cpp:26:9`!;
165 else if (strequcxx . . $ `melder/melder_string32.h:69:9`! (argv [1], "-sun4")) lookAndFeelcxx . . $ lookAndFeel. = LookAndFeel_SUN4cxx . . $ `sys/machine.cpp:27:9`!;
166 else if (strequcxx . . $ `melder/melder_string32.h:69:9`! (argv [1], "-mac")) lookAndFeelcxx . . $ lookAndFeel. = LookAndFeel_MACcxx . . $ `sys/machine.cpp:28:9`!;
167 else if (strequcxx . . $ `melder/melder_string32.h:69:9`! (argv [1], "-win32")) lookAndFeelcxx . . $ lookAndFeel. = LookAndFeel_WIN32cxx . . $ `sys/machine.cpp:29:9`!;
168 else if (strequcxx . . $ `melder/melder_string32.h:69:9`! (argv [1], "-linux")) lookAndFeelcxx . . $ lookAndFeel. = LookAndFeel_LINUXcxx . . $ `sys/machine.cpp:30:9`!;
169 else if (strequcxx . . $ `melder/melder_string32.h:69:9`! (argv [1], "-cocoa")) lookAndFeelcxx . . $ lookAndFeel. = LookAndFeel_COCOAcxx . . $ `sys/machine.cpp:31:9`!;
170 else if (strequcxx . . $ `melder/melder_string32.h:69:9`! (argv [1], "-chrome")) lookAndFeelcxx . . $ lookAndFeel. = LookAndFeel_CHROMEcxx . . $ `sys/machine.cpp:32:9`!;
171 }
172 }
173
174 /* End of file machine.cpp */