forked from enlightenment/enlightenment
Simplify arrangement widget. Use e_layout.
SVN revision: 68439
This commit is contained in:
parent
a5a3db6195
commit
23a469ae03
|
@ -126,10 +126,10 @@ free_cfdata(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
|
|
||||||
arrangement_widget_free_data(cfd, cfdata);
|
arrangement_widget_free_data(cfd, cfdata);
|
||||||
|
|
||||||
evas_object_del(cfdata->gui.subdialogs.arrangement.dialog);
|
evas_object_del(cfdata->gui.widgets.arrangement.dialog);
|
||||||
evas_object_del(cfdata->gui.subdialogs.policies.dialog);
|
evas_object_del(cfdata->gui.widgets.policies.dialog);
|
||||||
evas_object_del(cfdata->gui.subdialogs.resolutions.dialog);
|
evas_object_del(cfdata->gui.widgets.resolutions.dialog);
|
||||||
evas_object_del(cfdata->gui.subdialogs.orientation.dialog);
|
evas_object_del(cfdata->gui.widgets.orientation.dialog);
|
||||||
|
|
||||||
EINA_LIST_FREE(cfdata->output_dialog_data_list, dialog_data)
|
EINA_LIST_FREE(cfdata->output_dialog_data_list, dialog_data)
|
||||||
{
|
{
|
||||||
|
@ -304,25 +304,25 @@ basic_create_widgets(E_Config_Dialog *cfd, Evas *canvas, E_Config_Dialog_Data *c
|
||||||
|
|
||||||
e_config_runtime_info->gui.canvas = canvas;
|
e_config_runtime_info->gui.canvas = canvas;
|
||||||
|
|
||||||
if (!(cfdata->gui.subdialogs.arrangement.dialog = arrangement_widget_basic_create_widgets(canvas))) goto _dialog_create_subdialog_arrangement_fail;
|
if (!(cfdata->gui.widgets.arrangement.dialog = arrangement_widget_basic_create_widgets(canvas))) goto _dialog_create_subdialog_arrangement_fail;
|
||||||
if (!(cfdata->gui.subdialogs.policies.dialog = policy_widget_basic_create_widgets(canvas))) goto _dialog_create_subdialog_policies_fail;
|
if (!(cfdata->gui.widgets.policies.dialog = policy_widget_basic_create_widgets(canvas))) goto _dialog_create_subdialog_policies_fail;
|
||||||
if (!(cfdata->gui.subdialogs.resolutions.dialog = resolution_widget_basic_create_widgets(canvas))) goto _dialog_create_subdialog_resolutions_fail;
|
if (!(cfdata->gui.widgets.resolutions.dialog = resolution_widget_basic_create_widgets(canvas))) goto _dialog_create_subdialog_resolutions_fail;
|
||||||
if (!(cfdata->gui.subdialogs.orientation.dialog = orientation_widget_basic_create_widgets(canvas))) goto _dialog_create_subdialog_orientation_fail;
|
if (!(cfdata->gui.widgets.orientation.dialog = orientation_widget_basic_create_widgets(canvas))) goto _dialog_create_subdialog_orientation_fail;
|
||||||
|
|
||||||
EINA_SAFETY_ON_FALSE_GOTO((table = e_widget_table_add(canvas, EINA_FALSE)), _dialog_create_widgets_fail);
|
EINA_SAFETY_ON_FALSE_GOTO((table = e_widget_table_add(canvas, EINA_FALSE)), _dialog_create_widgets_fail);
|
||||||
EINA_SAFETY_ON_FALSE_GOTO((wl = e_widget_list_add(canvas, EINA_FALSE, EINA_TRUE)), _dialog_create_widget_list_fail);
|
EINA_SAFETY_ON_FALSE_GOTO((wl = e_widget_list_add(canvas, EINA_FALSE, EINA_TRUE)), _dialog_create_widget_list_fail);
|
||||||
|
|
||||||
//e_widget_table_object_append(Evas_Object *obj, Evas_Object *sobj, int col, int row, int colspan, int rowspan, int fill_w, int fill_h, int expand_w, int expand_h);
|
//e_widget_table_object_append(Evas_Object *obj, Evas_Object *sobj, int col, int row, int colspan, int rowspan, int fill_w, int fill_h, int expand_w, int expand_h);
|
||||||
e_widget_table_object_append(table, cfdata->gui.subdialogs.arrangement.dialog, 1, 1, 1, 1, EVAS_HINT_FILL, EVAS_HINT_FILL, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
e_widget_table_object_append(table, cfdata->gui.widgets.arrangement.dialog, 1, 1, 1, 1, EVAS_HINT_FILL, EVAS_HINT_FILL, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
/*
|
/*
|
||||||
e_widget_table_object_append(table, cfdata->gui.subdialogs.policies.dialog, 1, 2, 1, 1, 0, 0, 0, 0);
|
e_widget_table_object_append(table, cfdata->gui.widgets.policies.dialog, 1, 2, 1, 1, 0, 0, 0, 0);
|
||||||
e_widget_table_object_append(table, cfdata->gui.subdialogs.orientation.dialog, 2, 2, 1, 1, 0, 0, 0, 0);
|
e_widget_table_object_append(table, cfdata->gui.widgets.orientation.dialog, 2, 2, 1, 1, 0, 0, 0, 0);
|
||||||
e_widget_table_object_append(table, cfdata->gui.subdialogs.resolutions.dialog, 3, 2, 1, 1, EVAS_HINT_FILL, EVAS_HINT_FILL, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
e_widget_table_object_append(table, cfdata->gui.widgets.resolutions.dialog, 3, 2, 1, 1, EVAS_HINT_FILL, EVAS_HINT_FILL, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
*/
|
*/
|
||||||
//e_widget_list_object_append(Evas_Object *obj, Evas_Object *sobj, int fill, int expand, double align);
|
//e_widget_list_object_append(Evas_Object *obj, Evas_Object *sobj, int fill, int expand, double align);
|
||||||
e_widget_list_object_append(wl, cfdata->gui.subdialogs.policies.dialog, 0, 0, 0.0);
|
e_widget_list_object_append(wl, cfdata->gui.widgets.policies.dialog, 0, 0, 0.0);
|
||||||
e_widget_list_object_append(wl, cfdata->gui.subdialogs.orientation.dialog, 0, 0, 0.0);
|
e_widget_list_object_append(wl, cfdata->gui.widgets.orientation.dialog, 0, 0, 0.0);
|
||||||
e_widget_list_object_append(wl, cfdata->gui.subdialogs.resolutions.dialog, EVAS_HINT_FILL, EVAS_HINT_EXPAND, 1.0);
|
e_widget_list_object_append(wl, cfdata->gui.widgets.resolutions.dialog, EVAS_HINT_FILL, EVAS_HINT_EXPAND, 1.0);
|
||||||
e_widget_table_object_append(table, wl, 1, 2, 1, 1, EVAS_HINT_FILL, EVAS_HINT_FILL, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
e_widget_table_object_append(table, wl, 1, 2, 1, 1, EVAS_HINT_FILL, EVAS_HINT_FILL, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
cfdata->gui.widget_list = wl;
|
cfdata->gui.widget_list = wl;
|
||||||
|
|
||||||
|
@ -335,13 +335,13 @@ basic_create_widgets(E_Config_Dialog *cfd, Evas *canvas, E_Config_Dialog_Data *c
|
||||||
_dialog_create_widget_list_fail:
|
_dialog_create_widget_list_fail:
|
||||||
evas_object_del(table);
|
evas_object_del(table);
|
||||||
_dialog_create_widgets_fail:
|
_dialog_create_widgets_fail:
|
||||||
evas_object_del(cfdata->gui.subdialogs.orientation.dialog);
|
evas_object_del(cfdata->gui.widgets.orientation.dialog);
|
||||||
_dialog_create_subdialog_orientation_fail:
|
_dialog_create_subdialog_orientation_fail:
|
||||||
evas_object_del(cfdata->gui.subdialogs.resolutions.dialog);
|
evas_object_del(cfdata->gui.widgets.resolutions.dialog);
|
||||||
_dialog_create_subdialog_resolutions_fail:
|
_dialog_create_subdialog_resolutions_fail:
|
||||||
evas_object_del(cfdata->gui.subdialogs.policies.dialog);
|
evas_object_del(cfdata->gui.widgets.policies.dialog);
|
||||||
_dialog_create_subdialog_policies_fail:
|
_dialog_create_subdialog_policies_fail:
|
||||||
evas_object_del(cfdata->gui.subdialogs.arrangement.dialog);
|
evas_object_del(cfdata->gui.widgets.arrangement.dialog);
|
||||||
_dialog_create_subdialog_arrangement_fail:
|
_dialog_create_subdialog_arrangement_fail:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,7 @@ struct _E_Config_Dialog_Data
|
||||||
E_Config_Randr_Dialog_Confirmation_Dialog_Data *confirmation_dialog;
|
E_Config_Randr_Dialog_Confirmation_Dialog_Data *confirmation_dialog;
|
||||||
struct {
|
struct {
|
||||||
struct {
|
struct {
|
||||||
Evas_Object *dialog, *widget_list, *swallowing_edje, *smart_parent, *suggestion, *clipper, *check_display_disconnected_outputs;
|
Evas_Object *dialog, *area, *widget_list, *swallowing_edje, *suggestion, *check_display_disconnected_outputs;
|
||||||
Evas_Coord_Point previous_pos, relative_zero;
|
|
||||||
Evas_Coord_Rectangle disabled_output_size;
|
|
||||||
int suggestion_dist_min, check_val_display_disconnected_outputs;
|
int suggestion_dist_min, check_val_display_disconnected_outputs;
|
||||||
} arrangement;
|
} arrangement;
|
||||||
struct {
|
struct {
|
||||||
|
@ -44,7 +42,7 @@ struct _E_Config_Dialog_Data
|
||||||
Evas_Object *radio_normal, *radio_rot90, *radio_rot180, *radio_rot270, *radio_reflect_horizontal, *radio_reflect_vertical;
|
Evas_Object *radio_normal, *radio_rot90, *radio_rot180, *radio_rot270, *radio_reflect_horizontal, *radio_reflect_vertical;
|
||||||
int radio_val;
|
int radio_val;
|
||||||
} orientation;
|
} orientation;
|
||||||
} subdialogs;
|
} widgets;
|
||||||
} gui;
|
} gui;
|
||||||
Ecore_X_Randr_Screen_Size screen_size;
|
Ecore_X_Randr_Screen_Size screen_size;
|
||||||
|
|
||||||
|
@ -54,11 +52,11 @@ struct _E_Config_Randr_Dialog_Output_Dialog_Data
|
||||||
{
|
{
|
||||||
E_Randr_Crtc_Info *crtc;
|
E_Randr_Crtc_Info *crtc;
|
||||||
E_Randr_Output_Info *output;
|
E_Randr_Output_Info *output;
|
||||||
Evas_Coord_Point previous_pos, new_pos;
|
Evas_Coord_Point previous_pos;
|
||||||
Ecore_X_Randr_Mode_Info *previous_mode, *new_mode, *preferred_mode;
|
Ecore_X_Randr_Mode_Info *previous_mode, *new_mode, *preferred_mode;
|
||||||
Ecore_X_Randr_Orientation previous_orientation, new_orientation;
|
Ecore_X_Randr_Orientation previous_orientation, new_orientation;
|
||||||
Ecore_X_Randr_Output_Policy previous_policy, new_policy;
|
Ecore_X_Randr_Output_Policy previous_policy, new_policy;
|
||||||
Evas_Object *bg;
|
Evas_Object *bg, *rep;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _E_Config_Randr_Dialog_Confirmation_Dialog_Data
|
struct _E_Config_Randr_Dialog_Confirmation_Dialog_Data
|
||||||
|
|
|
@ -22,13 +22,10 @@ Evas_Object *arrangement_widget_basic_create_widgets(Evas *canvas);
|
||||||
Eina_Bool arrangement_widget_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
Eina_Bool arrangement_widget_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||||
Eina_Bool arrangement_widget_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
Eina_Bool arrangement_widget_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||||
void arrangement_widget_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
void arrangement_widget_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||||
static inline Eina_List *_arrangement_widget_neighbors_get(Evas_Object *obj);
|
|
||||||
static void _arrangement_widget_determine_positions_recursive(Evas_Object *obj);
|
|
||||||
|
|
||||||
//static inline E_Config_Randr_Dialog_Output_Dialog_Data *_arrangement_widget_rep_dialog_data_new (E_Randr_Crtc_Info *crtc_info, E_Randr_Output_Info *output_info);
|
//static inline E_Config_Randr_Dialog_Output_Dialog_Data *_arrangement_widget_rep_dialog_data_new (E_Randr_Crtc_Info *crtc_info, E_Randr_Output_Info *output_info);
|
||||||
static inline void _arrangement_widget_suggestion_add(Evas *evas);
|
static inline void _arrangement_widget_suggestion_add(Evas *evas);
|
||||||
static inline void _arrangement_widget_make_suggestion(Evas_Object *obj);
|
static inline void _arrangement_widget_make_suggestion(Evas_Object *obj);
|
||||||
static void _arrangement_widget_smart_class_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
|
|
||||||
static Evas_Object *_arrangement_widget_rep_add(Evas *canvas, E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data);
|
static Evas_Object *_arrangement_widget_rep_add(Evas *canvas, E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data);
|
||||||
static void _arrangement_widget_rep_del(Evas_Object *output);
|
static void _arrangement_widget_rep_del(Evas_Object *output);
|
||||||
static void _arrangement_widget_rep_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
static void _arrangement_widget_rep_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||||
|
@ -37,9 +34,6 @@ static void _arrangement_widget_rep_mouse_up_cb(void *data, Evas *e
|
||||||
static void _arrangement_widget_check_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
static void _arrangement_widget_check_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||||
static void _arrangement_widget_update(void);
|
static void _arrangement_widget_update(void);
|
||||||
|
|
||||||
static Evas_Smart_Class screen_setup_smart_class = EVAS_SMART_CLASS_INIT_NAME_VERSION("EvasObjectSmartScreenSetup");
|
|
||||||
static Evas_Smart *screen_setup_smart = NULL;
|
|
||||||
|
|
||||||
extern E_Config_Dialog_Data *e_config_runtime_info;
|
extern E_Config_Dialog_Data *e_config_runtime_info;
|
||||||
extern Config *randr_dialog_config;
|
extern Config *randr_dialog_config;
|
||||||
extern char _theme_file_path[];
|
extern char _theme_file_path[];
|
||||||
|
@ -74,111 +68,120 @@ _arrangement_widget_rep_dialog_data_fill(E_Config_Randr_Dialog_Output_Dialog_Dat
|
||||||
odd->preferred_mode = NULL;
|
odd->preferred_mode = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
odd->previous_pos.x = Ecore_X_Randr_Unset;
|
odd->previous_pos.x = 0;
|
||||||
odd->previous_pos.y = Ecore_X_Randr_Unset;
|
odd->previous_pos.y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
odd->new_pos.x = Ecore_X_Randr_Unset;
|
|
||||||
odd->new_pos.y = Ecore_X_Randr_Unset;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_arrangement_widget_update(void)
|
_arrangement_widget_update(void)
|
||||||
{
|
{
|
||||||
Evas_Object *area, *rep;
|
static Evas_Object *area = NULL;
|
||||||
|
E_Config_Randr_Dialog_Output_Dialog_Data *odd = NULL;
|
||||||
|
static Eina_Rectangle default_geo;
|
||||||
|
Eina_Rectangle geo = {.x = 0, .y = 0, .w = 0, .h = 0};
|
||||||
|
static char *edje_data_item = NULL;
|
||||||
Eina_List *iter;
|
Eina_List *iter;
|
||||||
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
|
||||||
|
|
||||||
area = e_config_runtime_info->gui.subdialogs.arrangement.smart_parent;
|
area = e_config_runtime_info->gui.widgets.arrangement.area;
|
||||||
|
|
||||||
if (!e_config_runtime_info || !e_config_runtime_info->gui.canvas || !e_config_runtime_info->output_dialog_data_list || !area) return;
|
if (!e_config_runtime_info || !e_config_runtime_info->gui.canvas || !e_config_runtime_info->output_dialog_data_list || !area) return;
|
||||||
|
|
||||||
fprintf(stderr, "CONF_RANDR: Display disconnected outputs %d\n", randr_dialog_config->display_disconnected_outputs);
|
fprintf(stderr, "CONF_RANDR: Display disconnected outputs: %s\n", (randr_dialog_config->display_disconnected_outputs ? "YES" : "NO"));
|
||||||
|
|
||||||
EINA_LIST_FOREACH(evas_object_smart_members_get(area), iter, rep)
|
if (!edje_data_item)
|
||||||
{
|
{
|
||||||
//skip clipper
|
if(!(edje_data_item = edje_file_data_get(_theme_file_path, "disabled_output_width")))
|
||||||
if (rep == e_config_runtime_info->gui.subdialogs.arrangement.clipper)
|
edje_data_item = "1024";
|
||||||
continue;
|
default_geo.w = atoi(edje_data_item);
|
||||||
evas_object_smart_member_del(rep);
|
|
||||||
_arrangement_widget_rep_del(rep);
|
if(!(edje_data_item = edje_file_data_get(_theme_file_path, "disabled_output_height")))
|
||||||
|
edje_data_item = "768";
|
||||||
|
default_geo.h = atoi(edje_data_item);
|
||||||
|
|
||||||
|
default_geo.x = e_randr_screen_info.rrvd_info.randr_info_12->max_size.width - default_geo.w;
|
||||||
|
default_geo.y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
EINA_LIST_FOREACH(e_config_runtime_info->output_dialog_data_list, iter, output_dialog_data)
|
e_layout_freeze(area);
|
||||||
|
e_layout_unpack(area);
|
||||||
|
e_layout_virtual_size_set(area, e_randr_screen_info.rrvd_info.randr_info_12->max_size.width, e_randr_screen_info.rrvd_info.randr_info_12->max_size.height);
|
||||||
|
fprintf(stderr, "CONF_RANDR: Set virtual size of arrangement e_layout to %dx%d\n", e_randr_screen_info.rrvd_info.randr_info_12->max_size.width, e_randr_screen_info.rrvd_info.randr_info_12->max_size.height);
|
||||||
|
EINA_LIST_FOREACH(e_config_runtime_info->output_dialog_data_list, iter, odd)
|
||||||
{
|
{
|
||||||
if(!output_dialog_data->crtc &&
|
_arrangement_widget_rep_del(odd->rep);
|
||||||
(!output_dialog_data->output->monitor && (randr_dialog_config && !randr_dialog_config->display_disconnected_outputs)))
|
|
||||||
|
if(!odd->crtc &&
|
||||||
|
(!odd->output->monitor && (randr_dialog_config && !randr_dialog_config->display_disconnected_outputs)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
rep = _arrangement_widget_rep_add(e_config_runtime_info->gui.canvas, output_dialog_data);
|
odd->rep = _arrangement_widget_rep_add(e_config_runtime_info->gui.canvas, odd);
|
||||||
|
if (odd->crtc && odd->crtc->current_mode)
|
||||||
|
{
|
||||||
|
geo.x = odd->crtc->geometry.x;
|
||||||
|
geo.y = odd->crtc->geometry.y;
|
||||||
|
geo.w = odd->crtc->geometry.w;
|
||||||
|
geo.h = odd->crtc->geometry.h;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memcpy(&geo, &default_geo, sizeof(geo));
|
||||||
|
}
|
||||||
|
e_layout_child_raise(odd->rep);
|
||||||
|
e_layout_child_resize(odd->rep, geo.w, geo.h);
|
||||||
|
e_layout_child_move(odd->rep, geo.x, geo.y);
|
||||||
|
evas_object_show(odd->rep);
|
||||||
|
|
||||||
if (!rep) continue;
|
e_layout_pack(area, odd->rep);
|
||||||
evas_object_show(rep);
|
fprintf(stderr, "CONF_RANDR: Representation (%p) added with geo %d.%d %dx%d.\n", odd->rep, geo.x, geo.y, geo.w, geo.h);
|
||||||
|
|
||||||
evas_object_smart_member_add(rep, area);
|
|
||||||
fprintf(stderr, "CONF_RANDR: Representation (%p) added to arrangement subdialog (%p).\n", rep, area);
|
|
||||||
}
|
}
|
||||||
|
e_layout_thaw(area);
|
||||||
}
|
}
|
||||||
|
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
arrangement_widget_create_data(E_Config_Dialog_Data *data)
|
arrangement_widget_create_data(E_Config_Dialog_Data *data)
|
||||||
{
|
{
|
||||||
Eina_List *iter;
|
Eina_List *iter;
|
||||||
E_Config_Randr_Dialog_Output_Dialog_Data *dialog_data;
|
E_Config_Randr_Dialog_Output_Dialog_Data *dialog_data;
|
||||||
char *disabled_output_width, *disabled_output_height;
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH(data->output_dialog_data_list, iter, dialog_data)
|
EINA_LIST_FOREACH(data->output_dialog_data_list, iter, dialog_data)
|
||||||
{
|
{
|
||||||
_arrangement_widget_rep_dialog_data_fill(dialog_data);
|
_arrangement_widget_rep_dialog_data_fill(dialog_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(disabled_output_width = edje_file_data_get(_theme_file_path, "disabled_output_width")))
|
|
||||||
disabled_output_width = "1024";
|
|
||||||
if(!(disabled_output_height = edje_file_data_get(_theme_file_path, "disabled_output_height")))
|
|
||||||
disabled_output_height = "768";
|
|
||||||
|
|
||||||
data->gui.subdialogs.arrangement.disabled_output_size.w = atoi(disabled_output_width);
|
|
||||||
data->gui.subdialogs.arrangement.disabled_output_size.h = atoi(disabled_output_height);
|
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//IMPROVABLE: Clean up properly if instances can't be created
|
|
||||||
Evas_Object *
|
Evas_Object *
|
||||||
arrangement_widget_basic_create_widgets(Evas *canvas)
|
arrangement_widget_basic_create_widgets(Evas *canvas)
|
||||||
{
|
{
|
||||||
Evas_Object *subdialog, *area, *check;
|
Evas_Object *widget, *area, *check;
|
||||||
|
|
||||||
if (!canvas || !e_config_runtime_info || !e_config_runtime_info->output_dialog_data_list) return NULL;
|
if (!canvas || !e_config_runtime_info || !e_config_runtime_info->output_dialog_data_list) return NULL;
|
||||||
|
|
||||||
subdialog = e_widget_list_add(canvas, 0, 1);
|
widget = e_widget_list_add(canvas, 0, 1);
|
||||||
|
fprintf(stderr, "CONF_RANDR: Arrangement widget added (%p).\n", widget);
|
||||||
|
|
||||||
//Add checkbox
|
//Add checkbox
|
||||||
check = e_widget_check_add(canvas, _("Display disconnected outputs"), &e_config_runtime_info->gui.subdialogs.arrangement.check_val_display_disconnected_outputs);
|
check = e_widget_check_add(canvas, _("Display disconnected outputs"), &e_config_runtime_info->gui.widgets.arrangement.check_val_display_disconnected_outputs);
|
||||||
if (randr_dialog_config)
|
if (randr_dialog_config)
|
||||||
e_widget_check_checked_set(check, randr_dialog_config->display_disconnected_outputs);
|
e_widget_check_checked_set(check, randr_dialog_config->display_disconnected_outputs);
|
||||||
evas_object_event_callback_add(check, EVAS_CALLBACK_MOUSE_DOWN, _arrangement_widget_check_mouse_down_cb, NULL);
|
evas_object_event_callback_add(check, EVAS_CALLBACK_MOUSE_DOWN, _arrangement_widget_check_mouse_down_cb, NULL);
|
||||||
e_config_runtime_info->gui.subdialogs.arrangement.check_display_disconnected_outputs = check;
|
e_config_runtime_info->gui.widgets.arrangement.check_display_disconnected_outputs = check;
|
||||||
|
|
||||||
//Add smart move area with outputs
|
area = e_layout_add(canvas);
|
||||||
//initialize smart object
|
e_config_runtime_info->gui.widgets.arrangement.area = area;
|
||||||
evas_object_smart_clipped_smart_set(&screen_setup_smart_class);
|
|
||||||
screen_setup_smart_class.resize = _arrangement_widget_smart_class_resize;
|
|
||||||
screen_setup_smart = evas_smart_class_new(&screen_setup_smart_class);
|
|
||||||
|
|
||||||
area = evas_object_smart_add(canvas, screen_setup_smart);
|
|
||||||
e_config_runtime_info->gui.subdialogs.arrangement.clipper = evas_object_smart_clipped_clipper_get(area);
|
|
||||||
e_config_runtime_info->gui.subdialogs.arrangement.smart_parent = area;
|
|
||||||
_arrangement_widget_update();
|
_arrangement_widget_update();
|
||||||
fprintf(stderr, "CONF_RANDR: Arrangement subdialog added (%p).\n", subdialog);
|
|
||||||
|
|
||||||
// Append both objects to widget list
|
// Append both objects to widget list
|
||||||
e_widget_list_object_append(subdialog, area, EVAS_HINT_FILL, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
|
e_widget_list_object_append(widget, area, EVAS_HINT_FILL, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
|
||||||
e_widget_list_object_append(subdialog, check, 0, 0, 1.0);
|
e_widget_list_object_append(widget, check, 0, 0, 1.0);
|
||||||
|
|
||||||
e_config_runtime_info->gui.subdialogs.arrangement.widget_list = subdialog;
|
evas_object_show(area);
|
||||||
|
|
||||||
return subdialog;
|
e_config_runtime_info->gui.widgets.arrangement.widget_list = widget;
|
||||||
|
|
||||||
|
return widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Evas_Object *
|
static Evas_Object *
|
||||||
|
@ -199,7 +202,7 @@ _arrangement_widget_rep_add(Evas *canvas, E_Config_Randr_Dialog_Output_Dialog_Da
|
||||||
//set theme for monitor representation
|
//set theme for monitor representation
|
||||||
EINA_SAFETY_ON_FALSE_GOTO(edje_object_file_set(rep, _theme_file_path, "e/conf/randr/dialog/subdialog/arrangement/output"), _arrangement_widget_rep_add_edje_set_fail);
|
EINA_SAFETY_ON_FALSE_GOTO(edje_object_file_set(rep, _theme_file_path, "e/conf/randr/dialog/subdialog/arrangement/output"), _arrangement_widget_rep_add_edje_set_fail);
|
||||||
//indicate monitor state
|
//indicate monitor state
|
||||||
if (!output_dialog_data->crtc || (output_dialog_data->crtc && !output_dialog_data->previous_mode))
|
if (!(output_dialog_data->crtc && output_dialog_data->crtc->current_mode))
|
||||||
state_signal = "disabled";
|
state_signal = "disabled";
|
||||||
else
|
else
|
||||||
state_signal = "enabled";
|
state_signal = "enabled";
|
||||||
|
@ -207,6 +210,7 @@ _arrangement_widget_rep_add(Evas *canvas, E_Config_Randr_Dialog_Output_Dialog_Da
|
||||||
//for now use deskpreview widget as background of rep, maybe change this to
|
//for now use deskpreview widget as background of rep, maybe change this to
|
||||||
//live image from comp module
|
//live image from comp module
|
||||||
output_dialog_data->bg = e_widget_deskpreview_add(canvas, 1, 1);
|
output_dialog_data->bg = e_widget_deskpreview_add(canvas, 1, 1);
|
||||||
|
//output_dialog_data->bg = e_livethumb_add(canvas);
|
||||||
edje_object_part_swallow(rep, "e.swallow.content", output_dialog_data->bg);
|
edje_object_part_swallow(rep, "e.swallow.content", output_dialog_data->bg);
|
||||||
|
|
||||||
//Try to get the name of the monitor connected to the output's last output via edid
|
//Try to get the name of the monitor connected to the output's last output via edid
|
||||||
|
@ -225,9 +229,6 @@ _arrangement_widget_rep_add(Evas *canvas, E_Config_Randr_Dialog_Output_Dialog_Da
|
||||||
if (output_name)
|
if (output_name)
|
||||||
edje_object_part_text_set(rep, "output_txt", output_name);
|
edje_object_part_text_set(rep, "output_txt", output_name);
|
||||||
|
|
||||||
//set output orientation
|
|
||||||
orientation_widget_update_edje(rep);
|
|
||||||
|
|
||||||
evas_object_event_callback_add (rep, EVAS_CALLBACK_MOUSE_DOWN, _arrangement_widget_rep_mouse_down_cb, NULL);
|
evas_object_event_callback_add (rep, EVAS_CALLBACK_MOUSE_DOWN, _arrangement_widget_rep_mouse_down_cb, NULL);
|
||||||
evas_object_event_callback_add (rep, EVAS_CALLBACK_MOUSE_MOVE, _arrangement_widget_rep_mouse_move_cb, NULL);
|
evas_object_event_callback_add (rep, EVAS_CALLBACK_MOUSE_MOVE, _arrangement_widget_rep_mouse_move_cb, NULL);
|
||||||
evas_object_event_callback_add (rep, EVAS_CALLBACK_MOUSE_UP, _arrangement_widget_rep_mouse_up_cb, NULL);
|
evas_object_event_callback_add (rep, EVAS_CALLBACK_MOUSE_UP, _arrangement_widget_rep_mouse_up_cb, NULL);
|
||||||
|
@ -244,136 +245,34 @@ _arrangement_widget_rep_del(Evas_Object *rep)
|
||||||
{
|
{
|
||||||
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
||||||
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN(rep);
|
if (!rep)
|
||||||
|
return;
|
||||||
|
|
||||||
evas_object_hide(rep);
|
evas_object_hide(rep);
|
||||||
//get instance data for output
|
|
||||||
output_dialog_data = evas_object_data_get(rep, "rep_info");
|
|
||||||
|
|
||||||
edje_object_part_unswallow(rep, output_dialog_data->bg);
|
|
||||||
evas_object_del(output_dialog_data->bg);
|
|
||||||
|
|
||||||
evas_object_event_callback_del(rep, EVAS_CALLBACK_MOUSE_DOWN, _arrangement_widget_rep_mouse_down_cb);
|
evas_object_event_callback_del(rep, EVAS_CALLBACK_MOUSE_DOWN, _arrangement_widget_rep_mouse_down_cb);
|
||||||
evas_object_event_callback_del(rep, EVAS_CALLBACK_MOUSE_MOVE, _arrangement_widget_rep_mouse_move_cb);
|
evas_object_event_callback_del(rep, EVAS_CALLBACK_MOUSE_MOVE, _arrangement_widget_rep_mouse_move_cb);
|
||||||
evas_object_event_callback_del(rep, EVAS_CALLBACK_MOUSE_UP, _arrangement_widget_rep_mouse_up_cb);
|
evas_object_event_callback_del(rep, EVAS_CALLBACK_MOUSE_UP, _arrangement_widget_rep_mouse_up_cb);
|
||||||
|
|
||||||
//set output orientation
|
//get instance data for output
|
||||||
|
if((output_dialog_data = evas_object_data_get(rep, "rep_info")))
|
||||||
|
{
|
||||||
|
edje_object_part_unswallow(rep, output_dialog_data->bg);
|
||||||
|
evas_object_del(output_dialog_data->bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
//update output orientation
|
||||||
orientation_widget_update_edje(NULL);
|
orientation_widget_update_edje(NULL);
|
||||||
|
|
||||||
evas_object_del(rep);
|
evas_object_del(rep);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
_arrangement_widget_smart_class_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
||||||
{
|
|
||||||
Evas_Object *rep;
|
|
||||||
Evas_Coord real_sum_w = 0, real_sum_h = 0;
|
|
||||||
Eina_Rectangle parent_geo, new_geo;
|
|
||||||
Evas_Coord_Point offset = {.x = 0, .y = 0};
|
|
||||||
Evas_Coord offset_x_max = 0;
|
|
||||||
float scaling_factor = 0.1;
|
|
||||||
Eina_List *lst, *itr;
|
|
||||||
const E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
|
||||||
|
|
||||||
evas_object_geometry_get(obj, &parent_geo.x, &parent_geo.y, &parent_geo.w, &parent_geo.h);
|
|
||||||
fprintf(stderr, "CONF_RANDR: Arrangement dialog shall be resized to %d x %d\n", w, h);
|
|
||||||
fprintf(stderr, "CONF_RANDR: Arrangement dialog Smart object geo: %d x %d, %d x %d\n", parent_geo.x, parent_geo.y, parent_geo.w, parent_geo.h);
|
|
||||||
if ((w < 1) || (h < 1)) return;
|
|
||||||
|
|
||||||
lst = evas_object_smart_members_get(obj);
|
|
||||||
//Calc average aspect ratio from all available monitors
|
|
||||||
EINA_LIST_FOREACH(lst, itr, rep)
|
|
||||||
{
|
|
||||||
if (rep == e_config_runtime_info->gui.subdialogs.arrangement.clipper) continue;
|
|
||||||
output_dialog_data = evas_object_data_get(rep, "rep_info");
|
|
||||||
if (!output_dialog_data) continue;
|
|
||||||
if ((!output_dialog_data->previous_mode) && (!output_dialog_data->preferred_mode)) continue;
|
|
||||||
if (output_dialog_data->previous_mode)
|
|
||||||
{
|
|
||||||
real_sum_w += output_dialog_data->previous_mode->width;
|
|
||||||
real_sum_h += output_dialog_data->previous_mode->height;
|
|
||||||
}
|
|
||||||
else if (output_dialog_data->preferred_mode)
|
|
||||||
{
|
|
||||||
real_sum_w += output_dialog_data->preferred_mode->width;
|
|
||||||
real_sum_h += output_dialog_data->preferred_mode->height;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
real_sum_w += e_config_runtime_info->gui.subdialogs.arrangement.disabled_output_size.w;
|
|
||||||
real_sum_h += e_config_runtime_info->gui.subdialogs.arrangement.disabled_output_size.h;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
scaling_factor = (((float)parent_geo.w / (float)real_sum_w) < ((float)parent_geo.h / (float)real_sum_h)) ? ((float)parent_geo.w / (float)real_sum_w) : ((float)parent_geo.h / (float)real_sum_h);
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH(lst, itr, rep)
|
|
||||||
{
|
|
||||||
//Skip elements that are either the clipped smart object or falsely added
|
|
||||||
//to the list of outputs (which should not happen)
|
|
||||||
if (rep == e_config_runtime_info->gui.subdialogs.arrangement.clipper) continue;
|
|
||||||
output_dialog_data = evas_object_data_get(rep, "rep_info");
|
|
||||||
if (!output_dialog_data) continue;
|
|
||||||
if (output_dialog_data->previous_mode)
|
|
||||||
{
|
|
||||||
new_geo.w = (int)((float)output_dialog_data->previous_mode->width * scaling_factor);
|
|
||||||
new_geo.h = (int)((float)output_dialog_data->previous_mode->height * scaling_factor);
|
|
||||||
}
|
|
||||||
else if (output_dialog_data->preferred_mode)
|
|
||||||
{
|
|
||||||
new_geo.w = (int)((float)output_dialog_data->preferred_mode->width * scaling_factor);
|
|
||||||
new_geo.h = (int)((float)output_dialog_data->preferred_mode->height * scaling_factor);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
new_geo.w = (int)((float)e_config_runtime_info->gui.subdialogs.arrangement.disabled_output_size.w * scaling_factor);
|
|
||||||
new_geo.h = (int)((float)e_config_runtime_info->gui.subdialogs.arrangement.disabled_output_size.h * scaling_factor);
|
|
||||||
fprintf(stderr, "CONF_RANDR: Neither mode nor preferred mode are avavailable for %d. Using %dx%d.\n", (output_dialog_data->crtc ? output_dialog_data->crtc->xid : output_dialog_data->output->xid), e_config_runtime_info->gui.subdialogs.arrangement.disabled_output_size.w, e_config_runtime_info->gui.subdialogs.arrangement.disabled_output_size.h);
|
|
||||||
}
|
|
||||||
if ((new_geo.w <= 0) || (new_geo.h <= 0))
|
|
||||||
{
|
|
||||||
//this is an effect, occuring during dialog closing.
|
|
||||||
//If we don't return here, e_thumb will segfault!
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ((output_dialog_data->previous_pos.x == Ecore_X_Randr_Unset) || (output_dialog_data->previous_pos.y == Ecore_X_Randr_Unset))
|
|
||||||
{
|
|
||||||
//this is a non enabled monitor
|
|
||||||
new_geo.x = parent_geo.x + parent_geo.w - new_geo.w - offset.x;
|
|
||||||
new_geo.y = parent_geo.y + offset.y;
|
|
||||||
offset.y = new_geo.y + new_geo.h;
|
|
||||||
if (offset_x_max < new_geo.w)
|
|
||||||
{
|
|
||||||
//adopt new max value for x
|
|
||||||
offset_x_max = new_geo.w;
|
|
||||||
}
|
|
||||||
if ((offset.y + new_geo.h) > (parent_geo.y + parent_geo.h))
|
|
||||||
{
|
|
||||||
//reset offset.y and adjust offset.x
|
|
||||||
offset.y = 0;
|
|
||||||
offset.x += offset_x_max;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
new_geo.x = ((int)((float)output_dialog_data->previous_pos.x * scaling_factor)) + parent_geo.x;
|
|
||||||
new_geo.y = ((int)((float)output_dialog_data->previous_pos.y * scaling_factor)) + parent_geo.y;
|
|
||||||
}
|
|
||||||
//resize edje element
|
|
||||||
evas_object_resize(rep, new_geo.w, new_geo.h);
|
|
||||||
//also resize bg
|
|
||||||
evas_object_move(rep, new_geo.x, new_geo.y);
|
|
||||||
fprintf(stderr, "CONF_RANDR: output representation %p was resized to %d x %d\n", rep, new_geo.w, new_geo.h);
|
|
||||||
fprintf(stderr, "CONF_RANDR: output representation %p was moved to %d x %d\n", rep, new_geo.x, new_geo.y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_arrangement_widget_check_mouse_down_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
|
_arrangement_widget_check_mouse_down_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
|
||||||
{
|
{
|
||||||
if (!obj || !e_config_runtime_info || !randr_dialog_config) return;
|
if (!obj || !e_config_runtime_info || !randr_dialog_config) return;
|
||||||
|
|
||||||
if (obj == e_config_runtime_info->gui.subdialogs.arrangement.check_display_disconnected_outputs)
|
if (obj == e_config_runtime_info->gui.widgets.arrangement.check_display_disconnected_outputs)
|
||||||
{
|
{
|
||||||
//this is bad. The events are called _before_ the value is updated.
|
//this is bad. The events are called _before_ the value is updated.
|
||||||
randr_dialog_config->display_disconnected_outputs ^= EINA_TRUE;
|
randr_dialog_config->display_disconnected_outputs ^= EINA_TRUE;
|
||||||
|
@ -384,35 +283,31 @@ _arrangement_widget_check_mouse_down_cb(void *data __UNUSED__, Evas *e __UNUSED_
|
||||||
static void
|
static void
|
||||||
_arrangement_widget_rep_mouse_down_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
|
_arrangement_widget_rep_mouse_down_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
|
||||||
{
|
{
|
||||||
Evas_Object *element = NULL;
|
Evas_Object *rep = NULL;
|
||||||
Eina_List *iter;
|
Eina_List *iter;
|
||||||
Eina_Bool crtc_selected = EINA_FALSE;
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH(evas_object_smart_members_get(evas_object_smart_parent_get(obj)), iter, element)
|
EINA_LIST_FOREACH(e_config_runtime_info->output_dialog_data_list, iter, rep)
|
||||||
{
|
{
|
||||||
if (e_config_runtime_info->gui.subdialogs.arrangement.clipper == obj) continue;
|
if (rep == obj)
|
||||||
if (element != obj)
|
continue;
|
||||||
edje_object_signal_emit(element, "deselect", "e");
|
edje_object_signal_emit(rep, "deselect", "e");
|
||||||
else
|
|
||||||
{
|
|
||||||
edje_object_signal_emit(element, "select", "e");
|
|
||||||
//update data for other dialogs
|
|
||||||
e_config_runtime_info->gui.selected_eo = obj;
|
|
||||||
e_config_runtime_info->gui.selected_output_dd = evas_object_data_get(obj, "rep_info");
|
|
||||||
|
|
||||||
//update resolutions list
|
|
||||||
resolution_widget_update_list(obj);
|
|
||||||
|
|
||||||
//update orientation radio buttons
|
|
||||||
orientation_widget_update_radio_buttons(obj);
|
|
||||||
|
|
||||||
//update policy radio buttons
|
|
||||||
policy_widget_update_radio_buttons(obj);
|
|
||||||
|
|
||||||
crtc_selected = EINA_TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!crtc_selected)
|
|
||||||
|
edje_object_signal_emit(obj, "select", "e");
|
||||||
|
//update data for other dialogs
|
||||||
|
e_config_runtime_info->gui.selected_eo = obj;
|
||||||
|
e_config_runtime_info->gui.selected_output_dd = evas_object_data_get(obj, "rep_info");
|
||||||
|
|
||||||
|
//update resolutions list
|
||||||
|
resolution_widget_update_list(obj);
|
||||||
|
|
||||||
|
//update orientation radio buttons
|
||||||
|
orientation_widget_update_radio_buttons(obj);
|
||||||
|
|
||||||
|
//update policy radio buttons
|
||||||
|
policy_widget_update_radio_buttons(obj);
|
||||||
|
|
||||||
|
if (!obj)
|
||||||
{
|
{
|
||||||
//update data for other dialogs
|
//update data for other dialogs
|
||||||
e_config_runtime_info->gui.selected_eo = NULL;
|
e_config_runtime_info->gui.selected_eo = NULL;
|
||||||
|
@ -427,8 +322,6 @@ _arrangement_widget_rep_mouse_down_cb(void *data __UNUSED__, Evas *e __UNUSED__,
|
||||||
//update policy radio buttons
|
//update policy radio buttons
|
||||||
policy_widget_update_radio_buttons(NULL);
|
policy_widget_update_radio_buttons(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_object_geometry_get(obj, &e_config_runtime_info->gui.subdialogs.arrangement.previous_pos.x, &e_config_runtime_info->gui.subdialogs.arrangement.previous_pos.y, NULL, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -440,7 +333,8 @@ _arrangement_widget_rep_mouse_move_cb(void *data __UNUSED__, Evas *e __UNUSED__,
|
||||||
|
|
||||||
if (ev->buttons != 1) return;
|
if (ev->buttons != 1) return;
|
||||||
evas_object_geometry_get (obj, &geo.x, &geo.y, &geo.w, &geo.h);
|
evas_object_geometry_get (obj, &geo.x, &geo.y, &geo.w, &geo.h);
|
||||||
evas_object_geometry_get (evas_object_smart_parent_get(obj), &parent.x, &parent.y, &parent.w, &parent.h);
|
EINA_RECTANGLE_SET(&parent, 0, 0, e_randr_screen_info.rrvd_info.randr_info_12->current_size.width, e_randr_screen_info.rrvd_info.randr_info_12->current_size.height);
|
||||||
|
|
||||||
delta.x = ev->cur.canvas.x - ev->prev.canvas.x;
|
delta.x = ev->cur.canvas.x - ev->prev.canvas.x;
|
||||||
delta.y = ev->cur.canvas.y - ev->prev.canvas.y;
|
delta.y = ev->cur.canvas.y - ev->prev.canvas.y;
|
||||||
|
|
||||||
|
@ -468,16 +362,12 @@ _arrangement_widget_rep_mouse_up_cb(void *data __UNUSED__, Evas *e __UNUSED__, E
|
||||||
{
|
{
|
||||||
Evas_Coord_Point coords;
|
Evas_Coord_Point coords;
|
||||||
|
|
||||||
if (evas_object_visible_get(e_config_runtime_info->gui.subdialogs.arrangement.suggestion))
|
if (evas_object_visible_get(e_config_runtime_info->gui.widgets.arrangement.suggestion))
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(e_config_runtime_info->gui.subdialogs.arrangement.suggestion, "hide", "e");
|
edje_object_signal_emit(e_config_runtime_info->gui.widgets.arrangement.suggestion, "hide", "e");
|
||||||
evas_object_geometry_get(e_config_runtime_info->gui.subdialogs.arrangement.suggestion, &coords.x, &coords.y, NULL, NULL);
|
evas_object_geometry_get(e_config_runtime_info->gui.widgets.arrangement.suggestion, &coords.x, &coords.y, NULL, NULL);
|
||||||
evas_object_move(obj, coords.x, coords.y);
|
evas_object_move(obj, coords.x, coords.y);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
evas_object_move(obj, e_config_runtime_info->gui.subdialogs.arrangement.previous_pos.x, e_config_runtime_info->gui.subdialogs.arrangement.previous_pos.y);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -485,34 +375,33 @@ _arrangement_widget_suggestion_add(Evas *evas)
|
||||||
{
|
{
|
||||||
const char *theme_data_item = NULL;
|
const char *theme_data_item = NULL;
|
||||||
|
|
||||||
e_config_runtime_info->gui.subdialogs.arrangement.suggestion = edje_object_add(evas);
|
e_config_runtime_info->gui.widgets.arrangement.suggestion = edje_object_add(evas);
|
||||||
edje_object_file_set(e_config_runtime_info->gui.subdialogs.arrangement.suggestion, _theme_file_path, "e/conf/randr/dialog/subdialog/arrangement/suggestion");
|
edje_object_file_set(e_config_runtime_info->gui.widgets.arrangement.suggestion, _theme_file_path, "e/conf/randr/dialog/subdialog/arrangement/suggestion");
|
||||||
if ((theme_data_item = edje_object_data_get(e_config_runtime_info->gui.subdialogs.arrangement.suggestion, "distance_min")))
|
if ((theme_data_item = edje_object_data_get(e_config_runtime_info->gui.widgets.arrangement.suggestion, "distance_min")))
|
||||||
e_config_runtime_info->gui.subdialogs.arrangement.suggestion_dist_min = MIN(MAX(atoi(theme_data_item), 0), 100);
|
e_config_runtime_info->gui.widgets.arrangement.suggestion_dist_min = MIN(MAX(atoi(theme_data_item), 0), 100);
|
||||||
else
|
else
|
||||||
e_config_runtime_info->gui.subdialogs.arrangement.suggestion_dist_min = 20;
|
e_config_runtime_info->gui.widgets.arrangement.suggestion_dist_min = 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_arrangement_widget_make_suggestion(Evas_Object *obj)
|
_arrangement_widget_make_suggestion(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Eina_List *li, *crtcs = evas_object_smart_members_get(evas_object_smart_parent_get(obj));
|
Evas_Object *rep = NULL;
|
||||||
Evas_Object *crtc = NULL;
|
Eina_Rectangle p_geo = {.x = 0, .y = 0, .w = 0, .h = 0}, geo, rep_geo, s_geo;
|
||||||
Eina_Rectangle p_geo, geo, crtc_geo, s_geo;
|
int dxa = INT_MAX, dya = INT_MAX, tmp, min_dist;
|
||||||
int dxa = 10000, dya = 10000, tmp, min_dist;
|
Eina_List *li;
|
||||||
|
|
||||||
if (!obj) return;
|
if (!obj) return;
|
||||||
|
|
||||||
if (!e_config_runtime_info->gui.subdialogs.arrangement.suggestion)
|
if (!e_config_runtime_info->gui.widgets.arrangement.suggestion)
|
||||||
{
|
{
|
||||||
_arrangement_widget_suggestion_add(evas_object_evas_get(obj));
|
_arrangement_widget_suggestion_add(evas_object_evas_get(obj));
|
||||||
evas_object_show(e_config_runtime_info->gui.subdialogs.arrangement.suggestion);
|
evas_object_show(e_config_runtime_info->gui.widgets.arrangement.suggestion);
|
||||||
}
|
}
|
||||||
|
|
||||||
min_dist = e_config_runtime_info->gui.subdialogs.arrangement.suggestion_dist_min;
|
min_dist = e_config_runtime_info->gui.widgets.arrangement.suggestion_dist_min;
|
||||||
|
|
||||||
evas_object_geometry_get(evas_object_smart_parent_get(obj), &p_geo.x, &p_geo.y, &p_geo.w, &p_geo.h);
|
e_layout_child_geometry_get(obj, &geo.x, &geo.y, &geo.w, &geo.h);
|
||||||
evas_object_geometry_get(obj, &geo.x, &geo.y, &geo.w, &geo.h);
|
|
||||||
|
|
||||||
s_geo.x = geo.x;
|
s_geo.x = geo.x;
|
||||||
s_geo.y = geo.y;
|
s_geo.y = geo.y;
|
||||||
|
@ -533,66 +422,65 @@ _arrangement_widget_make_suggestion(Evas_Object *obj)
|
||||||
s_geo.y = p_geo.y;
|
s_geo.y = p_geo.y;
|
||||||
dya = tmp;
|
dya = tmp;
|
||||||
}
|
}
|
||||||
//iterate crtc list
|
//iterate rep list
|
||||||
EINA_LIST_FOREACH(crtcs, li, crtc)
|
EINA_LIST_FOREACH(e_config_runtime_info->output_dialog_data_list, li, rep)
|
||||||
{
|
{
|
||||||
if ((crtc == obj) || (crtc == e_config_runtime_info->gui.subdialogs.arrangement.clipper)) continue;
|
e_layout_child_geometry_get(rep, &rep_geo.x, &rep_geo.y, &rep_geo.w, &rep_geo.h);
|
||||||
evas_object_geometry_get(crtc, &crtc_geo.x, &crtc_geo.y, &crtc_geo.w, &crtc_geo.h);
|
|
||||||
//X-Axis
|
//X-Axis
|
||||||
tmp = abs(s_geo.x - crtc_geo.x);
|
tmp = abs(s_geo.x - rep_geo.x);
|
||||||
if ((tmp < dxa) && (tmp < min_dist))
|
if ((tmp < dxa) && (tmp < min_dist))
|
||||||
{
|
{
|
||||||
s_geo.x = crtc_geo.x;
|
s_geo.x = rep_geo.x;
|
||||||
dxa = abs(s_geo.x - crtc_geo.x);
|
dxa = abs(s_geo.x - rep_geo.x);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = abs(s_geo.x - (crtc_geo.x + crtc_geo.w));
|
tmp = abs(s_geo.x - (rep_geo.x + rep_geo.w));
|
||||||
if ((tmp < dxa) && (tmp < min_dist))
|
if ((tmp < dxa) && (tmp < min_dist))
|
||||||
{
|
{
|
||||||
s_geo.x = (crtc_geo.x + crtc_geo.w);
|
s_geo.x = (rep_geo.x + rep_geo.w);
|
||||||
dxa = tmp;
|
dxa = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = abs((s_geo.x + s_geo.w) - (crtc_geo.x - 1));
|
tmp = abs((s_geo.x + s_geo.w) - (rep_geo.x - 1));
|
||||||
if ((tmp < dxa) && (tmp < min_dist))
|
if ((tmp < dxa) && (tmp < min_dist))
|
||||||
{
|
{
|
||||||
s_geo.x = (crtc_geo.x - s_geo.w);
|
s_geo.x = (rep_geo.x - s_geo.w);
|
||||||
dxa = tmp;
|
dxa = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = abs((s_geo.x + s_geo.w) - (crtc_geo.x + crtc_geo.w));
|
tmp = abs((s_geo.x + s_geo.w) - (rep_geo.x + rep_geo.w));
|
||||||
if ((tmp < dxa) && (tmp < min_dist))
|
if ((tmp < dxa) && (tmp < min_dist))
|
||||||
{
|
{
|
||||||
s_geo.x = (crtc_geo.x + crtc_geo.w - s_geo.w);
|
s_geo.x = (rep_geo.x + rep_geo.w - s_geo.w);
|
||||||
dxa = tmp;
|
dxa = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Y-Axis
|
//Y-Axis
|
||||||
tmp = abs(s_geo.y - crtc_geo.y);
|
tmp = abs(s_geo.y - rep_geo.y);
|
||||||
if ((tmp < dya) && (tmp < min_dist))
|
if ((tmp < dya) && (tmp < min_dist))
|
||||||
{
|
{
|
||||||
s_geo.y = crtc_geo.y;
|
s_geo.y = rep_geo.y;
|
||||||
dya = abs(s_geo.y - crtc_geo.y);
|
dya = abs(s_geo.y - rep_geo.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = abs(s_geo.y - (crtc_geo.y + crtc_geo.h));
|
tmp = abs(s_geo.y - (rep_geo.y + rep_geo.h));
|
||||||
if ((tmp < dya) && (tmp < min_dist))
|
if ((tmp < dya) && (tmp < min_dist))
|
||||||
{
|
{
|
||||||
s_geo.y = (crtc_geo.y + crtc_geo.h);
|
s_geo.y = (rep_geo.y + rep_geo.h);
|
||||||
dya = tmp;
|
dya = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = abs((s_geo.y + s_geo.h) - (crtc_geo.y - 1));
|
tmp = abs((s_geo.y + s_geo.h) - (rep_geo.y - 1));
|
||||||
if ((tmp < dya) && (tmp < min_dist))
|
if ((tmp < dya) && (tmp < min_dist))
|
||||||
{
|
{
|
||||||
s_geo.y = (crtc_geo.y - s_geo.h);
|
s_geo.y = (rep_geo.y - s_geo.h);
|
||||||
dya = tmp;
|
dya = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = abs((s_geo.y + s_geo.h) - (crtc_geo.y + crtc_geo.h));
|
tmp = abs((s_geo.y + s_geo.h) - (rep_geo.y + rep_geo.h));
|
||||||
if ((tmp < dya) && (tmp < min_dist))
|
if ((tmp < dya) && (tmp < min_dist))
|
||||||
{
|
{
|
||||||
s_geo.y = (crtc_geo.y + crtc_geo.h - s_geo.h);
|
s_geo.y = (rep_geo.y + rep_geo.h - s_geo.h);
|
||||||
dya = tmp;
|
dya = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -604,19 +492,19 @@ _arrangement_widget_make_suggestion(Evas_Object *obj)
|
||||||
if (s_geo.y < p_geo.y) s_geo.y = p_geo.y;
|
if (s_geo.y < p_geo.y) s_geo.y = p_geo.y;
|
||||||
if ((s_geo.y + s_geo.h) > (p_geo.y + p_geo.h)) s_geo.y = ((p_geo.y + p_geo.h) - s_geo.h);
|
if ((s_geo.y + s_geo.h) > (p_geo.y + p_geo.h)) s_geo.y = ((p_geo.y + p_geo.h) - s_geo.h);
|
||||||
|
|
||||||
if (!evas_object_visible_get(e_config_runtime_info->gui.subdialogs.arrangement.suggestion))
|
if (!evas_object_visible_get(e_config_runtime_info->gui.widgets.arrangement.suggestion))
|
||||||
{
|
{
|
||||||
evas_object_show(e_config_runtime_info->gui.subdialogs.arrangement.suggestion);
|
evas_object_show(e_config_runtime_info->gui.widgets.arrangement.suggestion);
|
||||||
edje_object_signal_emit(e_config_runtime_info->gui.subdialogs.arrangement.suggestion, "show", "e");
|
edje_object_signal_emit(e_config_runtime_info->gui.widgets.arrangement.suggestion, "show", "e");
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_object_resize(e_config_runtime_info->gui.subdialogs.arrangement.suggestion, s_geo.w, s_geo.h);
|
evas_object_resize(e_config_runtime_info->gui.widgets.arrangement.suggestion, s_geo.w, s_geo.h);
|
||||||
evas_object_move(e_config_runtime_info->gui.subdialogs.arrangement.suggestion, s_geo.x, s_geo.y);
|
evas_object_move(e_config_runtime_info->gui.widgets.arrangement.suggestion, s_geo.x, s_geo.y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edje_object_signal_emit(e_config_runtime_info->gui.subdialogs.arrangement.suggestion, "hide", "e");
|
edje_object_signal_emit(e_config_runtime_info->gui.widgets.arrangement.suggestion, "hide", "e");
|
||||||
evas_object_hide(e_config_runtime_info->gui.subdialogs.arrangement.suggestion);
|
evas_object_hide(e_config_runtime_info->gui.widgets.arrangement.suggestion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -638,244 +526,61 @@ arrangement_widget_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Da
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_List *
|
|
||||||
_arrangement_widget_neighbors_get(Evas_Object *obj)
|
|
||||||
{
|
|
||||||
Evas_Object *smart_parent, *crtc;
|
|
||||||
Eina_List *crtcs, *iter, *neighbors = NULL;
|
|
||||||
Eina_Rectangle geo, neighbor_geo;
|
|
||||||
E_Config_Randr_Dialog_Output_Dialog_Data *dialog_data, *neighbor_info;
|
|
||||||
|
|
||||||
smart_parent = evas_object_smart_parent_get(obj);
|
|
||||||
crtcs = evas_object_smart_members_get(smart_parent);
|
|
||||||
|
|
||||||
EINA_SAFETY_ON_FALSE_RETURN_VAL((dialog_data = evas_object_data_get(obj, "rep_info")), NULL);
|
|
||||||
evas_object_geometry_get(obj, &geo.x, &geo.y, &geo.w, &geo.h);
|
|
||||||
EINA_LIST_FOREACH(crtcs, iter, crtc)
|
|
||||||
{
|
|
||||||
if ((crtc == obj)
|
|
||||||
|| (crtc == e_config_runtime_info->gui.subdialogs.arrangement.clipper)) continue;
|
|
||||||
evas_object_geometry_get(crtc, &neighbor_geo.x, &neighbor_geo.y, &neighbor_geo.w, &neighbor_geo.h);
|
|
||||||
if (!(neighbor_info = evas_object_data_get(crtc, "rep_info"))) continue;
|
|
||||||
if (!neighbor_info->previous_mode) continue;
|
|
||||||
|
|
||||||
if (((geo.x + geo.w) == neighbor_geo.x)
|
|
||||||
|| (geo.x == (neighbor_geo.x + neighbor_geo.w))
|
|
||||||
|| (geo.x == neighbor_geo.x)
|
|
||||||
|| ((geo.x + geo.w) == (neighbor_geo.x + neighbor_geo.w))
|
|
||||||
|| ((geo.y + geo.h) == neighbor_geo.y)
|
|
||||||
|| (geo.y == (neighbor_geo.y + neighbor_geo.h))
|
|
||||||
|| (geo.y == neighbor_geo.y)
|
|
||||||
|| ((geo.y + geo.h) == (neighbor_geo.y + neighbor_geo.h)))
|
|
||||||
{
|
|
||||||
neighbors = eina_list_append(neighbors, crtc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return neighbors;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_arrangement_widget_determine_positions_recursive(Evas_Object *obj)
|
|
||||||
{
|
|
||||||
Eina_List *neighbors, *iter;
|
|
||||||
Evas_Object *smart_parent, *crtc;
|
|
||||||
E_Config_Randr_Dialog_Output_Dialog_Data *dialog_data, *neighbor_info;
|
|
||||||
Eina_Rectangle geo, neighbor_geo, smart_geo;
|
|
||||||
|
|
||||||
// Each object is seen as a tree. All its edges are compared to their
|
|
||||||
// neighbors and wandered recusively.
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN(obj);
|
|
||||||
|
|
||||||
smart_parent = e_config_runtime_info->gui.subdialogs.arrangement.smart_parent;
|
|
||||||
evas_object_geometry_get(smart_parent, &smart_geo.x, &smart_geo.y, &smart_geo.w, &smart_geo.h);
|
|
||||||
//fprintf(stderr, "CONF_RANDR: Smart Parent is at %dx%d\n", smart_geo.x, smart_geo.y);
|
|
||||||
neighbors = _arrangement_widget_neighbors_get(obj);
|
|
||||||
|
|
||||||
EINA_SAFETY_ON_FALSE_RETURN((dialog_data = evas_object_data_get(obj, "rep_info")));
|
|
||||||
evas_object_geometry_get(obj, &geo.x, &geo.y, &geo.w, &geo.h);
|
|
||||||
|
|
||||||
//fprintf(stderr, "CONF_RANDR: Traversed element (%p) is at %dx%d\n", obj, geo.x, geo.y);
|
|
||||||
if (geo.x == e_config_runtime_info->gui.subdialogs.arrangement.relative_zero.x) dialog_data->new_pos.x = 0;
|
|
||||||
if (geo.y == e_config_runtime_info->gui.subdialogs.arrangement.relative_zero.y) dialog_data->new_pos.y = 0;
|
|
||||||
|
|
||||||
if ((dialog_data->new_pos.x != 0) || (dialog_data->new_pos.y != 0))
|
|
||||||
{
|
|
||||||
// Find neighbor object we can calculate our own coordinates from
|
|
||||||
EINA_LIST_FOREACH(neighbors, iter, crtc)
|
|
||||||
{
|
|
||||||
evas_object_geometry_get(crtc, &neighbor_geo.x, &neighbor_geo.y, &neighbor_geo.w, &neighbor_geo.h);
|
|
||||||
if (!(neighbor_info = evas_object_data_get(crtc, "rep_info"))) continue;
|
|
||||||
|
|
||||||
evas_object_geometry_get(crtc, &neighbor_geo.x, &neighbor_geo.y, &neighbor_geo.w, &neighbor_geo.h);
|
|
||||||
|
|
||||||
if ((dialog_data->new_pos.x == Ecore_X_Randr_Unset) && (neighbor_info->new_pos.x != Ecore_X_Randr_Unset))
|
|
||||||
{
|
|
||||||
if ((geo.x + geo.w) == neighbor_geo.x)
|
|
||||||
{
|
|
||||||
dialog_data->new_pos.x = neighbor_info->new_pos.x - dialog_data->previous_mode->width;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (geo.x == (neighbor_geo.x + neighbor_geo.w))
|
|
||||||
{
|
|
||||||
dialog_data->new_pos.x = neighbor_info->new_pos.x + neighbor_info->previous_mode->width;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (geo.x == neighbor_geo.x)
|
|
||||||
{
|
|
||||||
dialog_data->new_pos.x = neighbor_info->new_pos.x;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((geo.x + geo.w) == (neighbor_geo.x + neighbor_geo.w))
|
|
||||||
{
|
|
||||||
dialog_data->new_pos.x = (neighbor_info->new_pos.x + neighbor_info->previous_mode->width) - dialog_data->previous_mode->width;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((dialog_data->new_pos.y == Ecore_X_Randr_Unset) && (neighbor_info->new_pos.y != Ecore_X_Randr_Unset))
|
|
||||||
{
|
|
||||||
if ((geo.y + geo.h) == neighbor_geo.y)
|
|
||||||
{
|
|
||||||
dialog_data->new_pos.y = neighbor_info->new_pos.y - dialog_data->previous_mode->height;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (geo.y == (neighbor_geo.y + neighbor_geo.h))
|
|
||||||
{
|
|
||||||
dialog_data->new_pos.y = neighbor_info->new_pos.y + neighbor_info->previous_mode->height;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (geo.y == neighbor_geo.y)
|
|
||||||
{
|
|
||||||
dialog_data->new_pos.y = neighbor_info->new_pos.y;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((geo.y + geo.h) == (neighbor_geo.y + neighbor_geo.h))
|
|
||||||
{
|
|
||||||
dialog_data->new_pos.y = (neighbor_info->new_pos.y + neighbor_info->previous_mode->height) - dialog_data->previous_mode->height;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((dialog_data->new_pos.x != Ecore_X_Randr_Unset)
|
|
||||||
&& (dialog_data->new_pos.y != Ecore_X_Randr_Unset))
|
|
||||||
{
|
|
||||||
//fprintf(stderr, "CONF_RANDR: Determined position for %p: %dx%d\n", obj, dialog_data->new_pos.x, dialog_data->new_pos.y);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((dialog_data->new_pos.x != Ecore_X_Randr_Unset) || (dialog_data->new_pos.y != Ecore_X_Randr_Unset))
|
|
||||||
{
|
|
||||||
//Only wander all neighbors recursively, if they can use the current
|
|
||||||
//element as reference for their position
|
|
||||||
EINA_LIST_FOREACH(neighbors, iter, crtc)
|
|
||||||
{
|
|
||||||
neighbor_info = evas_object_data_get(crtc, "rep_info");
|
|
||||||
if ((neighbor_info->new_pos.x == Ecore_X_Randr_Unset)
|
|
||||||
|| (neighbor_info->new_pos.y == Ecore_X_Randr_Unset))
|
|
||||||
{
|
|
||||||
//fprintf(stderr, "CONF_RANDR: Now going to travel %p.\n", crtc);
|
|
||||||
_arrangement_widget_determine_positions_recursive(crtc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
eina_list_free(neighbors);
|
|
||||||
}
|
|
||||||
|
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
arrangement_widget_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata __UNUSED__)
|
arrangement_widget_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
Eina_List *crtcs, *iter;
|
|
||||||
Evas_Object *smart_parent, *crtc, *top_left = NULL;
|
|
||||||
Eina_Rectangle geo, smart_geo;
|
|
||||||
E_Config_Randr_Dialog_Output_Dialog_Data *odd;
|
E_Config_Randr_Dialog_Output_Dialog_Data *odd;
|
||||||
Evas_Coord_Point relz = { .x = 10000, .y = 10000};
|
Evas_Coord_Point pos = {.x = 0, .y = 0};
|
||||||
Eina_Bool arrangement_failed = EINA_FALSE;
|
Eina_Bool success = EINA_TRUE;
|
||||||
|
Eina_List *iter;
|
||||||
|
|
||||||
smart_parent = e_config_runtime_info->gui.subdialogs.arrangement.smart_parent;
|
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
|
||||||
evas_object_geometry_get(smart_parent, &smart_geo.x, &smart_geo.y, &smart_geo.w, &smart_geo.h);
|
|
||||||
crtcs = evas_object_smart_members_get(smart_parent);
|
|
||||||
|
|
||||||
//Create virtual borders around the displayed representations by finding
|
|
||||||
//relative x and y as virtual 0x0
|
|
||||||
EINA_LIST_FOREACH(crtcs, iter, crtc)
|
|
||||||
{
|
{
|
||||||
if (crtc == e_config_runtime_info->gui.subdialogs.arrangement.clipper) continue;
|
if (!odd->crtc || !odd->crtc->current_mode)
|
||||||
//Already reset values for upcoming calculation
|
continue;
|
||||||
if (!(odd = evas_object_data_get(crtc, "rep_info"))) continue;
|
e_layout_child_geometry_get(odd->rep, &pos.x, &pos.y, NULL, NULL);
|
||||||
odd->new_pos.x = Ecore_X_Randr_Unset;
|
fprintf(stderr, "CONF_RANDR: Rearranging CRTC %d to (x.y): %d.%d\n", odd->crtc->xid, pos.x, pos.y);
|
||||||
odd->new_pos.y = Ecore_X_Randr_Unset;
|
/*
|
||||||
odd = NULL;
|
#define EQL(c) (pos.c == odd->crtc->geometry.c)
|
||||||
|
if (!EQL(x) || !EQL(y))
|
||||||
//See whether this element is closer to 0x0 than any before
|
success |= ecore_x_randr_crtc_pos_set(cfd->con->manager->root, odd->crtc->xid, pos.x, pos.y);
|
||||||
evas_object_geometry_get(crtc, &geo.x, &geo.y, &geo.w, &geo.h);
|
#undef EQL
|
||||||
if (geo.x < relz.x)
|
*/
|
||||||
{
|
odd->previous_pos.x = odd->crtc->geometry.x;
|
||||||
relz.x = geo.x;
|
odd->previous_pos.y = odd->crtc->geometry.y;
|
||||||
top_left = crtc;
|
|
||||||
}
|
|
||||||
if (geo.y < relz.y)
|
|
||||||
{
|
|
||||||
relz.y = geo.y;
|
|
||||||
top_left = crtc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
e_config_runtime_info->gui.subdialogs.arrangement.relative_zero.x = relz.x;
|
|
||||||
e_config_runtime_info->gui.subdialogs.arrangement.relative_zero.y = relz.y;
|
|
||||||
if (top_left) _arrangement_widget_determine_positions_recursive(top_left);
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH(crtcs, iter, crtc)
|
|
||||||
{
|
|
||||||
if ((crtc == e_config_runtime_info->gui.subdialogs.arrangement.clipper) || !(odd = evas_object_data_get(crtc, "rep_info")) || !odd->crtc
|
|
||||||
|| ((odd->new_pos.x == Ecore_X_Randr_Unset) || (odd->new_pos.y == Ecore_X_Randr_Unset))) continue;
|
|
||||||
if ((odd->previous_pos.x != odd->new_pos.x) || (odd->previous_pos.y != odd->new_pos.y))
|
|
||||||
{
|
|
||||||
fprintf(stderr, "CONF_RANDR: CRTC %d is moved to %dx%d\n", odd->crtc->xid, odd->new_pos.x, odd->new_pos.y);
|
|
||||||
if (!ecore_x_randr_crtc_pos_set(cfd->con->manager->root, odd->crtc->xid, odd->new_pos.x, odd->new_pos.y))
|
|
||||||
{
|
|
||||||
arrangement_failed = EINA_TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (arrangement_failed)
|
|
||||||
return EINA_FALSE;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ecore_x_randr_screen_reset(cfd->con->manager->root);
|
|
||||||
return EINA_TRUE;
|
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
if (success)
|
||||||
|
ecore_x_randr_screen_reset(cfd->con->manager->root);
|
||||||
|
*/
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
Eina_Bool
|
Eina_Bool
|
||||||
arrangement_widget_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
arrangement_widget_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
|
E_Config_Randr_Dialog_Output_Dialog_Data *odd = NULL;
|
||||||
|
Evas_Coord_Point pos = {.x = 0, .y = 0};
|
||||||
Eina_List *iter;
|
Eina_List *iter;
|
||||||
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, output_dialog_data)
|
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
|
||||||
{
|
{
|
||||||
if ((output_dialog_data->previous_pos.x != output_dialog_data->new_pos.x)
|
if (!odd->crtc || !odd->crtc->current_mode)
|
||||||
|| (output_dialog_data->previous_pos.y != output_dialog_data->new_pos.y)
|
continue;
|
||||||
) return EINA_TRUE;
|
e_layout_child_geometry_get(odd->rep, &pos.x, &pos.y, NULL, NULL);
|
||||||
|
fprintf(stderr, "CONF_RANDR: Checking coord of CRTC %d. They are: %d.%d\n", odd->crtc->xid, pos.x, pos.y);
|
||||||
|
#define EQL(c) (pos.c == odd->crtc->geometry.c)
|
||||||
|
if (!EQL(x) || !EQL(y))
|
||||||
|
return EINA_TRUE;
|
||||||
|
#undef EQL
|
||||||
}
|
}
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
arrangement_widget_keep_changes(E_Config_Dialog_Data *cfdata)
|
arrangement_widget_keep_changes(E_Config_Dialog_Data *cfdata __UNUSED__)
|
||||||
{
|
{
|
||||||
E_Config_Randr_Dialog_Output_Dialog_Data *odd;
|
return;
|
||||||
Eina_List *iter;
|
|
||||||
|
|
||||||
if (!cfdata) return;
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
|
|
||||||
{
|
|
||||||
if (!odd->crtc || ((odd->new_pos.x == Ecore_X_Randr_Unset) || (odd->new_pos.y == Ecore_X_Randr_Unset))) continue;
|
|
||||||
odd->previous_pos.x = odd->new_pos.x;
|
|
||||||
odd->previous_pos.y = odd->new_pos.y;
|
|
||||||
odd->new_pos.x = Ecore_X_Randr_Unset;
|
|
||||||
odd->new_pos.y = Ecore_X_Randr_Unset;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -891,10 +596,10 @@ arrangement_widget_discard_changes(E_Config_Dialog_Data *cfdata)
|
||||||
if (!odd->crtc || ((odd->previous_pos.x == Ecore_X_Randr_Unset) || (odd->previous_pos.y == Ecore_X_Randr_Unset))) continue;
|
if (!odd->crtc || ((odd->previous_pos.x == Ecore_X_Randr_Unset) || (odd->previous_pos.y == Ecore_X_Randr_Unset))) continue;
|
||||||
if (ecore_x_randr_crtc_pos_set(cfdata->manager->root, odd->crtc->xid, odd->previous_pos.x, odd->previous_pos.y))
|
if (ecore_x_randr_crtc_pos_set(cfdata->manager->root, odd->crtc->xid, odd->previous_pos.x, odd->previous_pos.y))
|
||||||
{
|
{
|
||||||
odd->new_pos.x = odd->previous_pos.x;
|
#define EQL(c) (odd->previous_pos.c == odd->crtc->geometry.c)
|
||||||
odd->new_pos.y = odd->previous_pos.y;
|
if (!EQL(x) || !EQL(y))
|
||||||
odd->previous_pos.x = Ecore_X_Randr_Unset;
|
ecore_x_randr_crtc_pos_set(cfdata->manager->root, odd->crtc->xid, odd->previous_pos.x, odd->previous_pos.y);
|
||||||
odd->previous_pos.y = Ecore_X_Randr_Unset;
|
#undef EQL
|
||||||
ecore_x_randr_screen_reset(cfdata->manager->root);
|
ecore_x_randr_screen_reset(cfdata->manager->root);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,12 +23,12 @@ extern char _theme_file_path[];
|
||||||
static void
|
static void
|
||||||
_orientation_widget_radio_add_callbacks(void)
|
_orientation_widget_radio_add_callbacks(void)
|
||||||
{
|
{
|
||||||
evas_object_event_callback_add (e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_vertical, EVAS_CALLBACK_MOUSE_UP, _orientation_widget_mouse_up_cb, NULL);
|
evas_object_event_callback_add (e_config_runtime_info->gui.widgets.orientation.radio_reflect_vertical, EVAS_CALLBACK_MOUSE_UP, _orientation_widget_mouse_up_cb, NULL);
|
||||||
evas_object_event_callback_add (e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_horizontal, EVAS_CALLBACK_MOUSE_UP, _orientation_widget_mouse_up_cb, NULL);
|
evas_object_event_callback_add (e_config_runtime_info->gui.widgets.orientation.radio_reflect_horizontal, EVAS_CALLBACK_MOUSE_UP, _orientation_widget_mouse_up_cb, NULL);
|
||||||
evas_object_event_callback_add (e_config_runtime_info->gui.subdialogs.orientation.radio_rot270, EVAS_CALLBACK_MOUSE_UP, _orientation_widget_mouse_up_cb, NULL);
|
evas_object_event_callback_add (e_config_runtime_info->gui.widgets.orientation.radio_rot270, EVAS_CALLBACK_MOUSE_UP, _orientation_widget_mouse_up_cb, NULL);
|
||||||
evas_object_event_callback_add (e_config_runtime_info->gui.subdialogs.orientation.radio_rot180, EVAS_CALLBACK_MOUSE_UP, _orientation_widget_mouse_up_cb, NULL);
|
evas_object_event_callback_add (e_config_runtime_info->gui.widgets.orientation.radio_rot180, EVAS_CALLBACK_MOUSE_UP, _orientation_widget_mouse_up_cb, NULL);
|
||||||
evas_object_event_callback_add (e_config_runtime_info->gui.subdialogs.orientation.radio_rot90, EVAS_CALLBACK_MOUSE_UP, _orientation_widget_mouse_up_cb, NULL);
|
evas_object_event_callback_add (e_config_runtime_info->gui.widgets.orientation.radio_rot90, EVAS_CALLBACK_MOUSE_UP, _orientation_widget_mouse_up_cb, NULL);
|
||||||
evas_object_event_callback_add (e_config_runtime_info->gui.subdialogs.orientation.radio_normal, EVAS_CALLBACK_MOUSE_UP, _orientation_widget_mouse_up_cb, NULL);
|
evas_object_event_callback_add (e_config_runtime_info->gui.widgets.orientation.radio_normal, EVAS_CALLBACK_MOUSE_UP, _orientation_widget_mouse_up_cb, NULL);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -60,55 +60,55 @@ orientation_widget_basic_create_widgets(Evas *canvas)
|
||||||
//char signal[29];
|
//char signal[29];
|
||||||
|
|
||||||
if (!canvas || !e_config_runtime_info) return NULL;
|
if (!canvas || !e_config_runtime_info) return NULL;
|
||||||
if (e_config_runtime_info->gui.subdialogs.orientation.dialog) return e_config_runtime_info->gui.subdialogs.orientation.dialog;
|
if (e_config_runtime_info->gui.widgets.orientation.dialog) return e_config_runtime_info->gui.widgets.orientation.dialog;
|
||||||
|
|
||||||
if (!(subdialog = e_widget_framelist_add(canvas, _("Display Orientation"), EINA_FALSE))) return NULL;
|
if (!(subdialog = e_widget_framelist_add(canvas, _("Display Orientation"), EINA_FALSE))) return NULL;
|
||||||
|
|
||||||
// Add radio buttons
|
// Add radio buttons
|
||||||
if (!(rg = e_widget_radio_group_new(&e_config_runtime_info->gui.subdialogs.orientation.radio_val))) goto _orientation_widget_radio_add_fail;
|
if (!(rg = e_widget_radio_group_new(&e_config_runtime_info->gui.widgets.orientation.radio_val))) goto _orientation_widget_radio_add_fail;
|
||||||
|
|
||||||
//IMPROVABLE: use enum to determine objects via 'switch'-statement
|
//IMPROVABLE: use enum to determine objects via 'switch'-statement
|
||||||
e_config_runtime_info->gui.subdialogs.orientation.radio_normal = e_widget_radio_add(canvas, _("Normal"), ECORE_X_RANDR_OUTPUT_POLICY_ABOVE, rg);
|
e_config_runtime_info->gui.widgets.orientation.radio_normal = e_widget_radio_add(canvas, _("Normal"), ECORE_X_RANDR_OUTPUT_POLICY_ABOVE, rg);
|
||||||
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.subdialogs.orientation.radio_normal);
|
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.widgets.orientation.radio_normal);
|
||||||
|
|
||||||
e_config_runtime_info->gui.subdialogs.orientation.radio_rot90 = e_widget_radio_add(canvas, _("Rotated, 90°"), ECORE_X_RANDR_OUTPUT_POLICY_RIGHT, rg);
|
e_config_runtime_info->gui.widgets.orientation.radio_rot90 = e_widget_radio_add(canvas, _("Rotated, 90°"), ECORE_X_RANDR_OUTPUT_POLICY_RIGHT, rg);
|
||||||
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.subdialogs.orientation.radio_rot90);
|
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.widgets.orientation.radio_rot90);
|
||||||
|
|
||||||
e_config_runtime_info->gui.subdialogs.orientation.radio_rot180 = e_widget_radio_add(canvas, _("Rotated, 180°"), ECORE_X_RANDR_OUTPUT_POLICY_BELOW, rg);
|
e_config_runtime_info->gui.widgets.orientation.radio_rot180 = e_widget_radio_add(canvas, _("Rotated, 180°"), ECORE_X_RANDR_OUTPUT_POLICY_BELOW, rg);
|
||||||
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.subdialogs.orientation.radio_rot180);
|
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.widgets.orientation.radio_rot180);
|
||||||
|
|
||||||
e_config_runtime_info->gui.subdialogs.orientation.radio_rot270 = e_widget_radio_add(canvas, _("Rotated, 270°"), ECORE_X_RANDR_OUTPUT_POLICY_LEFT, rg);
|
e_config_runtime_info->gui.widgets.orientation.radio_rot270 = e_widget_radio_add(canvas, _("Rotated, 270°"), ECORE_X_RANDR_OUTPUT_POLICY_LEFT, rg);
|
||||||
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.subdialogs.orientation.radio_rot270);
|
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.widgets.orientation.radio_rot270);
|
||||||
|
|
||||||
e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_horizontal = e_widget_radio_add(canvas, _("Flipped, horizontally"), ECORE_X_RANDR_OUTPUT_POLICY_CLONE, rg);
|
e_config_runtime_info->gui.widgets.orientation.radio_reflect_horizontal = e_widget_radio_add(canvas, _("Flipped, horizontally"), ECORE_X_RANDR_OUTPUT_POLICY_CLONE, rg);
|
||||||
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_horizontal);
|
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.widgets.orientation.radio_reflect_horizontal);
|
||||||
|
|
||||||
e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_vertical = e_widget_radio_add(canvas, _("Flipped, vertically"), ECORE_X_RANDR_OUTPUT_POLICY_NONE, rg);
|
e_config_runtime_info->gui.widgets.orientation.radio_reflect_vertical = e_widget_radio_add(canvas, _("Flipped, vertically"), ECORE_X_RANDR_OUTPUT_POLICY_NONE, rg);
|
||||||
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_vertical);
|
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.widgets.orientation.radio_reflect_vertical);
|
||||||
|
|
||||||
//_orientation_widget_radio_add_callbacks();
|
//_orientation_widget_radio_add_callbacks();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Add orientation demonstration edje
|
// Add orientation demonstration edje
|
||||||
if (!(e_config_runtime_info->gui.subdialogs.orientation.swallowing_edje = edje_object_add(canvas)))
|
if (!(e_config_runtime_info->gui.widgets.orientation.swallowing_edje = edje_object_add(canvas)))
|
||||||
goto _orientation_widget_edje_add_fail;
|
goto _orientation_widget_edje_add_fail;
|
||||||
if (!edje_object_file_set(e_config_runtime_info->gui.subdialogs.orientation.swallowing_edje, _theme_file_path, "e/conf/randr/dialog/subdialog/orientation"))
|
if (!edje_object_file_set(e_config_runtime_info->gui.widgets.orientation.swallowing_edje, _theme_file_path, "e/conf/randr/dialog/subdialog/orientation"))
|
||||||
goto _orientation_widget_edje_set_fail;
|
goto _orientation_widget_edje_set_fail;
|
||||||
|
|
||||||
e_widget_table_object_align_append(subdialog, e_config_runtime_info->gui.subdialogs.orientation.swallowing_edje, 1, 0, 1, 1, 1, 1, 1, 1, 1.0, 1.0);
|
e_widget_table_object_align_append(subdialog, e_config_runtime_info->gui.widgets.orientation.swallowing_edje, 1, 0, 1, 1, 1, 1, 1, 1, 1.0, 1.0);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//disable widgets, if no CRTC is selected
|
//disable widgets, if no CRTC is selected
|
||||||
orientation_widget_update_radio_buttons(e_config_runtime_info->gui.selected_eo);
|
orientation_widget_update_radio_buttons(e_config_runtime_info->gui.selected_eo);
|
||||||
|
|
||||||
//evas_object_show(e_config_runtime_info->gui.subdialogs.orientation.swallowing_edje);
|
//evas_object_show(e_config_runtime_info->gui.widgets.orientation.swallowing_edje);
|
||||||
|
|
||||||
return subdialog;
|
return subdialog;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
_orientation_widget_edje_set_fail:
|
_orientation_widget_edje_set_fail:
|
||||||
evas_object_del(ol);
|
evas_object_del(ol);
|
||||||
evas_object_del(e_config_runtime_info->gui.subdialogs.orientation.swallowing_edje);
|
evas_object_del(e_config_runtime_info->gui.widgets.orientation.swallowing_edje);
|
||||||
_orientation_widget_edje_add_fail:
|
_orientation_widget_edje_add_fail:
|
||||||
fprintf(stderr, "CONF_RANDR: Couldn't set edj for orientation subdialog!\n");
|
fprintf(stderr, "CONF_RANDR: Couldn't set edj for orientation subdialog!\n");
|
||||||
evas_object_del(subdialog);
|
evas_object_del(subdialog);
|
||||||
|
@ -132,18 +132,18 @@ _orientation_widget_mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *eve
|
||||||
* "sadly" the evas callbacks are called before radio_val is set to its new
|
* "sadly" the evas callbacks are called before radio_val is set to its new
|
||||||
* value. If that is ever changed, remove the used code below and just use the
|
* value. If that is ever changed, remove the used code below and just use the
|
||||||
* 1-liner below.
|
* 1-liner below.
|
||||||
* snprintf(signal, sizeof(signal), "conf,randr,dialog,orientation,%d", e_config_runtime_info->gui.subdialogs.orientation.radio_val);
|
* snprintf(signal, sizeof(signal), "conf,randr,dialog,orientation,%d", e_config_runtime_info->gui.widgets.orientation.radio_val);
|
||||||
*/
|
*/
|
||||||
if (obj == e_config_runtime_info->gui.subdialogs.orientation.radio_normal) orientation = ECORE_X_RANDR_ORIENTATION_ROT_0;
|
if (obj == e_config_runtime_info->gui.widgets.orientation.radio_normal) orientation = ECORE_X_RANDR_ORIENTATION_ROT_0;
|
||||||
if (obj == e_config_runtime_info->gui.subdialogs.orientation.radio_rot90) orientation = ECORE_X_RANDR_ORIENTATION_ROT_90;
|
if (obj == e_config_runtime_info->gui.widgets.orientation.radio_rot90) orientation = ECORE_X_RANDR_ORIENTATION_ROT_90;
|
||||||
if (obj == e_config_runtime_info->gui.subdialogs.orientation.radio_rot180) orientation = ECORE_X_RANDR_ORIENTATION_ROT_180;
|
if (obj == e_config_runtime_info->gui.widgets.orientation.radio_rot180) orientation = ECORE_X_RANDR_ORIENTATION_ROT_180;
|
||||||
if (obj == e_config_runtime_info->gui.subdialogs.orientation.radio_rot270) orientation = ECORE_X_RANDR_ORIENTATION_ROT_270;
|
if (obj == e_config_runtime_info->gui.widgets.orientation.radio_rot270) orientation = ECORE_X_RANDR_ORIENTATION_ROT_270;
|
||||||
if (obj == e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_horizontal) orientation = ECORE_X_RANDR_ORIENTATION_FLIP_X;
|
if (obj == e_config_runtime_info->gui.widgets.orientation.radio_reflect_horizontal) orientation = ECORE_X_RANDR_ORIENTATION_FLIP_X;
|
||||||
if (obj == e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_vertical) orientation = ECORE_X_RANDR_ORIENTATION_FLIP_Y;
|
if (obj == e_config_runtime_info->gui.widgets.orientation.radio_reflect_vertical) orientation = ECORE_X_RANDR_ORIENTATION_FLIP_Y;
|
||||||
|
|
||||||
snprintf(signal, sizeof(signal), "conf,randr,dialog,orientation,%d", orientation);
|
snprintf(signal, sizeof(signal), "conf,randr,dialog,orientation,%d", orientation);
|
||||||
|
|
||||||
edje_object_signal_emit(e_config_runtime_info->gui.subdialogs.orientation.swallowing_edje, signal, "e");
|
edje_object_signal_emit(e_config_runtime_info->gui.widgets.orientation.swallowing_edje, signal, "e");
|
||||||
|
|
||||||
fprintf(stderr, "CONF_RANDR: mouse button released. Emitted signal to orientation: %s\n", signal);
|
fprintf(stderr, "CONF_RANDR: mouse button released. Emitted signal to orientation: %s\n", signal);
|
||||||
}
|
}
|
||||||
|
@ -159,12 +159,12 @@ orientation_widget_update_radio_buttons(Evas_Object *crtc)
|
||||||
//disable widgets, if no crtc is selected
|
//disable widgets, if no crtc is selected
|
||||||
if (!crtc)
|
if (!crtc)
|
||||||
{
|
{
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_normal, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_normal, EINA_TRUE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot90, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_rot90, EINA_TRUE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot180, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_rot180, EINA_TRUE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot270, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_rot270, EINA_TRUE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_horizontal, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_reflect_horizontal, EINA_TRUE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_vertical, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_reflect_vertical, EINA_TRUE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,60 +185,60 @@ orientation_widget_update_radio_buttons(Evas_Object *crtc)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (supported_oris & ECORE_X_RANDR_ORIENTATION_ROT_0)
|
if (supported_oris & ECORE_X_RANDR_ORIENTATION_ROT_0)
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_normal, EINA_FALSE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_normal, EINA_FALSE);
|
||||||
else
|
else
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_normal, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_normal, EINA_TRUE);
|
||||||
|
|
||||||
if (supported_oris & ECORE_X_RANDR_ORIENTATION_ROT_90)
|
if (supported_oris & ECORE_X_RANDR_ORIENTATION_ROT_90)
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot90, EINA_FALSE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_rot90, EINA_FALSE);
|
||||||
else
|
else
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot90, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_rot90, EINA_TRUE);
|
||||||
|
|
||||||
if (supported_oris & ECORE_X_RANDR_ORIENTATION_ROT_180)
|
if (supported_oris & ECORE_X_RANDR_ORIENTATION_ROT_180)
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot180, EINA_FALSE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_rot180, EINA_FALSE);
|
||||||
else
|
else
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot180, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_rot180, EINA_TRUE);
|
||||||
|
|
||||||
if (supported_oris & ECORE_X_RANDR_ORIENTATION_ROT_270)
|
if (supported_oris & ECORE_X_RANDR_ORIENTATION_ROT_270)
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot270, EINA_FALSE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_rot270, EINA_FALSE);
|
||||||
else
|
else
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot270, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_rot270, EINA_TRUE);
|
||||||
|
|
||||||
if (supported_oris & ECORE_X_RANDR_ORIENTATION_FLIP_X)
|
if (supported_oris & ECORE_X_RANDR_ORIENTATION_FLIP_X)
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_horizontal, EINA_FALSE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_reflect_horizontal, EINA_FALSE);
|
||||||
else
|
else
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_horizontal, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_reflect_horizontal, EINA_TRUE);
|
||||||
|
|
||||||
if (supported_oris & ECORE_X_RANDR_ORIENTATION_FLIP_Y)
|
if (supported_oris & ECORE_X_RANDR_ORIENTATION_FLIP_Y)
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_vertical, EINA_FALSE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_reflect_vertical, EINA_FALSE);
|
||||||
else
|
else
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_vertical, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_reflect_vertical, EINA_TRUE);
|
||||||
|
|
||||||
//toggle the switch of the currently used orientation
|
//toggle the switch of the currently used orientation
|
||||||
switch (ori)
|
switch (ori)
|
||||||
{
|
{
|
||||||
case ECORE_X_RANDR_ORIENTATION_ROT_90:
|
case ECORE_X_RANDR_ORIENTATION_ROT_90:
|
||||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot90, EINA_TRUE);
|
e_widget_radio_toggle_set(e_config_runtime_info->gui.widgets.orientation.radio_rot90, EINA_TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ECORE_X_RANDR_ORIENTATION_ROT_180:
|
case ECORE_X_RANDR_ORIENTATION_ROT_180:
|
||||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot180, EINA_TRUE);
|
e_widget_radio_toggle_set(e_config_runtime_info->gui.widgets.orientation.radio_rot180, EINA_TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ECORE_X_RANDR_ORIENTATION_ROT_270:
|
case ECORE_X_RANDR_ORIENTATION_ROT_270:
|
||||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot270, EINA_TRUE);
|
e_widget_radio_toggle_set(e_config_runtime_info->gui.widgets.orientation.radio_rot270, EINA_TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ECORE_X_RANDR_ORIENTATION_FLIP_X:
|
case ECORE_X_RANDR_ORIENTATION_FLIP_X:
|
||||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_horizontal, EINA_TRUE);
|
e_widget_radio_toggle_set(e_config_runtime_info->gui.widgets.orientation.radio_reflect_horizontal, EINA_TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ECORE_X_RANDR_ORIENTATION_FLIP_Y:
|
case ECORE_X_RANDR_ORIENTATION_FLIP_Y:
|
||||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_vertical, EINA_TRUE);
|
e_widget_radio_toggle_set(e_config_runtime_info->gui.widgets.orientation.radio_reflect_vertical, EINA_TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: //== ECORE_X_RANDR_ORIENTATION_ROT_0:
|
default: //== ECORE_X_RANDR_ORIENTATION_ROT_0:
|
||||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.orientation.radio_normal, EINA_TRUE);
|
e_widget_radio_toggle_set(e_config_runtime_info->gui.widgets.orientation.radio_normal, EINA_TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,9 +277,9 @@ orientation_widget_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *
|
||||||
Ecore_X_Randr_Orientation orientation;
|
Ecore_X_Randr_Orientation orientation;
|
||||||
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
||||||
|
|
||||||
if (!e_config_runtime_info->gui.subdialogs.orientation.dialog || !e_config_runtime_info->gui.selected_eo || !(output_dialog_data = evas_object_data_get(e_config_runtime_info->gui.selected_eo, "rep_info")) || !output_dialog_data->crtc) return EINA_FALSE;
|
if (!e_config_runtime_info->gui.widgets.orientation.dialog || !e_config_runtime_info->gui.selected_eo || !(output_dialog_data = evas_object_data_get(e_config_runtime_info->gui.selected_eo, "rep_info")) || !output_dialog_data->crtc) return EINA_FALSE;
|
||||||
|
|
||||||
orientation = e_config_runtime_info->gui.subdialogs.orientation.radio_val;
|
orientation = e_config_runtime_info->gui.widgets.orientation.radio_val;
|
||||||
|
|
||||||
fprintf(stderr, "CONF_RANDR: Change orientation of crtc %d to %d.\n", output_dialog_data->crtc->xid, orientation);
|
fprintf(stderr, "CONF_RANDR: Change orientation of crtc %d to %d.\n", output_dialog_data->crtc->xid, orientation);
|
||||||
|
|
||||||
|
@ -299,9 +299,9 @@ orientation_widget_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config
|
||||||
{
|
{
|
||||||
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
||||||
|
|
||||||
if (!e_config_runtime_info->gui.subdialogs.orientation.dialog || !e_config_runtime_info->gui.selected_eo || !(output_dialog_data = evas_object_data_get(e_config_runtime_info->gui.selected_eo, "rep_info"))) return EINA_FALSE;
|
if (!e_config_runtime_info->gui.widgets.orientation.dialog || !e_config_runtime_info->gui.selected_eo || !(output_dialog_data = evas_object_data_get(e_config_runtime_info->gui.selected_eo, "rep_info"))) return EINA_FALSE;
|
||||||
|
|
||||||
return (int)output_dialog_data->previous_orientation != (int)e_config_runtime_info->gui.subdialogs.orientation.radio_val;
|
return (int)output_dialog_data->previous_orientation != (int)e_config_runtime_info->gui.widgets.orientation.radio_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -38,12 +38,12 @@ static const char *_POLICIES_STRINGS[] = {
|
||||||
static void
|
static void
|
||||||
_policy_widget_radio_add_callbacks(void)
|
_policy_widget_radio_add_callbacks(void)
|
||||||
{
|
{
|
||||||
evas_object_event_callback_add(e_config_runtime_info->gui.subdialogs.policies.radio_none, EVAS_CALLBACK_MOUSE_UP, _policy_widget_policy_mouse_up_cb, NULL);
|
evas_object_event_callback_add(e_config_runtime_info->gui.widgets.policies.radio_none, EVAS_CALLBACK_MOUSE_UP, _policy_widget_policy_mouse_up_cb, NULL);
|
||||||
evas_object_event_callback_add(e_config_runtime_info->gui.subdialogs.policies.radio_clone, EVAS_CALLBACK_MOUSE_UP, _policy_widget_policy_mouse_up_cb, NULL);
|
evas_object_event_callback_add(e_config_runtime_info->gui.widgets.policies.radio_clone, EVAS_CALLBACK_MOUSE_UP, _policy_widget_policy_mouse_up_cb, NULL);
|
||||||
evas_object_event_callback_add(e_config_runtime_info->gui.subdialogs.policies.radio_left, EVAS_CALLBACK_MOUSE_UP, _policy_widget_policy_mouse_up_cb, NULL);
|
evas_object_event_callback_add(e_config_runtime_info->gui.widgets.policies.radio_left, EVAS_CALLBACK_MOUSE_UP, _policy_widget_policy_mouse_up_cb, NULL);
|
||||||
evas_object_event_callback_add(e_config_runtime_info->gui.subdialogs.policies.radio_below, EVAS_CALLBACK_MOUSE_UP, _policy_widget_policy_mouse_up_cb, NULL);
|
evas_object_event_callback_add(e_config_runtime_info->gui.widgets.policies.radio_below, EVAS_CALLBACK_MOUSE_UP, _policy_widget_policy_mouse_up_cb, NULL);
|
||||||
evas_object_event_callback_add(e_config_runtime_info->gui.subdialogs.policies.radio_above, EVAS_CALLBACK_MOUSE_UP, _policy_widget_policy_mouse_up_cb, NULL);
|
evas_object_event_callback_add(e_config_runtime_info->gui.widgets.policies.radio_above, EVAS_CALLBACK_MOUSE_UP, _policy_widget_policy_mouse_up_cb, NULL);
|
||||||
evas_object_event_callback_add(e_config_runtime_info->gui.subdialogs.policies.radio_right, EVAS_CALLBACK_MOUSE_UP, _policy_widget_policy_mouse_up_cb, NULL);
|
evas_object_event_callback_add(e_config_runtime_info->gui.widgets.policies.radio_right, EVAS_CALLBACK_MOUSE_UP, _policy_widget_policy_mouse_up_cb, NULL);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -81,74 +81,74 @@ policy_widget_basic_create_widgets(Evas *canvas)
|
||||||
|
|
||||||
if (!canvas || !e_config_runtime_info) return NULL;
|
if (!canvas || !e_config_runtime_info) return NULL;
|
||||||
|
|
||||||
if (e_config_runtime_info->gui.subdialogs.policies.dialog) return e_config_runtime_info->gui.subdialogs.policies.dialog;
|
if (e_config_runtime_info->gui.widgets.policies.dialog) return e_config_runtime_info->gui.widgets.policies.dialog;
|
||||||
|
|
||||||
if (!(subdialog = e_widget_framelist_add(canvas, _("Screen attachement policy"), EINA_FALSE))) return NULL;
|
if (!(subdialog = e_widget_framelist_add(canvas, _("Screen attachement policy"), EINA_FALSE))) return NULL;
|
||||||
|
|
||||||
// Add radio buttons
|
// Add radio buttons
|
||||||
if (!(rg = e_widget_radio_group_new(&e_config_runtime_info->gui.subdialogs.policies.radio_val))) goto _policy_widget_radio_add_fail;
|
if (!(rg = e_widget_radio_group_new(&e_config_runtime_info->gui.widgets.policies.radio_val))) goto _policy_widget_radio_add_fail;
|
||||||
|
|
||||||
//IMPROVABLE: use enum to determine objects via 'switch'-statement
|
//IMPROVABLE: use enum to determine objects via 'switch'-statement
|
||||||
e_config_runtime_info->gui.subdialogs.policies.radio_above = e_widget_radio_add(canvas, _("Above"), ECORE_X_RANDR_OUTPUT_POLICY_ABOVE, rg);
|
e_config_runtime_info->gui.widgets.policies.radio_above = e_widget_radio_add(canvas, _("Above"), ECORE_X_RANDR_OUTPUT_POLICY_ABOVE, rg);
|
||||||
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.subdialogs.policies.radio_above);
|
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.widgets.policies.radio_above);
|
||||||
|
|
||||||
e_config_runtime_info->gui.subdialogs.policies.radio_right = e_widget_radio_add(canvas, _("Right"), ECORE_X_RANDR_OUTPUT_POLICY_RIGHT, rg);
|
e_config_runtime_info->gui.widgets.policies.radio_right = e_widget_radio_add(canvas, _("Right"), ECORE_X_RANDR_OUTPUT_POLICY_RIGHT, rg);
|
||||||
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.subdialogs.policies.radio_right);
|
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.widgets.policies.radio_right);
|
||||||
|
|
||||||
e_config_runtime_info->gui.subdialogs.policies.radio_below = e_widget_radio_add(canvas, _("Below"), ECORE_X_RANDR_OUTPUT_POLICY_BELOW, rg);
|
e_config_runtime_info->gui.widgets.policies.radio_below = e_widget_radio_add(canvas, _("Below"), ECORE_X_RANDR_OUTPUT_POLICY_BELOW, rg);
|
||||||
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.subdialogs.policies.radio_below);
|
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.widgets.policies.radio_below);
|
||||||
|
|
||||||
e_config_runtime_info->gui.subdialogs.policies.radio_left = e_widget_radio_add(canvas, _("Left"), ECORE_X_RANDR_OUTPUT_POLICY_LEFT, rg);
|
e_config_runtime_info->gui.widgets.policies.radio_left = e_widget_radio_add(canvas, _("Left"), ECORE_X_RANDR_OUTPUT_POLICY_LEFT, rg);
|
||||||
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.subdialogs.policies.radio_left);
|
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.widgets.policies.radio_left);
|
||||||
|
|
||||||
e_config_runtime_info->gui.subdialogs.policies.radio_clone = e_widget_radio_add(canvas, _("Clone display content"), ECORE_X_RANDR_OUTPUT_POLICY_CLONE, rg);
|
e_config_runtime_info->gui.widgets.policies.radio_clone = e_widget_radio_add(canvas, _("Clone display content"), ECORE_X_RANDR_OUTPUT_POLICY_CLONE, rg);
|
||||||
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.subdialogs.policies.radio_clone);
|
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.widgets.policies.radio_clone);
|
||||||
|
|
||||||
e_config_runtime_info->gui.subdialogs.policies.radio_none = e_widget_radio_add(canvas, _("No reaction"), ECORE_X_RANDR_OUTPUT_POLICY_NONE, rg);
|
e_config_runtime_info->gui.widgets.policies.radio_none = e_widget_radio_add(canvas, _("No reaction"), ECORE_X_RANDR_OUTPUT_POLICY_NONE, rg);
|
||||||
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.subdialogs.policies.radio_none);
|
e_widget_framelist_object_append(subdialog, e_config_runtime_info->gui.widgets.policies.radio_none);
|
||||||
|
|
||||||
//_policy_widget_radio_add_callbacks();
|
//_policy_widget_radio_add_callbacks();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Add policies demonstration edje
|
// Add policies demonstration edje
|
||||||
if (!(e_config_runtime_info->gui.subdialogs.policies.swallowing_edje = edje_object_add(canvas)))
|
if (!(e_config_runtime_info->gui.widgets.policies.swallowing_edje = edje_object_add(canvas)))
|
||||||
{
|
{
|
||||||
goto _policy_widget_edje_add_fail;
|
goto _policy_widget_edje_add_fail;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!edje_object_file_set(e_config_runtime_info->gui.subdialogs.policies.swallowing_edje, _theme_file_path, "e/conf/randr/dialog/subdialog/policies"))
|
if (!edje_object_file_set(e_config_runtime_info->gui.widgets.policies.swallowing_edje, _theme_file_path, "e/conf/randr/dialog/subdialog/policies"))
|
||||||
{
|
{
|
||||||
goto _policy_widget_edje_set_fail;
|
goto _policy_widget_edje_set_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
e_widget_table_object_align_append(subdialog, e_config_runtime_info->gui.subdialogs.policies.swallowing_edje, 1, 0, 1, 1, 1, 1, 1, 1, 1.0, 1.0);
|
e_widget_table_object_align_append(subdialog, e_config_runtime_info->gui.widgets.policies.swallowing_edje, 1, 0, 1, 1, 1, 1, 1, 1, 1.0, 1.0);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
evas_object_show(e_config_runtime_info->gui.subdialogs.policies.swallowing_edje);
|
evas_object_show(e_config_runtime_info->gui.widgets.policies.swallowing_edje);
|
||||||
|
|
||||||
//emit signal to edje so a demonstration can be shown
|
//emit signal to edje so a demonstration can be shown
|
||||||
snprintf(signal, sizeof(signal), "conf,randr,dialog,policies,%d", e_randr_screen_info->rrvd_info.randr_info_12->output_policy);
|
snprintf(signal, sizeof(signal), "conf,randr,dialog,policies,%d", e_randr_screen_info->rrvd_info.randr_info_12->output_policy);
|
||||||
edje_object_signal_emit(e_config_runtime_info->gui.subdialogs.policies.swallowing_edje, signal, "e");
|
edje_object_signal_emit(e_config_runtime_info->gui.widgets.policies.swallowing_edje, signal, "e");
|
||||||
fprintf(stderr, "CONF_RANDR: Initial signal emitted to policy dialog: %s\n", signal);
|
fprintf(stderr, "CONF_RANDR: Initial signal emitted to policy dialog: %s\n", signal);
|
||||||
|
|
||||||
//Use theme's background as screen representation
|
//Use theme's background as screen representation
|
||||||
e_config_runtime_info->gui.subdialogs.policies.new_display = edje_object_add(canvas);
|
e_config_runtime_info->gui.widgets.policies.new_display = edje_object_add(canvas);
|
||||||
e_theme_edje_object_set(e_config_runtime_info->gui.subdialogs.policies.new_display, "base/theme/widgets", "e/widgets/frame");
|
e_theme_edje_object_set(e_config_runtime_info->gui.widgets.policies.new_display, "base/theme/widgets", "e/widgets/frame");
|
||||||
e_config_runtime_info->gui.subdialogs.policies.new_display_background = edje_object_add(canvas);
|
e_config_runtime_info->gui.widgets.policies.new_display_background = edje_object_add(canvas);
|
||||||
e_theme_edje_object_set(e_config_runtime_info->gui.subdialogs.policies.new_display_background, "base/theme/background", "e/desktop/background");
|
e_theme_edje_object_set(e_config_runtime_info->gui.widgets.policies.new_display_background, "base/theme/background", "e/desktop/background");
|
||||||
edje_object_part_swallow(e_config_runtime_info->gui.subdialogs.policies.new_display, "e.swallow.content", e_config_runtime_info->gui.subdialogs.policies.new_display_background);
|
edje_object_part_swallow(e_config_runtime_info->gui.widgets.policies.new_display, "e.swallow.content", e_config_runtime_info->gui.widgets.policies.new_display_background);
|
||||||
edje_object_part_text_set(e_config_runtime_info->gui.subdialogs.policies.new_display, "e.text.label", _("New display"));
|
edje_object_part_text_set(e_config_runtime_info->gui.widgets.policies.new_display, "e.text.label", _("New display"));
|
||||||
edje_object_part_swallow(e_config_runtime_info->gui.subdialogs.policies.swallowing_edje, "new_display.swallow.content", e_config_runtime_info->gui.subdialogs.policies.new_display);
|
edje_object_part_swallow(e_config_runtime_info->gui.widgets.policies.swallowing_edje, "new_display.swallow.content", e_config_runtime_info->gui.widgets.policies.new_display);
|
||||||
//add theme's frame
|
//add theme's frame
|
||||||
//for now use the theme's background for the new display as well
|
//for now use the theme's background for the new display as well
|
||||||
e_config_runtime_info->gui.subdialogs.policies.current_displays_setup = edje_object_add(canvas);
|
e_config_runtime_info->gui.widgets.policies.current_displays_setup = edje_object_add(canvas);
|
||||||
e_theme_edje_object_set(e_config_runtime_info->gui.subdialogs.policies.current_displays_setup, "base/theme/widgets", "e/widgets/frame");
|
e_theme_edje_object_set(e_config_runtime_info->gui.widgets.policies.current_displays_setup, "base/theme/widgets", "e/widgets/frame");
|
||||||
e_config_runtime_info->gui.subdialogs.policies.current_displays_setup_background = edje_object_add(canvas);
|
e_config_runtime_info->gui.widgets.policies.current_displays_setup_background = edje_object_add(canvas);
|
||||||
e_theme_edje_object_set(e_config_runtime_info->gui.subdialogs.policies.current_displays_setup_background, "base/theme/background", "e/desktop/background");
|
e_theme_edje_object_set(e_config_runtime_info->gui.widgets.policies.current_displays_setup_background, "base/theme/background", "e/desktop/background");
|
||||||
edje_object_part_swallow(e_config_runtime_info->gui.subdialogs.policies.current_displays_setup, "e.swallow.content", e_config_runtime_info->gui.subdialogs.policies.current_displays_setup_background);
|
edje_object_part_swallow(e_config_runtime_info->gui.widgets.policies.current_displays_setup, "e.swallow.content", e_config_runtime_info->gui.widgets.policies.current_displays_setup_background);
|
||||||
edje_object_part_text_set(e_config_runtime_info->gui.subdialogs.policies.current_displays_setup, "e.text.label", _("Used display"));
|
edje_object_part_text_set(e_config_runtime_info->gui.widgets.policies.current_displays_setup, "e.text.label", _("Used display"));
|
||||||
edje_object_part_swallow(e_config_runtime_info->gui.subdialogs.policies.swallowing_edje, "current_displays_setup.swallow.content", e_config_runtime_info->gui.subdialogs.policies.current_displays_setup);
|
edje_object_part_swallow(e_config_runtime_info->gui.widgets.policies.swallowing_edje, "current_displays_setup.swallow.content", e_config_runtime_info->gui.widgets.policies.current_displays_setup);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
evas_object_show(subdialog);
|
evas_object_show(subdialog);
|
||||||
|
@ -157,7 +157,7 @@ policy_widget_basic_create_widgets(Evas *canvas)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
_policy_widget_edje_set_fail:
|
_policy_widget_edje_set_fail:
|
||||||
evas_object_del(e_config_runtime_info->gui.subdialogs.policies.swallowing_edje);
|
evas_object_del(e_config_runtime_info->gui.widgets.policies.swallowing_edje);
|
||||||
_policy_widget_edje_add_fail:
|
_policy_widget_edje_add_fail:
|
||||||
fprintf(stderr, "CONF_RANDR: Couldn't set edj for policies subdialog!\n");
|
fprintf(stderr, "CONF_RANDR: Couldn't set edj for policies subdialog!\n");
|
||||||
evas_object_del(subdialog);
|
evas_object_del(subdialog);
|
||||||
|
@ -182,18 +182,18 @@ _policy_widget_policy_mouse_up_cb(void *data __UNUSED__, Evas *e __UNUSED__, Eva
|
||||||
* "sadly" the evas callbacks are called before radio_val is set to its new
|
* "sadly" the evas callbacks are called before radio_val is set to its new
|
||||||
* value. If that is ever changed, remove the used code below and just use the
|
* value. If that is ever changed, remove the used code below and just use the
|
||||||
* 1-liner below.
|
* 1-liner below.
|
||||||
* snprintf(signal, sizeof(signal), "conf,randr,dialog,policies,%d", e_config_runtime_info->gui.subdialogs.policies.radio_val);
|
* snprintf(signal, sizeof(signal), "conf,randr,dialog,policies,%d", e_config_runtime_info->gui.widgets.policies.radio_val);
|
||||||
* /
|
* /
|
||||||
if (obj == e_config_runtime_info->gui.subdialogs.policies.radio_above) policy = ECORE_X_RANDR_OUTPUT_POLICY_ABOVE;
|
if (obj == e_config_runtime_info->gui.widgets.policies.radio_above) policy = ECORE_X_RANDR_OUTPUT_POLICY_ABOVE;
|
||||||
if (obj == e_config_runtime_info->gui.subdialogs.policies.radio_right) policy = ECORE_X_RANDR_OUTPUT_POLICY_RIGHT;
|
if (obj == e_config_runtime_info->gui.widgets.policies.radio_right) policy = ECORE_X_RANDR_OUTPUT_POLICY_RIGHT;
|
||||||
if (obj == e_config_runtime_info->gui.subdialogs.policies.radio_below) policy = ECORE_X_RANDR_OUTPUT_POLICY_BELOW;
|
if (obj == e_config_runtime_info->gui.widgets.policies.radio_below) policy = ECORE_X_RANDR_OUTPUT_POLICY_BELOW;
|
||||||
if (obj == e_config_runtime_info->gui.subdialogs.policies.radio_left) policy = ECORE_X_RANDR_OUTPUT_POLICY_LEFT;
|
if (obj == e_config_runtime_info->gui.widgets.policies.radio_left) policy = ECORE_X_RANDR_OUTPUT_POLICY_LEFT;
|
||||||
if (obj == e_config_runtime_info->gui.subdialogs.policies.radio_clone) policy = ECORE_X_RANDR_OUTPUT_POLICY_CLONE;
|
if (obj == e_config_runtime_info->gui.widgets.policies.radio_clone) policy = ECORE_X_RANDR_OUTPUT_POLICY_CLONE;
|
||||||
if (obj == e_config_runtime_info->gui.subdialogs.policies.radio_none) policy = ECORE_X_RANDR_OUTPUT_POLICY_NONE;
|
if (obj == e_config_runtime_info->gui.widgets.policies.radio_none) policy = ECORE_X_RANDR_OUTPUT_POLICY_NONE;
|
||||||
|
|
||||||
snprintf(signal, sizeof(signal), "conf,randr,dialog,policies,%d", policy);
|
snprintf(signal, sizeof(signal), "conf,randr,dialog,policies,%d", policy);
|
||||||
|
|
||||||
//edje_object_signal_emit(e_config_runtime_info->gui.subdialogs.policies.swallowing_edje, signal, "e");
|
//edje_object_signal_emit(e_config_runtime_info->gui.widgets.policies.swallowing_edje, signal, "e");
|
||||||
|
|
||||||
fprintf(stderr, "CONF_RANDR: mouse button released. Emitted signal to policy: %s\n", signal);
|
fprintf(stderr, "CONF_RANDR: mouse button released. Emitted signal to policy: %s\n", signal);
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ policy_widget_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_
|
||||||
|
|
||||||
//policy update
|
//policy update
|
||||||
e_config_runtime_info->gui.selected_output_dd->previous_policy = e_config_runtime_info->gui.selected_output_dd->new_policy;
|
e_config_runtime_info->gui.selected_output_dd->previous_policy = e_config_runtime_info->gui.selected_output_dd->new_policy;
|
||||||
e_config_runtime_info->gui.selected_output_dd->new_policy = e_config_runtime_info->gui.subdialogs.policies.radio_val;
|
e_config_runtime_info->gui.selected_output_dd->new_policy = e_config_runtime_info->gui.widgets.policies.radio_val;
|
||||||
fprintf(stderr, "CONF_RANDR: 'New display attached'-policy set to %s.\n", _POLICIES_STRINGS[e_config_runtime_info->gui.selected_output_dd->new_policy - 1]);
|
fprintf(stderr, "CONF_RANDR: 'New display attached'-policy set to %s.\n", _POLICIES_STRINGS[e_config_runtime_info->gui.selected_output_dd->new_policy - 1]);
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
@ -217,7 +217,7 @@ policy_widget_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dial
|
||||||
{
|
{
|
||||||
if (!E_RANDR_12 || !cfdata || !cfdata->gui.selected_output_dd || !cfdata->gui.selected_output_dd->output) return EINA_FALSE;
|
if (!E_RANDR_12 || !cfdata || !cfdata->gui.selected_output_dd || !cfdata->gui.selected_output_dd->output) return EINA_FALSE;
|
||||||
|
|
||||||
return (int)cfdata->gui.selected_output_dd->previous_policy != (int)cfdata->gui.subdialogs.policies.radio_val;
|
return (int)cfdata->gui.selected_output_dd->previous_policy != (int)cfdata->gui.widgets.policies.radio_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -230,22 +230,22 @@ policy_widget_update_radio_buttons(Evas_Object *rep)
|
||||||
if (!rep || !(output_dialog_data = evas_object_data_get(rep, "rep_info")))
|
if (!rep || !(output_dialog_data = evas_object_data_get(rep, "rep_info")))
|
||||||
{
|
{
|
||||||
//Evas_Object *radio_above, *radio_right, *radio_below, *radio_left, *radio_clone, *radio_none;
|
//Evas_Object *radio_above, *radio_right, *radio_below, *radio_left, *radio_clone, *radio_none;
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.policies.radio_above, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.policies.radio_above, EINA_TRUE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.policies.radio_right, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.policies.radio_right, EINA_TRUE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.policies.radio_below, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.policies.radio_below, EINA_TRUE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.policies.radio_left, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.policies.radio_left, EINA_TRUE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.policies.radio_clone, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.policies.radio_clone, EINA_TRUE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.policies.radio_none, EINA_TRUE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.policies.radio_none, EINA_TRUE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.policies.radio_above, EINA_FALSE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.policies.radio_above, EINA_FALSE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.policies.radio_right, EINA_FALSE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.policies.radio_right, EINA_FALSE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.policies.radio_below, EINA_FALSE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.policies.radio_below, EINA_FALSE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.policies.radio_left, EINA_FALSE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.policies.radio_left, EINA_FALSE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.policies.radio_clone, EINA_FALSE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.policies.radio_clone, EINA_FALSE);
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.policies.radio_none, EINA_FALSE);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.policies.radio_none, EINA_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
policy = output_dialog_data->new_policy;
|
policy = output_dialog_data->new_policy;
|
||||||
|
@ -254,27 +254,27 @@ policy_widget_update_radio_buttons(Evas_Object *rep)
|
||||||
switch (policy)
|
switch (policy)
|
||||||
{
|
{
|
||||||
case ECORE_X_RANDR_OUTPUT_POLICY_RIGHT:
|
case ECORE_X_RANDR_OUTPUT_POLICY_RIGHT:
|
||||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.policies.radio_right, EINA_TRUE);
|
e_widget_radio_toggle_set(e_config_runtime_info->gui.widgets.policies.radio_right, EINA_TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ECORE_X_RANDR_OUTPUT_POLICY_BELOW:
|
case ECORE_X_RANDR_OUTPUT_POLICY_BELOW:
|
||||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.policies.radio_below, EINA_TRUE);
|
e_widget_radio_toggle_set(e_config_runtime_info->gui.widgets.policies.radio_below, EINA_TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ECORE_X_RANDR_OUTPUT_POLICY_LEFT:
|
case ECORE_X_RANDR_OUTPUT_POLICY_LEFT:
|
||||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.policies.radio_left, EINA_TRUE);
|
e_widget_radio_toggle_set(e_config_runtime_info->gui.widgets.policies.radio_left, EINA_TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ECORE_X_RANDR_OUTPUT_POLICY_CLONE:
|
case ECORE_X_RANDR_OUTPUT_POLICY_CLONE:
|
||||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.policies.radio_clone, EINA_TRUE);
|
e_widget_radio_toggle_set(e_config_runtime_info->gui.widgets.policies.radio_clone, EINA_TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ECORE_X_RANDR_OUTPUT_POLICY_NONE:
|
case ECORE_X_RANDR_OUTPUT_POLICY_NONE:
|
||||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.policies.radio_none, EINA_TRUE);
|
e_widget_radio_toggle_set(e_config_runtime_info->gui.widgets.policies.radio_none, EINA_TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: //== ECORE_X_RANDR_OUTPUT_POLICY_ABOVE:
|
default: //== ECORE_X_RANDR_OUTPUT_POLICY_ABOVE:
|
||||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.policies.radio_above, EINA_TRUE);
|
e_widget_radio_toggle_set(e_config_runtime_info->gui.widgets.policies.radio_above, EINA_TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ resolution_widget_basic_create_widgets(Evas *canvas)
|
||||||
{
|
{
|
||||||
Evas_Object *subdialog;
|
Evas_Object *subdialog;
|
||||||
|
|
||||||
if (!canvas || !e_config_runtime_info || e_config_runtime_info->gui.subdialogs.resolutions.dialog || !(subdialog = e_widget_ilist_add(canvas, ICON_WIDTH * e_scale, ICON_HEIGHT * e_scale, NULL))) return NULL;
|
if (!canvas || !e_config_runtime_info || e_config_runtime_info->gui.widgets.resolutions.dialog || !(subdialog = e_widget_ilist_add(canvas, ICON_WIDTH * e_scale, ICON_HEIGHT * e_scale, NULL))) return NULL;
|
||||||
|
|
||||||
e_widget_ilist_multi_select_set(subdialog, EINA_FALSE);
|
e_widget_ilist_multi_select_set(subdialog, EINA_FALSE);
|
||||||
e_widget_disabled_set(subdialog, EINA_TRUE);
|
e_widget_disabled_set(subdialog, EINA_TRUE);
|
||||||
|
@ -121,7 +121,7 @@ resolution_widget_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *c
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
//get selected mode
|
//get selected mode
|
||||||
if ((selected_mode = (Ecore_X_Randr_Mode_Info *)e_widget_ilist_selected_data_get(e_config_runtime_info->gui.subdialogs.resolutions.dialog)))
|
if ((selected_mode = (Ecore_X_Randr_Mode_Info *)e_widget_ilist_selected_data_get(e_config_runtime_info->gui.widgets.resolutions.dialog)))
|
||||||
{
|
{
|
||||||
mode = selected_mode->xid;
|
mode = selected_mode->xid;
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ resolution_widget_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_
|
||||||
Ecore_X_Randr_Mode_Info *selected_mode;
|
Ecore_X_Randr_Mode_Info *selected_mode;
|
||||||
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
||||||
|
|
||||||
if (!e_config_runtime_info->gui.selected_eo || !(selected_mode = (Ecore_X_Randr_Mode_Info *)e_widget_ilist_selected_data_get(e_config_runtime_info->gui.subdialogs.resolutions.dialog)) || !(output_dialog_data = evas_object_data_get(e_config_runtime_info->gui.selected_eo, "rep_info"))) return EINA_FALSE;
|
if (!e_config_runtime_info->gui.selected_eo || !(selected_mode = (Ecore_X_Randr_Mode_Info *)e_widget_ilist_selected_data_get(e_config_runtime_info->gui.widgets.resolutions.dialog)) || !(output_dialog_data = evas_object_data_get(e_config_runtime_info->gui.selected_eo, "rep_info"))) return EINA_FALSE;
|
||||||
|
|
||||||
return selected_mode != output_dialog_data->previous_mode;
|
return selected_mode != output_dialog_data->previous_mode;
|
||||||
}
|
}
|
||||||
|
@ -170,8 +170,8 @@ resolution_widget_update_list(Evas_Object *rep)
|
||||||
Eina_Bool enable = EINA_FALSE;
|
Eina_Bool enable = EINA_FALSE;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
e_widget_ilist_freeze(e_config_runtime_info->gui.subdialogs.resolutions.dialog);
|
e_widget_ilist_freeze(e_config_runtime_info->gui.widgets.resolutions.dialog);
|
||||||
e_widget_ilist_clear(e_config_runtime_info->gui.subdialogs.resolutions.dialog);
|
e_widget_ilist_clear(e_config_runtime_info->gui.widgets.resolutions.dialog);
|
||||||
|
|
||||||
if (!rep || !(output_dialog_data = evas_object_data_get(rep, "rep_info")))
|
if (!rep || !(output_dialog_data = evas_object_data_get(rep, "rep_info")))
|
||||||
goto _go_and_return;
|
goto _go_and_return;
|
||||||
|
@ -202,24 +202,24 @@ resolution_widget_update_list(Evas_Object *rep)
|
||||||
rate = 0.0;
|
rate = 0.0;
|
||||||
|
|
||||||
snprintf(resolution_text, (RESOLUTION_TXT_MAX_LENGTH - 1), "%dx%d@%.1fHz", mode_info->width, mode_info->height, rate);
|
snprintf(resolution_text, (RESOLUTION_TXT_MAX_LENGTH - 1), "%dx%d@%.1fHz", mode_info->width, mode_info->height, rate);
|
||||||
e_widget_ilist_append(e_config_runtime_info->gui.subdialogs.resolutions.dialog, NULL, resolution_text, NULL, mode_info, NULL);
|
e_widget_ilist_append(e_config_runtime_info->gui.widgets.resolutions.dialog, NULL, resolution_text, NULL, mode_info, NULL);
|
||||||
|
|
||||||
//select currently enabled mode
|
//select currently enabled mode
|
||||||
if (mode_info == current_mode)
|
if (mode_info == current_mode)
|
||||||
e_widget_ilist_selected_set(e_config_runtime_info->gui.subdialogs.resolutions.dialog, i);
|
e_widget_ilist_selected_set(e_config_runtime_info->gui.widgets.resolutions.dialog, i);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//append 'disabled' mode
|
//append 'disabled' mode
|
||||||
e_widget_ilist_append(e_config_runtime_info->gui.subdialogs.resolutions.dialog, NULL, _("Disabled"), NULL, &disabled_mode, NULL);
|
e_widget_ilist_append(e_config_runtime_info->gui.widgets.resolutions.dialog, NULL, _("Disabled"), NULL, &disabled_mode, NULL);
|
||||||
|
|
||||||
//reenable widget
|
//reenable widget
|
||||||
enable = EINA_TRUE;
|
enable = EINA_TRUE;
|
||||||
|
|
||||||
_go_and_return:
|
_go_and_return:
|
||||||
e_widget_disabled_set(e_config_runtime_info->gui.subdialogs.resolutions.dialog, enable);
|
e_widget_disabled_set(e_config_runtime_info->gui.widgets.resolutions.dialog, enable);
|
||||||
e_widget_ilist_go(e_config_runtime_info->gui.subdialogs.resolutions.dialog);
|
e_widget_ilist_go(e_config_runtime_info->gui.widgets.resolutions.dialog);
|
||||||
e_widget_ilist_thaw(e_config_runtime_info->gui.subdialogs.resolutions.dialog);
|
e_widget_ilist_thaw(e_config_runtime_info->gui.widgets.resolutions.dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue