aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-10-31 07:14:00 +0800
committerChristian Persch <chpe@src.gnome.org>2005-10-31 07:14:00 +0800
commit1ff25e7c76cafd5abae29b7e7c058cee3f2f2299 (patch)
treec6551ba78e0f05700a7f1ad768d0b4b1cf1d0793
parent362396c2bf69c659b5fcea2eaf3ed17b6ff93b09 (diff)
downloadgsoc2013-epiphany-1ff25e7c76cafd5abae29b7e7c058cee3f2f2299.tar
gsoc2013-epiphany-1ff25e7c76cafd5abae29b7e7c058cee3f2f2299.tar.gz
gsoc2013-epiphany-1ff25e7c76cafd5abae29b7e7c058cee3f2f2299.tar.bz2
gsoc2013-epiphany-1ff25e7c76cafd5abae29b7e7c058cee3f2f2299.tar.lz
gsoc2013-epiphany-1ff25e7c76cafd5abae29b7e7c058cee3f2f2299.tar.xz
gsoc2013-epiphany-1ff25e7c76cafd5abae29b7e7c058cee3f2f2299.tar.zst
gsoc2013-epiphany-1ff25e7c76cafd5abae29b7e7c058cee3f2f2299.zip
R lib/ephy-glade.c: R lib/ephy-glade.h:
2005-10-31 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/GtkNSSDialogs.cpp: * embed/print-dialog.c: * lib/Makefile.am: * lib/ephy-dialog.c: (impl_construct): R lib/ephy-glade.c: R lib/ephy-glade.h: Remove ephy-glade since we don't need autoconnect anymore.
-rw-r--r--ChangeLog11
-rw-r--r--embed/mozilla/GtkNSSDialogs.cpp16
-rwxr-xr-xembed/print-dialog.c2
-rw-r--r--lib/Makefile.am2
-rw-r--r--lib/ephy-dialog.c22
-rw-r--r--lib/ephy-glade.c150
-rw-r--r--lib/ephy-glade.h44
7 files changed, 35 insertions, 212 deletions
diff --git a/ChangeLog b/ChangeLog
index e70d42ec1..d838aeeb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-10-31 Christian Persch <chpe@cvs.gnome.org>
+
+ * embed/mozilla/GtkNSSDialogs.cpp:
+ * embed/print-dialog.c:
+ * lib/Makefile.am:
+ * lib/ephy-dialog.c: (impl_construct):
+ R lib/ephy-glade.c:
+ R lib/ephy-glade.h:
+
+ Remove ephy-glade since we don't need autoconnect anymore.
+
2005-10-30 Christian Persch <chpe@cvs.gnome.org>
* data/glade/epiphany.glade:
diff --git a/embed/mozilla/GtkNSSDialogs.cpp b/embed/mozilla/GtkNSSDialogs.cpp
index 44b6897e2..95844b920 100644
--- a/embed/mozilla/GtkNSSDialogs.cpp
+++ b/embed/mozilla/GtkNSSDialogs.cpp
@@ -50,7 +50,7 @@
#include <nsEmbedString.h>
#define MOZILLA_INTERNAL_API 1
-#include <gconf/gconf-client.h>
+#include <glib/gi18n.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtkstock.h>
#include <gtk/gtkcheckbutton.h>
@@ -72,12 +72,13 @@
#include <gtk/gtktextbuffer.h>
#include <gtk/gtktextview.h>
#include <gtk/gtkprogressbar.h>
-#include <glib/gi18n.h>
+#include <gtk/gtksizegroup.h>
+#include <glade/glade-xml.h>
+#include <gconf/gconf-client.h>
#include <time.h>
#include "GtkNSSDialogs.h"
#include "ephy-file-helpers.h"
-#include "ephy-glade.h"
#include "ephy-gui.h"
NS_DEFINE_CID (kX509CertCID, NS_IX509CERT_IID);
@@ -1299,9 +1300,12 @@ GtkNSSDialogs::ViewCert(nsIInterfaceRequestor *ctx,
PRUnichar ** usage;
GtkSizeGroup * sizegroup;
- gxml = ephy_glade_widget_new (ephy_file ("certificate-dialogs.glade"),
- "viewcert_dialog",
- &dialog, NULL, NULL);
+ gxml = glade_xml_new (ephy_file ("certificate-dialogs.glade"),
+ "viewcert_dialog", NULL);
+ g_return_val_if_fail (gxml != NULL, NS_ERROR_FAILURE);
+
+ dialog = glade_xml_get_widget (gxml, "viewcert_dialog");
+ g_return_val_if_fail (dialog != NULL, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMWindow> parent = do_GetInterface (ctx);
GtkWindow *gparent = GTK_WINDOW (EphyUtils::FindGtkParent (parent));
diff --git a/embed/print-dialog.c b/embed/print-dialog.c
index a2eb47d33..72f39428c 100755
--- a/embed/print-dialog.c
+++ b/embed/print-dialog.c
@@ -185,7 +185,7 @@ ephy_print_get_print_info (void)
return info;
}
-void
+static void
ephy_print_dialog_response_cb (GtkDialog *dialog,
int response,
EmbedPrintInfo *info)
diff --git a/lib/Makefile.am b/lib/Makefile.am
index cec961f04..10a357a2e 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -13,7 +13,6 @@ NOINST_H_FILES = \
ephy-dnd.h \
ephy-file-chooser.h \
ephy-file-helpers.h \
- ephy-glade.h \
ephy-gui.h \
ephy-langs.h \
ephy-module.h \
@@ -48,7 +47,6 @@ libephymisc_la_SOURCES = \
ephy-dnd.c \
ephy-file-chooser.c \
ephy-file-helpers.c \
- ephy-glade.c \
ephy-gui.c \
ephy-langs.c \
ephy-loader.c \
diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c
index 9cd0518a3..ef264845c 100644
--- a/lib/ephy-dialog.c
+++ b/lib/ephy-dialog.c
@@ -22,7 +22,6 @@
#include "config.h"
#include "ephy-dialog.h"
-#include "ephy-glade.h"
#include "ephy-state.h"
#include "ephy-gui.h"
#include "eel-gconf-extensions.h"
@@ -36,6 +35,9 @@
#include <gtk/gtkspinbutton.h>
#include <gtk/gtkeditable.h>
#include <gtk/gtkentry.h>
+#include <gtk/gtksizegroup.h>
+#include <gtk/gtkdialog.h>
+#include <glade/glade-xml.h>
enum
{
@@ -1035,14 +1037,18 @@ impl_construct (EphyDialog *dialog,
const char *name,
const char *domain)
{
+ EphyDialogPrivate *priv = dialog->priv;
GladeXML *gxml;
- gxml = ephy_glade_widget_new
- (file, name, &(dialog->priv->dialog), dialog, domain);
+ gxml = glade_xml_new (file, name, domain);
+ g_return_if_fail (gxml != NULL);
- if (dialog->priv->name == NULL)
+ priv->dialog = glade_xml_get_widget (gxml, name);
+ g_return_if_fail (priv->dialog != NULL);
+
+ if (priv->name == NULL)
{
- dialog->priv->name = g_strdup (name);
+ priv->name = g_strdup (name);
}
if (properties)
@@ -1050,10 +1056,8 @@ impl_construct (EphyDialog *dialog,
init_props (dialog, properties, gxml);
}
- g_signal_connect_object (dialog->priv->dialog,
- "destroy",
- G_CALLBACK(dialog_destroy_cb),
- dialog, 0);
+ g_signal_connect_object (dialog->priv->dialog, "destroy",
+ G_CALLBACK(dialog_destroy_cb), dialog, 0);
g_object_unref (gxml);
}
diff --git a/lib/ephy-glade.c b/lib/ephy-glade.c
deleted file mode 100644
index 75dc067e3..000000000
--- a/lib/ephy-glade.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2000, 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, 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.
- *
- * $Id$
- */
-
-#include "config.h"
-
-#include "ephy-glade.h"
-
-#include <glade/glade-xml.h>
-#include <gtk/gtkmenu.h>
-#include <gmodule.h>
-
-static void
-glade_signal_connect_func (const gchar *cb_name, GObject *obj,
- const gchar *signal_name, const gchar *signal_data,
- GObject *conn_obj, gboolean conn_after,
- gpointer user_data);
-
-/**
- * ephy_glade_widget_new:
- * @file: a Glade XML file
- * @widget_name: the name of a widget within @file
- * @root: the returned root #GtkWidget pointer, or %NULL if not wanted
- * @data: callback data to connect to all @root's signal callbacks
- * @domain: the translation domain for the XML file (or %NULL for default)
- *
- * Builds a new #GladeXML object from the given @file with root widget
- * @widget_name. The widget can also be aquired by passing @root, a pointer
- * to a #GtkWidget pointer.
- *
- * The signal callbacks underneath the desired root widget in @file will all be
- * automatically connected; the callback data will be @data.
- *
- * Libglade automatically caches @file; it is not inefficient to call
- * ephy_glade_widget_new() several times on the same XML file.
- *
- * Return value: the desired #GladeXML object, or %NULL on failure
- **/
-GladeXML *
-ephy_glade_widget_new (const char *file,
- const char *widget_name,
- GtkWidget **root,
- gpointer data,
- const char *domain)
-{
- GladeXML *gxml;
-
- /* build the widget */
- gxml = glade_xml_new (file, widget_name, domain);
- g_return_val_if_fail (gxml != NULL, NULL);
-
- /* lookup the root widget if requested */
- if (root != NULL)
- {
- *root = glade_xml_get_widget (gxml, widget_name);
- }
-
- /* connect signals and data */
- glade_xml_signal_autoconnect_full
- (gxml, (GladeXMLConnectFunc)glade_signal_connect_func, data);
-
- /* return xml document for subsequent widget lookups */
- return gxml;
-}
-
-/*
- * glade_signal_connect_func: used by glade_xml_signal_autoconnect_full
- */
-static void
-glade_signal_connect_func (const gchar *cb_name, GObject *obj,
- const gchar *signal_name, const gchar *signal_data,
- GObject *conn_obj, gboolean conn_after,
- gpointer user_data)
-{
- /** Module with all the symbols of the program */
- static GModule *mod_self = NULL;
- gpointer handler_func;
-
- /* initialize gmodule */
- if (mod_self == NULL)
- {
- mod_self = g_module_open (NULL, G_MODULE_BIND_LAZY);
- g_assert (mod_self != NULL);
- }
-
- /*g_print( "glade_signal_connect_func: cb_name = '%s', signal_name = '%s', signal_data = '%s'\n",
- cb_name, signal_name, signal_data ); */
-
- if (g_module_symbol (mod_self, cb_name, &handler_func))
- {
- /* found callback */
- if (conn_obj)
- {
- if (conn_after)
- {
- g_signal_connect_object
- (obj, signal_name,
- handler_func, conn_obj,
- G_CONNECT_AFTER);
- }
- else
- {
- g_signal_connect_object
- (obj, signal_name,
- handler_func, conn_obj,
- G_CONNECT_SWAPPED);
- }
- }
- else
- {
- /* no conn_obj; use standard connect */
- gpointer data = NULL;
-
- data = user_data;
-
- if (conn_after)
- {
- g_signal_connect_after
- (obj, signal_name,
- handler_func, data);
- }
- else
- {
- g_signal_connect
- (obj, signal_name,
- handler_func, data);
- }
- }
- }
- else
- {
- g_warning("callback function not found: %s", cb_name);
- }
-}
diff --git a/lib/ephy-glade.h b/lib/ephy-glade.h
deleted file mode 100644
index 324fe315e..000000000
--- a/lib/ephy-glade.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2000, 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, 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.
- *
- * $Id$
- */
-
-#ifndef EPHY_GLADE_H
-#define EPHY_GLADE_H
-
-#include <glib.h>
-#include <gtk/gtk.h>
-#include <glade/glade-xml.h>
-
-G_BEGIN_DECLS
-
-typedef struct
-{
- const gchar *name;
- GtkWidget **ptr;
-} WidgetLookup;
-
-GladeXML *ephy_glade_widget_new (const char *file,
- const char *widget_name,
- GtkWidget **root,
- gpointer data,
- const char *domain);
-
-G_END_DECLS
-
-#endif