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>
|
2021-01-25 12:42:36 +00:00
|
|
|
* Copyright (C) 2014-2021 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>
|
|
|
|
|
2021-03-08 02:59:07 +00:00
|
|
|
#include <bitmaps/bitmap_types.h>
|
2018-01-31 09:03:33 +00:00
|
|
|
|
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 )
|
2020-10-08 23:47:06 +00:00
|
|
|
mDevelopers.Add( developer );
|
2015-11-19 20:03:02 +00:00
|
|
|
}
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
void AddDocWriter( const CONTRIBUTOR* docwriter )
|
2015-11-19 20:03:02 +00:00
|
|
|
{
|
|
|
|
if( docwriter != NULL )
|
2020-10-08 23:47:06 +00:00
|
|
|
mDocWriters.Add( docwriter );
|
|
|
|
}
|
|
|
|
|
|
|
|
void AddLibrarian( const CONTRIBUTOR* aLibrarian )
|
|
|
|
{
|
|
|
|
if( aLibrarian )
|
|
|
|
mLibrarians.Add( aLibrarian );
|
2015-11-19 20:03:02 +00:00
|
|
|
}
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
void AddArtist( const CONTRIBUTOR* artist )
|
2015-11-19 20:03:02 +00:00
|
|
|
{
|
|
|
|
if( artist != NULL )
|
2020-10-08 23:47:06 +00:00
|
|
|
mArtists.Add( artist );
|
2015-11-19 20:03:02 +00:00
|
|
|
}
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
void AddTranslator( const CONTRIBUTOR* translator )
|
2015-11-19 20:03:02 +00:00
|
|
|
{
|
|
|
|
if( translator != NULL )
|
2020-10-08 23:47:06 +00:00
|
|
|
mTranslators.Add( translator );
|
2015-11-19 20:03:02 +00:00
|
|
|
}
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
void AddPackager( const CONTRIBUTOR* packager )
|
2015-11-19 20:03:02 +00:00
|
|
|
{
|
|
|
|
if( packager != NULL )
|
2020-10-08 23:47:06 +00:00
|
|
|
mPackagers.Add( packager );
|
2015-11-19 20:03:02 +00:00
|
|
|
}
|
2013-05-26 04:36:44 +00:00
|
|
|
|
2020-10-08 23:47:06 +00:00
|
|
|
CONTRIBUTORS GetDevelopers() { return mDevelopers; }
|
|
|
|
CONTRIBUTORS GetDocWriters() { return mDocWriters; }
|
|
|
|
CONTRIBUTORS GetLibrarians() { return mLibrarians; }
|
|
|
|
CONTRIBUTORS GetArtists() { return mArtists; }
|
|
|
|
CONTRIBUTORS GetTranslators() { return mTranslators; }
|
|
|
|
CONTRIBUTORS GetPackagers() { return mPackagers; }
|
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; }
|
|
|
|
|
2019-11-11 17:57:33 +00:00
|
|
|
void SetBuildDate( const wxString& date ) { buildDate = date; }
|
|
|
|
wxString& GetBuildDate() { return buildDate; }
|
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
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
|
|
|
|
2021-01-25 12:42:36 +00:00
|
|
|
///< Wrapper to manage memory allocation for bitmaps
|
2021-03-08 02:59:07 +00:00
|
|
|
wxBitmap* CreateKiBitmap( BITMAPS aBitmap )
|
2018-01-31 09:03:33 +00:00
|
|
|
{
|
|
|
|
m_bitmaps.emplace_back( KiBitmapNew( aBitmap ) );
|
|
|
|
return m_bitmaps.back().get();
|
|
|
|
}
|
|
|
|
|
2013-05-26 04:36:44 +00:00
|
|
|
private:
|
2020-10-08 23:47:06 +00:00
|
|
|
CONTRIBUTORS mDevelopers;
|
|
|
|
CONTRIBUTORS mDocWriters;
|
|
|
|
CONTRIBUTORS mLibrarians;
|
|
|
|
CONTRIBUTORS mArtists;
|
|
|
|
CONTRIBUTORS mTranslators;
|
|
|
|
CONTRIBUTORS mPackagers;
|
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;
|
2019-11-11 17:57:33 +00:00
|
|
|
wxString buildDate;
|
2013-05-26 04:36:44 +00:00
|
|
|
wxString libVersion;
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
wxIcon m_appIcon;
|
2018-01-31 09:03:33 +00:00
|
|
|
|
2021-01-25 12:42:36 +00:00
|
|
|
///< Bitmaps to be freed when the dialog is closed
|
2018-01-31 09:03:33 +00:00
|
|
|
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:
|
2021-02-10 01:25:11 +00:00
|
|
|
* - Extra identifying information
|
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,
|
2021-02-10 01:25:11 +00:00
|
|
|
const wxString& aExtra = 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,
|
2021-02-10 01:25:11 +00:00
|
|
|
m_extra = aExtra;
|
2017-08-18 06:06:45 +00:00
|
|
|
m_category = aCategory;
|
|
|
|
m_icon = aIcon;
|
|
|
|
}
|
|
|
|
|
2020-10-08 23:47:06 +00:00
|
|
|
CONTRIBUTOR( const wxString& aName,
|
|
|
|
const wxString& aCategory,
|
|
|
|
wxBitmap* aIcon )
|
|
|
|
{
|
|
|
|
m_checked = false;
|
|
|
|
m_name = aName;
|
|
|
|
m_url = wxEmptyString,
|
2021-02-10 01:25:11 +00:00
|
|
|
m_extra = wxEmptyString;
|
2020-10-08 23:47:06 +00:00
|
|
|
m_category = aCategory;
|
|
|
|
m_icon = aIcon;
|
|
|
|
}
|
|
|
|
|
2017-08-18 06:06:45 +00:00
|
|
|
virtual ~CONTRIBUTOR() {}
|
2013-05-26 04:36:44 +00:00
|
|
|
|
|
|
|
wxString& GetName() { return m_name; }
|
2021-02-10 01:25:11 +00:00
|
|
|
wxString& GetExtra() { return m_extra; }
|
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;
|
2021-02-10 01:25:11 +00:00
|
|
|
wxString m_extra;
|
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
|