[gitg] Use G_DEFINE_INTERFACE
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Use G_DEFINE_INTERFACE
- Date: Wed, 29 Dec 2010 14:51:36 +0000 (UTC)
commit 2a322097eae7208ecff82f2d4bb80f52d57eaf43
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Wed Dec 29 15:51:19 2010 +0100
Use G_DEFINE_INTERFACE
gitg/gitg-activatable.c | 57 ++++++++++++++++++++--------------------------
gitg/gitg-activatable.h | 22 ++++++++++++++++++
2 files changed, 47 insertions(+), 32 deletions(-)
---
diff --git a/gitg/gitg-activatable.c b/gitg/gitg-activatable.c
index 690deb3..07fb267 100644
--- a/gitg/gitg-activatable.c
+++ b/gitg/gitg-activatable.c
@@ -1,35 +1,28 @@
-#include "gitg-activatable.h"
-
-static void gitg_activatable_default_init (GitgActivatableInterface *iface);
+/*
+ * gitg-activatable.c
+ * This file is part of gitg - git repository viewer
+ *
+ * Copyright (C) 2009 - Jesse van den Kieboom
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
-GType
-gitg_activatable_get_type ()
-{
- static GType gitg_activatable_type_id = 0;
-
- if (!gitg_activatable_type_id)
- {
- static const GTypeInfo g_define_type_info =
- {
- sizeof (GitgActivatableInterface),
- (GBaseInitFunc) gitg_activatable_default_init,
- NULL,
- NULL,
- NULL,
- NULL,
- 0,
- 0,
- NULL
- };
-
- gitg_activatable_type_id = g_type_register_static (G_TYPE_INTERFACE,
- "GitgActivatable",
- &g_define_type_info,
- 0);
- }
+#include "gitg-activatable.h"
- return gitg_activatable_type_id;
-}
+G_DEFINE_INTERFACE(GitgActivatable, gitg_activatable, G_TYPE_OBJECT)
/* Default implementation */
static gchar *
@@ -40,7 +33,7 @@ gitg_activatable_get_id_default (GitgActivatable *panel)
static gboolean
gitg_activatable_activate_default (GitgActivatable *panel,
- gchar const *cmd)
+ gchar const *cmd)
{
return FALSE;
}
@@ -69,7 +62,7 @@ gitg_activatable_get_id (GitgActivatable *panel)
gboolean
gitg_activatable_activate (GitgActivatable *panel,
- gchar const *action)
+ gchar const *action)
{
g_return_val_if_fail (GITG_IS_ACTIVATABLE (panel), FALSE);
diff --git a/gitg/gitg-activatable.h b/gitg/gitg-activatable.h
index d5cd62a..e83189b 100644
--- a/gitg/gitg-activatable.h
+++ b/gitg/gitg-activatable.h
@@ -1,3 +1,25 @@
+/*
+ * gitg-activatable.h
+ * This file is part of gitg - git repository viewer
+ *
+ * Copyright (C) 2009 - Jesse van den Kieboom
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
#ifndef __GITG_ACTIVATABLE_H__
#define __GITG_ACTIVATABLE_H__
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]