Massive change of button callback function prototypes
This commit is contained in:
parent
f2d579695c
commit
30f23b93ef
277
src/buttons.c
277
src/buttons.c
@ -240,7 +240,7 @@ void Change_paintbrush_shape(byte shape)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------- UNDO/REDO ---------------------------------
|
//-------------------------------- UNDO/REDO ---------------------------------
|
||||||
void Button_Undo(void)
|
void Button_Undo(int btn)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Undo();
|
Undo();
|
||||||
@ -249,13 +249,13 @@ void Button_Undo(void)
|
|||||||
|
|
||||||
Check_menu_mode();
|
Check_menu_mode();
|
||||||
Display_all_screen();
|
Display_all_screen();
|
||||||
Unselect_button(BUTTON_UNDO);
|
Unselect_button(btn);
|
||||||
Draw_menu_button(BUTTON_MAGNIFIER,Main.magnifier_mode);
|
Draw_menu_button(BUTTON_MAGNIFIER,Main.magnifier_mode);
|
||||||
Display_menu();
|
Display_menu();
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Redo(void)
|
void Button_Redo(int btn)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Redo();
|
Redo();
|
||||||
@ -264,15 +264,14 @@ void Button_Redo(void)
|
|||||||
|
|
||||||
Check_menu_mode();
|
Check_menu_mode();
|
||||||
Display_all_screen();
|
Display_all_screen();
|
||||||
Unselect_button(BUTTON_UNDO);
|
Unselect_button(btn);
|
||||||
Draw_menu_button(BUTTON_MAGNIFIER,Main.magnifier_mode);
|
Draw_menu_button(BUTTON_MAGNIFIER,Main.magnifier_mode);
|
||||||
Display_menu();
|
Display_menu();
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//---------------------------- SCROLL PALETTE LEFT ---------------------------
|
//---------------------------- SCROLL PALETTE LEFT ---------------------------
|
||||||
void Button_Pal_left(void)
|
void Button_Pal_left(int btn)
|
||||||
{
|
{
|
||||||
short cells;
|
short cells;
|
||||||
cells = (Config.Palette_vertical)?Palette_cells_X():Palette_cells_Y();
|
cells = (Config.Palette_vertical)?Palette_cells_X():Palette_cells_Y();
|
||||||
@ -286,11 +285,11 @@ void Button_Pal_left(void)
|
|||||||
First_color_in_palette=0;
|
First_color_in_palette=0;
|
||||||
Display_menu_palette();
|
Display_menu_palette();
|
||||||
}
|
}
|
||||||
Unselect_button(BUTTON_PAL_LEFT);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Pal_left_fast(void)
|
void Button_Pal_left_fast(int btn)
|
||||||
{
|
{
|
||||||
short cells_x = Palette_cells_X();
|
short cells_x = Palette_cells_X();
|
||||||
short cells_y = Palette_cells_Y();
|
short cells_y = Palette_cells_Y();
|
||||||
@ -304,13 +303,13 @@ void Button_Pal_left_fast(void)
|
|||||||
First_color_in_palette=0;
|
First_color_in_palette=0;
|
||||||
Display_menu_palette();
|
Display_menu_palette();
|
||||||
}
|
}
|
||||||
Unselect_button(BUTTON_PAL_LEFT);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//--------------------------- SCROLL PALETTE RIGHT ---------------------------
|
//--------------------------- SCROLL PALETTE RIGHT ---------------------------
|
||||||
void Button_Pal_right(void)
|
void Button_Pal_right(int btn)
|
||||||
{
|
{
|
||||||
short cells;
|
short cells;
|
||||||
cells = (Config.Palette_vertical)?Palette_cells_X():Palette_cells_Y();
|
cells = (Config.Palette_vertical)?Palette_cells_X():Palette_cells_Y();
|
||||||
@ -322,11 +321,11 @@ void Button_Pal_right(void)
|
|||||||
Display_menu_palette();
|
Display_menu_palette();
|
||||||
}
|
}
|
||||||
|
|
||||||
Unselect_button(BUTTON_PAL_RIGHT);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Pal_right_fast(void)
|
void Button_Pal_right_fast(int btn)
|
||||||
{
|
{
|
||||||
short cells_x = Palette_cells_X();
|
short cells_x = Palette_cells_X();
|
||||||
short cells_y = Palette_cells_Y();
|
short cells_y = Palette_cells_Y();
|
||||||
@ -345,12 +344,12 @@ void Button_Pal_right_fast(void)
|
|||||||
}
|
}
|
||||||
Display_menu_palette();
|
Display_menu_palette();
|
||||||
}
|
}
|
||||||
Unselect_button(BUTTON_PAL_RIGHT);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------- item de la forecolor dans le menu --------------------
|
//-------------------- item de la forecolor dans le menu --------------------
|
||||||
void Button_Select_forecolor(void)
|
void Button_Select_forecolor(int btn)
|
||||||
{
|
{
|
||||||
static long time_click = 0;
|
static long time_click = 0;
|
||||||
long time_previous;
|
long time_previous;
|
||||||
@ -367,7 +366,7 @@ void Button_Select_forecolor(void)
|
|||||||
if (time_click - time_previous < Config.Double_click_speed)
|
if (time_click - time_previous < Config.Double_click_speed)
|
||||||
{
|
{
|
||||||
// Open palette window
|
// Open palette window
|
||||||
Button_Palette();
|
Button_Palette(btn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -384,8 +383,8 @@ void Button_Select_forecolor(void)
|
|||||||
while(Mouse_K)
|
while(Mouse_K)
|
||||||
{
|
{
|
||||||
Get_input(20);
|
Get_input(20);
|
||||||
|
|
||||||
if (Button_under_mouse()==BUTTON_CHOOSE_COL)
|
if (Button_under_mouse()==btn)
|
||||||
{
|
{
|
||||||
color=Pick_color_in_palette();
|
color=Pick_color_in_palette();
|
||||||
if (color != Fore_color && color!=-1)
|
if (color != Fore_color && color!=-1)
|
||||||
@ -401,7 +400,7 @@ void Button_Select_forecolor(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------- item de la backcolor dans le menu --------------------
|
//-------------------- item de la backcolor dans le menu --------------------
|
||||||
void Button_Select_backcolor(void)
|
void Button_Select_backcolor(int btn)
|
||||||
{
|
{
|
||||||
int color;
|
int color;
|
||||||
|
|
||||||
@ -421,14 +420,14 @@ void Button_Select_backcolor(void)
|
|||||||
{
|
{
|
||||||
Get_input(20);
|
Get_input(20);
|
||||||
|
|
||||||
if (Button_under_mouse()==BUTTON_CHOOSE_COL)
|
if (Button_under_mouse()==btn)
|
||||||
break; // This will repeat this button's action
|
break; // This will repeat this button's action
|
||||||
|
|
||||||
} while(Mouse_K);
|
} while(Mouse_K);
|
||||||
} while(Mouse_K);
|
} while(Mouse_K);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Hide_menu(void)
|
void Button_Hide_menu(int btn)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
if (Menu_is_visible)
|
if (Menu_is_visible)
|
||||||
@ -484,11 +483,11 @@ void Button_Hide_menu(void)
|
|||||||
if (Main.magnifier_mode)
|
if (Main.magnifier_mode)
|
||||||
Display_all_screen();
|
Display_all_screen();
|
||||||
}
|
}
|
||||||
Unselect_button(BUTTON_HIDE);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Toggle_toolbar(void)
|
void Button_Toggle_toolbar(int btn)
|
||||||
{
|
{
|
||||||
T_Dropdown_button dropdown;
|
T_Dropdown_button dropdown;
|
||||||
T_Dropdown_choice *item;
|
T_Dropdown_choice *item;
|
||||||
@ -562,11 +561,11 @@ void Button_Toggle_toolbar(void)
|
|||||||
// Closing
|
// Closing
|
||||||
Window_dropdown_clear_items(&dropdown);
|
Window_dropdown_clear_items(&dropdown);
|
||||||
|
|
||||||
Unselect_button(BUTTON_HIDE);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Toggle_all_toolbars(void)
|
void Button_Toggle_all_toolbars(int btn)
|
||||||
{
|
{
|
||||||
// This is used to memorize the bars' visibility when temporarily hidden
|
// This is used to memorize the bars' visibility when temporarily hidden
|
||||||
static word Last_visibility = 0xFFFF;
|
static word Last_visibility = 0xFFFF;
|
||||||
@ -598,7 +597,7 @@ void Button_Toggle_all_toolbars(void)
|
|||||||
Display_menu();
|
Display_menu();
|
||||||
Display_all_screen();
|
Display_all_screen();
|
||||||
|
|
||||||
Unselect_button(BUTTON_HIDE);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -672,7 +671,7 @@ byte Button_Quit_local_function(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Quit(void)
|
void Button_Quit(int btn)
|
||||||
{
|
{
|
||||||
//short clicked_button;
|
//short clicked_button;
|
||||||
|
|
||||||
@ -680,7 +679,7 @@ void Button_Quit(void)
|
|||||||
{
|
{
|
||||||
if (Spare.image_is_modified)
|
if (Spare.image_is_modified)
|
||||||
{
|
{
|
||||||
Button_Page(); // On passe sur le brouillon
|
Button_Page(btn); // On passe sur le brouillon
|
||||||
// Si l'utilisateur présente les derniers symptomes de l'abandon
|
// Si l'utilisateur présente les derniers symptomes de l'abandon
|
||||||
if (Button_Quit_local_function())
|
if (Button_Quit_local_function())
|
||||||
Quitting=1;
|
Quitting=1;
|
||||||
@ -700,7 +699,7 @@ void Button_Quit(void)
|
|||||||
|
|
||||||
|
|
||||||
//---------------------------- Effacer l'écran -------------------------------
|
//---------------------------- Effacer l'écran -------------------------------
|
||||||
void Button_Clear(void)
|
void Button_Clear(int btn)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Backup();
|
Backup();
|
||||||
@ -711,11 +710,11 @@ void Button_Clear(void)
|
|||||||
Redraw_layered_image();
|
Redraw_layered_image();
|
||||||
End_of_modification();
|
End_of_modification();
|
||||||
Display_all_screen();
|
Display_all_screen();
|
||||||
Unselect_button(BUTTON_CLEAR);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Clear_with_backcolor(void)
|
void Button_Clear_with_backcolor(int btn)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Backup();
|
Backup();
|
||||||
@ -726,7 +725,7 @@ void Button_Clear_with_backcolor(void)
|
|||||||
Redraw_layered_image();
|
Redraw_layered_image();
|
||||||
End_of_modification();
|
End_of_modification();
|
||||||
Display_all_screen();
|
Display_all_screen();
|
||||||
Unselect_button(BUTTON_CLEAR);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -943,7 +942,7 @@ void Settings_load_config(T_Config * conf)
|
|||||||
Error(0);
|
Error(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Settings(void)
|
void Button_Settings(int btn)
|
||||||
{
|
{
|
||||||
short clicked_button;
|
short clicked_button;
|
||||||
T_Config selected_config;
|
T_Config selected_config;
|
||||||
@ -1196,7 +1195,7 @@ void Button_Settings(void)
|
|||||||
Compute_optimal_menu_colors(Main.palette);
|
Compute_optimal_menu_colors(Main.palette);
|
||||||
|
|
||||||
Close_window();
|
Close_window();
|
||||||
Unselect_button(BUTTON_SETTINGS);
|
Unselect_button(btn);
|
||||||
// Raffichage du menu pour que les inscriptions qui y figurent soient
|
// Raffichage du menu pour que les inscriptions qui y figurent soient
|
||||||
// retracées avec la nouvelle fonte
|
// retracées avec la nouvelle fonte
|
||||||
Display_menu();
|
Display_menu();
|
||||||
@ -1275,7 +1274,7 @@ void Draw_one_skin_name(word x, word y, word index, byte highlighted)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Skin selector window
|
/// Skin selector window
|
||||||
void Button_Skins(void)
|
void Button_Skins(int btn)
|
||||||
{
|
{
|
||||||
short clicked_button;
|
short clicked_button;
|
||||||
short temp;
|
short temp;
|
||||||
@ -1293,7 +1292,7 @@ void Button_Skins(void)
|
|||||||
|
|
||||||
word x, y, x_pos, offs_y;
|
word x, y, x_pos, offs_y;
|
||||||
|
|
||||||
char * cursors[] = { "Solid", "Transparent", "Thin" };
|
const char * cursors[] = { "Solid", "Transparent", "Thin" };
|
||||||
T_Gui_skin * gfx = NULL;
|
T_Gui_skin * gfx = NULL;
|
||||||
byte * new_font;
|
byte * new_font;
|
||||||
|
|
||||||
@ -1525,7 +1524,7 @@ void Button_Skins(void)
|
|||||||
Set_palette(Main.palette);
|
Set_palette(Main.palette);
|
||||||
|
|
||||||
Close_window();
|
Close_window();
|
||||||
Unselect_button(BUTTON_SETTINGS);
|
Unselect_button(btn);
|
||||||
|
|
||||||
// Raffichage du menu pour que les inscriptions qui y figurent soient retracées avec la nouvelle fonte
|
// Raffichage du menu pour que les inscriptions qui y figurent soient retracées avec la nouvelle fonte
|
||||||
Display_menu();
|
Display_menu();
|
||||||
@ -1550,7 +1549,7 @@ void Button_Skins(void)
|
|||||||
|
|
||||||
|
|
||||||
//---------------------------- Changement de page ----------------------------
|
//---------------------------- Changement de page ----------------------------
|
||||||
void Button_Page(void)
|
void Button_Page(int btn)
|
||||||
{
|
{
|
||||||
byte factor_index;
|
byte factor_index;
|
||||||
T_Document temp_doc;
|
T_Document temp_doc;
|
||||||
@ -1594,7 +1593,7 @@ void Button_Page(void)
|
|||||||
Compute_optimal_menu_colors(Main.palette);
|
Compute_optimal_menu_colors(Main.palette);
|
||||||
Check_menu_mode();
|
Check_menu_mode();
|
||||||
Display_all_screen();
|
Display_all_screen();
|
||||||
Unselect_button(BUTTON_PAGE);
|
Unselect_button(btn);
|
||||||
Draw_menu_button(BUTTON_MAGNIFIER,Main.magnifier_mode);
|
Draw_menu_button(BUTTON_MAGNIFIER,Main.magnifier_mode);
|
||||||
// Tilemap mode might be different
|
// Tilemap mode might be different
|
||||||
Draw_menu_button(BUTTON_EFFECTS,Any_effect_active());
|
Draw_menu_button(BUTTON_EFFECTS,Any_effect_active());
|
||||||
@ -1683,7 +1682,7 @@ void Copy_some_colors(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Copy_page(void)
|
void Button_Copy_page(int btn)
|
||||||
{
|
{
|
||||||
short clicked_button;
|
short clicked_button;
|
||||||
|
|
||||||
@ -1767,13 +1766,13 @@ void Button_Copy_page(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Unselect_button(BUTTON_PAGE);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -- Suppression d'une page -------------------------------------------------
|
// -- Suppression d'une page -------------------------------------------------
|
||||||
void Button_Kill(void)
|
void Button_Kill(int btn)
|
||||||
{
|
{
|
||||||
if ( (Main.backups->List_size==1)
|
if ( (Main.backups->List_size==1)
|
||||||
|| (!Confirmation_box("Delete the current page?")) )
|
|| (!Confirmation_box("Delete the current page?")) )
|
||||||
@ -1781,7 +1780,7 @@ void Button_Kill(void)
|
|||||||
if (Main.backups->List_size==1)
|
if (Main.backups->List_size==1)
|
||||||
Warning_message("You can't delete the last page.");
|
Warning_message("You can't delete the last page.");
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Unselect_button(BUTTON_KILL);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1793,7 +1792,7 @@ void Button_Kill(void)
|
|||||||
Compute_optimal_menu_colors(Main.palette);
|
Compute_optimal_menu_colors(Main.palette);
|
||||||
|
|
||||||
Display_all_screen();
|
Display_all_screen();
|
||||||
Unselect_button(BUTTON_KILL);
|
Unselect_button(btn);
|
||||||
Draw_menu_button(BUTTON_MAGNIFIER,Main.magnifier_mode);
|
Draw_menu_button(BUTTON_MAGNIFIER,Main.magnifier_mode);
|
||||||
Display_menu();
|
Display_menu();
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
@ -1900,7 +1899,7 @@ void Scroll_list_of_modes(short list_start, short cursor_position, int * selecte
|
|||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Resolution(void)
|
void Button_Resolution(int btn)
|
||||||
{
|
{
|
||||||
short clicked_button;
|
short clicked_button;
|
||||||
int selected_mode;
|
int selected_mode;
|
||||||
@ -2215,18 +2214,18 @@ void Button_Resolution(void)
|
|||||||
Paintbrush_Y = Mouse_Y;
|
Paintbrush_Y = Mouse_Y;
|
||||||
|
|
||||||
|
|
||||||
Unselect_button(BUTTON_RESOL);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Safety_resolution(void)
|
void Button_Safety_resolution(int btn)
|
||||||
{
|
{
|
||||||
// In windowed mode, do nothing
|
// In windowed mode, do nothing
|
||||||
if (Current_resolution==0)
|
if (Current_resolution==0)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Unselect_button(BUTTON_RESOL);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2245,7 +2244,7 @@ void Button_Safety_resolution(void)
|
|||||||
Reposition_palette();
|
Reposition_palette();
|
||||||
Display_all_screen();
|
Display_all_screen();
|
||||||
|
|
||||||
Unselect_button(BUTTON_RESOL);
|
Unselect_button(btn);
|
||||||
// Le pinceau est affiché à la position du clic et pas
|
// Le pinceau est affiché à la position du clic et pas
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
@ -2253,15 +2252,16 @@ void Button_Safety_resolution(void)
|
|||||||
|
|
||||||
//------------------ Gestion des boutons de dessin à la main -----------------
|
//------------------ Gestion des boutons de dessin à la main -----------------
|
||||||
|
|
||||||
void Button_Draw(void)
|
void Button_Draw(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Start_operation_stack(Selected_freehand_mode);
|
Start_operation_stack(Selected_freehand_mode);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Draw_switch_mode(void)
|
void Button_Draw_switch_mode(int btn)
|
||||||
{
|
{
|
||||||
char icon;
|
char icon;
|
||||||
|
|
||||||
@ -2271,9 +2271,9 @@ void Button_Draw_switch_mode(void)
|
|||||||
static const char text[4][14] =
|
static const char text[4][14] =
|
||||||
{"Continuous", "Discontinuous", "Single", "Contour fill"};
|
{"Continuous", "Discontinuous", "Single", "Contour fill"};
|
||||||
|
|
||||||
dropdown.Pos_X =Buttons_Pool[BUTTON_DRAW].X_offset;
|
dropdown.Pos_X =Buttons_Pool[btn].X_offset;
|
||||||
dropdown.Pos_Y =Buttons_Pool[BUTTON_DRAW].Y_offset;
|
dropdown.Pos_Y =Buttons_Pool[btn].Y_offset;
|
||||||
dropdown.Height =Buttons_Pool[BUTTON_DRAW].Height;
|
dropdown.Height =Buttons_Pool[btn].Height;
|
||||||
dropdown.Dropdown_width=14*8;
|
dropdown.Dropdown_width=14*8;
|
||||||
dropdown.First_item =NULL;
|
dropdown.First_item =NULL;
|
||||||
dropdown.Bottom_up =1;
|
dropdown.Bottom_up =1;
|
||||||
@ -2316,8 +2316,8 @@ void Button_Draw_switch_mode(void)
|
|||||||
icon=MENU_SPRITE_CONTOUR_DRAW;
|
icon=MENU_SPRITE_CONTOUR_DRAW;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Display_sprite_in_menu(BUTTON_DRAW,icon);
|
Display_sprite_in_menu(btn,icon);
|
||||||
Draw_menu_button(BUTTON_DRAW,BUTTON_PRESSED);
|
Draw_menu_button(btn,BUTTON_PRESSED);
|
||||||
Start_operation_stack(Selected_freehand_mode);
|
Start_operation_stack(Selected_freehand_mode);
|
||||||
|
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
@ -2327,16 +2327,18 @@ void Button_Draw_switch_mode(void)
|
|||||||
|
|
||||||
// -- Gestion des boutons de rectangle vide et plein ------------------------
|
// -- Gestion des boutons de rectangle vide et plein ------------------------
|
||||||
|
|
||||||
void Button_Empty_rectangle(void)
|
void Button_Empty_rectangle(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Start_operation_stack(OPERATION_EMPTY_RECTANGLE);
|
Start_operation_stack(OPERATION_EMPTY_RECTANGLE);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Filled_rectangle(void)
|
void Button_Filled_rectangle(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Start_operation_stack(OPERATION_FILLED_RECTANGLE);
|
Start_operation_stack(OPERATION_FILLED_RECTANGLE);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
@ -2519,7 +2521,7 @@ void Draw_gradient_preview(short start_x,short start_y,short width,short height,
|
|||||||
Update_rect(start_x,start_y,width*Menu_factor_X,height*Menu_factor_Y);
|
Update_rect(start_x,start_y,width*Menu_factor_X,height*Menu_factor_Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Gradients(void)
|
void Button_Gradients(int btn)
|
||||||
{
|
{
|
||||||
short clicked_button;
|
short clicked_button;
|
||||||
char str[4];
|
char str[4];
|
||||||
@ -2539,6 +2541,7 @@ void Button_Gradients(void)
|
|||||||
int changed_gradient_index;
|
int changed_gradient_index;
|
||||||
byte cycling_mode=Cycling_mode;
|
byte cycling_mode=Cycling_mode;
|
||||||
|
|
||||||
|
(void)btn;
|
||||||
// Enable cycling while this window is open
|
// Enable cycling while this window is open
|
||||||
Cycling_mode=1;
|
Cycling_mode=1;
|
||||||
|
|
||||||
@ -2815,9 +2818,9 @@ void Button_Gradients(void)
|
|||||||
|
|
||||||
// -- Gestion des boutons de cercle / ellipse / rectangle dégradés --------------------
|
// -- Gestion des boutons de cercle / ellipse / rectangle dégradés --------------------
|
||||||
|
|
||||||
|
void Button_Grad_rectangle(int btn)
|
||||||
void Button_Grad_rectangle(void)
|
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Start_operation_stack(OPERATION_GRAD_RECTANGLE);
|
Start_operation_stack(OPERATION_GRAD_RECTANGLE);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
@ -2826,8 +2829,9 @@ void Button_Grad_rectangle(void)
|
|||||||
|
|
||||||
// -- Gestion du bouton de remplissage ---------------------------------------
|
// -- Gestion du bouton de remplissage ---------------------------------------
|
||||||
|
|
||||||
void Button_Fill(void)
|
void Button_Fill(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
if (Current_operation!=OPERATION_FILL)
|
if (Current_operation!=OPERATION_FILL)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
@ -2847,8 +2851,9 @@ void Button_Fill(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Replace(void)
|
void Button_Replace(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
if (Current_operation!=OPERATION_REPLACE)
|
if (Current_operation!=OPERATION_REPLACE)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
@ -2866,8 +2871,9 @@ void Button_Replace(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Unselect_fill(void)
|
void Button_Unselect_fill(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Paintbrush_shape=Paintbrush_shape_before_fill;
|
Paintbrush_shape=Paintbrush_shape_before_fill;
|
||||||
|
|
||||||
if (Current_operation==OPERATION_REPLACE)
|
if (Current_operation==OPERATION_REPLACE)
|
||||||
@ -2899,7 +2905,7 @@ byte Same_paintbrush(byte index)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Paintbrush_menu(void)
|
void Button_Paintbrush_menu(int btn)
|
||||||
{
|
{
|
||||||
short clicked_button;
|
short clicked_button;
|
||||||
short x_pos,y_pos;
|
short x_pos,y_pos;
|
||||||
@ -3051,18 +3057,18 @@ void Button_Paintbrush_menu(void)
|
|||||||
}
|
}
|
||||||
while (1);
|
while (1);
|
||||||
|
|
||||||
Unselect_button(BUTTON_PAINTBRUSHES);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Brush_monochrome(void)
|
void Button_Brush_monochrome(int btn)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
// On passe en brosse monochrome:
|
// On passe en brosse monochrome:
|
||||||
Change_paintbrush_shape(PAINTBRUSH_SHAPE_MONO_BRUSH);
|
Change_paintbrush_shape(PAINTBRUSH_SHAPE_MONO_BRUSH);
|
||||||
|
|
||||||
Unselect_button(BUTTON_PAINTBRUSHES);
|
Unselect_button(btn);
|
||||||
|
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
@ -3303,8 +3309,9 @@ void Load_picture(enum CONTEXT_TYPE type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Load(void)
|
void Button_Load(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
// On sauve l'état actuel des paramètres de l'image pour pouvoir les
|
// On sauve l'état actuel des paramètres de l'image pour pouvoir les
|
||||||
// restituer en cas d'erreur n'affectant pas l'image
|
// restituer en cas d'erreur n'affectant pas l'image
|
||||||
Upload_infos_page(&Main);
|
Upload_infos_page(&Main);
|
||||||
@ -3314,11 +3321,12 @@ void Button_Load(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Reload(void)
|
void Button_Reload(int btn)
|
||||||
{
|
{
|
||||||
byte old_cursor_shape;
|
byte old_cursor_shape;
|
||||||
int new_mode;
|
int new_mode;
|
||||||
|
|
||||||
|
(void)btn;
|
||||||
// On sauve l'état actuel des paramètres de l'image pour pouvoir les
|
// On sauve l'état actuel des paramètres de l'image pour pouvoir les
|
||||||
// restituer en cas d'erreur n'affectant pas l'image
|
// restituer en cas d'erreur n'affectant pas l'image
|
||||||
Upload_infos_page(&Main);
|
Upload_infos_page(&Main);
|
||||||
@ -3550,19 +3558,20 @@ void Save_picture(enum CONTEXT_TYPE type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Save(void)
|
void Button_Save(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Save_picture(CONTEXT_MAIN_IMAGE);
|
Save_picture(CONTEXT_MAIN_IMAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Save main image over existing file (no fileselector)
|
/// Save main image over existing file (no fileselector)
|
||||||
void Button_Autosave(void)
|
void Button_Autosave(int btn)
|
||||||
{
|
{
|
||||||
byte old_cursor_shape;
|
byte old_cursor_shape;
|
||||||
static char filename[MAX_PATH_CHARACTERS];
|
static char filename[MAX_PATH_CHARACTERS];
|
||||||
byte file_already_exists;
|
byte file_already_exists;
|
||||||
|
|
||||||
|
(void)btn;
|
||||||
Get_full_filename(filename, Main.backups->Pages->Filename, Main.backups->Pages->File_directory);
|
Get_full_filename(filename, Main.backups->Pages->Filename, Main.backups->Pages->File_directory);
|
||||||
file_already_exists=File_exists(filename);
|
file_already_exists=File_exists(filename);
|
||||||
|
|
||||||
@ -3608,44 +3617,38 @@ void Button_Autosave(void)
|
|||||||
|
|
||||||
// -- Gestion des boutons de ligne ------------------------------------------
|
// -- Gestion des boutons de ligne ------------------------------------------
|
||||||
|
|
||||||
void Button_Lines(void)
|
void Button_Lines(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Start_operation_stack(Selected_line_mode);
|
Start_operation_stack(Selected_line_mode);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Lines_switch_mode(void)
|
void Button_Lines_switch_mode(int btn)
|
||||||
{
|
{
|
||||||
char icon;
|
char icon;
|
||||||
|
|
||||||
if (Selected_line_mode==OPERATION_LINE)
|
if (Selected_line_mode==OPERATION_LINE)
|
||||||
|
{
|
||||||
Selected_line_mode=OPERATION_K_LINE;
|
Selected_line_mode=OPERATION_K_LINE;
|
||||||
|
icon=MENU_SPRITE_K_LINE;
|
||||||
|
}
|
||||||
|
else if (Selected_line_mode==OPERATION_K_LINE)
|
||||||
|
{
|
||||||
|
Selected_line_mode=OPERATION_CENTERED_LINES;
|
||||||
|
icon=MENU_SPRITE_CENTERED_LINES;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Selected_line_mode==OPERATION_K_LINE)
|
Selected_line_mode=OPERATION_LINE;
|
||||||
Selected_line_mode=OPERATION_CENTERED_LINES;
|
icon=-1;
|
||||||
else
|
|
||||||
Selected_line_mode=OPERATION_LINE;
|
|
||||||
}
|
|
||||||
switch(Selected_line_mode)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
case OPERATION_LINE:
|
|
||||||
icon=-1;
|
|
||||||
break;
|
|
||||||
case OPERATION_K_LINE:
|
|
||||||
icon=MENU_SPRITE_K_LINE;
|
|
||||||
break;
|
|
||||||
case OPERATION_CENTERED_LINES:
|
|
||||||
icon=MENU_SPRITE_CENTERED_LINES;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Display_sprite_in_menu(BUTTON_LINES,icon);
|
Display_sprite_in_menu(btn,icon);
|
||||||
Draw_menu_button(BUTTON_LINES,BUTTON_PRESSED);
|
Draw_menu_button(btn,BUTTON_PRESSED);
|
||||||
Start_operation_stack(Selected_line_mode);
|
Start_operation_stack(Selected_line_mode);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
@ -3653,34 +3656,34 @@ void Button_Lines_switch_mode(void)
|
|||||||
|
|
||||||
// -- Button de brosse ------------------------------------------------------
|
// -- Button de brosse ------------------------------------------------------
|
||||||
|
|
||||||
void Button_Brush(void)
|
void Button_Brush(int btn)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
|
|
||||||
if (Current_operation!=OPERATION_GRAB_BRUSH)
|
if (Current_operation!=OPERATION_GRAB_BRUSH)
|
||||||
Start_operation_stack(OPERATION_GRAB_BRUSH);
|
Start_operation_stack(OPERATION_GRAB_BRUSH);
|
||||||
else
|
else
|
||||||
Unselect_button(BUTTON_BRUSH);
|
Unselect_button(btn);
|
||||||
|
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Unselect_brush(void)
|
void Button_Unselect_brush(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
// On fait de notre mieux pour restaurer l'ancienne opération:
|
// On fait de notre mieux pour restaurer l'ancienne opération:
|
||||||
Start_operation_stack(Operation_before_interrupt);
|
Start_operation_stack(Operation_before_interrupt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Restore_brush(void)
|
void Button_Restore_brush(int btn)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
// On passe en brosse couleur:
|
// On passe en brosse couleur:
|
||||||
Change_paintbrush_shape(PAINTBRUSH_SHAPE_COLOR_BRUSH);
|
Change_paintbrush_shape(PAINTBRUSH_SHAPE_COLOR_BRUSH);
|
||||||
|
|
||||||
Unselect_button(BUTTON_BRUSH);
|
Unselect_button(btn);
|
||||||
Unselect_button(BUTTON_POLYBRUSH);
|
|
||||||
|
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
@ -3688,7 +3691,7 @@ void Button_Restore_brush(void)
|
|||||||
|
|
||||||
// -- Button de prise de brosse au lasso ------------------------------------
|
// -- Button de prise de brosse au lasso ------------------------------------
|
||||||
|
|
||||||
void Button_Lasso(void)
|
void Button_Lasso(int btn)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
|
|
||||||
@ -3699,14 +3702,15 @@ void Button_Lasso(void)
|
|||||||
Start_operation_stack(OPERATION_POLYBRUSH);
|
Start_operation_stack(OPERATION_POLYBRUSH);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Unselect_button(BUTTON_POLYBRUSH);
|
Unselect_button(btn);
|
||||||
|
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Unselect_lasso(void)
|
void Button_Unselect_lasso(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
// On fait de notre mieux pour restaurer l'ancienne opération:
|
// On fait de notre mieux pour restaurer l'ancienne opération:
|
||||||
Start_operation_stack(Operation_before_interrupt);
|
Start_operation_stack(Operation_before_interrupt);
|
||||||
Paintbrush_shape=Paintbrush_shape_before_lasso;
|
Paintbrush_shape=Paintbrush_shape_before_lasso;
|
||||||
@ -3715,7 +3719,7 @@ void Button_Unselect_lasso(void)
|
|||||||
|
|
||||||
// -- Button de pipette -----------------------------------------------------
|
// -- Button de pipette -----------------------------------------------------
|
||||||
|
|
||||||
void Button_Colorpicker(void)
|
void Button_Colorpicker(int btn)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
|
|
||||||
@ -3731,14 +3735,15 @@ void Button_Colorpicker(void)
|
|||||||
Print_in_menu("X: Y: ( )",0);
|
Print_in_menu("X: Y: ( )",0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Unselect_button(BUTTON_COLORPICKER);
|
Unselect_button(btn);
|
||||||
|
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Unselect_colorpicker(void)
|
void Button_Unselect_colorpicker(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
// Erase the color block which shows the picked color
|
// Erase the color block which shows the picked color
|
||||||
if (Operation_before_interrupt!=OPERATION_REPLACE)
|
if (Operation_before_interrupt!=OPERATION_REPLACE)
|
||||||
if ( (Mouse_Y<Menu_Y) && (Menu_is_visible) &&
|
if ( (Mouse_Y<Menu_Y) && (Menu_is_visible) &&
|
||||||
@ -3755,7 +3760,7 @@ void Button_Unselect_colorpicker(void)
|
|||||||
|
|
||||||
|
|
||||||
// -- Inversion de la couleur Fore et de la couleur Back --
|
// -- Inversion de la couleur Fore et de la couleur Back --
|
||||||
void Button_Invert_foreback(void)
|
void Button_Invert_foreback(int btn)
|
||||||
{
|
{
|
||||||
byte temp_color;
|
byte temp_color;
|
||||||
|
|
||||||
@ -3768,7 +3773,7 @@ void Button_Invert_foreback(void)
|
|||||||
Frame_menu_color(Fore_color);
|
Frame_menu_color(Fore_color);
|
||||||
Reposition_palette();
|
Reposition_palette();
|
||||||
Display_foreback();
|
Display_foreback();
|
||||||
Unselect_button(BUTTON_COLORPICKER);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3777,12 +3782,12 @@ void Button_Invert_foreback(void)
|
|||||||
|
|
||||||
byte Coming_from_zoom_factor_menu=0;
|
byte Coming_from_zoom_factor_menu=0;
|
||||||
|
|
||||||
void Button_Magnify(void)
|
void Button_Magnify(int btn)
|
||||||
{
|
{
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
if ( (Current_operation==OPERATION_MAGNIFY) || (Main.magnifier_mode) )
|
if ( (Current_operation==OPERATION_MAGNIFY) || (Main.magnifier_mode) )
|
||||||
{
|
{
|
||||||
Unselect_button(BUTTON_MAGNIFIER);
|
Unselect_button(btn);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3826,15 +3831,16 @@ void Button_Magnify(void)
|
|||||||
Update_rect(0,0,0,0);
|
Update_rect(0,0,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Magnify_menu(void)
|
void Button_Magnify_menu(int btn)
|
||||||
{
|
{
|
||||||
T_Dropdown_button dropdown;
|
T_Dropdown_button dropdown;
|
||||||
T_Dropdown_choice *item;
|
T_Dropdown_choice *item;
|
||||||
int i;
|
int i;
|
||||||
const char text[NB_ZOOM_FACTORS][4] =
|
static const char * text[NB_ZOOM_FACTORS] =
|
||||||
{"x2", "x3", "x4", "x5", "x6", "x8", "x10", "x12", "x14", "x16", "x18", "x20",
|
{"x2", "x3", "x4", "x5", "x6", "x8", "x10", "x12", "x14", "x16", "x18", "x20",
|
||||||
"x24", "x28", "x32"};
|
"x24", "x28", "x32"};
|
||||||
|
|
||||||
|
(void)btn;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
|
|
||||||
dropdown.Pos_X =Buttons_Pool[BUTTON_MAGNIFIER].X_offset;
|
dropdown.Pos_X =Buttons_Pool[BUTTON_MAGNIFIER].X_offset;
|
||||||
@ -3871,8 +3877,9 @@ void Button_Magnify_menu(void)
|
|||||||
Window_dropdown_clear_items(&dropdown);
|
Window_dropdown_clear_items(&dropdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Unselect_magnifier(void)
|
void Button_Unselect_magnifier(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
if (Main.magnifier_mode)
|
if (Main.magnifier_mode)
|
||||||
{
|
{
|
||||||
// On sort du mode loupe
|
// On sort du mode loupe
|
||||||
@ -3914,7 +3921,7 @@ void Button_Unselect_magnifier(void)
|
|||||||
|
|
||||||
// ----------------------- Modifications de brosse ---------------------------
|
// ----------------------- Modifications de brosse ---------------------------
|
||||||
|
|
||||||
void Button_Brush_FX(void)
|
void Button_Brush_FX(int btn)
|
||||||
{
|
{
|
||||||
short clicked_button;
|
short clicked_button;
|
||||||
short index;
|
short index;
|
||||||
@ -4003,7 +4010,7 @@ void Button_Brush_FX(void)
|
|||||||
while (clicked_button<=0);
|
while (clicked_button<=0);
|
||||||
|
|
||||||
Close_window();
|
Close_window();
|
||||||
Unselect_button(BUTTON_BRUSH_EFFECTS);
|
Unselect_button(btn);
|
||||||
|
|
||||||
// Gestion du bouton clické
|
// Gestion du bouton clické
|
||||||
switch (clicked_button)
|
switch (clicked_button)
|
||||||
@ -4088,15 +4095,16 @@ void Button_Brush_FX(void)
|
|||||||
|
|
||||||
//---------------------------- Courbes de Bézier ----------------------------
|
//---------------------------- Courbes de Bézier ----------------------------
|
||||||
|
|
||||||
void Button_Curves(void)
|
void Button_Curves(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Start_operation_stack(Selected_curve_mode);
|
Start_operation_stack(Selected_curve_mode);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Curves_switch_mode(void)
|
void Button_Curves_switch_mode(int btn)
|
||||||
{
|
{
|
||||||
if (Selected_curve_mode==OPERATION_4_POINTS_CURVE)
|
if (Selected_curve_mode==OPERATION_4_POINTS_CURVE)
|
||||||
Selected_curve_mode=OPERATION_3_POINTS_CURVE;
|
Selected_curve_mode=OPERATION_3_POINTS_CURVE;
|
||||||
@ -4104,8 +4112,8 @@ void Button_Curves_switch_mode(void)
|
|||||||
Selected_curve_mode=OPERATION_4_POINTS_CURVE;
|
Selected_curve_mode=OPERATION_4_POINTS_CURVE;
|
||||||
|
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Display_sprite_in_menu(BUTTON_CURVES,Selected_curve_mode==OPERATION_4_POINTS_CURVE?MENU_SPRITE_4_POINTS_CURVE:-1);
|
Display_sprite_in_menu(btn,Selected_curve_mode==OPERATION_4_POINTS_CURVE?MENU_SPRITE_4_POINTS_CURVE:-1);
|
||||||
Draw_menu_button(BUTTON_CURVES,BUTTON_PRESSED);
|
Draw_menu_button(btn,BUTTON_PRESSED);
|
||||||
Start_operation_stack(Selected_curve_mode);
|
Start_operation_stack(Selected_curve_mode);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
@ -4113,8 +4121,9 @@ void Button_Curves_switch_mode(void)
|
|||||||
|
|
||||||
//--------------------------------- Spray -----------------------------------
|
//--------------------------------- Spray -----------------------------------
|
||||||
|
|
||||||
void Button_Airbrush(void)
|
void Button_Airbrush(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Start_operation_stack(OPERATION_AIRBRUSH);
|
Start_operation_stack(OPERATION_AIRBRUSH);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
@ -4139,7 +4148,7 @@ void Refresh_airbrush_settings(byte selected_color, byte update_slider)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Airbrush_menu(void)
|
void Button_Airbrush_menu(int btn)
|
||||||
{
|
{
|
||||||
static byte spray_init=1;
|
static byte spray_init=1;
|
||||||
short clicked_button;
|
short clicked_button;
|
||||||
@ -4161,7 +4170,7 @@ void Button_Airbrush_menu(void)
|
|||||||
byte color;
|
byte color;
|
||||||
byte click;
|
byte click;
|
||||||
|
|
||||||
|
(void)btn;
|
||||||
memcpy(old_airbrush_multi_flow,Airbrush_multi_flow,256);
|
memcpy(old_airbrush_multi_flow,Airbrush_multi_flow,256);
|
||||||
|
|
||||||
|
|
||||||
@ -4483,32 +4492,36 @@ void Button_Airbrush_menu(void)
|
|||||||
|
|
||||||
// -- Gestion des boutons de polygone vide et plein -------------------------
|
// -- Gestion des boutons de polygone vide et plein -------------------------
|
||||||
|
|
||||||
void Button_polygon(void)
|
void Button_polygon(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Start_operation_stack(OPERATION_POLYGON);
|
Start_operation_stack(OPERATION_POLYGON);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Polyform(void)
|
void Button_Polyform(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Start_operation_stack(OPERATION_POLYFORM);
|
Start_operation_stack(OPERATION_POLYFORM);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Polyfill(void)
|
void Button_Polyfill(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Start_operation_stack(OPERATION_POLYFILL);
|
Start_operation_stack(OPERATION_POLYFILL);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Filled_polyform(void)
|
void Button_Filled_polyform(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Start_operation_stack(OPERATION_FILLED_POLYFORM);
|
Start_operation_stack(OPERATION_FILLED_POLYFORM);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
@ -4517,8 +4530,9 @@ void Button_Filled_polyform(void)
|
|||||||
|
|
||||||
// -- Boutons d'ajustement de l'image ---------------------------------------
|
// -- Boutons d'ajustement de l'image ---------------------------------------
|
||||||
|
|
||||||
void Button_Adjust(void)
|
void Button_Adjust(int btn)
|
||||||
{
|
{
|
||||||
|
(void)btn;
|
||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
Start_operation_stack(OPERATION_SCROLL);
|
Start_operation_stack(OPERATION_SCROLL);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
@ -4584,7 +4598,7 @@ void Display_feedback_state(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Effects(void)
|
void Button_Effects(int btn)
|
||||||
{
|
{
|
||||||
short clicked_button;
|
short clicked_button;
|
||||||
byte exit_by_close_button=0;
|
byte exit_by_close_button=0;
|
||||||
@ -4914,7 +4928,7 @@ void Button_Effects(void)
|
|||||||
Hide_cursor();
|
Hide_cursor();
|
||||||
|
|
||||||
if (!Any_effect_active())
|
if (!Any_effect_active())
|
||||||
Unselect_button(BUTTON_EFFECTS);
|
Unselect_button(btn);
|
||||||
|
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
@ -4927,7 +4941,7 @@ void Draw_one_font_name(word x, word y, word index, byte highlighted)
|
|||||||
Print_in_window(x,y,Font_label(index), MC_Black, (highlighted)?MC_Dark:MC_Light);
|
Print_in_window(x,y,Font_label(index), MC_Black, (highlighted)?MC_Dark:MC_Light);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Text(void)
|
void Button_Text(int btn)
|
||||||
{
|
{
|
||||||
static char str[256]="";
|
static char str[256]="";
|
||||||
static int font_size=32;
|
static int font_size=32;
|
||||||
@ -4954,7 +4968,8 @@ void Button_Text(void)
|
|||||||
|
|
||||||
byte redraw_is_needed=1;
|
byte redraw_is_needed=1;
|
||||||
byte preview_is_needed=1;
|
byte preview_is_needed=1;
|
||||||
|
|
||||||
|
(void)btn;
|
||||||
Open_window(288,180,"Text");
|
Open_window(288,180,"Text");
|
||||||
|
|
||||||
// Texte saisi
|
// Texte saisi
|
||||||
|
|||||||
124
src/buttons.h
124
src/buttons.h
@ -59,37 +59,37 @@ void Change_paintbrush_shape(byte shape);
|
|||||||
Callback for the palette scroller buttons left click.
|
Callback for the palette scroller buttons left click.
|
||||||
Scrolls the menubar palette one column to the left.
|
Scrolls the menubar palette one column to the left.
|
||||||
*/
|
*/
|
||||||
void Button_Pal_left(void);
|
void Button_Pal_left(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the palette scroller buttons right click.
|
Callback for the palette scroller buttons right click.
|
||||||
Scrolls the menubar palette faster to the left.
|
Scrolls the menubar palette faster to the left.
|
||||||
*/
|
*/
|
||||||
void Button_Pal_left_fast(void);
|
void Button_Pal_left_fast(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the palette scroller buttons left click.
|
Callback for the palette scroller buttons left click.
|
||||||
Scrolls the menubar palette one column to the right.
|
Scrolls the menubar palette one column to the right.
|
||||||
*/
|
*/
|
||||||
void Button_Pal_right(void);
|
void Button_Pal_right(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the palette scroller buttons right click.
|
Callback for the palette scroller buttons right click.
|
||||||
Scrolls the menubar palette faster to the right.
|
Scrolls the menubar palette faster to the right.
|
||||||
*/
|
*/
|
||||||
void Button_Pal_right_fast(void);
|
void Button_Pal_right_fast(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the palette color buttons left click.
|
Callback for the palette color buttons left click.
|
||||||
Selects the foreground drawing color when clicking on the menubar palette.
|
Selects the foreground drawing color when clicking on the menubar palette.
|
||||||
*/
|
*/
|
||||||
void Button_Select_forecolor(void);
|
void Button_Select_forecolor(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the palette color buttons right click.
|
Callback for the palette color buttons right click.
|
||||||
Selects the background drawing color when clicking on the menubar palette.
|
Selects the background drawing color when clicking on the menubar palette.
|
||||||
*/
|
*/
|
||||||
void Button_Select_backcolor(void);
|
void Button_Select_backcolor(int);
|
||||||
|
|
||||||
// Boutons relatifs au pinceaux
|
// Boutons relatifs au pinceaux
|
||||||
|
|
||||||
@ -97,13 +97,13 @@ void Button_Select_backcolor(void);
|
|||||||
Callback for the brush button left click.
|
Callback for the brush button left click.
|
||||||
Selects the monochrome brush mode when right clicking on the brush button.
|
Selects the monochrome brush mode when right clicking on the brush button.
|
||||||
*/
|
*/
|
||||||
void Button_Brush_monochrome(void);
|
void Button_Brush_monochrome(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the brush button right click.
|
Callback for the brush button right click.
|
||||||
Displays the "Paintbrush menu".
|
Displays the "Paintbrush menu".
|
||||||
*/
|
*/
|
||||||
void Button_Paintbrush_menu(void);
|
void Button_Paintbrush_menu(int);
|
||||||
|
|
||||||
// Boutons relatifs au mode de dessin à main levée
|
// Boutons relatifs au mode de dessin à main levée
|
||||||
|
|
||||||
@ -111,13 +111,13 @@ void Button_Paintbrush_menu(void);
|
|||||||
Callback for the freehand draw button left click.
|
Callback for the freehand draw button left click.
|
||||||
Selects freehand drawing mode, depending on the current state of the freehand button.
|
Selects freehand drawing mode, depending on the current state of the freehand button.
|
||||||
*/
|
*/
|
||||||
void Button_Draw(void);
|
void Button_Draw(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the freehand draw button right click.
|
Callback for the freehand draw button right click.
|
||||||
Cycles the drawing modes for the freehand tool.
|
Cycles the drawing modes for the freehand tool.
|
||||||
*/
|
*/
|
||||||
void Button_Draw_switch_mode(void);
|
void Button_Draw_switch_mode(int);
|
||||||
|
|
||||||
// Dessin par ligne
|
// Dessin par ligne
|
||||||
|
|
||||||
@ -125,13 +125,13 @@ void Button_Draw_switch_mode(void);
|
|||||||
Callback for the lines button left click.
|
Callback for the lines button left click.
|
||||||
Selects lines drawing mode, depending on the current state of the lines button.
|
Selects lines drawing mode, depending on the current state of the lines button.
|
||||||
*/
|
*/
|
||||||
void Button_Lines(void);
|
void Button_Lines(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the lines button right click.
|
Callback for the lines button right click.
|
||||||
Cycles the drawing modes for the lines tool.
|
Cycles the drawing modes for the lines tool.
|
||||||
*/
|
*/
|
||||||
void Button_Lines_switch_mode(void);
|
void Button_Lines_switch_mode(int);
|
||||||
|
|
||||||
// Button relatif au remplissage
|
// Button relatif au remplissage
|
||||||
|
|
||||||
@ -139,20 +139,20 @@ void Button_Lines_switch_mode(void);
|
|||||||
Callback for the fill button left click.
|
Callback for the fill button left click.
|
||||||
Start the filling operation.
|
Start the filling operation.
|
||||||
*/
|
*/
|
||||||
void Button_Fill(void);
|
void Button_Fill(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the fill button right click.
|
Callback for the fill button right click.
|
||||||
Start the color replace operation.
|
Start the color replace operation.
|
||||||
*/
|
*/
|
||||||
void Button_Replace(void);
|
void Button_Replace(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Disable and release the fill button.
|
Disable and release the fill button.
|
||||||
Restores the cursor (custom brushes are disabled for the fill operation).
|
Restores the cursor (custom brushes are disabled for the fill operation).
|
||||||
Cleans the status bar if the color replacement tool put a preview color inside it.
|
Cleans the status bar if the color replacement tool put a preview color inside it.
|
||||||
*/
|
*/
|
||||||
void Button_Unselect_fill(void);
|
void Button_Unselect_fill(int);
|
||||||
|
|
||||||
// Spray
|
// Spray
|
||||||
|
|
||||||
@ -160,13 +160,13 @@ void Button_Unselect_fill(void);
|
|||||||
Callback for the spray button left click.
|
Callback for the spray button left click.
|
||||||
Start the spray operation.
|
Start the spray operation.
|
||||||
*/
|
*/
|
||||||
void Button_Airbrush(void);
|
void Button_Airbrush(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the spray button right click.
|
Callback for the spray button right click.
|
||||||
Opens the spray's setup menu.
|
Opens the spray's setup menu.
|
||||||
*/
|
*/
|
||||||
void Button_Airbrush_menu(void);
|
void Button_Airbrush_menu(int);
|
||||||
|
|
||||||
// Courbes de Bézier
|
// Courbes de Bézier
|
||||||
|
|
||||||
@ -174,13 +174,13 @@ void Button_Airbrush_menu(void);
|
|||||||
Callback for the curves button left click.
|
Callback for the curves button left click.
|
||||||
Start curve operation according to the selected mode.
|
Start curve operation according to the selected mode.
|
||||||
*/
|
*/
|
||||||
void Button_Curves(void);
|
void Button_Curves(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the curves button right click.
|
Callback for the curves button right click.
|
||||||
Select the curve mode (1-point, 2-point)
|
Select the curve mode (1-point, 2-point)
|
||||||
*/
|
*/
|
||||||
void Button_Curves_switch_mode(void);
|
void Button_Curves_switch_mode(int);
|
||||||
|
|
||||||
// Boutons relatifs aux rectangles pleins et vides
|
// Boutons relatifs aux rectangles pleins et vides
|
||||||
|
|
||||||
@ -188,13 +188,13 @@ void Button_Curves_switch_mode(void);
|
|||||||
Callback for the empty rectangle button.
|
Callback for the empty rectangle button.
|
||||||
Start the rectangle operation.
|
Start the rectangle operation.
|
||||||
*/
|
*/
|
||||||
void Button_Empty_rectangle(void);
|
void Button_Empty_rectangle(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the filled rectangle button.
|
Callback for the filled rectangle button.
|
||||||
Start the filled rectangle operation.
|
Start the filled rectangle operation.
|
||||||
*/
|
*/
|
||||||
void Button_Filled_rectangle(void);
|
void Button_Filled_rectangle(int);
|
||||||
|
|
||||||
// Boutons relatifs au texte
|
// Boutons relatifs au texte
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ void Button_Filled_rectangle(void);
|
|||||||
Callback for the text button.
|
Callback for the text button.
|
||||||
Opens the text setup window.
|
Opens the text setup window.
|
||||||
*/
|
*/
|
||||||
void Button_Text(void);
|
void Button_Text(int);
|
||||||
|
|
||||||
// Boutons relatifs aux dégradés
|
// Boutons relatifs aux dégradés
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ void Button_Text(void);
|
|||||||
Callback for the gradation button.
|
Callback for the gradation button.
|
||||||
Opens the "Gradation menu".
|
Opens the "Gradation menu".
|
||||||
*/
|
*/
|
||||||
void Button_Gradients(void);
|
void Button_Gradients(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Gets the informations from the gradations table and set the global vars for the current gradation.
|
Gets the informations from the gradations table and set the global vars for the current gradation.
|
||||||
@ -222,7 +222,7 @@ void Load_gradient_data(int index);
|
|||||||
Callback for the gradation rectangle button.
|
Callback for the gradation rectangle button.
|
||||||
Starts the gradation rectangle drawing operation.
|
Starts the gradation rectangle drawing operation.
|
||||||
*/
|
*/
|
||||||
void Button_Grad_rectangle(void);
|
void Button_Grad_rectangle(int);
|
||||||
|
|
||||||
// Boutons relatifs aux cercles (ellipses) plein(e)s et vides
|
// Boutons relatifs aux cercles (ellipses) plein(e)s et vides
|
||||||
|
|
||||||
@ -244,25 +244,25 @@ void Button_Circle_switch_mode(int);
|
|||||||
Callback for the polyline button left click.
|
Callback for the polyline button left click.
|
||||||
Starts drawing a polygon.
|
Starts drawing a polygon.
|
||||||
*/
|
*/
|
||||||
void Button_polygon(void);
|
void Button_polygon(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the polyline right click.
|
Callback for the polyline right click.
|
||||||
Starts drawing a polyform.
|
Starts drawing a polyform.
|
||||||
*/
|
*/
|
||||||
void Button_Polyform(void);
|
void Button_Polyform(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the polyfill button left click.
|
Callback for the polyfill button left click.
|
||||||
Starts drawing a filled polygon.
|
Starts drawing a filled polygon.
|
||||||
*/
|
*/
|
||||||
void Button_Polyfill(void);
|
void Button_Polyfill(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the polyfill button right click.
|
Callback for the polyfill button right click.
|
||||||
Starts drawing a filled polyform.
|
Starts drawing a filled polyform.
|
||||||
*/
|
*/
|
||||||
void Button_Filled_polyform(void);
|
void Button_Filled_polyform(int);
|
||||||
|
|
||||||
// Boutons d'ajustement de l'image
|
// Boutons d'ajustement de l'image
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ void Button_Filled_polyform(void);
|
|||||||
Callback for the adjust picture button.
|
Callback for the adjust picture button.
|
||||||
Start the adjust picture operation.
|
Start the adjust picture operation.
|
||||||
*/
|
*/
|
||||||
void Button_Adjust(void);
|
void Button_Adjust(int);
|
||||||
|
|
||||||
// Gestion du mode Shade
|
// Gestion du mode Shade
|
||||||
|
|
||||||
@ -430,7 +430,7 @@ void Effects_off(void);
|
|||||||
Callback for the effects button click.
|
Callback for the effects button click.
|
||||||
Displays the effect selection menu.
|
Displays the effect selection menu.
|
||||||
*/
|
*/
|
||||||
void Button_Effects(void);
|
void Button_Effects(int);
|
||||||
|
|
||||||
// Prise de brosse
|
// Prise de brosse
|
||||||
|
|
||||||
@ -438,83 +438,83 @@ void Button_Effects(void);
|
|||||||
Callback for the brush button left click.
|
Callback for the brush button left click.
|
||||||
Start the brush picking operation.
|
Start the brush picking operation.
|
||||||
*/
|
*/
|
||||||
void Button_Brush(void);
|
void Button_Brush(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the brush button right click.
|
Callback for the brush button right click.
|
||||||
Activates the last captured custom brush.
|
Activates the last captured custom brush.
|
||||||
*/
|
*/
|
||||||
void Button_Restore_brush(void);
|
void Button_Restore_brush(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Disables the custom brush and set back a regular one.
|
Disables the custom brush and set back a regular one.
|
||||||
*/
|
*/
|
||||||
void Button_Unselect_brush(void);
|
void Button_Unselect_brush(int);
|
||||||
// Prise de brosse au lasso
|
// Prise de brosse au lasso
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Callback for the freehand brush pick button left click.
|
Callback for the freehand brush pick button left click.
|
||||||
Starts freehand brush picking operation.
|
Starts freehand brush picking operation.
|
||||||
*/
|
*/
|
||||||
void Button_Lasso(void);
|
void Button_Lasso(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Disables the custom freehand brush and set back a regular one.
|
Disables the custom freehand brush and set back a regular one.
|
||||||
*/
|
*/
|
||||||
void Button_Unselect_lasso(void);
|
void Button_Unselect_lasso(int);
|
||||||
|
|
||||||
// Button relatifs à la pipette
|
// Button relatifs à la pipette
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Starts the color picking operation.
|
Starts the color picking operation.
|
||||||
*/
|
*/
|
||||||
void Button_Colorpicker(void);
|
void Button_Colorpicker(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Disables the color picker button and get back to the previously selected drawing mode.
|
Disables the color picker button and get back to the previously selected drawing mode.
|
||||||
*/
|
*/
|
||||||
void Button_Unselect_colorpicker(void);
|
void Button_Unselect_colorpicker(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Swap fore- and background colors.
|
Swap fore- and background colors.
|
||||||
*/
|
*/
|
||||||
void Button_Invert_foreback(void);
|
void Button_Invert_foreback(int);
|
||||||
|
|
||||||
// Mode loupe
|
// Mode loupe
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Enters magnify mode.
|
Enters magnify mode.
|
||||||
*/
|
*/
|
||||||
void Button_Magnify(void);
|
void Button_Magnify(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Displays magnify menu.
|
Displays magnify menu.
|
||||||
*/
|
*/
|
||||||
void Button_Magnify_menu(void);
|
void Button_Magnify_menu(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Exit magnify mode.
|
Exit magnify mode.
|
||||||
*/
|
*/
|
||||||
void Button_Unselect_magnifier(void);
|
void Button_Unselect_magnifier(int);
|
||||||
|
|
||||||
// Les différents effets sur la brosse
|
// Les différents effets sur la brosse
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Display the Brush effects window.
|
Display the Brush effects window.
|
||||||
*/
|
*/
|
||||||
void Button_Brush_FX(void);
|
void Button_Brush_FX(int);
|
||||||
|
|
||||||
// Boutons relatifs aux différentes pages
|
// Boutons relatifs aux différentes pages
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Swap main and spare drawing pages.
|
Swap main and spare drawing pages.
|
||||||
*/
|
*/
|
||||||
void Button_Page(void);
|
void Button_Page(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Copy main page to spare page.
|
Copy main page to spare page.
|
||||||
*/
|
*/
|
||||||
void Button_Copy_page(void);
|
void Button_Copy_page(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Copy only pixel data from main page to spare page (no palette copy).
|
Copy only pixel data from main page to spare page (no palette copy).
|
||||||
@ -524,101 +524,101 @@ void Copy_image_only(void);
|
|||||||
/*!
|
/*!
|
||||||
Kill (free from memory) the current page.
|
Kill (free from memory) the current page.
|
||||||
*/
|
*/
|
||||||
void Button_Kill(void);
|
void Button_Kill(int);
|
||||||
|
|
||||||
// Boutons relatifs aux changements de résolution et de taille d'image
|
// Boutons relatifs aux changements de résolution et de taille d'image
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Display the screenmode menu.
|
Display the screenmode menu.
|
||||||
*/
|
*/
|
||||||
void Button_Resolution(void);
|
void Button_Resolution(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Set the screen to the "safe resolution" (320x200 pixel window).
|
Set the screen to the "safe resolution" (320x200 pixel window).
|
||||||
*/
|
*/
|
||||||
void Button_Safety_resolution(void);
|
void Button_Safety_resolution(int);
|
||||||
|
|
||||||
// Boutons relatifs aux chargements et sauvegardes
|
// Boutons relatifs aux chargements et sauvegardes
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Opens the load file dialog.
|
Opens the load file dialog.
|
||||||
*/
|
*/
|
||||||
void Button_Load(void);
|
void Button_Load(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Reload current picture from disk.
|
Reload current picture from disk.
|
||||||
*/
|
*/
|
||||||
void Button_Reload(void);
|
void Button_Reload(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Open the save file dialog.
|
Open the save file dialog.
|
||||||
*/
|
*/
|
||||||
void Button_Save(void);
|
void Button_Save(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Saves the current file without asking for a new name.
|
Saves the current file without asking for a new name.
|
||||||
*/
|
*/
|
||||||
void Button_Autosave(void);
|
void Button_Autosave(int);
|
||||||
|
|
||||||
// Réglage des paramètres de l'utilisateur
|
// Réglage des paramètres de l'utilisateur
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Display the setting menu.
|
Display the setting menu.
|
||||||
*/
|
*/
|
||||||
void Button_Settings(void);
|
void Button_Settings(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Display the skin selector window.
|
Display the skin selector window.
|
||||||
*/
|
*/
|
||||||
void Button_Skins(void);
|
void Button_Skins(int);
|
||||||
|
|
||||||
// Annulation de la dernière modification
|
// Annulation de la dernière modification
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Undo the last modification to the picture.
|
Undo the last modification to the picture.
|
||||||
*/
|
*/
|
||||||
void Button_Undo(void);
|
void Button_Undo(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Redo an operation that has been undone.
|
Redo the last modification to the picture.
|
||||||
*/
|
*/
|
||||||
void Button_Redo(void);
|
void Button_Redo(int);
|
||||||
|
|
||||||
// Boutons relatifs aux effacements d'images
|
// Boutons relatifs aux effacements d'images
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Clear the whole screen with black (color index 0).
|
Clear the whole screen with black (color index 0).
|
||||||
*/
|
*/
|
||||||
void Button_Clear(void);
|
void Button_Clear(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Clear the screen with the selected backcolor.
|
Clear the screen with the selected backcolor.
|
||||||
*/
|
*/
|
||||||
void Button_Clear_with_backcolor(void);
|
void Button_Clear_with_backcolor(int);
|
||||||
|
|
||||||
// Quitter le programme
|
// Quitter le programme
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Quits the program. Display a requester to save the changes to the picture before exiting if the pic was modified since last save.
|
Quits the program. Display a requester to save the changes to the picture before exiting if the pic was modified since last save.
|
||||||
*/
|
*/
|
||||||
void Button_Quit(void);
|
void Button_Quit(int);
|
||||||
|
|
||||||
// Cacher le menu
|
// Cacher le menu
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Hides the menubar.
|
Hides the menubar.
|
||||||
*/
|
*/
|
||||||
void Button_Hide_menu(void);
|
void Button_Hide_menu(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Shows a dropdown panel where you can choose which toolbars are visible
|
Shows a dropdown panel where you can choose which toolbars are visible
|
||||||
*/
|
*/
|
||||||
void Button_Toggle_toolbar(void);
|
void Button_Toggle_toolbar(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Hides all toolbars (except status) or shows them again
|
Hides all toolbars (except status) or shows them again
|
||||||
*/
|
*/
|
||||||
void Button_Toggle_all_toolbars(void);
|
void Button_Toggle_all_toolbars(int);
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@ -730,7 +730,7 @@ void Main_handler(void)
|
|||||||
if (Quit_is_required)
|
if (Quit_is_required)
|
||||||
{
|
{
|
||||||
Quit_is_required=0;
|
Quit_is_required=0;
|
||||||
Button_Quit();
|
Button_Quit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Pan_shortcut_pressed && Current_operation!=OPERATION_PAN_VIEW)
|
if (Pan_shortcut_pressed && Current_operation!=OPERATION_PAN_VIEW)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
/* vim:expandtab:ts=2 sw=2:
|
/* vim:expandtab:ts=2 sw=2:
|
||||||
*/
|
*/
|
||||||
void Button_Brush_Factory(void);
|
void Button_Brush_Factory(int);
|
||||||
void Repeat_script(void);
|
void Repeat_script(void);
|
||||||
|
|
||||||
/// Lua scripts bound to shortcut keys.
|
/// Lua scripts bound to shortcut keys.
|
||||||
|
|||||||
@ -477,10 +477,11 @@ void Scroll_help(T_Scroller_button * scroller)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Button_Help(void)
|
void Button_Help(int btn)
|
||||||
{
|
{
|
||||||
short btn_number;
|
short btn_number;
|
||||||
|
|
||||||
|
(void)btn;
|
||||||
// Aide contextuelle
|
// Aide contextuelle
|
||||||
if (Key!=0)
|
if (Key!=0)
|
||||||
{
|
{
|
||||||
@ -679,7 +680,7 @@ void Window_help(int section, const char *sub_section)
|
|||||||
|
|
||||||
#define STATS_TITLE_COLOR MC_White
|
#define STATS_TITLE_COLOR MC_White
|
||||||
#define STATS_DATA_COLOR MC_Light
|
#define STATS_DATA_COLOR MC_Light
|
||||||
void Button_Stats(void)
|
void Button_Stats(int btn)
|
||||||
{
|
{
|
||||||
short clicked_button;
|
short clicked_button;
|
||||||
char buffer[37];
|
char buffer[37];
|
||||||
@ -887,7 +888,7 @@ void Button_Stats(void)
|
|||||||
if(Key==SDLK_RETURN)Key=0;
|
if(Key==SDLK_RETURN)Key=0;
|
||||||
|
|
||||||
Close_window();
|
Close_window();
|
||||||
Unselect_button(BUTTON_HELP);
|
Unselect_button(btn);
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,12 +32,12 @@
|
|||||||
If the mouse is over a button, its contextual help will be displayed.
|
If the mouse is over a button, its contextual help will be displayed.
|
||||||
Else, the default helpscreen will be shown.
|
Else, the default helpscreen will be shown.
|
||||||
*/
|
*/
|
||||||
void Button_Help(void);
|
void Button_Help(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Displays and runs the "Statistics" window
|
Displays and runs the "Statistics" window
|
||||||
*/
|
*/
|
||||||
void Button_Stats(void);
|
void Button_Stats(int);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Displays and runs the "Help / About..." window
|
Displays and runs the "Help / About..." window
|
||||||
|
|||||||
38
src/layers.h
38
src/layers.h
@ -20,25 +20,25 @@
|
|||||||
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
|
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void Button_Layer_add(void);
|
void Button_Layer_add(int);
|
||||||
void Button_Layer_duplicate(void);
|
void Button_Layer_duplicate(int);
|
||||||
void Button_Layer_remove(void);
|
void Button_Layer_remove(int);
|
||||||
void Button_Layer_menu(void);
|
void Button_Layer_menu(int);
|
||||||
void Button_Layer_set_transparent(void);
|
void Button_Layer_set_transparent(int);
|
||||||
void Button_Layer_get_transparent(void);
|
void Button_Layer_get_transparent(int);
|
||||||
void Button_Layer_merge(void);
|
void Button_Layer_merge(int);
|
||||||
void Button_Layer_up(void);
|
void Button_Layer_up(int);
|
||||||
void Button_Layer_down(void);
|
void Button_Layer_down(int);
|
||||||
void Button_Layer_select(void);
|
void Button_Layer_select(int);
|
||||||
void Button_Layer_toggle(void);
|
void Button_Layer_toggle(int);
|
||||||
void Layer_activate(int layer, short side);
|
void Layer_activate(int layer, short side);
|
||||||
void Button_Anim_time(void);
|
void Button_Anim_time(int);
|
||||||
void Button_Anim_first_frame(void);
|
void Button_Anim_first_frame(int);
|
||||||
void Button_Anim_prev_frame(void);
|
void Button_Anim_prev_frame(int);
|
||||||
void Button_Anim_next_frame(void);
|
void Button_Anim_next_frame(int);
|
||||||
void Button_Anim_last_frame(void);
|
void Button_Anim_last_frame(int);
|
||||||
void Button_Anim_play(void);
|
void Button_Anim_play(int);
|
||||||
void Button_Anim_continuous_prev(void);
|
void Button_Anim_continuous_prev(int);
|
||||||
void Button_Anim_continuous_next(void);
|
void Button_Anim_continuous_next(int);
|
||||||
|
|
||||||
short Layer_under_mouse(void);
|
short Layer_under_mouse(void);
|
||||||
|
|||||||
@ -1680,7 +1680,7 @@ if (Create_lock_file(Config_directory))
|
|||||||
Compute_limits();
|
Compute_limits();
|
||||||
Compute_paintbrush_coordinates();
|
Compute_paintbrush_coordinates();
|
||||||
if (Backups_main)
|
if (Backups_main)
|
||||||
Button_Page();
|
Button_Page(-1);
|
||||||
}
|
}
|
||||||
restored_main = Process_backups(&Backups_main);
|
restored_main = Process_backups(&Backups_main);
|
||||||
|
|
||||||
|
|||||||
@ -921,7 +921,7 @@ int Init_program(int argc,char * argv[])
|
|||||||
Redraw_layered_image();
|
Redraw_layered_image();
|
||||||
End_of_modification();
|
End_of_modification();
|
||||||
|
|
||||||
Button_Page();
|
Button_Page(-1);
|
||||||
// no break ! proceed with the other file now
|
// no break ! proceed with the other file now
|
||||||
case 1:
|
case 1:
|
||||||
Init_context_layered_image(&context, main_filename, main_directory);
|
Init_context_layered_image(&context, main_filename, main_directory);
|
||||||
|
|||||||
@ -1075,7 +1075,7 @@ void Tag_used_colors(byte color, dword color_usage[])
|
|||||||
Update_window_area(Window_palette_button_list->Pos_X+3,Window_palette_button_list->Pos_Y+3,12*16,5*16);
|
Update_window_area(Window_palette_button_list->Pos_X+3,Window_palette_button_list->Pos_Y+3,12*16,5*16);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Palette(void)
|
void Button_Palette(int btn)
|
||||||
{
|
{
|
||||||
static const int BUTTON_PLUS_X = 182;
|
static const int BUTTON_PLUS_X = 182;
|
||||||
static const int BUTTON_PLUS_Y = 163;
|
static const int BUTTON_PLUS_Y = 163;
|
||||||
@ -1145,6 +1145,7 @@ void Button_Palette(void)
|
|||||||
static const int L3 = 46;
|
static const int L3 = 46;
|
||||||
static const int L4 = 61;
|
static const int L4 = 61;
|
||||||
|
|
||||||
|
(void)btn;
|
||||||
backup_palette =(T_Components *)malloc(sizeof(T_Palette));
|
backup_palette =(T_Components *)malloc(sizeof(T_Palette));
|
||||||
temp_palette=(T_Components *)malloc(sizeof(T_Palette));
|
temp_palette=(T_Components *)malloc(sizeof(T_Palette));
|
||||||
working_palette=(T_Components *)malloc(sizeof(T_Palette));
|
working_palette=(T_Components *)malloc(sizeof(T_Palette));
|
||||||
@ -2876,7 +2877,7 @@ void Button_Palette(void)
|
|||||||
|
|
||||||
//---------------------- Menu de palettes secondaires ------------------------
|
//---------------------- Menu de palettes secondaires ------------------------
|
||||||
|
|
||||||
void Button_Secondary_palette(void)
|
void Button_Secondary_palette(int btn)
|
||||||
{
|
{
|
||||||
short clicked_button;
|
short clicked_button;
|
||||||
byte dummy;
|
byte dummy;
|
||||||
@ -2894,7 +2895,7 @@ void Button_Secondary_palette(void)
|
|||||||
static const int RGBScale_X = 161;
|
static const int RGBScale_X = 161;
|
||||||
static const int RGBScale_Y = 85;
|
static const int RGBScale_Y = 85;
|
||||||
|
|
||||||
|
(void)btn;
|
||||||
Open_window(218,146,"Palettes");
|
Open_window(218,146,"Palettes");
|
||||||
|
|
||||||
Window_set_normal_button(10,20,180,14,"Colors for best match",12,1,SDLK_b); // 1
|
Window_set_normal_button(10,20,180,14,"Colors for best match",12,1,SDLK_b); // 1
|
||||||
|
|||||||
@ -24,9 +24,9 @@
|
|||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/// Open the palette menu and handles everything inside it.
|
/// Open the palette menu and handles everything inside it.
|
||||||
void Button_Palette(void);
|
void Button_Palette(int);
|
||||||
/// Open the secondary palette menu and handles it.
|
/// Open the secondary palette menu and handles it.
|
||||||
void Button_Secondary_palette(void);
|
void Button_Secondary_palette(int);
|
||||||
|
|
||||||
/// Choose the number of graduations for RGB components, from 2 to 256.
|
/// Choose the number of graduations for RGB components, from 2 to 256.
|
||||||
void Set_palette_RGB_scale(int);
|
void Set_palette_RGB_scale(int);
|
||||||
|
|||||||
@ -72,7 +72,7 @@ short Compute_dimension(short original_size, short new_ratio, short old_ratio)
|
|||||||
return amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Button_Transform_menu(void)
|
void Button_Transform_menu(int btn)
|
||||||
{
|
{
|
||||||
enum RESIZE_UNIT {
|
enum RESIZE_UNIT {
|
||||||
UNIT_PIXELS = 1,
|
UNIT_PIXELS = 1,
|
||||||
@ -198,7 +198,7 @@ void Button_Transform_menu(void)
|
|||||||
if (Is_shortcut(Key,0x100+BUTTON_HELP))
|
if (Is_shortcut(Key,0x100+BUTTON_HELP))
|
||||||
{
|
{
|
||||||
Key=0;
|
Key=0;
|
||||||
Window_help(BUTTON_ADJUST, "PICTURE TRANSFORM");
|
Window_help(btn, "PICTURE TRANSFORM");
|
||||||
}
|
}
|
||||||
else if (Is_shortcut(Key,0x200+BUTTON_ADJUST))
|
else if (Is_shortcut(Key,0x200+BUTTON_ADJUST))
|
||||||
clicked_button=1;
|
clicked_button=1;
|
||||||
@ -340,7 +340,7 @@ void Button_Transform_menu(void)
|
|||||||
|
|
||||||
// The Scroll operation uses the same button as transformation menu.
|
// The Scroll operation uses the same button as transformation menu.
|
||||||
if (Current_operation != OPERATION_SCROLL)
|
if (Current_operation != OPERATION_SCROLL)
|
||||||
Unselect_button(BUTTON_ADJUST);
|
Unselect_button(btn);
|
||||||
|
|
||||||
if (clicked_button != 1) // 1 is Cancel
|
if (clicked_button != 1) // 1 is Cancel
|
||||||
{
|
{
|
||||||
|
|||||||
@ -26,4 +26,4 @@
|
|||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/// Opens and handles the Picture transform screen.
|
/// Opens and handles the Picture transform screen.
|
||||||
void Button_Transform_menu(void);
|
void Button_Transform_menu(int);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user