Kage Studio 0.7.240121
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
KageDocument Class Reference

#include <document.h>

Inheritance diagram for KageDocument:
Collaboration diagram for KageDocument:

Data Structures

struct  Asset
 

Public Types

enum  AssetType { ASSET_IMAGE , ASSET_VIDEO , ASSET_KAGE }
 

Public Member Functions

 KageDocument ()
 
 KageDocument (KageDocument &p_document)
 
KageDocument operator= (const KageDocument &p_document)
 
void init ()
 
virtual ~KageDocument ()
 
unsigned int openScene (std::string p_filepath)
 
bool saveScene (unsigned int p_sceneID)
 Kage Document will contain several scenes. This will allow saving one Scene to be saved each time.
 
bool openProject ()
 
bool saveProject ()
 
bool isSaved ()
 
unsigned int addScene (std::string p_sceneLabel, bool p_asset=false)
 Used by Kage when creating new Scene, or opening KSF file (even if via KAGE file)
 
bool removeAllScenes ()
 
bool removeSceneAt (unsigned int p_sceneIndex)
 Used by KageDocument; This will gracefully remove all Layers of this Scene along with its Frames.
 
KageScenegetScene ()
 
unsigned int getCurrentScene ()
 returns activeSceneIndex+1; to get the actual (pointer to) Scene object, use getScene instead
 
void setCurrentScene (unsigned int p_newScene)
 returns index+1
 
void setCurrentSceneByID (unsigned int p_newSceneID)
 
unsigned int getActiveSceneID ()
 
unsigned int getActiveLayerID ()
 
unsigned int getActiveFrameID ()
 
unsigned int frameCount ()
 
void setSceneLayerCurrentFrame (unsigned int p_frame)
 
std::string getLayerLabel ()
 
void setLayerLabel (std::string p_label)
 
void toggleLayerVisibility ()
 
bool isLayerVisible ()
 
void setLayerVisible (bool p_visible)
 
void toggleLayerLock ()
 
bool isLayerLocked ()
 
void setLayerLocked (bool p_lock)
 
bool moveSceneUp ()
 
bool moveSceneDown ()
 
bool moveSceneToTop ()
 
bool moveSceneToBottom ()
 
bool gotoNextScene ()
 For use by Kage when Play is triggered.
 

Data Fields

bool _saved
 
unsigned int _activeSceneID
 
unsigned int _activeSceneIndex
 
unsigned int sceneCtr
 
unsigned int _activeScene
 will be used to create Unique sceneCtr IDs
 
std::vector< AssetAssets
 
std::vector< KageScene * > Scenes
 
KageScene_scenePtr
 

Static Public Attributes

static GdkPoint _mouseLocation
 
static bool _displayObjectIsShape
 
static bool ASSET_MODE = false
 

Member Enumeration Documentation

◆ AssetType

Enumerator
ASSET_IMAGE 
ASSET_VIDEO 
ASSET_KAGE 

Constructor & Destructor Documentation

◆ KageDocument() [1/2]

KageDocument::KageDocument ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ KageDocument() [2/2]

KageDocument::KageDocument ( KageDocument & p_document)
Here is the call graph for this function:

◆ ~KageDocument()

KageDocument::~KageDocument ( )
virtual

Member Function Documentation

◆ addScene()

unsigned int KageDocument::addScene ( std::string p_sceneLabel,
bool p_asset = false )

Used by Kage when creating new Scene, or opening KSF file (even if via KAGE file)

Returns
Scene ID of newly created Scene
Here is the call graph for this function:
Here is the caller graph for this function:

◆ frameCount()

unsigned int KageDocument::frameCount ( )
Here is the call graph for this function:

◆ getActiveFrameID()

unsigned int KageDocument::getActiveFrameID ( )
Here is the call graph for this function:

◆ getActiveLayerID()

unsigned int KageDocument::getActiveLayerID ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getActiveSceneID()

unsigned int KageDocument::getActiveSceneID ( )

◆ getCurrentScene()

unsigned int KageDocument::getCurrentScene ( )

returns activeSceneIndex+1; to get the actual (pointer to) Scene object, use getScene instead

Returns
unsigned int activeSceneIndex+1
See also
setActiveScene
Here is the caller graph for this function:

◆ getLayerLabel()

std::string KageDocument::getLayerLabel ( )
Here is the call graph for this function:

◆ getScene()

KageScene * KageDocument::getScene ( )
Here is the caller graph for this function:

◆ gotoNextScene()

bool KageDocument::gotoNextScene ( )

