navit
0.5.3-trunk
|
#include <glib.h>
#include "config.h"
#include "item.h"
#include "callback.h"
#include "color.h"
#include "debug.h"
#include "event.h"
#include "point.h"
#include "graphics.h"
#include "plugin.h"
#include "window.h"
#include "event_qt5.h"
#include "graphics_qt5.h"
#include <QDBusConnection>
#include <QDBusInterface>
#include <QFile>
#include <QFont>
#include <QGuiApplication>
#include <QPainter>
#include <QPainterPath>
#include <QPixmap>
#include <QScreen>
#include <QSvgRenderer>
#include "QNavitWidget.h"
#include <QApplication>
Data Structures | |
struct | graphics_font_priv |
struct | graphics_image_priv |
Functions | |
static void | graphics_destroy (struct graphics_priv *gr) |
static void | font_destroy (struct graphics_font_priv *font) |
static struct graphics_font_priv * | font_new (struct graphics_priv *gr, struct graphics_font_methods *meth, char *font, int size, int flags) |
Allocate a font context. More... | |
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) |
void | gc_set_texture (struct graphics_gc_priv *gc, struct graphics_image_priv *img) |
static struct graphics_gc_priv * | gc_new (struct graphics_priv *gr, struct graphics_gc_methods *meth) |
static void | image_destroy (struct graphics_image_priv *img) |
static struct graphics_image_priv * | image_new (struct graphics_priv *gr, struct graphics_image_methods *meth, char *path, 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_polygon_with_holes (struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count, int hole_count, int *ccount, struct point **holes) |
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) |
Render given text. More... | |
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) |
Drag layer. More... | |
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_priv * | overlay_new (struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int wraparound) |
void | resize_callback (struct graphics_priv *gr, int w, int h) |
static int | graphics_qt5_fullscreen (struct window *w, int on) |
static void | keep_display_on (struct graphics_priv *priv) |
static void | graphics_qt5_disable_suspend (struct window *w) |
static void * | get_data (struct graphics_priv *this_priv, char const *type) |
static void | image_free (struct graphics_priv *gr, struct graphics_image_priv *priv) |
static void | get_text_bbox (struct graphics_priv *gr, struct graphics_font_priv *font, char *text, int dx, int dy, struct point *ret, int estimate) |
Calculate pixel space required for font display. More... | |
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 navit_float | get_dpi (struct graphics_priv *gr) |
Return number of dots per inch. More... | |
static struct graphics_priv * | graphics_qt5_new (struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl) |
void | plugin_init (void) |
Variables | |
QGuiApplication * | navit_app = NULL |
static struct graphics_font_methods | font_methods |
font interface structure This structure is preset with all function pointers provided by this implemention to be returned as interface. More... | |
static const char * | fontfamilies [] |
static struct graphics_gc_methods | gc_methods |
struct graphics_image_methods | image_methods |
static struct graphics_methods | graphics_methods |
|
static |
References graphics_priv::background_graphics_gc_priv.
|
static |
References p, graphics_priv::painter, and graphics_gc_priv::pen.
|
static |
Drag layer.
gr | private handle |
p | vector the bitmap is moved from base, or NULL to indicate 0:0 vector |
Move layer to new position. If drag_bitmap is enabled this may also be called for root layer. There the content of the root layer is to be moved by given vector. On root layer, NULL indicates the end of a drag.
References dbg, lvl_debug, p, graphics_priv::pixmap, graphics_priv::root, graphics_priv::scroll_x, graphics_priv::scroll_y, graphics_priv::widget, graphics_priv::x, point::x, graphics_priv::y, and point::y.
|
static |
References dbg, lvl_debug, p, graphics_priv::painter, and graphics_image_priv::pixmap.
|
static |
References p, graphics_priv::painter, and graphics_gc_priv::pen.
|
static |
|
static |
References graphics_gc_priv::brush, p, graphics_priv::painter, and graphics_gc_priv::pen.
|
static |
References graphics_gc_priv::brush, p, graphics_priv::painter, graphics_image_priv::path, graphics_gc_priv::pen, point::x, and point::y.
|
static |
References graphics_gc_priv::brush, graphics_image_priv::h, p, graphics_priv::painter, and graphics_image_priv::w.
|
static |
Render given text.
gr | own private context |
fg | foreground drawing context (for color) |
bg | background drawing context (for color) |
font | font context to use (allocated by font_new) |
text | String to calculate bbox for |
p | offset on gr context to place this text. |
dx | transformation matrix (16.16 fixpoint) |
dy | transformation matrix (16.16 fixpoint) |
Renders given text on gr surface. Draws nice contrast outline around text.
References color::a, color::b, data, dbg, graphics_font_priv::font, graphics_priv::freetype_methods, color::g, font_freetype_methods::get_glyph, font_freetype_methods::get_shadow, font_freetype_text::glyph, font_freetype_text::glyph_count, lvl_debug, p, graphics_priv::painter, graphics_gc_priv::pen, color::r, font_freetype_methods::text_destroy, and font_freetype_methods::text_new.
|
static |
References graphics_font_priv::font.
|
static |
Allocate a font context.
gr | own private context |
meth | fill this structure with correct functions to be called with handle as interface to font |
font | font family e.g. "Arial" |
size | Font size in 16.6 fractional points @ 300dpi. This is bullsh***. The encoding is freetypes 16.6 fixed point format usually giving points. One point is usually 72th part of an inch. But navit does not honor dpi correct. It's traditionally used freetype backend is fixed to 300 dpi. So this value is (300/72) pixels |
flags | Font flags (currently 1 if bold and 0 if not) |
Allocates a font handle and returnes filled interface stucture
References font_priv::data, dbg, graphics_font_priv::font, font_methods, fontfamilies, lvl_debug, and size.
|
static |
References graphics_gc_priv::brush, and graphics_gc_priv::pen.
|
static |
|
static |
References c.
|
static |
References dbg, lvl_error, offset, and graphics_gc_priv::pen.
|
static |
References graphics_gc_priv::brush, c, and graphics_gc_priv::pen.
|
static |
References graphics_gc_priv::pen.
void gc_set_texture | ( | struct graphics_gc_priv * | gc, |
struct graphics_image_priv * | img | ||
) |
|
static |
|
static |
|
static |
Calculate pixel space required for font display.
gr | own private context |
font | font context to use (allocated by font_new) |
text | String to calculate bbox for |
dx | transformation matrix (16.16 fixpoint) |
dy | transformation matrix (16.16 fixpoint) |
ret | point array to fill. (low left, top left, top right, low right) |
estimate | ??? |
Calculates the bounding box around the given text.
References graphics_font_priv::font, point::x, and point::y.
|
static |
References graphics_priv::argc, graphics_priv::argv, font_freetype_methods::destroy, graphics_priv::display_on_cb, graphics_priv::display_on_ev, event_remove_timeout(), graphics_priv::freetype_methods, navit_app, graphics_priv::overlays, graphics_priv::painter, graphics_priv::parent, graphics_priv::pixmap, graphics_priv::root, and graphics_priv::widget.
|
static |
References callback_cast, callback_new_1, graphics_priv::display_on_cb, graphics_priv::display_on_ev, event_add_timeout(), keep_display_on(), and graphics_priv::w.
Referenced by get_data().
|
static |
References USE_QML, graphics_priv::w, graphics_priv::widget, and graphics_priv::window.
Referenced by get_data().
|
static |
References graphics_priv::argc, graphics_priv::argv, attr_search(), attr::attrs, graphics_priv::callbacks, cbl, dbg, graphics_priv::disable, event_request_system(), font_freetype_new(), graphics_priv::font_freetype_new, font_freetype_methods::font_new, graphics_methods::font_new, graphics_priv::freetype_methods, fullscreen(), font_freetype_methods::get_text_bbox, graphics_methods::get_text_bbox, graphics_methods, graphics_priv, lvl_error, navit_app, attr::num, graphics_priv::overlays, graphics_priv::painter, graphics_priv::parent, graphics_priv::pixmap, resize_callback(), graphics_priv::root, graphics_priv::scroll_x, graphics_priv::scroll_y, attr::str, attr::u, graphics_priv::use_count, USE_QML, USE_QWIDGET, graphics_priv::widget, graphics_priv::window, graphics_priv::x, and graphics_priv::y.
Referenced by plugin_init().
|
static |
References graphics_gc_priv::img, and graphics_image_priv::pixmap.
|
static |
References window::priv.
|
static |
|
static |
Referenced by graphics_qt5_disable_suspend().
|
static |
References graphics_priv::disable, graphics_priv::pixmap, graphics_priv::widget, graphics_priv::x, and graphics_priv::y.
|
static |
References graphics_priv::argc, graphics_priv::argv, graphics_priv::callbacks, graphics_priv::disable, graphics_priv::font_freetype_new, font_freetype_methods::font_new, graphics_methods::font_new, graphics_priv::freetype_methods, font_freetype_methods::get_text_bbox, graphics_methods::get_text_bbox, graphics_methods, graphics_priv, graphics_priv::overlays, p, graphics_priv::painter, graphics_priv::parent, graphics_priv::pixmap, graphics_priv::root, graphics_priv::scroll_x, graphics_priv::scroll_y, graphics_priv::use_count, graphics_priv::widget, graphics_priv::window, graphics_priv::x, and graphics_priv::y.
|
static |
References p, graphics_priv::painter, graphics_priv::pixmap, graphics_priv::widget, graphics_priv::x, and graphics_priv::y.
void plugin_init | ( | void | ) |
References graphics_qt5_new(), and qt5_event_init().
void resize_callback | ( | struct graphics_priv * | gr, |
int | w, | ||
int | h | ||
) |
References callback_list_call_attr_2, graphics_priv::callbacks, graphics_priv::h, and graphics_priv::w.
Referenced by get_data(), and graphics_qt5_new().
|
static |
font interface structure This structure is preset with all function pointers provided by this implemention to be returned as interface.
Referenced by font_new().
|
static |
List of font families to use, in order of preference
Referenced by font_new().
|
static |
Referenced by gc_new().
|
static |
Referenced by graphics_qt5_new(), and overlay_new().
struct graphics_image_methods image_methods |
Referenced by image_new().
QGuiApplication* navit_app = NULL |
Navit, a modular navigation system. Copyright (C) 2005-2017 Navit Team
This program is free software; you can redistribute it and/or modify it under the terms of the GNU 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 General Public License for more details.
You should have received a copy of the GNU 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.
Referenced by event_qt5_main_loop_run(), get_dpi(), graphics_destroy(), and graphics_qt5_new().