当前位置: 首页>>代码示例>>C++>>正文


C++ IDirectFBDisplayLayer::CreateWindow方法代码示例

本文整理汇总了C++中IDirectFBDisplayLayer::CreateWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectFBDisplayLayer::CreateWindow方法的具体用法?C++ IDirectFBDisplayLayer::CreateWindow怎么用?C++ IDirectFBDisplayLayer::CreateWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDirectFBDisplayLayer的用法示例。


在下文中一共展示了IDirectFBDisplayLayer::CreateWindow方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createDirectFBWindow

void QDirectFbWindow::createDirectFBWindow()
{
    Q_ASSERT(!m_dfbWindow.data());

    DFBDisplayLayerConfig layerConfig;
    IDirectFBDisplayLayer *layer;

    layer = toDfbScreen(window())->dfbLayer();
    layer->GetConfiguration(layer, &layerConfig);

    DFBWindowDescription description;
    memset(&description,0,sizeof(DFBWindowDescription));
    description.flags = DFBWindowDescriptionFlags(DWDESC_WIDTH|DWDESC_HEIGHT|DWDESC_POSX|DWDESC_POSY|DWDESC_SURFACE_CAPS
                                                  |DWDESC_OPTIONS
                                                  |DWDESC_CAPS);
    description.width = qMax(1, window()->width());
    description.height = qMax(1, window()->height());
    description.posx = window()->x();
    description.posy = window()->y();

    if (layerConfig.surface_caps & DSCAPS_PREMULTIPLIED)
        description.surface_caps = DSCAPS_PREMULTIPLIED;
    description.pixelformat = layerConfig.pixelformat;

    description.options = DFBWindowOptions(DWOP_ALPHACHANNEL);
    description.caps = DFBWindowCapabilities(DWCAPS_DOUBLEBUFFER|DWCAPS_ALPHACHANNEL);

    DFBResult result = layer->CreateWindow(layer, &description, m_dfbWindow.outPtr());
    if (result != DFB_OK)
        DirectFBError("QDirectFbWindow: failed to create window", result);

    m_dfbWindow->SetOpacity(m_dfbWindow.data(), 0xff);
    m_inputHandler->addWindow(m_dfbWindow.data(), window());
}
开发者ID:KDE,项目名称:android-qt5-qtbase,代码行数:34,代码来源:qdirectfbwindow.cpp

示例2: createDirectFBWindow

void QDirectFbWindowEGL::createDirectFBWindow()
{
    // Use the default for the raster surface.
    if (window()->surfaceType() == QSurface::RasterSurface)
        return QDirectFbWindow::createDirectFBWindow();

    Q_ASSERT(!m_dfbWindow.data());

    DFBWindowDescription description;
    memset(&description, 0, sizeof(DFBWindowDescription));
    description.flags = DFBWindowDescriptionFlags(DWDESC_WIDTH | DWDESC_HEIGHT|
                                                  DWDESC_POSX | DWDESC_POSY|
                                                  DWDESC_PIXELFORMAT | DWDESC_SURFACE_CAPS);
    description.width = qMax(1, window()->width());
    description.height = qMax(1, window()->height());
    description.posx = window()->x();
    description.posy = window()->y();

    description.surface_caps = DSCAPS_GL;
    description.pixelformat = DSPF_RGB16;

    IDirectFBDisplayLayer *layer;
    layer = toDfbScreen(window())->dfbLayer();
    DFBResult result = layer->CreateWindow(layer, &description, m_dfbWindow.outPtr());
    if (result != DFB_OK)
        DirectFBError("QDirectFbWindow: failed to create window", result);

    m_dfbWindow->SetOpacity(m_dfbWindow.data(), 0xff);
    m_inputHandler->addWindow(m_dfbWindow.data(), window());
}
开发者ID:ghjinlei,项目名称:qt5,代码行数:30,代码来源:qdirectfb_egl.cpp

示例3: dfb_create_window

/* DFB API */
IDirectFBWindow* dfb_create_window (IDirectFB *dfb, int x, int y, int width, int height, gboolean isAlpha)
{
	DFBResult err;
	DFBWindowDescription dsc;
	IDirectFBWindow *window = NULL;
	IDirectFBDisplayLayer *layer = NULL;
	
	DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer));
	layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE);
	
	dsc.flags = DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT;
	dsc.posx = x;
	dsc.posy = y;
	dsc.width = width;
	dsc.height = height;
	if(isAlpha) {
		dsc.flags |= DWDESC_CAPS;
		dsc.caps   = DWCAPS_ALPHACHANNEL;
	}
	err = layer->CreateWindow (layer, &dsc, &window);
	if (err!=DR_OK) {
		ZError(DBG_INIT, "Failed  to dfb_create_window.");
		return NULL;
	}
	/* Set ZKPlayer to Bottom but upper ZImagePlayer */
	DFBCHECK(window->LowerToBottom(window));
	DFBCHECK(window->SetOpacity(window, 0x0));
	return window;
}
开发者ID:jamesyan84,项目名称:zbase,代码行数:30,代码来源:zkplayerutil.c

示例4: get_display_layer_window

int get_display_layer_window() {
    IDirectFB *dfb = NULL;
    IDirectFBDisplayLayer   *layer   = NULL;
    IDirectFBWindow         *window  = NULL;

    DFBWindowDescription desc;


    DFBCHECK(DirectFBInit(NULL, NULL));

    DFBCHECK(DirectFBCreate(&dfb));
    push_release(dfb,dfb->Release);
    DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer));
    push_release(layer, layer->Release);

    desc.flags = DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_POSX | DWDESC_POSY;

    desc.posx = desc.posy = desc.width = desc.height = 20;
    
    DFBCHECK(layer->CreateWindow(layer, &desc, &window));
    push_release(window, window->Release);

    /* check window */

    release_all();
    return 0;

}
开发者ID:iuridiniz,项目名称:eitv-lots,代码行数:28,代码来源:main.c

示例5: Java_vdr_mhp_awt_DFBWindowPeer_createDFBWindow

jlong Java_vdr_mhp_awt_DFBWindowPeer_createDFBWindow(JNIEnv* env, jobject obj, jlong nativeLayer, jint x, jint y, jint width, jint height) {
     IDirectFBDisplayLayer *layer = (IDirectFBDisplayLayer *)nativeLayer;
     IDirectFBWindow       *window;
     DFBWindowDescription  desc;

     if (!layer)
        layer=MhpOutput::System::self()->GetMainLayer();

     //printf("createDFBWindow %d, %d - %dx%d on layer %p ID %d\n", x, y, width, height, layer, layer->GetID());

     /*if (getenv( "MHP_NO_ALPHA" ))
          bgAlpha = 255;

     if (bgAlpha < 255) {
          desc.flags = DWDESC_CAPS;
          desc.caps  = DWCAPS_ALPHACHANNEL;
     }
     else
          desc.flags = 0;*/
          
     desc.flags=(DFBWindowDescriptionFlags)0;
     
     if (!getenv( "MHP_NO_ALPHA" )) {
          DFB_ADD_WINDOW_DESC(desc.flags, DWDESC_CAPS);
          desc.caps=DWCAPS_NONE;
          DFB_ADD_WINDOW_CAPS(desc.caps, DWCAPS_ALPHACHANNEL);
          DFB_ADD_WINDOW_CAPS(desc.caps, DWCAPS_DOUBLEBUFFER);
     }


     if (x >= 0) {
          DFB_ADD_WINDOW_DESC(desc.flags, DWDESC_POSX);
          desc.posx = x;
     }
     if (y >= 0) {
          DFB_ADD_WINDOW_DESC(desc.flags, DWDESC_POSY);
          desc.posy = y;
     }
     if (width > 0) {
          DFB_ADD_WINDOW_DESC(desc.flags, DWDESC_WIDTH);
          desc.width = width;
     }
     if (height > 0) {
          DFB_ADD_WINDOW_DESC(desc.flags, DWDESC_HEIGHT);
          desc.height = height;
     }
     

     try {
          window=layer->CreateWindow(desc);
     } catch (DFBException *e) {
         printf("DirectFB: Error %s, %s\n", e->GetAction(), e->GetResult());
         delete e;
         return 0;
     }
      int ww,hh;window->GetSize(&ww, &hh);
     //printf("Created window %p, size %dx%d\n", window, ww, hh);
     
     return (jlong )window;
}
开发者ID:BackupTheBerlios,项目名称:mhpforvdr-svn,代码行数:60,代码来源:window.c

示例6: DFBCHECK

