GrafX2 2.9.3227
The ultimate 256-color painting program
buttons.h File Reference

Almost all the editor actions that are called by the menu are here. More...

#include "struct.h"
#include "loadsave.h"
+ Include dependency graph for buttons.h:
+ This graph shows which files directly or indirectly include this file:

Functions

void Stencil_update_color (byte color)
 
void Stencil_tag_color (byte color, byte tag_color)
 
void Message_out_of_memory (void)
 Displays an error message when there is no more memory for the requested operation. More...
 
void Button_Message_initial (void)
 Displays the splash screen at program startup. More...
 
void Change_paintbrush_shape (byte shape)
 Changes brush shape. More...
 
void Button_Pal_left (int)
 Callback for the palette scroller buttons left click. More...
 
void Button_Pal_left_fast (int)
 Callback for the palette scroller buttons right click. More...
 
void Button_Pal_right (int)
 Callback for the palette scroller buttons left click. More...
 
void Button_Pal_right_fast (int)
 Callback for the palette scroller buttons right click. More...
 
void Button_Select_forecolor (int)
 Callback for the palette color buttons left click. More...
 
void Button_Select_backcolor (int)
 Callback for the palette color buttons right click. More...
 
void Button_Brush_monochrome (int)
 Callback for the brush button left click. More...
 
void Button_Paintbrush_menu (int)
 Callback for the brush button right click. More...
 
void Button_Draw (int)
 Callback for the freehand draw button left click. More...
 
void Button_Draw_switch_mode (int)
 Callback for the freehand draw button right click. More...
 
void Button_Lines (int)
 Callback for the lines button left click. More...
 
void Button_Lines_switch_mode (int)
 Callback for the lines button right click. More...
 
void Button_Fill (int)
 Callback for the fill button left click. More...
 
void Button_Replace (int)
 Callback for the fill button right click. More...
 
void Button_Unselect_fill (int)
 Disable and release the fill button. More...
 
void Button_Airbrush (int)
 Callback for the spray button left click. More...
 
void Button_Airbrush_menu (int)
 Callback for the spray button right click. More...
 
void Button_Curves (int)
 Callback for the curves button left click. More...
 
void Button_Curves_switch_mode (int)
 Callback for the curves button right click. More...
 
void Button_Empty_rectangle (int)
 Callback for the empty rectangle button. More...
 
void Button_Filled_rectangle (int)
 Callback for the filled rectangle button. More...
 
void Button_Text (int)
 Callback for the text button. More...
 
void Button_Gradients (int)
 Callback for the gradation button. More...
 
void Load_gradient_data (int index)
 Gets the informations from the gradations table and set the global vars for the current gradation. More...
 
void Button_Grad_rectangle (int)
 Callback for the gradation rectangle button. More...
 
void Button_circle_ellipse (int btn)
 Callback for the circle/ellipse buttons Starts drawing circle/ellipse. More...
 
void Button_Circle_switch_mode (int)
 Callback for the cicle button right click. More...
 
void Button_polygon (int)
 Callback for the polyline button left click. More...
 
void Button_Polyform (int)
 Callback for the polyline right click. More...
 
void Button_Polyfill (int)
 Callback for the polyfill button left click. More...
 
void Button_Filled_polyform (int)
 Callback for the polyfill button right click. More...
 
void Button_Adjust (int)
 Callback for the adjust picture button. More...
 
void Button_Shade_mode (void)
 Callback for the shade button (in the FX window). More...
 
void Button_Quick_shade_mode (void)
 Callback for the QSHade button (in the FX window). More...
 
void Button_Shade_menu (void)
 Callback for the Shade button (in the FX window) right click. More...
 
void Button_Stencil_mode (void)
 Callback for the Stencil button (in the FX window) left click. More...
 
void Button_Stencil_menu (void)
 Callback for the Stencil button (in the FX window) right click. More...
 
void Button_Mask_mode (void)
 Callback for the Mask button (in the FX window) left click. More...
 
void Button_Mask_menu (void)
 Callback for the Mask button (in the FX window) right click. More...
 
void Button_Snap_mode (void)
 Callback for the Grid button (in the FX window) left click. More...
 
void Button_Grid_menu (void)
 Callback for the Grid button (in the FX window) right click. More...
 
void Button_Show_grid (void)
 Callback to toggle the grid visible in the magnified view. More...
 
void Copy_preset_sieve (byte index)
 In the sieve window, copy one of the presets patterns to the current one. More...
 
void Invert_trame (void)
 In the sieve window, swaps black and white in the current pattern. More...
 
void Button_Sieve_mode (void)
 Callback for the Sieve button (in the FX window) left click. More...
 
void Button_Sieve_menu (void)
 Callback for the Sieve button (in the FX window) right click. More...
 
void Button_Smooth_mode (void)
 Callback for the smooth button (in the FX window) left click. More...
 
void Compute_colorize_table (void)
 Computes the tables used by the transparency/colorize mode. More...
 
void Button_Colorize_mode (void)
 Callback for the Tranparency button (in the FX window) left click. More...
 
void Button_Colorize_menu (void)
 Callback for the Transparency button (in the FX window) right click. More...
 
void Button_Tiling_mode (void)
 Callback for the Tiling button (in the FX window) left click. More...
 
void Button_Tiling_menu (void)
 Callback for the Tiling button (in the FX window) right click. More...
 
void Button_Constraint_mode (void)
 Constaint enforcer/checker. More...
 
void Button_Constraint_menu (void)
 
void Button_Tilemap_mode (void)
 
void Button_Tilemap_menu (void)
 
void Effects_off (void)
 Callback for the command that turns off all drawaing effects. More...
 
void Button_Effects (int)
 Callback for the effects button click. More...
 
void Button_Brush (int)
 Callback for the brush button left click. More...
 
void Button_Restore_brush (int)
 Callback for the brush button right click. More...
 
void Button_Unselect_brush (int)
 Disables the custom brush and set back a regular one. More...
 
void Button_Lasso (int)
 Callback for the freehand brush pick button left click. More...
 
void Button_Unselect_lasso (int)
 Disables the custom freehand brush and set back a regular one. More...
 
void Button_Colorpicker (int)
 Starts the color picking operation. More...
 
void Button_Unselect_colorpicker (int)
 Disables the color picker button and get back to the previously selected drawing mode. More...
 
void Button_Invert_foreback (int)
 Swap fore- and background colors. More...
 
void Button_Magnify (int)
 Enters magnify mode. More...
 
void Button_Magnify_menu (int)
 Displays magnify menu. More...
 
void Button_Unselect_magnifier (int)
 Exit magnify mode. More...
 
void Button_Brush_FX (int)
 Display the Brush effects window. More...
 
void Button_Page (int)
 Swap main and spare drawing pages. More...
 
void Button_Copy_page (int)
 Copy main page to spare page. More...
 
void Copy_image_only (void)
 Copy only pixel data from main page to spare page (no palette copy). More...
 
void Button_Kill (int)
 Kill (free from memory) the current page. More...
 
void Button_Resolution (int)
 Display the screenmode menu. More...
 
void Button_Safety_resolution (int)
 Set the screen to the "safe resolution" (320x200 pixel window). More...
 
void Button_Load (int)
 Opens the load file dialog. More...
 
void Button_Reload (int)
 Reload current picture from disk. More...
 
void Button_Save (int)
 Open the save file dialog. More...
 
void Button_Autosave (int)
 Saves the current file without asking for a new name. More...
 
void Button_Settings (int)
 Display the setting menu. More...
 
void Button_Skins (int)
 Display the skin selector window. More...
 
void Button_Undo (int)
 Undo the last modification to the picture. More...
 
void Button_Redo (int)
 Redo the last modification to the picture. More...
 
void Button_Clear (int)
 Clear the whole screen with black (color index 0). More...
 
void Button_Clear_with_backcolor (int)
 Clear the screen with the selected backcolor. More...
 
void Button_Quit (int)
 Quits the program. More...
 
void Button_Hide_menu (int)
 Hides the menubar. More...
 
void Button_Toggle_toolbar (int)
 Shows a dropdown panel where you can choose which toolbars are visible. More...
 
void Button_Toggle_all_toolbars (int)
 Hides all toolbars (except status) or shows them again. More...
 
void Load_picture (enum CONTEXT_TYPE type)
 Load picture from file. More...
 
void Save_picture (enum CONTEXT_TYPE type)
 Save picture to file. More...
 
void Menu_tag_colors (char *window_title, byte *table, byte *mode, byte can_cancel, const char *help_section, word close_shortcut)
 Generic color tagging menu, for various effects. More...
 
void Button_Smooth_menu (void)
 Display the menu for the smooth effect. More...
 
void Button_Smear_mode (void)
 Toogles the smear mode. More...
 
void Button_Brush_container (void)
 
byte Store_paintbrush (int index)
 Store the current brush in paintbrush slot, if possible. More...
 
void Select_paintbrush (int index)
 Retrieve a normal paintbrush. More...
 
byte Any_effect_active (void)
 

Detailed Description

Almost all the editor actions that are called by the menu are here.

Function Documentation

◆ Stencil_update_color()

void Stencil_update_color ( byte  color)

◆ Stencil_tag_color()

void Stencil_tag_color ( byte  color,
byte  tag_color 
)

◆ Message_out_of_memory()

void Message_out_of_memory ( void  )

◆ Button_Message_initial()

◆ Change_paintbrush_shape()

void Change_paintbrush_shape ( byte  shape)

Changes brush shape.

This function saves the current brush shape and swith to the default one (single pixel brush) for the filler and the color picker. These functions don't need (and will not work with) a custom brush.

References Current_operation, Display_paintbrush_in_menu(), OPERATION_COLORPICK, OPERATION_FILL, Paintbrush_shape, Paintbrush_shape_before_colorpicker, Paintbrush_shape_before_fill, PAINTBRUSH_SHAPE_NONE, and PAINTBRUSH_SHAPE_POINT.

Referenced by Button_Brush_monochrome(), Button_Paintbrush_menu(), Button_Restore_brush(), Button_Sieve_menu(), Button_Text(), Load_picture(), Main_handler(), Restore_brush(), Return_to_draw_mode(), and Select_paintbrush().

◆ Button_Pal_left()

void Button_Pal_left ( int  btn)

Callback for the palette scroller buttons left click.

