From 4811b7c7e02c0612975a8526f8ebba49ece0e72b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 16 Sep 1999 22:45:24 +0000 Subject: initial check-in --- src/glut/beos/glutWindow.h | 109 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 src/glut/beos/glutWindow.h (limited to 'src/glut/beos/glutWindow.h') diff --git a/src/glut/beos/glutWindow.h b/src/glut/beos/glutWindow.h new file mode 100644 index 0000000000..7a4292e733 --- /dev/null +++ b/src/glut/beos/glutWindow.h @@ -0,0 +1,109 @@ +/*********************************************************** + * Copyright (C) 1997, Be Inc. All rights reserved. + * + * FILE: glutWindow.h + * + * DESCRIPTION: the GlutWindow class saves all events for + * handling by main thread + ***********************************************************/ + +/*********************************************************** + * Headers + ***********************************************************/ +#include +#include +#include + +/*********************************************************** + * CLASS: GlutWindow + * + * INHERITS FROM: BGLView (NOT BWindow!) + * + * DESCRIPTION: all information needed for windows and + * subwindows (handled as similarly as possible) + ***********************************************************/ +class GlutWindow : public BGLView { +public: + GlutWindow(GlutWindow *nparent, char *name, int x, int y, int width, + int height, ulong options); + + void KeyDown(const char *bytes, int32 numBytes); + void MouseDown(BPoint point); + void MouseMoved(BPoint point, uint32 transit, const BMessage *message); + void FrameResized(float width, float height); + void Draw(BRect updateRect); + void Hide(); + void Show(); + void Pulse(); // needed since MouseUp() is broken + void MouseCheck(); // check for button state changes + void ErrorCallback(GLenum errorCode); + + static long MenuThread(void *menu); + + int num; // window number returned to user + int cursor; // my cursor +#define GLUT_MAX_MENUS 3 + int menu[GLUT_MAX_MENUS]; // my popup menus + int m_width, m_height; // the last width and height reported to GLUT + uint32 m_buttons; // the last mouse button state + + /* Window relationship state. */ + GlutWindow *parent; /* parent window */ + GlutWindow *children; /* first child window */ + GlutWindow *siblings; /* next sibling */ + + // leave out buttons and dials callbacks that we don't support + GLUTdisplayCB display; /* redraw */ + GLUTreshapeCB reshape; /* resize (width,height) */ + GLUTmouseCB mouse; /* mouse (button,state,x,y) */ + GLUTmotionCB motion; /* motion (x,y) */ + GLUTpassiveCB passive; /* passive motion (x,y) */ + GLUTentryCB entry; /* window entry/exit (state) */ + GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */ + GLUTvisibilityCB visibility; /* visibility */ + GLUTspecialCB special; /* special key */ + + bool anyevents; // were any events received? + bool displayEvent; // call display + bool reshapeEvent; // call reshape + bool mouseEvent; // call mouse + bool motionEvent; // call motion + bool passiveEvent; // call passive + bool entryEvent; // call entry + bool keybEvent; // call keyboard + bool visEvent; // call visibility + bool specialEvent; // call special + bool statusEvent; // menu status changed + bool menuEvent; // menu selected + + bool swapHack; // faked out single buffering + + int button, mouseState; // for mouse callback + int mouseX, mouseY; // for mouse callback + int motionX, motionY; // for motion callback + int passiveX, passiveY; // for passive callback + int entryState; // for entry callback + unsigned char key; // for keyboard callback + int keyX, keyY; // for keyboard callback + int visState; // for visibility callback + int specialKey; // for special key callback + int specialX, specialY; // for special callback + int modifierKeys; // modifier key state + int menuStatus; // for status callback + int statusX, statusY; // for status callback + int menuNumber; // for menu and status callbacks + int menuValue; // for menu callback +}; + +/*********************************************************** + * CLASS: GlutBWindow + * + * INHERITS FROM: BWindow + * + * DESCRIPTION: basically a BWindow that won't quit + ***********************************************************/ +class GlutBWindow : public BWindow { +public: + GlutBWindow(BRect frame, char *name); + bool QuitRequested(); // exits app +}; \ No newline at end of file -- cgit v1.2.3