27dd5fdf |
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 |
15 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
16 | * MA 02111-1307, USA. |
17 | */ |
18 | |
19 | |
20 | #include "lttv_plugin_cfv.h" |
21 | #include <lttvwindow/lttvwindow.h> |
22 | #include "drawing.h" |
43ed82b5 |
23 | #include "eventhooks.h" |
27dd5fdf |
24 | |
25 | /* |
26 | * forward definitions |
27 | */ |
28 | |
29 | /* |
30 | * Implementation |
31 | */ |
32 | |
33 | static void cfv_update_filter(LttvPlugin *parent, LttvFilter *filter) |
34 | { |
35 | LttvPluginCFV *self = LTTV_PLUGIN_CFV(parent); |
36 | g_message("In CFV update filter."); |
37 | lttv_filter_destroy(self->cfd->filter); |
38 | self->cfd->filter = filter; |
39 | redraw_notify(self->cfd, NULL); |
40 | } |
41 | |
42 | |
43 | static void |
44 | lttv_plugin_cfv_class_init (LttvPluginCFVClass *klass) |
45 | { |
46 | LttvPluginClass *parent_klass; |
47 | parent_klass = &klass->parent; |
48 | parent_klass->update_filter = cfv_update_filter; |
49 | g_type_class_add_private (klass, sizeof (ControlFlowData)); |
50 | } |
51 | |
52 | |
53 | static void |
54 | lttv_plugin_cfv_init (GTypeInstance *instance, gpointer g_class) |
55 | { |
56 | LttvPluginCFV *self = LTTV_PLUGIN_CFV (instance); |
57 | self->cfd = G_TYPE_INSTANCE_GET_PRIVATE (self, |
58 | LTTV_TYPE_PLUGIN_CFV, ControlFlowData); |
59 | } |
60 | |
61 | |
62 | GType |
63 | lttv_plugin_cfv_get_type (void) |
64 | { |
65 | static GType type = 0; |
66 | if (type == 0) { |
67 | static const GTypeInfo info = { |
68 | sizeof (LttvPluginCFVClass), |
69 | NULL, /* base_init */ |
70 | NULL, /* base_finalize */ |
71 | lttv_plugin_cfv_class_init, /* class_init */ |
72 | NULL, /* class_finalize */ |
73 | NULL, /* class_data */ |
74 | sizeof (LttvPluginCFV), |
75 | 0, /* n_preallocs */ |
76 | lttv_plugin_cfv_init /* instance_init */ |
77 | }; |
78 | type = g_type_register_static (G_TYPE_OBJECT, |
79 | "LttvPluginCFVType", |
80 | &info, 0); |
81 | } |
82 | return type; |
83 | } |
84 | |
85 | |