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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "ui-sys/libui"]
path = ui-sys/libui
url = https://github.com/andlabs/libui
url = https://github.com/zentner-kyle/libui
3 changes: 1 addition & 2 deletions ui-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ description = "Native bindings to the minimalist, cross-platform, widget set `li
libc = "0.2"

[build-dependencies]
make-cmd = "0.1"

cmake = "0.1.22"
30 changes: 20 additions & 10 deletions ui-sys/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extern crate make_cmd;
extern crate cmake;
use cmake::Config;

use std::env;
use std::path::Path;
Expand All @@ -9,14 +10,23 @@ fn main() {
Command::new("git").args(&["submodule", "update", "--init"]).status().unwrap();
}

let out_dir = env::var("OUT_DIR").unwrap();
let outdir_argument = format!("OUTDIR={}", out_dir);
let objdir_argument = format!("OBJDIR={}/obj", out_dir);
make_cmd::gnu_make().args(&["-C", "libui", &*outdir_argument, &*objdir_argument])
.status()
.unwrap();
let target = env::var("TARGET").unwrap();
let msvc = target.contains("msvc");

println!("cargo:rustc-link-lib=dylib=ui");
println!("cargo:rustc-link-search=native={}", out_dir);
}
let dst = Config::new("libui")
.build_target("libui")
.build();

let mut postfix = Path::new("build").join("out");
let libname;
if msvc {
postfix = postfix.join("Release");
libname = "libui";
} else {
libname = "ui";
}
let dst = dst.join(&postfix);

println!("cargo:rustc-link-lib={}", libname);
println!("cargo:rustc-link-search=native={}", dst.display());
}
2 changes: 1 addition & 1 deletion ui-sys/libui
Submodule libui updated 198 files
27 changes: 0 additions & 27 deletions ui-sys/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub struct uiInitOptions {
pub Size: size_t,
}

