SoGtk  0.1.0
Coin3D GUI toolkit binding
All Classes Functions Variables Typedefs Enumerations Enumerator Modules Pages
SoGtkKeyboard.h
1#ifndef SOGTK_KEYBOARD_H
2#define SOGTK_KEYBOARD_H
3
4//
5
6/**************************************************************************\
7 * Copyright (c) Kongsberg Oil & Gas Technologies AS
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are
12 * met:
13 *
14 * Redistributions of source code must retain the above copyright notice,
15 * this list of conditions and the following disclaimer.
16 *
17 * Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 *
21 * Neither the name of the copyright holder nor the names of its
22 * contributors may be used to endorse or promote products derived from
23 * this software without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36\**************************************************************************/
37
38#include <Inventor/Gtk/devices/SoGtkDevice.h>
39
40class SoKeyboardEvent;
41
42// *************************************************************************
43
44#define SO_GTK_ALL_KEYBOARD_EVENTS SoGtkKeyboard::ALL
45
46class SOGTK_DLL_API SoGtkKeyboard : public SoGtkDevice {
47 SOGTK_OBJECT_HEADER(SoGtkKeyboard, SoGtkDevice);
48
49public:
50 enum Events {
51 KEY_PRESS = 0x01,
52 KEY_RELEASE = 0x02,
53 ALL_EVENTS = KEY_PRESS | KEY_RELEASE
54 };
55
56 SoGtkKeyboard(int eventmask = ALL_EVENTS);
57 virtual ~SoGtkKeyboard(void);
58
59 virtual void enable(GtkWidget* widget, SoGtkEventHandler * handler, void * closure);
60 virtual void disable(GtkWidget* widget, SoGtkEventHandler * handler, void * closure);
61
62 virtual const SoEvent * translateEvent(GdkEvent* event);
63
64private:
65 class SoGtkKeyboardP * pimpl;
66 friend class SoGtkKeyboardP;
67 friend class SoGuiKeyboardP;
68};
69
70// *************************************************************************
71
72#endif // ! SOGTK_KEYBOARD_H
The SoGtkDevice class is the base class for the translation devices.
Definition SoGtkDevice.h:77
virtual void disable(GtkWidget *w, SoGtkEventHandler *handler, void *closure)=0
virtual const SoEvent * translateEvent(GdkEvent *event)=0
virtual void enable(GtkWidget *w, SoGtkEventHandler *handler, void *closure)=0
The SoGtkKeyboard class is the keyboard input device abstraction.
Definition SoGtkKeyboard.h:46
Events
Definition SoGtkKeyboard.h:50