shortcuts.cpp revision 6b15695578f07a3f72c4c9475c1a261a3021472a
#define __SP_SHORTCUTS_C__
/** \file
* Keyboard shortcut processing.
*/
/*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* MenTaLguY <mental@rydia.net>
* bulia byak <buliabyak@users.sf.net>
* Peter Moulder <pmoulder@mail.csse.monash.edu.au>
*
* Copyright (C) 2005 Monash University
* Copyright (C) 2005 MenTaLguY <mental@rydia.net>
*
* as published by the Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gdk/gdkkeysyms.h>
#include "shortcuts.h"
#include "verbs.h"
#include "xml/node-iterators.h"
using namespace Inkscape;
static void sp_shortcut_set(unsigned int const shortcut, Inkscape::Verb *const verb, bool const is_primary);
/* Returns true if action was performed */
bool
{
if (verb) {
if (action) {
return true;
}
}
return false;
}
extern char const shortcuts_default_xml[];
static void
{
XML::Document *shortcuts=sp_repr_read_mem(shortcuts_default_xml, strlen(shortcuts_default_xml), NULL);
if (shortcuts) {
} else {
g_error("Unable to parse default shortcuts");
}
}
bool is_primary;
is_primary = true;
is_primary = false;
} else {
continue;
}
if (!verb_name) {
g_warning("Missing verb name for shortcut");
continue;
}
if (!keyval_name) {
continue;
}
if (keyval == GDK_VoidSymbol) {
continue;
}
if (modifiers_string) {
while (*iter) {
} else {
}
}
}
}
}
/**
* Adds a keyboard shortcut for the given verb.
* (Removes any existing binding for the given shortcut, including appropriately
* adjusting sp_shortcut_get_primary if necessary.)
*
* \param is_primary True iff this is the shortcut to be written in menu items or buttons.
*
* \post sp_shortcut_get_verb(shortcut) == verb.
* \post !is_primary or sp_shortcut_get_primary(verb) == shortcut.
*/
static void
{
if (!verbs) sp_shortcut_init();
Inkscape::Verb *old_verb = (Inkscape::Verb *)(g_hash_table_lookup(verbs, GINT_TO_POINTER(shortcut)));
/* Maintain the invariant that sp_shortcut_get_primary(v) returns either 0 or a valid shortcut for v. */
unsigned int const old_primary = (unsigned int)GPOINTER_TO_INT(g_hash_table_lookup(primary_shortcuts, (gpointer)old_verb));
if (old_primary == shortcut) {
}
}
if (is_primary) {
}
}
sp_shortcut_get_verb(unsigned int shortcut)
{
if (!verbs) sp_shortcut_init();
}
unsigned int
{
if (!primary_shortcuts) sp_shortcut_init();
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :