Skip to content

Commit

Permalink
v106.189
Browse files Browse the repository at this point in the history
* updated Cirrus CI rules
* hiro improvements
* XShm fix
  • Loading branch information
byuu committed Jul 31, 2019
1 parent 982988d commit c30cb01
Show file tree
Hide file tree
Showing 24 changed files with 217 additions and 107 deletions.
58 changes: 31 additions & 27 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,23 @@ linux-x86_64-binaries_task:
- apt-get update && apt-get -y install build-essential libgtk2.0-dev libpulse-dev mesa-common-dev libgtksourceview2.0-dev libcairo2-dev libsdl2-dev libxv-dev libao-dev libopenal-dev libudev-dev zip

compile_script:
- make -C higan
- make -C higan local=false
- make -C icarus
- make -C genius

package_script:
- mkdir higan-nightly
- cp -a higan/out/higan higan-nightly/higan
- cp -a higan/System/ higan-nightly/
- cp -a higan/System/ higan-nightly
- cp -a icarus/out/icarus higan-nightly/icarus
- cp -a icarus/Database higan-nightly/
- cp -a icarus/Firmware higan-nightly/
- cp -a icarus/Database higan-nightly
- cp -a icarus/Firmware higan-nightly
- cp -a genius/out/genius higan-nightly/genius
- cp -a GPLv3.txt higan-nightly/
- cp -a GPLv3.txt higan-nightly
- zip -r higan-nightly.zip higan-nightly

higan-nightly_artifacts:
path: "higan-nightly/**"
path: "higan-nightly.zip"

freebsd-x86_64-binaries_task:
freebsd_instance:
Expand All @@ -31,62 +32,65 @@ freebsd-x86_64-binaries_task:
- pkg install --yes gmake gdb gcc8 pkgconf sdl2 openal-soft gtksourceview2 libXv zip

compile_script:
- gmake -C higan
- gmake -C higan local=false
- gmake -C icarus
- gmake -C genius

package_script:
- mkdir higan-nightly
- cp -a higan/out/higan higan-nightly/higan
- cp -a higan/System/ higan-nightly/
- cp -a higan/System/ higan-nightly
- cp -a icarus/out/icarus higan-nightly/icarus
- cp -a icarus/Database higan-nightly/
- cp -a icarus/Firmware higan-nightly/
- cp -a icarus/Database higan-nightly
- cp -a icarus/Firmware higan-nightly
- cp -a genius/out/genius higan-nightly/genius
- cp -a GPLv3.txt higan-nightly/
- cp -a GPLv3.txt higan-nightly
- zip -r higan-nightly.zip higan-nightly

higan-nightly_artifacts:
path: "higan-nightly/**"
path: "higan-nightly.zip"

windows-x86_64-binaries_task:
container:
image: ubuntu:latest

setup_script:
- apt-get update && apt-get -y install build-essential mingw-w64
- apt-get update && apt-get -y install build-essential mingw-w64 zip

compile_script:
- make -C higan platform=windows compiler="x86_64-w64-mingw32-g++" windres="x86_64-w64-mingw32-windres"
- make -C higan local=false platform=windows compiler="x86_64-w64-mingw32-g++" windres="x86_64-w64-mingw32-windres"
- make -C icarus platform=windows compiler="x86_64-w64-mingw32-g++" windres="x86_64-w64-mingw32-windres"

package_script:
- mkdir higan-nightly
- cp -a higan/out/higan higan-nightly/higan.exe
- cp -a higan/System/ higan-nightly/
- cp -a higan/System/ higan-nightly
- cp -a icarus/out/icarus higan-nightly/icarus.exe
- cp -a icarus/Database higan-nightly/
- cp -a icarus/Firmware higan-nightly/
- cp -a GPLv3.txt higan-nightly/
- cp -a icarus/Database higan-nightly
- cp -a icarus/Firmware higan-nightly
- cp -a GPLv3.txt higan-nightly
- zip -r higan-nightly.zip higan-nightly

