Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions

# WindowProperties Class Reference

A container for the various kinds of properties we might ask to have on a graphics window before we open it. More...

List of all members.

## Public Types
enum | MouseMode { MAbsolute = 0, MRelative = 1 }
enum | ZOrder { ZBottom = 0, ZNormal = 1, ZTop = 2 }
## Public Member Functions
| WindowProperties ()
| WindowProperties (WindowProperties const copy)
| addProperties (WindowProperties const other)
| Sets any properties that are explicitly specified in other on this object.
| clear ()
| Unsets all properties that have been specified so far, and resets the WindowProperties structure to its initial empty state.
| clearCursorFilename ()
| Removes the cursor_filename specification from the properties.
| clearCursorHidden ()
| Removes the cursor_hidden specification from the properties.
| clearFixedSize ()
| Removes the fixed_size specification from the properties.
| clearForeground ()
| Removes the foreground specification from the properties.
| clearFullscreen ()
| Removes the fullscreen specification from the properties.
| clearIconFilename ()
| Removes the icon_filename specification from the properties.
| clearMinimized ()
| Removes the minimized specification from the properties.
| clearMouseMode ()
| Removes the mouse_mode specification from the properties.
| clearOpen ()
| Removes the open specification from the properties.
| clearOrigin ()
| Removes the origin specification from the properties.
| clearParentWindow ()
| Removes the S_parent_window specification from the properties.
| clearRawMice ()
| Removes the raw_mice specification from the properties.
| clearSize ()
| Removes the size specification from the properties.
| clearTitle ()
| Removes the title specification from the properties.
| clearUndecorated ()
| Removes the undecorated specification from the properties.
| clearZOrder ()
| Removes the z_order specification from the properties.
Filename const | getCursorFilename ()
| Returns the icon filename associated with the mouse cursor.
bool | getCursorHidden ()
| Returns true if the mouse cursor is invisible.
bool | getFixedSize ()
| Returns true if the window cannot be resized by the user, false otherwise.
bool | getForeground ()
| Returns true if the window is in the foreground.
bool | getFullscreen ()
| Returns true if the window is in fullscreen mode.
Filename const | getIconFilename ()
| Returns the icon filename associated with the window.
bool | getMinimized ()
| Returns true if the window is minimized.
MouseMode | getMouseMode ()
| See set_mouse_mode().
bool | getOpen ()
| Returns true if the window is open.
WindowHandle | getParentWindow ()
| Returns the parent window specification, or NULL if there is no parent window specified.
bool | getRawMice ()
| Returns true if the window reads the raw mice.
string | getTitle ()
| Returns the window's title.
bool | getUndecorated ()
| Returns true if the window has no border.
int | getXOrigin ()
| Returns the x coordinate of the window's top-left corner, not including decorations.
int | getXSize ()
| Returns size in pixels in the x dimension of the useful part of the window, not including decorations.
int | getYOrigin ()
| Returns the y coordinate of the window's top-left corner, not including decorations.
int | getYSize ()
| Returns size in pixels in the y dimension of the useful part of the window, not including decorations.
ZOrder | getZOrder ()
| Returns the window's z_order.
bool | hasCursorFilename ()
| Returns true if set_cursor_filename() has been specified.
bool | hasCursorHidden ()
| Returns true if set_cursor_hidden() has been specified.
bool | hasFixedSize ()
| Returns true if set_fixed_size() has been specified.
bool | hasForeground ()
| Returns true if set_foreground() has been specified.
bool | hasFullscreen ()
| Returns true if set_fullscreen() has been specified.
bool | hasIconFilename ()
| Returns true if set_icon_filename() has been specified.
bool | hasMinimized ()
| Returns true if set_minimized() has been specified.
bool | hasMouseMode ()
bool | hasOpen ()
| Returns true if set_open() has been specified.
bool | hasOrigin ()
| Returns true if the window origin has been specified, false otherwise.
bool | hasParentWindow ()
| Checks the S_parent_window specification from the properties.
bool | hasRawMice ()
| Returns true if set_raw_mice() has been specified.
bool | hasSize ()
| Returns true if the window size has been specified, false otherwise.
bool | hasTitle ()
| Returns true if the window title has been specified, false otherwise.
bool | hasUndecorated ()
| Returns true if set_undecorated() has been specified.
bool | hasZOrder ()
| Returns true if the window z_order has been specified, false otherwise.
bool | isAnySpecified ()
| Returns true if any properties have been specified, false otherwise.
bool | operator!= (WindowProperties const other)
WindowProperties | operator= (WindowProperties const copy)
bool | operator== (WindowProperties const other)
| output (ostream out)
| Sets any properties that are explicitly specified in other on this object.
| setCursorFilename (Filename const cursor_filename)
| Specifies the file that contains the icon to associate with the mouse cursor when it is within the window (and visible).
| setCursorHidden (bool cursor_hidden)
| Specifies whether the mouse cursor should be visible.
| setFixedSize (bool fixed_size)
| Specifies whether the window should be resizable by the user.
| setForeground (bool foreground)
| Specifies whether the window should be opened in the foreground (true), or left in the background (false).
| setFullscreen (bool fullscreen)
| Specifies whether the window should be opened in fullscreen mode (true) or normal windowed mode (false, the default).
| setIconFilename (Filename const icon_filename)
| Specifies the file that contains the icon to associate with the window when it is minimized.
| setMinimized (bool minimized)
| Specifies whether the window should be created minimized (true), or normal (false).
| setMouseMode (MouseMode mode)
| Specifies the mode in which the window is to operate its mouse pointer.
| setOpen (bool open)
| Specifies whether the window should be open.
| setOrigin (int x_origin, int y_origin)
| Specifies the origin on the screen (in pixels, relative to the top-left corner) at which the window should appear.
| setParentWindow ()
| Specifies the window that this window should be attached to.
| setParentWindow (unsigned int parent)
| Specifies the window that this window should be attached to.
| setParentWindow (WindowHandle parent_window)
| Specifies the window that this window should be attached to.
| setRawMice (bool raw_mice)
| Specifies whether the window should read the raw mouse devices.
| setSize (int x_size, int y_size)
| Specifies the requested size of the window, in pixels.
| setTitle (string title)
| Specifies the title that should be assigned to the window.
| setUndecorated (bool undecorated)
| Specifies whether the window should be created with a visible title and border (false, the default) or not (true).
| setZOrder (ZOrder z_order)
| Specifies the relative ordering of the window with respect to other windows.
## Static Public Member Functions
static | clearDefault ()
| Returns the "default" WindowProperties to whatever is specified in the user's config file.
static WindowProperties | getConfigProperties ()
| Returns a WindowProperties structure with all of the default values filled in according to the user's config file.
static WindowProperties | getDefault ()
| Returns the "default" WindowProperties.
static | setDefault (WindowProperties const default_properties)
| Replaces the "default" WindowProperties with the specified structure.
static WindowProperties | size (int x_size, int y_size)
| Returns a WindowProperties structure with only the size specified.

