aboutsummaryrefslogtreecommitdiffstats
path: root/filter/score-context.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-11-06 04:47:24 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-11-06 04:47:24 +0800
commit96669b4af8ecc871dbfd405271293f29f38a05f3 (patch)
treebfe7084583e6d965a5ebd65c8199e24ad7ba1390 /filter/score-context.c
parent12db8c46874e98b39ad026972527e422e4c228eb (diff)
downloadgsoc2013-evolution-96669b4af8ecc871dbfd405271293f29f38a05f3.tar
gsoc2013-evolution-96669b4af8ecc871dbfd405271293f29f38a05f3.tar.gz
gsoc2013-evolution-96669b4af8ecc871dbfd405271293f29f38a05f3.tar.bz2
gsoc2013-evolution-96669b4af8ecc871dbfd405271293f29f38a05f3.tar.lz
gsoc2013-evolution-96669b4af8ecc871dbfd405271293f29f38a05f3.tar.xz
gsoc2013-evolution-96669b4af8ecc871dbfd405271293f29f38a05f3.tar.zst
gsoc2013-evolution-96669b4af8ecc871dbfd405271293f29f38a05f3.zip
Ported.
2002-11-05 Jeffrey Stedfast <fejj@ximian.com> * score-rule.c: Ported. * score-editor.c: Ported. Again, thise code seems to be unused. * score-context.c: Ported. Although it seems this code isn't really used anywhere? svn path=/trunk/; revision=18562
Diffstat (limited to 'filter/score-context.c')
-rw-r--r--filter/score-context.c75
1 files changed, 36 insertions, 39 deletions
diff --git a/filter/score-context.c b/filter/score-context.c
index 4c892bc8d3..dd3663ffab 100644
--- a/filter/score-context.c
+++ b/filter/score-context.c
@@ -1,7 +1,9 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * Copyright (C) 2000 Ximian Inc.
+ * Copyright (C) 2000-2002 Ximian Inc.
*
* Authors: Not Zed <notzed@lostzed.mmc.com.au>
+ * Jeffrey Stedfast <fejj@ximian.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -18,75 +20,71 @@
* Boston, MA 02111-1307, USA.
*/
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#include <gtk/gtkobject.h>
-
#include "score-context.h"
#include "score-rule.h"
-static void score_context_class_init (ScoreContextClass *class);
-static void score_context_init (ScoreContext *gspaper);
-static void score_context_finalise (GtkObject *obj);
+static void score_context_class_init (ScoreContextClass *klass);
+static void score_context_init (ScoreContext *sc);
+static void score_context_finalise (GObject *obj);
+
-static RuleContextClass *parent_class;
+static RuleContextClass *parent_class = NULL;
-guint
+
+GType
score_context_get_type (void)
{
- static guint type = 0;
+ static GType type = 0;
if (!type) {
- GtkTypeInfo type_info = {
- "ScoreContext",
- sizeof(ScoreContext),
- sizeof(ScoreContextClass),
- (GtkClassInitFunc)score_context_class_init,
- (GtkObjectInitFunc)score_context_init,
- (GtkArgSetFunc)NULL,
- (GtkArgGetFunc)NULL
+ static const GTypeInfo info = {
+ sizeof (ScoreContextClass),
+ NULL, /* base_class_init */
+ NULL, /* base_class_finalize */
+ (GClassInitFunc) score_context_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (ScoreContext),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) score_context_init,
};
- type = gtk_type_unique(rule_context_get_type (), &type_info);
+ type = g_type_register_static (RULE_TYPE_CONTEXT, "ScoreContext", &info, 0);
}
return type;
}
static void
-score_context_class_init (ScoreContextClass *class)
+score_context_class_init (ScoreContextClass *klass)
{
- GtkObjectClass *object_class;
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_ref (rule_context_get_type ());
- object_class = (GtkObjectClass *)class;
- parent_class = gtk_type_class(rule_context_get_type ());
-
object_class->finalize = score_context_finalise;
- /* override methods */
-
}
static void
-score_context_init (ScoreContext *o)
+score_context_init (ScoreContext *sc)
{
- rule_context_add_part_set((RuleContext *)o, "partset", filter_part_get_type(),
- rule_context_add_part, rule_context_next_part);
+ rule_context_add_part_set ((RuleContext *) sc, "partset", filter_part_get_type (),
+ rule_context_add_part, rule_context_next_part);
- rule_context_add_rule_set((RuleContext *)o, "ruleset", score_rule_get_type(),
- rule_context_add_rule, rule_context_next_rule);
+ rule_context_add_rule_set ((RuleContext *) sc, "ruleset", score_rule_get_type (),
+ rule_context_add_rule, rule_context_next_rule);
}
static void
-score_context_finalise(GtkObject *obj)
+score_context_finalise (GObject *obj)
{
- ScoreContext *o = (ScoreContext *)obj;
-
- o = o;
-
- ((GtkObjectClass *)(parent_class))->finalize(obj);
+ G_OBJECT_CLASS (parent_class)->finalize (obj);
}
/**
@@ -97,8 +95,7 @@ score_context_finalise(GtkObject *obj)
* Return value: A new #ScoreContext object.
**/
ScoreContext *
-score_context_new(void)
+score_context_new (void)
{
- ScoreContext *o = (ScoreContext *)gtk_type_new(score_context_get_type ());
- return o;
+ return (ScoreContext *) g_object_new (SCORE_TYPE_CONTEXT, NULL, NULL);
}