summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Hallendal <micke@codefactory.se>2002-05-18 00:20:07 +0000
committerMikael Hallendal <hallski@src.gnome.org>2002-05-18 00:20:07 +0000
commitee0affd987db4722a7ca2e5fc61504879d36c6bc (patch)
treea3c1a167ef1c1560bb7575fbe7dc0bc8c65b100f
parent5380a99302b519228bcaacae1ebba7f39904576e (diff)
downloadyelp-ee0affd987db4722a7ca2e5fc61504879d36c6bc.tar.gz
conform with style. same. same. same.
2002-05-18 Mikael Hallendal <micke@codefactory.se> * src/yelp-view-toc.c: conform with style. * src/yelp-window.c: same. * src/yelp-history.c: same. * src/yelp-scrollkeeper.c: same.
-rw-r--r--ChangeLog5
-rw-r--r--src/yelp-history.c52
-rw-r--r--src/yelp-scrollkeeper.c145
-rw-r--r--src/yelp-view-toc.c408
-rw-r--r--src/yelp-window.c240
5 files changed, 427 insertions, 423 deletions
diff --git a/ChangeLog b/ChangeLog
index bc06bcdd..72837d2e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2002-05-18 Mikael Hallendal <micke@codefactory.se>
+ * src/yelp-view-toc.c: conform with style.
+ * src/yelp-window.c: same.
+ * src/yelp-history.c: same.
+ * src/yelp-scrollkeeper.c: same.
+
* src/yelp-view-index.c (yelp_view_index_show_uri):
- commented out call to yelp_html_open_uri since it's been
removed.
diff --git a/src/yelp-history.c b/src/yelp-history.c
index fbf01bea..bf1e592e 100644
--- a/src/yelp-history.c
+++ b/src/yelp-history.c
@@ -27,12 +27,12 @@
#include <string.h>
#include "yelp-history.h"
-static void yelp_history_init (YelpHistory *history);
-static void yelp_history_class_init (YelpHistoryClass *klass);
-static void yelp_history_finalize (GObject *object);
-static void yelp_history_free_history_list (GList *history_list);
+static void history_init (YelpHistory *history);
+static void history_class_init (YelpHistoryClass *klass);
+static void history_finalize (GObject *object);
+static void history_free_history_list (GList *history_list);
-static void yelp_history_maybe_emit (YelpHistory *history);
+static void history_maybe_emit (YelpHistory *history);
enum {
FORWARD_EXISTS_CHANGED,
@@ -43,7 +43,7 @@ enum {
static gint signals[LAST_SIGNAL] = { 0 };
struct _YelpHistoryPriv {
- GList *yelp_history_list;
+ GList *history_list;
GList *current;
gboolean last_emit_forward;
@@ -60,12 +60,12 @@ yelp_history_get_type (void)
sizeof (YelpHistoryClass),
NULL,
NULL,
- (GClassInitFunc) yelp_history_class_init,
+ (GClassInitFunc) history_class_init,
NULL,
NULL,
sizeof (YelpHistory),
0,
- (GInstanceInitFunc) yelp_history_init,
+ (GInstanceInitFunc) history_init,
};
history_type = g_type_register_static (G_TYPE_OBJECT,
@@ -77,13 +77,13 @@ yelp_history_get_type (void)
}
static void
-yelp_history_init (YelpHistory *history)
+history_init (YelpHistory *history)
{
YelpHistoryPriv *priv;
priv = g_new0 (YelpHistoryPriv, 1);
- priv->yelp_history_list = NULL;
+ priv->history_list = NULL;
priv->current = NULL;
priv->last_emit_forward = FALSE;
priv->last_emit_back = FALSE;
@@ -91,13 +91,13 @@ yelp_history_init (YelpHistory *history)
}
static void
-yelp_history_class_init (YelpHistoryClass *klass)
+history_class_init (YelpHistoryClass *klass)
{
GObjectClass *object_class;
object_class = (GObjectClass *) klass;
- object_class->finalize = yelp_history_finalize;
+ object_class->finalize = history_finalize;
signals[FORWARD_EXISTS_CHANGED] =
g_signal_new ("forward_exists_changed",
@@ -123,7 +123,7 @@ yelp_history_class_init (YelpHistoryClass *klass)
}
static void
-yelp_history_finalize (GObject *object)
+history_finalize (GObject *object)
{
YelpHistory *history;
YelpHistoryPriv *priv;
@@ -135,11 +135,11 @@ yelp_history_finalize (GObject *object)
history = YELP_HISTORY (object);
priv = history->priv;
- for (node = priv->yelp_history_list; node; node = node->next) {
+ for (node = priv->history_list; node; node = node->next) {
yelp_uri_unref (YELP_URI (node->data));
}
- g_list_free (priv->yelp_history_list);
+ g_list_free (priv->history_list);
g_free (priv);
@@ -147,19 +147,19 @@ yelp_history_finalize (GObject *object)
}
static void
-yelp_history_free_history_list (GList *yelp_history_list)
+history_free_history_list (GList *history_list)
{
GList *node;
- for (node = yelp_history_list; node; node = node->next) {
+ for (node = history_list; node; node = node->next) {
yelp_uri_unref (YELP_URI (node->data));
}
- g_list_free (yelp_history_list);
+ g_list_free (history_list);
}
static void
-yelp_history_maybe_emit (YelpHistory *history)
+history_maybe_emit (YelpHistory *history)
{
YelpHistoryPriv *priv;
@@ -205,15 +205,15 @@ yelp_history_goto (YelpHistory *history, YelpURI *uri)
forward_list = priv->current->next;
priv->current->next = NULL;
- yelp_history_free_history_list (forward_list);
+ history_free_history_list (forward_list);
}
- priv->yelp_history_list = g_list_append (priv->yelp_history_list,
- yelp_uri_ref (uri));
+ priv->history_list = g_list_append (priv->history_list,
+ yelp_uri_ref (uri));
- priv->current = g_list_last (priv->yelp_history_list);
+ priv->current = g_list_last (priv->history_list);
- yelp_history_maybe_emit (history);
+ history_maybe_emit (history);
}
YelpURI *
@@ -229,7 +229,7 @@ yelp_history_go_forward (YelpHistory *history)
if (priv->current->next) {
priv->current = priv->current->next;
- yelp_history_maybe_emit (history);
+ history_maybe_emit (history);
return YELP_URI (priv->current->data);
}
@@ -250,7 +250,7 @@ yelp_history_go_back (YelpHistory *history)
if (priv->current->prev) {
priv->current = priv->current->prev;
- yelp_history_maybe_emit (history);
+ history_maybe_emit (history);
return YELP_URI (priv->current->data);
}
diff --git a/src/yelp-scrollkeeper.c b/src/yelp-scrollkeeper.c
index c662a267..0da64543 100644
--- a/src/yelp-scrollkeeper.c
+++ b/src/yelp-scrollkeeper.c
@@ -35,39 +35,38 @@
#define d(x)
-static gboolean ys_trim_empty_branches (xmlNode *cl_node);
-static gboolean ys_tree_empty (xmlNode *cl_node);
-
-static gboolean ys_parse_books (GNode *tree,
- xmlDoc *doc);
-static gboolean ys_parse_section (GNode *parent,
- xmlNode *xml_node);
-static void ys_parse_doc (GNode *parent,
- xmlNode *xml_node,
- gchar *docid);
-static void ys_parse_toc_section (GNode *parent,
- xmlNode *xml_node,
- const gchar *base_uri);
-static gchar * ys_get_xml_docpath (const gchar *command,
- const gchar *argument);
-
-static gchar * ys_strip_scheme (gchar *original_uri,
- gchar **scheme);
-
-static gboolean ys_parse_index (GList **index);
-static void ys_parse_index_file (GList **index,
- const gchar *index_path,
- YelpSection *section);
-static void ys_parse_index_item (GList **index,
- YelpSection *section,
- xmlNode *node);
+static gboolean scrollkeeper_trim_empty_branches (xmlNode *cl_node);
+static gboolean scrollkeeper_tree_empty (xmlNode *cl_node);
+
+static gboolean scrollkeeper_parse_books (GNode *tree,
+ xmlDoc *doc);
+static gboolean scrollkeeper_parse_section (GNode *parent,
+ xmlNode *xml_node);
+static void scrollkeeper_parse_doc (GNode *parent,
+ xmlNode *xml_node,
+ gchar *docid);
+static void scrollkeeper_parse_toc_section (GNode *parent,
+ xmlNode *xml_node,
+ const gchar *base_uri);
+static gchar * scrollkeeper_get_xml_docpath (const gchar *command,
+ const gchar *argument);
+static gchar * scrollkeeper_strip_scheme (gchar *original_uri,
+ gchar **scheme);
+
+static gboolean scrollkeeper_parse_index (GList **index);
+static void scrollkeeper_parse_index_file (GList **index,
+ const gchar *index_path,
+ YelpSection *section);
+static void scrollkeeper_parse_index_item (GList **index,
+ YelpSection *section,
+ xmlNode *node);
static GHashTable *seriesid_hash = NULL;
static GHashTable *docid_hash = NULL;
static gboolean
-ys_trim_empty_branches (xmlNode *node)
+scrollkeeper_trim_empty_branches (xmlNode *node)
{
xmlNode *child;
xmlNode *next;
@@ -81,7 +80,7 @@ ys_trim_empty_branches (xmlNode *node)
next = child->next;
if (!g_ascii_strcasecmp (child->name, "sect")) {
- empty = ys_trim_empty_branches (child);
+ empty = scrollkeeper_trim_empty_branches (child);
if (empty) {
xmlUnlinkNode (child);
xmlFreeNode (child);
@@ -100,7 +99,7 @@ ys_trim_empty_branches (xmlNode *node)
}
static gboolean
-ys_tree_empty (xmlNode *cl_node)
+scrollkeeper_tree_empty (xmlNode *cl_node)
{
xmlNode *node, *next;
gboolean ret_val;
@@ -113,7 +112,7 @@ ys_tree_empty (xmlNode *cl_node)
if (!g_ascii_strcasecmp (node->name, "sect") &&
node->xmlChildrenNode->next != NULL) {
- ret_val = ys_tree_empty (
+ ret_val = scrollkeeper_tree_empty (
node->xmlChildrenNode->next);
if (!ret_val) {
@@ -130,7 +129,7 @@ ys_tree_empty (xmlNode *cl_node)
}
static gboolean
-ys_parse_books (GNode *tree, xmlDoc *doc)
+scrollkeeper_parse_books (GNode *tree, xmlDoc *doc)
{
xmlNode *node;
gboolean success;
@@ -153,7 +152,7 @@ ys_parse_books (GNode *tree, xmlDoc *doc)
for (node = node->xmlChildrenNode; node; node = node->next) {
if (!g_ascii_strcasecmp (node->name, "sect")) {
- success = ys_parse_section (book_node, node);
+ success = scrollkeeper_parse_section (book_node, node);
}
}
@@ -161,7 +160,7 @@ ys_parse_books (GNode *tree, xmlDoc *doc)
}
static gboolean
-ys_parse_section (GNode *parent, xmlNode *xml_node)
+scrollkeeper_parse_section (GNode *parent, xmlNode *xml_node)
{
xmlNode *cur;
xmlChar *xml_str;
@@ -192,7 +191,7 @@ ys_parse_section (GNode *parent, xmlNode *xml_node)
for (cur = xml_node->xmlChildrenNode; cur; cur = cur->next) {
if (!g_ascii_strcasecmp (cur->name, "sect")) {
- ys_parse_section (node, cur);
+ scrollkeeper_parse_section (node, cur);
}
else if (!g_ascii_strcasecmp (cur->name, "doc")) {
@@ -202,7 +201,7 @@ ys_parse_section (GNode *parent, xmlNode *xml_node)
xmlFree (xml_str);
}
- ys_parse_doc (node, cur, docid);
+ scrollkeeper_parse_doc (node, cur, docid);
}
}
@@ -210,7 +209,7 @@ ys_parse_section (GNode *parent, xmlNode *xml_node)
}
static void
-ys_parse_doc (GNode *parent, xmlNode *xml_node, gchar *docid)
+scrollkeeper_parse_doc (GNode *parent, xmlNode *xml_node, gchar *docid)
{
xmlNode *cur;
xmlChar *xml_str;
@@ -237,7 +236,7 @@ ys_parse_doc (GNode *parent, xmlNode *xml_node, gchar *docid)
}
else if (!g_ascii_strcasecmp (cur->name, "docsource")) {
xml_str = xmlNodeGetContent (cur);
- docsource = ys_strip_scheme (xml_str, NULL);
+ docsource = scrollkeeper_strip_scheme (xml_str, NULL);
link = g_strconcat ("ghelp:", docsource, NULL);
xmlFree (xml_str);
}
@@ -274,9 +273,9 @@ ys_parse_doc (GNode *parent, xmlNode *xml_node, gchar *docid)
}
static void
-ys_parse_toc_section (GNode *parent,
- xmlNode *xml_node,
- const gchar *base_uri)
+scrollkeeper_parse_toc_section (GNode *parent,
+ xmlNode *xml_node,
+ const gchar *base_uri)
{
gchar *name;
gchar *link;
@@ -315,13 +314,13 @@ ys_parse_toc_section (GNode *parent,
for (; next_child != NULL; next_child = next_child->next) {
if (!g_ascii_strncasecmp (next_child->name, "tocsect", 7)) {
- ys_parse_toc_section (node, next_child, base_uri);
+ scrollkeeper_parse_toc_section (node, next_child, base_uri);
}
}
}
static gchar *
-ys_get_xml_docpath (const gchar *command, const gchar *argument)
+scrollkeeper_get_xml_docpath (const gchar *command, const gchar *argument)
{
gboolean success;
gchar *full_command;
@@ -353,7 +352,7 @@ ys_get_xml_docpath (const gchar *command, const gchar *argument)
}
static gchar *
-ys_strip_scheme(gchar *original_uri, gchar **scheme)
+scrollkeeper_strip_scheme(gchar *original_uri, gchar **scheme)
{
gchar *new_uri;
gchar *point;
@@ -378,7 +377,7 @@ ys_strip_scheme(gchar *original_uri, gchar **scheme)
}
static gboolean
-ys_parse_index (GList **index)
+scrollkeeper_parse_index (GList **index)
{
gchar *sk_data_dir = NULL;
gchar *index_dir;
@@ -388,8 +387,8 @@ ys_parse_index (GList **index)
GNode *node;
YelpSection *section;
- sk_data_dir = ys_get_xml_docpath ("scrollkeeper-config",
- "--pkglocalstatedir");
+ sk_data_dir = scrollkeeper_get_xml_docpath ("scrollkeeper-config",
+ "--pkglocalstatedir");
index_dir = g_strdup_printf ("%s/index", sk_data_dir);
@@ -414,7 +413,7 @@ ys_parse_index (GList **index)
section = YELP_SECTION (node->data);
- ys_parse_index_file (index, index_path, section);
+ scrollkeeper_parse_index_file (index, index_path, section);
g_free (index_path);
}
@@ -428,9 +427,9 @@ ys_parse_index (GList **index)
}
static void
-ys_parse_index_file (GList **index,
- const gchar *index_path,
- YelpSection *section)
+scrollkeeper_parse_index_file (GList **index,
+ const gchar *index_path,
+ YelpSection *section)
{
xmlDoc *doc;
xmlNode *node;
@@ -449,14 +448,14 @@ ys_parse_index_file (GList **index,
for (node = node->xmlChildrenNode; node; node = node->next) {
if (!g_ascii_strcasecmp (node->name, "indexitem")) {
- ys_parse_index_item (index, section, node);
+ scrollkeeper_parse_index_item (index, section, node);
}
}
}
}
static void
-ys_parse_index_item (GList **index, YelpSection *section, xmlNode *node)
+scrollkeeper_parse_index_item (GList **index, YelpSection *section, xmlNode *node)
{
xmlNode *cur;
xmlChar *title = NULL;
@@ -482,7 +481,7 @@ ys_parse_index_item (GList **index, YelpSection *section, xmlNode *node)
xmlFree (xml_str);
}
else if (!g_ascii_strcasecmp (cur->name, "indexitem")) {
- ys_parse_index_item (index, section, cur);
+ scrollkeeper_parse_index_item (index, section, cur);
}
}
@@ -511,24 +510,24 @@ ys_parse_index_item (GList **index, YelpSection *section, xmlNode *node)
gboolean
yelp_scrollkeeper_init (GNode *tree, GList **index)
{
- gchar *docpath;
- xmlDoc *doc;
- const GList *node;
+ gchar *docpath;
+ xmlDoc *doc;
+ const GList *node;
- g_return_val_if_fail (tree != NULL, FALSE);
+ g_return_val_if_fail (tree != NULL, FALSE);
- seriesid_hash = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free, NULL);
+ seriesid_hash = g_hash_table_new_full (g_str_hash,
+ g_str_equal,
+ g_free, NULL);
- docid_hash = g_hash_table_new_full (g_str_hash, g_str_equal,
- g_free, NULL);
+ docid_hash = g_hash_table_new_full (g_str_hash, g_str_equal,
+ g_free, NULL);
- doc = NULL;
+ doc = NULL;
- for (node = gnome_i18n_get_language_list ("LC_MESSAGES"); node; node = node->next) {
- docpath = ys_get_xml_docpath ("scrollkeeper-get-content-list",
- node->data);
+ for (node = gnome_i18n_get_language_list ("LC_MESSAGES"); node; node = node->next) {
+ docpath = scrollkeeper_get_xml_docpath ("scrollkeeper-get-content-list",
+ node->data);
if (docpath) {
doc = xmlParseFile (docpath);
@@ -536,7 +535,7 @@ yelp_scrollkeeper_init (GNode *tree, GList **index)
}
if (doc) {
- if (doc->xmlRootNode && !ys_tree_empty(doc->xmlRootNode->xmlChildrenNode)) {
+ if (doc->xmlRootNode && !scrollkeeper_tree_empty(doc->xmlRootNode->xmlChildrenNode)) {
break;
} else {
xmlFreeDoc (doc);
@@ -546,14 +545,14 @@ yelp_scrollkeeper_init (GNode *tree, GList **index)
}
if (doc) {
- ys_trim_empty_branches (doc->xmlRootNode);
+ scrollkeeper_trim_empty_branches (doc->xmlRootNode);
- ys_parse_books (tree, doc);
+ scrollkeeper_parse_books (tree, doc);
xmlFreeDoc (doc);
}
- ys_parse_index (index);
+ scrollkeeper_parse_index (index);
return TRUE;
}
@@ -577,8 +576,8 @@ yelp_scrollkeeper_get_toc_tree (const gchar *docpath)
tree = g_node_new (NULL);
- toc_file = ys_get_xml_docpath ("scrollkeeper-get-toc-from-docpath",
- docpath);
+ toc_file = scrollkeeper_get_xml_docpath ("scrollkeeper-get-toc-from-docpath",
+ docpath);
if (toc_file) {
doc = xmlParseFile (toc_file);
@@ -600,7 +599,7 @@ yelp_scrollkeeper_get_toc_tree (const gchar *docpath)
full_path = g_strconcat ("ghelp:", docpath, NULL);
for (; xml_node != NULL; xml_node = xml_node->next) {
- ys_parse_toc_section (tree, xml_node, full_path);
+ scrollkeeper_parse_toc_section (tree, xml_node, full_path);
}
g_free (full_path);
diff --git a/src/yelp-view-toc.c b/src/yelp-view-toc.c
index 16ac3094..0eae99e4 100644
--- a/src/yelp-view-toc.c
+++ b/src/yelp-view-toc.c
@@ -39,15 +39,15 @@
#define d(x)
-static void yvh_init (YelpViewTOC *html);
-static void yvh_class_init (YelpViewTOCClass *klass);
-static void yvh_link_clicked_cb (HtmlDocument *doc,
+static void toc_init (YelpViewTOC *html);
+static void toc_class_init (YelpViewTOCClass *klass);
+static void toc_link_clicked_cb (HtmlDocument *doc,
const gchar *url,
YelpViewTOC *view);
-static void yelp_view_toc_man_1 (YelpViewTOC *view);
-static void yelp_view_toc_man_2 (YelpViewTOC *view,
+static void toc_man_1 (YelpViewTOC *view);
+static void toc_man_2 (YelpViewTOC *view,
GNode *root);
-static void yelp_view_read_important_docs (YelpViewTOC *view);
+static void toc_read_important_docs (YelpViewTOC *view);
enum {
URI_SELECTED,
@@ -173,12 +173,12 @@ yelp_view_toc_get_type (void)
sizeof (YelpViewTOCClass),
NULL,
NULL,
- (GClassInitFunc) yvh_class_init,
+ (GClassInitFunc) toc_class_init,
NULL,
NULL,
sizeof (YelpViewTOC),
0,
- (GInstanceInitFunc) yvh_init,
+ (GInstanceInitFunc) toc_init,
};
view_type = g_type_register_static (HTML_TYPE_VIEW,
@@ -190,25 +190,25 @@ yelp_view_toc_get_type (void)
}
static void
-yvh_init (YelpViewTOC *view)
+toc_init (YelpViewTOC *view)
{
YelpViewTOCPriv *priv;
priv = g_new0 (YelpViewTOCPriv, 1);
view->priv = priv;
- yelp_view_read_important_docs (view);
+ toc_read_important_docs (view);
priv->doc = html_document_new ();
html_view_set_document (HTML_VIEW (view), priv->doc);
g_signal_connect (G_OBJECT (priv->doc), "link_clicked",
- G_CALLBACK (yvh_link_clicked_cb), view);
+ G_CALLBACK (toc_link_clicked_cb), view);
}
static void
-yvh_class_init (YelpViewTOCClass *klass)
+toc_class_init (YelpViewTOCClass *klass)
{
signals[URI_SELECTED] =
g_signal_new ("uri_selected",
@@ -223,7 +223,7 @@ yvh_class_init (YelpViewTOCClass *klass)
}
static void
-yvh_link_clicked_cb (HtmlDocument *doc, const gchar *url, YelpViewTOC *view)
+toc_link_clicked_cb (HtmlDocument *doc, const gchar *url, YelpViewTOC *view)
{
YelpURI *uri;
@@ -239,14 +239,14 @@ yvh_link_clicked_cb (HtmlDocument *doc, const gchar *url, YelpViewTOC *view)
}
static void
-yelp_view_toc_open (YelpViewTOC *view)
+toc_open (YelpViewTOC *view)
{
html_document_open_stream (view->priv->doc, "text/html");
view->priv->buffer_pos = 0;
}
static void
-yelp_view_toc_close (YelpViewTOC *view)
+toc_close (YelpViewTOC *view)
{
YelpViewTOCPriv *priv = view->priv;
@@ -260,7 +260,7 @@ yelp_view_toc_close (YelpViewTOC *view)
}
static void
-yelp_view_toc_write (YelpViewTOC *view, char *data, int len)
+toc_write (YelpViewTOC *view, char *data, int len)
{
YelpViewTOCPriv *priv = view->priv;
int chunk_size;
@@ -289,7 +289,7 @@ yelp_view_toc_write (YelpViewTOC *view, char *data, int len)
}
static void
-yelp_view_toc_printf (YelpViewTOC *view, char *format, ...)
+toc_printf (YelpViewTOC *view, char *format, ...)
{
va_list args;
gchar *string;
@@ -300,23 +300,23 @@ yelp_view_toc_printf (YelpViewTOC *view, char *format, ...)
string = g_strdup_vprintf (format, args);
va_end (args);
- yelp_view_toc_write (view, string, -1);
+ toc_write (view, string, -1);
g_free (string);
}
static void
-yelp_view_toc_write_footer (YelpViewTOC *view)
+toc_write_footer (YelpViewTOC *view)
{
char *footer="\n"
-" </body>\n"
-"</html>\n";
- yelp_view_toc_write (view, footer, -1);
+ " </body>\n"
+ "</html>\n";
+ toc_write (view, footer, -1);
}
static void
-yelp_view_toc_start (YelpViewTOC *view)
+toc_start (YelpViewTOC *view)
{
YelpViewTOCPriv *priv;
GNode *node;
@@ -340,13 +340,13 @@ yelp_view_toc_start (YelpViewTOC *view)
g_warning ("No nodes in tree");
}
- yelp_view_toc_open (view);
+ toc_open (view);
- yelp_view_toc_printf (view, PAGE_HEADER, page_title);
+ toc_printf (view, PAGE_HEADER, page_title);
- yelp_view_toc_printf (view,
- PAGE_START,
- page_title);
+ toc_printf (view,
+ PAGE_START,
+ page_title);
sections = priv->important_sections;
@@ -370,16 +370,16 @@ yelp_view_toc_start (YelpViewTOC *view)
if (important_doc_installed) {
if (!left_column_started) {
- yelp_view_toc_printf (view,
- COLUMN_LEFT_START);
+ toc_printf (view,
+ COLUMN_LEFT_START);
left_column_started = TRUE;
}
- yelp_view_toc_printf (view,
- TOC_BLOCK_SEPARATOR
- TOC_BLOCK_START
- "<h2>%s</h2>",
- important_section->title);
+ toc_printf (view,
+ TOC_BLOCK_SEPARATOR
+ TOC_BLOCK_START
+ "<h2>%s</h2>",
+ important_section->title);
}
seriesids = important_section->seriesids;
@@ -391,20 +391,20 @@ yelp_view_toc_start (YelpViewTOC *view)
if (node) {
section = node->data;
- yelp_view_toc_printf (view,
- "<a href=\"%s\">%s</a>\n",
- yelp_uri_to_string (section->uri), section->name);
+ toc_printf (view,
+ "<a href=\"%s\">%s</a>\n",
+ yelp_uri_to_string (section->uri), section->name);
}
seriesids = seriesids->next;
}
if (important_doc_installed) {
- yelp_view_toc_printf (view,
- TOC_BLOCK_END);
+ toc_printf (view,
+ TOC_BLOCK_END);
if (sections->next) {
- yelp_view_toc_printf (view,
- TOC_BLOCK_SEPARATOR);
+ toc_printf (view,
+ TOC_BLOCK_SEPARATOR);
}
}
@@ -413,20 +413,20 @@ yelp_view_toc_start (YelpViewTOC *view)
}
if (left_column_started) {
- yelp_view_toc_printf (view, COLUMN_END);
+ toc_printf (view, COLUMN_END);
}
- yelp_view_toc_printf (view,
- COLUMN_RIGHT_START);
+ toc_printf (view,
+ COLUMN_RIGHT_START);
root = yelp_util_find_toplevel (priv->doc_tree, "scrollkeeper");
node = g_node_first_child (root);
- yelp_view_toc_printf (view,
- TOC_BLOCK_SEPARATOR
- TOC_BLOCK_START
- "<h2>%s</h2>\n",
- section_gnome);
+ toc_printf (view,
+ TOC_BLOCK_SEPARATOR
+ TOC_BLOCK_START
+ "<h2>%s</h2>\n",
+ section_gnome);
root = yelp_util_find_node_from_name (priv->doc_tree, "GNOME");
node = g_node_first_child (root);
@@ -434,22 +434,22 @@ yelp_view_toc_start (YelpViewTOC *view)
while (node) {
section = YELP_SECTION (node->data);
path = yelp_util_node_to_string_path (node);
- yelp_view_toc_printf (view,
- "<a href=\"toc:scrollkeeper/%s\">%s</a><br>\n",
- path, section->name);
+ toc_printf (view,
+ "<a href=\"toc:scrollkeeper/%s\">%s</a><br>\n",
+ path, section->name);
g_free (path);
node = g_node_next_sibling (node);
}
- yelp_view_toc_printf (view,
- TOC_BLOCK_END);
+ toc_printf (view,
+ TOC_BLOCK_END);
- yelp_view_toc_printf (view,
- TOC_BLOCK_SEPARATOR
- TOC_BLOCK_START
- "<h2>%s</h2>\n",
- section_additional);
+ toc_printf (view,
+ TOC_BLOCK_SEPARATOR
+ TOC_BLOCK_START
+ "<h2>%s</h2>\n",
+ section_additional);
root = yelp_util_find_toplevel (priv->doc_tree, "scrollkeeper");
node = g_node_first_child (root);
@@ -458,9 +458,9 @@ yelp_view_toc_start (YelpViewTOC *view)
section = YELP_SECTION (node->data);
if (strcmp (section->name, "GNOME")) {
path = yelp_util_node_to_string_path (node);
- yelp_view_toc_printf (view,
- "<a href=\"toc:scrollkeeper/%s\">%s</a><br>\n",
- path, section->name);
+ toc_printf (view,
+ "<a href=\"toc:scrollkeeper/%s\">%s</a><br>\n",
+ path, section->name);
g_free (path);
}
@@ -468,29 +468,29 @@ yelp_view_toc_start (YelpViewTOC *view)
}
if (yelp_util_find_toplevel (priv->doc_tree, "man")) {
- yelp_view_toc_printf (view,
- "<a href=\"toc:man\">%s</a><br>\n",
- man_string);
+ toc_printf (view,
+ "<a href=\"toc:man\">%s</a><br>\n",
+ man_string);
}
if (yelp_util_find_toplevel (priv->doc_tree, "info")) {
- yelp_view_toc_printf (view,
- "<a href=\"toc:info\">%s</a><br>\n",
- info_string);
+ toc_printf (view,
+ "<a href=\"toc:info\">%s</a><br>\n",
+ info_string);
}
- yelp_view_toc_printf (view,
- TOC_BLOCK_END
- COLUMN_END
- PAGE_END);
+ toc_printf (view,
+ TOC_BLOCK_END
+ COLUMN_END
+ PAGE_END);
- yelp_view_toc_write_footer (view);
+ toc_write_footer (view);
- yelp_view_toc_close (view);
+ toc_close (view);
}
static char *
-yelp_view_toc_full_path_name (YelpViewTOC *view, GNode *node)
+toc_full_path_name (YelpViewTOC *view, GNode *node)
{
char *str, *t;
YelpSection *section;
@@ -518,7 +518,7 @@ yelp_view_toc_full_path_name (YelpViewTOC *view, GNode *node)
}
static void
-yelp_view_toc_man_emit (YelpViewTOC *view, GNode *first)
+toc_man_emit (YelpViewTOC *view, GNode *first)
{
YelpViewTOCPriv *priv;
GNode *node, *child;
@@ -537,9 +537,9 @@ yelp_view_toc_man_emit (YelpViewTOC *view, GNode *first)
do {
if (node->children != NULL) {
if (!sub_started) {
- yelp_view_toc_printf (view, TOC_BLOCK_START);
- yelp_view_toc_printf (view, "<h3>%s</h3>",
- str_subcats);
+ toc_printf (view, TOC_BLOCK_START);
+ toc_printf (view, "<h3>%s</h3>",
+ str_subcats);
sub_started = TRUE;
}
@@ -549,7 +549,7 @@ yelp_view_toc_man_emit (YelpViewTOC *view, GNode *first)
section = node->data;
path = yelp_util_node_to_string_path (node);
- yelp_view_toc_printf (view, "<a href=\"toc:man/%s\">%s</a><br>\n", path, section->name);
+ toc_printf (view, "<a href=\"toc:man/%s\">%s</a><br>\n", path, section->name);
g_free (path);
} else {
got_a_leaf = TRUE;
@@ -557,20 +557,20 @@ yelp_view_toc_man_emit (YelpViewTOC *view, GNode *first)
} while ((node = node->next) != NULL);
if (sub_started) {
- yelp_view_toc_printf (view, TOC_BLOCK_END);
- yelp_view_toc_printf (view, TOC_BLOCK_SEPARATOR);
+ toc_printf (view, TOC_BLOCK_END);
+ toc_printf (view, TOC_BLOCK_SEPARATOR);
}
if (got_a_leaf) {
- yelp_view_toc_printf (view, TOC_BLOCK_START);
- yelp_view_toc_printf (view, "<h3>%s</h3>",
- str_docs);
+ toc_printf (view, TOC_BLOCK_START);
+ toc_printf (view, "<h3>%s</h3>",
+ str_docs);
- yelp_view_toc_write (view, "</td></tr><tr><td>", -1);
+ toc_write (view, "</td></tr><tr><td>", -1);
- yelp_view_toc_write (view,
- "<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\" width=\"100%%\">\n",
- -1);
+ toc_write (view,
+ "<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\" width=\"100%%\">\n",
+ -1);
i = 0;
node = first;
@@ -580,36 +580,36 @@ yelp_view_toc_man_emit (YelpViewTOC *view, GNode *first)
if (i % 3 == 0) {
if (i == 0) {
- yelp_view_toc_write (view,
- "<tr>\n",
- -1);
+ toc_write (view,
+ "<tr>\n",
+ -1);
} else {
- yelp_view_toc_write (view,
- "</tr>\n<tr>\n",
- -1);
+ toc_write (view,
+ "</tr>\n<tr>\n",
+ -1);
}
}
section = node->data;
url = yelp_util_compose_path_url (node->parent, yelp_uri_get_path (section->uri));
- yelp_view_toc_printf (view, "<td valign=\"Top\"><a href=\"%s\">%s</a></td>\n", yelp_uri_to_string (section->uri),
- section->name);
-/* yelp_view_toc_printf (view, "<td valign=\"Top\"><a href=\"%s\">%s</a></td>\n", url, section->name); */
+ toc_printf (view, "<td valign=\"Top\"><a href=\"%s\">%s</a></td>\n", yelp_uri_to_string (section->uri),
+ section->name);
+/* toc_printf (view, "<td valign=\"Top\"><a href=\"%s\">%s</a></td>\n", url, section->name); */
g_free (url);
i++;
}
} while ((node = node->next) != NULL);
- yelp_view_toc_write (view, "</tr>\n", -1);
- yelp_view_toc_write (view, "</table>\n", -1);
+ toc_write (view, "</tr>\n", -1);
+ toc_write (view, "</table>\n", -1);
- yelp_view_toc_printf (view, TOC_BLOCK_END);
+ toc_printf (view, TOC_BLOCK_END);
}
}
static void
-yelp_view_toc_man_2 (YelpViewTOC *view,
- GNode *root)
+toc_man_2 (YelpViewTOC *view,
+ GNode *root)
{
GNode *first;
gchar *name;
@@ -621,50 +621,50 @@ yelp_view_toc_man_2 (YelpViewTOC *view,
first = root->children;
- yelp_view_toc_open (view);
+ toc_open (view);
- yelp_view_toc_printf (view, PAGE_HEADER, string);
+ toc_printf (view, PAGE_HEADER, string);
- name = yelp_view_toc_full_path_name (view, root);
-
- yelp_view_toc_printf (view,
- "<table cellpadding=\"0\"\n"
- "border=\"0\"\n"
- "align=\"center\"\n"
- "cellspacing=\"10\"\n"
- "width=\"100%\">\n"
- "<tr align=\"left\"\n"
- " valign=\"top\"\n"
- " bgcolor=\"" BG_COLOR "\">\n"
- "<td height=\"69\"\n"
- " align=\"center\"\n"
- " valign=\"center\"\n"
- " bgcolor=\"" BLOCK_BG_COLOR "\"\n"
- " colspan=\"2\">\n"
- " <h2>\n"
- " %s/%s\n"
- " </h2>\n"
- "</td>\n"
- "</tr>\n"
- "<tr>\n",
- string, name);
+ name = toc_full_path_name (view, root);
+
+ toc_printf (view,
+ "<table cellpadding=\"0\"\n"
+ "border=\"0\"\n"
+ "align=\"center\"\n"
+ "cellspacing=\"10\"\n"
+ "width=\"100%\">\n"
+ "<tr align=\"left\"\n"
+ " valign=\"top\"\n"
+ " bgcolor=\"" BG_COLOR "\">\n"
+ "<td height=\"69\"\n"
+ " align=\"center\"\n"
+ " valign=\"center\"\n"
+ " bgcolor=\"" BLOCK_BG_COLOR "\"\n"
+ " colspan=\"2\">\n"
+ " <h2>\n"
+ " %s/%s\n"
+ " </h2>\n"
+ "</td>\n"
+ "</tr>\n"
+ "<tr>\n",
+ string, name);
g_free (name);
- yelp_view_toc_printf (view, COLUMN_RIGHT_START);
+ toc_printf (view, COLUMN_RIGHT_START);
- yelp_view_toc_man_emit (view, first);
+ toc_man_emit (view, first);
- yelp_view_toc_printf (view,
- COLUMN_END
- PAGE_END);
+ toc_printf (view,
+ COLUMN_END
+ PAGE_END);
- yelp_view_toc_write_footer (view);
- yelp_view_toc_close (view);
+ toc_write_footer (view);
+ toc_close (view);
}
static void
-yelp_view_toc_man_1 (YelpViewTOC *view)
+toc_man_1 (YelpViewTOC *view)
{
YelpViewTOCPriv *priv;
GNode *root, *node, *child;
@@ -688,19 +688,19 @@ yelp_view_toc_man_1 (YelpViewTOC *view)
return;
}
- yelp_view_toc_open (view);
+ toc_open (view);
- yelp_view_toc_printf (view, PAGE_HEADER, string);
+ toc_printf (view, PAGE_HEADER, string);
- yelp_view_toc_printf (view,
- PAGE_START,
- string);
+ toc_printf (view,
+ PAGE_START,
+ string);
- yelp_view_toc_printf (view,
- COLUMN_RIGHT_START
- TOC_BLOCK_START
- "<h2>%s</h2>",
- str_subcats);
+ toc_printf (view,
+ COLUMN_RIGHT_START
+ TOC_BLOCK_START
+ "<h2>%s</h2>",
+ str_subcats);
do {
child = g_node_first_child (node);
@@ -709,24 +709,24 @@ yelp_view_toc_man_1 (YelpViewTOC *view)
section = YELP_SECTION (node->data);
path = yelp_util_node_to_string_path (node);
- yelp_view_toc_printf (view,
- "<a href=\"toc:man/%s\">%s</a><br>\n",
- path, section->name);
+ toc_printf (view,
+ "<a href=\"toc:man/%s\">%s</a><br>\n",
+ path, section->name);
g_free (path);
}
} while ((node = g_node_next_sibling (node)));
- yelp_view_toc_printf (view,
- TOC_BLOCK_END
- COLUMN_END
- PAGE_END);
+ toc_printf (view,
+ TOC_BLOCK_END
+ COLUMN_END
+ PAGE_END);
- yelp_view_toc_write_footer (view);
- yelp_view_toc_close (view);
+ toc_write_footer (view);
+ toc_close (view);
}
static void
-yelp_view_toc_info (YelpViewTOC *view)
+toc_info (YelpViewTOC *view)
{
YelpViewTOCPriv *priv;
GNode *root, *node;
@@ -751,42 +751,42 @@ yelp_view_toc_info (YelpViewTOC *view)
return;
}
- yelp_view_toc_open (view);
+ toc_open (view);
- yelp_view_toc_printf (view, PAGE_HEADER, string);
+ toc_printf (view, PAGE_HEADER, string);
- yelp_view_toc_printf (view, PAGE_START, string);
- yelp_view_toc_printf (view, COLUMN_RIGHT_START);
- yelp_view_toc_printf (view, TOC_BLOCK_START);
+ toc_printf (view, PAGE_START, string);
+ toc_printf (view, COLUMN_RIGHT_START);
+ toc_printf (view, TOC_BLOCK_START);
- yelp_view_toc_printf (view, "<h2>%s</h2>", str_docs);
+ toc_printf (view, "<h2>%s</h2>", str_docs);
do {
section = YELP_SECTION (node->data);
url = yelp_util_compose_path_url (root,
yelp_uri_get_path (section->uri));
- yelp_view_toc_printf (view,
- "<a href=\"%s\">%s</a><br>\n",
- yelp_uri_to_string (section->uri),
- section->name);
-/* yelp_view_toc_printf (view, */
+ toc_printf (view,
+ "<a href=\"%s\">%s</a><br>\n",
+ yelp_uri_to_string (section->uri),
+ section->name);
+/* toc_printf (view, */
/* "<a href=\"%s\">%s</a><br>\n", */
/* url, section->name); */
g_free (url);
} while ((node = g_node_next_sibling (node)));
- yelp_view_toc_printf (view,
- TOC_BLOCK_END
- COLUMN_END
- PAGE_END);
+ toc_printf (view,
+ TOC_BLOCK_END
+ COLUMN_END
+ PAGE_END);
- yelp_view_toc_write_footer (view);
- yelp_view_toc_close (view);
+ toc_write_footer (view);
+ toc_close (view);
}
static void
-yelp_view_read_important_docs (YelpViewTOC *view)
+toc_read_important_docs (YelpViewTOC *view)
{
xmlDocPtr doc;
xmlNodePtr node;
@@ -865,8 +865,8 @@ yelp_view_toc_new (GNode *doc_tree)
}
static void
-yelp_view_toc_scrollkeeper (YelpViewTOC *view,
- GNode *root)
+toc_scrollkeeper (YelpViewTOC *view,
+ GNode *root)
{
YelpViewTOCPriv *priv;
GNode *node, *child;
@@ -884,30 +884,30 @@ yelp_view_toc_scrollkeeper (YelpViewTOC *view,
return;
}
- yelp_view_toc_open (view);
+ toc_open (view);
- name = yelp_view_toc_full_path_name (view, root);
+ name = toc_full_path_name (view, root);
- yelp_view_toc_printf (view, PAGE_HEADER, name);
+ toc_printf (view, PAGE_HEADER, name);
- yelp_view_toc_printf (view, PAGE_START, name);
+ toc_printf (view, PAGE_START, name);
g_free (name);
- yelp_view_toc_printf (view, COLUMN_RIGHT_START);
+ toc_printf (view, COLUMN_RIGHT_START);
got_a_leaf = FALSE;
node = root->children;
-/* yelp_view_toc_printf (view, TOC_BLOCK_START); */
+/* toc_printf (view, TOC_BLOCK_START); */
for (node = root->children; node; node = node->next) {
if (node->children != NULL) {
if (!sub_started) {
- yelp_view_toc_printf (view, TOC_BLOCK_START);
- yelp_view_toc_printf (view, "<h2>%s</h2>",
- str_subcats);
+ toc_printf (view, TOC_BLOCK_START);
+ toc_printf (view, "<h2>%s</h2>",
+ str_subcats);
sub_started = TRUE;
}
@@ -917,7 +917,7 @@ yelp_view_toc_scrollkeeper (YelpViewTOC *view,
section = node->data;
path = yelp_util_node_to_string_path (node);
- yelp_view_toc_printf (view, "<a href=\"toc:scrollkeeper/%s\">%s</a><br>\n", path, section->name);
+ toc_printf (view, "<a href=\"toc:scrollkeeper/%s\">%s</a><br>\n", path, section->name);
g_free (path);
} else {
got_a_leaf = TRUE;
@@ -925,34 +925,34 @@ yelp_view_toc_scrollkeeper (YelpViewTOC *view,
}
if (sub_started) {
- yelp_view_toc_printf (view, TOC_BLOCK_END);
+ toc_printf (view, TOC_BLOCK_END);
}
-/* yelp_view_toc_printf (view, TOC_BLOCK_END); */
+/* toc_printf (view, TOC_BLOCK_END); */
if (got_a_leaf) {
- yelp_view_toc_printf (view, TOC_BLOCK_START);
- yelp_view_toc_printf (view, "<h2>%s</h2>", str_docs);
+ toc_printf (view, TOC_BLOCK_START);
+ toc_printf (view, "<h2>%s</h2>", str_docs);
-/* yelp_view_toc_write (view, "<ul>\n", -1); */
+/* toc_write (view, "<ul>\n", -1); */
for (node = root->children; node; node = node->next) {
if (node->children == NULL) {
YelpSection *section;
section = node->data;
- yelp_view_toc_printf (view, "<a href=\"%s\">%s</a><br>\n", yelp_uri_to_string (section->uri), section->name);
+ toc_printf (view, "<a href=\"%s\">%s</a><br>\n", yelp_uri_to_string (section->uri), section->name);
}
}
- yelp_view_toc_printf (view, TOC_BLOCK_END);
+ toc_printf (view, TOC_BLOCK_END);
}
- yelp_view_toc_printf (view,
- COLUMN_END
- PAGE_END);
- yelp_view_toc_write_footer (view);
- yelp_view_toc_close (view);
+ toc_printf (view,
+ COLUMN_END
+ PAGE_END);
+ toc_write_footer (view);
+ toc_close (view);
}
void
@@ -968,12 +968,12 @@ yelp_view_toc_open_uri (YelpViewTOC *view, YelpURI *uri)
d(g_print ("PATH:[%s]\n", path));
if (!strcmp (path, "")) {
- yelp_view_toc_start (view);
+ toc_start (view);
}
else if (strncmp (path, "man", 3) == 0) {
path += 3;
if (path[0] == 0) {
- yelp_view_toc_man_1 (view);
+ toc_man_1 (view);
} else if (path[0] == '/') {
/* Calculate where it should go */
path++;
@@ -981,14 +981,14 @@ yelp_view_toc_open_uri (YelpViewTOC *view, YelpURI *uri)
node = yelp_util_string_path_to_node (path,
view->priv->doc_tree);
if (node) {
- yelp_view_toc_man_2 (view, node);
+ toc_man_2 (view, node);
} else {
g_warning ("Bad path in toc url %s\n",
yelp_uri_to_string (uri));
}
}
} else if (strcmp (path, "info") == 0) {
- yelp_view_toc_info (view);
+ toc_info (view);
} else if (strncmp (path, "scrollkeeper", strlen ("scrollkeeper")) == 0) {
path = path + strlen ("scrollkeeper");
if (path[0] == '/') {
@@ -998,7 +998,7 @@ yelp_view_toc_open_uri (YelpViewTOC *view, YelpURI *uri)
node = yelp_util_string_path_to_node (path,
view->priv->doc_tree);
if (node) {
- yelp_view_toc_scrollkeeper (view, node);
+ toc_scrollkeeper (view, node);
} else {
g_warning ("Bad path in toc url %s\n",
yelp_uri_to_string (uri));
diff --git a/src/yelp-window.c b/src/yelp-window.c
index 972f9d4d..190e588a 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -55,63 +55,63 @@ static GConfEnumStringPair toolbar_styles[] = {
{ GTK_TOOLBAR_BOTH, "both" }
};
-static void yw_init (YelpWindow *window);
-static void yw_class_init (YelpWindowClass *klass);
-
-static void yw_populate (YelpWindow *window);
-
-static gboolean yw_handle_uri (YelpWindow *window,
- YelpURI *uri);
-static void yw_uri_selected_cb (gpointer view,
- YelpURI *uri,
- gboolean handled,
- YelpWindow *window);
-static void yw_toggle_history_back (YelpHistory *history,
- gboolean sensitive,
- YelpWindow *window);
-
-static void yw_toggle_history_forward (YelpHistory *history,
- gboolean sensitive,
- YelpWindow *window);
-
-static void yw_history_action (YelpWindow *window,
- YelpHistoryAction action);
-static void yw_back_button_clicked (GtkWidget *button,
- YelpWindow *window);
-static void yw_forward_button_clicked (GtkWidget *button,
- YelpWindow *window);
-static void yw_home_button_clicked (GtkWidget *button,
- YelpWindow *window);
-static void yw_index_button_clicked (GtkWidget *button,
- YelpWindow *window);
-static void yw_new_window_cb (gpointer data,
- guint section,
- GtkWidget *widget);
-static void yw_close_window_cb (gpointer data,
- guint section,
- GtkWidget *widget);
-static void yw_history_go_cb (gpointer data,
- guint section,
- GtkWidget *widget);
-static void yw_go_home_cb (gpointer data,
- guint section,
- GtkWidget *widget);
-static void yw_go_index_cb (gpointer data,
- guint section,
- GtkWidget *widget);
-static void yw_about_cb (gpointer data,
- guint section,
- GtkWidget *widget);
-static GtkWidget * yw_create_toolbar (YelpWindow *window);
-
-static void yw_toolbar_style_changed_cb (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer data);
+static void window_init (YelpWindow *window);
+static void window_class_init (YelpWindowClass *klass);
+
+static void window_populate (YelpWindow *window);
+
+static gboolean window_handle_uri (YelpWindow *window,
+ YelpURI *uri);
+static void window_uri_selected_cb (gpointer view,
+ YelpURI *uri,
+ gboolean handled,
+ YelpWindow *window);
+static void window_toggle_history_back (YelpHistory *history,
+ gboolean sensitive,
+ YelpWindow *window);
+
+static void window_toggle_history_forward (YelpHistory *history,
+ gboolean sensitive,
+ YelpWindow *window);
+
+static void window_history_action (YelpWindow *window,
+ YelpHistoryAction action);
+static void window_back_button_clicked (GtkWidget *button,
+ YelpWindow *window);
+static void window_forward_button_clicked (GtkWidget *button,
+ YelpWindow *window);
+static void window_home_button_clicked (GtkWidget *button,
+ YelpWindow *window);
+static void window_index_button_clicked (GtkWidget *button,
+ YelpWindow *window);
+static void window_new_window_cb (gpointer data,
+ guint section,
+ GtkWidget *widget);
+static void window_close_window_cb (gpointer data,
+ guint section,
+ GtkWidget *widget);
+static void window_history_go_cb (gpointer data,
+ guint section,
+ GtkWidget *widget);
+static void window_go_home_cb (gpointer data,
+ guint section,
+ GtkWidget *widget);
+static void window_go_index_cb (gpointer data,
+ guint section,
+ GtkWidget *widget);
+static void window_about_cb (gpointer data,
+ guint section,
+ GtkWidget *widget);
+static GtkWidget * window_create_toolbar (YelpWindow *window);
+
+static void window_toolbar_style_changed_cb (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer data);
#if 0
-static void yw_remove_notify_cb (GtkObject *obj,
- gpointer data);
+static void window_remove_notify_cb (GtkObject *obj,
+ gpointer data);
#endif
enum {
@@ -149,16 +149,16 @@ struct _YelpWindowPriv {
static GtkItemFactoryEntry menu_items[] = {
{N_("/_File"), NULL, 0, 0, "<Branch>"},
- {N_("/File/_New window"), NULL, yw_new_window_cb, 0, "<StockItem>", GTK_STOCK_NEW },
- {N_("/File/_Close window"), NULL, yw_close_window_cb, 0, "<StockItem>", GTK_STOCK_CLOSE },
-/* {N_("/File/_Quit"), NULL, yw_exit_cb, 0, "<StockItem>", GTK_STOCK_QUIT }, */
+ {N_("/File/_New window"), NULL, window_new_window_cb, 0, "<StockItem>", GTK_STOCK_NEW },
+ {N_("/File/_Close window"), NULL, window_close_window_cb, 0, "<StockItem>", GTK_STOCK_CLOSE },
+/* {N_("/File/_Quit"), NULL, window_exit_cb, 0, "<StockItem>", GTK_STOCK_QUIT }, */
{N_("/_Go"), NULL, 0, 0, "<Branch>"},
- {N_("/Go/_Back"), NULL, yw_history_go_cb, YELP_WINDOW_ACTION_BACK, "<StockItem>", GTK_STOCK_GO_BACK },
- {N_("/Go/_Forward"), NULL, yw_history_go_cb, YELP_WINDOW_ACTION_FORWARD, "<StockItem>", GTK_STOCK_GO_FORWARD },
- {N_("/Go/_Home"), NULL, yw_go_home_cb, 0, "<StockItem>", GTK_STOCK_HOME },
- {N_("/Go/_Index"), NULL, yw_go_index_cb, 0, "<StockItem>", GTK_STOCK_INDEX },
+ {N_("/Go/_Back"), NULL, window_history_go_cb, YELP_WINDOW_ACTION_BACK, "<StockItem>", GTK_STOCK_GO_BACK },
+ {N_("/Go/_Forward"), NULL, window_history_go_cb, YELP_WINDOW_ACTION_FORWARD, "<StockItem>", GTK_STOCK_GO_FORWARD },
+ {N_("/Go/_Home"), NULL, window_go_home_cb, 0, "<StockItem>", GTK_STOCK_HOME },
+ {N_("/Go/_Index"), NULL, window_go_index_cb, 0, "<StockItem>", GTK_STOCK_INDEX },
{N_("/_Help"), NULL, 0, 0, "<Branch>"},
- {N_("/Help/_About"), NULL, yw_about_cb, 0, NULL },
+ {N_("/Help/_About"), NULL, window_about_cb, 0, NULL },
};
GType
@@ -172,12 +172,12 @@ yelp_window_get_type (void)
sizeof (YelpWindowClass),
NULL,
NULL,
- (GClassInitFunc) yw_class_init,
+ (GClassInitFunc) window_class_init,
NULL,
NULL,
sizeof (YelpWindow),
0,
- (GInstanceInitFunc) yw_init,
+ (GInstanceInitFunc) window_init,
};
window_type = g_type_register_static (GTK_TYPE_WINDOW,
@@ -189,7 +189,7 @@ yelp_window_get_type (void)
}
static void
-yw_init (YelpWindow *window)
+window_init (YelpWindow *window)
{
YelpWindowPriv *priv;
YelpURI *uri;
@@ -210,12 +210,12 @@ yw_init (YelpWindow *window)
g_signal_connect (priv->history,
"back_exists_changed",
- G_CALLBACK (yw_toggle_history_back),
+ G_CALLBACK (window_toggle_history_back),
window);
g_signal_connect (priv->history,
"forward_exists_changed",
- G_CALLBACK (yw_toggle_history_forward),
+ G_CALLBACK (window_toggle_history_forward),
window);
gtk_window_set_default_size (GTK_WINDOW (window), 600, 420);
@@ -224,7 +224,7 @@ yw_init (YelpWindow *window)
}
static void
-yw_class_init (YelpWindowClass *klass)
+window_class_init (YelpWindowClass *klass)
{
signals[NEW_WINDOW_REQUESTED] =
g_signal_new ("new_window_requested",
@@ -238,7 +238,7 @@ yw_class_init (YelpWindowClass *klass)
}
static void
-yw_populate (YelpWindow *window)
+window_populate (YelpWindow *window)
{
YelpWindowPriv *priv;
GtkWidget *toolbar;
@@ -255,7 +255,7 @@ yw_populate (YelpWindow *window)
accel_group = gtk_accel_group_new ();
priv->item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR,
- "<main>", accel_group);
+ "<main>", accel_group);
gtk_item_factory_set_translate_func (priv->item_factory,
(GtkTranslateFunc) gettext,
@@ -281,7 +281,7 @@ yw_populate (YelpWindow *window)
"<main>"),
FALSE, FALSE, 0);
- toolbar = yw_create_toolbar (window);
+ toolbar = window_create_toolbar (window);
priv->notebook = gtk_notebook_new ();
@@ -315,7 +315,7 @@ yw_populate (YelpWindow *window)
}
static gboolean
-yw_handle_uri (YelpWindow *window, YelpURI *uri)
+window_handle_uri (YelpWindow *window, YelpURI *uri)
{
YelpWindowPriv *priv;
GError *error = NULL;
@@ -373,10 +373,10 @@ yw_handle_uri (YelpWindow *window, YelpURI *uri)
}
static void
-yw_uri_selected_cb (gpointer view,
- YelpURI *uri,
- gboolean handled,
- YelpWindow *window)
+window_uri_selected_cb (gpointer view,
+ YelpURI *uri,
+ gboolean handled,
+ YelpWindow *window)
{
YelpWindowPriv *priv;
@@ -392,7 +392,7 @@ yw_uri_selected_cb (gpointer view,
if (handled) {
yelp_history_goto (priv->history, uri);
} else {
- if (yw_handle_uri (window, uri)) {
+ if (window_handle_uri (window, uri)) {
yelp_history_goto (priv->history, uri);
}
}
@@ -401,9 +401,9 @@ yw_uri_selected_cb (gpointer view,
}
static void
-yw_toggle_history_back (YelpHistory *history,
- gboolean sensitive,
- YelpWindow *window)
+window_toggle_history_back (YelpHistory *history,
+ gboolean sensitive,
+ YelpWindow *window)
{
YelpWindowPriv *priv;
GtkWidget *menu_item;
@@ -421,9 +421,9 @@ yw_toggle_history_back (YelpHistory *history,
}
static void
-yw_toggle_history_forward (YelpHistory *history,
- gboolean sensitive,
- YelpWindow *window)
+window_toggle_history_forward (YelpHistory *history,
+ gboolean sensitive,
+ YelpWindow *window)
{
YelpWindowPriv *priv;
GtkWidget *menu_item;
@@ -441,7 +441,7 @@ yw_toggle_history_forward (YelpHistory *history,
}
static void
-yw_history_action (YelpWindow *window, YelpHistoryAction action)
+window_history_action (YelpWindow *window, YelpHistoryAction action)
{
YelpWindowPriv *priv;
YelpURI *uri;
@@ -462,30 +462,30 @@ yw_history_action (YelpWindow *window, YelpHistoryAction action)
}
if (uri) {
- yw_handle_uri (window, uri);
+ window_handle_uri (window, uri);
}
}
static void
-yw_back_button_clicked (GtkWidget *button, YelpWindow *window)
+window_back_button_clicked (GtkWidget *button, YelpWindow *window)
{
g_return_if_fail (GTK_IS_BUTTON (button));
g_return_if_fail (YELP_IS_WINDOW (window));
- yw_history_action (window, YELP_WINDOW_ACTION_BACK);
+ window_history_action (window, YELP_WINDOW_ACTION_BACK);
}
static void
-yw_forward_button_clicked (GtkWidget *button, YelpWindow *window)
+window_forward_button_clicked (GtkWidget *button, YelpWindow *window)
{
g_return_if_fail (GTK_IS_BUTTON (button));
g_return_if_fail (YELP_IS_WINDOW (window));
- yw_history_action (window, YELP_WINDOW_ACTION_FORWARD);
+ window_history_action (window, YELP_WINDOW_ACTION_FORWARD);
}
static void
-yw_home_button_clicked (GtkWidget *button, YelpWindow *window)
+window_home_button_clicked (GtkWidget *button, YelpWindow *window)
{
YelpURI *uri;
@@ -503,7 +503,7 @@ yw_home_button_clicked (GtkWidget *button, YelpWindow *window)
}
static void
-yw_index_button_clicked (GtkWidget *button, YelpWindow *window)
+window_index_button_clicked (GtkWidget *button, YelpWindow *window)
{
YelpURI *uri;
@@ -518,7 +518,7 @@ yw_index_button_clicked (GtkWidget *button, YelpWindow *window)
}
static void
-yw_new_window_cb (gpointer data, guint section, GtkWidget *widget)
+window_new_window_cb (gpointer data, guint section, GtkWidget *widget)
{
g_return_if_fail (YELP_IS_WINDOW (data));
@@ -526,33 +526,33 @@ yw_new_window_cb (gpointer data, guint section, GtkWidget *widget)
}
static void
-yw_close_window_cb (gpointer data,
- guint section,
- GtkWidget *widget)
+window_close_window_cb (gpointer data,
+ guint section,
+ GtkWidget *widget)
{
gtk_widget_destroy (GTK_WIDGET (data));
}
static void
-yw_history_go_cb (gpointer data, guint section, GtkWidget *widget)
+window_history_go_cb (gpointer data, guint section, GtkWidget *widget)
{
- yw_history_action (data, section);
+ window_history_action (data, section);
}
static void
-yw_go_home_cb (gpointer data, guint section, GtkWidget *widget)
+window_go_home_cb (gpointer data, guint section, GtkWidget *widget)
{
- yw_home_button_clicked (NULL, YELP_WINDOW (data));
+ window_home_button_clicked (NULL, YELP_WINDOW (data));
}
static void
-yw_go_index_cb (gpointer data, guint section, GtkWidget *widget)
+window_go_index_cb (gpointer data, guint section, GtkWidget *widget)
{
- yw_index_button_clicked (NULL, YELP_WINDOW (data));
+ window_index_button_clicked (NULL, YELP_WINDOW (data));
}
static void
-yw_about_cb (gpointer data, guint section, GtkWidget *widget)
+window_about_cb (gpointer data, guint section, GtkWidget *widget)
{
GtkWidget *about;
const gchar *authors[] = {
@@ -576,7 +576,7 @@ yw_about_cb (gpointer data, guint section, GtkWidget *widget)
}
static GtkWidget *
-yw_create_toolbar (YelpWindow *window)
+window_create_toolbar (YelpWindow *window)
{
YelpWindowPriv *priv;
GtkWidget *toolbar;
@@ -607,11 +607,11 @@ yw_create_toolbar (YelpWindow *window)
gconf_client_notify_add (conf_client,
"/desktop/gnome/interface/toolbar_style",
- yw_toolbar_style_changed_cb,
+ window_toolbar_style_changed_cb,
toolbar, NULL, NULL);
/* g_signal_connect(toolbar, "destroy", */
-/* G_CALLBACK(yw_remove_notify_cb), */
+/* G_CALLBACK(window_remove_notify_cb), */
/* GINT_TO_POINTER(notify_id)); */
gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), style);
@@ -623,7 +623,7 @@ yw_create_toolbar (YelpWindow *window)
_("Back"),
_("Show previous page in history"),
NULL, icon,
- G_CALLBACK (yw_back_button_clicked),
+ G_CALLBACK (window_back_button_clicked),
window);
gtk_widget_set_sensitive (priv->back_button, FALSE);
@@ -635,7 +635,7 @@ yw_create_toolbar (YelpWindow *window)
_("Forward"),
_("Show next page in history"),
NULL, icon,
- G_CALLBACK (yw_forward_button_clicked),
+ G_CALLBACK (window_forward_button_clicked),
window);
gtk_widget_set_sensitive (priv->forward_button, FALSE);
@@ -649,7 +649,7 @@ yw_create_toolbar (YelpWindow *window)
_("Home"),
_("Go to home view"),
NULL, icon,
- G_CALLBACK (yw_home_button_clicked),
+ G_CALLBACK (window_home_button_clicked),
window);
if (priv->index) {
@@ -660,7 +660,7 @@ yw_create_toolbar (YelpWindow *window)
_("Index"),
_("Search in the index"),
NULL, icon,
- G_CALLBACK (yw_index_button_clicked),
+ G_CALLBACK (window_index_button_clicked),
window);
}
@@ -669,10 +669,10 @@ yw_create_toolbar (YelpWindow *window)
}
static void
-yw_toolbar_style_changed_cb (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer data)
+window_toolbar_style_changed_cb (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer data)
{
GtkToolbarStyle style = GTK_TOOLBAR_BOTH;
GtkToolbar *toolbar = GTK_TOOLBAR(data);
@@ -694,7 +694,7 @@ yw_toolbar_style_changed_cb (GConfClient *client,
#if 0
static void
-yw_remove_notify_cb (GtkObject *obj, gpointer data)
+window_remove_notify_cb (GtkObject *obj, gpointer data)
{
GConfClient *conf_client;
guint notify_id;
@@ -725,18 +725,18 @@ yelp_window_new (GNode *doc_tree, GList *index)
priv->index_view = yelp_view_index_new (index);
g_signal_connect (priv->index_view, "uri_selected",
- G_CALLBACK (yw_uri_selected_cb),
+ G_CALLBACK (window_uri_selected_cb),
window);
}
g_signal_connect (priv->toc_view, "uri_selected",
- G_CALLBACK (yw_uri_selected_cb),
+ G_CALLBACK (window_uri_selected_cb),
window);
g_signal_connect (priv->content_view, "uri_selected",
- G_CALLBACK (yw_uri_selected_cb),
+ G_CALLBACK (window_uri_selected_cb),
window);
- yw_populate (window);
+ window_populate (window);
return GTK_WIDGET (window);
}
@@ -755,7 +755,7 @@ yelp_window_open_uri (YelpWindow *window,
uri = yelp_uri_new (str_uri);
if (yelp_uri_exists (uri)) {
- yw_handle_uri (window, uri);
+ window_handle_uri (window, uri);
}
yelp_uri_unref (uri);