FDOSTUI
FreeDOS Text User Interface
wmhelper.hpp
Go to the documentation of this file.
1 /*
2  WMHELPER.HPP
3 
4  License CC0 PUBLIC DOMAIN
5 
6  To the extent possible under law, Mark J. Olesen has waived all copyright
7  and related or neighboring rights to FDOSTUI Library. This work is published
8  from: United States.
9 */
10 #ifndef __wmhelper_hpp__
11 
12 #include "screen.h"
13 #include "window.hpp"
14 
15 class wmhelper
16 {
17 
18 public:
19 
20  static unsigned int const MIN_WIDTH;
21  static unsigned int const MIN_HEIGHT;
22 
23  wmhelper();
24 
25  virtual
26  ~wmhelper();
27 
28  static void
30  struct box const& i_box,
31  enum window::attributes const i_attr,
32  unsigned char const* i_title);
33 
34  static void
35  draw_frame(
36  struct box const& i_box,
37  struct skin_frame const& i_skin,
38  enum foreground const i_fcolor,
39  enum background const i_bcolor);
40 
41  static void
42  draw_title(
43  unsigned char const* i_title,
44  struct box const& i_box);
45 
46  enum event_response
47  event_key(
48  struct event_key const& i_event);
49 
50  enum event_response
51  event_key(
52  window*const i_window,
53  struct event_key const& i_event);
54 
55  enum event_response
57  struct event_mouse const& i_event);
58 
59  enum event_response
61  window*const i_window,
62  struct event_mouse const& i_event);
63 
64  void
65  close();
66 
67  void
68  maximize();
69 
70  void
71  minimize();
72 
73  bool
74  capture() const;
75 
76  void
78 
79  void
80  capture_move();
81 
82 protected:
83 
84  enum wm_event
85  {
87 /* EVENT_SYSMENU,
88  EVENT_CLOSE,
89  EVENT_MINIMIZE,
90  EVENT_MAXIMIZE, */
93  };
94 
96  {
100  };
101 
103  unsigned int m_mouse_x;
104  unsigned int m_mouse_y;
107 
108 private:
109 
110  wmhelper(
111  const wmhelper&);
112 
113  wmhelper&
114  operator=(wmhelper const&);
115 
116  void
118 
119 };
120 
121 inline bool
123 {
124  return m_capture;
125 }
126 
127 inline void
129 {
132  return;
133 }
134 
135 inline void
137 {
140 }
141 
142 #define __wmhelper_hpp__
143 #endif
window * m_window
Definition: wmhelper.hpp:102
contains window class
static void draw_title(unsigned char const *i_title, struct box const &i_box)
draw title on the window
Definition: wmhelper.cpp:119
void close()
closes the window
Definition: wmhelper.cpp:430
unsigned int m_mouse_x
Definition: wmhelper.hpp:103
wmhelper()
constructor
Definition: wmhelper.cpp:22
unsigned int m_mouse_y
Definition: wmhelper.hpp:104
screen drawing routines (no clipping) The draw.h module contians clipping routines.
void maximize()
maximizes the window
Definition: wmhelper.cpp:448
wm_event
current event state
Definition: wmhelper.hpp:84
Definition: wmhelper.hpp:91
void minimize()
minimizes the window
Definition: wmhelper.cpp:471
void capture_resize()
sets capture state to ::CAPTURE_KEYBOARD and event state to ::EVENT_RESIZE
Definition: wmhelper.hpp:128
Definition: wmhelper.hpp:97
window manager helper class
Definition: wmhelper.hpp:15
void capture_move()
sets capture state to ::CAPTURE_KEYBOARD and event state to ::EVENT_MOVE
Definition: wmhelper.hpp:136
enum wm_capture m_capture
Definition: wmhelper.hpp:106
attributes
Definition: window.hpp:24
enum event_response event_key(struct event_key const &i_event)
handle key event
Definition: wmhelper.cpp:492
frame theme
Definition: skin.h:14
static void draw_frame(struct box const &i_box, struct skin_frame const &i_skin, enum foreground const i_fcolor, enum background const i_bcolor)
draw a rectangular frame
Definition: wmhelper.cpp:39
Definition: wmhelper.hpp:99
enum wm_event m_event
Definition: wmhelper.hpp:105
Definition: wmhelper.hpp:92
bool capture() const
gets whether or not the window is in capture mode
Definition: wmhelper.hpp:122
wm_capture
capture state
Definition: wmhelper.hpp:95
background
background color
Definition: screen.h:117
event_response
response
Definition: event.h:14
Definition: wmhelper.hpp:98
static unsigned int const MIN_WIDTH
Definition: wmhelper.hpp:20
enum event_response event_mouse(struct event_mouse const &i_event)
handle mouse event
Definition: wmhelper.cpp:676
virtual ~wmhelper()
destructor
Definition: wmhelper.cpp:32
top level container widget that can be moved and resized by the user
Definition: window.hpp:19
foreground
foreground colors
Definition: screen.h:43
Definition: wmhelper.hpp:86
static unsigned int const MIN_HEIGHT
Definition: wmhelper.hpp:21
static void draw_decorate(struct box const &i_box, enum window::attributes const i_attr, unsigned char const *i_title)
adorns a rectangular area
Definition: wmhelper.cpp:181
void event_system_menu()
pop-up the system menu
Definition: wmhelper.cpp:388
container for a mouse event
Definition: event.h:37
defines a rectangular region
Definition: box.h:12
container for a keyboard event
Definition: event.h:23