summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Scorgie <dscorgie@src.gnome.org>2007-06-20 19:13:00 +0000
committerDon Scorgie <dscorgie@src.gnome.org>2007-06-20 19:13:00 +0000
commit0ee644ec4aca9aa354ff9f05dfd4fca8cc7947a8 (patch)
treeba998b2394784842c2025169c3805d8e65e27d0d
parent1bc97272e1333418e5aa22f9a96567ddf4e841a7 (diff)
downloadyelp-0ee644ec4aca9aa354ff9f05dfd4fca8cc7947a8.tar.gz
Spoon is now Rarian. Bump min version to 0.5.0
* configure.in: * src/test-resolver.c: * src/yelp-toc.c: * src/yelp-window.c: * src/yelp-utils.c: * src/yelp-utils.h: Spoon is now Rarian. Bump min version to 0.5.0 svn path=/branches/yelp-spoon/; revision=2827
-rw-r--r--ChangeLog10
-rw-r--r--configure.in2
-rw-r--r--src/test-resolver.c6
-rw-r--r--src/yelp-toc.c22
-rw-r--r--src/yelp-utils.c94
-rw-r--r--src/yelp-utils.h22
-rw-r--r--src/yelp-window.c52
7 files changed, 98 insertions, 110 deletions
diff --git a/ChangeLog b/ChangeLog
index 0bd0b450..cbada9e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-06-20 Don Scorgie <dscorgie@svn.gnome.org>
+
+ * configure.in:
+ * src/test-resolver.c:
+ * src/yelp-toc.c:
+ * src/yelp-window.c:
+ * src/yelp-utils.c:
+ * src/yelp-utils.h:
+ Spoon is now Rarian. Bump min version to 0.5.0
+
2007-06-14 Don Scorgie <dscorgie@svn.gnome.org>
* src/yelp-utils.c:
diff --git a/configure.in b/configure.in
index e360decb..010bebbd 100644
--- a/configure.in
+++ b/configure.in
@@ -78,7 +78,7 @@ PKG_CHECK_MODULES(YELP,
libexslt >= 0.8.1
libstartup-notification-1.0 >= 0.8
dbus-glib-1
- spoon >= 0.4.5
+ rarian >= 0.5.0
])
AC_SUBST([YELP_CFLAGS])
AC_SUBST([YELP_LIBS])
diff --git a/src/test-resolver.c b/src/test-resolver.c
index 48f3c5f9..b39d11a5 100644
--- a/src/test-resolver.c
+++ b/src/test-resolver.c
@@ -26,9 +26,9 @@ DefaultTests (void)
{
gchar *result = NULL;
gchar *section = NULL;
- YelpSpoonType restype = YELP_TYPE_ERROR;
+ YelpRrnType restype = YELP_TYPE_ERROR;
- /* First, normal docs - these will only work with spoon XDG_DATA_DIRS set correctly */
+ /* First, normal docs - these will only work with rrn XDG_DATA_DIRS set correctly */
/* Normal doc, no section */
restype = yelp_uri_resolve ("ghelp:user-guide", &result, &section);
if (restype != YELP_TYPE_DOC || !TestFile (result) ||
@@ -223,7 +223,7 @@ main (int argc, char *argv[])
char *type = argv[i+1];
char *result = NULL;
char *section = NULL;
- YelpSpoonType restype = YELP_TYPE_ERROR;
+ YelpRrnType restype = YELP_TYPE_ERROR;
printf ("uri: %s type: %s\n", argv[i], argv[i+1]);
diff --git a/src/yelp-toc.c b/src/yelp-toc.c
index 08f5e0e1..2db87507 100644
--- a/src/yelp-toc.c
+++ b/src/yelp-toc.c
@@ -33,13 +33,13 @@
#include <libxml/parserInternals.h>
#include <libxml/xinclude.h>
#include <libxml/xmlreader.h>
-#include <spoon.h>
+#include <rarian.h>
#ifdef ENABLE_INFO
-#include <spoon-info.h>
+#include <rarian-info.h>
#endif /* ENABLE_INFO */
#ifdef ENABLE_MAN
-#include <spoon-man.h>
+#include <rarian-man.h>
#endif /* ENABLE_MAN */
#include "yelp-error.h"
@@ -419,10 +419,10 @@ transform_final_func (YelpTransform *transform, YelpToc *toc)
/** Threaded ******************************************************************/
static int
-spoon_add_document (void *reg, void * user_data)
+rrn_add_document (void *reg, void * user_data)
{
xmlNodePtr node = (xmlNodePtr) user_data;
- SpoonReg *r = (SpoonReg *) reg;
+ RrnReg *r = (RrnReg *) reg;
xmlNodePtr new;
gchar *tmp;
new = xmlNewChild (node, NULL, BAD_CAST "doc", NULL);
@@ -535,7 +535,7 @@ toc_process (YelpToc *toc)
BAD_CAST "subject")) {
xmlChar *cat = xmlTextReaderGetAttribute (reader,
BAD_CAST "category");
- spoon_for_each_in_category (spoon_add_document,
+ rrn_for_each_in_category (rrn_add_document,
(char *) cat,
(void *) node);
xmlFree (cat);
@@ -668,7 +668,7 @@ xml_trim_titles (xmlNodePtr node, xmlChar * nodetype)
#ifdef ENABLE_INFO
static int
-spoon_info_add_document (SpoonInfoEntry *entry, void *user_data)
+rrn_info_add_document (RrnInfoEntry *entry, void *user_data)
{
xmlNodePtr node = (xmlNodePtr) user_data;
xmlNodePtr new;
@@ -734,7 +734,7 @@ toc_process_info (YelpToc *toc)
xmlXPathFreeObject (obj);
xmlXPathFreeContext (xpath);
- categories = spoon_info_get_categories ();
+ categories = rrn_info_get_categories ();
cat_iter = categories;
while (cat_iter && *cat_iter) {
@@ -758,7 +758,7 @@ toc_process_info (YelpToc *toc)
xmlNewTextChild (cat_node, NULL, BAD_CAST "title",
BAD_CAST *cat_iter);
- spoon_info_for_each_in_category (*cat_iter, (SpoonInfoForeachFunc) spoon_info_add_document,
+ rrn_info_for_each_in_category (*cat_iter, (RrnInfoForeachFunc) rrn_info_add_document,
cat_node);
cat_iter++;
}
@@ -794,7 +794,7 @@ toc_process_info (YelpToc *toc)
#ifdef ENABLE_MAN
static int
-spoon_add_man_document (SpoonManEntry *entry, void *user_data)
+rrn_add_man_document (RrnManEntry *entry, void *user_data)
{
xmlNodePtr node = (xmlNodePtr) user_data;
xmlNodePtr new;
@@ -852,7 +852,7 @@ toc_process_man (YelpToc *toc)
cat_node = xmlNewChild (node, NULL, BAD_CAST "toc",
NULL);
for (j = 0; sects[j] != NULL; j++)
- spoon_man_for_each_in_category (sects[j], (SpoonManForeachFunc) spoon_add_man_document, node);
+ rrn_man_for_each_in_category (sects[j], (RrnManForeachFunc) rrn_add_man_document, node);
g_strfreev (sects);
}
xmlFree (sect);
diff --git a/src/yelp-utils.c b/src/yelp-utils.c
index 16b91079..7bf3559b 100644
--- a/src/yelp-utils.c
+++ b/src/yelp-utils.c
@@ -1047,16 +1047,16 @@ convert_info_uri (gchar *uri)
}
#else /*DON_UTIL*/
-#include <spoon-info.h>
-#include <spoon-man.h>
-#include <spoon.h>
+#include <rarian-info.h>
+#include <rarian-man.h>
+#include <rarian.h>
-YelpSpoonType
+YelpRrnType
resolve_process_ghelp (char *uri, gchar **result)
{
- SpoonReg *reg = spoon_find_from_ghelp (&uri[6]);
- YelpSpoonType type = YELP_SPOON_TYPE_ERROR;
+ RrnReg *reg = rrn_find_from_ghelp (&uri[6]);
+ YelpRrnType type = YELP_RRN_TYPE_ERROR;
if (reg) {
gchar *mime = NULL;
@@ -1074,10 +1074,10 @@ resolve_process_ghelp (char *uri, gchar **result)
if (g_str_equal (mime, "text/xml") ||
g_str_equal (mime, "application/docbook+xml") ||
g_str_equal (mime, "application/xml"))
- type = YELP_SPOON_TYPE_DOC;
+ type = YELP_RRN_TYPE_DOC;
else if (g_str_equal (mime, "text/html") ||
g_str_equal (mime, "application/xhtml+xml"))
- type = YELP_SPOON_TYPE_HTML;
+ type = YELP_RRN_TYPE_HTML;
}
@@ -1108,7 +1108,7 @@ resolve_is_man_path (const gchar *path, const gchar *encoding)
gchar **cats;
gchar **iter;
- cats = spoon_man_get_categories ();
+ cats = rrn_man_get_categories ();
iter = cats;
@@ -1133,54 +1133,54 @@ resolve_is_man_path (const gchar *path, const gchar *encoding)
return FALSE;
}
-YelpSpoonType
+YelpRrnType
resolve_full_file (const gchar *path)
{
gchar *mime_type;
- YelpSpoonType type = YELP_SPOON_TYPE_ERROR;
+ YelpRrnType type = YELP_RRN_TYPE_ERROR;
if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
- return YELP_SPOON_TYPE_ERROR;
+ return YELP_RRN_TYPE_ERROR;
}
mime_type = gnome_vfs_get_mime_type (path);
if (mime_type == NULL)
- return YELP_SPOON_TYPE_ERROR;
+ return YELP_RRN_TYPE_ERROR;
if (g_str_equal (mime_type, "text/xml") || g_str_equal (mime_type, "application/docbook+xml") || g_str_equal (mime_type, "application/xml"))
- type = YELP_SPOON_TYPE_DOC;
+ type = YELP_RRN_TYPE_DOC;
else if (g_str_equal (mime_type, "text/html") ||
g_str_equal (mime_type, "application/xhtml+xml"))
- type = YELP_SPOON_TYPE_HTML;
+ type = YELP_RRN_TYPE_HTML;
/* No distinction between HTML and XHTML now. They're handled the same way */
else if (g_str_equal (mime_type, "application/x-gzip")) {
if (g_str_has_suffix (path, ".info.gz")) {
- type = YELP_SPOON_TYPE_INFO;
+ type = YELP_RRN_TYPE_INFO;
} else if (resolve_is_man_path (path, "gz")) {
- type = YELP_SPOON_TYPE_MAN;
+ type = YELP_RRN_TYPE_MAN;
}
} else if (g_str_equal (mime_type, "application/x-bzip")) {
if (g_str_has_suffix (path, ".info.bz2")) {
- type = YELP_SPOON_TYPE_INFO;
+ type = YELP_RRN_TYPE_INFO;
} else if (resolve_is_man_path (path, "bz2")) {
- type = YELP_SPOON_TYPE_MAN;
+ type = YELP_RRN_TYPE_MAN;
}
} else if (g_str_equal (mime_type, "text/plain")) {
if (g_str_has_suffix (path, ".info")) {
- type = YELP_SPOON_TYPE_INFO;
+ type = YELP_RRN_TYPE_INFO;
} else if (resolve_is_man_path (path, NULL)) {
- type = YELP_SPOON_TYPE_MAN;
+ type = YELP_RRN_TYPE_MAN;
}
} else {
- type = YELP_SPOON_TYPE_EXTERNAL;
+ type = YELP_RRN_TYPE_EXTERNAL;
}
g_free (mime_type);
return type;
}
-YelpSpoonType
+YelpRrnType
resolve_man_page (const gchar *name, gchar **result, gchar **section)
{
/* Various ways the path could be presented:
@@ -1196,7 +1196,7 @@ resolve_man_page (const gchar *name, gchar **result, gchar **section)
gchar *sect = NULL;
gchar *real_name = NULL;
gboolean repeat = FALSE;
- SpoonManEntry *entry = NULL;
+ RrnManEntry *entry = NULL;
lbrace = strrchr (name, '(');
if (lbrace) {
@@ -1230,29 +1230,29 @@ resolve_man_page (const gchar *name, gchar **result, gchar **section)
/* Full filename */
printf ("Exists\n");
*result = g_strdup (real_name);
- return YELP_SPOON_TYPE_MAN;
+ return YELP_RRN_TYPE_MAN;
} else if (g_file_test (name, G_FILE_TEST_EXISTS)) {
/* Full filename */
printf ("Exists\n");
*result = g_strdup (name);
- return YELP_SPOON_TYPE_MAN;
+ return YELP_RRN_TYPE_MAN;
}
- entry = spoon_man_find_from_name (real_name, sect);
+ entry = rrn_man_find_from_name (real_name, sect);
if (entry) {
*result = strdup (entry->path);
/**section = strdup (entry->section);*/
- return YELP_SPOON_TYPE_MAN;
+ return YELP_RRN_TYPE_MAN;
} else if (repeat) {
- entry = spoon_man_find_from_name (name, NULL);
+ entry = rrn_man_find_from_name (name, NULL);
if (entry) {
*result = strdup (entry->path);
/**section = strdup (entry->section);*/
- return YELP_SPOON_TYPE_MAN;
+ return YELP_RRN_TYPE_MAN;
}
}
- return YELP_SPOON_TYPE_ERROR;
+ return YELP_RRN_TYPE_ERROR;
}
@@ -1265,10 +1265,10 @@ resolve_remove_section (const gchar *uri, const gchar *sect)
return (g_strdup (uri));
}
-YelpSpoonType
+YelpRrnType
yelp_uri_resolve (gchar *uri, gchar **result, gchar **section)
{
- YelpSpoonType ret = YELP_SPOON_TYPE_ERROR;
+ YelpRrnType ret = YELP_RRN_TYPE_ERROR;
gchar *intern_section = NULL;
gchar *intern_uri = NULL;
g_assert (result != NULL);
@@ -1295,7 +1295,7 @@ yelp_uri_resolve (gchar *uri, gchar **result, gchar **section)
}
} else if (!strncmp (uri, "man:", 4)) {
ret = resolve_man_page (&uri[4], result, section);
- if (ret == YELP_SPOON_TYPE_ERROR) {
+ if (ret == YELP_RRN_TYPE_ERROR) {
*result = NULL;
*section = NULL;
}
@@ -1306,12 +1306,12 @@ yelp_uri_resolve (gchar *uri, gchar **result, gchar **section)
gchar *info_name = intern_uri;
gchar *info_sect = intern_section;
gboolean free_stuff = FALSE;
- SpoonInfoEntry *entry = NULL;
+ RrnInfoEntry *entry = NULL;
if (g_str_equal (&uri[5], "dir")) {
*section = g_strdup ("info");
*result = NULL;
- ret = YELP_SPOON_TYPE_TOC;
+ ret = YELP_RRN_TYPE_TOC;
return ret;
}
@@ -1331,9 +1331,9 @@ yelp_uri_resolve (gchar *uri, gchar **result, gchar **section)
info_name += 5;
}
- entry = spoon_info_find_from_uri (info_name, info_sect);
+ entry = rrn_info_find_from_uri (info_name, info_sect);
if (entry) {
- ret = YELP_SPOON_TYPE_INFO;
+ ret = YELP_RRN_TYPE_INFO;
if (entry->section)
*section = g_strdup (entry->section);
else
@@ -1342,7 +1342,7 @@ yelp_uri_resolve (gchar *uri, gchar **result, gchar **section)
} else {
ret = resolve_man_page (&uri[5], result, section);
if (!ret) {
- ret = YELP_SPOON_TYPE_ERROR;
+ ret = YELP_RRN_TYPE_ERROR;
*section = NULL;
*result = NULL;
}
@@ -1353,11 +1353,11 @@ yelp_uri_resolve (gchar *uri, gchar **result, gchar **section)
}
} else if (!strncmp (uri, "file:", 5)) {
ret = resolve_full_file (&intern_uri[5]);
- if (ret == YELP_SPOON_TYPE_EXTERNAL) {
+ if (ret == YELP_RRN_TYPE_EXTERNAL) {
*section = NULL;
*result = g_strdup (uri);
}
- else if (ret == YELP_SPOON_TYPE_ERROR) {
+ else if (ret == YELP_RRN_TYPE_ERROR) {
*section = NULL;
*result = NULL;
} else {
@@ -1366,7 +1366,7 @@ yelp_uri_resolve (gchar *uri, gchar **result, gchar **section)
}
/* full file path. Ensure file exists and determine type */
} else if (!strncmp (uri, "x-yelp-toc:", 11)) {
- ret = YELP_SPOON_TYPE_TOC;
+ ret = YELP_RRN_TYPE_TOC;
if (strlen (uri) > 11) {
*section = g_strdup (&uri[11]);
} else {
@@ -1378,15 +1378,15 @@ yelp_uri_resolve (gchar *uri, gchar **result, gchar **section)
/* Search pager request. *result contains the search terms */
*result = g_strdup (uri);
*section = g_strdup (uri+14);
- ret = YELP_SPOON_TYPE_SEARCH;
+ ret = YELP_RRN_TYPE_SEARCH;
} else if (g_file_test (intern_uri, G_FILE_TEST_EXISTS)) {
/* Full path */
ret = resolve_full_file (intern_uri);
- if (ret == YELP_SPOON_TYPE_EXTERNAL) {
+ if (ret == YELP_RRN_TYPE_EXTERNAL) {
*section = NULL;
*result = g_strdup (uri);
}
- else if (ret == YELP_SPOON_TYPE_ERROR) {
+ else if (ret == YELP_RRN_TYPE_ERROR) {
*section = NULL;
*result = NULL;
} else {
@@ -1397,14 +1397,14 @@ yelp_uri_resolve (gchar *uri, gchar **result, gchar **section)
/* Quite probable it was supposed to be ours, but
* the file doesn't exist. Hence, we should bin it
*/
- ret = YELP_SPOON_TYPE_ERROR;
+ ret = YELP_RRN_TYPE_ERROR;
*result = NULL;
*section = NULL;
} else {
/* We really don't care what it is. It's not ours. Let
* someone else handle it
*/
- ret = YELP_SPOON_TYPE_EXTERNAL;
+ ret = YELP_RRN_TYPE_EXTERNAL;
*result = g_strdup (uri);
*section = NULL;
}
diff --git a/src/yelp-utils.h b/src/yelp-utils.h
index 88c05333..22a8ca50 100644
--- a/src/yelp-utils.h
+++ b/src/yelp-utils.h
@@ -115,16 +115,16 @@ gchar ** yelp_get_man_paths (void);
#else
typedef enum {
- YELP_SPOON_TYPE_DOC = 0,
- YELP_SPOON_TYPE_MAN,
- YELP_SPOON_TYPE_INFO,
- YELP_SPOON_TYPE_HTML,
- YELP_SPOON_TYPE_TOC,
- YELP_SPOON_TYPE_SEARCH,
- YELP_SPOON_TYPE_NOT_FOUND,
- YELP_SPOON_TYPE_EXTERNAL,
- YELP_SPOON_TYPE_ERROR
-} YelpSpoonType;
+ YELP_RRN_TYPE_DOC = 0,
+ YELP_RRN_TYPE_MAN,
+ YELP_RRN_TYPE_INFO,
+ YELP_RRN_TYPE_HTML,
+ YELP_RRN_TYPE_TOC,
+ YELP_RRN_TYPE_SEARCH,
+ YELP_RRN_TYPE_NOT_FOUND,
+ YELP_RRN_TYPE_EXTERNAL,
+ YELP_RRN_TYPE_ERROR
+} YelpRrnType;
/* Generic resolver function. Takes in the uri (which can be
@@ -137,7 +137,7 @@ typedef enum {
* Both *result and *section must be NULL when calling (otherwise
* we throw an error
*/
-YelpSpoonType yelp_uri_resolve (gchar *uri,
+YelpRrnType yelp_uri_resolve (gchar *uri,
gchar **result,
gchar **section);
#endif
diff --git a/src/yelp-window.c b/src/yelp-window.c
index eb72002d..0e585b28 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -43,22 +43,18 @@
#include "yelp-error.h"
*/
#include "yelp-html.h"
-/*
-#include "yelp-pager.h"*/
#include "yelp-settings.h"
-//#include "yelp-toc-pager.h"
#include "yelp-toc.h"
-#include "yelp-man.h"
#include "yelp-docbook.h"
#include "yelp-window.h"
#include "yelp-print.h"
#include "yelp-debug.h"
-/*#ifdef ENABLE_MAN
-#include "yelp-man-pager.h"
+#ifdef ENABLE_MAN
+#include "yelp-man.h"
#endif
-#ifdef ENABLE_INFO
+/*#ifdef ENABLE_INFO
#include "yelp-info-pager.h"
#endif
#ifdef ENABLE_SEARCH
@@ -958,7 +954,7 @@ yelp_window_load (YelpWindow *window, const gchar *uri)
gchar *frag_id = NULL;
GtkAction *action;
gchar *real_uri = NULL;
- YelpSpoonType type = YELP_SPOON_TYPE_ERROR;
+ YelpRrnType type = YELP_RRN_TYPE_ERROR;
YelpDocument *doc = NULL;
g_return_if_fail (YELP_IS_WINDOW (window));
@@ -978,20 +974,20 @@ yelp_window_load (YelpWindow *window, const gchar *uri)
doc = priv->current_document;
} else {
switch (type) {
- case YELP_SPOON_TYPE_TOC:
+ case YELP_RRN_TYPE_TOC:
doc = yelp_toc_get ();
priv->base_uri = g_strdup ("file:///fakefile");
break;
- case YELP_SPOON_TYPE_MAN:
+ case YELP_RRN_TYPE_MAN:
priv->base_uri = g_strdup ("file:///fakefile");
doc = yelp_man_new (real_uri);
priv->uri = "";
break;
- case YELP_SPOON_TYPE_DOC:
+ case YELP_RRN_TYPE_DOC:
priv->base_uri = g_strdup (uri);
doc = yelp_docbook_new (real_uri);
break;
- case YELP_SPOON_TYPE_HTML:
+ case YELP_RRN_TYPE_HTML:
break;
default:
break;
@@ -2904,32 +2900,14 @@ window_preferences_cb (GtkAction *action, YelpWindow *window)
static void
window_reload_cb (GtkAction *action, YelpWindow *window)
{
-#if 0
- YelpPager *pager;
-
- g_return_if_fail (YELP_IS_WINDOW (window));
-
- debug_print (DB_FUNCTION, "entering\n");
-
- if (window->priv->current_doc) {
- YelpLoadData *data;
- gchar *uri;
- pager = yelp_doc_info_get_pager (window->priv->current_doc);
-
- if (!pager)
- return;
-
- yelp_pager_cancel (pager);
-
- uri = yelp_doc_info_get_uri (window->priv->current_doc,
- window->priv->current_frag,
- YELP_URI_TYPE_ANY);
- data = g_new0 (YelpLoadData, 1);
- data->window = g_object_ref (window);
- data->uri = uri;
- g_idle_add ((GSourceFunc) window_load_async, data);
+ if (window->priv->current_document) {
+ if (window->priv->current_request > -1) {
+ yelp_document_cancel_page (window->priv->current_document, window->priv->current_request);
+ }
+ g_object_unref (window->priv->current_document);
+ window->priv->current_document = NULL;
+ yelp_window_load (window, window->priv->req_uri);
}
-#endif
}
static void