For use by Kage when Play is triggered.

Returns
true
false
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void KageDocument::init ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isLayerLocked()

bool KageDocument::isLayerLocked ( )
Here is the call graph for this function:

◆ isLayerVisible()

bool KageDocument::isLayerVisible ( )
Here is the call graph for this function:

◆ isSaved()

bool KageDocument::isSaved ( )

◆ moveSceneDown()

bool KageDocument::moveSceneDown ( )

NOTE: Scenes are organized as index 0 as BOTTOM and last index is TOP

See also
moveToBottom() moveToTop() moveUp()
Returns
True if successfully moved to bottom
Here is the caller graph for this function:

◆ moveSceneToBottom()

bool KageDocument::moveSceneToBottom ( )

NOTE: Scenes are organized as index 0 as BOTTOM and last index is TOP

See also
moveSceneDown() moveSceneToTop() moveSceneUp()
Returns
True if successfully moved to bottom
Here is the call graph for this function:

◆ moveSceneToTop()

bool KageDocument::moveSceneToTop ( )

NOTE: Scenes are organized as index 0 as BOTTOM and last index is TOP

See also
moveSceneDown() moveSceneToBottom() moveSceneUp()
Returns
True if successfully moved to bottom
Here is the call graph for this function:

◆ moveSceneUp()

bool KageDocument::moveSceneUp ( )

NOTE: Scenes are organized as index 0 as BOTTOM and last index is TOP

See also
moveSceneDown() moveSceneToBottom() moveSceneToTop()
Returns
True if successfully moved to bottom
Here is the caller graph for this function:

◆ openProject()

bool KageDocument::openProject ( )

◆ openScene()

unsigned int KageDocument::openScene ( std::string p_filepath)

◆ operator=()

KageDocument KageDocument::operator= ( const KageDocument & p_document)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeAllScenes()

bool KageDocument::removeAllScenes ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeSceneAt()

bool KageDocument::removeSceneAt ( unsigned int p_sceneIndex)

Used by KageDocument; This will gracefully remove all Layers of this Scene along with its Frames.

Parameters
p_sceneIndex
Returns
true
false
See also
KageDocument::removeAllScenes
Here is the caller graph for this function:

◆ saveProject()

bool KageDocument::saveProject ( )

◆ saveScene()

bool KageDocument::saveScene ( unsigned int p_sceneID)

Kage Document will contain several scenes. This will allow saving one Scene to be saved each time.

Parameters
p_sceneIDwhich Scene do we want to save?
Returns
true
false

◆ setCurrentScene()

void KageDocument::setCurrentScene ( unsigned int p_newScene)

returns index+1

Used by KageSceneUI.

Parameters
p_newScenep_newScene-1 is index
Here is the caller graph for this function:

◆ setCurrentSceneByID()

void KageDocument::setCurrentSceneByID ( unsigned int p_newSceneID)

◆ setLayerLabel()

void KageDocument::setLayerLabel ( std::string p_label)
Here is the call graph for this function:

◆ setLayerLocked()

void KageDocument::setLayerLocked ( bool p_lock)
Here is the call graph for this function:

◆ setLayerVisible()

void KageDocument::setLayerVisible ( bool p_visible)
Here is the call graph for this function:

◆ setSceneLayerCurrentFrame()

void KageDocument::setSceneLayerCurrentFrame ( unsigned int p_frame)
Here is the call graph for this function:

◆ toggleLayerLock()

void KageDocument::toggleLayerLock ( )
Here is the call graph for this function:

◆ toggleLayerVisibility()

void KageDocument::toggleLayerVisibility ( )
Here is the call graph for this function:

Field Documentation

◆ _activeScene

unsigned int KageDocument::_activeScene

will be used to create Unique sceneCtr IDs

◆ _activeSceneID

unsigned int KageDocument::_activeSceneID

◆ _activeSceneIndex

unsigned int KageDocument::_activeSceneIndex

◆ _displayObjectIsShape

bool KageDocument::_displayObjectIsShape
static

◆ _mouseLocation

GdkPoint KageDocument::_mouseLocation
static

◆ _saved

bool KageDocument::_saved

◆ _scenePtr

KageScene* KageDocument::_scenePtr

◆ ASSET_MODE

bool KageDocument::ASSET_MODE = false
static

◆ Assets

std::vector<Asset> KageDocument::Assets

◆ sceneCtr

unsigned int KageDocument::sceneCtr

◆ Scenes

std::vector<KageScene*> KageDocument::Scenes

The documentation for this class was generated from the following files: