forked from enlightenment/enlightenment
Remove old randr code from dialog creation.
Signed-off-by: Christopher Michael <cp.michael@samsung.com> SVN revision: 84115
This commit is contained in:
parent
7dd5880922
commit
d874b1ed9c
|
@ -1,7 +1,6 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
#include "e_int_config_randr.h"
|
||||
#include "e_smart_randr.h"
|
||||
|
||||
/* local structures */
|
||||
struct _E_Config_Dialog_Data
|
||||
|
@ -14,7 +13,6 @@ static void *_create_data(E_Config_Dialog *cfd EINA_UNUSED);
|
|||
static void _free_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata);
|
||||
static Evas_Object *_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
|
||||
static int _basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata);
|
||||
static void _randr_cb_changed(void *data, Evas_Object *obj, void *event EINA_UNUSED);
|
||||
|
||||
/* public functions */
|
||||
E_Config_Dialog *
|
||||
|
@ -71,10 +69,6 @@ _free_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
|
|||
/* if we have the randr smart widget, delete it */
|
||||
if (cfdata->o_randr)
|
||||
{
|
||||
/* delete the hook into randr widget changed signal */
|
||||
evas_object_smart_callback_del(cfdata->o_randr, "changed",
|
||||
_randr_cb_changed);
|
||||
|
||||
/* delete the randr object */
|
||||
evas_object_del(cfdata->o_randr);
|
||||
}
|
||||
|
@ -86,72 +80,16 @@ _free_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
|
|||
static Evas_Object *
|
||||
_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
Evas_Object *o;
|
||||
Evas_Coord cw = 0, ch = 0;
|
||||
|
||||
/* create the base list widget */
|
||||
o = e_widget_list_add(evas, 0, 0);
|
||||
|
||||
/* try to create randr smart widget */
|
||||
if ((cfdata->o_randr = e_smart_randr_add(evas)))
|
||||
{
|
||||
Evas_Coord lw = 0, lh = 0;
|
||||
|
||||
/* ask randr widget to compute best layout size based on the
|
||||
* size of available crtcs */
|
||||
e_smart_randr_layout_size_get(cfdata->o_randr, &lw, &lh);
|
||||
|
||||
/* calculate virtual size
|
||||
*
|
||||
* NB: Get which size is larger. This is done so that the
|
||||
* virtual canvas size can be set such that monitors may be
|
||||
* repositioned easily in a horizontal or vertical layout.
|
||||
* Without using MAX (and just using current size) than a
|
||||
* horizontal layout cannot be changed into a vertical layout */
|
||||
cw = MAX(lw, lh);
|
||||
ch = MAX(lw, lh);
|
||||
|
||||
/* set the virtual size for the randr widget */
|
||||
e_smart_randr_current_size_set(cfdata->o_randr, cw, ch);
|
||||
|
||||
/* tell randr widget to create monitors */
|
||||
e_smart_randr_monitors_create(cfdata->o_randr);
|
||||
|
||||
/* hook into randr widget changed signal */
|
||||
evas_object_smart_callback_add(cfdata->o_randr, "changed",
|
||||
_randr_cb_changed, cfd);
|
||||
|
||||
/* add randr widget to the base widget */
|
||||
e_widget_list_object_append(o, cfdata->o_randr, 1, 1, 0.5);
|
||||
}
|
||||
|
||||
/* set a minimum size to 1/10th */
|
||||
e_widget_size_min_set(o, (cw / 10), (ch / 10));
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
static int
|
||||
_basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
/* tell randr widget to apply changes */
|
||||
e_smart_randr_changes_apply(cfdata->o_randr);
|
||||
|
||||
/* return success */
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
_randr_cb_changed(void *data, Evas_Object *obj, void *event EINA_UNUSED)
|
||||
{
|
||||
E_Config_Dialog *cfd;
|
||||
Eina_Bool changed = EINA_FALSE;
|
||||
|
||||
if (!(cfd = data)) return;
|
||||
|
||||
/* get randr widget changed state */
|
||||
changed = e_smart_randr_changed_get(obj);
|
||||
|
||||
/* update dialog with changed state */
|
||||
e_config_dialog_changed_set(cfd, changed);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue