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": SBSERVICES_E_PLIST_ERROR = -2 SBSERVICES_E_CONN_FAILED = -3 SBSERVICES_E_UNKNOWN_ERROR = -256 - sbservices_error_t sbservices_client_new(idevice_t device, uint16_t port, sbservices_client_t *client) + sbservices_error_t sbservices_client_new(idevice_t device, lockdownd_service_descriptor_t descriptor, sbservices_client_t *client) sbservices_error_t sbservices_client_free(sbservices_client_t client) sbservices_error_t sbservices_get_icon_state(sbservices_client_t client, plist.plist_t *state, char *format_version) sbservices_error_t sbservices_set_icon_state(sbservices_client_t client, plist.plist_t newstate) @@ -28,9 +28,11 @@ cdef class SpringboardServicesError(BaseError): cdef class SpringboardServicesClient(PropertyListService): __service_name__ = "com.apple.springboardservices" cdef sbservices_client_t _c_client + cdef char* format_version - def __cinit__(self, iDevice device not None, int port, *args, **kwargs): - self.handle_error(sbservices_client_new(device._c_dev, port, &self._c_client)) + def __cinit__(self, iDevice device not None, LockdownServiceDescriptor descriptor, *args, **kwargs): + self.handle_error(sbservices_client_new(device._c_dev, descriptor._c_service_descriptor, &self._c_client)) + self.format_version = "2" def __dealloc__(self): if self._c_client is not NULL: @@ -40,12 +42,18 @@ cdef class SpringboardServicesClient(PropertyListService): cdef inline BaseError _error(self, int16_t ret): return SpringboardServicesError(ret) + property format_version: + def __get__(self): + return <bytes>self.format_version + def __set__(self, char* newversion): + self.format_version = newversion + property icon_state: def __get__(self): cdef: plist.plist_t c_node = NULL sbservices_error_t err - err = sbservices_get_icon_state(self._c_client, &c_node, NULL) + err = sbservices_get_icon_state(self._c_client, &c_node, self.format_version) try: self.handle_error(err) |