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

Utility functions for the menu and all windows. More...

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

Functions

void Main_handler (void)
 Main handler for everything. This is the main loop of the program. More...
 
void Draw_menu_button (byte btn_number, byte pressed)
 Draw a menu button, selected or not. More...
 
void Unselect_button (int btn_number)
 Deselect a button. More...
 
void Select_button (int btn_number, byte click)
 Select a button and disable all his family (for example, selecting "freehand" unselect "curves", "lines", ...) More...
 
void Open_window (word width, word height, const char *title)
 Open a GUI window. More...
 
void Close_window (void)
 Close a window previously open with Open_window() More...
 
void Open_popup (word x_pos, word y_pos, word width, word height)
 Open a popup window. More...
 
void Close_popup (void)
 
void Window_draw_normal_bouton (word x_pos, word y_pos, word width, word height, const char *title, byte undersc_letter, byte clickable)
 
void Window_select_normal_button (word x_pos, word y_pos, word width, word height)
 
void Window_unselect_normal_button (word x_pos, word y_pos, word width, word height)
 
void Window_draw_palette_bouton (word x_pos, word y_pos)
 
void Compute_slider_cursor_length (T_Scroller_button *button)
 
void Window_draw_slider (T_Scroller_button *button)
 
void Window_draw_scroller_button (T_Scroller_button *button)
 
void Window_input_content (T_Special_button *button, const char *content)
 
void Window_clear_input_button (T_Special_button *button)
 
void Window_draw_input_bouton (word x_pos, word y_pos, word width_in_characters)
 
T_Normal_buttonWindow_set_normal_button (word x_pos, word y_pos, word width, word height, const char *title, byte undersc_letter, byte clickable, word shortcut)
 
T_Normal_buttonWindow_set_repeatable_button (word x_pos, word y_pos, word width, word height, const char *title, byte undersc_letter, byte clickable, word shortcut)
 
T_Palette_buttonWindow_set_palette_button (word x_pos, word y_pos)
 
void Window_clear_tags (void)
 
void Tag_color_range (byte start, byte end)
 
T_Scroller_buttonWindow_set_scroller_button (word x_pos, word y_pos, word height, word nb_elements, word nb_elements_visible, word initial_position)
 
T_Scroller_buttonWindow_set_horizontal_scroller_button (word x_pos, word y_pos, word width, word nb_elements, word nb_elements_visible, word initial_position)
 
T_Special_buttonWindow_set_special_button (word x_pos, word y_pos, word width, word height, word shortcut)
 
T_Special_buttonWindow_set_input_button_s (word x_pos, word y_pos, word width_in_characters, word shortcut)
 
T_Special_buttonWindow_set_input_button (word x_pos, word y_pos, word width_in_characters)
 
T_Dropdown_buttonWindow_set_dropdown_button (word x_pos, word y_pos, word width, word height, word dropdown_width, const char *label, byte display_choice, byte display_centered, byte display_arrow, byte active_button, byte bottom_up)
 
void Window_dropdown_add_item (T_Dropdown_button *dropdown, word btn_number, const char *label)
 Adds an item to a dropdown menu. More...
 
void Window_dropdown_clear_items (T_Dropdown_button *dropdown)
 
T_Dropdown_choiceDropdown_activate (T_Dropdown_button *button, short off_x, short off_y)
 Displays a dropped-down menu and handles the UI logic until the user releases a mouse button. More...
 
T_List_buttonWindow_set_list_button (T_Special_button *entry_button, T_Scroller_button *scroller, Func_draw_list_item draw_list_item, byte color_index)
 
void Window_redraw_list (T_List_button *list)
 
byte Window_click_in_rectangle (short start_x, short start_y, short end_x, short end_y)
 
short Wait_click_in_palette (T_Palette_button *button)
 
short Window_normal_button_onclick (word x_pos, word y_pos, word width, word height, short btn_number)
 
void Get_color_behind_window (byte *color, byte *click)
 
