forked from enlightenment/enlightenment
parent
d447dfb63f
commit
aa24d2f3b1
|
@ -22,7 +22,6 @@
|
|||
#define ECORE_X_RANDR_1_3 ((1 << 16) | 3)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef Ecore_X_Randr_None
|
||||
#undef Ecore_X_Randr_None
|
||||
#define Ecore_X_Randr_None 0
|
||||
|
@ -39,55 +38,55 @@
|
|||
#define THEME_FILENAME "/e-module-conf_randr.edj"
|
||||
#define TOOLBAR_ICONSIZE 16
|
||||
|
||||
static void *create_data (E_Config_Dialog *cfd);
|
||||
static void free_cfdata (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
static int basic_check_changed (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
static int basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
static Evas_Object *basic_create_widgets (E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||
static Eina_Bool _deferred_noxrandr_error (void *data);
|
||||
static void *create_data(E_Config_Dialog *cfd);
|
||||
static void free_cfdata(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
static int basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
static int basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
static Evas_Object *basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||
static Eina_Bool _deferred_noxrandr_error(void *data);
|
||||
|
||||
// Functions for the arrangement subdialog interaction
|
||||
extern Eina_Bool dialog_subdialog_arrangement_create_data (E_Config_Dialog_Data *cfdata);
|
||||
extern Evas_Object *dialog_subdialog_arrangement_basic_create_widgets (Evas *canvas);
|
||||
extern Eina_Bool dialog_subdialog_arrangement_basic_check_changed (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern Eina_Bool dialog_subdialog_arrangement_basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_arrangement_free_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_arrangement_keep_changes (E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_arrangement_discard_changes (E_Config_Dialog_Data *cfdata);
|
||||
extern Eina_Bool dialog_subdialog_arrangement_create_data(E_Config_Dialog_Data *cfdata);
|
||||
extern Evas_Object *dialog_subdialog_arrangement_basic_create_widgets(Evas *canvas);
|
||||
extern Eina_Bool dialog_subdialog_arrangement_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern Eina_Bool dialog_subdialog_arrangement_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_arrangement_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_arrangement_keep_changes(E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_arrangement_discard_changes(E_Config_Dialog_Data *cfdata);
|
||||
|
||||
// Functions for the policies subdialog interaction
|
||||
extern Eina_Bool dialog_subdialog_policies_create_data (E_Config_Dialog_Data *cfdata);
|
||||
extern Evas_Object *dialog_subdialog_policies_basic_create_widgets (Evas *canvas);
|
||||
extern Eina_Bool dialog_subdialog_policies_basic_check_changed (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern Eina_Bool dialog_subdialog_policies_basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_policies_keep_changes (E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_policies_discard_changes (E_Config_Dialog_Data *cfdata);
|
||||
extern Eina_Bool dialog_subdialog_policies_create_data(E_Config_Dialog_Data *cfdata);
|
||||
extern Evas_Object *dialog_subdialog_policies_basic_create_widgets(Evas *canvas);
|
||||
extern Eina_Bool dialog_subdialog_policies_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern Eina_Bool dialog_subdialog_policies_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_policies_keep_changes(E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_policies_discard_changes(E_Config_Dialog_Data *cfdata);
|
||||
|
||||
// Functions for the resolutions subdialog interaction
|
||||
extern Eina_Bool dialog_subdialog_resolutions_create_data (E_Config_Dialog_Data *cfdata);
|
||||
extern Evas_Object *dialog_subdialog_resolutions_basic_create_widgets (Evas *canvas);
|
||||
extern Eina_Bool dialog_subdialog_resolutions_basic_check_changed (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern Eina_Bool dialog_subdialog_resolutions_basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_resolutions_update_list (Evas *canvas, Evas_Object *crtc);
|
||||
extern void dialog_subdialog_resolutions_keep_changes (E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_resolutions_discard_changes (E_Config_Dialog_Data *cfdata);
|
||||
extern Eina_Bool dialog_subdialog_resolutions_create_data(E_Config_Dialog_Data *cfdata);
|
||||
extern Evas_Object *dialog_subdialog_resolutions_basic_create_widgets(Evas *canvas);
|
||||
extern Eina_Bool dialog_subdialog_resolutions_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern Eina_Bool dialog_subdialog_resolutions_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_resolutions_update_list(Evas *canvas, Evas_Object *crtc);
|
||||
extern void dialog_subdialog_resolutions_keep_changes(E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_resolutions_discard_changes(E_Config_Dialog_Data *cfdata);
|
||||
|
||||
// Functions for the orientation subdialog interaction
|
||||
extern Eina_Bool dialog_subdialog_orientation_create_data (E_Config_Dialog_Data *cfdata);
|
||||
extern Evas_Object *dialog_subdialog_orientation_basic_create_widgets (Evas *canvas);
|
||||
extern Eina_Bool dialog_subdialog_orientation_basic_check_changed (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern Eina_Bool dialog_subdialog_orientation_basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_orientation_update_radio_buttons (Evas_Object *crtc);
|
||||
extern void dialog_subdialog_orientation_update_edje (Evas_Object *crtc);
|
||||
extern void dialog_subdialog_orientation_keep_changes (E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_orientation_discard_changes (E_Config_Dialog_Data *cfdata);
|
||||
extern Eina_Bool dialog_subdialog_orientation_create_data(E_Config_Dialog_Data *cfdata);
|
||||
extern Evas_Object *dialog_subdialog_orientation_basic_create_widgets(Evas *canvas);
|
||||
extern Eina_Bool dialog_subdialog_orientation_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern Eina_Bool dialog_subdialog_orientation_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_orientation_update_radio_buttons(Evas_Object *crtc);
|
||||
extern void dialog_subdialog_orientation_update_edje(Evas_Object *crtc);
|
||||
extern void dialog_subdialog_orientation_keep_changes(E_Config_Dialog_Data *cfdata);
|
||||
extern void dialog_subdialog_orientation_discard_changes(E_Config_Dialog_Data *cfdata);
|
||||
|
||||
/* actual module specifics */
|
||||
E_Config_Dialog_Data *e_config_runtime_info = NULL;
|
||||
extern E_Module *conf_randr_module;
|
||||
char _theme_file_path[PATH_MAX];
|
||||
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *
|
||||
_dialog_output_dialog_data_new(E_Randr_Crtc_Info *crtc_info, E_Randr_Output_Info *output_info)
|
||||
{
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *dialog_data;
|
||||
|
@ -109,8 +108,7 @@ _dialog_output_dialog_data_new(E_Randr_Crtc_Info *crtc_info, E_Randr_Output_Info
|
|||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static void *
|
||||
static void *
|
||||
create_data(E_Config_Dialog *cfd)
|
||||
{
|
||||
Eina_List *iter;
|
||||
|
@ -152,7 +150,7 @@ _e_conf_randr_create_data_failed_free_data:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
free_cfdata(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
EINA_SAFETY_ON_TRUE_RETURN(!e_randr_screen_info);
|
||||
|
@ -162,10 +160,10 @@ free_cfdata(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|||
cfdata = NULL;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
static Eina_Bool
|
||||
_e_conf_randr_confirmation_dialog_timer_cb(void *data)
|
||||
{
|
||||
E_Config_Randr_Dialog_Confirmation_Dialog_Data *cdd = (E_Config_Randr_Dialog_Confirmation_Dialog_Data*)data;
|
||||
E_Config_Randr_Dialog_Confirmation_Dialog_Data *cdd = (E_Config_Randr_Dialog_Confirmation_Dialog_Data *)data;
|
||||
char buf[4096];
|
||||
|
||||
if (!cdd) return ECORE_CALLBACK_CANCEL;
|
||||
|
@ -190,7 +188,7 @@ _e_conf_randr_confirmation_dialog_timer_cb(void *data)
|
|||
return (cdd->countdown > 0) ? ECORE_CALLBACK_RENEW : ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_e_conf_randr_confirmation_dialog_delete_cb(E_Win *win)
|
||||
{
|
||||
E_Dialog *dia;
|
||||
|
@ -208,10 +206,10 @@ _e_conf_randr_confirmation_dialog_delete_cb(E_Win *win)
|
|||
e_object_unref(E_OBJECT(cfd));
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_e_conf_randr_confirmation_dialog_keep_cb(void *data, E_Dialog *dia)
|
||||
{
|
||||
E_Config_Randr_Dialog_Confirmation_Dialog_Data *cdd = (E_Config_Randr_Dialog_Confirmation_Dialog_Data*)data;
|
||||
E_Config_Randr_Dialog_Confirmation_Dialog_Data *cdd = (E_Config_Randr_Dialog_Confirmation_Dialog_Data *)data;
|
||||
|
||||
if (!cdd) return;
|
||||
|
||||
|
@ -222,10 +220,10 @@ _e_conf_randr_confirmation_dialog_keep_cb(void *data, E_Dialog *dia)
|
|||
_e_conf_randr_confirmation_dialog_delete_cb(dia->win);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_e_conf_randr_confirmation_dialog_discard_cb(void *data, E_Dialog *dia)
|
||||
{
|
||||
E_Config_Randr_Dialog_Confirmation_Dialog_Data *cdd = (E_Config_Randr_Dialog_Confirmation_Dialog_Data*)data;
|
||||
E_Config_Randr_Dialog_Confirmation_Dialog_Data *cdd = (E_Config_Randr_Dialog_Confirmation_Dialog_Data *)data;
|
||||
|
||||
if (!cdd) return;
|
||||
|
||||
|
@ -236,10 +234,10 @@ _e_conf_randr_confirmation_dialog_discard_cb(void *data, E_Dialog *dia)
|
|||
_e_conf_randr_confirmation_dialog_delete_cb(dia->win);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_e_conf_randr_confirmation_dialog_store_cb(void *data, E_Dialog *dia)
|
||||
{
|
||||
E_Config_Randr_Dialog_Confirmation_Dialog_Data *cdd = (E_Config_Randr_Dialog_Confirmation_Dialog_Data*)data;
|
||||
E_Config_Randr_Dialog_Confirmation_Dialog_Data *cdd = (E_Config_Randr_Dialog_Confirmation_Dialog_Data *)data;
|
||||
|
||||
if (!cdd) return;
|
||||
|
||||
|
@ -247,7 +245,7 @@ _e_conf_randr_confirmation_dialog_store_cb(void *data, E_Dialog *dia)
|
|||
e_randr_store_configuration(e_randr_screen_info);
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_e_conf_randr_confirmation_dialog_new(E_Config_Dialog *cfd)
|
||||
{
|
||||
E_Config_Randr_Dialog_Confirmation_Dialog_Data *cd = E_NEW(E_Config_Randr_Dialog_Confirmation_Dialog_Data, 1);
|
||||
|
@ -256,7 +254,7 @@ _e_conf_randr_confirmation_dialog_new(E_Config_Dialog *cfd)
|
|||
|
||||
cd->cfd = cfd;
|
||||
|
||||
if((cd->dialog = e_dialog_new(cfd->con, "E", "e_randr_confirmation_dialog")))
|
||||
if ((cd->dialog = e_dialog_new(cfd->con, "E", "e_randr_confirmation_dialog")))
|
||||
{
|
||||
e_dialog_title_set(cd->dialog, _("New settings confirmation"));
|
||||
cd->cfdata = cfd->cfdata;
|
||||
|
@ -276,21 +274,20 @@ _e_conf_randr_confirmation_dialog_new(E_Config_Dialog *cfd)
|
|||
e_dialog_show(cd->dialog);
|
||||
e_object_ref(E_OBJECT(cfd));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
basic_create_widgets (E_Config_Dialog *cfd, Evas *canvas, E_Config_Dialog_Data *cfdata)
|
||||
static Evas_Object *
|
||||
basic_create_widgets(E_Config_Dialog *cfd, Evas *canvas, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
Evas_Object *table = NULL, *wl = NULL;
|
||||
|
||||
EINA_SAFETY_ON_TRUE_RETURN_VAL (!e_randr_screen_info || (e_randr_screen_info->randr_version < ECORE_X_RANDR_1_2), NULL);
|
||||
EINA_SAFETY_ON_TRUE_RETURN_VAL((!canvas || !cfdata), NULL);
|
||||
|
||||
if(!(cfdata->gui.subdialogs.arrangement.dialog = dialog_subdialog_arrangement_basic_create_widgets(canvas))) goto _dialog_create_subdialog_arrangement_fail;
|
||||
if(!(cfdata->gui.subdialogs.policies.dialog = dialog_subdialog_policies_basic_create_widgets(canvas))) goto _dialog_create_subdialog_policies_fail;
|
||||
if(!(cfdata->gui.subdialogs.resolutions.dialog = dialog_subdialog_resolutions_basic_create_widgets(canvas))) goto _dialog_create_subdialog_resolutions_fail;
|
||||
if(!(cfdata->gui.subdialogs.orientation.dialog = dialog_subdialog_orientation_basic_create_widgets(canvas))) goto _dialog_create_subdialog_orientation_fail;
|
||||
if (!(cfdata->gui.subdialogs.arrangement.dialog = dialog_subdialog_arrangement_basic_create_widgets(canvas))) goto _dialog_create_subdialog_arrangement_fail;
|
||||
if (!(cfdata->gui.subdialogs.policies.dialog = dialog_subdialog_policies_basic_create_widgets(canvas))) goto _dialog_create_subdialog_policies_fail;
|
||||
if (!(cfdata->gui.subdialogs.resolutions.dialog = dialog_subdialog_resolutions_basic_create_widgets(canvas))) goto _dialog_create_subdialog_resolutions_fail;
|
||||
if (!(cfdata->gui.subdialogs.orientation.dialog = dialog_subdialog_orientation_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((wl = e_widget_list_add(canvas, EINA_FALSE, EINA_TRUE)), _dialog_create_widget_list_fail);
|
||||
|
@ -330,8 +327,8 @@ _dialog_create_subdialog_arrangement_fail:
|
|||
}
|
||||
|
||||
static int
|
||||
basic_apply_data
|
||||
(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||
basic_apply_data
|
||||
(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
Eina_Bool ret = EINA_TRUE;
|
||||
|
||||
|
@ -396,7 +393,7 @@ e_int_config_randr(E_Container *con, const char *params __UNUSED__){
|
|||
return cfd;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
static Eina_Bool
|
||||
_deferred_noxrandr_error(void *data __UNUSED__)
|
||||
{
|
||||
e_util_dialog_show(_("Missing Features"),
|
||||
|
@ -409,14 +406,14 @@ _deferred_noxrandr_error(void *data __UNUSED__)
|
|||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
||||
static int
|
||||
basic_check_changed (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||
static int
|
||||
basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
if (!cfdata) return EINA_FALSE;
|
||||
else
|
||||
return (dialog_subdialog_arrangement_basic_check_changed(cfd, cfdata)
|
||||
return dialog_subdialog_arrangement_basic_check_changed(cfd, cfdata)
|
||||
|| dialog_subdialog_policies_basic_check_changed(cfd, cfdata)
|
||||
|| dialog_subdialog_orientation_basic_check_changed(cfd, cfdata)
|
||||
|| dialog_subdialog_resolutions_basic_check_changed(cfd, cfdata));
|
||||
|| dialog_subdialog_resolutions_basic_check_changed(cfd, cfdata);
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ dialog_subdialog_arrangement_create_data(E_Config_Dialog_Data *data)
|
|||
Eina_List *iter;
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *dialog_data;
|
||||
|
||||
EINA_LIST_FOREACH(data->output_dialog_data_list, iter, dialog_data)
|
||||
EINA_LIST_FOREACH (data->output_dialog_data_list, iter, dialog_data)
|
||||
{
|
||||
_dialog_subdialog_arrangement_output_dialog_data_fill(dialog_data);
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ dialog_subdialog_arrangement_basic_create_widgets(Evas *canvas)
|
|||
fprintf(stderr, "CONF_RANDR: Arrangement subdialog added (%p).\n", subdialog);
|
||||
|
||||
//only use information we can restore.
|
||||
EINA_LIST_FOREACH(e_config_runtime_info->output_dialog_data_list, iter, output_dialog_data)
|
||||
EINA_LIST_FOREACH (e_config_runtime_info->output_dialog_data_list, iter, output_dialog_data)
|
||||
{
|
||||
if ((!output_dialog_data->crtc && !output_dialog_data->output))
|
||||
continue;
|
||||
|
@ -200,7 +200,7 @@ _dialog_subdialog_arrangement_smart_class_resize(Evas_Object *obj, Evas_Coord w,
|
|||
|
||||
lst = evas_object_smart_members_get(obj);
|
||||
//Calc average aspect ratio from all available monitors
|
||||
EINA_LIST_FOREACH(lst, itr, output)
|
||||
EINA_LIST_FOREACH (lst, itr, output)
|
||||
{
|
||||
if (output == e_config_runtime_info->gui.subdialogs.arrangement.clipper) continue;
|
||||
output_dialog_data = evas_object_data_get(output, "output_info");
|
||||
|
@ -221,7 +221,7 @@ _dialog_subdialog_arrangement_smart_class_resize(Evas_Object *obj, Evas_Coord w,
|
|||
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);
|
||||
scaling_factor *= e_scale;
|
||||
|
||||
EINA_LIST_FOREACH(lst, itr, output)
|
||||
EINA_LIST_FOREACH (lst, itr, output)
|
||||
{
|
||||
//Skip elements that are either the clipped smart object or falsely added
|
||||
//to the list of outputs (which should not happen)
|
||||
|
@ -287,7 +287,7 @@ _dialog_subdialog_arrangement_output_mouse_down_cb(void *data __UNUSED__, Evas *
|
|||
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 (evas_object_smart_members_get(evas_object_smart_parent_get(obj)), iter, element)
|
||||
{
|
||||
if (e_config_runtime_info->gui.subdialogs.arrangement.clipper == obj) continue;
|
||||
if (element != obj)
|
||||
|
@ -433,7 +433,7 @@ _dialog_subdialog_arrangement_make_suggestion(Evas_Object *obj)
|
|||
dya = tmp;
|
||||
}
|
||||
//iterate crtc list
|
||||
EINA_LIST_FOREACH(crtcs, li, crtc)
|
||||
EINA_LIST_FOREACH (crtcs, li, crtc)
|
||||
{
|
||||
if ((crtc == obj) || (crtc == e_config_runtime_info->gui.subdialogs.arrangement.clipper)) continue;
|
||||
evas_object_geometry_get(crtc, &crtc_geo.x, &crtc_geo.y, &crtc_geo.w, &crtc_geo.h);
|
||||
|
@ -526,7 +526,7 @@ dialog_subdialog_arrangement_free_data(E_Config_Dialog *cfd __UNUSED__, E_Config
|
|||
|
||||
EINA_SAFETY_ON_NULL_RETURN(cfdata);
|
||||
|
||||
EINA_LIST_FREE(cfdata->output_dialog_data_list, dialog_data)
|
||||
EINA_LIST_FREE (cfdata->output_dialog_data_list, dialog_data)
|
||||
{
|
||||
if (!dialog_data) continue;
|
||||
if (dialog_data->bg)
|
||||
|
@ -551,7 +551,7 @@ _dialog_subdialog_arrangement_neighbors_get(Evas_Object *obj)
|
|||
|
||||
EINA_SAFETY_ON_FALSE_RETURN_VAL((dialog_data = evas_object_data_get(obj, "output_info")), NULL);
|
||||
evas_object_geometry_get(obj, &geo.x, &geo.y, &geo.w, &geo.h);
|
||||
EINA_LIST_FOREACH(crtcs, iter, crtc)
|
||||
EINA_LIST_FOREACH (crtcs, iter, crtc)
|
||||
{
|
||||
if ((crtc == obj)
|
||||
|| (crtc == e_config_runtime_info->gui.subdialogs.arrangement.clipper)) continue;
|
||||
|
@ -601,7 +601,7 @@ _dialog_subdialog_arrangement_determine_positions_recursive(Evas_Object *obj)
|
|||
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)
|
||||
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, "output_info"))) continue;
|
||||
|
@ -665,7 +665,7 @@ _dialog_subdialog_arrangement_determine_positions_recursive(Evas_Object *obj)
|
|||
{
|
||||
//Only wander all neighbors recursively, if they can use the current
|
||||
//element as reference for their position
|
||||
EINA_LIST_FOREACH(neighbors, iter, crtc)
|
||||
EINA_LIST_FOREACH (neighbors, iter, crtc)
|
||||
{
|
||||
neighbor_info = evas_object_data_get(crtc, "output_info");
|
||||
if ((neighbor_info->new_pos.x == Ecore_X_Randr_Unset)
|
||||
|
@ -695,7 +695,7 @@ dialog_subdialog_arrangement_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dia
|
|||
|
||||
//Create virtual borders around the displayed representations by finding
|
||||
//relative x and y as virtual 0x0
|
||||
EINA_LIST_FOREACH(crtcs, iter, crtc)
|
||||
EINA_LIST_FOREACH (crtcs, iter, crtc)
|
||||
{
|
||||
if (crtc == e_config_runtime_info->gui.subdialogs.arrangement.clipper) continue;
|
||||
//Already reset values for upcoming calculation
|
||||
|
@ -721,7 +721,7 @@ dialog_subdialog_arrangement_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dia
|
|||
e_config_runtime_info->gui.subdialogs.arrangement.relative_zero.y = relz.y;
|
||||
if (top_left) _dialog_subdialog_arrangement_determine_positions_recursive(top_left);
|
||||
|
||||
EINA_LIST_FOREACH(crtcs, iter, crtc)
|
||||
EINA_LIST_FOREACH (crtcs, iter, crtc)
|
||||
{
|
||||
if ((crtc == e_config_runtime_info->gui.subdialogs.arrangement.clipper) || !(odd = evas_object_data_get(crtc, "output_info")) || !odd->crtc
|
||||
|| ((odd->new_pos.x == Ecore_X_Randr_Unset) || (odd->new_pos.y == Ecore_X_Randr_Unset))) continue;
|
||||
|
@ -750,7 +750,7 @@ dialog_subdialog_arrangement_basic_check_changed(E_Config_Dialog *cfd __UNUSED__
|
|||
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, output_dialog_data)
|
||||
{
|
||||
if ((output_dialog_data->previous_pos.x != output_dialog_data->new_pos.x)
|
||||
|| (output_dialog_data->previous_pos.y != output_dialog_data->new_pos.y)
|
||||
|
@ -767,7 +767,7 @@ dialog_subdialog_arrangement_keep_changes(E_Config_Dialog_Data *cfdata)
|
|||
|
||||
if (!cfdata) return;
|
||||
|
||||
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
|
||||
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;
|
||||
|
@ -785,7 +785,7 @@ dialog_subdialog_arrangement_discard_changes(E_Config_Dialog_Data *cfdata)
|
|||
|
||||
if (!cfdata) return;
|
||||
|
||||
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
|
||||
EINA_LIST_FOREACH (cfdata->output_dialog_data_list, iter, odd)
|
||||
{
|
||||
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))
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
|
||||
#define RANDR_DIALOG_ORIENTATION_ALL (ECORE_X_RANDR_ORIENTATION_ROT_0 | ECORE_X_RANDR_ORIENTATION_ROT_90 | ECORE_X_RANDR_ORIENTATION_ROT_180 | ECORE_X_RANDR_ORIENTATION_ROT_270 | ECORE_X_RANDR_ORIENTATION_ROT_270 | ECORE_X_RANDR_ORIENTATION_FLIP_X | ECORE_X_RANDR_ORIENTATION_FLIP_Y)
|
||||
|
||||
Eina_Bool dialog_subdialog_orientation_create_data (E_Config_Dialog_Data *cfdata);
|
||||
Eina_Bool dialog_subdialog_orientation_create_data(E_Config_Dialog_Data *cfdata);
|
||||
Evas_Object *dialog_subdialog_orientation_basic_create_widgets(Evas *canvas);
|
||||
Eina_Bool dialog_subdialog_orientation_basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
Eina_Bool dialog_subdialog_orientation_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
Eina_Bool dialog_subdialog_orientation_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
Eina_Bool dialog_subdialog_orientation_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
void dialog_subdialog_orientation_update_radio_buttons(Evas_Object *crtc);
|
||||
|
@ -20,19 +20,19 @@ extern E_Config_Dialog_Data *e_config_runtime_info;
|
|||
extern char _theme_file_path[];
|
||||
|
||||
/*
|
||||
static void
|
||||
_dialog_subdialog_orientation_radio_add_callbacks(void)
|
||||
{
|
||||
static void
|
||||
_dialog_subdialog_orientation_radio_add_callbacks(void)
|
||||
{
|
||||
evas_object_event_callback_add (e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_vertical, EVAS_CALLBACK_MOUSE_UP, _dialog_subdialog_orientation_policy_mouse_up_cb, NULL);
|
||||
evas_object_event_callback_add (e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_horizontal, EVAS_CALLBACK_MOUSE_UP, _dialog_subdialog_orientation_policy_mouse_up_cb, NULL);
|
||||
evas_object_event_callback_add (e_config_runtime_info->gui.subdialogs.orientation.radio_rot270, EVAS_CALLBACK_MOUSE_UP, _dialog_subdialog_orientation_policy_mouse_up_cb, NULL);
|
||||
evas_object_event_callback_add (e_config_runtime_info->gui.subdialogs.orientation.radio_rot180, EVAS_CALLBACK_MOUSE_UP, _dialog_subdialog_orientation_policy_mouse_up_cb, NULL);
|
||||
evas_object_event_callback_add (e_config_runtime_info->gui.subdialogs.orientation.radio_rot90, EVAS_CALLBACK_MOUSE_UP, _dialog_subdialog_orientation_policy_mouse_up_cb, NULL);
|
||||
evas_object_event_callback_add (e_config_runtime_info->gui.subdialogs.orientation.radio_normal, EVAS_CALLBACK_MOUSE_UP, _dialog_subdialog_orientation_policy_mouse_up_cb, NULL);
|
||||
}
|
||||
*/
|
||||
}
|
||||
*/
|
||||
|
||||
Eina_Bool
|
||||
Eina_Bool
|
||||
dialog_subdialog_orientation_create_data(E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *odd;
|
||||
|
@ -41,7 +41,7 @@ dialog_subdialog_orientation_create_data(E_Config_Dialog_Data *cfdata)
|
|||
|
||||
if (!cfdata || !cfdata->output_dialog_data_list) return EINA_FALSE;
|
||||
|
||||
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
|
||||
EINA_LIST_FOREACH (cfdata->output_dialog_data_list, iter, odd)
|
||||
{
|
||||
ci = odd->crtc;
|
||||
if (!ci || !ci->current_mode) continue;
|
||||
|
@ -65,7 +65,7 @@ dialog_subdialog_orientation_basic_create_widgets(Evas *canvas)
|
|||
if (!(subdialog = e_widget_framelist_add(canvas, _("Display Orientation"), EINA_FALSE))) return NULL;
|
||||
|
||||
// Add radio buttons
|
||||
if(!(rg = e_widget_radio_group_new(&e_config_runtime_info->gui.subdialogs.orientation.radio_val))) goto _dialog_subdialog_orientation_radio_add_fail;
|
||||
if (!(rg = e_widget_radio_group_new(&e_config_runtime_info->gui.subdialogs.orientation.radio_val))) goto _dialog_subdialog_orientation_radio_add_fail;
|
||||
|
||||
//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);
|
||||
|
@ -106,10 +106,10 @@ dialog_subdialog_orientation_basic_create_widgets(Evas *canvas)
|
|||
return subdialog;
|
||||
|
||||
/*
|
||||
_dialog_subdialog_orientation_edje_set_fail:
|
||||
_dialog_subdialog_orientation_edje_set_fail:
|
||||
evas_object_del(ol);
|
||||
evas_object_del(e_config_runtime_info->gui.subdialogs.orientation.swallowing_edje);
|
||||
_dialog_subdialog_orientation_edje_add_fail:
|
||||
_dialog_subdialog_orientation_edje_add_fail:
|
||||
fprintf(stderr, "CONF_RANDR: Couldn't set edj for orientation subdialog!\n");
|
||||
evas_object_del(subdialog);
|
||||
return NULL;
|
||||
|
@ -121,7 +121,7 @@ _dialog_subdialog_orientation_radio_add_fail:
|
|||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
static void
|
||||
_dialog_subdialog_orientation_policy_mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
char signal[40];
|
||||
|
@ -147,9 +147,10 @@ _dialog_subdialog_orientation_policy_mouse_up_cb(void *data, Evas *e, Evas_Objec
|
|||
|
||||
fprintf(stderr, "CONF_RANDR: mouse button released. Emitted signal to orientation: %s\n", signal);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void
|
||||
void
|
||||
dialog_subdialog_orientation_update_radio_buttons(Evas_Object *crtc)
|
||||
{
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
||||
|
@ -219,24 +220,29 @@ dialog_subdialog_orientation_update_radio_buttons(Evas_Object *crtc)
|
|||
case ECORE_X_RANDR_ORIENTATION_ROT_90:
|
||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot90, EINA_TRUE);
|
||||
break;
|
||||
|
||||
case ECORE_X_RANDR_ORIENTATION_ROT_180:
|
||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot180, EINA_TRUE);
|
||||
break;
|
||||
|
||||
case ECORE_X_RANDR_ORIENTATION_ROT_270:
|
||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.orientation.radio_rot270, EINA_TRUE);
|
||||
break;
|
||||
|
||||
case ECORE_X_RANDR_ORIENTATION_FLIP_X:
|
||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_horizontal, EINA_TRUE);
|
||||
break;
|
||||
|
||||
case ECORE_X_RANDR_ORIENTATION_FLIP_Y:
|
||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.orientation.radio_reflect_vertical, EINA_TRUE);
|
||||
break;
|
||||
|
||||
default: //== ECORE_X_RANDR_ORIENTATION_ROT_0:
|
||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.orientation.radio_normal, EINA_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
dialog_subdialog_orientation_update_edje(Evas_Object *crtc)
|
||||
{
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
||||
|
@ -265,8 +271,8 @@ dialog_subdialog_orientation_update_edje(Evas_Object *crtc)
|
|||
edje_object_signal_emit(crtc, signal, "e");
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
dialog_subdialog_orientation_basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata __UNUSED__)
|
||||
Eina_Bool
|
||||
dialog_subdialog_orientation_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata __UNUSED__)
|
||||
{
|
||||
Ecore_X_Randr_Orientation orientation;
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
||||
|
@ -288,17 +294,17 @@ dialog_subdialog_orientation_basic_apply_data (E_Config_Dialog *cfd, E_Config_Di
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
Eina_Bool
|
||||
dialog_subdialog_orientation_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata __UNUSED__)
|
||||
{
|
||||
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, "output_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.subdialogs.orientation.radio_val;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
dialog_subdialog_orientation_keep_changes(E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *odd;
|
||||
|
@ -306,7 +312,7 @@ dialog_subdialog_orientation_keep_changes(E_Config_Dialog_Data *cfdata)
|
|||
|
||||
if (!cfdata) return;
|
||||
|
||||
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
|
||||
EINA_LIST_FOREACH (cfdata->output_dialog_data_list, iter, odd)
|
||||
{
|
||||
if (!odd || ((int)odd->previous_orientation == Ecore_X_Randr_Unset)) continue;
|
||||
odd->previous_orientation = odd->new_orientation;
|
||||
|
@ -314,7 +320,7 @@ dialog_subdialog_orientation_keep_changes(E_Config_Dialog_Data *cfdata)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
dialog_subdialog_orientation_discard_changes(E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *odd;
|
||||
|
@ -322,7 +328,7 @@ dialog_subdialog_orientation_discard_changes(E_Config_Dialog_Data *cfdata)
|
|||
|
||||
if (!cfdata) return;
|
||||
|
||||
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
|
||||
EINA_LIST_FOREACH (cfdata->output_dialog_data_list, iter, odd)
|
||||
{
|
||||
if (!odd->crtc || ((int)odd->previous_orientation == Ecore_X_Randr_Unset)) continue;
|
||||
if (ecore_x_randr_crtc_orientation_set(cfdata->manager->root, odd->crtc->xid, odd->previous_orientation))
|
||||
|
@ -333,3 +339,4 @@ dialog_subdialog_orientation_discard_changes(E_Config_Dialog_Data *cfdata)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#endif
|
||||
|
||||
Evas_Object *dialog_subdialog_policies_basic_create_widgets(Evas *canvas);
|
||||
Eina_Bool dialog_subdialog_policies_basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
Eina_Bool dialog_subdialog_policies_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
Eina_Bool dialog_subdialog_policies_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
Eina_Bool dialog_subdialog_policies_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
void dialog_subdialog_policies_update_radio_buttons(Evas_Object *crtc);
|
||||
|
@ -23,19 +23,19 @@ extern E_Config_Dialog_Data *e_config_runtime_info;
|
|||
extern char _theme_file_path[];
|
||||
|
||||
/*
|
||||
static void
|
||||
_dialog_subdialog_policies_radio_add_callbacks(void)
|
||||
{
|
||||
static void
|
||||
_dialog_subdialog_policies_radio_add_callbacks(void)
|
||||
{
|
||||
evas_object_event_callback_add(e_config_runtime_info->gui.subdialogs.policies.radio_none, EVAS_CALLBACK_MOUSE_UP, _dialog_subdialog_policies_policy_mouse_up_cb, NULL);
|
||||
evas_object_event_callback_add(e_config_runtime_info->gui.subdialogs.policies.radio_clone, EVAS_CALLBACK_MOUSE_UP, _dialog_subdialog_policies_policy_mouse_up_cb, NULL);
|
||||
evas_object_event_callback_add(e_config_runtime_info->gui.subdialogs.policies.radio_left, EVAS_CALLBACK_MOUSE_UP, _dialog_subdialog_policies_policy_mouse_up_cb, NULL);
|
||||
evas_object_event_callback_add(e_config_runtime_info->gui.subdialogs.policies.radio_below, EVAS_CALLBACK_MOUSE_UP, _dialog_subdialog_policies_policy_mouse_up_cb, NULL);
|
||||
evas_object_event_callback_add(e_config_runtime_info->gui.subdialogs.policies.radio_above, EVAS_CALLBACK_MOUSE_UP, _dialog_subdialog_policies_policy_mouse_up_cb, NULL);
|
||||
evas_object_event_callback_add(e_config_runtime_info->gui.subdialogs.policies.radio_right, EVAS_CALLBACK_MOUSE_UP, _dialog_subdialog_policies_policy_mouse_up_cb, NULL);
|
||||
}
|
||||
*/
|
||||
}
|
||||
*/
|
||||
|
||||
Eina_Bool
|
||||
Eina_Bool
|
||||
dialog_subdialog_policies_create_data(E_Config_Dialog_Data *e_config_runtime_info)
|
||||
{
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *odd;
|
||||
|
@ -43,7 +43,7 @@ dialog_subdialog_policies_create_data(E_Config_Dialog_Data *e_config_runtime_inf
|
|||
|
||||
if (!e_config_runtime_info || !e_config_runtime_info->output_dialog_data_list) return EINA_FALSE;
|
||||
|
||||
EINA_LIST_FOREACH(e_config_runtime_info->output_dialog_data_list, iter, odd)
|
||||
EINA_LIST_FOREACH (e_config_runtime_info->output_dialog_data_list, iter, odd)
|
||||
{
|
||||
E_Randr_Output_Info *oi;
|
||||
if (odd->crtc)
|
||||
|
@ -69,7 +69,7 @@ dialog_subdialog_policies_basic_create_widgets(Evas *canvas)
|
|||
|
||||
if (e_config_runtime_info->gui.subdialogs.policies.dialog) return e_config_runtime_info->gui.subdialogs.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
|
||||
if (!(rg = e_widget_radio_group_new(&e_config_runtime_info->gui.subdialogs.policies.radio_val))) goto _dialog_subdialog_policies_radio_add_fail;
|
||||
|
@ -142,9 +142,9 @@ dialog_subdialog_policies_basic_create_widgets(Evas *canvas)
|
|||
return subdialog;
|
||||
|
||||
/*
|
||||
_dialog_subdialog_policies_edje_set_fail:
|
||||
_dialog_subdialog_policies_edje_set_fail:
|
||||
evas_object_del(e_config_runtime_info->gui.subdialogs.policies.swallowing_edje);
|
||||
_dialog_subdialog_policies_edje_add_fail:
|
||||
_dialog_subdialog_policies_edje_add_fail:
|
||||
fprintf(stderr, "CONF_RANDR: Couldn't set edj for policies subdialog!\n");
|
||||
evas_object_del(subdialog);
|
||||
return NULL;
|
||||
|
@ -154,7 +154,7 @@ _dialog_subdialog_policies_radio_add_fail:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
_dialog_subdialog_policies_policy_mouse_up_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
|
||||
{
|
||||
char signal[29];
|
||||
|
@ -181,7 +181,7 @@ _dialog_subdialog_policies_policy_mouse_up_cb(void *data __UNUSED__, Evas *e __U
|
|||
fprintf(stderr, "CONF_RANDR: mouse button released. Emitted signal to policy: %s\n", signal);
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
Eina_Bool
|
||||
dialog_subdialog_policies_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata __UNUSED__)
|
||||
{
|
||||
if (!e_randr_screen_info || !e_config_runtime_info->gui.selected_output_dd) return EINA_FALSE;
|
||||
|
@ -194,15 +194,15 @@ dialog_subdialog_policies_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Co
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
Eina_Bool
|
||||
dialog_subdialog_policies_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
if (!e_randr_screen_info || !cfdata || !cfdata->gui.selected_output_dd) 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.subdialogs.policies.radio_val;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
dialog_subdialog_policies_update_radio_buttons(Evas_Object *crtc)
|
||||
{
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
||||
|
@ -233,7 +233,7 @@ dialog_subdialog_policies_update_radio_buttons(Evas_Object *crtc)
|
|||
|
||||
if (output_dialog_data->crtc && output_dialog_data->crtc->outputs)
|
||||
{
|
||||
output = (E_Randr_Output_Info*)eina_list_data_get(eina_list_last(output_dialog_data->crtc->outputs));
|
||||
output = (E_Randr_Output_Info *)eina_list_data_get(eina_list_last(output_dialog_data->crtc->outputs));
|
||||
}
|
||||
else if (output_dialog_data->output)
|
||||
{
|
||||
|
@ -249,24 +249,29 @@ dialog_subdialog_policies_update_radio_buttons(Evas_Object *crtc)
|
|||
case ECORE_X_RANDR_OUTPUT_POLICY_RIGHT:
|
||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.policies.radio_right, EINA_TRUE);
|
||||
break;
|
||||
|
||||
case ECORE_X_RANDR_OUTPUT_POLICY_BELOW:
|
||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.policies.radio_below, EINA_TRUE);
|
||||
break;
|
||||
|
||||
case ECORE_X_RANDR_OUTPUT_POLICY_LEFT:
|
||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.policies.radio_left, EINA_TRUE);
|
||||
break;
|
||||
|
||||
case ECORE_X_RANDR_OUTPUT_POLICY_CLONE:
|
||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.policies.radio_clone, EINA_TRUE);
|
||||
break;
|
||||
|
||||
case ECORE_X_RANDR_OUTPUT_POLICY_NONE:
|
||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.policies.radio_none, EINA_TRUE);
|
||||
break;
|
||||
|
||||
default: //== ECORE_X_RANDR_OUTPUT_POLICY_ABOVE:
|
||||
e_widget_radio_toggle_set(e_config_runtime_info->gui.subdialogs.policies.radio_above, EINA_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
dialog_subdialog_policies_keep_changes(E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *odd;
|
||||
|
@ -274,7 +279,7 @@ dialog_subdialog_policies_keep_changes(E_Config_Dialog_Data *cfdata)
|
|||
|
||||
if (!cfdata) return;
|
||||
|
||||
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
|
||||
EINA_LIST_FOREACH (cfdata->output_dialog_data_list, iter, odd)
|
||||
{
|
||||
if (!odd || ((int)odd->previous_policy == Ecore_X_Randr_Unset)) continue;
|
||||
odd->previous_policy = odd->new_policy;
|
||||
|
@ -282,7 +287,7 @@ dialog_subdialog_policies_keep_changes(E_Config_Dialog_Data *cfdata)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
dialog_subdialog_policies_discard_changes(E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *odd;
|
||||
|
@ -290,10 +295,11 @@ dialog_subdialog_policies_discard_changes(E_Config_Dialog_Data *cfdata)
|
|||
|
||||
if (!cfdata) return;
|
||||
|
||||
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
|
||||
EINA_LIST_FOREACH (cfdata->output_dialog_data_list, iter, odd)
|
||||
{
|
||||
if (!odd->crtc || ((int)odd->previous_policy == Ecore_X_Randr_Unset)) continue;
|
||||
odd->new_policy = odd->previous_policy;
|
||||
odd->previous_policy = Ecore_X_Randr_Unset;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#define RESOLUTION_TXT_MAX_LENGTH 50
|
||||
|
||||
Evas_Object *dialog_subdialog_resolutions_basic_create_widgets(Evas *canvas);
|
||||
Eina_Bool dialog_subdialog_resolutions_basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
Eina_Bool dialog_subdialog_resolutions_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
Eina_Bool dialog_subdialog_resolutions_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
|
||||
void dialog_subdialog_resolutions_update_list(Evas_Object *crtc);
|
||||
void dialog_subdialog_resolutions_keep_changes(E_Config_Dialog_Data *cfdata);
|
||||
|
@ -27,7 +27,7 @@ void dialog_subdialog_resolutions_discard_changes(E_Config_Dialog_Data *cfdata);
|
|||
|
||||
extern E_Config_Dialog_Data *e_config_runtime_info;
|
||||
|
||||
Eina_Bool
|
||||
Eina_Bool
|
||||
dialog_subdialog_resolutions_create_data(E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *odd;
|
||||
|
@ -36,7 +36,7 @@ dialog_subdialog_resolutions_create_data(E_Config_Dialog_Data *cfdata)
|
|||
|
||||
if (!cfdata || !cfdata->output_dialog_data_list) return EINA_FALSE;
|
||||
|
||||
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
|
||||
EINA_LIST_FOREACH (cfdata->output_dialog_data_list, iter, odd)
|
||||
{
|
||||
if (odd->previous_mode || odd->preferred_mode)
|
||||
{
|
||||
|
@ -46,20 +46,20 @@ dialog_subdialog_resolutions_create_data(E_Config_Dialog_Data *cfdata)
|
|||
}
|
||||
if (odd->crtc)
|
||||
{
|
||||
if(!(mi = odd->crtc->current_mode))
|
||||
mi = (Ecore_X_Randr_Mode_Info*)eina_list_data_get(eina_list_last(odd->crtc->outputs_common_modes));
|
||||
if (!(mi = odd->crtc->current_mode))
|
||||
mi = (Ecore_X_Randr_Mode_Info *)eina_list_data_get(eina_list_last(odd->crtc->outputs_common_modes));
|
||||
odd->previous_mode = mi;
|
||||
}
|
||||
else if (odd->output)
|
||||
{
|
||||
odd->preferred_mode = (Ecore_X_Randr_Mode_Info*)eina_list_data_get(eina_list_last(odd->output->preferred_modes));
|
||||
odd->preferred_mode = (Ecore_X_Randr_Mode_Info *)eina_list_data_get(eina_list_last(odd->output->preferred_modes));
|
||||
}
|
||||
}
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
Evas_Object *
|
||||
Evas_Object *
|
||||
dialog_subdialog_resolutions_basic_create_widgets(Evas *canvas)
|
||||
{
|
||||
Evas_Object *subdialog;
|
||||
|
@ -74,11 +74,11 @@ dialog_subdialog_resolutions_basic_create_widgets(Evas *canvas)
|
|||
return subdialog;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
dialog_subdialog_resolutions_basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata __UNUSED__)
|
||||
Eina_Bool
|
||||
dialog_subdialog_resolutions_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata __UNUSED__)
|
||||
{
|
||||
//Apply new mode
|
||||
Ecore_X_Randr_Mode_Info* selected_mode;
|
||||
Ecore_X_Randr_Mode_Info *selected_mode;
|
||||
Ecore_X_ID selected_mode_xid;
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
|
||||
Ecore_X_Randr_Output *output = NULL;
|
||||
|
@ -103,7 +103,7 @@ dialog_subdialog_resolutions_basic_apply_data (E_Config_Dialog *cfd, E_Config_Di
|
|||
fprintf(stderr, "CONF_RANDR: Trying to find a CRTC for output %x, %d crtcs are possible.\n", output_dialog_data->output->xid, eina_list_count(output_dialog_data->output->possible_crtcs));
|
||||
output = &output_dialog_data->output->xid;
|
||||
noutputs = 1;
|
||||
EINA_LIST_FOREACH(output_dialog_data->output->possible_crtcs, iter, crtc_iter)
|
||||
EINA_LIST_FOREACH (output_dialog_data->output->possible_crtcs, iter, crtc_iter)
|
||||
{
|
||||
if (!crtc_iter->outputs)
|
||||
{
|
||||
|
@ -119,7 +119,7 @@ dialog_subdialog_resolutions_basic_apply_data (E_Config_Dialog *cfd, E_Config_Di
|
|||
return EINA_FALSE;
|
||||
}
|
||||
//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.subdialogs.resolutions.dialog)))
|
||||
{
|
||||
selected_mode_xid = selected_mode->xid;
|
||||
}
|
||||
|
@ -144,18 +144,18 @@ dialog_subdialog_resolutions_basic_apply_data (E_Config_Dialog *cfd, E_Config_Di
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
Eina_Bool
|
||||
dialog_subdialog_resolutions_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata __UNUSED__)
|
||||
{
|
||||
Ecore_X_Randr_Mode_Info* selected_mode;
|
||||
Ecore_X_Randr_Mode_Info *selected_mode;
|
||||
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, "output_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.subdialogs.resolutions.dialog)) || !(output_dialog_data = evas_object_data_get(e_config_runtime_info->gui.selected_eo, "output_info"))) return EINA_FALSE;
|
||||
|
||||
return (selected_mode != output_dialog_data->previous_mode);
|
||||
return selected_mode != output_dialog_data->previous_mode;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
dialog_subdialog_resolutions_update_list(Evas_Object *crtc)
|
||||
{
|
||||
Eina_List *iter, *modelist = NULL;
|
||||
|
@ -189,13 +189,13 @@ dialog_subdialog_resolutions_update_list(Evas_Object *crtc)
|
|||
else
|
||||
modelist = output_dialog_data->output->modes;
|
||||
}
|
||||
EINA_LIST_FOREACH(modelist, iter, mode_info)
|
||||
EINA_LIST_FOREACH (modelist, iter, mode_info)
|
||||
{
|
||||
//calculate refresh rate
|
||||
if (!mode_info) continue;
|
||||
if (mode_info->hTotal && mode_info->vTotal)
|
||||
rate = ((float) mode_info->dotClock /
|
||||
((float) mode_info->hTotal * (float) mode_info->vTotal));
|
||||
rate = ((float)mode_info->dotClock /
|
||||
((float)mode_info->hTotal * (float)mode_info->vTotal));
|
||||
else
|
||||
rate = 0.0;
|
||||
|
||||
|
@ -222,7 +222,6 @@ dialog_subdialog_resolutions_update_list(Evas_Object *crtc)
|
|||
e_widget_ilist_thaw(e_config_runtime_info->gui.subdialogs.resolutions.dialog);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
dialog_subdialog_resolutions_keep_changes(E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
|
@ -231,7 +230,7 @@ dialog_subdialog_resolutions_keep_changes(E_Config_Dialog_Data *cfdata)
|
|||
|
||||
if (!cfdata) return;
|
||||
|
||||
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
|
||||
EINA_LIST_FOREACH (cfdata->output_dialog_data_list, iter, odd)
|
||||
{
|
||||
if (odd && odd->new_mode && (odd->new_mode != odd->previous_mode))
|
||||
{
|
||||
|
@ -241,7 +240,7 @@ dialog_subdialog_resolutions_keep_changes(E_Config_Dialog_Data *cfdata)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
dialog_subdialog_resolutions_discard_changes(E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
E_Config_Randr_Dialog_Output_Dialog_Data *odd;
|
||||
|
@ -249,7 +248,7 @@ dialog_subdialog_resolutions_discard_changes(E_Config_Dialog_Data *cfdata)
|
|||
|
||||
if (!cfdata) return;
|
||||
|
||||
EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
|
||||
EINA_LIST_FOREACH (cfdata->output_dialog_data_list, iter, odd)
|
||||
{
|
||||
//for now, there is no way to redisable an output during discartion
|
||||
if (!odd->crtc || !odd->previous_mode) continue;
|
||||
|
@ -262,3 +261,4 @@ dialog_subdialog_resolutions_discard_changes(E_Config_Dialog_Data *cfdata)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,8 @@ EAPI int
|
|||
e_modapi_shutdown(E_Module *m __UNUSED__)
|
||||
{
|
||||
E_Config_Dialog *cfd;
|
||||
while ((cfd = e_config_dialog_get("E", "screen/randr"))) e_object_del(E_OBJECT(cfd));
|
||||
while ((cfd = e_config_dialog_get("E", "screen/randr")))
|
||||
e_object_del(E_OBJECT(cfd));
|
||||
e_configure_registry_item_del("screen/randr");
|
||||
e_configure_registry_category_del("screen");
|
||||
conf_randr_module = NULL;
|
||||
|
@ -40,3 +41,4 @@ e_modapi_save(E_Module *m __UNUSED__)
|
|||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue