LCOV - code coverage report
Current view: top level - src/utils/gui/shortcuts - GUIShortcutsSubSys.cpp (source / functions) Coverage Total Hit
Test: lcov.info Lines: 96.5 % 198 191
Test Date: 2024-12-21 15:45:41 Functions: 100.0 % 5 5

            Line data    Source code
       1              : /****************************************************************************/
       2              : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
       3              : // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
       4              : // This program and the accompanying materials are made available under the
       5              : // terms of the Eclipse Public License 2.0 which is available at
       6              : // https://www.eclipse.org/legal/epl-2.0/
       7              : // This Source Code may also be made available under the following Secondary
       8              : // Licenses when the conditions for such availability set forth in the Eclipse
       9              : // Public License 2.0 are satisfied: GNU General Public License, version 2
      10              : // or later which is available at
      11              : // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
      12              : // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
      13              : /****************************************************************************/
      14              : /// @file    GUIShortcutsSubSys.cpp
      15              : /// @author  Pablo Alvarez Lopez
      16              : /// @date    Feb 2019
      17              : ///
      18              : // Helper for Shortcuts
      19              : /****************************************************************************/
      20              : #include <config.h>
      21              : 
      22              : #include <utils/gui/windows/GUIAppEnum.h>
      23              : 
      24              : #include "GUIShortcutsSubSys.h"
      25              : 
      26              : // ===========================================================================
      27              : // member definitions
      28              : // ===========================================================================
      29              : 
      30              : void
      31         7599 : GUIShortcutsSubSys::buildAccelerators(FXAccelTable* accelTable, FXObject* target, const bool sumogui) {
      32              : 
      33              :     // basic hotkeys
      34              : 
      35         7599 :     accelTable->addAccel(parseKey(KEY_a), target, FXSEL(SEL_COMMAND, MID_HOTKEY_A_MODE_STARTSIMULATION_ADDITIONALS_STOPS));
      36         7599 :     accelTable->addAccel(parseKey(KEY_A), target, FXSEL(SEL_COMMAND, MID_HOTKEY_A_MODE_STARTSIMULATION_ADDITIONALS_STOPS));
      37              : 
      38         7599 :     accelTable->addAccel(parseKey(KEY_b), target, FXSEL(SEL_COMMAND, MID_HOTKEY_B_BREAKPOINT));
      39         7599 :     accelTable->addAccel(parseKey(KEY_B), target, FXSEL(SEL_COMMAND, MID_HOTKEY_B_BREAKPOINT));
      40              : 
      41         7599 :     accelTable->addAccel(parseKey(KEY_c), target, FXSEL(SEL_COMMAND, MID_HOTKEY_C_MODE_CONNECT_CONTAINER));
      42         7599 :     accelTable->addAccel(parseKey(KEY_C), target, FXSEL(SEL_COMMAND, MID_HOTKEY_C_MODE_CONNECT_CONTAINER));
      43              : 
      44         7599 :     accelTable->addAccel(parseKey(KEY_d), target, FXSEL(SEL_COMMAND, MID_HOTKEY_D_MODE_SINGLESIMULATIONSTEP_DELETE));
      45         7599 :     accelTable->addAccel(parseKey(KEY_D), target, FXSEL(SEL_COMMAND, MID_HOTKEY_D_MODE_SINGLESIMULATIONSTEP_DELETE));
      46              : 
      47         7599 :     accelTable->addAccel(parseKey(KEY_e), target, FXSEL(SEL_COMMAND, MID_HOTKEY_E_MODE_EDGE_EDGEDATA));
      48         7599 :     accelTable->addAccel(parseKey(KEY_E), target, FXSEL(SEL_COMMAND, MID_HOTKEY_E_MODE_EDGE_EDGEDATA));
      49              : 
      50         7599 :     accelTable->addAccel(parseKey(KEY_h), target, FXSEL(SEL_COMMAND, MID_HOTKEY_H_MODE_PROHIBITION_CONTAINERPLAN));
      51         7599 :     accelTable->addAccel(parseKey(KEY_H), target, FXSEL(SEL_COMMAND, MID_HOTKEY_H_MODE_PROHIBITION_CONTAINERPLAN));
      52              : 
      53         7599 :     accelTable->addAccel(parseKey(KEY_i), target, FXSEL(SEL_COMMAND, MID_HOTKEY_I_MODE_INSPECT));
      54         7599 :     accelTable->addAccel(parseKey(KEY_I), target, FXSEL(SEL_COMMAND, MID_HOTKEY_I_MODE_INSPECT));
      55              : 
      56         7599 :     accelTable->addAccel(parseKey(KEY_l), target, FXSEL(SEL_COMMAND, MID_HOTKEY_L_MODE_PERSONPLAN));
      57         7599 :     accelTable->addAccel(parseKey(KEY_L), target, FXSEL(SEL_COMMAND, MID_HOTKEY_L_MODE_PERSONPLAN));
      58              : 
      59         7599 :     accelTable->addAccel(parseKey(KEY_m), target, FXSEL(SEL_COMMAND, MID_HOTKEY_M_MODE_MOVE_MEANDATA));
      60         7599 :     accelTable->addAccel(parseKey(KEY_M), target, FXSEL(SEL_COMMAND, MID_HOTKEY_M_MODE_MOVE_MEANDATA));
      61              : 
      62         7599 :     accelTable->addAccel(parseKey(KEY_p), target, FXSEL(SEL_COMMAND, MID_HOTKEY_P_MODE_POLYGON_PERSON));
      63         7599 :     accelTable->addAccel(parseKey(KEY_P), target, FXSEL(SEL_COMMAND, MID_HOTKEY_P_MODE_POLYGON_PERSON));
      64              : 
      65         7599 :     accelTable->addAccel(parseKey(KEY_r), target, FXSEL(SEL_COMMAND, MID_HOTKEY_R_MODE_CROSSING_ROUTE_EDGERELDATA));
      66         7599 :     accelTable->addAccel(parseKey(KEY_R), target, FXSEL(SEL_COMMAND, MID_HOTKEY_R_MODE_CROSSING_ROUTE_EDGERELDATA));
      67              : 
      68         7599 :     accelTable->addAccel(parseKey(KEY_s), target, FXSEL(SEL_COMMAND, MID_HOTKEY_S_MODE_STOPSIMULATION_SELECT));
      69         7599 :     accelTable->addAccel(parseKey(KEY_S), target, FXSEL(SEL_COMMAND, MID_HOTKEY_S_MODE_STOPSIMULATION_SELECT));
      70              : 
      71         7599 :     accelTable->addAccel(parseKey(KEY_t), target, FXSEL(SEL_COMMAND, MID_HOTKEY_T_MODE_TLS_TYPE));
      72         7599 :     accelTable->addAccel(parseKey(KEY_T), target, FXSEL(SEL_COMMAND, MID_HOTKEY_T_MODE_TLS_TYPE));
      73              : 
      74         7599 :     accelTable->addAccel(parseKey(KEY_u), target, FXSEL(SEL_COMMAND, MID_HOTKEY_U_MODE_DECAL_TYPEDISTRIBUTION));
      75         7599 :     accelTable->addAccel(parseKey(KEY_U), target, FXSEL(SEL_COMMAND, MID_HOTKEY_U_MODE_DECAL_TYPEDISTRIBUTION));
      76              : 
      77         7599 :     accelTable->addAccel(parseKey(KEY_v), target, FXSEL(SEL_COMMAND, MID_HOTKEY_V_MODE_VEHICLE));
      78         7599 :     accelTable->addAccel(parseKey(KEY_V), target, FXSEL(SEL_COMMAND, MID_HOTKEY_V_MODE_VEHICLE));
      79              : 
      80         7599 :     accelTable->addAccel(parseKey(KEY_w), target, FXSEL(SEL_COMMAND, MID_HOTKEY_W_MODE_WIRE_ROUTEDISTRIBUTION));
      81         7599 :     accelTable->addAccel(parseKey(KEY_W), target, FXSEL(SEL_COMMAND, MID_HOTKEY_W_MODE_WIRE_ROUTEDISTRIBUTION));
      82              : 
      83         7599 :     accelTable->addAccel(parseKey(KEY_z), target, FXSEL(SEL_COMMAND, MID_HOTKEY_Z_MODE_TAZ_TAZREL));
      84         7599 :     accelTable->addAccel(parseKey(KEY_Z), target, FXSEL(SEL_COMMAND, MID_HOTKEY_Z_MODE_TAZ_TAZREL));
      85              : 
      86              :     // function Hotkeys
      87              : 
      88         7599 :     accelTable->addAccel(parseKey(KEY_F1),  target, FXSEL(SEL_COMMAND, MID_HOTKEY_F1_ONLINEDOCUMENTATION));
      89         7599 :     accelTable->addAccel(parseKey(KEY_F2),  target, FXSEL(SEL_COMMAND, MID_HOTKEY_F2_SUPERMODE_NETWORK));
      90         7599 :     accelTable->addAccel(parseKey(KEY_F3),  target, FXSEL(SEL_COMMAND, MID_HOTKEY_F3_SUPERMODE_DEMAND));
      91         7599 :     accelTable->addAccel(parseKey(KEY_F4),  target, FXSEL(SEL_COMMAND, MID_HOTKEY_F4_SUPERMODE_DATA));
      92         7599 :     accelTable->addAccel(parseKey(KEY_F5),  target, FXSEL(SEL_COMMAND, MID_HOTKEY_F5_COMPUTE_NETWORK_DEMAND));
      93         7599 :     accelTable->addAccel(parseKey(KEY_F6),  target, FXSEL(SEL_COMMAND, MID_HOTKEY_F6_CLEAN_SOLITARYJUNCTIONS_UNUSEDROUTES));
      94         7599 :     accelTable->addAccel(parseKey(KEY_F7),  target, FXSEL(SEL_COMMAND, MID_HOTKEY_F7_JOIN_SELECTEDJUNCTIONS_ROUTES));
      95         7599 :     accelTable->addAccel(parseKey(KEY_F8),  target, FXSEL(SEL_COMMAND, MID_HOTKEY_F8_CLEANINVALID_CROSSINGS_DEMANDELEMENTS));
      96         7599 :     accelTable->addAccel(parseKey(KEY_F9),  target, FXSEL(SEL_COMMAND, MID_HOTKEY_F9_EDIT_VIEWSCHEME));
      97         7599 :     accelTable->addAccel(parseKey(KEY_F10), target, FXSEL(SEL_COMMAND, MID_HOTKEY_F10_OPTIONSMENU));
      98         7599 :     accelTable->addAccel(parseKey(KEY_F11), target, FXSEL(SEL_COMMAND, MID_HOTKEY_F11_FRONTELEMENT));
      99         7599 :     accelTable->addAccel(parseKey(KEY_F12), target, FXSEL(SEL_COMMAND, MID_HOTKEY_F12_ABOUT));
     100              : 
     101              :     // other hotkeys
     102              : 
     103         7599 :     accelTable->addAccel(parseKey(KEY_ESC),        target, FXSEL(SEL_COMMAND, MID_HOTKEY_ESC));
     104         7599 :     accelTable->addAccel(parseKey(KEY_DEL),        target, FXSEL(SEL_COMMAND, MID_HOTKEY_DEL));
     105         7599 :     accelTable->addAccel(parseKey(KEY_ENTER),      target, FXSEL(SEL_COMMAND, MID_HOTKEY_ENTER));
     106         7599 :     accelTable->addAccel(parseKey(KEY_BACKSPACE),  target, FXSEL(SEL_COMMAND, MID_HOTKEY_BACKSPACE));
     107              : 
     108              :     // control hotkeys
     109              : 
     110         7599 :     accelTable->addAccel(parseKey(KEY_a, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS));
     111         7599 :     accelTable->addAccel(parseKey(KEY_A, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS));
     112              : 
     113         7599 :     accelTable->addAccel(parseKey(KEY_b, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS));
     114         7599 :     accelTable->addAccel(parseKey(KEY_B, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS));
     115              : 
     116         7599 :     accelTable->addAccel(parseKey(KEY_c, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_C_COPY));
     117         7599 :     accelTable->addAccel(parseKey(KEY_C, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_C_COPY));
     118              : 
     119         7599 :     accelTable->addAccel(parseKey(KEY_d, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS));
     120         7599 :     accelTable->addAccel(parseKey(KEY_D, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS));
     121              : 
     122              :     // special case: we can NOT overwritte here the ctrl+E shortcut in SUMO-GUI
     123         7599 :     if (!sumogui) {
     124            0 :         accelTable->addAccel(parseKey(KEY_e, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_E_EDITSELECTION_LOADNETEDITCONFIG));
     125            0 :         accelTable->addAccel(parseKey(KEY_E, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_E_EDITSELECTION_LOADNETEDITCONFIG));
     126              :     }
     127              : 
     128         7599 :     accelTable->addAccel(parseKey(KEY_f, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_F_FULSCREENMODE));
     129         7599 :     accelTable->addAccel(parseKey(KEY_F, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_F_FULSCREENMODE));
     130              : 
     131         7599 :     accelTable->addAccel(parseKey(KEY_g, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_G_GAMINGMODE_TOGGLEGRID));
     132         7599 :     accelTable->addAccel(parseKey(KEY_G, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_G_GAMINGMODE_TOGGLEGRID));
     133              : 
     134         7599 :     accelTable->addAccel(parseKey(KEY_h, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_H_APPSETTINGS_OPENEDGETYPES));
     135         7599 :     accelTable->addAccel(parseKey(KEY_H, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_H_APPSETTINGS_OPENEDGETYPES));
     136              : 
     137         7599 :     accelTable->addAccel(parseKey(KEY_i, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_I_EDITVIEWPORT));
     138         7599 :     accelTable->addAccel(parseKey(KEY_I, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_I_EDITVIEWPORT));
     139              : 
     140         7599 :     accelTable->addAccel(parseKey(KEY_j, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_J_TOGGLEDRAWJUNCTIONSHAPE));
     141         7599 :     accelTable->addAccel(parseKey(KEY_J, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_J_TOGGLEDRAWJUNCTIONSHAPE));
     142              : 
     143         7599 :     accelTable->addAccel(parseKey(KEY_k, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_K_OPENTLSPROGRAMS));
     144         7599 :     accelTable->addAccel(parseKey(KEY_K, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_K_OPENTLSPROGRAMS));
     145              : 
     146         7599 :     accelTable->addAccel(parseKey(KEY_l, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_L_SAVEASPLAINXML));
     147         7599 :     accelTable->addAccel(parseKey(KEY_L, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_L_SAVEASPLAINXML));
     148              : 
     149         7599 :     accelTable->addAccel(parseKey(KEY_m, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_M_OPENSUMOCONFIG));
     150         7599 :     accelTable->addAccel(parseKey(KEY_M, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_M_OPENSUMOCONFIG));
     151              : 
     152         7599 :     accelTable->addAccel(parseKey(KEY_n, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_N_OPENNETWORK_NEWNETWORK));
     153         7599 :     accelTable->addAccel(parseKey(KEY_N, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_N_OPENNETWORK_NEWNETWORK));
     154              : 
     155         7599 :     accelTable->addAccel(parseKey(KEY_o, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_O_OPENSIMULATION_OPENNETWORK));
     156         7599 :     accelTable->addAccel(parseKey(KEY_O, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_O_OPENSIMULATION_OPENNETWORK));
     157              : 
     158         7599 :     accelTable->addAccel(parseKey(KEY_p, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_P_OPENSHAPES));
     159         7599 :     accelTable->addAccel(parseKey(KEY_P, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_P_OPENSHAPES));
     160              : 
     161         7599 :     accelTable->addAccel(parseKey(KEY_q, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_Q_CLOSE));
     162         7599 :     accelTable->addAccel(parseKey(KEY_Q, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_Q_CLOSE));
     163              : 
     164         7599 :     accelTable->addAccel(parseKey(KEY_r, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_R_RELOAD));
     165         7599 :     accelTable->addAccel(parseKey(KEY_R, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_R_RELOAD));
     166              : 
     167         7599 :     accelTable->addAccel(parseKey(KEY_s, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK));
     168         7599 :     accelTable->addAccel(parseKey(KEY_S, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK));
     169              : 
     170         7599 :     accelTable->addAccel(parseKey(KEY_t, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_T_OPENNETEDIT_OPENSUMO));
     171         7599 :     accelTable->addAccel(parseKey(KEY_T, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_T_OPENNETEDIT_OPENSUMO));
     172              : 
     173         7599 :     accelTable->addAccel(parseKey(KEY_u, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_U_OPENEDGEDATA));
     174         7599 :     accelTable->addAccel(parseKey(KEY_U, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_U_OPENEDGEDATA));
     175              : 
     176         7599 :     accelTable->addAccel(parseKey(KEY_w, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_W_CLOSESIMULATION));
     177         7599 :     accelTable->addAccel(parseKey(KEY_W, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_W_CLOSESIMULATION));
     178              : 
     179         7599 :     accelTable->addAccel(parseKey(KEY_v, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_V_PASTE));
     180         7599 :     accelTable->addAccel(parseKey(KEY_V, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_V_PASTE));
     181              : 
     182         7599 :     accelTable->addAccel(parseKey(KEY_x, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_X_CUT));
     183         7599 :     accelTable->addAccel(parseKey(KEY_X, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_X_CUT));
     184              : 
     185         7599 :     accelTable->addAccel(parseKey(KEY_y, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_Y_REDO));
     186         7599 :     accelTable->addAccel(parseKey(KEY_Y, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_Y_REDO));
     187              : 
     188         7599 :     accelTable->addAccel(parseKey(KEY_z, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_Z_UNDO));
     189         7599 :     accelTable->addAccel(parseKey(KEY_Z, KEYMODIFIER_CONTROL), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_Z_UNDO));
     190              : 
     191              :     // control + shift hotkeys
     192              : 
     193         7599 :     accelTable->addAccel(parseKey(KEY_a, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_A_SAVEADDITIONALS));
     194         7599 :     accelTable->addAccel(parseKey(KEY_A, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_A_SAVEADDITIONALS));
     195              : 
     196         7599 :     accelTable->addAccel(parseKey(KEY_b, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_B_SAVEDATAELEMENTS));
     197         7599 :     accelTable->addAccel(parseKey(KEY_B, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_B_SAVEDATAELEMENTS));
     198              : 
     199         7599 :     accelTable->addAccel(parseKey(KEY_c, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_C_SAVENETEDITCONFIG));
     200         7599 :     accelTable->addAccel(parseKey(KEY_C, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_C_SAVENETEDITCONFIG));
     201              : 
     202         7599 :     accelTable->addAccel(parseKey(KEY_d, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS));
     203         7599 :     accelTable->addAccel(parseKey(KEY_D, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS));
     204              : 
     205         7599 :     accelTable->addAccel(parseKey(KEY_e, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_E_SAVENETEDITCONFIG));
     206         7599 :     accelTable->addAccel(parseKey(KEY_E, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_E_SAVENETEDITCONFIG));
     207              : 
     208         7599 :     accelTable->addAccel(parseKey(KEY_h, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_H_SAVEEDGETYPES));
     209         7599 :     accelTable->addAccel(parseKey(KEY_H, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_H_SAVEEDGETYPES));
     210              : 
     211         7599 :     accelTable->addAccel(parseKey(KEY_k, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_K_SAVETLS));
     212         7599 :     accelTable->addAccel(parseKey(KEY_K, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_K_SAVETLS));
     213              : 
     214         7599 :     accelTable->addAccel(parseKey(KEY_m, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_M_SAVEMEANDATAS));
     215         7599 :     accelTable->addAccel(parseKey(KEY_M, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_M_SAVEMEANDATAS));
     216              : 
     217         7599 :     accelTable->addAccel(parseKey(KEY_n, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_N_NEWWINDOW));
     218         7599 :     accelTable->addAccel(parseKey(KEY_N, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_N_NEWWINDOW));
     219              : 
     220         7599 :     accelTable->addAccel(parseKey(KEY_o, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_O_OPENNETCONVERTFILE));
     221         7599 :     accelTable->addAccel(parseKey(KEY_O, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_O_OPENNETCONVERTFILE));
     222              : 
     223         7599 :     accelTable->addAccel(parseKey(KEY_s, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_S_SAVESUMOCONFIG));
     224         7599 :     accelTable->addAccel(parseKey(KEY_S, KEYMODIFIER_CONTROL, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_S_SAVESUMOCONFIG));
     225              : 
     226              :     // shift hotkeys
     227              : 
     228         7599 :     accelTable->addAccel(parseKey(KEY_a, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_A_LOCATEADDITIONAL));
     229         7599 :     accelTable->addAccel(parseKey(KEY_A, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_A_LOCATEADDITIONAL));
     230              : 
     231         7599 :     accelTable->addAccel(parseKey(KEY_c, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_C_LOCATECONTAINER));
     232         7599 :     accelTable->addAccel(parseKey(KEY_C, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_C_LOCATECONTAINER));
     233              : 
     234         7599 :     accelTable->addAccel(parseKey(KEY_e, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_E_LOCATEEDGE));
     235         7599 :     accelTable->addAccel(parseKey(KEY_E, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_E_LOCATEEDGE));
     236              : 
     237         7599 :     accelTable->addAccel(parseKey(KEY_j, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_J_LOCATEJUNCTION));
     238         7599 :     accelTable->addAccel(parseKey(KEY_J, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_J_LOCATEJUNCTION));
     239              : 
     240         7599 :     accelTable->addAccel(parseKey(KEY_l, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_L_LOCATEPOLY));
     241         7599 :     accelTable->addAccel(parseKey(KEY_L, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_L_LOCATEPOLY));
     242              : 
     243         7599 :     accelTable->addAccel(parseKey(KEY_o, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_O_LOCATEPOI));
     244         7599 :     accelTable->addAccel(parseKey(KEY_O, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_O_LOCATEPOI));
     245              : 
     246         7599 :     accelTable->addAccel(parseKey(KEY_p, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_P_LOCATEPERSON));
     247         7599 :     accelTable->addAccel(parseKey(KEY_P, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_P_LOCATEPERSON));
     248              : 
     249         7599 :     accelTable->addAccel(parseKey(KEY_t, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_T_LOCATETLS));
     250         7599 :     accelTable->addAccel(parseKey(KEY_T, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_T_LOCATETLS));
     251              : 
     252         7599 :     accelTable->addAccel(parseKey(KEY_v, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_V_LOCATEVEHICLE));
     253         7599 :     accelTable->addAccel(parseKey(KEY_V, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_V_LOCATEVEHICLE));
     254              : 
     255         7599 :     accelTable->addAccel(parseKey(KEY_F1,  KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F1_TEMPLATE_SET));
     256         7599 :     accelTable->addAccel(parseKey(KEY_F2,  KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY));
     257         7599 :     accelTable->addAccel(parseKey(KEY_F3,  KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR));
     258         7599 :     accelTable->addAccel(parseKey(KEY_F5,  KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F5_COMPUTEJUNCTIONS_VOLATILE));
     259         7599 :     accelTable->addAccel(parseKey(KEY_F7,  KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F7_ADJUST_PERSON_PLANS));
     260         7599 :     accelTable->addAccel(parseKey(KEY_F10, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F10_SUMOOPTIONSMENU));
     261         7599 :     accelTable->addAccel(parseKey(KEY_F11, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F11_HALLOFFAME));
     262         7599 :     accelTable->addAccel(parseKey(KEY_F12, KEYMODIFIER_SHIFT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F12_FOCUSUPPERELEMENT));
     263              : 
     264         7599 :     accelTable->addAccel(parseKey(KEY_ESC, KEYMODIFIER_SHIFT),  target, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_ESC_CLEARSELECTION));
     265              : 
     266              :     // alt hotkeys
     267              : 
     268         7599 :     accelTable->addAccel(parseKey(KEY_0, KEYMODIFIER_ALT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_0_TOGGLEEDITOPTION));
     269         7599 :     accelTable->addAccel(parseKey(KEY_1, KEYMODIFIER_ALT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_1_TOGGLEEDITOPTION));
     270         7599 :     accelTable->addAccel(parseKey(KEY_2, KEYMODIFIER_ALT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_2_TOGGLEEDITOPTION));
     271         7599 :     accelTable->addAccel(parseKey(KEY_3, KEYMODIFIER_ALT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_3_TOGGLEEDITOPTION));
     272         7599 :     accelTable->addAccel(parseKey(KEY_4, KEYMODIFIER_ALT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_4_TOGGLEEDITOPTION));
     273         7599 :     accelTable->addAccel(parseKey(KEY_5, KEYMODIFIER_ALT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_5_TOGGLEEDITOPTION));
     274         7599 :     accelTable->addAccel(parseKey(KEY_6, KEYMODIFIER_ALT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_6_TOGGLEEDITOPTION));
     275         7599 :     accelTable->addAccel(parseKey(KEY_7, KEYMODIFIER_ALT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_7_TOGGLEEDITOPTION));
     276         7599 :     accelTable->addAccel(parseKey(KEY_8, KEYMODIFIER_ALT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_8_TOGGLEEDITOPTION));
     277         7599 :     accelTable->addAccel(parseKey(KEY_9, KEYMODIFIER_ALT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_9_TOGGLEEDITOPTION));
     278              : 
     279         7599 :     accelTable->addAccel(parseKey(KEY_F4, KEYMODIFIER_ALT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_F4_CLOSE));
     280         7599 :     accelTable->addAccel(parseKey(KEY_b, KEYMODIFIER_ALT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_B_BREAKPOINT_EARLY));
     281         7599 :     accelTable->addAccel(parseKey(KEY_B, KEYMODIFIER_ALT), target, FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_B_BREAKPOINT_EARLY));
     282         7599 : }
     283              : 
     284              : 
     285              : void
     286      5978041 : GUIShortcutsSubSys::changeAccelerator(FXAccelTable* accelTable, FXObject* target, GUIShortcut keysym, long msg) {
     287      5978041 :     accelTable->addAccel(parseKey(keysym), target, FXSEL(SEL_COMMAND, msg));
     288      5978041 : }
     289              : 
     290              : 
     291              : int
     292      7209079 : GUIShortcutsSubSys::parseKey(GUIShortcut key) {
     293              :     // beware!: xx in the key - xx + yy expression may change when the content of enum GUIShortcut is changed (e.g. addition of space key)
     294              :     if ((key >= KEY_0) &&  key <= KEY_9) {
     295        75990 :         return (key + 48); // 48 is '0' in ASCII
     296              :     } else if ((key >= KEY_a) &&  key <= KEY_z) {
     297       478737 :         return (key - 10 + 97); // 97 is 'a' in ASCII
     298              :     } else if ((key >= KEY_A) &&  key <= KEY_Z) {
     299       478737 :         return (key - 36 + 65); // 65 is 'A' in ASCII
     300              :     } else if (key == KEY_SPACE) {
     301              :         return (key - 62 + 32); // 32 is SPACE  in ASCII
     302              :     } else if ((key >= KEY_F1) &&  key <= KEY_F12) {
     303       159579 :         return (key - 63 + 65470); // 65470 is 'F1' in ASCII
     304              :     } else if (key == KEY_ESC) {
     305        15198 :         return parseAccel("Esc");
     306              :     } else if (key == KEY_ENTER) {
     307         7599 :         return parseAccel("Enter");
     308              :     } else if (key == KEY_BACKSPACE) {
     309         7599 :         return parseAccel("Back");
     310              :     } else if (key == KEY_DEL) {
     311         7599 :         return parseAccel("Del");
     312              :     } else {
     313            0 :         return 0;
     314              :     }
     315              : }
     316              : 
     317              : 
     318              : int
     319       851088 : GUIShortcutsSubSys::parseKey(GUIShortcut key, GUIShortcutModifier firstModifier) {
     320       851088 :     int keyCode = parseKey(key);
     321              :     // add first modifier
     322       851088 :     if (firstModifier == KEYMODIFIER_SHIFT) {
     323       205173 :         keyCode += 65536;
     324       645915 :     } else if (firstModifier == KEYMODIFIER_ALT) {
     325        98787 :         keyCode += 524288;
     326       547128 :     } else if (firstModifier == KEYMODIFIER_CONTROL) {
     327       547128 :         keyCode += 262144;
     328              :     }
     329       851088 :     return keyCode;
     330              : }
     331              : 
     332              : 
     333              : int
     334       167178 : GUIShortcutsSubSys::parseKey(GUIShortcut key, GUIShortcutModifier firstModifier, GUIShortcutModifier secondModifier) {
     335       167178 :     int keyCode = parseKey(key, firstModifier);
     336              :     // add second modifier
     337       167178 :     if (secondModifier == KEYMODIFIER_SHIFT) {
     338       167178 :         keyCode += 65536;
     339            0 :     } else if (secondModifier == KEYMODIFIER_ALT) {
     340            0 :         keyCode += 524288;
     341            0 :     } else if (secondModifier == KEYMODIFIER_CONTROL) {
     342            0 :         keyCode += 262144;
     343              :     }
     344       167178 :     return keyCode;
     345              : }
     346              : 
     347              : 
     348              : /****************************************************************************/
        

Generated by: LCOV version 2.0-1