aboutsummaryrefslogtreecommitdiffstats
path: root/filter/score-editor.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-editor.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-editor.c')
-rw-r--r--filter/score-editor.c112
1 files changed, 48 insertions, 64 deletions
diff --git a/filter/score-editor.c b/filter/score-editor.c
index ab24afd499..e5023260ba 100644
--- a/filter/score-editor.c
+++ b/filter/score-editor.c
@@ -1,5 +1,6 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * Copyright (C) 2001 Ximian Inc.
+ * Copyright (C) 2001-2002 Ximian Inc.
*
* Authors: Not Zed <notzed@lostzed.mmc.com.au>
* Jeffrey Stedfast <fejj@ximian.com>
@@ -19,94 +20,77 @@
* Boston, MA 02111-1307, USA.
*/
+
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
-#include <glib.h>
#include <gtk/gtkframe.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
-#include <glade/glade.h>
-#include <gal/widgets/e-unicode.h>
#include "score-editor.h"
-#include "score-context.h"
#include "score-rule.h"
#define d(x)
static FilterRule * create_rule(RuleEditor *re);
-static void score_editor_class_init (ScoreEditorClass *class);
-static void score_editor_init (ScoreEditor *gspaper);
-static void score_editor_finalise (GtkObject *obj);
-
-#define _PRIVATE(x) (((ScoreEditor *)(x))->priv)
-
-struct _ScoreEditorPrivate {
-};
+static void score_editor_class_init (ScoreEditorClass *klass);
+static void score_editor_init (ScoreEditor *se);
+static void score_editor_finalise (GObject *obj);
-static RuleEditorClass *parent_class;
-enum {
- LAST_SIGNAL
-};
+static RuleEditorClass *parent_class = NULL;
-static guint signals[LAST_SIGNAL] = { 0 };
-guint
+GtkType
score_editor_get_type (void)
{
- static guint type = 0;
+ static GtkType type = 0;
if (!type) {
- GtkTypeInfo type_info = {
+ static const GtkTypeInfo info = {
"ScoreEditor",
- sizeof(ScoreEditor),
- sizeof(ScoreEditorClass),
- (GtkClassInitFunc)score_editor_class_init,
- (GtkObjectInitFunc)score_editor_init,
- (GtkArgSetFunc)NULL,
- (GtkArgGetFunc)NULL
+ sizeof (ScoreEditor),
+ sizeof (ScoreEditorClass),
+ (GtkClassInitFunc) score_editor_class_init,
+ (GtkObjectInitFunc) score_editor_init,
+ /* reserved_1 */ NULL,
+ /* reserved_2 */ NULL,
+ (GtkClassInitFunc) NULL,
};
- type = gtk_type_unique (rule_editor_get_type (), &type_info);
+ type = gtk_type_unique (RULE_TYPE_EDITOR, &info);
}
return type;
}
static void
-score_editor_class_init (ScoreEditorClass *class)
+score_editor_class_init (ScoreEditorClass *klass)
{
- GtkObjectClass *object_class = (GtkObjectClass *)class;
- RuleEditorClass *re_class = (RuleEditorClass *)class;
-
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+ RuleEditorClass *re_class = (RuleEditorClass *) klass;
+
parent_class = gtk_type_class (rule_editor_get_type ());
- object_class->finalize = score_editor_finalise;
-
+ gobject_class->finalize = score_editor_finalise;
+
/* override methods */
re_class->create_rule = create_rule;
-
- /* signals */
-
- gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
}
static void
-score_editor_init (ScoreEditor *o)
+score_editor_init (ScoreEditor *se)
{
- o->priv = g_malloc0 (sizeof (*o->priv));
+ ;
}
static void
-score_editor_finalise(GtkObject *obj)
+score_editor_finalise (GObject *obj)
{
- ScoreEditor *o = (ScoreEditor *)obj;
-
- g_free(o->priv);
-
- ((GtkObjectClass *)(parent_class))->finalize(obj);
+ G_OBJECT_CLASS (parent_class)->finalize (obj);
}
/**
@@ -117,33 +101,33 @@ score_editor_finalise(GtkObject *obj)
* Return value: A new #ScoreEditor object.
**/
ScoreEditor *
-score_editor_new(ScoreContext *f)
+score_editor_new (ScoreContext *sc)
{
+ ScoreEditor *se = (ScoreEditor *) gtk_type_new (score_editor_get_type ());
GladeXML *gui;
- ScoreEditor *o = (ScoreEditor *)gtk_type_new (score_editor_get_type ());
GtkWidget *w;
-
- gui = glade_xml_new(FILTER_GLADEDIR "/filter.glade", "rule_editor");
- rule_editor_construct((RuleEditor *)o, (RuleContext *)f, gui, NULL);
-
- w = glade_xml_get_widget(gui, "rule_frame");
- gtk_frame_set_label((GtkFrame *)w, _("Score Rules"));
-
- gtk_object_unref((GtkObject *)gui);
- return o;
+ gui = glade_xml_new (FILTER_GLADEDIR "/filter.glade", "rule_editor");
+ rule_editor_construct ((RuleEditor *) se, (RuleContext *) sc, gui, NULL);
+
+ w = glade_xml_get_widget (gui, "rule_frame");
+ gtk_frame_set_label ((GtkFrame *) w, _("Score Rules"));
+
+ g_object_unref (gui);
+
+ return se;
}
static FilterRule *
-create_rule(RuleEditor *re)
+create_rule (RuleEditor *re)
{
- FilterRule *rule = filter_rule_new();
+ FilterRule *rule = filter_rule_new ();
FilterPart *part;
-
+
/* create a rule with 1 part in it */
- rule = (FilterRule *)score_rule_new ();
- part = rule_context_next_part(re->context, NULL);
- filter_rule_add_part(rule, filter_part_clone(part));
-
+ rule = (FilterRule *) score_rule_new ();
+ part = rule_context_next_part (re->context, NULL);
+ filter_rule_add_part (rule, filter_part_clone (part));
+
return rule;
}