Skip to Content
XLIB Programming Manual, Rel. 5, Third Edition
book

XLIB Programming Manual, Rel. 5, Third Edition

by Adrian Nye
June 1994
Intermediate to advanced
821 pages
24h 40m
English
O'Reilly Media, Inc.
Content preview from XLIB Programming Manual, Rel. 5, Third Edition

5.11 The Default GC Versus Default Values of a GC

The server creates one GC, called the default GC, when it starts up. This GC is returned by the XDefaultGC() and the DefaultGC() macro. It contains foreground and background colors that are guaranteed contrasting (but not necessarily black and white), and it contains a default font that is guaranteed to be loaded, but is not necessarily the same font on all servers. The values in the default GC must not be changed.

The default GC can be used in simple applications. But it is not very useful since all applications should provide user customization of fonts and colors, and few can avoid the need to modify other GC components as well.

When you create a GC of your own, its default values are slightly different from the values of the default GC. Its foreground and background values are 0 and 1, respectively, so they are not necessarily black and white or contrasting. That’s why you must always set foreground and background when you create a GC. Also, the default font is implementation dependent, and it may not be loaded. Therefore, you must always load the font before attempting to draw with it.

Table 5-3 shows the default values for all members of a graphics context you create.

Table 5-3. The Default Values of a Graphics Context

Component

Value

function

GXcopy

plane_mask

all 1’s

foreground

0

background

1

line_width

0

line_style

LineSolid

cap_style

CapButt

join_style

JoinMiter

fill_style

FillSolid

fill_rule

EvenOddRule

arc_mode

ArcPieSlice

tile

Pixmap filled with ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

X Window System User's Guide for X11 R3 and R4 of the X Window System

X Window System User's Guide for X11 R3 and R4 of the X Window System

Valerie Quercia, Tim O'Reilly

Publisher Resources

ISBN: 9780596806187Catalog PageErrata