higan-nightly_artifacts:
path: "higan-nightly/**"
path: "higan-nightly.zip"

macOS-x86_64-binaries_task:
osx_instance:
image: mojave-base

compile_script:
- make -C higan
- make -C higan local=false
- make -C icarus

package_script:
- mkdir higan-nightly
- cp -a higan/out/higan.app higan-nightly/
- cp -a higan/System/ higan-nightly/
- cp -a icarus/out/icarus.app higan-nightly/
- cp -a icarus/Database higan-nightly/
- cp -a icarus/Firmware higan-nightly/
- cp -a GPLv3.txt higan-nightly/
- cp -a higan/out/higan.app higan-nightly
- cp -a higan/System/ higan-nightly
- cp -a icarus/out/icarus.app higan-nightly
- cp -a icarus/Database higan-nightly
- cp -a icarus/Firmware higan-nightly
- cp -a GPLv3.txt higan-nightly
- zip -r higan-nightly.zip higan-nightly

higan-nightly_artifacts:
path: "higan-nightly/**"
path: "higan-nightly.zip"
16 changes: 10 additions & 6 deletions higan/GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
target := higan
build := performance
openmp := false
local := true
flags += -I. -I..

nall.path := ../nall
include $(nall.path)/GNUmakefile

ifeq ($(platform),local)
flags += -march=native
endif

ifeq ($(platform),windows)
link += -luuid -lkernel32 -luser32 -lgdi32 -lcomctl32 -lcomdlg32 -lshell32
link += -Wl,-enable-auto-import
link += -Wl,-enable-runtime-pseudo-reloc
options += -luuid -lkernel32 -luser32 -lgdi32 -lcomctl32 -lcomdlg32 -lshell32
options += -Wl,-enable-auto-import
options += -Wl,-enable-runtime-pseudo-reloc
else ifeq ($(platform),macos)
else ifneq ($(filter $(platform),linux bsd),)
flags += -march=native
link += -Wl,-export-dynamic
link += -lX11 -lXext
options += -Wl,-export-dynamic
options += -lX11 -lXext
else
$(error "unsupported platform")
endif
Expand Down
2 changes: 1 addition & 1 deletion higan/emulator/emulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ using namespace nall;

namespace higan {
static const string Name = "higan";
static const string Version = "106.188";
static const string Version = "106.189";
static const string Author = "byuu";
static const string License = "GPLv3";
static const string Website = "https://byuu.org";
Expand Down
2 changes: 1 addition & 1 deletion higan/target-higan/program/input-mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ InputMapper::InputMapper(View* view) : Panel(view, Size{~0, ~0}) {
setCollapsible().setVisible(false);
nameLabel.setFont(Font().setBold());
inputList.setBatchable();
inputList.onActivate([&] { eventAssign(); });
inputList.onActivate([&](auto cell) { eventAssign(); });
inputList.onChange([&] { eventChange(); });
mouseXaxis.setText("Mouse X-axis").setCollapsible().onActivate([&] { eventAssignMouse(0, 0); });
mouseYaxis.setText("Mouse Y-axis").setCollapsible().onActivate([&] { eventAssignMouse(0, 1); });
Expand Down
2 changes: 1 addition & 1 deletion higan/target-higan/settings/hotkeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HotkeySettings::HotkeySettings(View* parent) : Panel(parent, Size{~0, ~0}) {

headerLabel.setText("Hotkeys").setFont(Font().setBold());
hotkeyList.setBatchable();
hotkeyList.onActivate([&] { eventAssign(); });
hotkeyList.onActivate([&](auto cell) { eventAssign(); });
hotkeyList.onChange([&] { eventChange(); });
assignButton.setText("Assign").onActivate([&] { eventAssign(); });
clearButton.setText("Clear").onActivate([&] { eventClear(); });
Expand Down
8 changes: 4 additions & 4 deletions hiro/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@ ifneq ($(filter $(platform),linux bsd),)

ifeq ($(hiro),gtk2)
hiro.flags = $(flags.cpp) -DHIRO_GTK=2 $(shell pkg-config --cflags gtk+-2.0 gtksourceview-2.0)
hiro.options = -lX11 $(shell pkg-config --libs gtk+-2.0 gtksourceview-2.0)
hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs gtk+-2.0 gtksourceview-2.0)
endif

ifeq ($(hiro),gtk3)
hiro.flags = $(flags.cpp) -DHIRO_GTK=3 $(shell pkg-config --cflags gtk+-3.0 gtksourceview-3.0) -Wno-deprecated-declarations
hiro.options = -lX11 $(shell pkg-config --libs gtk+-3.0 gtksourceview-3.0)
hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs gtk+-3.0 gtksourceview-3.0)
endif

ifeq ($(hiro),qt4)
moc = /usr/local/lib/qt4/bin/moc
hiro.flags = $(flags.cpp) -DHIRO_QT=4 $(shell pkg-config --cflags QtCore QtGui)
hiro.options = -lX11 $(shell pkg-config --libs QtCore QtGui)
hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs QtCore QtGui)
endif

