forked from ghaerr/microwindows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
229 lines (183 loc) · 9.01 KB
/
README
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
Microwindows Configuration Documentation
February 4, 2019 g haerr <[email protected]>
To build Microwindows for desktop demonstration:
1. cd microwindows/src
2. The default configuration is for MAC OSX running X11 (Configs/config.macosx).
For Linux X11 type "cp Configs/config.linux-X11 config".
Edit the default configuration file "config" for library support desired.
There are (outdated) pre-built configuration files for a variety
of target systems, see Configs/README.
See docs/CONTENTS and Configs/README for more information.
3. Type "make"
4. Run the demonstration programs using "./runapp <appname>".
Any application in microwindows/src/bin/ can be run using the application launch
script, runapp, which automatically starts the nano-X server if required.
Some examples:
./runapp demo-aafont
./runapp demo-composite
./runapp mwdvetest
./runapp mwmine
./runapp can be used to set the Nano-X portrait modes using -L, -R, -D, -A
(left, right, upside down, auto-mouseedge) when running Nano-X apps, e.g.:
./runapp -A demo-ttfont (move mouse to edges of screen to demonstragte flip orientation)
The runapp shell script sets up and exports LD_LIBRARY_PATH so that the
required shared libraries are loaded from microwindows/src/lib/ when
configured with SHAREDLINK=Y. To link the demo programs
with Microwindows static libraries, set SHAREDLINK=N.
Microwindows by default builds both .a share libraries.
To not generate any shared libraries, set SHAREDLIBS=N.
For the EMSCRIPTEN port, check that the EMSDK is in ~/emsdk/, then compilation
is done after copying Configs/config.emscripten to src/config and running
./make-emscripten. Applications are run as above but using ./emrun:
./emrun demo-aafont
./emrun mwdemo2
./emrun mwmine
5. Documentation is available in microwindows/doc and microwindows/src/docs directories.
Win32 API documentation is in docs/Win32API.html
Nano-X API documentation is in docs/nano-X
NX11 API documentation is in docs/NXlib programming and reference manual.html
6. More information below.
Microwindows compiles and runs on Linux, MACOSX, UNIX, X11, EMSCRIPTEN, Android, PSP,
RTEMS, MinGW and bare hardware. There is support for the MIPS,
ARM, and x86 cpu's using the cross compiler toolchains specified in config.
Use "make -f Makefile_nr ARCH=XXX" to compile for MinGW or DOS-DJGPP.
Microwindows can be compiled to use different screen,
mouse and keyboard drivers for a given operating system environment.
Most options are set using configuration file (microwindows/src/config) options.
These options are manually editted.
Other fine-tuning options are set in the graphics drawing engine's header
file microwindows/src/include/device.h.
After changing any options in microwindows/src/config, Microwindows
is built by typing "make".
Microwindows' header files can be written to /usr/lib/microwin,
and libraries to /usr/lib by typing "sudo make install". This
is not required unless using Microwindows to build outside
applications, however. All demos build and run using the headers
and libraries built in the source tree.
Config options are detailed in the config file itself and
following each operating environment below. Setting the line
MICROWIN=Y
will build Microwindows. The line
NANOX=Y
will build Nano-X. Both are built by default.
NX11=Y will build the libNX11 X11-compatibility library used with libnano-X.
Setting OPTIMIZE=Y will run the compiler's -O3 switch.
Setting DEBUG=Y will add -g. Setting VERBOSE=Y will display
the full compiler command line when making. When cross-compiling
for different platforms, the various XXXTOOLSPREFIX values
must be set accordingly.
The Nano-X server can be built as a compiled-in application,
or use UNIX sockets to allow seperately compiled applications
to connect to the server. Setting the line
LINK_APP_INTO_SERVER=Y
will create libnanoX and all demos with the server files necessary to create
a standalone nano-X application, which is useful for debugging,
or for not having to run a seperate client/server connection
to the nano-X server. The downside is that multiple applications
cannot be run simultaneously.
Scaled, rotated, and antialiased fonts (truetype and adobe type 1)
are supported using Freetype 2. Set
HAVE_FREETYPE_2_SUPPORT=Y
in the config file. For Adobe Type 1 font support, download
t1lib-1.0.tar.gz from microwindows.org or
ftp://ftp.neuroinformatik.ruhr-uni-bochum.de/pub/software/t1lib/
and set:
HAVE_T1LIB_SUPPORT=Y
in the config file. The demo-ttfont, demo-aafont and demop-font programs demonstrate
use of both truetype and type 1 fonts.
If compiling for use with multi-threaded applications, setting
THREADSAFE=Y (default)
enables a global mutex around all GrXXX() functions.
This is necessary when using Nano-X with the SDL library and SMPEG.
All the demos are built in the microwindows/src/bin directory.
Linux/UNIX
==========
Linux users set the line below in the config file.
ARCH=LINUX-NATIVE
UNIX/Linux users have the choice of running framebuffer screen drivers, X11 or SDL.
The framebuffer driver runs on 1, 2, 4, 8, 16 and 32bpp systems.
To choose between them, set one of the following lines in the config file:
SCREEN=FB (for 1, 2, 4, 8, 16 or 32 bpp linear fb access)
SCREEN=X11
SCREEN=SDL (for SDL version 2)
SCREEN=FBE (for framebuffer emulator bin/fbe, set FBEMULATOR=Y also)
When building the X11 version, the SCREEN_PIXTYPE can be used
to emulate a different hardware framebuffer configuration.
See the config file SCREEN_PIXTYPE= for more details, the default
is 32 bit color in ARGB format.
Linux framebuffer users can use either the /dev/input/mice driver,
the GPM mouse driver, or a "bare" serial mouse driver that decodes
the mouse directly from the serial port. Set one of the following in config:
MOUSE=DEVMICEMOUSE
MOUSE=GPMMOUSE
MOUSE=SERMOUSE
MOUSE=NOMOUSE (for no mouse)
Note that to use the GPM driver, you must start GPM with
the -R option, and usually specify the mouse type with -t.
See mouse.sh for an example. If using the direct serial
mouse driver, the serial port may have to be specified in
microwindows/src/drivers/mou_ser.c, as it defaults to /dev/psaux,
and expects a ps2-compatible mouse (changeable in mou_ser.c
or through environment variables MOUSE_TYPE={ms,pc,logi,ps2},
and MOUSE_PORT=/dev/ttyS1).
There is a utility that converts MS fonts, for exact
MS-Windows look and feel. You must own a MS license in order
to use an MS font. To use the MS fonts, compile microwindows/src/fonts/tools/convfnt.c
on a Windows system, and it will create the win*.c font tables.
These fonts can then be linked in by modifying the drivers/genfont.c file.
ELKS (not tested since version 0.86)
====
ELKS users set the line below in the config file.
ARCH=ELKS
The NWIDGET=N line must be set, as bcc can't handle
ansi C's token paste operator, used in the widget library.
The serial mouse driver is in microwindows/src/drivers/mou_ser.c.
The default mouse port and type can be changed with the following
environment variables, or changed in the driver.
Environment Var Default Allowed
MOUSE_TYPE pc ms, pc, logi(same as pc)
MOUSE_PORT /dev/ttys0 any serial port
It might also be a good idea to use the XOR frame-redraw window
move algorithm, by setting the following lines in the config file.
The XOR algorithm redraws only after the window move is
completed, which works well on slower cpu's.
ERASEMOVE=N
UPDATEREGIONS=N
Since ELKS doesn't currently have a floating point library,
the 3d demo is automatically compiled out of
microwindows/src/demos/mwin/mwdemo.c:
#define GRAPH3D 0
#define IMAGE 0
The IMAGE define is set to 0 as bringing in most
images will break the 64k data segment limit. The ELKS
version also doesn't include the button control or wallpaper
in the demo to keep the text/data sizes down.
The latest version of the ELKS kernel supports a variant
of UNIX sockets, using numbers rather than names. To
build a client/server version of Nano-X for ELKS, the config line
LINK_APP_INTO_SERVER=y
must be set. In addition, the bcc compiler doesn't support
the ANSI C '##' token pasting operator which is used
in the client request code, client.c. Run the following
perl script to preprocess the client.c source file:
cd microwindows/src/nanox
mv client.c client.dist
./elkspatch.pl < client.dist > client.c
DJGPP and others
================
There are contributed DJGPP and MINGW32 ports.
Instructions are in microwindows/src/Makefile_nr.
Framebuffer notes:
If you haven't used any of the Linux 2.2 or 2.4 framebuffer drivers before,
it can be a little daunting at first. Alex Buell has written a
Framebuffer HOWTO, which is available at
http://en.tldp.org/HOWTO/Framebuffer-HOWTO.html which goes into detail about the
various drivers, command line options, and the fbset utility.
For any frame buffer other than the Vesa framebuffer
(which can only change modes at bootup because it needs to
execute the code in the video card's ROM in real mode),
you can change bits per pixel with the command 'fbset -depth {8|16|24|32}'.
Another very useful framebuffer site is http://www.linux-fbdev.org
Have fun!
Greg Haerr