navit  0.5.3-trunk
osd.h File Reference

Go to the source code of this file.

Data Structures

struct  osd_methods
 
struct  osd_item_methods
 
struct  osd_item
 

Macros

#define TRANSPARENT_BG   1
 
#define ITEM_HAS_TEXT   2
 
#define DISABLE_OVERLAY   4
 
#define osd_draw_cast(x)   (void (*)(struct osd_priv *osd, struct navit *navit, struct vehicle *v))(x)
 

Functions

struct osdosd_new (struct attr *parent, struct attr **attrs)
 
int osd_set_methods (struct osd_methods *in, int in_size, struct osd_methods *out)
 
void osd_wrap_point (struct point *p, struct navit *nav)
 
void osd_std_click (struct osd_item *this, struct navit *nav, int pressed, int button, struct point *p)
 
void osd_set_std_attr (struct attr **attrs, struct osd_item *item, int flags)
 
void osd_std_config (struct osd_item *item, struct navit *navit)
 
void osd_set_keypress (struct navit *nav, struct osd_item *item)
 
void osd_set_std_config (struct navit *nav, struct osd_item *item)
 
void osd_set_std_graphic (struct navit *nav, struct osd_item *item, struct osd_priv *priv)
 Sets up the graphics for an item. More...
 
void osd_std_resize (struct osd_item *item)
 
void osd_std_calculate_sizes (struct osd_item *item, int w, int h)
 Calculates the size and position of an OSD item. More...
 
void osd_fill_with_bgcolor (struct osd_item *item)
 
int osd_set_attr (struct osd *osd, struct attr *attr)
 
int osd_get_attr (struct osd *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
 

Macro Definition Documentation

◆ DISABLE_OVERLAY

#define DISABLE_OVERLAY   4

◆ ITEM_HAS_TEXT

#define ITEM_HAS_TEXT   2

◆ osd_draw_cast

#define osd_draw_cast (   x)    (void (*)(struct osd_priv *osd, struct navit *navit, struct vehicle *v))(x)

◆ TRANSPARENT_BG

#define TRANSPARENT_BG   1

Function Documentation

◆ osd_fill_with_bgcolor()

◆ osd_get_attr()

int osd_get_attr ( struct osd this_,
enum attr_type  type,
struct attr attr,
struct attr_iter iter 
)

◆ osd_new()

◆ osd_set_attr()

int osd_set_attr ( struct osd osd,
struct attr attr 
)

◆ osd_set_keypress()

void osd_set_keypress ( struct navit nav,
struct osd_item item 
)

◆ osd_set_methods()

int osd_set_methods ( struct osd_methods in,
int  in_size,
struct osd_methods out 
)

◆ osd_set_std_attr()

◆ osd_set_std_config()

void osd_set_std_config ( struct navit nav,
struct osd_item item 
)

◆ osd_set_std_graphic()

◆ osd_std_calculate_sizes()

void osd_std_calculate_sizes ( struct osd_item item,
int  w,
int  h 
)

Calculates the size and position of an OSD item.

If the geometry of the OSD item is specified relative to screen dimensions, this function will set its absolute dimensions accordingly. If relative width or relative height is set to 0% (int value is equal to ATTR_REL_RELSHIFT), object width (height) is not changed here, for button and image osds it means to derive values from the underlying image.

This method considers padding if the graphics plugin supports it (i.e. its get_data method returns a valid pointer if "padding" is supplied as its arument): It will offset the origin of the item by the amount of padding in the left and top edges, and will reduce w and h by the total amount of padding in the respective dimension to obtain the equivalent of 100%.

If the graphics driver does not support padding, none of these corrections take place (this is equivalent to 0 padding on all sides).

Parameters
itemThe item whose size and position are to be calculated
wAvailable screen width in pixels
hAvailable screen height in pixels

References attr_rel2real(), ATTR_REL_RELSHIFT, padding::bottom, dbg, graphics_get_data(), padding::left, lvl_debug, lvl_warning, padding::right, and padding::top.

Referenced by osd_button_draw(), osd_button_init(), osd_scale_draw(), osd_set_std_graphic(), osd_std_calculate_sizes_and_redraw(), and set_std_osd_attr().

◆ osd_std_click()

void osd_std_click ( struct osd_item this,
struct navit nav,
int  pressed,
int  button,
struct point p 
)

◆ osd_std_config()

◆ osd_std_resize()

◆ osd_wrap_point()

void osd_wrap_point ( struct point p,
struct navit nav 
)