short Window_clicked_button (void)
 
int Button_under_mouse (void)
 Guess the number of the button that was just clicked. More...
 
short Window_get_button_shortcut (void)
 
short Window_get_clicked_button (void)
 
void Remap_window_backgrounds (const byte *conversion_table, int Min_Y, int Max_Y)
 Remaps all the colors from the window background buffers from row Min_Y to row Max_Y. More...
 
void Remap_UI_in_window_backgrounds (const byte *conversion_table)
 Remaps only UI elements (Windows + Menu) in all window background buffers. More...
 
void Pixel_background (int x_pos, int y_pos, byte color)
 Draw a pixel in a saved screen block (when you sort colors in the palette, for example) More...
 
void Status_print_palette_color (byte color)
 Updates the status bar line with a color number. More...
 
void Delay_with_active_mouse (int delay)
 Puts the user in wait mode for the specified time ( in 1/100s), though the mouse still works. More...
 
void Compute_menu_offsets (void)
 Based on which toolbars are visible, updates their offsets and computes Menu_height and Menu_Y. More...
 
void Set_bar_visibility (word bar, int visible, int with_redraw)
 Shows or hides a tolbar from the menu. More...
 
int Check_menu_mode (void)
 Checks if the current menu toolbars suit the current image type : layered vs anim. More...
 

Detailed Description

Utility functions for the menu and all windows.

Function Documentation

◆ Main_handler()

void Main_handler ( void  )

Main handler for everything. This is the main loop of the program.

Todo:
create a SPECIAL_ACTIONS for Copy and Paste ?

