source: trunk/deushax/gtk/glmapview.h @ 612

Last change on this file since 612 was 220, checked in by sam, 12 years ago

Split test-map into deus-hax and monsterz.

  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1//
2// Deus Hax (working title)
3// Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
4//
5
6#if !defined __DH_GLMAPVIEW_H__
7#define __DH_GLMAPVIEW_H__
8
9#include "mapviewer.h"
10
11#include <gtk/gtk.h>
12
13class GlMapView
14{
15public:
16    GlMapView(GtkBuilder *builder);
17    void LoadMap(char const *path);
18    void CloseMap();
19
20private:
21    /* Private methods */
22    gboolean IdleTick();
23    gboolean Setup();
24    gboolean Shutdown();
25    gboolean Draw(GdkEventExpose *e);
26    void Scroll(double dx, double dy);
27    void UpdateAdjustments();
28    gboolean MouseButton(GdkEventButton *e);
29    gboolean MouseMotion(GdkEventMotion *e);
30    gboolean KeyPress(GdkEventKey *e);
31
32    /* Private signal slots */
33    static gboolean IdleTickSignal(GlMapView *that);
34    static gboolean SetupSignal(GtkWidget *w, GlMapView *that);
35    static gboolean ShutdownSignal(GlMapView *that);
36    static gboolean DrawSignal(GtkWidget *w, GdkEventExpose *e,
37                               GlMapView *that);
38    static gboolean ReshapeSignal(GtkWidget *w, GdkEventConfigure *e,
39                                  GlMapView *that);
40    static gboolean MouseButtonSignal(GtkWidget *w, GdkEventButton *e,
41                                      GlMapView *that);
42    static gboolean MouseMotionSignal(GtkWidget *w, GdkEventMotion *e,
43                                      GlMapView *that);
44    static gboolean KeyPressSignal(GtkWidget *w, GdkEventKey *e,
45                                   GlMapView *that);
46
47private:
48    GtkAdjustment *hadj, *vadj;
49    GtkWidget *glarea;
50    gboolean ticking, panning;
51
52    MapViewer *mapviewer;
53    double xpan, ypan;
54};
55
56#endif // __DH_GLMAPVIEW_H__
57
Note: See TracBrowser for help on using the repository browser.