Merge lp:~thomas-voss/platform-api/add-documentation-part-1 into lp:platform-api

Proposed by Thomas Voß
Status: Superseded
Proposed branch: lp:~thomas-voss/platform-api/add-documentation-part-1
Merge into: lp:platform-api
Diff against target: 3480 lines (+1496/-741) (has conflicts)
36 files modified
CMakeLists.txt (+1/-1)
android/hybris/ubuntu_application_gps_for_hybris.cpp (+50/-50)
debian/changelog (+9/-0)
debian/libplatform-api1-dev.doc-base (+8/-0)
debian/libplatform-api1-dev.install (+1/-0)
debian/libplatform-api1-hybris.install (+2/-1)
debian/libplatform-api1-hybris.symbols (+19/-17)
doc/CMakeLists.txt (+1/-1)
doc/Doxyfile.in (+12/-12)
doc/mainpage.md (+1/-1)
include/ubuntu/application/CMakeLists.txt (+1/-2)
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 (+71/-13)
include/ubuntu/application/sensors/proximity.h (+62/-4)
include/ubuntu/hardware/gps.h (+226/-174)
include/ubuntu/status.h (+8/-3)
include/ubuntu/unit.h (+8/-5)
src/hybris/CMakeLists.txt (+26/-7)
src/hybris/bridge.h (+200/-0)
src/hybris/hybris_bridge.cpp (+0/-59)
src/hybris/hybris_bridge.h (+0/-148)
src/hybris/tests/CMakeLists.txt (+1/-1)
src/hybris/tests/test_gps_api.cpp (+35/-32)
src/hybris/ubuntu_application_api_hybris.cpp (+1/-23)
src/hybris/ubuntu_application_sensors_hybris.cpp (+1/-1)
src/hybris/ubuntu_platform_hardware_api.cpp (+78/-0)
Text conflict in debian/changelog
To merge this branch: bzr merge lp:~thomas-voss/platform-api/add-documentation-part-1
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+173159@code.launchpad.net

This proposal has been superseded by 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.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
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

84. By Thomas Voß

Addressing review comments.

85. By Thomas Voß

 Adjust Document:-line.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-07-03 07:23:59 +0000
