From 0423c55dc1aa19887c47437f65c6046475f69437 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 15 Sep 2017 11:56:08 +0530 Subject: [PATCH] Move a few externs into appropriate header files --- kitty/child-monitor.c | 2 -- kitty/data-types.h | 4 +++- kitty/glfw.c | 3 --- kitty/mouse.c | 1 - kitty/state.h | 2 ++ 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/kitty/child-monitor.c b/kitty/child-monitor.c index d13736573..6c7a978ba 100644 --- a/kitty/child-monitor.c +++ b/kitty/child-monitor.c @@ -492,8 +492,6 @@ render_cursor(Window *w, double now) { } } -extern bool drag_scroll(Window *); - static inline bool render(ChildMonitor *self, double now) { double time_since_last_render = now - last_render_at; diff --git a/kitty/data-types.h b/kitty/data-types.h index ffbdfa74e..75a42ae99 100644 --- a/kitty/data-types.h +++ b/kitty/data-types.h @@ -314,4 +314,6 @@ void copy_color_table_to_buffer(ColorProfile *self, void *address, int offset, s unsigned int safe_wcwidth(uint32_t ch); void change_wcwidth(bool use9); - +void set_mouse_cursor(MouseShape); +void mouse_event(int, int); +void scroll_event(double, double); diff --git a/kitty/glfw.c b/kitty/glfw.c index f4dc67843..c183c26b4 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -67,9 +67,6 @@ key_callback(GLFWwindow UNUSED *w, int key, int scancode, int action, int mods) WINDOW_CALLBACK(key_callback, "iiii", key, scancode, action, mods); } -extern void mouse_event(int, int); -extern void scroll_event(double, double); - static void mouse_button_callback(GLFWwindow *w, int button, int action, int mods) { if (!global_state.mouse_visible) { glfwSetInputMode(w, GLFW_CURSOR, GLFW_CURSOR_NORMAL); global_state.mouse_visible = true; } diff --git a/kitty/mouse.c b/kitty/mouse.c index 9d45e1ab1..00030cdc1 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -12,7 +12,6 @@ #include #include -extern void set_mouse_cursor(MouseShape); static MouseShape mouse_cursor_shape = BEAM; typedef enum MouseActions { PRESS, RELEASE, DRAG, MOVE } MouseAction; diff --git a/kitty/state.h b/kitty/state.h index 980e8c6ec..c268ced3d 100644 --- a/kitty/state.h +++ b/kitty/state.h @@ -74,7 +74,9 @@ typedef struct { PyObject *boss; bool is_key_pressed[MAX_KEY_COUNT]; } GlobalState; + extern GlobalState global_state; +bool drag_scroll(Window *); #define EXTERNAL_FUNC(name, ret, ...) typedef ret (*name##_func)(__VA_ARGS__); extern name##_func name #define EXTERNAL_FUNC0(name, ret) typedef ret (*name##_func)(); extern name##_func name