40 GraphicsOutput(engine, pipe, name, fb_prop, win_prop, flags, gsg, host, true),
41 _input_lock(
"GraphicsWindow::_input_lock"),
42 _properties_lock(
"GraphicsWindow::_properties_lock")
48 if (display_cat.is_debug()) {
50 <<
"Creating new window " << get_name() <<
"\n";
53 _properties.set_open(
false);
54 _properties.set_undecorated(
false);
55 _properties.set_fullscreen(
false);
56 _properties.set_minimized(
false);
57 _properties.set_cursor_hidden(
false);
60 request_properties(win_prop);
62 _window_event =
"window-event";
63 _got_expose_event =
false;
64 _unexposed_draw = win_unexposed_draw;
65 set_pixel_zoom(pixel_zoom);
75 PythonWinProcClasses::iterator iter;
76 for (iter = _python_window_proc_classes.begin();
77 iter != _python_window_proc_classes.end();
107 result = _requested_properties;
119 _rejected_properties.
clear();
133 result = _rejected_properties;
151 if (!_has_size && _requested_properties.
has_size()) {
156 _size = _requested_properties.
get_size();
182 _window_event = window_event;
194 result = _window_event;
218 _close_request_event = close_request_event;
230 result = _close_request_event;
245 result = _input_devices.size();
257 nassertr(device >= 0 && device < (
int)_input_devices.size(), NULL);
258 return _input_devices[device];
269 nassertr(device >= 0 && device < (
int)_input_devices.size(),
"");
270 result = _input_devices[device]->get_name();
284 nassertr(device >= 0 && device < (
int)_input_devices.size(),
false);
285 result = _input_devices[device]->has_pointer();
298 nassertr(device >= 0 && device < (
int)_input_devices.size(),
false);
299 result = _input_devices[device]->has_keyboard();
319 nassertv(device >= 0 && device < (
int)_input_devices.size());
320 _input_devices[device]->enable_pointer_events();
329 nassertv(device >= 0 && device < (
int)_input_devices.size());
330 _input_devices[device]->disable_pointer_events();
365 nassertr(device >= 0 && device < (
int)_input_devices.size(),
MouseData());
467 properties = _requested_properties;
468 _requested_properties.
clear();
473 <<
"Unable to set window properties: " << properties <<
"\n";
559 int x_origin = 0, y_origin = 0;
567 (has_origin && (x_origin != _properties.
get_x_origin() ||
569 if (do_reshape_request(x_origin, y_origin, has_origin,
586 if (properties.has_mouse_mode() &&
599 <<
"Closing " << get_type() <<
"\n";
602 if (_window_handle !=
nullptr &&
603 _parent_window_handle !=
nullptr) {
604 _parent_window_handle->detach_child(_window_handle);
607 _window_handle =
nullptr;
608 _parent_window_handle =
nullptr;
626reset_window(
bool swapchain) {
628 <<
"Resetting " << get_type() <<
"\n";
638do_reshape_request(
int x_origin,
int y_origin,
bool has_origin,
639 int x_size,
int y_size) {
650 if (display_cat.is_debug()) {
652 <<
"system_changed_properties(" << properties <<
")\n";
663 if (_properties != old_properties) {
664 throw_event(_window_event,
this);
674system_changed_size(
int x_size,
int y_size) {
675 if (display_cat.is_debug()) {
677 <<
"system_changed_size(" << x_size <<
", " << y_size <<
")\n";
693 int index = (int)_input_devices.size();
694 _input_devices.push_back(device);
703mouse_mode_relative() {
711mouse_mode_absolute() {
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
This class is the main interface to controlling the render process.
This is a base class for the various different classes that represent the result of a frame of render...
is_active
Returns true if the window is ready to be rendered into, false otherwise.
void set_size_and_recalc(int x, int y)
Changes the x_size and y_size, then recalculates structures that depend on size.
An object to create GraphicsOutputs that share a particular 3-D API.
Encapsulates all the communication with a particular instance of a given rendering backend.
This specialization on CallbackData is passed when the callback is initiated from from an implementat...
virtual void request_open()
This is called by the GraphicsEngine to request that the window (or whatever) open itself or,...
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.
virtual bool is_touch_event(GraphicsWindowProcCallbackData *callbackData)
Returns whether the specified event msg is a touch message.
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_input_device
Returns the nth input device associated with the window.
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_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.
virtual int get_num_touches()
Returns the current number of touches on this window.
get_rejected_properties
Returns the set of properties that have recently been requested, but could not be applied to the wind...
bool has_pointer(int device) const
Returns true if the nth input device has a screen-space pointer (for instance, a mouse),...
virtual void process_events()
Do whatever processing is necessary to ensure that the window responds to user events.
virtual bool supports_window_procs() const
Returns whether this window supports adding of Windows proc handlers.
virtual int verify_window_sizes(int numsizes, int *dimen)
Determines which of the indicated window sizes are supported by available hardware (e....
virtual void request_close()
This is called by the GraphicsEngine to request that the window (or whatever) close itself or,...
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 TouchInfo get_touch_info(int index)
Returns the TouchInfo object describing the specified touch.
virtual void set_close_now()
This is called by the GraphicsEngine to insist that the window be closed immediately.
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.
virtual bool is_active() const
Returns true if the window is ready to be rendered into, false otherwise.
Similar to MutexHolder, but for a light mutex.
Similar to MutexHolder, but for a light reentrant mutex.
static void update_type(ReferenceCount *ptr, TypeHandle type)
Associates the indicated type with the given pointer.
Stores information for a single touch event.
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 window before we o...
void add_properties(const WindowProperties &other)
Sets any properties that are explicitly specified in other on this object.
get_open
Returns true if the window is open.
has_open
Returns true if set_open() has been specified.
int get_y_size() const
Returns size in pixels in the y dimension of the useful part of the window, not including decorations...
int get_x_size() const
Returns size in pixels in the x dimension of the useful part of the window, not including decorations...
int get_y_origin() const
Returns the y coordinate of the window's top-left corner, not including decorations.
void clear()
Unsets all properties that have been specified so far, and resets the WindowProperties structure to i...
get_minimized
Returns true if the window is minimized.
clear_mouse_mode
Removes the mouse_mode specification from the properties.
has_fullscreen
Returns true if set_fullscreen() has been specified.
has_size
Returns true if the window size has been specified, false otherwise.
get_size
Returns size in pixels of the useful part of the window, not including decorations.
clear_origin
Removes the origin specification from the properties.
set_size
Specifies the requested size of the window, in pixels.
bool is_any_specified() const
Returns true if any properties have been specified, false otherwise.
clear_fullscreen
Removes the fullscreen specification from the properties.
clear_size
Removes the size specification from the properties.
set_open
Specifies whether the window should be open.
get_fullscreen
Returns true if the window is in fullscreen mode.
get_default
Returns the "default" WindowProperties.
get_mouse_mode
See set_mouse_mode().
has_origin
Returns true if the window origin has been specified, false otherwise.
clear_open
Removes the open specification from the properties.
int get_x_origin() const
Returns the x coordinate of the window's top-left corner, not including decorations.
set_origin
Specifies the origin on the screen (in pixels, relative to the top-left corner) at which the window s...
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.