本文整理汇总了C++中IDirectFBWindow::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectFBWindow::Release方法的具体用法?C++ IDirectFBWindow::Release怎么用?C++ IDirectFBWindow::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDirectFBWindow
的用法示例。
在下文中一共展示了IDirectFBWindow::Release方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static DFBResult
Test_HideWindow( IDirectFBDisplayLayer *layer, void *arg )
{
IDirectFBWindow *window;
D_ASSERT( m_toplevel_id != 0 );
/*
* Get the top level window
*/
_T( layer->GetWindow( layer, arg ? (unsigned long) arg : m_toplevel_id, &window ) );
/*
* Hide it
*/
SHOW_TEST( "SetOpacity( 0 )..." );
_T( window->SetOpacity( window, 0 ) );
SHOW_RESULT( "...SetOpacity( 0 ) done." );
/*
* Show it again
*/
SHOW_TEST( "SetOpacity( 0xff )..." );
_T( window->SetOpacity( window, 0xff ) );
SHOW_RESULT( "...SetOpacity( 0xff ) done." );
window->Release( window );
return DFB_OK;
}
示例2: releaseWindow
void DFBDeviceScreen::releaseWindow(void* win) {
set<IDirectFBWindow*>::iterator i;
IDirectFBWindow* w;
w = (IDirectFBWindow*)win;
pthread_mutex_lock(&winMutex);
if (windowPool != NULL) {
i = windowPool->find(w);
if (i != windowPool->end()) {
windowPool->erase(i);
pthread_mutex_unlock(&winMutex);
} else {
pthread_mutex_unlock(&winMutex);
}
} else {
pthread_mutex_unlock(&winMutex);
}
w->Destroy(w);
w->Release(w);
win = NULL;
w = NULL;
}
示例3: setPermanentState
void QDirectFBWindowSurface::setPermanentState(const QByteArray &state)
{
const char *ptr = state.constData();
IDirectFBDisplayLayer *layer = screen->dfbDisplayLayer();
SurfaceFlags flags;
memcpy(&flags, ptr, sizeof(SurfaceFlags));
setSurfaceFlags(flags);
ptr += sizeof(SurfaceFlags);
DFBWindowID id;
memcpy(&id, ptr, sizeof(DFBWindowID));
if (dfbSurface)
dfbSurface->Release(dfbSurface);
if (id != (DFBWindowID)-1) {
IDirectFBWindow *dw;
layer->GetWindow(layer, id, &dw);
if (dw->GetSurface(dw, &dfbSurface) != DFB_OK)
dfbSurface = 0;
dw->Release(dw);
}
else {
dfbSurface = 0;
}
}
示例4: DirectFBInit
int
main( int argc, char *argv[] )
{
DFBResult ret;
IDirectFB *dfb;
IDirectFBDisplayLayer *layer;
/* Initialize DirectFB. */
ret = DirectFBInit( &argc, &argv );
if (ret) {
D_DERROR( ret, "DFBTest/Window_Surface: DirectFBInit() failed!\n" );
return ret;
}
/* Create super interface. */
ret = DirectFBCreate( &dfb );
if (ret) {
D_DERROR( ret, "DFBTest/Window_Surface: DirectFBCreate() failed!\n" );
return ret;
}
dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer );
while (true) {
DFBWindowDescription desc;
IDirectFBWindow *window;
IDirectFBSurface *surface;
desc.flags = DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_CAPS;
desc.posx = 150;
desc.posy = 150;
desc.width = 300;
desc.height = 300;
desc.caps = DWCAPS_ALPHACHANNEL;
ret = layer->CreateWindow( layer, &desc, &window );
if (ret) {
D_DERROR( ret, "DFBTest/Window_Surface: CreateWindow() failed!\n" );
return ret;
}
window->GetSurface( window, &surface );
D_INFO( "Created window and surface, going to release window... (in 2 seconds)\n" );
usleep( 2000000 );
D_INFO("Releasing window...\n");
window->Release( window );
D_INFO("Window released, going to release surface... (in 2 seconds)\n");
usleep( 2000000 );
D_INFO("Releasing surface...\n");
surface->Release( surface );
D_INFO("Surface released, done.\n");
usleep( 5000000 );
}
/* Shutdown DirectFB. */
dfb->Release( dfb );
return ret;
}
示例5: CreateInputBuffer
static void
TestResize( IDirectFB *dfb )
{
DFBResult ret;
DirectThread *thread;
DFBWindowDescription desc;
IDirectFBDisplayLayer *layer;
IDirectFBWindow *window;
IDirectFBSurface *surface;
DFBInputEvent evt;
IDirectFBEventBuffer *keybuffer;
quit = 0;
/* Create an input buffer for key events */
ret = dfb->CreateInputEventBuffer( dfb, DICAPS_KEYS,
DFB_FALSE, &keybuffer);
if (ret) {
D_DERROR( ret, "DFBTest/Resize: CreateInputBuffer() failed!\n" );
return;
}
ret = dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer );
if (ret) {
D_DERROR( ret, "DFBTest/Resize: Failed to get display layer!\n" );
keybuffer->Release( keybuffer );
return;
}
desc.flags = DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_PIXELFORMAT;
desc.width = 500;
desc.height = 500;
desc.pixelformat = DSPF_ARGB;
ret = layer->CreateWindow( layer, &desc, &window );
if (ret) {
D_DERROR( ret, "DFBTest/Resize: CreateWindow() failed!\n" );
keybuffer->Release( keybuffer );
layer->Release( layer );
return;
}
ret = window->GetSurface( window, &surface );
if (ret) {
D_DERROR( ret, "DFBTest/Resize: GetSurface() failed!\n" );
keybuffer->Release( keybuffer );
window->Release( window );
layer->Release( layer );
return;
}
thread = direct_thread_create( DTT_DEFAULT, TestThread, surface, "Test" );
while (!quit) {
ret = window->Resize( window, 500, 400 );
if (ret)
D_DERROR( ret, "DFBTest/Resize: Resize() failed!\n" );
ret = window->Resize( window, 500, 500 );
if (ret)
D_DERROR( ret, "DFBTest/Resize: Resize() failed!\n" );
/* Process keybuffer */
while (keybuffer->GetEvent( keybuffer, DFB_EVENT(&evt)) == DFB_OK)
{
if (evt.type == DIET_KEYPRESS) {
switch (DFB_LOWER_CASE(evt.key_symbol)) {
case DIKS_ESCAPE:
case DIKS_SMALL_Q:
case DIKS_BACK:
case DIKS_STOP:
case DIKS_EXIT:
/* Quit main loop & test thread */
quit = 1;
direct_thread_join(thread);
break;
default:
break;
}
}
}
}
keybuffer->Release( keybuffer );
surface->Release( surface );
window->Release( window );
layer->Release( layer );
}