Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gnome docking library (gdl) fix #304 #312

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
7 changes: 5 additions & 2 deletions Build.d
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int main(string[] args)

foreach ( arg; args )
{
if ( !["gtkd", "gtkdgl", "sv", "gstreamer", "vte", "peas", "all"].canFind(arg) )
if ( !["gtkd", "gtkdgl", "sv", "gstreamer", "vte", "peas", "gdl", "all"].canFind(arg) )
{
writefln("Unknown option: %s", arg);
return 1;
Expand All @@ -87,7 +87,7 @@ int main(string[] args)
args = ["gtkd", "sv"];

if ( args.canFind("all") )
args = ["gtkd", "sv", "gstreamer", "peas"];
args = ["gtkd", "sv", "gstreamer", "peas", "gdl"];

foreach ( arg; args )
{
Expand All @@ -108,6 +108,9 @@ int main(string[] args)
case "peas":
build("generated\\peas", "peasd");
break;
case "gdl":
build("generated\\gdl", "gdld");
break;
default:
assert(false);
break;
Expand Down
53 changes: 47 additions & 6 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ SOURCES_PEASD = $(wildcard generated/peas/*/*.d) $(wildcard generated/peas/*/c/*
OBJECTS_PEASD = $(patsubst %.d,%.o,$(SOURCES_PEASD))
PICOBJECTS_PEASD = $(patsubst %.o,%.pic.o,$(OBJECTS_PEASD))

LIBNAME_GDLD = libgdld-$(MAJOR).a
SONAME_GDLD = libgdld-$(MAJOR).$(SO_POSTFIX)
SOURCES_GDLD = $(wildcard generated/gdl/*/*.d) $(wildcard generated/gdl/*/c/*.d)
OBJECTS_GDLD = $(patsubst %.d,%.o,$(SOURCES_GDLD))
PICOBJECTS_GDLD = $(patsubst %.o,%.pic.o,$(OBJECTS_GDLD))

#######################################################################

USE_RUNTIME_LINKER = $(shell grep "Linker" generated/gtkd/atk/c/functions.d)
Expand All @@ -132,6 +138,7 @@ ifeq ($(USE_RUNTIME_LINKER),)
SOFLAGS_GSTREAMERD = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).$(SO_POSTFIX) $(shell ${PKG_CONFIG} --libs-only-l --libs-only-L gstreamer-base-1.0 | sed 's/-[lL]/$(LINKERFLAG)&/g')
SOFLAGS_VTED = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).$(SO_POSTFIX) $(shell ${PKG_CONFIG} --libs-only-l --libs-only-L vte-2.91 | sed 's/-[lL]/$(LINKERFLAG)&/g')
SOFLAGS_PEASD = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).$(SO_POSTFIX) $(shell ${PKG_CONFIG} --libs-only-l --libs-only-L libpeas-1.0 | sed -e 's/-[lL]/$(LINKERFLAG)&/g')
SOFLAGS_GDLD = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).$(SO_POSTFIX) $(shell ${PKG_CONFIG} --libs-only-l --libs-only-L gdl-3.0 | sed -e 's/-[lL]/$(LINKERFLAG)&/g')
endif

#######################################################################
Expand Down Expand Up @@ -171,8 +178,8 @@ ifeq ("$(OS)","Darwin")
libs: gtkd
shared-libs: shared-gtkd
else
libs: gtkd sv gstreamer vte peas
shared-libs: shared-gtkd shared-sv shared-gstreamer shared-vte shared-peas
libs: gtkd sv gstreamer vte peas gdl
shared-libs: shared-gtkd shared-sv shared-gstreamer shared-vte shared-peas shared-gdl
endif

gtkd: $(LIBNAME_GTKD)
Expand All @@ -181,13 +188,15 @@ sv: $(LIBNAME_GTKDSV)
gstreamer: $(LIBNAME_GSTREAMERD)
vte: $(LIBNAME_VTED)
peas: $(LIBNAME_PEASD)
gdl: $(LIBNAME_GDLD)

shared-gtkd: $(SONAME_GTKD)
shared-gtkdgl: $(SONAME_GTKDGL)
shared-sv: $(SONAME_GTKDSV)
shared-gstreamer: $(SONAME_GSTREAMERD)
shared-vte: $(SONAME_VTED)
shared-peas: $(SONAME_PEASD)
shared-gdl: $(SONAME_GDLD)

#######################################################################

Expand Down Expand Up @@ -215,6 +224,10 @@ $(LIBNAME_PEASD): IMPORTS=-Igenerated/gtkd -Igenerated/peas
$(LIBNAME_PEASD): $(LIBNAME_GTKD) $(OBJECTS_PEASD)
$(make-lib)

$(LIBNAME_GDLD): IMPORTS=-Igenerated/gtkd -Igenerated/gdl
$(LIBNAME_GDLD): $(LIBNAME_GTKD) $(OBJECTS_GDLD)
$(make-lib)

#######################################################################

$(SONAME_GTKD): IMPORTS=-Igenerated/gtkd
Expand All @@ -241,6 +254,10 @@ $(SONAME_PEASD): IMPORTS=-Igenerated/gtkd -Igenerated/peas
$(SONAME_PEASD): $(SONAME_GTKD) $(PICOBJECTS_PEASD)
$(call make-shared-lib,$(SOFLAGS_PEASD))

$(SONAME_GDLD): IMPORTS=-Igenerated/gtkd -Igenerated/gdl
$(SONAME_GDLD): $(SONAME_GTKD) $(PICOBJECTS_GDLD)
$(call make-shared-lib,$(SOFLAGS_GDLD))

#######################################################################

# -Idemos
Expand Down Expand Up @@ -284,6 +301,7 @@ pkgconfig-sv: gtkdsv-$(MAJOR).pc
pkgconfig-gstreamer: gstreamerd-$(MAJOR).pc
pkgconfig-vte: vted-$(MAJOR).pc
pkgconfig-peas: peasd-$(MAJOR).pc
pkgconfig-gdl: gdld-$(MAJOR).pc

gtkd-$(MAJOR).pc:
echo Name: GtkD > $@
Expand Down Expand Up @@ -328,16 +346,23 @@ peasd-$(MAJOR).pc:
echo Libs: $(LINKERFLAG)-lpeasd-$(MAJOR) >> $@
echo Requires: gtkd-$(MAJOR), libpeas-1.0, libpeas-gtk-1.0 >> $@

gdld-$(MAJOR).pc:
echo Name: GdlD > $@
echo Description: A D binding and OO wrapper for Gnome Docking library. >> $@
echo Version: $(GTKD_VERSION) >> $@
echo Libs: $(LINKERFLAG)-lgdld-$(MAJOR) >> $@
echo Requires: gtkd-$(MAJOR), gdl-3.0 >> $@

#######################################################################

ifeq ("$(OS)","Darwin")
install: install-gtkd
install-headers: install-headers-gtkd
install-shared: install-shared-gtkd
else
install: install-gtkd install-gtkdsv install-gstreamer install-vte install-peas
install-headers: install-headers-gtkd install-headers-gtkdsv install-headers-gstreamer install-headers-vte install-headers-peas
install-shared: install-shared-gtkd install-shared-gtkdsv install-shared-gstreamer install-shared-vte install-shared-peas
install: install-gtkd install-gtkdsv install-gstreamer install-vte install-peas install-gdl
install-headers: install-headers-gtkd install-headers-gtkdsv install-headers-gstreamer install-headers-vte install-headers-peas install-headers-gdl
install-shared: install-shared-gtkd install-shared-gtkdsv install-shared-gstreamer install-shared-vte install-shared-peas install-shared-gdl
endif

install-gtkd: $(LIBNAME_GTKD) install-headers-gtkd
Expand All @@ -359,6 +384,9 @@ install-vte: $(LIBNAME_VTED) install-gtkd install-headers-vte
install-peas: $(LIBNAME_PEASD) install-gtkd install-headers-peas
install -m 644 $(LIBNAME_PEASD) $(DESTDIR)$(prefix)/$(libdir)

install-gdl: $(LIBNAME_GDLD) install-gtkd install-headers-gdl
install -m 644 $(LIBNAME_GDLD) $(DESTDIR)$(prefix)/$(libdir)

install-shared-gtkd: $(SONAME_GTKD)
install -d $(DESTDIR)$(prefix)/$(libdir)
$(install-so)
Expand Down Expand Up @@ -404,7 +432,11 @@ install-headers-peas: peasd-$(MAJOR).pc install-headers-gtkd
(cd generated/peas; echo $(SOURCES_PEASD) | sed -e s,generated/peas/,,g | xargs tar cf -) | (cd $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR); tar xvf -)
install -m 644 peasd-$(MAJOR).pc $(DESTDIR)$(prefix)/$(pkgconfigdir)

uninstall: uninstall-gtkdgl uninstall-gtkdsv uninstall-gstreamer uninstall-vte uninstall-peas
install-headers-gdl: gdld-$(MAJOR).pc install-headers-gtkd
(cd generated/gdl; echo $(SOURCES_GDLD) | sed -e s,generated/gdl/,,g | xargs tar cf -) | (cd $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR); tar xvf -)
install -m 644 gdld-$(MAJOR).pc $(DESTDIR)$(prefix)/$(pkgconfigdir)

uninstall: uninstall-gtkdgl uninstall-gtkdsv uninstall-gstreamer uninstall-vte uninstall-peas uninstall-gdl
$(foreach dir,$(shell ls generated/gtkd) , rm -rf $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR)/$(dir))
rm -f $(DESTDIR)$(prefix)/$(pkgconfigdir)/gtkd-$(MAJOR).pc
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(LIBNAME_GTKD)
Expand Down Expand Up @@ -452,13 +484,22 @@ uninstall-peas:
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_PEASD).$(SO_VERSION)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_PEASD).$(SO_VERSION).$(MINOR).$(BUGFIX)

uninstall-gdl:
$(foreach dir,$(shell ls generated/gdl), rm -rf $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR)/$(dir))
rm -f $(DESTDIR)$(prefix)/$(pkgconfigdir)/gdld-$(MAJOR).pc
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(LIBNAME_GDLD)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GDLD)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GDLD).$(SO_VERSION)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GDLD).$(SO_VERSION).$(MINOR).$(BUGFIX)

clean:
-rm -f $(LIBNAME_GTKD) $(SONAME_GTKD) gtkd-$(MAJOR).pc $(OBJECTS_GTKD) $(PICOBJECTS_GTKD)
-rm -f $(LIBNAME_GTKDGL) $(SONAME_GTKDGL) gtkdgl-$(MAJOR).pc $(OBJECTS_GTKDGL) $(PICOBJECTS_GTKDGL)
-rm -f $(LIBNAME_GTKDSV) $(SONAME_GTKDSV) gtkdsv-$(MAJOR).pc $(OBJECTS_GTKDSV) $(PICOBJECTS_GTKDSV)
-rm -f $(LIBNAME_GSTREAMERD) $(SONAME_GSTREAMERD) gstreamerd-$(MAJOR).pc $(OBJECTS_GSTREAMERD) $(PICOBJECTS_GSTREAMERD)
-rm -f $(LIBNAME_VTED) $(SONAME_VTED) vted-$(MAJOR).pc $(OBJECTS_VTED) $(PICOBJECTS_VTED)
-rm -f $(LIBNAME_PEASD) $(SONAME_PEASD) peasd-$(MAJOR).pc $(OBJECTS_PEASD) $(PICOBJECTS_PEASD)
-rm -f $(LIBNAME_GDLD) $(SONAME_GDLD) gdld-$(MAJOR).pc $(OBJECTS_GDLD) $(PICOBJECTS_GDLD)
-rm -f $(BINNAME_DEMO) $(OBJECTS_DEMO) $(SONAME_GTKD).$(SO_VERSION)
-$(MAKE) -C wrap clean

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ shared | build all the shared libraries.
[shared-]gstreamer | build gstreamer.
[shared-]vte | build vte.
[shared-]peas | build peas.
[shared-]gdl | build gdl.

install and uninstall options are also available for the options mentioned above.

Expand Down
76 changes: 76 additions & 0 deletions demos/gtkD/DemoGdl/DemoGdl.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
module demos.gtkD.DemoGdl.DemoGdl;

/*
* This file is part of gtkD.
*
* gtkD is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* gtkD is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with gtkD; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
*/

/*****************************************************************************

Authors: Jan Jurzita <[email protected]>

This demo shows the Gnome Docking library in action.

*****************************************************************************/

import gtk.Application : Application;
import gio.Application : GioApplication = Application;
import gtk.ApplicationWindow : ApplicationWindow;

import gtk.Button;
import gtk.DrawingArea;

import gdl.DockItem;
import gdl.Dock;

import TestDrawingArea;

class MainWindow : ApplicationWindow {

this(Application application) {
super(application);
initUI();
showAll();
}

/**
* Create and initialize the GTK widgets
*/
private void initUI() {
this.setSizeRequest(1024, 640);

Dock dock = new Dock;
DockItem item2 = new DockItem("Drawing Area", "Drawing Area",
GdlDockItemBehavior.LOCKED
| GdlDockItemBehavior.CANT_CLOSE
| GdlDockItemBehavior.NO_GRIP);
item2.add(new TestDrawingArea());
dock.addItem(item2, GdlDockPlacement.CENTER);
DockItem item = new DockItem("Toolbox", "Toolbox", GdlDockItemBehavior.NORMAL);
item.add(new Button("Toolbox 1"));
dock.addItem(item, GdlDockPlacement.LEFT);
DockItem item3 = new DockItem("TBox3", "Long Toolbox 3 Name", GdlDockItemBehavior.NORMAL);
item3.add(new Button("Toolbox 3"));
dock.addItem(item3, GdlDockPlacement.BOTTOM);
add(dock);
}
}

int main(string[] args) {
auto application = new Application("demo.gtkd.GDL", GApplicationFlags.FLAGS_NONE);
application.addOnActivate(delegate void(GioApplication app) { MainWindow mainWindow = new MainWindow(application); });
return application.run(args);
}
10 changes: 10 additions & 0 deletions demos/gtkD/DemoGdl/dub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "demo_gdl",
"description": "A Actions demo",
"targetType": "executable",
"sourceFiles": ["DemoGdl.d", "../_shared/TestDrawingArea.d"],
"dependencies": {
"gtk-d:gtkd": {"path": "../../../" },
"gtk-d:gdl": {"path": "../../../" }
}
}
3 changes: 2 additions & 1 deletion demos/gtkD/TestWindow/dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"sourceFiles": ["TestEntries.d", "TestStock.d", "TestTreeView.d",
"TEditableCells.d", "TestIdle.d", "TestText.d",
"TestWindow.d", "TestAspectFrame.d", "TestImage.d",
"TestThemes.d", "TTextView.d", "TestDrawingArea.d",
"TestThemes.d", "TTextView.d",
"../_shared/TestDrawingArea.d",
"TestScales.d", "TestTreeView1.d"],
"dependencies": {
"gtk-d:gtkd": {"path": "../../../" },
Expand Down
2 changes: 2 additions & 0 deletions docs/candydoc/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ function PackageExplorer()
node.setRef("../../vte/" + path.join("/") + ".html");
} else if ((path[0] == "peas") || (path[0] == "peasc")) {
node.setRef("../../peas/" + path.join("/") + ".html");
} else if ((path[0] == "gdl") || (path[0] == "gdlc")) {
node.setRef("../../gdl/" + path.join("/") + ".html");
} else {
node.setRef("../../gtkd/" + path.join("/") + ".html");
}
Expand Down
12 changes: 11 additions & 1 deletion dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"gtk-d:vte": "*",
"gtk-d:gtkd": "*",
"gtk-d:gstreamer": "*",
"gtk-d:peas": "*"
"gtk-d:peas": "*",
"gtk-d:gdl": "*"
},

"subPackages" : [
Expand Down Expand Up @@ -76,6 +77,15 @@
"libs-posix": ["dl"],
"importPaths": ["generated/peas"],
"dependencies": {"gtk-d:gtkd":"*"}
},
{
"name": "gdl",
"targetType": "library",
"targetName": "gdld-3",
"sourcePaths": ["generated/gdl"],
"libs-posix": ["dl"],
"importPaths": ["generated/gdl"],
"dependencies": {"gtk-d:gtkd":"*"}
}
]
}
Loading