ifeq ($(hiro),qt5)
moc = /usr/local/lib/qt5/bin/moc
hiro.flags = $(flags.cpp) -DHIRO_QT=5 -fPIC $(shell pkg-config --cflags Qt5Core Qt5Gui Qt5Widgets)
hiro.options = -lX11 $(shell pkg-config --libs Qt5Core Qt5Gui Qt5Widgets)
hiro.options = -L/usr/local/lib -lX11 $(shell pkg-config --libs Qt5Core Qt5Gui Qt5Widgets)
endif
endif

Expand Down
34 changes: 24 additions & 10 deletions hiro/cocoa/widget/table-view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-(id) initWith:(hiro::mTableView&)tableViewReference {
if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) {
tableView = &tableViewReference;
content = [[CocoaTableViewContent alloc] initWithFrame:NSMakeRect(0, 0, 0, 0)];
content = [[CocoaTableViewContent alloc] initWith:tableViewReference];

[self setDocumentView:content];
[self setBorderType:NSBezelBorder];
Expand Down Expand Up @@ -110,26 +110,40 @@
tableView->doChange();
}

-(IBAction) activate:(id)sender {
tableView->doActivate();
}

-(IBAction) doubleAction:(id)sender {
if([content clickedRow] >= 0) {
[self activate:self];
int row = [content clickedRow];
if(row >= 0 && row < tableView->state.items.size()) {
int column = [content clickedColumn];
if(column >= 0 && column < tableView->state.columns.size()) {
auto item = tableView->state.items[row];
auto cell = item->cell(column);
tableView->doActivate(cell);
}
}
}

@end

@implementation CocoaTableViewContent : NSTableView

-(id) initWith:(hiro::mTableView&)tableViewReference {
if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) {
tableView = &tableViewReference;
}
return self;
}

-(void) keyDown:(NSEvent*)event {
auto character = [[event characters] characterAtIndex:0];
if(character == NSEnterCharacter || character == NSCarriageReturnCharacter) {
if([self selectedRow] >= 0) {
[[self delegate] activate:self];
return;
int row = [self selectedRow];
if(row >= 0 && row < tableView->state.items.size()) {
int column = max(0, [self selectedColumn]); //can be -1?
if(column >= 0 && column < tableView->state.columns.size()) {
auto item = tableView->state.items[row];
auto cell = item->cell(column);
tableView->doActivate(cell);
}
}
}

Expand Down
5 changes: 3 additions & 2 deletions hiro/cocoa/widget/table-view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
CocoaTableViewContent* content;
NSFont* font;
}
-(id) initWith:(hiro::mTableView&)tableView;
-(id) initWith:(hiro::mTableView&)tableViewReference;
-(void) dealloc;
-(CocoaTableViewContent*) content;
-(NSFont*) font;
Expand All @@ -20,12 +20,13 @@
-(NSString*) tableView:(NSTableView*)table toolTipForCell:(NSCell*)cell rect:(NSRectPointer)rect tableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row mouseLocation:(NSPoint)mouseLocation;
-(void) tableView:(NSTableView*)tableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)tableColumn row:(NSInteger)row;
-(void) tableViewSelectionDidChange:(NSNotification*)notification;
-(IBAction) activate:(id)sender;
-(IBAction) doubleAction:(id)sender;
@end

