當前位置: 首頁>>代碼示例>>C++>>正文


C++ DIRECT_INTERFACE_GET_DATA函數代碼示例

本文整理匯總了C++中DIRECT_INTERFACE_GET_DATA函數的典型用法代碼示例。如果您正苦於以下問題:C++ DIRECT_INTERFACE_GET_DATA函數的具體用法?C++ DIRECT_INTERFACE_GET_DATA怎麽用?C++ DIRECT_INTERFACE_GET_DATA使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了DIRECT_INTERFACE_GET_DATA函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: IDirectFBVideoProvider_Xine_DetachEventBuffer

static DFBResult
IDirectFBVideoProvider_Xine_DetachEventBuffer( IDirectFBVideoProvider *thiz,
                                               IDirectFBEventBuffer   *events )
{
     DIRECT_INTERFACE_GET_DATA( IDirectFBVideoProvider_Xine )

     pthread_mutex_lock( &data->lock );

     if (!data->events) {
          pthread_mutex_unlock( &data->lock );
          return DFB_BUFFEREMPTY;
     }

     if (data->events != events) {
          pthread_mutex_unlock( &data->lock );
          return DFB_INVARG;
     }

     data->events = NULL;

     events->Release( events );

     pthread_mutex_unlock( &data->lock );

     return DFB_OK;
}
開發者ID:Distrotech,項目名稱:DirectFB,代碼行數:26,代碼來源:idirectfbvideoprovider_xine.c

示例2: IDirectFBWindow_Resize

static DFBResult
IDirectFBWindow_Resize( IDirectFBWindow *thiz,
                        int              width,
                        int              height )
{
     DFBResult ret;
     DFBInsets insets;
     
     DIRECT_INTERFACE_GET_DATA(IDirectFBWindow)

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

     if (data->destroyed)
          return DFB_DESTROYED;

     if (width < 1 || width > 4096 || height < 1 || height > 4096)
          return DFB_INVARG;
     
     dfb_windowstack_lock( data->window->stack );

     dfb_wm_get_insets( data->window->stack, data->window, &insets );
     width  += insets.l+insets.r;
     height += insets.t+insets.b;

     ret = dfb_window_resize( data->window, width, height );

     dfb_windowstack_unlock( data->window->stack );

     return ret;
}
開發者ID:kizukukoto,項目名稱:WDN900_GPL,代碼行數:30,代碼來源:idirectfbwindow.c

示例3: IDirectFBWindow_PutBelow

static DFBResult
IDirectFBWindow_PutBelow( IDirectFBWindow *thiz,
                           IDirectFBWindow *upper )
{
     IDirectFBWindow_data *upper_data;

     DIRECT_INTERFACE_GET_DATA(IDirectFBWindow)

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

     if (data->destroyed)
          return DFB_DESTROYED;

     if (!upper)
          return DFB_INVARG;

     upper_data = (IDirectFBWindow_data*) upper->priv;
     if (!upper_data)
          return DFB_DEAD;

     if (!upper_data->window)
          return DFB_DESTROYED;

     return dfb_window_putbelow( data->window, upper_data->window );
}
開發者ID:kizukukoto,項目名稱:WDN900_GPL,代碼行數:25,代碼來源:idirectfbwindow.c

示例4: IDirectFBWindow_SetKeySelection

static DFBResult
IDirectFBWindow_SetKeySelection( IDirectFBWindow               *thiz,
                                 DFBWindowKeySelection          selection,
                                 const DFBInputDeviceKeySymbol *keys,
                                 unsigned int                   num_keys )
{
     DIRECT_INTERFACE_GET_DATA(IDirectFBWindow)

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

     /* What a lovely switch */
     switch (selection) {
         case DWKS_ALL:
         case DWKS_NONE:
             break;
         case DWKS_LIST:
             if (!keys || num_keys == 0)
         default:
                 return DFB_INVARG;
     }

     if (data->destroyed)
          return DFB_DESTROYED;

     return dfb_window_set_key_selection( data->window, selection, keys, num_keys );
}
開發者ID:kizukukoto,項目名稱:WDN900_GPL,代碼行數:26,代碼來源:idirectfbwindow.c

示例5: IDirectFBWindow_SetColorKey

static DFBResult
IDirectFBWindow_SetColorKey( IDirectFBWindow *thiz,
                             u8               r,
                             u8               g,
                             u8               b )
{
     u32          key;
     CoreSurface *surface;

     DIRECT_INTERFACE_GET_DATA(IDirectFBWindow)

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

     if (data->destroyed)
          return DFB_DESTROYED;

     if (data->window->caps & DWCAPS_INPUTONLY)
          return DFB_UNSUPPORTED;

     surface = data->window->surface;

     if (DFB_PIXELFORMAT_IS_INDEXED( surface->config.format ))
          key = dfb_palette_search( surface->palette, r, g, b, 0x80 );
     else
          key = dfb_color_to_pixel( surface->config.format, r, g, b );

     return dfb_window_set_colorkey( data->window, key );
}
開發者ID:kizukukoto,項目名稱:WDN900_GPL,代碼行數:28,代碼來源:idirectfbwindow.c

