summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-01-13 13:41:33 -0500
committerChris Michael <cp.michael@samsung.com>2015-01-13 13:41:33 -0500
commit4e9444e1ebc8ceb7a5053375c858c4c6c0e6139a (patch)
treed79e3d296a02036c35a215701c324eea6cc77fcc
parent968c123fdc61bd4bceb6615637e7100c7309f5de (diff)
wallpaper2: Update wallpaper2 module to work again with Enlightenment
Elementary changes Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/e_int_config_wallpaper.c85
1 files changed, 37 insertions, 48 deletions
diff --git a/src/e_int_config_wallpaper.c b/src/e_int_config_wallpaper.c
index 6c77e55..5d8bdef 100644
--- a/src/e_int_config_wallpaper.c
+++ b/src/e_int_config_wallpaper.c
@@ -15,7 +15,8 @@ typedef struct _Item Item;
15 15
16struct _Info 16struct _Info
17{ 17{
18 E_Win *win; 18 Evas *evas;
19 Evas_Object *win;
19 Evas_Object *bg, *preview, *mini, *button, *box, *sframe, *span; 20 Evas_Object *bg, *preview, *mini, *button, *box, *sframe, *span;
20 Eina_Stringshare *bg_file; 21 Eina_Stringshare *bg_file;
21 int iw, ih; 22 int iw, ih;
@@ -955,20 +956,6 @@ _pan_file_add(Evas_Object *obj, const char *file, Eina_Bool remote, Eina_Bool th
955//////// 956////////
956 957
957static void 958static void
958_resize(E_Win *wn)
959{
960 Info *info = wn->data;
961
962 evas_object_resize(info->bg, wn->w, wn->h);
963}
964
965static void
966_delete(E_Win *wn EINA_UNUSED)
967{
968 e_object_del(E_OBJECT(global_info->win));
969}
970
971static void
972_bg_clicked(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) 959_bg_clicked(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
973{ 960{
974 Info *info = data; 961 Info *info = data;
@@ -1117,7 +1104,7 @@ Info *
1117wp_browser_new(E_Comp *comp) 1104wp_browser_new(E_Comp *comp)
1118{ 1105{
1119 Info *info; 1106 Info *info;
1120 E_Win *win; 1107 Evas_Object *win;
1121 E_Zone *zone; 1108 E_Zone *zone;
1122 E_Desk *desk; 1109 E_Desk *desk;
1123 const E_Config_Desktop_Background *cfbg; 1110 const E_Config_Desktop_Background *cfbg;
@@ -1156,49 +1143,48 @@ wp_browser_new(E_Comp *comp)
1156 info->iw = (120 * e_scale); 1143 info->iw = (120 * e_scale);
1157 info->ih = (zone->h * info->iw) / (zone->w); 1144 info->ih = (zone->h * info->iw) / (zone->w);
1158 1145
1159 win = e_win_new(comp); 1146 win = e_elm_win_add(NULL, NULL, ELM_WIN_BASIC);
1160 if (!win) 1147 if (!win)
1161 { 1148 {
1162 eina_stringshare_del(info->bg_file); 1149 eina_stringshare_del(info->bg_file);
1163 free(info); 1150 free(info);
1164 return NULL; 1151 return NULL;
1165 } 1152 }
1153 info->evas = evas_object_evas_get(win);
1166 info->win = win; 1154 info->win = win;
1167 win->data = info;
1168 1155
1169 e_user_dir_concat_static(buf, "backgrounds"); 1156 e_user_dir_concat_static(buf, "backgrounds");
1170 info->dirs = eina_list_append(info->dirs, strdup(buf)); 1157 info->dirs = eina_list_append(info->dirs, strdup(buf));
1171 e_prefix_data_concat_static(buf, "data/backgrounds"); 1158 e_prefix_data_concat_static(buf, "data/backgrounds");
1172 info->dirs = eina_list_append(info->dirs, strdup(buf)); 1159 info->dirs = eina_list_append(info->dirs, strdup(buf));
1173 1160
1174 e_win_title_set(win, D_("Wallpaper Settings")); 1161 elm_win_title_set(win, D_("Wallpaper Settings"));
1175 e_win_name_class_set(win, "E", "_config::appearance/wallpaper2"); 1162 ecore_evas_name_class_set(e_win_ee_get(win), "E", "_config::appearance/wallpaper2");
1176 e_win_resize_callback_set(win, _resize);
1177 e_win_delete_callback_set(win, _delete);
1178 1163
1179 // bg + manager 1164 // bg + manager
1180 info->bg = edje_object_add(info->win->evas); 1165 info->bg = edje_object_add(info->evas);
1166 elm_win_resize_object_add(win, info->bg);
1181 e_theme_edje_object_set(info->bg, "base/theme/widgets", 1167 e_theme_edje_object_set(info->bg, "base/theme/widgets",
1182 "e/conf/wallpaper/main/window"); 1168 "e/conf/wallpaper/main/window");
1183 edje_object_signal_callback_add(info->bg, "e,action,click", "e", 1169 edje_object_signal_callback_add(info->bg, "e,action,click", "e",
1184 _bg_clicked, info); 1170 _bg_clicked, info);
1185 1171
1186 info->box = e_widget_list_add(info->win->evas, 1, 1); 1172 info->box = e_widget_list_add(info->evas, 1, 1);
1187 1173
1188 // ok button 1174 // ok button
1189 info->button = e_widget_button_add(info->win->evas, D_("OK"), NULL, 1175 info->button = e_widget_button_add(info->evas, D_("OK"), NULL,
1190 _ok, info, NULL); 1176 _ok, info, NULL);
1191 evas_object_show(info->button); 1177 evas_object_show(info->button);
1192 e_widget_list_object_append(info->box, info->button, 1, 0, 0.5); 1178 e_widget_list_object_append(info->box, info->button, 1, 0, 0.5);
1193 1179
1194 // apply button 1180 // apply button
1195 info->button = e_widget_button_add(info->win->evas, D_("Apply"), NULL, 1181 info->button = e_widget_button_add(info->evas, D_("Apply"), NULL,
1196 _apply, info, NULL); 1182 _apply, info, NULL);
1197 evas_object_show(info->button); 1183 evas_object_show(info->button);
1198 e_widget_list_object_append(info->box, info->button, 1, 0, 0.5); 1184 e_widget_list_object_append(info->box, info->button, 1, 0, 0.5);
1199 1185
1200 // close button 1186 // close button
1201 info->button = e_widget_button_add(info->win->evas, D_("Close"), NULL, 1187 info->button = e_widget_button_add(info->evas, D_("Close"), NULL,
1202 _close, info, NULL); 1188 _close, info, NULL);
1203 evas_object_show(info->button); 1189 evas_object_show(info->button);
1204 e_widget_list_object_append(info->box, info->button, 1, 0, 0.5); 1190 e_widget_list_object_append(info->box, info->button, 1, 0, 0.5);
@@ -1209,7 +1195,7 @@ wp_browser_new(E_Comp *comp)
1209 evas_object_show(info->box); 1195 evas_object_show(info->box);
1210 1196
1211 // preview 1197 // preview
1212 info->preview = e_livethumb_add(info->win->evas); 1198 info->preview = e_livethumb_add(info->evas);
1213 e_livethumb_vsize_set(info->preview, zone->w, zone->h); 1199 e_livethumb_vsize_set(info->preview, zone->w, zone->h);
1214 edje_extern_object_aspect_set(info->preview, EDJE_ASPECT_CONTROL_NEITHER, 1200 edje_extern_object_aspect_set(info->preview, EDJE_ASPECT_CONTROL_NEITHER,
1215 zone->w, zone->h); 1201 zone->w, zone->h);
@@ -1230,11 +1216,11 @@ wp_browser_new(E_Comp *comp)
1230 } 1216 }
1231 1217
1232 // scrolled thumbs 1218 // scrolled thumbs
1233 info->span = _pan_add(info->win->evas); 1219 info->span = _pan_add(info->evas);
1234 _pan_info_set(info->span, info); 1220 _pan_info_set(info->span, info);
1235 1221
1236 // the scrollframe holding the scrolled thumbs 1222 // the scrollframe holding the scrolled thumbs
1237 info->sframe = e_scrollframe_add(info->win->evas); 1223 info->sframe = e_scrollframe_add(info->evas);
1238 e_scrollframe_custom_theme_set(info->sframe, "base/theme/widgets", 1224 e_scrollframe_custom_theme_set(info->sframe, "base/theme/widgets",
1239 "e/conf/wallpaper/main/scrollframe"); 1225 "e/conf/wallpaper/main/scrollframe");
1240 e_scrollframe_extern_pan_set(info->sframe, info->span, 1226 e_scrollframe_extern_pan_set(info->sframe, info->span,
@@ -1244,23 +1230,23 @@ wp_browser_new(E_Comp *comp)
1244 evas_object_show(info->sframe); 1230 evas_object_show(info->sframe);
1245 evas_object_show(info->span); 1231 evas_object_show(info->span);
1246 1232
1247 ob = e_widget_list_add(info->win->evas, 0, 1); 1233 ob = e_widget_list_add(info->evas, 0, 1);
1248 1234
1249 o = e_widget_list_add(info->win->evas, 1, 0); 1235 o = e_widget_list_add(info->evas, 1, 0);
1250 1236
1251 rg = e_widget_radio_group_new(&(info->mode)); 1237 rg = e_widget_radio_group_new(&(info->mode));
1252 o2 = e_widget_radio_add(info->win->evas, D_("All Desktops"), 0, rg); 1238 o2 = e_widget_radio_add(info->evas, D_("All Desktops"), 0, rg);
1253 evas_object_smart_callback_add(o2, "changed", _wp_changed, info); 1239 evas_object_smart_callback_add(o2, "changed", _wp_changed, info);
1254 e_widget_list_object_append(o, o2, 1, 0, 0.5); 1240 e_widget_list_object_append(o, o2, 1, 0, 0.5);
1255 e_widget_disabled_set(o2, (e_util_comp_desk_count_get(comp) < 2)); 1241 e_widget_disabled_set(o2, (e_util_comp_desk_count_get(comp) < 2));
1256 evas_object_show(o2); 1242 evas_object_show(o2);
1257 1243
1258 o2 = e_widget_radio_add(info->win->evas, D_("This Desktop"), 1, rg); 1244 o2 = e_widget_radio_add(info->evas, D_("This Desktop"), 1, rg);
1259 evas_object_smart_callback_add(o2, "changed", _wp_changed, info); 1245 evas_object_smart_callback_add(o2, "changed", _wp_changed, info);
1260 e_widget_list_object_append(o, o2, 1, 0, 0.5); 1246 e_widget_list_object_append(o, o2, 1, 0, 0.5);
1261 evas_object_show(o2); 1247 evas_object_show(o2);
1262 1248
1263 o2 = e_widget_radio_add(info->win->evas, D_("This Screen"), 2, rg); 1249 o2 = e_widget_radio_add(info->evas, D_("This Screen"), 2, rg);
1264 evas_object_smart_callback_add(o2, "changed", _wp_changed, info); 1250 evas_object_smart_callback_add(o2, "changed", _wp_changed, info);
1265 e_widget_list_object_append(o, o2, 1, 0, 0.5); 1251 e_widget_list_object_append(o, o2, 1, 0, 0.5);
1266 if (!(e_util_comp_zone_number_get(0, 1) || 1252 if (!(e_util_comp_zone_number_get(0, 1) ||
@@ -1271,14 +1257,14 @@ wp_browser_new(E_Comp *comp)
1271 e_widget_list_object_append(ob, o, 1, 0, 0.5); 1257 e_widget_list_object_append(ob, o, 1, 0, 0.5);
1272 evas_object_show(o); 1258 evas_object_show(o);
1273 1259
1274 o = e_widget_list_add(info->win->evas, 1, 0); 1260 o = e_widget_list_add(info->evas, 1, 0);
1275 1261
1276 o2 = e_widget_button_add(info->win->evas, D_("Add"), NULL, 1262 o2 = e_widget_button_add(info->evas, D_("Add"), NULL,
1277 _wp_add, info, NULL); 1263 _wp_add, info, NULL);
1278 e_widget_list_object_append(o, o2, 1, 0, 0.5); 1264 e_widget_list_object_append(o, o2, 1, 0, 0.5);
1279 evas_object_show(o2); 1265 evas_object_show(o2);
1280 1266
1281 o2 = e_widget_button_add(info->win->evas, D_("Delete"), NULL, 1267 o2 = e_widget_button_add(info->evas, D_("Delete"), NULL,
1282 _wp_delete, info, NULL); 1268 _wp_delete, info, NULL);
1283 e_widget_list_object_append(o, o2, 1, 0, 0.5); 1269 e_widget_list_object_append(o, o2, 1, 0, 0.5);
1284 evas_object_show(o2); 1270 evas_object_show(o2);
@@ -1293,16 +1279,19 @@ wp_browser_new(E_Comp *comp)
1293 1279
1294 // min size calc 1280 // min size calc
1295 edje_object_size_min_calc(info->bg, &mw, &mh); 1281 edje_object_size_min_calc(info->bg, &mw, &mh);
1296 e_win_size_min_set(win, mw, mh); 1282 evas_object_size_hint_min_set(win, mw, mh);
1283 e_util_win_auto_resize_fill(win);
1297 if ((zone->w / 4) > mw) mw = (zone->w / 4); 1284 if ((zone->w / 4) > mw) mw = (zone->w / 4);
1298 if ((zone->h / 4) > mh) mh = (zone->h / 4); 1285 if ((zone->h / 4) > mh) mh = (zone->h / 4);
1299 e_win_resize(win, mw, mh);
1300 e_win_centered_set(win, 1);
1301 e_win_show(win);
1302 e_win_client_icon_set(win, "preferences-desktop-wallpaper");
1303 1286
1304 evas_object_resize(info->bg, info->win->w, info->win->h); 1287 evas_object_resize(win, mw, mh);
1288 elm_win_center(win, 1, 1);
1289
1305 evas_object_show(info->bg); 1290 evas_object_show(info->bg);
1291 evas_object_show(win);
1292 e_win_client_icon_set(win, "preferences-desktop-wallpaper");
1293
1294 evas_object_resize(info->bg, mw, mh);
1306 1295
1307 // add theme bg 1296 // add theme bg
1308 _pan_file_add(info->span, NULL, 0, 1); 1297 _pan_file_add(info->span, NULL, 0, 1);
@@ -1329,14 +1318,14 @@ wp_broser_free(Info *info)
1329} 1318}
1330 1319
1331E_Config_Dialog * 1320E_Config_Dialog *
1332wp_conf_show(E_Comp *comp, const char *params EINA_UNUSED) 1321wp_conf_show(Evas_Object *parent EINA_UNUSED, const char *params EINA_UNUSED)
1333{ 1322{
1334 if (global_info) 1323 if (global_info)
1335 { 1324 {
1336 e_win_show(global_info->win); 1325 evas_object_show(global_info->win);
1337 e_win_raise(global_info->win); 1326 evas_object_raise(global_info->win);
1338 } 1327 }
1339 global_info = wp_browser_new(comp); 1328 global_info = wp_browser_new(e_comp);
1340 1329
1341 return NULL; 1330 return NULL;
1342} 1331}