Code

doc/ncmpc.1: update connection setup, add local socket
[ncmpc.git] / src / screen_interface.h
index 7a8fdc604cf0a0439ff3debce15fbadd463320b6..e11813a10f88ca1395ae773d63d9164faf2758da 100644 (file)
@@ -1,5 +1,5 @@
 /* ncmpc (Ncurses MPD Client)
- * (c) 2004-2009 The Music Player Daemon Project
+ * (c) 2004-2017 The Music Player Daemon Project
  * Project homepage: http://musicpd.org
  *
  * This program is free software; you can redistribute it and/or modify
 
 #include "config.h"
 #include "command.h"
+#include "ncmpc_curses.h"
 
 #include <stdbool.h>
 #include <stddef.h>
 
-#ifdef HAVE_NCURSESW_NCURSES_H
-#include <ncursesw/ncurses.h>
-#else
-#include <ncurses.h>
-#endif
-
 struct mpdclient;
 
-typedef struct screen_functions {
-       void (*init)(WINDOW *w, int cols, int rows);
+struct screen_functions {
+       void (*init)(WINDOW *w, unsigned cols, unsigned rows);
        void (*exit)(void);
        void (*open)(struct mpdclient *c);
        void (*close)(void);
-       void (*resize)(int cols, int rows);
+       void (*resize)(unsigned cols, unsigned rows);
        void (*paint)(void);
        void (*update)(struct mpdclient *c);
+
+       /**
+        * Handle a command.
+        *
+        * @returns true if the command should not be handled by the ncmpc core.
+        */
        bool (*cmd)(struct mpdclient *c, command_t cmd);
+
+#ifdef HAVE_GETMOUSE
+       /**
+        * Handle a mouse event.
+        *
+        * @return true if the event was handled (and should not be
+        * handled by the ncmpc core)
+        */
+       bool (*mouse)(struct mpdclient *c, int x, int y, mmask_t bstate);
+#endif
+
        const char *(*get_title)(char *s, size_t size);
-} screen_functions_t;
+};
 
 #endif