gtktestutils.h 4.19 KB
Newer Older
1
/* Gtk+ testing utilities
2 3
 * Copyright (C) 2007 Imendio AB
 * Authors: Tim Janik
4 5 6 7 8 9 10 11 12 13 14 15
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
16
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17
 */
18

19 20 21
#ifndef __GTK_TEST_UTILS_H__
#define __GTK_TEST_UTILS_H__

22
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
23 24 25
#error "Only <gtk/gtk.h> can be included directly."
#endif

26 27 28
#include <gtk/gtkwidget.h>
#include <gtk/gtkspinbutton.h>

29
G_BEGIN_DECLS
30 31

/* --- Gtk+ Test Utility API --- */
32
GDK_AVAILABLE_IN_ALL
33 34 35
void            gtk_test_init                   (int            *argcp,
                                                 char         ***argvp,
                                                 ...);
36
GDK_AVAILABLE_IN_ALL
37
void            gtk_test_register_all_types     (void);
38
GDK_AVAILABLE_IN_ALL
39
const GType*    gtk_test_list_all_types         (guint          *n_types);
40
GDK_AVAILABLE_IN_ALL
41 42 43
GtkWidget*      gtk_test_find_widget            (GtkWidget      *widget,
                                                 const gchar    *label_pattern,
                                                 GType           widget_type);
44
GDK_DEPRECATED_IN_3_20
45 46 47
GtkWidget*      gtk_test_create_widget          (GType           widget_type,
                                                 const gchar    *first_property_name,
                                                 ...);
48
GDK_DEPRECATED_IN_3_20
49 50
GtkWidget*      gtk_test_create_simple_window   (const gchar    *window_title,
                                                 const gchar    *dialog_text);
51
GDK_DEPRECATED_IN_3_20
52 53 54
GtkWidget*      gtk_test_display_button_window  (const gchar    *window_title,
                                                 const gchar    *dialog_text,
                                                 ...); /* NULL terminated list of (label, &int) pairs */
55
GDK_DEPRECATED_IN_3_20
56 57
void            gtk_test_slider_set_perc        (GtkWidget      *widget, /* GtkRange-alike */
                                                 double          percentage);
58
GDK_DEPRECATED_IN_3_20
59
double          gtk_test_slider_get_value       (GtkWidget      *widget);
60
GDK_DEPRECATED_IN_3_20
Johan Dahlin's avatar
Johan Dahlin committed
61
gboolean        gtk_test_spin_button_click      (GtkSpinButton  *spinner,
62 63
                                                 guint           button,
                                                 gboolean        upwards);
64 65
GDK_AVAILABLE_IN_3_10
void            gtk_test_widget_wait_for_draw   (GtkWidget      *widget);
66
GDK_DEPRECATED_IN_3_20
67 68 69
gboolean        gtk_test_widget_click           (GtkWidget      *widget,
                                                 guint           button,
                                                 GdkModifierType modifiers);
70
GDK_AVAILABLE_IN_ALL
71 72 73 74
gboolean        gtk_test_widget_send_key        (GtkWidget      *widget,
                                                 guint           keyval,
                                                 GdkModifierType modifiers);
/* operate on GtkEntry, GtkText, GtkTextView or GtkLabel */
75
GDK_DEPRECATED_IN_3_20
76 77
void            gtk_test_text_set               (GtkWidget      *widget,
                                                 const gchar    *string);
78
GDK_DEPRECATED_IN_3_20
79 80 81
gchar*          gtk_test_text_get               (GtkWidget      *widget);

/* --- Gtk+ Test low-level API --- */
82
GDK_AVAILABLE_IN_ALL
83 84
GtkWidget*      gtk_test_find_sibling           (GtkWidget      *base_widget,
                                                 GType           widget_type);
85
GDK_AVAILABLE_IN_ALL
86 87
GtkWidget*      gtk_test_find_label             (GtkWidget      *widget,
                                                 const gchar    *label_pattern);
88
G_END_DECLS
89 90

#endif /* __GTK_TEST_UTILS_H__ */