diff options
Diffstat (limited to 'cython/sbservices.pxi')
| -rw-r--r-- | cython/sbservices.pxi | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/cython/sbservices.pxi b/cython/sbservices.pxi index e826b2a..8ff2595 100644 --- a/cython/sbservices.pxi +++ b/cython/sbservices.pxi | |||
| @@ -8,7 +8,7 @@ cdef extern from "libimobiledevice/sbservices.h": | |||
| 8 | SBSERVICES_E_PLIST_ERROR = -2 | 8 | SBSERVICES_E_PLIST_ERROR = -2 |
| 9 | SBSERVICES_E_CONN_FAILED = -3 | 9 | SBSERVICES_E_CONN_FAILED = -3 |
| 10 | SBSERVICES_E_UNKNOWN_ERROR = -256 | 10 | SBSERVICES_E_UNKNOWN_ERROR = -256 |
| 11 | sbservices_error_t sbservices_client_new(idevice_t device, uint16_t port, sbservices_client_t *client) | 11 | sbservices_error_t sbservices_client_new(idevice_t device, lockdownd_service_descriptor_t descriptor, sbservices_client_t *client) |
| 12 | sbservices_error_t sbservices_client_free(sbservices_client_t client) | 12 | sbservices_error_t sbservices_client_free(sbservices_client_t client) |
| 13 | sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist.plist_t *state, char *format_version) | 13 | sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist.plist_t *state, char *format_version) |
| 14 | sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist.plist_t newstate) | 14 | sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist.plist_t newstate) |
| @@ -28,9 +28,11 @@ cdef class SpringboardServicesError(BaseError): | |||
| 28 | cdef class SpringboardServicesClient(PropertyListService): | 28 | cdef class SpringboardServicesClient(PropertyListService): |
| 29 | __service_name__ = "com.apple.springboardservices" | 29 | __service_name__ = "com.apple.springboardservices" |
| 30 | cdef sbservices_client_t _c_client | 30 | cdef sbservices_client_t _c_client |
| 31 | cdef char* format_version | ||
| 31 | 32 | ||
| 32 | def __cinit__(self, iDevice device not None, int port, *args, **kwargs): | 33 | def __cinit__(self, iDevice device not None, LockdownServiceDescriptor descriptor, *args, **kwargs): |
| 33 | self.handle_error(sbservices_client_new(device._c_dev, port, &self._c_client)) | 34 | self.handle_error(sbservices_client_new(device._c_dev, descriptor._c_service_descriptor, &self._c_client)) |
| 35 | self.format_version = "2" | ||
| 34 | 36 | ||
| 35 | def __dealloc__(self): | 37 | def __dealloc__(self): |
| 36 | if self._c_client is not NULL: | 38 | if self._c_client is not NULL: |
| @@ -40,12 +42,18 @@ cdef class SpringboardServicesClient(PropertyListService): | |||
| 40 | cdef inline BaseError _error(self, int16_t ret): | 42 | cdef inline BaseError _error(self, int16_t ret): |
| 41 | return SpringboardServicesError(ret) | 43 | return SpringboardServicesError(ret) |
| 42 | 44 | ||
| 45 | property format_version: | ||
| 46 | def __get__(self): | ||
| 47 | return <bytes>self.format_version | ||
| 48 | def __set__(self, char* newversion): | ||
| 49 | self.format_version = newversion | ||
| 50 | |||
| 43 | property icon_state: | 51 | property icon_state: |
| 44 | def __get__(self): | 52 | def __get__(self): |
| 45 | cdef: | 53 | cdef: |
| 46 | plist.plist_t c_node = NULL | 54 | plist.plist_t c_node = NULL |
| 47 | sbservices_error_t err | 55 | sbservices_error_t err |
| 48 | err = sbservices_get_icon_state(self._c_client, &c_node, NULL) | 56 | err = sbservices_get_icon_state(self._c_client, &c_node, self.format_version) |
| 49 | try: | 57 | try: |
| 50 | self.handle_error(err) | 58 | self.handle_error(err) |
| 51 | 59 | ||
