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

Handler for the Undo/Redo system. More...

+ This graph shows which files directly or indirectly include this file:

Functions

void Download_infos_page_main (T_Page *page)
 INDIVIDUAL PAGES. More...
 
byte Add_layer (T_List_of_pages *list, int layer)
 Add a new layer to latest page of a list. Returns 0 on success. More...
 
byte Delete_layer (T_List_of_pages *list, int layer)
 Delete a layer from the latest page of a list. Returns 0 on success. More...
 
byte Merge_layer (void)
 Merges the current layer onto the one below it. More...
 
int Dup_layer_if_shared (T_Page *page, int layer)
 Backs up a layer, unless it's already different from previous history step. More...
 
void Upload_infos_page (T_Document *doc)
 
void Init_list_of_pages (T_List_of_pages *list)
 LISTS OF PAGES. More...
 
int Allocate_list_of_pages (T_List_of_pages *list)
 
void Backward_in_list_of_pages (T_List_of_pages *list)
 
void Advance_in_list_of_pages (T_List_of_pages *list)
 
void Free_last_page_of_list (T_List_of_pages *list)
 
int Create_new_page (T_Page *new_page, T_List_of_pages *current_list, int layer)
 
void Change_page_number_of_list (T_List_of_pages *list, int number)
 
void Free_page_of_a_list (T_List_of_pages *list)
 
int Init_all_backup_lists (enum IMAGE_MODES image_mode, int width, int height)
 GESTION DES BACKUPS. More...
 
void Set_number_of_backups (int nb_backups)
 
int Backup_new_image (int layers, int width, int height)
 
int Backup_with_new_dimensions (int width, int height)
 
