diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2014-10-25 20:02:34 +0300 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2014-10-25 20:02:34 +0300 |
commit | d3db039136ad66d2c83c1c0fbf0964bfbb5afb16 (patch) | |
tree | 93af6d73ad168e0169183a9c4f625acd5492e08c /lib/bemenu.h | |
parent | 2820734ec01ad6d2e1a0611fa480c3dd533588c7 (diff) | |
download | bemenu-d3db039136ad66d2c83c1c0fbf0964bfbb5afb16.tar.gz bemenu-d3db039136ad66d2c83c1c0fbf0964bfbb5afb16.tar.bz2 bemenu-d3db039136ad66d2c83c1c0fbf0964bfbb5afb16.zip |
Single line mode, color customization, etc..
Diffstat (limited to 'lib/bemenu.h')
-rw-r--r-- | lib/bemenu.h | 77 |
1 files changed, 76 insertions, 1 deletions
diff --git a/lib/bemenu.h b/lib/bemenu.h index 20574f6..c52135d 100644 --- a/lib/bemenu.h +++ b/lib/bemenu.h @@ -183,6 +183,26 @@ enum bm_key { }; /** + * Colorable element constants. + * + * @link ::bm_color BM_COLOR_LAST @endlink is provided for enumerating colors. + */ +enum bm_color { + BM_COLOR_BG, + BM_COLOR_TITLE_BG, + BM_COLOR_TITLE_FG, + BM_COLOR_FILTER_BG, + BM_COLOR_FILTER_FG, + BM_COLOR_ITEM_BG, + BM_COLOR_ITEM_FG, + BM_COLOR_HIGHLIGHTED_BG, + BM_COLOR_HIGHLIGHTED_FG, + BM_COLOR_SELECTED_BG, + BM_COLOR_SELECTED_FG, + BM_COLOR_LAST +}; + +/** * @name Menu Memory * @{ */ @@ -265,10 +285,27 @@ void bm_menu_set_filter_mode(struct bm_menu *menu, enum bm_filter_mode mode); enum bm_filter_mode bm_menu_get_filter_mode(const struct bm_menu *menu); /** + * Set amount of max vertical lines to be shown. + * Some renderers such as ncurses may ignore this when it does not make sense. + * + * @param menu bm_menu instance where to set max vertical line amount. + * @param lines 0 for single line layout, > 0 to show that many lines. + */ +void bm_menu_set_lines(struct bm_menu *menu, uint32_t lines); + +/** + * Get amount of max vertical lines to be shown. + * + * @param menu bm_menu instance where to get max vertical line amount. + * @return uint32_t for max amount of vertical lines to be shown. + */ +uint32_t bm_menu_get_lines(struct bm_menu *menu); + +/** * Set selection wrapping on/off. * * @param menu bm_menu instance where to toggle selection wrapping. - * @param bool true/false. + * @param wrap true/false. */ void bm_menu_set_wrap(struct bm_menu *menu, bool wrap); @@ -297,6 +334,44 @@ bool bm_menu_set_title(struct bm_menu *menu, const char *title); */ const char* bm_menu_get_title(const struct bm_menu *menu); +/** + * Set font to bm_menu instance. + * + * @param font C "string" to set as font, can be **NULL** for default (Terminus). + * @param size Size for the font, may be set 0 for default. + * @return true if set was succesful, false if out of memory. + */ +bool bm_menu_set_font(struct bm_menu *menu, const char *font, uint32_t size); + +/** + * Get font from bm_menu instance. + * + * @param menu bm_menu instance where to get font from. + * @param out_size Reference to uint32_t, will be se to size of the font. May set **NULL** for no-op. + * @return Pointer to null terminated C "string". + */ +const char* bm_menu_get_font(const struct bm_menu *menu, uint32_t *out_size); + +/** + * Set a hexadecimal color for element. + * + * @param menu bm_menu instance where to set color. + * @param color bm_color type. + * @param hex Color in hexadecimal format starting with '#'. + * @return true if set was succesful, false if out of memory. + */ +bool bm_menu_set_color(struct bm_menu *menu, enum bm_color color, const char *hex); + +/** + * Get hexadecimal color for element. + * + * @param menu bm_menu instance where to get color from. + * @param color bm_color type. + * @return Pointer to null terminated C "string". + */ +const char* bm_menu_get_color(const struct bm_menu *menu, enum bm_color color); + + /** @} Properties */ /** |