Scrolls the menubar palette one column to the left.

References Config, Display_cursor(), Display_menu_palette(), First_color_in_palette, Hide_cursor, Palette_cells_X(), Palette_cells_Y(), T_Config::Palette_vertical, and Unselect_button().

◆ Button_Pal_left_fast()

void Button_Pal_left_fast ( int  btn)

Callback for the palette scroller buttons right click.

Scrolls the menubar palette faster to the left.

References Display_cursor(), Display_menu_palette(), First_color_in_palette, Hide_cursor, Palette_cells_X(), Palette_cells_Y(), and Unselect_button().

◆ Button_Pal_right()

void Button_Pal_right ( int  btn)

Callback for the palette scroller buttons left click.

Scrolls the menubar palette one column to the right.

References Config, Display_cursor(), Display_menu_palette(), First_color_in_palette, Hide_cursor, Palette_cells_X(), Palette_cells_Y(), T_Config::Palette_vertical, and Unselect_button().

◆ Button_Pal_right_fast()

void Button_Pal_right_fast ( int  btn)

Callback for the palette scroller buttons right click.

Scrolls the menubar palette faster to the right.

References Config, Display_cursor(), Display_menu_palette(), First_color_in_palette, Hide_cursor, Palette_cells_X(), Palette_cells_Y(), T_Config::Palette_vertical, and Unselect_button().

◆ Button_Select_forecolor()

void Button_Select_forecolor ( int  btn)

Callback for the palette color buttons left click.

Selects the foreground drawing color when clicking on the menubar palette.

References Button_Palette(), Button_under_mouse(), Config, Display_cursor(), T_Config::Double_click_speed, Fore_color, Get_input(), GFX2_GetTicks(), Hide_cursor, Mouse_K, Pick_color_in_palette(), Set_fore_color(), and Status_print_palette_color().

◆ Button_Select_backcolor()

void Button_Select_backcolor ( int  btn)

Callback for the palette color buttons right click.

Selects the background drawing color when clicking on the menubar palette.

References Back_color, Button_under_mouse(), Display_cursor(), Get_input(), Hide_cursor, Mouse_K, Pick_color_in_palette(), Set_back_color(), and Status_print_palette_color().

◆ Button_Brush_monochrome()

void Button_Brush_monochrome ( int  btn)

Callback for the brush button left click.

Selects the monochrome brush mode when right clicking on the brush button.

References Change_paintbrush_shape(), Display_cursor(), Hide_cursor, PAINTBRUSH_SHAPE_MONO_BRUSH, and Unselect_button().

◆ Button_Paintbrush_menu()

◆ Button_Draw()

void Button_Draw ( int  btn)

Callback for the freehand draw button left click.

Selects freehand drawing mode, depending on the current state of the freehand button.

References Display_cursor(), Hide_cursor, Selected_freehand_mode, and Start_operation_stack().

◆ Button_Draw_switch_mode()

◆ Button_Lines()

void Button_Lines ( int  btn)

Callback for the lines button left click.

Selects lines drawing mode, depending on the current state of the lines button.

References Display_cursor(), Hide_cursor, Selected_line_mode, and Start_operation_stack().

◆ Button_Lines_switch_mode()

void Button_Lines_switch_mode ( int  btn)

◆ Button_Fill()

◆ Button_Replace()

◆ Button_Unselect_fill()

void Button_Unselect_fill ( int  btn)

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.

References Current_operation, T_Document::magnifier_mode, Main, Menu_is_visible, Menu_Y, Mouse_X, Mouse_Y, OPERATION_REPLACE, Paintbrush_shape, Paintbrush_shape_before_fill, Print_in_menu(), T_Document::separator_position, and T_Document::X_zoom.

◆ Button_Airbrush()

void Button_Airbrush ( int  btn)

Callback for the spray button left click.

Start the spray operation.

References Display_cursor(), Hide_cursor, OPERATION_AIRBRUSH, and Start_operation_stack().

◆ Button_Airbrush_menu()

◆ Button_Curves()

void Button_Curves ( int  btn)

Callback for the curves button left click.

Start curve operation according to the selected mode.

References Display_cursor(), Hide_cursor, Selected_curve_mode, and Start_operation_stack().

◆ Button_Curves_switch_mode()

void Button_Curves_switch_mode ( int  btn)

◆ Button_Empty_rectangle()

void Button_Empty_rectangle ( int  btn)

Callback for the empty rectangle button.

Start the rectangle operation.

References Display_cursor(), Hide_cursor, OPERATION_EMPTY_RECTANGLE, and Start_operation_stack().

◆ Button_Filled_rectangle()

void Button_Filled_rectangle ( int  btn)

Callback for the filled rectangle button.

Start the filled rectangle operation.

References Display_cursor(), Hide_cursor, OPERATION_FILLED_RECTANGLE, and Start_operation_stack().

◆ Button_Text()

void Button_Text ( int  btn)

Callback for the text button.

Opens the text setup window.

