diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-03-01 09:57:54 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-03-01 09:57:54 +0100 |
commit | 45c70cbecf980769ec5cda10e1186bf3d7dcb580 (patch) | |
tree | 6f226bd82cc54a4aad62a75048e8329510eb28b6 /include | |
parent | 8aac855fe045bc3e388dc888b01ed3438522f0f8 (diff) |
Allow modes to set message box, instead of view creation argument.
Diffstat (limited to 'include')
-rw-r--r-- | include/mode-private.h | 13 | ||||
-rw-r--r-- | include/mode.h | 9 | ||||
-rw-r--r-- | include/view.h | 3 |
3 files changed, 22 insertions, 3 deletions
diff --git a/include/mode-private.h b/include/mode-private.h index a4b06c74..935402e4 100644 --- a/include/mode-private.h +++ b/include/mode-private.h @@ -1,7 +1,7 @@ #ifndef ROFI_MODE_PRIVATE_H #define ROFI_MODE_PRIVATE_H -#define ABI_VERSION 0x00000001 +#define ABI_VERSION 0x00000002 /** * @param data Pointer to #Mode object. @@ -94,6 +94,15 @@ typedef ModeMode ( *_mode_result )( Mode *sw, int menu_retv, char **input, unsig typedef char* ( *_mode_preprocess_input )( Mode *sw, const char *input ); /** + * @param sw The #Mode pointer + * + * Message to show in the message bar. + * + * @returns the (valid pango markup) message to display. + */ +typedef char * (*_mode_get_message )( const Mode *sw ); + +/** * Structure defining a switcher. * It consists of a name, callback and if enabled * a textbox for the sidebar-mode. @@ -127,6 +136,8 @@ struct rofi_mode _mode_preprocess_input _preprocess_input; + _mode_get_message _get_message; + /** Pointer to private data. */ void *private_data; diff --git a/include/mode.h b/include/mode.h index b8ee36c4..0dbef79c 100644 --- a/include/mode.h +++ b/include/mode.h @@ -185,5 +185,14 @@ void mode_set_config ( Mode *mode ); * @returns a newly allocated string */ char * mode_preprocess_input ( Mode *mode, const char *input ); + +/** + * @param mode The mode to query + * + * Query the mode for a user display. + * + * @return a new allocated (valid pango markup) message to display (user should free). + */ +char *mode_get_message ( const Mode *mode ); /*@}*/ #endif diff --git a/include/view.h b/include/view.h index 817aeedb..ca3a5721 100644 --- a/include/view.h +++ b/include/view.h @@ -33,7 +33,6 @@ typedef enum /** * @param sw the Mode to show. * @param input A pointer to a string where the inputted data is placed. - * @param message Extra message to display. * @param flags Flags indicating state of the menu. * @param finalize the finailze callback * @@ -41,7 +40,7 @@ typedef enum * * @returns The command issued (see MenuReturn) */ -RofiViewState *rofi_view_create ( Mode *sw, const char *input, const char *message, MenuFlags flags, void ( *finalize )( RofiViewState * ) ); +RofiViewState *rofi_view_create ( Mode *sw, const char *input, MenuFlags flags, void ( *finalize )( RofiViewState * ) ); /** * @param state The Menu Handle |