/* Main.c generated by valac 0.56.19, the Vala compiler
 * generated from Main.vala, do not modify */

/*-
 * Copyright (c) 2017 elementary LLC. (https://elementary.io)
 *
 * 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 3 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/>.
 *
 * Authored by: David Hewitt <davidmhewitt@gmail.com>
 */

#include <webkit2/webkit-web-extension.h>
#include <glib.h>
#include "io.elementary.mail-webkit-extension.h"
#include <glib-object.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

VALA_EXTERN void webkit_web_extension_on_page_created (WebKitWebPage* page);
static void _webkit_web_extension_on_page_created_webkit_web_extension_page_created (WebKitWebExtension* _sender,
                                                                              WebKitWebPage* web_page,
                                                                              gpointer self);

void
webkit_web_extension_on_page_created (WebKitWebPage* page)
{
	MailPage* mail_page = NULL;
	MailPage* _tmp0_;
	MailPage* _tmp1_;
	g_return_if_fail (page != NULL);
	_tmp0_ = mail_page_new (page);
	mail_page = _tmp0_;
	_tmp1_ = mail_page;
	mail_page = NULL;
	g_object_set_data_full ((GObject*) page, "elementary-mail-page", _tmp1_, g_object_unref);
	_g_object_unref0 (mail_page);
}

static void
_webkit_web_extension_on_page_created_webkit_web_extension_page_created (WebKitWebExtension* _sender,
                                                                         WebKitWebPage* web_page,
                                                                         gpointer self)
{
	webkit_web_extension_on_page_created (web_page);
}

void
G_MODULE_EXPORT webkit_web_extension_initialize (WebKitWebExtension* extension)
{
	g_return_if_fail (extension != NULL);
	g_signal_connect (extension, "page-created", (GCallback) _webkit_web_extension_on_page_created_webkit_web_extension_page_created, NULL);
}

