navit
0.5.1-trunk
|
#include <windows.h>
#include <windowsx.h>
#include <wingdi.h>
#include <glib.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "config.h"
#include "debug.h"
#include "point.h"
#include "graphics.h"
#include "color.h"
#include "callback.h"
#include "plugin.h"
#include "item.h"
#include "window.h"
#include "graphics_win32.h"
#include "xpm2bmp.h"
#include "support/win32/ConvertUTF.h"
#include "profile.h"
#include "keys.h"
#include "png.h"
Data Structures | |
struct | graphics_priv |
struct | window_priv |
struct | graphics_image_priv |
struct | graphics_gc_priv |
struct | graphics_font_priv |
struct | event_timeout |
Macros | |
#define | STRETCH_HALFTONE 4 |
#define | GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam)) |
#define | EZ_ATTR_BOLD 1 |
#define | EZ_ATTR_ITALIC 2 |
#define | EZ_ATTR_UNDERLINE 4 |
#define | EZ_ATTR_STRIKEOUT 8 |
Typedefs | |
typedef int | nXOriginDest |
typedef int int | nYOriginDest |
typedef int int int | nWidthDest |
typedef int int int int | nHeightDest |
typedef int int int int HDC | hdcSrc |
typedef int int int int HDC int | nXOriginSrc |
typedef int int int int HDC int int | nYOriginSrc |
typedef int int int int HDC int int int | nWidthSrc |
typedef int int int int HDC int int int int | nHeightSrc |
typedef int int int int HDC int int int int BLENDFUNCTION | blendFunction |
typedef int | mode |
Functions | |
typedef | BOOL (WINAPI *FP_AlphaBlend)(HDC hdcDest |
typedef | int (WINAPI *FP_SetStretchBltMode)(HDC dc |
HFONT | EzCreateFont (HDC hdc, TCHAR *szFaceName, int iDeciPtHeight, int iDeciPtWidth, int iAttributes, BOOL fLogRes) |
static void | ErrorExit (LPTSTR lpszFunction) |
static void | create_memory_dc (struct graphics_priv *gr) |
static void | HandleButtonClick (struct graphics_priv *gra_priv, int updown, int button, long lParam) |
static void | HandleKeyChar (struct graphics_priv *gra_priv, WPARAM wParam) |
static void | HandleKeyDown (struct graphics_priv *gra_priv, WPARAM wParam) |
static LRESULT CALLBACK | WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) |
static int | fullscreen (struct window *win, int on) |
void WINAPI | SystemIdleTimerReset (void) |
static struct event_timeout * | event_win32_add_timeout (int timeout, int multi, struct callback *cb) |
static void | disable_suspend (struct window *win) |
static HANDLE | CreateGraphicsWindows (struct graphics_priv *gr, HMENU hMenu) |
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 width, 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_priv * | gc_new (struct graphics_priv *gr, struct graphics_gc_methods *meth) |
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_drag (struct graphics_priv *gr, struct point *p) |
static void | draw_mode (struct graphics_priv *gr, enum draw_mode_num mode) |
static void * | get_data (struct graphics_priv *this_, const char *type) |
static void | background_gc (struct graphics_priv *gr, struct graphics_gc_priv *gc) |
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 | font_destroy (struct graphics_font_priv *font) |
static struct graphics_font_priv * | font_new (struct graphics_priv *gr, struct graphics_font_methods *meth, char *name, int size, int flags) |
static int | pngdecode (struct graphics_priv *gr, char *name, struct graphics_image_priv *img) |
static void | pngscale (struct graphics_image_priv *img, struct graphics_priv *gr, int width, int height) |
static void | pngrender (struct graphics_image_priv *img, struct graphics_priv *gr, int x0, int y0) |
static int | xpmdecode (char *name, struct graphics_image_priv *img) |
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 void | draw_image (struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img) |
static struct graphics_priv * | graphics_win32_new_helper (struct graphics_methods *meth) |
static void | overlay_resize (struct graphics_priv *gr, struct point *p, int w, int h, int wraparound) |
static struct graphics_priv * | overlay_new (struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int wraparound) |
static void | overlay_disable (struct graphics_priv *gr, int disable) |
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) |
static void | bind_late (struct graphics_priv *gra_priv) |
static struct graphics_priv * | graphics_win32_new (struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl) |
static void | event_win32_main_loop_run (void) |
static void | event_win32_main_loop_quit (void) |
static struct event_watch * | event_win32_add_watch (int h, enum event_watch_cond cond, struct callback *cb) |
static void | event_win32_remove_watch (struct event_watch *ev) |
static void | run_timer (UINT_PTR idEvent) |
static VOID CALLBACK | win32_timer_cb (HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) |
static void | event_win32_remove_timeout (struct event_timeout *to) |
static struct event_idle * | event_win32_add_idle (int priority, struct callback *cb) |
static void | event_win32_remove_idle (struct event_idle *ev) |
static void | event_win32_call_callback (struct callback_list *cb) |
static struct event_priv * | event_win32_new (struct event_methods *meth) |
void | plugin_init (void) |
Variables | |
static HWND | g_hwnd = NULL |
static const TCHAR | g_szClassName [] = {'N','A','V','G','R','A','\0'} |
static struct graphics_gc_methods | gc_methods |
static struct graphics_font_methods | font_methods |
static struct graphics_methods | graphics_methods |
static GList * | timers |
static struct event_methods | event_win32_methods |
#define EZ_ATTR_BOLD 1 |
Referenced by EzCreateFont().
#define EZ_ATTR_ITALIC 2 |
Referenced by EzCreateFont().
#define EZ_ATTR_STRIKEOUT 8 |
Referenced by EzCreateFont().
#define EZ_ATTR_UNDERLINE 4 |
Referenced by EzCreateFont().
#define GET_WHEEL_DELTA_WPARAM | ( | wParam | ) | ((short)HIWORD(wParam)) |
#define STRETCH_HALFTONE 4 |
Referenced by pngscale().
typedef int int int int nHeightDest |
typedef int int int nWidthDest |
typedef int nXOriginDest |
typedef int int nYOriginDest |
|
static |
|
static |
References graphics_priv::AlphaBlend, dbg, graphics_priv::hCoreDll, graphics_priv::hGdi32Dll, graphics_priv::hUser32Dll, lvl_error, lvl_warning, and graphics_priv::SetStretchBltMode.
Referenced by graphics_win32_new().
typedef BOOL | ( | WINAPI * | FP_AlphaBlend | ) |
Referenced by initBth(), InitCeGlue(), speech_message_dispatcher(), and wince_reader_thread().
|
static |
References dbg, graphics_priv::hBitmap, graphics_priv::height, graphics_priv::hMemDC, graphics_priv::hOldBitmap, graphics_priv::hOldPrebuildBitmap, graphics_priv::hPrebuildBitmap, graphics_priv::hPrebuildDC, lvl_debug, graphics_priv::pPixelData, graphics_priv::width, and graphics_priv::wnd_handle.
Referenced by CreateGraphicsWindows(), overlay_new(), overlay_resize(), and WndProc().
|
static |
References callback_list_call_attr_2, graphics_priv::cbl, create_memory_dc(), dbg, graphics_priv::frame, g_hwnd, g_szClassName, graphics_priv::height, L, lvl_error, graphics_priv::width, graphics_priv::wnd_handle, graphics_priv::wnd_parent_handle, WndProc(), graphics_priv::x, and graphics_priv::y.
Referenced by draw_mode(), and get_data().
|
static |
References callback_new(), event_win32_add_timeout(), window_priv::hBackLight, window::priv, and SystemIdleTimerReset().
Referenced by get_data().
|
static |
References graphics_priv::hMemDC, graphics_gc_priv::hpen, point::x, and point::y.
|
static |
References graphics_priv::disabled, FALSE, graphics_priv::height, graphics_priv::p, graphics_priv::parent, TRUE, graphics_priv::width, point::x, and point::y.
|
static |
|
static |
References graphics_priv::hMemDC, graphics_gc_priv::hpen, point::x, and point::y.
|
static |
References graphics_priv::bg_color, CreateGraphicsWindows(), dbg, draw_mode_begin, draw_mode_end, FALSE, graphics_priv::height, graphics_priv::hMemDC, graphics_priv::hOldPrebuildBitmap, graphics_priv::hPrebuildBitmap, graphics_priv::hPrebuildDC, ID_CHILD_GFX, lvl_debug, graphics_priv::mode, graphics_priv::width, and graphics_priv::wnd_handle.
|
static |
References graphics_gc_priv::hbrush, graphics_priv::hMemDC, graphics_gc_priv::hpen, point::x, and point::y.
|
static |
References graphics_gc_priv::hbrush, graphics_priv::hMemDC, graphics_gc_priv::hpen, point::x, and point::y.
|
static |
|
static |
References event_win32_add_timeout().
|
static |
References event_timeout::cb, dbg, lvl_debug, event_timeout::multi, event_timeout::timer_id, timers, and win32_timer_cb().
Referenced by disable_suspend(), and event_win32_add_idle().
|
static |
|
static |
References g_hwnd.
|
static |
References event_win32_methods.
Referenced by plugin_init().
|
static |
References event_win32_remove_timeout().
|
static |
References dbg, lvl_debug, lvl_error, event_timeout::timer_id, and timers.
Referenced by event_win32_remove_idle().
|
static |
HFONT EzCreateFont | ( | HDC | hdc, |
TCHAR * | szFaceName, | ||
int | iDeciPtHeight, | ||
int | iDeciPtWidth, | ||
int | iAttributes, | ||
BOOL | fLogRes | ||
) |
References EZ_ATTR_BOLD, EZ_ATTR_ITALIC, EZ_ATTR_STRIKEOUT, EZ_ATTR_UNDERLINE, and int().
Referenced by draw_text().
|
static |
References graphics_font_priv::hfont.
|
static |
References graphics_font_priv::font, font_methods, graphics_font_priv::hfont, graphics_font_priv::size, and size.
References FALSE, g_hwnd, and L.
Referenced by get_data().
|
static |
References graphics_gc_priv::hbrush, and graphics_gc_priv::hpen.
|
static |
References graphics_gc_priv::bg_alpha, graphics_gc_priv::bg_color, graphics_gc_priv::dashed, graphics_gc_priv::fg_alpha, graphics_gc_priv::fg_color, gc_methods, graphics_gc_priv::gr, graphics_gc_priv::hbrush, graphics_gc_priv::hpen, graphics_gc_priv::hwnd, graphics_gc_priv::line_width, and graphics_priv::wnd_handle.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
References dbg, lvl_info, graphics_font_priv::size, point::x, and point::y.
|
static |
|
static |
References attr_search(), bind_late(), cbl, graphics_priv::cbl, event_request_system(), graphics_priv::frame, graphics_win32_new_helper(), graphics_priv::height, graphics_priv::image_cache_hash, graphics_priv::nav, attr::num, graphics_priv::overlays, graphics_priv::parent, window::priv, attr::u, graphics_priv::width, graphics_priv::window, graphics_priv::x, and graphics_priv::y.
Referenced by plugin_init().
|
static |
References graphics_methods, and graphics_priv::mode.
Referenced by graphics_win32_new(), and overlay_new().
|
static |
References callback_list_call_attr_3, and graphics_priv::cbl.
Referenced by WndProc().
|
static |
References callback_list_call_attr_1, graphics_priv::cbl, dbg, key, and lvl_debug.
Referenced by WndProc().
|
static |
References callback_list_call_attr_1, graphics_priv::cbl, dbg, int(), key, lvl_debug, NAVIT_KEY_DOWN, NAVIT_KEY_LEFT, NAVIT_KEY_RIGHT, and NAVIT_KEY_UP.
Referenced by WndProc().
|
static |
References dbg, graphics_priv::image_cache_hash, lvl_info, lvl_warning, pngdecode(), pngscale(), and xpmdecode().
typedef int | ( | WINAPI * | FP_SetStretchBltMode | ) |
Referenced by cache_new(), callback_call(), ch_setup(), cJSON_CreateNumber(), cmp(), org.navitproject.navit.FileBrowserActivity::createFileListAdapter(), EzCreateFont(), file_reader_finish(), get_u32(), graphics_gd_new(), graphics_gtk_drawing_area_new_helper(), graphics_opengl_new_helper(), graphics_qt5_new(), graphics_qt_qpainter_new(), graphics_sdl_new(), gui_internal_button_map_attr_new(), gui_internal_button_navit_attr_new(), HandleKeyDown(), image_create(), item_bin_to_poly_segment(), item_id_from_ptr(), j1850_idle(), label_line(), navit_vehicle_update_position(), org.navitproject.navit.Navit::onCreate(), org.navitproject.navit.NavitGraphics.NavitView::onMenuItemClick(), org.navitproject.navit.NavitGraphics.NavitView::onTouchEvent(), osd_odometer_draw(), osm_add_tag(), overlay_new(), org.navitproject.navit.NavitTextTranslations::p(), parse_number(), parseMain(), pedestrian_graphics_resize(), poly_get_data(), raster_AAFilledEllipse(), raster_hline(), raster_line(), raster_rect_inline(), route_get_coord_dist(), route_segment_data_field_pos(), route_segment_data_size(), org.navitproject.navit.NavitAddressSearchActivity::setCountryButtonImage(), org.navitproject.navit.NavitMapDownloader::updateProgress(), vehicle_webos_gps_update(), and vehicle_webos_timeout_callback().
|
static |
References dbg, graphics_priv::disable, graphics_priv::disabled, and lvl_debug.
|
static |
References graphics_priv::AlphaBlend, create_memory_dc(), dbg, graphics_priv::disabled, graphics_win32_new_helper(), graphics_priv::h, graphics_priv::height, height, graphics_priv::hPrebuildDC, image_cache_hash, graphics_priv::image_cache_hash, lvl_debug, next, graphics_priv::overlays, graphics_priv::w, graphics_priv::width, width, graphics_priv::wnd_handle, point::x, and point::y.
|
static |
References create_memory_dc(), dbg, graphics_priv::h, graphics_priv::height, lvl_debug, graphics_priv::p, graphics_priv::w, graphics_priv::width, point::x, and point::y.
void plugin_init | ( | void | ) |
References event_win32_new(), and graphics_win32_new().
|
static |
References graphics_image_priv::channels, dbg, FALSE, graphics_image_priv::hBitmap, graphics_image_priv::height, graphics_image_priv::hot, lvl_debug, lvl_warning, graphics_image_priv::png_pixels, graphics_image_priv::row_bytes, TRUE, graphics_image_priv::width, point::x, and point::y.
Referenced by image_new().
|
static |
|
static |
|
static |
References callback_call_0, event_timeout::cb, dbg, lvl_error, lvl_info, event_timeout::multi, event_timeout::timer_id, and timers.
Referenced by win32_timer_cb().
void WINAPI SystemIdleTimerReset | ( | void | ) |
Referenced by disable_suspend(), and WndProc().
|
static |
References run_timer().
Referenced by event_win32_add_timeout().
|
static |
References color::a, color::b, callback_list_call_0, callback_list_call_attr_1, callback_list_call_attr_2, cbl, graphics_priv::cbl, create_memory_dc(), dbg, graphics_priv::disabled, color::g, graphics_priv::h, HandleButtonClick(), HandleKeyChar(), HandleKeyDown(), window_priv::hBackLight, graphics_priv::height, graphics_priv::hMemDC, graphics_priv::hOldPrebuildBitmap, graphics_priv::hPrebuildBitmap, graphics_priv::hPrebuildDC, L, lvl_debug, graphics_priv::next, graphics_priv::overlay, graphics_priv::overlays, graphics_priv::p, graphics_priv::pPixelData, window::priv, profile, color::r, SystemIdleTimerReset(), graphics_priv::transparent_color, graphics_priv::w, graphics_priv::width, graphics_priv::window, point::x, graphics_priv::x, point::y, and graphics_priv::y.
Referenced by CreateGraphicsWindows().
|
static |
References FALSE, graphics_image_priv::height, graphics_image_priv::hot, XPM2BMP_TAG::hotspot_x, XPM2BMP_TAG::hotspot_y, graphics_image_priv::pxpm, XPM2BMP_TAG::size_x, XPM2BMP_TAG::size_y, TRUE, graphics_image_priv::width, point::x, Xpm2bmp_load(), Xpm2bmp_new(), and point::y.
Referenced by image_new().
|
static |
Referenced by event_win32_new().
|
static |
Referenced by font_new().
|
static |
Referenced by CreateGraphicsWindows(), event_win32_call_callback(), event_win32_main_loop_quit(), and fullscreen().
|
static |
Referenced by CreateGraphicsWindows().
|
static |
Referenced by gc_new().
|
static |
Referenced by graphics_win32_new_helper().
|
static |
Referenced by event_win32_add_timeout(), event_win32_remove_timeout(), and run_timer().