Hiroyuki Ikezoe
ikezo****@users*****
Tue Mar 20 12:44:21 JST 2007
Index: kazehakase/src/mozilla/kz-mozsingle.cpp diff -u kazehakase/src/mozilla/kz-mozsingle.cpp:1.1 kazehakase/src/mozilla/kz-mozsingle.cpp:removed --- kazehakase/src/mozilla/kz-mozsingle.cpp:1.1 Mon Mar 19 15:02:19 2007 +++ kazehakase/src/mozilla/kz-mozsingle.cpp Tue Mar 20 12:44:21 2007 @@ -1,186 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -// -// Copyright (C) 2007 Hiroyuki Ikezoe -// -// 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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif /* HAVE_CONFIG_H */ - -#include <glib/gi18n.h> -#include "kz-mozsingle.h" -#include "kz-app.h" -#include "mozilla.h" - -enum -{ - PROP_0, - PROP_KZ_APP -}; - -typedef struct _KzMozSinglePrivate KzMozSinglePrivate; -struct _KzMozSinglePrivate -{ - KzApp *kz_app; -}; - -#define KZ_MOZ_SINGLE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), KZ_TYPE_MOZ_SINGLE, KzMozSinglePrivate)) - -static GObject *constructor (GType type, - guint n_props, - GObjectConstructParam *props); -static void dispose (GObject *object); -static void set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); -static void get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); - -static KzMozSingle *the_kz_moz_single = NULL; - -G_DEFINE_TYPE(KzMozSingle, kz_moz_single, G_TYPE_OBJECT) - -static void -kz_moz_single_class_init (KzMozSingleClass *klass) -{ - GObjectClass *object_class; - - kz_moz_single_parent_class = g_type_class_peek_parent (klass); - object_class = (GObjectClass *) klass; - - object_class->constructor = constructor; - object_class->dispose = dispose; - object_class->set_property = set_property; - object_class->get_property = get_property; - - g_object_class_install_property( - object_class, - PROP_KZ_APP, - g_param_spec_object ("kz-app", - _("KzApp"), - _("The KzApp object"), - KZ_TYPE_APP, - (GParamFlags) (G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY))); - g_type_class_add_private(object_class, sizeof(KzMozSinglePrivate)); -} - -static GObject * -constructor (GType type, - guint n_props, - GObjectConstructParam *props) -{ - GObject *object; - - if (!the_kz_moz_single) - { - KzMozSinglePrivate *priv; - GObjectClass *klass = G_OBJECT_CLASS(kz_moz_single_parent_class); - object = klass->constructor(type, n_props, props); - - the_kz_moz_single = KZ_MOZ_SINGLE(object); - - priv = KZ_MOZ_SINGLE_GET_PRIVATE(object); - mozilla_init(kz_app_get_profile(priv->kz_app)); - } - else - { - object = G_OBJECT(g_object_ref(G_OBJECT(the_kz_moz_single))); - } - return object; -} - -static void -set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - KzMozSinglePrivate *priv = KZ_MOZ_SINGLE_GET_PRIVATE(object); - - switch (prop_id) - { - case PROP_KZ_APP: - priv->kz_app = KZ_APP(g_object_ref(g_value_get_object(value))); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); - break; - } -} - - -static void -get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - KzMozSinglePrivate *priv = KZ_MOZ_SINGLE_GET_PRIVATE(object); - - switch (prop_id) - { - case PROP_KZ_APP: - g_value_set_object(value, priv->kz_app); - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); - break; - } -} - - -static void -kz_moz_single_init (KzMozSingle *single) -{ - KzMozSinglePrivate *priv = KZ_MOZ_SINGLE_GET_PRIVATE(single); - - priv->kz_app = NULL; -} - - -static void -dispose (GObject *object) -{ - KzMozSinglePrivate *priv = KZ_MOZ_SINGLE_GET_PRIVATE(object); - - if (priv->kz_app) - { - mozilla_exit(); - g_object_unref(priv->kz_app); - } - - priv->kz_app = NULL; - - if (G_OBJECT_CLASS (kz_moz_single_parent_class)->dispose) - G_OBJECT_CLASS (kz_moz_single_parent_class)->dispose(object); -} - - -KzMozSingle * -kz_moz_single_new (KzApp *kz_app) -{ - KzMozSingle *single = KZ_MOZ_SINGLE(g_object_new(KZ_TYPE_MOZ_SINGLE, - "kz-app", kz_app, - NULL)); - - return single; -} - Index: kazehakase/src/mozilla/kz-mozsingle.h diff -u kazehakase/src/mozilla/kz-mozsingle.h:1.1 kazehakase/src/mozilla/kz-mozsingle.h:removed --- kazehakase/src/mozilla/kz-mozsingle.h:1.1 Mon Mar 19 15:02:19 2007 +++ kazehakase/src/mozilla/kz-mozsingle.h Tue Mar 20 12:44:21 2007 @@ -1,56 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* - * Copyright (C) 2007 Hiroyuki Ikezoe - * - * 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, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __KZ_MOZ_SINGLE_H__ -#define __KZ_MOZ_SINGLE_H__ - -#include <glib-object.h> -#include <gtkmozembed.h> -#include "kazehakase.h" - -G_BEGIN_DECLS - -#define KZ_TYPE_MOZ_SINGLE (kz_moz_single_get_type ()) -#define KZ_MOZ_SINGLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), KZ_TYPE_MOZ_SINGLE, KzMozSingle)) -#define KZ_MOZ_SINGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), KZ_TYPE_MOZ_SINGLE, KzMozSingleClass)) -#define KZ_IS_MOZ_SINGLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KZ_TYPE_MOZ_SINGLE)) -#define KZ_IS_MOZ_SINGLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), KZ_TYPE_MOZ_SINGLE)) -#define KZ_MOZ_SINGLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), KZ_TYPE_MOZ_SINGLE, KzMozSingleClass)) - -typedef struct _KzMozSingle KzMozSingle; -typedef struct _KzMozSingleClass KzMozSingleClass; - -struct _KzMozSingle -{ - GtkMozEmbedSingle parent; -}; - -struct _KzMozSingleClass -{ - GtkMozEmbedSingleClass parent_class; -}; - - -GType kz_moz_single_get_type (void); -KzMozSingle *kz_moz_single_new (KzApp *kz_app); - -G_END_DECLS - -#endif /* __KZ_MOZ_SINGLE_H__ */