LGI  1.0
Lliurex Graphic Interface
 All Classes Namespaces Files Functions Variables Macros
fbwindow.hpp
Go to the documentation of this file.
1 
2 #ifndef _LGI_FB_WINDOW_
3 #define _LGI_FB_WINDOW_
4 
5 #include "window.hpp"
6 
7 #include <linux/fb.h>
8 #include <unistd.h>
9 #include <stdint.h>
10 #include <cairo.h>
11 
12 #include <vector>
13 #include <queue>
14 
15 namespace net
16 {
17  namespace lliurex
18  {
19  namespace lgi
20  {
21  class fbWindow: public BaseWindow
22  {
23  private:
24 
25  int width;
26  int height;
27 
28  int fb_fd;
29  struct fb_var_screeninfo vinfo;
30  struct fb_fix_screeninfo finfo;
31 
32  int framesize;
33  uint8_t * framebuffer;
34  uint8_t * backbuffer;
35 
36  std::vector<Layer * > layers;
37  std::queue<RawEvent *> event_queue;
38 
39  int mouse_fd;
40  int mx,my;
41  int buttons[6];
42  Widget * dragging;
43 
44  timeval init_time;
45 
46 
47  void DrawMouse();
48 
49 
50 
51 
52  public:
53 
54 
55 
56  cairo_t * cairo;
57  cairo_surface_t * cairo_surface;
58 
59  fbWindow(int width,int height,const char * devname,int flags);
60  virtual ~fbWindow();
61 
62  /* inherited methods */
63 
64  void Resize(int w,int h);
65 
66  void Destroy();
67  void SetTitle(const char * title);
68 
69  void GetEvent();
70  void DispatchEvents(int mode);
71  void PushEvent(RawEvent * raw_event);
72  RawEvent * PopEvent();
73  void ProcessEvent(RawEvent * raw_event);
74 
75  void Flip();
76 
77  int GetWidth();
78  int GetHeight();
79 
80  void AddLayer(Layer * layer);
81  void RemoveLayer(Layer * layer);
82  void ShowLayer(Layer * layer);
83  void HideLayer(Layer * layer);
84 
85  void SetCursor(int type);
86  void SetCursorMode(int mode);
87  void SetCustomCursor(BaseCursor * cursor);
88 
89  void SetDoubleClickTime(int ms);
90 
91  void SendMessage(Layer * layer,Widget * widget,Message * msg);
92 
93  /* custom functs */
94  int GetTicks();
95  bool GetCollision(int x,int y,Widget ** widget,Layer ** layer);
96  };
97  }
98  }
99 }
100 
101 
102 #endif
void ShowLayer(Layer *layer)
fbWindow(int width, int height, const char *devname, int flags)
void SetCustomCursor(BaseCursor *cursor)
void Resize(int w, int h)
void DispatchEvents(int mode)
void SetCursorMode(int mode)
Definition: fbwindow.hpp:21
Definition: layer.hpp:23
Definition: window.hpp:145
bool GetCollision(int x, int y, Widget **widget, Layer **layer)
void PushEvent(RawEvent *raw_event)
void RemoveLayer(Layer *layer)
void SendMessage(Layer *layer, Widget *widget, Message *msg)
void AddLayer(Layer *layer)
void SetTitle(const char *title)
void ProcessEvent(RawEvent *raw_event)
cairo_t * cairo
Definition: fbwindow.hpp:56
void HideLayer(Layer *layer)
Definition: cursor.hpp:13
cairo_surface_t * cairo_surface
Definition: fbwindow.hpp:57
Definition: widget.hpp:18
Definition: message.hpp:83
Definition: window.hpp:137