refactor
This commit is contained in:
parent
5f9594cb23
commit
a6e63243f4
@ -6,6 +6,24 @@
|
|||||||
short int g_keycodes[512] = { 0 };
|
short int g_keycodes[512] = { 0 };
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
|
|
||||||
|
//-------------------------------------
|
||||||
|
struct mfb_window *
|
||||||
|
mfb_open(const char *title, unsigned width, unsigned height) {
|
||||||
|
return mfb_open_ex(title, width, height, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------
|
||||||
|
mfb_update_state
|
||||||
|
mfb_update(struct mfb_window *window, void *buffer) {
|
||||||
|
if (window == 0x0) {
|
||||||
|
return STATE_INVALID_WINDOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
SWindowData *window_data = (SWindowData *) window;
|
||||||
|
|
||||||
|
return mfb_update_ex(window, buffer, window_data->buffer_width, window_data->buffer_height);
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
void
|
void
|
||||||
mfb_set_active_callback(struct mfb_window *window, mfb_active_func callback) {
|
mfb_set_active_callback(struct mfb_window *window, mfb_active_func callback) {
|
||||||
|
@ -53,12 +53,6 @@ create_window_data(unsigned width, unsigned height) {
|
|||||||
return window_data;
|
return window_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------
|
|
||||||
struct mfb_window *
|
|
||||||
mfb_open(const char *title, unsigned width, unsigned height) {
|
|
||||||
return mfb_open_ex(title, width, height, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
struct mfb_window *
|
struct mfb_window *
|
||||||
mfb_open_ex(const char *title, unsigned width, unsigned height, unsigned flags) {
|
mfb_open_ex(const char *title, unsigned width, unsigned height, unsigned flags) {
|
||||||
@ -122,17 +116,6 @@ destroy_window_data(SWindowData *window_data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------
|
|
||||||
mfb_update_state
|
|
||||||
mfb_update(struct mfb_window *window, void *buffer) {
|
|
||||||
if (window == 0x0) {
|
|
||||||
return STATE_INVALID_WINDOW;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWindowData *window_data = (SWindowData *) window;
|
|
||||||
return mfb_update_ex(window, buffer, window_data->buffer_width, window_data->buffer_height);
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
mfb_update_state
|
mfb_update_state
|
||||||
mfb_update_ex(struct mfb_window *window, void *buffer, unsigned width, unsigned height) {
|
mfb_update_ex(struct mfb_window *window, void *buffer, unsigned width, unsigned height) {
|
||||||
|
@ -60,12 +60,6 @@ create_window_data(unsigned width, unsigned height) {
|
|||||||
return window_data;
|
return window_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------
|
|
||||||
struct mfb_window *
|
|
||||||
mfb_open(const char *title, unsigned width, unsigned height) {
|
|
||||||
return mfb_open_ex(title, width, height, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
struct mfb_window *
|
struct mfb_window *
|
||||||
mfb_open_ex(const char *title, unsigned width, unsigned height, unsigned flags) {
|
mfb_open_ex(const char *title, unsigned width, unsigned height, unsigned flags) {
|
||||||
@ -223,16 +217,6 @@ update_events(SWindowData *window_data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------
|
|
||||||
mfb_update_state
|
|
||||||
mfb_update(struct mfb_window *window, void *buffer) {
|
|
||||||
if(window == 0x0) {
|
|
||||||
return STATE_INVALID_WINDOW;
|
|
||||||
}
|
|
||||||
SWindowData *window_data = (SWindowData *) window;
|
|
||||||
return mfb_update_ex(window, buffer, window_data->buffer_width, window_data->buffer_height);
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
mfb_update_state
|
mfb_update_state
|
||||||
mfb_update_ex(struct mfb_window *window, void *buffer, unsigned width, unsigned height) {
|
mfb_update_ex(struct mfb_window *window, void *buffer, unsigned width, unsigned height) {
|
||||||
|
@ -562,11 +562,6 @@ static const struct wl_shell_surface_listener shell_surface_listener = {
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
struct mfb_window *
|
|
||||||
mfb_open(const char *title, unsigned width, unsigned height) {
|
|
||||||
return mfb_open_ex(title, width, height, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct mfb_window *
|
struct mfb_window *
|
||||||
mfb_open_ex(const char *title, unsigned width, unsigned height, unsigned flags)
|
mfb_open_ex(const char *title, unsigned width, unsigned height, unsigned flags)
|
||||||
{
|
{
|
||||||
@ -700,18 +695,6 @@ wl_callback_listener frame_listener = {
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
mfb_update_state
|
|
||||||
mfb_update(struct mfb_window *window, void *buffer) {
|
|
||||||
if (window == 0x0) {
|
|
||||||
return STATE_INVALID_WINDOW;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWindowData *window_data = (SWindowData *) window;
|
|
||||||
return mfb_update_ex(window, buffer, window_data->buffer_width, window_data->buffer_height);
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
mfb_update_state
|
mfb_update_state
|
||||||
mfb_update_ex(struct mfb_window *window, void *buffer, unsigned width, unsigned height)
|
mfb_update_ex(struct mfb_window *window, void *buffer, unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
|
@ -366,24 +366,6 @@ mfb_open_ex(const char *title, unsigned width, unsigned height, unsigned flags)
|
|||||||
return (struct mfb_window *) window_data;
|
return (struct mfb_window *) window_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct mfb_window *
|
|
||||||
mfb_open(const char *title, unsigned width, unsigned height) {
|
|
||||||
return mfb_open_ex(title, width, height, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
mfb_update_state
|
|
||||||
mfb_update(struct mfb_window *window, void *buffer) {
|
|
||||||
if (window == 0x0) {
|
|
||||||
return STATE_INVALID_WINDOW;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWindowData *window_data = (SWindowData *) window;
|
|
||||||
|
|
||||||
return mfb_update_ex(window, buffer, window_data->buffer_width, window_data->buffer_height);
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
mfb_update_state
|
mfb_update_state
|
||||||
|
@ -197,11 +197,6 @@ mfb_open_ex(const char *title, unsigned width, unsigned height, unsigned flags)
|
|||||||
return (struct mfb_window *) window_data;
|
return (struct mfb_window *) window_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct mfb_window *
|
|
||||||
mfb_open(const char *title, unsigned width, unsigned height) {
|
|
||||||
return mfb_open_ex(title, width, height, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int translate_key(int scancode);
|
int translate_key(int scancode);
|
||||||
@ -322,18 +317,6 @@ processEvents(SWindowData *window_data) {
|
|||||||
|
|
||||||
void destroy_window_data(SWindowData *window_data);
|
void destroy_window_data(SWindowData *window_data);
|
||||||
|
|
||||||
mfb_update_state
|
|
||||||
mfb_update(struct mfb_window *window, void *buffer) {
|
|
||||||
if (window == 0x0) {
|
|
||||||
return STATE_INVALID_WINDOW;
|
|
||||||
}
|
|
||||||
|
|
||||||
SWindowData *window_data = (SWindowData *) window;
|
|
||||||
mfb_update_ex(window, buffer, window_data->buffer_width, window_data->buffer_height);
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
mfb_update_state
|
mfb_update_state
|
||||||
mfb_update_ex(struct mfb_window *window, void *buffer, unsigned width, unsigned height) {
|
mfb_update_ex(struct mfb_window *window, void *buffer, unsigned width, unsigned height) {
|
||||||
if (window == 0x0) {
|
if (window == 0x0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user