Add way to trigger illume dual/single app mode via client messages.

(and fix some formatting)



SVN revision: 44378
This commit is contained in:
Christopher Michael 2009-12-11 19:51:47 +00:00
parent cb77de8e30
commit 1a3eec2e91
5 changed files with 103 additions and 36 deletions

View File

@ -896,50 +896,48 @@ EAPI extern int ECORE_X_LOCK_NUM;
EAPI extern int ECORE_X_LOCK_CAPS;
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 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,
/**
* If enabled the window manager will be told that the window
* explicitly sets input focus.
*/
ECORE_X_WM_PROTOCOL_TAKE_FOCUS,
/**
* If enabled the window manager can ping the window to check
* if it is alive.
*/
ECORE_X_NET_WM_PROTOCOL_PING,
/**
* If enabled the window manager can ping the window to check
* if it is alive.
*/
ECORE_X_NET_WM_PROTOCOL_PING,
/**
* If enabled the window manager can sync updating with the
* window (?)
*/
ECORE_X_NET_WM_PROTOCOL_SYNC_REQUEST,
/**
* If enabled the window manager can sync updating with the
* window (?)
*/
ECORE_X_NET_WM_PROTOCOL_SYNC_REQUEST,
/* Number of defined items */
ECORE_X_WM_PROTOCOL_NUM
/* Number of defined items */
ECORE_X_WM_PROTOCOL_NUM
} Ecore_X_WM_Protocol;
typedef enum _Ecore_X_Window_Input_Mode {
/** The window can never be focused */
ECORE_X_WINDOW_INPUT_MODE_NONE,
/** The window can never be focused */
ECORE_X_WINDOW_INPUT_MODE_NONE,
/** The window can be focused by the WM but doesn't focus itself */
ECORE_X_WINDOW_INPUT_MODE_PASSIVE,
/** The window can be focused by the WM but doesn't focus itself */
ECORE_X_WINDOW_INPUT_MODE_PASSIVE,
/** The window sets the focus itself if one of its sub-windows
* already is focused
*/
ECORE_X_WINDOW_INPUT_MODE_ACTIVE_LOCAL,
/** The window sets the focus itself if one of its sub-windows
* already is focused */
ECORE_X_WINDOW_INPUT_MODE_ACTIVE_LOCAL,
/** The window sets the focus itself even if another window
* is currently focused
*/
ECORE_X_WINDOW_INPUT_MODE_ACTIVE_GLOBAL
/** The window sets the focus itself even if another window
* is currently focused */
ECORE_X_WINDOW_INPUT_MODE_ACTIVE_GLOBAL
} Ecore_X_Window_Input_Mode;
typedef enum _Ecore_X_Window_State_Hint {
@ -1006,6 +1004,12 @@ typedef enum _Ecore_X_Virtual_Keyboard_State {
ECORE_X_VIRTUAL_KEYBOARD_STATE_PASSWORD
} Ecore_X_Virtual_Keyboard_State;
typedef enum _Ecore_X_Illume_Mode
{
ECORE_X_ILLUME_MODE_UNKNOWN = 0,
ECORE_X_ILLUME_MODE_SINGLE,
ECORE_X_ILLUME_MODE_DUAL
} Ecore_X_Illume_Mode;
/* Window layer constants */
#define ECORE_X_WINDOW_LAYER_BELOW 2
@ -1529,7 +1533,9 @@ EAPI void ecore_x_e_virtual_keyboard_state_send(Ecore_X_Window wi
EAPI void ecore_x_e_illume_conformant_set(Ecore_X_Window win, unsigned int is_conformant);
EAPI int ecore_x_e_illume_conformant_get(Ecore_X_Window win);
EAPI void ecore_x_e_illume_mode_set(Ecore_X_Window win, Ecore_X_Illume_Mode mode);
EAPI Ecore_X_Illume_Mode ecore_x_e_illume_mode_get(Ecore_X_Window win);
EAPI void ecore_x_e_illume_mode_send(Ecore_X_Window win, Ecore_X_Illume_Mode mode);
EAPI void ecore_x_xinerama_query_screens_prefetch(void);
EAPI void ecore_x_xinerama_query_screens_fetch(void);

View File

@ -199,5 +199,8 @@ EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PASSWORD;
/* atom to determine if an app is illume compliant */
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CONFORMANT;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_MODE;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_MODE_SINGLE;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_MODE_DUAL;
#endif /* _ECORE_X_ATOMS_H */

View File

@ -222,3 +222,6 @@ EAPI Ecore_X_Atom ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PASSWORD = 0;
/* atom to determine if an app is illume compliant */
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CONFORMANT = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_MODE = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_MODE_SINGLE = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_MODE_DUAL = 0;

View File

@ -212,7 +212,8 @@ _ecore_x_atoms_init(void)
{ "_E_VIRTUAL_KEYBOARD_TERMINAL", &ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_TERMINAL },
{ "_E_VIRTUAL_KEYBOARD_PASSWORD", &ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_PASSWORD },
{ "_E_ILLUME_CONFORMANT", &ECORE_X_ATOM_E_ILLUME_CONFORMANT }
{ "_E_ILLUME_CONFORMANT", &ECORE_X_ATOM_E_ILLUME_CONFORMANT },
{ "_E_ILLUME_MODE", &ECORE_X_ATOM_E_ILLUME_MODE }
};
Atom *atoms;
char **names;

View File

@ -113,6 +113,31 @@ ecore_x_e_virtual_keyboard_state_send(Ecore_X_Window win, Ecore_X_Virtual_Keyboa
0, 0, 0, 0);
}
static Ecore_X_Atom
_ecore_x_e_illume_atom_get(Ecore_X_Illume_Mode mode)
{
switch (mode)
{
case ECORE_X_ILLUME_MODE_SINGLE:
return ECORE_X_ATOM_E_ILLUME_MODE_SINGLE;
case ECORE_X_ILLUME_MODE_DUAL:
return ECORE_X_ATOM_E_ILLUME_MODE_DUAL;
default:
return 0;
}
return 0;
}
static Ecore_X_Illume_Mode
_ecore_x_e_illume_mode_get(Ecore_X_Atom atom)
{
if (atom == ECORE_X_ATOM_E_ILLUME_MODE_SINGLE)
return ECORE_X_ILLUME_MODE_SINGLE;
if (atom == ECORE_X_ATOM_E_ILLUME_MODE_DUAL)
return ECORE_X_ILLUME_MODE_DUAL;
return ECORE_X_ILLUME_MODE_UNKNOWN;
}
EAPI void
ecore_x_e_illume_conformant_set(Ecore_X_Window win, unsigned int is_conformant)
{
@ -129,3 +154,32 @@ ecore_x_e_illume_conformant_get(Ecore_X_Window win)
return 0;
return val;
}
EAPI void
ecore_x_e_illume_mode_set(Ecore_X_Window win, Ecore_X_Illume_Mode mode)
{
Ecore_X_Atom atom = 0;
atom = _ecore_x_e_illume_atom_get(mode);
ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_E_ILLUME_MODE,
&atom, 1);
}
EAPI Ecore_X_Illume_Mode
ecore_x_e_illume_mode_get(Ecore_X_Window win)
{
Ecore_X_Atom atom = 0;
if (!ecore_x_window_prop_card32_get(win, ECORE_X_ATOM_E_ILLUME_MODE, &atom, 1))
return ECORE_X_ILLUME_MODE_UNKNOWN;
return _ecore_x_e_illume_mode_get(atom);
}
EAPI void
ecore_x_e_illume_mode_send(Ecore_X_Window win, Ecore_X_Illume_Mode mode)
{
ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_MODE,
ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
_ecore_x_e_illume_atom_get(mode),
0, 0, 0, 0);
}