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


C++ D_DERROR函数代码示例

本文整理汇总了C++中D_DERROR函数的典型用法代码示例。如果您正苦于以下问题:C++ D_DERROR函数的具体用法?C++ D_DERROR怎么用?C++ D_DERROR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: main

int
main( int argc, char *argv[] )
{
     DFBResult  ret;
     IDirectFB *dfb;

     /* Initialize DirectFB. */
     ret = DirectFBInit( &argc, &argv );
     if (ret) {
          D_DERROR( ret, "DFBTest/Init: DirectFBInit() failed!\n" );
          return ret;
     }

     /* Create super interface. */
     ret = DirectFBCreate( &dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/Init: DirectFBCreate() failed!\n" );
          return ret;
     }

     /* Shutdown DirectFB. */
     ret = dfb->Release( dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/Init: IDirectFB::Release() failed!\n" );
          return ret;
     }

     return 0;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:29,代码来源:dfbtest_init.c

示例2: main

int
main( int argc, char *argv[] )
{
     DFBResult  ret;
     IDirectFB *dfb;

     /* Initialize DirectFB. */
     ret = DirectFBInit( &argc, &argv );
     if (ret) {
          D_DERROR( ret, "DFBTest/Resize: DirectFBInit() failed!\n" );
          return ret;
     }


     /* Create super interface. */
     ret = DirectFBCreate( &dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/Resize: DirectFBCreate() failed!\n" );
          return ret;
     }

     /* Required for keyboard access */
     dfb->SetCooperativeLevel( dfb, DFSCL_FULLSCREEN );

     TestResize( dfb );



     /* Shutdown DirectFB. */
     dfb->Release( dfb );


     return ret;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:34,代码来源:dfbtest_resize.c

示例3: Test_Clipboard_Get

static DFBResult
Test_Clipboard_Get( IDirectFB *dfb )
{
     DFBResult       ret;
     struct timeval  tv;
     char           *mime_type;
     void           *data;
     unsigned int    data_size;

     ret = dfb->GetClipboardTimeStamp( dfb, &tv );
     if (ret) {
          D_DERROR( ret, "DFBTest/Clipboard: IDirectFB::GetClipboardTimeStamp() failed!\n" );
          return ret;
     }

     ret = dfb->GetClipboardData( dfb, &mime_type, &data, &data_size );
     if (ret) {
          D_DERROR( ret, "DFBTest/Clipboard: IDirectFB::GetClipboardData() failed!\n" );
          return ret;
     }

     direct_log_printf( NULL, "Got clipboard data of mime type '%s' with data '%s'\n", mime_type, (const char*) data );
     direct_log_printf( NULL, "Got clipboard timestamp %ld.%06ld\n", tv.tv_sec, tv.tv_usec );

     return ret;
}
开发者ID:lelou6666,项目名称:DirectFB-1.6.3-ab,代码行数:26,代码来源:dfbtest_clipboard.c

示例4: wm_add_window

static DFBResult
wm_add_window( CoreWindowStack *stack,
               void            *wm_data,
               void            *stack_data,
               CoreWindow      *window,
               void            *window_data )
{
     DFBResult   ret;
     StackData  *sdata  = stack_data;
     WindowData *data   = window_data;
     WMData     *wmdata = wm_data;

     D_ASSERT( stack != NULL );
     D_ASSERT( wm_data != NULL );
     D_ASSERT( stack_data != NULL );
     D_ASSERT( window != NULL );
     D_ASSERT( window_data != NULL );

     D_MAGIC_ASSERT( sdata, StackData );
     D_MAGIC_ASSERT( sdata->context, UniqueContext );

     data->context = sdata->context;

     /* Create the unique window. */
     ret = unique_window_create( wmdata->core, window, data->context,
                                 window->caps, &window->config, &data->window );
     if (ret) {
          D_DERROR( ret, "WM/UniQuE: Could not create window!\n" );
          return ret;
     }

     /* Attach the global window listener. */
     ret = unique_window_attach_global( data->window,
                                        UNIQUE_WM_MODULE_WINDOW_LISTENER,
                                        data, &data->window_reaction );
     if (ret) {
          unique_window_unref( data->window );
          D_DERROR( ret, "WM/UniQuE: Could not attach global window listener!\n" );
          return ret;
     }

     /* Inherit all local references from the layer window. */
     ret = unique_window_inherit( data->window, window );
     unique_window_unref( data->window );
     if (ret) {
          unique_window_detach_global( data->window, &data->window_reaction );
          D_DERROR( ret, "WM/UniQuE: Could not inherit from core window!\n" );
          return ret;
     }

     unique_window_get_config( data->window, &window->config );


     D_MAGIC_SET( data, WindowData );

     return DFB_OK;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:57,代码来源:unique.c

示例5: args_alloc

DFBResult
ILayer_Requestor::GetPrimaryContext(
                    bool                                       activate,
                    CoreLayerContext                         **ret_context
)
{
    DFBResult           ret = DFB_OK;
    CoreLayerContext *context = NULL;
    char        args_static[FLUXED_ARGS_BYTES];
    char        return_args_static[FLUXED_ARGS_BYTES];
    CoreLayerGetPrimaryContext       *args = (CoreLayerGetPrimaryContext*) args_alloc( args_static, sizeof(CoreLayerGetPrimaryContext) );
    CoreLayerGetPrimaryContextReturn *return_args;

    if (!args)
        return (DFBResult) D_OOM();

    return_args = (CoreLayerGetPrimaryContextReturn*) args_alloc( return_args_static, sizeof(CoreLayerGetPrimaryContextReturn) );

    if (!return_args) {
        args_free( args_static, args );
        return (DFBResult) D_OOM();
    }

    D_DEBUG_AT( DirectFB_CoreLayer, "ILayer_Requestor::%s()\n", __FUNCTION__ );

    D_ASSERT( ret_context != NULL );

    args->activate = activate;

    ret = (DFBResult) CoreLayer_Call( obj, FCEF_NONE, CoreLayer_GetPrimaryContext, args, sizeof(CoreLayerGetPrimaryContext), return_args, sizeof(CoreLayerGetPrimaryContextReturn), NULL );
    if (ret) {
        D_DERROR( ret, "%s: CoreLayer_Call( CoreLayer_GetPrimaryContext ) failed!\n", __FUNCTION__ );
        goto out;
    }

    if (return_args->result) {
        /*D_DERROR( return_args->result, "%s: CoreLayer_GetPrimaryContext failed!\n", __FUNCTION__ );*/
        ret = return_args->result;
        goto out;
    }


    ret = (DFBResult) CoreLayerContext_Catch( core, return_args->context_ptr, &context );
    if (ret) {
         D_DERROR( ret, "%s: Catching context by ID %u failed!\n", __FUNCTION__, return_args->context_id );
         goto out;
    }

    *ret_context = context;


out:
    args_free( return_args_static, return_args );
    args_free( args_static, args );
    return ret;
}
开发者ID:lelou6666,项目名称:DirectFB-1.6.3-ab,代码行数:56,代码来源:CoreLayer.cpp

示例6: main

int
main( int argc, char *argv[] )
{
     DFBResult         ret;
     int               i;
     IDirectFB        *dfb;
     DFBInputDeviceID  device_id = 0;

     /* Initialize DirectFB. */
     ret = DirectFBInit( &argc, &argv );
     if (ret) {
          D_DERROR( ret, "DFBTest/Input: DirectFBInit() failed!\n" );
          return ret;
     }

     /* Parse arguments. */
     for (i=1; i<argc; i++) {
          const char *arg = argv[i];

          if (strcmp( arg, "-h" ) == 0 || strcmp (arg, "--help") == 0)
               return print_usage( argv[0] );
          else if (strcmp (arg, "-v") == 0 || strcmp (arg, "--version") == 0) {
               fprintf (stderr, "dfbtest_input version %s\n", DIRECTFB_VERSION);
               return false;
          }
          else if (strcmp (arg, "-d") == 0 || strcmp (arg, "--device") == 0) {
               if (++i == argc) {
                    print_usage (argv[0]);
                    return false;
               }

               if (!parse_id( argv[i], &device_id ))
                    return false;
          }
          else
               return print_usage( argv[0] );
     }

     /* Create super interface. */
     ret = DirectFBCreate( &dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/Input: DirectFBCreate() failed!\n" );
          return ret;
     }

     Test_Sensitivity( dfb, device_id );

     /* Shutdown DirectFB. */
     ret = dfb->Release( dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/Input: IDirectFB::Release() failed!\n" );
          return ret;
     }

     return 0;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:56,代码来源:dfbtest_input.c

示例7: args_alloc

DFBResult
ICore_Requestor::GetSurface(
                    u32                                        surface_id,
                    CoreSurface                              **ret_surface
)
{
    DFBResult           ret = DFB_OK;
    CoreSurface *surface = NULL;
    char        args_static[FLUXED_ARGS_BYTES];
    char        return_args_static[FLUXED_ARGS_BYTES];
    CoreDFBGetSurface       *args = (CoreDFBGetSurface*) args_alloc( args_static, sizeof(CoreDFBGetSurface) );
    CoreDFBGetSurfaceReturn *return_args;

    if (!args)
        return (DFBResult) D_OOM();

    return_args = (CoreDFBGetSurfaceReturn*) args_alloc( return_args_static, sizeof(CoreDFBGetSurfaceReturn) );

    if (!return_args) {
        args_free( args_static, args );
        return (DFBResult) D_OOM();
    }

    D_DEBUG_AT( DirectFB_CoreDFB, "ICore_Requestor::%s()\n", __FUNCTION__ );

    D_ASSERT( ret_surface != NULL );

    args->surface_id = surface_id;

    ret = (DFBResult) CoreDFB_Call( obj, FCEF_NONE, CoreDFB_GetSurface, args, sizeof(CoreDFBGetSurface), return_args, sizeof(CoreDFBGetSurfaceReturn), NULL );
    if (ret) {
        D_DERROR( ret, "%s: CoreDFB_Call( CoreDFB_GetSurface ) failed!\n", __FUNCTION__ );
        goto out;
    }

    if (return_args->result) {
        /*D_DERROR( return_args->result, "%s: CoreDFB_GetSurface failed!\n", __FUNCTION__ );*/
        ret = return_args->result;
        goto out;
    }


    ret = (DFBResult) CoreSurface_Catch( core, return_args->surface_ptr, &surface );
    if (ret) {
         D_DERROR( ret, "%s: Catching surface by ID %u failed!\n", __FUNCTION__, return_args->surface_id );
         goto out;
    }

    *ret_surface = surface;


out:
    args_free( return_args_static, return_args );
    args_free( args_static, args );
    return ret;
}
开发者ID:lelou6666,项目名称:DirectFB-1.6.3-ab,代码行数:56,代码来源:CoreDFB.cpp

示例8: main

int
main( int argc, char *argv[] )
{
     int                    i;
     DFBResult              ret;
     IDirectFB             *dfb;
     IDirectFBDisplayLayer *layer  = NULL;
     App                    apps[1];
     DFBDisplayLayerConfig  config;

     /* Parse arguments. */
     for (i=1; i<argc; i++) {
          if (!strcmp( argv[i], "-h" ))
               return show_usage( argv[0] );
     }

     /* Initialize DirectFB. */
     ret = DirectFBInit( &argc, &argv );
     if (ret) {
          D_DERROR( ret, "DFBTest/WindowFlip: DirectFBInit() failed!\n" );
          return ret;
     }

     /* Create super interface. */
     ret = DirectFBCreate( &dfb );
     if (ret) {
          D_DERROR( ret, "DFBTest/WindowFlip: DirectFBCreate() failed!\n" );
          return ret;
     }

     /* Get primary layer. */
     ret = dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &layer );
     if (ret) {
          D_DERROR( ret, "DFBTest/WindowFlip: IDirectFB::GetDisplayLayer( PRIMARY ) failed!\n" );
          goto out;
     }

     
     layer->GetConfiguration( layer, &config );

     app_init( &apps[0], layer, 100, 50, config.width-300, config.height-150, 0 );

     while (true) {
          direct_thread_sleep( 1000000 );

          app_update( &apps[0] );
     }


out:
     /* Shutdown DirectFB. */
     dfb->Release( dfb );

     return ret;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:55,代码来源:dfbtest_window_update.c

示例9: mDFB

gfxDirectFBSurface::gfxDirectFBSurface(const gfxIntSize& size, gfxImageFormat format) :
    mDFB(nsnull), mDFBSurface(nsnull)
{
    DFBResult             ret;
    DFBSurfaceDescription desc;

    if (!CheckSurfaceSize(size) || size.width <= 0 || size.height <= 0)
        return;

    /* Lightweight, getting singleton */
    ret = DirectFBCreate( &mDFB );
    if (ret) {
        D_DERROR( (DirectResult) ret, "gfxDirectFBSurface: DirectFBCreate() failed!\n" );
        return;
    }

    desc.flags  = (DFBSurfaceDescriptionFlags)( DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT );
    desc.width  = size.width;
    desc.height = size.height;

    switch (format) {
    case gfxASurface::ImageFormatARGB32:
        desc.pixelformat = DSPF_ARGB;
        break;

    case gfxASurface::ImageFormatRGB24:
        desc.pixelformat = DSPF_RGB32;
        break;

    case gfxASurface::ImageFormatA8:
        desc.pixelformat = DSPF_A8;
        break;

    case gfxASurface::ImageFormatA1:
        desc.pixelformat = DSPF_A1;
        break;

    default:
        D_BUG( "unknown format" );
        return;
    }

    ret = mDFB->CreateSurface( mDFB, &desc, &mDFBSurface );
    if (ret) {
        D_DERROR( (DirectResult) ret, "gfxDirectFBSurface: "
                  "IDirectFB::CreateSurface( %dx%d ) failed!\n", desc.width, desc.height );
        return;
    }

    cairo_surface_t *surface = cairo_directfb_surface_create(mDFB, mDFBSurface);

    Init(surface);
}
开发者ID:lofter2011,项目名称:Icefox,代码行数:53,代码来源:gfxDirectFBSurface.cpp

示例10: TestThread

static void *
TestThread( DirectThread *thread,
            void         *arg )
{
     DFBResult         ret;
     IDirectFBSurface *surface = arg;
     DFBRectangle      rect    = { 0, 0, 500, 1 };

     while (!quit) {
          void *data;
          int   pitch;

          ret = surface->Lock( surface, DSLF_WRITE, &data, &pitch );

          if (ret) {
               D_DERROR( ret, "DFBTest/Resize: Lock() failed!\n" );
               return NULL;
          }

          if (!data) {
               D_DERROR( ret, "DFBTest/Resize:invalid pointer!\n" );
               return NULL;
          }

          memset( data, 0, pitch * 400 );

          surface->Unlock( surface );

          data = malloc( pitch );

          ret = surface->Read( surface, &rect, data, pitch );

          if (ret) {
               D_DERROR( ret, "DFBTest/Resize: Read() failed!\n" );
               free (data);
               return NULL;
          }

          ret = surface->Write( surface, &rect, data, pitch );
          if (ret) {
               D_DERROR( ret, "DFBTest/Resize: Write() failed!\n" );
               free(data);
               return NULL;
          }

          free(data);
     }

     return NULL;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:50,代码来源:dfbtest_resize.c

示例11: ILOG_TRACE_F

DFBResult
DaleDFB::showOSK(const Rectangle& rect, TextInputMode mode)
{
    ILOG_TRACE_F(ILX_DALEDFB);

    if (getOSKComp() == DFB_FAILURE)
        return DFB_FAILURE;

    OSKRequest request;
    request.inputRect = rect.dfbRect();
    request.mode = mode;
    request.process = getpid();

    void *ptr;
    __coma->GetLocal(__coma, sizeof(OSKRequest), &ptr);
    OSKRequest* req = (OSKRequest*) ptr;
    *req = request;

    int ret_val;
    DirectResult ret = __oskComp->Call(__oskComp, 0, (void*) req, &ret_val);
    if (ret)
    {
        D_DERROR(ret, "WebKit/DFB: %s() failed!\n", __FUNCTION__);
        return (DFBResult) ret;
    }
    return DFB_OK;
}
开发者ID:touchao123,项目名称:ilixi,代码行数:27,代码来源:DaleDFB.cpp

示例12: InitGL

static DFBResult
InitGL( Test *test )
{
     DFBResult ret;

     /* 
      * Bind the OpenGL rendering context to our primary surface
      */
     ret = test->gl2context->Bind( test->gl2context, test->primary, test->primary );
     if (ret) {
          D_DERROR( ret, "IDirectFBGL2Context::Bind() failed!\n" );
          return ret;
     }

     gears_init();

     /* Update the projection matrix */
     perspective(ProjectionMatrix, 60.0, test->size.w / (float)test->size.h, 1.0, 1024.0);

     /* Setup the viewport */
     glViewport( 0, 0, (GLint) test->size.w, (GLint) test->size.h );

     /* Unbind the OpenGL rendering context */
     test->gl2context->Unbind( test->gl2context );

     return DFB_OK;
}
开发者ID:kuii,项目名称:dfbNEON,代码行数:27,代码来源:dfbtest_gl2.c

示例13: D_DEBUG_AT

EGLint
Surface::SwapBuffers()
{
     D_DEBUG_AT( DFBEGL_Surface, "EGL::Surface::%s( %p )\n", __FUNCTION__, this );

     if (surface == NULL) {
          D_DEBUG_AT( DFBEGL_Surface, "  -> NO SURFACE\n" );
          return EGL_BAD_SURFACE;
     }

     if (gfx_peer) {
          DFBResult ret;

          ret = gfx_peer->Flip( NULL, DSFLIP_NONE );
          if (ret) {
               D_DERROR( ret, "DFBEGL/Display: Graphics::SurfacePeer::Flip() failed!\n" );
               return EGL_BAD_SURFACE;
          }
     }
     else
          D_DEBUG_AT( DFBEGL_Surface, "  -> NO PEER\n" );

     Dispatch< Surface::SwapBuffersFunc >( "SwapBuffers", this );

     return EGL_SUCCESS;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:26,代码来源:egl_surface.cpp

示例14: x11JoinPool

static DFBResult
x11JoinPool( CoreDFB                    *core,
             CoreSurfacePool            *pool,
             void                       *pool_data,
             void                       *pool_local,
             void                       *system_data )
{
     DFBResult         ret;
     x11PoolLocalData *local = pool_local;
     DFBX11           *x11   = system_data;

     D_DEBUG_AT( X11_Surfaces, "%s()\n", __FUNCTION__ );

     D_MAGIC_ASSERT( pool, CoreSurfacePool );

     local->x11 = x11;

     ret = direct_hash_create( 7, &local->hash );
     if (ret) {
          D_DERROR( ret, "X11/Surfaces: Could not create local hash table!\n" );
          return ret;
     }

     pthread_mutex_init( &local->lock, NULL );

     return DFB_OK;
}
开发者ID:jameshilliard,项目名称:20-4-4,代码行数:27,代码来源:x11_surface_pool.c

示例15: IInputDevice_Requestor__ReloadKeymap

DFBResult
IInputDevice_Requestor__ReloadKeymap( CoreInputDevice *obj

)
{
    DFBResult           ret;
    CoreInputDeviceReloadKeymap       *args = (CoreInputDeviceReloadKeymap*) alloca( sizeof(CoreInputDeviceReloadKeymap) );
    CoreInputDeviceReloadKeymapReturn *return_args = (CoreInputDeviceReloadKeymapReturn*) alloca( sizeof(CoreInputDeviceReloadKeymapReturn) );

    D_DEBUG_AT( DirectFB_CoreInputDevice, "IInputDevice_Requestor::%s()\n", __FUNCTION__ );



    ret = (DFBResult) CoreInputDevice_Call( obj, FCEF_NONE, _CoreInputDevice_ReloadKeymap, args, sizeof(CoreInputDeviceReloadKeymap), return_args, sizeof(CoreInputDeviceReloadKeymapReturn), NULL );
    if (ret) {
        D_DERROR( ret, "%s: CoreInputDevice_Call( CoreInputDevice_ReloadKeymap ) failed!\n", __FUNCTION__ );
        return ret;
    }

    if (return_args->result) {
         /*D_DERROR( return_args->result, "%s: CoreInputDevice_ReloadKeymap failed!\n", __FUNCTION__ );*/
         return return_args->result;
    }


    return DFB_OK;
}
开发者ID:geekmaster,项目名称:buildroot-kindle,代码行数:27,代码来源:CoreInputDevice.c


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