2017-06-26 08:31:48 +00: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 16:39:53 +00:00
|
|
|
#ifndef META_TEST_UTILS_H
|
|
|
|
#define META_TEST_UTILS_H
|
2017-06-26 08:31:48 +00:00
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/extensions/sync.h>
|
|
|
|
|
2022-01-17 10:45:53 +00:00
|
|
|
#include "backends/meta-backend-types.h"
|
2017-06-26 08:31:48 +00:00
|
|
|
#include "meta/window.h"
|
|
|
|
|
2021-05-06 21:34:36 +00:00
|
|
|
#define META_TEST_CLIENT_ERROR meta_test_client_error_quark ()
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-07-22 18:51:34 +00: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 21:34:36 +00:00
|
|
|
typedef enum _MetaClientError
|
2017-06-26 08:31:48 +00:00
|
|
|
{
|
2021-05-06 21:34:36 +00:00
|
|
|
META_TEST_CLIENT_ERROR_BAD_COMMAND,
|
|
|
|
META_TEST_CLIENT_ERROR_RUNTIME_ERROR,
|
|
|
|
META_TEST_CLIENT_ERROR_ASSERTION_FAILED
|
|
|
|
} MetaClientError;
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 21:34:36 +00:00
|
|
|
GQuark meta_test_client_error_quark (void);
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-05-06 21:35:44 +00:00
|
|
|
typedef struct _MetaAsyncWaiter MetaAsyncWaiter;
|
2021-05-06 21:34:36 +00:00
|
|
|
typedef struct _MetaTestClient MetaTestClient;
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 21:35:44 +00:00
|
|
|
gboolean meta_async_waiter_process_x11_event (MetaAsyncWaiter *waiter,
|
|
|
|
MetaX11Display *display,
|
|
|
|
XSyncAlarmNotifyEvent *event);
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 21:35:44 +00:00
|
|
|
void meta_async_waiter_set_and_wait (MetaAsyncWaiter *waiter);
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 21:35:44 +00:00
|
|
|
MetaAsyncWaiter * meta_async_waiter_new (void);
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 21:35:44 +00:00
|
|
|
void meta_async_waiter_destroy (MetaAsyncWaiter *waiter);
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 21:34:36 +00:00
|
|
|
char * meta_test_client_get_id (MetaTestClient *client);
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 21:34:36 +00:00
|
|
|
gboolean meta_test_client_process_x11_event (MetaTestClient *client,
|
|
|
|
MetaX11Display *x11_display,
|
|
|
|
XSyncAlarmNotifyEvent *event);
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 21:34:36 +00:00
|
|
|
gboolean meta_test_client_wait (MetaTestClient *client,
|
|
|
|
GError **error);
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2022-01-14 21:06:18 +00:00
|
|
|
META_EXPORT
|
|
|
|
gboolean meta_test_client_dov (MetaTestClient *client,
|
|
|
|
GError **error,
|
|
|
|
va_list vap);
|
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 21:34:36 +00:00
|
|
|
gboolean meta_test_client_do (MetaTestClient *client,
|
|
|
|
GError **error,
|
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 21:34:36 +00:00
|
|
|
MetaWindow * meta_test_client_find_window (MetaTestClient *client,
|
|
|
|
const char *window_id,
|
|
|
|
GError **error);
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 21:34:36 +00:00
|
|
|
void meta_test_client_wait_for_window_shown (MetaTestClient *client,
|
|
|
|
MetaWindow *window);
|
2019-11-01 12:37:22 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 21:34:36 +00:00
|
|
|
gboolean meta_test_client_quit (MetaTestClient *client,
|
|
|
|
GError **error);
|
2017-08-18 06:23:42 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-11 07:35:04 +00:00
|
|
|
MetaTestClient * meta_test_client_new (MetaContext *context,
|
|
|
|
const char *id,
|
2021-05-06 21:34:36 +00:00
|
|
|
MetaWindowClientType type,
|
|
|
|
GError **error);
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 21:34:36 +00:00
|
|
|
void meta_test_client_destroy (MetaTestClient *client);
|
2017-06-26 08:31:48 +00:00
|
|
|
|
2021-05-06 21:37:35 +00:00
|
|
|
META_EXPORT
|
2021-05-06 22:47:01 +00:00
|
|
|
const char * meta_test_get_plugin_name (void);
|
2018-07-12 20:20:20 +00:00
|
|
|
|
2022-01-14 21:11:17 +00:00
|
|
|
META_EXPORT
|
2022-01-17 10:45:53 +00:00
|
|
|
void meta_set_custom_monitor_config (MetaBackend *backend,
|
|
|
|
const char *filename,
|
|
|
|
MetaMonitorsConfigFlag configs_flags);
|
2022-01-14 21:11:17 +00:00
|
|
|
|
2022-01-14 21:12:36 +00:00
|
|
|
META_EXPORT
|
|
|
|
void meta_wait_for_paint (MetaContext *context);
|
|
|
|
|
2021-05-06 21:34:36 +00:00
|
|
|
#endif /* TEST_UTILS_H */
|