profile/ivi/navit.git
12 years agoAdd:Build:Cmake-Options for OpenGLES and OpenGLES2
martin-s [Sun, 4 Mar 2012 08:48:50 +0000 (08:48 +0000)]
Add:Build:Cmake-Options for OpenGLES and OpenGLES2

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4960 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:graphics_opengl:Better integration of opengl and es
martin-s [Sat, 3 Mar 2012 23:18:45 +0000 (23:18 +0000)]
Fix:graphics_opengl:Better integration of opengl and es

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4959 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:graphics_opengl:Moved matrix initialization to correct place
martin-s [Sat, 3 Mar 2012 23:06:19 +0000 (23:06 +0000)]
Fix:graphics_opengl:Moved matrix initialization to correct place

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4958 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:Build:graphics_opengl cmake support
martin-s [Sat, 3 Mar 2012 19:35:19 +0000 (19:35 +0000)]
Fix:Build:graphics_opengl cmake support

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4957 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:Core:New function to get unique part of search results and possible next chars
martin-s [Sat, 3 Mar 2012 13:26:24 +0000 (13:26 +0000)]
Add:Core:New function to get unique part of search results and possible next chars

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4956 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:xpm:Title for icon example page
sleske [Wed, 29 Feb 2012 21:13:13 +0000 (21:13 +0000)]
Add:xpm:Title for icon example page

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4955 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Made all lists to use icon_xs sized icons.
mdankov [Tue, 28 Feb 2012 21:08:21 +0000 (21:08 +0000)]
Fix:gui_internal:Made all lists to use icon_xs sized icons.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4954 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:xpm:Ensure a black background on Former Destination icon when converting svg...
korrosa [Mon, 27 Feb 2012 23:36:45 +0000 (23:36 +0000)]
Fix:xpm:Ensure a black background on Former Destination icon when converting svg to xpm/png

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4953 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_internal:Show icons in POI lists
mdankov [Sun, 26 Feb 2012 12:48:24 +0000 (12:48 +0000)]
Add:gui_internal:Show icons in POI lists

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4952 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_internal:Scroll vehicle profiles list
mdankov [Sun, 26 Feb 2012 09:33:27 +0000 (09:33 +0000)]
Add:gui_internal:Scroll vehicle profiles list

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4951 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_internal:Allow scrolling of Display Layout screen
mdankov [Sun, 26 Feb 2012 08:37:37 +0000 (08:37 +0000)]
Add:gui_internal:Allow scrolling of Display Layout screen

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4950 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_internal:Scroll/page Map Point and Map Settings screens
mdankov [Sun, 26 Feb 2012 08:26:38 +0000 (08:26 +0000)]
Add:gui_internal:Scroll/page Map Point and Map Settings screens

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4949 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Clean up unused variables.
mdankov [Sat, 25 Feb 2012 22:52:26 +0000 (22:52 +0000)]
Fix:gui_internal:Clean up unused variables.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4948 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Guard against accidental scrolling when user is likely going to...
mdankov [Sat, 25 Feb 2012 22:42:19 +0000 (22:42 +0000)]
Fix:gui_internal:Guard against accidental scrolling when user is likely going to swipe

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4947 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Do swiping to right side. Guard against accidental swiping or callin...
mdankov [Sat, 25 Feb 2012 22:35:11 +0000 (22:35 +0000)]
Fix:gui_internal:Do swiping to right side. Guard against accidental swiping or calling an item.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4946 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_internal:Paging of table widgets with gesture left-to-right and right-to...
mdankov [Thu, 23 Feb 2012 21:09:31 +0000 (21:09 +0000)]
Add:gui_internal:Paging of table widgets with gesture left-to-right and right-to-left.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4945 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix::Maptool:Adds in undeclared prototypes
geoghegan [Tue, 21 Feb 2012 13:35:54 +0000 (13:35 +0000)]
Fix::Maptool:Adds in undeclared prototypes

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4944 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix::Core:Adds in undeclared prototypes for navit_ref and navit_unref
geoghegan [Tue, 21 Feb 2012 13:18:27 +0000 (13:18 +0000)]
Fix::Core:Adds in undeclared prototypes for navit_ref and navit_unref

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4943 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:Vehicle: Adds in undeclared prototypes for vehicle_ref and vehicle_unref
geoghegan [Tue, 21 Feb 2012 13:10:09 +0000 (13:10 +0000)]
Fix:Vehicle: Adds in undeclared prototypes for vehicle_ref and vehicle_unref

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4942 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Fix bug when scrolling tables not having the paging buttons.
mdankov [Sun, 19 Feb 2012 19:32:57 +0000 (19:32 +0000)]
Fix:gui_internal:Fix bug when scrolling tables not having the paging buttons.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4941 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_internal:Made tables scrollable by dragging lines vertically
mdankov [Sat, 18 Feb 2012 22:57:08 +0000 (22:57 +0000)]
Add:gui_internal:Made tables scrollable by dragging lines vertically

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4940 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core: do not exposure the map text file headr stuff into navit.c
woglinde [Sat, 18 Feb 2012 20:38:25 +0000 (20:38 +0000)]
Fix:core: do not exposure the map text file headr stuff into navit.c

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4939 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:Fix executable flag for obj_filter.c
sleske [Sat, 18 Feb 2012 20:02:48 +0000 (20:02 +0000)]
Fix:core:Fix executable flag for obj_filter.c

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4938 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Main navit object now is destroyed by unref code. No need to do...
mdankov [Wed, 15 Feb 2012 17:35:12 +0000 (17:35 +0000)]
Fix:gui_internal:Main navit object now is destroyed by unref code. No need to do it twice. Fix crashing on quit on some platforms.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4937 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:Core:Correct typo "fotway" to "footway"|Thanks ThomasAH!
korrosa [Sat, 11 Feb 2012 23:03:49 +0000 (23:03 +0000)]
Fix:Core:Correct typo "fotway" to "footway"|Thanks ThomasAH!

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4936 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Resized gui_former_dests.svg to 48x48px as other images have these...
mdankov [Sat, 11 Feb 2012 21:43:42 +0000 (21:43 +0000)]
Fix:gui_internal:Resized gui_former_dests.svg to 48x48px as other images have these sizes. WinCE port seems to depend on that size.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4935 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Don't dive too deep into clicked point details in default configurat...
mdankov [Sat, 11 Feb 2012 20:54:32 +0000 (20:54 +0000)]
Fix:gui_internal:Don't dive too deep into clicked point details in default configuration. Fixes #962, #1010.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4934 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:Fix navit crashing when nonexistant vehicle type is specified in navit.xml.
mdankov [Sat, 11 Feb 2012 20:46:56 +0000 (20:46 +0000)]
Fix:core:Fix navit crashing when nonexistant vehicle type is specified in navit.xml.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4933 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoUpdate:i18n:Updated Spanish translation, based on trac #1012. Thanks Mikel Martinez.
sleske [Sat, 11 Feb 2012 20:36:09 +0000 (20:36 +0000)]
Update:i18n:Updated Spanish translation, based on trac #1012. Thanks Mikel Martinez.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4932 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Allow gui.menu() to be called from osd button without strange mouse...
mdankov [Sat, 11 Feb 2012 13:01:37 +0000 (13:01 +0000)]
Fix:gui_internal:Allow gui.menu() to be called from osd button without strange mouse behavior after leving menu.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4931 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:Fix reference to already freed object in displaylist->dc.transform. Was...
mdankov [Fri, 10 Feb 2012 22:51:55 +0000 (22:51 +0000)]
Fix:core:Fix reference to already freed object in displaylist->dc.transform. Was causing a crash when entering Map Point information if both menu_on_map_click is on and osd button firing gui.menu() is enabled.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4930 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:android:Made watches more flexible
martin-s [Mon, 6 Feb 2012 22:03:13 +0000 (22:03 +0000)]
Add:android:Made watches more flexible

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4929 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:map_binfile:logging corrected
sleske [Mon, 6 Feb 2012 20:56:24 +0000 (20:56 +0000)]
Fix:map_binfile:logging corrected

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4928 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:vehicle_file:Option to save current gps position on shutdown and resume from...
martin-s [Mon, 6 Feb 2012 15:13:35 +0000 (15:13 +0000)]
Add:vehicle_file:Option to save current gps position on shutdown and resume from there on startup

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4927 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:Core:Implement reference counting for navit object
martin-s [Mon, 6 Feb 2012 13:50:30 +0000 (13:50 +0000)]
Add:Core:Implement reference counting for navit object

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4926 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:speech_cmdline:Option to urldecode sample filenames to avoid charset issues for...
martin-s [Mon, 6 Feb 2012 13:48:04 +0000 (13:48 +0000)]
Add:speech_cmdline:Option to urldecode sample filenames to avoid charset issues for some filesystems

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4925 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoRevert:maptool:Reverted changes 4890 and 4906 to make planet work again
martin-s [Mon, 6 Feb 2012 09:14:18 +0000 (09:14 +0000)]
Revert:maptool:Reverted changes 4890 and 4906 to make planet work again

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4924 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core/osd:reverted svn #4918 since it broke some OSDs
tegzed [Wed, 1 Feb 2012 20:05:58 +0000 (20:05 +0000)]
Fix:core/osd:reverted svn #4918 since it broke some OSDs

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4923 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:Core:Moved object functions of vehicle to vehicle.c, added reference counting
martin-s [Wed, 1 Feb 2012 13:32:50 +0000 (13:32 +0000)]
Add:Core:Moved object functions of vehicle to vehicle.c, added reference counting

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4922 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:Core:Reverted rename which breaks external modules
martin-s [Wed, 1 Feb 2012 13:21:24 +0000 (13:21 +0000)]
Fix:Core:Reverted rename which breaks external modules

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4921 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:Core:Reverted rename which breaks external modules
martin-s [Wed, 1 Feb 2012 13:20:09 +0000 (13:20 +0000)]
Fix:Core:Reverted rename which breaks external modules

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4920 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:Core:Option to get matched direction from map matching
martin-s [Wed, 1 Feb 2012 13:13:56 +0000 (13:13 +0000)]
Add:Core:Option to get matched direction from map matching

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4919 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:Call osd_std_calculate_sizes during OSD init, to interpret percentage sizes...
sleske [Sun, 29 Jan 2012 20:09:15 +0000 (20:09 +0000)]
Fix:core:Call osd_std_calculate_sizes during OSD init, to interpret percentage sizes for OSD elements. Fixes (part of) #983.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4918 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:Add comments and some #defines for constants
sleske [Sun, 29 Jan 2012 19:19:48 +0000 (19:19 +0000)]
Fix:core:Add comments and some #defines for constants

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4917 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:core:Add debugging example to navit_shipped.xml.
sleske [Sun, 29 Jan 2012 15:23:36 +0000 (15:23 +0000)]
Add:core:Add debugging example to navit_shipped.xml.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4916 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:Core:New "global" debug level; activate option -d.
sleske [Sun, 29 Jan 2012 14:49:58 +0000 (14:49 +0000)]
Add:Core:New "global" debug level; activate option -d.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4915 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:Avoid crash if gui_internal.txt does not exist.
sleske [Sat, 28 Jan 2012 18:33:49 +0000 (18:33 +0000)]
Fix:core:Avoid crash if gui_internal.txt does not exist.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4914 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:CMake target navit_config_xml should depend on navit.xml from binary directo...
mdankov [Fri, 27 Jan 2012 18:53:53 +0000 (18:53 +0000)]
Fix:core:CMake target navit_config_xml should depend on navit.xml from binary directory, not from source one. Fixes out-of-source builds.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4913 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:core:Made footway names visible and searcheable in Town submenu. Fixes #847
mdankov [Fri, 27 Jan 2012 18:41:12 +0000 (18:41 +0000)]
Add:core:Made footway names visible and searcheable in Town submenu. Fixes #847

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4912 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_internal:Do alphabetical ordering of search results
mdankov [Wed, 25 Jan 2012 20:44:51 +0000 (20:44 +0000)]
Add:gui_internal:Do alphabetical ordering of search results

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4911 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:Stop flooding debug log from search_list_get_result when streetname attribut...
mdankov [Wed, 25 Jan 2012 20:36:47 +0000 (20:36 +0000)]
Fix:core:Stop flooding debug log from search_list_get_result when streetname attribute exists.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4910 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:Core:Remove unused file locations.txt.
sleske [Sun, 22 Jan 2012 19:39:21 +0000 (19:39 +0000)]
Fix:Core:Remove unused file locations.txt.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4909 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Remove visual glitch in Route Description list
mdankov [Sat, 21 Jan 2012 22:59:42 +0000 (22:59 +0000)]
Fix:gui_internal:Remove visual glitch in Route Description list

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4908 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:binding_win32:Out-of-source autotools build for WinCE should be working now
mdankov [Sat, 21 Jan 2012 22:32:30 +0000 (22:32 +0000)]
Fix:binding_win32:Out-of-source autotools build for WinCE should be working now

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4907 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:maptool:fixed a wrong operator in function geom_poly_segments_group() ;
tegzed [Sat, 21 Jan 2012 15:58:46 +0000 (15:58 +0000)]
Fix:maptool:fixed a wrong operator in function geom_poly_segments_group() ;
            eliminated some compiler warnings

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4906 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_internal: Made route description items clickable
mdankov [Fri, 20 Jan 2012 23:54:27 +0000 (23:54 +0000)]
Add:gui_internal: Made route description items clickable

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4905 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Rearranged Prev and Next buttons and their icons to take less vertic...
mdankov [Fri, 20 Jan 2012 23:28:15 +0000 (23:28 +0000)]
Fix:gui_internal:Rearranged Prev and Next buttons and their icons to take less vertical place on screen.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4904 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:bindings_win32:adjust svn ignore
woglinde [Fri, 20 Jan 2012 23:01:03 +0000 (23:01 +0000)]
Fix:bindings_win32:adjust svn ignore

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4903 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Fixed memleak in route description code.
mdankov [Fri, 20 Jan 2012 21:55:01 +0000 (21:55 +0000)]
Fix:gui_internal:Fixed memleak in route description code.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4902 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_internal:Made search result lists pageable when onscreen keyboard is hidden...
mdankov [Fri, 20 Jan 2012 21:47:26 +0000 (21:47 +0000)]
Add:gui_internal:Made search result lists pageable when onscreen keyboard is hidden. See #1001.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4901 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:When destroying the graphics, destroy the graphics_gc's too, guard graphics_...
woglinde [Fri, 20 Jan 2012 21:32:30 +0000 (21:32 +0000)]
Fix:core:When destroying the graphics, destroy the graphics_gc's too, guard graphics_destroy_gc against null pointer

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4900 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:clean up a bit the destroy function
woglinde [Fri, 20 Jan 2012 21:32:10 +0000 (21:32 +0000)]
Fix:core:clean up a bit the destroy function

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4899 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:Fix memleak
woglinde [Fri, 20 Jan 2012 21:31:49 +0000 (21:31 +0000)]
Fix:core:Fix memleak

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4898 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core: Fix the format specifier for g_strdup_printf, compiler warning with gcc...
woglinde [Fri, 20 Jan 2012 21:31:29 +0000 (21:31 +0000)]
Fix:core: Fix the format specifier for g_strdup_printf, compiler warning with gcc and clang

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4897 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core: Fix the format specifier for g_strdup_printf, compiler warning with gcc...
woglinde [Fri, 20 Jan 2012 21:31:08 +0000 (21:31 +0000)]
Fix:core: Fix the format specifier for g_strdup_printf, compiler warning with gcc and clang

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4896 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agofix:map/csv: fix order of headers, config.h needs to be load first
woglinde [Thu, 19 Jan 2012 22:23:16 +0000 (22:23 +0000)]
fix:map/csv: fix order of headers, config.h needs to be load first

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4895 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:port_windows:Remove resource.rsc when making clean
mdankov [Thu, 19 Jan 2012 21:46:54 +0000 (21:46 +0000)]
Fix:port_windows:Remove resource.rsc when making clean

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4894 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:binding_win32:Repair autotools build for wince broken in r4892
mdankov [Thu, 19 Jan 2012 21:43:56 +0000 (21:43 +0000)]
Fix:binding_win32:Repair autotools build for wince broken in r4892

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4893 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:core:New binding_win32 module for Windows and WinCE. Some details are at ticket...
mdankov [Wed, 18 Jan 2012 21:11:59 +0000 (21:11 +0000)]
Add:core:New binding_win32 module for Windows and WinCE. Some details are at ticket #970.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4892 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:osd/core:fix compilation on windows platforms
tegzed [Mon, 16 Jan 2012 07:00:31 +0000 (07:00 +0000)]
Fix:osd/core:fix compilation on windows platforms

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4891 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:maptool:added initial support for relation based areas; added some tests to avoid...
tegzed [Sun, 15 Jan 2012 17:28:12 +0000 (17:28 +0000)]
Add:maptool:added initial support for relation based areas; added some tests to avoid generating self-intersecting area items

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4890 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agofix:osd/core:fixed distance calculation in route_guard
tegzed [Sat, 14 Jan 2012 20:06:43 +0000 (20:06 +0000)]
fix:osd/core:fixed distance calculation in route_guard

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4889 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoPatch:Translations:pt_BR strings|Fixes #994. Thanks leonardohamada!
korrosa [Sat, 7 Jan 2012 12:22:23 +0000 (12:22 +0000)]
Patch:Translations:pt_BR strings|Fixes #994. Thanks leonardohamada!

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4888 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:remove duplicate variable definitions
tegzed [Thu, 5 Jan 2012 19:28:14 +0000 (19:28 +0000)]
Fix:remove duplicate variable definitions

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4887 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:Fix crash when set_destination() is called from command interface without...
mdankov [Tue, 3 Jan 2012 21:05:01 +0000 (21:05 +0000)]
Fix:core:Fix crash when set_destination() is called from command interface without its last parameter, description.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4886 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:core:New command in command interface set_position() to set route start point...
mdankov [Tue, 3 Jan 2012 21:02:59 +0000 (21:02 +0000)]
Add:core:New command in command interface set_position() to set route start point, for systems where no GPS source avaliable.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4885 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:osd/core:fixed update_period handling in route_guard osd
tegzed [Mon, 2 Jan 2012 10:58:47 +0000 (10:58 +0000)]
Fix:osd/core:fixed update_period handling in route_guard osd

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4884 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:map_textfile:Rename SIZE define because it's hardly compatible with Win* platform.
mdankov [Sun, 1 Jan 2012 22:40:23 +0000 (22:40 +0000)]
Fix:map_textfile:Rename SIZE define because it's hardly compatible with Win* platform.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4883 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Made gui_internal_label_new_abbrev abbreviations utf-aware.
mdankov [Sun, 1 Jan 2012 21:53:25 +0000 (21:53 +0000)]
Fix:gui_internal:Made gui_internal_label_new_abbrev abbreviations utf-aware.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4882 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:Quickfix to make win32 cmake builds, broken in svn 4871, working again....
mdankov [Sun, 1 Jan 2012 21:50:55 +0000 (21:50 +0000)]
Fix:core:Quickfix to make win32 cmake builds, broken in svn 4871, working again. Needs further work on it.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4881 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Fix internal gui crashing when screen is very narrow. Fixes #989.
mdankov [Sun, 1 Jan 2012 19:16:31 +0000 (19:16 +0000)]
Fix:gui_internal:Fix internal gui crashing when screen is very narrow. Fixes #989.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4880 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:core:- fixed possible usage of uninitialized hash map in command function get_att...
tegzed [Thu, 29 Dec 2011 02:16:15 +0000 (02:16 +0000)]
Fix:core:- fixed possible usage of uninitialized hash map in command function get_attr_var()
         - added debug statements for some command functions

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4879 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:graphics/opengl:-made the opengl driver operable on windows also - thanks efess
tegzed [Wed, 28 Dec 2011 17:22:50 +0000 (17:22 +0000)]
Fix:graphics/opengl:-made the opengl driver operable on windows also - thanks efess

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4878 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_gtk:Add menu accel keys to German translation.
sleske [Mon, 26 Dec 2011 21:25:37 +0000 (21:25 +0000)]
Add:gui_gtk:Add menu accel keys to German translation.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4877 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_gtk:Update .po.in files with new msgids for GTK menu items, because of previo...
sleske [Mon, 26 Dec 2011 21:25:16 +0000 (21:25 +0000)]
Fix:gui_gtk:Update .po.in files with new msgids for GTK menu items, because of previous commit (GTK menu items now contain a "_").

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4876 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_gtk:Add mnemonics to GTK menu entries.
sleske [Mon, 26 Dec 2011 21:23:58 +0000 (21:23 +0000)]
Add:gui_gtk:Add mnemonics to GTK menu entries.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4875 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_gtk:Add more accelerator keys for menu/toolbar commands.
sleske [Mon, 26 Dec 2011 20:56:31 +0000 (20:56 +0000)]
Add:gui_gtk:Add more accelerator keys for menu/toolbar commands.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4874 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_gtk:Activate menu accelerators for GTK GUI; fixes #206.
sleske [Mon, 26 Dec 2011 20:55:56 +0000 (20:55 +0000)]
Fix:gui_gtk:Activate menu accelerators for GTK GUI; fixes #206.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4873 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_internal:Add icon for 'Former destinations'
sleske [Mon, 26 Dec 2011 20:34:23 +0000 (20:34 +0000)]
Add:gui_internal:Add icon for 'Former destinations'

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4872 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:Core:Mark destination as stopped in destination.txt, closes ticket #980.
sleske [Sun, 25 Dec 2011 21:07:15 +0000 (21:07 +0000)]
Fix:Core:Mark destination as stopped in destination.txt, closes ticket #980.
Avoids restarting a stopped navigation when Navit is restarted.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4871 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoUndo accidental commit. Sorry :-/.
sleske [Sun, 25 Dec 2011 21:04:50 +0000 (21:04 +0000)]
Undo accidental commit. Sorry :-/.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4870 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoIncrease debug level
sleske [Sun, 25 Dec 2011 21:01:30 +0000 (21:01 +0000)]
Increase debug level

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4869 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:Core:Add warning for invalid commands.
sleske [Sun, 25 Dec 2011 18:50:11 +0000 (18:50 +0000)]
Fix:Core:Add warning for invalid commands.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4868 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:Core:Remove out-ifdefed code, which no longer makes sense, but breaks cscope.
sleske [Sun, 25 Dec 2011 17:10:19 +0000 (17:10 +0000)]
Fix:Core:Remove out-ifdefed code, which no longer makes sense, but breaks cscope.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4867 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years ago#include <glib.h>
geoghegan [Sat, 24 Dec 2011 21:45:44 +0000 (21:45 +0000)]
#include <glib.h>
#include "config.h"
#include "config_.h"
#include "debug.h"
#include "plugin.h"
#include "point.h"
#include "window.h"
#include "graphics.h"
#include "event.h"
#include "item.h"
#include "callback.h"
#include "color.h"
#include <iconv.h>

