Scroom  0.14
measure-framerate-callbacks.hh File Reference
#include <vector>
#include <boost/function.hpp>
#include <gtk/gtk.h>
Include dependency graph for measure-framerate-callbacks.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

GtkWidget * create_window ()
 
void init ()
 
void invalidate ()
 

Variables

std::vector< boost::function< bool()> > functions
 

Function Documentation

◆ create_window()

GtkWidget* create_window ( )
80 {
81  GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
82  gtk_window_set_title(GTK_WINDOW(window), "Measure Framerate");
83  gtk_window_maximize(GTK_WINDOW(window));
84 
85  g_signal_connect(static_cast<gpointer>(window), "hide", G_CALLBACK(on_hide), NULL);
86 
87  drawingArea = gtk_drawing_area_new();
88  gtk_container_add(GTK_CONTAINER(window), drawingArea);
89  g_signal_connect(static_cast<gpointer>(drawingArea), "draw", G_CALLBACK(on_expose), NULL);
90  g_signal_connect(static_cast<gpointer>(drawingArea), "configure_event", G_CALLBACK(on_configure), NULL);
91 
92  gtk_widget_show(drawingArea);
93  gtk_widget_show(window);
94 
95  return window;
96 }

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void init ( )
98 { gdk_threads_add_idle(on_idle, nullptr); }

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ invalidate()

void invalidate ( )
101 {
102  GdkWindow* window = gtk_widget_get_window(drawingArea);
103  gdk_window_invalidate_rect(window, nullptr, false);
104 }

Referenced by Invalidator::operator()(), and InvalidatingCounter::operator()().

Here is the caller graph for this function:

Variable Documentation

◆ functions

drawingArea
static GtkWidget * drawingArea
Definition: measure-framerate-callbacks.cc:18
on_configure
static gboolean on_configure(GtkWidget *, GdkEventConfigure *, gpointer)
Definition: measure-framerate-callbacks.cc:23
on_expose
static gboolean on_expose(GtkWidget *widget, GdkEventExpose *, gpointer)
Definition: measure-framerate-callbacks.cc:40
on_hide
static void on_hide(GtkWidget *, gpointer)
Definition: measure-framerate-callbacks.cc:38
on_idle
static gboolean on_idle(gpointer)
Definition: measure-framerate-callbacks.cc:61