References T_Config::Auto_discontinuous, Back_color, Best_color_perceptual_except(), Brush_height, Brush_offset_X, Brush_offset_Y, Brush_original_palette, Brush_width, BUTTON_DRAW, BUTTON_EFFECTS, BUTTON_HELP, BUTTON_PRESSED, BUTTON_TEXT, Change_paintbrush_shape(), Close_window(), Colorize_current_mode, Colorize_mode, Config, Current_operation, T_List_button::Cursor_position, Display_brush, Display_cursor(), Draw_menu_button(), Draw_one_font_name(), Effect_alpha_colorize(), Effect_function, Error, Font_count(), Fore_color, T_Special_button::Height, Hide_cursor, INPUT_TYPE_INTEGER, INPUT_TYPE_STRING, Is_shortcut(), Key, KEY_a, KEY_b, KEY_ESC, KEY_i, KEY_NONE, KEY_RETURN, KEY_s, KEY_t, LEFT_SIDE, T_List_button::List_start, MC_Black, MC_Dark, MC_Light, Menu_factor_X, Menu_factor_Y, Min(), NULL, Num2str, Open_window(), OPERATION_DISCONTINUOUS_DRAW, PAINTBRUSH_SHAPE_COLOR_BRUSH, PAINTBRUSH_SHAPE_MONO_BRUSH, T_Special_button::Pos_X, T_Special_button::Pos_Y, Print_in_window(), Print_in_window_underscore(), Quick_shade_mode, Quit_is_required, Readline(), Readline_ex(), Realloc_brush(), Remap_brush(), Remap_general_lowlevel(), Render_text(), RIGHT_SIDE, Select_button(), Shade_mode, Smear_mode, Smooth_mode, Tiling_mode, TrueType_font(), Unselect_button(), Update_window_area, T_Special_button::Width, Window_attribute2, Window_clicked_button(), Window_display_frame_in(), Window_height, Window_help(), Window_input_content(), Window_pos_X, Window_pos_Y, Window_rectangle(), Window_redraw_list(), Window_set_input_button_s(), Window_set_list_button(), Window_set_normal_button(), Window_set_repeatable_button(), Window_set_scroller_button(), Window_set_special_button(), and Window_width.

◆ Button_Gradients()

◆ Load_gradient_data()

◆ Button_Grad_rectangle()

void Button_Grad_rectangle ( int  btn)

Callback for the gradation rectangle button.

Starts the gradation rectangle drawing operation.

References Display_cursor(), Hide_cursor, OPERATION_GRAD_RECTANGLE, and Start_operation_stack().

◆ Button_circle_ellipse()

void Button_circle_ellipse ( int  btn)

◆ Button_Circle_switch_mode()

◆ Button_polygon()

void Button_polygon ( int  btn)

Callback for the polyline button left click.

Starts drawing a polygon.

References Display_cursor(), Hide_cursor, OPERATION_POLYGON, and Start_operation_stack().

◆ Button_Polyform()

void Button_Polyform ( int  btn)

Callback for the polyline right click.

Starts drawing a polyform.

References Display_cursor(), Hide_cursor, OPERATION_POLYFORM, and Start_operation_stack().

◆ Button_Polyfill()

void Button_Polyfill ( int  btn)

Callback for the polyfill button left click.

Starts drawing a filled polygon.

References Display_cursor(), Hide_cursor, OPERATION_POLYFILL, and Start_operation_stack().

◆ Button_Filled_polyform()

void Button_Filled_polyform ( int  btn)

Callback for the polyfill button right click.

Starts drawing a filled polyform.

References Display_cursor(), Hide_cursor, OPERATION_FILLED_POLYFORM, and Start_operation_stack().

◆ Button_Adjust()

void Button_Adjust ( int  btn)

Callback for the adjust picture button.

Start the adjust picture operation.

References Display_cursor(), Hide_cursor, OPERATION_SCROLL, and Start_operation_stack().

◆ Button_Shade_mode()

void Button_Shade_mode ( void  )

Callback for the shade button (in the FX window).

Toogle the shade mode.

References Colorize_mode, Effect_function, Effect_shade(), No_effect(), Quick_shade_mode, Shade_mode, Smear_mode, Smooth_mode, and Tiling_mode.

Referenced by Button_Effects(), Button_Shade_menu(), and Main_handler().

◆ Button_Quick_shade_mode()

void Button_Quick_shade_mode ( void  )

Callback for the QSHade button (in the FX window).

Toogle the Quick Shade effect.

References Colorize_mode, Effect_function, Effect_quick_shade(), No_effect(), Quick_shade_mode, Shade_mode, Smear_mode, Smooth_mode, and Tiling_mode.

Referenced by Button_Effects(), Button_Quick_shade_menu(), and Main_handler().

◆ Button_Shade_menu()

void Button_Shade_menu ( void  )

Callback for the Shade button (in the FX window) right click.

Displays the shade setup menu.

References Button_Shade_mode(), Shade_mode, and Shade_settings_menu().

Referenced by Button_Effects(), and Main_handler().

◆ Button_Stencil_mode()

void Button_Stencil_mode ( void  )

Callback for the Stencil button (in the FX window) left click.

Toogle stencil mode.

References Stencil_mode.

Referenced by Button_Effects(), and Main_handler().

◆ Button_Stencil_menu()

void Button_Stencil_menu ( void  )

Callback for the Stencil button (in the FX window) right click.

Displays the stencil setup menu.

References Menu_tag_colors(), SPECIAL_STENCIL_MENU, Stencil, and Stencil_mode.

