aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore_x/xlib
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/ecore/src/lib/ecore_x/xlib')
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c497
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c16
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_composite.c32
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_cursor.c24
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_damage.c7
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c116
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_dpms.c8
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c14
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c275
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_error.c20
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c682
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c49
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_gc.c140
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c421
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_image.c247
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c17
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c646
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_pixmap.c29
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h280
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr.c53
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr.h4
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c84
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c1086
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c408
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_13.c17
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_region.c29
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c12
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c325
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_sync.c24
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_test.c30
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_vsync.c182
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window.c517
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c256
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window_shape.c30
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c211
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xinerama.c26
36 files changed, 3632 insertions, 3182 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c
index 33c91cf21f..36606b90d0 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x.c
@@ -19,11 +19,12 @@
#include "Ecore_X_Atoms.h"
#include "Ecore_Input.h"
-static Eina_Bool _ecore_x_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
-static Eina_Bool _ecore_x_fd_handler_buf(void *data,
- Ecore_Fd_Handler *fd_handler);
-static int _ecore_x_key_mask_get(KeySym sym);
-static int _ecore_x_event_modifier(unsigned int state);
+static Eina_Bool _ecore_x_fd_handler(void *data,
+ Ecore_Fd_Handler *fd_handler);
+static Eina_Bool _ecore_x_fd_handler_buf(void *data,
+ Ecore_Fd_Handler *fd_handler);
+static int _ecore_x_key_mask_get(KeySym sym);
+static int _ecore_x_event_modifier(unsigned int state);
static Ecore_Fd_Handler *_ecore_x_fd_handler_handle = NULL;
@@ -127,8 +128,10 @@ EAPI int ECORE_X_LOCK_SHIFT = 0;
#ifdef LOGRT
static double t0 = 0.0;
-static Status (*_logrt_real_reply)(Display *disp, void *rep, int extra,
- Bool discard) = NULL;
+static Status (*_logrt_real_reply)(Display *disp,
+ void *rep,
+ int extra,
+ Bool discard) = NULL;
static void
_logrt_init(void)
{
@@ -136,20 +139,23 @@ _logrt_init(void)
lib = dlopen("libX11.so", RTLD_GLOBAL | RTLD_LAZY);
if (!lib)
- lib = dlopen("libX11.so.6", RTLD_GLOBAL | RTLD_LAZY);
+ lib = dlopen("libX11.so.6", RTLD_GLOBAL | RTLD_LAZY);
if (!lib)
- lib = dlopen("libX11.so.6.3", RTLD_GLOBAL | RTLD_LAZY);
+ lib = dlopen("libX11.so.6.3", RTLD_GLOBAL | RTLD_LAZY);
if (!lib)
- lib = dlopen("libX11.so.6.3.0", RTLD_GLOBAL | RTLD_LAZY);
+ lib = dlopen("libX11.so.6.3.0", RTLD_GLOBAL | RTLD_LAZY);
_logrt_real_reply = dlsym(lib, "_XReply");
t0 = ecore_time_get();
} /* _logrt_init */
Status
-_XReply(Display *disp, void *rep, int extra, Bool discard)
+_XReply(Display *disp,
+ void *rep,
+ int extra,
+ Bool discard)
{
void *bt[128];
int i, n;
@@ -177,13 +183,13 @@ _XReply(Display *disp, void *rep, int extra, Bool discard)
printf("%s", tsym);
}
else
- printf("???");
+ printf("???");
}
else
- printf("???");
+ printf("???");
if (i > 1)
- printf(" > ");
+ printf(" > ");
}
printf("\n");
}
@@ -199,35 +205,35 @@ void
_ecore_x_modifiers_get(void)
{
/* everything has these... unless its like a pda... :) */
- ECORE_X_MODIFIER_SHIFT = _ecore_x_key_mask_get(XK_Shift_L);
- ECORE_X_MODIFIER_CTRL = _ecore_x_key_mask_get(XK_Control_L);
+ ECORE_X_MODIFIER_SHIFT = _ecore_x_key_mask_get(XK_Shift_L);
+ ECORE_X_MODIFIER_CTRL = _ecore_x_key_mask_get(XK_Control_L);
- /* apple's xdarwin has no alt!!!! */
- ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Alt_L);
- if (!ECORE_X_MODIFIER_ALT)
+ /* apple's xdarwin has no alt!!!! */
+ ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Alt_L);
+ if (!ECORE_X_MODIFIER_ALT)
ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Meta_L);
-
- if (!ECORE_X_MODIFIER_ALT)
+
+ if (!ECORE_X_MODIFIER_ALT)
ECORE_X_MODIFIER_ALT = _ecore_x_key_mask_get(XK_Super_L);
-
- /* the windows key... a valid modifier :) */
- ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Super_L);
- if (!ECORE_X_MODIFIER_WIN)
+
+ /* the windows key... a valid modifier :) */
+ ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Super_L);
+ if (!ECORE_X_MODIFIER_WIN)
ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Mode_switch);
- if (!ECORE_X_MODIFIER_WIN)
+ if (!ECORE_X_MODIFIER_WIN)
ECORE_X_MODIFIER_WIN = _ecore_x_key_mask_get(XK_Meta_L);
- if (ECORE_X_MODIFIER_WIN == ECORE_X_MODIFIER_ALT)
+ if (ECORE_X_MODIFIER_WIN == ECORE_X_MODIFIER_ALT)
ECORE_X_MODIFIER_WIN = 0;
- if (ECORE_X_MODIFIER_ALT == ECORE_X_MODIFIER_CTRL)
+ if (ECORE_X_MODIFIER_ALT == ECORE_X_MODIFIER_CTRL)
ECORE_X_MODIFIER_ALT = 0;
- ECORE_X_LOCK_SCROLL = _ecore_x_key_mask_get(XK_Scroll_Lock);
- ECORE_X_LOCK_NUM = _ecore_x_key_mask_get(XK_Num_Lock);
- ECORE_X_LOCK_CAPS = _ecore_x_key_mask_get(XK_Caps_Lock);
- ECORE_X_LOCK_SHIFT = _ecore_x_key_mask_get(XK_Shift_Lock);
+ ECORE_X_LOCK_SCROLL = _ecore_x_key_mask_get(XK_Scroll_Lock);
+ ECORE_X_LOCK_NUM = _ecore_x_key_mask_get(XK_Num_Lock);
+ ECORE_X_LOCK_CAPS = _ecore_x_key_mask_get(XK_Caps_Lock);
+ ECORE_X_LOCK_SHIFT = _ecore_x_key_mask_get(XK_Shift_Lock);
}
/**
@@ -270,7 +276,7 @@ ecore_x_init(const char *name)
#endif /* ifdef ECORE_XDAMAGE */
if (++_ecore_x_init_count != 1)
- return _ecore_x_init_count;
+ return _ecore_x_init_count;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
#ifdef LOGRT
@@ -279,44 +285,44 @@ ecore_x_init(const char *name)
eina_init();
_ecore_xlib_log_dom = eina_log_domain_register
- ("ecore_x", ECORE_XLIB_DEFAULT_LOG_COLOR);
+ ("ecore_x", ECORE_XLIB_DEFAULT_LOG_COLOR);
if(_ecore_xlib_log_dom < 0)
{
EINA_LOG_ERR(
- "Impossible to create a log domain for the Ecore Xlib module.");
+ "Impossible to create a log domain for the Ecore Xlib module.");
return --_ecore_x_init_count;
}
if (!ecore_init())
- goto shutdown_eina;
+ goto shutdown_eina;
if (!ecore_event_init())
- goto shutdown_ecore;
+ goto shutdown_ecore;
#ifdef EVAS_FRAME_QUEUING
XInitThreads();
#endif /* ifdef EVAS_FRAME_QUEUING */
_ecore_x_disp = XOpenDisplay((char *)name);
if (!_ecore_x_disp)
- goto shutdown_ecore_event;
+ goto shutdown_ecore_event;
_ecore_x_error_handler_init();
_ecore_x_event_handlers_num = LASTEvent;
-#define ECORE_X_EVENT_HANDLERS_GROW(ext_base, ext_num_events)\
- do {\
- if (_ecore_x_event_handlers_num < (ext_base + ext_num_events)) {\
- _ecore_x_event_handlers_num = (ext_base + ext_num_events); }\
- } while (0)
+#define ECORE_X_EVENT_HANDLERS_GROW(ext_base, ext_num_events) \
+ do { \
+ if (_ecore_x_event_handlers_num < (ext_base + ext_num_events)) { \
+ _ecore_x_event_handlers_num = (ext_base + ext_num_events); } \
+ } while (0)
if (XShapeQueryExtension(_ecore_x_disp, &shape_base, &shape_err_base))
- _ecore_x_event_shape_id = shape_base;
+ _ecore_x_event_shape_id = shape_base;
ECORE_X_EVENT_HANDLERS_GROW(shape_base, ShapeNumberEvents);
#ifdef ECORE_XSS
if (XScreenSaverQueryExtension(_ecore_x_disp, &screensaver_base,
&screensaver_err_base))
- _ecore_x_event_screensaver_id = screensaver_base;
+ _ecore_x_event_screensaver_id = screensaver_base;
ECORE_X_EVENT_HANDLERS_GROW(screensaver_base, ScreenSaverNumberEvents);
#endif /* ifdef ECORE_XSS */
@@ -327,35 +333,35 @@ ecore_x_init(const char *name)
_ecore_x_event_sync_id = sync_base;
if (!XSyncInitialize(_ecore_x_disp, &major, &minor))
- _ecore_x_event_sync_id = 0;
+ _ecore_x_event_sync_id = 0;
}
ECORE_X_EVENT_HANDLERS_GROW(sync_base, XSyncNumberEvents);
#ifdef ECORE_XRANDR
if (XRRQueryExtension(_ecore_x_disp, &randr_base, &randr_err_base))
- _ecore_x_event_randr_id = randr_base;
+ _ecore_x_event_randr_id = randr_base;
ECORE_X_EVENT_HANDLERS_GROW(randr_base, RRNumberEvents);
#endif /* ifdef ECORE_XRANDR */
#ifdef ECORE_XFIXES
if (XFixesQueryExtension(_ecore_x_disp, &fixes_base, &fixes_err_base))
- _ecore_x_event_fixes_selection_id = fixes_base;
+ _ecore_x_event_fixes_selection_id = fixes_base;
ECORE_X_EVENT_HANDLERS_GROW(fixes_base, XFixesNumberEvents);
#endif /* ifdef ECORE_XFIXES */
#ifdef ECORE_XDAMAGE
if (XDamageQueryExtension(_ecore_x_disp, &damage_base, &damage_err_base))
- _ecore_x_event_damage_id = damage_base;
+ _ecore_x_event_damage_id = damage_base;
ECORE_X_EVENT_HANDLERS_GROW(damage_base, XDamageNumberEvents);
#endif /* ifdef ECORE_XDAMAGE */
_ecore_x_event_handlers = calloc(_ecore_x_event_handlers_num, sizeof(void *));
if (!_ecore_x_event_handlers)
- goto close_display;
+ goto close_display;
#ifdef ECORE_XCURSOR
_ecore_x_xcursor = XcursorSupportsARGB(_ecore_x_disp) ? EINA_TRUE : EINA_FALSE;
@@ -365,7 +371,7 @@ ecore_x_init(const char *name)
_ecore_x_event_handlers[KeyRelease] = _ecore_x_event_handle_key_release;
_ecore_x_event_handlers[ButtonPress] = _ecore_x_event_handle_button_press;
_ecore_x_event_handlers[ButtonRelease] =
- _ecore_x_event_handle_button_release;
+ _ecore_x_event_handle_button_release;
_ecore_x_event_handlers[MotionNotify] = _ecore_x_event_handle_motion_notify;
_ecore_x_event_handlers[EnterNotify] = _ecore_x_event_handle_enter_notify;
_ecore_x_event_handlers[LeaveNotify] = _ecore_x_event_handle_leave_notify;
@@ -374,61 +380,61 @@ ecore_x_init(const char *name)
_ecore_x_event_handlers[KeymapNotify] = _ecore_x_event_handle_keymap_notify;
_ecore_x_event_handlers[Expose] = _ecore_x_event_handle_expose;
_ecore_x_event_handlers[GraphicsExpose] =
- _ecore_x_event_handle_graphics_expose;
+ _ecore_x_event_handle_graphics_expose;
_ecore_x_event_handlers[VisibilityNotify] =
- _ecore_x_event_handle_visibility_notify;
+ _ecore_x_event_handle_visibility_notify;
_ecore_x_event_handlers[CreateNotify] = _ecore_x_event_handle_create_notify;
_ecore_x_event_handlers[DestroyNotify] =
- _ecore_x_event_handle_destroy_notify;
+ _ecore_x_event_handle_destroy_notify;
_ecore_x_event_handlers[UnmapNotify] = _ecore_x_event_handle_unmap_notify;
_ecore_x_event_handlers[MapNotify] = _ecore_x_event_handle_map_notify;
_ecore_x_event_handlers[MapRequest] = _ecore_x_event_handle_map_request;
_ecore_x_event_handlers[ReparentNotify] =
- _ecore_x_event_handle_reparent_notify;
+ _ecore_x_event_handle_reparent_notify;
_ecore_x_event_handlers[ConfigureNotify] =
- _ecore_x_event_handle_configure_notify;
+ _ecore_x_event_handle_configure_notify;
_ecore_x_event_handlers[ConfigureRequest] =
- _ecore_x_event_handle_configure_request;
+ _ecore_x_event_handle_configure_request;
_ecore_x_event_handlers[GravityNotify] =
- _ecore_x_event_handle_gravity_notify;
+ _ecore_x_event_handle_gravity_notify;
_ecore_x_event_handlers[ResizeRequest] =
- _ecore_x_event_handle_resize_request;
+ _ecore_x_event_handle_resize_request;
_ecore_x_event_handlers[CirculateNotify] =
- _ecore_x_event_handle_circulate_notify;
+ _ecore_x_event_handle_circulate_notify;
_ecore_x_event_handlers[CirculateRequest] =
- _ecore_x_event_handle_circulate_request;
+ _ecore_x_event_handle_circulate_request;
_ecore_x_event_handlers[PropertyNotify] =
- _ecore_x_event_handle_property_notify;
+ _ecore_x_event_handle_property_notify;
_ecore_x_event_handlers[SelectionClear] =
- _ecore_x_event_handle_selection_clear;
+ _ecore_x_event_handle_selection_clear;
_ecore_x_event_handlers[SelectionRequest] =
- _ecore_x_event_handle_selection_request;
+ _ecore_x_event_handle_selection_request;
_ecore_x_event_handlers[SelectionNotify] =
- _ecore_x_event_handle_selection_notify;
+ _ecore_x_event_handle_selection_notify;
_ecore_x_event_handlers[ColormapNotify] =
- _ecore_x_event_handle_colormap_notify;
+ _ecore_x_event_handle_colormap_notify;
_ecore_x_event_handlers[ClientMessage] =
- _ecore_x_event_handle_client_message;
+ _ecore_x_event_handle_client_message;
_ecore_x_event_handlers[MappingNotify] =
- _ecore_x_event_handle_mapping_notify;
+ _ecore_x_event_handle_mapping_notify;
#ifdef GenericEvent
_ecore_x_event_handlers[GenericEvent] = _ecore_x_event_handle_generic_event;
#endif /* ifdef GenericEvent */
if (_ecore_x_event_shape_id)
- _ecore_x_event_handlers[_ecore_x_event_shape_id] =
- _ecore_x_event_handle_shape_change;
+ _ecore_x_event_handlers[_ecore_x_event_shape_id] =
+ _ecore_x_event_handle_shape_change;
if (_ecore_x_event_screensaver_id)
- _ecore_x_event_handlers[_ecore_x_event_screensaver_id] =
- _ecore_x_event_handle_screensaver_notify;
+ _ecore_x_event_handlers[_ecore_x_event_screensaver_id] =
+ _ecore_x_event_handle_screensaver_notify;
if (_ecore_x_event_sync_id)
{
_ecore_x_event_handlers[_ecore_x_event_sync_id + XSyncCounterNotify] =
- _ecore_x_event_handle_sync_counter;
+ _ecore_x_event_handle_sync_counter;
_ecore_x_event_handlers[_ecore_x_event_sync_id + XSyncAlarmNotify] =
- _ecore_x_event_handle_sync_alarm;
+ _ecore_x_event_handle_sync_alarm;
}
#ifdef ECORE_XRANDR
@@ -436,7 +442,7 @@ ecore_x_init(const char *name)
{
_ecore_x_event_handlers[_ecore_x_event_randr_id +
RRScreenChangeNotify] =
- _ecore_x_event_handle_randr_change;
+ _ecore_x_event_handle_randr_change;
_ecore_x_event_handlers[_ecore_x_event_randr_id +
RRNotify] = _ecore_x_event_handle_randr_notify;
}
@@ -444,14 +450,14 @@ ecore_x_init(const char *name)
#endif /* ifdef ECORE_XRANDR */
#ifdef ECORE_XFIXES
if (_ecore_x_event_fixes_selection_id)
- _ecore_x_event_handlers[_ecore_x_event_fixes_selection_id] =
- _ecore_x_event_handle_fixes_selection_notify;
+ _ecore_x_event_handlers[_ecore_x_event_fixes_selection_id] =
+ _ecore_x_event_handle_fixes_selection_notify;
#endif /* ifdef ECORE_XFIXES */
#ifdef ECORE_XDAMAGE
if (_ecore_x_event_damage_id)
- _ecore_x_event_handlers[_ecore_x_event_damage_id] =
- _ecore_x_event_handle_damage_notify;
+ _ecore_x_event_handlers[_ecore_x_event_damage_id] =
+ _ecore_x_event_handle_damage_notify;
#endif /* ifdef ECORE_XDAMAGE */
#ifdef ECORE_XKB
@@ -525,12 +531,12 @@ ecore_x_init(const char *name)
_ecore_x_modifiers_get();
_ecore_x_fd_handler_handle =
- ecore_main_fd_handler_add(ConnectionNumber(_ecore_x_disp),
- ECORE_FD_READ,
- _ecore_x_fd_handler, _ecore_x_disp,
- _ecore_x_fd_handler_buf, _ecore_x_disp);
+ ecore_main_fd_handler_add(ConnectionNumber(_ecore_x_disp),
+ ECORE_FD_READ,
+ _ecore_x_fd_handler, _ecore_x_disp,
+ _ecore_x_fd_handler_buf, _ecore_x_disp);
if (!_ecore_x_fd_handler_handle)
- goto free_event_handlers;
+ goto free_event_handlers;
_ecore_x_atoms_init();
@@ -546,13 +552,13 @@ ecore_x_init(const char *name)
/* This is just to be anal about naming conventions */
_ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_DELETE_REQUEST] =
- ECORE_X_ATOM_WM_DELETE_WINDOW;
+ ECORE_X_ATOM_WM_DELETE_WINDOW;
_ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_TAKE_FOCUS] =
- ECORE_X_ATOM_WM_TAKE_FOCUS;
+ ECORE_X_ATOM_WM_TAKE_FOCUS;
_ecore_x_atoms_wm_protocols[ECORE_X_NET_WM_PROTOCOL_PING] =
- ECORE_X_ATOM_NET_WM_PING;
+ ECORE_X_ATOM_NET_WM_PING;
_ecore_x_atoms_wm_protocols[ECORE_X_NET_WM_PROTOCOL_SYNC_REQUEST] =
- ECORE_X_ATOM_NET_WM_SYNC_REQUEST;
+ ECORE_X_ATOM_NET_WM_SYNC_REQUEST;
_ecore_x_selection_data_init();
_ecore_x_dnd_init();
@@ -591,16 +597,16 @@ static int
_ecore_x_shutdown(int close_display)
{
if (--_ecore_x_init_count != 0)
- return _ecore_x_init_count;
+ return _ecore_x_init_count;
if (!_ecore_x_disp)
- return _ecore_x_init_count;
+ return _ecore_x_init_count;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_main_fd_handler_del(_ecore_x_fd_handler_handle);
if (close_display)
- XCloseDisplay(_ecore_x_disp);
+ XCloseDisplay(_ecore_x_disp);
else
{
close(ConnectionNumber(_ecore_x_disp));
@@ -710,7 +716,9 @@ ecore_x_default_screen_get(void)
* @since 1.1
*/
EAPI void
-ecore_x_screen_size_get(const Ecore_X_Screen *screen, int *w, int *h)
+ecore_x_screen_size_get(const Ecore_X_Screen *screen,
+ int *w,
+ int *h)
{
Screen *s = (Screen *)screen;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -723,14 +731,14 @@ ecore_x_screen_size_get(const Ecore_X_Screen *screen, int *w, int *h)
/**
* Retrieves the number of screens.
- *
+ *
* @return The count of the number of screens.
* @ingroup Ecore_X_Display_Attr_Group
*
* @since 1.1
*/
-EAPI int
-ecore_x_screen_count_get(void)
+EAPI int
+ecore_x_screen_count_get(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -739,28 +747,28 @@ ecore_x_screen_count_get(void)
/**
* Retrieves the index number of the given screen.
- *
+ *
* @return The index number of the screen.
* @ingroup Ecore_X_Display_Attr_Group
*
* @since 1.1
*/
-EAPI int
-ecore_x_screen_index_get(const Ecore_X_Screen *screen)
+EAPI int
+ecore_x_screen_index_get(const Ecore_X_Screen *screen)
{
return XScreenNumberOfScreen((Screen *)screen);
}
/**
* Retrieves the screen based on index number.
- *
+ *
* @return The Ecore_X_Screen at this index.
* @ingroup Ecore_X_Display_Attr_Group
*
* @since 1.1
*/
EAPI Ecore_X_Screen *
-ecore_x_screen_get(int idx)
+ecore_x_screen_get(int idx)
{
return XScreenOfDisplay(_ecore_x_disp, idx);
}
@@ -779,7 +787,7 @@ EAPI void
ecore_x_double_click_time_set(double t)
{
if (t < 0.0)
- t = 0.0;
+ t = 0.0;
_ecore_x_double_click_time = t;
} /* ecore_x_double_click_time_set */
@@ -904,7 +912,7 @@ ecore_x_dpi_get(void)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
s = DefaultScreenOfDisplay(_ecore_x_disp);
if (s->mwidth <= 0)
- return 75;
+ return 75;
return (((s->width * 254) / s->mwidth) + 5) / 10;
} /* ecore_x_dpi_get */
@@ -928,13 +936,14 @@ ecore_x_bell(int percent)
ret = XBell(_ecore_x_disp, percent);
if (ret == BadValue)
- return EINA_FALSE;
+ return EINA_FALSE;
return EINA_TRUE;
} /* ecore_x_bell */
static Eina_Bool
-_ecore_x_fd_handler(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__)
+_ecore_x_fd_handler(void *data,
+ Ecore_Fd_Handler *fd_handler __UNUSED__)
{
Display *d;
@@ -948,30 +957,31 @@ _ecore_x_fd_handler(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__)
#ifdef ENABLE_XIM
/* Filter event for XIM */
if (XFilterEvent(&ev, ev.xkey.window))
- continue;
+ continue;
#endif /* ifdef ENABLE_XIM */
if ((ev.type >= 0) && (ev.type < _ecore_x_event_handlers_num))
{
if (_ecore_x_event_handlers[AnyXEvent])
- _ecore_x_event_handlers[AnyXEvent] (&ev);
+ _ecore_x_event_handlers[AnyXEvent] (&ev);
if (_ecore_x_event_handlers[ev.type])
- _ecore_x_event_handlers[ev.type] (&ev);
+ _ecore_x_event_handlers[ev.type] (&ev);
}
}
return ECORE_CALLBACK_RENEW;
} /* _ecore_x_fd_handler */
static Eina_Bool
-_ecore_x_fd_handler_buf(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__)
+_ecore_x_fd_handler_buf(void *data,
+ Ecore_Fd_Handler *fd_handler __UNUSED__)
{
Display *d;
d = data;
if (XPending(d))
- return ECORE_CALLBACK_RENEW;
+ return ECORE_CALLBACK_RENEW;
return ECORE_CALLBACK_CANCEL;
} /* _ecore_x_fd_handler_buf */
@@ -990,31 +1000,31 @@ _ecore_x_key_mask_get(KeySym sym)
mod = XGetModifierMapping(_ecore_x_disp);
if ((mod) && (mod->max_keypermod > 0))
- for (i = 0; i < (8 * mod->max_keypermod); i++)
- {
- for (j = 0; j < 8; j++)
- {
- sym2 = XKeycodeToKeysym(_ecore_x_disp, mod->modifiermap[i], j);
- if (sym2 != 0)
- break;
- }
- if (sym2 == sym)
- {
- int mask;
-
- mask = masks[i / mod->max_keypermod];
- if (mod->modifiermap)
- XFree(mod->modifiermap);
-
- XFree(mod);
- return mask;
- }
- }
+ for (i = 0; i < (8 * mod->max_keypermod); i++)
+ {
+ for (j = 0; j < 8; j++)
+ {
+ sym2 = XKeycodeToKeysym(_ecore_x_disp, mod->modifiermap[i], j);
+ if (sym2 != 0)
+ break;
+ }
+ if (sym2 == sym)
+ {
+ int mask;
+
+ mask = masks[i / mod->max_keypermod];
+ if (mod->modifiermap)
+ XFree(mod->modifiermap);
+
+ XFree(mod);
+ return mask;
+ }
+ }
if (mod)
{
if (mod->modifiermap)
- XFree(mod->modifiermap);
+ XFree(mod->modifiermap);
XFree(mod);
}
@@ -1046,7 +1056,7 @@ ecore_x_window_root_list(int *num_ret)
#endif /* ifdef ECORE_XPRINT */
if (!num_ret)
- return NULL;
+ return NULL;
*num_ret = 0;
@@ -1069,7 +1079,7 @@ ecore_x_window_root_list(int *num_ret)
for (j = 0; j < psnum; j++)
{
if (ScreenOfDisplay(_ecore_x_disp, i) == ps[j])
- overlap++;
+ overlap++;
}
}
roots = malloc((num - overlap) * sizeof(Window));
@@ -1106,33 +1116,33 @@ ecore_x_window_root_list(int *num_ret)
{
roots = malloc(num * sizeof(Window));
if (!roots)
- return NULL;
+ return NULL;
*num_ret = num;
for (i = 0; i < num; i++)
- roots[i] = RootWindow(_ecore_x_disp, i);
+ roots[i] = RootWindow(_ecore_x_disp, i);
}
}
else
{
roots = malloc(num * sizeof(Window));
if (!roots)
- return NULL;
+ return NULL;
*num_ret = num;
for (i = 0; i < num; i++)
- roots[i] = RootWindow(_ecore_x_disp, i);
+ roots[i] = RootWindow(_ecore_x_disp, i);
}
#else /* ifdef ECORE_XPRINT */
num = ScreenCount(_ecore_x_disp);
roots = malloc(num * sizeof(Window));
if (!roots)
- return NULL;
+ return NULL;
*num_ret = num;
for (i = 0; i < num; i++)
- roots[i] = RootWindow(_ecore_x_disp, i);
+ roots[i] = RootWindow(_ecore_x_disp, i);
#endif /* ifdef ECORE_XPRINT */
return roots;
} /* ecore_x_window_root_list */
@@ -1159,7 +1169,7 @@ ecore_x_window_root_first_get(void)
*/
} /* ecore_x_window_root_first_get */
-static void _ecore_x_window_manage_error(void *data);
+static void _ecore_x_window_manage_error(void *data);
static int _ecore_x_window_manage_failed = 0;
static void
@@ -1167,7 +1177,7 @@ _ecore_x_window_manage_error(void *data __UNUSED__)
{
if ((ecore_x_error_request_get() == X_ChangeWindowAttributes) &&
(ecore_x_error_code_get() == BadAccess))
- _ecore_x_window_manage_failed = 1;
+ _ecore_x_window_manage_failed = 1;
} /* _ecore_x_window_manage_error */
EAPI Eina_Bool
@@ -1177,7 +1187,7 @@ ecore_x_window_manage(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (XGetWindowAttributes(_ecore_x_disp, win, &att) != True)
- return EINA_FALSE;
+ return EINA_FALSE;
ecore_x_sync();
_ecore_x_window_manage_failed = 0;
@@ -1260,7 +1270,7 @@ ecore_x_window_attributes_get(Ecore_X_Window win,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!XGetWindowAttributes(_ecore_x_disp, win, &att))
- return EINA_FALSE;
+ return EINA_FALSE;
memset(att_ret, 0, sizeof(Ecore_X_Window_Attributes));
att_ret->root = att.root;
@@ -1271,19 +1281,19 @@ ecore_x_window_attributes_get(Ecore_X_Window win,
att_ret->border = att.border_width;
att_ret->depth = att.depth;
if (att.map_state != IsUnmapped)
- att_ret->visible = 1;
+ att_ret->visible = 1;
if (att.map_state == IsViewable)
- att_ret->viewable = 1;
+ att_ret->viewable = 1;
if (att.override_redirect)
- att_ret->override = 1;
+ att_ret->override = 1;
if (att.class == InputOnly)
- att_ret->input_only = 1;
+ att_ret->input_only = 1;
if (att.save_under)
- att_ret->save_under = 1;
+ att_ret->save_under = 1;
att_ret->event_mask.mine = att.your_event_mask;
att_ret->event_mask.all = att.all_event_masks;
@@ -1310,7 +1320,8 @@ ecore_x_window_save_set_del(Ecore_X_Window win)
} /* ecore_x_window_save_set_del */
EAPI Ecore_X_Window *
-ecore_x_window_children_get(Ecore_X_Window win, int *num)
+ecore_x_window_children_get(Ecore_X_Window win,
+ int *num)
{
Ecore_X_Window *windows = NULL;
Window root_ret = 0, parent_ret = 0, *children_ret = NULL;
@@ -1319,7 +1330,7 @@ ecore_x_window_children_get(Ecore_X_Window win, int *num)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!XQueryTree(_ecore_x_disp, win, &root_ret, &parent_ret, &children_ret,
&children_ret_num))
- return NULL;
+ return NULL;
if (children_ret)
{
@@ -1329,7 +1340,7 @@ ecore_x_window_children_get(Ecore_X_Window win, int *num)
unsigned int i;
for (i = 0; i < children_ret_num; i++)
- windows[i] = children_ret[i];
+ windows[i] = children_ret[i];
*num = children_ret_num;
}
@@ -1340,7 +1351,9 @@ ecore_x_window_children_get(Ecore_X_Window win, int *num)
} /* ecore_x_window_children_get */
EAPI Eina_Bool
-ecore_x_pointer_control_set(int accel_num, int accel_denom, int threshold)
+ecore_x_pointer_control_set(int accel_num,
+ int accel_denom,
+ int threshold)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return XChangePointerControl(_ecore_x_disp, 1, 1,
@@ -1348,7 +1361,9 @@ ecore_x_pointer_control_set(int accel_num, int accel_denom, int threshold)
} /* ecore_x_pointer_control_set */
EAPI Eina_Bool
-ecore_x_pointer_control_get(int *accel_num, int *accel_denom, int *threshold)
+ecore_x_pointer_control_get(int *accel_num,
+ int *accel_denom,
+ int *threshold)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return XGetPointerControl(_ecore_x_disp,
@@ -1356,14 +1371,16 @@ ecore_x_pointer_control_get(int *accel_num, int *accel_denom, int *threshold)
} /* ecore_x_pointer_control_get */
EAPI Eina_Bool
-ecore_x_pointer_mapping_set(unsigned char *map, int nmap)
+ecore_x_pointer_mapping_set(unsigned char *map,
+ int nmap)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return XSetPointerMapping(_ecore_x_disp, map, nmap) ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_pointer_mapping_set */
EAPI Eina_Bool
-ecore_x_pointer_mapping_get(unsigned char *map, int nmap)
+ecore_x_pointer_mapping_get(unsigned char *map,
+ int nmap)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return XGetPointerMapping(_ecore_x_disp, map, nmap) ? EINA_TRUE : EINA_FALSE;
@@ -1378,7 +1395,7 @@ ecore_x_pointer_grab(Ecore_X_Window win)
EnterWindowMask | LeaveWindowMask | PointerMotionMask,
GrabModeAsync, GrabModeAsync,
None, None, CurrentTime) == GrabSuccess)
- return EINA_TRUE;
+ return EINA_TRUE;
return EINA_FALSE;
} /* ecore_x_pointer_grab */
@@ -1392,7 +1409,7 @@ ecore_x_pointer_confine_grab(Ecore_X_Window win)
EnterWindowMask | LeaveWindowMask | PointerMotionMask,
GrabModeAsync, GrabModeAsync,
win, None, CurrentTime) == GrabSuccess)
- return EINA_TRUE;
+ return EINA_TRUE;
return EINA_FALSE;
} /* ecore_x_pointer_confine_grab */
@@ -1405,7 +1422,9 @@ ecore_x_pointer_ungrab(void)
} /* ecore_x_pointer_ungrab */
EAPI Eina_Bool
-ecore_x_pointer_warp(Ecore_X_Window win, int x, int y)
+ecore_x_pointer_warp(Ecore_X_Window win,
+ int x,
+ int y)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return XWarpPointer(_ecore_x_disp, None, win, 0, 0, 0, 0, x, y) ? EINA_TRUE : EINA_FALSE;
@@ -1418,7 +1437,7 @@ ecore_x_keyboard_grab(Ecore_X_Window win)
if (XGrabKeyboard(_ecore_x_disp, win, False,
GrabModeAsync, GrabModeAsync,
CurrentTime) == GrabSuccess)
- return EINA_TRUE;
+ return EINA_TRUE;
return EINA_FALSE;
} /* ecore_x_keyboard_grab */
@@ -1436,7 +1455,7 @@ ecore_x_grab(void)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
_ecore_x_grab_count++;
if (_ecore_x_grab_count == 1)
- XGrabServer(_ecore_x_disp);
+ XGrabServer(_ecore_x_disp);
} /* ecore_x_grab */
EAPI void
@@ -1445,22 +1464,24 @@ ecore_x_ungrab(void)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
_ecore_x_grab_count--;
if (_ecore_x_grab_count < 0)
- _ecore_x_grab_count = 0;
+ _ecore_x_grab_count = 0;
if (_ecore_x_grab_count == 0)
- XUngrabServer(_ecore_x_disp);
+ XUngrabServer(_ecore_x_disp);
} /* ecore_x_ungrab */
int _ecore_window_grabs_num = 0;
Window *_ecore_window_grabs = NULL;
-Eina_Bool (*_ecore_window_grab_replay_func)(void *data, int event_type,
+Eina_Bool (*_ecore_window_grab_replay_func)(void *data,
+ int event_type,
void *event);
void *_ecore_window_grab_replay_data;
EAPI void
-ecore_x_passive_grab_replay_func_set(Eina_Bool (*func)(void *data,
- int event_type,
- void *event), void *data)
+ecore_x_passive_grab_replay_func_set(Eina_Bool (*func)(void *data,
+ int event_type,
+ void *event),
+ void *data)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
_ecore_window_grab_replay_func = func;
@@ -1468,9 +1489,11 @@ ecore_x_passive_grab_replay_func_set(Eina_Bool (*func)(void *data,
} /* ecore_x_passive_grab_replay_func_set */
EAPI void
-ecore_x_window_button_grab(Ecore_X_Window win, int button,
+ecore_x_window_button_grab(Ecore_X_Window win,
+ int button,
Ecore_X_Event_Mask event_mask,
- int mod, int any_mod)
+ int mod,
+ int any_mod)
{
unsigned int b;
unsigned int m;
@@ -1481,11 +1504,11 @@ ecore_x_window_button_grab(Ecore_X_Window win, int button,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
b = button;
if (b == 0)
- b = AnyButton;
+ b = AnyButton;
m = _ecore_x_event_modifier(mod);
if (any_mod)
- m = AnyModifier;
+ m = AnyModifier;
locks[0] = 0;
locks[1] = ECORE_X_LOCK_CAPS;
@@ -1497,8 +1520,8 @@ ecore_x_window_button_grab(Ecore_X_Window win, int button,
locks[7] = ECORE_X_LOCK_CAPS | ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL;
ev = event_mask;
for (i = 0; i < 8; i++)
- XGrabButton(_ecore_x_disp, b, m | locks[i],
- win, False, ev, GrabModeSync, GrabModeAsync, None, None);
+ XGrabButton(_ecore_x_disp, b, m | locks[i],
+ win, False, ev, GrabModeSync, GrabModeAsync, None, None);
_ecore_window_grabs_num++;
t = realloc(_ecore_window_grabs,
_ecore_window_grabs_num * sizeof(Window));
@@ -1508,7 +1531,8 @@ ecore_x_window_button_grab(Ecore_X_Window win, int button,
} /* ecore_x_window_button_grab */
void
-_ecore_x_sync_magic_send(int val, Ecore_X_Window swin)
+_ecore_x_sync_magic_send(int val,
+ Ecore_X_Window swin)
{
XEvent xev;
@@ -1536,10 +1560,10 @@ _ecore_x_window_grab_remove(Ecore_X_Window win)
for (i = 0; i < _ecore_window_grabs_num; i++)
{
if (shuffle)
- _ecore_window_grabs[i - 1] = _ecore_window_grabs[i];
+ _ecore_window_grabs[i - 1] = _ecore_window_grabs[i];
if ((!shuffle) && (_ecore_window_grabs[i] == win))
- shuffle = 1;
+ shuffle = 1;
}
if (shuffle)
{
@@ -1560,8 +1584,10 @@ _ecore_x_window_grab_remove(Ecore_X_Window win)
} /* _ecore_x_window_grab_remove */
EAPI void
-ecore_x_window_button_ungrab(Ecore_X_Window win, int button,
- int mod, int any_mod)
+ecore_x_window_button_ungrab(Ecore_X_Window win,
+ int button,
+ int mod,
+ int any_mod)
{
unsigned int b;
unsigned int m;
@@ -1571,11 +1597,11 @@ ecore_x_window_button_ungrab(Ecore_X_Window win, int button,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
b = button;
if (b == 0)
- b = AnyButton;
+ b = AnyButton;
m = _ecore_x_event_modifier(mod);
if (any_mod)
- m = AnyModifier;
+ m = AnyModifier;
locks[0] = 0;
locks[1] = ECORE_X_LOCK_CAPS;
@@ -1586,7 +1612,7 @@ ecore_x_window_button_ungrab(Ecore_X_Window win, int button,
locks[6] = ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL;
locks[7] = ECORE_X_LOCK_CAPS | ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL;
for (i = 0; i < 8; i++)
- XUngrabButton(_ecore_x_disp, b, m | locks[i], win);
+ XUngrabButton(_ecore_x_disp, b, m | locks[i], win);
_ecore_x_sync_magic_send(1, win);
} /* ecore_x_window_button_ungrab */
@@ -1594,8 +1620,10 @@ int _ecore_key_grabs_num = 0;
Window *_ecore_key_grabs = NULL;
EAPI void
-ecore_x_window_key_grab(Ecore_X_Window win, const char *key,
- int mod, int any_mod)
+ecore_x_window_key_grab(Ecore_X_Window win,
+ const char *key,
+ int mod,
+ int any_mod)
{
KeyCode keycode = 0;
KeySym keysym;
@@ -1606,22 +1634,22 @@ ecore_x_window_key_grab(Ecore_X_Window win, const char *key,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!strncmp(key, "Keycode-", 8))
- keycode = atoi(key + 8);
+ keycode = atoi(key + 8);
else
{
keysym = XStringToKeysym(key);
if (keysym == NoSymbol)
- return;
+ return;
keycode = XKeysymToKeycode(_ecore_x_disp, XStringToKeysym(key));
}
if (keycode == 0)
- return;
+ return;
m = _ecore_x_event_modifier(mod);
if (any_mod)
- m = AnyModifier;
+ m = AnyModifier;
locks[0] = 0;
locks[1] = ECORE_X_LOCK_CAPS;
@@ -1632,8 +1660,8 @@ ecore_x_window_key_grab(Ecore_X_Window win, const char *key,
locks[6] = ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL;
locks[7] = ECORE_X_LOCK_CAPS | ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL;
for (i = 0; i < 8; i++)
- XGrabKey(_ecore_x_disp, keycode, m | locks[i],
- win, False, GrabModeSync, GrabModeAsync);
+ XGrabKey(_ecore_x_disp, keycode, m | locks[i],
+ win, False, GrabModeSync, GrabModeAsync);
_ecore_key_grabs_num++;
t = realloc(_ecore_key_grabs,
_ecore_key_grabs_num * sizeof(Window));
@@ -1653,10 +1681,10 @@ _ecore_x_key_grab_remove(Ecore_X_Window win)
for (i = 0; i < _ecore_key_grabs_num; i++)
{
if (shuffle)
- _ecore_key_grabs[i - 1] = _ecore_key_grabs[i];
+ _ecore_key_grabs[i - 1] = _ecore_key_grabs[i];
if ((!shuffle) && (_ecore_key_grabs[i] == win))
- shuffle = 1;
+ shuffle = 1;
}
if (shuffle)
{
@@ -1676,8 +1704,10 @@ _ecore_x_key_grab_remove(Ecore_X_Window win)
} /* _ecore_x_key_grab_remove */
EAPI void
-ecore_x_window_key_ungrab(Ecore_X_Window win, const char *key,
- int mod, int any_mod)
+ecore_x_window_key_ungrab(Ecore_X_Window win,
+ const char *key,
+ int mod,
+ int any_mod)
{
KeyCode keycode = 0;
KeySym keysym;
@@ -1687,22 +1717,22 @@ ecore_x_window_key_ungrab(Ecore_X_Window win, const char *key,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!strncmp(key, "Keycode-", 8))
- keycode = atoi(key + 8);
+ keycode = atoi(key + 8);
else
{
keysym = XStringToKeysym(key);
if (keysym == NoSymbol)
- return;
+ return;
keycode = XKeysymToKeycode(_ecore_x_disp, XStringToKeysym(key));
}
if (keycode == 0)
- return;
+ return;
m = _ecore_x_event_modifier(mod);
if (any_mod)
- m = AnyModifier;
+ m = AnyModifier;
locks[0] = 0;
locks[1] = ECORE_X_LOCK_CAPS;
@@ -1713,7 +1743,7 @@ ecore_x_window_key_ungrab(Ecore_X_Window win, const char *key,
locks[6] = ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL;
locks[7] = ECORE_X_LOCK_CAPS | ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL;
for (i = 0; i < 8; i++)
- XUngrabKey(_ecore_x_disp, keycode, m | locks[i], win);
+ XUngrabKey(_ecore_x_disp, keycode, m | locks[i], win);
_ecore_x_sync_magic_send(2, win);
} /* ecore_x_window_key_ungrab */
@@ -1731,9 +1761,14 @@ ecore_x_window_key_ungrab(Ecore_X_Window win, const char *key,
* @return EINA_TRUE on success EINA_FALSE otherwise.
*/
EAPI Eina_Bool
-ecore_x_client_message32_send(Ecore_X_Window win, Ecore_X_Atom type,
+ecore_x_client_message32_send(Ecore_X_Window win,
+ Ecore_X_Atom type,
Ecore_X_Event_Mask mask,
- long d0, long d1, long d2, long d3, long d4)
+ long d0,
+ long d1,
+ long d2,
+ long d3,
+ long d4)
{
XEvent xev;
@@ -1762,8 +1797,10 @@ ecore_x_client_message32_send(Ecore_X_Window win, Ecore_X_Atom type,
* @return EINA_TRUE on success EINA_FALSE otherwise.
*/
EAPI Eina_Bool
-ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_Atom type,
- const void *data, int len)
+ecore_x_client_message8_send(Ecore_X_Window win,
+ Ecore_X_Atom type,
+ const void *data,
+ int len)
{
XEvent xev;
@@ -1773,7 +1810,7 @@ ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_Atom type,
xev.xclient.message_type = type;
xev.xclient.format = 8;
if (len > 20)
- len = 20;
+ len = 20;
memcpy(xev.xclient.data.b, data, len);
memset(xev.xclient.data.b + len, 0, 20 - len);
@@ -1782,7 +1819,9 @@ ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_Atom type,
} /* ecore_x_client_message8_send */
EAPI Eina_Bool
-ecore_x_mouse_move_send(Ecore_X_Window win, int x, int y)
+ecore_x_mouse_move_send(Ecore_X_Window win,
+ int x,
+ int y)
{
XEvent xev;
XWindowAttributes att;
@@ -1808,7 +1847,10 @@ ecore_x_mouse_move_send(Ecore_X_Window win, int x, int y)
} /* ecore_x_mouse_move_send */
EAPI Eina_Bool
-ecore_x_mouse_down_send(Ecore_X_Window win, int x, int y, int b)
+ecore_x_mouse_down_send(Ecore_X_Window win,
+ int x,
+ int y,
+ int b)
{
XEvent xev;
XWindowAttributes att;
@@ -1834,7 +1876,10 @@ ecore_x_mouse_down_send(Ecore_X_Window win, int x, int y, int b)
} /* ecore_x_mouse_down_send */
EAPI Eina_Bool
-ecore_x_mouse_up_send(Ecore_X_Window win, int x, int y, int b)
+ecore_x_mouse_up_send(Ecore_X_Window win,
+ int x,
+ int y,
+ int b)
{
XEvent xev;
XWindowAttributes att;
@@ -1874,7 +1919,8 @@ ecore_x_events_allow_all(void)
} /* ecore_x_events_allow_all */
EAPI void
-ecore_x_pointer_last_xy_get(int *x, int *y)
+ecore_x_pointer_last_xy_get(int *x,
+ int *y)
{
if (x)
*x = _ecore_x_event_last_root_x;
@@ -1884,14 +1930,16 @@ ecore_x_pointer_last_xy_get(int *x, int *y)
} /* ecore_x_pointer_last_xy_get */
EAPI void
-ecore_x_pointer_xy_get(Ecore_X_Window win, int *x, int *y)
+ecore_x_pointer_xy_get(Ecore_X_Window win,
+ int *x,
+ int *y)
{
Window rwin, cwin;
int rx, ry, wx, wy, ret;
unsigned int mask;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ret = XQueryPointer(_ecore_x_disp, win, &rwin, &cwin,
+ ret = XQueryPointer(_ecore_x_disp, win, &rwin, &cwin,
&rx, &ry, &wx, &wy, &mask);
if (!ret)
wx = wy = -1;
@@ -1908,8 +1956,8 @@ ecore_x_pointer_xy_get(Ecore_X_Window win, int *x, int *y)
* @return The visual id.
* @since 1.1.0
*/
-EAPI unsigned int
-ecore_x_visual_id_get(Ecore_X_Visual visual)
+EAPI unsigned int
+ecore_x_visual_id_get(Ecore_X_Visual visual)
{
return XVisualIDFromVisual(visual);
}
@@ -1923,8 +1971,9 @@ ecore_x_visual_id_get(Ecore_X_Visual visual)
* @return The default visual.
* @since 1.1.0
*/
-EAPI Ecore_X_Visual
-ecore_x_default_visual_get(Ecore_X_Display *disp, Ecore_X_Screen *screen)
+EAPI Ecore_X_Visual
+ecore_x_default_visual_get(Ecore_X_Display *disp,
+ Ecore_X_Screen *screen)
{
return DefaultVisual(disp, ecore_x_screen_index_get(screen));
}
@@ -1938,8 +1987,9 @@ ecore_x_default_visual_get(Ecore_X_Display *disp, Ecore_X_Screen *screen)
* @return The default colormap.
* @since 1.1.0
*/
-EAPI Ecore_X_Colormap
-ecore_x_default_colormap_get(Ecore_X_Display *disp, Ecore_X_Screen *screen)
+EAPI Ecore_X_Colormap
+ecore_x_default_colormap_get(Ecore_X_Display *disp,
+ Ecore_X_Screen *screen)
{
return DefaultColormap(disp, ecore_x_screen_index_get(screen));
}
@@ -1953,8 +2003,9 @@ ecore_x_default_colormap_get(Ecore_X_Display *disp, Ecore_X_Screen *screen)
* @return The default depth.
* @since 1.1.0
*/
-EAPI int
-ecore_x_default_depth_get(Ecore_X_Display *disp, Ecore_X_Screen *screen)
+EAPI int
+ecore_x_default_depth_get(Ecore_X_Display *disp,
+ Ecore_X_Screen *screen)
{
return DefaultDepth(disp, ecore_x_screen_index_get(screen));
}
@@ -1969,28 +2020,28 @@ _ecore_x_event_modifier(unsigned int state)
int xmodifiers = 0;
if (state & ECORE_EVENT_MODIFIER_SHIFT)
- xmodifiers |= ECORE_X_MODIFIER_SHIFT;
+ xmodifiers |= ECORE_X_MODIFIER_SHIFT;
if (state & ECORE_EVENT_MODIFIER_CTRL)
- xmodifiers |= ECORE_X_MODIFIER_CTRL;
+ xmodifiers |= ECORE_X_MODIFIER_CTRL;
if (state & ECORE_EVENT_MODIFIER_ALT)
- xmodifiers |= ECORE_X_MODIFIER_ALT;
+ xmodifiers |= ECORE_X_MODIFIER_ALT;
if (state & ECORE_EVENT_MODIFIER_WIN)
- xmodifiers |= ECORE_X_MODIFIER_WIN;
+ xmodifiers |= ECORE_X_MODIFIER_WIN;
if (state & ECORE_EVENT_LOCK_SCROLL)
- xmodifiers |= ECORE_X_LOCK_SCROLL;
+ xmodifiers |= ECORE_X_LOCK_SCROLL;
if (state & ECORE_EVENT_LOCK_NUM)
- xmodifiers |= ECORE_X_LOCK_NUM;
+ xmodifiers |= ECORE_X_LOCK_NUM;
if (state & ECORE_EVENT_LOCK_CAPS)
- xmodifiers |= ECORE_X_LOCK_CAPS;
+ xmodifiers |= ECORE_X_LOCK_CAPS;
if (state & ECORE_EVENT_LOCK_SHIFT)
- xmodifiers |= ECORE_X_LOCK_SHIFT;
+ xmodifiers |= ECORE_X_LOCK_SHIFT;
return xmodifiers;
} /* _ecore_x_event_modifier */
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c
index 09071dba79..fd96d5c2e6 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_atoms.c
@@ -16,7 +16,7 @@
# ifdef __cplusplus
extern "C"
# endif /* ifdef __cplusplus */
-void * alloca (size_t);
+void *alloca(size_t);
#endif /* ifdef HAVE_ALLOCA_H */
#include <string.h>
@@ -305,26 +305,28 @@ EAPI Ecore_X_Atom
ecore_x_atom_get(const char *name)
{
if (!_ecore_x_disp)
- return 0;
+ return 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return XInternAtom(_ecore_x_disp, name, False);
} /* ecore_x_atom_get */
EAPI void
-ecore_x_atoms_get(const char **names, int num, Ecore_X_Atom *atoms)
+ecore_x_atoms_get(const char **names,
+ int num,
+ Ecore_X_Atom *atoms)
{
Atom *atoms_int;
int i;
if (!_ecore_x_disp)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
atoms_int = alloca(num * sizeof(Atom));
XInternAtoms(_ecore_x_disp, (char **)names, num, False, atoms_int);
for (i = 0; i < num; i++)
- atoms[i] = atoms_int[i];
+ atoms[i] = atoms_int[i];
} /* ecore_x_atoms_get */
EAPI char *
@@ -334,13 +336,13 @@ ecore_x_atom_name_get(Ecore_X_Atom atom)
char *xname;
if (!_ecore_x_disp)
- return NULL;
+ return NULL;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
xname = XGetAtomName(_ecore_x_disp, atom);
if (!xname)
- return NULL;
+ return NULL;
name = strdup(xname);
XFree(xname);
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_composite.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_composite.c
index 3e3d951c71..43153fff4d 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_composite.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_composite.c
@@ -50,12 +50,12 @@ ecore_x_composite_redirect_window(Ecore_X_Window win,
switch(type)
{
case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
- update = CompositeRedirectAutomatic;
- break;
+ update = CompositeRedirectAutomatic;
+ break;
case ECORE_X_COMPOSITE_UPDATE_MANUAL:
- update = CompositeRedirectManual;
- break;
+ update = CompositeRedirectManual;
+ break;
} /* switch */
XCompositeRedirectWindow(_ecore_x_disp, win, update);
#endif /* ifdef ECORE_XCOMPOSITE */
@@ -72,12 +72,12 @@ ecore_x_composite_redirect_subwindows(Ecore_X_Window win,
switch(type)
{
case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
- update = CompositeRedirectAutomatic;
- break;
+ update = CompositeRedirectAutomatic;
+ break;
case ECORE_X_COMPOSITE_UPDATE_MANUAL:
- update = CompositeRedirectManual;
- break;
+ update = CompositeRedirectManual;
+ break;
} /* switch */
XCompositeRedirectSubwindows(_ecore_x_disp, win, update);
#endif /* ifdef ECORE_XCOMPOSITE */
@@ -94,12 +94,12 @@ ecore_x_composite_unredirect_window(Ecore_X_Window win,
switch(type)
{
case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
- update = CompositeRedirectAutomatic;
- break;
+ update = CompositeRedirectAutomatic;
+ break;
case ECORE_X_COMPOSITE_UPDATE_MANUAL:
- update = CompositeRedirectManual;
- break;
+ update = CompositeRedirectManual;
+ break;
} /* switch */
XCompositeUnredirectWindow(_ecore_x_disp, win, update);
#endif /* ifdef ECORE_XCOMPOSITE */
@@ -116,12 +116,12 @@ ecore_x_composite_unredirect_subwindows(Ecore_X_Window win,
switch(type)
{
case ECORE_X_COMPOSITE_UPDATE_AUTOMATIC:
- update = CompositeRedirectAutomatic;
- break;
+ update = CompositeRedirectAutomatic;
+ break;
case ECORE_X_COMPOSITE_UPDATE_MANUAL:
- update = CompositeRedirectManual;
- break;
+ update = CompositeRedirectManual;
+ break;
} /* switch */
XCompositeUnredirectSubwindows(_ecore_x_disp, win, update);
#endif /* ifdef ECORE_XCOMPOSITE */
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_cursor.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_cursor.c
index d97b2f76c4..434505c207 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_cursor.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_cursor.c
@@ -43,7 +43,7 @@ ecore_x_cursor_new(Ecore_X_Window win,
// r = (((pixels[i] >> 16) & 0xff) * a) / 0xff;
// g = (((pixels[i] >> 8 ) & 0xff) * a) / 0xff;
// b = (((pixels[i] ) & 0xff) * a) / 0xff;
- xci->pixels[i] = pixels[i];
+ xci->pixels[i] = pixels[i];
// (a << 24) | (r << 16) | (g << 8) | (b);
}
c = XcursorImageLoadCursor(_ecore_x_disp, xci);
@@ -127,23 +127,23 @@ ecore_x_cursor_new(Ecore_X_Window win,
g = (pix[0] >> 8) & 0xff;
b = (pix[0]) & 0xff;
d1 =
- ((r - fr) * (r - fr)) +
- ((g - fg) * (g - fg)) +
- ((b - fb) * (b - fb));
+ ((r - fr) * (r - fr)) +
+ ((g - fg) * (g - fg)) +
+ ((b - fb) * (b - fb));
d2 =
- ((r - br) * (r - br)) +
- ((g - bg) * (g - bg)) +
- ((b - bb) * (b - bb));
+ ((r - br) * (r - br)) +
+ ((g - bg) * (g - bg)) +
+ ((b - bb) * (b - bb));
if (d1 + d2)
{
v = (((d2 * 255) / (d1 + d2)) * 5) / 256;
if (v > dither[x & 0x1][y & 0x1])
- v = 1;
+ v = 1;
else
- v = 0;
+ v = 0;
}
else
- v = 0;
+ v = 0;
XPutPixel(xim, x, y, v);
pix++;
@@ -162,9 +162,9 @@ ecore_x_cursor_new(Ecore_X_Window win,
v = (((pix[0] >> 24) & 0xff) * 5) / 256;
if (v > dither[x & 0x1][y & 0x1])
- v = 1;
+ v = 1;
else
- v = 0;
+ v = 0;
XPutPixel(xim, x, y, v);
pix++;
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_damage.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_damage.c
index 88d5f7d0f7..5e44d07c20 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_damage.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_damage.c
@@ -19,9 +19,9 @@ _ecore_x_damage_init(void)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (XDamageQueryVersion(_ecore_x_disp, &_damage_major, &_damage_minor))
- _damage_available = EINA_TRUE;
+ _damage_available = EINA_TRUE;
else
- _damage_available = EINA_FALSE;
+ _damage_available = EINA_FALSE;
#else /* ifdef ECORE_XDAMAGE */
_damage_available = EINA_FALSE;
@@ -35,7 +35,8 @@ ecore_x_damage_query(void)
} /* ecore_x_damage_query */
EAPI Ecore_X_Damage
-ecore_x_damage_new(Ecore_X_Drawable d, Ecore_X_Damage_Report_Level level)
+ecore_x_damage_new(Ecore_X_Drawable d,
+ Ecore_X_Damage_Report_Level level)
{
#ifdef ECORE_XDAMAGE
Ecore_X_Damage damage;
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c
index 67008cfd8f..7908584585 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_dnd.c
@@ -28,7 +28,8 @@ typedef struct _Version_Cache_Item
} Version_Cache_Item;
static Version_Cache_Item *_version_cache = NULL;
static int _version_cache_num = 0, _version_cache_alloc = 0;
-static void (*_posupdatecb)(void *, Ecore_X_Xdnd_Position *);
+static void (*_posupdatecb)(void *,
+ Ecore_X_Xdnd_Position *);
static void *_posupdatedata;
void
@@ -71,15 +72,15 @@ _ecore_x_dnd_shutdown(void)
{
_ecore_x_dnd_init_count--;
if (_ecore_x_dnd_init_count > 0)
- return;
+ return;
if (_source)
- free(_source);
+ free(_source);
_source = NULL;
if (_target)
- free(_target);
+ free(_target);
_target = NULL;
@@ -87,7 +88,7 @@ _ecore_x_dnd_shutdown(void)
} /* _ecore_x_dnd_shutdown */
static Eina_Bool
-_ecore_x_dnd_converter_copy(char *target __UNUSED__,
+_ecore_x_dnd_converter_copy(char *target __UNUSED__,
void *data,
int size,
void **data_ret,
@@ -100,11 +101,11 @@ _ecore_x_dnd_converter_copy(char *target __UNUSED__,
XICCEncodingStyle style = XTextStyle;
if (!data || !size)
- return EINA_FALSE;
+ return EINA_FALSE;
mystr = calloc(1, size + 1);
if (!mystr)
- return EINA_FALSE;
+ return EINA_FALSE;
memcpy(mystr, data, size);
@@ -132,16 +133,17 @@ _ecore_x_dnd_converter_copy(char *target __UNUSED__,
} /* _ecore_x_dnd_converter_copy */
EAPI void
-ecore_x_dnd_aware_set(Ecore_X_Window win, Eina_Bool on)
+ecore_x_dnd_aware_set(Ecore_X_Window win,
+ Eina_Bool on)
{
Ecore_X_Atom prop_data = ECORE_X_DND_VERSION;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (on)
- ecore_x_window_prop_property_set(win, ECORE_X_ATOM_XDND_AWARE,
- XA_ATOM, 32, &prop_data, 1);
+ ecore_x_window_prop_property_set(win, ECORE_X_ATOM_XDND_AWARE,
+ XA_ATOM, 32, &prop_data, 1);
else
- ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_AWARE);
+ ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_AWARE);
} /* ecore_x_dnd_aware_set */
EAPI int
@@ -157,16 +159,16 @@ ecore_x_dnd_version_get(Ecore_X_Window win)
// move and going to and from x multiple times per move is EXPENSIVE
// and slows things down, puts lots of load on x etc.
if (_source->state == ECORE_X_DND_SOURCE_DRAGGING)
- if (_version_cache)
- {
- int i;
+ if (_version_cache)
+ {
+ int i;
- for (i = 0; i < _version_cache_num; i++)
- {
- if (_version_cache[i].win == win)
- return _version_cache[i].ver;
- }
- }
+ for (i = 0; i < _version_cache_num; i++)
+ {
+ if (_version_cache[i].win == win)
+ return _version_cache[i].ver;
+ }
+ }
if (ecore_x_window_prop_property_get(win, ECORE_X_ATOM_XDND_AWARE,
XA_ATOM, 32, &prop_data, &num))
@@ -177,7 +179,7 @@ ecore_x_dnd_version_get(Ecore_X_Window win)
{
_version_cache_num++;
if (_version_cache_num > _version_cache_alloc)
- _version_cache_alloc += 16;
+ _version_cache_alloc += 16;
t = realloc(_version_cache,
_version_cache_alloc *
@@ -195,7 +197,7 @@ ecore_x_dnd_version_get(Ecore_X_Window win)
{
_version_cache_num++;
if (_version_cache_num > _version_cache_alloc)
- _version_cache_alloc += 16;
+ _version_cache_alloc += 16;
t = realloc(_version_cache, _version_cache_alloc *
sizeof(Version_Cache_Item));
@@ -209,7 +211,8 @@ ecore_x_dnd_version_get(Ecore_X_Window win)
} /* ecore_x_dnd_version_get */
EAPI Eina_Bool
-ecore_x_dnd_type_isset(Ecore_X_Window win, const char *type)
+ecore_x_dnd_type_isset(Ecore_X_Window win,
+ const char *type)
{
int num, i, ret = EINA_FALSE;
unsigned char *data;
@@ -218,7 +221,7 @@ ecore_x_dnd_type_isset(Ecore_X_Window win, const char *type)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_property_get(win, ECORE_X_ATOM_XDND_TYPE_LIST,
XA_ATOM, 32, &data, &num))
- return ret;
+ return ret;
atom = ecore_x_atom_get(type);
atoms = (Ecore_X_Atom *)data;
@@ -237,7 +240,9 @@ ecore_x_dnd_type_isset(Ecore_X_Window win, const char *type)
} /* ecore_x_dnd_type_isset */
EAPI void
-ecore_x_dnd_type_set(Ecore_X_Window win, const char *type, Eina_Bool on)
+ecore_x_dnd_type_set(Ecore_X_Window win,
+ const char *type,
+ Eina_Bool on)
{
Ecore_X_Atom atom;
Ecore_X_Atom *oldset = NULL, *newset = NULL;
@@ -262,12 +267,12 @@ ecore_x_dnd_type_set(Ecore_X_Window win, const char *type, Eina_Bool on)
newset = calloc(num + 1, sizeof(Ecore_X_Atom));
if (!newset)
- return;
+ return;
data = (unsigned char *)newset;
for (i = 0; i < num; i++)
- newset[i + 1] = oldset[i];
+ newset[i + 1] = oldset[i];
/* prepend the new type */
newset[0] = atom;
@@ -291,8 +296,8 @@ ecore_x_dnd_type_set(Ecore_X_Window win, const char *type, Eina_Bool on)
data = (unsigned char *)newset;
for (i = 0; i < num; i++)
- if (oldset[i] != atom)
- newset[j++] = oldset[i];
+ if (oldset[i] != atom)
+ newset[j++] = oldset[i];
ecore_x_window_prop_property_set(win, ECORE_X_ATOM_XDND_TYPE_LIST,
XA_ATOM, 32, data, num - 1);
@@ -313,12 +318,12 @@ ecore_x_dnd_types_set(Ecore_X_Window win,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!num_types)
- ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_TYPE_LIST);
+ ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_TYPE_LIST);
else
{
newset = calloc(num_types, sizeof(Ecore_X_Atom));
if (!newset)
- return;
+ return;
data = (unsigned char *)newset;
for (i = 0; i < num_types; i++)
@@ -343,7 +348,7 @@ ecore_x_dnd_actions_set(Ecore_X_Window win,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!num_actions)
- ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_ACTION_LIST);
+ ecore_x_window_prop_property_del(win, ECORE_X_ATOM_XDND_ACTION_LIST);
else
{
data = (unsigned char *)actions;
@@ -373,8 +378,9 @@ ecore_x_dnd_actions_set(Ecore_X_Window win,
*/
EAPI void
ecore_x_dnd_callback_pos_update_set(
- void (*cb)(void *, Ecore_X_Xdnd_Position *data),
- const void *data)
+ void (*cb)(void *,
+ Ecore_X_Xdnd_Position *data),
+ const void *data)
{
_posupdatecb = cb;
_posupdatedata = (void *)data; /* Discard the const early */
@@ -393,15 +399,17 @@ _ecore_x_dnd_target_get(void)
} /* _ecore_x_dnd_target_get */
EAPI Eina_Bool
-ecore_x_dnd_begin(Ecore_X_Window source, unsigned char *data, int size)
+ecore_x_dnd_begin(Ecore_X_Window source,
+ unsigned char *data,
+ int size)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_dnd_version_get(source))
- return EINA_FALSE;
+ return EINA_FALSE;
/* Take ownership of XdndSelection */
if (!ecore_x_selection_xdnd_set(source, data, size))
- return EINA_FALSE;
+ return EINA_FALSE;
if (_version_cache)
{
@@ -463,8 +471,8 @@ ecore_x_dnd_drop(void)
else
{
/* Dropping on nothing */
- ecore_x_selection_xdnd_clear();
- _source->state = ECORE_X_DND_SOURCE_IDLE;
+ ecore_x_selection_xdnd_clear();
+ _source->state = ECORE_X_DND_SOURCE_IDLE;
}
ecore_x_window_ignore_set(_source->win, 0);
@@ -483,7 +491,7 @@ ecore_x_dnd_send_status(Eina_Bool will_accept,
XEvent xev;
if (_target->state == ECORE_X_DND_TARGET_IDLE)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
memset(&xev, 0, sizeof(XEvent));
@@ -499,10 +507,10 @@ ecore_x_dnd_send_status(Eina_Bool will_accept,
xev.xclient.data.l[0] = _target->win;
xev.xclient.data.l[1] = 0;
if (will_accept)
- xev.xclient.data.l[1] |= 0x1UL;
+ xev.xclient.data.l[1] |= 0x1UL;
if (!suppress)
- xev.xclient.data.l[1] |= 0x2UL;
+ xev.xclient.data.l[1] |= 0x2UL;
/* Set rectangle information */
xev.xclient.data.l[2] = rectangle.x;
@@ -532,7 +540,7 @@ ecore_x_dnd_send_finished(void)
XEvent xev;
if (_target->state == ECORE_X_DND_TARGET_IDLE)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
xev.xany.type = ClientMessage;
@@ -560,7 +568,7 @@ ecore_x_dnd_source_action_set(Ecore_X_Atom action)
{
_source->action = action;
if (_source->prev.window)
- _ecore_x_dnd_drag(_source->prev.window, _source->prev.x, _source->prev.y);
+ _ecore_x_dnd_drag(_source->prev.window, _source->prev.x, _source->prev.y);
} /* ecore_x_dnd_source_action_set */
EAPI Ecore_X_Atom
@@ -570,7 +578,9 @@ ecore_x_dnd_source_action_get(void)
} /* ecore_x_dnd_source_action_get */
void
-_ecore_x_dnd_drag(Ecore_X_Window root, int x, int y)
+_ecore_x_dnd_drag(Ecore_X_Window root,
+ int x,
+ int y)
{
XEvent xev;
Ecore_X_Window win;
@@ -579,7 +589,7 @@ _ecore_x_dnd_drag(Ecore_X_Window root, int x, int y)
int num;
if (_source->state != ECORE_X_DND_SOURCE_DRAGGING)
- return;
+ return;
/* Preinitialize XEvent struct */
memset(&xev, 0, sizeof(XEvent));
@@ -599,7 +609,7 @@ _ecore_x_dnd_drag(Ecore_X_Window root, int x, int y)
// while ((win) && !(ecore_x_dnd_version_get(win)))
// win = ecore_x_window_parent_get(win);
while ((win) && !(ecore_x_dnd_version_get(win)))
- win = ecore_x_window_shadow_parent_get(root, win);
+ win = ecore_x_window_shadow_parent_get(root, win);
/* Send XdndLeave to current destination window if we have left it */
if ((_source->dest) && (win != _source->dest))
@@ -639,16 +649,16 @@ _ecore_x_dnd_drag(Ecore_X_Window root, int x, int y)
xev.xclient.data.l[0] = _source->win;
xev.xclient.data.l[1] = 0;
if (num > 3)
- xev.xclient.data.l[1] |= 0x1UL;
+ xev.xclient.data.l[1] |= 0x1UL;
else
- xev.xclient.data.l[1] &= 0xfffffffeUL;
+ xev.xclient.data.l[1] &= 0xfffffffeUL;
xev.xclient.data.l[1] |= ((unsigned long)_source->version) << 24;
for (i = 2; i < 5; i++)
- xev.xclient.data.l[i] = 0;
+ xev.xclient.data.l[i] = 0;
for (i = 0; i < MIN(num, 3); ++i)
- xev.xclient.data.l[i + 2] = types[i];
+ xev.xclient.data.l[i + 2] = types[i];
XFree(data);
XSendEvent(_ecore_x_disp, win, False, 0, &xev);
_source->await_status = 0;
@@ -691,10 +701,6 @@ _ecore_x_dnd_drag(Ecore_X_Window root, int x, int y)
_source->prev.y = y;
_source->prev.window = root;
_source->dest = win;
-
-
} /* _ecore_x_dnd_drag */
-
-
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_dpms.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_dpms.c
index 75046b7150..74d5344dce 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_dpms.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_dpms.c
@@ -16,9 +16,9 @@ _ecore_x_dpms_init(void)
_dpms_minor = 0;
if (DPMSGetVersion(_ecore_x_disp, &_dpms_major, &_dpms_minor))
- _dpms_available = EINA_TRUE;
+ _dpms_available = EINA_TRUE;
else
- _dpms_available = EINA_FALSE;
+ _dpms_available = EINA_FALSE;
#else /* ifdef ECORE_XDPMS */
_dpms_available = EINA_FALSE;
@@ -89,9 +89,9 @@ ecore_x_dpms_enabled_set(int enabled)
#ifdef ECORE_XDPMS
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (enabled)
- DPMSEnable(_ecore_x_disp);
+ DPMSEnable(_ecore_x_disp);
else
- DPMSDisable(_ecore_x_disp);
+ DPMSDisable(_ecore_x_disp);
#endif /* ifdef ECORE_XDPMS */
} /* ecore_x_dpms_enabled_set */
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c
index 90bda18a2e..a64060b06c 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_drawable.c
@@ -12,7 +12,7 @@
/**
* Retrieves the geometry of the given drawable.
-* @param d The given drawable.
+ * @param d The given drawable.
* @param x Pointer to an integer into which the X position is to be stored.
* @param y Pointer to an integer into which the Y position is to be stored.
* @param w Pointer to an integer into which the width is to be stored.
@@ -41,16 +41,16 @@ ecore_x_drawable_geometry_get(Ecore_X_Drawable d,
}
if (x)
- *x = ret_x;
+ *x = ret_x;
if (y)
- *y = ret_y;
+ *y = ret_y;
if (w)
- *w = (int)ret_w;
+ *w = (int)ret_w;
if (h)
- *h = (int)ret_h;
+ *h = (int)ret_h;
} /* ecore_x_drawable_geometry_get */
/**
@@ -69,7 +69,7 @@ ecore_x_drawable_border_width_get(Ecore_X_Drawable d)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &dummy_x, &dummy_y,
&dummy_w, &dummy_h, &border_ret, &dummy_depth))
- border_ret = 0;
+ border_ret = 0;
return (int)border_ret;
} /* ecore_x_drawable_border_width_get */
@@ -90,7 +90,7 @@ ecore_x_drawable_depth_get(Ecore_X_Drawable d)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &dummy_x, &dummy_y,
&dummy_w, &dummy_h, &dummy_border, &depth_ret))
- depth_ret = 0;
+ depth_ret = 0;
return (int)depth_ret;
} /* ecore_x_drawable_depth_get */
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c
index 72fd933099..d357c9b407 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_e.c
@@ -17,7 +17,11 @@ ecore_x_e_init(void)
} /* ecore_x_e_init */
EAPI void
-ecore_x_e_frame_size_set(Ecore_X_Window win, int fl, int fr, int ft, int fb)
+ecore_x_e_frame_size_set(Ecore_X_Window win,
+ int fl,
+ int fr,
+ int ft,
+ int fb)
{
unsigned int frames[4];
@@ -30,7 +34,8 @@ ecore_x_e_frame_size_set(Ecore_X_Window win, int fl, int fr, int ft, int fb)
} /* ecore_x_e_frame_size_set */
EAPI void
-ecore_x_e_virtual_keyboard_set(Ecore_X_Window win, unsigned int is_keyboard)
+ecore_x_e_virtual_keyboard_set(Ecore_X_Window win,
+ unsigned int is_keyboard)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD,
@@ -45,7 +50,7 @@ ecore_x_e_virtual_keyboard_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD,
&val, 1))
- return EINA_FALSE;
+ return EINA_FALSE;
return val ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_e_virtual_keyboard_get */
@@ -54,49 +59,49 @@ static Ecore_X_Virtual_Keyboard_State
_ecore_x_e_vkbd_state_get(Ecore_X_Atom atom)
{
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_ON)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_ON;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_ON;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_OFF)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_ALPHA)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_ALPHA;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_ALPHA;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_NUMERIC)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_NUMERIC;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_NUMERIC;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PIN)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_PIN;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_PIN;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PHONE_NUMBER)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_PHONE_NUMBER;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_PHONE_NUMBER;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_HEX)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_HEX;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_HEX;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_TERMINAL)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_TERMINAL;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_TERMINAL;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PASSWORD)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_PASSWORD;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_PASSWORD;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_IP)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_IP;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_IP;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_HOST)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_HOST;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_HOST;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_FILE)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_FILE;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_FILE;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_URL)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_URL;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_URL;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_KEYPAD)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_KEYPAD;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_KEYPAD;
if (atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_J2ME)
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_J2ME;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_J2ME;
return ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN;
} /* _ecore_x_e_vkbd_state_get */
@@ -107,49 +112,49 @@ _ecore_x_e_vkbd_atom_get(Ecore_X_Virtual_Keyboard_State state)
switch (state)
{
case ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_OFF;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_OFF;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_ON:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_ON;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_ON;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_ALPHA:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_ALPHA;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_ALPHA;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_NUMERIC:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_NUMERIC;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_NUMERIC;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_PIN:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PIN;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PIN;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_PHONE_NUMBER:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PHONE_NUMBER;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PHONE_NUMBER;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_HEX:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_HEX;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_HEX;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_TERMINAL:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_TERMINAL;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_TERMINAL;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_PASSWORD:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PASSWORD;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PASSWORD;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_IP:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_IP;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_IP;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_HOST:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_HOST;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_HOST;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_FILE:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_FILE;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_FILE;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_URL:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_URL;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_URL;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_KEYPAD:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_KEYPAD;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_KEYPAD;
case ECORE_X_VIRTUAL_KEYBOARD_STATE_J2ME:
- return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_J2ME;
+ return ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_J2ME;
default: break;
} /* switch */
@@ -176,7 +181,7 @@ ecore_x_e_virtual_keyboard_state_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_atom_get(win, ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE,
&atom, 1))
- return ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN;
+ return ECORE_X_VIRTUAL_KEYBOARD_STATE_UNKNOWN;
return _ecore_x_e_vkbd_state_get(atom);
} /* ecore_x_e_virtual_keyboard_state_get */
@@ -198,16 +203,16 @@ _ecore_x_e_illume_atom_get(Ecore_X_Illume_Mode mode)
switch (mode)
{
case ECORE_X_ILLUME_MODE_SINGLE:
- return ECORE_X_ATOM_E_ILLUME_MODE_SINGLE;
+ return ECORE_X_ATOM_E_ILLUME_MODE_SINGLE;
case ECORE_X_ILLUME_MODE_DUAL_TOP:
- return ECORE_X_ATOM_E_ILLUME_MODE_DUAL_TOP;
+ return ECORE_X_ATOM_E_ILLUME_MODE_DUAL_TOP;
case ECORE_X_ILLUME_MODE_DUAL_LEFT:
- return ECORE_X_ATOM_E_ILLUME_MODE_DUAL_LEFT;
+ return ECORE_X_ATOM_E_ILLUME_MODE_DUAL_LEFT;
default:
- break;
+ break;
} /* switch */
return ECORE_X_ILLUME_MODE_UNKNOWN;
} /* _ecore_x_e_illume_atom_get */
@@ -216,19 +221,20 @@ static Ecore_X_Illume_Mode
_ecore_x_e_illume_mode_get(Ecore_X_Atom atom)
{
if (atom == ECORE_X_ATOM_E_ILLUME_MODE_SINGLE)
- return ECORE_X_ILLUME_MODE_SINGLE;
+ return ECORE_X_ILLUME_MODE_SINGLE;
if (atom == ECORE_X_ATOM_E_ILLUME_MODE_DUAL_TOP)
- return ECORE_X_ILLUME_MODE_DUAL_TOP;
+ return ECORE_X_ILLUME_MODE_DUAL_TOP;
if (atom == ECORE_X_ATOM_E_ILLUME_MODE_DUAL_LEFT)
- return ECORE_X_ILLUME_MODE_DUAL_LEFT;
+ return ECORE_X_ILLUME_MODE_DUAL_LEFT;
return ECORE_X_ILLUME_MODE_UNKNOWN;
} /* _ecore_x_e_illume_mode_get */
EAPI void
-ecore_x_e_illume_zone_set(Ecore_X_Window win, Ecore_X_Window zone)
+ecore_x_e_illume_zone_set(Ecore_X_Window win,
+ Ecore_X_Window zone)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_window_set(win, ECORE_X_ATOM_E_ILLUME_ZONE,
@@ -243,7 +249,7 @@ ecore_x_e_illume_zone_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_window_get(win, ECORE_X_ATOM_E_ILLUME_ZONE,
&zone, 1))
- return 0;
+ return 0;
return zone;
} /* ecore_x_e_illume_zone_get */
@@ -259,7 +265,8 @@ ecore_x_e_illume_zone_list_set(Ecore_X_Window win,
} /* ecore_x_e_illume_zone_list_set */
EAPI void
-ecore_x_e_illume_conformant_set(Ecore_X_Window win, unsigned int is_conformant)
+ecore_x_e_illume_conformant_set(Ecore_X_Window win,
+ unsigned int is_conformant)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_CONFORMANT,
@@ -274,13 +281,14 @@ ecore_x_e_illume_conformant_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_CONFORMANT,
&val, 1))
- return EINA_FALSE;
+ return EINA_FALSE;
return val ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_e_illume_conformant_get */
EAPI void
-ecore_x_e_illume_mode_set(Ecore_X_Window win, Ecore_X_Illume_Mode mode)
+ecore_x_e_illume_mode_set(Ecore_X_Window win,
+ Ecore_X_Illume_Mode mode)
{
Ecore_X_Atom atom = 0;
@@ -297,13 +305,14 @@ ecore_x_e_illume_mode_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_atom_get(win, ECORE_X_ATOM_E_ILLUME_MODE, &atom, 1))
- return ECORE_X_ILLUME_MODE_UNKNOWN;
+ return ECORE_X_ILLUME_MODE_UNKNOWN;
return _ecore_x_e_illume_mode_get(atom);
} /* ecore_x_e_illume_mode_get */
EAPI void
-ecore_x_e_illume_mode_send(Ecore_X_Window win, Ecore_X_Illume_Mode mode)
+ecore_x_e_illume_mode_send(Ecore_X_Window win,
+ Ecore_X_Illume_Mode mode)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_MODE,
@@ -367,7 +376,8 @@ ecore_x_e_illume_home_del_send(Ecore_X_Window win)
} /* ecore_x_e_illume_home_del_send */
EAPI void
-ecore_x_e_illume_drag_set(Ecore_X_Window win, unsigned int drag)
+ecore_x_e_illume_drag_set(Ecore_X_Window win,
+ unsigned int drag)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_DRAG, &drag, 1);
@@ -380,13 +390,14 @@ ecore_x_e_illume_drag_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_DRAG, &val, 1))
- return EINA_FALSE;
+ return EINA_FALSE;
return val ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_e_illume_drag_get */
EAPI void
-ecore_x_e_illume_drag_locked_set(Ecore_X_Window win, unsigned int is_locked)
+ecore_x_e_illume_drag_locked_set(Ecore_X_Window win,
+ unsigned int is_locked)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_DRAG_LOCKED,
@@ -401,7 +412,7 @@ ecore_x_e_illume_drag_locked_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_DRAG_LOCKED,
&val, 1))
- return EINA_FALSE;
+ return EINA_FALSE;
return val ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_e_illume_drag_locked_get */
@@ -454,23 +465,23 @@ ecore_x_e_illume_indicator_geometry_get(Ecore_X_Window win,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ret =
- ecore_x_window_prop_card32_get(win,
- ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY,
- geom, 4);
+ ecore_x_window_prop_card32_get(win,
+ ECORE_X_ATOM_E_ILLUME_INDICATOR_GEOMETRY,
+ geom, 4);
if (ret != 4)
- return EINA_FALSE;
+ return EINA_FALSE;
if (x)
- *x = geom[0];
+ *x = geom[0];
if (y)
- *y = geom[1];
+ *y = geom[1];
if (w)
- *w = geom[2];
+ *w = geom[2];
if (h)
- *h = geom[3];
+ *h = geom[3];
return EINA_TRUE;
} /* ecore_x_e_illume_indicator_geometry_get */
@@ -505,23 +516,23 @@ ecore_x_e_illume_softkey_geometry_get(Ecore_X_Window win,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ret =
- ecore_x_window_prop_card32_get(win,
- ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY,
- geom, 4);
+ ecore_x_window_prop_card32_get(win,
+ ECORE_X_ATOM_E_ILLUME_SOFTKEY_GEOMETRY,
+ geom, 4);
if (ret != 4)
- return EINA_FALSE;
+ return EINA_FALSE;
if (x)
- *x = geom[0];
+ *x = geom[0];
if (y)
- *y = geom[1];
+ *y = geom[1];
if (w)
- *w = geom[2];
+ *w = geom[2];
if (h)
- *h = geom[3];
+ *h = geom[3];
return EINA_TRUE;
} /* ecore_x_e_illume_softkey_geometry_get */
@@ -556,23 +567,23 @@ ecore_x_e_illume_keyboard_geometry_get(Ecore_X_Window win,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ret =
- ecore_x_window_prop_card32_get(win,
- ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY,
- geom, 4);
+ ecore_x_window_prop_card32_get(win,
+ ECORE_X_ATOM_E_ILLUME_KEYBOARD_GEOMETRY,
+ geom, 4);
if (ret != 4)
- return EINA_FALSE;
+ return EINA_FALSE;
if (x)
- *x = geom[0];
+ *x = geom[0];
if (y)
- *y = geom[1];
+ *y = geom[1];
if (w)
- *w = geom[2];
+ *w = geom[2];
if (h)
- *h = geom[3];
+ *h = geom[3];
return EINA_TRUE;
} /* ecore_x_e_illume_keyboard_geometry_get */
@@ -583,13 +594,13 @@ _ecore_x_e_quickpanel_atom_get(Ecore_X_Illume_Quickpanel_State state)
switch (state)
{
case ECORE_X_ILLUME_QUICKPANEL_STATE_ON:
- return ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON;
+ return ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON;
case ECORE_X_ILLUME_QUICKPANEL_STATE_OFF:
- return ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF;
+ return ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF;
default:
- break;
+ break;
} /* switch */
return 0;
} /* _ecore_x_e_quickpanel_atom_get */
@@ -598,16 +609,17 @@ static Ecore_X_Illume_Quickpanel_State
_ecore_x_e_quickpanel_state_get(Ecore_X_Atom atom)
{
if (atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON)
- return ECORE_X_ILLUME_QUICKPANEL_STATE_ON;
+ return ECORE_X_ILLUME_QUICKPANEL_STATE_ON;
if (atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF)
- return ECORE_X_ILLUME_QUICKPANEL_STATE_OFF;
+ return ECORE_X_ILLUME_QUICKPANEL_STATE_OFF;
return ECORE_X_ILLUME_QUICKPANEL_STATE_UNKNOWN;
} /* _ecore_x_e_quickpanel_state_get */
EAPI void
-ecore_x_e_illume_quickpanel_set(Ecore_X_Window win, unsigned int is_quickpanel)
+ecore_x_e_illume_quickpanel_set(Ecore_X_Window win,
+ unsigned int is_quickpanel)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL,
@@ -622,7 +634,7 @@ ecore_x_e_illume_quickpanel_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_QUICKPANEL,
&val, 1))
- return EINA_FALSE;
+ return EINA_FALSE;
return val ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_e_illume_quickpanel_get */
@@ -648,7 +660,7 @@ ecore_x_e_illume_quickpanel_state_get(Ecore_X_Window win)
if (!ecore_x_window_prop_atom_get(win,
ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE,
&atom, 1))
- return ECORE_X_ILLUME_QUICKPANEL_STATE_UNKNOWN;
+ return ECORE_X_ILLUME_QUICKPANEL_STATE_UNKNOWN;
return _ecore_x_e_quickpanel_state_get(atom);
} /* ecore_x_e_illume_quickpanel_state_get */
@@ -693,7 +705,7 @@ ecore_x_e_illume_quickpanel_priority_major_get(Ecore_X_Window win)
if (!ecore_x_window_prop_card32_get(win,
ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR,
&val, 1))
- return 0;
+ return 0;
return val;
} /* ecore_x_e_illume_quickpanel_priority_major_get */
@@ -717,13 +729,14 @@ ecore_x_e_illume_quickpanel_priority_minor_get(Ecore_X_Window win)
if (!ecore_x_window_prop_card32_get(win,
ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR,
&val, 1))
- return 0;
+ return 0;
return val;
} /* ecore_x_e_illume_quickpanel_priority_minor_get */
EAPI void
-ecore_x_e_illume_quickpanel_zone_set(Ecore_X_Window win, unsigned int zone)
+ecore_x_e_illume_quickpanel_zone_set(Ecore_X_Window win,
+ unsigned int zone)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(win,
@@ -740,7 +753,7 @@ ecore_x_e_illume_quickpanel_zone_get(Ecore_X_Window win)
if (!ecore_x_window_prop_card32_get(win,
ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE,
&val, 1))
- return 0;
+ return 0;
return val;
} /* ecore_x_e_illume_quickpanel_zone_get */
@@ -761,10 +774,10 @@ ecore_x_e_comp_sync_counter_set(Ecore_X_Window win,
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (counter)
- ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_COMP_SYNC_COUNTER,
- ECORE_X_ATOM_CARDINAL, &counter, 1);
+ ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_COMP_SYNC_COUNTER,
+ ECORE_X_ATOM_CARDINAL, &counter, 1);
else
- ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_COMP_SYNC_COUNTER);
+ ecore_x_window_prop_property_del(win, ECORE_X_ATOM_E_COMP_SYNC_COUNTER);
} /* ecore_x_e_comp_sync_counter_set */
EAPI Ecore_X_Sync_Counter
@@ -775,24 +788,25 @@ ecore_x_e_comp_sync_counter_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ret =
- ecore_x_window_prop_xid_get(win,
- ECORE_X_ATOM_E_COMP_SYNC_COUNTER,
- ECORE_X_ATOM_CARDINAL,
- &counter, 1);
+ ecore_x_window_prop_xid_get(win,
+ ECORE_X_ATOM_E_COMP_SYNC_COUNTER,
+ ECORE_X_ATOM_CARDINAL,
+ &counter, 1);
if (ret != 1)
- return 0;
+ return 0;
return counter;
} /* ecore_x_e_comp_sync_counter_get */
EAPI void
-ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root, Ecore_X_Window win)
+ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root,
+ Ecore_X_Window win)
{
XEvent xev;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!root)
- root = DefaultRootWindow(_ecore_x_disp);
+ root = DefaultRootWindow(_ecore_x_disp);
xev.xclient.type = ClientMessage;
xev.xclient.display = _ecore_x_disp;
@@ -811,13 +825,16 @@ ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root, Ecore_X_Window win)
} /* ecore_x_e_comp_sync_draw_done_send */
EAPI void
-ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window root, Ecore_X_Window win, int w, int h)
+ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window root,
+ Ecore_X_Window win,
+ int w,
+ int h)
{
XEvent xev;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!root)
- root = DefaultRootWindow(_ecore_x_disp);
+ root = DefaultRootWindow(_ecore_x_disp);
xev.xclient.type = ClientMessage;
xev.xclient.display = _ecore_x_disp;
@@ -836,18 +853,19 @@ ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window root, Ecore_X_Window win,
} /* ecore_x_e_comp_sync_draw_done_send */
EAPI void
-ecore_x_e_comp_sync_supported_set(Ecore_X_Window root, Eina_Bool enabled)
+ecore_x_e_comp_sync_supported_set(Ecore_X_Window root,
+ Eina_Bool enabled)
{
Ecore_X_Window win;
if (!root)
- root = DefaultRootWindow(_ecore_x_disp);
+ root = DefaultRootWindow(_ecore_x_disp);
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (enabled)
{
win = ecore_x_window_new(root, 1, 2, 3, 4);
- ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED,
+ ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED,
ECORE_X_ATOM_WINDOW, &win, 1);
ecore_x_window_prop_xid_set(root, ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED,
ECORE_X_ATOM_WINDOW, &win, 1);
@@ -857,15 +875,15 @@ ecore_x_e_comp_sync_supported_set(Ecore_X_Window root, Eina_Bool enabled)
int ret;
ret =
- ecore_x_window_prop_xid_get(root,
- ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED,
- ECORE_X_ATOM_WINDOW,
- &win, 1);
+ ecore_x_window_prop_xid_get(root,
+ ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED,
+ ECORE_X_ATOM_WINDOW,
+ &win, 1);
if ((ret == 1) && (win))
{
ecore_x_window_prop_property_del(
- root,
- ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED);
+ root,
+ ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED);
ecore_x_window_free(win);
}
}
@@ -879,22 +897,22 @@ ecore_x_e_comp_sync_supported_get(Ecore_X_Window root)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!root)
- root = DefaultRootWindow(_ecore_x_disp);
+ root = DefaultRootWindow(_ecore_x_disp);
ret =
- ecore_x_window_prop_xid_get(root,
- ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED,
- ECORE_X_ATOM_WINDOW,
- &win, 1);
+ ecore_x_window_prop_xid_get(root,
+ ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED,
+ ECORE_X_ATOM_WINDOW,
+ &win, 1);
if ((ret == 1) && (win))
{
ret =
- ecore_x_window_prop_xid_get(win,
- ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED,
- ECORE_X_ATOM_WINDOW,
- &win2, 1);
+ ecore_x_window_prop_xid_get(win,
+ ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED,
+ ECORE_X_ATOM_WINDOW,
+ &win2, 1);
if ((ret == 1) && (win2 == win))
- return EINA_TRUE;
+ return EINA_TRUE;
}
return EINA_FALSE;
@@ -1011,14 +1029,15 @@ ecore_x_e_comp_dump_send(Ecore_X_Window win)
} /* ecore_x_e_comp_dump_send */
EAPI void
-ecore_x_e_comp_pixmap_set(Ecore_X_Window win, Ecore_X_Pixmap pixmap)
+ecore_x_e_comp_pixmap_set(Ecore_X_Window win,
+ Ecore_X_Pixmap pixmap)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (pixmap)
- ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_COMP_PIXMAP,
- ECORE_X_ATOM_PIXMAP, &pixmap, 1);
+ ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_COMP_PIXMAP,
+ ECORE_X_ATOM_PIXMAP, &pixmap, 1);
else
- ecore_x_window_prop_property_del(win, pixmap);
+ ecore_x_window_prop_property_del(win, pixmap);
} /* ecore_x_e_comp_pixmap_set */
EAPI Ecore_X_Pixmap
@@ -1029,12 +1048,12 @@ ecore_x_e_comp_pixmap_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ret =
- ecore_x_window_prop_xid_get(win,
- ECORE_X_ATOM_E_COMP_PIXMAP,
- ECORE_X_ATOM_PIXMAP,
- &pixmap, 1);
+ ecore_x_window_prop_xid_get(win,
+ ECORE_X_ATOM_E_COMP_PIXMAP,
+ ECORE_X_ATOM_PIXMAP,
+ &pixmap, 1);
if (ret != 1)
- return 0;
+ return 0;
return pixmap;
} /* ecore_x_e_comp_pixmap_get */
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_error.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_error.c
index 1d27937877..837ff53544 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_error.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_error.c
@@ -9,8 +9,9 @@
#include "ecore_x_private.h"
#include "Ecore_X.h"
-static int _ecore_x_error_handle(Display *d, XErrorEvent *ev);
-static int _ecore_x_io_error_handle(Display *d);
+static int _ecore_x_error_handle(Display *d,
+ XErrorEvent *ev);
+static int _ecore_x_io_error_handle(Display *d);
static void (*_error_func)(void *data) = NULL;
static void *_error_data = NULL;
@@ -27,7 +28,8 @@ static int _error_code = 0;
* Set the X error handler function
*/
EAPI void
-ecore_x_error_handler_set(void (*func)(void *data), const void *data)
+ecore_x_error_handler_set(void (*func)(void *data),
+ const void *data)
{
_error_func = func;
_error_data = (void *)data;
@@ -41,7 +43,8 @@ ecore_x_error_handler_set(void (*func)(void *data), const void *data)
* Set the X I/O error handler function
*/
EAPI void
-ecore_x_io_error_handler_set(void (*func)(void *data), const void *data)
+ecore_x_io_error_handler_set(void (*func)(void *data),
+ const void *data)
{
_io_error_func = func;
_io_error_data = (void *)data;
@@ -79,14 +82,15 @@ _ecore_x_error_handler_init(void)
} /* _ecore_x_error_handler_init */
static int
-_ecore_x_error_handle(Display *d, XErrorEvent *ev)
+_ecore_x_error_handle(Display *d,
+ XErrorEvent *ev)
{
if (d == _ecore_x_disp)
{
_error_request_code = ev->request_code;
_error_code = ev->error_code;
if (_error_func)
- _error_func(_error_data);
+ _error_func(_error_data);
}
return 0;
} /* _ecore_x_error_handle */
@@ -97,9 +101,9 @@ _ecore_x_io_error_handle(Display *d)
if (d == _ecore_x_disp)
{
if (_io_error_func)
- _io_error_func(_io_error_data);
+ _io_error_func(_io_error_data);
else
- exit(-1);
+ exit(-1);
}
return 0;
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
index cbfb02db37..a0e22d30b9 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_events.c
@@ -25,13 +25,13 @@
typedef struct _Ecore_X_Mouse_Down_Info
{
EINA_INLIST;
- int dev;
- Window last_win;
- Window last_last_win;
- Window last_event_win;
- Window last_last_event_win;
- Time last_time;
- Time last_last_time;
+ int dev;
+ Window last_win;
+ Window last_last_win;
+ Window last_event_win;
+ Window last_last_event_win;
+ Time last_time;
+ Time last_last_time;
Eina_Bool did_double : 1;
Eina_Bool did_triple : 1;
} Ecore_X_Mouse_Down_Info;
@@ -57,7 +57,7 @@ _ecore_x_mouse_down_info_clear(void)
void
_ecore_x_events_init(void)
{
- //Actually, Nothing to do.
+ //Actually, Nothing to do.
}
void
@@ -76,18 +76,19 @@ _ecore_x_mouse_down_info_get(int dev)
EINA_INLIST_FOREACH(l, info)
if (info->dev == dev) return info;
- //New Device. Add it.
+ //New Device. Add it.
info = calloc(1, sizeof(Ecore_X_Mouse_Down_Info));
if (!info) return NULL;
info->dev = dev;
- l = eina_inlist_append(l, (Eina_Inlist*) info);
+ l = eina_inlist_append(l, (Eina_Inlist *)info);
_ecore_x_mouse_down_info_list = l;
return info;
}
static void
-_ecore_x_event_free_mouse_move(void *data __UNUSED__, void *ev)
+_ecore_x_event_free_mouse_move(void *data __UNUSED__,
+ void *ev)
{
Ecore_Event_Mouse_Move *e;
@@ -102,14 +103,15 @@ _ecore_x_event_free_mouse_move(void *data __UNUSED__, void *ev)
} /* _ecore_x_event_free_mouse_move */
EAPI void
-ecore_x_event_mask_set(Ecore_X_Window w, Ecore_X_Event_Mask mask)
+ecore_x_event_mask_set(Ecore_X_Window w,
+ Ecore_X_Event_Mask mask)
{
XWindowAttributes attr;
XSetWindowAttributes s_attr;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!w)
- w = DefaultRootWindow(_ecore_x_disp);
+ w = DefaultRootWindow(_ecore_x_disp);
memset(&attr, 0, sizeof(XWindowAttributes));
XGetWindowAttributes(_ecore_x_disp, w, &attr);
@@ -118,14 +120,15 @@ ecore_x_event_mask_set(Ecore_X_Window w, Ecore_X_Event_Mask mask)
} /* ecore_x_event_mask_set */
EAPI void
-ecore_x_event_mask_unset(Ecore_X_Window w, Ecore_X_Event_Mask mask)
+ecore_x_event_mask_unset(Ecore_X_Window w,
+ Ecore_X_Event_Mask mask)
{
XWindowAttributes attr;
XSetWindowAttributes s_attr;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!w)
- w = DefaultRootWindow(_ecore_x_disp);
+ w = DefaultRootWindow(_ecore_x_disp);
memset(&attr, 0, sizeof(XWindowAttributes));
XGetWindowAttributes(_ecore_x_disp, w, &attr);
@@ -134,20 +137,22 @@ ecore_x_event_mask_unset(Ecore_X_Window w, Ecore_X_Event_Mask mask)
} /* ecore_x_event_mask_unset */
static void
-_ecore_x_event_free_xdnd_enter(void *data __UNUSED__, void *ev)
+_ecore_x_event_free_xdnd_enter(void *data __UNUSED__,
+ void *ev)
{
Ecore_X_Event_Xdnd_Enter *e;
int i;
e = ev;
for (i = 0; i < e->num_types; i++)
- XFree(e->types[i]);
+ XFree(e->types[i]);
free(e->types);
free(e);
} /* _ecore_x_event_free_xdnd_enter */
static void
-_ecore_x_event_free_selection_notify(void *data __UNUSED__, void *ev)
+_ecore_x_event_free_selection_notify(void *data __UNUSED__,
+ void *ev)
{
Ecore_X_Event_Selection_Notify *e;
Ecore_X_Selection_Data *sel;
@@ -155,7 +160,7 @@ _ecore_x_event_free_selection_notify(void *data __UNUSED__, void *ev)
e = ev;
sel = e->data;
if (sel->free)
- sel->free(sel);
+ sel->free(sel);
free(e->target);
free(e);
@@ -167,28 +172,28 @@ _ecore_x_event_modifiers(unsigned int state)
unsigned int modifiers = 0;
if (state & ECORE_X_MODIFIER_SHIFT)
- modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
+ modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
if (state & ECORE_X_MODIFIER_CTRL)
- modifiers |= ECORE_EVENT_MODIFIER_CTRL;
+ modifiers |= ECORE_EVENT_MODIFIER_CTRL;
if (state & ECORE_X_MODIFIER_ALT)
- modifiers |= ECORE_EVENT_MODIFIER_ALT;
+ modifiers |= ECORE_EVENT_MODIFIER_ALT;
if (state & ECORE_X_MODIFIER_WIN)
- modifiers |= ECORE_EVENT_MODIFIER_WIN;
+ modifiers |= ECORE_EVENT_MODIFIER_WIN;
if (state & ECORE_X_LOCK_SCROLL)
- modifiers |= ECORE_EVENT_LOCK_SCROLL;
+ modifiers |= ECORE_EVENT_LOCK_SCROLL;
if (state & ECORE_X_LOCK_NUM)
- modifiers |= ECORE_EVENT_LOCK_NUM;
+ modifiers |= ECORE_EVENT_LOCK_NUM;
if (state & ECORE_X_LOCK_CAPS)
- modifiers |= ECORE_EVENT_LOCK_CAPS;
+ modifiers |= ECORE_EVENT_LOCK_CAPS;
if (state & ECORE_X_LOCK_SHIFT)
- modifiers |= ECORE_EVENT_LOCK_SHIFT;
+ modifiers |= ECORE_EVENT_LOCK_SHIFT;
return modifiers;
} /* _ecore_x_event_modifiers */
@@ -219,7 +224,7 @@ _ecore_mouse_move(unsigned int timestamp,
e = malloc(sizeof(Ecore_Event_Mouse_Move));
if (!e)
- return;
+ return;
e->window = window;
e->root_window = root_win;
@@ -258,7 +263,8 @@ _ecore_mouse_move(unsigned int timestamp,
} /* _ecore_mouse_move */
static void
-_ecore_key_press(int event, XKeyEvent *xevent)
+_ecore_key_press(int event,
+ XKeyEvent *xevent)
{
Ecore_Event_Key *e;
char *compose = NULL;
@@ -292,22 +298,22 @@ _ecore_key_press(int event, XKeyEvent *xevent)
&sym,
&status);
if (val > 0)
- {
- compose_buffer[val] = 0;
- compose = eina_str_convert(nl_langinfo(CODESET), "UTF-8",
- compose_buffer);
- tmp = compose;
- }
+ {
+ compose_buffer[val] = 0;
+ compose = eina_str_convert(nl_langinfo(CODESET), "UTF-8",
+ compose_buffer);
+ tmp = compose;
+ }
key = XKeysymToString(sym);
if (!key)
- key = keyname;
+ key = keyname;
e =
- malloc(sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) +
- (compose ? strlen(compose) : 0) + 3);
+ malloc(sizeof(Ecore_Event_Key) + strlen(key) + strlen(keyname) +
+ (compose ? strlen(compose) : 0) + 3);
if (!e)
- goto on_error;
+ goto on_error;
e->keyname = (char *)(e + 1);
e->key = e->keyname + strlen(keyname) + 1;
@@ -315,9 +321,9 @@ _ecore_key_press(int event, XKeyEvent *xevent)
e->string = e->compose;
strcpy((char *)e->keyname, keyname);
- strcpy((char *)e->key, key);
+ strcpy((char *)e->key, key);
if (compose)
- strcpy((char *)e->compose, compose);
+ strcpy((char *)e->compose, compose);
e->modifiers = _ecore_x_event_modifiers(xevent->state);
@@ -333,7 +339,7 @@ _ecore_key_press(int event, XKeyEvent *xevent)
on_error:
if (tmp)
- free(tmp);
+ free(tmp);
} /* _ecore_key_press */
Ecore_Event_Mouse_Button *
@@ -363,7 +369,7 @@ _ecore_mouse_button(int event,
e = malloc(sizeof(Ecore_Event_Mouse_Button));
if (!e)
- return NULL;
+ return NULL;
e->window = window;
e->root_window = root_win;
@@ -398,37 +404,37 @@ _ecore_mouse_button(int event,
{
if (event == ECORE_EVENT_MOUSE_BUTTON_DOWN)
{
- //Check Double Clicked
- if (((int)(timestamp - down_info->last_time) <=
- (int)(1000 * _ecore_x_double_click_time)) &&
- (window == down_info->last_win) &&
- (event_window == down_info->last_event_win))
- {
- e->double_click = 1;
- down_info->did_double = EINA_TRUE;
- }
- else
- {
- down_info->did_double = EINA_FALSE;
- down_info->did_triple = EINA_FALSE;
- }
-
- //Check Triple Clicked
- if (((int)(timestamp - down_info->last_last_time) <=
- (int)(2 * 1000 * _ecore_x_double_click_time)) &&
- (window == down_info->last_win) &&
- (window == down_info->last_last_win) &&
- (event_window == down_info->last_event_win) &&
- (event_window == down_info->last_last_event_win)
- )
- {
- e->triple_click = 1;
- down_info->did_triple = EINA_TRUE;
- }
- else
- {
- down_info->did_triple = EINA_FALSE;
- }
+ //Check Double Clicked
+ if (((int)(timestamp - down_info->last_time) <=
+ (int)(1000 * _ecore_x_double_click_time)) &&
+ (window == down_info->last_win) &&
+ (event_window == down_info->last_event_win))
+ {
+ e->double_click = 1;
+ down_info->did_double = EINA_TRUE;
+ }
+ else
+ {
+ down_info->did_double = EINA_FALSE;
+ down_info->did_triple = EINA_FALSE;
+ }
+
+ //Check Triple Clicked
+ if (((int)(timestamp - down_info->last_last_time) <=
+ (int)(2 * 1000 * _ecore_x_double_click_time)) &&
+ (window == down_info->last_win) &&
+ (window == down_info->last_last_win) &&
+ (event_window == down_info->last_event_win) &&
+ (event_window == down_info->last_last_event_win)
+ )
+ {
+ e->triple_click = 1;
+ down_info->did_triple = EINA_TRUE;
+ }
+ else
+ {
+ down_info->did_triple = EINA_FALSE;
+ }
}
else
{
@@ -444,7 +450,7 @@ _ecore_mouse_button(int event,
* no use. The variable is also commented out above. This code block is
* the only place that this variable is used, and appears to serve no
* purpose. - dh
- if (event == ECORE_EVENT_MOUSE_BUTTON_DOWN
+ if (event == ECORE_EVENT_MOUSE_BUTTON_DOWN
&& !e->double_click
&& !e->triple_click)
_ecore_x_mouse_up_count = 0;
@@ -517,7 +523,7 @@ _ecore_x_event_handle_button_press(XEvent *xevent)
e = malloc(sizeof(Ecore_Event_Mouse_Wheel));
if (!e)
- return;
+ return;
e->timestamp = xevent->xbutton.time;
e->modifiers = _ecore_x_event_modifiers(xevent->xbutton.state);
@@ -540,9 +546,9 @@ _ecore_x_event_handle_button_press(XEvent *xevent)
e->root.y = xevent->xbutton.y_root;
if (xevent->xbutton.subwindow)
- e->window = xevent->xbutton.subwindow;
+ e->window = xevent->xbutton.subwindow;
else
- e->window = xevent->xbutton.window;
+ e->window = xevent->xbutton.window;
e->event_window = xevent->xbutton.window;
e->same_screen = xevent->xbutton.same_screen;
@@ -562,17 +568,17 @@ _ecore_x_event_handle_button_press(XEvent *xevent)
Eina_Bool replay = EINA_FALSE;
if (_ecore_window_grab_replay_func)
- replay = _ecore_window_grab_replay_func(
- _ecore_window_grab_replay_data,
- ECORE_EVENT_MOUSE_WHEEL,
- e);
+ replay = _ecore_window_grab_replay_func(
+ _ecore_window_grab_replay_data,
+ ECORE_EVENT_MOUSE_WHEEL,
+ e);
if (replay)
- XAllowEvents(xevent->xbutton.display,
- ReplayPointer, xevent->xbutton.time);
+ XAllowEvents(xevent->xbutton.display,
+ ReplayPointer, xevent->xbutton.time);
else
- XAllowEvents(xevent->xbutton.display,
- AsyncPointer, xevent->xbutton.time);
+ XAllowEvents(xevent->xbutton.display,
+ AsyncPointer, xevent->xbutton.time);
break;
}
@@ -601,8 +607,8 @@ _ecore_x_event_handle_button_press(XEvent *xevent)
int window;
window =
- (xevent->xbutton.subwindow ? xevent->xbutton.subwindow : xevent->
- xbutton.window);
+ (xevent->xbutton.subwindow ? xevent->xbutton.subwindow : xevent->
+ xbutton.window);
event_window = xevent->xbutton.window;
e = _ecore_mouse_button(ECORE_EVENT_MOUSE_BUTTON_DOWN,
@@ -629,29 +635,29 @@ _ecore_x_event_handle_button_press(XEvent *xevent)
xevent->xbutton.x_root,
xevent->xbutton.y_root);
if (e)
- for (i = 0; i < _ecore_window_grabs_num; i++)
- {
- if ((_ecore_window_grabs[i] == xevent->xbutton.window) ||
- (_ecore_window_grabs[i] == xevent->xbutton.subwindow))
- {
- Eina_Bool replay = EINA_FALSE;
-
- if (_ecore_window_grab_replay_func)
- replay = _ecore_window_grab_replay_func(
- _ecore_window_grab_replay_data,
- ECORE_EVENT_MOUSE_BUTTON_DOWN,
- e);
-
- if (replay)
- XAllowEvents(xevent->xbutton.display,
- ReplayPointer, xevent->xbutton.time);
- else
- XAllowEvents(xevent->xbutton.display,
- AsyncPointer, xevent->xbutton.time);
-
- break;
- }
- }
+ for (i = 0; i < _ecore_window_grabs_num; i++)
+ {
+ if ((_ecore_window_grabs[i] == xevent->xbutton.window) ||
+ (_ecore_window_grabs[i] == xevent->xbutton.subwindow))
+ {
+ Eina_Bool replay = EINA_FALSE;
+
+ if (_ecore_window_grab_replay_func)
+ replay = _ecore_window_grab_replay_func(
+ _ecore_window_grab_replay_data,
+ ECORE_EVENT_MOUSE_BUTTON_DOWN,
+ e);
+
+ if (replay)
+ XAllowEvents(xevent->xbutton.display,
+ ReplayPointer, xevent->xbutton.time);
+ else
+ XAllowEvents(xevent->xbutton.display,
+ AsyncPointer, xevent->xbutton.time);
+
+ break;
+ }
+ }
}
}
} /* _ecore_x_event_handle_button_press */
@@ -706,26 +712,26 @@ _ecore_x_event_handle_motion_notify(XEvent *xevent)
_ecore_x_last_event_mouse_move_event = NULL;
}
*/
- _ecore_mouse_move(xevent->xmotion.time, xevent->xmotion.state,
- xevent->xmotion.x, xevent->xmotion.y,
- xevent->xmotion.x_root, xevent->xmotion.y_root,
- xevent->xmotion.window,
- (xevent->xmotion.subwindow ? xevent->xmotion.subwindow :
- xevent->xmotion.window),
- xevent->xmotion.root,
- xevent->xmotion.same_screen,
- 0, 1, 1,
- 1.0, // pressure
- 0.0, // angle
- xevent->xmotion.x, xevent->xmotion.y,
- xevent->xmotion.x_root, xevent->xmotion.y_root);
-
- _ecore_x_last_event_mouse_move = 1;
-
- /* Xdnd handling */
- _ecore_x_dnd_drag(xevent->xmotion.root,
- xevent->xmotion.x_root,
- xevent->xmotion.y_root);
+ _ecore_mouse_move(xevent->xmotion.time, xevent->xmotion.state,
+ xevent->xmotion.x, xevent->xmotion.y,
+ xevent->xmotion.x_root, xevent->xmotion.y_root,
+ xevent->xmotion.window,
+ (xevent->xmotion.subwindow ? xevent->xmotion.subwindow :
+ xevent->xmotion.window),
+ xevent->xmotion.root,
+ xevent->xmotion.same_screen,
+ 0, 1, 1,
+ 1.0, // pressure
+ 0.0, // angle
+ xevent->xmotion.x, xevent->xmotion.y,
+ xevent->xmotion.x_root, xevent->xmotion.y_root);
+
+ _ecore_x_last_event_mouse_move = 1;
+
+ /* Xdnd handling */
+ _ecore_x_dnd_drag(xevent->xmotion.root,
+ xevent->xmotion.x_root,
+ xevent->xmotion.y_root);
} /* _ecore_x_event_handle_motion_notify */
void
@@ -752,7 +758,7 @@ _ecore_x_event_handle_enter_notify(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Mouse_In));
if (!e)
- return;
+ return;
e->modifiers = _ecore_x_event_modifiers(xevent->xcrossing.state);
e->x = xevent->xcrossing.x;
@@ -760,31 +766,31 @@ _ecore_x_event_handle_enter_notify(XEvent *xevent)
e->root.x = xevent->xcrossing.x_root;
e->root.y = xevent->xcrossing.y_root;
if (xevent->xcrossing.subwindow)
- e->win = xevent->xcrossing.subwindow;
+ e->win = xevent->xcrossing.subwindow;
else
- e->win = xevent->xcrossing.window;
+ e->win = xevent->xcrossing.window;
e->same_screen = xevent->xcrossing.same_screen;
e->root_win = xevent->xcrossing.root;
e->event_win = xevent->xcrossing.window;
if (xevent->xcrossing.mode == NotifyNormal)
- e->mode = ECORE_X_EVENT_MODE_NORMAL;
+ e->mode = ECORE_X_EVENT_MODE_NORMAL;
else if (xevent->xcrossing.mode == NotifyGrab)
- e->mode = ECORE_X_EVENT_MODE_GRAB;
+ e->mode = ECORE_X_EVENT_MODE_GRAB;
else if (xevent->xcrossing.mode == NotifyUngrab)
- e->mode = ECORE_X_EVENT_MODE_UNGRAB;
+ e->mode = ECORE_X_EVENT_MODE_UNGRAB;
if (xevent->xcrossing.detail == NotifyAncestor)
- e->detail = ECORE_X_EVENT_DETAIL_ANCESTOR;
+ e->detail = ECORE_X_EVENT_DETAIL_ANCESTOR;
else if (xevent->xcrossing.detail == NotifyVirtual)
- e->detail = ECORE_X_EVENT_DETAIL_VIRTUAL;
+ e->detail = ECORE_X_EVENT_DETAIL_VIRTUAL;
else if (xevent->xcrossing.detail == NotifyInferior)
- e->detail = ECORE_X_EVENT_DETAIL_INFERIOR;
+ e->detail = ECORE_X_EVENT_DETAIL_INFERIOR;
else if (xevent->xcrossing.detail == NotifyNonlinear)
- e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR;
+ e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR;
else if (xevent->xcrossing.detail == NotifyNonlinearVirtual)
- e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR_VIRTUAL;
+ e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR_VIRTUAL;
e->time = xevent->xcrossing.time;
_ecore_x_event_last_time = e->time;
@@ -816,7 +822,7 @@ _ecore_x_event_handle_leave_notify(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Mouse_Out));
if (!e)
- return;
+ return;
e->modifiers = _ecore_x_event_modifiers(xevent->xcrossing.state);
e->x = xevent->xcrossing.x;
@@ -824,31 +830,31 @@ _ecore_x_event_handle_leave_notify(XEvent *xevent)
e->root.x = xevent->xcrossing.x_root;
e->root.y = xevent->xcrossing.y_root;
if (xevent->xcrossing.subwindow)
- e->win = xevent->xcrossing.subwindow;
+ e->win = xevent->xcrossing.subwindow;
else
- e->win = xevent->xcrossing.window;
+ e->win = xevent->xcrossing.window;
e->same_screen = xevent->xcrossing.same_screen;
e->root_win = xevent->xcrossing.root;
e->event_win = xevent->xcrossing.window;
if (xevent->xcrossing.mode == NotifyNormal)
- e->mode = ECORE_X_EVENT_MODE_NORMAL;
+ e->mode = ECORE_X_EVENT_MODE_NORMAL;
else if (xevent->xcrossing.mode == NotifyGrab)
- e->mode = ECORE_X_EVENT_MODE_GRAB;
+ e->mode = ECORE_X_EVENT_MODE_GRAB;
else if (xevent->xcrossing.mode == NotifyUngrab)
- e->mode = ECORE_X_EVENT_MODE_UNGRAB;
+ e->mode = ECORE_X_EVENT_MODE_UNGRAB;
if (xevent->xcrossing.detail == NotifyAncestor)
- e->detail = ECORE_X_EVENT_DETAIL_ANCESTOR;
+ e->detail = ECORE_X_EVENT_DETAIL_ANCESTOR;
else if (xevent->xcrossing.detail == NotifyVirtual)
- e->detail = ECORE_X_EVENT_DETAIL_VIRTUAL;
+ e->detail = ECORE_X_EVENT_DETAIL_VIRTUAL;
else if (xevent->xcrossing.detail == NotifyInferior)
- e->detail = ECORE_X_EVENT_DETAIL_INFERIOR;
+ e->detail = ECORE_X_EVENT_DETAIL_INFERIOR;
else if (xevent->xcrossing.detail == NotifyNonlinear)
- e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR;
+ e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR;
else if (xevent->xcrossing.detail == NotifyNonlinearVirtual)
- e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR_VIRTUAL;
+ e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR_VIRTUAL;
e->time = xevent->xcrossing.time;
_ecore_x_event_last_time = e->time;
@@ -868,35 +874,35 @@ _ecore_x_event_handle_focus_in(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Window_Focus_In));
if (!e)
- return;
+ return;
e->win = xevent->xfocus.window;
if (xevent->xfocus.mode == NotifyNormal)
- e->mode = ECORE_X_EVENT_MODE_NORMAL;
+ e->mode = ECORE_X_EVENT_MODE_NORMAL;
else if (xevent->xfocus.mode == NotifyWhileGrabbed)
- e->mode = ECORE_X_EVENT_MODE_WHILE_GRABBED;
+ e->mode = ECORE_X_EVENT_MODE_WHILE_GRABBED;
else if (xevent->xfocus.mode == NotifyGrab)
- e->mode = ECORE_X_EVENT_MODE_GRAB;
+ e->mode = ECORE_X_EVENT_MODE_GRAB;
else if (xevent->xfocus.mode == NotifyUngrab)
- e->mode = ECORE_X_EVENT_MODE_UNGRAB;
+ e->mode = ECORE_X_EVENT_MODE_UNGRAB;
if (xevent->xfocus.detail == NotifyAncestor)
- e->detail = ECORE_X_EVENT_DETAIL_ANCESTOR;
+ e->detail = ECORE_X_EVENT_DETAIL_ANCESTOR;
else if (xevent->xfocus.detail == NotifyVirtual)
- e->detail = ECORE_X_EVENT_DETAIL_VIRTUAL;
+ e->detail = ECORE_X_EVENT_DETAIL_VIRTUAL;
else if (xevent->xfocus.detail == NotifyInferior)
- e->detail = ECORE_X_EVENT_DETAIL_INFERIOR;
+ e->detail = ECORE_X_EVENT_DETAIL_INFERIOR;
else if (xevent->xfocus.detail == NotifyNonlinear)
- e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR;
+ e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR;
else if (xevent->xfocus.detail == NotifyNonlinearVirtual)
- e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR_VIRTUAL;
+ e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR_VIRTUAL;
else if (xevent->xfocus.detail == NotifyPointer)
- e->detail = ECORE_X_EVENT_DETAIL_POINTER;
+ e->detail = ECORE_X_EVENT_DETAIL_POINTER;
else if (xevent->xfocus.detail == NotifyPointerRoot)
- e->detail = ECORE_X_EVENT_DETAIL_POINTER_ROOT;
+ e->detail = ECORE_X_EVENT_DETAIL_POINTER_ROOT;
else if (xevent->xfocus.detail == NotifyDetailNone)
- e->detail = ECORE_X_EVENT_DETAIL_DETAIL_NONE;
+ e->detail = ECORE_X_EVENT_DETAIL_DETAIL_NONE;
e->time = _ecore_x_event_last_time;
_ecore_x_event_last_time = e->time;
@@ -912,35 +918,35 @@ _ecore_x_event_handle_focus_out(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Window_Focus_Out));
if (!e)
- return;
+ return;
e->win = xevent->xfocus.window;
if (xevent->xfocus.mode == NotifyNormal)
- e->mode = ECORE_X_EVENT_MODE_NORMAL;
+ e->mode = ECORE_X_EVENT_MODE_NORMAL;
else if (xevent->xfocus.mode == NotifyWhileGrabbed)
- e->mode = ECORE_X_EVENT_MODE_WHILE_GRABBED;
+ e->mode = ECORE_X_EVENT_MODE_WHILE_GRABBED;
else if (xevent->xfocus.mode == NotifyGrab)
- e->mode = ECORE_X_EVENT_MODE_GRAB;
+ e->mode = ECORE_X_EVENT_MODE_GRAB;
else if (xevent->xfocus.mode == NotifyUngrab)
- e->mode = ECORE_X_EVENT_MODE_UNGRAB;
+ e->mode = ECORE_X_EVENT_MODE_UNGRAB;
if (xevent->xfocus.detail == NotifyAncestor)
- e->detail = ECORE_X_EVENT_DETAIL_ANCESTOR;
+ e->detail = ECORE_X_EVENT_DETAIL_ANCESTOR;
else if (xevent->xfocus.detail == NotifyVirtual)
- e->detail = ECORE_X_EVENT_DETAIL_VIRTUAL;
+ e->detail = ECORE_X_EVENT_DETAIL_VIRTUAL;
else if (xevent->xfocus.detail == NotifyInferior)
- e->detail = ECORE_X_EVENT_DETAIL_INFERIOR;
+ e->detail = ECORE_X_EVENT_DETAIL_INFERIOR;
else if (xevent->xfocus.detail == NotifyNonlinear)
- e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR;
+ e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR;
else if (xevent->xfocus.detail == NotifyNonlinearVirtual)
- e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR_VIRTUAL;
+ e->detail = ECORE_X_EVENT_DETAIL_NON_LINEAR_VIRTUAL;
else if (xevent->xfocus.detail == NotifyPointer)
- e->detail = ECORE_X_EVENT_DETAIL_POINTER;
+ e->detail = ECORE_X_EVENT_DETAIL_POINTER;
else if (xevent->xfocus.detail == NotifyPointerRoot)
- e->detail = ECORE_X_EVENT_DETAIL_POINTER_ROOT;
+ e->detail = ECORE_X_EVENT_DETAIL_POINTER_ROOT;
else if (xevent->xfocus.detail == NotifyDetailNone)
- e->detail = ECORE_X_EVENT_DETAIL_DETAIL_NONE;
+ e->detail = ECORE_X_EVENT_DETAIL_DETAIL_NONE;
e->time = _ecore_x_event_last_time;
_ecore_x_event_last_time = e->time;
@@ -962,7 +968,7 @@ _ecore_x_event_handle_expose(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
e = calloc(1, sizeof(Ecore_X_Event_Window_Damage));
if (!e)
- return;
+ return;
e->win = xevent->xexpose.window;
e->time = _ecore_x_event_last_time;
@@ -982,7 +988,7 @@ _ecore_x_event_handle_graphics_expose(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
e = calloc(1, sizeof(Ecore_X_Event_Window_Damage));
if (!e)
- return;
+ return;
e->win = xevent->xgraphicsexpose.drawable;
e->time = _ecore_x_event_last_time;
@@ -1004,14 +1010,14 @@ _ecore_x_event_handle_visibility_notify(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Window_Visibility_Change));
if (!e)
- return;
+ return;
e->win = xevent->xvisibility.window;
e->time = _ecore_x_event_last_time;
if (xevent->xvisibility.state == VisibilityFullyObscured)
- e->fully_obscured = 1;
+ e->fully_obscured = 1;
else
- e->fully_obscured = 0;
+ e->fully_obscured = 0;
ecore_event_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, e, NULL, NULL);
}
@@ -1025,14 +1031,14 @@ _ecore_x_event_handle_create_notify(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
e = calloc(1, sizeof(Ecore_X_Event_Window_Create));
if (!e)
- return;
+ return;
e->win = xevent->xcreatewindow.window;
e->parent = xevent->xcreatewindow.parent;
if (xevent->xcreatewindow.override_redirect)
- e->override = 1;
+ e->override = 1;
else
- e->override = 0;
+ e->override = 0;
e->x = xevent->xcreatewindow.x;
e->y = xevent->xcreatewindow.y;
@@ -1051,13 +1057,13 @@ _ecore_x_event_handle_destroy_notify(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
e = calloc(1, sizeof(Ecore_X_Event_Window_Destroy));
if (!e)
- return;
+ return;
e->win = xevent->xdestroywindow.window;
e->event_win = xevent->xdestroywindow.event;
e->time = _ecore_x_event_last_time;
if (e->win == _ecore_x_event_last_win)
- _ecore_x_event_last_win = 0;
+ _ecore_x_event_last_win = 0;
ecore_event_add(ECORE_X_EVENT_WINDOW_DESTROY, e, NULL, NULL);
} /* _ecore_x_event_handle_destroy_notify */
@@ -1070,7 +1076,7 @@ _ecore_x_event_handle_unmap_notify(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
e = calloc(1, sizeof(Ecore_X_Event_Window_Hide));
if (!e)
- return;
+ return;
e->win = xevent->xunmap.window;
e->event_win = xevent->xunmap.event;
@@ -1086,7 +1092,7 @@ _ecore_x_event_handle_map_notify(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
e = calloc(1, sizeof(Ecore_X_Event_Window_Show));
if (!e)
- return;
+ return;
e->win = xevent->xmap.window;
e->event_win = xevent->xmap.event;
@@ -1102,7 +1108,7 @@ _ecore_x_event_handle_map_request(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
e = calloc(1, sizeof(Ecore_X_Event_Window_Show_Request));
if (!e)
- return;
+ return;
e->win = xevent->xmaprequest.window;
e->time = _ecore_x_event_last_time;
@@ -1118,7 +1124,7 @@ _ecore_x_event_handle_reparent_notify(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
e = calloc(1, sizeof(Ecore_X_Event_Window_Reparent));
if (!e)
- return;
+ return;
e->win = xevent->xreparent.window;
e->event_win = xevent->xreparent.event;
@@ -1135,7 +1141,7 @@ _ecore_x_event_handle_configure_notify(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
e = calloc(1, sizeof(Ecore_X_Event_Window_Configure));
if (!e)
- return;
+ return;
e->win = xevent->xconfigure.window;
e->event_win = xevent->xconfigure.event;
@@ -1159,7 +1165,7 @@ _ecore_x_event_handle_configure_request(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
e = calloc(1, sizeof(Ecore_X_Event_Window_Configure_Request));
if (!e)
- return;
+ return;
e->win = xevent->xconfigurerequest.window;
e->parent_win = xevent->xconfigurerequest.parent;
@@ -1173,15 +1179,15 @@ _ecore_x_event_handle_configure_request(XEvent *xevent)
e->time = _ecore_x_event_last_time;
if (xevent->xconfigurerequest.detail == Above)
- e->detail = ECORE_X_WINDOW_STACK_ABOVE;
+ e->detail = ECORE_X_WINDOW_STACK_ABOVE;
else if (xevent->xconfigurerequest.detail == Below)
- e->detail = ECORE_X_WINDOW_STACK_BELOW;
+ e->detail = ECORE_X_WINDOW_STACK_BELOW;
else if (xevent->xconfigurerequest.detail == TopIf)
- e->detail = ECORE_X_WINDOW_STACK_TOP_IF;
+ e->detail = ECORE_X_WINDOW_STACK_TOP_IF;
else if (xevent->xconfigurerequest.detail == BottomIf)
- e->detail = ECORE_X_WINDOW_STACK_BOTTOM_IF;
+ e->detail = ECORE_X_WINDOW_STACK_BOTTOM_IF;
else if (xevent->xconfigurerequest.detail == Opposite)
- e->detail = ECORE_X_WINDOW_STACK_OPPOSITE;
+ e->detail = ECORE_X_WINDOW_STACK_OPPOSITE;
ecore_event_add(ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST, e, NULL, NULL);
} /* _ecore_x_event_handle_configure_request */
@@ -1201,7 +1207,7 @@ _ecore_x_event_handle_resize_request(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
e = calloc(1, sizeof(Ecore_X_Event_Window_Resize_Request));
if (!e)
- return;
+ return;
e->win = xevent->xresizerequest.window;
e->w = xevent->xresizerequest.width;
@@ -1218,14 +1224,14 @@ _ecore_x_event_handle_circulate_notify(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
e = calloc(1, sizeof(Ecore_X_Event_Window_Stack));
if (!e)
- return;
+ return;
e->win = xevent->xcirculate.window;
e->event_win = xevent->xcirculate.event;
if (xevent->xcirculate.place == PlaceOnTop)
- e->detail = ECORE_X_WINDOW_STACK_ABOVE;
+ e->detail = ECORE_X_WINDOW_STACK_ABOVE;
else
- e->detail = ECORE_X_WINDOW_STACK_BELOW;
+ e->detail = ECORE_X_WINDOW_STACK_BELOW;
e->time = _ecore_x_event_last_time;
ecore_event_add(ECORE_X_EVENT_WINDOW_STACK, e, NULL, NULL);
@@ -1239,14 +1245,14 @@ _ecore_x_event_handle_circulate_request(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
e = calloc(1, sizeof(Ecore_X_Event_Window_Stack_Request));
if (!e)
- return;
+ return;
e->win = xevent->xcirculaterequest.window;
e->parent = xevent->xcirculaterequest.parent;
if (xevent->xcirculaterequest.place == PlaceOnTop)
- e->detail = ECORE_X_WINDOW_STACK_ABOVE;
+ e->detail = ECORE_X_WINDOW_STACK_ABOVE;
else
- e->detail = ECORE_X_WINDOW_STACK_BELOW;
+ e->detail = ECORE_X_WINDOW_STACK_BELOW;
e->time = _ecore_x_event_last_time;
ecore_event_add(ECORE_X_EVENT_WINDOW_STACK_REQUEST, e, NULL, NULL);
@@ -1261,7 +1267,7 @@ _ecore_x_event_handle_property_notify(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Window_Property));
if (!e)
- return;
+ return;
e->win = xevent->xproperty.window;
e->atom = xevent->xproperty.atom;
@@ -1275,11 +1281,11 @@ void
_ecore_x_event_handle_selection_clear(XEvent *xevent)
{
// Ecore_X_Selection_Intern *d;
- Ecore_X_Event_Selection_Clear *e;
- Ecore_X_Atom sel;
+ Ecore_X_Event_Selection_Clear *e;
+ Ecore_X_Atom sel;
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
- _ecore_x_last_event_mouse_move = 0;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ _ecore_x_last_event_mouse_move = 0;
/* errr..... why? paranoia.
d = _ecore_x_selection_get(xevent->xselectionclear.selection);
if (d && (xevent->xselectionclear.time > d->time))
@@ -1289,20 +1295,20 @@ _ecore_x_event_handle_selection_clear(XEvent *xevent)
}
*/
/* Generate event for app cleanup */
- e = malloc(sizeof(Ecore_X_Event_Selection_Clear));
- e->win = xevent->xselectionclear.window;
- e->time = xevent->xselectionclear.time;
- e->atom = sel = xevent->xselectionclear.selection;
- if (sel == ECORE_X_ATOM_SELECTION_PRIMARY)
- e->selection = ECORE_X_SELECTION_PRIMARY;
- else if (sel == ECORE_X_ATOM_SELECTION_SECONDARY)
- e->selection = ECORE_X_SELECTION_SECONDARY;
- else if (sel == ECORE_X_ATOM_SELECTION_CLIPBOARD)
- e->selection = ECORE_X_SELECTION_CLIPBOARD;
- else
- e->selection = ECORE_X_SELECTION_OTHER;
-
- ecore_event_add(ECORE_X_EVENT_SELECTION_CLEAR, e, NULL, NULL);
+ e = malloc(sizeof(Ecore_X_Event_Selection_Clear));
+ e->win = xevent->xselectionclear.window;
+ e->time = xevent->xselectionclear.time;
+ e->atom = sel = xevent->xselectionclear.selection;
+ if (sel == ECORE_X_ATOM_SELECTION_PRIMARY)
+ e->selection = ECORE_X_SELECTION_PRIMARY;
+ else if (sel == ECORE_X_ATOM_SELECTION_SECONDARY)
+ e->selection = ECORE_X_SELECTION_SECONDARY;
+ else if (sel == ECORE_X_ATOM_SELECTION_CLIPBOARD)
+ e->selection = ECORE_X_SELECTION_CLIPBOARD;
+ else
+ e->selection = ECORE_X_SELECTION_OTHER;
+
+ ecore_event_add(ECORE_X_EVENT_SELECTION_CLEAR, e, NULL, NULL);
} /* _ecore_x_event_handle_selection_clear */
void
@@ -1347,12 +1353,12 @@ _ecore_x_event_handle_selection_request(XEvent *xevent)
if (!ecore_x_selection_convert(xevent->xselectionrequest.selection,
xevent->xselectionrequest.target,
&data, &len, &type, &typesize))
- /* Refuse selection, conversion to requested target failed */
- property = None;
+ /* Refuse selection, conversion to requested target failed */
+ property = None;
else if (data)
{
- /* FIXME: This does not properly handle large data transfers */
- ecore_x_window_prop_property_set(
+ /* FIXME: This does not properly handle large data transfers */
+ ecore_x_window_prop_property_set(
xevent->xselectionrequest.requestor,
xevent->xselectionrequest.
property,
@@ -1360,8 +1366,8 @@ _ecore_x_event_handle_selection_request(XEvent *xevent)
typesize,
data,
len);
- property = xevent->xselectionrequest.property;
- free(data);
+ property = xevent->xselectionrequest.property;
+ free(data);
}
ecore_x_selection_notify_send(xevent->xselectionrequest.requestor,
@@ -1391,7 +1397,7 @@ _ecore_x_event_handle_selection_notify(XEvent *xevent)
xevent->xselection.property,
XA_ATOM, 32, &data, &num_ret);
if (!format)
- return;
+ return;
}
else
{
@@ -1400,12 +1406,12 @@ _ecore_x_event_handle_selection_notify(XEvent *xevent)
AnyPropertyType, 8, &data,
&num_ret);
if (!format)
- return;
+ return;
}
e = calloc(1, sizeof(Ecore_X_Event_Selection_Notify));
if (!e)
- return;
+ return;
e->win = xevent->xselection.requestor;
e->time = xevent->xselection.time;
@@ -1413,15 +1419,15 @@ _ecore_x_event_handle_selection_notify(XEvent *xevent)
e->target = _ecore_x_selection_target_get(xevent->xselection.target);
if (selection == ECORE_X_ATOM_SELECTION_PRIMARY)
- e->selection = ECORE_X_SELECTION_PRIMARY;
+ e->selection = ECORE_X_SELECTION_PRIMARY;
else if (selection == ECORE_X_ATOM_SELECTION_SECONDARY)
- e->selection = ECORE_X_SELECTION_SECONDARY;
+ e->selection = ECORE_X_SELECTION_SECONDARY;
else if (selection == ECORE_X_ATOM_SELECTION_XDND)
- e->selection = ECORE_X_SELECTION_XDND;
+ e->selection = ECORE_X_SELECTION_XDND;
else if (selection == ECORE_X_ATOM_SELECTION_CLIPBOARD)
- e->selection = ECORE_X_SELECTION_CLIPBOARD;
+ e->selection = ECORE_X_SELECTION_CLIPBOARD;
else
- e->selection = ECORE_X_SELECTION_OTHER;
+ e->selection = ECORE_X_SELECTION_OTHER;
e->data = _ecore_x_selection_parse(e->target, data, num_ret, format);
@@ -1435,17 +1441,17 @@ _ecore_x_event_handle_colormap_notify(XEvent *xevent)
Ecore_X_Event_Window_Colormap *e;
_ecore_x_last_event_mouse_move = 0;
- e = calloc(1,sizeof(Ecore_X_Event_Window_Colormap));
+ e = calloc(1, sizeof(Ecore_X_Event_Window_Colormap));
if (!e)
- return;
+ return;
e->win = xevent->xcolormap.window;
e->cmap = xevent->xcolormap.colormap;
e->time = _ecore_x_event_last_time;
if (xevent->xcolormap.state == ColormapInstalled)
- e->installed = EINA_TRUE;
+ e->installed = EINA_TRUE;
else
- e->installed = EINA_FALSE;
+ e->installed = EINA_FALSE;
ecore_event_add(ECORE_X_EVENT_WINDOW_COLORMAP, e, NULL, NULL);
} /* _ecore_x_event_handle_colormap_notify */
@@ -1466,7 +1472,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Window_Delete_Request));
if (!e)
- return;
+ return;
e->win = xevent->xclient.window;
e->time = _ecore_x_event_last_time;
@@ -1481,7 +1487,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Window_Move_Resize_Request));
if (!e)
- return;
+ return;
e->win = xevent->xclient.window;
e->x = xevent->xclient.data.l[0];
@@ -1519,32 +1525,32 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
if (xevent->xclient.data.l[1] & 0x1UL)
{
/* source supports more than 3 types, fetch property */
- unsigned char *data;
- Ecore_X_Atom *types;
- int i, num_ret;
-
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!(ecore_x_window_prop_property_get(target->source,
- ECORE_X_ATOM_XDND_TYPE_LIST,
- XA_ATOM,
- 32, &data, &num_ret)))
- {
- WRN(
+ unsigned char *data;
+ Ecore_X_Atom *types;
+ int i, num_ret;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (!(ecore_x_window_prop_property_get(target->source,
+ ECORE_X_ATOM_XDND_TYPE_LIST,
+ XA_ATOM,
+ 32, &data, &num_ret)))
+ {
+ WRN(
"DND: Could not fetch data type list from source window, aborting.");
- free(e);
- return;
- }
+ free(e);
+ return;
+ }
- types = (Ecore_X_Atom *)data;
- e->types = calloc(num_ret, sizeof(char *));
- if (e->types)
- {
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
- for (i = 0; i < num_ret; i++)
+ types = (Ecore_X_Atom *)data;
+ e->types = calloc(num_ret, sizeof(char *));
+ if (e->types)
+ {
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ for (i = 0; i < num_ret; i++)
e->types[i] = XGetAtomName(_ecore_x_disp, types[i]);
- }
+ }
- e->num_types = num_ret;
+ e->num_types = num_ret;
}
else
{
@@ -1678,7 +1684,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
return;
target->time = (target->version >= 1) ?
- (Time)xevent->xclient.data.l[2] : _ecore_x_event_last_time;
+ (Time)xevent->xclient.data.l[2] : _ecore_x_event_last_time;
e = calloc(1, sizeof(Ecore_X_Event_Xdnd_Drop));
if (!e) return;
@@ -1749,11 +1755,11 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
e->win = xevent->xclient.window;
if (xevent->xclient.data.l[0] == 0)
- e->action = ECORE_X_WINDOW_STATE_ACTION_REMOVE;
+ e->action = ECORE_X_WINDOW_STATE_ACTION_REMOVE;
else if (xevent->xclient.data.l[0] == 1)
- e->action = ECORE_X_WINDOW_STATE_ACTION_ADD;
+ e->action = ECORE_X_WINDOW_STATE_ACTION_ADD;
else if (xevent->xclient.data.l[0] == 2)
- e->action = ECORE_X_WINDOW_STATE_ACTION_TOGGLE;
+ e->action = ECORE_X_WINDOW_STATE_ACTION_TOGGLE;
else
{
free(e);
@@ -1765,7 +1771,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
if (e->state[0] == ECORE_X_WINDOW_STATE_UNKNOWN)
{
// char *name;
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
// name = XGetAtomName(_ecore_x_disp, xevent->xclient.data.l[1]);
// if (name) ERR("Unknown state: %s", name);
@@ -1775,7 +1781,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
if (e->state[1] == ECORE_X_WINDOW_STATE_UNKNOWN)
{
// char *name;
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
// name = XGetAtomName(_ecore_x_disp, xevent->xclient.data.l[2]);
// if (name) ERR("Unknown state: %s", name);
@@ -1794,7 +1800,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Window_State_Request));
if (!e)
- return;
+ return;
e->win = xevent->xclient.window;
e->action = ECORE_X_WINDOW_STATE_ACTION_ADD;
@@ -1809,7 +1815,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Desktop_Change));
if (!e)
- return;
+ return;
e->win = xevent->xclient.window;
e->desk = xevent->xclient.data.l[0];
@@ -1824,7 +1830,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Frame_Extents_Request));
if (!e)
- return;
+ return;
e->win = xevent->xclient.window;
@@ -1840,7 +1846,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Ping));
if (!e)
- return;
+ return;
e->win = xevent->xclient.window;
e->time = xevent->xclient.data.l[1];
@@ -1854,7 +1860,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
root = ecore_x_window_root_get(e->win);
}
else
- root = DefaultRootWindow(_ecore_x_disp);
+ root = DefaultRootWindow(_ecore_x_disp);
if (xevent->xclient.window != root)
{
@@ -1867,21 +1873,21 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
else if ((xevent->xclient.message_type ==
ECORE_X_ATOM_NET_STARTUP_INFO_BEGIN) &&
(xevent->xclient.format == 8))
- _ecore_x_netwm_startup_info_begin(xevent->xclient.window,
- xevent->xclient.data.b);
+ _ecore_x_netwm_startup_info_begin(xevent->xclient.window,
+ xevent->xclient.data.b);
else if ((xevent->xclient.message_type == ECORE_X_ATOM_NET_STARTUP_INFO) &&
(xevent->xclient.format == 8))
- _ecore_x_netwm_startup_info(xevent->xclient.window,
- xevent->xclient.data.b);
+ _ecore_x_netwm_startup_info(xevent->xclient.window,
+ xevent->xclient.data.b);
else if ((xevent->xclient.message_type == 27777)
&& (xevent->xclient.data.l[0] == 0x7162534)
&& (xevent->xclient.format == 32)
&& (xevent->xclient.window == _ecore_x_private_win))
{
/* a grab sync marker */
- if (xevent->xclient.data.l[1] == 0x10000001)
+ if (xevent->xclient.data.l[1] == 0x10000001)
_ecore_x_window_grab_remove(xevent->xclient.data.l[2]);
- else if (xevent->xclient.data.l[1] == 0x10000002)
+ else if (xevent->xclient.data.l[1] == 0x10000002)
_ecore_x_key_grab_remove(xevent->xclient.data.l[2]);
}
else
@@ -1891,13 +1897,13 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Client_Message));
if (!e)
- return;
+ return;
e->win = xevent->xclient.window;
e->message_type = xevent->xclient.message_type;
e->format = xevent->xclient.format;
for (i = 0; i < 5; i++)
- e->data.l[i] = xevent->xclient.data.l[i];
+ e->data.l[i] = xevent->xclient.data.l[i];
ecore_event_add(ECORE_X_EVENT_CLIENT_MESSAGE, e, NULL, NULL);
}
@@ -1914,18 +1920,20 @@ _ecore_x_event_handle_mapping_notify(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Mapping_Change));
if (!e) return;
switch (xevent->xmapping.request)
- {
+ {
case MappingModifier:
- e->type = ECORE_X_MAPPING_MODIFIER;
- break;
+ e->type = ECORE_X_MAPPING_MODIFIER;
+ break;
+
case MappingKeyboard:
- e->type = ECORE_X_MAPPING_KEYBOARD;
- break;
+ e->type = ECORE_X_MAPPING_KEYBOARD;
+ break;
+
case MappingPointer:
default:
- e->type = ECORE_X_MAPPING_MOUSE;
- break;
- }
+ e->type = ECORE_X_MAPPING_MOUSE;
+ break;
+ }
e->keycode = xevent->xmapping.first_keycode;
e->num = xevent->xmapping.count;
ecore_event_add(ECORE_X_EVENT_MAPPING_CHANGE, e, NULL, NULL);
@@ -1941,22 +1949,25 @@ _ecore_x_event_handle_shape_change(XEvent *xevent)
shape_event = (XShapeEvent *)xevent;
e = calloc(1, sizeof(Ecore_X_Event_Window_Shape));
if (!e)
- return;
+ return;
e->win = shape_event->window;
e->time = shape_event->time;
switch (shape_event->kind)
{
- case ShapeBounding:
+ case ShapeBounding:
e->type = ECORE_X_SHAPE_BOUNDING;
break;
- case ShapeClip:
+
+ case ShapeClip:
e->type = ECORE_X_SHAPE_CLIP;
break;
- case ShapeInput:
+
+ case ShapeInput:
e->type = ECORE_X_SHAPE_INPUT;
break;
- default:
+
+ default:
break;
}
e->x = shape_event->x;
@@ -1978,13 +1989,13 @@ _ecore_x_event_handle_screensaver_notify(XEvent *xevent)
screensaver_event = (XScreenSaverNotifyEvent *)xevent;
e = calloc(1, sizeof(Ecore_X_Event_Screensaver_Notify));
if (!e)
- return;
+ return;
e->win = screensaver_event->window;
if (screensaver_event->state == ScreenSaverOn)
- e->on = EINA_TRUE;
+ e->on = EINA_TRUE;
else
- e->on = EINA_FALSE;
+ e->on = EINA_FALSE;
e->time = screensaver_event->time;
ecore_event_add(ECORE_X_EVENT_SCREENSAVER_NOTIFY, e, NULL, NULL);
@@ -2003,7 +2014,7 @@ _ecore_x_event_handle_sync_counter(XEvent *xevent)
sync_counter_event = (XSyncCounterNotifyEvent *)xevent;
e = calloc(1, sizeof(Ecore_X_Event_Sync_Counter));
if (!e)
- return;
+ return;
e->time = sync_counter_event->time;
ecore_event_add(ECORE_X_EVENT_SYNC_COUNTER, e, NULL, NULL);
@@ -2020,7 +2031,7 @@ _ecore_x_event_handle_sync_alarm(XEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Sync_Alarm));
if (!e)
- return;
+ return;
e->time = sync_alarm_event->time;
e->alarm = sync_alarm_event->alarm;
@@ -2037,11 +2048,11 @@ _ecore_x_event_handle_randr_change(XEvent *xevent)
_ecore_x_last_event_mouse_move = 0;
randr_event = (XRRScreenChangeNotifyEvent *)xevent;
if (!XRRUpdateConfiguration(xevent))
- ERR("Can't update RR config!");
+ ERR("Can't update RR config!");
e = calloc(1, sizeof(Ecore_X_Event_Screen_Change));
if (!e)
- return;
+ return;
e->win = randr_event->window;
e->root = randr_event->root;
@@ -2066,7 +2077,7 @@ _ecore_x_event_handle_randr_notify_crtc_change(const XRRNotifyEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Randr_Crtc_Change));
if (!e)
- return;
+ return;
e->win = randr_event->window;
e->crtc = randr_event->crtc;
@@ -2089,7 +2100,7 @@ _ecore_x_event_handle_randr_notify_output_change(const XRRNotifyEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Randr_Output_Change));
if (!e)
- return;
+ return;
e->win = randr_event->window;
e->output = randr_event->output;
@@ -2111,16 +2122,16 @@ _ecore_x_event_handle_randr_notify_output_property(const XRRNotifyEvent *xevent)
e = calloc(1, sizeof(Ecore_X_Event_Randr_Output_Property_Notify));
if (!e)
- return;
+ return;
e->win = randr_event->window;
e->output = randr_event->output;
e->property = randr_event->property;
e->time = randr_event->timestamp;
if (randr_event->state == PropertyNewValue)
- e->state = ECORE_X_RANDR_PROPERTY_CHANGE_ADD;
+ e->state = ECORE_X_RANDR_PROPERTY_CHANGE_ADD;
else
- e->state = ECORE_X_RANDR_PROPERTY_CHANGE_DEL;
+ e->state = ECORE_X_RANDR_PROPERTY_CHANGE_DEL;
ecore_event_add(ECORE_X_EVENT_RANDR_OUTPUT_PROPERTY_NOTIFY, e, NULL, NULL);
} /* _ecore_x_event_handle_randr_notify_output_property */
@@ -2135,21 +2146,21 @@ _ecore_x_event_handle_randr_notify(XEvent *xevent)
switch (randr_event->subtype)
{
case RRNotify_CrtcChange:
- _ecore_x_event_handle_randr_notify_crtc_change(randr_event);
- break;
+ _ecore_x_event_handle_randr_notify_crtc_change(randr_event);
+ break;
case RRNotify_OutputChange:
- _ecore_x_event_handle_randr_notify_output_change(randr_event);
- break;
+ _ecore_x_event_handle_randr_notify_output_change(randr_event);
+ break;
case RRNotify_OutputProperty:
- _ecore_x_event_handle_randr_notify_output_property(randr_event);
- break;
+ _ecore_x_event_handle_randr_notify_output_property(randr_event);
+ break;
default:
- ERR("Unknown XRandR RRNotify subtype: %d.",
- randr_event->subtype);
- break;
+ ERR("Unknown XRandR RRNotify subtype: %d.",
+ randr_event->subtype);
+ break;
} /* switch */
} /* _ecore_x_event_handle_randr_notify */
@@ -2160,7 +2171,7 @@ void
_ecore_x_event_handle_fixes_selection_notify(XEvent *event)
{
XFixesSelectionNotifyEvent *notify_event =
- (XFixesSelectionNotifyEvent *) event;
+ (XFixesSelectionNotifyEvent *)event;
Ecore_X_Event_Fixes_Selection_Notify *e;
Ecore_X_Atom sel;
@@ -2169,7 +2180,7 @@ _ecore_x_event_handle_fixes_selection_notify(XEvent *event)
e = calloc(1, sizeof(*e));
if (!e)
- return;
+ return;
e->win = notify_event->window;
e->owner = notify_event->owner;
@@ -2177,13 +2188,13 @@ _ecore_x_event_handle_fixes_selection_notify(XEvent *event)
e->selection_time = notify_event->selection_timestamp;
e->atom = sel = notify_event->selection;
if (sel == ECORE_X_ATOM_SELECTION_PRIMARY)
- e->selection = ECORE_X_SELECTION_PRIMARY;
+ e->selection = ECORE_X_SELECTION_PRIMARY;
else if (sel == ECORE_X_ATOM_SELECTION_SECONDARY)
- e->selection = ECORE_X_SELECTION_SECONDARY;
+ e->selection = ECORE_X_SELECTION_SECONDARY;
else if (sel == ECORE_X_ATOM_SELECTION_CLIPBOARD)
- e->selection = ECORE_X_SELECTION_CLIPBOARD;
+ e->selection = ECORE_X_SELECTION_CLIPBOARD;
else
- e->selection = ECORE_X_SELECTION_OTHER;
+ e->selection = ECORE_X_SELECTION_OTHER;
e->reason = notify_event->subtype;
ecore_event_add(ECORE_X_EVENT_FIXES_SELECTION_NOTIFY, e, NULL, NULL);
@@ -2203,7 +2214,7 @@ _ecore_x_event_handle_damage_notify(XEvent *event)
e = calloc(1, sizeof(Ecore_X_Event_Damage));
if (!e)
- return;
+ return;
e->level = damage_event->level;
e->drawable = damage_event->drawable;
@@ -2225,7 +2236,8 @@ _ecore_x_event_handle_damage_notify(XEvent *event)
#endif /* ifdef ECORE_XDAMAGE */
static void
-_ecore_x_event_free_generic_event(void *data, void *ev)
+_ecore_x_event_free_generic_event(void *data,
+ void *ev)
{
#ifdef ECORE_XI2
Ecore_X_Event_Generic *e = (Ecore_X_Event_Generic *)ev;
@@ -2233,11 +2245,11 @@ _ecore_x_event_free_generic_event(void *data, void *ev)
if (data)
{
if (e->data)
- XFreeEventData(_ecore_x_disp, (XGenericEventCookie *)data);
+ XFreeEventData(_ecore_x_disp, (XGenericEventCookie *)data);
free(data);
}
free(e);
-#else
+#else
return;
data = NULL; ev = NULL;
#endif /* ifdef ECORE_XI2 */
@@ -2250,13 +2262,13 @@ _ecore_x_event_handle_generic_event(XEvent *event)
XGenericEvent *generic_event;
Ecore_X_Event_Generic *e;
XGenericEventCookie *data;
-
+
LOGFN(__FILE__, __LINE__, __FUNCTION__);
generic_event = (XGenericEvent *)event;
e = calloc(1, sizeof(Ecore_X_Event_Generic));
if (!e)
- return;
+ return;
if (XGetEventData(_ecore_x_disp, &(event->xcookie)))
{
@@ -2273,8 +2285,8 @@ _ecore_x_event_handle_generic_event(XEvent *event)
e->evtype = generic_event->evtype;
if (e->extension == _ecore_x_xi2_opcode)
- _ecore_x_input_handler(event);
-
+ _ecore_x_input_handler(event);
+
data = malloc(sizeof(XGenericEventCookie));
if (data) memcpy(data, &(event->xcookie), sizeof(XGenericEventCookie));
ecore_event_add(ECORE_X_EVENT_GENERIC,
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c
index 7bed783285..e81af136a1 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_fixes.c
@@ -27,7 +27,7 @@ _ecore_x_fixes_init(void)
ECORE_X_EVENT_FIXES_SELECTION_NOTIFY = ecore_event_type_new();
}
else
- _fixes_available = 0;
+ _fixes_available = 0;
#else /* ifdef ECORE_XFIXES */
_fixes_available = 0;
@@ -37,17 +37,18 @@ _ecore_x_fixes_init(void)
#ifdef ECORE_XFIXES
/* I don't know what to call this function. */
static XRectangle *
-_ecore_x_rectangle_ecore_to_x(Ecore_X_Rectangle *rects, int num)
+_ecore_x_rectangle_ecore_to_x(Ecore_X_Rectangle *rects,
+ int num)
{
XRectangle *xrect;
int i;
if (num == 0)
- return NULL;
+ return NULL;
xrect = malloc(sizeof(XRectangle) * num);
if (!xrect)
- return NULL;
+ return NULL;
for (i = 0; i < num; i++)
{
@@ -60,17 +61,18 @@ _ecore_x_rectangle_ecore_to_x(Ecore_X_Rectangle *rects, int num)
} /* _ecore_x_rectangle_ecore_to_x */
static Ecore_X_Rectangle *
-_ecore_x_rectangle_x_to_ecore(XRectangle *xrect, int num)
+_ecore_x_rectangle_x_to_ecore(XRectangle *xrect,
+ int num)
{
Ecore_X_Rectangle *rects;
int i;
if (num == 0)
- return NULL;
+ return NULL;
rects = malloc(sizeof(Ecore_X_Rectangle) * num);
if (!rects)
- return NULL;
+ return NULL;
for (i = 0; i < num; i++)
{
@@ -91,11 +93,11 @@ ecore_x_fixes_selection_notification_request(Ecore_X_Atom selection)
if (_fixes_available)
{
XFixesSelectSelectionInput (_ecore_x_disp,
- DefaultRootWindow(_ecore_x_disp),
- selection,
- XFixesSetSelectionOwnerNotifyMask |
- XFixesSelectionWindowDestroyNotifyMask |
- XFixesSelectionClientCloseNotifyMask);
+ DefaultRootWindow(_ecore_x_disp),
+ selection,
+ XFixesSetSelectionOwnerNotifyMask |
+ XFixesSelectionWindowDestroyNotifyMask |
+ XFixesSelectionClientCloseNotifyMask);
return EINA_TRUE;
}
#endif
@@ -103,7 +105,8 @@ ecore_x_fixes_selection_notification_request(Ecore_X_Atom selection)
}
EAPI Ecore_X_Region
-ecore_x_region_new(Ecore_X_Rectangle *rects, int num)
+ecore_x_region_new(Ecore_X_Rectangle *rects,
+ int num)
{
#ifdef ECORE_XFIXES
Ecore_X_Region region;
@@ -134,7 +137,8 @@ ecore_x_region_new_from_bitmap(Ecore_X_Pixmap bitmap)
} /* ecore_x_region_new_from_bitmap */
EAPI Ecore_X_Region
-ecore_x_region_new_from_window(Ecore_X_Window win, Ecore_X_Region_Type type)
+ecore_x_region_new_from_window(Ecore_X_Window win,
+ Ecore_X_Region_Type type)
{
#ifdef ECORE_XFIXES
Ecore_X_Region region;
@@ -185,7 +189,9 @@ ecore_x_region_free(Ecore_X_Region region)
} /* ecore_x_region_free */
EAPI void
-ecore_x_region_set(Ecore_X_Region region, Ecore_X_Rectangle *rects, int num)
+ecore_x_region_set(Ecore_X_Region region,
+ Ecore_X_Rectangle *rects,
+ int num)
{
#ifdef ECORE_XFIXES
XRectangle *xrect = _ecore_x_rectangle_ecore_to_x(rects, num);
@@ -195,7 +201,8 @@ ecore_x_region_set(Ecore_X_Region region, Ecore_X_Rectangle *rects, int num)
} /* ecore_x_region_set */
EAPI void
-ecore_x_region_copy(Ecore_X_Region dest, Ecore_X_Region source)
+ecore_x_region_copy(Ecore_X_Region dest,
+ Ecore_X_Region source)
{
#ifdef ECORE_XFIXES
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -254,7 +261,9 @@ ecore_x_region_invert(Ecore_X_Region dest,
} /* ecore_x_region_invert */
EAPI void
-ecore_x_region_translate(Ecore_X_Region region, int dx, int dy)
+ecore_x_region_translate(Ecore_X_Region region,
+ int dx,
+ int dy)
{
#ifdef ECORE_XFIXES
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -263,7 +272,8 @@ ecore_x_region_translate(Ecore_X_Region region, int dx, int dy)
} /* ecore_x_region_translate */
EAPI void
-ecore_x_region_extents(Ecore_X_Region dest, Ecore_X_Region source)
+ecore_x_region_extents(Ecore_X_Region dest,
+ Ecore_X_Region source)
{
#ifdef ECORE_XFIXES
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -272,7 +282,8 @@ ecore_x_region_extents(Ecore_X_Region dest, Ecore_X_Region source)
} /* ecore_x_region_extents */
EAPI Ecore_X_Rectangle *
-ecore_x_region_fetch(Ecore_X_Region region, int *num,
+ecore_x_region_fetch(Ecore_X_Region region,
+ int *num,
Ecore_X_Rectangle *bounds){
#ifdef ECORE_XFIXES
Ecore_X_Rectangle *rects;
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_gc.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_gc.c
index 3867da89da..10b807b657 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_gc.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_gc.c
@@ -30,7 +30,7 @@ ecore_x_gc_new(Ecore_X_Drawable draw,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!draw)
- draw = DefaultRootWindow(_ecore_x_disp);
+ draw = DefaultRootWindow(_ecore_x_disp);
memset(&gcv, 0, sizeof (gcv));
@@ -39,119 +39,119 @@ ecore_x_gc_new(Ecore_X_Drawable draw,
switch (mask & value_mask)
{
case ECORE_X_GC_VALUE_MASK_FUNCTION:
- gcv.function = value_list[idx];
- idx++;
- break;
+ gcv.function = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_PLANE_MASK:
- gcv.plane_mask = value_list[idx];
- idx++;
- break;
+ gcv.plane_mask = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_FOREGROUND:
- gcv.foreground = value_list[idx];
- idx++;
- break;
+ gcv.foreground = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_BACKGROUND:
- gcv.background = value_list[idx];
- idx++;
- break;
+ gcv.background = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_LINE_WIDTH:
- gcv.line_width = value_list[idx];
- idx++;
- break;
+ gcv.line_width = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_LINE_STYLE:
- gcv.line_style = value_list[idx];
- idx++;
- break;
+ gcv.line_style = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_CAP_STYLE:
- gcv.cap_style = value_list[idx];
- idx++;
- break;
+ gcv.cap_style = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_JOIN_STYLE:
- gcv.join_style = value_list[idx];
- idx++;
- break;
+ gcv.join_style = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_FILL_STYLE:
- gcv.fill_style = value_list[idx];
- idx++;
- break;
+ gcv.fill_style = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_FILL_RULE:
- gcv.fill_rule = value_list[idx];
- idx++;
- break;
+ gcv.fill_rule = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_TILE:
- gcv.tile = value_list[idx];
- idx++;
- break;
+ gcv.tile = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_STIPPLE:
- gcv.stipple = value_list[idx];
- idx++;
- break;
+ gcv.stipple = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_TILE_STIPPLE_ORIGIN_X:
- gcv.ts_x_origin = value_list[idx];
- idx++;
- break;
+ gcv.ts_x_origin = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_TILE_STIPPLE_ORIGIN_Y:
- gcv.ts_y_origin = value_list[idx];
- idx++;
- break;
+ gcv.ts_y_origin = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_FONT:
- gcv.font = value_list[idx];
- idx++;
- break;
+ gcv.font = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_SUBWINDOW_MODE:
- gcv.subwindow_mode = value_list[idx];
- idx++;
- break;
+ gcv.subwindow_mode = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_GRAPHICS_EXPOSURES:
- gcv.graphics_exposures = value_list[idx];
- idx++;
- break;
+ gcv.graphics_exposures = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_CLIP_ORIGIN_X:
- gcv.clip_x_origin = value_list[idx];
- idx++;
- break;
+ gcv.clip_x_origin = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_CLIP_ORIGIN_Y:
- gcv.clip_y_origin = value_list[idx];
- idx++;
- break;
+ gcv.clip_y_origin = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_CLIP_MASK:
- gcv.clip_mask = value_list[idx];
- idx++;
- break;
+ gcv.clip_mask = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_DASH_OFFSET:
- gcv.dash_offset = value_list[idx];
- idx++;
- break;
+ gcv.dash_offset = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_DASH_LIST:
- gcv.dashes = value_list[idx];
- idx++;
- break;
+ gcv.dashes = value_list[idx];
+ idx++;
+ break;
case ECORE_X_GC_VALUE_MASK_ARC_MODE:
- gcv.arc_mode = value_list[idx];
- idx++;
- break;
+ gcv.arc_mode = value_list[idx];
+ idx++;
+ break;
} /* switch */
}
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c
index 12fbf45d7b..3899651a6a 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_icccm.c
@@ -24,17 +24,18 @@ ecore_x_icccm_init(void)
} /* ecore_x_icccm_init */
EAPI void
-ecore_x_icccm_state_set(Ecore_X_Window win, Ecore_X_Window_State_Hint state)
+ecore_x_icccm_state_set(Ecore_X_Window win,
+ Ecore_X_Window_State_Hint state)
{
unsigned long c[2];
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (state == ECORE_X_WINDOW_STATE_HINT_WITHDRAWN)
- c[0] = WithdrawnState;
+ c[0] = WithdrawnState;
else if (state == ECORE_X_WINDOW_STATE_HINT_NORMAL)
- c[0] = NormalState;
+ c[0] = NormalState;
else if (state == ECORE_X_WINDOW_STATE_HINT_ICONIC)
- c[0] = IconicState;
+ c[0] = IconicState;
c[1] = None;
XChangeProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_STATE,
@@ -60,21 +61,22 @@ ecore_x_icccm_state_get(Ecore_X_Window win)
if ((prop_ret) && (num_ret == 2))
{
if (prop_ret[0] == WithdrawnState)
- hint = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
+ hint = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
else if (prop_ret[0] == NormalState)
- hint = ECORE_X_WINDOW_STATE_HINT_NORMAL;
+ hint = ECORE_X_WINDOW_STATE_HINT_NORMAL;
else if (prop_ret[0] == IconicState)
- hint = ECORE_X_WINDOW_STATE_HINT_ICONIC;
+ hint = ECORE_X_WINDOW_STATE_HINT_ICONIC;
}
if (prop_ret)
- XFree(prop_ret);
+ XFree(prop_ret);
return hint;
} /* ecore_x_icccm_state_get */
EAPI void
-ecore_x_icccm_delete_window_send(Ecore_X_Window win, Ecore_X_Time t)
+ecore_x_icccm_delete_window_send(Ecore_X_Window win,
+ Ecore_X_Time t)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
@@ -84,7 +86,8 @@ ecore_x_icccm_delete_window_send(Ecore_X_Window win, Ecore_X_Time t)
} /* ecore_x_icccm_delete_window_send */
EAPI void
-ecore_x_icccm_take_focus_send(Ecore_X_Window win, Ecore_X_Time t)
+ecore_x_icccm_take_focus_send(Ecore_X_Window win,
+ Ecore_X_Time t)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
@@ -94,7 +97,8 @@ ecore_x_icccm_take_focus_send(Ecore_X_Window win, Ecore_X_Time t)
} /* ecore_x_icccm_take_focus_send */
EAPI void
-ecore_x_icccm_save_yourself_send(Ecore_X_Window win, Ecore_X_Time t)
+ecore_x_icccm_save_yourself_send(Ecore_X_Window win,
+ Ecore_X_Time t)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
@@ -104,7 +108,11 @@ ecore_x_icccm_save_yourself_send(Ecore_X_Window win, Ecore_X_Time t)
} /* ecore_x_icccm_save_yourself_send */
EAPI void
-ecore_x_icccm_move_resize_send(Ecore_X_Window win, int x, int y, int w, int h)
+ecore_x_icccm_move_resize_send(Ecore_X_Window win,
+ int x,
+ int y,
+ int w,
+ int h)
{
XEvent ev;
@@ -124,30 +132,30 @@ ecore_x_icccm_move_resize_send(Ecore_X_Window win, int x, int y, int w, int h)
} /* ecore_x_icccm_move_resize_send */
EAPI void
-ecore_x_icccm_hints_set(Ecore_X_Window win,
- Eina_Bool accepts_focus,
+ecore_x_icccm_hints_set(Ecore_X_Window win,
+ Eina_Bool accepts_focus,
Ecore_X_Window_State_Hint initial_state,
- Ecore_X_Pixmap icon_pixmap,
- Ecore_X_Pixmap icon_mask,
- Ecore_X_Window icon_window,
- Ecore_X_Window window_group,
- Eina_Bool is_urgent)
+ Ecore_X_Pixmap icon_pixmap,
+ Ecore_X_Pixmap icon_mask,
+ Ecore_X_Window icon_window,
+ Ecore_X_Window window_group,
+ Eina_Bool is_urgent)
{
XWMHints *hints;
hints = XAllocWMHints();
if (!hints)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
hints->flags = InputHint | StateHint;
hints->input = accepts_focus;
if (initial_state == ECORE_X_WINDOW_STATE_HINT_WITHDRAWN)
- hints->initial_state = WithdrawnState;
+ hints->initial_state = WithdrawnState;
else if (initial_state == ECORE_X_WINDOW_STATE_HINT_NORMAL)
- hints->initial_state = NormalState;
+ hints->initial_state = NormalState;
else if (initial_state == ECORE_X_WINDOW_STATE_HINT_ICONIC)
- hints->initial_state = IconicState;
+ hints->initial_state = IconicState;
if (icon_pixmap != 0)
{
@@ -174,45 +182,45 @@ ecore_x_icccm_hints_set(Ecore_X_Window win,
}
if (is_urgent)
- hints->flags |= XUrgencyHint;
+ hints->flags |= XUrgencyHint;
XSetWMHints(_ecore_x_disp, win, hints);
XFree(hints);
} /* ecore_x_icccm_hints_set */
EAPI Eina_Bool
-ecore_x_icccm_hints_get(Ecore_X_Window win,
- Eina_Bool *accepts_focus,
+ecore_x_icccm_hints_get(Ecore_X_Window win,
+ Eina_Bool *accepts_focus,
Ecore_X_Window_State_Hint *initial_state,
- Ecore_X_Pixmap *icon_pixmap,
- Ecore_X_Pixmap *icon_mask,
- Ecore_X_Window *icon_window,
- Ecore_X_Window *window_group,
- Eina_Bool *is_urgent)
+ Ecore_X_Pixmap *icon_pixmap,
+ Ecore_X_Pixmap *icon_mask,
+ Ecore_X_Window *icon_window,
+ Ecore_X_Window *window_group,
+ Eina_Bool *is_urgent)
{
XWMHints *hints;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (accepts_focus)
- *accepts_focus = EINA_TRUE;
+ *accepts_focus = EINA_TRUE;
if (initial_state)
- *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
+ *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
if (icon_pixmap)
- *icon_pixmap = 0;
+ *icon_pixmap = 0;
if (icon_mask)
- *icon_mask = 0;
+ *icon_mask = 0;
if (icon_window)
- *icon_window = 0;
+ *icon_window = 0;
if (window_group)
- *window_group = 0;
+ *window_group = 0;
if (is_urgent)
- *is_urgent = EINA_FALSE;
+ *is_urgent = EINA_FALSE;
hints = XGetWMHints(_ecore_x_disp, win);
if (hints)
@@ -220,35 +228,35 @@ ecore_x_icccm_hints_get(Ecore_X_Window win,
if ((hints->flags & InputHint) && (accepts_focus))
{
if (hints->input)
- *accepts_focus = EINA_TRUE;
+ *accepts_focus = EINA_TRUE;
else
- *accepts_focus = EINA_FALSE;
+ *accepts_focus = EINA_FALSE;
}
if ((hints->flags & StateHint) && (initial_state))
{
if (hints->initial_state == WithdrawnState)
- *initial_state = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
+ *initial_state = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
else if (hints->initial_state == NormalState)
- *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
+ *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
else if (hints->initial_state == IconicState)
- *initial_state = ECORE_X_WINDOW_STATE_HINT_ICONIC;
+ *initial_state = ECORE_X_WINDOW_STATE_HINT_ICONIC;
}
if ((hints->flags & IconPixmapHint) && (icon_pixmap))
- *icon_pixmap = hints->icon_pixmap;
+ *icon_pixmap = hints->icon_pixmap;
if ((hints->flags & IconMaskHint) && (icon_mask))
- *icon_mask = hints->icon_mask;
+ *icon_mask = hints->icon_mask;
if ((hints->flags & IconWindowHint) && (icon_window))
- *icon_window = hints->icon_window;
+ *icon_window = hints->icon_window;
if ((hints->flags & WindowGroupHint) && (window_group))
- *window_group = hints->window_group;
+ *window_group = hints->window_group;
if ((hints->flags & XUrgencyHint) && (is_urgent))
- *is_urgent = EINA_TRUE;
+ *is_urgent = EINA_TRUE;
XFree(hints);
return EINA_TRUE;
@@ -258,25 +266,30 @@ ecore_x_icccm_hints_get(Ecore_X_Window win,
} /* ecore_x_icccm_hints_get */
EAPI void
-ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win,
- Eina_Bool request_pos,
+ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win,
+ Eina_Bool request_pos,
Ecore_X_Gravity gravity,
- int min_w, int min_h,
- int max_w, int max_h,
- int base_w, int base_h,
- int step_x, int step_y,
- double min_aspect, double max_aspect)
+ int min_w,
+ int min_h,
+ int max_w,
+ int max_h,
+ int base_w,
+ int base_h,
+ int step_x,
+ int step_y,
+ double min_aspect,
+ double max_aspect)
{
XSizeHints hint;
long mask;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!XGetWMNormalHints(_ecore_x_disp, win, &hint, &mask))
- memset(&hint, 0, sizeof(XSizeHints));
+ memset(&hint, 0, sizeof(XSizeHints));
hint.flags = 0;
if (request_pos)
- hint.flags |= USPosition;
+ hint.flags |= USPosition;
if (gravity != ECORE_X_GRAVITY_NW)
{
@@ -325,14 +338,19 @@ ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win,
} /* ecore_x_icccm_size_pos_hints_set */
EAPI Eina_Bool
-ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
- Eina_Bool *request_pos,
+ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
+ Eina_Bool *request_pos,
Ecore_X_Gravity *gravity,
- int *min_w, int *min_h,
- int *max_w, int *max_h,
- int *base_w, int *base_h,
- int *step_x, int *step_y,
- double *min_aspect, double *max_aspect)
+ int *min_w,
+ int *min_h,
+ int *max_w,
+ int *max_h,
+ int *base_w,
+ int *base_h,
+ int *step_x,
+ int *step_y,
+ double *min_aspect,
+ double *max_aspect)
{
XSizeHints hint;
long mask;
@@ -345,23 +363,23 @@ ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!XGetWMNormalHints(_ecore_x_disp, win, &hint, &mask))
- return EINA_FALSE;
+ return EINA_FALSE;
if ((hint.flags & USPosition) || ((hint.flags & PPosition)))
{
if (request_pos)
- *request_pos = EINA_TRUE;
+ *request_pos = EINA_TRUE;
}
else if (request_pos)
- *request_pos = EINA_FALSE;
+ *request_pos = EINA_FALSE;
if (hint.flags & PWinGravity)
{
if (gravity)
- *gravity = hint.win_gravity;
+ *gravity = hint.win_gravity;
}
else if (gravity)
- *gravity = ECORE_X_GRAVITY_NW;
+ *gravity = ECORE_X_GRAVITY_NW;
if (hint.flags & PMinSize)
{
@@ -374,10 +392,10 @@ ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
maxw = hint.max_width;
maxh = hint.max_height;
if (maxw < minw)
- maxw = minw;
+ maxw = minw;
if (maxh < minh)
- maxh = minh;
+ maxh = minh;
}
if (hint.flags & PBaseSize)
@@ -385,10 +403,10 @@ ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
basew = hint.base_width;
baseh = hint.base_height;
if (basew > minw)
- minw = basew;
+ minw = basew;
if (baseh > minh)
- minh = baseh;
+ minh = baseh;
}
if (hint.flags & PResizeInc)
@@ -396,88 +414,89 @@ ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
stepx = hint.width_inc;
stepy = hint.height_inc;
if (stepx < 1)
- stepx = 1;
+ stepx = 1;
if (stepy < 1)
- stepy = 1;
+ stepy = 1;
}
if (hint.flags & PAspect)
{
if (hint.min_aspect.y > 0)
- mina = ((double)hint.min_aspect.x) / ((double)hint.min_aspect.y);
+ mina = ((double)hint.min_aspect.x) / ((double)hint.min_aspect.y);
if (hint.max_aspect.y > 0)
- maxa = ((double)hint.max_aspect.x) / ((double)hint.max_aspect.y);
+ maxa = ((double)hint.max_aspect.x) / ((double)hint.max_aspect.y);
}
if (min_w)
- *min_w = minw;
+ *min_w = minw;
if (min_h)
- *min_h = minh;
+ *min_h = minh;
if (max_w)
- *max_w = maxw;
+ *max_w = maxw;
if (max_h)
- *max_h = maxh;
+ *max_h = maxh;
if (base_w)
- *base_w = basew;
+ *base_w = basew;
if (base_h)
- *base_h = baseh;
+ *base_h = baseh;
if (step_x)
- *step_x = stepx;
+ *step_x = stepx;
if (step_y)
- *step_y = stepy;
+ *step_y = stepy;
if (min_aspect)
- *min_aspect = mina;
+ *min_aspect = mina;
if (max_aspect)
- *max_aspect = maxa;
+ *max_aspect = maxa;
return EINA_TRUE;
} /* ecore_x_icccm_size_pos_hints_get */
EAPI void
-ecore_x_icccm_title_set(Ecore_X_Window win, const char *t)
+ecore_x_icccm_title_set(Ecore_X_Window win,
+ const char *t)
{
char *list[1];
XTextProperty xprop;
int ret;
if (!t)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
xprop.value = NULL;
#ifdef X_HAVE_UTF8_STRING
list[0] = strdup(t);
ret =
- Xutf8TextListToTextProperty(_ecore_x_disp, list, 1, XUTF8StringStyle,
- &xprop);
+ Xutf8TextListToTextProperty(_ecore_x_disp, list, 1, XUTF8StringStyle,
+ &xprop);
#else /* ifdef X_HAVE_UTF8_STRING */
list[0] = strdup(t);
ret =
- XmbTextListToTextProperty(_ecore_x_disp, list, 1, XStdICCTextStyle,
- &xprop);
+ XmbTextListToTextProperty(_ecore_x_disp, list, 1, XStdICCTextStyle,
+ &xprop);
#endif /* ifdef X_HAVE_UTF8_STRING */
if (ret >= Success)
{
XSetWMName(_ecore_x_disp, win, &xprop);
if (xprop.value)
- XFree(xprop.value);
+ XFree(xprop.value);
}
else if (XStringListToTextProperty(list, 1, &xprop) >= Success)
{
XSetWMName(_ecore_x_disp, win, &xprop);
if (xprop.value)
- XFree(xprop.value);
+ XFree(xprop.value);
}
free(list[0]);
@@ -500,30 +519,30 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
int ret;
if (xprop.encoding == ECORE_X_ATOM_UTF8_STRING)
- t = strdup((char *)xprop.value);
+ t = strdup((char *)xprop.value);
else
{
- /* convert to utf8 */
+ /* convert to utf8 */
#ifdef X_HAVE_UTF8_STRING
- ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
- &list, &num);
+ ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
+ &list, &num);
#else /* ifdef X_HAVE_UTF8_STRING */
- ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
- &list, &num);
+ ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
+ &list, &num);
#endif /* ifdef X_HAVE_UTF8_STRING */
- if ((ret == XLocaleNotSupported) ||
- (ret == XNoMemory) || (ret == XConverterNotFound))
+ if ((ret == XLocaleNotSupported) ||
+ (ret == XNoMemory) || (ret == XConverterNotFound))
t = strdup((char *)xprop.value);
- else if ((ret >= Success) && (num > 0))
+ else if ((ret >= Success) && (num > 0))
t = strdup(list[0]);
- if (list)
+ if (list)
XFreeStringList(list);
}
if (xprop.value)
- XFree(xprop.value);
+ XFree(xprop.value);
return t;
}
@@ -545,9 +564,9 @@ ecore_x_icccm_protocol_atoms_set(Ecore_X_Window win,
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (num > 0)
- XSetWMProtocols(_ecore_x_disp, win, (Atom *)(protos), num);
+ XSetWMProtocols(_ecore_x_disp, win, (Atom *)(protos), num);
else
- XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_PROTOCOLS);
+ XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_PROTOCOLS);
} /* ecore_x_icccm_protocol_atoms_set */
/**
@@ -557,9 +576,9 @@ ecore_x_icccm_protocol_atoms_set(Ecore_X_Window win,
* @param on On/Off
*/
EAPI void
-ecore_x_icccm_protocol_set(Ecore_X_Window win,
+ecore_x_icccm_protocol_set(Ecore_X_Window win,
Ecore_X_WM_Protocol protocol,
- Eina_Bool on)
+ Eina_Bool on)
{
Atom *protos = NULL;
Atom proto;
@@ -569,7 +588,7 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
/* Check for invalid values */
if (protocol >= ECORE_X_WM_PROTOCOL_NUM)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
proto = _ecore_x_atoms_wm_protocols[protocol];
@@ -594,14 +613,14 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
Atom *new_protos = NULL;
if (already_set)
- goto leave;
+ goto leave;
new_protos = malloc((protos_count + 1) * sizeof(Atom));
if (!new_protos)
- goto leave;
+ goto leave;
for (i = 0; i < protos_count; i++)
- new_protos[i] = protos[i];
+ new_protos[i] = protos[i];
new_protos[protos_count] = proto;
XSetWMProtocols(_ecore_x_disp, win, new_protos, protos_count + 1);
free(new_protos);
@@ -609,7 +628,7 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
else
{
if (!already_set)
- goto leave;
+ goto leave;
for (i = 0; i < protos_count; i++)
{
@@ -618,13 +637,13 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
int j;
for (j = i + 1; j < protos_count; j++)
- protos[j - 1] = protos[j];
+ protos[j - 1] = protos[j];
if (protos_count > 1)
- XSetWMProtocols(_ecore_x_disp, win, protos,
- protos_count - 1);
+ XSetWMProtocols(_ecore_x_disp, win, protos,
+ protos_count - 1);
else
- XDeleteProperty(_ecore_x_disp, win,
- ECORE_X_ATOM_WM_PROTOCOLS);
+ XDeleteProperty(_ecore_x_disp, win,
+ ECORE_X_ATOM_WM_PROTOCOLS);
goto leave;
}
@@ -633,7 +652,7 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
leave:
if (protos)
- XFree(protos);
+ XFree(protos);
} /* ecore_x_icccm_protocol_set */
/**
@@ -643,7 +662,8 @@ leave:
* @return 1 if the protocol is set, else 0.
*/
EAPI Eina_Bool
-ecore_x_icccm_protocol_isset(Ecore_X_Window win, Ecore_X_WM_Protocol protocol)
+ecore_x_icccm_protocol_isset(Ecore_X_Window win,
+ Ecore_X_WM_Protocol protocol)
{
Atom proto, *protos = NULL;
int i, protos_count = 0;
@@ -651,23 +671,23 @@ ecore_x_icccm_protocol_isset(Ecore_X_Window win, Ecore_X_WM_Protocol protocol)
/* check for invalid values */
if (protocol >= ECORE_X_WM_PROTOCOL_NUM)
- return EINA_FALSE;
+ return EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
proto = _ecore_x_atoms_wm_protocols[protocol];
if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
- return EINA_FALSE;
+ return EINA_FALSE;
for (i = 0; i < protos_count; i++)
- if (protos[i] == proto)
- {
- ret = EINA_TRUE;
- break;
- }
+ if (protos[i] == proto)
+ {
+ ret = EINA_TRUE;
+ break;
+ }
if (protos)
- XFree(protos);
+ XFree(protos);
return ret;
} /* ecore_x_icccm_protocol_isset */
@@ -681,13 +701,15 @@ ecore_x_icccm_protocol_isset(Ecore_X_Window win, Ecore_X_WM_Protocol protocol)
* Set a window name * class
*/
EAPI void
-ecore_x_icccm_name_class_set(Ecore_X_Window win, const char *n, const char *c)
+ecore_x_icccm_name_class_set(Ecore_X_Window win,
+ const char *n,
+ const char *c)
{
XClassHint *xch;
xch = XAllocClassHint();
if (!xch)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
xch->res_name = (char *)n;
@@ -705,28 +727,30 @@ ecore_x_icccm_name_class_set(Ecore_X_Window win, const char *n, const char *c)
* Get a window name * class
*/
EAPI void
-ecore_x_icccm_name_class_get(Ecore_X_Window win, char **n, char **c)
+ecore_x_icccm_name_class_get(Ecore_X_Window win,
+ char **n,
+ char **c)
{
XClassHint xch;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (n)
- *n = NULL;
+ *n = NULL;
if (c)
- *c = NULL;
+ *c = NULL;
xch.res_name = NULL;
xch.res_class = NULL;
if (XGetClassHint(_ecore_x_disp, win, &xch))
{
if (n)
- if (xch.res_name)
- *n = strdup(xch.res_name);
+ if (xch.res_name)
+ *n = strdup(xch.res_name);
if (c)
- if (xch.res_class)
- *c = strdup(xch.res_class);
+ if (xch.res_class)
+ *c = strdup(xch.res_class);
XFree(xch.res_name);
XFree(xch.res_class);
@@ -758,7 +782,9 @@ ecore_x_icccm_client_machine_get(Ecore_X_Window win)
* @param argv Arguments.
*/
EAPI void
-ecore_x_icccm_command_set(Ecore_X_Window win, int argc, char **argv)
+ecore_x_icccm_command_set(Ecore_X_Window win,
+ int argc,
+ char **argv)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XSetCommand(_ecore_x_disp, win, argv, argc);
@@ -774,31 +800,33 @@ ecore_x_icccm_command_set(Ecore_X_Window win, int argc, char **argv)
* @param argv Arguments.
*/
EAPI void
-ecore_x_icccm_command_get(Ecore_X_Window win, int *argc, char ***argv)
+ecore_x_icccm_command_get(Ecore_X_Window win,
+ int *argc,
+ char ***argv)
{
int i, c;
char **v;
if (argc)
- *argc = 0;
+ *argc = 0;
if (argv)
- *argv = NULL;
+ *argv = NULL;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!XGetCommand(_ecore_x_disp, win, &v, &c))
- return;
+ return;
if (c < 1)
{
if (v)
- XFreeStringList(v);
+ XFreeStringList(v);
return;
}
if (argc)
- *argc = c;
+ *argc = c;
if (argv)
{
@@ -807,7 +835,7 @@ ecore_x_icccm_command_get(Ecore_X_Window win, int *argc, char ***argv)
{
XFreeStringList(v);
if (argc)
- *argc = 0;
+ *argc = 0;
return;
}
@@ -815,9 +843,9 @@ ecore_x_icccm_command_get(Ecore_X_Window win, int *argc, char ***argv)
for (i = 0; i < c; i++)
{
if (v[i])
- (*argv)[i] = strdup(v[i]);
+ (*argv)[i] = strdup(v[i]);
else
- (*argv)[i] = strdup("");
+ (*argv)[i] = strdup("");
}
}
@@ -832,7 +860,8 @@ ecore_x_icccm_command_get(Ecore_X_Window win, int *argc, char ***argv)
* Set a window icon name
*/
EAPI void
-ecore_x_icccm_icon_name_set(Ecore_X_Window win, const char *t)
+ecore_x_icccm_icon_name_set(Ecore_X_Window win,
+ const char *t)
{
char *list[1];
XTextProperty xprop;
@@ -853,13 +882,13 @@ ecore_x_icccm_icon_name_set(Ecore_X_Window win, const char *t)
{
XSetWMIconName(_ecore_x_disp, win, &xprop);
if (xprop.value)
- XFree(xprop.value);
+ XFree(xprop.value);
}
else if (XStringListToTextProperty(list, 1, &xprop) >= Success)
{
XSetWMIconName(_ecore_x_disp, win, &xprop);
if (xprop.value)
- XFree(xprop.value);
+ XFree(xprop.value);
}
free(list[0]);
@@ -889,33 +918,33 @@ ecore_x_icccm_icon_name_get(Ecore_X_Window win)
int ret;
if (xprop.encoding == ECORE_X_ATOM_UTF8_STRING)
- t = strdup((char *)xprop.value);
+ t = strdup((char *)xprop.value);
else
{
- /* convert to utf8 */
+ /* convert to utf8 */
#ifdef X_HAVE_UTF8_STRING
- ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
- &list, &num);
+ ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
+ &list, &num);
#else /* ifdef X_HAVE_UTF8_STRING */
- ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
- &list, &num);
+ ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
+ &list, &num);
#endif /* ifdef X_HAVE_UTF8_STRING */
- if ((ret == XLocaleNotSupported) ||
- (ret == XNoMemory) || (ret == XConverterNotFound))
+ if ((ret == XLocaleNotSupported) ||
+ (ret == XNoMemory) || (ret == XConverterNotFound))
t = strdup((char *)xprop.value);
- else if (ret >= Success)
- {
- if ((num >= 1) && (list))
+ else if (ret >= Success)
+ {
+ if ((num >= 1) && (list))
t = strdup(list[0]);
- if (list)
+ if (list)
XFreeStringList(list);
- }
+ }
}
if (xprop.value)
- XFree(xprop.value);
+ XFree(xprop.value);
return t;
}
@@ -930,7 +959,8 @@ ecore_x_icccm_icon_name_get(Ecore_X_Window win)
* @param subwin The subwindow to be added to the colormap windows list
*/
EAPI void
-ecore_x_icccm_colormap_window_set(Ecore_X_Window win, Ecore_X_Window subwin)
+ecore_x_icccm_colormap_window_set(Ecore_X_Window win,
+ Ecore_X_Window subwin)
{
int num = 0, i;
unsigned char *old_data = NULL;
@@ -945,7 +975,7 @@ ecore_x_icccm_colormap_window_set(Ecore_X_Window win, Ecore_X_Window subwin)
{
newset = calloc(1, sizeof(Window));
if (!newset)
- return;
+ return;
newset[0] = subwin;
num = 1;
@@ -956,14 +986,14 @@ ecore_x_icccm_colormap_window_set(Ecore_X_Window win, Ecore_X_Window subwin)
newset = calloc(num + 1, sizeof(Window));
oldset = (Window *)old_data;
if (!newset)
- return;
+ return;
for (i = 0; i < num; ++i)
{
if (oldset[i] == subwin)
{
if (old_data)
- XFree(old_data);
+ XFree(old_data);
old_data = NULL;
free(newset);
@@ -975,7 +1005,7 @@ ecore_x_icccm_colormap_window_set(Ecore_X_Window win, Ecore_X_Window subwin)
newset[num++] = subwin;
if (old_data)
- XFree(old_data);
+ XFree(old_data);
data = (unsigned char *)newset;
}
@@ -992,7 +1022,8 @@ ecore_x_icccm_colormap_window_set(Ecore_X_Window win, Ecore_X_Window subwin)
* @param subwin The window to be removed from the colormap window list.
*/
EAPI void
-ecore_x_icccm_colormap_window_unset(Ecore_X_Window win, Ecore_X_Window subwin)
+ecore_x_icccm_colormap_window_unset(Ecore_X_Window win,
+ Ecore_X_Window subwin)
{
int num = 0, i, j, k = 0;
unsigned char *old_data = NULL;
@@ -1004,7 +1035,7 @@ ecore_x_icccm_colormap_window_unset(Ecore_X_Window win, Ecore_X_Window subwin)
if (!ecore_x_window_prop_property_get(win,
ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
XA_WINDOW, 32, &old_data, &num))
- return;
+ return;
oldset = (Window *)old_data;
for (i = 0; i < num; i++)
@@ -1016,7 +1047,7 @@ ecore_x_icccm_colormap_window_unset(Ecore_X_Window win, Ecore_X_Window subwin)
XDeleteProperty(_ecore_x_disp,
win, ECORE_X_ATOM_WM_COLORMAP_WINDOWS);
if (old_data)
- XFree(old_data);
+ XFree(old_data);
old_data = NULL;
return;
@@ -1026,18 +1057,18 @@ ecore_x_icccm_colormap_window_unset(Ecore_X_Window win, Ecore_X_Window subwin)
newset = calloc(num - 1, sizeof(Window));
data = (unsigned char *)newset;
for (j = 0; j < num; ++j)
- if (oldset[j] != subwin)
- newset[k++] = oldset[j];
+ if (oldset[j] != subwin)
+ newset[k++] = oldset[j];
ecore_x_window_prop_property_set(
- win,
- ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
- XA_WINDOW,
- 32,
- data,
- k);
+ win,
+ ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
+ XA_WINDOW,
+ 32,
+ data,
+ k);
if (old_data)
- XFree(old_data);
+ XFree(old_data);
old_data = NULL;
free(newset);
@@ -1047,7 +1078,7 @@ ecore_x_icccm_colormap_window_unset(Ecore_X_Window win, Ecore_X_Window subwin)
}
if (old_data)
- XFree(old_data);
+ XFree(old_data);
} /* ecore_x_icccm_colormap_window_unset */
/**
@@ -1056,7 +1087,8 @@ ecore_x_icccm_colormap_window_unset(Ecore_X_Window win, Ecore_X_Window subwin)
* @param forwin the toplevel window
*/
EAPI void
-ecore_x_icccm_transient_for_set(Ecore_X_Window win, Ecore_X_Window forwin)
+ecore_x_icccm_transient_for_set(Ecore_X_Window win,
+ Ecore_X_Window forwin)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XSetTransientForHint(_ecore_x_disp, win, forwin);
@@ -1085,9 +1117,9 @@ ecore_x_icccm_transient_for_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (XGetTransientForHint(_ecore_x_disp, win, &forwin))
- return (Ecore_X_Window)forwin;
+ return (Ecore_X_Window)forwin;
else
- return 0;
+ return 0;
} /* ecore_x_icccm_transient_for_get */
/**
@@ -1096,7 +1128,8 @@ ecore_x_icccm_transient_for_get(Ecore_X_Window win)
* @param role The role string
*/
EAPI void
-ecore_x_icccm_window_role_set(Ecore_X_Window win, const char *role)
+ecore_x_icccm_window_role_set(Ecore_X_Window win,
+ const char *role)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_WINDOW_ROLE,
@@ -1124,7 +1157,8 @@ ecore_x_icccm_window_role_get(Ecore_X_Window win)
* the main window must have this property set to the app's main window.
*/
EAPI void
-ecore_x_icccm_client_leader_set(Ecore_X_Window win, Ecore_X_Window l)
+ecore_x_icccm_client_leader_set(Ecore_X_Window win,
+ Ecore_X_Window l)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_window_set(win, ECORE_X_ATOM_WM_CLIENT_LEADER,
@@ -1143,22 +1177,23 @@ ecore_x_icccm_client_leader_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (ecore_x_window_prop_window_get(win, ECORE_X_ATOM_WM_CLIENT_LEADER,
&l, 1) > 0)
- return l;
+ return l;
return 0;
} /* ecore_x_icccm_client_leader_get */
EAPI void
-ecore_x_icccm_iconic_request_send(Ecore_X_Window win, Ecore_X_Window root)
+ecore_x_icccm_iconic_request_send(Ecore_X_Window win,
+ Ecore_X_Window root)
{
XEvent xev;
if (!win)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!root)
- root = DefaultRootWindow(_ecore_x_disp);
+ root = DefaultRootWindow(_ecore_x_disp);
xev.xclient.type = ClientMessage;
xev.xclient.serial = 0;
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_image.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_image.c
index a81941f542..2de531914c 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_image.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_image.c
@@ -15,7 +15,8 @@ static int _ecore_x_image_shm_can = -1;
static int _ecore_x_image_err = 0;
static int
-_ecore_x_image_error_handler(Display *d __UNUSED__, XErrorEvent *ev __UNUSED__)
+_ecore_x_image_error_handler(Display *d __UNUSED__,
+ XErrorEvent *ev __UNUSED__)
{
_ecore_x_image_err = 1;
return 0;
@@ -29,7 +30,7 @@ _ecore_x_image_shm_check(void)
XImage *xim;
if (_ecore_x_image_shm_can != -1)
- return;
+ return;
XSync(_ecore_x_disp, False);
_ecore_x_image_err = 0;
@@ -104,13 +105,16 @@ struct _Ecore_X_Image
};
EAPI Ecore_X_Image *
-ecore_x_image_new(int w, int h, Ecore_X_Visual vis, int depth)
+ecore_x_image_new(int w,
+ int h,
+ Ecore_X_Visual vis,
+ int depth)
{
Ecore_X_Image *im;
im = calloc(1, sizeof(Ecore_X_Image));
if (!im)
- return NULL;
+ return NULL;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
im->w = w;
@@ -153,7 +157,7 @@ _ecore_x_image_shm_create(Ecore_X_Image *im)
ZPixmap, NULL, &(im->shminfo),
im->w, im->h);
if (!im->xim)
- return;
+ return;
im->shminfo.shmid = shmget(IPC_PRIVATE,
im->xim->bytes_per_line * im->xim->height,
@@ -183,16 +187,22 @@ _ecore_x_image_shm_create(Ecore_X_Image *im)
im->bpl = im->xim->bytes_per_line;
im->rows = im->xim->height;
if (im->xim->bits_per_pixel <= 8)
- im->bpp = 1;
+ im->bpp = 1;
else if (im->xim->bits_per_pixel <= 16)
- im->bpp = 2;
+ im->bpp = 2;
else
- im->bpp = 4;
+ im->bpp = 4;
} /* _ecore_x_image_shm_create */
EAPI Eina_Bool
-ecore_x_image_get(Ecore_X_Image *im, Ecore_X_Drawable draw,
- int x, int y, int sx, int sy, int w, int h)
+ecore_x_image_get(Ecore_X_Image *im,
+ Ecore_X_Drawable draw,
+ int x,
+ int y,
+ int sx,
+ int sy,
+ int w,
+ int h)
{
Eina_Bool ret = EINA_TRUE;
XErrorHandler ph;
@@ -201,10 +211,10 @@ ecore_x_image_get(Ecore_X_Image *im, Ecore_X_Drawable draw,
if (im->shm)
{
if (!im->xim)
- _ecore_x_image_shm_create(im);
+ _ecore_x_image_shm_create(im);
if (!im->xim)
- return 0;
+ return 0;
_ecore_x_image_err = 0;
// optimised path
@@ -212,12 +222,12 @@ ecore_x_image_get(Ecore_X_Image *im, Ecore_X_Drawable draw,
if ((sx == 0) && (w == im->w))
{
im->xim->data = (char *)
- im->data + (im->xim->bytes_per_line * sy) + (sx * im->bpp);
+ im->data + (im->xim->bytes_per_line * sy) + (sx * im->bpp);
im->xim->width = w;
im->xim->height = h;
XGrabServer(_ecore_x_disp);
if (!XShmGetImage(_ecore_x_disp, draw, im->xim, x, y, 0xffffffff))
- ret = EINA_FALSE;
+ ret = EINA_FALSE;
XUngrabServer(_ecore_x_disp);
ecore_x_sync();
}
@@ -259,7 +269,7 @@ ecore_x_image_get(Ecore_X_Image *im, Ecore_X_Drawable draw,
XSetErrorHandler((XErrorHandler)ph);
if (_ecore_x_image_err)
- ret = EINA_FALSE;
+ ret = EINA_FALSE;
}
else
{
@@ -271,15 +281,15 @@ ecore_x_image_get(Ecore_X_Image *im, Ecore_X_Drawable draw,
} /* ecore_x_image_get */
EAPI void
-ecore_x_image_put(Ecore_X_Image *im,
+ecore_x_image_put(Ecore_X_Image *im,
Ecore_X_Drawable draw,
- Ecore_X_GC gc,
- int x,
- int y,
- int sx,
- int sy,
- int w,
- int h)
+ Ecore_X_GC gc,
+ int x,
+ int y,
+ int sx,
+ int sy,
+ int w,
+ int h)
{
Ecore_X_GC tgc = 0;
@@ -299,7 +309,10 @@ ecore_x_image_put(Ecore_X_Image *im,
} /* ecore_x_image_put */
EAPI void *
-ecore_x_image_data_get(Ecore_X_Image *im, int *bpl, int *rows, int *bpp)
+ecore_x_image_data_get(Ecore_X_Image *im,
+ int *bpl,
+ int *rows,
+ int *bpp)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!im->xim) _ecore_x_image_shm_create(im);
@@ -317,10 +330,10 @@ ecore_x_image_is_argb32_get(Ecore_X_Image *im)
if (!im->xim) _ecore_x_image_shm_create(im);
if (((vis->class == TrueColor) ||
(vis->class == DirectColor)) &&
- (im->depth >= 24) &&
- (vis->red_mask == 0xff0000) &&
+ (im->depth >= 24) &&
+ (vis->red_mask == 0xff0000) &&
(vis->green_mask == 0x00ff00) &&
- (vis->blue_mask == 0x0000ff))
+ (vis->blue_mask == 0x0000ff))
{
#ifdef WORDS_BIGENDIAN
if (im->xim->bitmap_bit_order == LSBFirst) return EINA_TRUE;
@@ -332,31 +345,36 @@ ecore_x_image_is_argb32_get(Ecore_X_Image *im)
}
EAPI Eina_Bool
-ecore_x_image_to_argb_convert(void *src, int sbpp,
- int sbpl,
+ecore_x_image_to_argb_convert(void *src,
+ int sbpp,
+ int sbpl,
Ecore_X_Colormap c,
- Ecore_X_Visual v,
- int x, int y, int w, int h,
- unsigned int *dst,
- int dbpl,
- int dx, int dy)
+ Ecore_X_Visual v,
+ int x,
+ int y,
+ int w,
+ int h,
+ unsigned int *dst,
+ int dbpl,
+ int dx,
+ int dy)
{
Visual *vis = v;
XColor *cols = NULL;
int n = 0, nret = 0, i, row;
unsigned int pal[256], r, g, b;
enum
- {
- rgbnone = 0,
- rgb565,
- bgr565,
- rgbx555,
- argbx888,
- abgrx888,
- rgba888x,
- bgra888x,
- argbx666
- };
+ {
+ rgbnone = 0,
+ rgb565,
+ bgr565,
+ rgbx555,
+ argbx888,
+ abgrx888,
+ rgba888x,
+ bgra888x,
+ argbx666
+ };
int mode = 0;
sbpp *= 8;
@@ -367,65 +385,66 @@ ecore_x_image_to_argb_convert(void *src, int sbpp,
(vis->class == StaticColor) ||
(vis->class == GrayScale) ||
(vis->class == StaticGray)))
- {
- if (!c) c = DefaultColormap(_ecore_x_disp,
- DefaultScreen(_ecore_x_disp));
- cols = alloca(n * sizeof(XColor));
- for (i = 0; i < n; i++)
- {
- cols[i].pixel = i;
- cols[i].flags = DoRed | DoGreen | DoBlue;
- cols[i].red = 0;
- cols[i].green = 0;
- cols[i].blue = 0;
- }
- XQueryColors(_ecore_x_disp, c, cols, n);
- for (i = 0; i < n; i++)
- {
- pal[i] = 0xff000000 |
- ((cols[i].red >> 8) << 16) |
- ((cols[i].green >> 8) << 8 ) |
- ((cols[i].blue >> 8) );
- }
- nret = n;
- }
+ {
+ if (!c)
+ c = DefaultColormap(_ecore_x_disp,
+ DefaultScreen(_ecore_x_disp));
+ cols = alloca(n * sizeof(XColor));
+ for (i = 0; i < n; i++)
+ {
+ cols[i].pixel = i;
+ cols[i].flags = DoRed | DoGreen | DoBlue;
+ cols[i].red = 0;
+ cols[i].green = 0;
+ cols[i].blue = 0;
+ }
+ XQueryColors(_ecore_x_disp, c, cols, n);
+ for (i = 0; i < n; i++)
+ {
+ pal[i] = 0xff000000 |
+ ((cols[i].red >> 8) << 16) |
+ ((cols[i].green >> 8) << 8) |
+ ((cols[i].blue >> 8));
+ }
+ nret = n;
+ }
else if ((vis->class == TrueColor) ||
(vis->class == DirectColor))
{
- if ((vis->red_mask == 0x00ff0000) &&
+ if ((vis->red_mask == 0x00ff0000) &&
(vis->green_mask == 0x0000ff00) &&
- (vis->blue_mask == 0x000000ff))
- mode = argbx888;
- else if ((vis->red_mask == 0x000000ff) &&
+ (vis->blue_mask == 0x000000ff))
+ mode = argbx888;
+ else if ((vis->red_mask == 0x000000ff) &&
(vis->green_mask == 0x0000ff00) &&
- (vis->blue_mask == 0x00ff0000))
- mode = abgrx888;
- else if ((vis->red_mask == 0xff000000) &&
+ (vis->blue_mask == 0x00ff0000))
+ mode = abgrx888;
+ else if ((vis->red_mask == 0xff000000) &&
(vis->green_mask == 0x00ff0000) &&
- (vis->blue_mask == 0x0000ff00))
- mode = rgba888x;
- else if ((vis->red_mask == 0x0000ff00) &&
+ (vis->blue_mask == 0x0000ff00))
+ mode = rgba888x;
+ else if ((vis->red_mask == 0x0000ff00) &&
(vis->green_mask == 0x00ff0000) &&
- (vis->blue_mask == 0xff000000))
- mode = bgra888x;
- else if ((vis->red_mask == 0x0003f000) &&
+ (vis->blue_mask == 0xff000000))
+ mode = bgra888x;
+ else if ((vis->red_mask == 0x0003f000) &&
(vis->green_mask == 0x00000fc0) &&
- (vis->blue_mask == 0x0000003f))
- mode = argbx666;
- else if ((vis->red_mask == 0x0000f800) &&
+ (vis->blue_mask == 0x0000003f))
+ mode = argbx666;
+ else if ((vis->red_mask == 0x0000f800) &&
(vis->green_mask == 0x000007e0) &&
- (vis->blue_mask == 0x0000001f))
- mode = rgb565;
- else if ((vis->red_mask == 0x0000001f) &&
+ (vis->blue_mask == 0x0000001f))
+ mode = rgb565;
+ else if ((vis->red_mask == 0x0000001f) &&
(vis->green_mask == 0x000007e0) &&
- (vis->blue_mask == 0x0000f800))
- mode = bgr565;
- else if ((vis->red_mask == 0x00007c00) &&
+ (vis->blue_mask == 0x0000f800))
+ mode = bgr565;
+ else if ((vis->red_mask == 0x00007c00) &&
(vis->green_mask == 0x000003e0) &&
- (vis->blue_mask == 0x0000001f))
- mode = rgbx555;
+ (vis->blue_mask == 0x0000001f))
+ mode = rgbx555;
else
- return EINA_FALSE;
+ return EINA_FALSE;
}
for (row = 0; row < h; row++)
{
@@ -439,7 +458,7 @@ ecore_x_image_to_argb_convert(void *src, int sbpp,
de = dp + w;
switch (sbpp)
{
- case 8:
+ case 8:
s8 = ((unsigned char *)(((unsigned char *)src) + ((y + row) * sbpl))) + x;
if (nret > 0)
{
@@ -450,13 +469,14 @@ ecore_x_image_to_argb_convert(void *src, int sbpp,
}
}
else
- return EINA_FALSE;
+ return EINA_FALSE;
break;
- case 16:
+
+ case 16:
s16 = ((unsigned short *)(((unsigned char *)src) + ((y + row) * sbpl))) + x;
switch (mode)
{
- case rgb565:
+ case rgb565:
while (dp < de)
{
r = (*s16 & 0xf800) << 8;
@@ -469,7 +489,8 @@ ecore_x_image_to_argb_convert(void *src, int sbpp,
s16++; dp++;
}
break;
- case bgr565:
+
+ case bgr565:
while (dp < de)
{
r = (*s16 & 0x001f) << 19;
@@ -482,7 +503,8 @@ ecore_x_image_to_argb_convert(void *src, int sbpp,
s16++; dp++;
}
break;
- case rgbx555:
+
+ case rgbx555:
while (dp < de)
{
r = (*s16 & 0x7c00) << 9;
@@ -495,24 +517,27 @@ ecore_x_image_to_argb_convert(void *src, int sbpp,
s16++; dp++;
}
break;
- default:
+
+ default:
return EINA_FALSE;
break;
}
break;
- case 24:
- case 32:
+
+ case 24:
+ case 32:
s32 = ((unsigned int *)(((unsigned char *)src) + ((y + row) * sbpl))) + x;
switch (mode)
{
- case argbx888:
+ case argbx888:
while (dp < de)
{
*dp = 0xff000000 | *s32;
s32++; dp++;
}
break;
- case abgrx888:
+
+ case abgrx888:
while (dp < de)
{
r = *s32 & 0x000000ff;
@@ -522,14 +547,16 @@ ecore_x_image_to_argb_convert(void *src, int sbpp,
s32++; dp++;
}
break;
- case rgba888x:
+
+ case rgba888x:
while (dp < de)
{
*dp = 0xff000000 | (*s32 >> 8);
s32++; dp++;
}
break;
- case bgra888x:
+
+ case bgra888x:
while (dp < de)
{
r = *s32 & 0x0000ff00;
@@ -539,7 +566,8 @@ ecore_x_image_to_argb_convert(void *src, int sbpp,
s32++; dp++;
}
break;
- case argbx666:
+
+ case argbx666:
while (dp < de)
{
r = (*s32 & 0x3f000) << 6;
@@ -552,16 +580,19 @@ ecore_x_image_to_argb_convert(void *src, int sbpp,
s32++; dp++;
}
break;
- default:
+
+ default:
return EINA_FALSE;
break;
}
break;
break;
- default:
+
+ default:
return EINA_FALSE;
break;
}
}
return EINA_TRUE;
}
+
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c
index 6de53dd208..7459a8b60b 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_mwm.c
@@ -48,7 +48,7 @@ ecore_x_mwm_hints_get(Ecore_X_Window win,
ECORE_X_ATOM_MOTIF_WM_HINTS,
ECORE_X_ATOM_MOTIF_WM_HINTS,
32, &p, &num))
- return EINA_FALSE;
+ return EINA_FALSE;
mwmhints = (MWMHints *)p;
if (mwmhints)
@@ -58,25 +58,25 @@ ecore_x_mwm_hints_get(Ecore_X_Window win,
if (dhint)
{
if (mwmhints->flags & ECORE_X_MWM_HINTS_DECORATIONS)
- *dhint = mwmhints->decorations;
+ *dhint = mwmhints->decorations;
else
- *dhint = ECORE_X_MWM_HINT_DECOR_ALL;
+ *dhint = ECORE_X_MWM_HINT_DECOR_ALL;
}
if (fhint)
{
if (mwmhints->flags & ECORE_X_MWM_HINTS_FUNCTIONS)
- *fhint = mwmhints->functions;
+ *fhint = mwmhints->functions;
else
- *fhint = ECORE_X_MWM_HINT_FUNC_ALL;
+ *fhint = ECORE_X_MWM_HINT_FUNC_ALL;
}
if (ihint)
{
if (mwmhints->flags & ECORE_X_MWM_HINTS_INPUT_MODE)
- *ihint = mwmhints->inputmode;
+ *ihint = mwmhints->inputmode;
else
- *ihint = ECORE_X_MWM_HINT_INPUT_MODELESS;
+ *ihint = ECORE_X_MWM_HINT_INPUT_MODELESS;
}
ret = EINA_TRUE;
@@ -89,7 +89,8 @@ ecore_x_mwm_hints_get(Ecore_X_Window win,
} /* ecore_x_mwm_hints_get */
EAPI void
-ecore_x_mwm_borderless_set(Ecore_X_Window win, Eina_Bool borderless)
+ecore_x_mwm_borderless_set(Ecore_X_Window win,
+ Eina_Bool borderless)
{
unsigned int data[5] = {0, 0, 0, 0, 0};
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c
index e663413d11..36b028d871 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_netwm.c
@@ -13,7 +13,7 @@
#include "ecore_x_private.h"
#include "Ecore_X.h"
-typedef struct _Ecore_X_Startup_Info Ecore_X_Startup_Info;
+typedef struct _Ecore_X_Startup_Info Ecore_X_Startup_Info;
struct _Ecore_X_Startup_Info
{
@@ -39,30 +39,30 @@ struct _Ecore_X_Startup_Info
int silent;
};
-static void _ecore_x_window_prop_string_utf8_set(Ecore_X_Window win,
- Ecore_X_Atom atom,
- const char *str);
-static char * _ecore_x_window_prop_string_utf8_get(Ecore_X_Window win,
- Ecore_X_Atom atom);
+static void _ecore_x_window_prop_string_utf8_set(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ const char *str);
+static char *_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win,
+ Ecore_X_Atom atom);
#if 0 /* Unused */
-static int _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info);
-static int _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info,
- char *data);
+static int _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info);
+static int _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info,
+ char *data);
#endif /* if 0 */
-static void _ecore_x_netwm_startup_info_free(void *data);
+static void _ecore_x_netwm_startup_info_free(void *data);
/*
* Convenience macros
*/
-#define _ATOM_SET_UTF8_STRING_LIST(win, atom, string, cnt)\
- XChangeProperty(_ecore_x_disp,\
- win,\
- atom,\
- ECORE_X_ATOM_UTF8_STRING,\
- 8,\
- PropModeReplace,\
- (unsigned char *)string,\
- cnt)
+#define _ATOM_SET_UTF8_STRING_LIST(win, atom, string, cnt) \
+ XChangeProperty(_ecore_x_disp, \
+ win, \
+ atom, \
+ ECORE_X_ATOM_UTF8_STRING, \
+ 8, \
+ PropModeReplace, \
+ (unsigned char *)string, \
+ cnt)
/*
* Local variables
@@ -75,7 +75,7 @@ ecore_x_netwm_init(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
startup_info = eina_hash_string_superfast_new(
- _ecore_x_netwm_startup_info_free);
+ _ecore_x_netwm_startup_info_free);
} /* ecore_x_netwm_init */
EAPI void
@@ -83,7 +83,7 @@ ecore_x_netwm_shutdown(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (startup_info)
- eina_hash_free(startup_info);
+ eina_hash_free(startup_info);
startup_info = NULL;
} /* ecore_x_netwm_shutdown */
@@ -92,8 +92,9 @@ ecore_x_netwm_shutdown(void)
* WM identification
*/
EAPI void
-ecore_x_netwm_wm_identify(Ecore_X_Window root, Ecore_X_Window check,
- const char *wm_name)
+ecore_x_netwm_wm_identify(Ecore_X_Window root,
+ Ecore_X_Window check,
+ const char *wm_name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_window_set(root,
@@ -136,19 +137,19 @@ ecore_x_netwm_supported_get(Ecore_X_Window root,
int num_ret;
if (num)
- *num = 0;
+ *num = 0;
if (supported)
- *supported = NULL;
+ *supported = NULL;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
num_ret = ecore_x_window_prop_atom_list_get(root, ECORE_X_ATOM_NET_SUPPORTED,
supported);
if (num_ret <= 0)
- return EINA_FALSE;
+ return EINA_FALSE;
if (num)
- *num = num_ret;
+ *num = num_ret;
return EINA_TRUE;
} /* ecore_x_netwm_supported_get */
@@ -157,7 +158,8 @@ ecore_x_netwm_supported_get(Ecore_X_Window root,
* Desktop configuration and status
*/
EAPI void
-ecore_x_netwm_desk_count_set(Ecore_X_Window root, unsigned int n_desks)
+ecore_x_netwm_desk_count_set(Ecore_X_Window root,
+ unsigned int n_desks)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS,
@@ -165,8 +167,9 @@ ecore_x_netwm_desk_count_set(Ecore_X_Window root, unsigned int n_desks)
} /* ecore_x_netwm_desk_count_set */
EAPI void
-ecore_x_netwm_desk_roots_set(Ecore_X_Window root,
- Ecore_X_Window *vroots, unsigned int n_desks)
+ecore_x_netwm_desk_roots_set(Ecore_X_Window root,
+ Ecore_X_Window *vroots,
+ unsigned int n_desks)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_window_set(root,
@@ -177,7 +180,8 @@ ecore_x_netwm_desk_roots_set(Ecore_X_Window root,
EAPI void
ecore_x_netwm_desk_names_set(Ecore_X_Window root,
- const char **names, unsigned int n_desks)
+ const char **names,
+ unsigned int n_desks)
{
char ss[32], *buf, *t;
const char *s;
@@ -194,8 +198,8 @@ ecore_x_netwm_desk_names_set(Ecore_X_Window root,
if (!s)
{
/* Default to "Desk-<number>" */
- sprintf(ss, "Desk-%d", i);
- s = ss;
+ sprintf(ss, "Desk-%d", i);
+ s = ss;
}
l = strlen(s) + 1;
@@ -214,8 +218,9 @@ ecore_x_netwm_desk_names_set(Ecore_X_Window root,
} /* ecore_x_netwm_desk_names_set */
EAPI void
-ecore_x_netwm_desk_size_set(Ecore_X_Window root, unsigned int width,
- unsigned int height)
+ecore_x_netwm_desk_size_set(Ecore_X_Window root,
+ unsigned int width,
+ unsigned int height)
{
unsigned int size[2];
@@ -228,7 +233,8 @@ ecore_x_netwm_desk_size_set(Ecore_X_Window root, unsigned int width,
EAPI void
ecore_x_netwm_desk_viewports_set(Ecore_X_Window root,
- unsigned int *origins, unsigned int n_desks)
+ unsigned int *origins,
+ unsigned int n_desks)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_DESKTOP_VIEWPORT,
@@ -236,9 +242,11 @@ ecore_x_netwm_desk_viewports_set(Ecore_X_Window root,
} /* ecore_x_netwm_desk_viewports_set */
EAPI void
-ecore_x_netwm_desk_layout_set(Ecore_X_Window root, int orientation,
- int columns, int rows,
- int starting_corner)
+ecore_x_netwm_desk_layout_set(Ecore_X_Window root,
+ int orientation,
+ int columns,
+ int rows,
+ int starting_corner)
{
unsigned int layout[4];
@@ -253,7 +261,8 @@ ecore_x_netwm_desk_layout_set(Ecore_X_Window root, int orientation,
EAPI void
ecore_x_netwm_desk_workareas_set(Ecore_X_Window root,
- unsigned int *areas, unsigned int n_desks)
+ unsigned int *areas,
+ unsigned int n_desks)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_WORKAREA, areas,
@@ -261,7 +270,8 @@ ecore_x_netwm_desk_workareas_set(Ecore_X_Window root,
} /* ecore_x_netwm_desk_workareas_set */
EAPI void
-ecore_x_netwm_desk_current_set(Ecore_X_Window root, unsigned int desk)
+ecore_x_netwm_desk_current_set(Ecore_X_Window root,
+ unsigned int desk)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(root, ECORE_X_ATOM_NET_CURRENT_DESKTOP, &desk,
@@ -269,7 +279,8 @@ ecore_x_netwm_desk_current_set(Ecore_X_Window root, unsigned int desk)
} /* ecore_x_netwm_desk_current_set */
EAPI void
-ecore_x_netwm_showing_desktop_set(Ecore_X_Window root, Eina_Bool on)
+ecore_x_netwm_showing_desktop_set(Ecore_X_Window root,
+ Eina_Bool on)
{
unsigned int val;
@@ -285,8 +296,9 @@ ecore_x_netwm_showing_desktop_set(Ecore_X_Window root, Eina_Bool on)
/* Mapping order */
EAPI void
-ecore_x_netwm_client_list_set(Ecore_X_Window root,
- Ecore_X_Window *p_clients, unsigned int n_clients)
+ecore_x_netwm_client_list_set(Ecore_X_Window root,
+ Ecore_X_Window *p_clients,
+ unsigned int n_clients)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_CLIENT_LIST,
@@ -305,7 +317,8 @@ ecore_x_netwm_client_list_stacking_set(Ecore_X_Window root,
} /* ecore_x_netwm_client_list_stacking_set */
EAPI void
-ecore_x_netwm_client_active_set(Ecore_X_Window root, Ecore_X_Window win)
+ecore_x_netwm_client_active_set(Ecore_X_Window root,
+ Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_window_set(root, ECORE_X_ATOM_NET_ACTIVE_WINDOW,
@@ -322,7 +335,7 @@ ecore_x_netwm_client_active_request(Ecore_X_Window root,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!root)
- root = DefaultRootWindow(_ecore_x_disp);
+ root = DefaultRootWindow(_ecore_x_disp);
xev.xclient.type = ClientMessage;
xev.xclient.display = _ecore_x_disp;
@@ -340,43 +353,48 @@ ecore_x_netwm_client_active_request(Ecore_X_Window root,
} /* ecore_x_netwm_client_active_request */
EAPI void
-ecore_x_netwm_name_set(Ecore_X_Window win, const char *name)
+ecore_x_netwm_name_set(Ecore_X_Window win,
+ const char *name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
_ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_NAME, name);
} /* ecore_x_netwm_name_set */
EAPI int
-ecore_x_netwm_name_get(Ecore_X_Window win, char **name)
+ecore_x_netwm_name_get(Ecore_X_Window win,
+ char **name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (name)
- *name = _ecore_x_window_prop_string_utf8_get(win,
- ECORE_X_ATOM_NET_WM_NAME);
+ *name = _ecore_x_window_prop_string_utf8_get(win,
+ ECORE_X_ATOM_NET_WM_NAME);
return 1;
} /* ecore_x_netwm_name_get */
EAPI void
-ecore_x_netwm_startup_id_set(Ecore_X_Window win, const char *id)
+ecore_x_netwm_startup_id_set(Ecore_X_Window win,
+ const char *id)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
_ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_STARTUP_ID, id);
} /* ecore_x_netwm_startup_id_set */
EAPI int
-ecore_x_netwm_startup_id_get(Ecore_X_Window win, char **id)
+ecore_x_netwm_startup_id_get(Ecore_X_Window win,
+ char **id)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (id)
- *id = _ecore_x_window_prop_string_utf8_get(win,
- ECORE_X_ATOM_NET_STARTUP_ID);
+ *id = _ecore_x_window_prop_string_utf8_get(win,
+ ECORE_X_ATOM_NET_STARTUP_ID);
return 1;
} /* ecore_x_netwm_startup_id_get */
EAPI void
-ecore_x_netwm_visible_name_set(Ecore_X_Window win, const char *name)
+ecore_x_netwm_visible_name_set(Ecore_X_Window win,
+ const char *name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
_ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_VISIBLE_NAME,
@@ -384,19 +402,21 @@ ecore_x_netwm_visible_name_set(Ecore_X_Window win, const char *name)
} /* ecore_x_netwm_visible_name_set */
EAPI int
-ecore_x_netwm_visible_name_get(Ecore_X_Window win, char **name)
+ecore_x_netwm_visible_name_get(Ecore_X_Window win,
+ char **name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (name)
- *name = _ecore_x_window_prop_string_utf8_get(
- win,
- ECORE_X_ATOM_NET_WM_VISIBLE_NAME);
+ *name = _ecore_x_window_prop_string_utf8_get(
+ win,
+ ECORE_X_ATOM_NET_WM_VISIBLE_NAME);
return 1;
} /* ecore_x_netwm_visible_name_get */
EAPI void
-ecore_x_netwm_icon_name_set(Ecore_X_Window win, const char *name)
+ecore_x_netwm_icon_name_set(Ecore_X_Window win,
+ const char *name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
_ecore_x_window_prop_string_utf8_set(win, ECORE_X_ATOM_NET_WM_ICON_NAME,
@@ -404,19 +424,21 @@ ecore_x_netwm_icon_name_set(Ecore_X_Window win, const char *name)
} /* ecore_x_netwm_icon_name_set */
EAPI int
-ecore_x_netwm_icon_name_get(Ecore_X_Window win, char **name)
+ecore_x_netwm_icon_name_get(Ecore_X_Window win,
+ char **name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (name)
- *name = _ecore_x_window_prop_string_utf8_get(
- win,
- ECORE_X_ATOM_NET_WM_ICON_NAME);
+ *name = _ecore_x_window_prop_string_utf8_get(
+ win,
+ ECORE_X_ATOM_NET_WM_ICON_NAME);
return 1;
} /* ecore_x_netwm_icon_name_get */
EAPI void
-ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win, const char *name)
+ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win,
+ const char *name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
_ecore_x_window_prop_string_utf8_set(win,
@@ -425,26 +447,29 @@ ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win, const char *name)
} /* ecore_x_netwm_visible_icon_name_set */
EAPI int
-ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win, char **name)
+ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win,
+ char **name)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (name)
- *name = _ecore_x_window_prop_string_utf8_get(
- win,
- ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME);
+ *name = _ecore_x_window_prop_string_utf8_get(
+ win,
+ ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME);
return 1;
} /* ecore_x_netwm_visible_icon_name_get */
EAPI void
-ecore_x_netwm_desktop_set(Ecore_X_Window win, unsigned int desk)
+ecore_x_netwm_desktop_set(Ecore_X_Window win,
+ unsigned int desk)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_DESKTOP, &desk, 1);
} /* ecore_x_netwm_desktop_set */
EAPI Eina_Bool
-ecore_x_netwm_desktop_get(Ecore_X_Window win, unsigned int *desk)
+ecore_x_netwm_desktop_get(Ecore_X_Window win,
+ unsigned int *desk)
{
int ret;
unsigned int tmp;
@@ -454,7 +479,7 @@ ecore_x_netwm_desktop_get(Ecore_X_Window win, unsigned int *desk)
&tmp, 1);
if (desk)
- *desk = tmp;
+ *desk = tmp;
return ret == 1 ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_netwm_desktop_get */
@@ -463,8 +488,11 @@ ecore_x_netwm_desktop_get(Ecore_X_Window win, unsigned int *desk)
* _NET_WM_STRUT is deprecated
*/
EAPI void
-ecore_x_netwm_strut_set(Ecore_X_Window win, int left, int right,
- int top, int bottom)
+ecore_x_netwm_strut_set(Ecore_X_Window win,
+ int left,
+ int right,
+ int top,
+ int bottom)
{
unsigned int strut[4];
@@ -480,8 +508,11 @@ ecore_x_netwm_strut_set(Ecore_X_Window win, int left, int right,
* _NET_WM_STRUT is deprecated
*/
EAPI Eina_Bool
-ecore_x_netwm_strut_get(Ecore_X_Window win, int *left, int *right,
- int *top, int *bottom)
+ecore_x_netwm_strut_get(Ecore_X_Window win,
+ int *left,
+ int *right,
+ int *top,
+ int *bottom)
{
int ret = 0;
unsigned int strut[4];
@@ -492,19 +523,19 @@ ecore_x_netwm_strut_get(Ecore_X_Window win, int *left, int *right,
strut,
4);
if (ret != 4)
- return EINA_FALSE;
+ return EINA_FALSE;
if (left)
- *left = strut[0];
+ *left = strut[0];
if (right)
- *right = strut[1];
+ *right = strut[1];
if (top)
- *top = strut[2];
+ *top = strut[2];
if (bottom)
- *bottom = strut[3];
+ *bottom = strut[3];
return EINA_TRUE;
} /* ecore_x_netwm_strut_get */
@@ -569,49 +600,51 @@ ecore_x_netwm_strut_partial_get(Ecore_X_Window win,
strut,
12);
if (ret != 12)
- return EINA_FALSE;
+ return EINA_FALSE;
if (left)
- *left = strut[0];
+ *left = strut[0];
if (right)
- *right = strut[1];
+ *right = strut[1];
if (top)
- *top = strut[2];
+ *top = strut[2];
if (bottom)
- *bottom = strut[3];
+ *bottom = strut[3];
if (left_start_y)
- *left_start_y = strut[4];
+ *left_start_y = strut[4];
if (left_end_y)
- *left_end_y = strut[5];
+ *left_end_y = strut[5];
if (right_start_y)
- *right_start_y = strut[6];
+ *right_start_y = strut[6];
if (right_end_y)
- *right_end_y = strut[7];
+ *right_end_y = strut[7];
if (top_start_x)
- *top_start_x = strut[8];
+ *top_start_x = strut[8];
if (top_end_x)
- *top_end_x = strut[9];
+ *top_end_x = strut[9];
if (bottom_start_x)
- *bottom_start_x = strut[10];
+ *bottom_start_x = strut[10];
if (bottom_end_x)
- *bottom_end_x = strut[11];
+ *bottom_end_x = strut[11];
return EINA_TRUE;
} /* ecore_x_netwm_strut_partial_get */
EAPI Eina_Bool
-ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num)
+ecore_x_netwm_icons_get(Ecore_X_Window win,
+ Ecore_X_Icon **icon,
+ int *num)
{
unsigned int *data, *p;
unsigned int *src;
@@ -620,18 +653,18 @@ ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (num)
- *num = 0;
+ *num = 0;
if (icon)
- *icon = NULL;
+ *icon = NULL;
num_ret = ecore_x_window_prop_card32_list_get(win, ECORE_X_ATOM_NET_WM_ICON,
&data);
if (num_ret <= 0)
- return EINA_FALSE;
+ return EINA_FALSE;
if (!data)
- return EINA_FALSE;
+ return EINA_FALSE;
if (num_ret < 2)
{
@@ -655,10 +688,10 @@ ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num)
icons++;
if ((p - data) == num_ret)
- p = NULL;
+ p = NULL;
}
if (num)
- *num = icons;
+ *num = icons;
/* If the user doesn't want the icons, return */
if (!icon)
@@ -689,7 +722,7 @@ ecore_x_netwm_icons_get(Ecore_X_Window win, Ecore_X_Icon **icon, int *num)
if (!((*icon)[i]).data)
{
while (i)
- free(((*icon)[--i]).data);
+ free(((*icon)[--i]).data);
free(*icon);
free(data);
return EINA_FALSE;
@@ -753,25 +786,26 @@ ecore_x_netwm_icon_geometry_get(Ecore_X_Window win,
geometry,
4);
if (ret != 4)
- return EINA_FALSE;
+ return EINA_FALSE;
if (x)
- *x = geometry[0];
+ *x = geometry[0];
if (y)
- *y = geometry[1];
+ *y = geometry[1];
if (width)
- *width = geometry[2];
+ *width = geometry[2];
if (height)
- *height = geometry[3];
+ *height = geometry[3];
return EINA_TRUE;
} /* ecore_x_netwm_icon_geometry_get */
EAPI void
-ecore_x_netwm_pid_set(Ecore_X_Window win, int pid)
+ecore_x_netwm_pid_set(Ecore_X_Window win,
+ int pid)
{
unsigned int tmp;
@@ -782,7 +816,8 @@ ecore_x_netwm_pid_set(Ecore_X_Window win, int pid)
} /* ecore_x_netwm_pid_set */
EAPI Eina_Bool
-ecore_x_netwm_pid_get(Ecore_X_Window win, int *pid)
+ecore_x_netwm_pid_get(Ecore_X_Window win,
+ int *pid)
{
int ret;
unsigned int tmp;
@@ -791,7 +826,7 @@ ecore_x_netwm_pid_get(Ecore_X_Window win, int *pid)
ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_PID,
&tmp, 1);
if (pid)
- *pid = tmp;
+ *pid = tmp;
return ret == 1 ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_netwm_pid_get */
@@ -815,7 +850,8 @@ ecore_x_netwm_handled_icons_get(Ecore_X_Window win)
} /* ecore_x_netwm_handled_icons_get */
EAPI void
-ecore_x_netwm_user_time_set(Ecore_X_Window win, unsigned int tim)
+ecore_x_netwm_user_time_set(Ecore_X_Window win,
+ unsigned int tim)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_USER_TIME,
@@ -823,7 +859,8 @@ ecore_x_netwm_user_time_set(Ecore_X_Window win, unsigned int tim)
} /* ecore_x_netwm_user_time_set */
EAPI Eina_Bool
-ecore_x_netwm_user_time_get(Ecore_X_Window win, unsigned int *tim)
+ecore_x_netwm_user_time_get(Ecore_X_Window win,
+ unsigned int *tim)
{
int ret;
unsigned int tmp;
@@ -832,7 +869,7 @@ ecore_x_netwm_user_time_get(Ecore_X_Window win, unsigned int *tim)
ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_USER_TIME,
&tmp, 1);
if (tim)
- *tim = tmp;
+ *tim = tmp;
return ret == 1 ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_netwm_user_time_get */
@@ -841,31 +878,31 @@ Ecore_X_Window_State
_ecore_x_netwm_state_get(Ecore_X_Atom a)
{
if (a == ECORE_X_ATOM_NET_WM_STATE_MODAL)
- return ECORE_X_WINDOW_STATE_MODAL;
+ return ECORE_X_WINDOW_STATE_MODAL;
else if (a == ECORE_X_ATOM_NET_WM_STATE_STICKY)
- return ECORE_X_WINDOW_STATE_STICKY;
+ return ECORE_X_WINDOW_STATE_STICKY;
else if (a == ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT)
- return ECORE_X_WINDOW_STATE_MAXIMIZED_VERT;
+ return ECORE_X_WINDOW_STATE_MAXIMIZED_VERT;
else if (a == ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ)
- return ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ;
+ return ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ;
else if (a == ECORE_X_ATOM_NET_WM_STATE_SHADED)
- return ECORE_X_WINDOW_STATE_SHADED;
+ return ECORE_X_WINDOW_STATE_SHADED;
else if (a == ECORE_X_ATOM_NET_WM_STATE_SKIP_TASKBAR)
- return ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
+ return ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
else if (a == ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER)
- return ECORE_X_WINDOW_STATE_SKIP_PAGER;
+ return ECORE_X_WINDOW_STATE_SKIP_PAGER;
else if (a == ECORE_X_ATOM_NET_WM_STATE_HIDDEN)
- return ECORE_X_WINDOW_STATE_HIDDEN;
+ return ECORE_X_WINDOW_STATE_HIDDEN;
else if (a == ECORE_X_ATOM_NET_WM_STATE_FULLSCREEN)
- return ECORE_X_WINDOW_STATE_FULLSCREEN;
+ return ECORE_X_WINDOW_STATE_FULLSCREEN;
else if (a == ECORE_X_ATOM_NET_WM_STATE_ABOVE)
- return ECORE_X_WINDOW_STATE_ABOVE;
+ return ECORE_X_WINDOW_STATE_ABOVE;
else if (a == ECORE_X_ATOM_NET_WM_STATE_BELOW)
- return ECORE_X_WINDOW_STATE_BELOW;
+ return ECORE_X_WINDOW_STATE_BELOW;
else if (a == ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION)
- return ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION;
+ return ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION;
else
- return ECORE_X_WINDOW_STATE_UNKNOWN;
+ return ECORE_X_WINDOW_STATE_UNKNOWN;
} /* _ecore_x_netwm_state_get */
static Ecore_X_Atom
@@ -874,43 +911,43 @@ _ecore_x_netwm_state_atom_get(Ecore_X_Window_State s)
switch(s)
{
case ECORE_X_WINDOW_STATE_MODAL:
- return ECORE_X_ATOM_NET_WM_STATE_MODAL;
+ return ECORE_X_ATOM_NET_WM_STATE_MODAL;
case ECORE_X_WINDOW_STATE_STICKY:
- return ECORE_X_ATOM_NET_WM_STATE_STICKY;
+ return ECORE_X_ATOM_NET_WM_STATE_STICKY;
case ECORE_X_WINDOW_STATE_MAXIMIZED_VERT:
- return ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT;
+ return ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT;
case ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ:
- return ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ;
+ return ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ;
case ECORE_X_WINDOW_STATE_SHADED:
- return ECORE_X_ATOM_NET_WM_STATE_SHADED;
+ return ECORE_X_ATOM_NET_WM_STATE_SHADED;
case ECORE_X_WINDOW_STATE_SKIP_TASKBAR:
- return ECORE_X_ATOM_NET_WM_STATE_SKIP_TASKBAR;
+ return ECORE_X_ATOM_NET_WM_STATE_SKIP_TASKBAR;
case ECORE_X_WINDOW_STATE_SKIP_PAGER:
- return ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER;
+ return ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER;
case ECORE_X_WINDOW_STATE_HIDDEN:
- return ECORE_X_ATOM_NET_WM_STATE_HIDDEN;
+ return ECORE_X_ATOM_NET_WM_STATE_HIDDEN;
case ECORE_X_WINDOW_STATE_FULLSCREEN:
- return ECORE_X_ATOM_NET_WM_STATE_FULLSCREEN;
+ return ECORE_X_ATOM_NET_WM_STATE_FULLSCREEN;
case ECORE_X_WINDOW_STATE_ABOVE:
- return ECORE_X_ATOM_NET_WM_STATE_ABOVE;
+ return ECORE_X_ATOM_NET_WM_STATE_ABOVE;
case ECORE_X_WINDOW_STATE_BELOW:
- return ECORE_X_ATOM_NET_WM_STATE_BELOW;
+ return ECORE_X_ATOM_NET_WM_STATE_BELOW;
case ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION:
- return ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION;
+ return ECORE_X_ATOM_NET_WM_STATE_DEMANDS_ATTENTION;
default:
- return 0;
+ return 0;
} /* switch */
} /* _ecore_x_netwm_state_atom_get */
@@ -931,10 +968,10 @@ ecore_x_netwm_window_state_set(Ecore_X_Window win,
set = malloc(num * sizeof(Ecore_X_Atom));
if (!set)
- return;
+ return;
for (i = 0; i < num; i++)
- set[i] = _ecore_x_netwm_state_atom_get(state[i]);
+ set[i] = _ecore_x_netwm_state_atom_get(state[i]);
ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_NET_WM_STATE, set, num);
@@ -951,25 +988,25 @@ ecore_x_netwm_window_state_get(Ecore_X_Window win,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (num)
- *num = 0;
+ *num = 0;
if (state)
- *state = NULL;
+ *state = NULL;
num_ret = ecore_x_window_prop_atom_list_get(win, ECORE_X_ATOM_NET_WM_STATE,
&atoms);
if (num_ret <= 0)
- return EINA_FALSE;
+ return EINA_FALSE;
if (state)
{
*state = malloc(num_ret * sizeof(Ecore_X_Window_State));
if (*state)
- for (i = 0; i < num_ret; ++i)
- (*state)[i] = _ecore_x_netwm_state_get(atoms[i]);
+ for (i = 0; i < num_ret; ++i)
+ (*state)[i] = _ecore_x_netwm_state_get(atoms[i]);
if (num)
- *num = num_ret;
+ *num = num_ret;
}
free(atoms);
@@ -980,35 +1017,35 @@ static Ecore_X_Window_Type
_ecore_x_netwm_window_type_type_get(Ecore_X_Atom atom)
{
if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DESKTOP)
- return ECORE_X_WINDOW_TYPE_DESKTOP;
+ return ECORE_X_WINDOW_TYPE_DESKTOP;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DOCK)
- return ECORE_X_WINDOW_TYPE_DOCK;
+ return ECORE_X_WINDOW_TYPE_DOCK;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR)
- return ECORE_X_WINDOW_TYPE_TOOLBAR;
+ return ECORE_X_WINDOW_TYPE_TOOLBAR;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_MENU)
- return ECORE_X_WINDOW_TYPE_MENU;
+ return ECORE_X_WINDOW_TYPE_MENU;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_UTILITY)
- return ECORE_X_WINDOW_TYPE_UTILITY;
+ return ECORE_X_WINDOW_TYPE_UTILITY;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_SPLASH)
- return ECORE_X_WINDOW_TYPE_SPLASH;
+ return ECORE_X_WINDOW_TYPE_SPLASH;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DIALOG)
- return ECORE_X_WINDOW_TYPE_DIALOG;
+ return ECORE_X_WINDOW_TYPE_DIALOG;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL)
- return ECORE_X_WINDOW_TYPE_NORMAL;
+ return ECORE_X_WINDOW_TYPE_NORMAL;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DROPDOWN_MENU)
- return ECORE_X_WINDOW_TYPE_DROPDOWN_MENU;
+ return ECORE_X_WINDOW_TYPE_DROPDOWN_MENU;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_POPUP_MENU)
- return ECORE_X_WINDOW_TYPE_POPUP_MENU;
+ return ECORE_X_WINDOW_TYPE_POPUP_MENU;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLTIP)
- return ECORE_X_WINDOW_TYPE_TOOLTIP;
+ return ECORE_X_WINDOW_TYPE_TOOLTIP;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NOTIFICATION)
- return ECORE_X_WINDOW_TYPE_NOTIFICATION;
+ return ECORE_X_WINDOW_TYPE_NOTIFICATION;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_COMBO)
- return ECORE_X_WINDOW_TYPE_COMBO;
+ return ECORE_X_WINDOW_TYPE_COMBO;
else if (atom == ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DND)
- return ECORE_X_WINDOW_TYPE_DND;
+ return ECORE_X_WINDOW_TYPE_DND;
else
- return ECORE_X_WINDOW_TYPE_UNKNOWN;
+ return ECORE_X_WINDOW_TYPE_UNKNOWN;
} /* _ecore_x_netwm_window_type_type_get */
static Ecore_X_Atom
@@ -1017,49 +1054,49 @@ _ecore_x_netwm_window_type_atom_get(Ecore_X_Window_Type type)
switch (type)
{
case ECORE_X_WINDOW_TYPE_DESKTOP:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DESKTOP;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DESKTOP;
case ECORE_X_WINDOW_TYPE_DOCK:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DOCK;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DOCK;
case ECORE_X_WINDOW_TYPE_TOOLBAR:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR;
case ECORE_X_WINDOW_TYPE_MENU:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_MENU;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_MENU;
case ECORE_X_WINDOW_TYPE_UTILITY:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_UTILITY;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_UTILITY;
case ECORE_X_WINDOW_TYPE_SPLASH:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_SPLASH;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_SPLASH;
case ECORE_X_WINDOW_TYPE_DIALOG:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DIALOG;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DIALOG;
case ECORE_X_WINDOW_TYPE_NORMAL:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL;
case ECORE_X_WINDOW_TYPE_DROPDOWN_MENU:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DROPDOWN_MENU;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DROPDOWN_MENU;
case ECORE_X_WINDOW_TYPE_POPUP_MENU:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_POPUP_MENU;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_POPUP_MENU;
case ECORE_X_WINDOW_TYPE_TOOLTIP:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLTIP;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLTIP;
case ECORE_X_WINDOW_TYPE_NOTIFICATION:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NOTIFICATION;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NOTIFICATION;
case ECORE_X_WINDOW_TYPE_COMBO:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_COMBO;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_COMBO;
case ECORE_X_WINDOW_TYPE_DND:
- return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DND;
+ return ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DND;
default:
- return 0;
+ return 0;
} /* switch */
} /* _ecore_x_netwm_window_type_atom_get */
@@ -1068,7 +1105,8 @@ _ecore_x_netwm_window_type_atom_get(Ecore_X_Window_Type type)
* , ECORE_X_WINDOW_TYPE_MENU or ECORE_X_WINDOW_TYPE_DIALOG
*/
EAPI void
-ecore_x_netwm_window_type_set(Ecore_X_Window win, Ecore_X_Window_Type type)
+ecore_x_netwm_window_type_set(Ecore_X_Window win,
+ Ecore_X_Window_Type type)
{
Ecore_X_Atom atom;
@@ -1080,30 +1118,32 @@ ecore_x_netwm_window_type_set(Ecore_X_Window win, Ecore_X_Window_Type type)
/* FIXME: Maybe return 0 on some conditions? */
EAPI Eina_Bool
-ecore_x_netwm_window_type_get(Ecore_X_Window win, Ecore_X_Window_Type *type)
+ecore_x_netwm_window_type_get(Ecore_X_Window win,
+ Ecore_X_Window_Type *type)
{
int num;
Ecore_X_Atom *atoms = NULL;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (type)
- *type = ECORE_X_WINDOW_TYPE_NORMAL;
+ *type = ECORE_X_WINDOW_TYPE_NORMAL;
num = ecore_x_window_prop_atom_list_get(win,
ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
&atoms);
if ((type) && (num >= 1) && (atoms))
- *type = _ecore_x_netwm_window_type_type_get(atoms[0]);
+ *type = _ecore_x_netwm_window_type_type_get(atoms[0]);
free(atoms);
if (num >= 1)
- return EINA_TRUE;
+ return EINA_TRUE;
return EINA_FALSE;
} /* ecore_x_netwm_window_type_get */
EAPI int
-ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
+ecore_x_netwm_window_types_get(Ecore_X_Window win,
+ Ecore_X_Window_Type **types)
{
int num, i;
Ecore_X_Atom *atoms = NULL;
@@ -1111,7 +1151,7 @@ ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (types)
- *types = NULL;
+ *types = NULL;
num = ecore_x_window_prop_atom_list_get(win,
ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
@@ -1119,22 +1159,22 @@ ecore_x_netwm_window_types_get(Ecore_X_Window win, Ecore_X_Window_Type **types)
if ((num <= 0) || (!atoms))
{
if (atoms)
- free(atoms);
+ free(atoms);
return 0;
}
atoms2 = malloc(num * sizeof(Ecore_X_Window_Type));
if (!atoms2)
- return 0;
+ return 0;
for (i = 0; i < num; i++)
- atoms2[i] = _ecore_x_netwm_window_type_type_get(atoms[i]);
+ atoms2[i] = _ecore_x_netwm_window_type_type_get(atoms[i]);
free(atoms);
if (types)
- *types = atoms2;
+ *types = atoms2;
else
- free(atoms2);
+ free(atoms2);
return num;
} /* ecore_x_netwm_window_types_get */
@@ -1145,51 +1185,52 @@ _ecore_x_netwm_action_atom_get(Ecore_X_Action action)
switch (action)
{
case ECORE_X_ACTION_MOVE:
- return ECORE_X_ATOM_NET_WM_ACTION_MOVE;
+ return ECORE_X_ATOM_NET_WM_ACTION_MOVE;
case ECORE_X_ACTION_RESIZE:
- return ECORE_X_ATOM_NET_WM_ACTION_RESIZE;
+ return ECORE_X_ATOM_NET_WM_ACTION_RESIZE;
case ECORE_X_ACTION_MINIMIZE:
- return ECORE_X_ATOM_NET_WM_ACTION_MINIMIZE;
+ return ECORE_X_ATOM_NET_WM_ACTION_MINIMIZE;
case ECORE_X_ACTION_SHADE:
- return ECORE_X_ATOM_NET_WM_ACTION_SHADE;
+ return ECORE_X_ATOM_NET_WM_ACTION_SHADE;
case ECORE_X_ACTION_STICK:
- return ECORE_X_ATOM_NET_WM_ACTION_STICK;
+ return ECORE_X_ATOM_NET_WM_ACTION_STICK;
case ECORE_X_ACTION_MAXIMIZE_HORZ:
- return ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_HORZ;
+ return ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_HORZ;
case ECORE_X_ACTION_MAXIMIZE_VERT:
- return ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_VERT;
+ return ECORE_X_ATOM_NET_WM_ACTION_MAXIMIZE_VERT;
case ECORE_X_ACTION_FULLSCREEN:
- return ECORE_X_ATOM_NET_WM_ACTION_FULLSCREEN;
+ return ECORE_X_ATOM_NET_WM_ACTION_FULLSCREEN;
case ECORE_X_ACTION_CHANGE_DESKTOP:
- return ECORE_X_ATOM_NET_WM_ACTION_CHANGE_DESKTOP;
+ return ECORE_X_ATOM_NET_WM_ACTION_CHANGE_DESKTOP;
case ECORE_X_ACTION_CLOSE:
- return ECORE_X_ATOM_NET_WM_ACTION_CLOSE;
+ return ECORE_X_ATOM_NET_WM_ACTION_CLOSE;
case ECORE_X_ACTION_ABOVE:
- return ECORE_X_ATOM_NET_WM_ACTION_ABOVE;
+ return ECORE_X_ATOM_NET_WM_ACTION_ABOVE;
case ECORE_X_ACTION_BELOW:
- return ECORE_X_ATOM_NET_WM_ACTION_BELOW;
+ return ECORE_X_ATOM_NET_WM_ACTION_BELOW;
default:
- return 0;
+ return 0;
} /* switch */
} /* _ecore_x_netwm_action_atom_get */
/* FIXME: Get complete list */
EAPI Eina_Bool
-ecore_x_netwm_allowed_action_isset(Ecore_X_Window win, Ecore_X_Action action)
+ecore_x_netwm_allowed_action_isset(Ecore_X_Window win,
+ Ecore_X_Action action)
{
- int num, i;
+ int num, i;
Ecore_X_Atom *atoms, atom;
Eina_Bool ret = EINA_FALSE;
@@ -1197,7 +1238,7 @@ ecore_x_netwm_allowed_action_isset(Ecore_X_Window win, Ecore_X_Action action)
num = ecore_x_window_prop_atom_list_get(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
&atoms);
if (num <= 0)
- return ret;
+ return ret;
atom = _ecore_x_netwm_action_atom_get(action);
@@ -1233,10 +1274,10 @@ ecore_x_netwm_allowed_action_set(Ecore_X_Window win,
set = malloc(num * sizeof(Ecore_X_Atom));
if (!set)
- return;
+ return;
for (i = 0; i < num; i++)
- set[i] = _ecore_x_netwm_action_atom_get(action[i]);
+ set[i] = _ecore_x_netwm_action_atom_get(action[i]);
ecore_x_window_prop_atom_set(win,
ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS,
@@ -1256,27 +1297,27 @@ ecore_x_netwm_allowed_action_get(Ecore_X_Window win,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (num)
- *num = 0;
+ *num = 0;
if (action)
- *action = NULL;
+ *action = NULL;
num_ret = ecore_x_window_prop_atom_list_get(
- win,
- ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS,
- &atoms);
+ win,
+ ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS,
+ &atoms);
if (num_ret <= 0)
- return EINA_FALSE;
+ return EINA_FALSE;
if (action)
{
*action = malloc(num_ret * sizeof(Ecore_X_Action));
if (*action)
- for (i = 0; i < num_ret; ++i)
- (*action)[i] = _ecore_x_netwm_action_atom_get(atoms[i]);
+ for (i = 0; i < num_ret; ++i)
+ (*action)[i] = _ecore_x_netwm_action_atom_get(atoms[i]);
if (num)
- *num = num_ret;
+ *num = num_ret;
}
free(atoms);
@@ -1284,7 +1325,8 @@ ecore_x_netwm_allowed_action_get(Ecore_X_Window win,
} /* ecore_x_netwm_allowed_action_get */
EAPI void
-ecore_x_netwm_opacity_set(Ecore_X_Window win, unsigned int opacity)
+ecore_x_netwm_opacity_set(Ecore_X_Window win,
+ unsigned int opacity)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY,
@@ -1292,7 +1334,8 @@ ecore_x_netwm_opacity_set(Ecore_X_Window win, unsigned int opacity)
} /* ecore_x_netwm_opacity_set */
EAPI Eina_Bool
-ecore_x_netwm_opacity_get(Ecore_X_Window win, unsigned int *opacity)
+ecore_x_netwm_opacity_get(Ecore_X_Window win,
+ unsigned int *opacity)
{
int ret;
unsigned int tmp;
@@ -1301,13 +1344,17 @@ ecore_x_netwm_opacity_get(Ecore_X_Window win, unsigned int *opacity)
ret = ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY,
&tmp, 1);
if (opacity)
- *opacity = tmp;
+ *opacity = tmp;
return ret == 1 ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_netwm_opacity_get */
EAPI void
-ecore_x_netwm_frame_size_set(Ecore_X_Window win, int fl, int fr, int ft, int fb)
+ecore_x_netwm_frame_size_set(Ecore_X_Window win,
+ int fl,
+ int fr,
+ int ft,
+ int fb)
{
unsigned int frames[4];
@@ -1338,19 +1385,19 @@ ecore_x_netwm_frame_size_get(Ecore_X_Window win,
frames,
4);
if (ret != 4)
- return EINA_FALSE;
+ return EINA_FALSE;
if (fl)
- *fl = frames[0];
+ *fl = frames[0];
if (fr)
- *fr = frames[1];
+ *fr = frames[1];
if (ft)
- *ft = frames[2];
+ *ft = frames[2];
if (fb)
- *fb = frames[3];
+ *fb = frames[3];
return EINA_TRUE;
} /* ecore_x_netwm_frame_size_get */
@@ -1364,13 +1411,13 @@ ecore_x_netwm_sync_counter_get(Ecore_X_Window win,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ret = ecore_x_window_prop_card32_get(
- win,
- ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER,
- &tmp,
- 1);
+ win,
+ ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER,
+ &tmp,
+ 1);
if (counter)
- *counter = tmp;
+ *counter = tmp;
return ret == 1 ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_netwm_sync_counter_get */
@@ -1381,7 +1428,7 @@ ecore_x_netwm_ping_send(Ecore_X_Window win)
XEvent xev;
if (!win)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
xev.xclient.type = ClientMessage;
@@ -1399,13 +1446,14 @@ ecore_x_netwm_ping_send(Ecore_X_Window win)
} /* ecore_x_netwm_ping_send */
EAPI void
-ecore_x_netwm_sync_request_send(Ecore_X_Window win, unsigned int serial)
+ecore_x_netwm_sync_request_send(Ecore_X_Window win,
+ unsigned int serial)
{
XSyncValue value;
XEvent xev;
if (!win)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XSyncIntToValue(&value, (int)serial);
@@ -1434,11 +1482,11 @@ ecore_x_netwm_state_request_send(Ecore_X_Window win,
XEvent xev;
if (!win)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!root)
- root = DefaultRootWindow(_ecore_x_disp);
+ root = DefaultRootWindow(_ecore_x_disp);
xev.xclient.type = ClientMessage;
xev.xclient.serial = 0;
@@ -1467,11 +1515,11 @@ ecore_x_netwm_desktop_request_send(Ecore_X_Window win,
XEvent xev;
if (!win)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!root)
- root = DefaultRootWindow(_ecore_x_disp);
+ root = DefaultRootWindow(_ecore_x_disp);
xev.xclient.type = ClientMessage;
xev.xclient.serial = 0;
@@ -1488,14 +1536,14 @@ ecore_x_netwm_desktop_request_send(Ecore_X_Window win,
int
_ecore_x_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__,
- char *data __UNUSED__)
+ char *data __UNUSED__)
{
#if 0
Ecore_X_Startup_Info *info;
unsigned char *exists = 0;
if (!startup_info)
- return 0;
+ return 0;
info = eina_hash_find(startup_info, (void *)win);
if (info)
@@ -1507,7 +1555,7 @@ _ecore_x_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__,
info = calloc(1, sizeof(Ecore_X_Startup_Info));
if (!info)
- return 0;
+ return 0;
info->win = win;
info->length = 0;
@@ -1523,13 +1571,13 @@ _ecore_x_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__,
info->length += 20;
info->buffer[info->length] = 0;
if (exists)
- eina_hash_modify(startup_info, (void *)info->win, info);
+ eina_hash_modify(startup_info, (void *)info->win, info);
else
- eina_hash_add(startup_info, (void *)info->win, info);
+ eina_hash_add(startup_info, (void *)info->win, info);
if (strlen(info->buffer) != 20)
- /* We have a '\0' in there, the message is done */
- _ecore_x_netwm_startup_info_process(info);
+ /* We have a '\0' in there, the message is done */
+ _ecore_x_netwm_startup_info_process(info);
#endif /* if 0 */
return 1;
@@ -1537,18 +1585,18 @@ _ecore_x_netwm_startup_info_begin(Ecore_X_Window win __UNUSED__,
int
_ecore_x_netwm_startup_info(Ecore_X_Window win __UNUSED__,
- char *data __UNUSED__)
+ char *data __UNUSED__)
{
#if 0
Ecore_X_Startup_Info *info;
char *p;
if (!startup_info)
- return 0;
+ return 0;
info = eina_hash_find(startup_info, (void *)win);
if (!info)
- return 0;
+ return 0;
if ((info->length + 20) > info->buffer_size)
{
@@ -1567,8 +1615,8 @@ _ecore_x_netwm_startup_info(Ecore_X_Window win __UNUSED__,
info->length += 20;
info->buffer[info->length] = 0;
if (strlen(p) != 20)
- /* We have a '\0' in there, the message is done */
- _ecore_x_netwm_startup_info_process(info);
+ /* We have a '\0' in there, the message is done */
+ _ecore_x_netwm_startup_info_process(info);
#endif /* if 0 */
return 1;
@@ -1578,8 +1626,9 @@ _ecore_x_netwm_startup_info(Ecore_X_Window win __UNUSED__,
* Set UTF-8 string property
*/
static void
-_ecore_x_window_prop_string_utf8_set(Ecore_X_Window win, Ecore_X_Atom atom,
- const char *str)
+_ecore_x_window_prop_string_utf8_set(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ const char *str)
{
XChangeProperty(_ecore_x_disp, win, atom, ECORE_X_ATOM_UTF8_STRING, 8,
PropModeReplace, (unsigned char *)str, strlen(str));
@@ -1589,7 +1638,8 @@ _ecore_x_window_prop_string_utf8_set(Ecore_X_Window win, Ecore_X_Atom atom,
* Get UTF-8 string property
*/
static char *
-_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, Ecore_X_Atom atom)
+_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win,
+ Ecore_X_Atom atom)
{
char *str;
unsigned char *prop_ret;
@@ -1613,7 +1663,7 @@ _ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, Ecore_X_Atom atom)
}
if (prop_ret)
- XFree(prop_ret);
+ XFree(prop_ret);
return str;
} /* _ecore_x_window_prop_string_utf8_get */
@@ -1641,16 +1691,16 @@ _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info)
if (!strcmp(info->buffer, "new"))
{
if (info->init)
- event = ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE;
+ event = ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE;
else
- event = ECORE_X_EVENT_STARTUP_SEQUENCE_NEW;
+ event = ECORE_X_EVENT_STARTUP_SEQUENCE_NEW;
info->init = 1;
}
else if (!strcmp(info->buffer, "change"))
- event = ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE;
+ event = ECORE_X_EVENT_STARTUP_SEQUENCE_CHANGE;
else if (!strcmp(info->buffer, "remove"))
- event = ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE;
+ event = ECORE_X_EVENT_STARTUP_SEQUENCE_REMOVE;
else
{
eina_hash_del(startup_info, (void *)info->win);
@@ -1689,8 +1739,8 @@ _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info)
else
{
/* Discard buffer */
- info->length = 0;
- info->buffer[0] = 0;
+ info->length = 0;
+ info->buffer[0] = 0;
}
return 1;
@@ -1700,7 +1750,8 @@ _ecore_x_netwm_startup_info_process(Ecore_X_Startup_Info *info)
* Parse startup info
*/
static int
-_ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, char *data)
+_ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info,
+ char *data)
{
while (*data)
{
@@ -1715,7 +1766,7 @@ _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, char *data)
key = data;
data = strchr(key, '=');
if (!data)
- return 0;
+ return 0;
*data = 0;
data++;
@@ -1729,7 +1780,7 @@ _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, char *data)
while (*p)
{
if ((pp - value) >= 1024)
- return 0;
+ return 0;
if (escaped)
{
@@ -1740,9 +1791,9 @@ _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, char *data)
else if (in_quot_sing)
{
if (*p == '\\')
- escaped = 1;
+ escaped = 1;
else if (*p == '\'')
- in_quot_sing = 0;
+ in_quot_sing = 0;
else
{
*pp = *p;
@@ -1752,9 +1803,9 @@ _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, char *data)
else if (in_quot_dbl)
{
if (*p == '\\')
- escaped = 1;
+ escaped = 1;
else if (*p == '\"')
- in_quot_dbl = 0;
+ in_quot_dbl = 0;
else
{
*pp = *p;
@@ -1764,13 +1815,13 @@ _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, char *data)
else
{
if (*p == '\\')
- escaped = 1;
+ escaped = 1;
else if (*p == '\'')
- in_quot_sing = 1;
+ in_quot_sing = 1;
else if (*p == '\"')
- in_quot_dbl = 1;
+ in_quot_dbl = 1;
else if (*p == ' ')
- break;
+ break;
else
{
*pp = *p;
@@ -1781,7 +1832,7 @@ _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, char *data)
p++;
}
if ((in_quot_dbl) || (in_quot_sing))
- return 0;
+ return 0;
data = p;
*pp = 0;
@@ -1790,64 +1841,64 @@ _ecore_x_netwm_startup_info_parse(Ecore_X_Startup_Info *info, char *data)
if (!strcmp(key, "ID"))
{
if ((info->id) && (strcmp(info->id, value)))
- return 0;
+ return 0;
info->id = strdup(value);
p = strstr(value, "_TIME");
if (p)
- info->timestamp = atoi(p + 5);
+ info->timestamp = atoi(p + 5);
}
else if (!strcmp(key, "NAME"))
{
if (info->name)
- free(info->name);
+ free(info->name);
info->name = strdup(value);
}
else if (!strcmp(key, "SCREEN"))
- info->screen = atoi(value);
+ info->screen = atoi(value);
else if (!strcmp(key, "BIN"))
{
if (info->bin)
- free(info->bin);
+ free(info->bin);
info->bin = strdup(value);
}
else if (!strcmp(key, "ICON"))
{
if (info->icon)
- free(info->icon);
+ free(info->icon);
info->icon = strdup(value);
}
else if (!strcmp(key, "DESKTOP"))
- info->desktop = atoi(value);
+ info->desktop = atoi(value);
else if (!strcmp(key, "TIMESTAMP"))
{
if (!info->timestamp)
- info->timestamp = atoi(value);
+ info->timestamp = atoi(value);
}
else if (!strcmp(key, "DESCRIPTION"))
{
if (info->description)
- free(info->description);
+ free(info->description);
info->description = strdup(value);
}
else if (!strcmp(key, "WMCLASS"))
{
if (info->wmclass)
- free(info->wmclass);
+ free(info->wmclass);
info->wmclass = strdup(value);
}
else if (!strcmp(key, "SILENT"))
- info->silent = atoi(value);
+ info->silent = atoi(value);
else
- ERR("Ecore X Sequence, Unknown: %s=%s", key, value);
+ ERR("Ecore X Sequence, Unknown: %s=%s", key, value);
}
if (!info->id)
- return 0;
+ return 0;
return 1;
} /* _ecore_x_netwm_startup_info_parse */
@@ -1864,28 +1915,28 @@ _ecore_x_netwm_startup_info_free(void *data)
info = data;
if (!info)
- return;
+ return;
if (info->buffer)
- free(info->buffer);
+ free(info->buffer);
if (info->id)
- free(info->id);
+ free(info->id);
if (info->name)
- free(info->name);
+ free(info->name);
if (info->bin)
- free(info->bin);
+ free(info->bin);
if (info->icon)
- free(info->icon);
+ free(info->icon);
if (info->description)
- free(info->description);
+ free(info->description);
if (info->wmclass)
- free(info->wmclass);
+ free(info->wmclass);
free(info);
} /* _ecore_x_netwm_startup_info_free */
@@ -1903,10 +1954,10 @@ ecore_x_screen_is_composited(int screen)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
snprintf(buf, sizeof(buf), "_NET_WM_CM_S%i", screen);
if (atom == None)
- atom = XInternAtom(_ecore_x_disp, buf, False);
+ atom = XInternAtom(_ecore_x_disp, buf, False);
if (atom == None)
- return EINA_FALSE;
+ return EINA_FALSE;
win = XGetSelectionOwner(_ecore_x_disp, atom);
@@ -1914,7 +1965,8 @@ ecore_x_screen_is_composited(int screen)
} /* ecore_x_screen_is_composited */
EAPI void
-ecore_x_screen_is_composited_set(int screen, Ecore_X_Window win)
+ecore_x_screen_is_composited_set(int screen,
+ Ecore_X_Window win)
{
static Ecore_X_Atom atom = None;
char buf[32];
@@ -1922,10 +1974,10 @@ ecore_x_screen_is_composited_set(int screen, Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
snprintf(buf, sizeof(buf), "_NET_WM_CM_S%i", screen);
if (atom == None)
- atom = XInternAtom(_ecore_x_disp, buf, False);
+ atom = XInternAtom(_ecore_x_disp, buf, False);
if (atom == None)
- return;
+ return;
XSetSelectionOwner(_ecore_x_disp, atom, win, _ecore_x_event_last_time);
} /* ecore_x_screen_is_composited_set */
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_pixmap.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_pixmap.c
index 2d237410c8..b81d06c3c9 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_pixmap.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_pixmap.c
@@ -25,14 +25,17 @@
* @ingroup Ecore_X_Pixmap_Group
*/
EAPI Ecore_X_Pixmap
-ecore_x_pixmap_new(Ecore_X_Window win, int w, int h, int dep)
+ecore_x_pixmap_new(Ecore_X_Window win,
+ int w,
+ int h,
+ int dep)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (win == 0)
- win = DefaultRootWindow(_ecore_x_disp);
+ win = DefaultRootWindow(_ecore_x_disp);
if (dep == 0)
- dep = DefaultDepth(_ecore_x_disp, DefaultScreen(_ecore_x_disp));
+ dep = DefaultDepth(_ecore_x_disp, DefaultScreen(_ecore_x_disp));
return XCreatePixmap(_ecore_x_disp, win, w, h, dep);
} /* ecore_x_pixmap_new */
@@ -68,9 +71,15 @@ ecore_x_pixmap_free(Ecore_X_Pixmap pmap)
* @ingroup Ecore_X_Pixmap_Group
*/
EAPI void
-ecore_x_pixmap_paste(Ecore_X_Pixmap pmap, Ecore_X_Drawable dest,
- Ecore_X_GC gc, int sx, int sy,
- int w, int h, int dx, int dy)
+ecore_x_pixmap_paste(Ecore_X_Pixmap pmap,
+ Ecore_X_Drawable dest,
+ Ecore_X_GC gc,
+ int sx,
+ int sy,
+ int w,
+ int h,
+ int dx,
+ int dy)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XCopyArea(_ecore_x_disp, pmap, dest, gc, sx, sy, w, h, dx, dy);
@@ -86,11 +95,15 @@ ecore_x_pixmap_paste(Ecore_X_Pixmap pmap, Ecore_X_Drawable dest,
* @ingroup Ecore_X_Pixmap_Group
*/
EAPI void
-ecore_x_pixmap_geometry_get(Ecore_X_Pixmap pmap, int *x, int *y, int *w, int *h)
+ecore_x_pixmap_geometry_get(Ecore_X_Pixmap pmap,
+ int *x,
+ int *y,
+ int *w,
+ int *h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (pmap)
- ecore_x_drawable_geometry_get(pmap, x, y, w, h);
+ ecore_x_drawable_geometry_get(pmap, x, y, w, h);
} /* ecore_x_pixmap_geometry_get */
/**
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h
index 301af0ce7d..9ff45edd47 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_private.h
@@ -54,7 +54,7 @@
#endif /* ifdef ECORE_XI2 */
#ifndef XK_MISCELLANY
-# define XK_MISCELLANY 1
+# define XK_MISCELLANY 1
#endif
#include "Ecore.h"
@@ -93,7 +93,7 @@ extern int _ecore_xlib_log_dom;
#endif /* ifdef CRIT */
#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_xlib_log_dom, __VA_ARGS__)
-typedef struct _Ecore_X_Selection_Intern Ecore_X_Selection_Intern;
+typedef struct _Ecore_X_Selection_Intern Ecore_X_Selection_Intern;
struct _Ecore_X_Selection_Intern
{
@@ -104,18 +104,16 @@ struct _Ecore_X_Selection_Intern
Time time;
};
-typedef struct _Ecore_X_Selection_Converter Ecore_X_Selection_Converter;
+typedef struct _Ecore_X_Selection_Converter Ecore_X_Selection_Converter;
struct _Ecore_X_Selection_Converter
{
Ecore_X_Atom target;
- Eina_Bool (*convert)(char *target, void *data, int size,
- void **data_ret, int *size_ret,
- Ecore_X_Atom *type, int *typeseize);
+ Eina_Bool (*convert)(char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *type, int *typeseize);
Ecore_X_Selection_Converter *next;
};
-typedef struct _Ecore_X_Selection_Parser Ecore_X_Selection_Parser;
+typedef struct _Ecore_X_Selection_Parser Ecore_X_Selection_Parser;
struct _Ecore_X_Selection_Parser
{
@@ -202,166 +200,162 @@ extern Ecore_X_Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
extern int _ecore_window_grabs_num;
extern Window *_ecore_window_grabs;
-extern Eina_Bool (*_ecore_window_grab_replay_func)(void *data, int event_type,
+extern Eina_Bool (*_ecore_window_grab_replay_func)(void *data,
+ int event_type,
void *event);
extern void *_ecore_window_grab_replay_data;
extern Ecore_X_Window _ecore_x_private_win;
-void _ecore_x_error_handler_init(void);
-void _ecore_x_event_handle_any_event(XEvent *xevent);
-void _ecore_x_event_handle_key_press(XEvent *xevent);
-void _ecore_x_event_handle_key_release(XEvent *xevent);
-void _ecore_x_event_handle_button_press(XEvent *xevent);
-void _ecore_x_event_handle_button_release(XEvent *xevent);
-void _ecore_x_event_handle_motion_notify(XEvent *xevent);
-void _ecore_x_event_handle_enter_notify(XEvent *xevent);
-void _ecore_x_event_handle_leave_notify(XEvent *xevent);
-void _ecore_x_event_handle_focus_in(XEvent *xevent);
-void _ecore_x_event_handle_focus_out(XEvent *xevent);
-void _ecore_x_event_handle_keymap_notify(XEvent *xevent);
-void _ecore_x_event_handle_expose(XEvent *xevent);
-void _ecore_x_event_handle_graphics_expose(XEvent *xevent);
-void _ecore_x_event_handle_visibility_notify(
- XEvent *xevent);
-void _ecore_x_event_handle_create_notify(XEvent *xevent);
-void _ecore_x_event_handle_destroy_notify(XEvent *xevent);
-void _ecore_x_event_handle_unmap_notify(XEvent *xevent);
-void _ecore_x_event_handle_map_notify(XEvent *xevent);
-void _ecore_x_event_handle_map_request(XEvent *xevent);
-void _ecore_x_event_handle_reparent_notify(XEvent *xevent);
-void _ecore_x_event_handle_configure_notify(XEvent *xevent);
-void _ecore_x_event_handle_configure_request(
- XEvent *xevent);
-void _ecore_x_event_handle_gravity_notify(XEvent *xevent);
-void _ecore_x_event_handle_resize_request(XEvent *xevent);
-void _ecore_x_event_handle_circulate_notify(XEvent *xevent);
-void _ecore_x_event_handle_circulate_request(
- XEvent *xevent);
-void _ecore_x_event_handle_property_notify(XEvent *xevent);
-void _ecore_x_event_handle_selection_clear(XEvent *xevent);
-void _ecore_x_event_handle_selection_request(
- XEvent *xevent);
-void _ecore_x_event_handle_selection_notify(XEvent *xevent);
-void _ecore_x_event_handle_colormap_notify(XEvent *xevent);
-void _ecore_x_event_handle_client_message(XEvent *xevent);
-void _ecore_x_event_handle_mapping_notify(XEvent *xevent);
-void _ecore_x_event_handle_shape_change(XEvent *xevent);
-void _ecore_x_event_handle_screensaver_notify(
- XEvent *xevent);
-void _ecore_x_event_handle_sync_counter(XEvent *xevent);
-void _ecore_x_event_handle_sync_alarm(XEvent *xevent);
+void _ecore_x_error_handler_init(void);
+void _ecore_x_event_handle_any_event(XEvent *xevent);
+void _ecore_x_event_handle_key_press(XEvent *xevent);
+void _ecore_x_event_handle_key_release(XEvent *xevent);
+void _ecore_x_event_handle_button_press(XEvent *xevent);
+void _ecore_x_event_handle_button_release(XEvent *xevent);
+void _ecore_x_event_handle_motion_notify(XEvent *xevent);
+void _ecore_x_event_handle_enter_notify(XEvent *xevent);
+void _ecore_x_event_handle_leave_notify(XEvent *xevent);
+void _ecore_x_event_handle_focus_in(XEvent *xevent);
+void _ecore_x_event_handle_focus_out(XEvent *xevent);
+void _ecore_x_event_handle_keymap_notify(XEvent *xevent);
+void _ecore_x_event_handle_expose(XEvent *xevent);
+void _ecore_x_event_handle_graphics_expose(XEvent *xevent);
+void _ecore_x_event_handle_visibility_notify(XEvent *xevent);
+void _ecore_x_event_handle_create_notify(XEvent *xevent);
+void _ecore_x_event_handle_destroy_notify(XEvent *xevent);
+void _ecore_x_event_handle_unmap_notify(XEvent *xevent);
+void _ecore_x_event_handle_map_notify(XEvent *xevent);
+void _ecore_x_event_handle_map_request(XEvent *xevent);
+void _ecore_x_event_handle_reparent_notify(XEvent *xevent);
+void _ecore_x_event_handle_configure_notify(XEvent *xevent);
+void _ecore_x_event_handle_configure_request(XEvent *xevent);
+void _ecore_x_event_handle_gravity_notify(XEvent *xevent);
+void _ecore_x_event_handle_resize_request(XEvent *xevent);
+void _ecore_x_event_handle_circulate_notify(XEvent *xevent);
+void _ecore_x_event_handle_circulate_request(XEvent *xevent);
+void _ecore_x_event_handle_property_notify(XEvent *xevent);
+void _ecore_x_event_handle_selection_clear(XEvent *xevent);
+void _ecore_x_event_handle_selection_request(XEvent *xevent);
+void _ecore_x_event_handle_selection_notify(XEvent *xevent);
+void _ecore_x_event_handle_colormap_notify(XEvent *xevent);
+void _ecore_x_event_handle_client_message(XEvent *xevent);
+void _ecore_x_event_handle_mapping_notify(XEvent *xevent);
+void _ecore_x_event_handle_shape_change(XEvent *xevent);
+void _ecore_x_event_handle_screensaver_notify(XEvent *xevent);
+void _ecore_x_event_handle_sync_counter(XEvent *xevent);
+void _ecore_x_event_handle_sync_alarm(XEvent *xevent);
#ifdef ECORE_XRANDR
-void _ecore_x_event_handle_randr_change(XEvent *xevent);
-void _ecore_x_event_handle_randr_notify(XEvent *xevent);
+void _ecore_x_event_handle_randr_change(XEvent *xevent);
+void _ecore_x_event_handle_randr_notify(XEvent *xevent);
#endif /* ifdef ECORE_XRANDR */
#ifdef ECORE_XFIXES
-void _ecore_x_event_handle_fixes_selection_notify(
- XEvent *xevent);
+void _ecore_x_event_handle_fixes_selection_notify(XEvent *xevent);
#endif /* ifdef ECORE_XFIXES */
#ifdef ECORE_XDAMAGE
-void _ecore_x_event_handle_damage_notify(XEvent *xevent);
+void _ecore_x_event_handle_damage_notify(XEvent *xevent);
#endif /* ifdef ECORE_XDAMAGE */
-void _ecore_x_event_handle_generic_event(XEvent *xevent);
-
-void _ecore_x_selection_data_init(void);
-void _ecore_x_selection_shutdown(void);
-Ecore_X_Atom
- _ecore_x_selection_target_atom_get(const char *target);
-char * _ecore_x_selection_target_get(Ecore_X_Atom target);
-Ecore_X_Selection_Intern *
- _ecore_x_selection_get(Ecore_X_Atom selection);
-Eina_Bool _ecore_x_selection_set(Window w,
- const void *data,
- int len,
- Ecore_X_Atom selection);
-int _ecore_x_selection_convert(Ecore_X_Atom selection,
- Ecore_X_Atom target,
- void **data_ret,
- Ecore_X_Atom *targettype,
- int *targetsize);
-void * _ecore_x_selection_parse(const char *target,
- void *data,
- int size,
- int format);
-
-void _ecore_x_sync_magic_send(int val, Ecore_X_Window swin);
-void _ecore_x_window_grab_remove(Ecore_X_Window win);
-void _ecore_x_key_grab_remove(Ecore_X_Window win);
+void _ecore_x_event_handle_generic_event(XEvent *xevent);
+
+void _ecore_x_selection_data_init(void);
+void _ecore_x_selection_shutdown(void);
+Ecore_X_Atom _ecore_x_selection_target_atom_get(const char *target);
+char *_ecore_x_selection_target_get(Ecore_X_Atom target);
+Ecore_X_Selection_Intern *_ecore_x_selection_get(Ecore_X_Atom selection);
+Eina_Bool _ecore_x_selection_set(Window w,
+ const void *data,
+ int len,
+ Ecore_X_Atom selection);
+int _ecore_x_selection_convert(Ecore_X_Atom selection,
+ Ecore_X_Atom target,
+ void **data_ret,
+ Ecore_X_Atom *targettype,
+ int *targetsize);
+void *_ecore_x_selection_parse(const char *target,
+ void *data,
+ int size,
+ int format);
+
+void _ecore_x_sync_magic_send(int val,
+ Ecore_X_Window swin);
+void _ecore_x_window_grab_remove(Ecore_X_Window win);
+void _ecore_x_key_grab_remove(Ecore_X_Window win);
/* from dnd */
-void _ecore_x_dnd_init(void);
-Ecore_X_DND_Source * _ecore_x_dnd_source_get(void);
-Ecore_X_DND_Target * _ecore_x_dnd_target_get(void);
-void _ecore_x_dnd_drag(Ecore_X_Window root, int x, int y);
-void _ecore_x_dnd_shutdown(void);
+void _ecore_x_dnd_init(void);
+Ecore_X_DND_Source *_ecore_x_dnd_source_get(void);
+Ecore_X_DND_Target *_ecore_x_dnd_target_get(void);
+void _ecore_x_dnd_drag(Ecore_X_Window root,
+ int x,
+ int y);
+void _ecore_x_dnd_shutdown(void);
/* from netwm */
-Ecore_X_Window_State _ecore_x_netwm_state_get(Ecore_X_Atom a);
-int _ecore_x_netwm_startup_info_begin(Ecore_X_Window win,
- char *data);
-int _ecore_x_netwm_startup_info(Ecore_X_Window win,
- char *data);
+Ecore_X_Window_State _ecore_x_netwm_state_get(Ecore_X_Atom a);
+int _ecore_x_netwm_startup_info_begin(Ecore_X_Window win,
+ char *data);
+int _ecore_x_netwm_startup_info(Ecore_X_Window win,
+ char *data);
/* Fixes * Damage * Composite * DPMS */
-void _ecore_x_fixes_init(void);
-void _ecore_x_damage_init(void);
-void _ecore_x_composite_init(void);
-void _ecore_x_dpms_init(void);
-void _ecore_x_randr_init(void);
+void _ecore_x_fixes_init(void);
+void _ecore_x_damage_init(void);
+void _ecore_x_composite_init(void);
+void _ecore_x_dpms_init(void);
+void _ecore_x_randr_init(void);
-void _ecore_x_atoms_init(void);
+void _ecore_x_atoms_init(void);
extern int _ecore_x_xi2_opcode;
-void _ecore_x_events_init(void);
-void _ecore_x_events_shutdown(void);
+void _ecore_x_events_init(void);
+void _ecore_x_events_shutdown(void);
-void _ecore_x_input_init(void);
-void _ecore_x_input_shutdown(void);
-void _ecore_x_input_handler(XEvent *xevent);
+void _ecore_x_input_init(void);
+void _ecore_x_input_shutdown(void);
+void _ecore_x_input_handler(XEvent *xevent);
/* from sync */
-void _ecore_mouse_move(unsigned int timestamp,
- unsigned int xmodifiers,
- int x,
- int y,
- int x_root,
- int y_root,
- unsigned int event_window,
- unsigned int window,
- unsigned int root_win,
- int same_screen,
- int dev,
- double radx,
- double rady,
- double pressure,
- double angle,
- double mx,
- double my,
- double mrx,
- double mry);
-Ecore_Event_Mouse_Button * _ecore_mouse_button(int event,
- unsigned int timestamp,
- unsigned int xmodifiers,
- unsigned int buttons,
- int x,
- int y,
- int x_root,
- int y_root,
- unsigned int event_window,
- unsigned int window,
- unsigned int root_win,
- int same_screen,
- int dev,
- double radx,
- double rady,
- double pressure,
- double angle,
- double mx,
- double my,
- double mrx,
- double mry);
+void _ecore_mouse_move(unsigned int timestamp,
+ unsigned int xmodifiers,
+ int x,
+ int y,
+ int x_root,
+ int y_root,
+ unsigned int event_window,
+ unsigned int window,
+ unsigned int root_win,
+ int same_screen,
+ int dev,
+ double radx,
+ double rady,
+ double pressure,
+ double angle,
+ double mx,
+ double my,
+ double mrx,
+ double mry);
+Ecore_Event_Mouse_Button *_ecore_mouse_button(int event,
+ unsigned int timestamp,
+ unsigned int xmodifiers,
+ unsigned int buttons,
+ int x,
+ int y,
+ int x_root,
+ int y_root,
+ unsigned int event_window,
+ unsigned int window,
+ unsigned int root_win,
+ int same_screen,
+ int dev,
+ double radx,
+ double rady,
+ double pressure,
+ double angle,
+ double mx,
+ double my,
+ double mrx,
+ double mry);
void _ecore_x_modifiers_get(void);
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr.c
index 9bc5e5912c..d4d834f290 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr.c
@@ -9,19 +9,19 @@ static Eina_Bool _randr_available = EINA_FALSE;
#ifdef ECORE_XRANDR
static int _randr_major, _randr_minor;
int _randr_version;
-#define RANDR_1_1 ((1 << 16) | 1)
-#define RANDR_1_2 ((1 << 16) | 2)
-#define RANDR_1_3 ((1 << 16) | 3)
+#define RANDR_1_1 ((1 << 16) | 1)
+#define RANDR_1_2 ((1 << 16) | 2)
+#define RANDR_1_3 ((1 << 16) | 3)
-#define RANDR_VALIDATE_ROOT(screen, \
- root) ((screen = \
- XRRRootToScreen(_ecore_x_disp, \
- root)) != -1)
+#define RANDR_VALIDATE_ROOT(screen, \
+ root) ((screen = \
+ XRRRootToScreen(_ecore_x_disp, \
+ root)) != -1)
#define Ecore_X_Randr_Unset -1
-XRRScreenResources * (*_ecore_x_randr_get_screen_resources)(Display * dpy,
- Window window);
+XRRScreenResources *(*_ecore_x_randr_get_screen_resources)(Display * dpy,
+ Window window);
#endif /* ifdef ECORE_XRANDR */
@@ -35,17 +35,17 @@ _ecore_x_randr_init(void)
_ecore_x_randr_get_screen_resources = NULL;
if (XRRQueryVersion(_ecore_x_disp, &_randr_major, &_randr_minor))
- {
- _randr_version = (_randr_major << 16) | _randr_minor;
- if (_randr_version >= RANDR_1_3)
- _ecore_x_randr_get_screen_resources = XRRGetScreenResourcesCurrent;
- else if (_randr_version == RANDR_1_2)
- _ecore_x_randr_get_screen_resources = XRRGetScreenResources;
+ {
+ _randr_version = (_randr_major << 16) | _randr_minor;
+ if (_randr_version >= RANDR_1_3)
+ _ecore_x_randr_get_screen_resources = XRRGetScreenResourcesCurrent;
+ else if (_randr_version == RANDR_1_2)
+ _ecore_x_randr_get_screen_resources = XRRGetScreenResources;
- _randr_available = EINA_TRUE;
- }
+ _randr_available = EINA_TRUE;
+ }
else
- _randr_available = EINA_FALSE;
+ _randr_available = EINA_FALSE;
#else
_randr_available = EINA_FALSE;
@@ -73,13 +73,13 @@ ecore_x_randr_version_get(void)
#ifdef ECORE_XRANDR
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (_randr_available)
- {
- return _randr_version;
- }
+ {
+ return _randr_version;
+ }
else
- {
- return Ecore_X_Randr_Unset;
- }
+ {
+ return Ecore_X_Randr_Unset;
+ }
#else
return -1;
#endif
@@ -91,11 +91,12 @@ _ecore_x_randr_root_validate(Ecore_X_Window root)
#ifdef ECORE_XRANDR
Ecore_X_Randr_Screen scr = -1;
if (root && RANDR_VALIDATE_ROOT(scr, root))
- return EINA_TRUE;
+ return EINA_TRUE;
else
- return EINA_FALSE;
+ return EINA_FALSE;
#else
return EINA_FALSE;
#endif
}
+
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr.h b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr.h
index b6a6886f43..eca3c0c32c 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr.h
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr.h
@@ -2,6 +2,6 @@
#define ECORE_X_INLINE_X
Eina_Bool _ecore_x_randr_root_validate(Ecore_X_Window root);
Eina_Bool _ecore_x_randr_output_validate(Ecore_X_Window root,
- Ecore_X_Randr_Output
- output);
+ Ecore_X_Randr_Output
+ output);
#endif
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c
index 41f0f84079..a6bafb625f 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_11.c
@@ -14,16 +14,16 @@
#define RANDR_1_1 ((1 << 16) | 1)
-#define RANDR_VALIDATE_ROOT(screen,\
- root) ((screen =\
- XRRRootToScreen(_ecore_x_disp,\
- root)) != -1)
+#define RANDR_VALIDATE_ROOT(screen, \
+ root) ((screen = \
+ XRRRootToScreen(_ecore_x_disp, \
+ root)) != -1)
#define RANDR_CHECK_1_1_RET(ret) if(_randr_version < RANDR_1_1) return ret
-extern XRRScreenResources * (*_ecore_x_randr_get_screen_resources)(Display *
- dpy,
- Window
- window);
+extern XRRScreenResources *(*_ecore_x_randr_get_screen_resources)(Display *
+ dpy,
+ Window
+ window);
extern int _randr_version;
#endif /* ifdef ECORE_XRANDR */
@@ -38,8 +38,8 @@ ecore_x_randr_screen_primary_output_orientations_get(Ecore_X_Window root)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
rot =
- XRRRotations(_ecore_x_disp, XRRRootToScreen(_ecore_x_disp,
- root), &crot);
+ XRRRotations(_ecore_x_disp, XRRRootToScreen(_ecore_x_disp,
+ root), &crot);
return rot;
#else /* ifdef ECORE_XRANDR */
return Ecore_X_Randr_None;
@@ -56,7 +56,7 @@ ecore_x_randr_screen_primary_output_orientation_get(Ecore_X_Window root)
#ifdef ECORE_XRANDR
Rotation crot = Ecore_X_Randr_None;
XRRRotations(_ecore_x_disp, XRRRootToScreen(_ecore_x_disp,
- root), &crot);
+ root), &crot);
return crot;
#else /* ifdef ECORE_XRANDR */
return Ecore_X_Randr_None;
@@ -71,9 +71,9 @@ ecore_x_randr_screen_primary_output_orientation_get(Ecore_X_Window root)
*/
EAPI Eina_Bool
ecore_x_randr_screen_primary_output_orientation_set(
- Ecore_X_Window root,
- Ecore_X_Randr_Orientation
- orientation)
+ Ecore_X_Window root,
+ Ecore_X_Randr_Orientation
+ orientation)
{
#ifdef ECORE_XRANDR
XRRScreenConfiguration *xrr_screen_cfg = NULL;
@@ -81,15 +81,15 @@ ecore_x_randr_screen_primary_output_orientation_set(
Rotation crot;
Eina_Bool ret = EINA_FALSE;
if (!(xrr_screen_cfg = XRRGetScreenInfo(_ecore_x_disp, root)))
- return EINA_FALSE;
+ return EINA_FALSE;
sizeid = XRRConfigCurrentConfiguration(xrr_screen_cfg, &crot);
if (!XRRSetScreenConfig(_ecore_x_disp, xrr_screen_cfg, root, sizeid,
orientation, CurrentTime))
- ret = EINA_TRUE;
+ ret = EINA_TRUE;
if (xrr_screen_cfg)
- XRRFreeScreenConfigInfo(xrr_screen_cfg);
+ XRRFreeScreenConfigInfo(xrr_screen_cfg);
return ret;
#else /* ifdef ECORE_XRANDR */
@@ -104,7 +104,8 @@ ecore_x_randr_screen_primary_output_orientation_set(
* @return an array of sizes reported as supported by the screen's primary output or - if query failed - NULL
*/
EAPI Ecore_X_Randr_Screen_Size_MM *
-ecore_x_randr_screen_primary_output_sizes_get(Ecore_X_Window root, int *num)
+ecore_x_randr_screen_primary_output_sizes_get(Ecore_X_Window root,
+ int *num)
{
#ifdef ECORE_XRANDR
Ecore_X_Randr_Screen_Size_MM *ret = NULL;
@@ -113,15 +114,15 @@ ecore_x_randr_screen_primary_output_sizes_get(Ecore_X_Window root, int *num)
/* we don't have to free sizes, because they're hold in a cache inside X*/
sizes =
- XRRSizes(_ecore_x_disp, XRRRootToScreen(_ecore_x_disp,
- root), &n);
+ XRRSizes(_ecore_x_disp, XRRRootToScreen(_ecore_x_disp,
+ root), &n);
if ((!sizes) || (n <= 0)) return NULL;
ret = calloc(n, sizeof(Ecore_X_Randr_Screen_Size_MM));
if (!ret)
- return NULL;
+ return NULL;
if (num)
- *num = n;
+ *num = n;
for (i = 0; i < n; i++)
{
@@ -169,24 +170,24 @@ ecore_x_randr_screen_primary_output_current_size_get(Ecore_X_Window root,
idx = XRRConfigCurrentConfiguration(sc, &orientation);
sizes =
- XRRSizes(_ecore_x_disp, XRRRootToScreen(_ecore_x_disp,
- root), &n);
+ XRRSizes(_ecore_x_disp, XRRRootToScreen(_ecore_x_disp,
+ root), &n);
if ((idx < n) && (idx >= 0))
{
if (w)
- *w = sizes[idx].width;
+ *w = sizes[idx].width;
if (h)
- *h = sizes[idx].height;
+ *h = sizes[idx].height;
if (w_mm)
- *w_mm = sizes[idx].mwidth;
+ *w_mm = sizes[idx].mwidth;
if (h_mm)
- *h_mm = sizes[idx].mheight;
+ *h_mm = sizes[idx].mheight;
if (size_index)
- *size_index = idx;
+ *size_index = idx;
}
XRRFreeScreenConfigInfo(sc);
@@ -212,8 +213,8 @@ ecore_x_randr_screen_primary_output_size_set(Ecore_X_Window root,
if (size_index >= 0 && _ecore_x_randr_root_validate(root))
{
sizes =
- XRRSizes(_ecore_x_disp, XRRRootToScreen(_ecore_x_disp,
- root), &nsizes);
+ XRRSizes(_ecore_x_disp, XRRRootToScreen(_ecore_x_disp,
+ root), &nsizes);
if (size_index < nsizes)
{
@@ -226,7 +227,7 @@ ecore_x_randr_screen_primary_output_size_set(Ecore_X_Window root,
}
if (sc)
- XRRFreeScreenConfigInfo(sc);
+ XRRFreeScreenConfigInfo(sc);
}
}
@@ -242,7 +243,7 @@ ecore_x_randr_screen_primary_output_size_set(Ecore_X_Window root,
*/
EAPI Ecore_X_Randr_Refresh_Rate
ecore_x_randr_screen_primary_output_current_refresh_rate_get(
- Ecore_X_Window root)
+ Ecore_X_Window root)
{
#ifdef ECORE_XRANDR
Ecore_X_Randr_Refresh_Rate ret = 0.0;
@@ -250,11 +251,11 @@ ecore_x_randr_screen_primary_output_current_refresh_rate_get(
if (!_ecore_x_randr_root_validate(root) ||
!(sc = XRRGetScreenInfo(_ecore_x_disp, root)))
- return ret;
+ return ret;
ret = XRRConfigCurrentRate(sc);
if (sc)
- XRRFreeScreenConfigInfo(sc);
+ XRRFreeScreenConfigInfo(sc);
return ret;
#else /* ifdef ECORE_XRANDR */
@@ -304,10 +305,10 @@ ecore_x_randr_screen_primary_output_refresh_rates_get(Ecore_X_Window root,
*/
EAPI Eina_Bool
ecore_x_randr_screen_primary_output_refresh_rate_set(
- Ecore_X_Window root,
- int size_index,
- Ecore_X_Randr_Refresh_Rate
- rate)
+ Ecore_X_Window root,
+ int size_index,
+ Ecore_X_Randr_Refresh_Rate
+ rate)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_1_RET(EINA_FALSE);
@@ -315,12 +316,12 @@ ecore_x_randr_screen_primary_output_refresh_rate_set(
XRRScreenConfiguration *sc = NULL;
if (!(sc = XRRGetScreenInfo(_ecore_x_disp, root)))
- return ret;
+ return ret;
if (!XRRSetScreenConfigAndRate(_ecore_x_disp, sc,
root, size_index,
RR_Rotate_0, rate, CurrentTime))
- ret = EINA_TRUE;
+ ret = EINA_TRUE;
XRRFreeScreenConfigInfo(sc);
return ret;
@@ -328,3 +329,4 @@ ecore_x_randr_screen_primary_output_refresh_rate_set(
return EINA_FALSE;
#endif /* ifdef ECORE_XRANDR */
} /* ecore_x_randr_screen_primary_output_refresh_rate_set */
+
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c
index 7e9631be74..df0cddc6a7 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c
@@ -9,31 +9,31 @@
#include "ecore_x_private.h"
#include "ecore_x_randr.h"
-#define Ecore_X_Randr_None (Ecore_X_Randr_Crtc)0
-#define Ecore_X_Randr_Unset (Ecore_X_Randr_Crtc)-1
+#define Ecore_X_Randr_None (Ecore_X_Randr_Crtc)0
+#define Ecore_X_Randr_Unset (Ecore_X_Randr_Crtc) - 1
#ifdef ECORE_XRANDR
-#define RANDR_1_2 ((1 << 16) | 2)
+#define RANDR_1_2 ((1 << 16) | 2)
#define RANDR_VALIDATE_ROOT(screen, root) \
- ((screen = XRRRootToScreen(_ecore_x_disp, root)) != -1)
+ ((screen = XRRRootToScreen(_ecore_x_disp, root)) != -1)
#define RANDR_CHECK_1_2_RET(ret) if(_randr_version < RANDR_1_2) return ret
-#define RANDR_PROPERTY_EDID "EDID"
-#define RANDR_PROPERTY_BACKLIGHT "Backlight"
-#define RANDR_PROPERTY_SIGNAL_FORMAT "SignalFormat"
-#define RANDR_PROPERTY_SIGNAL_PROPERTIES "SignalProperties"
-#define RANDR_PROPERTY_CONNECTOR_TYPE "ConnectorType"
-#define RANDR_PROPERTY_CONNECTOR_NUMBER "ConnectorNumber"
-#define RANDR_PROPERTY_COMPATIBILITY_LIST "CompatibilityList"
-#define RANDR_PROPERTY_CLONE_LIST "CloneList"
-
-extern XRRScreenResources * (*_ecore_x_randr_get_screen_resources)(Display *
- dpy,
- Window
- window);
+#define RANDR_PROPERTY_EDID "EDID"
+#define RANDR_PROPERTY_BACKLIGHT "Backlight"
+#define RANDR_PROPERTY_SIGNAL_FORMAT "SignalFormat"
+#define RANDR_PROPERTY_SIGNAL_PROPERTIES "SignalProperties"
+#define RANDR_PROPERTY_CONNECTOR_TYPE "ConnectorType"
+#define RANDR_PROPERTY_CONNECTOR_NUMBER "ConnectorNumber"
+#define RANDR_PROPERTY_COMPATIBILITY_LIST "CompatibilityList"
+#define RANDR_PROPERTY_CLONE_LIST "CloneList"
+
+extern XRRScreenResources *(*_ecore_x_randr_get_screen_resources)(Display *
+ dpy,
+ Window
+ window);
extern int _randr_version;
#endif
@@ -44,21 +44,22 @@ extern int _randr_version;
* @param on enable/disable selecting
*/
EAPI void
-ecore_x_randr_events_select(Ecore_X_Window win, Eina_Bool on)
+ecore_x_randr_events_select(Ecore_X_Window win,
+ Eina_Bool on)
{
#ifdef ECORE_XRANDR
int mask;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!on)
- mask = 0;
+ mask = 0;
else
{
mask = RRScreenChangeNotifyMask;
if (_randr_version >= RANDR_1_2)
- mask |= (RRCrtcChangeNotifyMask |
- RROutputChangeNotifyMask |
- RROutputPropertyNotifyMask);
+ mask |= (RRCrtcChangeNotifyMask |
+ RROutputChangeNotifyMask |
+ RROutputPropertyNotifyMask);
}
XRRSelectInput(_ecore_x_disp, win, mask);
@@ -72,7 +73,8 @@ ecore_x_randr_events_select(Ecore_X_Window win, Eina_Bool on)
* @return in case it is found EINA_TRUE will be returned. Else EINA_FALSE is returned.
*/
static inline Eina_Bool
-_ecore_x_randr_crtc_validate(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc)
+_ecore_x_randr_crtc_validate(Ecore_X_Window root,
+ Ecore_X_Randr_Crtc crtc)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(EINA_FALSE);
@@ -83,7 +85,7 @@ _ecore_x_randr_crtc_validate(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc)
if ((crtc == Ecore_X_Randr_None) ||
(crtc == Ecore_X_Randr_Unset))
- return ret;
+ return ret;
if (_ecore_x_randr_root_validate(root) && crtc &&
(res = _ecore_x_randr_get_screen_resources (_ecore_x_disp, root)))
@@ -106,7 +108,8 @@ _ecore_x_randr_crtc_validate(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc)
}
Eina_Bool
-_ecore_x_randr_output_validate(Ecore_X_Window root, Ecore_X_Randr_Output output)
+_ecore_x_randr_output_validate(Ecore_X_Window root,
+ Ecore_X_Randr_Output output)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(EINA_FALSE);
@@ -136,7 +139,8 @@ _ecore_x_randr_output_validate(Ecore_X_Window root, Ecore_X_Randr_Output output)
}
static inline Eina_Bool
-_ecore_x_randr_mode_validate(Ecore_X_Window root, Ecore_X_Randr_Mode mode)
+_ecore_x_randr_mode_validate(Ecore_X_Window root,
+ Ecore_X_Randr_Mode mode)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(EINA_FALSE);
@@ -171,29 +175,29 @@ _ecore_x_randr_mode_validate(Ecore_X_Window root, Ecore_X_Randr_Mode mode)
*/
EAPI void
ecore_x_randr_screen_current_size_get(Ecore_X_Window root,
- int *w,
- int *h,
- int *w_mm,
- int *h_mm)
+ int *w,
+ int *h,
+ int *w_mm,
+ int *h_mm)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET();
Ecore_X_Randr_Screen scr;
if (!RANDR_VALIDATE_ROOT(scr, root))
- return;
+ return;
if (w)
- *w = DisplayWidth(_ecore_x_disp, scr);
+ *w = DisplayWidth(_ecore_x_disp, scr);
if (h)
- *h = DisplayHeight(_ecore_x_disp, scr);
+ *h = DisplayHeight(_ecore_x_disp, scr);
if (w_mm)
- *w_mm = DisplayWidthMM(_ecore_x_disp, scr);
+ *w_mm = DisplayWidthMM(_ecore_x_disp, scr);
if (h_mm)
- *h_mm = DisplayHeightMM(_ecore_x_disp, scr);
+ *h_mm = DisplayHeightMM(_ecore_x_disp, scr);
#endif
}
@@ -207,10 +211,10 @@ ecore_x_randr_screen_current_size_get(Ecore_X_Window root,
*/
EAPI void
ecore_x_randr_screen_size_range_get(Ecore_X_Window root,
- int *wmin,
- int *hmin,
- int *wmax,
- int *hmax)
+ int *wmin,
+ int *hmin,
+ int *wmax,
+ int *hmax)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET();
@@ -219,16 +223,16 @@ ecore_x_randr_screen_size_range_get(Ecore_X_Window root,
&thmax))
{
if (wmin)
- *wmin = twmin;
+ *wmin = twmin;
if (hmin)
- *hmin = thmin;
+ *hmin = thmin;
if (wmax)
- *wmax = twmax;
+ *wmax = twmax;
if (hmax)
- *hmax = thmax;
+ *hmax = thmax;
}
#endif
@@ -245,10 +249,10 @@ ecore_x_randr_screen_size_range_get(Ecore_X_Window root,
*/
EAPI Eina_Bool
ecore_x_randr_screen_current_size_set(Ecore_X_Window root,
- int w,
- int h,
- int w_mm,
- int h_mm)
+ int w,
+ int h,
+ int w_mm,
+ int h_mm)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(EINA_FALSE);
@@ -257,11 +261,11 @@ ecore_x_randr_screen_current_size_set(Ecore_X_Window root,
int w_c, h_c, w_mm_c, h_mm_c, twmin, thmin, twmax, thmax;
if (!RANDR_VALIDATE_ROOT(scr, root))
- return EINA_FALSE;
+ return EINA_FALSE;
ecore_x_randr_screen_current_size_get(root, &w_c, &h_c, &w_mm_c, &h_mm_c);
if ((w == w_c) && (h == h_c) && (w_mm_c == w_mm) && (h_mm_c == h_mm))
- return EINA_TRUE;
+ return EINA_TRUE;
ecore_x_randr_screen_size_range_get(root, &twmin, &thmin, &twmax, &thmax);
@@ -269,27 +273,27 @@ ecore_x_randr_screen_current_size_set(Ecore_X_Window root,
((w < twmin) ||
(w > twmax))) ||
((h != Ecore_X_Randr_None) && ((h < thmin) || (h > thmax))))
- return EINA_FALSE;
+ return EINA_FALSE;
if (w <= 0)
- w = DisplayWidth(_ecore_x_disp, scr);
+ w = DisplayWidth(_ecore_x_disp, scr);
if (h <= 0)
- h = DisplayHeight(_ecore_x_disp, scr);
+ h = DisplayHeight(_ecore_x_disp, scr);
if(w_mm <= 0)
- w_mm =
- (int)(((double)(DisplayWidthMM(_ecore_x_disp,
- scr) /
- (double)DisplayWidth(_ecore_x_disp,
- scr))) * (double)w);
+ w_mm =
+ (int)(((double)(DisplayWidthMM(_ecore_x_disp,
+ scr) /
+ (double)DisplayWidth(_ecore_x_disp,
+ scr))) * (double)w);
if(h_mm <= 0)
- h_mm =
- (int)(((double)(DisplayHeightMM(_ecore_x_disp,
- scr) /
- (double)DisplayHeight(_ecore_x_disp,
- scr))) * (double)h);
+ h_mm =
+ (int)(((double)(DisplayHeightMM(_ecore_x_disp,
+ scr) /
+ (double)DisplayHeight(_ecore_x_disp,
+ scr))) * (double)h);
XRRSetScreenSize (_ecore_x_disp, root, w, h, w_mm, h_mm);
return EINA_TRUE;
@@ -305,7 +309,8 @@ ecore_x_randr_screen_current_size_set(Ecore_X_Window root,
* @return modes' information
*/
EAPI Ecore_X_Randr_Mode_Info **
-ecore_x_randr_modes_info_get(Ecore_X_Window root, int *num)
+ecore_x_randr_modes_info_get(Ecore_X_Window root,
+ int *num)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(NULL);
@@ -317,10 +322,10 @@ ecore_x_randr_modes_info_get(Ecore_X_Window root, int *num)
(res = _ecore_x_randr_get_screen_resources (_ecore_x_disp, root)))
{
if ((ret =
- (Ecore_X_Randr_Mode_Info **)malloc(sizeof(
- Ecore_X_Randr_Mode_Info *)
- *
- res->nmode)))
+ (Ecore_X_Randr_Mode_Info **)malloc(sizeof(
+ Ecore_X_Randr_Mode_Info *)
+ *
+ res->nmode)))
{
for (i = 0; i < res->nmode; i++)
{
@@ -338,10 +343,10 @@ ecore_x_randr_modes_info_get(Ecore_X_Window root, int *num)
ret[i]->vSyncEnd = res->modes[i].vSyncEnd;
ret[i]->vTotal = res->modes[i].vTotal;
if ((ret[i]->name = (malloc(res->modes[i].nameLength))))
- strncpy(ret[i]->name, res->modes[i].name,
- res->modes[i].nameLength);
+ strncpy(ret[i]->name, res->modes[i].name,
+ res->modes[i].nameLength);
else
- ret[i]->name = NULL;
+ ret[i]->name = NULL;
ret[i]->nameLength = res->modes[i].nameLength;
ret[i]->modeFlags = res->modes[i].modeFlags;
@@ -349,8 +354,8 @@ ecore_x_randr_modes_info_get(Ecore_X_Window root, int *num)
else
{
while(i > 0)
- free(ret[--i]);
- free(ret);
+ free(ret[--i]);
+ free(ret);
ret = NULL;
break;
}
@@ -358,7 +363,7 @@ ecore_x_randr_modes_info_get(Ecore_X_Window root, int *num)
}
if (ret && num)
- *num = res->nmode;
+ *num = res->nmode;
XRRFreeScreenResources(res);
}
@@ -376,7 +381,8 @@ ecore_x_randr_modes_info_get(Ecore_X_Window root, int *num)
* @return mode's detailed information
*/
EAPI Ecore_X_Randr_Mode_Info *
-ecore_x_randr_mode_info_get(Ecore_X_Window root, Ecore_X_Randr_Mode mode)
+ecore_x_randr_mode_info_get(Ecore_X_Window root,
+ Ecore_X_Randr_Mode mode)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(NULL);
@@ -454,7 +460,8 @@ ecore_x_randr_mode_info_free(Ecore_X_Randr_Mode_Info *mode_info)
* @return CRTC IDs
*/
EAPI Ecore_X_Randr_Crtc *
-ecore_x_randr_crtcs_get(Ecore_X_Window root, int *num)
+ecore_x_randr_crtcs_get(Ecore_X_Window root,
+ int *num)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(NULL);
@@ -480,7 +487,8 @@ ecore_x_randr_crtcs_get(Ecore_X_Window root, int *num)
}
EAPI Ecore_X_Randr_Output *
-ecore_x_randr_outputs_get(Ecore_X_Window root, int *num)
+ecore_x_randr_outputs_get(Ecore_X_Window root,
+ int *num)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(NULL);
@@ -495,11 +503,11 @@ ecore_x_randr_outputs_get(Ecore_X_Window root, int *num)
memcpy(ret, res->outputs,
(sizeof(Ecore_X_Randr_Output) * res->noutput));
if (num)
- *num = res->noutput;
+ *num = res->noutput;
}
if (res)
- XRRFreeScreenResources(res);
+ XRRFreeScreenResources(res);
}
return ret;
@@ -515,9 +523,9 @@ ecore_x_randr_outputs_get(Ecore_X_Window root, int *num)
* @param num number of outputs referenced by given CRTC
*/
EAPI Ecore_X_Randr_Output *
-ecore_x_randr_crtc_outputs_get(Ecore_X_Window root,
+ecore_x_randr_crtc_outputs_get(Ecore_X_Window root,
Ecore_X_Randr_Crtc crtc,
- int *num)
+ int *num)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(NULL);
@@ -528,8 +536,8 @@ ecore_x_randr_crtc_outputs_get(Ecore_X_Window root,
if (_ecore_x_randr_crtc_validate(root,
crtc) &&
(res =
- _ecore_x_randr_get_screen_resources (_ecore_x_disp,
- root)) &&
+ _ecore_x_randr_get_screen_resources (_ecore_x_disp,
+ root)) &&
(crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
{
if ((ret = malloc(sizeof(Ecore_X_Randr_Output) * crtc_info->noutput)))
@@ -537,14 +545,14 @@ ecore_x_randr_crtc_outputs_get(Ecore_X_Window root,
memcpy(ret, crtc_info->outputs,
(sizeof(Ecore_X_Randr_Output) * crtc_info->noutput));
if (num)
- *num = crtc_info->noutput;
+ *num = crtc_info->noutput;
}
if (crtc_info)
- XRRFreeCrtcInfo(crtc_info);
+ XRRFreeCrtcInfo(crtc_info);
if (res)
- XRRFreeScreenResources(res);
+ XRRFreeScreenResources(res);
}
return ret;
@@ -559,9 +567,9 @@ ecore_x_randr_crtc_outputs_get(Ecore_X_Window root,
* @param num number of possible outputs referenced by given CRTC
*/
EAPI Ecore_X_Randr_Output *
-ecore_x_randr_crtc_possible_outputs_get(Ecore_X_Window root,
+ecore_x_randr_crtc_possible_outputs_get(Ecore_X_Window root,
Ecore_X_Randr_Crtc crtc,
- int *num)
+ int *num)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(NULL);
@@ -576,12 +584,12 @@ ecore_x_randr_crtc_possible_outputs_get(Ecore_X_Window root,
if((crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
{
if ((ret =
- malloc(sizeof(Ecore_X_Randr_Output) * crtc_info->npossible)))
+ malloc(sizeof(Ecore_X_Randr_Output) * crtc_info->npossible)))
{
memcpy(ret, crtc_info->possible,
(sizeof(Ecore_X_Randr_Output) * crtc_info->npossible));
if (num)
- *num = res->ncrtc;
+ *num = res->ncrtc;
}
XRRFreeCrtcInfo(crtc_info);
@@ -597,12 +605,12 @@ ecore_x_randr_crtc_possible_outputs_get(Ecore_X_Window root,
}
EAPI void
-ecore_x_randr_crtc_geometry_get(Ecore_X_Window root,
+ecore_x_randr_crtc_geometry_get(Ecore_X_Window root,
Ecore_X_Randr_Crtc crtc,
- int *x,
- int *y,
- int *w,
- int *h)
+ int *x,
+ int *y,
+ int *w,
+ int *h)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET();
@@ -612,21 +620,21 @@ ecore_x_randr_crtc_geometry_get(Ecore_X_Window root,
if (_ecore_x_randr_crtc_validate(root,
crtc) &&
(res =
- _ecore_x_randr_get_screen_resources (_ecore_x_disp,
- root)) &&
+ _ecore_x_randr_get_screen_resources (_ecore_x_disp,
+ root)) &&
(crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
{
if (x)
- *x = crtc_info->x;
+ *x = crtc_info->x;
if (y)
- *y = crtc_info->y;
+ *y = crtc_info->y;
if (w)
- *w = crtc_info->width;
+ *w = crtc_info->width;
if (h)
- *h = crtc_info->height;
+ *h = crtc_info->height;
XRRFreeCrtcInfo(crtc_info);
XRRFreeScreenResources(res);
@@ -644,10 +652,10 @@ ecore_x_randr_crtc_geometry_get(Ecore_X_Window root,
* @return EINA_TRUE if position could be successfully be altered.
*/
EAPI Eina_Bool
-ecore_x_randr_crtc_pos_set(Ecore_X_Window root,
+ecore_x_randr_crtc_pos_set(Ecore_X_Window root,
Ecore_X_Randr_Crtc crtc,
- int x,
- int y)
+ int x,
+ int y)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(EINA_FALSE);
@@ -662,20 +670,20 @@ ecore_x_randr_crtc_pos_set(Ecore_X_Window root,
&crtc_geo.h);
ecore_x_randr_screen_current_size_get(root, &w_c, &h_c, NULL, NULL);
if (x < 0)
- x = crtc_geo.x;
+ x = crtc_geo.x;
if (y < 0)
- y = crtc_geo.y;
+ y = crtc_geo.y;
if ((x + crtc_geo.w) > w_c)
- w_new = x + crtc_geo.w;
+ w_new = x + crtc_geo.w;
if ((y + crtc_geo.h) > h_c)
- h_new = y + crtc_geo.h;
+ h_new = y + crtc_geo.h;
if ((w_new != 0) || (h_new != 0))
- if (!ecore_x_randr_screen_current_size_set(root, w_new, h_new, 0, 0))
- return EINA_FALSE;
+ if (!ecore_x_randr_screen_current_size_set(root, w_new, h_new, 0, 0))
+ return EINA_FALSE;
return ecore_x_randr_crtc_settings_set(root,
crtc,
@@ -698,7 +706,8 @@ ecore_x_randr_crtc_pos_set(Ecore_X_Window root,
* Ecore_X_Randr_Unset
*/
EAPI Ecore_X_Randr_Mode
-ecore_x_randr_crtc_mode_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc)
+ecore_x_randr_crtc_mode_get(Ecore_X_Window root,
+ Ecore_X_Randr_Crtc crtc)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(Ecore_X_Randr_Unset);
@@ -709,8 +718,8 @@ ecore_x_randr_crtc_mode_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc)
_ecore_x_randr_crtc_validate(root,
crtc) &&
(res =
- _ecore_x_randr_get_screen_resources(_ecore_x_disp,
- root)) &&
+ _ecore_x_randr_get_screen_resources(_ecore_x_disp,
+ root)) &&
(crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
{
ret = crtc_info->mode;
@@ -737,17 +746,17 @@ ecore_x_randr_crtc_mode_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc)
* @return EINA_TRUE if mode setting was successful. Else EINA_FALSE
*/
EAPI Eina_Bool
-ecore_x_randr_crtc_mode_set(Ecore_X_Window root,
- Ecore_X_Randr_Crtc crtc,
+ecore_x_randr_crtc_mode_set(Ecore_X_Window root,
+ Ecore_X_Randr_Crtc crtc,
Ecore_X_Randr_Output *outputs,
- int noutputs,
- Ecore_X_Randr_Mode mode)
+ int noutputs,
+ Ecore_X_Randr_Mode mode)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(EINA_FALSE);
if (mode == Ecore_X_Randr_Unset)
- return EINA_FALSE;
+ return EINA_FALSE;
return ecore_x_randr_crtc_settings_set(root,
crtc,
@@ -763,10 +772,10 @@ ecore_x_randr_crtc_mode_set(Ecore_X_Window root,
}
EAPI void
-ecore_x_randr_crtc_size_get(Ecore_X_Window root,
+ecore_x_randr_crtc_size_get(Ecore_X_Window root,
Ecore_X_Randr_Crtc crtc,
- int *w,
- int *h)
+ int *w,
+ int *h)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET();
@@ -775,7 +784,7 @@ ecore_x_randr_crtc_size_get(Ecore_X_Window root,
}
EAPI Ecore_X_Randr_Refresh_Rate
-ecore_x_randr_crtc_refresh_rate_get(Ecore_X_Window root,
+ecore_x_randr_crtc_refresh_rate_get(Ecore_X_Window root,
Ecore_X_Randr_Crtc crtc,
Ecore_X_Randr_Mode mode)
{
@@ -791,23 +800,22 @@ ecore_x_randr_crtc_refresh_rate_get(Ecore_X_Window root,
(res = _ecore_x_randr_get_screen_resources (_ecore_x_disp, root)))
{
for (i = 0; i < res->nmode; i++)
- if (res->modes[i].id == mode)
- {
- if (res->modes[i].hTotal && res->modes[i].vTotal)
- ret = ((double)res->modes[i].dotClock /
- ((double)res->modes[i].hTotal *
- (double)res->modes[i].vTotal));
-
- break;
- }
+ if (res->modes[i].id == mode)
+ {
+ if (res->modes[i].hTotal && res->modes[i].vTotal)
+ ret = ((double)res->modes[i].dotClock /
+ ((double)res->modes[i].hTotal *
+ (double)res->modes[i].vTotal));
+ break;
+ }
}
if (crtc_info)
- XRRFreeCrtcInfo(crtc_info);
+ XRRFreeCrtcInfo(crtc_info);
if (res)
- XRRFreeScreenResources(res);
+ XRRFreeScreenResources(res);
return ret;
#else
@@ -816,7 +824,7 @@ ecore_x_randr_crtc_refresh_rate_get(Ecore_X_Window root,
}
EAPI Ecore_X_Randr_Orientation
-ecore_x_randr_crtc_orientations_get(Ecore_X_Window root,
+ecore_x_randr_crtc_orientations_get(Ecore_X_Window root,
Ecore_X_Randr_Crtc crtc)
{
#ifdef ECORE_XRANDR
@@ -828,17 +836,17 @@ ecore_x_randr_crtc_orientations_get(Ecore_X_Window root,
if (_ecore_x_randr_crtc_validate(root,
crtc) &&
(res =
- _ecore_x_randr_get_screen_resources (_ecore_x_disp,
- root)) &&
+ _ecore_x_randr_get_screen_resources (_ecore_x_disp,
+ root)) &&
(crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
{
ret = crtc_info->rotations;
}
if (crtc_info)
- XRRFreeCrtcInfo(crtc_info);
+ XRRFreeCrtcInfo(crtc_info);
if (res)
- XRRFreeScreenResources(res);
+ XRRFreeScreenResources(res);
return ret;
#else
@@ -847,7 +855,8 @@ ecore_x_randr_crtc_orientations_get(Ecore_X_Window root,
}
EAPI Ecore_X_Randr_Orientation
-ecore_x_randr_crtc_orientation_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc)
+ecore_x_randr_crtc_orientation_get(Ecore_X_Window root,
+ Ecore_X_Randr_Crtc crtc)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(Ecore_X_Randr_None);
@@ -858,17 +867,17 @@ ecore_x_randr_crtc_orientation_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc)
if (_ecore_x_randr_crtc_validate(root,
crtc) &&
(res =
- _ecore_x_randr_get_screen_resources (_ecore_x_disp,
- root)) &&
+ _ecore_x_randr_get_screen_resources (_ecore_x_disp,
+ root)) &&
(crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
{
ret = crtc_info->rotation;
}
if (crtc_info)
- XRRFreeCrtcInfo(crtc_info);
+ XRRFreeCrtcInfo(crtc_info);
if (res)
- XRRFreeScreenResources(res);
+ XRRFreeScreenResources(res);
return ret;
#else
@@ -877,8 +886,8 @@ ecore_x_randr_crtc_orientation_get(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc)
}
EAPI Eina_Bool
-ecore_x_randr_crtc_orientation_set(Ecore_X_Window root,
- Ecore_X_Randr_Crtc crtc,
+ecore_x_randr_crtc_orientation_set(Ecore_X_Window root,
+ Ecore_X_Randr_Crtc crtc,
Ecore_X_Randr_Orientation orientation)
{
#ifdef ECORE_XRANDR
@@ -904,10 +913,10 @@ ecore_x_randr_crtc_orientation_set(Ecore_X_Window root,
}
EAPI void
-ecore_x_randr_crtc_pos_get(Ecore_X_Window root,
+ecore_x_randr_crtc_pos_get(Ecore_X_Window root,
Ecore_X_Randr_Crtc crtc,
- int *x,
- int *y)
+ int *x,
+ int *y)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET();
@@ -917,7 +926,7 @@ ecore_x_randr_crtc_pos_get(Ecore_X_Window root,
}
EAPI Eina_Bool
-ecore_x_randr_crtc_clone_set(Ecore_X_Window root,
+ecore_x_randr_crtc_clone_set(Ecore_X_Window root,
Ecore_X_Randr_Crtc original,
Ecore_X_Randr_Crtc clon)
{
@@ -932,13 +941,13 @@ ecore_x_randr_crtc_clone_set(Ecore_X_Window root,
int x, y;
if (_ecore_x_randr_root_validate(root) &&
- _ecore_x_randr_crtc_validate(root,
+ _ecore_x_randr_crtc_validate(root,
original) &&
- _ecore_x_randr_crtc_validate(root,
+ _ecore_x_randr_crtc_validate(root,
clon) &&
(res =
- _ecore_x_randr_get_screen_resources (_ecore_x_disp,
- root)) &&
+ _ecore_x_randr_get_screen_resources (_ecore_x_disp,
+ root)) &&
(clone_crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, clon)))
{
ecore_x_randr_crtc_geometry_get(root, original, &x, &y, NULL, NULL);
@@ -984,13 +993,13 @@ ecore_x_randr_crtc_clone_set(Ecore_X_Window root,
* EINA_FALSE
*/
EAPI Eina_Bool
-ecore_x_randr_crtc_settings_set(Ecore_X_Window root,
- Ecore_X_Randr_Crtc crtc,
- Ecore_X_Randr_Output *outputs,
- int noutputs,
- int x,
- int y,
- Ecore_X_Randr_Mode mode,
+ecore_x_randr_crtc_settings_set(Ecore_X_Window root,
+ Ecore_X_Randr_Crtc crtc,
+ Ecore_X_Randr_Output *outputs,
+ int noutputs,
+ int x,
+ int y,
+ Ecore_X_Randr_Mode mode,
Ecore_X_Randr_Orientation orientation)
{
#ifdef ECORE_XRANDR
@@ -1018,21 +1027,21 @@ ecore_x_randr_crtc_settings_set(Ecore_X_Window root,
}
if (mode == Ecore_X_Randr_Unset)
- mode = crtc_info->mode;
+ mode = crtc_info->mode;
if (x < 0)
- x = crtc_info->x;
+ x = crtc_info->x;
if (y < 0)
- y = crtc_info->y;
+ y = crtc_info->y;
if (orientation == Ecore_X_Randr_Unset)
- orientation = crtc_info->rotation;
+ orientation = crtc_info->rotation;
if (!XRRSetCrtcConfig(_ecore_x_disp, res, crtc, CurrentTime,
x, y, mode, orientation, (RROutput *)outputs,
noutputs))
- ret = EINA_TRUE;
+ ret = EINA_TRUE;
XRRFreeCrtcInfo(crtc_info);
}
@@ -1057,10 +1066,10 @@ ecore_x_randr_crtc_settings_set(Ecore_X_Window root,
* repositioning failed or if position of new crtc would be out of given screen's min/max bounds.
*/
EAPI Eina_Bool
-ecore_x_randr_crtc_pos_relative_set(Ecore_X_Window root,
- Ecore_X_Randr_Crtc crtc_r1,
- Ecore_X_Randr_Crtc crtc_r2,
- Ecore_X_Randr_Output_Policy policy,
+ecore_x_randr_crtc_pos_relative_set(Ecore_X_Window root,
+ Ecore_X_Randr_Crtc crtc_r1,
+ Ecore_X_Randr_Crtc crtc_r2,
+ Ecore_X_Randr_Output_Policy policy,
Ecore_X_Randr_Relative_Alignment alignment)
{
#ifdef ECORE_XRANDR
@@ -1068,21 +1077,21 @@ ecore_x_randr_crtc_pos_relative_set(Ecore_X_Window root,
Eina_Rectangle r1_geo, r2_geo;
int w_max, h_max, cw, ch, x_n = Ecore_X_Randr_Unset, y_n =
- Ecore_X_Randr_Unset;
+ Ecore_X_Randr_Unset;
/*
- int r1_noutputs, r2_noutputs, r1_nmodes, i, j, outputs_mode_found, mode_w, mode_h;
- Ecore_X_Randr_Output *r1_outputs, *r2_outputs, *r2_r1_outputs;
- Ecore_X_Randr_Mode *r1_modes, r2_mode, r1_mode;
- Eina_Bool ret;
- */
+ int r1_noutputs, r2_noutputs, r1_nmodes, i, j, outputs_mode_found, mode_w, mode_h;
+ Ecore_X_Randr_Output *r1_outputs, *r2_outputs, *r2_r1_outputs;
+ Ecore_X_Randr_Mode *r1_modes, r2_mode, r1_mode;
+ Eina_Bool ret;
+ */
if ((ecore_x_randr_crtc_mode_get(root, crtc_r1) == Ecore_X_Randr_None)
|| (ecore_x_randr_crtc_mode_get(root, crtc_r2) == Ecore_X_Randr_None))
- return EINA_FALSE;
+ return EINA_FALSE;
if (!_ecore_x_randr_crtc_validate(root, crtc_r1) ||
(!(crtc_r1 != crtc_r2) &&
- !_ecore_x_randr_crtc_validate(root, crtc_r2)))
+ !_ecore_x_randr_crtc_validate(root, crtc_r2)))
return EINA_FALSE;
ecore_x_randr_crtc_geometry_get(root,
@@ -1103,246 +1112,246 @@ ecore_x_randr_crtc_pos_relative_set(Ecore_X_Window root,
switch (policy)
{
case ECORE_X_RANDR_OUTPUT_POLICY_RIGHT:
- //set r1 right of r2
- x_n = r2_geo.x + r2_geo.w;
-
- switch (alignment)
- {
- case ECORE_X_RANDR_RELATIVE_ALIGNMENT_NONE:
- y_n = Ecore_X_Randr_Unset;
- break;
-
- case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_REL:
- y_n =
- ((int)(((double)r2_geo.h /
- 2.0) + (double)r2_geo.y - ((double)r1_geo.h / 2.0)));
- break;
+ //set r1 right of r2
+ x_n = r2_geo.x + r2_geo.w;
- case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_SCR:
- y_n = ((int)((double)ch / 2.0) - ((double)r1_geo.h / 2.0));
- break;
- }
- break;
+ switch (alignment)
+ {
+ case ECORE_X_RANDR_RELATIVE_ALIGNMENT_NONE:
+ y_n = Ecore_X_Randr_Unset;
+ break;
+
+ case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_REL:
+ y_n =
+ ((int)(((double)r2_geo.h /
+ 2.0) + (double)r2_geo.y - ((double)r1_geo.h / 2.0)));
+ break;
+
+ case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_SCR:
+ y_n = ((int)((double)ch / 2.0) - ((double)r1_geo.h / 2.0));
+ break;
+ }
+ break;
case ECORE_X_RANDR_OUTPUT_POLICY_LEFT:
- //set r1 left of r2
- x_n = r2_geo.x - r1_geo.w;
-
- switch (alignment)
- {
- case ECORE_X_RANDR_RELATIVE_ALIGNMENT_NONE:
- y_n = Ecore_X_Randr_Unset;
- break;
-
- case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_REL:
- y_n =
- ((int)(((double)r2_geo.h /
- 2.0) + r2_geo.y - ((double)r1_geo.h / 2.0)));
- break;
+ //set r1 left of r2
+ x_n = r2_geo.x - r1_geo.w;
- case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_SCR:
- y_n = ((int)(((double)ch / 2.0) - ((double)r1_geo.h / 2.0)));
- break;
- }
- break;
+ switch (alignment)
+ {
+ case ECORE_X_RANDR_RELATIVE_ALIGNMENT_NONE:
+ y_n = Ecore_X_Randr_Unset;
+ break;
+
+ case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_REL:
+ y_n =
+ ((int)(((double)r2_geo.h /
+ 2.0) + r2_geo.y - ((double)r1_geo.h / 2.0)));
+ break;
+
+ case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_SCR:
+ y_n = ((int)(((double)ch / 2.0) - ((double)r1_geo.h / 2.0)));
+ break;
+ }
+ break;
case ECORE_X_RANDR_OUTPUT_POLICY_BELOW:
- //set r1 below r2
- y_n = r2_geo.y + r2_geo.h;
+ //set r1 below r2
+ y_n = r2_geo.y + r2_geo.h;
- switch (alignment)
- {
- case ECORE_X_RANDR_RELATIVE_ALIGNMENT_NONE:
- x_n = Ecore_X_Randr_Unset;
- break;
-
- case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_REL:
- x_n =
- ((int)((((double)r2_geo.x +
- (double)r2_geo.w) / 2.0) - ((double)r1_geo.w / 2.0)));
- break;
-
- case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_SCR:
- x_n = ((int)((double)cw / 2.0));
- break;
- }
- break;
+ switch (alignment)
+ {
+ case ECORE_X_RANDR_RELATIVE_ALIGNMENT_NONE:
+ x_n = Ecore_X_Randr_Unset;
+ break;
+
+ case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_REL:
+ x_n =
+ ((int)((((double)r2_geo.x +
+ (double)r2_geo.w) / 2.0) - ((double)r1_geo.w / 2.0)));
+ break;
+
+ case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_SCR:
+ x_n = ((int)((double)cw / 2.0));
+ break;
+ }
+ break;
case ECORE_X_RANDR_OUTPUT_POLICY_ABOVE:
- y_n = r2_geo.y - r1_geo.h;
-
- //set r1 above r2
- switch (alignment)
- {
- case ECORE_X_RANDR_RELATIVE_ALIGNMENT_NONE:
- x_n = Ecore_X_Randr_Unset;
- break;
+ y_n = r2_geo.y - r1_geo.h;
- case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_REL:
- x_n =
- ((int)((((double)r2_geo.x +
- (double)r2_geo.w) / 2.0) - ((double)r1_geo.w / 2.0)));
- break;
-
- case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_SCR:
- x_n = ((int)((double)cw / 2.0));
- break;
- }
- break;
+ //set r1 above r2
+ switch (alignment)
+ {
+ case ECORE_X_RANDR_RELATIVE_ALIGNMENT_NONE:
+ x_n = Ecore_X_Randr_Unset;
+ break;
+
+ case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_REL:
+ x_n =
+ ((int)((((double)r2_geo.x +
+ (double)r2_geo.w) / 2.0) - ((double)r1_geo.w / 2.0)));
+ break;
+
+ case ECORE_X_RANDR_RELATIVE_ALIGNMENT_CENTER_SCR:
+ x_n = ((int)((double)cw / 2.0));
+ break;
+ }
+ break;
case ECORE_X_RANDR_OUTPUT_POLICY_CLONE:
- return ecore_x_randr_crtc_pos_set(root, crtc_r1, r2_geo.x, r2_geo.y);
+ return ecore_x_randr_crtc_pos_set(root, crtc_r1, r2_geo.x, r2_geo.y);
- /* entire cloning (including modesetting)
+ /* entire cloning (including modesetting)
//all outputs of crtc1 capable of crtc2's current mode?
r2_mode = ecore_x_randr_crtc_mode_get(root, crtc_r2);
if (!(r1_outputs =
- ecore_x_randr_crtc_outputs_get(root, crtc_r1,
- &r1_noutputs)) ||
- (r1_noutputs == 0))
- return EINA_FALSE;
+ ecore_x_randr_crtc_outputs_get(root, crtc_r1,
+ &r1_noutputs)) ||
+ (r1_noutputs == 0))
+ return EINA_FALSE;
for (i = 0, outputs_mode_found = 0; i < r1_noutputs; i++)
- {
- if (!(r1_modes =
- ecore_x_randr_output_modes_get(root, r1_outputs[i],
- &r1_nmodes, NULL)))
- {
- free(r1_outputs);
- return EINA_FALSE;
- }
+ {
+ if (!(r1_modes =
+ ecore_x_randr_output_modes_get(root, r1_outputs[i],
+ &r1_nmodes, NULL)))
+ {
+ free(r1_outputs);
+ return EINA_FALSE;
+ }
- for (j = 0; j < r1_nmodes; j++)
- {
- ecore_x_randr_mode_size_get(root,
- r1_modes[j],
- &mode_w,
- &mode_h);
- if ((mode_w == r2_geo.w) && (mode_h == r2_geo.h))
- {
- r1_mode = r1_modes[j];
- ++outputs_mode_found;
- free(r1_modes);
- r1_modes = NULL;
- break;
- }
- }
- if (r1_modes)
- free(r1_modes);
+ for (j = 0; j < r1_nmodes; j++)
+ {
+ ecore_x_randr_mode_size_get(root,
+ r1_modes[j],
+ &mode_w,
+ &mode_h);
+ if ((mode_w == r2_geo.w) && (mode_h == r2_geo.h))
+ {
+ r1_mode = r1_modes[j];
+ ++outputs_mode_found;
+ free(r1_modes);
+ r1_modes = NULL;
+ break;
+ }
+ }
+ if (r1_modes)
+ free(r1_modes);
- if (outputs_mode_found <= i)
- {
- //an output doesn't support the set mode, cancel!
- free(r1_outputs);
- return EINA_FALSE;
- }
- }
- free (r1_outputs);
+ if (outputs_mode_found <= i)
+ {
+ //an output doesn't support the set mode, cancel!
+ free(r1_outputs);
+ return EINA_FALSE;
+ }
+ }
+ free (r1_outputs);
//CRTC 1's outputs support a mode of same geometry as CRTC 2.
ret =
- (ecore_x_randr_crtc_mode_set(root, crtc_r1, Ecore_X_Randr_None,
- Ecore_X_Randr_None,
- r1_mode) &&
- ecore_x_randr_crtc_pos_set(root, crtc_r1, r2_geo.x, r2_geo.y));
+ (ecore_x_randr_crtc_mode_set(root, crtc_r1, Ecore_X_Randr_None,
+ Ecore_X_Randr_None,
+ r1_mode) &&
+ ecore_x_randr_crtc_pos_set(root, crtc_r1, r2_geo.x, r2_geo.y));
return ret;
- */
+ */
- /* entire cloning on same CRTC
+ /* entire cloning on same CRTC
//all outputs of crtc1 capable of crtc2's current mode?
r2_mode = ecore_x_randr_crtc_mode_get(root, crtc_r2);
if (!(r1_outputs =
- ecore_x_randr_crtc_outputs_get(root, crtc_r1,
- &r1_noutputs)) ||
- (r1_noutputs == 0))
- return EINA_FALSE;
+ ecore_x_randr_crtc_outputs_get(root, crtc_r1,
+ &r1_noutputs)) ||
+ (r1_noutputs == 0))
+ return EINA_FALSE;
for (i = 0, outputs_mode_found = 0; i < r1_noutputs; i++)
- {
- if (!(r1_modes =
- ecore_x_randr_output_modes_get(root, r1_outputs[i],
- &r1_nmodes, NULL)))
- {
- free(r1_outputs);
- return EINA_FALSE;
- }
+ {
+ if (!(r1_modes =
+ ecore_x_randr_output_modes_get(root, r1_outputs[i],
+ &r1_nmodes, NULL)))
+ {
+ free(r1_outputs);
+ return EINA_FALSE;
+ }
- for (j = 0; j < r1_nmodes; j++)
- {
- if (r1_modes[j] == r2_mode)
- {
- ++outputs_mode_found;
- free(r1_modes);
- r1_modes = NULL;
- break;
- }
- }
- if (r1_modes)
- free(r1_modes);
+ for (j = 0; j < r1_nmodes; j++)
+ {
+ if (r1_modes[j] == r2_mode)
+ {
+ ++outputs_mode_found;
+ free(r1_modes);
+ r1_modes = NULL;
+ break;
+ }
+ }
+ if (r1_modes)
+ free(r1_modes);
- if (outputs_mode_found <= i)
- {
- //an output doesn't support the set mode, cancel!
- free(r1_outputs);
- return EINA_FALSE;
- }
- }
+ if (outputs_mode_found <= i)
+ {
+ //an output doesn't support the set mode, cancel!
+ free(r1_outputs);
+ return EINA_FALSE;
+ }
+ }
//check whether crtc r2 can use all outputs of r1.
if (!(r2_outputs =
- ecore_x_randr_crtc_possible_outputs_get(root, crtc_r2,
- &r2_noutputs)) ||
- (r2_noutputs == 0))
- {
- free(r1_outputs);
- return EINA_FALSE;
- }
+ ecore_x_randr_crtc_possible_outputs_get(root, crtc_r2,
+ &r2_noutputs)) ||
+ (r2_noutputs == 0))
+ {
+ free(r1_outputs);
+ return EINA_FALSE;
+ }
for (i = 0; i < r1_noutputs; i++)
- {
- for (j = 0; j < r2_noutputs; )
- {
- if (r1_outputs[i] == r2_outputs[j])
- break;
+ {
+ for (j = 0; j < r2_noutputs; )
+ {
+ if (r1_outputs[i] == r2_outputs[j])
+ break;
- j++;
- }
- if (j == r2_noutputs)
- {
- //didn't find the output!
- free (r1_outputs);
- free (r2_outputs);
- return EINA_FALSE;
- }
- }
+ j++;
+ }
+ if (j == r2_noutputs)
+ {
+ //didn't find the output!
+ free (r1_outputs);
+ free (r2_outputs);
+ return EINA_FALSE;
+ }
+ }
//apparently crtc2 supports all outputs of r1
//TODO: check with the compatible list of outputs (property in RR1.3)
r2_r1_outputs =
- malloc(sizeof(Ecore_X_Randr_Output) * (r1_noutputs + r2_noutputs));
+ malloc(sizeof(Ecore_X_Randr_Output) * (r1_noutputs + r2_noutputs));
for (i = 0; i < r1_noutputs; i++)
- {
- r2_r1_outputs[i] = r1_outputs[i];
- }
- free(r1_outputs);
+ {
+ r2_r1_outputs[i] = r1_outputs[i];
+ }
+ free(r1_outputs);
for (; i < r2_noutputs; i++)
- {
- r2_r1_outputs[i] = r2_outputs[i];
- }
- free(r2_outputs);
+ {
+ r2_r1_outputs[i] = r2_outputs[i];
+ }
+ free(r2_outputs);
ret =
- ecore_x_randr_crtc_mode_set(root, crtc_r2, r2_r1_outputs,
- (r1_noutputs + r1_noutputs), r2_mode);
+ ecore_x_randr_crtc_mode_set(root, crtc_r2, r2_r1_outputs,
+ (r1_noutputs + r1_noutputs), r2_mode);
free (r2_r1_outputs);
return ret;
- */
+ */
case ECORE_X_RANDR_OUTPUT_POLICY_NONE:
break;
}
if ((x_n == r1_geo.x) && (y_n == r1_geo.x))
- return EINA_TRUE;
+ return EINA_TRUE;
//out of possible bounds?
if (((y_n + r1_geo.h) > h_max) || ((x_n + r1_geo.w) > w_max))
- return EINA_FALSE;
+ return EINA_FALSE;
return ecore_x_randr_crtc_pos_set(root, crtc_r1, x_n, y_n);
#else
@@ -1350,12 +1359,11 @@ ecore_x_randr_crtc_pos_relative_set(Ecore_X_Window root,
#endif
}
-
EAPI Ecore_X_Randr_Mode *
-ecore_x_randr_output_modes_get(Ecore_X_Window root,
+ecore_x_randr_output_modes_get(Ecore_X_Window root,
Ecore_X_Randr_Output output,
- int *num,
- int *npreferred)
+ int *num,
+ int *npreferred)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(NULL);
@@ -1366,25 +1374,25 @@ ecore_x_randr_output_modes_get(Ecore_X_Window root,
if ((output != Ecore_X_Randr_None)
&& (res = _ecore_x_randr_get_screen_resources(_ecore_x_disp, root))
&& (output_info =
- XRRGetOutputInfo(_ecore_x_disp, res, (RROutput)output)))
+ XRRGetOutputInfo(_ecore_x_disp, res, (RROutput)output)))
{
if ((modes = malloc(sizeof(Ecore_X_Randr_Mode) * output_info->nmode)))
{
memcpy(modes, output_info->modes,
(sizeof(Ecore_X_Randr_Mode) * output_info->nmode));
if (num)
- *num = output_info->nmode;
+ *num = output_info->nmode;
if (npreferred)
- *npreferred = output_info->npreferred;
+ *npreferred = output_info->npreferred;
}
}
if (output_info)
- XRRFreeOutputInfo(output_info);
+ XRRFreeOutputInfo(output_info);
if (res)
- XRRFreeScreenResources(res);
+ XRRFreeScreenResources(res);
return modes;
#else
@@ -1393,7 +1401,9 @@ ecore_x_randr_output_modes_get(Ecore_X_Window root,
}
EAPI Ecore_X_Randr_Crtc *
-ecore_x_randr_output_possible_crtcs_get(Ecore_X_Window root, Ecore_X_Randr_Output output, int *num)
+ecore_x_randr_output_possible_crtcs_get(Ecore_X_Window root,
+ Ecore_X_Randr_Output output,
+ int *num)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(NULL);
@@ -1403,21 +1413,21 @@ ecore_x_randr_output_possible_crtcs_get(Ecore_X_Window root, Ecore_X_Randr_Outpu
if ((output != Ecore_X_Randr_None))
{
- if ((res = _ecore_x_randr_get_screen_resources(_ecore_x_disp, root)))
- {
- if ((output_info = XRRGetOutputInfo(_ecore_x_disp, res, output)))
- {
- if ((crtcs = malloc(sizeof(Ecore_X_Randr_Crtc) * output_info->ncrtc)))
- {
- memcpy(crtcs, output_info->crtcs, (sizeof(Ecore_X_Randr_Crtc) * output_info->ncrtc));
- if (num) *num = output_info->ncrtc;
- }
- XRRFreeOutputInfo(output_info);
- }
- XRRFreeScreenResources(res);
- }
+ if ((res = _ecore_x_randr_get_screen_resources(_ecore_x_disp, root)))
+ {
+ if ((output_info = XRRGetOutputInfo(_ecore_x_disp, res, output)))
+ {
+ if ((crtcs = malloc(sizeof(Ecore_X_Randr_Crtc) * output_info->ncrtc)))
+ {
+ memcpy(crtcs, output_info->crtcs, (sizeof(Ecore_X_Randr_Crtc) * output_info->ncrtc));
+ if (num) *num = output_info->ncrtc;
+ }
+ XRRFreeOutputInfo(output_info);
+ }
+ XRRFreeScreenResources(res);
+ }
}
- return crtcs;
+ return crtcs;
#else
return Ecore_X_Randr_None;
#endif
@@ -1431,7 +1441,9 @@ ecore_x_randr_output_possible_crtcs_get(Ecore_X_Window root, Ecore_X_Randr_Outpu
* @param num number of possible clones
*/
EAPI Ecore_X_Randr_Output *
-ecore_x_randr_output_clones_get(Ecore_X_Window root, Ecore_X_Randr_Output output, int *num)
+ecore_x_randr_output_clones_get(Ecore_X_Window root,
+ Ecore_X_Randr_Output output,
+ int *num)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(NULL);
@@ -1441,28 +1453,29 @@ ecore_x_randr_output_clones_get(Ecore_X_Window root, Ecore_X_Randr_Output output
if ((output != Ecore_X_Randr_None))
{
- if ((res = _ecore_x_randr_get_screen_resources(_ecore_x_disp, root)))
- {
- if ((output_info = XRRGetOutputInfo(_ecore_x_disp, res, output)))
- {
- if ((outputs = malloc(sizeof(Ecore_X_Randr_Output) * output_info->nclone)))
- {
- memcpy(outputs, output_info->clones, (sizeof(Ecore_X_Randr_Output) * output_info->nclone));
- if (num) *num = output_info->nclone;
- }
- XRRFreeOutputInfo(output_info);
- }
- XRRFreeScreenResources(res);
- }
+ if ((res = _ecore_x_randr_get_screen_resources(_ecore_x_disp, root)))
+ {
+ if ((output_info = XRRGetOutputInfo(_ecore_x_disp, res, output)))
+ {
+ if ((outputs = malloc(sizeof(Ecore_X_Randr_Output) * output_info->nclone)))
+ {
+ memcpy(outputs, output_info->clones, (sizeof(Ecore_X_Randr_Output) * output_info->nclone));
+ if (num) *num = output_info->nclone;
+ }
+ XRRFreeOutputInfo(output_info);
+ }
+ XRRFreeScreenResources(res);
+ }
}
- return outputs;
+ return outputs;
#else
return Ecore_X_Randr_None;
#endif
}
EAPI Ecore_X_Randr_Crtc
-ecore_x_randr_output_crtc_get(Ecore_X_Window root, Ecore_X_Randr_Output output)
+ecore_x_randr_output_crtc_get(Ecore_X_Window root,
+ Ecore_X_Randr_Output output)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(Ecore_X_Randr_None);
@@ -1472,15 +1485,15 @@ ecore_x_randr_output_crtc_get(Ecore_X_Window root, Ecore_X_Randr_Output output)
if ((output != Ecore_X_Randr_None))
{
- if ((res = _ecore_x_randr_get_screen_resources(_ecore_x_disp, root)))
- {
- if ((output_info = XRRGetOutputInfo(_ecore_x_disp, res, output)))
- {
- ret = output_info->crtc;
- XRRFreeOutputInfo(output_info);
- }
- XRRFreeScreenResources(res);
- }
+ if ((res = _ecore_x_randr_get_screen_resources(_ecore_x_disp, root)))
+ {
+ if ((output_info = XRRGetOutputInfo(_ecore_x_disp, res, output)))
+ {
+ ret = output_info->crtc;
+ XRRFreeOutputInfo(output_info);
+ }
+ XRRFreeScreenResources(res);
+ }
}
return ret;
@@ -1496,7 +1509,9 @@ ecore_x_randr_output_crtc_get(Ecore_X_Window root, Ecore_X_Randr_Output output)
* @return name of the output as reported by X
*/
EAPI char *
-ecore_x_randr_output_name_get(Ecore_X_Window root, Ecore_X_Randr_Output output, int *len)
+ecore_x_randr_output_name_get(Ecore_X_Window root,
+ Ecore_X_Randr_Output output,
+ int *len)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(NULL);
@@ -1508,19 +1523,19 @@ ecore_x_randr_output_name_get(Ecore_X_Window root, Ecore_X_Randr_Output output,
&& (res = _ecore_x_randr_get_screen_resources(_ecore_x_disp, root))
&& (output_info = XRRGetOutputInfo(_ecore_x_disp, res, output)))
{
- /*
- * Actually the below command is correct, but due to a bug in libXrandr
- * it doesn't work. Therefore we stick with strlen().
- * Replace the line below with the following once this bug is
- * fixed within libXrandr.
- *
- * *len = output_info->nameLen;
- *
- */
- if ((ret = strdup(output_info->name)) && len)
- *len = strlen(ret);
-
- XRRFreeOutputInfo(output_info);
+ /*
+ * Actually the below command is correct, but due to a bug in libXrandr
+ * it doesn't work. Therefore we stick with strlen().
+ * Replace the line below with the following once this bug is
+ * fixed within libXrandr.
+ *
+ * *len = output_info->nameLen;
+ *
+ */
+ if ((ret = strdup(output_info->name)) && len)
+ *len = strlen(ret);
+
+ XRRFreeOutputInfo(output_info);
}
if (res)
@@ -1539,7 +1554,10 @@ ecore_x_randr_output_name_get(Ecore_X_Window root, Ecore_X_Randr_Output output,
* @param h height of given mode in px
*/
EAPI void
-ecore_x_randr_mode_size_get(Ecore_X_Window root, Ecore_X_Randr_Mode mode, int *w, int *h)
+ecore_x_randr_mode_size_get(Ecore_X_Window root,
+ Ecore_X_Randr_Mode mode,
+ int *w,
+ int *h)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET();
@@ -1550,19 +1568,19 @@ ecore_x_randr_mode_size_get(Ecore_X_Window root, Ecore_X_Randr_Mode mode, int *w
&& (w || h)
&& (res = _ecore_x_randr_get_screen_resources(_ecore_x_disp, root)))
{
- for (i = 0; i < res->nmode; i++)
- {
- if (res->modes[i].id == mode)
- {
- if (w)
- *w = res->modes[i].width;
-
- if (h)
- *h = res->modes[i].height;
-
- break;
- }
- }
+ for (i = 0; i < res->nmode; i++)
+ {
+ if (res->modes[i].id == mode)
+ {
+ if (w)
+ *w = res->modes[i].width;
+
+ if (h)
+ *h = res->modes[i].height;
+
+ break;
+ }
+ }
}
if (res)
@@ -1580,9 +1598,9 @@ ecore_x_randr_mode_size_get(Ecore_X_Window root, Ecore_X_Randr_Mode mode, int *w
* @param length length of the byte-array. If NULL, request will fail.
*/
EAPI unsigned char *
-ecore_x_randr_output_edid_get(Ecore_X_Window root,
+ecore_x_randr_output_edid_get(Ecore_X_Window root,
Ecore_X_Randr_Output output,
- unsigned long *length)
+ unsigned long *length)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(NULL);
@@ -1593,7 +1611,7 @@ ecore_x_randr_output_edid_get(Ecore_X_Window root,
Atom actual_type;
if (!length || !_ecore_x_randr_output_validate(root, output))
- return NULL;
+ return NULL;
if(XRRGetOutputProperty (_ecore_x_disp, output, name,
0, 100, False, False,
@@ -1607,7 +1625,7 @@ ecore_x_randr_output_edid_get(Ecore_X_Window root,
{
if(length &&
(memcpy(ret, prop_data, (nitems * sizeof(unsigned char)))))
- *length = nitems;
+ *length = nitems;
return ret;
}
@@ -1621,7 +1639,7 @@ ecore_x_randr_output_edid_get(Ecore_X_Window root,
}
EAPI Ecore_X_Randr_Connection_Status
-ecore_x_randr_output_connection_status_get(Ecore_X_Window root,
+ecore_x_randr_output_connection_status_get(Ecore_X_Window root,
Ecore_X_Randr_Output output)
{
#ifdef ECORE_XRANDR
@@ -1629,7 +1647,7 @@ ecore_x_randr_output_connection_status_get(Ecore_X_Window root,
XRRScreenResources *res = NULL;
XRROutputInfo *output_info = NULL;
Ecore_X_Randr_Connection_Status ret =
- ECORE_X_RANDR_CONNECTION_STATUS_UNKNOWN;
+ ECORE_X_RANDR_CONNECTION_STATUS_UNKNOWN;
if ((output != Ecore_X_Randr_None)
&& (res = _ecore_x_randr_get_screen_resources(_ecore_x_disp, root))
@@ -1639,10 +1657,10 @@ ecore_x_randr_output_connection_status_get(Ecore_X_Window root,
}
if (output_info)
- XRRFreeOutputInfo(output_info);
+ XRRFreeOutputInfo(output_info);
if (res)
- XRRFreeScreenResources(res);
+ XRRFreeScreenResources(res);
return ret;
#else
@@ -1651,10 +1669,10 @@ ecore_x_randr_output_connection_status_get(Ecore_X_Window root,
}
EAPI void
-ecore_x_randr_output_size_mm_get(Ecore_X_Window root,
+ecore_x_randr_output_size_mm_get(Ecore_X_Window root,
Ecore_X_Randr_Output output,
- int *w_mm,
- int *h_mm)
+ int *w_mm,
+ int *h_mm)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET();
@@ -1665,13 +1683,13 @@ ecore_x_randr_output_size_mm_get(Ecore_X_Window root,
&& (res = _ecore_x_randr_get_screen_resources(_ecore_x_disp, root)))
{
if ((output_info =
- XRRGetOutputInfo(_ecore_x_disp, res, (RROutput)output)))
+ XRRGetOutputInfo(_ecore_x_disp, res, (RROutput)output)))
{
if (w_mm)
- *w_mm = output_info->mm_width;
+ *w_mm = output_info->mm_width;
if (h_mm)
- *h_mm = output_info->mm_height;
+ *h_mm = output_info->mm_height;
XRRFreeOutputInfo(output_info);
}
@@ -1683,11 +1701,11 @@ ecore_x_randr_output_size_mm_get(Ecore_X_Window root,
}
EAPI Eina_Bool
-ecore_x_randr_move_all_crtcs_but(Ecore_X_Window root,
+ecore_x_randr_move_all_crtcs_but(Ecore_X_Window root,
const Ecore_X_Randr_Crtc *not_moved,
- int nnot_moved,
- int dx,
- int dy)
+ int nnot_moved,
+ int dx,
+ int dy)
{
#ifdef ECORE_XRANDR
Ecore_X_Randr_Crtc *crtcs_to_be_moved = NULL;
@@ -1695,12 +1713,11 @@ ecore_x_randr_move_all_crtcs_but(Ecore_X_Window root,
int i, j, k, n;
Eina_Bool ret;
-
if ((nnot_moved <= 0) || (!not_moved)
|| !_ecore_x_randr_root_validate(root)
|| !(res =
- _ecore_x_randr_get_screen_resources (_ecore_x_disp, root)))
- return EINA_FALSE;
+ _ecore_x_randr_get_screen_resources (_ecore_x_disp, root)))
+ return EINA_FALSE;
n = (res->ncrtc - nnot_moved);
if ((crtcs_to_be_moved = malloc(sizeof(Ecore_X_Randr_Crtc) * n)))
@@ -1710,11 +1727,11 @@ ecore_x_randr_move_all_crtcs_but(Ecore_X_Window root,
for (j = 0; j < nnot_moved; j++)
{
if (res->crtcs[i] == not_moved[j])
- break;
+ break;
}
if (j == nnot_moved)
- //crtcs[i] is not in the 'not to move'-list
- crtcs_to_be_moved[k++] = res->crtcs[i];
+ //crtcs[i] is not in the 'not to move'-list
+ crtcs_to_be_moved[k++] = res->crtcs[i];
}
}
@@ -1737,11 +1754,11 @@ ecore_x_randr_move_all_crtcs_but(Ecore_X_Window root,
* @return EINA_TRUE if all crtcs could be moved successfully.
*/
EAPI Eina_Bool
-ecore_x_randr_move_crtcs(Ecore_X_Window root,
+ecore_x_randr_move_crtcs(Ecore_X_Window root,
const Ecore_X_Randr_Crtc *crtcs,
- int ncrtc,
- int dx,
- int dy)
+ int ncrtc,
+ int dx,
+ int dy)
{
#ifdef ECORE_XRANDR
RANDR_CHECK_1_2_RET(EINA_FALSE);
@@ -1770,7 +1787,7 @@ ecore_x_randr_move_crtcs(Ecore_X_Window root,
|| ((crtc_info[i]->y + dy) < 0) ||
((int)(crtc_info[i]->y + crtc_info[i]->height + dy) > h_max)
)
- goto _ecore_x_randr_move_crtcs_fail_free_crtc_info;
+ goto _ecore_x_randr_move_crtcs_fail_free_crtc_info;
nw = MAX((int)(crtc_info[i]->x + crtc_info[i]->width + dx), nw);
nh = MAX((int)(crtc_info[i]->y + crtc_info[i]->height + dy), nh);
@@ -1783,7 +1800,7 @@ ecore_x_randr_move_crtcs(Ecore_X_Window root,
ecore_x_randr_screen_current_size_set(root, nw, nh,
Ecore_X_Randr_Unset,
Ecore_X_Randr_Unset)))
- goto _ecore_x_randr_move_crtcs_fail_free_crtc_info;
+ goto _ecore_x_randr_move_crtcs_fail_free_crtc_info;
//actually move all the crtcs, keep their rotation and mode.
for (i = 0; (i < ncrtc) && crtc_info[i]; i++)
@@ -1804,18 +1821,18 @@ ecore_x_randr_move_crtcs(Ecore_X_Window root,
{
//something went wrong, let's try to move the already moved crtcs
//back.
- while ((i--) >= 0)
- {
- if (crtc_info[i])
- ecore_x_randr_crtc_settings_set(root,
- crtcs[i],
- NULL,
- Ecore_X_Randr_Unset,
- (crtc_info[i]->x - dx),
- (crtc_info[i]->y - dy),
- crtc_info[i]->mode,
- crtc_info[i]->rotation);
- }
+ while ((i--) >= 0)
+ {
+ if (crtc_info[i])
+ ecore_x_randr_crtc_settings_set(root,
+ crtcs[i],
+ NULL,
+ Ecore_X_Randr_Unset,
+ (crtc_info[i]->x - dx),
+ (crtc_info[i]->y - dy),
+ crtc_info[i]->mode,
+ crtc_info[i]->rotation);
+ }
}
for (i = 0; i < ncrtc; i++)
@@ -1829,7 +1846,7 @@ ecore_x_randr_move_crtcs(Ecore_X_Window root,
return ret;
_ecore_x_randr_move_crtcs_fail_free_crtc_info:
while (i-- > 0)
- XRRFreeCrtcInfo(crtc_info[i]);
+ XRRFreeCrtcInfo(crtc_info[i]);
XRRFreeScreenResources(res);
return EINA_FALSE;
#else
@@ -1853,43 +1870,43 @@ ecore_x_randr_screen_reset(Ecore_X_Window root)
if (!_ecore_x_randr_root_validate(root) ||
!(res = _ecore_x_randr_get_screen_resources(_ecore_x_disp, root)))
- return;
+ return;
Ecore_X_Randr_Crtc enabled_crtcs[res->ncrtc];
for (i = 0; i < res->ncrtc; i++)
{
if (!(crtc_info =
- XRRGetCrtcInfo(_ecore_x_disp, res,
- res->crtcs[i])) ||
+ XRRGetCrtcInfo(_ecore_x_disp, res,
+ res->crtcs[i])) ||
(crtc_info->mode == Ecore_X_Randr_None) ||
(crtc_info->mode == Ecore_X_Randr_Unset)
|| ((crtc_info->noutput == 0)))
- continue;
+ continue;
- enabled_crtcs[nenabled_crtcs++] = res->crtcs[i];
+ enabled_crtcs[nenabled_crtcs++] = res->crtcs[i];
if ((int)(crtc_info->x + crtc_info->width) > w_n)
- w_n = (crtc_info->x + crtc_info->width);
+ w_n = (crtc_info->x + crtc_info->width);
if ((int)(crtc_info->y + crtc_info->height) > h_n)
- h_n = (crtc_info->y + crtc_info->height);
+ h_n = (crtc_info->y + crtc_info->height);
- if (crtc_info->x < dx_min)
- dx_min = crtc_info->x;
- if (crtc_info->y < dy_min)
- dy_min = crtc_info->y;
+ if (crtc_info->x < dx_min)
+ dx_min = crtc_info->x;
+ if (crtc_info->y < dy_min)
+ dy_min = crtc_info->y;
XRRFreeCrtcInfo(crtc_info);
}
fprintf(stderr, "E_RANDR: babam, resize! Trying to move all CRTCs with dx %d and dy %d", dx_min, dy_min);
if ((dx_min > 0) || (dy_min > 0))
{
- if (ecore_x_randr_move_crtcs(root, enabled_crtcs, nenabled_crtcs, -dx_min, -dy_min))
- {
- w_n -= dx_min;
- h_n -= dy_min;
- }
+ if (ecore_x_randr_move_crtcs(root, enabled_crtcs, nenabled_crtcs, -dx_min, -dy_min))
+ {
+ w_n -= dx_min;
+ h_n -= dy_min;
+ }
}
ecore_x_randr_screen_current_size_set(root,
w_n,
@@ -2091,7 +2108,7 @@ ecore_x_randr_output_backlight_level_set(Ecore_X_Window root,
EAPI Ecore_X_Randr_Output *
ecore_x_randr_window_outputs_get(Ecore_X_Window window,
- int *num)
+ int *num)
{
#ifdef ECORE_XRANDR
Ecore_X_Window root;
@@ -2120,39 +2137,39 @@ ecore_x_randr_window_outputs_get(Ecore_X_Window window,
for (i = 0; i < ncrtcs; i++)
{
/* if crtc is not enabled, don't bother about it any further */
- mode = ecore_x_randr_crtc_mode_get(root, crtcs[i]);
- if (mode == Ecore_X_Randr_None) continue;
+ mode = ecore_x_randr_crtc_mode_get(root, crtcs[i]);
+ if (mode == Ecore_X_Randr_None) continue;
- ecore_x_randr_crtc_geometry_get(root, crtcs[i],
- &c_geo.x, &c_geo.y,
- &c_geo.w, &c_geo.h);
- if (eina_rectangles_intersect(&w_geo, &c_geo))
- {
- outputs = ecore_x_randr_crtc_outputs_get(root, crtcs[i],
- &noutputs);
- /* The case below should be impossible, but for safety reasons
- * remains */
- if (!outputs)
- {
- if (num) *num = 0;
- free(ret);
- free(crtcs);
- return NULL;
- }
- tret = realloc(ret, ((nret + noutputs) * sizeof(Ecore_X_Randr_Output)));
- if (!tret)
- {
- if (num) *num = 0;
- free(outputs);
- free(ret);
- free(crtcs);
- return NULL;
- }
- ret = tret;
- memcpy(&ret[nret], outputs, (noutputs * sizeof(Ecore_X_Randr_Output)));
- nret += noutputs;
- free(outputs);
- }
+ ecore_x_randr_crtc_geometry_get(root, crtcs[i],
+ &c_geo.x, &c_geo.y,
+ &c_geo.w, &c_geo.h);
+ if (eina_rectangles_intersect(&w_geo, &c_geo))
+ {
+ outputs = ecore_x_randr_crtc_outputs_get(root, crtcs[i],
+ &noutputs);
+ /* The case below should be impossible, but for safety reasons
+ * remains */
+ if (!outputs)
+ {
+ if (num) *num = 0;
+ free(ret);
+ free(crtcs);
+ return NULL;
+ }
+ tret = realloc(ret, ((nret + noutputs) * sizeof(Ecore_X_Randr_Output)));
+ if (!tret)
+ {
+ if (num) *num = 0;
+ free(outputs);
+ free(ret);
+ free(crtcs);
+ return NULL;
+ }
+ ret = tret;
+ memcpy(&ret[nret], outputs, (noutputs * sizeof(Ecore_X_Randr_Output)));
+ nret += noutputs;
+ free(outputs);
+ }
}
free(crtcs);
@@ -2176,7 +2193,8 @@ _ecore_x_randr_current_output_get_fail:
EINA_DEPRECATED EAPI Ecore_X_Randr_Output *
ecore_x_randr_current_output_get(Ecore_X_Window window,
- int *num)
+ int *num)
{
return ecore_x_randr_window_outputs_get(window, num);
}
+
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c
index baf58b8d96..d434f2f011 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12_edid.c
@@ -28,81 +28,82 @@
* - see other TODO's within this file.
*/
-#define ECORE_X_RANDR_EDID_VERSION_10 ((1 << 8) | 0)
-#define ECORE_X_RANDR_EDID_VERSION_11 ((1 << 8) | 1)
-#define ECORE_X_RANDR_EDID_VERSION_12 ((1 << 8) | 2)
-#define ECORE_X_RANDR_EDID_VERSION_13 ((1 << 8) | 3)
-#define ECORE_X_RANDR_EDID_VERSION_14 ((1 << 8) | 4)
-
-#define _ECORE_X_RANDR_EDID_OFFSET_MANUFACTURER 0x08
-#define _ECORE_X_RANDR_EDID_OFFSET_TYPE 0x14
-#define _ECORE_X_RANDR_EDID_OFFSET_VERSION_MAJOR 0x12
-#define _ECORE_X_RANDR_EDID_OFFSET_VERSION_MINOR 0x13
-#define _ECORE_X_RANDR_EDID_OFFSET_DPMS 0x18
-#define _ECORE_X_RANDR_EDID_OFFSET_COLORSPACE 0x18
-#define _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK 0x36
-#define _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE 3
-#define _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_CONTENT 5
-#define _ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO_PREFERRED 15
-#define _ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO 14
-
-#define _ECORE_X_RANDR_EDID_MASK_DIGITAL 0x80
-#define _ECORE_X_RANDR_EDID_MASK_DIGITAL_INTERFACE 0x0f
-#define _ECORE_X_RANDR_EDID_MASK_DIGITAL_TMDS_DFP_10 0x01
-#define _ECORE_X_RANDR_EDID_MASK_COLORSCHEME_ANALOGOUS 0x18
-#define _ECORE_X_RANDR_EDID_MASK_COLORSCHEME_DIGITAL_YCRCB_444 0x10
-#define _ECORE_X_RANDR_EDID_MASK_COLORSCHEME_DIGITAL_YCRCB_422 0x08
-#define _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_PREFERRED 0xe0
-#define _ECORE_X_RANDR_EDID_MASK_DPMS 0xE0
-#define _ECORE_X_RANDR_EDID_MASK_DPMS_STANDBY 0x80
-#define _ECORE_X_RANDR_EDID_MASK_DPMS_SUSPEND 0x40
-#define _ECORE_X_RANDR_EDID_MASK_DPMS_OFF 0x20
-#define _ECORE_X_RANDR_EDID_MASK_INTERFACE_TYPE 0x0f
-#define _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_4_3 0x80
-#define _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_16_9 0x40
-#define _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_16_10 0x20
-#define _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_5_4 0x10
-#define _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_15_9 0x08
+#define ECORE_X_RANDR_EDID_VERSION_10 ((1 << 8) | 0)
+#define ECORE_X_RANDR_EDID_VERSION_11 ((1 << 8) | 1)
+#define ECORE_X_RANDR_EDID_VERSION_12 ((1 << 8) | 2)
+#define ECORE_X_RANDR_EDID_VERSION_13 ((1 << 8) | 3)
+#define ECORE_X_RANDR_EDID_VERSION_14 ((1 << 8) | 4)
+
+#define _ECORE_X_RANDR_EDID_OFFSET_MANUFACTURER 0x08
+#define _ECORE_X_RANDR_EDID_OFFSET_TYPE 0x14
+#define _ECORE_X_RANDR_EDID_OFFSET_VERSION_MAJOR 0x12
+#define _ECORE_X_RANDR_EDID_OFFSET_VERSION_MINOR 0x13
+#define _ECORE_X_RANDR_EDID_OFFSET_DPMS 0x18
+#define _ECORE_X_RANDR_EDID_OFFSET_COLORSPACE 0x18
+#define _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK 0x36
+#define _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE 3
+#define _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_CONTENT 5
+#define _ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO_PREFERRED 15
+#define _ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO 14
+
+#define _ECORE_X_RANDR_EDID_MASK_DIGITAL 0x80
+#define _ECORE_X_RANDR_EDID_MASK_DIGITAL_INTERFACE 0x0f
+#define _ECORE_X_RANDR_EDID_MASK_DIGITAL_TMDS_DFP_10 0x01
+#define _ECORE_X_RANDR_EDID_MASK_COLORSCHEME_ANALOGOUS 0x18
+#define _ECORE_X_RANDR_EDID_MASK_COLORSCHEME_DIGITAL_YCRCB_444 0x10
+#define _ECORE_X_RANDR_EDID_MASK_COLORSCHEME_DIGITAL_YCRCB_422 0x08
+#define _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_PREFERRED 0xe0
+#define _ECORE_X_RANDR_EDID_MASK_DPMS 0xE0
+#define _ECORE_X_RANDR_EDID_MASK_DPMS_STANDBY 0x80
+#define _ECORE_X_RANDR_EDID_MASK_DPMS_SUSPEND 0x40
+#define _ECORE_X_RANDR_EDID_MASK_DPMS_OFF 0x20
+#define _ECORE_X_RANDR_EDID_MASK_INTERFACE_TYPE 0x0f
+#define _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_4_3 0x80
+#define _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_16_9 0x40
+#define _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_16_10 0x20
+#define _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_5_4 0x10
+#define _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_15_9 0x08
#define _ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX 13
typedef enum _Ecore_X_Randr_Edid_Aspect_Ratio_Preferred {
ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_4_3 = 0x00,
- ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_16_9 = 0x01,
- ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_16_10 = 0x02,
- ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_5_4 = 0x03,
- ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_15_9 = 0x04
+ ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_16_9 = 0x01,
+ ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_16_10 = 0x02,
+ ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_5_4 = 0x03,
+ ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_15_9 = 0x04
} Ecore_X_Randr_Edid_Aspect_Ratio_Preferred;
/* Some convenience loops */
#define _ECORE_X_RANDR_EDID_FOR_EACH_EXTENSION_BLOCK(edid, edid_length, extension_block_iter) \
- for (extension_block_iter = edid; extension_block_iter < (edid + edid_length); extension_block_iter += 128)
+ for (extension_block_iter = edid; extension_block_iter < (edid + edid_length); extension_block_iter += 128)
#define _ECORE_X_RANDR_EDID_FOR_EACH_CEA_BLOCK(edid, edid_length, cea_block_iter) \
- _ECORE_X_RANDR_EDID_FOR_EACH_EXTENSION_BLOCK(edid, edid_length, cea_block_iter) \
- if (cea_block_iter[0] == 0x02)
+ _ECORE_X_RANDR_EDID_FOR_EACH_EXTENSION_BLOCK(edid, edid_length, cea_block_iter) \
+ if (cea_block_iter[0] == 0x02)
/* The following macro is to be used with caution as it inherits another loop.
* Therefore using a 'break;' statement will lead to continuation in the
* inherent 'Extension block'-loop.
*/
-#define _ECORE_X_RANDR_EDID_FOR_EACH_CEA_DETAILED_BLOCK(edid, edid_length, cea_block_iter, detailed_block_iter) \
- _ECORE_X_RANDR_EDID_FOR_EACH_CEA_BLOCK(edid, edid_length, cea_block_iter) \
- for (detailed_block_iter = cea_block_iter + cea_block_iter[2]; detailed_block_iter + 18 < cea_block_iter + 127; detailed_block_iter += 18) \
- if (detailed_block_iter[0])
+#define _ECORE_X_RANDR_EDID_FOR_EACH_CEA_DETAILED_BLOCK(edid, edid_length, cea_block_iter, detailed_block_iter) \
+ _ECORE_X_RANDR_EDID_FOR_EACH_CEA_BLOCK(edid, edid_length, cea_block_iter) \
+ for (detailed_block_iter = cea_block_iter + cea_block_iter[2]; detailed_block_iter + 18 < cea_block_iter + 127; detailed_block_iter += 18) \
+ if (detailed_block_iter[0])
#define _ECORE_X_RANDR_EDID_FOR_EACH_DESCRIPTOR_BLOCK(edid, block) \
- for (block = edid + _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK; block <= (edid + _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK + (3*18)); block += 18)
+ for (block = edid + _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK; block <= (edid + _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK + (3 * 18)); block += 18)
#define _ECORE_X_RANDR_EDID_FOR_EACH_NON_PIXEL_DESCRIPTOR_BLOCK(edid, block) \
- _ECORE_X_RANDR_EDID_FOR_EACH_DESCRIPTOR_BLOCK(edid, block) \
- if ((block[0] == 0) && (block[1] == 0))
+ _ECORE_X_RANDR_EDID_FOR_EACH_DESCRIPTOR_BLOCK(edid, block) \
+ if ((block[0] == 0) && (block[1] == 0))
EAPI Eina_Bool
-ecore_x_randr_edid_has_valid_header(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_has_valid_header(unsigned char *edid,
+ unsigned long edid_length)
{
const unsigned char header[] =
- { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 };
+ { 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00 };
if (!edid) return EINA_FALSE;
if (edid_length < 8) return EINA_FALSE;
if (!memcmp(edid, header, 8)) return EINA_TRUE;
@@ -110,36 +111,40 @@ ecore_x_randr_edid_has_valid_header(unsigned char *edid, unsigned long edid_leng
}
EAPI int
-ecore_x_randr_edid_version_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_version_get(unsigned char *edid,
+ unsigned long edid_length)
{
if ((edid_length > _ECORE_X_RANDR_EDID_OFFSET_VERSION_MINOR) &&
(ecore_x_randr_edid_has_valid_header(edid, edid_length)))
- return ((edid[_ECORE_X_RANDR_EDID_OFFSET_VERSION_MAJOR] << 8) |
- edid[_ECORE_X_RANDR_EDID_OFFSET_VERSION_MINOR]);
+ return (edid[_ECORE_X_RANDR_EDID_OFFSET_VERSION_MAJOR] << 8) |
+ edid[_ECORE_X_RANDR_EDID_OFFSET_VERSION_MINOR];
return ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
}
EAPI int
-ecore_x_randr_edid_manufacturer_model_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_manufacturer_model_get(unsigned char *edid,
+ unsigned long edid_length)
{
if ((edid_length > 0x0b) &&
(ecore_x_randr_edid_has_valid_header(edid, edid_length)))
- return (int)(edid[0x0a] + (edid[0x0b] << 8));
+ return (int)(edid[0x0a] + (edid[0x0b] << 8));
return ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
}
EAPI int
-ecore_x_randr_edid_manufacturer_serial_number_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_manufacturer_serial_number_get(unsigned char *edid,
+ unsigned long edid_length)
{
if ((edid_length > 0x0f) &&
(ecore_x_randr_edid_has_valid_header(edid, edid_length)))
- return (int)(edid[0x0c] + (edid[0x0d] << 8) +
- (edid[0x0e] << 16) + (edid[0x0f] << 24));
+ return (int)(edid[0x0c] + (edid[0x0d] << 8) +
+ (edid[0x0e] << 16) + (edid[0x0f] << 24));
return ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
}
EAPI char *
-ecore_x_randr_edid_manufacturer_name_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_manufacturer_name_get(unsigned char *edid,
+ unsigned long edid_length)
{
if ((edid_length > (_ECORE_X_RANDR_EDID_OFFSET_MANUFACTURER + 1)) &&
(ecore_x_randr_edid_has_valid_header(edid, edid_length)))
@@ -160,72 +165,80 @@ ecore_x_randr_edid_manufacturer_name_get(unsigned char *edid, unsigned long edid
}
EAPI char *
-ecore_x_randr_edid_display_name_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_display_name_get(unsigned char *edid,
+ unsigned long edid_length)
{
unsigned char *block = NULL;
int version = ecore_x_randr_edid_version_get(edid, edid_length);
if (version < ECORE_X_RANDR_EDID_VERSION_13) return NULL;
_ECORE_X_RANDR_EDID_FOR_EACH_NON_PIXEL_DESCRIPTOR_BLOCK(edid, block)
- {
- if (block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xfc)
- {
- char *name, *p;
- const char *edid_name;
-
- edid_name = (const char *)block + _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_CONTENT;
- name = malloc(sizeof(char) * _ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX);
- if (!name) return NULL;
- strncpy(name, edid_name, (_ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX - 1));
- name[_ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX] = 0;
- for (p = name; *p; p++)
- {
- if ((*p < ' ') || (*p > '~')) *p = 0;
- }
- return name;
- }
- }
+ {
+ if (block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xfc)
+ {
+ char *name, *p;
+ const char *edid_name;
+
+ edid_name = (const char *)block + _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_CONTENT;
+ name = malloc(sizeof(char) * _ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX);
+ if (!name) return NULL;
+ strncpy(name, edid_name, (_ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX - 1));
+ name[_ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX] = 0;
+ for (p = name; *p; p++)
+ {
+ if ((*p < ' ') || (*p > '~')) *p = 0;
+ }
+ return name;
+ }
+ }
return NULL;
}
EAPI Ecore_X_Randr_Edid_Aspect_Ratio
-ecore_x_randr_edid_display_aspect_ratio_preferred_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_display_aspect_ratio_preferred_get(unsigned char *edid,
+ unsigned long edid_length)
{
unsigned char *block = NULL;
int version = ecore_x_randr_edid_version_get(edid, edid_length);
if (version < ECORE_X_RANDR_EDID_VERSION_13) return ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
_ECORE_X_RANDR_EDID_FOR_EACH_NON_PIXEL_DESCRIPTOR_BLOCK(edid, block)
- {
- if ((block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xfd) &&
- (block[10] == 0x04))
- {
- Ecore_X_Randr_Edid_Aspect_Ratio_Preferred preferred_ratio =
- (Ecore_X_Randr_Edid_Aspect_Ratio_Preferred)
- ((block[_ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO_PREFERRED] &
- _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_PREFERRED) >> 5);
- switch (preferred_ratio)
- {
- case ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_4_3:
- return ECORE_X_RANDR_EDID_ASPECT_RATIO_4_3;
- case ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_16_9:
- return ECORE_X_RANDR_EDID_ASPECT_RATIO_16_9;
- case ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_16_10:
- return ECORE_X_RANDR_EDID_ASPECT_RATIO_16_10;
- case ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_5_4:
- return ECORE_X_RANDR_EDID_ASPECT_RATIO_5_4;
- case ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_15_9:
- return ECORE_X_RANDR_EDID_ASPECT_RATIO_15_9;
- default:
- return ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
- }
- }
- }
+ {
+ if ((block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xfd) &&
+ (block[10] == 0x04))
+ {
+ Ecore_X_Randr_Edid_Aspect_Ratio_Preferred preferred_ratio =
+ (Ecore_X_Randr_Edid_Aspect_Ratio_Preferred)
+ ((block[_ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO_PREFERRED] &
+ _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_PREFERRED) >> 5);
+ switch (preferred_ratio)
+ {
+ case ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_4_3:
+ return ECORE_X_RANDR_EDID_ASPECT_RATIO_4_3;
+
+ case ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_16_9:
+ return ECORE_X_RANDR_EDID_ASPECT_RATIO_16_9;
+
+ case ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_16_10:
+ return ECORE_X_RANDR_EDID_ASPECT_RATIO_16_10;
+
+ case ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_5_4:
+ return ECORE_X_RANDR_EDID_ASPECT_RATIO_5_4;
+
+ case ECORE_X_RANDR_EDID_ASPECT_RATIO_PREFERRED_15_9:
+ return ECORE_X_RANDR_EDID_ASPECT_RATIO_15_9;
+
+ default:
+ return ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
+ }
+ }
+ }
return ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
}
EAPI Ecore_X_Randr_Edid_Aspect_Ratio
-ecore_x_randr_edid_display_aspect_ratios_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_display_aspect_ratios_get(unsigned char *edid,
+ unsigned long edid_length)
{
Ecore_X_Randr_Edid_Aspect_Ratio ret = ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
unsigned char *block = NULL;
@@ -233,91 +246,94 @@ ecore_x_randr_edid_display_aspect_ratios_get(unsigned char *edid, unsigned long
if (version < ECORE_X_RANDR_EDID_VERSION_13) return ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
_ECORE_X_RANDR_EDID_FOR_EACH_NON_PIXEL_DESCRIPTOR_BLOCK(edid, block)
- {
- if ((block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xfd) &&
- (block[10] == 0x04))
- {
- if (block[_ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO] & _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_4_3)
- ret |= ECORE_X_RANDR_EDID_ASPECT_RATIO_4_3;
- if (block[_ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO] & _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_16_9)
- ret |= ECORE_X_RANDR_EDID_ASPECT_RATIO_16_9;
- if (block[_ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO] & _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_16_10)
- ret |= ECORE_X_RANDR_EDID_ASPECT_RATIO_16_10;
- if (block[_ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO] & _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_5_4)
- ret |= ECORE_X_RANDR_EDID_ASPECT_RATIO_5_4;
- if (block[_ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO] & _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_15_9)
- ret |= ECORE_X_RANDR_EDID_ASPECT_RATIO_15_9;
- }
- }
+ {
+ if ((block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xfd) &&
+ (block[10] == 0x04))
+ {
+ if (block[_ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO] & _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_4_3)
+ ret |= ECORE_X_RANDR_EDID_ASPECT_RATIO_4_3;
+ if (block[_ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO] & _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_16_9)
+ ret |= ECORE_X_RANDR_EDID_ASPECT_RATIO_16_9;
+ if (block[_ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO] & _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_16_10)
+ ret |= ECORE_X_RANDR_EDID_ASPECT_RATIO_16_10;
+ if (block[_ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO] & _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_5_4)
+ ret |= ECORE_X_RANDR_EDID_ASPECT_RATIO_5_4;
+ if (block[_ECORE_X_RANDR_EDID_OFFSET_ASPECT_RATIO] & _ECORE_X_RANDR_EDID_MASK_ASPECT_RATIO_15_9)
+ ret |= ECORE_X_RANDR_EDID_ASPECT_RATIO_15_9;
+ }
+ }
return ret;
}
EAPI char *
-ecore_x_randr_edid_display_ascii_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_display_ascii_get(unsigned char *edid,
+ unsigned long edid_length)
{
unsigned char *block = NULL;
int version = ecore_x_randr_edid_version_get(edid, edid_length);
if (version < ECORE_X_RANDR_EDID_VERSION_13) return NULL;
_ECORE_X_RANDR_EDID_FOR_EACH_NON_PIXEL_DESCRIPTOR_BLOCK(edid, block)
- {
- if (block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xfe)
- {
- char *ascii, *p;
- const char *edid_ascii = (const char*)block +
- _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_CONTENT;
- /*
- * TODO: Two of these in a row, in the third and fourth slots,
- * seems to be specified by SPWG: http://www.spwg.org/
- */
- ascii = malloc(sizeof(char) * _ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX);
- if (!ascii) return NULL;
- strncpy(ascii, edid_ascii, (_ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX - 1));
- ascii[_ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX] = 0;
- for (p = ascii; *p; p++)
- {
- if ((*p < ' ') || (*p > '~')) *p = 0;
- }
- return ascii;
- }
- }
+ {
+ if (block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xfe)
+ {
+ char *ascii, *p;
+ const char *edid_ascii = (const char *)block +
+ _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_CONTENT;
+ /*
+ * TODO: Two of these in a row, in the third and fourth slots,
+ * seems to be specified by SPWG: http://www.spwg.org/
+ */
+ ascii = malloc(sizeof(char) * _ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX);
+ if (!ascii) return NULL;
+ strncpy(ascii, edid_ascii, (_ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX - 1));
+ ascii[_ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX] = 0;
+ for (p = ascii; *p; p++)
+ {
+ if ((*p < ' ') || (*p > '~')) *p = 0;
+ }
+ return ascii;
+ }
+ }
return NULL;
}
EAPI char *
-ecore_x_randr_edid_display_serial_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_display_serial_get(unsigned char *edid,
+ unsigned long edid_length)
{
unsigned char *block = NULL;
int version = ecore_x_randr_edid_version_get(edid, edid_length);
if (version < ECORE_X_RANDR_EDID_VERSION_13) return NULL;
_ECORE_X_RANDR_EDID_FOR_EACH_NON_PIXEL_DESCRIPTOR_BLOCK(edid, block)
- {
- if (block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xff)
- {
- char *serial, *p;
- const char *edid_serial = (const char*)block +
- _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_CONTENT;
- /*
- * TODO: Two of these in a row, in the third and fourth slots,
- * seems to be specified by SPWG: http://www.spwg.org/
- */
- serial = malloc(sizeof(char) * _ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX);
- if (!serial) return NULL;
- strncpy(serial, edid_serial, (_ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX - 1));
- serial[_ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX] = 0;
- for (p = serial; *p; p++)
- {
- if ((*p < ' ') || (*p > '~')) *p = 0;
- }
- return serial;
- }
- }
+ {
+ if (block[_ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_TYPE] == 0xff)
+ {
+ char *serial, *p;
+ const char *edid_serial = (const char *)block +
+ _ECORE_X_RANDR_EDID_OFFSET_DESCRIPTOR_BLOCK_CONTENT;
+ /*
+ * TODO: Two of these in a row, in the third and fourth slots,
+ * seems to be specified by SPWG: http://www.spwg.org/
+ */
+ serial = malloc(sizeof(char) * _ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX);
+ if (!serial) return NULL;
+ strncpy(serial, edid_serial, (_ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX - 1));
+ serial[_ECORE_X_RANDR_EDID_DISPLAY_DESCRIPTOR_BLOCK_CONTENT_LENGTH_MAX] = 0;
+ for (p = serial; *p; p++)
+ {
+ if ((*p < ' ') || (*p > '~')) *p = 0;
+ }
+ return serial;
+ }
+ }
return NULL;
}
EAPI Eina_Bool
-ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid,
+ unsigned long edid_length)
{
unsigned char *cea_block_iter = NULL;
char sum = 0;
@@ -333,71 +349,77 @@ ecore_x_randr_edid_info_has_valid_checksum(unsigned char *edid, unsigned long ed
/* Check the cea extension blocks */
_ECORE_X_RANDR_EDID_FOR_EACH_CEA_BLOCK(edid, edid_length, cea_block_iter)
- {
- for (i = 0, sum = 0; i < 128; i++) sum += cea_block_iter[i];
- }
+ {
+ for (i = 0, sum = 0; i < 128; i++) sum += cea_block_iter[i];
+ }
if (sum) return EINA_FALSE;
return EINA_TRUE;
}
EAPI Eina_Bool
-ecore_x_randr_edid_dpms_available_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_dpms_available_get(unsigned char *edid,
+ unsigned long edid_length)
{
int version = ecore_x_randr_edid_version_get(edid, edid_length);
if (version < ECORE_X_RANDR_EDID_VERSION_13) return EINA_FALSE;
- return (!!(edid[_ECORE_X_RANDR_EDID_OFFSET_DPMS] &
- _ECORE_X_RANDR_EDID_MASK_DPMS));
+ return !!(edid[_ECORE_X_RANDR_EDID_OFFSET_DPMS] &
+ _ECORE_X_RANDR_EDID_MASK_DPMS);
}
EAPI Eina_Bool
-ecore_x_randr_edid_dpms_standby_available_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_dpms_standby_available_get(unsigned char *edid,
+ unsigned long edid_length)
{
int version = ecore_x_randr_edid_version_get(edid, edid_length);
if (version < ECORE_X_RANDR_EDID_VERSION_13) return EINA_FALSE;
if (edid[_ECORE_X_RANDR_EDID_OFFSET_DPMS] & _ECORE_X_RANDR_EDID_MASK_DPMS)
- return (!!(edid[_ECORE_X_RANDR_EDID_OFFSET_DPMS] &
- _ECORE_X_RANDR_EDID_MASK_DPMS_STANDBY));
+ return !!(edid[_ECORE_X_RANDR_EDID_OFFSET_DPMS] &
+ _ECORE_X_RANDR_EDID_MASK_DPMS_STANDBY);
return EINA_FALSE;
}
EAPI Eina_Bool
-ecore_x_randr_edid_dpms_suspend_available_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_dpms_suspend_available_get(unsigned char *edid,
+ unsigned long edid_length)
{
int version = ecore_x_randr_edid_version_get(edid, edid_length);
if (version < ECORE_X_RANDR_EDID_VERSION_13) return EINA_FALSE;
if (edid[_ECORE_X_RANDR_EDID_OFFSET_DPMS] & _ECORE_X_RANDR_EDID_MASK_DPMS)
- return (!!(edid[_ECORE_X_RANDR_EDID_OFFSET_DPMS] &
- _ECORE_X_RANDR_EDID_MASK_DPMS_SUSPEND));
+ return !!(edid[_ECORE_X_RANDR_EDID_OFFSET_DPMS] &
+ _ECORE_X_RANDR_EDID_MASK_DPMS_SUSPEND);
return EINA_FALSE;
}
EAPI Eina_Bool
-ecore_x_randr_edid_dpms_off_available_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_dpms_off_available_get(unsigned char *edid,
+ unsigned long edid_length)
{
int version = ecore_x_randr_edid_version_get(edid, edid_length);
if (version < ECORE_X_RANDR_EDID_VERSION_13) return EINA_FALSE;
if (edid[_ECORE_X_RANDR_EDID_OFFSET_DPMS] & _ECORE_X_RANDR_EDID_MASK_DPMS)
- return (!!(edid[_ECORE_X_RANDR_EDID_OFFSET_DPMS] &
- _ECORE_X_RANDR_EDID_MASK_DPMS_OFF));
+ return !!(edid[_ECORE_X_RANDR_EDID_OFFSET_DPMS] &
+ _ECORE_X_RANDR_EDID_MASK_DPMS_OFF);
return EINA_FALSE;
}
EAPI Eina_Bool
-ecore_x_randr_edid_display_type_digital_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_display_type_digital_get(unsigned char *edid,
+ unsigned long edid_length)
{
int version = ecore_x_randr_edid_version_get(edid, edid_length);
if (version < ECORE_X_RANDR_EDID_VERSION_13) return EINA_FALSE;
- return (!!(edid[_ECORE_X_RANDR_EDID_OFFSET_TYPE] &
- _ECORE_X_RANDR_EDID_MASK_DIGITAL));
+ return !!(edid[_ECORE_X_RANDR_EDID_OFFSET_TYPE] &
+ _ECORE_X_RANDR_EDID_MASK_DIGITAL);
}
EAPI Ecore_X_Randr_Edid_Display_Colorscheme
-ecore_x_randr_edid_display_colorscheme_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_display_colorscheme_get(unsigned char *edid,
+ unsigned long edid_length)
{
Ecore_X_Randr_Edid_Display_Colorscheme colorscheme = ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
int version = ecore_x_randr_edid_version_get(edid, edid_length);
@@ -408,26 +430,28 @@ ecore_x_randr_edid_display_colorscheme_get(unsigned char *edid, unsigned long ed
colorscheme = ECORE_X_RANDR_EDID_DISPLAY_COLORSCHEME_COLOR_RGB_4_4_4;
if (edid[_ECORE_X_RANDR_EDID_OFFSET_COLORSPACE] &
_ECORE_X_RANDR_EDID_MASK_COLORSCHEME_DIGITAL_YCRCB_444)
- colorscheme |= ECORE_X_RANDR_EDID_DISPLAY_COLORSCHEME_COLOR_RGB_YCRCB_4_4_4;
+ colorscheme |= ECORE_X_RANDR_EDID_DISPLAY_COLORSCHEME_COLOR_RGB_YCRCB_4_4_4;
if (edid[_ECORE_X_RANDR_EDID_OFFSET_COLORSPACE] &
_ECORE_X_RANDR_EDID_MASK_COLORSCHEME_DIGITAL_YCRCB_422)
- colorscheme |= ECORE_X_RANDR_EDID_DISPLAY_COLORSCHEME_COLOR_RGB_YCRCB_4_2_2;
+ colorscheme |= ECORE_X_RANDR_EDID_DISPLAY_COLORSCHEME_COLOR_RGB_YCRCB_4_2_2;
}
else
- colorscheme = edid[_ECORE_X_RANDR_EDID_OFFSET_COLORSPACE] & _ECORE_X_RANDR_EDID_MASK_COLORSCHEME_ANALOGOUS;
+ colorscheme = edid[_ECORE_X_RANDR_EDID_OFFSET_COLORSPACE] & _ECORE_X_RANDR_EDID_MASK_COLORSCHEME_ANALOGOUS;
return colorscheme;
}
EAPI Ecore_X_Randr_Edid_Display_Interface_Type
-ecore_x_randr_edid_display_interface_type_get(unsigned char *edid, unsigned long edid_length)
+ecore_x_randr_edid_display_interface_type_get(unsigned char *edid,
+ unsigned long edid_length)
{
Ecore_X_Randr_Edid_Display_Interface_Type type = ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
int version = ecore_x_randr_edid_version_get(edid, edid_length);
if (version < ECORE_X_RANDR_EDID_VERSION_13) return type;
type = edid[_ECORE_X_RANDR_EDID_OFFSET_TYPE] &
- _ECORE_X_RANDR_EDID_MASK_INTERFACE_TYPE;
+ _ECORE_X_RANDR_EDID_MASK_INTERFACE_TYPE;
if (type > ECORE_X_RANDR_EDID_DISPLAY_INTERFACE_DISPLAY_PORT)
- type = ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
+ type = ECORE_X_RANDR_EDID_UNKNOWN_VALUE;
return type;
}
+
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_13.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_13.c
index 6564b26ab7..ab242f76c4 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_13.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_13.c
@@ -9,18 +9,18 @@
#include "ecore_x_private.h"
#include "ecore_x_randr.h"
-#define Ecore_X_Randr_None 0
+#define Ecore_X_Randr_None 0
#define Ecore_X_Randr_Unset -1
#ifdef ECORE_XRANDR
-#define RANDR_1_3 ((1 << 16) | 3)
+#define RANDR_1_3 ((1 << 16) | 3)
#define RANDR_CHECK_1_3_RET(ret) if(_randr_version < RANDR_1_3) return ret
-extern XRRScreenResources * (*_ecore_x_randr_get_screen_resources)(Display *
- dpy,
- Window
- window);
+extern XRRScreenResources *(*_ecore_x_randr_get_screen_resources)(Display *
+ dpy,
+ Window
+ window);
extern int _randr_version;
#endif
@@ -34,7 +34,7 @@ ecore_x_randr_primary_output_get(Ecore_X_Window root)
#ifdef ECORE_XRANDR
RANDR_CHECK_1_3_RET(Ecore_X_Randr_None);
if (!_ecore_x_randr_root_validate(root))
- return Ecore_X_Randr_None;
+ return Ecore_X_Randr_None;
return XRRGetOutputPrimary(_ecore_x_disp, root);
#else
@@ -47,7 +47,7 @@ ecore_x_randr_primary_output_get(Ecore_X_Window root)
* @param output that should be set as given root window's screen primary output
*/
EAPI void
-ecore_x_randr_primary_output_set(Ecore_X_Window root,
+ecore_x_randr_primary_output_set(Ecore_X_Window root,
Ecore_X_Randr_Output output)
{
#ifdef ECORE_XRANDR
@@ -60,3 +60,4 @@ ecore_x_randr_primary_output_set(Ecore_X_Window root,
#endif
}
+
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_region.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_region.c
index f70e2bf3dc..7cc66e3642 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_region.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_region.c
@@ -39,24 +39,27 @@ ecore_x_xregion_free(Ecore_X_XRegion *region)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!region)
- return;
+ return;
XDestroyRegion((Region)region);
} /* ecore_x_xregion_free */
EAPI Eina_Bool
-ecore_x_xregion_set(Ecore_X_XRegion *region, Ecore_X_GC gc)
+ecore_x_xregion_set(Ecore_X_XRegion *region,
+ Ecore_X_GC gc)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return XSetRegion(_ecore_x_disp, gc, (Region)region) ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_xregion_set */
EAPI void
-ecore_x_xregion_translate(Ecore_X_XRegion *region, int x, int y)
+ecore_x_xregion_translate(Ecore_X_XRegion *region,
+ int x,
+ int y)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!region)
- return;
+ return;
/* return value not used */
XOffsetRegion((Region)region, x, y);
@@ -109,37 +112,41 @@ EAPI Eina_Bool
ecore_x_xregion_is_empty(Ecore_X_XRegion *region)
{
if (!region)
- return EINA_TRUE;
+ return EINA_TRUE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return XEmptyRegion((Region)region) ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_xregion_is_empty */
EAPI Eina_Bool
-ecore_x_xregion_is_equal(Ecore_X_XRegion *r1, Ecore_X_XRegion *r2)
+ecore_x_xregion_is_equal(Ecore_X_XRegion *r1,
+ Ecore_X_XRegion *r2)
{
if (!r1 || !r2)
- return EINA_FALSE;
+ return EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return XEqualRegion((Region)r1, (Region)r1) ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_xregion_is_equal */
EAPI Eina_Bool
-ecore_x_xregion_point_contain(Ecore_X_XRegion *region, int x, int y)
+ecore_x_xregion_point_contain(Ecore_X_XRegion *region,
+ int x,
+ int y)
{
if (!region)
- return EINA_FALSE;
+ return EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return XPointInRegion((Region)region, x, y) ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_xregion_point_contain */
EAPI Eina_Bool
-ecore_x_xregion_rect_contain(Ecore_X_XRegion *region, Ecore_X_Rectangle *rect)
+ecore_x_xregion_rect_contain(Ecore_X_XRegion *region,
+ Ecore_X_Rectangle *rect)
{
if (!region || !rect)
- return EINA_FALSE;
+ return EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return XRectInRegion((Region)region,
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c
index d33b9482c5..a3bca67f53 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_screensaver.c
@@ -17,7 +17,7 @@ EAPI Eina_Bool
ecore_x_screensaver_event_available_get(void)
{
if (_screensaver_available >= 0)
- return _screensaver_available;
+ return _screensaver_available;
#ifdef ECORE_XSS
int _screensaver_major, _screensaver_minor;
@@ -28,9 +28,9 @@ ecore_x_screensaver_event_available_get(void)
if (XScreenSaverQueryVersion(_ecore_x_disp, &_screensaver_major,
&_screensaver_minor))
- _screensaver_available = 1;
+ _screensaver_available = 1;
else
- _screensaver_available = 0;
+ _screensaver_available = 0;
#else /* ifdef ECORE_XSS */
_screensaver_available = 0;
@@ -49,7 +49,7 @@ ecore_x_screensaver_idle_time_get(void)
xss = XScreenSaverAllocInfo();
XScreenSaverQueryInfo(_ecore_x_disp,
RootWindow(_ecore_x_disp, DefaultScreen(
- _ecore_x_disp)), xss);
+ _ecore_x_disp)), xss);
idle = xss->idle / 1000;
XFree(xss);
@@ -162,9 +162,9 @@ ecore_x_screensaver_event_listen_set(Eina_Bool on)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
root = DefaultRootWindow(_ecore_x_disp);
if (on)
- XScreenSaverSelectInput(_ecore_x_disp, root, ScreenSaverNotifyMask);
+ XScreenSaverSelectInput(_ecore_x_disp, root, ScreenSaverNotifyMask);
else
- XScreenSaverSelectInput(_ecore_x_disp, root, 0);
+ XScreenSaverSelectInput(_ecore_x_disp, root, 0);
#else
return;
on = EINA_FALSE;
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c
index c484f3ee79..b1aa611764 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c
@@ -16,28 +16,28 @@ static Ecore_X_Selection_Converter *converters = NULL;
static Ecore_X_Selection_Parser *parsers = NULL;
static Eina_Bool _ecore_x_selection_converter_text(char *target,
- void *data,
- int size,
- void **data_ret,
- int *size_ret,
- Ecore_X_Atom *tprop,
- int *);
-static int _ecore_x_selection_data_default_free(void *data);
-static void * _ecore_x_selection_parser_files(const char *target,
- void *data,
- int size,
- int format);
-static int _ecore_x_selection_data_files_free(void *data);
-static void * _ecore_x_selection_parser_text(const char *target,
- void *data,
- int size,
- int format);
-static int _ecore_x_selection_data_text_free(void *data);
-static void * _ecore_x_selection_parser_targets(const char *target,
- void *data,
- int size,
- int format);
-static int _ecore_x_selection_data_targets_free(void *data);
+ void *data,
+ int size,
+ void **data_ret,
+ int *size_ret,
+ Ecore_X_Atom *tprop,
+ int *);
+static int _ecore_x_selection_data_default_free(void *data);
+static void *_ecore_x_selection_parser_files(const char *target,
+ void *data,
+ int size,
+ int format);
+static int _ecore_x_selection_data_files_free(void *data);
+static void *_ecore_x_selection_parser_text(const char *target,
+ void *data,
+ int size,
+ int format);
+static int _ecore_x_selection_data_text_free(void *data);
+static void *_ecore_x_selection_parser_targets(const char *target,
+ void *data,
+ int size,
+ int format);
+static int _ecore_x_selection_data_targets_free(void *data);
#define ECORE_X_SELECTION_DATA(x) ((Ecore_X_Selection_Data *)(x))
@@ -45,31 +45,31 @@ void
_ecore_x_selection_data_init(void)
{
/* Initialize global data */
- memset(selections, 0, sizeof(selections));
+ memset(selections, 0, sizeof(selections));
- /* Initialize converters */
- ecore_x_selection_converter_atom_add(ECORE_X_ATOM_TEXT,
- _ecore_x_selection_converter_text);
+ /* Initialize converters */
+ ecore_x_selection_converter_atom_add(ECORE_X_ATOM_TEXT,
+ _ecore_x_selection_converter_text);
#ifdef X_HAVE_UTF8_STRING
- ecore_x_selection_converter_atom_add(ECORE_X_ATOM_UTF8_STRING,
- _ecore_x_selection_converter_text);
+ ecore_x_selection_converter_atom_add(ECORE_X_ATOM_UTF8_STRING,
+ _ecore_x_selection_converter_text);
#endif /* ifdef X_HAVE_UTF8_STRING */
- ecore_x_selection_converter_atom_add(ECORE_X_ATOM_COMPOUND_TEXT,
- _ecore_x_selection_converter_text);
- ecore_x_selection_converter_atom_add(ECORE_X_ATOM_STRING,
- _ecore_x_selection_converter_text);
-
- /* Initialize parsers */
- ecore_x_selection_parser_add("text/plain",
- _ecore_x_selection_parser_text);
- ecore_x_selection_parser_add(ECORE_X_SELECTION_TARGET_UTF8_STRING,
- _ecore_x_selection_parser_text);
- ecore_x_selection_parser_add("text/uri-list",
- _ecore_x_selection_parser_files);
- ecore_x_selection_parser_add("_NETSCAPE_URL",
- _ecore_x_selection_parser_files);
- ecore_x_selection_parser_add(ECORE_X_SELECTION_TARGET_TARGETS,
- _ecore_x_selection_parser_targets);
+ ecore_x_selection_converter_atom_add(ECORE_X_ATOM_COMPOUND_TEXT,
+ _ecore_x_selection_converter_text);
+ ecore_x_selection_converter_atom_add(ECORE_X_ATOM_STRING,
+ _ecore_x_selection_converter_text);
+
+ /* Initialize parsers */
+ ecore_x_selection_parser_add("text/plain",
+ _ecore_x_selection_parser_text);
+ ecore_x_selection_parser_add(ECORE_X_SELECTION_TARGET_UTF8_STRING,
+ _ecore_x_selection_parser_text);
+ ecore_x_selection_parser_add("text/uri-list",
+ _ecore_x_selection_parser_files);
+ ecore_x_selection_parser_add("_NETSCAPE_URL",
+ _ecore_x_selection_parser_files);
+ ecore_x_selection_parser_add(ECORE_X_SELECTION_TARGET_TARGETS,
+ _ecore_x_selection_parser_targets);
} /* _ecore_x_selection_data_init */
void
@@ -108,15 +108,15 @@ Ecore_X_Selection_Intern *
_ecore_x_selection_get(Ecore_X_Atom selection)
{
if (selection == ECORE_X_ATOM_SELECTION_PRIMARY)
- return &selections[0];
+ return &selections[0];
else if (selection == ECORE_X_ATOM_SELECTION_SECONDARY)
- return &selections[1];
+ return &selections[1];
else if (selection == ECORE_X_ATOM_SELECTION_XDND)
- return &selections[2];
+ return &selections[2];
else if (selection == ECORE_X_ATOM_SELECTION_CLIPBOARD)
- return &selections[3];
+ return &selections[3];
else
- return NULL;
+ return NULL;
} /* _ecore_x_selection_get */
Eina_Bool
@@ -130,18 +130,18 @@ _ecore_x_selection_set(Window w,
XSetSelectionOwner(_ecore_x_disp, selection, w, _ecore_x_event_last_time);
if (XGetSelectionOwner(_ecore_x_disp, selection) != w)
- return EINA_FALSE;
+ return EINA_FALSE;
if (selection == ECORE_X_ATOM_SELECTION_PRIMARY)
- in = 0;
+ in = 0;
else if (selection == ECORE_X_ATOM_SELECTION_SECONDARY)
- in = 1;
+ in = 1;
else if (selection == ECORE_X_ATOM_SELECTION_XDND)
- in = 2;
+ in = 2;
else if (selection == ECORE_X_ATOM_SELECTION_CLIPBOARD)
- in = 3;
+ in = 3;
else
- return EINA_FALSE;
+ return EINA_FALSE;
if (data)
{
@@ -173,7 +173,9 @@ _ecore_x_selection_set(Window w,
* claimed, or 0 if unsuccessful.
*/
EAPI Eina_Bool
-ecore_x_selection_primary_set(Ecore_X_Window w, const void *data, int size)
+ecore_x_selection_primary_set(Ecore_X_Window w,
+ const void *data,
+ int size)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return _ecore_x_selection_set(w, data, size, ECORE_X_ATOM_SELECTION_PRIMARY);
@@ -201,7 +203,9 @@ ecore_x_selection_primary_clear(void)
* claimed, or 0 if unsuccessful.
*/
EAPI Eina_Bool
-ecore_x_selection_secondary_set(Ecore_X_Window w, const void *data, int size)
+ecore_x_selection_secondary_set(Ecore_X_Window w,
+ const void *data,
+ int size)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return _ecore_x_selection_set(w,
@@ -235,7 +239,9 @@ ecore_x_selection_secondary_clear(void)
* claimed, or 0 if unsuccessful.
*/
EAPI Eina_Bool
-ecore_x_selection_xdnd_set(Ecore_X_Window w, const void *data, int size)
+ecore_x_selection_xdnd_set(Ecore_X_Window w,
+ const void *data,
+ int size)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return _ecore_x_selection_set(w, data, size, ECORE_X_ATOM_SELECTION_XDND);
@@ -266,7 +272,9 @@ ecore_x_selection_xdnd_clear(void)
* request. The buffer must be freed when done with.
*/
EAPI Eina_Bool
-ecore_x_selection_clipboard_set(Ecore_X_Window w, const void *data, int size)
+ecore_x_selection_clipboard_set(Ecore_X_Window w,
+ const void *data,
+ int size)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return _ecore_x_selection_set(w,
@@ -297,17 +305,17 @@ _ecore_x_selection_target_atom_get(const char *target)
Ecore_X_Atom x_target;
if (!strcmp(target, ECORE_X_SELECTION_TARGET_TEXT))
- x_target = ECORE_X_ATOM_TEXT;
+ x_target = ECORE_X_ATOM_TEXT;
else if (!strcmp(target, ECORE_X_SELECTION_TARGET_COMPOUND_TEXT))
- x_target = ECORE_X_ATOM_COMPOUND_TEXT;
+ x_target = ECORE_X_ATOM_COMPOUND_TEXT;
else if (!strcmp(target, ECORE_X_SELECTION_TARGET_STRING))
- x_target = ECORE_X_ATOM_STRING;
+ x_target = ECORE_X_ATOM_STRING;
else if (!strcmp(target, ECORE_X_SELECTION_TARGET_UTF8_STRING))
- x_target = ECORE_X_ATOM_UTF8_STRING;
+ x_target = ECORE_X_ATOM_UTF8_STRING;
else if (!strcmp(target, ECORE_X_SELECTION_TARGET_FILENAME))
- x_target = ECORE_X_ATOM_FILE_NAME;
+ x_target = ECORE_X_ATOM_FILE_NAME;
else
- x_target = ecore_x_atom_get(target);
+ x_target = ecore_x_atom_get(target);
return x_target;
} /* _ecore_x_selection_target_atom_get */
@@ -317,16 +325,16 @@ _ecore_x_selection_target_get(Ecore_X_Atom target)
{
/* FIXME: Should not return mem allocated with strdup or X mixed,
* one should use free to free, the other XFree */
- if (target == ECORE_X_ATOM_FILE_NAME)
- return strdup(ECORE_X_SELECTION_TARGET_FILENAME);
- else if (target == ECORE_X_ATOM_STRING)
- return strdup(ECORE_X_SELECTION_TARGET_STRING);
- else if (target == ECORE_X_ATOM_UTF8_STRING)
- return strdup(ECORE_X_SELECTION_TARGET_UTF8_STRING);
- else if (target == ECORE_X_ATOM_TEXT)
- return strdup(ECORE_X_SELECTION_TARGET_TEXT);
- else
- return XGetAtomName(_ecore_x_disp, target);
+ if (target == ECORE_X_ATOM_FILE_NAME)
+ return strdup(ECORE_X_SELECTION_TARGET_FILENAME);
+ else if (target == ECORE_X_ATOM_STRING)
+ return strdup(ECORE_X_SELECTION_TARGET_STRING);
+ else if (target == ECORE_X_ATOM_UTF8_STRING)
+ return strdup(ECORE_X_SELECTION_TARGET_UTF8_STRING);
+ else if (target == ECORE_X_ATOM_TEXT)
+ return strdup(ECORE_X_SELECTION_TARGET_TEXT);
+ else
+ return XGetAtomName(_ecore_x_disp, target);
} /* _ecore_x_selection_target_get */
static void
@@ -339,34 +347,37 @@ _ecore_x_selection_request(Ecore_X_Window w,
target = _ecore_x_selection_target_atom_get(target_str);
if (selection == ECORE_X_ATOM_SELECTION_PRIMARY)
- prop = ECORE_X_ATOM_SELECTION_PROP_PRIMARY;
+ prop = ECORE_X_ATOM_SELECTION_PROP_PRIMARY;
else if (selection == ECORE_X_ATOM_SELECTION_SECONDARY)
- prop = ECORE_X_ATOM_SELECTION_PROP_SECONDARY;
+ prop = ECORE_X_ATOM_SELECTION_PROP_SECONDARY;
else if (selection == ECORE_X_ATOM_SELECTION_CLIPBOARD)
- prop = ECORE_X_ATOM_SELECTION_PROP_CLIPBOARD;
+ prop = ECORE_X_ATOM_SELECTION_PROP_CLIPBOARD;
else
- return;
+ return;
XConvertSelection(_ecore_x_disp, selection, target, prop,
w, CurrentTime);
} /* _ecore_x_selection_request */
EAPI void
-ecore_x_selection_primary_request(Ecore_X_Window w, const char *target)
+ecore_x_selection_primary_request(Ecore_X_Window w,
+ const char *target)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
_ecore_x_selection_request(w, ECORE_X_ATOM_SELECTION_PRIMARY, target);
} /* ecore_x_selection_primary_request */
EAPI void
-ecore_x_selection_secondary_request(Ecore_X_Window w, const char *target)
+ecore_x_selection_secondary_request(Ecore_X_Window w,
+ const char *target)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
_ecore_x_selection_request(w, ECORE_X_ATOM_SELECTION_SECONDARY, target);
} /* ecore_x_selection_secondary_request */
EAPI void
-ecore_x_selection_xdnd_request(Ecore_X_Window w, const char *target)
+ecore_x_selection_xdnd_request(Ecore_X_Window w,
+ const char *target)
{
Ecore_X_Atom atom;
Ecore_X_DND_Target *_target;
@@ -380,21 +391,22 @@ ecore_x_selection_xdnd_request(Ecore_X_Window w, const char *target)
} /* ecore_x_selection_xdnd_request */
EAPI void
-ecore_x_selection_clipboard_request(Ecore_X_Window w, const char *target)
+ecore_x_selection_clipboard_request(Ecore_X_Window w,
+ const char *target)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
_ecore_x_selection_request(w, ECORE_X_ATOM_SELECTION_CLIPBOARD, target);
} /* ecore_x_selection_clipboard_request */
EAPI void
-ecore_x_selection_converter_atom_add(Ecore_X_Atom target,
- Eina_Bool (*func)(char *target,
- void *data,
- int size,
- void **data_ret,
- int *size_ret,
- Ecore_X_Atom *ttype,
- int *tsize))
+ecore_x_selection_converter_atom_add(Ecore_X_Atom target,
+ Eina_Bool (*func)(char *target,
+ void *data,
+ int size,
+ void **data_ret,
+ int *size_ret,
+ Ecore_X_Atom *ttype,
+ int *tsize))
{
Ecore_X_Selection_Converter *cnv;
@@ -411,9 +423,9 @@ ecore_x_selection_converter_atom_add(Ecore_X_Atom target,
}
if (cnv->next)
- cnv = cnv->next;
+ cnv = cnv->next;
else
- break;
+ break;
}
cnv->next = calloc(1, sizeof(Ecore_X_Selection_Converter));
@@ -432,19 +444,19 @@ ecore_x_selection_converter_atom_add(Ecore_X_Atom target,
} /* ecore_x_selection_converter_atom_add */
EAPI void
-ecore_x_selection_converter_add(char *target,
- Eina_Bool (*func)(char *target,
- void *data,
- int size,
- void **data_ret,
- int *size_ret,
- Ecore_X_Atom *,
- int *))
+ecore_x_selection_converter_add(char *target,
+ Eina_Bool (*func)(char *target,
+ void *data,
+ int size,
+ void **data_ret,
+ int *size_ret,
+ Ecore_X_Atom *,
+ int *))
{
Ecore_X_Atom x_target;
if (!func || !target)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
x_target = _ecore_x_selection_target_atom_get(target);
@@ -466,7 +478,7 @@ ecore_x_selection_converter_atom_del(Ecore_X_Atom target)
if (cnv->target == target)
{
if (prev_cnv)
- prev_cnv->next = cnv->next;
+ prev_cnv->next = cnv->next;
else
{
converters = cnv->next; /* This was the first converter */
@@ -488,7 +500,7 @@ ecore_x_selection_converter_del(char *target)
Ecore_X_Atom x_target;
if (!target)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
x_target = _ecore_x_selection_target_atom_get(target);
@@ -517,7 +529,7 @@ ecore_x_selection_notify_send(Ecore_X_Window requestor,
xnotify.serial = 0;
xev.xselection = xnotify;
- return ((XSendEvent(_ecore_x_disp, requestor, False, 0, &xev) > 0) ? EINA_TRUE : EINA_FALSE);
+ return (XSendEvent(_ecore_x_disp, requestor, False, 0, &xev) > 0) ? EINA_TRUE : EINA_FALSE;
} /* ecore_x_selection_notify_send */
/* Locate and run conversion callback for specified selection target */
@@ -552,7 +564,7 @@ ecore_x_selection_convert(Ecore_X_Atom selection,
return r;
}
else
- return EINA_FALSE;
+ return EINA_FALSE;
}
}
@@ -584,22 +596,22 @@ _ecore_x_selection_converter_text(char *target,
XICCEncodingStyle style;
if (!data || !size)
- return EINA_FALSE;
+ return EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!strcmp(target, ECORE_X_SELECTION_TARGET_TEXT))
- style = XTextStyle;
+ style = XTextStyle;
else if (!strcmp(target, ECORE_X_SELECTION_TARGET_COMPOUND_TEXT))
- style = XCompoundTextStyle;
+ style = XCompoundTextStyle;
else if (!strcmp(target, ECORE_X_SELECTION_TARGET_STRING))
- style = XStringStyle;
+ style = XStringStyle;
#ifdef X_HAVE_UTF8_STRING
else if (!strcmp(target, ECORE_X_SELECTION_TARGET_UTF8_STRING))
- style = XUTF8StringStyle;
+ style = XUTF8StringStyle;
#endif /* ifdef X_HAVE_UTF8_STRING */
else
- return EINA_FALSE;
+ return EINA_FALSE;
mystr = alloca(size + 1);
memcpy(mystr, data, size);
@@ -650,7 +662,7 @@ ecore_x_selection_parser_add(const char *target,
Ecore_X_Selection_Parser *prs;
if (!target)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
prs = parsers;
@@ -688,7 +700,7 @@ ecore_x_selection_parser_del(const char *target)
Ecore_X_Selection_Parser *prs, *prev_prs;
if (!target)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
prev_prs = NULL;
@@ -699,7 +711,7 @@ ecore_x_selection_parser_del(const char *target)
if (!strcmp(prs->target, target))
{
if (prev_prs)
- prev_prs->next = prs->next;
+ prev_prs->next = prs->next;
else
{
parsers = prs->next; /* This was the first parser */
@@ -723,29 +735,34 @@ ecore_x_selection_parser_del(const char *target)
* @param time Specifies the time
* @since 1.1.0
*/
-EAPI void
-ecore_x_selection_owner_set(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Time tim)
+EAPI void
+ecore_x_selection_owner_set(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Time tim)
{
XSetSelectionOwner(_ecore_x_disp, atom, win, tim);
}
/**
* Return the window that currently owns the specified selection.
- *
+ *
* @param atom The specified selection atom.
- *
+ *
* @return The window that currently owns the specified selection.
* @since 1.1.0
*/
-EAPI Ecore_X_Window
-ecore_x_selection_owner_get(Ecore_X_Atom atom)
+EAPI Ecore_X_Window
+ecore_x_selection_owner_get(Ecore_X_Atom atom)
{
return XGetSelectionOwner(_ecore_x_disp, atom);
}
/* Locate and run conversion callback for specified selection target */
void *
-_ecore_x_selection_parse(const char *target, void *data, int size, int format)
+_ecore_x_selection_parse(const char *target,
+ void *data,
+ int size,
+ int format)
{
Ecore_X_Selection_Parser *prs;
Ecore_X_Selection_Data *sel;
@@ -755,7 +772,7 @@ _ecore_x_selection_parse(const char *target, void *data, int size, int format)
if (!strcmp(prs->target, target))
{
sel = prs->parse(target, data, size, format);
- if (sel) return sel;
+ if (sel) return sel;
}
}
@@ -784,7 +801,7 @@ static void *
_ecore_x_selection_parser_files(const char *target,
void *_data,
int size,
- int format __UNUSED__)
+ int format __UNUSED__)
{
Ecore_X_Selection_Data_Files *sel;
char *t, *data = _data;
@@ -794,7 +811,7 @@ _ecore_x_selection_parser_files(const char *target,
if (strcmp(target, "text/uri-list") &&
strcmp(target, "_NETSCAPE_URL"))
- return NULL;
+ return NULL;
sel = calloc(1, sizeof(Ecore_X_Selection_Data_Files));
if (!sel) return NULL;
@@ -803,15 +820,15 @@ _ecore_x_selection_parser_files(const char *target,
if (data[size - 1])
{
/* Isn't nul terminated */
- size++;
- t = realloc(data, size);
- if (!t)
- {
- free(sel);
- return NULL;
- }
- data = t;
- data[size - 1] = 0;
+ size++;
+ t = realloc(data, size);
+ if (!t)
+ {
+ free(sel);
+ return NULL;
+ }
+ data = t;
+ data[size - 1] = 0;
}
tmp = malloc(size);
@@ -825,12 +842,12 @@ _ecore_x_selection_parser_files(const char *target,
while ((is < size) && (data[is]))
{
if ((i == 0) && (data[is] == '#'))
- for (; ((data[is]) && (data[is] != '\n')); is++) ;
+ for (; ((data[is]) && (data[is] != '\n')); is++) ;
else
{
if ((data[is] != '\r') &&
(data[is] != '\n'))
- tmp[i++] = data[is++];
+ tmp[i++] = data[is++];
else
{
while ((data[is] == '\r') || (data[is] == '\n')) is++;
@@ -878,7 +895,7 @@ _ecore_x_selection_data_files_free(void *data)
if (sel->files)
{
for (i = 0; i < sel->num_files; i++)
- free(sel->files[i]);
+ free(sel->files[i]);
free(sel->files);
}
@@ -888,9 +905,9 @@ _ecore_x_selection_data_files_free(void *data)
static void *
_ecore_x_selection_parser_text(const char *target __UNUSED__,
- void *_data,
- int size,
- int format __UNUSED__)
+ void *_data,
+ int size,
+ int format __UNUSED__)
{
Ecore_X_Selection_Data_Text *sel;
unsigned char *data = _data;
@@ -901,15 +918,15 @@ _ecore_x_selection_parser_text(const char *target __UNUSED__,
if (data[size - 1])
{
/* Isn't nul terminated */
- size++;
- t = realloc(data, size);
- if (!t)
- {
- free(sel);
- return NULL;
- }
- data = t;
- data[size - 1] = 0;
+ size++;
+ t = realloc(data, size);
+ if (!t)
+ {
+ free(sel);
+ return NULL;
+ }
+ data = t;
+ data[size - 1] = 0;
}
sel->text = (char *)data;
@@ -933,9 +950,9 @@ _ecore_x_selection_data_text_free(void *data)
static void *
_ecore_x_selection_parser_targets(const char *target __UNUSED__,
- void *data,
- int size,
- int format __UNUSED__)
+ void *data,
+ int size,
+ int format __UNUSED__)
{
Ecore_X_Selection_Data_Targets *sel;
unsigned long *targets;
@@ -953,7 +970,7 @@ _ecore_x_selection_parser_targets(const char *target __UNUSED__,
return NULL;
}
for (i = 2; i < size; i++)
- sel->targets[i - 2] = XGetAtomName(_ecore_x_disp, targets[i]);
+ sel->targets[i - 2] = XGetAtomName(_ecore_x_disp, targets[i]);
ECORE_X_SELECTION_DATA(sel)->free = _ecore_x_selection_data_targets_free;
ECORE_X_SELECTION_DATA(sel)->content = ECORE_X_SELECTION_CONTENT_TARGETS;
@@ -973,7 +990,7 @@ _ecore_x_selection_data_targets_free(void *data)
if (sel->targets)
{
for (i = 0; i < sel->num_targets; i++)
- XFree(sel->targets[i]);
+ XFree(sel->targets[i]);
free(sel->targets);
}
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_sync.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_sync.c
index bc2bb1feae..e49fede4a6 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_sync.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_sync.c
@@ -27,7 +27,7 @@ ecore_x_sync_alarm_new(Ecore_X_Sync_Counter counter)
XSyncIntToValue(&values.trigger.wait_value, 1);
values.trigger.test_type = XSyncPositiveComparison;
- XSyncIntToValue(&values.delta, 1);
+ XSyncIntToValue(&values.delta, 1);
values.events = True;
@@ -52,7 +52,8 @@ ecore_x_sync_alarm_free(Ecore_X_Sync_Alarm alarm)
} /* ecore_x_sync_alarm_free */
EAPI Eina_Bool
-ecore_x_sync_counter_query(Ecore_X_Sync_Counter counter, unsigned int *val)
+ecore_x_sync_counter_query(Ecore_X_Sync_Counter counter,
+ unsigned int *val)
{
XSyncValue value;
@@ -86,7 +87,8 @@ ecore_x_sync_counter_free(Ecore_X_Sync_Counter counter)
} /* ecore_x_sync_counter_free */
EAPI void
-ecore_x_sync_counter_inc(Ecore_X_Sync_Counter counter, int by)
+ecore_x_sync_counter_inc(Ecore_X_Sync_Counter counter,
+ int by)
{
XSyncValue v;
@@ -96,14 +98,15 @@ ecore_x_sync_counter_inc(Ecore_X_Sync_Counter counter, int by)
} /* ecore_x_sync_counter_inc */
EAPI void
-ecore_x_sync_counter_val_wait(Ecore_X_Sync_Counter counter, int val)
+ecore_x_sync_counter_val_wait(Ecore_X_Sync_Counter counter,
+ int val)
{
XSyncWaitCondition cond;
XSyncValue v, v2;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XSyncQueryCounter(_ecore_x_disp, counter, &v);
- XSyncIntToValue(&v, val);
+ XSyncIntToValue(&v, val);
XSyncIntToValue(&v2, val + 1);
cond.trigger.counter = counter;
cond.trigger.value_type = XSyncAbsolute;
@@ -115,7 +118,8 @@ ecore_x_sync_counter_val_wait(Ecore_X_Sync_Counter counter, int val)
} /* ecore_x_sync_counter_val_wait */
EAPI void
-ecore_x_sync_counter_set(Ecore_X_Sync_Counter counter, int val)
+ecore_x_sync_counter_set(Ecore_X_Sync_Counter counter,
+ int val)
{
XSyncValue v;
@@ -125,7 +129,9 @@ ecore_x_sync_counter_set(Ecore_X_Sync_Counter counter, int val)
}
EAPI void
-ecore_x_sync_counter_2_set(Ecore_X_Sync_Counter counter, int val_hi, unsigned int val_lo)
+ecore_x_sync_counter_2_set(Ecore_X_Sync_Counter counter,
+ int val_hi,
+ unsigned int val_lo)
{
XSyncValue v;
@@ -135,7 +141,9 @@ ecore_x_sync_counter_2_set(Ecore_X_Sync_Counter counter, int val_hi, unsigned in
}
EAPI Eina_Bool
-ecore_x_sync_counter_2_query(Ecore_X_Sync_Counter counter, int *val_hi, unsigned int *val_lo)
+ecore_x_sync_counter_2_query(Ecore_X_Sync_Counter counter,
+ int *val_hi,
+ unsigned int *val_lo)
{
XSyncValue value;
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_test.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_test.c
index da64bb7055..c4576f9f7a 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_test.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_test.c
@@ -25,18 +25,18 @@ ecore_x_test_fake_key_down(const char *key __UNUSED__)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!strncmp(key, "Keycode-", 8))
- keycode = atoi(key + 8);
+ keycode = atoi(key + 8);
else
{
keysym = XStringToKeysym(key);
if (keysym == NoSymbol)
- return EINA_FALSE;
+ return EINA_FALSE;
keycode = XKeysymToKeycode(_ecore_x_disp, keysym);
}
if (keycode == 0)
- return EINA_FALSE;
+ return EINA_FALSE;
return XTestFakeKeyEvent(_ecore_x_disp, keycode, 1, 0) ? EINA_TRUE : EINA_FALSE;
#else /* ifdef ECORE_XTEST */
@@ -57,18 +57,18 @@ ecore_x_test_fake_key_up(const char *key __UNUSED__)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!strncmp(key, "Keycode-", 8))
- keycode = atoi(key + 8);
+ keycode = atoi(key + 8);
else
{
keysym = XStringToKeysym(key);
if (keysym == NoSymbol)
- return EINA_FALSE;
+ return EINA_FALSE;
keycode = XKeysymToKeycode(_ecore_x_disp, keysym);
}
if (keycode == 0)
- return EINA_FALSE;
+ return EINA_FALSE;
return XTestFakeKeyEvent(_ecore_x_disp, keycode, 0, 0) ? EINA_TRUE : EINA_FALSE;
#else /* ifdef ECORE_XTEST */
@@ -90,23 +90,23 @@ ecore_x_test_fake_key_press(const char *key __UNUSED__)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!strncmp(key, "Keycode-", 8))
- keycode = atoi(key + 8);
+ keycode = atoi(key + 8);
else
{
keysym = XStringToKeysym(key);
if (keysym == NoSymbol)
- return EINA_FALSE;
+ return EINA_FALSE;
keycode = XKeysymToKeycode(_ecore_x_disp, keysym);
if (XKeycodeToKeysym(_ecore_x_disp, keycode, 0) != keysym)
{
if (XKeycodeToKeysym(_ecore_x_disp, keycode, 1) == keysym)
- shift = 1;
+ shift = 1;
else
- keycode = 0;
+ keycode = 0;
}
else
- shift = 0;
+ shift = 0;
}
if (keycode == 0)
@@ -132,14 +132,14 @@ ecore_x_test_fake_key_press(const char *key __UNUSED__)
}
if (shift)
- XTestFakeKeyEvent(_ecore_x_disp,
- XKeysymToKeycode(_ecore_x_disp, XK_Shift_L), 1, 0);
+ XTestFakeKeyEvent(_ecore_x_disp,
+ XKeysymToKeycode(_ecore_x_disp, XK_Shift_L), 1, 0);
XTestFakeKeyEvent(_ecore_x_disp, keycode, 1, 0);
XTestFakeKeyEvent(_ecore_x_disp, keycode, 0, 0);
if (shift)
- XTestFakeKeyEvent(_ecore_x_disp,
- XKeysymToKeycode(_ecore_x_disp, XK_Shift_L), 0, 0);
+ XTestFakeKeyEvent(_ecore_x_disp,
+ XKeysymToKeycode(_ecore_x_disp, XK_Shift_L), 0, 0);
return EINA_TRUE;
#else /* ifdef ECORE_XTEST */
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_vsync.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_vsync.c
index 53a9fb8bf2..f05429885b 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_vsync.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_vsync.c
@@ -25,13 +25,13 @@ typedef unsigned int drm_magic_t;
typedef enum
{
- DRM_VBLANK_ABSOLUTE = 0x00000000,
- DRM_VBLANK_RELATIVE = 0x00000001,
- DRM_VBLANK_EVENT = 0x04000000,
- DRM_VBLANK_FLIP = 0x08000000,
- DRM_VBLANK_NEXTONMISS = 0x10000000,
- DRM_VBLANK_SECONDARY = 0x20000000,
- DRM_VBLANK_SIGNAL = 0x40000000
+ DRM_VBLANK_ABSOLUTE = 0x00000000,
+ DRM_VBLANK_RELATIVE = 0x00000001,
+ DRM_VBLANK_EVENT = 0x04000000,
+ DRM_VBLANK_FLIP = 0x08000000,
+ DRM_VBLANK_NEXTONMISS = 0x10000000,
+ DRM_VBLANK_SECONDARY = 0x20000000,
+ DRM_VBLANK_SIGNAL = 0x40000000
}
drmVBlankSeqType;
@@ -61,48 +61,67 @@ typedef union _drmVBlank
typedef struct _drmEventContext
{
int version;
- void (*vblank_handler)(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, void *user_data);
- void (*page_flip_handler)(int fd, unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec, void *user_data);
+ void (*vblank_handler)(int fd,
+ unsigned int sequence,
+ unsigned int tv_sec,
+ unsigned int tv_usec,
+ void *user_data);
+ void (*page_flip_handler)(int fd,
+ unsigned int sequence,
+ unsigned int tv_sec,
+ unsigned int tv_usec,
+ void *user_data);
} drmEventContext;
-static int (*sym_drmClose) (int fd) = NULL;
-static int (*sym_drmGetMagic) (int fd, drm_magic_t * magic) = NULL;
-static int (*sym_drmWaitVBlank) (int fd, drmVBlank *vbl) = NULL;
-static int (*sym_drmHandleEvent) (int fd, drmEventContext *evctx) = NULL;
+static int (*sym_drmClose)(int fd) = NULL;
+static int (*sym_drmGetMagic)(int fd,
+ drm_magic_t *magic) = NULL;
+static int (*sym_drmWaitVBlank)(int fd,
+ drmVBlank *vbl) = NULL;
+static int (*sym_drmHandleEvent)(int fd,
+ drmEventContext *evctx) = NULL;
//// dri
-static Bool (*sym_DRI2QueryExtension) (Display *display, int *eventBase, int *errorBase) = NULL;
-static Bool (*sym_DRI2QueryVersion) (Display *display, int *major, int *minor) = NULL;
-static Bool (*sym_DRI2Connect) (Display *display, XID window, char **driverName, char **deviceName) = NULL;
-static Bool (*sym_DRI2Authenticate) (Display *display, XID window, drm_magic_t magic) = NULL;
-
+static Bool (*sym_DRI2QueryExtension)(Display *display,
+ int *eventBase,
+ int *errorBase) = NULL;
+static Bool (*sym_DRI2QueryVersion)(Display *display,
+ int *major,
+ int *minor) = NULL;
+static Bool (*sym_DRI2Connect)(Display *display,
+ XID window,
+ char **driverName,
+ char **deviceName) = NULL;
+static Bool (*sym_DRI2Authenticate)(Display *display,
+ XID window,
+ drm_magic_t magic) = NULL;
//// dri/drm data needed
-static int dri2_event = 0;
-static int dri2_error = 0;
-static int dri2_major = 0;
-static int dri2_minor = 0;
-static char *device_name = 0;
-static char *driver_name = 0;
-static drm_magic_t drm_magic;
-
-static int drm_fd = -1;
-static int drm_event_is_busy = 0;
-static int drm_animators_interval = 1;
-static drmEventContext drm_evctx;
+static int dri2_event = 0;
+static int dri2_error = 0;
+static int dri2_major = 0;
+static int dri2_minor = 0;
+static char *device_name = 0;
+static char *driver_name = 0;
+static drm_magic_t drm_magic;
+
+static int drm_fd = -1;
+static int drm_event_is_busy = 0;
+static int drm_animators_interval = 1;
+static drmEventContext drm_evctx;
static Ecore_Fd_Handler *dri_drm_fdh = NULL;
-static void *dri_lib = NULL;
-static void *drm_lib = NULL;
+static void *dri_lib = NULL;
+static void *drm_lib = NULL;
-static Window dri_drm_vsync_root = 0;
+static Window dri_drm_vsync_root = 0;
static void
_dri_drm_tick_schedule(void)
{
drmVBlank vbl;
-
+
vbl.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT;
vbl.request.sequence = drm_animators_interval;
vbl.request.signal = 0;
@@ -123,16 +142,19 @@ _dri_drm_tick_end(void *data __UNUSED__)
}
static void
-_dri_drm_vblank_handler(int fd __UNUSED__, unsigned int frame __UNUSED__,
- unsigned int sec __UNUSED__,
- unsigned int usec __UNUSED__, void *data __UNUSED__)
+_dri_drm_vblank_handler(int fd __UNUSED__,
+ unsigned int frame __UNUSED__,
+ unsigned int sec __UNUSED__,
+ unsigned int usec __UNUSED__,
+ void *data __UNUSED__)
{
ecore_animator_custom_tick();
if (drm_event_is_busy) _dri_drm_tick_schedule();
}
static Eina_Bool
-_dri_drm_cb(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UNUSED__)
+_dri_drm_cb(void *data __UNUSED__,
+ Ecore_Fd_Handler *fd_handler __UNUSED__)
{
sym_drmHandleEvent(drm_fd, &drm_evctx);
return ECORE_CALLBACK_RENEW;
@@ -146,36 +168,36 @@ static int
_dri_drm_link(void)
{
const char *drm_libs[] =
- {
- "libdrm.so.2",
- "libdrm.so.1",
- "libdrm.so.0",
- "libdrm.so",
- NULL,
- };
+ {
+ "libdrm.so.2",
+ "libdrm.so.1",
+ "libdrm.so.0",
+ "libdrm.so",
+ NULL,
+ };
const char *dri_libs[] =
- {
- "libdri2.so.2",
- "libdri2.so.1",
- "libdri2.so.0",
- "libdri2.so",
- "libGL.so.4",
- "libGL.so.3",
- "libGL.so.2",
- "libGL.so.1",
- "libGL.so.0",
- "libGL.so",
- NULL,
- };
+ {
+ "libdri2.so.2",
+ "libdri2.so.1",
+ "libdri2.so.0",
+ "libdri2.so",
+ "libGL.so.4",
+ "libGL.so.3",
+ "libGL.so.2",
+ "libGL.so.1",
+ "libGL.so.0",
+ "libGL.so",
+ NULL,
+ };
int i, fail;
-#define SYM(lib, xx) \
- do { \
- sym_ ## xx = dlsym(lib, #xx); \
- if (!(sym_ ## xx)) { \
- fprintf(stderr, "%s\n", dlerror()); \
- fail = 1; \
- } \
- } while (0)
+#define SYM(lib, xx) \
+ do { \
+ sym_ ## xx = dlsym(lib, #xx); \
+ if (!(sym_ ## xx)) { \
+ fprintf(stderr, "%s\n", dlerror()); \
+ fail = 1; \
+ } \
+ } while (0)
if (dri_lib) return 1;
for (i = 0; drm_libs[i]; i++)
@@ -227,16 +249,16 @@ static int
_dri_drm_init(void)
{
if (!sym_DRI2QueryExtension(_ecore_x_disp, &dri2_event, &dri2_error))
- return 0;
+ return 0;
if (!sym_DRI2QueryVersion(_ecore_x_disp, &dri2_major, &dri2_minor))
- return 0;
+ return 0;
if (dri2_major < 2)
- return 0;
+ return 0;
if (!sym_DRI2Connect(_ecore_x_disp, dri_drm_vsync_root, &driver_name, &device_name))
- return 0;
+ return 0;
drm_fd = open(device_name, O_RDWR);
if (drm_fd < 0)
- return 0;
+ return 0;
sym_drmGetMagic(drm_fd, &drm_magic);
if (!sym_DRI2Authenticate(_ecore_x_disp, dri_drm_vsync_root, drm_magic))
{
@@ -248,8 +270,8 @@ _dri_drm_init(void)
drm_evctx.version = DRM_EVENT_CONTEXT_VERSION;
drm_evctx.vblank_handler = _dri_drm_vblank_handler;
drm_evctx.page_flip_handler = NULL;
-
- dri_drm_fdh = ecore_main_fd_handler_add(drm_fd, ECORE_FD_READ,
+
+ dri_drm_fdh = ecore_main_fd_handler_add(drm_fd, ECORE_FD_READ,
_dri_drm_cb, NULL, NULL, NULL);
if (!dri_drm_fdh)
{
@@ -274,6 +296,7 @@ _dri_drm_shutdown(void)
dri_drm_fdh = NULL;
}
}
+
#endif
EAPI Eina_Bool
@@ -281,7 +304,7 @@ ecore_x_vsync_animator_tick_source_set(Ecore_X_Window win)
{
#ifdef ECORE_X_VSYNC_DRI2
Ecore_X_Window root;
-
+
root = ecore_x_window_root_get(win);
if (root != dri_drm_vsync_root)
{
@@ -301,9 +324,9 @@ ecore_x_vsync_animator_tick_source_set(Ecore_X_Window win)
return EINA_FALSE;
}
ecore_animator_custom_source_tick_begin_callback_set
- (_dri_drm_tick_begin, NULL);
+ (_dri_drm_tick_begin, NULL);
ecore_animator_custom_source_tick_end_callback_set
- (_dri_drm_tick_end, NULL);
+ (_dri_drm_tick_end, NULL);
ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_CUSTOM);
}
else
@@ -312,9 +335,9 @@ ecore_x_vsync_animator_tick_source_set(Ecore_X_Window win)
{
_dri_drm_shutdown();
ecore_animator_custom_source_tick_begin_callback_set
- (NULL, NULL);
+ (NULL, NULL);
ecore_animator_custom_source_tick_end_callback_set
- (NULL, NULL);
+ (NULL, NULL);
ecore_animator_source_set(ECORE_ANIMATOR_SOURCE_TIMER);
}
}
@@ -323,5 +346,6 @@ ecore_x_vsync_animator_tick_source_set(Ecore_X_Window win)
#else
return EINA_FALSE;
win = 0;
-#endif
+#endif
}
+
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window.c
index 26088076df..76670d3290 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window.c
@@ -32,14 +32,18 @@ static Ecore_X_Window *ignore_list = NULL;
* @ingroup Ecore_X_Window_Create_Group
*/
EAPI Ecore_X_Window
-ecore_x_window_new(Ecore_X_Window parent, int x, int y, int w, int h)
+ecore_x_window_new(Ecore_X_Window parent,
+ int x,
+ int y,
+ int w,
+ int h)
{
Window win;
XSetWindowAttributes attr;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (parent == 0)
- parent = DefaultRootWindow(_ecore_x_disp);
+ parent = DefaultRootWindow(_ecore_x_disp);
attr.backing_store = NotUseful;
attr.override_redirect = False;
@@ -50,18 +54,18 @@ ecore_x_window_new(Ecore_X_Window parent, int x, int y, int w, int h)
attr.save_under = False;
attr.do_not_propagate_mask = NoEventMask;
attr.event_mask = KeyPressMask |
- KeyReleaseMask |
- ButtonPressMask |
- ButtonReleaseMask |
- EnterWindowMask |
- LeaveWindowMask |
- PointerMotionMask |
- ExposureMask |
- VisibilityChangeMask |
- StructureNotifyMask |
- FocusChangeMask |
- PropertyChangeMask |
- ColormapChangeMask;
+ KeyReleaseMask |
+ ButtonPressMask |
+ ButtonReleaseMask |
+ EnterWindowMask |
+ LeaveWindowMask |
+ PointerMotionMask |
+ ExposureMask |
+ VisibilityChangeMask |
+ StructureNotifyMask |
+ FocusChangeMask |
+ PropertyChangeMask |
+ ColormapChangeMask;
win = XCreateWindow(_ecore_x_disp, parent,
x, y, w, h, 0,
CopyFromParent, /*DefaultDepth(_ecore_x_disp, DefaultScreen(_ecore_x_disp)),*/
@@ -80,7 +84,7 @@ ecore_x_window_new(Ecore_X_Window parent, int x, int y, int w, int h)
&attr);
if (parent == DefaultRootWindow(_ecore_x_disp))
- ecore_x_window_defaults_set(win);
+ ecore_x_window_defaults_set(win);
return win;
} /* ecore_x_window_new */
@@ -97,14 +101,18 @@ ecore_x_window_new(Ecore_X_Window parent, int x, int y, int w, int h)
* @ingroup Ecore_X_Window_Create_Group
*/
EAPI Ecore_X_Window
-ecore_x_window_override_new(Ecore_X_Window parent, int x, int y, int w, int h)
+ecore_x_window_override_new(Ecore_X_Window parent,
+ int x,
+ int y,
+ int w,
+ int h)
{
Window win;
XSetWindowAttributes attr;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (parent == 0)
- parent = DefaultRootWindow(_ecore_x_disp);
+ parent = DefaultRootWindow(_ecore_x_disp);
attr.backing_store = NotUseful;
attr.override_redirect = True;
@@ -115,18 +123,18 @@ ecore_x_window_override_new(Ecore_X_Window parent, int x, int y, int w, int h)
attr.save_under = False;
attr.do_not_propagate_mask = NoEventMask;
attr.event_mask = KeyPressMask |
- KeyReleaseMask |
- ButtonPressMask |
- ButtonReleaseMask |
- EnterWindowMask |
- LeaveWindowMask |
- PointerMotionMask |
- ExposureMask |
- VisibilityChangeMask |
- StructureNotifyMask |
- FocusChangeMask |
- PropertyChangeMask |
- ColormapChangeMask;
+ KeyReleaseMask |
+ ButtonPressMask |
+ ButtonReleaseMask |
+ EnterWindowMask |
+ LeaveWindowMask |
+ PointerMotionMask |
+ ExposureMask |
+ VisibilityChangeMask |
+ StructureNotifyMask |
+ FocusChangeMask |
+ PropertyChangeMask |
+ ColormapChangeMask;
win = XCreateWindow(_ecore_x_disp, parent,
x, y, w, h, 0,
CopyFromParent, /*DefaultDepth(_ecore_x_disp, DefaultScreen(_ecore_x_disp)),*/
@@ -158,30 +166,34 @@ ecore_x_window_override_new(Ecore_X_Window parent, int x, int y, int w, int h)
* @ingroup Ecore_X_Window_Create_Group
*/
EAPI Ecore_X_Window
-ecore_x_window_input_new(Ecore_X_Window parent, int x, int y, int w, int h)
+ecore_x_window_input_new(Ecore_X_Window parent,
+ int x,
+ int y,
+ int w,
+ int h)
{
Window win;
XSetWindowAttributes attr;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (parent == 0)
- parent = DefaultRootWindow(_ecore_x_disp);
+ parent = DefaultRootWindow(_ecore_x_disp);
attr.override_redirect = True;
attr.do_not_propagate_mask = NoEventMask;
attr.event_mask = KeyPressMask |
- KeyReleaseMask |
- ButtonPressMask |
- ButtonReleaseMask |
- EnterWindowMask |
- LeaveWindowMask |
- PointerMotionMask |
- ExposureMask |
- VisibilityChangeMask |
- StructureNotifyMask |
- FocusChangeMask |
- PropertyChangeMask |
- ColormapChangeMask;
+ KeyReleaseMask |
+ ButtonPressMask |
+ ButtonReleaseMask |
+ EnterWindowMask |
+ LeaveWindowMask |
+ PointerMotionMask |
+ ExposureMask |
+ VisibilityChangeMask |
+ StructureNotifyMask |
+ FocusChangeMask |
+ PropertyChangeMask |
+ ColormapChangeMask;
win = XCreateWindow(_ecore_x_disp, parent,
x, y, w, h, 0,
CopyFromParent,
@@ -254,16 +266,20 @@ ecore_x_window_defaults_set(Ecore_X_Window win)
} /* ecore_x_window_defaults_set */
EAPI void
-ecore_x_window_configure(Ecore_X_Window win,
+ecore_x_window_configure(Ecore_X_Window win,
Ecore_X_Window_Configure_Mask mask,
- int x, int y, int w, int h,
- int border_width, Ecore_X_Window sibling,
- int stack_mode)
+ int x,
+ int y,
+ int w,
+ int h,
+ int border_width,
+ Ecore_X_Window sibling,
+ int stack_mode)
{
XWindowChanges xwc;
if (!win)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -295,9 +311,9 @@ ecore_x_window_free(Ecore_X_Window win)
/* sorry sir, deleting the root window doesn't sound like
* a smart idea.
*/
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (win)
- XDestroyWindow(_ecore_x_disp, win);
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (win)
+ XDestroyWindow(_ecore_x_disp, win);
} /* ecore_x_window_free */
/**
@@ -306,7 +322,8 @@ ecore_x_window_free(Ecore_X_Window win)
* @param ignore if to ignore
*/
EAPI void
-ecore_x_window_ignore_set(Ecore_X_Window win, int ignore)
+ecore_x_window_ignore_set(Ecore_X_Window win,
+ int ignore)
{
int i, j, cnt;
Ecore_X_Window *t;
@@ -319,7 +336,7 @@ ecore_x_window_ignore_set(Ecore_X_Window win, int ignore)
for (i = 0; i < ignore_num; i++)
{
if (win == ignore_list[i])
- return;
+ return;
}
t = realloc(ignore_list, (ignore_num + 1) * sizeof(Ecore_X_Window));
if (!t) return;
@@ -331,20 +348,20 @@ ecore_x_window_ignore_set(Ecore_X_Window win, int ignore)
ignore_num = 0;
ignore_list = malloc(sizeof(Ecore_X_Window));
if (ignore_list)
- ignore_list[ignore_num++] = win;
+ ignore_list[ignore_num++] = win;
}
}
else
{
if (!ignore_list)
- return;
+ return;
for (cnt = ignore_num, i = 0, j = 0; i < cnt; i++)
{
if (win != ignore_list[i])
- ignore_list[j++] = ignore_list[i];
+ ignore_list[j++] = ignore_list[i];
else
- ignore_num--;
+ ignore_num--;
}
if (ignore_num <= 0)
@@ -367,7 +384,7 @@ EAPI Ecore_X_Window *
ecore_x_window_ignore_list(int *num)
{
if (num)
- *num = ignore_num;
+ *num = ignore_num;
return ignore_list;
} /* ecore_x_window_ignore_list */
@@ -386,7 +403,7 @@ ecore_x_window_delete_request_send(Ecore_X_Window win)
* a smart idea.
*/
if (!win)
- return;
+ return;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
xev.xclient.type = ClientMessage;
@@ -441,17 +458,17 @@ ecore_x_window_hide(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
root = win;
if (ScreenCount(_ecore_x_disp) == 1)
- root = DefaultRootWindow(_ecore_x_disp);
+ root = DefaultRootWindow(_ecore_x_disp);
else
- XGetGeometry(_ecore_x_disp,
- win,
- &root,
- &idum,
- &idum,
- &uidum,
- &uidum,
- &uidum,
- &uidum);
+ XGetGeometry(_ecore_x_disp,
+ win,
+ &root,
+ &idum,
+ &idum,
+ &uidum,
+ &uidum,
+ &uidum,
+ &uidum);
xev.xunmap.type = UnmapNotify;
xev.xunmap.serial = 0;
@@ -483,7 +500,9 @@ ecore_x_window_hide(Ecore_X_Window win)
* @ingroup Ecore_X_Window_Geometry_Group
*/
EAPI void
-ecore_x_window_move(Ecore_X_Window win, int x, int y)
+ecore_x_window_move(Ecore_X_Window win,
+ int x,
+ int y)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XMoveWindow(_ecore_x_disp, win, x, y);
@@ -497,14 +516,16 @@ ecore_x_window_move(Ecore_X_Window win, int x, int y)
* @ingroup Ecore_X_Window_Geometry_Group
*/
EAPI void
-ecore_x_window_resize(Ecore_X_Window win, int w, int h)
+ecore_x_window_resize(Ecore_X_Window win,
+ int w,
+ int h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (w < 1)
- w = 1;
+ w = 1;
if (h < 1)
- h = 1;
+ h = 1;
XResizeWindow(_ecore_x_disp, win, w, h);
} /* ecore_x_window_resize */
@@ -519,14 +540,18 @@ ecore_x_window_resize(Ecore_X_Window win, int w, int h)
* @ingroup Ecore_X_Window_Geometry_Group
*/
EAPI void
-ecore_x_window_move_resize(Ecore_X_Window win, int x, int y, int w, int h)
+ecore_x_window_move_resize(Ecore_X_Window win,
+ int x,
+ int y,
+ int w,
+ int h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (w < 1)
- w = 1;
+ w = 1;
if (h < 1)
- h = 1;
+ h = 1;
XMoveResizeWindow(_ecore_x_disp, win, x, y, w, h);
} /* ecore_x_window_move_resize */
@@ -547,7 +572,7 @@ ecore_x_window_focus(Ecore_X_Window win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (win == 0)
- win = DefaultRootWindow(_ecore_x_disp); // XSetInputFocus(_ecore_x_disp, win, RevertToNone, CurrentTime);
+ win = DefaultRootWindow(_ecore_x_disp); // XSetInputFocus(_ecore_x_disp, win, RevertToNone, CurrentTime);
// XSetInputFocus(_ecore_x_disp, win, RevertToPointerRoot, CurrentTime);
XSetInputFocus(_ecore_x_disp, win, RevertToParent, CurrentTime);
@@ -560,11 +585,12 @@ ecore_x_window_focus(Ecore_X_Window win)
* @ingroup Ecore_X_Window_Focus_Functions
*/
EAPI void
-ecore_x_window_focus_at_time(Ecore_X_Window win, Ecore_X_Time t)
+ecore_x_window_focus_at_time(Ecore_X_Window win,
+ Ecore_X_Time t)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (win == 0)
- win = DefaultRootWindow(_ecore_x_disp); // XSetInputFocus(_ecore_x_disp, win, RevertToNone, t);
+ win = DefaultRootWindow(_ecore_x_disp); // XSetInputFocus(_ecore_x_disp, win, RevertToNone, t);
// XSetInputFocus(_ecore_x_disp, win, PointerRoot, t);
XSetInputFocus(_ecore_x_disp, win, RevertToParent, t);
@@ -639,7 +665,7 @@ ecore_x_window_reparent(Ecore_X_Window win,
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (new_parent == 0)
- new_parent = DefaultRootWindow(_ecore_x_disp);
+ new_parent = DefaultRootWindow(_ecore_x_disp);
XReparentWindow(_ecore_x_disp, win, new_parent, x, y);
} /* ecore_x_window_reparent */
@@ -652,13 +678,15 @@ ecore_x_window_reparent(Ecore_X_Window win,
* @ingroup Ecore_X_Window_Geometry_Group
*/
EAPI void
-ecore_x_window_size_get(Ecore_X_Window win, int *w, int *h)
+ecore_x_window_size_get(Ecore_X_Window win,
+ int *w,
+ int *h)
{
int dummy_x, dummy_y;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (win == 0)
- win = DefaultRootWindow(_ecore_x_disp);
+ win = DefaultRootWindow(_ecore_x_disp);
ecore_x_drawable_geometry_get(win, &dummy_x, &dummy_y, w, h);
} /* ecore_x_window_size_get */
@@ -680,11 +708,15 @@ ecore_x_window_size_get(Ecore_X_Window win, int *w, int *h)
* @ingroup Ecore_X_Window_Geometry_Group
*/
EAPI void
-ecore_x_window_geometry_get(Ecore_X_Window win, int *x, int *y, int *w, int *h)
+ecore_x_window_geometry_get(Ecore_X_Window win,
+ int *x,
+ int *y,
+ int *w,
+ int *h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win)
- win = DefaultRootWindow(_ecore_x_disp);
+ win = DefaultRootWindow(_ecore_x_disp);
ecore_x_drawable_geometry_get(win, x, y, w, h);
} /* ecore_x_window_geometry_get */
@@ -701,7 +733,7 @@ ecore_x_window_border_width_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
/* doesn't make sense to call this on a root window */
if (!win)
- return 0;
+ return 0;
return ecore_x_drawable_border_width_get(win);
} /* ecore_x_window_border_width_get */
@@ -713,12 +745,13 @@ ecore_x_window_border_width_get(Ecore_X_Window win)
* @ingroup Ecore_X_Window_Geometry_Group
*/
EAPI void
-ecore_x_window_border_width_set(Ecore_X_Window win, int width)
+ecore_x_window_border_width_set(Ecore_X_Window win,
+ int width)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
/* doesn't make sense to call this on a root window */
if (!win)
- return;
+ return;
XSetWindowBorderWidth (_ecore_x_disp, win, width);
} /* ecore_x_window_border_width_set */
@@ -741,11 +774,12 @@ ecore_x_window_depth_get(Ecore_X_Window win)
* FIXME: To be fixed.
*/
EAPI void
-ecore_x_window_cursor_show(Ecore_X_Window win, Eina_Bool show)
+ecore_x_window_cursor_show(Ecore_X_Window win,
+ Eina_Bool show)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (win == 0)
- win = DefaultRootWindow(_ecore_x_disp);
+ win = DefaultRootWindow(_ecore_x_disp);
if (!show)
{
@@ -768,17 +802,18 @@ ecore_x_window_cursor_show(Ecore_X_Window win, Eina_Bool show)
XFreePixmap(_ecore_x_disp, m);
}
else
- XDefineCursor(_ecore_x_disp, win, 0);
+ XDefineCursor(_ecore_x_disp, win, 0);
} /* ecore_x_window_cursor_show */
EAPI void
-ecore_x_window_cursor_set(Ecore_X_Window win, Ecore_X_Cursor c)
+ecore_x_window_cursor_set(Ecore_X_Window win,
+ Ecore_X_Cursor c)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (c == 0)
- XUndefineCursor(_ecore_x_disp, win);
+ XUndefineCursor(_ecore_x_disp, win);
else
- XDefineCursor(_ecore_x_disp, win, c);
+ XDefineCursor(_ecore_x_disp, win, c);
} /* ecore_x_window_cursor_set */
/**
@@ -793,11 +828,11 @@ ecore_x_window_visible_get(Ecore_X_Window win)
XWindowAttributes attr;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- return (XGetWindowAttributes(_ecore_x_disp, win, &attr) &&
- (attr.map_state == IsViewable));
+ return XGetWindowAttributes(_ecore_x_disp, win, &attr) &&
+ (attr.map_state == IsViewable);
} /* ecore_x_window_visible_get */
-typedef struct _Shadow Shadow;
+typedef struct _Shadow Shadow;
struct _Shadow
{
Shadow *parent;
@@ -821,14 +856,14 @@ _ecore_x_window_tree_walk(Window win)
XWindowAttributes att;
if (!XGetWindowAttributes(_ecore_x_disp, win, &att))
- return NULL; // if (att.class == InputOnly) return NULL;
+ return NULL; // if (att.class == InputOnly) return NULL;
if (att.map_state != IsViewable)
- return NULL;
+ return NULL;
s = calloc(1, sizeof(Shadow));
if (!s)
- return NULL;
+ return NULL;
s->win = win;
s->x = att.x;
@@ -847,7 +882,7 @@ _ecore_x_window_tree_walk(Window win)
{
s->children[i] = _ecore_x_window_tree_walk(list[i]);
if (s->children[i])
- s->children[i]->parent = s;
+ s->children[i]->parent = s;
}
/* compress list down */
j = 0;
@@ -870,13 +905,13 @@ _ecore_x_window_tree_walk(Window win)
s->children_num = j;
sl = realloc(s->children, sizeof(Shadow *) * j);
if (sl)
- s->children = sl;
+ s->children = sl;
}
}
}
if (list)
- XFree(list);
+ XFree(list);
return s;
} /* _ecore_x_window_tree_walk */
@@ -887,14 +922,14 @@ _ecore_x_window_tree_shadow_free1(Shadow *s)
int i;
if (!s)
- return;
+ return;
if (s->children)
{
for (i = 0; i < s->children_num; i++)
{
if (s->children[i])
- _ecore_x_window_tree_shadow_free1(s->children[i]);
+ _ecore_x_window_tree_shadow_free1(s->children[i]);
}
free(s->children);
}
@@ -908,12 +943,12 @@ _ecore_x_window_tree_shadow_free(void)
int i;
if (!shadow_base)
- return;
+ return;
for (i = 0; i < shadow_num; i++)
{
if (!shadow_base[i])
- continue;
+ continue;
_ecore_x_window_tree_shadow_free1(shadow_base[i]);
}
@@ -936,7 +971,7 @@ _ecore_x_window_tree_shadow_populate(void)
{
shadow_num = num;
for (i = 0; i < num; i++)
- shadow_base[i] = _ecore_x_window_tree_walk(roots[i]);
+ shadow_base[i] = _ecore_x_window_tree_walk(roots[i]);
}
free(roots);
@@ -964,24 +999,25 @@ _ecore_x_window_tree_shadow_populate(void)
*/
static Shadow *
-_ecore_x_window_shadow_tree_find_shadow(Shadow *s, Window win)
+_ecore_x_window_shadow_tree_find_shadow(Shadow *s,
+ Window win)
{
Shadow *ss;
int i;
if (s->win == win)
- return s;
+ return s;
if (s->children)
- for (i = 0; i < s->children_num; i++)
- {
- if (!s->children[i])
- continue;
+ for (i = 0; i < s->children_num; i++)
+ {
+ if (!s->children[i])
+ continue;
- if ((ss =
- _ecore_x_window_shadow_tree_find_shadow(s->children[i], win)))
- return ss;
- }
+ if ((ss =
+ _ecore_x_window_shadow_tree_find_shadow(s->children[i], win)))
+ return ss;
+ }
return NULL;
} /* _ecore_x_window_shadow_tree_find_shadow */
@@ -995,26 +1031,32 @@ _ecore_x_window_shadow_tree_find(Window base)
for (i = 0; i < shadow_num; i++)
{
if (!shadow_base[i])
- continue;
+ continue;
if ((s = _ecore_x_window_shadow_tree_find_shadow(shadow_base[i], base)))
- return s;
+ return s;
}
return NULL;
} /* _ecore_x_window_shadow_tree_find */
static int
-_inside_rects(Shadow *s, int x, int y, int bx, int by, Ecore_X_Rectangle *rects, int num)
+_inside_rects(Shadow *s,
+ int x,
+ int y,
+ int bx,
+ int by,
+ Ecore_X_Rectangle *rects,
+ int num)
{
int i, inside;
-
+
if (!rects) return 0;
inside = 0;
for (i = 0; i < num; i++)
{
- if ((x >= s->x + bx + rects[i].x) &&
- (y >= s->y + by + rects[i].y) &&
- (x < (int)(s->x + bx + rects[i].x + rects[i].width)) &&
+ if ((x >= s->x + bx + rects[i].x) &&
+ (y >= s->y + by + rects[i].y) &&
+ (x < (int)(s->x + bx + rects[i].x + rects[i].width)) &&
(y < (int)(s->y + by + rects[i].y + rects[i].height)))
{
inside = 1;
@@ -1041,20 +1083,20 @@ _ecore_x_window_shadow_tree_at_xy_get_shadow(Shadow *s,
wx = s->x + bx;
wy = s->y + by;
if (!((x >= wx) && (y >= wy) && (x < (wx + s->w)) && (y < (wy + s->h))))
- return 0;
-
+ return 0;
+
/* FIXME: get shape */
- {
- int num;
- Ecore_X_Rectangle *rects;
-
- num = 0;
- rects = ecore_x_window_shape_rectangles_get(s->win, &num);
- if (!_inside_rects(s, x, y, bx, by, rects, num)) return 0;
- num = 0;
- rects = ecore_x_window_shape_input_rectangles_get(s->win, &num);
- if (!_inside_rects(s, x, y, bx, by, rects, num)) return 0;
- }
+ {
+ int num;
+ Ecore_X_Rectangle *rects;
+
+ num = 0;
+ rects = ecore_x_window_shape_rectangles_get(s->win, &num);
+ if (!_inside_rects(s, x, y, bx, by, rects, num)) return 0;
+ num = 0;
+ rects = ecore_x_window_shape_input_rectangles_get(s->win, &num);
+ if (!_inside_rects(s, x, y, bx, by, rects, num)) return 0;
+ }
if (s->children)
{
@@ -1063,29 +1105,28 @@ _ecore_x_window_shadow_tree_at_xy_get_shadow(Shadow *s,
for (i = s->children_num - 1; i >= 0; --i)
{
if (!s->children[i])
- continue;
+ continue;
skipit = 0;
if (skip)
- for (j = 0; j < skip_num; j++)
- {
- if (s->children[i]->win == skip[j])
- {
- skipit = 1;
- goto onward;
- }
- }
+ for (j = 0; j < skip_num; j++)
+ {
+ if (s->children[i]->win == skip[j])
+ {
+ skipit = 1;
+ goto onward;
+ }
+ }
onward:
if (!skipit)
- if ((child =
- _ecore_x_window_shadow_tree_at_xy_get_shadow(s->
- children[i
- ], wx, wy,
- x, y, skip,
- skip_num)))
- return child;
-
+ if ((child =
+ _ecore_x_window_shadow_tree_at_xy_get_shadow(s->
+ children[i
+ ], wx, wy,
+ x, y, skip,
+ skip_num)))
+ return child;
}
}
@@ -1093,8 +1134,13 @@ onward:
} /* _ecore_x_window_shadow_tree_at_xy_get_shadow */
static Window
-_ecore_x_window_shadow_tree_at_xy_get(Window base, int bx, int by, int x, int y,
- Ecore_X_Window *skip, int skip_num)
+_ecore_x_window_shadow_tree_at_xy_get(Window base,
+ int bx,
+ int by,
+ int x,
+ int y,
+ Ecore_X_Window *skip,
+ int skip_num)
{
Shadow *s;
@@ -1102,12 +1148,12 @@ _ecore_x_window_shadow_tree_at_xy_get(Window base, int bx, int by, int x, int y,
{
_ecore_x_window_tree_shadow_populate();
if (!shadow_base)
- return 0;
+ return 0;
}
s = _ecore_x_window_shadow_tree_find(base);
if (!s)
- return 0;
+ return 0;
return _ecore_x_window_shadow_tree_at_xy_get_shadow(s,
bx,
@@ -1157,7 +1203,7 @@ ecore_x_window_shadow_tree_at_xy_with_skip_get(Ecore_X_Window base,
*/
EAPI Ecore_X_Window
ecore_x_window_shadow_parent_get(Ecore_X_Window root __UNUSED__,
- Ecore_X_Window win)
+ Ecore_X_Window win)
{
Shadow *s;
int i;
@@ -1167,19 +1213,19 @@ ecore_x_window_shadow_parent_get(Ecore_X_Window root __UNUSED__,
{
_ecore_x_window_tree_shadow_populate();
if (!shadow_base)
- return 0;
+ return 0;
}
for (i = 0; i < shadow_num; i++)
{
if (!shadow_base[i])
- continue;
+ continue;
s = _ecore_x_window_shadow_tree_find_shadow(shadow_base[i], win);
if (s)
{
if (!s->parent)
- return 0;
+ return 0;
return s->parent->win;
}
@@ -1211,14 +1257,19 @@ ecore_x_window_root_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!XGetWindowAttributes(_ecore_x_disp, win, &att))
- return 0;
+ return 0;
return att.root;
} /* ecore_x_window_root_get */
static Window
-_ecore_x_window_at_xy_get(Window base, int bx, int by, int x, int y,
- Ecore_X_Window *skip, int skip_num)
+_ecore_x_window_at_xy_get(Window base,
+ int bx,
+ int by,
+ int x,
+ int y,
+ Ecore_X_Window *skip,
+ int skip_num)
{
Window *list = NULL;
Window parent_win = 0, child = 0, root_win = 0;
@@ -1227,7 +1278,7 @@ _ecore_x_window_at_xy_get(Window base, int bx, int by, int x, int y,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_visible_get(base))
- return 0;
+ return 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_geometry_get(base, &wx, &wy, &ww, &wh);
@@ -1235,11 +1286,11 @@ _ecore_x_window_at_xy_get(Window base, int bx, int by, int x, int y,
wy += by;
if (!((x >= wx) && (y >= wy) && (x < (wx + ww)) && (y < (wy + wh))))
- return 0;
+ return 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!XQueryTree(_ecore_x_disp, base, &root_win, &parent_win, &list, &num))
- return base;
+ return base;
if (list)
{
@@ -1250,25 +1301,24 @@ _ecore_x_window_at_xy_get(Window base, int bx, int by, int x, int y,
skipit = 0;
if (skip)
- for (j = 0; j < skip_num; j++)
- {
- if (list[i] == skip[j])
- {
- skipit = 1;
- goto onward;
- }
- }
+ for (j = 0; j < skip_num; j++)
+ {
+ if (list[i] == skip[j])
+ {
+ skipit = 1;
+ goto onward;
+ }
+ }
onward:
if (!skipit)
- if ((child =
- _ecore_x_window_at_xy_get(list[i], wx, wy, x, y, skip,
- skip_num)))
- {
- XFree(list);
- return child;
- }
-
+ if ((child =
+ _ecore_x_window_at_xy_get(list[i], wx, wy, x, y, skip,
+ skip_num)))
+ {
+ XFree(list);
+ return child;
+ }
}
XFree(list);
}
@@ -1284,7 +1334,8 @@ onward:
* @ingroup Ecore_X_Window_Geometry_Group
*/
EAPI Ecore_X_Window
-ecore_x_window_at_xy_get(int x, int y)
+ecore_x_window_at_xy_get(int x,
+ int y)
{
Ecore_X_Window win, root;
@@ -1329,7 +1380,9 @@ ecore_x_window_at_xy_with_skip_get(int x,
} /* ecore_x_window_at_xy_with_skip_get */
EAPI Ecore_X_Window
-ecore_x_window_at_xy_begin_get(Ecore_X_Window begin, int x, int y)
+ecore_x_window_at_xy_begin_get(Ecore_X_Window begin,
+ int x,
+ int y)
{
Ecore_X_Window win;
@@ -1355,10 +1408,10 @@ ecore_x_window_parent_get(Ecore_X_Window win)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!XQueryTree(_ecore_x_disp, win, &root, &parent, &children, &num))
- return 0;
+ return 0;
if (children)
- XFree(children);
+ XFree(children);
return parent;
} /* ecore_x_window_parent_get */
@@ -1371,8 +1424,10 @@ ecore_x_window_parent_get(Ecore_X_Window win)
* @param b blue value (0...65536, 16 bits)
*/
EAPI void
-ecore_x_window_background_color_set(Ecore_X_Window win, unsigned short r,
- unsigned short g, unsigned short b)
+ecore_x_window_background_color_set(Ecore_X_Window win,
+ unsigned short r,
+ unsigned short g,
+ unsigned short b)
{
XSetWindowAttributes attr;
Colormap map;
@@ -1391,7 +1446,8 @@ ecore_x_window_background_color_set(Ecore_X_Window win, unsigned short r,
} /* ecore_x_window_background_color_set */
EAPI void
-ecore_x_window_gravity_set(Ecore_X_Window win, Ecore_X_Gravity grav)
+ecore_x_window_gravity_set(Ecore_X_Window win,
+ Ecore_X_Gravity grav)
{
XSetWindowAttributes att;
@@ -1401,7 +1457,8 @@ ecore_x_window_gravity_set(Ecore_X_Window win, Ecore_X_Gravity grav)
} /* ecore_x_window_gravity_set */
EAPI void
-ecore_x_window_pixel_gravity_set(Ecore_X_Window win, Ecore_X_Gravity grav)
+ecore_x_window_pixel_gravity_set(Ecore_X_Window win,
+ Ecore_X_Gravity grav)
{
XSetWindowAttributes att;
@@ -1411,28 +1468,38 @@ ecore_x_window_pixel_gravity_set(Ecore_X_Window win, Ecore_X_Gravity grav)
} /* ecore_x_window_pixel_gravity_set */
EAPI void
-ecore_x_window_pixmap_set(Ecore_X_Window win, Ecore_X_Pixmap pmap)
+ecore_x_window_pixmap_set(Ecore_X_Window win,
+ Ecore_X_Pixmap pmap)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XSetWindowBackgroundPixmap(_ecore_x_disp, win, pmap);
} /* ecore_x_window_pixmap_set */
EAPI void
-ecore_x_window_area_clear(Ecore_X_Window win, int x, int y, int w, int h)
+ecore_x_window_area_clear(Ecore_X_Window win,
+ int x,
+ int y,
+ int w,
+ int h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XClearArea(_ecore_x_disp, win, x, y, w, h, False);
} /* ecore_x_window_area_clear */
EAPI void
-ecore_x_window_area_expose(Ecore_X_Window win, int x, int y, int w, int h)
+ecore_x_window_area_expose(Ecore_X_Window win,
+ int x,
+ int y,
+ int w,
+ int h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XClearArea(_ecore_x_disp, win, x, y, w, h, True);
} /* ecore_x_window_area_expose */
EAPI void
-ecore_x_window_override_set(Ecore_X_Window win, Eina_Bool override)
+ecore_x_window_override_set(Ecore_X_Window win,
+ Eina_Bool override)
{
XSetWindowAttributes att;
@@ -1468,15 +1535,15 @@ _ecore_x_window_argb_internal_new(Ecore_X_Window parent,
else
{
/* ewww - round trip */
- XGetWindowAttributes(_ecore_x_disp, parent, &att);
- for (i = 0; i < ScreenCount(_ecore_x_disp); i++)
- {
- if (att.screen == ScreenOfDisplay(_ecore_x_disp, i))
- {
- scr = i;
- break;
- }
- }
+ XGetWindowAttributes(_ecore_x_disp, parent, &att);
+ for (i = 0; i < ScreenCount(_ecore_x_disp); i++)
+ {
+ if (att.screen == ScreenOfDisplay(_ecore_x_disp, i))
+ {
+ scr = i;
+ break;
+ }
+ }
}
vi_in.screen = scr;
@@ -1489,7 +1556,7 @@ _ecore_x_window_argb_internal_new(Ecore_X_Window parent,
&vi_in,
&nvi);
if (!xvi)
- return 0;
+ return 0;
vis = NULL;
for (i = 0; i < nvi; i++)
@@ -1514,18 +1581,18 @@ _ecore_x_window_argb_internal_new(Ecore_X_Window parent,
attr.save_under = saveunder;
attr.do_not_propagate_mask = NoEventMask;
attr.event_mask = KeyPressMask |
- KeyReleaseMask |
- ButtonPressMask |
- ButtonReleaseMask |
- EnterWindowMask |
- LeaveWindowMask |
- PointerMotionMask |
- ExposureMask |
- VisibilityChangeMask |
- StructureNotifyMask |
- FocusChangeMask |
- PropertyChangeMask |
- ColormapChangeMask;
+ KeyReleaseMask |
+ ButtonPressMask |
+ ButtonReleaseMask |
+ EnterWindowMask |
+ LeaveWindowMask |
+ PointerMotionMask |
+ ExposureMask |
+ VisibilityChangeMask |
+ StructureNotifyMask |
+ FocusChangeMask |
+ PropertyChangeMask |
+ ColormapChangeMask;
win = XCreateWindow(_ecore_x_disp, parent,
x, y, w, h, 0,
32,
@@ -1545,7 +1612,7 @@ _ecore_x_window_argb_internal_new(Ecore_X_Window parent,
XFreeColormap(_ecore_x_disp, attr.colormap);
if (parent == DefaultRootWindow(_ecore_x_disp))
- ecore_x_window_defaults_set(win);
+ ecore_x_window_defaults_set(win);
return win;
} /* _ecore_x_window_argb_internal_new */
@@ -1561,14 +1628,14 @@ ecore_x_window_argb_get(Ecore_X_Window win)
att.visual = 0;
if (!XGetWindowAttributes(_ecore_x_disp, win, &att))
- return 0;
+ return 0;
fmt = XRenderFindVisualFormat(_ecore_x_disp, att.visual);
if (!fmt)
- return 0;
+ return 0;
if ((fmt->type == PictTypeDirect) && (fmt->direct.alphaMask))
- return 1;
+ return 1;
return 0;
#else /* ifdef ECORE_XRENDER */
@@ -1614,7 +1681,11 @@ ecore_x_window_manager_argb_new(Ecore_X_Window parent,
* @ingroup Ecore_X_Window_Create_Group
*/
EAPI Ecore_X_Window
-ecore_x_window_argb_new(Ecore_X_Window parent, int x, int y, int w, int h)
+ecore_x_window_argb_new(Ecore_X_Window parent,
+ int x,
+ int y,
+ int w,
+ int h)
{
#ifdef ECORE_XRENDER
LOGFN(__FILE__, __LINE__, __FUNCTION__);
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c
index 82e35a89aa..b83829950f 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window_prop.c
@@ -12,16 +12,18 @@
#include <inttypes.h>
#include <limits.h>
-#define _ATOM_SET_CARD32(win, atom, p_val, cnt)\
- XChangeProperty(_ecore_x_disp, win, atom, XA_CARDINAL, 32, PropModeReplace,\
- (unsigned char *)p_val, cnt)
+#define _ATOM_SET_CARD32(win, atom, p_val, cnt) \
+ XChangeProperty(_ecore_x_disp, win, atom, XA_CARDINAL, 32, PropModeReplace, \
+ (unsigned char *)p_val, cnt)
/*
* Set CARD32 (array) property
*/
EAPI void
-ecore_x_window_prop_card32_set(Ecore_X_Window win, Ecore_X_Atom atom,
- unsigned int *val, unsigned int num)
+ecore_x_window_prop_card32_set(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ unsigned int *val,
+ unsigned int num)
{
#if SIZEOF_INT == SIZEOF_LONG
_ATOM_SET_CARD32(win, atom, val, num);
@@ -32,10 +34,10 @@ ecore_x_window_prop_card32_set(Ecore_X_Window win, Ecore_X_Atom atom,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
v2 = malloc(num * sizeof(long));
if (!v2)
- return;
+ return;
for (i = 0; i < num; i++)
- v2[i] = val[i];
+ v2[i] = val[i];
_ATOM_SET_CARD32(win, atom, v2, num);
free(v2);
#endif /* if SIZEOF_INT == SIZEOF_LONG */
@@ -50,8 +52,10 @@ ecore_x_window_prop_card32_set(Ecore_X_Window win, Ecore_X_Atom atom,
* Note: Return value 0 means that the property exists but has no elements.
*/
EAPI int
-ecore_x_window_prop_card32_get(Ecore_X_Window win, Ecore_X_Atom atom,
- unsigned int *val, unsigned int len)
+ecore_x_window_prop_card32_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ unsigned int *val,
+ unsigned int len)
{
unsigned char *prop_ret;
Atom type_ret;
@@ -65,24 +69,24 @@ ecore_x_window_prop_card32_get(Ecore_X_Window win, Ecore_X_Atom atom,
if (XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
XA_CARDINAL, &type_ret, &format_ret, &num_ret,
&bytes_after, &prop_ret) != Success)
- return -1;
+ return -1;
if (type_ret != XA_CARDINAL || format_ret != 32)
- num = -1;
+ num = -1;
else if (num_ret == 0 || !prop_ret)
- num = 0;
+ num = 0;
else
{
if (num_ret < len)
- len = num_ret;
+ len = num_ret;
for (i = 0; i < len; i++)
- val[i] = ((unsigned long *)prop_ret)[i];
+ val[i] = ((unsigned long *)prop_ret)[i];
num = len;
}
if (prop_ret)
- XFree(prop_ret);
+ XFree(prop_ret);
return num;
} /* ecore_x_window_prop_card32_get */
@@ -95,7 +99,8 @@ ecore_x_window_prop_card32_get(Ecore_X_Window win, Ecore_X_Atom atom,
* Note: Return value 0 means that the property exists but has no elements.
*/
EAPI int
-ecore_x_window_prop_card32_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
+ecore_x_window_prop_card32_list_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
unsigned int **plst)
{
unsigned char *prop_ret;
@@ -111,23 +116,23 @@ ecore_x_window_prop_card32_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
if (XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
XA_CARDINAL, &type_ret, &format_ret, &num_ret,
&bytes_after, &prop_ret) != Success)
- return -1;
+ return -1;
if (type_ret != XA_CARDINAL || format_ret != 32)
- num = -1;
+ num = -1;
else if (num_ret == 0 || !prop_ret)
- num = 0;
+ num = 0;
else
{
val = malloc(num_ret * sizeof(unsigned int));
for (i = 0; i < num_ret; i++)
- val[i] = ((unsigned long *)prop_ret)[i];
+ val[i] = ((unsigned long *)prop_ret)[i];
num = num_ret;
*plst = val;
}
if (prop_ret)
- XFree(prop_ret);
+ XFree(prop_ret);
return num;
} /* ecore_x_window_prop_card32_list_get */
@@ -136,9 +141,11 @@ ecore_x_window_prop_card32_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
* Set X ID (array) property
*/
EAPI void
-ecore_x_window_prop_xid_set(Ecore_X_Window win, Ecore_X_Atom atom,
- Ecore_X_Atom type, Ecore_X_ID *lst,
- unsigned int num)
+ecore_x_window_prop_xid_set(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom type,
+ Ecore_X_ID *lst,
+ unsigned int num)
{
#if SIZEOF_INT == SIZEOF_LONG
XChangeProperty(_ecore_x_disp, win, atom, type, 32, PropModeReplace,
@@ -150,10 +157,10 @@ ecore_x_window_prop_xid_set(Ecore_X_Window win, Ecore_X_Atom atom,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
pl = malloc(num * sizeof(long));
if (!pl)
- return;
+ return;
for (i = 0; i < num; i++)
- pl[i] = lst[i];
+ pl[i] = lst[i];
XChangeProperty(_ecore_x_disp, win, atom, type, 32, PropModeReplace,
(unsigned char *)pl, num);
free(pl);
@@ -169,9 +176,11 @@ ecore_x_window_prop_xid_set(Ecore_X_Window win, Ecore_X_Atom atom,
* Note: Return value 0 means that the property exists but has no elements.
*/
EAPI int
-ecore_x_window_prop_xid_get(Ecore_X_Window win, Ecore_X_Atom atom,
- Ecore_X_Atom type, Ecore_X_ID *lst,
- unsigned int len)
+ecore_x_window_prop_xid_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom type,
+ Ecore_X_ID *lst,
+ unsigned int len)
{
unsigned char *prop_ret;
Atom type_ret;
@@ -185,24 +194,24 @@ ecore_x_window_prop_xid_get(Ecore_X_Window win, Ecore_X_Atom atom,
if (XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
type, &type_ret, &format_ret, &num_ret,
&bytes_after, &prop_ret) != Success)
- return -1;
+ return -1;
if (type_ret != type || format_ret != 32)
- num = -1;
+ num = -1;
else if (num_ret == 0 || !prop_ret)
- num = 0;
+ num = 0;
else
{
if (num_ret < len)
- len = num_ret;
+ len = num_ret;
for (i = 0; i < len; i++)
- lst[i] = ((unsigned long *)prop_ret)[i];
+ lst[i] = ((unsigned long *)prop_ret)[i];
num = len;
}
if (prop_ret)
- XFree(prop_ret);
+ XFree(prop_ret);
return num;
} /* ecore_x_window_prop_xid_get */
@@ -216,8 +225,10 @@ ecore_x_window_prop_xid_get(Ecore_X_Window win, Ecore_X_Atom atom,
* Note: Return value 0 means that the property exists but has no elements.
*/
EAPI int
-ecore_x_window_prop_xid_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
- Ecore_X_Atom type, Ecore_X_ID **val)
+ecore_x_window_prop_xid_list_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom type,
+ Ecore_X_ID **val)
{
unsigned char *prop_ret;
Atom type_ret;
@@ -233,23 +244,23 @@ ecore_x_window_prop_xid_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
if (XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
type, &type_ret, &format_ret, &num_ret,
&bytes_after, &prop_ret) != Success)
- return -1;
+ return -1;
if (type_ret != type || format_ret != 32)
- num = -1;
+ num = -1;
else if (num_ret == 0 || !prop_ret)
- num = 0;
+ num = 0;
else
{
alst = malloc(num_ret * sizeof(Ecore_X_ID));
for (i = 0; i < num_ret; i++)
- alst[i] = ((unsigned long *)prop_ret)[i];
+ alst[i] = ((unsigned long *)prop_ret)[i];
num = num_ret;
*val = alst;
}
if (prop_ret)
- XFree(prop_ret);
+ XFree(prop_ret);
return num;
} /* ecore_x_window_prop_xid_list_get */
@@ -258,8 +269,11 @@ ecore_x_window_prop_xid_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
* Remove/add/toggle X ID list item.
*/
EAPI void
-ecore_x_window_prop_xid_list_change(Ecore_X_Window win, Ecore_X_Atom atom,
- Ecore_X_Atom type, Ecore_X_ID item, int op)
+ecore_x_window_prop_xid_list_change(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom type,
+ Ecore_X_ID item,
+ int op)
{
Ecore_X_ID *lst;
int i, num;
@@ -275,43 +289,45 @@ ecore_x_window_prop_xid_list_change(Ecore_X_Window win, Ecore_X_Atom atom,
for (i = 0; i < num; i++)
{
if (lst[i] == item)
- break;
+ break;
}
if (i < num)
{
/* Was in list */
- if (op == ECORE_X_PROP_LIST_ADD)
+ if (op == ECORE_X_PROP_LIST_ADD)
goto done; /* Remove it */
- num--;
- for (; i < num; i++)
+ num--;
+ for (; i < num; i++)
lst[i] = lst[i + 1];
}
else
{
/* Was not in list */
- if (op == ECORE_X_PROP_LIST_REMOVE)
+ if (op == ECORE_X_PROP_LIST_REMOVE)
goto done; /* Add it */
- num++;
- lst = realloc(lst, num * sizeof(Ecore_X_ID));
- lst[i] = item;
+ num++;
+ lst = realloc(lst, num * sizeof(Ecore_X_ID));
+ lst[i] = item;
}
ecore_x_window_prop_xid_set(win, atom, type, lst, num);
done:
if (lst)
- free(lst);
+ free(lst);
} /* ecore_x_window_prop_xid_list_change */
/*
* Set Atom (array) property
*/
EAPI void
-ecore_x_window_prop_atom_set(Ecore_X_Window win, Ecore_X_Atom atom,
- Ecore_X_Atom *lst, unsigned int num)
+ecore_x_window_prop_atom_set(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom *lst,
+ unsigned int num)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_xid_set(win, atom, XA_ATOM, lst, num);
@@ -326,8 +342,10 @@ ecore_x_window_prop_atom_set(Ecore_X_Window win, Ecore_X_Atom atom,
* Note: Return value 0 means that the property exists but has no elements.
*/
EAPI int
-ecore_x_window_prop_atom_get(Ecore_X_Window win, Ecore_X_Atom atom,
- Ecore_X_Atom *lst, unsigned int len)
+ecore_x_window_prop_atom_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom *lst,
+ unsigned int len)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return ecore_x_window_prop_xid_get(win, atom, XA_ATOM, lst, len);
@@ -342,7 +360,8 @@ ecore_x_window_prop_atom_get(Ecore_X_Window win, Ecore_X_Atom atom,
* Note: Return value 0 means that the property exists but has no elements.
*/
EAPI int
-ecore_x_window_prop_atom_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
+ecore_x_window_prop_atom_list_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
Ecore_X_Atom **plst)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -353,8 +372,10 @@ ecore_x_window_prop_atom_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
* Remove/add/toggle atom list item.
*/
EAPI void
-ecore_x_window_prop_atom_list_change(Ecore_X_Window win, Ecore_X_Atom atom,
- Ecore_X_Atom item, int op)
+ecore_x_window_prop_atom_list_change(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Atom item,
+ int op)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_xid_list_change(win, atom, XA_ATOM, item, op);
@@ -364,8 +385,10 @@ ecore_x_window_prop_atom_list_change(Ecore_X_Window win, Ecore_X_Atom atom,
* Set Window (array) property
*/
EAPI void
-ecore_x_window_prop_window_set(Ecore_X_Window win, Ecore_X_Atom atom,
- Ecore_X_Window *lst, unsigned int num)
+ecore_x_window_prop_window_set(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Window *lst,
+ unsigned int num)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ecore_x_window_prop_xid_set(win, atom, XA_WINDOW, lst, num);
@@ -380,8 +403,10 @@ ecore_x_window_prop_window_set(Ecore_X_Window win, Ecore_X_Atom atom,
* Note: Return value 0 means that the property exists but has no elements.
*/
EAPI int
-ecore_x_window_prop_window_get(Ecore_X_Window win, Ecore_X_Atom atom,
- Ecore_X_Window *lst, unsigned int len)
+ecore_x_window_prop_window_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
+ Ecore_X_Window *lst,
+ unsigned int len)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
return ecore_x_window_prop_xid_get(win, atom, XA_WINDOW, lst, len);
@@ -396,7 +421,8 @@ ecore_x_window_prop_window_get(Ecore_X_Window win, Ecore_X_Atom atom,
* Note: Return value 0 means that the property exists but has no elements.
*/
EAPI int
-ecore_x_window_prop_window_list_get(Ecore_X_Window win, Ecore_X_Atom atom,
+ecore_x_window_prop_window_list_get(Ecore_X_Window win,
+ Ecore_X_Atom atom,
Ecore_X_Window **plst)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -429,17 +455,17 @@ ecore_x_window_prop_property_set(Ecore_X_Window win,
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (win == 0)
- win = DefaultRootWindow(_ecore_x_disp);
+ win = DefaultRootWindow(_ecore_x_disp);
if (size != 32)
- XChangeProperty(_ecore_x_disp,
- win,
- property,
- type,
- size,
- PropModeReplace,
- (unsigned char *)data,
- number);
+ XChangeProperty(_ecore_x_disp,
+ win,
+ property,
+ type,
+ size,
+ PropModeReplace,
+ (unsigned char *)data,
+ number);
else
{
unsigned long *dat;
@@ -465,7 +491,7 @@ EAPI int
ecore_x_window_prop_property_get(Ecore_X_Window win,
Ecore_X_Atom property,
Ecore_X_Atom type,
- int size __UNUSED__,
+ int size __UNUSED__,
unsigned char **data,
int *num)
{
@@ -476,23 +502,23 @@ ecore_x_window_prop_property_get(Ecore_X_Window win,
/* make sure these are initialized */
if (num)
- *num = 0;
+ *num = 0;
if (data)
- *data = NULL;
+ *data = NULL;
else /* we can't store the retrieved data, so just return */
- return 0;
+ return 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win)
- win = DefaultRootWindow(_ecore_x_disp);
+ win = DefaultRootWindow(_ecore_x_disp);
ret = XGetWindowProperty(_ecore_x_disp, win, property, 0, LONG_MAX,
False, type, &type_ret, &size_ret,
&num_ret, &bytes, &prop_ret);
if (ret != Success)
- return 0;
+ return 0;
if (!num_ret)
{
@@ -508,38 +534,40 @@ ecore_x_window_prop_property_get(Ecore_X_Window win,
switch (size_ret) {
case 8:
- for (i = 0; i < num_ret; i++)
- (*data)[i] = prop_ret[i];
- break;
+ for (i = 0; i < num_ret; i++)
+ (*data)[i] = prop_ret[i];
+ break;
case 16:
- for (i = 0; i < num_ret; i++)
- ((unsigned short *)*data)[i] = ((unsigned short *)prop_ret)[i];
- break;
+ for (i = 0; i < num_ret; i++)
+ ((unsigned short *)*data)[i] = ((unsigned short *)prop_ret)[i];
+ break;
case 32:
- for (i = 0; i < num_ret; i++)
- ((unsigned int *)*data)[i] = ((unsigned long *)prop_ret)[i];
- break;
+ for (i = 0; i < num_ret; i++)
+ ((unsigned int *)*data)[i] = ((unsigned long *)prop_ret)[i];
+ break;
} /* switch */
XFree(prop_ret);
if (num)
- *num = num_ret;
+ *num = num_ret;
return size_ret;
} /* ecore_x_window_prop_property_get */
EAPI void
-ecore_x_window_prop_property_del(Ecore_X_Window win, Ecore_X_Atom property)
+ecore_x_window_prop_property_del(Ecore_X_Window win,
+ Ecore_X_Atom property)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XDeleteProperty(_ecore_x_disp, win, property);
} /* ecore_x_window_prop_property_del */
EAPI Ecore_X_Atom *
-ecore_x_window_prop_list(Ecore_X_Window win, int *num_ret)
+ecore_x_window_prop_list(Ecore_X_Window win,
+ int *num_ret)
{
Ecore_X_Atom *atoms;
Atom *atom_ret;
@@ -547,18 +575,18 @@ ecore_x_window_prop_list(Ecore_X_Window win, int *num_ret)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (num_ret)
- *num_ret = 0;
+ *num_ret = 0;
atom_ret = XListProperties(_ecore_x_disp, win, &num);
if (!atom_ret)
- return NULL;
+ return NULL;
atoms = malloc(num * sizeof(Ecore_X_Atom));
if (atoms)
{
for (i = 0; i < num; i++) atoms[i] = atom_ret[i];
if (num_ret)
- *num_ret = num;
+ *num_ret = num;
}
XFree(atom_ret);
@@ -582,7 +610,7 @@ ecore_x_window_prop_string_set(Ecore_X_Window win,
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (win == 0)
- win = DefaultRootWindow(_ecore_x_disp);
+ win = DefaultRootWindow(_ecore_x_disp);
xtp.value = (unsigned char *)str;
xtp.format = 8;
@@ -599,14 +627,15 @@ ecore_x_window_prop_string_set(Ecore_X_Window win,
* Return window string property of a window. String must be free'd when done.
*/
EAPI char *
-ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom type)
+ecore_x_window_prop_string_get(Ecore_X_Window win,
+ Ecore_X_Atom type)
{
XTextProperty xtp;
char *str = NULL;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (win == 0)
- win = DefaultRootWindow(_ecore_x_disp);
+ win = DefaultRootWindow(_ecore_x_disp);
if (XGetTextProperty(_ecore_x_disp, win, &xtp, type))
{
@@ -615,7 +644,7 @@ ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom type)
Status s;
if (xtp.encoding == ECORE_X_ATOM_UTF8_STRING)
- str = strdup((char *)xtp.value);
+ str = strdup((char *)xtp.value);
else
{
#ifdef X_HAVE_UTF8_STRING
@@ -627,12 +656,12 @@ ecore_x_window_prop_string_get(Ecore_X_Window win, Ecore_X_Atom type)
#endif /* ifdef X_HAVE_UTF8_STRING */
if ((s == XLocaleNotSupported) ||
(s == XNoMemory) || (s == XConverterNotFound))
- str = strdup((char *)xtp.value);
+ str = strdup((char *)xtp.value);
else if ((s >= Success) && (items > 0))
- str = strdup(list[0]);
+ str = strdup(list[0]);
if (list)
- XFreeStringList(list);
+ XFreeStringList(list);
}
XFree(xtp.value);
@@ -651,20 +680,20 @@ ecore_x_window_prop_protocol_isset(Ecore_X_Window win,
/* check for invalid values */
if (protocol >= ECORE_X_WM_PROTOCOL_NUM)
- return EINA_FALSE;
+ return EINA_FALSE;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
proto = _ecore_x_atoms_wm_protocols[protocol];
if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
- return ret;
+ return ret;
for (i = 0; i < protos_count; i++)
- if (protos[i] == proto)
- {
- ret = EINA_TRUE;
- break;
- }
+ if (protos[i] == proto)
+ {
+ ret = EINA_TRUE;
+ break;
+ }
XFree(protos);
@@ -677,7 +706,8 @@ ecore_x_window_prop_protocol_isset(Ecore_X_Window win,
* FIXME: To be fixed.
*/
EAPI Ecore_X_WM_Protocol *
-ecore_x_window_prop_protocol_list_get(Ecore_X_Window win, int *num_ret)
+ecore_x_window_prop_protocol_list_get(Ecore_X_Window win,
+ int *num_ret)
{
Atom *protos = NULL;
int i, protos_count = 0;
@@ -685,10 +715,10 @@ ecore_x_window_prop_protocol_list_get(Ecore_X_Window win, int *num_ret)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
- return NULL;
+ return NULL;
if ((!protos) || (protos_count <= 0))
- return NULL;
+ return NULL;
prot_ret = calloc(1, protos_count * sizeof(Ecore_X_WM_Protocol));
if (!prot_ret)
@@ -705,7 +735,7 @@ ecore_x_window_prop_protocol_list_get(Ecore_X_Window win, int *num_ret)
for (j = 0; j < ECORE_X_WM_PROTOCOL_NUM; j++)
{
if (_ecore_x_atoms_wm_protocols[j] == protos[i])
- prot_ret[i] = j;
+ prot_ret[i] = j;
}
}
XFree(protos);
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window_shape.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window_shape.c
index 6bbc864e89..2e8f8cef3f 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window_shape.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_window_shape.c
@@ -23,7 +23,8 @@
* @ingroup Ecore_X_Window_Shape
*/
EAPI void
-ecore_x_window_shape_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask)
+ecore_x_window_shape_mask_set(Ecore_X_Window win,
+ Ecore_X_Pixmap mask)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XShapeCombineMask(_ecore_x_disp, win, ShapeBounding, 0, 0, mask, ShapeSet);
@@ -37,11 +38,12 @@ ecore_x_window_shape_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask)
* @ingroup Ecore_X_Window_Shape
*/
EAPI void
-ecore_x_window_shape_input_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask)
+ecore_x_window_shape_input_mask_set(Ecore_X_Window win,
+ Ecore_X_Pixmap mask)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
#ifdef ShapeInput
- XShapeCombineMask(_ecore_x_disp, win, ShapeInput, 0, 0, mask, ShapeSet);
+ XShapeCombineMask(_ecore_x_disp, win, ShapeInput, 0, 0, mask, ShapeSet);
#else /* ifdef ShapeInput */
return;
win = mask = 0;
@@ -49,7 +51,8 @@ ecore_x_window_shape_input_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask)
} /* ecore_x_window_shape_input_mask_set */
EAPI void
-ecore_x_window_shape_window_set(Ecore_X_Window win, Ecore_X_Window shape_win)
+ecore_x_window_shape_window_set(Ecore_X_Window win,
+ Ecore_X_Window shape_win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XShapeCombineShape(_ecore_x_disp,
@@ -310,7 +313,8 @@ ecore_x_window_shape_input_rectangle_subtract(Ecore_X_Window win,
} /* ecore_x_window_shape_input_rectangle_subtract */
EAPI void
-ecore_x_window_shape_window_add(Ecore_X_Window win, Ecore_X_Window shape_win)
+ecore_x_window_shape_window_add(Ecore_X_Window win,
+ Ecore_X_Window shape_win)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
XShapeCombineShape(_ecore_x_disp,
@@ -546,7 +550,8 @@ ecore_x_window_shape_input_rectangles_add(Ecore_X_Window win,
} /* ecore_x_window_shape_input_rectangles_add */
EAPI Ecore_X_Rectangle *
-ecore_x_window_shape_rectangles_get(Ecore_X_Window win, int *num_ret)
+ecore_x_window_shape_rectangles_get(Ecore_X_Window win,
+ int *num_ret)
{
XRectangle *rect;
Ecore_X_Rectangle *rects = NULL;
@@ -583,7 +588,8 @@ ecore_x_window_shape_rectangles_get(Ecore_X_Window win, int *num_ret)
} /* ecore_x_window_shape_rectangles_get */
EAPI Ecore_X_Rectangle *
-ecore_x_window_shape_input_rectangles_get(Ecore_X_Window win, int *num_ret)
+ecore_x_window_shape_input_rectangles_get(Ecore_X_Window win,
+ int *num_ret)
{
Ecore_X_Rectangle *rects = NULL;
#ifdef ShapeInput
@@ -622,7 +628,7 @@ ecore_x_window_shape_input_rectangles_get(Ecore_X_Window win, int *num_ret)
// have to return fake shape input rect of size of window
Window dw;
unsigned int di;
-
+
if (num_ret) *num_ret = 0;
rects = malloc(sizeof(Ecore_X_Rectangle));
if (!rects) return NULL;
@@ -640,11 +646,13 @@ ecore_x_window_shape_input_rectangles_get(Ecore_X_Window win, int *num_ret)
} /* ecore_x_window_shape_input_rectangles_get */
EAPI void
-ecore_x_window_shape_events_select(Ecore_X_Window win, Eina_Bool on)
+ecore_x_window_shape_events_select(Ecore_X_Window win,
+ Eina_Bool on)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (on)
- XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask);
+ XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask);
else
- XShapeSelectInput(_ecore_x_disp, win, 0);
+ XShapeSelectInput(_ecore_x_disp, win, 0);
} /* ecore_x_window_shape_events_select */
+
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c
index 2755c260ef..38a81dde8e 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xi2.c
@@ -76,7 +76,7 @@ _ecore_x_input_handler(XEvent *xevent)
for (i = 0; i < _ecore_x_xi2_num; i++)
{
XIDeviceInfo *dev = &(_ecore_x_xi2_devs[i]);
-
+
if (devid == dev->deviceid)
{
if (dev->use == XIMasterPointer) return;
@@ -88,117 +88,120 @@ _ecore_x_input_handler(XEvent *xevent)
switch (xevent->xcookie.evtype)
{
case XI_Motion:
- _ecore_mouse_move
- (evd->time,
- 0, // state
- evd->event_x, evd->event_y,
- evd->root_x, evd->root_y,
- evd->event,
- (evd->child ? evd->child : evd->event),
- evd->root,
- 1, // same_screen
- devid, 1, 1,
- 1.0, // pressure
- 0.0, // angle
- evd->event_x, evd->event_y,
- evd->root_x, evd->root_y);
- break;
+ _ecore_mouse_move
+ (evd->time,
+ 0, // state
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y,
+ evd->event,
+ (evd->child ? evd->child : evd->event),
+ evd->root,
+ 1, // same_screen
+ devid, 1, 1,
+ 1.0, // pressure
+ 0.0, // angle
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y);
+ break;
case XI_ButtonPress:
- _ecore_mouse_button
- (ECORE_EVENT_MOUSE_BUTTON_DOWN,
- evd->time,
- 0, // state
- 0, // button
- evd->event_x, evd->event_y,
- evd->root_x, evd->root_y,
- evd->event,
- (evd->child ? evd->child : evd->event),
- evd->root,
- 1, // same_screen
- devid, 1, 1,
- 1.0, // pressure
- 0.0, // angle
- evd->event_x, evd->event_y,
- evd->root_x, evd->root_y);
- break;
+ _ecore_mouse_button
+ (ECORE_EVENT_MOUSE_BUTTON_DOWN,
+ evd->time,
+ 0, // state
+ 0, // button
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y,
+ evd->event,
+ (evd->child ? evd->child : evd->event),
+ evd->root,
+ 1, // same_screen
+ devid, 1, 1,
+ 1.0, // pressure
+ 0.0, // angle
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y);
+ break;
case XI_ButtonRelease:
- _ecore_mouse_button
- (ECORE_EVENT_MOUSE_BUTTON_UP,
- evd->time,
- 0, // state
- 0, // button
- evd->event_x, evd->event_y,
- evd->root_x, evd->root_y,
- evd->event,
- (evd->child ? evd->child : evd->event),
- evd->root,
- 1, // same_screen
- devid, 1, 1,
- 1.0, // pressure
- 0.0, // angle
- evd->event_x, evd->event_y,
- evd->root_x, evd->root_y);
- break;
+ _ecore_mouse_button
+ (ECORE_EVENT_MOUSE_BUTTON_UP,
+ evd->time,
+ 0, // state
+ 0, // button
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y,
+ evd->event,
+ (evd->child ? evd->child : evd->event),
+ evd->root,
+ 1, // same_screen
+ devid, 1, 1,
+ 1.0, // pressure
+ 0.0, // angle
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y);
+ break;
-#ifdef XI_TouchUpdate
+#ifdef XI_TouchUpdate
case XI_TouchUpdate:
- _ecore_mouse_move
- (evd->time,
- 0, // state
- evd->event_x, evd->event_y,
- evd->root_x, evd->root_y,
- evd->event,
- (evd->child ? evd->child : evd->event),
- evd->root,
- 1, // same_screen
- devid, 1, 1,
- 1.0, // pressure
- 0.0, // angle
- evd->event_x, evd->event_y,
- evd->root_x, evd->root_y);
+ _ecore_mouse_move
+ (evd->time,
+ 0, // state
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y,
+ evd->event,
+ (evd->child ? evd->child : evd->event),
+ evd->root,
+ 1, // same_screen
+ devid, 1, 1,
+ 1.0, // pressure
+ 0.0, // angle
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y);
break;
+
#endif
#ifdef XI_TouchBegin
case XI_TouchBegin:
- _ecore_mouse_button
- (ECORE_EVENT_MOUSE_BUTTON_DOWN,
- evd->time,
- 0, // state
- 0, // button
- evd->event_x, evd->event_y,
- evd->root_x, evd->root_y,
- evd->event,
- (evd->child ? evd->child : evd->event),
- evd->root,
- 1, // same_screen
- devid, 1, 1,
- 1.0, // pressure
- 0.0, // angle
- evd->event_x, evd->event_y,
- evd->root_x, evd->root_y);
+ _ecore_mouse_button
+ (ECORE_EVENT_MOUSE_BUTTON_DOWN,
+ evd->time,
+ 0, // state
+ 0, // button
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y,
+ evd->event,
+ (evd->child ? evd->child : evd->event),
+ evd->root,
+ 1, // same_screen
+ devid, 1, 1,
+ 1.0, // pressure
+ 0.0, // angle
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y);
break;
+
#endif
#ifdef XI_TouchEnd
case XI_TouchEnd:
- _ecore_mouse_button
- (ECORE_EVENT_MOUSE_BUTTON_UP,
- evd->time,
- 0, // state
- 0, // button
- evd->event_x, evd->event_y,
- evd->root_x, evd->root_y,
- evd->event,
- (evd->child ? evd->child : evd->event),
- evd->root,
- 1, // same_screen
- devid, 1, 1,
- 1.0, // pressure
- 0.0, // angle
- evd->event_x, evd->event_y,
- evd->root_x, evd->root_y);
+ _ecore_mouse_button
+ (ECORE_EVENT_MOUSE_BUTTON_UP,
+ evd->time,
+ 0, // state
+ 0, // button
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y,
+ evd->event,
+ (evd->child ? evd->child : evd->event),
+ evd->root,
+ 1, // same_screen
+ devid, 1, 1,
+ 1.0, // pressure
+ 0.0, // angle
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y);
break;
+
#endif
default:
break;
@@ -214,7 +217,7 @@ ecore_x_input_multi_select(Ecore_X_Window win)
Eina_Bool find = EINA_FALSE;
if (!_ecore_x_xi2_devs)
- return 0;
+ return 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
for (i = 0; i < _ecore_x_xi2_num; i++)
@@ -239,18 +242,18 @@ ecore_x_input_multi_select(Ecore_X_Window win)
{
XIDeviceInfo *atdev = NULL;
int j;
-
+
for (j = 0; j < _ecore_x_xi2_num; j++)
{
if (_ecore_x_xi2_devs[j].deviceid == dev->attachment)
- atdev = &(_ecore_x_xi2_devs[j]);
+ atdev = &(_ecore_x_xi2_devs[j]);
}
if (((atdev) && (atdev->use != XIMasterPointer)) ||
(!atdev))
{
XIEventMask eventmask;
unsigned char mask[4] = { 0 };
-
+
eventmask.deviceid = dev->deviceid;
eventmask.mask_len = sizeof(mask);
eventmask.mask = mask;
@@ -259,13 +262,13 @@ ecore_x_input_multi_select(Ecore_X_Window win)
XISetMask(mask, XI_Motion);
# ifdef XI_TouchUpdate
XISetMask(mask, XI_TouchUpdate);
-# endif
+# endif
# ifdef XI_TouchBegin
XISetMask(mask, XI_TouchBegin);
-# endif
+# endif
# ifdef XI_TouchEnd
XISetMask(mask, XI_TouchEnd);
-# endif
+# endif
XISelectEvents(_ecore_x_disp, win, &eventmask, 1);
find = EINA_TRUE;
}
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xinerama.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xinerama.c
index 18b13852be..1d956b728a 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xinerama.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_xinerama.c
@@ -24,14 +24,14 @@ ecore_x_xinerama_screen_count_get(void)
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (_xin_info)
- XFree(_xin_info);
+ XFree(_xin_info);
_xin_info = NULL;
if (XineramaQueryExtension(_ecore_x_disp, &event_base, &error_base))
{
_xin_info = XineramaQueryScreens(_ecore_x_disp, &_xin_scr_num);
if (_xin_info)
- return _xin_scr_num;
+ return _xin_scr_num;
}
#endif /* ifdef ECORE_XINERAMA */
@@ -39,7 +39,11 @@ ecore_x_xinerama_screen_count_get(void)
} /* ecore_x_xinerama_screen_count_get */
EAPI Eina_Bool
-ecore_x_xinerama_screen_geometry_get(int screen, int *x, int *y, int *w, int *h)
+ecore_x_xinerama_screen_geometry_get(int screen,
+ int *x,
+ int *y,
+ int *w,
+ int *h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
#ifdef ECORE_XINERAMA
@@ -52,16 +56,16 @@ ecore_x_xinerama_screen_geometry_get(int screen, int *x, int *y, int *w, int *h)
if (_xin_info[i].screen_number == screen)
{
if (x)
- *x = _xin_info[i].x_org;
+ *x = _xin_info[i].x_org;
if (y)
- *y = _xin_info[i].y_org;
+ *y = _xin_info[i].y_org;
if (w)
- *w = _xin_info[i].width;
+ *w = _xin_info[i].width;
if (h)
- *h = _xin_info[i].height;
+ *h = _xin_info[i].height;
return EINA_TRUE;
}
@@ -70,16 +74,16 @@ ecore_x_xinerama_screen_geometry_get(int screen, int *x, int *y, int *w, int *h)
#endif /* ifdef ECORE_XINERAMA */
if (x)
- *x = 0;
+ *x = 0;
if (y)
- *y = 0;
+ *y = 0;
if (w)
- *w = DisplayWidth(_ecore_x_disp, 0);
+ *w = DisplayWidth(_ecore_x_disp, 0);
if (h)
- *h = DisplayHeight(_ecore_x_disp, 0);
+ *h = DisplayHeight(_ecore_x_disp, 0);
return EINA_FALSE;
screen = 0;