Code

No more NRMatrix or NRPoint.
[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 getLiveButtons() const = 0;
31 protected:
32     InputDevice();
33     virtual ~InputDevice();
35 private:
36     InputDevice(InputDevice const &); // no copy
37     void operator=(InputDevice const &); // no assign
38 };
40 class DeviceManager : public Glib::Object {
41 public:
42     static DeviceManager& getManager();
44     virtual std::list<InputDevice const *> getDevices() = 0;
45     virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalDeviceChanged() = 0;
46     virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalButtonsChanged() = 0;
47     virtual sigc::signal<void, const Glib::RefPtr<InputDevice>& > signalLinkChanged() = 0;
49     virtual void addButton(Glib::ustring const & id, gint button) = 0;
50     virtual void setLinkedTo(Glib::ustring const & id, Glib::ustring const& link) = 0;
52 protected:
53     DeviceManager();
54     virtual ~DeviceManager();
56 private:
57     DeviceManager(DeviceManager const &); // no copy
58     void operator=(DeviceManager const &); // no assign
59 };
63 } // namespace Inkscape
65 #endif // SEEN_INKSCAPE_DEVICE_MANAGER_H
67 /*
68   Local Variables:
69   mode:c++
70   c-file-style:"stroustrup"
71   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
72   indent-tabs-mode:nil
73   fill-column:99
74   End:
75 */
76 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :