2011-08-15 02:21:12 -07:00
|
|
|
/* Ask about compositing */
|
2012-11-30 06:38:34 -08:00
|
|
|
#include "e_wizard.h"
|
2016-03-11 11:58:19 -08:00
|
|
|
#include <Evas_GL.h>
|
2011-12-25 22:24:59 -08:00
|
|
|
|
2016-03-11 14:14:17 -08:00
|
|
|
static Eina_Bool do_gl = 0;
|
|
|
|
static Eina_Bool do_vsync = 0;
|
|
|
|
static Eina_Bool disable_effects = 0;
|
2011-08-15 02:21:12 -07:00
|
|
|
|
|
|
|
|
2016-03-11 14:14:17 -08:00
|
|
|
static void
|
|
|
|
check_add(Evas_Object *box, const char *txt, Eina_Bool *val)
|
|
|
|
{
|
|
|
|
Evas_Object *ck;
|
|
|
|
|
|
|
|
ck = elm_check_add(box);
|
|
|
|
evas_object_show(ck);
|
|
|
|
E_ALIGN(ck, 0, 0.5);
|
|
|
|
elm_object_text_set(ck, txt);
|
|
|
|
elm_check_state_pointer_set(ck, val);
|
|
|
|
elm_box_pack_end(box, ck);
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2016-03-11 14:14:17 -08:00
|
|
|
wizard_page_show(E_Wizard_Page *pg EINA_UNUSED)
|
2011-08-15 02:21:12 -07:00
|
|
|
{
|
2016-03-11 14:14:17 -08:00
|
|
|
Evas_Object *o, *of;
|
2013-08-20 07:07:44 -07:00
|
|
|
|
2013-01-10 05:55:41 -08:00
|
|
|
e_wizard_title_set(_("Compositing"));
|
2013-01-04 10:35:32 -08:00
|
|
|
|
2016-03-11 14:14:17 -08:00
|
|
|
of = elm_frame_add(e_comp->elm);
|
|
|
|
elm_object_text_set(of, _("Settings"));
|
2012-06-28 06:12:13 -07:00
|
|
|
|
2016-03-11 14:14:17 -08:00
|
|
|
o = elm_box_add(of);
|
|
|
|
elm_box_homogeneous_set(o, 1);
|
|
|
|
elm_object_content_set(of, o);
|
2016-03-11 11:58:19 -08:00
|
|
|
if (e_comp->gl)
|
2013-01-10 05:55:41 -08:00
|
|
|
{
|
2016-03-11 11:58:19 -08:00
|
|
|
Evas_GL *gl;
|
|
|
|
|
|
|
|
gl = evas_gl_new(e_comp->evas);
|
|
|
|
if (gl)
|
2013-01-10 05:55:41 -08:00
|
|
|
{
|
2016-03-11 11:58:19 -08:00
|
|
|
const char *str;
|
|
|
|
Evas_GL_API *glapi = evas_gl_api_get(gl);
|
|
|
|
str = (char*)glapi->glGetString(GL_RENDERER);
|
|
|
|
if (str && (!strcasestr(str, "llvmpipe")))
|
|
|
|
do_gl = do_vsync = 1;
|
|
|
|
evas_gl_free(gl);
|
2013-01-10 05:55:41 -08:00
|
|
|
}
|
2016-03-11 14:14:17 -08:00
|
|
|
check_add(o, _("Hardware Accelerated (OpenGL)"), &do_gl);
|
|
|
|
check_add(o, _("Tear-free Rendering (OpenGL only)"), &do_vsync);
|
2013-01-10 05:55:41 -08:00
|
|
|
}
|
2016-03-11 14:14:17 -08:00
|
|
|
check_add(o, _("Disable composite effects"), &disable_effects);
|
2012-06-28 06:12:13 -07:00
|
|
|
|
2011-08-15 02:21:12 -07:00
|
|
|
evas_object_show(of);
|
2016-03-11 14:14:17 -08:00
|
|
|
e_wizard_page_show(of);
|
2013-01-04 10:35:32 -08:00
|
|
|
|
2011-08-15 02:21:12 -07:00
|
|
|
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API int
|
2015-03-18 15:09:09 -07:00
|
|
|
wizard_page_hide(E_Wizard_Page *pg EINA_UNUSED)
|
2011-08-15 02:21:12 -07:00
|
|
|
{
|
2013-01-10 05:55:41 -08:00
|
|
|
E_Comp_Config *conf = NULL;
|
2013-01-04 10:35:32 -08:00
|
|
|
|
2013-01-10 05:55:41 -08:00
|
|
|
conf = e_comp_config_get();
|
2013-01-04 10:35:32 -08:00
|
|
|
if (do_gl)
|
|
|
|
{
|
2013-01-10 05:55:41 -08:00
|
|
|
conf->engine = E_COMP_ENGINE_GL;
|
|
|
|
conf->smooth_windows = 1;
|
|
|
|
conf->vsync = do_vsync;
|
2011-08-15 02:21:12 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-01-10 05:55:41 -08:00
|
|
|
conf->engine = E_COMP_ENGINE_SW;
|
|
|
|
conf->smooth_windows = 0;
|
|
|
|
conf->vsync = 0;
|
|
|
|
}
|
|
|
|
if (disable_effects)
|
|
|
|
{
|
2013-01-11 06:40:14 -08:00
|
|
|
conf->disable_screen_effects =
|
2013-01-10 05:55:41 -08:00
|
|
|
conf->match.disable_borders =
|
|
|
|
conf->match.disable_popups =
|
|
|
|
conf->match.disable_menus =
|
2014-06-16 09:18:32 -07:00
|
|
|
conf->match.disable_objects =
|
2013-01-10 05:55:41 -08:00
|
|
|
conf->match.disable_overrides = 1;
|
2013-01-04 10:35:32 -08:00
|
|
|
}
|
2012-06-28 06:12:13 -07:00
|
|
|
|
2013-01-10 05:55:41 -08:00
|
|
|
e_comp_internal_save();
|
2013-01-04 10:35:32 -08:00
|
|
|
|
2011-08-15 02:21:12 -07:00
|
|
|
return 1;
|
|
|
|
}
|