/** Opens application window and return pointer to offscreen buffer for  */
char *directfbapp_open_window() {

    DFBWindowDescription wdesc;
    DFBDisplayLayerConfig lconfig;
    static char *argv_array[] = {
        "CVM",
        "--dfb:system=FBDev"
            ",force-windowed"   /* use windows instead of surfaces */
            ",no-vt-switch"     /* do not switch between Linux' VT */
            ",no-cursor"        /* do not use pointer */
            // ",no-deinit-check" /* do not check for deinit */
        ,NULL
    };
    int argc = sizeof argv_array / sizeof argv_array[0] - 1;
    char **argv = argv_array;
    IDirectFBDisplayLayer *dlayer;
    char *dst;
    int pitch;
    unsigned int win_id;
    int win_x, win_y;

    DFBCHECK(DirectFBInit(&argc, &argv));
    DFBCHECK(DirectFBCreate(&dfb));
    DFBCHECK(dfb->SetCooperativeLevel(dfb, DFSCL_NORMAL));

    DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &dlayer));
    DFBCHECK(dlayer->GetConfiguration(dlayer, &lconfig));
    wdesc.caps = DWCAPS_DOUBLEBUFFER;
    wdesc.surface_caps = DSCAPS_DOUBLE;
    wdesc.pixelformat = DSPF_RGB16;
    wdesc.width = CHAM_WIDTH;
    wdesc.height = CHAM_HEIGHT;
    wdesc.flags = DWDESC_CAPS | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_PIXELFORMAT |
        DWDESC_SURFACE_CAPS;
    DFBCHECK(dlayer->CreateWindow(dlayer, &wdesc, &window));
    releaseInterface(dlayer);
    if ((lconfig.flags & (DLCONF_WIDTH | DLCONF_HEIGHT)) == (DLCONF_WIDTH | DLCONF_HEIGHT)) {
        DFBCHECK(window->GetID(window, &win_id));
        set_win_position(win_id, lconfig.width, lconfig.height, win_x, win_y);
        DFBCHECK(window->MoveTo(window, win_x, win_y));
    }
    DFBCHECK(window->RaiseToTop(window));
    DFBCHECK(window->SetOpacity(window, 0xff));
    DFBCHECK(window->RequestFocus(window));
    DFBCHECK(window->GetSurface(window, &screen));
    DFBCHECK(screen->GetSize(screen, &screen_width, &screen_height));
    DFBCHECK(screen->Lock(screen, DSLF_WRITE, (void**)(void*)&dst, &pitch));
    if (pitch != (int)sizeof(gxj_pixel_type) * screen_width) {
        REPORT_ERROR(LC_LOWUI,
            "Invalid pixel format: Supports only 16-bit, 5:6:5 display");
        goto dfb_err;
    }
    return dst;

dfb_err:;
    directfbapp_finalize();
    exit(1); /* TODO: exit from Java */
    /* return NULL; */
}
开发者ID:jiangxilong,项目名称:yari,代码行数:60,代码来源:directfbapp_export.c

示例7: createWindow

void QDirectFBWindowSurface::createWindow(const QRect &rect)
{
    IDirectFBDisplayLayer *layer = screen->dfbDisplayLayer();
    if (!layer)
        qFatal("QDirectFBWindowSurface: Unable to get primary display layer!");

    updateIsOpaque();

    DFBWindowDescription description;
    memset(&description, 0, sizeof(DFBWindowDescription));

    description.flags = DWDESC_CAPS|DWDESC_HEIGHT|DWDESC_WIDTH|DWDESC_POSX|DWDESC_POSY|DWDESC_SURFACE_CAPS|DWDESC_PIXELFORMAT;
    description.caps = DWCAPS_NODECORATION;
    description.surface_caps = DSCAPS_NONE;
    imageFormat = screen->pixelFormat();

    if (!(surfaceFlags() & Opaque)) {
        imageFormat = screen->alphaPixmapFormat();
        description.caps |= DWCAPS_ALPHACHANNEL;
#if (Q_DIRECTFB_VERSION >= 0x010200)
        description.flags |= DWDESC_OPTIONS;
        description.options |= DWOP_ALPHACHANNEL;
#endif
    }
    description.pixelformat = QDirectFBScreen::getSurfacePixelFormat(imageFormat);
    description.posx = rect.x();
    description.posy = rect.y();
    description.width = rect.width();
    description.height = rect.height();

    if (QDirectFBScreen::isPremultiplied(imageFormat))
        description.surface_caps = DSCAPS_PREMULTIPLIED;

    if (screen->directFBFlags() & QDirectFBScreen::VideoOnly)
        description.surface_caps |= DSCAPS_VIDEOONLY;

    DFBResult result = layer->CreateWindow(layer, &description, &dfbWindow);

    if (result != DFB_OK)
        DirectFBErrorFatal("QDirectFBWindowSurface::createWindow", result);

    if (window()) {
        if (window()->windowFlags() & Qt::WindowStaysOnTopHint) {
            dfbWindow->SetStackingClass(dfbWindow, DWSC_UPPER);
        }
        DFBWindowID winid;
        result = dfbWindow->GetID(dfbWindow, &winid);
        if (result != DFB_OK) {
            DirectFBError("QDirectFBWindowSurface::createWindow. Can't get ID", result);
        } else {
            window()->setProperty("_q_DirectFBWindowID", winid);
        }
    }

    Q_ASSERT(!dfbSurface);
    dfbWindow->GetSurface(dfbWindow, &dfbSurface);
}
开发者ID:Blizzard,项目名称:qt4,代码行数:57,代码来源:qdirectfbwindowsurface.cpp

