X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtktestutils.c;h=c41c8920c43c720f2ff736904deea41859d46a15;hb=79695ee64d41c9aadfe2c6f18dc7dd1e3fd44852;hp=b6826d8c01b01de481a7715c99fa83f0694da41a;hpb=d4add8cefa6fa5c29bdb50f18e31cbfbfb38cc2b;p=~andy%2Fgtk diff --git a/gtk/gtktestutils.c b/gtk/gtktestutils.c index b6826d8c0..c41c8920c 100644 --- a/gtk/gtktestutils.c +++ b/gtk/gtktestutils.c @@ -13,9 +13,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ @@ -23,6 +21,12 @@ #include #include "gtkspinbutton.h" +#include "gtkmain.h" +#include "gtkbox.h" +#include "gtklabel.h" +#include "gtkbutton.h" +#include "gtktextview.h" +#include "gtkrange.h" #include #include @@ -43,7 +47,7 @@ * argv parameter of main(). * Any parameters understood by g_test_init() or gtk_init() are * stripped before return. - * @Varargs: currently unused + * @...: currently unused * * This function is used to initialize a GTK+ test program. * @@ -126,7 +130,7 @@ test_find_widget_input_windows (GtkWidget *widget, * particular because the mouse pointer is warped to the key press * location, see gdk_test_simulate_key() for details. * - * Returns: wether all actions neccessary for the key event simulation were carried out successfully. + * Returns: whether all actions neccessary for the key event simulation were carried out successfully. * * Since: 2.14 **/ @@ -162,7 +166,7 @@ gtk_test_widget_send_key (GtkWidget *widget, * particular because the mouse pointer is warped to the button click * location, see gdk_test_simulate_button() for details. * - * Returns: wether all actions neccessary for the button click simulation were carried out successfully. + * Returns: whether all actions neccessary for the button click simulation were carried out successfully. * * Since: 2.14 **/ @@ -193,7 +197,7 @@ gtk_test_widget_click (GtkWidget *widget, * spin button arrow areas, usually leading to an increase or decrease of * spin button's value. * - * Returns: wether all actions neccessary for the button click simulation were carried out successfully. + * Returns: whether all actions neccessary for the button click simulation were carried out successfully. * * Since: 2.14 **/ @@ -202,18 +206,18 @@ gtk_test_spin_button_click (GtkSpinButton *spinner, guint button, gboolean upwards) { - GdkWindow *panel; + GdkWindow *down_panel = NULL, *up_panel = NULL, *panel; gboolean b1res = FALSE, b2res = FALSE; - panel = _gtk_spin_button_get_panel (spinner); + _gtk_spin_button_get_panels (spinner, &down_panel, &up_panel); + + panel = (upwards) ? up_panel : down_panel; if (panel) { - gint width, pos; - width = gdk_window_get_width (panel); - pos = upwards ? 0 : gdk_window_get_height (panel) - 1; - b1res = gdk_test_simulate_button (panel, width - 1, pos, button, 0, GDK_BUTTON_PRESS); - b2res = gdk_test_simulate_button (panel, width - 1, pos, button, 0, GDK_BUTTON_RELEASE); + gint width = gdk_window_get_width (panel); + b1res = gdk_test_simulate_button (panel, width - 1, 1, button, 0, GDK_BUTTON_PRESS); + b2res = gdk_test_simulate_button (panel, width - 1, 1, button, 0, GDK_BUTTON_RELEASE); } return b1res && b2res; } @@ -332,7 +336,7 @@ widget_geo_cmp (gconstpointer a, * @base_widget will be returned. * The general purpose of this function is to find the most likely "action" * widget, relative to another labeling widget. Such as finding a - * button or text entry widget, given it's corresponding label widget. + * button or text entry widget, given its corresponding label widget. * * Returns: (transfer none): a widget of type @widget_type if any is found. * @@ -513,7 +517,7 @@ gtk_test_text_get (GtkWidget *widget) * gtk_test_create_widget: * @widget_type: a valid widget type. * @first_property_name: (allow-none): Name of first property to set or %NULL - * @Varargs: value to set the first property to, followed by more + * @...: value to set the first property to, followed by more * name-value pairs, terminated by %NULL * * This function wraps g_object_new() for widget types. @@ -590,7 +594,7 @@ gtk_test_display_button_window (const gchar *window_title, { va_list var_args; GtkWidget *window = gtk_test_create_widget (GTK_TYPE_WINDOW, "title", window_title, NULL); - GtkWidget *vbox = gtk_test_create_widget (GTK_TYPE_VBOX, "parent", window, NULL); + GtkWidget *vbox = gtk_test_create_widget (GTK_TYPE_BOX, "parent", window, "orientation", GTK_ORIENTATION_VERTICAL, NULL); const char *arg1; gtk_test_create_widget (GTK_TYPE_LABEL, "label", dialog_text, "parent", vbox, NULL); g_signal_connect (window, "destroy", G_CALLBACK (try_main_quit), NULL); @@ -630,7 +634,7 @@ gtk_test_create_simple_window (const gchar *window_title, const gchar *dialog_text) { GtkWidget *window = gtk_test_create_widget (GTK_TYPE_WINDOW, "title", window_title, NULL); - GtkWidget *vbox = gtk_test_create_widget (GTK_TYPE_VBOX, "parent", window, NULL); + GtkWidget *vbox = gtk_test_create_widget (GTK_TYPE_BOX, "parent", window, "orientation", GTK_ORIENTATION_VERTICAL, NULL); gtk_test_create_widget (GTK_TYPE_LABEL, "label", dialog_text, "parent", vbox, NULL); g_signal_connect (window, "destroy", G_CALLBACK (try_main_quit), NULL); gtk_widget_show_all (vbox); @@ -643,14 +647,15 @@ static guint n_all_registered_types = 0; /** * gtk_test_list_all_types: * @n_types: location to store number of types - * @returns: (array length=n_types zero-terminated=1) (transfer none): - * 0-terminated array of type ids * * Return the type ids that have been registered after * calling gtk_test_register_all_types(). * + * Returns: (array length=n_types zero-terminated=1) (transfer none): + * 0-terminated array of type ids + * * Since: 2.14 - **/ + */ const GType* gtk_test_list_all_types (guint *n_types) {