Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/composition_manager/dev_guide/kd_qnx_window.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/composition_manager/dev_guide/kd_qnx_window.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/composition_manager/dev_guide/kd_qnx_window.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/composition_manager/dev_guide/kd_qnx_window.html on line 8

KD_QNX_window

The KD_QNX_window extension

Synopsis:

KD_QNX_window {
    kdSetWindowOrderQNX( KDWindow *window, KDWindow *above )
    kdPostWindowEventQNX( KDEvent *event, KDWindow *window )
    KD_QNX_WINDOWPROPERTY_CLASS
    KD_QNX_WINDOWPROPERTY_ID_STRING
    KD_QNX_WINDOWPROPERTY_DISPLAY
    KD_QNX_WINDOWPROPERTY_POSITION
    KD_QNX_WINDOWPROPERTY_SOURCE_POSITION
    KD_QNX_WINDOWPROPERTY_SOURCE_SIZE
    KD_QNX_WINDOWPROPERTY_SURFACE_SIZE
    KD_QNX_WINDOWPROPERTY_ALPHA
    KD_QNX_WINDOWPROPERTY_DELEGATE_POINTER
    KD_QNX_WINDOWPROPERTY_DELEGATE
    KD_QNX_WINDOWPROPERTY_SOURCE_ALPHA
    KD_QNX_WINDOWPROPERTY_SENSITIVE
    KD_QNX_WINDOWPROPERTY_MANAGED
    KD_QNX_WINDOWPROPERTY_POINTER_FOCUS
    KD_QNX_WINDOWPROPERTY_SWAP_INTERVAL
    KD_QNX_EVENT_WINDOW_CREATE
    KD_QNX_EVENT_WINDOW_REALIZE
    KD_QNX_EVENT_WINDOW_PROPERTY
    KD_QNX_EVENT_WINDOW_CLOSE
}
 

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_QNX_WINDOWPROPERTY_CLASS
Window class name.

Synopsis:

#define KD_QNX_WINDOWPROPERTY_CLASS 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_QNX_WINDOWPROPERTY_ID_STRING
A String representing the id of the window. The ID is used to identify the window.

Synopsis:

#define KD_QNX_WINDOWPROPERTY_ID_STRING 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_QNX_WINDOWPROPERTY_DISPLAY
Window display assignment.

Synopsis:

#define KD_QNX_WINDOWPROPERTY_DISPLAY 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_QNX_WINDOWPROPERTY_POSITION
Used to position a window within a display.

Synopsis:

#define KD_QNX_WINDOWPROPERTY_POSITION 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_QNX_WINDOWPROPERTY_SOURCE_POSITION

Synopsis:

#define KD_QNX_WINDOWPROPERTY_SOURCE_POSITION 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_QNX_WINDOWPROPERTY_SOURCE_SIZE 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_QNX_WINDOWPROPERTY_SOURCE_SIZE

Synopsis:

#define KD_QNX_WINDOWPROPERTY_SOURCE_SIZE 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_QNX_WINDOWPROPERTY_SOURCE_POSITION 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_QNX_WINDOWPROPERTY_SURFACE_SIZE

Synopsis:

#define KD_QNX_WINDOWPROPERTY_SURFACE_SIZE 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_QNX_WINDOWPROPERTY_ALPHA
Window global transparency.

Synopsis:

#define KD_QNX_WINDOWPROPERTY_ALPHA 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_QNX_WINDOWPROPERTY_DELEGATE_POINTER
Specify the userptr value supplied in delegate notification events.

Synopsis:

#define KD_QNX_WINDOWPROPERTY_DELEGATE_POINTER 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_QNX_WINDOWPROPERTY_DELEGATE
Indicates whether a window is a delegate or not, or if a window is handled by a delegate or not.

Synopsis:

#define KD_QNX_WINDOWPROPERTY_DELEGATE 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_QNX_WINDOWPROPERTY_SOURCE_ALPHA
Indicates whether a window has per-pixel transparency or not.

Synopsis:

#define KD_QNX_WINDOWPROPERTY_SOURCE_ALPHA 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_QNX_WINDOWPROPERTY_SENSITIVE
Indicates whether a window will get input focus when a pointer click event is detected.

Synopsis:

#define KD_QNX_WINDOWPROPERTY_SENSITIVE 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_QNX_WINDOWPROPERTY_MANAGED
Used by delegates who wish to handle the compositing of windows instead of the Composition Manager.

#define KD_QNX_WINDOWPROPERTY_MANAGED 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_QNX_WINDOWPROPERTY_SWAP_INTERVAL
Used to set a swap interval for a window.

#define KD_QNX_WINDOWPROPERTY_SWAP_INTERVAL 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_QNX_WINDOWPROPERTY_POINTER_FOCUS
Indicates if a window has pointer focus.

#define KD_QNX_WINDOWPROPERTY_POINTER_FOCUS 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.

Events:

KD_QNX_EVENT_WINDOW_CREATE
Notify delegates of the creation of a window.

Synopsis:

#define KD_QNX_EVENT_WINDOW_CREATE (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_QNX_EVENT_WINDOW_REALIZE
Notify delegates of the realization of a window.

Synopsis:

#define KD_QNX_EVENT_WINDOW_REALIZE (KD_QNX_EVENT_UNDEFINED + 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_QNX_EVENT_WINDOW_PROPERTY
Notify delegates of the change of a window's properties.

Synopsis:

#define KD_QNX_EVENT_WINDOW_PROPERTY (KD_QNX_EVENT_UNDEFINED + 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_QNX_EVENT_WINDOW_CLOSE
Notify delegates of the closing of a window.

Synopsis:

#define KD_QNX_EVENT_WINDOW_CLOSE (KD_QNX_EVENT_UNDEFINED + 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


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/composition_manager/dev_guide/kd_qnx_window.html on line 546

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/composition_manager/dev_guide/kd_qnx_window.html on line 546