aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2012-11-06 19:19:59 +0800
committerBastien Nocera <hadess@hadess.net>2012-12-10 15:46:47 +0800
commit4666852818b260e239b33092678fcad78a1f031c (patch)
tree31d5cc42cd6f28c3b2ba509f5826b36d9658b16f /lib
parent52b87722689ed8a124b6cafcf51f7309b7c7104c (diff)
downloadgsoc2013-epiphany-4666852818b260e239b33092678fcad78a1f031c.tar
gsoc2013-epiphany-4666852818b260e239b33092678fcad78a1f031c.tar.gz
gsoc2013-epiphany-4666852818b260e239b33092678fcad78a1f031c.tar.bz2
gsoc2013-epiphany-4666852818b260e239b33092678fcad78a1f031c.tar.lz
gsoc2013-epiphany-4666852818b260e239b33092678fcad78a1f031c.tar.xz
gsoc2013-epiphany-4666852818b260e239b33092678fcad78a1f031c.tar.zst
gsoc2013-epiphany-4666852818b260e239b33092678fcad78a1f031c.zip
lib: Remove unused EphySearchEntry widget
https://bugzilla.gnome.org/show_bug.cgi?id=687744
Diffstat (limited to 'lib')
-rw-r--r--lib/widgets/Makefile.am2
-rw-r--r--lib/widgets/ephy-search-entry.c211
-rw-r--r--lib/widgets/ephy-search-entry.h65
3 files changed, 0 insertions, 278 deletions
diff --git a/lib/widgets/Makefile.am b/lib/widgets/Makefile.am
index 3259bb703..7bf331674 100644
--- a/lib/widgets/Makefile.am
+++ b/lib/widgets/Makefile.am
@@ -85,8 +85,6 @@ libephywidgets_la_SOURCES = \
ephy-overview-store.h \
ephy-removable-pixbuf-renderer.c \
ephy-removable-pixbuf-renderer.h \
- ephy-search-entry.c \
- ephy-search-entry.h \
ephy-tree-model-node.c \
ephy-tree-model-node.h \
ephy-tree-model-sort.c \
diff --git a/lib/widgets/ephy-search-entry.c b/lib/widgets/ephy-search-entry.c
deleted file mode 100644
index 2a5e971e6..000000000
--- a/lib/widgets/ephy-search-entry.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * Copyright © 2002 Jorn Baayen <jorn@nl.linux.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "config.h"
-
-#include <glib/gi18n.h>
-
-#include "ephy-search-entry.h"
-
-/**
- * SECTION:ephy-search-entry
- * @short_description: A search entry widget
- * @see_also: #GtkEntry
- *
- * #EphySearchEntry implements a #GtkEntry for handling user search input.
- * It implements a search timeout and easy cleaning.
- */
-
-static void ephy_search_entry_class_init (EphySearchEntryClass *klass);
-static void ephy_search_entry_init (EphySearchEntry *entry);
-
-#define EPHY_SEARCH_ENTRY_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_SEARCH_ENTRY, EphySearchEntryPrivate))
-
-struct _EphySearchEntryPrivate
-{
- gboolean clearing;
- guint timeout;
-};
-
-enum
-{
- SEARCH,
- LAST_SIGNAL
-};
-
-static guint ephy_search_entry_signals[LAST_SIGNAL] = { 0 };
-
-G_DEFINE_TYPE (EphySearchEntry, ephy_search_entry, GTK_TYPE_ENTRY)
-
-static void
-ephy_search_entry_class_init (EphySearchEntryClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- /**
- * EphySearchEntry::search:
- * @entry: the object on which the signal is emitted
- * @text: the text introduced by the user
- *
- * Emitted when the user activates the search entry after introducing
- * text.
- *
- */
- ephy_search_entry_signals[SEARCH] =
- g_signal_new ("search",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EphySearchEntryClass, search),
- NULL, NULL,
- g_cclosure_marshal_VOID__STRING,
- G_TYPE_NONE,
- 1,
- G_TYPE_STRING);
-
- g_type_class_add_private (object_class, sizeof (EphySearchEntryPrivate));
-}
-
-static gboolean
-ephy_search_entry_timeout_cb (EphySearchEntry *entry)
-{
- g_signal_emit (entry, ephy_search_entry_signals[SEARCH], 0,
- gtk_entry_get_text (GTK_ENTRY (entry)));
- entry->priv->timeout = 0;
-
- return FALSE;
-}
-
-static void
-ephy_search_entry_changed_cb (GtkEditable *editable,
- EphySearchEntry *entry)
-{
- if (entry->priv->clearing == TRUE)
- {
- g_signal_emit (entry, ephy_search_entry_signals[SEARCH], 0,
- gtk_entry_get_text (GTK_ENTRY (entry)));
- return;
- }
-
- if (entry->priv->timeout != 0)
- {
- g_source_remove (entry->priv->timeout);
- entry->priv->timeout = 0;
- }
-
- entry->priv->timeout = g_timeout_add (300, (GSourceFunc) ephy_search_entry_timeout_cb, entry);
-}
-
-static void
-ephy_search_entry_destroy_cb (GtkEditable *editable,
- EphySearchEntry *entry)
-{
- if (entry->priv->timeout)
- {
- g_source_remove (entry->priv->timeout);
- entry->priv->timeout = 0;
- }
-}
-
-static gboolean
-search_entry_clear_cb (GtkWidget *entry,
- GtkEntryIconPosition position,
- GdkEventButton *event,
- gpointer user_data)
-{
- guint state = event->state & gtk_accelerator_get_default_mod_mask ();
-
- if (event->button == 1 /* left */ &&
- state == 0 &&
- position == GTK_ENTRY_ICON_SECONDARY)
- {
- ephy_search_entry_clear (EPHY_SEARCH_ENTRY (entry));
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void
-ephy_search_entry_init (EphySearchEntry *entry)
-{
- gboolean ltr;
-
- entry->priv = EPHY_SEARCH_ENTRY_GET_PRIVATE (entry);
- ltr = gtk_widget_get_default_direction () == GTK_TEXT_DIR_LTR;
-
- gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
- GTK_ENTRY_ICON_SECONDARY,
- ltr ? "edit-clear-symbolic" :
- "edit-clear-rtl-symbolic");
- gtk_entry_set_icon_activatable (GTK_ENTRY (entry),
- GTK_ENTRY_ICON_SECONDARY,
- TRUE);
- gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
- GTK_ENTRY_ICON_SECONDARY,
- _("Clear"));
- g_signal_connect (entry,
- "icon-press",
- G_CALLBACK (search_entry_clear_cb),
- NULL);
- g_signal_connect (entry,
- "destroy",
- G_CALLBACK (ephy_search_entry_destroy_cb),
- entry);
- g_signal_connect (entry,
- "changed",
- G_CALLBACK (ephy_search_entry_changed_cb),
- entry);
-}
-
-/**
- * ephy_search_entry_new:
- *
- * Creates a new #EphySearchEntry.
- *
- * Returns: a new #EphySearchEntry, as a #GtkWidget
- **/
-GtkWidget *
-ephy_search_entry_new (void)
-{
- return gtk_widget_new (EPHY_TYPE_SEARCH_ENTRY, NULL);
-}
-
-/**
- * ephy_search_entry_clear:
- * @entry: an #EphySearchEntry
- *
- * Clears the text of the internal #GtkEntry of @entry.
- *
- **/
-void
-ephy_search_entry_clear (EphySearchEntry *entry)
-{
- if (entry->priv->timeout != 0)
- {
- g_source_remove (entry->priv->timeout);
- entry->priv->timeout = 0;
- }
-
- entry->priv->clearing = TRUE;
-
- gtk_entry_set_text (GTK_ENTRY (entry), "");
-
- entry->priv->clearing = FALSE;
-}
diff --git a/lib/widgets/ephy-search-entry.h b/lib/widgets/ephy-search-entry.h
deleted file mode 100644
index 5ea2526d2..000000000
--- a/lib/widgets/ephy-search-entry.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright © 2002 Jorn Baayen <jorn@nl.linux.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#if !defined (__EPHY_EPIPHANY_H_INSIDE__) && !defined (EPIPHANY_COMPILATION)
-#error "Only <epiphany/epiphany.h> can be included directly."
-#endif
-
-#ifndef EPHY_SEARCH_ENTRY_H
-#define EPHY_SEARCH_ENTRY_H
-
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-#define EPHY_TYPE_SEARCH_ENTRY (ephy_search_entry_get_type ())
-#define EPHY_SEARCH_ENTRY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EPHY_TYPE_SEARCH_ENTRY, EphySearchEntry))
-#define EPHY_SEARCH_ENTRY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EPHY_TYPE_SEARCH_ENTRY, EphySearchEntryClass))
-#define EPHY_IS_SEARCH_ENTRY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EPHY_TYPE_SEARCH_ENTRY))
-#define EPHY_IS_SEARCH_ENTRY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_SEARCH_ENTRY))
-#define EPHY_SEARCH_ENTRY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EPHY_TYPE_SEARCH_ENTRY, EphySearchEntryClass))
-
-typedef struct _EphySearchEntryClass EphySearchEntryClass;
-typedef struct _EphySearchEntry EphySearchEntry;
-typedef struct _EphySearchEntryPrivate EphySearchEntryPrivate;
-
-struct _EphySearchEntryClass
-{
- GtkEntryClass parent;
-
- void (*search) (EphySearchEntry *entry, const char *text);
-};
-
-struct _EphySearchEntry
-{
- GtkEntry parent;
-
- /*< private >*/
- EphySearchEntryPrivate *priv;
-};
-
-GType ephy_search_entry_get_type (void);
-
-GtkWidget *ephy_search_entry_new (void);
-
-void ephy_search_entry_clear (EphySearchEntry *entry);
-
-G_END_DECLS
-
-#endif /* __EPHY_SEARCH_ENTRY_H */