File: cha-canvas.html

package info (click to toggle)
ebook-dev-ggad 199908-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,264 kB
  • ctags: 1,163
  • sloc: sh: 44; makefile: 35
file content (158 lines) | stat: -rw-r--r-- 6,067 bytes parent folder | download | duplicates (2)
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <title>
      GnomeCanvas
    </title>
    <meta name="GENERATOR" content=
    "Modular DocBook HTML Stylesheet Version 1.45">
    <link rel="HOME" title="GTK+ / Gnome Application Development"
    href="ggad.html">
    <link rel="UP" title="Advanced GTK+/Gnome Techniques" href= 
    "advanced.html">
    <link rel="PREVIOUS" title="Other Examples" href="z171.html">
    <link rel="NEXT" title="Basic Canvas Architecture" href= 
    "z174.html">
  </head>
  <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink= 
  "#840084" alink="#0000FF">
    <div class="NAVHEADER">
      <table width="100%" border="0" bgcolor="#ffffff" cellpadding= 
      "1" cellspacing="0">
        <tr>
          <th colspan="4" align="center">
            <font color="#000000" size="2">GTK+ / Gnome Application
            Development</font>
          </th>
        </tr>
        <tr>
          <td width="25%" bgcolor="#ffffff" align="left">
            <a href="z171.html"><font color="#0000ff" size="2"><b>
            &lt;&lt;&lt; Previous</b></font></a>
          </td>
          <td width="25%" colspan="2" bgcolor="#ffffff" align= 
          "center">
            <font color="#0000ff" size="2"><b><a href="ggad.html">
            <font color="#0000ff" size="2"><b>
            Home</b></font></a></b></font>
          </td>
          <td width="25%" bgcolor="#ffffff" align="right">
            <a href="z174.html"><font color="#0000ff" size="2"><b>
            Next &gt;&gt;&gt;</b></font></a>
          </td>
        </tr>
      </table>
    </div>
    <div class="CHAPTER">
      <h1>
        <a name="CHA-CANVAS"><tt class="CLASSNAME">
        GnomeCanvas</tt></a>
      </h1>
      <div class="TOC">
        <dl>
          <dt>
            <b>Table of Contents</b>
          </dt>
          <dt>
            <a href="cha-canvas.html#Z173">Introduction to the
            Canvas</a>
          </dt>
          <dt>
            <a href="z174.html">Basic Canvas Architecture</a>
          </dt>
          <dt>
            <a href="z177.html">Using the Canvas</a>
          </dt>
          <dt>
            <a href="sec-itemreference.html">Standard Canvas Item
            Reference</a>
          </dt>
        </dl>
      </div>
      <p>
        This chapter describes the <tt class="CLASSNAME">
        GnomeCanvas</tt> widget, and the standard canvas items that
        come with Gnome. The following chapter discusses in more
        detail how to write a custom canvas item.
      </p>
      <div class="SECT1">
        <h1 class="SECT1">
          <a name="Z173">Introduction to the Canvas</a>
        </h1>
        <p>
          The canvas widget is a powerful and extensible
          object-oriented display engine, useful in a wide variety
          of Gnome applications. The widget itself is simply a
          blank area; you can place <span class="STRUCTNAME">
          GnomeCanvasItem</span>s on it. A <span class=
          "STRUCTNAME">GnomeCanvasItem</span> is a <span class= 
          "STRUCTNAME">GtkObject</span> representing some element
          of the display, such as an image, a rectangle, an
          ellipse, or some text. You can refer to this architecture
          as <i class="FIRSTTERM">structured graphics</i>; the
          canvas lets you deal with graphics in terms of items,
          rather than an undifferentiated grid of pixels. Since a
          <span class="STRUCTNAME">GnomeCanvasItem</span> is a
          <span class="STRUCTNAME">GtkObject</span>, you can create
          your own subclasses to supplement those that come with
          Gnome. This gives you quite a bit of flexibility. Using
          custom canvas items, the canvas can render almost
          anything. At the same time, you can use stock canvas
          items to save time and effort. The canvas puts you in
          control.
        </p>
        <p>
          <tt class="CLASSNAME">GnomeCanvas</tt> has two modes,
          representing a quality/speed tradeoff. In "GDK" mode,
          canvas items render directly to a <span class=
          "STRUCTNAME">GdkPixmap</span> buffer using the GDK
          drawing primitives. The canvas copies the buffer to the
          screen once all items are rendered. In antialiased or
          "AA" mode, the canvas items write RGB pixels to a vector
          of bytes; after all the items have drawn on the RGB
          buffer, the canvas copies it to the screen. This RGB
          buffer mode is called "antialiased" mode because all the
          standard canvas items draw to the RGB buffer using the
          high-quality antialiased routines in <tt class= 
          "APPLICATION">libart_lgpl</tt>. This results in smooth
          lines and very high display quality, with some cost in
          speed.
        </p>
      </div>
    </div>
    <div class="NAVFOOTER">
      <br>
      <br>
      <table width="100%" border="0" bgcolor="#ffffff" cellpadding= 
      "1" cellspacing="0">
        <tr>
          <td width="25%" bgcolor="#ffffff" align="left">
            <a href="z171.html"><font color="#0000ff" size="2"><b>
            &lt;&lt;&lt; Previous</b></font></a>
          </td>
          <td width="25%" colspan="2" bgcolor="#ffffff" align= 
          "center">
            <font color="#0000ff" size="2"><b><a href="ggad.html">
            <font color="#0000ff" size="2"><b>
            Home</b></font></a></b></font>
          </td>
          <td width="25%" bgcolor="#ffffff" align="right">
            <a href="z174.html"><font color="#0000ff" size="2"><b>
            Next &gt;&gt;&gt;</b></font></a>
          </td>
        </tr>
        <tr>
          <td colspan="2" align="left">
            <font color="#000000" size="2"><b>Other
            Examples</b></font>
          </td>
          <td colspan="2" align="right">
            <font color="#000000" size="2"><b>Basic Canvas
            Architecture</b></font>
          </td>
        </tr>
      </table>
    </div>
  </body>
</html>