6 class: X11Singleton | widgetlist quitflag defaultFont dumpEvents | [
24 ^sameWids: w0 and: w1 [
35 defaultFont ifNil: [ defaultFont := 'verdana,sans-10' ].
36 dumpEvents ifNil: [ dumpEvents := false ].
37 widgetlist := List new.
38 self XInitialize: nil.
51 defaultFont := aName ifNil: [ 'verdana,sans-10' ].
80 ^XSelectInput: aWindow interestFlag: aFlag [
81 <#X11Do 15 aWindow aFlag>.
85 ^XCreateSimpleWindow: parentWid x: x y: y width: wdt height: hgt bgcolor: clr [
86 <#X11Do 20 parentWid x y wdt hgt clr>.
90 ^XDestroyWindow: wid [
95 ^XSetTitle: wid title: aTitle [
96 <#X11Do 22 wid aTitle>.
101 <#X11Do 23 wid true>.
106 <#X11Do 23 wid false>.
110 ^XGetGeometry: wid item: aItem [
111 <#X11Do 24 wid aItem>.
120 ^XSetWindowBackground: wid color: clr [
130 ^XMoveWindow: wid x: x y: y [
131 <#X11Do 27 wid 1 x y>.
135 ^XResizeWindow: wid width: w height: h [
136 <#X11Do 27 wid 2 w h>.
140 ^XMoveResizeWindow: wid x: x y: y width: w height: h [
141 <#X11Do 27 wid 3 x y w h>.
145 ^XSetInputFocus: wid [
155 ^XCreateGC: wid fgColor: aColor [
156 <#X11Do 30 wid aColor>.
170 ^XNewColor: r g: g b: b [
180 ^XSetColor: aGC color: aClr backFlag: aBF [
181 <#X11Do 34 aGC aClr aBF>.
185 ^fgColor: aGC color: aClr [
186 ^self XSetColor: aGC color: aClr backFlag: false
189 ^bgColor: aGC color: aClr [
190 ^self XSetColor: aGC color: aClr backFlag: true
193 ^XSetLineAttr: aGC width: wdt line: line cap: cap join: join [
194 <#X11Do 35 aGC wdt line cap join>.
198 ^XDrawPoint: wid gc: gc x: x y: y [
199 <#X11Do 40 wid gc x y>.
203 ^XDrawLine: wid gc: gc x0: x0 y0: y0 x1: x1 y1: y1 [
204 <#X11Do 41 wid gc x0 y0 x1 y1>.
208 ^XDrawRect: wid gc: gc x: x y: y width: wdt height: hgt [
209 <#X11Do 42 wid gc x y wdt hgt>.
213 ^XFillRect: wid gc: gc x: x y: y width: wdt height: hgt [
214 <#X11Do 43 wid gc x y wdt hgt>.
218 ^XftFontOpen: aName [
223 ^XftFontClose: aFont [
228 ^XftDrawCreate: wid [
233 ^XftDrawDestroy: aDraw [
238 ^XftNewColor: r g: g b: b [
243 ^XftFreeColor: aClr [
248 ^XftFontDraw: aDraw color: aClr font: aFont x: x y: y text: text [
249 <#X11Do 56 aDraw aClr aFont x y text>.
253 ^XftTextExtents: aFont text: text item: aNo [
254 <#X11Do 57 aFont text aNo>.
258 ^XftTextExtents: aFont text: text [
259 <#X11Do 57 aFont text>.
269 widgetlist remove: aWC ifAbsent: [ nil ]
274 (X11Singleton sameWids: aWid and: w wid)
276 "'dead meat: ' print. (self wid2str: aWid) printNl."
283 ^findWidgetById: aWid [
284 widgetlist do: [:w | (X11Singleton sameWids: aWid and: w wid) ifTrue: [ ^w ]].
296 ^passEvent: wid event: evt [
297 widgetlist do: [:w | (w passEvent: wid event: evt) ifTrue: [ ^true ]].
304 [ quitflag ] whileFalse: [
305 System eventWaitFor: 1200.
306 (evt := self getEvent) ifNotNil: [
309 'wid: ' print. (X11Singleton wid2str: wid) print. '; ' print. evt printNl.
311 kill := (evt at: 1) == #DestroyNotify.
312 self passEvent: wid event: evt.
314 self removeById: wid.
315 widgetlist isEmpty ifTrue: [ quitflag := true ].
323 class: X11ResourceObject [
326 (obj := self basicNew) addToBeFinalized.