summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpuppetmaster <puppetmaster>2005-07-30 18:51:39 +0000
committerpuppetmaster <puppetmaster>2005-07-30 18:51:39 +0000
commit80a07831113345cf2278b44a064e1221d87e459c (patch)
tree28161c191e811bebf626232deda8640424493ee2
parentfix for XSetWindowAttributs typedef (raster remarque) (diff)
downloadelock-80a07831113345cf2278b44a064e1221d87e459c.tar.gz
it COMPILESVN_Import
-rw-r--r--ecore/src/lib/ecore_x/ecore_x.c6
-rw-r--r--ecore/src/lib/ecore_x/ecore_x_private.h232
-rw-r--r--ecore/src/lib/ecore_x/ecore_x_screensaver.c31
3 files changed, 139 insertions, 130 deletions
diff --git a/ecore/src/lib/ecore_x/ecore_x.c b/ecore/src/lib/ecore_x/ecore_x.c
index b6a7db5..bde19f5 100644
--- a/ecore/src/lib/ecore_x/ecore_x.c
+++ b/ecore/src/lib/ecore_x/ecore_x.c
@@ -22,6 +22,8 @@ static Ecore_Event_Filter *_ecore_x_filter_handler = NULL;
static int _ecore_x_event_shape_id = 0;
static int _ecore_x_event_sync_id = 0;
static int _ecore_x_event_scrnsaver_id = 0;
+static int *ecore_x_screensaver_v_major = NULL;
+static int *ecore_x_screensaver_v_minor = NULL;
static int _ecore_x_event_handlers_num = 0;
static void (**_ecore_x_event_handlers) (XEvent * event) = NULL;
@@ -228,11 +230,9 @@ ecore_x_init(const char *name)
if (XScreenSaverQueryExtension
(_ecore_x_disp, &scrnsaver_base, &scrnsaver_err_base))
{
- int v_major, v_minor;
-
_ecore_x_event_scrnsaver_id = scrnsaver_base + ScreenSaverNotify;
- if (!XScreenSaverQueryVersion(_ecore_x_disp, v_major, v_minor))
+ if (!XScreenSaverQueryVersion(_ecore_x_disp, ecore_x_screensaver_v_major, ecore_x_screensaver_v_minor))
_ecore_x_event_scrnsaver_id = 0;
}
diff --git a/ecore/src/lib/ecore_x/ecore_x_private.h b/ecore/src/lib/ecore_x/ecore_x_private.h
index 3b50671..233b34b 100644
--- a/ecore/src/lib/ecore_x/ecore_x_private.h
+++ b/ecore/src/lib/ecore_x/ecore_x_private.h
@@ -40,33 +40,34 @@ typedef struct _Ecore_X_Reply Ecore_X_Reply;
struct _Ecore_X_Reply
{
/* FIXME: this is for simulation only */
- Ecore_Job *job;
-
- void *reply_data;
- void (*reply_data_free) (void *reply_data);
-
- void (*func) (void *data, Ecore_X_Reply *reply, void *reply_data);
- void *data;
+ Ecore_Job *job;
+
+ void *reply_data;
+ void (*reply_data_free) (void *reply_data);
+
+ void (*func) (void *data, Ecore_X_Reply * reply,
+ void *reply_data);
+ void *data;
};
typedef struct _Ecore_X_Selection_Intern Ecore_X_Selection_Intern;
struct _Ecore_X_Selection_Intern
{
- Ecore_X_Window win;
- Ecore_X_Atom selection;
- unsigned char *data;
- int length;
- Time time;
+ Ecore_X_Window win;
+ Ecore_X_Atom selection;
+ unsigned char *data;
+ int length;
+ Time time;
};
typedef struct _Ecore_X_Selection_Converter Ecore_X_Selection_Converter;
struct _Ecore_X_Selection_Converter
{
- Ecore_X_Atom target;
- int (*convert)(char *target, void *data, int size,
- void **data_ret, int *size_ret);
+ Ecore_X_Atom target;
+ int (*convert) (char *target, void *data, int size,
+ void **data_ret, int *size_ret);
Ecore_X_Selection_Converter *next;
};
@@ -74,134 +75,147 @@ typedef struct _Ecore_X_Selection_Parser Ecore_X_Selection_Parser;
struct _Ecore_X_Selection_Parser
{
- char *target;
- void *(*parse)(const char *target, unsigned char *data, int size);
+ char *target;
+ void *(*parse) (const char *target, unsigned char *data,
+ int size);
Ecore_X_Selection_Parser *next;
};
-typedef struct _Ecore_X_DND_Source
+typedef struct _Ecore_X_DND_Source
{
- int version;
- Ecore_X_Window win, dest;
-
- enum {
+ int version;
+ Ecore_X_Window win, dest;
+
+ enum
+ {
ECORE_X_DND_SOURCE_IDLE,
ECORE_X_DND_SOURCE_DRAGGING,
ECORE_X_DND_SOURCE_DROPPED,
ECORE_X_DND_SOURCE_CONVERTING
} state;
- struct {
- short x, y;
- unsigned short width, height;
+ struct
+ {
+ short x, y;
+ unsigned short width, height;
} rectangle;
- Time time;
+ Time time;
+
+ Ecore_X_Atom action, accepted_action;
- Ecore_X_Atom action, accepted_action;
-
- int will_accept;
- int suppress;
+ int will_accept;
+ int suppress;
- int await_status;
+ int await_status;
} Ecore_X_DND_Source;
-typedef struct _Ecore_X_DND_Target
+typedef struct _Ecore_X_DND_Target
{
- int version;
- Ecore_X_Window win, source;
-
- enum {
+ int version;
+ Ecore_X_Window win, source;
+
+ enum
+ {
ECORE_X_DND_TARGET_IDLE,
ECORE_X_DND_TARGET_ENTERED
} state;
- struct {
- int x, y;
+ struct
+ {
+ int x, y;
} pos;
-
- Time time;
- Ecore_X_Atom action, accepted_action;
-
- int will_accept;
+ Time time;
+
+ Ecore_X_Atom action, accepted_action;
+
+ int will_accept;
} Ecore_X_DND_Target;
-extern Display *_ecore_x_disp;
-extern double _ecore_x_double_click_time;
-extern Time _ecore_x_event_last_time;
-extern Window _ecore_x_event_last_win;
-extern int _ecore_x_event_last_root_x;
-extern int _ecore_x_event_last_root_y;
-extern int _ecore_x_xcursor;
+extern Display *_ecore_x_disp;
+extern int _ecore_x_event_scrnsaver_id;
+extern int *ecore_x_screensaver_v_major;
+extern int *ecore_x_screensaver_v_minor;
+
+extern double _ecore_x_double_click_time;
+extern Time _ecore_x_event_last_time;
+extern Window _ecore_x_event_last_win;
+extern int _ecore_x_event_last_root_x;
+extern int _ecore_x_event_last_root_y;
+extern int _ecore_x_xcursor;
-extern Ecore_X_Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
+extern Ecore_X_Atom _ecore_x_atoms_wm_protocols[ECORE_X_WM_PROTOCOL_NUM];
-extern int _ecore_window_grabs_num;
-extern Window *_ecore_window_grabs;
-extern int (*_ecore_window_grab_replay_func) (void *data, int event_type, void *event);
-extern void *_ecore_window_grab_replay_data;
+extern int _ecore_window_grabs_num;
+extern Window *_ecore_window_grabs;
+extern int (*_ecore_window_grab_replay_func) (void *data,
+ int event_type,
+ void *event);
+extern void *_ecore_window_grab_replay_data;
extern Ecore_X_Window _ecore_x_private_win;
-void _ecore_x_error_handler_init(void);
-void _ecore_x_event_handle_key_press(XEvent *xevent);
-void _ecore_x_event_handle_key_release(XEvent *xevent);
-void _ecore_x_event_handle_button_press(XEvent *xevent);
-void _ecore_x_event_handle_button_release(XEvent *xevent);
-void _ecore_x_event_handle_motion_notify(XEvent *xevent);
-void _ecore_x_event_handle_enter_notify(XEvent *xevent);
-void _ecore_x_event_handle_leave_notify(XEvent *xevent);
-void _ecore_x_event_handle_focus_in(XEvent *xevent);
-void _ecore_x_event_handle_focus_out(XEvent *xevent);
-void _ecore_x_event_handle_keymap_notify(XEvent *xevent);
-void _ecore_x_event_handle_expose(XEvent *xevent);
-void _ecore_x_event_handle_graphics_expose(XEvent *xevent);
-void _ecore_x_event_handle_visibility_notify(XEvent *xevent);
-void _ecore_x_event_handle_create_notify(XEvent *xevent);
-void _ecore_x_event_handle_destroy_notify(XEvent *xevent);
-void _ecore_x_event_handle_unmap_notify(XEvent *xevent);
-void _ecore_x_event_handle_map_notify(XEvent *xevent);
-void _ecore_x_event_handle_map_request(XEvent *xevent);
-void _ecore_x_event_handle_reparent_notify(XEvent *xevent);
-void _ecore_x_event_handle_configure_notify(XEvent *xevent);
-void _ecore_x_event_handle_configure_request(XEvent *xevent);
-void _ecore_x_event_handle_gravity_notify(XEvent *xevent);
-void _ecore_x_event_handle_resize_request(XEvent *xevent);
-void _ecore_x_event_handle_circulate_notify(XEvent *xevent);
-void _ecore_x_event_handle_circulate_request(XEvent *xevent);
-void _ecore_x_event_handle_property_notify(XEvent *xevent);
-void _ecore_x_event_handle_selection_clear(XEvent *xevent);
-void _ecore_x_event_handle_selection_request(XEvent *xevent);
-void _ecore_x_event_handle_selection_notify(XEvent *xevent);
-void _ecore_x_event_handle_colormap_notify(XEvent *xevent);
-void _ecore_x_event_handle_client_message(XEvent *xevent);
-void _ecore_x_event_handle_mapping_notify(XEvent *xevent);
-void _ecore_x_event_handle_shape_change(XEvent *xevent);
-void _ecore_x_event_handle_sync_counter(XEvent *xevent);
-void _ecore_x_event_handle_sync_alarm(XEvent *xevent);
-
-void _ecore_x_selection_data_init(void);
-void _ecore_x_selection_shutdown(void);
-Ecore_X_Atom
- _ecore_x_selection_target_atom_get(const char *target);
-char *_ecore_x_selection_target_get(Ecore_X_Atom target);
-Ecore_X_Selection_Intern *
- _ecore_x_selection_get(Ecore_X_Atom selection);
-int _ecore_x_selection_set(Window w, unsigned char *data, int len, Ecore_X_Atom selection);
-int _ecore_x_selection_convert(Ecore_X_Atom selection, Ecore_X_Atom target, void **data_ret);
-void *_ecore_x_selection_parse(const char *target, unsigned char *data, int size);
-
-void _ecore_x_sync_magic_send(int val, Ecore_X_Window swin);
-void _ecore_x_window_grab_remove(Ecore_X_Window win);
-void _ecore_x_key_grab_remove(Ecore_X_Window win);
+void _ecore_x_error_handler_init(void);
+void _ecore_x_event_handle_key_press(XEvent * xevent);
+void _ecore_x_event_handle_key_release(XEvent * xevent);
+void _ecore_x_event_handle_button_press(XEvent * xevent);
+void _ecore_x_event_handle_button_release(XEvent * xevent);
+void _ecore_x_event_handle_motion_notify(XEvent * xevent);
+void _ecore_x_event_handle_enter_notify(XEvent * xevent);
+void _ecore_x_event_handle_leave_notify(XEvent * xevent);
+void _ecore_x_event_handle_focus_in(XEvent * xevent);
+void _ecore_x_event_handle_focus_out(XEvent * xevent);
+void _ecore_x_event_handle_keymap_notify(XEvent * xevent);
+void _ecore_x_event_handle_expose(XEvent * xevent);
+void _ecore_x_event_handle_graphics_expose(XEvent * xevent);
+void _ecore_x_event_handle_visibility_notify(XEvent * xevent);
+void _ecore_x_event_handle_create_notify(XEvent * xevent);
+void _ecore_x_event_handle_destroy_notify(XEvent * xevent);
+void _ecore_x_event_handle_unmap_notify(XEvent * xevent);
+void _ecore_x_event_handle_map_notify(XEvent * xevent);
+void _ecore_x_event_handle_map_request(XEvent * xevent);
+void _ecore_x_event_handle_reparent_notify(XEvent * xevent);
+void _ecore_x_event_handle_configure_notify(XEvent * xevent);
+void _ecore_x_event_handle_configure_request(XEvent * xevent);
+void _ecore_x_event_handle_gravity_notify(XEvent * xevent);
+void _ecore_x_event_handle_resize_request(XEvent * xevent);
+void _ecore_x_event_handle_circulate_notify(XEvent * xevent);
+void _ecore_x_event_handle_circulate_request(XEvent * xevent);
+void _ecore_x_event_handle_property_notify(XEvent * xevent);
+void _ecore_x_event_handle_selection_clear(XEvent * xevent);
+void _ecore_x_event_handle_selection_request(XEvent * xevent);
+void _ecore_x_event_handle_selection_notify(XEvent * xevent);
+void _ecore_x_event_handle_colormap_notify(XEvent * xevent);
+void _ecore_x_event_handle_client_message(XEvent * xevent);
+void _ecore_x_event_handle_mapping_notify(XEvent * xevent);
+void _ecore_x_event_handle_shape_change(XEvent * xevent);
+void _ecore_x_event_handle_sync_counter(XEvent * xevent);
+void _ecore_x_event_handle_sync_alarm(XEvent * xevent);
+
+void _ecore_x_selection_data_init(void);
+void _ecore_x_selection_shutdown(void);
+Ecore_X_Atom _ecore_x_selection_target_atom_get(const char *target);
+char *_ecore_x_selection_target_get(Ecore_X_Atom target);
+Ecore_X_Selection_Intern *_ecore_x_selection_get(Ecore_X_Atom selection);
+int _ecore_x_selection_set(Window w, unsigned char *data,
+ int len, Ecore_X_Atom selection);
+int _ecore_x_selection_convert(Ecore_X_Atom selection,
+ Ecore_X_Atom target,
+ void **data_ret);
+void *_ecore_x_selection_parse(const char *target,
+ unsigned char *data, int size);
+
+void _ecore_x_sync_magic_send(int val, Ecore_X_Window swin);
+void _ecore_x_window_grab_remove(Ecore_X_Window win);
+void _ecore_x_key_grab_remove(Ecore_X_Window win);
/* from dnd */
-void _ecore_x_dnd_init(void);
+void _ecore_x_dnd_init(void);
Ecore_X_DND_Source *_ecore_x_dnd_source_get(void);
Ecore_X_DND_Target *_ecore_x_dnd_target_get(void);
-void _ecore_x_dnd_drag(int x, int y);
-void _ecore_x_dnd_shutdown(void);
+void _ecore_x_dnd_drag(int x, int y);
+void _ecore_x_dnd_shutdown(void);
/* from netwm */
Ecore_X_Window_State _ecore_x_netwm_state_get(Ecore_X_Atom a);
diff --git a/ecore/src/lib/ecore_x/ecore_x_screensaver.c b/ecore/src/lib/ecore_x/ecore_x_screensaver.c
index 9abd149..af07daf 100644
--- a/ecore/src/lib/ecore_x/ecore_x_screensaver.c
+++ b/ecore/src/lib/ecore_x/ecore_x_screensaver.c
@@ -36,7 +36,7 @@ ecore_x_screensaver_free_alloc_info(XScreenSaverInfo * info)
}
void
-ecore_x_screensaver_set_attributes(Ecore_X_Window_Set_Attributes attr)
+ecore_x_screensaver_set_attributes(Ecore_X_Set_Window_Attributes attr)
{
Ecore_X_Window root;
int screen;
@@ -66,45 +66,40 @@ ecore_x_screensaver_add(void)
XEvent event;
Ecore_X_Window root;
XScreenSaverNotifyEvent *se;
- Ecore_X_Set_Attributes attributes;
+ Ecore_X_Set_Window_Attributes attributes;
root = DefaultRootWindow(_ecore_x_disp);
screen = DefaultScreen(_ecore_x_disp);
gc = DefaultGC(_ecore_x_disp, screen);
- if (!XScreenSaverSelectInput
- (_ecore_x_disp, root, ScreenSaverNotifyMask | ScreenSaverCycleMask))
- return 1;
+ XScreenSaverSelectInput(_ecore_x_disp, root, ScreenSaverNotifyMask | ScreenSaverCycleMask);
- if (!ecore_x_screensaver_set_attributes(attributes))
- return 1;
+ ecore_x_screensaver_set_attributes(attributes);
if (!XSetForeground(_ecore_x_disp, gc, WhitePixel(_ecore_x_disp, screen)))
return 1;
- while (Xpending(_ecore_x_disp))
+ while (XPending(_ecore_x_disp))
{
if (!XNextEvent(_ecore_x_disp, &event))
return 1;
- if (event.type == _ecore_x_event_scrnsaver_id)
+ if (event.type == _ecore_x_event_scrnsaver_id )
{
- se = (XScreenSaverNotifyEvent *) & pe;
+ se = (XScreenSaverNotifyEvent *) & event;
if (se->state == ScreenSaverOn && se->kind == ScreenSaverExternal)
{
/*START THE EDJE SCREENSAVER PROBABLY HERE */
- XDrawString(_ecore_x_disp, 100, 100, "Ecore ScreeSaver", 17);
+ XDrawString(_ecore_x_disp, root, gc, 100, 100, "Ecore ScreeSaver", 17);
XSync(_ecore_x_disp, False);
}
}
}
-return 0}
+ return 0;
+}
-int ecore_x_screensaver_unset_attributes
+void
+ecore_x_screensaver_unset_attributes()
{
- if (!XScreenSaverUnsetAttributes
- (_ecore_x_disp, DefaultRootWindow(_ecore_x_disp)))
- return 1;
- else
- return 0;
+ XScreenSaverUnsetAttributes (_ecore_x_disp, DefaultRootWindow(_ecore_x_disp));
}