<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># HG changeset patch
# Parent 8535ec673dce6301179b50c930cbf29db33fb302
Rename KeysCommand_t to KeysCommand, KeyBinding_t to KeyBinding, Mapping_t to Mapping.

diff -r 8535ec673dce src/keys.cc
--- a/src/keys.cc
+++ b/src/keys.cc
@@ -25,20 +25,20 @@
  */
 typedef struct {
    const char *name;
-   KeysCommand_t cmd;
+   KeysCommand cmd;
    int modifier, key;
-} KeyBinding_t;
+} KeyBinding;
 
 typedef struct {
    const char *name;
    const int value;
-} Mapping_t;
+} Mapping;
 
 
 /*
  *  Local data
  */
-static const Mapping_t keyNames[] = {
+static const Mapping keyNames[] = {
    { "Backspace",   FL_BackSpace },
    { "Delete",      FL_Delete    },
    { "Down",        FL_Down      },
@@ -86,7 +86,7 @@
    { "VolumeUp",    FL_Volume_Up   },
 };
 
-static const Mapping_t modifierNames[] = {
+static const Mapping modifierNames[] = {
    { "Shift",   FL_SHIFT   },
    { "Ctrl",    FL_CTRL    },
    { "Alt",     FL_ALT     },
@@ -96,7 +96,7 @@
    { "Button3", FL_BUTTON3 }
 };
 
-static const KeyBinding_t default_keys[] = {
+static const KeyBinding default_keys[] = {
    { "nop"          , KEYS_NOP          , 0         , 0               },
    { "open"         , KEYS_OPEN         , FL_CTRL   , 'o'             },
    { "new-window"   , KEYS_NEW_WINDOW   , FL_CTRL   , 'n'             },
@@ -146,13 +146,13 @@
  */
 void Keys::init()
 {
-   KeyBinding_t *node;
+   KeyBinding *node;
 
    // Fill our key bindings list
    bindings = dList_new(32);
    for (uint_t i = 0; i &lt; sizeof(default_keys) / sizeof(default_keys[0]); i++) {
       if (default_keys[i].key) {
-         node = dNew(KeyBinding_t, 1);
+         node = dNew(KeyBinding, 1);
          node-&gt;name = dStrdup(default_keys[i].name);
          node-&gt;cmd = default_keys[i].cmd;
          node-&gt;modifier = default_keys[i].modifier;
@@ -167,9 +167,9 @@
  */
 void Keys::free()
 {
-   KeyBinding_t *node;
+   KeyBinding *node;
 
-   while ((node = (KeyBinding_t*)dList_nth_data(bindings, 0))) {
+   while ((node = (KeyBinding*)dList_nth_data(bindings, 0))) {
       dFree((char*)node-&gt;name);
       dList_remove_fast(bindings, node);
       dFree(node);
@@ -182,7 +182,7 @@
  */
 int Keys::nodeByKeyCmp(const void *node, const void *key)
 {
-   KeyBinding_t *n = (KeyBinding_t*)node, *k = (KeyBinding_t*)key;
+   KeyBinding *n = (KeyBinding*)node, *k = (KeyBinding*)key;
    _MSG("Keys::nodeByKeyCmp modifier=%d\n", k-&gt;modifier);
    return (n-&gt;key != k-&gt;key) ? (n-&gt;key - k-&gt;key) : (n-&gt;modifier - k-&gt;modifier);
 }
@@ -191,10 +191,10 @@
  * Look if the just pressed key is bound to a command.
  * Return value: The command if found, KEYS_NOP otherwise.
  */
-KeysCommand_t Keys::getKeyCmd()
+KeysCommand Keys::getKeyCmd()
 {
-   KeysCommand_t ret = KEYS_NOP;
-   KeyBinding_t keyNode;
+   KeysCommand ret = KEYS_NOP;
+   KeyBinding keyNode;
 
    keyNode.modifier = Fl::event_state() &amp; (FL_SHIFT | FL_CTRL |FL_ALT|FL_META);
    if (iscntrl(Fl::event_text()[0])) {
@@ -216,7 +216,7 @@
         Fl::event_key(), Fl::event_text(), keyNode.key, keyNode.modifier);
    void *data = dList_find_sorted(bindings, &amp;keyNode, nodeByKeyCmp);
    if (data)
-      ret = ((KeyBinding_t*)data)-&gt;cmd;
+      ret = ((KeyBinding*)data)-&gt;cmd;
    return ret;
 }
 
@@ -225,11 +225,11 @@
  */
 void Keys::delKeyCmd(int key, int mod)
 {
-   KeyBinding_t keyNode, *node;
+   KeyBinding keyNode, *node;
    keyNode.key = key;
    keyNode.modifier = mod;
 
-   node = (KeyBinding_t*) dList_find_sorted(bindings, &amp;keyNode, nodeByKeyCmp);
+   node = (KeyBinding*) dList_find_sorted(bindings, &amp;keyNode, nodeByKeyCmp);
    if (node) {
       dList_remove(bindings, node);
       dFree((char*)node-&gt;name);
@@ -258,11 +258,11 @@
  * Takes a command name and searches it in the mapping table.
  * Return value: command code if found, -1 otherwise
  */
-KeysCommand_t Keys::getCmdCode(const char *commandName)
+KeysCommand Keys::getCmdCode(const char *commandName)
 {
    uint_t i;
 
-   for (i = 0; i &lt; sizeof(default_keys) / sizeof(KeyBinding_t); i++) {
+   for (i = 0; i &lt; sizeof(default_keys) / sizeof(KeyBinding); i++) {
       if (!dStrAsciiCasecmp(default_keys[i].name, commandName))
          return default_keys[i].cmd;
    }
@@ -289,12 +289,12 @@
  * Given a keys command, return a shortcut for it, or 0 if there is none
  * (e.g., for KEYS_NEW_WINDOW, return CTRL+'n').
  */
-int Keys::getShortcut(KeysCommand_t cmd)
+int Keys::getShortcut(KeysCommand cmd)
 {
    int len = dList_length(bindings);
 
    for (int i = 0; i &lt; len; i++) {
-      KeyBinding_t *node = (KeyBinding_t*)dList_nth_data(bindings, i);
+      KeyBinding *node = (KeyBinding*)dList_nth_data(bindings, i);
       if (cmd == node-&gt;cmd)
          return node-&gt;modifier + node-&gt;key;
    }
@@ -308,7 +308,7 @@
 void Keys::parseKey(char *key, char *commandName)
 {
    char *p, *modstr, *keystr;
-   KeysCommand_t symcode;
+   KeysCommand symcode;
    int st, keymod = 0, keycode = 0;
 
    _MSG("Keys::parseKey key='%s' commandName='%s'\n", key, commandName);
@@ -356,7 +356,7 @@
    if (keycode) {
       delKeyCmd(keycode, keymod);
       if (symcode != KEYS_NOP) {
-         KeyBinding_t *node = dNew(KeyBinding_t, 1);
+         KeyBinding *node = dNew(KeyBinding, 1);
          node-&gt;name = dStrdup(commandName);
          node-&gt;cmd = symcode;
          node-&gt;modifier = keymod;
diff -r 8535ec673dce src/keys.hh
--- a/src/keys.hh
+++ b/src/keys.hh
@@ -48,13 +48,13 @@
    KEYS_RIGHT,
    KEYS_TOP,
    KEYS_BOTTOM
-} KeysCommand_t;
+} KeysCommand;
 
 class Keys {
 private:
    static int nodeByKeyCmp(const void *node, const void *key);
    static void delKeyCmd(int key, int mod);
-   static KeysCommand_t getCmdCode(const char *symbolName);
+   static KeysCommand getCmdCode(const char *symbolName);
    static int getKeyCode(char *keyName);
    static int getModifier(char *modifierName);
    static void parseKey(char *key, char *symbol);
@@ -62,8 +62,8 @@
    static void init();
    static void free();
    static void parse(FILE *fp);
-   static KeysCommand_t getKeyCmd(void);
-   static int getShortcut(KeysCommand_t cmd);
+   static KeysCommand getKeyCmd(void);
+   static int getShortcut(KeysCommand cmd);
 };
 
 
diff -r 8535ec673dce src/ui.cc
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -714,7 +714,7 @@
    if (event == FL_KEYBOARD) {
       return 0; // Receive as shortcut
    } else if (event == FL_SHORTCUT) {
-      KeysCommand_t cmd = Keys::getKeyCmd();
+      KeysCommand cmd = Keys::getKeyCmd();
       if (cmd == KEYS_NOP) {
          // Do nothing
       } else if (cmd == KEYS_SCREEN_UP || cmd == KEYS_SCREEN_DOWN ||
diff -r 8535ec673dce src/uicmd.cc
--- a/src/uicmd.cc
+++ b/src/uicmd.cc
@@ -223,7 +223,7 @@
    } else if (e == FL_SHORTCUT) {
       UI *ui = (UI*)wizard()-&gt;value();
       BrowserWindow *bw = a_UIcmd_get_bw_by_widget(ui);
-      KeysCommand_t cmd = Keys::getKeyCmd();
+      KeysCommand cmd = Keys::getKeyCmd();
       if (cmd == KEYS_NOP) {
          // Do nothing
          _MSG("CustTabs::handle KEYS_NOP\n");
@@ -1294,7 +1294,7 @@
 
    if (layout) {
       typedef struct {
-         KeysCommand_t keys_cmd;
+         KeysCommand keys_cmd;
          ScrollCommand dw_cmd;
       } mapping_t;
 
@@ -1310,7 +1310,7 @@
          {KEYS_TOP, TOP_CMD},
          {KEYS_BOTTOM, BOTTOM_CMD},
       };
-      KeysCommand_t keycmd = (KeysCommand_t)icmd;
+      KeysCommand keycmd = (KeysCommand)icmd;
 
       for (uint_t i = 0; i &lt; sizeof(map) / sizeof(map[0]); i++) {
          if (keycmd == map[i].keys_cmd) {
</pre></body></html>