Merge lp:~bregma/libgrip/lp-744911 into lp:libgrip
- lp-744911
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 52 |
Proposed branch: | lp:~bregma/libgrip/lp-744911 |
Merge into: | lp:libgrip |
Diff against target: |
689 lines (+467/-23) 10 files modified
.bzrignore (+26/-0) Makefile.am (+2/-2) configure.ac (+3/-0) doc/Makefile.am (+2/-0) doc/reference/Makefile.am (+106/-0) doc/reference/libgrip-docs.sgml.in (+51/-0) doc/reference/libgrip-sections.txt (+53/-0) doc/reference/libgrip.types (+4/-0) src/gripgesturemanager.c (+27/-4) src/gripgesturemanager.h (+193/-17) |
To merge this branch: | bzr merge lp:~bregma/libgrip/lp-744911 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Duncan McGreggor (community) | Approve | ||
David Planella | review docs published | Pending | |
Review via email: mp+55539@code.launchpad.net |
Commit message
Description of the change
Adds gtk-doc reference docs.
Once packaged, this should satisfy bug lp:744911.
Chase Douglas (chasedouglas) wrote : | # |
Stephen M. Webb (bregma) wrote : | # |
An example of the generated docs can now be found here: <http://
Duncan McGreggor (oubiwann) wrote : | # |
Thanks for the docs (and the link) Stephen!
So I have one comment, and you're free to go either route. But first, here's a list of the components that seem to be missing documentation:
* struct GripGestureMana
* union GripGestureEvent
* struct GripEventGestureAny
* grip_gesture_
* grip_gesture_
* grip_gesture_
We should do one of the following:
1) add docs (even a short one-sentence description) for the 6 listed above, or
2) be prepared to update the docs when asked by community members.
I'd prefer option #1, but if it's a matter of being unclear of the exact usage, and there being too much overhead in tracking down the folks that know, we can do #2.
However, if we go that route, it means that we need to be *very* conscientious: as soon as we answer a question in-channel (or mail list) or find an answer out from someone who knows, we need to file a ticket to update the docs, and add that information immediately.
I will set my review to "approve" -- however, don't merge yet. Let's get a review from David Planella.
- 42. By Stephen M. Webb
-
More final documentation tweaks, for the remaining undocumented bits.
Preview Diff
1 | === added file '.bzrignore' |
2 | --- .bzrignore 1970-01-01 00:00:00 +0000 |
3 | +++ .bzrignore 2011-04-13 18:27:31 +0000 |
4 | @@ -0,0 +1,26 @@ |
5 | +*.gir |
6 | +*.la |
7 | +*.lo |
8 | +*.make |
9 | +*.pc |
10 | +*.stamp |
11 | +*.typelib |
12 | +.deps |
13 | +.libs |
14 | +aclocal.m4 |
15 | +autom4te.cache |
16 | +config.* |
17 | +depcomp |
18 | +doc/reference/*.sgml |
19 | +doc/reference/*.txt |
20 | +doc/reference/html |
21 | +doc/reference/tmpl |
22 | +doc/reference/xml |
23 | +examples/rectangle-mover/grip-test |
24 | +libtool |
25 | +ltmain.sh |
26 | +Makefile |
27 | +Makefile.in |
28 | +missing |
29 | +src/griptypebuiltins.* |
30 | +stamp-* |
31 | |
32 | === modified file 'Makefile.am' |
33 | --- Makefile.am 2011-03-09 03:00:31 +0000 |
34 | +++ Makefile.am 2011-04-13 18:27:31 +0000 |
35 | @@ -1,4 +1,4 @@ |
36 | -SUBDIRS = src bindings examples/rectangle-mover |
37 | +SUBDIRS = src bindings examples/rectangle-mover doc |
38 | |
39 | libgrip-0.1.pc: libgrip.pc |
40 | cp -f libgrip.pc libgrip-0.1.pc |
41 | @@ -12,7 +12,7 @@ |
42 | |
43 | ACLOCAL_AMFLAGS=-I m4 |
44 | |
45 | -DISTCHECK_CONFIGURE_FLAGS = --disable-gtk-doc |
46 | +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection --enable-localinstall |
47 | |
48 | dist-hook: |
49 | @if test -d "$(top_srcdir)/.bzr"; \ |
50 | |
51 | === modified file 'configure.ac' |
52 | --- configure.ac 2011-03-23 18:13:02 +0000 |
53 | +++ configure.ac 2011-04-13 18:27:31 +0000 |
54 | @@ -119,6 +119,9 @@ |
55 | bindings/Makefile |
56 | examples/rectangle-mover/Makefile |
57 | libgrip.pc |
58 | + doc/Makefile |
59 | + doc/reference/Makefile |
60 | + doc/reference/libgrip-docs.sgml |
61 | ]) |
62 | |
63 | AC_OUTPUT |
64 | |
65 | === added directory 'doc' |
66 | === added file 'doc/Makefile.am' |
67 | --- doc/Makefile.am 1970-01-01 00:00:00 +0000 |
68 | +++ doc/Makefile.am 2011-04-13 18:27:31 +0000 |
69 | @@ -0,0 +1,2 @@ |
70 | +SUBDIRS = reference |
71 | + |
72 | |
73 | === added directory 'doc/reference' |
74 | === added file 'doc/reference/Makefile.am' |
75 | --- doc/reference/Makefile.am 1970-01-01 00:00:00 +0000 |
76 | +++ doc/reference/Makefile.am 2011-04-13 18:27:31 +0000 |
77 | @@ -0,0 +1,106 @@ |
78 | +## Process this file with automake to produce Makefile.in |
79 | + |
80 | +# This is a blank Makefile.am for using gtk-doc. |
81 | +# Copy this to your project's API docs directory and modify the variables to |
82 | +# suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples |
83 | +# of using the various options. |
84 | + |
85 | +# The name of the module, e.g. 'glib'. |
86 | +DOC_MODULE=libgrip |
87 | + |
88 | +# Uncomment for versioned docs and specify the version of the module, e.g. '2'. |
89 | +#DOC_MODULE_VERSION=2 |
90 | + |
91 | + |
92 | +# The top-level SGML file. You can change this if you want to. |
93 | +DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml |
94 | + |
95 | +# Directories containing the source code, relative to $(srcdir). |
96 | +# gtk-doc will search all .c and .h files beneath these paths |
97 | +# for inline comments documenting functions and macros. |
98 | +# e.g. DOC_SOURCE_DIR=../../../gtk ../../../gdk |
99 | +DOC_SOURCE_DIR=$(top_srcdir)/src |
100 | + |
101 | +# Extra options to pass to gtkdoc-scangobj. Not normally needed. |
102 | +SCANGOBJ_OPTIONS= |
103 | + |
104 | +# Extra options to supply to gtkdoc-scan. |
105 | +# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" |
106 | +SCAN_OPTIONS= |
107 | + |
108 | +# Extra options to supply to gtkdoc-mkdb. |
109 | +# e.g. MKDB_OPTIONS=--xml-mode --output-format=xml |
110 | +MKDB_OPTIONS=--xml-mode --output-format=xml |
111 | + |
112 | +# Extra options to supply to gtkdoc-mktmpl |
113 | +# e.g. MKTMPL_OPTIONS=--only-section-tmpl |
114 | +MKTMPL_OPTIONS= |
115 | + |
116 | +# Extra options to supply to gtkdoc-mkhtml |
117 | +MKHTML_OPTIONS= |
118 | + |
119 | +# Extra options to supply to gtkdoc-fixref. Not normally needed. |
120 | +# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html |
121 | +FIXXREF_OPTIONS= |
122 | + |
123 | +# Used for dependencies. The docs will be rebuilt if any of these change. |
124 | +# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h |
125 | +# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c |
126 | +HFILE_GLOB=$(DOC_SOURCE_DIR)/*.h |
127 | +CFILE_GLOB=$(DOC_SOURCE_DIR)/*.c |
128 | + |
129 | +# Extra header to include when scanning, which are not under DOC_SOURCE_DIR |
130 | +# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h |
131 | +EXTRA_HFILES= |
132 | + |
133 | +# Header files or dirs to ignore when scanning. Use base file/dir names |
134 | +# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code |
135 | +IGNORE_HFILES= |
136 | + |
137 | +# Images to copy into HTML directory. |
138 | +# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png |
139 | +HTML_IMAGES= |
140 | + |
141 | +# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). |
142 | +# e.g. content_files=running.sgml building.sgml changes-2.0.sgml |
143 | +content_files= |
144 | + |
145 | +# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded |
146 | +# These files must be listed here *and* in content_files |
147 | +# e.g. expand_content_files=running.sgml |
148 | +expand_content_files= |
149 | + |
150 | +# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. |
151 | +# Only needed if you are using gtkdoc-scangobj to dynamically query widget |
152 | +# signals and properties. |
153 | +# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) |
154 | +# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) |
155 | +GTKDOC_CFLAGS=$(GTK_CFLAGS) |
156 | +GTKDOC_LIBS=$(top_builddir)/src/libgrip-0.1.la $(GTK_LIBS) |
157 | + |
158 | +# This includes the standard gtk-doc make rules, copied by gtkdocize. |
159 | +include $(top_srcdir)/gtk-doc.make |
160 | + |
161 | +# Other files to distribute |
162 | +# e.g. EXTRA_DIST += version.xml.in |
163 | +EXTRA_DIST += libgrip-docs.sgml.in |
164 | + |
165 | +# Files not to distribute |
166 | +# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types |
167 | +# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt |
168 | +#DISTCLEANFILES += |
169 | + |
170 | +# Comment this out if you want 'make check' to test you doc status |
171 | +# and run some sanity checks |
172 | +if ENABLE_GTK_DOC |
173 | +TESTS_ENVIRONMENT = cd $(srcdir) && \ |
174 | + DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \ |
175 | + SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) |
176 | +#TESTS = $(GTKDOC_CHECK) |
177 | +endif |
178 | + |
179 | +dist-hook-local: gtk-docs-clean all-local |
180 | + |
181 | +gtk-docs-clean: clean |
182 | + rm -rf xml tmpl html |
183 | + |
184 | |
185 | === added file 'doc/reference/libgrip-docs.sgml.in' |
186 | --- doc/reference/libgrip-docs.sgml.in 1970-01-01 00:00:00 +0000 |
187 | +++ doc/reference/libgrip-docs.sgml.in 2011-04-13 18:27:31 +0000 |
188 | @@ -0,0 +1,51 @@ |
189 | +<?xml version="1.0"?> |
190 | +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" |
191 | + "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" |
192 | +[ |
193 | + <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'"> |
194 | +]> |
195 | +<book id="index"> |
196 | + <bookinfo> |
197 | + <title>libgrip Reference Manual</title> |
198 | + <releaseinfo> |
199 | + for @PACKAGE@ @VERSION@. |
200 | + </releaseinfo> |
201 | + </bookinfo> |
202 | + |
203 | + <chapter id="libgrip"> |
204 | + <title>libgrip Overview</title> |
205 | + <para> |
206 | + The libgrip library provides multi-touch and gesture events to GTK widgets. |
207 | + </para> |
208 | + |
209 | + <para> |
210 | + The libgrip library provides a singleton GripGestureManager that maintains |
211 | + a connection to the gesture recognizer. Any widgets interested in acting |
212 | + on gestures must register one or more callback functions with the |
213 | + GripGestureManager, one per gesture primitive. The widgets will receive |
214 | + data describing the ongoing state of gestures as they occur, and must take |
215 | + appropriate action in the callback function. |
216 | + </para> |
217 | + </chapter> |
218 | + |
219 | + <chapter id="libgrip-api"> |
220 | + <title>Programming Interface</title> |
221 | + <xi:include href="xml/GripGestureManager.xml"/> |
222 | + <xi:include href="xml/GripGestureEvents.xml"/> |
223 | + </chapter> |
224 | + |
225 | + <chapter id="object-tree"> |
226 | + <title>Object Hierarchy</title> |
227 | + <xi:include href="xml/tree_index.sgml"/> |
228 | + </chapter> |
229 | + <index id="api-index-full"> |
230 | + <title>API Index</title> |
231 | + <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include> |
232 | + </index> |
233 | + <index id="deprecated-api-index" role="deprecated"> |
234 | + <title>Index of deprecated API</title> |
235 | + <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include> |
236 | + </index> |
237 | + |
238 | + <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include> |
239 | +</book> |
240 | |
241 | === added file 'doc/reference/libgrip-sections.txt' |
242 | --- doc/reference/libgrip-sections.txt 1970-01-01 00:00:00 +0000 |
243 | +++ doc/reference/libgrip-sections.txt 2011-04-13 18:27:31 +0000 |
244 | @@ -0,0 +1,53 @@ |
245 | +<SECTION> |
246 | +<FILE>GripGestureManager</FILE> |
247 | +<TITLE>GripGestureManager</TITLE> |
248 | +GripGestureManager |
249 | +GripGestureManagerClass |
250 | + |
251 | +grip_gesture_manager_get |
252 | + |
253 | +<SUBSECTION> |
254 | +GripGestureCallback |
255 | + |
256 | +grip_gesture_manager_register_window |
257 | + |
258 | +<SUBSECTION Standard> |
259 | +GRIP_TYPE_GESTURE_MANAGER |
260 | +GRIP_GESTURE_MANAGER |
261 | +GRIP_IS_GESTURE_MANAGER |
262 | +GRIP_GESTURE_MANAGER_CLASS |
263 | +GRIP_IS_GESTURE_MANAGER_CLASS |
264 | +GRIP_GESTURE_MANAGER_GET_CLASS |
265 | + |
266 | +<SUBSECTION Private> |
267 | +GripGestureManagerPrivate |
268 | +grip_gesture_manager_get_type |
269 | +</SECTION> |
270 | + |
271 | + |
272 | +<SECTION> |
273 | +<FILE>GripGestureEvents</FILE> |
274 | +<TITLE>Gesture Events</TITLE> |
275 | +GripGestureType |
276 | + |
277 | +<SUBSECTION> |
278 | +GripTimeType |
279 | + |
280 | +<SUBSECTION> |
281 | +GripGestureEvent |
282 | +GripEventGestureAny |
283 | +GripEventGestureDrag |
284 | +GripEventGesturePinch |
285 | +GripEventGestureRotate |
286 | +GripEventGestureTap |
287 | +grip_gesture_event_new |
288 | +grip_gesture_event_free |
289 | +grip_gesture_event_copy |
290 | +<SUBSECTION Private> |
291 | +GRIP_TYPE_GESTURE_TYPE |
292 | +grip_gesture_type_get_type |
293 | +grip_gesture_event_get_type |
294 | +GRIP_TYPE_TIME_TYPE |
295 | +grip_time_type_get_type |
296 | +</SECTION> |
297 | + |
298 | |
299 | === added file 'doc/reference/libgrip.types' |
300 | --- doc/reference/libgrip.types 1970-01-01 00:00:00 +0000 |
301 | +++ doc/reference/libgrip.types 2011-04-13 18:27:31 +0000 |
302 | @@ -0,0 +1,4 @@ |
303 | +grip_gesture_event_get_type |
304 | +grip_gesture_manager_get_type |
305 | +grip_gesture_type_get_type |
306 | +grip_time_type_get_type |
307 | |
308 | === modified file 'src/gripgesturemanager.c' |
309 | --- src/gripgesturemanager.c 2011-03-23 15:17:02 +0000 |
310 | +++ src/gripgesturemanager.c 2011-04-13 18:27:31 +0000 |
311 | @@ -1,5 +1,5 @@ |
312 | /* |
313 | - * Copyright 2010 Canonical, Ltd. |
314 | + * Copyright 2010, 2011 Canonical, Ltd. |
315 | * |
316 | * This program is free software: you can redistribute it and/or modify it |
317 | * under the terms of either or both of the following licenses: |
318 | @@ -1165,7 +1165,7 @@ |
319 | /** |
320 | * grip_gesture_manager_register_window: |
321 | * @manager: A #GripGestureManager instance. |
322 | - * @window: A #GtkWindow to register the gesture event for. |
323 | + * @widget: A #GtkWidget to register the gesture event for. |
324 | * @gesture_type: The type of gesture event to register. |
325 | * @touch_points: Number of touch points for this gesture. |
326 | * @callback: Called when a gesture starts, updates, or ends. |
327 | @@ -1260,16 +1260,33 @@ |
328 | return type; |
329 | } |
330 | |
331 | +/** |
332 | + * grip_gesture_event_new: |
333 | + * @gesture_type: the type of the gesture |
334 | + * |
335 | + * Creates a new Grip gesture event. |
336 | + * |
337 | + * Returns: a new #GripGestureEvent |
338 | + */ |
339 | GripGestureEvent * |
340 | -grip_gesture_event_new (GripGestureType type) |
341 | +grip_gesture_event_new (GripGestureType gesture_type) |
342 | { |
343 | GripGestureEvent *event = g_slice_new0 (GripGestureEvent); |
344 | |
345 | - event->any.type = type; |
346 | + event->any.type = gesture_type; |
347 | |
348 | return event; |
349 | } |
350 | |
351 | +/** |
352 | + * grip_gesture_event_copy: |
353 | + * @event: an existing #GripGestureEvent |
354 | + * |
355 | + * Creates a new #GripGestureEvent instance using a deep copy of and existing |
356 | + * event. |
357 | + * |
358 | + * Returns: a new #GripGestureEvent |
359 | + */ |
360 | GripGestureEvent * |
361 | grip_gesture_event_copy (const GripGestureEvent *event) |
362 | { |
363 | @@ -1283,6 +1300,12 @@ |
364 | return new_event; |
365 | } |
366 | |
367 | +/** |
368 | + * grip_gesture_event_free: |
369 | + * @event: a #GripGestureEvent |
370 | + * |
371 | + * Frees the resources allocated for a #GripGestureEvent. |
372 | + */ |
373 | void |
374 | grip_gesture_event_free (GripGestureEvent *event) |
375 | { |
376 | |
377 | === modified file 'src/gripgesturemanager.h' |
378 | --- src/gripgesturemanager.h 2011-03-23 15:17:02 +0000 |
379 | +++ src/gripgesturemanager.h 2011-04-13 18:27:31 +0000 |
380 | @@ -1,5 +1,5 @@ |
381 | /* |
382 | - * Copyright 2010 Canonical, Ltd. |
383 | + * Copyright 2010, 2011 Canonical, Ltd. |
384 | * |
385 | * This program is free software: you can redistribute it and/or modify it |
386 | * under the terms of either or both of the following licenses: |
387 | @@ -30,12 +30,70 @@ |
388 | |
389 | G_BEGIN_DECLS |
390 | |
391 | -#define GRIP_TYPE_GESTURE_MANAGER (grip_gesture_manager_get_type ()) |
392 | -#define GRIP_GESTURE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GRIP_TYPE_GESTURE_MANAGER, GripGestureManager)) |
393 | -#define GRIP_GESTURE_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GRIP_TYPE_GESTURE_MANAGER, GripGestureManagerClass)) |
394 | -#define GRIP_IS_GESTURE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GRIP_TYPE_GESTURE_MANAGER)) |
395 | -#define GRIP_IS_GESTURE_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GRIP_TYPE_GESTURE_MANAGER)) |
396 | -#define GRIP_GESTURE_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GRIP_TYPE_GESTURE_MANAGER, GripGestureManagerClass)) |
397 | +/** |
398 | + * SECTION:GripGestureManager |
399 | + * |
400 | + * The Grip gesture managre is a singleton object that connections to the |
401 | + * gesture recognition engine and manages gesture subscriptions for GTK widgets. |
402 | + */ |
403 | + |
404 | +/** |
405 | + * SECTION:GripGestureEvents |
406 | + * |
407 | + * A series of one or more events are passed to the gesture callback. Each |
408 | + * event conveys information specific to the type of gesture occurring. |
409 | + */ |
410 | + |
411 | +/** |
412 | + * GRIP_TYPE_GESTURE_MANAGER: |
413 | + * |
414 | + * Gets the #GType for the #GripGestureManager. |
415 | + */ |
416 | +#define GRIP_TYPE_GESTURE_MANAGER (grip_gesture_manager_get_type ()) |
417 | + |
418 | +/** |
419 | + * GRIP_GESTURE_MANAGER: |
420 | + * @obj: The #GObject to convert. |
421 | + * |
422 | + * Performs a checked conversion of a #GObject to a #GripGestureManager. |
423 | + */ |
424 | +#define GRIP_GESTURE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GRIP_TYPE_GESTURE_MANAGER, GripGestureManager)) |
425 | + |
426 | +/** |
427 | + * GRIP_GESTURE_MANAGER_CLASS: |
428 | + * @klass: The #GObjectClass to convert. |
429 | + * |
430 | + * Performes a checked conversion of a #GObjectClass to a |
431 | + * #GripGestureManagerClass. |
432 | + */ |
433 | +#define GRIP_GESTURE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GRIP_TYPE_GESTURE_MANAGER, GripGestureManagerClass)) |
434 | + |
435 | +/** |
436 | + * GRIP_IS_GESTURE_MANAGER: |
437 | + * @obj: The #GObject to check. |
438 | + * |
439 | + * Checks to see if #GripGestureManagerClass is in the #GObjectClass heirarchy |
440 | + * of @obj. |
441 | + */ |
442 | +#define GRIP_IS_GESTURE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GRIP_TYPE_GESTURE_MANAGER)) |
443 | + |
444 | +/** |
445 | + * GRIP_IS_GESTURE_MANAGER_CLASS: |
446 | + * @klass: The #GObjectClass to check. |
447 | + * |
448 | + * Checks to see if a #GripGestureManagerClass object is in the object heirarchy |
449 | + * of @klass. |
450 | + */ |
451 | +#define GRIP_IS_GESTURE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GRIP_TYPE_GESTURE_MANAGER)) |
452 | + |
453 | +/** |
454 | + * GRIP_GESTURE_MANAGER_GET_CLASS: |
455 | + * @obj: A #GObject. |
456 | + * |
457 | + * Gets the @GripGestureManagerClass object for @obj if that object is a member |
458 | + * of its #GObjectClass heirarchy. |
459 | + */ |
460 | +#define GRIP_GESTURE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GRIP_TYPE_GESTURE_MANAGER, GripGestureManagerClass)) |
461 | |
462 | typedef struct _GripGestureManager GripGestureManager; |
463 | typedef struct _GripGestureManagerClass GripGestureManagerClass; |
464 | @@ -48,6 +106,15 @@ |
465 | typedef struct _GripEventGestureRotate GripEventGestureRotate; |
466 | typedef struct _GripEventGestureTap GripEventGestureTap; |
467 | |
468 | +/** |
469 | + * GripGestureType: |
470 | + * @GRIP_GESTURE_DRAG: a drag gesture |
471 | + * @GRIP_GESTURE_PINCH: a pinch/expand gesture |
472 | + * @GRIP_GESTURE_ROTATE: a rotate gesture |
473 | + * @GRIP_GESTURE_TAP: a tap gesture |
474 | + * |
475 | + * Indicates the type of gesture for which a gesture event is being received. |
476 | + */ |
477 | typedef enum { |
478 | GRIP_GESTURE_DRAG = 0, |
479 | GRIP_GESTURE_PINCH = 1, |
480 | @@ -55,18 +122,51 @@ |
481 | GRIP_GESTURE_TAP = 15 |
482 | } GripGestureType; |
483 | |
484 | +/** |
485 | + * GripTimeType: |
486 | + * @GRIP_TIME_START: a new gesture is starting |
487 | + * @GRIP_TIME_UPDATE: an existing gesture is updating |
488 | + * @GRIP_TIME_END: a gesture is ending |
489 | + * |
490 | + * Indicates the part of the gesture stream ocuuring during the gesture event. |
491 | + */ |
492 | typedef enum { |
493 | GRIP_TIME_START, |
494 | GRIP_TIME_UPDATE, |
495 | GRIP_TIME_END |
496 | } GripTimeType; |
497 | |
498 | +/** |
499 | + * GripEventGestureAny: |
500 | + * |
501 | + * This struct is not used. |
502 | + */ |
503 | struct _GripEventGestureAny |
504 | { |
505 | GdkEventType type; |
506 | GdkWindow *window; |
507 | }; |
508 | |
509 | +/** |
510 | + * GripEventGestureDrag: |
511 | + * @type: the #GripGestureType of the gesture |
512 | + * @id: identifies the gesture |
513 | + * @window: the #GdkWindow in which the gesture occurred |
514 | + * @root: the root #GdkWindow |
515 | + * @child: the child #GdkWindow |
516 | + * @timestamp: the time the gesture event occurred |
517 | + * @fingers: the number of touches making up the gesture |
518 | + * @focus_x: the X coordinate of the focus point of the gesture start |
519 | + * @focus_y: the Y coordinate of the focus point of the gesture start |
520 | + * @delta_x: the change in the X coordinate since the last gesture event |
521 | + * @delta_y: the change in the Y coordinate since the last gesture event |
522 | + * @velocity_x: the rate of change of the X coordinate |
523 | + * @velocity_y: the rate of change of the Y coordinate |
524 | + * @position_x: the current X coordinate of the centroid poistion of the touches |
525 | + * @position_y: the current Y coordinate of the centroid poistion of the touches |
526 | + * |
527 | + * Data associated with a drag event. A drag is a lateral motion. |
528 | + */ |
529 | struct _GripEventGestureDrag |
530 | { |
531 | GripGestureType type; |
532 | @@ -86,6 +186,25 @@ |
533 | gdouble position_y; |
534 | }; |
535 | |
536 | +/** |
537 | + * GripEventGesturePinch: |
538 | + * @type: the #GripGestureType of the gesture |
539 | + * @id: identifies the gesture |
540 | + * @window: the #GdkWindow in which the gesture occurred |
541 | + * @root: the root #GdkWindow |
542 | + * @child: the child #GdkWindow |
543 | + * @timestamp: the time the gesture event occurred |
544 | + * @fingers: the number of touches making up the gesture |
545 | + * @focus_x: the X coordinate of the focus point of the gesture start |
546 | + * @focus_y: the Y coordinate of the focus point of the gesture start |
547 | + * @radius_delta: the change in the radius (in screen coordinates) |
548 | + * @radial_velocity: the rate of change of the radius |
549 | + * @radius: the current radius (in screen coordinates) |
550 | + * @position_x: the current X coordinate of the centroid poistion of the touches |
551 | + * @position_y: the current Y coordinate of the centroid poistion of the touches |
552 | + * |
553 | + * Data associated with a pinch event. A pinch is an expand or contract motion. |
554 | + */ |
555 | struct _GripEventGesturePinch |
556 | { |
557 | GripGestureType type; |
558 | @@ -104,6 +223,25 @@ |
559 | gfloat position_y; |
560 | }; |
561 | |
562 | +/** |
563 | + * GripEventGestureRotate: |
564 | + * @type: the #GripGestureType of the gesture |
565 | + * @id: identifies the gesture |
566 | + * @window: the #GdkWindow in which the gesture occurred |
567 | + * @root: the root #GdkWindow |
568 | + * @child: the child #GdkWindow |
569 | + * @timestamp: the time the gesture event occurred |
570 | + * @fingers: the number of touches making up the gesture |
571 | + * @focus_x: the X coordinate of the focus point of the gesture start |
572 | + * @focus_y: the Y coordinate of the focus point of the gesture start |
573 | + * @angle_delta: the change in the rotation angle (in radians) |
574 | + * @angular_velocity: the rate of change in the rotation angle |
575 | + * @angle: the current rotation angle |
576 | + * @position_x: the current X coordinate of the centroid poistion of the touches |
577 | + * @position_y: the current Y coordinate of the centroid poistion of the touches |
578 | + * |
579 | + * Data associated with a rotate gesture event. |
580 | + */ |
581 | struct _GripEventGestureRotate |
582 | { |
583 | GripGestureType type; |
584 | @@ -122,6 +260,23 @@ |
585 | gfloat position_y; |
586 | }; |
587 | |
588 | +/** |
589 | + * GripEventGestureTap: |
590 | + * @type: the #GripGestureType of the gesture |
591 | + * @id: identifies the gesture |
592 | + * @window: the #GdkWindow in which the gesture occurred |
593 | + * @root: the root #GdkWindow |
594 | + * @child: the child #GdkWindow |
595 | + * @timestamp: the time the gesture event occurred |
596 | + * @fingers: the number of touches making up the gesture |
597 | + * @tap_time: the duration of the tap |
598 | + * @focus_x: the X coordinate of the focus point of the gesture start |
599 | + * @focus_y: the Y coordinate of the focus point of the gesture start |
600 | + * @position_x: the current X coordinate of the centroid poistion of the touches |
601 | + * @position_y: the current Y coordinate of the centroid poistion of the touches |
602 | + * |
603 | + * Data associated with a tap gesture. |
604 | + */ |
605 | struct _GripEventGestureTap |
606 | { |
607 | GripGestureType type; |
608 | @@ -131,7 +286,6 @@ |
609 | GdkWindow *child; |
610 | guint32 timestamp; |
611 | guint fingers; |
612 | - |
613 | guint32 tap_time; |
614 | gfloat focus_x; |
615 | gfloat focus_y; |
616 | @@ -139,6 +293,17 @@ |
617 | gfloat position_y; |
618 | }; |
619 | |
620 | +/** |
621 | + * GripGestureEvent: |
622 | + * @type: the #GripGestureType, selects the variant record |
623 | + * @any: (not used) |
624 | + * @drag: the event contains a drag gesture record |
625 | + * @pinch: the event contains a pinch gesture record |
626 | + * @rotate: the event contains a rotate gesture record |
627 | + * @tap: the event contains a tap gesture record |
628 | + * |
629 | + * This is a boxed type. |
630 | + */ |
631 | union _GripGestureEvent |
632 | { |
633 | GripGestureType type; |
634 | @@ -150,14 +315,15 @@ |
635 | }; |
636 | |
637 | /** |
638 | - GripGestureManager |
639 | - @parent: #GObject. |
640 | - |
641 | - A singleton manager into which a window may be registered to receive |
642 | - multitouch gesture events. |
643 | + * GripGestureManager: |
644 | + * @parent_instance: the parent #GObject instance. |
645 | + * |
646 | + * A singleton manager into which a window may be registered to receive |
647 | + * multitouch gesture events. |
648 | */ |
649 | struct _GripGestureManager |
650 | { |
651 | + /*< Public >*/ |
652 | GObject parent_instance; |
653 | |
654 | /*< Private >*/ |
655 | @@ -165,9 +331,11 @@ |
656 | }; |
657 | |
658 | /** |
659 | - GripGestureManagerClass |
660 | - @parent_class: #GObjectClass |
661 | -*/ |
662 | + * GripGestureManagerClass: |
663 | + * @parent_class: the base #GObjectClass |
664 | + * |
665 | + * The class object for a #GripGestureManager. |
666 | + */ |
667 | struct _GripGestureManagerClass |
668 | { |
669 | GObjectClass parent_class; |
670 | @@ -179,11 +347,19 @@ |
671 | * @time: A #GripTimeType |
672 | * @gesture: (in): A #GripGestureEvent pointer |
673 | * @user_data: (transfer none): user data |
674 | + * |
675 | + * The gesture callback function is registered by the |
676 | + * grip_gesture_manager_register_window() function and gets called whenever a |
677 | + * new gesture event has been received. The same function may be registered for |
678 | + * more than one gesture type. |
679 | + * |
680 | + * The <type>GripGestureCallback</type> function is the main customization point |
681 | + * for application response to gestural input. |
682 | **/ |
683 | typedef void (* GripGestureCallback) (GtkWidget *widget, |
684 | GripTimeType time, |
685 | GripGestureEvent *gesture, |
686 | - gpointer user_data); |
687 | + gpointer user_data); |
688 | |
689 | GType grip_gesture_manager_get_type (void) G_GNUC_CONST; |
690 |
I don't know exactly how the docs turn out, but I trust Stephen on making documentation :).