References Allow_color_change_during_operation, Any_effect_active(), T_Config::Auto_discontinuous, Bigger_paintbrush(), Block, Brush, Brush_colormap, Brush_fileformat, Brush_filename, Brush_filename_unicode, Brush_height, Brush_offset_X, Brush_offset_Y, Brush_original_pixels, Brush_width, BUTTON_CHOOSE_COL, Button_Colorize_menu(), Button_Colorize_mode(), BUTTON_DRAW, BUTTON_EFFECTS, Button_Grid_menu(), BUTTON_LAYER_SELECT, Button_Mask_menu(), Button_Mask_mode(), Button_Quick_shade_menu(), Button_Quick_shade_mode(), Button_Quit(), BUTTON_QUIT, Button_Shade_menu(), Button_Shade_mode(), Button_Show_grid(), 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(), Button_under_mouse(), Buttons_Pool, Change_paintbrush_shape(), Check_menu_mode(), Compute_limits(), Compute_optimal_menu_colors(), Compute_paintbrush_coordinates(), Config, Confirmation_box(), CONTEXT_BRUSH, Current_operation, Cursor_hidden, Cursor_in_menu, Cursor_in_menu_previous, Cursor_shape, CURSOR_SHAPE_HOURGLASS, Cycling_mode, Default_window_height, Default_window_width, Destroy_context(), Display_all_screen(), Display_cursor(), T_Config::Display_image_limits, Display_image_limits(), Display_menu(), Draw_menu_button(), Drop_file_name, Drop_file_name_unicode, Effects_off(), End_of_modification(), Exclude_color, File_error, T_IO_Context::File_name_unicode, Find_last_separator(), Find_last_separator_unicode(), First_color_in_palette, Flip_X_lowlevel(), Flip_Y_lowlevel(), T_IO_Context::Format, FORMAT_CLIPBOARD, FORMAT_GIF, Get_colors_from_brush(), Get_input(), GFX2_WINDOW_STANDARD, Hide_cursor, T_Document::image_is_modified, Init_context_brush(), Init_context_layered_image(), Init_mode_video(), Invert_trame(), Is_shortcut(), Key, Layer_activate(), Layer_preview_off(), Layer_preview_on(), LEFT_SIDE, Load_image(), Load_picture(), T_Document::magnifier_height, T_Document::magnifier_mode, T_Document::magnifier_width, Main, MC_Light, Menu_factor_X, Menu_factor_Y, Menu_is_visible, Menu_status_Y, Menu_tag_colors(), Menu_Y, Mouse_K, Mouse_K_unique, Mouse_X, Mouse_Y, Move_separator(), NB_BUTTONS, NB_SPECIAL_SHORTCUTS, Nibble_brush(), NULL, Old_MX, Old_MY, Operation, OPERATION_COLORPICK, OPERATION_CONTINUOUS_DRAW, OPERATION_DISCONTINUOUS_DRAW, OPERATION_DISTORT_BRUSH, OPERATION_PAN_VIEW, OPERATION_REPLACE, OPERATION_ROTATE_BRUSH, Operation_stack_size, OPERATION_STRETCH_BRUSH, Outline_brush(), Paintbrush_shape, PAINTBRUSH_SHAPE_COLOR_BRUSH, PAINTBRUSH_SHAPE_MONO_BRUSH, PAINTBRUSH_SHAPE_ROUND, T_Document::palette, Pan_shortcut_pressed, Pick_color_in_palette(), Pixel_ratio, Print_in_menu(), Quit_is_required, Quitting, Redraw_layered_image(), Remap_brush(), Remap_general_lowlevel(), Repeat_script(), Reposition_palette(), Resize_height, Resize_width, RIGHT_SIDE, Rotate_180_deg_lowlevel(), Rotate_90_deg(), Run_numbered_script(), Save_image(), Save_picture(), Screen_height, Screen_width, Scroll_magnifier(), Scroll_screen(), Select_button(), T_Document::separator_position, Set_paintbrush_size(), Set_palette(), SHORTCUT_COPY, SHORTCUT_PASTE, Smaller_paintbrush(), SPECIAL_BIGGER_PAINTBRUSH, SPECIAL_BOTTOM_LEFT_ATTACHMENT, SPECIAL_BOTTOM_RIGHT_ATTACHMENT, SPECIAL_BRUSH_DOUBLE, SPECIAL_BRUSH_DOUBLE_HEIGHT, SPECIAL_BRUSH_DOUBLE_WIDTH, SPECIAL_BRUSH_HALVE, SPECIAL_CENTER_ATTACHMENT, SPECIAL_CLICK_RIGHT, SPECIAL_COLORIZE_MENU, SPECIAL_COLORIZE_MODE, SPECIAL_CONTINUOUS_DRAW, SPECIAL_CYCLE_MODE, SPECIAL_DISTORT, SPECIAL_DOT_PAINTBRUSH, SPECIAL_EFFECTS_OFF, SPECIAL_EXCLUDE_COLORS_MENU, SPECIAL_FLIP_X, SPECIAL_FLIP_Y, SPECIAL_GET_BRUSH_COLORS, SPECIAL_GRID_MENU, SPECIAL_GRID_MODE, SPECIAL_HOLD_PAN, SPECIAL_INVERT_SIEVE, SPECIAL_LAYER1_SELECT, SPECIAL_LAYER1_TOGGLE, SPECIAL_LAYER2_SELECT, SPECIAL_LAYER2_TOGGLE, SPECIAL_LAYER3_SELECT, SPECIAL_LAYER3_TOGGLE, SPECIAL_LAYER4_SELECT, SPECIAL_LAYER4_TOGGLE, SPECIAL_LAYER5_SELECT, SPECIAL_LAYER5_TOGGLE, SPECIAL_LAYER6_SELECT, SPECIAL_LAYER6_TOGGLE, SPECIAL_LAYER7_SELECT, SPECIAL_LAYER7_TOGGLE, SPECIAL_LAYER8_SELECT, SPECIAL_LAYER8_TOGGLE, SPECIAL_LOAD_BRUSH, SPECIAL_MASK_MENU, SPECIAL_MASK_MODE, SPECIAL_NEXT_BACKCOLOR, Special_next_backcolor(), SPECIAL_NEXT_FORECOLOR, Special_next_forecolor(), SPECIAL_NEXT_USER_BACKCOLOR, Special_next_user_backcolor(), SPECIAL_NEXT_USER_FORECOLOR, Special_next_user_forecolor(), SPECIAL_NIBBLE, SPECIAL_OUTLINE, SPECIAL_PREVIOUS_BACKCOLOR, Special_previous_backcolor(), SPECIAL_PREVIOUS_FORECOLOR, Special_previous_forecolor(), SPECIAL_PREVIOUS_USER_BACKCOLOR, Special_previous_user_backcolor(), SPECIAL_PREVIOUS_USER_FORECOLOR, Special_previous_user_forecolor(), SPECIAL_QUICK_SHADE_MENU, SPECIAL_QUICK_SHADE_MODE, SPECIAL_RECOLORIZE_BRUSH, SPECIAL_REPEAT_SCRIPT, SPECIAL_ROTATE_180, SPECIAL_ROTATE_90, SPECIAL_ROTATE_ANY_ANGLE, SPECIAL_RUN_SCRIPT_1, SPECIAL_RUN_SCRIPT_10, SPECIAL_RUN_SCRIPT_2, SPECIAL_RUN_SCRIPT_3, SPECIAL_RUN_SCRIPT_4, SPECIAL_RUN_SCRIPT_5, SPECIAL_RUN_SCRIPT_6, SPECIAL_RUN_SCRIPT_7, SPECIAL_RUN_SCRIPT_8, SPECIAL_RUN_SCRIPT_9, SPECIAL_SAVE_BRUSH, SPECIAL_SCROLL_DOWN, SPECIAL_SCROLL_DOWN_FAST, SPECIAL_SCROLL_DOWN_SLOW, SPECIAL_SCROLL_LEFT, SPECIAL_SCROLL_LEFT_FAST, SPECIAL_SCROLL_LEFT_SLOW, SPECIAL_SCROLL_RIGHT, SPECIAL_SCROLL_RIGHT_FAST, SPECIAL_SCROLL_RIGHT_SLOW, SPECIAL_SCROLL_UP, SPECIAL_SCROLL_UP_FAST, SPECIAL_SCROLL_UP_SLOW, SPECIAL_SHADE_MENU, SPECIAL_SHADE_MODE, SPECIAL_SHOW_GRID, SPECIAL_SHOW_HIDE_CURSOR, SPECIAL_SIEVE_MENU, SPECIAL_SIEVE_MODE, SPECIAL_SMALLER_PAINTBRUSH, SPECIAL_SMEAR_MODE, SPECIAL_SMOOTH_MENU, SPECIAL_SMOOTH_MODE, SPECIAL_STENCIL_MENU, SPECIAL_STENCIL_MODE, SPECIAL_STRETCH, SPECIAL_TILEMAP_MENU, SPECIAL_TILEMAP_MODE, SPECIAL_TILING_MENU, SPECIAL_TILING_MODE, SPECIAL_TOP_LEFT_ATTACHMENT, SPECIAL_TOP_RIGHT_ATTACHMENT, SPECIAL_TRANSPARENCY_0, SPECIAL_TRANSPARENCY_1, SPECIAL_TRANSPARENCY_2, SPECIAL_TRANSPARENCY_3, SPECIAL_TRANSPARENCY_4, SPECIAL_TRANSPARENCY_5, SPECIAL_TRANSPARENCY_6, SPECIAL_TRANSPARENCY_7, SPECIAL_TRANSPARENCY_8, SPECIAL_TRANSPARENCY_9, SPECIAL_ZOOM_1, SPECIAL_ZOOM_10, SPECIAL_ZOOM_12, SPECIAL_ZOOM_14, SPECIAL_ZOOM_16, SPECIAL_ZOOM_18, SPECIAL_ZOOM_2, SPECIAL_ZOOM_20, SPECIAL_ZOOM_3, SPECIAL_ZOOM_4, SPECIAL_ZOOM_5, SPECIAL_ZOOM_6, SPECIAL_ZOOM_8, SPECIAL_ZOOM_IN, SPECIAL_ZOOM_IN_MORE, SPECIAL_ZOOM_OUT, SPECIAL_ZOOM_OUT_MORE, Start_operation_stack(), Status_print_palette_color(), Stretch_brush(), Tiling_offset_X, Tiling_offset_Y, Transparency_set(), Unicode_strdup(), Update_rect(), Upload_infos_page(), Window_state, T_Document::X_zoom, Zoom(), and Zoom_set().

