Code

Tracking of live axes
[inkscape.git] / src / device-manager.h
1 /*
2  * Inkscape::DeviceManager - a view of input devices available.
3  *
4  * Copyright 2006  Jon A. Cruz  <jon@joncruz.org>
5  *
6  * Released under GNU GPL, read the file 'COPYING' for more information
7  */
9 #ifndef SEEN_INKSCAPE_DEVICE_MANAGER_H
10 #define SEEN_INKSCAPE_DEVICE_MANAGER_H
13 #include <list>
14 #include <glibmm/ustring.h>
15 #include <gdkmm/device.h>
17 namespace Inkscape {
19 class InputDevice : public Glib::Object {
20 public:
21     virtual Glib::ustring getId() const = 0;
22     virtual Glib::ustring getName() const = 0;
23     virtual Gdk::InputSource getSource() const = 0;
24     virtual Gdk::InputMode getMode() const = 0;
25     virtual bool hasCursor() const = 0;
26     virtual gint getNumAxes() const = 0;
27     virtual gint getNumKeys() const = 0;
28     virtual Glib::ustring getLink() const = 0;
29     virtual gint getLiveAxes() const = 0;
30     virtual gint getLiveButtons() const = 0;
32 protected:
33     InputDevice();
34     virtual ~InputDevice();
36 private:
37     InputDevice(InputDevice const &); // no copy
38     void operator=(InputDevice const &); // no assign
39 };
41 class DeviceManager : public Glib::Object {
42 public:
43     static DeviceManager& getManager();
45     virtual std::list<InputDevice const *> getDevices() = 0;
46     virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalDeviceChanged() = 0;
47     virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalAxesChanged() = 0;
48     virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalButtonsChanged() = 0;
49     virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalLinkChanged() = 0;
51     virtual void addAxis(Glib::ustring const & id, gint axis) = 0;
52     virtual void addButton(Glib::ustring const & id, gint button) = 0;
53     virtual void setLinkedTo(Glib::ustring const & id, Glib::ustring const& link) = 0;
55 protected:
56     DeviceManager();
57     virtual ~DeviceManager();
59 private:
60     DeviceManager(DeviceManager const &); // no copy
61     void operator=(DeviceManager const &); // no assign
62 };
66 } // namespace Inkscape
68 #endif // SEEN_INKSCAPE_DEVICE_MANAGER_H
70 /*
71   Local Variables:
72   mode:c++
73   c-file-style:"stroustrup"
74   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
75   indent-tabs-mode:nil
76   fill-column:99
77   End:
78 */
79 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :