MetaShadowFactory

MetaShadowFactory — Create and cache shadow textures for abritrary window shapes

Signals

void changed Run Last

Object Hierarchy

    GObject
    ╰── MetaShadowFactory

Description

Functions

meta_shadow_factory_get_default ()

MetaShadowFactory *
meta_shadow_factory_get_default (void);

Returns

the global singleton shadow factory.

[transfer none]


meta_shadow_factory_set_params ()

void
meta_shadow_factory_set_params (MetaShadowFactory *factory,
                                const char *class_name,
                                gboolean focused,
                                MetaShadowParams *params);

Updates the shadow parameters for a particular class of shadows for either the focused or unfocused state. If the class name does not name an existing class, a new class will be created (the other focus state for that class will have default values assigned to it.)

Parameters

factory

a MetaShadowFactory

 

class_name

name of the class of shadow to set the params for. the default shadow classes are the names of the different theme frame types (normal, dialog, modal_dialog, utility, border, menu, attached) and in addition, popup-menu and dropdown-menu.

 

focused

whether the shadow is for a focused window

 

params

new parameter values

 

meta_shadow_factory_get_params ()

void
meta_shadow_factory_get_params (MetaShadowFactory *factory,
                                const char *class_name,
                                gboolean focused,
                                MetaShadowParams *params);

Gets the shadow parameters for a particular class of shadows for either the focused or unfocused state. If the class name does not name an existing class, default values will be returned without printing an error.

Parameters

factory

a MetaShadowFactory

 

class_name

name of the class of shadow to get the params for

 

focused

whether the shadow is for a focused window

 

params

location to store the current parameter values.

[out caller-allocates]

Types and Values

struct MetaShadowParams

struct MetaShadowParams {
  int radius;
  int top_fade;
  int x_offset;
  int y_offset;
  guint8 opacity;
};

The MetaShadowParams structure holds information about how to draw a particular style of shadow.

Members

int radius;

the radius (gaussian standard deviation) of the shadow

 

int top_fade;

if >= 0, the shadow doesn't extend above the top of the shape, and fades out over the given number of pixels

 

int x_offset;

horizontal offset of the shadow with respect to the shape being shadowed, in pixels

 

int y_offset;

vertical offset of the shadow with respect to the shape being shadowed, in pixels

 

guint8 opacity;

opacity of the shadow, from 0 to 255

 

MetaShadowFactory

typedef struct _MetaShadowFactory MetaShadowFactory;

MetaShadowFactory is used to create window shadows. It caches shadows internally so that multiple shadows created for the same shape with the same radius will share the same MetaShadow.


MetaShadowFactoryClass

typedef struct _MetaShadowFactoryClass MetaShadowFactoryClass;

Signal Details

The “changed” signal

void
user_function (MetaShadowFactory *metashadowfactory,
               gpointer           user_data)

Flags: Run Last