GrafX2 2.9.3227
The ultimate 256-color painting program
|
#include <stdio.h>
#include <stdarg.h>
#include "../struct.h"
#include "../global.h"
#include "../readline.h"
Functions | |
void | Warning_message (const char *message) |
Window that shows a warning message and wait for a click on the OK button. More... | |
void | Warning_with_format (const char *template,...) |
Window that shows a warning message and waits for a click on the OK button. More... | |
void | Error_function (int error_code, const char *filename, int line_number, const char *function_name) |
Helper function used by the macro Error. More... | |
void | Warning_function (const char *message, const char *filename, int line_number, const char *function_name) |
void | Window_help (int section, const char *sub_section) |
Displays and runs the "Help / About..." window. More... | |
void | Open_window (word width, word height, const char *title) |
Open a GUI window. More... | |
void | Close_window () |
Close a window previously open with Open_window() More... | |
void | Print_in_window (short x, short y, const char *str, byte text_color, byte background_color) |
Draws a string in a window. More... | |
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_button * | Window_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) |
T_Normal_button * | Window_set_normal_button (word x_pos, word y_pos, word width, word height, const char *title, byte undersc_letter, byte clickable, word shortcut) |
short | Window_clicked_button (void) |
int | Is_shortcut (word key, word function) |
Returns true if the keycode has been set as a keyboard shortcut for the function. More... | |
void | Update_rect (short x, short y, unsigned short width, unsigned short height) |
void | Display_cursor (void) |
void | Hide_cursor (void) |
Boolean: Need to hide/unhide cursor during this step. More... | |
word | Count_used_colors (dword *usage) |
Count used palette indexes in the whole picture Return the total number of different colors Fill in "usage" with the count for each color. More... | |
word | Count_used_colors_area (dword *usage, word start_x, word start_y, word width, word height) |
Same as Count_used_colors, but for a given rectangle in the picture only. More... | |
void | Window_input_content (T_Special_button *button, const char *content) |
T_Special_button * | Window_set_input_button (word x_pos, word y_pos, word width_in_characters) |
byte | Readline (word x_pos, word y_pos, char *str, byte visible_size, enum INPUT_TYPE input_type) |
Lets the user input a line of text, exit by Esc or Return. More... | |
void Error_function | ( | int | error_code, |
const char * | filename, | ||
int | line_number, | ||
const char * | function_name | ||
) |
Helper function used by the macro Error.
References backup_palette, Config_directory, Delay_with_active_mouse(), Display_syntax(), ERROR_COMMAND_LINE, ERROR_FORBIDDEN_MODE, ERROR_FORBIDDEN_SIZE, ERROR_GUI_CORRUPTED, ERROR_GUI_MISSING, ERROR_INI_CORRUPTED, ERROR_INI_MISSING, ERROR_MEMORY, ERROR_MISSING_DIRECTORY, ERROR_SAVING_CFG, ERROR_SAVING_INI, ERROR_SORRY_SORRY_SORRY, Get_current_palette(), GFX2_MB_ERROR, GFX2_MessageBox(), Gui_loading_error_message, INI_FILENAME, Line_number_in_INI_file, NULL, Set_palette(), and temp_palette.
void Warning_function | ( | const char * | message, |
const char * | filename, | ||
int | line_number, | ||
const char * | function_name | ||
) |
void Window_help | ( | int | section, |
const char * | sub_section | ||
) |
Displays and runs the "Help / About..." window.
section | Number of the help section page to display (equals the button number the mouse was hovering for the contextual help), -1 for the main help page. |
sub_section | Help sub-section title (the page will be scrolled so this title is at the top). |
Open a GUI window.
width | window width (max 320) |
height | window height (max 200) |
title | window 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 Windows_open.
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 Windows_open.
Draws a string in a window.
void Window_dropdown_add_item | ( | T_Dropdown_button * | dropdown, |
word | btn_number, | ||
const char * | label | ||
) |
Adds an item to a dropdown menu.
References label.
void Window_dropdown_clear_items | ( | T_Dropdown_button * | dropdown | ) |
T_Dropdown_button * Window_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 | ||
) |
References NULL.
T_Normal_button * Window_set_normal_button | ( | word | x_pos, |
word | y_pos, | ||
word | width, | ||
word | height, | ||
const char * | title, | ||
byte | undersc_letter, | ||
byte | clickable, | ||
word | shortcut | ||
) |
References NULL.
short Window_clicked_button | ( | void | ) |
Returns true if the keycode has been set as a keyboard shortcut for the function.
void Update_rect | ( | short | x, |
short | y, | ||
unsigned short | width, | ||
unsigned short | height | ||
) |
References Max_X, Max_Y, Min_X, Min_Y, Pixel_height, Pixel_width, and Screen_SDL.
Referenced by Button_Magnify(), Button_Magnify_menu(), Button_Palette(), Button_Sieve_menu(), Clear_brush_double(), Clear_brush_quad(), Clear_brush_scaled_double(), Clear_brush_scaled_quad(), Clear_brush_scaled_simple(), Clear_brush_scaled_tall(), Clear_brush_scaled_tall2(), Clear_brush_scaled_tall3(), Clear_brush_scaled_triple(), Clear_brush_scaled_wide(), Clear_brush_scaled_wide2(), Clear_brush_simple(), Clear_brush_tall(), Clear_brush_tall2(), Clear_brush_tall3(), Clear_brush_triple(), Clear_brush_wide(), Clear_brush_wide2(), Display_all_screen(), Display_brush_color_double(), Display_brush_color_quad(), Display_brush_color_simple(), Display_brush_color_tall(), Display_brush_color_tall2(), Display_brush_color_tall3(), Display_brush_color_triple(), Display_brush_color_wide(), Display_brush_color_wide2(), Display_brush_mono_double(), Display_brush_mono_quad(), Display_brush_mono_simple(), Display_brush_mono_tall(), Display_brush_mono_tall2(), Display_brush_mono_tall3(), Display_brush_mono_triple(), Display_brush_mono_wide(), Display_brush_mono_wide2(), Display_brush_mono_zoom_double(), Display_brush_mono_zoom_quad(), Display_brush_mono_zoom_simple(), Display_brush_mono_zoom_tall(), Display_brush_mono_zoom_tall2(), Display_brush_mono_zoom_tall3(), Display_brush_mono_zoom_triple(), Display_brush_mono_zoom_wide(), Display_brush_mono_zoom_wide2(), Display_cursor(), Display_effect_sprite(), Display_foreback(), Display_grad_block_in_window(), Display_image_limits(), Display_layerbar(), Display_menu(), Display_menu_palette(), Display_menu_palette_avoiding_window(), Display_paintbrush_in_window(), Display_part_of_screen_scaled_double(), Display_part_of_screen_scaled_quad(), Display_part_of_screen_scaled_simple(), Display_part_of_screen_scaled_tall(), Display_part_of_screen_scaled_tall2(), Display_part_of_screen_scaled_tall3(), Display_part_of_screen_scaled_triple(), Display_part_of_screen_scaled_wide(), Display_part_of_screen_scaled_wide2(), Display_separator(), Distort_brush_1_9(), Draw_gradient_preview(), Draw_menu_button(), Draw_preset_sieve_patterns(), Draw_sieve_scaled(), Draw_xor_rect(), Fill_general(), Frame_menu_color(), Get_input(), Hide_cursor(), Horizontal_XOR_line_zoom(), Main_handler(), Move_separator(), Move_window(), Readline_ex_unicode(), Remap_screen_double(), Remap_screen_quad(), Remap_screen_simple(), Remap_screen_tall(), Remap_screen_tall2(), Remap_screen_tall3(), Remap_screen_triple(), Remap_screen_wide(), Remap_screen_wide2(), Scroll_picture(), Tilemap_draw(), Update_part_of_screen(), Update_sieve_area(), Vertical_XOR_line_zoom(), and Window_display_icon_sprite().
void Display_cursor | ( | void | ) |
void Hide_cursor | ( | void | ) |
Boolean: Need to hide/unhide cursor during this step.
Count used palette indexes in the whole picture Return the total number of different colors Fill in "usage" with the count for each color.
Same as Count_used_colors, but for a given rectangle in the picture only.
Used bu the C64 block constraint checker.
void Window_input_content | ( | T_Special_button * | button, |
const char * | content | ||
) |
T_Special_button * Window_set_input_button | ( | word | x_pos, |
word | y_pos, | ||
word | width_in_characters | ||
) |
References NULL.
byte Readline | ( | word | x_pos, |
word | y_pos, | ||
char * | str, | ||
byte | visible_size, | ||
enum INPUT_TYPE | input_type | ||
) |
Lets the user input a line of text, exit by Esc or Return.
x_pos | Coordinates of input, in window coordinates before scaling. |
y_pos | Coordinates of input, in window coordinates before scaling. |
str | The original string value (will be modified, unless user cancels. |
visible_size | Number of characters visible and editable. |
input_type | one of enum INPUT_TYPE |