summaryrefslogtreecommitdiffstats
path: root/include/rofi.h
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-01-20 18:24:31 +0100
committerDave Davenport <qball@gmpclient.org>2016-01-20 18:24:31 +0100
commitd0716efe12487668fcab9ba55f8e75da87058ff5 (patch)
tree42a4953393e99f62ceed2818d88b5e35a904289c /include/rofi.h
parent94cbe3a00518cac898f58b6a89da6da52809ffc9 (diff)
Refactor menu function into three parts, setup, itterrate and finalize.
Diffstat (limited to 'include/rofi.h')
-rw-r--r--include/rofi.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/include/rofi.h b/include/rofi.h
index a43a29eb..c1824090 100644
--- a/include/rofi.h
+++ b/include/rofi.h
@@ -17,6 +17,7 @@
* Pointer to xdg cache directory.
*/
extern const char *cache_dir;
+typedef struct MenuState MenuState;
/**
* @param msg The error message to show.
@@ -49,12 +50,11 @@ typedef enum
*
* @returns The command issued (see MenuReturn)
*/
-MenuReturn menu ( Mode *sw,
- char **input, char *prompt,
- unsigned int *selected_line,
- unsigned int *next_pos,
+MenuState *menu ( Mode *sw,
+ char *input, char *prompt,
+ unsigned int selected_line,
const char *message, MenuFlags flags )
-__attribute__ ( ( nonnull ( 1, 2, 3, 4 ) ) );
+__attribute__ ( ( nonnull ( 1, 2, 3 ) ) );
/** Reset terminal */
#define color_reset "\033[0m"
@@ -84,5 +84,13 @@ int show_error_message ( const char *msg, int markup );
" * The version of rofi you are running\n\n" \
" <i>https://github.com/DaveDavenport/rofi/</i>"
#define ERROR_MSG_MARKUP TRUE
+
+MenuReturn menu_state_get_return_value ( const MenuState *state );
+unsigned int menu_state_get_selected_line ( const MenuState *state );
+unsigned int menu_state_get_next_position ( const MenuState *state );
+void menu_state_itterrate ( MenuState *state, XEvent *event );
+unsigned int menu_state_get_completed ( const MenuState *state );
+const char * menu_state_get_user_input ( const MenuState *state );
+void menu_state_free ( MenuState *state );
/*@}*/
#endif