]> Pileus Git - ~andy/gtk/blob - gtk/gtktestutils.h
gtk/gtkmountoperation.h gtk/gtkshow.h gtk/gtktestutils.h no need to allow
[~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, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
22 #error "Only <gtk/gtk.h> can be included directly."
23 #endif
24
25 #ifndef __GTK_TEST_UTILS_H__
26 #define __GTK_TEST_UTILS_H__
27
28 #include <gtk/gtkwidget.h>
29 #include <gtk/gtkspinbutton.h>
30
31 G_BEGIN_DECLS
32
33 /* --- Gtk+ Test Utility API --- */
34 void            gtk_test_init                   (int            *argcp,
35                                                  char         ***argvp,
36                                                  ...);
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,
41                                                  GType           widget_type);
42 GtkWidget*      gtk_test_create_widget          (GType           widget_type,
43                                                  const gchar    *first_property_name,
44                                                  ...);
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 */
51                                                  double          percentage);
52 double          gtk_test_slider_get_value       (GtkWidget      *widget);
53 gboolean        gtk_test_spin_button_click      (GtkSpinButton  *spinner,
54                                                  guint           button,
55                                                  gboolean        upwards);
56 gboolean        gtk_test_widget_click           (GtkWidget      *widget,
57                                                  guint           button,
58                                                  GdkModifierType modifiers);
59 gboolean        gtk_test_widget_send_key        (GtkWidget      *widget,
60                                                  guint           keyval,
61                                                  GdkModifierType modifiers);
62 /* operate on GtkEntry, GtkText, GtkTextView or GtkLabel */
63 void            gtk_test_text_set               (GtkWidget      *widget,
64                                                  const gchar    *string);
65 gchar*          gtk_test_text_get               (GtkWidget      *widget);
66
67 /* --- Gtk+ Test low-level API --- */
68 GtkWidget*      gtk_test_find_sibling           (GtkWidget      *base_widget,
69                                                  GType           widget_type);
70 GtkWidget*      gtk_test_find_label             (GtkWidget      *widget,
71                                                  const gchar    *label_pattern);
72 G_END_DECLS
73
74 #endif /* __GTK_TEST_UTILS_H__ */