forked from enlightenment/efl
From: 이상진 <lsj119@samsung.com>
I am attaching another patches for transparent window. 1. Use RGB Visual. 2. Set destination_alpha in ecore_evas for alpha composite in evas. 3. add Function - Ecore_Evas_Engine_Func->fn_transparent_set - ecore_evas_transparent_set , ecore_evas_transparent_get - elm_win_transparent_set, elm_win_transparent_get SVN revision: 46106
This commit is contained in:
parent
fb8d1dc110
commit
7c9103f3ae
|
@ -285,6 +285,8 @@ EAPI void ecore_evas_shaped_set(Ecore_Evas *ee, int shaped);
|
|||
EAPI int ecore_evas_shaped_get(const Ecore_Evas *ee);
|
||||
EAPI void ecore_evas_alpha_set(Ecore_Evas *ee, int alpha);
|
||||
EAPI int ecore_evas_alpha_get(const Ecore_Evas *ee);
|
||||
EAPI void ecore_evas_transparent_set(Ecore_Evas *ee, int transparent);
|
||||
EAPI int ecore_evas_transparent_get(const Ecore_Evas *ee);
|
||||
EAPI void ecore_evas_show(Ecore_Evas *ee);
|
||||
EAPI void ecore_evas_hide(Ecore_Evas *ee);
|
||||
EAPI int ecore_evas_visibility_get(const Ecore_Evas *ee);
|
||||
|
|
|
@ -1551,6 +1551,51 @@ ecore_evas_alpha_get(const Ecore_Evas *ee)
|
|||
return ee->alpha ? 1:0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether an Ecore_Evas has an transparent window or not.
|
||||
* @param ee The Ecore_Evas to shape
|
||||
* @param transparent 1 to enable the transparent window, 0 to disable it
|
||||
*
|
||||
* This function allows you to make an Ecore_Evas translucent using an
|
||||
* alpha channel. See ecore_evas_shaped_set() for details. The difference
|
||||
* between a shaped window and a window with an alpha channel is that an
|
||||
* alpha channel supports multiple levels of transpararency, as opposed to
|
||||
* the 1 bit transparency of a shaped window (a pixel is either opaque, or
|
||||
* it's transparent).
|
||||
*/
|
||||
EAPI void
|
||||
ecore_evas_transparent_set(Ecore_Evas *ee, int transparent)
|
||||
{
|
||||
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
|
||||
{
|
||||
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
|
||||
"ecore_evas_transparent_set");
|
||||
return;
|
||||
}
|
||||
IFC(ee, fn_transparent_set) (ee, transparent);
|
||||
IFE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether an Ecore_Evas has an alpha channel.
|
||||
* @param ee The Ecore_Evas to query.
|
||||
* @return 1 if ee has an alpha channel, 0 if it does not.
|
||||
*
|
||||
* This function returns 1 if @p ee has an alpha channel, and 0 if
|
||||
* it does not.
|
||||
*/
|
||||
EAPI int
|
||||
ecore_evas_transparent_get(const Ecore_Evas *ee)
|
||||
{
|
||||
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
|
||||
{
|
||||
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
|
||||
"ecore_evas_transparent_get");
|
||||
return 0;
|
||||
}
|
||||
return ee->transparent ? 1:0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show an Ecore_Evas' window
|
||||
* @param ee The Ecore_Evas to show.
|
||||
|
|
|
@ -471,6 +471,7 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
|
|||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, //transparent
|
||||
|
||||
NULL // render
|
||||
};
|
||||
|
|
|
@ -485,6 +485,7 @@ static Ecore_Evas_Engine_Func _ecore_directfb_engine_func =
|
|||
NULL, /* sticky */
|
||||
NULL, /* ignore events */
|
||||
NULL, /* alpha */
|
||||
NULL, //transparent
|
||||
|
||||
NULL // render
|
||||
};
|
||||
|
|
|
@ -562,6 +562,7 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
|
|||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, //transparent
|
||||
|
||||
NULL // render
|
||||
};
|
||||
|
|
|
@ -183,6 +183,7 @@ struct _Ecore_Evas_Engine_Func
|
|||
void (*fn_sticky_set) (Ecore_Evas *ee, int sticky);
|
||||
void (*fn_ignore_events_set) (Ecore_Evas *ee, int ignore);
|
||||
void (*fn_alpha_set) (Ecore_Evas *ee, int alpha);
|
||||
void (*fn_transparent_set) (Ecore_Evas *ee, int transparent);
|
||||
|
||||
int (*fn_render) (Ecore_Evas *ee);
|
||||
};
|
||||
|
@ -273,6 +274,7 @@ struct _Ecore_Evas
|
|||
Eina_Bool draw_ok : 1;
|
||||
Eina_Bool should_be_visible : 1;
|
||||
Eina_Bool alpha : 1;
|
||||
Eina_Bool transparent : 1;
|
||||
|
||||
Eina_Hash *data;
|
||||
|
||||
|
|
|
@ -340,6 +340,7 @@ static Ecore_Evas_Engine_Func _ecore_quartz_engine_func =
|
|||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, //transparent
|
||||
|
||||
NULL // render
|
||||
};
|
||||
|
|
|
@ -335,6 +335,7 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
|
|||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, //transparent
|
||||
|
||||
NULL // render
|
||||
};
|
||||
|
|
|
@ -850,6 +850,7 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
|
|||
NULL, /* _ecore_evas_x_sticky_set */
|
||||
NULL, /* _ecore_evas_x_ignore_events_set */
|
||||
NULL, /* _ecore_evas_x_alpha_set */
|
||||
NULL, //transparent
|
||||
|
||||
NULL // render
|
||||
};
|
||||
|
|
|
@ -720,6 +720,7 @@ static Ecore_Evas_Engine_Func _ecore_wince_engine_func =
|
|||
NULL, /* _ecore_evas_x_sticky_set */
|
||||
NULL, /* _ecore_evas_x_ignore_events_set */
|
||||
NULL, /* _ecore_evas_x_alpha_set */
|
||||
NULL, //transparent
|
||||
|
||||
NULL // render
|
||||
};
|
||||
|
|
|
@ -1795,6 +1795,27 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
|
|||
#endif /* BUILD_ECORE_EVAS_SOFTWARE_16_X11 */
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_ecore_evas_x_transparent_set(Ecore_Evas *ee, int transparent)
|
||||
{
|
||||
if (((ee->transparent) && (transparent)) ||
|
||||
((!ee->transparent) && (!transparent)))
|
||||
return;
|
||||
|
||||
if (!strcmp(ee->driver, "software_x11"))
|
||||
{
|
||||
Evas_Engine_Info_Software_X11 *einfo;
|
||||
|
||||
einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(ee->evas);
|
||||
if (!einfo) return;
|
||||
|
||||
ee->transparent = transparent;
|
||||
einfo->info.destination_alpha = transparent;
|
||||
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
|
||||
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
||||
}
|
||||
}
|
||||
#endif /* BUILD_ECORE_EVAS_X11 */
|
||||
|
||||
#ifdef BUILD_ECORE_EVAS_X11
|
||||
|
@ -2332,6 +2353,7 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func =
|
|||
_ecore_evas_x_sticky_set,
|
||||
_ecore_evas_x_ignore_events_set,
|
||||
_ecore_evas_x_alpha_set,
|
||||
_ecore_evas_x_transparent_set,
|
||||
|
||||
NULL // render
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue