diff options
-rw-r--r-- | src/web-view.c | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/src/web-view.c b/src/web-view.c index 599a6f5..4e96acb 100644 --- a/src/web-view.c +++ b/src/web-view.c @@ -55,63 +55,6 @@ G_DEFINE_TYPE(MqWebView, mq_web_view, WEBKIT_TYPE_WEB_VIEW) WEBKIT_CONTEXT_MENU_ACTION_##ACTION static void -finalize(GObject *object) -{ - MqWebView *web_view; - - web_view = MQ_WEB_VIEW(object); - - if (web_view->uri) { - g_free(web_view->uri); - } -} - -static void -get_property(GObject *object, guint property_id, GValue *value, - GParamSpec *pspec) -{ - MqWebView *web_view; - - web_view = MQ_WEB_VIEW(object); - - switch (property_id) { - case PROP_TAB: - g_value_set_pointer(value, web_view->tab); - break; - case PROP_REWRITTEN_URI: - g_value_set_string(value, web_view->uri); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, - pspec); - break; - } -} - -static void -set_property(GObject *object, guint property_id, const GValue *value, - GParamSpec *pspec) -{ - MqWebView *web_view; - - web_view = MQ_WEB_VIEW(object); - - switch (property_id) { - case PROP_TAB: - web_view->tab = g_value_get_pointer(value); - break; - case PROP_REWRITTEN_URI: - mq_web_view_load_uri(web_view, - g_value_get_string(value)); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, - pspec); - break; - } -} - -static void menu_open_link_activate_cb(GtkAction G_GNUC_UNUSED *action, MqWebView *web_view) { webkit_web_view_load_uri(WEBKIT_WEB_VIEW(web_view), @@ -653,12 +596,69 @@ constructed(GObject *object) } static void +finalize(GObject *object) +{ + MqWebView *web_view; + + web_view = MQ_WEB_VIEW(object); + + if (web_view->uri) { + g_free(web_view->uri); + } +} + +static void +get_property(GObject *object, guint property_id, GValue *value, + GParamSpec *pspec) +{ + MqWebView *web_view; + + web_view = MQ_WEB_VIEW(object); + + switch (property_id) { + case PROP_TAB: + g_value_set_pointer(value, web_view->tab); + break; + case PROP_REWRITTEN_URI: + g_value_set_string(value, web_view->uri); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, + pspec); + break; + } +} + +static void +set_property(GObject *object, guint property_id, const GValue *value, + GParamSpec *pspec) +{ + MqWebView *web_view; + + web_view = MQ_WEB_VIEW(object); + + switch (property_id) { + case PROP_TAB: + web_view->tab = g_value_get_pointer(value); + break; + case PROP_REWRITTEN_URI: + mq_web_view_load_uri(web_view, + g_value_get_string(value)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, + pspec); + break; + } +} + +static void mq_web_view_class_init(MqWebViewClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS(klass); - object_class->finalize = finalize; object_class->constructed = constructed; + object_class->finalize = finalize; object_class->get_property = get_property; object_class->set_property = set_property; |