2017-04-15 06:32:05 -04:00
|
|
|
/*
|
2015-03-30 14:12:22 -04:00
|
|
|
* rofi
|
|
|
|
*
|
|
|
|
* MIT/X11 License
|
2021-06-09 08:50:39 -04:00
|
|
|
* Copyright © 2013-2021 Qball Cow <qball@gmpclient.org>
|
2015-03-30 14:12:22 -04:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
* a copy of this software and associated documentation files (the
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
* permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
* the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be
|
|
|
|
* included in all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
|
|
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
*/
|
2017-04-15 05:58:49 -04:00
|
|
|
|
2018-06-12 05:45:42 -04:00
|
|
|
/** The log domain of this dialog. */
|
2017-04-27 16:59:14 -04:00
|
|
|
#define G_LOG_DOMAIN "Dialogs.Combi"
|
2017-04-15 05:58:49 -04:00
|
|
|
|
2015-03-30 14:12:22 -04:00
|
|
|
#include <config.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <rofi.h>
|
2016-01-07 10:01:56 -05:00
|
|
|
#include "settings.h"
|
2017-01-26 13:46:46 -05:00
|
|
|
#include "helper.h"
|
2015-03-30 14:12:22 -04:00
|
|
|
|
2015-11-03 13:57:07 -05:00
|
|
|
#include <dialogs/dialogs.h>
|
2017-03-10 17:39:29 -05:00
|
|
|
#include <pango/pango.h>
|
|
|
|
#include "mode-private.h"
|
|
|
|
#include <theme.h>
|
2015-03-31 16:45:02 -04:00
|
|
|
|
2015-03-30 14:12:22 -04:00
|
|
|
/**
|
2015-11-25 03:26:38 -05:00
|
|
|
* Combi Mode
|
2015-03-30 14:12:22 -04:00
|
|
|
*/
|
2017-02-04 04:54:15 -05:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Mode *mode;
|
|
|
|
gboolean disable;
|
|
|
|
} CombiMode;
|
|
|
|
|
2016-03-24 17:15:10 -04:00
|
|
|
typedef struct
|
2015-03-30 14:12:22 -04:00
|
|
|
{
|
|
|
|
// List of (combined) entries.
|
|
|
|
unsigned int cmd_list_length;
|
|
|
|
// List to validate where each switcher starts.
|
|
|
|
unsigned int *starts;
|
|
|
|
unsigned int *lengths;
|
|
|
|
// List of switchers to combine.
|
|
|
|
unsigned int num_switchers;
|
2017-02-04 04:54:15 -05:00
|
|
|
CombiMode *switchers;
|
2015-03-30 14:12:22 -04:00
|
|
|
} CombiModePrivateData;
|
|
|
|
|
2015-11-25 03:26:38 -05:00
|
|
|
static void combi_mode_parse_switchers ( Mode *sw )
|
2015-03-30 14:12:22 -04:00
|
|
|
{
|
2016-01-07 15:27:20 -05:00
|
|
|
CombiModePrivateData *pd = mode_get_private_data ( sw );
|
2015-03-31 16:45:02 -04:00
|
|
|
char *savept = NULL;
|
|
|
|
// Make a copy, as strtok will modify it.
|
|
|
|
char *switcher_str = g_strdup ( config.combi_modi );
|
2017-03-31 14:57:42 -04:00
|
|
|
const char * const sep = ",#";
|
2015-03-31 16:45:02 -04:00
|
|
|
// Split token on ','. This modifies switcher_str.
|
2016-03-19 08:29:04 -04:00
|
|
|
for ( char *token = strtok_r ( switcher_str, sep, &savept ); token != NULL;
|
|
|
|
token = strtok_r ( NULL, sep, &savept ) ) {
|
2015-03-31 16:45:02 -04:00
|
|
|
// Resize and add entry.
|
2017-02-04 04:54:15 -05:00
|
|
|
pd->switchers = (CombiMode *) g_realloc ( pd->switchers,
|
|
|
|
sizeof ( CombiMode ) * ( pd->num_switchers + 1 ) );
|
2015-03-31 16:45:02 -04:00
|
|
|
|
2017-03-04 06:00:59 -05:00
|
|
|
Mode *mode = rofi_collect_modi_search ( token );
|
2020-09-08 11:30:03 -04:00
|
|
|
if ( mode != NULL ) {
|
2017-02-04 04:54:15 -05:00
|
|
|
pd->switchers[pd->num_switchers].disable = FALSE;
|
2017-03-04 06:00:59 -05:00
|
|
|
pd->switchers[pd->num_switchers++].mode = mode;
|
2020-09-08 11:30:03 -04:00
|
|
|
continue;
|
2017-03-04 13:41:06 -05:00
|
|
|
}
|
2020-09-08 11:30:03 -04:00
|
|
|
// If not build in, use custom switchers.
|
|
|
|
mode = script_switcher_parse_setup ( token );
|
|
|
|
if ( mode != NULL ) {
|
|
|
|
pd->switchers[pd->num_switchers].disable = FALSE;
|
|
|
|
pd->switchers[pd->num_switchers++].mode = mode;
|
|
|
|
continue;
|
2015-03-31 16:45:02 -04:00
|
|
|
}
|
2020-09-08 11:30:03 -04:00
|
|
|
// Report error, don't continue.
|
|
|
|
g_warning ( "Invalid script switcher: %s", token );
|
|
|
|
token = NULL;
|
2015-03-31 16:45:02 -04:00
|
|
|
}
|
|
|
|
// Free string that was modified by strtok_r
|
|
|
|
g_free ( switcher_str );
|
2015-03-30 14:12:22 -04:00
|
|
|
}
|
2020-09-08 11:30:03 -04:00
|
|
|
static unsigned int combi_mode_get_num_entries ( const Mode *sw )
|
|
|
|
{
|
|
|
|
const CombiModePrivateData *pd = (const CombiModePrivateData *) mode_get_private_data ( sw );
|
|
|
|
unsigned int length = 0;
|
|
|
|
for ( unsigned int i = 0; i < pd->num_switchers; i++ ) {
|
|
|
|
unsigned int entries = mode_get_num_entries ( pd->switchers[i].mode );
|
|
|
|
pd->starts[i] = length;
|
|
|
|
pd->lengths[i] = entries;
|
|
|
|
length += entries;
|
|
|
|
}
|
|
|
|
return length;
|
|
|
|
}
|
2015-03-31 16:45:02 -04:00
|
|
|
|
2016-01-08 03:16:59 -05:00
|
|
|
static int combi_mode_init ( Mode *sw )
|
2015-03-30 14:12:22 -04:00
|
|
|
{
|
2016-01-07 15:27:20 -05:00
|
|
|
if ( mode_get_private_data ( sw ) == NULL ) {
|
2015-03-30 14:12:22 -04:00
|
|
|
CombiModePrivateData *pd = g_malloc0 ( sizeof ( *pd ) );
|
2016-01-07 15:27:20 -05:00
|
|
|
mode_set_private_data ( sw, (void *) pd );
|
2015-03-31 16:45:02 -04:00
|
|
|
combi_mode_parse_switchers ( sw );
|
2015-03-30 14:12:22 -04:00
|
|
|
pd->starts = g_malloc0 ( sizeof ( int ) * pd->num_switchers );
|
|
|
|
pd->lengths = g_malloc0 ( sizeof ( int ) * pd->num_switchers );
|
2015-03-31 16:45:02 -04:00
|
|
|
for ( unsigned int i = 0; i < pd->num_switchers; i++ ) {
|
2017-02-04 04:54:15 -05:00
|
|
|
if ( !mode_init ( pd->switchers[i].mode ) ) {
|
2016-01-08 03:16:59 -05:00
|
|
|
return FALSE;
|
|
|
|
}
|
2015-03-31 16:45:02 -04:00
|
|
|
}
|
2015-11-21 17:59:59 -05:00
|
|
|
if ( pd->cmd_list_length == 0 ) {
|
2020-09-08 11:30:03 -04:00
|
|
|
pd->cmd_list_length = combi_mode_get_num_entries ( sw );
|
2015-11-21 17:59:59 -05:00
|
|
|
}
|
2015-03-30 14:12:22 -04:00
|
|
|
}
|
2016-01-08 03:16:59 -05:00
|
|
|
return TRUE;
|
2015-03-30 14:12:22 -04:00
|
|
|
}
|
2015-11-25 03:26:38 -05:00
|
|
|
static void combi_mode_destroy ( Mode *sw )
|
2015-03-30 14:12:22 -04:00
|
|
|
{
|
2016-01-07 15:27:20 -05:00
|
|
|
CombiModePrivateData *pd = (CombiModePrivateData *) mode_get_private_data ( sw );
|
2015-03-30 14:12:22 -04:00
|
|
|
if ( pd != NULL ) {
|
|
|
|
g_free ( pd->starts );
|
|
|
|
g_free ( pd->lengths );
|
2015-03-31 16:45:02 -04:00
|
|
|
// Cleanup switchers.
|
|
|
|
for ( unsigned int i = 0; i < pd->num_switchers; i++ ) {
|
2017-02-04 04:54:15 -05:00
|
|
|
mode_destroy ( pd->switchers[i].mode );
|
2015-03-31 16:45:02 -04:00
|
|
|
}
|
2015-03-30 14:13:47 -04:00
|
|
|
g_free ( pd->switchers );
|
2015-06-30 15:18:45 -04:00
|
|
|
g_free ( pd );
|
2016-01-07 15:27:20 -05:00
|
|
|
mode_set_private_data ( sw, NULL );
|
2015-03-30 14:12:22 -04:00
|
|
|
}
|
|
|
|
}
|
2015-11-25 03:26:38 -05:00
|
|
|
static ModeMode combi_mode_result ( Mode *sw, int mretv, char **input, unsigned int selected_line )
|
2015-03-30 14:12:22 -04:00
|
|
|
{
|
2016-01-07 15:27:20 -05:00
|
|
|
CombiModePrivateData *pd = mode_get_private_data ( sw );
|
2017-01-26 13:46:46 -05:00
|
|
|
|
|
|
|
if ( input[0][0] == '!' ) {
|
2020-08-28 10:41:59 -04:00
|
|
|
int switcher = -1;
|
2020-04-07 06:48:53 -04:00
|
|
|
// Implement strchrnul behaviour.
|
2020-08-28 10:41:59 -04:00
|
|
|
char *eob = g_utf8_strchr ( input[0], -1, ' ' );
|
2020-04-07 06:48:53 -04:00
|
|
|
if ( eob == NULL ) {
|
2020-08-28 10:41:59 -04:00
|
|
|
eob = &( input[0][strlen ( input[0] )] );
|
2020-04-07 06:48:53 -04:00
|
|
|
}
|
2017-01-26 13:46:46 -05:00
|
|
|
ssize_t bang_len = g_utf8_pointer_to_offset ( input[0], eob ) - 1;
|
|
|
|
if ( bang_len > 0 ) {
|
2020-09-08 11:30:03 -04:00
|
|
|
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
|
2017-02-04 04:54:15 -05:00
|
|
|
const char *mode_name = mode_get_name ( pd->switchers[i].mode );
|
2017-02-03 14:49:16 -05:00
|
|
|
size_t mode_name_len = g_utf8_strlen ( mode_name, -1 );
|
2017-01-26 13:46:46 -05:00
|
|
|
if ( (size_t) bang_len <= mode_name_len && utf8_strncmp ( &input[0][1], mode_name, bang_len ) == 0 ) {
|
|
|
|
switcher = i;
|
2020-09-08 11:30:03 -04:00
|
|
|
break;
|
2017-01-26 13:46:46 -05:00
|
|
|
}
|
2015-10-18 16:12:06 -04:00
|
|
|
}
|
|
|
|
}
|
2017-01-26 13:46:46 -05:00
|
|
|
if ( switcher >= 0 ) {
|
|
|
|
if ( eob[0] == ' ' ) {
|
2017-02-03 14:49:16 -05:00
|
|
|
char *n = eob + 1;
|
2017-02-04 04:54:15 -05:00
|
|
|
return mode_result ( pd->switchers[switcher].mode, mretv, &n,
|
2016-01-07 15:27:20 -05:00
|
|
|
selected_line - pd->starts[switcher] );
|
2015-10-18 16:12:06 -04:00
|
|
|
}
|
|
|
|
return MODE_EXIT;
|
|
|
|
}
|
2021-06-08 15:20:09 -04:00
|
|
|
} else if ( ( mretv& MENU_COMPLETE) ) {
|
|
|
|
return RELOAD_DIALOG;
|
2015-10-18 16:12:06 -04:00
|
|
|
}
|
2015-03-30 14:12:22 -04:00
|
|
|
|
|
|
|
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
|
|
|
|
if ( selected_line >= pd->starts[i] &&
|
|
|
|
selected_line < ( pd->starts[i] + pd->lengths[i] ) ) {
|
2017-02-04 04:54:15 -05:00
|
|
|
return mode_result ( pd->switchers[i].mode, mretv, input, selected_line - pd->starts[i] );
|
2015-03-30 14:12:22 -04:00
|
|
|
}
|
|
|
|
}
|
2020-09-13 15:56:25 -04:00
|
|
|
if ( ( mretv & MENU_CUSTOM_INPUT ) ) {
|
2020-11-03 17:57:02 -05:00
|
|
|
return mode_result ( pd->switchers[0].mode, mretv, input, selected_line );
|
2020-09-13 15:56:25 -04:00
|
|
|
}
|
2015-03-30 14:12:22 -04:00
|
|
|
return MODE_EXIT;
|
|
|
|
}
|
2017-09-29 02:32:09 -04:00
|
|
|
static int combi_mode_match ( const Mode *sw, rofi_int_matcher **tokens, unsigned int index )
|
2015-03-30 14:12:22 -04:00
|
|
|
{
|
2016-01-07 15:27:20 -05:00
|
|
|
CombiModePrivateData *pd = mode_get_private_data ( sw );
|
2016-05-26 02:39:33 -04:00
|
|
|
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
|
2017-02-04 04:54:15 -05:00
|
|
|
if ( pd->switchers[i].disable ) {
|
2016-05-26 02:39:33 -04:00
|
|
|
continue;
|
2015-03-30 14:12:22 -04:00
|
|
|
}
|
2016-05-26 02:39:33 -04:00
|
|
|
if ( index >= pd->starts[i] && index < ( pd->starts[i] + pd->lengths[i] ) ) {
|
2017-02-04 04:54:15 -05:00
|
|
|
return mode_token_match ( pd->switchers[i].mode, tokens, index - pd->starts[i] );
|
2015-11-24 08:14:55 -05:00
|
|
|
}
|
|
|
|
}
|
2015-03-30 14:12:22 -04:00
|
|
|
return 0;
|
|
|
|
}
|
2017-03-10 17:39:29 -05:00
|
|
|
static char * combi_mgrv ( const Mode *sw, unsigned int selected_line, int *state, GList **attr_list, int get_entry )
|
2015-03-31 16:45:02 -04:00
|
|
|
{
|
2016-01-07 15:27:20 -05:00
|
|
|
CombiModePrivateData *pd = mode_get_private_data ( sw );
|
2015-11-21 17:59:59 -05:00
|
|
|
if ( !get_entry ) {
|
|
|
|
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
|
|
|
|
if ( selected_line >= pd->starts[i] && selected_line < ( pd->starts[i] + pd->lengths[i] ) ) {
|
2017-03-10 17:39:29 -05:00
|
|
|
mode_get_display_value ( pd->switchers[i].mode, selected_line - pd->starts[i], state, attr_list, FALSE );
|
2015-11-21 17:59:59 -05:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
2015-03-31 16:45:02 -04:00
|
|
|
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
|
2015-09-19 14:59:50 -04:00
|
|
|
if ( selected_line >= pd->starts[i] && selected_line < ( pd->starts[i] + pd->lengths[i] ) ) {
|
2017-11-07 14:03:42 -05:00
|
|
|
char * retv;
|
|
|
|
char * str = retv = mode_get_display_value ( pd->switchers[i].mode, selected_line - pd->starts[i], state, attr_list, TRUE );
|
2017-03-10 17:39:29 -05:00
|
|
|
const char *dname = mode_get_display_name ( pd->switchers[i].mode );
|
2017-11-07 14:03:42 -05:00
|
|
|
if ( !config.combi_hide_mode_prefix ) {
|
2021-06-15 06:31:32 -04:00
|
|
|
retv = g_strdup_printf ( "%s %s", dname, str );
|
|
|
|
g_free ( str );
|
2017-03-10 17:39:29 -05:00
|
|
|
|
2021-06-15 06:31:32 -04:00
|
|
|
if ( attr_list != NULL ) {
|
2021-06-14 13:29:05 -04:00
|
|
|
ThemeWidget *wid = rofi_config_find_widget ( sw->name, NULL, TRUE );
|
2017-03-17 09:07:11 -04:00
|
|
|
Property *p = rofi_theme_find_property ( wid, P_COLOR, pd->switchers[i].mode->name, TRUE );
|
2017-03-10 17:39:29 -05:00
|
|
|
if ( p != NULL ) {
|
2021-06-15 06:31:32 -04:00
|
|
|
PangoAttribute *pa = pango_attr_foreground_new (
|
|
|
|
p->value.color.red * 65535,
|
|
|
|
p->value.color.green * 65535,
|
|
|
|
p->value.color.blue * 65535 );
|
|
|
|
pa->start_index = PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING;
|
|
|
|
pa->end_index = strlen ( dname );
|
|
|
|
*attr_list = g_list_append ( *attr_list, pa );
|
2017-03-10 17:39:29 -05:00
|
|
|
}
|
2021-06-15 06:31:32 -04:00
|
|
|
}
|
2017-03-10 17:39:29 -05:00
|
|
|
}
|
2015-11-21 17:59:59 -05:00
|
|
|
return retv;
|
2015-03-31 16:45:02 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
2015-11-25 03:26:38 -05:00
|
|
|
static char * combi_get_completion ( const Mode *sw, unsigned int index )
|
2015-11-24 07:59:35 -05:00
|
|
|
{
|
2016-01-07 15:27:20 -05:00
|
|
|
CombiModePrivateData *pd = mode_get_private_data ( sw );
|
2015-11-24 07:59:35 -05:00
|
|
|
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
|
|
|
|
if ( index >= pd->starts[i] && index < ( pd->starts[i] + pd->lengths[i] ) ) {
|
2017-02-04 04:54:15 -05:00
|
|
|
char *comp = mode_get_completion ( pd->switchers[i].mode, index - pd->starts[i] );
|
|
|
|
char *mcomp = g_strdup_printf ( "!%s %s", mode_get_name ( pd->switchers[i].mode ), comp );
|
2016-04-19 16:10:34 -04:00
|
|
|
g_free ( comp );
|
2016-04-10 14:57:12 -04:00
|
|
|
return mcomp;
|
2015-11-24 07:59:35 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Should never get here.
|
2017-04-15 05:58:49 -04:00
|
|
|
g_assert_not_reached ();
|
2015-11-24 07:59:35 -05:00
|
|
|
return NULL;
|
|
|
|
}
|
2015-03-30 14:12:22 -04:00
|
|
|
|
2017-04-12 11:58:32 -04:00
|
|
|
static cairo_surface_t * combi_get_icon ( const Mode *sw, unsigned int index, int height )
|
|
|
|
{
|
|
|
|
CombiModePrivateData *pd = mode_get_private_data ( sw );
|
|
|
|
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
|
|
|
|
if ( index >= pd->starts[i] && index < ( pd->starts[i] + pd->lengths[i] ) ) {
|
|
|
|
cairo_surface_t *icon = mode_get_icon ( pd->switchers[i].mode, index - pd->starts[i], height );
|
|
|
|
return icon;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2016-05-26 02:39:33 -04:00
|
|
|
static char * combi_preprocess_input ( Mode *sw, const char *input )
|
|
|
|
{
|
|
|
|
CombiModePrivateData *pd = mode_get_private_data ( sw );
|
2017-02-04 04:54:15 -05:00
|
|
|
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
|
|
|
|
pd->switchers[i].disable = FALSE;
|
|
|
|
}
|
2017-01-26 13:46:46 -05:00
|
|
|
if ( input != NULL && input[0] == '!' ) {
|
2020-04-07 06:48:53 -04:00
|
|
|
// Implement strchrnul behaviour.
|
2020-08-28 10:41:59 -04:00
|
|
|
const char *eob = g_utf8_strchr ( input, -1, ' ' );
|
2020-04-07 06:48:53 -04:00
|
|
|
if ( eob == NULL ) {
|
|
|
|
// Set it to end.
|
2020-08-28 10:41:59 -04:00
|
|
|
eob = &( input[strlen ( input )] );
|
2020-04-07 06:48:53 -04:00
|
|
|
}
|
2017-01-26 13:46:46 -05:00
|
|
|
ssize_t bang_len = g_utf8_pointer_to_offset ( input, eob ) - 1;
|
|
|
|
if ( bang_len > 0 ) {
|
|
|
|
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
|
2017-02-04 04:54:15 -05:00
|
|
|
const char *mode_name = mode_get_name ( pd->switchers[i].mode );
|
2017-02-03 14:49:16 -05:00
|
|
|
size_t mode_name_len = g_utf8_strlen ( mode_name, -1 );
|
2017-02-04 04:54:15 -05:00
|
|
|
if ( !( (size_t) bang_len <= mode_name_len && utf8_strncmp ( &input[1], mode_name, bang_len ) == 0 ) ) {
|
|
|
|
// No match.
|
|
|
|
pd->switchers[i].disable = TRUE;
|
2016-05-26 02:39:33 -04:00
|
|
|
}
|
|
|
|
}
|
2017-02-04 04:54:15 -05:00
|
|
|
if ( eob[0] == '\0' || eob[1] == '\0' ) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
return g_strdup ( eob + 1 );
|
2016-05-26 02:39:33 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return g_strdup ( input );
|
|
|
|
}
|
|
|
|
|
2015-11-25 03:26:38 -05:00
|
|
|
Mode combi_mode =
|
2015-03-30 14:12:22 -04:00
|
|
|
{
|
2016-01-07 15:27:20 -05:00
|
|
|
.name = "combi",
|
2016-01-12 16:17:53 -05:00
|
|
|
.cfg_name_key = "display-combi",
|
2016-01-07 15:27:20 -05:00
|
|
|
._init = combi_mode_init,
|
|
|
|
._get_num_entries = combi_mode_get_num_entries,
|
|
|
|
._result = combi_mode_result,
|
|
|
|
._destroy = combi_mode_destroy,
|
|
|
|
._token_match = combi_mode_match,
|
|
|
|
._get_completion = combi_get_completion,
|
|
|
|
._get_display_value = combi_mgrv,
|
2017-04-12 11:58:32 -04:00
|
|
|
._get_icon = combi_get_icon,
|
2016-05-26 02:39:33 -04:00
|
|
|
._preprocess_input = combi_preprocess_input,
|
2016-01-07 15:27:20 -05:00
|
|
|
.private_data = NULL,
|
|
|
|
.free = NULL
|
2015-03-30 14:12:22 -04:00
|
|
|
};
|