![]() |
http://www.coin3d.org/ http://www.kongsberg.com/kogt/ |
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 * Copyright (c) Kongsberg Oil & Gas Technologies AS 00008 * All rights reserved. 00009 * 00010 * Redistribution and use in source and binary forms, with or without 00011 * modification, are permitted provided that the following conditions are 00012 * met: 00013 * 00014 * Redistributions of source code must retain the above copyright notice, 00015 * this list of conditions and the following disclaimer. 00016 * 00017 * Redistributions in binary form must reproduce the above copyright 00018 * notice, this list of conditions and the following disclaimer in the 00019 * documentation and/or other materials provided with the distribution. 00020 * 00021 * Neither the name of the copyright holder nor the names of its 00022 * contributors may be used to endorse or promote products derived from 00023 * this software without specific prior written permission. 00024 * 00025 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00026 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00027 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00028 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00029 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00030 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00031 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00032 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00033 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00034 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00035 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00036 \**************************************************************************/ 00037 00038 // ************************************************************************* 00039 // 00040 // Toolkit-specific typedef and include(s). Put these before any Coin 00041 // and/or SoQt includes, in case there are any dependency bugs in 00042 // the underlying native toolkit set of include files versus the 00043 // compiler environment's include files. 00044 00045 #include <Inventor/Qt/SoQtBasic.h> // Contains __COIN_SOQT__ define. 00046 00047 #ifdef __COIN_SOQT__ 00048 #include <qevent.h> 00049 typedef void SoQtEventHandler(QWidget *, void *, QEvent *, bool *); 00050 #endif // __COIN_SOQT__ 00051 #ifdef __COIN_SOXT__ 00052 #include <X11/Intrinsic.h> 00053 typedef void SoQtEventHandler(QWidget *, XtPointer, XEvent *, Boolean *); 00054 #endif // __COIN_SOXT__ 00055 #ifdef __COIN_SOGTK__ 00056 #include <gtk/gtk.h> 00057 typedef gint SoQtEventHandler(QWidget *, QEvent *, gpointer); 00058 #endif // __COIN_SOGTK__ 00059 #ifdef __COIN_SOWIN__ 00060 #include <windows.h> 00061 typedef LRESULT SoQtEventHandler(QWidget *, UINT, WPARAM, LPARAM); 00062 #endif // __COIN_SOWIN__ 00063 00064 // ************************************************************************* 00065 00066 #include <Inventor/SbLinear.h> 00067 #include <Inventor/Qt/SoQtObject.h> 00068 00069 class SoEvent; 00070 00071 // ************************************************************************* 00072 00073 class SOQT_DLL_API SoQtDevice : public SoQtObject { 00074 SOQT_OBJECT_ABSTRACT_HEADER(SoQtDevice, SoQtObject); 00075 00076 public: 00077 virtual ~SoQtDevice(); 00078 00079 virtual void enable(QWidget * w, SoQtEventHandler * handler, void * closure) = 0; 00080 virtual void disable(QWidget * w, SoQtEventHandler * handler, void * closure) = 0; 00081 00082 virtual const SoEvent * translateEvent(QEvent * event) = 0; 00083 00084 void setWindowSize(const SbVec2s size); 00085 SbVec2s getWindowSize(void) const; 00086 00087 static void initClasses(void); 00088 00089 protected: 00090 SoQtDevice(void); 00091 00092 void setEventPosition(SoEvent * event, int x, int y) const; 00093 static SbVec2s getLastEventPosition(void); 00094 00095 void addEventHandler(QWidget *, SoQtEventHandler *, void *); 00096 void removeEventHandler(QWidget *, SoQtEventHandler *, void *); 00097 void invokeHandlers(QEvent * event); 00098 00099 private: 00100 class SoQtDeviceP * pimpl; 00101 friend class SoQtDeviceP; 00102 }; 00103 00104 // ************************************************************************* 00105 00106 #endif // !SOQT_DEVICE_H
Copyright © by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated on Wed Mar 2 2016 19:55:25 for SoQt by Doxygen 1.7.3.