15 #ifndef TINYOSXGRAPHICSWINDOW_H 16 #define TINYOSXGRAPHICSWINDOW_H 18 #include "pandabase.h" 20 #if defined(IS_OSX) && !defined(BUILD_IPHONE) && defined(HAVE_CARBON) && !__LP64__ 22 #include <Carbon/Carbon.h> 24 #include "graphicsWindow.h" 25 #include "buttonHandle.h" 26 #include "tinyGraphicsStateGuardian.h" 42 virtual ~TinyOsxGraphicsWindow();
52 virtual bool do_reshape_request(
int x_origin,
int y_origin,
bool has_origin,
53 int x_size,
int y_size);
55 virtual void mouse_mode_absolute();
56 virtual void mouse_mode_relative();
61 void ReleaseSystemResources();
65 virtual void close_window();
66 virtual bool open_window();
78 OSStatus handleKeyInput (EventHandlerCallRef myHandler, EventRef event, Boolean keyDown);
79 OSStatus handleTextInput (EventHandlerCallRef myHandler, EventRef event);
80 OSStatus handleWindowMouseEvents (EventHandlerCallRef myHandler, EventRef event);
81 ButtonHandle OSX_TranslateKey( UInt32 key, EventRef event );
82 static TinyOsxGraphicsWindow * GetCurrentOSxWindow (WindowRef hint);
84 void HandleModifireDeleta(UInt32 modifiers);
85 void HandleButtonDelta(UInt32 new_buttons);
88 OSStatus event_handler(EventHandlerCallRef myHandler, EventRef event);
90 virtual void user_close_request();
91 void SystemCloseWindow();
92 void SystemSetWindowForground(
bool forground);
93 void SystemPointToLocalPoint(Point &qdGlobalPoint);
94 void LocalPointToSystemPoint(Point &qdLocalPoint);
95 bool set_icon_filename(
const Filename &icon_filename);
97 void set_pointer_in_window(
int x,
int y);
98 void set_pointer_out_of_window();
101 void create_frame_buffer();
107 UInt32 _last_key_modifiers;
108 UInt32 _last_buttons;
109 WindowRef _osx_window;
112 CGImageRef _pending_icon;
113 CGImageRef _current_icon;
116 static TinyOsxGraphicsWindow *FullScreenWindow;
118 CFDictionaryRef _originalMode;
124 bool _display_hide_cursor;
132 static void init_type() {
133 GraphicsWindow::init_type();
134 register_type(_type_handle,
"TinyOsxGraphicsWindow",
135 GraphicsWindow::get_class_type());
138 return get_class_type();
140 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
146 #include "tinyOsxGraphicsWindow.I" virtual void process_events()
Do whatever processing is necessary to ensure that the window responds to user events.
virtual bool move_pointer(int device, int x, int y)
Forces the pointer to the indicated position within the window, if possible.
virtual void set_properties_now(WindowProperties &properties)
Applies the requested set of properties to the window, if possible, for instance to request a change ...
virtual void end_frame(FrameMode mode, Thread *current_thread)
This function will be called within the draw thread after rendering is completed for a given frame...
A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive d...
A container for the various kinds of properties we might ask to have on a graphics window before we o...
The name of a file, such as a texture file or an Egg file.
virtual bool supports_pixel_zoom() const
Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored...
An object to create GraphicsOutputs that share a particular 3-D API.
This is a base class for the various different classes that represent the result of a frame of render...
A thread; that is, a lightweight process.
virtual void begin_flip()
This function will be called within the draw thread after end_frame() has been called on all windows...
Encapsulates all the communication with a particular instance of a given rendering backend...
This class is the main interface to controlling the render process.
TypeHandle is the identifier used to differentiate C++ class types.
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
virtual bool begin_frame(FrameMode mode, Thread *current_thread)
This function will be called within the draw thread before beginning rendering for a given frame...