navit
0.5.3-trunk
|
Exported functions / structures for the graphics subsystem. More...
#include "coord.h"
Go to the source code of this file.
Data Structures | |
struct | graphics_keyboard |
struct | padding |
The functions to be implemented by graphics plugins. More... | |
struct | graphics_methods |
struct | graphics_font_methods |
struct | graphics_font |
struct | graphics_gc_methods |
struct | graphics_gc |
graphics context A graphics context encapsulates a set of drawing parameters, such as linewidth and drawing color. More... | |
struct | graphics_image_methods |
struct | graphics_image |
struct | graphics_data_image |
Enumerations | |
enum | draw_mode_num { draw_mode_begin , draw_mode_end , draw_mode_begin_clear } |
Functions | |
int | graphics_set_attr (struct graphics *gra, struct attr *attr) |
Sets an attribute of the graphics instance. More... | |
void | graphics_set_rect (struct graphics *gra, struct point_rect *pr) |
struct graphics * | graphics_new (struct attr *parent, struct attr **attrs) |
int | graphics_get_attr (struct graphics *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter) |
Gets an attribute of the graphics instance. More... | |
struct graphics * | graphics_overlay_new (struct graphics *parent, struct point *p, int w, int h, int wraparound) |
Create a new graphics overlay. An overlay is a graphics object that is independent of the main graphics object. When drawing everything to a window, the overlay will be shown on top of the main graphics object. Navit uses overlays for OSD elements and for the vehicle on the map. This allows updating OSD elements and the vehicle without redrawing the map. More... | |
void | graphics_overlay_resize (struct graphics *this_, struct point *p, int w, int h, int wraparound) |
Alters the size, position and wraparound for an overlay. More... | |
void | graphics_init (struct graphics *this_) |
void * | graphics_get_data (struct graphics *this_, const char *type) |
void | graphics_add_callback (struct graphics *this_, struct callback *cb) |
void | graphics_remove_callback (struct graphics *this_, struct callback *cb) |
struct graphics_font * | graphics_font_new (struct graphics *gra, int size, int flags) |
struct graphics_font * | graphics_named_font_new (struct graphics *gra, char *font, int size, int flags) |
void | graphics_font_destroy (struct graphics_font *gra_font) |
void | graphics_free (struct graphics *gra) |
void | graphics_font_destroy_all (struct graphics *gra) |
struct graphics_gc * | graphics_gc_new (struct graphics *gra) |
void | graphics_gc_destroy (struct graphics_gc *gc) |
void | graphics_gc_set_foreground (struct graphics_gc *gc, struct color *c) |
void | graphics_gc_set_background (struct graphics_gc *gc, struct color *c) |
void | graphics_gc_set_texture (struct graphics_gc *gc, struct graphics_image *img) |
void | graphics_gc_set_linewidth (struct graphics_gc *gc, int width) |
void | graphics_gc_set_dashes (struct graphics_gc *gc, int width, int offset, unsigned char dash_list[], int n) |
gboolean | graphics_gc_has_texture (struct graphics_gc *gc) |
struct graphics_image * | graphics_image_new_scaled (struct graphics *gra, char *path, int w, int h) |
Create a new image from file path, optionally scaled to w and h pixels. More... | |
struct graphics_image * | graphics_image_new_scaled_rotated (struct graphics *gra, char *path, int w, int h, int rotate) |
Create a new image from file path, optionally scaled to w and h pixels and rotated. More... | |
struct graphics_image * | graphics_image_new (struct graphics *gra, char *path) |
void | graphics_image_free (struct graphics *gra, struct graphics_image *img) |
void | graphics_draw_mode (struct graphics *this_, enum draw_mode_num mode) |
Start or finish a set of drawing operations. More... | |
void | graphics_draw_lines (struct graphics *this_, struct graphics_gc *gc, struct point *p, int count) |
void | graphics_draw_circle (struct graphics *this_, struct graphics_gc *gc, struct point *p, int r) |
Draw a circle. More... | |
void | graphics_draw_rectangle (struct graphics *this_, struct graphics_gc *gc, struct point *p, int w, int h) |
void | graphics_draw_rectangle_rounded (struct graphics *this_, struct graphics_gc *gc, struct point *plu, int w, int h, int r, int fill) |
void | graphics_draw_text (struct graphics *this_, struct graphics_gc *gc1, struct graphics_gc *gc2, struct graphics_font *font, char *text, struct point *p, int dx, int dy) |
void | graphics_get_text_bbox (struct graphics *this_, struct graphics_font *font, char *text, int dx, int dy, struct point *ret, int estimate) |
void | graphics_overlay_disable (struct graphics *this_, int disable) |
int | graphics_is_disabled (struct graphics *this_) |
void | graphics_draw_image (struct graphics *this_, struct graphics_gc *gc, struct point *p, struct graphics_image *img) |
int | graphics_draw_drag (struct graphics *this_, struct point *p) |
void | graphics_background_gc (struct graphics *this_, struct graphics_gc *gc) |
void | graphics_draw_text_std (struct graphics *this_, int text_size, char *text, struct point *p) |
char * | graphics_icon_path (const char *icon) |
char * | graphics_texture_path (const char *texture) |
void | graphics_draw_itemgra (struct graphics *gra, struct itemgra *itm, struct transformation *t, char *label) |
void | graphics_displaylist_draw (struct graphics *gra, struct displaylist *displaylist, struct transformation *trans, struct layout *l, int flags) |
void | graphics_draw (struct graphics *gra, struct displaylist *displaylist, struct mapset *mapset, struct transformation *trans, struct layout *l, int async, struct callback *cb, int flags) |
int | graphics_draw_cancel (struct graphics *gra, struct displaylist *displaylist) |
struct displaylist_handle * | graphics_displaylist_open (struct displaylist *displaylist) |
struct displayitem * | graphics_displaylist_next (struct displaylist_handle *dlh) |
void | graphics_displaylist_close (struct displaylist_handle *dlh) |
struct displaylist * | graphics_displaylist_new (void) |
void | graphics_displaylist_destroy (struct displaylist *displaylist) |
struct map_selection * | displaylist_get_selection (struct displaylist *displaylist) |
Returns selection structure based on displaylist transform, projection and order. Use this function to get map selection if you are going to fetch complete item data from the map based on displayitem reference. More... | |
GList * | displaylist_get_clicked_list (struct displaylist *displaylist, struct point *p, int radius) |
Returns list of displayitems clicked at given coordinates. The deeper item is in current layout, the deeper it will be in the list. More... | |
struct item * | graphics_displayitem_get_item (struct displayitem *di) |
int | graphics_displayitem_get_coord_count (struct displayitem *di) |
char * | graphics_displayitem_get_label (struct displayitem *di) |
int | graphics_displayitem_get_displayed (struct displayitem *di) |
int | graphics_displayitem_get_z_order (struct displayitem *di) |
int | graphics_displayitem_within_dist (struct displaylist *displaylist, struct displayitem *di, struct point *p, int dist) |
void | graphics_add_selection (struct graphics *gra, struct item *item, enum item_type type, struct displaylist *dl) |
void | graphics_remove_selection (struct graphics *gra, struct item *item, enum item_type type, struct displaylist *dl) |
void | graphics_clear_selection (struct graphics *gra, struct displaylist *dl) |
int | graphics_show_native_keyboard (struct graphics *this_, struct graphics_keyboard *kbd) |
Shows the native on-screen keyboard or other input method. More... | |
int | graphics_hide_native_keyboard (struct graphics *this_, struct graphics_keyboard *kbd) |
Hides the native on-screen keyboard or other input method. More... | |
void | graphics_draw_polygon_clipped (struct graphics *gra, struct graphics_gc *gc, struct point *pin, int count_in) |
Draw a plain polygon on the display. More... | |
void | graphics_draw_polyline_clipped (struct graphics *gra, struct graphics_gc *gc, struct point *pa, int count, int *width, int poly) |
Draw polyline on the display. More... | |
navit_float | graphics_get_dpi (struct graphics *gra) |
get display resolution in DPI This method returns the native display density in DPI More... | |
Exported functions / structures for the graphics subsystem.
Navit, a modular navigation system. Copyright (C) 2005-2008 Navit Team
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
enum draw_mode_num |
GList* displaylist_get_clicked_list | ( | struct displaylist * | displaylist, |
struct point * | p, | ||
int | radius | ||
) |
Returns list of displayitems clicked at given coordinates. The deeper item is in current layout, the deeper it will be in the list.
displaylist | |
p | clicked point |
radius | radius of clicked area |
References displaylist_handle::di, displaylist_cmp_zorder(), graphics_displayitem_within_dist(), graphics_displaylist_close(), graphics_displaylist_next(), graphics_displaylist_open(), p, and displayitem::z_order.
Referenced by gui_internal_cmd_position_do().
struct map_selection* displaylist_get_selection | ( | struct displaylist * | displaylist | ) |
Returns selection structure based on displaylist transform, projection and order. Use this function to get map selection if you are going to fetch complete item data from the map based on displayitem reference.
displaylist |
References displaylist::dc, displaylist::order, display_context::pro, display_context::trans, and transform_get_selection().
Referenced by do_draw(), and gui_internal_cmd_position_do().
References callback_list_add(), and graphics::cbl.
Referenced by gui_internal_set_graphics(), gui_qml_set_graphics(), gui_qt5_qml_set_graphics(), navit_set_graphics(), osd_button_init(), osd_image_init(), osd_scale_init(), osd_set_keypress(), osd_set_std_graphic(), pedestrian_navit_init(), and win32_cb_graphics_ready().
void graphics_add_selection | ( | struct graphics * | gra, |
struct item * | item, | ||
enum item_type | type, | ||
struct displaylist * | dl | ||
) |
References graphics_process_selection_item(), item, item::priv_data, graphics::selection, and type.
Referenced by gui_internal_cmd_view_on_map().
void graphics_background_gc | ( | struct graphics * | this_, |
struct graphics_gc * | gc | ||
) |
References graphics_methods::background_gc, graphics::meth, graphics::priv, and graphics_gc::priv.
Referenced by graphics_displaylist_draw(), graphics_init(), osd_set_std_graphic(), and vehicle_draw().
void graphics_clear_selection | ( | struct graphics * | gra, |
struct displaylist * | dl | ||
) |
References graphics_remove_selection(), item::priv_data, and graphics::selection.
Referenced by gui_internal_cmd_view_on_map().
int graphics_displayitem_get_coord_count | ( | struct displayitem * | di | ) |
References displayitem::count.
Referenced by popup_show_item().
int graphics_displayitem_get_displayed | ( | struct displayitem * | di | ) |
Referenced by gui_internal_dbus_signal(), and gui_qml_dbus_signal().
struct item* graphics_displayitem_get_item | ( | struct displayitem * | di | ) |
Get the map item which given displayitem is based on. NOTE: returned structure doesn't contain any attributes or coordinates. type, map, idhi and idlow seem to be the only useable members.
di | pointer to displayitem structure |
References displayitem::item.
Referenced by gui_internal_cmd_position_do(), gui_internal_dbus_signal(), gui_qml_dbus_signal(), and popup_show_item().
char* graphics_displayitem_get_label | ( | struct displayitem * | di | ) |
int graphics_displayitem_get_z_order | ( | struct displayitem * | di | ) |
Get the number of this item as it was last displayed on the screen, dependent of current layout. Items with lower numbers are shaded by items with higher ones when they overlap. Zero means item was not displayed at all. If the item is displayed twice, its topmost occurence is used.
di | pointer to displayitem structure |
References displayitem::z_order.
int graphics_displayitem_within_dist | ( | struct displaylist * | displaylist, |
struct displayitem * | di, | ||
struct point * | p, | ||
int | dist | ||
) |
FIXME
<> |
References ALLOCA_COORD_LIMIT, displayitem::c, displayitem::count, displaylist::dc, displayitem::item, display_context::maxlen, p, display_context::pro, display_context::trans, transform_point_buf(), item::type, within_dist_point(), within_dist_polygon(), and within_dist_polyline().
Referenced by displaylist_get_clicked_list(), gui_internal_dbus_signal(), and gui_qml_dbus_signal().
void graphics_displaylist_close | ( | struct displaylist_handle * | dlh | ) |
FIXME
<> |
Referenced by displaylist_get_clicked_list(), gui_internal_cmd_position_do(), gui_internal_dbus_signal(), and gui_qml_dbus_signal().
void graphics_displaylist_destroy | ( | struct displaylist * | displaylist | ) |
References displaylist::dc, display_context::trans, and transform_destroy().
Referenced by navit_destroy().
void graphics_displaylist_draw | ( | struct graphics * | gra, |
struct displaylist * | displaylist, | ||
struct transformation * | trans, | ||
struct layout * | l, | ||
int | flags | ||
) |
FIXME
<> |
References callback_list_call_attr_0, graphics::cbl, layout::color, displaylist::dc, graphics::default_font, draw_mode_begin, draw_mode_begin_clear, draw_mode_end, layout::font, graphics::gc, display_context::gra, graphics_background_gc(), graphics_draw_mode(), graphics_draw_rectangle(), graphics_gc_set_background(), graphics_gc_set_foreground(), point_rect::lu, display_context::mindist, layout::order_delta, graphics::r, point_rect::rl, display_context::trans, transform_destroy(), transform_dup(), transform_get_order(), point::x, xdisplay_draw(), and point::y.
Referenced by do_draw(), navit_draw_displaylist(), navit_motion_timeout(), osd_auxmap_draw(), and pedestrian_rocket_idle().
struct displaylist* graphics_displaylist_new | ( | void | ) |
FIXME
<> |
References ALLOCA_COORD_LIMIT, displaylist::dc, and display_context::maxlen.
Referenced by navit_new().
struct displayitem* graphics_displaylist_next | ( | struct displaylist_handle * | dlh | ) |
FIXME
<> |
References hash_entry::di, displaylist_handle::di, displaylist_handle::dl, displaylist::hash_entries, HASH_SIZE, displaylist_handle::hashidx, displayitem::next, and hash_entry::type.
Referenced by displaylist_get_clicked_list(), gui_internal_dbus_signal(), and gui_qml_dbus_signal().
struct displaylist_handle* graphics_displaylist_open | ( | struct displaylist * | displaylist | ) |
FIXME
<> |
References displaylist_handle::dl.
Referenced by displaylist_get_clicked_list(), gui_internal_cmd_position_do(), gui_internal_dbus_signal(), and gui_qml_dbus_signal().
void graphics_draw | ( | struct graphics * | gra, |
struct displaylist * | displaylist, | ||
struct mapset * | mapset, | ||
struct transformation * | trans, | ||
struct layout * | l, | ||
int | async, | ||
struct callback * | cb, | ||
int | flags | ||
) |
FIXME
<> |
References graphics_load_mapset().
Referenced by navit_draw_async(), and osd_auxmap_draw().
int graphics_draw_cancel | ( | struct graphics * | gra, |
struct displaylist * | displaylist | ||
) |
References displaylist::busy, and do_draw().
Referenced by navit_block(), navit_destroy(), navit_handle_resize(), and navit_motion_timeout().
void graphics_draw_circle | ( | struct graphics * | this_, |
struct graphics_gc * | gc, | ||
struct point * | p, | ||
int | r | ||
) |
Draw a circle.
this_ | The graphics instance on which to draw |
gc | The graphics context |
p | The coordinates of the center of the circle |
r | The radius of the circle |
References ALLOCA_COORD_LIMIT, circle_to_points(), graphics_methods::draw_circle, graphics_dpi_scale(), graphics_dpi_scale_point(), graphics_draw_lines(), graphics::meth, p, graphics::priv, and graphics_gc::priv.
Referenced by displayitem_draw_circle(), gui_internal_cmd2_route_height_profile(), osd_auxmap_draw(), osd_compass_draw(), and osd_speed_warner_draw().
References graphics_methods::draw_drag, graphics_dpi_scale_point(), graphics::meth, p, and graphics::priv.
Referenced by navit_handle_button(), navit_motion_timeout(), and vehicle_draw_do().
void graphics_draw_image | ( | struct graphics * | this_, |
struct graphics_gc * | gc, | ||
struct point * | p, | ||
struct graphics_image * | img | ||
) |
FIXME
<> |
References graphics_methods::draw_image, graphics_dpi_scale_point(), graphics::meth, p, graphics::priv, graphics_gc::priv, and graphics_image::priv.
Referenced by displayitem_draw_icon(), gui_internal_image_render(), osd_button_draw(), osd_button_init(), osd_cmd_interface_draw(), osd_gps_status_draw(), osd_image_init(), osd_nav_next_turn_draw(), osd_nav_toggle_announcer_draw(), osd_navigation_status_draw_do(), osd_speed_warner_draw(), osd_volume_draw(), and pedestrian_draw_arrow().
void graphics_draw_itemgra | ( | struct graphics * | gra, |
struct itemgra * | itm, | ||
struct transformation * | t, | ||
char * | label | ||
) |
References ALLOCA_COORD_LIMIT, displayitem::c, element::coord, element::coord_count, displayitem::count, dbg, display_context_free(), displayitem_draw(), display_context::e, itemgra::elements, display_context::gc, display_context::gc_background, display_context::gra, displayitem::holes, item::id_hi, item::id_lo, display_context::img, displayitem::item, displayitem::label, label, lvl_error, item::map, display_context::maxlen, display_context::mindist, displayitem::next, display_context::pro, projection_screen, display_context::trans, display_context::type, item::type, coord::x, coord::y, and displayitem::z_order.
Referenced by vehicle_draw_do().
void graphics_draw_lines | ( | struct graphics * | this_, |
struct graphics_gc * | gc, | ||
struct point * | p, | ||
int | count | ||
) |
FIXME
<> |
References ALLOCA_COORD_LIMIT, graphics_methods::draw_lines, graphics_dpi_scale_point(), graphics::meth, p, graphics::priv, and graphics_gc::priv.
Referenced by display_draw_arrow(), display_draw_spike(), draw_handle(), graphics_draw_circle(), graphics_draw_polyline_clipped(), graphics_draw_rectangle_rounded(), gui_internal_box_render(), gui_internal_cmd2_route_height_profile(), gui_internal_table_render(), and osd_scale_draw().
void graphics_draw_mode | ( | struct graphics * | this_, |
enum draw_mode_num | mode | ||
) |
Start or finish a set of drawing operations.
graphics_draw_mode(draw_mode_begin) must be invoked before performing any drawing operations; this allows the graphics driver to perform any necessary setup. graphics_draw_mode(draw_mode_end) must be invoked to finish a set of drawing operations; this will typically clean up drawing resources and display the drawing result.
this_ | graphics object that is being drawn to |
mode | specify beginning or end of drawing |
References graphics_methods::draw_mode, graphics::meth, and graphics::priv.
Referenced by draw_aligned_osd_text(), graphics_displaylist_draw(), gui_internal_button(), gui_internal_cmd2_about(), gui_internal_cmd2_back(), gui_internal_cmd2_locale(), gui_internal_cmd2_network_info(), gui_internal_highlight_do(), gui_internal_highlight_possible_keys(), gui_internal_html_menu(), gui_internal_html_submit(), gui_internal_keypress(), gui_internal_leave(), gui_internal_motion_cb(), gui_internal_route_update(), gui_internal_search_idle(), gui_internal_set_attr(), navit_map_progress(), navit_motion_timeout(), navit_set_attr_do(), osd_auxmap_draw(), osd_button_init(), osd_cmd_interface_draw(), osd_compass_draw(), osd_fill_with_bgcolor(), osd_gps_status_draw(), osd_image_init(), osd_j1850_draw(), osd_nav_next_turn_draw(), osd_nav_toggle_announcer_draw(), osd_navigation_status_draw_do(), osd_odometer_draw(), osd_route_guard_draw(), osd_scale_draw(), osd_speed_cam_draw(), osd_speed_warner_draw(), osd_stopwatch_draw(), osd_text_draw(), osd_volume_draw(), and vehicle_draw_do().
void graphics_draw_polygon_clipped | ( | struct graphics * | gra, |
struct graphics_gc * | gc, | ||
struct point * | pin, | ||
int | count_in | ||
) |
Draw a plain polygon on the display.
gra | The graphics instance on which to draw | |
gc | The graphics context | |
[in] | pin | An array of points forming the polygon |
count_in | The number of elements inside pin |
References ALLOCA_COORD_LIMIT, graphics_clip_polygon(), graphics_draw_polygon(), and graphics::r.
Referenced by displayitem_draw_polygon(), and draw_compass().
void graphics_draw_polyline_clipped | ( | struct graphics * | gra, |
struct graphics_gc * | gc, | ||
struct point * | pa, | ||
int | count, | ||
int * | width, | ||
int | poly | ||
) |
Draw polyline on the display.
Polylines are a serie of lines connected to each other.
gra | The graphics instance on which to draw | |
gc | The graphics context | |
[in] | pin | An array of points forming the polygon |
count_in | The number of elements inside pin | |
[in] | width | An array of width matching the line starting from the corresponding pa (if all equal, all lines will have the same width) |
poly | A boolean indicating whether the polyline should be closed to form a polygon (only the contour of this polygon will be drawn) |
References ALLOCA_COORD_LIMIT, clip_line(), CLIPRES_END_CLIPPED, CLIPRES_INVISIBLE, CLIPRES_START_CLIPPED, dbg, graphics_draw_lines(), graphics_draw_polyline_as_polygon(), point_rect::lu, lvl_debug, graphics::r, point_rect::rl, wpoint::w, width, wpoint::x, point::x, wpoint::y, and point::y.
Referenced by displayitem_draw_polyline(), and draw_compass().
void graphics_draw_rectangle | ( | struct graphics * | this_, |
struct graphics_gc * | gc, | ||
struct point * | p, | ||
int | w, | ||
int | h | ||
) |
FIXME
<> |
References graphics_methods::draw_rectangle, graphics_dpi_scale(), graphics_dpi_scale_point(), graphics::meth, p, graphics::priv, and graphics_gc::priv.
Referenced by graphics_displaylist_draw(), graphics_draw_text_std(), gui_internal_background_render(), gui_internal_label_render(), osd_fill_with_bgcolor(), osd_nav_toggle_announcer_draw(), osd_scale_draw(), pedestrian_graphics_postdraw(), and vehicle_draw_do().
void graphics_draw_rectangle_rounded | ( | struct graphics * | this_, |
struct graphics_gc * | gc, | ||
struct point * | plu, | ||
int | w, | ||
int | h, | ||
int | r, | ||
int | fill | ||
) |
References ALLOCA_COORD_LIMIT, circle_to_points(), graphics_draw_lines(), graphics_draw_polygon(), p, point::x, and point::y.
void graphics_draw_text | ( | struct graphics * | this_, |
struct graphics_gc * | gc1, | ||
struct graphics_gc * | gc2, | ||
struct graphics_font * | font, | ||
char * | text, | ||
struct point * | p, | ||
int | dx, | ||
int | dy | ||
) |
FIXME
<> |
References graphics_methods::draw_text, graphics_dpi_scale_point(), graphics::meth, p, graphics::priv, graphics_font::priv, and graphics_gc::priv.
Referenced by draw_aligned_osd_text(), draw_multiline_osd_text(), graphics_draw_text_std(), gui_internal_label_render(), label_line(), multiline_label_draw(), osd_compass_draw(), osd_j1850_draw(), osd_route_guard_draw(), osd_scale_draw(), osd_speed_warner_draw(), osd_stopwatch_draw(), and osd_text_draw().
void graphics_draw_text_std | ( | struct graphics * | this_, |
int | text_size, | ||
char * | text, | ||
struct point * | p | ||
) |
References bbox(), graphics::gc, get_font(), graphics_draw_rectangle(), graphics_draw_text(), graphics_get_text_bbox(), and p.
Referenced by gui_internal_cmd2_route_height_profile(), and navit_map_progress().
void graphics_font_destroy | ( | struct graphics_font * | gra_font | ) |
References graphics_font_methods::font_destroy, graphics_font::meth, and graphics_font::priv.
void graphics_font_destroy_all | ( | struct graphics * | gra | ) |
Free all loaded fonts. Used when switching layouts.
gra | The graphics instance |
References graphics::font, graphics_font_methods::font_destroy, graphics::font_len, graphics_font::meth, and graphics_font::priv.
Referenced by graphics_free(), and navit_set_attr_do().
struct graphics_font* graphics_font_new | ( | struct graphics * | gra, |
int | size, | ||
int | flags | ||
) |
FIXME
<> |
References graphics::default_font, graphics_named_font_new(), and size.
Referenced by get_font(), and gui_internal_apply_config().
void graphics_free | ( | struct graphics * | gra | ) |
Destroy graphics Called when navit exits
gra | The graphics instance |
References attr_list_free(), graphics::attrs, graphics::default_font, graphics::font, g_hash_to_list(), graphics::gc, graphics_methods::graphics_destroy, graphics_font_destroy_all(), graphics_gc_destroy(), graphics::image_cache_hash, graphics_methods::image_free, graphics::meth, graphics::parent, graphics::priv, and graphics_image::priv.
Referenced by navit_destroy(), and vehicle_destroy().
void graphics_gc_destroy | ( | struct graphics_gc * | gc | ) |
Destroy a graphics context, freeing associated resources.
gc | context to destroy |
References graphics_gc_methods::gc_destroy, graphics_gc::meth, and graphics_gc::priv.
Referenced by display_context_free(), graphics_free(), pedestrian_draw_arrow(), pedestrian_graphics_postdraw(), and vehicle_destroy().
gboolean graphics_gc_has_texture | ( | struct graphics_gc * | gc | ) |
Check if graphic context supports textured backgrounds
gc | Graphics context handle |
References graphics_gc_methods::gc_set_texture, and graphics_gc::meth.
Referenced by displayitem_draw_polygon(), and graphics_gc_set_texture().
struct graphics_gc* graphics_gc_new | ( | struct graphics * | gra | ) |
Create a new graphics context.
gra | associated graphics object for the new context |
References graphics_methods::gc_new, graphics_gc::gra, graphics::meth, graphics_gc::meth, graphics::priv, and graphics_gc::priv.
Referenced by displayitem_draw(), displayitem_draw_circle(), displayitem_draw_text(), graphics_init(), gui_internal_box_render(), gui_internal_setup(), gui_internal_table_render(), osd_button_init(), osd_cmd_interface_init(), osd_compass_init(), osd_image_init(), osd_j1850_init(), osd_odometer_init(), osd_route_guard_init(), osd_set_std_graphic(), osd_stopwatch_init(), pedestrian_draw_arrow(), pedestrian_graphics_postdraw(), and vehicle_draw().
void graphics_gc_set_background | ( | struct graphics_gc * | gc, |
struct color * | c | ||
) |
FIXME
<> |
References c, graphics::colormgmt, graphics_gc_methods::gc_set_background, graphics_gc::gra, graphics_convert_color(), graphics_gc::meth, and graphics_gc::priv.
Referenced by graphics_displaylist_draw(), and graphics_gc_init().
void graphics_gc_set_dashes | ( | struct graphics_gc * | gc, |
int | width, | ||
int | offset, | ||
unsigned char | dash_list[], | ||
int | n | ||
) |
FIXME
<> |
References color::a, graphics_gc_methods::gc_set_dashes, graphics_gc::gra, graphics_dpi_scale(), graphics_gc::meth, offset, graphics_gc::priv, and width.
Referenced by displayitem_draw_polyline().
void graphics_gc_set_foreground | ( | struct graphics_gc * | gc, |
struct color * | c | ||
) |
Set foreground color.
gc | graphics context to set color for |
c | color to set |
References c, graphics::colormgmt, graphics_gc_methods::gc_set_foreground, graphics_gc::gra, graphics_convert_color(), graphics_gc::meth, and graphics_gc::priv.
Referenced by displayitem_draw(), displayitem_draw_circle(), displayitem_draw_text(), graphics_displaylist_draw(), graphics_gc_init(), gui_internal_box_render(), gui_internal_setup(), gui_internal_table_render(), osd_cmd_interface_init(), osd_compass_init(), osd_j1850_init(), osd_odometer_init(), osd_route_guard_init(), osd_set_std_graphic(), osd_stopwatch_init(), pedestrian_draw_arrow(), pedestrian_graphics_postdraw(), and vehicle_draw().
void graphics_gc_set_linewidth | ( | struct graphics_gc * | gc, |
int | width | ||
) |
FIXME
<> |
References graphics_gc_methods::gc_set_linewidth, graphics_gc::gra, graphics_dpi_scale(), graphics_gc::meth, graphics_gc::priv, and width.
Referenced by displayitem_draw_circle(), displayitem_draw_polyline(), gui_internal_box_render(), gui_internal_table_render(), osd_cmd_interface_init(), osd_compass_init(), osd_j1850_init(), osd_odometer_init(), osd_route_guard_init(), and osd_stopwatch_init().
void graphics_gc_set_texture | ( | struct graphics_gc * | gc, |
struct graphics_image * | img | ||
) |
Set textured background to current graphics context.
gc | Graphics context handle |
img | Allocated image |
References graphics_gc_methods::gc_set_texture, graphics_gc_has_texture(), graphics_gc::meth, graphics_gc::priv, and graphics_image::priv.
Referenced by displayitem_draw_polygon().
int graphics_get_attr | ( | struct graphics * | this_, |
enum attr_type | type, | ||
struct attr * | attr, | ||
struct attr_iter * | iter | ||
) |
Gets an attribute of the graphics instance.
This function searches the attribute list of the graphics object for an attribute of a given type and stores it in the attr parameter.
Searching for attr_any or attr_any_xml is supported.
An iterator can be specified to get multiple attributes of the same type: The first call will return the first match from attr; each subsequent call with the same iterator will return the next match. If no more matching attributes are found in either of them, false is returned.
Note that currently this will only return the generic attributes which can be set with graphics_set_attr_do(struct graphics *, struct attr *). Attributes implemented by a graphics plugin cannot be retrieved with this method.
this | The graphics instance |
type | The attribute type to search for |
attr | Points to a which will receive the attribute |
iter | An iterator. This parameter may be NULL. |
References attr_generic_get_attr(), graphics::attrs, and type.
Referenced by navit_init().
void* graphics_get_data | ( | struct graphics * | this_, |
const char * | type | ||
) |
FIXME
<> |
References graphics_methods::get_data, graphics::meth, graphics::priv, and type.
Referenced by gui_gtk_set_graphics(), gui_internal_menu_menu_resize(), gui_internal_resize(), gui_internal_set_graphics(), gui_qml_set_graphics(), gui_qt5_qml_set_graphics(), navit_get_cursor_pnt(), osd_set_std_graphic(), osd_std_calculate_sizes(), pedestrian_graphics_resize(), request_graphics_get_data(), and win32_gui_set_graphics().
navit_float graphics_get_dpi | ( | struct graphics * | gra | ) |
get display resolution in DPI This method returns the native display density in DPI
gra | graphics handle |
References graphics_methods::get_dpi, graphics::meth, and graphics::priv.
Referenced by graphics_new().
void graphics_get_text_bbox | ( | struct graphics * | this_, |
struct graphics_font * | font, | ||
char * | text, | ||
int | dx, | ||
int | dy, | ||
struct point * | ret, | ||
int | estimate | ||
) |
FIXME
<> |
References graphics_methods::get_text_bbox, graphics_dpi_unscale_point(), graphics::meth, graphics::priv, and graphics_font::priv.
Referenced by draw_aligned_osd_text(), draw_multiline_osd_text(), graphics_draw_text_std(), gui_internal_label_font_new(), label_line(), osd_cmd_interface_draw(), osd_compass_draw(), osd_j1850_draw(), osd_route_guard_draw(), osd_scale_draw(), osd_speed_cam_draw(), osd_speed_warner_draw(), osd_stopwatch_draw(), and osd_text_draw().
int graphics_hide_native_keyboard | ( | struct graphics * | this_, |
struct graphics_keyboard * | kbd | ||
) |
Hides the native on-screen keyboard or other input method.
This method is a wrapper around the respective method of the graphics plugin.
A call to this function indicates that Navit no longer needs the input method and is about to reclaim any screen real estate it may have previously reserved for the input method.
On platforms that don't support overlapping windows this means that the on-screen input method should be hidden, as it may otherwise obstruct parts of Navit's UI.
On windowed platforms, where on-screen input methods can be displayed alongside Navit or moved around as needed, the graphics driver should instead notify the on-screen method that it is no longer expecting user input, allowing the input method to take the appropriate action.
The graphics plugin must free any data it has stored in
and reset the pointer to
to indicate it has done so.
The caller may free
after this function returns.
this | The graphics instance |
kbd | The keyboard instance |
References graphics_methods::hide_native_keyboard, and graphics::meth.
Referenced by gui_internal_keyboard_hide_native().
char* graphics_icon_path | ( | const char * | icon | ) |
References dbg, file_wordexp_destroy(), file_wordexp_get_array(), file_wordexp_get_count(), file_wordexp_new(), and lvl_debug.
Referenced by displayitem_draw_icon(), geticon(), image_new_scaled(), osd_button_icon_path(), osd_button_new(), osd_cmd_interface_set_attr(), osd_gps_status_new(), osd_image_new(), osd_nav_next_turn_draw(), osd_nav_next_turn_new(), osd_nav_toggle_announcer_draw(), osd_nav_toggle_announcer_new(), osd_navigation_status_draw_do(), osd_navigation_status_new(), osd_volume_new(), and pedestrian_draw_arrow().
void graphics_image_free | ( | struct graphics * | gra, |
struct graphics_image * | img | ||
) |
FIXME
<> |
Referenced by display_context_free(), displayitem_draw_icon(), gui_internal_button_attr_update(), gui_internal_widget_destroy(), osd_button_draw(), osd_button_init(), osd_cmd_interface_set_attr(), osd_gps_status_draw(), osd_image_init(), osd_nav_next_turn_draw(), osd_nav_toggle_announcer_draw(), osd_navigation_status_draw_do(), osd_volume_draw(), and pedestrian_draw_arrow().
struct graphics_image* graphics_image_new | ( | struct graphics * | gra, |
char * | path | ||
) |
Create a new image from file path
gra | the graphics instance |
path | path of the image to load |
References graphics_image_new_scaled_rotated().
Referenced by osd_cmd_interface_set_attr(), osd_image_init(), and pedestrian_draw_arrow().
struct graphics_image* graphics_image_new_scaled | ( | struct graphics * | gra, |
char * | path, | ||
int | w, | ||
int | h | ||
) |
Create a new image from file path, optionally scaled to w and h pixels.
gra | the graphics instance |
path | path of the image to load |
w | width to rescale to, or IMAGE_W_H_UNSET for original width |
h | height to rescale to, or IMAGE_W_H_UNSET for original height |
References graphics_image_new_scaled_rotated().
Referenced by image_new_scaled(), osd_button_draw(), osd_button_init(), osd_button_set_attr(), osd_gps_status_draw(), osd_nav_next_turn_draw(), osd_nav_toggle_announcer_draw(), osd_navigation_status_draw_do(), and osd_volume_draw().
struct graphics_image* graphics_image_new_scaled_rotated | ( | struct graphics * | gra, |
char * | path, | ||
int | w, | ||
int | h, | ||
int | rotate | ||
) |
Create a new image from file path, optionally scaled to w and h pixels and rotated.
gra | the graphics instance |
path | path of the image to load |
w | width to rescale to, or IMAGE_W_H_UNSET for original width |
h | height to rescale to, or IMAGE_W_H_UNSET for original height |
rotate | angle to rotate the image, in 90 degree steps (not supported by all plugins). |
References dbg, file_wordexp_destroy(), file_wordexp_get_array(), file_wordexp_get_count(), file_wordexp_new(), graphics_image::height, graphics::image_cache_hash, image_new_helper(), lvl_debug, lvl_error, name, graphics_image::priv, file_wordexp::we, and graphics_image::width.
Referenced by displayitem_draw_icon(), displayitem_draw_image(), displayitem_draw_polygon(), graphics_image_new(), and graphics_image_new_scaled().
void graphics_init | ( | struct graphics * | this_ | ) |
FIXME
<> |
References graphics::gc, graphics_background_gc(), graphics_gc_init(), and graphics_gc_new().
Referenced by navit_handle_resize(), and vehicle_draw().
int graphics_is_disabled | ( | struct graphics * | this_ | ) |
References graphics::disabled, and graphics::parent.
Referenced by osd_std_keypress().
struct graphics_font* graphics_named_font_new | ( | struct graphics * | gra, |
char * | font, | ||
int | size, | ||
int | flags | ||
) |
References graphics_methods::font_new, graphics_dpi_scale(), graphics::meth, graphics_font::meth, graphics::priv, graphics_font::priv, and size.
Referenced by graphics_font_new(), gui_internal_apply_config(), and osd_set_std_graphic().
Creates a new graphics object attr type required
<> |
References attr_generic_add_attr(), attr_list_dup(), attr_search(), attr::attrs, graphics::attrs, graphics::brightness, attr::callback_list, callback_list_add_patch_function(), callback_list_call_attr_2, callback_list_new(), graphics::cbl, cbl, graphics::contrast, dbg, graphics::dpi_factor, graphics::font_size, graphics::gamma, graphics_dpi_patch(), graphics_get_dpi(), graphics_set_attr_do(), graphics::image_cache_hash, lvl_error, graphics::meth, navit_get_height(), navit_get_width(), attr::num, graphics::priv, attr::str, attr::type, and attr::u.
void graphics_overlay_disable | ( | struct graphics * | this_, |
int | disable | ||
) |
FIXME
<> |
References graphics::disabled, graphics::meth, graphics_methods::overlay_disable, and graphics::priv.
Referenced by gui_internal_check_exit(), gui_internal_enter(), navit_handle_button(), navit_motion_timeout(), osd_speed_cam_draw(), osd_std_config(), osd_std_reconfigure(), pedestrian_rocket_idle(), and vehicle_set_cursor().
struct graphics* graphics_overlay_new | ( | struct graphics * | parent, |
struct point * | p, | ||
int | w, | ||
int | h, | ||
int | wraparound | ||
) |
Create a new graphics overlay. An overlay is a graphics object that is independent of the main graphics object. When drawing everything to a window, the overlay will be shown on top of the main graphics object. Navit uses overlays for OSD elements and for the vehicle on the map. This allows updating OSD elements and the vehicle without redrawing the map.
parent | parent graphics context (should be the main graphics context as returned by graphics_new) |
p | drawing position for the overlay |
w | width of overlay |
h | height of overlay |
wraparound | use wraparound (0/1). If set, position, width and height "wrap around": negative position coordinates wrap around the window, negative width/height specify difference to window width/height. |
References graphics::dpi_factor, graphics::font_size, graphics_dpi_scale(), graphics_dpi_scale_point(), graphics_set_rect(), graphics::image_cache_hash, point_rect::lu, graphics::meth, p, graphics::parent, graphics::priv, point_rect::rl, point::x, and point::y.
Referenced by osd_set_std_graphic(), and vehicle_draw().
void graphics_overlay_resize | ( | struct graphics * | this_, |
struct point * | p, | ||
int | w, | ||
int | h, | ||
int | wraparound | ||
) |
Alters the size, position and wraparound for an overlay.
this_ | The overlay's graphics struct |
p | The new position of the overlay |
w | The new width of the overlay |
h | The new height of the overlay |
wraparound | The new wraparound of the overlay |
References graphics_dpi_scale(), graphics_dpi_scale_point(), graphics::meth, graphics_methods::overlay_resize, p, and graphics::priv.
Referenced by osd_std_resize(), and vehicle_draw().
References callback_list_remove(), and graphics::cbl.
Referenced by navit_destroy().
void graphics_remove_selection | ( | struct graphics * | gra, |
struct item * | item, | ||
enum item_type | type, | ||
struct displaylist * | dl | ||
) |
References displayitem::count, displayitem::item, item_is_equal, displayitem::label, graphics::selection, item::type, and type.
Referenced by graphics_clear_selection().
Sets an attribute of the graphics instance.
This method first tries to set one of the private attributes implemented by the current graphics plugin. If this fails, it tries to set one of the generic attributes.
If the graphics plugin does not supply a
method, this method currently does nothing and returns true, even if the attribute is a generic one.
gra | The graphics instance |
attr | The attribute to set |
References dbg, graphics_set_attr_do(), lvl_debug, graphics::meth, graphics::priv, and graphics_methods::set_attr.
Referenced by NPP_SetWindow(), pedestrian_navit_init(), and request_graphics_set_attr().
void graphics_set_rect | ( | struct graphics * | gra, |
struct point_rect * | pr | ||
) |
References graphics::r.
Referenced by graphics_overlay_new(), navit_handle_resize(), and osd_auxmap_draw().
int graphics_show_native_keyboard | ( | struct graphics * | this_, |
struct graphics_keyboard * | kbd | ||
) |
Shows the native on-screen keyboard or other input method.
This method is a wrapper around the respective method of the graphics plugin.
The caller should populate the
argument with appropriate
and
members so the graphics plugin can determine the best matching layout.
If an input method is shown, the graphics plugin should try to select the configuration which best matches the specified
. For example, if
specifies a numeric layout, the graphics plugin should select a numeric keyboard layout (if available), or the equivalent for another input method (such as setting stroke recognition to identify strokes as numbers). Likewise, when an alphanumeric-uppercase mode is requested, it should switch to uppercase input.
Implementations should, however, consider that Navit's internal keyboard allows the user to switch modes at will (the only exception being degree mode) and thus must not "lock" the user into a limited layout with no means to switch to a general-purpose one. For example, house number entry in an address search dialog may default to numeric mode, but since some house numbers may contain non-numeric characters, a pure numeric keyboard is suitable only if the user has the option to switch to an alphanumeric layout.
When multiple alphanumeric layouts are available, the graphics plugin should use the
argument to determine the best layout.
When selecting an input method, preference should always be given to the default or last selected input method and configuration if it matches the requested
and
.
If the native input method is going to obstruct parts of Navit's UI, the graphics plugin should set
and
to the height and width to the appropriate value in pixels. A value of -1 indicates that the input method fills the entire available width or height of the space available to Navit. On windowed platforms, where the on-screen input method and Navit's window may be moved relative to each other as needed and can be displayed alongside each other, the graphics plugin should report 0 for both dimensions.
this_ | The graphics instance |
kbd | The keyboard instance |
References dbg, lvl_debug, graphics::meth, and graphics_methods::show_native_keyboard.
Referenced by gui_internal_keyboard_show_native().
char* graphics_texture_path | ( | const char * | texture | ) |
References dbg, file_wordexp_destroy(), file_wordexp_get_array(), file_wordexp_get_count(), file_wordexp_new(), and lvl_debug.
Referenced by displayitem_draw_polygon().