From 35f3c3ea86b3eaf656ec632f2b1ce80a082fca9e Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Fri, 15 Oct 2010 20:49:03 +0200 Subject: [PATCH] Inizio sviluppo allegato. --- configure.ac | 3 +- data/libsolipa/gui/libsolipa.ui | 150 ++++++++++++++++++++++++++++++++ src/Makefile.am | 6 +- src/allegato.c | 122 ++++++++++++++++++++++++++ src/allegato.h | 60 +++++++++++++ src/solipa.c | 15 +++- src/solipa.h | 4 + 7 files changed, 356 insertions(+), 4 deletions(-) create mode 100644 src/allegato.c create mode 100644 src/allegato.h diff --git a/configure.ac b/configure.ac index ba43080..4b78194 100644 --- a/configure.ac +++ b/configure.ac @@ -28,7 +28,8 @@ AC_PROG_RANLIB # Checks for libraries. PKG_CHECK_MODULES(SOLIPA, [gobject-2.0 >= 2.24.0 - glib-2.0 >= 2.24.0]) + glib-2.0 >= 2.24.0 + libgdaex >= 0.2.2]) AC_SUBST(SOLIPA_CFLAGS) AC_SUBST(SOLIPA_LIBS) diff --git a/data/libsolipa/gui/libsolipa.ui b/data/libsolipa/gui/libsolipa.ui index 8fc2c38..8accd27 100644 --- a/data/libsolipa/gui/libsolipa.ui +++ b/data/libsolipa/gui/libsolipa.ui @@ -1,4 +1,154 @@ + + + Allegato - Gestione mezzi + True + center-on-parent + 480 + True + + + True + 4 + 2 + 5 + 5 + + + True + 0 + Percorso del file + + + GTK_FILL + GTK_FILL + + + + + True + 5 + + + True + True + False + + gtk-clear + True + True + + + 0 + + + + + ... + True + True + True + + + False + 1 + + + + + 1 + 2 + GTK_FILL + + + + + True + 0 + Data del file + + + 2 + 3 + GTK_FILL + GTK_FILL + + + + + True + True + False + + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + True + 0 + Dimensione del file + + + 3 + 4 + GTK_FILL + GTK_FILL + + + + + True + True + False + + + + 1 + 2 + 3 + 4 + GTK_FILL + + + + + True + True + False + 0.52999997138977051 + True + + + 1 + 2 + 1 + 2 + GTK_FILL + + + + + True + 0 + Salva nel database + + + 1 + 2 + GTK_FILL + GTK_FILL + + + + + diff --git a/src/Makefile.am b/src/Makefile.am index 775fea9..e16786d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,11 +4,13 @@ AM_CPPFLAGS = $(SOLIPA_CFLAGS) lib_LTLIBRARIES = libsolipa.la -libsolipa_la_SOURCES = solipa.c +libsolipa_la_SOURCES = solipa.c \ + allegato.c libsolipa_la_LDFLAGS = -no-undefined libsolipa_include_HEADERS = libsolipa.h \ - solipa.h + solipa.h \ + allegato.h libsolipa_includedir = $(includedir)/libsolipa diff --git a/src/allegato.c b/src/allegato.c new file mode 100644 index 0000000..7d0e43a --- /dev/null +++ b/src/allegato.c @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2010 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 "allegato.h" + +static void solipa_allegato_class_init (SolipaAllegatoClass *class); +static void solipa_allegato_init (SolipaAllegato *solipa_allegato); + +static void solipa_allegato_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec); +static void solipa_allegato_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec); + +#define SOLIPA_ALLEGATO_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_SOLIPA_ALLEGATO, SolipaAllegatoPrivate)) + +typedef struct _SolipaAllegatoPrivate SolipaAllegatoPrivate; +struct _SolipaAllegatoPrivate + { + Solipa *solipa; + }; + +G_DEFINE_TYPE (SolipaAllegato, solipa_allegato, G_TYPE_OBJECT) + +static void +solipa_allegato_class_init (SolipaAllegatoClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->set_property = solipa_allegato_set_property; + object_class->get_property = solipa_allegato_get_property; + + g_type_class_add_private (object_class, sizeof (SolipaAllegatoPrivate)); +} + +static void +solipa_allegato_init (SolipaAllegato *solipa_allegato) +{ + SolipaAllegatoPrivate *priv = SOLIPA_ALLEGATO_GET_PRIVATE (solipa_allegato); +} + +/** + * solipa_allegato_new: + * @solipa: + * + * Returns: the newly created #SolipaAllegato object. + */ +SolipaAllegato +*solipa_allegato_new (Solipa *solipa) +{ + SolipaAllegato *solipa_allegato; + SolipaAllegatoPrivate *priv; + + g_return_val_if_fail (IS_SOLIPA (solipa), NULL); + + solipa_allegato = SOLIPA_ALLEGATO (g_object_new (solipa_allegato_get_type (), NULL)); + + priv = SOLIPA_ALLEGATO_GET_PRIVATE (solipa_allegato); + + priv->solipa = solipa; + + return solipa_allegato; +} + +/* PRIVATE */ +static void +solipa_allegato_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + SolipaAllegato *solipa_allegato = (SolipaAllegato *)object; + + SolipaAllegatoPrivate *priv = SOLIPA_ALLEGATO_GET_PRIVATE (solipa_allegato); + + switch (property_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +solipa_allegato_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + SolipaAllegato *solipa_allegato = (SolipaAllegato *)object; + + SolipaAllegatoPrivate *priv = SOLIPA_ALLEGATO_GET_PRIVATE (solipa_allegato); + + switch (property_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} diff --git a/src/allegato.h b/src/allegato.h new file mode 100644 index 0000000..b26b9f0 --- /dev/null +++ b/src/allegato.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2010 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_ALLEGATO_H__ +#define __SOLIPA_ALLEGATO_H__ + +#include +#include + +#include + + +G_BEGIN_DECLS + + +#define TYPE_SOLIPA_ALLEGATO (solipa_allegato_get_type ()) +#define SOLIPA_ALLEGATO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SOLIPA_ALLEGATO, SolipaAllegato)) +#define SOLIPA_ALLEGATO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SOLIPA_ALLEGATO, SolipaAllegatoClass)) +#define IS_SOLIPA_ALLEGATO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_SOLIPA_ALLEGATO)) +#define IS_SOLIPA_ALLEGATO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_SOLIPA_ALLEGATO)) +#define SOLIPA_ALLEGATO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_SOLIPA_ALLEGATO, SolipaAllegatoClass)) + +typedef struct _SolipaAllegato SolipaAllegato; +typedef struct _SolipaAllegatoClass SolipaAllegatoClass; + +struct _SolipaAllegato + { + GObject parent; + }; + +struct _SolipaAllegatoClass + { + GObjectClass parent_class; + }; + +GType solipa_allegato_get_type (void) G_GNUC_CONST; + + +SolipaAllegato *solipa_allegato_new (Solipa *solipa); + + +G_END_DECLS + + +#endif /* __SOLIPA_ALLEGATO_H__ */ diff --git a/src/solipa.c b/src/solipa.c index b344a28..c4a99d2 100644 --- a/src/solipa.c +++ b/src/solipa.c @@ -39,7 +39,7 @@ static void solipa_get_property (GObject *object, typedef struct _SolipaPrivate SolipaPrivate; struct _SolipaPrivate { - gpointer foo; + GdaEx *gdaex; }; G_DEFINE_TYPE (Solipa, solipa, G_TYPE_OBJECT) @@ -73,6 +73,19 @@ Solipa return SOLIPA (g_object_new (solipa_get_type (), NULL)); } +void +solipa_set_gdaex (Solipa *solipa, GdaEx *gdaex) +{ + SolipaPrivate *priv; + + g_return_if_fail (IS_SOLIPA (solipa)); + g_return_if_fail (IS_GDAEX (gdaex)); + + priv = SOLIPA_GET_PRIVATE (solipa); + + priv->gdaex = gdaex; +} + /* PRIVATE */ static void solipa_set_property (GObject *object, diff --git a/src/solipa.h b/src/solipa.h index f102fb2..18126f5 100644 --- a/src/solipa.h +++ b/src/solipa.h @@ -22,6 +22,8 @@ #include #include +#include + G_BEGIN_DECLS @@ -51,6 +53,8 @@ GType solipa_get_type (void) G_GNUC_CONST; Solipa *solipa_new (void); +void solipa_set_gdaex (Solipa *solipa, GdaEx *gdaex); + G_END_DECLS -- 2.49.0