Moved events into events.c
This commit is contained in:
parent
40601a240f
commit
08fed97811
4 changed files with 32 additions and 12 deletions
20
src/kiwmi/events.c
Normal file
20
src/kiwmi/events.c
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#include "events.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <xcb/xcb.h>
|
||||||
|
|
||||||
|
void
|
||||||
|
handle_xcb_event(xcb_generic_event_t *event)
|
||||||
|
{
|
||||||
|
switch (event->response_type) {
|
||||||
|
case XCB_CREATE_NOTIFY:
|
||||||
|
// TODO: insert into tree
|
||||||
|
break;
|
||||||
|
case XCB_DESTROY_NOTIFY:
|
||||||
|
// TODO: destroy window
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
free(event);
|
||||||
|
}
|
8
src/kiwmi/events.h
Normal file
8
src/kiwmi/events.h
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#ifndef EVENTS_H
|
||||||
|
#define EVENTS_H
|
||||||
|
|
||||||
|
#include <xcb/xcb.h>
|
||||||
|
|
||||||
|
void handle_xcb_event(xcb_generic_event_t *event);
|
||||||
|
|
||||||
|
#endif /* EVENTS_H */
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
|
|
||||||
|
#include "events.h"
|
||||||
#include "ipc.h"
|
#include "ipc.h"
|
||||||
#include "xcb.h"
|
#include "xcb.h"
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,13 @@
|
||||||
|
|
||||||
#include "xcb.h"
|
#include "xcb.h"
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#define ROOT_MASK ( XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT )
|
#define ROOT_MASK ( XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY )
|
||||||
|
|
||||||
int g_dpy_fd;
|
int g_dpy_fd;
|
||||||
xcb_connection_t *g_dpy;
|
xcb_connection_t *g_dpy;
|
||||||
|
@ -53,14 +55,3 @@ init_xcb(void)
|
||||||
|
|
||||||
g_dpy_fd = xcb_get_file_descriptor(g_dpy);
|
g_dpy_fd = xcb_get_file_descriptor(g_dpy);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
handle_xcb_event(xcb_generic_event_t *event)
|
|
||||||
{
|
|
||||||
// TODO: handle event
|
|
||||||
|
|
||||||
switch (event->response_type) {
|
|
||||||
}
|
|
||||||
|
|
||||||
free(event);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue