Skip to content

Commit

Permalink
fixes for mac build; initial ide setup, editor font; new readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Rochus Keller committed Jul 13, 2021
1 parent 3f66c07 commit 2dba618
Show file tree
Hide file tree
Showing 109 changed files with 330 additions and 3,164 deletions.
29 changes: 19 additions & 10 deletions OBXLJ.pro
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ DEFINES += OBX_BBOX

include( ObxParser.pri )

DEFINES += _LJTOOLS_DONT_CREATE_TAIL_CALLS # crashes otherwise in are-we-fast-yet runall
DEFINES += LUA_ENGINE_USE_DEFAULT_PRINT
#DEFINES += _LJTOOLS_DONT_CREATE_TAIL_CALLS

SOURCES += \
ObxLjMain.cpp \
Expand Down Expand Up @@ -76,17 +77,25 @@ CONFIG(debug, debug|release) {
DEFINES += _DEBUG
}

INCLUDEPATH += .. ../LjTools/luajit-2.0
DEFINES += LUA_ENGINE_USE_DEFAULT_PRINT

include( ../LuaJIT/src/LuaJit.pri ){
LIBS += -ldl
} else {
LIBS += -lluajit
win32 {
INCLUDEPATH += .. ../LjTools/luajit-2.0
LIBS += -L../LuaJIT/src -llua51
}

QMAKE_LFLAGS += -rdynamic -ldl
#rdynamic is required so that the LjLibFfi functions are visible to LuaJIT FFI
linux {
include( ../LuaJIT/src/LuaJit.pri ){
LIBS += -ldl
} else {
LIBS += -lluajit
}

QMAKE_LFLAGS += -rdynamic -ldl
#rdynamic is required so that the LjLibFfi functions are visible to LuaJIT FFI
}
macx {
include( ../LuaJIT/src/LuaJit.pri )
QMAKE_LFLAGS += -rdynamic -ldl -pagezero_size 10000 -image_base 100000000
}


RESOURCES += \
Expand Down
38 changes: 28 additions & 10 deletions ObxIde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ class Ide::Editor : public CodeEditor
setPaintIndents(false);
d_hl = new Highlighter( document() );
updateTabWidth();
QSettings set;
if( !set.contains("CodeEditor/Font") )
{
QFont monospace("Monospace",9);
if( !monospace.exactMatch() )
{
monospace = QFont("DejaVu Sans Mono",9);
monospace.setStyleName("Book");
}
setFont(monospace);
}
}

~Editor()
Expand Down Expand Up @@ -511,15 +522,15 @@ Ide::Ide(QWidget *parent)

enableDbgMenu();

createTerminal();
createDumpView();
createMods();
createMod();
createHier();
createErrs();
createXref();
createStack();
createErrs();
createDumpView();
createLocals();
createStack();
createTerminal();
createMenu();

setCentralWidget(d_tab);
Expand Down Expand Up @@ -598,11 +609,13 @@ void Ide::createTerminal()
dock->setWidget(d_term);
addDockWidget( Qt::BottomDockWidgetArea, dock );
new Gui::AutoShortcut( tr("CTRL+SHIFT+C"), this, d_term, SLOT(onClear()) );
connect( d_rt->getLua(), SIGNAL(onNotify(int,QByteArray,int)), dock, SLOT(show()) );
}

void Ide::createDumpView()
{
QDockWidget* dock = new QDockWidget( tr("Bytecode"), this );
dock->setVisible(false);
dock->setObjectName("Bytecode");
dock->setAllowedAreas( Qt::AllDockWidgetAreas );
dock->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable );
Expand Down Expand Up @@ -735,6 +748,7 @@ void Ide::createXref()
void Ide::createStack()
{
QDockWidget* dock = new QDockWidget( tr("Stack"), this );
dock->setVisible(false);
dock->setObjectName("Stack");
dock->setAllowedAreas( Qt::AllDockWidgetAreas );
dock->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable );
Expand All @@ -747,13 +761,14 @@ void Ide::createStack()
d_stack->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents);
d_stack->header()->setSectionResizeMode(3, QHeaderView::Stretch);
dock->setWidget(d_stack);
addDockWidget( Qt::LeftDockWidgetArea, dock );
addDockWidget( Qt::RightDockWidgetArea, dock );
connect( d_stack, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(onStackDblClicked(QTreeWidgetItem*,int)) );
}

void Ide::createLocals()
{
QDockWidget* dock = new QDockWidget( tr("Locals"), this );
dock->setVisible(false);
dock->setObjectName("Locals");
dock->setAllowedAreas( Qt::AllDockWidgetAreas );
dock->setFeatures( QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable );
Expand All @@ -764,7 +779,7 @@ void Ide::createLocals()
d_locals->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
d_locals->header()->setSectionResizeMode(1, QHeaderView::Stretch);
dock->setWidget(d_locals);
addDockWidget( Qt::LeftDockWidgetArea, dock );
addDockWidget( Qt::RightDockWidgetArea, dock );
}

void Ide::createMenu()
Expand All @@ -787,7 +802,7 @@ void Ide::createMenu()
pop->addCommand( "Remove Import Path...", this, SLOT(onRemoveDir()) );
pop->addSeparator();
pop->addCommand( "Built-in Oakwood", this, SLOT(onOakwood()) );
pop->addCommand( "Built-in Oberon System Inner", this, SLOT(onObSysInner()) );
pop->addCommand( "Built-in Oberon Sys. Inner Mod.", this, SLOT(onObSysInner()) );
pop->addCommand( "Set Working Directory...", this, SLOT( onWorkingDir() ) );
pop->addSeparator();
pop->addCommand( "Compile", this, SLOT(onCompile()), tr("CTRL+T"), false );
Expand Down Expand Up @@ -855,7 +870,7 @@ void Ide::createMenuBar()
pop->addCommand( "Remove Module...", this, SLOT(onRemoveFile()) );
pop->addSeparator();
pop->addCommand( "Built-in Oakwood", this, SLOT(onOakwood()) );
pop->addCommand( "Built-in Oberon System Inner", this, SLOT(onObSysInner()) );
pop->addCommand( "Built-in Oberon System Inner Modules", this, SLOT(onObSysInner()) );
pop->addCommand( "Set Working Directory...", this, SLOT( onWorkingDir() ) );

pop = new Gui::AutoMenu( tr("Build && Run"), this );
Expand Down Expand Up @@ -2183,6 +2198,7 @@ void Ide::fillLocals()
if( d_rt->getLua()->getMode() == Lua::Engine2::PcMode )
{
fillRawLocals(d_locals, d_rt->getLua());
d_locals->parentWidget()->show();
return;
}

Expand Down Expand Up @@ -2244,6 +2260,7 @@ void Ide::fillLocals()
#if 0 // TEST, usually 0
fillRawLocals(d_locals, d_rt->getLua());
#endif
d_locals->parentWidget()->show();
}

static inline Type* derefed( Type* type )
Expand Down Expand Up @@ -3062,8 +3079,9 @@ int main(int argc, char *argv[])
a.setOrganizationName("me@rochus-keller.ch");
a.setOrganizationDomain("github.com/rochus-keller/Oberon");
a.setApplicationName("Oberon+ IDE");
a.setApplicationVersion("0.7.25");
a.setStyle("Fusion");
a.setApplicationVersion("0.8");
a.setStyle("Fusion");
QFontDatabase::addApplicationFont(":/font/DejaVuSansMono.ttf"); // "DejaVu Sans Mono"

Ide w;
if( a.arguments().size() > 1 )
Expand Down
1 change: 1 addition & 0 deletions ObxIde.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@
<file>images/marker.png</file>
<file>images/alias_priv.png</file>
<file>images/alias.png</file>
<file>font/DejaVuSansMono.ttf</file>
</qresource>
</RCC>
2 changes: 1 addition & 1 deletion ObxLjMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ int main(int argc, char *argv[])
a.setOrganizationName("Rochus Keller");
a.setOrganizationDomain("https://github.com/rochus-keller/Oberon");
a.setApplicationName("OBXLJ");
a.setApplicationVersion("2021-07-12");
a.setApplicationVersion("2021-07-13");

QTextStream out(stdout);
out << "OBXLJ version: " << a.applicationVersion() <<
Expand Down
Loading

0 comments on commit 2dba618

Please sign in to comment.