Referenced by Button_Effects(), and Main_handler().

◆ Button_Mask_mode()

void Button_Mask_mode ( void  )

Callback for the Mask button (in the FX window) left click.

Toogles the mask mode/

References Mask_mode.

Referenced by Button_Effects(), and Main_handler().

◆ Button_Mask_menu()

void Button_Mask_menu ( void  )

Callback for the Mask button (in the FX window) right click.

Displays the mask setup menu.

References Mask_mode, Mask_table, Menu_tag_colors(), and SPECIAL_MASK_MENU.

Referenced by Button_Effects(), and Main_handler().

◆ Button_Snap_mode()

void Button_Snap_mode ( void  )

Callback for the Grid button (in the FX window) left click.

Toogle the grid.

References Compute_paintbrush_coordinates(), Display_cursor(), Hide_cursor, and Snap_mode.

Referenced by Button_Effects(), and Main_handler().

◆ Button_Grid_menu()

◆ Button_Show_grid()

void Button_Show_grid ( void  )

Callback to toggle the grid visible in the magnified view.

References Display_all_screen(), Display_cursor(), Hide_cursor, and Show_grid.

Referenced by Main_handler().

◆ Copy_preset_sieve()

void Copy_preset_sieve ( byte  index)

In the sieve window, copy one of the presets patterns to the current one.

Parameters
indexIndex of the pattern to copy

References Gfx, Sieve, Sieve_height, T_Gui_skin::Sieve_pattern, and Sieve_width.

Referenced by Button_Sieve_menu(), and Init_program().

◆ Invert_trame()

void Invert_trame ( void  )

In the sieve window, swaps black and white in the current pattern.

References Sieve, Sieve_height, and Sieve_width.

Referenced by Button_Sieve_menu(), and Main_handler().

◆ Button_Sieve_mode()

void Button_Sieve_mode ( void  )

Callback for the Sieve button (in the FX window) left click.

Toogle sieve mode.

References Sieve_mode.

Referenced by Button_Effects(), Button_Sieve_menu(), and Main_handler().

◆ Button_Sieve_menu()

◆ Button_Smooth_mode()

void Button_Smooth_mode ( void  )

Callback for the smooth button (in the FX window) left click.

Callback for the Smooth button (in the FX window) right click.

Toogles smooth mode.

Displays the smooth setup menu.

References Colorize_mode, Effect_function, Effect_smooth(), No_effect(), Quick_shade_mode, Shade_mode, Smear_mode, Smooth_mode, and Tiling_mode.

Referenced by Button_Effects(), Button_Smooth_menu(), and Main_handler().

◆ Compute_colorize_table()

void Compute_colorize_table ( void  )

Computes the tables used by the transparency/colorize mode.

These tables are used to match the drawing color*picture color to the color that is painted on screen.

References Colorize_opacity, Factors_inv_table, and Factors_table.

Referenced by Button_Colorize_menu(), Init_program(), and Transparency_set().

◆ Button_Colorize_mode()

void Button_Colorize_mode ( void  )

◆ Button_Colorize_menu()

◆ Button_Tiling_mode()

void Button_Tiling_mode ( void  )

Callback for the Tiling button (in the FX window) left click.

Toogles tiling mode.

References Colorize_mode, Effect_function, Effect_tiling(), No_effect(), Quick_shade_mode, Shade_mode, Smear_mode, Smooth_mode, and Tiling_mode.

Referenced by Button_Effects(), Button_Tiling_menu(), and Main_handler().

◆ Button_Tiling_menu()

◆ Button_Constraint_mode()

◆ Button_Constraint_menu()

void Button_Constraint_menu ( void  )
Todo:
enable WIDE pixels when switching to 160x200
Todo:
enable TALL pixels when switching to 560x192

References Back_color, T_Document::backups, Button_Constraint_mode(), BUTTON_EFFECTS, BUTTON_HELP, C64_set_palette(), Check_menu_mode(), Close_window(), Compute_optimal_menu_colors(), Config, CPC_set_default_BASIC_palette(), CPC_set_HW_palette(), DHGR_set_palette(), Dialog_multiple_choice(), Display_all_screen(), Display_cursor(), Display_menu(), End_of_modification(), Favorite_GUI_color(), First_color_in_palette, Fore_color, HGR_set_palette(), Hide_cursor, T_Page::Image_mode, IMAGE_MODE_ANIMATION, IMAGE_MODE_C64FLI, IMAGE_MODE_C64HIRES, IMAGE_MODE_C64MULTI, IMAGE_MODE_DHGR, IMAGE_MODE_EGX, IMAGE_MODE_EGX2, IMAGE_MODE_GBC, IMAGE_MODE_HGR, IMAGE_MODE_MEGADRIVE, IMAGE_MODE_MODE5, IMAGE_MODE_RASTER, IMAGE_MODE_THOMSON, IMAGE_MODE_TMS9918G2, IMAGE_MODE_ZX, Is_shortcut(), Key, KEY_ESC, KEY_g, KEY_p, KEY_RETURN, KEY_s, label, LEFT_SIDE, MACHINE_MO5, MACHINE_MO6, MACHINE_TO7, MACHINE_TO8, Main, MC_Black, MC_Dark, MC_Light, mode, T_Config::MOTO_gamma, MOTO_set_MO5_palette(), MOTO_set_TO7_palette(), MSX_set_palette(), NULL, Open_window(), T_List_of_pages::Pages, T_Document::palette, Print_in_window(), Print_in_window_underscore(), Redraw_layered_image(), Remap_screen_after_menu_colors_change(), Resize_image(), RIGHT_SIDE, Selected_Constraint_Mode, Set_palette(), Set_palette_Gamma(), Set_palette_RGB_scale(), Show_grid, Snap_height, Snap_mode, Snap_offset_X, Snap_offset_Y, Snap_width, Update_window_area, Window_attribute2, Window_clicked_button(), Window_dropdown_add_item(), Window_height, Window_help(), Window_set_dropdown_button(), Window_set_normal_button(), Window_width, and ZX_Spectrum_set_palette().

