- Page 1 and 2: Volume One: Xlib Programming Manual
- Page 3: Introduction, provides a discussion
- Page 7 and 8: Volume Five −− X Toolkit Intrin
- Page 9 and 10: X was developed jointly by MIT’s
- Page 11 and 12: Figure 1−2. Applications can run
- Page 13 and 14: the MIT X Consortium, such as the S
- Page 15 and 16: Server provide information about a
- Page 17 and 18: Actually, although this manual desc
- Page 19 and 20: The fact that Xlib queues both inpu
- Page 21 and 22: Much of the communication between c
- Page 23 and 24: 2.2.1 Window Characteristics Do rea
- Page 25 and 26: • A window’s border. It can var
- Page 27 and 28: A child may be positioned partially
- Page 29 and 30: Mapping is done with the XMapWindow
- Page 31 and 32: lot of pixmaps may not work on PC s
- Page 33 and 34: whether this feature is supported o
- Page 35 and 36: 2.4.6 Special Characteristics of th
- Page 37 and 38: Window window; int x, y; int width,
- Page 39 and 40: code is written. 2.6.2 Writing an X
- Page 41 and 42: values True or False. As another ex
- Page 43 and 44: 2.6.3.2 The XErrorEvent Structure E
- Page 45 and 46: Without further ado, let’s begin
- Page 47 and 48: structure types depending on the ty
- Page 49 and 50: 3.2.4 Getting Window Information Mo
- Page 51 and 52: * Open display, determine screen di
- Page 53 and 54: convention for communication betwee
- Page 55 and 56:
icon name is not set, the conventio
- Page 57 and 58:
The next step in the application is
- Page 59 and 60:
default: /* All events selected by
- Page 61 and 62:
edraw, then the application should
- Page 63 and 64:
3.2.14 When Can I Draw? There is of
- Page 65 and 66:
handler function. The client is fre
- Page 67 and 68:
x, y, width, height, border_width,
- Page 69 and 70:
unsigned int line_width = 6; int li
- Page 71 and 72:
} int y_offset, x_offset; y_offset
- Page 73 and 74:
If the window already exists, you c
- Page 75 and 76:
None (default) Specifies that the w
- Page 77 and 78:
larger or smaller window. By instru
- Page 79 and 80:
the window is resized smaller than
- Page 81 and 82:
will not be generated when that win
- Page 83 and 84:
If the client requires its own colo
- Page 85 and 86:
* IsViewable */ long all_event_mask
- Page 87:
fourth stages in Figure 5−1 use t
- Page 90 and 91:
Bool graphics_exposures; /* Should
- Page 92 and 93:
. . /* Open display, create window,
- Page 94 and 95:
5.3.1.3 Cap Style The cap_style mem
- Page 96 and 97:
Figure 5−5. Detail of JoinRound f
- Page 98 and 99:
{3, 1}; static unsigned char dot_da
- Page 100 and 101:
5.3.2 The Font The font member of a
- Page 102 and 103:
5.3.5 Clip Mask Clipping allows you
- Page 104 and 105:
5.4.1 Drawing in Foreground Only Ba
- Page 106 and 107:
Remember that only the bits that ar
- Page 108 and 109:
The source (result of stage 2 of th
- Page 110 and 111:
Figure 5−14c. The effect of logic
- Page 112 and 113:
e set with XSetGraphicsExposures().
- Page 114 and 115:
XQueryFont() and it will get inform
- Page 116 and 117:
X Version 11 also supports the XDra
- Page 118 and 119:
The calling routine gets the window
- Page 120 and 121:
In the second method, you create a
- Page 122 and 123:
If the width argument is 0, the lef
- Page 124 and 125:
XGContextFromGC(DefaultGC(display,
- Page 126 and 127:
The attributes member is for font
- Page 128 and 129:
(max_char_or_byte2 − min_char_or_
- Page 130 and 131:
the string ascent and descent) if y
- Page 132 and 133:
} (void) sprintf(cd_width, " Width
- Page 134 and 135:
6.2.10 Setting the Font Path XFreeF
- Page 136 and 137:
XGetImage() returns data that uses
- Page 138 and 139:
the image was created using XCreate
- Page 140 and 141:
If your client is operating on a co
- Page 142 and 143:
Xlib provides for determining the s
- Page 144 and 145:
English Words Red Green Blue aquama
- Page 146 and 147:
7.2.4 Hexadecimal Color Specificati
- Page 148 and 149:
In high performance screens, having
- Page 150 and 151:
7.3.5 Shareability vs. Changeabilit
- Page 152 and 153:
colorcells returns False, the clien
- Page 154 and 155:
} border_pixel = BlackPixel(display
- Page 156 and 157:
foreground = 1111111100000000111111
- Page 158 and 159:
int i; XVisualInfo visual_info; int
- Page 160 and 161:
7.5.2 Allocating Read/Write Colorce
- Page 162 and 163:
#define CAN_OVERLAY 1 int get_color
- Page 164 and 165:
The best way to do this is to incre
- Page 166 and 167:
color system, this value is typical
- Page 168 and 169:
In some cases, the window manager o
- Page 170 and 171:
To obtain the pixel value, these RG
- Page 172 and 173:
* allocate all cells read/write */
- Page 174 and 175:
When a window manager creates a sta
- Page 176 and 177:
value of three coordinates (as is t
- Page 178 and 179:
Manual. XcmsAllocColor() Allocates
- Page 180 and 181:
long *pixels; /* RETURN */ int n; {
- Page 182 and 183:
long *pixels; /* RETURN */ int n; {
- Page 184 and 185:
7.10.2 The ColormapNotify Event col
- Page 186 and 187:
• Something the window manager ne
- Page 188 and 189:
XAnyEvent xany; XKeyEvent xkey; XBu
- Page 190 and 191:
| ButtonPressMask); XSelectInput(di
- Page 192 and 193:
}; "ButtonPress", "ButtonRelease",
- Page 194 and 195:
another count. This is identical to
- Page 196 and 197:
} } 8.3 Selecting Events case Butto
- Page 198 and 199:
LeaveWindowMask LeaveNotify XLeaveW
- Page 200 and 201:
The program lets the user draw in t
- Page 202 and 203:
8.3.2.1 The Keyboard Focus Window T
- Page 204 and 205:
Button1MotionMask, Button2MotionMas
- Page 206 and 207:
The handling of Expose events is fu
- Page 208 and 209:
• CirculateRequest events report
- Page 210 and 211:
The Keyboard and Pointer This chapt
- Page 212 and 213:
XEvent event; char buffer[20]; int
- Page 214 and 215:
start_x = 2; start_y = font_info−
- Page 216 and 217:
mapping. These techniques are not n
- Page 218 and 219:
Let’s say a user wanted to use th
- Page 220 and 221:
} fprintf(stderr,"Cannot open displ
- Page 222 and 223:
• Getting all motion events. The
- Page 224 and 225:
mean drawing in black, button 2 cou
- Page 226 and 227:
all−motion−events approach for
- Page 228 and 229:
ButtonRelease events occur in the s
- Page 230 and 231:
Mapping the pointer buttons might b
- Page 232 and 233:
performance when operating over a n
- Page 234 and 235:
physical pointer or keyboard themse
- Page 236 and 237:
Note that the actual forms fill−i
- Page 238 and 239:
Figure 9−5. Correct forms fill−
- Page 240 and 241:
The led_mask member is not directly
- Page 242 and 243:
These and related problems of local
- Page 244 and 245:
computer are represented by numbers
- Page 246 and 247:
ut strings passed to wcstombs are n
- Page 248 and 249:
Before R5, the Xlib drawing routine
- Page 250 and 251:
insert or delete a character from a
- Page 252 and 253:
} */ (void) XmbTextExtents(fontset,
- Page 254 and 255:
XGetFontPath() XParseGeometry() XGe
- Page 256 and 257:
any value > 0 current locale (if th
- Page 258 and 259:
R5−based internationalization:
- Page 260 and 261:
understanding of material presented
- Page 262 and 263:
XSetICFocus() causes key events to
- Page 264 and 265:
XmbLookupString() or XwcLookupStrin
- Page 266 and 267:
* * The error messages in this prog
- Page 268 and 269:
Section 11.4.2, "Querying Input Met
- Page 270 and 271:
} } t = style2 & status; if (s | t
- Page 272 and 273:
XNFocusWindow attribute (of type Wi
- Page 274 and 275:
aseline−to−baseline spacing was
- Page 276 and 277:
XEvent *event; XIMStyle style; XRec
- Page 278 and 279:
typedef struct _XIMText { unsigned
- Page 280 and 281:
• XIMLineStart means move the cur
- Page 282 and 283:
} The R5 X Toolkit Intrinsics have
- Page 284 and 285:
• Set the locale with setlocale.
- Page 286 and 287:
* This is a long procedure for a si
- Page 288 and 289:
fontset = XCreateFontSet(dpy, "−a
- Page 290 and 291:
} } Chapter 12 break; case XLookupK
- Page 292 and 293:
The data associated with a property
- Page 294 and 295:
XA_WM_ICON_NAME "TEXT" XTextProper
- Page 296 and 297:
• The max_width and max_height me
- Page 298 and 299:
application. To remind you, the key
- Page 300 and 301:
The client must not: • Select Res
- Page 302 and 303:
Note that session managers are rare
- Page 304 and 305:
that they can save their state and
- Page 306 and 307:
unsigned long nitems; /* Number of
- Page 308 and 309:
12.4 Selections Selections are the
- Page 310 and 311:
sends a SelectionNotify event (usin
- Page 312 and 313:
the ownership of the selection invo
- Page 314 and 315:
events can assist applications in t
- Page 316 and 317:
Example 13−1 shows the code for o
- Page 318 and 319:
PictureFileName = option; } } if (!
- Page 320 and 321:
13.2 Using the Low−level Resource
- Page 322 and 323:
XTerm*Foreground: maroon #else ! re
- Page 324 and 325:
esulting values are used to set the
- Page 326 and 327:
• Background color • Foreground
- Page 328 and 329:
app−defaults files written in thi
- Page 330 and 331:
In addition, a representation type
- Page 332 and 333:
corresponding quark and compares th
- Page 334 and 335:
The long horizontal window along th
- Page 336 and 337:
} /* Get events */ takeEvents (); /
- Page 338 and 339:
} } screen_num = DefaultScreen(disp
- Page 340 and 341:
} if (XResourceManagerString(displa
- Page 342 and 343:
} background = WhitePixel(display,
- Page 344 and 345:
Example 14−9. basecalc −− dec
- Page 346 and 347:
} } /* Make the utility pixmaps */
- Page 348 and 349:
takeEvents () { XEvent Event; regis
- Page 350 and 351:
} gc = bgGC; attributes.background_
- Page 352 and 353:
XStoreName (dpy, w, name) register
- Page 354 and 355:
Normally all resources associated w
- Page 356 and 357:
Because the window−based coordina
- Page 358 and 359:
The const keyword is new in ANSI−
- Page 360 and 361:
Example 15−4. Using the XlibSpeci
- Page 362 and 363:
XCirculateSubwindowsDown(), XCircul
- Page 364 and 365:
When the window with the shadow is
- Page 366 and 367:
The routines XRemoveFromSaveSet() a
- Page 368 and 369:
If a stack_mode is specified but no
- Page 370 and 371:
If CirculateDn, CirculateUp, or New
- Page 372 and 373:
order_width, BlackPixel(display,scr
- Page 374 and 375:
case 4: circup(menuwin); break; cas
- Page 376 and 377:
16.7.4 Selecting Input Now that we
- Page 378 and 379:
drawn by XDrawImageString() might n
- Page 380 and 381:
16.7.11 Raising and Lowering Window
- Page 382 and 383:
min_size = True; if (size_hints.fla
- Page 384 and 385:
* it doesn’t matter */ /* fprintf
- Page 386 and 387:
} Window child; Window root; int wi
- Page 388 and 389:
16.7.15 Creating the Icons The make
- Page 390 and 391:
} char * getIconName(window) Window
- Page 392 and 393:
Window menuwin; { XEvent report; in
- Page 394 and 395:
Example 16−16. winman −− the
- Page 396 and 397:
This rather verbose line is actuall
- Page 398 and 399:
−bitstream−charter−medium−i
- Page 400 and 401:
If you have worked with X at a site
- Page 402 and 403:
A.2.1 Font Server Naming To the X s
- Page 404 and 405:
fonts = XListFonts(dpy, "−*−*
- Page 406 and 407:
Example A−8 shows a procedure tha
- Page 408 and 409:
The flags member, as defined in Xli
- Page 410 and 411:
Writing Extensions to X Extensibili
- Page 412 and 413:
XInitExtension()determines if the n
- Page 414 and 415:
When XLoadQueryFont() or XQueryFont
- Page 416 and 417:
should be copied from the host form
- Page 418 and 419:
The XESetFlushGC() procedure is ide
- Page 420 and 421:
XDrawPoint()(dpy, d, gc, x, y) regi
- Page 422 and 423:
typedef struct _DoSomethingReply {
- Page 424 and 425:
meantime, _XReply places them in th
- Page 426 and 427:
This routine generally is implement
- Page 428 and 429:
#define WTYP_DIG 0x02 /* Digit 0−
- Page 430 and 431:
#endif SYSV { CKILL, "CE", 2 }, { C
- Page 432 and 433:
}; { 0, "/", 5, 3, OPR_DIV, WTYP_OP
- Page 434 and 435:
XrmMergeDatabases(serverDB, &rDB);
- Page 436 and 437:
} } else { background = WhitePixel(
- Page 438 and 439:
else if (windata[win].type == WTYP_
- Page 440 and 441:
} if (Buttons[win].self == Event.xb
- Page 442 and 443:
Buttons[i].x, Buttons[i].y, Buttons
- Page 444 and 445:
windata[win].color = pressedColor;
- Page 446 and 447:
else Accum *= Value; break; case OP
- Page 448 and 449:
} case ’\r’: case ’\n’: str
- Page 450 and 451:
if (b==2) plmax = 32; else if (b==8
- Page 452 and 453:
typedef struct { int type; unsigned
- Page 454 and 455:
Notes Unless an active grab already
- Page 456 and 457:
Select With There is no event mask
- Page 458 and 459:
} XConfigureEvent; Event Structure
- Page 460 and 461:
Bool override_redirect; /* creation
- Page 462 and 463:
unsignedlong, so it wraps around wh
- Page 464 and 465:
EnterNotify and LeaveNotify events
- Page 466 and 467:
Event Structure typedef struct { in
- Page 468:
common ancestor of A and B. This ta
- Page 471 and 472:
Select With These events are not se
- Page 473 and 474:
} XEvent; Event Structure typedef s
- Page 475 and 476:
SubstructureNotifyMask. XEvent Stru
- Page 477 and 478:
Display *display; /* Display the ev
- Page 479 and 480:
When Generated A PropertyNotify eve
- Page 481 and 482:
} XResizeRequestEvent; Event Struct
- Page 483 and 484:
Window requestor; Atom selection; A
- Page 485 and 486:
F.3 System Utility Functions XmuGet
- Page 487 and 488:
F.11 Compound Text Functions These
- Page 489 and 490:
Central USA mordred.cs.purdue.edu 1
- Page 491 and 492:
G.2 Netnews The Usenet network news
- Page 493 and 494:
G.5 Finding Out for Yourself X is u
- Page 495 and 496:
The character ? may now be used in
- Page 497 and 498:
XSetWMProtocols() is used by client
- Page 499 and 500:
any keycode, Group 1 is used when t
- Page 501 and 502:
The abstract graphical symbol for a
- Page 503 and 504:
drawables. encoding A set of unambi
- Page 505 and 506:
inferiors The inferiors of a window
- Page 507 and 508:
occludes Window Aobscures window B
- Page 509 and 510:
equest Information requested by a c
- Page 511 and 512:
The stipple member of a GC defines
- Page 513:
ISO2022: Information processing−