diff options
author | Dave Davenport <qball@gmpclient.org> | 2016-01-07 19:47:37 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2016-01-07 19:47:37 +0100 |
commit | e8daff0f6ad49cd17b225622fa1875ee2960a70f (patch) | |
tree | 98573f33b525ffe0acbb378eb0367e8c658fc0cc /source/mode.c | |
parent | 51b5511017b632129df78d2906882abafd92c38a (diff) |
First cleanup steps.
Diffstat (limited to 'source/mode.c')
-rw-r--r-- | source/mode.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/source/mode.c b/source/mode.c new file mode 100644 index 00000000..7b8590d3 --- /dev/null +++ b/source/mode.c @@ -0,0 +1,39 @@ +#include "rofi.h" +#include "mode.h" + +// This one should only be in mode implementations. +#include "mode-private.h" +/** + * @ingroup MODE + * @{ + */ + +void mode_init ( Mode *mode ) +{ + g_assert ( mode != NULL ); + g_assert ( mode->_init != NULL ); + mode->_init ( mode ); +} + +void mode_destroy ( Mode *mode ) +{ + g_assert ( mode != NULL ); + g_assert ( mode->_destroy != NULL ); + mode->_destroy ( mode ); +} + +unsigned int mode_get_num_entries ( const Mode *mode ) +{ + g_assert ( mode != NULL ); + g_assert ( mode->_get_num_entries != NULL ); + return mode->_get_num_entries ( mode ); +} + +char * mode_get_display_value ( const Mode *mode, unsigned int selected_line, int *state, int get_entry ) +{ + g_assert ( mode != NULL ); + g_assert ( mode->mgrv != NULL ); + + return mode->mgrv ( mode, selected_line, state, get_entry ); +} +/*@}*/ |