You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(59) |
Sep
(43) |
Oct
(95) |
Nov
(135) |
Dec
(108) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(229) |
Feb
(141) |
Mar
(59) |
Apr
(70) |
May
(64) |
Jun
(87) |
Jul
(57) |
Aug
(108) |
Sep
(74) |
Oct
(203) |
Nov
(141) |
Dec
(108) |
2009 |
Jan
(114) |
Feb
(91) |
Mar
(101) |
Apr
(69) |
May
(54) |
Jun
(82) |
Jul
(49) |
Aug
(109) |
Sep
(81) |
Oct
(93) |
Nov
(100) |
Dec
(79) |
2010 |
Jan
(46) |
Feb
(36) |
Mar
(135) |
Apr
(103) |
May
(116) |
Jun
(130) |
Jul
(52) |
Aug
(31) |
Sep
(46) |
Oct
(48) |
Nov
(98) |
Dec
(110) |
2011 |
Jan
(234) |
Feb
(184) |
Mar
(150) |
Apr
(43) |
May
(53) |
Jun
(52) |
Jul
(112) |
Aug
(72) |
Sep
(79) |
Oct
(23) |
Nov
(6) |
Dec
(30) |
2012 |
Jan
(39) |
Feb
(37) |
Mar
(49) |
Apr
(60) |
May
(63) |
Jun
(38) |
Jul
(33) |
Aug
(24) |
Sep
(20) |
Oct
(14) |
Nov
(23) |
Dec
(50) |
2013 |
Jan
(30) |
Feb
(32) |
Mar
(27) |
Apr
(41) |
May
(59) |
Jun
(21) |
Jul
(10) |
Aug
(73) |
Sep
(23) |
Oct
(60) |
Nov
(14) |
Dec
(15) |
2014 |
Jan
(4) |
Feb
(8) |
Mar
(11) |
Apr
(6) |
May
(27) |
Jun
(4) |
Jul
(29) |
Aug
(62) |
Sep
(11) |
Oct
(17) |
Nov
(58) |
Dec
(9) |
2015 |
Jan
(23) |
Feb
(3) |
Mar
(26) |
Apr
(47) |
May
(8) |
Jun
(28) |
Jul
(10) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Albert L F. <af...@us...> - 2008-02-04 00:46:01
|
Update of /cvsroot/navit/navit/projs/CodeBlocks In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29752 Added Files: Navit_gtk.cbp Navit_win32.cbp speech_speech_dispatcher.cbp Log Message: Fix:projs/CodeBlocks:update project files, more work on native win32 gui/graphics --- NEW FILE: Navit_win32.cbp --- <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <CodeBlocks_project_file> <FileVersion major="1" minor="6" /> <Project> <Option title="Navit_win32" /> <Option pch_mode="2" /> <Option compiler="gcc" /> <Build> <Target title="Debug"> <Option output="bin\Debug\Navit_win32" prefix_auto="1" extension_auto="1" /> <Option object_output="obj\Debug\" /> <Option external_deps="bin\Debug\libnavit.a;bin\Debug\libvehicle_file.la;bin\Debug\libdata_binfile.la;bin\Debug\libgtk_graphics.la;bin\Debug\libgtk_gui.la;bin\Debug\libwin32_gui.la" /> <Option type="1" /> <Option compiler="gcc" /> <Option use_console_runner="0" /> <Compiler> <Add option="-g" /> </Compiler> <Linker> <Add library="bin\Debug\libvehicle_file.la" /> <Add library="bin\Debug\libdata_binfile.la" /> <Add library="bin\Debug\libvehicle_demo.la" /> <Add library="bin\Debug\libdata_poi_geodownload.la" /> <Add library="bin\Debug\libmdb.a" /> <Add library="bin\Debug\libdata_garmin.la" /> <Add library="bin\Debug\libspeech_speech_dispatcher.la" /> <Add library="bin\Debug\libdata_mg.la" /> <Add library="bin\Debug\libdata_textfile.la" /> <Add library="libgarmin.a" /> <Add library="bin\Debug\libwin32_gui.la" /> <Add library="bin\Debug\libnavit.a" /> <Add library="bin\Debug\libfib.a" /> <Add library="ole32" /> <Add library="user32" /> <Add library="gdi32" /> <Add library="z" /> <Add library="gobject-2.0" /> <Add library="gmodule-2.0" /> <Add library="glib-2.0" /> <Add library="intl" /> <Add directory="bin\Debug" /> <Add directory="." /> <Add directory="Win32Extra\libgarmin" /> </Linker> </Target> <Target title="Release"> <Option output="bin\Release\Navit_win32" prefix_auto="1" extension_auto="1" /> <Option object_output="obj\Release\" /> <Option external_deps="bin\Release\libnavit.a;bin\Release\libvehicle_file.la;bin\Release\libdata_binfile.la;bin\Release\libgtk_graphics.la;bin\Release\libgtk_gui.la;bin\Release\libwin32_gui.la" /> <Option type="1" /> <Option compiler="gcc" /> <Option use_console_runner="0" /> <Compiler> <Add option="-O2" /> </Compiler> <Linker> <Add option="-s" /> <Add library="bin\Release\libvehicle_file.la" /> <Add library="bin\Release\libdata_binfile.la" /> <Add library="bin\Release\libgtk_graphics.la" /> <Add library="bin\Release\libvehicle_demo.la" /> <Add library="bin\Release\libgtk_gui.la" /> <Add library="bin\Release\libdata_poi_geodownload.la" /> <Add library="bin\Release\libmdb.a" /> <Add library="bin\Release\libdata_garmin.la" /> <Add library="bin\Release\libspeech_speech_dispatcher.la" /> <Add library="bin\Release\libdata_mg.la" /> <Add library="bin\Release\libdata_textfile.la" /> <Add library="bin\Release\libwin32_gui.la" /> <Add library="libgarmin.a" /> <Add library="bin\Release\libnavit.a" /> <Add library="bin\Release\libfib.a" /> <Add library="ole32" /> <Add library="user32" /> <Add library="gdi32" /> <Add library="z" /> <Add library="gobject-2.0" /> <Add library="gmodule-2.0" /> <Add library="glib-2.0" /> <Add library="intl" /> <Add directory="." /> <Add directory="Win32Extra\libgarmin" /> </Linker> </Target> </Build> <Compiler> <Add option="-Wall" /> <Add option="-mms-bitfields" /> <Add option="-DMODULE=Navit" /> <Add option='-DPREFIX=\"/usr/local\"' /> <Add directory="%GTK_DIR%\include" /> <Add directory="%GTK_DIR%\include\gtk-2.0" /> <Add directory="%GTK_DIR%\include\glib-2.0" /> <Add directory="%GTK_DIR%\lib\gtk-2.0\include" /> <Add directory="%GTK_DIR%\lib\glib-2.0\include" /> <Add directory="%GTK_DIR%\include\cairo" /> <Add directory="%GTK_DIR%\include\pango-1.0" /> <Add directory="%GTK_DIR%\include\atk-1.0" /> <Add directory="..\..\src" /> <Add directory="Win32Extra" /> <Add directory="..\..\src\fib-1.1" /> <Add directory="%GTK_DIR%\include\freetype2" /> </Compiler> <Linker> <Add directory="%GTK_DIR%\lib" /> </Linker> <Unit filename="Win32Extra\navit_win32.c"> <Option compilerVar="CC" /> </Unit> <Extensions> <code_completion /> <envvars /> <debugger /> </Extensions> </Project> </CodeBlocks_project_file> --- NEW FILE: speech_speech_dispatcher.cbp --- <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <CodeBlocks_project_file> <FileVersion major="1" minor="6" /> <Project> <Option title="speech" /> <Option pch_mode="2" /> <Option compiler="gcc" /> <Build> <Target title="Debug"> <Option output=".\bin\Debug\libspeech_speech_dispatcher.la" prefix_auto="1" extension_auto="0" /> <Option working_dir="" /> <Option object_output=".\obj\Debug\" /> <Option type="2" /> <Option compiler="gcc" /> <Option createDefFile="1" /> <Compiler> <Add option="-g" /> </Compiler> <Linker> <Add directory="%GTK_DIR%\lib" /> <Add directory="bin\Debug" /> </Linker> </Target> <Target title="Release"> <Option output=".\bin\Release\libspeech_speech_dispatcher.la" prefix_auto="1" extension_auto="0" /> <Option working_dir="" /> <Option object_output=".\obj\Release\" /> <Option type="2" /> <Option compiler="gcc" /> <Option createDefFile="1" /> <Compiler> <Add option="-O2" /> </Compiler> <Linker> <Add option="-s" /> <Add directory="%GTK_DIR%\lib" /> <Add directory="bin\Release" /> </Linker> </Target> </Build> <Compiler> <Add option="-Wall" /> <Add option="-mms-bitfields" /> <Add option="-DBUILD_DLL" /> <Add option="-DMODULE=speech_speech_dispatcher" /> <Add directory="%GTK_DIR%\include\glib-2.0" /> <Add directory="%GTK_DIR%\lib\glib-2.0\include" /> <Add directory="Win32Extra" /> <Add directory="..\..\src" /> <Add directory="." /> <Add directory="Win32Extra\libgarmin" /> <Add directory="C:\Program Files\Microsoft Speech SDK 5.1\Include" /> </Compiler> <Linker> <Add library="NavitCommonLib" /> <Add library="glib-2.0" /> <Add library="user32" /> <Add library="intl" /> <Add library="iconv" /> <Add directory="%GTK_DIR%\lib" /> </Linker> <Unit filename="Win32Extra\speech_dispatcher_win32.c"> <Option compilerVar="CC" /> </Unit> <Unit filename="..\..\src\data\garmin\garmin.h" /> <Extensions> <code_completion /> <envvars /> <debugger /> </Extensions> </Project> </CodeBlocks_project_file> --- NEW FILE: Navit_gtk.cbp --- <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <CodeBlocks_project_file> <FileVersion major="1" minor="6" /> <Project> <Option title="Navit_gtk" /> <Option pch_mode="2" /> <Option compiler="gcc" /> <Build> <Target title="Debug"> <Option output="bin\Debug\Navit_gtk" prefix_auto="1" extension_auto="1" /> <Option object_output="obj\Debug\" /> <Option external_deps="bin\Debug\libnavit.a;bin\Debug\libvehicle_file.la;bin\Debug\libdata_binfile.la;bin\Debug\libgtk_graphics.la;bin\Debug\libgtk_gui.la;bin\Debug\libwin32_gui.la" /> <Option type="1" /> <Option compiler="gcc" /> <Option use_console_runner="0" /> <Compiler> <Add option="-g" /> </Compiler> <Linker> <Add library="bin\Debug\libvehicle_file.la" /> <Add library="bin\Debug\libdata_binfile.la" /> <Add library="bin\Debug\libgtk_graphics.la" /> <Add library="bin\Debug\libgtk_gui.la" /> <Add library="bin\Debug\libvehicle_demo.la" /> <Add library="bin\Debug\libdata_poi_geodownload.la" /> <Add library="bin\Debug\libmdb.a" /> <Add library="bin\Debug\libdata_garmin.la" /> <Add library="bin\Debug\libspeech_speech_dispatcher.la" /> <Add library="bin\Debug\libdata_mg.la" /> <Add library="bin\Debug\libdata_textfile.la" /> <Add library="libgarmin.a" /> <Add library="bin\Debug\libnavit.a" /> <Add library="bin\Debug\libfib.a" /> <Add library="ole32" /> <Add library="user32" /> <Add library="gdi32" /> <Add library="gtk-win32-2.0" /> <Add library="gdk-win32-2.0" /> <Add library="gdk_pixbuf-2.0" /> <Add library="freetype" /> <Add library="fontconfig" /> <Add library="z" /> <Add library="gobject-2.0" /> <Add library="gmodule-2.0" /> <Add library="glib-2.0" /> <Add library="intl" /> <Add directory="bin\Debug" /> <Add directory="." /> <Add directory="Win32Extra\libgarmin" /> </Linker> </Target> <Target title="Release"> <Option output="bin\Release\Navit_gtk" prefix_auto="1" extension_auto="1" /> <Option object_output="obj\Release\" /> <Option type="1" /> <Option compiler="gcc" /> <Option use_console_runner="0" /> <Compiler> <Add option="-O2" /> </Compiler> <Linker> <Add option="-s" /> <Add library="bin\Release\libvehicle_file.la" /> <Add library="bin\Release\libdata_binfile.la" /> <Add library="bin\Release\libgtk_graphics.la" /> <Add library="bin\Release\libvehicle_demo.la" /> <Add library="bin\Release\libgtk_gui.la" /> <Add library="bin\Release\libdata_poi_geodownload.la" /> <Add library="bin\Release\libmdb.a" /> <Add library="bin\Release\libdata_garmin.la" /> <Add library="bin\Release\libspeech_speech_dispatcher.la" /> <Add library="bin\Release\libdata_mg.la" /> <Add library="bin\Release\libdata_textfile.la" /> <Add library="libgarmin.a" /> <Add library="bin\Release\libnavit.a" /> <Add library="bin\Release\libfib.a" /> <Add library="ole32" /> <Add library="user32" /> <Add library="gtk-win32-2.0" /> <Add library="gdk-win32-2.0" /> <Add library="gdk_pixbuf-2.0" /> <Add library="freetype" /> <Add library="z" /> <Add library="gobject-2.0" /> <Add library="gmodule-2.0" /> <Add library="glib-2.0" /> <Add library="intl" /> <Add directory="." /> <Add directory="Win32Extra\libgarmin" /> </Linker> </Target> </Build> <Compiler> <Add option="-Wall" /> <Add option="-mms-bitfields" /> <Add option="-DMODULE=Navit" /> <Add option='-DPREFIX=\"/usr/local\"' /> <Add directory="%GTK_DIR%\include" /> <Add directory="%GTK_DIR%\include\gtk-2.0" /> <Add directory="%GTK_DIR%\include\glib-2.0" /> <Add directory="%GTK_DIR%\lib\gtk-2.0\include" /> <Add directory="%GTK_DIR%\lib\glib-2.0\include" /> <Add directory="%GTK_DIR%\include\cairo" /> <Add directory="%GTK_DIR%\include\pango-1.0" /> <Add directory="%GTK_DIR%\include\atk-1.0" /> <Add directory="..\..\src" /> <Add directory="Win32Extra" /> <Add directory="..\..\src\fib-1.1" /> <Add directory="%GTK_DIR%\include\freetype2" /> </Compiler> <Linker> <Add directory="%GTK_DIR%\lib" /> </Linker> <Unit filename="Win32Extra\navit_gtk.c"> <Option compilerVar="CC" /> </Unit> <Extensions> <code_completion /> <envvars /> <debugger /> </Extensions> </Project> </CodeBlocks_project_file> |
From: Albert L F. <af...@us...> - 2008-02-04 00:43:58
|
Update of /cvsroot/navit/navit/projs/CodeBlocks/win32gui In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28478/win32gui Modified Files: win32_graphics.c win32_gui.c win32_gui.h Log Message: Fix:projs/CodeBlocks:update project files, more work on native win32 gui/graphics Index: win32_graphics.c =================================================================== RCS file: /cvsroot/navit/navit/projs/CodeBlocks/win32gui/win32_graphics.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** win32_graphics.c 1 Feb 2008 22:42:08 -0000 1.2 --- win32_graphics.c 4 Feb 2008 00:44:01 -0000 1.3 *************** *** 9,14 **** #include "color.h" #include "plugin.h" - #define ID_CHILD_GFX 2000 #include "xpm2bmp.h"; --- 9,14 ---- #include "color.h" #include "plugin.h" + #include "win32_gui.h" #include "xpm2bmp.h"; *************** *** 17,20 **** --- 17,98 ---- #endif + HFONT EzCreateFont (HDC hdc, TCHAR * szFaceName, int iDeciPtHeight, + int iDeciPtWidth, int iAttributes, BOOL fLogRes) ; + + #define EZ_ATTR_BOLD 1 + #define EZ_ATTR_ITALIC 2 + #define EZ_ATTR_UNDERLINE 4 + #define EZ_ATTR_STRIKEOUT 8 + + HFONT EzCreateFont (HDC hdc, TCHAR * szFaceName, int iDeciPtHeight, + int iDeciPtWidth, int iAttributes, BOOL fLogRes) + { + FLOAT cxDpi, cyDpi ; + HFONT hFont ; + LOGFONT lf ; + POINT pt ; + TEXTMETRIC tm ; + + SaveDC (hdc) ; + + SetGraphicsMode (hdc, GM_ADVANCED) ; + ModifyWorldTransform (hdc, NULL, MWT_IDENTITY) ; + SetViewportOrgEx (hdc, 0, 0, NULL) ; + SetWindowOrgEx (hdc, 0, 0, NULL) ; + + if (fLogRes) + { + cxDpi = (FLOAT) GetDeviceCaps (hdc, LOGPIXELSX) ; + cyDpi = (FLOAT) GetDeviceCaps (hdc, LOGPIXELSY) ; + } + else + { + cxDpi = (FLOAT) (25.4 * GetDeviceCaps (hdc, HORZRES) / + GetDeviceCaps (hdc, HORZSIZE)) ; + + cyDpi = (FLOAT) (25.4 * GetDeviceCaps (hdc, VERTRES) / + GetDeviceCaps (hdc, VERTSIZE)) ; + } + + pt.x = (int) (iDeciPtWidth * cxDpi / 72) ; + pt.y = (int) (iDeciPtHeight * cyDpi / 72) ; + + DPtoLP (hdc, &pt, 1) ; + lf.lfHeight = - (int) (fabs (pt.y) / 10.0 + 0.5) ; + lf.lfWidth = 0 ; + lf.lfEscapement = 0 ; + lf.lfOrientation = 0 ; + lf.lfWeight = iAttributes & EZ_ATTR_BOLD ? 700 : 0 ; + lf.lfItalic = iAttributes & EZ_ATTR_ITALIC ? 1 : 0 ; + lf.lfUnderline = iAttributes & EZ_ATTR_UNDERLINE ? 1 : 0 ; + lf.lfStrikeOut = iAttributes & EZ_ATTR_STRIKEOUT ? 1 : 0 ; + lf.lfCharSet = DEFAULT_CHARSET ; + lf.lfOutPrecision = 0 ; + lf.lfClipPrecision = 0 ; + lf.lfQuality = 0 ; + lf.lfPitchAndFamily = 0 ; + + lstrcpy (lf.lfFaceName, szFaceName) ; + + hFont = CreateFontIndirect (&lf) ; + + if (iDeciPtWidth != 0) + { + hFont = (HFONT) SelectObject (hdc, hFont) ; + + GetTextMetrics (hdc, &tm) ; + + DeleteObject (SelectObject (hdc, hFont)) ; + + lf.lfWidth = (int) (tm.tmAveCharWidth * + fabs (pt.x) / fabs (pt.y) + 0.5) ; + + hFont = CreateFontIndirect (&lf) ; + } + + RestoreDC (hdc, -1) ; + return hFont ; + } + struct graphics_image_priv { PXPM2BMP pxpm; *************** *** 53,73 **** - struct graphics_priv { - struct point p; - int width; - int height; - int library_init; - int visible; - HANDLE wnd_parent_handle; - HANDLE wnd_handle; - - void (*resize_callback)(void *data, int w, int h); - void *resize_callback_data; - void (*motion_callback)(void *data, struct point *p); - void *motion_callback_data; - void (*button_callback)(void *data, int press, int button, struct point *p); - void *button_callback_data; - enum draw_mode_num mode; - }; struct graphics_gc_priv { --- 131,134 ---- *************** *** 119,127 **** } static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { ! if ( Message != 15 ) ! printf( "CHILD %d %d %d \n", Message, wParam, lParam ); switch(Message) { --- 180,200 ---- } + static void HandleButtonClick( int updown, int button, long lParam ) + { + int xPos = LOWORD(lParam); + int yPos = HIWORD(lParam); + // printf( "WM_LBUTTONDOWN: %d %d \n", xPos, yPos ); + if (g_gra->button_callback ) + { + struct point pt = {xPos, yPos}; + (*g_gra->button_callback)(g_gra->button_callback_data, updown, button, &pt); + } + } + static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { ! //if ( Message != 15 ) ! // printf( "CHILD %d %d %d \n", Message, wParam, lParam ); switch(Message) { *************** *** 152,159 **** DestroyWindow(hwnd); break; - case WM_LBUTTONDBLCLK: - if (g_gra->resize_callback) - (*g_gra->resize_callback)(g_gra->resize_callback_data, g_gra->width, g_gra->height); - break; case WM_SIZE: { --- 225,228 ---- *************** *** 194,230 **** struct point pt = {xPos, yPos}; ! printf( "WM_MOUSEMOVE: %d %d \n", xPos, yPos ); (*g_gra->motion_callback)(g_gra->motion_callback_data, &pt); } break; - case WM_LBUTTONUP: - { - int xPos = LOWORD(lParam); - int yPos = HIWORD(lParam); - - struct point pt = { xPos, yPos }; - - printf( "WM_LBUTTONUP: %d %d \n", xPos, yPos ); - if (g_gra->button_callback ) - { - struct point pt = {xPos, yPos}; - (*g_gra->button_callback)(g_gra->button_callback_data, 0, 1, &pt); - } - - } - break; case WM_LBUTTONDOWN: ! { ! int xPos = LOWORD(lParam); ! int yPos = HIWORD(lParam); ! printf( "WM_LBUTTONDOWN: %d %d \n", xPos, yPos ); ! if (g_gra->button_callback ) ! { ! struct point pt = {xPos, yPos}; ! (*g_gra->button_callback)(g_gra->button_callback_data, 1, 1, &pt); ! } ! } break; --- 263,283 ---- struct point pt = {xPos, yPos}; ! // printf( "WM_MOUSEMOVE: %d %d \n", xPos, yPos ); (*g_gra->motion_callback)(g_gra->motion_callback_data, &pt); } break; case WM_LBUTTONDOWN: ! HandleButtonClick( 1, 1,lParam ); ! break; ! case WM_LBUTTONUP: ! HandleButtonClick( 0, 1,lParam ); ! break; ! case WM_RBUTTONDOWN: ! HandleButtonClick( 1, 3,lParam ); ! break; ! case WM_RBUTTONUP: ! HandleButtonClick( 0, 3,lParam ); break; *************** *** 276,282 **** } ! g_gra->width = rcParent.right - rcParent.left; ! g_gra->height = rcParent.bottom - rcParent.top; ! hwnd = CreateWindow( g_szClassName, --- 329,334 ---- } ! gr->width = rcParent.right - rcParent.left; ! gr->height = rcParent.bottom - rcParent.top; hwnd = CreateWindow( g_szClassName, *************** *** 285,290 **** 0, 0, ! g_gra->width, ! g_gra->height, gr->wnd_parent_handle, (HMENU)ID_CHILD_GFX, --- 337,342 ---- 0, 0, ! gr->width, ! gr->height, gr->wnd_parent_handle, (HMENU)ID_CHILD_GFX, *************** *** 405,408 **** --- 457,461 ---- static void draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count) { + //if (gr->mode == draw_mode_begin || gr->mode == draw_mode_end) { *************** *** 460,472 **** static void draw_restore(struct graphics_priv *gr, struct point *p, int w, int h) { ! // AF TODO ! printf( "draw restore \n" ); ! ! InvalidateRect( gr->wnd_handle, NULL, FALSE ); } static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode) { ! printf( "set draw_mode to %d\n", (int)mode ); if ( mode == draw_mode_begin ) --- 513,522 ---- static void draw_restore(struct graphics_priv *gr, struct point *p, int w, int h) { ! InvalidateRect( gr->wnd_handle, NULL, TRUE ); } static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode) { ! // printf( "set draw_mode to %d\n", (int)mode ); if ( mode == draw_mode_begin ) *************** *** 476,479 **** --- 526,540 ---- CreateGraphicsWindows( gr ); } + if ( gr->mode != draw_mode_begin ) + { + if ( hMemDC ) + { + RECT rcClient; + HBRUSH bgBrush = CreateSolidBrush( gr->bg_color ); + GetClientRect( gr->wnd_handle, &rcClient ); + FillRect( hMemDC, &rcClient, bgBrush ); + DeleteObject( bgBrush ); + } + } } *************** *** 524,538 **** static void background_gc(struct graphics_priv *gr, struct graphics_gc_priv *gc) { ! // gr->background_gc=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 struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, int size) { ! meth = NULL; ! return NULL; } --- 585,684 ---- static void background_gc(struct graphics_priv *gr, struct graphics_gc_priv *gc) { ! RECT rcClient; ! HBRUSH bgBrush = CreateSolidBrush( gc->bg_color ); ! GetClientRect( gr->wnd_handle, &rcClient ); ! FillRect( hMemDC, &rcClient, bgBrush ); ! DeleteObject( bgBrush ); ! gr->bg_color = gc->bg_color; } + struct graphics_font_priv { + LOGFONT lf; + HFONT hfont; + int size; + }; + 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) { + RECT rcClient; + GetClientRect( gr->wnd_handle, &rcClient ); + + int prevBkMode = SetBkMode( hMemDC, TRANSPARENT ); + + if ( NULL == font->hfont ) + { + int size = font->size; + long lfHeight = -MulDiv(font->size, GetDeviceCaps(hMemDC, LOGPIXELSY), 72); + + font->hfont = EzCreateFont (hMemDC, TEXT ("Arial"), size/2, 0, 0, TRUE) ; + GetObject ( font->hfont, sizeof (LOGFONT), &font->lf) ; + + /* + font->hfont = CreateFont( lfHeight, + 0, + 0, + 0, + 0, + TRUE, + 0, + 0, + DEFAULT_CHARSET, + 0, + 0, + 0, + 0, + "Arial"); + */ + } + + + // RECT rc = { p->x, p->y, 800, 800 }; + // DrawText(hMemDC, text, -1, &rc, DT_NOCLIP | DT_CALCRECT| DT_SINGLELINE); + double angle = -atan2( dy, dx ) * 180 / 3.14159 ; + // printf( "dx %d , dy %d angle %6.3f %s\n", dx, dy, angle, text); + SetTextAlign (hMemDC, TA_BASELINE) ; + SetViewportOrgEx (hMemDC, p->x, p->y, NULL) ; + font->lf.lfEscapement = font->lf.lfOrientation = ( angle * 10 ) ; + DeleteObject (font->hfont) ; + + font->hfont = CreateFontIndirect (&font->lf); + HFONT hOldFont = SelectObject(hMemDC, font->hfont ); + + TextOut(hMemDC, 0,0, text, strlen( text ) ); + + SelectObject(hMemDC, hOldFont); + DeleteObject (font->hfont) ; + + SetBkMode( hMemDC, prevBkMode ); + + SetViewportOrgEx (hMemDC, 0, 0, NULL) ; + + } + + + + static void font_destroy(struct graphics_font_priv *font) + { + if ( font->hfont ) + { + DeleteObject(font->hfont); + } + g_free(font); } + static struct graphics_font_methods font_methods = { + font_destroy + }; + static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, int size) { ! struct graphics_font_priv *font=g_new(struct graphics_font_priv, 1); ! *meth = font_methods; ! ! font->hfont = NULL; ! font->size = size; ! // FontFamily fontFamily( "Liberation Mono"); ! //font( &fontFamily, size, FontStyleRegular, UnitPoint ); ! return font; } *************** *** 584,587 **** --- 730,734 ---- *meth=graphics_methods; g_gra = this_; + this_->mode = -1; return this_; } Index: win32_gui.h =================================================================== RCS file: /cvsroot/navit/navit/projs/CodeBlocks/win32gui/win32_gui.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32_gui.h 24 Jan 2008 20:45:26 -0000 1.1 --- win32_gui.h 4 Feb 2008 00:44:01 -0000 1.2 *************** *** 3,6 **** --- 3,22 ---- #include "coord.h" + #include "point.h" + #include "graphics.h" + + #define ID_CHILD_GFX 2000 + #define ID_CHILD_1 2001 + #define ID_CHILD_2 ID_CHILD_1 + 1 + #define ID_CHILD_3 ID_CHILD_2 + 1 + #define ID_CHILD_4 ID_CHILD_4 + 1 + #define ID_DISPLAY_ZOOMIN 8000 + #define ID_DISPLAY_ZOOMOUT 8001 + + #define ID_FILE_EXIT 9001 + #define ID_STUFF_GO 9002 + + #define _(text) gettext(text) + struct statusbar_methods; *************** *** 15,18 **** --- 31,55 ---- }; + + struct graphics_priv { + struct point p; + int width; + int height; + int library_init; + int visible; + HANDLE wnd_parent_handle; + HANDLE wnd_handle; + COLORREF bg_color; + + + void (*resize_callback)(void *data, int w, int h); + void *resize_callback_data; + void (*motion_callback)(void *data, struct point *p); + void *motion_callback_data; + void (*button_callback)(void *data, int press, int button, struct point *p); + void *button_callback_data; + enum draw_mode_num mode; + }; + struct menu_priv *gui_gtk_menubar_new(struct gui_priv *gui, struct menu_methods *meth); struct menu_priv *gui_gtk_toolbar_new(struct gui_priv *gui, struct menu_methods *meth); *************** *** 21,23 **** --- 58,62 ---- struct datawindow_priv *gui_gtk_datawindow_new(struct gui_priv *gui, char *name, struct callback *click, struct callback *close, struct datawindow_methods *meth); + struct graphics_priv* win32_graphics_new( struct graphics_methods *meth, struct attr **attrs); + #endif Index: win32_gui.c =================================================================== RCS file: /cvsroot/navit/navit/projs/CodeBlocks/win32gui/win32_gui.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** win32_gui.c 1 Feb 2008 22:42:08 -0000 1.2 --- win32_gui.c 4 Feb 2008 00:44:01 -0000 1.3 *************** *** 8,39 **** #include "win32_gui.h" #include "point.h" - #define ID_DISPLAY_ZOOMIN 8000 - #define ID_DISPLAY_ZOOMOUT 8001 ! #define ID_FILE_EXIT 9001 ! #define ID_STUFF_GO 9002 - const char g_szClassName[] = "myWindowClass"; ! #define ID_CHILD_GFX 2000 ! #define ID_CHILD_1 2001 ! #define ID_CHILD_2 ID_CHILD_1 + 1 ! #define ID_CHILD_3 ID_CHILD_2 + 1 ! #define ID_CHILD_4 ID_CHILD_4 + 1 ! ! #define _(text) gettext(text) gboolean message_pump( gpointer data ) { ! Sleep( 100 ); ! printf( "pump\n" ); - MSG messages; /* Here messages to the application are saved */ if (GetMessage (&messages, NULL, 0, 0)) { - /* Translate virtual-key messages into character messages */ TranslateMessage(&messages); - /* Send message to WindowProcedure */ DispatchMessage(&messages); } --- 8,27 ---- #include "win32_gui.h" #include "point.h" + #include "menu.h" ! const char g_szClassName[] = "navit_gui_class"; ! static menu_id = 0; ! static POINT menu_pt; gboolean message_pump( gpointer data ) { ! MSG messages; if (GetMessage (&messages, NULL, 0, 0)) { TranslateMessage(&messages); DispatchMessage(&messages); } *************** *** 41,69 **** exit( 0 ); } ! return TRUE; } - struct gui_priv *g_this_; - - - struct graphics_priv { - struct point p; - int width; - int height; - int library_init; - int visible; - HANDLE wnd_parent_handle; - HANDLE wnd_handle; - void (*resize_callback)(void *data, int w, int h); - void *resize_callback_data; - void (*motion_callback)(void *data, struct point *p); - void *motion_callback_data; - void (*button_callback)(void *data, int press, int button, struct point *p); - void *button_callback_data; - // enum draw_mode_num mode; - }; --- 29,38 ---- exit( 0 ); } ! return TRUE; } *************** *** 96,100 **** RECT rcClient; ! printf( "PARENT %d %d %d \n", Message, wParam, lParam ); switch(Message) --- 65,69 ---- RECT rcClient; ! //printf( "PARENT %d %d %d \n", Message, wParam, lParam ); switch(Message) *************** *** 106,110 **** hMenu = CreateMenu(); ! g_this_->hwnd = hwnd; hSubMenu = CreatePopupMenu(); --- 75,79 ---- hMenu = CreateMenu(); ! // g_this_->hwnd = hwnd; hSubMenu = CreatePopupMenu(); *************** *** 152,157 **** --- 121,135 ---- break; case WM_COMMAND: + { + struct gui_priv* gui = (struct gui_priv*)GetWindowLongPtr( hwnd , DWLP_USER ); + switch(LOWORD(wParam)) { + case ID_DISPLAY_ZOOMIN: + navit_zoom_in(gui->nav, 2, NULL); + break; + case ID_DISPLAY_ZOOMOUT: + navit_zoom_out(gui->nav, 2, NULL); + break; case ID_FILE_EXIT: PostMessage(hwnd, WM_CLOSE, 0, 0); *************** *** 160,167 **** (*g_gra->resize_callback)(g_gra->resize_callback_data, g_gra->width, g_gra->height); ! // navit_draw(g_this_->nav); // MessageBox(hwnd, "You clicked Go!", "Woo!", MB_OK); break; } break; case WM_USER+ 1: --- 138,146 ---- (*g_gra->resize_callback)(g_gra->resize_callback_data, g_gra->width, g_gra->height); ! // navit_draw(gui->nav); // MessageBox(hwnd, "You clicked Go!", "Woo!", MB_OK); break; } + } break; case WM_USER+ 1: *************** *** 183,197 **** break; case WM_MOUSEWHEEL: { ! struct gui_priv * priv = GetWindowLongPtr( hwnd, DWLP_USER ); short delta = GET_WHEEL_DELTA_WPARAM( wParam ); if ( delta > 0 ) { ! navit_zoom_in(g_this_->nav, 2, NULL); } else{ ! navit_zoom_out(g_this_->nav, 2, NULL); } } --- 162,177 ---- break; + case WM_MOUSEWHEEL: { ! struct gui_priv* gui = (struct gui_priv*)GetWindowLongPtr( hwnd , DWLP_USER ); short delta = GET_WHEEL_DELTA_WPARAM( wParam ); if ( delta > 0 ) { ! navit_zoom_in(gui->nav, 2, NULL); } else{ ! navit_zoom_out(gui->nav, 2, NULL); } } *************** *** 204,208 **** } ! HANDLE Win32Init( void ) { WNDCLASSEX wc; --- 184,188 ---- } ! HANDLE CreateWin32Window( void ) { WNDCLASSEX wc; *************** *** 214,218 **** wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; ! wc.cbWndExtra = 0; wc.hInstance = NULL; wc.hIcon = NULL; --- 194,198 ---- wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; ! wc.cbWndExtra = 32; wc.hInstance = NULL; wc.hIcon = NULL; *************** *** 225,230 **** if(!RegisterClassEx(&wc)) { ! MessageBox(NULL, "Window Registration Failed!", "Error!", ! MB_ICONEXCLAMATION | MB_OK); return 0; } --- 205,209 ---- if(!RegisterClassEx(&wc)) { ! MessageBox(NULL, "Window Registration Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK); return 0; } *************** *** 240,245 **** if(hwnd == NULL) { ! MessageBox(NULL, "Window Creation Failed!", "Error!", ! MB_ICONEXCLAMATION | MB_OK); return 0; } --- 219,223 ---- if(hwnd == NULL) { ! MessageBox(NULL, "Window Creation Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK); return 0; } *************** *** 257,263 **** { HANDLE* wndHandle_ptr = graphics_get_data(gra, "wnd_parent_handle_ptr"); - *wndHandle_ptr = this_->hwnd; - graphics_get_data(gra, "START_CLIENT"); return 0; --- 235,239 ---- *************** *** 276,279 **** --- 252,340 ---- } + struct menu_priv { + HWND wnd_handle; + HMENU hMenu; + }; + + static struct menu_methods menu_methods; + + + static struct menu_priv *add_menu( struct menu_priv *menu, + struct menu_methods *meth, + char *name, + enum menu_type type, + struct callback *cb) + { + struct menu_priv* ret = NULL; + + ret = g_new0(struct menu_priv, 1); + + *ret = *menu; + *meth = menu_methods; + + if ( type == menu_type_submenu ) + { + HMENU hSubMenu = NULL; + hSubMenu = CreatePopupMenu(); + AppendMenu(menu->hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, name ); + ret->hMenu = hSubMenu; + } + else + { + AppendMenu( menu->hMenu, MF_STRING, menu_id, name ); + } + menu_id++; + + return ret; + + } + + static void set_toggle(struct menu_priv *menu, int active) + { + // gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(menu->action), active); + } + + static int get_toggle(struct menu_priv *menu) + { + // return gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(menu->action)); + return 0; + } + + static struct menu_methods menu_methods = { + add_menu, + set_toggle, + get_toggle, + }; + + static void popup_activate(struct menu_priv *menu) + { + POINT menu_pt = { 200,200 }; + POINT pnt = menu_pt; + + ClientToScreen(menu->wnd_handle, (LPPOINT) &pnt); + + if (menu->hMenu) + { + TrackPopupMenu (menu->hMenu, 0, pnt.x, pnt.y, 0, menu->wnd_handle, NULL); + } + } + + struct menu_priv* win32_gui_popup_new(struct gui_priv *this_, struct menu_methods *meth) + { + struct menu_priv* ret = NULL; + + ret = g_new0(struct menu_priv, 1); + *meth = menu_methods; + + menu_id = 4000; + + ret->hMenu = CreatePopupMenu(); + ret->wnd_handle = this_->hwnd; + meth->popup=popup_activate; + + printf( "create popup menu %d \n", ret->hMenu ); + + return ret; + } struct gui_methods win32_gui_methods = { *************** *** 281,285 **** NULL, // win32_gui_toolbar_new, NULL, // win32_gui_statusbar_new, ! NULL, // win32_gui_popup_new, win32_gui_set_graphics, NULL, --- 342,346 ---- NULL, // win32_gui_toolbar_new, NULL, // win32_gui_statusbar_new, ! win32_gui_popup_new, win32_gui_set_graphics, NULL, *************** *** 293,298 **** { struct gui_priv *this_; - int w=792, h=547; - unsigned xid = 0; *meth=win32_gui_methods; --- 354,357 ---- *************** *** 301,318 **** this_->nav=nav; ! g_this_ = this_; ! ! this_->hwnd = Win32Init(); SetWindowLongPtr( this_->hwnd , DWLP_USER, this_ ); - - // navit_zoom_out(this_->nav, 2, NULL); - return this_; } - extern struct graphics_priv* win32_graphics_new( struct graphics_methods *meth, struct attr **attrs); - - void plugin_init(void) { --- 360,369 ---- this_->nav=nav; ! this_->hwnd = CreateWin32Window(); SetWindowLongPtr( this_->hwnd , DWLP_USER, this_ ); return this_; } void plugin_init(void) { |
From: Albert L F. <af...@us...> - 2008-02-04 00:43:58
|
Update of /cvsroot/navit/navit/projs/CodeBlocks In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28478 Modified Files: Navit.workspace NavitCore.cbp data_garmin.cbp Added Files: win32_gui.cbp Log Message: Fix:projs/CodeBlocks:update project files, more work on native win32 gui/graphics Index: data_garmin.cbp =================================================================== RCS file: /cvsroot/navit/navit/projs/CodeBlocks/data_garmin.cbp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** data_garmin.cbp 24 Jan 2008 20:45:22 -0000 1.2 --- data_garmin.cbp 4 Feb 2008 00:44:00 -0000 1.3 *************** *** 66,72 **** </Unit> <Unit filename="..\..\src\data\garmin\garmin.h" /> - <Unit filename="..\..\src\data\garmin\gentypes.c"> - <Option compilerVar="CC" /> - </Unit> <Extensions> <code_completion /> --- 66,69 ---- Index: NavitCore.cbp =================================================================== RCS file: /cvsroot/navit/navit/projs/CodeBlocks/NavitCore.cbp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NavitCore.cbp 24 Jan 2008 20:45:22 -0000 1.1 --- NavitCore.cbp 4 Feb 2008 00:44:00 -0000 1.2 *************** *** 49,55 **** <Add directory="%GTK_DIR%\lib" /> </Linker> - <Unit filename="Win32Extra\builtin.c"> - <Option compilerVar="CC" /> - </Unit> <Unit filename="Win32Extra\config.h" /> <Unit filename="Win32Extra\serial_io.c"> --- 49,52 ---- Index: Navit.workspace =================================================================== RCS file: /cvsroot/navit/navit/projs/CodeBlocks/Navit.workspace,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Navit.workspace 1 Feb 2008 22:42:08 -0000 1.9 --- Navit.workspace 4 Feb 2008 00:44:00 -0000 1.10 *************** *** 2,5 **** --- 2,6 ---- <CodeBlocks_workspace_file> <Workspace title="Navit"> + <Project filename="NavitCore.cbp" /> <Project filename="win32_gui.cbp" /> <Project filename="fib-1.1.cbp" /> *************** *** 21,25 **** </Project> <Project filename="data_mg.cbp" /> ! <Project filename="Navit.cbp" active="1"> <Depends filename="win32_gui.cbp" /> <Depends filename="fib-1.1.cbp" /> --- 22,46 ---- </Project> <Project filename="data_mg.cbp" /> ! <Project filename="Navit_win32.cbp" active="1"> ! <Depends filename="NavitCore.cbp" /> ! <Depends filename="win32_gui.cbp" /> ! <Depends filename="fib-1.1.cbp" /> ! <Depends filename="Osm2Navit.cbp" /> ! <Depends filename="gentypes.cbp" /> ! <Depends filename="data_textfile.cbp" /> ! <Depends filename="mdb.cbp" /> ! <Depends filename="gtk_gui.cbp" /> ! <Depends filename="gtk_graphics.cbp" /> ! <Depends filename="gtk_gl_ext.cbp" /> ! <Depends filename="vehicle_file.cbp" /> ! <Depends filename="vehicle_demo.cbp" /> ! <Depends filename="speech_speech_dispatcher.cbp" /> ! <Depends filename="binfile.cbp" /> ! <Depends filename="data_poi_geodownload.cbp" /> ! <Depends filename="data_garmin.cbp" /> ! <Depends filename="data_mg.cbp" /> ! </Project> ! <Project filename="Navit_gtk.cbp"> ! <Depends filename="NavitCore.cbp" /> <Depends filename="win32_gui.cbp" /> <Depends filename="fib-1.1.cbp" /> --- NEW FILE: win32_gui.cbp --- <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <CodeBlocks_project_file> <FileVersion major="1" minor="6" /> <Project> <Option title="win32_gui" /> <Option pch_mode="2" /> <Option compiler="gcc" /> <Build> <Target title="Debug"> <Option output=".\bin\Debug\libwin32_gui.la" prefix_auto="0" extension_auto="0" /> <Option working_dir="" /> <Option object_output="obj\" /> <Option type="2" /> <Option compiler="gcc" /> <Option createDefFile="1" /> <Compiler> <Add option="-g" /> <Add option="-I." /> </Compiler> </Target> <Target title="Release"> <Option output=".\bin\Release\libwin32_gui.la" prefix_auto="0" extension_auto="0" /> <Option working_dir="" /> <Option object_output="obj\" /> <Option type="2" /> <Option compiler="gcc" /> <Option createDefFile="1" /> <Compiler> <Add option="-O2" /> </Compiler> <Linker> <Add option="-s" /> </Linker> </Target> </Build> <Compiler> <Add option="-Wall" /> <Add option="-mms-bitfields" /> <Add option="-DMODULE=win32_gui" /> <Add directory="%GTK_DIR%\include\glib-2.0" /> <Add directory="%GTK_DIR%\lib\glib-2.0\include" /> <Add directory="..\..\src" /> <Add directory="Win32Extra" /> </Compiler> <Unit filename="win32gui\win32_graphics.c"> <Option compilerVar="CC" /> </Unit> <Unit filename="win32gui\win32_gui.c"> <Option compilerVar="CC" /> </Unit> <Unit filename="win32gui\win32_gui.h" /> <Unit filename="win32gui\xpm2bmp.c"> <Option compilerVar="CC" /> </Unit> <Unit filename="win32gui\xpm2bmp.h" /> <Extensions> <code_completion /> <envvars /> <debugger /> </Extensions> </Project> </CodeBlocks_project_file> |
From: Albert L F. <af...@us...> - 2008-02-04 00:43:57
|
Update of /cvsroot/navit/navit/projs/CodeBlocks/Win32Extra In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28478/Win32Extra Added Files: navit_gtk.c navit_win32.c Log Message: Fix:projs/CodeBlocks:update project files, more work on native win32 gui/graphics --- NEW FILE: navit_win32.c --- extern void module_vehicle_demo_init(void); extern void module_vehicle_file_init(void); extern void module_win32_gui_init(void); extern void module_speech_speech_dispatcher_init(void); extern void builtin_init(void); void builtin_init(void) { module_data_textfile_init(); module_data_binfile_init(); module_data_mg_init(); module_win32_gui_init(); module_data_garmin_init(); module_data_poi_geodownload_init(); module_vehicle_demo_init(); module_vehicle_file_init(); module_speech_speech_dispatcher_init(); } --- NEW FILE: navit_gtk.c --- extern void module_data_textfile_init(void); extern void module_data_binfile_init(void); extern void module_data_mg_init(void); extern void module_data_garmin_init(void); extern void module_data_poi_geodownload_init(void); extern void module_gtk_graphics_init(void); extern void module_gtk_gui_init(void); extern void module_vehicle_demo_init(void); extern void module_vehicle_file_init(void); extern void module_speech_speech_dispatcher_init(void); extern void builtin_init(void); void builtin_init(void) { module_data_textfile_init(); module_data_binfile_init(); module_data_mg_init(); module_data_garmin_init(); module_data_poi_geodownload_init(); module_gtk_graphics_init(); module_gtk_gui_init(); module_vehicle_demo_init(); module_vehicle_file_init(); module_speech_speech_dispatcher_init(); } |
From: Albert L F. <af...@us...> - 2008-02-01 22:45:13
|
Update of /cvsroot/navit/navit/projs/CodeBlocks/win32gui In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11329/win32gui Modified Files: win32_graphics.c win32_gui.c Added Files: xpm2bmp.c xpm2bmp.h Log Message: Fix:projs/CodeBlocks:update project files, more work on native win32 gui/graphics Index: win32_graphics.c =================================================================== RCS file: /cvsroot/navit/navit/projs/CodeBlocks/win32gui/win32_graphics.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32_graphics.c 24 Jan 2008 20:45:23 -0000 1.1 --- win32_graphics.c 1 Feb 2008 22:42:08 -0000 1.2 *************** *** 10,14 **** --- 10,23 ---- #include "plugin.h" + #define ID_CHILD_GFX 2000 + #include "xpm2bmp.h"; + + #ifndef GET_WHEEL_DELTA_WPARAM + #define GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam)) + #endif + struct graphics_image_priv { + PXPM2BMP pxpm; + }; *************** *** 31,36 **** 0, NULL ); - // Display the error message and exit the process - lpDisplayBuf = (LPVOID)LocalAlloc(LMEM_ZEROINIT, (lstrlen((LPCTSTR)lpMsgBuf)+lstrlen((LPCTSTR)lpszFunction)+40)*sizeof(TCHAR)); --- 40,43 ---- *************** *** 64,81 **** }; struct graphics_priv *g_gra; static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch(Message) { case WM_CREATE: { ! g_gra->wnd_handle = hwnd; ! //if (g_gra->resize_callback) ! // (*g_gra->resize_callback)(g_gra->resize_callback_data, g_gra->width, g_gra->height); ! //MoveWindow( hwnd, 0,0, 780, 680, TRUE ); } break; --- 71,143 ---- }; + struct graphics_gc_priv { + HWND hwnd; + int line_width; + COLORREF fg_color; + COLORREF bg_color; + struct graphics_priv *gr; + }; + struct graphics_priv *g_gra; + static HDC hMemDC; + static HBITMAP hBitmap; + static HBITMAP hOldBitmap; + + // Fills the region 'rgn' in graded colours + static void MakeMemoryDC(HANDLE hWnd, HDC hdc ) + { + if ( hMemDC ) + { + if ( hOldBitmap ) + { + SelectObject( hMemDC, hOldBitmap ); + DeleteObject( hBitmap ); + hBitmap = NULL; + hOldBitmap = NULL; + } + } + + // Creates memory DC + hMemDC = CreateCompatibleDC(hdc); + if ( hMemDC ) + { + RECT rectRgn; + GetClientRect( hWnd, &rectRgn ); + int Width = rectRgn.right - rectRgn.left; + int Height = rectRgn.bottom - rectRgn.top; + printf( "resize memDC to: %d %d \n", Width, Height ); + + hBitmap = CreateCompatibleBitmap(hdc, Width, Height ); + + if ( hBitmap ) + { + hOldBitmap = (HBITMAP) SelectObject( hMemDC, hBitmap); + } + } + } static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { + + if ( Message != 15 ) + printf( "CHILD %d %d %d \n", Message, wParam, lParam ); switch(Message) { case WM_CREATE: { ! g_gra->wnd_handle = hwnd; ! //if (g_gra->resize_callback) ! // (*g_gra->resize_callback)(g_gra->resize_callback_data, g_gra->width, g_gra->height); ! //MoveWindow( hwnd, 0,0, 780, 680, TRUE ); ! ! { ! HDC hdc; ! hdc = GetDC( hwnd ); ! MakeMemoryDC(hwnd, hdc ); ! ReleaseDC( hwnd, hdc ); ! } ! PostMessage( g_gra->wnd_parent_handle, WM_USER + 1, 0, 0 ); } break; *************** *** 83,86 **** --- 145,150 ---- switch(LOWORD(wParam)) { + case WM_USER + 1: + break; } break; *************** *** 99,106 **** --- 163,239 ---- g_gra->height = HIWORD( lParam ); + { + HDC hdc; + hdc = GetDC( hwnd ); + MakeMemoryDC(hwnd, hdc ); + ReleaseDC( hwnd, hdc ); + } + printf( "resize gfx to: %d %d \n", g_gra->width, g_gra->height ); + } break; case WM_DESTROY: PostQuitMessage(0); + exit( 0 ); + break; + case WM_PAINT: + { + + HDC hdc = GetDC(hwnd ); + if ( hMemDC ) + { + BitBlt( hdc, 0, 0, g_gra->width , g_gra->height, hMemDC, 0, 0, SRCCOPY ); + } + ReleaseDC( hwnd, hdc ); + } + break; + case WM_MOUSEMOVE: + { + int xPos = LOWORD(lParam); + int yPos = HIWORD(lParam); + struct point pt = {xPos, yPos}; + + printf( "WM_MOUSEMOVE: %d %d \n", xPos, yPos ); + (*g_gra->motion_callback)(g_gra->motion_callback_data, &pt); + } + + break; + case WM_LBUTTONUP: + { + int xPos = LOWORD(lParam); + int yPos = HIWORD(lParam); + + struct point pt = { xPos, yPos }; + + printf( "WM_LBUTTONUP: %d %d \n", xPos, yPos ); + if (g_gra->button_callback ) + { + struct point pt = {xPos, yPos}; + (*g_gra->button_callback)(g_gra->button_callback_data, 0, 1, &pt); + } + + } + break; + + case WM_LBUTTONDOWN: + { + int xPos = LOWORD(lParam); + int yPos = HIWORD(lParam); + printf( "WM_LBUTTONDOWN: %d %d \n", xPos, yPos ); + if (g_gra->button_callback ) + { + struct point pt = {xPos, yPos}; + (*g_gra->button_callback)(g_gra->button_callback_data, 1, 1, &pt); + } + } + break; + + case WM_HSCROLL: + case WM_VSCROLL: + printf( "mousewheel delta %d\n", wParam ); + break; + case WM_MOUSEWHEEL: + printf( "mousewheel delta %d\n", wParam ); + break; default: *************** *** 134,148 **** ! HANDLE hdl = gr->wnd_parent_handle; ! GetWindowRect( gr->wnd_parent_handle,&rcParent); if(!RegisterClassEx(&wc)) { ErrorExit( "Window Registration Failed!" ); ! return 0; } ! g_gra->width = rcParent.right - rcParent.left; ! g_gra->height = rcParent.bottom - rcParent.top; --- 267,281 ---- ! HANDLE hdl = gr->wnd_parent_handle; ! GetClientRect( gr->wnd_parent_handle,&rcParent); if(!RegisterClassEx(&wc)) { ErrorExit( "Window Registration Failed!" ); ! return NULL; } ! g_gra->width = rcParent.right - rcParent.left; ! g_gra->height = rcParent.bottom - rcParent.top; *************** *** 155,159 **** g_gra->height, gr->wnd_parent_handle, ! NULL, NULL, NULL); --- 288,292 ---- g_gra->height, gr->wnd_parent_handle, ! (HMENU)ID_CHILD_GFX, NULL, NULL); *************** *** 172,195 **** ! 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) { ! // gdk_gc_set_line_attributes(gc->gc, w, GDK_LINE_SOLID, GDK_CAP_ROUND, GDK_JOIN_ROUND); } ! static void ! gc_set_dashes(struct graphics_gc_priv *gc, unsigned char *dash_list, int n) { // gdk_gc_set_dashes(gc->gc, 0, (gint8 *)dash_list, n); --- 305,327 ---- ! static void graphics_destroy(struct graphics_priv *gr) { + g_free( gr ); } ! static void gc_destroy(struct graphics_gc_priv *gc) { ! g_free( gc ); } ! static HPEN line_pen; ! ! static void gc_set_linewidth(struct graphics_gc_priv *gc, int w) { ! gc->line_width = w; } ! static void gc_set_dashes(struct graphics_gc_priv *gc, unsigned char *dash_list, int n) { // gdk_gc_set_dashes(gc->gc, 0, (gint8 *)dash_list, n); *************** *** 197,224 **** } ! static void ! gc_set_color(struct graphics_gc_priv *gc, struct color *c, int fg) { ! // GdkColor gdkc; ! // gdkc.pixel=0; ! // gdkc.red=c->r; ! // gdkc.green=c->g; ! // gdkc.blue=c->b; ! // gdk_colormap_alloc_color(gc->gr->colormap, &gdkc, FALSE, TRUE); ! // if (fg) ! // gdk_gc_set_foreground(gc->gc, &gdkc); ! // else ! // gdk_gc_set_background(gc->gc, &gdkc); } ! static void ! gc_set_foreground(struct graphics_gc_priv *gc, struct color *c) { ! // gc_set_color(gc, c, 1); } static void gc_set_background(struct graphics_gc_priv *gc, struct color *c) { ! // gc_set_color(gc, c, 0); } --- 329,351 ---- } ! ! ! static void gc_set_color(struct graphics_gc_priv *gc, struct color *c, int fg) { ! ! gc->fg_color = RGB( c->r, c->g, c->b ); } ! static void gc_set_foreground(struct graphics_gc_priv *gc, struct color *c) { ! gc->fg_color = RGB( c->r, c->g, c->b ); } static void gc_set_background(struct graphics_gc_priv *gc, struct color *c) { ! gc->bg_color = RGB( c->r, c->g, c->b ); ! if ( hMemDC ) ! SetBkColor( hMemDC, gc->bg_color ); ! } *************** *** 233,242 **** static struct graphics_gc_priv *gc_new(struct graphics_priv *gr, struct graphics_gc_methods *meth) { ! // struct graphics_gc_priv *gc=g_new(struct graphics_gc_priv, 1); ! *meth=gc_methods; ! // gc->gc=gdk_gc_new(gr->widget->window); ! // gc->gr=gr; ! return NULL; } --- 360,370 ---- static struct graphics_gc_priv *gc_new(struct graphics_priv *gr, struct graphics_gc_methods *meth) { ! struct graphics_gc_priv *gc=g_new(struct graphics_gc_priv, 1); *meth=gc_methods; ! gc->hwnd = g_gra->wnd_handle; ! gc->line_width = 1; ! gc->fg_color = RGB( 0,0,0 ); ! gc->bg_color = RGB( 255,255,255 ); ! return gc; } *************** *** 244,252 **** static void draw_lines(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count) { - int i; HANDLE hndl = gr->wnd_handle; ! HDC dc = GetDC( gr->wnd_handle ); int first = 1; --- 372,387 ---- static void draw_lines(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count) { int i; HANDLE hndl = gr->wnd_handle; ! HDC dc = hMemDC; ! ! HPEN holdpen; ! HPEN hpen; ! ! hpen = CreatePen( PS_SOLID, gc->line_width, gc->fg_color ); ! holdpen = SelectObject( dc, hpen ); ! ! SetBkColor( dc, gc->bg_color ); int first = 1; *************** *** 263,277 **** } } ! ReleaseDC( gr->wnd_handle, dc ); } static void draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count) { ! // if (gr->mode == draw_mode_begin || gr->mode == draw_mode_end) ! // gdk_draw_polygon(gr->drawable, gc->gc, TRUE, (GdkPoint *)p, count); ! // if (gr->mode == draw_mode_end || gr->mode == draw_mode_cursor) ! // gdk_draw_polygon(gr->widget->window, gc->gc, TRUE, (GdkPoint *)p, count); } static void draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int w, int h) { --- 398,431 ---- } } ! ! SelectObject( dc, holdpen ); ! DeleteObject( hpen ); } static void draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count) { ! //if (gr->mode == draw_mode_begin || gr->mode == draw_mode_end) ! { ! int i; ! POINT points[ count ]; ! for ( i=0;i< count; i++ ) ! { ! points[i].x = p[i].x; ! points[i].y = p[i].y; ! } ! HBRUSH holdbrush; ! HBRUSH hbrush; ! ! SetBkColor( hMemDC, gc->bg_color ); ! ! hbrush = CreateSolidBrush( gc->fg_color ); ! holdbrush = SelectObject( hMemDC, hbrush ); ! Polygon( hMemDC, points,count ); ! SelectObject( hMemDC, holdbrush ); ! DeleteObject( hbrush ); ! } } + static void draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int w, int h) { *************** *** 281,284 **** --- 435,453 ---- static void draw_circle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int r) { + HDC dc = hMemDC; + + HPEN holdpen; + HPEN hpen; + + hpen = CreatePen( PS_SOLID, gc->line_width, gc->fg_color ); + holdpen = SelectObject( dc, hpen ); + + SetBkColor( hMemDC, gc->bg_color ); + + Ellipse( dc, p->x - r, p->y -r, p->x + r, p->y + r ); + + SelectObject( dc, holdpen ); + DeleteObject( hpen ); + // if (gr->mode == draw_mode_begin || gr->mode == draw_mode_end) // gdk_draw_arc(gr->drawable, gc->gc, FALSE, p->x-r/2, p->y-r/2, r, r, 0, 64*360); *************** *** 291,311 **** static void draw_restore(struct graphics_priv *gr, struct point *p, int w, int h) { ! printf( "restore\n"); } static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode) { if ( mode == draw_mode_begin ) { if ( gr->wnd_handle == NULL ) CreateGraphicsWindows( gr ); ! ! HDC hdcScreen = GetDC( gr->wnd_handle ); ! /* ! hbmScreen = CreateCompatibleBitmap(hdcScreen, ! GetDeviceCaps(hdcScreen, HORZRES), ! GetDeviceCaps(hdcScreen, VERTRES)); ! */ ! } --- 460,479 ---- static void draw_restore(struct graphics_priv *gr, struct point *p, int w, int h) { ! // AF TODO ! printf( "draw restore \n" ); ! ! InvalidateRect( gr->wnd_handle, NULL, FALSE ); } static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode) { + printf( "set draw_mode to %d\n", (int)mode ); + if ( mode == draw_mode_begin ) { if ( gr->wnd_handle == NULL ) + { CreateGraphicsWindows( gr ); ! } } *************** *** 313,316 **** --- 481,485 ---- if (mode == draw_mode_end && gr->mode == draw_mode_begin) { + InvalidateRect( gr->wnd_handle, NULL, FALSE ); } *************** *** 370,376 **** 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) { ! return NULL; } static struct graphics_methods graphics_methods = { --- 539,555 ---- 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) { ! struct graphics_image_priv* ret; ! ! ret = g_new( struct graphics_image_priv, 1 ); ! printf( "loading image '%s'\n", name ); ! ret->pxpm = Xpm2bmp_new(); ! Xpm2bmp_load( ret->pxpm, name ); ! return ret; } + static void draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img) + { + Xpm2bmp_paint( img->pxpm , hMemDC, p->x, p->y ); + } static struct graphics_methods graphics_methods = { *************** *** 382,386 **** draw_circle, draw_text, ! NULL, // draw_image, #ifdef HAVE_IMLIB2 NULL, // draw_image_warp, --- 561,565 ---- draw_circle, draw_text, ! draw_image, #ifdef HAVE_IMLIB2 NULL, // draw_image_warp, --- NEW FILE: xpm2bmp.h --- #ifndef Xpm2BMP_H_INCLUDED #define Xpm2BMP_H_INCLUDED #include <windows.h> #include "wingdi.h" typedef struct XPMCOLORENTRY_TAG { char* color_str; unsigned long r; unsigned long g; unsigned long b; } XPMCOLORENTRY, *PXPMCOLORENTRY; typedef struct XPM2BMP_TAG { unsigned short size_x; unsigned short size_y; unsigned short colors; unsigned short pixels; unsigned short chars_per_pixel; unsigned short hotspot_x; unsigned short hotspot_y; int color_entires_size; PXPMCOLORENTRY color_entires; unsigned char *dib; unsigned char *wimage_data; BITMAPINFOHEADER *bmih; unsigned char *dib_trans; unsigned char *wimage_data_trans; BITMAPINFOHEADER *bmih_trans; } XPM2BMP, *PXPM2BMP; PXPM2BMP Xpm2bmp_new(); int Xpm2bmp_load( PXPM2BMP pXpm2bmp, const char* filename ); int Xpm2bmp_paint( PXPM2BMP pXpm2bmp, HDC hdc, int x1,int y1 ); #endif // Xpm2BMP_H_INCLUDED --- NEW FILE: xpm2bmp.c --- #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <wingdi.h> #include "Xpm2bmp.h" // #define _DBG // function prototypes static int CreateBitmapFromXpm( const char* filename, PXPM2BMP pXpm2bmp ); // typedefs static XPMCOLORENTRY theRGBRecords[] = { {"ALICEBLUE", 240, 248, 255}, {"ANTIQUEWHITE", 250, 235, 215}, {"AQUAMARINE", 50, 191, 193}, {"AZURE", 240, 255, 255}, {"BEIGE", 245, 245, 220}, {"BISQUE", 255, 228, 196}, {"BLACK", 0, 0, 0}, {"BLANCHEDALMOND", 255, 235, 205}, {"BLUE", 0, 0, 255}, {"BLUEVIOLET", 138, 43, 226}, {"BROWN", 165, 42, 42}, {"BURLYWOOD", 222, 184, 135}, {"CADETBLUE", 95, 146, 158}, {"CHARTREUSE", 127, 255, 0}, {"CHOCOLATE", 210, 105, 30}, {"CORAL", 255, 114, 86}, {"CORNFLOWERBLUE", 34, 34, 152}, {"CORNSILK", 255, 248, 220}, {"CYAN", 0, 255, 255}, {"DARKGOLDENROD", 184, 134, 11}, {"DARKGREEN", 0, 86, 45}, {"DARKKHAKI", 189, 183, 107}, {"DARKOLIVEGREEN", 85, 86, 47}, {"DARKORANGE", 255, 140, 0}, {"DARKORCHID", 139, 32, 139}, {"DARKSALMON", 233, 150, 122}, {"DARKSEAGREEN", 143, 188, 143}, {"DARKSLATEBLUE", 56, 75, 102}, {"DARKSLATEGRAY", 47, 79, 79}, {"DARKTURQUOISE", 0, 166, 166}, {"DARKVIOLET", 148, 0, 211}, {"DEEPPINK", 255, 20, 147}, {"DEEPSKYBLUE", 0, 191, 255}, {"DIMGRAY", 84, 84, 84}, {"DODGERBLUE", 30, 144, 255}, {"FIREBRICK", 142, 35, 35}, {"FLORALWHITE", 255, 250, 240}, {"FORESTGREEN", 80, 159, 105}, {"GAINSBORO", 220, 220, 220}, {"GHOSTWHITE", 248, 248, 255}, {"GOLD", 218, 170, 0}, {"GOLDENROD", 239, 223, 132}, {"GRAY", 126, 126, 126}, {"GRAY0", 0, 0, 0}, {"GRAY1", 3, 3, 3}, {"GRAY10", 26, 26, 26}, {"GRAY100", 255, 255, 255}, {"GRAY11", 28, 28, 28}, {"GRAY12", 31, 31, 31}, {"GRAY13", 33, 33, 33}, {"GRAY14", 36, 36, 36}, {"GRAY15", 38, 38, 38}, {"GRAY16", 41, 41, 41}, {"GRAY17", 43, 43, 43}, {"GRAY18", 46, 46, 46}, {"GRAY19", 48, 48, 48}, {"GRAY2", 5, 5, 5}, {"GRAY20", 51, 51, 51}, {"GRAY21", 54, 54, 54}, {"GRAY22", 56, 56, 56}, {"GRAY23", 59, 59, 59}, {"GRAY24", 61, 61, 61}, {"GRAY25", 64, 64, 64}, {"GRAY26", 66, 66, 66}, {"GRAY27", 69, 69, 69}, {"GRAY28", 71, 71, 71}, {"GRAY29", 74, 74, 74}, {"GRAY3", 8, 8, 8}, {"GRAY30", 77, 77, 77}, {"GRAY31", 79, 79, 79}, {"GRAY32", 82, 82, 82}, {"GRAY33", 84, 84, 84}, {"GRAY34", 87, 87, 87}, {"GRAY35", 89, 89, 89}, {"GRAY36", 92, 92, 92}, {"GRAY37", 94, 94, 94}, {"GRAY38", 97, 97, 97}, {"GRAY39", 99, 99, 99}, {"GRAY4", 10, 10, 10}, {"GRAY40", 102, 102, 102}, {"GRAY41", 105, 105, 105}, {"GRAY42", 107, 107, 107}, {"GRAY43", 110, 110, 110}, {"GRAY44", 112, 112, 112}, {"GRAY45", 115, 115, 115}, {"GRAY46", 117, 117, 117}, {"GRAY47", 120, 120, 120}, {"GRAY48", 122, 122, 122}, {"GRAY49", 125, 125, 125}, {"GRAY5", 13, 13, 13}, {"GRAY50", 127, 127, 127}, {"GRAY51", 130, 130, 130}, {"GRAY52", 133, 133, 133}, {"GRAY53", 135, 135, 135}, {"GRAY54", 138, 138, 138}, {"GRAY55", 140, 140, 140}, {"GRAY56", 143, 143, 143}, {"GRAY57", 145, 145, 145}, {"GRAY58", 148, 148, 148}, {"GRAY59", 150, 150, 150}, {"GRAY6", 15, 15, 15}, {"GRAY60", 153, 153, 153}, {"GRAY61", 156, 156, 156}, {"GRAY62", 158, 158, 158}, {"GRAY63", 161, 161, 161}, {"GRAY64", 163, 163, 163}, {"GRAY65", 166, 166, 166}, {"GRAY66", 168, 168, 168}, {"GRAY67", 171, 171, 171}, {"GRAY68", 173, 173, 173}, {"GRAY69", 176, 176, 176}, {"GRAY7", 18, 18, 18}, {"GRAY70", 179, 179, 179}, {"GRAY71", 181, 181, 181}, {"GRAY72", 184, 184, 184}, {"GRAY73", 186, 186, 186}, {"GRAY74", 189, 189, 189}, {"GRAY75", 191, 191, 191}, {"GRAY76", 194, 194, 194}, {"GRAY77", 196, 196, 196}, {"GRAY78", 199, 199, 199}, {"GRAY79", 201, 201, 201}, {"GRAY8", 20, 20, 20}, {"GRAY80", 204, 204, 204}, {"GRAY81", 207, 207, 207}, {"GRAY82", 209, 209, 209}, {"GRAY83", 212, 212, 212}, {"GRAY84", 214, 214, 214}, {"GRAY85", 217, 217, 217}, {"GRAY86", 219, 219, 219}, {"GRAY87", 222, 222, 222}, {"GRAY88", 224, 224, 224}, {"GRAY89", 227, 227, 227}, {"GRAY9", 23, 23, 23}, {"GRAY90", 229, 229, 229}, {"GRAY91", 232, 232, 232}, {"GRAY92", 235, 235, 235}, {"GRAY93", 237, 237, 237}, {"GRAY94", 240, 240, 240}, {"GRAY95", 242, 242, 242}, {"GRAY96", 245, 245, 245}, {"GRAY97", 247, 247, 247}, {"GRAY98", 250, 250, 250}, {"GRAY99", 252, 252, 252}, {"GREEN", 0, 255, 0}, {"GREENYELLOW", 173, 255, 47}, {"HONEYDEW", 240, 255, 240}, {"HOTPINK", 255, 105, 180}, {"INDIANRED", 107, 57, 57}, {"IVORY", 255, 255, 240}, {"KHAKI", 179, 179, 126}, {"LAVENDER", 230, 230, 250}, {"LAVENDERBLUSH", 255, 240, 245}, {"LAWNGREEN", 124, 252, 0}, {"LEMONCHIFFON", 255, 250, 205}, {"LIGHTBLUE", 176, 226, 255}, {"LIGHTCORAL", 240, 128, 128}, {"LIGHTCYAN", 224, 255, 255}, {"LIGHTGOLDENROD", 238, 221, 130}, {"LIGHTGOLDENRODYELLOW", 250, 250, 210}, {"LIGHTGRAY", 168, 168, 168}, {"LIGHTPINK", 255, 182, 193}, {"LIGHTSALMON", 255, 160, 122}, {"LIGHTSEAGREEN", 32, 178, 170}, {"LIGHTSKYBLUE", 135, 206, 250}, {"LIGHTSLATEBLUE", 132, 112, 255}, {"LIGHTSLATEGRAY", 119, 136, 153}, {"LIGHTSTEELBLUE", 124, 152, 211}, {"LIGHTYELLOW", 255, 255, 224}, {"LIMEGREEN", 0, 175, 20}, {"LINEN", 250, 240, 230}, {"MAGENTA", 255, 0, 255}, {"MAROON", 143, 0, 82}, {"MEDIUMAQUAMARINE", 0, 147, 143}, {"MEDIUMBLUE", 50, 50, 204}, {"MEDIUMFORESTGREEN", 50, 129, 75}, {"MEDIUMGOLDENROD", 209, 193, 102}, {"MEDIUMORCHID", 189, 82, 189}, {"MEDIUMPURPLE", 147, 112, 219}, {"MEDIUMSEAGREEN", 52, 119, 102}, {"MEDIUMSLATEBLUE", 106, 106, 141}, {"MEDIUMSPRINGGREEN", 35, 142, 35}, {"MEDIUMTURQUOISE", 0, 210, 210}, {"MEDIUMVIOLETRED", 213, 32, 121}, {"MIDNIGHTBLUE", 47, 47, 100}, {"MINTCREAM", 245, 255, 250}, {"MISTYROSE", 255, 228, 225}, {"MOCCASIN", 255, 228, 181}, {"NAVAJOWHITE", 255, 222, 173}, {"NAVY", 35, 35, 117}, {"NAVYBLUE", 35, 35, 117}, {"OLDLACE", 253, 245, 230}, {"OLIVEDRAB", 107, 142, 35}, {"ORANGE", 255, 135, 0}, {"ORANGERED", 255, 69, 0}, {"ORCHID", 239, 132, 239}, {"PALEGOLDENROD", 238, 232, 170}, {"PALEGREEN", 115, 222, 120}, {"PALETURQUOISE", 175, 238, 238}, {"PALEVIOLETRED", 219, 112, 147}, {"PAPAYAWHIP", 255, 239, 213}, {"PEACHPUFF", 255, 218, 185}, {"PERU", 205, 133, 63}, {"PINK", 255, 181, 197}, {"PLUM", 197, 72, 155}, {"POWDERBLUE", 176, 224, 230}, {"PURPLE", 160, 32, 240}, {"RED", 255, 0, 0}, {"ROSYBROWN", 188, 143, 143}, {"ROYALBLUE", 65, 105, 225}, {"SADDLEBROWN", 139, 69, 19}, {"SALMON", 233, 150, 122}, {"SANDYBROWN", 244, 164, 96}, {"SEAGREEN", 82, 149, 132}, {"SEASHELL", 255, 245, 238}, {"SIENNA", 150, 82, 45}, {"SKYBLUE", 114, 159, 255}, {"SLATEBLUE", 126, 136, 171}, {"SLATEGRAY", 112, 128, 144}, {"SNOW", 255, 250, 250}, {"SPRINGGREEN", 65, 172, 65}, {"STEELBLUE", 84, 112, 170}, {"TAN", 222, 184, 135}, {"THISTLE", 216, 191, 216}, {"TOMATO", 255, 99, 71}, {"TRANSPARENT", 0, 0, 1}, {"TURQUOISE", 25, 204, 223}, {"VIOLET", 156, 62, 206}, {"VIOLETRED", 243, 62, 150}, {"WHEAT", 245, 222, 179}, {"WHITE", 255, 255, 255}, {"WHITESMOKE", 245, 245, 245}, {"YELLOW", 255, 255, 0}, {"YELLOWGREEN", 50, 216, 56} }; PXPM2BMP Xpm2bmp_new() { PXPM2BMP preturn = (PXPM2BMP)calloc( sizeof( XPM2BMP ) , 1 ); return preturn; } int Xpm2bmp_load( PXPM2BMP pXpm2bmp, const char* filename ) { return CreateBitmapFromXpm( filename, pXpm2bmp ); } int Xpm2bmp_paint( PXPM2BMP pXpm2bmp, HDC hdc, int x1,int y1 ) { StretchDIBits(hdc, x1, y1, pXpm2bmp->size_x, pXpm2bmp->size_y, 0, 0, pXpm2bmp->size_x, pXpm2bmp->size_y, pXpm2bmp->wimage_data_trans, (BITMAPINFO *)pXpm2bmp->bmih_trans, DIB_RGB_COLORS, SRCAND ); StretchDIBits(hdc, x1, y1, pXpm2bmp->size_x, pXpm2bmp->size_y, 0, 0, pXpm2bmp->size_x, pXpm2bmp->size_y, pXpm2bmp->wimage_data, (BITMAPINFO *)pXpm2bmp->bmih, DIB_RGB_COLORS, SRCPAINT ); return 0; } static int parse_line_values( const char* line, PXPM2BMP pXpm2bmp ) { int return_value = 0; char* parse_line = (char*)line; char* tok; int value_pos = 0; parse_line = strchr( parse_line, '"' ); parse_line++; tok = strtok( parse_line, " \t\n" ); while ( tok != 0 ) { int val = atoi( tok ); switch ( value_pos ) { case 0: pXpm2bmp->size_x = val; break; case 1: pXpm2bmp->size_y = val; break; case 2: pXpm2bmp->colors = val; break; case 3: pXpm2bmp->chars_per_pixel = val; break; case 4: pXpm2bmp->hotspot_x = val; break; case 5: pXpm2bmp->hotspot_y = val; break; } tok = strtok( NULL, " \t" ); value_pos ++; } return return_value; } static int hex2int( char c ) { if ((c >= '0') && (c <='9' )) return c - '0'; if ((c >= 'A') && (c <= 'F')) return c - 'A' + 10; if ((c >= 'a') && (c <= 'f')) return c - 'a' + 10; return -1; } static DWORD string2hex16( const char* str ) { int i1 = hex2int( str[0] ); int i2 = hex2int( str[1] ); if ( ( i1 >= 0 ) && ( i2 >= 0 ) ) return i1*16+i2; return -1; } static int parse_color_values( const char* line, PXPM2BMP pXpm2bmp ) { int return_value = 0; char* cq = strchr( line, '"' ); char* cchar = strchr( cq+pXpm2bmp->chars_per_pixel, 'c' ); char* chash = strchr( cq+pXpm2bmp->chars_per_pixel, '#' ); char* qe = strchr( cq+pXpm2bmp->chars_per_pixel, '"' ); cq++; if ( cq ) { memcpy( pXpm2bmp->color_entires[ pXpm2bmp-> color_entires_size].color_str, cq, pXpm2bmp->chars_per_pixel + 1 ); pXpm2bmp->color_entires[ pXpm2bmp-> color_entires_size].color_str[ pXpm2bmp->chars_per_pixel ] = '\0'; if ( cchar && chash && qe) { chash++; *qe = 0; int len = strlen( chash ); pXpm2bmp->color_entires[ pXpm2bmp->color_entires_size].r = string2hex16( &chash[0] ); pXpm2bmp->color_entires[ pXpm2bmp->color_entires_size].g = string2hex16( &chash[len / 3] ); pXpm2bmp->color_entires[ pXpm2bmp->color_entires_size].b = string2hex16( &chash[len * 2 / 3] ); #ifdef _DBG printf( "adding color %s => %d RGB %x %x %x \n", line, pXpm2bmp->color_entires_size, pXpm2bmp->color_entires[ pXpm2bmp->color_entires_size].r, pXpm2bmp->color_entires[ pXpm2bmp->color_entires_size].g, pXpm2bmp->color_entires[ pXpm2bmp->color_entires_size].b ); #endif } else { int q; char *start = cchar + 1; char *end = start; while ( *start != 0 ) { if ( ( *start != '\t' ) && ( *start != ' ' ) ) { break; } start++; } end = start; while ( *end != 0 ) { if ( ( *end == '\t' ) || ( *end == ' ' ) || ( *end == '"' )) { *end = 0; } end++; } start = _strupr( start ); for ( q=0; q < sizeof( theRGBRecords ) / sizeof( theRGBRecords[0] ); q++ ) { if ( 0 == strcmp( start, theRGBRecords[q].color_str ) ) { pXpm2bmp->color_entires[ pXpm2bmp->color_entires_size].r = theRGBRecords[q].r; pXpm2bmp->color_entires[ pXpm2bmp->color_entires_size].g = theRGBRecords[q].g; pXpm2bmp->color_entires[ pXpm2bmp->color_entires_size].b = theRGBRecords[q].b; } } if ( 0 == strcmp( start, "NONE" ) ) { pXpm2bmp->color_entires[ pXpm2bmp->color_entires_size].r = 255; pXpm2bmp->color_entires[ pXpm2bmp->color_entires_size].g = 0; pXpm2bmp->color_entires[ pXpm2bmp->color_entires_size].b = 255; } } } pXpm2bmp->color_entires_size++; return return_value; } static int vv = 0; static int parse_pixel_line_values( const char* line, PXPM2BMP pXpm2bmp, unsigned char* pixel_data, unsigned char* pixel_data_trans ) { int return_value = 0; int i,j; char* cq = strchr( line, '"' ); int pix_idx = 0; int size_x = pXpm2bmp->size_x; int len = strlen( cq ); cq++; if ( len > pXpm2bmp->chars_per_pixel * size_x ) { for ( i=0; i< size_x; i++ ) { int found = 0; char* cmp = &cq[ i * pXpm2bmp->chars_per_pixel]; for ( j=0; j< pXpm2bmp-> color_entires_size; j++ ) { if ( strncmp( cmp, pXpm2bmp->color_entires[ j ].color_str, pXpm2bmp->chars_per_pixel ) == 0 ) { int r = pXpm2bmp->color_entires[ j ].r; int g = pXpm2bmp->color_entires[ j ].g; int b = pXpm2bmp->color_entires[ j ].b; if ( ( r == 255 ) && ( g == 0 ) && ( r == 255 ) ) { r=g=b=0; pixel_data_trans[ pix_idx ] = 255; pixel_data_trans[ pix_idx+1 ] = 255; pixel_data_trans[ pix_idx+2 ] = 255; } else { pixel_data_trans[ pix_idx ] = 0; pixel_data_trans[ pix_idx+1 ] = 0; pixel_data_trans[ pix_idx+2 ] = 0; } // pixel_data[ pix_idx++ ] = pXpm2bmp->color_entires[ j ].r; // pixel_data[ pix_idx++ ] = pXpm2bmp->color_entires[ j ].g; // pixel_data[ pix_idx++ ] = pXpm2bmp->color_entires[ j ].b; pixel_data[ pix_idx++ ] = b; pixel_data[ pix_idx++ ] = g; pixel_data[ pix_idx++ ] = r; found = 1; vv++; break; } } if ( !found ) { fprintf( stderr, "XPMLIB: error color not found\n" ); } } } else { return_value = -1; fprintf( stderr, "XPMLIB: invalid line length\n" ); } return return_value; } static int CreateBitmapFromXpm( const char* filename, PXPM2BMP pXpm2bmp ) { int return_val = 0; unsigned char i, row; char line[ 1024 ]; int nbytes ; FILE* file_xpm = fopen( filename, "r" ); int phase = 0; row = 0; if ( file_xpm ) { while ( fgets(line, sizeof( line ), file_xpm ) ) { #ifdef _DBG printf( "PARSING: %s\n", line ); #endif if ( line[ 0 ] != '"' ) continue; switch ( phase ) { case 0: parse_line_values( line, pXpm2bmp ); #ifdef _DBG printf( "size_x %d\n", pXpm2bmp->size_x ); printf( "size_y %d\n", pXpm2bmp->size_y ); #endif phase = 1; pXpm2bmp->color_entires_size = 0; nbytes = ( pXpm2bmp->chars_per_pixel + 1 ) * pXpm2bmp->colors; pXpm2bmp->color_entires = calloc( sizeof( XPMCOLORENTRY ), pXpm2bmp->colors + 100 ); pXpm2bmp->color_entires[0].color_str = calloc( nbytes, pXpm2bmp->colors ); for ( i = 1; i< pXpm2bmp->colors; i++ ) { pXpm2bmp->color_entires[i].color_str = pXpm2bmp->color_entires[0].color_str + ( pXpm2bmp->chars_per_pixel + 1 ) * i; } if (!(pXpm2bmp->dib = (unsigned char *)malloc(sizeof(BITMAPINFOHEADER) + pXpm2bmp->size_x * pXpm2bmp->size_y * 3))) { return 4; } if (!(pXpm2bmp->dib_trans = (unsigned char *)calloc(sizeof(BITMAPINFOHEADER) + pXpm2bmp->size_x * pXpm2bmp->size_y * 3,1))) { return 4; } memset(pXpm2bmp->dib, 0, sizeof(BITMAPINFOHEADER)); pXpm2bmp->bmih = (BITMAPINFOHEADER *)pXpm2bmp->dib; pXpm2bmp->bmih->biSize = sizeof(BITMAPINFOHEADER); pXpm2bmp->bmih->biWidth = pXpm2bmp->size_x; pXpm2bmp->bmih->biHeight = -((long)pXpm2bmp->size_y); pXpm2bmp->bmih->biPlanes = 1; pXpm2bmp->bmih->biBitCount = 24; pXpm2bmp->bmih->biCompression = 0; pXpm2bmp->wimage_data = pXpm2bmp->dib + sizeof(BITMAPINFOHEADER); pXpm2bmp->bmih_trans = (BITMAPINFOHEADER *)pXpm2bmp->dib_trans; pXpm2bmp->bmih_trans->biSize = sizeof(BITMAPINFOHEADER); pXpm2bmp->bmih_trans->biWidth = pXpm2bmp->size_x; pXpm2bmp->bmih_trans->biHeight = -((long)pXpm2bmp->size_y); pXpm2bmp->bmih_trans->biPlanes = 1; pXpm2bmp->bmih_trans->biBitCount = 24; pXpm2bmp->bmih_trans->biCompression = 0; pXpm2bmp->wimage_data_trans = pXpm2bmp->dib_trans + sizeof(BITMAPINFOHEADER); // memset( pXpm2bmp->wimage_data_trans, 255, 5* 22 * 3 ); break; case 1: parse_color_values( line, pXpm2bmp ); if ( pXpm2bmp->color_entires_size >= pXpm2bmp->colors ) { phase = 2; } break; case 2: parse_pixel_line_values( line, pXpm2bmp, pXpm2bmp->wimage_data + row * pXpm2bmp->size_x * 3, pXpm2bmp->wimage_data_trans + row * pXpm2bmp->size_x * 3 ); row++; if ( row >= pXpm2bmp->size_y ) { phase = 3; } break; } } fclose( file_xpm ); } return return_val; } Index: win32_gui.c =================================================================== RCS file: /cvsroot/navit/navit/projs/CodeBlocks/win32gui/win32_gui.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32_gui.c 24 Jan 2008 20:45:25 -0000 1.1 --- win32_gui.c 1 Feb 2008 22:42:08 -0000 1.2 *************** *** 9,12 **** --- 9,15 ---- #include "point.h" + #define ID_DISPLAY_ZOOMIN 8000 + #define ID_DISPLAY_ZOOMOUT 8001 + #define ID_FILE_EXIT 9001 #define ID_STUFF_GO 9002 *************** *** 14,20 **** --- 17,33 ---- const char g_szClassName[] = "myWindowClass"; + #define ID_CHILD_GFX 2000 + #define ID_CHILD_1 2001 + #define ID_CHILD_2 ID_CHILD_1 + 1 + #define ID_CHILD_3 ID_CHILD_2 + 1 + #define ID_CHILD_4 ID_CHILD_4 + 1 + + #define _(text) gettext(text) gboolean message_pump( gpointer data ) { + Sleep( 100 ); + printf( "pump\n" ); + MSG messages; /* Here messages to the application are saved */ if (GetMessage (&messages, NULL, 0, 0)) *************** *** 28,32 **** exit( 0 ); } ! return TRUE; } --- 41,45 ---- exit( 0 ); } ! return TRUE; } *************** *** 51,55 **** void (*button_callback)(void *data, int press, int button, struct point *p); void *button_callback_data; ! // AF FIXenum draw_mode_num mode; }; --- 64,68 ---- void (*button_callback)(void *data, int press, int button, struct point *p); void *button_callback_data; ! // enum draw_mode_num mode; }; *************** *** 57,64 **** --- 70,101 ---- extern struct graphics_priv *g_gra; + BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam) + { + LPRECT rcParent; + int idChild; + + idChild = GetWindowLong(hwndChild, GWL_ID); + + if ( idChild == ID_CHILD_GFX ) + { + rcParent = (LPRECT) lParam; + + MoveWindow( hwndChild, 0, 0, rcParent->right, rcParent->bottom, TRUE ); + (*g_gra->resize_callback)(g_gra->resize_callback_data, rcParent->right, rcParent->bottom); + } + + return TRUE; + } + #ifndef GET_WHEEL_DELTA_WPARAM + #define GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam)) + #endif static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { + RECT rcClient; + + printf( "PARENT %d %d %d \n", Message, wParam, lParam ); + switch(Message) { *************** *** 72,77 **** hSubMenu = CreatePopupMenu(); ! AppendMenu(hSubMenu, MF_STRING, ID_FILE_EXIT, "E&xit"); ! AppendMenu(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, "&File"); hSubMenu = CreatePopupMenu(); --- 109,130 ---- hSubMenu = CreatePopupMenu(); ! ! gunichar2* utf16 = NULL; ! ! utf16 = g_utf8_to_utf16( _( "_Quit" ), -1, NULL, NULL, NULL ); ! AppendMenuW(hSubMenu, MF_STRING, ID_FILE_EXIT, utf16 ); ! g_free( utf16 ); ! ! utf16 = g_utf8_to_utf16( _( "Zoom in" ), -1, NULL, NULL, NULL ); ! AppendMenuW(hSubMenu, MF_STRING, ID_DISPLAY_ZOOMIN, utf16 ); ! g_free( utf16 ); ! ! utf16 = g_utf8_to_utf16( _( "Zoom out" ), -1, NULL, NULL, NULL ); ! AppendMenuW(hSubMenu, MF_STRING, ID_DISPLAY_ZOOMOUT, utf16 ); ! g_free( utf16 ); ! ! utf16 = g_utf8_to_utf16( _( "Display" ), -1, NULL, NULL, NULL ); ! AppendMenuW(hMenu, MF_STRING | MF_POPUP, (UINT)hSubMenu, utf16 ); ! g_free( utf16 ); hSubMenu = CreatePopupMenu(); *************** *** 112,121 **** --- 165,201 ---- } break; + case WM_USER+ 1: + printf( "wm_user \n" ); + (*g_gra->resize_callback)( g_gra->resize_callback_data, g_gra->width, g_gra->height ); + break; case WM_CLOSE: DestroyWindow(hwnd); break; + case WM_SIZE: + GetClientRect(hwnd, &rcClient); + printf( "resize gui to: %d %d \n", rcClient.right, rcClient.bottom ); + + EnumChildWindows(hwnd, EnumChildProc, (LPARAM) &rcClient); + return 0; + break; case WM_DESTROY: PostQuitMessage(0); break; + + case WM_MOUSEWHEEL: + { + struct gui_priv * priv = GetWindowLongPtr( hwnd, DWLP_USER ); + + short delta = GET_WHEEL_DELTA_WPARAM( wParam ); + if ( delta > 0 ) + { + navit_zoom_in(g_this_->nav, 2, NULL); + } + else{ + navit_zoom_out(g_this_->nav, 2, NULL); + } + } + break; + default: return DefWindowProc(hwnd, Message, wParam, lParam); *************** *** 124,128 **** } ! int Win32Init( void ) { WNDCLASSEX wc; --- 204,208 ---- } ! HANDLE Win32Init( void ) { WNDCLASSEX wc; *************** *** 153,157 **** WS_EX_CLIENTEDGE, g_szClassName, ! "A Menu #2", WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, --- 233,237 ---- WS_EX_CLIENTEDGE, g_szClassName, ! _( "Navit" ), WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, 800, 600, *************** *** 223,227 **** g_this_ = this_; ! Win32Init(); --- 303,308 ---- g_this_ = this_; ! this_->hwnd = Win32Init(); ! SetWindowLongPtr( this_->hwnd , DWLP_USER, this_ ); |
From: Albert L F. <af...@us...> - 2008-02-01 22:43:49
|
Update of /cvsroot/navit/navit/projs/CodeBlocks In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11329 Modified Files: Navit.cbp Navit.workspace navit.xml.distr Log Message: Fix:projs/CodeBlocks:update project files, more work on native win32 gui/graphics Index: Navit.cbp =================================================================== RCS file: /cvsroot/navit/navit/projs/CodeBlocks/Navit.cbp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Navit.cbp 24 Jan 2008 20:45:22 -0000 1.8 --- Navit.cbp 1 Feb 2008 22:42:08 -0000 1.9 *************** *** 10,14 **** <Option output="bin\Debug\Navit" prefix_auto="1" extension_auto="1" /> <Option object_output="obj\Debug\" /> ! <Option external_deps="bin\Debug\libvehicle_file.la;bin\Debug\libdata_binfile.la;bin\Debug\libgtk_graphics.la;bin\Debug\libgtk_gui.la" /> <Option type="1" /> <Option compiler="gcc" /> --- 10,14 ---- <Option output="bin\Debug\Navit" prefix_auto="1" extension_auto="1" /> <Option object_output="obj\Debug\" /> ! <Option external_deps="bin\Debug\libvehicle_file.la;bin\Debug\libdata_binfile.la;bin\Debug\libgtk_graphics.la;bin\Debug\libgtk_gui.la;bin\Debug\libwin32_gui.la" /> <Option type="1" /> <Option compiler="gcc" /> Index: Navit.workspace =================================================================== RCS file: /cvsroot/navit/navit/projs/CodeBlocks/Navit.workspace,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Navit.workspace 24 Jan 2008 20:45:22 -0000 1.8 --- Navit.workspace 1 Feb 2008 22:42:08 -0000 1.9 *************** *** 20,23 **** --- 20,24 ---- <Depends filename="gentypes.cbp" /> </Project> + <Project filename="data_mg.cbp" /> <Project filename="Navit.cbp" active="1"> <Depends filename="win32_gui.cbp" /> *************** *** 38,42 **** <Depends filename="data_mg.cbp" /> </Project> - <Project filename="data_mg.cbp" /> </Workspace> </CodeBlocks_workspace_file> --- 39,42 ---- Index: navit.xml.distr =================================================================== RCS file: /cvsroot/navit/navit/projs/CodeBlocks/navit.xml.distr,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navit.xml.distr 14 Jan 2008 22:34:56 -0000 1.1 --- navit.xml.distr 1 Feb 2008 22:42:08 -0000 1.2 *************** *** 1,4 **** --- 1,5 ---- <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE navit SYSTEM "navit.dtd"> + <config> <plugins> <plugin path="$NAVIT_LIBDIR/*/${NAVIT_LIBPREFIX}lib*.so"/> *************** *** 74,100 **** <layout name="Tag"> <layer name="sea" details="0"> ! <item type="wood" order="0-"> <polygon color="#8ec78d" /> </item> ! <item type="town_poly" order="0-"> <polygon color="#ffc895" /> <polyline color="#ebb481" /> </item> ! <item type="water_poly" order="0-"> <polygon color="#82c8ea" /> <polyline color="#5096b8" /> <label label_size="5" /> </item> ! <item type="park_poly" order="0-"> <polygon color="#7cc334" /> <label label_size="5" /> </item> ! <item type="airport_poly" order="0-"> <polygon color="#a0a0a0" /> </item> ! <item type="sport_poly" order="0-"> <polygon color="#4af04f" /> </item> ! <item type="industry_poly,building_poly,place_poly" order="0-"> <polygon color="#e6e6e6" /> </item> --- 75,101 ---- <layout name="Tag"> <layer name="sea" details="0"> ! <item type="poly_wood" order="0-"> <polygon color="#8ec78d" /> </item> ! <item type="poly_town" order="0-"> <polygon color="#ffc895" /> <polyline color="#ebb481" /> </item> ! <item type="poly_water" order="0-"> <polygon color="#82c8ea" /> <polyline color="#5096b8" /> <label label_size="5" /> </item> ! <item type="poly_park" order="0-"> <polygon color="#7cc334" /> <label label_size="5" /> </item> ! <item type="poly_airport" order="0-"> <polygon color="#a0a0a0" /> </item> ! <item type="poly_sport" order="0-"> <polygon color="#4af04f" /> </item> ! <item type="poly_industry,poly_building,poly_place" order="0-"> <polygon color="#e6e6e6" /> </item> *************** *** 103,106 **** --- 104,113 ---- <label label_size="5" /> </item> + <item type="poly_apron" order="0-"> + <polygon color="#d0d0d0" /> + </item> + <item type="poly_terminal" order="7-"> + <polygon color="#e3c6a6" /> + </item> <item type="rail" order="6-"> <polyline color="#808080" width="3" /> *************** *** 163,166 **** --- 170,206 ---- <polyline color="#000000" width="1" /> </item> + <item type="street_service" order="11"> + <polyline color="#d2d2d2" width="4" /> + <polyline color="#fefefe" width="2" /> + </item> + <item type="street_service" order="12"> + <polyline color="#d2d2d2" width="5" /> + <polyline color="#fefefe" width="3" /> + </item> + <item type="street_service" order="13"> + <polyline color="#d2d2d2" width="6" /> + <polyline color="#fefefe" width="4" /> + </item> + <item type="street_service" order="14"> + <polyline color="#d2d2d2" width="7" /> + <polyline color="#fefefe" width="5" /> + </item> + <item type="street_service" order="15"> + <polyline color="#d2d2d2" width="8" /> + <polyline color="#fefefe" width="6" /> + </item> + <item type="street_service" order="16"> + <polyline color="#d2d2d2" width="9" /> + <polyline color="#fefefe" width="7" /> + </item> + <item type="street_service" order="17"> + <polyline color="#d2d2d2" width="10" /> + <polyline color="#fefefe" width="8" /> + </item> + <item type="street_service" order="18"> + <polyline color="#d2d2d2" width="11" /> + <polyline color="#fefefe" width="9" /> + </item> + <item type="street_0,street_1_city,street_1_land" order="10"> <polyline color="#d2d2d2" width="4" /> *************** *** 409,412 **** --- 449,535 ---- <label label_size="9" /> </item> + <item type="aeroway_taxiway" order="10"> + <polyline color="#989994" width="4" /> + <polyline color="#d3dbbc" width="2" /> + </item> + <item type="aeroway_taxiway" order="11"> + <polyline color="#989994" width="6" /> + <polyline color="#d3dbbc" width="4" /> + </item> + <item type="aeroway_taxiway" order="12"> + <polyline color="#989994" width="10" /> + <polyline color="#d3dbbc" width="8" /> + </item> + <item type="aeroway_taxiway" order="13"> + <polyline color="#989994" width="12" /> + <polyline color="#d3dbbc" width="9" /> + </item> + <item type="aeroway_taxiway" order="14"> + <polyline color="#989994" width="15" /> + <polyline color="#d3dbbc" width="13" /> + </item> + <item type="aeroway_taxiway" order="15"> + <polyline color="#989994" width="17" /> + <polyline color="#d3dbbc" width="14" /> + </item> + <item type="aeroway_taxiway" order="16"> + <polyline color="#989994" width="33" /> + <polyline color="#d3dbbc" width="26" /> + </item> + <item type="aeroway_taxiway" order="17"> + <polyline color="#989994" width="69" /> + <polyline color="#d3dbbc" width="61" /> + </item> + <item type="aeroway_taxiway" order="18"> + <polyline color="#989994" width="132" /> + <polyline color="#d3dbbc" width="126" /> + </item> + <item type="aeroway_runway" order="2-6"> + <polyline color="#404040" width="1" /> + </item> + <item type="aeroway_runway" order="7-8"> + <polyline color="#404040" width="3" /> + <polyline color="#d3dbbc" width="1" /> + </item> + <item type="aeroway_runway" order="9"> + <polyline color="#6b6f5f" width="5" /> + <polyline color="#d3dbbc" width="3" /> + </item> + <item type="aeroway_runway" order="10"> + <polyline color="#6b6f5f" width="6" /> + <polyline color="#d3dbbc" width="4" /> + </item> + <item type="aeroway_runway" order="11"> + <polyline color="#6b6f5f" width="9" /> + <polyline color="#d3dbbc" width="7" /> + </item> + <item type="aeroway_runway" order="12"> + <polyline color="#6b6f5f" width="13" /> + <polyline color="#d3dbbc" width="9" /> + </item> + <item type="aeroway_runway" order="13"> + <polyline color="#6b6f5f" width="18" /> + <polyline color="#d3dbbc" width="14" /> + </item> + <item type="aeroway_runway" order="14"> + <polyline color="#6b6f5f" width="21" /> + <polyline color="#d3dbbc" width="17" /> + </item> + <item type="aeroway_runway" order="15"> + <polyline color="#6b6f5f" width="24" /> + <polyline color="#d3dbbc" width="20" /> + </item> + <item type="aeroway_runway" order="16"> + <polyline color="#6b6f5f" width="39" /> + <polyline color="#d3dbbc" width="33" /> + </item> + <item type="aeroway_runway" order="17"> + <polyline color="#6b6f5f" width="78" /> + <polyline color="#d3dbbc" width="72" /> + </item> + <item type="aeroway_runway" order="18"> + <polyline color="#6b6f5f" width="156" /> + <polyline color="#d3dbbc" width="150" /> + </item> <item type="town_label,district_label,town_label_0e0,town_label_1e0,town_label_2e0,town_label_5e0,town_label_1e1,town_label_2e1,town_label_5e1,town_label_1e2,town_label_2e2,town_label_5e2,district_label_0e0,district_label_1e0,district_label_2e0,district_label_5e0,district_label_1e1,district_label_2e1,district_label_5e1,district_label_1e2,district_label_2e2,district_label_5e2" order="12-"> <circle color="#000000" radius="3" label_size="7" /> *************** *** 443,447 **** </item> ! <item type="poi_airport" order="0-"> <icon src="airport.xpm" /> </item> --- 566,570 ---- </item> ! <item type="poi_airport" order="5-"> <icon src="airport.xpm" /> </item> *************** *** 449,456 **** <icon src="ghost_town.xpm" /> </item> ! <item type="poi_hotel" order="0-"> <icon src="hotel.xpm" /> </item> ! <item type="poi_car_parking" order="0-"> <icon src="parking.xpm" /> </item> --- 572,579 ---- <icon src="ghost_town.xpm" /> </item> ! <item type="poi_hotel" order="12-"> <icon src="hotel.xpm" /> </item> ! <item type="poi_car_parking" order="11-"> <icon src="parking.xpm" /> </item> *************** *** 458,462 **** <icon src="car_dealer.xpm" /> </item> ! <item type="poi_fuel" order="0-"> <icon src="fuel.xpm" /> </item> --- 581,585 ---- <icon src="car_dealer.xpm" /> </item> ! <item type="poi_fuel" order="10-"> <icon src="fuel.xpm" /> </item> *************** *** 464,471 **** <icon src="shopping.xpm" /> </item> ! <item type="poi_attraction" order="0-"> <icon src="attraction.xpm" /> </item> ! <item type="poi_bar" order="0-"> <icon src="bar.xpm" /> </item> --- 587,594 ---- <icon src="shopping.xpm" /> </item> ! <item type="poi_attraction" order="5-"> <icon src="attraction.xpm" /> </item> ! <item type="poi_bar" order="12-"> <icon src="bar.xpm" /> </item> *************** *** 473,486 **** <icon src="bridge.xpm" /> </item> ! <item type="highway_exit" order="0-"> <icon src="exit.xpm" /> </item> ! <item type="poi_camp_rv" order="0-"> <icon src="camping.xpm" /> </item> ! <item type="poi_museum_history" order="0-"> <icon src="museum.xpm" /> </item> ! <item type="poi_hospital" order="0-"> <icon src="hospital.xpm" /> </item> --- 596,609 ---- <icon src="bridge.xpm" /> </item> ! <item type="highway_exit" order="11-"> <icon src="exit.xpm" /> </item> ! <item type="poi_camp_rv" order="9-"> <icon src="camping.xpm" /> </item> ! <item type="poi_museum_history" order="12-"> <icon src="museum.xpm" /> </item> ! <item type="poi_hospital" order="12-"> <icon src="hospital.xpm" /> </item> *************** *** 488,498 **** <circle color="#8080ff" radius="3" /> </item> ! <item type="poi_dining" order="0-"> <icon src="dining.xpm" /> </item> ! <item type="poi_fastfood" order="0-"> <icon src="fastfood.xpm" /> </item> ! <item type="poi_police" order="0-"> <icon src="police.xpm" /> </item> --- 611,621 ---- <circle color="#8080ff" radius="3" /> </item> ! <item type="poi_dining" order="12-"> <icon src="dining.xpm" /> </item> ! <item type="poi_fastfood" order="12-"> <icon src="fastfood.xpm" /> </item> ! <item type="poi_police" order="12-"> <icon src="police.xpm" /> </item> *************** *** 503,507 **** <icon src="autoservice.xpm" /> </item> ! <item type="poi_bank" order="0-"> <icon src="bank.xpm" /> </item> --- 626,630 ---- <icon src="autoservice.xpm" /> </item> ! <item type="poi_bank" order="12-"> <icon src="bank.xpm" /> </item> *************** *** 542,549 **** <icon src="cemetery.xpm" /> </item> ! <item type="poi_church" order="0-"> <icon src="church.xpm" /> </item> ! <item type="poi_cinema" order="0-"> <icon src="cinema.xpm" /> </item> --- 665,672 ---- <icon src="cemetery.xpm" /> </item> ! <item type="poi_church" order="11-"> <icon src="church.xpm" /> </item> ! <item type="poi_cinema" order="12-"> <icon src="cinema.xpm" /> </item> *************** *** 587,591 **** <icon src="fair.xpm" /> </item> ! <item type="poi_firebrigade" order="0-"> <icon src="firebrigade.xpm" /> </item> --- 710,714 ---- <icon src="fair.xpm" /> </item> ! <item type="poi_firebrigade" order="12-"> <icon src="firebrigade.xpm" /> </item> *************** *** 599,603 **** <icon src="garmin.xpm" /> </item> ! <item type="poi_golf" order="0-"> <icon src="golf.xpm" /> </item> --- 722,726 ---- <icon src="garmin.xpm" /> </item> ! <item type="poi_golf" order="12-"> <icon src="golf.xpm" /> </item> *************** *** 617,621 **** <icon src="icesport.xpm" /> </item> ! <item type="poi_information" order="0-"> <icon src="information.xpm" /> </item> --- 740,744 ---- <icon src="icesport.xpm" /> </item> ! <item type="poi_information" order="12-"> <icon src="information.xpm" /> </item> *************** *** 629,633 **** <icon src="levee.xpm" /> </item> ! <item type="poi_library" order="0-"> <icon src="library.xpm" /> </item> --- 752,756 ---- <icon src="levee.xpm" /> </item> ! <item type="poi_library" order="12-"> <icon src="library.xpm" /> </item> *************** *** 668,675 **** <icon src="personal_service.xpm" /> </item> ! <item type="poi_pharmacy" order="0-"> <icon src="pharmacy.xpm" /> </item> ! <item type="poi_post" order="0-"> <icon src="post.xpm" /> </item> --- 791,798 ---- <icon src="personal_service.xpm" /> </item> ! <item type="poi_pharmacy" order="12-"> <icon src="pharmacy.xpm" /> </item> ! <item type="poi_post" order="13-"> <icon src="post.xpm" /> </item> *************** *** 683,690 **** <icon src="resort.xpm" /> </item> ! <item type="poi_rest_room" order="0-"> <icon src="rest_room.xpm" /> </item> ! <item type="poi_restaurant" order="0-"> <icon src="restaurant.xpm" /> </item> --- 806,813 ---- <icon src="resort.xpm" /> </item> ! <item type="poi_rest_room" order="13-"> <icon src="rest_room.xpm" /> </item> ! <item type="poi_restaurant" order="12-"> <icon src="restaurant.xpm" /> </item> *************** *** 692,696 **** <icon src="restricted_area.xpm" /> </item> ! <item type="poi_restroom" order="0-"> <icon src="restroom.xpm" /> </item> --- 815,819 ---- <icon src="restricted_area.xpm" /> </item> ! <item type="poi_restroom" order="13-"> <icon src="restroom.xpm" /> </item> *************** *** 701,705 **** <icon src="scenic_area.xpm" /> </item> ! <item type="poi_school" order="0-"> <icon src="school.xpm" /> </item> --- 824,828 ---- <icon src="scenic_area.xpm" /> </item> ! <item type="poi_school" order="12-"> <icon src="school.xpm" /> </item> *************** *** 734,738 **** <icon src="shower.xpm" /> </item> ! <item type="poi_skiing" order="0-"> <icon src="skiing.xpm" /> </item> --- 857,861 ---- <icon src="shower.xpm" /> </item> ! <item type="poi_skiing" order="12-"> <icon src="skiing.xpm" /> </item> *************** *** 752,762 **** <icon src="subdivision.xpm" /> </item> ! <item type="poi_swimming" order="0-"> <icon src="swimming.xpm" /> </item> ! <item type="poi_telephone" order="0-"> <icon src="telephone.xpm" /> </item> ! <item type="poi_theater" order="0-"> <icon src="theater.xpm" /> </item> --- 875,885 ---- <icon src="subdivision.xpm" /> </item> ! <item type="poi_swimming" order="12-"> <icon src="swimming.xpm" /> </item> ! <item type="poi_telephone" order="13-"> <icon src="telephone.xpm" /> </item> ! <item type="poi_theater" order="12-"> <icon src="theater.xpm" /> </item> *************** *** 764,768 **** <icon src="tide.xpm" /> </item> ! <item type="poi_tower" order="0-"> <icon src="tower.xpm" /> </item> --- 887,891 ---- <icon src="tide.xpm" /> </item> ! <item type="poi_tower" order="13-"> <icon src="tower.xpm" /> </item> *************** *** 788,792 **** <icon src="zoo.xpm" /> </item> ! <item type="poi_picnic" order="0-"> <icon src="picnic.xpm" /> </item> --- 911,915 ---- <icon src="zoo.xpm" /> </item> ! <item type="poi_picnic" order="11-"> <icon src="picnic.xpm" /> </item> *************** *** 815,819 **** <icon src="gc_webcam.xpm" /> </item> ! <item type="flats,scrub,military_zone,marine_poly,plantation,tundra" order="0-"> <polygon color="#a0a0a0" /> <label label_size="5" /> --- 938,945 ---- <icon src="gc_webcam.xpm" /> </item> ! <item type="traffic_signals" order="13-"> ! <icon src="traffic_signals.xpm" /> ! </item> ! <item type="poly_flats,poly_scrub,poly_military_zone,poly_marine,plantation,tundra" order="0-"> <polygon color="#a0a0a0" /> <label label_size="5" /> *************** *** 830,831 **** --- 956,958 ---- </layout> </navit> + </config> |
From: Alex L. M. <haw...@us...> - 2008-02-01 17:08:25
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv9026/src Modified Files: osm2navit.c Log Message: * Add aeroway=aerodrome to render as poly_airport Index: osm2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/osm2navit.c,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** osm2navit.c 29 Jan 2008 22:12:27 -0000 1.48 --- osm2navit.c 1 Feb 2008 17:08:24 -0000 1.49 *************** *** 107,110 **** --- 107,111 ---- "w building 1 poly_building\n" "w building\n" + "w aeroway aerodrome poly_airport\n" "w aeroway apron poly_apron\n" "w aeroway runway aeroway_runway\n" |
From: Michael F. <ho...@us...> - 2008-02-01 07:08:34
|
Update of /cvsroot/navit/navit/src/graphics/gtk_drawing_area In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv13596/src/graphics/gtk_drawing_area Modified Files: Makefile.am Log Message: GTK:Add:Use gflags and libs of freetype2 and fontconfig for graphics_drawing_area Index: Makefile.am =================================================================== RCS file: /cvsroot/navit/navit/src/graphics/gtk_drawing_area/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.am 3 Jan 2008 11:13:37 -0000 1.9 --- Makefile.am 1 Feb 2008 07:08:32 -0000 1.10 *************** *** 1,5 **** include $(top_srcdir)/Makefile.inc ! AM_CPPFLAGS = @GTK2_CFLAGS@ @FREETYPE2_CFLAGS@ -I$(top_srcdir)/src -DMODULE=graphics_gtk_drawing_area modulegraphics_LTLIBRARIES = libgraphics_gtk_drawing_area.la libgraphics_gtk_drawing_area_la_SOURCES = graphics_gtk_drawing_area.c ! libgraphics_gtk_drawing_area_la_LDFLAGS = @GTK2_LIBS@ --- 1,5 ---- include $(top_srcdir)/Makefile.inc ! AM_CPPFLAGS = @GTK2_CFLAGS@ @FREETYPE2_CFLAGS@ @FONTCONFIG_CFLAGS@ -I$(top_srcdir)/src -DMODULE=graphics_gtk_drawing_area modulegraphics_LTLIBRARIES = libgraphics_gtk_drawing_area.la libgraphics_gtk_drawing_area_la_SOURCES = graphics_gtk_drawing_area.c ! libgraphics_gtk_drawing_area_la_LDFLAGS = @GTK2_LIBS@ @FREETYPE2_LIBS@ @FONTCONFIG_LIBS@ |
From: Michael F. <ho...@us...> - 2008-02-01 06:20:45
|
Update of /cvsroot/navit/navit In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11110 Modified Files: configure.in Log Message: Core:Add:Add check for fontconfig to configure Index: configure.in =================================================================== RCS file: /cvsroot/navit/navit/configure.in,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** configure.in 25 Jan 2008 12:58:29 -0000 1.68 --- configure.in 1 Feb 2008 06:20:47 -0000 1.69 *************** *** 84,88 **** PKG_CHECK_MODULES(GTK2, [gtk+-2.0], [gtk2_pkgconfig=yes], [gtk2_pkgconfig=no]) if test "x$gtk2_pkgconfig" = "xyes"; then ! AC_DEFINE(HAVE_GTK2, 1, [Define to 1 if you have imlib2]) fi fi --- 84,88 ---- PKG_CHECK_MODULES(GTK2, [gtk+-2.0], [gtk2_pkgconfig=yes], [gtk2_pkgconfig=no]) if test "x$gtk2_pkgconfig" = "xyes"; then ! AC_DEFINE(HAVE_GTK2, 1, [Define to 1 if you have gtk2]) fi fi *************** *** 98,106 **** PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_pkgconfig=yes], [freetype2_pkgconfig=no]) if test "x$freetype2_pkgconfig" = "xyes"; then ! AC_DEFINE(HAVE_FREETYPE2, 1, [Define to 1 if you have imlib2]) fi AC_SUBST(FREETYPE2_CFLAGS) AC_SUBST(FREETYPE2_LIBS) PKG_CHECK_MODULES(IMLIB2, [imlib2], [imlib2_pkgconfig=yes], [imlib2_pkgconfig=no]) if test "x$imlib2_pkgconfig" = "xyes"; then --- 98,113 ---- PKG_CHECK_MODULES(FREETYPE2, [freetype2], [freetype2_pkgconfig=yes], [freetype2_pkgconfig=no]) if test "x$freetype2_pkgconfig" = "xyes"; then ! AC_DEFINE(HAVE_FREETYPE2, 1, [Define to 1 if you have freetype2]) fi AC_SUBST(FREETYPE2_CFLAGS) AC_SUBST(FREETYPE2_LIBS) + PKG_CHECK_MODULES(FONTCONFIG, [fontconfig], [fontconfig_pkgconfig=yes], [fontconfig_pkgconfig=no]) + if test "x$fontconfig_pkgconfig" = "xyes"; then + AC_DEFINE(HAVE_FONTCONFIG, 1, [Define to 1 if you have fontconfig]) + fi + AC_SUBST(FONTCONFIG_CFLAGS) + AC_SUBST(FONTCONFIG_LIBS) + PKG_CHECK_MODULES(IMLIB2, [imlib2], [imlib2_pkgconfig=yes], [imlib2_pkgconfig=no]) if test "x$imlib2_pkgconfig" = "xyes"; then |
From: Michael F. <ho...@us...> - 2008-02-01 05:54:35
|
Update of /cvsroot/navit/navit/src/graphics/gtk_drawing_area In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8038/graphics/gtk_drawing_area Modified Files: graphics_gtk_drawing_area.c Log Message: GTK:Fix:Use fontconfig instead of static fontpath. Thanks to Matt Callow for the patch. Index: graphics_gtk_drawing_area.c =================================================================== RCS file: /cvsroot/navit/navit/src/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** graphics_gtk_drawing_area.c 23 Jan 2008 21:25:56 -0000 1.28 --- graphics_gtk_drawing_area.c 1 Feb 2008 05:54:38 -0000 1.29 *************** *** 2,5 **** --- 2,6 ---- #include "config.h" #include <gtk/gtk.h> + #include <fontconfig/fontconfig.h> #include <ft2build.h> #include FT_FREETYPE_H *************** *** 62,96 **** graphics_destroy(struct graphics_priv *gr) { } ! static char *fontpaths[]={ ! #ifdef _WIN32 ! ".", ! #endif ! "/usr/share/fonts", ! "/usr/X11R6/lib/X11/fonts/msttcorefonts", ! "/usr/X11R6/lib/X11/fonts/truetype", ! "/usr/X11R6/lib/X11/fonts/TTF", ! "/usr/share/fonts/truetype", ! "/usr/share/fonts/truetype/msttcorefonts", ! "/usr/share/fonts/truetype/ttf-dejavu", ! "/usr/share/fonts/ttf", ! "/usr/share/fonts/corefonts", ! "/usr/share/fonts/liberation", ! NULL, ! }; ! ! #if 0 ! static char *fontlist_bd[]={ ! "/usr/X11R6/lib/X11/fonts/msttcorefonts/arialbd.ttf", ! "/usr/X11R6/lib/X11/fonts/truetype/arialbd.ttf", ! "/usr/share/fonts/truetype/msttcorefonts/arialbd.ttf", ! "/usr/share/fonts/ttf/arialbd.ttf", ! "/usr/share/fonts/corefonts/arialbd.ttf", NULL, }; - #endif - - static void font_destroy(struct graphics_font_priv *font) --- 63,81 ---- graphics_destroy(struct graphics_priv *gr) { + FcFini(); } ! /** ! * List of font families to use, in order of preference ! */ ! static char *fontfamilies[]={ ! "Liberation Mono", ! "Arial", ! "DejaVu Sans", ! "NcrBI4nh", ! "luximbi", ! "FreeSans", NULL, }; static void font_destroy(struct graphics_font_priv *font) *************** *** 104,115 **** }; static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, int size) { - char **filename=fontpaths; - char fontpath [256]; - struct graphics_font_priv *font=g_new(struct graphics_font_priv, 1); *meth=font_methods; if (!gr->library_init) { --- 89,104 ---- }; + /** + * Load a new font using the fontconfig library. + * First search for each of the font families and require and exact match on family + * If no font found, let fontconfig pick the best match + */ static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, int size) { struct graphics_font_priv *font=g_new(struct graphics_font_priv, 1); *meth=font_methods; + int exact, found; + char **family; if (!gr->library_init) { *************** *** 117,146 **** gr->library_init=1; } ! while (*filename) { ! // Trying the Liberation font first ! sprintf(fontpath,"%s/LiberationMono-Regular.ttf",*filename); ! dbg(1,"font : %s\n",fontpath); ! if (!FT_New_Face( gr->library, fontpath, 0, &font->face )) ! break; ! //Fallback to arial.ttf, in the same path ! sprintf(fontpath,"%s/arial.ttf",*filename); ! dbg(1,"font : %s\n",fontpath); ! if (!FT_New_Face( gr->library, fontpath, 0, &font->face )) ! break; ! sprintf(fontpath,"%s/NcrBI4nh.ttf",*filename); ! dbg(1,"font : %s\n",fontpath); ! if (!FT_New_Face( gr->library, fontpath, 0, &font->face )) ! break; ! sprintf(fontpath,"%s/luximbi.ttf",*filename); ! dbg(1,"font : %s\n",fontpath); ! if (!FT_New_Face( gr->library, fontpath, 0, &font->face )) ! break; ! sprintf(fontpath,"%s/DejaVuSans.ttf",*filename); ! dbg(1,"font : %s\n",fontpath); ! if (!FT_New_Face( gr->library, fontpath, 0, &font->face )) ! break; ! filename++; } ! if (! *filename) { g_warning("Failed to load font, no labelling"); g_free(font); --- 106,139 ---- gr->library_init=1; } ! found=0; ! for (exact=1;!found && exact>=0;exact--) { ! family=fontfamilies; ! while (*family && !found) { ! dbg(1, "Looking for font family %s. exact=%d\n", *family, exact); ! FcPattern *required = FcPatternBuild(NULL, FC_FAMILY, FcTypeString, *family, NULL); ! FcConfigSubstitute(FcConfigGetCurrent(), required, FcMatchFont); ! FcDefaultSubstitute(required); ! FcResult result; ! FcPattern *matched = FcFontMatch(FcConfigGetCurrent(), required, &result); ! if (matched) { ! FcValue v1, v2; ! FcChar8 *fontfile; ! int fontindex; ! FcPatternGet(required, FC_FAMILY, 0, &v1); ! FcPatternGet(matched, FC_FAMILY, 0, &v2); ! FcResult r1 = FcPatternGetString(matched, FC_FILE, 0, &fontfile); ! FcResult r2 = FcPatternGetInteger(matched, FC_INDEX, 0, &fontindex); ! if ((r1 == FcResultMatch) && (r2 == FcResultMatch) && (FcValueEqual(v1,v2) || !exact)) { ! dbg(2, "About to load font from file %s index %d\n", fontfile, fontindex); ! FT_New_Face( gr->library, (char *)fontfile, fontindex, &font->face ); ! found=1; ! } ! FcPatternDestroy(matched); ! } ! FcPatternDestroy(required); ! family++; ! } } ! if (!found) { g_warning("Failed to load font, no labelling"); g_free(font); *************** *** 214,217 **** --- 207,212 ---- gc->gc=gdk_gc_new(gr->widget->window); gc->gr=gr; + if (FcInit() != FcTrue) + dbg(0, "Failed to init fontconfig"); return gc; } |
From: KaZeR <ka...@us...> - 2008-01-31 10:47:35
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25014 Modified Files: navit.dtd Log Message: Core:Fix:Added sdl specific gui attributes to dtd Index: navit.dtd =================================================================== RCS file: /cvsroot/navit/navit/src/navit.dtd,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** navit.dtd 31 Jan 2008 10:34:13 -0000 1.2 --- navit.dtd 31 Jan 2008 10:47:35 -0000 1.3 *************** *** 18,21 **** --- 18,23 ---- <!ATTLIST gui toolbar CDATA #IMPLIED> <!ATTLIST gui statusbar CDATA #IMPLIED> + <!ATTLIST gui skin CDATA #IMPLIED> + <!ATTLIST gui fullscreen CDATA #IMPLIED> <!ELEMENT graphics EMPTY> <!ATTLIST graphics type CDATA #REQUIRED> |
From: Michael F. <ho...@us...> - 2008-01-31 10:34:14
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23902 Modified Files: navit.dtd Log Message: Core:Fix:Add new gui attributes to dtd Index: navit.dtd =================================================================== RCS file: /cvsroot/navit/navit/src/navit.dtd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** navit.dtd 30 Jan 2008 20:32:27 -0000 1.1 --- navit.dtd 31 Jan 2008 10:34:13 -0000 1.2 *************** *** 15,18 **** --- 15,21 ---- <!ELEMENT gui EMPTY> <!ATTLIST gui type CDATA #REQUIRED> + <!ATTLIST gui menubar CDATA #IMPLIED> + <!ATTLIST gui toolbar CDATA #IMPLIED> + <!ATTLIST gui statusbar CDATA #IMPLIED> <!ELEMENT graphics EMPTY> <!ATTLIST graphics type CDATA #REQUIRED> |
From: KaZeR <ka...@us...> - 2008-01-31 09:19:39
|
Update of /cvsroot/navit/navit/src/gui/gtk In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18381/gui/gtk Modified Files: gui_gtk_window.c Log Message: Add:GTK:Added options to disable menubar/toolbar/statusbar, thanks Matt Callow for the patch Index: gui_gtk_window.c =================================================================== RCS file: /cvsroot/navit/navit/src/gui/gtk/gui_gtk_window.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** gui_gtk_window.c 28 Jan 2008 08:55:48 -0000 1.18 --- gui_gtk_window.c 31 Jan 2008 09:19:42 -0000 1.19 *************** *** 9,12 **** --- 9,13 ---- #include <gtk/gtk.h> #include "config.h" + #include "item.h" #include "navit.h" #include "debug.h" *************** *** 159,162 **** --- 160,164 ---- char *cp = getenv("NAVIT_XID"); unsigned xid = 0; + struct attr *menubar, *toolbar, *statusbar; if (cp) { *************** *** 164,167 **** --- 166,181 ---- } + menubar = attr_search(attrs, NULL, attr_menubar); + if (menubar && menubar->u.num == 0) { + gui_gtk_methods.menubar_new = NULL; + } + toolbar = attr_search(attrs, NULL, attr_toolbar); + if (toolbar && toolbar->u.num == 0) { + gui_gtk_methods.toolbar_new = NULL; + } + statusbar = attr_search(attrs, NULL, attr_statusbar); + if (statusbar && statusbar->u.num == 0) { + gui_gtk_methods.statusbar_new = NULL; + } *meth=gui_gtk_methods; |
From: KaZeR <ka...@us...> - 2008-01-31 09:19:39
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18381 Modified Files: attr_def.h navit.xml Log Message: Add:GTK:Added options to disable menubar/toolbar/statusbar, thanks Matt Callow for the patch Index: navit.xml =================================================================== RCS file: /cvsroot/navit/navit/src/navit.xml,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** navit.xml 29 Jan 2008 21:46:34 -0000 1.33 --- navit.xml 31 Jan 2008 09:19:41 -0000 1.34 *************** *** 15,19 **** --> <navit center="4808 N 1134 E" zoom="256" tracking="1" cursor="1" orientation="0"> ! <gui type="gtk" /> <graphics type="gtk_drawing_area" /> <!-- For SDL, use rather the following lines --- 15,19 ---- --> <navit center="4808 N 1134 E" zoom="256" tracking="1" cursor="1" orientation="0"> ! <gui type="gtk" menubar="1" toolbar="1" statusbar="1" /> <graphics type="gtk_drawing_area" /> <!-- For SDL, use rather the following lines Index: attr_def.h =================================================================== RCS file: /cvsroot/navit/navit/src/attr_def.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** attr_def.h 6 Jan 2008 16:35:21 -0000 1.26 --- attr_def.h 31 Jan 2008 09:19:41 -0000 1.27 *************** *** 44,47 **** --- 44,50 ---- ATTR(orientation) ATTR(tracking) + ATTR(menubar) + ATTR(statusbar) + ATTR(toolbar) ATTR2(0x0002ffff,type_int_end) ATTR2(0x00030000,type_string_begin) |
From: Michael F. <ho...@us...> - 2008-01-30 20:32:28
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2405 Added Files: navit.dtd Log Message: Core:Add:Add dtd for navit config file --- NEW FILE: navit.dtd --- <!ELEMENT config (plugins,debug*,navit)> <!ELEMENT plugins (plugin*)> <!ELEMENT plugin EMPTY> <!ATTLIST plugin path CDATA #REQUIRED> <!ATTLIST plugin active CDATA #IMPLIED> <!ELEMENT debug EMPTY> <!ATTLIST debug name CDATA #REQUIRED> <!ATTLIST debug level CDATA "0"> <!ELEMENT navit (gui,graphics,vehicle*,tracking,route,navigation,speech,mapset+,layout+)> <!ATTLIST navit center CDATA #REQUIRED> <!ATTLIST navit zoom CDATA #REQUIRED> <!ATTLIST navit tracking CDATA #REQUIRED> <!ATTLIST navit cursor CDATA #REQUIRED> <!ATTLIST navit orientation CDATA #REQUIRED> <!ELEMENT gui EMPTY> <!ATTLIST gui type CDATA #REQUIRED> <!ELEMENT graphics EMPTY> <!ATTLIST graphics type CDATA #REQUIRED> <!ELEMENT vehicle EMPTY> <!ATTLIST vehicle name CDATA #REQUIRED> <!ATTLIST vehicle source CDATA #REQUIRED> <!ATTLIST vehicle color CDATA #REQUIRED> <!ATTLIST vehicle enabled CDATA #IMPLIED> <!ATTLIST vehicle active CDATA #IMPLIED> <!ATTLIST vehicle follow CDATA #IMPLIED> <!ATTLIST vehicle refresh CDATA #IMPLIED> <!ELEMENT tracking ANY> <!ELEMENT route (speed+)> <!ELEMENT speed EMPTY> <!ATTLIST speed type CDATA #REQUIRED> <!ATTLIST speed value CDATA #REQUIRED> <!ELEMENT navigation (announce+)> <!ELEMENT announce EMPTY> <!ATTLIST announce type CDATA #REQUIRED> <!ATTLIST announce level0 CDATA #IMPLIED> <!ATTLIST announce level1 CDATA #IMPLIED> <!ATTLIST announce level2 CDATA #IMPLIED> <!ATTLIST announce unit CDATA #REQUIRED> <!ELEMENT speech EMPTY> <!ATTLIST speech type CDATA #REQUIRED> <!ATTLIST speech data CDATA #REQUIRED> <!ELEMENT mapset (map+)> <!ATTLIST mapset enabled CDATA #IMPLIED> <!ELEMENT map EMPTY> <!ATTLIST map type CDATA #REQUIRED> <!ATTLIST map enabled CDATA #IMPLIED> <!ATTLIST map active CDATA #IMPLIED> <!ATTLIST map data CDATA #REQUIRED> <!ATTLIST map debug CDATA #IMPLIED> <!ELEMENT layout (layer*)> <!ATTLIST layout name CDATA #REQUIRED> <!ELEMENT layer (item+)> <!ATTLIST layer name CDATA #REQUIRED> <!ATTLIST layer details CDATA #REQUIRED> <!ELEMENT item (polygon|polyline|label|circle|icon)*> <!ATTLIST item type CDATA #REQUIRED> <!ATTLIST item order CDATA #REQUIRED> <!ELEMENT polygon EMPTY> <!ATTLIST polygon color CDATA #REQUIRED> <!ELEMENT polyline EMPTY> <!ATTLIST polyline color CDATA #REQUIRED> <!ATTLIST polyline width CDATA #IMPLIED> <!ELEMENT label EMPTY> <!ATTLIST label label_size CDATA #REQUIRED> <!ELEMENT circle EMPTY> <!ATTLIST circle color CDATA #REQUIRED> <!ATTLIST circle radius CDATA #REQUIRED> <!ATTLIST circle label_size CDATA #IMPLIED> <!ELEMENT icon EMPTY> <!ATTLIST icon src CDATA #REQUIRED> |
From: KaZeR <ka...@us...> - 2008-01-30 10:16:17
|
Update of /cvsroot/navit/navit In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4641 Modified Files: AUTHORS Log Message: Update:Doc:Updated AUTHORS list Index: AUTHORS =================================================================== RCS file: /cvsroot/navit/navit/AUTHORS,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AUTHORS 4 Dec 2005 10:38:46 -0000 1.2 --- AUTHORS 30 Jan 2008 10:16:18 -0000 1.3 *************** *** 1,2 **** --- 1,7 ---- Michael Farmbauer <ho...@us...> Martin Schaller <mar...@us...> + Pierre Grandin <ka...@us...> + Alexander Atanasov <aat...@gm...> + + And all the Navit Team members and contributors. + See http://wiki.navit-project.org/index.php/Navit_project_members_and_contributors for the full list! |
From: KaZeR <ka...@us...> - 2008-01-30 09:50:33
|
Update of /cvsroot/navit/navit In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24983 Modified Files: README Log Message: Update:Doc:Updated README with the list of 12 languages Index: README =================================================================== RCS file: /cvsroot/navit/navit/README,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** README 25 Jan 2008 09:53:45 -0000 1.11 --- README 30 Jan 2008 09:50:36 -0000 1.12 *************** *** 18,22 **** destination, but also generates directions and even speaks to you. ! Navit currently speaks 10 languages : - English - German --- 18,22 ---- destination, but also generates directions and even speaks to you. ! Navit currently speaks 12 languages : - English - German *************** *** 29,32 **** --- 29,34 ---- - Finish - Danish + - Dutch + - Russian For help or more information, please refer to the wiki : |
From: KaZeR <ka...@us...> - 2008-01-30 09:48:21
|
Update of /cvsroot/navit/navit/po In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv24091 Added Files: ru.po Log Message: Add:Translations:Added Russian translation contributed by Rustam T. Usmanov. Thank you\! --- NEW FILE: ru.po --- # Russian translations for navit. # Copyright (C) 2008. # This file is distributed under the same license as the PACKAGE package. # Rustam Usmanov <zc...@ma...>, 2008. # msgid "" msgstr "" "Project-Id-Version: Navit 0.0.4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-01-30 10:48+0100\n" "PO-Revision-Date: 2008-01-24 15:46+0300\n" "Last-Translator: Rustam T. Usmanov\n" "Language-Team: Rustam T. Usmanov\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%100/10==1 ? 2 : n%10==1 ? 0 : (n+9)%" "10>3 ? 2 : 1;\n" #: ../src/main.c:108 #, c-format msgid "Running from source directory\n" msgstr "ÐапÑÑк в иÑÑ Ð¾Ð´Ð½Ð¾Ð¼ каÑалоге\n" #: ../src/main.c:124 #, c-format msgid "setting '%s' to '%s'\n" msgstr "ÑÑÑановка '%s' в '%s'\n" #: ../src/main.c:202 #, c-format msgid "No config file navit.xml, navit.xml.local found\n" msgstr "Ðе найден конÑигÑÑаÑионнÑй Ñайл navit.xml, navit.xml.local\n" #: ../src/main.c:206 #, c-format msgid "Error parsing '%s': %s\n" msgstr "ÐÑибка ÑазбоÑа '%s': %s\n" #: ../src/main.c:209 #, c-format msgid "Using '%s'\n" msgstr "ÐÑполÑзÑеÑÑÑ '%s'\n" #: ../src/main.c:212 #, c-format msgid "No instance has been created, exiting\n" msgstr "ÐкземплÑÑ Ð½Ðµ Ñоздан, вÑÑ Ð¾Ð´Ð¸Ð¼\n" #: ../src/navigation.c:162 #, c-format msgid "%d m" msgstr "%d м" #: ../src/navigation.c:164 #, c-format msgid "in %d m" msgstr "ÑеÑез %d м" #: ../src/navigation.c:168 #, c-format msgid "%d meters" msgstr "%d меÑÑов" #: ../src/navigation.c:170 #, c-format msgid "in %d meters" msgstr "ÑеÑез %d меÑÑов" #: ../src/navigation.c:176 #, c-format msgid "%d.%d kilometer" msgstr "%d.%d киломеÑÑ" #: ../src/navigation.c:178 #, c-format msgid "in %d.%d kilometers" msgstr "ÑеÑез %d.%d киломеÑÑ(а,ов" #: ../src/navigation.c:182 #, c-format msgid "one kilometer" msgid_plural "%d kilometers" msgstr[0] "%d киломеÑÑ" msgstr[1] "%d киломеÑÑа" msgstr[2] "%d киломеÑÑов" #: ../src/navigation.c:184 #, c-format msgid "in one kilometer" msgid_plural "in %d kilometers" msgstr[0] "ÑеÑез %d киломеÑÑ" msgstr[1] "%d киломеÑÑа" msgstr[2] "%d киломеÑÑов" #: ../src/navigation.c:402 msgid "right" msgstr "напÑаво" #: ../src/navigation.c:409 msgid "left" msgstr "налево" #: ../src/navigation.c:413 msgid "easily " msgstr "Ñлегка " #: ../src/navigation.c:417 msgid "strongly " msgstr "ÑилÑно " #: ../src/navigation.c:420 msgid "unknown " msgstr "неизвеÑÑно " #: ../src/navigation.c:426 msgid "When possible, please turn around" msgstr "РазвеÑниÑеÑÑ, пожалÑйÑÑа, еÑли ÑÑо возможно" #: ../src/navigation.c:433 #, c-format msgid "Follow the road for the next %s" msgstr "ÐвигайÑеÑÑ Ð¿Ð¾ доÑоге ÑледÑÑÑие %s" #: ../src/navigation.c:437 msgid "soon" msgstr "ÑкоÑо" #: ../src/navigation.c:443 msgid "now" msgstr "ÑейÑаÑ" #: ../src/navigation.c:446 msgid "error" msgstr "оÑибка" #. TRANSLATORS: The first argument is strength, the second direction and the third distance #: ../src/navigation.c:450 #, c-format msgid "Turn %1$s%2$s %3$s" msgstr "ÐовеÑниÑе %1$s%2$s %3$s" #: ../src/navigation.c:453 #, c-format msgid "You have reached your destination %s" msgstr "ÐÑ Ð¿ÑибÑли в пÑÐ½ÐºÑ Ð½Ð°Ð·Ð½Ð°ÑÐµÐ½Ð¸Ñ %s" #: ../src/navit.c:659 ../src/gui/gtk/gui_gtk_action.c:198 msgid "Layout" msgstr "Ð¡Ñ ÐµÐ¼Ð°" #: ../src/navit.c:675 msgid "Projection" msgstr "ÐÑоекÑиÑ" #: ../src/navit.c:730 msgid "Former Destinations" msgstr "ÐÑоÑлÑе пÑнкÑÑ Ð½Ð°Ð·Ð½Ð°ÑениÑ" #: ../src/navit.c:740 msgid "Bookmarks" msgstr "Ðакладки" #: ../src/navit.c:778 msgid "Vehicle" msgstr "Т/Ñ" #: ../src/navit.c:828 msgid "Command" msgstr "Ðоманда" #: ../src/navit.c:833 msgid "Length" msgstr "Ðлина" #: ../src/navit.c:839 msgid "Time" msgstr "ÐÑемÑ" #: ../src/navit.c:844 msgid "Destination Length" msgstr "" #: ../src/navit.c:850 msgid "Destination Time" msgstr "" #: ../src/navit.c:873 ../src/gui/gtk/gui_gtk_action.c:202 msgid "Roadbook" msgstr "ÐоÑожнÑй ÑпÑавоÑник" #: ../src/navit.c:1106 ../src/gui/gtk/destination.c:368 #: ../src/gui/gtk/gui_gtk_action.c:197 msgid "Map" msgstr "ÐаÑÑа" #: ../src/navit.c:1113 ../src/gui/gtk/gui_gtk_action.c:196 msgid "Route" msgstr "ÐаÑÑÑÑÑ" #: ../src/popup.c:229 #, c-format msgid "Point 0x%x 0x%x" msgstr "ТоÑка 0x%x 0x%x" #: ../src/popup.c:230 #, fuzzy, c-format msgid "Screen coord : %d %d" msgstr "ÐкÑан %d %d" #: ../src/popup.c:239 msgid "Set as position" msgstr "УÑÑановиÑÑ ÐºÐ°Ðº пÑÐ½ÐºÑ Ð¾ÑпÑавлениÑ" #: ../src/popup.c:240 msgid "Set as destination" msgstr "УÑÑановиÑÑ ÐºÐ°Ðº пÑÐ½ÐºÑ Ð½Ð°Ð·Ð½Ð°ÑениÑ" #: ../src/popup.c:241 msgid "Add as bookmark" msgstr "ÐобавиÑÑ Ð² закладки" #: ../src/country.c:24 msgid "Czech Republic" msgstr "ЧеÑÑÐºÐ°Ñ Ð ÐµÑпÑблика" #: ../src/country.c:25 msgid "Slovakia" msgstr "СловакиÑ" #: ../src/country.c:26 msgid "San Marino" msgstr "Сан ÐаÑино" #: ../src/country.c:27 msgid "Estonia" msgstr "ÐÑÑониÑ" #: ../src/country.c:28 msgid "Georgia" msgstr "ÐÑÑзиÑ" #: ../src/country.c:29 msgid "Latvia" msgstr "ÐаÑвиÑ" #: ../src/country.c:30 msgid "Lithuania" msgstr "ÐиÑва" #: ../src/country.c:31 msgid "Moldova" msgstr "ÐолдавиÑ" #: ../src/country.c:32 msgid "Russian Federation" msgstr "РоÑÑийÑÐºÐ°Ñ Ð¤ÐµÐ´ÐµÑаÑиÑ" #: ../src/country.c:33 msgid "Ukraine" msgstr "УкÑаина" #: ../src/country.c:34 msgid "Belarus" msgstr "ÐелоÑÑÑÑиÑ" #: ../src/country.c:35 msgid "Egypt" msgstr "ÐгипеÑ" #: ../src/country.c:36 msgid "Greece" msgstr "ÐÑеÑиÑ" #: ../src/country.c:37 msgid "Netherlands" msgstr "ÐидеÑландÑ" #: ../src/country.c:38 msgid "Belgium" msgstr "ÐелÑгиÑ" #: ../src/country.c:39 msgid "France" msgstr "ФÑанÑиÑ" #: ../src/country.c:40 msgid "Spain" msgstr "ÐÑпаниÑ" #: ../src/country.c:41 msgid "Hungary" msgstr "ÐенгÑиÑ" #: ../src/country.c:42 msgid "Italy" msgstr "ÐÑалиÑ" #: ../src/country.c:43 msgid "Romania" msgstr "Ð ÑмÑниÑ" #: ../src/country.c:44 msgid "Switzerland" msgstr "ШвейÑаÑиÑ" #: ../src/country.c:45 msgid "Austria" msgstr "ÐвÑÑÑиÑ" #: ../src/country.c:46 msgid "United Kingdom" msgstr "ÐеликобÑиÑаниÑ" #: ../src/country.c:47 msgid "Denmark" msgstr "ÐаниÑ" #: ../src/country.c:48 msgid "Sweden" msgstr "ШвеÑиÑ" #: ../src/country.c:49 msgid "Norway" msgstr "ÐоÑвегиÑ" #: ../src/country.c:50 msgid "Poland" msgstr "ÐолÑÑа" #: ../src/country.c:51 msgid "Germany" msgstr "ÐеÑманиÑ" #: ../src/country.c:52 msgid "Gibraltar" msgstr "ÐибÑалÑаÑ" #: ../src/country.c:53 msgid "Portugal" msgstr "ÐоÑÑÑгалиÑ" #: ../src/country.c:54 msgid "Luxembourg" msgstr "ÐÑкÑембÑÑг" #: ../src/country.c:55 msgid "Ireland" msgstr "ÐÑландиÑ" #: ../src/country.c:56 msgid "Iceland" msgstr "ÐÑландиÑ" #: ../src/country.c:57 msgid "Albania" msgstr "ÐлбаниÑ" #: ../src/country.c:58 msgid "Malta" msgstr "ÐалÑÑа" #: ../src/country.c:59 msgid "Cyprus" msgstr "ÐипÑ" #: ../src/country.c:60 msgid "Finland" msgstr "ФинлÑндиÑ" #: ../src/country.c:61 msgid "Bulgaria" msgstr "ÐолгаÑиÑ" #: ../src/country.c:62 msgid "Lebanon" msgstr "Ðиван" #: ../src/country.c:63 msgid "Andorra" msgstr "ÐндоÑÑа" #: ../src/country.c:64 msgid "Syria" msgstr "СиÑиÑ" #: ../src/country.c:65 msgid "Saudi Arabia" msgstr "СаÑдовÑÐºÐ°Ñ ÐÑавиÑ" #: ../src/country.c:66 msgid "Libia" msgstr "ÐивиÑ" #: ../src/country.c:67 msgid "Israel" msgstr "ÐзÑаилÑ" #: ../src/country.c:68 msgid "Palestinia" msgstr "ÐалеÑÑина" #: ../src/country.c:69 msgid "Liechtenstein" msgstr "ÐÐ¸Ñ ÑенÑÑейн" #: ../src/country.c:70 msgid "Morocco" msgstr "ÐаÑокко" #: ../src/country.c:71 msgid "Algeria" msgstr "ÐлжиÑ" #: ../src/country.c:72 msgid "Tunisia" msgstr "ТÑниÑ" #: ../src/country.c:73 msgid "Serbia" msgstr "СеÑбиÑ" #: ../src/country.c:74 msgid "Jordan" msgstr "ÐоÑданиÑ" #: ../src/country.c:75 msgid "Croatia" msgstr "ХоÑваÑиÑ" #: ../src/country.c:76 msgid "Slovenia" msgstr "СловениÑ" #: ../src/country.c:77 msgid "Bosnia and Herzegovina" msgstr "ÐоÑÐ½Ð¸Ñ Ð¸ ÐеÑÑеговина" #: ../src/country.c:78 msgid "Macedonia" msgstr "ÐакедониÑ" #: ../src/country.c:79 msgid "Turkey" msgstr "ТÑÑÑиÑ" #: ../src/country.c:80 msgid "Monaco" msgstr "Ðонако" #: ../src/country.c:81 msgid "Azerbaijan" msgstr "ÐзеÑбайджан" #: ../src/country.c:82 msgid "Armenia" msgstr "ÐÑмениÑ" #: ../src/country.c:83 msgid "Faroe Islands" msgstr "ФаÑеÑÑкие ÐÑÑÑова" #: ../src/country.c:84 msgid "Western Sahara" msgstr "ÐÐ°Ð¿Ð°Ð´Ð½Ð°Ñ Ð¡Ð°Ñ Ð°Ñа" #: ../src/country.c:85 msgid "Svalbard and Jan Mayen" msgstr "СвалÑбаÑд и Ян Ðайен" #: ../src/gui/gtk/destination.c:96 ../src/gui/gtk/destination.c:97 #: ../src/gui/gtk/destination.c:98 ../src/gui/gtk/destination.c:99 msgid "Car" msgstr "ÐвÑо" #: ../src/gui/gtk/destination.c:96 msgid "Iso2" msgstr "" #: ../src/gui/gtk/destination.c:96 msgid "Iso3" msgstr "" #: ../src/gui/gtk/destination.c:96 ../src/gui/gtk/destination.c:334 msgid "Country" msgstr "СÑÑана" #: ../src/gui/gtk/destination.c:97 ../src/gui/gtk/destination.c:98 #: ../src/gui/gtk/destination.c:99 msgid "Postal" msgstr "ÐндекÑ" #: ../src/gui/gtk/destination.c:97 ../src/gui/gtk/destination.c:98 #: ../src/gui/gtk/destination.c:99 msgid "Town" msgstr "ÐоÑод" #: ../src/gui/gtk/destination.c:97 ../src/gui/gtk/destination.c:98 #: ../src/gui/gtk/destination.c:99 msgid "District" msgstr "Район" #: ../src/gui/gtk/destination.c:98 ../src/gui/gtk/destination.c:99 #: ../src/gui/gtk/destination.c:343 msgid "Street" msgstr "УлиÑа" #: ../src/gui/gtk/destination.c:99 ../src/gui/gtk/destination.c:345 msgid "Number" msgstr "ÐомеÑ" #: ../src/gui/gtk/destination.c:329 msgid "Enter Destination" msgstr "ÐведиÑе пÑÐ½ÐºÑ Ð½Ð°Ð·Ð½Ð°ÑениÑ" #: ../src/gui/gtk/destination.c:336 msgid "Zip Code" msgstr "ÐндекÑ" #: ../src/gui/gtk/destination.c:338 msgid "City" msgstr "ÐоÑод" #: ../src/gui/gtk/destination.c:340 msgid "District/Township" msgstr "Район" #: ../src/gui/gtk/destination.c:369 msgid "Bookmark" msgstr "Ðакладка" #: ../src/gui/gtk/destination.c:370 ../src/gui/gtk/gui_gtk_action.c:208 msgid "Destination" msgstr "ÐÑÐ½ÐºÑ Ð½Ð°Ð·Ð½Ð°ÑениÑ" #: ../src/gui/gtk/gui_gtk_action.c:195 msgid "Display" msgstr "ÐиÑплей" #: ../src/gui/gtk/gui_gtk_action.c:199 msgid "ZoomOut" msgstr "УменÑÑиÑÑ" #: ../src/gui/gtk/gui_gtk_action.c:200 msgid "ZoomIn" msgstr "УвелиÑиÑÑ" #: ../src/gui/gtk/gui_gtk_action.c:201 msgid "Refresh" msgstr "ÐбновиÑÑ" #: ../src/gui/gtk/gui_gtk_action.c:204 ../src/gui/gtk/gui_gtk_action.c:206 msgid "Info" msgstr "ÐнÑоÑмаÑиÑ" #: ../src/gui/gtk/gui_gtk_action.c:209 msgid "Clear" msgstr "ÐÑиÑÑиÑÑ" #: ../src/gui/gtk/gui_gtk_action.c:210 msgid "Test" msgstr "ТеÑÑ" #: ../src/gui/gtk/gui_gtk_action.c:211 msgid "_Quit" msgstr "_ÐÑÑ Ð¾Ð´" #: ../src/gui/gtk/gui_gtk_action.c:218 msgid "Cursor" msgstr "ÐÑÑÑоÑ" #: ../src/gui/gtk/gui_gtk_action.c:219 msgid "Tracking" msgstr "Слежение" #: ../src/gui/gtk/gui_gtk_action.c:220 msgid "Orientation" msgstr "ÐÑиенÑаÑиÑ" #: ../src/gui/gtk/gui_gtk_action.c:222 ../src/gui/gtk/gui_gtk_action.c:224 msgid "Fullscreen" msgstr "Ðо веÑÑ ÑкÑан" #: ../src/gui/gtk/gui_gtk_action.c:232 msgid "Data" msgstr "ÐаннÑе" #: ../src/gui/gtk/gui_gtk_action.c:233 msgid "VisibleBlocks" msgstr "" #: ../src/gui/gtk/gui_gtk_action.c:234 msgid "VisibleTowns" msgstr "" #: ../src/gui/gtk/gui_gtk_action.c:235 msgid "VisiblePolys" msgstr "" #: ../src/gui/gtk/gui_gtk_action.c:236 msgid "VisibleStreets" msgstr "" #: ../src/gui/gtk/gui_gtk_action.c:237 msgid "VisiblePoints" msgstr "" #: ../src/gui/gtk/gui_gtk_statusbar.c:48 ../src/gui/gtk/gui_gtk_statusbar.c:83 msgid "N" msgstr "" #: ../src/gui/gtk/gui_gtk_statusbar.c:48 ../src/gui/gtk/gui_gtk_statusbar.c:83 msgid "NE" msgstr "" #: ../src/gui/gtk/gui_gtk_statusbar.c:48 ../src/gui/gtk/gui_gtk_statusbar.c:83 msgid "E" msgstr "" #: ../src/gui/gtk/gui_gtk_statusbar.c:48 ../src/gui/gtk/gui_gtk_statusbar.c:83 msgid "SE" msgstr "" #: ../src/gui/gtk/gui_gtk_statusbar.c:48 ../src/gui/gtk/gui_gtk_statusbar.c:83 msgid "S" msgstr "" #: ../src/gui/gtk/gui_gtk_statusbar.c:48 ../src/gui/gtk/gui_gtk_statusbar.c:83 msgid "SW" msgstr "" #: ../src/gui/gtk/gui_gtk_statusbar.c:48 ../src/gui/gtk/gui_gtk_statusbar.c:83 msgid "W" msgstr "" #: ../src/gui/gtk/gui_gtk_statusbar.c:48 ../src/gui/gtk/gui_gtk_statusbar.c:83 msgid "NW" msgstr "" #: ../src/gui/gtk/gui_gtk_statusbar.c:105 #, c-format msgid "Route %4.0fkm %02d:%02d ETA" msgstr "ÐаÑÑÑÑÑ %4.0fкм %02d:%02d Ð ÐÐ" #: ../src/gui/gtk/gui_gtk_statusbar.c:156 msgid "Route 0000km 0+00:00 ETA" msgstr "ÐаÑÑÑÑÑ 0000км 0+00:00 Ð ÐÐ" |
From: Alex L. M. <haw...@us...> - 2008-01-29 22:12:24
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28329/src Modified Files: osm2navit.c Log Message: * Add rendering of riverbank (as line) * sport=golf is not always a golf course, it can also be other things related to golf, such as a driving range or shop. Index: osm2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/osm2navit.c,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** osm2navit.c 29 Jan 2008 21:23:57 -0000 1.47 --- osm2navit.c 29 Jan 2008 22:12:27 -0000 1.48 *************** *** 64,67 **** --- 64,68 ---- "n leisure slipway poi_boat_ramp\n" "n leisure fishing poi_fish\n" + "n sport golf poi_golf\n" "n leisure golf_course poi_golf\n" "n leisure marina poi_marine\n" *************** *** 89,93 **** "n military range poi_military\n" "n military danger_area poi_danger_area\n" - "n sport golf poi_golf\n" "n sport swimming poi_swimming\n" "n sport skiing poi_skiing\n" --- 90,93 ---- *************** *** 150,154 **** "w railway subway rail\n" "w railway tram rail\n" ! "w sport golf poly_golf_course\n" "w waterway canal water_line\n" "w waterway river water_line\n" --- 150,154 ---- "w railway subway rail\n" "w railway tram rail\n" ! "w leisure golf_course poly_golf_course\n" "w waterway canal water_line\n" "w waterway river water_line\n" *************** *** 156,159 **** --- 156,160 ---- "w waterway stream water_line\n" "w waterway drain water_line\n" + "w waterway riverbank water_line\n" "w boundary administrative border_country\n" "w route ferry ferry\n" |
From: Martin S. <mar...@us...> - 2008-01-29 21:59:35
|
Update of /cvsroot/navit/navit/src/script In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23292 Modified Files: mapExtract.class.php map_index.php Added Files: download_index.html Log Message: Fix:Scripts:Fixed a bug/added download interface Index: map_index.php =================================================================== RCS file: /cvsroot/navit/navit/src/script/map_index.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** map_index.php 10 Dec 2007 13:28:48 -0000 1.1 --- map_index.php 29 Jan 2008 21:59:39 -0000 1.2 *************** *** 1,4 **** ! <code><span style="color: #000000"> ! <span style="color: #0000BB"><?php<br /> set_time_limit</span><span style="color: #007700">(</span><span style="color: #0000BB">600</span><span style="color: #007700">);<br /> require_once(</span><span style="color: #DD0000">"mapExtract.class.php"</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">$bbox</span><span style="color: #007700">=</span><span style="color: #0000BB">split</span><span style="color: #007700">(</span><span style="color: #DD0000">','</span><span style="color: #007700">,</span><span style="color: #0000BB">$HTTP_GET_VARS</span><span style="color: #007700">[</span><span style="color: #DD0000">'bbox'</span><span style="color: #007700">]);<br /> if (</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">$bbox</span><span style="color: #007700">) == </span><span style="color: #0000BB">4</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">$mapextract </span><span style="color: #007700">= new </span><span style="color: #0000BB">mapExtract</span><span style="color: #007700">();<br /> </span><span style="color: #0000BB">$mapextract</span><span style="color: #007700">-></span><span style="color: #0000BB">setBbox</span><span style="color: #007700">(</span><span style="color: #0000BB">$bbox</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">], </span><span style="color: #0000BB">$bbox</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">], </span><span style="color: #0000BB">$bbox</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">], </span><span style="color: #0000BB">$bbox</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">]); <br /> </span><span style="color: #0000BB">$fp</span><span style="color: #007700">=</span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">'php://output'</span><span style="color: #007700">,</span><span style="color: #DD0000">'w'</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">$mapextract</span><span style="color: #007700">-></span><span style="color: #0000BB">setInput</span><span style="color: #007700">(</span><span style="color: #DD0000">'../../planet.bin'</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">$mapextract</span><span style="color: #007700">-></span><span style="color: #0000BB">setOutputFD</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-Type: application/octet-stream'</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">$error</span><span style="color: #007700">=</span><span style="color: #0000BB">$mapextract</span><span style="color: #007700">-></span><span style="color: #0000BB">process</span><span style="color: #007700">();<br /> if (</span><span style="color: #0000BB">$error</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-Type: text/plain'</span><span style="color: #007700">);<br /> echo </span><span style="color: #0000BB">$error</span><span style="color: #007700">;<br /> }<br /> </span><span style="color: #0000BB">fclose</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /> } else {<br /> </span><span style="color: #FF8000">#echo "<pre>";<br /> #print_r($HTTP_HOST);<br /> #echo "</pre>";<br /> </span><span style="color: #0000BB">$areas</span><span style="color: #007700">=array(<br /> </span><span style="color: #DD0000">'Germany' </span><span style="color: #007700">=> </span><span style="color: #DD0000">'5,47,16,55.1'</span><span style="color: #007700">,<br /> );<br /> </span><span style="color: #0000BB">$url</span><span style="color: #007700">=</span><span style="color: #DD0000">'http://' </span><span style="color: #007700">. </span><span style="color: #0000BB">$HTTP_HOST </span><span style="color: #007700">. </span><span style="color: #0000BB">$PHP_SELF</span><span style="color: #007700">;<br /> echo </span><span style="color: #DD0000">"Use: $url?bbox=bllon,bllat,trlon,trlat <br />\n"</span><span style="color: #007700">;<br /> echo </span><span style="color: #DD0000">"<br />\n"</span><span style="color: #007700">;<br /> while (list(</span><span style="color: #0000BB">$area</span><span style="color: #007700">,</span><span style="color: #0000BB">$bbox</span><span style="color: #007700">)=</span><span style="color: #0000BB">each</span><span style="color: #007700">(</span><span style="color: #0000BB">$areas</span><span style="color: #007700">)) {<br /> </span><span style="color: #0000BB">$urlf</span><span style="color: #007700">=</span><span style="color: #0000BB">$url </span><span style="color: #007700">. </span><span style="color: #DD0000">"?bbox=$bbox"</span><span style="color: #007700">;<br /> echo </span><span style="color: #DD0000">"$area <a href='$urlf'>$urlf</a><br />\n"</span><span style="color: #007700">;<br /> }<br /> <br /> }<br /></span><span style="color: #0000BB">?><br /></span> ! </span> ! </code> \ No newline at end of file --- 1,42 ---- ! <?php ! set_time_limit(600); ! require_once("mapExtract.class.php"); ! $bbox=split(',',urldecode($HTTP_GET_VARS['bbox'])); ! if (count($bbox) == 4) { ! $mapextract = new mapExtract(); ! $mapextract->setBbox($bbox[0], $bbox[1], $bbox[2], $bbox[3]); ! $fp=fopen('php://output','w'); ! $mapextract->setInput('../../planet.bin'); ! $mapextract->setOutputFD($fp); ! if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')) ! header('Content-Type: application/force-download'); ! else ! header('Content-Type: application/octet-stream'); ! $name='osm_bbox_'; ! $name.=round($bbox[0],1) . ',' . round($bbox[1],1) . ','; ! $name.=round($bbox[2],1) . ',' . round($bbox[3],1); ! $name.='.bin'; ! header("Content-disposition: attachment; filename=\"$name\""); ! $error=$mapextract->process(); ! if ($error) { ! header('Content-Type: text/plain'); ! echo $error; ! } ! fclose($fp); ! } else { ! #echo "<pre>"; ! #print_r($HTTP_HOST); ! #echo "</pre>"; ! $areas=array( ! 'Germany' => '5,47,16,55.1', ! ); ! $url='http://' . $HTTP_HOST . $PHP_SELF; ! echo "Use: $url?bbox=bllon,bllat,trlon,trlat <br />\n"; ! echo "<br />\n"; ! while (list($area,$bbox)=each($areas)) { ! $urlf=$url . "?bbox=$bbox"; ! echo "$area <a href='$urlf'>$urlf</a><br />\n"; ! } ! ! } ! ?> Index: mapExtract.class.php =================================================================== RCS file: /cvsroot/navit/navit/src/script/mapExtract.class.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mapExtract.class.php 10 Dec 2007 13:28:48 -0000 1.1 --- mapExtract.class.php 29 Jan 2008 21:59:39 -0000 1.2 *************** *** 1,4 **** ! <code><span style="color: #000000"> ! <span style="color: #0000BB"><?php<br /><br /></span><span style="color: #007700">class </span><span style="color: #0000BB">mapExtract </span><span style="color: #007700">{<br /> <br /> var </span><span style="color: #0000BB">$input_fd</span><span style="color: #007700">;<br /> var </span><span style="color: #0000BB">$output_fd</span><span style="color: #007700">;<br /> var </span><span style="color: #0000BB">$fetchBbox</span><span style="color: #007700">;<br /> <br /> var </span><span style="color: #0000BB">$formats</span><span style="color: #007700">;<br /> var </span><span style="color: #0000BB">$worldBbox</span><span style="color: #007700">;<br /> <br /> function </span><span style="color: #0000BB">mapExtract</span><span style="color: #007700">() {<br /> </span><span style="color: #0000BB">$formats </span><span style="color: #007700">= array();<br /> <br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'ziphpack'</span><span style="color: #007700">] = </span><span style="color: #DD0000">"lssssslLLSS"</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipheader'</span><span style="color: #007700">] = </span><span style="color: #DD0000">"l" </span><span style="color: #007700">. </span><span style="color: #DD0000">"ziplocsig"</span><span style="color: #007700">; </span><span style="color: #FF8000"># Signature (is always the same)<br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipheader'</span><span style="color: #007700">] .= </span><span style="color: #DD0000">"/s" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipver"</span><span style="color: #007700">; </span><span style="color: #FF8000"># zip version needed<br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipheader'</span><span style="color: #007700">] .= </span><span style="color: #DD0000">"/s" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipgenfld"</span><span style="color: #007700">;</span><span style="color: #FF8000"># type of os that generated the file<br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipheader'</span><span style="color: #007700">] .= </span><span style="color: #DD0000">"/s" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipmthd"</span><span style="color: #007700">; </span><span style="color: #FF8000"># <br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipheader'</span><span style="color: #007700">] .= </span><span style="color: #DD0000">"/s" </span><span style="color: #007700">. </span><span style="color: #DD0000">"ziptime"</span><span style="color: #007700">; </span><span style="color: #FF8000"># time<br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipheader'</span><span style="color: #007700">] .= </span><span style="color: #DD0000">"/s" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipdate"</span><span style="color: #007700">; </span><span style="color: #FF8000"># date<br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipheader'</span><span style="color: #007700">] .= </span><span style="color: #DD0000">"/l" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipcrc"</span><span style="color: #007700">; </span><span style="color: #FF8000"># crc checksum<br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipheader'</span><span style="color: #007700">] .= </span><span style="color: #DD0000">"/L" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipsize"</span><span style="color: #007700">; </span><span style="color: #FF8000"># data size<br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipheader'</span><span style="color: #007700">] .= </span><span style="color: #DD0000">"/L" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipuncmp"</span><span style="color: #007700">; </span><span style="color: #FF8000"># uncompressed size<br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipheader'</span><span style="color: #007700">] .= </span><span style="color: #DD0000">"/S" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipfnln"</span><span style="color: #007700">; </span><span style="color: #FF8000"># length of filename<br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipheader'</span><span style="color: #007700">] .= </span><span style="color: #DD0000">"/S" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipxtraln"</span><span style="color: #007700">;</span><span style="color: #FF8000"># length of extra data (always 0)<br /> <br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipcdpack'</span><span style="color: #007700">] = </span><span style="color: #DD0000">"iccccssssiIISSSSSII"</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipcd'</span><span style="color: #007700">] = </span><span style="color: #DD0000">""</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"i" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipcensig/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"c" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipcver/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"c" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipcos/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"c" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipcvxt/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"c" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipcexos/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"s" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipcflg/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"s" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipcmthd/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"s" </span><span style="color: #007700">. </span><span style="color: #DD0000">"ziptim/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"s" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipdat/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"i" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipccrc/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"I" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipcsiz/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"I" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipcunc/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"S" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipcfnl/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"S" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipcxtl/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"S" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipccml/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"S" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipdsk/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"S" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipint/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"I" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipext/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"I" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipofst"</span><span style="color: #007700">;<br /> <br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipeocpack'</span><span style="color: #007700">] = </span><span style="color: #DD0000">"iSSSSIIs"</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipeoc'</span><span style="color: #007700">] = </span><span style="color: #DD0000">""</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"i" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipesig/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"S" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipedsk/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"S" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipecen/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"S" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipenum/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"S" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipecenn/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"I" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipecsz/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"I" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipeofst/"</span><span style="color: #007700">.<br /> </span><span style="color: #DD0000">"s" </span><span style="color: #007700">. </span><span style="color: #DD0000">"zipecoml/"</span><span style="color: #007700">.<br /> <br /> </span><span style="color: #0000BB">$world_bbox </span><span style="color: #007700">= array();<br /> </span><span style="color: #0000BB">$world_bbox</span><span style="color: #007700">[</span><span style="color: #DD0000">'l'</span><span style="color: #007700">][</span><span style="color: #DD0000">'x'</span><span style="color: #007700">] = -</span><span style="color: #0000BB">20000000</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$world_bbox</span><span style="color: #007700">[</span><span style="color: #DD0000">'l'</span><span style="color: #007700">][</span><span style="color: #DD0000">'y'</span><span style="color: #007700">] = -</span><span style="color: #0000BB">20000000</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$world_bbox</span><span style="color: #007700">[</span><span style="color: #DD0000">'h'</span><span style="color: #007700">][</span><span style="color: #DD0000">'x'</span><span style="color: #007700">] = </span><span style="color: #0000BB">20000000</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$world_bbox</span><span style="color: #007700">[</span><span style="color: #DD0000">'h'</span><span style="color: #007700">][</span><span style="color: #DD0000">'y'</span><span style="color: #007700">] = </span><span style="color: #0000BB">20000000</span><span style="color: #007700">;<br /> <br /> </span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">formats </span><span style="color: #007700">= </span><span style="color: #0000BB">$formats</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">worldBbox </span><span style="color: #007700">= </span><span style="color: #0000BB">$world_bbox</span><span style="color: #007700">;<br /> }<br /> <br /> <br /> function </span><span style="color: #0000BB">process</span><span style="color: #007700">() {<br /> <br /> if (!</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">fetchBbox</span><span style="color: #007700">)) {<br /> return </span><span style="color: #DD0000">"Fetch box not set"</span><span style="color: #007700">;<br /> }<br /> </span><span style="color: #FF8000">#<br /> </span><span style="color: #007700">if (!</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">input_fd</span><span style="color: #007700">) {<br /> return </span><span style="color: #DD0000">"No useable input set"</span><span style="color: #007700">;<br /> }<br /> if (!</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">output_fd</span><span style="color: #007700">) {<br /> return </span><span style="color: #DD0000">"No useable output set"</span><span style="color: #007700">;<br /> }<br /> </span><span style="color: #0000BB">$filecount </span><span style="color: #007700">= </span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$offset </span><span style="color: #007700">= </span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$zipcd_data </span><span style="color: #007700">= </span><span style="color: #DD0000">''</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$report </span><span style="color: #007700">= array();<br /> <br /> </span><span style="color: #FF8000">/**<br /> * Read through zipheaders<br /> * <br /> */<br /> </span><span style="color: #007700">for(;;) {<br /> </span><span style="color: #0000BB">$buffer </span><span style="color: #007700">= </span><span style="color: #0000BB">fread</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">input_fd</span><span style="color: #007700">, </span><span style="color: #0000BB">30</span><span style="color: #007700">);<br /> if (! </span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">$buffer</span><span style="color: #007700">))<br /> break;<br /> </span><span style="color: #0000BB">$tileinfo </span><span style="color: #007700">= </span><span style="color: #0000BB">unpack</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipheader'</span><span style="color: #007700">], </span><span style="color: #0000BB">$buffer</span><span style="color: #007700">);<br /> <br /> if (</span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipfnln'</span><span style="color: #007700">] <= </span><span style="color: #0000BB">0</span><span style="color: #007700">)<br /> break;<br /> <br /> </span><span style="color: #0000BB">$filename </span><span style="color: #007700">= </span><span style="color: #0000BB">fread</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">input_fd</span><span style="color: #007700">, </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipfnln'</span><span style="color: #007700">]);<br /> </span><span style="color: #0000BB">$done</span><span style="color: #007700">=</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /> <br /> </span><span style="color: #0000BB">$r </span><span style="color: #007700">= </span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">worldBbox</span><span style="color: #007700">;<br /> <br /> </span><span style="color: #0000BB">$len</span><span style="color: #007700">=</span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">$filename</span><span style="color: #007700">); <br /> for (</span><span style="color: #0000BB">$i</span><span style="color: #007700">=</span><span style="color: #0000BB">0 </span><span style="color: #007700">; </span><span style="color: #0000BB">$i </span><span style="color: #007700">< </span><span style="color: #0000BB">$len </span><span style="color: #007700">; </span><span style="color: #0000BB">$i</span><span style="color: #007700">++) {<br /> </span><span style="color: #0000BB">$c</span><span style="color: #007700">[</span><span style="color: #DD0000">'x'</span><span style="color: #007700">] = </span><span style="color: #0000BB">floor</span><span style="color: #007700">( (</span><span style="color: #0000BB">$r</span><span style="color: #007700">[</span><span style="color: #DD0000">'l'</span><span style="color: #007700">][</span><span style="color: #DD0000">'x'</span><span style="color: #007700">] + </span><span style="color: #0000BB">$r</span><span style="color: #007700">[</span><span style="color: #DD0000">'h'</span><span style="color: #007700">][</span><span style="color: #DD0000">'x'</span><span style="color: #007700">])/</span><span style="color: #0000BB">2 </span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">$c</span><span style="color: #007700">[</span><span style="color: #DD0000">'y'</span><span style="color: #007700">] = </span><span style="color: #0000BB">floor</span><span style="color: #007700">( (</span><span style="color: #0000BB">$r</span><span style="color: #007700">[</span><span style="color: #DD0000">'l'</span><span style="color: #007700">][</span><span style="color: #DD0000">'y'</span><span style="color: #007700">] + </span><span style="color: #0000BB">$r</span><span style="color: #007700">[</span><span style="color: #DD0000">'h'</span><span style="color: #007700">][</span><span style="color: #DD0000">'y'</span><span style="color: #007700">])/</span><span style="color: #0000BB">2 </span><span style="color: #007700">);<br /> <br /> switch(</span><span style="color: #0000BB">$filename</span><span style="color: #007700">[</span><span style="color: #0000BB">$i</span><span style="color: #007700">]) {<br /> case </span><span style="color: #DD0000">'a'</span><span style="color: #007700">:<br /> </span><span style="color: #0000BB">$r</span><span style="color: #007700">[</span><span style="color: #DD0000">'l'</span><span style="color: #007700">][</span><span style="color: #DD0000">'x'</span><span style="color: #007700">] = </span><span style="color: #0000BB">$c</span><span style="color: #007700">[</span><span style="color: #DD0000">'x'</span><span style="color: #007700">];<br /> </span><span style="color: #0000BB">$r</span><span style="color: #007700">[</span><span style="color: #DD0000">'l'</span><span style="color: #007700">][</span><span style="color: #DD0000">'y'</span><span style="color: #007700">] = </span><span style="color: #0000BB">$c</span><span style="color: #007700">[</span><span style="color: #DD0000">'y'</span><span style="color: #007700">];<br /> break;<br /> case </span><span style="color: #DD0000">'b'</span><span style="color: #007700">:<br /> </span><span style="color: #0000BB">$r</span><span style="color: #007700">[</span><span style="color: #DD0000">'h'</span><span style="color: #007700">][</span><span style="color: #DD0000">'x'</span><span style="color: #007700">] = </span><span style="color: #0000BB">$c</span><span style="color: #007700">[</span><span style="color: #DD0000">'x'</span><span style="color: #007700">];<br /> </span><span style="color: #0000BB">$r</span><span style="color: #007700">[</span><span style="color: #DD0000">'l'</span><span style="color: #007700">][</span><span style="color: #DD0000">'y'</span><span style="color: #007700">] = </span><span style="color: #0000BB">$c</span><span style="color: #007700">[</span><span style="color: #DD0000">'y'</span><span style="color: #007700">];<br /> break;<br /> case </span><span style="color: #DD0000">'c'</span><span style="color: #007700">:<br /> </span><span style="color: #0000BB">$r</span><span style="color: #007700">[</span><span style="color: #DD0000">'l'</span><span style="color: #007700">][</span><span style="color: #DD0000">'x'</span><span style="color: #007700">] = </span><span style="color: #0000BB">$c</span><span style="color: #007700">[</span><span style="color: #DD0000">'x'</span><span style="color: #007700">];<br /> </span><span style="color: #0000BB">$r</span><span style="color: #007700">[</span><span style="color: #DD0000">'h'</span><span style="color: #007700">][</span><span style="color: #DD0000">'y'</span><span style="color: #007700">] = </span><span style="color: #0000BB">$c</span><span style="color: #007700">[</span><span style="color: #DD0000">'y'</span><span style="color: #007700">];<br /> break;<br /> case </span><span style="color: #DD0000">'d'</span><span style="color: #007700">:<br /> </span><span style="color: #0000BB">$r</span><span style="color: #007700">[</span><span style="color: #DD0000">'h'</span><span style="color: #007700">][</span><span style="color: #DD0000">'x'</span><span style="color: #007700">] = </span><span style="color: #0000BB">$c</span><span style="color: #007700">[</span><span style="color: #DD0000">'x'</span><span style="color: #007700">];<br /> </span><span style="color: #0000BB">$r</span><span style="color: #007700">[</span><span style="color: #DD0000">'h'</span><span style="color: #007700">][</span><span style="color: #DD0000">'y'</span><span style="color: #007700">] = </span><span style="color: #0000BB">$c</span><span style="color: #007700">[</span><span style="color: #DD0000">'y'</span><span style="color: #007700">];<br /> break;<br /> default:<br /> </span><span style="color: #0000BB">$done</span><span style="color: #007700">=</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br /> }<br /> if (</span><span style="color: #0000BB">$done</span><span style="color: #007700">)<br /> break;<br /> }<br /> </span><span style="color: #FF8000"># print "zipsize=" . $tileinfo['zipsize']; <br /> </span><span style="color: #0000BB">$tilecontent </span><span style="color: #007700">= </span><span style="color: #0000BB">fread</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">input_fd</span><span style="color: #007700">, </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipsize'</span><span style="color: #007700">]);<br /> <br /> </span><span style="color: #FF8000"># print "tile $filename"; <br /> /* Area inside box, save it! */<br /> </span><span style="color: #007700">if (</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">contains_bbox</span><span style="color: #007700">(</span><span style="color: #0000BB">$r</span><span style="color: #007700">)) {<br /> </span><span style="color: #0000BB">$report</span><span style="color: #007700">[</span><span style="color: #DD0000">'added_areas'</span><span style="color: #007700">]++;<br /> <br /> </span><span style="color: #0000BB">$zipheader </span><span style="color: #007700">= </span><span style="color: #0000BB">$buffer</span><span style="color: #007700">;<br /> </span><span style="color: #FF8000"># print " in\n";<br /> <br /> /* Area outside of box, set zipcontent=0 */<br /> </span><span style="color: #007700">} else {<br /> </span><span style="color: #FF8000"># print " out\n";<br /> </span><span style="color: #0000BB">$report</span><span style="color: #007700">[</span><span style="color: #DD0000">'excluded_areas'</span><span style="color: #007700">]++;<br /> <br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipmthd'</span><span style="color: #007700">] = </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipcrc'</span><span style="color: #007700">] = </span><span style="color: #0000BB">$tileinfo<br /></span><span style="color: #007700">[</span><span style="color: #DD0000">'zipsize'</span><span style="color: #007700">] = </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipuncmp'</span><span style="color: #007700">] = </span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$zipheader </span><span style="color: #007700">= </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$tilecontent </span><span style="color: #007700">= </span><span style="color: #DD0000">''</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">$zipheader </span><span style="color: #007700">= </span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'ziphpack'</span><span style="color: #007700">], <br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'ziplocsig'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipver'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipgenfld'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipmthd'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'ziptime'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipdate'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipcrc'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipsize'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipuncmp'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipfnln'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipxtraln'</span><span style="color: #007700">]<br /> );<br /> }<br /> <br /> </span><span style="color: #0000BB">$put </span><span style="color: #007700">= </span><span style="color: #0000BB">$zipheader</span><span style="color: #007700">.</span><span style="color: #0000BB">$filename</span><span style="color: #007700">.</span><span style="color: #0000BB">$tilecontent</span><span style="color: #007700">;<br /> <br /> </span><span style="color: #FF8000">/* Zip directory */<br /> </span><span style="color: #0000BB">$zipcd_data </span><span style="color: #007700">.= </span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipcdpack'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">0x02014b50</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipver'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">0x00</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">0x0a</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">0x00</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">0x00</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipmthd'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'ziptime'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipdate'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipcrc'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipsize'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipuncmp'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">$tileinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipfnln'</span><span style="color: #007700">],<br /> </span><span style="color: #0000BB">0x00</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">0x00</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">0x00</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">0x00</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">0x00</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">$offset<br /> </span><span style="color: #007700">) . </span><span style="color: #0000BB">$filename</span><span style="color: #007700">;<br /> <br /> </span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">output_fd</span><span style="color: #007700">, </span><span style="color: #0000BB">$put</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">$offset </span><span style="color: #007700">+= </span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">$put</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">$filecount </span><span style="color: #007700">+= </span><span style="color: #0000BB">1</span><span style="color: #007700">;<br /> }<br /> <br /> </span><span style="color: #0000BB">fwrite</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">output_fd</span><span style="color: #007700">, </span><span style="color: #0000BB">$zipcd_data</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">$ecsz </span><span style="color: #007700">= </span><span style="color: #0000BB">strlen</span><span style="color: #007700">(</span><span style="color: #0000BB">$zipcd_data</span><span style="color: #007700">);<br /> <br /> </span><span style="color: #FF8000">/* Zip central directory */<br /> </span><span style="color: #0000BB">$zip_eoc </span><span style="color: #007700">= </span><span style="color: #0000BB">pack</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-></span><span style="color: #0000BB">formats</span><span style="color: #007700">[</span><span style="color: #DD0000">'zipeocpack'</span><span style="color: #007700">], <br /> ... [truncated message content] |
From: Martin S. <mar...@us...> - 2008-01-29 21:46:33
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17901 Modified Files: navit.xml Log Message: Fix:Core:Render street_service Index: navit.xml =================================================================== RCS file: /cvsroot/navit/navit/src/navit.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** navit.xml 28 Jan 2008 08:13:41 -0000 1.32 --- navit.xml 29 Jan 2008 21:46:34 -0000 1.33 *************** *** 168,171 **** --- 168,204 ---- <polyline color="#000000" width="1" /> </item> + <item type="street_service" order="11"> + <polyline color="#d2d2d2" width="4" /> + <polyline color="#fefefe" width="2" /> + </item> + <item type="street_service" order="12"> + <polyline color="#d2d2d2" width="5" /> + <polyline color="#fefefe" width="3" /> + </item> + <item type="street_service" order="13"> + <polyline color="#d2d2d2" width="6" /> + <polyline color="#fefefe" width="4" /> + </item> + <item type="street_service" order="14"> + <polyline color="#d2d2d2" width="7" /> + <polyline color="#fefefe" width="5" /> + </item> + <item type="street_service" order="15"> + <polyline color="#d2d2d2" width="8" /> + <polyline color="#fefefe" width="6" /> + </item> + <item type="street_service" order="16"> + <polyline color="#d2d2d2" width="9" /> + <polyline color="#fefefe" width="7" /> + </item> + <item type="street_service" order="17"> + <polyline color="#d2d2d2" width="10" /> + <polyline color="#fefefe" width="8" /> + </item> + <item type="street_service" order="18"> + <polyline color="#d2d2d2" width="11" /> + <polyline color="#fefefe" width="9" /> + </item> + <item type="street_0,street_1_city,street_1_land" order="10"> <polyline color="#d2d2d2" width="4" /> |
From: Martin S. <mar...@us...> - 2008-01-29 21:23:56
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8454 Modified Files: osm2navit.c Log Message: Fix:Tools:Added fix for buildings Index: osm2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/osm2navit.c,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** osm2navit.c 29 Jan 2008 10:05:38 -0000 1.46 --- osm2navit.c 29 Jan 2008 21:23:57 -0000 1.47 *************** *** 105,108 **** --- 105,109 ---- "w amenity place_of_worship poly_building\n" "w building glasshouse poly_building\n" + "w building 1 poly_building\n" "w building\n" "w aeroway apron poly_apron\n" *************** *** 115,119 **** "w highway cyclepath street_nopass\n" "w highway track street_nopass\n" ! "w highway service street_nopass\n" "w highway pedestrian street_nopass\n" "w highway residential street_1_city\n" --- 116,120 ---- "w highway cyclepath street_nopass\n" "w highway track street_nopass\n" ! "w highway service street_service\n" "w highway pedestrian street_nopass\n" "w highway residential street_1_city\n" *************** *** 349,354 **** if (! strcmp(k,"layer")) level=7; if (! strcmp(k,"oneway")) { ! if (! strcasecmp(v,"true") || !strcasecmp(v,"yes") || !strcmp(v,"1")) { flags_attr_value=AF_ONEWAY; flags_attr.len=2; --- 350,357 ---- if (! strcmp(k,"layer")) level=7; + if (! strcasecmp(v,"true") || ! strcasecmp(v,"yes")) + v="1"; if (! strcmp(k,"oneway")) { ! if (!strcmp(v,"1")) { flags_attr_value=AF_ONEWAY; flags_attr.len=2; |
From: KaZeR <ka...@us...> - 2008-01-29 16:52:12
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26730 Modified Files: navit.c Log Message: Fix:Core:Navit exits with error message instead of segfaulting on destination dialog when no mapset is enabled (ticket #48) Index: navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/navit.c,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** navit.c 23 Jan 2008 20:18:42 -0000 1.76 --- navit.c 29 Jan 2008 16:52:14 -0000 1.77 *************** *** 113,117 **** navit_get_mapset(struct navit *this_) { ! return this_->mapsets->data; } --- 113,122 ---- navit_get_mapset(struct navit *this_) { ! if(this_->mapsets){ ! return this_->mapsets->data; ! } else { ! g_warning("No mapsets enabled! Is it on purpose? Navit can't draw a map. Please check your navit.xml\n"); ! } ! exit(-1); } |
From: Martin S. <mar...@us...> - 2008-01-29 10:05:37
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17371 Modified Files: osm2navit.c Log Message: Fix:Tools:Add key highway=minor Index: osm2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/osm2navit.c,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** osm2navit.c 28 Jan 2008 23:09:10 -0000 1.45 --- osm2navit.c 29 Jan 2008 10:05:38 -0000 1.46 *************** *** 119,122 **** --- 119,123 ---- "w highway residential street_1_city\n" "w highway unclassified street_1_city\n" + "w highway minor street_1_land\n" "w highway tertiary street_2_city\n" "w highway secondary street_3_city\n" |
From: Martin S. <mar...@us...> - 2008-01-28 23:09:08
|
Update of /cvsroot/navit/navit/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14648 Modified Files: osm2navit.c Log Message: Fix:Tools:Add switch to generate coverage for osm Index: osm2navit.c =================================================================== RCS file: /cvsroot/navit/navit/src/osm2navit.c,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** osm2navit.c 28 Jan 2008 08:13:41 -0000 1.44 --- osm2navit.c 28 Jan 2008 23:09:10 -0000 1.45 *************** *** 30,34 **** static int nodeid,wayid; static int report,phase; ! static int ignore_unkown = 0; static char *attrmap={ --- 30,34 ---- static int nodeid,wayid; static int report,phase; ! static int ignore_unkown = 0, coverage=0; static char *attrmap={ *************** *** 430,434 **** if ( (type != type_street_unkn ) && ( type != type_point_unkn ) ) { ! item.type=type; } else --- 430,437 ---- if ( (type != type_street_unkn ) && ( type != type_point_unkn ) ) { ! if (coverage && type >= type_street_nopass && type <= type_ramp) ! item.type=type_coverage; ! else ! item.type=type; } else *************** *** 1753,1756 **** --- 1756,1760 ---- fprintf(f,"-e (--end) : end at specified phase\n"); fprintf(f,"-k (--keep-tmpfiles) : do not delete tmp files after processing. useful to reuse them\n\n"); + fprintf(f,"-o (--coverage) : map every street to item overage\n"); fprintf(f,"-s (--start) : start at specified phase\n"); fprintf(f,"-i (--input-file) : specify the input file name (OSM), overrules default stdin\n"); *************** *** 1780,1783 **** --- 1784,1788 ---- {"attr-debug-level", 1, 0, 'a'}, {"compression-level", 1, 0, 'z'}, + {"coverage", 0, 0, 'o'}, {"dedupe-ways", 0, 0, 'w'}, {"end", 1, 0, 'e'}, *************** *** 1821,1824 **** --- 1826,1832 ---- keep_tmpfiles=1; break; + case 'o': + coverage=1; + break; case 's': start=atoi(optarg); |