1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
#ifndef __DTK_APPLICATION_H__
#define __DTK_APPLICATION_H__
#include <++dfb.h>
#include <idirectfbwindow.h>
#include <directfb.h>
#include <list>
#include <map>
#include "event.h"
#include "window.h"
#include "widget.h"
namespace dtk
{
typedef std::map<DFBWindowID, window*> IdfbwMap;
class application : protected eventReceiver
{
friend class widget;
friend class button;
public:
application();
application(int argc, char **argv);
virtual ~application();
virtual int run();
virtual bool exit();
virtual IDirectFBWindow& createWindow (DFBWindowDescription &desc, bool isMain);
bool registerWindow(window &dtkwin, IDirectFBWindow& dfbwin);
bool unregisterWindow(IDirectFBWindow& dfbwin);
protected:
bool dispatch (DFBEvent& event);
bool processNoneEvent (DFBEvent &event);
bool processUsrEvent (DFBUserEvent &event);
bool processWinEvent (DFBWindowEvent &event);
bool processInEvent (DFBInputEvent &event);
bool processUnivEvent (DFBUniversalEvent &event);
IDirectFBWindow* getWindowById(const DFBWindowID& id);
IDirectFB idfb;
IDirectFBDisplayLayer ilayer;
IDirectFBSurface isurface;
IDirectFBEventBuffer ieventbuffer;
IDirectFBWindow *mainwin;
std::list<IDirectFBWindow*> Windows;
IdfbwMap dtkWindowMap;
bool done;
};
}
#endif |
Partager