fbdbg  3.0
FreeBASIC Debugger
shortcuts.bas File Reference

Code for shortcuts dialog. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ACCELL_FILE
 The file name for the shortcut keylist. More...
 

Functions

SUB_CDECL populateShortcuts (BYVAL_AS_gpointer Act, BYVAL_AS_gpointer Store)
 Populate the list of shortcuts (GFunc callback) More...
 
FUNCTION_CDECL_AS_gboolean evaluateShortcuts (BYVAL_AS_GtkTreeModel_PTR Tree, BYVAL_AS_GtkTreePath_PTR Path, BYVAL_AS_GtkTreeIter_PTR Iter, BYVAL_AS_gpointer user_data)
 Evaluate the list of shortcuts (GFunc callback) More...
 
SUB ShortcutsForm (BYVAL_AS_gint Mo=1)
 Populate or evaluate the shortcuts dialog. More...
 
SUB_CDECL_ALIAS act_Shortcut (BYVAL_AS_GtkAction_PTR Action, BYVAL_AS_gpointer Dialog)
 Run the shortcuts dialog (GtkAction id="action024") More...
 
SUB_CDECL_ALIAS on_accel_cleared (BYVAL_AS_GtkCellRendererAccel_PTR Accel, BYVAL_AS_gchar_PTR PathString, BYVAL_AS_gpointer Store)
 Signal handler for clearing a GtkCellRendererAccel (id="cellrendereraccel601") More...
 
SUB_CDECL_ALIAS on_accel_edited (BYVAL_AS_GtkCellRendererAccel_PTR Accel, BYVAL_AS_gchar_PTR PathString, BYVAL_AS_guint AccelKey, BYVAL_AS_GdkModifierType AccelMods, BYVAL_AS_guint HardwareKeycode, BYVAL_AS_gpointer Store)
 Signal handler for editing a GtkCellRendererAccel (id="cellrendereraccel601") More...
 

Detailed Description

Code for shortcuts dialog.

This file contains the code to handle the shortcut key list and edit dialog and some auxiliary code. Shortcuts are stored in file dat/accelerators.rc*.

The actions in file fbdbg.ui are grouped after their appereance

  • action0xx = actions that proxies multiple widgets
  • action1xx = actions in menu10 = ProcVar
  • action2xx = actions in menu20 = Procs
  • action3xx = actions in menu30 = Watched
  • action4xx = actions in menu40 = Source + toolbar
  • action5xx = actions in menu50 = Threads
  • action9xx = actions in menu90 = tools
Todo:
Decide if we store shortcuts in the ini file or in a separate one (as is currently in dat/accelerators.rc).
Since
3.0

Definition in file shortcuts.bas.

Macro Definition Documentation

#define ACCELL_FILE
Value:
/* "dat/accelerators.rc"
*/

The file name for the shortcut keylist.

Definition at line 26 of file shortcuts.bas.

Function Documentation

SUB_CDECL_ALIAS act_Shortcut ( BYVAL_AS_GtkAction_PTR  Action,
BYVAL_AS_gpointer  Dialog 
)

Run the shortcuts dialog (GtkAction id="action024")

Parameters
ActionThe GtkAction that triggered the signal
DialogThe GtkWidget PTR of the dialog window

This signal handler shows the settings dialog in modal mode. Depending on the user action it either cancels all changes or reads the new data.

Todo:
Decide if we need a help button.

Definition at line 138 of file shortcuts.bas.

Here is the call graph for this function:

FUNCTION_CDECL_AS_gboolean evaluateShortcuts ( BYVAL_AS_GtkTreeModel_PTR  Tree,
BYVAL_AS_GtkTreePath_PTR  Path,
BYVAL_AS_GtkTreeIter_PTR  Iter,
BYVAL_AS_gpointer  user_data 
)

Evaluate the list of shortcuts (GFunc callback)

Parameters
TreeThe tree model to get the data
PathThe path (unused)
IterThe tree model iter where to read from
user_dataunused

The callback gets called by gtk_tree_model_foreach() on all members of the list store. It gets a current shortcut setting and changes its entry in the GtkAccelMap.

Definition at line 72 of file shortcuts.bas.

SUB_CDECL_ALIAS on_accel_cleared ( BYVAL_AS_GtkCellRendererAccel_PTR  Accel,
BYVAL_AS_gchar_PTR  PathString,
BYVAL_AS_gpointer  Store 
)

Signal handler for clearing a GtkCellRendererAccel (id="cellrendereraccel601")

Parameters
AccelThe widget that triggers the signal (unused)
PathStringThe path in the GtkTreeModel
StoreThe GtkListStore where to change the data (user_data)

This signal handler gets called when the user cleared a keyboard shortcut in the shortcuts dialog (by pressing backspace key). It up-dates the data in the related list store.

Definition at line 167 of file shortcuts.bas.

SUB_CDECL_ALIAS on_accel_edited ( BYVAL_AS_GtkCellRendererAccel_PTR  Accel,
BYVAL_AS_gchar_PTR  PathString,
BYVAL_AS_guint  AccelKey,
BYVAL_AS_GdkModifierType  AccelMods,
BYVAL_AS_guint  HardwareKeycode,
BYVAL_AS_gpointer  Store 
)

Signal handler for editing a GtkCellRendererAccel (id="cellrendereraccel601")

Parameters
AccelThe widget that triggers the signal (unused)
PathStringThe path in the GtkTreeModel
AccelKeyThe key number of the shortcut
AccelModsThe modifier mask (GdkModifierType)
HardwareKeycodeA hardware keycode (unused)
StoreThe GtkListStore where to change the data (user_data)

This signal handler gets called when the user edited a keyboard shortcut in the shortcuts dialog. It checks for double-tees and up-dates the data in the related list store.

Todo:
Decide if warning (no modifiers) should be used

Definition at line 198 of file shortcuts.bas.

SUB_CDECL populateShortcuts ( BYVAL_AS_gpointer  Act,
BYVAL_AS_gpointer  Store 
)

Populate the list of shortcuts (GFunc callback)

Parameters
ActThe GtkAction to handle
StoreThe GtkListStore to use

The callback gets called by g_list_foreach() on all GtkActions in 'actiongroup1'. It gets the shortcut and reads the label and the tooltip to store that context in the list. A hidden column (4) is used to store the accell path for easy evaluation.

Definition at line 39 of file shortcuts.bas.

SUB ShortcutsForm ( BYVAL_AS_gint  Mo = 1)

Populate or evaluate the shortcuts dialog.

Parameters
MoThe modus (0 = read, 1 = write)

Handle the data in the shortcuts dialog. The SUB either

  • reads the dialog data and sets the parameter variables for the ini file, or
  • sets the dialog to ini file parameter variables

When called first, the widgets get searched in the GUI description file.

Definition at line 104 of file shortcuts.bas.

Here is the caller graph for this function: