event-utils.h revision bd80360f39d70d4a2622064a4fa0f29dd829d1ed
/** @file
* Collection of shorthands to deal with GDK events.
*/
/* Authors:
* Krzysztof KosiĆski <tweenk.pl@gmail.com>
*
* Copyright (C) 2009 Authors
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef SEEN_UI_TOOL_EVENT_UTILS_H
#define SEEN_UI_TOOL_EVENT_UTILS_H
struct SPCanvas;
inline bool state_held_shift(unsigned state) {
return state & GDK_SHIFT_MASK;
}
inline bool state_held_control(unsigned state) {
return state & GDK_CONTROL_MASK;
}
inline bool state_held_alt(unsigned state) {
return state & GDK_MOD1_MASK;
}
inline bool state_held_only_shift(unsigned state) {
}
inline bool state_held_only_control(unsigned state) {
}
inline bool state_held_only_alt(unsigned state) {
}
inline bool state_held_any_modifiers(unsigned state) {
}
inline bool state_held_no_modifiers(unsigned state) {
return !state_held_any_modifiers(state);
}
inline bool state_held_button(unsigned state) {
}
/** Checks whether Shift was held when the event was generated. */
inline bool held_shift(E const &event) {
}
/** Checks whether Control was held when the event was generated. */
inline bool held_control(E const &event) {
}
/** Checks whether Alt was held when the event was generated. */
}
/** True if from the set of Ctrl, Shift and Alt only Ctrl was held when the event
* was generated. */
inline bool held_only_control(E const &event) {
}
/** True if from the set of Ctrl, Shift and Alt only Shift was held when the event
* was generated. */
inline bool held_only_shift(E const &event) {
}
/** True if from the set of Ctrl, Shift and Alt only Alt was held when the event
* was generated. */
inline bool held_only_alt(E const &event) {
}
inline bool held_no_modifiers(E const &event) {
}
inline bool held_any_modifiers(E const &event) {
}
}
/** Use like this:
* @code if (held_button<2>(event->motion)) { ... @endcode */
inline bool held_button(E const &event) {
}
} // namespace UI
} // namespace Inkscape
#endif
/*
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 :