annotate lcdemu/window.c @ 1017:759b3cbf46aa

doc/TCH-special-feature: document written
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Mon, 21 Mar 2016 06:05:57 +0000
parents e54abee27e8f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
903
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
2 * LCDemu based on HECterm by the same author
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
3 * X11 window creation functions
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
4 */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
5
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
6 #include <stdio.h>
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
7 #include <stdlib.h>
904
e54abee27e8f lcdemu: window size hints set correctly
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 903
diff changeset
8 #include <string.h>
e54abee27e8f lcdemu: window size hints set correctly
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 903
diff changeset
9 #include <strings.h>
903
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10 #include <X11/Xlib.h>
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11 #include <X11/Xresource.h>
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
12 #include <X11/Xutil.h>
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
13 #include "globals.h"
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
14
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
15 extern char *xrm_lookup();
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
16
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
17 create_our_window()
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
18 {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
19 XrmQuark instquarks[3], classquarks[3];
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
20 register char *cp;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
21 register int i, geomask;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 int pixwidth, pixheight, xpos, ypos;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
23 XSetWindowAttributes xswa;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
24 u_long xswamask;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25 XColor bdcolor;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26 XClassHint xclasshint;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 XWMHints wmhints;
904
e54abee27e8f lcdemu: window size hints set correctly
Space Falcon <falcon@ivan.Harhan.ORG>
parents: 903
diff changeset
28 XSizeHints wm_normal_hints;
903
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
29
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
30 /* Determine our geometry */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
31 instquarks[0] = xrmquark_topinstance;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
32 classquarks[0] = xrmquark_topclass;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
33 classquarks[1] = instquarks[1] = XrmStringToQuark("geometry");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
34 instquarks[2] = classquarks[2] = NULLQUARK;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
35 cp = xrm_lookup(instquarks, classquarks);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
36 if (cp) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
37 geomask = XParseGeometry(cp, &xpos, &ypos, &pixwidth,
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
38 &pixheight);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
39 free(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
40 } else
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
41 geomask = 0;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
42 if (!(geomask & WidthValue))
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
43 pixwidth = 176;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
44 if (!(geomask & HeightValue))
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
45 pixheight = 220;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
46 if (!(geomask & XValue))
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
47 xpos = 0;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
48 else if (geomask & XNegative)
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
49 xpos += DisplayWidth(mydisplay, DefaultScreen(mydisplay)) -
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
50 pixwidth;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
51 if (!(geomask & YValue))
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
52 ypos = 0;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
53 else if (geomask & YNegative)
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
54 ypos += DisplayHeight(mydisplay, DefaultScreen(mydisplay)) -
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
55 pixheight;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
56 /* fill out XSetWindowAttributes */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
57 xswa.event_mask = 0; /* not interested in any events */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
58 xswamask = CWEventMask;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
59 /* border color */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
60 classquarks[1] = instquarks[1] = XrmStringToQuark("borderColor");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
61 cp = xrm_lookup(instquarks, classquarks);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
62 if (cp) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
63 i = XParseColor(mydisplay, DefaultColormap(mydisplay,
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
64 DefaultScreen(mydisplay)), cp, &bdcolor);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
65 free(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
66 if (i) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
67 i = XAllocColor(mydisplay, DefaultColormap(mydisplay,
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
68 DefaultScreen(mydisplay)), &bdcolor);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
69 if (i) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
70 xswa.border_pixel = bdcolor.pixel;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
71 xswamask |= CWBorderPixel;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
72 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
73 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
74 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
75 /* border width */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
76 classquarks[1] = instquarks[1] = XrmStringToQuark("borderWidth");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
77 cp = xrm_lookup(instquarks, classquarks);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
78 if (cp) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
79 i = atoi(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
80 free(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
81 } else
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
82 i = 2;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
83 /* go for it! */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
84 mainwindow = XCreateWindow(mydisplay, DefaultRootWindow(mydisplay),
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
85 xpos, ypos, pixwidth, pixheight, i, CopyFromParent,
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
86 InputOutput, CopyFromParent, xswamask, &xswa);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
87 /* set window manager properties */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
88 xclasshint.res_name = proginstancename;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
89 xclasshint.res_class = "LEDemu";
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
90 XSetClassHint(mydisplay, mainwindow, &xclasshint);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
91 wmhints.flags = InputHint | StateHint;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
92 wmhints.input = False;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
93 classquarks[1] = instquarks[1] = XrmStringToQuark("iconic");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
94 cp = xrm_lookup(instquarks, classquarks);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
95 if (cp) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
96 i = parse_boolean_resource(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
97 free(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
98 } else
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
99 i = 0;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
100 wmhints.initial_state = i ? IconicState : NormalState;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
101 XSetWMHints(mydisplay, mainwindow, &wmhints);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
102 if (geomask & (WidthValue|HeightValue))
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
103 wm_normal_hints.flags = USSize;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
104 else
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
105 wm_normal_hints.flags = PSize;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
106 if (geomask & (XValue|YValue))
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
107 wm_normal_hints.flags |= USPosition;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
108 XSetWMNormalHints(mydisplay, mainwindow, &wm_normal_hints);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
109 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
110
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
111 set_initial_window_title()
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
112 {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
113 XrmQuark instquarks[3], classquarks[3];
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
114 register char *cp;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
115 char buf[256];
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
116
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
117 instquarks[0] = xrmquark_topinstance;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
118 classquarks[0] = xrmquark_topclass;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
119 instquarks[1] = XrmStringToQuark("title");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
120 classquarks[1] = XrmStringToQuark("Title");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
121 instquarks[2] = classquarks[2] = NULLQUARK;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
122 cp = xrm_lookup(instquarks, classquarks);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
123 if (cp) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
124 XStoreName(mydisplay, mainwindow, cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
125 free(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
126 return;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
127 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
128 XStoreName(mydisplay, mainwindow, "Emulated LCD");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
129 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
130
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
131 set_initial_icon_name()
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
132 {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
133 XrmQuark instquarks[3], classquarks[3];
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
134 register char *cp;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
135
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
136 instquarks[0] = xrmquark_topinstance;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
137 classquarks[0] = xrmquark_topclass;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
138 instquarks[1] = XrmStringToQuark("iconName");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
139 classquarks[1] = XrmStringToQuark("IconName");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
140 instquarks[2] = classquarks[2] = NULLQUARK;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
141 cp = xrm_lookup(instquarks, classquarks);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
142 if (cp) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
143 XSetIconName(mydisplay, mainwindow, cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
144 free(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
145 return;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
146 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
147 XSetIconName(mydisplay, mainwindow, proginstancename);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
148 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
149
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
150 create_mainwin_gc()
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
151 {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
152 XGCValues xgcval;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
153
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
154 xgcval.graphics_exposures = False;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
155 mainwingc = XCreateGC(mydisplay, mainwindow, GCGraphicsExposures,
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
156 &xgcval);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
157 }