![]() |
http://www.sim.no http://www.coin3d.org |
00001 #ifndef SOQT_DEVICE_H 00002 #define SOQT_DEVICE_H 00003 00004 // src/Inventor/Qt/devices/SoQtDevice.h. Generated from SoGuiDevice.h.in by configure. 00005 00006 /**************************************************************************\ 00007 * 00008 * This file is part of the Coin 3D visualization library. 00009 * Copyright (C) by Kongsberg Oil & Gas Technologies. 00010 * 00011 * This library is free software; you can redistribute it and/or 00012 * modify it under the terms of the GNU General Public License 00013 * ("GPL") version 2 as published by the Free Software Foundation. 00014 * See the file LICENSE.GPL at the root directory of this source 00015 * distribution for additional information about the GNU GPL. 00016 * 00017 * For using Coin with software that can not be combined with the GNU 00018 * GPL, and for taking advantage of the additional benefits of our 00019 * support services, please contact Kongsberg Oil & Gas Technologies 00020 * about acquiring a Coin Professional Edition License. 00021 * 00022 * See http://www.coin3d.org/ for more information. 00023 * 00024 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY. 00025 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org 00026 * 00027 \**************************************************************************/ 00028 00029 // ************************************************************************* 00030 // 00031 // Toolkit-specific typedef and include(s). Put these before any Coin 00032 // and/or SoQt includes, in case there are any dependency bugs in 00033 // the underlying native toolkit set of include files versus the 00034 // compiler environment's include files. 00035 00036 #include <Inventor/Qt/SoQtBasic.h> // Contains __COIN_SOQT__ define. 00037 00038 #ifdef __COIN_SOQT__ 00039 #include <qevent.h> 00040 typedef void SoQtEventHandler(QWidget *, void *, QEvent *, bool *); 00041 #endif // __COIN_SOQT__ 00042 #ifdef __COIN_SOXT__ 00043 #include <X11/Intrinsic.h> 00044 typedef void SoQtEventHandler(QWidget *, XtPointer, XEvent *, Boolean *); 00045 #endif // __COIN_SOXT__ 00046 #ifdef __COIN_SOGTK__ 00047 #include <gtk/gtk.h> 00048 typedef gint SoQtEventHandler(QWidget *, QEvent *, gpointer); 00049 #endif // __COIN_SOGTK__ 00050 #ifdef __COIN_SOWIN__ 00051 #include <windows.h> 00052 typedef LRESULT SoQtEventHandler(QWidget *, UINT, WPARAM, LPARAM); 00053 #endif // __COIN_SOWIN__ 00054 00055 // ************************************************************************* 00056 00057 #include <Inventor/SbLinear.h> 00058 #include <Inventor/Qt/SoQtObject.h> 00059 00060 class SoEvent; 00061 00062 // ************************************************************************* 00063 00064 class SOQT_DLL_API SoQtDevice : public SoQtObject { 00065 SOQT_OBJECT_ABSTRACT_HEADER(SoQtDevice, SoQtObject); 00066 00067 public: 00068 virtual ~SoQtDevice(); 00069 00070 virtual void enable(QWidget * w, SoQtEventHandler * handler, void * closure) = 0; 00071 virtual void disable(QWidget * w, SoQtEventHandler * handler, void * closure) = 0; 00072 00073 virtual const SoEvent * translateEvent(QEvent * event) = 0; 00074 00075 void setWindowSize(const SbVec2s size); 00076 SbVec2s getWindowSize(void) const; 00077 00078 static void initClasses(void); 00079 00080 protected: 00081 SoQtDevice(void); 00082 00083 void setEventPosition(SoEvent * event, int x, int y) const; 00084 static SbVec2s getLastEventPosition(void); 00085 00086 void addEventHandler(QWidget *, SoQtEventHandler *, void *); 00087 void removeEventHandler(QWidget *, SoQtEventHandler *, void *); 00088 void invokeHandlers(QEvent * event); 00089 00090 private: 00091 class SoQtDeviceP * pimpl; 00092 friend class SoQtDeviceP; 00093 }; 00094 00095 // ************************************************************************* 00096 00097 #endif // !SOQT_DEVICE_H
Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated on Sun Dec 11 2011 10:38:42 for SoQt by Doxygen 1.7.6.1.