context: Make ClutterContext a GObject and move to separate file

This is a step in cleaning up the Clutter context management. By making
it a GObject it's easier to add e.g. properties and features that helps
with introspection.

For now, this means the context creation is changed to go via a
"constructor" (clutter_create_context()). This is so that the global
context singleton can be mantained outsid of ClutterContext, until it
can be removed.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2016>
This commit is contained in:
Jonas Ådahl
2021-09-20 10:28:42 +02:00
committed by Marge Bot
parent 6aebd5407d
commit 501d19656e
14 changed files with 469 additions and 312 deletions

View File

@ -0,0 +1,48 @@
/*
* Copyright (C) 2006 OpenedHand
* Copyright (C) 2023 Red Hat
*
* 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
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "clutter/clutter-context.h"
struct _ClutterContext
{
GObject parent;
ClutterBackend *backend;
ClutterStageManager *stage_manager;
GAsyncQueue *events_queue;
/* the event filters added via clutter_event_add_filter. these are
* ordered from least recently added to most recently added */
GList *event_filters;
CoglPangoFontMap *font_map;
GSList *current_event;
GList *repaint_funcs;
guint last_repaint_id;
ClutterSettings *settings;
gboolean is_initialized;
gboolean show_fps;
};