14#ifndef GRAPHICSWINDOW_H
15#define GRAPHICSWINDOW_H
40class EXPCL_PANDA_DISPLAY GraphicsWindow :
public GraphicsOutput {
42 GraphicsWindow(GraphicsEngine *engine,
44 const std::string &name,
49 GraphicsOutput *host);
52 virtual ~GraphicsWindow();
105 virtual void clear_window_procs(){};
106 virtual bool supports_window_procs()
const;
108 virtual int verify_window_sizes(
int numsizes,
int *dimen);
110 virtual bool is_touch_event(GraphicsWindowProcCallbackData* callbackData);
111 virtual int get_num_touches();
112 virtual TouchInfo get_touch_info(
int index);
123 virtual void set_properties_now(WindowProperties &properties);
126 virtual void close_window();
127 virtual bool open_window();
130 virtual bool do_reshape_request(
int x_origin,
int y_origin,
bool has_origin,
131 int x_size,
int y_size);
133 virtual void mouse_mode_absolute();
134 virtual void mouse_mode_relative();
138 void system_changed_properties(
const WindowProperties &properties);
139 void system_changed_size(
int x_size,
int y_size);
142 int add_input_device(InputDevice *device);
143 typedef pvector<PT(InputDevice)> InputDevices;
144 InputDevices _input_devices;
145 LightMutex _input_lock;
148 WindowProperties _properties;
149 PT(WindowHandle) _window_handle;
150 PT(WindowHandle) _parent_window_handle;
152 bool _got_expose_event;
155 LightReMutex _properties_lock;
158 WindowProperties _requested_properties;
159 WindowProperties _rejected_properties;
160 std::string _window_event;
161 std::string _close_request_event;
162 bool _unexposed_draw;
165 typedef pset<GraphicsWindowProc*> PythonWinProcClasses;
166 PythonWinProcClasses _python_window_proc_classes;
170 static TypeHandle get_class_type() {
173 static void init_type() {
174 GraphicsOutput::init_type();
176 GraphicsOutput::get_class_type());
178 virtual TypeHandle get_type()
const {
179 return get_class_type();
181 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
184 static TypeHandle _type_handle;
186 friend class GraphicsEngine;
187 friend class Extension<GraphicsWindow>;
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
virtual void process_events()
Do whatever processing in the window thread is appropriate for this output object each frame.
is_active
Returns true if the window is ready to be rendered into, false otherwise.
virtual void reset_window(bool swapchain)
Resets the window framebuffer from its derived children.
virtual void request_close()
This is called by the GraphicsEngine to request that the window (or whatever) close itself or,...
virtual void request_open()
This is called by the GraphicsEngine to request that the window (or whatever) open itself or,...
virtual void set_close_now()
This is called by the GraphicsEngine to insist that the output be closed immediately.
Encapsulates all the communication with a particular instance of a given rendering backend.
Defines an interface for storing platform-specific window processor methods.
set_close_request_event
Sets the event that is triggered when the user requests to close the window, e.g.
get_input_device_name
Returns the name of the nth input device.
void disable_pointer_events(int device)
Turn off the generation of pointer events.
void clear_rejected_properties()
Empties the set of failed properties that will be returned by get_rejected_properties().
virtual bool move_pointer(int device, int x, int y)
Forces the pointer to the indicated position within the window, if possible.
get_unexposed_draw
See set_unexposed_draw().
get_input_device
Returns the nth input device associated with the window.
set_unexposed_draw
If this flag is false, the window is redrawn only after it has received a recent "unexpose" or "draw"...
get_window_event
Returns the name of the event that is generated when this window is modified externally,...
get_properties
Returns the current properties of the window.
bool is_fullscreen() const
Returns true if the window has been opened as a fullscreen window, false otherwise.
get_requested_properties
Returns the properties of the window that are currently requested.
set_window_event
Changes the name of the event that is generated when this window is modified externally,...
get_num_input_devices
Returns the number of separate input devices associated with the window.
void request_properties(const WindowProperties &requested_properties)
Requests a property change on the window.
get_window_handle
Returns the WindowHandle corresponding to this window on the desktop.
get_close_request_event
Returns the name of the event set via set_close_request_event().
virtual MouseData get_pointer(int device) const
See GraphicsWindowInputDevice::enable_pointer_mode.
virtual void close_ime()
Forces the ime window to close if any.
get_rejected_properties
Returns the set of properties that have recently been requested, but could not be applied to the wind...
is_closed
Returns true if the window has not yet been opened, or has been fully closed, false if it is open.
bool has_pointer(int device) const
Returns true if the nth input device has a screen-space pointer (for instance, a mouse),...
void enable_pointer_events(int device)
Turn on the generation of pointer events.
virtual ButtonMap * get_keyboard_map() const
Returns a ButtonMap containing the association between raw buttons and virtual buttons.
bool has_keyboard(int device) const
Returns true if the nth input device has a keyboard, false otherwise.
This object represents a window on the desktop, not necessarily a Panda window.
A container for the various kinds of properties we might ask to have on a graphics window before we o...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
BEGIN_PUBLISH typedef PointerData MouseData
Deprecated alias for PointerData.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.