OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
LifecycleEvents.hpp File Reference
#include <functional>
#include <condition_variable>
#include <cstddef>
#include <mutex>
#include <string>
#include <utility>
Include dependency graph for LifecycleEvents.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Slic3r::LifecycleEventContext
struct  Slic3r::detail::LifecycleHookState
class  Slic3r::detail::LifecycleDispatchGuard

Namespaces

namespace  Slic3r
 |/ Copyright (c) Prusa Research 2020 - 2023 Enrico Turri @enricoturri1966 |/ |/ PrusaSlicer is released under the terms of the AGPLv3 or higher |/
namespace  Slic3r::detail

Typedefs

using Slic3r::LifecycleHookFn = std::function<void(LifecycleEvent, const LifecycleEventContext&)>

Enumerations

enum class  Slic3r::LifecycleEvent {
  Slic3r::NewProject , Slic3r::ProjectOpened , Slic3r::ProjectBeforeSave , Slic3r::ProjectAfterSave ,
  Slic3r::ProjectClosed , Slic3r::ProjectDirtyChanged , Slic3r::SliceStarted , Slic3r::SliceGeometryFinished ,
  Slic3r::GCodeExportStarted , Slic3r::GCodeExportFinished , Slic3r::SlicingJobComplete , Slic3r::ObjectAdded ,
  Slic3r::ObjectDeleted , Slic3r::ObjectTransformed , Slic3r::ObjectChanged , Slic3r::ObjectRenamed ,
  Slic3r::PlateCreated , Slic3r::PlateDeleted , Slic3r::PlateSelected , Slic3r::PlateRenamed ,
  Slic3r::PresetSelected , Slic3r::PresetSaved , Slic3r::PrintStateChanged , Slic3r::DeviceOnline ,
  Slic3r::DeviceOffline , Slic3r::DeviceDiscovered , Slic3r::DeviceSelected , Slic3r::UploadStarted ,
  Slic3r::UploadFinished , Slic3r::PrintJobStarted , Slic3r::PrintJobFinished , Slic3r::SendJobStarted ,
  Slic3r::SendJobFinished
}
enum class  Slic3r::LifecycleEvtCode { Slic3r::Ok , Slic3r::Error , Slic3r::Warn }

Functions

std::string Slic3r::lifecycle_event_to_string (LifecycleEvent event)
std::string Slic3r::lifecycle_evt_code_to_string (LifecycleEvtCode code)
LifecycleHookState & Slic3r::detail::lifecycle_hook_state ()
void Slic3r::set_lifecycle_hook_fn (LifecycleHookFn fn)
void Slic3r::fire_lifecycle_event (LifecycleEvent event, const LifecycleEventContext &ctx)

Class Documentation

◆ Slic3r::LifecycleEventContext

struct Slic3r::LifecycleEventContext
Collaboration diagram for Slic3r::LifecycleEventContext:
Class Members
function< bool()> cancellation_check
LifecycleEvtCode code = LifecycleEvtCode::Ok
string device_id
bool dirty = false
string id
int index = -1
string job_id
string msg
string name
string previous_name
string source

◆ Slic3r::detail::LifecycleHookState

struct Slic3r::detail::LifecycleHookState
Collaboration diagram for Slic3r::detail::LifecycleHookState:
Class Members
bool accepting = false
size_t active_dispatches = 0
condition_variable cv
LifecycleHookFn fn
mutex mutex