diff options
author | Shaun McCance <shaunm@src.gnome.org> | 2003-11-16 19:57:44 +0000 |
---|---|---|
committer | Shaun McCance <shaunm@src.gnome.org> | 2003-11-16 19:57:44 +0000 |
commit | eaf84f6f0d64aebf835f8b81d4ad2e3c55ead8f9 (patch) | |
tree | a2c8355cd7a83e0911d041f13c95db2af504334c | |
parent | ae36d16dc580e98fb7c6a61d1b3d6f5fedb95041 (diff) | |
download | yelp-eaf84f6f0d64aebf835f8b81d4ad2e3c55ead8f9.tar.gz |
- Adding YelpTocPager
* src/Makefile.am:
* src/yelp-base.c:
* src/yelp-toc-pager.c:
* src/yelp-toc-pager.h:
- Adding YelpTocPager
* src/yelp-db-pager.c:
* src/yelp-db-pager.h:
- Whitespace changes
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rw-r--r-- | src/yelp-base.c | 5 | ||||
-rw-r--r-- | src/yelp-db-pager.c | 7 | ||||
-rw-r--r-- | src/yelp-db-pager.h | 6 | ||||
-rw-r--r-- | src/yelp-toc-pager.c | 160 | ||||
-rw-r--r-- | src/yelp-toc-pager.h | 56 |
7 files changed, 242 insertions, 7 deletions
@@ -1,3 +1,15 @@ +2003-11-16 Shaun McCance <shaunm@gnome.org> + + * src/Makefile.am: + * src/yelp-base.c: + * src/yelp-toc-pager.c: + * src/yelp-toc-pager.h: + - Adding YelpTocPager + + * src/yelp-db-pager.c: + * src/yelp-db-pager.h: + - Whitespace changes + 2003-11-15 Shaun McCance <shaunm@gnome.org> * src/yelp-db-pager.c: diff --git a/src/Makefile.am b/src/Makefile.am index 06c282eb..3a7d8a40 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -88,9 +88,10 @@ yelp_SOURCES = \ yelp-html-gtkhtml2.c yelp-html.h \ yelp-info.c yelp-info.h \ yelp-man.c yelp-man.h \ + yelp-pager.c yelp-pager.h \ yelp-section.c yelp-section.h \ yelp-scrollkeeper.c yelp-scrollkeeper.h \ - yelp-pager.c yelp-pager.h \ + yelp-toc-pager.c yelp-toc-pager.h \ yelp-util.c yelp-util.h \ yelp-window.c yelp-window.h \ yelp-uri.c yelp-uri.h \ diff --git a/src/yelp-base.c b/src/yelp-base.c index 9bb9de6e..bebee033 100644 --- a/src/yelp-base.c +++ b/src/yelp-base.c @@ -32,6 +32,7 @@ #include "yelp-scrollkeeper.h" #include "yelp-man.h" #include "yelp-info.h" +#include "yelp-toc-pager.h" #include "yelp-base.h" struct _YelpBasePriv { @@ -162,11 +163,15 @@ yelp_base_new (void) base = g_object_new (YELP_TYPE_BASE, NULL); priv = base->priv; + yelp_toc_pager_init (); + + /* yelp_scrollkeeper_init (priv->toc_tree, &priv->index); yelp_man_init (base->priv->toc_tree, &priv->index); yelp_info_init (base->priv->toc_tree, &priv->index); priv->index = g_list_sort (priv->index, yelp_section_compare); + */ return base; } diff --git a/src/yelp-db-pager.c b/src/yelp-db-pager.c index db0e91c5..f95ad65f 100644 --- a/src/yelp-db-pager.c +++ b/src/yelp-db-pager.c @@ -65,9 +65,9 @@ struct _DBWalker { gint depth; }; -static void db_pager_class_init (YelpDBPagerClass *klass); -static void db_pager_init (YelpDBPager *pager); -static void db_pager_dispose (GObject *gobject); +static void db_pager_class_init (YelpDBPagerClass *klass); +static void db_pager_init (YelpDBPager *pager); +static void db_pager_dispose (GObject *gobject); gboolean db_pager_process (YelpPager *pager); void db_pager_cancel (YelpPager *pager); @@ -285,6 +285,7 @@ db_pager_process (YelpPager *pager) void db_pager_cancel (YelpPager *pager) { + // FIXME } gchar * diff --git a/src/yelp-db-pager.h b/src/yelp-db-pager.h index 2cbb2f78..000fd0fe 100644 --- a/src/yelp-db-pager.h +++ b/src/yelp-db-pager.h @@ -45,10 +45,10 @@ struct _YelpDBPager { }; struct _YelpDBPagerClass { - YelpPagerClass parent_class; + YelpPagerClass parent_class; }; -GType yelp_db_pager_get_type (void); -YelpPager * yelp_db_pager_new (YelpURI *uri); +GType yelp_db_pager_get_type (void); +YelpPager * yelp_db_pager_new (YelpURI *uri); #endif /* __YELP_DB_PAGER_H__ */ diff --git a/src/yelp-toc-pager.c b/src/yelp-toc-pager.c new file mode 100644 index 00000000..9b8115e0 --- /dev/null +++ b/src/yelp-toc-pager.c @@ -0,0 +1,160 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2003 Shaun McCance <shaunm@gnome.org> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Shaun McCance <shaunm@gnome.org> + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <glib.h> +#include <libgnome/gnome-i18n.h> +#include <libxml/parser.h> +#include <libxml/parserInternals.h> + +#include "yelp-toc-pager.h" + +#define d(x) + +struct _YelpTocPagerPriv { +}; + +static void toc_pager_class_init (YelpTocPagerClass *klass); +static void toc_pager_init (YelpTocPager *pager); +static void toc_pager_dispose (GObject *gobject); + +gboolean toc_pager_process (YelpPager *pager); +void toc_pager_cancel (YelpPager *pager); +gchar * toc_pager_resolve_uri (YelpPager *pager, + YelpURI *uri); +const GtkTreeModel * toc_pager_get_sections (YelpPager *pager); + +static YelpPagerClass *parent_class; + +static YelpTocPager *toc_pager; + +GType +yelp_toc_pager_get_type (void) +{ + static GType type = 0; + + if (!type) { + static const GTypeInfo info = { + sizeof (YelpTocPagerClass), + NULL, + NULL, + (GClassInitFunc) toc_pager_class_init, + NULL, + NULL, + sizeof (YelpTocPager), + 0, + (GInstanceInitFunc) toc_pager_init, + }; + type = g_type_register_static (YELP_TYPE_PAGER, + "YelpTocPager", + &info, 0); + } + return type; +} + +static void +toc_pager_class_init (YelpTocPagerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + YelpPagerClass *pager_class = YELP_PAGER_CLASS (klass); + + parent_class = g_type_class_peek_parent (klass); + + object_class->dispose = toc_pager_dispose; + + pager_class->process = toc_pager_process; + pager_class->cancel = toc_pager_cancel; + pager_class->resolve_uri = toc_pager_resolve_uri; + pager_class->get_sections = toc_pager_get_sections; +} + +static void +toc_pager_init (YelpTocPager *pager) +{ + YelpTocPagerPriv *priv; + + priv = g_new0 (YelpTocPagerPriv, 1); + pager->priv = priv; +} + +static void +toc_pager_dispose (GObject *object) +{ + YelpTocPager *pager = YELP_TOC_PAGER (object); + + g_free (pager->priv); + + G_OBJECT_CLASS (parent_class)->dispose (object); +} + +/******************************************************************************/ + +void +yelp_toc_pager_init (void) +{ + toc_pager = (YelpTocPager *) g_object_new (YELP_TYPE_TOC_PAGER, NULL); + + yelp_pager_start (YELP_PAGER (toc_pager)); +} + +YelpPager * +yelp_toc_pager_get (void) +{ + return (YelpPager *) toc_pager; +} + +/******************************************************************************/ + +gboolean +toc_pager_process (YelpPager *pager) +{ + // FIXME below + + while (gtk_events_pending ()) + gtk_main_iteration (); + + return FALSE; +} + +void +toc_pager_cancel (YelpPager *pager) +{ + // FIXME +} + +gchar * +toc_pager_resolve_uri (YelpPager *pager, YelpURI *uri) +{ + // FIXME + return NULL; +} + +const GtkTreeModel * +toc_pager_get_sections (YelpPager *pager) +{ + return NULL; +} + +/******************************************************************************/ diff --git a/src/yelp-toc-pager.h b/src/yelp-toc-pager.h new file mode 100644 index 00000000..16130530 --- /dev/null +++ b/src/yelp-toc-pager.h @@ -0,0 +1,56 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2003 Shaun McCance <shaunm@gnome.org> + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program 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 + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Shaun McCance <shaunm@gnome.org> + */ + +#ifndef __YELP_TOC_PAGER_H__ +#define __YELP_TOC_PAGER_H__ + +#include <glib-object.h> + +#include "yelp-pager.h" + +#define YELP_TYPE_TOC_PAGER (yelp_toc_pager_get_type ()) +#define YELP_TOC_PAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), YELP_TYPE_TOC_PAGER, YelpTocPager)) +#define YELP_TOC_PAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), YELP_TYPE_TOC_PAGER, YelpTocPagerClass)) +#define YELP_IS_TOC_PAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), YELP_TYPE_TOC_PAGER)) +#define YELP_IS_TOC_PAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), YELP_TYPE_TOC_PAGER)) +#define YELP_TOC_PAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), YELP_TYPE_TOC_PAGER, YelpTocPagerClass)) + +typedef struct _YelpTocPager YelpTocPager; +typedef struct _YelpTocPagerClass YelpTocPagerClass; +typedef struct _YelpTocPagerPriv YelpTocPagerPriv; + +struct _YelpTocPager { + YelpPager parent; + + YelpTocPagerPriv *priv; +}; + +struct _YelpTocPagerClass { + YelpPagerClass parent_class; +}; + +GType yelp_toc_pager_get_type (void); + +void yelp_toc_pager_init (void); +YelpPager * yelp_toc_pager_get (void); + +#endif /* __YELP_TOC_PAGER_H__ */ |