static DFBResult system_join( CoreDFB *core, void **data ) { DFBResult ret; void *ptr; DFBX11 *x11; DFBX11Shared *shared; D_DEBUG_AT( X11_Core, "%s()\n", __FUNCTION__ ); x11 = D_CALLOC( 1, sizeof(DFBX11) ); if (!x11) return D_OOM(); core_arena_get_shared_field( core, "x11", &ptr ); shared = ptr; /* * Local init (master and slave) */ ret = InitLocal( x11, shared, core ); if (ret) { D_FREE( x11 ); return ret; } /* * Must be set before joining the pools! */ *data = x11; /* * Slave init */ if (shared->x11image_pool) dfb_surface_pool_join( core, shared->x11image_pool, &x11SurfacePoolFuncs ); if (shared->x11window_pool) dfb_surface_pool_join( core, shared->x11window_pool, &x11WindowPoolFuncs ); #ifdef USE_GLX if (shared->glx_pool) dfb_surface_pool_join( core, shared->glx_pool, &glxSurfacePoolFuncs ); #endif if (shared->vpsmem_pool) dfb_surface_pool_join( core, shared->vpsmem_pool, &vpsmemSurfacePoolFuncs ); #ifdef USE_GLX if (shared->x11_pool_bridge) dfb_surface_pool_bridge_join( core, shared->x11_pool_bridge, &x11SurfacePoolBridgeFuncs, x11 ); #endif return DFB_OK; }
static DFBResult system_initialize( CoreDFB *core, void **ret_data ) { DFBResult ret; MesaData *mesa; MesaDataShared *shared; FusionSHMPoolShared *pool; D_ASSERT( m_data == NULL ); mesa = D_CALLOC( 1, sizeof(MesaData) ); if (!mesa) return D_OOM(); mesa->core = core; pool = dfb_core_shmpool( core ); shared = SHCALLOC( pool, 1, sizeof(MesaDataShared) ); if (!shared) { D_FREE( mesa ); return D_OOSHM(); } shared->shmpool = pool; mesa->shared = shared; m_data = mesa; if (dfb_config->vt) { ret = dfb_vt_initialize(); if (ret) return DFB_INIT; } ret = InitLocal( mesa ); if (ret) { if (dfb_config->vt) dfb_vt_shutdown( false ); return ret; } *ret_data = m_data; dfb_surface_pool_initialize( core, &mesaSurfacePoolFuncs, &shared->pool ); mesa->screen = dfb_screens_register( NULL, mesa, mesaScreenFuncs ); mesa->layer = dfb_layers_register( mesa->screen, mesa, mesaLayerFuncs ); core_arena_add_shared_field( core, "mesa", shared ); return DFB_OK; }
MxStatus MxHttpServerInitOnLocal(MxHttpServerRef server, const char *filename) { MxAssertPointer(server); MxAssertPointer(filename); MxStatus result = InitNonNet(server); MxStatusCheck(result); result = InitLocal(server, filename); return result; }
static DFBResult system_initialize( CoreDFB *core, void **ret_data ) { DFBResult ret; AndroidData *android; AndroidDataShared *shared; FusionSHMPoolShared *pool; D_ASSERT( m_data == NULL ); android = D_CALLOC( 1, sizeof(AndroidData) ); if (!android) return D_OOM(); android->core = core; pool = dfb_core_shmpool( core ); shared = SHCALLOC( pool, 1, sizeof(AndroidDataShared) ); if (!shared) { D_FREE( android ); return D_OOSHM(); } shared->shmpool = pool; android->shared = shared; m_data = android; ret = InitLocal( android ); if (ret) return ret; *ret_data = m_data; dfb_surface_pool_initialize( core, &androidSurfacePoolFuncs, &shared->pool ); android->screen = dfb_screens_register( NULL, android, androidScreenFuncs ); android->layer = dfb_layers_register( android->screen, android, androidLayerFuncs ); android->java_vm = native_data.app->activity->vm; android->app_path = D_STRDUP( native_data.app->activity->internalDataPath) ; core_arena_add_shared_field( core, "android", shared ); return DFB_OK; }
static DFBResult system_join( CoreDFB *core, void **ret_data ) { DFBResult ret; void *tmp; MesaData *mesa; MesaDataShared *shared; D_ASSERT( m_data == NULL ); if (dfb_config->vt) { ret = dfb_vt_join(); if (ret) return DFB_INIT; } mesa = D_CALLOC( 1, sizeof(MesaData) ); if (!mesa) return D_OOM(); mesa->core = core; ret = core_arena_get_shared_field( core, "mesa", &tmp ); if (ret) { D_FREE( mesa ); return ret; } mesa->shared = shared = tmp; ret = InitLocal( mesa ); if (ret) return ret; *ret_data = m_data = mesa; dfb_surface_pool_join( core, shared->pool, &mesaSurfacePoolFuncs ); mesa->screen = dfb_screens_register( NULL, mesa, mesaScreenFuncs ); mesa->layer = dfb_layers_register( mesa->screen, mesa, mesaLayerFuncs ); return DFB_OK; }
static DFBResult system_join( CoreDFB *core, void **ret_data ) { DFBResult ret; void *tmp; AndroidData *android; AndroidDataShared *shared; D_ASSERT( m_data == NULL ); android = D_CALLOC( 1, sizeof(AndroidData) ); if (!android) return D_OOM(); android->core = core; ret = core_arena_get_shared_field( core, "android", &tmp ); if (ret) { D_FREE( android ); return ret; } android->shared = shared = tmp; ret = InitLocal( android ); if (ret) return ret; *ret_data = m_data = android; dfb_surface_pool_join( core, shared->pool, &androidSurfacePoolFuncs ); android->screen = dfb_screens_register( NULL, android, androidScreenFuncs ); android->layer = dfb_layers_register( android->screen, android, androidLayerFuncs ); return DFB_OK; }
static DFBResult system_initialize( CoreDFB *core, void **data ) { DFBResult ret; DFBX11 *x11; DFBX11Shared *shared; D_DEBUG_AT( X11_Core, "%s()\n", __FUNCTION__ ); x11 = D_CALLOC( 1, sizeof(DFBX11) ); if (!x11) return D_OOM(); shared = SHCALLOC( dfb_core_shmpool( core ), 1, sizeof(DFBX11Shared) ); if (!shared) { D_FREE( x11 ); return D_OOSHM(); } /* we need the error handler to signal the error to us, so use a global static */ shared_for_error_handler = shared; XSetErrorHandler( error_handler ); /* * Local init (master and slave) */ ret = InitLocal( x11, shared, core ); if (ret) { SHFREE( dfb_core_shmpool( core ), shared ); D_FREE( x11 ); return ret; } /* * Shared init (master only) */ shared->data_shmpool = dfb_core_shmpool_data( core ); shared->screen_size.w = x11->screenptr->width; shared->screen_size.h = x11->screenptr->height; fusion_skirmish_init( &shared->lock, "X11 System", dfb_core_world(core) ); fusion_call_init( &shared->call, call_handler, x11, dfb_core_world(core) ); /* * Must be set before initializing the pools! */ *data = x11; /* * Master init */ dfb_surface_pool_initialize( core, &x11SurfacePoolFuncs, &shared->x11image_pool ); #ifdef USE_GLX dfb_surface_pool_initialize( core, &glxSurfacePoolFuncs, &shared->glx_pool ); #endif if (dfb_config->video_length) { shared->vpsmem_length = dfb_config->video_length; dfb_surface_pool_initialize( core, &vpsmemSurfacePoolFuncs, &shared->vpsmem_pool ); } #ifdef USE_GLX dfb_surface_pool_bridge_initialize( core, &x11SurfacePoolBridgeFuncs, x11, &shared->x11_pool_bridge ); #endif fusion_arena_add_shared_field( dfb_core_arena( core ), "x11", shared ); return DFB_OK; }