features #2

Merged
dikkadev merged 5 commits from paste-and-undo-redo into main 2025-06-01 17:34:43 +00:00
dikkadev commented 2025-06-01 17:34:35 +00:00 (Migrated from github.com)

This pull request introduces two major features: an undo/redo system for managing application state and Windows API integrations for clipboard and window positioning functionality. These changes enhance the application's usability by providing state management and platform-specific utilities.

Undo/Redo System (src/undo_redo.zig):

  • Added StateSnapshot struct for managing application state snapshots, including methods for initialization, setting data, and checking emptiness.
  • Implemented a generic UndoStack with configurable capacity, supporting operations like push, pop, and clear.
  • Created UndoRedoSystem struct to manage undo and redo stacks, with methods for pushing snapshots, performing undo/redo operations, and clearing history.
  • Added a convenience function createSnapshot to simplify the creation of state snapshots.

Windows API Integrations (src/windows_api.zig):

  • Declared Windows clipboard API functions and constants, and implemented helper functions getClipboardText and copyToClipboard for interacting with the clipboard.
  • Introduced Windows window positioning API declarations and helper functions, including calculateDesiredWindowPosition to determine the best position for a window and positionWindow to move a window to a specified position.
This pull request introduces two major features: an undo/redo system for managing application state and Windows API integrations for clipboard and window positioning functionality. These changes enhance the application's usability by providing state management and platform-specific utilities. ### Undo/Redo System (`src/undo_redo.zig`): * Added `StateSnapshot` struct for managing application state snapshots, including methods for initialization, setting data, and checking emptiness. * Implemented a generic `UndoStack` with configurable capacity, supporting operations like `push`, `pop`, and `clear`. * Created `UndoRedoSystem` struct to manage undo and redo stacks, with methods for pushing snapshots, performing undo/redo operations, and clearing history. * Added a convenience function `createSnapshot` to simplify the creation of state snapshots. ### Windows API Integrations (`src/windows_api.zig`): * Declared Windows clipboard API functions and constants, and implemented helper functions `getClipboardText` and `copyToClipboard` for interacting with the clipboard. * Introduced Windows window positioning API declarations and helper functions, including `calculateDesiredWindowPosition` to determine the best position for a window and `positionWindow` to move a window to a specified position.
Sign in to join this conversation.
No description provided.