Referenced by main().

◆ Draw_menu_button()

◆ Unselect_button()

◆ Select_button()

◆ Open_window()

void Open_window ( word  width,
word  height,
const char *  title 
)

Open a GUI window.

Parameters
widthwindow width (max 320)
heightwindow height (max 200)
titlewindow title

The mouse must be shown before calling this function. The mouse is hidden when the function returns.

The function Close_window() must be called afterward.

References Allow_colorcycling, Allow_drag_and_drop(), Cursor_shape, CURSOR_SHAPE_ARROW, Cursor_shape_before_window, GFX2_Log(), GFX2_WARNING, Hide_cursor, Main, MC_Black, MC_Dark, MC_White, MC_Window, Menu_factor_X, Menu_factor_Y, Menu_is_visible, Menu_is_visible_before_window, Menu_Y, Menu_Y_before_window, NULL, Paintbrush_hidden, Paintbrush_hidden_before_window, T_Document::palette, Print_in_window_limited(), Save_background(), Screen_height, Screen_width, Set_palette(), Window_background, Window_display_frame_mono(), Window_display_frame_out(), Window_draggable, Window_dropdown_button_list, Window_height, Window_nb_buttons, Window_normal_button_list, Window_palette_button_list, Window_pos_X, Window_pos_Y, Window_rectangle(), Window_scroller_button_list, Window_special_button_list, Window_width, and Windows_open.