@interface CocoaTableViewContent : NSTableView {
hiro::mTableView* tableView;
}
-(id) initWith:(hiro::mTableView&)tableViewReference;
-(void) keyDown:(NSEvent*)event;
@end

Expand Down
4 changes: 2 additions & 2 deletions hiro/core/shared.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ struct TableView : sTableView {
auto column(uint position) const { return self().column(position); }
auto columnCount() const { return self().columnCount(); }
auto columns() const { return self().columns(); }
auto doActivate() const { return self().doActivate(); }
auto doActivate(sTableViewCell cell) const { return self().doActivate(cell); }
auto doChange() const { return self().doChange(); }
auto doContext() const { return self().doContext(); }
auto doEdit(sTableViewCell cell) const { return self().doEdit(cell); }
Expand All @@ -711,7 +711,7 @@ struct TableView : sTableView {
auto item(unsigned position) const { return self().item(position); }
auto itemCount() const { return self().itemCount(); }
auto items() const { return self().items(); }
auto onActivate(const function<void ()>& callback = {}) { return self().onActivate(callback), *this; }
auto onActivate(const function<void (TableViewCell)>& callback = {}) { return self().onActivate(callback), *this; }
auto onChange(const function<void ()>& callback = {}) { return self().onChange(callback), *this; }
auto onContext(const function<void ()>& callback = {}) { return self().onContext(callback), *this; }
auto onEdit(const function<void (TableViewCell)>& callback = {}) { return self().onEdit(callback), *this; }
Expand Down
6 changes: 3 additions & 3 deletions hiro/core/widget/table-view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ auto mTableView::columns() const -> vector<TableViewColumn> {
return columns;
}

auto mTableView::doActivate() const -> void {
if(state.onActivate) return state.onActivate();
auto mTableView::doActivate(sTableViewCell cell) const -> void {
if(state.onActivate) return state.onActivate(cell);
}

auto mTableView::doChange() const -> void {
Expand Down Expand Up @@ -112,7 +112,7 @@ auto mTableView::items() const -> vector<TableViewItem> {
return items;
}

auto mTableView::onActivate(const function<void ()>& callback) -> type& {
auto mTableView::onActivate(const function<void (TableViewCell)>& callback) -> type& {
state.onActivate = callback;
return *this;
}
Expand Down
6 changes: 3 additions & 3 deletions hiro/core/widget/table-view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct mTableView : mWidget {
auto column(uint position) const -> TableViewColumn;
auto columnCount() const -> uint;
auto columns() const -> vector<TableViewColumn>;
auto doActivate() const -> void;
auto doActivate(sTableViewCell cell) const -> void;
auto doChange() const -> void;
auto doContext() const -> void;
auto doEdit(sTableViewCell cell) const -> void;
Expand All @@ -24,7 +24,7 @@ struct mTableView : mWidget {
auto item(uint position) const -> TableViewItem;
auto itemCount() const -> uint;
auto items() const -> vector<TableViewItem>;
auto onActivate(const function<void ()>& callback = {}) -> type&;
auto onActivate(const function<void (TableViewCell)>& callback = {}) -> type&;
auto onChange(const function<void ()>& callback = {}) -> type&;
auto onContext(const function<void ()>& callback = {}) -> type&;
auto onEdit(const function<void (TableViewCell)>& callback = {}) -> type&;
Expand Down Expand Up @@ -59,7 +59,7 @@ struct mTableView : mWidget {
Color foregroundColor;
bool headered = false;
vector<sTableViewItem> items;
function<void ()> onActivate;
function<void (TableViewCell)> onActivate;
function<void ()> onChange;
function<void ()> onContext;
function<void (TableViewCell)> onEdit;
Expand Down
Loading

0 comments on commit c30cb01

Please sign in to comment.