Source: ksirk/decoratedgameframe.h
|
|
|
|
/***************************************************************************
decoratedgameframe.h - description
-------------------
begin : Thu Jul 19 2001
copyright : (C) 2001 by Gaël de Chalendar
email : Gael.de.Chalendar@libertysurf.fr
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#define KDE_NO_COMPAT
#ifndef DECORATEDGAMEFRAME_H
#define DECORATEDGAMEFRAME_H
#include "ksirkresources.h"
#include
#include
#include
/**
* The DecoratedGameFrame class is the central widget of the application where
* all the sprites are displayed. It is linked to its parent widget (the main window)
* and to its logical model, the graphics pool which is a QCanvas
*/
class DecoratedGameFrame: public QCanvasView
{
Q_OBJECT
public:
/**
* Creates the frame, its timer and set some parameters
*/
DecoratedGameFrame(QWidget* parent, const char *nom, QCanvas* clientWnd);
/**
* Destroy the frame : stops and deletes the timer
*/
~DecoratedGameFrame();
/**
* Start the timer. Quit if error
*/
void initTimer();
/**
* Halt the timer. Quit if error
*/
void haltTimer();
signals:
/**
* These signals are connected to slots of the window. They are emitted
* for the mouse buttons events with corrected coordinates
*/
void evenementLButtonDown(const QPoint &);
void evenementLButtonUp(const QPoint &);
void evenementRButtonDown(const QPoint &);
protected:
/**
* The timer that will cause the updates of the display and so allow for
* movements
*/
QTimer *timer;
/**
* These methods override the inherited ones by converting the coordinates
* from screen ones to game ones. After this conversion, they emit the
* adequate signal
*/
virtual void contentsMousePressEvent ( QMouseEvent * );
virtual void contentsMouseReleaseEvent ( QMouseEvent * );
};
#endif // DECORATEDGAMEFRAME_H
Generated by: gael on noirdes.limsi.u-psud.fr on Fri Jan 3 17:03:38 2003, using kdoc 2.0a53. |