MT Showcase SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Showcase::Package Class Reference

Showcase package will contain one or more components. More...

#include <Package.hpp>

Public Member Functions

void preparePackage ()
 This should be called when the package is selected for loading In case there are multiple versions of the same package, only the selected version should call this Currently just adds search paths.
 
void load ()
 
bool canBeUsed () const
 Checks that version matches and everything is available. More...
 

Detailed Description

Showcase package will contain one or more components.

Components are compiled into one or multiple dynamic libraries that are loaded by Showcase runtime. In addition components can also have data and CSS-files.

Each package file consists of single JSON-object. Below is an example of package file. Fields are exmplained below the example.

{ "name" : "awesome-background", "libraries" : [ "awesome-bg-SHOWCASE_VERSION" ], "required-showcase-version" : "SHOWCASE_VERSION", "version" : "0.9.6", "components" : { "awesome-bg" : { "type" : "ui", "data-folders" : [ "data" ], "css-files" : [ "awesome-bg.css" ], "schema" : "awesome-bg.schema" } } }

Fields of package definition:

  • name - Name of the package. This acts as an identifier for the package. Only single package with each name can be loaded to runtime same time.
  • libraries - Dynamic libraries that contains the packaged components. String "SHOWCASE_VERSION" is replaced during runtime with the current version of showcase core. Version does not have any meaning here.
  • required-showcase-version - Version of Showcase that is required for this package. Again "SHOWCASE_VERSION" is replaced during runtime. Package is accepted if patch version of Showcase core is greater or equal to this version and major and minor versions are same.
  • version - Internal version number of the package. Only used in the case if there are multiple compatible packages with the same name.
  • components - List of components contained within single package. Each component can list data folders and CSS-files. Data folders are added to Qt's search-path, and CSS-files are automatically loaded. In the example above contents of this particular data-folders can be referred using "awesome-bg:"-prefix. CSS-file is expected to be located in some of the defined data-folders.

Member Function Documentation

bool Showcase::Package::canBeUsed ( ) const

Checks that version matches and everything is available.

void Showcase::Package::load ( )