Add option to build on wxWidgets master
This commit is contained in:
parent
d97c16cb7c
commit
5944d7999c
7 changed files with 72 additions and 18 deletions
19
.github/workflows/ci.yml
vendored
19
.github/workflows/ci.yml
vendored
|
@ -33,6 +33,25 @@ jobs:
|
|||
-Dfribidi:tests=false
|
||||
-Dfribidi:docs=false
|
||||
-Dlibass:fontconfig=disabled
|
||||
- name: Windows MSVC Release (wx master)
|
||||
os: windows-latest
|
||||
msvc: true
|
||||
buildtype: release
|
||||
args: >-
|
||||
-Ddefault_library=static
|
||||
--force-fallback-for=zlib,harfbuzz,freetype2,fribidi,libpng
|
||||
-Dfreetype2:harfbuzz=disabled
|
||||
-Dharfbuzz:freetype=disabled
|
||||
-Dharfbuzz:cairo=disabled
|
||||
-Dharfbuzz:glib=disabled
|
||||
-Dharfbuzz:gobject=disabled
|
||||
-Dharfbuzz:tests=disabled
|
||||
-Dharfbuzz:docs=disabled
|
||||
-Dharfbuzz:icu=disabled
|
||||
-Dfribidi:tests=false
|
||||
-Dfribidi:docs=false
|
||||
-Dlibass:fontconfig=disabled
|
||||
-Dwx_version='3.3.0'
|
||||
#- {
|
||||
# name: Windows MinGW,
|
||||
# os: windows-latest,
|
||||
|
|
18
meson.build
18
meson.build
|
@ -8,6 +8,7 @@ cmake = import('cmake')
|
|||
|
||||
if host_machine.system() == 'windows'
|
||||
add_project_arguments('-DNOMINMAX', '-D_WIN32_WINNT=0x0601', language: 'cpp')
|
||||
add_project_arguments('-DUNICODE', language: 'cpp')
|
||||
|
||||
if not get_option('csri').disabled()
|
||||
add_global_arguments('-DCSRI_NO_EXPORT', language: 'c')
|
||||
|
@ -134,16 +135,21 @@ else
|
|||
opt_var = cmake.subproject_options()
|
||||
opt_var.add_cmake_defines({
|
||||
'wxBUILD_INSTALL': false,
|
||||
'wxBUILD_PRECOMP': false, # otherwise breaks project generation w/ meson
|
||||
'wxBUILD_PRECOMP': 'OFF', # otherwise breaks project generation w/ meson
|
||||
'wxBUILD_SHARED': build_shared,
|
||||
|
||||
'wxUSE_WEBVIEW': false, # breaks build on linux
|
||||
'wxUSE_REGEX': 'builtin',
|
||||
'CMAKE_BUILD_TYPE': build_type,
|
||||
'wxUSE_IMAGE': true,
|
||||
'wxBUILD_MONOLITHIC': true # otherwise breaks project generation w/ meson
|
||||
})
|
||||
|
||||
wx = cmake.subproject('wxWidgets', options: opt_var)
|
||||
if get_option('wx_version').version_compare('>=3.3.0')
|
||||
wx = cmake.subproject('wxWidgets-master', options: opt_var)
|
||||
else
|
||||
wx = cmake.subproject('wxWidgets', options: opt_var)
|
||||
endif
|
||||
|
||||
deps += [
|
||||
wx.dependency('wxmono'),
|
||||
|
@ -151,6 +157,12 @@ else
|
|||
wx.dependency('wxscintilla')
|
||||
]
|
||||
|
||||
if get_option('wx_version').version_compare('>=3.3.0')
|
||||
deps += [
|
||||
wx.dependency('wxlexilla')
|
||||
]
|
||||
endif
|
||||
|
||||
if host_machine.system() == 'windows' or host_machine.system() == 'darwin'
|
||||
deps += [
|
||||
wx.dependency('wxpng'),
|
||||
|
@ -242,7 +254,7 @@ if host_machine.system() == 'windows' and not get_option('directsound').disabled
|
|||
endif
|
||||
|
||||
if host_machine.system() == 'darwin'
|
||||
frameworks_dep = dependency('appleframeworks', modules : ['CoreText', 'CoreFoundation', 'AppKit', 'Carbon', 'IOKit'])
|
||||
frameworks_dep = dependency('appleframeworks', modules : ['CoreText', 'CoreFoundation', 'AppKit', 'Carbon', 'IOKit', 'QuartzCore'])
|
||||
deps += frameworks_dep
|
||||
endif
|
||||
|
||||
|
|
|
@ -398,8 +398,8 @@ void ColorPickerScreenDropper::DropFromScreenXY(int x, int y) {
|
|||
CGGetDisplaysWithPoint(CGPointMake(x, y), 1, &display_id, &display_count);
|
||||
|
||||
agi::scoped_holder<CGImageRef> img(CGDisplayCreateImageForRect(display_id, CGRectMake(x - resx / 2, y - resy / 2, resx, resy)), CGImageRelease);
|
||||
NSUInteger width = CGImageGetWidth(img);
|
||||
NSUInteger height = CGImageGetHeight(img);
|
||||
size_t width = CGImageGetWidth(img);
|
||||
size_t height = CGImageGetHeight(img);
|
||||
std::vector<uint8_t> imgdata(height * width * 4);
|
||||
|
||||
agi::scoped_holder<CGColorSpaceRef> colorspace(CGColorSpaceCreateDeviceRGB(), CGColorSpaceRelease);
|
||||
|
|
|
@ -51,6 +51,11 @@
|
|||
#include <wx/stattext.h>
|
||||
#include <wx/stc/stc.h>
|
||||
|
||||
// Define macros for wxWidgets 3.1
|
||||
#ifndef wxSTC_KEYMOD_SHIFT
|
||||
#define wxSTC_KEYMOD_SHIFT wxSTC_SCMOD_SHIFT
|
||||
#endif
|
||||
|
||||
static void add_hotkey(wxSizer *sizer, wxWindow *parent, const char *command, wxString const& text) {
|
||||
sizer->Add(new wxStaticText(parent, -1, text));
|
||||
sizer->Add(new wxStaticText(parent, -1, to_wx(hotkey::get_hotkey_str_first("Translation Assistant", command))));
|
||||
|
@ -97,7 +102,7 @@ DialogTranslation::DialogTranslation(agi::Context *c)
|
|||
translated_text->SetMarginWidth(1, 0);
|
||||
translated_text->SetFocus();
|
||||
translated_text->Bind(wxEVT_CHAR_HOOK, &DialogTranslation::OnKeyDown, this);
|
||||
translated_text->CmdKeyAssign(wxSTC_KEY_RETURN, wxSTC_SCMOD_SHIFT, wxSTC_CMD_NEWLINE);
|
||||
translated_text->CmdKeyAssign(wxSTC_KEY_RETURN, wxSTC_KEYMOD_SHIFT, wxSTC_CMD_NEWLINE);
|
||||
|
||||
wxSizer *translated_box = new wxStaticBoxSizer(wxVERTICAL, this, _("Translation"));
|
||||
translated_box->Add(translated_text, 1, wxEXPAND, 0);
|
||||
|
|
|
@ -56,6 +56,17 @@
|
|||
#include <wx/menu.h>
|
||||
#include <wx/settings.h>
|
||||
|
||||
// Define macros for wxWidgets 3.1
|
||||
#ifndef wxSTC_KEYMOD_CTRL
|
||||
#define wxSTC_KEYMOD_CTRL wxSTC_SCMOD_CTRL
|
||||
#endif
|
||||
#ifndef wxSTC_KEYMOD_SHIFT
|
||||
#define wxSTC_KEYMOD_SHIFT wxSTC_SCMOD_SHIFT
|
||||
#endif
|
||||
#ifndef wxSTC_KEYMOD_NORM
|
||||
#define wxSTC_KEYMOD_NORM wxSTC_SCMOD_NORM
|
||||
#endif
|
||||
|
||||
// Maximum number of languages (locales)
|
||||
// It should be above 100 (at least 242) and probably not more than 1000
|
||||
#define LANGS_MAX 1000
|
||||
|
@ -94,17 +105,17 @@ SubsTextEditCtrl::SubsTextEditCtrl(wxWindow* parent, wxSize wsize, long style, a
|
|||
SetStyles();
|
||||
|
||||
// Set hotkeys
|
||||
CmdKeyClear(wxSTC_KEY_RETURN,wxSTC_SCMOD_CTRL);
|
||||
CmdKeyClear(wxSTC_KEY_RETURN,wxSTC_SCMOD_SHIFT);
|
||||
CmdKeyClear(wxSTC_KEY_RETURN,wxSTC_SCMOD_NORM);
|
||||
CmdKeyClear(wxSTC_KEY_TAB,wxSTC_SCMOD_NORM);
|
||||
CmdKeyClear(wxSTC_KEY_TAB,wxSTC_SCMOD_SHIFT);
|
||||
CmdKeyClear('D',wxSTC_SCMOD_CTRL);
|
||||
CmdKeyClear('L',wxSTC_SCMOD_CTRL);
|
||||
CmdKeyClear('L',wxSTC_SCMOD_CTRL | wxSTC_SCMOD_SHIFT);
|
||||
CmdKeyClear('T',wxSTC_SCMOD_CTRL);
|
||||
CmdKeyClear('T',wxSTC_SCMOD_CTRL | wxSTC_SCMOD_SHIFT);
|
||||
CmdKeyClear('U',wxSTC_SCMOD_CTRL);
|
||||
CmdKeyClear(wxSTC_KEY_RETURN,wxSTC_KEYMOD_CTRL);
|
||||
CmdKeyClear(wxSTC_KEY_RETURN,wxSTC_KEYMOD_SHIFT);
|
||||
CmdKeyClear(wxSTC_KEY_RETURN,wxSTC_KEYMOD_NORM);
|
||||
CmdKeyClear(wxSTC_KEY_TAB,wxSTC_KEYMOD_NORM);
|
||||
CmdKeyClear(wxSTC_KEY_TAB,wxSTC_KEYMOD_SHIFT);
|
||||
CmdKeyClear('D',wxSTC_KEYMOD_CTRL);
|
||||
CmdKeyClear('L',wxSTC_KEYMOD_CTRL);
|
||||
CmdKeyClear('L',wxSTC_KEYMOD_CTRL | wxSTC_KEYMOD_SHIFT);
|
||||
CmdKeyClear('T',wxSTC_KEYMOD_CTRL);
|
||||
CmdKeyClear('T',wxSTC_KEYMOD_CTRL | wxSTC_KEYMOD_SHIFT);
|
||||
CmdKeyClear('U',wxSTC_KEYMOD_CTRL);
|
||||
|
||||
using std::bind;
|
||||
|
||||
|
|
6
subprojects/wxWidgets-master.wrap
Normal file
6
subprojects/wxWidgets-master.wrap
Normal file
|
@ -0,0 +1,6 @@
|
|||
[wrap-git]
|
||||
directory = wxWidgets-master
|
||||
url = https://github.com/wxWidgets/wxWidgets.git
|
||||
revision = master
|
||||
clone-recursive = true
|
||||
depth = 1
|
|
@ -1,5 +1,6 @@
|
|||
[wrap-git]
|
||||
directory = wxWidgets
|
||||
url = https://github.com/wxWidgets/wxWidgets.git
|
||||
revision = v3.1.4
|
||||
revision = v3.1.7
|
||||
clone-recursive = true
|
||||
depth = 1
|
||||
|
|
Loading…
Reference in a new issue