Commit | Line | Data |
---|---|---|
b139ad2a | 1 | /* This file is part of the Linux Trace Toolkit viewer |
2 | * Copyright (C) 2006 Mathieu Desnoyers | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License Version 2 as | |
6 | * published by the Free Software Foundation; | |
7 | * | |
8 | * This program is distributed in the hope that it will be useful, | |
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | * GNU General Public License for more details. | |
12 | * | |
13 | * You should have received a copy of the GNU General Public License | |
14 | * along with this program; if not, write to the Free Software | |
b9ce0bad YB |
15 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
16 | * MA 02110-1301, USA. | |
b139ad2a | 17 | */ |
18 | ||
19 | ||
20 | #include "lttv_plugin_evd.h" | |
21 | #include <lttvwindow/lttvwindow.h> | |
22 | #include "events.h" | |
23 | ||
24 | /* | |
25 | * forward definitions | |
26 | */ | |
27 | ||
28 | /* | |
29 | * Implementation | |
30 | */ | |
9a366873 | 31 | #ifdef BABEL_CLEANUP |
b139ad2a | 32 | static void evd_update_filter(LttvPlugin *parent, LttvFilter *filter) |
33 | { | |
34 | LttvPluginEVD *self = LTTV_PLUGIN_EVD(parent); | |
35 | g_message("In EVD update filter."); | |
36 | lttv_filter_destroy(self->evd->filter); | |
37 | self->evd->filter = filter; | |
38 | evd_redraw_notify(self->evd, NULL); | |
39 | } | |
9a366873 | 40 | #endif //babel cleanup |
b139ad2a | 41 | |
42 | static void | |
43 | lttv_plugin_evd_class_init (LttvPluginEVDClass *klass) | |
44 | { | |
26ea84eb | 45 | #ifdef BABEL_CLEANUP |
b139ad2a | 46 | LttvPluginClass *parent_klass; |
47 | parent_klass = &klass->parent; | |
26ea84eb | 48 | |
b139ad2a | 49 | parent_klass->update_filter = evd_update_filter; |
9a366873 | 50 | #endif //babel cleanup |
b139ad2a | 51 | g_type_class_add_private (klass, sizeof (EventViewerData)); |
52 | } | |
53 | ||
54 | ||
55 | static void | |
56 | lttv_plugin_evd_init (GTypeInstance *instance, gpointer g_class) | |
57 | { | |
58 | LttvPluginEVD *self = LTTV_PLUGIN_EVD (instance); | |
59 | self->evd = G_TYPE_INSTANCE_GET_PRIVATE (self, | |
60 | LTTV_TYPE_PLUGIN_EVD, EventViewerData); | |
61 | } | |
62 | ||
63 | ||
64 | GType | |
65 | lttv_plugin_evd_get_type (void) | |
66 | { | |
67 | static GType type = 0; | |
68 | if (type == 0) { | |
69 | static const GTypeInfo info = { | |
70 | sizeof (LttvPluginEVDClass), | |
71 | NULL, /* base_init */ | |
72 | NULL, /* base_finalize */ | |
8d8c5ea7 | 73 | (GClassInitFunc) lttv_plugin_evd_class_init, /* class_init */ |
b139ad2a | 74 | NULL, /* class_finalize */ |
75 | NULL, /* class_data */ | |
76 | sizeof (LttvPluginEVD), | |
77 | 0, /* n_preallocs */ | |
78 | lttv_plugin_evd_init /* instance_init */ | |
79 | }; | |
80 | type = g_type_register_static (G_TYPE_OBJECT, | |
81 | "LttvPluginEVDType", | |
82 | &info, 0); | |
83 | } | |
84 | return type; | |
85 | } | |
86 | ||
87 |