summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-05-22 17:47:34 +0200
committerDave Davenport <qball@gmpclient.org>2016-05-22 17:47:34 +0200
commit498fadc735df509ef0a864db1e93d2120d8eb9ee (patch)
tree8d322b8736c615cc0ba51c9b40ad30d3a9668480 /include
parent8091558ed8234914b398fe288aaccfe9770dac9c (diff)
Remove the is_ascii mess.
Diffstat (limited to 'include')
-rw-r--r--include/helper.h8
-rw-r--r--include/mode-private.h6
-rw-r--r--include/mode.h14
-rw-r--r--include/view-internal.h1
4 files changed, 6 insertions, 23 deletions
diff --git a/include/helper.h b/include/helper.h
index cca31cc0..e48b6d7f 100644
--- a/include/helper.h
+++ b/include/helper.h
@@ -32,8 +32,8 @@ int helper_parse_setup ( char * string, char ***output, int *length, ... );
*
* @returns a newly allocated 2 dimensional array of strings.
*/
-char **tokenize ( const char *input, int case_sensitive );
-void tokenize_free ( char ** tokens );
+GRegex **tokenize ( const char *input, int case_sensitive );
+void tokenize_free ( GRegex ** tokens );
/**
* @param key The key to search for
@@ -97,7 +97,7 @@ int find_arg ( const char * const key );
*
* @returns 1 when matches, 0 otherwise
*/
-int token_match ( char **tokens, const char *input, int not_ascii, int case_sensitive );
+int token_match ( GRegex **tokens, const char *input);
/**
* @param cmd The command to execute.
*
@@ -160,6 +160,6 @@ unsigned int levenshtein ( const char *needle, const char *haystack );
*/
char * rofi_force_utf8 ( gchar *data );
char * rofi_latin_to_utf8_strdup ( const char *input, gssize length );
-PangoAttrList *token_match_get_pango_attr ( char **tokens, const char *input, PangoAttrList *retv );
+PangoAttrList *token_match_get_pango_attr ( GRegex **tokens, const char *input, PangoAttrList *retv );
/*@}*/
#endif // ROFI_HELPER_H
diff --git a/include/mode-private.h b/include/mode-private.h
index 7747de0a..530827e8 100644
--- a/include/mode-private.h
+++ b/include/mode-private.h
@@ -17,7 +17,7 @@ typedef char * ( *_mode_get_completion )( const Mode *sw, unsigned int selected_
*
* @returns 1 when it matches, 0 if not.
*/
-typedef int ( *_mode_token_match )( const Mode *data, char **tokens, int not_ascii, int case_sensitive, unsigned int index );
+typedef int ( *_mode_token_match )( const Mode *data, GRegex **tokens, unsigned int index );
typedef int ( *__mode_init )( Mode *sw );
@@ -27,8 +27,6 @@ typedef void ( *__mode_destroy )( Mode *sw );
typedef ModeMode ( *_mode_result )( Mode *sw, int menu_retv, char **input, unsigned int selected_line );
-typedef int ( *_mode_is_not_ascii )( const Mode *sw, unsigned int index );
-
/**
* Structure defining a switcher.
* It consists of a name, callback and if enabled
@@ -50,8 +48,6 @@ struct rofi_mode
__mode_destroy _destroy;
/** Get number of entries to display. (unfiltered). */
__mode_get_num_entries _get_num_entries;
- /** Check if the element is ascii. */
- _mode_is_not_ascii _is_not_ascii;
/** Process the result of the user selection. */
_mode_result _result;
/** Token match. */
diff --git a/include/mode.h b/include/mode.h
index aaf38566..672d74db 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -98,16 +98,6 @@ char * mode_get_completion ( const Mode *mode, unsigned int selected_line );
/**
* @param mode The mode to query
- * @param selected_line The entry to query
- *
- * Check if the entry has non-ascii characters.
- *
- * @returns TRUE when selected line has non-ascii characters.
- */
-int mode_is_not_ascii ( const Mode *mode, unsigned int selected_line );
-
-/**
- * @param mode The mode to query
* @param mretv The menu return value.
* @param input Pointer to the user input string.
* @param selected_line the line selected by the user.
@@ -121,15 +111,13 @@ ModeMode mode_result ( Mode *mode, int menu_retv, char **input, unsigned int sel
/**
* @param mode The mode to query
* @param tokens The set of tokens to match against
- * @param not_ascii If the entry is pure-ascii
- * @param case_sensitive If the entry should be matched case sensitive
* @param selected_line The index of the entry to match
*
* Match entry against the set of tokens.
*
* @returns TRUE if matches
*/
-int mode_token_match ( const Mode *mode, char **tokens, int not_ascii, int case_sensitive, unsigned int selected_line );
+int mode_token_match ( const Mode *mode, GRegex **tokens, unsigned int selected_line );
/**
* @param mode The mode to query
diff --git a/include/view-internal.h b/include/view-internal.h
index 4912da10..43ba6875 100644
--- a/include/view-internal.h
+++ b/include/view-internal.h
@@ -56,7 +56,6 @@ struct RofiViewState
// Return state
unsigned int selected_line;
MenuReturn retv;
- int *lines_not_ascii;
int line_height;
unsigned int border;
workarea mon;