From: Andrea Zagli Date: Mon, 18 Jul 2011 06:54:01 +0000 (+0200) Subject: Inizio sviluppo interfaccia OpenOffice. X-Git-Tag: 0.5.0~50 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=31a48caea3d91ffd3550ffbce064b5d8b1b9c04c;p=solipa%2Flibsolipa Inizio sviluppo interfaccia OpenOffice. --- diff --git a/configure.ac b/configure.ac index dc357af..1b8ce26 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.65) -AC_INIT([libsolipa], [0.3.1], [azagli@libero.it]) +AC_INIT([libsolipa], [0.4.0], [azagli@libero.it]) AC_CONFIG_SRCDIR([src/solipa.c]) AC_CONFIG_HEADER([config.h]) @@ -41,6 +41,11 @@ PKG_CHECK_MODULES(SOLIPA, [gobject-2.0 >= 2.24.0 AC_SUBST(SOLIPA_CFLAGS) AC_SUBST(SOLIPA_LIBS) +AC_CHECK_PROG(PYTHON_CFLAGS, [python-config], `python-config --cflags`, [-I/c/Python26/include]) +AC_CHECK_PROG(PYTHON_LIBS, [python-config], `python-config --libs`, [-lpthread -lm -L/c/Python26/libs -lpython26]) +AC_SUBST(PYTHON_CFLAGS) +AC_SUBST(PYTHON_LIBS) + # Checks for header files. AC_HEADER_STDC @@ -52,6 +57,7 @@ AC_C_CONST # Checks for library functions. AC_CONFIG_FILES([ libsolipa.pc + libsolipaooo.pc Makefile src/Makefile data/Makefile diff --git a/libsolipa.pc.in b/libsolipa.pc.in index b49fd98..f7b58d0 100644 --- a/libsolipa.pc.in +++ b/libsolipa.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: @PACKAGE_NAME@ Description: Classe con funzioni varie di utilità. Version: @PACKAGE_VERSION@ -Requires: glib-2.0 gobject-2.0 libgdaex camel-provider-1.2 gtk+-2.0 +Requires: glib-2.0 gobject-2.0 libgdaex camel-provider-1.2 gtk+-2.0 libgtkform gio-2.0 Libs: -L${libdir} -lsolipa Cflags: -I${includedir} diff --git a/libsolipaooo.pc.in b/libsolipaooo.pc.in new file mode 100644 index 0000000..fb3d342 --- /dev/null +++ b/libsolipaooo.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: @PACKAGE_NAME@ +Description: Classe con funzioni varie di utilità - Supporto per l'interfacciamento a OpenOffice.org. +Version: @PACKAGE_VERSION@ +Requires: libsolipa +Libs: -L${libdir} -lsolipa +Cflags: -I${includedir} diff --git a/src/Makefile.am b/src/Makefile.am index c2e59c1..83f8750 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,7 +6,8 @@ AM_CPPFLAGS = $(SOLIPA_CFLAGS) \ -DGUIDIR=\""$(guidir)"\" \ -DG_LOG_DOMAIN=\"Solipa\" -lib_LTLIBRARIES = libsolipa.la +lib_LTLIBRARIES = libsolipa.la \ + libsolipaooo.la libsolipa_la_SOURCES = solipa.c \ allegato.c \ @@ -27,4 +28,16 @@ libsolipa_include_HEADERS = libsolipa.h \ progresswindow.h \ utils.h +libsolipaooo_la_LIBADD = $(PYTHON_LIBS) + +libsolipaooo_la_CFLAGS = $(PYTHON_CFLAGS) + +libsolipaooo_la_LDFLAGS = -no-undefined + +libsolipaooo_la_SOURCES = ooo.c + +libsolipaooo_include_HEADERS = ooo.h + libsolipa_includedir = $(includedir)/libsolipa + +libsolipaooo_includedir = $(includedir)/libsolipa diff --git a/src/ooo.c b/src/ooo.c new file mode 100644 index 0000000..83d75aa --- /dev/null +++ b/src/ooo.c @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2011 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 + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "ooo.h" + +static void solipa_ooo_class_init (SolipaOOOClass *class); +static void solipa_ooo_init (SolipaOOO *solipa_ooo); + +static void solipa_ooo_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec); +static void solipa_ooo_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec); + +static void solipa_ooo_dispose (GObject *gobject); +static void solipa_ooo_finalize (GObject *gobject); + +#define SOLIPA_OOO_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), SOLIPA_OOO_TYPE, SolipaOOOPrivate)) + +typedef struct _SolipaOOOPrivate SolipaOOOPrivate; +struct _SolipaOOOPrivate + { + gpointer foo; + }; + +G_DEFINE_TYPE (SolipaOOO, solipa_ooo, G_TYPE_OBJECT) + +static void +solipa_ooo_class_init (SolipaOOOClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->set_property = solipa_ooo_set_property; + object_class->get_property = solipa_ooo_get_property; + object_class->dispose = solipa_ooo_dispose; + object_class->finalize = solipa_ooo_finalize; + + g_type_class_add_private (object_class, sizeof (SolipaOOOPrivate)); +} + +static void +solipa_ooo_init (SolipaOOO *solipa_ooo) +{ + SolipaOOOPrivate *priv = SOLIPA_OOO_GET_PRIVATE (solipa_ooo); +} + +/** + * solipa_ooo_new: + * + * Returns: the newly created #SolipaOOO object. + */ +SolipaOOO +*solipa_ooo_new () +{ + SolipaOOO *solipa_ooo; + SolipaOOOPrivate *priv; + + solipa_ooo = SOLIPA_OOO (g_object_new (solipa_ooo_get_type (), NULL)); + + priv = SOLIPA_OOO_GET_PRIVATE (solipa_ooo); + + return solipa_ooo; +} + +/* PRIVATE */ +static void +solipa_ooo_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + SolipaOOO *solipa_ooo = (SolipaOOO *)object; + SolipaOOOPrivate *priv = SOLIPA_OOO_GET_PRIVATE (solipa_ooo); + + switch (property_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +solipa_ooo_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + SolipaOOO *solipa_ooo = (SolipaOOO *)object; + SolipaOOOPrivate *priv = SOLIPA_OOO_GET_PRIVATE (solipa_ooo); + + switch (property_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +solipa_ooo_dispose (GObject *gobject) +{ + SolipaOOO *solipa_ooo = (SolipaOOO *)gobject; + SolipaOOOPrivate *priv = SOLIPA_OOO_GET_PRIVATE (solipa_ooo); + + /*if (priv->gdaex) + { + g_object_unref (priv->gdaex); + priv->gdaex = NULL; + }*/ + + GObjectClass *parent_class = g_type_class_peek_parent (G_OBJECT_GET_CLASS (gobject)); + parent_class->dispose (gobject); +} + +static void +solipa_ooo_finalize (GObject *gobject) +{ + SolipaOOO *solipa_ooo = (SolipaOOO *)gobject; + SolipaOOOPrivate *priv = SOLIPA_OOO_GET_PRIVATE (solipa_ooo); + + /*g_free (priv->camel_tmpdir);*/ + + GObjectClass *parent_class = g_type_class_peek_parent (G_OBJECT_GET_CLASS (gobject)); + parent_class->finalize (gobject); +} diff --git a/src/ooo.h b/src/ooo.h new file mode 100644 index 0000000..63ff517 --- /dev/null +++ b/src/ooo.h @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2011 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 __SOLIPA_OOO_H__ +#define __SOLIPA_OOO_H__ + +#include +#include + +#include + +#include + +#include + + +G_BEGIN_DECLS + + +#define SOLIPA_OOO_TYPE (solipa_ooo_get_type ()) +#define SOLIPA_OOO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOLIPA_OOO_TYPE, SolipaOOO)) +#define SOLIPA_OOO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOLIPA_OOO_TYPE, SolipaOOOClass)) +#define IS_SOLIPA_OOO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOLIPA_OOO_TYPE)) +#define IS_SOLIPA_OOO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SOLIPA_OOO_TYPE)) +#define SOLIPA_OOO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOLIPA_OOO_TYPE, SolipaOOOClass)) + +typedef struct _SolipaOOO SolipaOOO; +typedef struct _SolipaOOOClass SolipaOOOClass; + +struct _SolipaOOO + { + GObject parent; + }; + +struct _SolipaOOOClass + { + GObjectClass parent_class; + }; + +GType solipa_ooo_get_type (void) G_GNUC_CONST; + + +SolipaOOO *solipa_ooo_new (void); + + +G_END_DECLS + + +#endif /* __SOLIPA_OOO_H__ */