File: clutter-frame-clock.h

package info (click to toggle)
mutter 50.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 50,868 kB
  • sloc: ansic: 385,772; xml: 3,430; python: 3,272; sh: 325; ruby: 167; makefile: 60; javascript: 26
file content (149 lines) | stat: -rw-r--r-- 5,504 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
 * Copyright (C) 2019 Red Hat Inc.
 *
 * 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

#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif

#include <glib.h>
#include <glib-object.h>
#include <stdint.h>

#include "clutter/clutter-types.h"

typedef enum _ClutterFrameResult
{
  CLUTTER_FRAME_RESULT_PENDING_PRESENTED,
  CLUTTER_FRAME_RESULT_IDLE,
  CLUTTER_FRAME_RESULT_IGNORED,
} ClutterFrameResult;

#define CLUTTER_TYPE_FRAME_CLOCK_DRIVER (clutter_frame_clock_driver_get_type ())
CLUTTER_EXPORT
G_DECLARE_DERIVABLE_TYPE (ClutterFrameClockDriver, clutter_frame_clock_driver,
                          CLUTTER, FRAME_CLOCK_DRIVER,
                          GObject)

struct _ClutterFrameClockDriverClass
{
  GObjectClass parent_class;

  void (* schedule_update) (ClutterFrameClockDriver *driver);
};

#define CLUTTER_TYPE_FRAME_CLOCK (clutter_frame_clock_get_type ())
CLUTTER_EXPORT
G_DECLARE_FINAL_TYPE (ClutterFrameClock, clutter_frame_clock,
                      CLUTTER, FRAME_CLOCK,
                      GObject)

/**
 * ClutterFrameListenerIface: (skip)
 */
typedef struct _ClutterFrameListenerIface
{
  void (* before_frame) (ClutterFrameClock *frame_clock,
                         ClutterFrame      *frame,
                         gpointer           user_data);
  ClutterFrameResult (* frame) (ClutterFrameClock *frame_clock,
                                ClutterFrame      *frame,
                                gpointer           user_data);
  ClutterFrame * (* new_frame) (ClutterFrameClock *frame_clock,
                                gpointer           user_data);
} ClutterFrameListenerIface;

typedef enum _ClutterFrameClockMode
{
  CLUTTER_FRAME_CLOCK_MODE_FIXED,
  CLUTTER_FRAME_CLOCK_MODE_VARIABLE,
  CLUTTER_FRAME_CLOCK_MODE_PASSIVE,
} ClutterFrameClockMode;

CLUTTER_EXPORT
ClutterFrameClock * clutter_frame_clock_new (float                            refresh_rate,
                                             int64_t                          vblank_duration_us,
                                             const char                      *name,
                                             const ClutterFrameListenerIface *iface,
                                             gpointer                         user_data);

CLUTTER_EXPORT
void clutter_frame_clock_destroy (ClutterFrameClock *frame_clock);

CLUTTER_EXPORT
void clutter_frame_clock_set_mode (ClutterFrameClock     *frame_clock,
                                   ClutterFrameClockMode  mode);

CLUTTER_EXPORT
void clutter_frame_clock_notify_presented (ClutterFrameClock *frame_clock,
                                           ClutterFrameInfo  *frame_info);

CLUTTER_EXPORT
void clutter_frame_clock_notify_ready (ClutterFrameClock *frame_clock);

CLUTTER_EXPORT
void clutter_frame_clock_schedule_update (ClutterFrameClock *frame_clock);

CLUTTER_EXPORT
void clutter_frame_clock_schedule_flush_update (ClutterFrameClock *frame_clock);

CLUTTER_EXPORT
void clutter_frame_clock_schedule_update_now (ClutterFrameClock *frame_clock);

CLUTTER_EXPORT
void clutter_frame_clock_set_fullscreen_update_time (ClutterFrameClock *frame_clock,
                                                     int64_t            update_time_us);

CLUTTER_EXPORT
void clutter_frame_clock_add_future_time (ClutterFrameClock *frame_clock,
                                          int64_t            when_us);

CLUTTER_EXPORT
void clutter_frame_clock_inhibit (ClutterFrameClock *frame_clock);

CLUTTER_EXPORT
void clutter_frame_clock_uninhibit (ClutterFrameClock *frame_clock);

void clutter_frame_clock_add_timeline (ClutterFrameClock *frame_clock,
                                       ClutterTimeline   *timeline);

void clutter_frame_clock_remove_timeline (ClutterFrameClock *frame_clock,
                                          ClutterTimeline   *timeline);

CLUTTER_EXPORT
float clutter_frame_clock_get_refresh_rate (ClutterFrameClock *frame_clock);

void clutter_frame_clock_record_flip_time (ClutterFrameClock *frame_clock,
                                           int64_t            flip_time_us);

GString * clutter_frame_clock_get_max_render_time_debug_info (ClutterFrameClock *frame_clock);

CLUTTER_EXPORT
void clutter_frame_clock_set_deadline_evasion (ClutterFrameClock *frame_clock,
                                               int64_t            deadline_evasion_us);

CLUTTER_EXPORT
int clutter_frame_clock_get_priority (ClutterFrameClock *frame_clock);

CLUTTER_EXPORT
void clutter_frame_clock_set_passive (ClutterFrameClock       *frame_clock,
                                      ClutterFrameClockDriver *driver);

CLUTTER_EXPORT
ClutterFrameResult clutter_frame_clock_dispatch (ClutterFrameClock *frame_clock,
                                                 int64_t            time_us);