change all references to SDLK_xxxxx to KEY_xxxx

+ some fixes
This commit is contained in:
Thomas Bernard
2018-05-31 16:44:04 +02:00
parent 77005eb780
commit 4d86b8a0c1
31 changed files with 863 additions and 542 deletions

View File

@@ -79,6 +79,7 @@
#include "tiles.h"
#include "setup.h"
#include "unicode.h"
#include "keycodes.h"
#if defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
#include <proto/dos.h>
@@ -109,7 +110,7 @@ void Bouton_***(void)
Open_window(310,190,"***");
Window_set_normal_button(103,137,80,14,"OK",0,1,SDLK_RETURN); // 1
Window_set_normal_button(103,137,80,14,"OK",0,1,KEY_RETURN); // 1
Window_set_scroller_button(18,44,88,16,4,0); // 2
Update_window_area(0,0,Window_width, Window_height);
@@ -137,13 +138,13 @@ void Message_out_of_memory(void)
Print_in_window(8,20,"Please consult the manual",MC_Black,MC_Light);
Print_in_window(24,28,"to know how to obtain",MC_Black,MC_Light);
Print_in_window(36,36,"more memory space.",MC_Black,MC_Light);
Window_set_normal_button(60,53,40,14,"OK",1,1,SDLK_RETURN); // 1
Window_set_normal_button(60,53,40,14,"OK",1,1,KEY_RETURN); // 1
Update_window_area(0,0,Window_width, Window_height);
Display_cursor();
do
clicked_button=Window_clicked_button();
while ((clicked_button<=0) && (Key!=KEY_ESC) && (Key!=SDLK_o));
while ((clicked_button<=0) && (Key!=KEY_ESC) && (Key!=KEY_o));
if(clicked_button<=0) Key=0;
Close_window();
@@ -613,8 +614,8 @@ byte Button_Quit_local_function(void)
// On commence par afficher la fenêtre de QUIT
Open_window(160,84,"Quit ?");
Window_set_normal_button(20,20,120,14,"Stay",0,1,KEY_ESC); // 1
Window_set_normal_button(20,40,120,14,"Save & quit",1,1,SDLK_s); // 2
Window_set_normal_button(20,60,120,14,"Discard (Quit)",1,1,SDLK_d);// 3
Window_set_normal_button(20,40,120,14,"Save & quit",1,1,KEY_s); // 2
Window_set_normal_button(20,60,120,14,"Discard (Quit)",1,1,KEY_d);// 3
Update_window_area(0,0,Window_width, Window_height);
Display_cursor();
@@ -1035,11 +1036,11 @@ void Button_Settings(int btn)
Open_window(307,182,"Settings");
// Button Reload
Window_set_normal_button( 6,163, 51,14,"Reload" ,1,1,SDLK_r); // 1
Window_set_normal_button( 6,163, 51,14,"Reload" ,1,1,KEY_r); // 1
// Button Auto-save
Window_set_normal_button( 73,163,107,14,"Auto-save: ",1,1,SDLK_a); // 2
Window_set_normal_button( 73,163,107,14,"Auto-save: ",1,1,KEY_a); // 2
// Button Save
Window_set_normal_button(183,163, 51,14,"Save" ,1,1,SDLK_s); // 3
Window_set_normal_button(183,163, 51,14,"Save" ,1,1,KEY_s); // 3
// Button Close
Window_set_normal_button(250,163, 51,14,"Close" ,0,1,KEY_ESC); // 4
@@ -1165,7 +1166,7 @@ void Button_Settings(int btn)
else if (Is_shortcut(Key,0x100+BUTTON_SETTINGS))
clicked_button=4;
}
while ( (clicked_button!=4) && (Key!=SDLK_RETURN) );
while ( (clicked_button!=4) && (Key!=KEY_RETURN) );
// Checks on change
if (Config.Show_hidden_directories!=selected_config.Show_hidden_directories
@@ -1327,7 +1328,7 @@ void Button_Skins(int btn)
Print_in_window( 172, 59,"Cursor:" ,MC_Black,MC_Light);
// Ok button
Window_set_normal_button(6, 120, 51, 14, "OK", 0, 1, SDLK_RETURN); // 1
Window_set_normal_button(6, 120, 51, 14, "OK", 0, 1, KEY_RETURN); // 1
// List of skins
skin_list = Window_set_list_button(
@@ -1346,7 +1347,7 @@ void Button_Skins(int btn)
Window_dropdown_add_item(font_dropdown,temp,Get_item_by_index(&Font_files_list,temp)->Short_name);
// Cancel
Window_set_normal_button(61, 120, 51,14,"Cancel",0,1,SDLK_ESCAPE); // 6
Window_set_normal_button(61, 120, 51,14,"Cancel",0,1,KEY_ESCAPE); // 6
// Dropdown list to choose cursor type
cursor_dropdown = Window_set_dropdown_button(172, 69, 104, 11, 0,
@@ -1488,7 +1489,7 @@ void Button_Skins(int btn)
break;
}
}
while ( (clicked_button!=1) && (clicked_button !=6) && (Key != SDLK_ESCAPE));
while ( (clicked_button!=1) && (clicked_button !=6) && (Key != KEY_ESCAPE));
if(clicked_button == 1)
{
@@ -1688,11 +1689,11 @@ void Button_Copy_page(int btn)
Open_window(168,137,"Copy to spare page");
Window_set_normal_button(10, 20,148,14,"Pixels + palette" , 0,1,SDLK_RETURN); // 1
Window_set_normal_button(10, 37,148,14,"Pixels only" , 3,1,SDLK_x); // 2
Window_set_normal_button(10, 54,148,14,"Palette only" , 1,1,SDLK_p); // 3
Window_set_normal_button(10, 71,148,14,"Some colors only" , 6,1,SDLK_c); // 4
Window_set_normal_button(10, 88,148,14,"Palette and remap",13,1,SDLK_r); // 5
Window_set_normal_button(10, 20,148,14,"Pixels + palette" , 0,1,KEY_RETURN); // 1
Window_set_normal_button(10, 37,148,14,"Pixels only" , 3,1,KEY_x); // 2
Window_set_normal_button(10, 54,148,14,"Palette only" , 1,1,KEY_p); // 3
Window_set_normal_button(10, 71,148,14,"Some colors only" , 6,1,KEY_c); // 4
Window_set_normal_button(10, 88,148,14,"Palette and remap",13,1,KEY_r); // 5
Window_set_normal_button(44,114, 80,14,"Cancel" , 0,1,KEY_ESC); // 6
Update_window_area(0,0,Window_width, Window_height);
@@ -1927,14 +1928,14 @@ void Button_Resolution(int btn)
Print_in_window( 12, 21,"Picture size:" ,MC_Dark,MC_Light);
Window_display_frame ( 8,17,195, 33);
Window_set_normal_button(223, 18,67,14,"OK" ,0,1,SDLK_RETURN); // 1
Window_set_normal_button(223, 18,67,14,"OK" ,0,1,KEY_RETURN); // 1
Window_set_normal_button(223, 35,67,14,"Cancel" ,0,1,KEY_ESC); // 2
Print_in_window_underscore( 12, 37,"Width:",MC_Dark,MC_Light,1);
input_width_button=Window_set_input_button_s( 60, 35,4,SDLK_w); // 3
input_width_button=Window_set_input_button_s( 60, 35,4,KEY_w); // 3
Print_in_window_underscore(108, 37,"Height:",MC_Dark,MC_Light,1);
input_button_height=Window_set_input_button_s(164, 35,4,SDLK_h); // 4
input_button_height=Window_set_input_button_s(164, 35,4,KEY_h); // 4
Window_display_frame ( 8,72,283,110);
Window_display_frame_in (37,84,228,84);
@@ -2099,7 +2100,7 @@ void Button_Resolution(int btn)
// Gestion des touches de déplacement dans la liste
switch (Key)
{
case SDLK_UP : // Haut
case KEY_UP : // Haut
if (cursor_position>0)
cursor_position--;
else
@@ -2108,7 +2109,7 @@ void Button_Resolution(int btn)
Scroll_list_of_modes(list_start,cursor_position,&selected_mode);
Key=0;
break;
case SDLK_DOWN : // Bas
case KEY_DOWN : // Bas
if (cursor_position<(MODELIST_LINES-1) && cursor_position<(Nb_video_modes-1))
cursor_position++;
else
@@ -2117,7 +2118,7 @@ void Button_Resolution(int btn)
Scroll_list_of_modes(list_start,cursor_position,&selected_mode);
Key=0;
break;
case SDLK_PAGEUP : // PageUp
case KEY_PAGEUP : // PageUp
if (cursor_position>0)
cursor_position=0;
else
@@ -2130,7 +2131,7 @@ void Button_Resolution(int btn)
Scroll_list_of_modes(list_start,cursor_position,&selected_mode);
Key=0;
break;
case SDLK_PAGEDOWN : // PageDown
case KEY_PAGEDOWN : // PageDown
if (Nb_video_modes<MODELIST_LINES)
cursor_position=Nb_video_modes-1;
else if (cursor_position<(MODELIST_LINES-1))
@@ -2145,13 +2146,13 @@ void Button_Resolution(int btn)
Scroll_list_of_modes(list_start,cursor_position,&selected_mode);
Key=0;
break;
case SDLK_HOME : // Home
case KEY_HOME : // Home
list_start=0;
cursor_position=0;
Scroll_list_of_modes(list_start,cursor_position,&selected_mode);
Key=0;
break;
case SDLK_END : // End
case KEY_END : // End
if (Nb_video_modes<MODELIST_LINES)
cursor_position=Nb_video_modes-1;
else
@@ -2559,12 +2560,12 @@ void Button_Gradients(int btn)
Main.backups->Pages->Gradients->Range[Current_gradient].Mix); // 3
// Direction
Window_set_normal_button(8,20,15,14,
(Main.backups->Pages->Gradients->Range[Current_gradient].Inverse)?"\033":"\032",0,1,SDLK_TAB); // 4
(Main.backups->Pages->Gradients->Range[Current_gradient].Inverse)?"\033":"\032",0,1,KEY_TAB); // 4
// Technique
Window_set_normal_button(8,90,15,14,"",0,1,SDLK_TAB|MOD_SHIFT); // 5
Window_set_normal_button(8,90,15,14,"",0,1,KEY_TAB|MOD_SHIFT); // 5
Draw_button_gradient_style(8,90,Main.backups->Pages->Gradients->Range[Current_gradient].Technique);
Window_set_normal_button(178,128,51,14,"OK",0,1,SDLK_RETURN); // 6
Window_set_normal_button(178,128,51,14,"OK",0,1,KEY_RETURN); // 6
Window_set_normal_button(123,128,51,14,"Cancel",0,1,KEY_ESC); // 7
// Scrolling speed
speed_scroller = Window_set_horizontal_scroller_button(99,111,130,106,1,Main.backups->Pages->Gradients->Range[Current_gradient].Speed); // 8
@@ -2743,8 +2744,8 @@ void Button_Gradients(int btn)
if (!Mouse_K)
switch (Key)
{
case SDLK_BACKQUOTE : // Récupération d'une couleur derrière le menu
case SDLK_COMMA :
case KEY_BACKQUOTE : // Récupération d'une couleur derrière le menu
case KEY_COMMA :
Get_color_behind_window(&color,&click);
if (click)
{
@@ -4177,42 +4178,42 @@ void Button_Airbrush_menu(int btn)
Open_window(226,170,"Spray");
Window_set_normal_button(110,148,51,14,"Cancel" ,0,1,KEY_ESC); // 1
Window_set_normal_button(166,148,51,14,"OK" ,0,1,SDLK_RETURN); // 2
Window_set_normal_button(166,148,51,14,"OK" ,0,1,KEY_RETURN); // 2
Window_set_scroller_button(178,62,74,50,1,49-Airbrush_multi_flow[selected_color]); // 3
Window_set_palette_button(7,56); // 4
Window_set_normal_button( 8,148,83,14,"Mode: ",0,1,SDLK_TAB); // 5
Window_set_normal_button( 8,148,83,14,"Mode: ",0,1,KEY_TAB); // 5
if (Airbrush_mode)
Print_in_window(50,151," Mono",MC_Black,MC_Light);
else
Print_in_window(50,151,"Multi",MC_Black,MC_Light);
Window_set_normal_button(194, 62,19,14,"+1" ,0,1,SDLK_KP_PLUS); // 6
Window_set_normal_button(194, 79,19,14,"-1" ,0,1,SDLK_KP_MINUS); // 7
Window_set_normal_button(194, 96,19,14,"x2" ,0,1,SDLK_KP_MULTIPLY); // 8
Window_set_normal_button(194,113,19,14,"\xf7""2" ,0,1,SDLK_KP_ENTER); // 9
Window_set_normal_button(194, 62,19,14,"+1" ,0,1,KEY_KP_PLUS); // 6
Window_set_normal_button(194, 79,19,14,"-1" ,0,1,KEY_KP_MINUS); // 7
Window_set_normal_button(194, 96,19,14,"x2" ,0,1,KEY_KP_MULTIPLY); // 8
Window_set_normal_button(194,113,19,14,"\xf7""2" ,0,1,KEY_KP_ENTER); // 9
Window_set_normal_button( 8, 37,43,14,"Clear" ,1,1,SDLK_c); // 10
Window_set_normal_button( 8, 37,43,14,"Clear" ,1,1,KEY_c); // 10
Print_in_window_underscore(142,25,"Size:" ,MC_Dark,MC_Light,1);
input_size_button = Window_set_input_button_s(186,23,3,SDLK_s); // 11
input_size_button = Window_set_input_button_s(186,23,3,KEY_s); // 11
Num2str(Airbrush_size,str,3);
Window_input_content(input_size_button,str);
Print_in_window_underscore(142,39,"Delay:" ,MC_Dark,MC_Light,1);
input_delay_button = Window_set_input_button_s(194,37,2,SDLK_d); // 12
input_delay_button = Window_set_input_button_s(194,37,2,KEY_d); // 12
Num2str(Airbrush_delay,str,2);
Window_input_content(input_delay_button,str);
Print_in_window_underscore( 27,24,"Mono-Flow:",MC_Dark,MC_Light,1);
input_flow_button = Window_set_input_button_s(111,22,2,SDLK_m); // 13
input_flow_button = Window_set_input_button_s(111,22,2,KEY_m); // 13
Num2str(Airbrush_mono_flow,str,2);
Window_input_content(input_flow_button,str);
Print_in_window_underscore( 67,40,"Init:",MC_Dark,MC_Light,1);
input_init_button = Window_set_input_button_s(111,38,2,SDLK_i); // 14
input_init_button = Window_set_input_button_s(111,38,2,KEY_i); // 14
Num2str(spray_init,str,2);
Window_input_content(input_init_button,str);
@@ -4426,8 +4427,8 @@ void Button_Airbrush_menu(int btn)
if (!Mouse_K)
switch (Key)
{
case SDLK_BACKQUOTE : // Récupération d'une couleur derrière le menu
case SDLK_COMMA :
case KEY_BACKQUOTE : // Récupération d'une couleur derrière le menu
case KEY_COMMA :
Get_color_behind_window(&color,&click);
if (click)
{
@@ -4616,14 +4617,14 @@ void Button_Effects(int btn)
Window_set_normal_button(C3, L2, 16,16,"",0,1,Config_Key[SPECIAL_GRID_MODE][0]); // 9
Window_set_normal_button(C3, L4, 16,16,"",0,1,Config_Key[SPECIAL_TILING_MODE][0]); // 10
Window_set_normal_button(195,131, 68,14,"Close",0,1,SDLK_RETURN); // 11
Window_set_normal_button(118,131, 68,14,"All off",0,1,SDLK_DELETE); // 12
Window_set_normal_button(195,131, 68,14,"Close",0,1,KEY_RETURN); // 11
Window_set_normal_button(118,131, 68,14,"All off",0,1,KEY_DELETE); // 12
// "Feedback" frame
Window_display_frame_mono(C1-5,L1+8,90,88,MC_Dark);
Window_rectangle(C1-1, L1+2, 78, 14, MC_Light);
Window_set_normal_button(C1+1,L1+2,14,14," ",0,1,SDLK_f); // 13
Window_set_normal_button(C1+1,L1+2,14,14," ",0,1,KEY_f); // 13
Print_in_window(28,24,"Feedback",MC_Dark,MC_Light);
Window_set_normal_button(C2, L4, 16,16,"",0,1,Config_Key[SPECIAL_FORMAT_CHECKER_MENU][0]); // 14
@@ -4974,19 +4975,19 @@ void Button_Text(int btn)
// Texte saisi
Print_in_window_underscore(6,20,"Text:",MC_Dark,MC_Light,1);
input_text_button = Window_set_input_button_s(48,18,29,SDLK_t); // 1
input_text_button = Window_set_input_button_s(48,18,29,KEY_t); // 1
// TrueType options
Window_display_frame_in(182,34,100,68);
Print_in_window(199,31,"TrueType", MC_Dark, MC_Light);
// AA
Window_set_normal_button(188,58,13,11,antialias?"X":" ",0,1,SDLK_a); // 2
Window_set_normal_button(188,58,13,11,antialias?"X":" ",0,1,KEY_a); // 2
Print_in_window_underscore(206,60,"AntiAlias", MC_Dark, MC_Light,5);
// Bold
Window_set_normal_button(188,72,13,11,is_bold?"X":" ",0,1,SDLK_b); // 3
Window_set_normal_button(188,72,13,11,is_bold?"X":" ",0,1,KEY_b); // 3
Print_in_window_underscore(206,75,"Bold", MC_Dark, MC_Light,1);
// Italic
Window_set_normal_button(188,86,13,11,is_italic?"X":" ",0,1,SDLK_i); // 4
Window_set_normal_button(188,86,13,11,is_italic?"X":" ",0,1,KEY_i); // 4
Print_in_window_underscore(206,89,"Italic", MC_Dark, MC_Light,1);
// Scroller des fontes
@@ -4996,7 +4997,7 @@ void Button_Text(int btn)
Window_display_frame_in(7, 33, 154, NB_FONTS*8+4);
// Taille texte
input_size_button = Window_set_input_button_s(220,43,3,SDLK_s); // 7
input_size_button = Window_set_input_button_s(220,43,3,KEY_s); // 7
Window_set_repeatable_button(202,43,13,11,"-",0,1,KEY_NONE); // 8
Window_set_repeatable_button(251,43,13,11,"+",0,1,KEY_NONE); // 9
@@ -5004,7 +5005,7 @@ void Button_Text(int btn)
preview_button = Window_set_special_button(8,106,273,50,0); // 10
Window_display_frame_in(7, 105, 275, 52);
Window_set_normal_button(8,160,40,14,"OK",0,1,SDLK_RETURN); // 11
Window_set_normal_button(8,160,40,14,"OK",0,1,KEY_RETURN); // 11
Window_set_normal_button(54,160,60,14,"Cancel",0,1,KEY_ESC); // 12
// List of fonts