Referenced by Button_Airbrush_menu(), Button_Anim_time(), Button_Brush_container(), Button_Brush_FX(), Button_Colorize_menu(), Button_Constraint_menu(), Button_Copy_page(), Button_Effects(), Button_Gradients(), Button_Grid_menu(), Button_Layer_menu(), Button_Load_or_Save(), Button_Message_initial(), Button_Paintbrush_menu(), Button_Palette(), Button_Quick_shade_menu(), Button_Quit_local_function(), Button_Resolution(), Button_Secondary_palette(), Button_Settings(), Button_Sieve_menu(), Button_Skins(), Button_Smooth_menu(), Button_Stats(), Button_Text(), Button_Tilemap_menu(), Button_Tiling_menu(), Button_Transform_menu(), Confirmation_box(), Dialog_multiple_choice(), Load_SCR(), Menu_shade(), Menu_tag_colors(), Message_out_of_memory(), Requester_window(), Save_C64_window(), Save_image(), Save_MOTO_window(), Tilemap_update(), Verbose_message(), Warning_message(), Window_help(), Window_Histogram(), and Window_set_shortcut().

◆ Close_window()

void Close_window ( void  )

Close a window previously open with Open_window()

The mouse must be shown when this functions is called. It is hidden when the function returns.

References Allow_colorcycling, Allow_drag_and_drop(), Check_menu_mode(), Compute_paintbrush_coordinates(), Cursor_shape, Cursor_shape_before_window, Display_all_screen(), Display_menu(), Hide_cursor, Key, Menu_is_visible, Menu_is_visible_before_window, Menu_Y, Menu_Y_before_window, Mouse_K, NULL, Old_MX, Old_MY, Paintbrush_hidden, Paintbrush_hidden_before_window, Restore_background(), Update_window_area, Window_background, Window_dropdown_button_list, Window_dropdown_clear_items(), Window_height, Window_list_button_list, Window_normal_button_list, Window_palette_button_list, Window_pos_X, Window_pos_Y, Window_scroller_button_list, Window_special_button_list, Window_width, and Windows_open.

