pax_global_header 0000666 0000000 0000000 00000000064 13473224507 0014521 g ustar 00root root 0000000 0000000 52 comment=0893ff5601c15cf1c6723342d4f8165545af4944
GtkD-3.9.0/ 0000775 0000000 0000000 00000000000 13473224507 0012363 5 ustar 00root root 0000000 0000000 GtkD-3.9.0/.gitignore 0000664 0000000 0000000 00000000050 13473224507 0014346 0 ustar 00root root 0000000 0000000 *~
*.o
*.a
*.so
.hg
.hgignore
.svn
.dub
GtkD-3.9.0/.gitmodules 0000664 0000000 0000000 00000000127 13473224507 0014540 0 ustar 00root root 0000000 0000000 [submodule "wrap"]
path = wrap
url = https://github.com/gtkd-developers/gir-to-d.git
GtkD-3.9.0/AUTHORS 0000664 0000000 0000000 00000000234 13473224507 0013432 0 ustar 00root root 0000000 0000000 GTKD AUTHORS (alphabetical by last name)
Frank Benoit
Jake Day
Jonas Kivi
Alan Knowles
Antonio Monteiro
Sebastián E. Peyrott
John Reimer
Mike Wey
hauptmech GtkD-3.9.0/Build.d 0000775 0000000 0000000 00000006375 13473224507 0013605 0 ustar 00root root 0000000 0000000 module Build;
import core.stdc.stdlib: exit;
import std.algorithm;
import std.array;
import std.conv;
import std.file;
import std.getopt;
import std.path;
import std.process;
import std.range;
import std.stdio;
import std.string;
string dcflags;
string ldflags;
version(DigitalMars)
{
string DC = "dmd";
string OUTPUT = "-of";
version(Win32) version = DMD32;
}
else version(LDC)
{
string DC = "ldc2";
string OUTPUT = "-od=objects -oq -of";
}
else version(GNU)
{
string DC = "gdc";
string OUTPUT = "-o ";
}
else
{
static assert(false, "Unsupported compiler");
}
int main(string[] args)
{
version(Posix)
{
writeln("This build script is currently Windows only.");
return(1);
}
getopt(args, "dcflags", &dcflags, "ldflags", &ldflags);
args.popFront();
foreach ( arg; args )
{
if ( !["gtkd", "gtkdgl", "sv", "gstreamer", "vte", "peas", "all"].canFind(arg) )
{
writefln("Unknown option: %s", arg);
return 1;
}
}
if ( args.length == 0 )
args = ["gtkd", "sv"];
if ( args.canFind("all") )
args = ["gtkd", "sv", "gstreamer", "peas"];
foreach ( arg; args )
{
switch ( arg )
{
case "gtkd":
build("generated\\gtkd", "gtkd");
break;
case "gtkdgl":
build("generated\\gtkdgl", "gtkdgl");
break;
case "sv":
build("generated\\sourceview", "gtkdsv");
break;
case "gstreamer":
build("generated\\gstreamer", "gstreamerd");
break;
case "peas":
build("generated\\peas", "peasd");
break;
default:
assert(false);
break;
}
}
return(0);
}
void build(string dir, string lib)
{
version(DMD32)
{
if (lib == "gtkd")
{
string[] subDirs = ["atk", "cairo", "gdk", "gdkpixbuf", "gio", "glib", "gobject", "gthread", "gtkc", "gtkd", "pango", "rsvg"];
foreach(directory; subDirs)
buildObj(dFiles("generated\\gtkd\\"~ directory), directory);
string[] files = dFiles("generated\\gtkd\\gtk").split();
files.chunks((files.length / 4) + 1).enumerate(1).each!((index, value){buildObj(value.join(' '), "gtk"~to!string(index));});
string objects;
foreach(directory; subDirs)
objects ~= directory ~".obj ";
objects ~= "gtk1.obj gtk2.obj gtk3.obj gtk4.obj";
executeShell(format("%s -lib %s %s%s.lib %s", DC, ldflags, OUTPUT, lib, objects));
foreach(string obj; objects.split())
std.file.remove(obj);
}
else
{
buildObj(dFiles(dir), lib);
executeShell(format("%s -lib %s %s%s.lib %s.obj", DC, ldflags, OUTPUT, lib, lib));
std.file.remove(lib ~".obj");
}
}
else
{
std.file.write("build.rf", format("-m64 -c -lib %s %s -Igenerated/gtkd %s%s.lib %s", dcflags, ldflags, OUTPUT ,lib, dFiles(dir)));
auto pid = spawnProcess([DC, "@build.rf"]);
if ( wait(pid) != 0 )
exit(1);
}
version(LDC)std.file.rmdirRecurse("objects");
std.file.remove("build.rf");
}
void buildObj(string files, string objName)
{
std.file.write("build.rf", format("-c %s -Igenerated/gtkd %s%s.obj %s", dcflags, OUTPUT, objName, files));
auto pid = spawnProcess(["dmd", "@build.rf"]);
if ( wait(pid) != 0 )
exit(1);
}
string dFiles(string sourceDir)
{
string files;
auto entries = dirEntries(sourceDir, SpanMode.breadth);
foreach ( DirEntry entry; entries )
{
if ( entry.isDir == false && entry.name.extension == ".d" )
{
files ~= entry.name ~ " ";
}
}
return files;
}
GtkD-3.9.0/CHANGELOG 0000664 0000000 0000000 00000015372 13473224507 0013605 0 ustar 00root root 0000000 0000000 GtkD ChangeLog
==============
Release: 3.9.0
--------------
-Update the libraries to the latest versions.
Release: 3.8.5
--------------
-Set the correct version number.
Release: 3.8.4
--------------
-Fix a memory leak when signals are used on a widget in a container. #254
-Update the GdkPixbuf Lookup file for the canges in 2.38. #250
-Add a get template for gobject.Value.
-Don't hardcode pkg-config #249
-All function names and parameters that are D keywords are now post fixed with an underscore.
-This is instead of the more random substitutes used previously.
-Fix an out-of-bounds write in toStringzArray #248
Release: 3.8.3
--------------
-Make sure we only use one toggle reference per GObject.
-Allow empty arrays in the Dialog constructor.
-Fix Windows build script. #242
Release: 3.8.2
--------------
-Check for null in the ObjectG opCast, so we can cast objects that are null.
-Add len and index methods to PtrArray
Release: 3.8.1
--------------
-Fix the gobject.Value constructor for Objects. #239
-Also use toggle references for getInterfaceInstance. #239
Release: 3.8.0
--------------
-Update the libraries to the latest versions.
-Implement a DClosure. #225
-Add a Signals.connect overload for D functions and delegates.
-Bring back the OpCast changes for ObjectG.
-Add ldc support to the Build.d script.
-Clean up Idles and Timeouts when they are destroyed on the C side.
-Add missing properties for gtk.TreeIter.
Release: 3.7.4
--------------
-Fix building with dmd 2.079.
Release: 3.7.3
--------------
-Use the Slice allocator to allocate structs. #221
Release: 3.7.2
--------------
-Don't use the phobos version of Scoped, to avoid issues when the struct is moved.
-Fix the Windows build script for dmd 2.077.
Release: 3.7.1
--------------
-Revert the opCast changes for the 3.7 release.
-Use hasMember instead of hasStaticMember.
Release: 3.7.0
--------------
-Add GstMpegts bindings.
-Add GstBase and GstApp bindings. #215
-Add an opCast for ObjectG.
-Add properties for simple structs with fields marked as writable.
-Templatize ListStore.setValue, TreeStore.setValue andthe gobject.Value constructor to allow for more types.
-Also generate constants. #213
-Add gobject.Signals.Signals.connect(). #207.
-Update some of the demos to the Gtk3 way of doing things. #204, #205 and #206
-Remove GtkGlExt demos.
Release: 3.6.6
--------------
-Fix a memory leak with signals. #211
Release: 3.6.5
--------------
-Fix the Windows build script.
-Fix the 64bit Windows workaround.
Release: 3.6.4
--------------
-Don't add deprecation warnings in a bugfix release.
Release: 3.6.3
--------------
-Fix the destroyNotify error when destroying an object with unref.
-Retrieve the library names from the gir files instead of gtkd.paths.
Release: 3.6.2
--------------
-Fix dub.json.
-Call free in the destructors of classes not derived from ObjectG.
Release: 3.6.1
--------------
-Fix the GNUMakefile. #196
Release: 3.6.0
--------------
-Update the libraries to the latest versions.
-Add librsvg. #193
-Allow for not using the runtime linker when generating the binding.
-Add mixin templates to generate the boilerplate needed to implement Gtk interfaces
or overrideing Gtk functions.
Release: 3.5.1
--------------
-Set the correct path for the pkgconfig files. #181
Release: 3.5.0
--------------
-Add dub configurations for the demos. #177
-Fix gio.Socket.receive. #178
-Allow removing signal handlers and register each handler seperatly with GTK #170
-Use the correct Homebrew path #172
Release: 3.4.1
--------------
-Properly remove toggle references when an object is destroyed. #169
Release: 3.4.0
--------------
-Update to GTK 3.22
-Properly finalize GTK objects. #165
-Reset the ID for glib.Timeout. #154
-Add libPeas Binding. #152
-Load libraries in the Global namespace to avoid Sourceview errors.
-Check the "GTK_BASEPATH" and "HOMEBREW_ROOT" environment variables on OSX.
-Print a more informative error message when we fail to load a library.
Release: 3.3.0
--------------
-Update to GTK 3.20.
Release: 3.2.3
--------------
-Fix some memory errors, #146
-Add a scoped version of addOnCommandline. #142
Release: 3.2.2
--------------
-Add ddox generation script by Gerald Nunn.
-Allocate GTK structs with g_malloc0.
-GIO Action and Popover demo by Gerald Nunn. #140
-Don't create new objects in ListG and ListSG toArray.
Release: 3.2.1
--------------
-Fix ListG.toArray, and the unittest. #129
-Returning a TreeIter from a custom TreeModel should be optional. #130
-New CoreGL demo by: Sebastien Alaiwan. #132
-New Multithreading demo by: Gerald Nunn. #134
-Fix the vte path. #135
Release: 3.2.0
--------------
-Update to GTK 3.18.
Release: 3.1.5
--------------
-The Wrapper now shows file and linenumber on errors in the GIR files.
-Fix iterating ListG and ListSG. #123
-Fix building GtkDGL.
Release: 3.1.4
--------------
-Fix issues with dmd 2.068.
-Throw GExceptions before ConstructionExceptions. #118
-Add addMany and removeMany to gstreamer.Bin. #116
Release: 3.1.3
--------------
-Don't document length parameters that arn't there.
-Don't treat guchar* as string. #115
-Set the TreeModel after retrieving the TreeIter. Fix #113
Release: 3.1.2
--------------
-Fix Builder.addFromFile.
Release: 3.1.1
--------------
-Remove conflicting GStreamer Files
Release: 3.1.0
--------------
-Wraps the GTK+ 3.16 API.
-Add TreeModelFilter and TreeModelSort constructors, Fix #110
Release: 3.0.0
--------------
-New Generator based on the gir files. for changes because of it see the wiki: https://github.com/gtkd-developers/GtkD/wiki/GtkD-2-vs-GtkD-3
-Wraps the GTK+ 3.14 API.
-Deprecated the addOnDraw function that doesn't use scoped.
-Improve memory management for classes derived from gobject.ObjectG.
-Don't use absolute paths for the GTK libraries on OSX, Issue #97.
Release: 2.4.2
--------------
-Fix issue #102, stop allocating in the ObjectG destructor.
Release: 2.4.1
--------------
-Fix memory leak with gdk.Pixbuf.
-On Windows search for an copy of GTK+ in <exe path>\gtk.
Release: 2.4.0
--------------
- Calling unsupported functions now throws an Error.
- Add a Scoped overload for addOnDraw.
Since the GC can keep a lot of Contexts alive before a collection cycle
starts, some memory and GDI/X11 handles arn't released when no longer
needed.
The Scoped overload destroys the Context at the end of the call
releasing there resources.
- Avoid DLL issues on Windows.
GtkD now searches for the correct copy of Gtk+.
- Add a toArray function to glib.ListG and glib.ListSG.
- Add VTE binding, provided by Deadalnix.
- Remove D1 support.
There are a few reasons to do this:
1. All three compilers have discontinued there D1 version.
2. GtkD with D1 + Tango has been broken for a year now, without any complain
3. I hope to better support D2 features like const, imutable, nothrow, pure.
- bug fixes.
GtkD-3.9.0/COPYING 0000664 0000000 0000000 00000021553 13473224507 0013424 0 ustar 00root root 0000000 0000000 The GtkD library and included works are provided under the terms of the
GNU Library General Public License (LGPL) version 3, or (at your option)
any later version, with the following exceptions:
1. Modifications to any of the works included within the GtkD library to support a specific
platform or application do not constitute a modified or derivative work.
2. Static linking of applications or any other source to the GtkD library does not constitute a
modified or derivative work and does not require the author(s) to provide source code for said
work, use the shared GtkD libraries, or link their applications against a user-supplied version
of GtkD. If you link applications to a modified version of GtkD, then the changes to GtkD must be
provided under the terms of the LGPL.
3. You do not have to provide a copy of the GtkD license with applications that are linked to the
GtkD library, nor do you have to identify GtkD's license in your application as required by the
LGPL. However, applications must still identify their use of GtkD. The following example statement
can be included in the application or it's documentation to satisfy this requirement:
[application] is based in part on works of the GtkD project (http://gtkd.org).
The above exceptions are temporary and are subject to change at any time.
---------------------------------------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
GtkD-3.9.0/GNUmakefile 0000664 0000000 0000000 00000045005 13473224507 0014441 0 ustar 00root root 0000000 0000000 SHELL=/bin/sh
prefix?=/usr/local
PKG_CONFIG?=pkg-config
OS=$(shell uname || uname -s)
ARCH=$(shell uname -m || arch)
ifeq (, $(shell which dpkg-architecture 2>/dev/null))
libdir?=lib/
else
libdir?=lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
endif
ifndef DC
ifneq ($(strip $(shell which dmd 2>/dev/null)),)
DC=dmd
else ifneq ($(strip $(shell which ldc 2>/dev/null)),)
DC=ldc
else ifneq ($(strip $(shell which ldc2 2>/dev/null)),)
DC=ldc2
else
DC=gdc
endif
endif
# make gtkD libs and test
.DEFAULT_GOAL = default-goal
default-goal: libs test
shared: shared-libs
all: libs shared-libs test
ifeq ("$(DC)","gdc")
DCFLAGS=-O2
LINKERFLAG=-Xlinker
DDOCFLAGS=-fsyntax-only -c -fdoc -fdoc-file=$@
DDOCINC=-fdoc-inc=
output=-o $@
else
DCFLAGS=-O
LINKERFLAG=-L
DDOCFLAGS=-o- -Df$@
output=-of$@
endif
ifneq (,$(findstring ldc,$(DC)))
FPIC=-relocation-model=pic
else
FPIC=-fPIC
endif
ifeq ("$(OS)","Linux")
LDFLAGS+=$(LINKERFLAG)-ldl
endif
ifeq ("$(OS)","Darwin")
SO_POSTFIX=$(SO_VERSION).dylib
SONAME=$(LINKERFLAG)-dylib_install_name $(LINKERFLAG)"$@" $(LINKERFLAG)-dylib_current_version $(LINKERFLAG)$(GTKD_VERSION) $(LINKERFLAG)-dylib_compatibility_version $(LINKERFLAG)$(MAJOR).0
else
SO_POSTFIX=so
SONAME=$(LINKERFLAG)-soname=$@.$(SO_VERSION)
endif
AR=ar
RANLIB=ranlib
ifndef GIRTOD
ifneq ($(strip $(shell which girtod 2>/dev/null)),)
GIRTOD=girtod
else
GIRTOD=./wrap/girtod
endif
endif
#######################################################################
GTKD_VERSION=3.9.0
SO_VERSION=0
MAJOR = $(word 1,$(subst ., ,$(GTKD_VERSION)))
MINOR = $(word 2,$(subst ., ,$(GTKD_VERSION)))
BUGFIX = $(word 3,$(subst ., ,$(GTKD_VERSION)))
LIBNAME_GTKD = libgtkd-$(MAJOR).a
SONAME_GTKD = libgtkd-$(MAJOR).$(SO_POSTFIX)
SOURCES_GTKD = $(wildcard generated/gtkd/*/*.d) $(wildcard generated/gtkd/*/c/*.d)
OBJECTS_GTKD = $(patsubst %.d,%.o,$(SOURCES_GTKD))
PICOBJECTS_GTKD = $(patsubst %.o,%.pic.o,$(OBJECTS_GTKD))
LIBNAME_GTKDGL = libgtkdgl-$(MAJOR).a
SONAME_GTKDGL = libgtkdgl-$(MAJOR).$(SO_POSTFIX)
SOURCES_GTKDGL = $(wildcard generated/gtkdgl/*/*.d) $(wildcard generated/gtkdgl/*/c/*.d)
OBJECTS_GTKDGL = $(patsubst %.d,%.o,$(SOURCES_GTKDGL))
PICOBJECTS_GTKDGL = $(patsubst %.o,%.pic.o,$(OBJECTS_GTKDGL))
LIBNAME_GTKDSV = libgtkdsv-$(MAJOR).a
SONAME_GTKDSV = libgtkdsv-$(MAJOR).$(SO_POSTFIX)
SOURCES_GTKDSV = $(wildcard generated/sourceview/*/*.d) $(wildcard generated/sourceview/*/c/*.d)
OBJECTS_GTKDSV = $(patsubst %.d,%.o,$(SOURCES_GTKDSV))
PICOBJECTS_GTKDSV = $(patsubst %.o,%.pic.o,$(OBJECTS_GTKDSV))
LIBNAME_GSTREAMERD = libgstreamerd-$(MAJOR).a
SONAME_GSTREAMERD = libgstreamerd-$(MAJOR).$(SO_POSTFIX)
SOURCES_GSTREAMERD = $(wildcard generated/gstreamer/*/*.d) $(wildcard generated/gstreamer/*/c/*.d) $(wildcard generated/gstreamer/gst/*/*.d) $(wildcard generated/gstreamer/gst/*/c/*.d)
OBJECTS_GSTREAMERD = $(patsubst %.d,%.o,$(SOURCES_GSTREAMERD))
PICOBJECTS_GSTREAMERD = $(patsubst %.o,%.pic.o,$(OBJECTS_GSTREAMERD))
LIBNAME_VTED = libvted-$(MAJOR).a
SONAME_VTED = libvted-$(MAJOR).$(SO_POSTFIX)
SOURCES_VTED = $(wildcard generated/vte/*/*.d) $(wildcard generated/vte/*/c/*.d)
OBJECTS_VTED = $(patsubst %.d,%.o,$(SOURCES_VTED))
PICOBJECTS_VTED = $(patsubst %.o,%.pic.o,$(OBJECTS_VTED))
LIBNAME_PEASD = libpeasd-$(MAJOR).a
SONAME_PEASD = libpeasd-$(MAJOR).$(SO_POSTFIX)
SOURCES_PEASD = $(wildcard generated/peas/*/*.d) $(wildcard generated/peas/*/c/*.d)
OBJECTS_PEASD = $(patsubst %.d,%.o,$(SOURCES_PEASD))
PICOBJECTS_PEASD = $(patsubst %.o,%.pic.o,$(OBJECTS_PEASD))
#######################################################################
USE_RUNTIME_LINKER = $(shell grep "Linker" generated/gtkd/atk/c/functions.d)
ifeq ($(USE_RUNTIME_LINKER),)
SOFLAGS_GTKD = $(shell ${PKG_CONFIG} --libs gtk+-3.0 librsvg-2.0 | sed 's/-[lL]/$(LINKERFLAG)&/g')
SOFLAGS_GTKDGL = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).$(SO_POSTFIX) $(shell ${PKG_CONFIG} --libs gtkglext-3.0 | sed 's/-[lL]/$(LINKERFLAG)&/g')
SOFLAGS_GTKDSV = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).$(SO_POSTFIX) $(shell ${PKG_CONFIG} --libs gtksourceview-3.0 | sed 's/-[lL]/$(LINKERFLAG)&/g')
SOFLAGS_GSTREAMERD = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).$(SO_POSTFIX) $(shell ${PKG_CONFIG} --libs gstreamer-base-1.0 | sed 's/-[lL]/$(LINKERFLAG)&/g')
SOFLAGS_VTED = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).$(SO_POSTFIX) $(shell ${PKG_CONFIG} --libs vte-2.91 | sed 's/-[lL]/$(LINKERFLAG)&/g')
SOFLAGS_PEASD = $(LINKERFLAG)-L. $(LINKERFLAG)./libgtkd-$(MAJOR).$(SO_POSTFIX) $(shell ${PKG_CONFIG} --libs-only-l libpeas-1.0 | sed 's/-[lL]/$(LINKERFLAG)&/g')
endif
#######################################################################
BINNAME_DEMO = TestWindow
SOURCES_DEMO = $(shell find \
demos/gtkD/TestWindow \
-name '*.d' )
OBJECTS_DEMO = $(shell echo $(SOURCES_DEMO) | sed -e 's/\.d/\.o/g')
#######################################################################
generate: generate-runtime
generate-runtime: $(GIRTOD)
$(GIRTOD) -i src --use-runtime-linker --use-bind-dir
generate-compiletime: $(GIRTOD)
$(GIRTOD) -i src --use-bind-dir
$(GIRTOD):
$(if $(findstring "./wrap/girtod","$(GIRTOD)"),$(MAKE) -C wrap)
#######################################################################
# -Isrc
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
endif
gtkd: $(LIBNAME_GTKD)
gtkdgl: $(LIBNAME_GTKDGL)
sv: $(LIBNAME_GTKDSV)
gstreamer: $(LIBNAME_GSTREAMERD)
vte: $(LIBNAME_VTED)
peas: $(LIBNAME_PEASD)
shared-gtkd: $(SONAME_GTKD)
shared-gtkdgl: $(SONAME_GTKDGL)
shared-sv: $(SONAME_GTKDSV)
shared-gstreamer: $(SONAME_GSTREAMERD)
shared-vte: $(SONAME_VTED)
shared-peas: $(SONAME_PEASD)
#######################################################################
$(LIBNAME_GTKD): IMPORTS=-Igenerated/gtkd
$(LIBNAME_GTKD): $(OBJECTS_GTKD)
$(make-lib)
$(LIBNAME_GTKDGL): IMPORTS=-Igenerated/gtkd -Igenerated/gtkdgl
$(LIBNAME_GTKDGL): $(LIBNAME_GTKD) $(OBJECTS_GTKDGL)
$(make-lib)
$(LIBNAME_GTKDSV): IMPORTS=-Igenerated/gtkd -Igenerated/sourceview
$(LIBNAME_GTKDSV): $(LIBNAME_GTKD) $(OBJECTS_GTKDSV)
$(make-lib)
$(LIBNAME_GSTREAMERD): IMPORTS=-Igenerated/gtkd -Igenerated/gstreamer
$(LIBNAME_GSTREAMERD): $(LIBNAME_GTKD) $(OBJECTS_GSTREAMERD)
$(make-lib)
$(LIBNAME_VTED): IMPORTS=-Igenerated/gtkd -Igenerated/vte
$(LIBNAME_VTED): $(LIBNAME_GTKD) $(OBJECTS_VTED)
$(make-lib)
$(LIBNAME_PEASD): IMPORTS=-Igenerated/gtkd -Igenerated/peas
$(LIBNAME_PEASD): $(LIBNAME_GTKD) $(OBJECTS_PEASD)
$(make-lib)
#######################################################################
$(SONAME_GTKD): IMPORTS=-Igenerated/gtkd
$(SONAME_GTKD): $(PICOBJECTS_GTKD)
$(call make-shared-lib,$(SOFLAGS_GTKD))
$(SONAME_GTKDGL): IMPORTS=-Igenerated/gtkd -Igenerated/gtkdgl
$(SONAME_GTKDGL): $(SONAME_GTKD) $(PICOBJECTS_GTKDGL)
$(call make-shared-lib,$(SOFLAGS_GTKDGL))
$(SONAME_GTKDSV): IMPORTS=-Igenerated/gtkd -Igenerated/sourceview
$(SONAME_GTKDSV): $(SONAME_GTKD) $(PICOBJECTS_GTKDSV)
$(call make-shared-lib,$(SOFLAGS_GTKDSV))
$(SONAME_GSTREAMERD): IMPORTS=-Igenerated/gtkd -Igenerated/gstreamer
$(SONAME_GSTREAMERD): $(SONAME_GTKD) $(PICOBJECTS_GSTREAMERD)
$(call make-shared-lib,$(SOFLAGS_GSTREAMERD))
$(SONAME_VTED): IMPORTS=-Igenerated/gtkd -Igenerated/vte
$(SONAME_VTED): $(SONAME_GTKD) $(PICOBJECTS_VTED)
$(call make-shared-lib,$(SOFLAGS_VTED))
$(SONAME_PEASD): IMPORTS=-Igenerated/gtkd -Igenerated/peas
$(SONAME_PEASD): $(SONAME_GTKD) $(PICOBJECTS_PEASD)
$(call make-shared-lib,$(SOFLAGS_PEASD))
#######################################################################
# -Idemos
test: $(BINNAME_DEMO)
# Build libgtkd.a when neigther neither libgtkd.so and libgtkd.a are pressend.
# Use -rpath for the demo so that the shard libs don't need to
# be installed for it to run.
# Create a versioned symlink so the demo is able to load it.
$(BINNAME_DEMO): IMPORTS=-Igenerated/gtkd -Idemos/gtkD/TestWindow
$(BINNAME_DEMO): $(OBJECTS_DEMO)
$(if $(wildcard $(SONAME_GTKD)),,$(if $(wildcard $(LIBNAME_GTKD)),,$(MAKE) $(LIBNAME_GTKD)))
$(if $(wildcard $(SONAME_GTKD)),$(eval LDFLAGS+= $(LINKERFLAG)-rpath=./))
$(if $(wildcard $(SONAME_GTKD)),$(if $(findstring "gdc","$(DC)"),$(eval LDFLAGS+=-shared-libphobos)))
$(if $(wildcard $(SONAME_GTKD)),$(if $(wildcard $(SONAME_GTKD).$(SO_VERSION)),,$(shell ln -s $(SONAME_GTKD) $(SONAME_GTKD).$(SO_VERSION))))
$(DC) $(OBJECTS_DEMO) $(output) $(if $(wildcard $(SONAME_GTKD)),$(LINKERFLAG)./libgtkd-$(MAJOR).$(SO_POSTFIX),$(LINKERFLAG)./libgtkd-$(MAJOR).a) $(LDFLAGS)
#######################################################################
%.o : %.d
$(DC) $(DCFLAGS) $(IMPORTS) -c $< $(output)
%.pic.o : %.d
$(DC) $(DCFLAGS) $(FPIC) $(IMPORTS) -c $< $(output)
#######################################################################
ifeq ("$(OS)","Darwin")
pkgconfig: pkgconfig-gtkd
else
pkgconfig: pkgconfig-gtkd pkgconfig-gtkdgl pkgconfig-sv
endif
pkgconfig-gtkd: gtkd-$(MAJOR).pc
pkgconfig-gtkdgl: gtkdgl-$(MAJOR).pc
pkgconfig-sv: gtkdsv-$(MAJOR).pc
pkgconfig-gstreamer: gstreamerd-$(MAJOR).pc
pkgconfig-vte: vted-$(MAJOR).pc
pkgconfig-peas: peasd-$(MAJOR).pc
gtkd-$(MAJOR).pc:
echo Name: GtkD > $@
echo Description: A D binding and OO wrapper for GTK+. >> $@
echo Version: $(GTKD_VERSION) >> $@
echo Libs: $(LINKERFLAG)-L$(prefix)/$(libdir)/ $(LINKERFLAG)-lgtkd-$(MAJOR) $(LINKERFLAG)-ldl >> $@
echo Cflags: -I$(prefix)/include/d/gtkd-$(MAJOR)/ >> $@
gtkdgl-$(MAJOR).pc:
echo Name: GtkDGL > $@
echo Description: OpenGL capabilities for GtkD. >> $@
echo Version: $(GTKD_VERSION) >> $@
echo Libs: $(LINKERFLAG)-lgtkdgl-$(MAJOR) >> $@
echo Requires: gtkd-$(MAJOR) >> $@
gtkdsv-$(MAJOR).pc:
echo Name: GtkD SourceView > $@
echo Description: A D binding and OO wrapper for GtkSourceView. >> $@
echo Version: $(GTKD_VERSION) >> $@
echo Libs: $(LINKERFLAG)-lgtkdsv-$(MAJOR) >> $@
echo Requires: gtkd-$(MAJOR) >> $@
gstreamerd-$(MAJOR).pc:
echo Name: GstreamerD > $@
echo Description: A D binding and OO wrapper for Gstreamer. >> $@
echo Version: $(GTKD_VERSION) >> $@
echo Libs: $(LINKERFLAG)-lgstreamerd-$(MAJOR) >> $@
echo Requires: gtkd-$(MAJOR) >> $@
vted-$(MAJOR).pc:
echo Name: VteD > $@
echo Description: A D binding and OO wrapper for Vte. >> $@
echo Version: $(GTKD_VERSION) >> $@
echo Libs: $(LINKERFLAG)-lvted-$(MAJOR) >> $@
echo Requires: gtkd-$(MAJOR) >> $@
peasd-$(MAJOR).pc:
echo Name: PeasD > $@
echo Description: A D binding and OO wrapper for Peas. >> $@
echo Version: $(GTKD_VERSION) >> $@
echo Libs: $(LINKERFLAG)-lpeasd-$(MAJOR) >> $@
echo Requires: gtkd-$(MAJOR) >> $@
#######################################################################
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
endif
install-gtkd: $(LIBNAME_GTKD) install-headers-gtkd
install -d $(DESTDIR)$(prefix)/$(libdir)
install -m 644 $(LIBNAME_GTKD) $(DESTDIR)$(prefix)/$(libdir)
install-gtkdgl: $(LIBNAME_GTKDGL) install-gtkd install-headers-gtkdgl
install -m 644 $(LIBNAME_GTKDGL) $(DESTDIR)$(prefix)/$(libdir)
install-gtkdsv: $(LIBNAME_GTKDSV) install-gtkd install-headers-gtkdsv
install -m 644 $(LIBNAME_GTKDSV) $(DESTDIR)$(prefix)/$(libdir)
install-gstreamer: $(LIBNAME_GSTREAMERD) install-gtkd install-headers-gstreamer
install -m 644 $(LIBNAME_GSTREAMERD) $(DESTDIR)$(prefix)/$(libdir)
install-vte: $(LIBNAME_VTED) install-gtkd install-headers-vte
install -m 644 $(LIBNAME_VTED) $(DESTDIR)$(prefix)/$(libdir)
install-peas: $(LIBNAME_PEASD) install-gtkd install-headers-peas
install -m 644 $(LIBNAME_PEASD) $(DESTDIR)$(prefix)/$(libdir)
install-shared-gtkd: $(SONAME_GTKD)
install -d $(DESTDIR)$(prefix)/$(libdir)
$(install-so)
install-shared-gtkdgl: $(SONAME_GTKDGL) install-shared-gtkd
$(install-so)
install-shared-gtkdsv: $(SONAME_GTKDSV) install-shared-gtkd
$(install-so)
install-shared-gstreamer: $(SONAME_GSTREAMERD) install-shared-gtkd
$(install-so)
install-shared-vte: $(SONAME_VTED) install-shared-gtkd
$(install-so)
install-shared-peas: $(SONAME_PEASD) install-shared-gtkd
$(install-so)
install-headers-gtkd: gtkd-$(MAJOR).pc
install -d $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR)
install -d $(DESTDIR)$(libdir)/pkgconfig
(cd generated/gtkd; echo $(SOURCES_GTKD) | sed -e s,generated/gtkd/,,g | xargs tar cf -) | (cd $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR); tar xvf -)
install -m 644 gtkd-$(MAJOR).pc $(DESTDIR)$(libdir)/pkgconfig
install-headers-gtkdgl: gtkdgl-$(MAJOR).pc install-headers-gtkd
(cd generated/gtkdgl; echo $(SOURCES_GTKDGL) | sed -e s,generated/gtkdgl/,,g | xargs tar cf -) | (cd $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR); tar xvf -)
install -m 644 gtkdgl-$(MAJOR).pc $(DESTDIR)$(libdir)/pkgconfig
install-headers-gtkdsv: gtkdsv-$(MAJOR).pc install-headers-gtkd
(cd generated/sourceview; echo $(SOURCES_GTKDSV) | sed -e s,generated/sourceview/,,g | xargs tar cf -) | (cd $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR); tar xvf -)
install -m 644 gtkdsv-$(MAJOR).pc $(DESTDIR)$(libdir)/pkgconfig
install-headers-gstreamer: gstreamerd-$(MAJOR).pc install-headers-gtkd
(cd generated/gstreamer; echo $(SOURCES_GSTREAMERD) | sed -e s,generated/gstreamer/,,g | xargs tar cf -) | (cd $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR); tar xvf -)
install -m 644 gstreamerd-$(MAJOR).pc $(DESTDIR)$(libdir)/pkgconfig
install-headers-vte: vted-$(MAJOR).pc install-headers-gtkd
(cd generated/vte; echo $(SOURCES_VTED) | sed -e s,generated/vte/,,g | xargs tar cf -) | (cd $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR); tar xvf -)
install -m 644 vted-$(MAJOR).pc $(DESTDIR)$(libdir)/pkgconfig
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)$(libdir)/pkgconfig
uninstall: uninstall-gtkdgl uninstall-gtkdsv uninstall-gstreamer uninstall-vte uninstall-peas
$(foreach dir,$(shell ls generated/gtkd) , rm -rf $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR)/$(dir))
rm -f $(DESTDIR)$(libdir)/pkgconfig/gtkd-$(MAJOR).pc
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(LIBNAME_GTKD)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GTKD)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GTKD).$(SO_VERSION)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GTKD).$(SO_VERSION).$(MINOR).$(BUGFIX)
uninstall-gtkdgl:
$(foreach dir,$(shell ls generated/gtkdgl), rm -rf $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR)/$(dir))
rm -f $(DESTDIR)$(libdir)/pkgconfig/gtkdgl-$(MAJOR).pc
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(LIBNAME_GTKDGL)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GTKDGL)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GTKDGL).$(SO_VERSION)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GTKDGL).$(SO_VERSION).$(MINOR).$(BUGFIX)
uninstall-gtkdsv:
$(foreach dir,$(shell ls generated/sourceview), rm -rf $(DESTDIR)$(prefix)/include/d/$(dir))
rm -f $(DESTDIR)$(libdir)/pkgconfig/gtkdsv-$(MAJOR).pc
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(LIBNAME_GTKDSV)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GTKDSV)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GTKDSV).$(SO_VERSION)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GTKDSV).$(SO_VERSION).$(MINOR).$(BUGFIX)
uninstall-gstreamer:
$(foreach dir,$(shell ls generated/gstreamer), rm -rf $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR)/$(dir))
rm -f $(DESTDIR)$(libdir)/pkgconfig/gstreamerd-$(MAJOR).pc
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(LIBNAME_GSTREAMERD)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GSTREAMERD)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GSTREAMERD).$(SO_VERSION)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_GSTREAMERD).$(SO_VERSION).$(MINOR).$(BUGFIX)
uninstall-vte:
$(foreach dir,$(shell ls generated/vte), rm -rf $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR)/$(dir))
rm -f $(DESTDIR)$(libdir)/pkgconfig/vted-$(MAJOR).pc
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(LIBNAME_VTED)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_VTED)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_VTED).$(SO_VERSION)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_VTED).$(SO_VERSION).$(MINOR).$(BUGFIX)
uninstall-peas:
$(foreach dir,$(shell ls generated/peas), rm -rf $(DESTDIR)$(prefix)/include/d/gtkd-$(MAJOR)/$(dir))
rm -f $(DESTDIR)$(libdir)/pkgconfig/peasd-$(MAJOR).pc
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(LIBNAME_PEASD)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_PEASD)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_PEASD).$(SO_VERSION)
rm -f $(DESTDIR)$(prefix)/$(libdir)/$(SONAME_PEASD).$(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 $(BINNAME_DEMO) $(OBJECTS_DEMO) $(SONAME_GTKD).$(SO_VERSION)
$(MAKE) -C wrap clean
#######################################################################
define make-lib
$(AR) rcs $@ $(subst $(LIBNAME_GTKD),,$^)
$(RANLIB) $@
endef
define make-shared-lib
$(if $(filter-out "Darwin","$(OS)"), $(if $(findstring "dmd","$(DC)"),$(eval LDFLAGS+=-defaultlib=:libphobos2.so)))
$(if $(findstring "gdc","$(DC)"),$(eval LDFLAGS+=-shared-libphobos))
$(if $(findstring "ldc","$(DC)"),$(eval LDFLAGS+=-link-defaultlib-shared))
$(DC) -shared $(output) $(LDFLAGS) $1 $(SONAME) $(subst $(SONAME_GTKD),,$^)
endef
define install-so
install -m 755 $< $(DESTDIR)$(prefix)/$(libdir)/$<.$(SO_VERSION).$(MINOR).$(BUGFIX)
ldconfig -n $(DESTDIR)$(prefix)/$(libdir)/
cd $(DESTDIR)$(prefix)/$(libdir)/; ln -sf $<.$(SO_VERSION).$(MINOR).$(BUGFIX) $<.$(SO_VERSION)
cd $(DESTDIR)$(prefix)/$(libdir)/; ln -sf $<.$(SO_VERSION) $<
endef
GtkD-3.9.0/README.md 0000664 0000000 0000000 00000005333 13473224507 0013646 0 ustar 00root root 0000000 0000000 # GtkD
GtkD is the Digital Mars D programming language OO wrapper for Gtk+ 3.22. GtkD
is release on the LGPL license with additional exceptions.
Please view COPYING for GtkD's license.
## Requirements
- Linux, Windows, or Mac
- Gtk libs
- dmd, gdc or ldc installation
optional:
- OpenGL libs (mesa is fine on Linux)
- GtkGLext 3
## Who are you?
If you want to write some wicked cool D and Gtk+ apps, grab the gtkD release
archive at http://gtkd.org/download.html.
If you want to tweak the automatic wrapper or help with it, use git...
https://github.com/gtkd-developers/GtkD
## Installation
The installation depends on the setup of your development environment. This
means that to release your project you must include the GtkD lib on your
deliverable or statically link to GtkD – please pay attention to the license.
## Compile the lib and the test programs
### Linux / Posix
Using the GNU make to compile GtkD on these Operating systems, calling make
with no options will build GtkD, GtkD-Sourceview and one of the demos.
Optionally these options are available:
Option | Meaning
--- | ---
all | build everything.
libs | build all the static libraries.
shared | build all the shared libraries.
[shared-]gtkd | build gtkd.
[shared-]gtkdsv | build gtkd-sourceview.
[shared-]gstreamer | build gstreamer.
[shared-]vte | build vte.
[shared-]peas | build peas.
install and uninstall options are also available for the options mentioned above.
Or you can use one of the build options also available for Windows.
### OSX
The build options are the same as for Linux.
If on OSX GtkD is unable to find the GTK libraries. Some environment variables
can be set to override the search path. GTK\_BASEPATH and
HOMEBREW\_ROOT. GTK\_BASEPATH takes precedence over HOMEBREW\_ROOT.
### Windows
To build on Windows you can use the build script in combination with rdmd.
rdmd Build.d
By default this builds gtkd, gtkdgl and gtkdsv to compile only one of these
or gstreamerd you can pass the following options to the build file:
Option | Meaning
--- | ---
gtkd | build GtkD.
gtkdgl | build GtkDGL.
sv | build gtkd-sourceview
gstreamer | build gstreamer.
all | build everything.
For all the above packages there a two option avalable to specify aditional
compiler and linker flags:
- --dcflags="your compiler flags"
- --ldflags="your linker flags"
To specify if it should build for 64 or 32 bits, pass either
the -m32 or -m64 flag to rdmd.
rdmd -m64 Build.d
## Wrapped Versions
GtkD wraps Gtk+ 3.22 the versions of the associated libraries are:
Library | Version
--- | ---
Gtk+ | 3.24
Gdk | 3.24
Glib | 2.60
GObject | 2.60
Gio | 2.60
Pango | 1.43
Atk | 2.32
Gdk-pixbuf | 2.38
Cairo | 1.12.2
LibRsvg | 2.44
GtksourceView | 4.2
GStreamer | 1.16
Vte3 | 0.56
GtkD-3.9.0/demos/ 0000775 0000000 0000000 00000000000 13473224507 0013472 5 ustar 00root root 0000000 0000000 GtkD-3.9.0/demos/builder/ 0000775 0000000 0000000 00000000000 13473224507 0015120 5 ustar 00root root 0000000 0000000 GtkD-3.9.0/demos/builder/builderTest.d 0000664 0000000 0000000 00000002637 13473224507 0017563 0 ustar 00root root 0000000 0000000 module builder.builderTest;
import gio.Application: GioApplication = Application;
import gtk.Application;
import gtk.ApplicationWindow;
import gtk.Builder;
import gtk.Button;
import std.stdio;
import core.stdc.stdlib;
/**
* Usage ./gladeText /path/to/your/glade/file.glade
*
*/
int main(string[] args) {
string gladefile;
if(args.length > 1) {
writefln("Loading %s", args[1]);
gladefile = args[1];
args = args[0..1];
} else {
writeln("No glade file specified, using default \"builderTest.glade\"");
gladefile = "builderTest.glade";
}
auto application = new Application("org.gtkd.demo.builder.builderTest", GApplicationFlags.FLAGS_NONE);
void buildAndDisplay(GioApplication a) {
auto builder = new Builder();
if( ! builder.addFromFile(gladefile) ) {
writeln("Oops, could not create Glade object, check your glade file ;)");
exit(1);
}
auto window = cast(ApplicationWindow)builder.getObject("window");
window.setApplication(application);
if (window !is null) {
window.setTitle("This is a glade application window");
auto button = cast(Button)builder.getObject("button");
if(button !is null) {
button.addOnClicked( delegate void(Button aux){ a.quit(); } );
window.showAll();
} else {
writeln("No button in the window?");
exit(1);
}
} else {
writeln("No window?");
exit(1);
}
}
application.addOnActivate(&buildAndDisplay);
return application.run(args);
}
GtkD-3.9.0/demos/builder/builderTest.glade 0000664 0000000 0000000 00000001377 13473224507 0020414 0 ustar 00root root 0000000 0000000
GtkD-3.9.0/demos/builder/dub.json 0000664 0000000 0000000 00000000332 13473224507 0016563 0 ustar 00root root 0000000 0000000 {
"name": "buildertest",
"description": "A Gtk Builder demo",
"targetType": "executable",
"targetName": "BuilderTest",
"sourceFiles": ["builderTest.d"],
"dependencies": {
"gtk-d:gtkd": {"path": "../../" }
}
}
GtkD-3.9.0/demos/cairo/ 0000775 0000000 0000000 00000000000 13473224507 0014567 5 ustar 00root root 0000000 0000000 GtkD-3.9.0/demos/cairo/cairo_clock/ 0000775 0000000 0000000 00000000000 13473224507 0017037 5 ustar 00root root 0000000 0000000 GtkD-3.9.0/demos/cairo/cairo_clock/clock.d 0000664 0000000 0000000 00000007136 13473224507 0020306 0 ustar 00root root 0000000 0000000 /**
* clock.d
*
* A gtkD widget that implements a clock face
*
* Based on the Gtkmm example by:
* Jonathon Jongsma
*
* and the original GTK+ example by:
* (c) 2005-2006, Davyd Madeley
*
* Authors:
* Jonas Kivi (D version)
* Jonathon Jongsma (C++ version)
* Davyd Madeley (C version)
*/
module clock;
import std.stdio;
import std.math;
import std.datetime;
import glib.Timeout;
import cairo.Context;
import cairo.Surface;
import gtk.Widget;
import gtk.DrawingArea;
class Clock : DrawingArea
{
public:
this()
{
//Attach our expose callback, which will draw the window.
addOnDraw(&drawCallback);
}
protected:
//Override default signal handler:
bool drawCallback(Scoped!Context cr, Widget widget)
{
if ( m_timeout is null )
{
//Create a new timeout that will ask the window to be drawn once every second.
m_timeout = new Timeout( 1000, &onSecondElapsed, false );
}
// This is where we draw on the window
GtkAllocation size;
getAllocation(size);
// scale to unit square and translate (0, 0) to be (0.5, 0.5), i.e. the
// center of the window
cr.scale(size.width, size.height);
cr.translate(0.5, 0.5);
cr.setLineWidth(m_lineWidth);
cr.save();
cr.setSourceRgba(0.3, 0.6, 0.2, 0.9); // brownish green
cr.paint();
cr.restore();
cr.arc(0, 0, m_radius, 0, 2 * PI);
cr.save();
cr.setSourceRgba(0.0, 0.0, 0.0, 0.8);
cr.fillPreserve();
cr.restore();
cr.save();
cr.setSourceRgba(1.0, 1.0, 1.0, 1.0);
cr.setLineWidth( m_lineWidth * 1.7);
cr.strokePreserve();
cr.clip();
cr.restore();
//clock ticks
for (int i = 0; i < 12; i++)
{
double inset = 0.07;
cr.save();
cr.setSourceRgba(1.0, 1.0, 1.0, 1.0);
cr.setLineWidth( m_lineWidth * 0.25);
cr.setLineCap(cairo_line_cap_t.ROUND);
if (i % 3 != 0)
{
inset *= 1.2;
cr.setLineWidth( m_lineWidth * 0.5 );
}
cr.moveTo(
(m_radius - inset) * cos (i * PI / 6),
(m_radius - inset) * sin (i * PI / 6));
cr.lineTo (
m_radius * cos (i * PI / 6),
m_radius * sin (i * PI / 6));
cr.stroke();
cr.restore(); // stack-pen-size
}
SysTime lNow = std.datetime.Clock.currTime();
// compute the angles of the indicators of our clock
double minutes = lNow.minute * PI / 30;
double hours = lNow.hour * PI / 6;
double seconds= lNow.second * PI / 30;
cr.save();
cr.setLineCap(cairo_line_cap_t.ROUND);
// draw the seconds hand
cr.save();
cr.setLineWidth(m_lineWidth / 3);
cr.setSourceRgba(0.7, 0.7, 0.85, 0.8); // blueish gray
cr.moveTo(0, 0);
cr.lineTo(sin(seconds) * (m_radius * 0.8),
-cos(seconds) * (m_radius * 0.8));
cr.stroke();
cr.restore();
// draw the minutes hand
//cr.setSourceRgba(0.117, 0.337, 0.612, 0.9); // blue
cr.setSourceRgba(0.712, 0.337, 0.117, 0.9); // red
cr.moveTo(0, 0);
cr.lineTo(sin(minutes + seconds / 60) * (m_radius * 0.7),
-cos(minutes + seconds / 60) * (m_radius * 0.7));
cr.stroke();
// draw the hours hand
cr.setSourceRgba(0.337, 0.612, 0.117, 0.9); // green
cr.moveTo(0, 0);
cr.lineTo(sin(hours + minutes / 12.0) * (m_radius * 0.4),
-cos(hours + minutes / 12.0) * (m_radius * 0.4));
cr.stroke();
cr.restore();
// draw a little dot in the middle
cr.arc(0, 0, m_lineWidth / 3.0, 0, 2 * PI);
cr.fill();
return true;
}
bool onSecondElapsed()
{
//force our program to redraw the entire clock once per every second.
GtkAllocation area;
getAllocation(area);
queueDrawArea(area.x, area.y, area.width, area.height);
return true;
}
double m_radius = 0.40;
double m_lineWidth = 0.065;
Timeout m_timeout;
}
GtkD-3.9.0/demos/cairo/cairo_clock/dub.json 0000664 0000000 0000000 00000000275 13473224507 0020510 0 ustar 00root root 0000000 0000000 {
"name": "cairo_clock",
"description": "A Cairo demo",
"targetType": "executable",
"sourceFiles": ["main.d", "clock.d"],
"dependencies": {
"gtk-d:gtkd": {"path": "../../../" }
}
}
GtkD-3.9.0/demos/cairo/cairo_clock/main.d 0000664 0000000 0000000 00000001645 13473224507 0020136 0 ustar 00root root 0000000 0000000 /**
* main.d
*
* A gtkD main window that uses the clock widget from clock.d
*
* Based on the Gtkmm example by:
* Jonathon Jongsma
*
* and the original GTK+ example by:
* (c) 2005-2006, Davyd Madeley
*
* Authors:
* Jonas Kivi (D version)
* Jonathon Jongsma (C++ version)
* Davyd Madeley (C version)
*/
module main;
import clock;
import gio.Application : GioApplication = Application;
import gtk.Application;
import gtk.ApplicationWindow;
int main(string[] args)
{
Application application;
void activateClock(GioApplication app)
{
ApplicationWindow win = new ApplicationWindow(application);
win.setTitle("gtkD Cairo Clock");
win.setDefaultSize( 250, 250 );
Clock c = new Clock();
win.add(c);
c.show();
win.showAll();
}
application = new Application("org.gtkd.demo.cairo.clock", GApplicationFlags.FLAGS_NONE);
application.addOnActivate(&activateClock);
return application.run(args);
}
GtkD-3.9.0/demos/cairo/text_image/ 0000775 0000000 0000000 00000000000 13473224507 0016715 5 ustar 00root root 0000000 0000000 GtkD-3.9.0/demos/cairo/text_image/dub.json 0000664 0000000 0000000 00000000267 13473224507 0020367 0 ustar 00root root 0000000 0000000 {
"name": "text_image",
"description": "A Cairo demo",
"targetType": "executable",
"sourceFiles": ["text_image.d"],
"dependencies": {
"gtk-d:gtkd": {"path": "../../../" }
}
}
GtkD-3.9.0/demos/cairo/text_image/gtkD_logo.png 0000664 0000000 0000000 00000032422 13473224507 0021337 0 ustar 00root root 0000000 0000000 PNG
IHDR P xz
OiCCPPhotoshop ICC profile xڝSgTS=BKKoR RB&*! J!QEEȠQ,
!{kּ>H3Q5B.@
$p d!s# ~<<+" x M0B\t8K @zB @F&S