Skip to content

Commit

Permalink
First source code files
Browse files Browse the repository at this point in the history
  • Loading branch information
Héctor Barreras Almarcha committed Jun 29, 2016
1 parent 0f387b8 commit 1bceff4
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ docs/

# Code coverage
*.lst

#Project custom
out/
19 changes: 19 additions & 0 deletions dub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "puppeteer-gui",
"description": "GUI frontend for the puppeteer library",

"authors": ["Héctor Barreras Almarcha @Dechcaudron"],
"license": "GPL-3.0",

"dependencies" : {
"puppeteer" : "~>0.6.0",
"gtk-d": "~>3.3.1",
"ggplotd": "~>0.9.4"
},

"subConfigurations": {

},

"targetPath" : "out"
}
20 changes: 20 additions & 0 deletions dub.selections.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"fileVersion": 1,
"versions": {
"arith-eval": "0.4.0",
"painlesstraits": "0.2.0",
"cairod": "0.0.1-alpha.3+1.10.2",
"gtk-d": "3.3.1",
"x11": "1.0.14",
"derelict-ft": "1.0.2",
"puppeteer": "0.6.0",
"ggplotd": "0.9.4",
"pegged": "0.3.2",
"derelict-util": "2.0.6",
"windows-headers": "1.0.1",
"dstats": "1.0.3",
"onyx-serial": "0.5.0",
"onyx-config": "2.0.5",
"dunit": "1.0.12"
}
}
12 changes: 12 additions & 0 deletions source/app.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import std.stdio;
import puppeteer_gui.gui.igui;

void main(string[] args)
{
IGUI gui = IGUI.getInstance(args);

IWindow mainWindow = gui.createMainWindow("Main");
mainWindow.show();

gui.run();
}
65 changes: 65 additions & 0 deletions source/puppeteer_gui/gui/gtkd/wrapper.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
module puppeteer_gui.gui.gtkd.wrapper;

import puppeteer_gui.gui.igui;

import gtk.Main;

public class GTKGuiWrapper : IGUI
{
this(string[] args)
{
Main.init(args);
}

public IWindow createMainWindow(string title)
{
return new GTKMainWindow(title);
}

public IWindow createWindow(string title)
{
return new GTKWindow(title);
}

public void run()
{
Main.run();
}
}

private class GTKWindow : IWindow
{
import gtk.Window;

Window window;

this(string title)
{
generateWindow(title);
}

void generateWindow(string title)
{
window = new Window(title);
}

void show()
{
window.show();
}
}

private class GTKMainWindow : GTKWindow
{
import gtk.MainWindow;

this(string title)
{
super(title);
}

override void generateWindow(string title)
{
window = new MainWindow(title);
}
}
21 changes: 21 additions & 0 deletions source/puppeteer_gui/gui/igui.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module puppeteer_gui.gui.igui;

import puppeteer_gui.gui.gtkd.wrapper;

public interface IGUI
{
static IGUI getInstance(string[] args)
{
return new GTKGuiWrapper(args);
}

IWindow createMainWindow(string title);
IWindow createWindow(string title);

void run();
}

public interface IWindow
{
void show();
}

0 comments on commit 1bceff4

Please sign in to comment.