Referenced by Button_Effects().

◆ Button_Tilemap_mode()

void Button_Tilemap_mode ( void  )

◆ Button_Tilemap_menu()

◆ Effects_off()

void Effects_off ( void  )

◆ Button_Effects()

void Button_Effects ( int  btn)

Callback for the effects button click.

Displays the effect selection menu.

References Any_effect_active(), T_Document::backups, Button_Colorize_menu(), Button_Colorize_mode(), Button_Constraint_menu(), Button_Constraint_mode(), BUTTON_EFFECTS, Button_Grid_menu(), BUTTON_HELP, Button_Mask_menu(), Button_Mask_mode(), Button_Quick_shade_menu(), Button_Quick_shade_mode(), Button_Shade_menu(), Button_Shade_mode(), Button_Sieve_menu(), Button_Sieve_mode(), Button_Smear_mode(), Button_Smooth_menu(), Button_Smooth_mode(), Button_Snap_mode(), Button_Stencil_menu(), Button_Stencil_mode(), Button_Tilemap_menu(), Button_Tilemap_mode(), Button_Tiling_menu(), Button_Tiling_mode(), C1, C2, C3, Close_window(), Config, Config_Key, Display_cursor(), Display_effect_sprite(), Display_effect_state(), Display_effect_states(), Display_feedback_state(), Effects_off(), EFFECTS_SPRITE_8BIT, EFFECTS_SPRITE_GRID, EFFECTS_SPRITE_MASK, EFFECTS_SPRITE_SHADE, EFFECTS_SPRITE_SIEVE, EFFECTS_SPRITE_SMEAR, EFFECTS_SPRITE_SMOOTH, EFFECTS_SPRITE_STENCIL, EFFECTS_SPRITE_TILING, EFFECTS_SPRITE_TRANSP, T_Config::FX_Feedback, Hide_cursor, T_Page::Image_mode, IMAGE_MODE_ANIMATION, Input_sticky_control, Is_shortcut(), Key, KEY_DELETE, KEY_ESC, KEY_f, KEY_RETURN, L1, L2, L3, L4, L5, LEFT_SIDE, Main, Mask_mode, MC_Black, MC_Dark, MC_Light, NULL, Open_window(), T_List_of_pages::Pages, Print_in_window(), Print_in_window_underscore(), Quit_is_required, Selected_Constraint_Mode, Show_grid, Sieve_mode, Snap_mode, SPECIAL_COLORIZE_MODE, SPECIAL_FORMAT_CHECKER_MENU, SPECIAL_GRID_MODE, SPECIAL_MASK_MODE, SPECIAL_QUICK_SHADE_MODE, SPECIAL_SHADE_MODE, SPECIAL_SHOW_GRID, SPECIAL_SIEVE_MODE, SPECIAL_SMEAR_MODE, SPECIAL_SMOOTH_MODE, SPECIAL_STENCIL_MODE, SPECIAL_TILEMAP_MODE, SPECIAL_TILING_MODE, Stencil_mode, T_Document::tilemap_mode, Unselect_button(), Update_FX_feedback(), Update_window_area, Window_attribute1, Window_clicked_button(), Window_display_frame_mono(), Window_get_clicked_button(), Window_height, Window_help(), Window_rectangle(), Window_set_normal_button(), and Window_width.

◆ Button_Brush()

void Button_Brush ( int  btn)

Callback for the brush button left click.

Start the brush picking operation.

References Current_operation, Display_cursor(), Hide_cursor, OPERATION_GRAB_BRUSH, Start_operation_stack(), and Unselect_button().

◆ Button_Restore_brush()

void Button_Restore_brush ( int  btn)

Callback for the brush button right click.

Activates the last captured custom brush.

References Change_paintbrush_shape(), Display_cursor(), Hide_cursor, PAINTBRUSH_SHAPE_COLOR_BRUSH, and Unselect_button().

◆ Button_Unselect_brush()

void Button_Unselect_brush ( int  btn)

Disables the custom brush and set back a regular one.

References Operation_before_interrupt, and Start_operation_stack().

◆ Button_Lasso()

void Button_Lasso ( int  btn)

Callback for the freehand brush pick button left click.

Starts freehand brush picking operation.

References Current_operation, Display_cursor(), Hide_cursor, OPERATION_POLYBRUSH, Paintbrush_shape, Paintbrush_shape_before_lasso, PAINTBRUSH_SHAPE_POINT, Start_operation_stack(), and Unselect_button().

