CafeBG: CAFE Desktop Library Reference Manual

## CafeBG CafeBG |

## Functions

CafeBG * | cafe_bg_new ()
void | cafe_bg_load_from_preferences ()
void | cafe_bg_save_to_preferences ()
void | cafe_bg_set_filename ()
void | cafe_bg_set_placement ()
void | cafe_bg_set_color ()
const gchar * | cafe_bg_get_filename ()
CafeBGPlacement | cafe_bg_get_placement ()
void | cafe_bg_get_color ()
void | cafe_bg_draw ()
gboolean | cafe_bg_get_image_size ()
GdkPixbuf * | cafe_bg_create_thumbnail ()
gboolean | cafe_bg_is_dark ()

## Signals

void | changed | Run Last
void | transitioned | Run Last

## Types and Values

| CafeBG
enum | CafeBGColorType
enum | CafeBGPlacement

## Object Hierarchy

        GObject
        ╰── CafeBG

## Includes

    #include <cafe-bg.h>

## Description

## Functions

### cafe_bg_new ()

    CafeBG *
    cafe_bg_new (void);

### cafe_bg_load_from_preferences ()

    void
    cafe_bg_load_from_preferences (CafeBG *bg);

### cafe_bg_save_to_preferences ()

    void
    cafe_bg_save_to_preferences (CafeBG *bg);

### cafe_bg_set_filename ()

    void
    cafe_bg_set_filename (CafeBG *bg,
                          const char *filename);

### cafe_bg_set_placement ()

    void
    cafe_bg_set_placement (CafeBG *bg,
                           CafeBGPlacement placement);

### cafe_bg_set_color ()

    void
    cafe_bg_set_color (CafeBG *bg,
                       CafeBGColorType type,
                       CdkRGBA *primary,
                       CdkRGBA *secondary);

### cafe_bg_get_filename ()

    const gchar *
    cafe_bg_get_filename (CafeBG *bg);

### cafe_bg_get_placement ()

    CafeBGPlacement
    cafe_bg_get_placement (CafeBG *bg);

### cafe_bg_get_color ()

    void
    cafe_bg_get_color (CafeBG *bg,
                       CafeBGColorType *type,
                       CdkRGBA *primary,
                       CdkRGBA *secondary);

### cafe_bg_draw ()

    void
    cafe_bg_draw (CafeBG *bg,
                  GdkPixbuf *dest,
                  CdkScreen *screen,
                  gboolean is_root);

### cafe_bg_get_image_size ()

    gboolean
    cafe_bg_get_image_size (CafeBG *bg,
                            CafeDesktopThumbnailFactory *factory,
                            int best_width,
                            int best_height,
                            int *width,
                            int *height);

### cafe_bg_create_thumbnail ()

    GdkPixbuf *
    cafe_bg_create_thumbnail (CafeBG *bg,
                              CafeDesktopThumbnailFactory *factory,
                              CdkScreen *screen,
                              int dest_width,
                              int dest_height);

#### Returns

a GdkPixbuf showing the background as a thumbnail.

[transfer full]

### cafe_bg_is_dark ()

    gboolean
    cafe_bg_is_dark (CafeBG *bg,
                     int dest_width,
                     int dest_height);

## Types and Values

### CafeBG

    typedef struct _CafeBG CafeBG;

### enum CafeBGColorType

#### Members

CAFE_BG_COLOR_SOLID |  |
CAFE_BG_COLOR_H_GRADIENT |  |
CAFE_BG_COLOR_V_GRADIENT |  |

### enum CafeBGPlacement

#### Members

CAFE_BG_PLACEMENT_TILED |  |
CAFE_BG_PLACEMENT_ZOOMED |  |
CAFE_BG_PLACEMENT_CENTERED |  |
CAFE_BG_PLACEMENT_SCALED |  |
CAFE_BG_PLACEMENT_FILL_SCREEN |  |
CAFE_BG_PLACEMENT_SPANNED |  |

## Signal Details

### The `“changed”` signal

    void
    user_function (CafeBG  *cafebg,
                   gpointer user_data)

Flags: Run Last

### The `“transitioned”` signal

    void
    user_function (CafeBG  *cafebg,
                   gpointer user_data)

Flags: Run Last