2017-06-26 04:31:48 -04:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2017 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2021-04-20 12:39:53 -04:00
|
|
|
#ifndef META_TEST_UTILS_H
|
|
|
|
#define META_TEST_UTILS_H
|
2017-06-26 04:31:48 -04:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/extensions/sync.h>
|
|
|
|
|
2022-01-17 05:45:53 -05:00
|
|
|
#include "backends/meta-backend-types.h"
|
2017-06-26 04:31:48 -04:00
|
|
|
#include "meta/window.h"
|
|
|
|
|
2021-05-06 17:34:36 -04:00
|
|
|
#define META_TEST_CLIENT_ERROR meta_test_client_error_quark ()
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2021-07-22 14:51:34 -04:00
|
|
|
#define META_TEST_LOG_CALL(description, call) \
|
|
|
|
G_STMT_START { \
|
|
|
|
g_debug ("%s: %s: %s", G_STRFUNC, G_STRLOC, description); \
|
|
|
|
call; \
|
|
|
|
} G_STMT_END
|
|
|
|
|
2021-05-06 17:34:36 -04:00
|
|
|
typedef enum _MetaClientError
|
2017-06-26 04:31:48 -04:00
|
|
|
{
|
2021-05-06 17:34:36 -04:00
|
|
|
META_TEST_CLIENT_ERROR_BAD_COMMAND,
|
|
|
|
META_TEST_CLIENT_ERROR_RUNTIME_ERROR,
|
|
|
|
META_TEST_CLIENT_ERROR_ASSERTION_FAILED
|
|
|
|
} MetaClientError;
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2021-05-06 17:34:36 -04:00
|
|
|
GQuark meta_test_client_error_quark (void);
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2021-05-06 17:35:44 -04:00
|
|
|
typedef struct _MetaAsyncWaiter MetaAsyncWaiter;
|
2021-05-06 17:34:36 -04:00
|
|
|
typedef struct _MetaTestClient MetaTestClient;
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2021-05-06 17:35:44 -04:00
|
|
|
gboolean meta_async_waiter_process_x11_event (MetaAsyncWaiter *waiter,
|
2022-04-06 04:30:59 -04:00
|
|
|
MetaX11Display *x11_display,
|
2021-05-06 17:35:44 -04:00
|
|
|
XSyncAlarmNotifyEvent *event);
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2021-05-06 17:35:44 -04:00
|
|
|
void meta_async_waiter_set_and_wait (MetaAsyncWaiter *waiter);
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2022-04-06 04:30:59 -04:00
|
|
|
MetaAsyncWaiter * meta_async_waiter_new (MetaX11Display *x11_display);
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2021-05-06 17:35:44 -04:00
|
|
|
void meta_async_waiter_destroy (MetaAsyncWaiter *waiter);
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2021-05-06 17:34:36 -04:00
|
|
|
char * meta_test_client_get_id (MetaTestClient *client);
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2021-05-06 17:34:36 -04:00
|
|
|
gboolean meta_test_client_wait (MetaTestClient *client,
|
|
|
|
GError **error);
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2022-01-14 16:06:18 -05:00
|
|
|
META_EXPORT
|
|
|
|
gboolean meta_test_client_dov (MetaTestClient *client,
|
|
|
|
GError **error,
|
|
|
|
va_list vap);
|
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2021-05-06 17:34:36 -04:00
|
|
|
gboolean meta_test_client_do (MetaTestClient *client,
|
|
|
|
GError **error,
|
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2022-01-27 12:58:56 -05:00
|
|
|
META_EXPORT
|
|
|
|
MetaWindow * meta_find_window_from_title (MetaContext *context,
|
|
|
|
const char *title);
|
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2021-05-06 17:34:36 -04:00
|
|
|
MetaWindow * meta_test_client_find_window (MetaTestClient *client,
|
|
|
|
const char *window_id,
|
|
|
|
GError **error);
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2021-05-06 17:34:36 -04:00
|
|
|
void meta_test_client_wait_for_window_shown (MetaTestClient *client,
|
|
|
|
MetaWindow *window);
|
2019-11-01 08:37:22 -04:00
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2021-05-06 17:34:36 -04:00
|
|
|
gboolean meta_test_client_quit (MetaTestClient *client,
|
|
|
|
GError **error);
|
2017-08-18 02:23:42 -04:00
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2021-05-11 03:35:04 -04:00
|
|
|
MetaTestClient * meta_test_client_new (MetaContext *context,
|
|
|
|
const char *id,
|
2021-05-06 17:34:36 -04:00
|
|
|
MetaWindowClientType type,
|
|
|
|
GError **error);
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2021-05-06 17:34:36 -04:00
|
|
|
void meta_test_client_destroy (MetaTestClient *client);
|
2017-06-26 04:31:48 -04:00
|
|
|
|
2021-05-06 17:37:35 -04:00
|
|
|
META_EXPORT
|
2021-05-06 18:47:01 -04:00
|
|
|
const char * meta_test_get_plugin_name (void);
|
2018-07-12 16:20:20 -04:00
|
|
|
|
2022-01-14 16:11:17 -05:00
|
|
|
META_EXPORT
|
2022-01-28 10:28:32 -05:00
|
|
|
void meta_set_custom_monitor_config_full (MetaBackend *backend,
|
|
|
|
const char *filename,
|
|
|
|
MetaMonitorsConfigFlag configs_flags);
|
2022-01-14 16:11:17 -05:00
|
|
|
|
2022-01-14 16:12:36 -05:00
|
|
|
META_EXPORT
|
|
|
|
void meta_wait_for_paint (MetaContext *context);
|
|
|
|
|
2022-01-27 18:12:59 -05:00
|
|
|
META_EXPORT
|
|
|
|
MetaVirtualMonitor * meta_create_test_monitor (MetaContext *context,
|
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
float refresh_rate);
|
|
|
|
|
2021-05-06 17:34:36 -04:00
|
|
|
#endif /* TEST_UTILS_H */
|