Graphviz 13.0.0~dev.20250511.0440
Loading...
Searching...
No Matches
gvloadimage_gdk.c File Reference
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <util/alloc.h>
#include <util/agxbuf.h>
#include <util/gv_ftell.h>
#include <gvc/gvplugin_loadimage.h>
#include <gvc/gvio.h>
#include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdk.h>
Include dependency graph for gvloadimage_gdk.c:

Go to the source code of this file.

Data Structures

struct  data_t
 resources allocated for loaded images More...
 

Enumerations

enum  { FORMAT_BMP_CAIRO , FORMAT_JPEG_CAIRO , FORMAT_PNG_CAIRO , FORMAT_ICO_CAIRO }
 

Functions

static void gdk_set_mimedata_from_file (cairo_surface_t *image, const char *mime_type, const char *file)
 
static void gdk_set_mimedata (cairo_surface_t *image, usershape_t *us)
 
static void gdk_freeimage (usershape_t *us)
 
static cairo_surface_t * gdk_loadimage (GVJ_t *job, usershape_t *us)
 
static void gdk_loadimage_cairo (GVJ_t *job, usershape_t *us, boxf b, bool filled)
 

Variables

static gvloadimage_engine_t engine_gdk
 
gvplugin_installed_t gvloadimage_gdk_types []
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FORMAT_BMP_CAIRO 
FORMAT_JPEG_CAIRO 
FORMAT_PNG_CAIRO 
FORMAT_ICO_CAIRO 

Definition at line 26 of file gvloadimage_gdk.c.

Function Documentation

◆ gdk_freeimage()

static void gdk_freeimage ( usershape_t us)
static

Definition at line 92 of file gvloadimage_gdk.c.

References usershape_s::data, free(), and NULL.

Referenced by gdk_loadimage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdk_loadimage()

static cairo_surface_t * gdk_loadimage ( GVJ_t job,
usershape_t us 
)
static

Definition at line 104 of file gvloadimage_gdk.c.

References GVJ_s::context, usershape_s::data, usershape_s::datafree, FT_BMP, FT_ICO, FT_JPEG, FT_PNG, FT_TIFF, gdk_freeimage(), gdk_set_mimedata(), gv_alloc(), gvusershape_file_access(), gvusershape_file_release(), image, usershape_s::name, NULL, and usershape_s::type.

Referenced by gdk_loadimage_cairo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdk_loadimage_cairo()

static void gdk_loadimage_cairo ( GVJ_t job,
usershape_t us,
boxf  b,
bool  filled 
)
static

Definition at line 160 of file gvloadimage_gdk.c.

References GVJ_s::context, gdk_loadimage(), usershape_s::h, image, boxf::LL, boxf::UR, usershape_s::w, pointf_s::x, and pointf_s::y.

Here is the call graph for this function:

◆ gdk_set_mimedata()

static void gdk_set_mimedata ( cairo_surface_t *  image,
usershape_t us 
)
static

Definition at line 72 of file gvloadimage_gdk.c.

References FT_JPEG, FT_PNG, gdk_set_mimedata_from_file(), image, usershape_s::name, and usershape_s::type.

Referenced by gdk_loadimage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gdk_set_mimedata_from_file()

static void gdk_set_mimedata_from_file ( cairo_surface_t *  image,
const char *  mime_type,
const char *  file 
)
static

Definition at line 33 of file gvloadimage_gdk.c.

References agxbdisown(), agxbprint(), free(), gv_ftell(), image, len(), malloc(), and NULL.

Referenced by gdk_set_mimedata().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ engine_gdk

gvloadimage_engine_t engine_gdk
static
Initial value:
= {
}
static void gdk_loadimage_cairo(GVJ_t *job, usershape_t *us, boxf b, bool filled)

Definition at line 177 of file gvloadimage_gdk.c.

◆ gvloadimage_gdk_types

gvplugin_installed_t gvloadimage_gdk_types[]
Initial value:
= {
{FORMAT_BMP_CAIRO, "bmp:cairo", 1, &engine_gdk, NULL},
{FORMAT_JPEG_CAIRO, "jpe:cairo", 2, &engine_gdk, NULL},
{FORMAT_JPEG_CAIRO, "jpg:cairo", 2, &engine_gdk, NULL},
{FORMAT_JPEG_CAIRO, "jpeg:cairo", 2, &engine_gdk, NULL},
{FORMAT_PNG_CAIRO, "png:cairo", -1, &engine_gdk, NULL},
{FORMAT_ICO_CAIRO, "ico:cairo", 1, &engine_gdk, NULL},
{0, NULL, 0, NULL, NULL}
}
node NULL
Definition grammar.y:163
@ FORMAT_BMP_CAIRO
@ FORMAT_ICO_CAIRO
@ FORMAT_PNG_CAIRO
@ FORMAT_JPEG_CAIRO
static gvloadimage_engine_t engine_gdk

Definition at line 181 of file gvloadimage_gdk.c.