rofi  1.5.1
helper.h File Reference
#include <cairo.h>
#include "rofi-types.h"
Include dependency graph for helper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  RofiHelperExecuteContext
 

Functions

int helper_parse_setup (char *string, char ***output, int *length,...)
 
rofi_int_matcher ** helper_tokenize (const char *input, int case_sensitive)
 
void helper_tokenize_free (rofi_int_matcher **tokens)
 
int find_arg_char (const char *const key, char *val)
 
int find_arg_uint (const char *const key, unsigned int *val)
 
int find_arg_int (const char *const key, int *val)
 
int find_arg_str (const char *const key, char **val)
 
const char ** find_arg_strv (const char *const key)
 
int find_arg (const char *const key)
 
int helper_token_match (rofi_int_matcher *const *tokens, const char *input)
 
int execute_generator (const char *cmd) __attribute__((nonnull))
 
int create_pid_file (const char *pidfile)
 
void remove_pid_file (int fd)
 
int config_sanity_check (void)
 
char helper_parse_char (const char *arg)
 
void cmd_set_arguments (int argc, char **argv)
 
char * rofi_expand_path (const char *input)
 
unsigned int levenshtein (const char *needle, const glong needlelen, const char *haystack, const glong haystacklen)
 
char * rofi_force_utf8 (const gchar *data, ssize_t length)
 
char * rofi_latin_to_utf8_strdup (const char *input, gssize length)
 
gchar * rofi_escape_markup (gchar *text)
 
int rofi_scorer_fuzzy_evaluate (const char *pattern, glong plen, const char *str, glong slen)
 
int utf8_strncmp (const char *a, const char *b, size_t n) __attribute__((nonnull(1
 
gboolean helper_execute (const char *wd, char **args, const char *error_precmd, const char *error_cmd, RofiHelperExecuteContext *context)
 
gboolean helper_execute_command (const char *wd, const char *cmd, gboolean run_in_term, RofiHelperExecuteContext *context)
 
cairo_surface_t * cairo_image_surface_create_from_svg (const gchar *file, int height)
 
void parse_ranges (char *input, rofi_range_pair **list, unsigned int *length)
 
void rofi_output_formatted_line (const char *format, const char *string, int selected_line, const char *filter)
 

Function Documentation

◆ cairo_image_surface_create_from_svg()

cairo_surface_t* cairo_image_surface_create_from_svg ( const gchar *  file,
int  height 
)
Parameters
fileThe file path
heightThe wanted height Gets a surface from an svg path
Returns
a cairo surface from an svg path

Rendering fails

Definition at line 1085 of file helper.c.

References config, and Settings::dpi.

◆ helper_execute()

gboolean helper_execute ( const char *  wd,
char **  args,
const char *  error_precmd,
const char *  error_cmd,
RofiHelperExecuteContext context 
)
Parameters
wdThe working directory.
argsThe arguments of the command to exec.
error_precmdPrefix to error message command.
error_cmdError message command
contextThe startup notification context, if any

Executes the command

Returns
TRUE when successful, FALSE when failed.

Definition at line 975 of file helper.c.

References display_startup_notification(), and rofi_view_error_dialog().

Referenced by execshssh(), and helper_execute_command().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ helper_execute_command()

gboolean helper_execute_command ( const char *  wd,
const char *  cmd,
gboolean  run_in_term,
RofiHelperExecuteContext context 
)
Parameters
wdThe work directory (optional)
cmdThe cmd to execute
run_in_termIndicate if command should be run in a terminal
contextThe startup notification context, if any

Execute command. If needed members of

Parameters
contextare NULL, they will be filled.
Returns
FALSE On failure, TRUE on success

Definition at line 1000 of file helper.c.

References RofiHelperExecuteContext::binary, RofiHelperExecuteContext::command, config, RofiHelperExecuteContext::description, helper_execute(), helper_parse_setup(), RofiHelperExecuteContext::name, Settings::run_command, and Settings::run_shell_command.

Referenced by exec_cmd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_ranges()

void parse_ranges ( char *  input,
rofi_range_pair **  list,
unsigned int *  length 
)

Ranges.

Parameters
inputString to parse
listList of ranges
lengthLength of list.

ranges

Definition at line 1148 of file helper.c.

References parse_pair().

Referenced by dmenu_mode_init(), and parse_header_entry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_output_formatted_line()

void rofi_output_formatted_line ( const char *  format,
const char *  string,
int  selected_line,
const char *  filter 
)
Parameters
format
string
selected_line
filter
formatThe format string used. See below for possible syntax.
stringThe selected entry.
selected_lineThe selected line index.
filterThe entered filter.

Function that outputs the selected line in the user-specified format. Currently the following formats are supported:

  • i: Print the index (0-(N-1))
  • d: Print the index (1-N)
  • s: Print input string.
  • q: Print quoted input string.
  • f: Print the entered filter.
  • F: Print the entered filter, quoted

This functions outputs the formatted string to stdout, appends a newline (
) character and calls flush on the file descriptor.

Definition at line 1182 of file helper.c.

Referenced by dmenu_print_results(), and dmenu_switcher_dialog().

Here is the caller graph for this function:

◆ utf8_strncmp()

int utf8_strncmp ( const char *  a,
const char *  b,
size_t  n 
)
Parameters
aUTF-8 string to compare
bUTF-8 string to compare
nMaximum number of characters to compare

Compares the G_NORMALIZE_ALL_COMPOSE forms of the two strings.

Returns
less than, equal to, or greater than zero if the first n characters (not bytes) of a are found, respectively, to be less than, to match, or be greater than the first n characters (not bytes) of b.