Referenced by Button_Airbrush_menu(), Button_Anim_time(), Button_Brush_container(), Button_Brush_FX(), Button_Colorize_menu(), Button_Constraint_menu(), Button_Copy_page(), Button_Effects(), Button_Gradients(), Button_Grid_menu(), Button_Layer_menu(), Button_Load_or_Save(), Button_Message_initial(), Button_Paintbrush_menu(), Button_Palette(), Button_Quick_shade_menu(), Button_Quit_local_function(), Button_Resolution(), Button_Secondary_palette(), Button_Settings(), Button_Sieve_menu(), Button_Skins(), Button_Smooth_menu(), Button_Stats(), Button_Text(), Button_Tilemap_menu(), Button_Tiling_menu(), Button_Transform_menu(), Confirmation_box(), Dialog_multiple_choice(), Load_SCR(), Menu_shade(), Menu_tag_colors(), Message_out_of_memory(), Requester_window(), Save_C64_window(), Save_image(), Save_MOTO_window(), Tilemap_update(), Verbose_message(), Warning_message(), Window_help(), Window_Histogram(), and Window_set_shortcut().

◆ Open_popup()

void Open_popup ( word  x_pos,
word  y_pos,
word  width,
word  height 
)

Open a popup window.

Parameters
x_posleft position
y_postop position
widthwidth of the popup (max 320)
heightheight of the popup (max 200)

The mouse cursor must be shown when calling this function. When the function returns it is hidden.

Popup windows are managed as sub-windows. They have their own event loop, widget can be added inside, etc. The differences with plain windows are almost only graphical :

  • Possibility of fixing position (x_pos, y_pos)
  • No title
  • No 3D border, but a flat white border.

References Cursor_shape, CURSOR_SHAPE_ARROW, Cursor_shape_before_window, Menu_factor_X, Menu_factor_Y, Menu_is_visible, Menu_is_visible_before_window, Menu_Y, Menu_Y_before_window, NULL, Paintbrush_hidden, Paintbrush_hidden_before_window, Save_background(), Screen_height, Screen_width, Window_background, Window_draggable, Window_dropdown_button_list, Window_height, Window_nb_buttons, Window_normal_button_list, Window_palette_button_list, Window_pos_X, Window_pos_Y, Window_scroller_button_list, Window_special_button_list, Window_width, and Windows_open.

Referenced by Dropdown_activate(), Init_virtual_keyboard(), and Layer_preview_on().

◆ Close_popup()

◆ Window_draw_normal_bouton()

void Window_draw_normal_bouton ( word  x_pos,
word  y_pos,
word  width,
word  height,
const char *  title,
byte  undersc_letter,
byte  clickable 
)

◆ Window_select_normal_button()

◆ Window_unselect_normal_button()

void Window_unselect_normal_button ( word  x_pos,
word  y_pos,
word  width,
word  height 
)

◆ Window_draw_palette_bouton()

void Window_draw_palette_bouton ( word  x_pos,
word  y_pos 
)

◆ Compute_slider_cursor_length()

◆ Window_draw_slider()

◆ Window_draw_scroller_button()

◆ Window_input_content()

◆ Window_clear_input_button()

◆ Window_draw_input_bouton()

void Window_draw_input_bouton ( word  x_pos,
word  y_pos,
word  width_in_characters 
)

◆ Window_set_normal_button()

◆ Window_set_repeatable_button()

◆ Window_set_palette_button()

◆ Window_clear_tags()

void Window_clear_tags ( void  )

◆ Tag_color_range()

◆ Window_set_scroller_button()

◆ Window_set_horizontal_scroller_button()

◆ Window_set_special_button()

◆ Window_set_input_button_s()

T_Special_button * Window_set_input_button_s ( word  x_pos,
word  y_pos,
word  width_in_characters,
word  shortcut 
)

◆ Window_set_input_button()

◆ Window_set_dropdown_button()

