rofi/include/view.h

69 lines
2.0 KiB
C
Raw Normal View History

2016-02-06 13:27:36 +00:00
#ifndef ROFI_VIEW_H
#define ROFI_VIEW_H
2016-02-06 12:06:58 +00:00
2016-02-06 13:27:36 +00:00
/**
* @defgroup View View
*
* The rofi Menu view.
*
* @{
*/
2016-02-07 11:31:17 +00:00
typedef struct RofiViewState RofiViewState;
typedef enum
{
MENU_NORMAL = 0,
MENU_PASSWORD = 1
} MenuFlags;
2016-02-06 12:06:58 +00:00
2016-02-07 11:31:17 +00:00
/**
* @param sw the Mode to show.
* @param input A pointer to a string where the inputted data is placed.
* @param prompt The prompt to show.
* @param message Extra message to display.
* @param flags Flags indicating state of the menu.
*
* Main menu callback.
*
* @returns The command issued (see MenuReturn)
*/
2016-02-07 19:38:34 +00:00
RofiViewState *rofi_view_create ( Mode *sw, const char *input, char *prompt, const char *message, MenuFlags flags )
2016-02-07 11:31:17 +00:00
__attribute__ ( ( nonnull ( 1, 2, 3 ) ) );
2016-02-07 19:38:34 +00:00
2016-02-06 12:06:58 +00:00
/**
* @param state The Menu Handle
*
* Check if a finalize function is set, and if sets executes it.
*/
void rofi_view_finalize ( RofiViewState *state );
RofiViewState * rofi_view_state_create ( void );
2016-02-06 13:27:36 +00:00
MenuReturn rofi_view_get_return_value ( const RofiViewState *state );
unsigned int rofi_view_get_selected_line ( const RofiViewState *state );
unsigned int rofi_view_get_next_position ( const RofiViewState *state );
void rofi_view_itterrate ( RofiViewState *state, XEvent *event );
unsigned int rofi_view_get_completed ( const RofiViewState *state );
const char * rofi_view_get_user_input ( const RofiViewState *state );
void rofi_view_free ( RofiViewState *state );
void rofi_view_restart ( RofiViewState *state );
void rofi_view_set_selected_line ( RofiViewState *state, unsigned int selected_line );
void rofi_view_queue_redraw ( void );
void rofi_view_set_active ( RofiViewState *state );
void rofi_view_call_thread ( gpointer data, gpointer user_data );
2016-02-07 13:09:00 +00:00
void rofi_view_update ( RofiViewState *state );
void rofi_view_setup_fake_transparency ( Display *display, RofiViewState *state );
2016-02-06 13:27:36 +00:00
void rofi_view_cleanup ( void );
2016-02-08 08:03:11 +00:00
/**
* @param msg The error message to show.
* @param markup The error message uses pango markup.
*
* The error message to show.
*/
void rofi_view_error_dialog ( const char *msg, int markup );
2016-02-06 13:27:36 +00:00
/** @} */
#endif