示例8: QPlatformWindow

QT_BEGIN_NAMESPACE

QDirectFbWindow::QDirectFbWindow(QWidget *tlw, QDirectFbInput *inputhandler)
    : QPlatformWindow(tlw), m_inputHandler(inputhandler)
{
    DFBDisplayLayerConfig layerConfig;
    IDirectFBDisplayLayer *layer;

    layer = toDfbScreen(tlw)->dfbLayer();
    toDfbScreen(tlw)->dfbLayer()->GetConfiguration(layer, &layerConfig);

    DFBWindowDescription description;
    memset(&description,0,sizeof(DFBWindowDescription));
    description.flags = DFBWindowDescriptionFlags(DWDESC_WIDTH|DWDESC_HEIGHT|DWDESC_POSX|DWDESC_POSY|DWDESC_SURFACE_CAPS
#if DIRECTFB_MINOR_VERSION >= 1
                                                  |DWDESC_OPTIONS
#endif
                                                  |DWDESC_CAPS);
    description.width = tlw->width();
    description.height = tlw->height();
    description.posx = tlw->x();
    description.posy = tlw->y();

    if (layerConfig.surface_caps & DSCAPS_PREMULTIPLIED)
        description.surface_caps = DSCAPS_PREMULTIPLIED;
    description.pixelformat = layerConfig.pixelformat;

#if DIRECTFB_MINOR_VERSION >= 1
    description.options = DFBWindowOptions(DWOP_ALPHACHANNEL);
#endif
    description.caps = DFBWindowCapabilities(DWCAPS_DOUBLEBUFFER|DWCAPS_ALPHACHANNEL);
    description.surface_caps = DSCAPS_PREMULTIPLIED;

    DFBResult result = layer->CreateWindow(layer, &description, m_dfbWindow.outPtr());
    if (result != DFB_OK) {
        DirectFBError("QDirectFbGraphicsSystemScreen: failed to create window",result);
    }

    m_dfbWindow->SetOpacity(m_dfbWindow.data(), 0xff);

    setVisible(widget()->isVisible());

    m_inputHandler->addWindow(m_dfbWindow.data(), tlw);
}
开发者ID:Suneal,项目名称:qt,代码行数:44,代码来源:qdirectfbwindow.cpp

示例9: main


//.........这里部分代码省略.........

          bgsurface->SetColor( bgsurface, 0xCF, 0xCF, 0xFF, 0xFF );
          bgsurface->DrawString( bgsurface,
                                 "Move the mouse over a window to activate it.",
                                 -1, 10, 0, DSTF_LEFT | DSTF_TOP );

          bgsurface->SetColor( bgsurface, 0xFF, 0xCF, 0xFF, 0xFF );
          bgsurface->DrawString( bgsurface,
                    "You can drag them around, too, if you want.",
                                 -1, 10 , 40, DSTF_LEFT | DSTF_TOP );

          bgsurface->SetColor( bgsurface, 0xCF, 0xCF, 0xFF, 0xFF );
	  bgsurface->DrawString( bgsurface,
                    "The one with funky stuff happening and things flying around is an evas.",
                                 -1, 10, 80, DSTF_LEFT | DSTF_TOP );




          layer->SetBackgroundImage( layer, bgsurface );
          layer->SetBackgroundMode( layer, DLBM_IMAGE );
     }
     {
	  DFBWindowDescription desc;
	  desc.flags = ( DWDESC_POSX | DWDESC_POSY |
                         DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_CAPS );

	  desc.posx = 20;
          desc.posy = 120;
          desc.width = 200;
          desc.height = 200;
	  desc.caps = DWCAPS_ALPHACHANNEL;

          DFBCHECK( layer->CreateWindow( layer, &desc, &window2 ) );
          window2->GetSurface( window2, &window_surface2 );

          window2->SetOpacity( window2, 0xFF );

          window2->CreateEventBuffer( window2, &buffer );

	  {
	     window_surface2->SetColor( window_surface2,
		   0x00, 0x30, 0x10, 0xc0 );
	     window_surface2->DrawRectangle( window_surface2, 0, 0,
		   desc.width, desc.height );
	     window_surface2->SetColor( window_surface2,
		   0x80, 0xa0, 0x00, 0x90 );
	     window_surface2->FillRectangle( window_surface2, 1, 1,
		   desc.width-2, desc.height-2 );


	     DFBCHECK(window_surface2->SetFont(window_surface2, font ));
	     window_surface2->SetColor( window_surface2, 0xCF, 0xFF, 0xCF, 0xFF );

	     window_surface2->DrawString( window_surface2,
		   "Pants!",
		   -1,10, fontheight + 5, DSTF_LEFT | DSTF_TOP );

	  }

          window_surface2->Flip( window_surface2, NULL, 0 );
     }

     {
          DFBWindowDescription desc;
开发者ID:Limsik,项目名称:e17,代码行数:66,代码来源:evas_directfb_window.c

示例10: 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;
}
开发者ID:geekmaster,项目名称:buildroot-kindle,代码行数:69,代码来源:dfbtest_window_surface.c

