Commit 6731a579 authored by Thomas Bernard's avatar Thomas Bernard 💬

escape non ascii chars to HEX \xNN in C source (not in comments)

add "" where needed.

also fix extra space at end of lines (only in modified files)
parent b8ac7729
......@@ -259,7 +259,7 @@ byte Rightclick_colorpick(byte cursor_visible)
if (!Config.Right_click_colorpick)
return 0;
if (Mouse_K!=RIGHT_SIDE)
return 0;
return 0;
// In these modes, the Foreground color is ignored,
// so the RMB should act as normal.
if (Shade_mode||Quick_shade_mode||Tiling_mode)
......@@ -268,20 +268,20 @@ byte Rightclick_colorpick(byte cursor_visible)
Colorpicker_color=-1;
Colorpicker_X=-1;
Colorpicker_Y=-1;
if (cursor_visible)
Hide_cursor();
Start_operation_stack(OPERATION_RMB_COLORPICK);
Init_start_operation();
// Just an indicator to go to next step
Operation_push(1);
Rightclick_colorpick_2_1();
if (cursor_visible)
Display_cursor();
return 1;
}
......@@ -333,13 +333,13 @@ void Rightclick_colorpick_0_1(void)
short dummy;
Hide_cursor();
Operation_pop(&dummy);
Set_fore_color(Colorpicker_color);
// Restore previous operation
Start_operation_stack(Operation_before_interrupt);
// Erase the color block which shows the picked color
if (Operation_before_interrupt!=OPERATION_REPLACE)
if ( (Mouse_Y<Menu_Y) && (Menu_is_visible) &&
......@@ -347,7 +347,7 @@ void Rightclick_colorpick_0_1(void)
Print_in_menu("X: Y: ",0);
Print_coordinates();
Display_cursor();
}
......@@ -490,7 +490,7 @@ void Brush_0_5(void)
Brush_offset_X=(Brush_offset_X/Snap_width)*Snap_width;
Brush_offset_Y=(Brush_offset_Y/Snap_height)*Snap_height;
}
End_of_modification();
Return_to_draw_mode();
}
......@@ -618,7 +618,7 @@ void Polybrush_12_8(void)
Brush_offset_X=(Brush_offset_X/Snap_width)*Snap_width;
Brush_offset_Y=(Brush_offset_Y/Snap_height)*Snap_height;
}
Return_to_draw_mode();
Display_cursor();
}
......@@ -926,7 +926,7 @@ void Rotate_brush_12_0(void)
Operation_push(1); // State prcdent
if ((Config.Coords_rel) && (Menu_is_visible))
Print_in_menu("Angle: 0 ",0);
Print_in_menu("Angle: 0\xb0 ",0);
}
else
{
......@@ -995,7 +995,7 @@ void Rotate_brush_1_5(void)
Operation_push(cursor_x);
Operation_push(cursor_y);
}
Operation_push(cursor_x);
Operation_push(cursor_y);
......@@ -1023,7 +1023,7 @@ void Rotate_brush_0_5(void)
double angle=0.0;
int dx,dy;
short cursor_x, cursor_y;
Operation_pop(&prev_state);
Operation_pop(&old_y);
......@@ -1188,32 +1188,32 @@ void Distort_brush_1_0(void)
Init_start_operation();
Paintbrush_hidden=1;
Hide_cursor();
// Top left angle
x_pos=Paintbrush_X-Brush_offset_X;
y_pos=Paintbrush_Y-Brush_offset_Y;
Draw_stretch_spot(x_pos,y_pos);
Operation_push(x_pos);
Operation_push(y_pos);
// Top right angle
x_pos+=Brush_width;
Draw_stretch_spot(x_pos,y_pos);
Operation_push(x_pos);
Operation_push(y_pos);
// Bottom right angle
y_pos+=Brush_height;
Draw_stretch_spot(x_pos,y_pos);
Operation_push(x_pos);
Operation_push(y_pos);
// Bottom left angle
x_pos-=Brush_width;
Draw_stretch_spot(x_pos,y_pos);
Operation_push(x_pos);
Operation_push(y_pos);
Distort_brush_preview(
Operation_stack[1],
Operation_stack[2],
......@@ -1262,13 +1262,13 @@ void Distort_brush_1_8(void)
best_distance=distance;
}
}
for (i=0;i<4;i++)
{
Operation_push(x[i]);
Operation_push(y[i]);
}
if (best_spot>-1)
{
Operation_push(best_spot);
......@@ -1301,11 +1301,11 @@ void Distort_brush_1_9(void)
Operation_pop(&y[i]);
Operation_pop(&x[i]);
}
if (Paintbrush_X!=x[selected_corner] || Paintbrush_Y!=y[selected_corner])
{
{
Hide_cursor();
// Easiest refresh mode: make no assumptions on how the brush was
// displayed before.
Display_all_screen();
......@@ -1319,7 +1319,7 @@ void Distort_brush_1_9(void)
Distort_brush_preview(x[0],y[0],x[1],y[1],x[2],y[2],x[3],y[3]);
Display_cursor();
if ( (Config.Coords_rel) && (Menu_is_visible) )
{
Print_in_menu("X: Y: ",0);
......@@ -1327,7 +1327,7 @@ void Distort_brush_1_9(void)
}
Update_rect(0,0,Screen_width,Menu_Y);
}
// Push back all arguments
for (i=0;i<4;i++)
{
......@@ -1348,7 +1348,7 @@ void Distort_brush_0_9(void)
{
short selected_corner;
Operation_pop(&selected_corner);
}
void Distort_brush_2_0(void)
......@@ -1390,10 +1390,10 @@ void Distort_brush_2_8(void)
Operation_pop(&x[i]);
}
Distort_brush(x[0],y[0],x[1],y[1],x[2],y[2],x[3],y[3]);
Paintbrush_hidden=0;
Display_all_screen();
Return_to_draw_mode();
}
This diff is collapsed.
......@@ -203,8 +203,8 @@ static const T_Help_table helptable_help[] =
HELP_LINK ("Restore brush: %s", 0x200+BUTTON_BRUSH)
HELP_LINK ("Flip brush X: %s", SPECIAL_FLIP_X)
HELP_LINK ("Flip brush Y: %s", SPECIAL_FLIP_Y)
HELP_LINK ("90 brush rotation: %s", SPECIAL_ROTATE_90)
HELP_LINK ("180 brush rotation: %s", SPECIAL_ROTATE_180)
HELP_LINK ("90\xb0 brush rotation: %s", SPECIAL_ROTATE_90)
HELP_LINK ("180\xb0 brush rotation: %s", SPECIAL_ROTATE_180)
HELP_LINK ("Stretch brush: %s", SPECIAL_STRETCH)
HELP_LINK ("Distort brush: %s", SPECIAL_DISTORT)
HELP_LINK ("Outline brush: %s", SPECIAL_OUTLINE)
......@@ -456,7 +456,7 @@ static const T_Help_table helptable_credits[] =
HELP_TEXT ("")
HELP_BOLD (" FREEBSD PORT")
HELP_TEXT ("")
HELP_TEXT (" Jean-Baptiste Berlioz (Tob)")
HELP_TEXT (" Jean-Baptiste Berlioz (Tob\xe9)")
HELP_TEXT ("")
HELP_BOLD (" OPENBSD PORT")
HELP_TEXT ("")
......@@ -470,7 +470,7 @@ static const T_Help_table helptable_credits[] =
HELP_BOLD (" LINUX BINARIES")
HELP_TEXT ("")
HELP_TEXT (" Gentoo : Matteo 'Peach' Pescarin")
HELP_TEXT (" Debian : Grkan Sengn")
HELP_TEXT (" Debian : G\xfcrkan Seng\xfcn")
HELP_TEXT (" Android : pelya")
HELP_TEXT ("")
HELP_BOLD (" WIZ & CAANOO PORT")
......@@ -495,7 +495,7 @@ static const T_Help_table helptable_credits[] =
HELP_TEXT (" DarkDefende DawnBringer El Topo ")
HELP_TEXT (" falenblood fanickbux fano ")
HELP_TEXT (" finticemo fogbot121 freehand ")
HELP_TEXT (" Frost Grimmy Grkan Sengn")
HELP_TEXT (" Frost Grimmy G\xfcrkan Seng\xfcn")
HELP_TEXT (" Hatch HoraK-FDF iLKke ")
HELP_TEXT (" Iw2evk jackfrost128 Jamon ")
HELP_TEXT (" keito kusma lmemsm ")
......@@ -506,7 +506,7 @@ static const T_Help_table helptable_credits[] =
HELP_TEXT (" Ravey1138 richienyhus rixard ")
HELP_TEXT (" sm4tik spratek Surt ")
HELP_TEXT (" tape.yrm TeeEmCee tempest ")
HELP_TEXT (" Timo Kurrpa titus^Rab Tob ")
HELP_TEXT (" Timo Kurrpa titus^Rab Tob\xe9 ")
HELP_TEXT (" yakumo2975 00ai99")
HELP_TEXT (" ... posted the annoying bug reports.")
HELP_TEXT ("")
......@@ -564,7 +564,7 @@ static const T_Help_table helptable_credits[] =
HELP_TEXT (" Acryl Fred Prowler")
HELP_TEXT (" Alexel FreddyV Puznik")
HELP_TEXT (" Alias Frost Quick")
HELP_TEXT (" Amiral Gal(GDC) Ra")
HELP_TEXT (" Amiral Ga\xebl(GDC) Ra")
HELP_TEXT (" Arrakis GainX Raster")
HELP_TEXT (" Avocado Gandalf Ravian")
HELP_TEXT (" Baloo Goblin RedBug")
......@@ -575,10 +575,10 @@ static const T_Help_table helptable_credits[] =
HELP_TEXT (" BlackAxe Haplo Sam")
HELP_TEXT (" Bonnie Hof SandMan")
HELP_TEXT (" Boo Hornet Scape")
HELP_TEXT (" Boz Hulud Sbastien")
HELP_TEXT (" Boz Hulud S\xe9""bastien")
HELP_TEXT (" Carine Java Shodan")
HELP_TEXT (" Chandra JBT Skal")
HELP_TEXT (" Cheetah Jrme Skyfire")
HELP_TEXT (" Cheetah J\xe9r\xf4me Skyfire")
HELP_TEXT (" Chill Julien(JCA) Sphair")
HELP_TEXT (" Cougar KalMinDo Sprocket")
HELP_TEXT (" Cremax KaneWood Stef")
......@@ -793,7 +793,7 @@ static const T_Help_table helptable_adjust[] =
HELP_TEXT ("")
HELP_TEXT ("In 'Ratio' mode, you can set 2 numbers for")
HELP_TEXT ("each dimension, and the resizing factor will")
HELP_TEXT ("be of 'new''old'. For example you can use")
HELP_TEXT ("be of 'new'\xf7'old'. For example you can use")
HELP_TEXT ("1:3 to divide the image by three, 2:1 to")
HELP_TEXT ("double it, and any fraction like 15:16.")
HELP_TEXT ("")
......@@ -810,12 +810,12 @@ static const T_Help_table helptable_adjust[] =
HELP_TEXT ("")
HELP_BOLD ("ROTATE")
HELP_TEXT ("")
HELP_TEXT ("-90: Rotates the image by 90")
HELP_TEXT ("-90\xb0: Rotates the image by 90\xb0")
HELP_TEXT (" clockwise.")
HELP_TEXT ("")
HELP_TEXT ("+90: Rotates the image by 90")
HELP_TEXT ("+90\xb0: Rotates the image by 90\xb0")
HELP_TEXT (" counter-clockwise.")
HELP_TEXT ("180: Rotates the image by 180")
HELP_TEXT ("180\xb0: Rotates the image by 180\xb0")
HELP_TEXT ("")
HELP_TEXT ("")
};
......@@ -1301,10 +1301,10 @@ static const T_Help_table helptable_brush_fx[] =
HELP_LINK ("- Y: (Key:%s)",SPECIAL_FLIP_Y)
HELP_TEXT ("Flip vertically.")
HELP_TEXT ("")
HELP_LINK ("- Rotate by 90: (Key:%s)",SPECIAL_ROTATE_90)
HELP_LINK ("- Rotate by 90\xb0: (Key:%s)",SPECIAL_ROTATE_90)
HELP_TEXT ("Rotates the brush by an angle of 90 degrees.")
HELP_TEXT ("")
HELP_LINK ("- Rotate by 180: (Key:%s)",SPECIAL_ROTATE_180)
HELP_LINK ("- Rotate by 180\xb0: (Key:%s)",SPECIAL_ROTATE_180)
HELP_TEXT ("Rotates the brush by an angle of 180")
HELP_TEXT ("degrees.")
HELP_TEXT ("")
......@@ -2515,14 +2515,14 @@ static const T_Help_table helptable_settings_details[] =
HELP_TEXT ("window. (Set it to 'no' if you have a slow")
HELP_TEXT ("computer or if you edit huge pictures)")
HELP_TEXT ("")
HELP_BOLD (" Right click colorpick")
HELP_BOLD (" Right click colorpick")
HELP_TEXT ("This enables a mode where the right mouse")
HELP_TEXT ("buttons acts as a color picker until")
HELP_TEXT ("it's released, and selects Foreground color.")
HELP_TEXT ("This mode prevents you from painting with")
HELP_TEXT ("it's released, and selects Foreground color.")
HELP_TEXT ("This mode prevents you from painting with")
HELP_TEXT ("Background color.")
HELP_TEXT ("This option is ignored when the Shade,")
HELP_TEXT ("Quick-shade, or Tiling mode is used.")
HELP_TEXT ("Quick-shade, or Tiling mode is used.")
HELP_TEXT ("")
HELP_TEXT (" Multi shortcuts")
HELP_TEXT ("When this setting is disabled, and you")
......@@ -2909,7 +2909,7 @@ static const T_Help_table helptable_layertrans[] =
HELP_TEXT ("")
HELP_TEXT ("The current Background color becomes the")
HELP_TEXT ("color considered transparent for the layers.")
};
static const T_Help_table helptable_layermerge[] =
{
......@@ -3138,7 +3138,7 @@ T_Help_section Help_section[] =
HELP_TABLE_DECLARATION(helptable_pal_scroll)
HELP_TABLE_DECLARATION(helptable_color_select)
// End of buttons list
// NB_BUTTONS+0
HELP_TABLE_DECLARATION(helptable_settings_details)
// NB_BUTTONS+1
......@@ -3146,5 +3146,5 @@ T_Help_section Help_section[] =
// NB_BUTTONS+2
// HELP_TABLE_DECLARATION()
// ...
};
......@@ -689,17 +689,17 @@ T_Key_config ConfigKey[NB_SHORTCUTS] = {
SDLK_y, // Y
0},
{72,
"90 brush rotation",
"Rotate the user-defined brush by 90",
"90\xb0 brush rotation",
"Rotate the user-defined brush by 90\xb0",
"(counter-clockwise).",
"",
true,
SDLK_z, // Z (W en AZERTY)
0},
{73,
"180 brush rotation",
"180\xb0 brush rotation",
"Rotate the user-defined brush by",
"180.",
"180\xb0.",
"",
true,
SDLK_z|MOD_SHIFT, // Shift + Z
......@@ -1981,7 +1981,7 @@ word Ordering[NB_SHORTCUTS]=
SPECIAL_BIGGER_PAINTBRUSH, // Sets paintbrush size: bigger
SPECIAL_EFFECTS_OFF, // Turns off all effects
SPECIAL_TRANSPARENCY_1, // Sets transparency level 10%
SPECIAL_TRANSPARENCY_2, // Sets transparency level 20%
SPECIAL_TRANSPARENCY_2, // Sets transparency level 20%
SPECIAL_TRANSPARENCY_3, // Sets transparency level 30%
SPECIAL_TRANSPARENCY_4, // Sets transparency level 40%
SPECIAL_TRANSPARENCY_5, // Sets transparency level 50%
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -42,7 +42,7 @@ void Factorize(short *a, short *b)
{
// Method: brute-force.
short factor;
factor=2;
while (factor<=*a && factor<=*b)
{
......@@ -79,7 +79,7 @@ void Button_Transform_menu(int btn)
UNIT_PERCENT = 2,
UNIT_RATIO = 3
};
char buffer[5];
short clicked_button;
const char * unit_label[] = {
......@@ -95,11 +95,11 @@ void Button_Transform_menu(int btn)
short new_width=Main.image_width;
short new_height=Main.image_height;
byte need_display_size = 0;
// Persistent data
static short unit_index = 1; // 1= Pixels, 2= Percent, 3=Ratio
static short ratio_is_locked = 1; // True if X and Y resize should go together
T_Dropdown_button * unit_button;
T_Special_button * input_button[4];
short *input_value[4];
......@@ -109,7 +109,7 @@ void Button_Transform_menu(int btn)
new_ratio_width=old_ratio_width=new_ratio_height=old_ratio_height=100;
else
new_ratio_width=old_ratio_width=new_ratio_height=old_ratio_height=1;
Open_window(215,165,"Picture transform");
Window_display_frame( 5, 15,205,91);
......@@ -123,9 +123,9 @@ void Button_Transform_menu(int btn)
Window_set_normal_button( 17,140, 27,14,"Y\022" ,1,1,SDLK_y); // 3
Print_in_window( 84,114,"Rotate",MC_Dark,MC_Light);
Window_set_normal_button( 69,125, 37,14,"-90" ,0,1,SDLK_LAST); // 4
Window_set_normal_button(107,125, 37,14,"+90" ,0,1,SDLK_LAST); // 5
Window_set_normal_button( 69,140, 75,14,"180" ,0,1,SDLK_LAST); // 6
Window_set_normal_button( 69,125, 37,14,"-90\xb0" ,0,1,SDLK_LAST); // 4
Window_set_normal_button(107,125, 37,14,"+90\xb0" ,0,1,SDLK_LAST); // 5
Window_set_normal_button( 69,140, 75,14,"180\xb0" ,0,1,SDLK_LAST); // 6
Print_in_window( 87, 19,"Resize",MC_Dark,MC_Light);
Window_set_normal_button( 80, 86, 60,14,"RESIZE",1,1,SDLK_r); // 7
......@@ -142,14 +142,14 @@ void Button_Transform_menu(int btn)
Window_dropdown_add_item(unit_button,UNIT_PIXELS,unit_label[UNIT_PIXELS]);
Window_dropdown_add_item(unit_button,UNIT_PERCENT,unit_label[UNIT_PERCENT]);
Window_dropdown_add_item(unit_button,UNIT_RATIO,unit_label[UNIT_RATIO]);
input_button[0] = Window_set_input_button_s(45,43,4,SDLK_w); // 10
input_button[1] = Window_set_input_button(89,43,4); // 11
input_button[2] = Window_set_input_button_s(45,58,4,SDLK_h); // 12
input_button[3] = Window_set_input_button(89,58,4); // 13
Update_window_area(0,0,Window_width, Window_height);
Display_cursor();
do
......@@ -191,9 +191,9 @@ void Button_Transform_menu(int btn)
Display_cursor();
need_display_size=0;
}
clicked_button=Window_clicked_button();
// Contextual help
if (Is_shortcut(Key,0x100+BUTTON_HELP))
{
......@@ -202,7 +202,7 @@ void Button_Transform_menu(int btn)
}
else if (Is_shortcut(Key,0x200+BUTTON_ADJUST))
clicked_button=1;
else switch(clicked_button)
{
case 9: // Unit
......@@ -249,12 +249,12 @@ void Button_Transform_menu(int btn)
Factorize(&new_ratio_width, &old_ratio_width);
Factorize(&new_ratio_height, &old_ratio_height);
}
break;
break;
}
unit_index = Window_attribute2;
break;
case 8: // Lock proportions
ratio_is_locked = ! ratio_is_locked;
Hide_cursor();
......@@ -271,7 +271,7 @@ void Button_Transform_menu(int btn)
case 12: // input new height
Num2str(*( input_value[clicked_button-10]),buffer,4);
Hide_cursor();
if (Readline(input_button[clicked_button-10]->Pos_X+2,
if (Readline(input_button[clicked_button-10]->Pos_X+2,
input_button[clicked_button-10]->Pos_Y+2,
buffer,
4,
......@@ -299,7 +299,7 @@ void Button_Transform_menu(int btn)
// Copy the whole ratio
new_ratio_height=new_ratio_width;
old_ratio_height=old_ratio_width;
}
}
}
else // (clicked_button == 12 || clicked_button == 13)
{
......@@ -313,10 +313,10 @@ void Button_Transform_menu(int btn)
// Copy the whole ratio
new_ratio_width=new_ratio_height;
old_ratio_width=old_ratio_height;
}
}
}
}
}
// Re-compute ratio from size in pixels
if (unit_index == UNIT_PIXELS)
{
......@@ -337,7 +337,7 @@ void Button_Transform_menu(int btn)
while (clicked_button<=0 || clicked_button>=8);
Close_window();
// The Scroll operation uses the same button as transformation menu.
if (Current_operation != OPERATION_SCROLL)
Unselect_button(btn);
......@@ -346,7 +346,7 @@ void Button_Transform_menu(int btn)
{
short old_width;
short old_height;
// Determine new image dimensions
switch (clicked_button)
{
......@@ -354,15 +354,15 @@ void Button_Transform_menu(int btn)
// Keep new_width and new_height as entered.
break;
case 2 : // Flip X
case 3 : // Flip Y
case 3 : // Flip Y
case 6 : // 180 Rotation
new_width=Main.image_width;
new_height=Main.image_height;
break;
case 4 : // -90 Rotation
case 5 : // +90 Rotation
new_width=Main.image_height;
new_height=Main.image_width;
break;
......@@ -370,20 +370,20 @@ void Button_Transform_menu(int btn)
// Memorize the current dimensions
old_width=Main.image_width;
old_height=Main.image_height;
Upload_infos_page(&Main);
// Allocate a new page
if (Backup_with_new_dimensions(new_width,new_height))
{
// The new image is allocated, the new dimensions are already updated.
Main.image_is_modified=1;
// Process the transformation:
switch(clicked_button)
{
int i;
case 2 : // Flip X
for (i=0; i<Main.backups->Pages->Nb_layers; i++)
{
......@@ -391,7 +391,7 @@ void Button_Transform_menu(int btn)
Flip_X_lowlevel(Main.backups->Pages->Image[i].Pixels, Main.image_width, Main.image_height);
}
break;
case 3 : // Flip Y
case 3 : // Flip Y
for (i=0; i<Main.backups->Pages->Nb_layers; i++)
{
memcpy(Main.backups->Pages->Image[i].Pixels,Main.backups->Pages->Next->Image[i].Pixels,Main.image_width*Main.image_height);
......@@ -416,7 +416,7 @@ void Button_Transform_menu(int btn)
memcpy(Main.backups->Pages->Image[i].Pixels,Main.backups->Pages->Next->Image[i].Pixels,Main.image_width*Main.image_height);
Rotate_180_deg_lowlevel(Main.backups->Pages->Image[i].Pixels, Main.image_width, Main.image_height);
}
break;
break;
case 7 : // Resize
for (i=0; i<Main.backups->Pages->Nb_layers; i++)
{
......
......@@ -1043,7 +1043,7 @@ void Print_filename(void)
// Determine maximum size, in characters
max_size = 12 + (Screen_width / Menu_factor_X - 320) / 8;
// Erase whole area
Block(Screen_width-max_size*8*Menu_factor_X,
Menu_status_Y,Menu_factor_X*max_size*8,Menu_factor_Y<<3,MC_Light);
......@@ -1275,7 +1275,7 @@ void Print_counter(short x,short y,const char * str,byte text_color,byte backgro
case '-':
char_number=12;
break;
case '':
case '\xb1':
char_number=13;
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment