diff --git a/dlangide-monod-linux.dproj b/dlangide-monod-linux.dproj index 66e9e98..602b037 100644 --- a/dlangide-monod-linux.dproj +++ b/dlangide-monod-linux.dproj @@ -165,6 +165,30 @@ true 0 + + bin\DebugX11 + + + USE_X11 + USE_FREETYPE + USE_GDB_DEBUG + EmbedStandardResources + + + obj/DebugX11 + true + -L-lX11 + -Jviews +-Jviews/res +-Jviews/res/i18n +-Jviews/res/mdpi +-Jviews/res/hdpi + false + dlangide-monod-linux + Executable + true + 0 + diff --git a/dlangide-monod-linux.sln b/dlangide-monod-linux.sln index b7e62bd..ba2f7dc 100644 --- a/dlangide-monod-linux.sln +++ b/dlangide-monod-linux.sln @@ -13,6 +13,8 @@ Project("{3947E667-4C90-4C3A-BEB9-7148D6FE0D7C}") = "tetris-monod-linux", "..\dl EndProject Project("{3947E667-4C90-4C3A-BEB9-7148D6FE0D7C}") = "dmledit-monod-linux", "..\dlangui\examples\dmledit\dmledit-monod-linux.dproj", "{075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}" EndProject +Project("{3947E667-4C90-4C3A-BEB9-7148D6FE0D7C}") = "disowntty", "tools\disowntty\disowntty.dproj", "{FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,12 +23,15 @@ Global DebugMinimal|Any CPU = DebugMinimal|Any CPU ReleaseMinimal|Any CPU = ReleaseMinimal|Any CPU UnittestMinimal|Any CPU = UnittestMinimal|Any CPU + DebugX11|Any CPU = DebugX11|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.Debug|Any CPU.ActiveCfg = Debug|x64 {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.Debug|Any CPU.Build.0 = Debug|x64 {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.DebugMinimal|Any CPU.ActiveCfg = DebugMinimal|x64 {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.DebugMinimal|Any CPU.Build.0 = DebugMinimal|x64 + {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.DebugX11|Any CPU.ActiveCfg = DebugX11|x64 + {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.DebugX11|Any CPU.Build.0 = DebugX11|x64 {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.Release|Any CPU.ActiveCfg = Release|x64 {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.Release|Any CPU.Build.0 = Release|x64 {075C374A-563A-4CAC-9E9F-0B6E1DFEAEC3}.ReleaseMinimal|Any CPU.ActiveCfg = ReleaseMinimal|x64 @@ -39,6 +44,8 @@ Global {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.Debug|Any CPU.Build.0 = Debug|x64 {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.DebugMinimal|Any CPU.ActiveCfg = DebugMinimal|x64 {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.DebugMinimal|Any CPU.Build.0 = DebugMinimal|x64 + {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.DebugX11|Any CPU.ActiveCfg = DebugX11|x64 + {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.DebugX11|Any CPU.Build.0 = DebugX11|x64 {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.Release|Any CPU.ActiveCfg = Release|x64 {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.Release|Any CPU.Build.0 = Release|x64 {0A3A0D08-E4DC-418E-B92B-561CC91C2306}.ReleaseMinimal|Any CPU.ActiveCfg = ReleaseMinimal|x64 @@ -51,6 +58,8 @@ Global {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Debug|Any CPU.Build.0 = Debug|x64 {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.DebugMinimal|Any CPU.ActiveCfg = DebugMinimal|x64 {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.DebugMinimal|Any CPU.Build.0 = DebugMinimal|x64 + {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.DebugX11|Any CPU.ActiveCfg = DebugX11|x64 + {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.DebugX11|Any CPU.Build.0 = DebugX11|x64 {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Release|Any CPU.ActiveCfg = Release|x64 {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.Release|Any CPU.Build.0 = Release|x64 {54BDE028-6064-4CA9-B6CA-4C0BEEE70F24}.ReleaseMinimal|Any CPU.ActiveCfg = ReleaseMinimal|x64 @@ -63,6 +72,8 @@ Global {85ECF79F-B75F-4459-8A90-3857961F2029}.Debug|Any CPU.Build.0 = Debug|x64 {85ECF79F-B75F-4459-8A90-3857961F2029}.DebugMinimal|Any CPU.ActiveCfg = DebugMinimal|x64 {85ECF79F-B75F-4459-8A90-3857961F2029}.DebugMinimal|Any CPU.Build.0 = DebugMinimal|x64 + {85ECF79F-B75F-4459-8A90-3857961F2029}.DebugX11|Any CPU.ActiveCfg = DebugX11|x64 + {85ECF79F-B75F-4459-8A90-3857961F2029}.DebugX11|Any CPU.Build.0 = DebugX11|x64 {85ECF79F-B75F-4459-8A90-3857961F2029}.Release|Any CPU.ActiveCfg = Release|x64 {85ECF79F-B75F-4459-8A90-3857961F2029}.Release|Any CPU.Build.0 = Release|x64 {85ECF79F-B75F-4459-8A90-3857961F2029}.ReleaseMinimal|Any CPU.ActiveCfg = ReleaseMinimal|x64 @@ -75,6 +86,8 @@ Global {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.Debug|Any CPU.Build.0 = Debug|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.DebugMinimal|Any CPU.ActiveCfg = DebugMinimal|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.DebugMinimal|Any CPU.Build.0 = DebugMinimal|x64 + {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.DebugX11|Any CPU.ActiveCfg = DebugX11|x64 + {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.DebugX11|Any CPU.Build.0 = DebugX11|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.Release|Any CPU.ActiveCfg = Release|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.Release|Any CPU.Build.0 = Release|x64 {8E722D80-CF8D-4D98-BEAE-7BC9E6752AC4}.ReleaseMinimal|Any CPU.ActiveCfg = ReleaseMinimal|x64 @@ -87,6 +100,8 @@ Global {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Debug|Any CPU.Build.0 = Debug|x64 {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.DebugMinimal|Any CPU.ActiveCfg = DebugMinimal|x64 {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.DebugMinimal|Any CPU.Build.0 = DebugMinimal|x64 + {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.DebugX11|Any CPU.ActiveCfg = DebugX11|x64 + {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.DebugX11|Any CPU.Build.0 = DebugX11|x64 {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Release|Any CPU.ActiveCfg = Release|x64 {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Release|Any CPU.Build.0 = Release|x64 {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.ReleaseMinimal|Any CPU.ActiveCfg = ReleaseMinimal|x64 @@ -95,5 +110,19 @@ Global {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.Unittest|Any CPU.Build.0 = Unittest|x64 {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.UnittestMinimal|Any CPU.ActiveCfg = UnittestMinimal|x64 {A38BEF21-AAFE-4115-A978-63B7C8C2FBD1}.UnittestMinimal|Any CPU.Build.0 = UnittestMinimal|x64 + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.DebugMinimal|Any CPU.ActiveCfg = Debug|Any CPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.DebugMinimal|Any CPU.Build.0 = Debug|Any CPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.DebugX11|Any CPU.ActiveCfg = Debug|Any CPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.DebugX11|Any CPU.Build.0 = Debug|Any CPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.Release|Any CPU.Build.0 = Release|Any CPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.ReleaseMinimal|Any CPU.ActiveCfg = Debug|Any CPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.ReleaseMinimal|Any CPU.Build.0 = Debug|Any CPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.Unittest|Any CPU.ActiveCfg = Unittest|Any CPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.Unittest|Any CPU.Build.0 = Unittest|Any CPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.UnittestMinimal|Any CPU.ActiveCfg = Debug|Any CPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332}.UnittestMinimal|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection EndGlobal diff --git a/src/dlangide/ui/newproject.d b/src/dlangide/ui/newproject.d index 0f02d49..deeabb6 100644 --- a/src/dlangide/ui/newproject.d +++ b/src/dlangide/ui/newproject.d @@ -4,6 +4,10 @@ import dlangui.core.types; import dlangui.core.i18n; import dlangui.platforms.common.platform; import dlangui.dialogs.dialog; +import dlangui.widgets.widget; +import dlangui.widgets.layouts; +import dlangui.widgets.editors; +import dlangui.dml.parser; class NewProjectDlg : Dialog { @@ -18,6 +22,54 @@ class NewProjectDlg : Dialog { /// override to implement creation of dialog controls override void init() { super.init(); + Widget content = parseML(q{ + VerticalLayout { + id: vlayout + HorizontalLayout { + VerticalLayout { + layoutWidth: FILL_PARENT; layoutHeight: FILL_PARENT; layoutWidth: 1 + TextWidget { + text: "Project type" + } + } + VerticalLayout { + layoutWidth: FILL_PARENT; layoutWeight: FILL_PARENT; layoutWidth: 1 + TextWidget { + text: "Template" + } + } + VerticalLayout { + layoutWidth: FILL_PARENT; layoutWeight: FILL_PARENT; layoutWidth: 1 + TextWidget { + text: "Description" + } + } + } + margins: Rect { left: 5; right: 3; top: 2; bottom: 4 } + padding: Rect { 5, 4, 3, 2 } // same as Rect { left: 5; top: 4; right: 3; bottom: 2 } + TextWidget { + /* this widget can be accessed via id myLabel1 + e.g. w.childById!TextWidget("myLabel1") + */ + id: myLabel1 + text: "Some text"; padding: 5 + enabled: false + } + TextWidget { + id: myLabel2 + text: "More text"; margins: 5 + enabled: true + } + CheckBox{ id: cb1; text: "Some checkbox" } + HorizontalLayout { + RadioButton { id: rb1; text: "Radio Button 1" } + RadioButton { id: rb1; text: "Radio Button 2" } + } + } + }); + // you can access loaded items by id - e.g. to assign signal listeners + auto edit1 = window.mainWidget.childById!EditLine("edit1"); + } } diff --git a/src/dlangide/ui/settings.d b/src/dlangide/ui/settings.d index ef7e733..aea0be8 100644 --- a/src/dlangide/ui/settings.d +++ b/src/dlangide/ui/settings.d @@ -142,7 +142,10 @@ SettingsPage createSettingsPages() { texted.addCheckbox("editors/textEditor/useSpacesForTabs", UIString("Use spaces for tabs"d)); texted.addCheckbox("editors/textEditor/smartIndents", UIString("Smart indents"d)); texted.addCheckbox("editors/textEditor/smartIndentsAfterPaste", UIString("Smart indent after paste"d)); - SettingsPage ui = res.addChild("interface", UIString("Interface"d)); + SettingsPage dlang = res.addChild("dlang", UIString("D"d)); + SettingsPage ddebug = dlang.addChild("dlang/debugger", UIString("Debugger"d)); + ddebug.addStringEdit("dlang/debugger/executable", UIString("Debugger executable"d), "gdb"); + SettingsPage ui = res.addChild("interface", UIString("Interface"d)); ui.addStringComboBox("interface/theme", UIString("Theme"d), [ StringListValue("ide_theme_default", "Default"d), StringListValue("ide_theme_dark", "Dark"d)]); diff --git a/tools/disowntty/disowntty.d b/tools/disowntty/disowntty.d new file mode 100644 index 0000000..dace944 --- /dev/null +++ b/tools/disowntty/disowntty.d @@ -0,0 +1,65 @@ +/* tty;exec disowntty */ +//#include +//#include +//#include +//#include +//#include +//#include + +//import std.stdio; +import std.string; +import std.c.stdlib; +import core.thread; +import core.sys.posix.signal; +import core.sys.posix.sys.ioctl; +import core.sys.posix.unistd; +import core.sys.posix.stdio; + +//extern(C) void signal(int sig, void function(int) ); +//extern(C) void setbuf(FILE * stream, char * buf); +//extern(C) void ioctl(int fd, uint request, int param); + +void end(string msg) +{ + perror(msg.toStringz); + for (;;) + Thread.sleep(dur!"seconds"(1)); +} + +alias extern(C) void function(int) sigfn_t; + +void main(string args[]) +{ + FILE *tty_name_file; + if (args.length < 2) + exit(1); + + string tty_filename = args[1]; + + sigfn_t orig; + setbuf (stdout, null); + orig = signal (SIGHUP, SIG_IGN); + if (orig !is SIG_DFL) + end ("signal (SIGHUP)"); + + printf("%s %s\n", tty_filename.toStringz, ttyname(STDIN_FILENO)); + tty_name_file = fopen(tty_filename.toStringz, "w"); + fprintf(tty_name_file, "%s\n", ttyname(STDIN_FILENO)); + fclose(tty_name_file); + + /* Verify we are the sole owner of the tty. */ + if (ioctl(STDIN_FILENO, TIOCSCTTY, 0) != 0) + end ("TIOCSCTTY"); + + printf("%s %s\n", tty_filename.toStringz, ttyname(STDIN_FILENO)); + tty_name_file = fopen(tty_filename.toStringz, "w"); + fprintf(tty_name_file, "%s\n", ttyname(STDIN_FILENO)); + fclose(tty_name_file); + + /* Disown the tty. */ + if (ioctl (STDIN_FILENO, TIOCNOTTY) != 0) + end ("TIOCNOTTY"); + end ("OK, disowned"); + + exit(1); +} diff --git a/tools/disowntty/disowntty.dproj b/tools/disowntty/disowntty.dproj new file mode 100644 index 0000000..1b1c4b9 --- /dev/null +++ b/tools/disowntty/disowntty.dproj @@ -0,0 +1,48 @@ + + + + Debug + AnyCPU + {FB7A3FF6-0E67-47D1-BA70-F258F9A0E332} + . + DMD2 + true + true + true + + + true + bin\Debug + obj/Debug + false + false + disowntty + Executable + true + 0 + + + bin\Release + obj/Release + false + false + disowntty + Executable + true + 0 + + + true + bin\Unittest + obj/Unittest + false + true + disowntty + Executable + true + 0 + + + + + \ No newline at end of file