Commit 543fc562 authored by Mikael Hallendal's avatar Mikael Hallendal Committed by Mikael Hallendal

Added devhelp.in Updated from Gossip Removed html widget check, always use

2004-03-15  Mikael Hallendal  <micke@imendio.com>

	* Makefile.am: Added devhelp.in
	* autogen.sh: Updated from Gossip
	* configure.in: Removed html widget check, always use Gecko
	* devhelp.in: New script that sets MOZILLA_HOME
	* src/Makefile.am: Updated for file changes
	* src/dh-gecko-utils.cpp: Added, based on patch for yelp by Marco.
	* src/dh-gecko-utils.h: same
	* src/dh-html-gtkhtml2.c: Removed
	* src/dh-html-mozilla.c: Removed
	* src/dh-html.c:
	* src/dh-html.h:
	- Only support Gecko now.
	* src/dh-marshal.list: Added marshaller for title-changed
	* src/dh-util.c:
	* src/dh-util.h:
	(dh_dot_dir): Added
	* src/dh-window.c: (window_populate): Don't put the html widget in a
	  scrolled window, gecko provides it's own.
parent 9dd9e0a9
2004-03-15 Mikael Hallendal <micke@imendio.com>
* Makefile.am: Added devhelp.in
* autogen.sh: Updated from Gossip
* configure.in: Removed html widget check, always use Gecko
* devhelp.in: New script that sets MOZILLA_HOME
* src/Makefile.am: Updated for file changes
* src/dh-gecko-utils.cpp: Added, based on patch for yelp by Marco.
* src/dh-gecko-utils.h: same
* src/dh-html-gtkhtml2.c: Removed
* src/dh-html-mozilla.c: Removed
* src/dh-html.c:
* src/dh-html.h:
- Only support Gecko now.
* src/dh-marshal.list: Added marshaller for title-changed
* src/dh-util.c:
* src/dh-util.h:
(dh_dot_dir): Added
* src/dh-window.c: (window_populate): Don't put the html widget in a
scrolled window, gecko provides it's own.
2004-03-04 Guntupalli Karunakar <karunakar@freedomink.org>
* configure.in: Added "pa" for Punjabi to ALL_LINGUAS.
......
......@@ -19,11 +19,14 @@ mime_DATA = $(KEYS_FILES) devhelp.mime
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libdevhelp-1.0.pc
bin_SCRIPTS = devhelp
EXTRA_DIST = \
TODO \
$(DESKTOP_IN_FILES) \
$(KEYS_IN_FILES) \
$(mime_DATA) \
devhelp.in \
devhelp.desktop.in \
devhelp.spec.in \
libdevhelp-1.0.pc.in \
......
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
: ${AUTOCONF=autoconf}
: ${AUTOHEADER=autoheader}
: ${AUTOMAKE=automake}
: ${ACLOCAL=aclocal}
: ${LIBTOOLIZE=libtoolize}
: ${INTLTOOLIZE=intltoolize}
: ${LIBTOOL=libtool}
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
PROJECT=Devhelp
PROJECT=devhelp
TEST_TYPE=-f
FILE=src/dh-window.c
FILE=src/dh-main.c
CONFIGURE=configure.in
DIE=0
AUTOMAKE=automake-1.4
ACLOCAL=aclocal-1.4
($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
AUTOMAKE=automake
ACLOCAL=aclocal
}
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
# if GNOME2_DIR set, modify ACLOCAL_FLAGS ...
if [ -n "$GNOME2_DIR" ]; then
ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS"
fi
($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to compile $PROJECT."
echo "Download the appropriate package for your distribution,"
......@@ -28,44 +34,56 @@ ACLOCAL=aclocal-1.4
DIE=1
}
(grep "^AC_PROG_INTLTOOL" $srcdir/configure.in >/dev/null) && {
($INTLTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have \`intltoolize' installed to compile $PROJECT."
echo "Get ftp://ftp.gnome.org/pub/GNOME/stable/sources/intltool/intltool-0.22.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}
($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have automake installed to compile $PROJECT."
echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4-p6.tar.gz"
echo "Get ftp://sourceware.cygnus.com/pub/automake/automake-1.4.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
(grep "^AM_PROG_LIBTOOL" configure.in >/dev/null) && {
(libtool --version) < /dev/null > /dev/null 2>&1 || {
($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed to compile $PROJECT."
echo "Get ftp://ftp.gnu.org/pub/gnu/libtool/libtool-1.4.2.tar.gz"
echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}
grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null && {
grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
(gettext --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`gettext' installed to compile $PROJECT."
echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}
(grep "^AC_PROG_INTLTOOL" $srcdir/configure.in >/dev/null) && {
(intltoolize --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`intltoolize' installed to compile $PKG_NAME."
echo "Get ftp://ftp.gnome.org/pub/GNOME/stable/sources/intltool/intltool-0.15.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}
if grep "^AM_[A-Z0-9_]\{1,\}_GETTEXT" "$CONFIGURE" >/dev/null; then
if grep "sed.*POTFILES" "$CONFIGURE" >/dev/null; then
GETTEXTIZE=""
else
if grep "^AM_GLIB_GNU_GETTEXT" "$CONFIGURE" >/dev/null; then
GETTEXTIZE="glib-gettextize"
GETTEXTIZE_URL="ftp://ftp.gtk.org/pub/gtk/v2.0/glib-2.0.0.tar.gz"
else
GETTEXTIZE="gettextize"
GETTEXTIZE_URL="ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
fi
$GETTEXTIZE --version < /dev/null > /dev/null 2>&1
if test $? -ne 0; then
echo
echo "**Error**: You must have \`$GETTEXTIZE' installed to compile $PKG_NAME."
echo "Get $GETTEXTIZE_URL"
echo "(or a newer version if it is available)"
DIE=1
fi
fi
fi
if test "$DIE" -eq 1; then
exit 1
......@@ -119,19 +137,19 @@ do
intltoolize --copy --force --automake
fi
if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
echo "Running libtoolize..."
libtoolize --force --copy
echo "Running $LIBTOOLIZE..."
$LIBTOOLIZE --force --copy
fi
echo "Running aclocal $aclocalinclude ..."
echo "Running $ACLOCAL $aclocalinclude ..."
$ACLOCAL $aclocalinclude
if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
echo "Running autoheader..."
autoheader
echo "Running $AUTOHEADER..."
$AUTOHEADER
fi
echo "Running automake --gnu $am_opt ..."
echo "Running $AUTOMAKE --gnu $am_opt ..."
$AUTOMAKE --add-missing --gnu $am_opt
echo "Running autoconf ..."
autoconf
echo "Running $AUTOCONF ..."
$AUTOCONF
)
fi
done
......@@ -147,4 +165,3 @@ if test x$NOCONFIGURE = x; then
else
echo Skipping configure process.
fi
......@@ -7,7 +7,7 @@ AM_SANITY_CHECK
AM_MAINTAINER_MODE
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_ISC_POSIX
AC_HEADER_STDC
AM_PROG_LIBTOOL
......@@ -22,9 +22,6 @@ fi
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
AC_ARG_WITH(html-widget, [ --with-html-widget=[gtkhtml2/mozilla] html widget to use])
PKG_CHECK_MODULES(DEVHELP, [
gtk+-2.0 >= 2.2.0])
......@@ -34,20 +31,15 @@ PKG_CHECK_MODULES(LIBDEVHELP, [
gnome-vfs-2.0 >= 2.2.0
])
PKG_CHECK_MODULES(MOZILLA_COMPONENT, mozilla-gtkmozembed)
AC_SUBST(MOZILLA_COMPONENT_CFLAGS)
AC_SUBST(MOZILLA_COMPONENT_LIBS)
if test x$with_html_widget = xmozilla; then
PKG_CHECK_MODULES(HTML_WIDGET, mozilla-gtkmozembed)
else
PKG_CHECK_MODULES(HTML_WIDGET, libgtkhtml-2.0 >= 2.1.2)
fi
CFLAGS="$HTML_WIDGET_CFLAGS $CFLAGS"
AM_CONDITIONAL(HTML_WIDGET_MOZILLA, test x$with_html_widget = xmozilla)
PKG_CHECK_MODULES(EGG, [gtk+-2.0 >= 2.0.0 libgnome-2.0])
AC_SUBST(EGG_CFLAGS)
AC_SUBST(EGG_LIBS)
MOZILLA_INCLUDE_ROOT="`$PKG_CONFIG --variable=includedir mozilla-gtkmozembed`"
AC_SUBST(MOZILLA_INCLUDE_ROOT)
MOZILLA_HOME="`$PKG_CONFIG --variable=libdir mozilla-gtkmozembed`"
AC_SUBST(MOZILLA_HOME)
dnl Checks for zlib library.
_cppflags="${CPPFLAGS}"
......@@ -103,10 +95,12 @@ Makefile
devhelp.spec
devhelp.desktop
devhelp.keys
devhelp
libdevhelp-1.0.pc
dtd/Makefile
po/Makefile.in
src/Makefile
ui/Makefile
misc/Makefile
])
#!/bin/sh
dist_bin=`dirname $0`
MOZILLA_HOME=@MOZILLA_HOME@
LD_LIBRARY_PATH=$MOZILLA_HOME:$LD_LIBRARY_PATH
MOZILLA_FIVE_HOME=$MOZILLA_HOME
export MOZILLA_FIVE_HOME
exec "$dist_bin/devhelp-bin" "$@"
NULL =
INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DDATA_DIR=\"$(datadir)\" \
-DPREFIX="\"$(prefix)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DLIBDIR=\""$(libdir)"\" \
-DDTD_DIR="\"$(datadir)/devhelp/dtd"\" \
@DEVHELP_CFLAGS@ \
@LIBDEVHELP_CFLAGS@ \
INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-DDATA_DIR=\"$(datadir)\" \
-DPREFIX="\"$(prefix)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DLIBDIR=\""$(libdir)"\" \
-DDTD_DIR="\"$(datadir)/devhelp/dtd"\" \
@DEVHELP_CFLAGS@ \
@LIBDEVHELP_CFLAGS@ \
$(MOZILLA_COMPONENT_CFLAGS) \
-I$(MOZILLA_INCLUDE_ROOT)/dom \
-I$(MOZILLA_INCLUDE_ROOT)/find \
-I$(MOZILLA_INCLUDE_ROOT)/webbrwsr \
-I$(MOZILLA_INCLUDE_ROOT)/string \
-I$(MOZILLA_INCLUDE_ROOT)/pref \
-include $(MOZILLA_INCLUDE_ROOT)/mozilla-config.h \
$(NULL)
if HTML_WIDGET_MOZILLA
html_widget_impl=dh-html-mozilla.c
else
html_widget_impl=dh-html-gtkhtml2.c
endif
bin_PROGRAMS = devhelp-bin
bin_PROGRAMS = devhelp
devhelp_SOURCES = \
devhelp_bin_SOURCES = \
dh-main.c
devhelp_LDADD = \
devhelp_bin_LDADD = \
@DEVHELP_LIBS@ \
libdevhelp-1.la
......@@ -53,7 +54,9 @@ libdevhelp_1_la_SOURCES = \
dh-book-tree.c \
dh-error.c \
dh-history.c \
$(html_widget_impl) \
dh-html.c \
dh-gecko-utils.cpp \
dh-gecko-utils.h \
dh-keyword-model.c \
dh-link.c \
dh-search.c \
......@@ -63,7 +66,9 @@ libdevhelp_1_la_SOURCES = \
libdevhelp_1_la_LIBADD = \
@LIBDEVHELP_LIBS@ \
@HTML_WIDGET_LIBS@
$(MOZILLA_COMPONENT_LIBS)
libdevhelp_1_la_LDFLAGS = -avoid-version -module
dh-marshal-main.c: dh-marshal.c dh-marshal.h
......@@ -81,7 +86,5 @@ dh-marshal.c: dh-marshal.h
EXTRA_DIST = \
dh-marshal.list \
dh-html-mozilla.c \
dh-html-gtkhtml2.c \
$(devhelph_HEADERS) \
$(NULL)
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2004 Marco Pesenti Gritti
*
* 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: Marco Pesenti Gritti <marco@gnome.org>
*/
#include <gtkmozembed.h>
#include <gtkmozembed_internal.h>
#include <nsIWebBrowser.h>
#include <nsIWebBrowserFind.h>
#include <nsCOMPtr.h>
#include <nsIInterfaceRequestorUtils.h>
#include <nsReadableUtils.h>
#include <nsString.h>
#include <nsIPrefService.h>
#include <nsIServiceManager.h>
static gboolean
gecko_prefs_set_string (const gchar *key, const gchar *value)
{
nsCOMPtr<nsIPrefService> prefService =
do_GetService (NS_PREFSERVICE_CONTRACTID);
nsCOMPtr<nsIPrefBranch> pref;
prefService->GetBranch ("", getter_AddRefs (pref));
if (pref) {
nsresult rv = pref->SetCharPref (key, value);
return NS_SUCCEEDED (rv) ? TRUE : FALSE;
}
return FALSE;
}
static gboolean
gecko_prefs_set_int (const gchar *key, gint value)
{
nsCOMPtr<nsIPrefService> prefService =
do_GetService (NS_PREFSERVICE_CONTRACTID);
nsCOMPtr<nsIPrefBranch> pref;
prefService->GetBranch ("", getter_AddRefs (pref));
if (pref) {
nsresult rv = pref->SetIntPref (key, value);
return NS_SUCCEEDED (rv) ? TRUE : FALSE;
}
return FALSE;
}
extern "C" gboolean
dh_gecko_set_font (GtkMozEmbed *embed, const gchar *fontname, gint fontsize)
{
gecko_prefs_set_string ("font.name.variable.x-western", fontname);
gecko_prefs_set_int ("font.size.variable.x-western", fontsize);
}
extern "C" gboolean
dh_gecko_find (GtkMozEmbed *embed,
const gchar *str,
gboolean match_case,
gboolean wrap,
gboolean forward)
{
PRBool didFind;
nsCString matchString;
matchString.Assign (str);
nsCOMPtr<nsIWebBrowser> webBrowser;
gtk_moz_embed_get_nsIWebBrowser (embed, getter_AddRefs(webBrowser));
nsCOMPtr<nsIWebBrowserFind> finder (do_GetInterface(webBrowser));
NS_ENSURE_TRUE (finder, NS_ERROR_FAILURE);
finder->SetFindBackwards (!forward);
finder->SetSearchString (ToNewUnicode (matchString));
finder->SetMatchCase (match_case);
finder->SetWrapFind (wrap);
finder->FindNext (&didFind);
return didFind;
}
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2004 Marco Pesenti Gritti
*
* 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: Marco Pesenti Gritti <marco@gnome.org>
*/
#ifndef __DH_GECKO_UTILS_H__
#define __DH_GECKO_UTILS_H__
G_BEGIN_DECLS
void dh_gecko_set_font (GtkMozEmbed *html,
const gchar *fontname,
guint fontsize);
gboolean dh_set_font (GtkMozEmbed *html,
const gchar *font_name);
/*
gboolean dh_gecko_find (GtkMozEmbed *html,
const gchar *str,
gboolean match_case,
gboolean wrap,
gboolean forward);
*/
G_END_DECLS
#endif /* __DH_HTML_H__ */
This diff is collapsed.
......@@ -2,6 +2,7 @@
/*
* Copyright (C) 2002-2003 CodeFactory AB
* Copyright (C) 2001-2003 Mikael Hallendal <micke@imendio.com>
* Copyright (C) 2004 Imendio hB
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -24,20 +25,24 @@
#include <libgnomevfs/gnome-vfs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-init.h>
#include <gtkmozembed.h>
#include "dh-util.h"
#include "dh-marshal.h"
#include "dh-gecko-utils.h"
#include "dh-html.h"
#define d(x)
struct _DhHtmlPriv {
GtkWidget *widget;
GtkMozEmbed *gecko;
};
static void html_init (DhHtml *html);
static void html_class_init (DhHtmlClass *klass);
static void html_init (DhHtml *html);
static void html_title_cb (GtkMozEmbed *embed,
DhHtml *html);
#if 0
static gint html_open_uri_cb (GtkMozEmbed *embed,
......@@ -47,6 +52,7 @@ static gint html_open_uri_cb (GtkMozEmbed *embed,
enum {
URI_SELECTED,
TITLE_CHANGED,
LAST_SIGNAL
};
......@@ -63,7 +69,7 @@ dh_html_get_type (void)
sizeof (DhHtmlClass),
NULL,
NULL,
(GClassInitFunc) html_class_init,
(GClassInitFunc) html_class_init,
NULL,
NULL,
sizeof (DhHtml),
......@@ -79,15 +85,52 @@ dh_html_get_type (void)
return type;
}
static void
html_class_init (DhHtmlClass *klass)
{
signals[URI_SELECTED] =
g_signal_new ("uri-selected",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (DhHtmlClass, uri_selected),
NULL, NULL,
dh_marshal_VOID__POINTER,
G_TYPE_NONE,
1, G_TYPE_POINTER);
signals[TITLE_CHANGED] =
g_signal_new ("title-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (DhHtmlClass, title_changed),
NULL, NULL,
dh_marshal_VOID__STRING,
G_TYPE_NONE,
1, G_TYPE_STRING);
}
static void
html_init (DhHtml *html)
{
DhHtmlPriv *priv;
gchar *profile_path;
priv = g_new0 (DhHtmlPriv, 1);
priv = g_new0 (DhHtmlPriv, 1);
priv->gecko = (GtkMozEmbed *) gtk_moz_embed_new ();
priv->widget = gtk_moz_embed_new ();
profile_path = g_build_filename (dh_dot_dir (),
"mozilla",
NULL);
gtk_moz_embed_set_profile_path (profile_path, "Devhelp");
g_free (profile_path);
dh_gecko_set_font (priv->gecko, "Bitstream Vera Sans", 10);
g_signal_connect (priv->gecko, "title",
G_CALLBACK (html_title_cb),
html);
#if 0
g_signal_connect (priv->widget, "open_uri",
G_CALLBACK (html_open_uri_cb),
......@@ -98,17 +141,16 @@ html_init (DhHtml *html)
}
static void
html_class_init (DhHtmlClass *klass)
html_title_cb (GtkMozEmbed *embed, DhHtml *html)
{
signals[URI_SELECTED] =
g_signal_new ("uri_selected",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (DhHtmlClass, uri_selected),
NULL, NULL,
dh_marshal_VOID__POINTER,
G_TYPE_NONE,
1, G_TYPE_POINTER);
char *new_title;
new_title = gtk_moz_embed_get_title (embed);
if (new_title && *new_title != '\0') {
g_signal_emit (html, signals[TITLE_CHANGED], 0, new_title);
}
g_free (new_title);
}
#if 0
......@@ -129,13 +171,10 @@ DhHtml *
dh_html_new (void)
{
DhHtml *html;
DhHtmlPriv *priv;
d(puts(__FUNCTION__));
html = g_object_new (DH_TYPE_HTML, NULL);
priv = html->priv;
return html;
}
......@@ -146,7 +185,6 @@ dh_html_open_uri (DhHtml *html, const gchar *str_uri)
DhHtmlPriv *priv;
gchar *full_uri;
d(puts(__FUNCTION__));
g_return_if_fail (DH_IS_HTML (html));
......@@ -160,7 +198,7 @@ dh_html_open_uri (DhHtml *html, const gchar *str_uri)
full_uri = (gchar *) str_uri;
}
gtk_moz_embed_load_url (GTK_MOZ_EMBED (priv->widget), full_uri);
gtk_moz_embed_load_url (priv->gecko, full_uri);
if (full_uri != str_uri) {
g_free (full_uri);
......@@ -172,7 +210,7 @@ dh_html_get_widget (DhHtml *html)
{
g_return_val_if_fail (DH_IS_HTML (html), NULL);
gtk_widget_show (html->priv->widget);
gtk_widget_show (GTK_WIDGET (html->priv->gecko));
return html->priv->widget;
return GTK_WIDGET (html->priv->gecko);
}
......@@ -45,8 +45,10 @@ struct _DhHtmlClass {
GObjectClass parent_class;
/* Signals */
void (*uri_selected) (DhHtml *html,
const gchar *uri);
void (*title_changed) (DhHtml *html,
const gchar *new_title);
void (*uri_selected) (DhHtml *html,
const gchar *uri);
};
GType dh_html_get_type (void);
......
VOID:BOOLEAN
VOID:POINTER
VOID:STRING
......@@ -22,10 +22,26 @@
#include <config.h>
#include <string.h>
#include <libgnome/gnome-init.h>
#include "dh-util.h"
#define d(x)
static gchar *dot_dir = NULL;
const gchar *
dh_dot_dir (void)
{
if (!dot_dir) {
dot_dir = g_build_filename (g_get_home_dir (),
GNOME_DOT_GNOME,
"devhelp",
NULL);
}
return dot_dir;
}
/* ----------------------------------------------------------------- */
/* From GNOME VFS */
/* ----------------------------------------------------------------- */
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2001-2002 Mikael Hallendal <micke@imendio.com>
* Copyright (C) 2004 Imendio hB
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
......@@ -24,6 +25,8 @@
#include <glib.h>
#include <libgnomevfs/gnome-vfs.h>
const gchar * dh_dot_dir (void);
/* Taken from gnome-vfs CVS. */
gchar * dh_util_uri_relative_new (const gchar *text_uri,
const gchar *base_uri);
......
......@@ -266,7 +266,6 @@ static void
window_populate (DhWindow *window)
{
DhWindowPriv *priv;
GtkWidget *html_sw;
GtkWidget *frame;
GtkWidget *book_tree_sw;
GNode *contents_tree;
......@@ -303,11 +302,7 @@ window_populate (DhWindow *window)
G_CALLBACK (window_switch_page_after_cb),
window);
html_sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (html_sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
book_tree_sw = gtk_scrolled_window_new (NULL, NULL);
book_tree_sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (book_tree_sw),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
......@@ -321,15 +316,11 @@ window_populate (DhWindow *window)
gtk_paned_add1 (GTK_PANED (priv->hpaned), frame);
/* gtk_container_add (GTK_CONTAINER (html_sw), priv->html_view); */
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (html_sw),
priv->html_view);
frame = gtk_frame_new (NULL);
gtk_container_add (GTK_CONTAINER (frame), html_sw);
gtk_container_add (GTK_CONTAINER (frame), priv->html_view);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
gtk_paned_add2 (GTK_PANED(priv->hpaned), frame);
gtk_paned_add2 (GTK_PANED(priv->hpaned), frame);
gtk_paned_set_position (GTK_PANED (priv->hpaned), 250);
......