DirectFB:Notes

来源:互联网 发布:js字符串过滤空格 编辑:程序博客网 时间:2024/06/05 00:07

 

DFBWindow Focus and Input Control

From DirectFBWiki


DBFWindows will get focus or keyboard input based on the window manager rerouting the input into the window, for example if the mouse moves over a window, it will receive the DWET_GOT_FOCUS message, and when the cursor leaves the window it will receive the DWET_LOSTFOCUS.

If you want to control this further, here are some things good to know.

You could tell a specific window to always receive the mouse events using the IDirectFBWindow::GrabPointer (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_GrabPointer.html) interface. There's a corresponding IDirectFBWindow::UngrabPointer (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_UngrabPointer.html) interface to release this relationship.

If you want to force all keyboard input to a specific window, use the IDirectFBWindow::GrabKeyboard (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_GrabKeyboard.html) interface, and to release this relationship, use the IDirectFBWindow::UngrabKeyboard (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_UngrabKeyboard.html) interface. If you want specific keys to trigger the focus to a specific window, use the IDirectFBWindow::GrabKey (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_GrabKey.html) interface, and to release the key, the IDirectFBWindow::UngrabKey (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_UngrabKey.html) interface.

You could force the specific focus to a window using the IDirectFBWindow::RequestsFocus (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_RequestFocus.html) interface.

If you want to create a window that is totally transparent to focus and input control, in other words will never receive focus or input events, then set the DFBWindowOptions (http://www.directfb.org/docs/DirectFB_Reference/types.html#DFBWindowOptions) flag called DWOP_GHOST using the IDirectFBWindow::SetOptions (http://www.directfb.org/docs/DirectFB_Reference/IDirectFBWindow_SetOptions.html) interface. For example the DFBCursor is using this technique.

 
 
 

Notes:Software fallback warnings

From DirectFBWiki

Enable software fallback warnings

The run-time option "software-warn" makes DirectFB show warnings whenever a software fallback method is used.

root@embedded:~> DFBARGS=software-warn gtk-demo                                                                                                                                               [...]                                                                                                                                                                                                                                   (!!!)  *** WARNING [Blit          (  23, 270-   1x   8) ARGB, flags 0x00000005, color 0xff000000, source ( 123,   0) ARGB] *** [generic.c:7945 in gBlit()]

 

Use the mechanism to see all rendering operations

Adding "no-hardware" will cause software fallbacks all the time, hence showing every rendering operation made.

root@embedded:~> DFBARGS=software-warn,no-hardware gtk-demo                                                                                                                         [...]                                                                                                                                                                                                                                  (!!!)  *** WARNING [FillRectangle (   2, 264- 200x  20) ARGB, flags 0x00000000, color 0xffffffff] *** [generic.c:7823 in gFillRectangle()]                     (!!!)  *** WARNING [Blit          (   0,   0- 123x   9) ARGB, flags 0x00000000, color 0x00000000, source (   0,   0) ARGB] *** [generic.c:7945 in gBlit()] (!!!)  *** WARNING [Blit          (  23, 270-   1x   8) ARGB, flags 0x00000005, color 0xff000000, source ( 123,   0) ARGB] *** [generic.c:7945 in gBlit()]
原创粉丝点击