◆ Button_Unselect_lasso()

void Button_Unselect_lasso ( int  btn)

Disables the custom freehand brush and set back a regular one.

References Current_operation, Operation_before_interrupt, OPERATION_POLYBRUSH, Paintbrush_shape, Paintbrush_shape_before_lasso, and Start_operation_stack().

◆ Button_Colorpicker()

◆ Button_Unselect_colorpicker()

◆ Button_Invert_foreback()

void Button_Invert_foreback ( int  btn)

◆ Button_Magnify()

◆ Button_Magnify_menu()

◆ Button_Unselect_magnifier()

◆ Button_Brush_FX()

◆ Button_Page()

◆ Button_Copy_page()

◆ Copy_image_only()

◆ Button_Kill()

◆ Button_Resolution()

void Button_Resolution ( int  btn)

◆ Button_Safety_resolution()

void Button_Safety_resolution ( int  btn)

◆ Button_Load()

void Button_Load ( int  btn)

Opens the load file dialog.

References CONTEXT_MAIN_IMAGE, Load_picture(), Main, Tilemap_update(), and Upload_infos_page().

◆ Button_Reload()

◆ Button_Save()

void Button_Save ( int  btn)

Open the save file dialog.

References CONTEXT_MAIN_IMAGE, and Save_picture().

◆ Button_Autosave()

◆ Button_Settings()

void Button_Settings ( int  btn)

Display the setting menu.

References T_Config::Adjust_brush_pick, T_Config::Allow_multi_shortcuts, T_Config::Auto_discontinuous, T_Config::Auto_nb_used, T_Config::Auto_save, T_Config::Auto_set_res, T_Config::Backup, Brush_selector, BUTTON_HELP, BUTTON_SETTINGS, T_Config::Clear_palette, T_Config::Clear_with_stencil, Close_window(), Compute_optimal_menu_colors(), Config, T_Config::Coords_rel, T_Config::Delay_left_click_on_slider, T_Config::Delay_right_click_on_slider, T_Setting::Digits, Display_cursor(), T_Config::Display_image_limits, Display_menu(), T_Config::Double_click_speed, T_Config::Double_key_speed, T_Config::Fast_zoom, T_Config::Find_file_fast, Get_setting_value(), Hide_cursor, INPUT_TYPE_INTEGER, Is_shortcut(), Key, KEY_a, KEY_ESC, KEY_MOUSEWHEELDOWN, KEY_MOUSEWHEELUP, KEY_r, KEY_RETURN, KEY_s, LEFT_SIDE, T_Setting::Lookup, Lookup_AutoRes, Lookup_Coords, Lookup_FFF, Lookup_MenuRatio, Lookup_next(), Lookup_previous(), Lookup_SwapButtons, Lookup_VirtualKeyboard, Lookup_YesNo, Main, T_Config::Max_undo_pages, T_Setting::Max_value, T_Config::Maximize_preview, Menu_factor_Y, T_Setting::Min_value, T_Config::MOTO_gamma, Mouse_K, T_Config::Mouse_merge_movement, T_Config::Mouse_motion_debounce, Mouse_Y, NB_BUTTONS, T_Config::Nb_max_vertices_per_polygon, NULL, Num2str, T_Selector_settings::Offset, Open_window(), T_Config::Opening_message, T_Document::palette, Palette_selector, T_Special_button::Pos_X, T_Special_button::Pos_Y, T_Selector_settings::Position, Quit_is_required, T_Config::Ratio, Readline(), Remove_duplicate_shortcuts(), T_Config::Right_click_colorpick, RIGHT_SIDE, T_Config::Safety_colors, T_Config::Screen_size_in_GIF, T_Document::selector, T_Config::Separate_colors, Set_number_of_backups(), T_Config::Set_resolution_according_to, Set_setting_value(), SETTING_HEIGHT, SETTING_PAGES, SETTING_PER_PAGE, Settings_display_config(), Settings_load_config(), Settings_save_config(), T_Config::Show_hidden_directories, T_Config::Show_hidden_files, Spare, T_Config::Swap_buttons, T_Config::Sync_views, T_Config::Timer_delay, T_Setting::Type, Unselect_button(), Update_window_area, T_Config::Use_virtual_keyboard, T_Special_button::Width, Window_attribute2, Window_clicked_button(), Window_draw_slider(), Window_height, Window_help(), Window_normal_button_onclick(), Window_pos_Y, Window_scroller_button_list, Window_set_normal_button(), Window_set_scroller_button(), Window_set_special_button(), and Window_width.

◆ Button_Skins()

void Button_Skins ( int  btn)

Display the skin selector window.

Display the skin selector window.

