]> Pileus Git - ~andy/gtk/blob - gtk/gtktestutils.h
stylecontext: Do invalidation on first resize container
[~andy/gtk] / gtk / gtktestutils.h
1 /* Gtk+ testing utilities
2  * Copyright (C) 2007 Imendio AB
3  * Authors: Tim Janik
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17  */
18
19 #ifndef __GTK_TEST_UTILS_H__
20 #define __GTK_TEST_UTILS_H__
21
22 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
23 #error "Only <gtk/gtk.h> can be included directly."
24 #endif
25
26 #include <gtk/gtkwidget.h>
27 #include <gtk/gtkspinbutton.h>
28
29 G_BEGIN_DECLS
30
31 /* --- Gtk+ Test Utility API --- */
32 void            gtk_test_init                   (int            *argcp,
33                                                  char         ***argvp,
34                                                  ...);
35 void            gtk_test_register_all_types     (void);
36 const GType*    gtk_test_list_all_types         (guint          *n_types);
37 GtkWidget*      gtk_test_find_widget            (GtkWidget      *widget,
38                                                  const gchar    *label_pattern,
39                                                  GType           widget_type);
40 GtkWidget*      gtk_test_create_widget          (GType           widget_type,
41                                                  const gchar    *first_property_name,
42                                                  ...);
43 GtkWidget*      gtk_test_create_simple_window   (const gchar    *window_title,
44                                                  const gchar    *dialog_text);
45 GtkWidget*      gtk_test_display_button_window  (const gchar    *window_title,
46                                                  const gchar    *dialog_text,
47                                                  ...); /* NULL terminated list of (label, &int) pairs */
48 void            gtk_test_slider_set_perc        (GtkWidget      *widget, /* GtkRange-alike */
49                                                  double          percentage);
50 double          gtk_test_slider_get_value       (GtkWidget      *widget);
51 gboolean        gtk_test_spin_button_click      (GtkSpinButton  *spinner,
52                                                  guint           button,
53                                                  gboolean        upwards);
54 gboolean        gtk_test_widget_click           (GtkWidget      *widget,
55                                                  guint           button,
56                                                  GdkModifierType modifiers);
57 gboolean        gtk_test_widget_send_key        (GtkWidget      *widget,
58                                                  guint           keyval,
59                                                  GdkModifierType modifiers);
60 /* operate on GtkEntry, GtkText, GtkTextView or GtkLabel */
61 void            gtk_test_text_set               (GtkWidget      *widget,
62                                                  const gchar    *string);
63 gchar*          gtk_test_text_get               (GtkWidget      *widget);
64
65 /* --- Gtk+ Test low-level API --- */
66 GtkWidget*      gtk_test_find_sibling           (GtkWidget      *base_widget,
67                                                  GType           widget_type);
68 GtkWidget*      gtk_test_find_label             (GtkWidget      *widget,
69                                                  const gchar    *label_pattern);
70 G_END_DECLS
71
72 #endif /* __GTK_TEST_UTILS_H__ */