00001 /*************************************************************************** 00002 kdeglwidget.h - description 00003 ------------------- 00004 begin : Tue Jul 16 2002 00005 copyright : (C) 2002 by Christophe Teyssier 00006 email : chris@teyssier.org 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef KDEGLWIDGET_H 00019 #define KDEGLWIDGET_H 00020 00021 #include <qgl.h> 00022 #include <qevent.h> 00023 #include <kaction.h> 00024 00025 #include "celestiacore.h" 00026 #include "celengine/simulation.h" 00027 #include <celengine/starbrowser.h> 00028 #include <string> 00029 #include <vector> 00030 00035 class KdeGlWidget : public QGLWidget, public CelestiaCore::CursorHandler { 00036 Q_OBJECT 00037 00038 public: 00039 KdeGlWidget( QWidget* parent, const char* name, CelestiaCore* core); 00040 ~KdeGlWidget(); 00041 00042 void setCursorShape(CelestiaCore::CursorShape); 00043 CelestiaCore::CursorShape getCursorShape() const; 00044 00045 protected: 00046 00047 void initializeGL(); 00048 void paintGL(); 00049 void resizeGL( int w, int h ); 00050 virtual void mouseMoveEvent( QMouseEvent* m ); 00051 virtual void mousePressEvent( QMouseEvent* m ); 00052 virtual void mouseReleaseEvent( QMouseEvent* m ); 00053 virtual void wheelEvent( QWheelEvent* w ); 00054 virtual void keyPressEvent( QKeyEvent* e ); 00055 virtual void keyReleaseEvent( QKeyEvent* e ); 00056 bool handleSpecialKey(QKeyEvent* e, bool down); 00057 00058 private: 00059 00060 CelestiaCore* appCore; 00061 Renderer* appRenderer; 00062 Simulation* appSim; 00063 int lastX; 00064 int lastY; 00065 CelestiaCore::CursorShape currentCursor; 00066 00067 KActionCollection* actionColl; 00068 00069 }; 00070 00071 #endif
1.4.1