UTILX_TRACE ("[UTILX] utilx_set_system_notification_level... win = %x, level = %d\n", win, level);
int noti_level;
+ char *display = NULL;
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. NoOp\n");
+ return;
+ }
+
+ /* X11 specific */
if (dpy == NULL)
{
fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
Utilx_Notification_Level noti_level;
unsigned int level;
int ret;
+ char *display = NULL;
noti_level = UTILX_NOTIFICATION_LEVEL_LOW;
+ display = getenv("DISPLAY");
+
+ /* check if backend is WAYLAND or X11 */
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return UTILX_NOTIFICATION_LEVEL_LOW\n");
+ return noti_level;
+ }
+ /* X11 specific */
if (dpy == NULL)
{
fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
{
UTILX_TRACE ("[UTILX] utilx_indicator_set_visible_state... win = %x, show_state = %d\n", win, enable);
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. NoOp\n");
+ return;
+ }
+
+ /* X11 specific */
if (dpy == NULL)
{
fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
int ret;
Atom state;
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return 0\n");
+ return 0;
+ }
+ /* X11 specific */
if (dpy == NULL)
{
fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
int keycode = 0;
KeySym keysym;
errno = EINVAL;
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return 0\n");
+ return 0;
+ }
+ /* X11 specific */
if( NULL == disp )
{
fprintf(stderr, "[%s] Display is NULL\n", __FUNCTION__);
KeySym keysym;
int ret = -1;
errno = EINVAL;
+ char *display = NULL;
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return 0\n");
+ return 0;
+ }
+
+ /* X11 specific */
if( NULL == disp )
{
fprintf(stderr, "[%s] Display is NULL\n", __FUNCTION__);
unsigned char keymap[32];
static unsigned int masktable[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
Utilx_Key_Status status = UTILX_KEY_STATUS_UNKNOWN;
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return UTILX_KEY_STATUS_UNKNOWN\n");
+ return status;
+ }
+ /* X11 specific */
if( !strncmp(key_name, KEY_VOLUMEDOWN, LEN_KEY_VOLUMEDOWN) ||
!strncmp(key_name, KEY_VOLUMEUP, LEN_KEY_VOLUMEUP) ||
!strncmp(key_name, KEY_PAUSE, LEN_KEY_PAUSE) ||
API void utilx_set_window_effect_state(Display* dpy, Window win, int state)
{
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. NoOp\n");
+ return;
+ }
+
+ /* X11 specific */
if ( dpy == NULL )
{
fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
API int utilx_get_window_effect_state(Display* dpy, Window win)
{
int state = 0;
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return 0\n");
+ return 0;
+ }
+
+ /* X11 specific */
if( !_atom_comp_effect_state)
_atom_comp_effect_state = XInternAtom(dpy, "_NET_CM_WINDOW_EFFECT_ENABLE",False);
_utilx_get_window_property(dpy, win, _atom_comp_effect_state, XA_CARDINAL, (unsigned int *)&state, 1);
API void utilx_set_fake_launch_img(Display* dpy, Window win, char *file_name)
{
//UTILX_TRACE ("[UTILX] utilx_set_effect_state... win = %x, show_state = %d\n", win, enable);
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. NoOp\n");
+ return;
+ }
+ /* X11 specific */
if ( dpy == NULL )
{
fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
API void utilx_show_fake_effect( Display *dpy, Window win, char *fake_image_file )
{
XEvent xev;
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. NoOp\n");
+ return;
+ }
+ /* X11 specific */
_atom_comp_fake_launch = XInternAtom( dpy, "_E_COMP_FAKE_LAUNCH", False );
if( !_atom_comp_fake_launch )
SubstructureRedirectMask | SubstructureNotifyMask,
&xev );
XSync(dpy, 0 );
-
}
API void utilx_hide_fake_effect( Display *dpy, Window win)
{
XEvent xev;
+ char *display = NULL;
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. NoOp\n");
+ return;
+ }
+
+ /* X11 specific */
_atom_comp_fake_launch = XInternAtom( dpy, "_E_COMP_FAKE_LAUNCH", False );
if( !_atom_comp_fake_launch )
{
API void utilx_set_window_effect_style(Display* dpy, Window win, Utilx_Effect_Type type, Utilx_Effect_Style style)
{
Atom *window_effect_type_list = NULL;
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. NoOp\n");
+ return;
+ }
+
+ /* X11 specific */
if ( dpy == NULL )
{
fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
{
Atom *window_effect_type_list = NULL;
Utilx_Effect_Style style = UTILX_EFFECT_STYLE_DEFAULT;
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return UTILX_EFFECT_STYLE_DEFAULT\n");
+ return style;
+ }
+
+ /* X11 specific */
if ( dpy == NULL )
{
fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
UTILX_TRACE ("[UTILX] utilx_set_window_opaque_state... win = %x, show_state = %d\n", win, state);
unsigned int is_opaque;
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return 1\n");
+ return 1;
+ }
+
+ /* X11 specific */
if (dpy == NULL)
{
fprintf (stderr, "[UTILX] Error.. Invald Display.. %s (%d)\n", __func__, __LINE__);
{
Window root;
int disable;
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return 1\n");
+ return 1;
+ }
+
+ /* X11 specific */
if (!dpy)
{
fprintf (stderr, "[UTILX] Error.. dpy is NULL %s (%d)\n", __func__, __LINE__);
{
Window root;
int disable = 0;
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return 0\n");
+ return 0;
+ }
+
+ /* X11 specific */
if (!dpy)
{
fprintf (stderr, "[UTILX] Error.. dpy is NULL %s (%d)\n", __func__, __LINE__);
API void utilx_set_window_cardinal_property(Display* dpy, Window win, Atom atom, unsigned int *value)
{
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. NoOp\n");
+ return;
+ }
+
+ /* X11 specific */
_utilx_set_window_property(dpy, win, atom, XA_CARDINAL, value, 1);
}
API int utilx_get_window_cardinal_property (Display* dpy, Window win, Atom atom, unsigned int *value)
{
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return -1\n");
+ return -1;
+ }
+
+ /* X11 specific */
return _utilx_get_window_property(dpy, win, atom, XA_CARDINAL, value, 1);
}
API void utilx_show_capture_effect( Display *dpy, Window win)
{
XEvent xev;
+ char *display = NULL;
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. NoOp\n");
+ return;
+ }
+
+ /* X11 specific */
_atom_comp_capture_effect = XInternAtom( dpy, "_E_COMP_CAPTURE_EFFECT", False );
if( !_atom_comp_capture_effect )
{
API UtilxScrnConf *utilx_scrnconf_allocate (void)
{
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return NULL\n");
+ return NULL;
+ }
+
+ /* X11 specific */
UtilxScrnConf *scrnconf = calloc (1, sizeof(UtilxScrnConf));
if (!scrnconf)
{
char **list = NULL;
int i = 0;
int s;
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. NoOp\n");
+ return NULL;
+ }
+ /* X11 specific */
scrnconf_atom = XInternAtom (dpy, "_SCRNCONF_INFO", False);
/* get property */
XEvent xev;
Atom scrnconf_atom = None;
UtilxScrnConf *scrnconf = NULL;
+ char *display = NULL;
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return 0\n");
+ return 0;
+ }
+
+ /* X11 specific */
scrnconf = utilx_scrnconf_allocate ();
if (!scrnconf)
return 0;
{
ShotInfo *info;
XEvent ev;
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. return NULL\n");
+ return NULL;
+ }
+ /* X11 specific */
if (dpy <= 0)
{
fprintf (stderr, "[UTILX] invalid display(%p) \n", dpy);
API void
utilx_release_screen_shot (void)
{
+ char *display = NULL;
+
+ display = getenv("DISPLAY");
+
+ if (!display)
+ {
+ /* WAYLAND specific */
+ //fprintf(stdout, "[UTILX] %s\n", __func__);
+ //fprintf(stdout, "[UTILX] Running in wayland.. NoOp\n");
+ return;
+ }
+
+ /* X11 specific */
_deinit_screen_shot (shot_info);
}