summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-12-18 18:36:16 +0100
committerGravatar Martin Szulecki2012-03-18 18:41:15 +0100
commit8d6d1ca3d39386953b047b75b1f10452b30c9578 (patch)
tree480714162905ca3dd63db1e95095461988fe8223 /src
parent1d091c665342a6df3542388a694bfe101a415785 (diff)
downloadsbmanager-8d6d1ca3d39386953b047b75b1f10452b30c9578.tar.gz
sbmanager-8d6d1ca3d39386953b047b75b1f10452b30c9578.tar.bz2
Read home screen and icon folder configuration from device
Diffstat (limited to 'src')
-rw-r--r--src/device.c50
-rw-r--r--src/device.h11
2 files changed, 57 insertions, 4 deletions
diff --git a/src/device.c b/src/device.c
index e92fbc2..ddd6d53 100644
--- a/src/device.c
+++ b/src/device.c
@@ -386,12 +386,54 @@ gboolean device_get_info(const char *uuid, device_info_t *device_info, GError **
plist_free(node);
}
- /* get battery poll interval */
+ /* get layout information */
node = NULL;
- lockdownd_get_value(client, "com.apple.mobile.iTunes", "BatteryPollInterval", &node);
- plist_get_uint_val(node, &interval);
- (*device_info)->battery_poll_interval = (guint)interval;
+ plist_t value = NULL;
+ lockdownd_get_value(client, "com.apple.mobile.iTunes", NULL, &node);
+
+ value = plist_dict_get_item(node, "HomeScreenIconColumns");
+ plist_get_uint_val(value, &integer);
+ (*device_info)->home_screen_icon_columns = (guint)integer;
+
+ value = plist_dict_get_item(node, "HomeScreenIconDockMaxCount");
+ plist_get_uint_val(value, &integer);
+ (*device_info)->home_screen_icon_dock_max_count = (guint)integer;
+
+ value = plist_dict_get_item(node, "HomeScreenIconHeight");
+ plist_get_uint_val(value, &integer);
+ (*device_info)->home_screen_icon_height = (guint)integer;
+
+ value = plist_dict_get_item(node, "HomeScreenIconRows");
+ plist_get_uint_val(value, &integer);
+ (*device_info)->home_screen_icon_rows = (guint)integer;
+
+ value = plist_dict_get_item(node, "HomeScreenIconWidth");
+ plist_get_uint_val(value, &integer);
+ (*device_info)->home_screen_icon_width = (guint)integer;
+
+ value = plist_dict_get_item(node, "IconFolderColumns");
+ plist_get_uint_val(value, &integer);
+ (*device_info)->icon_folder_columns = (guint)integer;
+
+ value = plist_dict_get_item(node, "IconFolderMaxPages");
+ plist_get_uint_val(value, &integer);
+ (*device_info)->icon_folder_max_pages = (guint)integer;
+
+ value = plist_dict_get_item(node, "IconFolderRows");
+ plist_get_uint_val(value, &integer);
+ (*device_info)->icon_folder_rows = (guint)integer;
+
+ value = plist_dict_get_item(node, "IconStateSaves");
+ plist_get_bool_val(value, &boolean);
+ (*device_info)->icon_state_saves = (gboolean)boolean;
+
+ /* get battery poll interval */
+ value = plist_dict_get_item(node, "BatteryPollInterval");
+ plist_get_uint_val(value, &integer);
+ (*device_info)->battery_poll_interval = (guint)integer;
+
plist_free(node);
+ value = NULL;
/* get current battery capacity */
node = NULL;
diff --git a/src/device.h b/src/device.h
index c8829b2..b572c89 100644
--- a/src/device.h
+++ b/src/device.h
@@ -33,6 +33,17 @@ struct device_info_int {
char *device_type;
guint battery_capacity;
guint battery_poll_interval;
+ /* layout on iOS 3.2+ */
+ guint home_screen_icon_columns;
+ guint home_screen_icon_dock_max_count;
+ guint home_screen_icon_height;
+ guint home_screen_icon_rows;
+ guint home_screen_icon_width;
+ /* folders on iOS 4+ */
+ guint icon_folder_columns;
+ guint icon_folder_max_pages;
+ guint icon_folder_rows;
+ gboolean icon_state_saves;
};
typedef struct device_info_int *device_info_t;