◆ Window_dropdown_add_item()

◆ Window_dropdown_clear_items()

◆ Dropdown_activate()

◆ Window_set_list_button()

◆ Window_redraw_list()

◆ Window_click_in_rectangle()

byte Window_click_in_rectangle ( short  start_x,
short  start_y,
short  end_x,
short  end_y 
)

◆ Wait_click_in_palette()

◆ Window_normal_button_onclick()

short Window_normal_button_onclick ( word  x_pos,
word  y_pos,
word  width,
word  height,
short  btn_number 
)

◆ Get_color_behind_window()

◆ Window_clicked_button()

short Window_clicked_button ( void  )

References Config, T_List_button::Cursor_position, Display_cursor(), T_Config::Double_click_speed, T_List_button::Draw_list_item, T_List_button::Entry_button, Get_input(), GFX2_GetTicks(), Hide_cursor, Input_sticky_control, Key, KEY_DOWN, KEY_END, KEY_HOME, KEY_MOUSEWHEELDOWN, KEY_MOUSEWHEELUP, KEY_PAGEDOWN, KEY_PAGEUP, KEY_UP, T_List_button::List_start, Menu_factor_X, Menu_factor_Y, Mouse_K, Mouse_X, Mouse_Y, Move_window(), T_Scroller_button::Nb_elements, T_Scroller_button::Nb_visibles, T_List_button::Next, NULL, T_Scroller_button::Number, T_Special_button::Number, T_List_button::Number, T_Special_button::Pos_X, T_Special_button::Pos_Y, T_Scroller_button::Position, T_List_button::Scroller, Window_attribute2, Window_draggable, Window_draw_slider(), Window_get_button_shortcut(), Window_get_clicked_button(), Window_height, Window_list_button_list, Window_pos_X, Window_pos_Y, Window_redraw_list(), and Window_width.

Referenced by Button_Airbrush_menu(), Button_Anim_time(), Button_Brush_container(), Button_Brush_FX(), Button_Colorize_menu(), Button_Constraint_menu(), Button_Copy_page(), Button_Effects(), Button_Gradients(), Button_Grid_menu(), Button_Layer_menu(), Button_Load_or_Save(), Button_Paintbrush_menu(), Button_Palette(), Button_Quick_shade_menu(), Button_Quit_local_function(), Button_Resolution(), Button_Secondary_palette(), Button_Settings(), Button_Sieve_menu(), Button_Skins(), Button_Smooth_menu(), Button_Stats(), Button_Text(), Button_Tilemap_menu(), Button_Tiling_menu(), Button_Transform_menu(), Confirmation_box(), Dialog_multiple_choice(), Load_SCR(), Menu_shade(), Menu_tag_colors(), Message_out_of_memory(), Readline_ex_unicode(), Requester_window(), Save_C64_window(), Save_image(), Save_MOTO_window(), Verbose_message(), Warning_message(), Window_help(), Window_Histogram(), and Window_set_shortcut().

◆ Button_under_mouse()

◆ Window_get_button_shortcut()

◆ Window_get_clicked_button()

short Window_get_clicked_button ( void  )

References T_Dropdown_button::Active_button, Config, T_Scroller_button::Cursor_length, T_Config::Delay_left_click_on_slider, T_Config::Delay_right_click_on_slider, Delay_with_active_mouse(), Display_cursor(), T_Normal_button::Height, T_Special_button::Height, T_Dropdown_button::Height, Hide_cursor, Input_sticky_control, T_Scroller_button::Is_horizontal, T_Scroller_button::Length, Menu_factor_X, Menu_factor_Y, Mouse_K, Mouse_X, Mouse_Y, T_Scroller_button::Nb_elements, T_Scroller_button::Nb_visibles, T_Normal_button::Next, T_Palette_button::Next, T_Scroller_button::Next, T_Special_button::Next, T_Dropdown_button::Next, T_Normal_button::Number, T_Palette_button::Number, T_Scroller_button::Number, T_Special_button::Number, T_Dropdown_button::Number, T_Normal_button::Pos_X, T_Palette_button::Pos_X, T_Scroller_button::Pos_X, T_Special_button::Pos_X, T_Dropdown_button::Pos_X, T_Normal_button::Pos_Y, T_Palette_button::Pos_Y, T_Scroller_button::Pos_Y, T_Special_button::Pos_Y, T_Dropdown_button::Pos_Y, T_Scroller_button::Position, T_Normal_button::Repeatable, T_Normal_button::Width, T_Special_button::Width, T_Dropdown_button::Width, Window_attribute1, Window_attribute2, Window_click_in_rectangle(), Window_draw_slider(), Window_dropdown_button_list, Window_dropdown_on_click(), Window_normal_button_list, Window_normal_button_onclick(), Window_palette_button_list, Window_pos_X, Window_pos_Y, Window_scroller_button_list, Window_select_normal_button(), Window_special_button_list, and Window_unselect_normal_button().

Referenced by Button_Effects(), Button_Message_initial(), and Window_clicked_button().

◆ Remap_window_backgrounds()

void Remap_window_backgrounds ( const byte conversion_table,
int  Min_Y,
int  Max_Y 
)

Remaps all the colors from the window background buffers from row Min_Y to row Max_Y.

References T_Window::Height, Max_Y, Menu_factor_X, Menu_factor_Y, Min_Y, Pixel_width, T_Window::Width, Window_background, Window_stack, and Windows_open.

Referenced by Remap_image_highlevel().

◆ Remap_UI_in_window_backgrounds()

void Remap_UI_in_window_backgrounds ( const byte conversion_table)

◆ Pixel_background()

void Pixel_background ( int  x_pos,
int  y_pos,
byte  color 
)

Draw a pixel in a saved screen block (when you sort colors in the palette, for example)

References Menu_factor_X, Pixel_width, Window_background, and Window_width.

Referenced by Display_menu_palette_avoiding_window().

◆ Status_print_palette_color()

void Status_print_palette_color ( byte  color)

Updates the status bar line with a color number.

Used when hovering the menu palette.

References BUTTON_CHOOSE_COL, Buttons_Pool, Encode_component(), Main, T_Document::palette, and Print_in_menu().

Referenced by Button_Select_backcolor(), Button_Select_forecolor(), and Main_handler().

◆ Delay_with_active_mouse()

void Delay_with_active_mouse ( int  delay)

Puts the user in wait mode for the specified time ( in 1/100s), though the mouse still works.

References Get_input(), GFX2_GetTicks(), and Mouse_K.

Referenced by Error_function(), Window_get_button_shortcut(), and Window_get_clicked_button().

◆ Compute_menu_offsets()

void Compute_menu_offsets ( void  )

Based on which toolbars are visible, updates their offsets and computes Menu_height and Menu_Y.

References T_Menu_Bar::Height, Menu_bars, Menu_factor_Y, Menu_height, Menu_Y, MENUBAR_COUNT, Screen_height, and T_Menu_Bar::Top.

Referenced by Init_program(), and Set_bar_visibility().

◆ Set_bar_visibility()

◆ Check_menu_mode()

int Check_menu_mode ( void  )

Checks if the current menu toolbars suit the current image type : layered vs anim.

If they don't fit, swap the toolbars and return 1: The caller is then responsible for refreshing the screen by calling Display_menu() and Display_all_screen()

References T_Document::backups, T_Page::Image_mode, IMAGE_MODE_ANIMATION, Main, Menu_bars, MENUBAR_ANIMATION, MENUBAR_LAYERS, T_List_of_pages::Pages, and Set_bar_visibility().

Referenced by Button_Constraint_menu(), Button_Message_initial(), Button_Page(), Button_Redo(), Button_Reload(), Button_Toggle_all_toolbars(), Button_Undo(), Close_window(), Init_program(), Load_picture(), and Main_handler().