1 /* Gtk+ testing utilities
2 * Copyright (C) 2007 Imendio AB
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.
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.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
22 #error "Only <gtk/gtk.h> can be included directly."
25 #ifndef __GTK_TEST_UTILS_H__
26 #define __GTK_TEST_UTILS_H__
28 #include <gtk/gtkwidget.h>
29 #include <gtk/gtkspinbutton.h>
33 /* --- Gtk+ Test Utility API --- */
34 void gtk_test_init (int *argcp,
37 void gtk_test_register_all_types (void);
38 const GType* gtk_test_list_all_types (guint *n_types);
39 GtkWidget* gtk_test_find_widget (GtkWidget *widget,
40 const gchar *label_pattern,
42 GtkWidget* gtk_test_create_widget (GType widget_type,
43 const gchar *first_property_name,
45 GtkWidget* gtk_test_create_simple_window (const gchar *window_title,
46 const gchar *dialog_text);
47 GtkWidget* gtk_test_display_button_window (const gchar *window_title,
48 const gchar *dialog_text,
49 ...); /* NULL terminated list of (label, &int) pairs */
50 void gtk_test_slider_set_perc (GtkWidget *widget, /* GtkRange-alike */
52 double gtk_test_slider_get_value (GtkWidget *widget);
53 gboolean gtk_test_spin_button_click (GtkSpinButton *spinner,
56 gboolean gtk_test_widget_click (GtkWidget *widget,
58 GdkModifierType modifiers);
59 gboolean gtk_test_widget_send_key (GtkWidget *widget,
61 GdkModifierType modifiers);
62 /* operate on GtkEntry, GtkText, GtkTextView or GtkLabel */
63 void gtk_test_text_set (GtkWidget *widget,
65 gchar* gtk_test_text_get (GtkWidget *widget);
67 /* --- Gtk+ Test low-level API --- */
68 GtkWidget* gtk_test_find_sibling (GtkWidget *base_widget,
70 GtkWidget* gtk_test_find_label (GtkWidget *widget,
71 const gchar *label_pattern);
74 #endif /* __GTK_TEST_UTILS_H__ */