From 543e01d216e6c893638289f6faf99a7eab014fad Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sat, 5 Jan 2013 15:40:10 +0100 Subject: [PATCH] Added parsing of collection. Added anjuta project files. --- .anjuta/default.profile | 18 +++ .anjuta_sym_db.db | Bin 0 -> 70656 bytes libgapp.anjuta | 47 +++++++ src/Makefile.am | 11 +- src/collection.c | 292 ++++++++++++++++++++++++++++++++++++++++ src/collection.h | 70 ++++++++++ src/workspace.c | 16 ++- 7 files changed, 449 insertions(+), 5 deletions(-) create mode 100644 .anjuta/default.profile create mode 100644 .anjuta_sym_db.db create mode 100644 libgapp.anjuta create mode 100644 src/collection.c create mode 100644 src/collection.h diff --git a/.anjuta/default.profile b/.anjuta/default.profile new file mode 100644 index 0000000..cf999f6 --- /dev/null +++ b/.anjuta/default.profile @@ -0,0 +1,18 @@ + + + + + + + + + + + + diff --git a/.anjuta_sym_db.db b/.anjuta_sym_db.db new file mode 100644 index 0000000000000000000000000000000000000000..354436da82e164a92e99eff5ee871332cde3b139 GIT binary patch literal 70656 zcmeHw2Y6J+weXa?ceSDyu`FWQ6+);Z2_ZldLK4yZwypu5_c zGv}N+GjnF z|48z=2^GJQ>jMBE{S5<)(tpsu(m&JRi?2yarm|8JNJ-!fN+2{Bkj-R+cv?C<(gW}a zC{y5x>9-O5PyM7MkdnaJErAlOpqlc|{&Po$J3EdI3?3dj(%BX7I1oSBInq14w6v_e zxU{Uev?5woQB}6AYH1l$1(^N{!T;1xN&+bfybmRiNoxXLDq#wJ6b0xBME^p6O@Bnc zO`oA(peN`Z^vd_4AW~IIN#MOBfk}QEB15Bn`v-c_*JcE0F7D_U?mN;k81EZ68b7dS zN*c`yKz>JOS66&!2pFHNGavBLARg)(I1(S7tkN)MP=|Z^5BSp*nt>1Y^v3;@C=CaC zJNvswI=kcPgk}bg3=W(d?;4(rX(V7Q4aEBY$B6z|$DR62NgySGvtI&>u!_R70_D8} zU7fv02G1>9QfgiQm#?TQtrYA3KOy?3v%ki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;Hcu`Z(=G{{$=G z0KS7vC!^$dymVCR z<>mxtcJrJ>6`IJCa~;_|?vJhus$rjNZY) zfj+jrK5x8p-ASk#NI*reORNOCLX*O)|9C4lS>fs_Q!Y6)QAK6%v5v$}dI=2H?#Nx)44 z?EK$Uh~`d~l8xjr`1&4$cmDht&i_`@4!Hk+Km9WOrCYgF+6Pqv;uRehlQgWGeJeJ= zyA13BY$R(rxtN>l_dX2yW1mSV-S_p3paa=ZFP{NW7KJ+`Js6Hmo28dd>FADF7aK!<; z6oQ^aw@ZSxVgLYj^(gQbtze&cx`+q)t@q^mCQ}v#R z1eU5L0eCm9Wh}EEW!V$!Za|iSE@egFFs7r3)lMasIaaC`2jC62mLi~PT!}zBx~xns z#t?JVUcl#01Bz@|rB(*?_#`@QLn*luGIG%sa(EI)VGp84@n*LJM6y0}r!Kh*(3Nfn Nh-4J*^_C%y|3Cje=k@>q literal 0 HcmV?d00001 diff --git a/libgapp.anjuta b/libgapp.anjuta new file mode 100644 index 0000000..5e1cf44 --- /dev/null +++ b/libgapp.anjuta @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Makefile.am b/src/Makefile.am index b456e8a..3f13284 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -14,13 +14,16 @@ AM_CPPFLAGS = $(GAPP_CFLAGS) \ lib_LTLIBRARIES = libgapp.la -libgapp_la_SOURCES = service.c \ - workspace.c +libgapp_la_SOURCES = \ + collection.c \ + service.c \ + workspace.c libgapp_la_LDFLAGS = -no-undefined libgapp_include_HEADERS = gapp.h \ - service.h \ - workspace.h + collection.h \ + service.h \ + workspace.h libgapp_includedir = $(includedir)/libgapp diff --git a/src/collection.c b/src/collection.c new file mode 100644 index 0000000..88e2797 --- /dev/null +++ b/src/collection.c @@ -0,0 +1,292 @@ +/* libgfeed + * + * Copyright (C) 2012 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 + * + * Andrea Zagli + */ + +#include + +#include + +#include "collection.h" + +enum +{ + PROP_0, + PROP_HREF, + PROP_TITLE +}; + +static void gapp_collection_class_init (GappCollectionClass *klass); +static void gapp_collection_init (GappCollection *collection); + +static void gapp_collection_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec); +static void gapp_collection_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec); + +#define GAPP_COLLECTION_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_GAPP_COLLECTION, GappCollectionPrivate)) + +typedef struct _GappCollectionPrivate GappCollectionPrivate; +struct _GappCollectionPrivate + { + gchar *href; + AtomText *title; + }; + +G_DEFINE_TYPE (GappCollection, gapp_collection, TYPE_ATOM_COMMON) + +static void +gapp_collection_class_init (GappCollectionClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof (GappCollectionPrivate)); + + object_class->set_property = gapp_collection_set_property; + object_class->get_property = gapp_collection_get_property; + + g_object_class_install_property (object_class, PROP_HREF, + g_param_spec_string ("href", + "HRef", + "HRef.", + "", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + + g_object_class_install_property (object_class, PROP_TITLE, + g_param_spec_object ("title", + "Title", + "A human-readable title for the collection.", + TYPE_ATOM_TEXT, + G_PARAM_READWRITE)); +} + +static void +gapp_collection_init (GappCollection *collection) +{ +} + +/** + * gapp_collection_new: + * @href: + * + * Returns: the newly created #GappCollection object. + */ +GappCollection +*gapp_collection_new (const gchar *href) +{ + GappCollection *gapp_collection = GAPP_COLLECTION (g_object_new (gapp_collection_get_type (), NULL)); + + g_object_set (G_OBJECT (gapp_collection), + "href", href, + NULL); + + return gapp_collection; +} + +/** + * gapp_collection_new_from_xml: + * @xnode: an #xmlNode. + * + * Returns: the newly created #GappCollection object. + */ +GappCollection +*gapp_collection_new_from_xml (xmlNode *xnode) +{ + GappCollection *gapp_collection; + GappCollectionPrivate *priv; + + gchar *href; + AtomText *title; + + xmlXPathObject *xpresult; + xmlXPathContext *xpcontext; + + guint i; + + gapp_collection = NULL; + + href = xmlGetProp (xnode, "href"); + if (href == NULL) + { + g_critical ("Collection must have an attribute href."); + } + else + { + if (g_strcmp0 (g_strstrip (href), "") == 0) + { + g_critical ("Collection must have a not empty attribute href."); + } + } + + gapp_collection = gapp_collection_new (href); + + title = NULL; + xpcontext = xmlXPathNewContext (xnode->doc); + + xmlXPathRegisterNs (xpcontext, (const xmlChar *)"xmlns", (const xmlChar *)"http://www.w3.org/2007/app"); + xmlXPathRegisterNs (xpcontext, (const xmlChar *)"atom", (const xmlChar *)"http://www.w3.org/2005/Atom"); + + /* searching for title */ + xpcontext->node = xnode; + xpresult = xmlXPathEvalExpression ((const xmlChar *)"child::atom:title", xpcontext); + if (xpresult != NULL + && xpresult->nodesetval != NULL + && xpresult->nodesetval->nodeNr > 0) + { + title = atom_text_new_from_xml (xpresult->nodesetval->nodeTab[0]); + if (title == NULL) + { + g_warning ("Invalid title element."); + } + else + { + g_object_set (G_OBJECT (gapp_collection), + "title", title, + NULL); + } + } + + /* searching for accept */ + xpcontext->node = xnode; + xpresult = xmlXPathEvalExpression ((const xmlChar *)"child::xmlns:accept", xpcontext); + if (xpresult != NULL + && xpresult->nodesetval != NULL) + { + for (i = 0; i < xpresult->nodesetval->nodeNr; i++) + { + } + } + + return gapp_collection; +} + +/** + * atgapp_collection_get_xml: + * @gapp_collection: an #GappCollection object. + * @xnode: an #xmlNode. + * + */ +void +gapp_collection_get_xml (GappCollection *gapp_collection, xmlNode *xnode) +{ + xmlNode *xnodenew; + GList *lst; + + GappCollectionPrivate *priv = GAPP_COLLECTION_GET_PRIVATE (gapp_collection); + + atom_common_get_xml (ATOM_COMMON (gapp_collection), xnode); + + if (priv->title != NULL) + { + xnodenew = xmlNewNode (NULL, (const xmlChar *)"title"); + xmlAddChild (xnode, xnodenew); + atom_text_get_xml (priv->title, xnodenew); + } +} + +const gchar +*gapp_collection_get_href (GappCollection *gapp_collection) +{ + GappCollectionPrivate *priv = GAPP_COLLECTION_GET_PRIVATE (gapp_collection); + + return (const gchar *)priv->href; +} + +const gchar +*gapp_collection_get_title (GappCollection *gapp_collection) +{ + const gchar *ret; + AtomText *title; + + ret = NULL; + + g_object_get (G_OBJECT (gapp_collection), + "title", &title, + NULL); + + if (title != NULL) + { + g_object_get (G_OBJECT (title), + "text", &ret, + NULL); + } + + return ret; +} + +static void +gapp_collection_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) +{ + GObject *obj; + + GappCollection *collection = GAPP_COLLECTION (object); + GappCollectionPrivate *priv = GAPP_COLLECTION_GET_PRIVATE (collection); + + switch (property_id) + { + case PROP_HREF: + if (g_strcmp0 (g_value_get_string (value), "") != 0) + { + if (priv->href != NULL) + { + g_free (priv->href); + } + + priv->href = g_strdup (g_value_get_string (value)); + } + break; + + case PROP_TITLE: + if (g_value_get_object (value) != NULL && IS_ATOM_TEXT (g_value_get_object (value))) + { + priv->title = (AtomText *)g_value_dup_object (value); + } + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gapp_collection_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) +{ + GappCollection *collection = GAPP_COLLECTION (object); + GappCollectionPrivate *priv = GAPP_COLLECTION_GET_PRIVATE (collection); + + switch (property_id) + { + case PROP_HREF: + g_value_set_string (value, priv->href); + break; + + case PROP_TITLE: + g_value_set_object (value, priv->title); + break; + + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} diff --git a/src/collection.h b/src/collection.h new file mode 100644 index 0000000..634821a --- /dev/null +++ b/src/collection.h @@ -0,0 +1,70 @@ +/* libgfeed + * + * Copyright (C) 2012 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 + * + * Andrea Zagli + */ + +#ifndef __GAPP_COLLECTION_H__ +#define __GAPP_COLLECTION_H__ + +#include +#include +#include + +#include + +#include "collection.h" + +G_BEGIN_DECLS + + +#define TYPE_GAPP_COLLECTION (gapp_collection_get_type ()) +#define GAPP_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GAPP_COLLECTION, GappCollection)) +#define GAPP_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GAPP_COLLECTION, GappCollectionClass)) +#define IS_GAPP_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GAPP_COLLECTION)) +#define IS_GAPP_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GAPP_COLLECTION)) +#define GAPP_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GAPP_COLLECTION, GappCollectionClass)) + + +typedef struct _GappCollection GappCollection; +typedef struct _GappCollectionClass GappCollectionClass; + +struct _GappCollection + { + GObject parent; + }; + +struct _GappCollectionClass + { + GObjectClass parent_class; + }; + +GType gapp_collection_get_type (void) G_GNUC_CONST; + +GappCollection *gapp_collection_new (const gchar *href); +GappCollection *gapp_collection_new_from_xml (xmlNode *xnode); + +void gapp_collection_get_xml (GappCollection *gapp_collection, xmlNode *xnode); + +const gchar *gapp_collection_get_href (GappCollection *gapp_collection); +const gchar *gapp_collection_get_title (GappCollection *gapp_collection); + + +G_END_DECLS + +#endif /* __GAPP_COLLECTION_H__ */ diff --git a/src/workspace.c b/src/workspace.c index dc4c031..ebc82a0 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -24,6 +24,7 @@ #include #include "workspace.h" +#include "collection.h" enum { @@ -49,6 +50,8 @@ typedef struct _GappWorkspacePrivate GappWorkspacePrivate; struct _GappWorkspacePrivate { AtomText *title; + + GSList *collection; }; G_DEFINE_TYPE (GappWorkspace, gapp_workspace, TYPE_ATOM_COMMON) @@ -72,8 +75,9 @@ gapp_workspace_class_init (GappWorkspaceClass *klass) } static void -gapp_workspace_init (GappWorkspace *atome) +gapp_workspace_init (GappWorkspace *workspace) { + } /** @@ -110,6 +114,8 @@ GappWorkspace xmlXPathObject *xpresult; xmlXPathContext *xpcontext; + GappCollection *collection; + title = NULL; xpcontext = xmlXPathNewContext (xnode->doc); @@ -143,6 +149,14 @@ GappWorkspace { if (xmlStrcmp (cur->name, (const xmlChar *)"collection") == 0) { + collection = gapp_collection_new_from_xml (cur); + if (collection != NULL) + { + g_message ("Collection found: \"%s\" - \"%s\"", + gapp_collection_get_href (collection), + gapp_collection_get_title (collection)); + priv->collection = g_slist_append (priv->collection, collection); + } } cur = cur->next; -- 2.49.0