2013-09-11 04:18:53 -04:00
|
|
|
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
|
|
|
|
|
|
|
/* Mutter utilities */
|
|
|
|
|
2014-05-02 09:34:02 -04:00
|
|
|
/*
|
2013-09-11 04:18:53 -04:00
|
|
|
* Copyright (C) 2001 Havoc Pennington
|
|
|
|
* Copyright (C) 2005 Elijah Newren
|
2014-05-02 09:34:02 -04:00
|
|
|
*
|
2013-09-11 04:18:53 -04:00
|
|
|
* 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.
|
2014-05-02 09:34:02 -04:00
|
|
|
*
|
2013-09-11 04:18:53 -04:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
* 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef META_UTIL_PRIVATE_H
|
|
|
|
#define META_UTIL_PRIVATE_H
|
|
|
|
|
|
|
|
#include <glib/gi18n-lib.h>
|
|
|
|
|
2018-07-10 04:36:24 -04:00
|
|
|
#include "meta/util.h"
|
2019-01-22 21:25:35 -05:00
|
|
|
#include "meta/common.h"
|
|
|
|
|
|
|
|
/* META_EXPORT_TEST should be used to export symbols that are exported only
|
|
|
|
* for testability purposes */
|
|
|
|
#define META_EXPORT_TEST META_EXPORT
|
2018-07-10 04:36:24 -04:00
|
|
|
|
2013-09-11 04:18:53 -04:00
|
|
|
void meta_set_verbose (gboolean setting);
|
|
|
|
void meta_set_debugging (gboolean setting);
|
2021-03-02 05:05:15 -05:00
|
|
|
|
2013-09-11 04:18:53 -04:00
|
|
|
void meta_set_is_wayland_compositor (gboolean setting);
|
|
|
|
|
2017-06-21 01:42:23 -04:00
|
|
|
char * meta_generate_random_id (GRand *rand,
|
|
|
|
int length);
|
|
|
|
|
2021-02-24 10:27:44 -05:00
|
|
|
void meta_init_debug_utils (void);
|
|
|
|
|
2021-03-03 11:35:26 -05:00
|
|
|
#define META_POINT_IN_RECT(xcoord, ycoord, rect) \
|
|
|
|
((xcoord) >= (rect).x && \
|
|
|
|
(xcoord) < ((rect).x + (rect).width) && \
|
|
|
|
(ycoord) >= (rect).y && \
|
|
|
|
(ycoord) < ((rect).y + (rect).height))
|
|
|
|
|
renderer/native: Move per frame KMS update to MetaFrameNative
In order to make things more and more asynchronus and to each time we
paint be an isolated event, that can be potentially be applied
individually or together with other updates, make it so that each time
we draw, we use the transient MetaFrameNative (ClutterFrame) instance to
carry a KMS update for us.
For this to work, we also need to restructure how we apply mode sets.
Previously we'd amend the same KMS update each frame during mode set,
then after the last CRTC was composited, we'd apply the update that
contained updates for all CRTC.
Now each CRTC has its own KMS update, and instead we put them in a per
device table, and whenever we finished painting, we'll merge the new
update into any existing one, and then finally once all CRTCs have been
composited, we'll apply an update that contains all the mode sets for all
relevant CRTCs on a device.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2855>
2022-10-20 15:57:25 -04:00
|
|
|
#define META_CONTAINER_OF(ptr, type, member) \
|
|
|
|
(type *) ((uint8_t *) (ptr) - G_STRUCT_OFFSET (type, member))
|
|
|
|
|
2013-09-11 04:18:53 -04:00
|
|
|
#endif
|