navit
0.5.3-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 "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 BOOL(WINAPI * | FP_AlphaBlend) (HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, BLENDFUNCTION blendFunction) |
typedef int(WINAPI * | FP_SetStretchBltMode) (HDC dc, int mode) |
Functions | |
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_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_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 |
#define EZ_ATTR_ITALIC 2 |
#define EZ_ATTR_STRIKEOUT 8 |
#define EZ_ATTR_UNDERLINE 4 |
#define GET_WHEEL_DELTA_WPARAM | ( | wParam | ) | ((short)HIWORD(wParam)) |
#define STRETCH_HALFTONE 4 |
typedef BOOL(WINAPI * FP_AlphaBlend) (HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, BLENDFUNCTION blendFunction) |
typedef int(WINAPI * FP_SetStretchBltMode) (HDC dc, int mode) |
|
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().
|
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, and p.
|
static |
References graphics_priv::disabled, graphics_priv::height, graphics_priv::p, p, graphics_priv::parent, graphics_priv::width, point::x, and point::y.
|
static |
References graphics_priv::hMemDC, graphics_image_priv::img, p, pngrender(), and Xpm2bmp_paint().
|
static |
References graphics_gc_priv::gr, graphics_priv::hMemDC, graphics_gc_priv::hpen, and p.
|
static |
References graphics_priv::bg_color, CreateGraphicsWindows(), dbg, draw_mode_begin, draw_mode_end, 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::gr, graphics_gc_priv::hbrush, graphics_priv::hMemDC, graphics_gc_priv::hpen, and p.
|
static |
References graphics_gc_priv::hbrush, graphics_priv::hMemDC, graphics_gc_priv::hpen, p, point::x, and point::y.
|
static |
References graphics_gc_priv::hbrush, graphics_priv::hMemDC, graphics_gc_priv::hpen, and p.
|
static |
|
static |
References event_idle::cb, and 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 event_idle::cb, and 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, and EZ_ATTR_UNDERLINE.
Referenced by draw_text().
|
static |
References graphics_font_priv::hfont.
|
static |
References graphics_font_priv::font, font_methods, and size.
|
static |
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(), graphics_priv::cbl, 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, key, lvl_debug, NAVIT_KEY_DOWN, NAVIT_KEY_LEFT, NAVIT_KEY_RIGHT, and NAVIT_KEY_UP.
Referenced by WndProc().
|
static |
|
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, p, graphics_priv::w, graphics_priv::width, width, graphics_priv::wnd_handle, graphics_priv::wraparound, point::x, and point::y.
|
static |
void plugin_init | ( | void | ) |
References event_win32_new(), and graphics_win32_new().
|
static |
References graphics_image_priv::channels, dbg, graphics_image_priv::hBitmap, graphics_image_priv::height, graphics_image_priv::hot, lvl_debug, lvl_warning, name, graphics_image_priv::png_pixels, graphics_image_priv::row_bytes, 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 callback_list_call_0, callback_list_call_attr_1, callback_list_call_attr_2, graphics_priv::cbl, cbl, create_memory_dc(), dbg, graphics_priv::disabled, graphics_priv::h, HandleButtonClick(), HandleKeyChar(), HandleKeyDown(), window_priv::hBackLight, graphics_priv::height, graphics_priv::hMemDC, graphics_priv::hPrebuildDC, L, lvl_debug, graphics_priv::overlay, graphics_priv::overlays, graphics_priv::pPixelData, window::priv, profile, SystemIdleTimerReset(), graphics_priv::transparent_color, graphics_priv::w, graphics_priv::width, graphics_priv::window, graphics_priv::x, and graphics_priv::y.
Referenced by CreateGraphicsWindows().
|
static |
|
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().