#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
#define USE_UIKIT 1
#else
#define USE_UIKIT 0
#endif

#if USE_UIKIT
#import <UIKit/UIKit.h>
#define NSRect CGRect
#define NSMakeRect CGRectMake
#define REVERSE_Y 0

CGContextRef
current_context(void)
{
return UIGraphicsGetCurrentContext();
}

#else
#import <Cocoa/Cocoa.h>
#define UIView NSView
#define UIViewController NSViewController
#define UIApplicationDelegate NSApplicationDelegate
#define UIWindow NSWindow
#define UIApplication NSApplication
#define UIApplicationMain(a,b,c,d) NSApplicationMain(a,b)
#define UIScreen NSScreen
#define UIEvent NSEvent
#define applicationFrame frame
#define REVERSE_Y 1

CGContextRef
current_context(void)
{
return [[NSGraphicsContext currentContext] graphicsPort];
}

#endif

@interface NavitView : UIView {
@public
struct graphics_priv *graphics;
}

@end

static struct graphics_priv {
struct window win;
NavitView *view;
CGLayerRef layer;
CGContextRef layer_context;
struct callback_list *cbl;
struct point p, pclean;
int w, h, wraparound, overlay_disabled, cleanup;
struct graphics_priv *parent, *next, *overlays;
} *global_graphics_cocoa;

