Fray Engine
Loading...
Searching...
No Matches
fray Namespace Reference

Namespaces

namespace  state
namespace  style
namespace  console
namespace  log
namespace  errors
namespace  files
namespace  watch
namespace  ipc
namespace  message
namespace  history
namespace  logs
namespace  routing
namespace  process
namespace  fonts
namespace  threads
namespace  identity

Classes

class  FrayManager
 Owns and coordinates projects, their queues, application work, prompts, and logs. Project work runs on separate project threads; drive manager operations from one controlling thread. More...
struct  DatabaseChoice
 Chooses an existing candidate database or a new database when opening is ambiguous. More...
class  ProjectManager
 Owns a project’s files, state stores, watcher and registered threads. Public operations synchronize their own mutable state unless they return a reference or expose queue-owned pendingStep. Opening, closing and file-change handling are intended for the project’s own thread; callers must keep borrowed references valid and coordinate their use. More...
struct  ProjectMessageResult
 Project message status and optional response frame. More...

Functions

message::FrameOptions projectPreferencesFrame (const std::string &id, const std::string &name, bool packageOnClose, const std::string &error)
 Builds a project preference snapshot or operation error.
void sendApplicationPreferences (FrayManager &application, ipc::IPCManager &ipc, F_ulong renderer, const std::string &error="")
 Sends the current application preferences and an optional operation error.
void sendProjectOpenResult (ipc::IPCManager &ipc, const FrayManager::OpeningOrigin &origin, const std::string &path, F_err result)
 Sends the result of a project-open or create request.
message::FrameOptions projectRenamedFrame (const std::string &id, const std::string &path, const std::string &name)
 Builds a project-renamed notification for the renderer.
message::FrameOptions projectCloseResult (const message::InData &incoming, const std::string &name, F_err result, bool packaged, const std::string &path="", const std::string &id="")
 Builds a close result addressed to the request sender.
ProjectMessageResult stepHistory (ProjectManager &project, const ProjectManager::PendingStep &step)
 Resolves an undo or redo, updating history heads or requesting a missing layout revision. Run on the project queue; the renderer-provided revision first selects the layout head.

Variables

constexpr const char * layoutDomain = "layout:default"
 History domain used for the default renderer layout.
constexpr std::size_t maxLayoutBytes = 1024 * 1024
 Maximum accepted size in bytes of a serialized layout.

Detailed Description

A frame is three separate sections: [routing prefix: fixed binary] [Header: protobuf] [payload: opaque bytes] Routers inspect the header when routing a multicast; direct destinations are identified by the prefix.

Function Documentation

◆ projectCloseResult()

message::FrameOptions fray::projectCloseResult ( const message::InData & incoming,
const std::string & name,
F_err result,
bool packaged,
const std::string & path = "",
const std::string & id = "" )
inline

Builds a close result addressed to the request sender.

Parameters
incomingOriginal request, supplying sender and message ID.
nameProject name or requested target.
resultClose status; non-NONE values produce an error message.
packagedWhether an archive was produced.
pathResulting archive or working path, if known.
idStable id of the project that was closed, if known.
Returns
Serialized close-result frame options.

Definition at line 95 of file project_message_handler.hpp.

◆ projectPreferencesFrame()

message::FrameOptions fray::projectPreferencesFrame ( const std::string & id,
const std::string & name,
bool packageOnClose,
const std::string & error = "" )
inline

Builds a project preference snapshot or operation error.

Builds a project preferences snapshot or operation error.

Parameters
idStable project identity.
nameCurrent project name, or empty for an error-only update.
packageOnCloseCurrent packaging preference.
errorError to show, or empty on success.
Returns
Serialized frame for the main renderer.

Definition at line 28 of file project_message_handler.hpp.

◆ projectRenamedFrame()

message::FrameOptions fray::projectRenamedFrame ( const std::string & id,
const std::string & path,
const std::string & name )
inline

Builds a project-renamed notification for the renderer.

Parameters
idStable project ID.
pathNew project path key.
nameNew project name.
Returns
Serialized notification frame options.

Definition at line 69 of file project_message_handler.hpp.

◆ sendApplicationPreferences()

void fray::sendApplicationPreferences ( FrayManager & application,
ipc::IPCManager & ipc,
F_ulong renderer,
const std::string & error = "" )
inline

Sends the current application preferences and an optional operation error.

Parameters
applicationEngine-owned application manager.
ipcIPC manager used for delivery.
rendererDestination renderer instance.
errorOperation error to display, or empty on success.

Definition at line 30 of file fray_message_handler.hpp.

◆ sendProjectOpenResult()

void fray::sendProjectOpenResult ( ipc::IPCManager & ipc,
const FrayManager::OpeningOrigin & origin,
const std::string & path,
F_err result )
inline

Sends the result of a project-open or create request.

Parameters
ipcIPC manager used for the result.
originRequest sender and message identity.
pathRequested project path.
resultProject-open result.

Definition at line 56 of file fray_message_handler.hpp.

◆ stepHistory()

ProjectMessageResult fray::stepHistory ( ProjectManager & project,
const ProjectManager::PendingStep & step )
inline

Resolves an undo or redo, updating history heads or requesting a missing layout revision. Run on the project queue; the renderer-provided revision first selects the layout head.

Parameters
projectOpen project whose history and pending step may change.
stepDirection, optional domain, and source layout revision.
Returns
NONE with a history request or restoration frame, or FAILED_HISTORY or a move-head error without a response.

Definition at line 130 of file project_message_handler.hpp.

Variable Documentation

◆ layoutDomain

const char* fray::layoutDomain = "layout:default"
inlineconstexpr

History domain used for the default renderer layout.

Definition at line 14 of file project_message_handler.hpp.

◆ maxLayoutBytes

std::size_t fray::maxLayoutBytes = 1024 * 1024
inlineconstexpr

Maximum accepted size in bytes of a serialized layout.

Definition at line 18 of file project_message_handler.hpp.