From: Andrea Zagli Date: Fri, 19 Jun 2009 16:29:02 +0000 (+0200) Subject: Initial commit X-Git-Tag: GTKGIS_0_0_1~15 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=5c9d4124630f5ec46c878d2afc2829201825f6c3;p=libgtkgis Initial commit --- 5c9d4124630f5ec46c878d2afc2829201825f6c3 diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..ad1de0f --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Andrea Zagli diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..e4af899 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,10 @@ +ACLOCAL_AMFLAGS=-I m4 + +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc + +SUBDIRS = src tests + +EXTRA_DIST = libgtkgis.pc.in + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libgtkgis.pc diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 100644 index 0000000..e69de29 diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..3ab7132 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,98 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd $srcdir +PROJECT=libgtkgis +TEST_TYPE=-f +FILE=configure.ac + +DIE=0 + +have_libtool=false +if libtoolize --version < /dev/null > /dev/null 2>&1 ; then + libtool_version=`libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` + case $libtool_version in + 1.4*|1.5*) + have_libtool=true + ;; + esac +fi +if $have_libtool ; then : ; else + echo + echo "You must have libtool 1.4 installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnu.org/gnu/libtool/" + DIE=1 +fi + +(gtkdocize --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have gtk-doc installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/" + DIE=1 +} + +(autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have autoconf installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/" + DIE=1 +} + +if automake --version < /dev/null > /dev/null 2>&1 ; then + AUTOMAKE=automake + ACLOCAL=aclocal +else + echo + echo "You must have automake 1.7.x installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/" + DIE=1 +fi + +if test "$DIE" -eq 1; then + exit 1 +fi + +test $TEST_TYPE $FILE || { + echo "You must run this script in the top-level $PROJECT directory" + exit 1 +} + +if test -z "$AUTOGEN_SUBDIR_MODE"; then + if test -z "$*"; then + echo "I am going to run ./configure with no arguments - if you wish " + echo "to pass any to it, please specify them on the $0 command line." + fi +fi + +rm -rf autom4te.cache + +# README and INSTALL are required by automake, but may be deleted by clean +# up rules. to get automake to work, simply touch these here, they will be +# regenerated from their corresponding *.in files by ./configure anyway. +touch README INSTALL + +$ACLOCAL || exit $? + +libtoolize --force || exit $? +gtkdocize || exit $? + +autoheader || exit $? + +$AUTOMAKE --add-missing || exit $? +autoconf || exit $? +cd $ORIGDIR || exit $? + +if test -z "$AUTOGEN_SUBDIR_MODE"; then + $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $? + + echo + echo "Now type 'make' to compile $PROJECT." +fi diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..ad1549f --- /dev/null +++ b/config.h.in @@ -0,0 +1,82 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define to 1 if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..e69b97c --- /dev/null +++ b/configure.ac @@ -0,0 +1,55 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ(2.63) +AC_INIT([libgtkgis], [0.0.1], [azagli@libero.it]) +AC_CONFIG_SRCDIR([src/gtkgis.c]) +AC_CONFIG_HEADER([config.h]) + +AC_CONFIG_MACRO_DIR([m4]) + +AM_INIT_AUTOMAKE +AM_MAINTAINER_MODE +AC_LIBTOOL_WIN32_DLL + +AC_CANONICAL_SYSTEM + +# Checks for programs. +AC_PROG_CXX +AC_PROG_AWK +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_LIBTOOL + +AC_PATH_PROG(GDAL_CONFIG, "gdal-config", "", $PATH) + +# Checks for libraries. +PKG_CHECK_MODULES([GTKGIS], [gtk+-2.0 >= 2.10.0]) + +AC_SUBST(GTKGIS_CFLAGS) +AC_SUBST(GTKGIS_LIBS) + +GDAL_CFLAGS=`$GDAL_CONFIG --cflags` +GDAL_LIBS=`$GDAL_CONFIG --libs` + +AC_SUBST(GDAL_CFLAGS) +AC_SUBST(GDAL_LIBS) + +# Checks for header files. +AC_FUNC_ALLOCA +AC_HEADER_STDC + +# Checks for typedefs, structures, and compiler characteristics. + +# Checks for library functions. + +AC_CONFIG_FILES([ + libgtkgis.pc + Makefile + src/Makefile + tests/Makefile +]) +AC_OUTPUT diff --git a/libgtkgis.pc.in b/libgtkgis.pc.in new file mode 100644 index 0000000..9531dca --- /dev/null +++ b/libgtkgis.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: @PACKAGE_NAME@ +Description: Library to embed GIS functionalities into applications based on Gtk+ +Version: @PACKAGE_VERSION@ +Requires: gtk+-2.0 +Libs: -L${libdir} -lgtkgis +Cflags: -I${includedir} diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..c44f47b --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,18 @@ +LIBS = $(GTKGIS_LIBS) \ + $(GDAL_LIBS) + +AM_CPPFLAGS = $(GTKGIS_CFLAGS) \ + $(GDAL_CFLAGS) \ + -DG_LOG_DOMAIN=\"libgtkgis\" + +lib_LTLIBRARIES = libgtkgis.la + +libgtkgis_la_LDFLAGS = -no-undefined + +libgtkgis_la_SOURCES = \ + gtkgis.c + +include_HEADERS = \ + libgtkgis.h + +noinst_HEADERS = diff --git a/src/gtkgis.c b/src/gtkgis.c new file mode 100644 index 0000000..362398a --- /dev/null +++ b/src/gtkgis.c @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2009 Andrea Zagli + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +#include +#include + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "gtkgis.h" + +static void gtk_gis_class_init (GtkGisClass *klass); +static void gtk_gis_init (GtkGis *gtk_gis); + +static void gtk_gis_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec); +static void gtk_gis_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec); + + +#define GTK_GIS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_GTK_GIS, GtkGisPrivate)) + +typedef struct _GtkGisPrivate GtkGisPrivate; +struct _GtkGisPrivate + { + }; + +GType +gtk_gis_get_type (void) +{ + static GType gtk_gis_type = 0; + + if (!gtk_gis_type) + { + static const GTypeInfo gtk_gis_info = + { + sizeof (GtkGisClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) gtk_gis_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (GtkGis), + 0, /* n_preallocs */ + (GInstanceInitFunc) gtk_gis_init, + NULL + }; + + gtk_gis_type = g_type_register_static (G_TYPE_OBJECT, "GtkGis", + >k_gis_info, 0); + } + + return gtk_gis_type; +} + +static void +gtk_gis_class_init (GtkGisClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (GtkGisPrivate)); + + object_class->set_property = gtk_gis_set_property; + object_class->get_property = gtk_gis_get_property; +} + +static void +gtk_gis_init (GtkGis *gtk_gis) +{ + GtkGisPrivate *priv = GTK_GIS_GET_PRIVATE (gtk_gis); +} + +/** + * gtk_gis_new: + * + * Creates a new #GtkGis object. + * + * Returns: the newly created #GtkGis object. + */ +GtkGis +*gtk_gis_new () +{ + GtkGis *gtk_gis; + + gtk_gis = GTK_GIS (g_object_new (gtk_gis_get_type (), NULL)); + + return gtk_gis; +} + +static void +gtk_gis_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GtkGis *gtk_gis = GTK_GIS (object); + + GtkGisPrivate *priv = GTK_GIS_GET_PRIVATE (gtk_gis); + + switch (property_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gtk_gis_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GtkGis *gtk_gis = GTK_GIS (object); + + GtkGisPrivate *priv = GTK_GIS_GET_PRIVATE (gtk_gis); + + switch (property_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} diff --git a/src/gtkgis.h b/src/gtkgis.h new file mode 100644 index 0000000..30d6485 --- /dev/null +++ b/src/gtkgis.h @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2009 Andrea Zagli + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef __GTK_GIS_H__ +#define __GTK_GIS_H__ + +#include +#include + +G_BEGIN_DECLS + + +#define TYPE_GTK_GIS (gtk_gis_get_type ()) +#define GTK_GIS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GTK_GIS, GtkGis)) +#define GTK_GIS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GTK_GIS, GtkGisClass)) +#define IS_GTK_GIS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GTK_GIS)) +#define IS_GTK_GIS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GTK_GIS)) +#define GTK_GIS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GTK_GIS, GtkGisClass)) + + +typedef struct _GtkGis GtkGis; +typedef struct _GtkGisClass GtkGisClass; + +struct _GtkGis + { + GObject parent; + }; + +struct _GtkGisClass + { + GObjectClass parent_class; + }; + +GType gtk_gis_get_type (void) G_GNUC_CONST; + + +GtkGis *gtk_gis_new (void); + + +G_END_DECLS + +#endif /* __GTK_GIS_H__ */ diff --git a/src/libgtkgis.h b/src/libgtkgis.h new file mode 100644 index 0000000..46c15ab --- /dev/null +++ b/src/libgtkgis.h @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2009 Andrea Zagli + * + * This library 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 2.1 of the License, or (at your option) any later version. + * + * This library 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 this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef __LIBGTKGIS_H__ +#define __LIBGTKGIS_H__ + +#include + +#endif /* __LIBGTKGIS_H__ */ diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..9bad208 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,12 @@ +LIBS = $(GTKGIS_LIBS) + +AM_CPPFLAGS = $(GTKGIS_CFLAGS) \ + -I$(top_srcdir)/src + +libgtkgis = $(top_builddir)/src/libgtkgis.la + +noinst_PROGRAMS = + +LDADD = $(libgtgkis) + +EXTRA_DIST =