CoreDFB.h   CoreDFB.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef ___CoreDFB__H___ #ifndef ___CoreDFB__H___
#define ___CoreDFB__H___ #define ___CoreDFB__H___
#include <core/CoreDFB_includes.h> #include "CoreDFB_includes.h"
/************************************************************************** ******************************************** /************************************************************************** ********************************************
* CoreDFB * CoreDFB
*/ */
#ifdef __cplusplus #ifdef __cplusplus
#include <core/Interface.h> #include <core/Interface.h>
extern "C" { extern "C" {
#endif #endif
DFBResult CoreDFB_Register(
CoreDFB *obj,
u32 slave_call);
DFBResult CoreDFB_CreateSurface( DFBResult CoreDFB_CreateSurface(
CoreDFB *obj, CoreDFB *obj,
const CoreSurfaceConfig *config, const CoreSurfaceConfig *config,
CoreSurfaceTypeFlags type, CoreSurfaceTypeFlags type,
u64 resource_id, u64 resource_id,
CorePalette *palette, CorePalette *palette,
CoreSurface **ret_surface) ; CoreSurface **ret_surface) ;
DFBResult CoreDFB_CreatePalette( DFBResult CoreDFB_CreatePalette(
CoreDFB *obj, CoreDFB *obj,
skipping to change at line 69 skipping to change at line 65
CorePalette **ret_palette) ; CorePalette **ret_palette) ;
DFBResult CoreDFB_CreateState( DFBResult CoreDFB_CreateState(
CoreDFB *obj, CoreDFB *obj,
CoreGraphicsState **ret_state); CoreGraphicsState **ret_state);
DFBResult CoreDFB_WaitIdle( DFBResult CoreDFB_WaitIdle(
CoreDFB *obj CoreDFB *obj
); );
DFBResult CoreDFB_CreateImageProvider( void *CoreDFB_Init_Dispatch(
CoreDFB *obj,
u32 buffer_call,
u32 *ret_call);
void CoreDFB_Init_Dispatch(
CoreDFB *core, CoreDFB *core,
CoreDFB *obj, CoreDFB *obj,
FusionCall *call FusionCall *call
); );
void CoreDFB_Deinit_Dispatch( void CoreDFB_Deinit_Dispatch(
FusionCall *call void *dispatch
); );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif
namespace DirectFB {
/* /*
* CoreDFB Calls * CoreDFB Calls
*/ */
typedef enum { typedef enum {
_CoreDFB_Register = 1, CoreDFB_CreateSurface = 1,
_CoreDFB_CreateSurface = 2, CoreDFB_CreatePalette = 2,
_CoreDFB_CreatePalette = 3, CoreDFB_CreateState = 3,
_CoreDFB_CreateState = 4, CoreDFB_WaitIdle = 4,
_CoreDFB_WaitIdle = 5,
_CoreDFB_CreateImageProvider = 6,
} CoreDFBCall; } CoreDFBCall;
/* /*
* CoreDFB_Register
*/
typedef struct {
u32 slave_call;
} CoreDFBRegister;
typedef struct {
DFBResult result;
} CoreDFBRegisterReturn;
/*
* CoreDFB_CreateSurface * CoreDFB_CreateSurface
*/ */
typedef struct { typedef struct {
CoreSurfaceConfig config; CoreSurfaceConfig config;
CoreSurfaceTypeFlags type; CoreSurfaceTypeFlags type;
u64 resource_id; u64 resource_id;
bool palette_set; bool palette_set;
u32 palette_id; u32 palette_id;
} CoreDFBCreateSurface; } CoreDFBCreateSurface;
skipping to change at line 160 skipping to change at line 139
/* /*
* CoreDFB_WaitIdle * CoreDFB_WaitIdle
*/ */
typedef struct { typedef struct {
} CoreDFBWaitIdle; } CoreDFBWaitIdle;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreDFBWaitIdleReturn; } CoreDFBWaitIdleReturn;
/* class ICore : public Interface
* CoreDFB_CreateImageProvider {
*/ public:
typedef struct { ICore( CoreDFB *core )
u32 buffer_call; :
} CoreDFBCreateImageProvider; Interface( core )
{
}
typedef struct { public:
DFBResult result; virtual DFBResult CreateSurface(
u32 call; const CoreSurfaceConfig *config,
} CoreDFBCreateImageProviderReturn; CoreSurfaceTypeFlags type,
u64 resource_id,
CorePalette *palette,
CoreSurface **ret_surface
) = 0;
DFBResult ICore_Real__Register( CoreDFB *obj, virtual DFBResult CreatePalette(
u32 slave_call ) u32 size,
; CorePalette **ret_palette
) = 0;
DFBResult ICore_Real__CreateSurface( CoreDFB *obj, virtual DFBResult CreateState(
CoreGraphicsState **ret_state
) = 0;
virtual DFBResult WaitIdle(
) = 0;
};
class ICore_Real : public ICore
{
private:
CoreDFB *obj;
public:
ICore_Real( CoreDFB *core, CoreDFB *obj )
:
ICore( core ),
obj( obj )
{
}
public:
virtual DFBResult CreateSurface(
const CoreSurfaceConfig *config, const CoreSurfaceConfig *config,
CoreSurfaceTypeFlags type, CoreSurfaceTypeFlags type,
u64 resource_id, u64 resource_id,
CorePalette *palette, CorePalette *palette,
CoreSurface **ret_surface CoreSurface **ret_surface
); );
DFBResult ICore_Real__CreatePalette( CoreDFB *obj, virtual DFBResult CreatePalette(
u32 size, u32 size,
CorePalette **ret_palette CorePalette **ret_palette
); );
DFBResult ICore_Real__CreateState( CoreDFB *obj, virtual DFBResult CreateState(
CoreGraphicsState **ret_state ); CoreGraphicsState **ret_state
);
DFBResult ICore_Real__WaitIdle( CoreDFB *obj virtual DFBResult WaitIdle(
);
DFBResult ICore_Real__CreateImageProvider( CoreDFB *obj, );
u32 buffer_call,
u32 *ret_call );
DFBResult ICore_Requestor__Register( CoreDFB *obj, };
u32 slave_call )
;
DFBResult ICore_Requestor__CreateSurface( CoreDFB *obj, class ICore_Requestor : public ICore
{
private:
CoreDFB *obj;
public:
ICore_Requestor( CoreDFB *core, CoreDFB *obj )
:
ICore( core ),
obj( obj )
{
}
public:
virtual DFBResult CreateSurface(
const CoreSurfaceConfig *config, const CoreSurfaceConfig *config,
CoreSurfaceTypeFlags type, CoreSurfaceTypeFlags type,
u64 resource_id, u64 resource_id,
CorePalette *palette, CorePalette *palette,
CoreSurface **ret_surface CoreSurface **ret_surface
); );
DFBResult ICore_Requestor__CreatePalette( CoreDFB *obj, virtual DFBResult CreatePalette(
u32 size, u32 size,
CorePalette **ret_palette CorePalette **ret_palette
); );
DFBResult ICore_Requestor__CreateState( CoreDFB *obj, virtual DFBResult CreateState(
CoreGraphicsState **ret_state ); CoreGraphicsState **ret_state
);
DFBResult ICore_Requestor__WaitIdle( CoreDFB *obj virtual DFBResult WaitIdle(
);
DFBResult ICore_Requestor__CreateImageProvider( CoreDFB *obj, );
u32 buffer_call,
u32 *ret_call );
DFBResult CoreDFBDispatch__Dispatch( CoreDFB *obj, };
FusionID caller,
int method, class CoreDFBDispatch
void *ptr, {
unsigned int length,
void *ret_ptr, public:
unsigned int ret_size, CoreDFBDispatch( CoreDFB *core, ICore *real )
unsigned int *ret_length ); :
core( core ),
real( real )
{
}
virtual DFBResult Dispatch( FusionID caller,
int method,
void *ptr,
unsigned int length,
void *ret_ptr,
unsigned int ret_size,
unsigned int *ret_length );
private:
CoreDFB *core;
ICore *real;
};
}
#endif
#endif #endif
 End of changes. 26 change blocks. 
80 lines changed or deleted 119 lines changed or added


 CoreDFB_includes.h   CoreDFB_includes.h 
/*
(c) Copyright 2001-2012 The world wide DirectFB Open Source Community (
directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __CoreDFB_includes_h__ #ifndef __CoreDFB_includes_h__
#define __CoreDFB_includes_h__ #define __CoreDFB_includes_h__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <fusion/types.h> #include <fusion/types.h>
#include <fusion/lock.h> #include <fusion/lock.h>
#include <fusion/object.h> #include <fusion/object.h>
#include <directfb.h> #include <directfb.h>
#include <core/core.h> #include <core/core.h>
#include <core/graphics_state.h>
#include <core/layer_context.h> #include <core/layer_context.h>
#include <core/layer_control.h> #include <core/layer_control.h>
#include <core/layers_internal.h> #include <core/layers_internal.h>
#include <core/palette.h> #include <core/palette.h>
#include <core/screens.h>
#include <core/state.h> #include <core/state.h>
#include <core/surface.h> #include <core/surface.h>
#include <core/windows.h> #include <core/windows.h>
#include <core/windows_internal.h> #include <core/windows_internal.h>
static __inline__ DirectResult static __inline__ DirectResult
CoreDFB_Call( CoreDFB *core, CoreDFB_Call( CoreDFB *core,
FusionCallExecFlags flags, FusionCallExecFlags flags,
int call_arg, int call_arg,
void *ptr, void *ptr,
unsigned int length, unsigned int length,
void *ret_ptr, void *ret_ptr,
unsigned int ret_size, unsigned int ret_size,
unsigned int *ret_length ) unsigned int *ret_length )
{ {
return fusion_call_execute3( &core->shared->call, flags, call_arg, ptr , length, ret_ptr, ret_size, ret_length ); return fusion_call_execute3( &core->shared->call, flags, call_arg, ptr , length, ret_ptr, ret_size, ret_length );
} }
static __inline__ u32
CoreGraphicsState_GetID( const CoreGraphicsState *state )
{
return state->object.id;
}
static __inline__ DirectResult
CoreGraphicsState_Lookup( CoreDFB *core,
u32 object_id,
FusionID caller,
CoreGraphicsState **ret_state )
{
DFBResult ret;
CoreGraphicsState *state;
ret = dfb_core_get_graphics_state( core, object_id, &state );
if (ret)
return (DirectResult) ret;
if (state->object.owner && state->object.owner != caller) {
dfb_graphics_state_unref( state );
return DR_ACCESSDENIED;
}
*ret_state = state;
return DR_OK;
}
static __inline__ DirectResult
CoreGraphicsState_Unref( CoreGraphicsState *state )
{
return (DirectResult) dfb_graphics_state_unref( state );
}
static __inline__ DirectResult
CoreGraphicsState_Catch( CoreDFB *core,
u32 object_id,
CoreGraphicsState **ret_state )
{
DirectResult ret;
ret = (DirectResult) dfb_core_get_graphics_state( core, object_id, ret
_state );
if (ret)
return ret;
fusion_ref_catch( &(*ret_state)->object.ref );
return DR_OK;
}
static __inline__ DirectResult
CoreGraphicsState_Throw( CoreGraphicsState *state,
FusionID catcher,
u32 *ret_object_id )
{
*ret_object_id = state->object.id;
fusion_reactor_add_permissions( state->object.reactor, catcher,
(FusionReactorPermissions)(FUSION_REAC
TOR_PERMIT_ATTACH_DETACH) );
fusion_ref_add_permissions( &state->object.ref, catcher,
(FusionRefPermissions)(FUSION_REF_PERMIT_R
EF_UNREF_LOCAL | FUSION_REF_PERMIT_CATCH) );
fusion_call_add_permissions( &state->call, catcher, FUSION_CALL_PERMIT
_EXECUTE );
if (!state->object.owner)
state->object.owner = catcher;
return fusion_ref_throw( &state->object.ref, catcher );
}
static __inline__ u32
CoreLayer_GetID( const CoreLayer *layer )
{
return dfb_layer_id( layer );
}
static __inline__ DirectResult static __inline__ DirectResult
CoreLayer_Lookup( CoreDFB *core, CoreLayer_Lookup( CoreDFB *core,
u32 object_id, u32 object_id,
FusionID caller,
CoreLayer **ret_layer ) CoreLayer **ret_layer )
{ {
D_UNUSED_P( core );
D_UNUSED_P( caller );
if (object_id >= (u32) dfb_layer_num()) if (object_id >= (u32) dfb_layer_num())
return DR_IDNOTFOUND; return DR_IDNOTFOUND;
*ret_layer = dfb_layer_at( object_id ); *ret_layer = dfb_layer_at( object_id );
return DR_OK; return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreLayer_Unref( CoreLayer *layer ) CoreLayer_Unref( CoreLayerContext *context )
{ {
D_UNUSED_P( layer );
return DR_OK; return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreLayer_Catch( CoreDFB *core, CoreLayer_Catch( CoreDFB *core,
u32 object_id, u32 object_id,
CoreLayer **ret_layer ) CoreLayer **ret_layer )
{ {
D_UNUSED_P( core );
if (object_id >= (u32) dfb_layer_num()) if (object_id >= (u32) dfb_layer_num())
return DR_IDNOTFOUND; return DR_IDNOTFOUND;
*ret_layer = dfb_layer_at( object_id ); *ret_layer = dfb_layer_at( object_id );
return DR_OK; return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreLayer_Throw( CoreLayer *layer, CoreLayer_Throw( CoreLayer *layer,
FusionID catcher, FusionID catcher,
u32 *ret_object_id ) u32 *ret_object_id )
{ {
D_UNUSED_P( catcher );
*ret_object_id = layer->shared->layer_id; *ret_object_id = layer->shared->layer_id;
return DR_OK; return DR_OK;
} }
static __inline__ u32
CoreLayerContext_GetID( const CoreLayerContext *context )
{
return context->object.id;
}
static __inline__ DirectResult static __inline__ DirectResult
CoreLayerContext_Lookup( CoreDFB *core, CoreLayerContext_Lookup( CoreDFB *core,
u32 object_id, u32 object_id,
FusionID caller,
CoreLayerContext **ret_context ) CoreLayerContext **ret_context )
{ {
DFBResult ret; return (DirectResult) dfb_core_get_layer_context( core, object_id, ret
CoreLayerContext *context; _context );
ret = dfb_core_get_layer_context( core, object_id, &context );
if (ret)
return (DirectResult) ret;
if (context->object.owner && context->object.owner != caller) {
dfb_layer_context_unref( context );
return DR_ACCESSDENIED;
}
*ret_context = context;
return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreLayerContext_Unref( CoreLayerContext *context ) CoreLayerContext_Unref( CoreLayerContext *context )
{ {
return (DirectResult) dfb_layer_context_unref( context ); return (DirectResult) dfb_layer_context_unref( context );
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreLayerContext_Catch( CoreDFB *core, CoreLayerContext_Catch( CoreDFB *core,
skipping to change at line 254 skipping to change at line 116
return DR_OK; return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreLayerContext_Throw( CoreLayerContext *context, CoreLayerContext_Throw( CoreLayerContext *context,
FusionID catcher, FusionID catcher,
u32 *ret_object_id ) u32 *ret_object_id )
{ {
*ret_object_id = context->object.id; *ret_object_id = context->object.id;
fusion_reactor_add_permissions( context->object.reactor, catcher,
(FusionReactorPermissions)(FUSION_REAC
TOR_PERMIT_ATTACH_DETACH) );
fusion_ref_add_permissions( &context->object.ref, catcher,
(FusionRefPermissions)(FUSION_REF_PERMIT_R
EF_UNREF_LOCAL | FUSION_REF_PERMIT_CATCH) );
fusion_call_add_permissions( &context->call, catcher, FUSION_CALL_PERM
IT_EXECUTE );
if (context->stack)
fusion_call_add_permissions( &context->stack->call, catcher, FUSI
ON_CALL_PERMIT_EXECUTE );
return fusion_ref_throw( &context->object.ref, catcher ); return fusion_ref_throw( &context->object.ref, catcher );
} }
static __inline__ u32
CoreLayerRegion_GetID( const CoreLayerRegion *region )
{
return region->object.id;
}
static __inline__ DirectResult static __inline__ DirectResult
CoreLayerRegion_Lookup( CoreDFB *core, CoreLayerRegion_Lookup( CoreDFB *core,
u32 object_id, u32 object_id,
FusionID caller,
CoreLayerRegion **ret_region ) CoreLayerRegion **ret_region )
{ {
DFBResult ret; return (DirectResult) dfb_core_get_layer_region( core, object_id, ret_
CoreLayerRegion *region; region );
ret = dfb_core_get_layer_region( core, object_id, &region );
if (ret)
return (DirectResult) ret;
if (region->object.owner && region->object.owner != caller) {
dfb_layer_region_unref( region );
return DR_ACCESSDENIED;
}
*ret_region = region;
return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreLayerRegion_Unref( CoreLayerRegion *region ) CoreLayerRegion_Unref( CoreLayerRegion *region )
{ {
return (DirectResult) dfb_layer_region_unref( region ); return (DirectResult) dfb_layer_region_unref( region );
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreLayerRegion_Catch( CoreDFB *core, CoreLayerRegion_Catch( CoreDFB *core,
skipping to change at line 324 skipping to change at line 156
return DR_OK; return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreLayerRegion_Throw( CoreLayerRegion *region, CoreLayerRegion_Throw( CoreLayerRegion *region,
FusionID catcher, FusionID catcher,
u32 *ret_object_id ) u32 *ret_object_id )
{ {
*ret_object_id = region->object.id; *ret_object_id = region->object.id;
fusion_reactor_add_permissions( region->object.reactor, catcher,
(FusionReactorPermissions)(FUSION_REAC
TOR_PERMIT_ATTACH_DETACH) );
fusion_ref_add_permissions( &region->object.ref, catcher,
(FusionRefPermissions)(FUSION_REF_PERMIT_R
EF_UNREF_LOCAL | FUSION_REF_PERMIT_CATCH) );
fusion_call_add_permissions( &region->call, catcher, FUSION_CALL_PERMI
T_EXECUTE );
return fusion_ref_throw( &region->object.ref, catcher ); return fusion_ref_throw( &region->object.ref, catcher );
} }
static __inline__ u32
CorePalette_GetID( const CorePalette *palette )
{
return palette->object.id;
}
static __inline__ DirectResult static __inline__ DirectResult
CorePalette_Lookup( CoreDFB *core, CorePalette_Lookup( CoreDFB *core,
u32 object_id, u32 object_id,
FusionID caller,
CorePalette **ret_palette ) CorePalette **ret_palette )
{ {
DFBResult ret; return (DirectResult) dfb_core_get_palette( core, object_id, ret_palet
CorePalette *palette; te );
ret = dfb_core_get_palette( core, object_id, &palette );
if (ret)
return (DirectResult) ret;
if (palette->object.owner && palette->object.owner != caller) {
dfb_palette_unref( palette );
return DR_ACCESSDENIED;
}
*ret_palette = palette;
return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CorePalette_Unref( CorePalette *palette ) CorePalette_Unref( CorePalette *palette )
{ {
return (DirectResult) dfb_palette_unref( palette ); return (DirectResult) dfb_palette_unref( palette );
} }
static __inline__ DirectResult static __inline__ DirectResult
CorePalette_Catch( CoreDFB *core, CorePalette_Catch( CoreDFB *core,
skipping to change at line 391 skipping to change at line 196
return DR_OK; return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CorePalette_Throw( CorePalette *palette, CorePalette_Throw( CorePalette *palette,
FusionID catcher, FusionID catcher,
u32 *ret_object_id ) u32 *ret_object_id )
{ {
*ret_object_id = palette->object.id; *ret_object_id = palette->object.id;
fusion_reactor_add_permissions( palette->object.reactor, catcher,
(FusionReactorPermissions)(FUSION_REAC
TOR_PERMIT_ATTACH_DETACH) );
fusion_ref_add_permissions( &palette->object.ref, catcher,
(FusionRefPermissions)(FUSION_REF_PERMIT_R
EF_UNREF_LOCAL | FUSION_REF_PERMIT_CATCH) );
fusion_call_add_permissions( &palette->call, catcher, FUSION_CALL_PERM
IT_EXECUTE );
if (!palette->object.owner)
palette->object.owner = catcher;
return fusion_ref_throw( &palette->object.ref, catcher ); return fusion_ref_throw( &palette->object.ref, catcher );
} }
static __inline__ u32
CoreScreen_GetID( const CoreScreen *screen )
{
return dfb_screen_id( screen );
}
static __inline__ DirectResult
CoreScreen_Lookup( CoreDFB *core,
u32 object_id,
FusionID caller,
CoreScreen **ret_screen )
{
D_UNUSED_P( core );
D_UNUSED_P( caller );
if (object_id >= (u32) dfb_screens_num())
return DR_IDNOTFOUND;
*ret_screen = dfb_screens_at( object_id );
return DR_OK;
}
static __inline__ DirectResult
CoreScreen_Unref( CoreScreen *screen )
{
D_UNUSED_P( screen );
return DR_OK;
}
static __inline__ DirectResult
CoreScreen_Catch( CoreDFB *core,
u32 object_id,
CoreScreen **ret_screen )
{
D_UNUSED_P( core );
if (object_id >= (u32) dfb_screens_num())
return DR_IDNOTFOUND;
*ret_screen = dfb_screens_at( object_id );
return DR_OK;
}
static __inline__ DirectResult
CoreScreen_Throw( CoreScreen *screen,
FusionID catcher,
u32 *ret_object_id )
{
D_UNUSED_P( catcher );
*ret_object_id = dfb_screen_id( screen );
return DR_OK;
}
static __inline__ u32
CoreSurface_GetID( const CoreSurface *surface )
{
return surface->object.id;
}
static __inline__ DirectResult static __inline__ DirectResult
CoreSurface_Lookup( CoreDFB *core, CoreSurface_Lookup( CoreDFB *core,
u32 object_id, u32 object_id,
FusionID caller,
CoreSurface **ret_surface ) CoreSurface **ret_surface )
{ {
DFBResult ret; return (DirectResult) dfb_core_get_surface( core, object_id, ret_surfa
CoreSurface *surface; ce );
ret = dfb_core_get_surface( core, object_id, &surface );
if (ret)
return (DirectResult) ret;
if (surface->object.owner && surface->object.owner != caller) {
dfb_surface_unref( surface );
return DR_ACCESSDENIED;
}
*ret_surface = surface;
return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreSurface_Unref( CoreSurface *surface ) CoreSurface_Unref( CoreSurface *surface )
{ {
return (DirectResult) dfb_surface_unref( surface ); return (DirectResult) dfb_surface_unref( surface );
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreSurface_Catch( CoreDFB *core, CoreSurface_Catch( CoreDFB *core,
skipping to change at line 521 skipping to change at line 236
return DR_OK; return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreSurface_Throw( CoreSurface *surface, CoreSurface_Throw( CoreSurface *surface,
FusionID catcher, FusionID catcher,
u32 *ret_object_id ) u32 *ret_object_id )
{ {
*ret_object_id = surface->object.id; *ret_object_id = surface->object.id;
fusion_reactor_add_permissions( surface->object.reactor, catcher,
(FusionReactorPermissions)(FUSION_REAC
TOR_PERMIT_ATTACH_DETACH) );
fusion_ref_add_permissions( &surface->object.ref, catcher,
(FusionRefPermissions)(FUSION_REF_PERMIT_R
EF_UNREF_LOCAL | FUSION_REF_PERMIT_CATCH) );
fusion_call_add_permissions( &surface->call, catcher, FUSION_CALL_PERM
IT_EXECUTE );
if (!surface->object.owner && !(surface->type & CSTF_LAYER))
surface->object.owner = catcher;
return fusion_ref_throw( &surface->object.ref, catcher ); return fusion_ref_throw( &surface->object.ref, catcher );
} }
static __inline__ u32
CoreSurfaceAllocation_GetID( const CoreSurfaceAllocation *allocation )
{
return allocation->object.id;
}
static __inline__ DirectResult static __inline__ DirectResult
CoreSurfaceAllocation_Lookup( CoreDFB *core, CoreWindow_Lookup( CoreDFB *core,
u32 object_id, u32 object_id,
FusionID caller, CoreWindow **ret_window )
CoreSurfaceAllocation **ret_allocation )
{ {
DFBResult ret; return (DirectResult) dfb_core_get_window( core, object_id, ret_window
CoreSurfaceAllocation *allocation; );
ret = dfb_core_get_surface_allocation( core, object_id, &allocation );
if (ret)
return (DirectResult) ret;
if (allocation->object.owner && allocation->object.owner != caller) {
dfb_surface_allocation_unref( allocation );
return DR_ACCESSDENIED;
}
*ret_allocation = allocation;
return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreSurfaceAllocation_Unref( CoreSurfaceAllocation *allocation ) CoreWindow_Unref( CoreWindow *window )
{ {
return (DirectResult) dfb_surface_allocation_unref( allocation ); return (DirectResult) dfb_window_unref( window );
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreSurfaceAllocation_Catch( CoreDFB *core, CoreWindow_Catch( CoreDFB *core,
u32 object_id, u32 object_id,
CoreSurfaceAllocation **ret_allocation ) CoreWindow **ret_window )
{ {
DirectResult ret; DirectResult ret;
ret = (DirectResult) dfb_core_get_surface_allocation( core, object_id, ret_allocation ); ret = (DirectResult) dfb_core_get_window( core, object_id, ret_window );
if (ret) if (ret)
return ret; return ret;
fusion_ref_catch( &(*ret_allocation)->object.ref ); fusion_ref_catch( &(*ret_window)->object.ref );
return DR_OK; return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreSurfaceAllocation_Throw( CoreSurfaceAllocation *allocation, CoreWindow_Throw( CoreWindow *window,
FusionID catcher, FusionID catcher,
u32 *ret_object_id ) u32 *ret_object_id )
{ {
*ret_object_id = allocation->object.id; *ret_object_id = window->object.id;
fusion_reactor_add_permissions( allocation->object.reactor, catcher,
(FusionReactorPermissions)(FUSION_REAC
TOR_PERMIT_ATTACH_DETACH) );
fusion_ref_add_permissions( &allocation->object.ref, catcher,
(FusionRefPermissions)(FUSION_REF_PERMIT_R
EF_UNREF_LOCAL | FUSION_REF_PERMIT_CATCH) );
//fusion_call_add_permissions( &allocation->call, catcher, FUSION_CALL
_PERMIT_EXECUTE );
if (!allocation->object.owner)
allocation->object.owner = catcher;
return fusion_ref_throw( &allocation->object.ref, catcher );
}
static __inline__ u32 return fusion_ref_throw( &window->object.ref, catcher );
CoreSurfaceBuffer_GetID( const CoreSurfaceBuffer *buffer )
{
return buffer->object.id;
} }
static __inline__ DirectResult struct __DFB_CoreGraphicsState {
CoreSurfaceBuffer_Lookup( CoreDFB *core, int magic;
u32 object_id,
FusionID caller,
CoreSurfaceBuffer **ret_buffer )
{
DFBResult ret;
CoreSurfaceBuffer *buffer;
ret = dfb_core_get_surface_buffer( core, object_id, &buffer );
if (ret)
return (DirectResult) ret;
if (buffer->object.owner && buffer->object.owner != caller) { CoreDFB *core;
dfb_surface_buffer_unref( buffer );
return DR_ACCESSDENIED;
}
*ret_buffer = buffer; FusionCall call;
return DR_OK; CardState state;
} };
static __inline__ DirectResult static __inline__ DirectResult
CoreSurfaceBuffer_Unref( CoreSurfaceBuffer *buffer ) CoreGraphicsState_Lookup( CoreDFB *core,
u32 object_id,
CoreGraphicsState **ret_state )
{ {
return (DirectResult) dfb_surface_buffer_unref( buffer ); return DR_UNSUPPORTED;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreSurfaceBuffer_Catch( CoreDFB *core, CoreGraphicsState_Unref( CoreWindow *window )
u32 object_id,
CoreSurfaceBuffer **ret_buffer )
{ {
DirectResult ret; return DR_UNSUPPORTED;
ret = (DirectResult) dfb_core_get_surface_buffer( core, object_id, ret
_buffer );
if (ret)
return ret;
fusion_ref_catch( &(*ret_buffer)->object.ref );
return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreSurfaceBuffer_Throw( CoreSurfaceBuffer *buffer, CoreGraphicsState_Catch( CoreDFB *core,
FusionID catcher, u32 object_id,
u32 *ret_object_id ) CoreGraphicsState **ret_state )
{
*ret_object_id = buffer->object.id;
fusion_reactor_add_permissions( buffer->object.reactor, catcher,
(FusionReactorPermissions)(FUSION_REAC
TOR_PERMIT_ATTACH_DETACH) );
fusion_ref_add_permissions( &buffer->object.ref, catcher,
(FusionRefPermissions)(FUSION_REF_PERMIT_R
EF_UNREF_LOCAL | FUSION_REF_PERMIT_CATCH) );
//fusion_call_add_permissions( &buffer->call, catcher, FUSION_CALL_PER
MIT_EXECUTE );
if (!buffer->object.owner)
buffer->object.owner = catcher;
return fusion_ref_throw( &buffer->object.ref, catcher );
}
static __inline__ u32
CoreWindow_GetID( const CoreWindow *window )
{ {
return window->object.id; CoreGraphicsState *state;
}
static __inline__ DirectResult state = (CoreGraphicsState*) D_CALLOC( 1, sizeof(CoreGraphicsState) );
CoreWindow_Lookup( CoreDFB *core, if (!state)
u32 object_id, return D_OOM();
FusionID caller,
CoreWindow **ret_window )
{
DFBResult ret;
CoreWindow *window;
ret = dfb_core_get_window( core, object_id, &window ); state->core = core;
if (ret) // state->state is not used on client side, FIXME: find better integra
return (DirectResult) ret; tion for local/proxy objects
fusion_call_init_from( &state->call, object_id, core->world );
if (window->object.owner && window->object.owner != caller) { D_MAGIC_SET( state, CoreGraphicsState );
dfb_window_unref( window );
return DR_ACCESSDENIED;
}
*ret_window = window; *ret_state = state;
return DR_OK; return DR_OK;
} }
static __inline__ DirectResult static __inline__ DirectResult
CoreWindow_Unref( CoreWindow *window ) CoreGraphicsState_Throw( CoreGraphicsState *state,
{ FusionID catcher,
return (DirectResult) dfb_window_unref( window ); u32 *ret_object_id )
}
static __inline__ DirectResult
CoreWindow_Catch( CoreDFB *core,
u32 object_id,
CoreWindow **ret_window )
{ {
DirectResult ret; *ret_object_id = state->call.call_id;
ret = (DirectResult) dfb_core_get_window( core, object_id, ret_window
);
if (ret)
return ret;
fusion_ref_catch( &(*ret_window)->object.ref );
return DR_OK; return DR_OK;
} }
static __inline__ DirectResult
CoreWindow_Throw( CoreWindow *window,
FusionID catcher,
u32 *ret_object_id )
{
*ret_object_id = window->object.id;
fusion_reactor_add_permissions( window->object.reactor, catcher,
(FusionReactorPermissions)(FUSION_REAC
TOR_PERMIT_ATTACH_DETACH | FUSION_REACTOR_PERMIT_DISPATCH) );
fusion_ref_add_permissions( &window->object.ref, catcher,
(FusionRefPermissions)(FUSION_REF_PERMIT_R
EF_UNREF_LOCAL | FUSION_REF_PERMIT_CATCH) );
fusion_call_add_permissions( &window->call, catcher, FUSION_CALL_PERMI
T_EXECUTE );
if (!window->object.owner)
window->object.owner = catcher;
return fusion_ref_throw( &window->object.ref, catcher );
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 54 change blocks. 
486 lines changed or deleted 55 lines changed or added


 CoreGraphicsState.h   CoreGraphicsState.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef ___CoreGraphicsState__H___ #ifndef ___CoreGraphicsState__H___
#define ___CoreGraphicsState__H___ #define ___CoreGraphicsState__H___
#include <core/CoreGraphicsState_includes.h> #include "CoreGraphicsState_includes.h"
/************************************************************************** ******************************************** /************************************************************************** ********************************************
* CoreGraphicsState * CoreGraphicsState
*/ */
#ifdef __cplusplus #ifdef __cplusplus
#include <core/Interface.h> #include <core/Interface.h>
extern "C" { extern "C" {
#endif #endif
skipping to change at line 60 skipping to change at line 60
DFBSurfaceBlittingFlags flags); DFBSurfaceBlittingFlags flags);
DFBResult CoreGraphicsState_SetClip( DFBResult CoreGraphicsState_SetClip(
CoreGraphicsState *obj, CoreGraphicsState *obj,
const DFBRegion *region); const DFBRegion *region);
DFBResult CoreGraphicsState_SetColor( DFBResult CoreGraphicsState_SetColor(
CoreGraphicsState *obj, CoreGraphicsState *obj,
const DFBColor *color); const DFBColor *color);
DFBResult CoreGraphicsState_SetColorAndIndex(
CoreGraphicsState *obj,
const DFBColor *color,
u32 index);
DFBResult CoreGraphicsState_SetSrcBlend( DFBResult CoreGraphicsState_SetSrcBlend(
CoreGraphicsState *obj, CoreGraphicsState *obj,
DFBSurfaceBlendFunction function); DFBSurfaceBlendFunction function);
DFBResult CoreGraphicsState_SetDstBlend( DFBResult CoreGraphicsState_SetDstBlend(
CoreGraphicsState *obj, CoreGraphicsState *obj,
DFBSurfaceBlendFunction function); DFBSurfaceBlendFunction function);
DFBResult CoreGraphicsState_SetSrcColorKey( DFBResult CoreGraphicsState_SetSrcColorKey(
CoreGraphicsState *obj, CoreGraphicsState *obj,
skipping to change at line 182 skipping to change at line 177
const DFBPoint *points1, const DFBPoint *points1,
const DFBPoint *points2, const DFBPoint *points2,
u32 num); u32 num);
DFBResult CoreGraphicsState_TextureTriangles( DFBResult CoreGraphicsState_TextureTriangles(
CoreGraphicsState *obj, CoreGraphicsState *obj,
const DFBVertex *vertices, const DFBVertex *vertices,
u32 num, u32 num,
DFBTriangleFormation formation); DFBTriangleFormation formation);
DFBResult CoreGraphicsState_ReleaseSource( void *CoreGraphicsState_Init_Dispatch(
CoreGraphicsState *obj
);
void CoreGraphicsState_Init_Dispatch(
CoreDFB *core, CoreDFB *core,
CoreGraphicsState *obj, CoreGraphicsState *obj,
FusionCall *call FusionCall *call
); );
void CoreGraphicsState_Deinit_Dispatch( void CoreGraphicsState_Deinit_Dispatch(
FusionCall *call void *dispatch
); );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif
namespace DirectFB {
/* /*
* CoreGraphicsState Calls * CoreGraphicsState Calls
*/ */
typedef enum { typedef enum {
_CoreGraphicsState_SetDrawingFlags = 1, CoreGraphicsState_SetDrawingFlags = 1,
_CoreGraphicsState_SetBlittingFlags = 2, CoreGraphicsState_SetBlittingFlags = 2,
_CoreGraphicsState_SetClip = 3, CoreGraphicsState_SetClip = 3,
_CoreGraphicsState_SetColor = 4, CoreGraphicsState_SetColor = 4,
_CoreGraphicsState_SetColorAndIndex = 5, CoreGraphicsState_SetSrcBlend = 5,
_CoreGraphicsState_SetSrcBlend = 6, CoreGraphicsState_SetDstBlend = 6,
_CoreGraphicsState_SetDstBlend = 7, CoreGraphicsState_SetSrcColorKey = 7,
_CoreGraphicsState_SetSrcColorKey = 8, CoreGraphicsState_SetDstColorKey = 8,
_CoreGraphicsState_SetDstColorKey = 9, CoreGraphicsState_SetDestination = 9,
_CoreGraphicsState_SetDestination = 10, CoreGraphicsState_SetSource = 10,
_CoreGraphicsState_SetSource = 11, CoreGraphicsState_SetSourceMask = 11,
_CoreGraphicsState_SetSourceMask = 12, CoreGraphicsState_SetSourceMaskVals = 12,
_CoreGraphicsState_SetSourceMaskVals = 13, CoreGraphicsState_SetIndexTranslation = 13,
_CoreGraphicsState_SetIndexTranslation = 14, CoreGraphicsState_SetColorKey = 14,
_CoreGraphicsState_SetColorKey = 15, CoreGraphicsState_SetRenderOptions = 15,
_CoreGraphicsState_SetRenderOptions = 16, CoreGraphicsState_SetMatrix = 16,
_CoreGraphicsState_SetMatrix = 17, CoreGraphicsState_SetSource2 = 17,
_CoreGraphicsState_SetSource2 = 18, CoreGraphicsState_DrawRectangles = 18,
_CoreGraphicsState_DrawRectangles = 19, CoreGraphicsState_DrawLines = 19,
_CoreGraphicsState_DrawLines = 20, CoreGraphicsState_FillRectangles = 20,
_CoreGraphicsState_FillRectangles = 21, CoreGraphicsState_FillTriangles = 21,
_CoreGraphicsState_FillTriangles = 22, CoreGraphicsState_FillTrapezoids = 22,
_CoreGraphicsState_FillTrapezoids = 23, CoreGraphicsState_FillSpans = 23,
_CoreGraphicsState_FillSpans = 24, CoreGraphicsState_Blit = 24,
_CoreGraphicsState_Blit = 25, CoreGraphicsState_Blit2 = 25,
_CoreGraphicsState_Blit2 = 26, CoreGraphicsState_StretchBlit = 26,
_CoreGraphicsState_StretchBlit = 27, CoreGraphicsState_TileBlit = 27,
_CoreGraphicsState_TileBlit = 28, CoreGraphicsState_TextureTriangles = 28,
_CoreGraphicsState_TextureTriangles = 29,
_CoreGraphicsState_ReleaseSource = 30,
} CoreGraphicsStateCall; } CoreGraphicsStateCall;
/* /*
* CoreGraphicsState_SetDrawingFlags * CoreGraphicsState_SetDrawingFlags
*/ */
typedef struct { typedef struct {
DFBSurfaceDrawingFlags flags; DFBSurfaceDrawingFlags flags;
} CoreGraphicsStateSetDrawingFlags; } CoreGraphicsStateSetDrawingFlags;
typedef struct { typedef struct {
skipping to change at line 281 skipping to change at line 271
*/ */
typedef struct { typedef struct {
DFBColor color; DFBColor color;
} CoreGraphicsStateSetColor; } CoreGraphicsStateSetColor;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreGraphicsStateSetColorReturn; } CoreGraphicsStateSetColorReturn;
/* /*
* CoreGraphicsState_SetColorAndIndex
*/
typedef struct {
DFBColor color;
u32 index;
} CoreGraphicsStateSetColorAndIndex;
typedef struct {
DFBResult result;
} CoreGraphicsStateSetColorAndIndexReturn;
/*
* CoreGraphicsState_SetSrcBlend * CoreGraphicsState_SetSrcBlend
*/ */
typedef struct { typedef struct {
DFBSurfaceBlendFunction function; DFBSurfaceBlendFunction function;
} CoreGraphicsStateSetSrcBlend; } CoreGraphicsStateSetSrcBlend;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreGraphicsStateSetSrcBlendReturn; } CoreGraphicsStateSetSrcBlendReturn;
skipping to change at line 577 skipping to change at line 555
typedef struct { typedef struct {
u32 num; u32 num;
DFBTriangleFormation formation; DFBTriangleFormation formation;
/* 'num' DFBVertex follow (vertices) */ /* 'num' DFBVertex follow (vertices) */
} CoreGraphicsStateTextureTriangles; } CoreGraphicsStateTextureTriangles;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreGraphicsStateTextureTrianglesReturn; } CoreGraphicsStateTextureTrianglesReturn;
/* class IGraphicsState : public Interface
* CoreGraphicsState_ReleaseSource {
*/ public:
typedef struct { IGraphicsState( CoreDFB *core )
} CoreGraphicsStateReleaseSource; :
Interface( core )
{
}
typedef struct { public:
DFBResult result; virtual DFBResult SetDrawingFlags(
} CoreGraphicsStateReleaseSourceReturn; DFBSurfaceDrawingFlags flags
) = 0;
DFBResult IGraphicsState_Real__SetDrawingFlags( CoreGraphicsState *obj, virtual DFBResult SetBlittingFlags(
DFBSurfaceDrawingFlags flags ); DFBSurfaceBlittingFlags flags
) = 0;
DFBResult IGraphicsState_Real__SetBlittingFlags( CoreGraphicsState *obj, virtual DFBResult SetClip(
DFBSurfaceBlittingFlags flags ); const DFBRegion *region
) = 0;
DFBResult IGraphicsState_Real__SetClip( CoreGraphicsState *obj, virtual DFBResult SetColor(
const DFBRegion *region ); const DFBColor *color
) = 0;
DFBResult IGraphicsState_Real__SetColor( CoreGraphicsState *obj, virtual DFBResult SetSrcBlend(
const DFBColor *color ); DFBSurfaceBlendFunction function
) = 0;
DFBResult IGraphicsState_Real__SetColorAndIndex( CoreGraphicsState *obj, virtual DFBResult SetDstBlend(
const DFBColor *color, DFBSurfaceBlendFunction function
u32 index ); ) = 0;
DFBResult IGraphicsState_Real__SetSrcBlend( CoreGraphicsState *obj, virtual DFBResult SetSrcColorKey(
DFBSurfaceBlendFunction function ); u32 key
) = 0;
DFBResult IGraphicsState_Real__SetDstBlend( CoreGraphicsState *obj, virtual DFBResult SetDstColorKey(
DFBSurfaceBlendFunction function ); u32 key
) = 0;
DFBResult IGraphicsState_Real__SetSrcColorKey( CoreGraphicsState *obj, virtual DFBResult SetDestination(
u32 key ); CoreSurface *surface
) = 0;
DFBResult IGraphicsState_Real__SetDstColorKey( CoreGraphicsState *obj, virtual DFBResult SetSource(
u32 key ); CoreSurface *surface
) = 0;
DFBResult IGraphicsState_Real__SetDestination( CoreGraphicsState *obj, virtual DFBResult SetSourceMask(
CoreSurface *surface ); CoreSurface *surface
) = 0;
DFBResult IGraphicsState_Real__SetSource( CoreGraphicsState *obj, virtual DFBResult SetSourceMaskVals(
CoreSurface *surface ); const DFBPoint *offset,
DFBSurfaceMaskFlags flags
) = 0;
DFBResult IGraphicsState_Real__SetSourceMask( CoreGraphicsState *obj, virtual DFBResult SetIndexTranslation(
CoreSurface *surface ); const s32 *indices,
u32 num
) = 0;
DFBResult IGraphicsState_Real__SetSourceMaskVals( CoreGraphicsState *obj, virtual DFBResult SetColorKey(
const DFBColorKey *key
) = 0;
virtual DFBResult SetRenderOptions(
DFBSurfaceRenderOptions options
) = 0;
virtual DFBResult SetMatrix(
const s32 *values
) = 0;
virtual DFBResult SetSource2(
CoreSurface *surface
) = 0;
virtual DFBResult DrawRectangles(
const DFBRectangle *rects,
u32 num
) = 0;
virtual DFBResult DrawLines(
const DFBRegion *lines,
u32 num
) = 0;
virtual DFBResult FillRectangles(
const DFBRectangle *rects,
u32 num
) = 0;
virtual DFBResult FillTriangles(
const DFBTriangle *triangles,
u32 num
) = 0;
virtual DFBResult FillTrapezoids(
const DFBTrapezoid *trapezoids,
u32 num
) = 0;
virtual DFBResult FillSpans(
s32 y,
const DFBSpan *spans,
u32 num
) = 0;
virtual DFBResult Blit(
const DFBRectangle *rects,
const DFBPoint *points,
u32 num
) = 0;
virtual DFBResult Blit2(
const DFBRectangle *rects,
const DFBPoint *points1,
const DFBPoint *points2,
u32 num
) = 0;
virtual DFBResult StretchBlit(
const DFBRectangle *srects,
const DFBRectangle *drects,
u32 num
) = 0;
virtual DFBResult TileBlit(
const DFBRectangle *rects,
const DFBPoint *points1,
const DFBPoint *points2,
u32 num
) = 0;
virtual DFBResult TextureTriangles(
const DFBVertex *vertices,
u32 num,
DFBTriangleFormation formation
) = 0;
};
class IGraphicsState_Real : public IGraphicsState
{
private:
CoreGraphicsState *obj;
public:
IGraphicsState_Real( CoreDFB *core, CoreGraphicsState *obj )
:
IGraphicsState( core ),
obj( obj )
{
}
public:
virtual DFBResult SetDrawingFlags(
DFBSurfaceDrawingFlags flags
);
virtual DFBResult SetBlittingFlags(
DFBSurfaceBlittingFlags flags
);
virtual DFBResult SetClip(
const DFBRegion *region
);
virtual DFBResult SetColor(
const DFBColor *color
);
virtual DFBResult SetSrcBlend(
DFBSurfaceBlendFunction function
);
virtual DFBResult SetDstBlend(
DFBSurfaceBlendFunction function
);
virtual DFBResult SetSrcColorKey(
u32 key
);
virtual DFBResult SetDstColorKey(
u32 key
);
virtual DFBResult SetDestination(
CoreSurface *surface
);
virtual DFBResult SetSource(
CoreSurface *surface
);
virtual DFBResult SetSourceMask(
CoreSurface *surface
);
virtual DFBResult SetSourceMaskVals(
const DFBPoint *offset, const DFBPoint *offset,
DFBSurfaceMaskFlags flags ); DFBSurfaceMaskFlags flags
);
DFBResult IGraphicsState_Real__SetIndexTranslation( CoreGraphicsState *obj, virtual DFBResult SetIndexTranslation(
const s32 *indices, const s32 *indices,
u32 num ); u32 num
);
DFBResult IGraphicsState_Real__SetColorKey( CoreGraphicsState *obj, virtual DFBResult SetColorKey(
const DFBColorKey *key ); const DFBColorKey *key
);
DFBResult IGraphicsState_Real__SetRenderOptions( CoreGraphicsState *obj, virtual DFBResult SetRenderOptions(
DFBSurfaceRenderOptions options ); DFBSurfaceRenderOptions options
);
DFBResult IGraphicsState_Real__SetMatrix( CoreGraphicsState *obj, virtual DFBResult SetMatrix(
const s32 *values ); const s32 *values
);
DFBResult IGraphicsState_Real__SetSource2( CoreGraphicsState *obj, virtual DFBResult SetSource2(
CoreSurface *surface ); CoreSurface *surface
);
DFBResult IGraphicsState_Real__DrawRectangles( CoreGraphicsState *obj, virtual DFBResult DrawRectangles(
const DFBRectangle *rects, const DFBRectangle *rects,
u32 num ); u32 num
);
DFBResult IGraphicsState_Real__DrawLines( CoreGraphicsState *obj, virtual DFBResult DrawLines(
const DFBRegion *lines, const DFBRegion *lines,
u32 num ); u32 num
);
DFBResult IGraphicsState_Real__FillRectangles( CoreGraphicsState *obj, virtual DFBResult FillRectangles(
const DFBRectangle *rects, const DFBRectangle *rects,
u32 num ); u32 num
);
DFBResult IGraphicsState_Real__FillTriangles( CoreGraphicsState *obj, virtual DFBResult FillTriangles(
const DFBTriangle *triangles, const DFBTriangle *triangles,
u32 num ); u32 num
);
DFBResult IGraphicsState_Real__FillTrapezoids( CoreGraphicsState *obj, virtual DFBResult FillTrapezoids(
const DFBTrapezoid *trapezoids, const DFBTrapezoid *trapezoids,
u32 num ); u32 num
);
DFBResult IGraphicsState_Real__FillSpans( CoreGraphicsState *obj, virtual DFBResult FillSpans(
s32 y, s32 y,
const DFBSpan *spans, const DFBSpan *spans,
u32 num ); u32 num
);
DFBResult IGraphicsState_Real__Blit( CoreGraphicsState *obj, virtual DFBResult Blit(
const DFBRectangle *rects, const DFBRectangle *rects,
const DFBPoint *points, const DFBPoint *points,
u32 num ); u32 num
);
DFBResult IGraphicsState_Real__Blit2( CoreGraphicsState *obj, virtual DFBResult Blit2(
const DFBRectangle *rects, const DFBRectangle *rects,
const DFBPoint *points1, const DFBPoint *points1,
const DFBPoint *points2, const DFBPoint *points2,
u32 num ); u32 num
);
DFBResult IGraphicsState_Real__StretchBlit( CoreGraphicsState *obj, virtual DFBResult StretchBlit(
const DFBRectangle *srects, const DFBRectangle *srects,
const DFBRectangle *drects, const DFBRectangle *drects,
u32 num ); u32 num
);
DFBResult IGraphicsState_Real__TileBlit( CoreGraphicsState *obj, virtual DFBResult TileBlit(
const DFBRectangle *rects, const DFBRectangle *rects,
const DFBPoint *points1, const DFBPoint *points1,
const DFBPoint *points2, const DFBPoint *points2,
u32 num ); u32 num
);
DFBResult IGraphicsState_Real__TextureTriangles( CoreGraphicsState *obj, virtual DFBResult TextureTriangles(
const DFBVertex *vertices, const DFBVertex *vertices,
u32 num, u32 num,
DFBTriangleFormation formation ); DFBTriangleFormation formation
);
DFBResult IGraphicsState_Real__ReleaseSource( CoreGraphicsState *obj };
);
DFBResult IGraphicsState_Requestor__SetDrawingFlags( CoreGraphicsState *obj class IGraphicsState_Requestor : public IGraphicsState
, {
DFBSurfaceDrawingFlags flags ); private:
CoreGraphicsState *obj;
DFBResult IGraphicsState_Requestor__SetBlittingFlags( CoreGraphicsState *ob public:
j, IGraphicsState_Requestor( CoreDFB *core, CoreGraphicsState *obj )
DFBSurfaceBlittingFlags flags ); :
IGraphicsState( core ),
obj( obj )
{
}
DFBResult IGraphicsState_Requestor__SetClip( CoreGraphicsState *obj, public:
const DFBRegion *region ); virtual DFBResult SetDrawingFlags(
DFBSurfaceDrawingFlags flags
);
DFBResult IGraphicsState_Requestor__SetColor( CoreGraphicsState *obj, virtual DFBResult SetBlittingFlags(
const DFBColor *color ); DFBSurfaceBlittingFlags flags
);
DFBResult IGraphicsState_Requestor__SetColorAndIndex( CoreGraphicsState *ob virtual DFBResult SetClip(
j, const DFBRegion *region
const DFBColor *color, );
u32 index );
DFBResult IGraphicsState_Requestor__SetSrcBlend( CoreGraphicsState *obj, virtual DFBResult SetColor(
DFBSurfaceBlendFunction function ); const DFBColor *color
);
DFBResult IGraphicsState_Requestor__SetDstBlend( CoreGraphicsState *obj, virtual DFBResult SetSrcBlend(
DFBSurfaceBlendFunction function ); DFBSurfaceBlendFunction function
);
DFBResult IGraphicsState_Requestor__SetSrcColorKey( CoreGraphicsState *obj, virtual DFBResult SetDstBlend(
u32 key ); DFBSurfaceBlendFunction function
);
DFBResult IGraphicsState_Requestor__SetDstColorKey( CoreGraphicsState *obj, virtual DFBResult SetSrcColorKey(
u32 key ); u32 key
);
DFBResult IGraphicsState_Requestor__SetDestination( CoreGraphicsState *obj, virtual DFBResult SetDstColorKey(
CoreSurface *surface ); u32 key
);
DFBResult IGraphicsState_Requestor__SetSource( CoreGraphicsState *obj, virtual DFBResult SetDestination(
CoreSurface *surface ); CoreSurface *surface
);
DFBResult IGraphicsState_Requestor__SetSourceMask( CoreGraphicsState *obj, virtual DFBResult SetSource(
CoreSurface *surface ); CoreSurface *surface
);
DFBResult IGraphicsState_Requestor__SetSourceMaskVals( CoreGraphicsState *o virtual DFBResult SetSourceMask(
bj, CoreSurface *surface
);
virtual DFBResult SetSourceMaskVals(
const DFBPoint *offset, const DFBPoint *offset,
DFBSurfaceMaskFlags flags ); DFBSurfaceMaskFlags flags
);
DFBResult IGraphicsState_Requestor__SetIndexTranslation( CoreGraphicsState *obj, virtual DFBResult SetIndexTranslation(
const s32 *indices, const s32 *indices,
u32 num ); u32 num
);
DFBResult IGraphicsState_Requestor__SetColorKey( CoreGraphicsState *obj, virtual DFBResult SetColorKey(
const DFBColorKey *key ); const DFBColorKey *key
);
DFBResult IGraphicsState_Requestor__SetRenderOptions( CoreGraphicsState *ob virtual DFBResult SetRenderOptions(
j, DFBSurfaceRenderOptions options
DFBSurfaceRenderOptions options ); );
DFBResult IGraphicsState_Requestor__SetMatrix( CoreGraphicsState *obj, virtual DFBResult SetMatrix(
const s32 *values ); const s32 *values
);
DFBResult IGraphicsState_Requestor__SetSource2( CoreGraphicsState *obj, virtual DFBResult SetSource2(
CoreSurface *surface ); CoreSurface *surface
);
DFBResult IGraphicsState_Requestor__DrawRectangles( CoreGraphicsState *obj, virtual DFBResult DrawRectangles(
const DFBRectangle *rects, const DFBRectangle *rects,
u32 num ); u32 num
);
DFBResult IGraphicsState_Requestor__DrawLines( CoreGraphicsState *obj, virtual DFBResult DrawLines(
const DFBRegion *lines, const DFBRegion *lines,
u32 num ); u32 num
);
DFBResult IGraphicsState_Requestor__FillRectangles( CoreGraphicsState *obj, virtual DFBResult FillRectangles(
const DFBRectangle *rects, const DFBRectangle *rects,
u32 num ); u32 num
);
DFBResult IGraphicsState_Requestor__FillTriangles( CoreGraphicsState *obj, virtual DFBResult FillTriangles(
const DFBTriangle *triangles, const DFBTriangle *triangles,
u32 num ); u32 num
);
DFBResult IGraphicsState_Requestor__FillTrapezoids( CoreGraphicsState *obj, virtual DFBResult FillTrapezoids(
const DFBTrapezoid *trapezoids, const DFBTrapezoid *trapezoids,
u32 num ); u32 num
);
DFBResult IGraphicsState_Requestor__FillSpans( CoreGraphicsState *obj, virtual DFBResult FillSpans(
s32 y, s32 y,
const DFBSpan *spans, const DFBSpan *spans,
u32 num ); u32 num
);
DFBResult IGraphicsState_Requestor__Blit( CoreGraphicsState *obj, virtual DFBResult Blit(
const DFBRectangle *rects, const DFBRectangle *rects,
const DFBPoint *points, const DFBPoint *points,
u32 num ); u32 num
);
DFBResult IGraphicsState_Requestor__Blit2( CoreGraphicsState *obj, virtual DFBResult Blit2(
const DFBRectangle *rects, const DFBRectangle *rects,
const DFBPoint *points1, const DFBPoint *points1,
const DFBPoint *points2, const DFBPoint *points2,
u32 num ); u32 num
);
DFBResult IGraphicsState_Requestor__StretchBlit( CoreGraphicsState *obj, virtual DFBResult StretchBlit(
const DFBRectangle *srects, const DFBRectangle *srects,
const DFBRectangle *drects, const DFBRectangle *drects,
u32 num ); u32 num
);
DFBResult IGraphicsState_Requestor__TileBlit( CoreGraphicsState *obj, virtual DFBResult TileBlit(
const DFBRectangle *rects, const DFBRectangle *rects,
const DFBPoint *points1, const DFBPoint *points1,
const DFBPoint *points2, const DFBPoint *points2,
u32 num ); u32 num
);
DFBResult IGraphicsState_Requestor__TextureTriangles( CoreGraphicsState *ob j, virtual DFBResult TextureTriangles(
const DFBVertex *vertices, const DFBVertex *vertices,
u32 num, u32 num,
DFBTriangleFormation formation ); DFBTriangleFormation formation
);
DFBResult IGraphicsState_Requestor__ReleaseSource( CoreGraphicsState *obj };
);
DFBResult CoreGraphicsStateDispatch__Dispatch( CoreGraphicsState *obj, class CoreGraphicsStateDispatch
FusionID caller, {
int method,
void *ptr, public:
unsigned int length, CoreGraphicsStateDispatch( CoreDFB *core, IGraphicsState *real )
void *ret_ptr, :
unsigned int ret_size, core( core ),
unsigned int *ret_length ); real( real )
{
}
virtual DFBResult Dispatch( FusionID caller,
int method,
void *ptr,
unsigned int length,
void *ret_ptr,
unsigned int ret_size,
unsigned int *ret_length );
private:
CoreDFB *core;
IGraphicsState *real;
};
}
#endif
#endif #endif
 End of changes. 96 change blocks. 
198 lines changed or deleted 399 lines changed or added


 CoreGraphicsStateClient.h   CoreGraphicsStateClient.h 
skipping to change at line 52 skipping to change at line 52
CoreDFB *core; CoreDFB *core;
CardState *state; CardState *state;
CoreGraphicsState *gfx_state; CoreGraphicsState *gfx_state;
}; };
DFBResult CoreGraphicsStateClient_Init ( CoreGraphicsStateClient *client, DFBResult CoreGraphicsStateClient_Init ( CoreGraphicsStateClient *client,
CardState *state ); CardState *state );
void CoreGraphicsStateClient_Deinit ( CoreGraphicsStateClient
*client );
DFBResult CoreGraphicsStateClient_SetState ( CoreGraphicsStateClient *client, DFBResult CoreGraphicsStateClient_SetState ( CoreGraphicsStateClient *client,
CardState *state, CardState *state,
StateModificationFlags flags ); StateModificationFlags flags );
DFBResult CoreGraphicsStateClient_Update ( CoreGraphicsStateClient *client, DFBResult CoreGraphicsStateClient_Update ( CoreGraphicsStateClient *client,
DFBAccelerationMask accel, DFBAccelerationMask accel,
CardState *state ); CardState *state );
DFBResult CoreGraphicsStateClient_DrawRectangles ( CoreGraphicsStateClient *client, DFBResult CoreGraphicsStateClient_DrawRectangles ( CoreGraphicsStateClient *client,
const DFBRectangle *rects, const DFBRectangle *rects,
unsigned int num ); unsigned int num );
 End of changes. 1 change blocks. 
3 lines changed or deleted 0 lines changed or added


 CoreLayer.h   CoreLayer.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef ___CoreLayer__H___ #ifndef ___CoreLayer__H___
#define ___CoreLayer__H___ #define ___CoreLayer__H___
#include <core/CoreLayer_includes.h> #include "CoreLayer_includes.h"
/************************************************************************** ******************************************** /************************************************************************** ********************************************
* CoreLayer * CoreLayer
*/ */
#ifdef __cplusplus #ifdef __cplusplus
#include <core/Interface.h> #include <core/Interface.h>
extern "C" { extern "C" {
#endif #endif
DFBResult CoreLayer_CreateContext( DFBResult CoreLayer_CreateContext(
CoreLayer *obj, CoreLayer *obj,
CoreLayerContext **ret_context) ; CoreLayerContext **ret_context) ;
DFBResult CoreLayer_GetPrimaryContext(
CoreLayer *obj,
bool activate,
CoreLayerContext **ret_context)
;
DFBResult CoreLayer_ActivateContext( DFBResult CoreLayer_ActivateContext(
CoreLayer *obj, CoreLayer *obj,
CoreLayerContext *context); CoreLayerContext *context);
DFBResult CoreLayer_GetCurrentOutputField( void *CoreLayer_Init_Dispatch(
CoreLayer *obj,
s32 *ret_field);
DFBResult CoreLayer_SetLevel(
CoreLayer *obj,
s32 level);
DFBResult CoreLayer_WaitVSync(
CoreLayer *obj
);
void CoreLayer_Init_Dispatch(
CoreDFB *core, CoreDFB *core,
CoreLayer *obj, CoreLayer *obj,
FusionCall *call FusionCall *call
); );
void CoreLayer_Deinit_Dispatch( void CoreLayer_Deinit_Dispatch(
FusionCall *call void *dispatch
); );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif
namespace DirectFB {
/* /*
* CoreLayer Calls * CoreLayer Calls
*/ */
typedef enum { typedef enum {
_CoreLayer_CreateContext = 1, CoreLayer_CreateContext = 1,
_CoreLayer_GetPrimaryContext = 2, CoreLayer_ActivateContext = 2,
_CoreLayer_ActivateContext = 3,
_CoreLayer_GetCurrentOutputField = 4,
_CoreLayer_SetLevel = 5,
_CoreLayer_WaitVSync = 6,
} CoreLayerCall; } CoreLayerCall;
/* /*
* CoreLayer_CreateContext * CoreLayer_CreateContext
*/ */
typedef struct { typedef struct {
} CoreLayerCreateContext; } CoreLayerCreateContext;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
u32 context_id; u32 context_id;
} CoreLayerCreateContextReturn; } CoreLayerCreateContextReturn;
/* /*
* CoreLayer_GetPrimaryContext
*/
typedef struct {
bool activate;
} CoreLayerGetPrimaryContext;
typedef struct {
DFBResult result;
u32 context_id;
} CoreLayerGetPrimaryContextReturn;
/*
* CoreLayer_ActivateContext * CoreLayer_ActivateContext
*/ */
typedef struct { typedef struct {
u32 context_id; u32 context_id;
} CoreLayerActivateContext; } CoreLayerActivateContext;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreLayerActivateContextReturn; } CoreLayerActivateContextReturn;
/* class ILayer : public Interface
* CoreLayer_GetCurrentOutputField {
*/ public:
typedef struct { ILayer( CoreDFB *core )
} CoreLayerGetCurrentOutputField; :
Interface( core )
{
}
typedef struct { public:
DFBResult result; virtual DFBResult CreateContext(
s32 field; CoreLayerContext **ret_context
} CoreLayerGetCurrentOutputFieldReturn; ) = 0;
/* virtual DFBResult ActivateContext(
* CoreLayer_SetLevel CoreLayerContext *context
*/ ) = 0;
typedef struct {
s32 level;
} CoreLayerSetLevel;
typedef struct { };
DFBResult result;
} CoreLayerSetLevelReturn;
/* class ILayer_Real : public ILayer
* CoreLayer_WaitVSync {
*/ private:
typedef struct { CoreLayer *obj;
} CoreLayerWaitVSync;
typedef struct { public:
DFBResult result; ILayer_Real( CoreDFB *core, CoreLayer *obj )
} CoreLayerWaitVSyncReturn; :
ILayer( core ),
obj( obj )
{
}
DFBResult ILayer_Real__CreateContext( CoreLayer *obj, public:
CoreLayerContext **ret_context virtual DFBResult CreateContext(
); CoreLayerContext **ret_context
);
DFBResult ILayer_Real__GetPrimaryContext( CoreLayer *obj, virtual DFBResult ActivateContext(
bool activate, CoreLayerContext *context
CoreLayerContext **ret_context );
);
DFBResult ILayer_Real__ActivateContext( CoreLayer *obj, };
CoreLayerContext *context );
DFBResult ILayer_Real__GetCurrentOutputField( CoreLayer *obj, class ILayer_Requestor : public ILayer
s32 *ret_field ); {
private:
CoreLayer *obj;
DFBResult ILayer_Real__SetLevel( CoreLayer *obj, public:
s32 level ); ILayer_Requestor( CoreDFB *core, CoreLayer *obj )
:
ILayer( core ),
obj( obj )
{
}
DFBResult ILayer_Real__WaitVSync( CoreLayer *obj public:
); virtual DFBResult CreateContext(
CoreLayerContext **ret_context
);
DFBResult ILayer_Requestor__CreateContext( CoreLayer *obj, virtual DFBResult ActivateContext(
CoreLayerContext **ret_context CoreLayerContext *context
); );
DFBResult ILayer_Requestor__GetPrimaryContext( CoreLayer *obj, };
bool activate,
CoreLayerContext **ret_context
);
DFBResult ILayer_Requestor__ActivateContext( CoreLayer *obj, class CoreLayerDispatch
CoreLayerContext *context ); {
DFBResult ILayer_Requestor__GetCurrentOutputField( CoreLayer *obj, public:
s32 *ret_field ); CoreLayerDispatch( CoreDFB *core, ILayer *real )
:
core( core ),
real( real )
{
}
DFBResult ILayer_Requestor__SetLevel( CoreLayer *obj, virtual DFBResult Dispatch( FusionID caller,
s32 level ); int method,
void *ptr,
unsigned int length,
void *ret_ptr,
unsigned int ret_size,
unsigned int *ret_length );
DFBResult ILayer_Requestor__WaitVSync( CoreLayer *obj private:
); CoreDFB *core;
ILayer *real;
};
DFBResult CoreLayerDispatch__Dispatch( CoreLayer *obj, }
FusionID caller,
int method, #endif
void *ptr,
unsigned int length,
void *ret_ptr,
unsigned int ret_size,
unsigned int *ret_length );
#endif #endif
 End of changes. 26 change blocks. 
104 lines changed or deleted 84 lines changed or added


 CoreLayerContext.h   CoreLayerContext.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef ___CoreLayerContext__H___ #ifndef ___CoreLayerContext__H___
#define ___CoreLayerContext__H___ #define ___CoreLayerContext__H___
#include <core/CoreLayerContext_includes.h> #include "CoreLayerContext_includes.h"
/************************************************************************** ******************************************** /************************************************************************** ********************************************
* CoreLayerContext * CoreLayerContext
*/ */
#ifdef __cplusplus #ifdef __cplusplus
#include <core/Interface.h> #include <core/Interface.h>
extern "C" { extern "C" {
#endif #endif
DFBResult CoreLayerContext_GetPrimaryRegion(
CoreLayerContext *obj,
bool create,
CoreLayerRegion **ret_region);
DFBResult CoreLayerContext_TestConfiguration(
CoreLayerContext *obj,
const DFBDisplayLayerConfig *config,
DFBDisplayLayerConfigFlags *ret_failed);
DFBResult CoreLayerContext_SetConfiguration(
CoreLayerContext *obj,
const DFBDisplayLayerConfig *config);
DFBResult CoreLayerContext_SetSrcColorKey(
CoreLayerContext *obj,
const DFBColorKey *key);
DFBResult CoreLayerContext_SetDstColorKey(
CoreLayerContext *obj,
const DFBColorKey *key);
DFBResult CoreLayerContext_SetSourceRectangle(
CoreLayerContext *obj,
const DFBRectangle *rectangle);
DFBResult CoreLayerContext_SetScreenLocation(
CoreLayerContext *obj,
const DFBLocation *location);
DFBResult CoreLayerContext_SetScreenRectangle(
CoreLayerContext *obj,
const DFBRectangle *rectangle);
DFBResult CoreLayerContext_SetScreenPosition(
CoreLayerContext *obj,
const DFBPoint *position);
DFBResult CoreLayerContext_SetOpacity(
CoreLayerContext *obj,
u8 opacity);
DFBResult CoreLayerContext_SetRotation(
CoreLayerContext *obj,
s32 rotation);
DFBResult CoreLayerContext_SetColorAdjustment(
CoreLayerContext *obj,
const DFBColorAdjustment *adjustment);
DFBResult CoreLayerContext_SetFieldParity(
CoreLayerContext *obj,
u32 field);
DFBResult CoreLayerContext_SetClipRegions(
CoreLayerContext *obj,
const DFBRegion *regions,
u32 num,
bool positive);
DFBResult CoreLayerContext_CreateWindow( DFBResult CoreLayerContext_CreateWindow(
CoreLayerContext *obj, CoreLayerContext *obj,
const DFBWindowDescription *description, const DFBWindowDescription *description,
CoreWindow *parent,
CoreWindow *toplevel,
CoreWindow **ret_window); CoreWindow **ret_window);
DFBResult CoreLayerContext_FindWindow( DFBResult CoreLayerContext_SetConfiguration(
CoreLayerContext *obj, CoreLayerContext *obj,
DFBWindowID window_id, const DFBDisplayLayerConfig *config);
CoreWindow **ret_window);
DFBResult CoreLayerContext_FindWindowByResourceID( DFBResult CoreLayerContext_GetPrimaryRegion(
CoreLayerContext *obj, CoreLayerContext *obj,
u64 resource_id, bool create,
CoreWindow **ret_window); CoreLayerRegion **ret_region);
void CoreLayerContext_Init_Dispatch( void *CoreLayerContext_Init_Dispatch(
CoreDFB *core, CoreDFB *core,
CoreLayerContext *obj, CoreLayerContext *obj,
FusionCall *call FusionCall *call
); );
void CoreLayerContext_Deinit_Dispatch( void CoreLayerContext_Deinit_Dispatch(
FusionCall *call void *dispatch
); );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif
namespace DirectFB {
/* /*
* CoreLayerContext Calls * CoreLayerContext Calls
*/ */
typedef enum { typedef enum {
_CoreLayerContext_GetPrimaryRegion = 1, CoreLayerContext_CreateWindow = 1,
_CoreLayerContext_TestConfiguration = 2, CoreLayerContext_SetConfiguration = 2,
_CoreLayerContext_SetConfiguration = 3, CoreLayerContext_GetPrimaryRegion = 3,
_CoreLayerContext_SetSrcColorKey = 4,
_CoreLayerContext_SetDstColorKey = 5,
_CoreLayerContext_SetSourceRectangle = 6,
_CoreLayerContext_SetScreenLocation = 7,
_CoreLayerContext_SetScreenRectangle = 8,
_CoreLayerContext_SetScreenPosition = 9,
_CoreLayerContext_SetOpacity = 10,
_CoreLayerContext_SetRotation = 11,
_CoreLayerContext_SetColorAdjustment = 12,
_CoreLayerContext_SetFieldParity = 13,
_CoreLayerContext_SetClipRegions = 14,
_CoreLayerContext_CreateWindow = 15,
_CoreLayerContext_FindWindow = 16,
_CoreLayerContext_FindWindowByResourceID = 17,
} CoreLayerContextCall; } CoreLayerContextCall;
/* /*
* CoreLayerContext_GetPrimaryRegion
*/
typedef struct {
bool create;
} CoreLayerContextGetPrimaryRegion;
typedef struct {
DFBResult result;
u32 region_id;
} CoreLayerContextGetPrimaryRegionReturn;
/*
* CoreLayerContext_TestConfiguration
*/
typedef struct {
DFBDisplayLayerConfig config;
} CoreLayerContextTestConfiguration;
typedef struct {
DFBResult result;
DFBDisplayLayerConfigFlags failed;
} CoreLayerContextTestConfigurationReturn;
/*
* CoreLayerContext_SetConfiguration
*/
typedef struct {
DFBDisplayLayerConfig config;
} CoreLayerContextSetConfiguration;
typedef struct {
DFBResult result;
} CoreLayerContextSetConfigurationReturn;
/*
* CoreLayerContext_SetSrcColorKey
*/
typedef struct {
DFBColorKey key;
} CoreLayerContextSetSrcColorKey;
typedef struct {
DFBResult result;
} CoreLayerContextSetSrcColorKeyReturn;
/*
* CoreLayerContext_SetDstColorKey
*/
typedef struct {
DFBColorKey key;
} CoreLayerContextSetDstColorKey;
typedef struct {
DFBResult result;
} CoreLayerContextSetDstColorKeyReturn;
/*
* CoreLayerContext_SetSourceRectangle
*/
typedef struct {
DFBRectangle rectangle;
} CoreLayerContextSetSourceRectangle;
typedef struct {
DFBResult result;
} CoreLayerContextSetSourceRectangleReturn;
/*
* CoreLayerContext_SetScreenLocation
*/
typedef struct {
DFBLocation location;
} CoreLayerContextSetScreenLocation;
typedef struct {
DFBResult result;
} CoreLayerContextSetScreenLocationReturn;
/*
* CoreLayerContext_SetScreenRectangle
*/
typedef struct {
DFBRectangle rectangle;
} CoreLayerContextSetScreenRectangle;
typedef struct {
DFBResult result;
} CoreLayerContextSetScreenRectangleReturn;
/*
* CoreLayerContext_SetScreenPosition
*/
typedef struct {
DFBPoint position;
} CoreLayerContextSetScreenPosition;
typedef struct {
DFBResult result;
} CoreLayerContextSetScreenPositionReturn;
/*
* CoreLayerContext_SetOpacity
*/
typedef struct {
u8 opacity;
} CoreLayerContextSetOpacity;
typedef struct {
DFBResult result;
} CoreLayerContextSetOpacityReturn;
/*
* CoreLayerContext_SetRotation
*/
typedef struct {
s32 rotation;
} CoreLayerContextSetRotation;
typedef struct {
DFBResult result;
} CoreLayerContextSetRotationReturn;
/*
* CoreLayerContext_SetColorAdjustment
*/
typedef struct {
DFBColorAdjustment adjustment;
} CoreLayerContextSetColorAdjustment;
typedef struct {
DFBResult result;
} CoreLayerContextSetColorAdjustmentReturn;
/*
* CoreLayerContext_SetFieldParity
*/
typedef struct {
u32 field;
} CoreLayerContextSetFieldParity;
typedef struct {
DFBResult result;
} CoreLayerContextSetFieldParityReturn;
/*
* CoreLayerContext_SetClipRegions
*/
typedef struct {
u32 num;
bool positive;
/* 'num' DFBRegion follow (regions) */
} CoreLayerContextSetClipRegions;
typedef struct {
DFBResult result;
} CoreLayerContextSetClipRegionsReturn;
/*
* CoreLayerContext_CreateWindow * CoreLayerContext_CreateWindow
*/ */
typedef struct { typedef struct {
DFBWindowDescription description; DFBWindowDescription description;
bool parent_set;
u32 parent_id;
bool toplevel_set;
u32 toplevel_id;
} CoreLayerContextCreateWindow; } CoreLayerContextCreateWindow;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
u32 window_id; u32 window_id;
} CoreLayerContextCreateWindowReturn; } CoreLayerContextCreateWindowReturn;
/* /*
* CoreLayerContext_FindWindow * CoreLayerContext_SetConfiguration
*/ */
typedef struct { typedef struct {
DFBWindowID window_id; DFBDisplayLayerConfig config;
} CoreLayerContextFindWindow; } CoreLayerContextSetConfiguration;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
u32 window_id; } CoreLayerContextSetConfigurationReturn;
} CoreLayerContextFindWindowReturn;
/* /*
* CoreLayerContext_FindWindowByResourceID * CoreLayerContext_GetPrimaryRegion
*/ */
typedef struct { typedef struct {
u64 resource_id; bool create;
} CoreLayerContextFindWindowByResourceID; } CoreLayerContextGetPrimaryRegion;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
u32 window_id; u32 region_id;
} CoreLayerContextFindWindowByResourceIDReturn; } CoreLayerContextGetPrimaryRegionReturn;
DFBResult ILayerContext_Real__GetPrimaryRegion( CoreLayerContext *obj,
bool create,
CoreLayerRegion **ret_region )
;
DFBResult ILayerContext_Real__TestConfiguration( CoreLayerContext *obj,
const DFBDisplayLayerConfig *config,
DFBDisplayLayerConfigFlags *ret_failed )
;
DFBResult ILayerContext_Real__SetConfiguration( CoreLayerContext *obj,
const DFBDisplayLayerConfig *config );
DFBResult ILayerContext_Real__SetSrcColorKey( CoreLayerContext *obj,
const DFBColorKey *key );
DFBResult ILayerContext_Real__SetDstColorKey( CoreLayerContext *obj,
const DFBColorKey *key );
DFBResult ILayerContext_Real__SetSourceRectangle( CoreLayerContext *obj,
const DFBRectangle *rectangle );
DFBResult ILayerContext_Real__SetScreenLocation( CoreLayerContext *obj,
const DFBLocation *location );
DFBResult ILayerContext_Real__SetScreenRectangle( CoreLayerContext *obj, class ILayerContext : public Interface
const DFBRectangle *rectangle ); {
public:
ILayerContext( CoreDFB *core )
:
Interface( core )
{
}
DFBResult ILayerContext_Real__SetScreenPosition( CoreLayerContext *obj, public:
const DFBPoint *position ); virtual DFBResult CreateWindow(
const DFBWindowDescription *description,
CoreWindow **ret_window
) = 0;
DFBResult ILayerContext_Real__SetOpacity( CoreLayerContext *obj, virtual DFBResult SetConfiguration(
u8 opacity ); const DFBDisplayLayerConfig *config
) = 0;
DFBResult ILayerContext_Real__SetRotation( CoreLayerContext *obj, virtual DFBResult GetPrimaryRegion(
s32 rotation ); bool create,
CoreLayerRegion **ret_region
) = 0;
DFBResult ILayerContext_Real__SetColorAdjustment( CoreLayerContext *obj, };
const DFBColorAdjustment *adjustment )
;
DFBResult ILayerContext_Real__SetFieldParity( CoreLayerContext *obj, class ILayerContext_Real : public ILayerContext
u32 field ); {
private:
CoreLayerContext *obj;
DFBResult ILayerContext_Real__SetClipRegions( CoreLayerContext *obj, public:
const DFBRegion *regions, ILayerContext_Real( CoreDFB *core, CoreLayerContext *obj )
u32 num, :
bool positive ); ILayerContext( core ),
obj( obj )
{
}
DFBResult ILayerContext_Real__CreateWindow( CoreLayerContext *obj, public:
virtual DFBResult CreateWindow(
const DFBWindowDescription *description, const DFBWindowDescription *description,
CoreWindow *parent, CoreWindow **ret_window
CoreWindow *toplevel, );
CoreWindow **ret_window )
;
DFBResult ILayerContext_Real__FindWindow( CoreLayerContext *obj,
DFBWindowID window_id,
CoreWindow **ret_window )
;
DFBResult ILayerContext_Real__FindWindowByResourceID( CoreLayerContext *obj virtual DFBResult SetConfiguration(
, const DFBDisplayLayerConfig *config
u64 resource_id, );
CoreWindow **ret_window )
;
DFBResult ILayerContext_Requestor__GetPrimaryRegion( CoreLayerContext *obj, virtual DFBResult GetPrimaryRegion(
bool create, bool create,
CoreLayerRegion **ret_region ) CoreLayerRegion **ret_region
; );
DFBResult ILayerContext_Requestor__TestConfiguration( CoreLayerContext *obj
,
const DFBDisplayLayerConfig *config,
DFBDisplayLayerConfigFlags *ret_failed )
;
DFBResult ILayerContext_Requestor__SetConfiguration( CoreLayerContext *obj,
const DFBDisplayLayerConfig *config );
DFBResult ILayerContext_Requestor__SetSrcColorKey( CoreLayerContext *obj,
const DFBColorKey *key );
DFBResult ILayerContext_Requestor__SetDstColorKey( CoreLayerContext *obj,
const DFBColorKey *key );
DFBResult ILayerContext_Requestor__SetSourceRectangle( CoreLayerContext *ob };
j,
const DFBRectangle *rectangle );
DFBResult ILayerContext_Requestor__SetScreenLocation( CoreLayerContext *obj class ILayerContext_Requestor : public ILayerContext
, {
const DFBLocation *location ); private:
CoreLayerContext *obj;
DFBResult ILayerContext_Requestor__SetScreenRectangle( CoreLayerContext *ob public:
j, ILayerContext_Requestor( CoreDFB *core, CoreLayerContext *obj )
const DFBRectangle *rectangle ); :
ILayerContext( core ),
obj( obj )
{
}
DFBResult ILayerContext_Requestor__SetScreenPosition( CoreLayerContext *obj public:
, virtual DFBResult CreateWindow(
const DFBPoint *position ); const DFBWindowDescription *description,
CoreWindow **ret_window
);
DFBResult ILayerContext_Requestor__SetOpacity( CoreLayerContext *obj, virtual DFBResult SetConfiguration(
u8 opacity ); const DFBDisplayLayerConfig *config
);
DFBResult ILayerContext_Requestor__SetRotation( CoreLayerContext *obj, virtual DFBResult GetPrimaryRegion(
s32 rotation ); bool create,
CoreLayerRegion **ret_region
);
DFBResult ILayerContext_Requestor__SetColorAdjustment( CoreLayerContext *ob };
j,
const DFBColorAdjustment *adjustment )
;
DFBResult ILayerContext_Requestor__SetFieldParity( CoreLayerContext *obj, class CoreLayerContextDispatch
u32 field ); {
DFBResult ILayerContext_Requestor__SetClipRegions( CoreLayerContext *obj, public:
const DFBRegion *regions, CoreLayerContextDispatch( CoreDFB *core, ILayerContext *real )
u32 num, :
bool positive ); core( core ),
real( real )
{
}
DFBResult ILayerContext_Requestor__CreateWindow( CoreLayerContext *obj, virtual DFBResult Dispatch( FusionID caller,
const DFBWindowDescription *description, int method,
CoreWindow *parent, void *ptr,
CoreWindow *toplevel, unsigned int length,
CoreWindow **ret_window ) void *ret_ptr,
; unsigned int ret_size,
unsigned int *ret_length );
DFBResult ILayerContext_Requestor__FindWindow( CoreLayerContext *obj, private:
DFBWindowID window_id, CoreDFB *core;
CoreWindow **ret_window ) ILayerContext *real;
; };
DFBResult ILayerContext_Requestor__FindWindowByResourceID( CoreLayerContext }
*obj,
u64 resource_id,
CoreWindow **ret_window )
;
DFBResult CoreLayerContextDispatch__Dispatch( CoreLayerContext *obj, #endif
FusionID caller,
int method,
void *ptr,
unsigned int length,
void *ret_ptr,
unsigned int ret_size,
unsigned int *ret_length );
#endif #endif
 End of changes. 44 change blocks. 
385 lines changed or deleted 111 lines changed or added


 CoreLayerRegion.h   CoreLayerRegion.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef ___CoreLayerRegion__H___ #ifndef ___CoreLayerRegion__H___
#define ___CoreLayerRegion__H___ #define ___CoreLayerRegion__H___
#include <core/CoreLayerRegion_includes.h> #include "CoreLayerRegion_includes.h"
/************************************************************************** ******************************************** /************************************************************************** ********************************************
* CoreLayerRegion * CoreLayerRegion
*/ */
#ifdef __cplusplus #ifdef __cplusplus
#include <core/Interface.h> #include <core/Interface.h>
extern "C" { extern "C" {
#endif #endif
DFBResult CoreLayerRegion_GetSurface(
CoreLayerRegion *obj,
CoreSurface **ret_surface)
;
DFBResult CoreLayerRegion_FlipUpdate( DFBResult CoreLayerRegion_FlipUpdate(
CoreLayerRegion *obj, CoreLayerRegion *obj,
const DFBRegion *update, const DFBRegion *update,
DFBSurfaceFlipFlags flags); DFBSurfaceFlipFlags flags);
void CoreLayerRegion_Init_Dispatch( void *CoreLayerRegion_Init_Dispatch(
CoreDFB *core, CoreDFB *core,
CoreLayerRegion *obj, CoreLayerRegion *obj,
FusionCall *call FusionCall *call
); );
void CoreLayerRegion_Deinit_Dispatch( void CoreLayerRegion_Deinit_Dispatch(
FusionCall *call void *dispatch
); );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif
namespace DirectFB {
/* /*
* CoreLayerRegion Calls * CoreLayerRegion Calls
*/ */
typedef enum { typedef enum {
_CoreLayerRegion_GetSurface = 1, CoreLayerRegion_FlipUpdate = 1,
_CoreLayerRegion_FlipUpdate = 2,
} CoreLayerRegionCall; } CoreLayerRegionCall;
/* /*
* CoreLayerRegion_GetSurface
*/
typedef struct {
} CoreLayerRegionGetSurface;
typedef struct {
DFBResult result;
u32 surface_id;
} CoreLayerRegionGetSurfaceReturn;
/*
* CoreLayerRegion_FlipUpdate * CoreLayerRegion_FlipUpdate
*/ */
typedef struct { typedef struct {
bool update_set; bool update_set;
DFBRegion update; DFBRegion update;
DFBSurfaceFlipFlags flags; DFBSurfaceFlipFlags flags;
} CoreLayerRegionFlipUpdate; } CoreLayerRegionFlipUpdate;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreLayerRegionFlipUpdateReturn; } CoreLayerRegionFlipUpdateReturn;
DFBResult ILayerRegion_Real__GetSurface( CoreLayerRegion *obj, class ILayerRegion : public Interface
CoreSurface **ret_surface {
); public:
ILayerRegion( CoreDFB *core )
:
Interface( core )
{
}
DFBResult ILayerRegion_Real__FlipUpdate( CoreLayerRegion *obj, public:
virtual DFBResult FlipUpdate(
const DFBRegion *update, const DFBRegion *update,
DFBSurfaceFlipFlags flags ); DFBSurfaceFlipFlags flags
) = 0;
DFBResult ILayerRegion_Requestor__GetSurface( CoreLayerRegion *obj, };
CoreSurface **ret_surface
);
DFBResult ILayerRegion_Requestor__FlipUpdate( CoreLayerRegion *obj, class ILayerRegion_Real : public ILayerRegion
{
private:
CoreLayerRegion *obj;
public:
ILayerRegion_Real( CoreDFB *core, CoreLayerRegion *obj )
:
ILayerRegion( core ),
obj( obj )
{
}
public:
virtual DFBResult FlipUpdate(
const DFBRegion *update, const DFBRegion *update,
DFBSurfaceFlipFlags flags ); DFBSurfaceFlipFlags flags
);
DFBResult CoreLayerRegionDispatch__Dispatch( CoreLayerRegion *obj, };
FusionID caller,
int method, class ILayerRegion_Requestor : public ILayerRegion
void *ptr, {
unsigned int length, private:
void *ret_ptr, CoreLayerRegion *obj;
unsigned int ret_size,
unsigned int *ret_length ); public:
ILayerRegion_Requestor( CoreDFB *core, CoreLayerRegion *obj )
:
ILayerRegion( core ),
obj( obj )
{
}
public:
virtual DFBResult FlipUpdate(
const DFBRegion *update,
DFBSurfaceFlipFlags flags
);
};
class CoreLayerRegionDispatch
{
public:
CoreLayerRegionDispatch( CoreDFB *core, ILayerRegion *real )
:
core( core ),
real( real )
{
}
virtual DFBResult Dispatch( FusionID caller,
int method,
void *ptr,
unsigned int length,
void *ret_ptr,
unsigned int ret_size,
unsigned int *ret_length );
private:
CoreDFB *core;
ILayerRegion *real;
};
}
#endif
#endif #endif
 End of changes. 14 change blocks. 
40 lines changed or deleted 86 lines changed or added


 CorePalette.h   CorePalette.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef ___CorePalette__H___ #ifndef ___CorePalette__H___
#define ___CorePalette__H___ #define ___CorePalette__H___
#include <core/CorePalette_includes.h> #include "CorePalette_includes.h"
/************************************************************************** ******************************************** /************************************************************************** ********************************************
* CorePalette * CorePalette
*/ */
#ifdef __cplusplus #ifdef __cplusplus
#include <core/Interface.h> #include <core/Interface.h>
extern "C" { extern "C" {
#endif #endif
skipping to change at line 56 skipping to change at line 56
const DFBColor *colors, const DFBColor *colors,
u32 num, u32 num,
u32 offset); u32 offset);
DFBResult CorePalette_SetEntriesYUV( DFBResult CorePalette_SetEntriesYUV(
CorePalette *obj, CorePalette *obj,
const DFBColorYUV *colors, const DFBColorYUV *colors,
u32 num, u32 num,
u32 offset); u32 offset);
void CorePalette_Init_Dispatch( void *CorePalette_Init_Dispatch(
CoreDFB *core, CoreDFB *core,
CorePalette *obj, CorePalette *obj,
FusionCall *call FusionCall *call
); );
void CorePalette_Deinit_Dispatch( void CorePalette_Deinit_Dispatch(
FusionCall *call void *dispatch
); );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif
namespace DirectFB {
/* /*
* CorePalette Calls * CorePalette Calls
*/ */
typedef enum { typedef enum {
_CorePalette_SetEntries = 1, CorePalette_SetEntries = 1,
_CorePalette_SetEntriesYUV = 2, CorePalette_SetEntriesYUV = 2,
} CorePaletteCall; } CorePaletteCall;
/* /*
* CorePalette_SetEntries * CorePalette_SetEntries
*/ */
typedef struct { typedef struct {
u32 num; u32 num;
u32 offset; u32 offset;
/* 'num' DFBColor follow (colors) */ /* 'num' DFBColor follow (colors) */
} CorePaletteSetEntries; } CorePaletteSetEntries;
skipping to change at line 104 skipping to change at line 105
typedef struct { typedef struct {
u32 num; u32 num;
u32 offset; u32 offset;
/* 'num' DFBColorYUV follow (colors) */ /* 'num' DFBColorYUV follow (colors) */
} CorePaletteSetEntriesYUV; } CorePaletteSetEntriesYUV;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CorePaletteSetEntriesYUVReturn; } CorePaletteSetEntriesYUVReturn;
DFBResult IPalette_Real__SetEntries( CorePalette *obj, class IPalette : public Interface
{
public:
IPalette( CoreDFB *core )
:
Interface( core )
{
}
public:
virtual DFBResult SetEntries(
const DFBColor *colors, const DFBColor *colors,
u32 num, u32 num,
u32 offset ); u32 offset
) = 0;
DFBResult IPalette_Real__SetEntriesYUV( CorePalette *obj, virtual DFBResult SetEntriesYUV(
const DFBColorYUV *colors, const DFBColorYUV *colors,
u32 num, u32 num,
u32 offset ); u32 offset
) = 0;
DFBResult IPalette_Requestor__SetEntries( CorePalette *obj, };
class IPalette_Real : public IPalette
{
private:
CorePalette *obj;
public:
IPalette_Real( CoreDFB *core, CorePalette *obj )
:
IPalette( core ),
obj( obj )
{
}
public:
virtual DFBResult SetEntries(
const DFBColor *colors, const DFBColor *colors,
u32 num, u32 num,
u32 offset ); u32 offset
);
DFBResult IPalette_Requestor__SetEntriesYUV( CorePalette *obj, virtual DFBResult SetEntriesYUV(
const DFBColorYUV *colors, const DFBColorYUV *colors,
u32 num, u32 num,
u32 offset ); u32 offset
);
DFBResult CorePaletteDispatch__Dispatch( CorePalette *obj, };
FusionID caller,
int method, class IPalette_Requestor : public IPalette
void *ptr, {
unsigned int length, private:
void *ret_ptr, CorePalette *obj;
unsigned int ret_size,
unsigned int *ret_length ); public:
IPalette_Requestor( CoreDFB *core, CorePalette *obj )
:
IPalette( core ),
obj( obj )
{
}
public:
virtual DFBResult SetEntries(
const DFBColor *colors,
u32 num,
u32 offset
);
virtual DFBResult SetEntriesYUV(
const DFBColorYUV *colors,
u32 num,
u32 offset
);
};
class CorePaletteDispatch
{
public:
CorePaletteDispatch( CoreDFB *core, IPalette *real )
:
core( core ),
real( real )
{
}
virtual DFBResult Dispatch( FusionID caller,
int method,
void *ptr,
unsigned int length,
void *ret_ptr,
unsigned int ret_size,
unsigned int *ret_length );
private:
CoreDFB *core;
IPalette *real;
};
}
#endif
#endif #endif
 End of changes. 14 change blocks. 
22 lines changed or deleted 102 lines changed or added


 CoreSurface.h   CoreSurface.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef ___CoreSurface__H___ #ifndef ___CoreSurface__H___
#define ___CoreSurface__H___ #define ___CoreSurface__H___
#include <core/CoreSurface_includes.h> #include "CoreSurface_includes.h"
/************************************************************************** ******************************************** /************************************************************************** ********************************************
* CoreSurface * CoreSurface
*/ */
#ifdef __cplusplus #ifdef __cplusplus
#include <core/Interface.h> #include <core/Interface.h>
extern "C" { extern "C" {
#endif #endif
DFBResult CoreSurface_SetConfig( DFBResult CoreSurface_SetConfig(
CoreSurface *obj, CoreSurface *obj,
const CoreSurfaceConfig *config); const CoreSurfaceConfig *config);
DFBResult CoreSurface_Flip( DFBResult CoreSurface_LockBuffer(
CoreSurface *obj,
bool swap);
DFBResult CoreSurface_GetPalette(
CoreSurface *obj,
CorePalette **ret_palette)
;
DFBResult CoreSurface_SetPalette(
CoreSurface *obj,
CorePalette *palette);
DFBResult CoreSurface_SetAlphaRamp(
CoreSurface *obj,
u8 a0,
u8 a1,
u8 a2,
u8 a3);
DFBResult CoreSurface_SetField(
CoreSurface *obj,
s32 field);
DFBResult CoreSurface_PreLockBuffer(
CoreSurface *obj, CoreSurface *obj,
CoreSurfaceBuffer *buffer, CoreSurfaceBufferRole role,
CoreSurfaceAccessorID accessor, CoreSurfaceAccessorID accessor,
CoreSurfaceAccessFlags access, CoreSurfaceAccessFlags access,
CoreSurfaceAllocation **ret_allocati on); CoreSurfaceBufferLock *ret_lock);
DFBResult CoreSurface_PreLockBuffer2( DFBResult CoreSurface_UnlockBuffer(
CoreSurface *obj, CoreSurface *obj,
CoreSurfaceBufferRole role, CoreSurfaceBufferLock *lock);
CoreSurfaceAccessorID accessor,
CoreSurfaceAccessFlags access,
bool lock,
CoreSurfaceAllocation **ret_allocati
on);
DFBResult CoreSurface_PreReadBuffer( DFBResult CoreSurface_Flip(
CoreSurface *obj, CoreSurface *obj,
CoreSurfaceBuffer *buffer, bool swap);
const DFBRectangle *rect,
CoreSurfaceAllocation **ret_allocati
on);
DFBResult CoreSurface_PreWriteBuffer( DFBResult CoreSurface_SetPalette(
CoreSurface *obj, CoreSurface *obj,
CoreSurfaceBuffer *buffer, CorePalette *palette);
const DFBRectangle *rect,
CoreSurfaceAllocation **ret_allocati
on);
void CoreSurface_Init_Dispatch( void *CoreSurface_Init_Dispatch(
CoreDFB *core, CoreDFB *core,
CoreSurface *obj, CoreSurface *obj,
FusionCall *call FusionCall *call
); );
void CoreSurface_Deinit_Dispatch( void CoreSurface_Deinit_Dispatch(
FusionCall *call void *dispatch
); );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif
namespace DirectFB {
/* /*
* CoreSurface Calls * CoreSurface Calls
*/ */
typedef enum { typedef enum {
_CoreSurface_SetConfig = 1, CoreSurface_SetConfig = 1,
_CoreSurface_Flip = 2, CoreSurface_LockBuffer = 2,
_CoreSurface_GetPalette = 3, CoreSurface_UnlockBuffer = 3,
_CoreSurface_SetPalette = 4, CoreSurface_Flip = 4,
_CoreSurface_SetAlphaRamp = 5, CoreSurface_SetPalette = 5,
_CoreSurface_SetField = 6,
_CoreSurface_PreLockBuffer = 7,
_CoreSurface_PreLockBuffer2 = 8,
_CoreSurface_PreReadBuffer = 9,
_CoreSurface_PreWriteBuffer = 10,
} CoreSurfaceCall; } CoreSurfaceCall;
/* /*
* CoreSurface_SetConfig * CoreSurface_SetConfig
*/ */
typedef struct { typedef struct {
CoreSurfaceConfig config; CoreSurfaceConfig config;
} CoreSurfaceSetConfig; } CoreSurfaceSetConfig;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreSurfaceSetConfigReturn; } CoreSurfaceSetConfigReturn;
/* /*
* CoreSurface_Flip * CoreSurface_LockBuffer
*/ */
typedef struct { typedef struct {
bool swap; CoreSurfaceBufferRole role;
} CoreSurfaceFlip; CoreSurfaceAccessorID accessor;
CoreSurfaceAccessFlags access;
} CoreSurfaceLockBuffer;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreSurfaceFlipReturn; CoreSurfaceBufferLock lock;
} CoreSurfaceLockBufferReturn;
/* /*
* CoreSurface_GetPalette * CoreSurface_UnlockBuffer
*/ */
typedef struct { typedef struct {
} CoreSurfaceGetPalette; CoreSurfaceBufferLock lock;
} CoreSurfaceUnlockBuffer;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
u32 palette_id; CoreSurfaceBufferLock lock;
} CoreSurfaceGetPaletteReturn; } CoreSurfaceUnlockBufferReturn;
/* /*
* CoreSurface_SetPalette * CoreSurface_Flip
*/ */
typedef struct { typedef struct {
u32 palette_id; bool swap;
} CoreSurfaceSetPalette; } CoreSurfaceFlip;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreSurfaceSetPaletteReturn; } CoreSurfaceFlipReturn;
/* /*
* CoreSurface_SetAlphaRamp * CoreSurface_SetPalette
*/ */
typedef struct { typedef struct {
u8 a0; u32 palette_id;
u8 a1; } CoreSurfaceSetPalette;
u8 a2;
u8 a3;
} CoreSurfaceSetAlphaRamp;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreSurfaceSetAlphaRampReturn; } CoreSurfaceSetPaletteReturn;
/* class ISurface : public Interface
* CoreSurface_SetField {
*/ public:
typedef struct { ISurface( CoreDFB *core )
s32 field; :
} CoreSurfaceSetField; Interface( core )
{
}
typedef struct { public:
DFBResult result; virtual DFBResult SetConfig(
} CoreSurfaceSetFieldReturn; const CoreSurfaceConfig *config
) = 0;
/* virtual DFBResult LockBuffer(
* CoreSurface_PreLockBuffer CoreSurfaceBufferRole role,
*/ CoreSurfaceAccessorID accessor,
typedef struct { CoreSurfaceAccessFlags access,
u32 buffer_id; CoreSurfaceBufferLock *ret_lock
CoreSurfaceAccessorID accessor; ) = 0;
CoreSurfaceAccessFlags access;
} CoreSurfacePreLockBuffer;
typedef struct { virtual DFBResult UnlockBuffer(
DFBResult result; CoreSurfaceBufferLock *lock
u32 allocation_id; ) = 0;
} CoreSurfacePreLockBufferReturn;
/* virtual DFBResult Flip(
* CoreSurface_PreLockBuffer2 bool swap
*/ ) = 0;
typedef struct {
CoreSurfaceBufferRole role;
CoreSurfaceAccessorID accessor;
CoreSurfaceAccessFlags access;
bool lock;
} CoreSurfacePreLockBuffer2;
typedef struct { virtual DFBResult SetPalette(
DFBResult result; CorePalette *palette
u32 allocation_id; ) = 0;
} CoreSurfacePreLockBuffer2Return;
/* };
* CoreSurface_PreReadBuffer
*/
typedef struct {
u32 buffer_id;
DFBRectangle rect;
} CoreSurfacePreReadBuffer;
typedef struct { class ISurface_Real : public ISurface
DFBResult result; {
u32 allocation_id; private:
} CoreSurfacePreReadBufferReturn; CoreSurface *obj;
/* public:
* CoreSurface_PreWriteBuffer ISurface_Real( CoreDFB *core, CoreSurface *obj )
*/ :
typedef struct { ISurface( core ),
u32 buffer_id; obj( obj )
DFBRectangle rect; {
} CoreSurfacePreWriteBuffer; }
typedef struct { public:
DFBResult result; virtual DFBResult SetConfig(
u32 allocation_id; const CoreSurfaceConfig *config
} CoreSurfacePreWriteBufferReturn; );
DFBResult ISurface_Real__SetConfig( CoreSurface *obj, virtual DFBResult LockBuffer(
const CoreSurfaceConfig *config ); CoreSurfaceBufferRole role,
CoreSurfaceAccessorID accessor,
CoreSurfaceAccessFlags access,
CoreSurfaceBufferLock *ret_lock
);
DFBResult ISurface_Real__Flip( CoreSurface *obj, virtual DFBResult UnlockBuffer(
bool swap ); CoreSurfaceBufferLock *lock
);
DFBResult ISurface_Real__GetPalette( CoreSurface *obj, virtual DFBResult Flip(
CorePalette **ret_palette bool swap
); );
DFBResult ISurface_Real__SetPalette( CoreSurface *obj, virtual DFBResult SetPalette(
CorePalette *palette ); CorePalette *palette
);
DFBResult ISurface_Real__SetAlphaRamp( CoreSurface *obj, };
u8 a0,
u8 a1,
u8 a2,
u8 a3 );
DFBResult ISurface_Real__SetField( CoreSurface *obj, class ISurface_Requestor : public ISurface
s32 field ); {
private:
CoreSurface *obj;
DFBResult ISurface_Real__PreLockBuffer( CoreSurface *obj, public:
CoreSurfaceBuffer *buffer, ISurface_Requestor( CoreDFB *core, CoreSurface *obj )
CoreSurfaceAccessorID accessor, :
CoreSurfaceAccessFlags access, ISurface( core ),
CoreSurfaceAllocation **ret_allocati obj( obj )
on ); {
}
DFBResult ISurface_Real__PreLockBuffer2( CoreSurface *obj, public:
virtual DFBResult SetConfig(
const CoreSurfaceConfig *config
);
virtual DFBResult LockBuffer(
CoreSurfaceBufferRole role, CoreSurfaceBufferRole role,
CoreSurfaceAccessorID accessor, CoreSurfaceAccessorID accessor,
CoreSurfaceAccessFlags access, CoreSurfaceAccessFlags access,
bool lock, CoreSurfaceBufferLock *ret_lock
CoreSurfaceAllocation **ret_allocati );
on );
DFBResult ISurface_Real__PreReadBuffer( CoreSurface *obj,
CoreSurfaceBuffer *buffer,
const DFBRectangle *rect,
CoreSurfaceAllocation **ret_allocati
on );
DFBResult ISurface_Real__PreWriteBuffer( CoreSurface *obj,
CoreSurfaceBuffer *buffer,
const DFBRectangle *rect,
CoreSurfaceAllocation **ret_allocati
on );
DFBResult ISurface_Requestor__SetConfig( CoreSurface *obj,
const CoreSurfaceConfig *config );
DFBResult ISurface_Requestor__Flip( CoreSurface *obj, virtual DFBResult UnlockBuffer(
bool swap ); CoreSurfaceBufferLock *lock
);
DFBResult ISurface_Requestor__GetPalette( CoreSurface *obj, virtual DFBResult Flip(
CorePalette **ret_palette bool swap
); );
DFBResult ISurface_Requestor__SetPalette( CoreSurface *obj, virtual DFBResult SetPalette(
CorePalette *palette ); CorePalette *palette
);
DFBResult ISurface_Requestor__SetAlphaRamp( CoreSurface *obj, };
u8 a0,
u8 a1,
u8 a2,
u8 a3 );
DFBResult ISurface_Requestor__SetField( CoreSurface *obj, class CoreSurfaceDispatch
s32 field ); {
DFBResult ISurface_Requestor__PreLockBuffer( CoreSurface *obj, public:
CoreSurfaceBuffer *buffer, CoreSurfaceDispatch( CoreDFB *core, ISurface *real )
CoreSurfaceAccessorID accessor, :
CoreSurfaceAccessFlags access, core( core ),
CoreSurfaceAllocation **ret_allocati real( real )
on ); {
}
DFBResult ISurface_Requestor__PreLockBuffer2( CoreSurface *obj, virtual DFBResult Dispatch( FusionID caller,
CoreSurfaceBufferRole role, int method,
CoreSurfaceAccessorID accessor, void *ptr,
CoreSurfaceAccessFlags access, unsigned int length,
bool lock, void *ret_ptr,
CoreSurfaceAllocation **ret_allocati unsigned int ret_size,
on ); unsigned int *ret_length );
DFBResult ISurface_Requestor__PreReadBuffer( CoreSurface *obj, private:
CoreSurfaceBuffer *buffer, CoreDFB *core;
const DFBRectangle *rect, ISurface *real;
CoreSurfaceAllocation **ret_allocati };
on );
DFBResult ISurface_Requestor__PreWriteBuffer( CoreSurface *obj, }
CoreSurfaceBuffer *buffer,
const DFBRectangle *rect,
CoreSurfaceAllocation **ret_allocati
on );
DFBResult CoreSurfaceDispatch__Dispatch( CoreSurface *obj, #endif
FusionID caller,
int method,
void *ptr,
unsigned int length,
void *ret_ptr,
unsigned int ret_size,
unsigned int *ret_length );
#endif #endif
 End of changes. 55 change blocks. 
219 lines changed or deleted 149 lines changed or added


 CoreWindow.h   CoreWindow.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef ___CoreWindow__H___ #ifndef ___CoreWindow__H___
#define ___CoreWindow__H___ #define ___CoreWindow__H___
#include <core/CoreWindow_includes.h> #include "CoreWindow_includes.h"
/************************************************************************** ******************************************** /************************************************************************** ********************************************
* CoreWindow * CoreWindow
*/ */
#ifdef __cplusplus #ifdef __cplusplus
#include <core/Interface.h> #include <core/Interface.h>
extern "C" { extern "C" {
#endif #endif
skipping to change at line 62 skipping to change at line 62
const DFBRegion *update); const DFBRegion *update);
DFBResult CoreWindow_Restack( DFBResult CoreWindow_Restack(
CoreWindow *obj, CoreWindow *obj,
CoreWindow *relative, CoreWindow *relative,
int relation); int relation);
DFBResult CoreWindow_SetConfig( DFBResult CoreWindow_SetConfig(
CoreWindow *obj, CoreWindow *obj,
const CoreWindowConfig *config, const CoreWindowConfig *config,
const DFBInputDeviceKeySymbol *keys,
u32 num_keys,
CoreWindow *parent,
CoreWindowConfigFlags flags); CoreWindowConfigFlags flags);
DFBResult CoreWindow_Bind( DFBResult CoreWindow_Bind(
CoreWindow *obj, CoreWindow *obj,
CoreWindow *source, CoreWindow *source,
int x, int x,
int y); int y);
DFBResult CoreWindow_Unbind( DFBResult CoreWindow_Unbind(
CoreWindow *obj, CoreWindow *obj,
skipping to change at line 164 skipping to change at line 161
DFBResult CoreWindow_SetKeySelection( DFBResult CoreWindow_SetKeySelection(
CoreWindow *obj, CoreWindow *obj,
DFBWindowKeySelection selection, DFBWindowKeySelection selection,
const DFBInputDeviceKeySymbol *keys, const DFBInputDeviceKeySymbol *keys,
u32 num_keys); u32 num_keys);
DFBResult CoreWindow_SetRotation( DFBResult CoreWindow_SetRotation(
CoreWindow *obj, CoreWindow *obj,
int rotation); int rotation);
DFBResult CoreWindow_GetSurface( void *CoreWindow_Init_Dispatch(
CoreWindow *obj,
CoreSurface **ret_surface)
;
DFBResult CoreWindow_SetCursorShape(
CoreWindow *obj,
CoreSurface *shape,
const DFBPoint *hotspot);
void CoreWindow_Init_Dispatch(
CoreDFB *core, CoreDFB *core,
CoreWindow *obj, CoreWindow *obj,
FusionCall *call FusionCall *call
); );
void CoreWindow_Deinit_Dispatch( void CoreWindow_Deinit_Dispatch(
FusionCall *call void *dispatch
); );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif
namespace DirectFB {
/* /*
* CoreWindow Calls * CoreWindow Calls
*/ */
typedef enum { typedef enum {
_CoreWindow_Repaint = 1, CoreWindow_Repaint = 1,
_CoreWindow_BeginUpdates = 2, CoreWindow_BeginUpdates = 2,
_CoreWindow_Restack = 3, CoreWindow_Restack = 3,
_CoreWindow_SetConfig = 4, CoreWindow_SetConfig = 4,
_CoreWindow_Bind = 5, CoreWindow_Bind = 5,
_CoreWindow_Unbind = 6, CoreWindow_Unbind = 6,
_CoreWindow_RequestFocus = 7, CoreWindow_RequestFocus = 7,
_CoreWindow_ChangeGrab = 8, CoreWindow_ChangeGrab = 8,
_CoreWindow_GrabKey = 9, CoreWindow_GrabKey = 9,
_CoreWindow_UngrabKey = 10, CoreWindow_UngrabKey = 10,
_CoreWindow_Move = 11, CoreWindow_Move = 11,
_CoreWindow_MoveTo = 12, CoreWindow_MoveTo = 12,
_CoreWindow_Resize = 13, CoreWindow_Resize = 13,
_CoreWindow_Destroy = 14, CoreWindow_Destroy = 14,
_CoreWindow_SetCursorPosition = 15, CoreWindow_SetCursorPosition = 15,
_CoreWindow_ChangeEvents = 16, CoreWindow_ChangeEvents = 16,
_CoreWindow_ChangeOptions = 17, CoreWindow_ChangeOptions = 17,
_CoreWindow_SetColor = 18, CoreWindow_SetColor = 18,
_CoreWindow_SetColorKey = 19, CoreWindow_SetColorKey = 19,
_CoreWindow_SetOpaque = 20, CoreWindow_SetOpaque = 20,
_CoreWindow_SetOpacity = 21, CoreWindow_SetOpacity = 21,
_CoreWindow_SetStacking = 22, CoreWindow_SetStacking = 22,
_CoreWindow_SetBounds = 23, CoreWindow_SetBounds = 23,
_CoreWindow_SetKeySelection = 24, CoreWindow_SetKeySelection = 24,
_CoreWindow_SetRotation = 25, CoreWindow_SetRotation = 25,
_CoreWindow_GetSurface = 26,
_CoreWindow_SetCursorShape = 27,
} CoreWindowCall; } CoreWindowCall;
/* /*
* CoreWindow_Repaint * CoreWindow_Repaint
*/ */
typedef struct { typedef struct {
DFBRegion left; DFBRegion left;
DFBRegion right; DFBRegion right;
DFBSurfaceFlipFlags flags; DFBSurfaceFlipFlags flags;
} CoreWindowRepaint; } CoreWindowRepaint;
skipping to change at line 263 skipping to change at line 250
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreWindowRestackReturn; } CoreWindowRestackReturn;
/* /*
* CoreWindow_SetConfig * CoreWindow_SetConfig
*/ */
typedef struct { typedef struct {
CoreWindowConfig config; CoreWindowConfig config;
u32 num_keys;
bool parent_set;
u32 parent_id;
CoreWindowConfigFlags flags; CoreWindowConfigFlags flags;
bool keys_set;
/* 'num_keys' DFBInputDeviceKeySymbol follow (keys) */
} CoreWindowSetConfig; } CoreWindowSetConfig;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreWindowSetConfigReturn; } CoreWindowSetConfigReturn;
/* /*
* CoreWindow_Bind * CoreWindow_Bind
*/ */
typedef struct { typedef struct {
skipping to change at line 518 skipping to change at line 500
* CoreWindow_SetRotation * CoreWindow_SetRotation
*/ */
typedef struct { typedef struct {
int rotation; int rotation;
} CoreWindowSetRotation; } CoreWindowSetRotation;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreWindowSetRotationReturn; } CoreWindowSetRotationReturn;
/* class IWindow : public Interface
* CoreWindow_GetSurface {
*/ public:
typedef struct { IWindow( CoreDFB *core )
} CoreWindowGetSurface; :
Interface( core )
{
}
typedef struct { public:
DFBResult result; virtual DFBResult Repaint(
u32 surface_id; const DFBRegion *left,
} CoreWindowGetSurfaceReturn; const DFBRegion *right,
DFBSurfaceFlipFlags flags
) = 0;
/* virtual DFBResult BeginUpdates(
* CoreWindow_SetCursorShape const DFBRegion *update
*/ ) = 0;
typedef struct {
bool shape_set;
u32 shape_id;
DFBPoint hotspot;
} CoreWindowSetCursorShape;
typedef struct { virtual DFBResult Restack(
DFBResult result; CoreWindow *relative,
} CoreWindowSetCursorShapeReturn; int relation
) = 0;
DFBResult IWindow_Real__Repaint( CoreWindow *obj, virtual DFBResult SetConfig(
const CoreWindowConfig *config,
CoreWindowConfigFlags flags
) = 0;
virtual DFBResult Bind(
CoreWindow *source,
int x,
int y
) = 0;
virtual DFBResult Unbind(
CoreWindow *source
) = 0;
virtual DFBResult RequestFocus(
) = 0;
virtual DFBResult ChangeGrab(
CoreWMGrabTarget target,
bool grab
) = 0;
virtual DFBResult GrabKey(
DFBInputDeviceKeySymbol symbol,
DFBInputDeviceModifierMask modifiers
) = 0;
virtual DFBResult UngrabKey(
DFBInputDeviceKeySymbol symbol,
DFBInputDeviceModifierMask modifiers
) = 0;
virtual DFBResult Move(
int dx,
int dy
) = 0;
virtual DFBResult MoveTo(
int x,
int y
) = 0;
virtual DFBResult Resize(
int width,
int height
) = 0;
virtual DFBResult Destroy(
) = 0;
virtual DFBResult SetCursorPosition(
int x,
int y
) = 0;
virtual DFBResult ChangeEvents(
DFBWindowEventType disable,
DFBWindowEventType enable
) = 0;
virtual DFBResult ChangeOptions(
DFBWindowOptions disable,
DFBWindowOptions enable
) = 0;
virtual DFBResult SetColor(
const DFBColor *color
) = 0;
virtual DFBResult SetColorKey(
u32 key
) = 0;
virtual DFBResult SetOpaque(
const DFBRegion *opaque
) = 0;
virtual DFBResult SetOpacity(
u8 opacity
) = 0;
virtual DFBResult SetStacking(
DFBWindowStackingClass stacking
) = 0;
virtual DFBResult SetBounds(
const DFBRectangle *bounds
) = 0;
virtual DFBResult SetKeySelection(
DFBWindowKeySelection selection,
const DFBInputDeviceKeySymbol *keys,
u32 num_keys
) = 0;
virtual DFBResult SetRotation(
int rotation
) = 0;
};
class IWindow_Real : public IWindow
{
private:
CoreWindow *obj;
public:
IWindow_Real( CoreDFB *core, CoreWindow *obj )
:
IWindow( core ),
obj( obj )
{
}
public:
virtual DFBResult Repaint(
const DFBRegion *left, const DFBRegion *left,
const DFBRegion *right, const DFBRegion *right,
DFBSurfaceFlipFlags flags ); DFBSurfaceFlipFlags flags
);
DFBResult IWindow_Real__BeginUpdates( CoreWindow *obj, virtual DFBResult BeginUpdates(
const DFBRegion *update ); const DFBRegion *update
);
DFBResult IWindow_Real__Restack( CoreWindow *obj, virtual DFBResult Restack(
CoreWindow *relative, CoreWindow *relative,
int relation ); int relation
);
DFBResult IWindow_Real__SetConfig( CoreWindow *obj, virtual DFBResult SetConfig(
const CoreWindowConfig *config, const CoreWindowConfig *config,
const DFBInputDeviceKeySymbol *keys, CoreWindowConfigFlags flags
u32 num_keys, );
CoreWindow *parent,
CoreWindowConfigFlags flags );
DFBResult IWindow_Real__Bind( CoreWindow *obj, virtual DFBResult Bind(
CoreWindow *source, CoreWindow *source,
int x, int x,
int y ); int y
);
DFBResult IWindow_Real__Unbind( CoreWindow *obj, virtual DFBResult Unbind(
CoreWindow *source ); CoreWindow *source
);
DFBResult IWindow_Real__RequestFocus( CoreWindow *obj virtual DFBResult RequestFocus(
);
DFBResult IWindow_Real__ChangeGrab( CoreWindow *obj, );
virtual DFBResult ChangeGrab(
CoreWMGrabTarget target, CoreWMGrabTarget target,
bool grab ); bool grab
);
DFBResult IWindow_Real__GrabKey( CoreWindow *obj, virtual DFBResult GrabKey(
DFBInputDeviceKeySymbol symbol, DFBInputDeviceKeySymbol symbol,
DFBInputDeviceModifierMask modifiers ); DFBInputDeviceModifierMask modifiers
);
DFBResult IWindow_Real__UngrabKey( CoreWindow *obj, virtual DFBResult UngrabKey(
DFBInputDeviceKeySymbol symbol, DFBInputDeviceKeySymbol symbol,
DFBInputDeviceModifierMask modifiers ); DFBInputDeviceModifierMask modifiers
);
DFBResult IWindow_Real__Move( CoreWindow *obj, virtual DFBResult Move(
int dx, int dx,
int dy ); int dy
);
DFBResult IWindow_Real__MoveTo( CoreWindow *obj, virtual DFBResult MoveTo(
int x, int x,
int y ); int y
);
DFBResult IWindow_Real__Resize( CoreWindow *obj, virtual DFBResult Resize(
int width, int width,
int height ); int height
);
DFBResult IWindow_Real__Destroy( CoreWindow *obj virtual DFBResult Destroy(
);
DFBResult IWindow_Real__SetCursorPosition( CoreWindow *obj, );
virtual DFBResult SetCursorPosition(
int x, int x,
int y ); int y
);
DFBResult IWindow_Real__ChangeEvents( CoreWindow *obj, virtual DFBResult ChangeEvents(
DFBWindowEventType disable, DFBWindowEventType disable,
DFBWindowEventType enable ); DFBWindowEventType enable
);
DFBResult IWindow_Real__ChangeOptions( CoreWindow *obj, virtual DFBResult ChangeOptions(
DFBWindowOptions disable, DFBWindowOptions disable,
DFBWindowOptions enable ); DFBWindowOptions enable
);
DFBResult IWindow_Real__SetColor( CoreWindow *obj, virtual DFBResult SetColor(
const DFBColor *color ); const DFBColor *color
);
DFBResult IWindow_Real__SetColorKey( CoreWindow *obj, virtual DFBResult SetColorKey(
u32 key ); u32 key
);
DFBResult IWindow_Real__SetOpaque( CoreWindow *obj, virtual DFBResult SetOpaque(
const DFBRegion *opaque ); const DFBRegion *opaque
);
DFBResult IWindow_Real__SetOpacity( CoreWindow *obj, virtual DFBResult SetOpacity(
u8 opacity ); u8 opacity
);
DFBResult IWindow_Real__SetStacking( CoreWindow *obj, virtual DFBResult SetStacking(
DFBWindowStackingClass stacking ); DFBWindowStackingClass stacking
);
DFBResult IWindow_Real__SetBounds( CoreWindow *obj, virtual DFBResult SetBounds(
const DFBRectangle *bounds ); const DFBRectangle *bounds
);
DFBResult IWindow_Real__SetKeySelection( CoreWindow *obj, virtual DFBResult SetKeySelection(
DFBWindowKeySelection selection, DFBWindowKeySelection selection,
const DFBInputDeviceKeySymbol *keys, const DFBInputDeviceKeySymbol *keys,
u32 num_keys ); u32 num_keys
);
DFBResult IWindow_Real__SetRotation( CoreWindow *obj, virtual DFBResult SetRotation(
int rotation ); int rotation
);
DFBResult IWindow_Real__GetSurface( CoreWindow *obj, };
CoreSurface **ret_surface
);
DFBResult IWindow_Real__SetCursorShape( CoreWindow *obj, class IWindow_Requestor : public IWindow
CoreSurface *shape, {
const DFBPoint *hotspot ); private:
CoreWindow *obj;
DFBResult IWindow_Requestor__Repaint( CoreWindow *obj, public:
IWindow_Requestor( CoreDFB *core, CoreWindow *obj )
:
IWindow( core ),
obj( obj )
{
}
public:
virtual DFBResult Repaint(
const DFBRegion *left, const DFBRegion *left,
const DFBRegion *right, const DFBRegion *right,
DFBSurfaceFlipFlags flags ); DFBSurfaceFlipFlags flags
);
DFBResult IWindow_Requestor__BeginUpdates( CoreWindow *obj, virtual DFBResult BeginUpdates(
const DFBRegion *update ); const DFBRegion *update
);
DFBResult IWindow_Requestor__Restack( CoreWindow *obj, virtual DFBResult Restack(
CoreWindow *relative, CoreWindow *relative,
int relation ); int relation
);
DFBResult IWindow_Requestor__SetConfig( CoreWindow *obj, virtual DFBResult SetConfig(
const CoreWindowConfig *config, const CoreWindowConfig *config,
const DFBInputDeviceKeySymbol *keys, CoreWindowConfigFlags flags
u32 num_keys, );
CoreWindow *parent,
CoreWindowConfigFlags flags );
DFBResult IWindow_Requestor__Bind( CoreWindow *obj, virtual DFBResult Bind(
CoreWindow *source, CoreWindow *source,
int x, int x,
int y ); int y
);
DFBResult IWindow_Requestor__Unbind( CoreWindow *obj, virtual DFBResult Unbind(
CoreWindow *source ); CoreWindow *source
);
DFBResult IWindow_Requestor__RequestFocus( CoreWindow *obj virtual DFBResult RequestFocus(
);
DFBResult IWindow_Requestor__ChangeGrab( CoreWindow *obj, );
virtual DFBResult ChangeGrab(
CoreWMGrabTarget target, CoreWMGrabTarget target,
bool grab ); bool grab
);
DFBResult IWindow_Requestor__GrabKey( CoreWindow *obj, virtual DFBResult GrabKey(
DFBInputDeviceKeySymbol symbol, DFBInputDeviceKeySymbol symbol,
DFBInputDeviceModifierMask modifiers ); DFBInputDeviceModifierMask modifiers
);
DFBResult IWindow_Requestor__UngrabKey( CoreWindow *obj, virtual DFBResult UngrabKey(
DFBInputDeviceKeySymbol symbol, DFBInputDeviceKeySymbol symbol,
DFBInputDeviceModifierMask modifiers ); DFBInputDeviceModifierMask modifiers
);
DFBResult IWindow_Requestor__Move( CoreWindow *obj, virtual DFBResult Move(
int dx, int dx,
int dy ); int dy
);
DFBResult IWindow_Requestor__MoveTo( CoreWindow *obj, virtual DFBResult MoveTo(
int x, int x,
int y ); int y
);
DFBResult IWindow_Requestor__Resize( CoreWindow *obj, virtual DFBResult Resize(
int width, int width,
int height ); int height
);
DFBResult IWindow_Requestor__Destroy( CoreWindow *obj virtual DFBResult Destroy(
);
DFBResult IWindow_Requestor__SetCursorPosition( CoreWindow *obj, );
virtual DFBResult SetCursorPosition(
int x, int x,
int y ); int y
);
DFBResult IWindow_Requestor__ChangeEvents( CoreWindow *obj, virtual DFBResult ChangeEvents(
DFBWindowEventType disable, DFBWindowEventType disable,
DFBWindowEventType enable ); DFBWindowEventType enable
);
DFBResult IWindow_Requestor__ChangeOptions( CoreWindow *obj, virtual DFBResult ChangeOptions(
DFBWindowOptions disable, DFBWindowOptions disable,
DFBWindowOptions enable ); DFBWindowOptions enable
);
DFBResult IWindow_Requestor__SetColor( CoreWindow *obj, virtual DFBResult SetColor(
const DFBColor *color ); const DFBColor *color
);
DFBResult IWindow_Requestor__SetColorKey( CoreWindow *obj, virtual DFBResult SetColorKey(
u32 key ); u32 key
);
DFBResult IWindow_Requestor__SetOpaque( CoreWindow *obj, virtual DFBResult SetOpaque(
const DFBRegion *opaque ); const DFBRegion *opaque
);
DFBResult IWindow_Requestor__SetOpacity( CoreWindow *obj, virtual DFBResult SetOpacity(
u8 opacity ); u8 opacity
);
DFBResult IWindow_Requestor__SetStacking( CoreWindow *obj, virtual DFBResult SetStacking(
DFBWindowStackingClass stacking ); DFBWindowStackingClass stacking
);
DFBResult IWindow_Requestor__SetBounds( CoreWindow *obj, virtual DFBResult SetBounds(
const DFBRectangle *bounds ); const DFBRectangle *bounds
);
DFBResult IWindow_Requestor__SetKeySelection( CoreWindow *obj, virtual DFBResult SetKeySelection(
DFBWindowKeySelection selection, DFBWindowKeySelection selection,
const DFBInputDeviceKeySymbol *keys, const DFBInputDeviceKeySymbol *keys,
u32 num_keys ); u32 num_keys
);
DFBResult IWindow_Requestor__SetRotation( CoreWindow *obj, virtual DFBResult SetRotation(
int rotation ); int rotation
);
DFBResult IWindow_Requestor__GetSurface( CoreWindow *obj, };
CoreSurface **ret_surface
);
DFBResult IWindow_Requestor__SetCursorShape( CoreWindow *obj, class CoreWindowDispatch
CoreSurface *shape, {
const DFBPoint *hotspot );
DFBResult CoreWindowDispatch__Dispatch( CoreWindow *obj, public:
FusionID caller, CoreWindowDispatch( CoreDFB *core, IWindow *real )
int method, :
void *ptr, core( core ),
unsigned int length, real( real )
void *ret_ptr, {
unsigned int ret_size, }
unsigned int *ret_length );
virtual DFBResult Dispatch( FusionID caller,
int method,
void *ptr,
unsigned int length,
void *ret_ptr,
unsigned int ret_size,
unsigned int *ret_length );
private:
CoreDFB *core;
IWindow *real;
};
}
#endif
#endif #endif
 End of changes. 95 change blocks. 
195 lines changed or deleted 360 lines changed or added


 CoreWindowStack.h   CoreWindowStack.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef ___CoreWindowStack__H___ #ifndef ___CoreWindowStack__H___
#define ___CoreWindowStack__H___ #define ___CoreWindowStack__H___
#include <core/CoreWindowStack_includes.h> #include "CoreWindowStack_includes.h"
/************************************************************************** ******************************************** /************************************************************************** ********************************************
* CoreWindowStack * CoreWindowStack
*/ */
#ifdef __cplusplus #ifdef __cplusplus
#include <core/Interface.h> #include <core/Interface.h>
extern "C" { extern "C" {
#endif #endif
DFBResult CoreWindowStack_RepaintAll( DFBResult CoreWindowStack_RepaintAll(
CoreWindowStack *obj CoreWindowStack *obj
); );
DFBResult CoreWindowStack_GetInsets(
CoreWindowStack *obj,
CoreWindow *window,
DFBInsets *ret_insets);
DFBResult CoreWindowStack_CursorEnable( DFBResult CoreWindowStack_CursorEnable(
CoreWindowStack *obj, CoreWindowStack *obj,
bool enable); bool enable);
DFBResult CoreWindowStack_CursorSetShape( DFBResult CoreWindowStack_CursorSetShape(
CoreWindowStack *obj, CoreWindowStack *obj,
CoreSurface *shape, CoreSurface *shape,
const DFBPoint *hotspot); const DFBPoint *hotspot);
DFBResult CoreWindowStack_CursorSetOpacity( DFBResult CoreWindowStack_CursorSetOpacity(
skipping to change at line 96 skipping to change at line 91
CoreSurface *image); CoreSurface *image);
DFBResult CoreWindowStack_BackgroundSetColor( DFBResult CoreWindowStack_BackgroundSetColor(
CoreWindowStack *obj, CoreWindowStack *obj,
const DFBColor *color); const DFBColor *color);
DFBResult CoreWindowStack_BackgroundSetColorIndex( DFBResult CoreWindowStack_BackgroundSetColorIndex(
CoreWindowStack *obj, CoreWindowStack *obj,
s32 index); s32 index);
void CoreWindowStack_Init_Dispatch( void *CoreWindowStack_Init_Dispatch(
CoreDFB *core, CoreDFB *core,
CoreWindowStack *obj, CoreWindowStack *obj,
FusionCall *call FusionCall *call
); );
void CoreWindowStack_Deinit_Dispatch( void CoreWindowStack_Deinit_Dispatch(
FusionCall *call void *dispatch
); );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif
namespace DirectFB {
/* /*
* CoreWindowStack Calls * CoreWindowStack Calls
*/ */
typedef enum { typedef enum {
_CoreWindowStack_RepaintAll = 1, CoreWindowStack_RepaintAll = 1,
_CoreWindowStack_GetInsets = 2, CoreWindowStack_CursorEnable = 2,
_CoreWindowStack_CursorEnable = 3, CoreWindowStack_CursorSetShape = 3,
_CoreWindowStack_CursorSetShape = 4, CoreWindowStack_CursorSetOpacity = 4,
_CoreWindowStack_CursorSetOpacity = 5, CoreWindowStack_CursorSetAcceleration = 5,
_CoreWindowStack_CursorSetAcceleration = 6, CoreWindowStack_CursorWarp = 6,
_CoreWindowStack_CursorWarp = 7, CoreWindowStack_CursorGetPosition = 7,
_CoreWindowStack_CursorGetPosition = 8, CoreWindowStack_BackgroundSetMode = 8,
_CoreWindowStack_BackgroundSetMode = 9, CoreWindowStack_BackgroundSetImage = 9,
_CoreWindowStack_BackgroundSetImage = 10, CoreWindowStack_BackgroundSetColor = 10,
_CoreWindowStack_BackgroundSetColor = 11, CoreWindowStack_BackgroundSetColorIndex = 11,
_CoreWindowStack_BackgroundSetColorIndex = 12,
} CoreWindowStackCall; } CoreWindowStackCall;
/* /*
* CoreWindowStack_RepaintAll * CoreWindowStack_RepaintAll
*/ */
typedef struct { typedef struct {
} CoreWindowStackRepaintAll; } CoreWindowStackRepaintAll;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreWindowStackRepaintAllReturn; } CoreWindowStackRepaintAllReturn;
/* /*
* CoreWindowStack_GetInsets
*/
typedef struct {
u32 window_id;
} CoreWindowStackGetInsets;
typedef struct {
DFBResult result;
DFBInsets insets;
} CoreWindowStackGetInsetsReturn;
/*
* CoreWindowStack_CursorEnable * CoreWindowStack_CursorEnable
*/ */
typedef struct { typedef struct {
bool enable; bool enable;
} CoreWindowStackCursorEnable; } CoreWindowStackCursorEnable;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreWindowStackCursorEnableReturn; } CoreWindowStackCursorEnableReturn;
skipping to change at line 263 skipping to change at line 246
* CoreWindowStack_BackgroundSetColorIndex * CoreWindowStack_BackgroundSetColorIndex
*/ */
typedef struct { typedef struct {
s32 index; s32 index;
} CoreWindowStackBackgroundSetColorIndex; } CoreWindowStackBackgroundSetColorIndex;
typedef struct { typedef struct {
DFBResult result; DFBResult result;
} CoreWindowStackBackgroundSetColorIndexReturn; } CoreWindowStackBackgroundSetColorIndexReturn;
DFBResult IWindowStack_Real__RepaintAll( CoreWindowStack *obj class IWindowStack : public Interface
); {
public:
IWindowStack( CoreDFB *core )
:
Interface( core )
{
}
DFBResult IWindowStack_Real__GetInsets( CoreWindowStack *obj, public:
CoreWindow *window, virtual DFBResult RepaintAll(
DFBInsets *ret_insets )
;
DFBResult IWindowStack_Real__CursorEnable( CoreWindowStack *obj, ) = 0;
bool enable );
DFBResult IWindowStack_Real__CursorSetShape( CoreWindowStack *obj, virtual DFBResult CursorEnable(
bool enable
) = 0;
virtual DFBResult CursorSetShape(
CoreSurface *shape, CoreSurface *shape,
const DFBPoint *hotspot ); const DFBPoint *hotspot
) = 0;
DFBResult IWindowStack_Real__CursorSetOpacity( CoreWindowStack *obj, virtual DFBResult CursorSetOpacity(
u8 opacity ); u8 opacity
) = 0;
DFBResult IWindowStack_Real__CursorSetAcceleration( CoreWindowStack *obj, virtual DFBResult CursorSetAcceleration(
u32 numerator, u32 numerator,
u32 denominator, u32 denominator,
u32 threshold ); u32 threshold
) = 0;
DFBResult IWindowStack_Real__CursorWarp( CoreWindowStack *obj, virtual DFBResult CursorWarp(
const DFBPoint *position ); const DFBPoint *position
) = 0;
DFBResult IWindowStack_Real__CursorGetPosition( CoreWindowStack *obj, virtual DFBResult CursorGetPosition(
DFBPoint *ret_position DFBPoint *ret_position
); ) = 0;
DFBResult IWindowStack_Real__BackgroundSetMode( CoreWindowStack *obj, virtual DFBResult BackgroundSetMode(
DFBDisplayLayerBackgroundMode mode ); DFBDisplayLayerBackgroundMode mode
) = 0;
DFBResult IWindowStack_Real__BackgroundSetImage( CoreWindowStack *obj, virtual DFBResult BackgroundSetImage(
CoreSurface *image ); CoreSurface *image
) = 0;
DFBResult IWindowStack_Real__BackgroundSetColor( CoreWindowStack *obj, virtual DFBResult BackgroundSetColor(
const DFBColor *color ); const DFBColor *color
) = 0;
DFBResult IWindowStack_Real__BackgroundSetColorIndex( CoreWindowStack *obj, virtual DFBResult BackgroundSetColorIndex(
s32 index ); s32 index
) = 0;
DFBResult IWindowStack_Requestor__RepaintAll( CoreWindowStack *obj };
);
DFBResult IWindowStack_Requestor__GetInsets( CoreWindowStack *obj, class IWindowStack_Real : public IWindowStack
CoreWindow *window, {
DFBInsets *ret_insets ) private:
; CoreWindowStack *obj;
DFBResult IWindowStack_Requestor__CursorEnable( CoreWindowStack *obj, public:
bool enable ); IWindowStack_Real( CoreDFB *core, CoreWindowStack *obj )
:
IWindowStack( core ),
obj( obj )
{
}
DFBResult IWindowStack_Requestor__CursorSetShape( CoreWindowStack *obj, public:
virtual DFBResult RepaintAll(
);
virtual DFBResult CursorEnable(
bool enable
);
virtual DFBResult CursorSetShape(
CoreSurface *shape, CoreSurface *shape,
const DFBPoint *hotspot ); const DFBPoint *hotspot
);
DFBResult IWindowStack_Requestor__CursorSetOpacity( CoreWindowStack *obj, virtual DFBResult CursorSetOpacity(
u8 opacity ); u8 opacity
);
DFBResult IWindowStack_Requestor__CursorSetAcceleration( CoreWindowStack *o bj, virtual DFBResult CursorSetAcceleration(
u32 numerator, u32 numerator,
u32 denominator, u32 denominator,
u32 threshold ); u32 threshold
);
DFBResult IWindowStack_Requestor__CursorWarp( CoreWindowStack *obj, virtual DFBResult CursorWarp(
const DFBPoint *position ); const DFBPoint *position
);
DFBResult IWindowStack_Requestor__CursorGetPosition( CoreWindowStack *obj, virtual DFBResult CursorGetPosition(
DFBPoint *ret_position DFBPoint *ret_position
); );
DFBResult IWindowStack_Requestor__BackgroundSetMode( CoreWindowStack *obj, virtual DFBResult BackgroundSetMode(
DFBDisplayLayerBackgroundMode mode ); DFBDisplayLayerBackgroundMode mode
);
DFBResult IWindowStack_Requestor__BackgroundSetImage( CoreWindowStack *obj, virtual DFBResult BackgroundSetImage(
CoreSurface *image ); CoreSurface *image
);
DFBResult IWindowStack_Requestor__BackgroundSetColor( CoreWindowStack *obj, virtual DFBResult BackgroundSetColor(
const DFBColor *color ); const DFBColor *color
);
DFBResult IWindowStack_Requestor__BackgroundSetColorIndex( CoreWindowStack virtual DFBResult BackgroundSetColorIndex(
*obj, s32 index
s32 index ); );
DFBResult CoreWindowStackDispatch__Dispatch( CoreWindowStack *obj, };
FusionID caller,
int method, class IWindowStack_Requestor : public IWindowStack
void *ptr, {
unsigned int length, private:
void *ret_ptr, CoreWindowStack *obj;
unsigned int ret_size,
unsigned int *ret_length ); public:
IWindowStack_Requestor( CoreDFB *core, CoreWindowStack *obj )
:
IWindowStack( core ),
obj( obj )
{
}
public:
virtual DFBResult RepaintAll(
);
virtual DFBResult CursorEnable(
bool enable
);
virtual DFBResult CursorSetShape(
CoreSurface *shape,
const DFBPoint *hotspot
);
virtual DFBResult CursorSetOpacity(
u8 opacity
);
virtual DFBResult CursorSetAcceleration(
u32 numerator,
u32 denominator,
u32 threshold
);
virtual DFBResult CursorWarp(
const DFBPoint *position
);
virtual DFBResult CursorGetPosition(
DFBPoint *ret_position
);
virtual DFBResult BackgroundSetMode(
DFBDisplayLayerBackgroundMode mode
);
virtual DFBResult BackgroundSetImage(
CoreSurface *image
);
virtual DFBResult BackgroundSetColor(
const DFBColor *color
);
virtual DFBResult BackgroundSetColorIndex(
s32 index
);
};
class CoreWindowStackDispatch
{
public:
CoreWindowStackDispatch( CoreDFB *core, IWindowStack *real )
:
core( core ),
real( real )
{
}
virtual DFBResult Dispatch( FusionID caller,
int method,
void *ptr,
unsigned int length,
void *ret_ptr,
unsigned int ret_size,
unsigned int *ret_length );
private:
CoreDFB *core;
IWindowStack *real;
};
}
#endif
#endif #endif
 End of changes. 36 change blocks. 
96 lines changed or deleted 198 lines changed or added


 arena.h   arena.h 
skipping to change at line 34 skipping to change at line 34
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __FUSION__ARENA_H__ #ifndef __FUSION__ARENA_H__
#define __FUSION__ARENA_H__ #define __FUSION__ARENA_H__
#include <fusion/types.h> #include <fusion/types.h>
typedef int (*ArenaEnterFunc) (FusionArena *arena, void *ctx); typedef int (*ArenaEnterFunc)( FusionArena *arena, void *ctx );
typedef int (*ArenaExitFunc) (FusionArena *arena, void *ctx, bool emergency typedef int (*ArenaExitFunc) ( FusionArena *arena, void *ctx, bool emergenc
); y );
DirectResult fusion_arena_enter (FusionWorld *world, DirectResult FUSION_API fusion_arena_enter ( FusionWorld *wor
const char *name, ld,
ArenaEnterFunc initialize, const char *nam
ArenaEnterFunc join, e,
void *ctx, ArenaEnterFunc ini
FusionArena **ret_arena, tialize,
int *ret_error); ArenaEnterFunc joi
n,
void *ctx
,
FusionArena **ret
_arena,
int *ret
_error );
DirectResult fusion_arena_add_shared_field (FusionArena *arena, DirectResult FUSION_API fusion_arena_add_shared_field( FusionArena *are
const char *name, na,
void *data); const char *nam
e,
void *dat
a );
DirectResult fusion_arena_get_shared_field (FusionArena *arena, DirectResult FUSION_API fusion_arena_get_shared_field( FusionArena *are
const char *name, na,
void **data); const char *nam
e,
void **dat
a );
DirectResult fusion_arena_exit (FusionArena *arena, DirectResult FUSION_API fusion_arena_exit ( FusionArena *are
ArenaExitFunc shutdown, na,
ArenaExitFunc leave, ArenaExitFunc shu
void *ctx, tdown,
bool emergency, ArenaExitFunc lea
int *ret_error); ve,
void *ctx
,
bool eme
rgency,
int *ret
_error );
#endif #endif
 End of changes. 5 change blocks. 
22 lines changed or deleted 41 lines changed or added


 build.h   build.h 
/* /*
(c) Copyright 2000-2002 convergence integrated media GmbH. (c) Copyright 2001-2011 The world wide DirectFB Open Source Community (
(c) Copyright 2002-2004 convergence GmbH. directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org> and Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi>. Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>.
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__BUILD_H__ #ifndef __DIRECT__BUILD_H__
#define __DIRECT__BUILD_H__ #define __DIRECT__BUILD_H__
#define DIRECT_BUILD_DEBUG (0) #define DIRECT_OS_LINUX_GNU_LIBC (0)
#define DIRECT_BUILD_DEBUGS (1) #define DIRECT_OS_LINUX_KERNEL (1)
#define DIRECT_BUILD_TRACE (0) #define DIRECT_OS_PSP (2)
#define DIRECT_BUILD_TEXT (1) #define DIRECT_OS_WIN32 (3)
#define DIRECT_BUILD_GETTID (1)
#define DIRECT_BUILD_NETWORK (1) #define DIRECT_BUILD_DEBUG (0)
#define DIRECT_BUILD_STDBOOL (1) #define DIRECT_BUILD_DEBUGS (1)
#define DIRECT_BUILD_TRACE (0)
#define DIRECT_BUILD_TEXT (1)
#define DIRECT_BUILD_GETTID (1)
#define DIRECT_BUILD_NETWORK (1)
#define DIRECT_BUILD_STDBOOL (1)
#define DIRECT_BUILD_DYNLOAD (1)
#define DIRECT_BUILD_MULTICORE (1)
#define DIRECT_BUILD_OSTYPE (DIRECT_OS_LINUX_GNU_LIBC)
#if !DIRECT_BUILD_DEBUGS #if !DIRECT_BUILD_DEBUGS
#if defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FORCE_DEBUG) #if defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FORCE_DEBUG)
#define DIRECT_MINI_DEBUG #define DIRECT_MINI_DEBUG
#endif #endif
#undef DIRECT_ENABLE_DEBUG #undef DIRECT_ENABLE_DEBUG
#ifdef DIRECT_FORCE_DEBUG #ifdef DIRECT_FORCE_DEBUG
#warning DIRECT_FORCE_DEBUG used with 'pure release' library headers. #warning DIRECT_FORCE_DEBUG used with 'pure release' library headers.
#undef DIRECT_FORCE_DEBUG #undef DIRECT_FORCE_DEBUG
#endif #endif
 End of changes. 3 change blocks. 
11 lines changed or deleted 21 lines changed or added


 call.h   call.h 
skipping to change at line 65 skipping to change at line 65
typedef struct { typedef struct {
FusionWorldShared *shared; FusionWorldShared *shared;
int call_id; int call_id;
FusionID fusion_id; FusionID fusion_id;
FusionCallHandler handler; FusionCallHandler handler;
FusionCallHandler3 handler3; FusionCallHandler3 handler3;
void *ctx; void *ctx;
} FusionCall; } FusionCall;
DirectResult fusion_call_init ( FusionCall *call, DirectResult FUSION_API fusion_call_init ( FusionCall *call,
FusionCallHandler handler, FusionCallHandler handler,
void *ctx, void *ctx,
const FusionWorld *world ); const FusionWorld *world );
DirectResult fusion_call_init3 ( FusionCall *call,
FusionCallHandler3 handler3,
void *ctx,
const FusionWorld *world );
DirectResult fusion_call_init_from( FusionCall *call,
int call_id,
const FusionWorld *world );
DirectResult fusion_call_execute( FusionCall *call,
FusionCallExecFlags flags,
int call_arg,
void *call_ptr,
int *ret_val );
DirectResult fusion_call_execute2( FusionCall *call,
FusionCallExecFlags flags,
int call_arg,
void *ptr,
unsigned int length,
int *ret_val );
DirectResult fusion_call_execute3( FusionCall *call,
FusionCallExecFlags flags,
int call_arg,
void *ptr,
unsigned int length,
void *ret_ptr,
unsigned int ret_size,
unsigned int *ret_length );
DirectResult fusion_call_return ( FusionCall *call,
unsigned int serial,
int val );
DirectResult fusion_call_return3( FusionCall *call, DirectResult FUSION_API fusion_call_init3 ( FusionCall *call,
unsigned int serial, FusionCallHandler3 handler3,
void *ptr, void *ctx,
unsigned int length ); const FusionWorld *world );
DirectResult fusion_call_get_owner( FusionCall *call, DirectResult FUSION_API fusion_call_init_from( FusionCall *call,
FusionID *ret_fusion_id ); int call_id
,
const FusionWorld *world )
;
DirectResult fusion_call_destroy( FusionCall *call ); DirectResult FUSION_API fusion_call_execute( FusionCall *call,
FusionCallExecFlags flags,
int call_arg,
void *call_ptr,
int *ret_val )
;
DirectResult fusion_world_flush_calls( FusionWorld *world, int lock ); DirectResult FUSION_API fusion_call_execute2( FusionCall *call,
FusionCallExecFlags flags,
int call_arg
,
void *ptr,
unsigned int length,
int *ret_val
);
typedef enum { DirectResult FUSION_API fusion_call_execute3( FusionCall *call,
FUSION_CALL_PERMIT_NONE = 0x00000000, FusionCallExecFlags flags,
int call_arg
,
void *ptr,
unsigned int length,
void *ret_ptr,
unsigned int ret_size
,
unsigned int *ret_leng
th );
FUSION_CALL_PERMIT_EXECUTE = 0x00000001, DirectResult FUSION_API fusion_call_return ( FusionCall *call,
unsigned int serial,
int val );
FUSION_CALL_PERMIT_ALL = 0x00000001, DirectResult FUSION_API fusion_call_return3( FusionCall *call,
} FusionCallPermissions; unsigned int serial,
void *ptr,
unsigned int length );
/* DirectResult FUSION_API fusion_call_destroy( FusionCall *call );
* Give permissions to another fusionee to use the call.
*/
DirectResult fusion_call_add_permissions( FusionCall *call,
FusionID fusion_id,
FusionCallPermissions permission
s );
#endif #endif
 End of changes. 9 change blocks. 
59 lines changed or deleted 46 lines changed or added


 clip.h   clip.h 
skipping to change at line 69 skipping to change at line 69
* Returns a flag for each edge that wasn't cut off. * Returns a flag for each edge that wasn't cut off.
*/ */
DFBEdgeFlags dfb_clip_edges( const DFBRegion *clip, DFBRectangle *rect ); DFBEdgeFlags dfb_clip_edges( const DFBRegion *clip, DFBRectangle *rect );
static inline DFBBoolean static inline DFBBoolean
dfb_clip_needed( const DFBRegion *clip, DFBRectangle *rect ) dfb_clip_needed( const DFBRegion *clip, DFBRectangle *rect )
{ {
return ((clip->x1 > rect->x) || return ((clip->x1 > rect->x) ||
(clip->y1 > rect->y) || (clip->y1 > rect->y) ||
(clip->x2 < rect->x + rect->w - 1) || (clip->x2 < rect->x + rect->w - 1) ||
(clip->y2 < rect->y + rect->h - 1)) ? DFB_TRUE : DFB_FALSE; (clip->y2 < rect->y + rect->h - 1));
} }
/* /*
* Simple check if triangle lies outside the clipping region. * Simple check if triangle lies outside the clipping region.
* Returns true if the triangle may be visible within the region. * Returns true if the triangle may be visible within the region.
*/ */
DFBBoolean dfb_clip_triangle_precheck( const DFBRegion *clip, DFBBoolean dfb_clip_triangle_precheck( const DFBRegion *clip,
const DFBTriangle *tri ); const DFBTriangle *tri );
/* /*
skipping to change at line 124 skipping to change at line 124
/* /*
* Clips the stretch blit request to the clipping region. * Clips the stretch blit request to the clipping region.
* This includes adjustment of source AND destination coordinates * This includes adjustment of source AND destination coordinates
* based on the scaling factor. * based on the scaling factor.
*/ */
void dfb_clip_stretchblit( const DFBRegion *clip, void dfb_clip_stretchblit( const DFBRegion *clip,
DFBRectangle *srect, DFBRectangle *srect,
DFBRectangle *drect ); DFBRectangle *drect );
/*
* Clips the blitting request to the clipping region.
* This includes adjustment of source AND destination coordinates.
*
* In contrast to dfb_clip_blit() this also honors DSBLIT_ROTATE_ and DSBLI
T_FLIP_ blittingflags.
*
* FIXME: rotation and flipping is not supported simultaniously since the s
oftware driver
* would crash in its current state.
*/
void
dfb_clip_blit_flipped_rotated( const DFBRegion *clip,
DFBRectangle *srect, DFBRectangle *drect, DF
BSurfaceBlittingFlags flags );
#endif #endif
 End of changes. 2 change blocks. 
18 lines changed or deleted 1 lines changed or added


 clock.h   clock.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__CLOCK_H__ #ifndef __DIRECT__CLOCK_H__
#define __DIRECT__CLOCK_H__ #define __DIRECT__CLOCK_H__
#include <sys/time.h> #include <direct/os/clock.h>
long long direct_clock_get_micros( void ); /**************************************************************************
long long direct_clock_get_millis( void ); ********************************************/
void direct_clock_set_start( const struct timeval *start ); long long DIRECT_API direct_clock_get_abs_micros( void );
long long DIRECT_API direct_clock_get_abs_millis( void );
long long direct_clock_get_abs_micros( void ); long long DIRECT_API direct_clock_get_micros( void );
long long direct_clock_get_abs_millis( void ); long long DIRECT_API direct_clock_get_millis( void );
#ifndef DIRECT_DISABLE_DEPRECATED
// @deprecated
void DIRECT_API direct_clock_set_start( const struct timeval *start );
#endif
#endif #endif
 End of changes. 5 change blocks. 
7 lines changed or deleted 15 lines changed or added


 conf.h   conf.h 
skipping to change at line 255 skipping to change at line 255
unsigned int max_axis_rate; unsigned int max_axis_rate;
bool cursor_automation; bool cursor_automation;
int max_font_rows; int max_font_rows;
int max_font_row_width; int max_font_row_width;
bool core_sighandler; bool core_sighandler;
char *resource_manager; bool linux_input_force; /* use linux-input with all system modules */
bool layers_clear; u64 resource_id;
bool no_singleton;
} DFBConfig; } DFBConfig;
extern DFBConfig *dfb_config; extern DFBConfig DIRECTFB_API *dfb_config;
/* /*
* Allocate Config struct, fill with defaults and parse command line option s * Allocate Config struct, fill with defaults and parse command line option s
* for overrides. Options identified as DirectFB options are stripped out * for overrides. Options identified as DirectFB options are stripped out
* of the array. * of the array.
*/ */
DFBResult dfb_config_init( int *argc, char *(*argv[]) ); DFBResult DIRECTFB_API dfb_config_init( int *argc, char *(*argv[]) );
/* /*
* Read configuration options from file. Called by config_init(). * Read configuration options from file. Called by config_init().
* *
* Returns DFB_IO if config file could not be opened. * Returns DFB_IO if config file could not be opened.
* Returns DFB_UNSUPPORTED if file contains an invalid option. * Returns DFB_UNSUPPORTED if file contains an invalid option.
* Returns DFB_INVARG if an invalid option assignment is done, * Returns DFB_INVARG if an invalid option assignment is done,
* e.g. "--desktop-buffer-mode=somethingwrong". * e.g. "--desktop-buffer-mode=somethingwrong".
*/ */
DFBResult dfb_config_read( const char *filename ); DFBResult DIRECTFB_API dfb_config_read( const char *filename );
/* /*
* Set indiviual option. Used by config_init(), config_read() and * Set indiviual option. Used by config_init(), config_read() and
* DirectFBSetOption() * DirectFBSetOption()
*/ */
DFBResult dfb_config_set( const char *name, const char *value ); DFBResult DIRECTFB_API dfb_config_set( const char *name, const char *value );
const char *dfb_config_usage( void ); const char DIRECTFB_API *dfb_config_usage( void );
DFBSurfacePixelFormat dfb_config_parse_pixelformat( const char *format ); DFBSurfacePixelFormat DIRECTFB_API dfb_config_parse_pixelformat( const char *format );
#endif #endif
 End of changes. 8 change blocks. 
8 lines changed or deleted 10 lines changed or added


 convert.h   convert.h 
skipping to change at line 98 skipping to change at line 98
#define PIXEL_RGB32(r,g,b) ( (0xff << 24) | \ #define PIXEL_RGB32(r,g,b) ( (0xff << 24) | \
((r) << 16) | \ ((r) << 16) | \
((g) << 8) | \ ((g) << 8) | \
(b) ) (b) )
#define PIXEL_ARGB(a,r,g,b) ( ((a) << 24) | \ #define PIXEL_ARGB(a,r,g,b) ( ((a) << 24) | \
((r) << 16) | \ ((r) << 16) | \
((g) << 8) | \ ((g) << 8) | \
(b) ) (b) )
#define PIXEL_ABGR(a,r,g,b) ( ((a) << 24) | \
((b) << 16) | \
((g) << 8) | \
(r) )
#define PIXEL_ARGB8565(a,r,g,b)( ((a) << 16) | \ #define PIXEL_ARGB8565(a,r,g,b)( ((a) << 16) | \
PIXEL_RGB16 (r, g, b) ) PIXEL_RGB16 (r, g, b) )
#define PIXEL_ARGB1666(a,r,g,b) ( (((a)&0x80) << 11) | \ #define PIXEL_ARGB1666(a,r,g,b) ( (((a)&0x80) << 11) | \
(((r)&0xFC) << 10) | \ (((r)&0xFC) << 10) | \
(((g)&0xFC) << 4) | \ (((g)&0xFC) << 4) | \
(((b)&0xFC) >> 2) ) (((b)&0xFC) >> 2) )
#define PIXEL_ARGB6666(a,r,g,b) ( (((a)&0xFC) << 16) | \ #define PIXEL_ARGB6666(a,r,g,b) ( (((a)&0xFC) << 16) | \
(((r)&0xFC) << 10) | \ (((r)&0xFC) << 10) | \
skipping to change at line 397 skipping to change at line 402
(((pixel) & 0x000000F0) >> 4) ) (((pixel) & 0x000000F0) >> 4) )
#define ARGB_TO_RGB555(pixel) ( (((pixel) & 0x00F80000) >> 9) | \ #define ARGB_TO_RGB555(pixel) ( (((pixel) & 0x00F80000) >> 9) | \
(((pixel) & 0x0000F800) >> 6) | \ (((pixel) & 0x0000F800) >> 6) | \
(((pixel) & 0x000000F8) >> 3) ) (((pixel) & 0x000000F8) >> 3) )
#define ARGB_TO_BGR555(pixel) ( (((pixel) & 0x00F80000) >> 19) | \ #define ARGB_TO_BGR555(pixel) ( (((pixel) & 0x00F80000) >> 19) | \
(((pixel) & 0x0000F800) >> 6) | \ (((pixel) & 0x0000F800) >> 6) | \
(((pixel) & 0x000000F8) << 7) ) (((pixel) & 0x000000F8) << 7) )
#define ARGB_TO_ABGR(pixel) ( ((pixel) & 0xFF00FF00) | \
(((pixel) & 0x000000FF) << 16) | \
(((pixel) & 0x00FF0000) >> 16) )
/* RGB <-> YCbCr conversion */ /* RGB <-> YCbCr conversion */
#define YCBCR_TO_RGB( y, cb, cr, r, g, b ) \ #define YCBCR_TO_RGB( y, cb, cr, r, g, b ) \
do { \ do { \
int _y = (y) - 16; \ int _y = (y) - 16; \
int _cb = (cb) - 128; \ int _cb = (cb) - 128; \
int _cr = (cr) - 128; \ int _cr = (cr) - 128; \
\ \
int _r = (298 * _y + 409 * _cr + 128) >> 8; \ int _r = (298 * _y + 409 * _cr + 128) >> 8; \
int _g = (298 * _y - 100 * _cb - 208 * _cr + 128) >> 8; \ int _g = (298 * _y - 100 * _cb - 208 * _cr + 128) >> 8; \
skipping to change at line 423 skipping to change at line 432
#define RGB_TO_YCBCR( r, g, b, y, cb, cr ) \ #define RGB_TO_YCBCR( r, g, b, y, cb, cr ) \
do { \ do { \
int _r = (r), _g = (g), _b = (b); \ int _r = (r), _g = (g), _b = (b); \
\ \
(y) = ( 66 * _r + 129 * _g + 25 * _b + 16*256 + 128) >> 8; \ (y) = ( 66 * _r + 129 * _g + 25 * _b + 16*256 + 128) >> 8; \
(cb) = ( - 38 * _r - 74 * _g + 112 * _b + 128*256 + 128) >> 8; \ (cb) = ( - 38 * _r - 74 * _g + 112 * _b + 128*256 + 128) >> 8; \
(cr) = ( 112 * _r - 94 * _g - 18 * _b + 128*256 + 128) >> 8; \ (cr) = ( 112 * _r - 94 * _g - 18 * _b + 128*256 + 128) >> 8; \
} while (0) } while (0)
DFBSurfacePixelFormat dfb_pixelformat_for_depth( int depth );
void dfb_pixel_to_color ( DFBSurfacePixelFormat format, void dfb_pixel_to_color ( DFBSurfacePixelFormat format,
unsigned long pixel, unsigned long pixel,
DFBColor *ret_colo r ); DFBColor *ret_colo r );
unsigned long dfb_pixel_from_color( DFBSurfacePixelFormat format, unsigned long dfb_pixel_from_color( DFBSurfacePixelFormat format,
const DFBColor *color ); const DFBColor *color );
static inline u32 static __inline__ u32
dfb_color_to_pixel( DFBSurfacePixelFormat format, dfb_color_to_pixel( DFBSurfacePixelFormat format,
u8 r, u8 g, u8 b ) u8 r, u8 g, u8 b )
{ {
const DFBColor color = { 0, r, g, b }; const DFBColor color = { 0, r, g, b };
return dfb_pixel_from_color( format, &color ); return dfb_pixel_from_color( format, &color );
} }
static inline u32 static __inline__ u32
dfb_color_to_argb( const DFBColor *color ) dfb_color_to_argb( const DFBColor *color )
{ {
return (color->a << 24) | (color->r << 16) | (color->g << 8) | color-> b; return (color->a << 24) | (color->r << 16) | (color->g << 8) | color-> b;
} }
static inline u32 static __inline__ u32
dfb_color_to_aycbcr( const DFBColor *color ) dfb_color_to_aycbcr( const DFBColor *color )
{ {
u32 y, cb, cr; u32 y, cb, cr;
RGB_TO_YCBCR( color->r, color->g, color->b, y, cb, cr ); RGB_TO_YCBCR( color->r, color->g, color->b, y, cb, cr );
return (color->a << 24) | (y << 16) | (cb << 8) | cr; return (color->a << 24) | (y << 16) | (cb << 8) | cr;
} }
static inline u32 static __inline__ u32
dfb_color_to_acrycb( const DFBColor *color ) dfb_color_to_acrycb( const DFBColor *color )
{ {
u32 y, cb, cr; u32 y, cb, cr;
RGB_TO_YCBCR( color->r, color->g, color->b, y, cb, cr ); RGB_TO_YCBCR( color->r, color->g, color->b, y, cb, cr );
return (color->a << 24) | (cr << 16) | (y << 8) | cb; return (color->a << 24) | (cr << 16) | (y << 8) | cb;
} }
static inline void static __inline__ void
dfb_argb_to_rgb332( const u32 *src, u8 *dst, int len ) dfb_argb_to_rgb332( const u32 *src, u8 *dst, int len )
{ {
int i; int i;
for (i=0; i<len; i++) { for (i=0; i<len; i++) {
register u32 argb = src[i]; register u32 argb = src[i];
dst[i] = RGB32_TO_RGB332( argb ); dst[i] = RGB32_TO_RGB332( argb );
} }
} }
static inline void static __inline__ void
dfb_argb_to_argb1555( const u32 *src, u16 *dst, int len ) dfb_argb_to_argb1555( const u32 *src, u16 *dst, int len )
{ {
int i; int i;
for (i=0; i<len; i++) { for (i=0; i<len; i++) {
register u32 argb = src[i]; register u32 argb = src[i];
dst[i] = ARGB_TO_ARGB1555( argb ); dst[i] = ARGB_TO_ARGB1555( argb );
} }
} }
static inline void static __inline__ void
dfb_argb_to_rgba5551( const u32 *src, u16 *dst, int len ) dfb_argb_to_rgba5551( const u32 *src, u16 *dst, int len )
{ {
int i; int i;
for (i=0; i<len; i++) { for (i=0; i<len; i++) {
register u32 argb = src[i]; register u32 argb = src[i];
dst[i] = ARGB_TO_RGBA5551( argb ); dst[i] = ARGB_TO_RGBA5551( argb );
} }
} }
static inline void static __inline__ void
dfb_argb_to_argb2554( const u32 *src, u16 *dst, int len ) dfb_argb_to_argb2554( const u32 *src, u16 *dst, int len )
{ {
int i; int i;
for (i=0; i<len; i++) { for (i=0; i<len; i++) {
register u32 argb = src[i]; register u32 argb = src[i];
dst[i] = ARGB_TO_ARGB2554( argb ); dst[i] = ARGB_TO_ARGB2554( argb );
} }
} }
static inline void static __inline__ void
dfb_argb_to_argb4444( const u32 *src, u16 *dst, int len ) dfb_argb_to_argb4444( const u32 *src, u16 *dst, int len )
{ {
int i; int i;
for (i=0; i<len; i++) { for (i=0; i<len; i++) {
register u32 argb = src[i]; register u32 argb = src[i];
dst[i] = ARGB_TO_ARGB4444( argb ); dst[i] = ARGB_TO_ARGB4444( argb );
} }
} }
static inline void static __inline__ void
dfb_argb_to_rgba4444( const u32 *src, u16 *dst, int len ) dfb_argb_to_rgba4444( const u32 *src, u16 *dst, int len )
{ {
int i; int i;
for (i=0; i<len; i++) { for (i=0; i<len; i++) {
register u32 rgba = src[i]; register u32 rgba = src[i];
dst[i] = ARGB_TO_RGBA4444( rgba ); dst[i] = ARGB_TO_RGBA4444( rgba );
} }
} }
static inline void static __inline__ void
dfb_argb_to_argb8565( const u32 *src, u8 *dst, int len ) dfb_argb_to_argb8565( const u32 *src, u8 *dst, int len )
{ {
int i = -1, j = -1; int i = -1, j = -1;
while (++i < len) { while (++i < len) {
register u32 argb = src[i]; register u32 argb = src[i];
register u32 d = ARGB_TO_ARGB8565( argb ); register u32 d = ARGB_TO_ARGB8565( argb );
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
dst[++j] = (d >> 16) & 0xff; dst[++j] = (d >> 16) & 0xff;
dst[++j] = (d >> 8) & 0xff; dst[++j] = (d >> 8) & 0xff;
dst[++j] = (d >> 0) & 0xff; dst[++j] = (d >> 0) & 0xff;
#else #else
dst[++j] = (d >> 0) & 0xff; dst[++j] = (d >> 0) & 0xff;
dst[++j] = (d >> 8) & 0xff; dst[++j] = (d >> 8) & 0xff;
dst[++j] = (d >> 16) & 0xff; dst[++j] = (d >> 16) & 0xff;
#endif #endif
} }
} }
static inline void static __inline__ void
dfb_argb_to_rgb16( const u32 *src, u16 *dst, int len ) dfb_argb_to_rgb16( const u32 *src, u16 *dst, int len )
{ {
int i; int i;
for (i=0; i<len; i++) { for (i=0; i<len; i++) {
register u32 argb = src[i]; register u32 argb = src[i];
dst[i] = RGB32_TO_RGB16( argb ); dst[i] = RGB32_TO_RGB16( argb );
} }
} }
static inline void static __inline__ void
dfb_argb_to_a8( const u32 *src, u8 *dst, int len ) dfb_argb_to_a8( const u32 *src, u8 *dst, int len )
{ {
int i; int i;
for (i=0; i<len; i++) for (i=0; i<len; i++)
dst[i] = src[i] >> 24; dst[i] = src[i] >> 24;
} }
void dfb_convert_to_rgb16( DFBSurfacePixelFormat format, void dfb_convert_to_rgb16( DFBSurfacePixelFormat format,
const void *src, const void *src,
 End of changes. 16 change blocks. 
15 lines changed or deleted 22 lines changed or added


 core.h   core.h 
skipping to change at line 41 skipping to change at line 41
#include <fusion/types.h> #include <fusion/types.h>
#include <fusion/lock.h> #include <fusion/lock.h>
#include <fusion/object.h> #include <fusion/object.h>
#include <directfb.h> #include <directfb.h>
#include "coretypes.h" #include "coretypes.h"
#include "coredefs.h" #include "coredefs.h"
#include <core/CoreSlave_includes.h>
#include <core/surface.h>
#define DIRECTFB_CORE_ABI 46 #define DIRECTFB_CORE_ABI 46
typedef enum { typedef enum {
DFCP_CLIPBOARD, DFCP_CLIPBOARD,
DFCP_COLORHASH, DFCP_COLORHASH,
DFCP_GRAPHICS, DFCP_GRAPHICS,
DFCP_INPUT, DFCP_INPUT,
DFCP_LAYER, DFCP_LAYER,
DFCP_SCREEN, DFCP_SCREEN,
DFCP_SURFACE, DFCP_SURFACE,
skipping to change at line 82 skipping to change at line 78
bool emergency ); bool emergency );
void *dfb_core_get_part( CoreDFB *core, void *dfb_core_get_part( CoreDFB *core,
DFBCorePartID part_id ); DFBCorePartID part_id );
#define DFB_CORE(core,PART) dfb_core_get_part( core, DFCP_##PART ) #define DFB_CORE(core,PART) dfb_core_get_part( core, DFCP_##PART )
/* /*
* Object creation * Object creation
*/ */
CoreGraphicsState *dfb_core_create_graphics_state( CoreDFB *core ); CoreLayerContext *dfb_core_create_layer_context( CoreDFB *core );
CoreLayerContext *dfb_core_create_layer_context ( CoreDFB *core ); CoreLayerRegion *dfb_core_create_layer_region ( CoreDFB *core );
CoreLayerRegion *dfb_core_create_layer_region ( CoreDFB *core ); CorePalette *dfb_core_create_palette ( CoreDFB *core );
CorePalette *dfb_core_create_palette ( CoreDFB *core ); CoreSurface *dfb_core_create_surface ( CoreDFB *core );
CoreSurface *dfb_core_create_surface ( CoreDFB *core ); CoreWindow *dfb_core_create_window ( CoreDFB *core );
CoreSurfaceAllocation *dfb_core_create_surface_allocation( CoreDFB *core );
CoreSurfaceBuffer *dfb_core_create_surface_buffer( CoreDFB *core );
CoreWindow *dfb_core_create_window ( CoreDFB *core );
DFBResult dfb_core_get_graphics_state ( CoreDFB *core
,
u32 obje
ct_id,
CoreGraphicsState **ret_
state );
DFBResult dfb_core_get_layer_context ( CoreDFB *core DFBResult dfb_core_get_layer_context ( CoreDFB *core,
, u32 object_
u32 obje id,
ct_id, CoreLayerContext **ret_con
CoreLayerContext **ret_ text );
context );
DFBResult dfb_core_get_layer_region ( CoreDFB *core DFBResult dfb_core_get_layer_region ( CoreDFB *core,
, u32 object_
u32 obje id,
ct_id, CoreLayerRegion **ret_reg
CoreLayerRegion **ret_ ion );
region );
DFBResult dfb_core_get_palette ( CoreDFB *core DFBResult dfb_core_get_palette ( CoreDFB *core,
, u32 object_id,
u32 obje CorePalette **ret_palette
ct_id, );
CorePalette **ret_
palette );
DFBResult dfb_core_get_surface ( CoreDFB *core DFBResult dfb_core_get_surface ( CoreDFB *core,
, u32 object_id,
u32 obje CoreSurface **ret_surface
ct_id, );
CoreSurface **ret_
surface );
DFBResult dfb_core_get_surface_allocation( CoreDFB DFBResult dfb_core_get_window ( CoreDFB *core,
*core, u32 object_id,
u32 CoreWindow **ret_window );
object_id,
CoreSurfaceAllocation *
*ret_allocation );
DFBResult dfb_core_get_surface_buffer ( CoreDFB *core DFBResult dfb_core_create_graphics_state( CoreDFB *core,
, CoreGraphicsState **ret_s
u32 obje tate );
ct_id,
CoreSurfaceBuffer **ret_
surface );
DFBResult dfb_core_get_window ( CoreDFB *core DFBResult dfb_core_get_graphics_state ( CoreDFB *core,
, u32 objec
u32 obje t_id,
ct_id, CoreGraphicsState **ret_s
CoreWindow **ret_ tate );
window );
/* /*
* Debug * Debug
*/ */
DirectResult dfb_core_enum_surfaces ( CoreDFB *core, DirectResult dfb_core_enum_surfaces ( CoreDFB *core,
FusionObjectCallback callback, FusionObjectCallback callback,
void *ctx ); void *ctx );
DirectResult dfb_core_enum_layer_contexts( CoreDFB *core, DirectResult dfb_core_enum_layer_contexts( CoreDFB *core,
FusionObjectCallback callback, FusionObjectCallback callback,
void *ctx ); void *ctx );
skipping to change at line 147 skipping to change at line 135
* Returns true if the calling process is the master fusionee, * Returns true if the calling process is the master fusionee,
* i.e. handles input drivers running their threads. * i.e. handles input drivers running their threads.
*/ */
bool dfb_core_is_master( CoreDFB *core ); bool dfb_core_is_master( CoreDFB *core );
/* /*
* Allows other (blocking) Fusionees to enter the DirectFB session. * Allows other (blocking) Fusionees to enter the DirectFB session.
*/ */
void dfb_core_activate( CoreDFB *core ); void dfb_core_activate( CoreDFB *core );
bool dfb_core_active ( CoreDFB *core );
/* /*
* Returns the core's fusion world. * Returns the core's fusion world.
*/ */
FusionWorld *dfb_core_world( CoreDFB *core ); FusionWorld *dfb_core_world( CoreDFB *core );
/* /*
* Returns the core arena. * Returns the core arena.
*/ */
FusionArena *dfb_core_arena( CoreDFB *core ); FusionArena *dfb_core_arena( CoreDFB *core );
skipping to change at line 194 skipping to change at line 184
bool emergency ); bool emergency );
/* /*
* Removes a function from the cleanup stack. * Removes a function from the cleanup stack.
*/ */
void dfb_core_cleanup_remove( CoreDFB *core, void dfb_core_cleanup_remove( CoreDFB *core,
CoreCleanup *cleanup ); CoreCleanup *cleanup );
DFBFontManager *dfb_core_font_manager( CoreDFB *core ); DFBFontManager *dfb_core_font_manager( CoreDFB *core );
DECLARE_INTERFACE( ICoreResourceManager )
DECLARE_INTERFACE( ICoreResourceClient )
struct __DFB_CoreDFBShared { struct __DFB_CoreDFBShared {
int magic; int magic;
bool secure;
FusionSkirmish lock; FusionSkirmish lock;
bool active; bool active;
FusionObjectPool *graphics_state_pool;
FusionObjectPool *layer_context_pool; FusionObjectPool *layer_context_pool;
FusionObjectPool *layer_region_pool; FusionObjectPool *layer_region_pool;
FusionObjectPool *palette_pool; FusionObjectPool *palette_pool;
FusionObjectPool *state_pool;
FusionObjectPool *surface_pool; FusionObjectPool *surface_pool;
FusionObjectPool *surface_allocation_pool;
FusionObjectPool *surface_buffer_pool;
FusionObjectPool *window_pool; FusionObjectPool *window_pool;
FusionSHMPoolShared *shmpool; FusionSHMPoolShared *shmpool;
FusionSHMPoolShared *shmpool_data; /* for raw data, e.g. surface buffe rs */ FusionSHMPoolShared *shmpool_data; /* for raw data, e.g. surface buffe rs */
FusionCall call; FusionCall call;
}; };
struct __DFB_CoreDFB { struct __DFB_CoreDFB {
int magic; int magic;
skipping to change at line 244 skipping to change at line 227
DirectLink *cleanups; DirectLink *cleanups;
DirectThreadInitHandler *init_handler; DirectThreadInitHandler *init_handler;
DirectSignalHandler *signal_handler; DirectSignalHandler *signal_handler;
DirectCleanupHandler *cleanup_handler; DirectCleanupHandler *cleanup_handler;
DFBFontManager *font_manager; DFBFontManager *font_manager;
struct {
ICoreResourceManager *manager;
DirectHash *identities;
} resource;
FusionCall async_call; // used locally for async destroy
etc.
FusionCall slave_call;
DirectLink *memory_permissions;
DirectMutex memory_permissions_lock;
int shutdown_tid;
int shutdown_running;
}; };
typedef enum {
CMPF_READ = 0x00000001,
CMPF_WRITE = 0x00000002,
} CoreMemoryPermissionFlags;
typedef struct __CoreDFB_CoreMemoryPermission CoreMemoryPermission;
DFBResult dfb_core_memory_permissions_add ( CoreDFB *co
re,
CoreMemoryPermissionFlags fl
ags,
void *da
ta,
size_t le
ngth,
CoreMemoryPermission **re
t_permission );
DFBResult dfb_core_memory_permissions_remove( CoreDFB *co
re,
CoreMemoryPermission *pe
rmission );
DFBResult dfb_core_memory_permissions_check ( CoreDFB *co
re,
CoreMemoryPermissionFlags fl
ags,
void *da
ta,
size_t le
ngth );
extern CoreDFB *core_dfb; // FIXME extern CoreDFB *core_dfb; // FIXME
typedef void (*AsyncCallFunc)( void *ctx,
void *ctx2 );
typedef struct {
AsyncCallFunc func;
void *ctx;
void *ctx2;
} AsyncCall;
/*
* Runs a call on the Fusion Dispatch Thread
*
* Used for asynchronous destruct, i.e. when a call needs to destroy itself
*/
static __inline__ DFBResult
Core_AsyncCall( AsyncCallFunc func,
void *ctx,
void *ctx2 )
{
AsyncCall call;
call.func = func;
call.ctx = ctx;
call.ctx2 = ctx2;
return (DFBResult) fusion_call_execute2( &core_dfb->async_call, (Fusio
nCallExecFlags)(FCEF_ONEWAY | FCEF_NODIRECT), 0, &call, sizeof(call), NULL
);
}
void Core_TLS__init( void );
void Core_TLS__deinit( void );
/*
* Identity management
*
* Incoming dispatch pushes ID of caller
*/
void Core_PushIdentity( FusionID caller );
void Core_PopIdentity ( void );
FusionID Core_GetIdentity ( void );
void Core_PushCalling ( void );
void Core_PopCalling ( void );
int Core_GetCalling ( void );
/*
* Resource management
*
* Quotas etc can be implemented.
*
* Run time option 'resource-manager' is needed.
*/
DFBResult Core_Resource_CheckSurface ( const CoreSurfaceConfig *confi
g,
CoreSurfaceTypeFlags type,
u64 resou
rce_id,
CorePalette *palet
te );
DFBResult Core_Resource_CheckSurfaceUpdate( CoreSurface *surfa
ce,
const CoreSurfaceConfig *confi
g );
DFBResult Core_Resource_AddSurface ( CoreSurface *surfa
ce );
DFBResult Core_Resource_RemoveSurface ( CoreSurface *surfa
ce );
DFBResult Core_Resource_UpdateSurface ( CoreSurface *surfa
ce,
const CoreSurfaceConfig *confi
g );
/*
* Resource manager main interface
*
* Implementation can be loaded via 'resource-manager' option.
*/
DEFINE_INTERFACE( ICoreResourceManager,
DFBResult (*CreateClient) ( ICoreResourceManager *thiz,
FusionID identity,
ICoreResourceClient **ret_client
);
)
/*
* Per slave resource accounting
*/
DEFINE_INTERFACE( ICoreResourceClient,
DFBResult (*CheckSurface) ( ICoreResourceClient *thiz,
const CoreSurfaceConfig *config,
CoreSurfaceTypeFlags type,
u64 resource_i
d,
CorePalette *palette );
DFBResult (*CheckSurfaceUpdate) ( ICoreResourceClient *thiz,
CoreSurface *surface,
const CoreSurfaceConfig *config );
DFBResult (*AddSurface) ( ICoreResourceClient *thiz,
CoreSurface *surface );
DFBResult (*RemoveSurface) ( ICoreResourceClient *thiz,
CoreSurface *surface );
DFBResult (*UpdateSurface) ( ICoreResourceClient *thiz,
CoreSurface *surface,
const CoreSurfaceConfig *config );
)
/*
* Client instance management
*/
DFBResult Core_Resource_AddIdentity ( FusionID identity,
u32 slave_call );
void Core_Resource_DisposeIdentity( FusionID identity );
ICoreResourceClient *Core_Resource_GetClient ( FusionID identity );
CoreSlave *Core_Resource_GetSlave ( FusionID identity );
/*
* Per client cleanup
*/
typedef struct __Core__CoreResourceCleanup CoreResourceCleanup;
typedef void (*CoreResourceCleanupCallback)( void *ctx,
void *ctx2 );
DFBResult Core_Resource_AddCleanup ( FusionID
identity,
CoreResourceCleanupCall
back callback,
void
*ctx,
void
*ctx2,
CoreResourceCleanup
**ret_cleanup );
DFBResult Core_Resource_DisposeCleanup ( CoreResourceCleanup
*cleanup );
#endif #endif
 End of changes. 18 change blocks. 
275 lines changed or deleted 37 lines changed or added


 debug.h   debug.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 34 skipping to change at line 34
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__DEBUG_H__ #ifndef __DIRECT__DEBUG_H__
#define __DIRECT__DEBUG_H__ #define __DIRECT__DEBUG_H__
#include <direct/build.h> #include <direct/build.h>
#include <stdio.h>
#include <errno.h>
#include <direct/clock.h> #include <direct/clock.h>
#include <direct/conf.h> #include <direct/conf.h>
#include <direct/log.h> #include <direct/log.h>
#include <direct/messages.h> #include <direct/messages.h>
#include <direct/system.h> #include <direct/system.h>
#include <direct/thread.h>
#include <direct/trace.h> #include <direct/trace.h>
#include <direct/types.h> #include <direct/types.h>
typedef struct { // @deprecated
unsigned int age; #define D_DEBUG_DOMAIN( _identifier, _name, _description )
bool enabled; \
bool registered; D_LOG_DOMAIN( _identifier, _name, _description )
const char *name; #ifndef DIRECT_DISABLE_DEPRECATED
const char *description;
int name_len; // @deprecated
} DirectDebugDomain; D_DEBUG_DOMAIN( _direct_debug_deprecated, "-", "deprecated" );
void direct_debug_config_domain( const char *name, bool enable ); // @deprecated
#define D_DEBUG( ... )
\
D_DEBUG_AT( _direct_debug_deprecated, __VA_ARGS__ )
bool direct_debug_check_domain( DirectDebugDomain *domain ); #endif
#if DIRECT_BUILD_TEXT static __inline__ void
direct_debug_config_domain( const char *name, bool enable )
{
direct_log_domain_config_level( name, enable ? DIRECT_LOG_ALL : DIRECT
_LOG_NONE );
}
#define D_DEBUG_DOMAIN(identifier,name,description) #if DIRECT_BUILD_TEXT
\
static DirectDebugDomain identifier __attribute__((unused))
\
= { 0, false, false, name, description, sizeof(name) - 1 }
void direct_debug_at_always( DirectDebugDomain *domain, void DIRECT_API direct_debug_at_always( DirectLogDomain *domain,
const char *format, ... ) D_FORMAT_PRI const char *format, ... ) D_F
NTF(2); ORMAT_PRINTF(2);
#define d_debug_at( domain, ... ) direct_debug_at_always( &domain, __V A_ARGS__ ) #define d_debug_at( domain, ... ) direct_debug_at_always( &domain, __V A_ARGS__ )
#if DIRECT_BUILD_DEBUGS #if DIRECT_BUILD_DEBUGS
void direct_debug( const char *format, ... ) D_FORMAT_PRINTF(1); /*
* Direct v2.0 - Debug Interface
*
* debug level 1-9 (0 = verbose)
*
*/
void DIRECT_API direct_debug_log( DirectLogDomain *domain,
unsigned int debug_level,
const char *format, ... ) D_FOR
MAT_PRINTF(3);
void direct_debug_at( DirectDebugDomain *domain, /* old */
const char *format, ... ) D_FORMAT_PRINTF(2); void DIRECT_API direct_debug_at( DirectLogDomain *domain,
const char *format, ... ) D_FORMAT_PR
INTF(2);
void direct_debug_enter( DirectDebugDomain *domain, void DIRECT_API direct_debug_enter( DirectLogDomain *domain,
const char *func, const char *func,
const char *file, const char *file,
int line, int line,
const char *format, ... ) D_FORMAT_PRINTF(5); const char *format, ... ) D_FORMAT_PRI
NTF(5);
void direct_debug_exit( DirectDebugDomain *domain, void DIRECT_API direct_debug_exit( DirectLogDomain *domain,
const char *func, const char *func,
const char *file, const char *file,
int line, int line,
const char *format, ... ) D_FORMAT_PRINTF(5); const char *format, ... ) D_FORMAT_PRIN
TF(5);
void direct_break( const char *func, void DIRECT_API direct_break( const char *func,
const char *file, const char *file,
int line, int line,
const char *format, ... ) D_FORMAT_PRINTF(4); const char *format, ... ) D_FORMAT_PRINTF(4)
;
void direct_assertion( const char *exp, void DIRECT_API direct_assertion( const char *exp,
const char *func, const char *func,
const char *file, const char *file,
int line ); int line );
void direct_assumption( const char *exp, void DIRECT_API direct_assumption( const char *exp,
const char *func, const char *func,
const char *file, const char *file,
int line ); int line );
#endif #endif
#if DIRECT_BUILD_DEBUG || defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FO RCE_DEBUG) #if DIRECT_BUILD_DEBUG || defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FO RCE_DEBUG)
#define D_DEBUG_ENABLED (1) #define D_DEBUG_ENABLED (1)
#define D_DEBUG(...) \ #define D_DEBUG_LOG(_Domain,_level,...) \
do { \ do { \
if (!direct_config || direct_config->debug) direct_debug_log( &_Domain, _level, __VA_ARGS__ );
\ \
direct_debug( __VA_ARGS__ );
\
} while (0) } while (0)
#define D_DEBUG_AT(d,...) \ #define D_DEBUG_AT(d,...) \
do { \ do { \
direct_debug_at( &d, __VA_ARGS__ ); \ direct_debug_at( &d, __VA_ARGS__ ); \
} while (0) } while (0)
#define D_DEBUG_ENTER(d,...) \ #define D_DEBUG_ENTER(d,...) \
do { \ do { \
direct_debug_enter( &d, __FUNCTION__, __FILE__, __LINE__, __VA_AR GS__ ); \ /*direct_debug_enter( &d, __FUNCTION__, __FILE__, __LINE__, x );* / \
} while (0) } while (0)
#define D_DEBUG_EXIT(d,...) \ #define D_DEBUG_EXIT(d,...) \
do { \ do { \
direct_debug_exit( &d, __FUNCTION__, __FILE__, __LINE__, __VA_ARG S__ ); \ /*direct_debug_exit( &d, __FUNCTION__, __FILE__, __LINE__, x );*/ \
} while (0) } while (0)
#define D_ASSERT(exp) \ #define D_ASSERT(exp) \
do { \ do { \
if (!(exp)) \ if (!(exp)) \
direct_assertion( #exp, __FUNCTION__, __FILE__, __LINE__ ); \ direct_assertion( #exp, __FUNCTION__, __FILE__, __LINE__ ); \
} while (0) } while (0)
#define D_ASSUME(exp) \ #define D_ASSUME(exp) \
do { \ do { \
if (!(exp)) \ if (!(exp)) \
direct_assumption( #exp, __FUNCTION__, __FILE__, __LINE__ ); \ direct_assumption( #exp, __FUNCTION__, __FILE__, __LINE__ ); \
} while (0) } while (0)
#define D_BREAK(...) \ #define D_BREAK(...) \
do { \ do { \
direct_break( __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__ ); \ direct_break( __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__ ); \
} while (0) } while (0)
#define D_DEBUG_CHECK(d) \ #define D_DEBUG_CHECK(d) \
direct_debug_check_domain( &d ) direct_log_domain_check( &d )
#elif defined(DIRECT_MINI_DEBUG) #elif defined(DIRECT_MINI_DEBUG)
/* /*
* Mini debug mode, only D_DEBUG_AT, no domain filters, simple assertion * Mini debug mode, only D_DEBUG_AT, no domain filters, simple assertion
*/ */
#define D_DEBUG_ENABLED (2) #define D_DEBUG_ENABLED (2)
#define D_DEBUG_LOG(_Domain,_level,...)
\
do {
\
if (direct_config->log_level >= DIRECT_LOG_DEBUG)
\
direct_debug_at_always( &d, __VA_ARGS__ );
\
} while (0)
#define D_DEBUG_AT(d,...) \ #define D_DEBUG_AT(d,...) \
do { \ do { \
if (direct_config->debug) direct_debug_at_always( &d, __VA_ARGS__ if (direct_config->log_level >= DIRECT_LOG_DEBUG)
); \ \
direct_debug_at_always( &d, __VA_ARGS__ );
\
} while (0) } while (0)
#define D_CHECK(exp, aa) \ #define D_CHECK(exp, aa) \
do { \ do { \
if (!(exp)) { \ if (!(exp)) { \
long long millis = direct_clock_get_millis(); \ long long millis = direct_clock_get_millis(); \
const char *name = direct_thread_self_name(); \ const char *name = direct_thread_self_name(); \
\ \
direct_log_printf( NULL, \ direct_log_printf( NULL, \
"(!) [%-15s %3lld.%03lld] (%5d) *** " #aa " [%s] failed *** [%s:%d in %s()]\n", \ "(!) [%-15s %3lld.%03lld] (%5d) *** " #aa " [%s] failed *** [%s:%d in %s()]\n", \
skipping to change at line 188 skipping to change at line 201
} while (0) } while (0)
#define D_ASSERT(exp) D_CHECK(exp, Assertion) #define D_ASSERT(exp) D_CHECK(exp, Assertion)
#define D_ASSUME(exp) D_CHECK(exp, Assumption) #define D_ASSUME(exp) D_CHECK(exp, Assumption)
#define D_DEBUG_CHECK(d) \ #define D_DEBUG_CHECK(d) \
direct_config->debug direct_config->debug
#endif /* MINI_DEBUG / DIRECT_BUILD_DEBUG || DIRECT_ENABLE_DEBUG || DIR ECT_FORCE_DEBUG */ #endif /* MINI_DEBUG / DIRECT_BUILD_DEBUG || DIRECT_ENABLE_DEBUG || DIR ECT_FORCE_DEBUG */
#define D_DEBUG_AT__(d,...)
\
do {
\
direct_log_printf( NULL, __VA_ARGS__ );
\
} while (0)
#endif /* DIRECT_BUILD_TEXT */ #endif /* DIRECT_BUILD_TEXT */
/* /*
* Fallback definitions, e.g. without DIRECT_BUILD_TEXT or DIRECT_ENABLE_DE BUG * Fallback definitions, e.g. without DIRECT_BUILD_TEXT or DIRECT_ENABLE_DE BUG
*/ */
#ifndef D_DEBUG_ENABLED #ifndef D_DEBUG_ENABLED
#define D_DEBUG_ENABLED (0) #define D_DEBUG_ENABLED (0)
#endif #endif
#ifndef D_DEBUG_LOG
#define D_DEBUG_LOG(_Domain,_level,...)
\
do {
\
} while (0)
#endif
#ifndef D_DEBUG #ifndef D_DEBUG
#define D_DEBUG(...) do {} while (0) #define D_DEBUG(d,...) do {} while (0)
#endif #endif
#ifndef D_DEBUG_AT #ifndef D_DEBUG_AT
#define D_DEBUG_AT(d,...) do {} while (0) #define D_DEBUG_AT(d,...) do {} while (0)
#endif #endif
#ifndef D_DEBUG_ENTER #ifndef D_DEBUG_ENTER
#define D_DEBUG_ENTER(d,...) do {} while (0) #define D_DEBUG_ENTER(d,...) do {} while (0)
#endif #endif
skipping to change at line 222 skipping to change at line 246
#endif #endif
#ifndef D_ASSERT #ifndef D_ASSERT
#define D_ASSERT(exp) do {} while (0) #define D_ASSERT(exp) do {} while (0)
#endif #endif
#ifndef D_ASSUME #ifndef D_ASSUME
#define D_ASSUME(exp) do {} while (0) #define D_ASSUME(exp) do {} while (0)
#endif #endif
#ifndef D_DEBUG_AT__
#define D_DEBUG_AT__(d,...) do {} while (0)
#endif
#ifndef D_DEBUG_CHECK #ifndef D_DEBUG_CHECK
#define D_DEBUG_CHECK(d) false #define D_DEBUG_CHECK(d) false
#endif #endif
#ifndef D_BREAK #ifndef D_BREAK
#define D_BREAK(...) do {} while (0) #define D_BREAK(...) do {} while (0)
#endif #endif
#ifndef d_debug_at #ifndef d_debug_at
#define d_debug_at( domain, ... ) do {} while (0) #define d_debug_at( domain, ... ) do {} while (0)
#endif #endif
#ifndef D_DEBUG_DOMAIN #ifndef D_LOG_DOMAIN
#define D_DEBUG_DOMAIN(i,n,d) #define D_LOG_DOMAIN(i,n,d)
#endif #endif
/* /*
* Magic Assertions & Utilities * Magic Assertions & Utilities
*/ */
#define D_MAGIC(spell) ( (((spell)[sizeof(spell)*8/9] << 24) | \ #define D_MAGIC(spell) ( (((spell)[sizeof(spell)*8/9] << 24) | \
((spell)[sizeof(spell)*7/9] << 16) | \ ((spell)[sizeof(spell)*7/9] << 16) | \
((spell)[sizeof(spell)*6/9] << 8) | \ ((spell)[sizeof(spell)*6/9] << 8) | \
((spell)[sizeof(spell)*5/9] )) ^ \ ((spell)[sizeof(spell)*5/9] )) ^ \
(((spell)[sizeof(spell)*4/9] << 24) | \ (((spell)[sizeof(spell)*4/9] << 24) | \
((spell)[sizeof(spell)*3/9] << 16) | \ ((spell)[sizeof(spell)*3/9] << 16) | \
((spell)[sizeof(spell)*2/9] << 8) | \ ((spell)[sizeof(spell)*2/9] << 8) | \
((spell)[sizeof(spell)*1/9] )) ) ((spell)[sizeof(spell)*1/9] )) )
#if DIRECT_BUILD_DEBUGS
#define D_MAGIC_CHECK(o,m) ((o) != NULL && (o)->magic == D_MAGIC(#m
))
#define D_MAGIC_SET(o,m) do { \ #define D_MAGIC_SET(o,m) do { \
D_ASSERT( (o) != NULL ); \ D_ASSERT( (o) != NULL ); \
D_ASSUME( (o)->magic != D_MAGIC(#m) ); \ D_ASSUME( (o)->magic != D_MAGIC(#m) ); \
\ \
(o)->magic = D_MAGIC(#m); \ (o)->magic = D_MAGIC(#m); \
} while (0) } while (0)
#define D_MAGIC_SET_ONLY(o,m) do { \ #define D_MAGIC_SET_ONLY(o,m) do { \
D_ASSERT( (o) != NULL ); \ D_ASSERT( (o) != NULL ); \
\ \
skipping to change at line 287 skipping to change at line 319
D_ASSERT( (o)->magic == D_MAGI C(#m) ); \ D_ASSERT( (o)->magic == D_MAGI C(#m) ); \
} while (0) } while (0)
#define D_MAGIC_CLEAR(o) do { \ #define D_MAGIC_CLEAR(o) do { \
D_ASSERT( (o) != NULL ); \ D_ASSERT( (o) != NULL ); \
D_ASSUME( (o)->magic != 0 ); \ D_ASSUME( (o)->magic != 0 ); \
\ \
(o)->magic = 0; \ (o)->magic = 0; \
} while (0) } while (0)
#define D_INDEX_ASSERT(index,array) \
do { \
D_ASSERT( index >= 0 ); \
D_ASSERT( index < D_ARRAY_SIZE(array) ); \
} while (0)
#else
#define D_MAGIC_CHECK(o,m) ((o) != NULL)
#define D_MAGIC_SET(o,m) do {
\
} while (0)
#define D_MAGIC_SET_ONLY(o,m) do {
\
} while (0)
#define D_MAGIC_ASSERT(o,m) do {
\
} while (0)
#define D_MAGIC_ASSUME(o,m) do {
\
} while (0)
#define D_MAGIC_ASSERT_IF(o,m) do {
\
} while (0)
#define D_MAGIC_CLEAR(o) do {
\
} while (0)
#define D_INDEX_ASSERT(index,array) \
do { \
} while (0)
#endif
#define D_FLAGS_ASSERT(flags,f) D_ASSERT( D_FLAGS_ARE_IN(flags,f) )
#endif #endif
 End of changes. 33 change blocks. 
63 lines changed or deleted 153 lines changed or added


 dfb_types.h   dfb_types.h 
skipping to change at line 34 skipping to change at line 34
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DFB_TYPES_H__ #ifndef __DFB_TYPES_H__
#define __DFB_TYPES_H__ #define __DFB_TYPES_H__
#include <direct/types.h> #include <direct/types.h>
#ifdef WIN32
// The following ifdef block is the standard way of creating macros which m
ake exporting
// from a DLL simpler. All files within this DLL are compiled with the DIRE
CTFB_EXPORTS
// symbol defined on the command line. This symbol should not be defined on
any project
// that uses this DLL. This way any other project whose source files includ
e this file see
// DIRECTFB_API functions as being imported from a DLL, whereas this DLL se
es symbols
// defined with this macro as being exported.
#ifdef DIRECTFB_EXPORTS
#define DIRECTFB_API __declspec(dllexport)
#else
#define DIRECTFB_API __declspec(dllimport)
#endif
#else
#define DIRECTFB_API
#endif
#ifdef DIRECTFB_ENABLE_DEPRECATED #ifdef DIRECTFB_ENABLE_DEPRECATED
#define __u8 u8 #define __u8 u8
#define __u16 u16 #define __u16 u16
#define __u32 u32 #define __u32 u32
#define __u64 u64 #define __u64 u64
#define __s8 s8 #define __s8 s8
#define __s16 s16 #define __s16 s16
#define __s32 s32 #define __s32 s32
#define __s64 s64 #define __s64 s64
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 21 lines changed or added


 direct.h   direct.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 34 skipping to change at line 34
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__DIRECT_H__ #ifndef __DIRECT__DIRECT_H__
#define __DIRECT__DIRECT_H__ #define __DIRECT__DIRECT_H__
#include <direct/types.h> #include <direct/types.h>
DirectResult direct_initialize( void ); DirectResult DIRECT_API direct_initialize( void );
DirectResult direct_shutdown( void ); DirectResult DIRECT_API direct_shutdown( void );
typedef void (*DirectCleanupHandlerFunc)( void *ctx ); typedef void (*DirectCleanupHandlerFunc)( void *ctx );
DirectResult direct_cleanup_handler_add( DirectCleanupHandlerFunc func, DirectResult DIRECT_API direct_cleanup_handler_add( DirectCleanupHandlerFun
void *ctx, c func,
DirectCleanupHandler **ret_han void
dler ); *ctx,
DirectCleanupHandler
**ret_handler );
DirectResult direct_cleanup_handler_remove( DirectCleanupHandler *handler DirectResult DIRECT_API direct_cleanup_handler_remove( DirectCleanupHandler
); *handler );
void __D_direct_init( void );
void __D_direct_deinit( void );
#endif #endif
 End of changes. 4 change blocks. 
9 lines changed or deleted 14 lines changed or added


 directfb.h   directfb.h 
skipping to change at line 38 skipping to change at line 38
#ifndef __DIRECTFB_H__ #ifndef __DIRECTFB_H__
#define __DIRECTFB_H__ #define __DIRECTFB_H__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif #endif
#include <dfb_types.h> #include <dfb_types.h>
#include <sys/time.h> /* struct timeval */
#include <directfb_build.h> #include <directfb_build.h>
#include <directfb_keyboard.h> #include <directfb_keyboard.h>
#include <direct/interface.h> #include <direct/interface.h>
#ifdef WIN32
#undef CreateWindow // FIXME
#endif
/* /*
* Version handling. * Version handling.
*/ */
extern const unsigned int directfb_major_version; extern const unsigned int directfb_major_version;
extern const unsigned int directfb_minor_version; extern const unsigned int directfb_minor_version;
extern const unsigned int directfb_micro_version; extern const unsigned int directfb_micro_version;
extern const unsigned int directfb_binary_age; extern const unsigned int directfb_binary_age;
extern const unsigned int directfb_interface_age; extern const unsigned int directfb_interface_age;
/* /*
* Check for a certain DirectFB version. * Check for a certain DirectFB version.
* In case of an error a message is returned describing the mismatch. * In case of an error a message is returned describing the mismatch.
*/ */
const char * DirectFBCheckVersion( unsigned int required_major, const char DIRECTFB_API *DirectFBCheckVersion( unsigned int required_major,
unsigned int required_minor, unsigned int required_minor,
unsigned int required_micro ); unsigned int required_micro
);
/* /*
* Main interface of DirectFB, created by DirectFBCreate(). * Main interface of DirectFB, created by DirectFBCreate().
*/ */
DECLARE_INTERFACE( IDirectFB ) D_DECLARE_INTERFACE( IDirectFB )
/* /*
* Interface to a surface object, being a graphics context for rendering an d state control, * Interface to a surface object, being a graphics context for rendering an d state control,
* buffer operations, palette access and sub area translate'n'clip logic. * buffer operations, palette access and sub area translate'n'clip logic.
*/ */
DECLARE_INTERFACE( IDirectFBSurface ) D_DECLARE_INTERFACE( IDirectFBSurface )
/* /*
* Interface for read/write access to the colors of a palette object and fo r cloning it. * Interface for read/write access to the colors of a palette object and fo r cloning it.
*/ */
DECLARE_INTERFACE( IDirectFBPalette ) D_DECLARE_INTERFACE( IDirectFBPalette )
/* /*
* Input device interface for keymap access, event buffers and state querie s. * Input device interface for keymap access, event buffers and state querie s.
*/ */
DECLARE_INTERFACE( IDirectFBInputDevice ) D_DECLARE_INTERFACE( IDirectFBInputDevice )
/* /*
* Layer interface for configuration, window stack usage or direct surface access, with shared/exclusive context. * Layer interface for configuration, window stack usage or direct surface access, with shared/exclusive context.
*/ */
DECLARE_INTERFACE( IDirectFBDisplayLayer ) D_DECLARE_INTERFACE( IDirectFBDisplayLayer )
/* /*
* Interface to a window object, controlling appearance and focus, position ing and stacking, * Interface to a window object, controlling appearance and focus, position ing and stacking,
* event buffers and surface access. * event buffers and surface access.
*/ */
DECLARE_INTERFACE( IDirectFBWindow ) D_DECLARE_INTERFACE( IDirectFBWindow )
/* /*
* Interface to a local event buffer to send/receive events, wait for event s, abort waiting or reset buffer. * Interface to a local event buffer to send/receive events, wait for event s, abort waiting or reset buffer.
*/ */
DECLARE_INTERFACE( IDirectFBEventBuffer ) D_DECLARE_INTERFACE( IDirectFBEventBuffer )
/* /*
* Font interface for getting metrics, measuring strings or single characte rs, query/choose encodings. * Font interface for getting metrics, measuring strings or single characte rs, query/choose encodings.
*/ */
DECLARE_INTERFACE( IDirectFBFont ) D_DECLARE_INTERFACE( IDirectFBFont )
/* /*
* Interface to an image provider, retrieving information about the image a nd rendering it to a surface. * Interface to an image provider, retrieving information about the image a nd rendering it to a surface.
*/ */
DECLARE_INTERFACE( IDirectFBImageProvider ) D_DECLARE_INTERFACE( IDirectFBImageProvider )
/* /*
* Interface to a video provider for playback with advanced control and bas ic stream information. * Interface to a video provider for playback with advanced control and bas ic stream information.
*/ */
DECLARE_INTERFACE( IDirectFBVideoProvider ) D_DECLARE_INTERFACE( IDirectFBVideoProvider )
/* /*
* Data buffer interface, providing unified access to different kinds of da ta storage and live feed. * Data buffer interface, providing unified access to different kinds of da ta storage and live feed.
*/ */
DECLARE_INTERFACE( IDirectFBDataBuffer ) D_DECLARE_INTERFACE( IDirectFBDataBuffer )
/* /*
* Interface to different display outputs, encoders, connector settings, po wer management and synchronization. * Interface to different display outputs, encoders, connector settings, po wer management and synchronization.
*/ */
DECLARE_INTERFACE( IDirectFBScreen ) D_DECLARE_INTERFACE( IDirectFBScreen )
/* /*
* OpenGL context of a surface. * OpenGL context of a surface.
*/ */
DECLARE_INTERFACE( IDirectFBGL ) D_DECLARE_INTERFACE( IDirectFBGL )
/*
* Rendering context manager
*/
D_DECLARE_INTERFACE( IDirectFBGL2 )
/*
* Rendering context
*/
D_DECLARE_INTERFACE( IDirectFBGL2Context )
/* /*
* Return code of all interface methods and most functions * Return code of all interface methods and most functions
* *
* Whenever a method has to return any information, it is done via output p arameters. These are pointers to * Whenever a method has to return any information, it is done via output p arameters. These are pointers to
* primitive types such as <i>int *ret_num</i>, enumerated types like <i>DF BBoolean *ret_enabled</i>, structures * primitive types such as <i>int *ret_num</i>, enumerated types like <i>DF BBoolean *ret_enabled</i>, structures
* as in <i>DFBDisplayLayerConfig *ret_config</i>, just <i>void **ret_data< /i> or other types... * as in <i>DFBDisplayLayerConfig *ret_config</i>, just <i>void **ret_data< /i> or other types...
*/ */
typedef enum { typedef enum {
/* /*
skipping to change at line 180 skipping to change at line 193
DFB_ITEMNOTFOUND = DR_ITEMNOTFOUND, /* No such item found. */ DFB_ITEMNOTFOUND = DR_ITEMNOTFOUND, /* No such item found. */
DFB_VERSIONMISMATCH = DR_VERSIONMISMATCH, /* Some versions didn't m atch. */ DFB_VERSIONMISMATCH = DR_VERSIONMISMATCH, /* Some versions didn't m atch. */
DFB_EOF = DR_EOF, /* Reached end of file. * / DFB_EOF = DR_EOF, /* Reached end of file. * /
DFB_SUSPENDED = DR_SUSPENDED, /* The requested object i s suspended. */ DFB_SUSPENDED = DR_SUSPENDED, /* The requested object i s suspended. */
DFB_INCOMPLETE = DR_INCOMPLETE, /* The operation has been executed, but not completely. */ DFB_INCOMPLETE = DR_INCOMPLETE, /* The operation has been executed, but not completely. */
DFB_NOCORE = DR_NOCORE, /* Core part not availabl e. */ DFB_NOCORE = DR_NOCORE, /* Core part not availabl e. */
/* /*
* DirectFB specific result codes starting at (after) this offset * DirectFB specific result codes starting at (after) this offset
*/ */
DFB__RESULT_OFFSET = D_RESULT_TYPE_BASE( 'D','F','B' ), DFB__RESULT_BASE = D_RESULT_TYPE_CODE_BASE( 'D','F','B','1' ),
DFB_NOVIDEOMEMORY, /* There's not enough video memory. */ DFB_NOVIDEOMEMORY, /* There's not enough video memory. */
DFB_MISSINGFONT, /* No font has been set. */ DFB_MISSINGFONT, /* No font has been set. */
DFB_MISSINGIMAGE, /* No image has been set. */ DFB_MISSINGIMAGE, /* No image has been set. */
DFB_NOALLOCATION, /* No allocation. */
DFB__RESULT_END
} DFBResult; } DFBResult;
/* /*
* A boolean. * A boolean.
*/ */
typedef enum { typedef enum {
DFB_FALSE = 0, DFB_FALSE = 0,
DFB_TRUE = !DFB_FALSE DFB_TRUE = !DFB_FALSE
} DFBBoolean; } DFBBoolean;
skipping to change at line 221 skipping to change at line 235
/* /*
* A dimension specified by width and height. * A dimension specified by width and height.
*/ */
typedef struct { typedef struct {
int w; /* width of it */ int w; /* width of it */
int h; /* height of it */ int h; /* height of it */
} DFBDimension; } DFBDimension;
/* /*
* A rectangle specified by two points.
*
* The defined rectangle includes the top left but not the bottom right end
point.
*/
typedef struct {
int x1; /* X coordinate of top-left point (inclusive) */
int y1; /* Y coordinate of top-left point (inclusive) */
int x2; /* X coordinate of lower-right point (exclusive) *
/
int y2; /* Y coordinate of lower-right point (exclusive) *
/
} DFBBox;
/*
* A rectangle specified by a point and a dimension. * A rectangle specified by a point and a dimension.
*/ */
typedef struct { typedef struct {
int x; /* X coordinate of its top-left point */ int x; /* X coordinate of its top-left point */
int y; /* Y coordinate of its top-left point */ int y; /* Y coordinate of its top-left point */
int w; /* width of it */ int w; /* width of it */
int h; /* height of it */ int h; /* height of it */
} DFBRectangle; } DFBRectangle;
/* /*
skipping to change at line 370 skipping to change at line 396
*/ */
#define DFB_COLORKEY_EQUAL(x,y) ((x).index == (y).index && \ #define DFB_COLORKEY_EQUAL(x,y) ((x).index == (y).index && \
(x).r == (y).r && \ (x).r == (y).r && \
(x).g == (y).g && \ (x).g == (y).g && \
(x).b == (y).b) (x).b == (y).b)
/* /*
* Print a description of the result code along with an * Print a description of the result code along with an
* optional message that is put in front with a colon. * optional message that is put in front with a colon.
*/ */
DFBResult DirectFBError( DFBResult DIRECTFB_API DirectFBError(
const char *msg, /* optional message */ const char *msg, /* optional
DFBResult result /* result code to interpr message */
et */ DFBResult result /* result co
); de to interpret */
);
/* /*
* Behaves like DirectFBError, but shuts down the calling application. * Behaves like DirectFBError, but shuts down the calling application.
*/ */
DFBResult DirectFBErrorFatal( DFBResult DIRECTFB_API DirectFBErrorFatal(
const char *msg, /* optional message */ const char *msg, /* opti
DFBResult result /* result code to interpr onal message */
et */ DFBResult result /* resu
); lt code to interpret */
);
/* /*
* Returns a string describing 'result'. * Returns a string describing 'result'.
*/ */
const char *DirectFBErrorString( const char DIRECTFB_API *DirectFBErrorString(
DFBResult result DFBResult result
); );
/* /*
* Retrieves information about supported command-line flags in the * Retrieves information about supported command-line flags in the
* form of a user-readable string formatted suitable to be printed * form of a user-readable string formatted suitable to be printed
* as usage information. * as usage information.
*/ */
const char *DirectFBUsageString( void ); const char *DirectFBUsageString( void );
/* /*
* Parses the command-line and initializes some variables. You * Parses the command-line and initializes some variables. You
* absolutely need to call this before doing anything else. * absolutely need to call this before doing anything else.
* Removes all options used by DirectFB from argv. * Removes all options used by DirectFB from argv.
*/ */
DFBResult DirectFBInit( DFBResult DIRECTFB_API DirectFBInit(
int *argc, /* pointer to main()'s argc int *argc, /* pointer t
*/ o main()'s argc */
char *(*argv[]) /* pointer to main()'s argv char *(*argv[]) /* pointer t
*/ o main()'s argv */
); );
/* /*
* Sets configuration parameters supported on command line and in * Sets configuration parameters supported on command line and in
* config file. Can only be called before DirectFBCreate but after * config file. Can only be called before DirectFBCreate but after
* DirectFBInit. * DirectFBInit.
*/ */
DFBResult DirectFBSetOption( DFBResult DIRECTFB_API DirectFBSetOption(
const char *name, const char *name,
const char *value const char *value
); );
/* /*
* Creates the super interface. * Creates the super interface.
*/ */
DFBResult DirectFBCreate( DFBResult DIRECTFB_API DirectFBCreate(
IDirectFB **interface /* pointer to the IDirectFB **interface_ptr /* po
created interface */ inter to the created interface */
); );
typedef unsigned int DFBScreenID; typedef unsigned int DFBScreenID;
typedef unsigned int DFBDisplayLayerID; typedef unsigned int DFBDisplayLayerID;
typedef unsigned int DFBDisplayLayerSourceID; typedef unsigned int DFBDisplayLayerSourceID;
typedef unsigned int DFBSurfaceID; typedef unsigned int DFBSurfaceID;
typedef unsigned int DFBWindowID; typedef unsigned int DFBWindowID;
typedef unsigned int DFBInputDeviceID; typedef unsigned int DFBInputDeviceID;
typedef unsigned int DFBTextEncodingID; typedef unsigned int DFBTextEncodingID;
typedef u32 DFBDisplayLayerIDs; typedef u32 DFBDisplayLayerIDs;
skipping to change at line 558 skipping to change at line 583
DLCAPS_SCREEN_POSITION = 0x00100000, /* The layer position on the s creen can be changed. DLCAPS_SCREEN_POSITION = 0x00100000, /* The layer position on the s creen can be changed.
Supports IDirectFBDisplayLa yer::SetScreenPosition(). */ Supports IDirectFBDisplayLa yer::SetScreenPosition(). */
DLCAPS_SCREEN_SIZE = 0x00200000, /* The layer size (defined by its source rectangle) DLCAPS_SCREEN_SIZE = 0x00200000, /* The layer size (defined by its source rectangle)
can be scaled to a differen t size on the screen can be scaled to a differen t size on the screen
(defined by its screen/dest ination rectangle or (defined by its screen/dest ination rectangle or
its normalized size) and do es not have to be 1:1 its normalized size) and do es not have to be 1:1
with it. */ with it. */
DLCAPS_CLIP_REGIONS = 0x00400000, /* Supports IDirectFBDisplayLa yer::SetClipRegions(). */ DLCAPS_CLIP_REGIONS = 0x00400000, /* Supports IDirectFBDisplayLa yer::SetClipRegions(). */
DLCAPS_ALL = 0x0073FFFF DLCAPS_LR_MONO = 0x01000000, /* Supports L/R mono stereosco
pic display. */
DLCAPS_STEREO = 0x02000000, /* Supports independent L/R st
ereoscopic display. */
DLCAPS_ALL = 0x0373FFFF
} DFBDisplayLayerCapabilities; } DFBDisplayLayerCapabilities;
/* /*
* Capabilities of a screen. * Capabilities of a screen.
*/ */
typedef enum { typedef enum {
DSCCAPS_NONE = 0x00000000, DSCCAPS_NONE = 0x00000000,
DSCCAPS_VSYNC = 0x00000001, /* Synchronization with the DSCCAPS_VSYNC = 0x00000001, /* Synchronization with the
vertical retrace supported. */ vertical retrace supported. */
skipping to change at line 593 skipping to change at line 621
DLOP_ALPHACHANNEL = 0x00000001, /* Make usage of alpha channel DLOP_ALPHACHANNEL = 0x00000001, /* Make usage of alpha channel
for blending on a pixel per for blending on a pixel per
pixel basis. */ pixel basis. */
DLOP_FLICKER_FILTERING = 0x00000002, /* Enable flicker filtering. * / DLOP_FLICKER_FILTERING = 0x00000002, /* Enable flicker filtering. * /
DLOP_DEINTERLACING = 0x00000004, /* Enable deinterlacing of an DLOP_DEINTERLACING = 0x00000004, /* Enable deinterlacing of an
interlaced (video) source. */ interlaced (video) source. */
DLOP_SRC_COLORKEY = 0x00000008, /* Enable source color key. */ DLOP_SRC_COLORKEY = 0x00000008, /* Enable source color key. */
DLOP_DST_COLORKEY = 0x00000010, /* Enable dest. color key. */ DLOP_DST_COLORKEY = 0x00000010, /* Enable dest. color key. */
DLOP_OPACITY = 0x00000020, /* Make usage of the global al pha DLOP_OPACITY = 0x00000020, /* Make usage of the global al pha
factor set by SetOpacity. * / factor set by SetOpacity. * /
DLOP_FIELD_PARITY = 0x00000040 /* Set field parity */ DLOP_FIELD_PARITY = 0x00000040, /* Set field parity */
DLOP_LR_MONO = 0x00000100, /* Layer has a single set of
surface buffers and a stereo depth. The number
of buffers in each set is d
eteremined by DSCAPS_DOUBLE, DSCAPS_TRIPLE, etc
as usual. If they exist, th
e windows on this layer must not be stereo or
L/R mono, otherwise window
information will be lost when they are composited
to the layer. The layer con
tents (composited windows if they exist) will
be shifted horizontally lef
t and right by the stereo depth value when
the layer is composited on
the display screen. */
DLOP_STEREO = 0x00000200, /* Layer has 2 independent s
ets of surface buffers (left eye & right eye
buffers), each with unique
content. The number of buffers in each set is
deteremined by DSCAPS_DOUBL
E, DSCAPS_TRIPLE, etc as usual. This option
is required if any of the w
indows on this layer have DWCAPS_STEREO or
DWCAPS_LR_MONO set, otherwi
se the stereo or L/R depth content of the
windows cannot be preserved
when compositing to the layer. */
DLOP_ALL = 0x000003FF
} DFBDisplayLayerOptions; } DFBDisplayLayerOptions;
/* /*
* Layer Buffer Mode. * Layer Buffer Mode.
*/ */
typedef enum { typedef enum {
DLBM_UNKNOWN = 0x00000000, DLBM_UNKNOWN = 0x00000000,
DLBM_FRONTONLY = 0x00000001, /* no backbuffer */ DLBM_FRONTONLY = 0x00000001, /* no backbuffer */
DLBM_BACKVIDEO = 0x00000002, /* backbuffer in video memory */ DLBM_BACKVIDEO = 0x00000002, /* backbuffer in video memory */
skipping to change at line 630 skipping to change at line 673
DSDESC_PREALLOCATED = 0x00000010, /* Surface uses data that has been DSDESC_PREALLOCATED = 0x00000010, /* Surface uses data that has been
preallocated by the application. preallocated by the application.
The field array 'preallocated' The field array 'preallocated'
has to be set using the first has to be set using the first
element for the front buffer element for the front buffer
and eventually the second one and eventually the second one
for the back buffer. */ for the back buffer. */
DSDESC_PALETTE = 0x00000020, /* Initialize the surfaces palette DSDESC_PALETTE = 0x00000020, /* Initialize the surfaces palette
with the entries specified in th e with the entries specified in th e
description. */ description. */
DSDESC_COLORSPACE = 0x00000040, /* colorspace field is valid */
DSDESC_RESOURCE_ID = 0x00000100, /* user defined resource id for gen eral purpose DSDESC_RESOURCE_ID = 0x00000100, /* user defined resource id for gen eral purpose
surfaces is specified, or resour ce id of window, surfaces is specified, or resour ce id of window,
layer, user is returned */ layer, user is returned */
DSDESC_HINTS = 0x00000200, /* Flags for optimized allocation a nd pixel format selection are set. DSDESC_HINTS = 0x00000200, /* Flags for optimized allocation a nd pixel format selection are set.
See also DFBSurfaceHintFlags. */ See also DFBSurfaceHintFlags. */
DSDESC_ALL = 0x0000033F /* all of these */ DSDESC_ALL = 0x0000037F /* all of these */
} DFBSurfaceDescriptionFlags; } DFBSurfaceDescriptionFlags;
/* /*
* Flags defining which fields of a DFBPaletteDescription are valid. * Flags defining which fields of a DFBPaletteDescription are valid.
*/ */
typedef enum { typedef enum {
DPDESC_CAPS = 0x00000001, /* Specify palette capabilities. */ DPDESC_CAPS = 0x00000001, /* Specify palette capabilities. */
DPDESC_SIZE = 0x00000002, /* Specify number of entries. */ DPDESC_SIZE = 0x00000002, /* Specify number of entries. */
DPDESC_ENTRIES = 0x00000004 /* Initialize the palette with the DPDESC_ENTRIES = 0x00000004 /* Initialize the palette with the
entries specified in the entries specified in the
skipping to change at line 686 skipping to change at line 730
a surface can be resized (small er and bigger up to the a surface can be resized (small er and bigger up to the
initial size) without reallocat ion of the buffers. It's initial size) without reallocat ion of the buffers. It's
useful for surfaces that need a guaranteed space in useful for surfaces that need a guaranteed space in
video memory after resizing. */ video memory after resizing. */
DSCAPS_TRIPLE = 0x00000200, /* Surface is triple buffered. */ DSCAPS_TRIPLE = 0x00000200, /* Surface is triple buffered. */
DSCAPS_PREMULTIPLIED = 0x00001000, /* Surface stores data with premul tiplied alpha. */ DSCAPS_PREMULTIPLIED = 0x00001000, /* Surface stores data with premul tiplied alpha. */
DSCAPS_DEPTH = 0x00010000, /* A depth buffer is allocated. */ DSCAPS_DEPTH = 0x00010000, /* A depth buffer is allocated. */
DSCAPS_STEREO = 0x00020000, /* Both left & right buffers are a
llocated. Only valid with windows and
layers with the DLOP_STEREO or
DWCAPS_STEREO flags set. */
DSCAPS_SHARED = 0x00100000, /* The surface will be accessible among processes. */ DSCAPS_SHARED = 0x00100000, /* The surface will be accessible among processes. */
DSCAPS_ROTATED = 0x01000000, /* The back buffers are allocated with swapped width/height (unimplemented!). */ DSCAPS_ROTATED = 0x01000000, /* The back buffers are allocated with swapped width/height (unimplemented!). */
DSCAPS_ALL = 0x011113F7, /* All of these. */ DSCAPS_ALL = 0x011113F7, /* All of these. */
DSCAPS_FLIPPING = DSCAPS_DOUBLE | DSCAPS_TRIPLE /* Surface needs Flip() calls to make DSCAPS_FLIPPING = DSCAPS_DOUBLE | DSCAPS_TRIPLE /* Surface needs Flip() calls to make
updates/change s visible/usable. */ updates/change s visible/usable. */
} DFBSurfaceCapabilities; } DFBSurfaceCapabilities;
skipping to change at line 758 skipping to change at line 805
DSBLIT_ROTATE180 = 0x00001000, /* rotate the image by 180 deg ree */ DSBLIT_ROTATE180 = 0x00001000, /* rotate the image by 180 deg ree */
DSBLIT_ROTATE270 = 0x00004000, /* rotate the image by 270 deg ree */ DSBLIT_ROTATE270 = 0x00004000, /* rotate the image by 270 deg ree */
DSBLIT_COLORKEY_PROTECT = 0x00010000, /* make sure written pixels do n't match color key (internal only ATM) */ DSBLIT_COLORKEY_PROTECT = 0x00010000, /* make sure written pixels do n't match color key (internal only ATM) */
DSBLIT_SRC_MASK_ALPHA = 0x00100000, /* modulate source alpha chann el with alpha channel from source mask, DSBLIT_SRC_MASK_ALPHA = 0x00100000, /* modulate source alpha chann el with alpha channel from source mask,
see also IDirectFBSurface:: SetSourceMask() */ see also IDirectFBSurface:: SetSourceMask() */
DSBLIT_SRC_MASK_COLOR = 0x00200000, /* modulate source color chann els with color channels from source mask, DSBLIT_SRC_MASK_COLOR = 0x00200000, /* modulate source color chann els with color channels from source mask,
see also IDirectFBSurface:: SetSourceMask() */ see also IDirectFBSurface:: SetSourceMask() */
DSBLIT_SOURCE2 = 0x00400000, /* use secondary source instea d of destination for reading */ DSBLIT_SOURCE2 = 0x00400000, /* use secondary source instea d of destination for reading */
DSBLIT_FLIP_HORIZONTAL = 0x01000000, /* flip the image horizontally */ DSBLIT_FLIP_HORIZONTAL = 0x01000000, /* flip the image horizontally */
DSBLIT_FLIP_VERTICAL = 0x02000000, /* flip the image vertically * / DSBLIT_FLIP_VERTICAL = 0x02000000, /* flip the image vertically * /
DSBLIT_ROP = 0x04000000, /* use rop setting */
} DFBSurfaceBlittingFlags; } DFBSurfaceBlittingFlags;
/* /*
* Options for drawing and blitting operations. Not mandatory for accelerat ion. * Options for drawing and blitting operations. Not mandatory for accelerat ion.
*/ */
typedef enum { typedef enum {
DSRO_NONE = 0x00000000, /* None of these. */ DSRO_NONE = 0x00000000, /* None of these. */
DSRO_SMOOTH_UPSCALE = 0x00000001, /* Use interpolation for upsca le StretchBlit(). */ DSRO_SMOOTH_UPSCALE = 0x00000001, /* Use interpolation for upsca le StretchBlit(). */
DSRO_SMOOTH_DOWNSCALE = 0x00000002, /* Use interpolation for downs cale StretchBlit(). */ DSRO_SMOOTH_DOWNSCALE = 0x00000002, /* Use interpolation for downs cale StretchBlit(). */
DSRO_MATRIX = 0x00000004, /* Use the transformation matr ix set via IDirectFBSurface::SetMatrix(). */ DSRO_MATRIX = 0x00000004, /* Use the transformation matr ix set via IDirectFBSurface::SetMatrix(). */
DSRO_ANTIALIAS = 0x00000008, /* Enable anti-aliasing for ed ges (alphablend must be enabled). */ DSRO_ANTIALIAS = 0x00000008, /* Enable anti-aliasing for ed ges (alphablend must be enabled). */
DSRO_ALL = 0x0000000F /* All of these. */ DSRO_WRITE_MASK_BITS = 0x00000010, /* Enable usage of write mask
bits setting. */
DSRO_ALL = 0x0000001F /* All of these. */
} DFBSurfaceRenderOptions; } DFBSurfaceRenderOptions;
/* /*
* Mask of accelerated functions. * Mask of accelerated functions.
*/ */
typedef enum { typedef enum {
DFXL_NONE = 0x00000000, /* None of these. */ DFXL_NONE = 0x00000000, /* None of these. */
DFXL_FILLRECTANGLE = 0x00000001, /* FillRectangle() is accelerated. */ DFXL_FILLRECTANGLE = 0x00000001, /* FillRectangle() is accelerated. */
DFXL_DRAWRECTANGLE = 0x00000002, /* DrawRectangle() is accelerated. */ DFXL_DRAWRECTANGLE = 0x00000002, /* DrawRectangle() is accelerated. */
DFXL_DRAWLINE = 0x00000004, /* DrawLine() is accelerated. */ DFXL_DRAWLINE = 0x00000004, /* DrawLine() is accelerated. */
DFXL_FILLTRIANGLE = 0x00000008, /* FillTriangle() is accelerated. * / DFXL_FILLTRIANGLE = 0x00000008, /* FillTriangle() is accelerated. * /
DFXL_FILLTRAPEZOID = 0x00000010, /* FillTrapezoid() is accelerated. */ DFXL_FILLTRAPEZOID = 0x00000010, /* FillTrapezoid() is accelerated. */
DFXL_FILLQUADRANGLE = 0x00000020, /* FillQuadrangle() is accelerated. */
DFXL_BLIT = 0x00010000, /* Blit() and TileBlit() are accele rated. */ DFXL_BLIT = 0x00010000, /* Blit() and TileBlit() are accele rated. */
DFXL_STRETCHBLIT = 0x00020000, /* StretchBlit() is accelerated. */ DFXL_STRETCHBLIT = 0x00020000, /* StretchBlit() is accelerated. */
DFXL_TEXTRIANGLES = 0x00040000, /* TextureTriangles() is accelerate d. */ DFXL_TEXTRIANGLES = 0x00040000, /* TextureTriangles() is accelerate d. */
DFXL_BLIT2 = 0x00080000, /* BatchBlit2() is accelerated. */ DFXL_BLIT2 = 0x00080000, /* BatchBlit2() is accelerated. */
DFXL_DRAWSTRING = 0x01000000, /* DrawString() and DrawGlyph() are accelerated. */ DFXL_DRAWSTRING = 0x01000000, /* DrawString() and DrawGlyph() are accelerated. */
DFXL_ALL = 0x010F001F, /* All drawing/blitting functions. DFXL_ALL = 0x010F003F, /* All drawing/blitting functions.
*/ */
DFXL_ALL_DRAW = 0x0000001F, /* All drawing functions. */ DFXL_ALL_DRAW = 0x0000003F, /* All drawing functions. */
DFXL_ALL_BLIT = 0x010F0000, /* All blitting functions. */ DFXL_ALL_BLIT = 0x010F0000, /* All blitting functions. */
} DFBAccelerationMask; } DFBAccelerationMask;
#define DFB_MASK_BYTE0 0x000000ff
#define DFB_MASK_BYTE1 0x0000ff00
#define DFB_MASK_BYTE2 0x00ff0000
#define DFB_MASK_BYTE3 0xff000000
/* /*
* @internal * @internal
*/ */
#define DFB_DRAWING_FUNCTION(a) ((a) & 0x0000FFFF) #define DFB_DRAWING_FUNCTION(a) ((a) & 0x0000FFFF)
/* /*
* @internal * @internal
*/ */
#define DFB_BLITTING_FUNCTION(a) ((a) & 0xFFFF0000) #define DFB_BLITTING_FUNCTION(a) ((a) & 0xFFFF0000)
skipping to change at line 898 skipping to change at line 954
DWDESC_POSX = 0x00000010, /* posx field is valid */ DWDESC_POSX = 0x00000010, /* posx field is valid */
DWDESC_POSY = 0x00000020, /* posy field is valid */ DWDESC_POSY = 0x00000020, /* posy field is valid */
DWDESC_SURFACE_CAPS = 0x00000040, /* Create the window surface with DWDESC_SURFACE_CAPS = 0x00000040, /* Create the window surface with
special capabilities. */ special capabilities. */
DWDESC_PARENT = 0x00000080, /* This window has a parent accordi ng to parent_id field. */ DWDESC_PARENT = 0x00000080, /* This window has a parent accordi ng to parent_id field. */
DWDESC_OPTIONS = 0x00000100, /* Initial window options have been set. */ DWDESC_OPTIONS = 0x00000100, /* Initial window options have been set. */
DWDESC_STACKING = 0x00000200, /* Initial stacking class has been set. */ DWDESC_STACKING = 0x00000200, /* Initial stacking class has been set. */
DWDESC_TOPLEVEL_ID = 0x00000400, /* The top level window is set in t oplevel_id field. */ DWDESC_TOPLEVEL_ID = 0x00000400, /* The top level window is set in t oplevel_id field. */
DWDESC_COLORSPACE = 0x00000800, /* colorspace field is valid */
DWDESC_RESOURCE_ID = 0x00001000, /* Resource id for window surface c reation has been set. */ DWDESC_RESOURCE_ID = 0x00001000, /* Resource id for window surface c reation has been set. */
} DFBWindowDescriptionFlags; } DFBWindowDescriptionFlags;
/* /*
* Flags defining which fields of a DFBDataBufferDescription are valid. * Flags defining which fields of a DFBDataBufferDescription are valid.
*/ */
typedef enum { typedef enum {
DBDESC_FILE = 0x00000001, /* Create a static buffer for the DBDESC_FILE = 0x00000001, /* Create a static buffer for the
specified filename. */ specified filename. */
DBDESC_MEMORY = 0x00000002 /* Create a static buffer for the DBDESC_MEMORY = 0x00000002 /* Create a static buffer for the
skipping to change at line 942 skipping to change at line 1000
DWCAPS_SUBWINDOW = 0x00000010, /* Not a top level window. */ DWCAPS_SUBWINDOW = 0x00000010, /* Not a top level window. */
DWCAPS_COLOR = 0x00000020, /* The window has no buffer; DWCAPS_COLOR = 0x00000020, /* The window has no buffer;
it consumes no backing store. it consumes no backing store.
It is filled with a constant col or It is filled with a constant col or
and it receives events. The colo r is and it receives events. The colo r is
never specified premultiplied. * / never specified premultiplied. * /
DWCAPS_NOFOCUS = 0x00000100, /* Window will never get focus or r eceive key events, unless it grabs them. */ DWCAPS_NOFOCUS = 0x00000100, /* Window will never get focus or r eceive key events, unless it grabs them. */
DWCAPS_ALL = 0x0000013F /* All of these. */ DWCAPS_LR_MONO = 0x00001000, /* Window has a single set of surfac
e buffers and a stereo depth. The number
of buffers in each set is detere
mined by DSCAPS_DOUBLE, DSCAPS_TRIPLE, etc
as usual. Selecting this option
requires the underlying layer to have
DLOP_STEREO set, otherwise the s
tereo depth for the left and right eye
cannot be preserved when composi
ting to the underlying layer. The buffer is
composited to both the left and
right eye buffers of the layer with an x-axis
right and left shift of depth pi
xels, respectively. */
DWCAPS_STEREO = 0x00002000, /* Window has 2 independent sets of
surface buffers (left eye & right eye
buffers), each with unique conte
nt. The number of buffers in each set is
deteremined by DSCAPS_DOUBLE, DS
CAPS_TRIPLE, etc as usual. Selecting this
option requires the underlying l
ayer to have DLOP_STEREO set, otherwise
the independent content of the l
eft and right eye cannot be preserved when
compositing to the layer. */
DWCAPS_ALL = 0x0000313F /* All of these. */
} DFBWindowCapabilities; } DFBWindowCapabilities;
/* /*
* Flags controlling the appearance and behaviour of the window. * Flags controlling the appearance and behaviour of the window.
*/ */
typedef enum { typedef enum {
DWOP_NONE = 0x00000000, /* none of these */ DWOP_NONE = 0x00000000, /* none of these */
DWOP_COLORKEYING = 0x00000001, /* enable color key */ DWOP_COLORKEYING = 0x00000001, /* enable color key */
DWOP_ALPHACHANNEL = 0x00000002, /* enable alpha blending using the DWOP_ALPHACHANNEL = 0x00000002, /* enable alpha blending using the
window's alpha channel */ window's alpha channel */
skipping to change at line 1011 skipping to change at line 1083
/* /*
* Flags describing how to load a font. * Flags describing how to load a font.
* *
* These flags describe how a font is loaded and affect how the * These flags describe how a font is loaded and affect how the
* glyphs are drawn. There is no way to change this after the font * glyphs are drawn. There is no way to change this after the font
* has been loaded. If you need to render a font with different * has been loaded. If you need to render a font with different
* attributes, you have to create multiple FontProviders of the * attributes, you have to create multiple FontProviders of the
* same font file. * same font file.
*/ */
typedef enum { typedef enum {
DFFA_NONE = 0x00000000, /* none of these flags */ DFFA_NONE = 0x00000000, /* none of these flags */
DFFA_NOKERNING = 0x00000001, /* don't use kerning */ DFFA_NOKERNING = 0x00000001, /* don't use kerning */
DFFA_NOHINTING = 0x00000002, /* don't use hinting */ DFFA_NOHINTING = 0x00000002, /* don't use hinting */
DFFA_MONOCHROME = 0x00000004, /* don't use anti-aliasing */ DFFA_MONOCHROME = 0x00000004, /* don't use anti-aliasing */
DFFA_NOCHARMAP = 0x00000008, /* no char map, glyph indices are DFFA_NOCHARMAP = 0x00000008, /* no char map, glyph indices
specified directly */ are
DFFA_FIXEDCLIP = 0x00000010, /* width fixed advance, clip to it specified directly */
*/ DFFA_FIXEDCLIP = 0x00000010, /* width fixed advance, clip t
DFFA_NOBITMAP = 0x00000020, /* ignore bitmap strikes; for o it */
bitmap-only fonts this flag is DFFA_NOBITMAP = 0x00000020, /* ignore bitmap strikes; for
ignored */ bitmap-only fonts this flag
DFFA_OUTLINED = 0x00000040, is
DFFA_AUTOHINTING = 0x00000080, /* prefer auto-hinter over the font ignored */
's DFFA_OUTLINED = 0x00000040,
native hinter */ DFFA_AUTOHINTING = 0x00000080, /* prefer auto-hinter over the
DFFA_SOFTHINTING = 0x00000100 /* use a lighter hinting algorithm font's
that produces glyphs that are mo native hinter */
re DFFA_SOFTHINTING = 0x00000100, /* use a lighter hinting algor
fuzzy but better resemble the ithm
original shape */ that produces glyphs that a
re more
fuzzy but better resemble t
he
original shape */
DFFA_STYLE_ITALIC = 0x00000200, /* load italic style */
DFFA_VERTICAL_LAYOUT = 0x00000400, /* load vertical layout */
} DFBFontAttributes; } DFBFontAttributes;
/* /*
* Flags defining which fields of a DFBFontDescription are valid. * Flags defining which fields of a DFBFontDescription are valid.
*/ */
typedef enum { typedef enum {
DFDESC_ATTRIBUTES = 0x00000001, /* attributes field is valid * / DFDESC_ATTRIBUTES = 0x00000001, /* attributes field is valid * /
DFDESC_HEIGHT = 0x00000002, /* height is specified */ DFDESC_HEIGHT = 0x00000002, /* height is specified */
DFDESC_WIDTH = 0x00000004, /* width is specified */ DFDESC_WIDTH = 0x00000004, /* width is specified */
DFDESC_INDEX = 0x00000008, /* index is specified */ DFDESC_INDEX = 0x00000008, /* index is specified */
skipping to change at line 1243 skipping to change at line 1317
/* 24 bit VYU 4:4:4 (3 byte, Cr 8@16, Y 8@8, Cb 8@0) */ /* 24 bit VYU 4:4:4 (3 byte, Cr 8@16, Y 8@8, Cb 8@0) */
DSPF_VYU = DFB_SURFACE_PIXELFORMAT( 34, 24, 0, 0, 0, 3, 0, 0, 0, 0, 0 ), DSPF_VYU = DFB_SURFACE_PIXELFORMAT( 34, 24, 0, 0, 0, 3, 0, 0, 0, 0, 0 ),
/* 1 bit alpha (1 byte/ 8 pixel, LEAST significant bit used first) */ /* 1 bit alpha (1 byte/ 8 pixel, LEAST significant bit used first) */
DSPF_A1_LSB = DFB_SURFACE_PIXELFORMAT( 35, 0, 1, 1, 1, 0, 7, 0, 0, 0, 0 ), DSPF_A1_LSB = DFB_SURFACE_PIXELFORMAT( 35, 0, 1, 1, 1, 0, 7, 0, 0, 0, 0 ),
/* 16 bit YUV (8 bit Y plane followed by 8 bit 2x1 subsampled V/U pl anes) */ /* 16 bit YUV (8 bit Y plane followed by 8 bit 2x1 subsampled V/U pl anes) */
DSPF_YV16 = DFB_SURFACE_PIXELFORMAT( 36, 16, 0, 0, 0, 1, 0, 0, 1, 0, 0 ), DSPF_YV16 = DFB_SURFACE_PIXELFORMAT( 36, 16, 0, 0, 0, 1, 0, 0, 1, 0, 0 ),
/* 32 bit ABGR (4 byte, alpha 8@24, blue 8@16, green 8@8, red 8@0) */
DSPF_ABGR = DFB_SURFACE_PIXELFORMAT( 37, 24, 8, 1, 0, 4, 0, 0, 0,
0, 0 )
} DFBSurfacePixelFormat; } DFBSurfacePixelFormat;
/* Number of pixelformats defined */ /* Number of pixelformats defined */
#define DFB_NUM_PIXELFORMATS 37 #define DFB_NUM_PIXELFORMATS 38
/* These macros extract information about the pixel format. */ /* These macros extract information about the pixel format. */
#define DFB_PIXELFORMAT_INDEX(fmt) (((fmt) & 0x0000007F) ) #define DFB_PIXELFORMAT_INDEX(fmt) (((fmt) & 0x0000007F) )
#define DFB_COLOR_BITS_PER_PIXEL(fmt) (((fmt) & 0x00000F80) >> 7) #define DFB_COLOR_BITS_PER_PIXEL(fmt) (((fmt) & 0x00000F80) >> 7)
#define DFB_ALPHA_BITS_PER_PIXEL(fmt) (((fmt) & 0x0000F000) >> 12) #define DFB_ALPHA_BITS_PER_PIXEL(fmt) (((fmt) & 0x0000F000) >> 12)
#define DFB_PIXELFORMAT_HAS_ALPHA(fmt) (((fmt) & 0x00010000) != 0) #define DFB_PIXELFORMAT_HAS_ALPHA(fmt) (((fmt) & 0x00010000) != 0)
skipping to change at line 1273 skipping to change at line 1350
#define DFB_PIXELFORMAT_ALIGNMENT(fmt) (((fmt) & 0x03800000) >> 23) #define DFB_PIXELFORMAT_ALIGNMENT(fmt) (((fmt) & 0x03800000) >> 23)
#define DFB_PLANE_MULTIPLY(fmt,height) ((((((fmt) & 0x3C000000) >> 26) + 4 ) * (height)) >> 2) #define DFB_PLANE_MULTIPLY(fmt,height) ((((((fmt) & 0x3C000000) >> 26) + 4 ) * (height)) >> 2)
#define DFB_PIXELFORMAT_IS_INDEXED(fmt) (((fmt) & 0x40000000) != 0) #define DFB_PIXELFORMAT_IS_INDEXED(fmt) (((fmt) & 0x40000000) != 0)
#define DFB_PLANAR_PIXELFORMAT(fmt) (((fmt) & 0x3C000000) != 0) #define DFB_PLANAR_PIXELFORMAT(fmt) (((fmt) & 0x3C000000) != 0)
#define DFB_PIXELFORMAT_INV_ALPHA(fmt) (((fmt) & 0x80000000) != 0) #define DFB_PIXELFORMAT_INV_ALPHA(fmt) (((fmt) & 0x80000000) != 0)
#define DFB_COLOR_IS_RGB(fmt) \
(((fmt) == DSPF_ARGB1555) || \
((fmt) == DSPF_RGB16) || \
((fmt) == DSPF_RGB24) || \
((fmt) == DSPF_RGB32) || \
((fmt) == DSPF_ARGB) || \
((fmt) == DSPF_RGB332) || \
((fmt) == DSPF_AiRGB) || \
((fmt) == DSPF_ARGB2554) || \
((fmt) == DSPF_ARGB4444) || \
((fmt) == DSPF_RGBA4444) || \
((fmt) == DSPF_ARGB1666) || \
((fmt) == DSPF_ARGB6666) || \
((fmt) == DSPF_RGB18) || \
((fmt) == DSPF_RGB444) || \
((fmt) == DSPF_RGB555) || \
((fmt) == DSPF_BGR555))
#define DFB_COLOR_IS_YUV(fmt) \
(((fmt) == DSPF_YUY2) || \
((fmt) == DSPF_UYVY) || \
((fmt) == DSPF_I420) || \
((fmt) == DSPF_YV12) || \
((fmt) == DSPF_NV12) || \
((fmt) == DSPF_NV16) || \
((fmt) == DSPF_NV21) || \
((fmt) == DSPF_AYUV))
/*
* Color space used by the colors in the surface.
*/
typedef enum {
DSCS_UNKNOWN = 0,
DSCS_RGB = 1, /* standard RGB */
DSCS_BT601 = 2, /* ITU BT.601 */
DSCS_BT601_FULLRANGE = 3, /* ITU BT.601 Full Range
*/
DSCS_BT709 = 4 /* ITU BT.709 */
} DFBSurfaceColorSpace;
#define DFB_NUM_COLORSPACES 5
#define DFB_COLORSPACE_IS_COMPATIBLE(cs, fmt)
\
((DFB_COLOR_IS_RGB((fmt)) && ((cs) == DSCS_RGB)) ||
\
(DFB_COLOR_IS_YUV((fmt)) && (((cs) == DSCS_BT601) ||
\
((cs) == DSCS_BT601_FULLRANGE) ||
\
((cs) == DSCS_BT709))))
#define DFB_COLORSPACE_DEFAULT(fmt) \
(DFB_COLOR_IS_RGB((fmt)) ? DSCS_RGB : DFB_COLOR_IS_YUV((fmt)) ? DSCS_B
T601 : DSCS_UNKNOWN)
/* /*
* Hint flags for optimized allocation, format selection etc. * Hint flags for optimized allocation, format selection etc.
*/ */
typedef enum { typedef enum {
DSHF_NONE = 0x00000000, DSHF_NONE = 0x00000000,
DSHF_LAYER = 0x00000001, /* Surface optimized for display layer usage */ DSHF_LAYER = 0x00000001, /* Surface optimized for display layer usage */
DSHF_WINDOW = 0x00000002, /* Surface optimized for being a window buffer */ DSHF_WINDOW = 0x00000002, /* Surface optimized for being a window buffer */
DSHF_CURSOR = 0x00000004, /* Surface optimized for usage as a cursor shape */ DSHF_CURSOR = 0x00000004, /* Surface optimized for usage as a cursor shape */
DSHF_FONT = 0x00000008, /* Surface optimized for text rendering */ DSHF_FONT = 0x00000008, /* Surface optimized for text rendering */
skipping to change at line 1312 skipping to change at line 1439
struct { struct {
const DFBColor *entries; const DFBColor *entries;
unsigned int size; unsigned int size;
} palette; /* initial palette */ } palette; /* initial palette */
unsigned long resource_id; /* universal resourc e id, either user specified for general unsigned long resource_id; /* universal resourc e id, either user specified for general
purpose surfaces or id of layer or window */ purpose surfaces or id of layer or window */
DFBSurfaceHintFlags hints; /* usage hints for opt imized allocation, format selection etc. */ DFBSurfaceHintFlags hints; /* usage hints for opt imized allocation, format selection etc. */
DFBSurfaceColorSpace colorspace; /* color space */
} DFBSurfaceDescription; } DFBSurfaceDescription;
/* /*
* Description of the palette that is to be created. * Description of the palette that is to be created.
*/ */
typedef struct { typedef struct {
DFBPaletteDescriptionFlags flags; /* Validation of field s. */ DFBPaletteDescriptionFlags flags; /* Validation of field s. */
DFBPaletteCapabilities caps; /* Palette capabilitie s. */ DFBPaletteCapabilities caps; /* Palette capabilitie s. */
unsigned int size; /* Number of entries. */ unsigned int size; /* Number of entries. */
skipping to change at line 1494 skipping to change at line 1623
int posx; /* distance from left layer border */ int posx; /* distance from left layer border */
int posy; /* distance from uppe r layer border */ int posy; /* distance from uppe r layer border */
DFBSurfaceCapabilities surface_caps; /* surface capabiliti es */ DFBSurfaceCapabilities surface_caps; /* surface capabiliti es */
DFBWindowID parent_id; /* window id of paren t window */ DFBWindowID parent_id; /* window id of paren t window */
DFBWindowOptions options; /* initial window opt ions */ DFBWindowOptions options; /* initial window opt ions */
DFBWindowStackingClass stacking; /* initial stacking c lass */ DFBWindowStackingClass stacking; /* initial stacking c lass */
unsigned long resource_id; /* resource id used t o create the window surface */ unsigned long resource_id; /* resource id used t o create the window surface */
DFBWindowID toplevel_id; /* top level window, if != 0 window will be a sub window */ DFBWindowID toplevel_id; /* top level window, if != 0 window will be a sub window */
DFBSurfaceColorSpace colorspace; /* color space */
} DFBWindowDescription; } DFBWindowDescription;
/* /*
* Description of a data buffer that is to be created. * Description of a data buffer that is to be created.
*/ */
typedef struct { typedef struct {
DFBDataBufferDescriptionFlags flags; /* field validation */ DFBDataBufferDescriptionFlags flags; /* field validation */
const char *file; /* for file based data buffers */ const char *file; /* for file based data buffers */
skipping to change at line 1710 skipping to change at line 1841
* automatically attach input devices matching the specified * automatically attach input devices matching the specified
* capabilities. If DICAPS_NONE is passed an event buffer with * capabilities. If DICAPS_NONE is passed an event buffer with
* nothing attached to is created. An event buffer can be * nothing attached to is created. An event buffer can be
* attached to input devices and windows. * attached to input devices and windows.
* *
* <b>Fonts, images and videos</b> are created by this * <b>Fonts, images and videos</b> are created by this
* interface. There are different implementations for different * interface. There are different implementations for different
* content types. On creation a suitable implementation is * content types. On creation a suitable implementation is
* automatically chosen. * automatically chosen.
*/ */
DEFINE_INTERFACE( IDirectFB, D_DEFINE_INTERFACE( IDirectFB,
/** Cooperative level, video mode **/ /** Cooperative level, video mode **/
/* /*
* Puts the interface into the specified cooperative level. * Puts the interface into the specified cooperative level.
* *
* Function fails with DFB_LOCKED if another instance already * Function fails with DFB_LOCKED if another instance already
* is in a cooperative level other than DFSCL_NORMAL. * is in a cooperative level other than DFSCL_NORMAL.
*/ */
DFBResult (*SetCooperativeLevel) ( DFBResult (*SetCooperativeLevel) (
skipping to change at line 2101 skipping to change at line 2232
typedef enum { typedef enum {
DLCONF_NONE = 0x00000000, DLCONF_NONE = 0x00000000,
DLCONF_WIDTH = 0x00000001, DLCONF_WIDTH = 0x00000001,
DLCONF_HEIGHT = 0x00000002, DLCONF_HEIGHT = 0x00000002,
DLCONF_PIXELFORMAT = 0x00000004, DLCONF_PIXELFORMAT = 0x00000004,
DLCONF_BUFFERMODE = 0x00000008, DLCONF_BUFFERMODE = 0x00000008,
DLCONF_OPTIONS = 0x00000010, DLCONF_OPTIONS = 0x00000010,
DLCONF_SOURCE = 0x00000020, DLCONF_SOURCE = 0x00000020,
DLCONF_SURFACE_CAPS = 0x00000040, DLCONF_SURFACE_CAPS = 0x00000040,
DLCONF_COLORSPACE = 0x00000080,
DLCONF_ALL = 0x0000007F DLCONF_ALL = 0x000000FF
} DFBDisplayLayerConfigFlags; } DFBDisplayLayerConfigFlags;
/* /*
* Layer configuration * Layer configuration
*/ */
typedef struct { typedef struct {
DFBDisplayLayerConfigFlags flags; /* Which fields of the co nfiguration are set */ DFBDisplayLayerConfigFlags flags; /* Which fields of the co nfiguration are set */
int width; /* Pixel width */ int width; /* Pixel width */
int height; /* Pixel height */ int height; /* Pixel height */
DFBSurfacePixelFormat pixelformat; /* Pixel format */ DFBSurfacePixelFormat pixelformat; /* Pixel format */
DFBSurfaceColorSpace colorspace; /* Color space */
DFBDisplayLayerBufferMode buffermode; /* Buffer mode */ DFBDisplayLayerBufferMode buffermode; /* Buffer mode */
DFBDisplayLayerOptions options; /* Enable capabilities */ DFBDisplayLayerOptions options; /* Enable capabilities */
DFBDisplayLayerSourceID source; /* Selected layer source */ DFBDisplayLayerSourceID source; /* Selected layer source */
DFBSurfaceCapabilities surface_caps; /* Choose surface capabil ities, available: DFBSurfaceCapabilities surface_caps; /* Choose surface capabil ities, available:
INTERLACED, SEPARATED, PREMULTIPLIED. */ INTERLACED, SEPARATED, PREMULTIPLIED. */
} DFBDisplayLayerConfig; } DFBDisplayLayerConfig;
#define DLSO_FIXED_LIMIT 0x7f /* Stereo fixed depth value must be
between +DLSO_FIXED_LIMIT
and -DLSO_FIXED_LIMIT. */
/* /*
* Screen Power Mode. * Screen Power Mode.
*/ */
typedef enum { typedef enum {
DSPM_ON = 0, DSPM_ON = 0,
DSPM_STANDBY, DSPM_STANDBY,
DSPM_SUSPEND, DSPM_SUSPEND,
DSPM_OFF DSPM_OFF
} DFBScreenPowerMode; } DFBScreenPowerMode;
skipping to change at line 2431 skipping to change at line 2566
DFBScreenOutputConnectors all_connectors; /* Supported output connectors */ DFBScreenOutputConnectors all_connectors; /* Supported output connectors */
DFBScreenOutputResolution all_resolutions; /* Supported Resolut ions*/ DFBScreenOutputResolution all_resolutions; /* Supported Resolut ions*/
char name[DFB_SCREEN_ENCODER_DESC_NAME_LENGTH]; /* Encoder name */ char name[DFB_SCREEN_ENCODER_DESC_NAME_LENGTH]; /* Encoder name */
} DFBScreenEncoderDescription; } DFBScreenEncoderDescription;
/* /*
* Flags for display encoder configuration. * Flags for display encoder configuration.
*/ */
typedef enum { typedef enum {
DSECONF_NONE = 0x00000000, /* None of these. */ DSECONF_NONE = 0x00000000, /* None of these. */
DSECONF_TV_STANDARD = 0x00000001, /* Set TV standard. */ DSECONF_TV_STANDARD = 0x00000001, /* Set TV standard. */
DSECONF_TEST_PICTURE = 0x00000002, /* Set test picture mode. */ DSECONF_TEST_PICTURE = 0x00000002, /* Set test picture mode. */
DSECONF_MIXER = 0x00000004, /* Select mixer. */ DSECONF_MIXER = 0x00000004, /* Select mixer. */
DSECONF_OUT_SIGNALS = 0x00000008, /* Select generated output signal(s DSECONF_OUT_SIGNALS = 0x00000008, /* Select generated output sign
). */ al(s). */
DSECONF_SCANMODE = 0x00000010, /* Select interlaced or progressive DSECONF_SCANMODE = 0x00000010, /* Select interlaced or progres
output. */ sive output. */
DSECONF_TEST_COLOR = 0x00000020, /* Set color for DSETP_SINGLE. */ DSECONF_TEST_COLOR = 0x00000020, /* Set color for DSETP_SINGLE.
DSECONF_ADJUSTMENT = 0x00000040, /* Set color adjustment. */ */
DSECONF_FREQUENCY = 0x00000080, /* Set Output Frequency*/ DSECONF_ADJUSTMENT = 0x00000040, /* Set color adjustment. */
DSECONF_FREQUENCY = 0x00000080, /* Set Output Frequency*/
DSECONF_CONNECTORS = 0x00000100, /* Select output connector(s). */ DSECONF_CONNECTORS = 0x00000100, /* Select output connector(s).
DSECONF_SLOW_BLANKING = 0x00000200, /* Can select slow blanking suppor */
t. */ DSECONF_SLOW_BLANKING = 0x00000200, /* Can select slow blanking sup
DSECONF_RESOLUTION = 0x00000400, /* Can change resolution of the en port. */
coder.*/ DSECONF_RESOLUTION = 0x00000400, /* Can change resolution of the
encoder.*/
DSECONF_ALL = 0x000007FF DSECONF_FRAMING = 0x00000800, /* Set method for delivering pi
ctures to display. */
DSECONF_ALL = 0x00000FFF
} DFBScreenEncoderConfigFlags; } DFBScreenEncoderConfigFlags;
/* /*
* Test picture mode. * Test picture mode.
*/ */
typedef enum { typedef enum {
DSETP_OFF = 0x00000000, /* Disable test picture. */ DSETP_OFF = 0x00000000, /* Disable test picture. */
DSETP_MULTI = 0x00000001, /* Show color bars. */ DSETP_MULTI = 0x00000001, /* Show color bars. */
DSETP_SINGLE = 0x00000002, /* Whole screen as defined in configurat ion. */ DSETP_SINGLE = 0x00000002, /* Whole screen as defined in configurat ion. */
skipping to change at line 2469 skipping to change at line 2606
DSETP_YELLOW = 0x00000020, /* Whole screen (ff, ff, 00). */ DSETP_YELLOW = 0x00000020, /* Whole screen (ff, ff, 00). */
DSETP_CYAN = 0x00000030, /* Whole screen (00, ff, ff). */ DSETP_CYAN = 0x00000030, /* Whole screen (00, ff, ff). */
DSETP_GREEN = 0x00000040, /* Whole screen (00, ff, 00). */ DSETP_GREEN = 0x00000040, /* Whole screen (00, ff, 00). */
DSETP_MAGENTA = 0x00000050, /* Whole screen (ff, 00, ff). */ DSETP_MAGENTA = 0x00000050, /* Whole screen (ff, 00, ff). */
DSETP_RED = 0x00000060, /* Whole screen (ff, 00, 00). */ DSETP_RED = 0x00000060, /* Whole screen (ff, 00, 00). */
DSETP_BLUE = 0x00000070, /* Whole screen (00, 00, ff). */ DSETP_BLUE = 0x00000070, /* Whole screen (00, 00, ff). */
DSETP_BLACK = 0x00000080 /* Whole screen (00, 00, 00). */ DSETP_BLACK = 0x00000080 /* Whole screen (00, 00, 00). */
} DFBScreenEncoderTestPicture; } DFBScreenEncoderTestPicture;
/* /*
* Encoder picture delivery method.
*/
typedef enum {
DSEPF_UNKNOWN = 0,
DSEPF_MONO = 0x00000001, /* Normal output to non-s
tereoscopic (3D) TV. No
L/R content provided t
o TV. Frame is output on
each vsync. */
DSEPF_STEREO_PACKED_HORIZ = 0x00000002, /* L/R frames are downsca
led horizontally by 2 and
packed side-by-side in
to a single frame, left on left
half of frame. The pac
ked frame is output on each
vsync. Some stereoscop
ic TV's support this mode
using HDMI v1.3 and a
special menu configuration. */
DSEPF_STEREO_PACKED_VERT = 0x00000004, /* L/R frames are downsca
led vertically by 2 and
packed into a single f
rame, left on top. The packed
frame is output on eac
h vsync. Some stereoscopic TV's
support this mode usin
g HDMI v1.3 and a special
menu configuration. */
DSEPF_STEREO_SEQUENTIAL = 0x00000008 /* Full resolution L/R fr
ames are delivered sequentially
to the TV, alternating
left & right. Vsync occurs at
2x equivalent non-ster
eo frequency (i.e. 24Hz output
frequency causes 48Hz
vsync frequency to obtain both
left & right frames at
24Hz rate). Requires HDMI v1.4. */
} DFBScreenEncoderPictureFraming;
/*
* Configuration of a display encoder. * Configuration of a display encoder.
*/ */
typedef struct { typedef struct {
DFBScreenEncoderConfigFlags flags; /* Validates struct membe rs. */ DFBScreenEncoderConfigFlags flags; /* Validates st ruct members. */
DFBScreenEncoderTVStandards tv_standard; /* TV standard. */ DFBScreenEncoderTVStandards tv_standard; /* TV standard.
DFBScreenEncoderTestPicture test_picture; /* Test picture mode. */ */
int mixer; /* Selected mixer. */ DFBScreenEncoderTestPicture test_picture; /* Test picture
DFBScreenOutputSignals out_signals; /* Generated output signa mode. */
ls. */ int mixer; /* Selected mix
DFBScreenOutputConnectors out_connectors; /* Selected output conne er. */
ctor(s). */ DFBScreenOutputSignals out_signals; /* Generated ou
DFBScreenOutputSlowBlankingSignals slow_blanking;/* Slow Blanking tput signals. */
signals. */ DFBScreenOutputConnectors out_connectors; /* Selected out
put connector(s). */
DFBScreenOutputSlowBlankingSignals slow_blanking; /* Slow Blankin
g signals. */
DFBScreenEncoderScanMode scanmode; /* Interlaced or progress ive output. */ DFBScreenEncoderScanMode scanmode; /* Interlaced o r progressive output. */
DFBColor test_color; /* Color for DSETP_SINGLE . */ DFBColor test_color; /* Color for DS ETP_SINGLE. */
DFBColorAdjustment adjustment; /* Color adjustment. */ DFBColorAdjustment adjustment; /* Color adjust ment. */
DFBScreenEncoderFrequency frequency; /* Selected Output Freque DFBScreenEncoderFrequency frequency; /* Selected Out
ncy*/ put Frequency*/
DFBScreenOutputResolution resolution; /* Selected Output resolu DFBScreenOutputResolution resolution; /* Selected Out
tion*/ put resolution*/
DFBScreenEncoderPictureFraming framing; /* Selected pic
ture delivery method. */
} DFBScreenEncoderConfig; } DFBScreenEncoderConfig;
/******************* /*******************
* IDirectFBScreen * * IDirectFBScreen *
*******************/ *******************/
/* /*
* <i>No summary yet...</i> * <i>No summary yet...</i>
*/ */
DEFINE_INTERFACE( IDirectFBScreen, D_DEFINE_INTERFACE( IDirectFBScreen,
/** Retrieving information **/ /** Retrieving information **/
/* /*
* Get the unique screen ID. * Get the unique screen ID.
*/ */
DFBResult (*GetID) ( DFBResult (*GetID) (
IDirectFBScreen *thiz, IDirectFBScreen *thiz,
DFBScreenID *ret_screen_id DFBScreenID *ret_screen_id
); );
skipping to change at line 2716 skipping to change at line 2879
); );
) )
/************************* /*************************
* IDirectFBDisplayLayer * * IDirectFBDisplayLayer *
*************************/ *************************/
/* /*
* <i>No summary yet...</i> * <i>No summary yet...</i>
*/ */
DEFINE_INTERFACE( IDirectFBDisplayLayer, D_DEFINE_INTERFACE( IDirectFBDisplayLayer,
/** Information **/ /** Information **/
/* /*
* Get the unique layer ID. * Get the unique layer ID.
*/ */
DFBResult (*GetID) ( DFBResult (*GetID) (
IDirectFBDisplayLayer *thiz, IDirectFBDisplayLayer *thiz,
DFBDisplayLayerID *ret_layer_id DFBDisplayLayerID *ret_layer_id
); );
skipping to change at line 2861 skipping to change at line 3024
* Set location on screen in pixels. * Set location on screen in pixels.
*/ */
DFBResult (*SetScreenRectangle) ( DFBResult (*SetScreenRectangle) (
IDirectFBDisplayLayer *thiz, IDirectFBDisplayLayer *thiz,
int x, int x,
int y, int y,
int width, int width,
int height int height
); );
/*
* Get stereo depth.
*/
DFBResult (*GetStereoDepth) (
IDirectFBDisplayLayer *thiz,
bool *follow_video,
int *z
);
/*
* Set stereo depth.
*
* If follow_video is true then the pixel offset value from the video
metadata will be used to set the
* perceived depth. Otherwise, the z value specified will cause the le
ft eye buffer
* content to be shifted on the x-axis by +z and the right eye buffer
to be shifted
* by -z. A positive z value will cause the layer to appear closer tha
n
* the TV plane while a negative z value will make the layer appear fa
rther away. The
* depth is limited to a value between +DLSO_FIXED_LIMIT and -DLSO_FIX
ED_LIMIT.
*/
DFBResult (*SetStereoDepth) (
IDirectFBDisplayLayer *thiz,
bool follow_video,
int z
);
/** Misc Settings **/ /** Misc Settings **/
/* /*
* Set global alpha factor for blending with layer(s) below. * Set global alpha factor for blending with layer(s) below.
*/ */
DFBResult (*SetOpacity) ( DFBResult (*SetOpacity) (
IDirectFBDisplayLayer *thiz, IDirectFBDisplayLayer *thiz,
u8 opacity u8 opacity
); );
skipping to change at line 3250 skipping to change at line 3438
DSLF_READ = 0x00000001, /* Request read access while DSLF_READ = 0x00000001, /* Request read access while
surface is locked. */ surface is locked. */
DSLF_WRITE = 0x00000002 /* Request write access. If DSLF_WRITE = 0x00000002 /* Request write access. If
specified and surface has specified and surface has
a back buffer, it will be a back buffer, it will be
used. Otherwise, the front used. Otherwise, the front
buffer is used. */ buffer is used. */
} DFBSurfaceLockFlags; } DFBSurfaceLockFlags;
/* /*
* Stereo eye buffer.
*/
typedef enum {
DSSE_LEFT = 0x00000001, /* Left eye buffers to be used for
all future
operations on this surface. */
DSSE_RIGHT = 0x00000002 /* Right eye buffers to be used for
all future
operations on this surface. */
} DFBSurfaceStereoEye;
/*
* Available Porter/Duff rules. * Available Porter/Duff rules.
*
* pixel = (source * fs + destination * fd),
* sa = source alpha,
* da = destination alpha
*/ */
typedef enum { typedef enum {
/* pixel = (source * fs + destination * fd),
sa = source alpha,
da = destination alpha */
DSPD_NONE = 0, /* fs: sa fd: 1.0-sa (defaults) */ DSPD_NONE = 0, /* fs: sa fd: 1.0-sa (defaults) */
DSPD_CLEAR = 1, /* fs: 0.0 fd: 0.0 */ DSPD_CLEAR = 1, /* fs: 0.0 fd: 0.0 */
DSPD_SRC = 2, /* fs: 1.0 fd: 0.0 */ DSPD_SRC = 2, /* fs: 1.0 fd: 0.0 */
DSPD_SRC_OVER = 3, /* fs: 1.0 fd: 1.0-sa */ DSPD_SRC_OVER = 3, /* fs: 1.0 fd: 1.0-sa */
DSPD_DST_OVER = 4, /* fs: 1.0-da fd: 1.0 */ DSPD_DST_OVER = 4, /* fs: 1.0-da fd: 1.0 */
DSPD_SRC_IN = 5, /* fs: da fd: 0.0 */ DSPD_SRC_IN = 5, /* fs: da fd: 0.0 */
DSPD_DST_IN = 6, /* fs: 0.0 fd: sa */ DSPD_DST_IN = 6, /* fs: 0.0 fd: sa */
DSPD_SRC_OUT = 7, /* fs: 1.0-da fd: 0.0 */ DSPD_SRC_OUT = 7, /* fs: 1.0-da fd: 0.0 */
DSPD_DST_OUT = 8, /* fs: 0.0 fd: 1.0-sa */ DSPD_DST_OUT = 8, /* fs: 0.0 fd: 1.0-sa */
DSPD_SRC_ATOP = 9, /* fs: da fd: 1.0-sa */ DSPD_SRC_ATOP = 9, /* fs: da fd: 1.0-sa */
skipping to change at line 3336 skipping to change at line 3533
* Flags controlling surface masks set via IDirectFBSurface::SetSourceMask( ). * Flags controlling surface masks set via IDirectFBSurface::SetSourceMask( ).
*/ */
typedef enum { typedef enum {
DSMF_NONE = 0x00000000, /* None of these. */ DSMF_NONE = 0x00000000, /* None of these. */
DSMF_STENCIL = 0x00000001, /* Take <b>x</b> and <b>y</b> as fixed s tart coordinates in the mask. */ DSMF_STENCIL = 0x00000001, /* Take <b>x</b> and <b>y</b> as fixed s tart coordinates in the mask. */
DSMF_ALL = 0x00000001, /* All of these. */ DSMF_ALL = 0x00000001, /* All of these. */
} DFBSurfaceMaskFlags; } DFBSurfaceMaskFlags;
/*
* Available Rop codes.
*/
typedef enum {
DSROP_CLEAR = 0x00,
DSROP_XOR = 0x96,
DSROP_SRC_COPY = 0xCC,
/* TODO: to be extended with all ROP codes, possibly move to separate
header file */
} DFBSurfaceRopCode;
/*
* Available pattern mode
*/
typedef enum {
DSPM_8_8_MONO = 0,
DSPM_32_32_MONO = 1,
} DFBSurfacePatternMode;
/******************** /********************
* IDirectFBSurface * * IDirectFBSurface *
********************/ ********************/
/* /*
* <i>No summary yet...</i> * <i>No summary yet...</i>
*/ */
DEFINE_INTERFACE( IDirectFBSurface, D_DEFINE_INTERFACE( IDirectFBSurface,
/** Retrieving information **/ /** Retrieving information **/
/* /*
* Return the capabilities of this surface. * Return the capabilities of this surface.
*/ */
DFBResult (*GetCapabilities) ( DFBResult (*GetCapabilities) (
IDirectFBSurface *thiz, IDirectFBSurface *thiz,
DFBSurfaceCapabilities *ret_caps DFBSurfaceCapabilities *ret_caps
); );
skipping to change at line 3449 skipping to change at line 3665
IDirectFBSurface *thiz, IDirectFBSurface *thiz,
u8 a0, u8 a0,
u8 a1, u8 a1,
u8 a2, u8 a2,
u8 a3 u8 a3
); );
/** Buffer operations **/ /** Buffer operations **/
/* /*
* Get the current stereo eye.
*
* Only applicable to window/layer surfaces with the DWCAPS_STEREO or
DLOP_STEREO
* option. This method will retrieve which set of buffers (left or rig
ht) is currently
* active for operations on this surface.
*/
DFBResult (*GetStereoEye) (
IDirectFBSurface *thiz,
DFBSurfaceStereoEye *ret_eye
);
/*
* Select the stereo eye for future operations.
*
* Only applicable to window/layer surfaces with the DWCAPS_STEREO or
DLOP_STEREO
* option. This method will specify which set of buffers (left or righ
t) is to be
* used for future operations on this surface.
*/
DFBResult (*SetStereoEye) (
IDirectFBSurface *thiz,
DFBSurfaceStereoEye eye
);
/*
* Lock the surface for the access type specified. * Lock the surface for the access type specified.
* *
* Returns a data pointer and the line pitch of it.<br> * Returns a data pointer and the line pitch of it.<br>
* <br> * <br>
* <b>Note:</b> If the surface is double/triple buffered and * <b>Note:</b> If the surface is double/triple buffered and
* the DSLF_WRITE flag is specified, the pointer is to the back * the DSLF_WRITE flag is specified, the pointer is to the back
* buffer. In all other cases, the pointer is to the front * buffer. In all other cases, the pointer is to the front
* buffer. * buffer.
*/ */
DFBResult (*Lock) ( DFBResult (*Lock) (
skipping to change at line 3500 skipping to change at line 3740
* this method has the effect to make visible changes * this method has the effect to make visible changes
* made to the surface contents. * made to the surface contents.
*/ */
DFBResult (*Flip) ( DFBResult (*Flip) (
IDirectFBSurface *thiz, IDirectFBSurface *thiz,
const DFBRegion *region, const DFBRegion *region,
DFBSurfaceFlipFlags flags DFBSurfaceFlipFlags flags
); );
/* /*
* Flip/Update stereo surface buffers. Flips both the left and right
* buffers simultaneously to ensure synchronization between the two.
* Only applicable to window and layer surfaces with the DWCAPS_STEREO
* or DLOP_STEREO option set; will fail with all other surfaces.
*
* If no region is specified the whole surface is flipped,
* otherwise blitting is used to update the region.
* If surface capabilities don't include DSCAPS_FLIPPING,
* this method has the effect to make visible changes
* made to the surface contents.
*/
DFBResult (*FlipStereo) (
IDirectFBSurface *thiz,
const DFBRegion *left_region,
const DFBRegion *right_region,
DFBSurfaceFlipFlags flags
);
/*
* Set the active field. * Set the active field.
* *
* Interlaced surfaces consist of two fields. Software driven * Interlaced surfaces consist of two fields. Software driven
* deinterlacing uses this method to manually switch the field * deinterlacing uses this method to manually switch the field
* that is displayed, e.g. scaled up vertically by two. * that is displayed, e.g. scaled up vertically by two.
*/ */
DFBResult (*SetField) ( DFBResult (*SetField) (
IDirectFBSurface *thiz, IDirectFBSurface *thiz,
int field int field
); );
skipping to change at line 4184 skipping to change at line 4443
* Fill a bunch of trapezoids with a single call. * Fill a bunch of trapezoids with a single call.
* *
* Fill <b>num</b> trapezoids with the current color following the * Fill <b>num</b> trapezoids with the current color following the
* drawing flags. Each trapezoid specified by a DFBTrapezoid. * drawing flags. Each trapezoid specified by a DFBTrapezoid.
*/ */
DFBResult (*FillTrapezoids) ( DFBResult (*FillTrapezoids) (
IDirectFBSurface *thiz, IDirectFBSurface *thiz,
const DFBTrapezoid *traps, const DFBTrapezoid *traps,
unsigned int num unsigned int num
); );
/** Drawing/blitting control **/
/*
* Sets write mask bits.
*
* Bits being set in the mask will NOT get written to the destination.
Default is all zeros, i.e. all bits written.
*/
DFBResult (*SetWriteMaskBits) (
IDirectFBSurface *thiz,
u64 bits
);
/*
* Set Rop operation related parameters.
*
* rop_code: rop code<br>
* fg_color: pattern foreground color<br>
* bg_color: pattern background color<br>
* pattern: pattern array<br>
* pattern_mode: 8*8 mono or 32 * 32 mono
*/
DFBResult (*SetRop) (
IDirectFBSurface *thiz,
DFBSurfaceRopCode rop_code,
const DFBColor *fg_color,
const DFBColor *bg_color,
const u32 *pattern,
DFBSurfacePatternMode pattern_mode
);
) )
/******************** /********************
* IDirectFBPalette * * IDirectFBPalette *
********************/ ********************/
/* /*
* <i>No summary yet...</i> * <i>No summary yet...</i>
*/ */
DEFINE_INTERFACE( IDirectFBPalette, D_DEFINE_INTERFACE( IDirectFBPalette,
/** Retrieving information **/ /** Retrieving information **/
/* /*
* Return the capabilities of this palette. * Return the capabilities of this palette.
*/ */
DFBResult (*GetCapabilities) ( DFBResult (*GetCapabilities) (
IDirectFBPalette *thiz, IDirectFBPalette *thiz,
DFBPaletteCapabilities *ret_caps DFBPaletteCapabilities *ret_caps
); );
skipping to change at line 4353 skipping to change at line 4642
DIMM_HYPER = (1 << DIMKI_HYPER) /* Hyper key is pressed */ DIMM_HYPER = (1 << DIMKI_HYPER) /* Hyper key is pressed */
} DFBInputDeviceModifierMask; } DFBInputDeviceModifierMask;
/************************ /************************
* IDirectFBInputDevice * * IDirectFBInputDevice *
************************/ ************************/
/* /*
* <i>No summary yet...</i> * <i>No summary yet...</i>
*/ */
DEFINE_INTERFACE( IDirectFBInputDevice, D_DEFINE_INTERFACE( IDirectFBInputDevice,
/** Retrieving information **/ /** Retrieving information **/
/* /*
* Get the unique device ID. * Get the unique device ID.
*/ */
DFBResult (*GetID) ( DFBResult (*GetID) (
IDirectFBInputDevice *thiz, IDirectFBInputDevice *thiz,
DFBInputDeviceID *ret_device_id DFBInputDeviceID *ret_device_id
); );
skipping to change at line 4872 skipping to change at line 5161
unsigned int DVPET_BUFFERTIMEHIGH; unsigned int DVPET_BUFFERTIMEHIGH;
} DFBEventBufferStats; } DFBEventBufferStats;
/************************ /************************
* IDirectFBEventBuffer * * IDirectFBEventBuffer *
************************/ ************************/
/* /*
* <i>No summary yet...</i> * <i>No summary yet...</i>
*/ */
DEFINE_INTERFACE( IDirectFBEventBuffer, D_DEFINE_INTERFACE( IDirectFBEventBuffer,
/** Buffer handling **/ /** Buffer handling **/
/* /*
* Clear all events stored in this buffer. * Clear all events stored in this buffer.
*/ */
DFBResult (*Reset) ( DFBResult (*Reset) (
IDirectFBEventBuffer *thiz IDirectFBEventBuffer *thiz
); );
skipping to change at line 5030 skipping to change at line 5319
DWCF_RELATIVE = 0x00000001, DWCF_RELATIVE = 0x00000001,
DWCF_EXPLICIT = 0x00000002, DWCF_EXPLICIT = 0x00000002,
DWCF_UNCLIPPED = 0x00000004, DWCF_UNCLIPPED = 0x00000004,
DWCF_TRAPPED = 0x00000008, DWCF_TRAPPED = 0x00000008,
DWCF_FIXED = 0x00000010, DWCF_FIXED = 0x00000010,
DWCF_INVISIBLE = 0x00000020, DWCF_INVISIBLE = 0x00000020,
DWCF_ALL = 0x0000003F DWCF_ALL = 0x0000003F
} DFBWindowCursorFlags; } DFBWindowCursorFlags;
#define DWSO_FIXED_LIMIT 0x80 /* Fixed stereo depth value must be
between +DWSO_FIXED_LIMIT
and -DWSO_FIXED_LIMIT. */
/******************* /*******************
* IDirectFBWindow * * IDirectFBWindow *
*******************/ *******************/
/* /*
* <i>No summary yet...</i> * <i>No summary yet...</i>
*/ */
DEFINE_INTERFACE( IDirectFBWindow, D_DEFINE_INTERFACE( IDirectFBWindow,
/** Retrieving information **/ /** Retrieving information **/
/* /*
* Get the unique window ID. * Get the unique window ID.
*/ */
DFBResult (*GetID) ( DFBResult (*GetID) (
IDirectFBWindow *thiz, IDirectFBWindow *thiz,
DFBWindowID *ret_window_id DFBWindowID *ret_window_id
); );
skipping to change at line 5523 skipping to change at line 5815
/* /*
* Set destination location of window within its bounds. * Set destination location of window within its bounds.
* *
* Default and maximum is to fill whole bounds. * Default and maximum is to fill whole bounds.
*/ */
DFBResult (*SetDstGeometry) ( DFBResult (*SetDstGeometry) (
IDirectFBWindow *thiz, IDirectFBWindow *thiz,
const DFBWindowGeometry *geometry const DFBWindowGeometry *geometry
); );
/*
* Get stereo depth.
*/
DFBResult (*GetStereoDepth) (
IDirectFBWindow *thiz,
int *z
);
/*
* Set stereo depth.
*
* The depth value specified will cause the left eye buffer content to
be shifted on the
* x-axis by +z and the right eye buffer to be shifted by -z value. A
positive
* z value will cause the layer to appear closer than the TV plane whi
le a negative
* z value will make the layer appear farther away. The depth is limit
ed to a value
* between +DLSO_FIXED_LIMIT and -DLSO_FIXED_LIMIT.
*/
DFBResult (*SetStereoDepth) (
IDirectFBWindow *thiz,
int z
);
/** Properties **/ /** Properties **/
/* /*
* Set property controlling appearance and behaviour of the window. * Set property controlling appearance and behaviour of the window.
*/ */
DFBResult (*SetProperty) ( DFBResult (*SetProperty) (
IDirectFBWindow *thiz, IDirectFBWindow *thiz,
const char *key, const char *key,
void *value, void *value,
void **ret_old_value void **ret_old_value
skipping to change at line 5662 skipping to change at line 5976
void *context void *context
); );
/***************** /*****************
* IDirectFBFont * * IDirectFBFont *
*****************/ *****************/
/* /*
* <i>No summary yet...</i> * <i>No summary yet...</i>
*/ */
DEFINE_INTERFACE( IDirectFBFont, D_DEFINE_INTERFACE( IDirectFBFont,
/** Retrieving information **/ /** Retrieving information **/
/* /*
* Get the distance from the baseline to the top of the * Get the distance from the baseline to the top of the
* logical extents of this font. * logical extents of this font.
*/ */
DFBResult (*GetAscender) ( DFBResult (*GetAscender) (
IDirectFBFont *thiz, IDirectFBFont *thiz,
int *ret_ascender int *ret_ascender
skipping to change at line 5903 skipping to change at line 6217
* value indicating left-to-right rendering. If you don't * value indicating left-to-right rendering. If you don't
* need this value, pass NULL for advance. * need this value, pass NULL for advance.
*/ */
DFBResult (*GetGlyphExtentsXY) ( DFBResult (*GetGlyphExtentsXY) (
IDirectFBFont *thiz, IDirectFBFont *thiz,
unsigned int character, unsigned int character,
DFBRectangle *ret_rect, DFBRectangle *ret_rect,
int *ret_xadvance, int *ret_xadvance,
int *ret_yadvance int *ret_yadvance
); );
/*
* Get the position and thickness of the underline.
*/
DFBResult (*GetUnderline) (
IDirectFBFont *thiz,
int *ret_underline_position,
int *ret_underline_thichness
);
) )
/* /*
* Capabilities of an image. * Capabilities of an image.
*/ */
typedef enum { typedef enum {
DICAPS_NONE = 0x00000000, /* None of these. */ DICAPS_NONE = 0x00000000, /* None of these. */
DICAPS_ALPHACHANNEL = 0x00000001, /* The image data contains an DICAPS_ALPHACHANNEL = 0x00000001, /* The image data contains an
alphachannel. */ alphachannel. */
DICAPS_COLORKEY = 0x00000002 /* The image has a colorkey, DICAPS_COLORKEY = 0x00000002 /* The image has a colorkey,
skipping to change at line 5946 skipping to change at line 6269
*/ */
typedef DIRenderCallbackResult (*DIRenderCallback)(DFBRectangle *rect, void *ctx); typedef DIRenderCallbackResult (*DIRenderCallback)(DFBRectangle *rect, void *ctx);
/************************** /**************************
* IDirectFBImageProvider * * IDirectFBImageProvider *
**************************/ **************************/
/* /*
* <i>No summary yet...</i> * <i>No summary yet...</i>
*/ */
DEFINE_INTERFACE( IDirectFBImageProvider, D_DEFINE_INTERFACE( IDirectFBImageProvider,
/** Retrieving information **/ /** Retrieving information **/
/* /*
* Get a surface description that best matches the image * Get a surface description that best matches the image
* contained in the file. * contained in the file.
* *
* For opaque image formats the pixel format of the primary * For opaque image formats the pixel format of the primary
* layer is used. For images with alpha channel an ARGB * layer is used. For images with alpha channel an ARGB
* surface description is returned. * surface description is returned.
skipping to change at line 6150 skipping to change at line 6473
*/ */
typedef void (*DVFrameCallback)(void *ctx); typedef void (*DVFrameCallback)(void *ctx);
/************************** /**************************
* IDirectFBVideoProvider * * IDirectFBVideoProvider *
**************************/ **************************/
/* /*
* <i>No summary yet...</i> * <i>No summary yet...</i>
*/ */
DEFINE_INTERFACE( IDirectFBVideoProvider, D_DEFINE_INTERFACE( IDirectFBVideoProvider,
/** Retrieving information **/ /** Retrieving information **/
/* /*
* Retrieve information about the video provider's * Retrieve information about the video provider's
* capabilities. * capabilities.
*/ */
DFBResult (*GetCapabilities) ( DFBResult (*GetCapabilities) (
IDirectFBVideoProvider *thiz, IDirectFBVideoProvider *thiz,
DFBVideoProviderCapabilities *ret_caps DFBVideoProviderCapabilities *ret_caps
skipping to change at line 6449 skipping to change at line 6772
); );
) )
/*********************** /***********************
* IDirectFBDataBuffer * * IDirectFBDataBuffer *
***********************/ ***********************/
/* /*
* <i>No summary yet...</i> * <i>No summary yet...</i>
*/ */
DEFINE_INTERFACE( IDirectFBDataBuffer, D_DEFINE_INTERFACE( IDirectFBDataBuffer,
/** Buffer handling **/ /** Buffer handling **/
/* /*
* Flushes all data in this buffer. * Flushes all data in this buffer.
* *
* This method only applies to streaming buffers. * This method only applies to streaming buffers.
*/ */
DFBResult (*Flush) ( DFBResult (*Flush) (
IDirectFBDataBuffer *thiz IDirectFBDataBuffer *thiz
skipping to change at line 6603 skipping to change at line 6926
unsigned int length unsigned int length
); );
/** Media from data **/ /** Media from data **/
/* /*
* Creates an image provider using the buffers data. * Creates an image provider using the buffers data.
*/ */
DFBResult (*CreateImageProvider) ( DFBResult (*CreateImageProvider) (
IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *thiz,
IDirectFBImageProvider **interface IDirectFBImageProvider **interface_ptr
); );
/* /*
* Creates a video provider using the buffers data. * Creates a video provider using the buffers data.
*/ */
DFBResult (*CreateVideoProvider) ( DFBResult (*CreateVideoProvider) (
IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *thiz,
IDirectFBVideoProvider **interface IDirectFBVideoProvider **interface_ptr
); );
/* /*
* Load a font using the buffer's data, given a description * Load a font using the buffer's data, given a description
* of how to load the glyphs. * of how to load the glyphs.
*/ */
DFBResult (*CreateFont) ( DFBResult (*CreateFont) (
IDirectFBDataBuffer *thiz, IDirectFBDataBuffer *thiz,
const DFBFontDescription *desc, const DFBFontDescription *desc,
IDirectFBFont **interface IDirectFBFont **interface_ptr
); );
) )
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 83 change blocks. 
130 lines changed or deleted 544 lines changed or added


 directfb_strings.h   directfb_strings.h 
#ifndef __DIRECTFB_STRINGS_H__ #ifndef __DIRECTFB_STRINGS_H__
#define __DIRECTFB_STRINGS_H__ #define __DIRECTFB_STRINGS_H__
#include <directfb.h>
#include <directfb_water.h>
struct DFBPixelFormatName { struct DFBPixelFormatName {
DFBSurfacePixelFormat format; DFBSurfacePixelFormat format;
const char *name; const char *name;
}; };
#define DirectFBPixelFormatNames(Identifier) struct DFBPixelFormatName Iden tifier[] = { \ #define DirectFBPixelFormatNames(Identifier) struct DFBPixelFormatName Iden tifier[] = { \
{ DSPF_ARGB1555, "ARGB1555" }, \ { DSPF_ARGB1555, "ARGB1555" }, \
{ DSPF_RGB16, "RGB16" }, \ { DSPF_RGB16, "RGB16" }, \
{ DSPF_RGB24, "RGB24" }, \ { DSPF_RGB24, "RGB24" }, \
skipping to change at line 47 skipping to change at line 49
{ DSPF_RGB444, "RGB444" }, \ { DSPF_RGB444, "RGB444" }, \
{ DSPF_RGB555, "RGB555" }, \ { DSPF_RGB555, "RGB555" }, \
{ DSPF_BGR555, "BGR555" }, \ { DSPF_BGR555, "BGR555" }, \
{ DSPF_RGBA5551, "RGBA5551" }, \ { DSPF_RGBA5551, "RGBA5551" }, \
{ DSPF_YUV444P, "YUV444P" }, \ { DSPF_YUV444P, "YUV444P" }, \
{ DSPF_ARGB8565, "ARGB8565" }, \ { DSPF_ARGB8565, "ARGB8565" }, \
{ DSPF_AVYU, "AVYU" }, \ { DSPF_AVYU, "AVYU" }, \
{ DSPF_VYU, "VYU" }, \ { DSPF_VYU, "VYU" }, \
{ DSPF_A1_LSB, "A1_LSB" }, \ { DSPF_A1_LSB, "A1_LSB" }, \
{ DSPF_YV16, "YV16" }, \ { DSPF_YV16, "YV16" }, \
{ DSPF_ABGR, "ABGR" }, \
{ DSPF_UNKNOWN, "UNKNOWN" } \ { DSPF_UNKNOWN, "UNKNOWN" } \
}; };
struct DFBColorSpaceName {
DFBSurfaceColorSpace colorspace;
const char *name;
};
#define DirectFBColorSpaceNames(Identifier) struct DFBColorSpaceName Identi
fier[] = { \
{ DSCS_RGB, "RGB" }, \
{ DSCS_BT601, "BT601" }, \
{ DSCS_BT601_FULLRANGE, "BT601_FULLRANGE" }, \
{ DSCS_BT709, "BT709" }, \
{ DSCS_UNKNOWN, "UNKNOWN" } \
};
struct DFBInputDeviceTypeFlagsName { struct DFBInputDeviceTypeFlagsName {
DFBInputDeviceTypeFlags type; DFBInputDeviceTypeFlags type;
const char *name; const char *name;
}; };
#define DirectFBInputDeviceTypeFlagsNames(Identifier) struct DFBInputDevice TypeFlagsName Identifier[] = { \ #define DirectFBInputDeviceTypeFlagsNames(Identifier) struct DFBInputDevice TypeFlagsName Identifier[] = { \
{ DIDTF_KEYBOARD, "KEYBOARD" }, \ { DIDTF_KEYBOARD, "KEYBOARD" }, \
{ DIDTF_MOUSE, "MOUSE" }, \ { DIDTF_MOUSE, "MOUSE" }, \
{ DIDTF_JOYSTICK, "JOYSTICK" }, \ { DIDTF_JOYSTICK, "JOYSTICK" }, \
{ DIDTF_REMOTE, "REMOTE" }, \ { DIDTF_REMOTE, "REMOTE" }, \
skipping to change at line 106 skipping to change at line 122
{ DSBLIT_INDEX_TRANSLATION, "INDEX_TRANSLATION" }, \ { DSBLIT_INDEX_TRANSLATION, "INDEX_TRANSLATION" }, \
{ DSBLIT_ROTATE90, "ROTATE90" }, \ { DSBLIT_ROTATE90, "ROTATE90" }, \
{ DSBLIT_ROTATE180, "ROTATE180" }, \ { DSBLIT_ROTATE180, "ROTATE180" }, \
{ DSBLIT_ROTATE270, "ROTATE270" }, \ { DSBLIT_ROTATE270, "ROTATE270" }, \
{ DSBLIT_COLORKEY_PROTECT, "COLORKEY_PROTECT" }, \ { DSBLIT_COLORKEY_PROTECT, "COLORKEY_PROTECT" }, \
{ DSBLIT_SRC_MASK_ALPHA, "SRC_MASK_ALPHA" }, \ { DSBLIT_SRC_MASK_ALPHA, "SRC_MASK_ALPHA" }, \
{ DSBLIT_SRC_MASK_COLOR, "SRC_MASK_COLOR" }, \ { DSBLIT_SRC_MASK_COLOR, "SRC_MASK_COLOR" }, \
{ DSBLIT_SOURCE2, "SOURCE2" }, \ { DSBLIT_SOURCE2, "SOURCE2" }, \
{ DSBLIT_FLIP_HORIZONTAL, "FLIP_HORIZONTAL" }, \ { DSBLIT_FLIP_HORIZONTAL, "FLIP_HORIZONTAL" }, \
{ DSBLIT_FLIP_VERTICAL, "FLIP_VERTICAL" }, \ { DSBLIT_FLIP_VERTICAL, "FLIP_VERTICAL" }, \
{ DSBLIT_ROP, "ROP" }, \
{ DSBLIT_NOFX, "NOFX" } \ { DSBLIT_NOFX, "NOFX" } \
}; };
struct DFBSurfaceBlendFunctionName { struct DFBSurfaceBlendFunctionName {
DFBSurfaceBlendFunction function; DFBSurfaceBlendFunction function;
const char *name; const char *name;
}; };
#define DirectFBSurfaceBlendFunctionNames(Identifier) struct DFBSurfaceBlen dFunctionName Identifier[] = { \ #define DirectFBSurfaceBlendFunctionNames(Identifier) struct DFBSurfaceBlen dFunctionName Identifier[] = { \
{ DSBF_ZERO, "ZERO" }, \ { DSBF_ZERO, "ZERO" }, \
skipping to change at line 181 skipping to change at line 198
{ DLCAPS_SATURATION, "SATURATION" }, \ { DLCAPS_SATURATION, "SATURATION" }, \
{ DLCAPS_LEVELS, "LEVELS" }, \ { DLCAPS_LEVELS, "LEVELS" }, \
{ DLCAPS_FIELD_PARITY, "FIELD_PARITY" }, \ { DLCAPS_FIELD_PARITY, "FIELD_PARITY" }, \
{ DLCAPS_WINDOWS, "WINDOWS" }, \ { DLCAPS_WINDOWS, "WINDOWS" }, \
{ DLCAPS_SOURCES, "SOURCES" }, \ { DLCAPS_SOURCES, "SOURCES" }, \
{ DLCAPS_ALPHA_RAMP, "ALPHA_RAMP" }, \ { DLCAPS_ALPHA_RAMP, "ALPHA_RAMP" }, \
{ DLCAPS_PREMULTIPLIED, "PREMULTIPLIED" }, \ { DLCAPS_PREMULTIPLIED, "PREMULTIPLIED" }, \
{ DLCAPS_SCREEN_POSITION, "SCREEN_POSITION" }, \ { DLCAPS_SCREEN_POSITION, "SCREEN_POSITION" }, \
{ DLCAPS_SCREEN_SIZE, "SCREEN_SIZE" }, \ { DLCAPS_SCREEN_SIZE, "SCREEN_SIZE" }, \
{ DLCAPS_CLIP_REGIONS, "CLIP_REGIONS" }, \ { DLCAPS_CLIP_REGIONS, "CLIP_REGIONS" }, \
{ DLCAPS_LR_MONO, "LR_MONO" }, \
{ DLCAPS_STEREO, "STEREO" }, \
{ DLCAPS_NONE, "NONE" } \ { DLCAPS_NONE, "NONE" } \
}; };
struct DFBDisplayLayerBufferModeName { struct DFBDisplayLayerBufferModeName {
DFBDisplayLayerBufferMode mode; DFBDisplayLayerBufferMode mode;
const char *name; const char *name;
}; };
#define DirectFBDisplayLayerBufferModeNames(Identifier) struct DFBDisplayLa yerBufferModeName Identifier[] = { \ #define DirectFBDisplayLayerBufferModeNames(Identifier) struct DFBDisplayLa yerBufferModeName Identifier[] = { \
{ DLBM_FRONTONLY, "FRONTONLY" }, \ { DLBM_FRONTONLY, "FRONTONLY" }, \
skipping to change at line 204 skipping to change at line 223
{ DLBM_WINDOWS, "WINDOWS" }, \ { DLBM_WINDOWS, "WINDOWS" }, \
{ DLBM_UNKNOWN, "UNKNOWN" } \ { DLBM_UNKNOWN, "UNKNOWN" } \
}; };
struct DFBWindowCapabilitiesName { struct DFBWindowCapabilitiesName {
DFBWindowCapabilities capability; DFBWindowCapabilities capability;
const char *name; const char *name;
}; };
#define DirectFBWindowCapabilitiesNames(Identifier) struct DFBWindowCapabil itiesName Identifier[] = { \ #define DirectFBWindowCapabilitiesNames(Identifier) struct DFBWindowCapabil itiesName Identifier[] = { \
{ DWCAPS_LR_MONO, "LR_MONO" }, \
{ DWCAPS_ALPHACHANNEL, "ALPHACHANNEL" }, \ { DWCAPS_ALPHACHANNEL, "ALPHACHANNEL" }, \
{ DWCAPS_DOUBLEBUFFER, "DOUBLEBUFFER" }, \ { DWCAPS_DOUBLEBUFFER, "DOUBLEBUFFER" }, \
{ DWCAPS_INPUTONLY, "INPUTONLY" }, \ { DWCAPS_INPUTONLY, "INPUTONLY" }, \
{ DWCAPS_NODECORATION, "NODECORATION" }, \ { DWCAPS_NODECORATION, "NODECORATION" }, \
{ DWCAPS_SUBWINDOW, "SUBWINDOW" }, \ { DWCAPS_SUBWINDOW, "SUBWINDOW" }, \
{ DWCAPS_COLOR, "COLOR" }, \ { DWCAPS_COLOR, "COLOR" }, \
{ DWCAPS_NOFOCUS, "NOFOCUS" }, \ { DWCAPS_NOFOCUS, "NOFOCUS" }, \
{ DWCAPS_LR_MONO, "LR_MONO" }, \
{ DWCAPS_STEREO, "STEREO" }, \
{ DWCAPS_NONE, "NONE" } \ { DWCAPS_NONE, "NONE" } \
}; };
struct DFBWindowOptionsName { struct DFBWindowOptionsName {
DFBWindowOptions option; DFBWindowOptions option;
const char *name; const char *name;
}; };
#define DirectFBWindowOptionsNames(Identifier) struct DFBWindowOptionsName Identifier[] = { \ #define DirectFBWindowOptionsNames(Identifier) struct DFBWindowOptionsName Identifier[] = { \
{ DWOP_COLORKEYING, "COLORKEYING" }, \ { DWOP_COLORKEYING, "COLORKEYING" }, \
skipping to change at line 463 skipping to change at line 485
{ DSECONF_TEST_PICTURE, "TEST_PICTURE" }, \ { DSECONF_TEST_PICTURE, "TEST_PICTURE" }, \
{ DSECONF_MIXER, "MIXER" }, \ { DSECONF_MIXER, "MIXER" }, \
{ DSECONF_OUT_SIGNALS, "OUT_SIGNALS" }, \ { DSECONF_OUT_SIGNALS, "OUT_SIGNALS" }, \
{ DSECONF_SCANMODE, "SCANMODE" }, \ { DSECONF_SCANMODE, "SCANMODE" }, \
{ DSECONF_TEST_COLOR, "TEST_COLOR" }, \ { DSECONF_TEST_COLOR, "TEST_COLOR" }, \
{ DSECONF_ADJUSTMENT, "ADJUSTMENT" }, \ { DSECONF_ADJUSTMENT, "ADJUSTMENT" }, \
{ DSECONF_FREQUENCY, "FREQUENCY" }, \ { DSECONF_FREQUENCY, "FREQUENCY" }, \
{ DSECONF_CONNECTORS, "CONNECTORS" }, \ { DSECONF_CONNECTORS, "CONNECTORS" }, \
{ DSECONF_SLOW_BLANKING, "SLOW_BLANKING" }, \ { DSECONF_SLOW_BLANKING, "SLOW_BLANKING" }, \
{ DSECONF_RESOLUTION, "RESOLUTION" }, \ { DSECONF_RESOLUTION, "RESOLUTION" }, \
{ DSECONF_FRAMING, "FRAMING" }, \
{ DSECONF_UNKNOWN, "UNKNOWN" } \ { DSECONF_UNKNOWN, "UNKNOWN" } \
}; };
struct DFBScreenEncoderFrequencyName { struct DFBScreenEncoderFrequencyName {
DFBScreenEncoderFrequency frequency; DFBScreenEncoderFrequency frequency;
const char *name; const char *name;
}; };
#define DirectFBScreenEncoderFrequencyNames(Identifier) struct DFBScreenEnc oderFrequencyName Identifier[] = { \ #define DirectFBScreenEncoderFrequencyNames(Identifier) struct DFBScreenEnc oderFrequencyName Identifier[] = { \
{ DSEF_25HZ, "25HZ" }, \ { DSEF_25HZ, "25HZ" }, \
skipping to change at line 495 skipping to change at line 518
DFBAccelerationMask mask; DFBAccelerationMask mask;
const char *name; const char *name;
}; };
#define DirectFBAccelerationMaskNames(Identifier) struct DFBAccelerationMas kName Identifier[] = { \ #define DirectFBAccelerationMaskNames(Identifier) struct DFBAccelerationMas kName Identifier[] = { \
{ DFXL_FILLRECTANGLE, "FILLRECTANGLE" }, \ { DFXL_FILLRECTANGLE, "FILLRECTANGLE" }, \
{ DFXL_DRAWRECTANGLE, "DRAWRECTANGLE" }, \ { DFXL_DRAWRECTANGLE, "DRAWRECTANGLE" }, \
{ DFXL_DRAWLINE, "DRAWLINE" }, \ { DFXL_DRAWLINE, "DRAWLINE" }, \
{ DFXL_FILLTRIANGLE, "FILLTRIANGLE" }, \ { DFXL_FILLTRIANGLE, "FILLTRIANGLE" }, \
{ DFXL_FILLTRAPEZOID, "FILLTRAPEZOID" }, \ { DFXL_FILLTRAPEZOID, "FILLTRAPEZOID" }, \
{ DFXL_FILLQUADRANGLE, "FILLQUADRANGLE" }, \
{ DFXL_BLIT, "BLIT" }, \ { DFXL_BLIT, "BLIT" }, \
{ DFXL_STRETCHBLIT, "STRETCHBLIT" }, \ { DFXL_STRETCHBLIT, "STRETCHBLIT" }, \
{ DFXL_TEXTRIANGLES, "TEXTRIANGLES" }, \ { DFXL_TEXTRIANGLES, "TEXTRIANGLES" }, \
{ DFXL_BLIT2, "BLIT2" }, \ { DFXL_BLIT2, "BLIT2" }, \
{ DFXL_DRAWSTRING, "DRAWSTRING" }, \ { DFXL_DRAWSTRING, "DRAWSTRING" }, \
{ DFXL_NONE, "NONE" } \ { DFXL_NONE, "NONE" } \
}; };
struct DFBWaterElementTypeName {
WaterElementType type;
const char *name;
};
#define DirectFBWaterElementTypeNames(Identifier) struct DFBWaterElementTyp
eName Identifier[] = { \
{ WET_POINT, "POINT" }, \
{ WET_SPAN, "SPAN" }, \
{ WET_LINE, "LINE" }, \
{ WET_LINE_STRIP, "LINE_STRIP" }, \
{ WET_LINE_LOOP, "LINE_LOOP" }, \
{ WET_TRIANGLE, "TRIANGLE" }, \
{ WET_TRIANGLE_FAN, "TRIANGLE_FAN" }, \
{ WET_TRIANGLE_STRIP, "TRIANGLE_STRIP" }, \
{ WET_RECTANGLE, "RECTANGLE" }, \
{ WET_RECTANGLE_STRIP, "RECTANGLE_STRIP" }, \
{ WET_TRAPEZOID, "TRAPEZOID" }, \
{ WET_TRAPEZOID_STRIP, "TRAPEZOID_STRIP" }, \
{ WET_QUADRANGLE, "QUADRANGLE" }, \
{ WET_QUADRANGLE_STRIP, "QUADRANGLE_STRIP" }, \
{ WET_POLYGON, "POLYGON" }, \
{ WET_CIRCLE, "CIRCLE" }, \
{ WET_ELLIPSE, "ELLIPSE" }, \
{ WET_ARC_CIRCLE, "ARC_CIRCLE" }, \
{ WET_ARC_ELLIPSE, "ARC_ELLIPSE" }, \
{ WET_QUAD_CURVE, "QUAD_CURVE" }, \
{ WET_QUAD_CURVE_STRIP, "QUAD_CURVE_STRIP" }, \
{ WET_CUBIC_CURVE, "CUBIC_CURVE" }, \
{ WET_CUBIC_CURVE_STRIP, "CUBIC_CURVE_STRIP" }, \
{ WET_UNKNOWN, "UNKNOWN" } \
};
#endif #endif
 End of changes. 10 change blocks. 
0 lines changed or deleted 58 lines changed or added


 directfb_util.h   directfb_util.h 
skipping to change at line 44 skipping to change at line 44
#include <directfb.h> #include <directfb.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif #endif
#include <directfb_strings.h> #include <directfb_strings.h>
#include <direct/thread.h>
#include <direct/types.h> #include <direct/types.h>
#include <direct/debug.h> #include <direct/debug.h>
bool dfb_region_intersect( DFBRegion *region, bool DIRECTFB_API dfb_region_rectangle_intersect( DFBRegion *regio
int x1, int y1, int x2, int y2 ); n,
const DFBRectangle *rect
);
bool dfb_region_region_intersect( DFBRegion *region, bool DIRECTFB_API dfb_unsafe_region_intersect( DFBRegion *region,
const DFBRegion *clip ); int x1, int y1, int x2, int
y2 );
bool dfb_region_rectangle_intersect( DFBRegion *region, bool DIRECTFB_API dfb_unsafe_region_rectangle_intersect( DFBRegion
const DFBRectangle *rect ); *region,
const DFBRectangle
*rect );
bool dfb_unsafe_region_intersect( DFBRegion *region, bool DIRECTFB_API dfb_rectangle_intersect_by_unsafe_region( DFBRectangle *r
int x1, int y1, int x2, int y2 ); ectangle,
DFBRegion *r
egion );
bool dfb_unsafe_region_rectangle_intersect( DFBRegion *region, bool DIRECTFB_API dfb_rectangle_intersect_by_region( DFBRectangle *recta
const DFBRectangle *rect ); ngle,
const DFBRegion *regio
n );
bool dfb_rectangle_intersect_by_unsafe_region( DFBRectangle *rectangle, bool DIRECTFB_API dfb_rectangle_intersect( DFBRectangle *rectangle,
DFBRegion *region ); const DFBRectangle *clip );
bool dfb_rectangle_intersect_by_region( DFBRectangle *rectangle, /* returns the result in the first rectangle */
const DFBRegion *region ); void DIRECTFB_API dfb_rectangle_union ( DFBRectangle *rect1,
const DFBRectangle *rect2 );
bool dfb_rectangle_intersect( DFBRectangle *rectangle, /**************************************************************************
const DFBRectangle *clip ); ********************************************/
/* returns the result in the first rectangle */ #define DFB_RECTANGLE_CHECK(r) \
void dfb_rectangle_union ( DFBRectangle *rect1, ((r) != NULL && \
const DFBRectangle *rect2 ); (r)->x1 <= (r)->x2 && \
(r)->y1 <= (r)->y2)
#define DFB_RECTANGLE_ASSERT(r) \ #define DFB_RECTANGLE_CHECK_IF(r) \
do { \ ((r) == NULL || \
D_ASSERT( (r) != NULL ); \ ((r)->w >= 0 && \
D_ASSERT( (r)->w >= 0 ); \ (r)->h >= 0))
D_ASSERT( (r)->h >= 0 ); \
} while (0)
#define DFB_RECTANGLE_ASSERT_IF(r) \ #define DFB_RECT_FORMAT "%4d,%4d-%4dx%4d"
do { \
if ((r) != NULL) { \
D_ASSERT( (r)->w >= 0 ); \
D_ASSERT( (r)->h >= 0 ); \
} \
} while (0)
#define DFB_RECTANGLE_VALS(r) (r)->x, (r)->y, (r)->w, (r)->h #define DFB_RECTANGLE_VALS(r) (r)->x, (r)->y, (r)-
#define DFB_RECTANGLE_VALS_FROM_REGION(r) (r)->x1, (r)->y1, (r)->x2-(r)- >w, (r)->h
>x1+1, (r)->y2-(r)->y1+1
#define DFB_RECTANGLE_INIT_FROM_REGION(r) (DFBRectangle){ DFB_RECTANGLE_
VALS_FROM_REGION(r) }
#define DFB_RECTANGLE_CONTAINS_POINT(r,X,Y) (((X) >= (r)->x) && ((X) < (r)
->x + (r)->w) && \
((Y) >= (r)->y) && ((Y) < (r)
->y + (r)->h))
#define DFB_RECTANGLES_DEBUG_AT( Domain, rects, num ) #define DFB_RECTANGLE_EMPTY(r) ((r)->w == 0 || (r)-
\ >h == 0)
do { #define DFB_RECTANGLE_FULL(r) (!DFB_RECTANGLE_EMPT
\ Y(r))
unsigned int i;
\
\
for (i=0; i<(num); i++)
\
D_DEBUG_AT( Domain, " -> [%2d] %4d,%4d-%4dx%4d\n", i, DFB_R
ECTANGLE_VALS(&(rects)[i]) ); \
} while (0)
#define DFB_TRIANGLE_VALS(t) (t)->x1, (t)->y1, (t)->x2, (t) #define DFB_RECTANGLE_VALS_FROM_DIMENSION(d) 0, 0, (d)->w, (d)->h
->y2, (t)->x3, (t)->y3 #define DFB_RECTANGLE_INIT_FROM_DIMENSION(d) (DFBRectangle){ DFB_
RECTANGLE_VALS_FROM_DIMENSION(d) }
#define DFB_COLORKEY_VALS(c) (c)->r, (c)->g, (c)->b, (c)->i #define DFB_RECTANGLE_VALS_FROM_DIMENSION_VALS(w,h) 0, 0, (w), (h)
ndex #define DFB_RECTANGLE_INIT_FROM_DIMENSION_VALS(w,h) (DFBRectangle){ DFB_
RECTANGLE_VALS_FROM_DIMENSION_VALS(w,h) }
#define DFB_RECTANGLE_VALS_FROM_REGION(r) (r)->x1, (r)->y1, (r
)->x2-(r)->x1+1, (r)->y2-(r)->y1+1
#define DFB_RECTANGLE_INIT_FROM_REGION(r) (DFBRectangle){ DFB_
RECTANGLE_VALS_FROM_REGION(r) }
#define DFB_RECTANGLE_VALS_FROM_REGION_TRANSLATED(r,x,y) (r)->x1 + (x),
(r)->y1 + (y), (r)->x2-(r)->x1+1, (r)->y2-(r)->y1+1
#define DFB_RECTANGLE_INIT_FROM_REGION_TRANSLATED(r,x,y) (DFBRectangle){
DFB_RECTANGLE_VALS_FROM_REGION_TRANSLATED(r,x,y) }
#define DFB_RECTANGLE_VALS_FROM_BOX(b) (b)->x1, (b)->y1, (b
)->x2-(b)->x1, (b)->y2-(b)->y1
#define DFB_RECTANGLE_INIT_FROM_BOX(b) (DFBRectangle){ DFB_
RECTANGLE_VALS_FROM_BOX(b) }
#define DFB_RECTANGLE_VALS_FROM_BOX_TRANSLATED(b,x,y) (b)->x1 + (x), (b)->
y1 + (y), (b)->x2-(b)->x1, (b)->y2-(b)->y1
#define DFB_RECTANGLE_INIT_FROM_BOX_TRANSLATED(b,x,y) (DFBRectangle){ DFB_
RECTANGLE_VALS_FROM_BOX_TRANSLATED(b,x,y) }
#define DFB_RECTANGLE_VALS_FROM_BOX_VALS(x1,y1,x2,y2) (b)->x1, (b)->y1, (b
)->x2-(b)->x1, (b)->y2-(b)->y1
#define DFB_RECTANGLE_INIT_FROM_BOX_VALS(x1,y1,x2,y2) (DFBRectangle){ DFB_
RECTANGLE_VALS_FROM_BOX_VALS(x1,y1,x2,y2) }
#define DFB_RECTANGLE_CONTAINS_POINT(r,X,Y) (((X) >= (r)->x) &&
((X) < (r)->x + (r)->w) && \
((Y) >= (r)->y) &&
((Y) < (r)->y + (r)->h))
/**************************************************************************
********************************************/
#define DFB_REGION_CHECK(r) \ #define DFB_REGION_CHECK(r) \
((r) != NULL && \ ((r) != NULL && \
(r)->x1 <= (r)->x2 && \ (r)->x1 <= (r)->x2 && \
(r)->y1 <= (r)->y2) (r)->y1 <= (r)->y2)
#define DFB_REGION_CHECK_IF(r) \ #define DFB_REGION_CHECK_IF(r) \
((r) == NULL || \ ((r) == NULL || \
((r)->x1 <= (r)->x2 && \ ((r)->x1 <= (r)->x2 && \
(r)->y1 <= (r)->y2)) (r)->y1 <= (r)->y2))
#define DFB_REGION_ASSERT(r) \ #define DFB_REGION_FORMAT "%4d,%4d-%4d,%4d"
do { \
D_ASSERT( (r) != NULL ); \ #define DFB_REGION_VALS(r) (r)->x1, (r)->y1, (r
D_ASSERT( (r)->x1 <= (r)->x2 ); \ )->x2, (r)->y2
D_ASSERT( (r)->y1 <= (r)->y2 ); \
#define DFB_REGION_VALS_FROM_DIMENSION(d) 0, 0, (d)->w-1, (d)-
>h-1
#define DFB_REGION_INIT_FROM_DIMENSION(d) (DFBRegion){ DFB_REG
ION_VALS_FROM_DIMENSION(d) }
#define DFB_REGION_VALS_FROM_RECTANGLE(r) (r)->x, (r)->y, (r)-
>x+(r)->w-1, (r)->y+(r)->h-1
#define DFB_REGION_INIT_FROM_RECTANGLE(r) (DFBRegion){ DFB_REG
ION_VALS_FROM_RECTANGLE(r) }
#define DFB_REGION_VALS_FROM_RECTANGLE_VALS(x,y,w,h) (x), (y), (x)+(w)-1,
(y)+(h)-1
#define DFB_REGION_INIT_FROM_RECTANGLE_VALS(x,y,w,h) (DFBRegion){ DFB_REG
ION_VALS_FROM_RECTANGLE_VALS(x,y,w,h) }
#define DFB_REGION_VALS_FROM_BOX(b) (b)->x1, (b)->y1, (b
)->x2-1, (b)->y2-1
#define DFB_REGION_INIT_FROM_BOX(b) (DFBRegion){ DFB_REG
ION_VALS_FROM_BOX(b) }
#define DFB_REGION_VALS_TRANSLATED(r,x,y) (r)->x1 + x, (r)->y1
+ y, (r)->x2 + x, (r)->y2 + y
#define DFB_REGION_INIT_TRANSLATED(r,x,y) (DFBRegion){ DFB_REG
ION_VALS_TRANSLATED(r,x,y) }
#define DFB_REGION_VALS_INTERSECTED(r,X1,Y1,X2,Y2) (r)->x1 > (X1) ? (r)
->x1 : (X1), \
(r)->y1 > (Y1) ? (r)
->y1 : (Y1), \
(r)->x2 < (X2) ? (r)
->x2 : (X2), \
(r)->y2 < (Y2) ? (r)
->y2 : (Y2)
#define DFB_REGION_INIT_INTERSECTED(r,X1,Y1,X2,Y2) (DFBRegion){ DFB_REG
ION_VALS_INTERSECTED(r,X1,Y1,X2,Y2) }
#define DFB_REGION_CONTAINS_POINT(r,X,Y) (((X) >= (r)->x1) &&
((X) <= (r)->x2) && \
((Y) >= (r)->y1) &&
((Y) <= (r)->y2))
/**************************************************************************
********************************************/
#define DFB_BOX_CHECK(b) \
((b) != NULL && \
(b)->x1 <= (b)->x2 && \
(b)->y1 <= (b)->y2)
#define DFB_BOX_CHECK_IF(r) \
((b) == NULL || \
((b)->x1 <= (b)->x2 && \
(b)->y1 <= (b)->y2))
#define DFB_BOX_VALS(b) (b)->x1, (b)->y1, (b
)->x2, (b)->y2
#define DFB_BOX_INIT(x1,y1,x2,y2) (DFBBox){ x1, y1, x2
, y2 }
#define DFB_BOX_WIDTH(b) ((b)->x2 - (b)->x1)
#define DFB_BOX_HEIGHT(b) ((b)->y2 - (b)->y1)
#define DFB_BOX_SIZE(b) (DFB_BOX_WIDTH(b) *
DFB_BOX_HEIGHT(b))
#define DFB_BOX_EQUAL(b1,b2) (((b1) == (b2)) || (
(b1)->x1 == (b2)->x1 && (b1)->y1 == (b2)->y1 && (b1)->x2 == (b2)->x2 && (b
1)->y2 == (b2)->y2 ))
#define DFB_BOX_EMPTY(b) ((b)->x1 == (b)->x2
|| (b)->y1 == (b)->y2)
#define DFB_BOX_FULL(b) (!DFB_BOX_EMPTY(b))
#define DFB_BOX_RESET(b) do { (b)->x2 = (b)->
x1; (b)->y2 = (b)->y1; } while (0)
#define DFB_BOX_VALS_FROM_DIMENSION(d) 0, 0, (d)->w, (d)->h
#define DFB_BOX_INIT_FROM_DIMENSION(d) (DFBBox){ DFB_BOX_VA
LS_FROM_DIMENSION(d) }
#define DFB_BOX_VALS_FROM_DIMENSION_VALS(w,h) 0, 0, (w), (h)
#define DFB_BOX_INIT_FROM_DIMENSION_VALS(w,h) (DFBBox){ DFB_BOX_VA
LS_FROM_DIMENSION_VALS(w,h) }
#define DFB_BOX_VALS_FROM_RECTANGLE(r) (r)->x, (r)->y, (r)-
>x+(r)->w, (r)->y+(r)->h
#define DFB_BOX_INIT_FROM_RECTANGLE(r) (DFBBox){ DFB_BOX_VA
LS_FROM_RECTANGLE(r) }
#define DFB_BOX_VALS_FROM_RECTANGLE_VALS(x,y,w,h) (x), (y), (x)+(w), (
y)+(h)
#define DFB_BOX_INIT_FROM_RECTANGLE_VALS(X,Y,W,H) (DFBBox){ DFB_BOX_VA
LS_FROM_RECTANGLE_VALS(X,Y,W,H) }
#define DFB_BOX_VALS_FROM_REGION(r) (r)->x1, (r)->y1, (r
)->x2+1, (r)->y2+1
#define DFB_BOX_INIT_FROM_REGION(r) (DFBBox){ DFB_BOX_VA
LS_FROM_REGION(r) }
#define DFB_BOX_VALS_TRANSLATED(b,x,y) (b)->x1 + x, (b)->y1
+ y, (b)->x2 + x, (b)->y2 + y
#define DFB_BOX_INIT_TRANSLATED(b,x,y) (DFBBox){ DFB_BOX_VA
LS_TRANSLATED(b,x,y) }
#define DFB_BOX_VALS_AT_ZERO(b) 0, 0, DFB_BOX_WIDTH(
b), DFB_BOX_HEIGHT(b)
#define DFB_BOX_INIT_AT_ZERO(b) (DFBBox){ DFB_BOX_VA
LS_AT_ZERO(b) }
/**************************************************************************
********************************************/
#define DFB_DIMENSION_VALS(d) (d)->w, (d)->h
#define DFB_DIMENSION_INIT(w,h) (DFBDimension){ w, h
}
#define DFB_DIMENSION_VALS_FROM_BOX(b) DFB_BOX_WIDTH(b), DF
B_BOX_HEIGHT(b)
#define DFB_DIMENSION_INIT_FROM_BOX(b) (DFBDimension){ DFB_
DIMENSION_VALS_FROM_BOX(b) }
/**************************************************************************
********************************************/
/**************************************************************************
********************************************/
#define DFB_LINE_VALS(l) (l)->x1, (l)->y1, (l
)->x2, (l)->y2
/**************************************************************************
********************************************/
#define DFB_POINT_VALS(p) (p)->x, (p)->y
#define DFB_POINT_INIT(x,y) (DFBPoint){ x, y }
#define DFB_POINT_VALS_FROM_BOX(b) (b)->x1, (b)->y1
#define DFB_POINT_INIT_FROM_BOX(b) (DFBPoint){ DFB_POIN
T_VALS_FROM_BOX(b) }
/**************************************************************************
********************************************/
#define DFB_TRIANGLE_FORMAT "%4d,%4d-%4d,%4d-%4d
,%4d"
#define DFB_TRIANGLE_VALS(t) (t)->x1, (t)->y1, (t
)->x2, (t)->y2, (t)->x3, (t)->y3
#define DFB_TRIANGLE_INIT(x1,y1,x2,y2,x3,y3) (DFBTriangle){ x1, y
1, x2, y2, x3, y3 }
/**************************************************************************
********************************************/
#define DFB_SPAN_VALS(s) (s)->x, (s)->w
#define DFB_SPAN_INIT(x,w) (DFBSpan){ x, w }
#define DFB_SPAN_VALS_AT(s,y) (s)->x, y, (s)->w
/**************************************************************************
********************************************/
#define DFB_COLOR_FORMAT "%02x %02x %02x %02x
"
#define DFB_COLOR_VALS(c) (c)->a, (c)->r, (c)-
>g, (c)->b
#define DFB_COLOR_INIT(a,r,g,b) (DFBColor){ a, r, g,
b }
/**************************************************************************
********************************************/
#define DFB_COLORKEY_VALS(c) (c)->r, (c)->g, (c)-
>b, (c)->index
#define DFB_COLORKEY_INIT(r,g,b,index) (DFBColorKey){ r, g,
b, index }
/**************************************************************************
********************************************/
/**************************************************************************
********************************************/
#if D_DEBUG_ENABLED
#define DFB_RECTANGLE_ASSERT(r)
\
do {
\
D_ASSERT( (r) != NULL );
\
D_ASSERT( (r)->w >= 0 );
\
D_ASSERT( (r)->h >= 0 );
\
} while (0) } while (0)
#define DFB_REGION_ASSERT_IF(r) \ #define DFB_RECTANGLE_ASSERT_IF(r)
do { \ \
if ((r) != NULL) { \ do {
D_ASSERT( (r)->x1 <= (r)->x2 ); \ \
D_ASSERT( (r)->y1 <= (r)->y2 ); \ if ((r) != NULL) {
} \ \
D_ASSERT( (r)->w >= 0 );
\
D_ASSERT( (r)->h >= 0 );
\
}
\
} while (0) } while (0)
#define DFB_REGION_VALS(r) (r)->x1, (r)->y1, (r)->x2, (r) #define DFB_REGION_ASSERT(r)
->y2 \
do {
\
D_ASSERT( (r) != NULL );
\
D_ASSERT( (r)->x1 <= (r)->x2 );
\
D_ASSERT( (r)->y1 <= (r)->y2 );
\
} while (0)
#define DFB_REGION_VALS_FROM_DIMENSION(d) 0, 0, (d)->w-1, (d)->h-1 #define DFB_REGION_ASSERT_IF(r)
#define DFB_REGION_INIT_FROM_DIMENSION(d) (DFBRegion){ DFB_REGION_VALS_F \
ROM_DIMENSION(d) } do {
\
if ((r) != NULL) {
\
D_ASSERT( (r)->x1 <= (r)->x2 );
\
D_ASSERT( (r)->y1 <= (r)->y2 );
\
}
\
} while (0)
#define DFB_REGION_VALS_FROM_RECTANGLE(r) (r)->x, (r)->y, (r)->x+(r)->w- #define DFB_BOX_ASSERT(b)
1, (r)->y+(r)->h-1 \
#define DFB_REGION_INIT_FROM_RECTANGLE(r) (DFBRegion){ DFB_REGION_VALS_F do {
ROM_RECTANGLE(r) } \
D_ASSERT( (b) != NULL );
\
D_ASSERT( (b)->x1 <= (b)->x2 );
\
D_ASSERT( (b)->y1 <= (b)->y2 );
\
} while (0)
#define DFB_REGION_VALS_FROM_RECTANGLE_VALS(x,y,w,h) (x), (y), (x)+(w)-1, #define DFB_BOX_ASSERT_IF(b)
(y)+(h)-1 \
#define DFB_REGION_INIT_FROM_RECTANGLE_VALS(x,y,w,h) (DFBRegion){ DFB_REG do {
ION_VALS_FROM_RECTANGLE_VALS(x,y,w,h) } \
if ((b) != NULL) {
\
D_ASSERT( (b)->x1 <= (b)->x2 );
\
D_ASSERT( (b)->y1 <= (b)->y2 );
\
}
\
} while (0)
#define DFB_REGION_VALS_TRANSLATED(r,x,y) (r)->x1 + x, (r)->y1 + y, (r)- #define DFB_RECTANGLES_DEBUG_AT( Domain, rects, num )
>x2 + x, (r)->y2 + y \
#define DFB_REGION_INIT_TRANSLATED(r,x,y) (DFBRegion){ DFB_REGION_VALS_T do {
RANSLATED(r,x,y) } \
unsigned int i;
\
\
for (i=0; i<(num); i++)
\
D_DEBUG_AT( Domain, " -> [%3d] %4d,%4d-%4dx%4d\n", i, DFB_R
ECTANGLE_VALS(&(rects)[i]) ); \
} while (0)
#define DFB_REGION_VALS_INTERSECTED(r,X1,Y1,X2,Y2) (r)->x1 > (X1) ? (r)-> #define DFB_RECTANGLES2_DEBUG_AT( Domain, rects, rects2, num )
x1 : (X1), \ \
(r)->y1 > (Y1) ? (r)-> do {
y1 : (Y1), \ \
(r)->x2 < (X2) ? (r)-> unsigned int i;
x2 : (X2), \ \
(r)->y2 < (Y2) ? (r)->
y2 : (Y2) \
#define DFB_REGION_INIT_INTERSECTED(r,X1,Y1,X2,Y2) (DFBRegion){ DFB_REGIO for (i=0; i<(num); i++)
N_VALS_INTERSECTED(r,X1,Y1,X2,Y2) } \
D_DEBUG_AT( Domain, " -> [%3d] %4d,%4d-%4dx%4d <- %4d,%4d-%
4dx%4d\n", i, \
DFB_RECTANGLE_VALS(&(rects)[i]), DFB_REC
TANGLE_VALS(&(rects2)[i]) ); \
} while (0)
#define DFB_REGION_CONTAINS_POINT(r,X,Y) (((X) >= (r)->x1) && ((X) <= ( #define DFB_RECTANGLES_POINTS_DEBUG_AT( Domain, rects, points, num )
r)->x2) && \ \
((Y) >= (r)->y1) && ((Y) <= ( do {
r)->y2)) \
unsigned int i;
\
\
for (i=0; i<(num); i++)
\
D_DEBUG_AT( Domain, " -> [%3d] %4d,%4d-%4dx%4d <- %4d,%4d\n
", i, \
DFB_RECTANGLE_VALS(&(rects)[i]), DFB_POI
NT_VALS(&(points)[i]) ); \
} while (0)
#define DFB_REGIONS_DEBUG_AT( Domain, regions, num ) \ #define DFB_BOXES2_DEBUG_AT( Domain, boxes, boxes2, num ) \
do { \ do { \
unsigned int i; \ unsigned int i; \
\ \
for (i=0; i<(num); i++) \ for (i=0; i<(num); i++) \
D_DEBUG_AT( Domain, " -> [%2d] %4d,%4d-%4d,%4d\n", i, DFB_R D_DEBUG_AT( Domain, " -> [%3d] %4d,%4d-%4dx%4d <- %4d,%4d-%
EGION_VALS(&(regions)[i]) ); \ 4dx%4d\n", i, \
DFB_RECTANGLE_VALS_FROM_BOX(&(boxes)[i])
, DFB_RECTANGLE_VALS_FROM_BOX(&(boxes2)[i]) ); \
} while (0) } while (0)
static inline void dfb_rectangle_from_region( DFBRectangle *rect, #define DFB_REGIONS_LOG( Domain, LEVEL, regs, num )
const DFBRegion *region ) \
do {
\
unsigned int i;
\
\
for (i=0; i<(num); i++)
\
D_DEBUG_AT( Domain, " -> [%3d] %4d,%4d-%4dx%4d\n", i, DFB_R
ECTANGLE_VALS_FROM_REGION(&((regs)[i])) );\
} while (0)
#define DFB_REGIONS_DEBUG_AT( Domain, regs, num )
\
DFB_REGIONS_LOG( Domain, DEBUG, regs, num )
\
#define DFB_BOXES_LOG( Domain, _LEVEL, boxes, num )
\
do {
\
unsigned int i;
\
\
for (i=0; i<(num); i++)
\
D_LOG( Domain, _LEVEL, " -> [%3d] %4d,%4d-%4dx%4d\n", i, DF
B_RECTANGLE_VALS_FROM_BOX(&(boxes)[i]) );\
} while (0)
#define DFB_BOXES_DEBUG_AT( Domain, boxes, num )
\
do {
\
DFB_BOXES_LOG( Domain, DEBUG, boxes, num );
\
} while (0)
#define DFB_LINES_DEBUG_AT( Domain, lines, num )
\
do {
\
unsigned int i;
\
\
for (i=0; i<(num); i++)
\
D_DEBUG_AT( Domain, " -> [%3d] %4d,%4d-%4d,%4d\n", i, DFB_L
INE_VALS(&(lines)[i]) ); \
} while (0)
#define DFB_POINTS_DEBUG_AT( Domain, points, num )
\
do {
\
unsigned int i;
\
\
for (i=0; i<(num); i++)
\
D_DEBUG_AT( Domain, " -> [%3d] %4d,%4d\n", i, DFB_POINT_VAL
S(&(points)[i]) ); \
} while (0)
#define DFB_TRIANGLES_DEBUG_AT( Domain, tris, num )
\
do {
\
unsigned int i;
\
\
for (i=0; i<(num); i++)
\
D_DEBUG_AT( Domain, " -> [%3d] %4d,%4d-%4d,%4d-%4d,%4d\n",
i, DFB_TRIANGLE_VALS(&(tris)[i]) );\
} while (0)
#define DFB_SPANS_DEBUG_AT( Domain, spans, num, y )
\
do {
\
unsigned int i;
\
\
for (i=0; i<(num); i++)
\
D_DEBUG_AT( Domain, " -> [%3d] %4d,%4d-%4d\n", i, DFB_SPAN_
VALS_AT(&(spans)[i],y+i) ); \
} while (0)
#else
#define DFB_RECTANGLE_ASSERT(r)
\
do {
\
} while (0)
#define DFB_RECTANGLE_ASSERT_IF(r)
\
do {
\
} while (0)
#define DFB_REGION_ASSERT(r)
\
do {
\
} while (0)
#define DFB_REGION_ASSERT_IF(r)
\
do {
\
} while (0)
#define DFB_BOX_ASSERT(b)
\
do {
\
} while (0)
#define DFB_BOX_ASSERT_IF(b)
\
do {
\
} while (0)
#define DFB_RECTANGLES_DEBUG_AT( Domain, rects, num )
\
do {
\
} while (0)
#define DFB_RECTANGLES2_DEBUG_AT( Domain, rects, rects2, num )
\
do {
\
} while (0)
#define DFB_RECTANGLES_POINTS_DEBUG_AT( Domain, rects, points, num )
\
do {
\
} while (0)
#define DFB_REGIONS_DEBUG_AT( Domain, regs, num )
\
do {
\
} while (0)
#define DFB_BOXES_LOG( Domain, _LEVEL, boxes, num )
\
do {
\
} while (0)
#define DFB_BOXES_DEBUG_AT( Domain, boxes, num )
\
do {
\
} while (0)
#define DFB_LINES_DEBUG_AT( Domain, lines, num )
\
do {
\
} while (0)
#define DFB_POINTS_DEBUG_AT( Domain, points, num )
\
do {
\
} while (0)
#define DFB_TRIANGLES_DEBUG_AT( Domain, tris, num )
\
do {
\
} while (0)
#define DFB_SPANS_DEBUG_AT( Domain, spans, num, y )
\
do {
\
} while (0)
#endif
/**************************************************************************
********************************************/
/**************************************************************************
********************************************/
static __inline__ void
dfb_rectangle_from_region( DFBRectangle *rect,
const DFBRegion *region )
{ {
D_ASSERT( rect != NULL ); D_ASSERT( rect != NULL );
DFB_REGION_ASSERT( region ); DFB_REGION_ASSERT( region );
rect->x = region->x1; rect->x = region->x1;
rect->y = region->y1; rect->y = region->y1;
rect->w = region->x2 - region->x1 + 1; rect->w = region->x2 - region->x1 + 1;
rect->h = region->y2 - region->y1 + 1; rect->h = region->y2 - region->y1 + 1;
} }
static inline void dfb_rectangle_from_rectangle_plus_insets( DFBRectangle static __inline__ void
*rect, dfb_rectangle_from_box( DFBRectangle *rect,
const DFBRecta const DFBBox *box )
ngle *inner,
const DFBInset
s *insets )
{ {
D_ASSERT( rect != NULL ); D_ASSERT( rect != NULL );
D_ASSERT( insets != NULL ); DFB_BOX_ASSERT( box );
rect->x = box->x1;
rect->y = box->y1;
rect->w = box->x2 - box->x1;
rect->h = box->y2 - box->y1;
}
static __inline__ void
dfb_rectangle_from_rectangle_plus_insets( DFBRectangle *rect,
const DFBRectangle *inner,
const DFBInsets *insets )
{
D_ASSERT( rect != NULL );
DFB_RECTANGLE_ASSERT( inner ); DFB_RECTANGLE_ASSERT( inner );
D_ASSERT( insets != NULL );
rect->x = inner->x - insets->l; rect->x = inner->x - insets->l;
rect->y = inner->y - insets->t; rect->y = inner->y - insets->t;
rect->w = inner->w + insets->l + insets->r; rect->w = inner->w + insets->l + insets->r;
rect->h = inner->h + insets->t + insets->b; rect->h = inner->h + insets->t + insets->b;
} }
static inline void dfb_region_from_rectangle( DFBRegion *region, static __inline__ void
const DFBRectangle *rect ) dfb_rectangle_from_rotated( DFBRectangle *rectangle,
const DFBRectangle *from,
const DFBDimension *size,
int rotation )
{
D_ASSERT( rectangle != NULL );
DFB_RECTANGLE_ASSERT( from );
D_ASSERT( size != NULL );
D_ASSERT( size->w > 0 );
D_ASSERT( size->h > 0 );
D_ASSUME( rotation == 0 || rotation == 90 || rotation == 180 || rotati
on == 270 );
switch (rotation) {
default:
D_BUG( "invalid rotation %d", rotation );
case 0:
*rectangle = *from;
break;
case 90:
rectangle->x = from->y;
rectangle->y = size->w - from->x - from->w;
rectangle->w = from->h;
rectangle->h = from->w;
break;
case 180:
rectangle->x = size->w - from->x - from->w;
rectangle->y = size->h - from->y - from->h;
rectangle->w = from->w;
rectangle->h = from->h;
break;
case 270:
rectangle->x = size->h - from->y - from->h;
rectangle->y = from->x;
rectangle->w = from->h;
rectangle->h = from->w;
break;
}
DFB_RECTANGLE_ASSERT( rectangle );
}
/**************************************************************************
********************************************/
static __inline__ void
dfb_rectangle_translate( DFBRectangle *rect,
int dx,
int dy )
{
DFB_RECTANGLE_ASSERT( rect );
rect->x += dx;
rect->y += dy;
}
static __inline__ void
dfb_rectangle_resize( DFBRectangle *rect,
int width,
int height )
{
DFB_RECTANGLE_ASSERT( rect );
D_ASSERT( width >= 0 );
D_ASSERT( height >= 0 );
rect->w = width;
rect->h = height;
}
/**************************************************************************
********************************************/
static __inline__ bool
dfb_rectangle_region_intersects( const DFBRectangle *rect,
const DFBRegion *region )
{
DFB_RECTANGLE_ASSERT( rect );
DFB_REGION_ASSERT( region );
return (rect->x <= region->x2 &&
rect->y <= region->y2 &&
rect->x + rect->w > region->x1 &&
rect->y + rect->h > region->y1);
}
static __inline__ bool
dfb_rectangle_box_intersect( DFBRectangle *rect,
const DFBBox *box )
{
DFB_RECTANGLE_ASSERT( rect );
DFB_BOX_ASSERT( box );
if (DFB_BOX_EMPTY( box ) ||
box->x2 <= rect->x ||
box->y2 <= rect->y ||
box->x1 >= rect->x + rect->w ||
box->y1 >= rect->y + rect->h)
{
rect->w = rect->h = 0;
return false;
}
if (rect->x < box->x1) {
rect->w -= box->x1 - rect->x;
rect->x = box->x1;
}
if (rect->y < box->y1) {
rect->h -= box->y1 - rect->y;
rect->y = box->y1;
}
if (rect->x + rect->w > box->x2)
rect->w = box->x2 - rect->x;
if (rect->y + rect->h > box->y2)
rect->h = box->y2 - rect->y;
return true;
}
static __inline__ void
dfb_rectangle_subtract( DFBRectangle *rect,
const DFBInsets *insets )
{
D_ASSERT( rect != NULL );
D_ASSERT( insets != NULL );
rect->x += insets->l;
rect->y += insets->t;
rect->w -= insets->l + insets->r;
rect->h -= insets->t + insets->b;
if (rect->w <= 0 || rect->h <= 0)
rect->w = rect->h = 0;
}
/**************************************************************************
********************************************/
/**************************************************************************
********************************************/
static __inline__ void
dfb_region_from_rectangle( DFBRegion *region,
const DFBRectangle *rect )
{ {
D_ASSERT( region != NULL ); D_ASSERT( region != NULL );
DFB_RECTANGLE_ASSERT( rect ); DFB_RECTANGLE_ASSERT( rect );
D_ASSERT( rect->w > 0 ); D_ASSERT( rect->w > 0 );
D_ASSERT( rect->h > 0 ); D_ASSERT( rect->h > 0 );
region->x1 = rect->x; region->x1 = rect->x;
region->y1 = rect->y; region->y1 = rect->y;
region->x2 = rect->x + rect->w - 1; region->x2 = rect->x + rect->w - 1;
region->y2 = rect->y + rect->h - 1; region->y2 = rect->y + rect->h - 1;
} }
void dfb_region_from_rotated( DFBRegion *region, static __inline__ void
const DFBRegion *from, dfb_region_from_rectangle_translated( DFBRegion *region,
const DFBDimension *size, const DFBRectangle *rect,
int rotation ); const DFBPoint *offset )
{
D_ASSERT( region != NULL );
D_ASSERT( offset != NULL );
void dfb_rectangle_from_rotated( DFBRectangle *rectangle, DFB_RECTANGLE_ASSERT( rect );
const DFBRectangle *from,
const DFBDimension *size,
int rotation );
void dfb_point_from_rotated_region( DFBPoint *point, D_ASSERT( rect->w > 0 );
const DFBRegion *from, D_ASSERT( rect->h > 0 );
const DFBDimension *size,
int rotation );
static inline void dfb_rectangle_translate( DFBRectangle *rect, region->x1 = offset->x + rect->x;
int dx, region->y1 = offset->y + rect->y;
int dy ) region->x2 = offset->x + rect->x + rect->w - 1;
region->y2 = offset->y + rect->y + rect->h - 1;
}
static __inline__ void
dfb_region_from_rotated( DFBRegion *region,
const DFBRegion *from,
const DFBDimension *size,
int rotation )
{ {
DFB_RECTANGLE_ASSERT( rect ); D_ASSERT( region != NULL );
rect->x += dx; DFB_REGION_ASSERT( from );
rect->y += dy; D_ASSERT( size != NULL );
D_ASSERT( size->w > 0 );
D_ASSERT( size->h > 0 );
D_ASSUME( rotation == 0 || rotation == 90 || rotation == 180 || rotati
on == 270 );
switch (rotation) {
default:
D_BUG( "invalid rotation %d", rotation );
case 0:
*region = *from;
break;
case 90:
region->x1 = from->y1;
region->y1 = size->w - from->x2 - 1;
region->x2 = from->y2;
region->y2 = size->w - from->x1 - 1;
break;
case 180:
region->x1 = size->w - from->x2 - 1;
region->y1 = size->h - from->y2 - 1;
region->x2 = size->w - from->x1 - 1;
region->y2 = size->h - from->y1 - 1;
break;
case 270:
region->x1 = size->h - from->y2 - 1;
region->y1 = from->x1;
region->x2 = size->h - from->y1 - 1;
region->y2 = from->x2;
break;
}
DFB_REGION_ASSERT( region );
} }
static inline void dfb_region_translate( DFBRegion *region, /**************************************************************************
int dx, ********************************************/
int dy )
static __inline__ void
dfb_region_translate( DFBRegion *region,
int dx,
int dy )
{ {
DFB_REGION_ASSERT( region ); DFB_REGION_ASSERT( region );
region->x1 += dx; region->x1 += dx;
region->y1 += dy; region->y1 += dy;
region->x2 += dx; region->x2 += dx;
region->y2 += dy; region->y2 += dy;
} }
static inline void dfb_rectangle_resize( DFBRectangle *rect, static __inline__ void
int width, dfb_region_resize( DFBRegion *region,
int height ) int width,
{ int height )
DFB_RECTANGLE_ASSERT( rect );
D_ASSERT( width >= 0 );
D_ASSERT( height >= 0 );
rect->w = width;
rect->h = height;
}
static inline void dfb_region_resize( DFBRegion *region,
int width,
int height )
{ {
DFB_REGION_ASSERT( region ); DFB_REGION_ASSERT( region );
D_ASSERT( width >= 0 ); D_ASSERT( width >= 0 );
D_ASSERT( height >= 0 ); D_ASSERT( height >= 0 );
region->x2 = region->x1 + width - 1; region->x2 = region->x1 + width - 1;
region->y2 = region->y1 + height - 1; region->y2 = region->y1 + height - 1;
} }
static inline bool dfb_region_intersects( const DFBRegion *region, /**************************************************************************
int x1, ********************************************/
int y1,
int x2, static __inline__ bool
int y2 ) dfb_region_intersects( const DFBRegion *region,
int x1,
int y1,
int x2,
int y2 )
{ {
DFB_REGION_ASSERT( region ); DFB_REGION_ASSERT( region );
D_ASSERT( x1 <= x2 ); D_ASSERT( x1 <= x2 );
D_ASSERT( y1 <= y2 ); D_ASSERT( y1 <= y2 );
return (region->x1 <= x2 && return (region->x1 <= x2 &&
region->y1 <= y2 && region->y1 <= y2 &&
region->x2 >= x1 && region->x2 >= x1 &&
region->y2 >= y1); region->y2 >= y1);
} }
static inline bool dfb_region_region_intersects( const DFBRegion *region, static __inline__ bool
const DFBRegion *other ) dfb_region_region_intersects( const DFBRegion *region,
const DFBRegion *other )
{ {
DFB_REGION_ASSERT( region ); DFB_REGION_ASSERT( region );
DFB_REGION_ASSERT( other ); DFB_REGION_ASSERT( other );
return (region->x1 <= other->x2 && return (region->x1 <= other->x2 &&
region->y1 <= other->y2 && region->y1 <= other->y2 &&
region->x2 >= other->x1 && region->x2 >= other->x1 &&
region->y2 >= other->y1); region->y2 >= other->y1);
} }
static inline bool dfb_region_region_extends( const DFBRegion *a, static __inline__ bool
const DFBRegion *b ) dfb_region_intersect( DFBRegion *region,
int x1, int y1, int x2, int y2 )
{
if (region->x2 < x1 ||
region->y2 < y1 ||
region->x1 > x2 ||
region->y1 > y2)
return false;
if (region->x1 < x1)
region->x1 = x1;
if (region->y1 < y1)
region->y1 = y1;
if (region->x2 > x2)
region->x2 = x2;
if (region->y2 > y2)
region->y2 = y2;
return true;
}
static __inline__ bool
dfb_region_region_intersect( DFBRegion *region,
const DFBRegion *clip )
{
if (region->x2 < clip->x1 ||
region->y2 < clip->y1 ||
region->x1 > clip->x2 ||
region->y1 > clip->y2)
return false;
if (region->x1 < clip->x1)
region->x1 = clip->x1;
if (region->y1 < clip->y1)
region->y1 = clip->y1;
if (region->x2 > clip->x2)
region->x2 = clip->x2;
if (region->y2 > clip->y2)
region->y2 = clip->y2;
return true;
}
/**************************************************************************
********************************************/
static __inline__ bool
dfb_region_region_contains( const DFBRegion *a,
const DFBRegion *b )
{
if (a->x1 > b->x1)
return false;
if (a->y1 > b->y1)
return false;
if (a->x2 < b->x2)
return false;
if (a->y2 < b->y2)
return false;
return true;
}
static __inline__ bool
dfb_region_region_extends( const DFBRegion *a,
const DFBRegion *b )
{ {
if (a->x1 == b->x1 && a->x2 == b->x2) if (a->x1 == b->x1 && a->x2 == b->x2)
return (a->y1 == b->y2 - 1) || (a->y2 == b->y1 - 1); return (a->y1 == b->y2 - 1) || (a->y2 == b->y1 - 1);
if (a->y1 == b->y1 && a->y2 == b->y2) if (a->y1 == b->y1 && a->y2 == b->y2)
return (a->x1 == b->x2 - 1) || (a->x2 == b->x1 - 1); return (a->x1 == b->x2 - 1) || (a->x2 == b->x1 - 1);
return false; return false;
} }
static inline void dfb_region_region_union( DFBRegion *region, static __inline__ void
const DFBRegion *other ) dfb_region_region_union( DFBRegion *region,
const DFBRegion *other )
{ {
DFB_REGION_ASSERT( region ); DFB_REGION_ASSERT( region );
DFB_REGION_ASSERT( other ); DFB_REGION_ASSERT( other );
if (region->x1 > other->x1) if (region->x1 > other->x1)
region->x1 = other->x1; region->x1 = other->x1;
if (region->y1 > other->y1) if (region->y1 > other->y1)
region->y1 = other->y1; region->y1 = other->y1;
if (region->x2 < other->x2) if (region->x2 < other->x2)
region->x2 = other->x2; region->x2 = other->x2;
if (region->y2 < other->y2) if (region->y2 < other->y2)
region->y2 = other->y2; region->y2 = other->y2;
} }
static inline bool dfb_rectangle_region_intersects( const DFBRectangle *rec static __inline__ void
t, dfb_region_clip( DFBRegion *region,
const DFBRegion *reg int x1,
ion ) int y1,
{ int x2,
DFB_RECTANGLE_ASSERT( rect ); int y2 )
DFB_REGION_ASSERT( region );
return (rect->x <= region->x2 &&
rect->y <= region->y2 &&
rect->x + rect->w > region->x1 &&
rect->y + rect->h > region->y1);
}
static inline void dfb_region_clip( DFBRegion *region,
int x1,
int y1,
int x2,
int y2 )
{ {
DFB_REGION_ASSERT( region ); DFB_REGION_ASSERT( region );
D_ASSERT( dfb_region_intersects( region, x1, y1, x2, y2 ) ); D_ASSERT( dfb_region_intersects( region, x1, y1, x2, y2 ) );
if (region->x1 < x1) if (region->x1 < x1)
region->x1 = x1; region->x1 = x1;
if (region->y1 < y1) if (region->y1 < y1)
region->y1 = y1; region->y1 = y1;
if (region->x2 > x2) if (region->x2 > x2)
region->x2 = x2; region->x2 = x2;
if (region->y2 > y2) if (region->y2 > y2)
region->y2 = y2; region->y2 = y2;
} }
static inline void dfb_rectangle_subtract( DFBRectangle *rect, /**************************************************************************
const DFBInsets *insets ) ********************************************/
/**************************************************************************
********************************************/
static __inline__ void
dfb_box_from_rectangle( DFBBox *box,
const DFBRectangle *rect )
{ {
D_ASSERT( rect != NULL ); D_ASSERT( box != NULL );
D_ASSERT( insets != NULL );
rect->x += insets->l; DFB_RECTANGLE_ASSERT( rect );
rect->y += insets->t;
rect->w -= insets->l + insets->r;
rect->h -= insets->t + insets->b;
if (rect->w <= 0 || rect->h <= 0) box->x1 = rect->x;
rect->w = rect->h = 0; box->y1 = rect->y;
box->x2 = rect->x + rect->w;
box->y2 = rect->y + rect->h;
}
static __inline__ void
dfb_box_from_rectangle_translated( DFBBox *box,
const DFBRectangle *rect,
const DFBPoint *offset )
{
D_ASSERT( box != NULL );
DFB_RECTANGLE_ASSERT( rect );
D_ASSERT( offset != NULL );
box->x1 = offset->x + rect->x;
box->y1 = offset->y + rect->y;
box->x2 = offset->x + rect->x + rect->w;
box->y2 = offset->y + rect->y + rect->h;
}
static __inline__ void
dfb_box_from_rotated( DFBBox *box,
const DFBBox *from,
const DFBDimension *size,
int rotation )
{
D_ASSERT( box != NULL );
DFB_REGION_ASSERT( from );
D_ASSERT( size != NULL );
D_ASSERT( size->w > 0 );
D_ASSERT( size->h > 0 );
D_ASSUME( rotation == 0 || rotation == 90 || rotation == 180 || rotati
on == 270 );
switch (rotation) {
default:
D_BUG( "invalid rotation %d", rotation );
case 0:
*box = *from;
break;
case 90:
box->x1 = from->y1;
box->y1 = size->w - from->x2;
box->x2 = from->y2;
box->y2 = size->w - from->x1;
break;
case 180:
box->x1 = size->w - from->x2;
box->y1 = size->h - from->y2;
box->x2 = size->w - from->x1;
box->y2 = size->h - from->y1;
break;
case 270:
box->x1 = size->h - from->y2;
box->y1 = from->x1;
box->x2 = size->h - from->y1;
box->y2 = from->x2;
break;
}
DFB_REGION_ASSERT( box );
}
/**************************************************************************
********************************************/
static __inline__ void
dfb_box_translate( DFBBox *box,
int dx,
int dy )
{
DFB_REGION_ASSERT( box );
box->x1 += dx;
box->y1 += dy;
box->x2 += dx;
box->y2 += dy;
}
static __inline__ void
dfb_box_resize( DFBBox *box,
int width,
int height )
{
DFB_REGION_ASSERT( box );
D_ASSERT( width >= 0 );
D_ASSERT( height >= 0 );
box->x2 = box->x1 + width;
box->y2 = box->y1 + height;
}
/**************************************************************************
********************************************/
static __inline__ bool
dfb_box_box_contains( const DFBBox *a,
const DFBBox *b )
{
if (a->x1 > b->x1)
return false;
if (a->y1 > b->y1)
return false;
if (a->x2 < b->x2)
return false;
if (a->y2 < b->y2)
return false;
return true;
}
static __inline__ bool
dfb_box_intersects( const DFBBox *box,
int x1,
int y1,
int x2,
int y2 )
{
DFB_BOX_ASSERT( box );
D_ASSERT( x1 <= x2 );
D_ASSERT( y1 <= y2 );
return (box->x1 < x2 &&
box->y1 < y2 &&
box->x2 > x1 &&
box->y2 > y1);
}
static __inline__ bool
dfb_box_box_intersects( const DFBBox *box,
const DFBBox *other )
{
DFB_BOX_ASSERT( box );
DFB_BOX_ASSERT( other );
return (box->x1 < other->x2 &&
box->y1 < other->y2 &&
box->x2 > other->x1 &&
box->y2 > other->y1);
} }
static __inline__ bool
dfb_box_intersect( DFBBox *box,
int x1, int y1, int x2, int y2 )
{
DFB_BOX_ASSERT( box );
D_ASSERT( x1 <= x2 );
D_ASSERT( y1 <= y2 );
if (DFB_BOX_EMPTY( box ))
return false;
if (box->x2 <= x1 ||
box->y2 <= y1 ||
box->x1 >= x2 ||
box->y1 >= y2)
return false;
if (box->x1 < x1)
box->x1 = x1;
if (box->y1 < y1)
box->y1 = y1;
if (box->x2 > x2)
box->x2 = x2;
if (box->y2 > y2)
box->y2 = y2;
return true;
}
static __inline__ bool
dfb_box_box_intersect( DFBBox *box,
const DFBBox *clip )
{
DFB_BOX_ASSERT( box );
DFB_BOX_ASSERT( clip );
if (DFB_BOX_EMPTY( box ))
return false;
if (DFB_BOX_EMPTY( clip ) ||
box->x2 <= clip->x1 ||
box->y2 <= clip->y1 ||
box->x1 >= clip->x2 ||
box->y1 >= clip->y2)
{
return false;
}
if (box->x1 < clip->x1)
box->x1 = clip->x1;
if (box->y1 < clip->y1)
box->y1 = clip->y1;
if (box->x2 > clip->x2)
box->x2 = clip->x2;
if (box->y2 > clip->y2)
box->y2 = clip->y2;
return true;
}
static __inline__ bool
dfb_box_region_intersects( const DFBBox *box,
const DFBRegion *clip )
{
DFB_BOX_ASSERT( box );
D_ASSERT( clip != NULL );
if (DFB_BOX_EMPTY( box ))
return false;
if (clip->x1 > clip->x2 ||
clip->y1 > clip->y2 ||
box->x2 <= clip->x1 ||
box->y2 <= clip->y1 ||
box->x1 > clip->x2 ||
box->y1 > clip->y2)
{
return false;
}
return true;
}
static __inline__ bool
dfb_box_region_intersect( DFBBox *box,
const DFBRegion *clip )
{
DFB_BOX_ASSERT( box );
D_ASSERT( clip != NULL );
if (DFB_BOX_EMPTY( box ))
return false;
if (clip->x1 > clip->x2 ||
clip->y1 > clip->y2 ||
box->x2 <= clip->x1 ||
box->y2 <= clip->y1 ||
box->x1 > clip->x2 ||
box->y1 > clip->y2)
{
box->x2 = box->x1;
box->y2 = box->y1;
return false;
}
if (box->x1 < clip->x1)
box->x1 = clip->x1;
if (box->y1 < clip->y1)
box->y1 = clip->y1;
if (box->x2 > clip->x2 + 1)
box->x2 = clip->x2 + 1;
if (box->y2 > clip->y2 + 1)
box->y2 = clip->y2 + 1;
return true;
}
/**************************************************************************
********************************************/
static __inline__ bool
dfb_box_box_extends( const DFBBox *a,
const DFBBox *b )
{
DFB_BOX_ASSERT( a );
DFB_BOX_ASSERT( b );
if (a->x1 == b->x1 && a->x2 == b->x2)
return (a->y1 == b->y2) || (a->y2 == b->y1);
if (a->y1 == b->y1 && a->y2 == b->y2)
return (a->x1 == b->x2) || (a->x2 == b->x1);
return false;
}
static __inline__ void
dfb_box_box_union( DFBBox *box,
const DFBBox *other )
{
DFB_BOX_ASSERT( box );
DFB_BOX_ASSERT( other );
if (DFB_BOX_EMPTY( other ))
return;
if (DFB_BOX_EMPTY( box )) {
*box = *other;
}
else {
if (box->x1 > other->x1)
box->x1 = other->x1;
if (box->y1 > other->y1)
box->y1 = other->y1;
if (box->x2 < other->x2)
box->x2 = other->x2;
if (box->y2 < other->y2)
box->y2 = other->y2;
}
}
static __inline__ void
dfb_box_region_union( DFBBox *box,
const DFBRegion *region )
{
DFB_BOX_ASSERT( box );
DFB_REGION_ASSERT( region );
if (DFB_BOX_EMPTY( box )) {
*box = DFB_BOX_INIT_FROM_REGION( region );
}
else {
if (box->x1 > region->x1)
box->x1 = region->x1;
if (box->y1 > region->y1)
box->y1 = region->y1;
if (box->x2 < region->x2 + 1)
box->x2 = region->x2 + 1;
if (box->y2 < region->y2 + 1)
box->y2 = region->y2 + 1;
}
}
static __inline__ void
dfb_box_clip( DFBBox *box,
int x1,
int y1,
int x2,
int y2 )
{
DFB_BOX_ASSERT( box );
D_ASSERT( dfb_box_intersects( box, x1, y1, x2, y2 ) );
if (box->x1 < x1)
box->x1 = x1;
if (box->y1 < y1)
box->y1 = y1;
if (box->x2 > x2)
box->x2 = x2;
if (box->y2 > y2)
box->y2 = y2;
}
/**************************************************************************
********************************************/
/**************************************************************************
********************************************/
/* /*
* Compute line segment intersection. * Compute line segment intersection.
* Return true if intersection point exists within the given segment. * Return true if intersection point exists within the given segment.
*/ */
bool dfb_line_segment_intersect( const DFBRegion *line, static __inline__ bool
const DFBRegion *seg, dfb_line_segment_intersect( const DFBRegion *line,
int *x, const DFBRegion *seg,
int *y ); int *x,
int *y )
{
int x1, x2, x3, x4;
int y1, y2, y3, y4;
int num, den;
D_ASSERT( line != NULL );
D_ASSERT( seg != NULL );
x1 = seg->x1; y1 = seg->y1; x2 = seg->y2; y2 = seg->y2;
x3 = line->x1; y3 = line->y1; x4 = line->x2; y4 = line->y2;
num = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3);
den = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
if (!den) /* parallel */
return false;
if (num && ((num < 0) != (den < 0) || abs(num) > abs(den))) /* not wit
hin segment */
return false;
if (x)
*x = (s64)(x2 - x1) * num / den + x1;
if (y)
*y = (s64)(y2 - y1) * num / den + y1;
return true;
}
/**************************************************************************
********************************************/
static __inline__ void
dfb_point_from_rotated_region( DFBPoint *point,
const DFBRegion *from,
const DFBDimension *size,
int rotation )
{
D_ASSERT( point != NULL );
DFB_REGION_ASSERT( from );
D_ASSERT( size != NULL );
D_ASSERT( size->w > 0 );
D_ASSERT( size->h > 0 );
D_ASSUME( rotation == 0 || rotation == 90 || rotation == 180 || rotati
on == 270 );
switch (rotation) {
default:
D_BUG( "invalid rotation %d", rotation );
case 0:
point->x = from->x1;
point->y = from->y1;
break;
case 90:
point->x = from->y1;
point->y = size->w - from->x2 - 1;
break;
case 180:
point->x = size->w - from->x2 - 1;
point->y = size->h - from->y2 - 1;
break;
case 270:
point->x = size->h - from->y2 - 1;
point->y = from->x1;
break;
}
D_ASSERT( point->x >= 0 );
D_ASSERT( point->y >= 0 );
D_ASSERT( point->x < size->w );
D_ASSERT( point->y < size->h );
}
static __inline__ void
dfb_point_translate( DFBPoint *point,
int dx,
int dy )
{
D_ASSERT( point != NULL );
point->x += dx;
point->y += dy;
}
/**************************************************************************
********************************************/
/**************************************************************************
********************************************/
/* /*
* Copied declaration of DFBPixelFormatName from directfb_strings.h * Copied declaration of DFBPixelFormatName from directfb_strings.h
*/ */
extern const struct DFBPixelFormatName dfb_pixelformat_names[]; extern const struct DFBPixelFormatName DIRECTFB_API dfb_pixelformat_names[]
;
extern const struct DFBColorSpaceName DIRECTFB_API dfb_colorspace_names[];
const char *dfb_input_event_type_name ( DFBInputEventType type ); const char DIRECTFB_API *dfb_input_event_type_name ( DFBInputEventType
const char *dfb_pixelformat_name ( DFBSurfacePixelFormat format ); type );
const char *dfb_window_event_type_name( DFBWindowEventType type ); const char DIRECTFB_API *dfb_pixelformat_name ( DFBSurfacePixelFormat
format );
const char DIRECTFB_API *dfb_colorspace_name ( DFBSurfaceColorSpace
colorspace );
const char DIRECTFB_API *dfb_window_event_type_name( DFBWindowEventType
type );
DFBSurfacePixelFormat DIRECTFB_API dfb_pixelformat_for_depth( int depth );
typedef struct { typedef struct {
int magic; int magic;
DFBRegion *regions; DFBRegion *regions;
int max_regions; int max_regions;
int num_regions; int num_regions;
DFBRegion bounding; DFBRegion bounding;
} DFBUpdates; } DFBUpdates;
#define DFB_UPDATES_ASSERT(updates) \ #define DFB_UPDATES_ASSERT(updates) \
do { \ do { \
D_MAGIC_ASSERT( updates, DFBUpdates ); \ D_MAGIC_ASSERT( updates, DFBUpdates ); \
D_ASSERT( (updates)->regions != NULL ); \ D_ASSERT( (updates)->regions != NULL ); \
D_ASSERT( (updates)->max_regions > 0 ); \ D_ASSERT( (updates)->max_regions > 0 ); \
D_ASSERT( (updates)->num_regions <= (updates)->max_regions ); \ D_ASSERT( (updates)->num_regions <= (updates)->max_regions ); \
} while (0) } while (0)
void dfb_updates_init( DFBUpdates *updates, void DIRECTFB_API dfb_updates_init( DFBUpdates *updates,
DFBRegion *regions, DFBRegion *regions,
int max_regions ); int max_regions );
void dfb_updates_add ( DFBUpdates *updates, void DIRECTFB_API dfb_updates_add ( DFBUpdates *updates,
const DFBRegion *region ); const DFBRegion *region );
void dfb_updates_stat( DFBUpdates *updates, void DIRECTFB_API dfb_updates_stat( DFBUpdates *updates,
int *ret_total, int *ret_total,
int *ret_bounding ); int *ret_bounding );
void dfb_updates_get_rectangles( DFBUpdates *updates, void DIRECTFB_API dfb_updates_get_rectangles( DFBUpdates *updates,
DFBRectangle *ret_rects, DFBRectangle *ret_rects,
int *ret_num ); int *ret_num );
static inline void static __inline__ void
dfb_updates_add_rect( DFBUpdates *updates, dfb_updates_add_rect( DFBUpdates *updates,
int x, int x,
int y, int y,
int w, int w,
int h ) int h )
{ {
DFBRegion region = DFB_REGION_INIT_FROM_RECTANGLE_VALS( x, y, w, h ); DFBRegion region = { x, y, x+w-1, y+h-1 };
dfb_updates_add( updates, &region ); dfb_updates_add( updates, &region );
} }
static inline void static __inline__ void
dfb_updates_reset( DFBUpdates *updates ) dfb_updates_reset( DFBUpdates *updates )
{ {
D_MAGIC_ASSERT( updates, DFBUpdates ); D_MAGIC_ASSERT( updates, DFBUpdates );
updates->num_regions = 0; updates->num_regions = 0;
} }
static inline void static __inline__ void
dfb_updates_deinit( DFBUpdates *updates ) dfb_updates_deinit( DFBUpdates *updates )
{ {
D_MAGIC_ASSERT( updates, DFBUpdates ); D_MAGIC_ASSERT( updates, DFBUpdates );
D_MAGIC_CLEAR( updates ); D_MAGIC_CLEAR( updates );
} }
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
 End of changes. 63 change blocks. 
216 lines changed or deleted 1438 lines changed or added


 directfb_version.h   directfb_version.h 
skipping to change at line 33 skipping to change at line 33
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECTFB_VERSION_H__ #ifndef __DIRECTFB_VERSION_H__
#define __DIRECTFB_VERSION_H__ #define __DIRECTFB_VERSION_H__
#define DIRECTFB_MAJOR_VERSION (1) #define DIRECTFB_MAJOR_VERSION (1)
#define DIRECTFB_MINOR_VERSION (4) #define DIRECTFB_MINOR_VERSION (5)
#define DIRECTFB_MICRO_VERSION (17) #define DIRECTFB_MICRO_VERSION (0)
#define DIRECTFB_BINARY_AGE (11) #define DIRECTFB_BINARY_AGE (0)
#define DIRECTFB_INTERFACE_AGE (11) #define DIRECTFB_INTERFACE_AGE (0)
#endif /* __DIRECTFB_VERSION_H__ */ #endif /* __DIRECTFB_VERSION_H__ */
 End of changes. 1 change blocks. 
4 lines changed or deleted 4 lines changed or added


 directfbgl.h   directfbgl.h 
skipping to change at line 108 skipping to change at line 108
); );
/* /*
* Get the address of an OpenGL function. * Get the address of an OpenGL function.
*/ */
DFBResult (*GetProcAddress) ( DFBResult (*GetProcAddress) (
IDirectFBGL *thiz, IDirectFBGL *thiz,
const char *name, const char *name,
void **ret_address void **ret_address
); );
/*
* Set a surface to be used by the current texture object.
*/
DFBResult (*TextureSurface) (
IDirectFBGL *thiz,
int target,
int level,
IDirectFBSurface *surface
);
) )
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 1 change blocks. 
10 lines changed or deleted 0 lines changed or added


 fonts.h   fonts.h 
skipping to change at line 199 skipping to change at line 199
unsigned int index, unsigned int index,
CoreGlyphData *data ); CoreGlyphData *data );
DFBResult (* GetKerning) ( CoreFont *thiz, DFBResult (* GetKerning) ( CoreFont *thiz,
unsigned int prev, unsigned int prev,
unsigned int current, unsigned int current,
int *ret_x, int *ret_x,
int *ret_y ); int *ret_y );
int magic; int magic;
int underline_position;
int underline_thickness;
}; };
#define CORE_FONT_DEBUG_AT(Domain, font) \ #define CORE_FONT_DEBUG_AT(Domain, font) \
do { \ do { \
D_DEBUG_AT( Domain, " -> ascender %d\n", (font)->ascender ); \ D_DEBUG_AT( Domain, " -> ascender %d\n", (font)->ascender ); \
D_DEBUG_AT( Domain, " -> descender %d\n", (font)->descender ); \ D_DEBUG_AT( Domain, " -> descender %d\n", (font)->descender ); \
D_DEBUG_AT( Domain, " -> height %d\n", (font)->height ); \ D_DEBUG_AT( Domain, " -> height %d\n", (font)->height ); \
} while (0) } while (0)
/* /*
 End of changes. 1 change blocks. 
0 lines changed or deleted 3 lines changed or added


 fusion.h   fusion.h 
skipping to change at line 55 skipping to change at line 55
} FusionForkAction; } FusionForkAction;
typedef enum { typedef enum {
FFS_PREPARE, FFS_PREPARE,
FFS_PARENT, FFS_PARENT,
FFS_CHILD FFS_CHILD
} FusionForkState; } FusionForkState;
typedef void (*FusionForkCallback) ( FusionForkAction action, FusionForkSta te state ); typedef void (*FusionForkCallback) ( FusionForkAction action, FusionForkSta te state );
typedef void (*FusionLeaveCallback)( FusionWorld *world,
FusionID fusion_id,
void *ctx );
/* /*
* Enters a fusion world by joining or creating it. * Enters a fusion world by joining or creating it.
* *
* If <b>world_index</b> is negative, the next free index is used to create a new world. * If <b>world_index</b> is negative, the next free index is used to create a new world.
* Otherwise the world with the specified index is joined or created. * Otherwise the world with the specified index is joined or created.
*/ */
DirectResult fusion_enter( int world_index, DirectResult FUSION_API fusion_enter( int world_index,
int abi_version, int abi_version,
FusionEnterRole role, FusionEnterRole role,
FusionWorld **ret_world ); FusionWorld **ret_world );
/* /*
* Exits the fusion world. * Exits the fusion world.
* *
* If 'emergency' is true the function won't join but kill the dispatcher t hread. * If 'emergency' is true the function won't join but kill the dispatcher t hread.
*/ */
DirectResult fusion_exit( FusionWorld *world, DirectResult FUSION_API fusion_exit( FusionWorld *world,
bool emergency );
DirectResult fusion_stop_dispatcher( FusionWorld *world,
bool emergency ); bool emergency );
DirectResult FUSION_API fusion_stop_dispatcher( FusionWorld *world,
bool emergency );
/* /*
* Sets the fork() action of the calling Fusionee within the world. * Sets the fork() action of the calling Fusionee within the world.
*/ */
void fusion_world_set_fork_action( FusionWorld *world, void FUSION_API fusion_world_set_fork_action( FusionWorld *world,
FusionForkAction action ); FusionForkAction action );
/* /*
* Gets the current fork() action. * Gets the current fork() action.
*/ */
FusionForkAction fusion_world_get_fork_action( FusionWorld *world ); FusionForkAction FUSION_API fusion_world_get_fork_action( FusionWorld *worl d );
/* /*
* Registers a callback called upon fork(). * Registers a callback called upon fork().
*/ */
void fusion_world_set_fork_callback( FusionWorld *world, void FUSION_API fusion_world_set_fork_callback( FusionWorld *world,
FusionForkCallback callback ); FusionForkCallback callbac
k );
/*
* Registers a callback called when a slave exits.
*/
void fusion_world_set_leave_callback( FusionWorld *world,
FusionLeaveCallback callback,
void *ctx );
/* /*
* Return the index of the specified world. * Return the index of the specified world.
*/ */
int fusion_world_index( const FusionWorld *world ); int FUSION_API fusion_world_index( const FusionWorld *world );
/* /*
* Return the own Fusion ID within the specified world. * Return the own Fusion ID within the specified world.
*/ */
FusionID fusion_id( const FusionWorld *world ); FusionID FUSION_API fusion_id( const FusionWorld *world );
/* /*
* Return if the world is a multi application world. * Return if the world is a multi application world.
*/ */
bool fusion_is_multi( const FusionWorld *world ); bool FUSION_API fusion_is_multi( const FusionWorld *world );
/* /*
* Return the thread ID of the Fusion Dispatcher within the specified world . * Return the thread ID of the Fusion Dispatcher within the specified world .
*/ */
pid_t fusion_dispatcher_tid( const FusionWorld *world ); pid_t FUSION_API fusion_dispatcher_tid( const FusionWorld *world );
/* /*
* Return true if this process is the master. * Return true if this process is the master.
*/ */
bool fusion_master( const FusionWorld *world ); bool FUSION_API fusion_master( const FusionWorld *world );
/* /*
* Wait until all pending messages are processed. * Wait until all pending messages are processed.
*/ */
DirectResult fusion_sync( const FusionWorld *world ); DirectResult FUSION_API fusion_sync( const FusionWorld *world );
/* /*
* Sends a signal to one or more fusionees and optionally waits * Sends a signal to one or more fusionees and optionally waits
* for their processes to terminate. * for their processes to terminate.
* *
* A fusion_id of zero means all fusionees but the calling one. * A fusion_id of zero means all fusionees but the calling one.
* A timeout of zero means infinite waiting while a negative value * A timeout of zero means infinite waiting while a negative value
* means no waiting at all. * means no waiting at all.
*/ */
DirectResult fusion_kill( FusionWorld *world, DirectResult FUSION_API fusion_kill( FusionWorld *world,
FusionID fusion_id, FusionID fusion_id,
int signal, int signal,
int timeout_ms ); int timeout_ms );
/* Check if a pointer points to the shared memory. */ /* Check if a pointer points to the shared memory. */
bool fusion_is_shared( FusionWorld *world, bool FUSION_API fusion_is_shared( FusionWorld *world,
const void *ptr ); const void *ptr );
const char *fusion_get_tmpfs( FusionWorld *world );
/*
* Get the executable path of the Fusionee
*
* Returns DR_LIMITEXCEEDED when buf_size too small,
* with the required number of bytes returned in ret_size.
*/
DirectResult fusion_get_fusionee_path( const FusionWorld *world,
FusionID fusion_id,
char *buf,
size_t buf_size,
size_t *ret_size );
#endif #endif
 End of changes. 15 change blocks. 
50 lines changed or deleted 26 lines changed or added


 generic.h   generic.h 
skipping to change at line 248 skipping to change at line 248
} }
/************************************************************************** ********************************************/ /************************************************************************** ********************************************/
typedef void (*XopAdvanceFunc)( GenefxState *gfxs ); typedef void (*XopAdvanceFunc)( GenefxState *gfxs );
void Genefx_Aop_xy( GenefxState *gfxs, int x, int y ); void Genefx_Aop_xy( GenefxState *gfxs, int x, int y );
void Genefx_Aop_crab( GenefxState *gfxs ); void Genefx_Aop_crab( GenefxState *gfxs );
void Genefx_Aop_prev_crab( GenefxState *gfxs );
void Genefx_Aop_next( GenefxState *gfxs ); void Genefx_Aop_next( GenefxState *gfxs );
void Genefx_Aop_prev( GenefxState *gfxs ); void Genefx_Aop_prev( GenefxState *gfxs );
void Genefx_Bop_xy( GenefxState *gfxs, int x, int y ); void Genefx_Bop_xy( GenefxState *gfxs, int x, int y );
void Genefx_Bop_next( GenefxState *gfxs ); void Genefx_Bop_next( GenefxState *gfxs );
void Genefx_Bop_prev( GenefxState *gfxs ); void Genefx_Bop_prev( GenefxState *gfxs );
 End of changes. 1 change blocks. 
2 lines changed or deleted 0 lines changed or added


 gfxcard.h   gfxcard.h 
/* /*
(c) Copyright 2001-2011 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 48 skipping to change at line 48
#include <fusion/property.h> #include <fusion/property.h>
#include <core/coretypes.h> #include <core/coretypes.h>
#include <directfb.h> #include <directfb.h>
typedef enum { typedef enum {
CCF_CLIPPING = 0x00000001, CCF_CLIPPING = 0x00000001,
CCF_NOTRIEMU = 0x00000002, CCF_NOTRIEMU = 0x00000002,
CCF_READSYSMEM = 0x00000004, CCF_READSYSMEM = 0x00000004,
CCF_WRITESYSMEM= 0x00000008, /* CCF_WRITESYSMEM ?! */
CCF_AUXMEMORY = 0x00000010, CCF_AUXMEMORY = 0x00000010,
CCF_RENDEROPTS = 0x00000020 CCF_RENDEROPTS = 0x00000020
} CardCapabilitiesFlags; } CardCapabilitiesFlags;
struct __DFB_CoreGraphicsSerial { struct __DFB_CoreGraphicsSerial {
unsigned int serial; unsigned int serial;
unsigned int generation; unsigned int generation;
}; };
typedef struct { typedef struct {
skipping to change at line 251 skipping to change at line 251
bool (*DrawLine) ( void *driver_data, void *device_data, bool (*DrawLine) ( void *driver_data, void *device_data,
DFBRegion *line ); DFBRegion *line );
bool (*FillTriangle) ( void *driver_data, void *device_data, bool (*FillTriangle) ( void *driver_data, void *device_data,
DFBTriangle *tri ); DFBTriangle *tri );
bool (*FillTrapezoid) ( void *driver_data, void *device_data, bool (*FillTrapezoid) ( void *driver_data, void *device_data,
DFBTrapezoid *trap ); DFBTrapezoid *trap );
bool (*FillQuadrangles)( void *driver_data, void *device_data,
DFBPoint *points, int num );
/* /*
* blitting functions * blitting functions
*/ */
bool (*Blit) ( void *driver_data, void *device_data, bool (*Blit) ( void *driver_data, void *device_data,
DFBRectangle *rect, int dx, int dy ); DFBRectangle *rect, int dx, int dy );
bool (*Blit2) ( void *driver_data, void *device_data, bool (*Blit2) ( void *driver_data, void *device_data,
DFBRectangle *rect, int dx, int dy, int sx2, int sy2 ); DFBRectangle *rect, int dx, int dy, int sx2, int sy2 );
bool (*StretchBlit) ( void *driver_data, void *device_data, bool (*StretchBlit) ( void *driver_data, void *device_data,
skipping to change at line 313 skipping to change at line 316
GDLF_NONE = 0x00000000, GDLF_NONE = 0x00000000,
GDLF_WAIT = 0x00000001, GDLF_WAIT = 0x00000001,
GDLF_SYNC = 0x00000002, GDLF_SYNC = 0x00000002,
GDLF_INVALIDATE = 0x00000004, GDLF_INVALIDATE = 0x00000004,
GDLF_RESET = 0x00000008 GDLF_RESET = 0x00000008
} GraphicsDeviceLockFlags; } GraphicsDeviceLockFlags;
DFBResult dfb_gfxcard_lock( GraphicsDeviceLockFlags flags ); DFBResult dfb_gfxcard_lock( GraphicsDeviceLockFlags flags );
void dfb_gfxcard_unlock( void ); void dfb_gfxcard_unlock( void );
void dfb_gfxcard_holdup( void );
bool dfb_gfxcard_state_check( CardState *state, DFBAccelerationMask accel ) ; bool dfb_gfxcard_state_check( CardState *state, DFBAccelerationMask accel ) ;
/* /*
* Signal beginning of a sequence of operations using this state. * Signal beginning of a sequence of operations using this state.
* Any number of states can be 'drawing'. * Any number of states can be 'drawing'.
*/ */
void dfb_gfxcard_start_drawing( CoreGraphicsDevice *device, void dfb_gfxcard_start_drawing( CoreGraphicsDevice *device,
CardState *state ); CardState *state );
skipping to change at line 353 skipping to change at line 357
void dfb_gfxcard_fillspans ( int y, void dfb_gfxcard_fillspans ( int y,
DFBSpan *spans, DFBSpan *spans,
int num_spans, int num_spans,
CardState *state ); CardState *state );
void dfb_gfxcard_filltriangles ( const DFBTriangle *tris, void dfb_gfxcard_filltriangles ( const DFBTriangle *tris,
int num, int num,
CardState *state ); CardState *state );
void dfb_gfxcard_fillquadrangles ( DFBPoint *points,
int num,
CardState *state );
void dfb_gfxcard_filltrapezoids ( const DFBTrapezoid *traps, void dfb_gfxcard_filltrapezoids ( const DFBTrapezoid *traps,
int num, int num,
CardState *state ); CardState *state );
void dfb_gfxcard_blit ( DFBRectangle *rect, void dfb_gfxcard_blit ( DFBRectangle *rect,
int dx, int dx,
int dy, int dy,
CardState *state ); CardState *state );
void dfb_gfxcard_batchblit ( DFBRectangle *rects, void dfb_gfxcard_batchblit ( DFBRectangle *rects,
skipping to change at line 498 skipping to change at line 506
unsigned int videoram_length; unsigned int videoram_length;
unsigned int auxram_length; unsigned int auxram_length;
unsigned int auxram_offset; unsigned int auxram_offset;
char *module_name; char *module_name;
GraphicsDriverInfo driver_info; GraphicsDriverInfo driver_info;
GraphicsDeviceInfo device_info; GraphicsDeviceInfo device_info;
void *device_data; void *device_data;
FusionSkirmish lock; FusionProperty lock;
GraphicsDeviceLockFlags lock_flags; GraphicsDeviceLockFlags lock_flags;
/* /*
* Points to the current state of the graphics card. * Points to the current state of the graphics card.
*/ */
CardState *state; CardState *state;
FusionID holder; /* Fusion ID of state owner. */ FusionID holder; /* Fusion ID of state owner. */
} DFBGraphicsCoreShared; } DFBGraphicsCoreShared;
struct __DFB_DFBGraphicsCore { struct __DFB_DFBGraphicsCore {
 End of changes. 6 change blocks. 
3 lines changed or deleted 11 lines changed or added


 idirectfb.h   idirectfb.h 
skipping to change at line 56 skipping to change at line 56
DFBCooperativeLevel level; /* current cooperative level */ DFBCooperativeLevel level; /* current cooperative level */
CoreLayer *layer; /* primary display layer */ CoreLayer *layer; /* primary display layer */
CoreLayerContext *context; /* shared context of primary lay er */ CoreLayerContext *context; /* shared context of primary lay er */
CoreWindowStack *stack; /* window stack of primary layer */ CoreWindowStack *stack; /* window stack of primary layer */
struct { struct {
int width; /* IDirectFB stores window width */ int width; /* IDirectFB stores window width */
int height; /* and height and the pixel dept h */ int height; /* and height and the pixel dept h */
DFBSurfacePixelFormat format; /* from SetVideoMode() parameter s. */ DFBSurfacePixelFormat format; /* from SetVideoMode() parameter s. */
DFBSurfaceColorSpace colorspace; /* from SetVideoMode() paramet ers. */
CoreWindow *window; /* implicitly created window */ CoreWindow *window; /* implicitly created window */
Reaction reaction; /* for the focus listener */ Reaction reaction; /* for the focus listener */
bool focused; /* primary's window has the focu s */ bool focused; /* primary's window has the focu s */
CoreLayerContext *context; /* context for fullscreen primar y */ CoreLayerContext *context; /* context for fullscreen primar y */
} primary; /* Used for DFSCL_NORMAL's prima ry. */ } primary; /* Used for DFSCL_NORMAL's prima ry. */
bool app_focus; bool app_focus;
skipping to change at line 93 skipping to change at line 94
DFBResult IDirectFB_SetAppFocus( IDirectFB *thiz, DFBResult IDirectFB_SetAppFocus( IDirectFB *thiz,
DFBBoolean focused ); DFBBoolean focused );
/* /*
* Remove the event buffer element from the internally managed linked list of * Remove the event buffer element from the internally managed linked list of
* connections between event buffers created by * connections between event buffers created by
* IDirectFB::CreateInputEventBuffer and input devices that are hot-plugged in. * IDirectFB::CreateInputEventBuffer and input devices that are hot-plugged in.
*/ */
void containers_remove_input_eventbuffer( IDirectFBEventBuffer *thiz ) ; void containers_remove_input_eventbuffer( IDirectFBEventBuffer *thiz ) ;
DFBResult IDirectFB_InitLayers( IDirectFB *thiz );
extern IDirectFB *idirectfb_singleton; extern IDirectFB *idirectfb_singleton;
#endif #endif
 End of changes. 2 change blocks. 
0 lines changed or deleted 3 lines changed or added


 idirectfbdatabuffer.h   idirectfbdatabuffer.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __IDIRECTFBDATABUFFER_H__ #ifndef __IDIRECTFBDATABUFFER_H__
#define __IDIRECTFBDATABUFFER_H__ #define __IDIRECTFBDATABUFFER_H__
#include <core/core.h> #include <core/coretypes.h>
#include <fusion/call.h>
/* /*
* private data struct of IDirectFBDataBuffer * private data struct of IDirectFBDataBuffer
*/ */
typedef struct { typedef struct {
int ref; /* reference counter */ int ref; /* reference counter */
char *filename; /* Only set if databuffer is created from fil e. */ char *filename; /* Only set if databuffer is created from fil e. */
CoreDFB *core; CoreDFB *core;
IDirectFB *idirectfb;
bool is_memory; bool is_memory;
FusionCall call; /* for remote access */
} IDirectFBDataBuffer_data; } IDirectFBDataBuffer_data;
/* /*
* private data struct of IDirectFBDataBuffer_File * private data struct of IDirectFBDataBuffer_File
*/ */
typedef struct { typedef struct {
IDirectFBDataBuffer_data base; IDirectFBDataBuffer_data base;
DirectStream *stream; DirectStream *stream;
pthread_mutex_t mutex; DirectMutex mutex;
} IDirectFBDataBuffer_File_data; } IDirectFBDataBuffer_File_data;
/* /*
* private data struct of IDirectFBDataBuffer_Memory * private data struct of IDirectFBDataBuffer_Memory
*/ */
typedef struct { typedef struct {
IDirectFBDataBuffer_data base; IDirectFBDataBuffer_data base;
const void *buffer; const void *buffer;
unsigned int length; unsigned int length;
skipping to change at line 80 skipping to change at line 77
} IDirectFBDataBuffer_Memory_data; } IDirectFBDataBuffer_Memory_data;
/* /*
* base constructor * base constructor
* *
* If the databuffer is created for a file, the filename can be provided * If the databuffer is created for a file, the filename can be provided
* for fallbacks. * for fallbacks.
*/ */
DFBResult IDirectFBDataBuffer_Construct( IDirectFBDataBuffer *thiz, DFBResult IDirectFBDataBuffer_Construct( IDirectFBDataBuffer *thiz,
const char *filename, const char *filename,
CoreDFB *core ); CoreDFB *core,
IDirectFB *idirectfb );
/* /*
* base destructor * base destructor
*/ */
void IDirectFBDataBuffer_Destruct( IDirectFBDataBuffer *thiz ); void IDirectFBDataBuffer_Destruct( IDirectFBDataBuffer *thiz );
/* /*
* generic streamed data buffer * generic streamed data buffer
*/ */
DFBResult IDirectFBDataBuffer_Streamed_Construct( IDirectFBDataBuffer *thiz , DFBResult IDirectFBDataBuffer_Streamed_Construct( IDirectFBDataBuffer *thiz ,
CoreDFB *core CoreDFB *core
); ,
IDirectFB *idir
ectfb );
/* /*
* file based static data buffer * file based static data buffer
*/ */
DFBResult IDirectFBDataBuffer_File_Construct( IDirectFBDataBuffer *thiz, DFBResult IDirectFBDataBuffer_File_Construct( IDirectFBDataBuffer *thiz,
const char *filename , const char *filename ,
CoreDFB *core ); CoreDFB *core,
IDirectFB *idirectf
b );
/* /*
* memory based static data buffer * memory based static data buffer
*/ */
DFBResult IDirectFBDataBuffer_Memory_Construct( IDirectFBDataBuffer *thiz, DFBResult IDirectFBDataBuffer_Memory_Construct( IDirectFBDataBuffer *thiz,
const void *data, const void *data,
unsigned int length , unsigned int length ,
CoreDFB *core ) CoreDFB *core,
; IDirectFB *idirec
tfb );
#endif #endif
 End of changes. 8 change blocks. 
12 lines changed or deleted 15 lines changed or added


 idirectfbdisplaylayer.h   idirectfbdisplaylayer.h 
skipping to change at line 40 skipping to change at line 40
#define __IDIRECTFBDISPLAYLAYER_H__ #define __IDIRECTFBDISPLAYLAYER_H__
#include <directfb.h> #include <directfb.h>
#include <core/coretypes.h> #include <core/coretypes.h>
/* /*
* initializes interface struct and private data * initializes interface struct and private data
*/ */
DFBResult IDirectFBDisplayLayer_Construct( IDirectFBDisplayLayer *thiz, DFBResult IDirectFBDisplayLayer_Construct( IDirectFBDisplayLayer *thiz,
CoreLayer *layer, CoreLayer *layer,
CoreDFB *core ); CoreDFB *core,
IDirectFB *idirectfb
);
#endif #endif
 End of changes. 1 change blocks. 
1 lines changed or deleted 3 lines changed or added


 idirectfbfont.h   idirectfbfont.h 
skipping to change at line 34 skipping to change at line 34
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __IDIRECTFBFONT_H__ #ifndef __IDIRECTFBFONT_H__
#define __IDIRECTFBFONT_H__ #define __IDIRECTFBFONT_H__
#include <directfb.h> #include <directfb.h>
#include <direct/filesystem.h>
#include <core/coretypes.h> #include <core/coretypes.h>
/* /*
* probing context * probing context
*/ */
typedef struct { typedef struct {
/* Only set if databuffer is created from file. /* Only set if databuffer is created from file.
deprecated - use memory location below. */ deprecated - use memory location below. */
const char *filename; const char *filename;
/* if !=NULL, pointer to the file content */ /* if !=NULL, pointer to the file content */
unsigned char *content; unsigned char *content;
unsigned int content_size; unsigned int content_size;
bool content_mapped; bool content_mapped;
} IDirectFBFont_ProbeContext; } IDirectFBFont_ProbeContext;
DFBResult DFBResult
IDirectFBFont_CreateFromBuffer( IDirectFBDataBuffer *buffer, IDirectFBFont_CreateFromBuffer( IDirectFBDataBuffer *buffer,
CoreDFB *core, CoreDFB *core,
const DFBFontDescription *desc, const DFBFontDescription *desc,
IDirectFBFont **interface ); IDirectFBFont **interface_ptr );
/************************************************************************** ********************************************/ /************************************************************************** ********************************************/
/* /*
* private data struct of IDirectFBFont * private data struct of IDirectFBFont
* used by implementors of IDirectFBFont * used by implementors of IDirectFBFont
*/ */
typedef struct { typedef struct {
int ref; /* reference counter */ int ref; /* reference counter */
CoreFont *font; /* pointer to core font */ CoreFont *font; /* pointer to core font */
 End of changes. 2 change blocks. 
1 lines changed or deleted 3 lines changed or added


 idirectfbimageprovider.h   idirectfbimageprovider.h 
skipping to change at line 46 skipping to change at line 46
*/ */
typedef struct { typedef struct {
unsigned char header[32]; unsigned char header[32];
const char *filename; /* Only set if databuffer is created from fil e. */ const char *filename; /* Only set if databuffer is created from fil e. */
} IDirectFBImageProvider_ProbeContext; } IDirectFBImageProvider_ProbeContext;
DFBResult DFBResult
IDirectFBImageProvider_CreateFromBuffer( IDirectFBDataBuffer *buffer, IDirectFBImageProvider_CreateFromBuffer( IDirectFBDataBuffer *buffer,
CoreDFB *core, CoreDFB *core,
IDirectFBImageProvider **interface IDirectFB *idirectfb
); ,
IDirectFBImageProvider **interface
_ptr );
/************************************************************************** ********************************************/ /************************************************************************** ********************************************/
/* /*
* private data struct of IDirectFBImageProvider * private data struct of IDirectFBImageProvider
* used by implementors of IDirectFBImageProvider * used by implementors of IDirectFBImageProvider
*/ */
typedef struct { typedef struct {
int ref; /* reference counter */ int ref; /* reference counter */
IDirectFBDataBuffer *buffer; IDirectFBDataBuffer *buffer;
CoreDFB *core; CoreDFB *core;
IDirectFB *idirectfb;
DIRenderCallback render_callback; DIRenderCallback render_callback;
void *render_callback_context; void *render_callback_context;
void (*Destruct)( IDirectFBImageProvider *thiz ); void (*Destruct)( IDirectFBImageProvider *thiz );
} IDirectFBImageProvider_data; } IDirectFBImageProvider_data;
#endif #endif
 End of changes. 2 change blocks. 
2 lines changed or deleted 5 lines changed or added


 idirectfbinputbuffer.h   idirectfbinputbuffer.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __IDIRECTFBEVENTBUFFER_H__ #ifndef __IDIRECTFBEVENTBUFFER_H__
#define __IDIRECTFBEVENTBUFFER_H__ #define __IDIRECTFBEVENTBUFFER_H__
#include <directfb_build.h>
#include <fusion/types.h> #include <fusion/types.h>
#if !DIRECTFB_BUILD_PURE_VOODOO
#include <core/input.h> #include <core/input.h>
#endif
typedef bool (*EventBufferFilterCallback)( DFBEvent *evt, typedef bool (*EventBufferFilterCallback)( DFBEvent *evt,
void *ctx ); void *ctx );
/* /*
* initializes event buffer, adds it to input listeners and initializes mut exes * initializes event buffer, adds it to input listeners and initializes mut exes
*/ */
DFBResult IDirectFBEventBuffer_Construct( IDirectFBEventBuffer *thiz, DFBResult IDirectFBEventBuffer_Construct( IDirectFBEventBuffer *thiz,
EventBufferFilterCallback filter , EventBufferFilterCallback filter ,
void *filter _ctx ); void *filter _ctx );
#if !DIRECTFB_BUILD_PURE_VOODOO
DFBResult IDirectFBEventBuffer_AttachInputDevice( IDirectFBEventBuffer *thi z, DFBResult IDirectFBEventBuffer_AttachInputDevice( IDirectFBEventBuffer *thi z,
CoreInputDevice *dev ice ); CoreInputDevice *dev ice );
DFBResult IDirectFBEventBuffer_DetachInputDevice( IDirectFBEventBuffer *thi z, DFBResult IDirectFBEventBuffer_DetachInputDevice( IDirectFBEventBuffer *thi z,
CoreInputDevice *dev ice ); CoreInputDevice *dev ice );
DFBResult IDirectFBEventBuffer_AttachWindow( IDirectFBEventBuffer *thiz, DFBResult IDirectFBEventBuffer_AttachWindow( IDirectFBEventBuffer *thiz,
CoreWindow *window ) ; CoreWindow *window ) ;
DFBResult IDirectFBEventBuffer_DetachWindow( IDirectFBEventBuffer *thiz, DFBResult IDirectFBEventBuffer_DetachWindow( IDirectFBEventBuffer *thiz,
CoreWindow *window ) ; CoreWindow *window ) ;
#endif
#endif #endif
 End of changes. 5 change blocks. 
0 lines changed or deleted 7 lines changed or added


 idirectfbsurface.h   idirectfbsurface.h 
skipping to change at line 38 skipping to change at line 38
#ifndef __IDIRECTFBSURFACE_H__ #ifndef __IDIRECTFBSURFACE_H__
#define __IDIRECTFBSURFACE_H__ #define __IDIRECTFBSURFACE_H__
#include <directfb.h> #include <directfb.h>
#include <direct/types.h> #include <direct/types.h>
#include <fusion/reactor.h> #include <fusion/reactor.h>
#include <core/core.h>
#include <core/state.h> #include <core/state.h>
#include <core/CoreGraphicsStateClient.h> #include <core/CoreGraphicsStateClient.h>
/* /*
* private data struct of IDirectFBSurface * private data struct of IDirectFBSurface
*/ */
typedef struct { typedef struct {
DirectLink link; DirectLink link;
skipping to change at line 136 skipping to change at line 135
Reaction reaction; Reaction reaction;
CoreDFB *core; CoreDFB *core;
IDirectFBSurface *parent; IDirectFBSurface *parent;
DirectLink *children_data; DirectLink *children_data;
pthread_mutex_t children_lock; pthread_mutex_t children_lock;
CoreGraphicsStateClient state_client; CoreGraphicsStateClient state_client;
CoreMemoryPermission *memory_permissions[3];
unsigned int memory_permissions_count;
} IDirectFBSurface_data; } IDirectFBSurface_data;
/* /*
* initializes interface struct and private data * initializes interface struct and private data
*/ */
DFBResult IDirectFBSurface_Construct( IDirectFBSurface *thiz, DFBResult IDirectFBSurface_Construct( IDirectFBSurface *thiz,
IDirectFBSurface *parent, IDirectFBSurface *parent,
DFBRectangle *req_rect, DFBRectangle *req_rect,
DFBRectangle *clip_rect, DFBRectangle *clip_rect,
DFBInsets *insets, DFBInsets *insets,
 End of changes. 2 change blocks. 
4 lines changed or deleted 0 lines changed or added


 idirectfbvideoprovider.h   idirectfbvideoprovider.h 
skipping to change at line 50 skipping to change at line 50
/* Only set if databuffer is created from file. */ /* Only set if databuffer is created from file. */
const char *filename; const char *filename;
/* Usefull if provider needs more data for probing. */ /* Usefull if provider needs more data for probing. */
IDirectFBDataBuffer *buffer; IDirectFBDataBuffer *buffer;
} IDirectFBVideoProvider_ProbeContext; } IDirectFBVideoProvider_ProbeContext;
DFBResult DFBResult
IDirectFBVideoProvider_CreateFromBuffer( IDirectFBDataBuffer *buffer, IDirectFBVideoProvider_CreateFromBuffer( IDirectFBDataBuffer *buffer,
CoreDFB *core, CoreDFB *core,
IDirectFBVideoProvider **interface ); IDirectFBVideoProvider **interface _ptr );
#endif #endif
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 idirectfbwindow.h   idirectfbwindow.h 
skipping to change at line 43 skipping to change at line 43
#include <core/coretypes.h> #include <core/coretypes.h>
/* /*
* initializes a new window and constructs interface * initializes a new window and constructs interface
*/ */
DFBResult IDirectFBWindow_Construct( IDirectFBWindow *thiz, DFBResult IDirectFBWindow_Construct( IDirectFBWindow *thiz,
CoreWindow *window, CoreWindow *window,
CoreLayer *layer, CoreLayer *layer,
CoreDFB *core, CoreDFB *core,
bool created ); IDirectFB *idirectfb );
#endif #endif
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 input.h   input.h 
skipping to change at line 162 skipping to change at line 162
DFBInputDeviceID dfb_input_device_id ( const CoreInputDevice * device ); DFBInputDeviceID dfb_input_device_id ( const CoreInputDevice * device );
CoreInputDevice *dfb_input_device_at ( DFBInputDeviceID id ); CoreInputDevice *dfb_input_device_at ( DFBInputDeviceID id );
DFBInputDeviceCapabilities dfb_input_device_caps( const CoreInputDevice *de vice ); DFBInputDeviceCapabilities dfb_input_device_caps( const CoreInputDevice *de vice );
DFBResult dfb_input_device_get_keymap_entry( CoreInputDevice *device, DFBResult dfb_input_device_get_keymap_entry( CoreInputDevice *device,
int keycode, int keycode,
DFBInputDeviceKeymapEn try *entry ); DFBInputDeviceKeymapEn try *entry );
DFBResult dfb_input_device_set_keymap_entry( CoreInputDevice DFBResult dfb_input_device_set_keymap_entry( CoreInputDevice
*device, *device,
int int
keycode, keycode,
const DFBInputDeviceKe DFBInputDeviceKeymapEn
ymapEntry *entry ); try *entry );
DFBResult dfb_input_device_load_keymap ( CoreInputDevice *device, DFBResult dfb_input_device_load_keymap ( CoreInputDevice *device,
char *filename ); char *filename );
DFBResult dfb_input_device_reload_keymap ( CoreInputDevice *device ); DFBResult dfb_input_device_reload_keymap ( CoreInputDevice *device );
typedef struct {
DFBInputDeviceModifierMask modifiers_l;
DFBInputDeviceModifierMask modifiers_r;
DFBInputDeviceLockState locks;
DFBInputDeviceButtonMask buttons;
} CoreInputDeviceState;
DFBResult dfb_input_device_get_state( CoreInputDevice *device,
CoreInputDeviceState *ret_sta
te );
void containers_attach_device( CoreInputDevice *device ); void containers_attach_device( CoreInputDevice *device );
void containers_detach_device( CoreInputDevice *device ); void containers_detach_device( CoreInputDevice *device );
void stack_containers_attach_device( CoreInputDevice *device ) ; void stack_containers_attach_device( CoreInputDevice *device ) ;
void stack_containers_detach_device( CoreInputDevice *device ) ; void stack_containers_detach_device( CoreInputDevice *device ) ;
DFBResult dfb_input_create_device( int device_index, DFBResult dfb_input_create_device( int device_index,
CoreDFB *core_in, CoreDFB *core_in,
skipping to change at line 202 skipping to change at line 192
DFBResult dfb_input_remove_device( int device_index, DFBResult dfb_input_remove_device( int device_index,
void *driver_in ); void *driver_in );
/* global reactions */ /* global reactions */
typedef enum { typedef enum {
DFB_WINDOWSTACK_INPUTDEVICE_LISTENER DFB_WINDOWSTACK_INPUTDEVICE_LISTENER
} DFB_INPUT_GLOBALS; } DFB_INPUT_GLOBALS;
DirectResult CoreInputDevice_Call( CoreInputDevice *device,
FusionCallExecFlags flags,
int call_arg,
void *ptr,
unsigned int length,
void *ret_ptr,
unsigned int ret_size,
unsigned int *ret_length );
#endif #endif
 End of changes. 3 change blocks. 
26 lines changed or deleted 6 lines changed or added


 input_driver.h   input_driver.h 
skipping to change at line 101 skipping to change at line 101
static DFBResult static DFBResult
driver_resume( void ) driver_resume( void )
{ {
return DFB_UNSUPPORTED; return DFB_UNSUPPORTED;
} }
static DFBResult static DFBResult
is_created( int event_num, void *data) is_created( int event_num, void *data)
{ {
D_UNUSED_P( event_num );
D_UNUSED_P( data );
return DFB_UNSUPPORTED; return DFB_UNSUPPORTED;
} }
static InputDriverCapability static InputDriverCapability
get_capability( void ) get_capability( void )
{ {
return IDC_NONE; return IDC_NONE;
} }
static DFBResult static DFBResult
launch_hotplug(CoreDFB *core, launch_hotplug(CoreDFB *core,
void *input_driver) void *input_driver)
{ {
D_UNUSED_P( core );
D_UNUSED_P( input_driver );
return DFB_UNSUPPORTED; return DFB_UNSUPPORTED;
} }
static DFBResult static DFBResult
stop_hotplug( void ) stop_hotplug( void )
{ {
return DFB_UNSUPPORTED; return DFB_UNSUPPORTED;
} }
#endif #endif
 End of changes. 2 change blocks. 
6 lines changed or deleted 0 lines changed or added


 interface.h   interface.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 38 skipping to change at line 38
#ifndef __DIRECT__INTERFACE_H__ #ifndef __DIRECT__INTERFACE_H__
#define __DIRECT__INTERFACE_H__ #define __DIRECT__INTERFACE_H__
#include <direct/debug.h> #include <direct/debug.h>
#include <direct/mem.h> #include <direct/mem.h>
/* /*
* Forward declaration macro for interfaces. * Forward declaration macro for interfaces.
*/ */
#define DECLARE_INTERFACE( IFACE ) \ #define D_DECLARE_INTERFACE( IFACE ) \
typedef struct _##IFACE IFACE; typedef struct _ ## IFACE IFACE;
/* /*
* Macro for an interface definition. * Macro for an interface definition.
*/ */
#define DEFINE_INTERFACE( IFACE, ... ) \ #define D_DEFINE_INTERFACE( IFACE, ... ) \
struct _##IFACE { \ struct _ ## IFACE { \
void *priv; \ void *priv; \
int magic; \ int magic; \
int refs; \
\ \
DirectResult (*AddRef)( IFACE *thiz ); \ DirectResult (*AddRef)( IFACE *thiz ); \
DirectResult (*Release)( IFACE *thiz ); \ DirectResult (*Release)( IFACE *thiz ); \
\ \
__VA_ARGS__ \ __VA_ARGS__ \
}; };
#ifndef DIRECT_DISABLE_DEPRECATED
// @deprecated
#define DECLARE_INTERFACE D_DECLARE_INTERFACE
// @deprecated
#define DEFINE_INTERFACE D_DEFINE_INTERFACE
#endif
/* /*
* Declare base interface * Declare base interface
*/ */
DECLARE_INTERFACE( IAny ) D_DECLARE_INTERFACE( IAny )
/* /*
* Define base interface * Define base interface
*/ */
DEFINE_INTERFACE( IAny, ) D_DEFINE_INTERFACE( IAny, )
/* /*
* Function type for probing of interface implementations * Function type for probing of interface implementations
*/ */
typedef DirectResult (*DirectInterfaceGenericProbeFunc)( void *ctx, ... ); typedef DirectResult (*DirectInterfaceGenericProbeFunc)( void *ctx, ... );
/* /*
* Function type for initialization of interface instances * Function type for initialization of interface instances
*/ */
typedef DirectResult (*DirectInterfaceGenericConstructFunc)( void *interfac e, ... ); typedef DirectResult (*DirectInterfaceGenericConstructFunc)( void *interfac e_ptr, ... );
/* /*
* Function table for interface implementations * Function table for interface implementations
*/ */
typedef struct { typedef struct {
const char * (*GetType)(void); const char * (*GetType)(void);
const char * (*GetImplementation)(void); const char * (*GetImplementation)(void);
DirectResult (*Allocate)( void **interface ); DirectResult (*Allocate)( void **interface_ptr );
DirectResult (*Deallocate)( void *interface_ptr );
DirectInterfaceGenericProbeFunc Probe; DirectInterfaceGenericProbeFunc Probe;
DirectInterfaceGenericConstructFunc Construct; DirectInterfaceGenericConstructFunc Construct;
} DirectInterfaceFuncs; } DirectInterfaceFuncs;
/* /*
* Callback type for user probing interface implementations * Callback type for user probing interface implementations
*/ */
typedef DirectResult (*DirectInterfaceProbeFunc)( DirectInterfaceFuncs *imp l, void *ctx ); typedef DirectResult (*DirectInterfaceProbeFunc)( DirectInterfaceFuncs *imp l, void *ctx );
/* /*
* Loads an interface of a specific 'type'. * Loads an interface of a specific 'type'.
* Optionally an 'implementation' can be chosen. * Optionally an 'implementation' can be chosen.
* A 'probe' function can be used to check available implementations. * A 'probe' function can be used to check available implementations.
* *
* After success 'funcs' is set. * After success 'funcs' is set.
*/ */
DirectResult DirectGetInterface( DirectInterfaceFuncs **funcs, DirectResult DIRECT_API DirectGetInterface( DirectInterfaceFuncs **func
const char *type, s,
const char *implementation, const char *type
DirectInterfaceProbeFunc probe, ,
void *probe_ctx ); const char *impl
ementation,
DirectInterfaceProbeFunc prob
e,
void *prob
e_ctx );
/* /*
* Default probe function. Calls "funcs->Probe(ctx)". * Default probe function. Calls "funcs->Probe(ctx)".
* Can be used as the 'probe' argument to DirectGetInterface. * Can be used as the 'probe' argument to DirectGetInterface.
* 'probe_ctx' should then be set to the interface specific probe context. * 'probe_ctx' should then be set to the interface specific probe context.
*/ */
DirectResult DirectProbeInterface( DirectInterfaceFuncs *funcs, void *ctx ) ; DirectResult DIRECT_API DirectProbeInterface( DirectInterfaceFuncs *funcs, void *ctx );
/* /*
* Called by implementation modules during 'dlopen'ing or at startup if lin ked * Called by implementation modules during 'dlopen'ing or at startup if lin ked
* into the executable. * into the executable.
*/ */
void DirectRegisterInterface( DirectInterfaceFuncs *funcs ); void DIRECT_API DirectRegisterInterface( DirectInterfaceFuncs *funcs );
void DirectUnregisterInterface( DirectInterfaceFuncs *funcs ); void DIRECT_API DirectUnregisterInterface( DirectInterfaceFuncs *funcs );
void direct_print_interface_leaks(void); void DIRECT_API direct_print_interface_leaks(void);
#if DIRECT_BUILD_DEBUGS #if DIRECT_BUILD_DEBUGS
void direct_dbg_interface_add ( const char *func, void DIRECT_API direct_dbg_interface_add ( const char *func,
const char *file, const char *file,
int line, int line,
const char *what, const char *what,
const void *interface, const void *interface_ptr,
const char *name ); const char *name );
void direct_dbg_interface_remove( const char *func, void DIRECT_API direct_dbg_interface_remove( const char *func,
const char *file, const char *file,
int line, int line,
const char *what, const char *what,
const void *interface ); const void *interface_ptr );
#endif #endif
#if DIRECT_BUILD_DEBUG || defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FO RCE_DEBUG) #if DIRECT_BUILD_DEBUG || defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FO RCE_DEBUG)
#if !DIRECT_BUILD_DEBUGS #if !DIRECT_BUILD_DEBUGS
#error Building with debug, but library headers suggest that debug is not s upported. #error Building with debug, but library headers suggest that debug is not s upported.
#endif #endif
#define DIRECT_DBG_INTERFACE_ADD direct_dbg_interface_add #define DIRECT_DBG_INTERFACE_ADD direct_dbg_interface_add
#define DIRECT_DBG_INTERFACE_REMOVE direct_dbg_interface_remove #define DIRECT_DBG_INTERFACE_REMOVE direct_dbg_interface_remove
#else #else
#define DIRECT_DBG_INTERFACE_ADD(func,file,line,what,interface,name) do {} while (0) #define DIRECT_DBG_INTERFACE_ADD(func,file,line,what,interface,name) do {} while (0)
#define DIRECT_DBG_INTERFACE_REMOVE(func,file,line,what,interface) do {} while (0) #define DIRECT_DBG_INTERFACE_REMOVE(func,file,line,what,interface) do {} while (0)
#endif #endif
#define DIRECT_ALLOCATE_INTERFACE(p,i) #define DIRECT_ALLOCATE_INTERFACE(p,i)
\ \
do { do {
\ \
(p) = (__typeof__(p))D_CALLOC( 1, sizeof(i) ); (p) = (__typeof__(p))D_CALLOC( 1, sizeof(i) );
\ \
if (p) {
\ \
D_MAGIC_SET( (IAny*)(p), DirectInterface ); D_MAGIC_SET( (IAny*)(p), DirectInterface );
\ \
\ \
DIRECT_DBG_INTERFACE_ADD( __FUNCTION__, __FILE__, __LINE__, DIRECT_DBG_INTERFACE_ADD( __FUNCTION__, __FILE__, __LINE__, #p, p
#p, p, #i ); \ , #i ); \
}
\
else
\
D_OOM();
\
} while (0) } while (0)
#define DIRECT_ALLOCATE_INTERFACE_DATA(p,i) \ #define DIRECT_ALLOCATE_INTERFACE_DATA(p,i) \
i##_data *data; \ i##_data *data; \
\ \
D_MAGIC_ASSERT( (IAny*)(p), DirectInterface ); \ D_MAGIC_ASSERT( (IAny*)(p), DirectInterface ); \
\ \
if (!(p)->priv) \ if (!(p)->priv) \
(p)->priv = D_CALLOC( 1, sizeof(i##_data) ); \ (p)->priv = D_CALLOC( 1, sizeof(i##_data) ); \
\ \
data = (i##_data*)((p)->priv); data = (i##_data*)((p)->priv);
#define DIRECT_DEALLOCATE_INTERFACE(p) \ #define DIRECT_DEALLOCATE_INTERFACE(p) \
D_MAGIC_ASSERT( (IAny*)(p), DirectInterface );
\
\
DIRECT_DBG_INTERFACE_REMOVE( __FUNCTION__, __FILE__, __LINE__, #p, p ) ; \ DIRECT_DBG_INTERFACE_REMOVE( __FUNCTION__, __FILE__, __LINE__, #p, p ) ; \
\ \
if ((p)->priv) { \ if ((p)->priv) { \
D_FREE( (p)->priv ); \ D_FREE( (p)->priv ); \
(p)->priv = NULL; \ (p)->priv = NULL; \
} \ } \
\ \
D_MAGIC_CLEAR( (IAny*)(p) ); \ D_MAGIC_CLEAR( (IAny*)(p) ); \
\ \
D_FREE( (p) ); D_FREE( (p) );
skipping to change at line 210 skipping to change at line 221
#define DIRECT_INTERFACE_GET_DATA_FROM(interface,data,prefix) \ #define DIRECT_INTERFACE_GET_DATA_FROM(interface,data,prefix) \
do { \ do { \
D_MAGIC_ASSERT( (IAny*)(interface), DirectInterface ); \ D_MAGIC_ASSERT( (IAny*)(interface), DirectInterface ); \
\ \
(data) = (prefix##_data*) (interface)->priv; \ (data) = (prefix##_data*) (interface)->priv; \
\ \
if (!(data)) \ if (!(data)) \
return DR_DEAD; \ return DR_DEAD; \
} while (0) } while (0)
void __D_interface_init( void );
void __D_interface_deinit( void );
void __D_interface_dbg_init( void );
void __D_interface_dbg_deinit( void );
#endif #endif
 End of changes. 19 change blocks. 
49 lines changed or deleted 70 lines changed or added


 layer_context.h   layer_context.h 
skipping to change at line 58 skipping to change at line 58
* Creates a pool of layer context objects. * Creates a pool of layer context objects.
*/ */
FusionObjectPool *dfb_layer_context_pool_create( const FusionWorld *world ) ; FusionObjectPool *dfb_layer_context_pool_create( const FusionWorld *world ) ;
/* /*
* Generates dfb_layer_context_ref(), dfb_layer_context_attach() etc. * Generates dfb_layer_context_ref(), dfb_layer_context_attach() etc.
*/ */
FUSION_OBJECT_METHODS( CoreLayerContext, dfb_layer_context ) FUSION_OBJECT_METHODS( CoreLayerContext, dfb_layer_context )
DFBResult dfb_layer_context_init( CoreLayerContext *context, DFBResult dfb_layer_context_init( CoreLayerContext *context,
CoreLayer *layer, CoreLayer *layer );
bool stack );
/* /*
* Locking * Locking
*/ */
DirectResult dfb_layer_context_lock ( CoreLayerContext *context ); DirectResult dfb_layer_context_lock ( CoreLayerContext *context );
DirectResult dfb_layer_context_unlock( CoreLayerContext *context ); DirectResult dfb_layer_context_unlock( CoreLayerContext *context );
CoreWindowStack *dfb_layer_context_windowstack( const CoreLayerContext *con text ); CoreWindowStack *dfb_layer_context_windowstack( const CoreLayerContext *con text );
bool dfb_layer_context_active ( const CoreLayerContext *con text ); bool dfb_layer_context_active ( const CoreLayerContext *con text );
skipping to change at line 128 skipping to change at line 127
DFBResult dfb_layer_context_set_rotation ( CoreLayerContext *context, DFBResult dfb_layer_context_set_rotation ( CoreLayerContext *context,
int rotation ); int rotation );
DFBResult dfb_layer_context_set_coloradjustment( CoreLayerContext *context, DFBResult dfb_layer_context_set_coloradjustment( CoreLayerContext *context,
const DFBColorAdjustment *adjustment ); const DFBColorAdjustment *adjustment );
DFBResult dfb_layer_context_get_coloradjustment( CoreLayerContext *context, DFBResult dfb_layer_context_get_coloradjustment( CoreLayerContext *context,
DFBColorAdjustment *ret_adjustment ); DFBColorAdjustment *ret_adjustment );
DFBResult dfb_layer_context_set_stereo_depth ( CoreLayerContext
*context,
bool
follow_video,
int
z );
DFBResult dfb_layer_context_get_stereo_depth ( CoreLayerContext
*context,
bool
*follow_video,
int
*ret_z );
DFBResult dfb_layer_context_set_field_parity ( CoreLayerContext *context, DFBResult dfb_layer_context_set_field_parity ( CoreLayerContext *context,
int field ); int field );
DFBResult dfb_layer_context_set_clip_regions ( CoreLayerContext *context, DFBResult dfb_layer_context_set_clip_regions ( CoreLayerContext *context,
const DFBRegion *regions, const DFBRegion *regions,
int num_regions, int num_regions,
DFBBoolean positive ); DFBBoolean positive );
/* /*
* window control * window control
*/ */
DFBResult dfb_layer_context_create_window( CoreDFB *cor e, DFBResult dfb_layer_context_create_window( CoreDFB *cor e,
CoreLayerContext *con text, CoreLayerContext *con text,
const DFBWindowDescription *des c, const DFBWindowDescription *des c,
CoreWindow **ret _window ); CoreWindow **ret _window );
CoreWindow *dfb_layer_context_find_window( CoreLayerContext *con text, CoreWindow *dfb_layer_context_find_window( CoreLayerContext *con text,
DFBWindowID id ); DFBWindowID id );
DFBResult dfb_layer_context_allocate_surface ( CoreLayer
*layer,
CoreLayerRegion
*region,
CoreLayerRegionConfig
*config );
DFBResult dfb_layer_context_reallocate_surface ( CoreLayer
*layer,
CoreLayerRegion
*region,
CoreLayerRegionConfig
*config );
DFBResult dfb_layer_context_deallocate_surface ( CoreLayer
*layer,
CoreLayerRegion
*region );
#endif #endif
 End of changes. 3 change blocks. 
21 lines changed or deleted 15 lines changed or added


 layer_control.h   layer_control.h 
skipping to change at line 37 skipping to change at line 37
*/ */
#ifndef __CORE__LAYER_CONTROL_H__ #ifndef __CORE__LAYER_CONTROL_H__
#define __CORE__LAYER_CONTROL_H__ #define __CORE__LAYER_CONTROL_H__
#include <directfb.h> #include <directfb.h>
#include <core/coretypes.h> #include <core/coretypes.h>
DFBResult dfb_layer_create_context ( CoreLayer *layer, DFBResult dfb_layer_create_context ( CoreLayer *layer,
bool stack,
CoreLayerContext **ret_conte xt ); CoreLayerContext **ret_conte xt );
DFBResult dfb_layer_get_active_context ( CoreLayer *layer, DFBResult dfb_layer_get_active_context ( CoreLayer *layer,
CoreLayerContext **ret_conte xt ); CoreLayerContext **ret_conte xt );
DFBResult dfb_layer_get_primary_context ( CoreLayer *layer, DFBResult dfb_layer_get_primary_context ( CoreLayer *layer,
bool activate, bool activate,
CoreLayerContext **ret_conte xt ); CoreLayerContext **ret_conte xt );
DFBResult dfb_layer_activate_context ( CoreLayer *layer, DFBResult dfb_layer_activate_context ( CoreLayer *layer,
 End of changes. 1 change blocks. 
1 lines changed or deleted 0 lines changed or added


 layer_region.h   layer_region.h 
skipping to change at line 79 skipping to change at line 79
DFBResult dfb_layer_region_set_surface ( CoreLayerRegion *region, DFBResult dfb_layer_region_set_surface ( CoreLayerRegion *region,
CoreSurface *surface ); CoreSurface *surface );
DFBResult dfb_layer_region_get_surface ( CoreLayerRegion *region, DFBResult dfb_layer_region_get_surface ( CoreLayerRegion *region,
CoreSurface **ret_surface ); CoreSurface **ret_surface );
DFBResult dfb_layer_region_flip_update ( CoreLayerRegion *region, DFBResult dfb_layer_region_flip_update ( CoreLayerRegion *region,
const DFBRegion *update, const DFBRegion *update,
DFBSurfaceFlipFlags flags ); DFBSurfaceFlipFlags flags );
DFBResult
dfb_layer_region_flip_update_stereo ( CoreLayerRegion *region,
const DFBRegion *left_update
,
const DFBRegion *right_updat
e,
DFBSurfaceFlipFlags flags );
/* /*
* Configuration * Configuration
*/ */
DFBResult dfb_layer_region_set_configuration( CoreLayerRegion *r egion, DFBResult dfb_layer_region_set_configuration( CoreLayerRegion *r egion,
CoreLayerRegionConfig *c onfig, CoreLayerRegionConfig *c onfig,
CoreLayerRegionConfigFlags f lags ); CoreLayerRegionConfigFlags f lags );
DFBResult dfb_layer_region_get_configuration( CoreLayerRegion *region , DFBResult dfb_layer_region_get_configuration( CoreLayerRegion *region ,
CoreLayerRegionConfig *config ); CoreLayerRegionConfig *config );
 End of changes. 1 change blocks. 
0 lines changed or deleted 8 lines changed or added


 layers.h   layers.h 
skipping to change at line 43 skipping to change at line 43
#include <core/coretypes.h> #include <core/coretypes.h>
#include <core/gfxcard.h> #include <core/gfxcard.h>
#include <core/surface_buffer.h> #include <core/surface_buffer.h>
struct __DFB_CoreLayerRegionConfig { struct __DFB_CoreLayerRegionConfig {
int width; /* width of the source in pixels */ int width; /* width of the source in pixels */
int height; /* height of the source i n pixels */ int height; /* height of the source i n pixels */
DFBSurfacePixelFormat format; /* pixel format of the so urce surface */ DFBSurfacePixelFormat format; /* pixel format of the so urce surface */
DFBSurfaceColorSpace colorspace; /* color space of the sou rce surface */
DFBSurfaceCapabilities surface_caps; /* capabilities of the so urce surface */ DFBSurfaceCapabilities surface_caps; /* capabilities of the so urce surface */
DFBDisplayLayerBufferMode buffermode; /* surface buffer configu ration */ DFBDisplayLayerBufferMode buffermode; /* surface buffer configu ration */
DFBDisplayLayerOptions options; /* various configuration options */ DFBDisplayLayerOptions options; /* various configuration options */
DFBDisplayLayerSourceID source_id; /* selected source */ DFBDisplayLayerSourceID source_id; /* selected source */
DFBRectangle source; /* viewport within source (input) */ DFBRectangle source; /* viewport within source (input) */
DFBRectangle dest; /* viewport on screen (ou tput) */ DFBRectangle dest; /* viewport on screen (ou tput) */
skipping to change at line 65 skipping to change at line 66
DFBColorKey src_key; /* source color key */ DFBColorKey src_key; /* source color key */
DFBColorKey dst_key; /* destination color key */ DFBColorKey dst_key; /* destination color key */
int parity; /* field parity (for inte rlaced) */ int parity; /* field parity (for inte rlaced) */
u8 alpha_ramp[4]; /* alpha values for 1 or 2 bit lookup */ u8 alpha_ramp[4]; /* alpha values for 1 or 2 bit lookup */
DFBRegion *clips; /* clip regions */ DFBRegion *clips; /* clip regions */
int num_clips; /* number of clip regions */ int num_clips; /* number of clip regions */
DFBBoolean positive; /* show or cut out region s */ DFBBoolean positive; /* show or cut out region s */
bool keep_buffers;
}; };
#if D_DEBUG_ENABLED #if D_DEBUG_ENABLED
#define DFB_CORE_LAYER_REGION_CONFIG_DEBUG_AT( domain, config ) \ #define DFB_CORE_LAYER_REGION_CONFIG_DEBUG_AT( domain, config ) \
do { \ do { \
const CoreLayerRegionConfig *_config = config; \ const CoreLayerRegionConfig *_config = config; \
\ \
D_DEBUG_AT( domain, " -> size %dx%d\n", _config->width, _c onfig->height ); \ D_DEBUG_AT( domain, " -> size %dx%d\n", _config->width, _c onfig->height ); \
D_DEBUG_AT( domain, " -> format %s\n", dfb_pixelformat_name( _config->format ) ); \ D_DEBUG_AT( domain, " -> format %s\n", dfb_pixelformat_name( _config->format ) ); \
D_DEBUG_AT( domain, " -> surf caps 0x%08x\n", _config->surface_ caps ); \ D_DEBUG_AT( domain, " -> surf caps 0x%08x\n", _config->surface_ caps ); \
skipping to change at line 102 skipping to change at line 101
CLRCF_NONE = 0x00000000, CLRCF_NONE = 0x00000000,
CLRCF_WIDTH = 0x00000001, CLRCF_WIDTH = 0x00000001,
CLRCF_HEIGHT = 0x00000002, CLRCF_HEIGHT = 0x00000002,
CLRCF_FORMAT = 0x00000004, CLRCF_FORMAT = 0x00000004,
CLRCF_SURFACE_CAPS = 0x00000008, CLRCF_SURFACE_CAPS = 0x00000008,
CLRCF_BUFFERMODE = 0x00000010, CLRCF_BUFFERMODE = 0x00000010,
CLRCF_OPTIONS = 0x00000020, CLRCF_OPTIONS = 0x00000020,
CLRCF_SOURCE_ID = 0x00000040, CLRCF_SOURCE_ID = 0x00000040,
CLRCF_COLORSPACE = 0x00000080,
CLRCF_SOURCE = 0x00000100, CLRCF_SOURCE = 0x00000100,
CLRCF_DEST = 0x00000200, CLRCF_DEST = 0x00000200,
CLRCF_CLIPS = 0x00000400, CLRCF_CLIPS = 0x00000400,
CLRCF_OPACITY = 0x00001000, CLRCF_OPACITY = 0x00001000,
CLRCF_ALPHA_RAMP = 0x00002000, CLRCF_ALPHA_RAMP = 0x00002000,
CLRCF_SRCKEY = 0x00010000, CLRCF_SRCKEY = 0x00010000,
CLRCF_DSTKEY = 0x00020000, CLRCF_DSTKEY = 0x00020000,
CLRCF_PARITY = 0x00100000, CLRCF_PARITY = 0x00100000,
CLRCF_SURFACE = 0x10000000, CLRCF_SURFACE = 0x10000000,
CLRCF_PALETTE = 0x20000000, CLRCF_PALETTE = 0x20000000,
CLRCF_FREEZE = 0x80000000, CLRCF_FREEZE = 0x80000000,
CLRCF_ALL = 0xB013377F CLRCF_ALL = 0xB01337FF
} CoreLayerRegionConfigFlags; } CoreLayerRegionConfigFlags;
typedef struct { typedef struct {
/** Driver Control **/ /** Driver Control **/
/* /*
* Return size of layer data (shared memory). * Return size of layer data (shared memory).
*/ */
int (*LayerDataSize) ( void ); int (*LayerDataSize) ( void );
skipping to change at line 201 skipping to change at line 201
/** Configuration **/ /** Configuration **/
/* /*
* Adjust brightness, contrast, saturation etc. * Adjust brightness, contrast, saturation etc.
*/ */
DFBResult (*SetColorAdjustment) ( CoreLayer *layer, DFBResult (*SetColorAdjustment) ( CoreLayer *layer,
void *driver_dat a, void *driver_dat a,
void *layer_data , void *layer_data ,
DFBColorAdjustment *adjustment ); DFBColorAdjustment *adjustment );
/*
* Set the stereo depth for L/R mono and stereo layers. // FIXME:
Use SetRegion()!
*/
DFBResult (*SetStereoDepth) ( CoreLayer *layer,
void *driver_dat
a,
void *layer_data
,
bool follow_vid
eo,
int z );
/** Region Control **/ /** Region Control **/
/* /*
* Check all parameters and return if this region is supported. * Check all parameters and return if this region is supported.
*/ */
DFBResult (*TestRegion) ( CoreLayer *layer, DFBResult (*TestRegion) ( CoreLayer *layer,
void *driver_data, void *driver_data,
void *layer_data, void *layer_data,
CoreLayerRegionConfig *config, CoreLayerRegionConfig *config,
CoreLayerRegionConfigFlags *failed ); CoreLayerRegionConfigFlags *failed );
skipping to change at line 233 skipping to change at line 242
* have changed. Surface and palette are only set if updated or new. * have changed. Surface and palette are only set if updated or new.
*/ */
DFBResult (*SetRegion) ( CoreLayer *layer, DFBResult (*SetRegion) ( CoreLayer *layer,
void *driver_data, void *driver_data,
void *layer_data, void *layer_data,
void *region_data, void *region_data,
CoreLayerRegionConfig *config, CoreLayerRegionConfig *config,
CoreLayerRegionConfigFlags updated, CoreLayerRegionConfigFlags updated,
CoreSurface *surface, CoreSurface *surface,
CorePalette *palette, CorePalette *palette,
CoreSurfaceBufferLock *lock ); CoreSurfaceBufferLock *left_lock,
CoreSurfaceBufferLock *right_lock );
/* /*
* Remove a region from the layer. * Remove a region from the layer.
*/ */
DFBResult (*RemoveRegion) ( CoreLayer *layer, DFBResult (*RemoveRegion) ( CoreLayer *layer,
void *driver_data, void *driver_data,
void *layer_data, void *layer_data,
void *region_data ); void *region_data );
/* /*
* Flip the surface of the region. * Flip the surface of the region.
*/ */
DFBResult (*FlipRegion) ( CoreLayer *layer, DFBResult (*FlipRegion) ( CoreLayer *layer,
void *driver_data, void *driver_data,
void *layer_data, void *layer_data,
void *region_data, void *region_data,
CoreSurface *surface, CoreSurface *surface,
DFBSurfaceFlipFlags flags, DFBSurfaceFlipFlags flags,
CoreSurfaceBufferLock *lock ); CoreSurfaceBufferLock *left_lock,
CoreSurfaceBufferLock *right_lock );
/* /*
* Indicate updates to the front buffer content. * Indicate updates to the front buffer content.
*/ */
DFBResult (*UpdateRegion) ( CoreLayer *layer, DFBResult (*UpdateRegion) ( CoreLayer *layer,
void *driver_data, void *driver_data,
void *layer_data, void *layer_data,
void *region_data, void *region_data,
CoreSurface *surface, CoreSurface *surface,
const DFBRegion *update, const DFBRegion *left_update,
CoreSurfaceBufferLock *lock ); CoreSurfaceBufferLock *left_lock,
const DFBRegion *right_update,
CoreSurfaceBufferLock *right_lock );
/* /*
* Control hardware deinterlacing. * Control hardware deinterlacing.
*/ */
DFBResult (*SetInputField)( CoreLayer *layer, DFBResult (*SetInputField)( CoreLayer *layer,
void *driver_data, void *driver_data,
void *layer_data, void *layer_data,
void *region_data, void *region_data,
int field ); int field );
 End of changes. 8 change blocks. 
7 lines changed or deleted 24 lines changed or added


 list.h   list.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__LIST_H__ #ifndef __DIRECT__LIST_H__
#define __DIRECT__LIST_H__ #define __DIRECT__LIST_H__
#include <direct/types.h>
#include <direct/debug.h> #include <direct/debug.h>
#include <direct/thread.h>
struct __D_DirectLink { struct __D_DirectLink {
int magic; int magic;
DirectLink *next; DirectLink *next;
DirectLink *prev; /* The 'prev' pointer of the first element always po ints DirectLink *prev; /* The 'prev' pointer of the first element always po ints
to the last element of the list, for fast appendi ng ;-) */ to the last element of the list, for fast appendi ng ;-) */
}; };
static __inline__ void static __inline__ void
direct_list_prepend( DirectLink **list, DirectLink *link ) direct_list_prepend( DirectLink **list, DirectLink *link )
{ {
DirectLink *first = *list; DirectLink *first;
D_ASSERT( list != NULL );
D_ASSERT( link != NULL );
first = *list;
link->next = first; link->next = first;
if (first) { if (first) {
D_MAGIC_ASSERT( first, DirectLink ); D_MAGIC_ASSERT( first, DirectLink );
link->prev = first->prev; link->prev = first->prev;
first->prev = link; first->prev = link;
} }
skipping to change at line 68 skipping to change at line 73
link->prev = link; link->prev = link;
*list = link; *list = link;
D_MAGIC_SET( link, DirectLink ); D_MAGIC_SET( link, DirectLink );
} }
static __inline__ void static __inline__ void
direct_list_append( DirectLink **list, DirectLink *link ) direct_list_append( DirectLink **list, DirectLink *link )
{ {
DirectLink *first = *list; DirectLink *first;
D_ASSERT( list != NULL );
D_ASSERT( link != NULL );
first = *list;
link->next = NULL; link->next = NULL;
if (first) { if (first) {
DirectLink *last = first->prev; DirectLink *last = first->prev;
D_MAGIC_ASSERT( first, DirectLink ); D_MAGIC_ASSERT( first, DirectLink );
D_MAGIC_ASSERT( last, DirectLink ); D_MAGIC_ASSERT( last, DirectLink );
link->prev = last; link->prev = last;
last->next = first->prev = link; last->next = first->prev = link;
} }
else else
*list = link->prev = link; *list = link->prev = link;
D_MAGIC_SET( link, DirectLink ); D_MAGIC_SET( link, DirectLink );
} }
static __inline__ void
direct_list_insert( DirectLink **list, DirectLink *link, DirectLink *before
)
{
DirectLink *first;
D_ASSERT( list != NULL );
D_ASSERT( link != NULL );
first = *list;
D_MAGIC_ASSERT_IF( first, DirectLink );
D_MAGIC_ASSERT_IF( before, DirectLink );
if (first == before) {
direct_list_prepend( list, link );
}
else if (first == NULL || before == NULL) {
direct_list_append( list, link );
}
else {
DirectLink *prev = before->prev;
D_MAGIC_ASSERT( prev, DirectLink );
prev->next = link;
link->prev = prev;
link->next = before;
before->prev = link;
D_MAGIC_SET( link, DirectLink );
}
}
static __inline__ bool static __inline__ bool
direct_list_contains_element_EXPENSIVE( DirectLink *list, DirectLink *link ) direct_list_contains_element_EXPENSIVE( DirectLink *list, DirectLink *link )
{ {
D_MAGIC_ASSERT_IF( list, DirectLink ); D_MAGIC_ASSERT_IF( list, DirectLink );
while (list) { while (list) {
if (list == link) if (list == link)
return true; return true;
list = list->next; list = list->next;
skipping to change at line 119 skipping to change at line 164
D_MAGIC_ASSERT( list, DirectLink ); D_MAGIC_ASSERT( list, DirectLink );
count++; count++;
list = list->next; list = list->next;
} }
return count; return count;
} }
static __inline__ void static __inline__ bool
direct_list_remove( DirectLink **list, DirectLink *link ) direct_list_remove( DirectLink **list, DirectLink *link )
{ {
DirectLink *next; DirectLink *next;
DirectLink *prev; DirectLink *prev;
D_ASSERT( list != NULL ); D_ASSERT( list != NULL );
D_ASSERT( direct_list_contains_element_EXPENSIVE( *list, link ) ); D_ASSERT( direct_list_contains_element_EXPENSIVE( *list, link ) );
D_MAGIC_ASSERT( *list, DirectLink ); D_MAGIC_ASSERT( *list, DirectLink );
skipping to change at line 154 skipping to change at line 199
*list = next; *list = next;
else { else {
D_MAGIC_ASSERT( prev, DirectLink ); D_MAGIC_ASSERT( prev, DirectLink );
prev->next = next; prev->next = next;
} }
link->next = link->prev = NULL; link->next = link->prev = NULL;
D_MAGIC_CLEAR( link ); D_MAGIC_CLEAR( link );
return true;
} }
static __inline__ void static __inline__ void
direct_list_move_to_front( DirectLink **list, DirectLink *link ) direct_list_move_to_front( DirectLink **list, DirectLink *link )
{ {
DirectLink *next; DirectLink *next;
DirectLink *prev; DirectLink *prev;
DirectLink *first; DirectLink *first;
D_ASSERT( list != NULL ); D_ASSERT( list != NULL );
skipping to change at line 198 skipping to change at line 245
prev->next = next; prev->next = next;
link->next = first; link->next = first;
first->prev = link; first->prev = link;
*list = link; *list = link;
} }
#ifdef __GNUC__
#define direct_list_check_link( link ) \ #define direct_list_check_link( link ) \
({ \ ({ \
D_MAGIC_ASSERT_IF( link, DirectLink ); \ D_MAGIC_ASSERT_IF( link, DirectLink ); \
link != NULL; \ link != NULL; \
}) })
#else
#define direct_list_check_link( link ) \
(link != NULL)
#endif
#define direct_list_foreach(elem, list) \ #define direct_list_foreach(elem, list) \
for (elem = (__typeof__(elem))(list); \ for (elem = (__typeof__(elem))(list); \
direct_list_check_link( (DirectLink*)(elem) ); \ direct_list_check_link( (DirectLink*)(elem) ); \
elem = (__typeof__(elem))(((DirectLink*)(elem))->next)) elem = (__typeof__(elem))(((DirectLink*)(elem))->next))
#define direct_list_foreach_via(elem, list, _link) \
for (elem = (list) ? (__typeof__(elem)) ((void*)(list) - (long)(&((__t
ypeof__(elem)) NULL)->_link)) : NULL; \
direct_list_check_link( (elem) ? &(elem)->_link : NULL ); \
elem = ((elem)->_link.next) ? (__typeof__(elem)) ((void*)((elem)-
>_link.next) - (long)(&((__typeof__(elem)) NULL)->_link)) : NULL )
#define direct_list_foreach_via_safe(elem, temp, list, _link)
\
for (elem = (list) ? (__typeof__(elem)) ((void*)(list) - (long)(&((__t
ypeof__(elem)) NULL)->_link)) : NULL, temp = ((elem) ? (((elem)->_link.next
) ? (__typeof__(elem)) ((void*)((elem)->_link.next) - (long)(&((__typeof__(
elem)) NULL)->_link)) : NULL) : NULL); \
direct_list_check_link( (elem) ? &(elem)->_link : NULL ); \
elem = (__typeof__(elem))(temp), temp = ((elem) ? (((elem)->_link
.next) ? (__typeof__(elem)) ((void*)((elem)->_link.next) - (long)(&((__type
of__(elem)) NULL)->_link)) : NULL) : NULL) )
#define direct_list_foreach_reverse(elem, list) \ #define direct_list_foreach_reverse(elem, list) \
for (elem = (__typeof__(elem))((list) ? (list)->prev : NULL); \ for (elem = (__typeof__(elem))((list) ? (list)->prev : NULL); \
direct_list_check_link( (DirectLink*)(elem) ); \ direct_list_check_link( (DirectLink*)(elem) ); \
elem = (__typeof__(elem))((((DirectLink*)(elem))->prev->next) ? ( (DirectLink*)(elem))->prev : NULL)) elem = (__typeof__(elem))((((DirectLink*)(elem))->prev->next) ? ( (DirectLink*)(elem))->prev : NULL))
#define direct_list_foreach_safe(elem, temp, list) \ #define direct_list_foreach_safe(elem, temp, list) \
for (elem = (__typeof__(elem))(list), temp = ((__typeof__(temp))(elem) ? (__typeof__(temp))(((DirectLink*)(elem))->next) : NULL); \ for (elem = (__typeof__(elem))(list), temp = ((__typeof__(temp))(elem) ? (__typeof__(temp))(((DirectLink*)(elem))->next) : NULL); \
direct_list_check_link( (DirectLink*)(elem) ); \ direct_list_check_link( (DirectLink*)(elem) ); \
elem = (__typeof__(elem))(temp), temp = ((__typeof__(temp))(elem) ? (__typeof__(temp))(((DirectLink*)(elem))->next) : NULL)) elem = (__typeof__(elem))(temp), temp = ((__typeof__(temp))(elem) ? (__typeof__(temp))(((DirectLink*)(elem))->next) : NULL))
#define direct_list_foreach_remove(elem, list)
\
while ((elem = (__typeof__(elem))(list)) && direct_list_remove( &(list
), (DirectLink*)(elem) ))
#endif #endif
 End of changes. 12 change blocks. 
5 lines changed or deleted 81 lines changed or added


 lock.h   lock.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __FUSION__LOCK_H__ #ifndef __FUSION__LOCK_H__
#define __FUSION__LOCK_H__ #define __FUSION__LOCK_H__
#include <pthread.h>
#include <fusion/types.h> #include <fusion/types.h>
#include <direct/messages.h> #include <direct/messages.h>
#include <direct/thread.h>
#include <direct/util.h> #include <direct/util.h>
typedef struct { typedef struct {
pthread_mutex_t lock; DirectMutex lock;
pthread_cond_t cond; DirectWaitQueue cond;
int count; int count;
char *name; char *name;
} FusionSkirmishSingle; } FusionSkirmishSingle;
typedef struct { typedef union {
/* multi app */ /* multi app */
struct { struct {
int id; int id;
const FusionWorldShared *shared; const FusionWorldShared *shared;
/* builtin impl */ /* builtin impl */
struct { struct {
unsigned int locked; unsigned int locked;
pid_t owner; pid_t owner;
DirectLink *waiting; DirectLink *waiting;
bool requested; bool requested;
skipping to change at line 69 skipping to change at line 68
} multi; } multi;
/* single app */ /* single app */
FusionSkirmishSingle *single; FusionSkirmishSingle *single;
} FusionSkirmish; } FusionSkirmish;
/* /*
* Initialize. * Initialize.
*/ */
DirectResult fusion_skirmish_init ( FusionSkirmish *skirmish, DirectResult FUSION_API fusion_skirmish_init ( FusionSkirmish *skirmis
const char *name, h,
const FusionWorld *world ); const char *name,
const FusionWorld *world )
DirectResult fusion_skirmish_init2 ( FusionSkirmish *skirmish, ;
const char *name,
const FusionWorld *world,
bool local );
/* /*
* Lock. * Lock.
*/ */
DirectResult fusion_skirmish_prevail( FusionSkirmish *skirmish ); DirectResult FUSION_API fusion_skirmish_prevail( FusionSkirmish *skirmis h );
/* /*
* Try lock. * Try lock.
*/ */
DirectResult fusion_skirmish_swoop ( FusionSkirmish *skirmish ); DirectResult FUSION_API fusion_skirmish_swoop ( FusionSkirmish *skirmis h );
/* /*
* Find out how many times current thread has acquired lock. * Find out how many times current thread has acquired lock.
*/ */
DirectResult fusion_skirmish_lock_count( FusionSkirmish *skirmish, int *loc k_count ); DirectResult FUSION_API fusion_skirmish_lock_count( FusionSkirmish *skirmis h, int *lock_count );
/* /*
* Unlock. * Unlock.
*/ */
DirectResult fusion_skirmish_dismiss( FusionSkirmish *skirmish ); DirectResult FUSION_API fusion_skirmish_dismiss( FusionSkirmish *skirmis h );
/* /*
* Deinitialize. * Deinitialize.
*/ */
DirectResult fusion_skirmish_destroy( FusionSkirmish *skirmish ); DirectResult FUSION_API fusion_skirmish_destroy( FusionSkirmish *skirmis h );
/* /*
* Wait & Notify. * Wait & Notify.
* *
* Must be locked! * Must be locked!
*/ */
DirectResult fusion_skirmish_wait ( FusionSkirmish *skirmish, DirectResult FUSION_API fusion_skirmish_wait ( FusionSkirmish *skirmis
unsigned int timeout ); h,
DirectResult fusion_skirmish_notify ( FusionSkirmish *skirmish ); unsigned int timeout
);
DirectResult FUSION_API fusion_skirmish_notify ( FusionSkirmish *skirmis
h );
#if D_DEBUG_ENABLED #if D_DEBUG_ENABLED
#define FUSION_SKIRMISH_ASSERT(skirmish) \ #define FUSION_SKIRMISH_ASSERT(skirmish) \
do { \ do { \
int lock_count; \ int lock_count; \
\ \
D_ASSERT( skirmish != NULL ); \ D_ASSERT( skirmish != NULL ); \
\ \
D_ASSERT( fusion_skirmish_lock_count( skirmish, &lock_count ) == DR_OK ); \ D_ASSERT( fusion_skirmish_lock_count( skirmish, &lock_count ) == DR_OK ); \
D_ASSERT( lock_count > 0 ); \ D_ASSERT( lock_count > 0 ); \
} while (0) } while (0)
#else #else
#define FUSION_SKIRMISH_ASSERT(skirmish) \ #define FUSION_SKIRMISH_ASSERT(skirmish) \
do { \ do { \
} while (0) } while (0)
#endif #endif
typedef enum {
FUSION_SKIRMISH_PERMIT_NONE = 0x00000000,
FUSION_SKIRMISH_PERMIT_PREVAIL = 0x00000001,
FUSION_SKIRMISH_PERMIT_SWOOP = 0x00000002,
FUSION_SKIRMISH_PERMIT_DISMISS = 0x00000004,
FUSION_SKIRMISH_PERMIT_LOCK_COUNT = 0x00000008,
FUSION_SKIRMISH_PERMIT_WAIT = 0x00000010,
FUSION_SKIRMISH_PERMIT_NOTIFY = 0x00000020,
FUSION_SKIRMISH_PERMIT_DESTROY = 0x00000040,
FUSION_SKIRMISH_PERMIT_ALL = 0x0000007F,
} FusionSkirmishPermissions;
/*
* Give permissions to another fusionee to use the skirmish.
*/
DirectResult fusion_skirmish_add_permissions( FusionSkirmish *sk
imrish,
FusionID fu
sion_id,
FusionSkirmishPermissions pe
rmissions );
#endif #endif
 End of changes. 12 change blocks. 
45 lines changed or deleted 20 lines changed or added


 log.h   log.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__LOG_H__ #ifndef __DIRECT__LOG_H__
#define __DIRECT__LOG_H__ #define __DIRECT__LOG_H__
#include <direct/types.h> #include <direct/os/log.h>
#include <direct/messages.h> #include <direct/messages.h>
typedef enum { /**************************************************************************
DLT_STDERR, /* Simply print out log on stderr. */ ********************************************/
DLT_FILE, /* Write log into a file. */
DLT_UDP /* Send out log via UDP. */
} DirectLogType;
/* /*
* Creates a logging facility. * Creates a logging facility.
* *
* For each 'type' the 'param' has a different meaning: * For each 'type' the 'param' has a different meaning:
* DLT_STDERR ignored (leave NULL) * DLT_STDERR ignored (leave NULL)
* DLT_FILE file name * DLT_FILE file name
* DLT_UDP <ip>:<port> * DLT_UDP <ip>:<port>
*/ */
DirectResult direct_log_create ( DirectLogType type, DirectResult DIRECT_API direct_log_create ( DirectLogType type,
const char *param, const char *param,
DirectLog **ret_log ); DirectLog **ret_log )
;
/* /*
* Destroys a logging facility. * Destroys a logging facility.
*/ */
DirectResult direct_log_destroy ( DirectLog *log ); DirectResult DIRECT_API direct_log_destroy ( DirectLog *log );
/* /*
* Write to the log in a printf fashion. * Write to the log in a printf fashion.
* *
* If log is NULL, the default log is used if it's valid, * If log is NULL, the default log is used if it's valid,
* otherwise stderr is used a fallback until now. * otherwise stderr is used a fallback until now.
*/ */
DirectResult direct_log_printf ( DirectLog *log, DirectResult DIRECT_API direct_log_printf ( DirectLog *log,
const char *format, ... ) D_FOR const char *format, .
MAT_PRINTF(2); .. ) D_FORMAT_PRINTF(2);
/* /*
* Set the default log that's used when no valid log is passed. * Set the default log that's used when no valid log is passed.
*/ */
DirectResult direct_log_set_default( DirectLog *log ); DirectResult DIRECT_API direct_log_set_default( DirectLog *log );
/* /*
* Locks a logging facility for non-intermixed output of multiple calls in multiple threads. Not mandatory. * Locks a logging facility for non-intermixed output of multiple calls in multiple threads. Not mandatory.
*/ */
void direct_log_lock ( DirectLog *log ); void DIRECT_API direct_log_lock ( DirectLog *log );
/* /*
* Unlocks a logging facility. * Unlocks a logging facility.
*/ */
void direct_log_unlock ( DirectLog *log ); void DIRECT_API direct_log_unlock ( DirectLog *log );
/*
* Set a buffer to be used for the log data.
*/
DirectResult DIRECT_API direct_log_set_buffer ( DirectLog *log,
char *buffer,
size_t bytes );
/*
* Flush the log data and optionally synchronize with the output.
*/
DirectResult DIRECT_API direct_log_flush ( DirectLog *log,
bool sync );
/* /*
* Returns the default log. * Returns the default log.
*/ */
DirectLog *direct_log_default( void ); DirectLog DIRECT_API *direct_log_default( void );
#define d_printf( ... ) direct_log_printf( NULL, __VA_ARGS__ )
void __D_log_init( void );
void __D_log_deinit( void );
#endif #endif
 End of changes. 10 change blocks. 
18 lines changed or deleted 35 lines changed or added


 map.h   map.h 
skipping to change at line 47 skipping to change at line 47
void *ctx ); void *ctx );
typedef unsigned int (*DirectMapHashFunc) ( DirectMap *map , typedef unsigned int (*DirectMapHashFunc) ( DirectMap *map ,
const void *key , const void *key ,
void *ctx ); void *ctx );
typedef DirectEnumerationResult (*DirectMapIteratorFunc)( DirectMap *map , typedef DirectEnumerationResult (*DirectMapIteratorFunc)( DirectMap *map ,
void *obj ect, void *obj ect,
void *ctx ); void *ctx );
DirectResult direct_map_create ( unsigned int initial_size, DirectResult DIRECT_API direct_map_create ( unsigned int initia
DirectMapCompareFunc compare_func, l_size,
DirectMapHashFunc hash_func, DirectMapCompareFunc compar
void *ctx, e_func,
DirectMap **ret_map ); DirectMapHashFunc hash_f
unc,
void *ctx,
DirectMap **ret_ma
p );
void direct_map_destroy( DirectMap *map ); void DIRECT_API direct_map_destroy( DirectMap *map );
DirectResult direct_map_insert ( DirectMap *map, DirectResult DIRECT_API direct_map_insert ( DirectMap *map,
const void *key, const void *key,
void *object ); void *object
);
DirectResult direct_map_remove ( DirectMap *map, DirectResult DIRECT_API direct_map_remove ( DirectMap *map,
const void *key ); const void *key );
void *direct_map_lookup ( DirectMap *map, void DIRECT_API *direct_map_lookup ( DirectMap *map,
const void *key ); const void *key );
void direct_map_iterate( DirectMap *map, void DIRECT_API direct_map_iterate( DirectMap *map,
DirectMapIteratorFunc func, DirectMapIteratorFunc func,
void *ctx ); void *ctx );
#endif #endif
 End of changes. 6 change blocks. 
16 lines changed or deleted 21 lines changed or added


 mem.h   mem.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__MEM_H__ #ifndef __DIRECT__MEM_H__
#define __DIRECT__MEM_H__ #define __DIRECT__MEM_H__
#include <stddef.h> #include <direct/os/mem.h>
#include <direct/build.h> /************************************************************************** ********************************************/
void direct_print_memleaks( void ); void DIRECT_API direct_print_memleaks( void );
void direct_free ( const char *file, int line, /**************************************************************************
const char *func, const char *what, void *mem ); ********************************************/
void *direct_malloc ( const char *file, int line, void DIRECT_API *direct_dbg_malloc ( const char *file, int line,
const char *func, size_t bytes ); const char *func, size_t bytes );
void *direct_calloc ( const char *file, int line, void DIRECT_API *direct_dbg_calloc ( const char *file, int line,
const char *func, size_t count, size_t bytes); const char *func, size_t count, size_t
bytes);
void *direct_realloc( const char *file, int line, void DIRECT_API *direct_dbg_realloc( const char *file, int line,
const char *func, const char *what, void *mem, const char *func, const char *what, vo
size_t bytes ); id *mem,
size_t bytes );
char *direct_strdup ( const char *file, int line, char DIRECT_API *direct_dbg_strdup ( const char *file, int line,
const char *func, const char *string ); const char *func, const char *str );
#if DIRECT_BUILD_DEBUG || defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FO void DIRECT_API direct_dbg_free ( const char *file, int line,
RCE_DEBUG) const char *func, const char *what, vo
id *mem );
/**************************************************************************
********************************************/
#if DIRECT_BUILD_DEBUG || defined(DIRECT_ENABLE_DEBUG) || defined(DIRECT_FO
RCE_DEBUG) || defined(DIRECT_MEM_DEBUG)
#if !DIRECT_BUILD_DEBUGS #if !DIRECT_BUILD_DEBUGS
#warning Building with debug, but library headers suggest that debug is not supported. #warning Building with debug, but library headers suggest that debug is not supported.
#endif #endif
#define D_FREE(mem) direct_free( __FILE__, __LINE__, __FUNCTION__ #define D_MALLOC(bytes) direct_dbg_malloc( __FILE__, __LINE__, __FUNC
, #mem, mem ) TION__, bytes )
#define D_MALLOC(bytes) direct_malloc( __FILE__, __LINE__, __FUNCTION #define D_CALLOC(count,bytes) direct_dbg_calloc( __FILE__, __LINE__, __FUNC
__, bytes ) TION__, count, bytes )
#define D_CALLOC(count,bytes) direct_calloc( __FILE__, __LINE__, __FUNCTION #define D_REALLOC(mem,bytes) direct_dbg_realloc( __FILE__, __LINE__, __FUN
__, count, bytes ) CTION__, #mem, mem, bytes )
#define D_REALLOC(mem,bytes) direct_realloc( __FILE__, __LINE__, __FUNCTIO #define D_STRDUP(str) direct_dbg_strdup( __FILE__, __LINE__, __FUNC
N__, #mem, mem, bytes ) TION__, str )
#define D_STRDUP(string) direct_strdup( __FILE__, __LINE__, __FUNCTION #define D_FREE(mem) direct_dbg_free( __FILE__, __LINE__, __FUNCTI
__, string ) ON__, #mem, mem )
#else #else
#include <stdlib.h> /**************************************************************************
#include <string.h> ********************************************/
#define D_FREE free /* base malloc is declared in direct/os/mem.h */
#define D_MALLOC malloc
#define D_CALLOC calloc #define D_MALLOC direct_malloc
#define D_REALLOC realloc #define D_CALLOC direct_calloc
#define D_STRDUP strdup #define D_REALLOC direct_realloc
#define D_STRDUP direct_strdup
#define D_FREE direct_free
#endif #endif
void __D_mem_init( void );
void __D_mem_deinit( void );
#endif #endif
 End of changes. 14 change blocks. 
34 lines changed or deleted 48 lines changed or added


 memcpy.h   memcpy.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__MEMCPY_H__ #ifndef __DIRECT__MEMCPY_H__
#define __DIRECT__MEMCPY_H__ #define __DIRECT__MEMCPY_H__
#include <stdlib.h> #include <direct/types.h>
#include <string.h>
void direct_find_best_memcpy( void ); void DIRECT_API direct_find_best_memcpy( void );
void direct_print_memcpy_routines( void ); void DIRECT_API direct_print_memcpy_routines( void );
extern void *(*direct_memcpy)( void *to, const void *from, size_t len ); extern void DIRECT_API *(*direct_memcpy)( void *to, const void *from, size_ t len );
static __inline__ void *direct_memmove( void *to, const void *from, size_t len ) static __inline__ void *direct_memmove( void *to, const void *from, size_t len )
{ {
if ((from < to && ((const char*) from + len) < ((char*) to)) || if ((from < to && ((const char*) from + len) < ((char*) to)) ||
(((char*) to + len) < ((const char*) from))) (((char*) to + len) < ((const char*) from)))
return direct_memcpy( to, from, len ); return direct_memcpy( to, from, len );
else else
return memmove( to, from, len ); return memmove( to, from, len );
} }
 End of changes. 4 change blocks. 
6 lines changed or deleted 5 lines changed or added


 messages.h   messages.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__MESSAGES_H__ #ifndef __DIRECT__MESSAGES_H__
#define __DIRECT__MESSAGES_H__ #define __DIRECT__MESSAGES_H__
#include <direct/build.h>
#include <direct/types.h> #include <direct/types.h>
#if __GNUC__ >= 3
#define D_FORMAT_PRINTF(n) __attribute__((__format__ (__printf__, n
, n+1)))
#else
#define D_FORMAT_PRINTF(n)
#endif
typedef enum {
DMT_NONE = 0x00000000, /* No message type. */
DMT_BANNER = 0x00000001, /* Startup banner. */
DMT_INFO = 0x00000002, /* Info messages. */
DMT_WARNING = 0x00000004, /* Warnings. */
DMT_ERROR = 0x00000008, /* Error messages: regular, with DFBR
esult, bugs,
system call errors, dlopen errors
*/
DMT_UNIMPLEMENTED = 0x00000010, /* Messages notifying unimplemented f
unctionality. */
DMT_ONCE = 0x00000020, /* One-shot messages .*/
DMT_ALL = 0x0000003f /* All types. */
} DirectMessageType;
#if DIRECT_BUILD_TEXT #if DIRECT_BUILD_TEXT
#include <errno.h> #include <direct/compiler.h>
#include <direct/conf.h> #include <direct/conf.h>
void direct_messages_info ( const char *format, ... ) D_FORMAT_PRI NTF(1); void DIRECT_API direct_messages_info ( const char *format, ... ) D _FORMAT_PRINTF(1);
void direct_messages_error ( const char *format, ... ) D_FORMAT_PRI NTF(1); void DIRECT_API direct_messages_error ( const char *format, ... ) D _FORMAT_PRINTF(1);
void direct_messages_derror ( DirectResult result, void DIRECT_API direct_messages_derror ( DirectResult result,
const char *format, ... ) D_FORMAT_PRI const char *format, ... ) D
NTF(2); _FORMAT_PRINTF(2);
void direct_messages_perror ( int erno, void DIRECT_API direct_messages_perror ( int erno,
const char *format, ... ) D_FORMAT_PRI const char *format, ... ) D
NTF(2); _FORMAT_PRINTF(2);
void direct_messages_dlerror ( const char *dlerr, void DIRECT_API direct_messages_dlerror ( const char *dlerr,
const char *format, ... ) D_FORMAT_PRI const char *format, ... ) D
NTF(2); _FORMAT_PRINTF(2);
void direct_messages_once ( const char *func, void DIRECT_API direct_messages_once ( const char *func,
const char *file, const char *file,
int line, int line,
const char *format, ... ) D_FORMAT_PRI const char *format, ... ) D
NTF(4); _FORMAT_PRINTF(4);
void direct_messages_unimplemented( const char *func, void DIRECT_API direct_messages_unimplemented( const char *func,
const char *file, const char *file,
int line ); int line );
void direct_messages_bug ( const char *func, void DIRECT_API direct_messages_bug ( const char *func,
const char *file, const char *file,
int line, int line,
const char *format, ... ) D_FORMAT_PRI const char *format, ... ) D
NTF(4); _FORMAT_PRINTF(4);
void direct_messages_warn ( const char *func, void DIRECT_API direct_messages_warn ( const char *func,
const char *file, const char *file,
int line, int line,
const char *format, ... ) D_FORMAT_PRI const char *format, ... ) D
NTF(4); _FORMAT_PRINTF(4);
#define D_INFO(...) do { \ #define D_INFO(...) do { \
if (!(direct_config->quiet & DMT_INFO)) \ if (!(direct_config->quiet & DMT_INFO)) \
direct_messages_info( __VA_ARGS__ ); \ direct_messages_info( __VA_ARGS__ ); \
} while (0) } while (0)
#define D_ERROR(...) do { \ #define D_ERROR(...) do { \
if (!(direct_config->quiet & DMT_ERROR)) \ if (!(direct_config->quiet & DMT_ERROR)) \
direct_messages_error( __VA_ARGS__ ); \ direct_messages_error( __VA_ARGS__ ); \
} while (0) } while (0)
#define D_DERROR(r,...) do { #define D_ERROR_AT(d,...) do {
\ \
if (!(direct_config->quiet & DMT_ERROR))
\
direct_log_domain_log( &(d), DIRECT
_LOG_ERROR, \
__PRETTY_FUN
CTION__, __FILE__, __LINE__, __VA_ARGS__ ); \
} while (0)
#define D_DERROR(r,...) do {
\
if (!(direct_config->quiet & DMT_ERROR))
\
direct_messages_derror( (DirectResult) r
, __VA_ARGS__ ); \
} while (0)
// FIXME
#define D_DERROR_AT(d,r,...) do {
\
if (!(direct_config->quiet & DMT_ERROR)) \ if (!(direct_config->quiet & DMT_ERROR)) \
direct_messages_derror( (DirectResult)(r) direct_log_domain_log( &(d), DIRECT_LOG_
, __VA_ARGS__ ); \ ERROR, \
__PRETTY_FUNCTION
__, __FILE__, __LINE__, __VA_ARGS__ ); \
} while (0) } while (0)
#define D_PERROR(...) do { \ #define D_PERROR(...) do { \
if (!(direct_config->quiet & DMT_ERROR)) \ if (!(direct_config->quiet & DMT_ERROR)) \
direct_messages_perror( errno, __VA_ARGS __ ); \ direct_messages_perror( errno, __VA_ARGS __ ); \
} while (0) } while (0)
#define D_DLERROR(...) do { \ #define D_DLERROR(...) do { \
if (!(direct_config->quiet & DMT_ERROR)) \ if (!(direct_config->quiet & DMT_ERROR)) \
direct_messages_dlerror( dlerror(), __VA _ARGS__ ); \ direct_messages_dlerror( dlerror(), __VA _ARGS__ ); \
} while (0) } while (0)
#define D_ONCE(...) do { \ #define D_ONCE(...) do { \
if (!(direct_config->quiet & DMT_ONCE)) { \ if (!(direct_config->quiet & DMT_ONCE)) { \
static bool first = true; \ static bool first = true; \
if (first) { \ if (first) { \
direct_messages_once( __FUNCTION__, \ direct_messages_once( __FUNCTION__, \
__FILE__, __L __FILE__, __L
INE__, \ INE__, __VA_ARGS__ ); \
__VA_ARGS__
); \
first = false; \ first = false; \
} \ } \
} \ } \
} while (0) } while (0)
#define D_UNIMPLEMENTED() do { \ #define D_UNIMPLEMENTED() do { \
if (!(direct_config->quiet & DMT_UNIMPLEMENTE D)) { \ if (!(direct_config->quiet & DMT_UNIMPLEMENTE D)) { \
static bool first = true; \ static bool first = true; \
if (first) { \ if (first) { \
direct_messages_unimplemented( __FU NCTION__, \ direct_messages_unimplemented( __FU NCTION__, \
__FI LE__, __LINE__ ); \ __FI LE__, __LINE__ ); \
first = false; \ first = false; \
} \ } \
} \ } \
} while (0) } while (0)
#define D_BUG(...) do { #define D_UNTESTED() do {
\ \
if (!(direct_config->quiet & DMT_UNIMPLEMENTE
D)) { \
static bool first = true;
\
if (first) {
\
direct_messages_unimplemented( __FU
NCTION__, \
__FI
LE__, __LINE__ ); \
first = false;
\
}
\
}
\
} while (0)
#define D_BUG(...) do {
\
if (!(direct_config->quiet & DMT_ERROR)) \ if (!(direct_config->quiet & DMT_ERROR)) \
direct_messages_bug( __FUNCTION__, __FIL direct_messages_bug( __FUNCTION__, __FIL
E__, \ E__, __LINE__, __VA_ARGS__ ); \
__LINE__, __VA_ARGS
__ ); \
} while (0) } while (0)
#define D_WARN(...) do { \ #define D_WARN(...) do { \
if (!(direct_config->quiet & DMT_WARNING)) \ if (!(direct_config->quiet & DMT_WARNING)) \
direct_messages_warn( __FUNCTION__, __FI direct_messages_warn( __FUNCTION__, __FI
LE__, \ LE__, __LINE__, __VA_ARGS__ );\
__LINE__, __VA_ARG
S__ ); \
} while (0) } while (0)
#define D_OOM() (direct_messages_warn( __FUNCTION__, __FILE__, __L INE__, \ #define D_OOM() (direct_messages_warn( __FUNCTION__, __FILE__, __L INE__, \
"out of memory" ), DR_NOLOC ALMEMORY) "out of memory" ), DR_NOLOC ALMEMORY)
#else #else
#define D_INFO(...) do { } while (0) #define D_INFO(x...) do { } while (0)
#define D_ERROR(...) do { } while (0) #define D_ERROR(x...) do { } while (0)
#define D_DERROR(...) do { } while (0) #define D_DERROR(x...) do { } while (0)
#define D_PERROR(...) do { } while (0) #define D_PERROR(x...) do { } while (0)
#define D_DLERROR(...) do { } while (0) #define D_DLERROR(x...) do { } while (0)
#define D_ONCE(...) do { } while (0) #define D_ONCE(x...) do { } while (0)
#define D_UNIMPLEMENTED() do { } while (0) #define D_UNIMPLEMENTED() do { } while (0)
#define D_BUG(...) do { } while (0) #define D_BUG(x...) do { } while (0)
#define D_WARN(...) do { } while (0) #define D_WARN(x...) do { } while (0)
#define D_OOM() (printf("out of memory\n"), DR_NOLOCALME MORY) #define D_OOM() (printf("out of memory\n"), DR_NOLOCALME MORY)
#endif #endif
#endif #endif
 End of changes. 27 change blocks. 
89 lines changed or deleted 98 lines changed or added


 modules.h   modules.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__MODULES_H__ #ifndef __DIRECT__MODULES_H__
#define __DIRECT__MODULES_H__ #define __DIRECT__MODULES_H__
#include <pthread.h>
#include <direct/types.h> #include <direct/types.h>
#include <direct/list.h> #include <direct/list.h>
#include <direct/util.h> #include <direct/util.h>
struct __D_DirectModuleEntry { struct __D_DirectModuleEntry {
DirectLink link; DirectLink link;
int magic; int magic;
DirectModuleDir *directory; DirectModuleDir *directory;
skipping to change at line 58 skipping to change at line 56
char *name; char *name;
const void *funcs; const void *funcs;
int refs; int refs;
char *file; char *file;
void *handle; void *handle;
}; };
struct __D_DirectModuleDir { struct __D_DirectModuleDir {
pthread_mutex_t lock;
const char *path; const char *path;
unsigned int abi_version; unsigned int abi_version;
DirectLink *entries; DirectLink *entries;
DirectModuleEntry *loading; DirectModuleEntry *loading;
}; };
#define DECLARE_MODULE_DIRECTORY(d) \ #define DECLARE_MODULE_DIRECTORY(d) \
extern DirectModuleDir d extern DirectModuleDir d
#define DEFINE_MODULE_DIRECTORY(d,p,n) \ #define DEFINE_MODULE_DIRECTORY(d,p,n) \
DirectModuleDir d = { \ DirectModuleDir d = { \
.lock = PTHREAD_MUTEX_INITIALIZER, \
.path = p, \ .path = p, \
.abi_version = n, \ .abi_version = n, \
.entries = NULL, \ .entries = NULL, \
.loading = NULL, \ .loading = NULL, \
} }
int direct_modules_explore_directory( DirectModuleDir *directory ); int DIRECT_API direct_modules_explore_directory( DirectModuleDir *directo ry );
void direct_modules_register( DirectModuleDir *directory, void DIRECT_API direct_modules_register( DirectModuleDir *directory,
unsigned int abi_version, unsigned int abi_version,
const char *name, const char *name,
const void *funcs ); const void *funcs );
void direct_modules_unregister( DirectModuleDir *directory, void DIRECT_API direct_modules_unregister( DirectModuleDir *directory,
const char *name ); const char *name );
const void *direct_module_ref ( DirectModuleEntry *module ); const void DIRECT_API *direct_module_ref ( DirectModuleEntry *module );
void direct_module_unref( DirectModuleEntry *module ); void DIRECT_API direct_module_unref( DirectModuleEntry *module );
#endif #endif
 End of changes. 8 change blocks. 
15 lines changed or deleted 10 lines changed or added


 mutex.h   mutex.h 
skipping to change at line 34 skipping to change at line 34
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__OS__LINUX__GLIBC__MUTEX_H__ #ifndef __DIRECT__OS__LINUX__GLIBC__MUTEX_H__
#define __DIRECT__OS__LINUX__GLIBC__MUTEX_H__ #define __DIRECT__OS__LINUX__GLIBC__MUTEX_H__
#include <pthread.h> #include <pthread.h>
#include <direct/types.h> #include <direct/util.h>
/************************************************************************** ********************************************/ /************************************************************************** ********************************************/
struct __D_DirectMutex { struct __D_DirectMutex {
pthread_mutex_t lock; pthread_mutex_t lock;
}; };
/************************************************************************** ********************************************/ /************************************************************************** ********************************************/
#define DIRECT_MUTEX_INITIALIZER(name) { PTHREAD_MUTEX_INITIALIZ ER } #define DIRECT_MUTEX_INITIALIZER(name) { PTHREAD_MUTEX_INITIALIZ ER }
#define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name) { PTHREAD_RECURSIVE_MUTEX _INITIALIZER_NP } #define DIRECT_RECURSIVE_MUTEX_INITIALIZER(name) { PTHREAD_RECURSIVE_MUTEX _INITIALIZER_NP }
DirectResult direct_mutex_init ( DirectMutex *mutex );
DirectResult direct_recursive_mutex_init( DirectMutex *mutex );
DirectResult direct_mutex_lock ( DirectMutex *mutex );
DirectResult direct_mutex_unlock ( DirectMutex *mutex );
DirectResult direct_mutex_trylock ( DirectMutex *mutex );
DirectResult direct_mutex_deinit ( DirectMutex *mutex );
#endif #endif
 End of changes. 2 change blocks. 
13 lines changed or deleted 1 lines changed or added


 object.h   object.h 
skipping to change at line 59 skipping to change at line 59
FOS_DEINIT FOS_DEINIT
} FusionObjectState; } FusionObjectState;
struct __Fusion_FusionObject { struct __Fusion_FusionObject {
DirectLink link; DirectLink link;
FusionObjectPool *pool; FusionObjectPool *pool;
int magic; int magic;
FusionObjectID id; FusionObjectID id;
FusionID identity;
FusionObjectState state; FusionObjectState state;
FusionRef ref; FusionRef ref;
FusionReactor *reactor; FusionReactor *reactor;
FusionWorldShared *shared; FusionWorldShared *shared;
FusionHash *properties; FusionHash *properties;
FusionID owner;
}; };
typedef bool (*FusionObjectCallback)( FusionObjectPool *pool, typedef bool (*FusionObjectCallback)( FusionObjectPool *pool,
FusionObject *object, FusionObject *object,
void *ctx ); void *ctx );
FusionObjectPool *fusion_object_pool_create ( const char *name, FusionObjectPool FUSION_API *fusion_object_pool_create ( const char
int objec *name,
t_size, int
int messa object_size,
ge_size, int
FusionObjectDestructor destr message_size,
uctor, FusionObjec
void *ctx, tDestructor destructor,
const FusionWorld *world void
); *ctx,
const Fusio
nWorld *world );
DirectResult fusion_object_pool_destroy( FusionObjectPool *pool, DirectResult FUSION_API fusion_object_pool_destroy ( FusionObjec
const FusionWorld *world tPool *pool,
); const Fusio
nWorld *world );
DirectResult fusion_object_pool_enum ( FusionObjectPool *pool, DirectResult FUSION_API fusion_object_pool_enum ( FusionObjec
FusionObjectCallback callb tPool *pool,
ack, FusionObjec
void *ctx ) tCallback callback,
; void
*ctx );
FusionObject *fusion_object_create ( FusionObjectPool *pool, FusionObject FUSION_API *fusion_object_create ( FusionObjec
const FusionWorld *world, tPool *pool,
FusionID identity ); const Fusio
nWorld *world );
DirectResult fusion_object_get ( FusionObjectPool *pool, DirectResult FUSION_API fusion_object_get ( FusionObjec
FusionObjectID object_id, tPool *pool,
FusionObject **ret_object ); FusionObjec
tID object_id,
FusionObjec
t **ret_object );
DirectResult fusion_object_set_lock( FusionObject *object, DirectResult FUSION_API fusion_object_set_lock ( FusionObjec
FusionSkirmish *lock ); t *object,
FusionSkirm
ish *lock );
DirectResult fusion_object_activate( FusionObject *object ); DirectResult FUSION_API fusion_object_activate ( FusionObjec t *object );
DirectResult fusion_object_destroy ( FusionObject *object ); DirectResult FUSION_API fusion_object_destroy ( FusionObjec t *object );
DirectResult fusion_object_set_property( FusionObject *object , DirectResult FUSION_API fusion_object_set_property ( FusionObjec
const char *key, void *value, void **old_value); t *object,
const char
*key,
void
*value,
void
**old_value );
DirectResult fusion_object_set_int_property( FusionObject *object , DirectResult FUSION_API fusion_object_set_int_property ( FusionObjec
const char *key,int value); t *object,
const char
*key,
int
value );
DirectResult fusion_object_set_string_property( FusionObject *object DirectResult FUSION_API fusion_object_set_string_property( FusionObjec
, t *object,
const char *key,char *value); const char
*key,
char
*value );
void *fusion_object_get_property( FusionObject *object ,const char *key); void FUSION_API *fusion_object_get_property ( FusionObjec
void fusion_object_remove_property( FusionObject *object ,const char *key,v t *object,
oid **ret_val); const char
*key );
void FUSION_API fusion_object_remove_property ( FusionObjec
t *object,
const char
*key,
void
**ret_val );
#define FUSION_OBJECT_METHODS(type, prefix) \ #define FUSION_OBJECT_METHODS(type, prefix) \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_attach( type *object, \ prefix##_attach( type *object, \
ReactionFunc func, \ ReactionFunc func, \
void *ctx, \ void *ctx, \
Reaction *ret_reaction ) \ Reaction *ret_reaction ) \
{ \ { \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
return fusion_reactor_attach( ((FusionObject*)object)->reactor, \ return fusion_reactor_attach( ((FusionObject*)object)->reactor, \
func, ctx, ret_reaction ); \ func, ctx, ret_reaction ); \
} \ } \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_attach_channel( type *object, \ prefix##_attach_channel( type *object, \
int channel, \ int channel, \
ReactionFunc func, \ ReactionFunc func, \
void *ctx, \ void *ctx, \
Reaction *ret_reaction ) \ Reaction *ret_reaction ) \
{ \ { \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
return fusion_reactor_attach_channel( ((FusionObject*)object)->reactor , \ return fusion_reactor_attach_channel( ((FusionObject*)object)->reactor , \
channel, func, ctx, ret_reaction ); \ channel, func, ctx, ret_reaction ); \
} \ } \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_detach( type *object, \ prefix##_detach( type *object, \
Reaction *reaction ) \ Reaction *reaction ) \
{ \ { \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
return fusion_reactor_detach( ((FusionObject*)object)->reactor, \ return fusion_reactor_detach( ((FusionObject*)object)->reactor, \
reaction ); \ reaction ); \
} \ } \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_attach_global( type *object, \ prefix##_attach_global( type *object, \
int index, \ int index, \
void *ctx, \ void *ctx, \
GlobalReaction *reaction ) \ GlobalReaction *reaction ) \
{ \ { \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
return fusion_reactor_attach_global( ((FusionObject*)object)->reactor, \ return fusion_reactor_attach_global( ((FusionObject*)object)->reactor, \
index, ctx, reaction ); \ index, ctx, reaction ); \
} \ } \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_detach_global( type *object, \ prefix##_detach_global( type *object, \
GlobalReaction *reaction ) \ GlobalReaction *reaction ) \
{ \ { \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
return fusion_reactor_detach_global( ((FusionObject*)object)->reactor, \ return fusion_reactor_detach_global( ((FusionObject*)object)->reactor, \
reaction ); \ reaction ); \
} \ } \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_dispatch( type *object, \ prefix##_dispatch( type *object, \
void *message, \ void *message, \
const ReactionFunc *globals ) \ const ReactionFunc *globals ) \
{ \ { \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
return fusion_reactor_dispatch( ((FusionObject*)object)->reactor, \ return fusion_reactor_dispatch( ((FusionObject*)object)->reactor, \
message, true, globals ); \ message, true, globals ); \
} \ } \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_dispatch_channel( type *object, \ prefix##_dispatch_channel( type *object, \
int channel, \ int channel, \
void *message, \ void *message, \
int size, \ int size, \
const ReactionFunc *globals ) \ const ReactionFunc *globals ) \
{ \ { \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
return fusion_reactor_dispatch_channel( ((FusionObject*)object)->react or, \ return fusion_reactor_dispatch_channel( ((FusionObject*)object)->react or, \
channel, message, size, true, globals ); \ channel, message, size, true, globals ); \
} \ } \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_ref( type *object ) \ prefix##_ref( type *object ) \
{ \ { \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
return fusion_ref_up( &((FusionObject*)object)->ref, false ); \ return fusion_ref_up( &((FusionObject*)object)->ref, false ); \
} \ } \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_unref( type *object ) \ prefix##_unref( type *object ) \
{ \ { \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
return fusion_ref_down( &((FusionObject*)object)->ref, false ); \ return fusion_ref_down( &((FusionObject*)object)->ref, false ); \
} \ } \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_ref_stat( type *object, int *refs ) \ prefix##_ref_stat( type *object, int *refs ) \
{ \ { \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
return fusion_ref_stat ( &((FusionObject*)object)->ref, refs ); \ return fusion_ref_stat ( &((FusionObject*)object)->ref, refs ); \
} \ } \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_link( type **link, \ prefix##_link( type **link, \
type *object ) \ type *object ) \
{ \ { \
DirectResult ret; \ DirectResult ret; \
\ \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
\ \
ret = fusion_ref_up( &((FusionObject*)object)->ref, true ); \ ret = fusion_ref_up( &((FusionObject*)object)->ref, true ); \
if (ret) \ if (ret) \
return ret; \ return ret; \
\ \
*link = object; \ *link = object; \
\ \
return DR_OK; \ return DR_OK; \
} \ } \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_unlink( type **link ) \ prefix##_unlink( type **link ) \
{ \ { \
type *object = *link; \ type *object = *link; \
\ \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
\ \
*link = NULL; \ *link = NULL; \
\ \
return fusion_ref_down( &((FusionObject*)object)->ref, true ); \ return fusion_ref_down( &((FusionObject*)object)->ref, true ); \
} \ } \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_inherit( type *object, \ prefix##_inherit( type *object, \
void *from ) \ void *from ) \
{ \ { \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
D_MAGIC_ASSERT( (FusionObject*) from, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) from, FusionObject ); \
\ \
return fusion_ref_inherit( &((FusionObject*)object)->ref, \ return fusion_ref_inherit( &((FusionObject*)object)->ref, \
&((FusionObject*)from)->ref ); \ &((FusionObject*)from)->ref ); \
} \ } \
\ \
static inline DirectResult \ static __inline__ DirectResult \
prefix##_globalize( type *object ) \ prefix##_globalize( type *object ) \
{ \ { \
DirectResult ret; \ DirectResult ret; \
\ \
D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \ D_MAGIC_ASSERT( (FusionObject*) object, FusionObject ); \
\ \
ret = fusion_ref_up( &((FusionObject*)object)->ref, true ); \ ret = fusion_ref_up( &((FusionObject*)object)->ref, true ); \
if (ret) \ if (ret) \
return ret; \ return ret; \
\ \
 End of changes. 29 change blocks. 
56 lines changed or deleted 84 lines changed or added


 property.h   property.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __FUSION__PROPERTY_H__ #ifndef __FUSION__PROPERTY_H__
#define __FUSION__PROPERTY_H__ #define __FUSION__PROPERTY_H__
#include <pthread.h> #include <direct/thread.h>
#include <fusion/types.h> #include <fusion/types.h>
typedef enum { typedef enum {
FUSION_PROPERTY_AVAILABLE, FUSION_PROPERTY_AVAILABLE,
FUSION_PROPERTY_LEASED, FUSION_PROPERTY_LEASED,
FUSION_PROPERTY_PURCHASED FUSION_PROPERTY_PURCHASED
} FusionPropertyState; } FusionPropertyState;
typedef union { typedef union {
skipping to change at line 58 skipping to change at line 58
struct { struct {
FusionPropertyState state; FusionPropertyState state;
pid_t owner; pid_t owner;
bool requested; bool requested;
bool destroyed; bool destroyed;
} builtin; } builtin;
} multi; } multi;
/* single app */ /* single app */
struct { struct {
pthread_mutex_t lock; DirectMutex lock;
pthread_cond_t cond; DirectWaitQueue cond;
FusionPropertyState state; FusionPropertyState state;
} single; } single;
} FusionProperty; } FusionProperty;
/* /*
* Initializes the property * Initializes the property
*/ */
DirectResult fusion_property_init (FusionProperty *property, DirectResult FUSION_API fusion_property_init (FusionProperty *proper
const FusionWorld *world); ty,
const FusionWorld *world)
;
/* /*
* Lease the property causing others to wait before leasing or purchasing. * Lease the property causing others to wait before leasing or purchasing.
* *
* Waits as long as property is leased by another party. * Waits as long as property is leased by another party.
* Returns DR_BUSY if property is/gets purchased by another party. * Returns DR_BUSY if property is/gets purchased by another party.
* *
* Succeeds if property is available, * Succeeds if property is available,
* puts the property into 'leased' state. * puts the property into 'leased' state.
*/ */
DirectResult fusion_property_lease (FusionProperty *property); DirectResult FUSION_API fusion_property_lease (FusionProperty *property) ;
/* /*
* Purchase the property disallowing others to lease or purchase it. * Purchase the property disallowing others to lease or purchase it.
* *
* Waits as long as property is leased by another party. * Waits as long as property is leased by another party.
* Returns DR_BUSY if property is/gets purchased by another party. * Returns DR_BUSY if property is/gets purchased by another party.
* *
* Succeeds if property is available, * Succeeds if property is available,
* puts the property into 'purchased' state and wakes up any waiting party. * puts the property into 'purchased' state and wakes up any waiting party.
*/ */
DirectResult fusion_property_purchase (FusionProperty *property); DirectResult FUSION_API fusion_property_purchase (FusionProperty *property) ;
/* /*
* Cede the property allowing others to lease or purchase it. * Cede the property allowing others to lease or purchase it.
* *
* Puts the property into 'available' state and wakes up one waiting party. * Puts the property into 'available' state and wakes up one waiting party.
*/ */
DirectResult fusion_property_cede (FusionProperty *property); DirectResult FUSION_API fusion_property_cede (FusionProperty *property) ;
/* /*
* Kills the owner of the property. * Kills the owner of the property.
* *
* Tries to make a purchased property available again by killing * Tries to make a purchased property available again by killing
* the process that purchased it. * the process that purchased it.
*/ */
DirectResult fusion_property_holdup (FusionProperty *property); DirectResult FUSION_API fusion_property_holdup (FusionProperty *property) ;
/* /*
* Destroys the property * Destroys the property
*/ */
DirectResult fusion_property_destroy (FusionProperty *property); DirectResult FUSION_API fusion_property_destroy (FusionProperty *property) ;
#endif #endif
 End of changes. 8 change blocks. 
10 lines changed or deleted 12 lines changed or added


 reactor.h   reactor.h 
skipping to change at line 64 skipping to change at line 64
typedef struct { typedef struct {
DirectLink link; DirectLink link;
int index; int index;
void *ctx; void *ctx;
bool attached; bool attached;
} GlobalReaction; } GlobalReaction;
/* /*
* Create a new reactor configured for the specified message data size. * Create a new reactor configured for the specified message data size.
*/ */
FusionReactor *fusion_reactor_new ( int msg_size, FusionReactor FUSION_API *fusion_reactor_new ( int
const char *name, msg_size,
const FusionWorld *world ); const char
*name,
const FusionWorld
*world );
/* /*
* Destroy the reactor. * Destroy the reactor.
*/ */
DirectResult fusion_reactor_destroy ( FusionReactor *reactor ); DirectResult FUSION_API fusion_reactor_destroy ( FusionReactor *reactor );
/* /*
* Free the reactor. * Free the reactor.
*/ */
DirectResult fusion_reactor_free ( FusionReactor *reactor ); DirectResult FUSION_API fusion_reactor_free ( FusionReactor *reactor );
/* /*
* Makes the reactor use the specified lock for managing global reactions. * Makes the reactor use the specified lock for managing global reactions.
* *
* After creating the reactor a global default lock is set which is created * After creating the reactor a global default lock is set which is created
* by Fusion once during initialization. * by Fusion once during initialization.
* *
* To avoid dead locks caused by alternating lock orders of the global reac tion * To avoid dead locks caused by alternating lock orders of the global reac tion
* lock and another lock, the default lock is replaced by the other lock. * lock and another lock, the default lock is replaced by the other lock.
*/ */
DirectResult fusion_reactor_set_lock ( FusionReactor *reactor, DirectResult FUSION_API fusion_reactor_set_lock ( FusionReactor
FusionSkirmish *skirmish ) *reactor,
; FusionSkirmish
*skirmish );
DirectResult fusion_reactor_set_lock_only( FusionReactor *reactor, DirectResult FUSION_API fusion_reactor_set_lock_only( FusionReactor
FusionSkirmish *lock ); *reactor,
FusionSkirmish
*lock );
/* /*
* Attach a local reaction to the reactor (channel 0). * Attach a local reaction to the reactor (channel 0).
*/ */
DirectResult fusion_reactor_attach ( FusionReactor *reactor, DirectResult FUSION_API fusion_reactor_attach ( FusionReactor
ReactionFunc func, *reactor,
void *ctx, ReactionFunc
Reaction *reaction ) func,
; void
*ctx,
Reaction
*reaction );
/* /*
* Attach a local reaction to a specific reactor channel (0-1023). * Attach a local reaction to a specific reactor channel (0-1023).
*/ */
DirectResult fusion_reactor_attach_channel( FusionReactor *reactor, DirectResult FUSION_API fusion_reactor_attach_channel( FusionReactor
int channel, *reactor,
ReactionFunc func, int
void *ctx, channel,
Reaction *reaction ReactionFunc
); func,
void
*ctx,
Reaction
*reaction );
/* /*
* Detach an attached local reaction from the reactor. * Detach an attached local reaction from the reactor.
*/ */
DirectResult fusion_reactor_detach ( FusionReactor *reactor, DirectResult FUSION_API fusion_reactor_detach ( FusionReactor
Reaction *reaction ) *reactor,
; Reaction
*reaction );
/* /*
* Attach a global reaction to the reactor. * Attach a global reaction to the reactor.
* *
* It's always called directly, no matter which Fusionee calls fusion_react or_dispatch(). * It's always called directly, no matter which Fusionee calls fusion_react or_dispatch().
* Any data referenced by the reaction function has to be in shared memory, unless it uses a * Any data referenced by the reaction function has to be in shared memory, unless it uses a
* mechanism to lookup a local counter part or representative, based on sha red information. * mechanism to lookup a local counter part or representative, based on sha red information.
* *
* A global reaction is not defined directly as a function pointer, because that's always a * A global reaction is not defined directly as a function pointer, because that's always a
* local address. Instead, it's specified by an index into a built in funct ion table that * local address. Instead, it's specified by an index into a built in funct ion table that
* must be passed to fusion_reactor_dispatch() each time it is called. * must be passed to fusion_reactor_dispatch() each time it is called.
*/ */
DirectResult fusion_reactor_attach_global( FusionReactor *reactor, DirectResult FUSION_API fusion_reactor_attach_global( FusionReactor
int index, *reactor,
void *ctx, int
GlobalReaction *reaction ) index,
; void
*ctx,
GlobalReaction
*reaction );
/* /*
* Detach an attached global reaction from the reactor. * Detach an attached global reaction from the reactor.
*/ */
DirectResult fusion_reactor_detach_global( FusionReactor *reactor, DirectResult FUSION_API fusion_reactor_detach_global( FusionReactor
GlobalReaction *reaction ) *reactor,
; GlobalReaction
*reaction );
/* /*
* Dispatch a message to any attached reaction (channel 0). * Dispatch a message to any attached reaction (channel 0).
* *
* Setting 'self' to false excludes the caller's local reactions. * Setting 'self' to false excludes the caller's local reactions.
*/ */
DirectResult fusion_reactor_dispatch ( FusionReactor *reactor, DirectResult FUSION_API fusion_reactor_dispatch ( FusionReactor
const void *msg_data, *reactor,
bool self, const void
const ReactionFunc *globals ); *msg_data,
bool
self,
const ReactionFunc
*globals );
/* /*
* Dispatch a message to any attached reaction with a given size. Instead o f * Dispatch a message to any attached reaction with a given size. Instead o f
* using the size defined by the reactor, the caller can specify the size o f * using the size defined by the reactor, the caller can specify the size o f
* the data. * the data.
* *
* Setting 'self' to false excludes the caller's local reactions. * Setting 'self' to false excludes the caller's local reactions.
*/ */
DirectResult fusion_reactor_sized_dispatch( FusionReactor *reactor, DirectResult FUSION_API fusion_reactor_sized_dispatch( FusionReactor
const void *msg_data, *reactor,
int msg_size, const void
bool self, *msg_data,
const ReactionFunc *globals ) int
; msg_size,
bool
self,
const ReactionFunc
*globals );
/* /*
* Dispatch a message via a specific channel (0-1023). * Dispatch a message via a specific channel (0-1023).
* *
* Setting 'self' to false excludes the caller's local reactions. * Setting 'self' to false excludes the caller's local reactions.
*/ */
DirectResult fusion_reactor_dispatch_channel( FusionReactor *reactor DirectResult FUSION_API fusion_reactor_dispatch_channel( FusionReactor
, *reactor,
int channel int
, channel,
const void *msg_dat const void
a, *msg_data,
int msg_siz int
e, msg_size,
bool self, bool
const ReactionFunc *globals self,
); const ReactionFu
nc *globals );
/* /*
* Have the call executed when a dispatched message has been processed by a ll recipients. * Have the call executed when a dispatched message has been processed by a ll recipients.
*/ */
DirectResult fusion_reactor_set_dispatch_callback( FusionReactor *reacto DirectResult FUSION_API fusion_reactor_set_dispatch_callback( FusionReact
r, or *reactor,
FusionCall *call, FusionCall
void *call_p *call,
tr ); void
*call_ptr );
/* /*
* Change the name of the reactor (debug). * Change the name of the reactor (debug).
*/ */
DirectResult fusion_reactor_set_name ( FusionReactor *reacto DirectResult FUSION_API fusion_reactor_set_name ( FusionReact
r, or *reactor,
const char *name ) const char
; *name );
/* /*
* Specify whether local message handlers (reactions) should be called dire ctly. * Specify whether local message handlers (reactions) should be called dire ctly.
*/ */
DirectResult fusion_reactor_direct ( FusionReactor *reactor, DirectResult FUSION_API fusion_reactor_direct ( FusionReactor
bool direct ); *reactor,
bool
typedef enum { direct );
FUSION_REACTOR_PERMIT_NONE = 0x00000000,
FUSION_REACTOR_PERMIT_ATTACH_DETACH = 0x00000001,
FUSION_REACTOR_PERMIT_DISPATCH = 0x00000002,
FUSION_REACTOR_PERMIT_ALL = 0x00000003,
} FusionReactorPermissions;
/*
* Give permissions to another fusionee to use the reactor.
*/
DirectResult fusion_reactor_add_permissions( FusionReactor *reac
tor,
FusionID fusi
on_id,
FusionReactorPermissions perm
issions );
#endif #endif
 End of changes. 16 change blocks. 
83 lines changed or deleted 94 lines changed or added


 ref.h   ref.h 
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __FUSION__REF_H__ #ifndef __FUSION__REF_H__
#define __FUSION__REF_H__ #define __FUSION__REF_H__
#include <pthread.h> #include <direct/thread.h>
#include <fusion/types.h> #include <fusion/types.h>
#include <fusion/call.h> #include <fusion/call.h>
#include <fusion/lock.h> #include <fusion/lock.h>
typedef union { typedef union {
/* multi app */ /* multi app */
struct { struct {
int id; int id;
const FusionWorldShared *shared; const FusionWorldShared *shared;
skipping to change at line 58 skipping to change at line 58
FusionSkirmish lock; FusionSkirmish lock;
FusionCall *call; FusionCall *call;
int call_arg; int call_arg;
} builtin; } builtin;
} multi; } multi;
/* single app */ /* single app */
struct { struct {
int refs; int refs;
pthread_cond_t cond; DirectWaitQueue cond;
pthread_mutex_t lock; DirectMutex lock;
bool destroyed; bool destroyed;
int locked; int locked;
FusionCall *call; FusionCall *call;
int call_arg; int call_arg;
} single; } single;
} FusionRef; } FusionRef;
/* /*
* Initialize. * Initialize.
*/ */
DirectResult fusion_ref_init (FusionRef *ref, DirectResult FUSION_API fusion_ref_init (FusionRef *ref,
const char *name, const char *name,
const FusionWorld *world); const FusionWorld *world);
DirectResult fusion_ref_set_name (FusionRef *ref, DirectResult FUSION_API fusion_ref_set_name (FusionRef *ref,
const char *name); const char *name);
/* /*
* Lock, increase, unlock. * Lock, increase, unlock.
*/ */
DirectResult fusion_ref_up (FusionRef *ref, bool global); DirectResult FUSION_API fusion_ref_up (FusionRef *ref, bool globa l);
/* /*
* Lock, decrease, unlock. * Lock, decrease, unlock.
*/ */
DirectResult fusion_ref_down (FusionRef *ref, bool global); DirectResult FUSION_API fusion_ref_down (FusionRef *ref, bool globa l);
/* /*
* Catch reference * Catch reference
*/ */
DirectResult fusion_ref_catch (FusionRef *ref); DirectResult FUSION_API fusion_ref_catch (FusionRef *ref);
/* /*
* Throw reference * Throw reference
*/ */
DirectResult fusion_ref_throw (FusionRef *ref, FusionID catcher); DirectResult FUSION_API fusion_ref_throw (FusionRef *ref, FusionID c atcher);
/* /*
* Get the current reference count. Meant for debugging only. * Get the current reference count. Meant for debugging only.
* This value is not reliable, because no locking will be performed * This value is not reliable, because no locking will be performed
* and the value may change after or even while returning it. * and the value may change after or even while returning it.
*/ */
DirectResult fusion_ref_stat (FusionRef *ref, int *refs); DirectResult FUSION_API fusion_ref_stat (FusionRef *ref, int *refs) ;
/* /*
* Wait for zero and lock. * Wait for zero and lock.
*/ */
DirectResult fusion_ref_zero_lock (FusionRef *ref); DirectResult FUSION_API fusion_ref_zero_lock (FusionRef *ref);
/* /*
* Check for zero and lock if true. * Check for zero and lock if true.
*/ */
DirectResult fusion_ref_zero_trylock (FusionRef *ref); DirectResult FUSION_API fusion_ref_zero_trylock (FusionRef *ref);
/* /*
* Unlock the counter. * Unlock the counter.
* Only to be called after successful zero_lock or zero_trylock. * Only to be called after successful zero_lock or zero_trylock.
*/ */
DirectResult fusion_ref_unlock (FusionRef *ref); DirectResult FUSION_API fusion_ref_unlock (FusionRef *ref);
/* /*
* Have the call executed when reference counter reaches zero. * Have the call executed when reference counter reaches zero.
*/ */
DirectResult fusion_ref_watch (FusionRef *ref, DirectResult FUSION_API fusion_ref_watch (FusionRef *ref,
FusionCall *call, FusionCall *call,
int call_arg); int call_arg);
/* /*
* Inherit local reference count from another reference. * Inherit local reference count from another reference.
* *
* The local count of the other reference (and its inherited references) is added to this reference. * The local count of the other reference (and its inherited references) is added to this reference.
*/ */
DirectResult fusion_ref_inherit (FusionRef *ref, DirectResult FUSION_API fusion_ref_inherit (FusionRef *ref,
FusionRef *from); FusionRef *from);
/* /*
* Deinitialize. * Deinitialize.
* Can be called after successful zero_lock or zero_trylock * Can be called after successful zero_lock or zero_trylock
* so that waiting fusion_ref_up calls return with DR_DESTROYED. * so that waiting fusion_ref_up calls return with DR_DESTROYED.
*/ */
DirectResult fusion_ref_destroy (FusionRef *ref); DirectResult FUSION_API fusion_ref_destroy (FusionRef *ref);
typedef enum {
FUSION_REF_PERMIT_NONE = 0x00000000,
FUSION_REF_PERMIT_REF_UNREF_LOCAL = 0x00000001,
FUSION_REF_PERMIT_REF_UNREF_GLOBAL = 0x00000002,
FUSION_REF_PERMIT_ZERO_LOCK_UNLOCK = 0x00000004,
FUSION_REF_PERMIT_WATCH = 0x00000008,
FUSION_REF_PERMIT_INHERIT = 0x00000010,
FUSION_REF_PERMIT_DESTROY = 0x00000020,
FUSION_REF_PERMIT_CATCH = 0x00000040,
FUSION_REF_PERMIT_THROW = 0x00000080,
FUSION_REF_PERMIT_ALL = 0x000000FF,
} FusionRefPermissions;
/*
* Give permissions to another fusionee to use the reference.
*/
DirectResult fusion_ref_add_permissions( FusionRef *ref,
FusionID fusion_id,
FusionRefPermissions permissions
);
#endif #endif
 End of changes. 15 change blocks. 
45 lines changed or deleted 22 lines changed or added


 screens.h   screens.h 
skipping to change at line 234 skipping to change at line 234
unsigned long *ret_count ); unsigned long *ret_count );
} ScreenFuncs; } ScreenFuncs;
/* /*
* Add a screen to a graphics device by pointing to a table containing * Add a screen to a graphics device by pointing to a table containing
* driver functions. The driver data will be passed to these functions. * driver functions. The driver data will be passed to these functions.
*/ */
CoreScreen *dfb_screens_register( CoreGraphicsDevice *device, CoreScreen *dfb_screens_register( CoreGraphicsDevice *device,
void *driver_data, void *driver_data,
ScreenFuncs *funcs ); const ScreenFuncs *funcs );
/* /*
* Replace functions of the primary screen implementation by passing * Replace functions of the primary screen implementation by passing
* an alternative driver function table. All non-NULL functions in the new * an alternative driver function table. All non-NULL functions in the new
* table replace the functions in the original function table. * table replace the functions in the original function table.
* The original function table is written to 'primary_funcs' before to allo w * The original function table is written to 'primary_funcs' before to allo w
* drivers to use existing functionality from the original implementation. * drivers to use existing functionality from the original implementation.
*/ */
CoreScreen *dfb_screens_hook_primary( CoreGraphicsDevice *device, CoreScreen *dfb_screens_hook_primary( CoreGraphicsDevice *device,
void *driver_data, void *driver_data,
skipping to change at line 263 skipping to change at line 263
void *driver_data, void *driver_data,
ScreenFuncs *funcs ); ScreenFuncs *funcs );
/* /*
* Enumerate all registered screens by invoking the callback for each scree n. * Enumerate all registered screens by invoking the callback for each scree n.
*/ */
void dfb_screens_enumerate( CoreScreenCallback callback, void dfb_screens_enumerate( CoreScreenCallback callback,
void *ctx ); void *ctx );
/* /*
* Returns the number of screens.
*/
unsigned int dfb_screens_num( void );
/*
* Returns the screen with the specified ID. * Returns the screen with the specified ID.
*/ */
CoreScreen *dfb_screens_at( DFBScreenID screen_id ); CoreScreen *dfb_screens_at( DFBScreenID screen_id );
CoreScreen *dfb_screens_at_translated( DFBScreenID screen_id ); CoreScreen *dfb_screens_at_translated( DFBScreenID screen_id );
/* /*
* Return the ID of the specified screen.
*/
DFBScreenID dfb_screen_id( const CoreScreen *screen );
/*
* Return the (translated) ID of the specified screen. * Return the (translated) ID of the specified screen.
*/ */
DFBScreenID dfb_screen_id_translated( const CoreScreen *screen ); DFBScreenID dfb_screen_id_translated( CoreScreen *screen );
#endif #endif
 End of changes. 4 change blocks. 
12 lines changed or deleted 2 lines changed or added


 serial.h   serial.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__SERIAL_H__ #ifndef __DIRECT__SERIAL_H__
#define __DIRECT__SERIAL_H__ #define __DIRECT__SERIAL_H__
#include <direct/types.h> #include <direct/atomic.h>
#include <direct/debug.h> #include <direct/debug.h>
#include <direct/thread.h>
struct __D_DirectSerial { struct __D_DirectSerial {
int magic; int magic;
u32 value; u32 overflow;
u32 overflow;
unsigned long value;
int waiting;
int wakeup;
}; };
#if D_DEBUG_ENABLED
#define DIRECT_SERIAL_ASSERT( serial )
\
do {
\
D_MAGIC_ASSERT( serial, DirectSerial );
\
} while (0)
#else
#define DIRECT_SERIAL_ASSERT( serial )
\
do {
\
} while (0)
#endif
D_LOG_DOMAIN( Direct_Serial, "Direct/Serial", "Direct Serial" );
static __inline__ void static __inline__ void
direct_serial_init( DirectSerial *serial ) direct_serial_initialize( DirectSerial *serial, const char *name )
{ {
D_DEBUG_AT( Direct_Serial, "%s( %p '%s' ) <<\n", __FUNCTION__, (void*)
serial, name );
D_ASSERT( serial != NULL ); D_ASSERT( serial != NULL );
serial->value = 0; serial->value = 0;
serial->overflow = 0; serial->overflow = 0;
serial->waiting = 0;
D_MAGIC_SET( serial, DirectSerial );
}
// @deprecated
static __inline__ void
direct_serial_init( DirectSerial *serial )
{
D_DEBUG_AT( Direct_Serial, "%s( %p ) <<\n", __FUNCTION__, (void*) seri
al );
D_ASSERT( serial != NULL );
direct_serial_initialize( serial, "unnamed" );
}
static __inline__ void
direct_serial_init_from( DirectSerial *serial, const DirectSerial *source )
{
D_ASSERT( source != NULL );
D_DEBUG_AT( Direct_Serial, "%s( %p, %p ) <<-- <%lu>\n", __FUNCTION__,
(void*) serial, (void*) source, source->value );
D_ASSERT( serial != NULL );
D_MAGIC_ASSERT( source, DirectSerial );
serial->value = source->value;
serial->overflow = source->overflow;
serial->waiting = 0;
D_MAGIC_SET( serial, DirectSerial );
}
static __inline__ void
direct_serial_init_from_counting( DirectSerial *serial, DirectSerial *count
er )
{
unsigned long value;
D_ASSERT( serial != NULL );
D_MAGIC_ASSERT( counter, DirectSerial );
value = D_SYNC_ADD_AND_FETCH( &counter->value, 1 );
D_DEBUG_AT( Direct_Serial, "%s( %p, %p ) <<-- <%lu>\n", __FUNCTION__,
(void*) serial, (void*) counter, value );
serial->value = value;
serial->overflow = counter->overflow;
serial->waiting = 0;
D_MAGIC_SET( serial, DirectSerial ); D_MAGIC_SET( serial, DirectSerial );
} }
static __inline__ void static __inline__ void
direct_serial_deinit( DirectSerial *serial ) direct_serial_deinit( DirectSerial *serial )
{ {
D_ASSERT( serial != NULL );
D_DEBUG_AT( Direct_Serial, "%s( %p ) <- (%lu)\n", __FUNCTION__, (void*
) serial, serial->value );
D_MAGIC_ASSERT( serial, DirectSerial );
D_ASSUME( serial->waiting == 0 );
D_MAGIC_CLEAR( serial ); D_MAGIC_CLEAR( serial );
} }
static __inline__ void static __inline__ void
direct_serial_increase( DirectSerial *serial ) direct_serial_increase( DirectSerial *serial )
{ {
D_ASSERT( serial != NULL );
D_DEBUG_AT( Direct_Serial, "%s( %p ) <- %lu ++\n", __FUNCTION__, (void
*) serial, serial->value );
D_MAGIC_ASSERT( serial, DirectSerial ); D_MAGIC_ASSERT( serial, DirectSerial );
if (! ++serial->value) if (! ++serial->value)
serial->overflow++; serial->overflow++;
D_DEBUG_AT( Direct_Serial, " -> %lu\n", serial->value );
} }
static __inline__ void static __inline__ void
direct_serial_copy( DirectSerial *serial, const DirectSerial *source ) direct_serial_copy( DirectSerial *serial, const DirectSerial *source )
{ {
D_ASSERT( serial != NULL );
D_ASSERT( source != NULL );
D_DEBUG_AT( Direct_Serial, "%s( %p, %p ) <- %lu = (%lu)\n", __FUNCTION
__,
(void*) serial, (void*) source, source->value, serial->val
ue );
D_MAGIC_ASSERT( serial, DirectSerial ); D_MAGIC_ASSERT( serial, DirectSerial );
D_MAGIC_ASSERT( source, DirectSerial ); D_MAGIC_ASSERT( source, DirectSerial );
serial->value = source->value; serial->value = source->value;
serial->overflow = source->overflow; serial->overflow = source->overflow;
} }
static __inline__ bool static __inline__ bool
direct_serial_check( DirectSerial *serial, const DirectSerial *source ) direct_serial_check( const DirectSerial *serial, const DirectSerial *source )
{ {
D_ASSERT( serial != NULL );
D_ASSERT( source != NULL );
D_DEBUG_AT( Direct_Serial, "%s( %p, %p ) -- %lu == %lu\n", __FUNCTION_
_,
(void*) serial, (void*) source, serial->value, source->val
ue );
D_MAGIC_ASSERT( serial, DirectSerial ); D_MAGIC_ASSERT( serial, DirectSerial );
D_MAGIC_ASSERT( source, DirectSerial ); D_MAGIC_ASSERT( source, DirectSerial );
if (serial->overflow < source->overflow) if (serial->overflow < source->overflow)
return false; return false;
else if (serial->overflow == source->overflow && serial->value < sourc e->value) else if (serial->overflow == source->overflow && serial->value < sourc e->value)
return false; return false;
D_ASSUME( serial->value == source->value ); // D_ASSUME( serial->value == source->value );
return true; return true;
} }
static __inline__ bool static __inline__ bool
direct_serial_update( DirectSerial *serial, const DirectSerial *source ) direct_serial_update( DirectSerial *serial, const DirectSerial *source )
{ {
D_ASSERT( serial != NULL );
D_ASSERT( source != NULL );
D_DEBUG_AT( Direct_Serial, "%s( %p, %p ) <- %lu <-= %lu\n", __FUNCTION
__,
(void*) serial, (void*) source, serial->value, source->val
ue );
D_MAGIC_ASSERT( serial, DirectSerial ); D_MAGIC_ASSERT( serial, DirectSerial );
D_MAGIC_ASSERT( source, DirectSerial ); D_MAGIC_ASSERT( source, DirectSerial );
if (serial->overflow < source->overflow) { if (serial->overflow < source->overflow) {
serial->overflow = source->overflow; serial->overflow = source->overflow;
serial->value = source->value; serial->value = source->value;
return true; return true;
} }
else if (serial->overflow == source->overflow && serial->value < sourc e->value) { else if (serial->overflow == source->overflow && serial->value < sourc e->value) {
serial->value = source->value; serial->value = source->value;
return true; return true;
} }
D_ASSUME( serial->value == source->value ); D_ASSUME( serial->value == source->value );
return false; return false;
} }
DirectResult DIRECT_API direct_serial_wait ( DirectSerial *serial,
const DirectSerial *source );
DirectResult DIRECT_API direct_serial_notify( DirectSerial *serial,
const DirectSerial *source );
static __inline__ int
direct_serial_diff( const DirectSerial *a, const DirectSerial *b )
{
int ret;
D_ASSERT( a != NULL );
D_ASSERT( b != NULL );
D_DEBUG_AT( Direct_Serial, "%s( %p, %p ) <- %lu - %lu\n", __FUNCTION__
,
(void*) a, (void*) b, a->value, b->value );
D_MAGIC_ASSERT( a, DirectSerial );
D_MAGIC_ASSERT( b, DirectSerial );
if (a->overflow > b->overflow)
ret = INT_MAX;
else if (b->overflow > a->overflow)
ret = INT_MIN;
else
ret = (int) a->value - (int) b->value;
D_DEBUG_AT( Direct_Serial, " -> %d\n", ret );
return ret;
}
#endif #endif
 End of changes. 18 change blocks. 
8 lines changed or deleted 158 lines changed or added


 shmalloc.h   shmalloc.h 
skipping to change at line 49 skipping to change at line 49
#include <fusion/types.h> #include <fusion/types.h>
#include <fusion/shm/pool.h> #include <fusion/shm/pool.h>
#if FUSION_BUILD_MULTI && DIRECT_BUILD_TEXT #if FUSION_BUILD_MULTI && DIRECT_BUILD_TEXT
#define D_OOSHM() (direct_messages_warn( __FUNCTION__, __FILE__, __L INE__, \ #define D_OOSHM() (direct_messages_warn( __FUNCTION__, __FILE__, __L INE__, \
"out of shared memory" ), D R_NOSHAREDMEMORY) "out of shared memory" ), D R_NOSHAREDMEMORY)
#else #else
#define D_OOSHM() D_OOM() #define D_OOSHM() D_OOM()
#endif #endif
void fusion_dbg_print_memleaks( FusionSHMPoolShared *pool ); void FUSION_API fusion_dbg_print_memleaks( FusionSHMPoolShared *pool );
void *fusion_dbg_shmalloc ( FusionSHMPoolShared *pool, void FUSION_API *fusion_dbg_shmalloc ( FusionSHMPoolShared *pool,
const char *file, int line, const char *file, int line,
const char *func, size_t __size ); const char *func, size_t __size );
void *fusion_dbg_shcalloc ( FusionSHMPoolShared *pool, void FUSION_API *fusion_dbg_shcalloc ( FusionSHMPoolShared *pool,
const char *file, int line, const char *file, int line,
const char *func, size_t __nmemb, size_t __size const char *func, size_t __nmemb, si
); ze_t __size);
void *fusion_dbg_shrealloc( FusionSHMPoolShared *pool, void FUSION_API *fusion_dbg_shrealloc( FusionSHMPoolShared *pool,
const char *file, int line, const char *file, int line,
const char *func, const char *what, void *__ptr const char *func, const char *what,
, void *__ptr,
size_t __size ); size_t __size );
void fusion_dbg_shfree ( FusionSHMPoolShared *pool, void FUSION_API fusion_dbg_shfree ( FusionSHMPoolShared *pool,
const char *file, int line, const char *file, int line,
const char *func, const char *what, void *__ptr const char *func, const char *what,
); void *__ptr );
char *fusion_dbg_shstrdup ( FusionSHMPoolShared *pool, char FUSION_API *fusion_dbg_shstrdup ( FusionSHMPoolShared *pool,
const char *file, int line, const char *file, int line,
const char *func, const char *string ); const char *func, const char *string
);
/* Allocate SIZE bytes of memory. */ /* Allocate SIZE bytes of memory. */
void *fusion_shmalloc (FusionSHMPoolShared *pool, size_t __size); void FUSION_API *fusion_shmalloc (FusionSHMPoolShared *pool, size_t __size) ;
/* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */ /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */
void *fusion_shcalloc (FusionSHMPoolShared *pool, size_t __nmemb, size_t __ size); void FUSION_API *fusion_shcalloc (FusionSHMPoolShared *pool, size_t __nmemb , size_t __size);
/* Re-allocate the previously allocated block /* Re-allocate the previously allocated block
in __ptr, making the new block SIZE bytes long. */ in __ptr, making the new block SIZE bytes long. */
void *fusion_shrealloc (FusionSHMPoolShared *pool, void *__ptr, size_t __si ze); void FUSION_API *fusion_shrealloc (FusionSHMPoolShared *pool, void *__ptr, size_t __size);
/* Free a block allocated by `shmalloc', `shrealloc' or `shcalloc'. */ /* Free a block allocated by `shmalloc', `shrealloc' or `shcalloc'. */
void fusion_shfree (FusionSHMPoolShared *pool, void *__ptr); void FUSION_API fusion_shfree (FusionSHMPoolShared *pool, void *__ptr);
/* Duplicate string in shared memory. */ /* Duplicate string in shared memory. */
char *fusion_shstrdup (FusionSHMPoolShared *pool, const char *string); char FUSION_API *fusion_shstrdup (FusionSHMPoolShared *pool, const char *st ring);
#if DIRECT_BUILD_DEBUGS || DIRECT_BUILD_DEBUG || defined(DIRECT_ENABLE_DEBU G) || defined(DIRECT_FORCE_DEBUG) #if DIRECT_BUILD_DEBUGS || DIRECT_BUILD_DEBUG || defined(DIRECT_ENABLE_DEBU G) || defined(DIRECT_FORCE_DEBUG)
#if !DIRECT_BUILD_DEBUGS #if !DIRECT_BUILD_DEBUGS
#warning Building with debug, but library headers suggest that debug is not supported. #warning Building with debug, but library headers suggest that debug is not supported.
#endif #endif
#define SHMALLOC(pool,bytes) fusion_dbg_shmalloc( pool, __FILE__, __ LINE__, __FUNCTION__, bytes ) #define SHMALLOC(pool,bytes) fusion_dbg_shmalloc( pool, __FILE__, __ LINE__, __FUNCTION__, bytes )
#define SHCALLOC(pool,count,bytes) fusion_dbg_shcalloc( pool, __FILE__, __ LINE__, __FUNCTION__, count, bytes ) #define SHCALLOC(pool,count,bytes) fusion_dbg_shcalloc( pool, __FILE__, __ LINE__, __FUNCTION__, count, bytes )
#define SHREALLOC(pool,mem,bytes) fusion_dbg_shrealloc( pool, __FILE__, _ _LINE__, __FUNCTION__, #mem, mem, bytes ) #define SHREALLOC(pool,mem,bytes) fusion_dbg_shrealloc( pool, __FILE__, _ _LINE__, __FUNCTION__, #mem, mem, bytes )
 End of changes. 11 change blocks. 
25 lines changed or deleted 26 lines changed or added


 signals.h   signals.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 29 skipping to change at line 29
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__SIGNALS_H__ #ifndef __DIRECT__OS__SIGNALS_H__
#define __DIRECT__SIGNALS_H__ #define __DIRECT__OS__SIGNALS_H__
#include <direct/types.h>
typedef enum {
DSHR_OK,
DSHR_REMOVE,
DSHR_RESUME
} DirectSignalHandlerResult;
typedef DirectSignalHandlerResult (*DirectSignalHandlerFunc)( int num,
void *addr,
void *ctx );
DirectResult direct_signals_initialize( void );
DirectResult direct_signals_shutdown( void );
/*
* Modifies the current thread's signal mask to block everything.
* Should be called by input threads once to avoid killing themselves
* in the signal handler by deinitializing all input drivers.
*/
void direct_signals_block_all( void );
/*
* Signal number to use when registering a handler for any interrupt.
*/
#define DIRECT_SIGNAL_ANY -1
DirectResult direct_signal_handler_add ( int num, #include <direct/os/types.h>
DirectSignalHandlerFunc func,
void *ctx,
DirectSignalHandler **ret_ha
ndler );
DirectResult direct_signal_handler_remove( DirectSignalHandler *handle DirectResult DIRECT_API direct_sigaction( int signum,
r ); const struct sigaction *act,
struct sigaction *oldact );
#endif #endif
 End of changes. 4 change blocks. 
37 lines changed or deleted 7 lines changed or added


 state.h   state.h 
skipping to change at line 67 skipping to change at line 67
SMF_SRC_COLORKEY = 0x00000040, SMF_SRC_COLORKEY = 0x00000040,
SMF_DST_COLORKEY = 0x00000080, SMF_DST_COLORKEY = 0x00000080,
SMF_DESTINATION = 0x00000100, SMF_DESTINATION = 0x00000100,
SMF_SOURCE = 0x00000200, SMF_SOURCE = 0x00000200,
SMF_SOURCE_MASK = 0x00000400, SMF_SOURCE_MASK = 0x00000400,
SMF_SOURCE_MASK_VALS = 0x00000800, SMF_SOURCE_MASK_VALS = 0x00000800,
SMF_INDEX_TRANSLATION = 0x00001000, SMF_INDEX_TRANSLATION = 0x00001000,
SMF_COLORKEY = 0x00002000, SMF_COLORKEY = 0x00002000,
SMF_WRITE_MASK_BITS = 0x00004000,
SMF_RENDER_OPTIONS = 0x00010000, SMF_RENDER_OPTIONS = 0x00010000,
SMF_MATRIX = 0x00020000, SMF_MATRIX = 0x00020000,
SMF_SOURCE2 = 0x00100000, SMF_SOURCE2 = 0x00100000,
SMF_ALL = 0x00133FFF SMF_ROP_CODE = 0x01000000,
SMF_ROP_FG_COLOR = 0x02000000,
SMF_ROP_BG_COLOR = 0x04000000,
SMF_ROP_PATTERN = 0x08000000,
SMF_ALL = 0x0F137FFF
} StateModificationFlags; } StateModificationFlags;
typedef enum { typedef enum {
CSF_NONE = 0x00000000, CSF_NONE = 0x00000000,
CSF_DESTINATION = 0x00000001, /* destination is set using df b_state_set_destination() */ CSF_DESTINATION = 0x00000001, /* destination is set using df b_state_set_destination() */
CSF_SOURCE = 0x00000002, /* source is set using dfb_sta te_set_source() */ CSF_SOURCE = 0x00000002, /* source is set using dfb_sta te_set_source() */
CSF_SOURCE_MASK = 0x00000008, /* source mask is set using df b_state_set_source_mask() */ CSF_SOURCE_MASK = 0x00000008, /* source mask is set using df b_state_set_source_mask() */
CSF_SOURCE_LOCKED = 0x00000010, /* source surface is locked */ CSF_SOURCE_LOCKED = 0x00000010, /* source surface is locked */
skipping to change at line 177 skipping to change at line 183
DirectSerial src_mask_serial; /* last source mask surfa ce serial */ DirectSerial src_mask_serial; /* last source mask surfa ce serial */
DFBPoint src_mask_offset; /* relative or absolute c oordinates */ DFBPoint src_mask_offset; /* relative or absolute c oordinates */
DFBSurfaceMaskFlags src_mask_flags; /* controls coordinate mo de and more */ DFBSurfaceMaskFlags src_mask_flags; /* controls coordinate mo de and more */
CoreSurface *source2; /* source2 surface */ CoreSurface *source2; /* source2 surface */
DirectSerial src2_serial; /* last source2 surface s erial */ DirectSerial src2_serial; /* last source2 surface s erial */
CoreSurfaceBufferLock src2; CoreSurfaceBufferLock src2;
DFBColor colors[DFB_COLOR_IDS_MAX]; /* colors for drawing or modulation */ DFBColor colors[DFB_COLOR_IDS_MAX]; /* colors for drawing or modulation */
unsigned int color_indices[DFB_COLOR_IDS_MAX]; /* indices to colors in palette */ unsigned int color_indices[DFB_COLOR_IDS_MAX]; /* indices to colors in palette */
u64 write_mask_bits; /* write mask bits */
DFBSurfaceRopCode rop_code;
DFBColor rop_fg_color;
DFBColor rop_bg_color;
u32 rop_pattern[32];
DFBSurfacePatternMode rop_pattern_mode;
}; };
int dfb_state_init( CardState *state, CoreDFB *core ); int dfb_state_init( CardState *state, CoreDFB *core );
void dfb_state_destroy( CardState *state ); void dfb_state_destroy( CardState *state );
DFBResult dfb_state_set_destination( CardState *state, CoreSurface *destina tion ); DFBResult dfb_state_set_destination( CardState *state, CoreSurface *destina tion );
DFBResult dfb_state_set_source( CardState *state, CoreSurface *source ); DFBResult dfb_state_set_source( CardState *state, CoreSurface *source );
DFBResult dfb_state_set_source_mask( CardState *state, CoreSurface *source_ mask ); DFBResult dfb_state_set_source_mask( CardState *state, CoreSurface *source_ mask );
DFBResult dfb_state_set_source2( CardState *state, CoreSurface *source2 ); DFBResult dfb_state_set_source2( CardState *state, CoreSurface *source2 );
void dfb_state_update( CardState *state, bool update_source ); void dfb_state_update( CardState *state, bool update_source );
DFBResult dfb_state_set_index_translation( CardState *state, DFBResult dfb_state_set_index_translation( CardState *state,
const int *indices, const int *indices,
int num_indices ); int num_indices );
void dfb_state_set_matrix( CardState *state, void dfb_state_set_matrix( CardState *state,
const s32 *matrix ); const s32 *matrix );
void dfb_state_set_rop_pattern( CardState *state,
const u32 *pattern,
DFBSurfacePatternMode pattern_mode );
static inline void static inline void
dfb_state_get_serial( const CardState *state, CoreGraphicsSerial *ret_seria l ) dfb_state_get_serial( const CardState *state, CoreGraphicsSerial *ret_seria l )
{ {
D_ASSERT( state != NULL ); D_ASSERT( state != NULL );
D_ASSERT( ret_serial != NULL ); D_ASSERT( ret_serial != NULL );
*ret_serial = state->serial; *ret_serial = state->serial;
} }
static inline void static inline void
skipping to change at line 306 skipping to change at line 324
s tate, key ) s tate, key )
#define dfb_state_set_dst_colorkey(state,key) _dfb_state_set_checked( d st_colorkey, \ #define dfb_state_set_dst_colorkey(state,key) _dfb_state_set_checked( d st_colorkey, \
D ST_COLORKEY, \ D ST_COLORKEY, \
s tate, key ) s tate, key )
#define dfb_state_set_render_options(state,opts) _dfb_state_set_checked( r ender_options, \ #define dfb_state_set_render_options(state,opts) _dfb_state_set_checked( r ender_options, \
R ENDER_OPTIONS, \ R ENDER_OPTIONS, \
s tate, opts ) s tate, opts )
#define dfb_state_set_write_mask_bits(state,bits) _dfb_state_set_checked( w
rite_mask_bits, \
W
RITE_MASK_BITS, \
s
tate, bits )
#define dfb_state_set_rop_code(state,code) _dfb_state_set_checked( r
op_code, \
R
OP_CODE, \
s
tate, code )
#define dfb_state_set_rop_pattern_mode(state,mode) _dfb_state_set_checked(
rop_pattern_mode, \
ROP_PATTERN_MODE, \
state, mode )
static inline void dfb_state_set_clip( CardState *state, const DFBRegion *c lip ) static inline void dfb_state_set_clip( CardState *state, const DFBRegion *c lip )
{ {
D_MAGIC_ASSERT( state, CardState ); D_MAGIC_ASSERT( state, CardState );
DFB_REGION_ASSERT( clip ); DFB_REGION_ASSERT( clip );
if (! DFB_REGION_EQUAL( state->clip, *clip )) { if (! DFB_REGION_EQUAL( state->clip, *clip )) {
state->clip = *clip; state->clip = *clip;
state->modified = (StateModificationFlags)( state->modified | SMF _CLIP ); state->modified = (StateModificationFlags)( state->modified | SMF _CLIP );
} }
} }
skipping to change at line 328 skipping to change at line 358
{ {
D_MAGIC_ASSERT( state, CardState ); D_MAGIC_ASSERT( state, CardState );
D_ASSERT( color != NULL ); D_ASSERT( color != NULL );
if (! DFB_COLOR_EQUAL( state->color, *color )) { if (! DFB_COLOR_EQUAL( state->color, *color )) {
state->color = *color; state->color = *color;
state->modified = (StateModificationFlags)( state->modified | SMF _COLOR ); state->modified = (StateModificationFlags)( state->modified | SMF _COLOR );
} }
} }
static inline void dfb_state_set_rop_fg_color( CardState *state, const DFBC
olor *rop_fg_color )
{
D_MAGIC_ASSERT( state, CardState );
D_ASSERT( rop_fg_color != NULL );
if (! DFB_COLOR_EQUAL( state->rop_fg_color, *rop_fg_color )) {
state->rop_fg_color = *rop_fg_color;
state->modified = (StateModificationFlags)( state->modified |
SMF_ROP_FG_COLOR );
}
}
static inline void dfb_state_set_rop_bg_color( CardState *state, const DFBC
olor *rop_bg_color )
{
D_MAGIC_ASSERT( state, CardState );
D_ASSERT( rop_bg_color != NULL );
if (! DFB_COLOR_EQUAL( state->rop_bg_color, *rop_bg_color )) {
state->rop_bg_color = *rop_bg_color;
state->modified = (StateModificationFlags)( state->modified |
SMF_ROP_BG_COLOR );
}
}
static inline void dfb_state_set_colorkey( CardState *state, const DFBColor Key *key ) static inline void dfb_state_set_colorkey( CardState *state, const DFBColor Key *key )
{ {
D_MAGIC_ASSERT( state, CardState ); D_MAGIC_ASSERT( state, CardState );
D_ASSERT( key != NULL ); D_ASSERT( key != NULL );
if (! DFB_COLORKEY_EQUAL( state->colorkey, *key )) { if (! DFB_COLORKEY_EQUAL( state->colorkey, *key )) {
state->colorkey = *key; state->colorkey = *key;
state->modified = (StateModificationFlags)( state->modified | SMF _COLORKEY ); state->modified = (StateModificationFlags)( state->modified | SMF _COLOR );
} }
} }
static inline void dfb_state_set_source_mask_vals( CardState *sta te, static inline void dfb_state_set_source_mask_vals( CardState *sta te,
const DFBPoint *off set, const DFBPoint *off set,
DFBSurfaceMaskFlags fla gs ) DFBSurfaceMaskFlags fla gs )
{ {
D_MAGIC_ASSERT( state, CardState ); D_MAGIC_ASSERT( state, CardState );
D_ASSERT( offset != NULL ); D_ASSERT( offset != NULL );
D_FLAGS_ASSERT( flags, DSMF_ALL ); D_FLAGS_ASSERT( flags, DSMF_ALL );
 End of changes. 7 change blocks. 
2 lines changed or deleted 67 lines changed or added


 stream.h   stream.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 32 skipping to change at line 32
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__STREAM_H__ #ifndef __DIRECT__STREAM_H__
#define __DIRECT__STREAM_H__ #define __DIRECT__STREAM_H__
#include <stdio.h>
#include <sys/time.h>
#include <direct/types.h> #include <direct/types.h>
/* /*
* Create a stream wrapper. * Create a stream wrapper.
* *
* 'filename' can be a plain file name or one of the following: * 'filename' can be a plain file name or one of the following:
* http://<host>[:<port>]/<path> * http://<host>[:<port>]/<path>
* unsv://<host>[:<port>]/<path> * unsv://<host>[:<port>]/<path>
* ftp://<host>[:<port>]/<path> * ftp://<host>[:<port>]/<path>
* rtsp://<host>[:<port>]/<path> * rtsp://<host>[:<port>]/<path>
* tcp://<host>:<port> * tcp://<host>:<port>
* udp://<host>:<port> * udp://<host>:<port>
* file:/<path> * file:/<path>
* fd:/<fileno> * fd:/<fileno>
* stdin:/ * stdin:/
*/ */
DirectResult direct_stream_create ( const char *filename, DirectResult DIRECT_API direct_stream_create ( const char *filename,
DirectStream **ret_stream ); DirectStream **ret_stream
);
/* /*
* Duplicate the stream (never fails). * Duplicate the stream (never fails).
*/ */
DirectStream *direct_stream_dup ( DirectStream *stream ); DirectStream DIRECT_API *direct_stream_dup ( DirectStream *stream );
/* /*
* Return the file descriptor associated to the stream. * Return the file descriptor associated to the stream.
*/ */
int direct_stream_fileno ( DirectStream *stream ); int DIRECT_API direct_stream_fileno ( DirectStream *stream );
/* /*
* True if stream is seekable. * True if stream is seekable.
*/ */
bool direct_stream_seekable( DirectStream *stream ); bool DIRECT_API direct_stream_seekable( DirectStream *stream );
/* /*
* True if stream originates from a remote host. * True if stream originates from a remote host.
*/ */
bool direct_stream_remote ( DirectStream *stream ); bool DIRECT_API direct_stream_remote ( DirectStream *stream );
/* /*
* Get the mime description of the stream. * Get the mime description of the stream.
* Returns NULL if the information is not available. * Returns NULL if the information is not available.
*/ */
const char* direct_stream_mime ( DirectStream *stream ); const char DIRECT_API *direct_stream_mime ( DirectStream *stream );
/* /*
* Get stream length. * Get stream length.
*/ */
unsigned int direct_stream_length ( DirectStream *stream ); unsigned int DIRECT_API direct_stream_length ( DirectStream *stream );
/* /*
* Get stream position. * Get stream position.
*/ */
unsigned int direct_stream_offset ( DirectStream *stream ); unsigned int DIRECT_API direct_stream_offset ( DirectStream *stream );
/* /*
* Wait for data to be available. * Wait for data to be available.
* If 'timeout' is NULL, the function blocks indefinitely. * If 'timeout' is NULL, the function blocks indefinitely.
* Set the 'timeout' to 0 to make the function return immediatly. * Set the 'timeout' to 0 to make the function return immediatly.
*/ */
DirectResult direct_stream_wait ( DirectStream *stream, DirectResult DIRECT_API direct_stream_wait ( DirectStream *stream,
unsigned int length, unsigned int length,
struct timeval *timeout ); struct timeval *timeout );
/* /*
* Peek 'length' bytes of data at offset 'offset' from the stream. * Peek 'length' bytes of data at offset 'offset' from the stream.
*/ */
DirectResult direct_stream_peek ( DirectStream *stream, DirectResult DIRECT_API direct_stream_peek ( DirectStream *stream,
unsigned int length, unsigned int length,
int offset, int offset,
void *buf, void *buf,
unsigned int *read_out ); unsigned int *read_out )
;
/* /*
* Fetch 'length' bytes of data from the stream. * Fetch 'length' bytes of data from the stream.
*/ */
DirectResult direct_stream_read ( DirectStream *stream, DirectResult DIRECT_API direct_stream_read ( DirectStream *stream,
unsigned int length, unsigned int length,
void *buf, void *buf,
unsigned int *read_out ); unsigned int *read_out )
;
/* /*
* Seek to the specified absolute offset within the stream. * Seek to the specified absolute offset within the stream.
*/ */
DirectResult direct_stream_seek ( DirectStream *stream, DirectResult DIRECT_API direct_stream_seek ( DirectStream *stream,
unsigned int offset ); unsigned int offset );
/* /*
* Destroy the stream wrapper. * Destroy the stream wrapper.
*/ */
void direct_stream_destroy ( DirectStream *stream ); void DIRECT_API direct_stream_destroy ( DirectStream *stream );
#endif /* __DIRECT__STREAM_H__ */ #endif /* __DIRECT__STREAM_H__ */
 End of changes. 15 change blocks. 
28 lines changed or deleted 28 lines changed or added


 surface.h   surface.h 
skipping to change at line 74 skipping to change at line 74
int index; int index;
} CoreSurfaceNotification; } CoreSurfaceNotification;
typedef enum { typedef enum {
CSCONF_NONE = 0x00000000, CSCONF_NONE = 0x00000000,
CSCONF_SIZE = 0x00000001, CSCONF_SIZE = 0x00000001,
CSCONF_FORMAT = 0x00000002, CSCONF_FORMAT = 0x00000002,
CSCONF_CAPS = 0x00000004, CSCONF_CAPS = 0x00000004,
CSCONF_COLORSPACE = 0x00000008,
CSCONF_PREALLOCATED = 0x00000010, CSCONF_PREALLOCATED = 0x00000010,
CSCONF_ALL = 0x00000017 CSCONF_ALL = 0x0000001F
} CoreSurfaceConfigFlags; } CoreSurfaceConfigFlags;
typedef enum { typedef enum {
CSTF_NONE = 0x00000000, CSTF_NONE = 0x00000000,
CSTF_LAYER = 0x00000001, /* surface for layer */ CSTF_LAYER = 0x00000001, /* surface for layer */
CSTF_WINDOW = 0x00000002, /* surface for window */ CSTF_WINDOW = 0x00000002, /* surface for window */
CSTF_CURSOR = 0x00000004, /* surface for cursor */ CSTF_CURSOR = 0x00000004, /* surface for cursor */
CSTF_FONT = 0x00000008, /* surface for font */ CSTF_FONT = 0x00000008, /* surface for font */
skipping to change at line 103 skipping to change at line 104
CSTF_PREALLOCATED = 0x00000400, /* preallocated memory */ CSTF_PREALLOCATED = 0x00000400, /* preallocated memory */
CSTF_ALL = 0x0000071F CSTF_ALL = 0x0000071F
} CoreSurfaceTypeFlags; } CoreSurfaceTypeFlags;
typedef struct { typedef struct {
CoreSurfaceConfigFlags flags; CoreSurfaceConfigFlags flags;
DFBDimension size; DFBDimension size;
DFBSurfacePixelFormat format; DFBSurfacePixelFormat format;
DFBSurfaceColorSpace colorspace;
DFBSurfaceCapabilities caps; DFBSurfaceCapabilities caps;
struct { struct {
void *addr; /* " */ void *addr;
unsigned long phys; /* " */ int pitch;
unsigned long offset; /* " */ unsigned long handle;
unsigned int pitch; /* " */
void *handle; /* " */
} preallocated[MAX_SURFACE_BUFFERS]; } preallocated[MAX_SURFACE_BUFFERS];
CoreSurfacePoolID preallocated_pool_id;
DFBDimension min_size; DFBDimension min_size;
} CoreSurfaceConfig; } CoreSurfaceConfig;
typedef enum { typedef enum {
CSP_SYSTEMONLY = 0x00000000, /* never try to swap CSP_SYSTEMONLY = 0x00000000, /* never try to swap
into video memory */ into video memory */
CSP_VIDEOLOW = 0x00000001, /* try to store in video memory, CSP_VIDEOLOW = 0x00000001, /* try to store in video memory,
low priority */ low priority */
CSP_VIDEOHIGH = 0x00000002, /* try to store in video memory, CSP_VIDEOHIGH = 0x00000002, /* try to store in video memory,
high priority */ high priority */
skipping to change at line 213 skipping to change at line 210
int rotation; int rotation;
CoreSurfaceNotificationFlags notifications; CoreSurfaceNotificationFlags notifications;
DirectSerial serial; DirectSerial serial;
int field; int field;
u8 alpha_ramp[4]; u8 alpha_ramp[4];
CoreSurfaceBuffer *buffers[MAX_SURFACE_BUFFERS]; CoreSurfaceBuffer **buffers;
CoreSurfaceBuffer *left_buffers[MAX_SURFACE_BUFFERS];
CoreSurfaceBuffer *right_buffers[MAX_SURFACE_BUFFERS];
int num_buffers; int num_buffers;
int buffer_indices[MAX_SURFACE_BUFFERS]; int buffer_indices[MAX_SURFACE_BUFFERS];
unsigned int flips; unsigned int flips;
CorePalette *palette; CorePalette *palette;
GlobalReaction palette_reaction; GlobalReaction palette_reaction;
FusionSHMPoolShared *shmpool; FusionSHMPoolShared *shmpool;
void *data; /* Shared system driver-specifi c data for this surface. */ void *data; /* Shared system driver-specifi c data for this surface. */
skipping to change at line 230 skipping to change at line 228
CorePalette *palette; CorePalette *palette;
GlobalReaction palette_reaction; GlobalReaction palette_reaction;
FusionSHMPoolShared *shmpool; FusionSHMPoolShared *shmpool;
void *data; /* Shared system driver-specifi c data for this surface. */ void *data; /* Shared system driver-specifi c data for this surface. */
FusionCall call; FusionCall call;
}; };
#define CORE_SURFACE_ASSERT(surface)
\
do {
\
D_MAGIC_ASSERT( surface, CoreSurface );
\
} while (0)
/* /*
* Creates a pool of surface objects. * Creates a pool of surface objects.
*/ */
FusionObjectPool *dfb_surface_pool_create( const FusionWorld *world ); FusionObjectPool *dfb_surface_pool_create( const FusionWorld *world );
/* /*
* Generates dfb_surface_ref(), dfb_surface_attach() etc. * Generates dfb_surface_ref(), dfb_surface_attach() etc.
*/ */
FUSION_OBJECT_METHODS( CoreSurface, dfb_surface ) FUSION_OBJECT_METHODS( CoreSurface, dfb_surface )
skipping to change at line 256 skipping to change at line 249
const CoreSurfaceConfig *config, const CoreSurfaceConfig *config,
CoreSurfaceTypeFlags type, CoreSurfaceTypeFlags type,
unsigned long resourc e_id, unsigned long resourc e_id,
CorePalette *palette , CorePalette *palette ,
CoreSurface **ret_sur face ); CoreSurface **ret_sur face );
DFBResult dfb_surface_create_simple ( CoreDFB *core, DFBResult dfb_surface_create_simple ( CoreDFB *core,
int width, int width,
int height, int height,
DFBSurfacePixelFormat format, DFBSurfacePixelFormat format,
DFBSurfaceColorSpace colorsp ace,
DFBSurfaceCapabilities caps, DFBSurfaceCapabilities caps,
CoreSurfaceTypeFlags type, CoreSurfaceTypeFlags type,
unsigned long resourc e_id, unsigned long resourc e_id,
CorePalette *palette , CorePalette *palette ,
CoreSurface **ret_sur face ); CoreSurface **ret_sur face );
DFBResult dfb_surface_init_palette ( CoreDFB *core, DFBResult dfb_surface_init_palette ( CoreDFB *core,
CoreSurface *surface ); CoreSurface *surface );
DFBResult dfb_surface_notify ( CoreSurface *surface , DFBResult dfb_surface_notify ( CoreSurface *surface ,
skipping to change at line 279 skipping to change at line 273
CoreSurfaceBuffer *buffer) ; CoreSurfaceBuffer *buffer) ;
DFBResult dfb_surface_flip ( CoreSurface *surface , DFBResult dfb_surface_flip ( CoreSurface *surface ,
bool swap ); bool swap );
DFBResult dfb_surface_reconfig ( CoreSurface *surface , DFBResult dfb_surface_reconfig ( CoreSurface *surface ,
const CoreSurfaceConfig *config ); const CoreSurfaceConfig *config );
DFBResult dfb_surface_destroy_buffers( CoreSurface *surface ); DFBResult dfb_surface_destroy_buffers( CoreSurface *surface );
DFBResult dfb_surface_deallocate_buffers( CoreSurface *surface
);
DFBResult dfb_surface_lock_buffer ( CoreSurface *surface , DFBResult dfb_surface_lock_buffer ( CoreSurface *surface ,
CoreSurfaceBufferRole role, CoreSurfaceBufferRole role,
CoreSurfaceAccessorID accesso r, CoreSurfaceAccessorID accesso r,
CoreSurfaceAccessFlags access, CoreSurfaceAccessFlags access,
CoreSurfaceBufferLock *ret_loc k ); CoreSurfaceBufferLock *ret_loc k );
DFBResult dfb_surface_unlock_buffer ( CoreSurface *surface , DFBResult dfb_surface_unlock_buffer ( CoreSurface *surface ,
CoreSurfaceBufferLock *lock ); CoreSurfaceBufferLock *lock );
DFBResult dfb_surface_read_buffer ( CoreSurface *surface , DFBResult dfb_surface_read_buffer ( CoreSurface *surface ,
skipping to change at line 319 skipping to change at line 311
DFBResult dfb_surface_set_field ( CoreSurface *surface , DFBResult dfb_surface_set_field ( CoreSurface *surface ,
int field ) ; int field ) ;
DFBResult dfb_surface_set_alpha_ramp( CoreSurface *surface , DFBResult dfb_surface_set_alpha_ramp( CoreSurface *surface ,
u8 a0, u8 a0,
u8 a1, u8 a1,
u8 a2, u8 a2,
u8 a3 ); u8 a3 );
DFBResult dfb_surface_clear_buffers ( CoreSurface *surfac
e );
static inline DirectResult static inline DirectResult
dfb_surface_lock( CoreSurface *surface ) dfb_surface_lock( CoreSurface *surface )
{ {
D_MAGIC_ASSERT( surface, CoreSurface ); D_MAGIC_ASSERT( surface, CoreSurface );
return fusion_skirmish_prevail( &surface->lock ); return fusion_skirmish_prevail( &surface->lock );
} }
static inline DirectResult static inline DirectResult
dfb_surface_trylock( CoreSurface *surface ) dfb_surface_trylock( CoreSurface *surface )
skipping to change at line 473 skipping to change at line 463
/* global reactions */ /* global reactions */
ReactionResult _dfb_surface_palette_listener( const void *msg_data, ReactionResult _dfb_surface_palette_listener( const void *msg_data,
void *ctx ); void *ctx );
typedef enum { typedef enum {
DFB_LAYER_REGION_SURFACE_LISTENER, DFB_LAYER_REGION_SURFACE_LISTENER,
DFB_WINDOWSTACK_BACKGROUND_IMAGE_LISTENER DFB_WINDOWSTACK_BACKGROUND_IMAGE_LISTENER
} DFB_SURFACE_GLOBALS; } DFB_SURFACE_GLOBALS;
static inline void
dfb_surface_set_stereo_eye( CoreSurface *surface,
DFBSurfaceStereoEye eye )
{
D_ASSERT( surface != NULL );
D_MAGIC_ASSERT( surface, CoreSurface );
D_ASSERT( eye & (DSSE_LEFT | DSSE_RIGHT) );
if (eye & DSSE_LEFT)
surface->buffers = surface->left_buffers;
else
surface->buffers = surface->right_buffers;
}
static inline DFBSurfaceStereoEye
dfb_surface_get_stereo_eye( CoreSurface *surface )
{
D_ASSERT( surface != NULL );
D_MAGIC_ASSERT( surface, CoreSurface );
if (surface->buffers == surface->left_buffers)
return DSSE_LEFT;
else
return DSSE_RIGHT;
}
#endif #endif
 End of changes. 12 change blocks. 
25 lines changed or deleted 36 lines changed or added


 surface_buffer.h   surface_buffer.h 
skipping to change at line 34 skipping to change at line 34
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __CORE__SURFACE_BUFFER_H__ #ifndef __CORE__SURFACE_BUFFER_H__
#define __CORE__SURFACE_BUFFER_H__ #define __CORE__SURFACE_BUFFER_H__
#include <direct/debug.h> #include <direct/debug.h>
#include <fusion/object.h>
#include <fusion/vector.h> #include <fusion/vector.h>
#include <core/surface.h> #include <core/surface.h>
#include <core/surface_allocation.h>
#include <directfb.h> #include <directfb.h>
/* /*
* Configuration and State flags of a Surface Buffer * Configuration and State flags of a Surface Buffer
*/ */
typedef enum { typedef enum {
CSBF_NONE = 0x00000000, /* None of these. */ CSBF_NONE = 0x00000000, /* None of these. */
CSBF_STICKED = 0x00000001, /* Sticked to one Surface Pool, e.g. sys tem only. */ CSBF_STICKED = 0x00000001, /* Sticked to one Surface Pool, e.g. sys tem only. */
CSBF_ALL = 0x00000001 /* All of these. */ CSBF_ALL = 0x00000001 /* All of these. */
} CoreSurfaceBufferFlags; } CoreSurfaceBufferFlags;
/*
* Configuration and State flags of a Surface Buffer Allocation
*/
typedef enum { typedef enum {
CSBNF_NONE = 0x00000000 CSALF_NONE = 0x00000000, /* None of these. */
} CoreSurfaceBufferNotificationFlags;
typedef struct { CSALF_ONEFORALL = 0x00000001, /* Only one allocation in pool for
CoreSurfaceBufferNotificationFlags flags; all buffers. */
} CoreSurfaceBufferNotification; CSALF_VOLATILE = 0x00000002, /* Allocation should be freed when
no longer up to date. */
CSALF_PREALLOCATED = 0x00000004, /* Preallocated memory, don't zap w
hen "thrifty-surface-buffers" is active. */
CSALF_MUCKOUT = 0x00001000, /* Indicates surface pool being in
the progress of mucking out this and possibly
other allocations to have enough
space for a new allocation to be made. */
CSALF_ALL = 0x00001007 /* All of these. */
} CoreSurfaceAllocationFlags;
/*
* An Allocation of a Surface Buffer
*/
struct __DFB_CoreSurfaceAllocation {
int magic;
DirectSerial serial; /* Equals serial of buffe
r if content is up to date. */
CoreSurfaceBuffer *buffer; /* Surface Buffer owning
this allocation. */
CoreSurface *surface; /* Surface owning the Buf
fer of this allocation. */
CoreSurfacePool *pool; /* Surface Pool providing
the allocation. */
void *data; /* Pool's private data fo
r this allocation. */
int size; /* Amount of data used by
this allocation. */
unsigned long offset; /* Offset within address
range of pool if contiguous. */
CoreSurfaceAllocationFlags flags; /* Pool can return CSALF_
ONEFORALL upon allocation of first buffer. */
const CoreSurfaceAccessFlags *access; /* Possible acc
ess flags (pointer to pool description). */
CoreSurfaceAccessFlags accessed[_CSAID_NUM]; /* Access since
last synchronization. */
};
#define CORE_SURFACE_ALLOCATION_ASSERT(alloc)
\
do {
\
D_MAGIC_ASSERT( alloc, CoreSurfaceAllocation );
\
D_ASSUME( (alloc)->size > 0 );
\
D_ASSERT( (alloc)->size >= 0 );
\
D_ASSERT( (alloc)->offset + (alloc)->size <= ((alloc)->pool->desc
.size ?:~0UL) ); \
D_FLAGS_ASSERT( (alloc)->access[CSAID_CPU], CSAF_ALL );
\
D_FLAGS_ASSERT( (alloc)->access[CSAID_GPU], CSAF_ALL );
\
D_FLAGS_ASSERT( (alloc)->flags, CSALF_ALL );
\
D_FLAGS_ASSERT( (alloc)->accessed[CSAID_CPU], CSAF_ALL );
\
D_FLAGS_ASSERT( (alloc)->accessed[CSAID_GPU], CSAF_ALL );
\
} while (0)
/* /*
* A Lock on a Surface Buffer * A Lock on a Surface Buffer
*/ */
struct __DFB_CoreSurfaceBufferLock { struct __DFB_CoreSurfaceBufferLock {
int magic; /* Must be valid before c alling dfb_surface_pool_lock() */ int magic; /* Must be valid before c alling dfb_surface_pool_lock() */
CoreSurfaceAccessorID accessor; /* " */ CoreSurfaceAccessorID accessor; /* " */
CoreSurfaceAccessFlags access; /* " */ CoreSurfaceAccessFlags access; /* " */
skipping to change at line 121 skipping to change at line 161
lock->accessor = CSAID_NONE; lock->accessor = CSAID_NONE;
lock->access = CSAF_NONE; lock->access = CSAF_NONE;
D_MAGIC_CLEAR( lock ); D_MAGIC_CLEAR( lock );
} }
#define CORE_SURFACE_BUFFER_LOCK_ASSERT(lock) \ #define CORE_SURFACE_BUFFER_LOCK_ASSERT(lock) \
do { \ do { \
D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock ); \ D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock ); \
D_FLAGS_ASSERT( (lock)->access, CSAF_ALL ); \ D_FLAGS_ASSERT( (lock)->access, CSAF_ALL ); \
if ((lock)->allocation) { if ((lock)->buffer) {
\ \
/*D_ASSERT( (lock)->buffer == (lock)->allocation->buffer );* D_ASSERT( (lock)->allocation != NULL );
/ \ \
D_ASSERT( (lock)->buffer == (lock)->allocation->buffer );
\
D_ASSUME( (lock)->addr != NULL || (lock)->phys != 0 || (lock )->offset != ~0 || (lock)->handle != NULL );\ D_ASSUME( (lock)->addr != NULL || (lock)->phys != 0 || (lock )->offset != ~0 || (lock)->handle != NULL );\
D_ASSUME( (lock)->offset == (lock)->allocation->offset || (l ock)->offset == ~0 ); \ D_ASSUME( (lock)->offset == (lock)->allocation->offset || (l ock)->offset == ~0 ); \
D_ASSERT( (lock)->pitch > 0 || ((lock)->addr == NULL && (loc k)->phys == 0) ); \ D_ASSERT( (lock)->pitch > 0 || ((lock)->addr == NULL && (loc k)->phys == 0) ); \
} \ } \
else { \ else { \
D_ASSERT( (lock)->buffer == NULL ); \ D_ASSERT( (lock)->allocation == NULL ); \
D_ASSERT( (lock)->addr == NULL ); \ D_ASSERT( (lock)->addr == NULL ); \
D_ASSERT( (lock)->phys == 0 ); \ D_ASSERT( (lock)->phys == 0 ); \
D_ASSERT( (lock)->offset == ~0 ); \ D_ASSERT( (lock)->offset == ~0 ); \
D_ASSERT( (lock)->pitch == 0 ); \ D_ASSERT( (lock)->pitch == 0 ); \
D_ASSERT( (lock)->handle == NULL ); \ D_ASSERT( (lock)->handle == NULL ); \
} \ } \
} while (0) } while (0)
/* /*
* A Surface Buffer of a Surface * A Surface Buffer of a Surface
*/ */
struct __DFB_CoreSurfaceBuffer { struct __DFB_CoreSurfaceBuffer {
FusionObject object;
int magic; int magic;
DirectSerial serial; /* Increased when content is w ritten. */ DirectSerial serial; /* Increased when content is w ritten. */
CoreSurfaceAllocation *written; /* Allocation with the last wr ite access. */ CoreSurfaceAllocation *written; /* Allocation with the last wr ite access. */
CoreSurfaceAllocation *read; /* Allocation with the last re ad access. */ CoreSurfaceAllocation *read; /* Allocation with the last re ad access. */
CoreSurface *surface; /* Surface owning this Surface Buffer. */ CoreSurface *surface; /* Surface owning this Surface Buffer. */
CoreSurfacePolicy policy; CoreSurfacePolicy policy;
CoreSurfaceBufferFlags flags; /* Configuration and State fla gs. */ CoreSurfaceBufferFlags flags; /* Configuration and State fla gs. */
DFBSurfacePixelFormat format; /* Pixel format of buffer data . */ DFBSurfacePixelFormat format; /* Pixel format of buffer data . */
FusionVector allocs; /* Allocations within Surface Pools. */ FusionVector allocs; /* Allocations within Surface Pools. */
CoreSurfaceConfig config; /* Configuration of its surfac #if 1
e at the time of the buffer creation */ unsigned int locked; /* Lock count. FIXME: Add fail
CoreSurfaceTypeFlags type; safe cleanup! */
unsigned long resource_id; /* layer id, window id, or use #endif
r specified */
}; };
#define CORE_SURFACE_BUFFER_ASSERT(buffer) DFBResult dfb_surface_buffer_new ( CoreSurface *surface,
\
do {
\
D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
\
} while (0)
DFBResult dfb_surface_buffer_create ( CoreDFB *core,
CoreSurface *surface,
CoreSurfaceBufferFlags flags, CoreSurfaceBufferFlags flags,
CoreSurfaceBuffer **ret_buffer ) ; CoreSurfaceBuffer **ret_buffer ) ;
DFBResult dfb_surface_buffer_decouple( CoreSurfaceBuffer *buffer ); DFBResult dfb_surface_buffer_destroy( CoreSurfaceBuffer *buffer );
DFBResult dfb_surface_buffer_deallocate( CoreSurfaceBuffer *buffer );
DFBResult dfb_surface_buffer_lock ( CoreSurfaceBuffer *buffer, DFBResult dfb_surface_buffer_lock ( CoreSurfaceBuffer *buffer,
CoreSurfaceAccessorID accessor, CoreSurfaceAccessorID accessor,
CoreSurfaceAccessFlags access, CoreSurfaceAccessFlags access,
CoreSurfaceBufferLock *ret_lock ); CoreSurfaceBufferLock *ret_lock );
DFBResult dfb_surface_buffer_unlock ( CoreSurfaceBufferLock *lock ); DFBResult dfb_surface_buffer_unlock ( CoreSurfaceBufferLock *lock );
DFBResult dfb_surface_buffer_read ( CoreSurfaceBuffer *buffer, DFBResult dfb_surface_buffer_read ( CoreSurfaceBuffer *buffer,
void *destination, void *destination,
skipping to change at line 197 skipping to change at line 228
DFBResult dfb_surface_buffer_write ( CoreSurfaceBuffer *buffer, DFBResult dfb_surface_buffer_write ( CoreSurfaceBuffer *buffer,
const void *source, const void *source,
int pitch, int pitch,
const DFBRectangle *rect ); const DFBRectangle *rect );
DFBResult dfb_surface_buffer_dump ( CoreSurfaceBuffer *buffer, DFBResult dfb_surface_buffer_dump ( CoreSurfaceBuffer *buffer,
const char *directory, const char *directory,
const char *prefix ); const char *prefix );
CoreSurfaceAllocation *
dfb_surface_buffer_find_allocation( CoreSurfaceBuffer *buffer,
CoreSurfaceAccessorID accessor,
CoreSurfaceAccessFlags flags,
bool lock );
static inline int static inline int
dfb_surface_buffer_index( CoreSurfaceBuffer *buffer ) dfb_surface_buffer_index( CoreSurfaceBuffer *buffer )
{ {
int index; int index;
CoreSurface *surface; CoreSurface *surface;
D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer ); D_MAGIC_ASSERT( buffer, CoreSurfaceBuffer );
surface = buffer->surface; surface = buffer->surface;
D_MAGIC_ASSERT( surface, CoreSurface ); D_MAGIC_ASSERT( surface, CoreSurface );
for (index=0; index<MAX_SURFACE_BUFFERS; index++) { for (index=0; index<MAX_SURFACE_BUFFERS; index++) {
if (surface->buffers[index] == buffer) if (surface->left_buffers[index] == buffer)
return index; return index;
if (surface->config.caps & DSCAPS_STEREO)
if (surface->right_buffers[index] == buffer)
return index;
} }
D_ASSERT( index<MAX_SURFACE_BUFFERS ); D_ASSERT( index<MAX_SURFACE_BUFFERS );
return 0; return 0;
} }
FUSION_OBJECT_METHODS( CoreSurfaceBuffer, dfb_surface_buffer ) DFBResult dfb_surface_allocation_update( CoreSurfaceAllocation *allocation
,
FusionObjectPool *dfb_surface_buffer_pool_create( const FusionWorld *world CoreSurfaceAccessFlags access );
);
#endif #endif
 End of changes. 15 change blocks. 
43 lines changed or deleted 94 lines changed or added


 surface_pool.h   surface_pool.h 
skipping to change at line 45 skipping to change at line 45
#include <core/surface.h> #include <core/surface.h>
#include <core/surface_buffer.h> #include <core/surface_buffer.h>
typedef enum { typedef enum {
CSPCAPS_NONE = 0x00000000, CSPCAPS_NONE = 0x00000000,
CSPCAPS_PHYSICAL = 0x00000001, /* pool provides physical address t o buffer */ CSPCAPS_PHYSICAL = 0x00000001, /* pool provides physical address t o buffer */
CSPCAPS_VIRTUAL = 0x00000002, /* pool provides virtual address to buffer */ CSPCAPS_VIRTUAL = 0x00000002, /* pool provides virtual address to buffer */
CSPCAPS_READ = 0x00000004, /* pool provides Read() function (s CSPCAPS_ALL = 0x00000003
et automatically) */
CSPCAPS_WRITE = 0x00000008, /* pool provides Write() function (
set automatically) */
CSPCAPS_ALL = 0x0000000F
} CoreSurfacePoolCapabilities; } CoreSurfacePoolCapabilities;
typedef enum { typedef enum {
CSPP_DEFAULT, CSPP_DEFAULT,
CSPP_PREFERED, CSPP_PREFERED,
CSPP_ULTIMATE CSPP_ULTIMATE
} CoreSurfacePoolPriority; } CoreSurfacePoolPriority;
/* /*
* Increase this number when changes result in binary incompatibility! * Increase this number when changes result in binary incompatibility!
skipping to change at line 169 skipping to change at line 166
int pitch, int pitch,
const DFBRectangle *rect ); const DFBRectangle *rect );
/* /*
* Muck out * Muck out
*/ */
DFBResult (*MuckOut) ( CoreSurfacePool *pool, DFBResult (*MuckOut) ( CoreSurfacePool *pool,
void *pool_data, void *pool_data,
void *pool_local, void *pool_local,
CoreSurfaceBuffer *buffer ); CoreSurfaceBuffer *buffer );
/*
* Manage interlocks
*/
DFBResult (*PreLock) ( CoreSurfacePool *pool,
void *pool_data,
void *pool_local,
CoreSurfaceAllocation *allocation,
void *alloc_data,
CoreSurfaceAccessorID accessor,
CoreSurfaceAccessFlags access );
/*
* Handle preallocation
*
* The surface pool checks the description and extracts/generates
* information for the surface configuration, to be later used in
* the AllocateBuffer function.
*/
DFBResult (*PreAlloc)( CoreSurfacePool *pool,
void *pool_data,
void *pool_local,
const DFBSurfaceDescription *description,
CoreSurfaceConfig *config );
} SurfacePoolFuncs; } SurfacePoolFuncs;
struct __DFB_CoreSurfacePool { struct __DFB_CoreSurfacePool {
int magic; int magic;
FusionSkirmish lock; FusionSkirmish lock;
CoreSurfacePoolID pool_id; CoreSurfacePoolID pool_id;
CoreSurfacePoolDescription desc; CoreSurfacePoolDescription desc;
skipping to change at line 223 skipping to change at line 196
CoreSurfacePool *backup; CoreSurfacePool *backup;
}; };
typedef DFBEnumerationResult (*CoreSurfacePoolCallback)( CoreSurfacePool *p ool, typedef DFBEnumerationResult (*CoreSurfacePoolCallback)( CoreSurfacePool *p ool,
void *c tx ); void *c tx );
typedef DFBEnumerationResult (*CoreSurfaceAllocCallback)( CoreSurfaceAlloca tion *allocation, typedef DFBEnumerationResult (*CoreSurfaceAllocCallback)( CoreSurfaceAlloca tion *allocation,
void *ctx ); void *ctx );
DFBResult dfb_surface_pools_prealloc ( const DFBSurfaceDescription *descrip
tion,
CoreSurfaceConfig *config
);
DFBResult dfb_surface_pools_negotiate( CoreSurfaceBuffer *buffer, DFBResult dfb_surface_pools_negotiate( CoreSurfaceBuffer *buffer,
CoreSurfaceAccessorID accessor, CoreSurfaceAccessorID accessor,
CoreSurfaceAccessFlags access, CoreSurfaceAccessFlags access,
CoreSurfacePool **ret_pools, CoreSurfacePool **ret_pools,
unsigned int max_pools, unsigned int max_pools,
unsigned int *ret_num ); unsigned int *ret_num );
DFBResult dfb_surface_pools_enumerate( CoreSurfacePoolCallback callback, DFBResult dfb_surface_pools_enumerate( CoreSurfacePoolCallback callback,
void *ctx ); void *ctx );
DFBResult dfb_surface_pools_lookup ( CoreSurfacePoolID pool_id,
CoreSurfacePool **ret_pool );
DFBResult dfb_surface_pools_allocate ( CoreSurfaceBuffer *buffer, DFBResult dfb_surface_pools_allocate ( CoreSurfaceBuffer *buffer,
CoreSurfaceAccessorID accessor, CoreSurfaceAccessorID accessor,
CoreSurfaceAccessFlags access, CoreSurfaceAccessFlags access,
CoreSurfaceAllocation **ret_allocat ion ); CoreSurfaceAllocation **ret_allocat ion );
DFBResult dfb_surface_pool_initialize( CoreDFB *core, DFBResult dfb_surface_pool_initialize( CoreDFB *core,
const SurfacePoolFuncs *funcs, const SurfacePoolFuncs *funcs,
CoreSurfacePool **ret_pool ); CoreSurfacePool **ret_pool );
DFBResult dfb_surface_pool_initialize2( CoreDFB *core,
const SurfacePoolFuncs *funcs,
void *ctx,
CoreSurfacePool **ret_pool )
;
DFBResult dfb_surface_pool_join ( CoreDFB *core, DFBResult dfb_surface_pool_join ( CoreDFB *core,
CoreSurfacePool *pool, CoreSurfacePool *pool,
const SurfacePoolFuncs *funcs ); const SurfacePoolFuncs *funcs );
DFBResult dfb_surface_pool_join2 ( CoreDFB *core,
CoreSurfacePool *pool,
const SurfacePoolFuncs *funcs,
void *ctx );
DFBResult dfb_surface_pool_destroy ( CoreSurfacePool *pool ); DFBResult dfb_surface_pool_destroy ( CoreSurfacePool *pool );
DFBResult dfb_surface_pool_leave ( CoreSurfacePool *pool ); DFBResult dfb_surface_pool_leave ( CoreSurfacePool *pool );
DFBResult dfb_surface_pool_allocate ( CoreSurfacePool *pool, DFBResult dfb_surface_pool_allocate ( CoreSurfacePool *pool,
CoreSurfaceBuffer *buffer, CoreSurfaceBuffer *buffer,
CoreSurfaceAllocation **ret_allocat ion ); CoreSurfaceAllocation **ret_allocat ion );
DFBResult dfb_surface_pool_deallocate( CoreSurfacePool *pool, DFBResult dfb_surface_pool_deallocate( CoreSurfacePool *pool,
CoreSurfaceAllocation *allocation ); CoreSurfaceAllocation *allocation );
DFBResult dfb_surface_pool_displace ( CoreSurfacePool *pool, DFBResult dfb_surface_pool_displace ( CoreSurfacePool *pool,
CoreSurfaceBuffer *buffer, CoreSurfaceBuffer *buffer,
CoreSurfaceAllocation **ret_allocat ion ); CoreSurfaceAllocation **ret_allocat ion );
DFBResult dfb_surface_pool_prelock ( CoreSurfacePool *pool,
CoreSurfaceAllocation *allocation,
CoreSurfaceAccessorID accessor,
CoreSurfaceAccessFlags access );
DFBResult dfb_surface_pool_lock ( CoreSurfacePool *pool, DFBResult dfb_surface_pool_lock ( CoreSurfacePool *pool,
CoreSurfaceAllocation *allocation, CoreSurfaceAllocation *allocation,
CoreSurfaceBufferLock *lock ); CoreSurfaceBufferLock *lock );
DFBResult dfb_surface_pool_unlock ( CoreSurfacePool *pool, DFBResult dfb_surface_pool_unlock ( CoreSurfacePool *pool,
CoreSurfaceAllocation *allocation, CoreSurfaceAllocation *allocation,
CoreSurfaceBufferLock *lock ); CoreSurfaceBufferLock *lock );
DFBResult dfb_surface_pool_read ( CoreSurfacePool *pool, DFBResult dfb_surface_pool_read ( CoreSurfacePool *pool,
CoreSurfaceAllocation *allocation, CoreSurfaceAllocation *allocation,
 End of changes. 7 change blocks. 
54 lines changed or deleted 1 lines changed or added


 surface_pool_bridge.h   surface_pool_bridge.h 
skipping to change at line 38 skipping to change at line 38
#ifndef __CORE__SURFACE_POOL_BRIDGE_H__ #ifndef __CORE__SURFACE_POOL_BRIDGE_H__
#define __CORE__SURFACE_POOL_BRIDGE_H__ #define __CORE__SURFACE_POOL_BRIDGE_H__
#include <directfb.h> #include <directfb.h>
#include <core/coretypes.h> #include <core/coretypes.h>
#include <core/surface.h> #include <core/surface.h>
#include <core/surface_buffer.h> #include <core/surface_buffer.h>
#include <core/surface_pool.h>
typedef enum { typedef enum {
CSPBCAPS_NONE = 0x00000000, CSPBCAPS_NONE = 0x00000000,
CSPBCAPS_ALL = 0x00000000 CSPBCAPS_ALL = 0x00000000
} CoreSurfacePoolBridgeCapabilities; } CoreSurfacePoolBridgeCapabilities;
/* /*
* Increase this number when changes result in binary incompatibility! * Increase this number when changes result in binary incompatibility!
*/ */
#define DFB_SURFACE_POOL_BRIDGE_ABI_VERSION 1 #define DFB_SURFACE_POOL_BRIDGE_ABI_VERSION 1
#define DFB_SURFACE_POOL_BRIDGE_DESC_NAME_LENGTH 44 #define DFB_SURFACE_POOL_BRIDGE_DESC_NAME_LENGTH 44
typedef struct { typedef struct {
CoreSurfacePoolBridgeCapabilities caps; CoreSurfacePoolBridgeCapabilities caps;
char name[DFB_SURFACE_POOL_BRIDGE_DESC_N AME_LENGTH]; char name[DFB_SURFACE_POOL_BRIDGE_DESC_N AME_LENGTH];
CoreSurfacePoolPriority priority;
} CoreSurfacePoolBridgeDescription; } CoreSurfacePoolBridgeDescription;
typedef struct { typedef struct {
int (*PoolBridgeDataSize)( void ); int (*PoolBridgeDataSize)( void );
int (*PoolBridgeLocalDataSize)( void ); int (*PoolBridgeLocalDataSize)( void );
int (*PoolTransferDataSize)( void ); int (*PoolTransferDataSize)( void );
/* /*
* Bridge init/destroy * Bridge init/destroy
 End of changes. 2 change blocks. 
2 lines changed or deleted 0 lines changed or added


 system.h   system.h 
skipping to change at line 48 skipping to change at line 48
#include <fusion/types.h> #include <fusion/types.h>
typedef enum { typedef enum {
CORE_ANY, CORE_ANY,
CORE_FBDEV, CORE_FBDEV,
CORE_X11, CORE_X11,
CORE_OSX, CORE_OSX,
CORE_SDL, CORE_SDL,
CORE_VNC, CORE_VNC,
CORE_DEVMEM, CORE_DEVMEM,
CORE_TI_CMEM CORE_TI_CMEM,
CORE_MESA,
CORE_X11VDPAU,
CORE_PVR2D,
} CoreSystemType; } CoreSystemType;
typedef enum { typedef enum {
CSCAPS_NONE = 0x00000000, /* None of these. */ CSCAPS_NONE = 0x00000000, /* None of these. */
CSCAPS_ACCELERATION = 0x00000001, /* HW acceleration supported, so pr obe graphics drivers. */ CSCAPS_ACCELERATION = 0x00000001, /* HW acceleration supported, so pr obe graphics drivers. */
CSCAPS_PREFER_SHM = 0x00000002, /* Prefer shared memory surface poo l over local memory pool. */
CSCAPS_ALL = 0x00000001 /* All of these. */ CSCAPS_ALL = 0x00000003 /* All of these. */
} CoreSystemCapabilities; } CoreSystemCapabilities;
/* /*
* hold information of a Videomode read from /etc/fb.modes * hold information of a Videomode read from /etc/fb.modes
* (to be replaced by DirectFB's own config system) * (to be replaced by DirectFB's own config system)
*/ */
typedef struct _VideoMode { typedef struct _VideoMode {
int xres; int xres;
int yres; int yres;
int bpp; int bpp;
 End of changes. 3 change blocks. 
2 lines changed or deleted 6 lines changed or added


 thread.h   thread.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 29 skipping to change at line 29
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__THREAD_H__ #ifndef __DIRECT__OS__LINUX__GLIBC__THREAD_H__
#define __DIRECT__THREAD_H__ #define __DIRECT__OS__LINUX__GLIBC__THREAD_H__
#include <sys/types.h> #include <pthread.h>
#include <direct/types.h> #include <direct/util.h>
#include <direct/conf.h>
#include <direct/mutex.h>
typedef enum { /**************************************************************************
DTT_DEFAULT = 0, ********************************************/
DTT_CLEANUP = -5,
DTT_INPUT = -10,
DTT_OUTPUT = -12,
DTT_MESSAGING = -15,
DTT_CRITICAL = -20
} DirectThreadType;
typedef void * (*DirectThreadMainFunc)( DirectThread *thread, void *arg ); struct __D_DirectThreadHandle {
pthread_t thread;
};
typedef void (*DirectThreadInitFunc)( DirectThread *thread, void *arg ); /**************************************************************************
********************************************/
/**************************************************************************
********************************************/
/* /**************************************************************************
* Add a handler being called at the beginning of new threads. ********************************************/
*/
DirectThreadInitHandler *direct_thread_add_init_handler ( DirectThreadIni
tFunc func,
void
*arg );
/* struct __D_DirectOnce {
* Remove the specified handler. pthread_once_t once;
*/ };
void direct_thread_remove_init_handler( DirectThreadIni
tHandler *handler );
/* /**************************************************************************
* Create a new thread and start it. ********************************************/
* The thread type is relevant for the scheduling priority.
*/
DirectThread *direct_thread_create ( DirectThreadType thread_type,
DirectThreadMainFunc thread_main,
void *arg,
const char *name );
/* #define DIRECT_ONCE_INIT { PTHREAD_ONCE_INIT }
* Returns the thread of the caller.
*/
DirectThread *direct_thread_self ( void );
/* /**************************************************************************
* Returns the name of the specified thread. ********************************************/
*/
const char *direct_thread_get_name ( DirectThread *thread );
/* typedef void (*DirectOnceInitHandler)( void );
* Returns the thread ID of the specified thread.
*/
pid_t direct_thread_get_tid ( DirectThread *thread );
/* /**************************************************************************
* Returns the name of the calling thread. ********************************************/
*/
const char *direct_thread_self_name ( void );
/* __attribute__((no_instrument_function))
* Changes the name of the calling thread. static inline DirectResult direct_once( DirectOnce *once,
*/ DirectOnceInitHandler handler );
void direct_thread_set_name ( const char *name );
/* static inline DirectResult
* Wait on the thread object to be notified via direct_thread_notify(). direct_once( DirectOnce *once,
*/ DirectOnceInitHandler handler )
DirectResult direct_thread_wait ( DirectThread *thread, {
int timeout_ms ); if (pthread_once( &once->once, handler ))
return errno2result( errno );
/* return DR_OK;
* Notify the thread object waking up callers of direct_thread_wait(). }
*/
void direct_thread_notify ( DirectThread *thread );
void direct_thread_lock ( DirectThread *thread ); /**************************************************************************
void direct_thread_unlock ( DirectThread *thread ); ********************************************/
/**************************************************************************
********************************************/
/* struct __D_DirectTLS {
* Kindly ask the thread to terminate (for joining without thread cancellat pthread_key_t key;
ion). };
*/
void direct_thread_terminate ( DirectThread *thread );
/* /**************************************************************************
* Cancel a running thread. ********************************************/
*/
void direct_thread_cancel ( DirectThread *thread );
/* #define DIRECT_TLS_DATA( name ) \
* Returns true if the specified thread has been canceled. static DirectTLS name = { (pthread_key_t) -1 }
*/
bool direct_thread_is_canceled( DirectThread *thread );
/* /**************************************************************************
* Detach a thread. ********************************************/
*/
void direct_thread_detach ( DirectThread *thread );
/* __attribute__((no_instrument_function))
* Returns true if the specified thread has been detached. static inline void *direct_tls_get__( DirectTLS *tls );
*/
bool direct_thread_is_detached( DirectThread *thread );
/* __attribute__((no_instrument_function))
* Check if the calling thread is canceled. static inline DirectResult direct_tls_set__( DirectTLS *tls,
* Must not be called by other threads than 'thread'. void *value );
* This function won't return if the thread is canceled.
*/
void direct_thread_testcancel ( DirectThread *thread );
/* __attribute__((no_instrument_function))
* Wait until a running thread is terminated. static inline DirectResult direct_tls_register( DirectTLS *tls,
*/ void (*destructor)( vo
void direct_thread_join ( DirectThread *thread ); id* ) );
/* __attribute__((no_instrument_function))
* Returns true if the specified thread has been join. static inline DirectResult direct_tls_unregister( DirectTLS *tls );
*/
bool direct_thread_is_joined ( DirectThread *thread );
/* /**************************************************************************
* Free resources allocated by direct_thread_create. ********************************************/
* If the thread is still running it will be killed.
*/
void direct_thread_destroy ( DirectThread *thread );
/* #define direct_tls_get( name ) direct_tls_get__( &name )
* Utilities for stringification. #define direct_tls_set( name, v ) direct_tls_set__( &name,
*/ v )
#if DIRECT_BUILD_TEXT
const char *direct_thread_type_name ( DirectThreadType type ); /**************************************************************************
const char *direct_thread_scheduler_name( DirectConfigThreadScheduler sched ********************************************/
uler );
const char *direct_thread_policy_name ( int policy ); static inline void *
#endif direct_tls_get__( DirectTLS *tls )
{
void *value;
value = pthread_getspecific( tls->key );
return value;
}
static inline DirectResult
direct_tls_set__( DirectTLS *tls,
void *value )
{
if (pthread_setspecific( tls->key, value ))
return errno2result( errno );
return DR_OK;
}
static inline DirectResult
direct_tls_register( DirectTLS *tls, void (*destructor)( void* ) )
{
if (pthread_key_create( &tls->key, destructor ))
return errno2result( errno );
return DR_OK;
}
static inline DirectResult
direct_tls_unregister( DirectTLS *tls )
{
if (pthread_key_delete( tls->key ))
return errno2result( errno );
tls->key = (pthread_key_t) -1;
return DR_OK;
}
#endif #endif
 End of changes. 28 change blocks. 
117 lines changed or deleted 110 lines changed or added


 trace.h   trace.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 43 skipping to change at line 43
/************************************************************************** ********************************************* /************************************************************************** *********************************************
** Symbols ** Symbols
*/ */
/* /*
* Returns filename on success or NULL. * Returns filename on success or NULL.
* *
* Stores load address of object in 'ret_base' on success. * Stores load address of object in 'ret_base' on success.
*/ */
const char *direct_trace_lookup_file ( void *address, const char DIRECT_API *direct_trace_lookup_file ( void *address,
void **ret_base ); void **ret_base );
/* /*
* Look up a symbol by filename and offset. * Look up a symbol by filename and offset.
* *
* Returns symbol name on success or NULL. * Returns symbol name on success or NULL.
*/ */
const char *direct_trace_lookup_symbol( const char *filename, const char DIRECT_API *direct_trace_lookup_symbol( const char *filename,
long offset ); long offset );
/* /*
* Convenience function combining direct_trace_lookup_file() and direct_tra ce_lookup_symbol(). * Convenience function combining direct_trace_lookup_file() and direct_tra ce_lookup_symbol().
*/ */
static inline const char * static __inline__ const char *
direct_trace_lookup_symbol_at( void *address ) direct_trace_lookup_symbol_at( void *address )
{ {
void *base; void *base;
const char *filename; const char *filename;
filename = direct_trace_lookup_file( address, &base ); filename = direct_trace_lookup_file( address, &base );
return direct_trace_lookup_symbol( filename, (unsigned long) address - (unsigned long) base ); return direct_trace_lookup_symbol( filename, (unsigned long) address - (unsigned long) base );
} }
/************************************************************************** ********************************************* /************************************************************************** *********************************************
** Stacks ** Stacks
*/ */
/* /*
* Print stack in 'buffer' or current if NULL. * Print stack in 'buffer' or current if NULL.
*/ */
void direct_trace_print_stack( DirectTraceBuffer *buffer ); void DIRECT_API direct_trace_print_stack( DirectTraceBuffer *buffer );
/* /*
* Print stack of each known thread. * Print stack of each known thread.
*/ */
void direct_trace_print_stacks( void ); void DIRECT_API direct_trace_print_stacks( void );
/* /*
* Returns indent level for debug output. * Returns indent level for debug output.
*/ */
int direct_trace_debug_indent( void ); int DIRECT_API direct_trace_debug_indent( void );
/* /*
* Create a copy of a stack in 'buffer' or of current if NULL. * Create a copy of a stack in 'buffer' or of current if NULL.
*/ */
DirectTraceBuffer *direct_trace_copy_buffer( DirectTraceBuffer *buffer ); DirectTraceBuffer DIRECT_API *direct_trace_copy_buffer( DirectTraceBuffer * buffer );
/* /*
* Free a (copied) stack buffer. * Free a (copied) stack buffer.
*/ */
void direct_trace_free_buffer( DirectTraceBuffer *buffer ); void DIRECT_API direct_trace_free_buffer( DirectTraceBuffer * buffer );
#endif #endif
 End of changes. 9 change blocks. 
11 lines changed or deleted 11 lines changed or added


 tree.h   tree.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 54 skipping to change at line 54
struct __D_DirectNode struct __D_DirectNode
{ {
int balance; int balance;
DirectNode *left; DirectNode *left;
DirectNode *right; DirectNode *right;
void *key; void *key;
void *value; void *value;
}; };
DirectTree *direct_tree_new ( void ); DirectTree DIRECT_API *direct_tree_new ( void );
void direct_tree_destroy( DirectTree *tree ); void DIRECT_API direct_tree_destroy( DirectTree *tree );
void direct_tree_insert ( DirectTree *tree, void DIRECT_API direct_tree_insert ( DirectTree *tree,
void *key, void *key,
void *value ); void *value );
void *direct_tree_lookup ( DirectTree *tree, void DIRECT_API *direct_tree_lookup ( DirectTree *tree,
void *key ); void *key );
#endif #endif
 End of changes. 5 change blocks. 
8 lines changed or deleted 8 lines changed or added


 types.h   types.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
skipping to change at line 29 skipping to change at line 29
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DIRECT__TYPES_H__ #ifndef __DIRECT__OS__LINUX__GLIBC__TYPES_H__
#define __DIRECT__TYPES_H__ #define __DIRECT__OS__LINUX__GLIBC__TYPES_H__
#include <direct/build.h> #include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
/* #include <string.h>
* Define the bool type by including stdbool.h (preferably)...
*/
#if DIRECT_BUILD_STDBOOL
# include <stdbool.h>
/*
* ...or defining it ourself, if not using C++ or another definition
*/
#elif !defined(__cplusplus) && !defined(__bool_true_false_are_defined)
# warning Fallback definition of bool using u8! Checking for 'flags & 0x10
0' or higher bits will be false :(
typedef u8 bool;
# ifndef false
# define false (0)
# endif
# ifndef true
# define true (!false)
# endif
#endif /* DIRECT_BUILD_STDBOOL */
/* makes it possible to prevent definition of "direct" standard types */ #include <unistd.h>
#ifndef __DIRECT__STDTYPES__
#define __DIRECT__STDTYPES__
#ifdef USE_KOS
#include <sys/types.h> #include <ctype.h>
typedef uint8 u8; #include <dirent.h>
typedef uint16 u16; #include <errno.h>
typedef uint32 u32; #include <fcntl.h>
typedef uint64 u64; #include <limits.h>
#include <sched.h>
#include <signal.h>
typedef sint8 s8; #include <netinet/in.h>
typedef sint16 s16;
typedef sint32 s32;
typedef sint64 s64;
#else #include <sys/mman.h>
#include <sys/param.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <stdint.h>; typedef unsigned int unichar;
typedef uint8_t u8; typedef uint8_t u8;
typedef uint16_t u16; typedef uint16_t u16;
typedef uint32_t u32; typedef uint32_t u32;
typedef uint64_t u64; typedef uint64_t u64;
typedef int8_t s8; typedef int8_t s8;
typedef int16_t s16; typedef int16_t s16;
typedef int32_t s32; typedef int32_t s32;
typedef int64_t s64; typedef int64_t s64;
#endif #define __inline__ inline
#endif /* __DIRECT__STDTYPES__ */ #define D_UNUSED __attribute__((unused))
#define __no_instrument_function__ __attribute__((no_instrument_functi
#include <sys/mman.h> on))
#include <sys/stat.h> #define __constructor__ __attribute__((constructor))
#include <dirent.h> #define __destructor__ __attribute__((destructor))
#include <fcntl.h> #define __typeof__(x) typeof(x)
#include <string.h> #define __func__ __FUNCTION__
#include <unistd.h>
#define D_UNUSED __attribute__((unused))
#define direct_strcmp strcmp
typedef enum {
DR_OK = 0x00000000, /* No error occured. */
DR_FAILURE, /* A general or unknown error occured. */
DR_INIT, /* A general initialization error occured. */
DR_BUG, /* Internal bug or inconsistency has been detected
. */
DR_DEAD, /* Interface has a zero reference counter (availab
le in debug mode). */
DR_UNSUPPORTED, /* The requested operation or an argument is (curr
ently) not supported. */
DR_UNIMPLEMENTED, /* The requested operation is not implemented, yet
. */
DR_ACCESSDENIED, /* Access to the resource is denied. */
DR_INVAREA, /* An invalid area has been specified or detected.
*/
DR_INVARG, /* An invalid argument has been specified. */
DR_NOLOCALMEMORY, /* There's not enough local system memory. */
DR_NOSHAREDMEMORY, /* There's not enough shared system memory. */
DR_LOCKED, /* The resource is (already) locked. */
DR_BUFFEREMPTY, /* The buffer is empty. */
DR_FILENOTFOUND, /* The specified file has not been found. */
DR_IO, /* A general I/O error occured. */
DR_BUSY, /* The resource or device is busy. */
DR_NOIMPL, /* No implementation for this interface or content
type has been found. */
DR_TIMEOUT, /* The operation timed out. */
DR_THIZNULL, /* 'thiz' pointer is NULL. */
DR_IDNOTFOUND, /* No resource has been found by the specified id.
*/
DR_DESTROYED, /* The requested object has been destroyed. */
DR_FUSION, /* Internal fusion error detected, most likely rel
ated to IPC resources. */
DR_BUFFERTOOLARGE, /* Buffer is too large. */
DR_INTERRUPTED, /* The operation has been interrupted. */
DR_NOCONTEXT, /* No context available. */
DR_TEMPUNAVAIL, /* Temporarily unavailable. */
DR_LIMITEXCEEDED, /* Attempted to exceed limit, i.e. any kind of max
imum size, count etc. */
DR_NOSUCHMETHOD, /* Requested method is not known. */
DR_NOSUCHINSTANCE, /* Requested instance is not known. */
DR_ITEMNOTFOUND, /* No such item found. */
DR_VERSIONMISMATCH, /* Some versions didn't match. */
DR_EOF, /* Reached end of file. */
DR_SUSPENDED, /* The requested object is suspended. */
DR_INCOMPLETE, /* The operation has been executed, but not comple
tely. */
DR_NOCORE /* Core part not available. */
} DirectResult;
/*
* Generate result code base for API 'A','B','C', e.g. 'D','F','B'.
*/
#define D_RESULT_TYPE_BASE( a,b,c ) ((((unsigned)(a)&0x7f) * 0x02000000
) + \
(((unsigned)(b)&0x7f) * 0x00040000
) + \
(((unsigned)(c)&0x7f) * 0x00000800
))
/* #define _ZD "%zd"
* Generate result code maximum for API 'A','B','C', e.g. 'D','F','B'. #define _ZU "%zu"
*/
#define D_RESULT_TYPE_MAX( a,b,c ) (D_RESULT_TYPE_BASE(a,b,c) + 0x7ff)
/* /*
* Check if given result code belongs to API 'A','B','C', e.g. 'D','F','B'. * Define the bool type by including stdbool.h (preferably)...
*/ */
#define D_RESULT_TYPE_IS( code,a,b,c ) ((code) >= D_RESULT_TYPE_BASE(a,b,c #if DIRECT_BUILD_STDBOOL
) && (code) <= D_RESULT_TYPE_MAX(a,b,c)) # include <stdbool.h>
/* /*
* Return value of enumeration callbacks * ...or defining it ourself, if not using C++ or another definition
*/ */
typedef enum { #elif !defined(__cplusplus) && !defined(__bool_true_false_are_defined)
DENUM_OK = 0x00000000, /* Proceed with enumeration */ # warning Fallback definition of bool using u8! Checking for 'flags & 0x10
DENUM_CANCEL = 0x00000001 /* Cancel enumeration */ 0' or higher bits will be false :(
} DirectEnumerationResult; typedef u8 bool;
# ifndef false
typedef u32 unichar; # define false (0)
# endif
# ifndef true
# define true (!false)
# endif
#endif /* DIRECT_BUILD_STDBOOL */
typedef struct __D_DirectCleanupHandler DirectCleanupHandler; #if DIRECT_BUILD_DYNLOAD
typedef struct __D_DirectConfig DirectConfig; #include <dlfcn.h>
typedef struct __D_DirectHash DirectHash; #endif
typedef struct __D_DirectLink DirectLink;
typedef struct __D_DirectLog DirectLog;
typedef struct __D_DirectMap DirectMap;
typedef struct __D_DirectModuleDir DirectModuleDir;
typedef struct __D_DirectModuleEntry DirectModuleEntry;
typedef struct __D_DirectMutex DirectMutex;
typedef struct __D_DirectSerial DirectSerial;
typedef struct __D_DirectSignalHandler DirectSignalHandler;
typedef struct __D_DirectStream DirectStream;
typedef struct __D_DirectTraceBuffer DirectTraceBuffer;
typedef struct __D_DirectTree DirectTree;
typedef struct __D_DirectThread DirectThread;
typedef struct __D_DirectThreadInitHandler DirectThreadInitHandler;
#endif #endif
 End of changes. 17 change blocks. 
140 lines changed or deleted 53 lines changed or added


 utf8.h   utf8.h 
/* /*
(c) Copyright 2001-2009 The world wide DirectFB Open Source Community ( directfb.org) (c) Copyright 2001-2008 The world wide DirectFB Open Source Community ( directfb.org)
(c) Copyright 2000-2004 Convergence (integrated media) GmbH (c) Copyright 2000-2004 Convergence (integrated media) GmbH
All rights reserved. All rights reserved.
Written by Denis Oliver Kropp <dok@directfb.org>, Written by Denis Oliver Kropp <dok@directfb.org>,
Andreas Hundt <andi@fischlustig.de>, Andreas Hundt <andi@fischlustig.de>,
Sven Neumann <neo@directfb.org>, Sven Neumann <neo@directfb.org>,
Ville Syrjälä <syrjala@sci.fi> and Ville Syrjälä <syrjala@sci.fi> and
Claudio Ciccani <klan@users.sf.net>. Claudio Ciccani <klan@users.sf.net>.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 util.h   util.h 
skipping to change at line 36 skipping to change at line 36
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __GFX__UTIL_H__ #ifndef __GFX__UTIL_H__
#define __GFX__UTIL_H__ #define __GFX__UTIL_H__
#include <core/surface.h> #include <core/surface.h>
void dfb_gfx_copy( CoreSurface *source, CoreSurface *destination, const DFB Rectangle *rect ); void dfb_gfx_copy( CoreSurface *source, CoreSurface *destination, const DFB Rectangle *rect );
void dfb_gfx_copy_to( CoreSurface *source, CoreSurface *destination, const DFBRectangle *rect, int x, int y, bool from_back ); void dfb_gfx_copy_to( CoreSurface *source, CoreSurface *destination, const DFBRectangle *rect, int x, int y, bool from_back );
void dfb_gfx_clear( CoreSurface *surface, CoreSurfaceBufferRole role );
void dfb_gfx_stretch_to( CoreSurface *source, CoreSurface *destination, con st DFBRectangle *srect, const DFBRectangle *drect, bool from_back ); void dfb_gfx_stretch_to( CoreSurface *source, CoreSurface *destination, con st DFBRectangle *srect, const DFBRectangle *drect, bool from_back );
void dfb_back_to_front_copy( CoreSurface *surface, const DFBRegion *region ); void dfb_back_to_front_copy( CoreSurface *surface, const DFBRegion *region );
void dfb_back_to_front_copy_rotation( CoreSurface *surface, const DFBRegion *region, int rotation ); void dfb_back_to_front_copy_rotation( CoreSurface *surface, const DFBRegion *region, int rotation );
void dfb_clear_depth( CoreSurface *surface, const DFBRegion *region ); void dfb_clear_depth( CoreSurface *surface, const DFBRegion *region );
void dfb_sort_triangle( DFBTriangle *tri ); void dfb_sort_triangle( DFBTriangle *tri );
void dfb_sort_trapezoid( DFBTrapezoid *trap ); void dfb_sort_trapezoid( DFBTrapezoid *trap );
void dfb_gfx_copy_regions( CoreSurface *source, void dfb_gfx_copy_regions( CoreSurface *source,
CoreSurfaceBufferRole from, CoreSurfaceBufferRole from,
CoreSurface *destination, CoreSurface *destination,
CoreSurfaceBufferRole to, CoreSurfaceBufferRole to,
const DFBRegion *regions, const DFBRegion *regions,
unsigned int num, unsigned int num,
int x, int x,
int y ); int y );
/*
* Simplyfy blitting flags
*
* Allow any combination of DSBLIT_ROTATE_ and DSBLIT_FLIP_ flags to be red
uced
* to a combination of DSBLIT_ROTATE_90, DSBLIT_FLIP_HORIZONTAL and DSBLIT_
FLIP_VERTICAL
*
*/
static inline void dfb_simplify_blittingflags( DFBSurfaceBlittingFlags *fla
gs )
{
if (*flags & DSBLIT_ROTATE180)
*flags ^= (DSBLIT_ROTATE180 | DSBLIT_FLIP_HORIZONTAL | DSBLIT_FLI
P_VERTICAL);
if (*flags & DSBLIT_ROTATE270) {
if (*flags & DSBLIT_ROTATE90)
*flags ^= (DSBLIT_ROTATE90 | DSBLIT_ROTATE270);
else
*flags ^= (DSBLIT_ROTATE90 | DSBLIT_ROTATE270 | DSBLIT_FLIP_
HORIZONTAL | DSBLIT_FLIP_VERTICAL);
}
}
#endif #endif
 End of changes. 2 change blocks. 
26 lines changed or deleted 0 lines changed or added


 vector.h   vector.h 
skipping to change at line 49 skipping to change at line 49
int magic; int magic;
void **elements; void **elements;
int count; int count;
int capacity; int capacity;
FusionSHMPoolShared *pool; FusionSHMPoolShared *pool;
} FusionVector; } FusionVector;
void fusion_vector_init ( FusionVector *vector, void FUSION_API fusion_vector_init ( FusionVector *vec
int capacity, tor,
FusionSHMPoolShared *pool ); int cap
acity,
FusionSHMPoolShared *poo
l );
void fusion_vector_destroy ( FusionVector *vector ); void FUSION_API fusion_vector_destroy ( FusionVector *vec tor );
DirectResult fusion_vector_add ( FusionVector *vector, DirectResult FUSION_API fusion_vector_add ( FusionVector *vec
void *element ); tor,
void *ele
ment );
DirectResult fusion_vector_insert ( FusionVector *vector, DirectResult FUSION_API fusion_vector_insert ( FusionVector *vec
void *element, tor,
int index ); void *ele
ment,
int ind
ex );
DirectResult fusion_vector_move ( FusionVector *vector, DirectResult FUSION_API fusion_vector_move ( FusionVector *vec
int from, tor,
int to ); int fro
m,
int to
);
DirectResult fusion_vector_remove ( FusionVector *vector, DirectResult FUSION_API fusion_vector_remove ( FusionVector *vec
int index ); tor,
int ind
ex );
DirectResult fusion_vector_remove_last( FusionVector *vector ); DirectResult FUSION_API fusion_vector_remove_last( FusionVector *vec tor );
static inline bool static __inline__ bool
fusion_vector_has_elements( const FusionVector *vector ) fusion_vector_has_elements( const FusionVector *vector )
{ {
D_MAGIC_ASSERT( vector, FusionVector ); D_MAGIC_ASSERT( vector, FusionVector );
return vector->count > 0; return vector->count > 0;
} }
static inline bool static __inline__ bool
fusion_vector_is_empty( const FusionVector *vector ) fusion_vector_is_empty( const FusionVector *vector )
{ {
D_MAGIC_ASSERT( vector, FusionVector ); D_MAGIC_ASSERT( vector, FusionVector );
return vector->count == 0; return vector->count == 0;
} }
static inline int static __inline__ int
fusion_vector_size( const FusionVector *vector ) fusion_vector_size( const FusionVector *vector )
{ {
D_MAGIC_ASSERT( vector, FusionVector ); D_MAGIC_ASSERT( vector, FusionVector );
return vector->count; return vector->count;
} }
static inline void * static __inline__ void *
fusion_vector_at( const FusionVector *vector, int index ) fusion_vector_at( const FusionVector *vector, int index )
{ {
D_MAGIC_ASSERT( vector, FusionVector ); D_MAGIC_ASSERT( vector, FusionVector );
D_ASSERT( index >= 0 ); D_ASSERT( index >= 0 );
D_ASSERT( index < vector->count ); D_ASSERT( index < vector->count );
return vector->elements[index]; return vector->elements[index];
} }
static inline bool static __inline__ bool
fusion_vector_contains( const FusionVector *vector, const void *element ) fusion_vector_contains( const FusionVector *vector, const void *element )
{ {
int i; int i;
int count; int count;
void * const *elements; void * const *elements;
D_MAGIC_ASSERT( vector, FusionVector ); D_MAGIC_ASSERT( vector, FusionVector );
D_ASSERT( element != NULL ); D_ASSERT( element != NULL );
count = vector->count; count = vector->count;
elements = vector->elements; elements = vector->elements;
/* Start with more recently added elements. */ /* Start with more recently added elements. */
for (i=count-1; i>=0; i--) for (i=count-1; i>=0; i--)
if (elements[i] == element) if (elements[i] == element)
return true; return true;
return false; return false;
} }
static inline int static __inline__ int
fusion_vector_index_of( const FusionVector *vector, const void *element ) fusion_vector_index_of( const FusionVector *vector, const void *element )
{ {
int i; int i;
int count; int count;
void * const *elements; void * const *elements;
D_MAGIC_ASSERT( vector, FusionVector ); D_MAGIC_ASSERT( vector, FusionVector );
D_ASSERT( element != NULL ); D_ASSERT( element != NULL );
count = vector->count; count = vector->count;
skipping to change at line 158 skipping to change at line 158
return INT_MIN >> 2; return INT_MIN >> 2;
} }
#define fusion_vector_foreach(element, index, vector) \ #define fusion_vector_foreach(element, index, vector) \
for ((index) = 0; \ for ((index) = 0; \
(index) < (vector).count && (element = (vector).elements[index]); \ (index) < (vector).count && (element = (vector).elements[index]); \
(index)++) (index)++)
#define fusion_vector_foreach_reverse(element, index, vector) \ #define fusion_vector_foreach_reverse(element, index, vector) \
for ((index) = (vector).count - 1; \ for ((index) = (vector).count - 1; \
(index) >= 0 && (vector).count && (index) >= 0 && (element = (vector).elements[index]);
\ \
(vector).elements &&
\
(element = (vector).elements[index]);
\
(index)--) (index)--)
#endif #endif
 End of changes. 14 change blocks. 
27 lines changed or deleted 36 lines changed or added


 windows.h   windows.h 
skipping to change at line 33 skipping to change at line 33
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __WINDOWS_H__ #ifndef __WINDOWS_H__
#define __WINDOWS_H__ #define __WINDOWS_H__
#include <directfb.h> #include <directfb.h>
#include <directfb_windows.h>
#include <core/coredefs.h> #include <core/coredefs.h>
#include <core/coretypes.h> #include <core/coretypes.h>
#include <fusion/object.h> #include <fusion/object.h>
typedef enum { typedef enum {
CWMGT_KEYBOARD, CWMGT_KEYBOARD,
CWMGT_POINTER, CWMGT_POINTER,
CWMGT_KEY, CWMGT_KEY,
CWMGT_UNSELECTED_KEYS, CWMGT_UNSELECTED_KEYS,
} CoreWMGrabTarget; } CoreWMGrabTarget;
typedef enum { #define CoreWindowConfigFlags DFBWindowConfigFlags
CWCF_NONE = 0x00000000,
CWCF_POSITION = 0x00000001,
CWCF_SIZE = 0x00000002,
CWCF_OPACITY = 0x00000004,
CWCF_STACKING = 0x00000008,
CWCF_OPTIONS = 0x00000010,
CWCF_EVENTS = 0x00000020,
CWCF_ASSOCIATION = 0x00000040,
CWCF_COLOR_KEY = 0x00000100,
CWCF_OPAQUE = 0x00000200,
CWCF_COLOR = 0x00000400,
CWCF_KEY_SELECTION = 0x00001000,
CWCF_CURSOR_FLAGS = 0x00002000,
CWCF_CURSOR_RESOLUTION = 0x00004000,
CWCF_SRC_GEOMETRY = 0x00010000,
CWCF_DST_GEOMETRY = 0x00020000,
CWCF_ROTATION = 0x00040000,
CWCF_APPLICATION_ID= 0x00080000,
CWCF_ALL = 0x000F777F #define CWCF_NONE DWCONF_NONE
} CoreWindowConfigFlags; #define CWCF_POSITION DWCONF_POSITION
#define CWCF_SIZE DWCONF_SIZE
#define CWCF_OPACITY DWCONF_OPACITY
#define CWCF_STACKING DWCONF_STACKING
#define CWCF_OPTIONS DWCONF_OPTIONS
#define CWCF_EVENTS DWCONF_EVENTS
#define CWCF_ASSOCIATION DWCONF_ASSOCIATION
#define CWCF_COLOR_KEY DWCONF_COLOR_KEY
#define CWCF_OPAQUE DWCONF_OPAQUE
#define CWCF_COLOR DWCONF_COLOR
#define CWCF_STEREO_DEPTH DWCONF_STEREO_DEPTH
#define CWCF_KEY_SELECTION DWCONF_KEY_SELECTION
#define CWCF_CURSOR_FLAGS DWCONF_CURSOR_FLAGS
#define CWCF_CURSOR_RESOLUTION DWCONF_CURSOR_RESOLUTION
#define CWCF_SRC_GEOMETRY DWCONF_SRC_GEOMETRY
#define CWCF_DST_GEOMETRY DWCONF_DST_GEOMETRY
#define CWCF_ROTATION DWCONF_ROTATION
#define CWCF_APPLICATION_ID DWCONF_APPLICATION_ID
#define CWCF_ALL DWCONF_ALL
struct __DFB_CoreWindowConfig { struct __DFB_CoreWindowConfig {
DFBRectangle bounds; /* position and size */ DFBRectangle bounds; /* position and size */
int opacity; /* global alpha factor */ int opacity; /* global alpha factor */
DFBWindowStackingClass stacking; /* level boundaries */ DFBWindowStackingClass stacking; /* level boundaries */
DFBWindowOptions options; /* flags for appearance/behav iour */ DFBWindowOptions options; /* flags for appearance/behav iour */
DFBWindowEventType events; /* mask of enabled events */ DFBWindowEventType events; /* mask of enabled events */
DFBColor color; /* color for DWCAPS_COLOR, ne ver premultiplied! */ DFBColor color; /* color for DWCAPS_COLOR, ne ver premultiplied! */
u32 color_key; /* transparent pixel */ u32 color_key; /* transparent pixel */
DFBRegion opaque; /* region of the window force d to be opaque */ DFBRegion opaque; /* region of the window force d to be opaque */
int z; /* stereoscopic offset used t o establish perceived depth */
DFBWindowKeySelection key_selection; /* how to filter keys in focu s */ DFBWindowKeySelection key_selection; /* how to filter keys in focu s */
DFBInputDeviceKeySymbol *keys; /* list of keys for DWKS_LIST */ DFBInputDeviceKeySymbol *keys; /* list of keys for DWKS_LIST */
unsigned int num_keys; /* number of entries in key a rray */ unsigned int num_keys; /* number of entries in key a rray */
DFBWindowGeometry src_geometry; /* advanced source geometry * / DFBWindowGeometry src_geometry; /* advanced source geometry * /
DFBWindowGeometry dst_geometry; /* advanced destination geome try */ DFBWindowGeometry dst_geometry; /* advanced destination geome try */
int rotation; int rotation;
skipping to change at line 245 skipping to change at line 240
/* /*
* change window configuration * change window configuration
*/ */
DFBResult DFBResult
dfb_window_set_config( CoreWindow *window, dfb_window_set_config( CoreWindow *window,
const CoreWindowConfig *config, const CoreWindowConfig *config,
CoreWindowConfigFlags flags ); CoreWindowConfigFlags flags );
/* /*
* change window cursor
*/
DFBResult
dfb_window_set_cursor_shape( CoreWindow *window,
CoreSurface *surface,
unsigned int hot_x,
unsigned int hot_y );
/*
* sets the global alpha factor * sets the global alpha factor
*/ */
DFBResult DFBResult
dfb_window_set_opacity( CoreWindow *window, dfb_window_set_opacity( CoreWindow *window,
u8 opacity ); u8 opacity );
/* /*
* sets the window options * sets the window options
*/ */
DFBResult DFBResult
skipping to change at line 285 skipping to change at line 271
/* /*
* manipulates the event mask * manipulates the event mask
*/ */
DFBResult DFBResult
dfb_window_change_events( CoreWindow *window, dfb_window_change_events( CoreWindow *window,
DFBWindowEventType disable, DFBWindowEventType disable,
DFBWindowEventType enable ); DFBWindowEventType enable );
/* /*
* repaints part of a window, if region is NULL the whole window is repaint ed * repaints part of a window, if region is NULL the whole window is repaint ed
* right_region is ignored for all but stereo windows
*/ */
DFBResult DFBResult
dfb_window_repaint( CoreWindow *window, dfb_window_repaint( CoreWindow *window,
const DFBRegion *region, const DFBRegion *left_region,
const DFBRegion *right_region,
DFBSurfaceFlipFlags flags ); DFBSurfaceFlipFlags flags );
/* /*
* request a window to gain focus * request a window to gain focus
*/ */
DFBResult DFBResult
dfb_window_request_focus( CoreWindow *window ); dfb_window_request_focus( CoreWindow *window );
DFBResult dfb_window_set_key_selection( CoreWindow *wind ow, DFBResult dfb_window_set_key_selection( CoreWindow *wind ow,
DFBWindowKeySelection sele ction, DFBWindowKeySelection sele ction,
 End of changes. 7 change blocks. 
38 lines changed or deleted 26 lines changed or added


 wm.h   wm.h 
skipping to change at line 33 skipping to change at line 33
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. Boston, MA 02111-1307, USA.
*/ */
#ifndef __DFB__CORE__WM_H__ #ifndef __DFB__CORE__WM_H__
#define __DFB__CORE__WM_H__ #define __DFB__CORE__WM_H__
#include <directfb.h> #include <directfb.h>
#include <directfb_windows.h>
#include <direct/modules.h> #include <direct/modules.h>
#include <core/coretypes.h> #include <core/coretypes.h>
#include <core/windows.h> #include <core/windows.h>
DECLARE_MODULE_DIRECTORY( dfb_core_wm_modules ); DECLARE_MODULE_DIRECTORY( dfb_core_wm_modules );
/* /*
* Increase this number when changes result in binary incompatibility! * Increase this number when changes result in binary incompatibility!
*/ */
#define DFB_CORE_WM_ABI_VERSION 9 #define DFB_CORE_WM_ABI_VERSION 10
#define DFB_CORE_WM_INFO_NAME_LENGTH 60 #define DFB_CORE_WM_INFO_NAME_LENGTH 60
#define DFB_CORE_WM_INFO_VENDOR_LENGTH 80 #define DFB_CORE_WM_INFO_VENDOR_LENGTH 80
#define DFB_CORE_WM_INFO_URL_LENGTH 120 #define DFB_CORE_WM_INFO_URL_LENGTH 120
#define DFB_CORE_WM_INFO_LICENSE_LENGTH 40 #define DFB_CORE_WM_INFO_LICENSE_LENGTH 40
typedef struct { typedef struct {
int major; int major;
int minor; int minor;
skipping to change at line 275 skipping to change at line 276
DFBResult (*UpdateStack) ( CoreWindowStack *stack, DFBResult (*UpdateStack) ( CoreWindowStack *stack,
void *wm_data, void *wm_data,
void *stack_data, void *stack_data,
const DFBRegion *region, const DFBRegion *region,
DFBSurfaceFlipFlags flags ); DFBSurfaceFlipFlags flags );
DFBResult (*UpdateWindow) ( CoreWindow *window, DFBResult (*UpdateWindow) ( CoreWindow *window,
void *wm_data, void *wm_data,
void *window_data, void *window_data,
const DFBRegion *region, const DFBRegion *left_region,
const DFBRegion *right_region,
DFBSurfaceFlipFlags flags ); DFBSurfaceFlipFlags flags );
DFBResult (*UpdateCursor) ( CoreWindowStack *stack, DFBResult (*UpdateCursor) ( CoreWindowStack *stack,
void *wm_data, void *wm_data,
void *stack_data, void *stack_data,
CoreCursorUpdateFlags flags ); CoreCursorUpdateFlags flags );
} CoreWMFuncs; } CoreWMFuncs;
typedef enum {
CORE_WM_WINDOW_ADD = 1,
CORE_WM_WINDOW_REMOVE = 2,
CORE_WM_WINDOW_CONFIG = 3,
CORE_WM_WINDOW_STATE = 4,
CORE_WM_WINDOW_RESTACK = 5,
CORE_WM_WINDOW_FOCUS = 6,
_CORE_WM_NUM_CHANNELS
} CoreWMChannels;
typedef struct {
DFBWindowInfo info;
} CoreWM_WindowAdd;
typedef struct {
DFBWindowID window_id;
} CoreWM_WindowRemove;
typedef struct {
DFBWindowID window_id;
DFBWindowConfig config;
DFBWindowConfigFlags flags;
} CoreWM_WindowConfig;
typedef struct {
DFBWindowID window_id;
DFBWindowState state;
} CoreWM_WindowState;
typedef struct {
DFBWindowID window_id;
unsigned int index;
} CoreWM_WindowRestack;
typedef struct {
DFBWindowID window_id;
} CoreWM_WindowFocus;
DFBResult dfb_wm_attach ( CoreDFB *core,
int channel,
ReactionFunc func,
void *ctx,
Reaction *reaction );
DFBResult dfb_wm_detach ( CoreDFB *core,
Reaction *reaction );
DFBResult dfb_wm_dispatch( CoreDFB *core,
int channel,
const void *data,
int size );
DFBResult dfb_wm_dispatch_WindowAdd ( CoreDFB *core,
CoreWindow *window );
DFBResult dfb_wm_dispatch_WindowRemove ( CoreDFB *core,
CoreWindow *window );
DFBResult dfb_wm_dispatch_WindowConfig ( CoreDFB *core,
CoreWindow *window,
DFBWindowConfigFlags flags );
DFBResult dfb_wm_dispatch_WindowState ( CoreDFB *core,
CoreWindow *window );
DFBResult dfb_wm_dispatch_WindowRestack( CoreDFB *core,
CoreWindow *window,
unsigned int index );
DFBResult dfb_wm_dispatch_WindowFocus ( CoreDFB *core,
CoreWindow *window );
void dfb_wm_get_info( CoreWMInfo *info ); void dfb_wm_get_info( CoreWMInfo *info );
DFBResult dfb_wm_post_init ( CoreDFB *core ); DFBResult dfb_wm_post_init ( CoreDFB *core );
DFBResult dfb_wm_init_stack ( CoreWindowStack *stack ); DFBResult dfb_wm_init_stack ( CoreWindowStack *stack );
DFBResult dfb_wm_close_stack ( CoreWindowStack *stack ); DFBResult dfb_wm_close_stack ( CoreWindowStack *stack );
DFBResult dfb_wm_set_active ( CoreWindowStack *stack, DFBResult dfb_wm_set_active ( CoreWindowStack *stack,
bool active ); bool active );
skipping to change at line 374 skipping to change at line 449
DFBResult dfb_wm_set_cursor_position( CoreWindow *window, DFBResult dfb_wm_set_cursor_position( CoreWindow *window,
int x, int x,
int y ); int y );
DFBResult dfb_wm_update_stack ( CoreWindowStack *stack, DFBResult dfb_wm_update_stack ( CoreWindowStack *stack,
const DFBRegion *region, const DFBRegion *region,
DFBSurfaceFlipFlags flags ); DFBSurfaceFlipFlags flags );
DFBResult dfb_wm_update_window ( CoreWindow *window, DFBResult dfb_wm_update_window ( CoreWindow *window,
const DFBRegion *region, const DFBRegion *left_region,
const DFBRegion *right_region,
DFBSurfaceFlipFlags flags ); DFBSurfaceFlipFlags flags );
DFBResult dfb_wm_update_cursor ( CoreWindowStack *stack, DFBResult dfb_wm_update_cursor ( CoreWindowStack *stack,
CoreCursorUpdateFlags flags ); CoreCursorUpdateFlags flags );
#endif #endif
 End of changes. 5 change blocks. 
3 lines changed or deleted 79 lines changed or added


 wm_module.h   wm_module.h 
skipping to change at line 209 skipping to change at line 209
static DFBResult wm_update_stack ( CoreWindowStack *stack, static DFBResult wm_update_stack ( CoreWindowStack *stack,
void *wm_data, void *wm_data,
void *stack_data, void *stack_data,
const DFBRegion *region, const DFBRegion *region,
DFBSurfaceFlipFlags flags ); DFBSurfaceFlipFlags flags );
static DFBResult wm_update_window ( CoreWindow *window, static DFBResult wm_update_window ( CoreWindow *window,
void *wm_data, void *wm_data,
void *window_data, void *window_data,
const DFBRegion *region, const DFBRegion *left_region,
const DFBRegion *right_region,
DFBSurfaceFlipFlags flags ); DFBSurfaceFlipFlags flags );
static DFBResult wm_update_cursor ( CoreWindowStack *stack, static DFBResult wm_update_cursor ( CoreWindowStack *stack,
void *wm_data, void *wm_data,
void *stack_data, void *stack_data,
CoreCursorUpdateFlags flags ); CoreCursorUpdateFlags flags );
static CoreWMFuncs wm_funcs = { static CoreWMFuncs wm_funcs = {
.GetWMInfo = wm_get_info, .GetWMInfo = wm_get_info,
 End of changes. 1 change blocks. 
1 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/