iconv_t utf8_macosroman;

struct graphics_gc_priv {
CGFloat rgba[4];
int w;
};

struct graphics_font_priv {
int size;
char *name;
};

@implementation NavitView

- (void)drawRect:(NSRect)rect
{
struct graphics_priv *gr=NULL;
#if 0
NSLog(@"NavitView:drawRect...");
#endif

CGContextRef X = current_context();

CGContextDrawLayerAtPoint(X, CGPointZero, graphics->layer);
if (!graphics->overlay_disabled)
gr=graphics->overlays;
while (gr) {
if (!gr->overlay_disabled) {
struct CGPoint pc;
pc.x=gr->p.x;
pc.y=gr->p.y;
if (gr->wraparound) {
if (pc.x < 0)
pc.x+=graphics->w;
if (pc.y < 0)
pc.y+=graphics->h;
}
#if REVERSE_Y
pc.y=graphics->h-pc.y-gr->h;
#endif
dbg(0,"draw %dx%d at %f,%f\n",gr->w,gr->h,pc.x,pc.y);
CGContextDrawLayerAtPoint(X, pc, gr->layer);
}
gr=gr->next;
}
}

#if USE_UIKIT
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSArray *arr=touches.allObjects;
UITouch *touch=[arr objectAtIndex: 0];
struct CGPoint pc=[touch locationInView: self];
struct point p;
p.x=pc.x;
p.y=pc.y;
dbg(0,"Enter count=%d %d %d\n",touches.count,p.x,p.y);
        callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(1), GINT_TO_POINTER(1), (void *)&p);
}

- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
NSArray *arr=touches.allObjects;
UITouch *touch=[arr objectAtIndex: 0];
struct CGPoint pc=[touch locationInView: self];
struct point p;
p.x=pc.x;
p.y=pc.y;
dbg(0,"Enter count=%d %d %d\n",touches.count,p.x,p.y);
        callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(0), GINT_TO_POINTER(1), (void *)&p);
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
NSArray *arr=touches.allObjects;
UITouch *touch=[arr objectAtIndex: 0];
struct CGPoint pc=[touch locationInView: self];
struct point p;
p.x=pc.x;
p.y=pc.y;
dbg(0,"Enter count=%d %d %d\n",touches.count,p.x,p.y);
        callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(0), GINT_TO_POINTER(1), (void *)&p);
}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
NSArray *arr=touches.allObjects;
UITouch *touch=[arr objectAtIndex: 0];
struct CGPoint pc=[touch locationInView: self];
struct point p;
p.x=pc.x;
p.y=pc.y;
dbg(0,"Enter count=%d %d %d\n",touches.count,p.x,p.y);
callback_list_call_attr_1(graphics->cbl, attr_motion, (void *)&p);
}

#else
- (void)mouseDown:(UIEvent *)theEvent
{
struct point p;
p.x=theEvent.locationInWindow.x;
p.y=graphics->h-theEvent.locationInWindow.y;

dbg(0,"Enter %d %d\n",p.x,p.y);
        callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(1), GINT_TO_POINTER(1), (void *)&p);
}

