diff options
author | Xan Lopez <xan@igalia.com> | 2012-10-03 04:00:09 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-10-03 05:21:15 +0800 |
commit | 9c54a252230ceaf38a3accd5504b3e4bd5959c48 (patch) | |
tree | 6a8c33d4e4e322c2352f71974bf488359c6fc7f7 /embed/ephy-adblock.h | |
parent | 7b72dcabf03b0d989da6cb42f4b5adccba54aa33 (diff) | |
download | gsoc2013-epiphany-9c54a252230ceaf38a3accd5504b3e4bd5959c48.tar gsoc2013-epiphany-9c54a252230ceaf38a3accd5504b3e4bd5959c48.tar.gz gsoc2013-epiphany-9c54a252230ceaf38a3accd5504b3e4bd5959c48.tar.bz2 gsoc2013-epiphany-9c54a252230ceaf38a3accd5504b3e4bd5959c48.tar.lz gsoc2013-epiphany-9c54a252230ceaf38a3accd5504b3e4bd5959c48.tar.xz gsoc2013-epiphany-9c54a252230ceaf38a3accd5504b3e4bd5959c48.tar.zst gsoc2013-epiphany-9c54a252230ceaf38a3accd5504b3e4bd5959c48.zip |
adblock: get rid of AdBlock interface
No need for this now, just make EphyAdBlock a concrete class
implementing the adblock functionality.
https://bugzilla.gnome.org/show_bug.cgi?id=681657
Diffstat (limited to 'embed/ephy-adblock.h')
-rw-r--r-- | embed/ephy-adblock.h | 109 |
1 files changed, 54 insertions, 55 deletions
diff --git a/embed/ephy-adblock.h b/embed/ephy-adblock.h index 6e386d6e7..efdd5d06f 100644 --- a/embed/ephy-adblock.h +++ b/embed/ephy-adblock.h @@ -1,7 +1,6 @@ +/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* - * Copyright © 2003 Marco Pesenti Gritti - * Copyright © 2003 Christian Persch - * Copyright © 2005 Jean-François Rameau + * Copyright © 2011, 2012 Igalia S.L. * * 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 @@ -15,78 +14,78 @@ * * 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. - * + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if !defined (__EPHY_EPIPHANY_H_INSIDE__) && !defined (EPIPHANY_COMPILATION) -#error "Only <epiphany/epiphany.h> can be included directly." -#endif - #ifndef EPHY_ADBLOCK_H #define EPHY_ADBLOCK_H #include "ephy-embed.h" + #include <glib-object.h> +#include <glib.h> G_BEGIN_DECLS -#define EPHY_TYPE_ADBLOCK (ephy_adblock_get_type ()) -#define EPHY_ADBLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_ADBLOCK, EphyAdBlock)) -#define EPHY_ADBLOCK_IFACE(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EPHY_TYPE_ADBLOCK, EphyAdBlockIface)) -#define EPHY_IS_ADBLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPHY_TYPE_ADBLOCK)) -#define EPHY_IS_ADBLOCK_IFACE(class) (G_TYPE_CHECK_CLASS_TYPE ((class), EPHY_TYPE_ADBLOCK)) -#define EPHY_ADBLOCK_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EPHY_TYPE_ADBLOCK, EphyAdBlockIface)) +#define EPHY_TYPE_ADBLOCK (ephy_adblock_get_type ()) +#define EPHY_ADBLOCK(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EPHY_TYPE_ADBLOCK, EphyAdBlock)) +#define EPHY_ADBLOCK_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EPHY_TYPE_ADBLOCK, EphyAdBlockClass)) +#define EPHY_IS_ADBLOCK(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EPHY_TYPE_ADBLOCK)) +#define EPHY_IS_ADBLOCK_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EPHY_TYPE_ADBLOCK)) +#define EPHY_ADBLOCK_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EPHY_TYPE_ADBLOCK, EphyAdBlockClass)) typedef enum { - AD_URI_CHECK_TYPE_OTHER = 1U, - AD_URI_CHECK_TYPE_SCRIPT = 2U, /* Indicates an executable script - (such as JavaScript) */ - AD_URI_CHECK_TYPE_IMAGE = 3U, /* Indicates an image (e.g., IMG - elements) */ - AD_URI_CHECK_TYPE_STYLESHEET = 4U, /* Indicates a stylesheet (e.g., - STYLE elements) */ - AD_URI_CHECK_TYPE_OBJECT = 5U, /* Indicates a generic object - (plugin-handled content - typically falls under this - category) */ - AD_URI_CHECK_TYPE_DOCUMENT = 6U, /* Indicates a document at the - top-level (i.e., in a - browser) */ - AD_URI_CHECK_TYPE_SUBDOCUMENT = 7U, /* Indicates a document contained - within another document (e.g., - IFRAMEs, FRAMES, and OBJECTs) */ - AD_URI_CHECK_TYPE_REFRESH = 8U, /* Indicates a timed refresh */ - - AD_URI_CHECK_TYPE_XBEL = 9U, /* Indicates an XBL binding request, - triggered either by -moz-binding CSS - property or Document.addBinding method */ - AD_URI_CHECK_TYPE_PING = 10U, /* Indicates a ping triggered by a click on - <A PING="..."> element */ - AD_URI_CHECK_TYPE_XMLHTTPREQUEST = 11U, /* Indicates a XMLHttpRequest */ - AD_URI_CHECK_TYPE_OBJECT_SUBREQUEST = 12U /* Indicates a request by a plugin */ + AD_URI_CHECK_TYPE_OTHER = 1U, + AD_URI_CHECK_TYPE_SCRIPT = 2U, /* Indicates an executable script + (such as JavaScript) */ + AD_URI_CHECK_TYPE_IMAGE = 3U, /* Indicates an image (e.g., IMG + elements) */ + AD_URI_CHECK_TYPE_STYLESHEET = 4U, /* Indicates a stylesheet (e.g., + STYLE elements) */ + AD_URI_CHECK_TYPE_OBJECT = 5U, /* Indicates a generic object + (plugin-handled content + typically falls under this + category) */ + AD_URI_CHECK_TYPE_DOCUMENT = 6U, /* Indicates a document at the + top-level (i.e., in a + browser) */ + AD_URI_CHECK_TYPE_SUBDOCUMENT = 7U, /* Indicates a document contained + within another document (e.g., + IFRAMEs, FRAMES, and OBJECTs) */ + AD_URI_CHECK_TYPE_REFRESH = 8U, /* Indicates a timed refresh */ + AD_URI_CHECK_TYPE_XBEL = 9U, /* Indicates an XBL binding request, + triggered either by -moz-binding CSS + property or Document.addBinding method */ + AD_URI_CHECK_TYPE_PING = 10U, /* Indicates a ping triggered by a click on + <A PING="..."> element */ + AD_URI_CHECK_TYPE_XMLHTTPREQUEST = 11U, /* Indicates a XMLHttpRequest */ + AD_URI_CHECK_TYPE_OBJECT_SUBREQUEST = 12U /* Indicates a request by a plugin */ } AdUriCheckType; -typedef struct _EphyAdBlock EphyAdBlock; -typedef struct _EphyAdBlockIface EphyAdBlockIface; - -struct _EphyAdBlockIface +typedef struct EphyAdBlock EphyAdBlock; +typedef struct EphyAdBlockClass EphyAdBlockClass; +typedef struct EphyAdBlockPrivate EphyAdBlockPrivate; + +struct EphyAdBlockClass +{ + GObjectClass parent_class; +}; + +struct EphyAdBlock { - GTypeInterface base_iface; + GObject parent_instance; - gboolean (* should_load) (EphyAdBlock *adblock, - EphyEmbed *embed, - const char *url, - AdUriCheckType check_type); + /*< private >*/ + EphyAdBlockPrivate *priv; }; -GType ephy_adblock_get_type (void); +GType ephy_adblock_get_type (void); -gboolean ephy_adblock_should_load (EphyAdBlock *adblock, - EphyEmbed *embed, - const char *url, - AdUriCheckType check_type); +gboolean ephy_adblock_should_load (EphyAdBlock *adblock, + EphyEmbed *embed, + const char *url, + AdUriCheckType type); G_END_DECLS |