summaryrefslogtreecommitdiff
path: root/html/en/drv/xwin.html
blob: cd2d900966232c916a31ed2c276f6a4a39a24a56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!doctype HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>X-Windows</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
<style type="text/css">
.style1 {
	font-family: Courier;
}
</style>
</head>

<body>

<h2>X-Windows Base Driver</h2>

  <p>This driver represents a basic driver for all system-dependent drivers 
  implemented in the X-Windows system. The implementation uses the XLIB API 
  functions. It was developed using X11R4, but works in more recent versions, 
  such as X11R6.</p>
  <p>Note: The coordinates internally implemented by the video driver use 16-bit 
  integers. Therefore, if a coordinate with less than -32k or more than 32k is 
  defined, it will be interpreted incorrectly.</p>

<h3>Behavior of Functions</h3>
<h4>Control&nbsp; </h4>
<ul>
  <li><a href="../func/other.html#cdPlay">
  <font face="Courier"><strong>Play</strong></font></a>: does nothing, returns
  <font face="Courier">CD_ERROR</font>. </li>
</ul>
<h4>Coordinate System and Clipping </h4>
<ul>
  <li>
  <a href="../func/coordinates.html#cdUpdateYAxis">
  <font face="Courier"><strong>UpdateYAxis</strong></font></a>: the 
  orientation of axis Y is the opposite to its orientation in the CD library.</li>
</ul>
<h4>Primitives</h4>
<ul>
  <li><a href="../func/text.html#cdText"><font face="Courier"><strong>Text</strong></font></a>: 
  text orientation is simulated using XVertex rotines. Generic transformation 
  matrix affects only the position of the text.</li>
  <li><a href="../func/lines.html#cdBegin">
  <font face="Courier"><strong>Begin</strong></font></a>: Filled&nbsp; 
  polygons have an error of one pixel to the right and below. <strong><tt>
  CD_BEZIER</tt></strong> is simulated with lines.</li>
  <li><span class="style1"><a href="../func/marks.html#cdMark">
  <strong>Box</strong></a></span>: in Linux with ATI board, is being drawn with one 
  extra pixel to the right and below.</li>
</ul>
<h4>Attributes </h4>
<ul>
  <li>
  <a href="../func/lines.html#cdLineWidth">
  <font face="Courier"><strong>LineWidth</strong></font></a>: if
  <font face="Courier">width</font> is 1, the driver will use 0 for a better 
  performance.</li>
  <li>
  <a href="../func/lines.html#cdLineStyle">
  <font face="Courier"><strong>LineStyle</strong></font></a>: thick lines have 
  style only in the line's direction. For example, you will see small rectangles 
  in a thick dotted line.</li>
  <li>
  <a href="../func/text.html#cdNativeFont">
  <font face="Courier"><strong>NativeFont</strong></font></a>: also accepts the 
  X-Windows font string format. You can use program <strong>xfontsel</strong> to select a font and obtain the string. 
  For ex: &quot;-*-times-bold-r-*-*-24-*-*-*-*-*-*-*&quot; (equivalent of <strong>Font</strong>(&quot;Times&quot;, 
  CD_BOLD, -24).</li>
  <li><a href="../func/text.html#cdFont">
  <font face="Courier"><strong>Font</strong></font></a>: the old name &quot;System&quot; 
  is mapped to &quot;fixed&quot;.</li>
</ul>
<h4>Colors </h4>
<ul>
  <li>
  <a href="../func/color.html#cdPalette">
  <font face="Courier"><strong>Palette</strong></font></a>: When the number of 
  bits per pixel is smaller than or equal to 8, the driver will use the system 
  palette to solve colors passed as parameters to the canvas. The driver 
  allocates colors as they are requested - if a color cannot be allocated, the 
  closest color is used in the palette. For such, the driver sees all available 
  colors, in the current application and others. If one of the applications is 
  terminated, a color in the palette may become invalid and will only be updated 
  by the driver when it is requested again. For this reason, a call to <strong>
  cdForeground </strong>or <strong>cdBackground</strong> or <strong>cdPalette</strong> 
  is recommended before drawing.<br>
  When CD_FORCE is used, the driver forces color allocation in the X server. 
  This may imply changing colors in other applications when a cursor moves in 
  and out of the canvas. However, if the number of requested colors is smaller 
  than the maximum number of possible colors in the palette, then the first 
  colors in the default system palette will be preserved, minimizing this 
  problem.<br>
  When CD_POLITE is used, all colors allocated by the driver are liberated, and 
  the requested colors are allocated. This is useful for the application to 
  prioritize the colors that will be allocated, causing other colors to be 
  mapped to their closest colors.<br>
  Note that canvases in the same application interfere with one another, but 
  when a canvas is terminated it liberates all allocated colors.</li>
</ul>
<h4>Client Images</h4>
<ul>
  <li>
  <a href="../func/client.html#cdGetImageRGB">
  <font face="Courier"><strong>GetImageRGB</strong></font></a>: can be very 
  slow due to the heavy conversions performed to translate data in system format 
  into RGB vectors. </li>
</ul>
<h4>Exclusive Attributes</h4>
<ul>
  <li>&quot;<b><font face="Courier">GC</font></b>&quot;:&nbsp; returns the X11 graphics 
  context (get only). In Lua is returned as a user data.</li>
</ul>

<ul>
  <li>&quot;<b><font face="Courier">ROTATE</font></b>&quot;:&nbsp; allows the usage of 1 
  angle and 1 coordinate (x, y), that define a global rotation transformation 
  centered in the specified coordinate. Use 1 real and 2 integer values inside a 
  string (&quot;%g %d %d&quot; = angle x y). In this driver will change the 
  current transformation matrix, if removed will reset the current 
  transformation matrix.</li>
</ul>

</body>

</html>