- (void)mouseUp:(UIEvent *)theEvent
{
struct point p;
p.x=theEvent.locationInWindow.x;
p.y=graphics->h-theEvent.locationInWindow.y;

dbg(0,"Enter %d %d\n",p.x,p.y);
        callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(0), GINT_TO_POINTER(1), (void *)&p);
}

- (void)mouseDragged:(UIEvent *)theEvent
{
struct point p;
p.x=theEvent.locationInWindow.x;
p.y=graphics->h-theEvent.locationInWindow.y;

dbg(0,"Enter %d %d\n",p.x,p.y);
callback_list_call_attr_1(graphics->cbl, attr_motion, (void *)&p);
}
#endif

- (void)dealloc {
[super dealloc];
}

@end

@interface NavitViewController : UIViewController
{
NSRect frame;
CGLayerRef layer;
}

@property (nonatomic) NSRect frame;

- (id) init_withFrame : (NSRect) _frame;

@end

@implementation NavitViewController

@synthesize frame;

- (id) init_withFrame : (NSRect) _frame
{
NSLog(@"init with frame\n");
frame = _frame;
return [self init];
}

static
void free_graphics(struct graphics_priv *gr)
{
if (gr->layer) {
CGLayerRelease(gr->layer);
gr->layer=NULL;
}
}

