From 69b12661d5e5afd7154bae815b569d57348abdfd Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Tue, 19 Feb 2013 10:55:50 +0000 Subject: [PATCH] Start code for monitors create - Create monitor smart object - Set crtc and output config for monitor. Signed-off-by: Christopher Michael SVN revision: 84131 --- src/modules/conf_randr/e_smart_randr.c | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/modules/conf_randr/e_smart_randr.c b/src/modules/conf_randr/e_smart_randr.c index 79aa86992..3b2cfbecf 100644 --- a/src/modules/conf_randr/e_smart_randr.c +++ b/src/modules/conf_randr/e_smart_randr.c @@ -54,9 +54,38 @@ void e_smart_randr_monitors_create(Evas_Object *obj) { E_Smart_Data *sd; + Evas *evas; + Eina_List *l = NULL; + E_Randr_Crtc_Config *crtc; /* try to get the objects smart data */ if (!(sd = evas_object_smart_data_get(obj))) return; + + /* grab the canvas of the layout widget */ + evas = evas_object_evas_get(sd->o_layout); + + /* loop the list of crtcs in our config */ + EINA_LIST_FOREACH(e_randr_cfg->crtcs, l, crtc) + { + Eina_List *o = NULL; + E_Randr_Output_Config *output; + + /* loop the list of outputs in this crtc */ + EINA_LIST_FOREACH(crtc->outputs, o, output) + { + Evas_Object *mon; + + /* for each output, try to create a monitor */ + if (!(mon = e_smart_monitor_add(evas))) + continue; + + /* tell monitor what crtc it uses */ + e_smart_monitor_crtc_set(mon, crtc); + + /* tell monitor what output it uses */ + e_smart_monitor_output_set(mon, output); + } + } } /* local functions */