~gdesklets-desklet-team/gdesklets/0.36

« back to all changes in this revision

Viewing changes to doc/book/dsp-tag-display.xml

  • Committer: Robert Pastierovic
  • Date: 2007-10-07 10:08:42 UTC
  • Revision ID: pastierovic@gmail.com-20071007100842-fdvp2vzmqgh1j87k
merged 0.3x branch and basic documentation and some other changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<section id="dsp-tag-display" xmlns:xi="http://www.w3.org/2001/XInclude">
 
2
  <title>&lt;display&gt;</title>
 
3
 
 
4
  <para>This is the root element of every display file. It represents the
 
5
    display window on the screen. Apart from being a toplevel window, it is
 
6
    similar to a
 
7
    <link linkend="dsp-tag-group">&lt;group&gt;.</link> and inherits all of its
 
8
    properties.</para>
 
9
 
 
10
 
 
11
  <section><title>Attributes</title>
 
12
    <informaltable frame="topbot">
 
13
      <tgroup>
 
14
        <thead>
 
15
          <row>
 
16
            <entry>Name</entry>
 
17
            <entry>Type</entry>
 
18
            <entry>Default Value</entry>
 
19
            <entry>Description</entry>
 
20
          </row>
 
21
        </thead>
 
22
        <tbody>
 
23
          <row>
 
24
            <entry>bg-color</entry>
 
25
            <entry>color</entry>
 
26
            <entry>#00000000</entry>
 
27
            <entry>The background color of the display. You may use the
 
28
              alpha channel for color values to achieve translucency.</entry>
 
29
          </row>
 
30
          <row>
 
31
            <entry>bg-uri</entry>
 
32
            <entry>URI</entry>
 
33
            <entry></entry>
 
34
            <entry valign="top">The background image of the display. Overrides
 
35
              <property>bg-color</property>. If the image does not fit the
 
36
              window, it gets tiled over it.</entry>
 
37
          </row>
 
38
          <row>
 
39
            <entry>desktop-borders</entry>
 
40
            <entry>unit list</entry>
 
41
            <entry></entry>
 
42
            <entry valign="top">The desktop borders settings, if the window manager
 
43
              supports desktop struts.
 
44
              This property takes a list of two unit values, horizontal and
 
45
              vertical. Each value specifies the distance of the border from the
 
46
              desklet window. See below for details and examples.</entry>
 
47
          </row>
 
48
          <row>
 
49
            <entry>icon</entry>
 
50
            <entry>URI</entry>
 
51
            <entry></entry>
 
52
            <entry valign="top">The window icon.</entry>
 
53
          </row>
 
54
          <row>
 
55
            <entry>shape</entry>
 
56
            <entry>URI</entry>
 
57
            <entry></entry>
 
58
            <entry valign="top">The shape of the window. Images with an alpha
 
59
              channel can be used for changing the shape. All completely
 
60
              transparent parts result in holes in the window.</entry>
 
61
          </row>
 
62
          <row>
 
63
            <entry>title</entry>
 
64
            <entry>string</entry>
 
65
            <entry></entry>
 
66
            <entry valign="top">The window title.</entry>
 
67
          </row>
 
68
          <row>
 
69
            <entry valign="top">window-flags</entry>
 
70
            <entry valign="top">string list</entry>
 
71
            <entry valign="top">decorated, managed</entry>
 
72
            <entry valign="top">Attribute flags for the window. See below for a
 
73
              list of the supported flags.
 
74
              <literal>above, below, decorated, managed, sticky</literal>.
 
75
              </entry>
 
76
          </row>
 
77
        </tbody>
 
78
      </tgroup>
 
79
    </informaltable>
 
80
  </section>
 
81
 
 
82
 
 
83
 
 
84
  <section><title>Window Flags</title>
 
85
 
 
86
    <para>Window flags can change the appearance and the behavior of a window.
 
87
      The following flags are recognized by
 
88
      <application>gDesklets</application>:</para>
 
89
 
 
90
    <itemizedlist>
 
91
      <listitem><literal>above</literal> - The window appears above all normal
 
92
        windows and cannot be lowered.</listitem>
 
93
      <listitem><literal>below</literal> - The window appears below all normal
 
94
        windows and cannot be raised.</listitem>
 
95
      <listitem><literal>decorated</literal> - A decorated window has a titlebar
 
