Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323699
b: refs/heads/master
c: 4bb1646
h: refs/heads/master
i:
  323697: 2ef85eb
  323695: d6ae785
v: v3
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Aug 17, 2012
1 parent e65b912 commit 83a3282
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e6e9046879493d8bf8f44ac1f2718c4a5628aa52
refs/heads/master: 4bb1646a80db65bb45c0a1bffb2435c6690c392e
1 change: 1 addition & 0 deletions trunk/tools/perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ else
LIB_OBJS += $(OUTPUT)ui/gtk/browser.o
LIB_OBJS += $(OUTPUT)ui/gtk/setup.o
LIB_OBJS += $(OUTPUT)ui/gtk/util.o
LIB_OBJS += $(OUTPUT)ui/gtk/helpline.o
# Make sure that it'd be included only once.
ifneq ($(findstring -DNO_NEWT_SUPPORT,$(BASIC_CFLAGS)),)
LIB_OBJS += $(OUTPUT)ui/setup.o
Expand Down
2 changes: 2 additions & 0 deletions trunk/tools/perf/ui/gtk/gtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ static inline bool perf_gtk__is_active_context(struct perf_gtk_context *ctx)
struct perf_gtk_context *perf_gtk__activate_context(GtkWidget *window);
int perf_gtk__deactivate_context(struct perf_gtk_context **ctx);

void perf_gtk__init_helpline(void);

#ifndef HAVE_GTK_INFO_BAR
static inline GtkWidget *perf_gtk__setup_info_bar(void)
{
Expand Down
30 changes: 30 additions & 0 deletions trunk/tools/perf/ui/gtk/helpline.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include "gtk.h"
#include "../helpline.h"

static void gtk_helpline_pop(void)
{
if (!perf_gtk__is_active_context(pgctx))
return;

gtk_statusbar_pop(GTK_STATUSBAR(pgctx->statbar),
pgctx->statbar_ctx_id);
}

static void gtk_helpline_push(const char *msg)
{
if (!perf_gtk__is_active_context(pgctx))
return;

gtk_statusbar_push(GTK_STATUSBAR(pgctx->statbar),
pgctx->statbar_ctx_id, msg);
}

static struct ui_helpline gtk_helpline_fns = {
.pop = gtk_helpline_pop,
.push = gtk_helpline_push,
};

void perf_gtk__init_helpline(void)
{
helpline_fns = &gtk_helpline_fns;
}
1 change: 1 addition & 0 deletions trunk/tools/perf/ui/gtk/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ extern struct perf_error_ops perf_gtk_eops;
int perf_gtk__init(void)
{
perf_error__register(&perf_gtk_eops);
perf_gtk__init_helpline();
return gtk_init_check(NULL, NULL) ? 0 : -1;
}

Expand Down

0 comments on commit 83a3282

Please sign in to comment.