changeset 20231:c15d7e9939a4 draft

-Codechange: Pass UCS-4 instead of UCS-2 characters to the hotkey handlers.
author Michael Lutz <michi@icosahedron.de>
date Sat, 23 Mar 2013 23:38:30 +0100
parents 250ea1f71c97
children aea4ce005d80
files src/ai/ai_gui.cpp src/airport_gui.cpp src/dock_gui.cpp src/hotkeys.cpp src/hotkeys.h src/rail_gui.cpp src/road_gui.cpp src/signs_gui.cpp src/terraform_gui.cpp
diffstat 9 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -1514,7 +1514,7 @@
 /**
  * Handler for global AI debug window hotkeys.
  */
-EventState AIDebugGlobalHotkeys(uint16 key, uint16 keycode)
+EventState AIDebugGlobalHotkeys(WChar key, uint16 keycode)
 {
 	int num = CheckHotkeyMatch<AIDebugWindow>(_aidebug_hotkeys, keycode, NULL, true);
 	if (num == -1) return ES_NOT_HANDLED;
--- a/src/airport_gui.cpp
+++ b/src/airport_gui.cpp
@@ -187,7 +187,7 @@
 	return AllocateWindowDescFront<BuildAirToolbarWindow>(&_air_toolbar_desc, TRANSPORT_AIR);
 }
 
-EventState AirportToolbarGlobalHotkeys(uint16 key, uint16 keycode)
+EventState AirportToolbarGlobalHotkeys(WChar key, uint16 keycode)
 {
 	if (!CanBuildVehicleInfrastructure(VEH_AIRCRAFT)) return ES_NOT_HANDLED;
 	int num = CheckHotkeyMatch<BuildAirToolbarWindow>(_airtoolbar_hotkeys, keycode, NULL, true);
--- a/src/dock_gui.cpp
+++ b/src/dock_gui.cpp
@@ -335,7 +335,7 @@
 	return AllocateWindowDescFront<BuildDocksToolbarWindow>(&_build_docks_toolbar_desc, TRANSPORT_WATER);
 }
 
-EventState DockToolbarGlobalHotkeys(uint16 key, uint16 keycode)
+EventState DockToolbarGlobalHotkeys(WChar key, uint16 keycode)
 {
 	int num = CheckHotkeyMatch<BuildDocksToolbarWindow>(_dockstoolbar_hotkeys, keycode, NULL, true);
 	if (num == -1) return ES_NOT_HANDLED;
--- a/src/hotkeys.cpp
+++ b/src/hotkeys.cpp
@@ -295,7 +295,7 @@
 	SaveLoadHotkeys(true);
 }
 
-typedef EventState GlobalHotkeyHandler(uint16, uint16);
+typedef EventState GlobalHotkeyHandler(WChar, uint16);
 
 GlobalHotkeyHandler RailToolbarGlobalHotkeys;
 GlobalHotkeyHandler DockToolbarGlobalHotkeys;
@@ -324,7 +324,7 @@
 };
 
 
-void HandleGlobalHotkeys(uint16 key, uint16 keycode)
+void HandleGlobalHotkeys(WChar key, uint16 keycode)
 {
 	if (_game_mode == GM_NORMAL) {
 		for (uint i = 0; i < lengthof(_global_hotkey_handlers); i++) {
--- a/src/hotkeys.h
+++ b/src/hotkeys.h
@@ -14,6 +14,7 @@
 
 #include "core/smallvec_type.hpp"
 #include "gfx_type.h"
+#include "string_type.h"
 
 /**
  * All data for a single hotkey. The name (for saving/loading a configfile),
@@ -130,6 +131,6 @@
 void SaveHotkeysToConfig();
 
 
-void HandleGlobalHotkeys(uint16 key, uint16 keycode);
+void HandleGlobalHotkeys(WChar key, uint16 keycode);
 
 #endif /* HOTKEYS_H */
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -846,7 +846,7 @@
 	return new BuildRailToolbarWindow(&_build_rail_desc, railtype);
 }
 
-EventState RailToolbarGlobalHotkeys(uint16 key, uint16 keycode)
+EventState RailToolbarGlobalHotkeys(WChar key, uint16 keycode)
 {
 	if (!CanBuildVehicleInfrastructure(VEH_TRAIN)) return ES_NOT_HANDLED;
 	extern RailType _last_built_railtype;
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -775,7 +775,7 @@
 	return AllocateWindowDescFront<BuildRoadToolbarWindow>(roadtype == ROADTYPE_ROAD ? &_build_road_desc : &_build_tramway_desc, TRANSPORT_ROAD);
 }
 
-EventState RoadToolbarGlobalHotkeys(uint16 key, uint16 keycode)
+EventState RoadToolbarGlobalHotkeys(WChar key, uint16 keycode)
 {
 	extern RoadType _last_built_roadtype;
 	int num = CheckHotkeyMatch<BuildRoadToolbarWindow>(_roadtoolbar_hotkeys, keycode, NULL, true);
@@ -829,7 +829,7 @@
 	return AllocateWindowDescFront<BuildRoadToolbarWindow>(&_build_road_scen_desc, TRANSPORT_ROAD);
 }
 
-EventState RoadToolbarEditorGlobalHotkeys(uint16 key, uint16 keycode)
+EventState RoadToolbarEditorGlobalHotkeys(WChar key, uint16 keycode)
 {
 	int num = CheckHotkeyMatch<BuildRoadToolbarWindow>(_roadtoolbar_hotkeys, keycode, NULL, true);
 	if (num == -1) return ES_NOT_HANDLED;
--- a/src/signs_gui.cpp
+++ b/src/signs_gui.cpp
@@ -386,7 +386,7 @@
 	return AllocateWindowDescFront<SignListWindow>(&_sign_list_desc, 0);
 }
 
-EventState SignListGlobalHotkeys(uint16 key, uint16 keycode)
+EventState SignListGlobalHotkeys(WChar key, uint16 keycode)
 {
 	int num = CheckHotkeyMatch<SignListWindow>(_signlist_hotkeys, keycode, NULL, true);
 	if (num == -1) return ES_NOT_HANDLED;
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -377,7 +377,7 @@
 	return w;
 }
 
-EventState TerraformToolbarGlobalHotkeys(uint16 key, uint16 keycode)
+EventState TerraformToolbarGlobalHotkeys(WChar key, uint16 keycode)
 {
 	int num = CheckHotkeyMatch<TerraformToolbarWindow>(_terraform_hotkeys, keycode, NULL, true);
 	if (num == -1) return ES_NOT_HANDLED;
@@ -755,7 +755,7 @@
 	return AllocateWindowDescFront<ScenarioEditorLandscapeGenerationWindow>(&_scen_edit_land_gen_desc, 0);
 }
 
-EventState TerraformToolbarEditorGlobalHotkeys(uint16 key, uint16 keycode)
+EventState TerraformToolbarEditorGlobalHotkeys(WChar key, uint16 keycode)
 {
 	int num = CheckHotkeyMatch<ScenarioEditorLandscapeGenerationWindow>(_terraform_editor_hotkeys, keycode, NULL, true);
 	if (num == -1) return ES_NOT_HANDLED;