summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-12-18 18:36:16 +0100
committerGravatar Martin Szulecki2010-12-19 21:23:46 +0100
commit0986d833ec566f52a4d2c41d33217db6f0d49dfa (patch)
tree1834c11b9189b2917e32e8d490f5befd38c92968 /src
parent6a1b66f1de2d7147d4498f0902a494de56282039 (diff)
downloadsbmanager-0986d833ec566f52a4d2c41d33217db6f0d49dfa.tar.gz
sbmanager-0986d833ec566f52a4d2c41d33217db6f0d49dfa.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;