File: hatariui

package info (click to toggle)
hatari 2.5.0%2Bdfsg-1
  • links: PTS
  • area: main
  • in suites: trixie
  • size: 12,744 kB
  • sloc: ansic: 164,630; cpp: 8,685; python: 6,251; objc: 1,899; asm: 1,742; sh: 1,668; javascript: 146; makefile: 86; xml: 32
file content (52 lines) | stat: -rwxr-xr-x 1,956 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
#
# Don't modify the 'path' or 'conf' variable names or initial values,
# those will be replaced by Makefile when this script is installed.

path=${0%/*}
name=${0##*/}

if [ ! -e $path/$name.py ]; then
	# Assume package has been relocated, try relative data directory:
	path=${0%/*}/../share/hatari/hatariui
fi

# Assume hatari system configuration file dir is relative to hatariui dir
# (usually system config file isn't installed, but if defaults need to be
# configured differently from Hatari source code defaults, they're better
# done with system config file than patching sources).
conf=${path%/*}/../etc
# checked by hatari UI
export HATARI_SYSTEM_CONFDIR=$conf

# examples for Hatari UI options

# Embedding does not work under Wayland, only under X11
# Note: requesting Gtk & SDL to use "x11" backends does not help
if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$DISPLAY" ]; then
	echo "$path/$name.py --right 'about,|,run,pause,forward,|,reset,|,quit' --embed $*"
	$path/$name.py --right 'about,|,run,pause,forward,|,reset,|,quit' --embed $*
else
	# this looks nicer when Hatari window embedding cannot be used
	echo "$path/$name.py --bottom 'about,|,run,pause,forward,|,reset,|,quit' $*"
	$path/$name.py --bottom 'about,|,run,pause,forward,|,reset,|,quit' $*
fi
exit $?

# test setup without embedding, duplicate toggles
$path/$name.py --top "about,run,pause,quit" \
--panel "Testpanel,pause,>,close" \
--bottom "sound,|,forward,pause,|,Testpanel" \
$*
exit $?

# test setup with embedding and all available controls
$path/$name.py --embed \
--top "about,|,run,pause,|,reset,debug,|,quit" \
--left "run,pause,reset,machine,about" \
--panel "Keys,F1=59,F2=60,F3=61,F4=62,F5=63,F6=64,F7=65,F8=66,F9=67,F10=68,>,Macro=Test,Undo=97,Help=98,Enter=114,>,close" \
--panel "Misc,|,forward,full,|,sound,>,shot,>,close" \
--bottom "forward,full,Misc,Keys,input,display,debug,trace" \
--right "forward,full,Misc,Keys,input,display,Help=98" \
$*
exit $?