Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
144 changes: 72 additions & 72 deletions .github/workflows/wxOSX_arm64.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
name: wxOSX_arm64
on:
# push:
# branches: '*'
# pull_request:
# branches: '*'
# workflow_dispatch:
# branches: '*'
name: wxOSX_arm64

on:
# push:
# branches: '*'
# pull_request:
# branches: '*'
# workflow_dispatch:
# branches: '*'
workflow_dispatch:
jobs:
build:
runs-on: macos-14
steps:
- name: Install boost
uses: MarkusJx/install-boost@v2.4.5
id: install-boost
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json
boost_version: 1.86.0
boost_install_dir: /tmp/wxModularAppOCX/boost/
- uses: actions/checkout@v4
- name: Install wxWidgets
run: |
curl -L https://download.osgeo.org/libtiff/tiff-4.6.0.tar.gz --output tiff-4.6.0.tar.gz
tar xzf tiff-4.6.0.tar.gz
cd tiff-4.6.0
./configure
make -j$(getconf _NPROCESSORS_ONLN)
sudo make install
cd ..
curl -L https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.5/wxWidgets-3.2.5.tar.bz2 --output wxWidgets-3.2.5.tar.bz2
tar xjf wxWidgets-3.2.5.tar.bz2
cd wxwidgets-3.2.5
mkdir buildOSX
cd buildOSX
../configure --enable-debug
make -j$(getconf _NPROCESSORS_ONLN)
sudo make install
cd ../..
wx-config --list
wx-config --cxxflags
wx-config --libs
- name: Run CMake
run: |
cd build
chmod +x ./cmAppleMac.sh
./cmAppleMac.sh
cd ..
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- name: Run GNU Make with GNU compiler
run: |
cd build
mkdir -p bin
mkdir -p bin/Debug
cd Mac
make VERBOSE=1 -j$(getconf _NPROCESSORS_ONLN)
cd ../..
cp wxWidgets-3.2.5/buildOSX/lib/*.dylib build/bin/wxModularHost.app/Contents
- uses: actions/upload-artifact@v4
with:
name: artifacts_wxOSX_arm64
path: build/bin/wxModularHost.app/Contents

jobs:
build:

runs-on: macos-14

steps:
- name: Install boost
uses: MarkusJx/install-boost@v2.4.5
id: install-boost
with:
# REQUIRED: Specify the required boost version
# A list of supported versions can be found here:
# https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json
boost_version: 1.86.0
boost_install_dir: /tmp/wxModularAppOCX/boost/

- uses: actions/checkout@v4
- name: Install wxWidgets
run: |
curl -L https://download.osgeo.org/libtiff/tiff-4.6.0.tar.gz --output tiff-4.6.0.tar.gz
tar xzf tiff-4.6.0.tar.gz
cd tiff-4.6.0
./configure
make -j$(getconf _NPROCESSORS_ONLN)
sudo make install
cd ..
curl -L https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.5/wxWidgets-3.2.5.tar.bz2 --output wxWidgets-3.2.5.tar.bz2
tar xjf wxWidgets-3.2.5.tar.bz2
cd wxwidgets-3.2.5
mkdir buildOSX
cd buildOSX
../configure --enable-debug
make -j$(getconf _NPROCESSORS_ONLN)
sudo make install
cd ../..
wx-config --list
wx-config --cxxflags
wx-config --libs

- name: Run CMake
run: |
cd build
chmod +x ./cmAppleMac.sh
./cmAppleMac.sh
cd ..
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}

- name: Run GNU Make with GNU compiler
run: |
cd build
mkdir -p bin
mkdir -p bin/Debug
cd Mac
make VERBOSE=1 -j$(getconf _NPROCESSORS_ONLN)
cd ../..
cp wxWidgets-3.2.5/buildOSX/lib/*.dylib build/bin/wxModularHost.app/Contents

- uses: actions/upload-artifact@v4
with:
name: artifacts_wxOSX_arm64
path: build/bin/wxModularHost.app/Contents
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
build/
.cmake/
out/
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
CMakeSettings.json

Debug/
Release/
x64/
x86/

*.pch
*.obj
*.o
*.tlog
*.pdb
*.ilk
*.exp

.vs/
*.VC.db
*.VC.opendb
*.suo
*.user
*.userosscache
*.sln.docstates

.DS_Store
Thumbs.db
*.log
*.tmp
40 changes: 40 additions & 0 deletions CommonPluginBase/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Stuff the average programmer needs to change
#
set(SRCS
CommonConfigWindowBase.cpp
SerializableBase.cpp
)
set(HFILES
CommonConfigWindowBase.h
SerializableBase.h
CommonPlugin.h
)

set(INCLUDE_DIRECTORIES
${BASE_INCLUDE_DIRECTORIES}
${THIRD_PARTY_DIR}/wxXS/include
)

set(LIBRARY_NAME CommonPluginBase)

if(WIN32)
set(PREPROCESSOR_DEFINITIONS ${PREPROCESSOR_DEFINITIONS};/D_USRDLL;/DIFLOOR_EXPORTS_COMMONPLUGINBASE)
endif(WIN32)

set(SRCS ${SRCS} ${HFILES} ${PROJECT_ROOT_DIR}/include/stdwx.h ${PROJECT_ROOT_DIR}/include/stdwx.cpp)

add_definitions(${PREPROCESSOR_DEFINITIONS})
include_directories(${INCLUDE_DIRECTORIES})

add_library(${LIBRARY_NAME} SHARED ${SRCS})

target_link_libraries(${LIBRARY_NAME}
${wxWidgets_LIBRARIES}
wxXS
)

target_precompile_headers(${LIBRARY_NAME}
PRIVATE
"${PROJECT_ROOT_DIR}/include/stdwx.h"
)
44 changes: 44 additions & 0 deletions CommonPluginBase/CommonConfigWindowBase.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include "stdwx.h"
#include "CommonConfigWindowBase.h"

IMPLEMENT_DYNAMIC_CLASS(CommonConfigWindowBase, wxPanel)

CommonConfigWindowBase::CommonConfigWindowBase()
{

}

CommonConfigWindowBase::CommonConfigWindowBase(wxWindow *parent,
wxWindowID winid /*= wxID_ANY*/,
const wxPoint& pos /*= wxDefaultPosition*/,
const wxSize& size /*= wxDefaultSize*/,
long style /*= wxTAB_TRAVERSAL | wxNO_BORDER*/,
const wxString& name /*= wxPanelNameStr*/)
{
Create(parent, winid, pos, size, style, name);
}