示例11: 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 );
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:89,代码来源:dfbtest_resize.c

示例12: main


//.........这里部分代码省略.........
	
	//vibrate test for 3 second
	test_vibrate(3);
	
	//dfb init
	DFBCHECK(DirectFBInit(&argc, &argv));
	DFBCHECK(DirectFBCreate(&dfb));
	
	font_desc.flags = DFDESC_HEIGHT;
	font_desc.height = font_size;
	DFBCHECK(dfb->CreateFont( dfb, font_file,  &font_desc, &font));
	DFBCHECK(font->GetHeight(font, &font_height));
	DFBCHECK(dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer));
	DFBCHECK(layer->GetConfiguration( layer, &config ));
	// DFBCHECK(layer->SetRotation( layer, 180 ));
	//set window size
	screen_width = config.width;
	screen_height = config.height;
	mic_width = screen_width / 20;
	camera_window_width = (screen_width - mic_width) / 2;
	camera_window_height = screen_height / 2;
	case_width = screen_width - mic_width - camera_window_width;
	case_name_align = font_size;
	case_result_align = 7 * font_size;
	
	//create tp window
	dwsc.flags = DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_CAPS;
	dwsc.posx = 0;
	dwsc.posy = 0;
	dwsc.width = screen_width;
	dwsc.height = screen_height;
	dwsc.caps = DWCAPS_ALPHACHANNEL;
	
	DFBCHECK(layer->CreateWindow(layer, &dwsc, &window_tp));
	DFBCHECK(window_tp->GetSurface(window_tp, &surface_tp));
	DFBCHECK(window_tp->SetOptions(window_tp, DWOP_ALPHACHANNEL));
	DFBCHECK(window_tp->SetStackingClass(window_tp, DWSC_UPPER));
	DFBCHECK(window_tp->RaiseToTop(window_tp));
	DFBCHECK(surface_tp->Clear(surface_tp, 0, 0, 0, 0));
	DFBCHECK(surface_tp->SetColor(surface_tp, 0, 0xff, 0, 0xff));
	DFBCHECK(window_tp->SetOpacity(window_tp, 0xff));
	
	//config camera window
	dwsc.flags = DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT;
	dwsc.posx = case_width + mic_width;
	dwsc.posy = 0;
	dwsc.width = camera_window_width;
	dwsc.height = screen_height;
	
	DFBCHECK(layer->CreateWindow( layer, &dwsc, &window_camera ));
	DFBCHECK(window_camera->GetSurface(window_camera, &windowsurface));
	DFBCHECK(windowsurface->SetColor(windowsurface, 0, 0, 0, 0xff));
	DFBCHECK(windowsurface->FillRectangle(windowsurface, 0, 0, camera_window_width , screen_height));
	DFBCHECK(windowsurface->Flip(windowsurface, NULL, 0));
	DFBCHECK(window_camera->SetOpacity( window_camera, 0xff ));
	
	drawRGB(windowsurface, 0, screen_height / 2, camera_window_width, screen_height /2);
	
	rect.x = 0;
	rect.y = 0;
	rect.w = camera_window_width;
	rect.h = camera_window_height;
	DFBCHECK(windowsurface->GetSubSurface(windowsurface, &rect, &surface_camera));
	
	rect.x = 0;
	rect.y = screen_height / 4 * 3;
开发者ID:vonfritz,项目名称:owl,代码行数:67,代码来源:test_pcba.c


注:本文中的IDirectFBDisplayLayer::CreateWindow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。