[devhelp] Create DhWebView class skeleton



commit 7a340276301e804dd6f3a06860ad490e32ef1b53
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Feb 9 18:32:36 2018 +0100

    Create DhWebView class skeleton
    
    DhWindow will delegate some of its work to DhWebView.

 docs/reference/Makefile.am |    1 +
 po/POTFILES.in             |    1 +
 src/Makefile.am            |    2 +
 src/dh-web-view.c          |   52 ++++++++++++++++++++++++++++++++++++++++
 src/dh-web-view.h          |   56 ++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 112 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index f17ba5d..1a07ad1 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -55,6 +55,7 @@ IGNORE_HFILES = \
        dh-search-context.h \
        dh-settings.h \
        dh-util.h \
+       dh-web-view.h \
        dh-window.h
 
 # Images to copy into HTML directory.
diff --git a/po/POTFILES.in b/po/POTFILES.in
index a987008..73c12ea 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -20,6 +20,7 @@ src/dh-preferences.ui
 src/dh-search-context.c
 src/dh-sidebar.c
 src/dh-util.c
+src/dh-web-view.c
 src/dh-window.c
 src/dh-window.ui
 src/help-overlay.ui
diff --git a/src/Makefile.am b/src/Makefile.am
index 2873a8b..38cb976 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -69,6 +69,7 @@ libdevhelp_built_sources =                    \
 app_headers =                  \
        dh-app.h                \
        dh-assistant.h          \
+       dh-web-view.h           \
        dh-window.h             \
        $(NULL)
 
@@ -76,6 +77,7 @@ app_c_files =                 \
        dh-app.c                \
        dh-assistant.c          \
        dh-main.c               \
+       dh-web-view.c           \
        dh-window.c             \
        $(NULL)
 
diff --git a/src/dh-web-view.c b/src/dh-web-view.c
new file mode 100644
index 0000000..270e1f9
--- /dev/null
+++ b/src/dh-web-view.c
@@ -0,0 +1,52 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2018 Sébastien Wilmet <swilmet gnome 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "dh-web-view.h"
+
+struct _DhWebViewPrivate {
+        gint something;
+};
+
+G_DEFINE_TYPE_WITH_PRIVATE (DhWebView, dh_web_view, WEBKIT_TYPE_WEB_VIEW)
+
+static void
+dh_web_view_finalize (GObject *object)
+{
+
+        G_OBJECT_CLASS (dh_web_view_parent_class)->finalize (object);
+}
+
+static void
+dh_web_view_class_init (DhWebViewClass *klass)
+{
+        GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+        object_class->finalize = dh_web_view_finalize;
+}
+
+static void
+dh_web_view_init (DhWebView *view)
+{
+        view->priv = dh_web_view_get_instance_private (view);
+}
+
+DhWebView *
+dh_web_view_new (void)
+{
+        return g_object_new (DH_TYPE_WEB_VIEW, NULL);
+}
diff --git a/src/dh-web-view.h b/src/dh-web-view.h
new file mode 100644
index 0000000..250e3e7
--- /dev/null
+++ b/src/dh-web-view.h
@@ -0,0 +1,56 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2018 Sébastien Wilmet <swilmet gnome 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DH_WEB_VIEW_H
+#define DH_WEB_VIEW_H
+
+#include <webkit2/webkit2.h>
+
+G_BEGIN_DECLS
+
+#define DH_TYPE_WEB_VIEW             (dh_web_view_get_type ())
+#define DH_WEB_VIEW(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), DH_TYPE_WEB_VIEW, DhWebView))
+#define DH_WEB_VIEW_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), DH_TYPE_WEB_VIEW, DhWebViewClass))
+#define DH_IS_WEB_VIEW(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DH_TYPE_WEB_VIEW))
+#define DH_IS_WEB_VIEW_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), DH_TYPE_WEB_VIEW))
+#define DH_WEB_VIEW_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), DH_TYPE_WEB_VIEW, DhWebViewClass))
+
+typedef struct _DhWebView         DhWebView;
+typedef struct _DhWebViewClass    DhWebViewClass;
+typedef struct _DhWebViewPrivate  DhWebViewPrivate;
+
+struct _DhWebView {
+        WebKitWebView parent;
+
+        DhWebViewPrivate *priv;
+};
+
+struct _DhWebViewClass {
+        WebKitWebViewClass parent_class;
+
+       /* Padding for future expansion */
+        gpointer padding[12];
+};
+
+GType           dh_web_view_get_type            (void);
+
+DhWebView *     dh_web_view_new                 (void);
+
+G_END_DECLS
+
+#endif /* DH_WEB_VIEW_H */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]