added MouseWheel event support for Silverlight 3.0
[moon.git] / src / window.h
blobecfaf8230897b968b6fa805883942df8946573f3
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * window.h:
5 * Contact:
6 * Moonlight List (moonlight-list@lists.ximian.com)
8 * Copyright 2007-2008 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
14 #ifndef __MOON_WINDOW__
15 #define __MOON_WINDOW__
17 #include <gtk/gtk.h>
19 #define Visual _XxVisual
20 #define Region _XxRegion
21 #include <gdk/gdkx.h>
22 #undef Visual
23 #undef Region
25 class MoonWindow;
27 #include "rect.h"
28 #include "enums.h"
29 #include "color.h"
30 #include "deployment.h"
32 class Surface;
34 /* @Namespace=System.Windows */
35 class MoonWindow {
36 public:
37 MoonWindow (int w, int h) : width(w), height(h), surface(NULL), transparent(false) { }
39 virtual ~MoonWindow () { }
41 virtual void Resize (int width, int height) = 0;
43 virtual void SetCursor (MouseCursor cursor) = 0;
44 virtual void Invalidate (Rect r) = 0;
45 virtual void Invalidate () { Invalidate (Rect (0, 0, width, height)); }
46 virtual void ProcessUpdates () = 0;
48 virtual gboolean HandleEvent (XEvent *event) = 0;
50 virtual void Show () = 0;
51 virtual void Hide () = 0;
53 virtual void EnableEvents (bool first) = 0;
54 virtual void DisableEvents () = 0;
56 virtual void GrabFocus () = 0;
57 virtual bool HasFocus () = 0;
59 int GetWidth () { return width; }
60 int GetHeight () { return height; }
62 virtual void SetSurface (Surface* s) { surface = s; }
63 Surface *GetSurface () { return surface; }
65 /* @GenerateCBinding,GeneratePInvoke */
66 void SetTransparent (bool flag) { if (transparent != flag) Invalidate (); transparent = flag; }
68 virtual void SetBackgroundColor (Color *color) { Invalidate (); };
70 /* @GenerateCBinding,GeneratePInvoke */
71 bool GetTransparent () { return transparent; }
73 virtual bool IsFullScreen () = 0;
75 virtual GdkWindow* GetGdkWindow () = 0;
77 Deployment *GetDeployment () { return deployment; }
79 protected:
80 int width;
81 int height;
82 Surface *surface;
83 bool transparent;
84 Deployment *deployment;
87 #endif /* __MOON_WINDOW__ */