Remove Evas_Object as reference from conf_randr. Use data structure instead.
authorLeif Middelschulte <leif.middelschulte@gmail.com>
Thu, 26 Apr 2012 10:22:31 +0000 (10:22 +0000)
committerLeif Middelschulte <leif.middelschulte@gmail.com>
Thu, 26 Apr 2012 10:22:31 +0000 (10:22 +0000)
SVN revision: 70504

src/modules/conf_randr/e_int_config_randr.h
src/modules/conf_randr/e_int_config_randr_arrangement.c
src/modules/conf_randr/e_int_config_randr_orientation.c
src/modules/conf_randr/e_int_config_randr_policy.c
src/modules/conf_randr/e_int_config_randr_resolution.c

index 9e1efce..23a65a8 100644 (file)
@@ -18,7 +18,7 @@ struct _E_Config_Dialog_Data
    E_Manager *manager;
    struct {
         Evas *canvas;
-        Evas_Object *dialog, *widget_list, *selected_eo;
+        Evas_Object *dialog, *widget_list;
         E_Config_Randr_Dialog_Output_Dialog_Data *selected_output_dd;
         E_Config_Randr_Dialog_Confirmation_Dialog_Data *confirmation_dialog;
         struct {
@@ -95,7 +95,7 @@ Eina_Bool    policy_widget_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialo
 void         policy_widget_free_cfdata(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
 void         policy_widget_keep_changes(E_Config_Dialog_Data *cfdata);
 void         policy_widget_discard_changes(E_Config_Dialog_Data *cfdata);
-void         policy_widget_update_radio_buttons(Evas_Object *crtc);
+void         policy_widget_update_radio_buttons(E_Config_Randr_Dialog_Output_Dialog_Data *odd);
 
 // Functions for the resolutions widget interaction
 Eina_Bool    resolution_widget_create_data(E_Config_Dialog_Data *cfdata);
@@ -105,7 +105,7 @@ Eina_Bool    resolution_widget_basic_apply_data(E_Config_Dialog *cfd, E_Config_D
 void         resolution_widget_free_cfdata(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
 void         resolution_widget_keep_changes(E_Config_Dialog_Data *cfdata);
 void         resolution_widget_discard_changes(E_Config_Dialog_Data *cfdata);
-void         resolution_widget_update_list(Evas_Object *crtc);
+void         resolution_widget_update_list(E_Config_Randr_Dialog_Output_Dialog_Data *odd);
 
 // Functions for the orientation widget interaction
 Eina_Bool    orientation_widget_create_data(E_Config_Dialog_Data *cfdata);
@@ -113,8 +113,8 @@ Evas_Object *orientation_widget_basic_create_widgets(Evas *canvas);
 Eina_Bool    orientation_widget_basic_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
 Eina_Bool    orientation_widget_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
 void         orientation_widget_free_cfdata(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
-void         orientation_widget_update_radio_buttons(Evas_Object *crtc);
-void         orientation_widget_update_edje(Evas_Object *crtc);
+void         orientation_widget_update_radio_buttons(E_Config_Randr_Dialog_Output_Dialog_Data *odd);
+void         orientation_widget_update_edje(E_Config_Randr_Dialog_Output_Dialog_Data *odd);
 void         orientation_widget_keep_changes(E_Config_Dialog_Data *cfdata);
 void         orientation_widget_discard_changes(E_Config_Dialog_Data *cfdata);
 
index 80e5198..7bbe15a 100644 (file)
@@ -407,17 +407,16 @@ _arrangement_widget_rep_mouse_down_cb(void *data __UNUSED__, Evas *e __UNUSED__,
 
    e_layout_child_geometry_get(obj, &e_config_runtime_info->gui.widgets.arrangement.sel_rep_previous_pos.x, &e_config_runtime_info->gui.widgets.arrangement.sel_rep_previous_pos.y, NULL, NULL);
    //update data for other logs
-   e_config_runtime_info->gui.selected_eo = obj;
    e_config_runtime_info->gui.selected_output_dd = (E_Config_Randr_Dialog_Output_Dialog_Data*)evas_object_data_get(obj, "rep_info");
 
    //update resolutions list
-   resolution_widget_update_list(obj);
+   resolution_widget_update_list(e_config_runtime_info->gui.selected_output_dd);
 
    //update orientation radio buttons
-   orientation_widget_update_radio_buttons(obj);
+   orientation_widget_update_radio_buttons(e_config_runtime_info->gui.selected_output_dd);
 
    //update policy radio buttons
-   policy_widget_update_radio_buttons(obj);
+   policy_widget_update_radio_buttons(e_config_runtime_info->gui.selected_output_dd);
 }
 
 static void
index 4ef3f42..2ade18d 100644 (file)
@@ -31,7 +31,7 @@ orientation_widget_create_data(E_Config_Dialog_Data *cfdata)
    EINA_LIST_FOREACH(cfdata->output_dialog_data_list, iter, odd)
      {
         odd->new_orientation = Ecore_X_Randr_Unset;
-        odd->previous_orientation = odd->crtc ? odd->crtc->current_orientation :  Ecore_X_Randr_Unset;
+        odd->previous_orientation = odd->crtc ? odd->crtc->current_orientation : Ecore_X_Randr_Unset;
      }
 
    return EINA_TRUE;
@@ -95,7 +95,7 @@ orientation_widget_basic_create_widgets(Evas *canvas)
     */
 
    //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_output_dd);
 
    //evas_object_show(e_config_runtime_info->gui.widgets.orientation.swallowing_edje);
 
@@ -149,13 +149,12 @@ _orientation_widget_mouse_up_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_
 }
 
 void
-orientation_widget_update_radio_buttons(Evas_Object *crtc)
+orientation_widget_update_radio_buttons(E_Config_Randr_Dialog_Output_Dialog_Data *odd)
 {
-   E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
    Ecore_X_Randr_Orientation supported_oris, ori;
 
    //disable widgets, if no crtc is selected
-   if (!crtc)
+   if (!odd)
      {
         e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_normal, EINA_TRUE);
         e_widget_disabled_set(e_config_runtime_info->gui.widgets.orientation.radio_rot90, EINA_TRUE);
@@ -166,13 +165,11 @@ orientation_widget_update_radio_buttons(Evas_Object *crtc)
         return;
      }
 
-   if (!(output_dialog_data = evas_object_data_get(crtc, "rep_info"))) return;
-
-   if (output_dialog_data->crtc)
+   if (odd->crtc)
      {
         //enabled monitor
-        supported_oris = output_dialog_data->crtc->orientations;
-        ori = (output_dialog_data->new_orientation != Ecore_X_Randr_Unset) ? output_dialog_data->new_orientation : output_dialog_data->crtc->current_orientation;
+        supported_oris = odd->crtc->orientations;
+        ori = (odd->new_orientation != Ecore_X_Randr_Unset) ? odd->new_orientation : odd->crtc->current_orientation;
      }
    else
      {
@@ -246,19 +243,19 @@ orientation_widget_update_radio_buttons(Evas_Object *crtc)
 
 /*
 void
-orientation_widget_update_edje(Evas_Object *crtc)
+orientation_widget_update_edje(E_Config_Randr_Dialog_Output_Dialog_Data *odd)
 {
-   E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
    Ecore_X_Randr_Orientation supported_oris, ori;
    char signal[40];
 
-   if (!e_config_runtime_info->gui.selected_eo || !(output_dialog_data = evas_object_data_get(crtc, "rep_info"))) return;
+   if (!odd)
+     return;
 
-   if (output_dialog_data->crtc)
+   if (odd->crtc)
      {
         //enabled monitor
-        supported_oris = output_dialog_data->crtc->orientations;
-        ori = output_dialog_data->crtc->current_orientation;
+        supported_oris = odd->crtc->orientations;
+        ori = odd->crtc->current_orientation;
      }
    else
      {
index 7f1f262..acd2d80 100644 (file)
@@ -250,13 +250,12 @@ policy_widget_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_Dial
 }
 
 void
-policy_widget_update_radio_buttons(Evas_Object *rep)
+policy_widget_update_radio_buttons(E_Config_Randr_Dialog_Output_Dialog_Data *odd)
 {
-   E_Config_Randr_Dialog_Output_Dialog_Data *output_dialog_data;
    Ecore_X_Randr_Output_Policy policy;
 
    //disable widgets, if no rep is selected
-   if (!rep || !(output_dialog_data = evas_object_data_get(rep, "rep_info")))
+   if (!odd)
      {
         //Evas_Object *radio_above, *radio_right, *radio_below, *radio_left, *radio_clone, *radio_none;
         e_widget_disabled_set(e_config_runtime_info->gui.widgets.policy.radio_above, EINA_TRUE);
@@ -277,7 +276,7 @@ policy_widget_update_radio_buttons(Evas_Object *rep)
         e_widget_disabled_set(e_config_runtime_info->gui.widgets.policy.radio_none, EINA_FALSE);
      }
 
-   policy = (output_dialog_data->new_policy != Ecore_X_Randr_Unset) ? output_dialog_data->new_policy : output_dialog_data->previous_policy;
+   policy = (odd->new_policy != Ecore_X_Randr_Unset) ? odd->new_policy : odd->previous_policy;
    //toggle the switch of the currently used policies
    switch (policy)
      {
index f9f2d4f..f1cc4b4 100644 (file)
@@ -161,10 +161,9 @@ resolution_widget_basic_check_changed(E_Config_Dialog *cfd __UNUSED__, E_Config_
 }
 
 void
-resolution_widget_update_list(Evas_Object *rep)
+resolution_widget_update_list(E_Config_Randr_Dialog_Output_Dialog_Data *odd)
 {
    Eina_List *iter, *modelist = NULL;
-   E_Config_Randr_Dialog_Output_Dialog_Data *odd;
    Ecore_X_Randr_Mode_Info *mode_info, *current_mode = NULL;
    char resolution_text[RESOLUTION_TXT_MAX_LENGTH];
    float rate;
@@ -174,7 +173,7 @@ resolution_widget_update_list(Evas_Object *rep)
    e_widget_ilist_freeze(e_config_runtime_info->gui.widgets.resolution.widget);
    e_widget_ilist_clear(e_config_runtime_info->gui.widgets.resolution.widget);
 
-   if (!rep || !(odd = evas_object_data_get(rep, "rep_info")))
+   if (!odd)
      goto _go_and_return;
 
    //select correct mode list