## Detailed Description

A container for the various kinds of properties we might ask to have on a graphics window before we open it.

This also serves to hold the current properties for a window after it has been opened.

## Member Enumeration Documentation

enum MouseMode

Enumerator:

  MAbsolute |
  MRelative |

enum ZOrder

Enumerator:

  ZBottom |
  ZNormal |
  ZTop |

## Constructor & Destructor Documentation

WindowProperties | ( |  | ) |

WindowProperties | ( | WindowProperties const | copy | ) |

## Member Function Documentation

addProperties | ( | WindowProperties const | other | ) |

Sets any properties that are explicitly specified in other on this object.

Leaves other properties unchanged.

clear | ( |  | ) |

Unsets all properties that have been specified so far, and resets the WindowProperties structure to its initial empty state.

clearCursorFilename | ( |  | ) |

Removes the cursor_filename specification from the properties.

clearCursorHidden | ( |  | ) |

Removes the cursor_hidden specification from the properties.

static clearDefault | ( |  | ) | `[static]`

Returns the "default" WindowProperties to whatever is specified in the user's config file.

clearFixedSize | ( |  | ) |

Removes the fixed_size specification from the properties.

clearForeground | ( |  | ) |

Removes the foreground specification from the properties.

clearFullscreen | ( |  | ) |

Removes the fullscreen specification from the properties.

clearIconFilename | ( |  | ) |

Removes the icon_filename specification from the properties.

clearMinimized | ( |  | ) |

Removes the minimized specification from the properties.

clearMouseMode | ( |  | ) |

Removes the mouse_mode specification from the properties.

clearOpen | ( |  | ) |

Removes the open specification from the properties.

clearOrigin | ( |  | ) |

Removes the origin specification from the properties.

clearParentWindow | ( |  | ) |

Removes the S_parent_window specification from the properties.

clearRawMice | ( |  | ) |

