FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
PluginWindowX11.h
1 /**********************************************************\
2 Original Author: Richard Bateman (taxilian)
3 
4 Created: Nov 24, 2009
5 License: Dual license model; choose one of two:
6  New BSD License
7  http://www.opensource.org/licenses/bsd-license.php
8  - or -
9  GNU Lesser General Public License, version 2.1
10  http://www.gnu.org/licenses/lgpl-2.1.html
11 
12 Copyright 2009 Richard Bateman, Firebreath development team
13 \**********************************************************/
14 
15 #ifndef H_PLUGINWINDOWX11
16 #define H_PLUGINWINDOWX11
17 
18 #include "global/config.h"
19 
20 #if FB_GUI_DISABLED != 1
21 
22 #include <gtk/gtk.h>
23 
24 #endif
25 
26 #include "PluginWindow.h"
27 #include "WindowContextX11.h"
28 
29 #include <map>
30 
31 namespace FB {
32 
39  {
40  public:
41  PluginWindowX11(const WindowContextX11&);
42  virtual ~PluginWindowX11();
43 
44 // int16_t HandleEvent(EventRecord* evt);
45  void setWindowPosition(int32_t x, int32_t y, uint32_t w, uint32_t h);
46  void getWindowPosition(int32_t &x, int32_t &y, uint32_t &w, uint32_t &h) const;
47  FB::Rect getWindowPosition() const;
48  void setWindowClipping(int32_t t, int32_t l, int32_t b, int32_t r);
49  void getWindowClipping(int32_t &t, int32_t &l, int32_t &b, int32_t &r) const;
50  FB::Rect getWindowClipping() const;
51  virtual void InvalidateWindow() const;
52  uint32_t getWindowWidth() const { return m_width; }
53  uint32_t getWindowHeight() const { return m_height; }
54 
55 #if FB_GUI_DISABLED != 1
56  public:
57  bool hasKeyboardFocus() const { return m_focus; }
58  GdkNativeWindow getWindow();
59  GdkWindow* getWidgetWindow() const;
60  GtkWidget* getWidget() { return m_canvas; }
61  void setBrowserWindow(GdkNativeWindow win) { m_browserWindow = win; }
62  GdkNativeWindow getBrowserWindow() { return m_browserWindow; }
63  static gboolean _EventCallback(GtkWidget *widget, GdkEvent *event, gpointer user_data);
64 
65  // You probably won't ever want to call this yourself. Call getWindow instead.
66  GdkNativeWindow getTopLevelWindow() { return m_window; }
67  protected:
68  gboolean EventCallback(GtkWidget *widget, GdkEvent *event);
69 
70  GdkNativeWindow m_window;
71  GdkNativeWindow m_browserWindow;
72  GtkWidget *m_container;
73  GtkWidget *m_canvas;
74  bool m_focus;
75 
76  static gboolean idleInvalidate(gpointer win);
77 #endif
78 
79  int32_t m_x;
80  int32_t m_y;
81  uint32_t m_width;
82  uint32_t m_height;
83 
84  int32_t m_clipLeft;
85  int32_t m_clipRight;
86  int32_t m_clipTop;
87  int32_t m_clipBottom;
88 
89  int m_handler_id;
90  };
91 
92 };
93 
94 #endif // H_PLUGINWINDOWX11
95 
FB::Rect getWindowPosition() const
Gets the position rect of the window.
uint32_t getWindowWidth() const
Gets the width of the window.
X11 specific implementation of PluginWindow.
uint32_t getWindowHeight() const
Gets the height of the window.
PluginWindow is the base class for all PluginWindow objects.
Definition: PluginWindow.h:33
virtual void InvalidateWindow() const
Invalidate window. This should tell the OS to send a REFRESH event.
FB::Rect getWindowClipping() const
Gets the clipping rect of the window.