static void
setup_graphics(struct graphics_priv *gr)
{
CGRect lr=CGRectMake(0, 0, gr->w, gr->h);
gr->layer=CGLayerCreateWithContext(current_context(), lr.size, NULL);
gr->layer_context=CGLayerGetContext(gr->layer);
#if REVERSE_Y
CGContextScaleCTM(gr->layer_context, 1, -1);
CGContextTranslateCTM(gr->layer_context, 0, -gr->h);
#endif
CGContextSetRGBFillColor(gr->layer_context, 0, 0, 0, 0);
   CGContextSetRGBStrokeColor(gr->layer_context, 0, 0, 0, 0);
CGContextClearRect(gr->layer_context, lr);
}

- (void)loadView
{
NSLog(@"loadView");
NavitView* myV = [NavitView alloc];

if (global_graphics_cocoa) {
global_graphics_cocoa->view=myV;
myV->graphics=global_graphics_cocoa;
global_graphics_cocoa->w=frame.size.width;
global_graphics_cocoa->h=frame.size.height;
setup_graphics(global_graphics_cocoa);
}

[myV initWithFrame: frame];

[self setView: myV];

[myV release];
}

- (void)didReceiveMemoryWarning {
dbg(0,"enter\n");
}

- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}

- (void)dealloc {
[super dealloc];
}

@end

@class NavitViewController;

@interface NavitAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
NavitViewController *viewController;
}

@property (nonatomic, retain) /*IBOutlet*/ UIWindow *window;
@property (nonatomic, retain) /*IBOutlet*/ NavitViewController *viewController;

@end

@implementation NavitAppDelegate

@synthesize window;
@synthesize viewController;

#if USE_UIKIT
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
#else
- (void)
applicationDidFinishLaunching:(NSNotification *)aNotification
#endif
{
NSLog(@"DidFinishLaunching\n");
#if USE_UIKIT
[[UIApplication sharedApplication] setStatusBarHidden:NO];
#endif

NSRect appFrame = [UIScreen mainScreen].applicationFrame;

self.viewController = [[[NavitViewController alloc] init_withFrame : appFrame] autorelease];

NSRect windowRect = NSMakeRect(0, 0, appFrame.size.width, appFrame.size.height);

#if USE_UIKIT
self.window = [[[UIWindow alloc] initWithFrame:windowRect] autorelease];
#else
self.window = [[[UIWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO] autorelease];
#endif
utf8_macosroman=iconv_open("MACROMAN","UTF-8");

#if USE_UIKIT
[window addSubview:viewController.view];
[window makeKeyAndVisible];
#else
NSWindowController * controller = [[NSWindowController alloc] initWithWindow : window];
NSLog(@"Setting view\n");
[viewController loadView];
[window setContentView : viewController.view];
[controller setWindow : window];
[controller showWindow : nil];

#endif

if (global_graphics_cocoa) {
callback_list_call_attr_2(global_graphics_cocoa->cbl, attr_resize, (int)appFrame.size.width, (int)appFrame.size.height);

}

#if USE_UIKIT
return YES;
#endif
}

- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}

@end

static void
draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
{
if (mode == draw_mode_end) {
dbg(0,"end %p\n",gr);
if (!gr->parent) {
#if USE_UIKIT
[gr->view setNeedsDisplay];
#else
[gr->view display];
#endif
}
}
}

static void
draw_lines(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
{
CGPoint points[count];
int i;
for (i = 0 ; i < count ; i++) {
points[i].x=p[i].x;
points[i].y=p[i].y;
}
CGContextSetStrokeColor(gr->layer_context, gc->rgba);
CGContextSetLineWidth(gr->layer_context, gc->w);
CGContextSetLineCap(gr->layer_context, kCGLineCapRound);
     CGContextBeginPath(gr->layer_context);
CGContextAddLines(gr->layer_context, points, count);
CGContextStrokePath(gr->layer_context);

}

static void
draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int count)
{
CGPoint points[count];
int i;
for (i = 0 ; i < count ; i++) {
points[i].x=p[i].x;
points[i].y=p[i].y;
}
CGContextSetFillColor(gr->layer_context, gc->rgba);
     CGContextBeginPath(gr->layer_context);
CGContextAddLines(gr->layer_context, points, count);
CGContextFillPath(gr->layer_context);
}

static void
draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int w, int h)
{
CGRect lr=CGRectMake(p->x, p->y, w, h);
if (p->x <= 0 && p->y <= 0 && p->x+w+1 >= gr->w && p->y+h+1 >= gr->h) {
dbg(0,"clear %p %dx%d\n",gr,w,h);
free_graphics(gr);
setup_graphics(gr);
}
CGContextSetFillColor(gr->layer_context, gc->rgba);
CGContextFillRect(gr->layer_context, lr);
}

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)
{
size_t len,inlen=strlen(text)+1,outlen=strlen(text)+1;
char outb[outlen];
char *inp=text,*outp=outb;

len=iconv (utf8_macosroman, &inp, &inlen, &outp, &outlen);

CGContextSetFillColor(gr->layer_context, fg->rgba);

CGContextSelectFont(gr->layer_context, font->name, font->size/16.0, kCGEncodingMacRoman);
CGContextSetTextDrawingMode(gr->layer_context, kCGTextFill);
CGAffineTransform xform = CGAffineTransformMake(dx/65536.0, dy/65536.0, dy/65536.0, -dx/65536.0, 0.0f, 0.0f);
CGContextSetTextMatrix(gr->layer_context, xform);
CGContextShowTextAtPoint(gr->layer_context, p->x, p->y, outb, strlen(outb));
}

static void
draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img)
{
CGImageRef imgc=(CGImageRef) img;
int w=CGImageGetWidth(imgc);
int h=CGImageGetHeight(imgc);
CGRect rect=CGRectMake(0, 0, w, h);
CGContextSaveGState(gr->layer_context);
CGContextTranslateCTM(gr->layer_context, p->x, p->y+h);
CGContextScaleCTM(gr->layer_context, 1.0, -1.0);
CGContextDrawImage(gr->layer_context, rect, imgc);
CGContextRestoreGState(gr->layer_context);
}

static void font_destroy(struct graphics_font_priv *font)
{
g_free(font);
}

static struct graphics_font_methods font_methods = {
font_destroy
};

static void
draw_drag(struct graphics_priv *gr, struct point *p)
{
if (!gr->cleanup) {
gr->pclean=gr->p;
gr->cleanup=1;
}
if (p)
gr->p=*p;
else {
gr->p.x=0;
gr->p.y=0;
}
}

static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, char *font,  int size, int flags)
{
struct graphics_font_priv *ret=g_new0(struct graphics_font_priv, 1);
*meth=font_methods;

ret->size=size;
ret->name="Helvetica";
return ret;
}

static void
gc_destroy(struct graphics_gc_priv *gc)
{
g_free(gc);
}

static void
gc_set_linewidth(struct graphics_gc_priv *gc, int w)
{
gc->w=w;
}

static void
gc_set_dashes(struct graphics_gc_priv *gc, int w, int offset, unsigned char *dash_list, int n)
{
}

static void
gc_set_foreground(struct graphics_gc_priv *gc, struct color *c)
{
gc->rgba[0]=c->r/65535.0;
gc->rgba[1]=c->g/65535.0;
gc->rgba[2]=c->b/65535.0;
gc->rgba[3]=c->a/65535.0;
}

static void
gc_set_background(struct graphics_gc_priv *gc, struct color *c)
{
}

static void
gc_set_stipple(struct graphics_gc_priv *gc, struct graphics_image_priv *img)
{
}

static struct graphics_gc_methods gc_methods = {
gc_destroy,
gc_set_linewidth,
gc_set_dashes,
gc_set_foreground,
gc_set_background,
gc_set_stipple,
};

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);
gc->w=1;

        *meth=gc_methods;
        return gc;
}

static void
background_gc(struct graphics_priv *gr, struct graphics_gc_priv *gc)
{
}

static struct graphics_priv *
overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int alpha, int wraparound);

static struct graphics_image_priv *
image_new(struct graphics_priv *gra, struct graphics_image_methods *meth, char *path, int *w, int *h, struct point *hot, int rotation)
{
NSString *s=[[NSString alloc]initWithCString:path encoding:NSMacOSRomanStringEncoding];
CGDataProviderRef imgDataProvider = CGDataProviderCreateWithCFData((CFDataRef)[NSData dataWithContentsOfFile:s]);
[s release];

if (!imgDataProvider)
return NULL;

CGImageRef image = CGImageCreateWithPNGDataProvider(imgDataProvider, NULL, true, kCGRenderingIntentDefault);
CGDataProviderRelease(imgDataProvider);
dbg(0,"size %dx%d\n",CGImageGetWidth(image),CGImageGetHeight(image));
if (w)
*w=CGImageGetWidth(image);
if (h)
*h=CGImageGetHeight(image);
if (hot) {
hot->x=CGImageGetWidth(image)/2;
hot->y=CGImageGetHeight(image)/2;
}
return (struct graphics_image_priv *)image;
}

static void *
get_data(struct graphics_priv *this, const char *type)
{
dbg(0,"enter\n");
if (strcmp(type,"window"))
return NULL;
return &this->win;
}

static void
image_free(struct graphics_priv *gr, struct graphics_image_priv *priv)
{
CGImageRelease((CGImageRef)priv);
}

static void
get_text_bbox(struct graphics_priv *gr, struct graphics_font_priv *font, char *text, int dx, int dy, struct point *ret, int estimate)
{
int len = g_utf8_strlen(text, -1);
int xMin = 0;
int yMin = 0;
int yMax = 13*font->size/256;
int xMax = 9*font->size*len/256;

ret[0].x = xMin;
ret[0].y = -yMin;
ret[1].x = xMin;
ret[1].y = -yMax;
ret[2].x = xMax;
ret[2].y = -yMax;
ret[3].x = xMax;
ret[3].y = -yMin;
}

static void
overlay_disable(struct graphics_priv *gr, int disabled)
{
gr->overlay_disabled=disabled;
}

