Example #1
0
/*
 * Allocates and initializes a window stack.
 */
CoreWindowStack*
dfb_windowstack_new( DisplayLayer *layer, int width, int height )
{
     CardCapabilities  caps;
     CoreWindowStack  *stack;

     DFB_ASSERT( layer != NULL );
     DFB_ASSERT( width > 0 );
     DFB_ASSERT( height > 0 );

     /* Allocate window stack data (completely shared) */
     stack = (CoreWindowStack*) shcalloc( 1, sizeof(CoreWindowStack) );

     /* Remember layer id for access to it's local data later */
     stack->layer_id = dfb_layer_id( layer );

     /* Choose window surface policy */
     if (dfb_config->window_policy != -1) {
          /* From configuration */
          stack->wsp_opaque = stack->wsp_alpha = dfb_config->window_policy;
     }
     else {
          /* Examine hardware capabilities */
          caps = dfb_gfxcard_capabilities();

          /* If blitting is supported... */
          if (caps.accel & DFXL_BLIT) {
               /* Auto video policy for opaque windows */
               stack->wsp_opaque = CSP_VIDEOHIGH;

               /* If blending is supported,
                  then use auto video policy for alpha windows */
               if (caps.blitting & DSBLIT_BLEND_ALPHACHANNEL)
                    stack->wsp_alpha = CSP_VIDEOHIGH;
          }
     }

     /* Create the pool of windows. */
     stack->pool = fusion_object_pool_create( "Window Pool",
                                              sizeof(CoreWindow),
                                              sizeof(DFBWindowEvent),
                                              window_destructor );

     /* Initialize the modify/update lock */
     skirmish_init( &stack->lock );

     /* Set default acceleration */
     stack->cursor.numerator   = 2;
     stack->cursor.denominator = 1;
     stack->cursor.threshold   = 4;

     /* Setup size and cursor clipping region */
     dfb_windowstack_resize( stack, width, height );

     /* Attach to all input devices */
     dfb_input_enumerate_devices( stack_attach_devices, stack );

     return stack;
}
Example #2
0
FusionObjectPool *
unique_decoration_pool_create( const FusionWorld *world )
{
     return fusion_object_pool_create( "UniQuE Decoration Pool",
                                       sizeof(UniqueDecoration),
                                       sizeof(UniqueDecorationNotification),
                                       decoration_destructor, NULL, world );
}
Example #3
0
FusionObjectPool *
dfb_layer_region_pool_create()
{
     return fusion_object_pool_create( "Layer Region Pool",
                                       sizeof(CoreLayerRegion),
                                       sizeof(CoreLayerRegionNotification),
                                       region_destructor );
}
Example #4
0
FusionObjectPool *
dfb_layer_region_pool_create( const FusionWorld *world )
{
     return fusion_object_pool_create( "Layer Region Pool",
                                       sizeof(CoreLayerRegion),
                                       sizeof(CoreLayerRegionNotification),
                                       region_destructor, NULL, world );
}
Example #5
0
FusionObjectPool *
dfb_surface_pool_create( const FusionWorld *world )
{
     FusionObjectPool *pool;

     pool = fusion_object_pool_create( "Surface Pool",
                                       sizeof(CoreSurface),
                                       sizeof(CoreSurfaceNotification),
                                       surface_destructor, NULL, world );

     return pool;
}
Example #6
0
FusionObjectPool *
dfb_palette_pool_create( const FusionWorld *world )
{
     FusionObjectPool *pool;

     pool = fusion_object_pool_create( "Palette Pool",
                                       sizeof(CorePalette),
                                       sizeof(CorePaletteNotification),
                                       palette_destructor, NULL, world );

     return pool;
}
Example #7
0
FusionObjectPool *
dfb_surface_client_pool_create( const FusionWorld *world )
{
     FusionObjectPool *pool;

     pool = fusion_object_pool_create( "Surface Client Pool",
                                       sizeof(CoreSurfaceClient),
                                       0,
                                       surface_client_destructor, NULL, world );

     return pool;
}
Example #8
0
FusionObjectPool *
coma_thread_pool_create( Coma *coma )
{
     return fusion_object_pool_create( "Thread", sizeof(ComaThread), sizeof(void*),
                                       thread_destructor, coma, coma_world(coma) );
}