and add selection clear handling... and we are done.. :)

SVN revision: 4326
This commit is contained in:
Carsten Haitzler 2001-03-06 15:38:31 +00:00
parent bfe83cebfe
commit 8e7257a0bf
2 changed files with 25 additions and 2 deletions

View File

@ -183,8 +183,6 @@ void e_window_no_ignore(Window win);
int e_window_is_ignored(Window win);
Window e_window_get_at_xy(int x, int y);
char *e_selection_get_data(Window win, Atom prop);
int e_window_dnd_capable(Window win);
void e_window_dnd_handle_motion(Window source_win, int x, int y,
@ -274,6 +272,8 @@ char *e_window_get_title(Window win);
void e_keyboard_grab(Window win);
void e_keyboard_ungrab(void);
char *e_selection_get_data(Window win, Atom prop);
Window e_selection_request(void);
Window e_selection_set(char *string);
@ -321,6 +321,7 @@ typedef struct _ev_dnd_drop Ev_Dnd_Drop;
typedef struct _ev_dnd_drop_status Ev_Dnd_Drop_Status;
typedef struct _ev_dnd_data_request Ev_Dnd_Data_Request;
typedef struct _ev_paste_request Ev_Paste_Request;
typedef struct _ev_clear_selection Ev_Clear_Selection;
enum _eev_stack_detail
{
@ -379,6 +380,7 @@ enum _eev_type
EV_DND_DROP_STATUS,
EV_DND_DATA_REQUEST,
EV_PASTE_REQUEST,
EV_CLEAR_SELECTION,
EV_CHILD,
EV_USER,
@ -636,6 +638,12 @@ struct _ev_paste_request
char *string;
};
struct _ev_clear_selection
{
Window win, root;
Atom selection;
};
struct _ev_dnd_drop_request
{
Window win, root, source_win;

View File

@ -37,6 +37,7 @@ static void e_ev_x_handle_circulate_request(XEvent * xevent);
static void e_ev_x_handle_property_notify(XEvent * xevent);
static void e_ev_x_handle_colormap_notify(XEvent * xevent);
static void e_ev_x_handle_selection_notify(XEvent * xevent);
static void e_ev_x_handle_selection_clear(XEvent * xevent);
static void e_ev_x_handle_selection_request(XEvent * xevent);
static void e_ev_x_handle_client_message(XEvent * xevent);
static void e_ev_x_handle_shape_change(XEvent * xevent);
@ -97,6 +98,7 @@ e_ev_x_init(void)
event_translator[ColormapNotify] = e_ev_x_handle_colormap_notify;
event_translator[ClientMessage] = e_ev_x_handle_client_message;
event_translator[SelectionNotify] = e_ev_x_handle_selection_notify;
event_translator[SelectionClear] = e_ev_x_handle_selection_clear;
event_translator[SelectionRequest] = e_ev_x_handle_selection_request;
event_translator[shape_event_id] = e_ev_x_handle_shape_change;
@ -887,6 +889,19 @@ e_ev_x_handle_selection_notify(XEvent * xevent)
ev_drop_request_pending = NULL;
}
static void
e_ev_x_handle_selection_clear(XEvent * xevent)
{
Ev_Clear_Selection *e;
e = NEW(Ev_Clear_Selection, 1);
e->win = xevent->xselectionclear.window;
printf("%x\n", e->win);
e->root = e_window_get_root(e->win);
e->selection = xevent->xselectionclear.selection;
e_add_event(EV_CLEAR_SELECTION, e, e_ev_generic_free);
}
static void
e_ev_x_handle_selection_request(XEvent * xevent)
{