bool CommonConfigWindowBase::Create(wxWindow *parent,
wxWindowID winid /*= wxID_ANY*/,
const wxPoint& pos /*= wxDefaultPosition*/,
const wxSize& size /*= wxDefaultSize*/,
long style /*= wxTAB_TRAVERSAL | wxNO_BORDER*/,
const wxString& name /*= wxPanelNameStr*/)
{
return wxPanel::Create(parent, winid, pos, size, style, name);
}

CommonConfigWindowBase::~CommonConfigWindowBase(void)
{

}

bool CommonConfigWindowBase::ReadConfig()
{
return true;
}

bool CommonConfigWindowBase::SaveConfig()
{
return true;
}
37 changes: 37 additions & 0 deletions CommonPluginBase/CommonConfigWindowBase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#ifndef _COMMONCONFIGWINDOWBASE_H
#define _COMMONCONFIGWINDOWBASE_H
#include "CommonPlugin.h"
#include <wx/panel.h>

class IFLOOR_API_COMMONPLUGINBASE CommonConfigWindowBase : public wxPanel
{
DECLARE_DYNAMIC_CLASS(CommonConfigWindowBase)
public:
/// Constructors
CommonConfigWindowBase();
CommonConfigWindowBase(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
const wxString& name = wxPanelNameStr);

/// Pseudo ctor
bool Create(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
const wxString& name = wxPanelNameStr);

virtual ~CommonConfigWindowBase();

/// Reads config from the effect
virtual bool ReadConfig();

/// Saves config to the effect
virtual bool SaveConfig();
};


#endif // _COMMONCONFIGWINDOWBASE_H
14 changes: 14 additions & 0 deletions CommonPluginBase/CommonPlugin.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef _COMMONPLUGIN_H
#define _COMMONPLUGIN_H

#if defined(__WXMSW__)
#ifdef IFLOOR_EXPORTS_COMMONPLUGINBASE
#define IFLOOR_API_COMMONPLUGINBASE __declspec(dllexport)
#else
#define IFLOOR_API_COMMONPLUGINBASE __declspec(dllimport)
#endif
#else
#define IFLOOR_API_COMMONPLUGINBASE
#endif

#endif // _COMMONPLUGIN_H
63 changes: 63 additions & 0 deletions CommonPluginBase/SerializableBase.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#include "stdwx.h"
#include "SerializableBase.h"
#include <wx/listimpl.cpp>

IMPLEMENT_ABSTRACT_CLASS(SerializableBase, xsSerializable);

WX_DEFINE_USER_EXPORTED_LIST(SerializableBaseList);

SerializableBase::SerializableBase()
{
}

SerializableBase::~SerializableBase()
{
}

bool SerializableBase::Deserialize(wxInputStream & instream)
{
return Deserialize(instream, *this);
}

bool SerializableBase::Deserialize(wxInputStream & instream, xsSerializable & obj)
{
wxXmlSerializer Serializer;
Serializer.EnableCloning(false);
Serializer.SetRootItem(&obj);
bool res = Serializer.DeserializeFromXml(instream);
Serializer.SetRootItem(nullptr, false);
obj.Reparent(nullptr);
obj.SetParentManager(nullptr);
return res;
}

bool SerializableBase::Deserialize(const wxString & config, xsSerializable & obj)
{
wxStringInputStream stream(config);
return Deserialize(stream, obj);
}

bool SerializableBase::Serialize(wxOutputStream & outstream)
{
return Serialize(outstream, *this);
}

bool SerializableBase::Serialize(wxOutputStream & outstream, xsSerializable & obj)
{
wxXmlSerializer Serializer;
Serializer.EnableCloning(false);
Serializer.SetRootItem(&obj);
bool res = Serializer.SerializeToXml(outstream, true);
Serializer.SetRootItem(nullptr, false);
obj.Reparent(nullptr);
obj.SetParentManager(nullptr);
return res;
}

wxString SerializableBase::Serialize(xsSerializable & obj)
{
wxString config;
wxStringOutputStream stream(&config);
Serialize(stream, obj);
return config;
}
Loading