Massive change of button callback function prototypes
This commit is contained in:
parent
f2d579695c
commit
30f23b93ef
271
src/buttons.c
271
src/buttons.c
@ -240,7 +240,7 @@ void Change_paintbrush_shape(byte shape)
|
||||
|
||||
|
||||
//-------------------------------- UNDO/REDO ---------------------------------
|
||||
void Button_Undo(void)
|
||||
void Button_Undo(int btn)
|
||||
{
|
||||
Hide_cursor();
|
||||
Undo();
|
||||
@ -249,13 +249,13 @@ void Button_Undo(void)
|
||||
|
||||
Check_menu_mode();
|
||||
Display_all_screen();
|
||||
Unselect_button(BUTTON_UNDO);
|
||||
Unselect_button(btn);
|
||||
Draw_menu_button(BUTTON_MAGNIFIER,Main.magnifier_mode);
|
||||
Display_menu();
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
void Button_Redo(void)
|
||||
void Button_Redo(int btn)
|
||||
{
|
||||
Hide_cursor();
|
||||
Redo();
|
||||
@ -264,15 +264,14 @@ void Button_Redo(void)
|
||||
|
||||
Check_menu_mode();
|
||||
Display_all_screen();
|
||||
Unselect_button(BUTTON_UNDO);
|
||||
Unselect_button(btn);
|
||||
Draw_menu_button(BUTTON_MAGNIFIER,Main.magnifier_mode);
|
||||
Display_menu();
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
//---------------------------- SCROLL PALETTE LEFT ---------------------------
|
||||
void Button_Pal_left(void)
|
||||
void Button_Pal_left(int btn)
|
||||
{
|
||||
short cells;
|
||||
cells = (Config.Palette_vertical)?Palette_cells_X():Palette_cells_Y();
|
||||
@ -286,11 +285,11 @@ void Button_Pal_left(void)
|
||||
First_color_in_palette=0;
|
||||
Display_menu_palette();
|
||||
}
|
||||
Unselect_button(BUTTON_PAL_LEFT);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
void Button_Pal_left_fast(void)
|
||||
void Button_Pal_left_fast(int btn)
|
||||
{
|
||||
short cells_x = Palette_cells_X();
|
||||
short cells_y = Palette_cells_Y();
|
||||
@ -304,13 +303,13 @@ void Button_Pal_left_fast(void)
|
||||
First_color_in_palette=0;
|
||||
Display_menu_palette();
|
||||
}
|
||||
Unselect_button(BUTTON_PAL_LEFT);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------- SCROLL PALETTE RIGHT ---------------------------
|
||||
void Button_Pal_right(void)
|
||||
void Button_Pal_right(int btn)
|
||||
{
|
||||
short cells;
|
||||
cells = (Config.Palette_vertical)?Palette_cells_X():Palette_cells_Y();
|
||||
@ -322,11 +321,11 @@ void Button_Pal_right(void)
|
||||
Display_menu_palette();
|
||||
}
|
||||
|
||||
Unselect_button(BUTTON_PAL_RIGHT);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
void Button_Pal_right_fast(void)
|
||||
void Button_Pal_right_fast(int btn)
|
||||
{
|
||||
short cells_x = Palette_cells_X();
|
||||
short cells_y = Palette_cells_Y();
|
||||
@ -345,12 +344,12 @@ void Button_Pal_right_fast(void)
|
||||
}
|
||||
Display_menu_palette();
|
||||
}
|
||||
Unselect_button(BUTTON_PAL_RIGHT);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
//-------------------- item de la forecolor dans le menu --------------------
|
||||
void Button_Select_forecolor(void)
|
||||
void Button_Select_forecolor(int btn)
|
||||
{
|
||||
static long time_click = 0;
|
||||
long time_previous;
|
||||
@ -367,7 +366,7 @@ void Button_Select_forecolor(void)
|
||||
if (time_click - time_previous < Config.Double_click_speed)
|
||||
{
|
||||
// Open palette window
|
||||
Button_Palette();
|
||||
Button_Palette(btn);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -385,7 +384,7 @@ void Button_Select_forecolor(void)
|
||||
{
|
||||
Get_input(20);
|
||||
|
||||
if (Button_under_mouse()==BUTTON_CHOOSE_COL)
|
||||
if (Button_under_mouse()==btn)
|
||||
{
|
||||
color=Pick_color_in_palette();
|
||||
if (color != Fore_color && color!=-1)
|
||||
@ -401,7 +400,7 @@ void Button_Select_forecolor(void)
|
||||
}
|
||||
|
||||
//-------------------- item de la backcolor dans le menu --------------------
|
||||
void Button_Select_backcolor(void)
|
||||
void Button_Select_backcolor(int btn)
|
||||
{
|
||||
int color;
|
||||
|
||||
@ -421,14 +420,14 @@ void Button_Select_backcolor(void)
|
||||
{
|
||||
Get_input(20);
|
||||
|
||||
if (Button_under_mouse()==BUTTON_CHOOSE_COL)
|
||||
if (Button_under_mouse()==btn)
|
||||
break; // This will repeat this button's action
|
||||
|
||||
} while(Mouse_K);
|
||||
} while(Mouse_K);
|
||||
}
|
||||
|
||||
void Button_Hide_menu(void)
|
||||
void Button_Hide_menu(int btn)
|
||||
{
|
||||
Hide_cursor();
|
||||
if (Menu_is_visible)
|
||||
@ -484,11 +483,11 @@ void Button_Hide_menu(void)
|
||||
if (Main.magnifier_mode)
|
||||
Display_all_screen();
|
||||
}
|
||||
Unselect_button(BUTTON_HIDE);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
void Button_Toggle_toolbar(void)
|
||||
void Button_Toggle_toolbar(int btn)
|
||||
{
|
||||
T_Dropdown_button dropdown;
|
||||
T_Dropdown_choice *item;
|
||||
@ -562,11 +561,11 @@ void Button_Toggle_toolbar(void)
|
||||
// Closing
|
||||
Window_dropdown_clear_items(&dropdown);
|
||||
|
||||
Unselect_button(BUTTON_HIDE);
|
||||
Unselect_button(btn);
|
||||
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
|
||||
static word Last_visibility = 0xFFFF;
|
||||
@ -598,7 +597,7 @@ void Button_Toggle_all_toolbars(void)
|
||||
Display_menu();
|
||||
Display_all_screen();
|
||||
|
||||
Unselect_button(BUTTON_HIDE);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
@ -672,7 +671,7 @@ byte Button_Quit_local_function(void)
|
||||
}
|
||||
|
||||
|
||||
void Button_Quit(void)
|
||||
void Button_Quit(int btn)
|
||||
{
|
||||
//short clicked_button;
|
||||
|
||||
@ -680,7 +679,7 @@ void Button_Quit(void)
|
||||
{
|
||||
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
|
||||
if (Button_Quit_local_function())
|
||||
Quitting=1;
|
||||
@ -700,7 +699,7 @@ void Button_Quit(void)
|
||||
|
||||
|
||||
//---------------------------- Effacer l'écran -------------------------------
|
||||
void Button_Clear(void)
|
||||
void Button_Clear(int btn)
|
||||
{
|
||||
Hide_cursor();
|
||||
Backup();
|
||||
@ -711,11 +710,11 @@ void Button_Clear(void)
|
||||
Redraw_layered_image();
|
||||
End_of_modification();
|
||||
Display_all_screen();
|
||||
Unselect_button(BUTTON_CLEAR);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
void Button_Clear_with_backcolor(void)
|
||||
void Button_Clear_with_backcolor(int btn)
|
||||
{
|
||||
Hide_cursor();
|
||||
Backup();
|
||||
@ -726,7 +725,7 @@ void Button_Clear_with_backcolor(void)
|
||||
Redraw_layered_image();
|
||||
End_of_modification();
|
||||
Display_all_screen();
|
||||
Unselect_button(BUTTON_CLEAR);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
@ -943,7 +942,7 @@ void Settings_load_config(T_Config * conf)
|
||||
Error(0);
|
||||
}
|
||||
|
||||
void Button_Settings(void)
|
||||
void Button_Settings(int btn)
|
||||
{
|
||||
short clicked_button;
|
||||
T_Config selected_config;
|
||||
@ -1196,7 +1195,7 @@ void Button_Settings(void)
|
||||
Compute_optimal_menu_colors(Main.palette);
|
||||
|
||||
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
|
||||
Display_menu();
|
||||
@ -1275,7 +1274,7 @@ void Draw_one_skin_name(word x, word y, word index, byte highlighted)
|
||||
}
|
||||
|
||||
/// Skin selector window
|
||||
void Button_Skins(void)
|
||||
void Button_Skins(int btn)
|
||||
{
|
||||
short clicked_button;
|
||||
short temp;
|
||||
@ -1293,7 +1292,7 @@ void Button_Skins(void)
|
||||
|
||||
word x, y, x_pos, offs_y;
|
||||
|
||||
char * cursors[] = { "Solid", "Transparent", "Thin" };
|
||||
const char * cursors[] = { "Solid", "Transparent", "Thin" };
|
||||
T_Gui_skin * gfx = NULL;
|
||||
byte * new_font;
|
||||
|
||||
@ -1525,7 +1524,7 @@ void Button_Skins(void)
|
||||
Set_palette(Main.palette);
|
||||
|
||||
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
|
||||
Display_menu();
|
||||
@ -1550,7 +1549,7 @@ void Button_Skins(void)
|
||||
|
||||
|
||||
//---------------------------- Changement de page ----------------------------
|
||||
void Button_Page(void)
|
||||
void Button_Page(int btn)
|
||||
{
|
||||
byte factor_index;
|
||||
T_Document temp_doc;
|
||||
@ -1594,7 +1593,7 @@ void Button_Page(void)
|
||||
Compute_optimal_menu_colors(Main.palette);
|
||||
Check_menu_mode();
|
||||
Display_all_screen();
|
||||
Unselect_button(BUTTON_PAGE);
|
||||
Unselect_button(btn);
|
||||
Draw_menu_button(BUTTON_MAGNIFIER,Main.magnifier_mode);
|
||||
// Tilemap mode might be different
|
||||
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;
|
||||
|
||||
@ -1767,13 +1766,13 @@ void Button_Copy_page(void)
|
||||
}
|
||||
|
||||
Hide_cursor();
|
||||
Unselect_button(BUTTON_PAGE);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
// -- Suppression d'une page -------------------------------------------------
|
||||
void Button_Kill(void)
|
||||
void Button_Kill(int btn)
|
||||
{
|
||||
if ( (Main.backups->List_size==1)
|
||||
|| (!Confirmation_box("Delete the current page?")) )
|
||||
@ -1781,7 +1780,7 @@ void Button_Kill(void)
|
||||
if (Main.backups->List_size==1)
|
||||
Warning_message("You can't delete the last page.");
|
||||
Hide_cursor();
|
||||
Unselect_button(BUTTON_KILL);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
else
|
||||
@ -1793,7 +1792,7 @@ void Button_Kill(void)
|
||||
Compute_optimal_menu_colors(Main.palette);
|
||||
|
||||
Display_all_screen();
|
||||
Unselect_button(BUTTON_KILL);
|
||||
Unselect_button(btn);
|
||||
Draw_menu_button(BUTTON_MAGNIFIER,Main.magnifier_mode);
|
||||
Display_menu();
|
||||
Display_cursor();
|
||||
@ -1900,7 +1899,7 @@ void Scroll_list_of_modes(short list_start, short cursor_position, int * selecte
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
void Button_Resolution(void)
|
||||
void Button_Resolution(int btn)
|
||||
{
|
||||
short clicked_button;
|
||||
int selected_mode;
|
||||
@ -2215,18 +2214,18 @@ void Button_Resolution(void)
|
||||
Paintbrush_Y = Mouse_Y;
|
||||
|
||||
|
||||
Unselect_button(BUTTON_RESOL);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
void Button_Safety_resolution(void)
|
||||
void Button_Safety_resolution(int btn)
|
||||
{
|
||||
// In windowed mode, do nothing
|
||||
if (Current_resolution==0)
|
||||
{
|
||||
Hide_cursor();
|
||||
Unselect_button(BUTTON_RESOL);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
return;
|
||||
}
|
||||
@ -2245,7 +2244,7 @@ void Button_Safety_resolution(void)
|
||||
Reposition_palette();
|
||||
Display_all_screen();
|
||||
|
||||
Unselect_button(BUTTON_RESOL);
|
||||
Unselect_button(btn);
|
||||
// Le pinceau est affiché à la position du clic et pas
|
||||
Display_cursor();
|
||||
}
|
||||
@ -2253,15 +2252,16 @@ void Button_Safety_resolution(void)
|
||||
|
||||
//------------------ Gestion des boutons de dessin à la main -----------------
|
||||
|
||||
void Button_Draw(void)
|
||||
void Button_Draw(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
Hide_cursor();
|
||||
Start_operation_stack(Selected_freehand_mode);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
void Button_Draw_switch_mode(void)
|
||||
void Button_Draw_switch_mode(int btn)
|
||||
{
|
||||
char icon;
|
||||
|
||||
@ -2271,9 +2271,9 @@ void Button_Draw_switch_mode(void)
|
||||
static const char text[4][14] =
|
||||
{"Continuous", "Discontinuous", "Single", "Contour fill"};
|
||||
|
||||
dropdown.Pos_X =Buttons_Pool[BUTTON_DRAW].X_offset;
|
||||
dropdown.Pos_Y =Buttons_Pool[BUTTON_DRAW].Y_offset;
|
||||
dropdown.Height =Buttons_Pool[BUTTON_DRAW].Height;
|
||||
dropdown.Pos_X =Buttons_Pool[btn].X_offset;
|
||||
dropdown.Pos_Y =Buttons_Pool[btn].Y_offset;
|
||||
dropdown.Height =Buttons_Pool[btn].Height;
|
||||
dropdown.Dropdown_width=14*8;
|
||||
dropdown.First_item =NULL;
|
||||
dropdown.Bottom_up =1;
|
||||
@ -2316,8 +2316,8 @@ void Button_Draw_switch_mode(void)
|
||||
icon=MENU_SPRITE_CONTOUR_DRAW;
|
||||
break;
|
||||
}
|
||||
Display_sprite_in_menu(BUTTON_DRAW,icon);
|
||||
Draw_menu_button(BUTTON_DRAW,BUTTON_PRESSED);
|
||||
Display_sprite_in_menu(btn,icon);
|
||||
Draw_menu_button(btn,BUTTON_PRESSED);
|
||||
Start_operation_stack(Selected_freehand_mode);
|
||||
|
||||
Display_cursor();
|
||||
@ -2327,16 +2327,18 @@ void Button_Draw_switch_mode(void)
|
||||
|
||||
// -- Gestion des boutons de rectangle vide et plein ------------------------
|
||||
|
||||
void Button_Empty_rectangle(void)
|
||||
void Button_Empty_rectangle(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
Hide_cursor();
|
||||
Start_operation_stack(OPERATION_EMPTY_RECTANGLE);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
void Button_Filled_rectangle(void)
|
||||
void Button_Filled_rectangle(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
Hide_cursor();
|
||||
Start_operation_stack(OPERATION_FILLED_RECTANGLE);
|
||||
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);
|
||||
}
|
||||
|
||||
void Button_Gradients(void)
|
||||
void Button_Gradients(int btn)
|
||||
{
|
||||
short clicked_button;
|
||||
char str[4];
|
||||
@ -2539,6 +2541,7 @@ void Button_Gradients(void)
|
||||
int changed_gradient_index;
|
||||
byte cycling_mode=Cycling_mode;
|
||||
|
||||
(void)btn;
|
||||
// Enable cycling while this window is open
|
||||
Cycling_mode=1;
|
||||
|
||||
@ -2815,9 +2818,9 @@ void Button_Gradients(void)
|
||||
|
||||
// -- Gestion des boutons de cercle / ellipse / rectangle dégradés --------------------
|
||||
|
||||
|
||||
void Button_Grad_rectangle(void)
|
||||
void Button_Grad_rectangle(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
Hide_cursor();
|
||||
Start_operation_stack(OPERATION_GRAD_RECTANGLE);
|
||||
Display_cursor();
|
||||
@ -2826,8 +2829,9 @@ void Button_Grad_rectangle(void)
|
||||
|
||||
// -- Gestion du bouton de remplissage ---------------------------------------
|
||||
|
||||
void Button_Fill(void)
|
||||
void Button_Fill(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
if (Current_operation!=OPERATION_FILL)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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;
|
||||
|
||||
if (Current_operation==OPERATION_REPLACE)
|
||||
@ -2899,7 +2905,7 @@ byte Same_paintbrush(byte index)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void Button_Paintbrush_menu(void)
|
||||
void Button_Paintbrush_menu(int btn)
|
||||
{
|
||||
short clicked_button;
|
||||
short x_pos,y_pos;
|
||||
@ -3051,18 +3057,18 @@ void Button_Paintbrush_menu(void)
|
||||
}
|
||||
while (1);
|
||||
|
||||
Unselect_button(BUTTON_PAINTBRUSHES);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
void Button_Brush_monochrome(void)
|
||||
void Button_Brush_monochrome(int btn)
|
||||
{
|
||||
Hide_cursor();
|
||||
// On passe en brosse monochrome:
|
||||
Change_paintbrush_shape(PAINTBRUSH_SHAPE_MONO_BRUSH);
|
||||
|
||||
Unselect_button(BUTTON_PAINTBRUSHES);
|
||||
Unselect_button(btn);
|
||||
|
||||
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
|
||||
// restituer en cas d'erreur n'affectant pas l'image
|
||||
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;
|
||||
int new_mode;
|
||||
|
||||
(void)btn;
|
||||
// On sauve l'état actuel des paramètres de l'image pour pouvoir les
|
||||
// restituer en cas d'erreur n'affectant pas l'image
|
||||
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 main image over existing file (no fileselector)
|
||||
void Button_Autosave(void)
|
||||
void Button_Autosave(int btn)
|
||||
{
|
||||
byte old_cursor_shape;
|
||||
static char filename[MAX_PATH_CHARACTERS];
|
||||
byte file_already_exists;
|
||||
|
||||
|
||||
(void)btn;
|
||||
Get_full_filename(filename, Main.backups->Pages->Filename, Main.backups->Pages->File_directory);
|
||||
file_already_exists=File_exists(filename);
|
||||
|
||||
@ -3608,44 +3617,38 @@ void Button_Autosave(void)
|
||||
|
||||
// -- Gestion des boutons de ligne ------------------------------------------
|
||||
|
||||
void Button_Lines(void)
|
||||
void Button_Lines(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
Hide_cursor();
|
||||
Start_operation_stack(Selected_line_mode);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
void Button_Lines_switch_mode(void)
|
||||
void Button_Lines_switch_mode(int btn)
|
||||
{
|
||||
char icon;
|
||||
|
||||
if (Selected_line_mode==OPERATION_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
|
||||
{
|
||||
if (Selected_line_mode==OPERATION_K_LINE)
|
||||
Selected_line_mode=OPERATION_CENTERED_LINES;
|
||||
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;
|
||||
Selected_line_mode=OPERATION_LINE;
|
||||
icon=-1;
|
||||
}
|
||||
|
||||
Hide_cursor();
|
||||
Display_sprite_in_menu(BUTTON_LINES,icon);
|
||||
Draw_menu_button(BUTTON_LINES,BUTTON_PRESSED);
|
||||
Display_sprite_in_menu(btn,icon);
|
||||
Draw_menu_button(btn,BUTTON_PRESSED);
|
||||
Start_operation_stack(Selected_line_mode);
|
||||
Display_cursor();
|
||||
}
|
||||
@ -3653,34 +3656,34 @@ void Button_Lines_switch_mode(void)
|
||||
|
||||
// -- Button de brosse ------------------------------------------------------
|
||||
|
||||
void Button_Brush(void)
|
||||
void Button_Brush(int btn)
|
||||
{
|
||||
Hide_cursor();
|
||||
|
||||
if (Current_operation!=OPERATION_GRAB_BRUSH)
|
||||
Start_operation_stack(OPERATION_GRAB_BRUSH);
|
||||
else
|
||||
Unselect_button(BUTTON_BRUSH);
|
||||
Unselect_button(btn);
|
||||
|
||||
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:
|
||||
Start_operation_stack(Operation_before_interrupt);
|
||||
}
|
||||
|
||||
|
||||
void Button_Restore_brush(void)
|
||||
void Button_Restore_brush(int btn)
|
||||
{
|
||||
Hide_cursor();
|
||||
// On passe en brosse couleur:
|
||||
Change_paintbrush_shape(PAINTBRUSH_SHAPE_COLOR_BRUSH);
|
||||
|
||||
Unselect_button(BUTTON_BRUSH);
|
||||
Unselect_button(BUTTON_POLYBRUSH);
|
||||
Unselect_button(btn);
|
||||
|
||||
Display_cursor();
|
||||
}
|
||||
@ -3688,7 +3691,7 @@ void Button_Restore_brush(void)
|
||||
|
||||
// -- Button de prise de brosse au lasso ------------------------------------
|
||||
|
||||
void Button_Lasso(void)
|
||||
void Button_Lasso(int btn)
|
||||
{
|
||||
Hide_cursor();
|
||||
|
||||
@ -3699,14 +3702,15 @@ void Button_Lasso(void)
|
||||
Start_operation_stack(OPERATION_POLYBRUSH);
|
||||
}
|
||||
else
|
||||
Unselect_button(BUTTON_POLYBRUSH);
|
||||
Unselect_button(btn);
|
||||
|
||||
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:
|
||||
Start_operation_stack(Operation_before_interrupt);
|
||||
Paintbrush_shape=Paintbrush_shape_before_lasso;
|
||||
@ -3715,7 +3719,7 @@ void Button_Unselect_lasso(void)
|
||||
|
||||
// -- Button de pipette -----------------------------------------------------
|
||||
|
||||
void Button_Colorpicker(void)
|
||||
void Button_Colorpicker(int btn)
|
||||
{
|
||||
Hide_cursor();
|
||||
|
||||
@ -3731,14 +3735,15 @@ void Button_Colorpicker(void)
|
||||
Print_in_menu("X: Y: ( )",0);
|
||||
}
|
||||
else
|
||||
Unselect_button(BUTTON_COLORPICKER);
|
||||
Unselect_button(btn);
|
||||
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
void Button_Unselect_colorpicker(void)
|
||||
void Button_Unselect_colorpicker(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
// Erase the color block which shows the picked color
|
||||
if (Operation_before_interrupt!=OPERATION_REPLACE)
|
||||
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 --
|
||||
void Button_Invert_foreback(void)
|
||||
void Button_Invert_foreback(int btn)
|
||||
{
|
||||
byte temp_color;
|
||||
|
||||
@ -3768,7 +3773,7 @@ void Button_Invert_foreback(void)
|
||||
Frame_menu_color(Fore_color);
|
||||
Reposition_palette();
|
||||
Display_foreback();
|
||||
Unselect_button(BUTTON_COLORPICKER);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
@ -3777,12 +3782,12 @@ void Button_Invert_foreback(void)
|
||||
|
||||
byte Coming_from_zoom_factor_menu=0;
|
||||
|
||||
void Button_Magnify(void)
|
||||
void Button_Magnify(int btn)
|
||||
{
|
||||
Hide_cursor();
|
||||
if ( (Current_operation==OPERATION_MAGNIFY) || (Main.magnifier_mode) )
|
||||
{
|
||||
Unselect_button(BUTTON_MAGNIFIER);
|
||||
Unselect_button(btn);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3826,15 +3831,16 @@ void Button_Magnify(void)
|
||||
Update_rect(0,0,0,0);
|
||||
}
|
||||
|
||||
void Button_Magnify_menu(void)
|
||||
void Button_Magnify_menu(int btn)
|
||||
{
|
||||
T_Dropdown_button dropdown;
|
||||
T_Dropdown_choice *item;
|
||||
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",
|
||||
"x24", "x28", "x32"};
|
||||
|
||||
(void)btn;
|
||||
Hide_cursor();
|
||||
|
||||
dropdown.Pos_X =Buttons_Pool[BUTTON_MAGNIFIER].X_offset;
|
||||
@ -3871,8 +3877,9 @@ void Button_Magnify_menu(void)
|
||||
Window_dropdown_clear_items(&dropdown);
|
||||
}
|
||||
|
||||
void Button_Unselect_magnifier(void)
|
||||
void Button_Unselect_magnifier(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
if (Main.magnifier_mode)
|
||||
{
|
||||
// On sort du mode loupe
|
||||
@ -3914,7 +3921,7 @@ void Button_Unselect_magnifier(void)
|
||||
|
||||
// ----------------------- Modifications de brosse ---------------------------
|
||||
|
||||
void Button_Brush_FX(void)
|
||||
void Button_Brush_FX(int btn)
|
||||
{
|
||||
short clicked_button;
|
||||
short index;
|
||||
@ -4003,7 +4010,7 @@ void Button_Brush_FX(void)
|
||||
while (clicked_button<=0);
|
||||
|
||||
Close_window();
|
||||
Unselect_button(BUTTON_BRUSH_EFFECTS);
|
||||
Unselect_button(btn);
|
||||
|
||||
// Gestion du bouton clické
|
||||
switch (clicked_button)
|
||||
@ -4088,15 +4095,16 @@ void Button_Brush_FX(void)
|
||||
|
||||
//---------------------------- Courbes de Bézier ----------------------------
|
||||
|
||||
void Button_Curves(void)
|
||||
void Button_Curves(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
Hide_cursor();
|
||||
Start_operation_stack(Selected_curve_mode);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
void Button_Curves_switch_mode(void)
|
||||
void Button_Curves_switch_mode(int btn)
|
||||
{
|
||||
if (Selected_curve_mode==OPERATION_4_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;
|
||||
|
||||
Hide_cursor();
|
||||
Display_sprite_in_menu(BUTTON_CURVES,Selected_curve_mode==OPERATION_4_POINTS_CURVE?MENU_SPRITE_4_POINTS_CURVE:-1);
|
||||
Draw_menu_button(BUTTON_CURVES,BUTTON_PRESSED);
|
||||
Display_sprite_in_menu(btn,Selected_curve_mode==OPERATION_4_POINTS_CURVE?MENU_SPRITE_4_POINTS_CURVE:-1);
|
||||
Draw_menu_button(btn,BUTTON_PRESSED);
|
||||
Start_operation_stack(Selected_curve_mode);
|
||||
Display_cursor();
|
||||
}
|
||||
@ -4113,8 +4121,9 @@ void Button_Curves_switch_mode(void)
|
||||
|
||||
//--------------------------------- Spray -----------------------------------
|
||||
|
||||
void Button_Airbrush(void)
|
||||
void Button_Airbrush(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
Hide_cursor();
|
||||
Start_operation_stack(OPERATION_AIRBRUSH);
|
||||
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;
|
||||
short clicked_button;
|
||||
@ -4161,7 +4170,7 @@ void Button_Airbrush_menu(void)
|
||||
byte color;
|
||||
byte click;
|
||||
|
||||
|
||||
(void)btn;
|
||||
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 -------------------------
|
||||
|
||||
void Button_polygon(void)
|
||||
void Button_polygon(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
Hide_cursor();
|
||||
Start_operation_stack(OPERATION_POLYGON);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
void Button_Polyform(void)
|
||||
void Button_Polyform(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
Hide_cursor();
|
||||
Start_operation_stack(OPERATION_POLYFORM);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
void Button_Polyfill(void)
|
||||
void Button_Polyfill(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
Hide_cursor();
|
||||
Start_operation_stack(OPERATION_POLYFILL);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
void Button_Filled_polyform(void)
|
||||
void Button_Filled_polyform(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
Hide_cursor();
|
||||
Start_operation_stack(OPERATION_FILLED_POLYFORM);
|
||||
Display_cursor();
|
||||
@ -4517,8 +4530,9 @@ void Button_Filled_polyform(void)
|
||||
|
||||
// -- Boutons d'ajustement de l'image ---------------------------------------
|
||||
|
||||
void Button_Adjust(void)
|
||||
void Button_Adjust(int btn)
|
||||
{
|
||||
(void)btn;
|
||||
Hide_cursor();
|
||||
Start_operation_stack(OPERATION_SCROLL);
|
||||
Display_cursor();
|
||||
@ -4584,7 +4598,7 @@ void Display_feedback_state(void)
|
||||
}
|
||||
|
||||
|
||||
void Button_Effects(void)
|
||||
void Button_Effects(int btn)
|
||||
{
|
||||
short clicked_button;
|
||||
byte exit_by_close_button=0;
|
||||
@ -4914,7 +4928,7 @@ void Button_Effects(void)
|
||||
Hide_cursor();
|
||||
|
||||
if (!Any_effect_active())
|
||||
Unselect_button(BUTTON_EFFECTS);
|
||||
Unselect_button(btn);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
void Button_Text(void)
|
||||
void Button_Text(int btn)
|
||||
{
|
||||
static char str[256]="";
|
||||
static int font_size=32;
|
||||
@ -4955,6 +4969,7 @@ void Button_Text(void)
|
||||
byte redraw_is_needed=1;
|
||||
byte preview_is_needed=1;
|
||||
|
||||
(void)btn;
|
||||
Open_window(288,180,"Text");
|
||||
|
||||
// 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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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
|
||||
|
||||
@ -97,13 +97,13 @@ void Button_Select_backcolor(void);
|
||||
Callback for the brush button left click.
|
||||
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.
|
||||
Displays the "Paintbrush menu".
|
||||
*/
|
||||
void Button_Paintbrush_menu(void);
|
||||
void Button_Paintbrush_menu(int);
|
||||
|
||||
// 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.
|
||||
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.
|
||||
Cycles the drawing modes for the freehand tool.
|
||||
*/
|
||||
void Button_Draw_switch_mode(void);
|
||||
void Button_Draw_switch_mode(int);
|
||||
|
||||
// Dessin par ligne
|
||||
|
||||
@ -125,13 +125,13 @@ void Button_Draw_switch_mode(void);
|
||||
Callback for the lines button left click.
|
||||
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.
|
||||
Cycles the drawing modes for the lines tool.
|
||||
*/
|
||||
void Button_Lines_switch_mode(void);
|
||||
void Button_Lines_switch_mode(int);
|
||||
|
||||
// Button relatif au remplissage
|
||||
|
||||
@ -139,20 +139,20 @@ void Button_Lines_switch_mode(void);
|
||||
Callback for the fill button left click.
|
||||
Start the filling operation.
|
||||
*/
|
||||
void Button_Fill(void);
|
||||
void Button_Fill(int);
|
||||
|
||||
/*!
|
||||
Callback for the fill button right click.
|
||||
Start the color replace operation.
|
||||
*/
|
||||
void Button_Replace(void);
|
||||
void Button_Replace(int);
|
||||
|
||||
/*!
|
||||
Disable and release the fill button.
|
||||
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.
|
||||
*/
|
||||
void Button_Unselect_fill(void);
|
||||
void Button_Unselect_fill(int);
|
||||
|
||||
// Spray
|
||||
|
||||
@ -160,13 +160,13 @@ void Button_Unselect_fill(void);
|
||||
Callback for the spray button left click.
|
||||
Start the spray operation.
|
||||
*/
|
||||
void Button_Airbrush(void);
|
||||
void Button_Airbrush(int);
|
||||
|
||||
/*!
|
||||
Callback for the spray button right click.
|
||||
Opens the spray's setup menu.
|
||||
*/
|
||||
void Button_Airbrush_menu(void);
|
||||
void Button_Airbrush_menu(int);
|
||||
|
||||
// Courbes de Bézier
|
||||
|
||||
@ -174,13 +174,13 @@ void Button_Airbrush_menu(void);
|
||||
Callback for the curves button left click.
|
||||
Start curve operation according to the selected mode.
|
||||
*/
|
||||
void Button_Curves(void);
|
||||
void Button_Curves(int);
|
||||
|
||||
/*!
|
||||
Callback for the curves button right click.
|
||||
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
|
||||
|
||||
@ -188,13 +188,13 @@ void Button_Curves_switch_mode(void);
|
||||
Callback for the empty rectangle button.
|
||||
Start the rectangle operation.
|
||||
*/
|
||||
void Button_Empty_rectangle(void);
|
||||
void Button_Empty_rectangle(int);
|
||||
|
||||
/*!
|
||||
Callback for the filled rectangle button.
|
||||
Start the filled rectangle operation.
|
||||
*/
|
||||
void Button_Filled_rectangle(void);
|
||||
void Button_Filled_rectangle(int);
|
||||
|
||||
// Boutons relatifs au texte
|
||||
|
||||
@ -202,7 +202,7 @@ void Button_Filled_rectangle(void);
|
||||
Callback for the text button.
|
||||
Opens the text setup window.
|
||||
*/
|
||||
void Button_Text(void);
|
||||
void Button_Text(int);
|
||||
|
||||
// Boutons relatifs aux dégradés
|
||||
|
||||
@ -210,7 +210,7 @@ void Button_Text(void);
|
||||
Callback for the gradation button.
|
||||
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.
|
||||
@ -222,7 +222,7 @@ void Load_gradient_data(int index);
|
||||
Callback for the gradation rectangle button.
|
||||
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
|
||||
|
||||
@ -244,25 +244,25 @@ void Button_Circle_switch_mode(int);
|
||||
Callback for the polyline button left click.
|
||||
Starts drawing a polygon.
|
||||
*/
|
||||
void Button_polygon(void);
|
||||
void Button_polygon(int);
|
||||
|
||||
/*!
|
||||
Callback for the polyline right click.
|
||||
Starts drawing a polyform.
|
||||
*/
|
||||
void Button_Polyform(void);
|
||||
void Button_Polyform(int);
|
||||
|
||||
/*!
|
||||
Callback for the polyfill button left click.
|
||||
Starts drawing a filled polygon.
|
||||
*/
|
||||
void Button_Polyfill(void);
|
||||
void Button_Polyfill(int);
|
||||
|
||||
/*!
|
||||
Callback for the polyfill button right click.
|
||||
Starts drawing a filled polyform.
|
||||
*/
|
||||
void Button_Filled_polyform(void);
|
||||
void Button_Filled_polyform(int);
|
||||
|
||||
// Boutons d'ajustement de l'image
|
||||
|
||||
@ -270,7 +270,7 @@ void Button_Filled_polyform(void);
|
||||
Callback for the adjust picture button.
|
||||
Start the adjust picture operation.
|
||||
*/
|
||||
void Button_Adjust(void);
|
||||
void Button_Adjust(int);
|
||||
|
||||
// Gestion du mode Shade
|
||||
|
||||
@ -430,7 +430,7 @@ void Effects_off(void);
|
||||
Callback for the effects button click.
|
||||
Displays the effect selection menu.
|
||||
*/
|
||||
void Button_Effects(void);
|
||||
void Button_Effects(int);
|
||||
|
||||
// Prise de brosse
|
||||
|
||||
@ -438,83 +438,83 @@ void Button_Effects(void);
|
||||
Callback for the brush button left click.
|
||||
Start the brush picking operation.
|
||||
*/
|
||||
void Button_Brush(void);
|
||||
void Button_Brush(int);
|
||||
|
||||
/*!
|
||||
Callback for the brush button right click.
|
||||
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.
|
||||
*/
|
||||
void Button_Unselect_brush(void);
|
||||
void Button_Unselect_brush(int);
|
||||
// Prise de brosse au lasso
|
||||
|
||||
/*!
|
||||
Callback for the freehand brush pick button left click.
|
||||
Starts freehand brush picking operation.
|
||||
*/
|
||||
void Button_Lasso(void);
|
||||
void Button_Lasso(int);
|
||||
|
||||
/*!
|
||||
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
|
||||
|
||||
/*!
|
||||
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.
|
||||
*/
|
||||
void Button_Unselect_colorpicker(void);
|
||||
void Button_Unselect_colorpicker(int);
|
||||
|
||||
/*!
|
||||
Swap fore- and background colors.
|
||||
*/
|
||||
void Button_Invert_foreback(void);
|
||||
void Button_Invert_foreback(int);
|
||||
|
||||
// Mode loupe
|
||||
|
||||
/*!
|
||||
Enters magnify mode.
|
||||
*/
|
||||
void Button_Magnify(void);
|
||||
void Button_Magnify(int);
|
||||
|
||||
/*!
|
||||
Displays magnify menu.
|
||||
*/
|
||||
void Button_Magnify_menu(void);
|
||||
void Button_Magnify_menu(int);
|
||||
|
||||
/*!
|
||||
Exit magnify mode.
|
||||
*/
|
||||
void Button_Unselect_magnifier(void);
|
||||
void Button_Unselect_magnifier(int);
|
||||
|
||||
// Les différents effets sur la brosse
|
||||
|
||||
/*!
|
||||
Display the Brush effects window.
|
||||
*/
|
||||
void Button_Brush_FX(void);
|
||||
void Button_Brush_FX(int);
|
||||
|
||||
// Boutons relatifs aux différentes pages
|
||||
|
||||
/*!
|
||||
Swap main and spare drawing pages.
|
||||
*/
|
||||
void Button_Page(void);
|
||||
void Button_Page(int);
|
||||
|
||||
/*!
|
||||
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).
|
||||
@ -524,101 +524,101 @@ void Copy_image_only(void);
|
||||
/*!
|
||||
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
|
||||
|
||||
/*!
|
||||
Display the screenmode menu.
|
||||
*/
|
||||
void Button_Resolution(void);
|
||||
void Button_Resolution(int);
|
||||
|
||||
/*!
|
||||
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
|
||||
|
||||
/*!
|
||||
Opens the load file dialog.
|
||||
*/
|
||||
void Button_Load(void);
|
||||
void Button_Load(int);
|
||||
|
||||
/*!
|
||||
Reload current picture from disk.
|
||||
*/
|
||||
void Button_Reload(void);
|
||||
void Button_Reload(int);
|
||||
|
||||
/*!
|
||||
Open the save file dialog.
|
||||
*/
|
||||
void Button_Save(void);
|
||||
void Button_Save(int);
|
||||
|
||||
/*!
|
||||
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
|
||||
|
||||
/*!
|
||||
Display the setting menu.
|
||||
*/
|
||||
void Button_Settings(void);
|
||||
void Button_Settings(int);
|
||||
|
||||
/*!
|
||||
Display the skin selector window.
|
||||
*/
|
||||
void Button_Skins(void);
|
||||
void Button_Skins(int);
|
||||
|
||||
// Annulation de la dernière modification
|
||||
|
||||
/*!
|
||||
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
|
||||
|
||||
/*!
|
||||
Clear the whole screen with black (color index 0).
|
||||
*/
|
||||
void Button_Clear(void);
|
||||
void Button_Clear(int);
|
||||
|
||||
/*!
|
||||
Clear the screen with the selected backcolor.
|
||||
*/
|
||||
void Button_Clear_with_backcolor(void);
|
||||
void Button_Clear_with_backcolor(int);
|
||||
|
||||
// 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.
|
||||
*/
|
||||
void Button_Quit(void);
|
||||
void Button_Quit(int);
|
||||
|
||||
// Cacher le menu
|
||||
|
||||
/*!
|
||||
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
|
||||
*/
|
||||
void Button_Toggle_toolbar(void);
|
||||
void Button_Toggle_toolbar(int);
|
||||
|
||||
/*!
|
||||
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)
|
||||
{
|
||||
Quit_is_required=0;
|
||||
Button_Quit();
|
||||
Button_Quit(-1);
|
||||
}
|
||||
|
||||
if (Pan_shortcut_pressed && Current_operation!=OPERATION_PAN_VIEW)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* vim:expandtab:ts=2 sw=2:
|
||||
*/
|
||||
void Button_Brush_Factory(void);
|
||||
void Button_Brush_Factory(int);
|
||||
void Repeat_script(void);
|
||||
|
||||
/// 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;
|
||||
|
||||
(void)btn;
|
||||
// Aide contextuelle
|
||||
if (Key!=0)
|
||||
{
|
||||
@ -679,7 +680,7 @@ void Window_help(int section, const char *sub_section)
|
||||
|
||||
#define STATS_TITLE_COLOR MC_White
|
||||
#define STATS_DATA_COLOR MC_Light
|
||||
void Button_Stats(void)
|
||||
void Button_Stats(int btn)
|
||||
{
|
||||
short clicked_button;
|
||||
char buffer[37];
|
||||
@ -887,7 +888,7 @@ void Button_Stats(void)
|
||||
if(Key==SDLK_RETURN)Key=0;
|
||||
|
||||
Close_window();
|
||||
Unselect_button(BUTTON_HELP);
|
||||
Unselect_button(btn);
|
||||
Display_cursor();
|
||||
}
|
||||
|
||||
|
||||
@ -32,12 +32,12 @@
|
||||
If the mouse is over a button, its contextual help will be displayed.
|
||||
Else, the default helpscreen will be shown.
|
||||
*/
|
||||
void Button_Help(void);
|
||||
void Button_Help(int);
|
||||
|
||||
/*!
|
||||
Displays and runs the "Statistics" window
|
||||
*/
|
||||
void Button_Stats(void);
|
||||
void Button_Stats(int);
|
||||
|
||||
/*!
|
||||
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/>
|
||||
*/
|
||||
|
||||
void Button_Layer_add(void);
|
||||
void Button_Layer_duplicate(void);
|
||||
void Button_Layer_remove(void);
|
||||
void Button_Layer_menu(void);
|
||||
void Button_Layer_set_transparent(void);
|
||||
void Button_Layer_get_transparent(void);
|
||||
void Button_Layer_merge(void);
|
||||
void Button_Layer_up(void);
|
||||
void Button_Layer_down(void);
|
||||
void Button_Layer_select(void);
|
||||
void Button_Layer_toggle(void);
|
||||
void Button_Layer_add(int);
|
||||
void Button_Layer_duplicate(int);
|
||||
void Button_Layer_remove(int);
|
||||
void Button_Layer_menu(int);
|
||||
void Button_Layer_set_transparent(int);
|
||||
void Button_Layer_get_transparent(int);
|
||||
void Button_Layer_merge(int);
|
||||
void Button_Layer_up(int);
|
||||
void Button_Layer_down(int);
|
||||
void Button_Layer_select(int);
|
||||
void Button_Layer_toggle(int);
|
||||
void Layer_activate(int layer, short side);
|
||||
void Button_Anim_time(void);
|
||||
void Button_Anim_first_frame(void);
|
||||
void Button_Anim_prev_frame(void);
|
||||
void Button_Anim_next_frame(void);
|
||||
void Button_Anim_last_frame(void);
|
||||
void Button_Anim_play(void);
|
||||
void Button_Anim_continuous_prev(void);
|
||||
void Button_Anim_continuous_next(void);
|
||||
void Button_Anim_time(int);
|
||||
void Button_Anim_first_frame(int);
|
||||
void Button_Anim_prev_frame(int);
|
||||
void Button_Anim_next_frame(int);
|
||||
void Button_Anim_last_frame(int);
|
||||
void Button_Anim_play(int);
|
||||
void Button_Anim_continuous_prev(int);
|
||||
void Button_Anim_continuous_next(int);
|
||||
|
||||
short Layer_under_mouse(void);
|
||||
|
||||
@ -1680,7 +1680,7 @@ if (Create_lock_file(Config_directory))
|
||||
Compute_limits();
|
||||
Compute_paintbrush_coordinates();
|
||||
if (Backups_main)
|
||||
Button_Page();
|
||||
Button_Page(-1);
|
||||
}
|
||||
restored_main = Process_backups(&Backups_main);
|
||||
|
||||
|
||||
@ -921,7 +921,7 @@ int Init_program(int argc,char * argv[])
|
||||
Redraw_layered_image();
|
||||
End_of_modification();
|
||||
|
||||
Button_Page();
|
||||
Button_Page(-1);
|
||||
// no break ! proceed with the other file now
|
||||
case 1:
|
||||
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);
|
||||
}
|
||||
|
||||
void Button_Palette(void)
|
||||
void Button_Palette(int btn)
|
||||
{
|
||||
static const int BUTTON_PLUS_X = 182;
|
||||
static const int BUTTON_PLUS_Y = 163;
|
||||
@ -1145,6 +1145,7 @@ void Button_Palette(void)
|
||||
static const int L3 = 46;
|
||||
static const int L4 = 61;
|
||||
|
||||
(void)btn;
|
||||
backup_palette =(T_Components *)malloc(sizeof(T_Palette));
|
||||
temp_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 ------------------------
|
||||
|
||||
void Button_Secondary_palette(void)
|
||||
void Button_Secondary_palette(int btn)
|
||||
{
|
||||
short clicked_button;
|
||||
byte dummy;
|
||||
@ -2894,7 +2895,7 @@ void Button_Secondary_palette(void)
|
||||
static const int RGBScale_X = 161;
|
||||
static const int RGBScale_Y = 85;
|
||||
|
||||
|
||||
(void)btn;
|
||||
Open_window(218,146,"Palettes");
|
||||
|
||||
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.
|
||||
void Button_Palette(void);
|
||||
void Button_Palette(int);
|
||||
/// 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.
|
||||
void Set_palette_RGB_scale(int);
|
||||
|
||||
@ -72,7 +72,7 @@ short Compute_dimension(short original_size, short new_ratio, short old_ratio)
|
||||
return amount;
|
||||
}
|
||||
|
||||
void Button_Transform_menu(void)
|
||||
void Button_Transform_menu(int btn)
|
||||
{
|
||||
enum RESIZE_UNIT {
|
||||
UNIT_PIXELS = 1,
|
||||
@ -198,7 +198,7 @@ void Button_Transform_menu(void)
|
||||
if (Is_shortcut(Key,0x100+BUTTON_HELP))
|
||||
{
|
||||
Key=0;
|
||||
Window_help(BUTTON_ADJUST, "PICTURE TRANSFORM");
|
||||
Window_help(btn, "PICTURE TRANSFORM");
|
||||
}
|
||||
else if (Is_shortcut(Key,0x200+BUTTON_ADJUST))
|
||||
clicked_button=1;
|
||||
@ -340,7 +340,7 @@ void Button_Transform_menu(void)
|
||||
|
||||
// The Scroll operation uses the same button as transformation menu.
|
||||
if (Current_operation != OPERATION_SCROLL)
|
||||
Unselect_button(BUTTON_ADJUST);
|
||||
Unselect_button(btn);
|
||||
|
||||
if (clicked_button != 1) // 1 is Cancel
|
||||
{
|
||||
|
||||
@ -26,4 +26,4 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/// 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