## HippoCanvasContext

HippoCanvasContext

## Synopsis

    #include <hippo/hippo-canvas-context.h>

    enum                HippoStockColor;
                        HippoCanvasContext;
                        HippoCanvasContextIface;
    PangoLayout*        hippo_canvas_context_create_layout  (HippoCanvasContext *context);
    cairo_surface_t*    hippo_canvas_context_load_image     (HippoCanvasContext *context,
                                                             const char *image_name);
    guint32             hippo_canvas_context_get_color      (HippoCanvasContext *context,
                                                             HippoStockColor color);
    void                hippo_canvas_context_register_widget_item
                                                            (HippoCanvasContext *context,
                                                             HippoCanvasItem *item);
    void                hippo_canvas_context_unregister_widget_item
                                                            (HippoCanvasContext *context,
                                                             HippoCanvasItem *item);
    void                hippo_canvas_context_translate_to_widget
                                                            (HippoCanvasContext *context,
                                                             HippoCanvasItem *item,
                                                             int *x_p,
                                                             int *y_p);
    void                hippo_canvas_context_translate_to_screen
                                                            (HippoCanvasContext *context,
                                                             HippoCanvasItem *item,
                                                             int *x_p,
                                                             int *y_p);
    void                hippo_canvas_context_emit_style_changed
                                                            (HippoCanvasContext *context,
                                                             gboolean resize_needed);

## Object Hierarchy

      GInterface
       +----HippoCanvasContext

## Known Implementations

HippoCanvasContext is implemented by HippoCanvasGradient, HippoCanvasLink, HippoCanvasImage, HippoCanvasBox, HippoCanvasText and HippoCanvasImageButton.

## Signals

      "style-changed"                                  : Run Last

## Description

## Details

### enum HippoStockColor

    typedef enum {
        HIPPO_STOCK_COLOR_BG_NORMAL,
        HIPPO_STOCK_COLOR_BG_PRELIGHT,
        HIPPO_STOCK_COLOR_FG
    } HippoStockColor;

### HippoCanvasContext

    typedef struct _HippoCanvasContext HippoCanvasContext;

### HippoCanvasContextIface

    typedef struct {
        GTypeInterface base_iface;

        PangoLayout*     (* create_layout)  (HippoCanvasContext  *context);
        cairo_surface_t* (* create_surface) (HippoCanvasContext  *context,
                                             cairo_content_t      content,
                                             int                  width,
                                             int                  height);

        cairo_surface_t* (* load_image)     (HippoCanvasContext  *context,
                                             const char          *image_name);

        guint32          (* get_color)      (HippoCanvasContext  *context,
                                             HippoStockColor      color);

        void             (* register_widget_item)   (HippoCanvasContext *context,
                                                     HippoCanvasItem    *item);
        void             (* unregister_widget_item) (HippoCanvasContext *context,
                                                     HippoCanvasItem    *item);
        void             (* translate_to_widget)    (HippoCanvasContext *context,
                                                     HippoCanvasItem    *item,
                                                     int                *x_p,
                                                     int                *y_p);
        void             (* translate_to_screen)    (HippoCanvasContext *context,
                                                     HippoCanvasItem    *item,
                                                     int                *x_p,
                                                     int                *y_p);
        HippoCanvasStyle *(* get_style)             (HippoCanvasContext *context);
        double            (* get_resolution)        (HippoCanvasContext *context);
        PangoFontDescription *(* get_font)          (HippoCanvasContext *context);

        HippoAnimationManager *( *get_animation_manager) (HippoCanvasContext *context);

        /* Signals */

        /* Inherited style properties (see affect_* methods) have changed.
         * resize_needed means the change needs a resize not just repaint.
         */
        void             (* style_changed)    (HippoCanvasContext *context,
                                               gboolean            resize_needed);
    } HippoCanvasContextIface;

### hippo_canvas_context_create_layout ()

    PangoLayout*        hippo_canvas_context_create_layout  (HippoCanvasContext *context);

`context` : |
Returns : |

### hippo_canvas_context_load_image ()

    cairo_surface_t*    hippo_canvas_context_load_image     (HippoCanvasContext *context,
                                                             const char *image_name);

`context` : |
`image_name` : |
Returns : |

### hippo_canvas_context_get_color ()

    guint32             hippo_canvas_context_get_color      (HippoCanvasContext *context,
                                                             HippoStockColor color);

`context` : |
`color` : |
Returns : |

### hippo_canvas_context_register_widget_item ()

    void                hippo_canvas_context_register_widget_item
                                                            (HippoCanvasContext *context,
                                                             HippoCanvasItem *item);

`context` : |
`item` : |

### hippo_canvas_context_unregister_widget_item ()

    void                hippo_canvas_context_unregister_widget_item
                                                            (HippoCanvasContext *context,
                                                             HippoCanvasItem *item);

`context` : |
`item` : |

### hippo_canvas_context_translate_to_widget ()

    void                hippo_canvas_context_translate_to_widget
                                                            (HippoCanvasContext *context,
                                                             HippoCanvasItem *item,
                                                             int *x_p,
                                                             int *y_p);

`context` : |
`item` : |
`x_p` : |
`y_p` : |

### hippo_canvas_context_translate_to_screen ()

    void                hippo_canvas_context_translate_to_screen
                                                            (HippoCanvasContext *context,
                                                             HippoCanvasItem *item,
                                                             int *x_p,
                                                             int *y_p);

`context` : |
`item` : |
`x_p` : |
`y_p` : |

### hippo_canvas_context_emit_style_changed ()

    void                hippo_canvas_context_emit_style_changed
                                                            (HippoCanvasContext *context,
                                                             gboolean resize_needed);

`context` : |
`resize_needed` : |

## Signal Details

### The `"style-changed"` signal

    void                user_function                      (HippoCanvasContext *hippocanvascontext,
                                                            gboolean            arg1,
                                                            gpointer            user_data)               : Run Last

`hippocanvascontext` : | the object which received the signal.
`arg1` : |
`user_data` : | user data set when the signal handler was connected.