Skip to content

Commit

Permalink
Merge pull request #166 from kenz-gelsoft/dep_vendored_with_runtime_api
Browse files Browse the repository at this point in the history
Depends on vendored crates through newly created git-hosted wxrust-vendored-config crate
  • Loading branch information
kenz-gelsoft authored Sep 7, 2022
2 parents 277e9d5 + 854ce84 commit e284214
Show file tree
Hide file tree
Showing 26 changed files with 62 additions and 179 deletions.
30 changes: 17 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ members = [
]

[patch.crates-io]
wxrust-config = { path = "wxrust-config" }
# wxrust-config = { path = "wxrust-config" }
wxrust-config = { git = "https://github.com/kenz-gelsoft/wxrust-vendored-config" }
33 changes: 14 additions & 19 deletions Doxybindgen.toml
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,15 @@ blocklist = [
# - Not supported before 3.2.0
'ResetAlpha',
'UseAlpha',
# Some feature disabled in vendored create
'SetDepth',
'SetHeight',
'SetWidth',
]
wx31 = [
'wxBitmap5',
'wxBitmap8',
'wxBitmap9',
'wxBitmap10',
'CreateWithDIPSize',
'CreateWithDIPSize1',
Expand All @@ -619,13 +624,6 @@ wx31 = [
'Rescale',
'SetScaleFactor',
]
wx317 = [
# Doc isn't up-to-date in wx3.1.6
'wxBitmap9',
'SetDepth',
'SetHeight',
'SetWidth',
]
not_windows = [
# FIXME: FindHandler on MSW requires dynamic_cast in C++ generated code.
'FindHandler',
Expand Down Expand Up @@ -1181,10 +1179,11 @@ blocklist = [
blocklist = [
# some of our CI env built without printing
'CreateContext3',
# our vendored crate doesn't support
'GetDirect2DRenderer',
]
windows = [
'CreateContext4',
'GetDirect2DRenderer',
'GetGDIPlusRenderer',
]
wx31 = [
Expand Down Expand Up @@ -1281,18 +1280,16 @@ blocklist = [
[types.wxIcon]
blocklist = [
'operator=',
# Some feature disabled in vendored create
'SetDepth',
'SetHeight',
'SetWidth',
]
wx31 = [
'GetLogicalHeight',
'GetLogicalSize',
'GetLogicalWidth',
]
wx317 = [
# Doc isn't up-to-date in wx3.1.6
'SetDepth',
'SetHeight',
'SetWidth',
]
[types.wxIconBundle]
blocklist = [
'operator=',
Expand Down Expand Up @@ -1591,8 +1588,8 @@ blocklist = [
'wxPrintout',
]
[types.wxRadioBox]
wx317 = [
# Doc isn't up-to-date in wx3.1.6
blocklist = [
# help disabled in vendored crate
'GetItemHelpText',
]
[types.wxRadioButton]
Expand Down Expand Up @@ -1985,9 +1982,7 @@ blocklist = [
'GetChildren',
'GetCursor',
'GetUpdateRegion',
]
wx317 = [
# Doc isn't up-to-date in wx3.1.6
# help disabled in vendored crate
'GetHelpText',
]
not_gtk = [
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,17 @@ Following installation method are (somewhat) tested with:

### Use vendored wx binary crate

Specify `--features vendored` to cargo, to use vendored prebuilt wx binary crate. This configuration links to following per-build-target crates by default. You should be able to [override this by crate name](https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html):
You can use prebuilt wx binaries without installing wxWidgets system-wide.

1. Specify `--features vendored` to cargo.
2. Override `wxrust-config` crate dependency with the following git respositry crate (or your fork of it):
```toml
[patch.crates-io]
wxrust-config = { git = "https://github.com/kenz-gelsoft/wxrust-vendored-config" }
```
- You need to specify git or local separate repo's crate, as `crates.io` won't host crates with (large) binary crates such as this.

This configuration links to following per-build-target crates by default. You should be able to [override this by crate name](https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html):

|Build target|Crate name|Git repository|Build configuration|
|------------|----------|--------------|-------------------|
Expand Down
12 changes: 0 additions & 12 deletions wx-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,8 @@ license = "MIT"
[features]
vendored = [
"wxrust-config/vendored",
"dep:wx-universal-apple-darwin",
"dep:wx-x86_64-pc-windows-gnu",
"dep:wx-x86_64-pc-windows-msvc",
]

[target.'cfg(target_os = "macos")'.dependencies]
wx-universal-apple-darwin = { git = "https://github.com/ancwrd1/wx-universal-apple-darwin", optional = true }

[target.x86_64-pc-windows-gnu.dependencies]
wx-x86_64-pc-windows-gnu = { git = "https://github.com/ancwrd1/wx-x86_64-pc-windows-gnu", optional = true }

[target.x86_64-pc-windows-msvc.dependencies]
wx-x86_64-pc-windows-msvc = { git = "https://github.com/kenz-gelsoft/wx-x86_64-pc-windows-msvc", optional = true }

[build-dependencies]
cc = "1.0.72"
wxrust-config = "0.0.1-alpha2"
12 changes: 0 additions & 12 deletions wx-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,11 @@ license = "MIT"
[features]
vendored = [
"wxrust-config/vendored",
"dep:wx-universal-apple-darwin",
"dep:wx-x86_64-pc-windows-gnu",
"dep:wx-x86_64-pc-windows-msvc",
]

[dependencies]
wx-base = { path = "../wx-base", package="wxrust-base" }

[target.'cfg(target_os = "macos")'.dependencies]
wx-universal-apple-darwin = { git = "https://github.com/ancwrd1/wx-universal-apple-darwin", optional = true }

[target.x86_64-pc-windows-gnu.dependencies]
wx-x86_64-pc-windows-gnu = { git = "https://github.com/ancwrd1/wx-x86_64-pc-windows-gnu", optional = true }

[target.x86_64-pc-windows-msvc.dependencies]
wx-x86_64-pc-windows-msvc = { git = "https://github.com/kenz-gelsoft/wx-x86_64-pc-windows-msvc", optional = true }

[build-dependencies]
cc = "1.0.72"
wxrust-config = "0.0.1-alpha2"
11 changes: 0 additions & 11 deletions wx-core/include/generated/ffi_b.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ wxBitmap *wxBitmap_new5(int width, int height, const wxDC * dc);
wxBitmap *wxBitmap_new6(const char *const * bits);
#if wxCHECK_VERSION(3, 1, 0)
wxBitmap *wxBitmap_new8(const wxImage * img, int depth);
#endif
#if wxCHECK_VERSION(3, 1, 7)
wxBitmap *wxBitmap_new9(const wxImage * img, const wxDC * dc);
#endif
#if wxCHECK_VERSION(3, 1, 0)
wxBitmap *wxBitmap_new10(const wxCursor * cursor);
#endif
wxImage *wxBitmap_ConvertToImage(const wxBitmap * self);
Expand Down Expand Up @@ -78,18 +74,11 @@ wxSize *wxBitmap_GetSize(const wxBitmap * self);
int wxBitmap_GetWidth(const wxBitmap * self);
bool wxBitmap_HasAlpha(const wxBitmap * self);
bool wxBitmap_IsOk(const wxBitmap * self);
#if wxCHECK_VERSION(3, 1, 7)
void wxBitmap_SetDepth(wxBitmap * self, int depth);
void wxBitmap_SetHeight(wxBitmap * self, int height);
#endif
#if wxCHECK_VERSION(3, 1, 0)
void wxBitmap_SetScaleFactor(wxBitmap * self, double scale);
#endif
void wxBitmap_SetMask(wxBitmap * self, wxMask * mask);
void wxBitmap_SetPalette(wxBitmap * self, const wxPalette * palette);
#if wxCHECK_VERSION(3, 1, 7)
void wxBitmap_SetWidth(wxBitmap * self, int width);
#endif
void wxBitmap_AddHandler(wxBitmapHandler * handler);
void wxBitmap_CleanUpHandlers();
#ifndef __WXMSW__
Expand Down
1 change: 0 additions & 1 deletion wx-core/include/generated/ffi_g.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ wxGraphicsRenderer * wxGraphicsRenderer_GetDefaultRenderer();
wxGraphicsRenderer * wxGraphicsRenderer_GetCairoRenderer();
#ifdef __WXMSW__
wxGraphicsRenderer * wxGraphicsRenderer_GetGDIPlusRenderer();
wxGraphicsRenderer * wxGraphicsRenderer_GetDirect2DRenderer();
#endif

// CLASS: wxGridBagSizer
Expand Down
5 changes: 0 additions & 5 deletions wx-core/include/generated/ffi_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ double wxIcon_GetScaleFactor(const wxIcon * self);
wxSize *wxIcon_GetSize(const wxIcon * self);
int wxIcon_GetWidth(const wxIcon * self);
bool wxIcon_IsOk(const wxIcon * self);
#if wxCHECK_VERSION(3, 1, 7)
void wxIcon_SetDepth(wxIcon * self, int depth);
void wxIcon_SetHeight(wxIcon * self, int height);
void wxIcon_SetWidth(wxIcon * self, int width);
#endif

// CLASS: wxIconBundle
wxClassInfo *wxIconBundle_CLASSINFO();
Expand Down
3 changes: 0 additions & 3 deletions wx-core/include/generated/ffi_r.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ bool wxRadioBox_Create1(wxRadioBox * self, wxWindow * parent, wxWindowID id, con
bool wxRadioBox_Enable(wxRadioBox * self, unsigned int n, bool enable);
unsigned int wxRadioBox_GetColumnCount(const wxRadioBox * self);
int wxRadioBox_GetItemFromPoint(const wxRadioBox * self, const wxPoint * pt);
#if wxCHECK_VERSION(3, 1, 7)
wxString *wxRadioBox_GetItemHelpText(const wxRadioBox * self, unsigned int item);
#endif
wxToolTip * wxRadioBox_GetItemToolTip(const wxRadioBox * self, unsigned int item);
unsigned int wxRadioBox_GetRowCount(const wxRadioBox * self);
bool wxRadioBox_IsItemEnabled(const wxRadioBox * self, unsigned int n);
Expand Down
3 changes: 0 additions & 3 deletions wx-core/include/generated/ffi_w.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,6 @@ bool wxWindow_IsShownOnScreen(const wxWindow * self);
bool wxWindow_Disable(wxWindow * self);
bool wxWindow_Enable(wxWindow * self, bool enable);
bool wxWindow_Show(wxWindow * self, bool show);
#if wxCHECK_VERSION(3, 1, 7)
wxString *wxWindow_GetHelpText(const wxWindow * self);
#endif
void wxWindow_SetHelpText(wxWindow * self, const wxString * help_text);
wxToolTip * wxWindow_GetToolTip(const wxWindow * self);
wxString *wxWindow_GetToolTipText(const wxWindow * self);
Expand Down
17 changes: 0 additions & 17 deletions wx-core/src/generated/ffi_b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,9 @@ wxBitmap *wxBitmap_new6(const char *const * bits) {
wxBitmap *wxBitmap_new8(const wxImage * img, int depth) {
return new wxBitmap(*img, depth);
}
#endif
#if wxCHECK_VERSION(3, 1, 7)
wxBitmap *wxBitmap_new9(const wxImage * img, const wxDC * dc) {
return new wxBitmap(*img, *dc);
}
#endif
#if wxCHECK_VERSION(3, 1, 0)
wxBitmap *wxBitmap_new10(const wxCursor * cursor) {
return new wxBitmap(*cursor);
}
Expand Down Expand Up @@ -145,14 +141,6 @@ bool wxBitmap_HasAlpha(const wxBitmap * self) {
bool wxBitmap_IsOk(const wxBitmap * self) {
return self->IsOk();
}
#if wxCHECK_VERSION(3, 1, 7)
void wxBitmap_SetDepth(wxBitmap * self, int depth) {
return self->SetDepth(depth);
}
void wxBitmap_SetHeight(wxBitmap * self, int height) {
return self->SetHeight(height);
}
#endif
#if wxCHECK_VERSION(3, 1, 0)
void wxBitmap_SetScaleFactor(wxBitmap * self, double scale) {
return self->SetScaleFactor(scale);
Expand All @@ -164,11 +152,6 @@ void wxBitmap_SetMask(wxBitmap * self, wxMask * mask) {
void wxBitmap_SetPalette(wxBitmap * self, const wxPalette * palette) {
return self->SetPalette(*palette);
}
#if wxCHECK_VERSION(3, 1, 7)
void wxBitmap_SetWidth(wxBitmap * self, int width) {
return self->SetWidth(width);
}
#endif
void wxBitmap_AddHandler(wxBitmapHandler * handler) {
return wxBitmap::AddHandler(handler);
}
Expand Down
6 changes: 3 additions & 3 deletions wx-core/src/generated/ffi_b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ extern "C" {
// NOT_SUPPORTED: pub fn wxBitmap_LoadFile(self_: *mut c_void, name: *const c_void, type_: wxBitmapType) -> bool;
// BLOCKED: pub fn wxBitmap_ResetAlpha(self_: *mut c_void);
// NOT_SUPPORTED: pub fn wxBitmap_SaveFile(self_: *const c_void, name: *const c_void, type_: wxBitmapType, palette: *const c_void) -> bool;
pub fn wxBitmap_SetDepth(self_: *mut c_void, depth: c_int);
pub fn wxBitmap_SetHeight(self_: *mut c_void, height: c_int);
// BLOCKED: pub fn wxBitmap_SetDepth(self_: *mut c_void, depth: c_int);
// BLOCKED: pub fn wxBitmap_SetHeight(self_: *mut c_void, height: c_int);
pub fn wxBitmap_SetScaleFactor(self_: *mut c_void, scale: c_double);
pub fn wxBitmap_SetMask(self_: *mut c_void, mask: *mut c_void);
pub fn wxBitmap_SetPalette(self_: *mut c_void, palette: *const c_void);
pub fn wxBitmap_SetWidth(self_: *mut c_void, width: c_int);
// BLOCKED: pub fn wxBitmap_SetWidth(self_: *mut c_void, width: c_int);
// BLOCKED: pub fn wxBitmap_UseAlpha(self_: *mut c_void, use_: bool) -> bool;
pub fn wxBitmap_AddHandler(handler: *mut c_void);
pub fn wxBitmap_CleanUpHandlers();
Expand Down
3 changes: 0 additions & 3 deletions wx-core/src/generated/ffi_g.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,6 @@ wxGraphicsRenderer * wxGraphicsRenderer_GetCairoRenderer() {
wxGraphicsRenderer * wxGraphicsRenderer_GetGDIPlusRenderer() {
return wxGraphicsRenderer::GetGDIPlusRenderer();
}
wxGraphicsRenderer * wxGraphicsRenderer_GetDirect2DRenderer() {
return wxGraphicsRenderer::GetDirect2DRenderer();
}
#endif

// CLASS: wxGridBagSizer
Expand Down
2 changes: 1 addition & 1 deletion wx-core/src/generated/ffi_g.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ extern "C" {
pub fn wxGraphicsRenderer_GetDefaultRenderer() -> *mut c_void;
pub fn wxGraphicsRenderer_GetCairoRenderer() -> *mut c_void;
pub fn wxGraphicsRenderer_GetGDIPlusRenderer() -> *mut c_void;
pub fn wxGraphicsRenderer_GetDirect2DRenderer() -> *mut c_void;
// BLOCKED: pub fn wxGraphicsRenderer_GetDirect2DRenderer() -> *mut c_void;

// wxGridBagSizer
pub fn wxGridBagSizer_CLASSINFO() -> *mut c_void;
Expand Down
11 changes: 0 additions & 11 deletions wx-core/src/generated/ffi_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,6 @@ int wxIcon_GetWidth(const wxIcon * self) {
bool wxIcon_IsOk(const wxIcon * self) {
return self->IsOk();
}
#if wxCHECK_VERSION(3, 1, 7)
void wxIcon_SetDepth(wxIcon * self, int depth) {
return self->SetDepth(depth);
}
void wxIcon_SetHeight(wxIcon * self, int height) {
return self->SetHeight(height);
}
void wxIcon_SetWidth(wxIcon * self, int width) {
return self->SetWidth(width);
}
#endif

// CLASS: wxIconBundle
wxClassInfo *wxIconBundle_CLASSINFO() {
Expand Down
6 changes: 3 additions & 3 deletions wx-core/src/generated/ffi_i.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ extern "C" {
pub fn wxIcon_GetWidth(self_: *const c_void) -> c_int;
pub fn wxIcon_IsOk(self_: *const c_void) -> bool;
// NOT_SUPPORTED: pub fn wxIcon_LoadFile(self_: *mut c_void, name: *const c_void, type_: wxBitmapType, desired_width: c_int, desired_height: c_int) -> bool;
pub fn wxIcon_SetDepth(self_: *mut c_void, depth: c_int);
pub fn wxIcon_SetHeight(self_: *mut c_void, height: c_int);
pub fn wxIcon_SetWidth(self_: *mut c_void, width: c_int);
// BLOCKED: pub fn wxIcon_SetDepth(self_: *mut c_void, depth: c_int);
// BLOCKED: pub fn wxIcon_SetHeight(self_: *mut c_void, height: c_int);
// BLOCKED: pub fn wxIcon_SetWidth(self_: *mut c_void, width: c_int);
// BLOCKED: pub fn wxIcon_operator=(self_: *mut c_void, icon: *const c_void) -> *mut c_void;

// wxIconBundle
Expand Down
Loading

0 comments on commit e284214

Please sign in to comment.