Add pointlog2svg utility for the thesis
[numtypysics.git] / Overlay.h
blob3da685eacbd3e3cdf22198a1ad3d15ef3a919893
1 /*
2 * This file is part of NumptyPhysics
3 * Copyright (C) 2008 Tim Edmonds
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 3 of the
8 * License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
17 #ifndef OVERLAY_H
18 #define OVERLAY_H
20 #include "Common.h"
21 #include "Ui.h"
23 class Canvas;
24 class GameControl;
27 class Overlay : public Layer
29 public:
32 class ListProvider
34 public:
35 virtual int countItems() =0;
36 virtual Canvas* provideItem( int i, Canvas* old ) =0;
37 virtual void releaseItem( Canvas* old ) =0;
38 virtual void onSelection( int i ) {};
39 virtual void onSelection( int i, int ix, int iy ) { onSelection(i); };
42 extern Overlay* createTextOverlay( GameControl& game, const std::string& text );
44 extern Overlay* createIconOverlay( GameControl& game, const char* file,
45 int x=100,int y=20,
46 bool dragging_allowed=true);
48 extern Overlay* createEditOverlay( GameControl& game );
50 extern Overlay* createNextLevelOverlay( GameControl& game, int winner );
52 extern Overlay* createListOverlay( GameControl& game,
53 ListProvider* provider,
54 int x=100, int y=20,
55 int w=200, int h=200 );
57 extern Overlay* createMenuOverlay( GameControl& game );
59 #endif //OVERLAY_H