diff options
author | Dave Davenport <qball@gmpclient.org> | 2016-08-24 00:39:56 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2016-08-24 00:39:56 +0200 |
commit | ef3c773097072282627f5d16079602ff7111dcd5 (patch) | |
tree | e086d7601896cd946398e731477d78a80f0f8f82 /include | |
parent | ad53de507cfdafa53873d701b3d18a7704144b0a (diff) |
Constness.
Diffstat (limited to 'include')
-rw-r--r-- | include/helper.h | 4 | ||||
-rw-r--r-- | include/scrollbar.h | 2 | ||||
-rw-r--r-- | include/textbox.h | 39 |
3 files changed, 25 insertions, 20 deletions
diff --git a/include/helper.h b/include/helper.h index 42c71297..fafce9ac 100644 --- a/include/helper.h +++ b/include/helper.h @@ -85,6 +85,7 @@ int find_arg_str ( const char * const key, char** val ); */ int find_arg ( const char * const key ); + /** * @param tokens List of (input) tokens to match. * @param input The entry to match against. @@ -93,8 +94,7 @@ int find_arg ( const char * const key ); * * @returns TRUE when matches, FALSE otherwise */ -int token_match ( GRegex **tokens, const char *input ); - +int token_match ( GRegex * const *tokens, const char *input ); /** * @param cmd The command to execute. * diff --git a/include/scrollbar.h b/include/scrollbar.h index d3839fef..71002676 100644 --- a/include/scrollbar.h +++ b/include/scrollbar.h @@ -77,7 +77,7 @@ void scrollbar_draw ( scrollbar *sb, cairo_t *draw ); * * Calculate the position of the click relative to the max value of bar */ -unsigned int scrollbar_clicked ( scrollbar *sb, int y ); +unsigned int scrollbar_clicked ( const scrollbar *sb, int y ); /** * @param sb scrollbar object diff --git a/include/textbox.h b/include/textbox.h index 3109f577..6e69b18c 100644 --- a/include/textbox.h +++ b/include/textbox.h @@ -39,16 +39,16 @@ typedef struct typedef enum { - TB_AUTOHEIGHT = 1 << 0, - TB_AUTOWIDTH = 1 << 1, - TB_LEFT = 1 << 16, - TB_RIGHT = 1 << 17, - TB_CENTER = 1 << 18, - TB_EDITABLE = 1 << 19, - TB_MARKUP = 1 << 20, - TB_WRAP = 1 << 21, - TB_PASSWORD = 1 << 22, - TB_INDICATOR = 1 << 23, + TB_AUTOHEIGHT = 1 << 0, + TB_AUTOWIDTH = 1 << 1, + TB_LEFT = 1 << 16, + TB_RIGHT = 1 << 17, + TB_CENTER = 1 << 18, + TB_EDITABLE = 1 << 19, + TB_MARKUP = 1 << 20, + TB_WRAP = 1 << 21, + TB_PASSWORD = 1 << 22, + TB_INDICATOR = 1 << 23, } TextboxFlags; typedef enum @@ -113,7 +113,7 @@ int textbox_keybinding ( textbox *tb, KeyBindingAction action ); * The text should be one insert from a keypress.. the first gunichar is validated to be (or not) control * return TRUE if inserted */ -gboolean textbox_append_char ( textbox *tb, char *pad, int pad_len ); +gboolean textbox_append_char ( textbox *tb, const char *pad, const int pad_len ); /** * @param tb Handle to the textbox @@ -138,7 +138,7 @@ void textbox_cursor ( textbox *tb, int pos ); * * Insert the string str at position pos. */ -void textbox_insert ( textbox *tb, int pos, char *str, int slen ); +void textbox_insert ( textbox *tb, const int pos, const char *str, const int slen ); /** * Setup the cached fonts. This is required to do @@ -159,7 +159,7 @@ void textbox_cleanup ( void ); * * @returns the height of the textbox in pixels. */ -int textbox_get_height ( textbox *tb ); +int textbox_get_height ( const textbox *tb ); /** * @param tb Handle to the textbox @@ -168,7 +168,7 @@ int textbox_get_height ( textbox *tb ); * * @returns the width of the textbox in pixels. */ -int textbox_get_width ( textbox *tb ); +int textbox_get_width ( const textbox *tb ); /** * @param tb Handle to the textbox @@ -177,7 +177,7 @@ int textbox_get_width ( textbox *tb ); * * @returns the height of the string in pixels. */ -int textbox_get_font_height ( textbox *tb ); +int textbox_get_font_height ( const textbox *tb ); /** * @param tb Handle to the textbox @@ -186,7 +186,7 @@ int textbox_get_font_height ( textbox *tb ); * * @returns the width of the string in pixels. */ -int textbox_get_font_width ( textbox *tb ); +int textbox_get_font_width ( const textbox *tb ); /** * Estimate the width of a character. @@ -239,6 +239,11 @@ void textbox_set_pango_attributes ( textbox *tb, PangoAttrList *list ); PangoAttrList *textbox_get_pango_attributes ( textbox *tb ); -const char *textbox_get_visible_text ( textbox *tb ); +/** + * @param tb Handle to the textbox + * + * @returns the visible text. + */ +const char *textbox_get_visible_text ( const textbox *tb ); /*@}*/ #endif //ROFI_TEXTBOX_H |