Removes the raw_mice specification from the properties.

clearSize | ( |  | ) |

Removes the size specification from the properties.

clearTitle | ( |  | ) |

Removes the title specification from the properties.

clearUndecorated | ( |  | ) |

Removes the undecorated specification from the properties.

clearZOrder | ( |  | ) |

Removes the z_order specification from the properties.

static WindowProperties getConfigProperties | ( |  | ) | `[static]`

Returns a WindowProperties structure with all of the default values filled in according to the user's config file.

Filename const getCursorFilename | ( |  | ) |

Returns the icon filename associated with the mouse cursor.

bool getCursorHidden | ( |  | ) |

Returns true if the mouse cursor is invisible.

static WindowProperties getDefault | ( |  | ) | `[static]`

Returns the "default" WindowProperties.

If set_default() has been called, this returns that WindowProperties structure; otherwise, this returns get_config_properties().

bool getFixedSize | ( |  | ) |

Returns true if the window cannot be resized by the user, false otherwise.

bool getForeground | ( |  | ) |

Returns true if the window is in the foreground.

bool getFullscreen | ( |  | ) |

Returns true if the window is in fullscreen mode.

Filename const getIconFilename | ( |  | ) |

Returns the icon filename associated with the window.

bool getMinimized | ( |  | ) |

Returns true if the window is minimized.

MouseMode getMouseMode | ( |  | ) |

See set_mouse_mode().

bool getOpen | ( |  | ) |

Returns true if the window is open.

WindowHandle getParentWindow | ( |  | ) |

Returns the parent window specification, or NULL if there is no parent window specified.

bool getRawMice | ( |  | ) |

Returns true if the window reads the raw mice.

string getTitle | ( |  | ) |

Returns the window's title.

bool getUndecorated | ( |  | ) |

Returns true if the window has no border.

int getXOrigin | ( |  | ) |

Returns the x coordinate of the window's top-left corner, not including decorations.

int getXSize | ( |  | ) |

Returns size in pixels in the x dimension of the useful part of the window, not including decorations.

That is, this is the window's width.

int getYOrigin | ( |  | ) |

Returns the y coordinate of the window's top-left corner, not including decorations.

int getYSize | ( |  | ) |

Returns size in pixels in the y dimension of the useful part of the window, not including decorations.

That is, this is the window's height.

ZOrder getZOrder | ( |  | ) |

Returns the window's z_order.

bool hasCursorFilename | ( |  | ) |

Returns true if set_cursor_filename() has been specified.

bool hasCursorHidden | ( |  | ) |

Returns true if set_cursor_hidden() has been specified.

bool hasFixedSize | ( |  | ) |

Returns true if set_fixed_size() has been specified.

bool hasForeground | ( |  | ) |

Returns true if set_foreground() has been specified.

bool hasFullscreen | ( |  | ) |

Returns true if set_fullscreen() has been specified.

bool hasIconFilename | ( |  | ) |

Returns true if set_icon_filename() has been specified.

bool hasMinimized | ( |  | ) |

Returns true if set_minimized() has been specified.

bool hasMouseMode | ( |  | ) |

bool hasOpen | ( |  | ) |

Returns true if set_open() has been specified.

bool hasOrigin | ( |  | ) |

Returns true if the window origin has been specified, false otherwise.

bool hasParentWindow | ( |  | ) |

Checks the S_parent_window specification from the properties.

bool hasRawMice | ( |  | ) |

Returns true if set_raw_mice() has been specified.

bool hasSize | ( |  | ) |

Returns true if the window size has been specified, false otherwise.

bool hasTitle | ( |  | ) |

Returns true if the window title has been specified, false otherwise.

bool hasUndecorated | ( |  | ) |

Returns true if set_undecorated() has been specified.

bool hasZOrder | ( |  | ) |

Returns true if the window z_order has been specified, false otherwise.

bool isAnySpecified | ( |  | ) |

Returns true if any properties have been specified, false otherwise.

bool operator!= | ( | WindowProperties const | other | ) |

WindowProperties operator= | ( | WindowProperties const | copy | ) |

bool operator== | ( | WindowProperties const | other | ) |

output | ( | ostream | out | ) |

Sets any properties that are explicitly specified in other on this object.

Leaves other properties unchanged.

setCursorFilename | ( | Filename const | cursor_filename | ) |

Specifies the file that contains the icon to associate with the mouse cursor when it is within the window (and visible).

setCursorHidden | ( | bool | cursor_hidden | ) |

