1 /**************************************************************************
2 ** (c) Copyright 1998, Andromeda Technology & Automation
3 ***************************************************************************
4 ** MODULE INFORMATION *
5 ***********************
7 ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation
8 ** VERSION NUMBER : $Revision: 1.1 $
10 ** DESCRIPTION : Definition of gc class
12 ** EXPORTED OBJECTS : class gc
15 ***************************************************************************
16 ** ADMINISTRATIVE INFORMATION *
17 ********************************
18 ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
19 ** CREATION DATE : Feb 22, 1998
20 ** LAST UPDATE : Oct 28, 1999
22 **************************************************************************/
24 /*****************************
26 Revision 1.1 2002-07-25 08:01:27 arjen
27 First checkin, AXE release 0.2
29 *****************************/
31 /* static const char *RCSID = "$Id: gc.h,v 1.1 2002-07-25 08:01:27 arjen Exp $"; */
40 ///////////////////////////////////////////////////////////////////////////
43 // MEMBERS : XID gc_id
51 // LAST MODIFIED : Oct 28, 1999
52 ///////////////////////////////////////////////////////////////////////////
68 gc_id = XCreateGC(stddpy, stddpy.Root(), 0, 0);
69 XSetForeground(stddpy, gc_id, fg);
72 gc(font &fn, color &fg)
74 gc_id = XCreateGC(stddpy, stddpy.Root(), 0, 0);
77 XSetFont(stddpy, gc_id, fn);
79 XSetForeground(stddpy, gc_id, fg);
82 gc(font &fn, color &fg, stipple &stip)
84 gc_id = XCreateGC(stddpy, stddpy.Root(), 0, 0);
87 XSetFont(stddpy, gc_id, fn);
89 XSetForeground(stddpy, gc_id, fg);
90 XSetStipple(stddpy, gc_id, stip);
91 XSetFillStyle(stddpy, gc_id, FillStippled);
97 XFreeGC(stddpy, gc_id);
107 gc_id = XCreateGC(stddpy, stddpy.Root(), 0, 0);
110 void SetFunction(int func)
112 XSetFunction(stddpy, gc_id, func);
115 void SetForeground(unsigned long fg)
117 XSetForeground(stddpy, gc_id, fg);
120 void SetBackground(unsigned long fg)
122 XSetBackground(stddpy, gc_id, fg);
125 void SetFont(font &fn)
129 XSetFont(stddpy, gc_id, fn);
133 void SetLineAttributes(unsigned width, int line_style = LineSolid,
134 int cap_style = CapButt, int join_style = JoinMiter)
136 XSetLineAttributes(stddpy, gc_id, width, line_style,
137 cap_style, join_style);