navit  0.5.3-trunk
graphics_gd.c File Reference
#include <glib.h>
#include <gd.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "config.h"
#include "point.h"
#include "graphics.h"
#include "color.h"
#include "plugin.h"
#include "callback.h"
#include "window.h"
#include "navit.h"
#include "debug.h"
#include "navit/font/freetype/font_freetype.h"

Data Structures

struct  shmem_header
 
struct  graphics_priv
 
struct  graphics_gc_priv
 
struct  graphics_image_priv
 

Functions

static void emit_callback (struct graphics_priv *priv)
 
static void image_setup (struct graphics_priv *gr)
 
static struct shmem_headershm_next (struct graphics_priv *gr)
 
static void add_overlays (struct graphics_priv *overlay, gdImagePtr im)
 
static void graphics_destroy (struct graphics_priv *gr)
 
static void gc_destroy (struct graphics_gc_priv *gc)
 
static void gc_set_linewidth (struct graphics_gc_priv *gc, int w)
 
static void gc_set_dashes (struct graphics_gc_priv *gc, int w, int offset, unsigned char *dash_list, int n)
 
static void gc_set_foreground (struct graphics_gc_priv *gc, struct color *c)
 
static void gc_set_background (struct graphics_gc_priv *gc, struct color *c)
 
static struct graphics_gc_privgc_new (struct graphics_priv *gr, struct graphics_gc_methods *meth)
 
static struct graphics_image_privimage_new (struct graphics_priv *gr, struct graphics_image_methods *meth, char *name, int *w, int *h, struct point *hot, int rotation)
 
static void draw_lines (struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
 
static void draw_polygon (struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
 
static void draw_rectangle (struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int w, int h)
 
static void draw_circle (struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int r)
 
static void draw_text (struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy)
 
static void draw_image (struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img)
 
static void draw_drag (struct graphics_priv *gr, struct point *p)
 
static void background_gc (struct graphics_priv *gr, struct graphics_gc_priv *gc)
 
static void draw_mode (struct graphics_priv *gr, enum draw_mode_num mode)
 
static struct graphics_privoverlay_new (struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int wraparound)
 
static void * get_data (struct graphics_priv *this, char *type)
 
static void image_free (struct graphics_priv *gr, struct graphics_image_priv *priv)
 
static void overlay_disable (struct graphics_priv *gr, int disable)
 
static void overlay_resize (struct graphics_priv *gr, struct point *p, int w, int h, int wraparound)
 
static void image_create (struct graphics_priv *gr)
 
static void image_destroy (struct graphics_priv *gr)
 
static int set_attr_do (struct graphics_priv *gr, struct attr *attr, int init)
 
static int set_attr (struct graphics_priv *gr, struct attr *attr)
 
static struct graphics_privgraphics_gd_new (struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl)
 
void plugin_init (void)
 

Variables

static struct graphics_gc_methods gc_methods
 
static struct graphics_methods graphics_methods
 

Function Documentation

◆ add_overlays()

static void add_overlays ( struct graphics_priv overlay,
gdImagePtr  im 
)
static

◆ background_gc()

static void background_gc ( struct graphics_priv gr,
struct graphics_gc_priv gc 
)
static

◆ draw_circle()

static void draw_circle ( struct graphics_priv gr,
struct graphics_gc_priv gc,
struct point p,
int  r 
)
static

◆ draw_drag()

static void draw_drag ( struct graphics_priv gr,
struct point p 
)
static

References graphics_priv::p, p, point::x, and point::y.

◆ draw_image()

static void draw_image ( struct graphics_priv gr,
struct graphics_gc_priv fg,
struct point p,
struct graphics_image_priv img 
)
static

◆ draw_lines()

◆ draw_mode()

◆ draw_polygon()

static void draw_polygon ( struct graphics_priv gr,
struct graphics_gc_priv gc,
struct point p,
int  count 
)
static

◆ draw_rectangle()

static void draw_rectangle ( struct graphics_priv gr,
struct graphics_gc_priv gc,
struct point p,
int  w,
int  h 
)
static

◆ draw_text()

◆ emit_callback()

static void emit_callback ( struct graphics_priv priv)
static

◆ gc_destroy()

◆ gc_new()

◆ gc_set_background()

static void gc_set_background ( struct graphics_gc_priv gc,
struct color c 
)
static

◆ gc_set_dashes()

static void gc_set_dashes ( struct graphics_gc_priv gc,
int  w,
int  offset,
unsigned char *  dash_list,
int  n 
)
static

◆ gc_set_foreground()

static void gc_set_foreground ( struct graphics_gc_priv gc,
struct color c 
)
static

◆ gc_set_linewidth()

static void gc_set_linewidth ( struct graphics_gc_priv gc,
int  w 
)
static

◆ get_data()

◆ graphics_destroy()

static void graphics_destroy ( struct graphics_priv gr)
static

◆ graphics_gd_new()

◆ image_create()

◆ image_destroy()

static void image_destroy ( struct graphics_priv gr)
static

◆ image_free()

static void image_free ( struct graphics_priv gr,
struct graphics_image_priv priv 
)
static

◆ image_new()

static struct graphics_image_priv* image_new ( struct graphics_priv gr,
struct graphics_image_methods meth,
char *  name,
int *  w,
int *  h,
struct point hot,
int  rotation 
)
static

◆ image_setup()

◆ overlay_disable()

static void overlay_disable ( struct graphics_priv gr,
int  disable 
)
static

References dbg, and lvl_debug.

◆ overlay_new()

◆ overlay_resize()

static void overlay_resize ( struct graphics_priv gr,
struct point p,
int  w,
int  h,
int  wraparound 
)
static

References dbg, and lvl_debug.

◆ plugin_init()

void plugin_init ( void  )

References graphics_gd_new().

◆ set_attr()

static int set_attr ( struct graphics_priv gr,
struct attr attr 
)
static

◆ set_attr_do()

◆ shm_next()

Variable Documentation

◆ gc_methods

struct graphics_gc_methods gc_methods
static
Initial value:
= {
}
static void gc_destroy(struct graphics_gc_priv *gc)
Definition: graphics_gd.c:229
static void gc_set_foreground(struct graphics_gc_priv *gc, struct color *c)
Definition: graphics_gd.c:254
static void gc_set_background(struct graphics_gc_priv *gc, struct color *c)
Definition: graphics_gd.c:259
static void gc_set_dashes(struct graphics_gc_priv *gc, int w, int offset, unsigned char *dash_list, int n)
Definition: graphics_gd.c:242
static void gc_set_linewidth(struct graphics_gc_priv *gc, int w)
Definition: graphics_gd.c:238

Referenced by gc_new().

◆ graphics_methods

Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
}
static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int wraparound)
Definition: graphics_gd.c:763
static void draw_drag(struct graphics_priv *gr, struct point *p)
Definition: graphics_gd.c:438
static void * get_data(struct graphics_priv *this, char *type)
Definition: graphics_gd.c:545
static void overlay_disable(struct graphics_priv *gr, int disable)
Definition: graphics_gd.c:587
static void draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int w, int h)
Definition: graphics_gd.c:360
static void draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img)
Definition: graphics_gd.c:433
static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy)
Definition: graphics_gd.c:380
static void background_gc(struct graphics_priv *gr, struct graphics_gc_priv *gc)
Definition: graphics_gd.c:448
static int set_attr(struct graphics_priv *gr, struct attr *attr)
Definition: graphics_gd.c:733
static void draw_lines(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
Definition: graphics_gd.c:320
static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
Definition: graphics_gd.c:452
static void draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
Definition: graphics_gd.c:351
static void image_free(struct graphics_priv *gr, struct graphics_image_priv *priv)
Definition: graphics_gd.c:582
static struct graphics_gc_priv * gc_new(struct graphics_priv *gr, struct graphics_gc_methods *meth)
Definition: graphics_gd.c:271
static struct graphics_image_priv * image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *name, int *w, int *h, struct point *hot, int rotation)
Definition: graphics_gd.c:282
static void overlay_resize(struct graphics_priv *gr, struct point *p, int w, int h, int wraparound)
Definition: graphics_gd.c:591
static void draw_circle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int r)
Definition: graphics_gd.c:369
static void graphics_destroy(struct graphics_priv *gr)
Definition: graphics_gd.c:224

Referenced by graphics_gd_new(), and overlay_new().