annotate lcdemu/window.c @ 903:312778104f54

lcdemu started, compiles and runs w/o actual functionality
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 07 Sep 2015 08:34:37 +0000
parents
children e54abee27e8f
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>
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
8 #include <X11/Xlib.h>
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
9 #include <X11/Xresource.h>
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10 #include <X11/Xutil.h>
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11 #include "globals.h"
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
12
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
13 extern char *xrm_lookup();
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 create_our_window()
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 XrmQuark instquarks[3], classquarks[3];
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
18 register char *cp;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
19 register int i, geomask;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
20 int pixwidth, pixheight, xpos, ypos;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
21 XSetWindowAttributes xswa;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 u_long xswamask;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
23 XColor bdcolor;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
24 XClassHint xclasshint;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25 XWMHints wmhints;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
27 /* Determine our geometry */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
28 instquarks[0] = xrmquark_topinstance;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
29 classquarks[0] = xrmquark_topclass;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
30 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
31 instquarks[2] = classquarks[2] = NULLQUARK;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
32 cp = xrm_lookup(instquarks, classquarks);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
33 if (cp) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
34 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
35 &pixheight);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
36 free(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
37 } else
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
38 geomask = 0;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
39 if (!(geomask & WidthValue))
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
40 pixwidth = 176;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
41 if (!(geomask & HeightValue))
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
42 pixheight = 220;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
43 if (!(geomask & XValue))
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
44 xpos = 0;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
45 else if (geomask & XNegative)
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
46 xpos += DisplayWidth(mydisplay, DefaultScreen(mydisplay)) -
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
47 pixwidth;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
48 if (!(geomask & YValue))
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
49 ypos = 0;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
50 else if (geomask & YNegative)
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
51 ypos += DisplayHeight(mydisplay, DefaultScreen(mydisplay)) -
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
52 pixheight;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
53 /* fill out XSetWindowAttributes */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
54 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
55 xswamask = CWEventMask;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
56 /* border color */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
57 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
58 cp = xrm_lookup(instquarks, classquarks);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
59 if (cp) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
60 i = XParseColor(mydisplay, DefaultColormap(mydisplay,
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
61 DefaultScreen(mydisplay)), cp, &bdcolor);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
62 free(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
63 if (i) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
64 i = XAllocColor(mydisplay, DefaultColormap(mydisplay,
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
65 DefaultScreen(mydisplay)), &bdcolor);
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 xswa.border_pixel = bdcolor.pixel;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
68 xswamask |= CWBorderPixel;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
69 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
70 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
71 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
72 /* border width */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
73 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
74 cp = xrm_lookup(instquarks, classquarks);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
75 if (cp) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
76 i = atoi(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
77 free(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
78 } else
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
79 i = 2;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
80 /* go for it! */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
81 mainwindow = XCreateWindow(mydisplay, DefaultRootWindow(mydisplay),
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
82 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
83 InputOutput, CopyFromParent, xswamask, &xswa);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
84 /* set window manager properties */
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
85 xclasshint.res_name = proginstancename;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
86 xclasshint.res_class = "LEDemu";
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
87 XSetClassHint(mydisplay, mainwindow, &xclasshint);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
88 wmhints.flags = InputHint | StateHint;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
89 wmhints.input = False;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
90 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
91 cp = xrm_lookup(instquarks, classquarks);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
92 if (cp) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
93 i = parse_boolean_resource(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
94 free(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
95 } else
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
96 i = 0;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
97 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
98 XSetWMHints(mydisplay, mainwindow, &wmhints);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
99 #if 0
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
100 if (geomask & (WidthValue|HeightValue))
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
101 wm_normal_hints.flags = USSize;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
102 else
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
103 wm_normal_hints.flags = PSize;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
104 if (geomask & (XValue|YValue))
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
105 wm_normal_hints.flags |= USPosition;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
106 set_wm_normal_hints();
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
107 #endif
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
108 }
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 #if 0
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
111 set_wm_normal_hints()
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 wm_normal_hints.min_width = MIN_COLUMNS * charcell_width;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
114 wm_normal_hints.min_height = MIN_LINES * charcell_height;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
115 wm_normal_hints.max_width = MAX_COLUMNS * charcell_width;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
116 wm_normal_hints.max_height = MAX_LINES * charcell_height;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
117 wm_normal_hints.width_inc = charcell_width;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
118 wm_normal_hints.height_inc = charcell_height;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
119 wm_normal_hints.base_width = 0;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
120 wm_normal_hints.base_height = 0;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
121 wm_normal_hints.flags |= PMinSize | PMaxSize | PResizeInc | PBaseSize;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
122 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
123 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
124 #endif
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
125
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
126 set_initial_window_title()
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 XrmQuark instquarks[3], classquarks[3];
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
129 register char *cp;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
130 char buf[256];
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
131
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
132 instquarks[0] = xrmquark_topinstance;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
133 classquarks[0] = xrmquark_topclass;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
134 instquarks[1] = XrmStringToQuark("title");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
135 classquarks[1] = XrmStringToQuark("Title");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
136 instquarks[2] = classquarks[2] = NULLQUARK;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
137 cp = xrm_lookup(instquarks, classquarks);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
138 if (cp) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
139 XStoreName(mydisplay, mainwindow, cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
140 free(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
141 return;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
142 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
143 XStoreName(mydisplay, mainwindow, "Emulated LCD");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
144 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
145
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
146 set_initial_icon_name()
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
147 {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
148 XrmQuark instquarks[3], classquarks[3];
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
149 register char *cp;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
150
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
151 instquarks[0] = xrmquark_topinstance;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
152 classquarks[0] = xrmquark_topclass;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
153 instquarks[1] = XrmStringToQuark("iconName");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
154 classquarks[1] = XrmStringToQuark("IconName");
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
155 instquarks[2] = classquarks[2] = NULLQUARK;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
156 cp = xrm_lookup(instquarks, classquarks);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
157 if (cp) {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
158 XSetIconName(mydisplay, mainwindow, cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
159 free(cp);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
160 return;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
161 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
162 XSetIconName(mydisplay, mainwindow, proginstancename);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
163 }
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
164
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
165 create_mainwin_gc()
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
166 {
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
167 XGCValues xgcval;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
168
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
169 xgcval.graphics_exposures = False;
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
170 mainwingc = XCreateGC(mydisplay, mainwindow, GCGraphicsExposures,
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
171 &xgcval);
312778104f54 lcdemu started, compiles and runs w/o actual functionality
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff changeset
172 }