gtk2/perf/gtkwidgetprofiler.h
Federico Mena Quintero b4f52020f0 Update for the new API of the profiler.
2005-07-28  Federico Mena Quintero  <federico@ximian.com>

	* perf/README: Update for the new API of the profiler.

	* perf/gtkwidgetprofiler.[ch]: New files with a widget profiler
	object.  This is the old content of timers.[ch] turned into a nice
	object, with signals for creation and reporting.  The profiler
	needs to maintain some state when reusing the widget, so it's
	useful to turn it into a real object.

	Break down timing show_all into GTK_WIDGET_PROFILER_REPORT_MAP and
	GTK_WIDGET_PROFILER_REPORT_EXPOSE.

	* perf/main.c: Refactor to use GtkWidgetProfiler.

	* perf/appwindow.c (content_area_new): Make this just create a
	notebook, instead of a complex arrangement of panes.

	* perf/widgets.h: New header file for all the "create a widget"
	utility functions.

	* perf/treeview.c: New file.  Moved the tree view part from
	appwindow.c over to here; GtkTreeView really needs its own tests.
	(tree_view_new): Set the shadow type to IN.

	* perf/textview.c: Likewise moved over from appwindow.c, but for
	GtkTextView.
	(text_view_new): Set the shadow type to IN.

	* perf/Makefile.am (testperf_SOURCES): Add the new source files;
	remove appwindow.h and timers.[ch].

	* perf/timers.[ch]: Removed.

	* perf/appwindow.h: Removed.
2005-07-29 00:38:51 +00:00

59 lines
1.8 KiB
C

#include <gtk/gtk.h>
#ifndef GTK_WIDGET_PROFILER_H
#define GTK_WIDGET_PROFILER_H
G_BEGIN_DECLS
#define GTK_TYPE_WIDGET_PROFILER (gtk_widget_profiler_get_type ())
#define GTK_WIDGET_PROFILER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_WIDGET_PROFILER, GtkWidgetProfiler))
#define GTK_WIDGET_PROFILER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_WIDGET_PROFILER, GtkWidgetProfilerClass))
#define GTK_IS_WIDGET_PROFILER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_WIDGET_PROFILER))
#define GTK_IS_WIDGET_PROFILER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WIDGET_PROFILER))
#define GTK_WIDGET_PROFILER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_WIDGET_PROFILER, GtkWidgetProfilerClass))
typedef enum
{
GTK_WIDGET_PROFILER_REPORT_CREATE,
GTK_WIDGET_PROFILER_REPORT_MAP,
GTK_WIDGET_PROFILER_REPORT_EXPOSE,
GTK_WIDGET_PROFILER_REPORT_DESTROY
} GtkWidgetProfilerReport;
typedef struct _GtkWidgetProfiler GtkWidgetProfiler;
typedef struct _GtkWidgetProfilerClass GtkWidgetProfilerClass;
typedef struct _GtkWidgetProfilerPrivate GtkWidgetProfilerPrivate;
struct _GtkWidgetProfiler {
GObject object;
GtkWidgetProfilerPrivate *priv;
};
struct _GtkWidgetProfilerClass {
GObjectClass parent_class;
/* signals */
GtkWidget *(* create_widget) (GtkWidgetProfiler *profiler);
void (* report) (GtkWidgetProfiler *profiler,
GtkWidgetProfilerReport report,
GtkWidget *widget,
gdouble elapsed);
};
GType gtk_widget_profiler_get_type (void) G_GNUC_CONST;
GtkWidgetProfiler *gtk_widget_profiler_new ();
void gtk_widget_profiler_set_num_iterations (GtkWidgetProfiler *profiler,
gint n_iterations);
void gtk_widget_profiler_profile_boot (GtkWidgetProfiler *profiler);
G_END_DECLS
#endif