StyleProvider.hpp

1. Overview

The StyleProvider.hpp file loads and applies the CSS styling used by the graphical recovery interface.

This is an interface and data-contract file. It declares the public and internal types used by this subsystem, allowing implementation files and callers to share a stable compile-time contract.

Its paired source or interface file is StyleProvider.cpp.

Primary responsibilities:

  • Create or retain a Gtk CSS provider
  • Load application styling from resources or text
  • Attach style rules to the active display

2. File Identity and Scope

  • Source path: src/StyleProvider.hpp
  • Language: C++
  • File role: interface and data-contract file
  • Physical lines: 22
  • Non-empty lines: 20
  • SHA-256: 46adf7bb0dc96689ca9b19233eb5507993f4059c3357db3e618b12255891fcb4

The declarations in this file use the global namespace.


3. Dependencies

3.2 Standard and External Headers

  • gtkmm/cssprovider.h

These dependencies define the file’s compile-time integration with the recovery engine, GTK interface, on-disk format decoders, operating-system services, or C++ standard library.


4. Declared Types

No class, structure, or enumeration definition is declared directly in this file.


5. Constants and Configuration Values

No preprocessor or compile-time constants were detected as top-level declarations in this file.


6. Data Members and Persistent State

No class data members are declared directly in this file, or the file primarily implements methods declared elsewhere.


7. API and Function Inventory

The following callable interfaces or definitions were detected:

  • void load_style() – Reads or derives the requested information and returns or stores the decoded result.

8. Operational Flow

The subsystem represented by this file normally participates in the following flow:

  1. Create or retain a Gtk CSS provider.
  2. Load application styling from resources or text.
  3. Attach style rules to the active display.
  4. Expose or execute the detected APIs: load_style.
  5. Return explicit results, progress data, recovered records, or diagnostics to the calling layer.

9. Validation and Error Handling

  • Callers must inspect return values and avoid treating partial output as a complete recovery result.

10. Runtime, Concurrency, and Resource Management

  • GTK lifecycle: widget ownership, signal connections and main-thread affinity must be preserved.
  • GTK objects and callbacks must obey main-thread affinity and signal lifetime rules.

11. Security and Data-Recovery Considerations

  • Recovery code should prefer read-only source access and avoid writing to the original damaged medium.
  • Raw devices and image files are treated as untrusted binary input; every offset and length must remain bounded by the source size.

12. Implementation Considerations

  • Changes to public declarations can affect every translation unit that includes this header and should preserve binary and source compatibility where required.

13. Integration with the Recovery Pipeline

  • The file belongs to the application startup or presentation layer.
  • It receives or presents data produced by scan and recovery services.
  • Long-running operations should remain delegated to worker classes rather than blocking the GTK main loop.

14. Licensing and Provenance

The source header contains the following licensing or copyright statements:

  • Copyright (C) 2025–2026 Calogero Scarnà
  • SPDX-License-Identifier: GPL-3.0-or-later
  • it under the terms of the GNU General Public License as published by
  • GNU General Public License for more details.

The SHA-256 value in this document can be used to associate the generated documentation with the exact source version analyzed.