static struct graphics_methods graphics_methods = {
NULL, /* graphics_destroy, */
draw_mode,
draw_lines,
draw_polygon,
draw_rectangle,
NULL, /* draw_circle, */
draw_text,
draw_image,
NULL, /* draw_image_warp, */
NULL, /* draw_restore, */
draw_drag,
font_new,
gc_new,
background_gc,
overlay_new,
image_new,
get_data,
image_free,
get_text_bbox,
overlay_disable,
NULL, /* overlay_resize, */
NULL, /* set_attr, */
};

static struct graphics_priv *
overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int alpha, int wraparound)
{
struct graphics_priv *ret=g_new0(struct graphics_priv, 1);
*meth=graphics_methods;
ret->p=*p;
ret->w=w;
ret->h=h;
ret->parent=gr;
ret->next=gr->overlays;
ret->wraparound=wraparound;
gr->overlays=ret;
setup_graphics(gr);
return ret;
}

struct graphics_priv *
graphics_cocoa_new(struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl)
{
struct graphics_priv *ret;
*meth=graphics_methods;
dbg(0,"enter\n");
if(!event_request_system("cocoa","graphics_cocoa"))
return NULL;
ret=g_new0(struct graphics_priv, 1);
ret->cbl=cbl;
global_graphics_cocoa=ret;
return ret;
}

static void
event_cocoa_main_loop_run(void)
{

dbg(0,"enter\n");
#if 0
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *logPath = [documentsDirectory stringByAppendingPathComponent:@"console.log"];
freopen("/tmp/log.txt","a+",stderr);
NSLog(@"Test\n");
#endif
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
#if USE_UIKIT
dbg(0,"calling main\n");
int retval = UIApplicationMain(main_argc, main_argv, nil, @"NavitAppDelegate");
dbg(0,"retval=%d\n",retval);
#else
NavitAppDelegate * delegate = [[NavitAppDelegate alloc] init];
NSApplication * application = [NSApplication sharedApplication];
[application setDelegate:delegate];
NSLog(@"Test\n");

[NSApp run];

[delegate release];
#endif
[pool release];
}

@interface NavitTimer : NSObject{
@public
struct callback *cb;
NSTimer *timer;
}
- (void)onTimer:(NSTimer*)theTimer;

@end

@implementation NavitTimer

- (void)onTimer:(NSTimer*)theTimer
{
callback_call_0(cb);
}

@end

struct event_idle {
struct callback *cb;
NSTimer *timer;
};

static struct event_timeout *
event_cocoa_add_timeout(int timeout, int multi, struct callback *cb)
{
NavitTimer *ret=[[NavitTimer alloc]init];
ret->cb=cb;
ret->timer=[NSTimer scheduledTimerWithTimeInterval:(timeout/1000.0) target:ret selector:@selector(onTimer:) userInfo:nil repeats:multi?YES:NO];
dbg(0,"timer=%p\n",ret->timer);
return (struct event_timeout *)ret;
}

static void
event_cocoa_remove_timeout(struct event_timeout *ev)
{
NavitTimer *t=(NavitTimer *)ev;

[t->timer invalidate];
[t release];
}

static struct event_idle *
event_cocoa_add_idle(int priority, struct callback *cb)
{
NavitTimer *ret=[[NavitTimer alloc]init];
ret->cb=cb;
ret->timer=[NSTimer scheduledTimerWithTimeInterval:(0.0) target:ret selector:@selector(onTimer:) userInfo:nil repeats:YES];

dbg(0,"timer=%p\n",ret->timer);
return (struct event_idle *)ret;
}

static void
event_cocoa_remove_idle(struct event_idle *ev)
{
NavitTimer *t=(NavitTimer *)ev;

[t->timer invalidate];
[t release];
}

static struct event_methods event_cocoa_methods = {
event_cocoa_main_loop_run,
NULL, /* event_cocoa_main_loop_quit, */
NULL, /* event_cocoa_add_watch, */
NULL, /* event_cocoa_remove_watch, */
event_cocoa_add_timeout,
event_cocoa_remove_timeout,
event_cocoa_add_idle,
event_cocoa_remove_idle,
NULL, /* event_cocoa_call_callback, */
};

static struct event_priv *
event_cocoa_new(struct event_methods *meth)
{
dbg(0,"enter\n");
*meth=event_cocoa_methods;
return NULL;
}

void
plugin_init(void)
{
dbg(0,"enter\n");
plugin_register_graphics_type("cocoa", graphics_cocoa_new);
plugin_register_event_type("cocoa", event_cocoa_new);
}

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4866 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:Android:English text strings, fixing grammar
korrosa [Sun, 18 Dec 2011 22:36:47 +0000 (22:36 +0000)]
Fix:Android:English text strings, fixing grammar

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4865 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoAdd:gui_internal:When map is clicked, display the closest visible item details. Close...
mdankov [Sun, 18 Dec 2011 13:18:09 +0000 (13:18 +0000)]
Add:gui_internal:When map is clicked, display the closest visible item details. Closes #962.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4864 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:vehicle_demo:Free everything on destroy
martin-s [Fri, 16 Dec 2011 22:50:32 +0000 (22:50 +0000)]
Fix:vehicle_demo:Free everything on destroy

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4863 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:Core:Made navigation_unregister_callback more reasonable
martin-s [Fri, 16 Dec 2011 22:49:28 +0000 (22:49 +0000)]
Fix:Core:Made navigation_unregister_callback more reasonable

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4862 ffa7fe5e-494d-0410-b361-a75ebd5db220

12 years agoFix:gui_internal:Revert "back behaviour" in internal gui introduced accidently by...
woglinde [Fri, 16 Dec 2011 18:49:32 +0000 (18:49 +0000)]
Fix:gui_internal:Revert "back behaviour" in internal gui introduced accidently by rev 4860, because it needs to be discussed

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4861 ffa7fe5e-494d-0410-b361-a75ebd5db220