96
        and a window frame.</listitem>
 
97
      <listitem><literal>managed</literal> - A managed window is controlled by
 
98
        the window manager, not by <application>gDesklets</application>.
 
99
        </listitem>
 
100
      <listitem><literal>sticky</literal> - The window appears on all
 
101
        workspaces.</listitem>
 
102
    </itemizedlist>
 
103
 
 
104
    <tip>
 
105
      <para>The ideal combination for desktop applets is <literal>sticky,
 
106
        below</literal>.</para>
 
107
    </tip>
 
108
 
 
109
  </section>
 
110
 
 
111
 
 
112
  <section><title>Desktop Borders <emphasize>[new in 0.35]</emphasize></title>
 
113
 
 
114
    <para>Desktop borders define areas on the desktop which cannot be covered
 
115
      by maximized windows. Panels (i.e. gnome-panel, pypanel) use this 
 
116
      feature, for example.</para>
 
117
      
 
118
    <para>Display windows take two arguments for the border settings. One for
 
119
      a horizontal border and one for a vertical border. The values specify the
 
120
      distance of the border from the display window. For example, a desklet at
 
121
      the bottom edge of the screen with a vertical border value set to
 
122
      <literal>0</literal> (i.e. <literal>desktop-borders=",0"</literal> will 
 
123
      set a "virtual desktop border" along the desklet's top edge. If the
 
124
      desklet, however, is nearer towards the top edge of the screen, the border
 
125
      will be along its bottom edge.</para>
 
126
      
 
127
    <para>When increasing the border value (greater than <literal>0</literal>), 
 
128
      the border will be shifted away from the screen's edge by that amount. 
 
129
      Negative values pull the border towards the screen's edge. If you unset 
 
130
      the value (leave it empty) the border will be turned off.  You can do this
 
131
      with the unit constructor <literal>Unit()</literal> in an inline script.
 
132
      </para>
 
133
      
 
134
    <note>
 
135
      <para>Desktop borders might by annoying sometimes. So if your desklet supports
 
136
        desktop borders, please also provide an option to turn off that behavior!
 
137
        </para>
 
138
    </note>
 
139
 
 
140
  </section>
 
141
  
 
142
  
 
143
 
 
144
  <section><title>Examples</title>
 
145
 
 
146
    <programlisting><![CDATA[
 
147
<display window-flags="sticky, below" bg-color="white"
 
148
         width="100" height="100"
 
149
         desktop-borders=",0">
 
150
 
 
151
  <!-- This sets the height and width of the desklet to 
 
152
       100 pixels, puts the desklet below all other 
 
153
       windows and on every virtual desktop, and sets 
 
154
       the top or bottom "virtual border" of the desktop 
 
155
       to be exactly at the edge of the desklet.
 
156
    -->
 
157
 
 
158
  ...
 
159
  
 
160
</display>
 
161
 
 
162
 
 
163
<display id="win"
 
164
         window-flags="sticky, above"
 
165
         desktop-borders="-20,">
 
166
 
 
167
  <!-- This sets the left or right "virtual border"
 
168
       of the desktop to be 20 pixels below or above 
 
169
       the top or bottom of the desklet, respectively.
 
170
    -->
 
171
 
 
172
  ...
 
173
 
 
174
  <prefs>
 
175
    <!-- Add a configuration option so the user can
 
176
         set how much of a space between the desklet's
 
177
         side and a maximized window he or she would 
 
178
         like.
 
179
      -->
 
180
    <integer label="Side Border Placement:" 
 
181
        min="-500" 
 
182
        bind="tb_border" callback="border_chg"/>
 
183
  </prefs>
 
184
  
 
185
  ...
 
186
  
 
187
  <script>
 
188
    <![CDATA[
 
189
    
 
190
    tb_border = -20
 
191
    
 
192
    def border_chg(key, value):
 
193
        
 
194
        # desktop-borders expects a list of Unit types
 
195
        # so that's what we have to give it.  The 
 
196
        # second argument is just the Unit constructor,
 
197
        # which is like leaving the second argument blank
 
198
        # in the <display> tag above.
 
199
        Dsp.win.desktop_borders = [Unit(value,PX),Unit()]
 
200
    
 
201
</display>
 
202
]]></programlisting>
 
203
 
 
204
  </section>
 
205
 
 
206
</section>