Merge lp:~thomas-voss/platform-api/add-documentation-part-1 into lp:platform-api
- add-documentation-part-1
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Ricardo Salveti |
Approved revision: | 85 |
Merged at revision: | 87 |
Proposed branch: | lp:~thomas-voss/platform-api/add-documentation-part-1 |
Merge into: | lp:platform-api |
Prerequisite: | lp:~thomas-voss/platform-api/introduce-hardware-subdirectory-and-package |
Diff against target: |
1592 lines (+844/-214) 21 files modified
debian/control (+9/-0) debian/libplatform-api1-doc.doc-base (+8/-0) debian/libplatform-api1-doc.install (+1/-0) doc/CMakeLists.txt (+1/-1) doc/Doxyfile.in (+10/-10) doc/mainpage.md (+1/-1) include/ubuntu/application/archive.h (+280/-108) include/ubuntu/application/description.h (+55/-17) include/ubuntu/application/id.h (+31/-9) include/ubuntu/application/instance.h (+47/-13) include/ubuntu/application/lifecycle_delegate.h (+86/-14) include/ubuntu/application/operation_mode.h (+7/-3) include/ubuntu/application/options.h (+31/-9) include/ubuntu/application/sensors/accelerometer.h (+62/-4) include/ubuntu/application/sensors/event/accelerometer.h (+31/-3) include/ubuntu/application/sensors/event/light.h (+17/-1) include/ubuntu/application/sensors/event/proximity.h (+27/-5) include/ubuntu/application/sensors/light.h (+62/-4) include/ubuntu/application/sensors/proximity.h (+62/-4) include/ubuntu/status.h (+8/-3) include/ubuntu/unit.h (+8/-5) |
To merge this branch: | bzr merge lp:~thomas-voss/platform-api/add-documentation-part-1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Ricardo Salveti (community) | Approve | ||
Review via email: mp+173174@code.launchpad.net |
This proposal supersedes a proposal from 2013-07-05.
Commit message
Add first wave of doxygen documentation and make the documentation known to the packaging setup.
Description of the change
Add first wave of doxygen documentation and make the documentation known to the packaging setup.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:82
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 83. By Thomas Voß
-
[ Thomas Voß ]
* * Adjust the cmake setup and get rid of -DUSE_GLES, instead rely on
automatic detection if the header is available. * Adjust the cmake
setup to bail out if EGL is not available. * Adjust the cmake setup
to autogenerate doxygen API documentation.
* * Add a pkgconfig file for the platform API * Adjust installation of
header files to account for version.
[ Ubuntu daily release ]
* Automatic snapshot from revision 84
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:83
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Didier Roche-Tolomelli (didrocks) wrote : | # |
+Depends: libplatform-
-> you are missing a comma here
debian/
-> I think that should be in the -doc package, right?
Otherwise looking good, you can merge once you fixed that :)
- 84. By Thomas Voß
-
Addressing review comments.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:84
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 85. By Thomas Voß
-
Adjust Document:-line.
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'debian/control' |
2 | --- debian/control 2013-07-05 16:37:30 +0000 |
3 | +++ debian/control 2013-07-05 16:37:30 +0000 |
4 | @@ -39,10 +39,19 @@ |
5 | libplatform-api-headers (= ${binary:Version}), |
6 | libplatform-api1-hybris | libplatform-api1, |
7 | ${misc:Depends}, |
8 | +Suggests: libplatform-api1-doc, |
9 | Description: Platform API for system level capabilities (development) |
10 | This package provides the development library and headers (via |
11 | dependency) for the Platform API. |
12 | |
13 | +Package: libplatform-api1-doc |
14 | +Section: doc |
15 | +Architecture: any |
16 | +Depends: libplatform-api1-dev, |
17 | + ${misc:Depends}, |
18 | +Description: Platform API for system level capabilities (development) |
19 | + This package provides the developer documentation for the Platform API. |
20 | + |
21 | Package: libplatform-api1-hybris |
22 | Section: libs |
23 | Architecture: any |
24 | |
25 | === added file 'debian/libplatform-api1-doc.doc-base' |
26 | --- debian/libplatform-api1-doc.doc-base 1970-01-01 00:00:00 +0000 |
27 | +++ debian/libplatform-api1-doc.doc-base 2013-07-05 16:37:30 +0000 |
28 | @@ -0,0 +1,8 @@ |
29 | +Document: ubuntu-platform-api |
30 | +Title: Ubuntu Platform API Reference Documentation |
31 | +Author: Thomas Voß |
32 | +Abstract: This is the reference documentation for the Ubuntu Platform API |
33 | +Section: Debian |
34 | +Format: HTML |
35 | +Index: /usr/share/doc/ubuntu-platform-api/html/index.html |
36 | +Files: /usr/share/doc/ubuntu-platform-api/html/*.html |
37 | |
38 | === added file 'debian/libplatform-api1-doc.install' |
39 | --- debian/libplatform-api1-doc.install 1970-01-01 00:00:00 +0000 |
40 | +++ debian/libplatform-api1-doc.install 2013-07-05 16:37:30 +0000 |
41 | @@ -0,0 +1,1 @@ |
42 | +usr/share/doc/ubuntu-platform-api |
43 | \ No newline at end of file |
44 | |
45 | === modified file 'doc/CMakeLists.txt' |
46 | --- doc/CMakeLists.txt 2013-06-11 09:40:30 +0000 |
47 | +++ doc/CMakeLists.txt 2013-07-05 16:37:30 +0000 |
48 | @@ -26,5 +26,5 @@ |
49 | COMMENT "Generating API documentation with Doxygen" VERBATIM) |
50 | install( |
51 | DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html |
52 | - DESTINATION share/ubuntu-platform-api/doc) |
53 | + DESTINATION share/doc/ubuntu-platform-api) |
54 | endif(DOXYGEN_FOUND) |
55 | \ No newline at end of file |
56 | |
57 | === modified file 'doc/Doxyfile.in' |
58 | --- doc/Doxyfile.in 2013-07-05 16:37:30 +0000 |
59 | +++ doc/Doxyfile.in 2013-07-05 16:37:30 +0000 |
60 | @@ -26,7 +26,7 @@ |
61 | # identify the project. Note that if you do not use Doxywizard you need |
62 | # to put quotes around the project name if it contains spaces. |
63 | |
64 | -PROJECT_NAME = @CMAKE_PROJECT_NAME@ |
65 | +PROJECT_NAME = "Ubuntu Platform API" |
66 | |
67 | # The PROJECT_NUMBER tag can be used to enter a project or revision number. |
68 | # This could be handy for archiving the generated documentation or |
69 | @@ -38,7 +38,7 @@ |
70 | # for a project that appears at the top of each page and should give viewer |
71 | # a quick idea about the purpose of the project. Keep the description short. |
72 | |
73 | -PROJECT_BRIEF = |
74 | +PROJECT_BRIEF = "A library helping with tight integration into the Ubuntu platform" |
75 | |
76 | # With the PROJECT_LOGO tag one can specify an logo or icon that is |
77 | # included in the documentation. The maximum height of the logo should not |
78 | @@ -668,7 +668,7 @@ |
79 | # directories like "/usr/src/myproject". Separate the files or directories |
80 | # with spaces. |
81 | |
82 | -INPUT = @CMAKE_CURRENT_SOURCE_DIR@/../include |
83 | +INPUT = @CMAKE_CURRENT_SOURCE_DIR@ @CMAKE_CURRENT_SOURCE_DIR@/../include |
84 | |
85 | # This tag can be used to specify the character encoding of the source files |
86 | # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is |
87 | @@ -728,7 +728,7 @@ |
88 | # directories that contain example code fragments that are included (see |
89 | # the \include command). |
90 | |
91 | -EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/../examples |
92 | +EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/../src |
93 | |
94 | # If the value of the EXAMPLE_PATH tag contains directories, you can use the |
95 | # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp |
96 | @@ -791,7 +791,7 @@ |
97 | # This can be useful if you have a project on for instance GitHub and want reuse |
98 | # the introduction page also for the doxygen output. |
99 | |
100 | -USE_MDFILE_AS_MAINPAGE = |
101 | +USE_MDFILE_AS_MAINPAGE = @CMAKE_CURRENT_SOURCE_DIR@/mainpage.md |
102 | |
103 | #--------------------------------------------------------------------------- |
104 | # configuration options related to source browsing |
105 | @@ -807,7 +807,7 @@ |
106 | # Setting the INLINE_SOURCES tag to YES will include the body |
107 | # of functions and classes directly in the documentation. |
108 | |
109 | -INLINE_SOURCES = YES |
110 | +INLINE_SOURCES = NO |
111 | |
112 | # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct |
113 | # doxygen to hide any special comment blocks from generated source code |
114 | @@ -975,7 +975,7 @@ |
115 | # documentation will contain sections that can be hidden and shown after the |
116 | # page has loaded. |
117 | |
118 | -HTML_DYNAMIC_SECTIONS = NO |
119 | +HTML_DYNAMIC_SECTIONS = YES |
120 | |
121 | # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of |
122 | # entries shown in the various tree structured indices initially; the user |
123 | @@ -1145,7 +1145,7 @@ |
124 | # navigation tree you can set this option to NO if you already set |
125 | # GENERATE_TREEVIEW to YES. |
126 | |
127 | -DISABLE_INDEX = NO |
128 | +DISABLE_INDEX = YES |
129 | |
130 | # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index |
131 | # structure should be generated to display hierarchical information. |
132 | @@ -1157,7 +1157,7 @@ |
133 | # Since the tree basically has the same information as the tab index you |
134 | # could consider to set DISABLE_INDEX to NO when enabling this option. |
135 | |
136 | -GENERATE_TREEVIEW = NO |
137 | +GENERATE_TREEVIEW = YES |
138 | |
139 | # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values |
140 | # (range [0,1..20]) that doxygen will group on one line in the generated HTML |
141 | @@ -1434,7 +1434,7 @@ |
142 | # If the GENERATE_MAN tag is set to YES (the default) Doxygen will |
143 | # generate man pages |
144 | |
145 | -GENERATE_MAN = NO |
146 | +GENERATE_MAN = YES |
147 | |
148 | # The MAN_OUTPUT tag is used to specify where the man pages will be put. |
149 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be |
150 | |
151 | === modified file 'doc/mainpage.md' |
152 | --- doc/mainpage.md 2013-02-14 16:25:13 +0000 |
153 | +++ doc/mainpage.md 2013-07-05 16:37:30 +0000 |
154 | @@ -1,4 +1,4 @@ |
155 | -Ubuntu Platform API {#mainpage} |
156 | +Ubuntu Platform API {#mainpage} |
157 | =================== |
158 | |
159 | The Ubuntu platform API Implements access to the Ubuntu platform and |
160 | |
161 | === modified file 'include/ubuntu/application/archive.h' |
162 | --- include/ubuntu/application/archive.h 2013-06-03 20:54:26 +0000 |
163 | +++ include/ubuntu/application/archive.h 2013-07-05 16:37:30 +0000 |
164 | @@ -14,7 +14,7 @@ |
165 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
166 | * |
167 | * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com> |
168 | - * Thomas Voß <thomas.voss@canonical.com> |
169 | + * Thomas Voß <thomas.voss@canonical.com> |
170 | */ |
171 | |
172 | #ifndef UBUNTU_APPLICATION_ARCHIVE_H_ |
173 | @@ -26,139 +26,311 @@ |
174 | |
175 | struct UApplicationArchive; |
176 | |
177 | +/** |
178 | + * \brief Creates a new archive, ownership is transferred to caller. |
179 | + * \ingroup application_support |
180 | + * \sa u_application_archive_destroy |
181 | + * \returns A new archive instance or NULL if not enough memory is available. |
182 | + */ |
183 | UApplicationArchive* |
184 | u_application_archive_new(); |
185 | |
186 | +/** |
187 | + * \brief Destroys the given archive instance and releases all resources held by the instance. |
188 | + * \ingroup application_support |
189 | + * \param[in] archive The instance to be destroyed. |
190 | + * \post All resources held by the instance are released. The result of any operation invoked on the destroyed instance are undefined. |
191 | + */ |
192 | void |
193 | u_application_archive_destroy( |
194 | - UApplicationArchive *archive); |
195 | - |
196 | -UStatus |
197 | -u_application_archive_write( |
198 | - UApplicationArchive *archive, |
199 | - int8_t c); |
200 | - |
201 | -UStatus |
202 | -u_application_archive_write( |
203 | - UApplicationArchive *archive, |
204 | - uint8_t c); |
205 | - |
206 | -UStatus |
207 | -u_application_archive_write( |
208 | - UApplicationArchive *archive, |
209 | - int16_t s); |
210 | - |
211 | -UStatus |
212 | -u_application_archive_write( |
213 | - UApplicationArchive *archive, |
214 | - uint16_t s); |
215 | - |
216 | -UStatus |
217 | -u_application_archive_write( |
218 | - UApplicationArchive *archive, |
219 | - int32_t s); |
220 | - |
221 | -UStatus |
222 | -u_application_archive_write( |
223 | - UApplicationArchive *archive, |
224 | - uint32_t s); |
225 | - |
226 | -UStatus |
227 | -u_application_archive_write( |
228 | - UApplicationArchive *archive, |
229 | - int64_t s); |
230 | - |
231 | -UStatus |
232 | -u_application_archive_write( |
233 | - UApplicationArchive *archive, |
234 | - uint64_t s); |
235 | - |
236 | + UApplicationArchive *archive); |
237 | + |
238 | +/** |
239 | + * \brief Writes a signed 8-bit integer to the supplied archive |
240 | + * \ingroup application_support |
241 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
242 | + * \param[in] archive The archive to write to. |
243 | + * \param[in] c The signed 8-bit integer to write to the archive. |
244 | + */ |
245 | +UStatus |
246 | +u_application_archive_write( |
247 | + UApplicationArchive *archive, |
248 | + int8_t c); |
249 | + |
250 | +/** |
251 | + * \brief Writes an unsigned 8-bit integer to the supplied archive |
252 | + * \ingroup application_support |
253 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
254 | + * \param[in] archive The archive to write to. |
255 | + * \param[in] c The unsigned 8-bit integer to write to the archive. |
256 | + */ |
257 | +UStatus |
258 | +u_application_archive_write( |
259 | + UApplicationArchive *archive, |
260 | + uint8_t c); |
261 | + |
262 | +/** |
263 | + * \brief Writes a signed 16-bit integer to the supplied archive |
264 | + * \ingroup application_support |
265 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
266 | + * \param[in] archive The archive to write to. |
267 | + * \param[in] s The signed 16-bit integer to write to the archive. |
268 | + */ |
269 | +UStatus |
270 | +u_application_archive_write( |
271 | + UApplicationArchive *archive, |
272 | + int16_t s); |
273 | + |
274 | +/** |
275 | + * \brief Writes an unsigned 16-bit integer to the supplied archive |
276 | + * \ingroup application_support |
277 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
278 | + * \param[in] archive The archive to write to. |
279 | + * \param[in] s The unsigned 16-bit integer to write to the archive. |
280 | + */ |
281 | +UStatus |
282 | +u_application_archive_write( |
283 | + UApplicationArchive *archive, |
284 | + uint16_t s); |
285 | + |
286 | +/** |
287 | + * \brief Writes a signed 32-bit integer to the supplied archive |
288 | + * \ingroup application_support |
289 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
290 | + * \param[in] archive The archive to write to. |
291 | + * \param[in] s The signed 32-bit integer to write to the archive. |
292 | + */ |
293 | +UStatus |
294 | +u_application_archive_write( |
295 | + UApplicationArchive *archive, |
296 | + int32_t s); |
297 | + |
298 | +/** |
299 | + * \brief Writes an unsigned 32-bit integer to the supplied archive |
300 | + * \ingroup application_support |
301 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
302 | + * \param[in] archive The archive to write to. |
303 | + * \param[in] s The unsigned 32-bit integer to write to the archive. |
304 | + */ |
305 | +UStatus |
306 | +u_application_archive_write( |
307 | + UApplicationArchive *archive, |
308 | + uint32_t s); |
309 | + |
310 | +/** |
311 | + * \brief Writes a signed 64-bit integer to the supplied archive |
312 | + * \ingroup application_support |
313 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
314 | + * \param[in] archive The archive to write to. |
315 | + * \param[in] s The signed 64-bit integer to write to the archive. |
316 | + */ |
317 | +UStatus |
318 | +u_application_archive_write( |
319 | + UApplicationArchive *archive, |
320 | + int64_t s); |
321 | + |
322 | +/** |
323 | + * \brief Writes an unsigned 64-bit integer to the supplied archive |
324 | + * \ingroup application_support |
325 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
326 | + * \param[in] archive The archive to write to. |
327 | + * \param[in] s The unsigned 64-bit integer to write to the archive. |
328 | + */ |
329 | +UStatus |
330 | +u_application_archive_write( |
331 | + UApplicationArchive *archive, |
332 | + uint64_t s); |
333 | + |
334 | +/** |
335 | + * \brief Writes a string of characters to the supplied archive |
336 | + * \ingroup application_support |
337 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
338 | + * \param[in] archive The archive to write to. |
339 | + * \param[in] s The string to write. |
340 | + * \param[in] size The number of characters to write to the archive. |
341 | + */ |
342 | UStatus |
343 | u_application_archive_write_stringn( |
344 | - UApplicationArchive *archive, |
345 | - const char *s, |
346 | - size_t size); |
347 | + UApplicationArchive *archive, |
348 | + const char *s, |
349 | + size_t size); |
350 | |
351 | +/** |
352 | + * \brief Writes a string of wide characters to the supplied archive |
353 | + * \ingroup application_support |
354 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
355 | + * \param[in] archive The archive to write to. |
356 | + * \param[in] s The string to write. |
357 | + * \param[in] size The number of characters to write to the archive. |
358 | + */ |
359 | UStatus |
360 | u_application_archive_write_wstringn( |
361 | - UApplicationArchive *archive, |
362 | - const wchar_t *s, |
363 | - size_t size); |
364 | + UApplicationArchive *archive, |
365 | + const wchar_t *s, |
366 | + size_t size); |
367 | |
368 | +/** |
369 | + * \brief Writes a blob of binary data to the supplied archive |
370 | + * \ingroup application_support |
371 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
372 | + * \param[in] archive The archive to write to. |
373 | + * \param[in] data The binary blob to write. |
374 | + * \param[in] size The size of the blob. |
375 | + */ |
376 | UStatus |
377 | u_application_archive_write_bytes( |
378 | - UApplicationArchive *archive, |
379 | - const intptr_t *data, |
380 | - size_t size); |
381 | + UApplicationArchive *archive, |
382 | + const intptr_t *data, |
383 | + size_t size); |
384 | |
385 | UStatus |
386 | u_application_archive_write_begin_blockn( |
387 | - UApplicationArchive* archive, |
388 | - const char *name, |
389 | - size_t size); |
390 | + UApplicationArchive* archive, |
391 | + const char *name, |
392 | + size_t size); |
393 | |
394 | UStatus |
395 | u_application_archive_write_end_blockn( |
396 | - UApplicationArchive* archive, |
397 | - const char *name, |
398 | - size_t size); |
399 | - |
400 | -UStatus |
401 | -u_application_archive_read( |
402 | - const UApplicationArchive *archive, |
403 | - int8_t *c); |
404 | - |
405 | -UStatus |
406 | -u_application_archive_read( |
407 | - const UApplicationArchive *archive, |
408 | - uint8_t *c); |
409 | - |
410 | -UStatus |
411 | -u_application_archive_read( |
412 | - const UApplicationArchive *archive, |
413 | - int16_t *s); |
414 | - |
415 | -UStatus |
416 | -u_application_archive_read( |
417 | - const UApplicationArchive *archive, |
418 | - uint16_t *s); |
419 | - |
420 | -UStatus |
421 | -u_application_archive_read( |
422 | - const UApplicationArchive *archive, |
423 | - int32_t *s); |
424 | - |
425 | -UStatus |
426 | -u_application_archive_read( |
427 | - const UApplicationArchive *archive, |
428 | - uint32_t *s); |
429 | - |
430 | -UStatus |
431 | -u_application_archive_read( |
432 | - const UApplicationArchive *archive, |
433 | - int64_t *s); |
434 | - |
435 | -UStatus |
436 | -u_application_archive_read( |
437 | - const UApplicationArchive *archive, |
438 | - uint64_t *s); |
439 | - |
440 | + UApplicationArchive* archive, |
441 | + const char *name, |
442 | + size_t size); |
443 | + |
444 | +/** |
445 | + * \brief Reads a signed 8-bit integer from the supplied archive |
446 | + * \ingroup application_support |
447 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
448 | + * \param[in] archive The archive to read from. |
449 | + * \param[out] c Pointer to memory that receives the signed 8-bit integer. |
450 | + */ |
451 | +UStatus |
452 | +u_application_archive_read( |
453 | + const UApplicationArchive *archive, |
454 | + int8_t *c); |
455 | + |
456 | +/** |
457 | + * \brief Reads an unsigned 8-bit integer from the supplied archive |
458 | + * \ingroup application_support |
459 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
460 | + * \param[in] archive The archive to read from. |
461 | + * \param[out] c Pointer to memory that receives the unsigned 8-bit integer. |
462 | + */ |
463 | +UStatus |
464 | +u_application_archive_read( |
465 | + const UApplicationArchive *archive, |
466 | + uint8_t *c); |
467 | + |
468 | +/** |
469 | + * \brief Reads a signed 16-bit integer from the supplied archive |
470 | + * \ingroup application_support |
471 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
472 | + * \param[in] archive The archive to read from. |
473 | + * \param[out] s Pointer to memory that receives the signed 16-bit integer. |
474 | + */ |
475 | +UStatus |
476 | +u_application_archive_read( |
477 | + const UApplicationArchive *archive, |
478 | + int16_t *s); |
479 | + |
480 | +/** |
481 | + * \brief Reads an unsigned 16-bit integer from the supplied archive |
482 | + * \ingroup application_support |
483 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
484 | + * \param[in] archive The archive to read from. |
485 | + * \param[out] s Pointer to memory that receives the unsigned 16-bit integer. |
486 | + */ |
487 | +UStatus |
488 | +u_application_archive_read( |
489 | + const UApplicationArchive *archive, |
490 | + uint16_t *s); |
491 | + |
492 | +/** |
493 | + * \brief Reads a signed 32-bit integer from the supplied archive |
494 | + * \ingroup application_support |
495 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
496 | + * \param[in] archive The archive to read from. |
497 | + * \param[out] s Pointer to memory that receives the signed 32-bit integer. |
498 | + */ |
499 | +UStatus |
500 | +u_application_archive_read( |
501 | + const UApplicationArchive *archive, |
502 | + int32_t *s); |
503 | + |
504 | +/** |
505 | + * \brief Reads an unsigned 32-bit integer from the supplied archive |
506 | + * \ingroup application_support |
507 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
508 | + * \param[in] archive The archive to read from. |
509 | + * \param[out] s Pointer to memory that receives the unsigned 32-bit integer. |
510 | + */ |
511 | +UStatus |
512 | +u_application_archive_read( |
513 | + const UApplicationArchive *archive, |
514 | + uint32_t *s); |
515 | + |
516 | +/** |
517 | + * \brief Reads a signed 64-bit integer from the supplied archive |
518 | + * \ingroup application_support |
519 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
520 | + * \param[in] archive The archive to read from. |
521 | + * \param[out] s Pointer to memory that receives the signed 64-bit integer. |
522 | + */ |
523 | +UStatus |
524 | +u_application_archive_read( |
525 | + const UApplicationArchive *archive, |
526 | + int64_t *s); |
527 | + |
528 | +/** |
529 | + * \brief Reads an unsigned 64-bit integer from the supplied archive |
530 | + * \ingroup application_support |
531 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
532 | + * \param[in] archive The archive to read from. |
533 | + * \param[out] s Pointer to memory that receives the unsigned 64-bit integer. |
534 | + */ |
535 | +UStatus |
536 | +u_application_archive_read( |
537 | + const UApplicationArchive *archive, |
538 | + uint64_t *s); |
539 | + |
540 | +/** |
541 | + * \brief Reads a string of characters from the supplied archive |
542 | + * \ingroup application_support |
543 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
544 | + * \param[in] archive The archive to read from. |
545 | + * \param[out] s Pointer to memory that receives the string. |
546 | + * \param[out] size Pointer to memory that receives the size of the string. |
547 | + */ |
548 | UStatus |
549 | u_application_archive_read_stringn( |
550 | - const UApplicationArchive *archive, |
551 | - const char **s, |
552 | - size_t *size); |
553 | + const UApplicationArchive *archive, |
554 | + const char **s, |
555 | + size_t *size); |
556 | |
557 | +/** |
558 | + * \brief Reads a string of wide characters from the supplied archive |
559 | + * \ingroup application_support |
560 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
561 | + * \param[in] archive The archive to read from. |
562 | + * \param[out] s Pointer to memory that receives the wide string. |
563 | + * \param[out] size Pointer to memory that receives the size of the string. |
564 | + */ |
565 | UStatus |
566 | u_application_archive_read_wstringn( |
567 | - UApplicationArchive *archive, |
568 | - const wchar_t *s, |
569 | - size_t size); |
570 | + UApplicationArchive *archive, |
571 | + const wchar_t *s, |
572 | + size_t size); |
573 | |
574 | +/** |
575 | + * \brief Reads a blob of binary data from the supplied archive |
576 | + * \ingroup application_support |
577 | + * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures. |
578 | + * \param[in] archive The archive to read from. |
579 | + * \param[out] data Pointer to memory that receives the binary data. |
580 | + * \param[out] size Pointer to memory that receives the size of the blob. |
581 | + */ |
582 | UStatus |
583 | u_application_archive_read_bytes( |
584 | - UApplicationArchive *archive, |
585 | - const intptr_t *data, |
586 | - size_t size); |
587 | + UApplicationArchive *archive, |
588 | + const intptr_t *data, |
589 | + size_t size); |
590 | |
591 | #endif /* UBUNTU_APPLICATION_ARCHIVE_H_ */ |
592 | |
593 | === modified file 'include/ubuntu/application/description.h' |
594 | --- include/ubuntu/application/description.h 2013-05-27 22:14:00 +0000 |
595 | +++ include/ubuntu/application/description.h 2013-07-05 16:37:30 +0000 |
596 | @@ -14,7 +14,7 @@ |
597 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
598 | * |
599 | * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com> |
600 | - * Thomas Voß <thomas.voss@canonical.com> |
601 | + * Thomas Voß <thomas.voss@canonical.com> |
602 | */ |
603 | |
604 | #ifndef UBUNTU_APPLICATION_DESCRIPTION_H_ |
605 | @@ -27,33 +27,71 @@ |
606 | extern "C" { |
607 | #endif |
608 | |
609 | + /** |
610 | + * \brief Encapsulates properties of an application instance. |
611 | + * \ingroup application_support |
612 | + */ |
613 | typedef void UApplicationDescription; |
614 | - |
615 | + |
616 | + /** |
617 | + * \brief Creates a new instance of application description. |
618 | + * \ingroup application_support |
619 | + * \returns A new application description instance or NULL if not enough memory is available. |
620 | + */ |
621 | UApplicationDescription* |
622 | u_application_description_new(); |
623 | - |
624 | + |
625 | + /** |
626 | + * \brief Destroys an instance of application description and releases all resources. |
627 | + * \ingroup application_support |
628 | + * \param[in] desc The instance to be destroyed. |
629 | + */ |
630 | void |
631 | u_application_description_destroy( |
632 | - UApplicationDescription *desc); |
633 | - |
634 | + UApplicationDescription *desc); |
635 | + |
636 | + /** |
637 | + * \brief Sets the application id contained in the description instance. |
638 | + * \ingroup application_support |
639 | + * \param[in] desc The application description instance, must not be NULL. |
640 | + * \param[in] id The new application id, must not be NULL. |
641 | + */ |
642 | void |
643 | u_application_description_set_application_id( |
644 | - UApplicationDescription *desc, |
645 | - UApplicationId *id); |
646 | - |
647 | - UApplicationId* |
648 | + UApplicationDescription *desc, |
649 | + UApplicationId *id); |
650 | + |
651 | + /** |
652 | + * \brief Queries the application id contained in the description instance. |
653 | + * \ingroup application_support |
654 | + * \returns The app id contained in the instance. |
655 | + * \param[in] desc The application description instance, must not be NULL. |
656 | + */ |
657 | + UApplicationId* |
658 | u_application_description_get_application_id( |
659 | - UApplicationDescription *desc); |
660 | - |
661 | + UApplicationDescription *desc); |
662 | + |
663 | + /** |
664 | + * \brief Sets the application lifecycle delegate |
665 | + * \ingroup application_support |
666 | + * \param[in] desc The application description instance, must not be NULL. |
667 | + * \param[in] lifecycle_delegate The new lifecycle delegate, must not be NULL. |
668 | + */ |
669 | void |
670 | u_application_description_set_application_lifecycle_delegate( |
671 | - UApplicationDescription *desc, |
672 | - UApplicationLifecycleDelegate *lifecycle_delegate); |
673 | - |
674 | - UApplicationLifecycleDelegate* |
675 | + UApplicationDescription *desc, |
676 | + UApplicationLifecycleDelegate *lifecycle_delegate); |
677 | + |
678 | + /** |
679 | + * \brief Queries the application lifecycle delegate |
680 | + * \ingroup application_support |
681 | + * \returns The application lifecycle delegate contained in the description instance. |
682 | + * \param[in] desc The application description instance, must not be NULL. |
683 | + */ |
684 | + UApplicationLifecycleDelegate* |
685 | u_application_description_get_application_lifecycle_delegate( |
686 | - UApplicationDescription *desc); |
687 | - |
688 | + UApplicationDescription *desc); |
689 | + |
690 | #ifdef __cplusplus |
691 | } |
692 | #endif |
693 | |
694 | === modified file 'include/ubuntu/application/id.h' |
695 | --- include/ubuntu/application/id.h 2013-06-04 22:08:07 +0000 |
696 | +++ include/ubuntu/application/id.h 2013-07-05 16:37:30 +0000 |
697 | @@ -14,7 +14,7 @@ |
698 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
699 | * |
700 | * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com> |
701 | - * Thomas Voß <thomas.voss@canonical.com> |
702 | + * Thomas Voß <thomas.voss@canonical.com> |
703 | */ |
704 | |
705 | #ifndef UBUNTU_APPLICATION_ID_H_ |
706 | @@ -26,21 +26,43 @@ |
707 | extern "C" { |
708 | #endif |
709 | |
710 | + /** |
711 | + * \brief An opaque type describing an application ID. |
712 | + * \ingroup application_support |
713 | + */ |
714 | typedef void UApplicationId; |
715 | - |
716 | + |
717 | + /** |
718 | + * \brief Creates a new application ID from an existing string. |
719 | + * \ingroup application_support |
720 | + * \param[in] string The string containing the application ID. |
721 | + * \param[in] size The size of the string. |
722 | + */ |
723 | UApplicationId* |
724 | u_application_id_new_from_stringn( |
725 | - const char *string, |
726 | - size_t size); |
727 | - |
728 | + const char *string, |
729 | + size_t size); |
730 | + |
731 | + /** |
732 | + * \brief Destroy the supplied application ID instance. |
733 | + * \ingroup application_support |
734 | + * \param[in] id The instance to be destroyed. |
735 | + */ |
736 | void |
737 | u_application_id_destroy(UApplicationId *id); |
738 | - |
739 | + |
740 | + /** |
741 | + * \brief Compares two application ID instances. |
742 | + * \ingroup application_support |
743 | + * \returns -1 iff lhs < rhs, 0 iff lhs == rhs, 1 iff lhs > rhs. |
744 | + * \param[in] lhs The left-hand-side id to be compared. |
745 | + * \param[in] rhs The right-hand-side id to be compared. |
746 | + */ |
747 | int |
748 | u_application_id_compare( |
749 | - UApplicationId *lhs, |
750 | - UApplicationId *rhs); |
751 | - |
752 | + UApplicationId *lhs, |
753 | + UApplicationId *rhs); |
754 | + |
755 | #ifdef __cplusplus |
756 | } |
757 | #endif |
758 | |
759 | === modified file 'include/ubuntu/application/instance.h' |
760 | --- include/ubuntu/application/instance.h 2013-05-27 22:14:00 +0000 |
761 | +++ include/ubuntu/application/instance.h 2013-07-05 16:37:30 +0000 |
762 | @@ -14,7 +14,7 @@ |
763 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
764 | * |
765 | * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com> |
766 | - * Thomas Voß <thomas.voss@canonical.com> |
767 | + * Thomas Voß <thomas.voss@canonical.com> |
768 | */ |
769 | |
770 | #ifndef UBUNTU_APPLICATION_INSTANCE_H_ |
771 | @@ -27,31 +27,65 @@ |
772 | extern "C" { |
773 | #endif |
774 | |
775 | + /** \defgroup application_support Functions and types to support application development. */ |
776 | + |
777 | + /** |
778 | + * \brief Opaque type describing an application instance. |
779 | + * \ingroup application_support |
780 | + * An application instance encapsulates the event loop of an app. |
781 | + */ |
782 | typedef void UApplicationInstance; |
783 | - |
784 | + |
785 | + /** |
786 | + * \brief Creates a new application instance with a reference count of 1. |
787 | + * \ingroup application_support |
788 | + * \returns A new application instance or NULL in case of low-memory. |
789 | + * \param[in] desc A description object, must not be NULL. |
790 | + * \param[in] options An options object, must not be NULL. |
791 | + */ |
792 | UApplicationInstance* |
793 | u_application_instance_new_from_description_with_options( |
794 | - UApplicationDescription *desc, |
795 | - UApplicationOptions *options); |
796 | - |
797 | + UApplicationDescription *desc, |
798 | + UApplicationOptions *options); |
799 | + |
800 | + /** |
801 | + * \brief Increments the reference count of an application instance. |
802 | + * \ingroup application_support |
803 | + * \param[in] instance The instance to increment the reference count for. |
804 | + */ |
805 | void |
806 | u_application_instance_ref( |
807 | - UApplicationInstance *instance); |
808 | - |
809 | + UApplicationInstance *instance); |
810 | + |
811 | + /** |
812 | + * \brief Decrements the reference count of an application instance and releases all resources held by the object if the reference count reaches 0. |
813 | + * \ingroup application_support |
814 | + * \param[in] instance The instance to decrement the reference count for. |
815 | + */ |
816 | void |
817 | u_application_instance_unref( |
818 | - UApplicationInstance *instance); |
819 | - |
820 | + UApplicationInstance *instance); |
821 | + |
822 | + /** |
823 | + * \brief Destroys the application instance and releases all its resources. |
824 | + * \ingroup application_support |
825 | + * \param[in] instance The instance to be destroyed. |
826 | + */ |
827 | void |
828 | u_application_instance_destroy( |
829 | - UApplicationInstance *instance); |
830 | - |
831 | + UApplicationInstance *instance); |
832 | + |
833 | + /** |
834 | + * \brief Executes the event loop of the application instance |
835 | + * \ingroup application_support |
836 | + * \param[in] instance The instance to be executed. |
837 | + */ |
838 | void |
839 | u_application_instance_run( |
840 | - UApplicationInstance *instance); |
841 | + UApplicationInstance *instance); |
842 | |
843 | #ifdef __cplusplus |
844 | } |
845 | #endif |
846 | - |
847 | + |
848 | #endif /* UBUNTU_APPLICATION_INSTANCE_H_ */ |
849 | |
850 | === modified file 'include/ubuntu/application/lifecycle_delegate.h' |
851 | --- include/ubuntu/application/lifecycle_delegate.h 2013-05-27 21:49:05 +0000 |
852 | +++ include/ubuntu/application/lifecycle_delegate.h 2013-07-05 16:37:30 +0000 |
853 | @@ -14,7 +14,7 @@ |
854 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
855 | * |
856 | * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com> |
857 | - * Thomas Voß <thomas.voss@canonical.com> |
858 | + * Thomas Voß <thomas.voss@canonical.com> |
859 | */ |
860 | |
861 | #ifndef UBUNTU_APPLICATION_LIFECYCLE_DELEGATE_H_ |
862 | @@ -26,55 +26,127 @@ |
863 | #ifdef __cplusplus |
864 | extern "C" { |
865 | #endif |
866 | - |
867 | + |
868 | + /** |
869 | + * \brief Prototype for the callback that is invoked whenever the app has been resumed. |
870 | + * \ingroup application_support |
871 | + * \param[in] options Application instance options |
872 | + * \param[in] context The callback context as specified by the application |
873 | + */ |
874 | typedef void (*u_on_application_resumed)(const UApplicationOptions *options, void *context); |
875 | + /** |
876 | + * \brief Prototype for the callback that is invoked whenever the app is about to be stopped. |
877 | + * Applications can serialize their state to the supplied archive. |
878 | + * \ingroup application_support |
879 | + */ |
880 | typedef void (*u_on_application_about_to_stop)(UApplicationArchive *archive, void *context); |
881 | - |
882 | + |
883 | + /** |
884 | + * \brief Opaque type encapsulating all app-specific callback functions. |
885 | + * \ingroup application_support |
886 | + */ |
887 | typedef void UApplicationLifecycleDelegate; |
888 | - |
889 | + |
890 | + /** |
891 | + * \brief Creates a new instance of the lifecycle delegate with an initial refernce count of 1. |
892 | + * \ingroup application_support |
893 | + * \returns A new instance of the lifecycle delegate or NULL if no memory is available. |
894 | + */ |
895 | UApplicationLifecycleDelegate* |
896 | u_application_lifecycle_delegate_new(); |
897 | - |
898 | + |
899 | + /** |
900 | + * \brief Destroys an instance of the lifecycle delegate and releases all of its resources. |
901 | + * \ingroup application_support |
902 | + * \param[in] delegate The instance to be destroyed. |
903 | + */ |
904 | void |
905 | u_application_lifecycle_delegate_destroy( |
906 | UApplicationLifecycleDelegate *delegate); |
907 | - |
908 | + |
909 | + /** |
910 | + * \brief Increments the reference count of the supplied lifecycle delegate. |
911 | + * \ingroup application_support |
912 | + * \param[in] delegate The lifecycle delegate to increment the reference count for. |
913 | + */ |
914 | void |
915 | u_application_lifecycle_delegate_ref( |
916 | UApplicationLifecycleDelegate *delegate); |
917 | - |
918 | + |
919 | + /** |
920 | + * \brief Decrements the reference count of the supplied lifecycle delegate and destroys it if the count reaches 0. |
921 | + * \ingroup application_support |
922 | + * \param[in] delegate The lifecycle delegate to decrement the reference count for. |
923 | + */ |
924 | void |
925 | u_application_lifecycle_delegate_unref( |
926 | UApplicationLifecycleDelegate *delegate); |
927 | - |
928 | + |
929 | + /** |
930 | + * \brief Sets the resumed cb for the supplied delegate. |
931 | + * \ingroup application_support |
932 | + * \param[in] delegate The lifecycle delegate to adjust the cb for. |
933 | + * \param[in] cb The new callback to be invoked whenever the app resumes. |
934 | + */ |
935 | void |
936 | u_application_lifecycle_delegate_set_application_resumed_cb( |
937 | UApplicationLifecycleDelegate *delegate, |
938 | u_on_application_resumed cb); |
939 | - |
940 | + |
941 | + /** |
942 | + * \brief Queries the resumed cb from the supplied delegate. |
943 | + * \ingroup application_support |
944 | + * \returns The callback to be invoked whenever the app resumes. |
945 | + * \param[in] delegate The lifecycle delegate to query the callback from. |
946 | + */ |
947 | u_on_application_resumed |
948 | u_application_lifecycle_delegate_get_application_resumed_cb( |
949 | UApplicationLifecycleDelegate *delegate); |
950 | - |
951 | + |
952 | + /** |
953 | + * \brief Sets the about-to-stop cb for the supplied delegate. |
954 | + * \ingroup application_support |
955 | + * \param[in] delegate The lifecycle delegate to adjust the cb for. |
956 | + * \param[in] cb The new callback to be invoked whenever the app is about to be stopped.. |
957 | + */ |
958 | void |
959 | u_application_lifecycle_delegate_set_application_about_to_stop_cb( |
960 | UApplicationLifecycleDelegate *delegate, |
961 | u_on_application_about_to_stop cb); |
962 | - |
963 | + |
964 | + /** |
965 | + * \brief Queries the about-to-be-stopped cb from the supplied delegate. |
966 | + * \ingroup application_support |
967 | + * \returns The callback to be invoked whenever the app is about to be stopped. |
968 | + * \param[in] delegate The lifecycle delegate to query the callback from. |
969 | + */ |
970 | u_on_application_about_to_stop |
971 | u_application_lifecycle_delegate_get_application_about_to_stop_cb( |
972 | UApplicationLifecycleDelegate *delegate); |
973 | - |
974 | + |
975 | + /** |
976 | + * \brief Sets the cb context for the supplied delegate. |
977 | + * \ingroup application_support |
978 | + * \param[in] delegate The lifecycle delegate to adjust the context for. |
979 | + * \param[in] context The new cb context. |
980 | + */ |
981 | void |
982 | u_application_lifecycle_delegate_set_context( |
983 | UApplicationLifecycleDelegate *delegate, |
984 | void *context); |
985 | - |
986 | + |
987 | + /** |
988 | + * \brief Queries the cb context from the supplied delegate. |
989 | + * \ingroup application_support |
990 | + * \returns The context that is passed to callbacks of this delegate. |
991 | + * \param[in] delegate The lifecycle delegate to query the context from. |
992 | + * \param[in] context Unused. |
993 | + */ |
994 | void* |
995 | u_application_lifecycle_delegate_get_context( |
996 | UApplicationLifecycleDelegate *delegate, |
997 | void *context); |
998 | - |
999 | + |
1000 | #ifdef __cplusplus |
1001 | } |
1002 | #endif |
1003 | |
1004 | === modified file 'include/ubuntu/application/operation_mode.h' |
1005 | --- include/ubuntu/application/operation_mode.h 2013-05-27 21:49:05 +0000 |
1006 | +++ include/ubuntu/application/operation_mode.h 2013-07-05 16:37:30 +0000 |
1007 | @@ -14,16 +14,20 @@ |
1008 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1009 | * |
1010 | * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com> |
1011 | - * Thomas Voß <thomas.voss@canonical.com> |
1012 | + * Thomas Voß <thomas.voss@canonical.com> |
1013 | */ |
1014 | |
1015 | #ifndef UBUNTU_APPLICATION_OPERATION_MODE_H_ |
1016 | #define UBUNTU_APPLICATION_OPERATION_MODE_H_ |
1017 | |
1018 | +/** |
1019 | + * \brief Describes the different operational modes that an |
1020 | + * application can run in. |
1021 | + */ |
1022 | typedef enum |
1023 | { |
1024 | - U_APPLICATION_FOREGROUND_APP, |
1025 | - U_APPLICATION_BACKGROUND_SERVICE |
1026 | + U_APPLICATION_FOREGROUND_APP, |
1027 | + U_APPLICATION_BACKGROUND_SERVICE |
1028 | } UApplicationOperationMode; |
1029 | |
1030 | #endif /* UBUNTU_APPLICATION_OPERATION_MODE_H_ */ |
1031 | |
1032 | === modified file 'include/ubuntu/application/options.h' |
1033 | --- include/ubuntu/application/options.h 2013-05-27 22:14:00 +0000 |
1034 | +++ include/ubuntu/application/options.h 2013-07-05 16:37:30 +0000 |
1035 | @@ -14,7 +14,7 @@ |
1036 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1037 | * |
1038 | * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com> |
1039 | - * Thomas Voß <thomas.voss@canonical.com> |
1040 | + * Thomas Voß <thomas.voss@canonical.com> |
1041 | */ |
1042 | |
1043 | #ifndef UBUNTU_APPLICATION_OPTIONS_H_ |
1044 | @@ -26,21 +26,43 @@ |
1045 | extern "C" { |
1046 | #endif |
1047 | |
1048 | + /** |
1049 | + * \brief Encapsulates options as passed to the application. |
1050 | + * \ingroup application_support |
1051 | + */ |
1052 | typedef void UApplicationOptions; |
1053 | - |
1054 | + |
1055 | + /** |
1056 | + * \brief Parses options from the command line. |
1057 | + * \ingroup application_support |
1058 | + * \returns An options instance if parsing was successful, or 0 otheriwse. |
1059 | + * \param[in] argc Number of arguments. |
1060 | + * \param[in] argv Arguments. |
1061 | + */ |
1062 | UApplicationOptions* |
1063 | u_application_options_new_from_cmd_line( |
1064 | - int argc, |
1065 | - char** argv); |
1066 | - |
1067 | + int argc, |
1068 | + char** argv); |
1069 | + |
1070 | + /** |
1071 | + * \brief Destroys the options object and releases all resources. |
1072 | + * \ingroup application_support |
1073 | + * \param[in] options The object to be destroyed. |
1074 | + */ |
1075 | void |
1076 | u_application_options_destroy( |
1077 | - UApplicationOptions *options); |
1078 | - |
1079 | + UApplicationOptions *options); |
1080 | + |
1081 | + /** |
1082 | + * \brief Queries the operation mode from the supplied options object. |
1083 | + * \ingroup application_support |
1084 | + * \returns The operation mode as stored in the options object. |
1085 | + * \param[in] options The options object to be queried. |
1086 | + */ |
1087 | UApplicationOperationMode |
1088 | u_application_options_get_operation_mode( |
1089 | - UApplicationOptions *options); |
1090 | - |
1091 | + UApplicationOptions *options); |
1092 | + |
1093 | #ifdef __cplusplus |
1094 | } |
1095 | #endif |
1096 | |
1097 | === modified file 'include/ubuntu/application/sensors/accelerometer.h' |
1098 | --- include/ubuntu/application/sensors/accelerometer.h 2013-05-30 02:03:42 +0000 |
1099 | +++ include/ubuntu/application/sensors/accelerometer.h 2013-07-05 16:37:30 +0000 |
1100 | @@ -26,36 +26,94 @@ |
1101 | extern "C" { |
1102 | #endif |
1103 | |
1104 | + /** |
1105 | + * \brief Opaque type that models the accelerometer. |
1106 | + * \ingroup sensor_access |
1107 | + */ |
1108 | typedef void UASensorsAccelerometer; |
1109 | + |
1110 | + /** |
1111 | + * \brief Callback type used by applications to subscribe to accelerometer events. |
1112 | + * \ingroup sensor_access |
1113 | + */ |
1114 | typedef void (*on_accelerometer_event_cb)(UASAccelerometerEvent* event, |
1115 | void* context); |
1116 | |
1117 | + /** |
1118 | + * \brief Create a new object for accessing the accelerometer. |
1119 | + * \ingroup sensor_access |
1120 | + * \returns A new instance or NULL in case of errors. |
1121 | + */ |
1122 | UASensorsAccelerometer* |
1123 | - ua_sensors_accelerometer_new(); |
1124 | + ua_sensors_accelerometer_new(); |
1125 | |
1126 | + /** |
1127 | + * \brief Enables the supplied accelerometer. |
1128 | + * \ingroup sensor_access |
1129 | + * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured. |
1130 | + * \param[in] sensor The sensor instance to be enabled. |
1131 | + */ |
1132 | UStatus |
1133 | ua_sensors_accelerometer_enable( |
1134 | UASensorsAccelerometer* sensor); |
1135 | |
1136 | + /** |
1137 | + * \brief Disables the supplied accelerometer. |
1138 | + * \ingroup sensor_access |
1139 | + * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured. |
1140 | + * \param[in] sensor The sensor instance to be disabled. |
1141 | + */ |
1142 | UStatus |
1143 | ua_sensors_accelerometer_disable( |
1144 | UASensorsAccelerometer* sensor); |
1145 | |
1146 | + /** |
1147 | + * \brief Queries the minimum delay between two readings for the supplied sensor. |
1148 | + * \ingroup sensor_access |
1149 | + * \returns The minimum delay between two readings in [ms]. |
1150 | + * \param[in] sensor The sensor instance to be queried. |
1151 | + */ |
1152 | uint32_t |
1153 | ua_sensors_accelerometer_get_min_delay( |
1154 | UASensorsAccelerometer* sensor); |
1155 | - |
1156 | + |
1157 | + /** |
1158 | + * \brief Queries the minimum value that can be reported by the sensor. |
1159 | + * \ingroup sensor_access |
1160 | + * \returns The minimum value that can be reported by the sensor. |
1161 | + * \param[in] sensor The sensor instance to be queried. |
1162 | + */ |
1163 | float |
1164 | ua_sensors_accelerometer_get_min_value( |
1165 | UASensorsAccelerometer* sensor); |
1166 | - |
1167 | + |
1168 | + /** |
1169 | + * \brief Queries the maximum value that can be reported by the sensor. |
1170 | + * \ingroup sensor_access |
1171 | + * \returns The maximum value that can be reported by the sensor. |
1172 | + * \param[in] sensor The sensor instance to be queried. |
1173 | + */ |
1174 | float |
1175 | ua_sensors_accelerometer_get_max_value( |
1176 | UASensorsAccelerometer* sensor); |
1177 | - |
1178 | + |
1179 | + /** |
1180 | + * \brief Queries the numeric resolution supported by the sensor |
1181 | + * \ingroup sensor_access |
1182 | + * \returns The numeric resolution supported by the sensor. |
1183 | + * \param[in] sensor The sensor instance to be queried. |
1184 | + */ |
1185 | float |
1186 | ua_sensors_accelerometer_get_resolution( |
1187 | UASensorsAccelerometer* sensor); |
1188 | + |
1189 | + /** |
1190 | + * \brief Set the callback to be invoked whenever a new sensor reading is available. |
1191 | + * \ingroup sensor_access |
1192 | + * \param[in] sensor The sensor instance to associate the callback with. |
1193 | + * \param[in] cb The callback to be invoked. |
1194 | + * \param[in] ctx The context supplied to the callback invocation. |
1195 | + */ |
1196 | void |
1197 | ua_sensors_accelerometer_set_reading_cb( |
1198 | UASensorsAccelerometer* sensor, |
1199 | |
1200 | === modified file 'include/ubuntu/application/sensors/event/accelerometer.h' |
1201 | --- include/ubuntu/application/sensors/event/accelerometer.h 2013-05-30 02:03:42 +0000 |
1202 | +++ include/ubuntu/application/sensors/event/accelerometer.h 2013-07-05 16:37:30 +0000 |
1203 | @@ -25,20 +25,48 @@ |
1204 | extern "C" { |
1205 | #endif |
1206 | |
1207 | + /** |
1208 | + * \brief Opaque type describing an accelerometer reading. |
1209 | + * \ingroup sensor_access |
1210 | + */ |
1211 | typedef void UASAccelerometerEvent; |
1212 | |
1213 | + /** |
1214 | + * \brief Query the timestamp of the sensor reading. |
1215 | + * \ingroup sensor_access |
1216 | + * \returns The timestamp of the sensor reading in [µs], timebase: monotonic clock. |
1217 | + * \param[in] event The reading to be queried. |
1218 | + */ |
1219 | uint64_t |
1220 | uas_accelerometer_event_get_timestamp( |
1221 | UASAccelerometerEvent* event); |
1222 | - |
1223 | + |
1224 | + /** |
1225 | + * \brief Query the acceleration in x-axis direction. |
1226 | + * \ingroup sensor_access |
1227 | + * \returns The acceleration in x-axis direction. |
1228 | + * \param[in] event The reading to be queried. |
1229 | + */ |
1230 | float |
1231 | uas_accelerometer_event_get_acceleration_x( |
1232 | UASAccelerometerEvent* event); |
1233 | - |
1234 | + |
1235 | + /** |
1236 | + * \brief Query the acceleration in y-axis direction. |
1237 | + * \ingroup sensor_access |
1238 | + * \returns The acceleration in y-axis direction. |
1239 | + * \param[in] event The reading to be queried. |
1240 | + */ |
1241 | float |
1242 | uas_accelerometer_event_get_acceleration_y( |
1243 | UASAccelerometerEvent* event); |
1244 | - |
1245 | + |
1246 | + /** |
1247 | + * \brief Query the acceleration in z-axis direction. |
1248 | + * \ingroup sensor_access |
1249 | + * \returns The acceleration in z-axis direction. |
1250 | + * \param[in] event The reading to be queried. |
1251 | + */ |
1252 | float |
1253 | uas_accelerometer_event_get_acceleration_z( |
1254 | UASAccelerometerEvent* event); |
1255 | |
1256 | === modified file 'include/ubuntu/application/sensors/event/light.h' |
1257 | --- include/ubuntu/application/sensors/event/light.h 2013-05-30 02:03:42 +0000 |
1258 | +++ include/ubuntu/application/sensors/event/light.h 2013-07-05 16:37:30 +0000 |
1259 | @@ -25,12 +25,28 @@ |
1260 | extern "C" { |
1261 | #endif |
1262 | |
1263 | + /** |
1264 | + * \brief Opaque type describing an ambient light sensor reading. |
1265 | + * \ingroup sensor_access |
1266 | + */ |
1267 | typedef void UASLightEvent; |
1268 | |
1269 | + /** |
1270 | + * \brief Query the timestamp of the sensor reading. |
1271 | + * \ingroup sensor_access |
1272 | + * \returns The timestamp of the sensor reading in [µs], timebase: monotonic clock. |
1273 | + * \param[in] event The reading to be queried. |
1274 | + */ |
1275 | uint64_t |
1276 | uas_light_event_get_timestamp( |
1277 | UASLightEvent* event); |
1278 | - |
1279 | + |
1280 | + /** |
1281 | + * \brief Query the value measured by the ambient light sensor. |
1282 | + * \ingroup sensor_access |
1283 | + * \returns The ambient light level. |
1284 | + * \param[in] event The reading to be queried. |
1285 | + */ |
1286 | float |
1287 | uas_light_event_get_light( |
1288 | UASLightEvent* event); |
1289 | |
1290 | === modified file 'include/ubuntu/application/sensors/event/proximity.h' |
1291 | --- include/ubuntu/application/sensors/event/proximity.h 2013-05-30 02:03:42 +0000 |
1292 | +++ include/ubuntu/application/sensors/event/proximity.h 2013-07-05 16:37:30 +0000 |
1293 | @@ -25,17 +25,39 @@ |
1294 | extern "C" { |
1295 | #endif |
1296 | |
1297 | + /** |
1298 | + * \brief Useful constants when inspecting readings from the proximity sensor. |
1299 | + * \ingroup sensor_access |
1300 | + */ |
1301 | typedef enum { |
1302 | - U_PROXIMITY_NEAR = 1, |
1303 | - U_PROXIMITY_FAR = 2 |
1304 | - } UASProximityDistance; |
1305 | - |
1306 | + U_PROXIMITY_NEAR = 1, /**< The reading indicates that something is near the sensor/device. */ |
1307 | + U_PROXIMITY_FAR = 2 /**< The reading indicates that something is far away from the sensor/device. */ |
1308 | + } UbuntuApplicationSensorsProximityDistance; |
1309 | + |
1310 | + typedef UbuntuApplicationSensorsProximityDistance UASProximityDistance; |
1311 | + |
1312 | + /** |
1313 | + * \brief Opaque type describing an accelerometer reading. |
1314 | + * \ingroup sensor_access |
1315 | + */ |
1316 | typedef void UASProximityEvent; |
1317 | |
1318 | + /** |
1319 | + * \brief Query the timestamp of the sensor reading. |
1320 | + * \ingroup sensor_access |
1321 | + * \returns The timestamp of the sensor reading in [µs], timebase: monotonic clock. |
1322 | + * \param[in] event The reading to be queried. |
1323 | + */ |
1324 | uint64_t |
1325 | uas_proximity_event_get_timestamp( |
1326 | UASProximityEvent* event); |
1327 | - |
1328 | + |
1329 | + /** |
1330 | + * \brief Query the discrete distance as reported by the proximity sensor. |
1331 | + * \ingroup sensor_access |
1332 | + * \returns The discrete distance as reported by the proximity sensor. |
1333 | + * \param[in] event The reading to be queried. |
1334 | + */ |
1335 | UASProximityDistance |
1336 | uas_proximity_event_get_distance( |
1337 | UASProximityEvent* event); |
1338 | |
1339 | === modified file 'include/ubuntu/application/sensors/light.h' |
1340 | --- include/ubuntu/application/sensors/light.h 2013-07-05 16:37:30 +0000 |
1341 | +++ include/ubuntu/application/sensors/light.h 2013-07-05 16:37:30 +0000 |
1342 | @@ -26,36 +26,94 @@ |
1343 | extern "C" { |
1344 | #endif |
1345 | |
1346 | + /** |
1347 | + * \brief Opaque type that models the ambient light sensor. |
1348 | + * \ingroup sensor_access |
1349 | + */ |
1350 | typedef void UASensorsLight; |
1351 | + |
1352 | + /** |
1353 | + * \brief Callback type used by applications to subscribe to ambient light sensor events. |
1354 | + * \ingroup sensor_access |
1355 | + */ |
1356 | typedef void (*on_light_event_cb)(UASLightEvent* event, |
1357 | void* context); |
1358 | |
1359 | + /** |
1360 | + * \brief Create a new object for accessing the ambient light sensor. |
1361 | + * \ingroup sensor_access |
1362 | + * \returns A new instance or NULL in case of errors. |
1363 | + */ |
1364 | UASensorsLight* |
1365 | - ua_sensors_light_new(); |
1366 | + ua_sensors_light_new(); |
1367 | |
1368 | + /** |
1369 | + * \brief Enables the supplied ambient light sensor. |
1370 | + * \ingroup sensor_access |
1371 | + * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured. |
1372 | + * \param[in] sensor The sensor instance to be enabled. |
1373 | + */ |
1374 | UStatus |
1375 | ua_sensors_light_enable( |
1376 | UASensorsLight* sensor); |
1377 | |
1378 | + /** |
1379 | + * \brief Disables the supplied ambient light sensor. |
1380 | + * \ingroup sensor_access |
1381 | + * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured. |
1382 | + * \param[in] sensor The sensor instance to be disabled. |
1383 | + */ |
1384 | UStatus |
1385 | ua_sensors_light_disable( |
1386 | UASensorsLight* sensor); |
1387 | |
1388 | + /** |
1389 | + * \brief Queries the minimum delay between two readings for the supplied sensor. |
1390 | + * \ingroup sensor_access |
1391 | + * \returns The minimum delay between two readings in [ms]. |
1392 | + * \param[in] sensor The sensor instance to be queried. |
1393 | + */ |
1394 | uint32_t |
1395 | ua_sensors_light_get_min_delay( |
1396 | UASensorsLight* sensor); |
1397 | - |
1398 | + |
1399 | + /** |
1400 | + * \brief Queries the minimum value that can be reported by the sensor. |
1401 | + * \ingroup sensor_access |
1402 | + * \returns The minimum value that can be reported by the sensor. |
1403 | + * \param[in] sensor The sensor instance to be queried. |
1404 | + */ |
1405 | float |
1406 | ua_sensors_light_get_min_value( |
1407 | UASensorsLight* sensor); |
1408 | - |
1409 | + |
1410 | + /** |
1411 | + * \brief Queries the maximum value that can be reported by the sensor. |
1412 | + * \ingroup sensor_access |
1413 | + * \returns The maximum value that can be reported by the sensor. |
1414 | + * \param[in] sensor The sensor instance to be queried. |
1415 | + */ |
1416 | float |
1417 | ua_sensors_light_get_max_value( |
1418 | UASensorsLight* sensor); |
1419 | - |
1420 | + |
1421 | + /** |
1422 | + * \brief Queries the numeric resolution supported by the sensor |
1423 | + * \ingroup sensor_access |
1424 | + * \returns The numeric resolution supported by the sensor. |
1425 | + * \param[in] sensor The sensor instance to be queried. |
1426 | + */ |
1427 | float |
1428 | ua_sensors_light_get_resolution( |
1429 | UASensorsLight* sensor); |
1430 | + |
1431 | + /** |
1432 | + * \brief Set the callback to be invoked whenever a new sensor reading is available. |
1433 | + * \ingroup sensor_access |
1434 | + * \param[in] sensor The sensor instance to associate the callback with. |
1435 | + * \param[in] cb The callback to be invoked. |
1436 | + * \param[in] ctx The context supplied to the callback invocation. |
1437 | + */ |
1438 | void |
1439 | ua_sensors_light_set_reading_cb( |
1440 | UASensorsLight* sensor, |
1441 | |
1442 | === modified file 'include/ubuntu/application/sensors/proximity.h' |
1443 | --- include/ubuntu/application/sensors/proximity.h 2013-05-30 02:03:42 +0000 |
1444 | +++ include/ubuntu/application/sensors/proximity.h 2013-07-05 16:37:30 +0000 |
1445 | @@ -26,36 +26,94 @@ |
1446 | extern "C" { |
1447 | #endif |
1448 | |
1449 | + /** |
1450 | + * \brief Opaque type that models the proximity sensor. |
1451 | + * \ingroup sensor_access |
1452 | + */ |
1453 | typedef void UASensorsProximity; |
1454 | + |
1455 | + /** |
1456 | + * \brief Callback type used by applications to subscribe to proximity sensor events. |
1457 | + * \ingroup sensor_access |
1458 | + */ |
1459 | typedef void (*on_proximity_event_cb)(UASProximityEvent* event, |
1460 | void* context); |
1461 | |
1462 | + /** |
1463 | + * \brief Create a new object for accessing the proximity sensor. |
1464 | + * \ingroup sensor_access |
1465 | + * \returns A new instance or NULL in case of errors. |
1466 | + */ |
1467 | UASensorsProximity* |
1468 | - ua_sensors_proximity_new(); |
1469 | + ua_sensors_proximity_new(); |
1470 | |
1471 | + /** |
1472 | + * \brief Enables the supplied proximity sensor. |
1473 | + * \ingroup sensor_access |
1474 | + * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured. |
1475 | + * \param[in] sensor The sensor instance to be enabled. |
1476 | + */ |
1477 | UStatus |
1478 | ua_sensors_proximity_enable( |
1479 | UASensorsProximity* sensor); |
1480 | |
1481 | + /** |
1482 | + * \brief Disables the supplied proximity sensor. |
1483 | + * \ingroup sensor_access |
1484 | + * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured. |
1485 | + * \param[in] sensor The sensor instance to be disabled. |
1486 | + */ |
1487 | UStatus |
1488 | ua_sensors_proximity_disable( |
1489 | UASensorsProximity* sensor); |
1490 | |
1491 | + /** |
1492 | + * \brief Queries the minimum delay between two readings for the supplied sensor. |
1493 | + * \ingroup sensor_access |
1494 | + * \returns The minimum delay between two readings in [ms]. |
1495 | + * \param[in] sensor The sensor instance to be queried. |
1496 | + */ |
1497 | uint32_t |
1498 | ua_sensors_proximity_get_min_delay( |
1499 | UASensorsProximity* sensor); |
1500 | - |
1501 | + |
1502 | + /** |
1503 | + * \brief Queries the minimum value that can be reported by the sensor. |
1504 | + * \ingroup sensor_access |
1505 | + * \returns The minimum value that can be reported by the sensor. |
1506 | + * \param[in] sensor The sensor instance to be queried. |
1507 | + */ |
1508 | float |
1509 | ua_sensors_proximity_get_min_value( |
1510 | UASensorsProximity* sensor); |
1511 | - |
1512 | + |
1513 | + /** |
1514 | + * \brief Queries the maximum value that can be reported by the sensor. |
1515 | + * \ingroup sensor_access |
1516 | + * \returns The maximum value that can be reported by the sensor. |
1517 | + * \param[in] sensor The sensor instance to be queried. |
1518 | + */ |
1519 | float |
1520 | ua_sensors_proximity_get_max_value( |
1521 | UASensorsProximity* sensor); |
1522 | - |
1523 | + |
1524 | + /** |
1525 | + * \brief Queries the numeric resolution supported by the sensor |
1526 | + * \ingroup sensor_access |
1527 | + * \returns The numeric resolution supported by the sensor. |
1528 | + * \param[in] sensor The sensor instance to be queried. |
1529 | + */ |
1530 | float |
1531 | ua_sensors_proximity_get_resolution( |
1532 | UASensorsProximity* sensor); |
1533 | + |
1534 | + /** |
1535 | + * \brief Set the callback to be invoked whenever a new sensor reading is available. |
1536 | + * \ingroup sensor_access |
1537 | + * \param[in] sensor The sensor instance to associate the callback with. |
1538 | + * \param[in] cb The callback to be invoked. |
1539 | + * \param[in] ctx The context supplied to the callback invocation. |
1540 | + */ |
1541 | void |
1542 | ua_sensors_proximity_set_reading_cb( |
1543 | UASensorsProximity* sensor, |
1544 | |
1545 | === modified file 'include/ubuntu/status.h' |
1546 | --- include/ubuntu/status.h 2013-05-30 02:03:42 +0000 |
1547 | +++ include/ubuntu/status.h 2013-07-05 16:37:30 +0000 |
1548 | @@ -20,10 +20,15 @@ |
1549 | #ifndef UBUNTU_STATUS_H_ |
1550 | #define UBUNTU_STATUS_H_ |
1551 | |
1552 | +/** |
1553 | + * \brief Indicates the status of an operation. |
1554 | + */ |
1555 | typedef enum |
1556 | { |
1557 | - U_STATUS_SUCCESS, |
1558 | - U_STATUS_ERROR |
1559 | -} UStatus; |
1560 | + U_STATUS_SUCCESS, ///< Operation finished successfully. |
1561 | + U_STATUS_ERROR ///< Operation finished with an error. |
1562 | +} UbuntuStatus; |
1563 | + |
1564 | +typedef UbuntuStatus UStatus; |
1565 | |
1566 | #endif /* UBUNTU_STATUS_H_ */ |
1567 | |
1568 | === modified file 'include/ubuntu/unit.h' |
1569 | --- include/ubuntu/unit.h 2013-05-27 17:09:02 +0000 |
1570 | +++ include/ubuntu/unit.h 2013-07-05 16:37:30 +0000 |
1571 | @@ -20,13 +20,16 @@ |
1572 | #ifndef UBUNTU_UNIT_H_ |
1573 | #define UBUNTU_UNIT_H_ |
1574 | |
1575 | +/** |
1576 | + * \brief Describes units known to the platform integration layer. |
1577 | + */ |
1578 | typedef enum |
1579 | { |
1580 | - U_DEGREE, |
1581 | - U_METER, |
1582 | - U_SECOND, |
1583 | - U_METER_PER_SECOND, |
1584 | - U_MICRO_TESLA |
1585 | + U_DEGREE, |
1586 | + U_METER, |
1587 | + U_SECOND, |
1588 | + U_METER_PER_SECOND, |
1589 | + U_MICRO_TESLA |
1590 | } UbuntuUnit; |
1591 | |
1592 | typedef UbuntuUnit UUnit; |
PASSED: Continuous integration, rev:82 jenkins. qa.ubuntu. com/job/ platform- api-ci/ 66/ jenkins. qa.ubuntu. com/job/ platform- api-saucy- amd64-ci/ 36 jenkins. qa.ubuntu. com/job/ platform- api-saucy- armhf-ci/ 36 jenkins. qa.ubuntu. com/job/ platform- api-saucy- armhf-ci/ 36/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ platform- api-saucy- i386-ci/ 36
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ platform- api-ci/ 66/rebuild
http://