Specifies whether the mouse cursor should be visible.

static setDefault | ( | WindowProperties const | default_properties | ) | `[static]`

Replaces the "default" WindowProperties with the specified structure.

The specified WindowProperties will be returned by future calls to get_default(), until clear_default() is called.

Note that this completely replaces the default properties; it is not additive.

setFixedSize | ( | bool | fixed_size | ) |

Specifies whether the window should be resizable by the user.

setForeground | ( | bool | foreground | ) |

Specifies whether the window should be opened in the foreground (true), or left in the background (false).

setFullscreen | ( | bool | fullscreen | ) |

Specifies whether the window should be opened in fullscreen mode (true) or normal windowed mode (false, the default).

setIconFilename | ( | Filename const | icon_filename | ) |

Specifies the file that contains the icon to associate with the window when it is minimized.

setMinimized | ( | bool | minimized | ) |

Specifies whether the window should be created minimized (true), or normal (false).

setMouseMode | ( | MouseMode | mode | ) |

Specifies the mode in which the window is to operate its mouse pointer.

The default is M_absolute, which is the normal mode in which a mouse pointer operates; but you can also set M_relative, which is particularly useful for FPS-style mouse movements where you have hidden the mouse pointer and are are more interested in how fast the mouse is moving, rather than precisely where the pointer is hovering.

This has no effect on Windows, which does not have this concept; but is important to do on OSX and Unix/X11 to properly enable a smooth FPS-style mouselook mode. On Unix/X11, this requires the Xxf86dga extension to be available.

setOpen | ( | bool | open | ) |

Specifies whether the window should be open.

It is legal to create a GraphicsWindow in the closed state, and later request it to open by changing this flag.

setOrigin | ( | int | x_origin,
|  | int | y_origin
| ) |  |

Specifies the origin on the screen (in pixels, relative to the top-left corner) at which the window should appear.

This is the origin of the top-left corner of the useful part of the window, not including decorations.

setParentWindow | ( | WindowHandle | parent_window | ) |

Specifies the window that this window should be attached to.

If this is NULL or unspecified, the window will be created as a toplevel window on the desktop; if this is non-NULL, the window will be bound as a child window to the indicated parent window.

You should use GraphicsPipe.make_window_handle() to create an instance of a WindowHandle object given an appropriate OS-specific window handle representation. Each OS-specific GraphicsPipe class defines a make_window_handle() method that returns an appropriate WindowHandle object to wrap the particular OS-specific representation.

setParentWindow | ( | unsigned int | parent | ) |

Specifies the window that this window should be attached to.

This is a deprecated variant on this method, and exists only for backward compatibility. Future code should use the version of set_parent_window() below that receives a WindowHandle object; that interface is much more robust.

In this deprecated variant, the actual value for "parent" is platform-specific. On Windows, it is the HWND of the parent window, cast to an unsigned integer. On X11, it is the Window pointer of the parent window, similarly cast. On OSX, this is the NSWindow pointer, which doesn't appear to work at all.

setParentWindow | ( |  | ) |

Specifies the window that this window should be attached to.

If this is NULL or unspecified, the window will be created as a toplevel window on the desktop; if this is non-NULL, the window will be bound as a child window to the indicated parent window.

You should use GraphicsPipe.make_window_handle() to create an instance of a WindowHandle object given an appropriate OS-specific window handle representation. Each OS-specific GraphicsPipe class defines a make_window_handle() method that returns an appropriate WindowHandle object to wrap the particular OS-specific representation.

setRawMice | ( | bool | raw_mice | ) |

Specifies whether the window should read the raw mouse devices.

setSize | ( | int | x_size,
|  | int | y_size
| ) |  |

Specifies the requested size of the window, in pixels.

This is the size of the useful part of the window, not including decorations.

setTitle | ( | string | title | ) |

Specifies the title that should be assigned to the window.

setUndecorated | ( | bool | undecorated | ) |

Specifies whether the window should be created with a visible title and border (false, the default) or not (true).

setZOrder | ( | ZOrder | z_order | ) |

Specifies the relative ordering of the window with respect to other windows.

If the z_order is Z_top, the window will always be on top of other windows; if it is Z_bottom, it will always be below other windows. Most windows will want to be Z_normal, which allows the user to control the order.

static WindowProperties size | ( | int | x_size,
|  | int | y_size
| ) |  | `[static]`

Returns a WindowProperties structure with only the size specified.

The size is the only property that matters to buffers.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties