KD_QNX_window

The KD_QNX_window extension

Synopsis:

KD_QNX_window {
    kdSetWindowOrderQNX( KDWindow *window, KDWindow *above )
    kdPostWindowEventQNX( KDEvent *event, KDWindow *window )
    kdDuplicateWindowQNX(struct KDWindow *window, void *eventuserptr);
    KD_WINDOWPROPERTY_CLASS_QNX
    KD_WINDOWPROPERTY_ID_STRING_QNX
    KD_WINDOWPROPERTY_DISPLAY_QNX
    KD_WINDOWPROPERTY_POSITION_QNX
    KD_WINDOWPROPERTY_SOURCE_POSITION_QNX
    KD_WINDOWPROPERTY_SOURCE_SIZE_QNX
    KD_WINDOWPROPERTY_SURFACE_SIZE_QNX
    KD_WINDOWPROPERTY_ALPHA_QNX
    KD_WINDOWPROPERTY_DELEGATE_POINTER_QNX
    KD_WINDOWPROPERTY_DELEGATE_QNX
    KD_WINDOWPROPERTY_SOURCE_ALPHA_QNX
    KD_WINDOWPROPERTY_SENSITIVE_QNX
    KD_WINDOWPROPERTY_MANAGED_QNX
    KD_WINDOWPROPERTY_POINTER_FOCUS_QNX
    KD_WINDOWPROPERTY_SWAP_INTERVAL_QNX
    KD_WINDOWPROPERTY_BRIGHTNESS_QNX
    KD_WINDOWPROPERTY_CONTRAST_QNX
    KD_WINDOWPROPERTY_HUE_QNX
    KD_WINDOWPROPERTY_SATURATION_QNX
    KD_WINDOWPROPERTY_LEVEL_QNX
    KD_WINDOWPROPERTY_FREEZE_QNX

    KD_EVENT_WINDOW_CREATE_QNX
    KD_EVENT_WINDOW_REALIZE_QNX
    KD_EVENT_WINDOW_PROPERTY_QNX
    KD_EVENT_WINDOW_CLOSE_QNX
}
 

Description:

The KD_QNX_window extension defines the OpenKode representation of a Composition Manager window class.

The extension has the following members:

Functions:

kdPostWindowEventQNX( )

kdPostWindowEventQNX( KDEvent *event, KDWindow *window )

Post an event into another application's queue.

*event
A pointer to a KDEvent event.
*window
A pointer to the window that will fire the event.

This function posts the event pointed to by the event parameter, which is one returned by kdCreateEvent (in the same thread), although the fields in the KDEvent structure can have been altered to any values. If the timestamp field is 0, kdPostWindowEventQNX stores the current time at some point during this kdPostWindowEventQNX() call (as returned by kdGetTimeUST()) in that field. The event is otherwise unaltered by kdPostWindowEventQNX().

The kdPostWindowEventQNX() function posts the event to the queue that's associated with the window argument. The window argument may have been created in any thread of an application, or else must be the KDWindow field of a notification event sent to a delegate thread. If the window argument is KD_NULL and the event argument is an input or output event, then kdPostWindowEventQNX() posts the event to the queue that's associated with the window that currently has input focus for that particular type of event.

Any event type may be posted. The event may have any userptr value, even if the event is of a type defined in the OpenKODE specification. Take care to set the userptr field and event data to values that are expected by the application code that handles the event type being posted.


Note: Once the event has been passed to kdPostWindowEventQNX(), it's “owned” by the OpenKODE Core event system. If the application attempts to access or free it after the call to kdPostWindowEventQNX(), undefined behavior results. This is the case even if the call to kdPostWindowEventQNX() failed.

KDint32 kdSetWindowOrderQNX( )

KDint32 kdSetWindowOrderQNX( KDWindow *window, KDWindow *above )

Sets the z-order, or the position in the stack of windows, on the screen.

*window
A pointer to the window for which you want to change to order.
*above
A pointer to the window for which this window will appear above.

If the above argument is a valid window, kdSetWindowOrderQNX() places the window in the window argument directly below the above window argument.

The above argument can also be one of the following window constants:

KD_QNX_WINDOW_BOTTOM
Place the window below all windows on the same display
KD_QNX_LOWER
Place the window below the window currently beneath it.
KD_QNX_RAISE
Place the window above the window that is currently above it.
KD_QNX_WINDOW_TOP
Place the window above all windows on the same display.

The kdSetWindowOrderQNX() function returns an error if above is KD_QNX_LOWER and there are no windows below the window argument. Alternatively, kdSetWindowOrderQNX() returns an error if above is KD_QNX_RAISE and there are no windows above the window argument.

Properties:

KD_WINDOWPROPERTY_CLASS_QNX
Window class name.

Synopsis:

#define KD_WINDOWPROPERTY_CLASS_QNX 1001

Specifies the name of a window class that should be used to initialize a window's properties. It is a null-terminated UTF-8 string, and thus you set it with kdSetWindowPropertycv() and read with kdGetWindowPropertycv(). The default value is the empty string.

KD_WINDOWPROPERTY_ID_STRING_QNX
A String representing the id of the window. The ID is used to identify the window.

Synopsis:

#define KD_WINDOWPROPERTY_ID_STRING_QNX 1002

Provides a string that can be used by delegates to identify windows. It is a null-terminated UTF-8 string, and is set by kdSetWindowPropertycv(). The default value is the empty string.

You can use the string in conjunction with the class name, or by itself, to determine what a window is, which application created it, or which instance of an application is updating a window.

KD_WINDOWPROPERTY_DISPLAY_QNX
Window display assignment.

Synopsis:

#define KD_WINDOWPROPERTY_DISPLAY_QNX 1003

Used to put a window on a particular display when multiple displays are available. It is an array of a single KDint32, and thus you set it with kdSetWindowPropertyiv() and read with kdGetWindowPropertyiv(). The value of this property must correspond to the identification number of a display in the Composition Manager's configuration file. The default value is the identification number of the first display in the configuration file.

KD_WINDOWPROPERTY_POSITION_QNX
Used to position a window within a display.

Synopsis:

#define KD_WINDOWPROPERTY_POSITION_QNX 1004

It is an array of two KDint32 representing the x and y screen coordinates of the upper-left corner of the window. To set it use kdSetWindowPropertyiv() and read with kdGetWindowPropertyiv(). Positive and negative values are accepted for x and y. The parts of a window that fall outside the boundaries of the display are simply clipped out.

The default value is (0, 0).

KD_WINDOWPROPERTY_SOURCE_POSITION_QNX

Synopsis:

#define KD_WINDOWPROPERTY_SOURCE_POSITION_QNX 1005

Used to position the source rectangle within a larger window surface. It is an array of two KDint32 representing the x and y buffer coordinates of the upper-left corner of the source rectangle. To set it, use kdSetWindowPropertyiv() and read with kdGetWindowPropertyiv(). Only positive values are accepted for x and y.

The rectangle defined by this property and the KD_WINDOWPROPERTY_SOURCE_SIZE_QNX must be completely within the window surface. The default value is (0, 0).

When a window surface size is larger than the window size, an application can render more content than is displayed and use the window source position to move inside the window surface. Scrolling can be achieved without redrawing the buffer as long as the window source rectangle stays inside the window surface.

KD_WINDOWPROPERTY_SOURCE_SIZE_QNX

Synopsis:

#define KD_WINDOWPROPERTY_SOURCE_SIZE_QNX 1006

Sets a window's source rectangle size. It is an array of two KDint32 representing the width and height of the window's source rectangle. To set it use kdSetWindowPropertyiv() and read it with kdGetWindowPropertyiv(). The x and y values must be positive. The source size can be smaller or larger than the window size. The rectangle defined by this property and KD_WINDOWPROPERTY_SOURCE_POSITION_QNX must be completely within the window surface. The default value is the window size.

Choosing a source rectangle size that is smaller than the window size will produce a digital zoom in effect. Using a source rectangle size that is larger than the window size will produce a zoom out effect.

KD_WINDOWPROPERTY_SURFACE_SIZE_QNX

Synopsis:

#define KD_WINDOWPROPERTY_SURFACE_SIZE_QNX 1007

Sets the size of a window's buffers. It is an array of two KDint32 representing the width and height of the window's surfaces. To set it use kdSetWindowPropertyiv() and read it with kdGetWindowPropertyiv(). Both the width and height elements must be non-zero positive numbers. The surface size can be larger than the window size and window source size, but cannot be smaller than the window source size. The default value is the window source size.

When a window surface size is larger than the window size, an application can render more content than is displayed and can use the window source position to move inside the window surface. Scrolling can be achieved without redrawing the buffer as long as the window source rectangle stays inside the window surface.

KD_WINDOWPROPERTY_ALPHA_QNX
Window global transparency.

Synopsis:

#define KD_WINDOWPROPERTY_ALPHA_QNX 1008

Used to set the global transparency of a window. The value must be an array of a single KDint32 between 0 and 255 inclusively. To set it use kdSetWindowPropertyiv() and read it with kdGetWindowPropertyiv().

The default value is opaque, or 255.

KD_WINDOWPROPERTY_DELEGATE_POINTER_QNX
Specify the userptr value supplied in delegate notification events.

Synopsis:

#define KD_WINDOWPROPERTY_DELEGATE_POINTER_QNX 1009

It is an array of a single KDint32. To set it use kdSetWindowPropertyiv() and read it with kdGetWindowPropertyiv(). The value of this property is user-defined.

The default value is 0, or KD_NULL.

KD_WINDOWPROPERTY_DELEGATE_QNX
Indicates whether a window is a delegate or not, or if a window is handled by a delegate or not.

Synopsis:

#define KD_WINDOWPROPERTY_DELEGATE_QNX 1010

In the first case, it is an array of a single KDboolean. To set it use kdSetWindowPropertybv() and read it with kdGetWindowPropertybv().

The boolean has the value KD_TRUE if the window is a delegate, or KD_FALSE if it is not. The default value is KD_FALSE. When a window is handled by a delegate window, the delegate property is an array of a single KDint32 that contains the KDWindow pointer of that delegate window, which you can set with kdSetWindowPropertyiv() and read with kdGetWindowPropertyiv().

The default value is 0, or KD_NULL.

Normally, a thread starts by setting this property to KD_TRUE to become a delegate and start receiving notifications when other windows are created. The thread can choose to respond to these events by setting the newly created window's delegate property to the delegate window's KDWindow pointer. Once a window is handled by a delegate, the delegate thread will receive notifications when the window is realized, closed, or when window properties are changed. The delegate thread is allowed to change window properties, send events to windows, and close windows that it handles. It can also take over the compositing tasks normally handled by the Composition Manager to perform more sophisticated compositing effects.

KD_WINDOWPROPERTY_SOURCE_ALPHA_QNX
Indicates whether a window has per-pixel transparency or not.

Synopsis:

#define KD_WINDOWPROPERTY_SOURCE_ALPHA_QNX 1011

It is an array of a single KDboolean. You can set it with kdSetWindowPropertybv() and read it with kdGetWindowPropertybv(). The boolean has the value KD_TRUE if the window's alpha channel should be used to set transparency, otherwise KD_FALSE. The default value is KD_FALSE.

Setting this property to true enables per-pixel transparency for this window in the QNX Composition Manager. The application is responsible for drawing the correct alpha values in its alpha channel.

KD_WINDOWPROPERTY_SENSITIVE_QNX
Indicates whether a window will get input focus when a pointer click event is detected.

Synopsis:

#define KD_WINDOWPROPERTY_SENSITIVE_QNX 1012

It is an array of a single KDboolean. You can set it with kdSetWindowPropertybv() and read it with kdGetWindowPropertybv(). The boolean has the value KD_TRUE if the window gets input focus when clicked on, otherwise KD_FALSE.

The default value is KD_TRUE.

KD_WINDOWPROPERTY_MANAGED_QNX
Used by delegates who wish to handle the compositing of windows instead of the Composition Manager.

#define KD_WINDOWPROPERTY_MANAGED_QNX 1013

It is an array of a single KDboolean. You can set it with kdSetWindowPropertybv() and read it with kdGetWindowPropertybv(). The default value is KD_FALSE, indicating that the window is composited by the QNX Composition manager.

When a window is managed by a delegate, it is removed from the Composition Manager's scene. The delegate is responsible for compositing all of its managed windows. The delegate thread will receive notifications whenever managed windows post updates.

KD_WINDOWPROPERTY_SWAP_INTERVAL_QNX
Used to set a swap interval for a window.

#define KD_WINDOWPROPERTY_SWAP_INTERVAL_QNX 1014

The swap interval is the minimum number of video frame periods per buffer swap. The value must be an array of a single KDint32 between 0 and 255 inclusively. You can set it with kdSetWindowPropertyiv() and read it with kdGetWindowPropertyiv().

The default value is 1.

KD_WINDOWPROPERTY_POINTER_FOCUS_QNX
Indicates if a window has pointer focus.

#define KD_WINDOWPROPERTY_POINTER_FOCUS_QNX 1015

It is an array of a single KDboolean. You can set it with kdSetWindowPropertybv() and read it with kdGetWindowPropertybv(). The boolean has the value KD_TRUE if the window has pointer focus assigned to it, otherwise KD_FALSE.

The default value is KD_FALSE.


Note: When pointer focus is assigned to a window, general focus cannot be set via mouse click.

KD_WINDOWPROPERTY_BRIGHTNESS_QNX
Indicates brightness level of the window.

#define KD_WINDOWPROPERTY_BRIGHTNESS_QNX 1016

Used to set the brightness level of a window. The value must be an array of a single KDint32 between -255 and 255 inclusively. To set it use kdSetWindowPropertyiv() and read it with kdGetWindowPropertyiv().

The default brightness level is 0.

KD_WINDOWPROPERTY_CONTRAST_QNX
Indicates contrast level of the window.

#define KD_WINDOWPROPERTY_CONTRAST_QNX 1017

Used to set the contrast level of a window. The value must be an array of a single KDint32 between -255 and 255 inclusively. To set it use kdSetWindowPropertyiv() and read it with kdGetWindowPropertyiv().

The default contrast level is 0.

KD_WINDOWPROPERTY_HUE_QNX
Indicates hue level of the window.

#define KD_WINDOWPROPERTY_HUE_QNX 1018

Used to set the hue level of a window. The value must be an array of a single KDint32 between -255 and 255 inclusively. To set it use kdSetWindowPropertyiv() and read it with kdGetWindowPropertyiv().

The default hue level is 0.

KD_WINDOWPROPERTY_SATURATION_QNX
Indicates saturation level of the window.

#define KD_WINDOWPROPERTY_SATURATION_QNX 1019

Used to set the saturation level of a window. The value must be an array of a single KDint32 between -255 and 255 inclusively. To set it use kdSetWindowPropertyiv() and read it with kdGetWindowPropertyiv().

The default saturation level is 0.

KD_WINDOWPROPERTY_LEVEL_QNX
Indicates the EGL level of the window.

#define KD_WINDOWPROPERTY_LEVEL_QNX 1020

Used to set the EGL level of a window. The value must be an array of a single KDint32 between 0 and 255 inclusively. To set it use kdSetWindowPropertyiv() and read it with kdGetWindowPropertyiv().

The default EGL level is 0.

KD_WINDOWPROPERTY_FREEZE_QNX
Indicates whether a window's updates are frozen.

#define KD_WINDOWPROPERTY_FREEZE_QNX 1021

It is an array of a single KDboolean. You can set it with kdSetWindowPropertybv() and read it with kdGetWindowPropertybv(). The boolean has the value KD_TRUE if the window's updates should be frozen, otherwise KD_FALSE. The default value is KD_FALSE.

Events:

KD_EVENT_WINDOW_CREATE_QNX
Notify delegates of the creation of a window.

Synopsis:

#define KD_EVENT_WINDOW_CREATE_QNX (KD_QNX_EVENT_UNDEFINED + 0)

This event is sent to all threads with windows registered as delegates that share the same display.

The event's userptr field is set to KD_NULL.

The event data is in the event->data.windowcreateqnx element of the event's data union, which has the following type:

typedef struct KDEventWindowCreateQNX {
            struct KDWindow *window;
            KDint32          valid;
            KDint32          flags;
            KDint32          egl_config;
            void            *userptr;
} KDEventWindowCreateQNX;

The egl_config field corresponds to the config argument supplied by the application to the kdCreateWindow() function. The userptr field corresponds to the eventuserptr argument supplied by the application to the kdCreateWindow() function. The window member is a local copy of the newly created window. It can be used anywhere a KDWindow pointer is required.

KD_EVENT_WINDOW_REALIZE_QNX
Notify delegates of the realization of a window.

Synopsis:

#define KD_EVENT_WINDOW_REALIZE_QNX (KD_EVENT_UNDEFINED_QNX + 1)

This event type signals a window's delegate that a window buffer has been created. There can be more than one realization notification if the application creates multiple buffers to support a window.

The event's userptr field is set to the window's delegate pointer.

The event data is in the event->data.windowrealizeqnx element of the event's data union, which has the following type:

typedef struct KDEventWindowRealizeQNX {
             struct KDWindow *window;
             int              sid;
} KDEventWindowRealizeQNX;
The sid field corresponds to a unique identifier for the buffer that was created. The delegate can use this sid to gain access to a window's buffer if it wants access the surface contents. The window member is a local copy of the window that was the subject of the realize request. It can be used anywhere a KDWindow pointer is required.
KD_EVENT_WINDOW_PROPERTY_QNX
Notify delegates of the change of a window's properties.

Synopsis:

#define KD_EVENT_WINDOW_PROPERTY_QNX (KD_EVENT_UNDEFINED_QNX + 2)

The event's userptr field is set to the window's delegate pointer.

The event data is in the event->data.windowpropertyqnx element of the event's data union, which has the following type:

typedef struct KDEventWindowPropertyQNX {
             struct KDWindow *window;
             KDint32          pname;
 } KDEventWindowPropertyQNX;

The pname field identifies which window property was affected by the change. The delegate can use the window and pname member to get the new value for the property. The window member is a local copy of the window that was the subject of the property change. It can be used anywhere a KDWindow pointer is required.

KD_EVENT_WINDOW_CLOSE_QNX
Notify delegates of the closing of a window.

Synopsis:

#define KD_EVENT_WINDOW_CLOSE_QNX (KD_EVENT_UNDEFINED_QNX + 3)

The event's userptr field is set to the window's delegate pointer.

The event data is in the event->data.windowcloseqnx element of the event's data union, which has the following type:

typedef struct KDEventWindowCloseQNX {
              struct KDWindow *window;
} KDEventWindowCloseQNX;

The window field is a local copy of the window that was closed. It should no longer be used wherever a KDWindow pointer is required because the window is closed at that point.

See also:

Working with External APIs, io-winmgr