3+++ CMakeLists.txt 2013-07-05 09:17:25 +0000
4@@ -80,7 +80,7 @@
5 )
6
7 if(NOT Hybris)
8- message("Notice: libhybris-common.so not found, disabling hybris support")
9+ message(STATUS "Notice: libhybris-common.so not found, disabling hybris support")
10 set(ENABLE_HYBRIS_IMPLEMENTATION OFF)
11 endif()
12
13
14=== modified file 'android/hybris/ubuntu_application_gps_for_hybris.cpp'
15--- android/hybris/ubuntu_application_gps_for_hybris.cpp 2013-02-05 07:46:29 +0000
16+++ android/hybris/ubuntu_application_gps_for_hybris.cpp 2013-07-05 09:17:25 +0000
17@@ -15,7 +15,7 @@
18 *
19 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
20 */
21-#include <ubuntu/application/ubuntu_application_gps.h>
22+#include <ubuntu/hardware/gps.h>
23
24 #include <pthread.h>
25
26@@ -23,12 +23,12 @@
27 #include <hardware/gps.h>
28 #include <hardware_legacy/power.h>
29
30-#define WAKE_LOCK_NAME "UBUNTU_GPS"
31+#define WAKE_LOCK_NAME "U_HARDWARE_GPS"
32
33-struct UbuntuGps_
34+struct UHardwareGps_
35 {
36- UbuntuGps_(UbuntuGpsParams* params);
37- ~UbuntuGps_();
38+ UHardwareGps_(UHardwareGpsParams* params);
39+ ~UHardwareGps_();
40
41 bool init();
42
43@@ -48,28 +48,28 @@
44 const GpsDebugInterface* gps_debug_interface;
45 const AGpsRilInterface* agps_ril_interface;
46
47- UbuntuGpsLocationCallback location_cb;
48- UbuntuGpsStatusCallback status_cb;
49- UbuntuGpsSvStatusCallback sv_status_cb;
50- UbuntuGpsNmeaCallback nmea_cb;
51- UbuntuGpsSetCapabilities set_capabilities_cb;
52- UbuntuGpsRequestUtcTime request_utc_time_cb;
53-
54- UbuntuGpsXtraDownloadRequest xtra_download_request_cb;
55-
56- UbuntuAgpsStatusCallback agps_status_cb;
57-
58- UbuntuGpsNiNotifyCallback gps_ni_notify_cb;
59-
60- UbuntuAgpsRilRequestSetId request_setid_cb;
61- UbuntuAgpsRilRequestRefLoc request_refloc_cb;
62+ UHardwareGpsLocationCallback location_cb;
63+ UHardwareGpsStatusCallback status_cb;
64+ UHardwareGpsSvStatusCallback sv_status_cb;
65+ UHardwareGpsNmeaCallback nmea_cb;
66+ UHardwareGpsSetCapabilities set_capabilities_cb;
67+ UHardwareGpsRequestUtcTime request_utc_time_cb;
68+
69+ UHardwareGpsXtraDownloadRequest xtra_download_request_cb;
70+
71+ UHardwareGpsAGpsStatusCallback agps_status_cb;
72+
73+ UHardwareGpsNiNotifyCallback gps_ni_notify_cb;
74+
75+ UHardwareGpsAGpsRilRequestSetId request_setid_cb;
76+ UHardwareGpsAGpsRilRequestRefLoc request_refloc_cb;
77
78 void* context;
79 };
80
81 namespace
82 {
83-UbuntuGps hybris_gps_instance = NULL;
84+UHardwareGps hybris_gps_instance = NULL;
85 }
86
87 static void location_callback(GpsLocation* location)
88@@ -78,7 +78,7 @@
89 return;
90
91 hybris_gps_instance->location_cb(
92- reinterpret_cast<UbuntuGpsLocation*>(location),
93+ reinterpret_cast<UHardwareGpsLocation*>(location),
94 hybris_gps_instance->context);
95 }
96
97@@ -96,7 +96,7 @@
98 return;
99
100 hybris_gps_instance->sv_status_cb(
101- reinterpret_cast<UbuntuGpsSvStatus*>(sv_status),
102+ reinterpret_cast<UHardwareGpsSvStatus*>(sv_status),
103 hybris_gps_instance->context);
104 }
105
106@@ -202,7 +202,7 @@
107 */
108
109 hybris_gps_instance->agps_status_cb(
110- reinterpret_cast<UbuntuAgpsStatus*>(agps_status), hybris_gps_instance->context);
111+ reinterpret_cast<UHardwareGpsAGpsStatus*>(agps_status), hybris_gps_instance->context);
112 }
113
114 AGpsCallbacks agps_callbacks =
115@@ -215,7 +215,7 @@
116 {
117 if (hybris_gps_instance)
118 hybris_gps_instance->gps_ni_notify_cb(
119- reinterpret_cast<UbuntuGpsNiNotification*>(notification),
120+ reinterpret_cast<UHardwareGpsNiNotification*>(notification),
121 hybris_gps_instance->context);
122 }
123
124@@ -245,7 +245,7 @@
125 };
126
127
128-UbuntuGps_::UbuntuGps_(UbuntuGpsParams* params)
129+UHardwareGps_::UHardwareGps_(UHardwareGpsParams* params)
130 : gps_interface(NULL),
131 gps_xtra_interface(NULL),
132 agps_interface(NULL),
133@@ -294,13 +294,13 @@
134 }
135 }
136
137-UbuntuGps_::~UbuntuGps_()
138+UHardwareGps_::~UHardwareGps_()
139 {
140 if (gps_interface)
141 gps_interface->cleanup();
142 }
143
144-bool UbuntuGps_::init()
145+bool UHardwareGps_::init()
146 {
147 // fail if the main interface fails to initialize
148 if (!gps_interface || gps_interface->init(&gps_callbacks) != 0)
149@@ -320,7 +320,7 @@
150 return true;
151 }
152
153-bool UbuntuGps_::start()
154+bool UHardwareGps_::start()
155 {
156 if (gps_interface)
157 return (gps_interface->start() == 0);
158@@ -328,7 +328,7 @@
159 return false;
160 }
161
162-bool UbuntuGps_::stop()
163+bool UHardwareGps_::stop()
164 {
165 if (gps_interface)
166 return (gps_interface->stop() == 0);
167@@ -336,25 +336,25 @@
168 return false;
169 }
170
171-void UbuntuGps_::inject_time(int64_t time, int64_t time_reference, int uncertainty)
172+void UHardwareGps_::inject_time(int64_t time, int64_t time_reference, int uncertainty)
173 {
174 if (gps_interface)
175 gps_interface->inject_time(time, time_reference, uncertainty);
176 }
177
178-void UbuntuGps_::inject_location(double latitude, double longitude, float accuracy)
179+void UHardwareGps_::inject_location(double latitude, double longitude, float accuracy)
180 {
181 if (gps_interface)
182 gps_interface->inject_location(latitude, longitude, accuracy);
183 }
184
185-void UbuntuGps_::delete_aiding_data(uint16_t flags)
186+void UHardwareGps_::delete_aiding_data(uint16_t flags)
187 {
188 if (gps_interface)
189 gps_interface->delete_aiding_data(flags);
190 }
191
192-bool UbuntuGps_::set_position_mode(uint32_t mode, uint32_t recurrence, uint32_t min_interval,
193+bool UHardwareGps_::set_position_mode(uint32_t mode, uint32_t recurrence, uint32_t min_interval,
194 uint32_t preferred_accuracy, uint32_t preferred_time)
195 {
196 if (gps_interface)
197@@ -364,7 +364,7 @@
198 return false;
199 }
200
201-void UbuntuGps_::inject_xtra_data(char* data, int length)
202+void UHardwareGps_::inject_xtra_data(char* data, int length)
203 {
204 if (gps_xtra_interface)
205 gps_xtra_interface->inject_xtra_data(data, length);
206@@ -373,58 +373,58 @@
207 /////////////////////////////////////////////////////////////////////
208 // Implementation of the C API
209
210-UbuntuGps ubuntu_gps_new(UbuntuGpsParams* params)
211+UHardwareGps u_hardware_gps_new(UHardwareGpsParams* params)
212 {
213 if (hybris_gps_instance != NULL)
214 return NULL;
215
216- UbuntuGps ubuntu_gps = new UbuntuGps_(params);
217- hybris_gps_instance = ubuntu_gps;
218+ UHardwareGps u_hardware_gps = new UHardwareGps_(params);
219+ hybris_gps_instance = u_hardware_gps;
220
221- if (!ubuntu_gps->init())
222+ if (!u_hardware_gps->init())
223 {
224- delete ubuntu_gps;
225- ubuntu_gps = NULL;
226+ delete u_hardware_gps;
227+ u_hardware_gps = NULL;
228 }
229
230- return ubuntu_gps;
231+ return u_hardware_gps;
232 }
233
234-void ubuntu_gps_delete(UbuntuGps handle)
235+void u_hardware_gps_delete(UHardwareGps handle)
236 {
237 delete handle;
238 if (handle == hybris_gps_instance)
239 hybris_gps_instance = NULL;
240 }
241
242-bool ubuntu_gps_start(UbuntuGps self)
243+bool u_hardware_gps_start(UHardwareGps self)
244 {
245 return self->start();
246 }
247
248-bool ubuntu_gps_stop(UbuntuGps self)
249+bool u_hardware_gps_stop(UHardwareGps self)
250 {
251 return self->stop();
252 }
253
254-void ubuntu_gps_inject_time(UbuntuGps self, int64_t time, int64_t time_reference,
255+void u_hardware_gps_inject_time(UHardwareGps self, int64_t time, int64_t time_reference,
256 int uncertainty)
257 {
258 self->inject_time(time, time_reference, uncertainty);
259 }
260
261-void ubuntu_gps_inject_location(UbuntuGps self, double latitude, double longitude,
262+void u_hardware_gps_inject_location(UHardwareGps self, double latitude, double longitude,
263 float accuracy)
264 {
265 self->inject_location(latitude, longitude, accuracy);
266 }
267
268-void ubuntu_gps_delete_aiding_data(UbuntuGps self, uint16_t flags)
269+void u_hardware_gps_delete_aiding_data(UHardwareGps self, uint16_t flags)
270 {
271 self->delete_aiding_data(flags);
272 }
273
274-bool ubuntu_gps_set_position_mode(UbuntuGps self, uint32_t mode, uint32_t recurrence,
275+bool u_hardware_gps_set_position_mode(UHardwareGps self, uint32_t mode, uint32_t recurrence,
276 uint32_t min_interval, uint32_t preferred_accuracy,
277 uint32_t preferred_time)
278 {
279@@ -432,7 +432,7 @@
280 preferred_time);
281 }
282
283-void ubuntu_gps_inject_xtra_data(UbuntuGps self, char* data, int length)
284+void u_hardware_gps_inject_xtra_data(UHardwareGps self, char* data, int length)
285 {
286 self->inject_xtra_data(data, length);
287 }
288
289=== modified file 'debian/changelog'
290--- debian/changelog 2013-07-05 02:01:11 +0000
291+++ debian/changelog 2013-07-05 09:17:25 +0000
292@@ -1,3 +1,4 @@
293+<<<<<<< TREE
294 platform-api (0.18.1+13.10.20130705-0ubuntu1) saucy; urgency=low
295
296 [ Thomas Voß ]
297@@ -13,6 +14,14 @@
298
299 -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 05 Jul 2013 02:01:10 +0000
300
301+=======
302+platform-api (0.18.1+13.10.20130703-0ubuntu2) UNRELEASED; urgency=low
303+
304+ * Split out hal to ease integration of location service.
305+
306+ -- Thomas Voß <tvoss@x220> Thu, 04 Jul 2013 19:09:22 +0200
307+
308+>>>>>>> MERGE-SOURCE
309 platform-api (0.18.1+13.10.20130703-0ubuntu1) saucy; urgency=low
310
311 [ Ricardo Mendoza ]
312
313=== added file 'debian/libplatform-api1-dev.doc-base'
314--- debian/libplatform-api1-dev.doc-base 1970-01-01 00:00:00 +0000
315+++ debian/libplatform-api1-dev.doc-base 2013-07-05 09:17:25 +0000
316@@ -0,0 +1,8 @@
317+Document: Ubuntu Platform API
318+Title: Ubuntu Platform API Reference Documentation
319+Author: Thomas Voß
320+Abstract: This is the reference documentation for the Ubuntu Platform API
321+Section: Debian
322+Format: HTML
323+Index: /usr/share/doc/ubuntu-platform-api/html/index.html
324+Files: /usr/share/doc/ubuntu-platform-api/html/*.html
325\ No newline at end of file
326
327=== modified file 'debian/libplatform-api1-dev.install'
328--- debian/libplatform-api1-dev.install 2013-06-13 12:04:14 +0000
329+++ debian/libplatform-api1-dev.install 2013-07-05 09:17:25 +0000
330@@ -1,2 +1,3 @@
331 usr/lib/*/libubuntu_application_api.so
332+usr/lib/*/libubuntu_platform_hardware_api.so
333 usr/lib/*/pkgconfig/ubuntu-platform-api.pc
334
335=== modified file 'debian/libplatform-api1-hybris.install'
336--- debian/libplatform-api1-hybris.install 2013-03-20 12:49:06 +0000
337+++ debian/libplatform-api1-hybris.install 2013-07-05 09:17:25 +0000
338@@ -1,1 +1,2 @@
339-usr/lib/*/libubuntu_application_api.so.*
340+usr/lib/*/libubuntu_application_api.so*
341+usr/lib/*/libubuntu_platform_hardware_api.so*
342\ No newline at end of file
343
344=== modified file 'debian/libplatform-api1-hybris.symbols'
345--- debian/libplatform-api1-hybris.symbols 2013-06-21 02:01:18 +0000
346+++ debian/libplatform-api1-hybris.symbols 2013-07-05 09:17:25 +0000
347@@ -1,12 +1,9 @@
348 libubuntu_application_api.so.1 libplatform-api1-hybris #MINVER#
349- (c++)"ua_sensors_light_disable(void*)@Base" 0.18.1daily13.06.21
350- (c++)"ubuntu::hybris::Bridge::path_to_library()@Base" 0.18.1daily13.06.21
351- (c++)"ubuntu::hybris::Bridge::instance()@Base" 0.18.1daily13.06.21
352- (c++)"ubuntu::hybris::Bridge::Bridge()@Base" 0.18.1daily13.06.21
353- (c++)"ubuntu::hybris::Bridge::Bridge()@Base" 0.18.1daily13.06.21
354- (c++)"ubuntu::hybris::Bridge::~Bridge()@Base" 0.18.1daily13.06.21
355- (c++)"ubuntu::hybris::Bridge::~Bridge()@Base" 0.18.1daily13.06.21
356- (c++)"ubuntu::hybris::Bridge::resolve_symbol(char const*) const@Base" 0.18.1daily13.06.21
357+ _Z24ua_sensors_light_disablePv@Base 0.18.1daily13.06.21
358+ _ZGVZN8internal6BridgeINS_13ToApplicationEE8instanceEvE6bridge@Base 0.18.1+13.10.20130703-0ubuntu2
359+ _ZN8internal6BridgeINS_13ToApplicationEED1Ev@Base 0.18.1+13.10.20130703-0ubuntu2
360+ _ZN8internal6BridgeINS_13ToApplicationEED2Ev@Base 0.18.1+13.10.20130703-0ubuntu2
361+ _ZZN8internal6BridgeINS_13ToApplicationEE8instanceEvE6bridge@Base 0.18.1+13.10.20130703-0ubuntu2
362 u_application_description_destroy@Base 0.18.1daily13.06.21
363 u_application_description_new@Base 0.18.1daily13.06.21
364 u_application_description_set_application_id@Base 0.18.1daily13.06.21
365@@ -81,15 +78,6 @@
366 uas_light_event_get_timestamp@Base 0.18.1daily13.06.21
367 uas_proximity_event_get_distance@Base 0.18.1daily13.06.21
368 uas_proximity_event_get_timestamp@Base 0.18.1daily13.06.21
369- ubuntu_gps_delete@Base 0.18.1daily13.06.21
370- ubuntu_gps_delete_aiding_data@Base 0.18.1daily13.06.21
371- ubuntu_gps_inject_location@Base 0.18.1daily13.06.21
372- ubuntu_gps_inject_time@Base 0.18.1daily13.06.21
373- ubuntu_gps_inject_xtra_data@Base 0.18.1daily13.06.21
374- ubuntu_gps_new@Base 0.18.1daily13.06.21
375- ubuntu_gps_set_position_mode@Base 0.18.1daily13.06.21
376- ubuntu_gps_start@Base 0.18.1daily13.06.21
377- ubuntu_gps_stop@Base 0.18.1daily13.06.21
378 ubuntu_ui_install_task_controller@Base 0.18.1daily13.06.21
379 ubuntu_ui_report_notification_invisible@Base 0.18.1daily13.06.21
380 ubuntu_ui_report_notification_visible@Base 0.18.1daily13.06.21
381@@ -105,3 +93,17 @@
382 ubuntu_ui_session_unfocus_running_sessions@Base 0.18.1daily13.06.21
383 ubuntu_ui_set_surface_trap@Base 0.18.1daily13.06.21
384 ubuntu_ui_unset_surface_trap@Base 0.18.1daily13.06.21
385+libubuntu_platform_hardware_api.so.1 libplatform-api1-hybris #MINVER#
386+ _ZGVZN8internal6BridgeINS_13ToApplicationEE8instanceEvE6bridge@Base 0.18.1+13.10.20130703-0ubuntu2
387+ _ZN8internal6BridgeINS_13ToApplicationEED1Ev@Base 0.18.1+13.10.20130703-0ubuntu2
388+ _ZN8internal6BridgeINS_13ToApplicationEED2Ev@Base 0.18.1+13.10.20130703-0ubuntu2
389+ _ZZN8internal6BridgeINS_13ToApplicationEE8instanceEvE6bridge@Base 0.18.1+13.10.20130703-0ubuntu2
390+ u_hardware_gps_delete@Base 0.18.1+13.10.20130703-0ubuntu2
391+ u_hardware_gps_delete_aiding_data@Base 0.18.1+13.10.20130703-0ubuntu2
392+ u_hardware_gps_inject_location@Base 0.18.1+13.10.20130703-0ubuntu2
393+ u_hardware_gps_inject_time@Base 0.18.1+13.10.20130703-0ubuntu2
394+ u_hardware_gps_inject_xtra_data@Base 0.18.1+13.10.20130703-0ubuntu2
395+ u_hardware_gps_new@Base 0.18.1+13.10.20130703-0ubuntu2
396+ u_hardware_gps_set_position_mode@Base 0.18.1+13.10.20130703-0ubuntu2
397+ u_hardware_gps_start@Base 0.18.1+13.10.20130703-0ubuntu2
398+ u_hardware_gps_stop@Base 0.18.1+13.10.20130703-0ubuntu2
399
400=== modified file 'doc/CMakeLists.txt'
401--- doc/CMakeLists.txt 2013-06-11 09:40:30 +0000
402+++ doc/CMakeLists.txt 2013-07-05 09:17:25 +0000
403@@ -26,5 +26,5 @@
404 COMMENT "Generating API documentation with Doxygen" VERBATIM)
405 install(
406 DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
407- DESTINATION share/ubuntu-platform-api/doc)
408+ DESTINATION share/doc/ubuntu-platform-api)
409 endif(DOXYGEN_FOUND)
410\ No newline at end of file
411
412=== modified file 'doc/Doxyfile.in'
413--- doc/Doxyfile.in 2013-06-11 09:40:30 +0000
414+++ doc/Doxyfile.in 2013-07-05 09:17:25 +0000
415@@ -26,7 +26,7 @@
416 # identify the project. Note that if you do not use Doxywizard you need
417 # to put quotes around the project name if it contains spaces.
418
419-PROJECT_NAME = @CMAKE_PROJECT_NAME@
420+PROJECT_NAME = "Ubuntu Platform API"
421
422 # The PROJECT_NUMBER tag can be used to enter a project or revision number.
423 # This could be handy for archiving the generated documentation or
424@@ -38,7 +38,7 @@
425 # for a project that appears at the top of each page and should give viewer
426 # a quick idea about the purpose of the project. Keep the description short.
427
428-PROJECT_BRIEF =
429+PROJECT_BRIEF = "A library helping with tight integration into the Ubuntu platform"
430
431 # With the PROJECT_LOGO tag one can specify an logo or icon that is
432 # included in the documentation. The maximum height of the logo should not
433@@ -209,7 +209,7 @@
434 # For instance, some of the names that are used will be different. The list
435 # of all members will be omitted, etc.
436
437-OPTIMIZE_OUTPUT_FOR_C = NO
438+OPTIMIZE_OUTPUT_FOR_C = YES
439
440 # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
441 # sources only. Doxygen will then generate output that is more tailored for
442@@ -365,7 +365,7 @@
443 # Private class members and static file members will be hidden unless
444 # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
445
446-EXTRACT_ALL = NO
447+EXTRACT_ALL = YES
448
449 # If the EXTRACT_PRIVATE tag is set to YES all private members of a class
450 # will be included in the documentation.
451@@ -668,7 +668,7 @@
452 # directories like "/usr/src/myproject". Separate the files or directories
453 # with spaces.
454
455-INPUT = @CMAKE_CURRENT_SOURCE_DIR@/../include
456+INPUT = @CMAKE_CURRENT_SOURCE_DIR@ @CMAKE_CURRENT_SOURCE_DIR@/../include
457
458 # This tag can be used to specify the character encoding of the source files
459 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
460@@ -728,7 +728,7 @@
461 # directories that contain example code fragments that are included (see
462 # the \include command).
463
464-EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/../examples
465+EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/../src
466
467 # If the value of the EXAMPLE_PATH tag contains directories, you can use the
468 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
469@@ -791,7 +791,7 @@
470 # This can be useful if you have a project on for instance GitHub and want reuse
471 # the introduction page also for the doxygen output.
472
473-USE_MDFILE_AS_MAINPAGE =
474+USE_MDFILE_AS_MAINPAGE = @CMAKE_CURRENT_SOURCE_DIR@/mainpage.md
475
476 #---------------------------------------------------------------------------
477 # configuration options related to source browsing
478@@ -807,7 +807,7 @@
479 # Setting the INLINE_SOURCES tag to YES will include the body
480 # of functions and classes directly in the documentation.
481
482-INLINE_SOURCES = YES
483+INLINE_SOURCES = NO
484
485 # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
486 # doxygen to hide any special comment blocks from generated source code
487@@ -975,7 +975,7 @@
488 # documentation will contain sections that can be hidden and shown after the
489 # page has loaded.
490
491-HTML_DYNAMIC_SECTIONS = NO
492+HTML_DYNAMIC_SECTIONS = YES
493
494 # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
495 # entries shown in the various tree structured indices initially; the user
496@@ -1145,7 +1145,7 @@
497 # navigation tree you can set this option to NO if you already set
498 # GENERATE_TREEVIEW to YES.
499
500-DISABLE_INDEX = NO
501+DISABLE_INDEX = YES
502
503 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
504 # structure should be generated to display hierarchical information.
505@@ -1157,7 +1157,7 @@
506 # Since the tree basically has the same information as the tab index you
507 # could consider to set DISABLE_INDEX to NO when enabling this option.
508
509-GENERATE_TREEVIEW = NO
510+GENERATE_TREEVIEW = YES
511
512 # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
513 # (range [0,1..20]) that doxygen will group on one line in the generated HTML
514@@ -1434,7 +1434,7 @@
515 # If the GENERATE_MAN tag is set to YES (the default) Doxygen will
516 # generate man pages
517
518-GENERATE_MAN = NO
519+GENERATE_MAN = YES
520
521 # The MAN_OUTPUT tag is used to specify where the man pages will be put.
522 # If a relative path is entered the value of OUTPUT_DIRECTORY will be
523
524=== modified file 'doc/mainpage.md'
525--- doc/mainpage.md 2013-02-14 16:25:13 +0000
526+++ doc/mainpage.md 2013-07-05 09:17:25 +0000
527@@ -1,4 +1,4 @@
528-Ubuntu Platform API {#mainpage}
529+Ubuntu Platform API {#mainpage}
530 ===================
531
532 The Ubuntu platform API Implements access to the Ubuntu platform and
533
534=== modified file 'include/ubuntu/application/CMakeLists.txt'
535--- include/ubuntu/application/CMakeLists.txt 2013-06-11 11:05:25 +0000
536+++ include/ubuntu/application/CMakeLists.txt 2013-07-05 09:17:25 +0000
537@@ -7,7 +7,6 @@
538 lifecycle_delegate.h
539 operation_mode.h
540 options.h
541- ubuntu_application_gps.h
542 )
543
544 install(
545@@ -16,4 +15,4 @@
546 )
547
548 add_subdirectory(sensors)
549-add_subdirectory(ui)
550\ No newline at end of file
551+add_subdirectory(ui)
552
553=== modified file 'include/ubuntu/application/archive.h'
554--- include/ubuntu/application/archive.h 2013-06-03 20:54:26 +0000
555+++ include/ubuntu/application/archive.h 2013-07-05 09:17:25 +0000
556@@ -14,7 +14,7 @@
557 * along with this program. If not, see <http://www.gnu.org/licenses/>.
558 *
559 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
560- * Thomas Voß <thomas.voss@canonical.com>
561+ * Thomas Voß <thomas.voss@canonical.com>
562 */
563
564 #ifndef UBUNTU_APPLICATION_ARCHIVE_H_
565@@ -26,139 +26,311 @@
566
567 struct UApplicationArchive;
568
569+/**
570+ * \brief Creates a new archive, ownership is transferred to caller.
571+ * \ingroup application_support
572+ * \sa u_application_archive_destroy
573+ * \returns A new archive instance or NULL if not enough memory is available.
574+ */
575 UApplicationArchive*
576 u_application_archive_new();
577
578+/**
579+ * \brief Destroys the given archive instance and releases all resources held by the instance.
580+ * \ingroup application_support
581+ * \param[in] archive The instance to be destroyed.
582+ * \post All resources held by the instance are released. The result of any operation invoked on the destroyed instance are undefined.
583+ */
584 void
585 u_application_archive_destroy(
586- UApplicationArchive *archive);
587-
588-UStatus
589-u_application_archive_write(
590- UApplicationArchive *archive,
591- int8_t c);
592-
593-UStatus
594-u_application_archive_write(
595- UApplicationArchive *archive,
596- uint8_t c);
597-
598-UStatus
599-u_application_archive_write(
600- UApplicationArchive *archive,
601- int16_t s);
602-
603-UStatus
604-u_application_archive_write(
605- UApplicationArchive *archive,
606- uint16_t s);
607-
608-UStatus
609-u_application_archive_write(
610- UApplicationArchive *archive,
611- int32_t s);
612-
613-UStatus
614-u_application_archive_write(
615- UApplicationArchive *archive,
616- uint32_t s);
617-
618-UStatus
619-u_application_archive_write(
620- UApplicationArchive *archive,
621- int64_t s);
622-
623-UStatus
624-u_application_archive_write(
625- UApplicationArchive *archive,
626- uint64_t s);
627-
628+ UApplicationArchive *archive);
629+
630+/**
631+ * \brief Writes a signed 8-bit integer to the supplied archive
632+ * \ingroup application_support
633+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
634+ * \param[in] archive The archive to write to.
635+ * \param[in] c The signed 8-bit integer to write to the archive.
636+ */
637+UStatus
638+u_application_archive_write(
639+ UApplicationArchive *archive,
640+ int8_t c);
641+
642+/**
643+ * \brief Writes an unsigned 8-bit integer to the supplied archive
644+ * \ingroup application_support
645+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
646+ * \param[in] archive The archive to write to.
647+ * \param[in] c The unsigned 8-bit integer to write to the archive.
648+ */
649+UStatus
650+u_application_archive_write(
651+ UApplicationArchive *archive,
652+ uint8_t c);
653+
654+/**
655+ * \brief Writes a signed 16-bit integer to the supplied archive
656+ * \ingroup application_support
657+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
658+ * \param[in] archive The archive to write to.
659+ * \param[in] s The signed 16-bit integer to write to the archive.
660+ */
661+UStatus
662+u_application_archive_write(
663+ UApplicationArchive *archive,
664+ int16_t s);
665+
666+/**
667+ * \brief Writes an unsigned 16-bit integer to the supplied archive
668+ * \ingroup application_support
669+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
670+ * \param[in] archive The archive to write to.
671+ * \param[in] s The unsigned 16-bit integer to write to the archive.
672+ */
673+UStatus
674+u_application_archive_write(
675+ UApplicationArchive *archive,
676+ uint16_t s);
677+
678+/**
679+ * \brief Writes a signed 32-bit integer to the supplied archive
680+ * \ingroup application_support
681+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
682+ * \param[in] archive The archive to write to.
683+ * \param[in] s The signed 32-bit integer to write to the archive.
684+ */
685+UStatus
686+u_application_archive_write(
687+ UApplicationArchive *archive,
688+ int32_t s);
689+
690+/**
691+ * \brief Writes an unsigned 32-bit integer to the supplied archive
692+ * \ingroup application_support
693+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
694+ * \param[in] archive The archive to write to.
695+ * \param[in] s The unsigned 32-bit integer to write to the archive.
696+ */
697+UStatus
698+u_application_archive_write(
699+ UApplicationArchive *archive,
700+ uint32_t s);
701+
702+/**
703+ * \brief Writes a signed 64-bit integer to the supplied archive
704+ * \ingroup application_support
705+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
706+ * \param[in] archive The archive to write to.
707+ * \param[in] s The signed 64-bit integer to write to the archive.
708+ */
709+UStatus
710+u_application_archive_write(
711+ UApplicationArchive *archive,
712+ int64_t s);
713+
714+/**
715+ * \brief Writes an unsigned 64-bit integer to the supplied archive
716+ * \ingroup application_support
717+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
718+ * \param[in] archive The archive to write to.
719+ * \param[in] s The unsigned 64-bit integer to write to the archive.
720+ */
721+UStatus
722+u_application_archive_write(
723+ UApplicationArchive *archive,
724+ uint64_t s);
725+
726+/**
727+ * \brief Writes a string of characters to the supplied archive
728+ * \ingroup application_support
729+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
730+ * \param[in] archive The archive to write to.
731+ * \param[in] s The string to write.
732+ * \param[in] size The number of characters to write to the archive.
733+ */
734 UStatus
735 u_application_archive_write_stringn(
736- UApplicationArchive *archive,
737- const char *s,
738- size_t size);
739+ UApplicationArchive *archive,
740+ const char *s,
741+ size_t size);
742
743+/**
744+ * \brief Writes a string of wide characters to the supplied archive
745+ * \ingroup application_support
746+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
747+ * \param[in] archive The archive to write to.
748+ * \param[in] s The string to write.
749+ * \param[in] size The number of characters to write to the archive.
750+ */
751 UStatus
752 u_application_archive_write_wstringn(
753- UApplicationArchive *archive,
754- const wchar_t *s,
755- size_t size);
756+ UApplicationArchive *archive,
757+ const wchar_t *s,
758+ size_t size);
759
760+/**
761+ * \brief Writes a blob of binary data to the supplied archive
762+ * \ingroup application_support
763+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
764+ * \param[in] archive The archive to write to.
765+ * \param[in] data The binary blob to write.
766+ * \param[in] size The size of the blob.
767+ */
768 UStatus
769 u_application_archive_write_bytes(
770- UApplicationArchive *archive,
771- const intptr_t *data,
772- size_t size);
773+ UApplicationArchive *archive,
774+ const intptr_t *data,
775+ size_t size);
776
777 UStatus
778 u_application_archive_write_begin_blockn(
779- UApplicationArchive* archive,
780- const char *name,
781- size_t size);
782+ UApplicationArchive* archive,
783+ const char *name,
784+ size_t size);
785
786 UStatus
787 u_application_archive_write_end_blockn(
788- UApplicationArchive* archive,
789- const char *name,
790- size_t size);
791-
792-UStatus
793-u_application_archive_read(
794- const UApplicationArchive *archive,
795- int8_t *c);
796-
797-UStatus
798-u_application_archive_read(
799- const UApplicationArchive *archive,
800- uint8_t *c);
801-
802-UStatus
803-u_application_archive_read(
804- const UApplicationArchive *archive,
805- int16_t *s);
806-
807-UStatus
808-u_application_archive_read(
809- const UApplicationArchive *archive,
810- uint16_t *s);
811-
812-UStatus
813-u_application_archive_read(
814- const UApplicationArchive *archive,
815- int32_t *s);
816-
817-UStatus
818-u_application_archive_read(
819- const UApplicationArchive *archive,
820- uint32_t *s);
821-
822-UStatus
823-u_application_archive_read(
824- const UApplicationArchive *archive,
825- int64_t *s);
826-
827-UStatus
828-u_application_archive_read(
829- const UApplicationArchive *archive,
830- uint64_t *s);
831-
832+ UApplicationArchive* archive,
833+ const char *name,
834+ size_t size);
835+
836+/**
837+ * \brief Reads a signed 8-bit integer from the supplied archive
838+ * \ingroup application_support
839+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
840+ * \param[in] archive The archive to read from.
841+ * \param[out] c Pointer to memory that receives the signed 8-bit integer.
842+ */
843+UStatus
844+u_application_archive_read(
845+ const UApplicationArchive *archive,
846+ int8_t *c);
847+
848+/**
849+ * \brief Reads an unsigned 8-bit integer from the supplied archive
850+ * \ingroup application_support
851+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
852+ * \param[in] archive The archive to read from.
853+ * \param[out] c Pointer to memory that receives the unsigned 8-bit integer.
854+ */
855+UStatus
856+u_application_archive_read(
857+ const UApplicationArchive *archive,
858+ uint8_t *c);
859+
860+/**
861+ * \brief Reads a signed 16-bit integer from the supplied archive
862+ * \ingroup application_support
863+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
864+ * \param[in] archive The archive to read from.
865+ * \param[out] s Pointer to memory that receives the signed 16-bit integer.
866+ */
867+UStatus
868+u_application_archive_read(
869+ const UApplicationArchive *archive,
870+ int16_t *s);
871+
872+/**
873+ * \brief Reads an unsigned 16-bit integer from the supplied archive
874+ * \ingroup application_support
875+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
876+ * \param[in] archive The archive to read from.
877+ * \param[out] s Pointer to memory that receives the unsigned 16-bit integer.
878+ */
879+UStatus
880+u_application_archive_read(
881+ const UApplicationArchive *archive,
882+ uint16_t *s);
883+
884+/**
885+ * \brief Reads a signed 32-bit integer from the supplied archive
886+ * \ingroup application_support
887+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
888+ * \param[in] archive The archive to read from.
889+ * \param[out] s Pointer to memory that receives the signed 32-bit integer.
890+ */
891+UStatus
892+u_application_archive_read(
893+ const UApplicationArchive *archive,
894+ int32_t *s);
895+
896+/**
897+ * \brief Reads an unsigned 32-bit integer from the supplied archive
898+ * \ingroup application_support
899+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
900+ * \param[in] archive The archive to read from.
901+ * \param[out] s Pointer to memory that receives the unsigned 32-bit integer.
902+ */
903+UStatus
904+u_application_archive_read(
905+ const UApplicationArchive *archive,
906+ uint32_t *s);
907+
908+/**
909+ * \brief Reads a signed 64-bit integer from the supplied archive
910+ * \ingroup application_support
911+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
912+ * \param[in] archive The archive to read from.
913+ * \param[out] s Pointer to memory that receives the signed 64-bit integer.
914+ */
915+UStatus
916+u_application_archive_read(
917+ const UApplicationArchive *archive,
918+ int64_t *s);
919+
920+/**
921+ * \brief Reads an unsigned 64-bit integer from the supplied archive
922+ * \ingroup application_support
923+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
924+ * \param[in] archive The archive to read from.
925+ * \param[out] s Pointer to memory that receives the unsigned 64-bit integer.
926+ */
927+UStatus
928+u_application_archive_read(
929+ const UApplicationArchive *archive,
930+ uint64_t *s);
931+
932+/**
933+ * \brief Reads a string of characters from the supplied archive
934+ * \ingroup application_support
935+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
936+ * \param[in] archive The archive to read from.
937+ * \param[out] s Pointer to memory that receives the string.
938+ * \param[out] size Pointer to memory that receives the size of the string.
939+ */
940 UStatus
941 u_application_archive_read_stringn(
942- const UApplicationArchive *archive,
943- const char **s,
944- size_t *size);
945+ const UApplicationArchive *archive,
946+ const char **s,
947+ size_t *size);
948
949+/**
950+ * \brief Reads a string of wide characters from the supplied archive
951+ * \ingroup application_support
952+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
953+ * \param[in] archive The archive to read from.
954+ * \param[out] s Pointer to memory that receives the wide string.
955+ * \param[out] size Pointer to memory that receives the size of the string.
956+ */
957 UStatus
958 u_application_archive_read_wstringn(
959- UApplicationArchive *archive,
960- const wchar_t *s,
961- size_t size);
962+ UApplicationArchive *archive,
963+ const wchar_t *s,
964+ size_t size);
965
966+/**
967+ * \brief Reads a blob of binary data from the supplied archive
968+ * \ingroup application_support
969+ * \returns U_STATUS_SUCCESS if successful, and U_STATUS_ERROR in case of failures.
970+ * \param[in] archive The archive to read from.
971+ * \param[out] data Pointer to memory that receives the binary data.
972+ * \param[out] size Pointer to memory that receives the size of the blob.
973+ */
974 UStatus
975 u_application_archive_read_bytes(
976- UApplicationArchive *archive,
977- const intptr_t *data,
978- size_t size);
979+ UApplicationArchive *archive,
980+ const intptr_t *data,
981+ size_t size);
982
983 #endif /* UBUNTU_APPLICATION_ARCHIVE_H_ */
984
985=== modified file 'include/ubuntu/application/description.h'
986--- include/ubuntu/application/description.h 2013-05-27 22:14:00 +0000
987+++ include/ubuntu/application/description.h 2013-07-05 09:17:25 +0000
988@@ -14,7 +14,7 @@
989 * along with this program. If not, see <http://www.gnu.org/licenses/>.
990 *
991 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
992- * Thomas Voß <thomas.voss@canonical.com>
993+ * Thomas Voß <thomas.voss@canonical.com>
994 */
995
996 #ifndef UBUNTU_APPLICATION_DESCRIPTION_H_
997@@ -27,33 +27,71 @@
998 extern "C" {
999 #endif
1000
1001+ /**
1002+ * \brief Encapsulates properties of an application instance.
1003+ * \ingroup application_support
1004+ */
1005 typedef void UApplicationDescription;
1006-
1007+
1008+ /**
1009+ * \brief Creates a new instance of application description.
1010+ * \ingroup application_support
1011+ * \returns A new application description instance or NULL if not enough memory is available.
1012+ */
1013 UApplicationDescription*
1014 u_application_description_new();
1015-
1016+
1017+ /**
1018+ * \brief Destroys an instance of application description and releases all resources.
1019+ * \ingroup application_support
1020+ * \param[in] desc The instance to be destroyed.
1021+ */
1022 void
1023 u_application_description_destroy(
1024- UApplicationDescription *desc);
1025-
1026+ UApplicationDescription *desc);
1027+
1028+ /**
1029+ * \brief Sets the application id contained in the description instance.
1030+ * \ingroup application_support
1031+ * \param[in] desc The application description instance, must not be NULL.
1032+ * \param[in] id The new application id, must not be NULL.
1033+ */
1034 void
1035 u_application_description_set_application_id(
1036- UApplicationDescription *desc,
1037- UApplicationId *id);
1038-
1039- UApplicationId*
1040+ UApplicationDescription *desc,
1041+ UApplicationId *id);
1042+
1043+ /**
1044+ * \brief Queries the application id contained in the description instance.
1045+ * \ingroup application_support
1046+ * \returns The app id contained in the instance.
1047+ * \param[in] desc The application description instance, must not be NULL.
1048+ */
1049+ UApplicationId*
1050 u_application_description_get_application_id(
1051- UApplicationDescription *desc);
1052-
1053+ UApplicationDescription *desc);
1054+
1055+ /**
1056+ * \brief Sets the application lifecycle delegate
1057+ * \ingroup application_support
1058+ * \param[in] desc The application description instance, must not be NULL.
1059+ * \param[in] lifecycle_delegate The new lifecycle delegate, must not be NULL.
1060+ */
1061 void
1062 u_application_description_set_application_lifecycle_delegate(
1063- UApplicationDescription *desc,
1064- UApplicationLifecycleDelegate *lifecycle_delegate);
1065-
1066- UApplicationLifecycleDelegate*
1067+ UApplicationDescription *desc,
1068+ UApplicationLifecycleDelegate *lifecycle_delegate);
1069+
1070+ /**
1071+ * \brief Queries the application lifecycle delegate
1072+ * \ingroup application_support
1073+ * \returns The application lifecycle delegate contained in the description instance.
1074+ * \param[in] desc The application description instance, must not be NULL.
1075+ */
1076+ UApplicationLifecycleDelegate*
1077 u_application_description_get_application_lifecycle_delegate(
1078- UApplicationDescription *desc);
1079-
1080+ UApplicationDescription *desc);
1081+
1082 #ifdef __cplusplus
1083 }
1084 #endif
1085
1086=== modified file 'include/ubuntu/application/id.h'
1087--- include/ubuntu/application/id.h 2013-06-04 22:08:07 +0000
1088+++ include/ubuntu/application/id.h 2013-07-05 09:17:25 +0000
1089@@ -14,7 +14,7 @@
1090 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1091 *
1092 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
1093- * Thomas Voß <thomas.voss@canonical.com>
1094+ * Thomas Voß <thomas.voss@canonical.com>
1095 */
1096
1097 #ifndef UBUNTU_APPLICATION_ID_H_
1098@@ -26,21 +26,43 @@
1099 extern "C" {
1100 #endif
1101
1102+ /**
1103+ * \brief An opaque type describing an application ID.
1104+ * \ingroup application_support
1105+ */
1106 typedef void UApplicationId;
1107-
1108+
1109+ /**
1110+ * \brief Creates a new application ID from an existing string.
1111+ * \ingroup application_support
1112+ * \param[in] string The string containing the application ID.
1113+ * \param[in] size The size of the string.
1114+ */
1115 UApplicationId*
1116 u_application_id_new_from_stringn(
1117- const char *string,
1118- size_t size);
1119-
1120+ const char *string,
1121+ size_t size);
1122+
1123+ /**
1124+ * \brief Destroy the supplied application ID instance.
1125+ * \ingroup application_support
1126+ * \param[in] id The instance to be destroyed.
1127+ */
1128 void
1129 u_application_id_destroy(UApplicationId *id);
1130-
1131+
1132+ /**
1133+ * \brief Compares two application ID instances.
1134+ * \ingroup application_support
1135+ * \returns -1 iff lhs < rhs, 0 iff lhs == rhs, 1 iff lhs > rhs.
1136+ * \param[in] lhs The left-hand-side id to be compared.
1137+ * \param[in] rhs The right-hand-side id to be compared.
1138+ */
1139 int
1140 u_application_id_compare(
1141- UApplicationId *lhs,
1142- UApplicationId *rhs);
1143-
1144+ UApplicationId *lhs,
1145+ UApplicationId *rhs);
1146+
1147 #ifdef __cplusplus
1148 }
1149 #endif
1150
1151=== modified file 'include/ubuntu/application/instance.h'
1152--- include/ubuntu/application/instance.h 2013-05-27 22:14:00 +0000
1153+++ include/ubuntu/application/instance.h 2013-07-05 09:17:25 +0000
1154@@ -14,7 +14,7 @@
1155 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1156 *
1157 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
1158- * Thomas Voß <thomas.voss@canonical.com>
1159+ * Thomas Voß <thomas.voss@canonical.com>
1160 */
1161
1162 #ifndef UBUNTU_APPLICATION_INSTANCE_H_
1163@@ -27,31 +27,65 @@
1164 extern "C" {
1165 #endif
1166
1167+ /** \defgroup application_support Functions and types to support application development. */
1168+
1169+ /**
1170+ * \brief Opaque type describing an application instance.
1171+ * \ingroup application_support
1172+ * An application instance encapsulates the event loop of an app.
1173+ */
1174 typedef void UApplicationInstance;
1175-
1176+
1177+ /**
1178+ * \brief Creates a new application instance with a reference count of 1.
1179+ * \ingroup application_support
1180+ * \returns A new application instance or NULL in case of low-memory.
1181+ * \param[in] desc A description object, must not be NULL.
1182+ * \param[in] options An options object, must not be NULL.
1183+ */
1184 UApplicationInstance*
1185 u_application_instance_new_from_description_with_options(
1186- UApplicationDescription *desc,
1187- UApplicationOptions *options);
1188-
1189+ UApplicationDescription *desc,
1190+ UApplicationOptions *options);
1191+
1192+ /**
1193+ * \brief Increments the reference count of an application instance.
1194+ * \ingroup application_support
1195+ * \param[in] instance The instance to increment the reference count for.
1196+ */
1197 void
1198 u_application_instance_ref(
1199- UApplicationInstance *instance);
1200-
1201+ UApplicationInstance *instance);
1202+
1203+ /**
1204+ * \brief Decrements the reference count of an application instance and releases all resources held by the object if the reference count reaches 0.
1205+ * \ingroup application_support
1206+ * \param[in] instance The instance to decrement the reference count for.
1207+ */
1208 void
1209 u_application_instance_unref(
1210- UApplicationInstance *instance);
1211-
1212+ UApplicationInstance *instance);
1213+
1214+ /**
1215+ * \brief Destroys the application instance and releases all its resources.
1216+ * \ingroup application_support
1217+ * \param[in] instance The instance to be destroyed.
1218+ */
1219 void
1220 u_application_instance_destroy(
1221- UApplicationInstance *instance);
1222-
1223+ UApplicationInstance *instance);
1224+
1225+ /**
1226+ * \brief Executes the event loop of the application instance
1227+ * \ingroup application_support
1228+ * \param[in] instance The instance to be executed.
1229+ */
1230 void
1231 u_application_instance_run(
1232- UApplicationInstance *instance);
1233+ UApplicationInstance *instance);
1234
1235 #ifdef __cplusplus
1236 }
1237 #endif
1238-
1239+
1240 #endif /* UBUNTU_APPLICATION_INSTANCE_H_ */
1241
1242=== modified file 'include/ubuntu/application/lifecycle_delegate.h'
1243--- include/ubuntu/application/lifecycle_delegate.h 2013-05-27 21:49:05 +0000
1244+++ include/ubuntu/application/lifecycle_delegate.h 2013-07-05 09:17:25 +0000
1245@@ -14,7 +14,7 @@
1246 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1247 *
1248 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
1249- * Thomas Voß <thomas.voss@canonical.com>
1250+ * Thomas Voß <thomas.voss@canonical.com>
1251 */
1252
1253 #ifndef UBUNTU_APPLICATION_LIFECYCLE_DELEGATE_H_
1254@@ -26,55 +26,127 @@
1255 #ifdef __cplusplus
1256 extern "C" {
1257 #endif
1258-
1259+
1260+ /**
1261+ * \brief Prototype for the callback that is invoked whenever the app has been resumed.
1262+ * \ingroup application_support
1263+ * \param[in] options Application instance options
1264+ * \param[in] context The callback context as specified by the application
1265+ */
1266 typedef void (*u_on_application_resumed)(const UApplicationOptions *options, void *context);
1267+ /**
1268+ * \brief Prototype for the callback that is invoked whenever the app is about to be stopped.
1269+ * Applications can serialize their state to the supplied archive.
1270+ * \ingroup application_support
1271+ */
1272 typedef void (*u_on_application_about_to_stop)(UApplicationArchive *archive, void *context);
1273-
1274+
1275+ /**
1276+ * \brief Opaque type encapsulating all app-specific callback functions.
1277+ * \ingroup application_support
1278+ */
1279 typedef void UApplicationLifecycleDelegate;
1280-
1281+
1282+ /**
1283+ * \brief Creates a new instance of the lifecycle delegate with an initial refernce count of 1.
1284+ * \ingroup application_support
1285+ * \returns A new instance of the lifecycle delegate or NULL if no memory is available.
1286+ */
1287 UApplicationLifecycleDelegate*
1288 u_application_lifecycle_delegate_new();
1289-
1290+
1291+ /**
1292+ * \brief Destroys an instance of the lifecycle delegate and releases all of its resources.
1293+ * \ingroup application_support
1294+ * \param[in] delegate The instance to be destroyed.
1295+ */
1296 void
1297 u_application_lifecycle_delegate_destroy(
1298 UApplicationLifecycleDelegate *delegate);
1299-
1300+
1301+ /**
1302+ * \brief Increments the reference count of the supplied lifecycle delegate.
1303+ * \ingroup application_support
1304+ * \param[in] delegate The lifecycle delegate to increment the reference count for.
1305+ */
1306 void
1307 u_application_lifecycle_delegate_ref(
1308 UApplicationLifecycleDelegate *delegate);
1309-
1310+
1311+ /**
1312+ * \brief Decrements the reference count of the supplied lifecycle delegate and destroys it if the count reaches 0.
1313+ * \ingroup application_support
1314+ * \param[in] delegate The lifecycle delegate to decrement the reference count for.
1315+ */
1316 void
1317 u_application_lifecycle_delegate_unref(
1318 UApplicationLifecycleDelegate *delegate);
1319-
1320+
1321+ /**
1322+ * \brief Sets the resumed cb for the supplied delegate.
1323+ * \ingroup application_support
1324+ * \param[in] delegate The lifecycle delegate to adjust the cb for.
1325+ * \param[in] cb The new callback to be invoked whenever the app resumes.
1326+ */
1327 void
1328 u_application_lifecycle_delegate_set_application_resumed_cb(
1329 UApplicationLifecycleDelegate *delegate,
1330 u_on_application_resumed cb);
1331-
1332+
1333+ /**
1334+ * \brief Queries the resumed cb from the supplied delegate.
1335+ * \ingroup application_support
1336+ * \returns The callback to be invoked whenever the app resumes.
1337+ * \param[in] delegate The lifecycle delegate to query the callback from.
1338+ */
1339 u_on_application_resumed
1340 u_application_lifecycle_delegate_get_application_resumed_cb(
1341 UApplicationLifecycleDelegate *delegate);
1342-
1343+
1344+ /**
1345+ * \brief Sets the about-to-stop cb for the supplied delegate.
1346+ * \ingroup application_support
1347+ * \param[in] delegate The lifecycle delegate to adjust the cb for.
1348+ * \param[in] cb The new callback to be invoked whenever the app is about to be stopped..
1349+ */
1350 void
1351 u_application_lifecycle_delegate_set_application_about_to_stop_cb(
1352 UApplicationLifecycleDelegate *delegate,
1353 u_on_application_about_to_stop cb);
1354-
1355+
1356+ /**
1357+ * \brief Queries the about-to-be-stopped cb from the supplied delegate.
1358+ * \ingroup application_support
1359+ * \returns The callback to be invoked whenever the app is about to be stopped.
1360+ * \param[in] delegate The lifecycle delegate to query the callback from.
1361+ */
1362 u_on_application_about_to_stop
1363 u_application_lifecycle_delegate_get_application_about_to_stop_cb(
1364 UApplicationLifecycleDelegate *delegate);
1365-
1366+
1367+ /**
1368+ * \brief Sets the cb context for the supplied delegate.
1369+ * \ingroup application_support
1370+ * \param[in] delegate The lifecycle delegate to adjust the context for.
1371+ * \param[in] context The new cb context.
1372+ */
1373 void
1374 u_application_lifecycle_delegate_set_context(
1375 UApplicationLifecycleDelegate *delegate,
1376 void *context);
1377-
1378+
1379+ /**
1380+ * \brief Queries the cb context from the supplied delegate.
1381+ * \ingroup application_support
1382+ * \returns The context that is passed to callbacks of this delegate.
1383+ * \param[in] delegate The lifecycle delegate to query the context from.
1384+ * \param[in] context Unused.
1385+ */
1386 void*
1387 u_application_lifecycle_delegate_get_context(
1388 UApplicationLifecycleDelegate *delegate,
1389 void *context);
1390-
1391+
1392 #ifdef __cplusplus
1393 }
1394 #endif
1395
1396=== modified file 'include/ubuntu/application/operation_mode.h'
1397--- include/ubuntu/application/operation_mode.h 2013-05-27 21:49:05 +0000
1398+++ include/ubuntu/application/operation_mode.h 2013-07-05 09:17:25 +0000
1399@@ -14,16 +14,20 @@
1400 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1401 *
1402 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
1403- * Thomas Voß <thomas.voss@canonical.com>
1404+ * Thomas Voß <thomas.voss@canonical.com>
1405 */
1406
1407 #ifndef UBUNTU_APPLICATION_OPERATION_MODE_H_
1408 #define UBUNTU_APPLICATION_OPERATION_MODE_H_
1409
1410+/**
1411+ * \brief Describes the different operational modes that an
1412+ * application can run in.
1413+ */
1414 typedef enum
1415 {
1416- U_APPLICATION_FOREGROUND_APP,
1417- U_APPLICATION_BACKGROUND_SERVICE
1418+ U_APPLICATION_FOREGROUND_APP,
1419+ U_APPLICATION_BACKGROUND_SERVICE
1420 } UApplicationOperationMode;
1421
1422 #endif /* UBUNTU_APPLICATION_OPERATION_MODE_H_ */
1423
1424=== modified file 'include/ubuntu/application/options.h'
1425--- include/ubuntu/application/options.h 2013-05-27 22:14:00 +0000
1426+++ include/ubuntu/application/options.h 2013-07-05 09:17:25 +0000
1427@@ -14,7 +14,7 @@
1428 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1429 *
1430 * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
1431- * Thomas Voß <thomas.voss@canonical.com>
1432+ * Thomas Voß <thomas.voss@canonical.com>
1433 */
1434
1435 #ifndef UBUNTU_APPLICATION_OPTIONS_H_
1436@@ -26,21 +26,43 @@
1437 extern "C" {
1438 #endif
1439
1440+ /**
1441+ * \brief Encapsulates options as passed to the application.
1442+ * \ingroup application_support
1443+ */
1444 typedef void UApplicationOptions;
1445-
1446+
1447+ /**
1448+ * \brief Parses options from the command line.
1449+ * \ingroup application_support
1450+ * \returns An options instance if parsing was successful, or 0 otheriwse.
1451+ * \param[in] argc Number of arguments.
1452+ * \param[in] argv Arguments.
1453+ */
1454 UApplicationOptions*
1455 u_application_options_new_from_cmd_line(
1456- int argc,
1457- char** argv);
1458-
1459+ int argc,
1460+ char** argv);
1461+
1462+ /**
1463+ * \brief Destroys the options object and releases all resources.
1464+ * \ingroup application_support
1465+ * \param[in] options The object to be destroyed.
1466+ */
1467 void
1468 u_application_options_destroy(
1469- UApplicationOptions *options);
1470-
1471+ UApplicationOptions *options);
1472+
1473+ /**
1474+ * \brief Queries the operation mode from the supplied options object.
1475+ * \ingroup application_support
1476+ * \returns The operation mode as stored in the options object.
1477+ * \param[in] options The options object to be queried.
1478+ */
1479 UApplicationOperationMode
1480 u_application_options_get_operation_mode(
1481- UApplicationOptions *options);
1482-
1483+ UApplicationOptions *options);
1484+
1485 #ifdef __cplusplus
1486 }
1487 #endif
1488
1489=== modified file 'include/ubuntu/application/sensors/accelerometer.h'
1490--- include/ubuntu/application/sensors/accelerometer.h 2013-05-30 02:03:42 +0000
1491+++ include/ubuntu/application/sensors/accelerometer.h 2013-07-05 09:17:25 +0000
1492@@ -26,36 +26,94 @@
1493 extern "C" {
1494 #endif
1495
1496+ /**
1497+ * \brief Opaque type that models the accelerometer.
1498+ * \ingroup sensor_access
1499+ */
1500 typedef void UASensorsAccelerometer;
1501+
1502+ /**
1503+ * \brief Callback type used by applications to subscribe to accelerometer events.
1504+ * \ingroup sensor_access
1505+ */
1506 typedef void (*on_accelerometer_event_cb)(UASAccelerometerEvent* event,
1507 void* context);
1508
1509+ /**
1510+ * \brief Create a new object for accessing the accelerometer.
1511+ * \ingroup sensor_access
1512+ * \returns A new instance or NULL in case of errors.
1513+ */
1514 UASensorsAccelerometer*
1515- ua_sensors_accelerometer_new();
1516+ ua_sensors_accelerometer_new();
1517
1518+ /**
1519+ * \brief Enables the supplied accelerometer.
1520+ * \ingroup sensor_access
1521+ * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
1522+ * \param[in] sensor The sensor instance to be enabled.
1523+ */
1524 UStatus
1525 ua_sensors_accelerometer_enable(
1526 UASensorsAccelerometer* sensor);
1527
1528+ /**
1529+ * \brief Disables the supplied accelerometer.
1530+ * \ingroup sensor_access
1531+ * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
1532+ * \param[in] sensor The sensor instance to be disabled.
1533+ */
1534 UStatus
1535 ua_sensors_accelerometer_disable(
1536 UASensorsAccelerometer* sensor);
1537
1538+ /**
1539+ * \brief Queries the minimum delay between two readings for the supplied sensor.
1540+ * \ingroup sensor_access
1541+ * \returns The minimum delay between two readings in [ms].
1542+ * \param[in] sensor The sensor instance to be queried.
1543+ */
1544 uint32_t
1545 ua_sensors_accelerometer_get_min_delay(
1546 UASensorsAccelerometer* sensor);
1547-
1548+
1549+ /**
1550+ * \brief Queries the minimum value that can be reported by the sensor.
1551+ * \ingroup sensor_access
1552+ * \returns The minimum value that can be reported by the sensor.
1553+ * \param[in] sensor The sensor instance to be queried.
1554+ */
1555 float
1556 ua_sensors_accelerometer_get_min_value(
1557 UASensorsAccelerometer* sensor);
1558-
1559+
1560+ /**
1561+ * \brief Queries the maximum value that can be reported by the sensor.
1562+ * \ingroup sensor_access
1563+ * \returns The maximum value that can be reported by the sensor.
1564+ * \param[in] sensor The sensor instance to be queried.
1565+ */
1566 float
1567 ua_sensors_accelerometer_get_max_value(
1568 UASensorsAccelerometer* sensor);
1569-
1570+
1571+ /**
1572+ * \brief Queries the numeric resolution supported by the sensor
1573+ * \ingroup sensor_access
1574+ * \returns The numeric resolution supported by the sensor.
1575+ * \param[in] sensor The sensor instance to be queried.
1576+ */
1577 float
1578 ua_sensors_accelerometer_get_resolution(
1579 UASensorsAccelerometer* sensor);
1580+
1581+ /**
1582+ * \brief Set the callback to be invoked whenever a new sensor reading is available.
1583+ * \ingroup sensor_access
1584+ * \param[in] sensor The sensor instance to associate the callback with.
1585+ * \param[in] cb The callback to be invoked.
1586+ * \param[in] ctx The context supplied to the callback invocation.
1587+ */
1588 void
1589 ua_sensors_accelerometer_set_reading_cb(
1590 UASensorsAccelerometer* sensor,
1591
1592=== modified file 'include/ubuntu/application/sensors/event/accelerometer.h'
1593--- include/ubuntu/application/sensors/event/accelerometer.h 2013-05-30 02:03:42 +0000
1594+++ include/ubuntu/application/sensors/event/accelerometer.h 2013-07-05 09:17:25 +0000
1595@@ -25,20 +25,48 @@
1596 extern "C" {
1597 #endif
1598
1599+ /**
1600+ * \brief Opaque type describing an accelerometer reading.
1601+ * \ingroup sensor_access
1602+ */
1603 typedef void UASAccelerometerEvent;
1604
1605+ /**
1606+ * \brief Query the timestamp of the sensor reading.
1607+ * \ingroup sensor_access
1608+ * \returns The timestamp of the sensor reading in [µs], timebase: monotonic clock.
1609+ * \param[in] event The reading to be queried.
1610+ */
1611 uint64_t
1612 uas_accelerometer_event_get_timestamp(
1613 UASAccelerometerEvent* event);
1614-
1615+
1616+ /**
1617+ * \brief Query the acceleration in x-axis direction.
1618+ * \ingroup sensor_access
1619+ * \returns The acceleration in x-axis direction.
1620+ * \param[in] event The reading to be queried.
1621+ */
1622 float
1623 uas_accelerometer_event_get_acceleration_x(
1624 UASAccelerometerEvent* event);
1625-
1626+
1627+ /**
1628+ * \brief Query the acceleration in y-axis direction.
1629+ * \ingroup sensor_access
1630+ * \returns The acceleration in y-axis direction.
1631+ * \param[in] event The reading to be queried.
1632+ */
1633 float
1634 uas_accelerometer_event_get_acceleration_y(
1635 UASAccelerometerEvent* event);
1636-
1637+
1638+ /**
1639+ * \brief Query the acceleration in z-axis direction.
1640+ * \ingroup sensor_access
1641+ * \returns The acceleration in z-axis direction.
1642+ * \param[in] event The reading to be queried.
1643+ */
1644 float
1645 uas_accelerometer_event_get_acceleration_z(
1646 UASAccelerometerEvent* event);
1647
1648=== modified file 'include/ubuntu/application/sensors/event/light.h'
1649--- include/ubuntu/application/sensors/event/light.h 2013-05-30 02:03:42 +0000
1650+++ include/ubuntu/application/sensors/event/light.h 2013-07-05 09:17:25 +0000
1651@@ -25,12 +25,28 @@
1652 extern "C" {
1653 #endif
1654
1655+ /**
1656+ * \brief Opaque type describing an ambient light sensor reading.
1657+ * \ingroup sensor_access
1658+ */
1659 typedef void UASLightEvent;
1660
1661+ /**
1662+ * \brief Query the timestamp of the sensor reading.
1663+ * \ingroup sensor_access
1664+ * \returns The timestamp of the sensor reading in [µs], timebase: monotonic clock.
1665+ * \param[in] event The reading to be queried.
1666+ */
1667 uint64_t
1668 uas_light_event_get_timestamp(
1669 UASLightEvent* event);
1670-
1671+
1672+ /**
1673+ * \brief Query the value measured by the ambient light sensor.
1674+ * \ingroup sensor_access
1675+ * \returns The ambient light level.
1676+ * \param[in] event The reading to be queried.
1677+ */
1678 float
1679 uas_light_event_get_light(
1680 UASLightEvent* event);
1681
1682=== modified file 'include/ubuntu/application/sensors/event/proximity.h'
1683--- include/ubuntu/application/sensors/event/proximity.h 2013-05-30 02:03:42 +0000
1684+++ include/ubuntu/application/sensors/event/proximity.h 2013-07-05 09:17:25 +0000
1685@@ -25,17 +25,39 @@
1686 extern "C" {
1687 #endif
1688
1689+ /**
1690+ * \brief Useful constants when inspecting readings from the proximity sensor.
1691+ * \ingroup sensor_access
1692+ */
1693 typedef enum {
1694- U_PROXIMITY_NEAR = 1,
1695- U_PROXIMITY_FAR = 2
1696- } UASProximityDistance;
1697-
1698+ U_PROXIMITY_NEAR = 1, /**< The reading indicates that something is near the sensor/device. */
1699+ U_PROXIMITY_FAR = 2 /**< The reading indicates that something is far away from the sensor/device. */
1700+ } UbuntuApplicationSensorsProximityDistance;
1701+
1702+ typedef UbuntuApplicationSensorsProximityDistance UASProximityDistance;
1703+
1704+ /**
1705+ * \brief Opaque type describing an accelerometer reading.
1706+ * \ingroup sensor_access
1707+ */
1708 typedef void UASProximityEvent;
1709
1710+ /**
1711+ * \brief Query the timestamp of the sensor reading.
1712+ * \ingroup sensor_access
1713+ * \returns The timestamp of the sensor reading in [µs], timebase: monotonic clock.
1714+ * \param[in] event The reading to be queried.
1715+ */
1716 uint64_t
1717 uas_proximity_event_get_timestamp(
1718 UASProximityEvent* event);
1719-
1720+
1721+ /**
1722+ * \brief Query the discrete distance as reported by the proximity sensor.
1723+ * \ingroup sensor_access
1724+ * \returns The discrete distance as reported by the proximity sensor.
1725+ * \param[in] event The reading to be queried.
1726+ */
1727 UASProximityDistance
1728 uas_proximity_event_get_distance(
1729 UASProximityEvent* event);
1730
1731=== modified file 'include/ubuntu/application/sensors/light.h'
1732--- include/ubuntu/application/sensors/light.h 2013-05-30 02:03:42 +0000
1733+++ include/ubuntu/application/sensors/light.h 2013-07-05 09:17:25 +0000
1734@@ -26,36 +26,94 @@
1735 extern "C" {
1736 #endif
1737
1738+ /**
1739+ * \brief Opaque type that models the ambient light sensor.
1740+ * \ingroup sensor_access
1741+ */
1742 typedef void UASensorsLight;
1743+
1744+ /**
1745+ * \brief Callback type used by applications to subscribe to ambient light sensor events.
1746+ * \ingroup sensor_access
1747+ */
1748 typedef void (*on_light_event_cb)(UASLightEvent* event,
1749 void* context);
1750
1751+ /**
1752+ * \brief Create a new object for accessing the ambient light sensor.
1753+ * \ingroup sensor_access
1754+ * \returns A new instance or NULL in case of errors.
1755+ */
1756 UASensorsLight*
1757- ua_sensors_light_new();
1758-
1759- UStatus
1760- ua_sensors_light_enable(
1761- UASensorsLight* sensor);
1762-
1763- UStatus
1764- ua_sensors_light_enable(
1765- UASensorsLight* sensor);
1766-
1767+ ua_sensors_light_new();
1768+
1769+ /**
1770+ * \brief Enables the supplied ambient light sensor.
1771+ * \ingroup sensor_access
1772+ * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
1773+ * \param[in] sensor The sensor instance to be enabled.
1774+ */
1775+ UStatus
1776+ ua_sensors_light_enable(
1777+ UASensorsLight* sensor);
1778+
1779+ /**
1780+ * \brief Disables the supplied ambient light sensor.
1781+ * \ingroup sensor_access
1782+ * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
1783+ * \param[in] sensor The sensor instance to be disabled.
1784+ */
1785+ UStatus
1786+ ua_sensors_light_enable(
1787+ UASensorsLight* sensor);
1788+
1789+ /**
1790+ * \brief Queries the minimum delay between two readings for the supplied sensor.
1791+ * \ingroup sensor_access
1792+ * \returns The minimum delay between two readings in [ms].
1793+ * \param[in] sensor The sensor instance to be queried.
1794+ */
1795 uint32_t
1796 ua_sensors_light_get_min_delay(
1797 UASensorsLight* sensor);
1798-
1799+
1800+ /**
1801+ * \brief Queries the minimum value that can be reported by the sensor.
1802+ * \ingroup sensor_access
1803+ * \returns The minimum value that can be reported by the sensor.
1804+ * \param[in] sensor The sensor instance to be queried.
1805+ */
1806 float
1807 ua_sensors_light_get_min_value(
1808 UASensorsLight* sensor);
1809-
1810+
1811+ /**
1812+ * \brief Queries the maximum value that can be reported by the sensor.
1813+ * \ingroup sensor_access
1814+ * \returns The maximum value that can be reported by the sensor.
1815+ * \param[in] sensor The sensor instance to be queried.
1816+ */
1817 float
1818 ua_sensors_light_get_max_value(
1819 UASensorsLight* sensor);
1820-
1821+
1822+ /**
1823+ * \brief Queries the numeric resolution supported by the sensor
1824+ * \ingroup sensor_access
1825+ * \returns The numeric resolution supported by the sensor.
1826+ * \param[in] sensor The sensor instance to be queried.
1827+ */
1828 float
1829 ua_sensors_light_get_resolution(
1830 UASensorsLight* sensor);
1831+
1832+ /**
1833+ * \brief Set the callback to be invoked whenever a new sensor reading is available.
1834+ * \ingroup sensor_access
1835+ * \param[in] sensor The sensor instance to associate the callback with.
1836+ * \param[in] cb The callback to be invoked.
1837+ * \param[in] ctx The context supplied to the callback invocation.
1838+ */
1839 void
1840 ua_sensors_light_set_reading_cb(
1841 UASensorsLight* sensor,
1842
1843=== modified file 'include/ubuntu/application/sensors/proximity.h'
1844--- include/ubuntu/application/sensors/proximity.h 2013-05-30 02:03:42 +0000
1845+++ include/ubuntu/application/sensors/proximity.h 2013-07-05 09:17:25 +0000
1846@@ -26,36 +26,94 @@
1847 extern "C" {
1848 #endif
1849
1850+ /**
1851+ * \brief Opaque type that models the proximity sensor.
1852+ * \ingroup sensor_access
1853+ */
1854 typedef void UASensorsProximity;
1855+
1856+ /**
1857+ * \brief Callback type used by applications to subscribe to proximity sensor events.
1858+ * \ingroup sensor_access
1859+ */
1860 typedef void (*on_proximity_event_cb)(UASProximityEvent* event,
1861 void* context);
1862
1863+ /**
1864+ * \brief Create a new object for accessing the proximity sensor.
1865+ * \ingroup sensor_access
1866+ * \returns A new instance or NULL in case of errors.
1867+ */
1868 UASensorsProximity*
1869- ua_sensors_proximity_new();
1870+ ua_sensors_proximity_new();
1871
1872+ /**
1873+ * \brief Enables the supplied proximity sensor.
1874+ * \ingroup sensor_access
1875+ * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
1876+ * \param[in] sensor The sensor instance to be enabled.
1877+ */
1878 UStatus
1879 ua_sensors_proximity_enable(
1880 UASensorsProximity* sensor);
1881
1882+ /**
1883+ * \brief Disables the supplied proximity sensor.
1884+ * \ingroup sensor_access
1885+ * \returns U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
1886+ * \param[in] sensor The sensor instance to be disabled.
1887+ */
1888 UStatus
1889 ua_sensors_proximity_disable(
1890 UASensorsProximity* sensor);
1891
1892+ /**
1893+ * \brief Queries the minimum delay between two readings for the supplied sensor.
1894+ * \ingroup sensor_access
1895+ * \returns The minimum delay between two readings in [ms].
1896+ * \param[in] sensor The sensor instance to be queried.
1897+ */
1898 uint32_t
1899 ua_sensors_proximity_get_min_delay(
1900 UASensorsProximity* sensor);
1901-
1902+
1903+ /**
1904+ * \brief Queries the minimum value that can be reported by the sensor.
1905+ * \ingroup sensor_access
1906+ * \returns The minimum value that can be reported by the sensor.
1907+ * \param[in] sensor The sensor instance to be queried.
1908+ */
1909 float
1910 ua_sensors_proximity_get_min_value(
1911 UASensorsProximity* sensor);
1912-
1913+
1914+ /**
1915+ * \brief Queries the maximum value that can be reported by the sensor.
1916+ * \ingroup sensor_access
1917+ * \returns The maximum value that can be reported by the sensor.
1918+ * \param[in] sensor The sensor instance to be queried.
1919+ */
1920 float
1921 ua_sensors_proximity_get_max_value(
1922 UASensorsProximity* sensor);
1923-
1924+
1925+ /**
1926+ * \brief Queries the numeric resolution supported by the sensor
1927+ * \ingroup sensor_access
1928+ * \returns The numeric resolution supported by the sensor.
1929+ * \param[in] sensor The sensor instance to be queried.
1930+ */
1931 float
1932 ua_sensors_proximity_get_resolution(
1933 UASensorsProximity* sensor);
1934+
1935+ /**
1936+ * \brief Set the callback to be invoked whenever a new sensor reading is available.
1937+ * \ingroup sensor_access
1938+ * \param[in] sensor The sensor instance to associate the callback with.
1939+ * \param[in] cb The callback to be invoked.
1940+ * \param[in] ctx The context supplied to the callback invocation.
1941+ */
1942 void
1943 ua_sensors_proximity_set_reading_cb(
1944 UASensorsProximity* sensor,
1945
1946=== added directory 'include/ubuntu/hardware'
1947=== renamed file 'include/ubuntu/application/ubuntu_application_gps.h' => 'include/ubuntu/hardware/gps.h'
1948--- include/ubuntu/application/ubuntu_application_gps.h 2013-05-27 21:49:05 +0000
1949+++ include/ubuntu/hardware/gps.h 2013-07-05 09:17:25 +0000
1950@@ -14,9 +14,10 @@
1951 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1952 *
1953 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
1954+ * Authored by: Thomas Voß <thomas.voss@canonical.com>
1955 */
1956-#ifndef UBUNTU_APPLICATION_GPS_H_
1957-#define UBUNTU_APPLICATION_GPS_H_
1958+#ifndef UBUNTU_HARDWARE_GPS_H_
1959+#define UBUNTU_HARDWARE_GPS_H_
1960
1961 #include <stdint.h>
1962 #include <stddef.h>
1963@@ -25,149 +26,170 @@
1964 extern "C" {
1965 #endif
1966
1967-/** \defgroup gps_access Functions and types for accessing location services. */
1968+/** \defgroup gps_access Functions and types for accessing GPS H/W. */
1969+
1970+/**
1971+ * Maximum number of SVs for u_hardware_gps_sv_status_callback().
1972+ * \ingroup gps_access
1973+ */
1974+#define U_HARDWARE_GPS_MAX_SVS 32
1975
1976 /**
1977- * Maximum number of SVs for gps_sv_status_callback().
1978+ * The status of the GPS hardware.
1979 * \ingroup gps_access
1980 */
1981-#define UBUNTU_GPS_MAX_SVS 32
1982-
1983 enum
1984 {
1985 /** GPS status unknown. */
1986- UBUNTU_GPS_STATUS_NONE = 0,
1987+ U_HARDWARE_GPS_STATUS_NONE = 0,
1988 /** GPS has begun navigating. */
1989- UBUNTU_GPS_STATUS_SESSION_BEGIN = 1,
1990+ U_HARDWARE_GPS_STATUS_SESSION_BEGIN = 1,
1991 /** GPS has stopped navigating. */
1992- UBUNTU_GPS_STATUS_SESSION_END = 2,
1993+ U_HARDWARE_GPS_STATUS_SESSION_END = 2,
1994 /** GPS has powered on but is not navigating. */
1995- UBUNTU_GPS_STATUS_ENGINE_ON = 3,
1996+ U_HARDWARE_GPS_STATUS_ENGINE_ON = 3,
1997 /** GPS is powered off. */
1998- UBUNTU_GPS_STATUS_ENGINE_OFF = 4
1999+ U_HARDWARE_GPS_STATUS_ENGINE_OFF = 4
2000 };
2001
2002-/**
2003+/**
2004 * Flags for the gps_set_capabilities callback.
2005 * \ingroup gps_access
2006- * GPS HAL schedules fixes for UBUNTU_GPS_POSITION_RECURRENCE_PERIODIC mode.
2007+ * GPS HAL schedules fixes for U_HARDWARE_GPS_POSITION_RECURRENCE_PERIODIC mode.
2008 * If this is not set, then the framework will use 1000ms for min_interval
2009 * and will start and call start() and stop() to schedule the GPS.
2010 */
2011-#define UBUNTU_GPS_CAPABILITY_SCHEDULING 0x0000001
2012+#define U_HARDWARE_GPS_CAPABILITY_SCHEDULING 0x0000001
2013 /** GPS supports MS-Based AGPS mode */
2014-#define UBUNTU_GPS_CAPABILITY_MSB 0x0000002
2015+#define U_HARDWARE_GPS_CAPABILITY_MSB 0x0000002
2016 /** GPS supports MS-Assisted AGPS mode */
2017-#define UBUNTU_GPS_CAPABILITY_MSA 0x0000004
2018+#define U_HARDWARE_GPS_CAPABILITY_MSA 0x0000004
2019 /** GPS supports single-shot fixes */
2020-#define UBUNTU_GPS_CAPABILITY_SINGLE_SHOT 0x0000008
2021+#define U_HARDWARE_GPS_CAPABILITY_SINGLE_SHOT 0x0000008
2022 /** GPS supports on demand time injection */
2023-#define UBUNTU_GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010
2024+#define U_HARDWARE_GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010
2025
2026 /**
2027- * UbuntuGpsNiNotifyFlags constants
2028+ * UHardwareGpsNiNotifyFlags constants
2029 * \ingroup gps_access
2030 */
2031-typedef uint32_t UbuntuGpsNiNotifyFlags;
2032+typedef uint32_t UHardwareGpsNiNotifyFlags;
2033 /** NI requires notification */
2034-#define UBUNTU_GPS_NI_NEED_NOTIFY 0x0001
2035+#define U_HARDWARE_GPS_NI_NEED_NOTIFY 0x0001
2036 /** NI requires verification */
2037-#define UBUNTU_GPS_NI_NEED_VERIFY 0x0002
2038+#define U_HARDWARE_GPS_NI_NEED_VERIFY 0x0002
2039 /** NI requires privacy override, no notification/minimal trace */
2040-#define UBUNTU_GPS_NI_PRIVACY_OVERRIDE 0x0004
2041+#define U_HARDWARE_GPS_NI_PRIVACY_OVERRIDE 0x0004
2042
2043 /**
2044 * GPS NI responses, used to define the response in
2045 * NI structures
2046 * \ingroup gps_access
2047 */
2048-typedef int UbuntuGpsUserResponseType;
2049+typedef int UHardwareGpsUserResponseType;
2050+
2051 enum
2052 {
2053- UBUNTU_UBUNTU_GPS_NI_RESPONSE_ACCEPT = 1,
2054- UBUNTU_UBUNTU_GPS_NI_RESPONSE_DENY = 2,
2055- UBUNTU_UBUNTU_GPS_NI_RESPONSE_NORESP = 3
2056+ U_HARDWARE_GPS_NI_RESPONSE_ACCEPT = 1,
2057+ U_HARDWARE_GPS_NI_RESPONSE_DENY = 2,
2058+ U_HARDWARE_GPS_NI_RESPONSE_NORESP = 3
2059 };
2060
2061 enum
2062 {
2063- UBUNTU_GPS_NI_TYPE_VOICE = 1,
2064- UBUNTU_GPS_NI_TYPE_UMTS_SUPL = 2,
2065- UBUNTU_GPS_NI_TYPE_UMTS_CTRL_PLANE = 3
2066+ U_HARDWARE_GPS_NI_TYPE_VOICE = 1,
2067+ U_HARDWARE_GPS_NI_TYPE_UMTS_SUPL = 2,
2068+ U_HARDWARE_GPS_NI_TYPE_UMTS_CTRL_PLANE = 3
2069 };
2070
2071 /**
2072 * String length constants
2073 * \ingroup gps_access
2074 */
2075-#define UBUNTU_GPS_NI_SHORT_STRING_MAXLEN 256
2076-#define UBUNTU_GPS_NI_LONG_STRING_MAXLEN 2048
2077+#define U_HARDWARE_GPS_NI_SHORT_STRING_MAXLEN 256
2078+#define U_HARDWARE_GPS_NI_LONG_STRING_MAXLEN 2048
2079
2080 /**
2081 * NI data encoding scheme
2082 * \ingroup gps_access
2083 */
2084-typedef int UbuntuGpsNiEncodingType;
2085-enum
2086-{
2087- UBUNTU_GPS_ENC_NONE = 0,
2088- UBUNTU_GPS_ENC_SUPL_GSM_DEFAULT = 1,
2089- UBUNTU_GPS_ENC_SUPL_UTF8 = 2,
2090- UBUNTU_GPS_ENC_SUPL_UCS2 = 3,
2091- UBUNTU_GPS_ENC_UNKNOWN = -1
2092-};
2093-
2094-enum
2095-{
2096- UBUNTU_AGPS_TYPE_SUPL = 1,
2097- UBUNTU_AGPS_TYPE_C2K = 2
2098-};
2099-
2100-
2101+typedef int UHardwareGpsNiEncodingType;
2102+
2103+/**
2104+ * Known encoding types for Ni responses
2105+ * \ingroup gps_access
2106+ */
2107+enum
2108+{
2109+ U_HARDWARE_GPS_ENC_NONE = 0,
2110+ U_HARDWARE_GPS_ENC_SUPL_GSM_DEFAULT = 1,
2111+ U_HARDWARE_GPS_ENC_SUPL_UTF8 = 2,
2112+ U_HARDWARE_GPS_ENC_SUPL_UCS2 = 3,
2113+ U_HARDWARE_GPS_ENC_UNKNOWN = -1
2114+};
2115+
2116+/**
2117+ * Known AGPS types
2118+ * \ingroup gps_access
2119+ */
2120+enum
2121+{
2122+ U_HARDWARE_GPS_AGPS_TYPE_SUPL = 1,
2123+ U_HARDWARE_GPS_AGPS_TYPE_C2K = 2
2124+};
2125+
2126+/**
2127+ * Known positioning modes
2128+ * \ingroup gps_access
2129+ */
2130 enum
2131 {
2132 /** Mode for running GPS standalone (no assistance). */
2133- UBUNTU_GPS_POSITION_MODE_STANDALONE = 0,
2134+ U_HARDWARE_GPS_POSITION_MODE_STANDALONE = 0,
2135 /** AGPS MS-Based mode. */
2136- UBUNTU_GPS_POSITION_MODE_MS_BASED = 1,
2137+ U_HARDWARE_GPS_POSITION_MODE_MS_BASED = 1,
2138 /** AGPS MS-Assisted mode. */
2139- UBUNTU_GPS_POSITION_MODE_MS_ASSISTED = 2
2140+ U_HARDWARE_GPS_POSITION_MODE_MS_ASSISTED = 2
2141 };
2142
2143+/**
2144+ * Known positioning modes
2145+ * \ingroup gps_access
2146+ */
2147 enum
2148 {
2149 /** Receive GPS fixes on a recurring basis at a specified period. */
2150- UBUNTU_GPS_POSITION_RECURRENCE_PERIODIC = 0,
2151+ U_HARDWARE_GPS_POSITION_RECURRENCE_PERIODIC = 0,
2152 /** Request a single shot GPS fix. */
2153- UBUNTU_GPS_POSITION_RECURRENCE_SINGLE = 1
2154+ U_HARDWARE_GPS_POSITION_RECURRENCE_SINGLE = 1
2155 };
2156
2157 enum
2158 {
2159 /** GPS requests data connection for AGPS. */
2160- UBUNTU_GPS_REQUEST_AGPS_DATA_CONN = 1,
2161+ U_HARDWARE_GPS_REQUEST_AGPS_DATA_CONN = 1,
2162 /** GPS releases the AGPS data connection. */
2163- UBUNTU_GPS_RELEASE_AGPS_DATA_CONN = 2,
2164+ U_HARDWARE_GPS_RELEASE_AGPS_DATA_CONN = 2,
2165 /** AGPS data connection initiated */
2166- UBUNTU_GPS_AGPS_DATA_CONNECTED = 3,
2167+ U_HARDWARE_GPS_AGPS_DATA_CONNECTED = 3,
2168 /** AGPS data connection completed */
2169- UBUNTU_GPS_AGPS_DATA_CONN_DONE = 4,
2170+ U_HARDWARE_GPS_AGPS_DATA_CONN_DONE = 4,
2171 /** AGPS data connection failed */
2172- UBUNTU_GPS_AGPS_DATA_CONN_FAILED = 5
2173+ U_HARDWARE_GPS_AGPS_DATA_CONN_FAILED = 5
2174 };
2175
2176-/** UbuntuGpsLocation has valid latitude and longitude. */
2177-#define UBUNTU_GPS_LOCATION_HAS_LAT_LONG 0x0001
2178-/** UbuntuGpsLocation has valid altitude. */
2179-#define UBUNTU_GPS_LOCATION_HAS_ALTITUDE 0x0002
2180-/** UbuntuGpsLocation has valid speed. */
2181-#define UBUNTU_GPS_LOCATION_HAS_SPEED 0x0004
2182-/** UbuntuGpsLocation has valid bearing. */
2183-#define UBUNTU_GPS_LOCATION_HAS_BEARING 0x0008
2184-/** UbuntuGpsLocation has valid accuracy. */
2185-#define UBUNTU_GPS_LOCATION_HAS_ACCURACY 0x0010
2186+/** UHardwareGpsLocation has valid latitude and longitude. */
2187+#define U_HARDWARE_GPS_LOCATION_HAS_LAT_LONG 0x0001
2188+/** UHardwareGpsLocation has valid altitude. */
2189+#define U_HARDWARE_GPS_LOCATION_HAS_ALTITUDE 0x0002
2190+/** UHardwareGpsLocation has valid speed. */
2191+#define U_HARDWARE_GPS_LOCATION_HAS_SPEED 0x0004
2192+/** UHardwareGpsLocation has valid bearing. */
2193+#define U_HARDWARE_GPS_LOCATION_HAS_BEARING 0x0008
2194+/** UHardwareGpsLocation has valid accuracy. */
2195+#define U_HARDWARE_GPS_LOCATION_HAS_ACCURACY 0x0010
2196
2197-typedef struct UbuntuGps_* UbuntuGps;
2198+typedef struct UHardwareGps_* UHardwareGps;
2199
2200 /**
2201 * Models a location as reported by the GPS HAL.
2202@@ -175,234 +197,264 @@
2203 */
2204 typedef struct
2205 {
2206- /** set to sizeof(UbuntuGpsLocation) */
2207- size_t size;
2208- /** Contains UBUNTU_GPS_LOCATION_* flags bits. */
2209- uint16_t flags;
2210+ /** set to sizeof(UHardwareGpsLocation) */
2211+ size_t size;
2212+ /** Contains U_HARDWARE_GPS_LOCATION_* flags bits. */
2213+ uint16_t flags;
2214 /** Represents latitude in degrees. */
2215- double latitude;
2216+ double latitude;
2217 /** Represents longitude in degrees. */
2218- double longitude;
2219+ double longitude;
2220 /** Represents altitude in meters above the WGS 84 reference
2221 * ellipsoid. */
2222- double altitude;
2223+ double altitude;
2224 /** Represents speed in meters per second. */
2225- float speed;
2226+ float speed;
2227 /** Represents heading in degrees. */
2228- float bearing;
2229+ float bearing;
2230 /** Represents expected accuracy in meters. */
2231- float accuracy;
2232+ float accuracy;
2233 /** Timestamp for the location fix, in milliseconds since January 1, 1970 */
2234- int64_t timestamp;
2235-} UbuntuGpsLocation;
2236+ int64_t timestamp;
2237+} UHardwareGpsLocation;
2238
2239-/**
2240- * Represents space vehicle (satellite) information.
2241+/**
2242+ * Represents space vehicle (satellite) information.
2243 * \ingroup gps_access
2244 */
2245 typedef struct {
2246- /** set to sizeof(UbuntuGpsSvInfo) */
2247- size_t size;
2248+ /** set to sizeof(UHardwareGpsSvInfo) */
2249+ size_t size;
2250 /** Pseudo-random number for the SV. */
2251- int prn;
2252+ int prn;
2253 /** Signal to noise ratio. */
2254- float snr;
2255+ float snr;
2256 /** Elevation of SV in degrees. */
2257- float elevation;
2258+ float elevation;
2259 /** Azimuth of SV in degrees. */
2260- float azimuth;
2261-} UbuntuGpsSvInfo;
2262+ float azimuth;
2263+} UHardwareGpsSvInfo;
2264
2265-/**
2266- * Represents SV (Space Vehicle) status.
2267+/**
2268+ * Represents SV (Space Vehicle) status.
2269 * \ingroup gps_access
2270 */
2271 typedef struct {
2272 /** set to sizeof(GpsSvStatus) */
2273- size_t size;
2274+ size_t size;
2275
2276 /** Number of SVs currently visible. */
2277- int num_svs;
2278+ int num_svs;
2279
2280 /** Contains an array of SV information. */
2281- UbuntuGpsSvInfo sv_list[UBUNTU_GPS_MAX_SVS];
2282+ UHardwareGpsSvInfo sv_list[U_HARDWARE_GPS_MAX_SVS];
2283
2284 /** Represents a bit mask indicating which SVs
2285 * have ephemeris data.
2286 */
2287- uint32_t ephemeris_mask;
2288+ uint32_t ephemeris_mask;
2289
2290 /** Represents a bit mask indicating which SVs
2291 * have almanac data.
2292 */
2293- uint32_t almanac_mask;
2294+ uint32_t almanac_mask;
2295
2296 /**
2297 * Represents a bit mask indicating which SVs
2298 * were used for computing the most recent position fix.
2299 */
2300- uint32_t used_in_fix_mask;
2301-} UbuntuGpsSvStatus;
2302+ uint32_t used_in_fix_mask;
2303+} UHardwareGpsSvStatus;
2304
2305-/**
2306- * Represents the status of AGPS.
2307+/**
2308+ * Represents the status of AGPS.
2309 * \ingroup gps_access
2310 */
2311 typedef struct {
2312- /** set to sizeof(UbuntuAgpsStatus) */
2313+ /** set to sizeof(UHardwareGpsAGpsStatus) */
2314 size_t size;
2315
2316 uint16_t type;
2317 uint16_t status;
2318 uint32_t ipaddr;
2319-} UbuntuAgpsStatus;
2320+} UHardwareGpsAGpsStatus;
2321
2322-/**
2323- * Represents an NI request
2324+/**
2325+ * Represents an NI request
2326 * \ingroup gps_access
2327 */
2328 typedef struct {
2329- /** set to sizeof(UbuntuGpsNiNotification) */
2330- size_t size;
2331+ /** set to sizeof(UHardwareGpsNiNotification) */
2332+ size_t size;
2333
2334 /**
2335 * An ID generated by HAL to associate NI notifications and UI
2336 * responses
2337 */
2338- int notification_id;
2339+ int notification_id;
2340
2341 /**
2342 * An NI type used to distinguish different categories of NI
2343- * events, such as UBUNTU_GPS_NI_TYPE_VOICE, UBUNTU_GPS_NI_TYPE_UMTS_SUPL, ...
2344+ * events, such as U_HARDWARE_GPS_NI_TYPE_VOICE, U_HARDWARE_GPS_NI_TYPE_UMTS_SUPL, ...
2345 */
2346- uint32_t ni_type;
2347+ uint32_t ni_type;
2348
2349 /**
2350- * Notification/verification options, combinations of UbuntuGpsNiNotifyFlags constants
2351+ * Notification/verification options, combinations of UHardwareGpsNiNotifyFlags constants
2352 */
2353- UbuntuGpsNiNotifyFlags notify_flags;
2354+ UHardwareGpsNiNotifyFlags notify_flags;
2355
2356 /**
2357 * Timeout period to wait for user response.
2358 * Set to 0 for no time out limit.
2359 */
2360- int timeout;
2361+ int timeout;
2362
2363 /**
2364 * Default response when time out.
2365 */
2366- UbuntuGpsUserResponseType default_response;
2367+ UHardwareGpsUserResponseType default_response;
2368
2369 /**
2370 * Requestor ID
2371 */
2372- char requestor_id[UBUNTU_GPS_NI_SHORT_STRING_MAXLEN];
2373+ char requestor_id[U_HARDWARE_GPS_NI_SHORT_STRING_MAXLEN];
2374
2375 /**
2376 * Notification message. It can also be used to store client_id in some cases
2377 */
2378- char text[UBUNTU_GPS_NI_LONG_STRING_MAXLEN];
2379-
2380- /**
2381- * Client name decoding scheme
2382- */
2383- UbuntuGpsNiEncodingType requestor_id_encoding;
2384-
2385- /**
2386- * Client name decoding scheme
2387- */
2388- UbuntuGpsNiEncodingType text_encoding;
2389+ char text[U_HARDWARE_GPS_NI_LONG_STRING_MAXLEN];
2390+
2391+ /**
2392+ * Client name decoding scheme
2393+ */
2394+ UHardwareGpsNiEncodingType requestor_id_encoding;
2395+
2396+ /**
2397+ * Client name decoding scheme
2398+ */
2399+ UHardwareGpsNiEncodingType text_encoding;
2400
2401 /**
2402 * A pointer to extra data. Format:
2403 * key_1 = value_1
2404 * key_2 = value_2
2405 */
2406- char extras[UBUNTU_GPS_NI_LONG_STRING_MAXLEN];
2407-
2408-} UbuntuGpsNiNotification;
2409-
2410-typedef void (* UbuntuGpsLocationCallback)(UbuntuGpsLocation* location, void* context);
2411-typedef void (* UbuntuGpsStatusCallback)(uint16_t status, void* context);
2412-typedef void (* UbuntuGpsSvStatusCallback)(UbuntuGpsSvStatus* sv_info, void* context);
2413-typedef void (* UbuntuGpsNmeaCallback)(int64_t timestamp, const char* nmea, int length, void* context);
2414-typedef void (* UbuntuGpsSetCapabilities)(uint32_t capabilities, void* context);
2415-typedef void (* UbuntuGpsRequestUtcTime)(void* context);
2416+ char extras[U_HARDWARE_GPS_NI_LONG_STRING_MAXLEN];
2417+
2418+} UHardwareGpsNiNotification;
2419+
2420+typedef void (*UHardwareGpsLocationCallback)(UHardwareGpsLocation *location, void *context);
2421+typedef void (*UHardwareGpsStatusCallback)(uint16_t status, void *context);
2422+typedef void (*UHardwareGpsSvStatusCallback)(UHardwareGpsSvStatus *sv_info, void *context);
2423+typedef void (*UHardwareGpsNmeaCallback)(int64_t timestamp, const char *nmea, int length, void *context);
2424+typedef void (*UHardwareGpsSetCapabilities)(uint32_t capabilities, void *context);
2425+typedef void (*UHardwareGpsRequestUtcTime)(void *context);
2426
2427 /** Callback to request the client to download XTRA data.
2428 * The client should download XTRA data and inject it by calling inject_xtra_data().
2429 */
2430-typedef void (* UbuntuGpsXtraDownloadRequest)(void* context);
2431+typedef void (*UHardwareGpsXtraDownloadRequest)(void *context);
2432
2433 /** Callback with AGPS status information.
2434 */
2435-typedef void (* UbuntuAgpsStatusCallback)(UbuntuAgpsStatus* status, void* context);
2436+typedef void (*UHardwareGpsAGpsStatusCallback)(UHardwareGpsAGpsStatus *status, void *context);
2437
2438 /** Callback with NI notification.
2439 */
2440-typedef void (*UbuntuGpsNiNotifyCallback)(UbuntuGpsNiNotification *notification, void* context);
2441+typedef void (*UHardwareGpsNiNotifyCallback)(UHardwareGpsNiNotification *notification, void *context);
2442
2443 /*
2444 Callback for AGPS RIL (Radio Interface Library) set id
2445 */
2446-typedef void (*UbuntuAgpsRilRequestSetId)(uint32_t flags, void* context);
2447-typedef void (*UbuntuAgpsRilRequestRefLoc)(uint32_t flags, void* context);
2448+typedef void (*UHardwareGpsAGpsRilRequestSetId)(uint32_t flags, void *context);
2449+typedef void (*UHardwareGpsAGpsRilRequestRefLoc)(uint32_t flags, void *context);
2450
2451 typedef struct
2452 {
2453
2454- UbuntuGpsLocationCallback location_cb;
2455- UbuntuGpsStatusCallback status_cb;
2456- UbuntuGpsSvStatusCallback sv_status_cb;
2457- UbuntuGpsNmeaCallback nmea_cb;
2458- UbuntuGpsSetCapabilities set_capabilities_cb;
2459- UbuntuGpsRequestUtcTime request_utc_time_cb;
2460-
2461- UbuntuGpsXtraDownloadRequest xtra_download_request_cb;
2462-
2463- UbuntuAgpsStatusCallback agps_status_cb;
2464-
2465- UbuntuGpsNiNotifyCallback gps_ni_notify_cb;
2466-
2467- UbuntuAgpsRilRequestSetId request_setid_cb;
2468- UbuntuAgpsRilRequestRefLoc request_refloc_cb;
2469+ UHardwareGpsLocationCallback location_cb;
2470+ UHardwareGpsStatusCallback status_cb;
2471+ UHardwareGpsSvStatusCallback sv_status_cb;
2472+ UHardwareGpsNmeaCallback nmea_cb;
2473+ UHardwareGpsSetCapabilities set_capabilities_cb;
2474+ UHardwareGpsRequestUtcTime request_utc_time_cb;
2475+
2476+ UHardwareGpsXtraDownloadRequest xtra_download_request_cb;
2477+
2478+ UHardwareGpsAGpsStatusCallback agps_status_cb;
2479+
2480+ UHardwareGpsNiNotifyCallback gps_ni_notify_cb;
2481+
2482+ UHardwareGpsAGpsRilRequestSetId request_setid_cb;
2483+ UHardwareGpsAGpsRilRequestRefLoc request_refloc_cb;
2484
2485 void* context;
2486-} UbuntuGpsParams;
2487+} UHardwareGpsParams;
2488
2489 /*
2490 You must create only one instance per process/application.
2491 */
2492-UbuntuGps ubuntu_gps_new(UbuntuGpsParams* params);
2493-void ubuntu_gps_delete(UbuntuGps handle);
2494-
2495-bool ubuntu_gps_start(UbuntuGps self);
2496-bool ubuntu_gps_stop(UbuntuGps self);
2497+UHardwareGps
2498+u_hardware_gps_new(UHardwareGpsParams *params);
2499+
2500+void
2501+u_hardware_gps_delete(UHardwareGps handle);
2502+
2503+bool
2504+u_hardware_gps_start(UHardwareGps self);
2505+
2506+bool
2507+u_hardware_gps_stop(UHardwareGps self);
2508
2509 /*
2510 \param time NTP time, in milliseconds since Jan 1st 1970.
2511 \param time_reference time from the internal clock at the moment that NTP time was taken.
2512 \param uncertainty possible deviation in the time supplied (uncertainty) in milliseconds.
2513 */
2514-void ubuntu_gps_inject_time(UbuntuGps self, int64_t time, int64_t time_reference, int uncertainty);
2515-
2516-void ubuntu_gps_inject_location(UbuntuGps self, double latitude, double longitude, float accuracy);
2517-void ubuntu_gps_delete_aiding_data(UbuntuGps self, uint16_t flags);
2518+void
2519+u_hardware_gps_inject_time(
2520+ UHardwareGps self,
2521+ int64_t time,
2522+ int64_t time_reference,
2523+ int uncertainty);
2524+
2525+void
2526+u_hardware_gps_inject_location(
2527+ UHardwareGps self,
2528+ double latitude,
2529+ double longitude,
2530+ float accuracy);
2531+
2532+void
2533+u_hardware_gps_delete_aiding_data(
2534+ UHardwareGps self,
2535+ uint16_t flags);
2536
2537 /*
2538- \param mode One of the UBUNTU_GPS_POSITION_MODE_* values
2539- \param recurrence One of the UBUNTU_GPS_POSITION_RECURRENCE_* values
2540+ \param mode One of the U_HARDWARE_GPS_POSITION_MODE_* values
2541+ \param recurrence One of the U_HARDWARE_GPS_POSITION_RECURRENCE_* values
2542 \param min_interval represents the time between fixes in milliseconds.
2543 \param preferred_accuracy The requested fix accuracy in meters. Can be zero.
2544 \param preferred_time The requested time to first fix in milliseconds. Can be zero.
2545 */
2546-bool ubuntu_gps_set_position_mode(UbuntuGps self, uint32_t mode, uint32_t recurrence,
2547- uint32_t min_interval, uint32_t preferred_accuracy,
2548- uint32_t preferred_time);
2549-void ubuntu_gps_inject_xtra_data(UbuntuGps self, char* data, int length);
2550+bool
2551+u_hardware_gps_set_position_mode(
2552+ UHardwareGps self,
2553+ uint32_t mode,
2554+ uint32_t recurrence,
2555+ uint32_t min_interval,
2556+ uint32_t preferred_accuracy,
2557+ uint32_t preferred_time);
2558+
2559+void
2560+u_hardware_gps_inject_xtra_data(
2561+ UHardwareGps self,
2562+ char* data,
2563+ int length);
2564
2565 #ifdef __cplusplus
2566 }
2567 #endif
2568
2569-#endif // UBUNTU_APPLICATION_GPS_H_
2570+#endif // UBUNTU_HARDWARE_GPS_H_
2571
2572=== modified file 'include/ubuntu/status.h'
2573--- include/ubuntu/status.h 2013-05-30 02:03:42 +0000
2574+++ include/ubuntu/status.h 2013-07-05 09:17:25 +0000
2575@@ -20,10 +20,15 @@
2576 #ifndef UBUNTU_STATUS_H_
2577 #define UBUNTU_STATUS_H_
2578
2579+/**
2580+ * \brief Indicates the status of an operation.
2581+ */
2582 typedef enum
2583 {
2584- U_STATUS_SUCCESS,
2585- U_STATUS_ERROR
2586-} UStatus;
2587+ U_STATUS_SUCCESS, ///< Operation finished successfully.
2588+ U_STATUS_ERROR ///< Operation finished with an error.
2589+} UbuntuStatus;
2590+
2591+typedef UbuntuStatus UStatus;
2592
2593 #endif /* UBUNTU_STATUS_H_ */
2594
2595=== modified file 'include/ubuntu/unit.h'
2596--- include/ubuntu/unit.h 2013-05-27 17:09:02 +0000
2597+++ include/ubuntu/unit.h 2013-07-05 09:17:25 +0000
2598@@ -20,13 +20,16 @@
2599 #ifndef UBUNTU_UNIT_H_
2600 #define UBUNTU_UNIT_H_
2601
2602+/**
2603+ * \brief Describes units known to the platform integration layer.
2604+ */
2605 typedef enum
2606 {
2607- U_DEGREE,
2608- U_METER,
2609- U_SECOND,
2610- U_METER_PER_SECOND,
2611- U_MICRO_TESLA
2612+ U_DEGREE,
2613+ U_METER,
2614+ U_SECOND,
2615+ U_METER_PER_SECOND,
2616+ U_MICRO_TESLA
2617 } UbuntuUnit;
2618
2619 typedef UbuntuUnit UUnit;
2620
2621=== modified file 'src/hybris/CMakeLists.txt'
2622--- src/hybris/CMakeLists.txt 2013-06-20 12:23:48 +0000
2623+++ src/hybris/CMakeLists.txt 2013-07-05 09:17:25 +0000
2624@@ -1,14 +1,15 @@
2625-set(SOURCES
2626- hybris_bridge.cpp
2627+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x")
2628+
2629+add_library(
2630+ ubuntu_application_api SHARED
2631+
2632 ubuntu_application_api_hybris.cpp
2633 ubuntu_application_sensors_hybris.cpp
2634 )
2635
2636-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x")
2637-
2638 add_library(
2639- ubuntu_application_api SHARED
2640- ${SOURCES}
2641+ ubuntu_platform_hardware_api SHARED
2642+ ubuntu_platform_hardware_api.cpp
2643 )
2644
2645 include_directories(
2646@@ -20,6 +21,11 @@
2647 hybris-common
2648 )
2649
2650+target_link_libraries(
2651+ ubuntu_platform_hardware_api
2652+ hybris-common
2653+)
2654+
2655 set_target_properties(
2656 ubuntu_application_api
2657 PROPERTIES
2658@@ -27,8 +33,21 @@
2659 SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
2660 )
2661
2662+set_target_properties(
2663+ ubuntu_platform_hardware_api
2664+ PROPERTIES
2665+ VERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}.${UBUNTU_PLATFORM_API_VERSION_MINOR}.${UBUNTU_PLATFORM_API_VERSION_PATCH}
2666+ SOVERSION ${UBUNTU_PLATFORM_API_VERSION_MAJOR}
2667+)
2668+
2669 install(
2670 TARGETS ubuntu_application_api
2671- ${INSTALL_TARGETS_DEFAULT_ARGS})
2672+ ${INSTALL_TARGETS_DEFAULT_ARGS}
2673+)
2674+
2675+install(
2676+ TARGETS ubuntu_platform_hardware_api
2677+ ${INSTALL_TARGETS_DEFAULT_ARGS}
2678+)
2679
2680 add_subdirectory(tests/)
2681
2682=== added file 'src/hybris/bridge.h'
2683--- src/hybris/bridge.h 1970-01-01 00:00:00 +0000
2684+++ src/hybris/bridge.h 2013-07-05 09:17:25 +0000
2685@@ -0,0 +1,200 @@
2686+/*
2687+ * Copyright (C) 2012 Canonical Ltd
2688+ *
2689+ * This program is free software: you can redistribute it and/or modify
2690+ * it under the terms of the GNU Lesser General Public License version 3 as
2691+ * published by the Free Software Foundation.
2692+ *
2693+ * This program is distributed in the hope that it will be useful,
2694+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2695+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2696+ * GNU Lesser General Public License for more details.
2697+ *
2698+ * You should have received a copy of the GNU Lesser General Public License
2699+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2700+ *
2701+ * Authored by: Thomas Voss <thomas.voss@canonical.com>
2702+ * Ricardo Mendoza <ricardo.mendoza@canonical.com>
2703+ */
2704+#ifndef BRIDGE_H_
2705+#define BRIDGE_H_
2706+
2707+#include <assert.h>
2708+#include <dlfcn.h>
2709+#include <stddef.h>
2710+
2711+#ifdef __cplusplus
2712+extern "C" {
2713+#endif
2714+
2715+extern void *android_dlopen(const char *filename, int flag);
2716+extern void *android_dlsym(void *handle, const char *symbol);
2717+
2718+#ifdef __cplusplus
2719+}
2720+#endif
2721+
2722+namespace internal
2723+{
2724+
2725+struct ToApplication
2726+{
2727+ static const char* path()
2728+ {
2729+ return "/system/lib/libubuntu_application_api.so";
2730+ }
2731+};
2732+
2733+struct ToHardware
2734+{
2735+ static const char* path()
2736+ {
2737+ return "/system/lib/libubuntu_platform_hardware_api.so";
2738+ }
2739+};
2740+
2741+template<typename Scope = ToApplication>
2742+class Bridge
2743+{
2744+ public:
2745+ static Bridge<Scope>& instance()
2746+ {
2747+ static Bridge<Scope> bridge;
2748+ return bridge;
2749+ }
2750+
2751+ void* resolve_symbol(const char* symbol) const
2752+ {
2753+ return android_dlsym(lib_handle, symbol);
2754+ }
2755+
2756+ protected:
2757+ Bridge() : lib_handle(android_dlopen(Scope::path(), RTLD_LAZY))
2758+ {
2759+ assert(lib_handle && "Error loading ubuntu_application_api");
2760+ }
2761+
2762+ ~Bridge()
2763+ {
2764+ // TODO android_dlclose(libcamera_handle);
2765+ }
2766+
2767+ void* lib_handle;
2768+};
2769+
2770+}
2771+
2772+#ifdef __cplusplus
2773+extern "C" {
2774+#endif
2775+
2776+/**********************************************************/
2777+/*********** Implementation starts here *******************/
2778+/**********************************************************/
2779+
2780+#define DLSYM(fptr, sym) if (*(fptr) == NULL) { *((void**)fptr) = (void *) internal::Bridge<>::instance().resolve_symbol(sym); }
2781+
2782+#define IMPLEMENT_FUNCTION0(return_type, symbol) \
2783+ return_type symbol() \
2784+ { \
2785+ static return_type (*f)() = NULL; \
2786+ DLSYM(&f, #symbol); \
2787+ return f();}
2788+
2789+#define IMPLEMENT_VOID_FUNCTION0(symbol) \
2790+ void symbol() \
2791+ { \
2792+ static void (*f)() = NULL; \
2793+ DLSYM(&f, #symbol); \
2794+ f();}
2795+
2796+#define IMPLEMENT_FUNCTION1(return_type, symbol, arg1) \
2797+ return_type symbol(arg1 _1) \
2798+ { \
2799+ static return_type (*f)(arg1) = NULL; \
2800+ DLSYM(&f, #symbol); \
2801+ return f(_1); }
2802+
2803+#define IMPLEMENT_SF_FUNCTION1(return_type, symbol, arg1) \
2804+ return_type symbol(arg1 _1) \
2805+ { \
2806+ static return_type (*f)(arg1) __attribute__((pcs("aapcs"))) = NULL; \
2807+ DLSYM(&f, #symbol); \
2808+ return f(_1); }
2809+
2810+
2811+#define IMPLEMENT_VOID_FUNCTION1(symbol, arg1) \
2812+ void symbol(arg1 _1) \
2813+ { \
2814+ static void (*f)(arg1) = NULL; \
2815+ DLSYM(&f, #symbol); \
2816+ f(_1); }
2817+
2818+#define IMPLEMENT_FUNCTION2(return_type, symbol, arg1, arg2) \
2819+ return_type symbol(arg1 _1, arg2 _2) \
2820+ { \
2821+ static return_type (*f)(arg1, arg2) = NULL; \
2822+ DLSYM(&f, #symbol); \
2823+ return f(_1, _2); }
2824+
2825+#define IMPLEMENT_VOID_FUNCTION2(symbol, arg1, arg2) \
2826+ void symbol(arg1 _1, arg2 _2) \
2827+ { \
2828+ static void (*f)(arg1, arg2) = NULL; \
2829+ DLSYM(&f, #symbol); \
2830+ f(_1, _2); }
2831+
2832+#define IMPLEMENT_FUNCTION3(return_type, symbol, arg1, arg2, arg3) \
2833+ return_type symbol(arg1 _1, arg2 _2, arg3 _3) \
2834+ { \
2835+ static return_type (*f)(arg1, arg2, arg3) = NULL; \
2836+ DLSYM(&f, #symbol); \
2837+ return f(_1, _2, _3); }
2838+
2839+#define IMPLEMENT_VOID_FUNCTION3(symbol, arg1, arg2, arg3) \
2840+ void symbol(arg1 _1, arg2 _2, arg3 _3) \
2841+ { \
2842+ static void (*f)(arg1, arg2, arg3) = NULL; \
2843+ DLSYM(&f, #symbol); \
2844+ f(_1, _2, _3); }
2845+
2846+#define IMPLEMENT_VOID_FUNCTION4(symbol, arg1, arg2, arg3, arg4) \
2847+ void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4) \
2848+ { \
2849+ static void (*f)(arg1, arg2, arg3, arg4) = NULL; \
2850+ DLSYM(&f, #symbol); \
2851+ f(_1, _2, _3, _4); }
2852+
2853+#define IMPLEMENT_FUNCTION4(return_type, symbol, arg1, arg2, arg3, arg4) \
2854+ return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4) \
2855+ { \
2856+ static return_type (*f)(arg1, arg2, arg3, arg4) = NULL; \
2857+ DLSYM(&f, #symbol); \
2858+ return f(_1, _2, _3, _4); }
2859+
2860+#define IMPLEMENT_FUNCTION6(return_type, symbol, arg1, arg2, arg3, arg4, arg5, arg6) \
2861+ return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6) \
2862+ { \
2863+ static return_type (*f)(arg1, arg2, arg3, arg4, arg5, arg6) = NULL; \
2864+ DLSYM(&f, #symbol); \
2865+ return f(_1, _2, _3, _4, _5, _6); }
2866+
2867+#define IMPLEMENT_VOID_FUNCTION7(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
2868+ void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7) \
2869+ { \
2870+ static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7) = NULL; \
2871+ DLSYM(&f, #symbol); \
2872+ f(_1, _2, _3, _4, _5, _6, _7); }
2873+
2874+#define IMPLEMENT_VOID_FUNCTION8(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
2875+ void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7, arg8 _8) \
2876+ { \
2877+ static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) = NULL; \
2878+ DLSYM(&f, #symbol); \
2879+ f(_1, _2, _3, _4, _5, _6, _7, _8); }
2880+
2881+#ifdef __cplusplus
2882+}
2883+#endif
2884+
2885+#endif // BRIDGE_H_
2886
2887=== removed file 'src/hybris/hybris_bridge.cpp'
2888--- src/hybris/hybris_bridge.cpp 2013-06-05 22:34:41 +0000
2889+++ src/hybris/hybris_bridge.cpp 1970-01-01 00:00:00 +0000
2890@@ -1,59 +0,0 @@
2891-/*
2892- * Copyright (C) 2013 Canonical Ltd
2893- *
2894- * This program is free software: you can redistribute it and/or modify
2895- * it under the terms of the GNU Lesser General Public License version 3 as
2896- * published by the Free Software Foundation.
2897- *
2898- * This program is distributed in the hope that it will be useful,
2899- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2900- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2901- * GNU Lesser General Public License for more details.
2902- *
2903- * You should have received a copy of the GNU Lesser General Public License
2904- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2905- *
2906- * Authored by: Thomas Voss <thomas.voss@canonical.com>
2907- * Ricardo Mendoza <ricardo.mendoza@canonical.com>
2908- */
2909-
2910-#include "hybris_bridge.h"
2911-
2912-#include <dlfcn.h>
2913-#include <assert.h>
2914-
2915-namespace uh = ubuntu::hybris;
2916-
2917-extern "C" {
2918-
2919-extern void *android_dlopen(const char *filename, int flag);
2920-extern void *android_dlsym(void *handle, const char *symbol);
2921-
2922-}
2923-
2924-const char* uh::Bridge::path_to_library()
2925-{
2926- return "/system/lib/libubuntu_application_api.so";
2927-}
2928-
2929-uh::Bridge& uh::Bridge::instance()
2930-{
2931- static uh::Bridge bridge;
2932- return bridge;
2933-}
2934-
2935-uh::Bridge::Bridge()
2936- : lib_handle(android_dlopen(path_to_library(), RTLD_LAZY))
2937-{
2938- assert(lib_handle && "Error loading ubuntu_application_api");
2939-}
2940-
2941-uh::Bridge::~Bridge()
2942-{
2943- // TODO android_dlclose(libcamera_handle);
2944-}
2945-
2946-void* uh::Bridge::resolve_symbol(const char* symbol) const
2947-{
2948- return android_dlsym(lib_handle, symbol);
2949-}
2950
2951=== removed file 'src/hybris/hybris_bridge.h'
2952--- src/hybris/hybris_bridge.h 2013-06-05 23:44:55 +0000
2953+++ src/hybris/hybris_bridge.h 1970-01-01 00:00:00 +0000
2954@@ -1,148 +0,0 @@
2955-/*
2956- * Copyright (C) 2013 Canonical Ltd
2957- *
2958- * This program is free software: you can redistribute it and/or modify
2959- * it under the terms of the GNU Lesser General Public License version 3 as
2960- * published by the Free Software Foundation.
2961- *
2962- * This program is distributed in the hope that it will be useful,
2963- * but WITHOUT ANY WARRANTY; without even the implied warranty of
2964- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2965- * GNU Lesser General Public License for more details.
2966- *
2967- * You should have received a copy of the GNU Lesser General Public License
2968- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2969- *
2970- * Authored by: Thomas Voss <thomas.voss@canonical.com>
2971- * Ricardo Mendoza <ricardo.mendoza@canonical.com>
2972- */
2973-
2974-#ifndef UBUNTU_APPLICATION_API_HYBRIS_BRIDGE_H_
2975-#define UBUNTU_APPLICATION_API_HYBRIS_BRIDGE_H_
2976-
2977-#include <stddef.h>
2978-
2979-namespace ubuntu
2980-{
2981-namespace hybris
2982-{
2983-
2984-struct Bridge
2985-{
2986- Bridge();
2987- ~Bridge();
2988-
2989- static const char* path_to_library();
2990- static Bridge& instance();
2991-
2992- void* resolve_symbol(const char* symbol) const;
2993-
2994- void* lib_handle;
2995-};
2996-
2997-}
2998-}
2999-
3000-// Sweet and beautiful music.
3001-#define DLSYM(fptr, sym) if (*(fptr) == NULL) { *((void**)fptr) = (void *) ubuntu::hybris::Bridge::instance().resolve_symbol(sym); }
3002-
3003-#define IMPLEMENT_FUNCTION0(return_type, symbol) \
3004- return_type symbol() \
3005- { \
3006- static return_type (*f)() = NULL; \
3007- DLSYM(&f, #symbol); \
3008- return f();}
3009-
3010-#define IMPLEMENT_VOID_FUNCTION0(symbol) \
3011- void symbol() \
3012- { \
3013- static void (*f)() = NULL; \
3014- DLSYM(&f, #symbol); \
3015- f();}
3016-
3017-#define IMPLEMENT_FUNCTION1(return_type, symbol, arg1) \
3018- return_type symbol(arg1 _1) \
3019- { \
3020- static return_type (*f)(arg1) = NULL; \
3021- DLSYM(&f, #symbol); \
3022- return f(_1); }
3023-
3024-#define IMPLEMENT_SF_FUNCTION1(return_type, symbol, arg1) \
3025- return_type symbol(arg1 _1) \
3026- { \
3027- static return_type (*f)(arg1) __attribute__((pcs("aapcs"))) = NULL; \
3028- DLSYM(&f, #symbol); \
3029- return f(_1); }
3030-
3031-
3032-#define IMPLEMENT_VOID_FUNCTION1(symbol, arg1) \
3033- void symbol(arg1 _1) \
3034- { \
3035- static void (*f)(arg1) = NULL; \
3036- DLSYM(&f, #symbol); \
3037- f(_1); }
3038-
3039-#define IMPLEMENT_FUNCTION2(return_type, symbol, arg1, arg2) \
3040- return_type symbol(arg1 _1, arg2 _2) \
3041- { \
3042- static return_type (*f)(arg1, arg2) = NULL; \
3043- DLSYM(&f, #symbol); \
3044- return f(_1, _2); }
3045-
3046-#define IMPLEMENT_VOID_FUNCTION2(symbol, arg1, arg2) \
3047- void symbol(arg1 _1, arg2 _2) \
3048- { \
3049- static void (*f)(arg1, arg2) = NULL; \
3050- DLSYM(&f, #symbol); \
3051- f(_1, _2); }
3052-
3053-#define IMPLEMENT_FUNCTION3(return_type, symbol, arg1, arg2, arg3) \
3054- return_type symbol(arg1 _1, arg2 _2, arg3 _3) \
3055- { \
3056- static return_type (*f)(arg1, arg2, arg3) = NULL; \
3057- DLSYM(&f, #symbol); \
3058- return f(_1, _2, _3); }
3059-
3060-#define IMPLEMENT_VOID_FUNCTION3(symbol, arg1, arg2, arg3) \
3061- void symbol(arg1 _1, arg2 _2, arg3 _3) \
3062- { \
3063- static void (*f)(arg1, arg2, arg3) = NULL; \
3064- DLSYM(&f, #symbol); \
3065- f(_1, _2, _3); }
3066-
3067-#define IMPLEMENT_VOID_FUNCTION4(symbol, arg1, arg2, arg3, arg4) \
3068- void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4) \
3069- { \
3070- static void (*f)(arg1, arg2, arg3, arg4) = NULL; \
3071- DLSYM(&f, #symbol); \
3072- f(_1, _2, _3, _4); }
3073-
3074-#define IMPLEMENT_FUNCTION4(return_type, symbol, arg1, arg2, arg3, arg4) \
3075- return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4) \
3076- { \
3077- static return_type (*f)(arg1, arg2, arg3, arg4) = NULL; \
3078- DLSYM(&f, #symbol); \
3079- return f(_1, _2, _3, _4); }
3080-
3081-#define IMPLEMENT_FUNCTION6(return_type, symbol, arg1, arg2, arg3, arg4, arg5, arg6) \
3082- return_type symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6) \
3083- { \
3084- static return_type (*f)(arg1, arg2, arg3, arg4, arg5, arg6) = NULL; \
3085- DLSYM(&f, #symbol); \
3086- return f(_1, _2, _3, _4, _5, _6); }
3087-
3088-#define IMPLEMENT_VOID_FUNCTION7(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7) \
3089- void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7) \
3090- { \
3091- static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7) = NULL; \
3092- DLSYM(&f, #symbol); \
3093- f(_1, _2, _3, _4, _5, _6, _7); }
3094-
3095-#define IMPLEMENT_VOID_FUNCTION8(symbol, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) \
3096- void symbol(arg1 _1, arg2 _2, arg3 _3, arg4 _4, arg5 _5, arg6 _6, arg7 _7, arg8 _8) \
3097- { \
3098- static void (*f)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) = NULL; \
3099- DLSYM(&f, #symbol); \
3100- f(_1, _2, _3, _4, _5, _6, _7, _8); }
3101-
3102-#endif // UBUNTU_APPLICATION_API_HYBRIS_BRIDGE_H_
3103
3104=== modified file 'src/hybris/tests/CMakeLists.txt'
3105--- src/hybris/tests/CMakeLists.txt 2013-06-03 20:54:26 +0000
3106+++ src/hybris/tests/CMakeLists.txt 2013-07-05 09:17:25 +0000
3107@@ -4,7 +4,7 @@
3108 target_link_libraries(test_android_ubuntu_app_api ubuntu_application_api EGL GLESv2)
3109
3110 add_executable(test_android_gps_api test_gps_api.cpp)
3111-target_link_libraries(test_android_gps_api ubuntu_application_api)
3112+target_link_libraries(test_android_gps_api ubuntu_platform_hardware_api)
3113
3114 add_executable(test_android_ubuntu_app_api_multiple_surfaces test_multiple_surfaces_event_delivery.cpp)
3115 target_link_libraries(test_android_ubuntu_app_api_multiple_surfaces ubuntu_application_api EGL GLESv2)
3116
3117=== modified file 'src/hybris/tests/test_gps_api.cpp'
3118--- src/hybris/tests/test_gps_api.cpp 2013-02-05 08:01:14 +0000
3119+++ src/hybris/tests/test_gps_api.cpp 2013-07-05 09:17:25 +0000
3120@@ -15,7 +15,7 @@
3121 *
3122 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
3123 */
3124-#include <ubuntu/application/ubuntu_application_gps.h>
3125+#include <ubuntu/hardware/gps.h>
3126
3127 #include <ctime>
3128 #include <signal.h>
3129@@ -23,6 +23,8 @@
3130 #include <string.h>
3131 #include <unistd.h>
3132
3133+namespace ubuntu
3134+{
3135 class GPSTest
3136 {
3137 public:
3138@@ -32,10 +34,10 @@
3139 bool stop();
3140 void inject_time();
3141
3142- UbuntuGps ubuntu_gps;
3143+ UHardwareGps u_hardware_gps;
3144 };
3145
3146-void gps_location_cb(UbuntuGpsLocation* location, void* context)
3147+void gps_location_cb(UHardwareGpsLocation* location, void* context)
3148 {
3149 printf("gps_location_cb() called.\n");
3150 }
3151@@ -44,26 +46,26 @@
3152 {
3153 switch(status)
3154 {
3155- case UBUNTU_GPS_STATUS_NONE:
3156+ case U_HARDWARE_GPS_STATUS_NONE:
3157 printf("status: None\n");
3158 break;
3159- case UBUNTU_GPS_STATUS_SESSION_BEGIN:
3160+ case U_HARDWARE_GPS_STATUS_SESSION_BEGIN:
3161 printf("status: Session Begin\n");
3162 break;
3163- case UBUNTU_GPS_STATUS_SESSION_END:
3164+ case U_HARDWARE_GPS_STATUS_SESSION_END:
3165 printf("status: Session End\n");
3166 break;
3167- case UBUNTU_GPS_STATUS_ENGINE_ON:
3168+ case U_HARDWARE_GPS_STATUS_ENGINE_ON:
3169 printf("status: Engine On\n");
3170 break;
3171- case UBUNTU_GPS_STATUS_ENGINE_OFF:
3172+ case U_HARDWARE_GPS_STATUS_ENGINE_OFF:
3173 printf("status: Engine Off\n");
3174 default:
3175 break;
3176 };
3177 }
3178
3179-void gps_sb_status_cb(UbuntuGpsSvStatus* sv_info, void* context)
3180+void gps_sb_status_cb(UHardwareGpsSvStatus* sv_info, void* context)
3181 {
3182 printf("gps_sb_status_cb() called, listing %d space vehicles\n", sv_info->num_svs);
3183 }
3184@@ -80,15 +82,15 @@
3185 {
3186 printf("gps_set_cabapilities_cb() -");
3187
3188- if (capabilities & UBUNTU_GPS_CAPABILITY_SCHEDULING)
3189+ if (capabilities & U_HARDWARE_GPS_CAPABILITY_SCHEDULING)
3190 printf(" scheduling");
3191- if (capabilities & UBUNTU_GPS_CAPABILITY_MSB)
3192+ if (capabilities & U_HARDWARE_GPS_CAPABILITY_MSB)
3193 printf(" MSB");
3194- if (capabilities & UBUNTU_GPS_CAPABILITY_MSA)
3195+ if (capabilities & U_HARDWARE_GPS_CAPABILITY_MSA)
3196 printf(" MSA");
3197- if (capabilities & UBUNTU_GPS_CAPABILITY_SINGLE_SHOT)
3198+ if (capabilities & U_HARDWARE_GPS_CAPABILITY_SINGLE_SHOT)
3199 printf(" 'single shot'");
3200- if (capabilities & UBUNTU_GPS_CAPABILITY_ON_DEMAND_TIME)
3201+ if (capabilities & U_HARDWARE_GPS_CAPABILITY_ON_DEMAND_TIME)
3202 printf(" 'on demand time'");
3203
3204 printf("\n");
3205@@ -105,31 +107,31 @@
3206 printf("gps_xtra_download_request_cb() called.\n");
3207 }
3208
3209-void agps_status_cb(UbuntuAgpsStatus* status, void* context)
3210+void agps_status_cb(UHardwareGpsAGpsStatus* status, void* context)
3211 {
3212 printf("agps status -");
3213
3214- if (status->type == UBUNTU_AGPS_TYPE_SUPL)
3215+ if (status->type == U_HARDWARE_GPS_AGPS_TYPE_SUPL)
3216 printf(" SUPL");
3217 else
3218 printf(" C2K");
3219
3220 switch (status->status)
3221 {
3222- case UBUNTU_GPS_REQUEST_AGPS_DATA_CONN:
3223+ case U_HARDWARE_GPS_REQUEST_AGPS_DATA_CONN:
3224 printf(", request AGPS data connection");
3225 break;
3226- case UBUNTU_GPS_RELEASE_AGPS_DATA_CONN:
3227+ case U_HARDWARE_GPS_RELEASE_AGPS_DATA_CONN:
3228 printf(", release AGPS data connection");
3229 break;
3230- case UBUNTU_GPS_AGPS_DATA_CONNECTED:
3231+ case U_HARDWARE_GPS_AGPS_DATA_CONNECTED:
3232 printf(", request AGPS data connected");
3233 break;
3234- case UBUNTU_GPS_AGPS_DATA_CONN_DONE:
3235+ case U_HARDWARE_GPS_AGPS_DATA_CONN_DONE:
3236 printf(", AGPS data connection done");
3237 break;
3238 default:
3239- case UBUNTU_GPS_AGPS_DATA_CONN_FAILED:
3240+ case U_HARDWARE_GPS_AGPS_DATA_CONN_FAILED:
3241 printf(", AGPS data connection failed");
3242 break;
3243 }
3244@@ -137,7 +139,7 @@
3245 printf(" ipaddr=%u\n", status->ipaddr);
3246 }
3247
3248-void gps_notify_cb(UbuntuGpsNiNotification *notification, void* context)
3249+void gps_notify_cb(UHardwareGpsNiNotification *notification, void* context)
3250 {
3251 printf("gps_notify_cb() called.\n");
3252 }
3253@@ -153,14 +155,14 @@
3254 }
3255
3256 GPSTest::GPSTest()
3257- : ubuntu_gps(NULL)
3258+ : u_hardware_gps(NULL)
3259 {
3260 }
3261
3262 GPSTest::~GPSTest()
3263 {
3264- if (ubuntu_gps)
3265- ubuntu_gps_delete(ubuntu_gps);
3266+ if (u_hardware_gps)
3267+ u_hardware_gps_delete(u_hardware_gps);
3268 }
3269
3270 void GPSTest::inject_time()
3271@@ -168,7 +170,7 @@
3272 // A real implementation would inject time from some NTP server.
3273 time_t t = time(0);
3274 int64_t time_millis = (int64_t)t * (int64_t)1000;
3275- ubuntu_gps_inject_time(ubuntu_gps,
3276+ u_hardware_gps_inject_time(u_hardware_gps,
3277 time_millis /*NTP time would go here*/,
3278 time_millis /*internal time when that NTP time was taken*/,
3279 10 /* possible deviation, in milliseconds*/);
3280@@ -176,7 +178,7 @@
3281
3282 bool GPSTest::init_and_start()
3283 {
3284- UbuntuGpsParams gps_params;
3285+ UHardwareGpsParams gps_params;
3286
3287 gps_params.location_cb = gps_location_cb;
3288 gps_params.status_cb = gps_status_cb;
3289@@ -191,14 +193,14 @@
3290 gps_params.request_refloc_cb = agps_ril_request_refloc_cb;
3291 gps_params.context = this;
3292
3293- UbuntuGps ubuntu_gps = ubuntu_gps_new(&gps_params);
3294- if (!ubuntu_gps)
3295+ UHardwareGps u_hardware_gps = u_hardware_gps_new(&gps_params);
3296+ if (!u_hardware_gps)
3297 {
3298 printf("GPS creation failed!\n");
3299 return false;
3300 }
3301
3302- bool ok = ubuntu_gps_start(ubuntu_gps);
3303+ bool ok = u_hardware_gps_start(u_hardware_gps);
3304 if (!ok)
3305 {
3306 printf("GPS start up failed!\n");
3307@@ -210,12 +212,13 @@
3308
3309 bool GPSTest::stop()
3310 {
3311- bool ok = ubuntu_gps_stop(ubuntu_gps);
3312+ bool ok = u_hardware_gps_stop(u_hardware_gps);
3313 if (!ok)
3314 printf("failed when stopping GPS!\n");
3315
3316 return ok;
3317 }
3318+}
3319
3320 void wait_for_sigint()
3321 {
3322@@ -232,7 +235,7 @@
3323 int main(int argc, char** argv)
3324 {
3325 int return_value = 0;
3326- GPSTest test;
3327+ ubuntu::GPSTest test;
3328
3329 if (!test.init_and_start())
3330 return 1;
3331
3332=== modified file 'src/hybris/ubuntu_application_api_hybris.cpp'
3333--- src/hybris/ubuntu_application_api_hybris.cpp 2013-06-18 00:05:11 +0000
3334+++ src/hybris/ubuntu_application_api_hybris.cpp 2013-07-05 09:17:25 +0000
3335@@ -19,7 +19,6 @@
3336
3337 #include <private/application/ui/ubuntu_application_ui.h>
3338
3339-#include <ubuntu/application/ubuntu_application_gps.h>
3340 #include <ubuntu/ui/ubuntu_ui_session_service.h>
3341
3342 // C APIs
3343@@ -30,21 +29,12 @@
3344 #include <ubuntu/application/ui/clipboard.h>
3345 #include <ubuntu/application/ui/display.h>
3346
3347-#include <assert.h>
3348-#include <dlfcn.h>
3349-#include <stddef.h>
3350-
3351-#include "hybris_bridge.h"
3352+#include "bridge.h"
3353
3354 #ifdef __cplusplus
3355 extern "C" {
3356 #endif
3357
3358-/**********************************************************/
3359-/*********** Implementation starts here *******************/
3360-/**********************************************************/
3361-
3362-
3363 // Session helpers
3364 IMPLEMENT_FUNCTION0(UAUiSessionProperties*, ua_ui_session_properties_new);
3365 IMPLEMENT_VOID_FUNCTION2(ua_ui_session_properties_set_type, UAUiSessionProperties*, UAUiSessionType);
3366@@ -135,18 +125,6 @@
3367 IMPLEMENT_VOID_FUNCTION0(ubuntu_ui_report_notification_invisible);
3368 IMPLEMENT_VOID_FUNCTION1(ubuntu_ui_install_task_controller, ubuntu_ui_task_controller*);
3369
3370-// GPS
3371-IMPLEMENT_FUNCTION1(UbuntuGps, ubuntu_gps_new, UbuntuGpsParams*);
3372-IMPLEMENT_VOID_FUNCTION1(ubuntu_gps_delete, UbuntuGps);
3373-IMPLEMENT_FUNCTION1(bool, ubuntu_gps_start, UbuntuGps);
3374-IMPLEMENT_FUNCTION1(bool, ubuntu_gps_stop, UbuntuGps);
3375-IMPLEMENT_VOID_FUNCTION4(ubuntu_gps_inject_time, UbuntuGps, int64_t, int64_t, int);
3376-IMPLEMENT_VOID_FUNCTION4(ubuntu_gps_inject_location, UbuntuGps, double, double, float);
3377-IMPLEMENT_VOID_FUNCTION2(ubuntu_gps_delete_aiding_data, UbuntuGps, uint16_t);
3378-IMPLEMENT_FUNCTION6(bool, ubuntu_gps_set_position_mode, UbuntuGps, uint32_t, uint32_t,
3379- uint32_t, uint32_t, uint32_t);
3380-IMPLEMENT_VOID_FUNCTION3(ubuntu_gps_inject_xtra_data, UbuntuGps, char*, int);
3381-
3382 #ifdef __cplusplus
3383 }
3384 #endif
3385
3386=== modified file 'src/hybris/ubuntu_application_sensors_hybris.cpp'
3387--- src/hybris/ubuntu_application_sensors_hybris.cpp 2013-06-05 22:59:25 +0000
3388+++ src/hybris/ubuntu_application_sensors_hybris.cpp 2013-07-05 09:17:25 +0000
3389@@ -21,7 +21,7 @@
3390 #include <ubuntu/application/sensors/proximity.h>
3391 #include <ubuntu/application/sensors/light.h>
3392
3393-#include "hybris_bridge.h"
3394+#include "bridge.h"
3395
3396 // Ubuntu Application Sensors
3397
3398
3399=== added file 'src/hybris/ubuntu_platform_hardware_api.cpp'
3400--- src/hybris/ubuntu_platform_hardware_api.cpp 1970-01-01 00:00:00 +0000
3401+++ src/hybris/ubuntu_platform_hardware_api.cpp 2013-07-05 09:17:25 +0000
3402@@ -0,0 +1,78 @@
3403+/*
3404+ * Copyright (C) 2012 Canonical Ltd
3405+ *
3406+ * This program is free software: you can redistribute it and/or modify
3407+ * it under the terms of the GNU Lesser General Public License version 3 as
3408+ * published by the Free Software Foundation.
3409+ *
3410+ * This program is distributed in the hope that it will be useful,
3411+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3412+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3413+ * GNU Lesser General Public License for more details.
3414+ *
3415+ * You should have received a copy of the GNU Lesser General Public License
3416+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3417+ *
3418+ * Authored by: Thomas Voss <thomas.voss@canonical.com>
3419+ * Ricardo Mendoza <ricardo.mendoza@canonical.com>
3420+ */
3421+
3422+// C APIs
3423+#include <ubuntu/hardware/gps.h>
3424+
3425+#include "bridge.h"
3426+
3427+// Hardware - GPS
3428+IMPLEMENT_FUNCTION1(
3429+UHardwareGps,
3430+u_hardware_gps_new,
3431+UHardwareGpsParams*);
3432+
3433+IMPLEMENT_VOID_FUNCTION1(
3434+u_hardware_gps_delete,
3435+UHardwareGps);
3436+
3437+IMPLEMENT_FUNCTION1(
3438+bool,
3439+u_hardware_gps_start,
3440+UHardwareGps);
3441+
3442+IMPLEMENT_FUNCTION1(
3443+bool,
3444+u_hardware_gps_stop,
3445+UHardwareGps);
3446+
3447+IMPLEMENT_VOID_FUNCTION4(
3448+u_hardware_gps_inject_time,
3449+UHardwareGps,
3450+int64_t,
3451+int64_t,
3452+int);
3453+
3454+IMPLEMENT_VOID_FUNCTION4(
3455+u_hardware_gps_inject_location,
3456+UHardwareGps,
3457+double,
3458+double,
3459+float);
3460+
3461+IMPLEMENT_VOID_FUNCTION2(
3462+u_hardware_gps_delete_aiding_data,
3463+UHardwareGps,
3464+uint16_t);
3465+
3466+IMPLEMENT_FUNCTION6(
3467+bool,
3468+u_hardware_gps_set_position_mode,
3469+UHardwareGps,
3470+uint32_t,
3471+uint32_t,
3472+uint32_t,
3473+uint32_t,
3474+uint32_t);
3475+
3476+IMPLEMENT_VOID_FUNCTION3(
3477+u_hardware_gps_inject_xtra_data,
3478+UHardwareGps,
3479+char*,
3480+int);

Subscribers

People subscribed via source and target branches