2014-10-19 20:20:16 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Rafael Sokolowski <Rafael.Sokolowski@web.de>
|
2017-08-18 06:06:45 +00:00
|
|
|
* Copyright (C) 2014-2017 KiCad Developers, see CHANGELOG.TXT for contributors.
|
2014-10-19 20:20:16 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
#ifndef ABOUTAPPINFO_H
|
|
|
|
#define ABOUTAPPINFO_H
|
|
|
|
|
|
|
|
#include <wx/aboutdlg.h>
|
|
|
|
#include <wx/bitmap.h>
|
|
|
|
#include <wx/dynarray.h>
|
|
|
|
|
2018-01-31 09:03:33 +00:00
|
|
|
#include "bitmap_types.h"
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
class CONTRIBUTOR;
|
2013-05-26 04:36:44 +00:00
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
WX_DECLARE_OBJARRAY( CONTRIBUTOR, CONTRIBUTORS );
|
2013-05-26 04:36:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* An object of this class is meant to be used to store application specific information
|
|
|
|
* like who has contributed in which area of the application, the license, copyright
|
|
|
|
* and other descriptive information.
|
|
|
|
*/
|
2017-08-18 06:06:45 +00:00
|
|
|
class ABOUT_APP_INFO
|
2013-05-26 04:36:44 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-08-18 06:06:45 +00:00
|
|
|
ABOUT_APP_INFO() {};
|
|
|
|
virtual ~ABOUT_APP_INFO() {};
|
2013-05-26 04:36:44 +00:00
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
void AddDeveloper( const CONTRIBUTOR* developer )
|
2015-11-19 20:03:02 +00:00
|
|
|
{
|
|
|
|
if( developer != NULL )
|
|
|
|
developers.Add( developer );
|
|
|
|
}
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
void AddDocWriter( const CONTRIBUTOR* docwriter )
|
2015-11-19 20:03:02 +00:00
|
|
|
{
|
|
|
|
if( docwriter != NULL )
|
|
|
|
docwriters.Add( docwriter );
|
|
|
|
}
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
void AddArtist( const CONTRIBUTOR* artist )
|
2015-11-19 20:03:02 +00:00
|
|
|
{
|
|
|
|
if( artist != NULL )
|
|
|
|
artists.Add( artist );
|
|
|
|
}
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
void AddTranslator( const CONTRIBUTOR* translator )
|
2015-11-19 20:03:02 +00:00
|
|
|
{
|
|
|
|
if( translator != NULL )
|
|
|
|
translators.Add( translator );
|
|
|
|
}
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
void AddPackager( const CONTRIBUTOR* packager )
|
2015-11-19 20:03:02 +00:00
|
|
|
{
|
|
|
|
if( packager != NULL )
|
|
|
|
packagers.Add( packager );
|
|
|
|
}
|
2013-05-26 04:36:44 +00:00
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
CONTRIBUTORS GetDevelopers() { return developers; }
|
|
|
|
CONTRIBUTORS GetDocWriters() { return docwriters; }
|
|
|
|
CONTRIBUTORS GetArtists() { return artists; }
|
|
|
|
CONTRIBUTORS GetTranslators() { return translators; }
|
|
|
|
CONTRIBUTORS GetPackagers() { return packagers; }
|
2013-05-26 04:36:44 +00:00
|
|
|
|
|
|
|
void SetDescription( const wxString& text ) { description = text; }
|
|
|
|
wxString& GetDescription() { return description; }
|
|
|
|
|
|
|
|
void SetLicense( const wxString& text ) { license = text; }
|
|
|
|
wxString& GetLicense() { return license; }
|
|
|
|
|
|
|
|
void SetCopyright( const wxString& text ) { copyright = text; }
|
2017-08-18 06:06:45 +00:00
|
|
|
wxString GetCopyright() { return copyright; }
|
2013-05-26 04:36:44 +00:00
|
|
|
|
|
|
|
void SetAppName( const wxString& name ) { appName = name; }
|
|
|
|
wxString& GetAppName() { return appName; }
|
|
|
|
|
|
|
|
void SetBuildVersion( const wxString& version ) { buildVersion = version; }
|
|
|
|
wxString& GetBuildVersion() { return buildVersion; }
|
|
|
|
|
|
|
|
void SetLibVersion( const wxString& version ) { libVersion = version; }
|
|
|
|
wxString& GetLibVersion() { return libVersion; }
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
void SetAppIcon( const wxIcon& aIcon ) { m_appIcon = aIcon; }
|
|
|
|
wxIcon& GetAppIcon() { return m_appIcon; }
|
2013-05-26 04:36:44 +00:00
|
|
|
|
2018-01-31 09:03:33 +00:00
|
|
|
///> Wrapper to manage memory allocation for bitmaps
|
|
|
|
wxBitmap* CreateKiBitmap( BITMAP_DEF aBitmap )
|
|
|
|
{
|
|
|
|
m_bitmaps.emplace_back( KiBitmapNew( aBitmap ) );
|
|
|
|
return m_bitmaps.back().get();
|
|
|
|
}
|
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
private:
|
2017-08-18 06:06:45 +00:00
|
|
|
CONTRIBUTORS developers;
|
|
|
|
CONTRIBUTORS docwriters;
|
|
|
|
CONTRIBUTORS artists;
|
|
|
|
CONTRIBUTORS translators;
|
|
|
|
CONTRIBUTORS packagers;
|
2013-05-26 04:36:44 +00:00
|
|
|
|
|
|
|
wxString description;
|
|
|
|
wxString license;
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
wxString copyright;
|
2013-05-26 04:36:44 +00:00
|
|
|
wxString appName;
|
|
|
|
wxString buildVersion;
|
|
|
|
wxString libVersion;
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
wxIcon m_appIcon;
|
2018-01-31 09:03:33 +00:00
|
|
|
|
|
|
|
///> Bitmaps to be freed when the dialog is closed
|
|
|
|
std::vector<std::unique_ptr<wxBitmap>> m_bitmaps;
|
2013-05-26 04:36:44 +00:00
|
|
|
};
|
|
|
|
|
2015-11-19 20:03:02 +00:00
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
/**
|
|
|
|
* A contributor, a person which was involved in the development of the application
|
|
|
|
* or which has contributed in any kind somehow to the project.
|
|
|
|
*
|
|
|
|
* A contributor consists of the following mandatory information:
|
|
|
|
* - Name
|
|
|
|
*
|
|
|
|
* Each contributor can have optional information assigned like:
|
2017-11-29 23:05:35 +00:00
|
|
|
* - EMail address
|
2013-05-26 04:36:44 +00:00
|
|
|
* - A category
|
|
|
|
* - A category specific icon
|
|
|
|
*/
|
2017-08-18 06:06:45 +00:00
|
|
|
class CONTRIBUTOR
|
2013-05-26 04:36:44 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-08-18 06:06:45 +00:00
|
|
|
CONTRIBUTOR( const wxString& aName,
|
2017-11-29 23:05:35 +00:00
|
|
|
const wxString& aEmail = wxEmptyString,
|
2017-12-11 13:56:32 +00:00
|
|
|
const wxString& aUrl = wxEmptyString,
|
2017-08-18 06:06:45 +00:00
|
|
|
const wxString& aCategory = wxEmptyString,
|
|
|
|
wxBitmap* aIcon = NULL )
|
|
|
|
{
|
|
|
|
m_checked = false;
|
|
|
|
m_name = aName;
|
2017-12-11 13:56:32 +00:00
|
|
|
m_url = aUrl,
|
2017-08-18 06:06:45 +00:00
|
|
|
m_email = aEmail;
|
|
|
|
m_category = aCategory;
|
|
|
|
m_icon = aIcon;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~CONTRIBUTOR() {}
|
2013-05-26 04:36:44 +00:00
|
|
|
|
|
|
|
wxString& GetName() { return m_name; }
|
|
|
|
wxString& GetEMail() { return m_email; }
|
2017-12-11 13:56:32 +00:00
|
|
|
wxString& GetUrl() { return m_url; }
|
2013-05-26 04:36:44 +00:00
|
|
|
wxString& GetCategory() { return m_category; }
|
|
|
|
wxBitmap* GetIcon() { return m_icon; }
|
|
|
|
void SetChecked( bool status ) { m_checked = status; }
|
|
|
|
bool IsChecked() { return m_checked; }
|
2015-11-19 20:03:02 +00:00
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
private:
|
|
|
|
wxString m_name;
|
|
|
|
wxString m_email;
|
2017-12-11 13:56:32 +00:00
|
|
|
wxString m_url;
|
2013-05-26 04:36:44 +00:00
|
|
|
wxString m_category;
|
|
|
|
wxBitmap* m_icon;
|
|
|
|
bool m_checked;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ABOUTAPPINFO_H
|