Dillo v3.1.1-91-g6d5b3ee3
Loading...
Searching...
No Matches
image.cc File Reference
#include "msg.h"
#include "image.hh"
#include "dw/core.hh"
#include "dw/image.hh"
Include dependency graph for image.cc:

Go to the source code of this file.

Macros

#define I2IR(Image)   ((dw::core::ImgRenderer*)(Image->img_rndr))
 Image to Object-ImgRenderer macro.
 

Functions

DilloImagea_Image_new (void *layout, void *img_rndr, int32_t bg_color, int32_t fg_color)
 Create and initialize a new image structure.
 
DilloImagea_Image_new_with_dw (void *layout, const char *alt_text, int32_t bg_color, int32_t fg_color)
 Create and initialize a new image structure with an image widget.
 
void * a_Image_get_dw (DilloImage *Image)
 Return the image renderer as a widget.
 
static void Image_free (DilloImage *Image)
 Deallocate an Image structure.
 
void a_Image_unref (DilloImage *Image)
 Unref and free if necessary Do nothing if the argument is NULL.
 
void a_Image_ref (DilloImage *Image)
 Add a reference to an Image struct Do nothing if the argument is NULL.
 
void a_Image_set_parms (DilloImage *Image, void *v_imgbuf, DilloUrl *url, int version, uint_t width, uint_t height, DilloImgType type)
 Set initial parameters of the image.
 
void a_Image_write (DilloImage *Image, uint_t y)
 Implement the write method.
 
void a_Image_close (DilloImage *Image)
 Implement the close method.
 
void a_Image_abort (DilloImage *Image)
 Implement the abort method.
 

Macro Definition Documentation

◆ I2IR

#define I2IR (   Image)    ((dw::core::ImgRenderer*)(Image->img_rndr))

Image to Object-ImgRenderer macro.

Definition at line 28 of file image.cc.

Function Documentation

◆ a_Image_abort()

void a_Image_abort ( DilloImage Image)

Implement the abort method.

Definition at line 153 of file image.cc.

References _MSG, and I2IR.

Referenced by a_Dicache_callback().

◆ a_Image_close()

void a_Image_close ( DilloImage Image)

Implement the close method.

Definition at line 144 of file image.cc.

References _MSG, and I2IR.

Referenced by a_Dicache_callback().

◆ a_Image_get_dw()

void * a_Image_get_dw ( DilloImage Image)

Return the image renderer as a widget.

This is somewhat tricky, since simple casting leads to wrong (and hard to debug) results, because of multiple inheritance. This function can be used from C code, where only access to void* is possible.

Definition at line 72 of file image.cc.

Referenced by Dicache_image().

◆ a_Image_new()

DilloImage * a_Image_new ( void *  layout,
void *  img_rndr,
int32_t  bg_color,
int32_t  fg_color 
)

Create and initialize a new image structure.

Definition at line 34 of file image.cc.

References dNew, IMG_Empty, dw::core::Widget::layout, and layout.

Referenced by a_Html_image_new(), a_Image_new_with_dw(), and StyleEngine::apply().

◆ a_Image_new_with_dw()

DilloImage * a_Image_new_with_dw ( void *  layout,
const char *  alt_text,
int32_t  bg_color,
int32_t  fg_color 
)

Create and initialize a new image structure with an image widget.

Definition at line 59 of file image.cc.

References a_Image_new(), and layout.

Referenced by Dicache_image().

◆ a_Image_ref()

void a_Image_ref ( DilloImage Image)

Add a reference to an Image struct Do nothing if the argument is NULL.

Definition at line 100 of file image.cc.

Referenced by a_Html_image_new(), StyleEngine::apply(), Dicache_image(), and Html_load_image().

◆ a_Image_set_parms()

void a_Image_set_parms ( DilloImage Image,
void *  v_imgbuf,
DilloUrl url,
int  version,
uint_t  width,
uint_t  height,
DilloImgType  type 
)

Set initial parameters of the image.

Definition at line 109 of file image.cc.

References _MSG, a_Bitvec_new(), I2IR, and IMG_SetParms.

Referenced by a_Dicache_callback().

◆ a_Image_unref()

void a_Image_unref ( DilloImage Image)

Unref and free if necessary Do nothing if the argument is NULL.

Definition at line 89 of file image.cc.

References _MSG, and Image_free().

Referenced by a_Html_image_new(), a_Web_free(), DilloHtml::loadImages(), and DilloHtml::~DilloHtml().

◆ a_Image_write()

void a_Image_write ( DilloImage Image,
uint_t  y 
)

Implement the write method.

Definition at line 130 of file image.cc.

References _MSG, a_Bitvec_set_bit(), dReturn_if_fail, I2IR, and IMG_Write.

Referenced by a_Dicache_callback().

◆ Image_free()

static void Image_free ( DilloImage Image)
static

Deallocate an Image structure.

Definition at line 79 of file image.cc.

References a_Bitvec_free(), and dFree().

Referenced by a_Image_unref().