#[link(name = "ui")]
extern {
pub fn uiInit(options: *mut uiInitOptions) -> *const c_char;
pub fn uiUninit();
Expand Down Expand Up @@ -45,7 +44,6 @@ pub struct uiControl {
pub Disable: extern "C" fn(this: *mut uiControl),
}

#[link(name = "ui")]
extern {
pub fn uiControlDestroy(control: *mut uiControl);
pub fn uiControlHandle(control: *mut uiControl) -> usize;
Expand All @@ -70,7 +68,6 @@ extern {

pub enum uiWindow {}

#[link(name = "ui")]
extern {
pub fn uiWindowTitle(w: *mut uiWindow) -> *mut c_char;
pub fn uiWindowSetTitle(w: *mut uiWindow, title: *const c_char);
Expand All @@ -86,7 +83,6 @@ extern {

pub enum uiButton {}

#[link(name = "ui")]
extern {
pub fn uiButtonText(b: *mut uiButton) -> *mut c_char;
pub fn uiButtonSetText(b: *mut uiButton, text: *const c_char);
Expand All @@ -98,7 +94,6 @@ extern {

pub enum uiBox {}

#[link(name = "ui")]
extern {
pub fn uiBoxAppend(b: *mut uiBox, child: *mut uiControl, stretchy: c_int);
pub fn uiBoxDelete(b: *mut uiBox, index: uintmax_t);
Expand All @@ -110,7 +105,6 @@ extern {

pub enum uiEntry {}

#[link(name = "ui")]
extern {
pub fn uiEntryText(e: *mut uiEntry) -> *mut c_char;
pub fn uiEntrySetText(e: *mut uiEntry, text: *const c_char);
Expand All @@ -124,7 +118,6 @@ extern {

pub enum uiCheckbox {}

#[link(name = "ui")]
extern {
pub fn uiCheckboxText(c: *mut uiCheckbox) -> *mut c_char;
pub fn uiCheckboxSetText(c: *mut uiCheckbox, text: *const c_char);
Expand All @@ -138,7 +131,6 @@ extern {

pub enum uiLabel {}

#[link(name = "ui")]
extern {
pub fn uiLabelText(l: *mut uiLabel) -> *mut c_char;
pub fn uiLabelSetText(l: *mut uiLabel, text: *const c_char);
Expand All @@ -147,7 +139,6 @@ extern {

pub enum uiTab {}

#[link(name = "ui")]
extern {
pub fn uiTabAppend(t: *mut uiTab, name: *const c_char, c: *mut uiControl);
pub fn uiTabInsertAt(t: *mut uiTab, name: *const c_char, before: uintmax_t, c: *mut uiControl);
Expand All @@ -160,7 +151,6 @@ extern {

pub enum uiGroup {}

#[link(name = "ui")]
extern {
pub fn uiGroupTitle(g: *mut uiGroup) -> *mut c_char;
pub fn uiGroupSetTitle(g: *mut uiGroup, title: *const c_char);
Expand All @@ -172,7 +162,6 @@ extern {

pub enum uiSpinbox {}

#[link(name = "ui")]
extern {
pub fn uiSpinboxValue(s: *mut uiSpinbox) -> intmax_t;
pub fn uiSpinboxSetValue(s: *mut uiSpinbox, value: intmax_t);
Expand All @@ -184,15 +173,13 @@ extern {

pub enum uiProgressBar {}

#[link(name = "ui")]
extern {
pub fn uiProgressBarSetValue(p: *mut uiProgressBar, n: c_int);
pub fn uiNewProgressBar() -> *mut uiProgressBar;
}

pub enum uiSlider {}

#[link(name = "ui")]
extern {
pub fn uiSliderValue(s: *mut uiSlider) -> intmax_t;
pub fn uiSliderSetValue(s: *mut uiSlider, value: intmax_t);
Expand All @@ -204,14 +191,12 @@ extern {

pub enum uiSeparator {}

#[link(name = "ui")]
extern {
pub fn uiNewHorizontalSeparator() -> *mut uiSeparator;
}

pub enum uiCombobox {}

#[link(name = "ui")]
extern {
pub fn uiComboboxAppend(c: *mut uiCombobox, text: *const c_char);
pub fn uiComboboxSelected(c: *mut uiCombobox) -> intmax_t;
Expand All @@ -225,15 +210,13 @@ extern {

pub enum uiRadioButtons {}

#[link(name = "ui")]
extern {
pub fn uiRadioButtonsAppend(r: *mut uiRadioButtons, text: *const c_char);
pub fn uiNewRadioButtons() -> *mut uiRadioButtons;
}

pub enum uiDateTimePicker {}

#[link(name = "ui")]
extern {
pub fn uiNewDateTimePicker() -> *mut uiDateTimePicker;
pub fn uiNewDatePicker() -> *mut uiDateTimePicker;
Expand All @@ -242,7 +225,6 @@ extern {

pub enum uiMultilineEntry {}

#[link(name = "ui")]
extern {
pub fn uiMultilineEntryText(e: *mut uiMultilineEntry) -> *mut c_char;
pub fn uiMultilineEntrySetText(e: *mut uiMultilineEntry, text: *const c_char);
Expand All @@ -257,7 +239,6 @@ extern {

pub enum uiMenuItem {}

#[link(name = "ui")]
extern {
pub fn uiMenuItemEnable(m: *mut uiMenuItem);
pub fn uiMenuItemDisable(m: *mut uiMenuItem);
Expand All @@ -272,7 +253,6 @@ extern {

pub enum uiMenu {}

#[link(name = "ui")]
extern {
pub fn uiMenuAppendItem(m: *mut uiMenu, name: *const c_char) -> *mut uiMenuItem;
pub fn uiMenuAppendCheckItem(m: *mut uiMenu, name: *const c_char) -> *mut uiMenuItem;
Expand All @@ -283,7 +263,6 @@ extern {
pub fn uiNewMenu(name: *const c_char) -> *mut uiMenu;
}

#[link(name = "ui")]
extern {
pub fn uiOpenFile(parent: *mut uiWindow) -> *mut c_char;
pub fn uiSaveFile(parent: *mut uiWindow) -> *mut c_char;
Expand Down Expand Up @@ -311,7 +290,6 @@ pub struct uiAreaHandler {
-> c_int,
}

#[link(name = "ui")]
extern {
pub fn uiAreaSetSize(a: *mut uiArea, width: intmax_t, height: intmax_t);
pub fn uiAreaQueueRedrawAll(a: *mut uiArea);
Expand Down Expand Up @@ -434,13 +412,11 @@ pub struct uiDrawStrokeParams {
pub DashPhase: c_double,
}

#[link(name = "ui")]
extern {
pub fn uiDrawNewPath(fillMode: uiDrawFillMode) -> *mut uiDrawPath;
pub fn uiDrawFreePath(p: *mut uiDrawPath);
}

#[link(name = "ui")]
extern {
pub fn uiDrawPathNewFigure(p: *mut uiDrawPath, x: c_double, y: c_double);
pub fn uiDrawPathNewFigureWithArc(p: *mut uiDrawPath,
Expand Down Expand Up @@ -705,7 +681,6 @@ pub struct uiAreaKeyEvent {

pub enum uiFontButton {}

#[link(name = "ui")]
extern {
pub fn uiFontButtonFont(b: *mut uiFontButton) -> *mut uiDrawTextFont;
pub fn uiFontButtonOnChanged(b: *mut uiFontButton,
Expand All @@ -716,7 +691,6 @@ extern {

pub enum uiColorButton {}

#[link(name = "ui")]
extern {
pub fn uiColorButtonColor(b: *mut uiColorButton,
r: *mut c_double,
Expand All @@ -733,4 +707,3 @@ extern {
data: *mut c_void);
pub fn uiNewColorButton() -> *mut uiColorButton;
}

Loading