int Backup_in_place (int width, int height)
 Resizes a backup step in-place (doesn't add a Undo/Redo step). More...
 
void Backup_the_spare (int layer)
 Backup the spare image, the one you don't see. More...
 
int Backup_and_resize_the_spare (int width, int height)
 
void Backup (void)
 Backup with a new copy for the working layer, and references for all others. More...
 
void Backup_layers (int layer)
 Backup with a new copy of some layers (the others are references). More...
 
void Undo (void)
 
void Redo (void)
 
void Free_current_page (void)
 
void End_of_modification (void)
 
void Update_depth_buffer (void)
 
void Redraw_layered_image (void)
 
void Redraw_current_layer (void)
 
void Update_screen_targets (void)
 
int Update_buffers (int width, int height)
 Update all the special image buffers, if necessary. More...
 
int Update_spare_buffers (int width, int height)
 Update all the special image buffers of the spare page, if necessary. More...
 
void Redraw_spare_image (void)
 
void Update_FX_feedback (byte with_feedback)
 Must be called after changing the head of Main_backups list, or Main_current_layer. More...
 
void Switch_layer_mode (enum IMAGE_MODES new_mode)
 

Variables

byteFX_feedback_screen
 Pointer to the image to read, while drawing. More...
 
T_Bitmap Main_visible_image_backup
 The pixels of visible layers, flattened copy, used for no-feedback effects. More...
 
T_Bitmap Main_visible_image_depth_buffer
 The index of visible pixels Main page T_Document.visible_image. More...
 
static const int LAYER_NONE = -1
 BACKUP HIGH-LEVEL FUNCTIONS. More...
 
static const int LAYER_ALL = -2
 
long Stats_pages_number
 STATISTICS. More...
 
long long Stats_pages_memory
 Total memory used by bitmaps (layers, animation frames, backups) More...
 

Detailed Description

Handler for the Undo/Redo system.

Function Documentation

◆ Download_infos_page_main()

◆ Add_layer()

◆ Delete_layer()

byte Delete_layer ( T_List_of_pages list,
int  layer 
)

Delete a layer from the latest page of a list. Returns 0 on success.

References T_Document::backups, T_Document::current_layer, Free_layer(), T_Page::Image, T_Document::layers_visible, Main, T_Page::Nb_layers, T_List_of_pages::Pages, and Spare.

Referenced by Button_Layer_remove(), and Merge_layer().

◆ Merge_layer()

◆ Dup_layer_if_shared()

int Dup_layer_if_shared ( T_Page page,
int  layer 
)

Backs up a layer, unless it's already different from previous history step.

References Free_layer(), T_Page::Height, T_Page::Image, New_layer(), T_Page::Next, T_Image::Pixels, and T_Page::Width.

◆ Upload_infos_page()

◆ Init_list_of_pages()

void Init_list_of_pages ( T_List_of_pages list)

LISTS OF PAGES.

LISTS OF PAGES.

References T_List_of_pages::List_size, NULL, and T_List_of_pages::Pages.

Referenced by Init_program().

◆ Allocate_list_of_pages()

◆ Backward_in_list_of_pages()

void Backward_in_list_of_pages ( T_List_of_pages list)

◆ Advance_in_list_of_pages()

void Advance_in_list_of_pages ( T_List_of_pages list)

◆ Free_last_page_of_list()

◆ Create_new_page()

◆ Change_page_number_of_list()

void Change_page_number_of_list ( T_List_of_pages list,
int  number 
)

◆ Free_page_of_a_list()

◆ Init_all_backup_lists()

◆ Set_number_of_backups()

void Set_number_of_backups ( int  nb_backups)

◆ Backup_new_image()

◆ Backup_with_new_dimensions()

◆ Backup_in_place()

int Backup_in_place ( int  width,
int  height 
)

Resizes a backup step in-place (doesn't add a Undo/Redo step).

Should only be called after an actual backup, because it loses the current. pixels. This function is meant to be used from within Lua scripts.

References T_Document::backups, Download_infos_page_main(), Free_layer(), GFX2_malloc, T_Page::Height, T_Bitmap::Height, T_Page::Image, T_Bitmap::Image, T_Page::Image_mode, IMAGE_MODE_ANIMATION, Main, Main_visible_image_depth_buffer, T_Page::Nb_layers, New_layer(), NULL, T_List_of_pages::Pages, T_Image::Pixels, T_Page::Transparent_color, Update_screen_targets(), T_Document::visible_image, T_Page::Width, and T_Bitmap::Width.

◆ Backup_the_spare()

◆ Backup_and_resize_the_spare()

◆ Backup()

◆ Backup_layers()

◆ Undo()

◆ Redo()

◆ Free_current_page()

◆ End_of_modification()

void End_of_modification ( void  )

References T_Document::backups, Config, T_Document::edits_since_safety_backup, T_Config::FX_Feedback, T_Bitmap::Image, T_Document::image_height, T_Page::Image_mode, IMAGE_MODE_ANIMATION, T_Document::image_width, Main, Main_visible_image_backup, T_List_of_pages::Pages, Rotate_safety_backups(), Update_buffers(), Update_FX_feedback(), Update_screen_targets(), and T_Document::visible_image.

Referenced by Airbrush_0_2(), Brush_0_5(), Button_Anim_time(), Button_Clear(), Button_Clear_with_backcolor(), Button_Constraint_menu(), Button_Layer_add(), Button_Layer_down(), Button_Layer_duplicate(), Button_Layer_menu(), Button_Layer_merge(), Button_Layer_remove(), Button_Layer_set_transparent(), Button_Layer_up(), Button_Page(), Button_Palette(), Button_Reload(), Button_Resolution(), Button_Transform_menu(), Centered_lines_12_7(), Curve_4_points_2_9(), Curve_finalize(), Empty_circle_0_5(), Empty_ellipse_0_5(), Empty_rectangle_0_5(), Fill_1_0(), Fill_2_0(), Fill_general(), Filled_circle_0_5(), Filled_contour_0_8(), Filled_ellipse_0_5(), Filled_polyform_12_8(), Filled_rectangle_0_5(), Free_current_page(), Freehand_mode12_0_2(), Freehand_mode3_0_1(), Get_colors_from_brush(), Grad_circle_0_6(), Grad_circle_12_8(), Grad_ellipse_0_6(), Grad_ellipse_12_8(), Grad_rectangle_0_9(), Init_all_backup_lists(), Init_program(), K_line_12_7(), Line_0_5(), Load_picture(), Main_handler(), Polybrush_12_8(), Polyfill_12_9(), Polyform_12_8(), Polygon_12_9(), Redo(), Replace_1_0(), Replace_2_0(), Scroll_0_5(), and Undo().

◆ Update_depth_buffer()

◆ Redraw_layered_image()

◆ Redraw_current_layer()

◆ Update_screen_targets()

◆ Update_buffers()

◆ Update_spare_buffers()

int Update_spare_buffers ( int  width,
int  height 
)

◆ Redraw_spare_image()

◆ Update_FX_feedback()

◆ Switch_layer_mode()

Variable Documentation

◆ FX_feedback_screen

byte* FX_feedback_screen
extern

Pointer to the image to read, while drawing.

It's either the last history layer page when FX feedback is on, or the history page before it when FX feedback is off.

Referenced by Read_pixel_from_feedback_screen(), and Update_FX_feedback().

◆ Main_visible_image_backup

T_Bitmap Main_visible_image_backup
extern

The pixels of visible layers, flattened copy, used for no-feedback effects.

The pixels of visible layers, flattened copy, used for no-feedback effects.

Referenced by Backup_with_new_dimensions(), End_of_modification(), Init_all_backup_lists(), Program_shutdown(), Scroll_12_0(), Update_buffers(), and Update_screen_targets().

◆ Main_visible_image_depth_buffer

◆ LAYER_NONE

◆ LAYER_ALL

◆ Stats_pages_number

long Stats_pages_number
extern

STATISTICS.

Total number of unique bitmaps (layers, animation frames, backups)

STATISTICS.

Referenced by Button_Stats(), Free_layer(), and New_layer().

◆ Stats_pages_memory

long long Stats_pages_memory
extern

Total memory used by bitmaps (layers, animation frames, backups)

Referenced by Button_Stats(), Free_layer(), and New_layer().