rofi 1.7.9
mode-private.h File Reference
#include "mode.h"
#include <gmodule.h>
Include dependency graph for mode-private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rofi_mode
 

Typedefs

typedef void(* _mode_free) (Mode *data)
 
typedef char *(* _mode_get_display_value) (const Mode *sw, unsigned int selected_line, int *state, GList **attribute_list, int get_entry)
 
typedef cairo_surface_t *(* _mode_get_icon) (const Mode *sw, unsigned int selected_line, unsigned int height)
 
typedef char *(* _mode_get_completion) (const Mode *sw, unsigned int selected_line)
 
typedef int(* _mode_token_match) (const Mode *data, rofi_int_matcher **tokens, unsigned int index)
 
typedef int(* __mode_init) (Mode *sw)
 
typedef unsigned int(* __mode_get_num_entries) (const Mode *sw)
 
typedef void(* __mode_destroy) (Mode *sw)
 
typedef ModeMode(* _mode_result) (Mode *sw, int menu_retv, char **input, unsigned int selected_line)
 
typedef char *(* _mode_preprocess_input) (Mode *sw, const char *input)
 
typedef char *(* _mode_get_message) (const Mode *sw)
 
typedef Mode *(* _mode_create) (void)
 
typedef ModeMode(* _mode_completer_result) (Mode *sw, int menu_retv, char **input, unsigned int selected_line, char **path)
 

Enumerations

enum  ModeType { MODE_TYPE_UNSET = 0x0 , MODE_TYPE_SWITCHER = 0x1 , MODE_TYPE_COMPLETER = 0x2 , MODE_TYPE_DMENU = 0x4 }
 

Typedef Documentation

◆ __mode_destroy

typedef void(* __mode_destroy) (Mode *sw)
Parameters
swThe Mode pointer

Destroy the current mode. Still ready to restart.

Definition at line 132 of file mode-private.h.

◆ __mode_get_num_entries

typedef unsigned int(* __mode_get_num_entries) (const Mode *sw)
Parameters
swThe Mode pointer

Get the number of entries.

Returns
the number of entries

Definition at line 124 of file mode-private.h.

◆ __mode_init

typedef int(* __mode_init) (Mode *sw)
Parameters
swThe Mode pointer

Initialize the mode.

Returns
TRUE is successful

Definition at line 115 of file mode-private.h.

◆ _mode_completer_result

typedef ModeMode(* _mode_completer_result) (Mode *sw, int menu_retv, char **input, unsigned int selected_line, char **path)
Parameters
swThe Mode pointer
menu_retvThe return value
inputThe input string
selected_lineThe selected line
paththe path that was completed

Handle the user accepting an entry in completion mode.

Returns
the next action to take

Definition at line 185 of file mode-private.h.

◆ _mode_create

typedef Mode *(* _mode_create) (void)

Create a new instance of this mode. Free (free) result after use, after using mode_destroy.

Returns
Instantiate a new instance of this mode.

Definition at line 172 of file mode-private.h.

◆ _mode_free

typedef void(* _mode_free) (Mode *data)
Parameters
dataPointer to Mode object.

Mode free function.

Definition at line 54 of file mode-private.h.

◆ _mode_get_completion

typedef char *(* _mode_get_completion) (const Mode *sw, unsigned int selected_line)
Parameters
swThe Mode pointer
selected_lineThe selected line

Obtains the string to complete.

Returns
Get the completion string

Definition at line 93 of file mode-private.h.

◆ _mode_get_display_value

typedef char *(* _mode_get_display_value) (const Mode *sw, unsigned int selected_line, int *state, GList **attribute_list, int get_entry)
Parameters
swThe Mode pointer
selected_lineThe selected line
stateThe state to display [out]
attribute_listList of extra (pango) attribute to apply when displaying. [out][null]
get_entryif it should only return the state

Get the value for displaying.

Returns
the string and state for displaying.

Definition at line 68 of file mode-private.h.

◆ _mode_get_icon

typedef cairo_surface_t *(* _mode_get_icon) (const Mode *sw, unsigned int selected_line, unsigned int height)
Parameters
swThe Mode pointer
selected_lineThe selected line
heightThe height of the icon

Obtains the icon if available

Returns
Get the icon

Definition at line 81 of file mode-private.h.

◆ _mode_get_message

typedef char *(* _mode_get_message) (const Mode *sw)
Parameters
swThe Mode pointer

Message to show in the message bar.

Returns
the (valid pango markup) message to display.

Definition at line 164 of file mode-private.h.

◆ _mode_preprocess_input

typedef char *(* _mode_preprocess_input) (Mode *sw, const char *input)
Parameters
swThe Mode pointer
inputThe input string

Preprocess the input for sorting.

Returns
Entry stripped from markup for sorting

Definition at line 155 of file mode-private.h.

◆ _mode_result

typedef ModeMode(* _mode_result) (Mode *sw, int menu_retv, char **input, unsigned int selected_line)
Parameters
swThe Mode pointer
menu_retvThe return value
inputThe input string
selected_lineThe selected line

Handle the user accepting an entry.

Returns
the next action to take

Definition at line 144 of file mode-private.h.

◆ _mode_token_match

typedef int(* _mode_token_match) (const Mode *data, rofi_int_matcher **tokens, unsigned int index)
Parameters
dataThe Mode pointer
tokensList of (input) tokens to match.
indexThe current selected index.

Function prototype for the matching algorithm.

Returns
1 when it matches, 0 if not.

Definition at line 105 of file mode-private.h.

Enumeration Type Documentation

◆ ModeType

enum ModeType

Indicator what type of mode this is. For now it can be the classic switcher, or also implement a completer.

Enumerator
MODE_TYPE_UNSET 

Mode type is not set

MODE_TYPE_SWITCHER 

A normal mode.

MODE_TYPE_COMPLETER 

A mode that can be used to completer

MODE_TYPE_DMENU 

DMenu mode.

Definition at line 38 of file mode-private.h.