SDL  2.0
SDL_BWin.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
22 #ifndef _SDL_BWin_h
23 #define _SDL_BWin_h
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #include "../../SDL_internal.h"
30 #include "SDL.h"
31 #include "SDL_syswm.h"
32 #include "SDL_bframebuffer.h"
33 
34 #ifdef __cplusplus
35 }
36 #endif
37 
38 #include <stdio.h>
39 #include <AppKit.h>
40 #include <InterfaceKit.h>
41 #include <be/game/DirectWindow.h>
42 #if SDL_VIDEO_OPENGL
43 #include <be/opengl/GLView.h>
44 #endif
45 #include "SDL_events.h"
46 #include "../../main/haiku/SDL_BApp.h"
47 
48 
61 };
62 
63 
64 class SDL_BWin:public BDirectWindow
65 {
66  public:
67  /* Constructor/Destructor */
68  SDL_BWin(BRect bounds, window_look look, uint32 flags)
69  : BDirectWindow(bounds, "Untitled", look, B_NORMAL_WINDOW_FEEL, flags)
70  {
71  _last_buttons = 0;
72 
73 #if SDL_VIDEO_OPENGL
74  _SDL_GLView = NULL;
75 #endif
76  _shown = false;
77  _inhibit_resize = false;
78  _mouse_focused = false;
79  _prev_frame = NULL;
80 
81  /* Handle framebuffer stuff */
84  _trash_window_buffer = false;
85  _buffer_locker = new BLocker();
86  _bitmap = NULL;
87  _clips = NULL;
88 
89 #ifdef DRAWTHREAD
90  _draw_thread_id = spawn_thread(BE_DrawThread, "drawing_thread",
91  B_NORMAL_PRIORITY, (void*) this);
92  resume_thread(_draw_thread_id);
93 #endif
94  }
95 
96  virtual ~ SDL_BWin()
97  {
98  Lock();
99  _connection_disabled = true;
100  int32 result;
101 
102 #if SDL_VIDEO_OPENGL
103  if (_SDL_GLView) {
104  _SDL_GLView->UnlockGL();
105  RemoveChild(_SDL_GLView); /* Why was this outside the if
106  statement before? */
107  }
108 
109 #endif
110  Unlock();
111 #if SDL_VIDEO_OPENGL
112  if (_SDL_GLView) {
113  delete _SDL_GLView;
114  }
115 #endif
116 
117  /* Clean up framebuffer stuff */
118  _buffer_locker->Lock();
119 #ifdef DRAWTHREAD
120  wait_for_thread(_draw_thread_id, &result);
121 #endif
122  free(_clips);
123  delete _buffer_locker;
124  }
125 
126 
127  /* * * * * OpenGL functionality * * * * */
128 #if SDL_VIDEO_OPENGL
129  virtual BGLView *CreateGLView(Uint32 gl_flags) {
130  Lock();
131  if (_SDL_GLView == NULL) {
132  _SDL_GLView = new BGLView(Bounds(), "SDL GLView",
133  B_FOLLOW_ALL_SIDES,
134  (B_WILL_DRAW | B_FRAME_EVENTS),
135  gl_flags);
136  }
137  AddChild(_SDL_GLView);
138  _SDL_GLView->EnableDirectMode(true);
139  _SDL_GLView->LockGL(); /* "New" GLViews are created */
140  Unlock();
141  return (_SDL_GLView);
142  }
143 
144  virtual void RemoveGLView() {
145  Lock();
146  if(_SDL_GLView) {
147  _SDL_GLView->UnlockGL();
148  RemoveChild(_SDL_GLView);
149  }
150  Unlock();
151  }
152 
153  virtual void SwapBuffers(void) {
154  _SDL_GLView->UnlockGL();
155  _SDL_GLView->LockGL();
156  _SDL_GLView->SwapBuffers();
157  }
158 #endif
159 
160  /* * * * * Framebuffering* * * * */
161  virtual void DirectConnected(direct_buffer_info *info) {
163  return;
164  }
165 
166  /* Determine if the pixel buffer is usable after this update */
168  || ((info->buffer_state & B_BUFFER_RESIZED)
169  || (info->buffer_state & B_BUFFER_RESET)
170  || (info->driver_state == B_MODE_CHANGED));
171  LockBuffer();
172 
173  switch(info->buffer_state & B_DIRECT_MODE_MASK) {
174  case B_DIRECT_START:
175  _connected = true;
176 
177  case B_DIRECT_MODIFY:
178  if(_clips) {
179  free(_clips);
180  _clips = NULL;
181  }
182 
183  _num_clips = info->clip_list_count;
184  _clips = (clipping_rect *)malloc(_num_clips*sizeof(clipping_rect));
185  if(_clips) {
186  memcpy(_clips, info->clip_list,
187  _num_clips*sizeof(clipping_rect));
188 
189  _bits = (uint8*) info->bits;
190  _row_bytes = info->bytes_per_row;
191  _bounds = info->window_bounds;
192  _bytes_per_px = info->bits_per_pixel / 8;
193  _buffer_dirty = true;
194  }
195  break;
196 
197  case B_DIRECT_STOP:
198  _connected = false;
199  break;
200  }
201 #if SDL_VIDEO_OPENGL
202  if(_SDL_GLView) {
203  _SDL_GLView->DirectConnected(info);
204  }
205 #endif
206 
207 
208  /* Call the base object directconnected */
209  BDirectWindow::DirectConnected(info);
210 
211  UnlockBuffer();
212 
213  }
214 
215 
216 
217 
218  /* * * * * Event sending * * * * */
219  /* Hook functions */
220  virtual void FrameMoved(BPoint origin) {
221  /* Post a message to the BApp so that it can handle the window event */
222  BMessage msg(BAPP_WINDOW_MOVED);
223  msg.AddInt32("window-x", (int)origin.x);
224  msg.AddInt32("window-y", (int)origin.y);
225  _PostWindowEvent(msg);
226 
227  /* Perform normal hook operations */
228  BDirectWindow::FrameMoved(origin);
229  }
230 
231  virtual void FrameResized(float width, float height) {
232  /* Post a message to the BApp so that it can handle the window event */
233  BMessage msg(BAPP_WINDOW_RESIZED);
234 
235  msg.AddInt32("window-w", (int)width + 1);
236  msg.AddInt32("window-h", (int)height + 1);
237  _PostWindowEvent(msg);
238 
239  /* Perform normal hook operations */
240  BDirectWindow::FrameResized(width, height);
241  }
242 
243  virtual bool QuitRequested() {
244  BMessage msg(BAPP_WINDOW_CLOSE_REQUESTED);
245  _PostWindowEvent(msg);
246 
247  /* We won't allow a quit unless asked by DestroyWindow() */
248  return false;
249  }
250 
251  virtual void WindowActivated(bool active) {
252  BMessage msg(BAPP_KEYBOARD_FOCUS); /* Mouse focus sold separately */
253  _PostWindowEvent(msg);
254  }
255 
256  virtual void Zoom(BPoint origin,
257  float width,
258  float height) {
259  BMessage msg(BAPP_MAXIMIZE); /* Closest thing to maximization Haiku has */
260  _PostWindowEvent(msg);
261 
262  /* Before the window zooms, record its size */
263  if( !_prev_frame )
264  _prev_frame = new BRect(Frame());
265 
266  /* Perform normal hook operations */
267  BDirectWindow::Zoom(origin, width, height);
268  }
269 
270  /* Member functions */
271  virtual void Show() {
272  while(IsHidden()) {
273  BDirectWindow::Show();
274  }
275  _shown = true;
276 
277  BMessage msg(BAPP_SHOW);
278  _PostWindowEvent(msg);
279  }
280 
281  virtual void Hide() {
282  BDirectWindow::Hide();
283  _shown = false;
284 
285  BMessage msg(BAPP_HIDE);
286  _PostWindowEvent(msg);
287  }
288 
289  virtual void Minimize(bool minimize) {
290  BDirectWindow::Minimize(minimize);
291  int32 minState = (minimize ? BAPP_MINIMIZE : BAPP_RESTORE);
292 
293  BMessage msg(minState);
294  _PostWindowEvent(msg);
295  }
296 
297 
298  /* BView message interruption */
299  virtual void DispatchMessage(BMessage * msg, BHandler * target)
300  {
301  BPoint where; /* Used by mouse moved */
302  int32 buttons; /* Used for mouse button events */
303  int32 key; /* Used for key events */
304 
305  switch (msg->what) {
306  case B_MOUSE_MOVED:
307  int32 transit;
308  if (msg->FindPoint("where", &where) == B_OK
309  && msg->FindInt32("be:transit", &transit) == B_OK) {
310  _MouseMotionEvent(where, transit);
311  }
312 
313  /* FIXME: Apparently a button press/release event might be dropped
314  if made before before a different button is released. Does
315  B_MOUSE_MOVED have the data needed to check if a mouse button
316  state has changed? */
317  if (msg->FindInt32("buttons", &buttons) == B_OK) {
318  _MouseButtonEvent(buttons);
319  }
320  break;
321 
322  case B_MOUSE_DOWN:
323  case B_MOUSE_UP:
324  /* _MouseButtonEvent() detects any and all buttons that may have
325  changed state, as well as that button's new state */
326  if (msg->FindInt32("buttons", &buttons) == B_OK) {
327  _MouseButtonEvent(buttons);
328  }
329  break;
330 
331  case B_MOUSE_WHEEL_CHANGED:
332  float x, y;
333  if (msg->FindFloat("be:wheel_delta_x", &x) == B_OK
334  && msg->FindFloat("be:wheel_delta_y", &y) == B_OK) {
335  _MouseWheelEvent((int)x, (int)y);
336  }
337  break;
338 
339  case B_KEY_DOWN:
340  {
341  int32 i = 0;
342  int8 byte;
343  int8 bytes[4] = { 0, 0, 0, 0 };
344  while (i < 4 && msg->FindInt8("byte", i, &byte) == B_OK) {
345  bytes[i] = byte;
346  i++;
347  }
348  if (msg->FindInt32("key", &key) == B_OK) {
349  _KeyEvent((SDL_Scancode)key, &bytes[0], i, SDL_PRESSED);
350  }
351  }
352  break;
353 
354  case B_UNMAPPED_KEY_DOWN: /* modifier keys are unmapped */
355  if (msg->FindInt32("key", &key) == B_OK) {
357  }
358  break;
359 
360  case B_KEY_UP:
361  case B_UNMAPPED_KEY_UP: /* modifier keys are unmapped */
362  if (msg->FindInt32("key", &key) == B_OK) {
363  _KeyEvent(key, NULL, 0, SDL_RELEASED);
364  }
365  break;
366 
367  default:
368  /* move it after switch{} so it's always handled
369  that way we keep Haiku features like:
370  - CTRL+Q to close window (and other shortcuts)
371  - PrintScreen to make screenshot into /boot/home
372  - etc.. */
373  /* BDirectWindow::DispatchMessage(msg, target); */
374  break;
375  }
376 
377  BDirectWindow::DispatchMessage(msg, target);
378  }
379 
380  /* Handle command messages */
381  virtual void MessageReceived(BMessage* message) {
382  switch (message->what) {
383  /* Handle commands from SDL */
384  case BWIN_SET_TITLE:
385  _SetTitle(message);
386  break;
387  case BWIN_MOVE_WINDOW:
388  _MoveTo(message);
389  break;
390  case BWIN_RESIZE_WINDOW:
391  _ResizeTo(message);
392  break;
393  case BWIN_SET_BORDERED:
394  _SetBordered(message);
395  break;
396  case BWIN_SET_RESIZABLE:
397  _SetResizable(message);
398  break;
399  case BWIN_SHOW_WINDOW:
400  Show();
401  break;
402  case BWIN_HIDE_WINDOW:
403  Hide();
404  break;
406  BWindow::Zoom();
407  break;
409  Minimize(true);
410  break;
411  case BWIN_RESTORE_WINDOW:
412  _Restore();
413  break;
414  case BWIN_FULLSCREEN:
415  _SetFullScreen(message);
416  break;
417  default:
418  /* Perform normal message handling */
419  BDirectWindow::MessageReceived(message);
420  break;
421  }
422 
423  }
424 
425 
426 
427  /* Accessor methods */
428  bool IsShown() { return _shown; }
429  int32 GetID() { return _id; }
430  uint32 GetRowBytes() { return _row_bytes; }
431  int32 GetFbX() { return _bounds.left; }
432  int32 GetFbY() { return _bounds.top; }
434  bool Connected() { return _connected; }
435  clipping_rect *GetClips() { return _clips; }
436  int32 GetNumClips() { return _num_clips; }
437  uint8* GetBufferPx() { return _bits; }
438  int32 GetBytesPerPx() { return _bytes_per_px; }
440  bool BufferExists() { return _buffer_created; }
441  bool BufferIsDirty() { return _buffer_dirty; }
442  BBitmap *GetBitmap() { return _bitmap; }
443 #if SDL_VIDEO_OPENGL
444  BGLView *GetGLView() { return _SDL_GLView; }
445 #endif
446 
447  /* Setter methods */
448  void SetID(int32 id) { _id = id; }
449  void SetBufferExists(bool bufferExists) { _buffer_created = bufferExists; }
450  void LockBuffer() { _buffer_locker->Lock(); }
451  void UnlockBuffer() { _buffer_locker->Unlock(); }
452  void SetBufferDirty(bool bufferDirty) { _buffer_dirty = bufferDirty; }
453  void SetTrashBuffer(bool trash) { _trash_window_buffer = trash; }
454  void SetBitmap(BBitmap *bitmap) { _bitmap = bitmap; }
455 
456 
457 private:
458  /* Event redirection */
459  void _MouseMotionEvent(BPoint &where, int32 transit) {
460  if(transit == B_EXITED_VIEW) {
461  /* Change mouse focus */
462  if(_mouse_focused) {
463  _MouseFocusEvent(false);
464  }
465  } else {
466  /* Change mouse focus */
467  if (!_mouse_focused) {
468  _MouseFocusEvent(true);
469  }
470  BMessage msg(BAPP_MOUSE_MOVED);
471  msg.AddInt32("x", (int)where.x);
472  msg.AddInt32("y", (int)where.y);
473 
474  _PostWindowEvent(msg);
475  }
476  }
477 
478  void _MouseFocusEvent(bool focusGained) {
479  _mouse_focused = focusGained;
480  BMessage msg(BAPP_MOUSE_FOCUS);
481  msg.AddBool("focusGained", focusGained);
482  _PostWindowEvent(msg);
483 
484 /* FIXME: Why were these here?
485  if false: be_app->SetCursor(B_HAND_CURSOR);
486  if true: SDL_SetCursor(NULL); */
487  }
488 
489  void _MouseButtonEvent(int32 buttons) {
490  int32 buttonStateChange = buttons ^ _last_buttons;
491 
492  /* Make sure at least one button has changed state */
493  if( !(buttonStateChange) ) {
494  return;
495  }
496 
497  /* Add any mouse button events */
498  if(buttonStateChange & B_PRIMARY_MOUSE_BUTTON) {
500  B_PRIMARY_MOUSE_BUTTON);
501  }
502  if(buttonStateChange & B_SECONDARY_MOUSE_BUTTON) {
504  B_PRIMARY_MOUSE_BUTTON);
505  }
506  if(buttonStateChange & B_TERTIARY_MOUSE_BUTTON) {
508  B_PRIMARY_MOUSE_BUTTON);
509  }
510 
511  _last_buttons = buttons;
512  }
513 
514  void _SendMouseButton(int32 button, int32 state) {
515  BMessage msg(BAPP_MOUSE_BUTTON);
516  msg.AddInt32("button-id", button);
517  msg.AddInt32("button-state", state);
518  _PostWindowEvent(msg);
519  }
520 
521  void _MouseWheelEvent(int32 x, int32 y) {
522  /* Create a message to pass along to the BeApp thread */
523  BMessage msg(BAPP_MOUSE_WHEEL);
524  msg.AddInt32("xticks", x);
525  msg.AddInt32("yticks", y);
526  _PostWindowEvent(msg);
527  }
528 
529  void _KeyEvent(int32 keyCode, const int8 *keyUtf8, const ssize_t & len, int32 keyState) {
530  /* Create a message to pass along to the BeApp thread */
531  BMessage msg(BAPP_KEY);
532  msg.AddInt32("key-state", keyState);
533  msg.AddInt32("key-scancode", keyCode);
534  if (keyUtf8 != NULL) {
535  msg.AddData("key-utf8", B_INT8_TYPE, (const void*)keyUtf8, len);
536  }
537  be_app->PostMessage(&msg);
538  }
539 
540  void _RepaintEvent() {
541  /* Force a repaint: Call the SDL exposed event */
542  BMessage msg(BAPP_REPAINT);
543  _PostWindowEvent(msg);
544  }
545  void _PostWindowEvent(BMessage &msg) {
546  msg.AddInt32("window-id", _id);
547  be_app->PostMessage(&msg);
548  }
549 
550  /* Command methods (functions called upon by SDL) */
551  void _SetTitle(BMessage *msg) {
552  const char *title;
553  if(
554  msg->FindString("window-title", &title) != B_OK
555  ) {
556  return;
557  }
558  SetTitle(title);
559  }
560 
561  void _MoveTo(BMessage *msg) {
562  int32 x, y;
563  if(
564  msg->FindInt32("window-x", &x) != B_OK ||
565  msg->FindInt32("window-y", &y) != B_OK
566  ) {
567  return;
568  }
569  MoveTo(x, y);
570  }
571 
572  void _ResizeTo(BMessage *msg) {
573  int32 w, h;
574  if(
575  msg->FindInt32("window-w", &w) != B_OK ||
576  msg->FindInt32("window-h", &h) != B_OK
577  ) {
578  return;
579  }
580  ResizeTo(w, h);
581  }
582 
583  void _SetBordered(BMessage *msg) {
584  bool bEnabled;
585  if(msg->FindBool("window-border", &bEnabled) != B_OK) {
586  return;
587  }
588  SetLook(bEnabled ? B_BORDERED_WINDOW_LOOK : B_NO_BORDER_WINDOW_LOOK);
589  }
590 
591  void _SetResizable(BMessage *msg) {
592  bool bEnabled;
593  if(msg->FindBool("window-resizable", &bEnabled) != B_OK) {
594  return;
595  }
596  if (bEnabled) {
597  SetFlags(Flags() & ~(B_NOT_RESIZABLE | B_NOT_ZOOMABLE));
598  } else {
599  SetFlags(Flags() | (B_NOT_RESIZABLE | B_NOT_ZOOMABLE));
600  }
601  }
602 
603  void _Restore() {
604  if(IsMinimized()) {
605  Minimize(false);
606  } else if(IsHidden()) {
607  Show();
608  } else if(_prev_frame != NULL) { /* Zoomed */
609  MoveTo(_prev_frame->left, _prev_frame->top);
610  ResizeTo(_prev_frame->Width(), _prev_frame->Height());
611  }
612  }
613 
614  void _SetFullScreen(BMessage *msg) {
615  bool fullscreen;
616  if(
617  msg->FindBool("fullscreen", &fullscreen) != B_OK
618  ) {
619  return;
620  }
621  SetFullScreen(fullscreen);
622  }
623 
624  /* Members */
625 #if SDL_VIDEO_OPENGL
626  BGLView * _SDL_GLView;
627 #endif
628 
630  int32 _id; /* Window id used by SDL_BApp */
631  bool _mouse_focused; /* Does this window have mouse focus? */
632  bool _shown;
634 
635  BRect *_prev_frame; /* Previous position and size of the window */
636 
637  /* Framebuffer members */
643  uint8 *_bits;
644  uint32 _row_bytes;
645  clipping_rect _bounds;
646  BLocker *_buffer_locker;
647  clipping_rect *_clips;
648  int32 _num_clips;
650  thread_id _draw_thread_id;
651 
652  BBitmap *_bitmap;
653 };
654 
655 
656 /* FIXME:
657  * An explanation of framebuffer flags.
658  *
659  * _connected - Original variable used to let the drawing thread know
660  * when changes are being made to the other framebuffer
661  * members.
662  * _connection_disabled - Used to signal to the drawing thread that the window
663  * is closing, and the thread should exit.
664  * _buffer_created - True if the current buffer is valid
665  * _buffer_dirty - True if the window should be redrawn.
666  * _trash_window_buffer - True if the window buffer needs to be trashed partway
667  * through a draw cycle. Occurs when the previous
668  * buffer provided by DirectConnected() is invalidated.
669  */
670 #endif
int32 GetFbY()
Definition: SDL_BWin.h:432
BGLView * _SDL_GLView
Definition: SDL_BWin.h:626
virtual void Show()
Definition: SDL_BWin.h:271
virtual ~ SDL_BWin()
Definition: SDL_BWin.h:96
bool BufferExists()
Definition: SDL_BWin.h:440
GLsizei GLfixed GLfixed GLfixed GLfixed const GLubyte * bitmap
GLuint id
void _ResizeTo(BMessage *msg)
Definition: SDL_BWin.h:572
void UnlockBuffer()
Definition: SDL_BWin.h:451
virtual void WindowActivated(bool active)
Definition: SDL_BWin.h:251
int32 _last_buttons
Definition: SDL_BWin.h:629
bool _connected
Definition: SDL_BWin.h:638
SDL_Texture * button
bool _buffer_dirty
Definition: SDL_BWin.h:638
GLuint64EXT * result
GLint GLint GLsizei width
Definition: SDL_opengl.h:1565
bool _connection_disabled
Definition: SDL_BWin.h:638
uint8 * _bits
Definition: SDL_BWin.h:643
uint32 GetRowBytes()
Definition: SDL_BWin.h:430
GLuint GLsizei const GLchar * message
SDL_atomic_t active
Definition: SDL_events.c:76
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1567
void _MouseButtonEvent(int32 buttons)
Definition: SDL_BWin.h:489
#define SDL_BUTTON_RIGHT
Definition: SDL_mouse.h:284
struct xkb_state * state
SDL_EventEntry * free
Definition: SDL_events.c:81
BGLView * GetGLView()
Definition: SDL_BWin.h:444
SDL_BWin(BRect bounds, window_look look, uint32 flags)
Definition: SDL_BWin.h:68
bool _shown
Definition: SDL_BWin.h:632
void _SendMouseButton(int32 button, int32 state)
Definition: SDL_BWin.h:514
bool BufferIsDirty()
Definition: SDL_BWin.h:441
clipping_rect * GetClips()
Definition: SDL_BWin.h:435
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:161
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1565
virtual void Hide()
Definition: SDL_BWin.h:281
BLocker * _buffer_locker
Definition: SDL_BWin.h:646
bool _inhibit_resize
Definition: SDL_BWin.h:633
void SetBitmap(BBitmap *bitmap)
Definition: SDL_BWin.h:454
void SetBufferExists(bool bufferExists)
Definition: SDL_BWin.h:449
GLenum GLsizei len
void _SetFullScreen(BMessage *msg)
Definition: SDL_BWin.h:614
int32 _bytes_per_px
Definition: SDL_BWin.h:649
void SetID(int32 id)
Definition: SDL_BWin.h:448
bool _mouse_focused
Definition: SDL_BWin.h:631
void _MouseFocusEvent(bool focusGained)
Definition: SDL_BWin.h:478
int32 GetNumClips()
Definition: SDL_BWin.h:436
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1567
#define SDL_BUTTON_LEFT
Definition: SDL_mouse.h:282
virtual void DispatchMessage(BMessage *msg, BHandler *target)
Definition: SDL_BWin.h:299
void LockBuffer()
Definition: SDL_BWin.h:450
virtual void Minimize(bool minimize)
Definition: SDL_BWin.h:289
virtual void Zoom(BPoint origin, float width, float height)
Definition: SDL_BWin.h:256
GLenum target
virtual void MessageReceived(BMessage *message)
Definition: SDL_BWin.h:381
virtual void RemoveGLView()
Definition: SDL_BWin.h:144
virtual void FrameResized(float width, float height)
Definition: SDL_BWin.h:231
int32 _id
Definition: SDL_BWin.h:630
int32 _num_clips
Definition: SDL_BWin.h:648
clipping_rect * _clips
Definition: SDL_BWin.h:647
#define SDL_BUTTON_MIDDLE
Definition: SDL_mouse.h:283
BBitmap * GetBitmap()
Definition: SDL_BWin.h:442
void _MoveTo(BMessage *msg)
Definition: SDL_BWin.h:561
clipping_rect _bounds
Definition: SDL_BWin.h:645
void SetBufferDirty(bool bufferDirty)
Definition: SDL_BWin.h:452
int32 GetID()
Definition: SDL_BWin.h:429
BRect * _prev_frame
Definition: SDL_BWin.h:635
void _SetResizable(BMessage *msg)
Definition: SDL_BWin.h:591
bool Connected()
Definition: SDL_BWin.h:434
virtual void FrameMoved(BPoint origin)
Definition: SDL_BWin.h:220
void _SetTitle(BMessage *msg)
Definition: SDL_BWin.h:551
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
void _SetBordered(BMessage *msg)
Definition: SDL_BWin.h:583
#define NULL
Definition: begin_code.h:143
int32 GetFbX()
Definition: SDL_BWin.h:431
#define malloc
Definition: SDL_malloc.c:641
virtual void SwapBuffers(void)
Definition: SDL_BWin.h:153
bool _trash_window_buffer
Definition: SDL_BWin.h:638
void _PostWindowEvent(BMessage &msg)
Definition: SDL_BWin.h:545
void _KeyEvent(int32 keyCode, const int8 *keyUtf8, const ssize_t &len, int32 keyState)
Definition: SDL_BWin.h:529
#define memcpy
Definition: SDL_malloc.c:640
void _MouseMotionEvent(BPoint &where, int32 transit)
Definition: SDL_BWin.h:459
virtual BGLView * CreateGLView(Uint32 gl_flags)
Definition: SDL_BWin.h:129
bool CanTrashWindowBuffer()
Definition: SDL_BWin.h:439
bool _buffer_created
Definition: SDL_BWin.h:638
BBitmap * _bitmap
Definition: SDL_BWin.h:652
GLbitfield flags
virtual void DirectConnected(direct_buffer_info *info)
Definition: SDL_BWin.h:161
uint32 _row_bytes
Definition: SDL_BWin.h:644
GLubyte GLubyte GLubyte GLubyte w
uint8 * GetBufferPx()
Definition: SDL_BWin.h:437
void SetTrashBuffer(bool trash)
Definition: SDL_BWin.h:453
WinCommands
Definition: SDL_BWin.h:49
#define SDL_PRESSED
Definition: SDL_events.h:50
thread_id _draw_thread_id
Definition: SDL_BWin.h:650
bool ConnectionEnabled()
Definition: SDL_BWin.h:433
#define SDL_RELEASED
Definition: SDL_events.h:49
void _Restore()
Definition: SDL_BWin.h:603
int32 BE_DrawThread(void *data)
SDL_Scancode
The SDL keyboard scancode representation.
Definition: SDL_scancode.h:43
int32 GetBytesPerPx()
Definition: SDL_BWin.h:438
GLfloat GLfloat GLfloat GLfloat h
bool IsShown()
Definition: SDL_BWin.h:428
void _MouseWheelEvent(int32 x, int32 y)
Definition: SDL_BWin.h:521
virtual bool QuitRequested()
Definition: SDL_BWin.h:243
void _RepaintEvent()
Definition: SDL_BWin.h:540