GrafX2 2.9.3227
The ultimate 256-color painting program
|
Initialization (and some de-initialization) functions. More...
Functions | |
T_Gui_skin * | Load_graphics (const char *skin_file, T_Gradient_array *gradients) |
void | Set_current_skin (const char *skinfile, T_Gui_skin *gfx) |
void | Init_buttons (void) |
void | Init_operations (void) |
void | Init_brush_container (void) |
int | Load_CFG (int reload_all) |
int | Save_CFG (void) |
void | Set_all_video_modes (void) |
void | Set_config_defaults (void) |
void | Init_sighandler (void) |
void | Init_paintbrushes (void) |
void | Define_icon (void) |
Set application icon(s) More... | |
byte * | Load_font (const char *font_name, int is_main) |
Loads a 8x8 monochrome font, the kind used in all menus and screens. More... | |
void | Load_Unicode_fonts (void) |
Load fonts for additional Unicode characters. More... | |
Variables | |
char | Gui_loading_error_message [256] |
Initialization (and some de-initialization) functions.
T_Gui_skin * Load_graphics | ( | const char * | skin_file, |
T_Gradient_array * | gradients | ||
) |
References Data_directory, Free_GFX2_Surface(), GFX2_malloc, Gui_loading_error_message, Load_surface(), NULL, Parse_skin(), and SKINS_SUBDIRECTORY.
Referenced by Button_Skins(), and Init_program().
void Set_current_skin | ( | const char * | skinfile, |
T_Gui_skin * | gfx | ||
) |
References T_Gui_skin::Animbar_block, T_Gui_skin::Color, T_Gui_skin::Color_trans, Config, Gfx, T_Gui_skin::Layerbar_block, MC_Black, MC_Dark, MC_Darker, MC_Light, MC_Lighter, MC_OnBlack, MC_Trans, MC_White, MC_Window, Menu_bars, T_Gui_skin::Menu_block, MENUBAR_ANIMATION, MENUBAR_LAYERS, MENUBAR_STATUS, MENUBAR_TOOLS, T_Menu_Bar::Skin, T_Config::Skin_file, and T_Gui_skin::Statusbar_block.
Referenced by Button_Skins(), and Init_program().
void Init_buttons | ( | void | ) |
References BUTTON_SHAPE_RECTANGLE, Buttons_Pool, Do_nothing(), Init_button(), T_Toolbar_button::Left_shortcut, NB_BUTTONS, and T_Toolbar_button::Right_shortcut.
Referenced by Init_program().
void Init_operations | ( | void | ) |
References Airbrush_0_2(), Airbrush_12_2(), Airbrush_1_0(), Airbrush_2_0(), Brush_0_5(), Brush_12_0(), Brush_12_5(), Centered_lines_0_3(), Centered_lines_0_7(), Centered_lines_12_0(), Centered_lines_12_3(), Centered_lines_12_7(), Circle_12_0(), Circle_12_5(), Colorpicker_0_1(), Colorpicker_12_0(), Colorpicker_1_1(), Colorpicker_2_1(), Colorpicker_color, Curve_34_points_1_0(), Curve_34_points_1_5(), Curve_34_points_2_0(), Curve_34_points_2_5(), Curve_3_points_0_11(), Curve_3_points_0_5(), Curve_3_points_12_11(), Curve_4_points_0_5(), Curve_4_points_1_9(), Curve_4_points_2_9(), Distort_brush_0_0(), Distort_brush_0_9(), Distort_brush_1_0(), Distort_brush_1_8(), Distort_brush_1_9(), Distort_brush_2_0(), Distort_brush_2_8(), Ellipse_12_0(), Ellipse_12_5(), Empty_circle_0_5(), Empty_ellipse_0_5(), Empty_rectangle_0_5(), FAST_MOUSE, Fill_1_0(), Fill_2_0(), Filled_circle_0_5(), Filled_contour_0_8(), Filled_ellipse_0_5(), Filled_polyform_0_8(), Filled_polyform_12_0(), Filled_polyform_12_8(), Filled_rectangle_0_5(), Freehand_mode12_0_2(), Freehand_mode1_1_0(), Freehand_mode1_1_2(), Freehand_mode1_2_0(), Freehand_mode1_2_2(), Freehand_mode2_1_0(), Freehand_mode2_1_2(), Freehand_mode2_2_0(), Freehand_mode2_2_2(), Freehand_mode3_0_1(), Freehand_mode3_1_0(), Freehand_Mode3_2_0(), Grad_circle_0_6(), Grad_circle_12_0(), Grad_circle_12_6(), Grad_circle_12_8(), Grad_circle_or_ellipse_0_8(), Grad_ellipse_0_6(), Grad_ellipse_12_0(), Grad_ellipse_12_6(), Grad_ellipse_12_8(), Grad_rectangle_0_5(), Grad_rectangle_0_7(), Grad_rectangle_0_9(), Grad_rectangle_12_0(), Grad_rectangle_12_5(), Grad_rectangle_12_7(), Grad_rectangle_12_9(), HIDE_CURSOR, Init_operation(), K_line_0_6(), K_line_12_0(), K_line_12_6(), K_line_12_7(), Line_0_5(), Line_12_0(), Line_12_5(), Magnifier_12_0(), NB_OPERATIONS, OPERATION_3_POINTS_CURVE, OPERATION_4_POINTS_CURVE, OPERATION_AIRBRUSH, OPERATION_CENTERED_LINES, OPERATION_COLORPICK, OPERATION_CONTINUOUS_DRAW, OPERATION_DISCONTINUOUS_DRAW, OPERATION_DISTORT_BRUSH, OPERATION_EMPTY_CIRCLE_CRN, OPERATION_EMPTY_CIRCLE_CTR, OPERATION_EMPTY_ELLIPSE_CRN, OPERATION_EMPTY_ELLIPSE_CTR, OPERATION_EMPTY_RECTANGLE, OPERATION_FILL, OPERATION_FILLED_CIRCLE_CRN, OPERATION_FILLED_CIRCLE_CTR, OPERATION_FILLED_CONTOUR, OPERATION_FILLED_ELLIPSE_CRN, OPERATION_FILLED_ELLIPSE_CTR, OPERATION_FILLED_POLYFORM, OPERATION_FILLED_RECTANGLE, OPERATION_GRAB_BRUSH, OPERATION_GRAD_CIRCLE_CRN, OPERATION_GRAD_CIRCLE_CTR, OPERATION_GRAD_ELLIPSE_CRN, OPERATION_GRAD_ELLIPSE_CTR, OPERATION_GRAD_RECTANGLE, OPERATION_K_LINE, OPERATION_LINE, OPERATION_MAGNIFY, OPERATION_PAN_VIEW, OPERATION_POINT_DRAW, OPERATION_POLYBRUSH, OPERATION_POLYFILL, OPERATION_POLYFORM, OPERATION_POLYGON, OPERATION_REPLACE, OPERATION_RMB_COLORPICK, OPERATION_ROTATE_BRUSH, OPERATION_SCROLL, OPERATION_STACK_SIZE, OPERATION_STRETCH_BRUSH, Pan_view_0_0(), Pan_view_0_2(), Pan_view_12_0(), Pan_view_12_2(), Polybrush_12_8(), Polyfill_0_8(), Polyfill_12_0(), Polyfill_12_8(), Polyfill_12_9(), Polyform_0_8(), Polyform_12_0(), Polyform_12_8(), Polygon_12_0(), Polygon_12_9(), Print_coordinates(), Rectangle_12_0(), Rectangle_12_5(), Replace_1_0(), Replace_2_0(), Rightclick_colorpick_0_1(), Rotate_brush_0_5(), Rotate_brush_12_0(), Rotate_brush_1_5(), Rotate_brush_2_5(), Scroll_0_5(), Scroll_12_0(), Scroll_12_5(), Stretch_brush_0_7(), Stretch_brush_12_0(), Stretch_brush_1_7(), and Stretch_brush_2_7().
Referenced by Init_program().
void Init_brush_container | ( | void | ) |
References T_Brush_template::Brush, Brush_container, BRUSH_CONTAINER_COLUMNS, BRUSH_CONTAINER_PREVIEW_HEIGHT, BRUSH_CONTAINER_PREVIEW_WIDTH, BRUSH_CONTAINER_ROWS, T_Brush_template::Height, NULL, T_Brush_template::Paintbrush_shape, PAINTBRUSH_SHAPE_MAX, T_Brush_template::Transp_color, and T_Brush_template::Width.
Referenced by Init_program().
int Load_CFG | ( | int | reload_all | ) |
References BETA1, T_Config_header::Beta1, BETA2, T_Config_header::Beta2, Bound_script, Buttons_Pool, CHUNK_BRUSH, CHUNK_EXCLUDE_COLORS, CHUNK_GRADIENTS, CHUNK_GRID, CHUNK_KEYS, CHUNK_MASK, CHUNK_QUICK_SHADE, CHUNK_SCRIPTS, CHUNK_SHADE, CHUNK_SMOOTH, CHUNK_STENCIL, CHUNK_VIDEO_MODES, Config_directory, CONFIG_FILENAME, Config_Key, ConfigKey, ERROR_CFG_CORRUPTED, ERROR_CFG_MISSING, ERROR_CFG_OLD, ERROR_MEMORY, Exclude_color, File_length_file(), Filepath_append_to_dir(), GFX2_DEBUG, GFX2_Log(), GFX2_malloc, T_Video_mode::Height, T_Config_video_mode::Height, T_Paintbrush::Height, T_Config_shortcut_info::Key, T_Config_shortcut_info::Key2, Key_for_scancode(), T_Toolbar_button::Left_shortcut, Mask_table, NB_PAINTBRUSH_SPRITES, NB_SHORTCUTS, Nb_video_modes, NULL, T_Config_chunk::Number, T_Config_shortcut_info::Number, Ordering, Paintbrush, Quick_shade_loop, Quick_shade_step, Read_byte(), Read_bytes(), Read_word_le(), T_Toolbar_button::Right_shortcut, Shade_current, Shade_list, Shade_list_to_lookup_tables(), Shade_table_left, Shade_table_right, T_Config_header::Signature, T_Config_chunk::Size, Smooth_matrix, Snap_height, Snap_offset_X, Snap_offset_Y, Snap_width, T_Paintbrush::Sprite, T_Config_video_mode::State, Stencil, VERSION1, T_Config_header::Version1, VERSION2, T_Config_header::Version2, Video_mode, T_Config_video_mode::Width, and T_Paintbrush::Width.
Referenced by Init_program(), and Settings_load_config().
int Save_CFG | ( | void | ) |
References BETA1, T_Config_header::Beta1, BETA2, T_Config_header::Beta2, Bound_script, Buttons_Pool, CHUNK_BRUSH, CHUNK_EXCLUDE_COLORS, CHUNK_GRID, CHUNK_KEYS, CHUNK_MASK, CHUNK_QUICK_SHADE, CHUNK_SCRIPTS, CHUNK_SHADE, CHUNK_SMOOTH, CHUNK_STENCIL, CHUNK_VIDEO_MODES, Config_directory, CONFIG_FILENAME, Config_Key, ConfigKey, ERROR_SAVING_CFG, Exclude_color, Filepath_append_to_dir(), GFX2_DEBUG, GFX2_ERROR, GFX2_Log(), GFX2_WARNING, T_Video_mode::Height, T_Config_video_mode::Height, T_Paintbrush::Height, T_Config_shortcut_info::Key, T_Config_shortcut_info::Key2, T_Toolbar_button::Left_shortcut, Mask_table, NB_PAINTBRUSH_SPRITES, NB_SHORTCUTS, Nb_video_modes, NULL, T_Key_config::Number, T_Config_chunk::Number, T_Config_shortcut_info::Number, Ordering, Paintbrush, Quick_shade_loop, Quick_shade_step, T_Toolbar_button::Right_shortcut, Shade_current, Shade_list, T_Config_header::Signature, T_Config_chunk::Size, Smooth_matrix, Snap_height, Snap_offset_X, Snap_offset_Y, Snap_width, T_Video_mode::State, T_Config_video_mode::State, Stencil, VERSION1, T_Config_header::Version1, VERSION2, T_Config_header::Version2, Video_mode, T_Video_mode::Width, T_Config_video_mode::Width, T_Paintbrush::Width, Write_byte(), Write_bytes(), and Write_word_le().
Referenced by Program_shutdown(), and Settings_save_config().
void Set_all_video_modes | ( | void | ) |
References Compare_video_modes(), T_Video_mode::Fullscreen, GFX2_GetScreenSize(), T_Video_mode::Height, T_Video_mode::Mode, mode, Nb_video_modes, NULL, Set_video_mode(), T_Video_mode::State, Video_mode, and T_Video_mode::Width.
Referenced by Init_program().
void Set_config_defaults | ( | void | ) |
References Buttons_Pool, Config_Key, ConfigKey, Exclude_color, T_Key_config::Key, T_Key_config::Key2, T_Toolbar_button::Left_shortcut, Mask_table, T_Shade::Mode, NB_SHORTCUTS, Ordering, Quick_shade_loop, Quick_shade_step, T_Toolbar_button::Right_shortcut, Shade_current, Shade_list, Shade_list_to_lookup_tables(), Shade_table_left, Shade_table_right, Smooth_matrix, Snap_height, Snap_offset_X, Snap_offset_Y, Snap_width, Stencil, and T_Shade::Step.
Referenced by Init_program().
void Init_sighandler | ( | void | ) |
Referenced by Init_program().
void Init_paintbrushes | ( | void | ) |
References T_Paintbrush::Height, Init_paintbrush(), NB_PAINTBRUSH_SPRITES, NULL, T_Paintbrush::Offset_X, T_Paintbrush::Offset_Y, Paintbrush, PAINTBRUSH_SHAPE_ANTISLASH, PAINTBRUSH_SHAPE_CROSS, PAINTBRUSH_SHAPE_DIAMOND, PAINTBRUSH_SHAPE_HORIZONTAL_BAR, PAINTBRUSH_SHAPE_MISC, PAINTBRUSH_SHAPE_PLUS, PAINTBRUSH_SHAPE_RANDOM, PAINTBRUSH_SHAPE_ROUND, PAINTBRUSH_SHAPE_SIEVE_ROUND, PAINTBRUSH_SHAPE_SIEVE_SQUARE, PAINTBRUSH_SHAPE_SLASH, PAINTBRUSH_SHAPE_SQUARE, PAINTBRUSH_SHAPE_VERTICAL_BAR, and T_Paintbrush::Width.
Referenced by Init_program().
void Define_icon | ( | void | ) |
Set application icon(s)
References Data_directory, Filepath_append_to_dir(), Get_SDL_pixel_hicolor(), GFX2_Get_Window_Handle(), GFX2_Log(), GFX2_WARNING, T_GFX2_Surface::h, icon, NULL, TRUE, and T_GFX2_Surface::w.
Referenced by Init_program().
byte * Load_font | ( | const char * | font_name, |
int | is_main | ||
) |
Loads a 8x8 monochrome font, the kind used in all menus and screens.
This function allocates the memory, and returns a pointer to it when successful. If an error is encountered, it frees what needs it, prints an error message in Gui_loading_error_message, and returns NULL.
References Data_directory, Free_GFX2_Surface(), GFX2_malloc, Gui_loading_error_message, Load_surface(), NULL, Parse_font(), and SKINS_SUBDIRECTORY.
Referenced by Button_Skins(), Init_program(), and Load_Unicode_font().
void Load_Unicode_fonts | ( | void | ) |
Load fonts for additional Unicode characters.
References Data_directory, Filepath_append_to_dir(), For_each_file(), Load_Unicode_font(), and SKINS_SUBDIRECTORY.
Referenced by Init_program().
|
extern |
Referenced by Button_Skins(), Error_function(), GUI_seek_down(), GUI_seek_right(), Init_program(), Load_font(), Load_graphics(), Parse_font(), Parse_skin(), and Read_GUI_block().