Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/art/cursor/cursorthemegen/README
blob: e43a7c18b113a41b65ad02f6372b151a1d08e94b (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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
Introduction
============

cursorthemegen is a utility for generating libXcursor
cursor themes.

The inputs to cursorthemegen are conceptually:
 
 A) A set of multi-layer images, one for each
    size.
 B) A XML theme description file

Each image contains all the cursors arranged in
a grid; the layers are:
 
 - A layer with a dot for the hotspot of each cursor
 - The main image or first animation frame for multi-frame
   animated cursors
 - The second animation frame for multi-frame animated cursors
 - ...

In practice, since loading of multilayer images is not
supported by standard image libraries, each layer is
input as a separate image file.

The cursor theme file contains information about the
source images to read, the location of each named
cursor within the grid, and a set of aliases from
names to other names.


Invocation
==========

cursorthemegen takes two arguments:

 cursorthemegen THEMEFILE OUTPUTDIR

cursorthemegen reads in THEMEFILE, compiles a cursor
theme from it, creates the OUTPUTDIR directory  and 
writes  the result in it. The OUTPUTDIR directory must 
not already exist.


Theme file format
=================

The tags in the Theme file format are:

<theme>: The toplevel element. There must be 
  exactly one of these.

  Attributes:
    name: The name of the theme. Required.

  Child elements:
    <alias>, <layout>, <source>

<alias>: The alias element defines an alias of 
  one cursor name to another cursor.

  Attributes: 
   name: The name of the alias. Required.
   target: The name cursor (or alias) to which the
      alias points. Required.

  Child elements: 
    None

<source>: Defines a multilayer source

 Attributes:
    size: The nominal size of the cursors in the
      this source. This is used when selecting a 
      cursor. Required.

    gridsize: The size of the grid used for this
      source. Defaults to the same as 'size'.
      Optional.

 Child elements:
    <image>

<image>: One layer in a multilayer source

  Attributes:
    file: The filename to get the image from. Required.
    use: Either an integer indicating what animation
     frame this is (0, 1, ...) or "hotspot" to
     indicate that this frame contains hotspots. Required.

  Child elements:
    None

<layout>: Defines the layout of cursors within the grid.
  
  Attributes:
    None
 
  Child elements:
    <row>

<row>: Defines one row of cursors within the grid

  Attributes:
    None
 
  Child elements:
    <cursor>

<cursor>: Defines a single cursor. If there are no
  child <frame> elements, it is assumed to be a non-animated
  cursor with a single frame in it. Otherwise, one
  or more frames is specified with child <frame> elements.

  Attributes:
    name: The name of the cursor. Required.
 
  Child elements:
    <frame>

<frame>: Defines one frame of a multiframe cursor.
  
  Attributes:
    delay: The delay before the next frame is shown in 
    milliseconds. Optional. (If you don't specify the delays 
    for a multiframe animation, the result is undefined.)

  Child elements:
    None

Note that cursorthemegen doesn't actually use a full
XML parser, but the XML-subset GMarkup parser from
GLib, so some less common XML constructs may not work.


Makefile example
================

Makefile rules for generating and installing a theme
look like:

bluecurve_images =				\
	Bluecurve-1-24.png			\
	Bluecurve-2-24.png			\
	Bluecurve-hotspot-24.png

Bluecurve.stamp: $(bluecurve_images) Bluecurve.cursortheme
	rm -rf Bluecurve && \
	$(THEMEGEN) Bluecurve.cursortheme Bluecurve && \
	touch Bluecurve.stamp

install:
	rm -rf $(datadir)/icons/Bluecurve/cursors
	mkdir -p $(datadir)/icons/Bluecurve/cursors
	for i in `cd Bluecurve && echo *` ; do \
	  if test -L Bluecurve/$$i ; then \
	    cp -d Bluecurve/$$i $(datadir)/icons/Bluecurve/cursors/$$i ; \
	  else \
	    install -m 0644 Bluecurve/$$i $(datadir)/icons/Bluecurve/cursors/$$i ; \
          fi ; \
	done


License
=======

Copyright © 2003 Red Hat, Inc.

Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of Red Hat not be used in advertising or
publicity pertaining to distribution of the software without specific,
written prior permission.  Red Hat makes no representations about the
suitability of this software for any purpose.  It is provided "as is"
without express or implied warranty.

RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.