~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/ui/gtk/browser.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0
  2 #include "gtk.h"
  3 #include "../evsel.h"
  4 #include "../sort.h"
  5 #include "../hist.h"
  6 #include "../helpline.h"
  7 
  8 #include <signal.h>
  9 
 10 void perf_gtk__signal(int sig)
 11 {
 12         perf_gtk__exit(false);
 13         psignal(sig, "perf");
 14 }
 15 
 16 void perf_gtk__resize_window(GtkWidget *window)
 17 {
 18         GdkRectangle rect;
 19         GdkScreen *screen;
 20         int monitor;
 21         int height;
 22         int width;
 23 
 24         screen = gtk_widget_get_screen(window);
 25 
 26         monitor = gdk_screen_get_monitor_at_window(screen, window->window);
 27 
 28         gdk_screen_get_monitor_geometry(screen, monitor, &rect);
 29 
 30         width   = rect.width * 3 / 4;
 31         height  = rect.height * 3 / 4;
 32 
 33         gtk_window_resize(GTK_WINDOW(window), width, height);
 34 }
 35 
 36 const char *perf_gtk__get_percent_color(double percent)
 37 {
 38         if (percent >= MIN_RED)
 39                 return "<span fgcolor='red'>";
 40         if (percent >= MIN_GREEN)
 41                 return "<span fgcolor='dark green'>";
 42         return NULL;
 43 }
 44 
 45 #ifdef HAVE_GTK_INFO_BAR_SUPPORT
 46 GtkWidget *perf_gtk__setup_info_bar(void)
 47 {
 48         GtkWidget *info_bar;
 49         GtkWidget *label;
 50         GtkWidget *content_area;
 51 
 52         info_bar = gtk_info_bar_new();
 53         gtk_widget_set_no_show_all(info_bar, TRUE);
 54 
 55         label = gtk_label_new("");
 56         gtk_widget_show(label);
 57 
 58         content_area = gtk_info_bar_get_content_area(GTK_INFO_BAR(info_bar));
 59         gtk_container_add(GTK_CONTAINER(content_area), label);
 60 
 61         gtk_info_bar_add_button(GTK_INFO_BAR(info_bar), GTK_STOCK_OK,
 62                                 GTK_RESPONSE_OK);
 63         g_signal_connect(info_bar, "response",
 64                          G_CALLBACK(gtk_widget_hide), NULL);
 65 
 66         pgctx->info_bar = info_bar;
 67         pgctx->message_label = label;
 68 
 69         return info_bar;
 70 }
 71 #endif
 72 
 73 GtkWidget *perf_gtk__setup_statusbar(void)
 74 {
 75         GtkWidget *stbar;
 76         unsigned ctxid;
 77 
 78         stbar = gtk_statusbar_new();
 79 
 80         ctxid = gtk_statusbar_get_context_id(GTK_STATUSBAR(stbar),
 81                                              "perf report");
 82         pgctx->statbar = stbar;
 83         pgctx->statbar_ctx_id = ctxid;
 84 
 85         return stbar;
 86 }
 87 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php