aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/ui/gtk/util.c
diff options
context:
space:
mode:
authorNamhyung Kim <[email protected]>2012-05-29 13:22:59 +0900
committerArnaldo Carvalho de Melo <[email protected]>2012-06-19 13:06:18 -0300
commit42ab68a35ffee04700648ec42c9507145a66837d (patch)
treed447878f8831a472534cddac6cdd5f2e23d5be92 /tools/perf/ui/gtk/util.c
parentba47a142d9f9b84e0464a11b7a067e5ad95c5d4b (diff)
perf ui/gtk: Introduce struct perf_gtk_context
The struct perf_gtk_context is for tracking current state of GTK window and/or other things. This is a preparation of next changes. Signed-off-by: Namhyung Kim <[email protected]> Acked-by: Pekka Enberg <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/ui/gtk/util.c')
-rw-r--r--tools/perf/ui/gtk/util.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/perf/ui/gtk/util.c b/tools/perf/ui/gtk/util.c
index a727fe394e91..6fe13fdc513e 100644
--- a/tools/perf/ui/gtk/util.c
+++ b/tools/perf/ui/gtk/util.c
@@ -3,6 +3,29 @@
#include "gtk.h"
+struct perf_gtk_context *pgctx;
+
+struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window)
+{
+ struct perf_gtk_context *ctx;
+
+ ctx = malloc(sizeof(*pgctx));
+ if (ctx)
+ ctx->main_window = window;
+
+ return ctx;
+}
+
+int perf_gtk__deactivate_context(struct perf_gtk_context **ctx)
+{
+ if (!perf_gtk__is_active_context(*ctx))
+ return -1;
+
+ free(*ctx);
+ *ctx = NULL;
+ return 0;
+}
+
/*
* FIXME: Functions below should be implemented properly.
* For now, just add stubs for NO_NEWT=1 build.