argh more of that desktop profile insanity that didn't get #ifdefs

SVN revision: 81458
This commit is contained in:
Mike Blumenkrantz 2012-12-20 14:07:33 +00:00
parent 7d1cc24f5c
commit 6888d7b697
3 changed files with 24 additions and 14 deletions

View File

@ -11,7 +11,6 @@ static void _e_desk_event_desk_before_show_free(void *data, void *ev);
static void _e_desk_event_desk_after_show_free(void *data, void *ev);
static void _e_desk_event_desk_deskshow_free(void *data, void *ev);
static void _e_desk_event_desk_name_change_free(void *data, void *ev);
static void _e_desk_event_desk_window_profile_change_free(void *data, void *ev);
static void _e_desk_show_begin(E_Desk *desk, int mode, int x, int dy);
static void _e_desk_show_end(E_Desk *desk);
static Eina_Bool _e_desk_show_animator(void *data);
@ -19,6 +18,7 @@ static void _e_desk_hide_begin(E_Desk *desk, int mode, int dx, int dy);
static void _e_desk_hide_end(E_Desk *desk);
static Eina_Bool _e_desk_hide_animator(void *data);
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
static void _e_desk_event_desk_window_profile_change_free(void *data, void *ev);
static void _e_desk_window_profile_change_protocol_set(void);
#endif
@ -53,7 +53,9 @@ e_desk_new(E_Zone *zone, int x, int y)
E_Desk *desk;
Eina_List *l;
E_Config_Desktop_Name *cfname;
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
E_Config_Desktop_Window_Profile *cfprof;
#endif
char name[40];
int ok = 0;
@ -86,7 +88,7 @@ e_desk_new(E_Zone *zone, int x, int y)
snprintf(name, sizeof(name), _(e_config->desktop_default_name), x, y);
desk->name = eina_stringshare_add(name);
}
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
/* Get window profile name for current desktop */
ok = 0;
EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, cfprof)
@ -107,7 +109,7 @@ e_desk_new(E_Zone *zone, int x, int y)
desk->window_profile = eina_stringshare_add
(e_config->desktop_default_window_profile);
}
#endif
return desk;
}
@ -546,6 +548,7 @@ e_desk_prev(E_Zone *zone)
e_desk_show(e_desk_at_xy_get(zone, x, y));
}
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
EAPI void
e_desk_window_profile_set(E_Desk *desk,
const char *profile)
@ -610,7 +613,6 @@ e_desk_window_profile_del(int container,
}
}
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
EAPI void
e_desk_window_profile_update(void)
{
@ -725,7 +727,7 @@ _e_desk_event_desk_name_change_free(void *data __UNUSED__, void *event)
e_object_unref(E_OBJECT(ev->desk));
free(ev);
}
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
static void
_e_desk_event_desk_window_profile_change_free(void *data __UNUSED__, void *event)
{
@ -734,7 +736,7 @@ _e_desk_event_desk_window_profile_change_free(void *data __UNUSED__, void *event
e_object_unref(E_OBJECT(ev->desk));
E_FREE(ev);
}
#endif
static void
_e_desk_show_begin(E_Desk *desk, int mode, int dx, int dy)
{

View File

@ -76,10 +76,10 @@ EAPI void e_desk_row_add(E_Zone *zone);
EAPI void e_desk_row_remove(E_Zone *zone);
EAPI void e_desk_col_add(E_Zone *zone);
EAPI void e_desk_col_remove(E_Zone *zone);
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
EAPI void e_desk_window_profile_set(E_Desk *desk, const char *profile);
EAPI void e_desk_window_profile_add(int container, int zone, int desk_x, int desk_y, const char *profile);
EAPI void e_desk_window_profile_del(int container, int zone, int desk_x, int desk_y);
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
EAPI void e_desk_window_profile_update(void);
#endif
@ -88,7 +88,9 @@ extern EAPI int E_EVENT_DESK_BEFORE_SHOW;
extern EAPI int E_EVENT_DESK_AFTER_SHOW;
extern EAPI int E_EVENT_DESK_DESKSHOW;
extern EAPI int E_EVENT_DESK_NAME_CHANGE;
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
extern EAPI int E_EVENT_DESK_WINDOW_PROFILE_CHANGE;
#endif
#endif
#endif

View File

@ -15,8 +15,9 @@ struct _E_Config_Dialog_Data
int desk_y;
char *bg;
char *name;
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
char *profile;
#endif
Evas_Object *preview;
Ecore_Event_Handler *hdl;
};
@ -62,8 +63,9 @@ _fill_data(E_Config_Dialog_Data *cfdata)
const char *bg;
char name[40];
int ok = 0;
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
E_Config_Desktop_Window_Profile *prof;
#endif
bg = e_bg_file_get(cfdata->con_num, cfdata->zone_num, cfdata->desk_x, cfdata->desk_y);
if (!bg)
bg = e_theme_edje_file_get("base/theme/backgrounds", "e/desktop/background");
@ -90,7 +92,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
snprintf(name, sizeof(name), _(e_config->desktop_default_name), cfdata->desk_x, cfdata->desk_y);
cfdata->name = strdup(name);
}
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
ok = 0;
EINA_LIST_FOREACH(e_config->desktop_window_profiles, l, prof)
{
@ -108,6 +110,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
if (!ok)
cfdata->profile = strdup(e_config->desktop_default_window_profile);
#endif
}
static void *
@ -130,8 +133,10 @@ _free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
E_FREE(cfdata->bg);
if (cfdata->name)
E_FREE(cfdata->name);
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
if (cfdata->profile)
E_FREE(cfdata->profile);
#endif
E_FREE(cfdata);
}
@ -147,20 +152,21 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
cfdata->name = strdup(name);
}
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
if (!cfdata->profile[0])
cfdata->profile = strdup(e_config->desktop_default_window_profile);
#endif
e_desk_name_del(cfdata->con_num, cfdata->zone_num,
cfdata->desk_x, cfdata->desk_y);
e_desk_name_add(cfdata->con_num, cfdata->zone_num,
cfdata->desk_x, cfdata->desk_y, cfdata->name);
e_desk_name_update();
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
e_desk_window_profile_del(cfdata->con_num, cfdata->zone_num,
cfdata->desk_x, cfdata->desk_y);
e_desk_window_profile_add(cfdata->con_num, cfdata->zone_num,
cfdata->desk_x, cfdata->desk_y, cfdata->profile);
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
e_desk_window_profile_update();
#endif
e_bg_del(cfdata->con_num, cfdata->zone_num, cfdata->desk_x, cfdata->desk_y);
@ -188,7 +194,7 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
ob = e_widget_entry_add(evas, &(cfdata->name), NULL, NULL, NULL);
e_widget_frametable_object_append(of, ob, 1, 0, 2, 1, 1, 1, 1, 0);
e_widget_list_object_append(o, of, 1, 1, 0.5);
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
of = e_widget_frametable_add(evas, _("Desktop Window Profile"), 0);
ob = e_widget_label_add(evas, _("Profile Name:"));
e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 0);
@ -196,7 +202,7 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
e_widget_entry_readonly_set(ob, !(e_config->use_desktop_window_profile));
e_widget_frametable_object_append(of, ob, 1, 0, 2, 1, 1, 1, 1, 0);
e_widget_list_object_append(o, of, 1, 1, 0.5);
#endif
of = e_widget_frametable_add(evas, _("Desktop Wallpaper"), 0);
ob = e_widget_preview_add(evas, 240, (240 * zone->h) / zone->w);
cfdata->preview = ob;