| 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/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/surface_client.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 | | return fusion_call_execute3( &core->shared->call, | |
| , length, ret_ptr, ret_size, ret_length ); | | (FusionCallExecFlags)(dfb_config->call_no | |
| | | direct | flags), | |
| | | call_arg, ptr, length, ret_ptr, ret_size, | |
| | | ret_length ); | |
| } | | } | |
| | | | |
| static __inline__ u32 | | static __inline__ u32 | |
| CoreGraphicsState_GetID( const CoreGraphicsState *state ) | | CoreGraphicsState_GetID( const CoreGraphicsState *state ) | |
| { | | { | |
| return state->object.id; | | return state->object.id; | |
| } | | } | |
| | | | |
| static __inline__ DirectResult | | static __inline__ DirectResult | |
| CoreGraphicsState_Lookup( CoreDFB *core, | | CoreGraphicsState_Lookup( CoreDFB *core, | |
| | | | |
| skipping to change at line 75 | | skipping to change at line 107 | |
| } | | } | |
| | | | |
| static __inline__ DirectResult | | static __inline__ DirectResult | |
| CoreGraphicsState_Unref( CoreGraphicsState *state ) | | CoreGraphicsState_Unref( CoreGraphicsState *state ) | |
| { | | { | |
| return (DirectResult) dfb_graphics_state_unref( state ); | | return (DirectResult) dfb_graphics_state_unref( state ); | |
| } | | } | |
| | | | |
| static __inline__ DirectResult | | static __inline__ DirectResult | |
| CoreGraphicsState_Catch( CoreDFB *core, | | CoreGraphicsState_Catch( CoreDFB *core, | |
|
| u32 object_id, | | void *object_ptr, | |
| CoreGraphicsState **ret_state ) | | CoreGraphicsState **ret_state ) | |
| { | | { | |
|
| DirectResult ret; | | *ret_state = (CoreGraphicsState*) object_ptr; | |
| | | return fusion_object_catch( (FusionObject*) object_ptr ); | |
| 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 | | static __inline__ DirectResult | |
| CoreGraphicsState_Throw( CoreGraphicsState *state, | | CoreGraphicsState_Throw( CoreGraphicsState *state, | |
| FusionID catcher, | | FusionID catcher, | |
| u32 *ret_object_id ) | | u32 *ret_object_id ) | |
| { | | { | |
| *ret_object_id = state->object.id; | | *ret_object_id = state->object.id; | |
| | | | |
| fusion_reactor_add_permissions( state->object.reactor, catcher, | | fusion_reactor_add_permissions( state->object.reactor, catcher, | |
| | | | |
| skipping to change at line 120 | | skipping to change at line 145 | |
| { | | { | |
| return dfb_layer_id( 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, | | 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( CoreLayer *layer ) | |
| { | | { | |
|
| | | 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 | | static __inline__ u32 | |
| CoreLayerContext_GetID( const CoreLayerContext *context ) | | CoreLayerContext_GetID( const CoreLayerContext *context ) | |
| { | | { | |
| return context->object.id; | | return context->object.id; | |
| } | | } | |
| | | | |
| skipping to change at line 194 | | skipping to change at line 229 | |
| } | | } | |
| | | | |
| 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, | |
|
| u32 object_id, | | void *object_ptr, | |
| CoreLayerContext **ret_context ) | | CoreLayerContext **ret_context ) | |
| { | | { | |
|
| DirectResult ret; | | *ret_context = (CoreLayerContext*) object_ptr; | |
| | | return fusion_object_catch( (FusionObject*) object_ptr ); | |
| ret = (DirectResult) dfb_core_get_layer_context( core, object_id, ret_ | | | |
| context ); | | | |
| if (ret) | | | |
| return ret; | | | |
| | | | |
| fusion_ref_catch( &(*ret_context)->object.ref ); | | | |
| | | | |
| 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, | | fusion_reactor_add_permissions( context->object.reactor, catcher, | |
| | | | |
| skipping to change at line 264 | | skipping to change at line 292 | |
| } | | } | |
| | | | |
| 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, | |
|
| u32 object_id, | | void *object_ptr, | |
| CoreLayerRegion **ret_region ) | | CoreLayerRegion **ret_region ) | |
| { | | { | |
|
| DirectResult ret; | | *ret_region = (CoreLayerRegion*) object_ptr; | |
| | | return fusion_object_catch( (FusionObject*) object_ptr ); | |
| ret = (DirectResult) dfb_core_get_layer_region( core, object_id, ret_r | | | |
| egion ); | | | |
| if (ret) | | | |
| return ret; | | | |
| | | | |
| fusion_ref_catch( &(*ret_region)->object.ref ); | | | |
| | | | |
| 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, | | fusion_reactor_add_permissions( region->object.reactor, catcher, | |
| | | | |
| skipping to change at line 331 | | skipping to change at line 352 | |
| } | | } | |
| | | | |
| 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, | |
|
| u32 object_id, | | void *object_ptr, | |
| CorePalette **ret_palette ) | | CorePalette **ret_palette ) | |
| { | | { | |
|
| DirectResult ret; | | *ret_palette = (CorePalette*) object_ptr; | |
| | | return fusion_object_catch( (FusionObject*) object_ptr ); | |
| ret = (DirectResult) dfb_core_get_palette( core, object_id, ret_palett | | | |
| e ); | | | |
| if (ret) | | | |
| return ret; | | | |
| | | | |
| fusion_ref_catch( &(*ret_palette)->object.ref ); | | | |
| | | | |
| 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, | | fusion_reactor_add_permissions( palette->object.reactor, catcher, | |
| | | | |
| skipping to change at line 365 | | skipping to change at line 379 | |
| (FusionRefPermissions)(FUSION_REF_PERMIT_R
EF_UNREF_LOCAL | FUSION_REF_PERMIT_CATCH) ); | | (FusionRefPermissions)(FUSION_REF_PERMIT_R
EF_UNREF_LOCAL | FUSION_REF_PERMIT_CATCH) ); | |
| fusion_call_add_permissions( &palette->call, catcher, FUSION_CALL_PERM
IT_EXECUTE ); | | fusion_call_add_permissions( &palette->call, catcher, FUSION_CALL_PERM
IT_EXECUTE ); | |
| | | | |
| if (!palette->object.owner) | | if (!palette->object.owner) | |
| palette->object.owner = catcher; | | palette->object.owner = catcher; | |
| | | | |
| return fusion_ref_throw( &palette->object.ref, catcher ); | | return fusion_ref_throw( &palette->object.ref, catcher ); | |
| } | | } | |
| | | | |
| static __inline__ u32 | | 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 ) | | CoreSurface_GetID( const CoreSurface *surface ) | |
| { | | { | |
| return surface->object.id; | | 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, | | FusionID caller, | |
| CoreSurface **ret_surface ) | | CoreSurface **ret_surface ) | |
| { | | { | |
| DFBResult ret; | | DFBResult ret; | |
| CoreSurface *surface; | | CoreSurface *surface; | |
| | | | |
| ret = dfb_core_get_surface( core, object_id, &surface ); | | ret = dfb_core_get_surface( core, object_id, &surface ); | |
| if (ret) | | if (ret) | |
| return (DirectResult) ret; | | return (DirectResult) ret; | |
| | | | |
|
| if (surface->object.owner && surface->object.owner != caller) { | | if (caller != FUSION_ID_MASTER && surface->object.identity && surface-
>object.identity != caller) { | |
| dfb_surface_unref( surface ); | | dfb_surface_unref( surface ); | |
| return DR_ACCESSDENIED; | | return DR_ACCESSDENIED; | |
| } | | } | |
| | | | |
| *ret_surface = surface; | | *ret_surface = surface; | |
| | | | |
| return DR_OK; | | 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, | |
|
| u32 object_id, | | void *object_ptr, | |
| CoreSurface **ret_surface ) | | CoreSurface **ret_surface ) | |
| { | | { | |
|
| DirectResult ret; | | *ret_surface = (CoreSurface*) object_ptr; | |
| | | return fusion_object_catch( (FusionObject*) object_ptr ); | |
| ret = (DirectResult) dfb_core_get_surface( core, object_id, ret_surfac | | | |
| e ); | | | |
| if (ret) | | | |
| return ret; | | | |
| | | | |
| fusion_ref_catch( &(*ret_surface)->object.ref ); | | | |
| | | | |
| 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, | | fusion_reactor_add_permissions( surface->object.reactor, catcher, | |
|
| (FusionReactorPermissions)(FUSION_REAC | | (FusionReactorPermissions)(FUSION_REAC | |
| TOR_PERMIT_ATTACH_DETACH) ); | | TOR_PERMIT_ATTACH_DETACH | | |
| | | FUSION_REAC | |
| | | TOR_PERMIT_DISPATCH) ); | |
| fusion_ref_add_permissions( &surface->object.ref, catcher, | | fusion_ref_add_permissions( &surface->object.ref, catcher, | |
| (FusionRefPermissions)(FUSION_REF_PERMIT_R
EF_UNREF_LOCAL | FUSION_REF_PERMIT_CATCH) ); | | (FusionRefPermissions)(FUSION_REF_PERMIT_R
EF_UNREF_LOCAL | FUSION_REF_PERMIT_CATCH) ); | |
| fusion_call_add_permissions( &surface->call, catcher, FUSION_CALL_PERM
IT_EXECUTE ); | | fusion_call_add_permissions( &surface->call, catcher, FUSION_CALL_PERM
IT_EXECUTE ); | |
| | | | |
|
| if (!surface->object.owner) | | if (!surface->object.owner && !(surface->type & CSTF_LAYER) && !(surfa
ce->config.caps & DSCAPS_SHARED)) | |
| surface->object.owner = catcher; | | surface->object.owner = catcher; | |
| | | | |
| return fusion_ref_throw( &surface->object.ref, catcher ); | | return fusion_ref_throw( &surface->object.ref, catcher ); | |
| } | | } | |
| | | | |
| static __inline__ u32 | | static __inline__ u32 | |
|
| | | CoreSurfaceAllocation_GetID( const CoreSurfaceAllocation *allocation ) | |
| | | { | |
| | | return allocation->object.id; | |
| | | } | |
| | | | |
| | | static __inline__ DirectResult | |
| | | CoreSurfaceAllocation_Lookup( CoreDFB *core, | |
| | | u32 object_id, | |
| | | FusionID caller, | |
| | | CoreSurfaceAllocation **ret_allocation ) | |
| | | { | |
| | | DFBResult ret; | |
| | | 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 | |
| | | CoreSurfaceAllocation_Unref( CoreSurfaceAllocation *allocation ) | |
| | | { | |
| | | return (DirectResult) dfb_surface_allocation_unref( allocation ); | |
| | | } | |
| | | | |
| | | static __inline__ DirectResult | |
| | | CoreSurfaceAllocation_Catch( CoreDFB *core, | |
| | | void *object_ptr, | |
| | | CoreSurfaceAllocation **ret_allocation ) | |
| | | { | |
| | | *ret_allocation = (CoreSurfaceAllocation*) object_ptr; | |
| | | return fusion_object_catch( (FusionObject*) object_ptr ); | |
| | | } | |
| | | | |
| | | static __inline__ DirectResult | |
| | | CoreSurfaceAllocation_Throw( CoreSurfaceAllocation *allocation, | |
| | | FusionID catcher, | |
| | | u32 *ret_object_id ) | |
| | | { | |
| | | *ret_object_id = allocation->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 | |
| | | CoreSurfaceBuffer_GetID( const CoreSurfaceBuffer *buffer ) | |
| | | { | |
| | | return buffer->object.id; | |
| | | } | |
| | | | |
| | | static __inline__ DirectResult | |
| | | CoreSurfaceBuffer_Lookup( CoreDFB *core, | |
| | | 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) { | |
| | | dfb_surface_buffer_unref( buffer ); | |
| | | return DR_ACCESSDENIED; | |
| | | } | |
| | | | |
| | | *ret_buffer = buffer; | |
| | | | |
| | | return DR_OK; | |
| | | } | |
| | | | |
| | | static __inline__ DirectResult | |
| | | CoreSurfaceBuffer_Unref( CoreSurfaceBuffer *buffer ) | |
| | | { | |
| | | return (DirectResult) dfb_surface_buffer_unref( buffer ); | |
| | | } | |
| | | | |
| | | static __inline__ DirectResult | |
| | | CoreSurfaceBuffer_Catch( CoreDFB *core, | |
| | | void *object_ptr, | |
| | | CoreSurfaceBuffer **ret_buffer ) | |
| | | { | |
| | | *ret_buffer = (CoreSurfaceBuffer*) object_ptr; | |
| | | return fusion_object_catch( (FusionObject*) object_ptr ); | |
| | | } | |
| | | | |
| | | static __inline__ DirectResult | |
| | | CoreSurfaceBuffer_Throw( CoreSurfaceBuffer *buffer, | |
| | | FusionID catcher, | |
| | | u32 *ret_object_id ) | |
| | | { | |
| | | *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 | |
| | | CoreSurfaceClient_GetID( const CoreSurfaceClient *client ) | |
| | | { | |
| | | return client->object.id; | |
| | | } | |
| | | | |
| | | static __inline__ DirectResult | |
| | | CoreSurfaceClient_Lookup( CoreDFB *core, | |
| | | u32 object_id, | |
| | | FusionID caller, | |
| | | CoreSurfaceClient **ret_client ) | |
| | | { | |
| | | DFBResult ret; | |
| | | CoreSurfaceClient *client; | |
| | | | |
| | | ret = dfb_core_get_surface_client( core, object_id, &client ); | |
| | | if (ret) | |
| | | return (DirectResult) ret; | |
| | | | |
| | | if (client->object.owner && client->object.owner != caller) { | |
| | | dfb_surface_client_unref( client ); | |
| | | return DR_ACCESSDENIED; | |
| | | } | |
| | | | |
| | | *ret_client = client; | |
| | | | |
| | | return DR_OK; | |
| | | } | |
| | | | |
| | | static __inline__ DirectResult | |
| | | CoreSurfaceClient_Unref( CoreSurfaceClient *client ) | |
| | | { | |
| | | return (DirectResult) dfb_surface_client_unref( client ); | |
| | | } | |
| | | | |
| | | static __inline__ DirectResult | |
| | | CoreSurfaceClient_Catch( CoreDFB *core, | |
| | | void *object_ptr, | |
| | | CoreSurfaceClient **ret_client ) | |
| | | { | |
| | | *ret_client = (CoreSurfaceClient*) object_ptr; | |
| | | return fusion_object_catch( (FusionObject*) object_ptr ); | |
| | | } | |
| | | | |
| | | static __inline__ DirectResult | |
| | | CoreSurfaceClient_Throw( CoreSurfaceClient *client, | |
| | | FusionID catcher, | |
| | | u32 *ret_object_id ) | |
| | | { | |
| | | *ret_object_id = client->object.id; | |
| | | | |
| | | fusion_reactor_add_permissions( client->object.reactor, catcher, | |
| | | (FusionReactorPermissions)(FUSION_REAC | |
| | | TOR_PERMIT_ATTACH_DETACH) ); | |
| | | fusion_ref_add_permissions( &client->object.ref, catcher, | |
| | | (FusionRefPermissions)(FUSION_REF_PERMIT_R | |
| | | EF_UNREF_LOCAL | FUSION_REF_PERMIT_CATCH) ); | |
| | | fusion_call_add_permissions( &client->call, catcher, FUSION_CALL_PERMI | |
| | | T_EXECUTE ); | |
| | | | |
| | | if (!client->object.owner) | |
| | | client->object.owner = catcher; | |
| | | | |
| | | return fusion_ref_throw( &client->object.ref, catcher ); | |
| | | } | |
| | | | |
| | | static __inline__ u32 | |
| CoreWindow_GetID( const CoreWindow *window ) | | CoreWindow_GetID( const CoreWindow *window ) | |
| { | | { | |
| return window->object.id; | | return window->object.id; | |
| } | | } | |
| | | | |
| static __inline__ DirectResult | | static __inline__ DirectResult | |
| CoreWindow_Lookup( CoreDFB *core, | | CoreWindow_Lookup( CoreDFB *core, | |
| u32 object_id, | | u32 object_id, | |
| FusionID caller, | | FusionID caller, | |
| CoreWindow **ret_window ) | | CoreWindow **ret_window ) | |
| | | | |
| skipping to change at line 471 | | skipping to change at line 728 | |
| } | | } | |
| | | | |
| static __inline__ DirectResult | | static __inline__ DirectResult | |
| CoreWindow_Unref( CoreWindow *window ) | | CoreWindow_Unref( CoreWindow *window ) | |
| { | | { | |
| return (DirectResult) dfb_window_unref( window ); | | return (DirectResult) dfb_window_unref( window ); | |
| } | | } | |
| | | | |
| static __inline__ DirectResult | | static __inline__ DirectResult | |
| CoreWindow_Catch( CoreDFB *core, | | CoreWindow_Catch( CoreDFB *core, | |
|
| u32 object_id, | | void *object_ptr, | |
| CoreWindow **ret_window ) | | CoreWindow **ret_window ) | |
| { | | { | |
|
| DirectResult ret; | | *ret_window = (CoreWindow*) object_ptr; | |
| | | return fusion_object_catch( (FusionObject*) object_ptr ); | |
| 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; | | | |
| } | | } | |
| | | | |
| static __inline__ DirectResult | | static __inline__ DirectResult | |
| CoreWindow_Throw( CoreWindow *window, | | CoreWindow_Throw( CoreWindow *window, | |
| FusionID catcher, | | FusionID catcher, | |
| u32 *ret_object_id ) | | u32 *ret_object_id ) | |
| { | | { | |
| *ret_object_id = window->object.id; | | *ret_object_id = window->object.id; | |
| | | | |
| fusion_reactor_add_permissions( window->object.reactor, catcher, | | fusion_reactor_add_permissions( window->object.reactor, catcher, | |
| | | | |
End of changes. 26 change blocks. |
| 73 lines changed or deleted | | 329 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 "CoreGraphicsState_includes.h" | | #include <core/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 114 | | skipping to change at line 119 | |
| DFBSurfaceRenderOptions options); | | DFBSurfaceRenderOptions options); | |
| | | | |
| DFBResult CoreGraphicsState_SetMatrix( | | DFBResult CoreGraphicsState_SetMatrix( | |
| CoreGraphicsState *obj, | | CoreGraphicsState *obj, | |
| const s32 *values); | | const s32 *values); | |
| | | | |
| DFBResult CoreGraphicsState_SetSource2( | | DFBResult CoreGraphicsState_SetSource2( | |
| CoreGraphicsState *obj, | | CoreGraphicsState *obj, | |
| CoreSurface *surface); | | CoreSurface *surface); | |
| | | | |
|
| | | DFBResult CoreGraphicsState_SetFrom( | |
| | | CoreGraphicsState *obj, | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye); | |
| | | | |
| | | DFBResult CoreGraphicsState_SetTo( | |
| | | CoreGraphicsState *obj, | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye); | |
| | | | |
| DFBResult CoreGraphicsState_DrawRectangles( | | DFBResult CoreGraphicsState_DrawRectangles( | |
| CoreGraphicsState *obj, | | CoreGraphicsState *obj, | |
| const DFBRectangle *rects, | | const DFBRectangle *rects, | |
| u32 num); | | u32 num); | |
| | | | |
| DFBResult CoreGraphicsState_DrawLines( | | DFBResult CoreGraphicsState_DrawLines( | |
| CoreGraphicsState *obj, | | CoreGraphicsState *obj, | |
| const DFBRegion *lines, | | const DFBRegion *lines, | |
| u32 num); | | u32 num); | |
| | | | |
| | | | |
| skipping to change at line 177 | | skipping to change at line 192 | |
| 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); | |
| | | | |
|
| void *CoreGraphicsState_Init_Dispatch( | | DFBResult CoreGraphicsState_Flush( | |
| | | CoreGraphicsState *obj | |
| | | ); | |
| | | | |
| | | DFBResult CoreGraphicsState_ReleaseSource( | |
| | | 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( | |
|
| void *dispatch | | FusionCall *call | |
| ); | | ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| | | | |
| namespace DirectFB { | | 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_SetSrcBlend = 5, | | CoreGraphicsState_SetColorAndIndex = 5, | |
| CoreGraphicsState_SetDstBlend = 6, | | CoreGraphicsState_SetSrcBlend = 6, | |
| CoreGraphicsState_SetSrcColorKey = 7, | | CoreGraphicsState_SetDstBlend = 7, | |
| CoreGraphicsState_SetDstColorKey = 8, | | CoreGraphicsState_SetSrcColorKey = 8, | |
| CoreGraphicsState_SetDestination = 9, | | CoreGraphicsState_SetDstColorKey = 9, | |
| CoreGraphicsState_SetSource = 10, | | CoreGraphicsState_SetDestination = 10, | |
| CoreGraphicsState_SetSourceMask = 11, | | CoreGraphicsState_SetSource = 11, | |
| CoreGraphicsState_SetSourceMaskVals = 12, | | CoreGraphicsState_SetSourceMask = 12, | |
| CoreGraphicsState_SetIndexTranslation = 13, | | CoreGraphicsState_SetSourceMaskVals = 13, | |
| CoreGraphicsState_SetColorKey = 14, | | CoreGraphicsState_SetIndexTranslation = 14, | |
| CoreGraphicsState_SetRenderOptions = 15, | | CoreGraphicsState_SetColorKey = 15, | |
| CoreGraphicsState_SetMatrix = 16, | | CoreGraphicsState_SetRenderOptions = 16, | |
| CoreGraphicsState_SetSource2 = 17, | | CoreGraphicsState_SetMatrix = 17, | |
| CoreGraphicsState_DrawRectangles = 18, | | CoreGraphicsState_SetSource2 = 18, | |
| CoreGraphicsState_DrawLines = 19, | | CoreGraphicsState_SetFrom = 19, | |
| CoreGraphicsState_FillRectangles = 20, | | CoreGraphicsState_SetTo = 20, | |
| CoreGraphicsState_FillTriangles = 21, | | CoreGraphicsState_DrawRectangles = 21, | |
| CoreGraphicsState_FillTrapezoids = 22, | | CoreGraphicsState_DrawLines = 22, | |
| CoreGraphicsState_FillSpans = 23, | | CoreGraphicsState_FillRectangles = 23, | |
| CoreGraphicsState_Blit = 24, | | CoreGraphicsState_FillTriangles = 24, | |
| CoreGraphicsState_Blit2 = 25, | | CoreGraphicsState_FillTrapezoids = 25, | |
| CoreGraphicsState_StretchBlit = 26, | | CoreGraphicsState_FillSpans = 26, | |
| CoreGraphicsState_TileBlit = 27, | | CoreGraphicsState_Blit = 27, | |
| CoreGraphicsState_TextureTriangles = 28, | | CoreGraphicsState_Blit2 = 28, | |
| | | CoreGraphicsState_StretchBlit = 29, | |
| | | CoreGraphicsState_TileBlit = 30, | |
| | | CoreGraphicsState_TextureTriangles = 31, | |
| | | CoreGraphicsState_Flush = 32, | |
| | | CoreGraphicsState_ReleaseSource = 33, | |
| } 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 271 | | skipping to change at line 299 | |
| */ | | */ | |
| 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 416 | | skipping to change at line 456 | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| u32 surface_id; | | u32 surface_id; | |
| } CoreGraphicsStateSetSource2; | | } CoreGraphicsStateSetSource2; | |
| | | | |
| typedef struct { | | typedef struct { | |
| DFBResult result; | | DFBResult result; | |
| } CoreGraphicsStateSetSource2Return; | | } CoreGraphicsStateSetSource2Return; | |
| | | | |
| /* | | /* | |
|
| | | * CoreGraphicsState_SetFrom | |
| | | */ | |
| | | typedef struct { | |
| | | CoreSurfaceBufferRole role; | |
| | | DFBSurfaceStereoEye eye; | |
| | | } CoreGraphicsStateSetFrom; | |
| | | | |
| | | typedef struct { | |
| | | DFBResult result; | |
| | | } CoreGraphicsStateSetFromReturn; | |
| | | | |
| | | /* | |
| | | * CoreGraphicsState_SetTo | |
| | | */ | |
| | | typedef struct { | |
| | | CoreSurfaceBufferRole role; | |
| | | DFBSurfaceStereoEye eye; | |
| | | } CoreGraphicsStateSetTo; | |
| | | | |
| | | typedef struct { | |
| | | DFBResult result; | |
| | | } CoreGraphicsStateSetToReturn; | |
| | | | |
| | | /* | |
| * CoreGraphicsState_DrawRectangles | | * CoreGraphicsState_DrawRectangles | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| u32 num; | | u32 num; | |
| /* 'num' DFBRectangle follow (rects) */ | | /* 'num' DFBRectangle follow (rects) */ | |
| } CoreGraphicsStateDrawRectangles; | | } CoreGraphicsStateDrawRectangles; | |
| | | | |
| typedef struct { | | typedef struct { | |
| DFBResult result; | | DFBResult result; | |
| } CoreGraphicsStateDrawRectanglesReturn; | | } CoreGraphicsStateDrawRectanglesReturn; | |
| | | | |
| skipping to change at line 555 | | skipping to change at line 619 | |
| 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; | |
| | | | |
|
| | | /* | |
| | | * CoreGraphicsState_Flush | |
| | | */ | |
| | | typedef struct { | |
| | | } CoreGraphicsStateFlush; | |
| | | | |
| | | typedef struct { | |
| | | DFBResult result; | |
| | | } CoreGraphicsStateFlushReturn; | |
| | | | |
| | | /* | |
| | | * CoreGraphicsState_ReleaseSource | |
| | | */ | |
| | | typedef struct { | |
| | | } CoreGraphicsStateReleaseSource; | |
| | | | |
| | | typedef struct { | |
| | | DFBResult result; | |
| | | } CoreGraphicsStateReleaseSourceReturn; | |
| | | | |
| class IGraphicsState : public Interface | | class IGraphicsState : public Interface | |
| { | | { | |
| public: | | public: | |
| IGraphicsState( CoreDFB *core ) | | IGraphicsState( CoreDFB *core ) | |
| : | | : | |
| Interface( core ) | | Interface( core ) | |
| { | | { | |
| } | | } | |
| | | | |
| public: | | public: | |
| | | | |
| skipping to change at line 581 | | skipping to change at line 665 | |
| ) = 0; | | ) = 0; | |
| | | | |
| virtual DFBResult SetClip( | | virtual DFBResult SetClip( | |
| const DFBRegion *region | | const DFBRegion *region | |
| ) = 0; | | ) = 0; | |
| | | | |
| virtual DFBResult SetColor( | | virtual DFBResult SetColor( | |
| const DFBColor *color | | const DFBColor *color | |
| ) = 0; | | ) = 0; | |
| | | | |
|
| | | virtual DFBResult SetColorAndIndex( | |
| | | const DFBColor *color, | |
| | | u32 index | |
| | | ) = 0; | |
| | | | |
| virtual DFBResult SetSrcBlend( | | virtual DFBResult SetSrcBlend( | |
| DFBSurfaceBlendFunction function | | DFBSurfaceBlendFunction function | |
| ) = 0; | | ) = 0; | |
| | | | |
| virtual DFBResult SetDstBlend( | | virtual DFBResult SetDstBlend( | |
| DFBSurfaceBlendFunction function | | DFBSurfaceBlendFunction function | |
| ) = 0; | | ) = 0; | |
| | | | |
| virtual DFBResult SetSrcColorKey( | | virtual DFBResult SetSrcColorKey( | |
| u32 key | | u32 key | |
| | | | |
| skipping to change at line 635 | | skipping to change at line 724 | |
| ) = 0; | | ) = 0; | |
| | | | |
| virtual DFBResult SetMatrix( | | virtual DFBResult SetMatrix( | |
| const s32 *values | | const s32 *values | |
| ) = 0; | | ) = 0; | |
| | | | |
| virtual DFBResult SetSource2( | | virtual DFBResult SetSource2( | |
| CoreSurface *surface | | CoreSurface *surface | |
| ) = 0; | | ) = 0; | |
| | | | |
|
| | | virtual DFBResult SetFrom( | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetTo( | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye | |
| | | ) = 0; | |
| | | | |
| virtual DFBResult DrawRectangles( | | virtual DFBResult DrawRectangles( | |
| const DFBRectangle *rects, | | const DFBRectangle *rects, | |
| u32 num | | u32 num | |
| ) = 0; | | ) = 0; | |
| | | | |
| virtual DFBResult DrawLines( | | virtual DFBResult DrawLines( | |
| const DFBRegion *lines, | | const DFBRegion *lines, | |
| u32 num | | u32 num | |
| ) = 0; | | ) = 0; | |
| | | | |
| | | | |
| skipping to change at line 698 | | skipping to change at line 797 | |
| const DFBPoint *points2, | | const DFBPoint *points2, | |
| u32 num | | u32 num | |
| ) = 0; | | ) = 0; | |
| | | | |
| virtual DFBResult TextureTriangles( | | virtual DFBResult TextureTriangles( | |
| const DFBVertex *vertices, | | const DFBVertex *vertices, | |
| u32 num, | | u32 num, | |
| DFBTriangleFormation formation | | DFBTriangleFormation formation | |
| ) = 0; | | ) = 0; | |
| | | | |
|
| | | virtual DFBResult Flush( | |
| | | | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult ReleaseSource( | |
| | | | |
| | | ) = 0; | |
| | | | |
| }; | | }; | |
| | | | |
| class IGraphicsState_Real : public IGraphicsState | | class IGraphicsState_Real : public IGraphicsState | |
| { | | { | |
| private: | | private: | |
| CoreGraphicsState *obj; | | CoreGraphicsState *obj; | |
| | | | |
| public: | | public: | |
| IGraphicsState_Real( CoreDFB *core, CoreGraphicsState *obj ) | | IGraphicsState_Real( CoreDFB *core, CoreGraphicsState *obj ) | |
| : | | : | |
| | | | |
| skipping to change at line 730 | | skipping to change at line 837 | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetClip( | | virtual DFBResult SetClip( | |
| const DFBRegion *region | | const DFBRegion *region | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetColor( | | virtual DFBResult SetColor( | |
| const DFBColor *color | | const DFBColor *color | |
| ); | | ); | |
| | | | |
|
| | | virtual DFBResult SetColorAndIndex( | |
| | | const DFBColor *color, | |
| | | u32 index | |
| | | ); | |
| | | | |
| virtual DFBResult SetSrcBlend( | | virtual DFBResult SetSrcBlend( | |
| DFBSurfaceBlendFunction function | | DFBSurfaceBlendFunction function | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetDstBlend( | | virtual DFBResult SetDstBlend( | |
| DFBSurfaceBlendFunction function | | DFBSurfaceBlendFunction function | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetSrcColorKey( | | virtual DFBResult SetSrcColorKey( | |
| u32 key | | u32 key | |
| | | | |
| skipping to change at line 784 | | skipping to change at line 896 | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetMatrix( | | virtual DFBResult SetMatrix( | |
| const s32 *values | | const s32 *values | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetSource2( | | virtual DFBResult SetSource2( | |
| CoreSurface *surface | | CoreSurface *surface | |
| ); | | ); | |
| | | | |
|
| | | virtual DFBResult SetFrom( | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetTo( | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye | |
| | | ); | |
| | | | |
| virtual DFBResult DrawRectangles( | | virtual DFBResult DrawRectangles( | |
| const DFBRectangle *rects, | | const DFBRectangle *rects, | |
| u32 num | | u32 num | |
| ); | | ); | |
| | | | |
| virtual DFBResult DrawLines( | | virtual DFBResult DrawLines( | |
| const DFBRegion *lines, | | const DFBRegion *lines, | |
| u32 num | | u32 num | |
| ); | | ); | |
| | | | |
| | | | |
| skipping to change at line 847 | | skipping to change at line 969 | |
| const DFBPoint *points2, | | const DFBPoint *points2, | |
| u32 num | | u32 num | |
| ); | | ); | |
| | | | |
| virtual DFBResult TextureTriangles( | | virtual DFBResult TextureTriangles( | |
| const DFBVertex *vertices, | | const DFBVertex *vertices, | |
| u32 num, | | u32 num, | |
| DFBTriangleFormation formation | | DFBTriangleFormation formation | |
| ); | | ); | |
| | | | |
|
| | | virtual DFBResult Flush( | |
| | | | |
| | | ); | |
| | | | |
| | | virtual DFBResult ReleaseSource( | |
| | | | |
| | | ); | |
| | | | |
| }; | | }; | |
| | | | |
| class IGraphicsState_Requestor : public IGraphicsState | | class IGraphicsState_Requestor : public IGraphicsState | |
| { | | { | |
| private: | | private: | |
| CoreGraphicsState *obj; | | CoreGraphicsState *obj; | |
| | | | |
| public: | | public: | |
| IGraphicsState_Requestor( CoreDFB *core, CoreGraphicsState *obj ) | | IGraphicsState_Requestor( CoreDFB *core, CoreGraphicsState *obj ) | |
| : | | : | |
| | | | |
| skipping to change at line 879 | | skipping to change at line 1009 | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetClip( | | virtual DFBResult SetClip( | |
| const DFBRegion *region | | const DFBRegion *region | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetColor( | | virtual DFBResult SetColor( | |
| const DFBColor *color | | const DFBColor *color | |
| ); | | ); | |
| | | | |
|
| | | virtual DFBResult SetColorAndIndex( | |
| | | const DFBColor *color, | |
| | | u32 index | |
| | | ); | |
| | | | |
| virtual DFBResult SetSrcBlend( | | virtual DFBResult SetSrcBlend( | |
| DFBSurfaceBlendFunction function | | DFBSurfaceBlendFunction function | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetDstBlend( | | virtual DFBResult SetDstBlend( | |
| DFBSurfaceBlendFunction function | | DFBSurfaceBlendFunction function | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetSrcColorKey( | | virtual DFBResult SetSrcColorKey( | |
| u32 key | | u32 key | |
| | | | |
| skipping to change at line 933 | | skipping to change at line 1068 | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetMatrix( | | virtual DFBResult SetMatrix( | |
| const s32 *values | | const s32 *values | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetSource2( | | virtual DFBResult SetSource2( | |
| CoreSurface *surface | | CoreSurface *surface | |
| ); | | ); | |
| | | | |
|
| | | virtual DFBResult SetFrom( | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetTo( | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye | |
| | | ); | |
| | | | |
| virtual DFBResult DrawRectangles( | | virtual DFBResult DrawRectangles( | |
| const DFBRectangle *rects, | | const DFBRectangle *rects, | |
| u32 num | | u32 num | |
| ); | | ); | |
| | | | |
| virtual DFBResult DrawLines( | | virtual DFBResult DrawLines( | |
| const DFBRegion *lines, | | const DFBRegion *lines, | |
| u32 num | | u32 num | |
| ); | | ); | |
| | | | |
| | | | |
| skipping to change at line 996 | | skipping to change at line 1141 | |
| const DFBPoint *points2, | | const DFBPoint *points2, | |
| u32 num | | u32 num | |
| ); | | ); | |
| | | | |
| virtual DFBResult TextureTriangles( | | virtual DFBResult TextureTriangles( | |
| const DFBVertex *vertices, | | const DFBVertex *vertices, | |
| u32 num, | | u32 num, | |
| DFBTriangleFormation formation | | DFBTriangleFormation formation | |
| ); | | ); | |
| | | | |
|
| }; | | virtual DFBResult Flush( | |
| | | | |
|
| class CoreGraphicsStateDispatch | | ); | |
| { | | | |
| | | | |
|
| public: | | virtual DFBResult ReleaseSource( | |
| CoreGraphicsStateDispatch( CoreDFB *core, IGraphicsState *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; | | | |
| IGraphicsState *real; | | | |
| }; | | }; | |
| | | | |
|
| | | DFBResult CoreGraphicsStateDispatch__Dispatch( CoreGraphicsState *obj, | |
| | | FusionID caller, | |
| | | int method, | |
| | | void *ptr, | |
| | | unsigned int length, | |
| | | void *ret_ptr, | |
| | | unsigned int ret_size, | |
| | | unsigned int *ret_length ); | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 23 change blocks. |
| 47 lines changed or deleted | | 185 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 "CoreLayerContext_includes.h" | | #include <core/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_SetStereoDepth( | |
| | | CoreLayerContext *obj, | |
| | | bool follow_video | |
| | | , | |
| | | s32 z); | |
| | | | |
| | | 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_SetConfiguration( | | DFBResult CoreLayerContext_FindWindow( | |
| CoreLayerContext *obj, | | CoreLayerContext *obj, | |
|
| const DFBDisplayLayerConfig *config); | | DFBWindowID window_id, | |
| | | CoreWindow **ret_window); | |
| | | | |
|
| DFBResult CoreLayerContext_GetPrimaryRegion( | | DFBResult CoreLayerContext_FindWindowByResourceID( | |
| CoreLayerContext *obj, | | CoreLayerContext *obj, | |
|
| bool create, | | u64 resource_id, | |
| CoreLayerRegion **ret_region); | | CoreWindow **ret_window); | |
| | | | |
|
| 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( | |
|
| void *dispatch | | FusionCall *call | |
| ); | | ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| | | | |
| namespace DirectFB { | | namespace DirectFB { | |
| | | | |
| /* | | /* | |
| * CoreLayerContext Calls | | * CoreLayerContext Calls | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
|
| CoreLayerContext_CreateWindow = 1, | | CoreLayerContext_GetPrimaryRegion = 1, | |
| CoreLayerContext_SetConfiguration = 2, | | CoreLayerContext_TestConfiguration = 2, | |
| CoreLayerContext_GetPrimaryRegion = 3, | | CoreLayerContext_SetConfiguration = 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_SetStereoDepth = 13, | |
| | | CoreLayerContext_SetFieldParity = 14, | |
| | | CoreLayerContext_SetClipRegions = 15, | |
| | | CoreLayerContext_CreateWindow = 16, | |
| | | CoreLayerContext_FindWindow = 17, | |
| | | CoreLayerContext_FindWindowByResourceID = 18, | |
| } CoreLayerContextCall; | | } CoreLayerContextCall; | |
| | | | |
| /* | | /* | |
|
| | | * CoreLayerContext_GetPrimaryRegion | |
| | | */ | |
| | | typedef struct { | |
| | | bool create; | |
| | | } CoreLayerContextGetPrimaryRegion; | |
| | | | |
| | | typedef struct { | |
| | | DFBResult result; | |
| | | u32 region_id; | |
| | | void* region_ptr; | |
| | | } 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_SetStereoDepth | |
| | | */ | |
| | | typedef struct { | |
| | | bool follow_video; | |
| | | s32 z; | |
| | | } CoreLayerContextSetStereoDepth; | |
| | | | |
| | | typedef struct { | |
| | | DFBResult result; | |
| | | } CoreLayerContextSetStereoDepthReturn; | |
| | | | |
| | | /* | |
| | | * 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; | |
|
| | | void* window_ptr; | |
| } CoreLayerContextCreateWindowReturn; | | } CoreLayerContextCreateWindowReturn; | |
| | | | |
| /* | | /* | |
|
| * CoreLayerContext_SetConfiguration | | * CoreLayerContext_FindWindow | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
|
| DFBDisplayLayerConfig config; | | DFBWindowID window_id; | |
| } CoreLayerContextSetConfiguration; | | } CoreLayerContextFindWindow; | |
| | | | |
| typedef struct { | | typedef struct { | |
| DFBResult result; | | DFBResult result; | |
|
| } CoreLayerContextSetConfigurationReturn; | | u32 window_id; | |
| | | void* window_ptr; | |
| | | } CoreLayerContextFindWindowReturn; | |
| | | | |
| /* | | /* | |
|
| * CoreLayerContext_GetPrimaryRegion | | * CoreLayerContext_FindWindowByResourceID | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
|
| bool create; | | u64 resource_id; | |
| } CoreLayerContextGetPrimaryRegion; | | } CoreLayerContextFindWindowByResourceID; | |
| | | | |
| typedef struct { | | typedef struct { | |
| DFBResult result; | | DFBResult result; | |
|
| u32 region_id; | | u32 window_id; | |
| } CoreLayerContextGetPrimaryRegionReturn; | | void* window_ptr; | |
| | | } CoreLayerContextFindWindowByResourceIDReturn; | |
| | | | |
| class ILayerContext : public Interface | | class ILayerContext : public Interface | |
| { | | { | |
| public: | | public: | |
| ILayerContext( CoreDFB *core ) | | ILayerContext( CoreDFB *core ) | |
| : | | : | |
| Interface( core ) | | Interface( core ) | |
| { | | { | |
| } | | } | |
| | | | |
| public: | | public: | |
|
| | | virtual DFBResult GetPrimaryRegion( | |
| | | bool create, | |
| | | CoreLayerRegion **ret_region | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult TestConfiguration( | |
| | | const DFBDisplayLayerConfig *config, | |
| | | DFBDisplayLayerConfigFlags *ret_failed | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetConfiguration( | |
| | | const DFBDisplayLayerConfig *config | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetSrcColorKey( | |
| | | const DFBColorKey *key | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetDstColorKey( | |
| | | const DFBColorKey *key | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetSourceRectangle( | |
| | | const DFBRectangle *rectangle | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetScreenLocation( | |
| | | const DFBLocation *location | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetScreenRectangle( | |
| | | const DFBRectangle *rectangle | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetScreenPosition( | |
| | | const DFBPoint *position | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetOpacity( | |
| | | u8 opacity | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetRotation( | |
| | | s32 rotation | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetColorAdjustment( | |
| | | const DFBColorAdjustment *adjustment | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetStereoDepth( | |
| | | bool follow_video | |
| | | , | |
| | | s32 z | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetFieldParity( | |
| | | u32 field | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetClipRegions( | |
| | | const DFBRegion *regions, | |
| | | u32 num, | |
| | | bool positive | |
| | | ) = 0; | |
| | | | |
| virtual DFBResult CreateWindow( | | virtual DFBResult CreateWindow( | |
| const DFBWindowDescription *description, | | const DFBWindowDescription *description, | |
|
| CoreWindow *parent, | | | |
| CoreWindow *toplevel, | | | |
| CoreWindow **ret_window | | CoreWindow **ret_window | |
| ) = 0; | | ) = 0; | |
| | | | |
|
| virtual DFBResult SetConfiguration( | | virtual DFBResult FindWindow( | |
| const DFBDisplayLayerConfig *config | | DFBWindowID window_id, | |
| | | CoreWindow **ret_window | |
| ) = 0; | | ) = 0; | |
| | | | |
|
| virtual DFBResult GetPrimaryRegion( | | virtual DFBResult FindWindowByResourceID( | |
| bool create, | | u64 resource_id, | |
| CoreLayerRegion **ret_region | | CoreWindow **ret_window | |
| ) = 0; | | ) = 0; | |
| | | | |
| }; | | }; | |
| | | | |
| class ILayerContext_Real : public ILayerContext | | class ILayerContext_Real : public ILayerContext | |
| { | | { | |
| private: | | private: | |
| CoreLayerContext *obj; | | CoreLayerContext *obj; | |
| | | | |
| public: | | public: | |
| ILayerContext_Real( CoreDFB *core, CoreLayerContext *obj ) | | ILayerContext_Real( CoreDFB *core, CoreLayerContext *obj ) | |
| : | | : | |
| ILayerContext( core ), | | ILayerContext( core ), | |
| obj( obj ) | | obj( obj ) | |
| { | | { | |
| } | | } | |
| | | | |
| public: | | public: | |
|
| | | virtual DFBResult GetPrimaryRegion( | |
| | | bool create, | |
| | | CoreLayerRegion **ret_region | |
| | | ); | |
| | | | |
| | | virtual DFBResult TestConfiguration( | |
| | | const DFBDisplayLayerConfig *config, | |
| | | DFBDisplayLayerConfigFlags *ret_failed | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetConfiguration( | |
| | | const DFBDisplayLayerConfig *config | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetSrcColorKey( | |
| | | const DFBColorKey *key | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetDstColorKey( | |
| | | const DFBColorKey *key | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetSourceRectangle( | |
| | | const DFBRectangle *rectangle | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetScreenLocation( | |
| | | const DFBLocation *location | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetScreenRectangle( | |
| | | const DFBRectangle *rectangle | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetScreenPosition( | |
| | | const DFBPoint *position | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetOpacity( | |
| | | u8 opacity | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetRotation( | |
| | | s32 rotation | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetColorAdjustment( | |
| | | const DFBColorAdjustment *adjustment | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetStereoDepth( | |
| | | bool follow_video | |
| | | , | |
| | | s32 z | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetFieldParity( | |
| | | u32 field | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetClipRegions( | |
| | | const DFBRegion *regions, | |
| | | u32 num, | |
| | | bool positive | |
| | | ); | |
| | | | |
| virtual DFBResult CreateWindow( | | virtual DFBResult CreateWindow( | |
| const DFBWindowDescription *description, | | const DFBWindowDescription *description, | |
|
| CoreWindow *parent, | | | |
| CoreWindow *toplevel, | | | |
| CoreWindow **ret_window | | CoreWindow **ret_window | |
| ); | | ); | |
| | | | |
|
| virtual DFBResult SetConfiguration( | | virtual DFBResult FindWindow( | |
| const DFBDisplayLayerConfig *config | | DFBWindowID window_id, | |
| | | CoreWindow **ret_window | |
| ); | | ); | |
| | | | |
|
| virtual DFBResult GetPrimaryRegion( | | virtual DFBResult FindWindowByResourceID( | |
| bool create, | | u64 resource_id, | |
| CoreLayerRegion **ret_region | | CoreWindow **ret_window | |
| ); | | ); | |
| | | | |
| }; | | }; | |
| | | | |
| class ILayerContext_Requestor : public ILayerContext | | class ILayerContext_Requestor : public ILayerContext | |
| { | | { | |
| private: | | private: | |
| CoreLayerContext *obj; | | CoreLayerContext *obj; | |
| | | | |
| public: | | public: | |
| ILayerContext_Requestor( CoreDFB *core, CoreLayerContext *obj ) | | ILayerContext_Requestor( CoreDFB *core, CoreLayerContext *obj ) | |
| : | | : | |
| ILayerContext( core ), | | ILayerContext( core ), | |
| obj( obj ) | | obj( obj ) | |
| { | | { | |
| } | | } | |
| | | | |
| public: | | public: | |
|
| virtual DFBResult CreateWindow( | | virtual DFBResult GetPrimaryRegion( | |
| const DFBWindowDescription *description, | | bool create, | |
| CoreWindow *parent, | | CoreLayerRegion **ret_region | |
| CoreWindow *toplevel, | | ); | |
| CoreWindow **ret_window | | | |
| | | virtual DFBResult TestConfiguration( | |
| | | const DFBDisplayLayerConfig *config, | |
| | | DFBDisplayLayerConfigFlags *ret_failed | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetConfiguration( | | virtual DFBResult SetConfiguration( | |
| const DFBDisplayLayerConfig *config | | const DFBDisplayLayerConfig *config | |
| ); | | ); | |
| | | | |
|
| virtual DFBResult GetPrimaryRegion( | | virtual DFBResult SetSrcColorKey( | |
| bool create, | | const DFBColorKey *key | |
| CoreLayerRegion **ret_region | | | |
| ); | | ); | |
| | | | |
|
| }; | | virtual DFBResult SetDstColorKey( | |
| | | const DFBColorKey *key | |
| | | ); | |
| | | | |
|
| class CoreLayerContextDispatch | | virtual DFBResult SetSourceRectangle( | |
| { | | const DFBRectangle *rectangle | |
| | | ); | |
| | | | |
|
| public: | | virtual DFBResult SetScreenLocation( | |
| CoreLayerContextDispatch( CoreDFB *core, ILayerContext *real ) | | const DFBLocation *location | |
| : | | ); | |
| core( core ), | | | |
| real( real ) | | | |
| { | | | |
| } | | | |
| | | | |
|
| virtual DFBResult Dispatch( FusionID caller, | | virtual DFBResult SetScreenRectangle( | |
| int method, | | const DFBRectangle *rectangle | |
| void *ptr, | | ); | |
| unsigned int length, | | | |
| void *ret_ptr, | | virtual DFBResult SetScreenPosition( | |
| unsigned int ret_size, | | const DFBPoint *position | |
| unsigned int *ret_length ); | | ); | |
| | | | |
| | | virtual DFBResult SetOpacity( | |
| | | u8 opacity | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetRotation( | |
| | | s32 rotation | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetColorAdjustment( | |
| | | const DFBColorAdjustment *adjustment | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetStereoDepth( | |
| | | bool follow_video | |
| | | , | |
| | | s32 z | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetFieldParity( | |
| | | u32 field | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetClipRegions( | |
| | | const DFBRegion *regions, | |
| | | u32 num, | |
| | | bool positive | |
| | | ); | |
| | | | |
| | | virtual DFBResult CreateWindow( | |
| | | const DFBWindowDescription *description, | |
| | | CoreWindow **ret_window | |
| | | ); | |
| | | | |
| | | virtual DFBResult FindWindow( | |
| | | DFBWindowID window_id, | |
| | | CoreWindow **ret_window | |
| | | ); | |
| | | | |
| | | virtual DFBResult FindWindowByResourceID( | |
| | | u64 resource_id, | |
| | | CoreWindow **ret_window | |
| | | ); | |
| | | | |
|
| private: | | | |
| CoreDFB *core; | | | |
| ILayerContext *real; | | | |
| }; | | }; | |
| | | | |
|
| | | DFBResult CoreLayerContextDispatch__Dispatch( CoreLayerContext *obj, | |
| | | FusionID caller, | |
| | | int method, | |
| | | void *ptr, | |
| | | unsigned int length, | |
| | | void *ret_ptr, | |
| | | unsigned int ret_size, | |
| | | unsigned int *ret_length ); | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 35 change blocks. |
| 68 lines changed or deleted | | 499 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 "CoreSurface_includes.h" | | #include <core/CoreSurface_includes.h> | |
| | | | |
| /**************************************************************************
******************************************** | | /**************************************************************************
******************************************** | |
| * CoreSurface | | * CoreSurface | |
| */ | | */ | |
| | | | |
| #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 | |
| bool swap); | | bool swap); | |
| | | | |
| DFBResult CoreSurface_GetPalette( | | DFBResult CoreSurface_GetPalette( | |
| CoreSurface *obj, | | CoreSurface *obj, | |
| CorePalette **ret_palette)
; | | CorePalette **ret_palette)
; | |
| | | | |
| DFBResult CoreSurface_SetPalette( | | DFBResult CoreSurface_SetPalette( | |
| CoreSurface *obj, | | CoreSurface *obj, | |
| CorePalette *palette); | | 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( | | DFBResult CoreSurface_PreLockBuffer( | |
| CoreSurface *obj, | | CoreSurface *obj, | |
|
| u32 buffer_index | | CoreSurfaceBuffer *buffer, | |
| , | | CoreSurfaceAccessorID accessor, | |
| | | CoreSurfaceAccessFlags access, | |
| | | CoreSurfaceAllocation **ret_allocati | |
| | | on); | |
| | | | |
| | | DFBResult CoreSurface_PreLockBuffer2( | |
| | | CoreSurface *obj, | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye, | |
| CoreSurfaceAccessorID accessor, | | CoreSurfaceAccessorID accessor, | |
| CoreSurfaceAccessFlags access, | | CoreSurfaceAccessFlags access, | |
|
| u32 *ret_allocati | | bool lock, | |
| on_index); | | CoreSurfaceAllocation **ret_allocati | |
| | | on); | |
| | | | |
| DFBResult CoreSurface_PreReadBuffer( | | DFBResult CoreSurface_PreReadBuffer( | |
| CoreSurface *obj, | | CoreSurface *obj, | |
|
| u32 buffer_index
, | | CoreSurfaceBuffer *buffer, | |
| const DFBRectangle *rect, | | const DFBRectangle *rect, | |
|
| u32 *ret_allocati
on_index); | | CoreSurfaceAllocation **ret_allocati
on); | |
| | | | |
| DFBResult CoreSurface_PreWriteBuffer( | | DFBResult CoreSurface_PreWriteBuffer( | |
| CoreSurface *obj, | | CoreSurface *obj, | |
|
| u32 buffer_index
, | | CoreSurfaceBuffer *buffer, | |
| const DFBRectangle *rect, | | const DFBRectangle *rect, | |
|
| u32 *ret_allocati | | CoreSurfaceAllocation **ret_allocati | |
| on_index); | | on); | |
| | | | |
| | | DFBResult CoreSurface_PreLockBuffer3( | |
| | | CoreSurface *obj, | |
| | | CoreSurfaceBufferRole role, | |
| | | u32 flip_count, | |
| | | DFBSurfaceStereoEye eye, | |
| | | CoreSurfaceAccessorID accessor, | |
| | | CoreSurfaceAccessFlags access, | |
| | | bool lock, | |
| | | CoreSurfaceAllocation **ret_allocati | |
| | | on); | |
| | | | |
| | | DFBResult CoreSurface_CreateClient( | |
| | | CoreSurface *obj, | |
| | | CoreSurfaceClient **ret_client); | |
| | | | |
| | | DFBResult CoreSurface_BackToFrontCopy( | |
| | | CoreSurface *obj, | |
| | | DFBSurfaceStereoEye eye, | |
| | | const DFBRegion *left_region, | |
| | | const DFBRegion *right_region | |
| | | ); | |
| | | | |
|
| 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( | |
|
| void *dispatch | | FusionCall *call | |
| ); | | ); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| | | | |
| namespace DirectFB { | | namespace DirectFB { | |
| | | | |
| /* | | /* | |
| * CoreSurface Calls | | * CoreSurface Calls | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| CoreSurface_SetConfig = 1, | | CoreSurface_SetConfig = 1, | |
| CoreSurface_Flip = 2, | | CoreSurface_Flip = 2, | |
| CoreSurface_GetPalette = 3, | | CoreSurface_GetPalette = 3, | |
| CoreSurface_SetPalette = 4, | | CoreSurface_SetPalette = 4, | |
|
| CoreSurface_PreLockBuffer = 5, | | CoreSurface_SetAlphaRamp = 5, | |
| CoreSurface_PreReadBuffer = 6, | | CoreSurface_SetField = 6, | |
| CoreSurface_PreWriteBuffer = 7, | | CoreSurface_PreLockBuffer = 7, | |
| | | CoreSurface_PreLockBuffer2 = 8, | |
| | | CoreSurface_PreReadBuffer = 9, | |
| | | CoreSurface_PreWriteBuffer = 10, | |
| | | CoreSurface_PreLockBuffer3 = 11, | |
| | | CoreSurface_CreateClient = 12, | |
| | | CoreSurface_BackToFrontCopy = 13, | |
| } CoreSurfaceCall; | | } CoreSurfaceCall; | |
| | | | |
| /* | | /* | |
| * CoreSurface_SetConfig | | * CoreSurface_SetConfig | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| CoreSurfaceConfig config; | | CoreSurfaceConfig config; | |
| } CoreSurfaceSetConfig; | | } CoreSurfaceSetConfig; | |
| | | | |
| typedef struct { | | typedef struct { | |
| | | | |
| skipping to change at line 138 | | skipping to change at line 184 | |
| | | | |
| /* | | /* | |
| * CoreSurface_GetPalette | | * CoreSurface_GetPalette | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| } CoreSurfaceGetPalette; | | } CoreSurfaceGetPalette; | |
| | | | |
| typedef struct { | | typedef struct { | |
| DFBResult result; | | DFBResult result; | |
| u32 palette_id; | | u32 palette_id; | |
|
| | | void* palette_ptr; | |
| } CoreSurfaceGetPaletteReturn; | | } CoreSurfaceGetPaletteReturn; | |
| | | | |
| /* | | /* | |
| * CoreSurface_SetPalette | | * CoreSurface_SetPalette | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| u32 palette_id; | | u32 palette_id; | |
| } CoreSurfaceSetPalette; | | } CoreSurfaceSetPalette; | |
| | | | |
| typedef struct { | | typedef struct { | |
| DFBResult result; | | DFBResult result; | |
| } CoreSurfaceSetPaletteReturn; | | } CoreSurfaceSetPaletteReturn; | |
| | | | |
| /* | | /* | |
|
| | | * CoreSurface_SetAlphaRamp | |
| | | */ | |
| | | typedef struct { | |
| | | u8 a0; | |
| | | u8 a1; | |
| | | u8 a2; | |
| | | u8 a3; | |
| | | } CoreSurfaceSetAlphaRamp; | |
| | | | |
| | | typedef struct { | |
| | | DFBResult result; | |
| | | } CoreSurfaceSetAlphaRampReturn; | |
| | | | |
| | | /* | |
| | | * CoreSurface_SetField | |
| | | */ | |
| | | typedef struct { | |
| | | s32 field; | |
| | | } CoreSurfaceSetField; | |
| | | | |
| | | typedef struct { | |
| | | DFBResult result; | |
| | | } CoreSurfaceSetFieldReturn; | |
| | | | |
| | | /* | |
| * CoreSurface_PreLockBuffer | | * CoreSurface_PreLockBuffer | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
|
| u32 buffer_index; | | u32 buffer_id; | |
| CoreSurfaceAccessorID accessor; | | CoreSurfaceAccessorID accessor; | |
| CoreSurfaceAccessFlags access; | | CoreSurfaceAccessFlags access; | |
| } CoreSurfacePreLockBuffer; | | } CoreSurfacePreLockBuffer; | |
| | | | |
| typedef struct { | | typedef struct { | |
| DFBResult result; | | DFBResult result; | |
|
| u32 allocation_index; | | u32 allocation_id; | |
| | | void* allocation_ptr; | |
| } CoreSurfacePreLockBufferReturn; | | } CoreSurfacePreLockBufferReturn; | |
| | | | |
| /* | | /* | |
|
| | | * CoreSurface_PreLockBuffer2 | |
| | | */ | |
| | | typedef struct { | |
| | | CoreSurfaceBufferRole role; | |
| | | DFBSurfaceStereoEye eye; | |
| | | CoreSurfaceAccessorID accessor; | |
| | | CoreSurfaceAccessFlags access; | |
| | | bool lock; | |
| | | } CoreSurfacePreLockBuffer2; | |
| | | | |
| | | typedef struct { | |
| | | DFBResult result; | |
| | | u32 allocation_id; | |
| | | void* allocation_ptr; | |
| | | } CoreSurfacePreLockBuffer2Return; | |
| | | | |
| | | /* | |
| * CoreSurface_PreReadBuffer | | * CoreSurface_PreReadBuffer | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
|
| u32 buffer_index; | | u32 buffer_id; | |
| DFBRectangle rect; | | DFBRectangle rect; | |
| } CoreSurfacePreReadBuffer; | | } CoreSurfacePreReadBuffer; | |
| | | | |
| typedef struct { | | typedef struct { | |
| DFBResult result; | | DFBResult result; | |
|
| u32 allocation_index; | | u32 allocation_id; | |
| | | void* allocation_ptr; | |
| } CoreSurfacePreReadBufferReturn; | | } CoreSurfacePreReadBufferReturn; | |
| | | | |
| /* | | /* | |
| * CoreSurface_PreWriteBuffer | | * CoreSurface_PreWriteBuffer | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
|
| u32 buffer_index; | | u32 buffer_id; | |
| DFBRectangle rect; | | DFBRectangle rect; | |
| } CoreSurfacePreWriteBuffer; | | } CoreSurfacePreWriteBuffer; | |
| | | | |
| typedef struct { | | typedef struct { | |
| DFBResult result; | | DFBResult result; | |
|
| u32 allocation_index; | | u32 allocation_id; | |
| | | void* allocation_ptr; | |
| } CoreSurfacePreWriteBufferReturn; | | } CoreSurfacePreWriteBufferReturn; | |
| | | | |
|
| | | /* | |
| | | * CoreSurface_PreLockBuffer3 | |
| | | */ | |
| | | typedef struct { | |
| | | CoreSurfaceBufferRole role; | |
| | | u32 flip_count; | |
| | | DFBSurfaceStereoEye eye; | |
| | | CoreSurfaceAccessorID accessor; | |
| | | CoreSurfaceAccessFlags access; | |
| | | bool lock; | |
| | | } CoreSurfacePreLockBuffer3; | |
| | | | |
| | | typedef struct { | |
| | | DFBResult result; | |
| | | u32 allocation_id; | |
| | | void* allocation_ptr; | |
| | | } CoreSurfacePreLockBuffer3Return; | |
| | | | |
| | | /* | |
| | | * CoreSurface_CreateClient | |
| | | */ | |
| | | typedef struct { | |
| | | } CoreSurfaceCreateClient; | |
| | | | |
| | | typedef struct { | |
| | | DFBResult result; | |
| | | u32 client_id; | |
| | | void* client_ptr; | |
| | | } CoreSurfaceCreateClientReturn; | |
| | | | |
| | | /* | |
| | | * CoreSurface_BackToFrontCopy | |
| | | */ | |
| | | typedef struct { | |
| | | DFBSurfaceStereoEye eye; | |
| | | bool left_region_set; | |
| | | DFBRegion left_region; | |
| | | bool right_region_set; | |
| | | DFBRegion right_region; | |
| | | } CoreSurfaceBackToFrontCopy; | |
| | | | |
| | | typedef struct { | |
| | | DFBResult result; | |
| | | } CoreSurfaceBackToFrontCopyReturn; | |
| | | | |
| class ISurface : public Interface | | class ISurface : public Interface | |
| { | | { | |
| public: | | public: | |
| ISurface( CoreDFB *core ) | | ISurface( CoreDFB *core ) | |
| : | | : | |
| Interface( core ) | | Interface( core ) | |
| { | | { | |
| } | | } | |
| | | | |
| public: | | public: | |
| | | | |
| skipping to change at line 217 | | skipping to change at line 354 | |
| ) = 0; | | ) = 0; | |
| | | | |
| virtual DFBResult GetPalette( | | virtual DFBResult GetPalette( | |
| CorePalette **ret_palette | | CorePalette **ret_palette | |
| ) = 0; | | ) = 0; | |
| | | | |
| virtual DFBResult SetPalette( | | virtual DFBResult SetPalette( | |
| CorePalette *palette | | CorePalette *palette | |
| ) = 0; | | ) = 0; | |
| | | | |
|
| | | virtual DFBResult SetAlphaRamp( | |
| | | u8 a0, | |
| | | u8 a1, | |
| | | u8 a2, | |
| | | u8 a3 | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult SetField( | |
| | | s32 field | |
| | | ) = 0; | |
| | | | |
| virtual DFBResult PreLockBuffer( | | virtual DFBResult PreLockBuffer( | |
|
| u32 buffer_index
, | | CoreSurfaceBuffer *buffer, | |
| CoreSurfaceAccessorID accessor, | | CoreSurfaceAccessorID accessor, | |
| CoreSurfaceAccessFlags access, | | CoreSurfaceAccessFlags access, | |
|
| u32 *ret_allocati | | CoreSurfaceAllocation **ret_allocati | |
| on_index | | on | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult PreLockBuffer2( | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye, | |
| | | CoreSurfaceAccessorID accessor, | |
| | | CoreSurfaceAccessFlags access, | |
| | | bool lock, | |
| | | CoreSurfaceAllocation **ret_allocati | |
| | | on | |
| ) = 0; | | ) = 0; | |
| | | | |
| virtual DFBResult PreReadBuffer( | | virtual DFBResult PreReadBuffer( | |
|
| u32 buffer_index
, | | CoreSurfaceBuffer *buffer, | |
| const DFBRectangle *rect, | | const DFBRectangle *rect, | |
|
| u32 *ret_allocati
on_index | | CoreSurfaceAllocation **ret_allocati
on | |
| ) = 0; | | ) = 0; | |
| | | | |
| virtual DFBResult PreWriteBuffer( | | virtual DFBResult PreWriteBuffer( | |
|
| u32 buffer_index
, | | CoreSurfaceBuffer *buffer, | |
| const DFBRectangle *rect, | | const DFBRectangle *rect, | |
|
| u32 *ret_allocati | | CoreSurfaceAllocation **ret_allocati | |
| on_index | | on | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult PreLockBuffer3( | |
| | | CoreSurfaceBufferRole role, | |
| | | u32 flip_count, | |
| | | DFBSurfaceStereoEye eye, | |
| | | CoreSurfaceAccessorID accessor, | |
| | | CoreSurfaceAccessFlags access, | |
| | | bool lock, | |
| | | CoreSurfaceAllocation **ret_allocati | |
| | | on | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult CreateClient( | |
| | | CoreSurfaceClient **ret_client | |
| | | ) = 0; | |
| | | | |
| | | virtual DFBResult BackToFrontCopy( | |
| | | DFBSurfaceStereoEye eye, | |
| | | const DFBRegion *left_region, | |
| | | const DFBRegion *right_region | |
| ) = 0; | | ) = 0; | |
| | | | |
| }; | | }; | |
| | | | |
| class ISurface_Real : public ISurface | | class ISurface_Real : public ISurface | |
| { | | { | |
| private: | | private: | |
| CoreSurface *obj; | | CoreSurface *obj; | |
| | | | |
| public: | | public: | |
| | | | |
| skipping to change at line 268 | | skipping to change at line 445 | |
| ); | | ); | |
| | | | |
| virtual DFBResult GetPalette( | | virtual DFBResult GetPalette( | |
| CorePalette **ret_palette | | CorePalette **ret_palette | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetPalette( | | virtual DFBResult SetPalette( | |
| CorePalette *palette | | CorePalette *palette | |
| ); | | ); | |
| | | | |
|
| | | virtual DFBResult SetAlphaRamp( | |
| | | u8 a0, | |
| | | u8 a1, | |
| | | u8 a2, | |
| | | u8 a3 | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetField( | |
| | | s32 field | |
| | | ); | |
| | | | |
| virtual DFBResult PreLockBuffer( | | virtual DFBResult PreLockBuffer( | |
|
| u32 buffer_index
, | | CoreSurfaceBuffer *buffer, | |
| CoreSurfaceAccessorID accessor, | | CoreSurfaceAccessorID accessor, | |
| CoreSurfaceAccessFlags access, | | CoreSurfaceAccessFlags access, | |
|
| u32 *ret_allocati | | CoreSurfaceAllocation **ret_allocati | |
| on_index | | on | |
| | | ); | |
| | | | |
| | | virtual DFBResult PreLockBuffer2( | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye, | |
| | | CoreSurfaceAccessorID accessor, | |
| | | CoreSurfaceAccessFlags access, | |
| | | bool lock, | |
| | | CoreSurfaceAllocation **ret_allocati | |
| | | on | |
| ); | | ); | |
| | | | |
| virtual DFBResult PreReadBuffer( | | virtual DFBResult PreReadBuffer( | |
|
| u32 buffer_index
, | | CoreSurfaceBuffer *buffer, | |
| const DFBRectangle *rect, | | const DFBRectangle *rect, | |
|
| u32 *ret_allocati
on_index | | CoreSurfaceAllocation **ret_allocati
on | |
| ); | | ); | |
| | | | |
| virtual DFBResult PreWriteBuffer( | | virtual DFBResult PreWriteBuffer( | |
|
| u32 buffer_index
, | | CoreSurfaceBuffer *buffer, | |
| const DFBRectangle *rect, | | const DFBRectangle *rect, | |
|
| u32 *ret_allocati | | CoreSurfaceAllocation **ret_allocati | |
| on_index | | on | |
| | | ); | |
| | | | |
| | | virtual DFBResult PreLockBuffer3( | |
| | | CoreSurfaceBufferRole role, | |
| | | u32 flip_count, | |
| | | DFBSurfaceStereoEye eye, | |
| | | CoreSurfaceAccessorID accessor, | |
| | | CoreSurfaceAccessFlags access, | |
| | | bool lock, | |
| | | CoreSurfaceAllocation **ret_allocati | |
| | | on | |
| | | ); | |
| | | | |
| | | virtual DFBResult CreateClient( | |
| | | CoreSurfaceClient **ret_client | |
| | | ); | |
| | | | |
| | | virtual DFBResult BackToFrontCopy( | |
| | | DFBSurfaceStereoEye eye, | |
| | | const DFBRegion *left_region, | |
| | | const DFBRegion *right_region | |
| ); | | ); | |
| | | | |
| }; | | }; | |
| | | | |
| class ISurface_Requestor : public ISurface | | class ISurface_Requestor : public ISurface | |
| { | | { | |
| private: | | private: | |
| CoreSurface *obj; | | CoreSurface *obj; | |
| | | | |
| public: | | public: | |
| | | | |
| skipping to change at line 319 | | skipping to change at line 536 | |
| ); | | ); | |
| | | | |
| virtual DFBResult GetPalette( | | virtual DFBResult GetPalette( | |
| CorePalette **ret_palette | | CorePalette **ret_palette | |
| ); | | ); | |
| | | | |
| virtual DFBResult SetPalette( | | virtual DFBResult SetPalette( | |
| CorePalette *palette | | CorePalette *palette | |
| ); | | ); | |
| | | | |
|
| | | virtual DFBResult SetAlphaRamp( | |
| | | u8 a0, | |
| | | u8 a1, | |
| | | u8 a2, | |
| | | u8 a3 | |
| | | ); | |
| | | | |
| | | virtual DFBResult SetField( | |
| | | s32 field | |
| | | ); | |
| | | | |
| virtual DFBResult PreLockBuffer( | | virtual DFBResult PreLockBuffer( | |
|
| u32 buffer_index | | CoreSurfaceBuffer *buffer, | |
| , | | CoreSurfaceAccessorID accessor, | |
| | | CoreSurfaceAccessFlags access, | |
| | | CoreSurfaceAllocation **ret_allocati | |
| | | on | |
| | | ); | |
| | | | |
| | | virtual DFBResult PreLockBuffer2( | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye, | |
| CoreSurfaceAccessorID accessor, | | CoreSurfaceAccessorID accessor, | |
| CoreSurfaceAccessFlags access, | | CoreSurfaceAccessFlags access, | |
|
| u32 *ret_allocati | | bool lock, | |
| on_index | | CoreSurfaceAllocation **ret_allocati | |
| | | on | |
| ); | | ); | |
| | | | |
| virtual DFBResult PreReadBuffer( | | virtual DFBResult PreReadBuffer( | |
|
| u32 buffer_index
, | | CoreSurfaceBuffer *buffer, | |
| const DFBRectangle *rect, | | const DFBRectangle *rect, | |
|
| u32 *ret_allocati
on_index | | CoreSurfaceAllocation **ret_allocati
on | |
| ); | | ); | |
| | | | |
| virtual DFBResult PreWriteBuffer( | | virtual DFBResult PreWriteBuffer( | |
|
| u32 buffer_index
, | | CoreSurfaceBuffer *buffer, | |
| const DFBRectangle *rect, | | const DFBRectangle *rect, | |
|
| u32 *ret_allocati
on_index | | CoreSurfaceAllocation **ret_allocati
on | |
| ); | | ); | |
| | | | |
|
| }; | | virtual DFBResult PreLockBuffer3( | |
| | | CoreSurfaceBufferRole role, | |
| class CoreSurfaceDispatch | | u32 flip_count, | |
| { | | DFBSurfaceStereoEye eye, | |
| | | CoreSurfaceAccessorID accessor, | |
| | | CoreSurfaceAccessFlags access, | |
| | | bool lock, | |
| | | CoreSurfaceAllocation **ret_allocati | |
| | | on | |
| | | ); | |
| | | | |
|
| public: | | virtual DFBResult CreateClient( | |
| CoreSurfaceDispatch( CoreDFB *core, ISurface *real ) | | CoreSurfaceClient **ret_client | |
| : | | ); | |
| core( core ), | | | |
| real( real ) | | | |
| { | | | |
| } | | | |
| | | | |
|
| virtual DFBResult Dispatch( FusionID caller, | | virtual DFBResult BackToFrontCopy( | |
| int method, | | DFBSurfaceStereoEye eye, | |
| void *ptr, | | const DFBRegion *left_region, | |
| unsigned int length, | | const DFBRegion *right_region | |
| void *ret_ptr, | | ); | |
| unsigned int ret_size, | | | |
| unsigned int *ret_length ); | | | |
| | | | |
|
| private: | | | |
| CoreDFB *core; | | | |
| ISurface *real; | | | |
| }; | | }; | |
| | | | |
|
| | | DFBResult CoreSurfaceDispatch__Dispatch( CoreSurface *obj, | |
| | | FusionID caller, | |
| | | int method, | |
| | | void *ptr, | |
| | | unsigned int length, | |
| | | void *ret_ptr, | |
| | | unsigned int ret_size, | |
| | | unsigned int *ret_length ); | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 47 change blocks. |
| 66 lines changed or deleted | | 315 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 75 | | skipping to change at line 79 | |
| DFBResult dfb_core_create ( CoreDFB **ret_core ); | | DFBResult dfb_core_create ( CoreDFB **ret_core ); | |
| | | | |
| DFBResult dfb_core_destroy ( CoreDFB *core, | | DFBResult dfb_core_destroy ( CoreDFB *core, | |
| 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 ) | |
| | | | |
|
| | | DFBResult dfb_core_initialize( CoreDFB *core ); | |
| | | | |
| /* | | /* | |
| * Object creation | | * Object creation | |
| */ | | */ | |
| CoreGraphicsState *dfb_core_create_graphics_state( CoreDFB *core ); | | 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 ); | |
|
| | | CoreSurfaceAllocation *dfb_core_create_surface_allocation( CoreDFB *core ); | |
| | | CoreSurfaceBuffer *dfb_core_create_surface_buffer( CoreDFB *core ); | |
| | | CoreSurfaceClient *dfb_core_create_surface_client( CoreDFB *core ); | |
| CoreWindow *dfb_core_create_window ( CoreDFB *core ); | | CoreWindow *dfb_core_create_window ( CoreDFB *core ); | |
| | | | |
| DFBResult dfb_core_get_graphics_state ( CoreDFB *core
, | | DFBResult dfb_core_get_graphics_state ( CoreDFB *core
, | |
| u32 obje
ct_id, | | u32 obje
ct_id, | |
| CoreGraphicsState **ret_
state ); | | CoreGraphicsState **ret_
state ); | |
| | | | |
| DFBResult dfb_core_get_layer_context ( CoreDFB *core
, | | DFBResult dfb_core_get_layer_context ( CoreDFB *core
, | |
| u32 obje
ct_id, | | u32 obje
ct_id, | |
| CoreLayerContext **ret_
context ); | | CoreLayerContext **ret_
context ); | |
| | | | |
| | | | |
| skipping to change at line 105 | | skipping to change at line 114 | |
| CoreLayerRegion **ret_
region ); | | CoreLayerRegion **ret_
region ); | |
| | | | |
| DFBResult dfb_core_get_palette ( CoreDFB *core
, | | DFBResult dfb_core_get_palette ( CoreDFB *core
, | |
| u32 obje
ct_id, | | u32 obje
ct_id, | |
| CorePalette **ret_
palette ); | | CorePalette **ret_
palette ); | |
| | | | |
| DFBResult dfb_core_get_surface ( CoreDFB *core
, | | DFBResult dfb_core_get_surface ( CoreDFB *core
, | |
| u32 obje
ct_id, | | u32 obje
ct_id, | |
| CoreSurface **ret_
surface ); | | CoreSurface **ret_
surface ); | |
| | | | |
|
| | | DFBResult dfb_core_get_surface_allocation( CoreDFB | |
| | | *core, | |
| | | u32 | |
| | | object_id, | |
| | | CoreSurfaceAllocation * | |
| | | *ret_allocation ); | |
| | | | |
| | | DFBResult dfb_core_get_surface_buffer ( CoreDFB *core | |
| | | , | |
| | | u32 obje | |
| | | ct_id, | |
| | | CoreSurfaceBuffer **ret_ | |
| | | surface ); | |
| | | | |
| | | DFBResult dfb_core_get_surface_client ( CoreDFB *core | |
| | | , | |
| | | u32 obje | |
| | | ct_id, | |
| | | CoreSurfaceClient **ret_ | |
| | | client ); | |
| | | | |
| DFBResult dfb_core_get_window ( CoreDFB *core
, | | DFBResult dfb_core_get_window ( CoreDFB *core
, | |
| u32 obje
ct_id, | | u32 obje
ct_id, | |
| CoreWindow **ret_
window ); | | CoreWindow **ret_
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 ); | |
| DirectResult dfb_core_enum_layer_regions ( CoreDFB *core, | | DirectResult dfb_core_enum_layer_regions ( CoreDFB *core, | |
| FusionObjectCallback callback, | | FusionObjectCallback callback, | |
| void *ctx ); | | void *ctx ); | |
| | | | |
| /* | | /* | |
|
| | | * Arena shared fields | |
| | | */ | |
| | | DirectResult core_arena_add_shared_field( CoreDFB *core, | |
| | | const char *name, | |
| | | void *data ); | |
| | | | |
| | | DirectResult core_arena_get_shared_field( CoreDFB *core, | |
| | | const char *name, | |
| | | void **data ); | |
| | | | |
| | | /* | |
| * 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. | | | |
| */ | | | |
| FusionArena *dfb_core_arena( CoreDFB *core ); | | | |
| | | | |
| /* | | | |
| * Returns the shared memory pool of the core. | | * Returns the shared memory pool of the core. | |
| */ | | */ | |
| FusionSHMPoolShared *dfb_core_shmpool( CoreDFB *core ); | | FusionSHMPoolShared *dfb_core_shmpool( CoreDFB *core ); | |
| | | | |
| /* | | /* | |
| * Returns the shared memory pool for raw data, e.g. surface buffers. | | * Returns the shared memory pool for raw data, e.g. surface buffers. | |
| */ | | */ | |
| FusionSHMPoolShared *dfb_core_shmpool_data( CoreDFB *core ); | | FusionSHMPoolShared *dfb_core_shmpool_data( CoreDFB *core ); | |
| | | | |
| /* | | /* | |
| | | | |
| skipping to change at line 182 | | skipping to change at line 207 | |
| 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 ); | |
| | | | |
|
| | | D_DECLARE_INTERFACE( ICoreResourceManager ) | |
| | | D_DECLARE_INTERFACE( ICoreResourceClient ) | |
| | | | |
| struct __DFB_CoreDFBShared { | | struct __DFB_CoreDFBShared { | |
| int magic; | | int magic; | |
| | | | |
|
| FusionSkirmish lock; | | bool secure; | |
| bool active; | | | |
| | | | |
| FusionObjectPool *graphics_state_pool; | | 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 *surface_pool; | | FusionObjectPool *surface_pool; | |
|
| | | FusionObjectPool *surface_allocation_pool; | |
| | | FusionObjectPool *surface_buffer_pool; | |
| | | FusionObjectPool *surface_client_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; | |
|
| | | FusionHash *field_hash; | |
| }; | | }; | |
| | | | |
| struct __DFB_CoreDFB { | | struct __DFB_CoreDFB { | |
| int magic; | | int magic; | |
| | | | |
| int refs; | | int refs; | |
| | | | |
| int fusion_id; | | int fusion_id; | |
| | | | |
| FusionWorld *world; | | FusionWorld *world; | |
|
| FusionArena *arena; | | | |
| | | | |
| CoreDFBShared *shared; | | CoreDFBShared *shared; | |
| | | | |
|
| bool master; | | | |
| bool suspended; | | bool suspended; | |
| | | | |
| 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 ); | |
| | | | |
| | | DFBResult Core_Resource_AllowSurface ( CoreSurface *surfa | |
| | | ce, | |
| | | const char *execu | |
| | | table ); | |
| | | | |
| | | /* | |
| | | * Resource manager main interface | |
| | | * | |
| | | * Implementation can be loaded via 'resource-manager' option. | |
| | | */ | |
| | | D_DEFINE_INTERFACE( ICoreResourceManager, | |
| | | | |
| | | DFBResult (*CreateClient) ( ICoreResourceManager *thiz, | |
| | | FusionID identity, | |
| | | ICoreResourceClient **ret_client | |
| | | ); | |
| | | ) | |
| | | | |
| | | /* | |
| | | * Per slave resource accounting | |
| | | */ | |
| | | D_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. 16 change blocks. |
| 11 lines changed or deleted | | 260 lines changed or added | |
|
| directfb.h | | directfb.h | |
| | | | |
| skipping to change at line 198 | | skipping to change at line 198 | |
| 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_BASE = D_RESULT_TYPE_CODE_BASE( 'D','F','B','1' ), | | 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 | | 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 | |
| | | | |
| skipping to change at line 590 | | skipping to change at line 591 | |
| | | | |
| DLCAPS_CLIP_REGIONS = 0x00400000, /* Supports IDirectFBDisplayLa
yer::SetClipRegions(). */ | | DLCAPS_CLIP_REGIONS = 0x00400000, /* Supports IDirectFBDisplayLa
yer::SetClipRegions(). */ | |
| | | | |
| DLCAPS_LR_MONO = 0x01000000, /* Supports L/R mono stereosco
pic display. */ | | DLCAPS_LR_MONO = 0x01000000, /* Supports L/R mono stereosco
pic display. */ | |
| DLCAPS_STEREO = 0x02000000, /* Supports independent L/R st
ereoscopic display. */ | | DLCAPS_STEREO = 0x02000000, /* Supports independent L/R st
ereoscopic display. */ | |
| | | | |
| DLCAPS_ALL = 0x0373FFFF | | DLCAPS_ALL = 0x0373FFFF | |
| } DFBDisplayLayerCapabilities; | | } DFBDisplayLayerCapabilities; | |
| | | | |
| /* | | /* | |
|
| | | * Flags used by image providers | |
| | | */ | |
| | | typedef enum { | |
| | | DIRENDER_NONE = 0x00000000, | |
| | | DIRENDER_FAST = 0x00000001, /* Select fast rendering metho | |
| | | d */ | |
| | | DIRENDER_ALL = 0x00000001 | |
| | | } DIRenderFlags; | |
| | | | |
| | | /* | |
| * 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.
*/ | |
| DSCCAPS_POWER_MANAGEMENT = 0x00000002, /* Power management supported.
*/ | | DSCCAPS_POWER_MANAGEMENT = 0x00000002, /* Power management supported.
*/ | |
| | | | |
| DSCCAPS_MIXERS = 0x00000010, /* Has mixers. */ | | DSCCAPS_MIXERS = 0x00000010, /* Has mixers. */ | |
| | | | |
| skipping to change at line 707 | | skipping to change at line 717 | |
| * The surface capabilities. | | * The surface capabilities. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| DSCAPS_NONE = 0x00000000, /* None of these. */ | | DSCAPS_NONE = 0x00000000, /* None of these. */ | |
| | | | |
| DSCAPS_PRIMARY = 0x00000001, /* It's the primary surface. */ | | DSCAPS_PRIMARY = 0x00000001, /* It's the primary surface. */ | |
| DSCAPS_SYSTEMONLY = 0x00000002, /* Surface data is permanently sto
red in system memory.<br> | | DSCAPS_SYSTEMONLY = 0x00000002, /* Surface data is permanently sto
red in system memory.<br> | |
| There's no video memory allocat
ion/storage. */ | | There's no video memory allocat
ion/storage. */ | |
| DSCAPS_VIDEOONLY = 0x00000004, /* Surface data is permanently sto
red in video memory.<br> | | DSCAPS_VIDEOONLY = 0x00000004, /* Surface data is permanently sto
red in video memory.<br> | |
| There's no system memory alloca
tion/storage. */ | | There's no system memory alloca
tion/storage. */ | |
|
| | | DSCAPS_GL = 0x00000008, /* Surface data is stored in memor
y that can be accessed by a GL accelerator. */ | |
| DSCAPS_DOUBLE = 0x00000010, /* Surface is double buffered */ | | DSCAPS_DOUBLE = 0x00000010, /* Surface is double buffered */ | |
| DSCAPS_SUBSURFACE = 0x00000020, /* Surface is just a sub area of a
nother | | DSCAPS_SUBSURFACE = 0x00000020, /* Surface is just a sub area of a
nother | |
| one sharing the surface data. *
/ | | one sharing the surface data. *
/ | |
| DSCAPS_INTERLACED = 0x00000040, /* Each buffer contains interlaced
video (or graphics) | | DSCAPS_INTERLACED = 0x00000040, /* Each buffer contains interlaced
video (or graphics) | |
| data consisting of two fields.<
br> | | data consisting of two fields.<
br> | |
| Their lines are stored interlea
ved. One field's height | | Their lines are stored interlea
ved. One field's height | |
| is a half of the surface's heig
ht. */ | | is a half of the surface's heig
ht. */ | |
| DSCAPS_SEPARATED = 0x00000080, /* For usage with DSCAPS_INTERLACE
D.<br> | | DSCAPS_SEPARATED = 0x00000080, /* For usage with DSCAPS_INTERLACE
D.<br> | |
| DSCAPS_SEPARATED specifies that
the fields are NOT | | DSCAPS_SEPARATED specifies that
the fields are NOT | |
| interleaved line by line in the
buffer.<br> | | interleaved line by line in the
buffer.<br> | |
| | | | |
| skipping to change at line 737 | | skipping to change at line 748 | |
| | | | |
| 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 | | 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. */ | | 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 = 0x011113FF, /* 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; | |
| | | | |
| /* | | /* | |
| * The palette capabilities. | | * The palette capabilities. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| DPCAPS_NONE = 0x00000000 /* None of these. */ | | DPCAPS_NONE = 0x00000000 /* None of these. */ | |
| | | | |
| skipping to change at line 905 | | skipping to change at line 916 | |
| DIDTF_REMOTE = 0x00000008, /* Is a remote control. */ | | DIDTF_REMOTE = 0x00000008, /* Is a remote control. */ | |
| DIDTF_VIRTUAL = 0x00000010, /* Is a virtual input device. */ | | DIDTF_VIRTUAL = 0x00000010, /* Is a virtual input device. */ | |
| | | | |
| DIDTF_ALL = 0x0000001F /* All type flags set. */ | | DIDTF_ALL = 0x0000001F /* All type flags set. */ | |
| } DFBInputDeviceTypeFlags; | | } DFBInputDeviceTypeFlags; | |
| | | | |
| /* | | /* | |
| * Basic input device features. | | * Basic input device features. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
|
| | | #ifndef DIRECTFB_DISABLE_DEPRECATED | |
| DICAPS_KEYS = 0x00000001, /* device supports key events */ | | DICAPS_KEYS = 0x00000001, /* device supports key events */ | |
| DICAPS_AXES = 0x00000002, /* device supports axis events */ | | DICAPS_AXES = 0x00000002, /* device supports axis events */ | |
| DICAPS_BUTTONS = 0x00000004, /* device supports button events */ | | DICAPS_BUTTONS = 0x00000004, /* device supports button events */ | |
| | | | |
| DICAPS_ALL = 0x00000007 /* all capabilities */ | | DICAPS_ALL = 0x00000007 /* all capabilities */ | |
|
| | | #else | |
| | | DIDCAPS_NONE = 0x00000000, /* device supports no events */ | |
| | | DIDCAPS_KEYS = 0x00000001, /* device supports key events */ | |
| | | DIDCAPS_AXES = 0x00000002, /* device supports axis events */ | |
| | | DIDCAPS_BUTTONS = 0x00000004, /* device supports button events */ | |
| | | | |
| | | DIDCAPS_ALL = 0x00000007 /* all capabilities */ | |
| | | #endif | |
| } DFBInputDeviceCapabilities; | | } DFBInputDeviceCapabilities; | |
| | | | |
| /* | | /* | |
| * Identifier (index) for e.g. mouse or joystick buttons. | | * Identifier (index) for e.g. mouse or joystick buttons. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| DIBI_LEFT = 0x00000000, /* left mouse button */ | | DIBI_LEFT = 0x00000000, /* left mouse button */ | |
| DIBI_RIGHT = 0x00000001, /* right mouse button */ | | DIBI_RIGHT = 0x00000001, /* right mouse button */ | |
| DIBI_MIDDLE = 0x00000002, /* middle mouse button */ | | DIBI_MIDDLE = 0x00000002, /* middle mouse button */ | |
| | | | |
| | | | |
| skipping to change at line 1051 | | skipping to change at line 1071 | |
| or lowered with the mouse */ | | or lowered with the mouse */ | |
| DWOP_GHOST = 0x00001000, /* never get focus or input, | | DWOP_GHOST = 0x00001000, /* never get focus or input, | |
| clicks will go through, | | clicks will go through, | |
| implies DWOP_KEEP... */ | | implies DWOP_KEEP... */ | |
| DWOP_INDESTRUCTIBLE = 0x00002000, /* window can't be destroyed | | DWOP_INDESTRUCTIBLE = 0x00002000, /* window can't be destroyed | |
| by internal shortcut */ | | by internal shortcut */ | |
| DWOP_INPUTONLY = 0x00004000, /* The window will be input only. | | DWOP_INPUTONLY = 0x00004000, /* The window will be input only. | |
| It will receive events but is no
t shown. | | It will receive events but is no
t shown. | |
| Note that toggling this bit will
not | | Note that toggling this bit will
not | |
| free/assign the window surface.
*/ | | free/assign the window surface.
*/ | |
|
| | | DWOP_STEREO_SIDE_BY_SIDE_HALF = 0x00008000, /* Treat single buffer as
combined left/right buffers, side by side. */ | |
| DWOP_SCALE = 0x00010000, /* Surface won't be changed if wind
ow size on screen changes. The surface | | DWOP_SCALE = 0x00010000, /* Surface won't be changed if wind
ow size on screen changes. The surface | |
| can be resized separately using
IDirectFBWindow::ResizeSurface(). */ | | can be resized separately using
IDirectFBWindow::ResizeSurface(). */ | |
| | | | |
| DWOP_KEEP_ABOVE = 0x00100000, /* Keep window above parent window.
*/ | | DWOP_KEEP_ABOVE = 0x00100000, /* Keep window above parent window.
*/ | |
| DWOP_KEEP_UNDER = 0x00200000, /* Keep window under parent window.
*/ | | DWOP_KEEP_UNDER = 0x00200000, /* Keep window under parent window.
*/ | |
| DWOP_FOLLOW_BOUNDS = 0x00400000, /* Follow window bounds from parent
. */ | | DWOP_FOLLOW_BOUNDS = 0x00400000, /* Follow window bounds from parent
. */ | |
| | | | |
|
| DWOP_ALL = 0x0071707F /* all possible options */ | | DWOP_ALL = 0x0071F07F /* all possible options */ | |
| } DFBWindowOptions; | | } DFBWindowOptions; | |
| | | | |
| /* | | /* | |
| * The stacking class restricts the stacking order of windows. | | * The stacking class restricts the stacking order of windows. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| DWSC_MIDDLE = 0x00000000, /* This is the default stacking | | DWSC_MIDDLE = 0x00000000, /* This is the default stacking | |
| class of new windows. */ | | class of new windows. */ | |
| DWSC_UPPER = 0x00000001, /* Window is always above windows | | DWSC_UPPER = 0x00000001, /* Window is always above windows | |
| in the middle stacking class. | | in the middle stacking class. | |
| | | | |
| skipping to change at line 1328 | | skipping to change at line 1349 | |
| /* 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) */ | | /* 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 ), | | DSPF_ABGR = DFB_SURFACE_PIXELFORMAT( 37, 24, 8, 1, 0, 4, 0, 0, 0,
0, 0 ), | |
| | | | |
| /* 32 bit RGBAF (4 byte, red 8@24, green 8@16, blue 8@8, alpha 7@1, fl
ash 1@0 */ | | /* 32 bit RGBAF (4 byte, red 8@24, green 8@16, blue 8@8, alpha 7@1, fl
ash 1@0 */ | |
|
| DSPF_RGBAF88871 = DFB_SURFACE_PIXELFORMAT( 38, 24, 7, 1, 0, 4, 0, 0, 0 | | DSPF_RGBAF88871 = DFB_SURFACE_PIXELFORMAT( 38, 24, 7, 1, 0, 4, 0, 0, 0 | |
| , 0, 0 ) | | , 0, 0 ), | |
| | | | |
| | | /* 4 bit LUT (1 byte/ 2 pixel, 4 bit color and alpha lookup from pa | |
| | | lette) */ | |
| | | DSPF_LUT4 = DFB_SURFACE_PIXELFORMAT( 39, 4, 0, 1, 4, 0, 1, 0, 0, | |
| | | 1, 0 ), | |
| | | | |
| | | /* 16 bit LUT (1 byte alpha and 8 bit color lookup from palette) */ | |
| | | DSPF_ALUT8 = DFB_SURFACE_PIXELFORMAT( 40, 8, 8, 1, 0, 2, 0, 0, 0, | |
| | | 1, 0 ), | |
| | | | |
| } DFBSurfacePixelFormat; | | } DFBSurfacePixelFormat; | |
| | | | |
| /* Number of pixelformats defined */ | | /* Number of pixelformats defined */ | |
|
| #define DFB_NUM_PIXELFORMATS 39 | | #define DFB_NUM_PIXELFORMATS 41 | |
| | | | |
| /* 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 1387 | | skipping to change at line 1414 | |
| ((fmt) == DSPF_RGBAF88871)) | | ((fmt) == DSPF_RGBAF88871)) | |
| | | | |
| #define DFB_COLOR_IS_YUV(fmt) \ | | #define DFB_COLOR_IS_YUV(fmt) \ | |
| (((fmt) == DSPF_YUY2) || \ | | (((fmt) == DSPF_YUY2) || \ | |
| ((fmt) == DSPF_UYVY) || \ | | ((fmt) == DSPF_UYVY) || \ | |
| ((fmt) == DSPF_I420) || \ | | ((fmt) == DSPF_I420) || \ | |
| ((fmt) == DSPF_YV12) || \ | | ((fmt) == DSPF_YV12) || \ | |
| ((fmt) == DSPF_NV12) || \ | | ((fmt) == DSPF_NV12) || \ | |
| ((fmt) == DSPF_NV16) || \ | | ((fmt) == DSPF_NV16) || \ | |
| ((fmt) == DSPF_NV21) || \ | | ((fmt) == DSPF_NV21) || \ | |
|
| ((fmt) == DSPF_AYUV)) | | ((fmt) == DSPF_AYUV) || \ | |
| | | ((fmt) == DSPF_YUV444P) || \ | |
| | | ((fmt) == DSPF_AVYU) || \ | |
| | | ((fmt) == DSPF_VYU) || \ | |
| | | ((fmt) == DSPF_YV16)) | |
| | | | |
| /* | | /* | |
| * Color space used by the colors in the surface. | | * Color space used by the colors in the surface. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| DSCS_UNKNOWN = 0, | | DSCS_UNKNOWN = 0, | |
| DSCS_RGB = 1, /* standard RGB */ | | DSCS_RGB = 1, /* standard RGB */ | |
| DSCS_BT601 = 2, /* ITU BT.601 */ | | DSCS_BT601 = 2, /* ITU BT.601 */ | |
| DSCS_BT601_FULLRANGE = 3, /* ITU BT.601 Full Range
*/ | | DSCS_BT601_FULLRANGE = 3, /* ITU BT.601 Full Range
*/ | |
| DSCS_BT709 = 4 /* ITU BT.709 */ | | DSCS_BT709 = 4 /* ITU BT.709 */ | |
| | | | |
| skipping to change at line 1439 | | skipping to change at line 1470 | |
| DFBSurfaceDescriptionFlags flags; /* field validation */ | | DFBSurfaceDescriptionFlags flags; /* field validation */ | |
| | | | |
| DFBSurfaceCapabilities caps; /* capabilities */ | | DFBSurfaceCapabilities caps; /* capabilities */ | |
| int width; /* pixel width */ | | int width; /* pixel width */ | |
| int height; /* pixel height */ | | int height; /* pixel height */ | |
| DFBSurfacePixelFormat pixelformat; /* pixel format */ | | DFBSurfacePixelFormat pixelformat; /* pixel format */ | |
| | | | |
| struct { | | struct { | |
| void *data; /* data pointer of exi
sting buffer */ | | void *data; /* data pointer of exi
sting buffer */ | |
| int pitch; /* pitch of buffer */ | | int pitch; /* pitch of buffer */ | |
|
| } preallocated[2]; | | } preallocated[3]; | |
| | | | |
| 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. */ | |
| | | | |
| skipping to change at line 2188 | | skipping to change at line 2219 | |
| * has been constructed, the resulting interface pointer is stored in | | * has been constructed, the resulting interface pointer is stored in | |
| * <b>interface</b>. | | * <b>interface</b>. | |
| */ | | */ | |
| DFBResult (*GetInterface) ( | | DFBResult (*GetInterface) ( | |
| IDirectFB *thiz, | | IDirectFB *thiz, | |
| const char *type, | | const char *type, | |
| const char *implementation, | | const char *implementation, | |
| void *arg, | | void *arg, | |
| void **ret_interface | | void **ret_interface | |
| ); | | ); | |
|
| | | | |
| | | /** Surfaces **/ | |
| | | | |
| | | /* | |
| | | * Get a surface by ID. | |
| | | */ | |
| | | DFBResult (*GetSurface) ( | |
| | | IDirectFB *thiz, | |
| | | DFBSurfaceID surface_id, | |
| | | IDirectFBSurface **ret_interface | |
| | | ); | |
| ) | | ) | |
| | | | |
| /* predefined layer ids */ | | /* predefined layer ids */ | |
| #define DLID_PRIMARY 0x0000 | | #define DLID_PRIMARY 0x0000 | |
| | | | |
| /* predefined layer source ids */ | | /* predefined layer source ids */ | |
| #define DLSID_SURFACE 0x0000 | | #define DLSID_SURFACE 0x0000 | |
| | | | |
| /* predefined screen ids */ | | /* predefined screen ids */ | |
| #define DSCID_PRIMARY 0x0000 | | #define DSCID_PRIMARY 0x0000 | |
| | | | |
| skipping to change at line 2426 | | skipping to change at line 2468 | |
| DSOR_800_600 = 0x00000008, /* 800x600 Resolution */ | | DSOR_800_600 = 0x00000008, /* 800x600 Resolution */ | |
| DSOR_1024_768 = 0x00000010, /* 1024x768 Resolution */ | | DSOR_1024_768 = 0x00000010, /* 1024x768 Resolution */ | |
| DSOR_1152_864 = 0x00000020, /* 1152x864 Resolution */ | | DSOR_1152_864 = 0x00000020, /* 1152x864 Resolution */ | |
| DSOR_1280_720 = 0x00000040, /* 1280x720 Resolution */ | | DSOR_1280_720 = 0x00000040, /* 1280x720 Resolution */ | |
| DSOR_1280_768 = 0x00000080, /* 1280x768 Resolution */ | | DSOR_1280_768 = 0x00000080, /* 1280x768 Resolution */ | |
| DSOR_1280_960 = 0x00000100, /* 1280x960 Resolution */ | | DSOR_1280_960 = 0x00000100, /* 1280x960 Resolution */ | |
| DSOR_1280_1024 = 0x00000200, /* 1280x1024 Resolution */ | | DSOR_1280_1024 = 0x00000200, /* 1280x1024 Resolution */ | |
| DSOR_1400_1050 = 0x00000400, /* 1400x1050 Resolution */ | | DSOR_1400_1050 = 0x00000400, /* 1400x1050 Resolution */ | |
| DSOR_1600_1200 = 0x00000800, /* 1600x1200 Resolution */ | | DSOR_1600_1200 = 0x00000800, /* 1600x1200 Resolution */ | |
| DSOR_1920_1080 = 0x00001000, /* 1920x1080 Resolution */ | | DSOR_1920_1080 = 0x00001000, /* 1920x1080 Resolution */ | |
|
| DSOR_ALL = 0x00001FFF /* All Resolution */ | | DSOR_960_540 = 0x00002000, /* 960x540 Resolution */ | |
| | | DSOR_1440_540 = 0x00004000, /* 1440x540 Resolution */ | |
| | | DSOR_ALL = 0x00007FFF /* All Resolution */ | |
| } DFBScreenOutputResolution; | | } DFBScreenOutputResolution; | |
| | | | |
| #define DFB_SCREEN_OUTPUT_DESC_NAME_LENGTH 24 | | #define DFB_SCREEN_OUTPUT_DESC_NAME_LENGTH 24 | |
| | | | |
| /* | | /* | |
| * Description of a screen output. | | * Description of a screen output. | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| DFBScreenOutputCapabilities caps; /* Screen capabilities
. */ | | DFBScreenOutputCapabilities caps; /* Screen capabilities
. */ | |
| | | | |
| | | | |
| skipping to change at line 2494 | | skipping to change at line 2538 | |
| | | | |
| DSECAPS_BRIGHTNESS = 0x00000100, /* Adjustment of brightness is supp
orted. */ | | DSECAPS_BRIGHTNESS = 0x00000100, /* Adjustment of brightness is supp
orted. */ | |
| DSECAPS_CONTRAST = 0x00000200, /* Adjustment of contrast is suppor
ted. */ | | DSECAPS_CONTRAST = 0x00000200, /* Adjustment of contrast is suppor
ted. */ | |
| DSECAPS_HUE = 0x00000400, /* Adjustment of hue is supported.
*/ | | DSECAPS_HUE = 0x00000400, /* Adjustment of hue is supported.
*/ | |
| DSECAPS_SATURATION = 0x00000800, /* Adjustment of saturation is supp
orted. */ | | DSECAPS_SATURATION = 0x00000800, /* Adjustment of saturation is supp
orted. */ | |
| | | | |
| DSECAPS_CONNECTORS = 0x00001000, /* Select output connector(s). */ | | DSECAPS_CONNECTORS = 0x00001000, /* Select output connector(s). */ | |
| DSECAPS_SLOW_BLANKING = 0x00002000, /* Slow Blanking on outputs is sup
ported. */ | | DSECAPS_SLOW_BLANKING = 0x00002000, /* Slow Blanking on outputs is sup
ported. */ | |
| DSECAPS_RESOLUTION = 0x00004000, /* Different encoder resolutions su
pported */ | | DSECAPS_RESOLUTION = 0x00004000, /* Different encoder resolutions su
pported */ | |
| DSECAPS_FRAMING = 0x00008000, /* Can select picture framing mode
for stereo */ | | DSECAPS_FRAMING = 0x00008000, /* Can select picture framing mode
for stereo */ | |
|
| | | DSECAPS_ASPECT_RATIO = 0x00010000, /* Can specify display aspect ratio
*/ | |
| | | | |
|
| DSECAPS_ALL = 0x0000FF3F | | DSECAPS_ALL = 0x0001FF3F | |
| } DFBScreenEncoderCapabilities; | | } DFBScreenEncoderCapabilities; | |
| | | | |
| /* | | /* | |
| * Type of display encoder. | | * Type of display encoder. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| DSET_UNKNOWN = 0x00000000, /* Unknown type */ | | DSET_UNKNOWN = 0x00000000, /* Unknown type */ | |
| | | | |
| DSET_CRTC = 0x00000001, /* Encoder is a CRTC. */ | | DSET_CRTC = 0x00000001, /* Encoder is a CRTC. */ | |
| DSET_TV = 0x00000002, /* TV output encoder. */ | | DSET_TV = 0x00000002, /* TV output encoder. */ | |
| | | | |
| skipping to change at line 2557 | | skipping to change at line 2602 | |
| DSEF_29_97HZ = 0x00000002, /* 29.97 Hz Output. */ | | DSEF_29_97HZ = 0x00000002, /* 29.97 Hz Output. */ | |
| DSEF_50HZ = 0x00000004, /* 50 Hz Output. */ | | DSEF_50HZ = 0x00000004, /* 50 Hz Output. */ | |
| DSEF_59_94HZ = 0x00000008, /* 59.94 Hz Output. */ | | DSEF_59_94HZ = 0x00000008, /* 59.94 Hz Output. */ | |
| DSEF_60HZ = 0x00000010, /* 60 Hz Output. */ | | DSEF_60HZ = 0x00000010, /* 60 Hz Output. */ | |
| DSEF_75HZ = 0x00000020, /* 75 Hz Output. */ | | DSEF_75HZ = 0x00000020, /* 75 Hz Output. */ | |
| DSEF_30HZ = 0x00000040, /* 30 Hz Output. */ | | DSEF_30HZ = 0x00000040, /* 30 Hz Output. */ | |
| DSEF_24HZ = 0x00000080, /* 24 Hz Output. */ | | DSEF_24HZ = 0x00000080, /* 24 Hz Output. */ | |
| DSEF_23_976HZ = 0x00000100, /* 23.976 Hz Output. */ | | DSEF_23_976HZ = 0x00000100, /* 23.976 Hz Output. */ | |
| } DFBScreenEncoderFrequency; | | } DFBScreenEncoderFrequency; | |
| | | | |
|
| | | /* | |
| | | * Encoder picture delivery method. | |
| | | * See HDMI Specification 1.4a - Extraction of 3D signaling portion for mor | |
| | | e details | |
| | | */ | |
| | | typedef enum { | |
| | | DSEPF_UNKNOWN = 0, | |
| | | DSEPF_MONO = 0x00000001, /* Normal output to | |
| | | non-stereoscopic (3D) TV. No | |
| | | L/R content provi | |
| | | ded to TV. Frame is output on | |
| | | each vsync. */ | |
| | | DSEPF_STEREO_SIDE_BY_SIDE_HALF = 0x00000002, /* L/R frames are do | |
| | | wnscaled horizontally by 2 and | |
| | | packed side-by-si | |
| | | de into a single frame, left on left | |
| | | half of frame. Th | |
| | | e packed frame is output on each | |
| | | vsync. Some stere | |
| | | oscopic TV's support this mode | |
| | | using HDMI v1.3 a | |
| | | nd a special menu configuration. */ | |
| | | DSEPF_STEREO_TOP_AND_BOTTOM = 0x00000004, /* L/R frames are do | |
| | | wnscaled vertically by 2 and | |
| | | packed into a sin | |
| | | gle frame, left on top. The packed | |
| | | frame is output o | |
| | | n each vsync. Some stereoscopic TV's | |
| | | support this mode | |
| | | using HDMI v1.3 and a special | |
| | | menu configuratio | |
| | | n. */ | |
| | | DSEPF_STEREO_FRAME_PACKING = 0x00000008, /* Full resolution L | |
| | | /R frames or fields are delivered sequentially | |
| | | to the TV, altern | |
| | | ating left & right with an active | |
| | | space between eac | |
| | | h video frame. Vsync occurs | |
| | | after each sequen | |
| | | ce of: vblank, left eye video frame, | |
| | | active space, rig | |
| | | ht eye video frame. Requires HDMI v1.4a. */ | |
| | | | |
| | | DSEPF_STEREO_SIDE_BY_SIDE_FULL = 0x00000010, /* L/R frames are pa | |
| | | cked side-by-side into a double width | |
| | | single frame, lef | |
| | | t on left half of frame. The packed | |
| | | frame is output o | |
| | | n each vsync. Requires HDMI v1.4a. */ | |
| | | DSEPF_ALL = 0x0000001f | |
| | | } DFBScreenEncoderPictureFraming; | |
| | | | |
| | | #ifndef DIRECTFB_DISABLE_DEPRECATED | |
| | | #define DSEPF_STEREO_PACKED_HORIZ DSEPF_STEREO_SIDE_BY_SIDE_HALF | |
| | | #define DSEPF_STEREO_PACKED_VERT DSEPF_STEREO_TOP_AND_BOTTOM | |
| | | #define DSEPF_STEREO_SEQUENTIAL DSEPF_STEREO_FRAME_PACKING | |
| | | #endif | |
| | | | |
| | | typedef enum { | |
| | | DFB_ASPECT_RATIO_eAuto, /* 4x3 for SD and 480p, 16x9 for HD (including | |
| | | 720p, 1080i, etc.) */ | |
| | | DFB_ASPECT_RATIO_e4x3, | |
| | | DFB_ASPECT_RATIO_e16x9 | |
| | | } DFBDisplayAspectRatio; | |
| | | | |
| #define DFB_SCREEN_ENCODER_DESC_NAME_LENGTH 24 | | #define DFB_SCREEN_ENCODER_DESC_NAME_LENGTH 24 | |
| | | | |
| /* | | /* | |
| * Description of a display encoder. | | * Description of a display encoder. | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| DFBScreenEncoderCapabilities caps; /* Encoder capabilit
ies. */ | | DFBScreenEncoderCapabilities caps; /* Encoder capabilit
ies. */ | |
| DFBScreenEncoderType type; /* Type of encoder.
*/ | | DFBScreenEncoderType type; /* Type of encoder.
*/ | |
| | | | |
| DFBScreenEncoderTVStandards tv_standards; /* Supported TV stan
dards. */ | | DFBScreenEncoderTVStandards tv_standards; /* Supported TV stan
dards. */ | |
| DFBScreenOutputSignals out_signals; /* Supported output
signals. */ | | DFBScreenOutputSignals out_signals; /* Supported output
signals. */ | |
| 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 */ | |
|
| | | | |
| | | DFBScreenEncoderPictureFraming all_framing; /* Supported HDMI si | |
| | | gnaling modes */ | |
| | | DFBDisplayAspectRatio all_aspect_ratio; /* Supported display | |
| | | aspect ratios */ | |
| } 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. */ | |
| | | | |
| skipping to change at line 2594 | | skipping to change at line 2685 | |
| DSECONF_SCANMODE = 0x00000010, /* Select interlaced or progres
sive output. */ | | DSECONF_SCANMODE = 0x00000010, /* Select interlaced or progres
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_ADJUSTMENT = 0x00000040, /* Set color adjustment. */ | |
| DSECONF_FREQUENCY = 0x00000080, /* Set Output Frequency*/ | | 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 sup
port. */ | | DSECONF_SLOW_BLANKING = 0x00000200, /* Can select slow blanking sup
port. */ | |
| DSECONF_RESOLUTION = 0x00000400, /* Can change resolution of the
encoder.*/ | | DSECONF_RESOLUTION = 0x00000400, /* Can change resolution of the
encoder.*/ | |
| | | | |
| DSECONF_FRAMING = 0x00000800, /* Set method for delivering pi
ctures to display. */ | | DSECONF_FRAMING = 0x00000800, /* Set method for delivering pi
ctures to display. */ | |
|
| | | DSECONF_ASPECT_RATIO = 0x00001000, /* Set display aspect ratio. */ | |
| | | | |
|
| DSECONF_ALL = 0x00000FFF | | DSECONF_ALL = 0x00001FFF | |
| } 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 2618 | | skipping to change at line 2710 | |
| 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. | | | |
| * See HDMI Specification 1.4a - Extraction of 3D signaling portion for mor | | | |
| e details | | | |
| */ | | | |
| typedef enum { | | | |
| DSEPF_UNKNOWN = 0, | | | |
| DSEPF_MONO = 0x00000001, /* Normal output to | | | |
| non-stereoscopic (3D) TV. No | | | |
| L/R content provi | | | |
| ded to TV. Frame is output on | | | |
| each vsync. */ | | | |
| DSEPF_STEREO_SIDE_BY_SIDE_HALF = 0x00000002, /* L/R frames are do | | | |
| wnscaled horizontally by 2 and | | | |
| packed side-by-si | | | |
| de into a single frame, left on left | | | |
| half of frame. Th | | | |
| e packed frame is output on each | | | |
| vsync. Some stere | | | |
| oscopic TV's support this mode | | | |
| using HDMI v1.3 a | | | |
| nd a special menu configuration. */ | | | |
| DSEPF_STEREO_TOP_AND_BOTTOM = 0x00000004, /* L/R frames are do | | | |
| wnscaled vertically by 2 and | | | |
| packed into a sin | | | |
| gle frame, left on top. The packed | | | |
| frame is output o | | | |
| n each vsync. Some stereoscopic TV's | | | |
| support this mode | | | |
| using HDMI v1.3 and a special | | | |
| menu configuratio | | | |
| n. */ | | | |
| DSEPF_STEREO_FRAME_PACKING = 0x00000008, /* Full resolution L | | | |
| /R frames or fields are delivered sequentially | | | |
| to the TV, altern | | | |
| ating left & right with an active | | | |
| space between eac | | | |
| h video frame. Vsync occurs | | | |
| after each sequen | | | |
| ce of: vblank, left eye video frame, | | | |
| active space, rig | | | |
| ht eye video frame. Requires HDMI v1.4a. */ | | | |
| | | | |
| DSEPF_STEREO_SIDE_BY_SIDE_FULL = 0x00000010, /* L/R frames are pa | | | |
| cked side-by-side into a double width | | | |
| single frame, lef | | | |
| t on left half of frame. The packed | | | |
| frame is output o | | | |
| n each vsync. Requires HDMI v1.4a. */ | | | |
| DSEPF_ALL = 0x0000001f | | | |
| } DFBScreenEncoderPictureFraming; | | | |
| | | | |
| #ifndef DIRECTFB_DISABLE_DEPRECATED | | | |
| #define DSEPF_STEREO_PACKED_HORIZ DSEPF_STEREO_SIDE_BY_SIDE_HALF | | | |
| #define DSEPF_STEREO_PACKED_VERT DSEPF_STEREO_TOP_AND_BOTTOM | | | |
| #define DSEPF_STEREO_SEQUENTIAL DSEPF_STEREO_FRAME_PACKING | | | |
| #endif | | | |
| | | | |
| /* | | | |
| * Configuration of a display encoder. | | * Configuration of a display encoder. | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| DFBScreenEncoderConfigFlags flags; /* Validates st
ruct members. */ | | DFBScreenEncoderConfigFlags flags; /* Validates st
ruct members. */ | |
| | | | |
| DFBScreenEncoderTVStandards tv_standard; /* TV standard.
*/ | | DFBScreenEncoderTVStandards tv_standard; /* TV standard.
*/ | |
| DFBScreenEncoderTestPicture test_picture; /* Test picture
mode. */ | | DFBScreenEncoderTestPicture test_picture; /* Test picture
mode. */ | |
| int mixer; /* Selected mix
er. */ | | int mixer; /* Selected mix
er. */ | |
| DFBScreenOutputSignals out_signals; /* Generated ou
tput signals. */ | | DFBScreenOutputSignals out_signals; /* Generated ou
tput signals. */ | |
| DFBScreenOutputConnectors out_connectors; /* Selected out
put connector(s). */ | | DFBScreenOutputConnectors out_connectors; /* Selected out
put connector(s). */ | |
| | | | |
| skipping to change at line 2676 | | skipping to change at line 2731 | |
| | | | |
| DFBScreenEncoderScanMode scanmode; /* Interlaced o
r progressive output. */ | | DFBScreenEncoderScanMode scanmode; /* Interlaced o
r progressive output. */ | |
| | | | |
| DFBColor test_color; /* Color for DS
ETP_SINGLE. */ | | DFBColor test_color; /* Color for DS
ETP_SINGLE. */ | |
| | | | |
| DFBColorAdjustment adjustment; /* Color adjust
ment. */ | | DFBColorAdjustment adjustment; /* Color adjust
ment. */ | |
| | | | |
| DFBScreenEncoderFrequency frequency; /* Selected Out
put Frequency*/ | | DFBScreenEncoderFrequency frequency; /* Selected Out
put Frequency*/ | |
| DFBScreenOutputResolution resolution; /* Selected Out
put resolution*/ | | DFBScreenOutputResolution resolution; /* Selected Out
put resolution*/ | |
| DFBScreenEncoderPictureFraming framing; /* Selected pic
ture delivery method. */ | | DFBScreenEncoderPictureFraming framing; /* Selected pic
ture delivery method. */ | |
|
| | | DFBDisplayAspectRatio aspect_ratio; /* screen aspec
t ratio */ | |
| } DFBScreenEncoderConfig; | | } DFBScreenEncoderConfig; | |
| | | | |
| /******************* | | /******************* | |
| * IDirectFBScreen * | | * IDirectFBScreen * | |
| *******************/ | | *******************/ | |
| | | | |
| /* | | /* | |
| * <i>No summary yet...</i> | | * <i>No summary yet...</i> | |
| */ | | */ | |
| D_DEFINE_INTERFACE( IDirectFBScreen, | | D_DEFINE_INTERFACE( IDirectFBScreen, | |
| | | | |
| skipping to change at line 3473 | | skipping to change at line 3529 | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| DSSE_LEFT = 0x00000001, /* Left eye buffers to be used for
all future | | DSSE_LEFT = 0x00000001, /* Left eye buffers to be used for
all future | |
| operations on this surface. */ | | operations on this surface. */ | |
| DSSE_RIGHT = 0x00000002 /* Right eye buffers to be used for
all future | | DSSE_RIGHT = 0x00000002 /* Right eye buffers to be used for
all future | |
| operations on this surface. */ | | operations on this surface. */ | |
| } DFBSurfaceStereoEye; | | } 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 3678 | | skipping to change at line 3735 | |
| | | | |
| /* | | /* | |
| * Get the current pixel format. | | * Get the current pixel format. | |
| */ | | */ | |
| DFBResult (*GetPixelFormat) ( | | DFBResult (*GetPixelFormat) ( | |
| IDirectFBSurface *thiz, | | IDirectFBSurface *thiz, | |
| DFBSurfacePixelFormat *ret_format | | DFBSurfacePixelFormat *ret_format | |
| ); | | ); | |
| | | | |
| /* | | /* | |
|
| | | * Get the current color space. | |
| | | */ | |
| | | DFBResult (*GetColorSpace) ( | |
| | | IDirectFBSurface *thiz, | |
| | | DFBSurfaceColorSpace *ret_colorspace | |
| | | ); | |
| | | | |
| | | /* | |
| * Get a mask of drawing functions that are hardware | | * Get a mask of drawing functions that are hardware | |
| * accelerated with the current settings. | | * accelerated with the current settings. | |
| * | | * | |
| * If a source surface is specified the mask will also | | * If a source surface is specified the mask will also | |
| * contain accelerated blitting functions. Note that there | | * contain accelerated blitting functions. Note that there | |
| * is no guarantee that these will actually be accelerated | | * is no guarantee that these will actually be accelerated | |
| * since the surface storage (video/system) is examined only | | * since the surface storage (video/system) is examined only | |
| * when something actually gets drawn or blitted. | | * when something actually gets drawn or blitted. | |
| */ | | */ | |
| DFBResult (*GetAccelerationMask) ( | | DFBResult (*GetAccelerationMask) ( | |
| | | | |
| skipping to change at line 4604 | | skipping to change at line 4669 | |
| | | | |
| /* | | /* | |
| * Set the source convolution filter. | | * Set the source convolution filter. | |
| * | | * | |
| * Enable usage of this filter by setting DSBLIT_SRC_CONVOLUTION via I
DirectFBSurface::SetBlittingFlags(). | | * Enable usage of this filter by setting DSBLIT_SRC_CONVOLUTION via I
DirectFBSurface::SetBlittingFlags(). | |
| */ | | */ | |
| DFBResult (*SetSrcConvolution) ( | | DFBResult (*SetSrcConvolution) ( | |
| IDirectFBSurface *thiz, | | IDirectFBSurface *thiz, | |
| const DFBConvolutionFilter *filter | | const DFBConvolutionFilter *filter | |
| ); | | ); | |
|
| | | | |
| | | /** Retrieving information **/ | |
| | | | |
| | | /* | |
| | | * Get the unique surface ID. | |
| | | */ | |
| | | DFBResult (*GetID) ( | |
| | | IDirectFBSurface *thiz, | |
| | | DFBSurfaceID *ret_surface_id | |
| | | ); | |
| | | | |
| | | /** Process security **/ | |
| | | | |
| | | /* | |
| | | * Allow access. | |
| | | */ | |
| | | DFBResult (*AllowAccess) ( | |
| | | IDirectFBSurface *thiz, | |
| | | const char *executable | |
| | | ); | |
| | | | |
| | | /** Event buffers **/ | |
| | | | |
| | | /* | |
| | | * Create an event buffer for this surface and attach it. | |
| | | */ | |
| | | DFBResult (*CreateEventBuffer) ( | |
| | | IDirectFBSurface *thiz, | |
| | | IDirectFBEventBuffer **ret_buffer | |
| | | ); | |
| | | | |
| | | /* | |
| | | * Attach an existing event buffer to this surface. | |
| | | * | |
| | | * NOTE: Attaching multiple times generates multiple events. | |
| | | */ | |
| | | DFBResult (*AttachEventBuffer) ( | |
| | | IDirectFBSurface *thiz, | |
| | | IDirectFBEventBuffer *buffer | |
| | | ); | |
| | | | |
| | | /* | |
| | | * Detach an event buffer from this surface. | |
| | | */ | |
| | | DFBResult (*DetachEventBuffer) ( | |
| | | IDirectFBSurface *thiz, | |
| | | IDirectFBEventBuffer *buffer | |
| | | ); | |
| | | | |
| | | /** Blitting functions **/ | |
| | | /* | |
| | | * Blit a bunch of areas scaled from the source to the destination | |
| | | * rectangles. | |
| | | * | |
| | | * <b>source_rects</b> and <b>dest_rects</b> will be modified! | |
| | | */ | |
| | | DFBResult (*BatchStretchBlit) ( | |
| | | IDirectFBSurface *thiz, | |
| | | IDirectFBSurface *source, | |
| | | const DFBRectangle *source_rects, | |
| | | const DFBRectangle *dest_rects, | |
| | | int num | |
| | | ); | |
| | | | |
| | | /** Client **/ | |
| | | | |
| | | /* | |
| | | * Put in client mode for frame synchronization. | |
| | | */ | |
| | | DFBResult (*MakeClient) ( | |
| | | IDirectFBSurface *thiz | |
| | | ); | |
| | | | |
| | | /* | |
| | | * Put in client mode for frame synchronization. | |
| | | */ | |
| | | DFBResult (*FrameAck) ( | |
| | | IDirectFBSurface *thiz, | |
| | | u32 flip_count | |
| | | ); | |
| ) | | ) | |
| | | | |
| /******************** | | /******************** | |
| * IDirectFBPalette * | | * IDirectFBPalette * | |
| ********************/ | | ********************/ | |
| | | | |
| /* | | /* | |
| * <i>No summary yet...</i> | | * <i>No summary yet...</i> | |
| */ | | */ | |
| D_DEFINE_INTERFACE( IDirectFBPalette, | | D_DEFINE_INTERFACE( IDirectFBPalette, | |
| | | | |
| skipping to change at line 4766 | | skipping to change at line 4911 | |
| typedef enum { | | typedef enum { | |
| DIMM_SHIFT = (1 << DIMKI_SHIFT), /* Shift key is pressed */ | | DIMM_SHIFT = (1 << DIMKI_SHIFT), /* Shift key is pressed */ | |
| DIMM_CONTROL = (1 << DIMKI_CONTROL), /* Control key is pressed */ | | DIMM_CONTROL = (1 << DIMKI_CONTROL), /* Control key is pressed */ | |
| DIMM_ALT = (1 << DIMKI_ALT), /* Alt key is pressed */ | | DIMM_ALT = (1 << DIMKI_ALT), /* Alt key is pressed */ | |
| DIMM_ALTGR = (1 << DIMKI_ALTGR), /* AltGr key is pressed */ | | DIMM_ALTGR = (1 << DIMKI_ALTGR), /* AltGr key is pressed */ | |
| DIMM_META = (1 << DIMKI_META), /* Meta key is pressed */ | | DIMM_META = (1 << DIMKI_META), /* Meta key is pressed */ | |
| DIMM_SUPER = (1 << DIMKI_SUPER), /* Super key is pressed */ | | DIMM_SUPER = (1 << DIMKI_SUPER), /* Super key is pressed */ | |
| DIMM_HYPER = (1 << DIMKI_HYPER) /* Hyper key is pressed */ | | DIMM_HYPER = (1 << DIMKI_HYPER) /* Hyper key is pressed */ | |
| } DFBInputDeviceModifierMask; | | } DFBInputDeviceModifierMask; | |
| | | | |
|
| | | /* | |
| | | * Input device configuration flags | |
| | | */ | |
| | | typedef enum { | |
| | | DIDCONF_NONE = 0x00000000, | |
| | | | |
| | | DIDCONF_SENSITIVITY = 0x00000001, | |
| | | | |
| | | DIDCONF_ALL = 0x00000001 | |
| | | } DFBInputDeviceConfigFlags; | |
| | | | |
| | | /* | |
| | | * Input device configuration | |
| | | */ | |
| | | typedef struct { | |
| | | DFBInputDeviceConfigFlags flags; | |
| | | | |
| | | int sensitivity; /* Sensitivity value for | |
| | | X/Y axes (8.8 fixed point), default 0x100 */ | |
| | | } DFBInputDeviceConfig; | |
| | | | |
| /************************ | | /************************ | |
| * IDirectFBInputDevice * | | * IDirectFBInputDevice * | |
| ************************/ | | ************************/ | |
| | | | |
| /* | | /* | |
| * <i>No summary yet...</i> | | * <i>No summary yet...</i> | |
| */ | | */ | |
| D_DEFINE_INTERFACE( IDirectFBInputDevice, | | D_DEFINE_INTERFACE( IDirectFBInputDevice, | |
| | | | |
| /** Retrieving information **/ | | /** Retrieving information **/ | |
| | | | |
| skipping to change at line 4924 | | skipping to change at line 5089 | |
| /* | | /* | |
| * Utility function combining two calls to GetAxis(). | | * Utility function combining two calls to GetAxis(). | |
| * | | * | |
| * You may leave one of the x/y arguments NULL. | | * You may leave one of the x/y arguments NULL. | |
| */ | | */ | |
| DFBResult (*GetXY) ( | | DFBResult (*GetXY) ( | |
| IDirectFBInputDevice *thiz, | | IDirectFBInputDevice *thiz, | |
| int *ret_x, | | int *ret_x, | |
| int *ret_y | | int *ret_y | |
| ); | | ); | |
|
| | | | |
| | | /** Configuration **/ | |
| | | | |
| | | /* | |
| | | * Change config values for the input device. | |
| | | */ | |
| | | DFBResult (*SetConfiguration) ( | |
| | | IDirectFBInputDevice *thiz, | |
| | | const DFBInputDeviceConfig *config | |
| | | ); | |
| ) | | ) | |
| | | | |
| /* | | /* | |
| * Event class. | | * Event class. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| DFEC_NONE = 0x00, /* none of these */ | | DFEC_NONE = 0x00, /* none of these */ | |
| DFEC_INPUT = 0x01, /* raw input event */ | | DFEC_INPUT = 0x01, /* raw input event */ | |
| DFEC_WINDOW = 0x02, /* windowing event */ | | DFEC_WINDOW = 0x02, /* windowing event */ | |
| DFEC_USER = 0x03, /* custom event for the user of this lib
rary */ | | DFEC_USER = 0x03, /* custom event for the user of this lib
rary */ | |
| DFEC_UNIVERSAL = 0x04, /* universal event for custom usage with
variable size */ | | DFEC_UNIVERSAL = 0x04, /* universal event for custom usage with
variable size */ | |
|
| DFEC_VIDEOPROVIDER = 0x05 /* video provider event */ | | DFEC_VIDEOPROVIDER = 0x05, /* video provider event */ | |
| | | DFEC_SURFACE = 0x06, /* surface event */ | |
| } DFBEventClass; | | } DFBEventClass; | |
| | | | |
| /* | | /* | |
| * The type of an input event. | | * The type of an input event. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| DIET_UNKNOWN = 0, /* unknown event */ | | DIET_UNKNOWN = 0, /* unknown event */ | |
| DIET_KEYPRESS, /* a key is been pressed */ | | DIET_KEYPRESS, /* a key is been pressed */ | |
| DIET_KEYRELEASE, /* a key is been released */ | | DIET_KEYRELEASE, /* a key is been released */ | |
| DIET_BUTTONPRESS, /* a (mouse) button is been pressed */ | | DIET_BUTTONPRESS, /* a (mouse) button is been pressed */ | |
| | | | |
| skipping to change at line 5118 | | skipping to change at line 5294 | |
| DVPET_DATAEXHAUSTED = 0x00000200, /* There is no more data available
for consumption */ | | DVPET_DATAEXHAUSTED = 0x00000200, /* There is no more data available
for consumption */ | |
| DVPET_VIDEOACTION = 0x00000400, /* An action is required on the vi
deo provider */ | | DVPET_VIDEOACTION = 0x00000400, /* An action is required on the vi
deo provider */ | |
| DVPET_DATALOW = 0x00000800, /* The stream buffer is running lo
w in data (threshold defined by implementation). */ | | DVPET_DATALOW = 0x00000800, /* The stream buffer is running lo
w in data (threshold defined by implementation). */ | |
| DVPET_DATAHIGH = 0x00001000, /* The stream buffer is high. */ | | DVPET_DATAHIGH = 0x00001000, /* The stream buffer is high. */ | |
| DVPET_BUFFERTIMELOW = 0x00002000, /* The stream buffer has less than
requested playout time buffered. */ | | DVPET_BUFFERTIMELOW = 0x00002000, /* The stream buffer has less than
requested playout time buffered. */ | |
| DVPET_BUFFERTIMEHIGH = 0x00004000, /* The stream buffer has more than
requested playout time buffered. */ | | DVPET_BUFFERTIMEHIGH = 0x00004000, /* The stream buffer has more than
requested playout time buffered. */ | |
| DVPET_ALL = 0x00007FFF /* All event types */ | | DVPET_ALL = 0x00007FFF /* All event types */ | |
| } DFBVideoProviderEventType; | | } DFBVideoProviderEventType; | |
| | | | |
| /* | | /* | |
|
| | | * Surface Event Types - can also be used as flags for event filters. | |
| | | */ | |
| | | typedef enum { | |
| | | DSEVT_NONE = 0x00000000, | |
| | | DSEVT_DESTROYED = 0x00000001, /* surface got destroyed by global | |
| | | deinitialization function or the application itself */ | |
| | | DSEVT_UPDATE = 0x00000002, /* */ | |
| | | DSEVT_ALL = 0x00000003 /* All event types */ | |
| | | } DFBSurfaceEventType; | |
| | | | |
| | | /* | |
| * Event from the windowing system. | | * Event from the windowing system. | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| DFBEventClass clazz; /* clazz of event */ | | DFBEventClass clazz; /* clazz of event */ | |
| | | | |
| DFBWindowEventType type; /* type of event */ | | DFBWindowEventType type; /* type of event */ | |
| | | | |
| /* used by DWET_KEYDOWN, DWET_KEYUP */ | | /* used by DWET_KEYDOWN, DWET_KEYUP */ | |
| DFBWindowEventFlags flags; /* event flags */ | | DFBWindowEventFlags flags; /* event flags */ | |
| | | | |
| | | | |
| skipping to change at line 5200 | | skipping to change at line 5386 | |
| DFBEventClass clazz; /* clazz of event */ | | DFBEventClass clazz; /* clazz of event */ | |
| | | | |
| DFBVideoProviderEventType type; /* type of event */ | | DFBVideoProviderEventType type; /* type of event */ | |
| DFBVideoProviderEventDataSubType data_type; /* data type that this ev
ent is applicable for. */ | | DFBVideoProviderEventDataSubType data_type; /* data type that this ev
ent is applicable for. */ | |
| | | | |
| int data[4]; /* custom data - large en
ough for 4 ints so that in most cases | | int data[4]; /* custom data - large en
ough for 4 ints so that in most cases | |
| memory allocation will
not be needed */ | | memory allocation will
not be needed */ | |
| } DFBVideoProviderEvent; | | } DFBVideoProviderEvent; | |
| | | | |
| /* | | /* | |
|
| | | * Event from surface | |
| | | */ | |
| | | typedef struct { | |
| | | DFBEventClass clazz; /* clazz of event */ | |
| | | | |
| | | DFBSurfaceEventType type; /* type of event */ | |
| | | | |
| | | DFBSurfaceID surface_id; /* source of event */ | |
| | | DFBRegion update; | |
| | | DFBRegion update_right; | |
| | | | |
| | | unsigned int flip_count; /* Serial number of frame | |
| | | , modulo number of buffers = buffer index */ | |
| | | } DFBSurfaceEvent; | |
| | | | |
| | | /* | |
| * Event for usage by the user of this library. | | * Event for usage by the user of this library. | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| DFBEventClass clazz; /* clazz of event */ | | DFBEventClass clazz; /* clazz of event */ | |
| | | | |
| unsigned int type; /* custom type */ | | unsigned int type; /* custom type */ | |
| void *data; /* custom data */ | | void *data; /* custom data */ | |
| } DFBUserEvent; | | } DFBUserEvent; | |
| | | | |
| /* | | /* | |
| | | | |
| skipping to change at line 5230 | | skipping to change at line 5431 | |
| /* | | /* | |
| * General container for a DirectFB Event. | | * General container for a DirectFB Event. | |
| */ | | */ | |
| typedef union { | | typedef union { | |
| DFBEventClass clazz; /* clazz of event */ | | DFBEventClass clazz; /* clazz of event */ | |
| DFBInputEvent input; /* field for input even
ts */ | | DFBInputEvent input; /* field for input even
ts */ | |
| DFBWindowEvent window; /* field for window eve
nts */ | | DFBWindowEvent window; /* field for window eve
nts */ | |
| DFBUserEvent user; /* field for user-defin
ed events */ | | DFBUserEvent user; /* field for user-defin
ed events */ | |
| DFBUniversalEvent universal; /* field for universal
events */ | | DFBUniversalEvent universal; /* field for universal
events */ | |
| DFBVideoProviderEvent videoprovider; /* field for video prov
ider */ | | DFBVideoProviderEvent videoprovider; /* field for video prov
ider */ | |
|
| | | DFBSurfaceEvent surface; /* field for surface ev
ents */ | |
| } DFBEvent; | | } DFBEvent; | |
| | | | |
| #define DFB_EVENT(e) ((DFBEvent *) (e)) | | #define DFB_EVENT(e) ((DFBEvent *) (e)) | |
| | | | |
| /* | | /* | |
| * Statistics about event buffer queue. | | * Statistics about event buffer queue. | |
| */ | | */ | |
| typedef struct { | | typedef struct { | |
| unsigned int num_events; /* Total number of events in t
he queue. */ | | unsigned int num_events; /* Total number of events in t
he queue. */ | |
| | | | |
| | | | |
| skipping to change at line 6089 | | skipping to change at line 6291 | |
| ); | | ); | |
| | | | |
| /* | | /* | |
| * Set cursor position within window coordinates (surface or cursor re
solution). | | * Set cursor position within window coordinates (surface or cursor re
solution). | |
| */ | | */ | |
| DFBResult (*SetCursorPosition) ( | | DFBResult (*SetCursorPosition) ( | |
| IDirectFBWindow *thiz, | | IDirectFBWindow *thiz, | |
| int x, | | int x, | |
| int y | | int y | |
| ); | | ); | |
|
| | | | |
| | | /** Geometry **/ | |
| | | | |
| | | /* | |
| | | * Set area of surface to be shown in window. | |
| | | * Set destination location of window within its bounds. | |
| | | * | |
| | | * Default and maximum is to show whole surface. | |
| | | */ | |
| | | DFBResult (*SetGeometry) ( | |
| | | IDirectFBWindow *thiz, | |
| | | const DFBWindowGeometry *src, | |
| | | const DFBWindowGeometry *dst | |
| | | ); | |
| ) | | ) | |
| | | | |
| /* | | /* | |
| * Called for each provided text encoding. | | * Called for each provided text encoding. | |
| */ | | */ | |
| typedef DFBEnumerationResult (*DFBTextEncodingCallback) ( | | typedef DFBEnumerationResult (*DFBTextEncodingCallback) ( | |
| DFBTextEncodingID encoding_id, | | DFBTextEncodingID encoding_id, | |
| const char *name, | | const char *name, | |
| void *context | | void *context | |
| ); | | ); | |
| | | | |
| skipping to change at line 6357 | | skipping to change at line 6573 | |
| ); | | ); | |
| | | | |
| /* | | /* | |
| * Get the position and thickness of the underline. | | * Get the position and thickness of the underline. | |
| */ | | */ | |
| DFBResult (*GetUnderline) ( | | DFBResult (*GetUnderline) ( | |
| IDirectFBFont *thiz, | | IDirectFBFont *thiz, | |
| int *ret_underline_position, | | int *ret_underline_position, | |
| int *ret_underline_thichness | | int *ret_underline_thichness | |
| ); | | ); | |
|
| | | | |
| | | /** Retrieving information **/ | |
| | | | |
| | | /* | |
| | | * Get the description of the font. | |
| | | */ | |
| | | DFBResult (*GetDescription) ( | |
| | | IDirectFBFont *thiz, | |
| | | DFBFontDescription *ret_description | |
| | | ); | |
| ) | | ) | |
| | | | |
| /* | | /* | |
| * 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 6461 | | skipping to change at line 6687 | |
| * Registers a callback for progressive image loading. | | * Registers a callback for progressive image loading. | |
| * | | * | |
| * The function is called each time a chunk of the image is decoded. | | * The function is called each time a chunk of the image is decoded. | |
| */ | | */ | |
| DFBResult (*SetRenderCallback) ( | | DFBResult (*SetRenderCallback) ( | |
| IDirectFBImageProvider *thiz, | | IDirectFBImageProvider *thiz, | |
| DIRenderCallback callback, | | DIRenderCallback callback, | |
| void *callback_data | | void *callback_data | |
| ); | | ); | |
| | | | |
|
| | | /* | |
| | | * Sets hint for preferred image decoding method | |
| | | * | |
| | | * This is optional and might be unsupported by some image providers | |
| | | */ | |
| | | DFBResult (*SetRenderFlags) ( | |
| | | IDirectFBImageProvider *thiz, | |
| | | DIRenderFlags flags | |
| | | ); | |
| | | | |
| /** Encoding **/ | | /** Encoding **/ | |
| | | | |
| /* | | /* | |
| * Encode a portion of a surface. | | * Encode a portion of a surface. | |
| */ | | */ | |
| DFBResult (*WriteBack) ( | | DFBResult (*WriteBack) ( | |
| IDirectFBImageProvider *thiz, | | IDirectFBImageProvider *thiz, | |
| IDirectFBSurface *surface, | | IDirectFBSurface *surface, | |
| const DFBRectangle *src_rect, | | const DFBRectangle *src_rect, | |
| const char *filename | | const char *filename | |
| | | | |
End of changes. 35 change blocks. |
| 72 lines changed or deleted | | 318 lines changed or added | |
|
| directfb_strings.h | | directfb_strings.h | |
| | | | |
| skipping to change at line 51 | | skipping to change at line 51 | |
| { 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_ABGR, "ABGR" }, \ | |
| { DSPF_RGBAF88871, "RGBAF88871" }, \ | | { DSPF_RGBAF88871, "RGBAF88871" }, \ | |
|
| | | { DSPF_LUT4, "LUT4" }, \ | |
| | | { DSPF_ALUT8, "ALUT8" }, \ | |
| { DSPF_UNKNOWN, "UNKNOWN" } \ | | { DSPF_UNKNOWN, "UNKNOWN" } \ | |
| }; | | }; | |
| | | | |
| struct DFBColorSpaceName { | | struct DFBColorSpaceName { | |
| DFBSurfaceColorSpace colorspace; | | DFBSurfaceColorSpace colorspace; | |
| const char *name; | | const char *name; | |
| }; | | }; | |
| | | | |
| #define DirectFBColorSpaceNames(Identifier) struct DFBColorSpaceName Identi
fier[] = { \ | | #define DirectFBColorSpaceNames(Identifier) struct DFBColorSpaceName Identi
fier[] = { \ | |
| { DSCS_RGB, "RGB" }, \ | | { DSCS_RGB, "RGB" }, \ | |
| | | | |
| skipping to change at line 258 | | skipping to change at line 260 | |
| { DWOP_ALPHACHANNEL, "ALPHACHANNEL" }, \ | | { DWOP_ALPHACHANNEL, "ALPHACHANNEL" }, \ | |
| { DWOP_OPAQUE_REGION, "OPAQUE_REGION" }, \ | | { DWOP_OPAQUE_REGION, "OPAQUE_REGION" }, \ | |
| { DWOP_SHAPED, "SHAPED" }, \ | | { DWOP_SHAPED, "SHAPED" }, \ | |
| { DWOP_ALPHACHANNEL, "ALPHACHANNEL" }, \ | | { DWOP_ALPHACHANNEL, "ALPHACHANNEL" }, \ | |
| { DWOP_KEEP_POSITION, "KEEP_POSITION" }, \ | | { DWOP_KEEP_POSITION, "KEEP_POSITION" }, \ | |
| { DWOP_KEEP_SIZE, "KEEP_SIZE" }, \ | | { DWOP_KEEP_SIZE, "KEEP_SIZE" }, \ | |
| { DWOP_KEEP_STACKING, "KEEP_STACKING" }, \ | | { DWOP_KEEP_STACKING, "KEEP_STACKING" }, \ | |
| { DWOP_GHOST, "GHOST" }, \ | | { DWOP_GHOST, "GHOST" }, \ | |
| { DWOP_INDESTRUCTIBLE, "INDESTRUCTIBLE" }, \ | | { DWOP_INDESTRUCTIBLE, "INDESTRUCTIBLE" }, \ | |
| { DWOP_INPUTONLY, "INPUTONLY" }, \ | | { DWOP_INPUTONLY, "INPUTONLY" }, \ | |
|
| | | { DWOP_STEREO_SIDE_BY_SIDE_HALF, "STEREO_SIDE_BY_SIDE_HALF" }, \ | |
| { DWOP_SCALE, "SCALE" }, \ | | { DWOP_SCALE, "SCALE" }, \ | |
| { DWOP_KEEP_ABOVE, "KEEP_ABOVE" }, \ | | { DWOP_KEEP_ABOVE, "KEEP_ABOVE" }, \ | |
| { DWOP_KEEP_UNDER, "KEEP_UNDER" }, \ | | { DWOP_KEEP_UNDER, "KEEP_UNDER" }, \ | |
| { DWOP_FOLLOW_BOUNDS, "FOLLOW_BOUNDS" }, \ | | { DWOP_FOLLOW_BOUNDS, "FOLLOW_BOUNDS" }, \ | |
| { DWOP_NONE, "NONE" } \ | | { DWOP_NONE, "NONE" } \ | |
| }; | | }; | |
| | | | |
| struct DFBScreenCapabilitiesName { | | struct DFBScreenCapabilitiesName { | |
| DFBScreenCapabilities capability; | | DFBScreenCapabilities capability; | |
| const char *name; | | const char *name; | |
| | | | |
| skipping to change at line 299 | | skipping to change at line 302 | |
| { DSECAPS_SCANMODE, "SCANMODE" }, \ | | { DSECAPS_SCANMODE, "SCANMODE" }, \ | |
| { DSECAPS_FREQUENCY, "FREQUENCY" }, \ | | { DSECAPS_FREQUENCY, "FREQUENCY" }, \ | |
| { DSECAPS_BRIGHTNESS, "BRIGHTNESS" }, \ | | { DSECAPS_BRIGHTNESS, "BRIGHTNESS" }, \ | |
| { DSECAPS_CONTRAST, "CONTRAST" }, \ | | { DSECAPS_CONTRAST, "CONTRAST" }, \ | |
| { DSECAPS_HUE, "HUE" }, \ | | { DSECAPS_HUE, "HUE" }, \ | |
| { DSECAPS_SATURATION, "SATURATION" }, \ | | { DSECAPS_SATURATION, "SATURATION" }, \ | |
| { DSECAPS_CONNECTORS, "CONNECTORS" }, \ | | { DSECAPS_CONNECTORS, "CONNECTORS" }, \ | |
| { DSECAPS_SLOW_BLANKING, "SLOW_BLANKING" }, \ | | { DSECAPS_SLOW_BLANKING, "SLOW_BLANKING" }, \ | |
| { DSECAPS_RESOLUTION, "RESOLUTION" }, \ | | { DSECAPS_RESOLUTION, "RESOLUTION" }, \ | |
| { DSECAPS_FRAMING, "FRAMING" }, \ | | { DSECAPS_FRAMING, "FRAMING" }, \ | |
|
| | | { DSECAPS_ASPECT_RATIO, "ASPECT_RATIO" }, \ | |
| { DSECAPS_NONE, "NONE" } \ | | { DSECAPS_NONE, "NONE" } \ | |
| }; | | }; | |
| | | | |
| struct DFBScreenEncoderTypeName { | | struct DFBScreenEncoderTypeName { | |
| DFBScreenEncoderType type; | | DFBScreenEncoderType type; | |
| const char *name; | | const char *name; | |
| }; | | }; | |
| | | | |
| #define DirectFBScreenEncoderTypeNames(Identifier) struct DFBScreenEncoderT
ypeName Identifier[] = { \ | | #define DirectFBScreenEncoderTypeNames(Identifier) struct DFBScreenEncoderT
ypeName Identifier[] = { \ | |
| { DSET_CRTC, "CRTC" }, \ | | { DSET_CRTC, "CRTC" }, \ | |
| | | | |
| skipping to change at line 415 | | skipping to change at line 419 | |
| { DSOR_800_600, "800_600" }, \ | | { DSOR_800_600, "800_600" }, \ | |
| { DSOR_1024_768, "1024_768" }, \ | | { DSOR_1024_768, "1024_768" }, \ | |
| { DSOR_1152_864, "1152_864" }, \ | | { DSOR_1152_864, "1152_864" }, \ | |
| { DSOR_1280_720, "1280_720" }, \ | | { DSOR_1280_720, "1280_720" }, \ | |
| { DSOR_1280_768, "1280_768" }, \ | | { DSOR_1280_768, "1280_768" }, \ | |
| { DSOR_1280_960, "1280_960" }, \ | | { DSOR_1280_960, "1280_960" }, \ | |
| { DSOR_1280_1024, "1280_1024" }, \ | | { DSOR_1280_1024, "1280_1024" }, \ | |
| { DSOR_1400_1050, "1400_1050" }, \ | | { DSOR_1400_1050, "1400_1050" }, \ | |
| { DSOR_1600_1200, "1600_1200" }, \ | | { DSOR_1600_1200, "1600_1200" }, \ | |
| { DSOR_1920_1080, "1920_1080" }, \ | | { DSOR_1920_1080, "1920_1080" }, \ | |
|
| | | { DSOR_960_540, "960_540" }, \ | |
| | | { DSOR_1440_540, "1440_540" }, \ | |
| { DSOR_UNKNOWN, "UNKNOWN" } \ | | { DSOR_UNKNOWN, "UNKNOWN" } \ | |
| }; | | }; | |
| | | | |
| struct DFBScreenMixerCapabilitiesName { | | struct DFBScreenMixerCapabilitiesName { | |
| DFBScreenMixerCapabilities capability; | | DFBScreenMixerCapabilities capability; | |
| const char *name; | | const char *name; | |
| }; | | }; | |
| | | | |
| #define DirectFBScreenMixerCapabilitiesNames(Identifier) struct DFBScreenMi
xerCapabilitiesName Identifier[] = { \ | | #define DirectFBScreenMixerCapabilitiesNames(Identifier) struct DFBScreenMi
xerCapabilitiesName Identifier[] = { \ | |
| { DSMCAPS_FULL, "FULL" }, \ | | { DSMCAPS_FULL, "FULL" }, \ | |
| | | | |
| skipping to change at line 492 | | skipping to change at line 498 | |
| { 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_FRAMING, "FRAMING" }, \ | |
|
| | | { DSECONF_ASPECT_RATIO, "ASPECT_RATIO" }, \ | |
| { 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 513 | | skipping to change at line 520 | |
| { DSEF_50HZ, "50HZ" }, \ | | { DSEF_50HZ, "50HZ" }, \ | |
| { DSEF_59_94HZ, "59_94HZ" }, \ | | { DSEF_59_94HZ, "59_94HZ" }, \ | |
| { DSEF_60HZ, "60HZ" }, \ | | { DSEF_60HZ, "60HZ" }, \ | |
| { DSEF_75HZ, "75HZ" }, \ | | { DSEF_75HZ, "75HZ" }, \ | |
| { DSEF_30HZ, "30HZ" }, \ | | { DSEF_30HZ, "30HZ" }, \ | |
| { DSEF_24HZ, "24HZ" }, \ | | { DSEF_24HZ, "24HZ" }, \ | |
| { DSEF_23_976HZ, "23_976HZ" }, \ | | { DSEF_23_976HZ, "23_976HZ" }, \ | |
| { DSEF_UNKNOWN, "UNKNOWN" } \ | | { DSEF_UNKNOWN, "UNKNOWN" } \ | |
| }; | | }; | |
| | | | |
|
| | | struct DFBScreenEncoderPictureFramingName { | |
| | | DFBScreenEncoderPictureFraming framing; | |
| | | const char *name; | |
| | | }; | |
| | | | |
| | | #define DirectFBScreenEncoderPictureFramingNames(Identifier) struct DFBScre | |
| | | enEncoderPictureFramingName Identifier[] = { \ | |
| | | { DSEPF_MONO, "MONO" }, \ | |
| | | { DSEPF_STEREO_SIDE_BY_SIDE_HALF, "STEREO_SIDE_BY_SIDE_HALF" }, \ | |
| | | { DSEPF_STEREO_TOP_AND_BOTTOM, "STEREO_TOP_AND_BOTTOM" }, \ | |
| | | { DSEPF_STEREO_FRAME_PACKING, "STEREO_FRAME_PACKING" }, \ | |
| | | { DSEPF_STEREO_SIDE_BY_SIDE_FULL, "STEREO_SIDE_BY_SIDE_FULL" }, \ | |
| | | { DSEPF_UNKNOWN, "UNKNOWN" } \ | |
| | | }; | |
| | | | |
| struct DFBAccelerationMaskName { | | struct DFBAccelerationMaskName { | |
| 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" }, \ | |
| | | | |
End of changes. 6 change blocks. |
| 0 lines changed or deleted | | 22 lines changed or added | |
|
| state.h | | state.h | |
| | | | |
| skipping to change at line 51 | | skipping to change at line 51 | |
| #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> | |
| | | | |
| #include <gfx/generic/generic.h> | | #include <gfx/generic/generic.h> | |
| | | | |
| #include <misc/conf.h> | | #include <misc/conf.h> | |
| #include <misc/util.h> | | #include <misc/util.h> | |
| | | | |
| typedef enum { | | typedef enum { | |
|
| | | SMF_NONE = 0x00000000, | |
| | | | |
| SMF_DRAWING_FLAGS = 0x00000001, | | SMF_DRAWING_FLAGS = 0x00000001, | |
| SMF_BLITTING_FLAGS = 0x00000002, | | SMF_BLITTING_FLAGS = 0x00000002, | |
| SMF_CLIP = 0x00000004, | | SMF_CLIP = 0x00000004, | |
| SMF_COLOR = 0x00000008, | | SMF_COLOR = 0x00000008, | |
| SMF_SRC_BLEND = 0x00000010, | | SMF_SRC_BLEND = 0x00000010, | |
| SMF_DST_BLEND = 0x00000020, | | SMF_DST_BLEND = 0x00000020, | |
| SMF_SRC_COLORKEY = 0x00000040, | | SMF_SRC_COLORKEY = 0x00000040, | |
| SMF_DST_COLORKEY = 0x00000080, | | SMF_DST_COLORKEY = 0x00000080, | |
| | | | |
| SMF_DESTINATION = 0x00000100, | | SMF_DESTINATION = 0x00000100, | |
| | | | |
| skipping to change at line 84 | | skipping to change at line 86 | |
| SMF_DST_COLORKEY_EXTENDED = 0x00080000, | | SMF_DST_COLORKEY_EXTENDED = 0x00080000, | |
| | | | |
| SMF_SOURCE2 = 0x00100000, | | SMF_SOURCE2 = 0x00100000, | |
| SMF_SRC_CONVOLUTION = 0x00200000, | | SMF_SRC_CONVOLUTION = 0x00200000, | |
| | | | |
| SMF_ROP_CODE = 0x01000000, | | SMF_ROP_CODE = 0x01000000, | |
| SMF_ROP_FG_COLOR = 0x02000000, | | SMF_ROP_FG_COLOR = 0x02000000, | |
| SMF_ROP_BG_COLOR = 0x04000000, | | SMF_ROP_BG_COLOR = 0x04000000, | |
| SMF_ROP_PATTERN = 0x08000000, | | SMF_ROP_PATTERN = 0x08000000, | |
| | | | |
|
| SMF_ALL = 0x0F3FFFFF | | SMF_FROM = 0x10000000, | |
| | | SMF_TO = 0x20000000, | |
| | | | |
| | | SMF_ALL = 0x3F3FFFFF | |
| } 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 */ | |
| CSF_SOURCE_MASK_LOCKED = 0x00000020, /* source mask surface is lock
ed */ | | CSF_SOURCE_MASK_LOCKED = 0x00000020, /* source mask surface is lock
ed */ | |
| | | | |
| CSF_SOURCE2 = 0x00000100, /* source2 is set using dfb_st
ate_set_source2() */ | | CSF_SOURCE2 = 0x00000100, /* source2 is set using dfb_st
ate_set_source2() */ | |
| CSF_SOURCE2_LOCKED = 0x00000200, /* source2 surface is locked *
/ | | CSF_SOURCE2_LOCKED = 0x00000200, /* source2 surface is locked *
/ | |
| | | | |
|
| | | CSF_DESTINATION_LOCKED = 0x00001000, /* destination surface is lock | |
| | | ed */ | |
| | | | |
| CSF_DRAWING = 0x00010000, /* something has been rendered
with this state, | | CSF_DRAWING = 0x00010000, /* something has been rendered
with this state, | |
| this is cleared by flushing
the state, e.g. upon flip */ | | this is cleared by flushing
the state, e.g. upon flip */ | |
| | | | |
|
| CSF_ALL = 0x0001033B | | CSF_ALL = 0x0001133B | |
| } CardStateFlags; | | } CardStateFlags; | |
| | | | |
| struct _CardState { | | struct _CardState { | |
| int magic; | | int magic; | |
| | | | |
| CoreDFB *core; | | CoreDFB *core; | |
| CoreGraphicsDevice *device; | | CoreGraphicsDevice *device; | |
| FusionID fusion_id; | | FusionID fusion_id; | |
| | | | |
| pthread_mutex_t lock; /* lock for state handling */ | | pthread_mutex_t lock; /* lock for state handling */ | |
| | | | |
| skipping to change at line 156 | | skipping to change at line 163 | |
| DFBAccelerationMask accel; /* remember checked commands i
f they are accelerated */ | | DFBAccelerationMask accel; /* remember checked commands i
f they are accelerated */ | |
| DFBAccelerationMask checked; /* commands for which a state
has been checked */ | | DFBAccelerationMask checked; /* commands for which a state
has been checked */ | |
| DFBAccelerationMask set; /* commands for which a state
is valid */ | | DFBAccelerationMask set; /* commands for which a state
is valid */ | |
| DFBAccelerationMask disabled; /* commands which are disabled
temporarily */ | | DFBAccelerationMask disabled; /* commands which are disabled
temporarily */ | |
| | | | |
| CoreGraphicsSerial serial; /* hardware serial of the last
operation */ | | CoreGraphicsSerial serial; /* hardware serial of the last
operation */ | |
| | | | |
| /* from/to buffers */ | | /* from/to buffers */ | |
| | | | |
| CoreSurfaceBufferRole from; /* usually CSBR_FRONT */ | | CoreSurfaceBufferRole from; /* usually CSBR_FRONT */ | |
|
| | | DFBSurfaceStereoEye from_eye; /* usually DSSE_LEFT */ | |
| CoreSurfaceBufferRole to; /* usually CSBR_BACK */ | | CoreSurfaceBufferRole to; /* usually CSBR_BACK */ | |
|
| | | DFBSurfaceStereoEye to_eye; /* usually DSSE_LEFT */ | |
| | | | |
| /* read/write locks during operation */ | | /* read/write locks during operation */ | |
| | | | |
| CoreSurfaceBufferLock dst; | | CoreSurfaceBufferLock dst; | |
| CoreSurfaceBufferLock src; | | CoreSurfaceBufferLock src; | |
| | | | |
| /* software driver */ | | /* software driver */ | |
| | | | |
| GenefxState *gfxs; | | GenefxState *gfxs; | |
| | | | |
| | | | |
| skipping to change at line 203 | | skipping to change at line 212 | |
| DFBColor rop_bg_color; | | DFBColor rop_bg_color; | |
| u32 rop_pattern[32]; | | u32 rop_pattern[32]; | |
| DFBSurfacePatternMode rop_pattern_mode; | | DFBSurfacePatternMode rop_pattern_mode; | |
| | | | |
| DFBColorKeyExtended src_colorkey_extended; | | DFBColorKeyExtended src_colorkey_extended; | |
| DFBColorKeyExtended dst_colorkey_extended; | | DFBColorKeyExtended dst_colorkey_extended; | |
| | | | |
| s32 src_colormatrix[12]; /* transformation ma
trix for DSBLIT_SRC_COLORMATRIX (fixed 16.16) */ | | s32 src_colormatrix[12]; /* transformation ma
trix for DSBLIT_SRC_COLORMATRIX (fixed 16.16) */ | |
| | | | |
| DFBConvolutionFilter src_convolution; | | DFBConvolutionFilter src_convolution; | |
|
| | | | |
| | | void *gfxcard_data; /* gfx driver specific state da | |
| | | ta */ | |
| | | | |
| | | u32 source_flip_count; | |
| | | bool source_flip_count_used; | |
| }; | | }; | |
| | | | |
| 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_2( CardState *state, CoreSurface *source, u3
2 flip_count ); | |
| 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, | |
| | | | |
| skipping to change at line 354 | | skipping to change at line 369 | |
| s
tate, bits ) | | s
tate, bits ) | |
| | | | |
| #define dfb_state_set_rop_code(state,code) _dfb_state_set_checked( r
op_code, \ | | #define dfb_state_set_rop_code(state,code) _dfb_state_set_checked( r
op_code, \ | |
| R
OP_CODE, \ | | R
OP_CODE, \ | |
| s
tate, code ) | | s
tate, code ) | |
| | | | |
| #define dfb_state_set_rop_pattern_mode(state,mode) _dfb_state_set_checked(
rop_pattern_mode, \ | | #define dfb_state_set_rop_pattern_mode(state,mode) _dfb_state_set_checked(
rop_pattern_mode, \ | |
|
ROP_PATTERN_MODE, \ | |
ROP_PATTERN_MODE, \ | |
|
state, mode ) | |
state, mode ) | |
| | | | |
|
| | | static inline void dfb_state_set_from( CardState *state, | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye ) | |
| | | { | |
| | | D_MAGIC_ASSERT( state, CardState ); | |
| | | D_ASSERT( role == CSBR_FRONT || role == CSBR_BACK || role == CSBR_IDLE | |
| | | ); | |
| | | D_ASSERT( eye == DSSE_LEFT || eye == DSSE_RIGHT ); | |
| | | | |
| | | if (state->from != role || state->from_eye != eye) { | |
| | | state->from = role; | |
| | | state->from_eye = eye; | |
| | | state->modified = (StateModificationFlags)( state->modified | SMF | |
| | | _SOURCE | SMF_SOURCE2 | SMF_SOURCE_MASK | SMF_FROM ); | |
| | | } | |
| | | } | |
| | | | |
| | | static inline void dfb_state_set_to( CardState *state, | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye ) | |
| | | { | |
| | | D_MAGIC_ASSERT( state, CardState ); | |
| | | D_ASSERT( role == CSBR_FRONT || role == CSBR_BACK || role == CSBR_IDLE | |
| | | ); | |
| | | D_ASSERT( eye == DSSE_LEFT || eye == DSSE_RIGHT ); | |
| | | | |
| | | if (state->to != role || state->to_eye != eye) { | |
| | | state->to = role; | |
| | | state->to_eye = eye; | |
| | | state->modified = (StateModificationFlags)( state->modified | SMF | |
| | | _DESTINATION | SMF_TO ); | |
| | | } | |
| | | } | |
| | | | |
| 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 405 | | skipping to change at line 450 | |
| } | | } | |
| } | | } | |
| | | | |
| 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
_COLOR ); | | state->modified = (StateModificationFlags)( state->modified | SMF
_COLORKEY ); | |
| } | | } | |
| } | | } | |
| | | | |
| 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. 10 change blocks. |
| 3 lines changed or deleted | | 54 lines changed or added | |
|
| surface.h | | surface.h | |
| /* | | /* | |
|
| (c) Copyright 2001-2010 The world wide DirectFB Open Source Community (
directfb.org) | | (c) Copyright 2001-2012 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 57 | | skipping to change at line 57 | |
| CSNF_SIZEFORMAT = 0x00000001, /* width, height, format */ | | CSNF_SIZEFORMAT = 0x00000001, /* width, height, format */ | |
| CSNF_SYSTEM = 0x00000002, /* system instance information */ | | CSNF_SYSTEM = 0x00000002, /* system instance information */ | |
| CSNF_VIDEO = 0x00000004, /* video instance information */ | | CSNF_VIDEO = 0x00000004, /* video instance information */ | |
| CSNF_DESTROY = 0x00000008, /* surface is about to be destroyed
*/ | | CSNF_DESTROY = 0x00000008, /* surface is about to be destroyed
*/ | |
| CSNF_FLIP = 0x00000010, /* surface buffer pointer swapped *
/ | | CSNF_FLIP = 0x00000010, /* surface buffer pointer swapped *
/ | |
| CSNF_FIELD = 0x00000020, /* active (displayed) field switche
d */ | | CSNF_FIELD = 0x00000020, /* active (displayed) field switche
d */ | |
| CSNF_PALETTE_CHANGE = 0x00000040, /* another palette has been set */ | | CSNF_PALETTE_CHANGE = 0x00000040, /* another palette has been set */ | |
| CSNF_PALETTE_UPDATE = 0x00000080, /* current palette has been altered
*/ | | CSNF_PALETTE_UPDATE = 0x00000080, /* current palette has been altered
*/ | |
| CSNF_ALPHA_RAMP = 0x00000100, /* alpha ramp was modified */ | | CSNF_ALPHA_RAMP = 0x00000100, /* alpha ramp was modified */ | |
| CSNF_DISPLAY = 0x00000200, /* surface buffer displayed */ | | CSNF_DISPLAY = 0x00000200, /* surface buffer displayed */ | |
|
| | | CSNF_FRAME = 0x00000400, /* flip count ack */ | |
| | | CSNF_BUFFER_ALLOCATION_DESTROY | |
| | | = 0x00000800, /* Buffer allocation about to be de | |
| | | stroyed */ | |
| | | | |
|
| CSNF_ALL = 0x000003FF | | CSNF_ALL = 0x00000FFF | |
| } CoreSurfaceNotificationFlags; | | } CoreSurfaceNotificationFlags; | |
| | | | |
| typedef struct { | | typedef struct { | |
| CoreSurfaceNotificationFlags flags; | | CoreSurfaceNotificationFlags flags; | |
| CoreSurface *surface; | | CoreSurface *surface; | |
| | | | |
|
| | | /* The following field is used only by the CSNF_DISPLAY message. */ | |
| int index; | | int index; | |
|
| | | | |
| | | /* The following fields are used only by the CSNF_BUFFER_ALLOCATION_DE | |
| | | STROY message. */ | |
| | | CoreSurfaceBuffer *buffer_no_access; /* Pointer to associated CoreSur | |
| | | faceBuffer being | |
| | | destroyed. Do not dereference | |
| | | . */ | |
| | | void *surface_data; /* CoreSurface's shared driver s | |
| | | pecific data. */ | |
| | | int surface_object_id; /* CoreSurface's Fusion ID. */ | |
| | | | |
| | | unsigned int flip_count; | |
| } CoreSurfaceNotification; | | } CoreSurfaceNotification; | |
| | | | |
| typedef enum { | | typedef enum { | |
|
| | | CSCH_NOTIFICATION, | |
| | | CSCH_EVENT, | |
| | | } CoreSurfaceChannel; | |
| | | | |
| | | 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_COLORSPACE = 0x00000008, | |
| | | | |
| CSCONF_PREALLOCATED = 0x00000010, | | CSCONF_PREALLOCATED = 0x00000010, | |
| | | | |
| CSCONF_ALL = 0x0000001F | | CSCONF_ALL = 0x0000001F | |
| | | | |
| skipping to change at line 108 | | skipping to change at line 125 | |
| | | | |
| typedef struct { | | typedef struct { | |
| CoreSurfaceConfigFlags flags; | | CoreSurfaceConfigFlags flags; | |
| | | | |
| DFBDimension size; | | DFBDimension size; | |
| DFBSurfacePixelFormat format; | | DFBSurfacePixelFormat format; | |
| DFBSurfaceColorSpace colorspace; | | DFBSurfaceColorSpace colorspace; | |
| DFBSurfaceCapabilities caps; | | DFBSurfaceCapabilities caps; | |
| | | | |
| struct { | | struct { | |
|
| void *addr; | | void *addr; /* " */ | |
| int pitch; | | unsigned long phys; /* " */ | |
| unsigned long handle; | | unsigned long offset; /* " */ | |
| | | 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 216 | | skipping to change at line 238 | |
| | | | |
| int field; | | int field; | |
| u8 alpha_ramp[4]; | | u8 alpha_ramp[4]; | |
| | | | |
| CoreSurfaceBuffer **buffers; | | CoreSurfaceBuffer **buffers; | |
| CoreSurfaceBuffer *left_buffers[MAX_SURFACE_BUFFERS]; | | CoreSurfaceBuffer *left_buffers[MAX_SURFACE_BUFFERS]; | |
| CoreSurfaceBuffer *right_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; | | u32 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. */ | |
| | | | |
| FusionCall call; | | FusionCall call; | |
|
| | | | |
| | | FusionVector clients; | |
| | | u32 flips_acked; | |
| }; | | }; | |
| | | | |
|
| | | #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 265 | | skipping to change at line 295 | |
| | | | |
| 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
, | |
| CoreSurfaceNotificationFlags flags); | | CoreSurfaceNotificationFlags flags); | |
| | | | |
| DFBResult dfb_surface_notify_display( CoreSurface *surface
, | | DFBResult dfb_surface_notify_display( CoreSurface *surface
, | |
| CoreSurfaceBuffer *buffer)
; | | CoreSurfaceBuffer *buffer)
; | |
| | | | |
|
| | | DFBResult dfb_surface_notify_frame ( CoreSurface *surface | |
| | | , | |
| | | unsigned int flip_co | |
| | | unt ); | |
| | | | |
| | | /* | |
| | | Prepares and sends a notification message that a change is about to ha | |
| | | ppen to the specified | |
| | | surface buffer pool allocation. The notification message will be rece | |
| | | ived by all pocesses | |
| | | that have listeners attached to the associated CoreSurface's reactor. | |
| | | | |
| | | At present, only THE CSNF_BUFFER_ALLOCATION_DESTROY message is handled | |
| | | . | |
| | | */ | |
| | | DFBResult dfb_surface_pool_notify ( CoreSurface *surface | |
| | | , | |
| | | CoreSurfaceBuffer *buffer, | |
| | | CoreSurfaceAllocation *allocat | |
| | | ion, | |
| | | CoreSurfaceNotificationFlags flags ) | |
| | | ; | |
| | | | |
| DFBResult dfb_surface_flip ( CoreSurface *surface
, | | DFBResult dfb_surface_flip ( CoreSurface *surface
, | |
| bool swap ); | | bool swap ); | |
| | | | |
|
| | | DFBResult dfb_surface_dispatch_event( CoreSurface *surface | |
| | | , | |
| | | DFBSurfaceEventType type ); | |
| | | | |
| | | DFBResult dfb_surface_dispatch_update( CoreSurface *surfac | |
| | | e, | |
| | | const DFBRegion *update | |
| | | , | |
| | | const DFBRegion *update | |
| | | _right ); | |
| | | | |
| 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_destroy ( 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_lock_buffer2 ( CoreSurface *surface | |
| | | , | |
| | | CoreSurfaceBufferRole role, | |
| | | u32 flip_co | |
| | | unt, | |
| | | DFBSurfaceStereoEye eye, | |
| | | CoreSurfaceAccessorID accesso | |
| | | r, | |
| | | CoreSurfaceAccessFlags access, | |
| | | 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
, | |
| CoreSurfaceBufferRole role, | | CoreSurfaceBufferRole role, | |
| void *destina
tion, | | void *destina
tion, | |
| int pitch, | | int pitch, | |
| const DFBRectangle *rect ); | | const DFBRectangle *rect ); | |
| | | | |
| DFBResult dfb_surface_write_buffer ( CoreSurface *surface
, | | DFBResult dfb_surface_write_buffer ( CoreSurface *surface
, | |
| CoreSurfaceBufferRole role, | | CoreSurfaceBufferRole role, | |
| const void *source, | | const void *source, | |
| int pitch, | | int pitch, | |
| const DFBRectangle *rect ); | | const DFBRectangle *rect ); | |
| | | | |
| DFBResult dfb_surface_dump_buffer ( CoreSurface *surface
, | | DFBResult dfb_surface_dump_buffer ( CoreSurface *surface
, | |
| CoreSurfaceBufferRole role, | | CoreSurfaceBufferRole role, | |
| const char *path, | | const char *path, | |
| const char *prefix
); | | const char *prefix
); | |
| | | | |
|
| | | DFBResult dfb_surface_dump_buffer2 ( CoreSurface *surface | |
| | | , | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye, | |
| | | const char *path, | |
| | | const char *prefix | |
| | | ); | |
| | | | |
| DFBResult dfb_surface_set_palette ( CoreSurface *surface
, | | DFBResult dfb_surface_set_palette ( CoreSurface *surface
, | |
| CorePalette *palette
); | | CorePalette *palette
); | |
| | | | |
| 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 ); | |
| | | | |
|
| static inline DirectResult | | DFBResult dfb_surface_clear_buffers ( CoreSurface *surfac | |
| | | e ); | |
| | | | |
| | | 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 ) | |
| { | | { | |
| D_MAGIC_ASSERT( surface, CoreSurface ); | | D_MAGIC_ASSERT( surface, CoreSurface ); | |
| | | | |
| return fusion_skirmish_swoop( &surface->lock ); | | return fusion_skirmish_swoop( &surface->lock ); | |
| } | | } | |
| | | | |
|
| static inline DirectResult | | static __inline__ DirectResult | |
| dfb_surface_unlock( CoreSurface *surface ) | | dfb_surface_unlock( CoreSurface *surface ) | |
| { | | { | |
| D_MAGIC_ASSERT( surface, CoreSurface ); | | D_MAGIC_ASSERT( surface, CoreSurface ); | |
| | | | |
| return fusion_skirmish_dismiss( &surface->lock ); | | return fusion_skirmish_dismiss( &surface->lock ); | |
| } | | } | |
| | | | |
|
| static inline CoreSurfaceBuffer * | | static __inline__ CoreSurfaceBuffer * | |
| dfb_surface_get_buffer( CoreSurface *surface, | | dfb_surface_get_buffer( CoreSurface *surface, | |
| CoreSurfaceBufferRole role ) | | CoreSurfaceBufferRole role ) | |
| { | | { | |
| D_MAGIC_ASSERT( surface, CoreSurface ); | | D_MAGIC_ASSERT( surface, CoreSurface ); | |
| D_ASSERT( role == CSBR_FRONT || role == CSBR_BACK || role == CSBR_IDLE
); | | D_ASSERT( role == CSBR_FRONT || role == CSBR_BACK || role == CSBR_IDLE
); | |
| | | | |
| D_ASSERT( surface->num_buffers > 0 ); | | D_ASSERT( surface->num_buffers > 0 ); | |
| | | | |
| return surface->buffers[ surface->buffer_indices[(surface->flips + rol
e) % surface->num_buffers] ]; | | return surface->buffers[ surface->buffer_indices[(surface->flips + rol
e) % surface->num_buffers] ]; | |
| } | | } | |
| | | | |
|
| static inline void * | | static __inline__ CoreSurfaceBuffer * | |
| | | dfb_surface_get_buffer2( CoreSurface *surface, | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye ) | |
| | | { | |
| | | D_MAGIC_ASSERT( surface, CoreSurface ); | |
| | | D_ASSERT( role == CSBR_FRONT || role == CSBR_BACK || role == CSBR_IDLE | |
| | | ); | |
| | | D_ASSERT( eye == DSSE_LEFT || eye == DSSE_RIGHT ); | |
| | | | |
| | | D_ASSERT( surface->num_buffers > 0 ); | |
| | | | |
| | | if (eye == DSSE_LEFT) | |
| | | return surface->left_buffers[ surface->buffer_indices[(surface->f | |
| | | lips + role) % surface->num_buffers] ]; | |
| | | | |
| | | return surface->right_buffers[ surface->buffer_indices[(surface->flips | |
| | | + role) % surface->num_buffers] ]; | |
| | | } | |
| | | | |
| | | static __inline__ CoreSurfaceBuffer * | |
| | | dfb_surface_get_buffer3( CoreSurface *surface, | |
| | | CoreSurfaceBufferRole role, | |
| | | DFBSurfaceStereoEye eye, | |
| | | u32 flip_count ) | |
| | | { | |
| | | D_MAGIC_ASSERT( surface, CoreSurface ); | |
| | | D_ASSERT( role == CSBR_FRONT || role == CSBR_BACK || role == CSBR_IDLE | |
| | | ); | |
| | | D_ASSERT( eye == DSSE_LEFT || eye == DSSE_RIGHT ); | |
| | | | |
| | | D_ASSERT( surface->num_buffers > 0 ); | |
| | | | |
| | | if (eye == DSSE_LEFT) | |
| | | return surface->left_buffers[ surface->buffer_indices[(flip_count | |
| | | + role) % surface->num_buffers] ]; | |
| | | | |
| | | return surface->right_buffers[ surface->buffer_indices[(flip_count + r | |
| | | ole) % surface->num_buffers] ]; | |
| | | } | |
| | | | |
| | | static __inline__ void * | |
| dfb_surface_data_offset( const CoreSurface *surface, | | dfb_surface_data_offset( const CoreSurface *surface, | |
| void *data, | | void *data, | |
| int pitch, | | int pitch, | |
| int x, | | int x, | |
| int y ) | | int y ) | |
| { | | { | |
| D_ASSERT( surface != NULL ); | | D_ASSERT( surface != NULL ); | |
| D_ASSERT( data != NULL ); | | D_ASSERT( data != NULL ); | |
| D_ASSERT( pitch > 0 ); | | D_ASSERT( pitch > 0 ); | |
| D_ASSERT( x >= 0 ); | | D_ASSERT( x >= 0 ); | |
| | | | |
| skipping to change at line 372 | | skipping to change at line 479 | |
| if (surface->config.caps & DSCAPS_SEPARATED) { | | if (surface->config.caps & DSCAPS_SEPARATED) { | |
| if (y & 1) | | if (y & 1) | |
| y += surface->config.size.h; | | y += surface->config.size.h; | |
| | | | |
| y >>= 1; | | y >>= 1; | |
| } | | } | |
| | | | |
| return (u8*)data + pitch * y + DFB_BYTES_PER_LINE( surface->config.for
mat, x ); | | return (u8*)data + pitch * y + DFB_BYTES_PER_LINE( surface->config.for
mat, x ); | |
| } | | } | |
| | | | |
|
| static inline void | | static __inline__ void | |
| dfb_surface_calc_buffer_size( CoreSurface *surface, | | dfb_surface_calc_buffer_size( CoreSurface *surface, | |
| int byte_align, | | int byte_align, | |
| int pixel_align, | | int pixel_align, | |
| int *ret_pitch, | | int *ret_pitch, | |
| int *ret_size ) | | int *ret_size ) | |
| { | | { | |
| DFBSurfacePixelFormat format; | | DFBSurfacePixelFormat format; | |
| int width; | | int width; | |
| int pitch; | | int pitch; | |
| | | | |
| | | | |
| skipping to change at line 397 | | skipping to change at line 504 | |
| width = direct_util_align( surface->config.size.w, pixel_align ); | | width = direct_util_align( surface->config.size.w, pixel_align ); | |
| pitch = direct_util_align( DFB_BYTES_PER_LINE( format, width ), byte_a
lign ); | | pitch = direct_util_align( DFB_BYTES_PER_LINE( format, width ), byte_a
lign ); | |
| | | | |
| if (ret_pitch) | | if (ret_pitch) | |
| *ret_pitch = pitch; | | *ret_pitch = pitch; | |
| | | | |
| if (ret_size) | | if (ret_size) | |
| *ret_size = pitch * DFB_PLANE_MULTIPLY( format, surface->config.s
ize.h ); | | *ret_size = pitch * DFB_PLANE_MULTIPLY( format, surface->config.s
ize.h ); | |
| } | | } | |
| | | | |
|
| static inline void | | static __inline__ void | |
| dfb_surface_caps_apply_policy( CoreSurfacePolicy policy, | | dfb_surface_caps_apply_policy( CoreSurfacePolicy policy, | |
| DFBSurfaceCapabilities *caps ) | | DFBSurfaceCapabilities *caps ) | |
| { | | { | |
| switch (policy) { | | switch (policy) { | |
| case CSP_SYSTEMONLY: | | case CSP_SYSTEMONLY: | |
| *caps = (DFBSurfaceCapabilities)((*caps & ~DSCAPS_VIDEOONLY)
| DSCAPS_SYSTEMONLY); | | *caps = (DFBSurfaceCapabilities)((*caps & ~DSCAPS_VIDEOONLY)
| DSCAPS_SYSTEMONLY); | |
| break; | | break; | |
| | | | |
| case CSP_VIDEOONLY: | | case CSP_VIDEOONLY: | |
| *caps = (DFBSurfaceCapabilities)((*caps & ~DSCAPS_SYSTEMONLY
) | DSCAPS_VIDEOONLY); | | *caps = (DFBSurfaceCapabilities)((*caps & ~DSCAPS_SYSTEMONLY
) | DSCAPS_VIDEOONLY); | |
| break; | | break; | |
| | | | |
| default: | | default: | |
| *caps = (DFBSurfaceCapabilities)(*caps & ~(DSCAPS_SYSTEMONLY
| DSCAPS_VIDEOONLY)); | | *caps = (DFBSurfaceCapabilities)(*caps & ~(DSCAPS_SYSTEMONLY
| DSCAPS_VIDEOONLY)); | |
| break; | | break; | |
| } | | } | |
| } | | } | |
| | | | |
|
| static inline DFBResult | | static __inline__ DFBResult | |
| dfb_surface_resize( CoreSurface *surface, | | dfb_surface_resize( CoreSurface *surface, | |
| int width, | | int width, | |
| int height ) | | int height ) | |
| { | | { | |
| CoreSurfaceConfig config; | | CoreSurfaceConfig config; | |
| | | | |
| D_MAGIC_ASSERT( surface, CoreSurface ); | | D_MAGIC_ASSERT( surface, CoreSurface ); | |
| D_ASSERT( width > 0 ); | | D_ASSERT( width > 0 ); | |
| D_ASSERT( height > 0 ); | | D_ASSERT( height > 0 ); | |
| | | | |
| config.flags = CSCONF_SIZE; | | config.flags = CSCONF_SIZE; | |
| config.size.w = width; | | config.size.w = width; | |
| config.size.h = height; | | config.size.h = height; | |
| | | | |
| return dfb_surface_reconfig( surface, &config ); | | return dfb_surface_reconfig( surface, &config ); | |
| } | | } | |
| | | | |
|
| static inline DFBResult | | static __inline__ DFBResult | |
| dfb_surface_reformat( CoreSurface *surface, | | dfb_surface_reformat( CoreSurface *surface, | |
| int width, | | int width, | |
| int height, | | int height, | |
| DFBSurfacePixelFormat format ) | | DFBSurfacePixelFormat format ) | |
| { | | { | |
| CoreSurfaceConfig config; | | CoreSurfaceConfig config; | |
| | | | |
| D_MAGIC_ASSERT( surface, CoreSurface ); | | D_MAGIC_ASSERT( surface, CoreSurface ); | |
| D_ASSERT( width > 0 ); | | D_ASSERT( width > 0 ); | |
| D_ASSERT( height > 0 ); | | D_ASSERT( height > 0 ); | |
| | | | |
| skipping to change at line 463 | | skipping to change at line 570 | |
| | | | |
| /* 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. 26 change blocks. |
| 41 lines changed or deleted | | 157 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 { | |
|
| CSALF_NONE = 0x00000000, /* None of these. */ | | CSBNF_NONE = 0x00000000 | |
| | | } CoreSurfaceBufferNotificationFlags; | |
| CSALF_ONEFORALL = 0x00000001, /* Only one allocation in pool for | | | |
| all buffers. */ | | | |
| 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 | | typedef struct { | |
| ess flags (pointer to pool description). */ | | CoreSurfaceBufferNotificationFlags flags; | |
| CoreSurfaceAccessFlags accessed[_CSAID_NUM]; /* Access since | | } CoreSurfaceBufferNotification; | |
| 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; /* " */ | |
| | | | |
| CoreSurfaceBuffer *buffer; /* Set by dfb_surface_poo
l_lock() */ | | CoreSurfaceBuffer *buffer; /* Set by dfb_surface_poo
l_lock() */ | |
| CoreSurfaceAllocation *allocation; /* " */ | | CoreSurfaceAllocation *allocation; /* " */ | |
| | | | |
| void *addr; /* " */ | | void *addr; /* " */ | |
| unsigned long phys; /* " */ | | unsigned long phys; /* " */ | |
| unsigned long offset; /* " */ | | unsigned long offset; /* " */ | |
| unsigned int pitch; /* " */ | | unsigned int pitch; /* " */ | |
| | | | |
|
| void *handle; /* " */ | | void* handle; /* " */ | |
| }; | | }; | |
| | | | |
| static inline void | | static inline void | |
| dfb_surface_buffer_lock_reset( CoreSurfaceBufferLock *lock ) | | dfb_surface_buffer_lock_reset( CoreSurfaceBufferLock *lock ) | |
| { | | { | |
| D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock ); | | D_MAGIC_ASSERT( lock, CoreSurfaceBufferLock ); | |
| | | | |
| lock->buffer = NULL; | | lock->buffer = NULL; | |
| lock->allocation = NULL; | | lock->allocation = NULL; | |
| lock->addr = NULL; | | lock->addr = NULL; | |
| lock->phys = 0; | | lock->phys = 0; | |
| lock->offset = ~0; | | lock->offset = ~0; | |
| lock->pitch = 0; | | lock->pitch = 0; | |
|
| lock->handle = NULL; | | lock->handle = 0; | |
| } | | } | |
| | | | |
| static inline void | | static inline void | |
| dfb_surface_buffer_lock_init( CoreSurfaceBufferLock *lock, CoreSurfaceAcces
sorID accessor, CoreSurfaceAccessFlags access ) | | dfb_surface_buffer_lock_init( CoreSurfaceBufferLock *lock, CoreSurfaceAcces
sorID accessor, CoreSurfaceAccessFlags access ) | |
| { | | { | |
|
| D_MAGIC_SET( lock, CoreSurfaceBufferLock ); | | D_MAGIC_SET_ONLY( lock, CoreSurfaceBufferLock ); | |
| | | | |
| lock->accessor = accessor; | | lock->accessor = accessor; | |
| lock->access = access; | | lock->access = access; | |
| | | | |
| dfb_surface_buffer_lock_reset( lock ); | | dfb_surface_buffer_lock_reset( lock ); | |
| } | | } | |
| | | | |
| static inline void | | static inline void | |
| dfb_surface_buffer_lock_deinit( CoreSurfaceBufferLock *lock ) | | dfb_surface_buffer_lock_deinit( CoreSurfaceBufferLock *lock ) | |
| { | | { | |
| | | | |
| skipping to change at line 161 | | skipping to change at line 121 | |
| 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)->buffer) { | | if ((lock)->allocation) { | |
| \ | | \ | |
| D_ASSERT( (lock)->allocation != NULL ); | | /*D_ASSERT( (lock)->buffer == (lock)->allocation->buffer );* | |
| \ | | / \ | |
| 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)->allocation == NULL );
\ | | D_ASSERT( (lock)->buffer == 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. */ | |
| | | | |
|
| #if 1 | | CoreSurfaceConfig config; /* Configuration of its surfac | |
| unsigned int locked; /* Lock count. FIXME: Add fail | | e at the time of the buffer creation */ | |
| safe cleanup! */ | | CoreSurfaceTypeFlags type; | |
| #endif | | unsigned long resource_id; /* layer id, window id, or use | |
| | | r specified */ | |
| }; | | }; | |
| | | | |
|
| DFBResult dfb_surface_buffer_new ( CoreSurface *surface, | | #define CORE_SURFACE_BUFFER_ASSERT(buffer) | |
| | | \ | |
| | | 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_destroy( CoreSurfaceBuffer *buffer ); | | DFBResult dfb_surface_buffer_decouple( 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 259 | | skipping to change at line 228 | |
| if (surface->config.caps & DSCAPS_STEREO) | | if (surface->config.caps & DSCAPS_STEREO) | |
| if (surface->right_buffers[index] == buffer) | | if (surface->right_buffers[index] == buffer) | |
| return index; | | return index; | |
| } | | } | |
| | | | |
| D_ASSERT( index<MAX_SURFACE_BUFFERS ); | | D_ASSERT( index<MAX_SURFACE_BUFFERS ); | |
| | | | |
| return 0; | | return 0; | |
| } | | } | |
| | | | |
|
| DFBResult dfb_surface_allocation_update( CoreSurfaceAllocation *allocation | | FUSION_OBJECT_METHODS( CoreSurfaceBuffer, dfb_surface_buffer ) | |
| , | | | |
| CoreSurfaceAccessFlags access ); | | FusionObjectPool *dfb_surface_buffer_pool_create( const FusionWorld *world | |
| | | ); | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 15 change blocks. |
| 92 lines changed or deleted | | 39 lines changed or added | |
|