Make ecore_x atoms public.

SVN revision: 12352
This commit is contained in:
Kim Woelders 2004-12-04 10:10:29 +00:00
parent 23f1dc55f4
commit 1611c78704
14 changed files with 883 additions and 837 deletions

View File

@ -10,3 +10,4 @@ Nicholas Curran <quasar@bigblue.net.au>
Howell Tam <pigeon@pigeond.net>
Nathan Ingersoll <rbdpngn@users.sourceforge.net>
Andrew Elcock <andy@elcock.org>
Kim Woelders <kim@woelders.dk>

View File

@ -639,7 +639,6 @@ extern EAPI int ECORE_X_LOCK_SCROLL;
extern EAPI int ECORE_X_LOCK_NUM;
extern EAPI int ECORE_X_LOCK_CAPS;
#ifndef _ECORE_X_PRIVATE_H
typedef enum _Ecore_X_WM_Protocol {
/**
* If enabled the window manager will be asked to send a
@ -651,9 +650,11 @@ typedef enum _Ecore_X_WM_Protocol {
* If enabled the window manager will be told that the window
* explicitly sets input focus.
*/
ECORE_X_WM_PROTOCOL_TAKE_FOCUS
ECORE_X_WM_PROTOCOL_TAKE_FOCUS,
/* Number of defined items */
ECORE_X_WM_PROTOCOL_NUM
} Ecore_X_WM_Protocol;
#endif
typedef enum _Ecore_X_Window_Input_Mode {
/** The window can never be focused */

View File

@ -0,0 +1,129 @@
/*
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
*/
#ifndef _ECORE_X_ATOMS_H
#define _ECORE_X_ATOMS_H
#include "Ecore_X.h"
/**
* @file
* @brief Ecore X atoms
*/
/* General */
extern Ecore_X_Atom ECORE_X_ATOM_UTF8_STRING;
extern Ecore_X_Atom ECORE_X_ATOM_FILE_NAME;
extern Ecore_X_Atom ECORE_X_ATOM_STRING;
extern Ecore_X_Atom ECORE_X_ATOM_TEXT;
extern Ecore_X_Atom ECORE_X_ATOM_COMPOUND_TEXT;
/* ICCCM */
extern Ecore_X_Atom ECORE_X_ATOM_WM_STATE;
extern Ecore_X_Atom ECORE_X_ATOM_WM_DELETE_WINDOW;
extern Ecore_X_Atom ECORE_X_ATOM_WM_TAKE_FOCUS;
extern Ecore_X_Atom ECORE_X_ATOM_WM_PROTOCOLS;
extern Ecore_X_Atom ECORE_X_ATOM_WM_CLASS;
extern Ecore_X_Atom ECORE_X_ATOM_WM_NAME;
extern Ecore_X_Atom ECORE_X_ATOM_WM_COMMAND;
extern Ecore_X_Atom ECORE_X_ATOM_WM_ICON_NAME;
extern Ecore_X_Atom ECORE_X_ATOM_WM_CLIENT_MACHINE;
extern Ecore_X_Atom ECORE_X_ATOM_WM_CHANGE_STATE;
extern Ecore_X_Atom ECORE_X_ATOM_WM_COLORMAP_WINDOWS;
extern Ecore_X_Atom ECORE_X_ATOM_WM_WINDOW_ROLE;
extern Ecore_X_Atom ECORE_X_ATOM_WM_HINTS;
extern Ecore_X_Atom ECORE_X_ATOM_WM_CLIENT_LEADER;
extern Ecore_X_Atom ECORE_X_ATOM_WM_TRANSIENT_FOR;
extern Ecore_X_Atom ECORE_X_ATOM_WM_SAVE_YOURSELF;
/* MWM */
extern Ecore_X_Atom ECORE_X_ATOM_MOTIF_WM_HINTS;
/* GNOME */
extern Ecore_X_Atom ECORE_X_ATOM_WIN_LAYER;
/* EWMH */
extern Ecore_X_Atom ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS;
extern Ecore_X_Atom ECORE_X_ATOM_NET_VIRTUAL_ROOTS;
extern Ecore_X_Atom ECORE_X_ATOM_NET_DESKTOP_NAMES;
extern Ecore_X_Atom ECORE_X_ATOM_NET_DESKTOP_GEOMETRY;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WORKAREA;
extern Ecore_X_Atom ECORE_X_ATOM_NET_CURRENT_DESKTOP;
extern Ecore_X_Atom ECORE_X_ATOM_NET_DESKTOP_VIEWPORT;
extern Ecore_X_Atom ECORE_X_ATOM_NET_SHOWING_DESKTOP;
extern Ecore_X_Atom ECORE_X_ATOM_NET_CLIENT_LIST;
extern Ecore_X_Atom ECORE_X_ATOM_NET_CLIENT_LIST_STACKING;
extern Ecore_X_Atom ECORE_X_ATOM_NET_ACTIVE_WINDOW;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_DESKTOP;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_ABOVE;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_BELOW;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_NAME;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_VISIBLE_NAME;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ICON_NAME;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_DESKTOP;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STRUT;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STRUT_PARTIAL;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ICON_GEOMETRY;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_ICON;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_PID;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_HANDLE_ICONS;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_USER_TIME;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DESKTOP;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DOCK;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_MENU;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_UTILITY;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_SPLASH;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DIALOG;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_OPACITY;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_MODAL;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_STICKY;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_SHADED;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_SKIP_TASKBAR;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_HIDDEN;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_FULLSCREEN;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_ABOVE;
extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_BELOW;
/* Selections */
extern Ecore_X_Atom ECORE_X_ATOM_SELECTION_PRIMARY;
extern Ecore_X_Atom ECORE_X_ATOM_SELECTION_SECONDARY;
extern Ecore_X_Atom ECORE_X_ATOM_SELECTION_CLIPBOARD;
extern Ecore_X_Atom ECORE_X_ATOM_SELECTION_PROP_PRIMARY;
extern Ecore_X_Atom ECORE_X_ATOM_SELECTION_PROP_SECONDARY;
extern Ecore_X_Atom ECORE_X_ATOM_SELECTION_PROP_CLIPBOARD;
/* DND */
extern Ecore_X_Atom ECORE_X_ATOM_SELECTION_XDND;
extern Ecore_X_Atom ECORE_X_ATOM_SELECTION_PROP_XDND;
extern Ecore_X_Atom ECORE_X_ATOM_XDND_AWARE;
extern Ecore_X_Atom ECORE_X_ATOM_XDND_ENTER;
extern Ecore_X_Atom ECORE_X_ATOM_XDND_TYPE_LIST;
extern Ecore_X_Atom ECORE_X_ATOM_XDND_POSITION;
extern Ecore_X_Atom ECORE_X_ATOM_XDND_ACTION_COPY;
extern Ecore_X_Atom ECORE_X_ATOM_XDND_ACTION_PRIVATE;
extern Ecore_X_Atom ECORE_X_ATOM_XDND_ACTION_ASK;
extern Ecore_X_Atom ECORE_X_ATOM_XDND_ACTION_LIST;
extern Ecore_X_Atom ECORE_X_ATOM_XDND_ACTION_DESCRIPTION;
extern Ecore_X_Atom ECORE_X_ATOM_XDND_STATUS;
extern Ecore_X_Atom ECORE_X_ATOM_XDND_LEAVE;
extern Ecore_X_Atom ECORE_X_ATOM_XDND_DROP;
extern Ecore_X_Atom ECORE_X_ATOM_XDND_FINISHED;
#endif /* _ECORE_X_ATOMS_H */

View File

@ -19,6 +19,7 @@ if BUILD_ECORE_X
lib_LTLIBRARIES = libecore_x.la
include_HEADERS = \
Ecore_X.h \
Ecore_X_Atoms.h \
Ecore_X_Cursor.h
libecore_x_la_SOURCES = \
@ -53,6 +54,7 @@ endif
EXTRA_DIST = \
Ecore_X.h \
Ecore_X_Atoms.h \
Ecore_X_Cursor.h \
ecore_x.c \
ecore_x_dnd.c \

View File

@ -1,6 +1,7 @@
#include "Ecore.h"
#include "ecore_x_private.h"
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
static int _ecore_x_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
static int _ecore_x_fd_handler_buf(void *data, Ecore_Fd_Handler *fd_handler);
@ -25,72 +26,48 @@ Window _ecore_x_event_last_win = 0;
int _ecore_x_event_last_root_x = 0;
int _ecore_x_event_last_root_y = 0;
/*
* ICCCM hints.
*/
Atom _ecore_x_atom_wm_state = 0;
Atom _ecore_x_atom_wm_delete_window = 0;
Atom _ecore_x_atom_wm_take_focus = 0;
Atom _ecore_x_atom_wm_protocols = 0;
Atom _ecore_x_atom_wm_class = 0;
Atom _ecore_x_atom_wm_name = 0;
Atom _ecore_x_atom_wm_command = 0;
Atom _ecore_x_atom_wm_icon_name = 0;
Atom _ecore_x_atom_wm_client_machine = 0;
Atom _ecore_x_atom_wm_change_state = 0;
Atom _ecore_x_atom_wm_colormap_windows = 0;
Atom _ecore_x_atom_wm_window_role = 0;
Atom _ecore_x_atom_wm_hints = 0;
Atom _ecore_x_atom_wm_client_leader = 0;
Atom _ecore_x_atom_wm_transient_for = 0;
Atom _ecore_x_atom_wm_save_yourself = 0;
/* FIXME - These are duplicates after making ecore atoms public */
Ecore_X_Atom ECORE_X_ATOM_FILE_NAME = 0;
Ecore_X_Atom ECORE_X_ATOM_STRING = 0;
Ecore_X_Atom ECORE_X_ATOM_TEXT = 0;
Ecore_X_Atom ECORE_X_ATOM_UTF8_STRING = 0;
Ecore_X_Atom ECORE_X_ATOM_COMPOUND_TEXT = 0;
Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
/*
* Motif hints.
*/
Atom _ecore_x_atom_motif_wm_hints = 0;
Ecore_X_Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
/*
* GNOME hints.
*/
Atom _ecore_x_atom_win_layer = 0;
Ecore_X_Atom ECORE_X_ATOM_WIN_LAYER = 0;
/*
* Other hints.
*/
Atom _ecore_x_atom_selection_primary = 0;
Atom _ecore_x_atom_selection_secondary = 0;
Atom _ecore_x_atom_selection_clipboard = 0;
Atom _ecore_x_atom_selection_prop_primary = 0;
Atom _ecore_x_atom_selection_prop_secondary = 0;
Atom _ecore_x_atom_selection_prop_clipboard = 0;
Ecore_X_Atom ECORE_X_ATOM_SELECTION_PRIMARY = 0;
Ecore_X_Atom ECORE_X_ATOM_SELECTION_SECONDARY = 0;
Ecore_X_Atom ECORE_X_ATOM_SELECTION_CLIPBOARD = 0;
Ecore_X_Atom ECORE_X_ATOM_SELECTION_PROP_PRIMARY = 0;
Ecore_X_Atom ECORE_X_ATOM_SELECTION_PROP_SECONDARY = 0;
Ecore_X_Atom ECORE_X_ATOM_SELECTION_PROP_CLIPBOARD = 0;
Atom _ecore_x_atom_selection_xdnd = 0;
Atom _ecore_x_atom_selection_prop_xdnd = 0;
Atom _ecore_x_atom_xdnd_aware = 0;
Atom _ecore_x_atom_xdnd_enter = 0;
Atom _ecore_x_atom_xdnd_type_list = 0;
Atom _ecore_x_atom_xdnd_position = 0;
Atom _ecore_x_atom_xdnd_action_copy = 0;
Atom _ecore_x_atom_xdnd_action_move = 0;
Atom _ecore_x_atom_xdnd_action_link = 0;
Atom _ecore_x_atom_xdnd_action_private = 0;
Atom _ecore_x_atom_xdnd_action_ask = 0;
Atom _ecore_x_atom_xdnd_action_list = 0;
Atom _ecore_x_atom_xdnd_action_description = 0;
Atom _ecore_x_atom_xdnd_proxy = 0;
Atom _ecore_x_atom_xdnd_status = 0;
Atom _ecore_x_atom_xdnd_drop = 0;
Atom _ecore_x_atom_xdnd_finished = 0;
Atom _ecore_x_atom_xdnd_leave = 0;
Atom _ecore_x_atom_file_name = 0;
Atom _ecore_x_atom_string = 0;
Atom _ecore_x_atom_text = 0;
Atom _ecore_x_atom_utf8_string = 0;
Atom _ecore_x_atom_compound_text = 0;
Ecore_X_Atom ECORE_X_ATOM_SELECTION_XDND = 0;
Ecore_X_Atom ECORE_X_ATOM_SELECTION_PROP_XDND = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_AWARE = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_ENTER = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_TYPE_LIST = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_POSITION = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_ACTION_COPY = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_ACTION_MOVE = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_ACTION_LINK = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_ACTION_PRIVATE = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_ACTION_ASK = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_ACTION_LIST = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_ACTION_DESCRIPTION = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_PROXY = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_STATUS = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_DROP = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_FINISHED = 0;
Ecore_X_Atom ECORE_X_ATOM_XDND_LEAVE = 0;
/* Xdnd atoms that need to be exposed to the application interface */
Ecore_X_Atom ECORE_X_DND_ACTION_COPY = 0;
@ -316,71 +293,71 @@ ecore_x_init(const char *name)
}
_ecore_x_filter_handler = ecore_event_filter_add(_ecore_x_event_filter_start, _ecore_x_event_filter_filter, _ecore_x_event_filter_end, NULL);
_ecore_x_atom_compound_text = XInternAtom(_ecore_x_disp, "COMPOUND_TEXT", False);
_ecore_x_atom_utf8_string = XInternAtom(_ecore_x_disp, "UTF8_STRING", False);
_ecore_x_atom_file_name = XInternAtom(_ecore_x_disp, "FILE_NAME", False);
_ecore_x_atom_string = XInternAtom(_ecore_x_disp, "STRING", False);
_ecore_x_atom_text = XInternAtom(_ecore_x_disp, "TEXT", False);
ECORE_X_ATOM_COMPOUND_TEXT = XInternAtom(_ecore_x_disp, "COMPOUND_TEXT", False);
ECORE_X_ATOM_UTF8_STRING = XInternAtom(_ecore_x_disp, "UTF8_STRING", False);
ECORE_X_ATOM_FILE_NAME = XInternAtom(_ecore_x_disp, "FILE_NAME", False);
ECORE_X_ATOM_STRING = XInternAtom(_ecore_x_disp, "STRING", False);
ECORE_X_ATOM_TEXT = XInternAtom(_ecore_x_disp, "TEXT", False);
_ecore_x_atom_wm_state = XInternAtom(_ecore_x_disp, "WM_STATE", False);
_ecore_x_atom_wm_delete_window = XInternAtom(_ecore_x_disp, "WM_DELETE_WINDOW", False);
_ecore_x_atom_wm_take_focus = XInternAtom(_ecore_x_disp, "WM_TAKE_FOCUS", False);
_ecore_x_atom_wm_protocols = XInternAtom(_ecore_x_disp, "WM_PROTOCOLS", False);
_ecore_x_atom_wm_class = XInternAtom(_ecore_x_disp, "WM_CLASS", False);
_ecore_x_atom_wm_name = XInternAtom(_ecore_x_disp, "WM_NAME", False);
_ecore_x_atom_wm_command = XInternAtom(_ecore_x_disp, "WM_COMMAND", False);
_ecore_x_atom_wm_icon_name = XInternAtom(_ecore_x_disp, "WM_ICON_NAME", False);
_ecore_x_atom_wm_client_machine = XInternAtom(_ecore_x_disp, "WM_CLIENT_MACHINE", False);
_ecore_x_atom_wm_change_state = XInternAtom(_ecore_x_disp, "WM_CHANGE_STATE", False);
_ecore_x_atom_wm_colormap_windows = XInternAtom(_ecore_x_disp, "WM_COLORMAP_WINDOWS", False);
_ecore_x_atom_wm_window_role = XInternAtom(_ecore_x_disp, "WM_WINDOW_ROLE", False);
_ecore_x_atom_wm_hints = XInternAtom(_ecore_x_disp, "WM_HINTS", False);
_ecore_x_atom_wm_client_leader = XInternAtom(_ecore_x_disp, "WM_CLIENT_LEADER", False);
_ecore_x_atom_wm_transient_for = XInternAtom(_ecore_x_disp, "WM_TRANSIENT_FOR", False);
_ecore_x_atom_wm_save_yourself = XInternAtom(_ecore_x_disp, "WM_SAVE_YOURSELF", False);
ECORE_X_ATOM_WM_STATE = XInternAtom(_ecore_x_disp, "WM_STATE", False);
ECORE_X_ATOM_WM_DELETE_WINDOW = XInternAtom(_ecore_x_disp, "WM_DELETE_WINDOW", False);
ECORE_X_ATOM_WM_TAKE_FOCUS = XInternAtom(_ecore_x_disp, "WM_TAKE_FOCUS", False);
ECORE_X_ATOM_WM_PROTOCOLS = XInternAtom(_ecore_x_disp, "WM_PROTOCOLS", False);
ECORE_X_ATOM_WM_CLASS = XInternAtom(_ecore_x_disp, "WM_CLASS", False);
ECORE_X_ATOM_WM_NAME = XInternAtom(_ecore_x_disp, "WM_NAME", False);
ECORE_X_ATOM_WM_COMMAND = XInternAtom(_ecore_x_disp, "WM_COMMAND", False);
ECORE_X_ATOM_WM_ICON_NAME = XInternAtom(_ecore_x_disp, "WM_ICON_NAME", False);
ECORE_X_ATOM_WM_CLIENT_MACHINE = XInternAtom(_ecore_x_disp, "WM_CLIENT_MACHINE", False);
ECORE_X_ATOM_WM_CHANGE_STATE = XInternAtom(_ecore_x_disp, "WM_CHANGE_STATE", False);
ECORE_X_ATOM_WM_COLORMAP_WINDOWS = XInternAtom(_ecore_x_disp, "WM_COLORMAP_WINDOWS", False);
ECORE_X_ATOM_WM_WINDOW_ROLE = XInternAtom(_ecore_x_disp, "WM_WINDOW_ROLE", False);
ECORE_X_ATOM_WM_HINTS = XInternAtom(_ecore_x_disp, "WM_HINTS", False);
ECORE_X_ATOM_WM_CLIENT_LEADER = XInternAtom(_ecore_x_disp, "WM_CLIENT_LEADER", False);
ECORE_X_ATOM_WM_TRANSIENT_FOR = XInternAtom(_ecore_x_disp, "WM_TRANSIENT_FOR", False);
ECORE_X_ATOM_WM_SAVE_YOURSELF = XInternAtom(_ecore_x_disp, "WM_SAVE_YOURSELF", False);
_ecore_x_atom_motif_wm_hints = XInternAtom(_ecore_x_disp, "_MOTIF_WM_HINTS", False);
ECORE_X_ATOM_MOTIF_WM_HINTS = XInternAtom(_ecore_x_disp, "_MOTIF_WM_HINTS", False);
_ecore_x_atom_win_layer = XInternAtom(_ecore_x_disp, "_WIN_LAYER", False);
ECORE_X_ATOM_WIN_LAYER = XInternAtom(_ecore_x_disp, "_WIN_LAYER", False);
/* Set up the _NET_... hints */
ecore_x_netwm_init();
/* This is just to be anal about naming conventions */
_ecore_x_atom_selection_primary = XA_PRIMARY;
_ecore_x_atom_selection_secondary = XA_SECONDARY;
_ecore_x_atom_selection_clipboard = XInternAtom(_ecore_x_disp, "CLIPBOARD", False);
_ecore_x_atom_selection_prop_primary = XInternAtom(_ecore_x_disp, "_ECORE_SELECTION_PRIMARY", False);
_ecore_x_atom_selection_prop_secondary = XInternAtom(_ecore_x_disp, "_ECORE_SELECTION_SECONDARY", False);
_ecore_x_atom_selection_prop_clipboard = XInternAtom(_ecore_x_disp, "_ECORE_SELECTION_CLIPBOARD", False);
_ecore_x_atom_selection_prop_xdnd = XInternAtom(_ecore_x_disp, "JXSelectionWindowProperty", False);
_ecore_x_atom_selection_xdnd = XInternAtom(_ecore_x_disp, "XdndSelection", False);
_ecore_x_atom_xdnd_aware = XInternAtom(_ecore_x_disp, "XdndAware", False);
_ecore_x_atom_xdnd_type_list = XInternAtom(_ecore_x_disp, "XdndTypeList", False);
_ecore_x_atom_xdnd_enter = XInternAtom(_ecore_x_disp, "XdndEnter", False);
_ecore_x_atom_xdnd_position = XInternAtom(_ecore_x_disp, "XdndPosition", False);
_ecore_x_atom_xdnd_action_copy = XInternAtom(_ecore_x_disp, "XdndActionCopy", False);
_ecore_x_atom_xdnd_action_move = XInternAtom(_ecore_x_disp, "XdndActionMove", False);
_ecore_x_atom_xdnd_action_private = XInternAtom(_ecore_x_disp, "XdndActionPrivate", False);
_ecore_x_atom_xdnd_action_ask = XInternAtom(_ecore_x_disp, "XdndActionAsk", False);
_ecore_x_atom_xdnd_action_list = XInternAtom(_ecore_x_disp, "XdndActionList", False);
_ecore_x_atom_xdnd_action_link = XInternAtom(_ecore_x_disp, "XdndActionLink", False);
_ecore_x_atom_xdnd_action_description = XInternAtom(_ecore_x_disp, "XdndActionDescription", False);
_ecore_x_atom_xdnd_proxy = XInternAtom(_ecore_x_disp, "XdndProxy", False);
_ecore_x_atom_xdnd_status = XInternAtom(_ecore_x_disp, "XdndStatus", False);
_ecore_x_atom_xdnd_leave = XInternAtom(_ecore_x_disp, "XdndLeave", False);
_ecore_x_atom_xdnd_drop = XInternAtom(_ecore_x_disp, "XdndDrop", False);
_ecore_x_atom_xdnd_finished = XInternAtom(_ecore_x_disp, "XdndFinished", False);
ECORE_X_ATOM_SELECTION_PRIMARY = XA_PRIMARY;
ECORE_X_ATOM_SELECTION_SECONDARY = XA_SECONDARY;
ECORE_X_ATOM_SELECTION_CLIPBOARD = XInternAtom(_ecore_x_disp, "CLIPBOARD", False);
ECORE_X_ATOM_SELECTION_PROP_PRIMARY = XInternAtom(_ecore_x_disp, "_ECORE_SELECTION_PRIMARY", False);
ECORE_X_ATOM_SELECTION_PROP_SECONDARY = XInternAtom(_ecore_x_disp, "_ECORE_SELECTION_SECONDARY", False);
ECORE_X_ATOM_SELECTION_PROP_CLIPBOARD = XInternAtom(_ecore_x_disp, "_ECORE_SELECTION_CLIPBOARD", False);
ECORE_X_ATOM_SELECTION_PROP_XDND = XInternAtom(_ecore_x_disp, "JXSelectionWindowProperty", False);
ECORE_X_ATOM_SELECTION_XDND = XInternAtom(_ecore_x_disp, "XdndSelection", False);
ECORE_X_ATOM_XDND_AWARE = XInternAtom(_ecore_x_disp, "XdndAware", False);
ECORE_X_ATOM_XDND_TYPE_LIST = XInternAtom(_ecore_x_disp, "XdndTypeList", False);
ECORE_X_ATOM_XDND_ENTER = XInternAtom(_ecore_x_disp, "XdndEnter", False);
ECORE_X_ATOM_XDND_POSITION = XInternAtom(_ecore_x_disp, "XdndPosition", False);
ECORE_X_ATOM_XDND_ACTION_COPY = XInternAtom(_ecore_x_disp, "XdndActionCopy", False);
ECORE_X_ATOM_XDND_ACTION_MOVE = XInternAtom(_ecore_x_disp, "XdndActionMove", False);
ECORE_X_ATOM_XDND_ACTION_PRIVATE = XInternAtom(_ecore_x_disp, "XdndActionPrivate", False);
ECORE_X_ATOM_XDND_ACTION_ASK = XInternAtom(_ecore_x_disp, "XdndActionAsk", False);
ECORE_X_ATOM_XDND_ACTION_LIST = XInternAtom(_ecore_x_disp, "XdndActionList", False);
ECORE_X_ATOM_XDND_ACTION_LINK = XInternAtom(_ecore_x_disp, "XdndActionLink", False);
ECORE_X_ATOM_XDND_ACTION_DESCRIPTION = XInternAtom(_ecore_x_disp, "XdndActionDescription", False);
ECORE_X_ATOM_XDND_PROXY = XInternAtom(_ecore_x_disp, "XdndProxy", False);
ECORE_X_ATOM_XDND_STATUS = XInternAtom(_ecore_x_disp, "XdndStatus", False);
ECORE_X_ATOM_XDND_LEAVE = XInternAtom(_ecore_x_disp, "XdndLeave", False);
ECORE_X_ATOM_XDND_DROP = XInternAtom(_ecore_x_disp, "XdndDrop", False);
ECORE_X_ATOM_XDND_FINISHED = XInternAtom(_ecore_x_disp, "XdndFinished", False);
/* Initialize the globally defined xdnd atoms */
ECORE_X_DND_ACTION_COPY = _ecore_x_atom_xdnd_action_copy;
ECORE_X_DND_ACTION_MOVE = _ecore_x_atom_xdnd_action_move;
ECORE_X_DND_ACTION_LINK = _ecore_x_atom_xdnd_action_link;
ECORE_X_DND_ACTION_ASK = _ecore_x_atom_xdnd_action_ask;
ECORE_X_DND_ACTION_PRIVATE = _ecore_x_atom_xdnd_action_private;
ECORE_X_DND_ACTION_COPY = ECORE_X_ATOM_XDND_ACTION_COPY;
ECORE_X_DND_ACTION_MOVE = ECORE_X_ATOM_XDND_ACTION_MOVE;
ECORE_X_DND_ACTION_LINK = ECORE_X_ATOM_XDND_ACTION_LINK;
ECORE_X_DND_ACTION_ASK = ECORE_X_ATOM_XDND_ACTION_ASK;
ECORE_X_DND_ACTION_PRIVATE = ECORE_X_ATOM_XDND_ACTION_PRIVATE;
_ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_DELETE_REQUEST] = _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_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_DELETE_REQUEST] = 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_selection_data_init();
_ecore_x_dnd_init();
@ -1231,7 +1208,7 @@ ecore_x_window_button_ungrab(Ecore_X_Window win, int button,
unsigned int b;
unsigned int m;
unsigned int locks[8];
int i, ev, shuffle = 0;
int i, shuffle = 0;
b = button;
if (b == 0) b = AnyButton;

View File

@ -1,6 +1,7 @@
#include "Ecore.h"
#include "ecore_x_private.h"
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
static Ecore_X_Selection_Data _xdnd_selection;
static Ecore_X_DND_Protocol *_xdnd;
@ -22,10 +23,10 @@ ecore_x_dnd_aware_set (Ecore_X_Window win, int on)
Atom prop_data = ECORE_X_DND_VERSION;
if (on)
ecore_x_window_prop_property_set(win, _ecore_x_atom_xdnd_aware,
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);
/* TODO: Add dnd typelist to window properties */
}
@ -35,7 +36,7 @@ ecore_x_dnd_version_get (Ecore_X_Window win)
unsigned char *prop_data;
int num;
if (ecore_x_window_prop_property_get(win, _ecore_x_atom_xdnd_aware,
if (ecore_x_window_prop_property_get(win, ECORE_X_ATOM_XDND_AWARE,
XA_ATOM, 32, &prop_data, &num))
{
int version = (int) *prop_data;
@ -62,14 +63,14 @@ ecore_x_dnd_begin (Ecore_X_Window source, unsigned char *data, int size)
return 0;
/* Take ownership of XdndSelection */
XSetSelectionOwner(_ecore_x_disp, _ecore_x_atom_selection_xdnd, source,
XSetSelectionOwner(_ecore_x_disp, ECORE_X_ATOM_SELECTION_XDND, source,
_ecore_x_event_last_time);
if (XGetSelectionOwner(_ecore_x_disp, _ecore_x_atom_selection_xdnd) != source)
if (XGetSelectionOwner(_ecore_x_disp, ECORE_X_ATOM_SELECTION_XDND) != source)
return 0;
/* Initialize Selection Data Struct */
_xdnd_selection.win = source;
_xdnd_selection.selection = _ecore_x_atom_selection_xdnd;
_xdnd_selection.selection = ECORE_X_ATOM_SELECTION_XDND;
_xdnd_selection.length = size;
_xdnd_selection.time = _ecore_x_event_last_time;
@ -82,7 +83,7 @@ ecore_x_dnd_begin (Ecore_X_Window source, unsigned char *data, int size)
_xdnd->time = _ecore_x_event_last_time;
/* Default Accepted Action: ask */
_xdnd->action = _ecore_x_atom_xdnd_action_ask;
_xdnd->action = ECORE_X_ATOM_XDND_ACTION_ASK;
_xdnd->accepted_action = None;
/* TODO: Set supported data types in API */
@ -113,7 +114,7 @@ ecore_x_dnd_send_status(int will_accept, int suppress, Ecore_X_Rectangle rectang
xev.xclient.type = ClientMessage;
xev.xclient.display = _ecore_x_disp;
xev.xclient.message_type = _ecore_x_atom_xdnd_status;
xev.xclient.message_type = ECORE_X_ATOM_XDND_STATUS;
xev.xclient.format = 32;
xev.xclient.window = _xdnd->source;
@ -166,7 +167,7 @@ _ecore_x_dnd_drag(int x, int y)
if ((win != _xdnd->dest) && (_xdnd->dest))
{
xev.xclient.window = _xdnd->dest;
xev.xclient.message_type = _ecore_x_atom_xdnd_leave;
xev.xclient.message_type = ECORE_X_ATOM_XDND_LEAVE;
xev.xclient.data.l[0] = _xdnd->source;
XSendEvent(_ecore_x_disp, _xdnd->dest, False, 0, &xev);
@ -182,7 +183,7 @@ _ecore_x_dnd_drag(int x, int y)
/* Entered new window, send XdndEnter */
xev.xclient.window = win;
xev.xclient.message_type = _ecore_x_atom_xdnd_enter;
xev.xclient.message_type = ECORE_X_ATOM_XDND_ENTER;
xev.xclient.data.l[0] = _xdnd->source;
if(_xdnd->num_types > 3)
xev.xclient.data.l[1] |= 0x1UL;
@ -200,7 +201,7 @@ _ecore_x_dnd_drag(int x, int y)
/*if (!_xdnd->await_status)
{*/
xev.xclient.window = win;
xev.xclient.message_type = _ecore_x_atom_xdnd_position;
xev.xclient.message_type = ECORE_X_ATOM_XDND_POSITION;
xev.xclient.data.l[0] = _xdnd->source;
xev.xclient.data.l[1] = 0; /* Reserved */
xev.xclient.data.l[2] = ((x << 16) & 0xffff0000) | (y & 0xffff);
@ -218,7 +219,7 @@ _ecore_x_dnd_drag(int x, int y)
if (_xdnd->will_accept)
{
xev.xclient.window = win;
xev.xclient.message_type = _ecore_x_atom_xdnd_drop;
xev.xclient.message_type = ECORE_X_ATOM_XDND_DROP;
xev.xclient.data.l[0] = _xdnd->source;
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = CurrentTime;
@ -229,7 +230,7 @@ _ecore_x_dnd_drag(int x, int y)
else
{
xev.xclient.window = win;
xev.xclient.message_type = _ecore_x_atom_xdnd_leave;
xev.xclient.message_type = ECORE_X_ATOM_XDND_LEAVE;
xev.xclient.data.l[0] = _xdnd->source;
memset(xev.xclient.data.l + 1, 0, sizeof(long) * 3); /* Evil */
XSendEvent(_ecore_x_disp, win, False, 0, &xev);
@ -250,7 +251,7 @@ _ecore_x_dnd_send_finished(void)
xev.xany.type = ClientMessage;
xev.xany.display = _ecore_x_disp;
xev.xclient.window = _xdnd->source;
xev.xclient.message_type = _ecore_x_atom_xdnd_finished;
xev.xclient.message_type = ECORE_X_ATOM_XDND_FINISHED;
xev.xclient.format = 32;
xev.xclient.data.l[0] = _xdnd->dest;
@ -261,7 +262,7 @@ _ecore_x_dnd_send_finished(void)
int
_ecore_x_dnd_own_selection(void)
{
return (!XSetSelectionOwner(_ecore_x_disp, _ecore_x_atom_selection_xdnd,
return (!XSetSelectionOwner(_ecore_x_disp, ECORE_X_ATOM_SELECTION_XDND,
_xdnd->source, CurrentTime));
}
#endif

View File

@ -5,6 +5,7 @@
#include "Ecore.h"
#include "ecore_x_private.h"
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
#if 0
static void _ecore_x_event_free_window_prop_name_class_change(void *data, void *ev);
@ -871,7 +872,7 @@ _ecore_x_event_handle_property_notify(XEvent *xevent)
#if 0 /* for now i disabled this. nice idea though this is - it leaves a lot
* to be desired for efficiency that is better left to the app layer
*/
if (xevent->xproperty.atom == _ecore_x_atom_wm_class)
if (xevent->xproperty.atom == ECORE_X_ATOM_WM_CLASS)
{
Ecore_X_Event_Window_Prop_Name_Class_Change *e;
@ -883,7 +884,7 @@ _ecore_x_event_handle_property_notify(XEvent *xevent)
_ecore_x_event_last_time = e->time;
ecore_event_add(ECORE_X_EVENT_WINDOW_PROP_NAME_CLASS_CHANGE, e, _ecore_x_event_free_window_prop_name_class_change, NULL);
}
else if ((xevent->xproperty.atom == _ecore_x_atom_wm_name) || (xevent->xproperty.atom == _ecore_x_atom_net_wm_name))
else if ((xevent->xproperty.atom == ECORE_X_ATOM_WM_NAME) || (xevent->xproperty.atom == ECORE_X_ATOM_NET_WM_NAME))
{
Ecore_X_Event_Window_Prop_Title_Change *e;
@ -894,7 +895,7 @@ _ecore_x_event_handle_property_notify(XEvent *xevent)
_ecore_x_event_last_time = e->time;
ecore_event_add(ECORE_X_EVENT_WINDOW_PROP_TITLE_CHANGE, e, _ecore_x_event_free_window_prop_title_change, NULL);
}
else if (xevent->xproperty.atom == _ecore_x_atom_net_wm_visible_name)
else if (xevent->xproperty.atom == ECORE_X_ATOM_NET_WM_VISIBLE_NAME)
{
Ecore_X_Event_Window_Prop_Visible_Title_Change *e;
@ -905,7 +906,7 @@ _ecore_x_event_handle_property_notify(XEvent *xevent)
_ecore_x_event_last_time = e->time;
ecore_event_add(ECORE_X_EVENT_WINDOW_PROP_VISIBLE_TITLE_CHANGE, e, _ecore_x_event_free_window_prop_visible_title_change, NULL);
}
else if ((xevent->xproperty.atom == _ecore_x_atom_wm_icon_name) || (xevent->xproperty.atom == _ecore_x_atom_net_wm_icon_name))
else if ((xevent->xproperty.atom == ECORE_X_ATOM_WM_ICON_NAME) || (xevent->xproperty.atom == ECORE_X_ATOM_NET_WM_ICON_NAME))
{
Ecore_X_Event_Window_Prop_Icon_Name_Change *e;
@ -916,7 +917,7 @@ _ecore_x_event_handle_property_notify(XEvent *xevent)
_ecore_x_event_last_time = e->time;
ecore_event_add(ECORE_X_EVENT_WINDOW_PROP_ICON_NAME_CHANGE, e, _ecore_x_event_free_window_prop_icon_name_change, NULL);
}
else if (xevent->xproperty.atom == _ecore_x_atom_net_wm_visible_icon_name)
else if (xevent->xproperty.atom == ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME)
{
Ecore_X_Event_Window_Prop_Visible_Icon_Name_Change *e;
@ -927,7 +928,7 @@ _ecore_x_event_handle_property_notify(XEvent *xevent)
_ecore_x_event_last_time = e->time;
ecore_event_add(ECORE_X_EVENT_WINDOW_PROP_VISIBLE_ICON_NAME_CHANGE, e, _ecore_x_event_free_window_prop_visible_icon_name_change, NULL);
}
else if (xevent->xproperty.atom == _ecore_x_atom_wm_client_machine)
else if (xevent->xproperty.atom == ECORE_X_ATOM_WM_CLIENT_MACHINE)
{
Ecore_X_Event_Window_Prop_Client_Machine_Change *e;
@ -938,7 +939,7 @@ _ecore_x_event_handle_property_notify(XEvent *xevent)
_ecore_x_event_last_time = e->time;
ecore_event_add(ECORE_X_EVENT_WINDOW_PROP_CLIENT_MACHINE_CHANGE, e, _ecore_x_event_free_window_prop_client_machine_change, NULL);
}
else if (xevent->xproperty.atom == _ecore_x_atom_net_wm_pid)
else if (xevent->xproperty.atom == ECORE_X_ATOM_NET_WM_PID)
{
Ecore_X_Event_Window_Prop_Pid_Change *e;
@ -949,7 +950,7 @@ _ecore_x_event_handle_property_notify(XEvent *xevent)
_ecore_x_event_last_time = e->time;
ecore_event_add(ECORE_X_EVENT_WINDOW_PROP_PID_CHANGE, e, NULL, NULL);
}
else if (xevent->xproperty.atom == _ecore_x_atom_net_wm_desktop)
else if (xevent->xproperty.atom == ECORE_X_ATOM_NET_WM_DESKTOP)
{
Ecore_X_Event_Window_Prop_Desktop_Change *e;
@ -993,9 +994,9 @@ _ecore_x_event_handle_selection_clear(XEvent *xevent)
e->win = xevent->xselectionclear.window;
e->time = xevent->xselectionclear.time;
sel = xevent->xselectionclear.selection;
if (sel == _ecore_x_atom_selection_primary)
if (sel == ECORE_X_ATOM_SELECTION_PRIMARY)
e->selection = ECORE_X_SELECTION_PRIMARY;
else if (sel == _ecore_x_atom_selection_secondary)
else if (sel == ECORE_X_ATOM_SELECTION_SECONDARY)
e->selection = ECORE_X_SELECTION_SECONDARY;
else
e->selection = ECORE_X_SELECTION_CLIPBOARD;
@ -1067,11 +1068,11 @@ _ecore_x_event_handle_selection_notify(XEvent *xevent)
e->time = xevent->xselection.time;
e->target = _ecore_x_selection_target_get(xevent->xselection.target);
selection = xevent->xselection.selection;
if (selection == _ecore_x_atom_selection_primary)
if (selection == ECORE_X_ATOM_SELECTION_PRIMARY)
e->selection = ECORE_X_SELECTION_PRIMARY;
else if (selection == _ecore_x_atom_selection_secondary)
else if (selection == ECORE_X_ATOM_SELECTION_SECONDARY)
e->selection = ECORE_X_SELECTION_SECONDARY;
else if (selection == _ecore_x_atom_selection_clipboard)
else if (selection == ECORE_X_ATOM_SELECTION_CLIPBOARD)
e->selection = ECORE_X_SELECTION_CLIPBOARD;
else
{
@ -1118,9 +1119,9 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
/* checks here and generate synthetic events per special message known */
/* otherwise generate generic client message event. this would handle*/
/* netwm, ICCCM, gnomewm, old kde and mwm hint client message protocols */
if ((xevent->xclient.message_type == _ecore_x_atom_wm_protocols) &&
if ((xevent->xclient.message_type == ECORE_X_ATOM_WM_PROTOCOLS) &&
(xevent->xclient.format == 32) &&
(xevent->xclient.data.l[0] == (long)_ecore_x_atom_wm_delete_window))
(xevent->xclient.data.l[0] == (long)ECORE_X_ATOM_WM_DELETE_WINDOW))
{
Ecore_X_Event_Window_Delete_Request *e;
@ -1133,7 +1134,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
/* Xdnd Client Message Handling Begin */
/* Message Type: XdndEnter */
else if (xevent->xclient.message_type == _ecore_x_atom_xdnd_enter)
else if (xevent->xclient.message_type == ECORE_X_ATOM_XDND_ENTER)
{
Ecore_X_Event_Xdnd_Enter *e;
Ecore_X_DND_Protocol *_xdnd;
@ -1157,7 +1158,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
Atom *types;
int i, num_ret;
if (!(ecore_x_window_prop_property_get(_xdnd->source,
_ecore_x_atom_xdnd_type_list,
ECORE_X_ATOM_XDND_TYPE_LIST,
XA_ATOM,
32,
&data,
@ -1194,7 +1195,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
}
/* Message Type: XdndPosition */
else if (xevent->xclient.message_type == _ecore_x_atom_xdnd_position)
else if (xevent->xclient.message_type == ECORE_X_ATOM_XDND_POSITION)
{
Ecore_X_Event_Xdnd_Position *e;
Ecore_X_DND_Protocol *_xdnd;
@ -1222,7 +1223,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
}
/* Message Type: XdndStatus */
else if (xevent->xclient.message_type == _ecore_x_atom_xdnd_status)
else if (xevent->xclient.message_type == ECORE_X_ATOM_XDND_STATUS)
{
Ecore_X_Event_Xdnd_Status *e;
Ecore_X_DND_Protocol *_xdnd;
@ -1258,7 +1259,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
/* Message Type: XdndLeave */
/* Pretend the whole thing never happened, sort of */
else if (xevent->xclient.message_type == _ecore_x_atom_xdnd_leave)
else if (xevent->xclient.message_type == ECORE_X_ATOM_XDND_LEAVE)
{
Ecore_X_Event_Xdnd_Leave *e;
Ecore_X_DND_Protocol *_xdnd;
@ -1280,7 +1281,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
e->source = _xdnd->source;
ecore_event_add(ECORE_X_EVENT_XDND_LEAVE, e, NULL, NULL);
}
else if (xevent->xclient.message_type == _ecore_x_atom_xdnd_drop)
else if (xevent->xclient.message_type == ECORE_X_ATOM_XDND_DROP)
{
Ecore_X_Event_Xdnd_Drop *e;
Ecore_X_DND_Protocol *_xdnd;
@ -1295,8 +1296,8 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
timestamp = (_xdnd->version >= 1) ?
xevent->xclient.data.l[2] : _ecore_x_event_last_time;
XConvertSelection(_ecore_x_disp, _ecore_x_atom_selection_xdnd,
_xdnd->dest, _ecore_x_atom_selection_prop_xdnd, _xdnd->dest,
XConvertSelection(_ecore_x_disp, ECORE_X_ATOM_SELECTION_XDND,
_xdnd->dest, ECORE_X_ATOM_SELECTION_PROP_XDND, _xdnd->dest,
timestamp);
/* FIXME: Have to wait for SelectionNotify before we can send
@ -1314,7 +1315,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
}
/* Message Type: XdndFinished */
else if (xevent->xclient.message_type == _ecore_x_atom_xdnd_finished)
else if (xevent->xclient.message_type == ECORE_X_ATOM_XDND_FINISHED)
{
Ecore_X_Event_Xdnd_Finished *e;
Ecore_X_DND_Protocol *_xdnd;

View File

@ -7,6 +7,25 @@
#include "Ecore.h"
#include "ecore_x_private.h"
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
/* Atoms */
Ecore_X_Atom ECORE_X_ATOM_WM_STATE = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_DELETE_WINDOW = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_TAKE_FOCUS = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_PROTOCOLS = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_CLASS = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_NAME = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_COMMAND = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_ICON_NAME = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_CLIENT_MACHINE = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_CHANGE_STATE = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_COLORMAP_WINDOWS = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_WINDOW_ROLE = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_HINTS = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_CLIENT_LEADER = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_TRANSIENT_FOR = 0;
Ecore_X_Atom ECORE_X_ATOM_WM_SAVE_YOURSELF = 0;
void
ecore_x_icccm_state_set(Ecore_X_Window win, Ecore_X_Window_State_Hint state)
@ -14,47 +33,46 @@ ecore_x_icccm_state_set(Ecore_X_Window win, Ecore_X_Window_State_Hint state)
unsigned long c[2];
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] = 0;
XChangeProperty(_ecore_x_disp, win, _ecore_x_atom_wm_state,
_ecore_x_atom_wm_state, 32, PropModeReplace,
XChangeProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_STATE,
ECORE_X_ATOM_WM_STATE, 32, PropModeReplace,
(unsigned char *)c, 2);
}
void
ecore_x_icccm_delete_window_send(Ecore_X_Window win, Ecore_X_Time t)
{
ecore_x_client_message32_send(win, _ecore_x_atom_wm_protocols,
_ecore_x_atom_wm_delete_window,
ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
ECORE_X_ATOM_WM_DELETE_WINDOW,
CurrentTime, 0, 0, 0);
}
void
ecore_x_icccm_take_focus_send(Ecore_X_Window win, Ecore_X_Time t)
{
ecore_x_client_message32_send(win, _ecore_x_atom_wm_protocols,
_ecore_x_atom_wm_take_focus,
ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
ECORE_X_ATOM_WM_TAKE_FOCUS,
CurrentTime, 0, 0, 0);
}
void
ecore_x_icccm_save_yourself_send(Ecore_X_Window win, Ecore_X_Time t)
{
ecore_x_client_message32_send(win, _ecore_x_atom_wm_protocols,
_ecore_x_atom_wm_save_yourself,
ecore_x_client_message32_send(win, ECORE_X_ATOM_WM_PROTOCOLS,
ECORE_X_ATOM_WM_SAVE_YOURSELF,
CurrentTime, 0, 0, 0);
}
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;
ev.type = ConfigureNotify;
ev.xconfigure.display = _ecore_x_disp;
ev.xconfigure.event = win;
@ -67,7 +85,7 @@ ecore_x_icccm_move_resize_send(Ecore_X_Window win,
ev.xconfigure.above = win;
ev.xconfigure.override_redirect = False;
XSendEvent(_ecore_x_disp, win, False, StructureNotifyMask, &ev);
}
}
void
ecore_x_icccm_hints_set(Ecore_X_Window win,
@ -76,22 +94,22 @@ ecore_x_icccm_hints_set(Ecore_X_Window win,
Ecore_X_Pixmap icon_pixmap,
Ecore_X_Pixmap icon_mask,
Ecore_X_Window icon_window,
Ecore_X_Window window_group,
int is_urgent)
Ecore_X_Window window_group, int is_urgent)
{
XWMHints *hints;
XWMHints *hints;
hints = XAllocWMHints();
if (!hints) return;
if (!hints)
return;
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)
{
hints->icon_pixmap = icon_pixmap;
@ -113,7 +131,7 @@ ecore_x_icccm_hints_set(Ecore_X_Window win,
hints->flags |= WindowGroupHint;
}
if (is_urgent)
hints->flags |= XUrgencyHint;
hints->flags |= XUrgencyHint;
XSetWMHints(_ecore_x_disp, win, hints);
XFree(hints);
}
@ -121,40 +139,46 @@ ecore_x_icccm_hints_set(Ecore_X_Window win,
int
ecore_x_icccm_hints_get(Ecore_X_Window win,
int *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,
int *is_urgent)
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, int *is_urgent)
{
XWMHints *hints;
if (accepts_focus) *accepts_focus = 0;
if (initial_state) *initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
if (icon_pixmap) *icon_pixmap = 0;
if (icon_mask) *icon_mask = 0;
if (icon_window) *icon_window = 0;
if (window_group) *window_group = 0;
if (is_urgent) *is_urgent = 0;
if (accepts_focus)
*accepts_focus = 0;
if (initial_state)
*initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
if (icon_pixmap)
*icon_pixmap = 0;
if (icon_mask)
*icon_mask = 0;
if (icon_window)
*icon_window = 0;
if (window_group)
*window_group = 0;
if (is_urgent)
*is_urgent = 0;
hints = XGetWMHints(_ecore_x_disp, win);
if (hints)
{
if ((hints->flags & InputHint) && (accepts_focus))
{
if (hints->input)
*accepts_focus = 1;
*accepts_focus = 1;
else
*accepts_focus = 0;
*accepts_focus = 0;
}
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))
{
@ -184,18 +208,17 @@ ecore_x_icccm_hints_get(Ecore_X_Window win,
void
ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win,
int request_pos,
int 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)
double min_aspect, double max_aspect)
{
/* FIXME: working here */
XSizeHints hint;
XSizeHints hint;
hint.flags = 0;
if (request_pos)
{
@ -244,39 +267,43 @@ ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win,
int
ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
int *request_pos,
Ecore_X_Gravity *gravity,
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)
double *min_aspect, double *max_aspect)
{
XSizeHints hint;
long mask;
int minw = 0, minh = 0;
int maxw = 32767, maxh = 32767;
int basew = 0, baseh = 0;
int stepx = 1, stepy = 1;
double mina = 0.0, maxa = 0.0;
if (XGetWMNormalHints(_ecore_x_disp, win, &hint, &mask) < Success) return 0;
int minw = 0, minh = 0;
int maxw = 32767, maxh = 32767;
int basew = 0, baseh = 0;
int stepx = 1, stepy = 1;
double mina = 0.0, maxa = 0.0;
if (XGetWMNormalHints(_ecore_x_disp, win, &hint, &mask) < Success)
return 0;
if ((hint.flags & USPosition) || ((hint.flags & PPosition)))
{
if (request_pos) *request_pos = 1;
if (request_pos)
*request_pos = 1;
}
else
{
if (request_pos) *request_pos = 0;
if (request_pos)
*request_pos = 0;
}
if (hint.flags & PWinGravity)
{
if (gravity) *gravity = hint.win_gravity;
if (gravity)
*gravity = hint.win_gravity;
}
else
{
if (gravity) *gravity = ECORE_X_GRAVITY_NW;
if (gravity)
*gravity = ECORE_X_GRAVITY_NW;
}
if (hint.flags & PMinSize)
{
@ -287,56 +314,76 @@ ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
{
maxw = hint.max_width;
maxh = hint.max_height;
if (maxw < minw) maxw = minw;
if (maxh < minh) maxh = minh;
if (maxw < minw)
maxw = minw;
if (maxh < minh)
maxh = minh;
}
if (hint.flags & PBaseSize)
{
basew = hint.base_width;
baseh = hint.base_height;
if (basew > minw) minw = basew;
if (baseh > minh) minh = baseh;
if (basew > minw)
minw = basew;
if (baseh > minh)
minh = baseh;
}
if (hint.flags & PResizeInc)
{
stepx = hint.width_inc;
stepy = hint.height_inc;
if (stepx < 1) stepx = 1;
if (stepy < 1) stepy = 1;
if (stepx < 1)
stepx = 1;
if (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;
if (min_h) *min_h = minh;
if (max_w) *max_w = maxw;
if (max_h) *max_h = maxh;
if (base_w) *base_w = basew;
if (base_h) *base_h = baseh;
if (step_x) *step_x = stepx;
if (step_y) *step_y = stepy;
if (min_aspect) *min_aspect = mina;
if (max_aspect) *max_aspect = maxa;
if (min_w)
*min_w = minw;
if (min_h)
*min_h = minh;
if (max_w)
*max_w = maxw;
if (max_h)
*max_h = maxh;
if (base_w)
*base_w = basew;
if (base_h)
*base_h = baseh;
if (step_x)
*step_x = stepx;
if (step_y)
*step_y = stepy;
if (min_aspect)
*min_aspect = mina;
if (max_aspect)
*max_aspect = maxa;
return 1;
}
void
ecore_x_icccm_title_set(Ecore_X_Window win, const char *t)
{
char *list[1];
XTextProperty xprop;
int ret;
char *list[1];
XTextProperty xprop;
int ret;
#ifdef X_HAVE_UTF8_STRING
list[0] = strdup(t);
ret = Xutf8TextListToTextProperty(_ecore_x_disp, list, 1, XUTF8StringStyle, &xprop);
ret =
Xutf8TextListToTextProperty(_ecore_x_disp, list, 1, XUTF8StringStyle,
&xprop);
#else
list[0] = strdup(t);
ret = XmbTextListToTextProperty(_ecore_x_disp, list, 1, XStdICCTextStyle, &xprop);
ret =
XmbTextListToTextProperty(_ecore_x_disp, list, 1, XStdICCTextStyle,
&xprop);
#endif
if (ret >= Success)
{
@ -354,41 +401,40 @@ ecore_x_icccm_title_set(Ecore_X_Window win, const char *t)
free(list[0]);
}
char *
char *
ecore_x_icccm_title_get(Ecore_X_Window win)
{
XTextProperty xprop;
XTextProperty xprop;
if (XGetWMName(_ecore_x_disp, win, &xprop) >= Success)
{
if (xprop.value)
{
char **list = NULL;
char *t = NULL;
int num = 0;
if (xprop.encoding == _ecore_x_atom_string)
char **list = NULL;
char *t = NULL;
int num = 0;
if (xprop.encoding == ECORE_X_ATOM_STRING)
{
t = strdup(xprop.value);
}
else if (xprop.encoding == _ecore_x_atom_utf8_string)
else if (xprop.encoding == ECORE_X_ATOM_UTF8_STRING)
{
t = strdup(xprop.value);
}
else
{
int ret;
int ret;
#ifdef X_HAVE_UTF8_STRING
ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
ret = Xutf8TextPropertyToTextList(_ecore_x_disp, &xprop,
&list, &num);
#else
ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
#else
ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
&list, &num);
#endif
#endif
if ((ret == XLocaleNotSupported) ||
(ret == XNoMemory) ||
(ret == XConverterNotFound))
(ret == XNoMemory) || (ret == XConverterNotFound))
{
t = strdup(xprop.value);
}
@ -399,7 +445,8 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
/* FIXME: convert to utf8 */
t = strdup(list[0]);
}
if (list) XFreeStringList(list);
if (list)
XFreeStringList(list);
}
}
XFree(xprop.value);
@ -417,14 +464,13 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
*/
void
ecore_x_icccm_protocol_set(Ecore_X_Window win,
Ecore_X_WM_Protocol protocol,
int on)
Ecore_X_WM_Protocol protocol, int on)
{
Atom *protos = NULL;
Atom proto;
int protos_count = 0;
int already_set = 0;
int i;
Atom *protos = NULL;
Atom proto;
int protos_count = 0;
int already_set = 0;
int i;
/* Check for invalid values */
if (protocol < 0 || protocol >= ECORE_X_WM_PROTOCOL_NUM)
@ -433,62 +479,64 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
proto = _ecore_x_atoms_wm_protocols[protocol];
if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
{
protos = NULL;
protos_count = 0;
}
{
protos = NULL;
protos_count = 0;
}
for (i = 0; i < protos_count; i++)
{
if (protos[i] == proto)
{
already_set = 1;
break;
}
}
{
if (protos[i] == proto)
{
already_set = 1;
break;
}
}
if (on)
{
Atom *new_protos = NULL;
{
Atom *new_protos = NULL;
if (already_set) goto leave;
new_protos = malloc((protos_count + 1) * sizeof(Atom));
if (!new_protos) goto leave;
for (i = 0; i < protos_count; i++)
new_protos[i] = protos[i];
new_protos[protos_count] = proto;
XSetWMProtocols(_ecore_x_disp, win, new_protos, protos_count + 1);
free(new_protos);
}
if (already_set)
goto leave;
new_protos = malloc((protos_count + 1) * sizeof(Atom));
if (!new_protos)
goto leave;
for (i = 0; i < protos_count; i++)
new_protos[i] = protos[i];
new_protos[protos_count] = proto;
XSetWMProtocols(_ecore_x_disp, win, new_protos, protos_count + 1);
free(new_protos);
}
else
{
if (!already_set) goto leave;
for (i = 0; i < protos_count; i++)
{
if (protos[i] == proto)
{
int j;
{
if (!already_set)
goto leave;
for (i = 0; i < protos_count; i++)
{
if (protos[i] == proto)
{
int j;
for (j = i + 1; j < protos_count; j++)
protos[j-1] = protos[j];
if (protos_count > 1)
XSetWMProtocols(_ecore_x_disp, win, protos,
protos_count - 1);
else
XDeleteProperty(_ecore_x_disp, win,
_ecore_x_atom_wm_protocols);
goto leave;
}
}
}
for (j = i + 1; j < protos_count; j++)
protos[j - 1] = protos[j];
if (protos_count > 1)
XSetWMProtocols(_ecore_x_disp, win, protos,
protos_count - 1);
else
XDeleteProperty(_ecore_x_disp, win,
ECORE_X_ATOM_WM_PROTOCOLS);
goto leave;
}
}
}
leave:
leave:
if (protos)
XFree(protos);
}
/**
* Determines whether a protocol is set for a window.
* @param win The Window
@ -496,11 +544,10 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
* @return 1 if the protocol is set, else 0.
*/
int
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, ret = 0, protos_count = 0;
Atom proto, *protos = NULL;
int i, ret = 0, protos_count = 0;
/* check for invalid values */
if (protocol < 0 || protocol >= ECORE_X_WM_PROTOCOL_NUM)
@ -510,13 +557,13 @@ ecore_x_icccm_protocol_isset(Ecore_X_Window win,
if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
return 0;
for (i = 0; i < protos_count; i++)
if (protos[i] == proto)
{
ret = 1;
break;
}
{
ret = 1;
break;
}
XFree(protos);
return ret;
@ -532,11 +579,9 @@ ecore_x_icccm_protocol_isset(Ecore_X_Window win,
* Set a window name * class
*/
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;
XClassHint *xch;
xch = XAllocClassHint();
if (!xch)
@ -554,12 +599,12 @@ ecore_x_icccm_name_class_set(Ecore_X_Window win,
*
* Return the client machine of a window. String must be free'd when done with.
*/
char *
char *
ecore_x_icccm_client_machine_get(Ecore_X_Window win)
{
char *name;
char *name;
name = ecore_x_window_prop_string_get(win, _ecore_x_atom_wm_client_machine);
name = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_CLIENT_MACHINE);
return name;
}
@ -601,8 +646,8 @@ ecore_x_icccm_command_get(Ecore_X_Window win, int *argc, char ***argv)
void
ecore_x_icccm_icon_name_set(Ecore_X_Window win, const char *t)
{
ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_icon_name, (char *)t);
ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_icon_name,
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_ICON_NAME, (char *)t);
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_ICON_NAME,
(char *)t);
}
@ -613,13 +658,14 @@ ecore_x_icccm_icon_name_set(Ecore_X_Window win, const char *t)
*
* Return the icon name of a window. String must be free'd when done with.
*/
char *
char *
ecore_x_icccm_icon_name_get(Ecore_X_Window win)
{
char *name;
char *name;
name = ecore_x_window_prop_string_get(win, _ecore_x_atom_net_wm_icon_name);
if (!name) name = ecore_x_window_prop_string_get(win, _ecore_x_atom_wm_icon_name);
name = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_NET_WM_ICON_NAME);
if (!name)
name = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_ICON_NAME);
return name;
}
@ -631,53 +677,49 @@ ecore_x_icccm_icon_name_get(Ecore_X_Window win)
void
ecore_x_icccm_colormap_window_set(Ecore_X_Window win, Ecore_X_Window subwin)
{
int num = 0, i;
unsigned char *old_data = NULL;
unsigned char *data = NULL;
Window *oldset = NULL;
Window *newset = NULL;
if(!ecore_x_window_prop_property_get(win,
_ecore_x_atom_wm_colormap_windows,
XA_WINDOW,
32,
&old_data,
&num))
{
newset = calloc(1, sizeof(Window));
if (!newset) return;
newset[0] = subwin;
num = 1;
data = (unsigned char *)newset;
}
else
{
newset = calloc(num + 1, sizeof(Window));
oldset = (Window *) old_data;
if (!newset) return;
for (i = 0; i < num; ++i)
{
if (oldset[i] == subwin)
{
XFree(old_data);
free(newset);
return;
}
newset[i] = oldset[i];
}
int num = 0, i;
unsigned char *old_data = NULL;
unsigned char *data = NULL;
Window *oldset = NULL;
Window *newset = NULL;
newset[num++] = subwin;
XFree(old_data);
data = (unsigned char *)newset;
}
ecore_x_window_prop_property_set(win,
_ecore_x_atom_wm_colormap_windows,
XA_WINDOW,
32,
data,
num);
if (!ecore_x_window_prop_property_get(win,
ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
XA_WINDOW, 32, &old_data, &num))
{
newset = calloc(1, sizeof(Window));
if (!newset)
return;
newset[0] = subwin;
num = 1;
data = (unsigned char *)newset;
}
else
{
newset = calloc(num + 1, sizeof(Window));
oldset = (Window *) old_data;
if (!newset)
return;
for (i = 0; i < num; ++i)
{
if (oldset[i] == subwin)
{
XFree(old_data);
free(newset);
return;
}
newset[i] = oldset[i];
}
newset[num++] = subwin;
XFree(old_data);
data = (unsigned char *)newset;
}
ecore_x_window_prop_property_set(win,
ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
XA_WINDOW, 32, data, num);
free(newset);
}
@ -689,53 +731,46 @@ ecore_x_icccm_colormap_window_set(Ecore_X_Window win, Ecore_X_Window subwin)
void
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;
unsigned char *data = NULL;
Window *oldset = NULL;
Window *newset = NULL;
int num = 0, i, j, k = 0;
unsigned char *old_data = NULL;
unsigned char *data = NULL;
Window *oldset = NULL;
Window *newset = NULL;
if (!ecore_x_window_prop_property_get(win,
_ecore_x_atom_wm_colormap_windows,
XA_WINDOW,
32,
&old_data,
&num))
if (!ecore_x_window_prop_property_get(win,
ECORE_X_ATOM_WM_COLORMAP_WINDOWS,
XA_WINDOW, 32, &old_data, &num))
return;
oldset = (Window *) old_data;
for (i = 0; i < num; i++)
{
if (oldset[i] == subwin)
{
if (num == 1)
{
XDeleteProperty(_ecore_x_disp,
win,
_ecore_x_atom_wm_colormap_windows);
XFree(old_data);
return;
}
else
{
newset = calloc(num - 1, sizeof(Window));
data = (unsigned char *)newset;
for (j = 0; j < num; ++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);
XFree(old_data);
free(newset);
return;
}
}
}
{
if (oldset[i] == subwin)
{
if (num == 1)
{
XDeleteProperty(_ecore_x_disp,
win, ECORE_X_ATOM_WM_COLORMAP_WINDOWS);
XFree(old_data);
return;
}
else
{
newset = calloc(num - 1, sizeof(Window));
data = (unsigned char *)newset;
for (j = 0; j < num; ++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);
XFree(old_data);
free(newset);
return;
}
}
}
XFree(old_data);
}
@ -757,7 +792,7 @@ ecore_x_icccm_transient_for_set(Ecore_X_Window win, Ecore_X_Window forwin)
void
ecore_x_icccm_transient_for_unset(Ecore_X_Window win)
{
XDeleteProperty(_ecore_x_disp, win, _ecore_x_atom_wm_transient_for);
XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_TRANSIENT_FOR);
}
/**
@ -768,13 +803,13 @@ ecore_x_icccm_transient_for_unset(Ecore_X_Window win)
Ecore_X_Window
ecore_x_icccm_transient_for_get(Ecore_X_Window win)
{
Window forwin;
Window forwin;
if(XGetTransientForHint(_ecore_x_disp, win, &forwin))
if (XGetTransientForHint(_ecore_x_disp, win, &forwin))
return (Ecore_X_Window) forwin;
else
return 0;
}
/**
@ -785,8 +820,8 @@ ecore_x_icccm_transient_for_get(Ecore_X_Window win)
void
ecore_x_icccm_window_role_set(Ecore_X_Window win, const char *role)
{
ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_window_role,
(char *)role);
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_WINDOW_ROLE,
(char *)role);
}
/**
@ -794,11 +829,10 @@ ecore_x_icccm_window_role_set(Ecore_X_Window win, const char *role)
* @param win The window
* @return The window's role string.
*/
char *
char *
ecore_x_icccm_window_role_get(Ecore_X_Window win)
{
return ecore_x_window_prop_string_get(win,
_ecore_x_atom_wm_window_role);
return ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_WINDOW_ROLE);
}
/**
@ -813,8 +847,8 @@ void
ecore_x_icccm_client_leader_set(Ecore_X_Window win, Ecore_X_Window l)
{
ecore_x_window_prop_property_set(win,
_ecore_x_atom_wm_client_leader,
XA_WINDOW, 32, &l, 1);
ECORE_X_ATOM_WM_CLIENT_LEADER,
XA_WINDOW, 32, &l, 1);
}
/**
@ -824,19 +858,17 @@ ecore_x_icccm_client_leader_set(Ecore_X_Window win, Ecore_X_Window l)
Ecore_X_Window
ecore_x_icccm_client_leader_get(Ecore_X_Window win)
{
unsigned char *data;
int num;
if(ecore_x_window_prop_property_get(win,
_ecore_x_atom_wm_client_leader,
XA_WINDOW, 32, &data, &num))
return (Ecore_X_Window)*data;
unsigned char *data;
int num;
if (ecore_x_window_prop_property_get(win,
ECORE_X_ATOM_WM_CLIENT_LEADER,
XA_WINDOW, 32, &data, &num))
return (Ecore_X_Window) * data;
else
return 0;
}
/* FIXME: move these things in here as they are icccm related */
/* send iconify request */

View File

@ -7,6 +7,7 @@
#include "Ecore.h"
#include "ecore_x_private.h"
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
#define ECORE_X_MWM_HINTS_FUNCTIONS (1 << 0)
#define ECORE_X_MWM_HINTS_DECORATIONS (1 << 1)
@ -23,48 +24,51 @@ typedef struct _mwmhints
}
MWMHints;
/* Atoms */
Ecore_X_Atom ECORE_X_ATOM_MOTIF_WM_HINTS = 0;
int
ecore_x_mwm_hints_get(Ecore_X_Window win,
Ecore_X_MWM_Hint_Func *fhint,
Ecore_X_MWM_Hint_Decor *dhint,
Ecore_X_MWM_Hint_Input *ihint)
Ecore_X_MWM_Hint_Func * fhint,
Ecore_X_MWM_Hint_Decor * dhint,
Ecore_X_MWM_Hint_Input * ihint)
{
unsigned char *p = NULL;
MWMHints *mwmhints = NULL;
int num;
int ret;
unsigned char *p = NULL;
MWMHints *mwmhints = NULL;
int num;
int ret;
ret = 0;
if (!ecore_x_window_prop_property_get(win,
_ecore_x_atom_motif_wm_hints,
_ecore_x_atom_motif_wm_hints,
ECORE_X_ATOM_MOTIF_WM_HINTS,
ECORE_X_ATOM_MOTIF_WM_HINTS,
32, &p, &num))
return 0;
mwmhints = (MWMHints *)p;
return 0;
mwmhints = (MWMHints *) p;
if (mwmhints)
{
if (num >= 4)
{
if (dhint)
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 = 1;
}

View File

@ -4,6 +4,7 @@
#include "Ecore.h"
#include "ecore_x_private.h"
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
/*
* Convenience macros
@ -12,10 +13,10 @@
XInternAtom(_ecore_x_disp, name, False)
#define _ATOM_SET_UTF8_STRING(atom, win, string) \
XChangeProperty(_ecore_x_disp, win, atom, _ecore_x_atom_utf8_string, 8, PropModeReplace, \
XChangeProperty(_ecore_x_disp, win, atom, ECORE_X_ATOM_UTF8_STRING, 8, PropModeReplace, \
(unsigned char *)string, strlen(string))
#define _ATOM_SET_UTF8_STRING_LIST(atom, win, string, cnt) \
XChangeProperty(_ecore_x_disp, win, atom, _ecore_x_atom_utf8_string, 8, PropModeReplace, \
XChangeProperty(_ecore_x_disp, win, atom, ECORE_X_ATOM_UTF8_STRING, 8, PropModeReplace, \
(unsigned char *)string, cnt)
#define _ATOM_SET_WINDOW(atom, win, p_wins, cnt) \
XChangeProperty(_ecore_x_disp, win, atom, XA_WINDOW, 32, PropModeReplace, \
@ -27,7 +28,6 @@
XChangeProperty(_ecore_x_disp, win, atom, XA_CARDINAL, 32, PropModeReplace, \
(unsigned char *)p_val, cnt)
/*
* Convenience functions. Should probably go elsewhere.
*/
@ -36,7 +36,8 @@
* 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)
{
_ATOM_SET_UTF8_STRING(win, atom, str);
}
@ -44,7 +45,7 @@ _ecore_x_window_prop_string_utf8_set(Ecore_X_Window win, Ecore_X_Atom atom, cons
/*
* Get UTF-8 string property
*/
static char *
static char *
_ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, Ecore_X_Atom atom)
{
char *str;
@ -56,7 +57,7 @@ _ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, Ecore_X_Atom atom)
str = NULL;
prop_return = NULL;
XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
_ecore_x_atom_utf8_string, &type_ret,
ECORE_X_ATOM_UTF8_STRING, &type_ret,
&format_ret, &num_ret, &bytes_after, &prop_return);
if (prop_return && num_ret > 0 && format_ret == 8)
{
@ -73,134 +74,144 @@ _ecore_x_window_prop_string_utf8_get(Ecore_X_Window win, Ecore_X_Atom atom)
return str;
}
/*
* Root window NetWM hints.
*/
Atom _ecore_x_atom_net_supported = 0;
Atom _ecore_x_atom_net_supporting_wm_check = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_SUPPORTED = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK = 0;
Atom _ecore_x_atom_net_number_of_desktops = 0;
Atom _ecore_x_atom_net_virtual_roots = 0;
Atom _ecore_x_atom_net_desktop_names = 0;
Atom _ecore_x_atom_net_desktop_geometry = 0;
Atom _ecore_x_atom_net_desktop_viewport = 0;
Atom _ecore_x_atom_net_workarea = 0;
Atom _ecore_x_atom_net_desktop_layout = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_VIRTUAL_ROOTS = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_DESKTOP_NAMES = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_DESKTOP_GEOMETRY = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_DESKTOP_VIEWPORT = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WORKAREA = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_DESKTOP_LAYOUT = 0;
Atom _ecore_x_atom_net_current_desktop = 0;
Atom _ecore_x_atom_net_showing_desktop = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_CURRENT_DESKTOP = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_SHOWING_DESKTOP = 0;
Atom _ecore_x_atom_net_client_list = 0;
Atom _ecore_x_atom_net_client_list_stacking = 0;
Atom _ecore_x_atom_net_active_window = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_CLIENT_LIST = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_CLIENT_LIST_STACKING = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_ACTIVE_WINDOW = 0;
/*
* Client message types.
*/
Atom _ecore_x_atom_net_close_window = 0;
Atom _ecore_x_atom_net_wm_moveresize = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_CLOSE_WINDOW = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_MOVERESIZE = 0;
/*
* Application window specific NetWM hints.
*/
Atom _ecore_x_atom_net_wm_desktop = 0;
Atom _ecore_x_atom_net_wm_name = 0;
Atom _ecore_x_atom_net_wm_visible_name = 0;
Atom _ecore_x_atom_net_wm_icon_name = 0;
Atom _ecore_x_atom_net_wm_visible_icon_name = 0;
Atom _ecore_x_atom_net_wm_window_type = 0;
Atom _ecore_x_atom_net_wm_state = 0;
Atom _ecore_x_atom_net_wm_allowed_actions = 0;
Atom _ecore_x_atom_net_wm_strut = 0;
Atom _ecore_x_atom_net_wm_strut_partial = 0;
Atom _ecore_x_atom_net_wm_icon_geometry = 0;
Atom _ecore_x_atom_net_wm_icon = 0;
Atom _ecore_x_atom_net_wm_pid = 0;
Atom _ecore_x_atom_net_wm_handle_icons = 0;
Atom _ecore_x_atom_net_wm_user_time = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_DESKTOP = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_NAME = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_VISIBLE_NAME = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_ICON_NAME = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STRUT = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STRUT_PARTIAL = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_ICON_GEOMETRY = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_ICON = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_PID = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_HANDLE_ICONS = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_USER_TIME = 0;
Atom _ecore_x_atom_net_wm_window_type_desktop = 0;
Atom _ecore_x_atom_net_wm_window_type_dock = 0;
Atom _ecore_x_atom_net_wm_window_type_toolbar = 0;
Atom _ecore_x_atom_net_wm_window_type_menu = 0;
Atom _ecore_x_atom_net_wm_window_type_utility = 0;
Atom _ecore_x_atom_net_wm_window_type_splash = 0;
Atom _ecore_x_atom_net_wm_window_type_dialog = 0;
Atom _ecore_x_atom_net_wm_window_type_normal = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DESKTOP = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DOCK = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_MENU = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_UTILITY = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_SPLASH = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DIALOG = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL = 0;
Atom _ecore_x_atom_net_wm_state_modal = 0;
Atom _ecore_x_atom_net_wm_state_sticky = 0;
Atom _ecore_x_atom_net_wm_state_maximized_vert = 0;
Atom _ecore_x_atom_net_wm_state_maximized_horz = 0;
Atom _ecore_x_atom_net_wm_state_shaded = 0;
Atom _ecore_x_atom_net_wm_state_skip_taskbar = 0;
Atom _ecore_x_atom_net_wm_state_skip_pager = 0;
Atom _ecore_x_atom_net_wm_state_hidden = 0;
Atom _ecore_x_atom_net_wm_state_fullscreen = 0;
Atom _ecore_x_atom_net_wm_state_above = 0;
Atom _ecore_x_atom_net_wm_state_below = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_MODAL = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_STICKY = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_SHADED = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_SKIP_TASKBAR = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_HIDDEN = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_FULLSCREEN = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_ABOVE = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_STATE_BELOW = 0;
Atom _ecore_x_atom_net_wm_window_opacity = 0;
Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_OPACITY = 0;
void
ecore_x_netwm_init(void)
{
_ecore_x_atom_net_supported = _ATOM_GET("_NET_SUPPORTED");
_ecore_x_atom_net_supporting_wm_check = _ATOM_GET("_NET_SUPPORTING_WM_CHECK");
ECORE_X_ATOM_NET_SUPPORTED = _ATOM_GET("_NET_SUPPORTED");
ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK = _ATOM_GET("_NET_SUPPORTING_WM_CHECK");
_ecore_x_atom_net_number_of_desktops = _ATOM_GET("_NET_NUMBER_OF_DESKTOPS");
_ecore_x_atom_net_virtual_roots = _ATOM_GET("_NET_VIRTUAL_ROOTS");
_ecore_x_atom_net_desktop_geometry = _ATOM_GET("_NET_DESKTOP_GEOMETRY");
_ecore_x_atom_net_desktop_names = _ATOM_GET("_NET_DESKTOP_NAMES");
_ecore_x_atom_net_current_desktop = _ATOM_GET("_NET_CURRENT_DESKTOP");
_ecore_x_atom_net_desktop_viewport = _ATOM_GET("_NET_DESKTOP_VIEWPORT");
_ecore_x_atom_net_workarea = _ATOM_GET("_NET_WORKAREA");
ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS = _ATOM_GET("_NET_NUMBER_OF_DESKTOPS");
ECORE_X_ATOM_NET_VIRTUAL_ROOTS = _ATOM_GET("_NET_VIRTUAL_ROOTS");
ECORE_X_ATOM_NET_DESKTOP_GEOMETRY = _ATOM_GET("_NET_DESKTOP_GEOMETRY");
ECORE_X_ATOM_NET_DESKTOP_NAMES = _ATOM_GET("_NET_DESKTOP_NAMES");
ECORE_X_ATOM_NET_CURRENT_DESKTOP = _ATOM_GET("_NET_CURRENT_DESKTOP");
ECORE_X_ATOM_NET_DESKTOP_VIEWPORT = _ATOM_GET("_NET_DESKTOP_VIEWPORT");
ECORE_X_ATOM_NET_WORKAREA = _ATOM_GET("_NET_WORKAREA");
_ecore_x_atom_net_client_list = _ATOM_GET("_NET_CLIENT_LIST");
_ecore_x_atom_net_client_list_stacking = _ATOM_GET("_NET_CLIENT_LIST_STACKING");
_ecore_x_atom_net_active_window = _ATOM_GET("_NET_ACTIVE_WINDOW");
ECORE_X_ATOM_NET_CLIENT_LIST = _ATOM_GET("_NET_CLIENT_LIST");
ECORE_X_ATOM_NET_CLIENT_LIST_STACKING =
_ATOM_GET("_NET_CLIENT_LIST_STACKING");
ECORE_X_ATOM_NET_ACTIVE_WINDOW = _ATOM_GET("_NET_ACTIVE_WINDOW");
_ecore_x_atom_net_close_window = _ATOM_GET("_NET_CLOSE_WINDOW");
_ecore_x_atom_net_wm_moveresize = _ATOM_GET("_NET_WM_MOVERESIZE");
ECORE_X_ATOM_NET_CLOSE_WINDOW = _ATOM_GET("_NET_CLOSE_WINDOW");
ECORE_X_ATOM_NET_WM_MOVERESIZE = _ATOM_GET("_NET_WM_MOVERESIZE");
_ecore_x_atom_net_wm_name = _ATOM_GET("_NET_WM_NAME");
_ecore_x_atom_net_wm_visible_name = _ATOM_GET("_NET_WM_VISIBLE_NAME");
_ecore_x_atom_net_wm_icon_name = _ATOM_GET("_NET_WM_ICON_NAME");
_ecore_x_atom_net_wm_visible_icon_name = _ATOM_GET("_NET_WM_VISIBLE_ICON_NAME");
_ecore_x_atom_net_wm_desktop = _ATOM_GET("_NET_WM_DESKTOP");
_ecore_x_atom_net_wm_window_type = _ATOM_GET("_NET_WM_WINDOW_TYPE");
_ecore_x_atom_net_wm_state = _ATOM_GET("_NET_WM_STATE");
_ecore_x_atom_net_wm_allowed_actions = _ATOM_GET("_NET_WM_ALLOWED_ACTIONS");
_ecore_x_atom_net_wm_strut = _ATOM_GET("_NET_WM_STRUT");
_ecore_x_atom_net_wm_strut_partial = _ATOM_GET("_NET_WM_STRUT_PARTIAL");
_ecore_x_atom_net_wm_icon_geometry = _ATOM_GET("_NET_WM_ICON_GEOMETRY");
_ecore_x_atom_net_wm_icon = _ATOM_GET("_NET_WM_ICON");
_ecore_x_atom_net_wm_pid = _ATOM_GET("_NET_WM_PID");
_ecore_x_atom_net_wm_user_time = _ATOM_GET("_NET_WM_USER_TIME");
ECORE_X_ATOM_NET_WM_NAME = _ATOM_GET("_NET_WM_NAME");
ECORE_X_ATOM_NET_WM_VISIBLE_NAME = _ATOM_GET("_NET_WM_VISIBLE_NAME");
ECORE_X_ATOM_NET_WM_ICON_NAME = _ATOM_GET("_NET_WM_ICON_NAME");
ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME =
_ATOM_GET("_NET_WM_VISIBLE_ICON_NAME");
ECORE_X_ATOM_NET_WM_DESKTOP = _ATOM_GET("_NET_WM_DESKTOP");
ECORE_X_ATOM_NET_WM_WINDOW_TYPE = _ATOM_GET("_NET_WM_WINDOW_TYPE");
ECORE_X_ATOM_NET_WM_STATE = _ATOM_GET("_NET_WM_STATE");
ECORE_X_ATOM_NET_WM_ALLOWED_ACTIONS = _ATOM_GET("_NET_WM_ALLOWED_ACTIONS");
ECORE_X_ATOM_NET_WM_STRUT = _ATOM_GET("_NET_WM_STRUT");
ECORE_X_ATOM_NET_WM_STRUT_PARTIAL = _ATOM_GET("_NET_WM_STRUT_PARTIAL");
ECORE_X_ATOM_NET_WM_ICON_GEOMETRY = _ATOM_GET("_NET_WM_ICON_GEOMETRY");
ECORE_X_ATOM_NET_WM_ICON = _ATOM_GET("_NET_WM_ICON");
ECORE_X_ATOM_NET_WM_PID = _ATOM_GET("_NET_WM_PID");
ECORE_X_ATOM_NET_WM_USER_TIME = _ATOM_GET("_NET_WM_USER_TIME");
_ecore_x_atom_net_wm_window_type_desktop = _ATOM_GET("_NET_WM_WINDOW_TYPE_DESKTOP");
_ecore_x_atom_net_wm_window_type_dock = _ATOM_GET("_NET_WM_WINDOW_TYPE_DOCK");
_ecore_x_atom_net_wm_window_type_toolbar = _ATOM_GET("_NET_WM_WINDOW_TYPE_TOOLBAR");
_ecore_x_atom_net_wm_window_type_menu = _ATOM_GET("_NET_WM_WINDOW_TYPE_MENU");
_ecore_x_atom_net_wm_window_type_utility = _ATOM_GET("_NET_WM_WINDOW_TYPE_UTILITY");
_ecore_x_atom_net_wm_window_type_splash = _ATOM_GET("_NET_WM_WINDOW_TYPE_SPLASH");
_ecore_x_atom_net_wm_window_type_dialog = _ATOM_GET("_NET_WM_WINDOW_TYPE_DIALOG");
_ecore_x_atom_net_wm_window_type_normal = _ATOM_GET("_NET_WM_WINDOW_TYPE_NORMAL");
ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DESKTOP =
_ATOM_GET("_NET_WM_WINDOW_TYPE_DESKTOP");
ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DOCK = _ATOM_GET("_NET_WM_WINDOW_TYPE_DOCK");
ECORE_X_ATOM_NET_WM_WINDOW_TYPE_TOOLBAR =
_ATOM_GET("_NET_WM_WINDOW_TYPE_TOOLBAR");
ECORE_X_ATOM_NET_WM_WINDOW_TYPE_MENU = _ATOM_GET("_NET_WM_WINDOW_TYPE_MENU");
ECORE_X_ATOM_NET_WM_WINDOW_TYPE_UTILITY =
_ATOM_GET("_NET_WM_WINDOW_TYPE_UTILITY");
ECORE_X_ATOM_NET_WM_WINDOW_TYPE_SPLASH =
_ATOM_GET("_NET_WM_WINDOW_TYPE_SPLASH");
ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DIALOG =
_ATOM_GET("_NET_WM_WINDOW_TYPE_DIALOG");
ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL =
_ATOM_GET("_NET_WM_WINDOW_TYPE_NORMAL");
_ecore_x_atom_net_wm_state_modal = _ATOM_GET("_NET_WM_STATE_MODAL");
_ecore_x_atom_net_wm_state_sticky = _ATOM_GET("_NET_WM_STATE_STICKY");
_ecore_x_atom_net_wm_state_maximized_vert = _ATOM_GET("_NET_WM_STATE_MAXIMIZED_VERT");
_ecore_x_atom_net_wm_state_maximized_horz = _ATOM_GET("_NET_WM_STATE_MAXIMIZED_HORZ");
_ecore_x_atom_net_wm_state_shaded = _ATOM_GET("_NET_WM_STATE_SHADED");
_ecore_x_atom_net_wm_state_skip_taskbar = _ATOM_GET("_NET_WM_STATE_SKIP_TASKBAR");
_ecore_x_atom_net_wm_state_skip_pager = _ATOM_GET("_NET_WM_STATE_SKIP_PAGER");
_ecore_x_atom_net_wm_state_hidden = _ATOM_GET("_NET_WM_STATE_HIDDEN");
_ecore_x_atom_net_wm_state_fullscreen = _ATOM_GET("_NET_WM_STATE_FULLSCREEN");
_ecore_x_atom_net_wm_state_above = _ATOM_GET("_NET_WM_STATE_ABOVE");
_ecore_x_atom_net_wm_state_below = _ATOM_GET("_NET_WM_STATE_BELOW");
ECORE_X_ATOM_NET_WM_STATE_MODAL = _ATOM_GET("_NET_WM_STATE_MODAL");
ECORE_X_ATOM_NET_WM_STATE_STICKY = _ATOM_GET("_NET_WM_STATE_STICKY");
ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT =
_ATOM_GET("_NET_WM_STATE_MAXIMIZED_VERT");
ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ =
_ATOM_GET("_NET_WM_STATE_MAXIMIZED_HORZ");
ECORE_X_ATOM_NET_WM_STATE_SHADED = _ATOM_GET("_NET_WM_STATE_SHADED");
ECORE_X_ATOM_NET_WM_STATE_SKIP_TASKBAR =
_ATOM_GET("_NET_WM_STATE_SKIP_TASKBAR");
ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER = _ATOM_GET("_NET_WM_STATE_SKIP_PAGER");
ECORE_X_ATOM_NET_WM_STATE_HIDDEN = _ATOM_GET("_NET_WM_STATE_HIDDEN");
ECORE_X_ATOM_NET_WM_STATE_FULLSCREEN = _ATOM_GET("_NET_WM_STATE_FULLSCREEN");
ECORE_X_ATOM_NET_WM_STATE_ABOVE = _ATOM_GET("_NET_WM_STATE_ABOVE");
ECORE_X_ATOM_NET_WM_STATE_BELOW = _ATOM_GET("_NET_WM_STATE_BELOW");
_ecore_x_atom_net_wm_window_opacity = _ATOM_GET("_NET_WM_WINDOW_OPACITY");
ECORE_X_ATOM_NET_WM_WINDOW_OPACITY = _ATOM_GET("_NET_WM_WINDOW_OPACITY");
}
/*
@ -208,15 +219,14 @@ ecore_x_netwm_init(void)
*/
void
ecore_x_netwm_wm_identify(Ecore_X_Window root, Ecore_X_Window check,
const char *wm_name)
const char *wm_name)
{
_ATOM_SET_WINDOW(_ecore_x_atom_net_supporting_wm_check, root, &check, 1);
_ATOM_SET_WINDOW(_ecore_x_atom_net_supporting_wm_check, check, &check, 1);
_ATOM_SET_UTF8_STRING(_ecore_x_atom_net_wm_name, check, wm_name);
_ATOM_SET_WINDOW(ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK, root, &check, 1);
_ATOM_SET_WINDOW(ECORE_X_ATOM_NET_SUPPORTING_WM_CHECK, check, &check, 1);
_ATOM_SET_UTF8_STRING(ECORE_X_ATOM_NET_WM_NAME, check, wm_name);
/* This one isn't mandatory */
_ATOM_SET_UTF8_STRING(_ecore_x_atom_net_wm_name, root, wm_name);
}
_ATOM_SET_UTF8_STRING(ECORE_X_ATOM_NET_WM_NAME, root, wm_name);
}
/*
* Desktop configuration and status
@ -228,14 +238,14 @@ ecore_x_netwm_desk_count_set(Ecore_X_Window root, int n_desks)
CARD32 val;
val = n_desks;
_ATOM_SET_CARD32(_ecore_x_atom_net_number_of_desktops, root, &val, 1);
_ATOM_SET_CARD32(ECORE_X_ATOM_NET_NUMBER_OF_DESKTOPS, root, &val, 1);
}
void
ecore_x_netwm_desk_roots_set(Ecore_X_Window root, int n_desks,
Ecore_X_Window * vroots)
{
_ATOM_SET_WINDOW(_ecore_x_atom_net_virtual_roots, root, vroots, n_desks);
_ATOM_SET_WINDOW(ECORE_X_ATOM_NET_VIRTUAL_ROOTS, root, vroots, n_desks);
}
void
@ -265,7 +275,7 @@ ecore_x_netwm_desk_names_set(Ecore_X_Window root, int n_desks,
len += l;
}
_ATOM_SET_UTF8_STRING_LIST(_ecore_x_atom_net_desktop_names, root, buf, len);
_ATOM_SET_UTF8_STRING_LIST(ECORE_X_ATOM_NET_DESKTOP_NAMES, root, buf, len);
free(buf);
}
@ -277,7 +287,7 @@ ecore_x_netwm_desk_size_set(Ecore_X_Window root, int width, int height)
size[0] = width;
size[1] = height;
_ATOM_SET_CARD32(_ecore_x_atom_net_desktop_geometry, root, &size, 2);
_ATOM_SET_CARD32(ECORE_X_ATOM_NET_DESKTOP_GEOMETRY, root, &size, 2);
}
void
@ -294,7 +304,7 @@ ecore_x_netwm_desk_workareas_set(Ecore_X_Window root, int n_desks, int *areas)
for (i = 0; i < n_coord; i++)
p_coord[i] = areas[i];
_ATOM_SET_CARD32(_ecore_x_atom_net_workarea, root, p_coord, n_coord);
_ATOM_SET_CARD32(ECORE_X_ATOM_NET_WORKAREA, root, p_coord, n_coord);
free(p_coord);
}
@ -305,7 +315,7 @@ ecore_x_netwm_desk_current_set(Ecore_X_Window root, int desk)
CARD32 val;
val = desk;
_ATOM_SET_CARD32(_ecore_x_atom_net_current_desktop, root, &val, 1);
_ATOM_SET_CARD32(ECORE_X_ATOM_NET_CURRENT_DESKTOP, root, &val, 1);
}
void
@ -322,7 +332,7 @@ ecore_x_netwm_desk_viewports_set(Ecore_X_Window root, int n_desks, int *origins)
for (i = 0; i < n_coord; i++)
p_coord[i] = origins[i];
_ATOM_SET_CARD32(_ecore_x_atom_net_desktop_viewport, root, p_coord, n_coord);
_ATOM_SET_CARD32(ECORE_X_ATOM_NET_DESKTOP_VIEWPORT, root, p_coord, n_coord);
free(p_coord);
}
@ -333,7 +343,7 @@ ecore_x_netwm_showing_desktop_set(Ecore_X_Window root, int on)
CARD32 val;
val = on;
_ATOM_SET_CARD32(_ecore_x_atom_net_showing_desktop, root, &val, 1);
_ATOM_SET_CARD32(ECORE_X_ATOM_NET_SHOWING_DESKTOP, root, &val, 1);
}
/*
@ -345,7 +355,7 @@ void
ecore_x_netwm_client_list_set(Ecore_X_Window root, int n_clients,
Ecore_X_Window * p_clients)
{
_ATOM_SET_WINDOW(_ecore_x_atom_net_client_list, root, p_clients, n_clients);
_ATOM_SET_WINDOW(ECORE_X_ATOM_NET_CLIENT_LIST, root, p_clients, n_clients);
}
/* Stacking order */
@ -353,60 +363,66 @@ void
ecore_x_netwm_client_list_stacking_set(Ecore_X_Window root, int n_clients,
Ecore_X_Window * p_clients)
{
_ATOM_SET_WINDOW(_ecore_x_atom_net_client_list_stacking, root, p_clients,
_ATOM_SET_WINDOW(ECORE_X_ATOM_NET_CLIENT_LIST_STACKING, root, p_clients,
n_clients);
}
void
ecore_x_netwm_client_active_set(Ecore_X_Window root, Ecore_X_Window win)
{
_ATOM_SET_WINDOW(_ecore_x_atom_net_active_window, root, &win, 1);
_ATOM_SET_WINDOW(ECORE_X_ATOM_NET_ACTIVE_WINDOW, root, &win, 1);
}
void
ecore_x_netwm_name_set(Ecore_X_Window win, const char *name)
{
_ecore_x_window_prop_string_utf8_set(_ecore_x_atom_net_wm_name, win, name);
_ecore_x_window_prop_string_utf8_set(ECORE_X_ATOM_NET_WM_NAME, win, name);
}
char *
char *
ecore_x_netwm_name_get(Ecore_X_Window win)
{
return _ecore_x_window_prop_string_utf8_get(win, _ecore_x_atom_net_wm_name);
return _ecore_x_window_prop_string_utf8_get(win, ECORE_X_ATOM_NET_WM_NAME);
}
void
ecore_x_netwm_icon_name_set(Ecore_X_Window win, const char *name)
{
_ecore_x_window_prop_string_utf8_set(_ecore_x_atom_net_wm_icon_name, win, name);
}
char *
ecore_x_netwm_icon_name_get(Ecore_X_Window win)
{
return _ecore_x_window_prop_string_utf8_get(win, _ecore_x_atom_net_wm_icon_name);
_ecore_x_window_prop_string_utf8_set(ECORE_X_ATOM_NET_WM_ICON_NAME, win,
name);
}
char *
ecore_x_netwm_icon_name_get(Ecore_X_Window win)
{
return _ecore_x_window_prop_string_utf8_get(win,
ECORE_X_ATOM_NET_WM_ICON_NAME);
}
void
ecore_x_netwm_visible_name_set(Ecore_X_Window win, const char *name)
{
_ecore_x_window_prop_string_utf8_set(_ecore_x_atom_net_wm_visible_name, win, name);
{
_ecore_x_window_prop_string_utf8_set(ECORE_X_ATOM_NET_WM_VISIBLE_NAME, win,
name);
}
char *
ecore_x_netwm_visible_name_get(Ecore_X_Window win)
{
return _ecore_x_window_prop_string_utf8_get(win, _ecore_x_atom_net_wm_visible_name);
return _ecore_x_window_prop_string_utf8_get(win,
ECORE_X_ATOM_NET_WM_VISIBLE_NAME);
}
void
ecore_x_netwm_visible_icon_name_set(Ecore_X_Window win, const char *name)
{
_ecore_x_window_prop_string_utf8_set(_ecore_x_atom_net_wm_visible_icon_name, win, name);
}
{
_ecore_x_window_prop_string_utf8_set(ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME,
win, name);
}
char *
ecore_x_netwm_visible_icon_name_get(Ecore_X_Window win)
{
return _ecore_x_window_prop_string_utf8_get(win, _ecore_x_atom_net_wm_visible_icon_name);
}
{
return _ecore_x_window_prop_string_utf8_get(win,
ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME);
}

View File

@ -16,6 +16,7 @@
#include <X11/extensions/XShm.h>
#include <X11/extensions/shape.h>
#include "Ecore_X.h"
/* FIXME: this is for simulation only */
#include "Ecore_Job.h"
@ -99,21 +100,6 @@ typedef struct _Ecore_X_DND_Protocol
} handlers;
} Ecore_X_DND_Protocol;
typedef enum _Ecore_X_WM_Protocol {
/**
* If enabled the window manager will be asked to send a
* delete message instead of just closing (destroying) the window.
*/
ECORE_X_WM_PROTOCOL_DELETE_REQUEST,
/**
* If enabled the window manager will be told that the window
* explicitly sets input focus.
*/
ECORE_X_WM_PROTOCOL_TAKE_FOCUS,
ECORE_X_WM_PROTOCOL_NUM
} Ecore_X_WM_Protocol;
extern Display *_ecore_x_disp;
extern double _ecore_x_double_click_time;
extern Time _ecore_x_event_last_time;
@ -121,114 +107,7 @@ extern Window _ecore_x_event_last_win;
extern int _ecore_x_event_last_root_x;
extern int _ecore_x_event_last_root_y;
extern Atom _ecore_x_atom_wm_state;
extern Atom _ecore_x_atom_wm_delete_window;
extern Atom _ecore_x_atom_wm_take_focus;
extern Atom _ecore_x_atom_wm_protocols;
extern Atom _ecore_x_atom_wm_class;
extern Atom _ecore_x_atom_wm_name;
extern Atom _ecore_x_atom_wm_command;
extern Atom _ecore_x_atom_wm_icon_name;
extern Atom _ecore_x_atom_wm_client_machine;
extern Atom _ecore_x_atom_wm_change_state;
extern Atom _ecore_x_atom_wm_colormap_windows;
extern Atom _ecore_x_atom_wm_window_role;
extern Atom _ecore_x_atom_wm_hints;
extern Atom _ecore_x_atom_wm_client_leader;
extern Atom _ecore_x_atom_wm_transient_for;
extern Atom _ecore_x_atom_wm_save_yourself;
extern Atom _ecore_x_atom_motif_wm_hints;
extern Atom _ecore_x_atom_win_layer;
extern Atom _ecore_x_atom_net_number_of_desktops;
extern Atom _ecore_x_atom_net_virtual_roots;
extern Atom _ecore_x_atom_net_desktop_names;
extern Atom _ecore_x_atom_net_desktop_geometry;
extern Atom _ecore_x_atom_net_workarea;
extern Atom _ecore_x_atom_net_current_desktop;
extern Atom _ecore_x_atom_net_desktop_viewport;
extern Atom _ecore_x_atom_net_showing_desktop;
extern Atom _ecore_x_atom_net_client_list;
extern Atom _ecore_x_atom_net_client_list_stacking;
extern Atom _ecore_x_atom_net_active_window;
extern Atom _ecore_x_atom_net_wm_desktop;
extern Atom _ecore_x_atom_net_wm_state;
extern Atom _ecore_x_atom_net_wm_state_above;
extern Atom _ecore_x_atom_net_wm_state_below;
extern Atom _ecore_x_atom_net_wm_name;
extern Atom _ecore_x_atom_net_wm_visible_name;
extern Atom _ecore_x_atom_net_wm_icon_name;
extern Atom _ecore_x_atom_net_wm_visible_icon_name;
extern Atom _ecore_x_atom_net_wm_desktop;
extern Atom _ecore_x_atom_net_wm_window_type;
extern Atom _ecore_x_atom_net_wm_state;
extern Atom _ecore_x_atom_net_wm_allowed_actions;
extern Atom _ecore_x_atom_net_wm_strut;
extern Atom _ecore_x_atom_net_wm_strut_partial;
extern Atom _ecore_x_atom_net_wm_icon_geometry;
extern Atom _ecore_x_atom_net_wm_icon;
extern Atom _ecore_x_atom_net_wm_pid;
extern Atom _ecore_x_atom_net_wm_handle_icons;
extern Atom _ecore_x_atom_net_wm_user_time;
extern Atom _ecore_x_atom_net_wm_window_type_desktop;
extern Atom _ecore_x_atom_net_wm_window_type_dock;
extern Atom _ecore_x_atom_net_wm_window_type_toolbar;
extern Atom _ecore_x_atom_net_wm_window_type_menu;
extern Atom _ecore_x_atom_net_wm_window_type_utility;
extern Atom _ecore_x_atom_net_wm_window_type_splash;
extern Atom _ecore_x_atom_net_wm_window_type_dialog;
extern Atom _ecore_x_atom_net_wm_window_type_normal;
extern Atom _ecore_x_atom_net_wm_window_opacity;
extern Atom _ecore_x_atom_net_wm_state_modal;
extern Atom _ecore_x_atom_net_wm_state_sticky;
extern Atom _ecore_x_atom_net_wm_state_maximized_vert;
extern Atom _ecore_x_atom_net_wm_state_maximized_horz;
extern Atom _ecore_x_atom_net_wm_state_shaded;
extern Atom _ecore_x_atom_net_wm_state_skip_taskbar;
extern Atom _ecore_x_atom_net_wm_state_skip_pager;
extern Atom _ecore_x_atom_net_wm_state_hidden;
extern Atom _ecore_x_atom_net_wm_state_fullscreen;
extern Atom _ecore_x_atom_net_wm_state_above;
extern Atom _ecore_x_atom_net_wm_state_below;
extern Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
extern Atom _ecore_x_atom_utf8_string;
extern Atom _ecore_x_atom_file_name;
extern Atom _ecore_x_atom_string;
extern Atom _ecore_x_atom_text;
extern Atom _ecore_x_atom_compound_text;
extern Atom _ecore_x_atom_selection_primary;
extern Atom _ecore_x_atom_selection_secondary;
extern Atom _ecore_x_atom_selection_clipboard;
extern Atom _ecore_x_atom_selection_prop_primary;
extern Atom _ecore_x_atom_selection_prop_secondary;
extern Atom _ecore_x_atom_selection_prop_clipboard;
extern Atom _ecore_x_atom_selection_xdnd;
extern Atom _ecore_x_atom_selection_prop_xdnd;
extern Atom _ecore_x_atom_xdnd_aware;
extern Atom _ecore_x_atom_xdnd_enter;
extern Atom _ecore_x_atom_xdnd_type_list;
extern Atom _ecore_x_atom_xdnd_position;
extern Atom _ecore_x_atom_xdnd_action_copy;
extern Atom _ecore_x_atom_xdnd_action_private;
extern Atom _ecore_x_atom_xdnd_action_ask;
extern Atom _ecore_x_atom_xdnd_action_list;
extern Atom _ecore_x_atom_xdnd_action_description;
extern Atom _ecore_x_atom_xdnd_status;
extern Atom _ecore_x_atom_xdnd_leave;
extern Atom _ecore_x_atom_xdnd_drop;
extern Atom _ecore_x_atom_xdnd_finished;
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;

View File

@ -1,6 +1,7 @@
#include "Ecore.h"
#include "ecore_x_private.h"
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
static Ecore_X_Selection_Data selections[3] = {{0}};
static Ecore_X_Selection_Data request_data[3] = {{0}};
@ -12,15 +13,15 @@ void
_ecore_x_selection_data_init(void)
{
/* Initialize converters */
ecore_x_selection_converter_atom_add(_ecore_x_atom_text,
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_atom_add(ECORE_X_ATOM_UTF8_STRING,
_ecore_x_selection_converter_text);
#endif
ecore_x_selection_converter_atom_add(_ecore_x_atom_compound_text,
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_atom_add(ECORE_X_ATOM_STRING,
_ecore_x_selection_converter_text);
}
@ -47,11 +48,11 @@ _ecore_x_selection_request_data_get(Ecore_X_Atom selection, void **buf, int *len
{
int i;
char *data;
if (selection == _ecore_x_atom_selection_primary)
if (selection == ECORE_X_ATOM_SELECTION_PRIMARY)
i = 0;
else if (selection == _ecore_x_atom_selection_secondary)
else if (selection == ECORE_X_ATOM_SELECTION_SECONDARY)
i = 1;
else if (selection == _ecore_x_atom_selection_clipboard)
else if (selection == ECORE_X_ATOM_SELECTION_CLIPBOARD)
i = 2;
else
return;
@ -81,7 +82,7 @@ _ecore_x_selection_request_data_get(Ecore_X_Atom selection, void **buf, int *len
void
ecore_x_selection_primary_request_data_get(void **buf, int *len)
{
_ecore_x_selection_request_data_get(_ecore_x_atom_selection_primary,
_ecore_x_selection_request_data_get(ECORE_X_ATOM_SELECTION_PRIMARY,
buf, len);
}
@ -96,7 +97,7 @@ ecore_x_selection_primary_request_data_get(void **buf, int *len)
void
ecore_x_selection_secondary_request_data_get(void **buf, int *len)
{
_ecore_x_selection_request_data_get(_ecore_x_atom_selection_secondary,
_ecore_x_selection_request_data_get(ECORE_X_ATOM_SELECTION_SECONDARY,
buf, len);
}
@ -111,7 +112,7 @@ ecore_x_selection_secondary_request_data_get(void **buf, int *len)
void
ecore_x_selection_clipboard_request_data_get(void **buf, int *len)
{
_ecore_x_selection_request_data_get(_ecore_x_atom_selection_clipboard,
_ecore_x_selection_request_data_get(ECORE_X_ATOM_SELECTION_CLIPBOARD,
buf, len);
}
@ -119,11 +120,11 @@ void
_ecore_x_selection_request_data_set(Ecore_X_Selection_Data data)
{
int i;
if (data.selection == _ecore_x_atom_selection_primary)
if (data.selection == ECORE_X_ATOM_SELECTION_PRIMARY)
i = 0;
else if (data.selection == _ecore_x_atom_selection_secondary)
else if (data.selection == ECORE_X_ATOM_SELECTION_SECONDARY)
i = 1;
else if (data.selection == _ecore_x_atom_selection_clipboard)
else if (data.selection == ECORE_X_ATOM_SELECTION_CLIPBOARD)
i = 2;
else
return;
@ -134,11 +135,11 @@ _ecore_x_selection_request_data_set(Ecore_X_Selection_Data data)
Ecore_X_Selection_Data *
_ecore_x_selection_get(Atom selection)
{
if (selection == _ecore_x_atom_selection_primary)
if (selection == ECORE_X_ATOM_SELECTION_PRIMARY)
return &selections[0];
else if (selection == _ecore_x_atom_selection_secondary)
else if (selection == ECORE_X_ATOM_SELECTION_SECONDARY)
return &selections[1];
else if (selection == _ecore_x_atom_selection_clipboard)
else if (selection == ECORE_X_ATOM_SELECTION_CLIPBOARD)
return &selections[2];
else
return NULL;
@ -154,9 +155,9 @@ _ecore_x_selection_set(Window w, unsigned char *data, int size, Atom selection)
if (XGetSelectionOwner(_ecore_x_disp, selection) != w)
return 0;
if (selection == _ecore_x_atom_selection_primary)
if (selection == ECORE_X_ATOM_SELECTION_PRIMARY)
in = 0;
else if (selection == _ecore_x_atom_selection_secondary)
else if (selection == ECORE_X_ATOM_SELECTION_SECONDARY)
in = 1;
else
in = 2;
@ -198,7 +199,7 @@ _ecore_x_selection_set(Window w, unsigned char *data, int size, Atom selection)
int
ecore_x_selection_primary_set(Ecore_X_Window w, unsigned char *data, int size)
{
return _ecore_x_selection_set(w, data, size, _ecore_x_atom_selection_primary);
return _ecore_x_selection_set(w, data, size, ECORE_X_ATOM_SELECTION_PRIMARY);
}
/**
@ -210,7 +211,7 @@ ecore_x_selection_primary_set(Ecore_X_Window w, unsigned char *data, int size)
int
ecore_x_selection_primary_clear(void)
{
return _ecore_x_selection_set(None, NULL, 0, _ecore_x_atom_selection_primary);
return _ecore_x_selection_set(None, NULL, 0, ECORE_X_ATOM_SELECTION_PRIMARY);
}
/**
@ -227,7 +228,7 @@ ecore_x_selection_primary_clear(void)
int
ecore_x_selection_secondary_set(Ecore_X_Window w, unsigned char *data, int size)
{
return _ecore_x_selection_set(w, data, size, _ecore_x_atom_selection_secondary);
return _ecore_x_selection_set(w, data, size, ECORE_X_ATOM_SELECTION_SECONDARY);
}
/**
@ -239,7 +240,7 @@ ecore_x_selection_secondary_set(Ecore_X_Window w, unsigned char *data, int size)
int
ecore_x_selection_secondary_clear(void)
{
return _ecore_x_selection_set(None, NULL, 0, _ecore_x_atom_selection_secondary);
return _ecore_x_selection_set(None, NULL, 0, ECORE_X_ATOM_SELECTION_SECONDARY);
}
/**
@ -256,7 +257,7 @@ ecore_x_selection_secondary_clear(void)
int
ecore_x_selection_clipboard_set(Ecore_X_Window w, unsigned char *data, int size)
{
return _ecore_x_selection_set(w, data, size, _ecore_x_atom_selection_clipboard);
return _ecore_x_selection_set(w, data, size, ECORE_X_ATOM_SELECTION_CLIPBOARD);
}
/**
@ -268,7 +269,7 @@ ecore_x_selection_clipboard_set(Ecore_X_Window w, unsigned char *data, int size)
int
ecore_x_selection_clipboard_clear(void)
{
return _ecore_x_selection_set(None, NULL, 0, _ecore_x_atom_selection_clipboard);
return _ecore_x_selection_set(None, NULL, 0, ECORE_X_ATOM_SELECTION_CLIPBOARD);
}
Atom
@ -277,15 +278,15 @@ _ecore_x_selection_target_atom_get(char *target)
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
{
char *atom_name;
@ -301,13 +302,13 @@ _ecore_x_selection_target_atom_get(char *target)
char *
_ecore_x_selection_target_get(Atom target)
{
if (target == _ecore_x_atom_file_name)
if (target == ECORE_X_ATOM_FILE_NAME)
return strdup(ECORE_X_SELECTION_TARGET_FILENAME);
else if (target == _ecore_x_atom_string)
else if (target == ECORE_X_ATOM_STRING)
return strdup(ECORE_X_SELECTION_TARGET_STRING);
else if (target == _ecore_x_atom_utf8_string)
else if (target == ECORE_X_ATOM_UTF8_STRING)
return strdup(ECORE_X_SELECTION_TARGET_UTF8_STRING);
else if (target == _ecore_x_atom_text)
else if (target == ECORE_X_ATOM_TEXT)
return strdup(ECORE_X_SELECTION_TARGET_TEXT);
else
return strdup(ECORE_X_SELECTION_TARGET_TEXT);
@ -320,14 +321,14 @@ _ecore_x_selection_request(Ecore_X_Window w, Ecore_X_Atom selection, char *targe
target = _ecore_x_selection_target_atom_get(target_str);
if (selection == _ecore_x_atom_selection_primary)
prop = _ecore_x_atom_selection_prop_primary;
else if (selection == _ecore_x_atom_selection_secondary)
prop = _ecore_x_atom_selection_prop_secondary;
else if (selection == _ecore_x_atom_selection_xdnd)
prop = _ecore_x_atom_selection_prop_xdnd;
if (selection == ECORE_X_ATOM_SELECTION_PRIMARY)
prop = ECORE_X_ATOM_SELECTION_PROP_PRIMARY;
else if (selection == ECORE_X_ATOM_SELECTION_SECONDARY)
prop = ECORE_X_ATOM_SELECTION_PROP_SECONDARY;
else if (selection == ECORE_X_ATOM_SELECTION_XDND)
prop = ECORE_X_ATOM_SELECTION_PROP_XDND;
else
prop = _ecore_x_atom_selection_prop_clipboard;
prop = ECORE_X_ATOM_SELECTION_PROP_CLIPBOARD;
XConvertSelection(_ecore_x_disp, selection, target, prop,
w, _ecore_x_event_last_time);
@ -336,19 +337,19 @@ _ecore_x_selection_request(Ecore_X_Window w, Ecore_X_Atom selection, char *targe
void
ecore_x_selection_primary_request(Ecore_X_Window w, char *target)
{
_ecore_x_selection_request(w, _ecore_x_atom_selection_primary, target);
_ecore_x_selection_request(w, ECORE_X_ATOM_SELECTION_PRIMARY, target);
}
void
ecore_x_selection_secondary_request(Ecore_X_Window w, char *target)
{
_ecore_x_selection_request(w, _ecore_x_atom_selection_secondary, target);
_ecore_x_selection_request(w, ECORE_X_ATOM_SELECTION_SECONDARY, target);
}
void
ecore_x_selection_clipboard_request(Ecore_X_Window w, char *target)
{
_ecore_x_selection_request(w, _ecore_x_atom_selection_clipboard, target);
_ecore_x_selection_request(w, ECORE_X_ATOM_SELECTION_CLIPBOARD, target);
}
void
@ -410,9 +411,9 @@ ecore_x_selection_converter_atom_del(Ecore_X_Atom target)
{
if (cnv->target == target)
{
if (target == _ecore_x_atom_text ||
target == _ecore_x_atom_compound_text ||
target == _ecore_x_atom_string)
if (target == ECORE_X_ATOM_TEXT ||
target == ECORE_X_ATOM_COMPOUND_TEXT ||
target == ECORE_X_ATOM_STRING)
{
cnv->convert = _ecore_x_selection_converter_text;
}

View File

@ -5,6 +5,7 @@
#include "Ecore.h"
#include "ecore_x_private.h"
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
/**
* @defgroup Ecore_X_Window_Create_Group X Window Creation Functions
@ -208,7 +209,7 @@ ecore_x_window_defaults_set(Ecore_X_Window win)
hostname[0] = buf;
/* The ecore function uses UTF8 which Xlib may not like (especially
* with older clients) */
/* ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_client_machine,
/* ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_CLIENT_MACHINE,
(char *)buf); */
if (XStringListToTextProperty(hostname, 1, &xprop))
{
@ -220,7 +221,7 @@ ecore_x_window_defaults_set(Ecore_X_Window win)
* Set _NET_WM_PID
*/
pid = getpid();
ecore_x_window_prop_property_set(win, _ecore_x_atom_net_wm_pid, XA_CARDINAL,
ecore_x_window_prop_property_set(win, ECORE_X_ATOM_NET_WM_PID, XA_CARDINAL,
32, &pid, 1);
ecore_x_window_prop_window_type_set(win, ECORE_X_WINDOW_TYPE_NORMAL);
@ -292,9 +293,9 @@ ecore_x_window_delete_request_send(Ecore_X_Window win)
xev.xclient.type = ClientMessage;
xev.xclient.display = _ecore_x_disp;
xev.xclient.window = win;
xev.xclient.message_type = _ecore_x_atom_wm_protocols;
xev.xclient.message_type = ECORE_X_ATOM_WM_PROTOCOLS;
xev.xclient.format = 32;
xev.xclient.data.l[0] = _ecore_x_atom_wm_delete_window;
xev.xclient.data.l[0] = ECORE_X_ATOM_WM_DELETE_WINDOW;
xev.xclient.data.l[1] = CurrentTime;
XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);

View File

@ -5,6 +5,7 @@
#include "Ecore.h"
#include "ecore_x_private.h"
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
#include <inttypes.h>
#include <limits.h>
@ -164,7 +165,7 @@ ecore_x_window_prop_string_set(Ecore_X_Window win, Ecore_X_Atom type, char *str)
if (win == 0) win = DefaultRootWindow(_ecore_x_disp);
xtp.value = str;
xtp.format = 8;
xtp.encoding = _ecore_x_atom_utf8_string;
xtp.encoding = ECORE_X_ATOM_UTF8_STRING;
xtp.nitems = strlen(str);
XSetTextProperty(_ecore_x_disp, win, &xtp, type);
}
@ -227,14 +228,14 @@ ecore_x_window_prop_title_set(Ecore_X_Window win, const char *t)
/* Xlib may not like the UTF8 String */
/* FIXME convert utf8 to whatever encoding xlib prefers */
/* ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_name, (char *)t); */
/* ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_NAME, (char *)t); */
if (XStringListToTextProperty(list, 1, &xprop))
{
XSetWMName(_ecore_x_disp, win, &xprop);
XFree(xprop.value);
}
ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_name, (char *)t);
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_NAME, (char *)t);
}
/**
@ -249,8 +250,8 @@ ecore_x_window_prop_title_get(Ecore_X_Window win)
{
char *title;
/* title = ecore_x_window_prop_string_get(win, _ecore_x_atom_net_wm_name);*/
title = ecore_x_window_prop_string_get(win, _ecore_x_atom_wm_name);
/* title = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_NET_WM_NAME);*/
title = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_NAME);
return title;
}
@ -298,7 +299,7 @@ ecore_x_window_prop_command_get(Ecore_X_Window win, int *argc, char ***argv)
void
ecore_x_window_prop_visible_title_set(Ecore_X_Window win, const char *t)
{
ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_visible_name,
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_VISIBLE_NAME,
(char *)t);
}
@ -314,7 +315,7 @@ ecore_x_window_prop_visible_title_get(Ecore_X_Window win)
{
char *title;
title = ecore_x_window_prop_string_get(win, _ecore_x_atom_net_wm_visible_name);
title = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_NET_WM_VISIBLE_NAME);
return title;
}
@ -330,8 +331,8 @@ ecore_x_window_prop_visible_title_get(Ecore_X_Window win)
void
ecore_x_window_prop_icon_name_set(Ecore_X_Window win, const char *t)
{
ecore_x_window_prop_string_set(win, _ecore_x_atom_wm_icon_name, (char *)t);
ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_icon_name,
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_ICON_NAME, (char *)t);
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_ICON_NAME,
(char *)t);
}
@ -348,8 +349,8 @@ ecore_x_window_prop_icon_name_get(Ecore_X_Window win)
{
char *name;
name = ecore_x_window_prop_string_get(win, _ecore_x_atom_net_wm_icon_name);
if (!name) name = ecore_x_window_prop_string_get(win, _ecore_x_atom_wm_icon_name);
name = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_NET_WM_ICON_NAME);
if (!name) name = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_ICON_NAME);
return name;
}
@ -363,7 +364,7 @@ ecore_x_window_prop_icon_name_get(Ecore_X_Window win)
void
ecore_x_window_prop_visible_icon_name_set(Ecore_X_Window win, const char *t)
{
ecore_x_window_prop_string_set(win, _ecore_x_atom_net_wm_visible_icon_name,
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME,
(char *)t);
}
@ -379,7 +380,7 @@ ecore_x_window_prop_visible_icon_name_get(Ecore_X_Window win)
{
char *name;
name = ecore_x_window_prop_string_get(win, _ecore_x_atom_net_wm_visible_icon_name);
name = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_NET_WM_VISIBLE_ICON_NAME);
return name;
}
@ -396,7 +397,7 @@ ecore_x_window_prop_client_machine_get(Ecore_X_Window win)
{
char *name;
name = ecore_x_window_prop_string_get(win, _ecore_x_atom_wm_client_machine);
name = ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_CLIENT_MACHINE);
return name;
}
@ -414,7 +415,7 @@ ecore_x_window_prop_pid_get(Ecore_X_Window win)
pid_t pid = 0;
unsigned char *tmp = NULL;
ecore_x_window_prop_property_get(win, _ecore_x_atom_net_wm_pid, XA_CARDINAL,
ecore_x_window_prop_property_get(win, ECORE_X_ATOM_NET_WM_PID, XA_CARDINAL,
32, &tmp, &num);
if ((num) && (tmp))
{
@ -543,7 +544,7 @@ ecore_x_window_prop_protocol_set(Ecore_X_Window win,
protos_count - 1);
else
XDeleteProperty(_ecore_x_disp, win,
_ecore_x_atom_wm_protocols);
ECORE_X_ATOM_WM_PROTOCOLS);
goto leave;
}
}
@ -734,19 +735,19 @@ ecore_x_window_prop_sticky_set(Ecore_X_Window win, int on)
unsigned char *data = NULL;
if (on) {
ecore_x_window_prop_property_set(win, _ecore_x_atom_net_wm_desktop,
ecore_x_window_prop_property_set(win, ECORE_X_ATOM_NET_WM_DESKTOP,
XA_CARDINAL, 32, &val, 1);
ecore_x_window_prop_state_set(win, ECORE_X_WINDOW_STATE_STICKY);
return;
}
ecore_x_window_prop_state_unset(win, ECORE_X_WINDOW_STATE_STICKY);
ret = ecore_x_window_prop_property_get(0, _ecore_x_atom_net_current_desktop,
ret = ecore_x_window_prop_property_get(0, ECORE_X_ATOM_NET_CURRENT_DESKTOP,
XA_CARDINAL, 32, &data, &num);
if (!ret || !num)
return;
ecore_x_window_prop_property_set(win, _ecore_x_atom_net_wm_desktop,
ecore_x_window_prop_property_set(win, ECORE_X_ATOM_NET_WM_DESKTOP,
XA_CARDINAL, 32, data, 1);
free(data);
}
@ -836,8 +837,8 @@ ecore_x_window_prop_borderless_set(Ecore_X_Window win, int borderless)
data[2] = !borderless;
ecore_x_window_prop_property_set(win,
_ecore_x_atom_motif_wm_hints,
_ecore_x_atom_motif_wm_hints,
ECORE_X_ATOM_MOTIF_WM_HINTS,
ECORE_X_ATOM_MOTIF_WM_HINTS,
32, (void *)data, 5);
}
@ -854,8 +855,8 @@ ecore_x_window_prop_borderless_get(Ecore_X_Window win)
int borderless = 0;
ecore_x_window_prop_property_get(win,
_ecore_x_atom_motif_wm_hints,
_ecore_x_atom_motif_wm_hints,
ECORE_X_ATOM_MOTIF_WM_HINTS,
ECORE_X_ATOM_MOTIF_WM_HINTS,
32, &data, &num);
/* check for valid data. only read the borderless flag if the
@ -904,7 +905,7 @@ ecore_x_window_prop_layer_set(Ecore_X_Window win, int layer)
}
/* set the gnome atom */
ecore_x_window_prop_property_set(win, _ecore_x_atom_win_layer,
ecore_x_window_prop_property_set(win, ECORE_X_ATOM_WIN_LAYER,
XA_CARDINAL, 32, &layer, 1);
return 1;
@ -956,7 +957,7 @@ ecore_x_window_prop_desktop_request(Ecore_X_Window win, long desktop)
xev.xclient.type = ClientMessage;
xev.xclient.display = _ecore_x_disp;
xev.xclient.window = win;
xev.xclient.message_type = _ecore_x_atom_net_wm_desktop;
xev.xclient.message_type = ECORE_X_ATOM_NET_WM_DESKTOP;
xev.xclient.format = 32;
xev.xclient.data.l[0] = desktop;
@ -998,11 +999,11 @@ ecore_x_window_prop_state_request(Ecore_X_Window win, Ecore_X_Window_State state
}
if (action != 1)
return;
xev.xclient.message_type = _ecore_x_atom_wm_change_state;
xev.xclient.message_type = ECORE_X_ATOM_WM_CHANGE_STATE;
xev.xclient.data.l[0] = IconicState;
break;
default: /* The _NET_WM_STATE_... hints */
xev.xclient.message_type = _ecore_x_atom_net_wm_state;
xev.xclient.message_type = ECORE_X_ATOM_NET_WM_STATE;
xev.xclient.data.l[0] = action;
xev.xclient.data.l[1] = _ecore_x_window_prop_state_atom_get(state);
break;
@ -1023,7 +1024,7 @@ ecore_x_window_prop_state_request(Ecore_X_Window win, Ecore_X_Window_State state
void
ecore_x_window_prop_desktop_set(Ecore_X_Window win, long desktop)
{
ecore_x_window_prop_property_set(win, _ecore_x_atom_net_wm_desktop,
ecore_x_window_prop_property_set(win, ECORE_X_ATOM_NET_WM_DESKTOP,
XA_CARDINAL, 32, &desktop, 1);
}
@ -1040,7 +1041,7 @@ ecore_x_window_prop_desktop_get(Ecore_X_Window win)
unsigned char *tmp;
long desktop = -1;
ecore_x_window_prop_property_get(win, _ecore_x_atom_net_wm_desktop,
ecore_x_window_prop_property_get(win, ECORE_X_ATOM_NET_WM_DESKTOP,
XA_CARDINAL, 32, &tmp, &num);
if ((tmp) && (num))
{
@ -1058,21 +1059,21 @@ _ecore_x_window_prop_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;
default:
return 0;
}
@ -1092,7 +1093,7 @@ ecore_x_window_prop_window_type_set(Ecore_X_Window win, Ecore_X_Window_Type type
a = _ecore_x_window_prop_type_atom_get(type);
if (a)
ecore_x_window_prop_property_set(win, _ecore_x_atom_net_wm_window_type,
ecore_x_window_prop_property_set(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
XA_ATOM, 32, (unsigned char*)&a, 1);
}
@ -1112,7 +1113,7 @@ ecore_x_window_prop_window_type_set(Ecore_X_Window win, Ecore_X_Atom type)
unsigned char *data = NULL;
if (ecore_x_window_prop_property_get(win,
_ecore_x_atom_net_wm_window_type,
ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
XA_ATOM, 32, &data, &num))
XFree(data);
@ -1121,7 +1122,7 @@ ecore_x_window_prop_window_type_set(Ecore_X_Window win, Ecore_X_Atom type)
{
((Atom *)data)[0] = type;
ecore_x_window_prop_property_set(win,
_ecore_x_atom_net_wm_window_type,
ECORE_X_ATOM_NET_WM_WINDOW_TYPE,
XA_ATOM, 32, data, 1);
}
free(data);
@ -1134,27 +1135,27 @@ _ecore_x_window_prop_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_skip_pager;
return ECORE_X_ATOM_NET_WM_STATE_SKIP_PAGER;
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;
default:
return 0;
}
@ -1179,7 +1180,7 @@ ecore_x_window_prop_state_set(Ecore_X_Window win, Ecore_X_Window_State s)
state = _ecore_x_window_prop_state_atom_get(s);
ecore_x_window_prop_property_get(win, _ecore_x_atom_net_wm_state,
ecore_x_window_prop_property_get(win, ECORE_X_ATOM_NET_WM_STATE,
XA_ATOM, 32, &old_data, &num);
oldset = (Atom *) old_data;
newset = calloc(num + 1, sizeof(Atom));
@ -1200,7 +1201,7 @@ ecore_x_window_prop_state_set(Ecore_X_Window win, Ecore_X_Window_State s)
newset[num] = state;
ecore_x_window_prop_property_set(win, _ecore_x_atom_net_wm_state,
ecore_x_window_prop_property_set(win, ECORE_X_ATOM_NET_WM_STATE,
XA_ATOM, 32, data, num + 1);
XFree(old_data);
free(data);
@ -1224,7 +1225,7 @@ ecore_x_window_prop_state_isset(Ecore_X_Window win, Ecore_X_Window_State s)
Ecore_X_Atom state;
state = _ecore_x_window_prop_state_atom_get(s);
if (!ecore_x_window_prop_property_get(win, _ecore_x_atom_net_wm_state,
if (!ecore_x_window_prop_property_get(win, ECORE_X_ATOM_NET_WM_STATE,
XA_ATOM, 32, &data, &num))
return ret;
@ -1267,7 +1268,7 @@ ecore_x_window_prop_state_unset(Ecore_X_Window win, Ecore_X_Window_State s)
return;
}
ecore_x_window_prop_property_get(win, _ecore_x_atom_net_wm_state,
ecore_x_window_prop_property_get(win, ECORE_X_ATOM_NET_WM_STATE,
XA_ATOM, 32, &old_data, &num);
oldset = (Atom *) old_data;
newset = calloc(num - 1, sizeof(Atom));
@ -1276,7 +1277,7 @@ ecore_x_window_prop_state_unset(Ecore_X_Window win, Ecore_X_Window_State s)
if (oldset[i] != state)
newset[j++] = oldset[i];
ecore_x_window_prop_property_set(win, _ecore_x_atom_net_wm_state,
ecore_x_window_prop_property_set(win, ECORE_X_ATOM_NET_WM_STATE,
XA_ATOM, 32, data, j);
XFree(oldset);
free(newset);
@ -1286,7 +1287,7 @@ ecore_x_window_prop_state_unset(Ecore_X_Window win, Ecore_X_Window_State s)
void
ecore_x_window_prop_window_type_utility_set(Ecore_X_Window win)
{
ecore_x_window_prop_window_type_set(win, _ecore_x_atom_net_wm_window_type_utility);
ecore_x_window_prop_window_type_set(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE_UTILITY);
}
/**
@ -1298,7 +1299,7 @@ ecore_x_window_prop_window_type_utility_set(Ecore_X_Window win)
void
ecore_x_window_prop_window_type_splash_set(Ecore_X_Window win)
{
ecore_x_window_prop_window_type_set(win, _ecore_x_atom_net_wm_window_type_splash);
ecore_x_window_prop_window_type_set(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE_SPLASH);
}
/**
@ -1310,7 +1311,7 @@ ecore_x_window_prop_window_type_splash_set(Ecore_X_Window win)
void
ecore_x_window_prop_window_type_dialog_set(Ecore_X_Window win)
{
ecore_x_window_prop_window_type_set(win, _ecore_x_atom_net_wm_window_type_dialog);
ecore_x_window_prop_window_type_set(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE_DIALOG);
}
/**
@ -1322,7 +1323,7 @@ ecore_x_window_prop_window_type_dialog_set(Ecore_X_Window win)
void
ecore_x_window_prop_window_type_normal_set(Ecore_X_Window win)
{
ecore_x_window_prop_window_type_set(win, _ecore_x_atom_net_wm_window_type_normal);
ecore_x_window_prop_window_type_set(win, ECORE_X_ATOM_NET_WM_WINDOW_TYPE_NORMAL);
}
#endif
@ -1349,7 +1350,7 @@ void ecore_x_window_prop_window_opacity_set(Ecore_X_Window win, int opacity)
tmp = (double) opacity/255. * 4294967295.;
o_val = (unsigned long) tmp;
ecore_x_window_prop_property_set(win, _ecore_x_atom_net_wm_window_opacity,
ecore_x_window_prop_property_set(win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY,
XA_CARDINAL, 32, &o_val, 1);
}
@ -1366,7 +1367,7 @@ int ecore_x_window_prop_window_opacity_get(Ecore_X_Window win)
int ret_val = -1;
int num;
if(ecore_x_window_prop_property_get(win, _ecore_x_atom_net_wm_window_opacity,
if(ecore_x_window_prop_property_get(win, ECORE_X_ATOM_NET_WM_WINDOW_OPACITY,
XA_CARDINAL, 32, &data, &num))
{
if (data && num)