File: ui_shortcut.h

package info (click to toggle)
mlterm 3.9.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 25,340 kB
  • sloc: ansic: 154,713; sh: 5,302; cpp: 2,953; objc: 2,776; java: 2,472; makefile: 2,445; perl: 1,674; xml: 44
file content (74 lines) | stat: -rw-r--r-- 1,300 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* -*- c-basic-offset:2; tab-width:2; indent-tabs-mode:nil -*- */

/*
 * This manages short-cut keys of ui_screen key events.
 */

#ifndef __UI_SHORTCUT_H__
#define __UI_SHORTCUT_H__

#include "ui.h"
#include <pobl/bl_types.h>

typedef enum ui_key_func {
  IM_HOTKEY,
  EXT_KBD,
  OPEN_SCREEN,
  OPEN_PTY,
  NEXT_PTY,
  PREV_PTY,
  HSPLIT_SCREEN,
  VSPLIT_SCREEN,
  NEXT_SCREEN,
  PREV_SCREEN,
  CLOSE_SCREEN,
  HEXPAND_SCREEN,
  VEXPAND_SCREEN,
  PAGE_UP,
  SCROLL_UP,
  SCROLL_UP_TO_MARK,
  SCROLL_DOWN_TO_MARK,
  INSERT_SELECTION,
  INSERT_CLIPBOARD,
  COPY_CLIPBOARD,
  RESET,
  COPY_MODE,
  SET_MARK,
  EXIT_PROGRAM,

  MAX_KEY_MAPS

} ui_key_func_t;

typedef struct ui_key {
  KeySym ksym;
  u_int state;
  int is_used;

} ui_key_t;

typedef struct ui_str_key {
  KeySym ksym;
  u_int state;
  char *str;

} ui_str_key_t;

typedef struct ui_shortcut {
  ui_key_t map[MAX_KEY_MAPS];
  ui_str_key_t *str_map;
  u_int str_map_size;

} ui_shortcut_t;

void ui_shortcut_init(ui_shortcut_t *shortcut);

void ui_shortcut_final(ui_shortcut_t *shortcut);

int ui_shortcut_match(ui_shortcut_t *shortcut, ui_key_func_t func, KeySym sym, u_int state);

char *ui_shortcut_str(ui_shortcut_t *shortcut, KeySym sym, u_int state);

int ui_shortcut_parse(ui_shortcut_t *shortcut, char *key, char *oper);

#endif