Coin Logo http://www.sim.no
http://www.coin3d.org

SoQtDevice.h
1 #ifndef SOQT_DEVICE_H
2 #define SOQT_DEVICE_H
3 
4 // src/Inventor/Qt/devices/SoQtDevice.h. Generated from SoGuiDevice.h.in by configure.
5 
6 /**************************************************************************\
7  *
8  * This file is part of the Coin 3D visualization library.
9  * Copyright (C) by Kongsberg Oil & Gas Technologies.
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * ("GPL") version 2 as published by the Free Software Foundation.
14  * See the file LICENSE.GPL at the root directory of this source
15  * distribution for additional information about the GNU GPL.
16  *
17  * For using Coin with software that can not be combined with the GNU
18  * GPL, and for taking advantage of the additional benefits of our
19  * support services, please contact Kongsberg Oil & Gas Technologies
20  * about acquiring a Coin Professional Edition License.
21  *
22  * See http://www.coin3d.org/ for more information.
23  *
24  * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
25  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
26  *
27 \**************************************************************************/
28 
29 // *************************************************************************
30 //
31 // Toolkit-specific typedef and include(s). Put these before any Coin
32 // and/or SoQt includes, in case there are any dependency bugs in
33 // the underlying native toolkit set of include files versus the
34 // compiler environment's include files.
35 
36 #include <Inventor/Qt/SoQtBasic.h> // Contains __COIN_SOQT__ define.
37 
38 #ifdef __COIN_SOQT__
39 #include <qevent.h>
40 typedef void SoQtEventHandler(QWidget *, void *, QEvent *, bool *);
41 #endif // __COIN_SOQT__
42 #ifdef __COIN_SOXT__
43 #include <X11/Intrinsic.h>
44 typedef void SoQtEventHandler(QWidget *, XtPointer, XEvent *, Boolean *);
45 #endif // __COIN_SOXT__
46 #ifdef __COIN_SOGTK__
47 #include <gtk/gtk.h>
48 typedef gint SoQtEventHandler(QWidget *, QEvent *, gpointer);
49 #endif // __COIN_SOGTK__
50 #ifdef __COIN_SOWIN__
51 #include <windows.h>
52 typedef LRESULT SoQtEventHandler(QWidget *, UINT, WPARAM, LPARAM);
53 #endif // __COIN_SOWIN__
54 
55 // *************************************************************************
56 
57 #include <Inventor/SbLinear.h>
58 #include <Inventor/Qt/SoQtObject.h>
59 
60 class SoEvent;
61 
62 // *************************************************************************
63 
64 class SOQT_DLL_API SoQtDevice : public SoQtObject {
65  SOQT_OBJECT_ABSTRACT_HEADER(SoQtDevice, SoQtObject);
66 
67 public:
68  virtual ~SoQtDevice();
69 
70  virtual void enable(QWidget * w, SoQtEventHandler * handler, void * closure) = 0;
71  virtual void disable(QWidget * w, SoQtEventHandler * handler, void * closure) = 0;
72 
73  virtual const SoEvent * translateEvent(QEvent * event) = 0;
74 
75  void setWindowSize(const SbVec2s size);
76  SbVec2s getWindowSize(void) const;
77 
78  static void initClasses(void);
79 
80 protected:
81  SoQtDevice(void);
82 
83  void setEventPosition(SoEvent * event, int x, int y) const;
84  static SbVec2s getLastEventPosition(void);
85 
86  void addEventHandler(QWidget *, SoQtEventHandler *, void *);
87  void removeEventHandler(QWidget *, SoQtEventHandler *, void *);
88  void invokeHandlers(QEvent * event);
89 
90 private:
91  class SoQtDeviceP * pimpl;
92  friend class SoQtDeviceP;
93 };
94 
95 // *************************************************************************
96 
97 #endif // !SOQT_DEVICE_H

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Fri Aug 3 2012 for SoQt by Doxygen 1.8.1.1.