Ejemplo n.º 1
0
ObjectMetadata::ObjectMetadata(const std::string & extensionNamespace_,
                   const std::string & name_,
                   const std::string & fullname_,
                   const std::string & informations_,
                   const std::string & icon24x24,
                   CreateFunPtr createFunPtrP,
                   DestroyFunPtr destroyFunPtrP) :
    extensionNamespace(extensionNamespace_)
{
    name = name_;
#if defined(GD_IDE_ONLY)
    SetFullName(std::string(fullname_));
    SetDescription(std::string(informations_));
#if !defined(GD_NO_WX_GUI)
    if ( gd::SkinHelper::IconExists(icon24x24, 24) )
        SetBitmapIcon(gd::SkinHelper::GetIcon(icon24x24, 24));
    else if ( wxFile::Exists(icon24x24) )
        SetBitmapIcon(wxBitmap(icon24x24, wxBITMAP_TYPE_ANY));
    else {
        std::cout << "Warning: The icon file for object \"" << name_
            << " was not found in the current skin icons"
            << " and the specified name is not an existing filename.";
        SetBitmapIcon(wxBitmap(24,24));
    }
#endif
#endif
    createFunPtr = createFunPtrP;
    destroyFunPtr = destroyFunPtrP;
}
Ejemplo n.º 2
0
BehaviorMetadata::BehaviorMetadata(const gd::String & extensionNamespace_,
                       const gd::String & name_,
                       const gd::String & fullname_,
                       const gd::String & defaultName_,
                       const gd::String & description_,
                       const gd::String & group_,
                       const gd::String & icon24x24,
                       const gd::String & className_,
                       std::shared_ptr<gd::Behavior> instance_,
                       std::shared_ptr<gd::BehaviorsSharedData> sharedDatasInstance_) :
    extensionNamespace(extensionNamespace_),
    instance(instance_),
    sharedDatasInstance(sharedDatasInstance_)
{
#if defined(GD_IDE_ONLY)
    SetFullName(gd::String(fullname_));
    SetDescription(gd::String(description_));
    SetDefaultName(gd::String(defaultName_));
    SetGroup(group_);
    className = className_;
    iconFilename = icon24x24;
#if !defined(GD_NO_WX_GUI)
    if ( gd::SkinHelper::IconExists(iconFilename, 24) )
        SetBitmapIcon(gd::SkinHelper::GetIcon(iconFilename, 24));
    else if ( wxFile::Exists(iconFilename) )
        SetBitmapIcon(wxBitmap(iconFilename, wxBITMAP_TYPE_ANY));
    else {
        std::cout << "Warning: The icon file for behavior \"" << name_
            << " was not found in the current skin icons"
            << " and the specified name is not an existing filename.";
        SetBitmapIcon(wxBitmap(24,24));
    }
#endif
#endif

    if ( instance ) instance->SetTypeName(name_);
    if ( sharedDatasInstance ) sharedDatasInstance->SetTypeName(name_);
}