示例6: IDirectFBWindow_CreateEventBuffer

static DFBResult
IDirectFBWindow_CreateEventBuffer( IDirectFBWindow       *thiz,
                                   IDirectFBEventBuffer **buffer )
{
     IDirectFBEventBuffer *b;

     DIRECT_INTERFACE_GET_DATA(IDirectFBWindow)

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

     if (data->destroyed)
          return DFB_DESTROYED;

     DIRECT_ALLOCATE_INTERFACE( b, IDirectFBEventBuffer );

     IDirectFBEventBuffer_Construct( b, NULL, NULL );

     IDirectFBEventBuffer_AttachWindow( b, data->window );

     dfb_window_send_configuration( data->window );

     *buffer = b;

     return DFB_OK;
}
開發者ID:Distrotech,項目名稱:DirectFB,代碼行數:25,代碼來源:idirectfbwindow.c

示例7: IDirectFBWindow_GetPosition

static DFBResult
IDirectFBWindow_GetPosition( IDirectFBWindow *thiz,
                             int             *x,
                             int             *y )
{
     DFBInsets insets;
     DIRECT_INTERFACE_GET_DATA(IDirectFBWindow)

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


     if (data->destroyed)
          return DFB_DESTROYED;

     if (!x && !y)
          return DFB_INVARG;

     CoreWindow_GetInsets( data->window, &insets );

     if (x)
          *x = data->window->config.bounds.x-insets.l;

     if (y)
          *y = data->window->config.bounds.y-insets.t;

     return DFB_OK;
}
開發者ID:Distrotech,項目名稱:DirectFB,代碼行數:27,代碼來源:idirectfbwindow.c

示例8: IDirectFBWindow_GetProperty

static DFBResult
IDirectFBWindow_GetProperty( IDirectFBWindow  *thiz,
                             const char       *key,
                             void            **ret_value )
{
     DFBResult ret;

     DIRECT_INTERFACE_GET_DATA(IDirectFBWindow)

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

     if (data->destroyed)
          return DFB_DESTROYED;

     if (!key)
          return DFB_INVARG;

     if (!ret_value)
          return DFB_INVARG;

     dfb_windowstack_lock( data->window->stack );
     ret = dfb_wm_get_window_property( data->window->stack, data->window, key, ret_value );
     dfb_windowstack_unlock( data->window->stack );

     return ret;
}
開發者ID:Distrotech,項目名稱:DirectFB,代碼行數:26,代碼來源:idirectfbwindow.c

示例9: IDirectFBWindow_GetSize

static DFBResult
IDirectFBWindow_GetSize( IDirectFBWindow *thiz,
                         int             *width,
                         int             *height )
{
     DFBInsets insets;
     DIRECT_INTERFACE_GET_DATA(IDirectFBWindow)

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

     if (data->destroyed)
          return DFB_DESTROYED;

     if (!width && !height)
          return DFB_INVARG;

     CoreWindow_GetInsets( data->window, &insets );

     if (width)
          *width = data->window->config.bounds.w-insets.l-insets.r;

     if (height)
          *height = data->window->config.bounds.h-insets.t-insets.b;

     return DFB_OK;
}
開發者ID:Distrotech,項目名稱:DirectFB,代碼行數:26,代碼來源:idirectfbwindow.c

示例10: IDirectFBSurface_Layer_GetSubSurface

static DFBResult
IDirectFBSurface_Layer_GetSubSurface( IDirectFBSurface    *thiz,
                                      const DFBRectangle  *rect,
                                      IDirectFBSurface   **surface )
{
     DFBResult ret;

     DIRECT_INTERFACE_GET_DATA(IDirectFBSurface_Layer)

     D_DEBUG_AT( Surface, "%s( %p )\n", __FUNCTION__, thiz );

     /* Check arguments */
     if (!data->base.surface)
          return DFB_DESTROYED;

     if (!surface)
          return DFB_INVARG;
          
     /* Allocate interface */
     DIRECT_ALLOCATE_INTERFACE( *surface, IDirectFBSurface );

     if (rect || data->base.limit_set) {
          DFBRectangle wanted, granted;
          
          /* Compute wanted rectangle */
          if (rect) {
               wanted = *rect;

               wanted.x += data->base.area.wanted.x;
               wanted.y += data->base.area.wanted.y;

               if (wanted.w <= 0 || wanted.h <= 0) {
                    wanted.w = 0;
                    wanted.h = 0;
               }
          }
          else {
               wanted = data->base.area.wanted;
          }
          
          /* Compute granted rectangle */
          granted = wanted;

          dfb_rectangle_intersect( &granted, &data->base.area.granted );
          
          /* Construct */
          ret = IDirectFBSurface_Layer_Construct( *surface, thiz, &wanted, &granted,
                                                  data->region, data->base.caps |
                                                  DSCAPS_SUBSURFACE, data->base.core );
     }
     else {
          /* Construct */
          ret = IDirectFBSurface_Layer_Construct( *surface, thiz, NULL, NULL,
                                                  data->region, data->base.caps |
                                                  DSCAPS_SUBSURFACE, data->base.core );
     }
     
     return ret;
}
開發者ID:kizukukoto,項目名稱:WDN900_GPL,代碼行數:59,代碼來源:idirectfbsurface_layer.c

示例11: IDirectFBVideoProvider_V4L_AddRef

static DFBResult IDirectFBVideoProvider_V4L_AddRef( IDirectFBVideoProvider *thiz )
{
     DIRECT_INTERFACE_GET_DATA (IDirectFBVideoProvider_V4L)

     data->ref++;

     return DFB_OK;
}
開發者ID:Kvasshtain,項目名稱:uos-embedded,代碼行數:8,代碼來源:idirectfbvideoprovider_v4l.c

示例12: IDirectFBFont_GetGlyphExtentsXY

/*
 * Get the extents of the specified glyph.
 */
static DFBResult
IDirectFBFont_GetGlyphExtentsXY( IDirectFBFont *thiz,
                                 unsigned int   character,
                                 DFBRectangle  *rect,
                                 int           *xadvance,
                                 int           *yadvance )
{
     DFBResult      ret;
     CoreFont      *font;
     CoreGlyphData *glyph;
     unsigned int   index;

     DIRECT_INTERFACE_GET_DATA(IDirectFBFont)

     D_DEBUG_AT( Font, "%s( %p )\n", __FUNCTION__, thiz );

     if (!rect && !xadvance && !yadvance)
          return DFB_INVARG;

     font = data->font;

     dfb_font_lock( font );

     ret = dfb_font_decode_character( font, data->encoding, character, &index );
     if (ret) {
          dfb_font_unlock( font );
          return ret;
     }

     if (dfb_font_get_glyph_data (font, index, 0, &glyph) != DFB_OK) {     // FIXME: support font layers
          if (rect)
               rect->x = rect->y = rect->w = rect->h = 0;

          if (xadvance)
               *xadvance = 0;

          if (yadvance)
               *yadvance = 0;
     }
     else {
          if (rect) {
               rect->x = glyph->left + font->ascender * font->up_unit_x;
               rect->y = glyph->top  + font->ascender * font->up_unit_y;
               rect->w = glyph->width;
               rect->h = glyph->height;
          }

          if (xadvance)
               *xadvance = glyph->xadvance;

          if (yadvance)
               *yadvance = glyph->yadvance;
     }

     dfb_font_unlock( font );

     return DFB_OK;
}
開發者ID:canalplus,項目名稱:r7oss,代碼行數:61,代碼來源:idirectfbfont.c

示例13: IDirectFBGL_AddRef

static DirectResult
IDirectFBGL_AddRef( IDirectFBGL *thiz )
{
     DIRECT_INTERFACE_GET_DATA (IDirectFBGL);

     data->ref++;

     return DFB_OK;
}
開發者ID:folkien,項目名稱:directfb,代碼行數:9,代碼來源:idirectfbgl_egl.c

示例14: IDirectFBDataBuffer_Dispatcher_AddRef

static DirectResult
IDirectFBDataBuffer_Dispatcher_AddRef( IDirectFBDataBuffer *thiz )
{
     DIRECT_INTERFACE_GET_DATA(IDirectFBDataBuffer_Dispatcher)

     data->base.ref++;

     return DFB_OK;
}
開發者ID:geekmaster,項目名稱:buildroot-kindle,代碼行數:9,代碼來源:idirectfbdatabuffer_dispatcher.c

示例15: IDirectFBVideoProvider_Swf_AddRef

static DirectResult
IDirectFBVideoProvider_Swf_AddRef(IDirectFBVideoProvider *thiz )
{
    DIRECT_INTERFACE_GET_DATA(IDirectFBVideoProvider_Swf)

    data->ref++;

    return DR_OK;
}
開發者ID:lihp1603,項目名稱:DirectFB,代碼行數:9,代碼來源:idirectfbvideoprovider_swf.c


注:本文中的DIRECT_INTERFACE_GET_DATA函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。