Start code for monitors create
authorChristopher Michael <cp.michael@samsung.com>
Tue, 19 Feb 2013 10:55:50 +0000 (10:55 +0000)
committerChristopher Michael <cpmichael1@comcast.net>
Tue, 19 Feb 2013 10:55:50 +0000 (10:55 +0000)
 - Create monitor smart object
 - Set crtc and output config for monitor.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>
SVN revision: 84131

src/modules/conf_randr/e_smart_randr.c

index 79aa869..3b2cfbe 100644 (file)
@@ -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 */