References Add_font_or_skin(), Any_effect_active(), BUTTON_EFFECTS, BUTTON_HELP, BUTTON_MAGNIFIER, BUTTON_SETTINGS, Buttons_Pool, Close_window(), T_Gui_skin::Color, Compute_optimal_menu_colors(), Config, T_Config::Cursor, T_List_button::Cursor_position, Data_directory, T_Gui_skin::Default_palette, Display_cursor(), T_Config::Display_image_limits, Display_menu(), Draw_menu_button(), Draw_one_skin_name(), Filepath_append_to_dir(), FILESEL_Y, Find_file_in_fileselector(), T_Config::Font_file, Font_files_list, For_each_file(), Free_fileselector_list(), T_Fileselector_item::Full_name, Get_item_by_index(), Gfx, Gui_loading_error_message, T_Dropdown_button::Height, Hide_cursor, Is_shortcut(), Key, KEY_ESCAPE, KEY_NONE, KEY_RETURN, LEFT_SIDE, T_List_button::List_start, Load_font(), Load_graphics(), T_Document::magnifier_mode, Main, MC_Black, MC_Dark, MC_Light, MC_White, Menu_font, NB_BUTTONS, T_Fileselector::Nb_elements, T_Fileselector::Nb_files, NULL, Open_window(), T_Document::palette, Pixel_in_window(), T_Dropdown_button::Pos_X, T_Dropdown_button::Pos_Y, T_Toolbar_button::Pressed, T_Gui_skin::Preview, Print_in_window(), Print_in_window_limited(), Quit_is_required, RIGHT_SIDE, T_Config::Separate_colors, Set_color(), Set_current_skin(), Set_palette(), T_Fileselector_item::Short_name, T_Config::Skin_file, Skin_files_list, SKINS_SUBDIRECTORY, Sort_list_of_files(), Unselect_button(), Update_window_area, Verbose_message(), Window_attribute2, Window_clicked_button(), Window_display_frame_in(), Window_dropdown_add_item(), Window_height, Window_help(), Window_rectangle(), Window_redraw_list(), Window_set_dropdown_button(), Window_set_list_button(), Window_set_normal_button(), Window_set_scroller_button(), Window_set_special_button(), and Window_width.

◆ Button_Undo()

◆ Button_Redo()

◆ Button_Clear()

◆ Button_Clear_with_backcolor()

◆ Button_Quit()

void Button_Quit ( int  btn)

Quits the program.

Display a requester to save the changes to the picture before exiting if the pic was modified since last save.

References Button_Page(), BUTTON_PAGE, Button_Quit_local_function(), Display_cursor(), Hide_cursor, T_Document::image_is_modified, Menu_is_visible, Menu_Y, Mouse_Y, Quitting, Spare, and Unselect_button().

Referenced by Main_handler().

◆ Button_Hide_menu()

◆ Button_Toggle_toolbar()

◆ Button_Toggle_all_toolbars()

void Button_Toggle_all_toolbars ( int  btn)

◆ Load_picture()

void Load_picture ( enum CONTEXT_TYPE  type)

Load picture from file.

References T_Config::Auto_discontinuous, T_Config::Auto_set_res, T_Document::backups, Best_video_mode(), Brush_file_directory, Brush_fileformat, Brush_filename, Brush_filename_unicode, Brush_height, Brush_offset_X, Brush_offset_Y, Brush_selector, Brush_width, BUTTON_DRAW, Button_Load_or_Save(), BUTTON_MAGNIFIER, Change_paintbrush_shape(), Check_menu_mode(), Compute_limits(), Compute_optimal_menu_colors(), Compute_paintbrush_coordinates(), Config, Confirmation_box(), CONTEXT_BRUSH, CONTEXT_MAIN_IMAGE, CONTEXT_PALETTE, Current_operation, Current_resolution, Cursor_shape, CURSOR_SHAPE_HOURGLASS, Destroy_context(), Display_all_screen(), Display_cursor(), Display_menu(), Draw_menu_button(), End_of_modification(), T_IO_Context::File_directory, T_Page::File_directory, File_error, T_IO_Context::File_name, T_IO_Context::File_name_unicode, T_Document::fileformat, T_Page::Filename, T_Page::Filename_unicode, T_IO_Context::Format, FORMAT_PAL, Get_fileformat(), Hide_cursor, T_Document::image_height, T_Document::image_is_modified, T_Document::image_width, Init_context_brush(), Init_context_layered_image(), Init_mode_video(), LEFT_SIDE, Load_image(), T_Document::magnifier_mode, Main, NULL, T_Document::offset_X, T_Document::offset_Y, OPERATION_DISCONTINUOUS_DRAW, Original_screen_X, Original_screen_Y, T_List_of_pages::Pages, PAINTBRUSH_SHAPE_COLOR_BRUSH, T_Document::palette, T_Format::Palette_only, Palette_selector, Pixel_preview, Pixel_preview_normal, Pixel_ratio, PIXEL_TALL, PIXEL_TALL2, PIXEL_TALL3, PIXEL_WIDE, PIXEL_WIDE2, Print_filename(), T_IO_Context::Ratio, Redraw_layered_image(), RIGHT_SIDE, Select_button(), T_Document::selector, Set_palette(), Tiling_offset_X, Tiling_offset_Y, T_IO_Context::Type, Unicode_strdup(), and Video_mode.

Referenced by Button_Brush_FX(), Button_Load(), Button_Palette(), and Main_handler().

◆ Save_picture()

◆ Menu_tag_colors()

◆ Button_Smooth_menu()

◆ Button_Smear_mode()

void Button_Smear_mode ( void  )

◆ Button_Brush_container()

◆ Store_paintbrush()

◆ Select_paintbrush()

◆ Any_effect_active()