1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-10-27 05:23:18 -04:00
rofi/include/view-internal.h

100 lines
3.1 KiB
C
Raw Normal View History

2016-02-06 08:27:36 -05:00
#ifndef ROFI_VIEW_INTERNAL_H
#define ROFI_VIEW_INTERNAL_H
#include "widgets/widget.h"
#include "widgets/textbox.h"
#include "widgets/separator.h"
#include "widgets/listview.h"
#include "widgets/box.h"
#include "keyb.h"
2016-02-19 13:29:06 -05:00
#include "x11-helper.h"
2016-02-06 08:27:36 -05:00
/**
2016-02-08 12:16:16 -05:00
* @ingroup ViewHandle
2016-02-06 08:27:36 -05:00
*
* @{
*/
// State of the menu.
2016-02-11 14:24:29 -05:00
struct RofiViewState
2016-02-06 08:27:36 -05:00
{
/** #Mode bound to to this view. */
2016-05-08 05:13:11 -04:00
Mode *sw;
2016-02-06 08:27:36 -05:00
/** Flag indicating if view needs to be refiltered. */
2016-05-08 05:13:11 -04:00
int refilter;
2016-02-06 08:27:36 -05:00
/** Main #box widget holding different elements. */
box *main_box;
/** #box widget packing the input bar widgets. */
box *input_bar;
/** #textbox showing the prompt in the input bar. */
textbox *prompt;
/** #textbox with the user input in the input bar. */
2016-05-08 05:13:11 -04:00
textbox *text;
/** #textbox showing the state of the case sensitive and sortng. */
2016-05-08 05:13:11 -04:00
textbox *case_indicator;
/** #separator widget below the input bar. */
separator *input_bar_separator;
/** #listview holding the displayed elements. */
listview *list_view;
/** #textbox widget showing the overlay. */
2016-06-26 09:48:12 -04:00
textbox *overlay;
/** Array with the levenshtein distance for each eleemnt. */
2016-05-08 05:13:11 -04:00
int *distance;
/** Array with the translation between the filtered and unfiltered list. */
2016-05-08 05:13:11 -04:00
unsigned int *line_map;
/** number of (unfiltered) elements to show. */
2016-05-08 05:13:11 -04:00
unsigned int num_lines;
2016-02-06 08:27:36 -05:00
/** number of (filtered) elements to show. */
2016-05-08 05:13:11 -04:00
unsigned int filtered_lines;
2016-02-06 08:27:36 -05:00
/** Previously called key action. */
KeyBindingAction prev_action;
/** Time previous key action was executed. */
2016-05-08 05:13:11 -04:00
xcb_timestamp_t last_button_press;
2016-02-06 08:27:36 -05:00
/** Indicate view should terminate */
2016-05-08 05:13:11 -04:00
int quit;
/** Indicate if we should absorb the key release */
2016-05-08 05:13:11 -04:00
int skip_absorb;
/** The selected line (in the unfiltered list) */
2016-05-08 05:13:11 -04:00
unsigned int selected_line;
/** The return state of the view */
2016-05-08 05:13:11 -04:00
MenuReturn retv;
/** Calculated border width */
2016-05-08 05:13:11 -04:00
unsigned int border;
/** Monitor #workarea the view is displayed on */
2016-05-08 05:13:11 -04:00
workarea mon;
2016-02-06 08:27:36 -05:00
/** #box holding the different modi buttons */
box *sidebar_bar;
/** number of modi to display */
2016-05-08 05:13:11 -04:00
unsigned int num_modi;
/** Array of #textbox that act as buttons for switching modi */
2016-05-08 05:13:11 -04:00
textbox **modi;
/** Settings of the menu */
2016-05-08 05:13:11 -04:00
MenuFlags menu_flags;
/** If mouse was within view previously */
int mouse_seen;
/** Flag indicating if view needs to be reloaded. */
int reload;
/** The funciton to be called when finalizing this view */
2016-05-08 05:13:11 -04:00
void ( *finalize )( struct RofiViewState *state );
/** Width of the view */
int width;
/** Height of the view */
int height;
/** X position of the view */
int x;
/** Y position of the view */
int y;
2016-10-11 02:18:34 -04:00
/** Regexs used for matching */
2016-10-11 02:18:34 -04:00
GRegex **tokens;
2016-02-11 14:24:29 -05:00
};
2016-02-06 08:27:36 -05:00
/** @} */
#endif