Merge branch 'leolost/wayland-notifications' of github.com:elementary/gala into leolost/wayland-notifications

This commit is contained in:
Leonhard 2024-03-21 17:50:42 +01:00
commit cd92f7d3e2
46 changed files with 1208 additions and 697 deletions

View File

@ -174,7 +174,7 @@
<summary>Cycle to the next workspace to the right or to back to the first</summary>
</key>
<key type="as" name="panel-main-menu">
<default><![CDATA[['<Super>space','<Alt>F2']]]></default>
<default><![CDATA[['<Alt>F2']]]></default>
<summary>Open the applications menu</summary>
</key>
<key name="screenshot" type="as">
@ -202,12 +202,12 @@
<summary>Copy a screenshot of an area to clipboard</summary>
</key>
<key type="as" name="switch-input-source">
<default><![CDATA[['']]]></default>
<default><![CDATA[['<Super>Space']]]></default>
<summary>Cycle to next keyboard layout</summary>
<description></description>
</key>
<key type="as" name="switch-input-source-backward">
<default><![CDATA[['']]]></default>
<default><![CDATA[['<Super><Shift>Space']]]></default>
<summary>Cycle to previous keyboard layout</summary>
<description></description>
</key>

28
lib/CanvasActor.vala Normal file
View File

@ -0,0 +1,28 @@
/*
* Copyright 2024 elementary, Inc. (https://elementary.io)
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
public class Gala.CanvasActor : Clutter.Actor {
private Gala.Drawing.Canvas canvas;
construct {
canvas = new Gala.Drawing.Canvas ();
content = canvas;
canvas.draw.connect ((ctx, width, height) => {
draw (ctx, width, height);
});
}
public override void resource_scale_changed () {
canvas.set_scale_factor (get_resource_scale ());
}
public override void allocate (Clutter.ActorBox box) {
base.allocate (box);
canvas.set_size ((int)box.get_width (), (int)box.get_height ());
canvas.set_scale_factor (get_resource_scale ());
}
protected virtual void draw (Cairo.Context canvas, int width, int height) { }
}

163
lib/Drawing/Canvas.vala Normal file
View File

@ -0,0 +1,163 @@
/*
* Copyright 2024 elementary, Inc. (https://elementary.io)
* SPDX-License-Identifier: LGPL-2.0-or-later
*/
#if HAS_MUTTER46
public class Gala.Drawing.Canvas : GLib.Object, Clutter.Content {
private int width = -1;
private int height = -1;
private float scale_factor = 1.0f;
private Cogl.Texture? texture = null;
private Cogl.Bitmap? bitmap = null;
private bool dirty = false;
public signal void draw (Cairo.Context cr, int width, int height);
private void emit_draw () requires (width > 0 && height > 0) {
dirty = true;
int real_width = (int) Math.ceilf (width * scale_factor);
int real_height = (int) Math.ceilf (height * scale_factor);
if (bitmap == null) {
unowned Cogl.Context ctx = Clutter.get_default_backend ().get_cogl_context ();
bitmap = new Cogl.Bitmap.with_size (ctx, real_width, real_height, Cogl.PixelFormat.CAIRO_ARGB32_COMPAT);
}
unowned Cogl.Buffer? buffer = bitmap.get_buffer ();
if (buffer == null) {
return;
}
buffer.set_update_hint (Cogl.BufferUpdateHint.DYNAMIC);
void* data = buffer.map (Cogl.BufferAccess.READ_WRITE, Cogl.BufferMapHint.DISCARD);
Cairo.ImageSurface surface;
bool mapped_buffer;
if (data != null) {
var bitmap_stride = bitmap.get_rowstride ();
surface = new Cairo.ImageSurface.for_data ((uchar[]) data, Cairo.Format.ARGB32, real_width, real_height, bitmap_stride);
mapped_buffer = true;
} else {
surface = new Cairo.ImageSurface (Cairo.Format.ARGB32, real_width, real_height);
mapped_buffer = false;
}
surface.set_device_scale (scale_factor, scale_factor);
var cr = new Cairo.Context (surface);
draw ((owned) cr, width, height);
if (mapped_buffer) {
buffer.unmap ();
} else {
int size = surface.get_stride () * height;
buffer.set_data (0, surface.get_data (), size);
}
}
public bool get_preferred_size (out float out_width, out float out_height) {
if (width < 0 || width < 0) {
out_width = 0;
out_height = 0;
return false;
}
out_width = Math.ceilf (width * scale_factor);
out_height = Math.ceilf (height * scale_factor);
return true;
}
public void invalidate () {
if (width < 0 || height < 0) {
return;
}
emit_draw ();
}
public void invalidate_size () { }
public void paint_content (Clutter.Actor actor, Clutter.PaintNode root, Clutter.PaintContext paint_context) {
if (bitmap == null) {
return;
}
if (dirty) {
texture = null;
}
if (texture == null) {
texture = new Cogl.Texture2D.from_bitmap (bitmap);
}
if (texture == null) {
return;
}
var node = actor.create_texture_paint_node (texture);
root.add_child (node);
dirty = false;
}
public void set_size (int new_width, int new_height) requires (new_width >= -1 && new_height >= -1) {
if (new_width == width && new_height == height) {
return;
}
width = new_width;
height = new_height;
invalidate ();
}
public void set_scale_factor (float new_scale_factor) requires (new_scale_factor > 0.0f) {
if (new_scale_factor != scale_factor) {
scale_factor = new_scale_factor;
invalidate ();
}
}
}
#else
public class Gala.Drawing.Canvas : GLib.Object, Clutter.Content {
public Clutter.Canvas canvas;
construct {
canvas = new Clutter.Canvas ();
canvas.draw.connect (on_draw);
}
public signal void draw (Cairo.Context cr, int width, int height);
public bool get_preferred_size (out float out_width, out float out_height) {
return canvas.get_preferred_size (out out_width, out out_height);
}
public void invalidate () {
canvas.invalidate ();
}
public void invalidate_size () {
canvas.invalidate_size ();
}
public void paint_content (Clutter.Actor actor, Clutter.PaintNode root, Clutter.PaintContext paint_context) {
canvas.paint_content (actor, root, paint_context);
}
public void set_size (int new_width, int new_height) requires (new_width >= -1 && new_height >= -1) {
canvas.set_size (new_width, new_height);
}
public void set_scale_factor (float new_scale_factor) requires (new_scale_factor > 0.0f) {
canvas.set_scale_factor (new_scale_factor);
}
private bool on_draw (Cairo.Context cr, int width, int height) {
draw (cr, width, height);
return true;
}
}
#endif

View File

@ -13,6 +13,11 @@ namespace Gala.Drawing {
* A class containing an RGBA color and methods for more powerful color manipulation.
*/
public class Color : GLib.Object, SettingsSerializable {
public const Gdk.RGBA LIGHT_BACKGROUND = { (250f / 255f), (250f / 255f), (250f / 255f), 1};
public const Gdk.RGBA DARK_BACKGROUND = { (51 / 255f), (51 / 255f), (51 / 255f), 1};
public const Gdk.RGBA TOOLTIP_BACKGROUND = { 0, 0, 0, 1};
public const Gdk.RGBA TOOLTIP_TEXT_COLOR = { 1, 1, 1, 1};
/**
* The value of the red channel, with 0 being the lowest value and 1.0 being the greatest value.
*/

View File

@ -133,8 +133,8 @@ public class Gala.ShadowEffect : Clutter.Effect {
pipeline.set_layer_texture (0, shadow);
}
var opacity = actor.get_paint_opacity () * shadow_opacity / 255;
var alpha = Cogl.Color.from_4ub (255, 255, 255, opacity);
var opacity = actor.get_paint_opacity () * shadow_opacity / 255.0f;
var alpha = Cogl.Color.from_4f (1.0f, 1.0f, 1.0f, opacity / 255.0f);
alpha.premultiply ();
pipeline.set_color (alpha);

View File

@ -117,24 +117,30 @@ namespace Gala {
}
}
unowned Meta.Group group = window.get_group ();
if (group != null) {
var group_windows = group.list_windows ();
group_windows.foreach ((window) => {
if (window.get_window_type () != Meta.WindowType.NORMAL) {
return;
}
if (window.get_client_type () == Meta.WindowClientType.X11) {
#if HAS_MUTTER46
unowned Meta.Group group = window.x11_get_group ();
#else
unowned Meta.Group group = window.get_group ();
#endif
if (group != null) {
var group_windows = group.list_windows ();
group_windows.foreach ((window) => {
if (window.get_window_type () != Meta.WindowType.NORMAL) {
return;
}
if (window_to_desktop_cache[window] != null) {
desktop_app = window_to_desktop_cache[window];
}
});
if (window_to_desktop_cache[window] != null) {
desktop_app = window_to_desktop_cache[window];
}
});
if (desktop_app != null) {
var icon = get_icon_for_desktop_app_info (desktop_app, icon_size, scale);
if (icon != null) {
window_to_desktop_cache[window] = desktop_app;
return icon;
if (desktop_app != null) {
var icon = get_icon_for_desktop_app_info (desktop_app, icon_size, scale);
if (icon != null) {
window_to_desktop_cache[window] = desktop_app;
return icon;
}
}
}
}

View File

@ -4,10 +4,12 @@ gala_lib_sources = files(
'AppCache.vala',
'AppSystem.vala',
'BackgroundManager.vala',
'CanvasActor.vala',
'CloseButton.vala',
'Constants.vala',
'DragDropAction.vala',
'Drawing/BufferSurface.vala',
'Drawing/Canvas.vala',
'Drawing/Color.vala',
'Drawing/Utilities.vala',
'Plugin.vala',

View File

@ -15,7 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
public class Gala.Plugins.PIP.SelectionArea : Clutter.Actor {
public class Gala.Plugins.PIP.SelectionArea : CanvasActor {
public signal void captured (int x, int y, int width, int height);
public signal void selected (int x, int y);
public signal void closed ();
@ -42,13 +42,6 @@ public class Gala.Plugins.PIP.SelectionArea : Clutter.Actor {
wm.get_display ().get_size (out screen_width, out screen_height);
width = screen_width;
height = screen_height;
var canvas = new Clutter.Canvas ();
canvas.set_size (screen_width, screen_height);
canvas.draw.connect (draw_area);
set_content (canvas);
canvas.invalidate ();
}
#if HAS_MUTTER45
@ -159,7 +152,7 @@ public class Gala.Plugins.PIP.SelectionArea : Clutter.Actor {
height = (start_point.y - end_point.y).abs ();
}
private bool draw_area (Cairo.Context ctx) {
protected override void draw (Cairo.Context ctx, int width, int height) {
ctx.save ();
ctx.set_operator (Cairo.Operator.CLEAR);
@ -168,7 +161,7 @@ public class Gala.Plugins.PIP.SelectionArea : Clutter.Actor {
ctx.restore ();
if (!dragging) {
return true;
return;
}
int x, y, w, h;
@ -182,7 +175,5 @@ public class Gala.Plugins.PIP.SelectionArea : Clutter.Actor {
ctx.set_source_rgb (0.7, 0.7, 0.7);
ctx.set_line_width (1.0);
ctx.stroke ();
return true;
}
}

View File

@ -8,16 +8,16 @@ msgstr ""
"Project-Id-Version: gala\n"
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
"POT-Creation-Date: 2024-02-18 02:05+0000\n"
"PO-Revision-Date: 2023-06-13 10:07+0000\n"
"PO-Revision-Date: 2024-02-24 16:12+0000\n"
"Last-Translator: Uwe S <saabisto@gmx.de>\n"
"Language-Team: German <https://l10n.elementary.io/projects/desktop/gala/de/"
">\n"
"Language-Team: German <https://l10n.elementary.io/projects/desktop/gala/de/>"
"\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
"X-Generator: Weblate 5.0.2\n"
"X-Launchpad-Export-Date: 2017-02-21 05:47+0000\n"
#: src/Dialogs.vala:152
@ -91,14 +91,12 @@ msgid "System Settings…"
msgstr "Systemeinstellungen …"
#: daemon/BackgroundMenu.vala:47
#, fuzzy
#| msgid "System Settings…"
msgid "Failed to open System Settings"
msgstr "Systemeinstellungen …"
msgstr "Öffnen der Systemeinstellungen fehlgeschlagen"
#: daemon/BackgroundMenu.vala:48
msgid "A handler for the “settings://” URI scheme must be installed."
msgstr ""
msgstr "Ein Handler für das URI-Scheme »settings://« muss installiert werden."
#: daemon/WindowMenu.vala:36
msgid "Hide"

View File

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: beat-box\n"
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
"POT-Creation-Date: 2024-02-18 02:05+0000\n"
"PO-Revision-Date: 2023-11-13 02:10+0000\n"
"PO-Revision-Date: 2024-02-22 04:12+0000\n"
"Last-Translator: David Hewitt <davidmhewitt@gmail.com>\n"
"Language-Team: English (United Kingdom) <https://l10n.elementary.io/projects/"
"desktop/gala/en_GB/>\n"
@ -91,14 +91,12 @@ msgid "System Settings…"
msgstr "System Settings…"
#: daemon/BackgroundMenu.vala:47
#, fuzzy
#| msgid "System Settings…"
msgid "Failed to open System Settings"
msgstr "System Settings"
msgstr "Failed to open System Settings"
#: daemon/BackgroundMenu.vala:48
msgid "A handler for the “settings://” URI scheme must be installed."
msgstr ""
msgstr "A handler for the “settings://” URI scheme must be installed."
#: daemon/WindowMenu.vala:36
msgid "Hide"

View File

@ -8,10 +8,10 @@ msgstr ""
"Project-Id-Version: gala\n"
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
"POT-Creation-Date: 2024-02-18 02:05+0000\n"
"PO-Revision-Date: 2023-10-27 12:25+0000\n"
"PO-Revision-Date: 2024-03-12 11:13+0000\n"
"Last-Translator: Nathan <bonnemainsnathan@gmail.com>\n"
"Language-Team: French <https://l10n.elementary.io/projects/desktop/gala/fr/"
">\n"
"Language-Team: French <https://l10n.elementary.io/projects/desktop/gala/fr/>"
"\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -92,14 +92,13 @@ msgid "System Settings…"
msgstr "Paramètres du système…"
#: daemon/BackgroundMenu.vala:47
#, fuzzy
#| msgid "System Settings…"
msgid "Failed to open System Settings"
msgstr "Paramètres du système"
msgstr "Échec de l'ouverture de Paramètres du système"
#: daemon/BackgroundMenu.vala:48
msgid "A handler for the “settings://” URI scheme must be installed."
msgstr ""
"Un gestionnaire doit être installé pour le schéma d'URI « settings:// »."
#: daemon/WindowMenu.vala:36
msgid "Hide"
@ -180,6 +179,8 @@ msgid ""
"Changing the wallpaper or going to sleep respects the \"Reduce Motion\" "
"option"
msgstr ""
"Le changement du fond d'écran ou la mise en veille respectent l'option « "
"Réduire le mouvement »"
#: data/gala.metainfo.xml.in:33
msgid "Use appropriate drag-and-drop pointers when moving windows"
@ -189,10 +190,14 @@ msgstr ""
#: data/gala.metainfo.xml.in:34
msgid "Fix the issue when gestures in the multitasking view might stop working"
msgstr ""
"Correction d'un problème où les gestes dans la vue multitâche peuvent cesser "
"de fonctionner"
#: data/gala.metainfo.xml.in:35
msgid "Improve dynamic workspaces behaviour with multiple monitors"
msgstr ""
"Amélioration du comportement des espaces de travail dynamiques sur plusieurs "
"écrans"
#: data/gala.metainfo.xml.in:36 data/gala.metainfo.xml.in:58
#: data/gala.metainfo.xml.in:73 data/gala.metainfo.xml.in:88

View File

@ -3,10 +3,10 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
"POT-Creation-Date: 2024-02-18 02:05+0000\n"
"PO-Revision-Date: 2023-11-09 19:10+0000\n"
"PO-Revision-Date: 2024-02-22 04:12+0000\n"
"Last-Translator: Yaron Shahrabani <sh.yaron@gmail.com>\n"
"Language-Team: Hebrew <https://l10n.elementary.io/projects/desktop/gala/he/"
">\n"
"Language-Team: Hebrew <https://l10n.elementary.io/projects/desktop/gala/he/>"
"\n"
"Language: he\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -86,14 +86,12 @@ msgid "System Settings…"
msgstr "הגדרות מערכת…"
#: daemon/BackgroundMenu.vala:47
#, fuzzy
#| msgid "System Settings…"
msgid "Failed to open System Settings"
msgstr "הגדרות מערכת…"
msgstr "פתיחת הגדרות המערכת נכשלה"
#: daemon/BackgroundMenu.vala:48
msgid "A handler for the “settings://” URI scheme must be installed."
msgstr ""
msgstr "חובה להתקין מנגנון שמטפל בכתובות מהתבנית „settings://‎”."
#: daemon/WindowMenu.vala:36
msgid "Hide"

View File

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: noise\n"
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
"POT-Creation-Date: 2024-02-18 02:05+0000\n"
"PO-Revision-Date: 2023-12-17 00:10+0000\n"
"PO-Revision-Date: 2024-02-22 04:12+0000\n"
"Last-Translator: TomiOhl <ohlslager.tom@gmail.com>\n"
"Language-Team: Hungarian <https://l10n.elementary.io/projects/desktop/gala/"
"hu/>\n"
@ -91,14 +91,14 @@ msgid "System Settings…"
msgstr "Rendszerbeállítások…"
#: daemon/BackgroundMenu.vala:47
#, fuzzy
#| msgid "System Settings…"
msgid "Failed to open System Settings"
msgstr "Rendszerbeállítások…"
msgstr "A Rendszerbeállítások megnyitása sikertelen"
#: daemon/BackgroundMenu.vala:48
msgid "A handler for the “settings://” URI scheme must be installed."
msgstr ""
"Telepítve kell lennie egy alkalmazásnak, ami kezelni tudja a “settings://” "
"URI-sémákat."
#: daemon/WindowMenu.vala:36
msgid "Hide"

View File

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: noise\n"
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
"POT-Creation-Date: 2024-02-18 02:05+0000\n"
"PO-Revision-Date: 2024-02-12 08:11+0000\n"
"PO-Revision-Date: 2024-02-22 04:12+0000\n"
"Last-Translator: Ryo Nakano <ryonakaknock3@gmail.com>\n"
"Language-Team: Japanese <https://l10n.elementary.io/projects/desktop/gala/ja/"
">\n"
@ -88,14 +88,12 @@ msgid "System Settings…"
msgstr "システム設定…"
#: daemon/BackgroundMenu.vala:47
#, fuzzy
#| msgid "System Settings…"
msgid "Failed to open System Settings"
msgstr "システム設定"
msgstr "システム設定を開けませんでした"
#: daemon/BackgroundMenu.vala:48
msgid "A handler for the “settings://” URI scheme must be installed."
msgstr ""
msgstr "“settings://” URI スキーム用のハンドラーをインストールする必要があります。"
#: daemon/WindowMenu.vala:36
msgid "Hide"

View File

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: noise\n"
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
"POT-Creation-Date: 2024-02-18 02:05+0000\n"
"PO-Revision-Date: 2023-04-14 00:59+0000\n"
"PO-Revision-Date: 2024-02-22 04:12+0000\n"
"Last-Translator: NorwayFun <temuri.doghonadze@gmail.com>\n"
"Language-Team: Georgian <https://l10n.elementary.io/projects/desktop/gala/ka/"
">\n"
@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.16.4\n"
"X-Generator: Weblate 5.0.2\n"
"X-Launchpad-Export-Date: 2017-02-21 05:47+0000\n"
#: src/Dialogs.vala:152
@ -89,10 +89,8 @@ msgid "System Settings…"
msgstr "სისტემის მორგება…"
#: daemon/BackgroundMenu.vala:47
#, fuzzy
#| msgid "System Settings…"
msgid "Failed to open System Settings"
msgstr "სისტემის მორგება…"
msgstr "სისტემის მორგების ფანჯრის გახსნა ჩავარდა"
#: daemon/BackgroundMenu.vala:48
msgid "A handler for the “settings://” URI scheme must be installed."

View File

@ -8,10 +8,10 @@ msgstr ""
"Project-Id-Version: gala\n"
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
"POT-Creation-Date: 2024-02-18 02:05+0000\n"
"PO-Revision-Date: 2023-11-10 22:49+0000\n"
"Last-Translator: Marcin Serwin <marcin.serwin0@protonmail.com>\n"
"Language-Team: Polish <https://l10n.elementary.io/projects/desktop/gala/pl/"
">\n"
"PO-Revision-Date: 2024-02-23 10:12+0000\n"
"Last-Translator: Sebastian Bernat <srakap330@gmail.com>\n"
"Language-Team: Polish <https://l10n.elementary.io/projects/desktop/gala/pl/>"
"\n"
"Language: pl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -93,14 +93,12 @@ msgid "System Settings…"
msgstr "Ustawienia systemu…"
#: daemon/BackgroundMenu.vala:47
#, fuzzy
#| msgid "System Settings…"
msgid "Failed to open System Settings"
msgstr "Ustawienia systemu…"
msgstr "Nie udało się otworzyć Ustawień Systemowych"
#: daemon/BackgroundMenu.vala:48
msgid "A handler for the “settings://” URI scheme must be installed."
msgstr ""
msgstr "Odnośnik dla schematu URI \"settings://\" musi zostać zainstalowany."
#: daemon/WindowMenu.vala:36
msgid "Hide"

View File

@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: beat-box\n"
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
"POT-Creation-Date: 2024-02-18 02:05+0000\n"
"PO-Revision-Date: 2024-02-18 10:49+0000\n"
"Last-Translator: кубик круглый <megarainbow29@gmail.com>\n"
"PO-Revision-Date: 2024-02-22 04:12+0000\n"
"Last-Translator: lenemter <lenemter@gmail.com>\n"
"Language-Team: Russian <https://l10n.elementary.io/projects/desktop/gala/ru/>"
"\n"
"Language: ru\n"
@ -39,7 +39,7 @@ msgstr ""
#: src/Dialogs.vala:158
msgid "Force Quit"
msgstr "Закрыть"
msgstr "Принудительно закрыть"
#: src/Dialogs.vala:159
msgid "Wait"
@ -81,7 +81,7 @@ msgstr "Снимок экрана от %s"
#: daemon/BackgroundMenu.vala:11
msgid "Change Wallpaper…"
msgstr "Изменить обои…"
msgstr "Сменить обои…"
#: daemon/BackgroundMenu.vala:16
msgid "Display Settings…"
@ -188,7 +188,7 @@ msgstr "Соответствующие указатели перетаскива
#: data/gala.metainfo.xml.in:34
msgid "Fix the issue when gestures in the multitasking view might stop working"
msgstr ""
"Исправлена ошибка из-за которой жесты в режиме многозадачности могли "
"Исправлена ошибка, из-за которой жесты в режиме многозадачности могли "
"перестать работать"
#: data/gala.metainfo.xml.in:35

View File

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: beat-box\n"
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
"POT-Creation-Date: 2024-02-18 02:05+0000\n"
"PO-Revision-Date: 2023-11-09 19:10+0000\n"
"PO-Revision-Date: 2024-02-22 04:12+0000\n"
"Last-Translator: Ihor Hordiichuk <igor_ck@outlook.com>\n"
"Language-Team: Ukrainian <https://l10n.elementary.io/projects/desktop/gala/"
"uk/>\n"
@ -16,8 +16,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 5.0.2\n"
"X-Launchpad-Export-Date: 2017-02-21 05:47+0000\n"
@ -93,14 +93,12 @@ msgid "System Settings…"
msgstr "Налаштування системи…"
#: daemon/BackgroundMenu.vala:47
#, fuzzy
#| msgid "System Settings…"
msgid "Failed to open System Settings"
msgstr "Налаштування системи"
msgstr "Не вдалося відкрити Налаштування системи"
#: daemon/BackgroundMenu.vala:48
msgid "A handler for the “settings://” URI scheme must be installed."
msgstr ""
msgstr "Має бути встановлений обробник для схеми URI \"settings://\"."
#: daemon/WindowMenu.vala:36
msgid "Hide"

View File

@ -8,13 +8,15 @@ msgstr ""
"Project-Id-Version: gala 3.2.0\n"
"Report-Msgid-Bugs-To: https://github.com/elementary/gala/issues\n"
"POT-Creation-Date: 2024-02-18 02:05+0000\n"
"PO-Revision-Date: 2019-12-10 17:16-0800\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"PO-Revision-Date: 2024-02-22 04:12+0000\n"
"Last-Translator: Shukrullo Turgunov <shookrullo@gmail.com>\n"
"Language-Team: Uzbek <https://l10n.elementary.io/projects/desktop/gala/uz/>\n"
"Language: uz\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.0.2\n"
#: src/Dialogs.vala:152
#, c-format
@ -126,7 +128,7 @@ msgstr ""
#: daemon/WindowMenu.vala:105
msgid "Close"
msgstr ""
msgstr "Yopish"
#: daemon/WindowMenu.vala:138
msgid "Untile"

View File

@ -100,6 +100,17 @@ public class Gala.DesktopIntegration : GLib.Object {
return (owned) returned_windows;
}
public void focus_window (uint64 uid) throws GLib.DBusError, GLib.IOError {
var apps = Gala.AppSystem.get_default ().get_running_apps ();
foreach (unowned var app in apps) {
foreach (weak Meta.Window window in app.get_windows ()) {
if (window.get_id () == uid) {
window.activate (wm.get_display ().get_current_time ());
}
}
}
}
public void show_windows_for (string app_id) throws IOError, DBusError {
if (wm.window_overview == null) {
throw new IOError.FAILED ("Window overview not provided by window manager");

View File

@ -73,8 +73,14 @@ namespace Gala {
if (parent != null) {
if (parent.get_client_type () == Meta.WindowClientType.X11) {
//TODO: wayland support
#if HAS_MUTTER46
unowned Meta.Display display = parent.get_display ();
unowned Meta.X11Display x11display = display.get_x11_display ();
parent_handler = "x11:%x".printf ((uint) x11display.lookup_xwindow (parent));
#else
parent_handler = "x11:%x".printf ((uint) parent.get_xwindow ());
#endif
//TODO: wayland support
}
app_id = parent.get_sandboxed_app_id () ?? "";

View File

@ -0,0 +1,91 @@
/*
* Copyright 2024 elementary, Inc. (https://elementary.io)
* SPDX-License-Identifier: GPL-3.0-or-later
*/
/**
* A pointer barrier supporting pressured activation.
*/
public class Gala.Barrier : Meta.Barrier {
public signal void trigger ();
public bool triggered { get; set; default = false; }
public int trigger_pressure_threshold { get; construct; }
public int release_pressure_threshold { get; construct; }
public int retrigger_pressure_threshold { get; construct; }
public int retrigger_delay { get; construct; }
private uint32 triggered_time;
private double pressure;
/**
* @param trigger_pressure_threshold The amount of pixels to travel additionally for
* the barrier to trigger. Set to 0 to immediately activate.
* @param retrigger_pressure_threshold The amount of pixels to travel additionally for
* the barrier to trigger again. Set to int.MAX to disallow retrigger.
*/
public Barrier (
Meta.Display display,
int x1,
int y1,
int x2,
int y2,
Meta.BarrierDirection directions,
int trigger_pressure_threshold,
int release_pressure_threshold,
int retrigger_pressure_threshold,
int retrigger_delay
) {
Object (
display: display,
x1: x1,
y1: y1,
x2: x2,
y2: y2,
directions: directions,
trigger_pressure_threshold: trigger_pressure_threshold,
release_pressure_threshold: release_pressure_threshold,
retrigger_pressure_threshold: retrigger_pressure_threshold,
retrigger_delay: retrigger_delay
);
}
construct {
hit.connect (on_hit);
left.connect (on_left);
}
private void on_hit (Meta.BarrierEvent event) {
if (POSITIVE_X in directions || NEGATIVE_X in directions) {
pressure += event.dx.abs ();
} else {
pressure += event.dy.abs ();
}
if (!triggered && pressure > trigger_pressure_threshold) {
emit_trigger (event.time);
}
if (!triggered && pressure > release_pressure_threshold) {
release (event);
}
if (triggered && pressure.abs () > retrigger_pressure_threshold && event.time > retrigger_delay + triggered_time) {
emit_trigger (event.time);
}
}
private void emit_trigger (uint32 time) {
triggered = true;
pressure = 0;
triggered_time = time;
trigger ();
}
private void on_left () {
pressure = 0;
triggered = false;
}
}

View File

@ -16,18 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
private class Gala.Barrier : Meta.Barrier {
public bool is_hit { get; set; default = false; }
public double pressure_x { get; set; default = 0; }
public double pressure_y { get; set; default = 0; }
public Barrier (Meta.Display display, int x1, int y1, int x2, int y2, Meta.BarrierDirection directions) {
Object (display: display, x1: x1, y1: y1, x2: x2, y2: y2, directions: directions);
}
}
public class Gala.HotCorner : Object {
public const string POSITION_TOP_LEFT = "hotcorner-topleft";
public const string POSITION_TOP_RIGHT = "hotcorner-topright";
@ -59,8 +47,6 @@ public class Gala.HotCorner : Object {
private Gala.Barrier? vertical_barrier = null;
private Gala.Barrier? horizontal_barrier = null;
private bool triggered = false;
private uint32 triggered_time;
public HotCorner (Meta.Display display, float x, float y, float scale, string hot_corner_position) {
add_barriers (display, x, y, scale, hot_corner_position);
@ -82,14 +68,24 @@ public class Gala.HotCorner : Object {
var vdir = get_barrier_direction (hot_corner_position, Clutter.Orientation.VERTICAL);
var hdir = get_barrier_direction (hot_corner_position, Clutter.Orientation.HORIZONTAL);
vertical_barrier = new Gala.Barrier (display, vrect.x, vrect.y, vrect.x + vrect.width, vrect.y + vrect.height, vdir);
horizontal_barrier = new Gala.Barrier (display, hrect.x, hrect.y, hrect.x + hrect.width, hrect.y + hrect.height, hdir);
vertical_barrier = new Gala.Barrier (
display, vrect.x, vrect.y, vrect.x + vrect.width, vrect.y + vrect.height, vdir,
TRIGGER_PRESSURE_THRESHOLD,
RELEASE_PRESSURE_THRESHOLD,
RETRIGGER_PRESSURE_THRESHOLD,
RETRIGGER_DELAY
);
vertical_barrier.hit.connect ((event) => on_barrier_hit (vertical_barrier, event));
horizontal_barrier.hit.connect ((event) => on_barrier_hit (horizontal_barrier, event));
horizontal_barrier = new Gala.Barrier (
display, hrect.x, hrect.y, hrect.x + hrect.width, hrect.y + hrect.height, hdir,
TRIGGER_PRESSURE_THRESHOLD,
RELEASE_PRESSURE_THRESHOLD,
RETRIGGER_PRESSURE_THRESHOLD,
RETRIGGER_DELAY
);
vertical_barrier.left.connect ((event) => on_barrier_left (vertical_barrier, event));
horizontal_barrier.left.connect ((event) => on_barrier_left (horizontal_barrier, event));
vertical_barrier.trigger.connect (on_barrier_trigger);
horizontal_barrier.trigger.connect (on_barrier_trigger);
}
private static Meta.BarrierDirection get_barrier_direction (string hot_corner_position, Clutter.Orientation orientation) {
@ -143,48 +139,9 @@ public class Gala.HotCorner : Object {
return { x1, y1, x2 - x1, y2 - y1 };
}
private void on_barrier_hit (Gala.Barrier barrier, Meta.BarrierEvent event) {
barrier.is_hit = true;
barrier.pressure_x += event.dx;
barrier.pressure_y += event.dy;
var pressure = (barrier == vertical_barrier) ?
barrier.pressure_x.abs () :
barrier.pressure_y.abs ();
if (!triggered && vertical_barrier.is_hit && horizontal_barrier.is_hit) {
if (pressure.abs () > TRIGGER_PRESSURE_THRESHOLD) {
trigger_hot_corner ();
pressure = 0;
triggered_time = event.time;
}
private void on_barrier_trigger () {
if (vertical_barrier.triggered && horizontal_barrier.triggered) {
trigger ();
}
if (!triggered && pressure.abs () > RELEASE_PRESSURE_THRESHOLD) {
barrier.release (event);
}
if (triggered && pressure.abs () > RETRIGGER_PRESSURE_THRESHOLD && event.time > RETRIGGER_DELAY + triggered_time) {
trigger_hot_corner ();
}
}
private void on_barrier_left (Gala.Barrier barrier, Meta.BarrierEvent event) {
barrier.is_hit = false;
barrier.pressure_x = 0;
barrier.pressure_y = 0;
if (!vertical_barrier.is_hit && !horizontal_barrier.is_hit) {
triggered = false;
}
}
private void trigger_hot_corner () {
triggered = true;
vertical_barrier.pressure_x = 0;
vertical_barrier.pressure_y = 0;
horizontal_barrier.pressure_x = 0;
horizontal_barrier.pressure_y = 0;
trigger ();
}
}

View File

@ -51,7 +51,11 @@ public class Gala.KeyboardManager : Object {
[CCode (instance_pos = -1)]
public static bool handle_modifiers_accelerator_activated (Meta.Display display, bool backward) {
#if HAS_MUTTER46
display.get_compositor ().backend.ungrab_keyboard (display.get_current_time ());
#else
display.ungrab_keyboard (display.get_current_time ());
#endif
var sources = settings.get_value ("sources");
if (!sources.is_of_type (sources_variant_type)) {
@ -116,7 +120,12 @@ public class Gala.KeyboardManager : Object {
var variant = string.joinv (",", variants);
var options = string.joinv (",", xkb_options);
#if HAS_MUTTER46
//TODO: add model support
display.get_context ().get_backend ().set_keymap (layout, variant, options, "");
#else
display.get_context ().get_backend ().set_keymap (layout, variant, options);
#endif
} else if (key == "current") {
display.get_context ().get_backend ().lock_layout_group (settings.get_uint ("current"));
}

View File

@ -65,7 +65,11 @@ namespace Gala {
var flash_actor = new Clutter.Actor ();
flash_actor.set_size (width, height);
flash_actor.set_position (x, y);
#if HAS_MUTTER46
flash_actor.set_background_color (Clutter.Color.from_pixel (0xffffffffu));
#else
flash_actor.set_background_color (Clutter.Color.get_static (Clutter.StaticColor.WHITE));
#endif
flash_actor.set_opacity (0);
flash_actor.transitions_completed.connect ((actor) => {
wm.ui_group.remove_child (actor);

View File

@ -10,7 +10,7 @@ namespace Gala {
* It also decides whether to draw the container shape, a plus sign or an ellipsis.
* Lastly it also includes the drawing code for the active highlight.
*/
public class IconGroup : Clutter.Actor {
public class IconGroup : CanvasActor {
public const int SIZE = 64;
private const int PLUS_SIZE = 6;
@ -47,7 +47,7 @@ namespace Gala {
set {
if (value != _scale_factor) {
_scale_factor = value;
resize_canvas ();
resize ();
}
}
}
@ -62,10 +62,6 @@ namespace Gala {
construct {
reactive = true;
var canvas = new Clutter.Canvas ();
canvas.draw.connect (draw);
content = canvas;
drag_action = new DragDropAction (DragDropActionType.SOURCE | DragDropActionType.DESTINATION, "multitaskingview-window");
drag_action.actor_clicked.connect (() => selected ());
drag_action.drag_begin.connect (drag_begin);
@ -80,8 +76,7 @@ namespace Gala {
add_child (icon_container);
resize_canvas ();
resize ();
#if HAS_MUTTER46
icon_container.child_removed.connect_after (redraw);
#else
@ -97,13 +92,11 @@ namespace Gala {
#endif
}
private bool resize_canvas () {
private void resize () {
var size = InternalUtils.scale_to_int (SIZE, scale_factor);
width = size;
height = size;
return ((Clutter.Canvas) content).set_size (size, size);
}
/**
@ -206,16 +199,14 @@ namespace Gala {
* Trigger a redraw
*/
public void redraw () {
if (!resize_canvas ()) {
content.invalidate ();
}
content.invalidate ();
}
/**
* Draw the background or plus sign and do layouting. We won't lose performance here
* by relayouting in the same function, as it's only ever called when we invalidate it.
*/
private bool draw (Cairo.Context cr) {
protected override void draw (Cairo.Context cr, int cr_width, int cr_height) {
clear_effects ();
cr.set_operator (Cairo.Operator.CLEAR);
cr.paint ();
@ -228,7 +219,7 @@ namespace Gala {
var icon = (WindowIconActor) icon_container.get_child_at_index (0);
icon.place (0, 0, 64, scale_factor);
return false;
return;
}
// more than one => we need a folder
@ -236,8 +227,8 @@ namespace Gala {
cr,
0,
0,
(int) width,
(int) height,
width,
height,
InternalUtils.scale_to_int (5, scale_factor)
);
@ -289,7 +280,7 @@ namespace Gala {
if (n_windows < 1) {
if (!Meta.Prefs.get_dynamic_workspaces ()
|| workspace_index != manager.get_n_workspaces () - 1)
return false;
return;
var buffer = new Drawing.BufferSurface (scaled_size, scaled_size);
var offset = scaled_size / 2 - InternalUtils.scale_to_int (PLUS_WIDTH, scale_factor) / 2;
@ -330,7 +321,7 @@ namespace Gala {
cr.set_source_surface (buffer.surface, 0, 0);
cr.paint ();
return false;
return;
}
int size;
@ -390,8 +381,6 @@ namespace Gala {
y += InternalUtils.scale_to_int (size, scale_factor) + spacing;
}
}
return false;
}
private Clutter.Actor? drag_begin (float click_x, float click_y) {

View File

@ -16,7 +16,7 @@
//
namespace Gala {
public class SelectionArea : Clutter.Actor {
public class SelectionArea : CanvasActor {
public signal void closed ();
public WindowManager wm { get; construct; }
@ -43,13 +43,6 @@ namespace Gala {
wm.get_display ().get_size (out screen_width, out screen_height);
width = screen_width;
height = screen_height;
var canvas = new Clutter.Canvas ();
canvas.set_size (screen_width, screen_height);
canvas.draw.connect (draw_area);
set_content (canvas);
canvas.invalidate ();
}
#if HAS_MUTTER45
@ -155,7 +148,7 @@ namespace Gala {
}.expand (end_point);
}
private bool draw_area (Cairo.Context ctx) {
protected override void draw (Cairo.Context ctx, int width, int height) {
ctx.save ();
ctx.set_operator (Cairo.Operator.CLEAR);
@ -164,7 +157,7 @@ namespace Gala {
ctx.restore ();
if (!dragging) {
return true;
return;
}
ctx.translate (0.5, 0.5);
@ -178,8 +171,6 @@ namespace Gala {
ctx.set_source_rgb (0.7, 0.7, 0.7);
ctx.set_line_width (1.0);
ctx.stroke ();
return true;
}
}
}

View File

@ -7,26 +7,11 @@
/**
* Clutter actor to display text in a tooltip-like component.
*/
public class Gala.Tooltip : Clutter.Actor {
private static Clutter.Color text_color;
private static Gtk.Border padding;
private static Gtk.StyleContext style_context;
/**
* Canvas to draw the Tooltip background.
*/
private Clutter.Canvas background_canvas;
public class Gala.Tooltip : CanvasActor {
/**
* Actor to display the Tooltip text.
*/
private Clutter.Text? text_actor = null;
/**
* Text displayed in the Tooltip.
* @see set_text
*/
private string text;
private Clutter.Text text_actor;
/**
* Maximum width of the Tooltip.
@ -35,102 +20,49 @@ public class Gala.Tooltip : Clutter.Actor {
public float max_width;
construct {
text = "";
max_width = 200;
background_canvas = new Clutter.Canvas ();
background_canvas.draw.connect (draw_background);
content = background_canvas;
draw ();
}
private static void create_gtk_objects () {
var tooltip_widget_path = new Gtk.WidgetPath ();
var pos = tooltip_widget_path.append_type (typeof (Gtk.Window));
tooltip_widget_path.iter_set_object_name (pos, "tooltip");
tooltip_widget_path.iter_add_class (pos, Gtk.STYLE_CLASS_CSD);
tooltip_widget_path.iter_add_class (pos, Gtk.STYLE_CLASS_BACKGROUND);
style_context = new Gtk.StyleContext ();
style_context.set_path (tooltip_widget_path);
padding = style_context.get_padding (Gtk.StateFlags.NORMAL);
tooltip_widget_path.append_type (typeof (Gtk.Label));
var label_style_context = new Gtk.StyleContext ();
label_style_context.set_path (tooltip_widget_path);
var text_rgba = (Gdk.RGBA) label_style_context.get_property (
Gtk.STYLE_PROPERTY_COLOR,
Gtk.StateFlags.NORMAL
);
text_color = Clutter.Color () {
red = (uint8) text_rgba.red * uint8.MAX,
green = (uint8) text_rgba.green * uint8.MAX,
blue = (uint8) text_rgba.blue * uint8.MAX,
alpha = (uint8) text_rgba.alpha * uint8.MAX,
Clutter.Color text_color = {
(uint8) Drawing.Color.TOOLTIP_TEXT_COLOR.red * uint8.MAX,
(uint8) Drawing.Color.TOOLTIP_TEXT_COLOR.green * uint8.MAX,
(uint8) Drawing.Color.TOOLTIP_TEXT_COLOR.blue * uint8.MAX,
(uint8) Drawing.Color.TOOLTIP_TEXT_COLOR.alpha * uint8.MAX,
};
}
public void set_text (string new_text, bool redraw = true) {
text = new_text;
if (redraw) {
draw ();
}
}
public void set_max_width (float new_max_width, bool redraw = true) {
max_width = new_max_width;
if (redraw) {
draw ();
}
}
private void draw () {
visible = (text.length != 0);
if (!visible) {
return;
}
// First set the text
if (text_actor != null) {
remove_child (text_actor);
}
text_actor = new Clutter.Text () {
color = text_color,
x = padding.left,
y = padding.top,
ellipsize = Pango.EllipsizeMode.MIDDLE
margin_left = 6,
margin_top = 6,
margin_bottom = 6,
margin_right = 6,
ellipsize = Pango.EllipsizeMode.MIDDLE,
color = text_color
};
text_actor.text = text;
if ((text_actor.width + padding.left + padding.right) > max_width) {
text_actor.width = max_width - padding.left - padding.right;
}
add_child (text_actor);
// Adjust the size of the tooltip to the text
width = text_actor.width + padding.left + padding.right;
height = text_actor.height + padding.top + padding.bottom;
background_canvas.set_size ((int) width, (int) height);
// And paint the background
background_canvas.invalidate ();
layout_manager = new Clutter.BinLayout ();
}
private static bool draw_background (Cairo.Context ctx, int width, int height) {
if (style_context == null) {
create_gtk_objects ();
public void set_text (string new_text) {
text_actor.text = new_text;
}
public void set_max_width (float new_max_width) {
max_width = new_max_width;
queue_relayout ();
}
protected override void allocate (Clutter.ActorBox box) {
if (box.get_width () > max_width) {
box.set_origin (box.get_x () + ((box.get_width () - max_width) / 2), box.get_y ());
box.set_size (max_width, box.get_height ());
}
base.allocate (box);
}
protected override void draw (Cairo.Context ctx, int width, int height) {
ctx.save ();
ctx.set_operator (Cairo.Operator.CLEAR);
ctx.paint ();
@ -138,10 +70,17 @@ public class Gala.Tooltip : Clutter.Actor {
ctx.reset_clip ();
ctx.set_operator (Cairo.Operator.OVER);
style_context.render_background (ctx, 0, 0, width, height);
var background_color = Drawing.Color.TOOLTIP_BACKGROUND;
ctx.set_source_rgba (
background_color.red,
background_color.green,
background_color.blue,
background_color.alpha
);
Drawing.Utilities.cairo_rounded_rectangle (ctx, 0, 0, width, height, 4);
ctx.fill ();
ctx.restore ();
return false;
}
}

View File

@ -541,7 +541,7 @@ public class Gala.WindowClone : Clutter.Actor {
close_button.opacity = show ? 255 : 0;
window_title.opacity = close_button.opacity;
window_title.set_text (window.get_title () ?? "", false);
window_title.set_text (window.get_title () ?? "");
window_title.set_max_width (dest_width - InternalUtils.scale_to_int (TITLE_MAX_WIDTH_MARGIN, scale_factor));
set_window_title_position (dest_width, dest_height, scale_factor);
}
@ -866,46 +866,21 @@ public class Gala.WindowClone : Clutter.Actor {
/**
* Border to show around the selected window when using keyboard navigation.
*/
private class ActiveShape : Clutter.Actor {
private static int border_radius = -1;
private class ActiveShape : CanvasActor {
private const int BORDER_RADIUS = 16;
private const double COLOR_OPACITY = 0.8;
private Clutter.Canvas background_canvas;
construct {
background_canvas = new Clutter.Canvas ();
background_canvas.draw.connect (draw_background);
content = background_canvas;
notify["opacity"].connect (invalidate);
}
private void create_gtk_objects () {
var label_widget_path = new Gtk.WidgetPath ();
label_widget_path.append_type (typeof (Gtk.Label));
var style_context = new Gtk.StyleContext ();
style_context.add_class (Granite.STYLE_CLASS_CARD);
style_context.add_class (Granite.STYLE_CLASS_ROUNDED);
style_context.set_path (label_widget_path);
border_radius = style_context.get_property (
Gtk.STYLE_PROPERTY_BORDER_RADIUS,
Gtk.StateFlags.NORMAL
).get_int () * 4;
}
public void invalidate () {
background_canvas.invalidate ();
content.invalidate ();
}
private bool draw_background (Cairo.Context cr, int width, int height) {
if (border_radius == -1) {
create_gtk_objects ();
}
protected override void draw (Cairo.Context cr, int width, int height) {
if (!visible || opacity == 0) {
return Clutter.EVENT_PROPAGATE;
return;
}
var color = InternalUtils.get_theme_accent_color ();
@ -915,18 +890,9 @@ public class Gala.WindowClone : Clutter.Actor {
cr.paint ();
cr.restore ();
Drawing.Utilities.cairo_rounded_rectangle (cr, 0, 0, width, height, border_radius);
Drawing.Utilities.cairo_rounded_rectangle (cr, 0, 0, width, height, BORDER_RADIUS);
cr.set_source_rgba (color.red, color.green, color.blue, COLOR_OPACITY);
cr.fill ();
return Clutter.EVENT_PROPAGATE;
}
public override void allocate (Clutter.ActorBox box) {
base.allocate (box);
background_canvas.set_size ((int) box.get_width (), (int) box.get_height ());
invalidate ();
}
}
}

View File

@ -7,7 +7,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
public class Gala.WindowSwitcher : Clutter.Actor {
public class Gala.WindowSwitcher : CanvasActor {
public const int ICON_SIZE = 64;
public const int WRAPPER_PADDING = 12;
@ -25,13 +25,9 @@ public class Gala.WindowSwitcher : Clutter.Actor {
private int modifier_mask;
private Gala.ModalProxy modal_proxy = null;
private Granite.Settings granite_settings;
private Clutter.Canvas canvas;
private Clutter.Actor container;
private Clutter.Text caption;
private Gtk.WidgetPath widget_path;
private Gtk.StyleContext style_context;
private unowned Gtk.CssProvider? dark_style_provider = null;
private ShadowEffect shadow_effect;
private WindowSwitcherIcon? _current_icon = null;
private WindowSwitcherIcon? current_icon {
@ -65,123 +61,115 @@ public class Gala.WindowSwitcher : Clutter.Actor {
unowned var gtk_settings = Gtk.Settings.get_default ();
granite_settings = Granite.Settings.get_default ();
unowned var display = wm.get_display ();
scaling_factor = display.get_monitor_scale (display.get_current_monitor ());
canvas = new Clutter.Canvas ();
canvas.scale_factor = scaling_factor;
set_content (canvas);
opacity = 0;
// Carry out the initial draw
create_components ();
var effect = new ShadowEffect (40) {
shadow_opacity = 200,
css_class = "window-switcher",
scale_factor = scaling_factor
container = new Clutter.Actor () {
reactive = true,
#if HAS_MUTTER46
layout_manager = new Clutter.FlowLayout (Clutter.Orientation.HORIZONTAL)
#else
layout_manager = new Clutter.FlowLayout (Clutter.FlowOrientation.HORIZONTAL)
#endif
};
add_effect (effect);
caption = new Clutter.Text () {
font_name = CAPTION_FONT_NAME,
ellipsize = END,
line_alignment = CENTER
};
add_child (container);
add_child (caption);
opacity = 0;
layout_manager = new Clutter.BoxLayout () {
orientation = VERTICAL
};
shadow_effect = new ShadowEffect (40) {
shadow_opacity = 200,
css_class = "window-switcher"
};
add_effect (shadow_effect);
scale ();
container.button_release_event.connect (container_mouse_release);
// Redraw the components if the colour scheme changes.
granite_settings.notify["prefers-color-scheme"].connect (() => {
canvas.invalidate ();
create_components ();
});
granite_settings.notify["prefers-color-scheme"].connect (content.invalidate);
gtk_settings.notify["gtk-theme-name"].connect (() => {
canvas.invalidate ();
create_components ();
});
gtk_settings.notify["gtk-theme-name"].connect (content.invalidate);
unowned var monitor_manager = wm.get_display ().get_context ().get_backend ().get_monitor_manager ();
monitor_manager.monitors_changed.connect (() => {
var cur_scale = display.get_monitor_scale (display.get_current_monitor ());
if (cur_scale != scaling_factor) {
scaling_factor = cur_scale;
canvas.scale_factor = scaling_factor;
effect.scale_factor = scaling_factor;
create_components ();
}
});
canvas.draw.connect (draw);
monitor_manager.monitors_changed.connect (scale);
}
private bool draw (Cairo.Context ctx, int width, int height) {
if (style_context == null) { // gtk is not initialized yet
create_gtk_objects ();
private void scale () {
scaling_factor = wm.get_display ().get_monitor_scale (wm.get_display ().get_current_monitor ());
shadow_effect.scale_factor = scaling_factor;
var margin = InternalUtils.scale_to_int (WRAPPER_PADDING, scaling_factor);
container.margin_left = margin;
container.margin_right = margin;
container.margin_bottom = margin;
container.margin_top = margin;
caption.margin_left = margin;
caption.margin_right = margin;
caption.margin_bottom = margin;
}
protected override void get_preferred_width (float for_height, out float min_width, out float natural_width) {
min_width = 0;
float preferred_nat_width;
base.get_preferred_width (for_height, null, out preferred_nat_width);
unowned var display = wm.get_display ();
var monitor = display.get_current_monitor ();
var geom = display.get_monitor_geometry (monitor);
float container_nat_width;
container.get_preferred_size (null, null, out container_nat_width, null);
var max_width = float.min (
geom.width - InternalUtils.scale_to_int (MIN_OFFSET, scaling_factor) * 2, //Don't overflow the monitor
container_nat_width //Ellipsize the label if it's longer than the icons
);
natural_width = float.min (max_width, preferred_nat_width);
}
protected override void draw (Cairo.Context ctx, int width, int height) {
var caption_color = "#2e2e31";
if (granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK) {
caption_color = "#fafafa";
}
caption.color = Clutter.Color.from_string (caption_color);
ctx.save ();
ctx.set_operator (Cairo.Operator.CLEAR);
ctx.paint ();
ctx.clip ();
ctx.reset_clip ();
var background_color = Drawing.Color.LIGHT_BACKGROUND;
if (granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK) {
unowned var gtksettings = Gtk.Settings.get_default ();
dark_style_provider = Gtk.CssProvider.get_named (gtksettings.gtk_theme_name, "dark");
style_context.add_provider (dark_style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
} else if (dark_style_provider != null) {
style_context.remove_provider (dark_style_provider);
dark_style_provider = null;
background_color = Drawing.Color.DARK_BACKGROUND;
}
ctx.set_operator (Cairo.Operator.OVER);
style_context.render_background (ctx, 0, 0, width, height);
style_context.render_frame (ctx, 0, 0, width, height);
ctx.set_operator (Cairo.Operator.SOURCE);
ctx.set_source_rgba (
background_color.red,
background_color.green,
background_color.blue,
background_color.alpha
);
Drawing.Utilities.cairo_rounded_rectangle (ctx, 0, 0, width, height, InternalUtils.scale_to_int (6, scaling_factor));
ctx.fill ();
ctx.restore ();
return true;
}
private void create_components () {
// We've already been constructed once, start again
if (container != null) {
destroy_all_children ();
}
var margin = InternalUtils.scale_to_int (WRAPPER_PADDING, scaling_factor);
var layout = new Clutter.FlowLayout (Clutter.FlowOrientation.HORIZONTAL);
container = new Clutter.Actor () {
reactive = true,
layout_manager = layout,
margin_left = margin,
margin_top = margin,
margin_right = margin,
margin_bottom = margin
};
container.button_release_event.connect (container_mouse_release);
var caption_color = "#2e2e31";
if (granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK) {
caption_color = "#fafafa";
}
caption = new Clutter.Text.full (CAPTION_FONT_NAME, "", Clutter.Color.from_string (caption_color));
caption.set_pivot_point (0.5f, 0.5f);
caption.set_ellipsize (Pango.EllipsizeMode.END);
caption.set_line_alignment (Pango.Alignment.CENTER);
add_child (container);
add_child (caption);
}
private void create_gtk_objects () {
widget_path = new Gtk.WidgetPath ();
widget_path.append_type (typeof (Gtk.Window));
widget_path.iter_set_object_name (-1, "window");
style_context = new Gtk.StyleContext ();
style_context.set_scale ((int)Math.round (scaling_factor));
style_context.set_path (widget_path);
style_context.add_class ("background");
style_context.add_class ("csd");
style_context.add_class ("unified");
}
[CCode (instance_pos = -1)]
@ -282,8 +270,7 @@ public class Gala.WindowSwitcher : Clutter.Actor {
current_icon = null;
}
container.width = -1;
container.destroy_all_children ();
container.remove_all_children ();
foreach (unowned var window in windows) {
var icon = new WindowSwitcherIcon (window, ICON_SIZE, scaling_factor);
@ -309,8 +296,7 @@ public class Gala.WindowSwitcher : Clutter.Actor {
return false;
}
container.width = -1;
container.destroy_all_children ();
container.remove_all_children ();
unowned var window_tracker = ((WindowManagerGala) wm).window_tracker;
var app = window_tracker.get_app_for_window (current_window);
@ -350,38 +336,19 @@ public class Gala.WindowSwitcher : Clutter.Actor {
return;
}
opacity = 0;
float width, height;
get_preferred_size (null, null, out width, out height);
unowned var display = wm.get_display ();
var monitor = display.get_current_monitor ();
var geom = display.get_monitor_geometry (monitor);
float container_width;
container.get_preferred_width (
InternalUtils.scale_to_int (ICON_SIZE, scaling_factor) + container.margin_left + container.margin_right,
null,
out container_width
);
if (container_width + InternalUtils.scale_to_int (MIN_OFFSET, scaling_factor) * 2 > geom.width) {
container.width = geom.width - InternalUtils.scale_to_int (MIN_OFFSET, scaling_factor) * 2;
}
float nat_width, nat_height;
container.get_preferred_size (null, null, out nat_width, out nat_height);
var switcher_height = (int) (nat_height + caption.height / 2 - container.margin_bottom + WRAPPER_PADDING * 3 * scaling_factor);
set_size ((int) nat_width, switcher_height);
canvas.set_size ((int) nat_width, switcher_height);
canvas.invalidate ();
// container width might have changed, so we must update caption width too
update_caption_text ();
set_position (
(int) (geom.x + (geom.width - width) / 2),
(int) (geom.y + (geom.height - height) / 2)
);
opacity = 0;
toggle_display (true);
}
@ -480,13 +447,6 @@ public class Gala.WindowSwitcher : Clutter.Actor {
var current_window = current_icon != null ? current_icon.window : null;
var current_caption = current_window != null ? current_window.title : "n/a";
caption.set_text (current_caption);
// Make caption smaller than the wrapper, so it doesn't overflow.
caption.width = width - WRAPPER_PADDING * 2 * scaling_factor;
caption.set_position (
InternalUtils.scale_to_int (WRAPPER_PADDING, scaling_factor),
(int) (height - caption.height / 2 - InternalUtils.scale_to_int (WRAPPER_PADDING, scaling_factor) * 2)
);
}
public override void key_focus_out () {

View File

@ -3,13 +3,12 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
public class Gala.WindowSwitcherIcon : Clutter.Actor {
public class Gala.WindowSwitcherIcon : CanvasActor {
private const int WRAPPER_BORDER_RADIUS = 3;
public Meta.Window window { get; construct; }
private WindowIcon icon;
private Clutter.Canvas canvas;
private bool _selected = false;
public bool selected {
@ -18,7 +17,7 @@ public class Gala.WindowSwitcherIcon : Clutter.Actor {
}
set {
_selected = value;
canvas.invalidate ();
content.invalidate ();
}
}
@ -29,10 +28,8 @@ public class Gala.WindowSwitcherIcon : Clutter.Actor {
}
set {
_scale_factor = value;
canvas.scale_factor = _scale_factor;
update_size ();
canvas.invalidate ();
}
}
@ -43,10 +40,6 @@ public class Gala.WindowSwitcherIcon : Clutter.Actor {
icon.add_constraint (new Clutter.AlignConstraint (this, Clutter.AlignAxis.BOTH, 0.5f));
add_child (icon);
canvas = new Clutter.Canvas ();
canvas.draw.connect (draw_background);
set_content (canvas);
reactive = true;
this.scale_factor = scale_factor;
@ -58,10 +51,9 @@ public class Gala.WindowSwitcherIcon : Clutter.Actor {
scale_factor
);
set_size (indicator_size, indicator_size);
canvas.set_size (indicator_size, indicator_size);
}
private bool draw_background (Cairo.Context ctx, int width, int height) {
protected override void draw (Cairo.Context ctx, int width, int height) {
ctx.save ();
ctx.set_operator (Cairo.Operator.CLEAR);
ctx.paint ();
@ -84,7 +76,5 @@ public class Gala.WindowSwitcherIcon : Clutter.Actor {
ctx.restore ();
}
return true;
}
}

View File

@ -86,7 +86,7 @@ namespace Gala {
debug (e.message);
}
var color = Cogl.Color.from_4ub (255, 255, 255, 25);
var color = Cogl.Color.from_4f (1.0f, 1.0f, 1.0f, 25.0f / 255.0f);
color.premultiply ();
pipeline.set_color (color);

View File

@ -0,0 +1,30 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* SPDX-FileCopyrightText: 2024 elementary, Inc. (https://elementary.io)
*/
public class Gala.WindowGrabTracker : GLib.Object {
public Meta.Display display { get; construct; }
public Meta.Window? current_window { get; private set; }
public WindowGrabTracker (Meta.Display display) {
Object (display: display);
}
construct {
display.grab_op_begin.connect (on_grab_op_begin);
display.grab_op_end.connect (on_grab_op_end);
}
private void on_grab_op_begin (Meta.Window window, Meta.GrabOp op) {
if (op != MOVING) {
return;
}
current_window = window;
}
private void on_grab_op_end (Meta.Window window, Meta.GrabOp op) {
current_window = null;
}
}

View File

@ -85,6 +85,8 @@ namespace Gala {
private ManagedClient notifications_server;
private WindowGrabTracker window_grab_tracker;
private NotificationStack notification_stack;
private Gee.LinkedList<ModalProxy> modal_stack = new Gee.LinkedList<ModalProxy> ();
@ -141,6 +143,7 @@ namespace Gala {
public override void start () {
daemon_manager = new DaemonManager (get_display ());
window_grab_tracker = new WindowGrabTracker (get_display ());
notifications_server = new ManagedClient (get_display (), {"io.elementary.notifications"});
@ -702,9 +705,21 @@ namespace Gala {
uint fade_out_duration = 900U;
double[] op_keyframes = { 0.1, 0.9 };
GLib.Value[] opacity = { 20U, 20U };
#if HAS_MUTTER46
unowned Meta.Display display = get_display ();
unowned Meta.X11Display x11display = display.get_x11_display ();
var bottom_xwin = x11display.lookup_xwindow (bottom_window);
#else
var bottom_xwin = bottom_window.get_xwindow ();
#endif
workspace.list_windows ().@foreach ((window) => {
if (window.get_xwindow () == bottom_window.get_xwindow ()
#if HAS_MUTTER46
var xwin = x11display.lookup_xwindow (window);
#else
var xwin = window.get_xwindow ();
#endif
if (xwin == bottom_xwin
|| !InternalUtils.get_window_is_normal (window)
|| window.minimized) {
return;
@ -851,38 +866,27 @@ namespace Gala {
return (proxy in modal_stack);
}
private HashTable<Meta.Window, unowned Meta.WindowActor> dim_table =
new HashTable<Meta.Window, unowned Meta.WindowActor> (GLib.direct_hash, GLib.direct_equal);
private void dim_parent_window (Meta.Window window, bool dim) {
unowned var transient = window.get_transient_for ();
if (transient != null && transient != window) {
unowned var transient_actor = (Meta.WindowActor) transient.get_compositor_private ();
// Can't rely on win.has_effects since other effects could be applied
if (dim) {
if (window.window_type == Meta.WindowType.MODAL_DIALOG) {
var dark_effect = new Clutter.BrightnessContrastEffect ();
dark_effect.set_brightness (-0.4f);
transient_actor.add_effect_with_name ("dim-parent", dark_effect);
dim_table[window] = transient_actor;
}
} else if (transient_actor.get_effect ("dim-parent") != null) {
transient_actor.remove_effect_by_name ("dim-parent");
dim_table.remove (window);
}
private void dim_parent_window (Meta.Window window) {
if (window.window_type != MODAL_DIALOG) {
return;
}
if (!dim) {
// fall back to dim_data (see https://github.com/elementary/gala/issues/1331)
unowned var transient_actor = dim_table.take (window);
if (transient_actor != null) {
transient_actor.remove_effect_by_name ("dim-parent");
debug ("Removed dim using dim_data");
}
unowned var transient = window.get_transient_for ();
if (transient == null || transient == window) {
warning ("No transient found");
return;
}
unowned var transient_actor = (Meta.WindowActor) transient.get_compositor_private ();
var dark_effect = new Clutter.BrightnessContrastEffect ();
dark_effect.set_brightness (-0.4f);
transient_actor.add_effect_with_name ("dim-parent", dark_effect);
window.unmanaged.connect (() => {
if (transient_actor != null && transient_actor.get_effect ("dim-parent") != null) {
transient_actor.remove_effect_by_name ("dim-parent");
}
});
}
/**
@ -918,7 +922,9 @@ namespace Gala {
break;
case ActionType.START_MOVE_CURRENT:
if (current != null && current.allows_move ())
#if HAS_MUTTER44
#if HAS_MUTTER46
current.begin_grab_op (Meta.GrabOp.KEYBOARD_MOVING, null, null, Gtk.get_current_event_time (), null);
#elif HAS_MUTTER44
current.begin_grab_op (Meta.GrabOp.KEYBOARD_MOVING, null, null, Gtk.get_current_event_time ());
#else
current.begin_grab_op (Meta.GrabOp.KEYBOARD_MOVING, true, Gtk.get_current_event_time ());
@ -926,7 +932,9 @@ namespace Gala {
break;
case ActionType.START_RESIZE_CURRENT:
if (current != null && current.allows_resize ())
#if HAS_MUTTER44
#if HAS_MUTTER46
current.begin_grab_op (Meta.GrabOp.KEYBOARD_RESIZING_UNKNOWN, null, null, Gtk.get_current_event_time (), null);
#elif HAS_MUTTER44
current.begin_grab_op (Meta.GrabOp.KEYBOARD_RESIZING_UNKNOWN, null, null, Gtk.get_current_event_time ());
#else
current.begin_grab_op (Meta.GrabOp.KEYBOARD_RESIZING_UNKNOWN, true, Gtk.get_current_event_time ());
@ -1566,7 +1574,7 @@ namespace Gala {
}
});
dim_parent_window (window, true);
dim_parent_window (window);
break;
default:
@ -1662,8 +1670,6 @@ namespace Gala {
destroy_completed (actor);
});
dim_parent_window (window, false);
break;
case Meta.WindowType.MENU:
case Meta.WindowType.DROPDOWN_MENU:
@ -1947,21 +1953,37 @@ namespace Gala {
clutter_actor_reparent (moving_actor, static_windows);
}
unowned var grabbed_window = window_grab_tracker.current_window;
if (grabbed_window != null) {
unowned var moving_actor = (Meta.WindowActor) grabbed_window.get_compositor_private ();
windows.prepend (moving_actor);
parents.prepend (moving_actor.get_parent ());
moving_actor.set_translation (-clone_offset_x, -clone_offset_y, 0);
clutter_actor_reparent (moving_actor, static_windows);
}
var to_has_fullscreened = false;
var from_has_fullscreened = false;
var docks = new List<Meta.WindowActor> ();
// collect all windows and put them in the appropriate containers
foreach (unowned Meta.WindowActor actor in display.get_window_actors ()) {
if (actor.is_destroyed ())
if (actor.is_destroyed ()) {
continue;
}
unowned Meta.Window window = actor.get_meta_window ();
unowned var window = actor.get_meta_window ();
if (!window.showing_on_its_workspace () ||
(move_primary_only && !window.is_on_primary_monitor ()) ||
(moving != null && window == moving))
move_primary_only && !window.is_on_primary_monitor () ||
window == moving ||
window == grabbed_window) {
continue;
}
if (window.on_all_workspaces) {
// only collect docks here that need to be displayed on both workspaces

View File

@ -170,7 +170,16 @@ public class Gala.WindowTracker : GLib.Object {
}
private unowned Gala.App? get_app_from_window_group (Meta.Window window) {
if (window.get_client_type () != Meta.WindowClientType.X11) {
//TODO: Implement it for wayland
return null;
}
#if HAS_MUTTER46
unowned Meta.Group? group = window.x11_get_group ();
#else
unowned Meta.Group? group = window.get_group ();
#endif
if (group == null) {
return null;
}

View File

@ -14,6 +14,7 @@ gala_bin_sources = files(
'ScreenSaverManager.vala',
'ScreenshotManager.vala',
'SessionManager.vala',
'WindowGrabTracker.vala',
'WindowListener.vala',
'WindowManager.vala',
'WindowStateSaver.vala',
@ -36,6 +37,7 @@ gala_bin_sources = files(
'Gestures/GestureTracker.vala',
'Gestures/ScrollBackend.vala',
'Gestures/ToucheggBackend.vala',
'HotCorners/Barrier.vala',
'HotCorners/HotCorner.vala',
'HotCorners/HotCornerManager.vala',
'Widgets/DwellClickTimer.vala',

View File

@ -10,8 +10,6 @@ Perspective struct
Actor
.apply_transform.matrix ref
.get_abs_allocation_vertices.verts out=false
Canvas
.new symbol_type="constructor"
Event.type#method name="get_type"
Image
.new symbol_type="constructor"
@ -77,9 +75,6 @@ ActorBox
Margin
.new skip
// Struct return values
color_get_static nullable
// Upstream
Event
.get_position.position out

View File

@ -6,55 +6,10 @@ namespace Cogl {
[Version (since = "1.4")]
[CCode (cname="cogl_color_init_from_4fv")]
public Color.from_4fv (float color_array);
[Version (since = "1.4")]
[CCode (cname="cogl_color_init_from_4ub")]
public Color.from_4ub (uint8 red, uint8 green, uint8 blue, uint8 alpha);
[Version (since = "1.16")]
[CCode (cname="cogl_color_init_from_hsl")]
public Color.from_hsl (float hue, float saturation, float luminance);
}
[CCode (cheader_filename = "cogl/cogl.h")]
public sealed class Primitive : GLib.Object {
[CCode (has_construct_function = false)]
public Primitive (Cogl.VerticesMode mode, int n_vertices, ...);
[Version (since = "1.10")]
public Cogl.Primitive copy ();
[Version (since = "1.16")]
public void draw (Cogl.Framebuffer framebuffer, Cogl.Pipeline pipeline);
public int get_first_vertex ();
public Cogl.VerticesMode get_mode ();
[Version (since = "1.8")]
public int get_n_vertices ();
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2C4[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2t2 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2T2[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2t2c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2T2C4[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3C4[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3t2 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3T2[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3t2c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3T2C4[] data);
public void set_first_vertex (int first_vertex);
public void set_mode (Cogl.VerticesMode mode);
[Version (since = "1.8")]
public void set_n_vertices (int n_vertices);
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP2 {
@ -131,4 +86,8 @@ namespace Cogl {
public uint8 b;
public uint8 a;
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_PIXEL_FORMAT_", type_id = "cogl_pixel_format_get_type ()")]
public enum PixelFormat {
CAIRO_ARGB32_COMPAT;
}
}

View File

@ -8,6 +8,12 @@ color_equal skip
Context.free_timestamp_query.query owned
Bitmap.* skip=false
Bitmap.new_for_data.data type="owned uint8[]"
Bitmap.get_buffer type="unowned Cogl.Buffer?"
Primitive.new skip=false
Texture
.get_data.data type="uint8[]"
.set_data.data type="uint8[]"
@ -15,11 +21,6 @@ Texture
Texture2D
.new_from_data skip=false
.new_from_data.data array=true
Pipeline.get_layer_filters
.min_filter out
.mag_filter out
create_program type="Cogl.Program" name="create" parent="Cogl.Program"
create_shader type="Cogl.Shader" name="create" parent="Cogl.Shader"
@ -31,7 +32,6 @@ has_feature parent="Cogl.Context" symbol_type="method" instance_idx=0
Bitmap.error_quark parent="Cogl.BitmapError" name="quark"
Texture.error_quark parent="Cogl.TextureError" name="quark"
Scanout.error_quark parent="Cogl.ScanoutError" name="quark"
scanout_error_quark skip
BitmapError errordomain
BlendStringError errordomain
@ -47,6 +47,3 @@ blit_framebuffer parent="Cogl.Framebuffer" symbol_type="method" instance_idx=0 n
Onscreen
.add_dirty_callback unowned
.add_frame_callback unowned
.queue_damage_region.rectangles array array_length_idx=1
.swap_buffers_with_damage.rectangles array array_length_idx=1
.swap_region.rectangles array array_length_idx=1

View File

@ -19,7 +19,6 @@ BarrierFlags cheader_filename="meta/barrier.h"
ButtonFunction cheader_filename="meta/common.h"
ButtonLayout cheader_filename="meta/common.h"
Compositor cheader_filename="meta/compositor.h"
get_feedback_group_for_display parent="Meta.Display" symbol_type="method" name="get_feedback_group" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
get_stage_for_display parent="Meta.Display" symbol_type="method" name="get_stage" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
get_top_window_group_for_display parent="Meta.Display" symbol_type="method" name="get_top_window_group" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
get_window_group_for_display parent="Meta.Display" symbol_type="method" name="get_window_group" instance_idx=0 cheader_filename="meta/compositor-mutter.h"
@ -41,6 +40,7 @@ DebugTopic cheader_filename="meta/util.h"
DebugPaintFlag cheader_filename="meta/util.h"
Direction cheader_filename="meta/common.h"
Display cheader_filename="meta/display.h"
Display.focus_window#signal name="do_focus_window"
DisplayCorner cheader_filename="meta/display.h"
DisplayDirection cheader_filename="meta/display.h"
Dnd cheader_filename="meta/meta-dnd.h"
@ -78,7 +78,6 @@ MotionDirection cheader_filename="meta/common.h"
PadDirection cheader_filename="meta/display.h"
PadFeatureType cheader_filename="meta/display.h"
Plugin cheader_filename="meta/meta-plugin.h"
Plugin.xevent_filter.event type="X.Event" ref
PluginInfo cheader_filename="meta/meta-plugin.h"
PowerSaveChangeReason cheader_filename="meta/meta-monitor-manager.h"
Preference cheader_filename="meta/prefs.h"
@ -107,7 +106,6 @@ Stage cheader_filename="meta/meta-stage.h"
Strut cheader_filename="meta/boxes.h"
TabList cheader_filename="meta/display.h"
TabShowType cheader_filename="meta/display.h"
VirtualModifier cheader_filename="meta/common.h"
WaylandClient cheader_filename="meta/meta-wayland-client.h"
WaylandCompositor cheader_filename="meta/meta-wayland-compositor.h"
Workspace cheader_filename="meta/workspace.h"
@ -140,11 +138,6 @@ frame_type_to_string cheader_filename="meta/util.h"
topic_to_string parent="Meta.DebugTopic" name="to_string" cheader_filename="meta/util.h"
CURRENT_TIME cheader_filename="meta/common.h"
ICON_WIDTH cheader_filename="meta/common.h"
ICON_HEIGHT cheader_filename="meta/common.h"
MINI_ICON_WIDTH cheader_filename="meta/common.h"
MINI_ICON_HEIGHT cheader_filename="meta/common.h"
DEFAULT_ICON_NAME cheader_filename="meta/common.h"
PRIORITY_RESIZE cheader_filename="meta/common.h"
PRIORITY_BEFORE_REDRAW cheader_filename="meta/common.h"
PRIORITY_REDRAW cheader_filename="meta/common.h"
@ -175,10 +168,6 @@ unsigned_long_hash.v type="ulong?"
warning parent="Meta.Util" cheader_filename="meta/util.h"
create_context parent="Meta.Context" name="new" symbol_type="constructor" cheader_filename="meta/meta-context.h"
x11_error_trap_pop parent="Meta.X11Display" symbol_type="method" name="error_trap_pop" instance_idx=0 cheader_filename="meta/meta-x11-errors.h"
x11_error_trap_pop_with_return parent="Meta.X11Display" symbol_type="method" name="error_trap_pop_with_return" instance_idx=0 cheader_filename="meta/meta-x11-errors.h"
x11_error_trap_push parent="Meta.X11Display" symbol_type="method" name="error_trap_push" instance_idx=0 cheader_filename="meta/meta-x11-errors.h"
BackgroundActor sealed
BackgroundContent sealed
BackgroundImage sealed

View File

@ -1 +1,3 @@
Rectangle struct
RECTANGLE_MAX_STACK_RECTS parent="Mtk.Rectangle" name="MAX_STACK_RECTS"
REGION_BUILDER_MAX_LEVELS parent="Mtk.RegionBuilder" name="MAX_LEVELS"

View File

@ -146,6 +146,9 @@ namespace Meta {
public abstract class Backend : GLib.Object, GLib.Initable {
[CCode (has_construct_function = false)]
protected Backend ();
#if HAS_MUTTER46
public void freeze_keyboard (uint32 timestamp);
#endif
#if !HAS_MUTTER44
[CCode (cheader_filename = "meta/meta-backend.h", cname = "meta_get_backend")]
public static unowned Meta.Backend get_backend ();
@ -163,7 +166,13 @@ namespace Meta {
public bool is_headless ();
public bool is_rendering_hardware_accelerated ();
public void lock_layout_group (uint idx);
#if HAS_MUTTER46
public void set_keymap (string layouts, string variants, string options, string model);
public void unfreeze_keyboard (uint32 timestamp);
public void ungrab_keyboard (uint32 timestamp);
#else
public void set_keymap (string layouts, string variants, string options);
#endif
#if HAS_MUTTER43
public Meta.BackendCapabilities capabilities { get; }
#endif
@ -279,8 +288,10 @@ namespace Meta {
#endif
[NoAccessorMethod]
public Meta.BarrierDirection directions { get; construct; }
#if !HAS_MUTTER46
[NoAccessorMethod]
public Meta.Display display { owned get; construct; }
#endif
#if HAS_MUTTER45
[NoAccessorMethod]
public Meta.BarrierFlags flags { get; construct; }
@ -422,8 +433,8 @@ namespace Meta {
#if !HAS_MUTTER46
[CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_focus_stage_window")]
public void focus_stage_window (uint32 timestamp);
#endif
public void freeze_keyboard (uint32 timestamp);
#endif
public unowned Meta.Compositor get_compositor ();
public Clutter.ModifierType get_compositor_modifiers ();
public unowned Meta.Context get_context ();
@ -432,8 +443,10 @@ namespace Meta {
public uint32 get_current_time_roundtrip ();
[CCode (cname = "meta_cursor_tracker_get_for_display")]
public unowned Meta.CursorTracker get_cursor_tracker ();
#if !HAS_MUTTER46
[CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_get_feedback_group_for_display")]
public unowned Clutter.Actor get_feedback_group ();
#endif
public unowned Meta.Window get_focus_window ();
#if !HAS_MUTTER44
public Meta.GrabOp get_grab_op ();
@ -496,11 +509,13 @@ namespace Meta {
#if !HAS_MUTTER46
[CCode (cheader_filename = "meta/compositor-mutter.h", cname = "meta_stage_is_focused")]
public bool stage_is_focused ();
#endif
public bool supports_extended_barriers ();
public void unfreeze_keyboard (uint32 timestamp);
#endif
public bool ungrab_accelerator (uint action_id);
#if !HAS_MUTTER46
public void ungrab_keyboard (uint32 timestamp);
#endif
public void unset_input_focus (uint32 timestamp);
public bool xserver_time_is_before (uint32 time1, uint32 time2);
public Clutter.ModifierType compositor_modifiers { get; }
@ -508,6 +523,8 @@ namespace Meta {
public signal void accelerator_activated (uint object, Clutter.InputDevice p0, uint p1);
public signal void closing ();
public signal void cursor_updated ();
[CCode (cname = "focus-window")]
public signal void do_focus_window (Meta.Window object, int64 p0);
public signal void gl_video_memory_purged ();
public signal void grab_op_begin (Meta.Window object, Meta.GrabOp p0);
public signal void grab_op_end (Meta.Window object, Meta.GrabOp p0);
@ -729,8 +746,10 @@ namespace Meta {
[NoWrapper]
public virtual void unminimize (Meta.WindowActor actor);
public void unminimize_completed (Meta.WindowActor actor);
#if !HAS_MUTTER46
[NoWrapper]
public virtual bool xevent_filter ([CCode (type = "XEvent*")] ref X.Event event);
#endif
}
[CCode (cheader_filename = "meta/meta-remote-access-controller.h", type_id = "meta_remote_access_controller_get_type ()")]
public sealed class RemoteAccessController : GLib.Object {
@ -900,6 +919,7 @@ namespace Meta {
public void hide_from_window_list (Meta.Window window);
#if HAS_MUTTER46
public void make_desktop (Meta.Window window);
public void make_dock (Meta.Window window);
#endif
public bool owns_window (Meta.Window window);
public void show_in_window_list (Meta.Window window);
@ -947,7 +967,9 @@ namespace Meta {
public void activate_with_workspace (uint32 current_time, Meta.Workspace workspace);
public bool allows_move ();
public bool allows_resize ();
#if HAS_MUTTER44
#if HAS_MUTTER46
public bool begin_grab_op (Meta.GrabOp op, Clutter.InputDevice? device, Clutter.EventSequence? sequence, uint32 timestamp, Graphene.Point? pos_hint);
#elif HAS_MUTTER44
public bool begin_grab_op (Meta.GrabOp op, Clutter.InputDevice? device, Clutter.EventSequence? sequence, uint32 timestamp);
#else
public void begin_grab_op (Meta.GrabOp op, bool frame_action, uint32 timestamp);
@ -966,7 +988,9 @@ namespace Meta {
#else
public Meta.Rectangle client_rect_to_frame_rect (Meta.Rectangle client_rect);
#endif
#if !HAS_MUTTER46
public void compute_group ();
#endif
public void @delete (uint32 timestamp);
public unowned Meta.Window find_root_ancestor ();
public void focus (uint32 timestamp);
@ -979,7 +1003,9 @@ namespace Meta {
public Meta.Rectangle frame_rect_to_client_rect (Meta.Rectangle frame_rect);
public Meta.Rectangle get_buffer_rect ();
#endif
#if !HAS_MUTTER46
public unowned string? get_client_machine ();
#endif
public Meta.WindowClientType get_client_type ();
public unowned GLib.Object get_compositor_private ();
public unowned string get_description ();
@ -996,7 +1022,9 @@ namespace Meta {
public Meta.Rectangle get_frame_rect ();
#endif
public Meta.FrameType get_frame_type ();
#if !HAS_MUTTER46
public unowned Meta.Group? get_group ();
#endif
public unowned string? get_gtk_app_menu_object_path ();
public unowned string? get_gtk_application_id ();
public unowned string? get_gtk_application_object_path ();
@ -1036,8 +1064,10 @@ namespace Meta {
public Meta.Rectangle get_work_area_for_monitor (int which_monitor);
#endif
public unowned Meta.Workspace get_workspace ();
#if !HAS_MUTTER46
public X.Window get_xwindow ();
public void group_leader_changed ();
#endif
public bool has_attached_dialogs ();
public bool has_focus ();
#if HAS_MUTTER45
@ -1087,7 +1117,9 @@ namespace Meta {
#endif
public void shove_titlebar_onscreen ();
public bool showing_on_its_workspace ();
#if !HAS_MUTTER46
public void shutdown_group ();
#endif
public void stick ();
public bool titlebar_is_onscreen ();
public void unmake_above ();
@ -1099,6 +1131,9 @@ namespace Meta {
public void unshade (uint32 timestamp);
#endif
public void unstick ();
#if HAS_MUTTER46
public unowned Meta.Group? x11_get_group ();
#endif
[NoAccessorMethod]
public bool above { get; }
[NoAccessorMethod]
@ -1258,15 +1293,23 @@ namespace Meta {
public unowned Meta.Workspace append_new_workspace (bool activate, uint32 timestamp);
public unowned Meta.Workspace get_active_workspace ();
public int get_active_workspace_index ();
#if HAS_MUTTER46
public int get_layout_columns ();
public int get_layout_rows ();
#endif
public int get_n_workspaces ();
public unowned Meta.Workspace? get_workspace_by_index (int index);
public unowned GLib.List<Meta.Workspace> get_workspaces ();
public void override_workspace_layout (Meta.DisplayCorner starting_corner, bool vertical_layout, int n_rows, int n_columns);
public void remove_workspace (Meta.Workspace workspace, uint32 timestamp);
public void reorder_workspace (Meta.Workspace workspace, int new_index);
#if !HAS_MUTTER46
[NoAccessorMethod]
#endif
public int layout_columns { get; }
#if !HAS_MUTTER46
[NoAccessorMethod]
#endif
public int layout_rows { get; }
public int n_workspaces { get; }
public signal void active_workspace_changed ();
@ -1303,6 +1346,9 @@ namespace Meta {
public bool has_shape ();
#endif
public unowned Meta.Group lookup_group (X.Window group_leader);
#if HAS_MUTTER46
public X.Window lookup_xwindow (Meta.Window window);
#endif
#if HAS_MUTTER45
public void redirect_windows (Meta.Display display);
public void remove_event_func (uint id);
@ -1973,6 +2019,7 @@ namespace Meta {
ICON,
INSTANTLY
}
#if !HAS_MUTTER46
[CCode (cheader_filename = "meta/common.h", cprefix = "META_VIRTUAL_", type_id = "meta_virtual_modifier_get_type ()")]
[Flags]
public enum VirtualModifier {
@ -1987,6 +2034,7 @@ namespace Meta {
MOD4_MASK,
MOD5_MASK
}
#endif
[CCode (cheader_filename = "meta/window.h", cprefix = "META_WINDOW_CLIENT_TYPE_", type_id = "meta_window_client_type_get_type ()")]
public enum WindowClientType {
WAYLAND,
@ -2026,16 +2074,6 @@ namespace Meta {
public delegate bool WindowForeachFunc (Meta.Window window);
[CCode (cheader_filename = "meta/common.h", cname = "META_CURRENT_TIME")]
public const int CURRENT_TIME;
[CCode (cheader_filename = "meta/common.h", cname = "META_DEFAULT_ICON_NAME")]
public const string DEFAULT_ICON_NAME;
[CCode (cheader_filename = "meta/common.h", cname = "META_ICON_HEIGHT")]
public const int ICON_HEIGHT;
[CCode (cheader_filename = "meta/common.h", cname = "META_ICON_WIDTH")]
public const int ICON_WIDTH;
[CCode (cheader_filename = "meta/common.h", cname = "META_MINI_ICON_HEIGHT")]
public const int MINI_ICON_HEIGHT;
[CCode (cheader_filename = "meta/common.h", cname = "META_MINI_ICON_WIDTH")]
public const int MINI_ICON_WIDTH;
[CCode (cheader_filename = "meta/common.h", cname = "META_PRIORITY_BEFORE_REDRAW")]
public const int PRIORITY_BEFORE_REDRAW;
[CCode (cheader_filename = "meta/common.h", cname = "META_PRIORITY_PREFS_NOTIFY")]
@ -2056,8 +2094,10 @@ namespace Meta {
public static void add_clutter_debug_flags (Clutter.DebugFlag debug_flags, Clutter.DrawDebugFlag draw_flags, Clutter.PickDebugFlag pick_flags);
[CCode (cheader_filename = "meta/main.h")]
public static void add_debug_paint_flag (Meta.DebugPaintFlag flag);
#if !HAS_MUTTER46
[CCode (cheader_filename = "meta/main.h")]
public static void clutter_init ();
#endif
[CCode (cheader_filename = "meta/main.h")]
public static void exit (Meta.ExitCode code);
#if HAS_MUTTER44
@ -2085,3 +2125,4 @@ namespace Meta {
public static void restart (string? message);
#endif
}

View File

@ -4706,6 +4706,9 @@ namespace Clutter {
public Pango.Context create_pango_context ();
[Version (since = "1.0")]
public Pango.Layout create_pango_layout (string? text);
#if HAS_MUTTER46
public Clutter.PaintNode create_texture_paint_node (Cogl.Texture texture);
#endif
[Version (since = "1.10")]
public void destroy_all_children ();
[CCode (cname = "clutter_actor_event")]
@ -5348,7 +5351,7 @@ namespace Clutter {
}
[CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_align_constraint_get_type ()")]
[Version (since = "1.4")]
public class AlignConstraint : Clutter.Constraint {
public sealed class AlignConstraint : Clutter.Constraint {
[CCode (has_construct_function = false, type = "ClutterConstraint*")]
public AlignConstraint (Clutter.Actor? source, Clutter.AlignAxis axis, float factor);
public Clutter.AlignAxis get_align_axis ();
@ -5418,7 +5421,7 @@ namespace Clutter {
}
[CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_bind_constraint_get_type ()")]
[Version (since = "1.4")]
public class BindConstraint : Clutter.Constraint {
public sealed class BindConstraint : Clutter.Constraint {
[CCode (has_construct_function = false, type = "ClutterConstraint*")]
public BindConstraint (Clutter.Actor? source, Clutter.BindCoordinate coordinate, float offset);
public Clutter.BindCoordinate get_coordinate ();
@ -5433,7 +5436,7 @@ namespace Clutter {
}
[CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_binding_pool_get_type ()")]
[Version (since = "1.0")]
public class BindingPool : GLib.Object {
public sealed class BindingPool : GLib.Object {
[CCode (has_construct_function = false)]
public BindingPool (string name);
public bool activate (uint key_val, Clutter.ModifierType modifiers, GLib.Object gobject);
@ -5441,7 +5444,11 @@ namespace Clutter {
public static unowned Clutter.BindingPool find (string name);
public unowned string find_action (uint key_val, Clutter.ModifierType modifiers);
public static unowned Clutter.BindingPool get_for_class (void* klass);
#if HAS_MUTTER46
public void install_action (string action_name, uint key_val, Clutter.ModifierType modifiers, owned GLib.Callback callback);
#else
public void install_action (string action_name, uint key_val, Clutter.ModifierType modifiers, owned Clutter.BindingActionFunc callback);
#endif
public void install_closure (string action_name, uint key_val, Clutter.ModifierType modifiers, GLib.Closure closure);
public void override_action (uint key_val, Clutter.ModifierType modifiers, owned GLib.Callback callback);
public void override_closure (uint key_val, Clutter.ModifierType modifiers, GLib.Closure closure);
@ -5537,6 +5544,7 @@ namespace Clutter {
public float y;
#endif
}
#if !HAS_MUTTER46
[CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_canvas_get_type ()")]
[Version (since = "1.10")]
public class Canvas : GLib.Object, Clutter.Content {
@ -5552,7 +5560,6 @@ namespace Clutter {
public int width { get; set; }
public virtual signal bool draw (Cairo.Context cr, int width, int height);
}
#if !HAS_MUTTER46
[CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_child_meta_get_type ()")]
[Version (since = "0.8")]
public abstract class ChildMeta : GLib.Object {
@ -5753,8 +5760,10 @@ namespace Clutter {
#if !HAS_MUTTER45
public Clutter.EventType type;
#endif
#if !HAS_MUTTER46
[CCode (has_construct_function = false)]
public Event (Clutter.EventType type);
#endif
[Version (since = "1.18")]
public static uint add_filter (Clutter.Stage? stage, [CCode (delegate_target_pos = 2.2, destroy_notify_pos = 2.1)] owned Clutter.EventFilterFunc func);
public Clutter.Event copy ();
@ -5827,8 +5836,10 @@ namespace Clutter {
public Clutter.ScrollFinishFlags get_scroll_finish_flags ();
[Version (since = "1.26")]
public Clutter.ScrollSource get_scroll_source ();
#if !HAS_MUTTER46
[Version (since = "0.6")]
public unowned Clutter.Actor get_source ();
#endif
[Version (since = "1.6")]
public unowned Clutter.InputDevice get_source_device ();
#if !HAS_MUTTER45
@ -5907,13 +5918,21 @@ namespace Clutter {
}
[CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_flow_layout_get_type ()")]
[Version (since = "1.2")]
public class FlowLayout : Clutter.LayoutManager {
public sealed class FlowLayout : Clutter.LayoutManager {
[CCode (has_construct_function = false, type = "ClutterLayoutManager*")]
#if HAS_MUTTER46
public FlowLayout (Clutter.Orientation orientation);
#else
public FlowLayout (Clutter.FlowOrientation orientation);
#endif
public float get_column_spacing ();
public void get_column_width (out float min_width, out float max_width);
public bool get_homogeneous ();
#if HAS_MUTTER46
public Clutter.Orientation get_orientation ();
#else
public Clutter.FlowOrientation get_orientation ();
#endif
public void get_row_height (out float min_height, out float max_height);
public float get_row_spacing ();
[Version (since = "1.16")]
@ -5921,7 +5940,11 @@ namespace Clutter {
public void set_column_spacing (float spacing);
public void set_column_width (float min_width, float max_width);
public void set_homogeneous (bool homogeneous);
#if HAS_MUTTER46
public void set_orientation (Clutter.Orientation orientation);
#else
public void set_orientation (Clutter.FlowOrientation orientation);
#endif
public void set_row_height (float min_height, float max_height);
public void set_row_spacing (float spacing);
[Version (since = "1.16")]
@ -5936,7 +5959,11 @@ namespace Clutter {
public float min_column_width { get; set; }
[NoAccessorMethod]
public float min_row_height { get; set; }
#if HAS_MUTTER46
public Clutter.Orientation orientation { get; set construct; }
#else
public Clutter.FlowOrientation orientation { get; set construct; }
#endif
public float row_spacing { get; set; }
[Version (since = "1.16")]
public bool snap_to_grid { get; set; }
@ -5950,7 +5977,9 @@ namespace Clutter {
public class Frame {
#if HAS_MUTTER44
public int64 get_count ();
#if HAS_MUTTER45
#if HAS_MUTTER46
public bool get_frame_deadline (int64 frame_deadline_us);
#elif HAS_MUTTER45
public bool get_min_render_time_allowed (int64 min_render_time_allowed_us);
#endif
public bool get_target_presentation_time (int64 target_presentation_time_us);
@ -6036,17 +6065,30 @@ namespace Clutter {
public virtual signal void gesture_end (Clutter.Actor actor);
public virtual signal bool gesture_progress (Clutter.Actor actor);
}
#if HAS_MUTTER46
[CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_grab_get_type ()")]
public sealed class Grab : GLib.Object {
[CCode (has_construct_function = false)]
protected Grab ();
#else
[CCode (cheader_filename = "clutter/clutter.h", ref_function = "clutter_grab_ref", type_id = "clutter_grab_get_type ()", unref_function = "clutter_grab_unref")]
[Compact]
public class Grab {
#endif
public void dismiss ();
public Clutter.GrabState get_seat_state ();
#if HAS_MUTTER46
public bool is_revoked ();
[NoAccessorMethod]
public bool revoked { get; }
#else
public unowned Clutter.Grab @ref ();
public void unref ();
#endif
}
[CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_grid_layout_get_type ()")]
[Version (since = "1.12")]
public class GridLayout : Clutter.LayoutManager {
public sealed class GridLayout : Clutter.LayoutManager {
[CCode (has_construct_function = false, type = "ClutterLayoutManager*")]
public GridLayout ();
public void attach (Clutter.Actor child, int left, int top, int width, int height);
@ -6343,7 +6385,11 @@ namespace Clutter {
[CCode (has_construct_function = false)]
protected Keymap ();
public bool get_caps_lock_state ();
#if HAS_MUTTER46
public virtual Clutter.TextDirection get_direction ();
#else
public virtual Pango.Direction get_direction ();
#endif
public bool get_num_lock_state ();
public bool caps_lock_state { get; }
public bool num_lock_state { get; }
@ -6843,7 +6889,7 @@ namespace Clutter {
}
[CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_settings_get_type ()")]
[Version (since = "1.4")]
public class Settings : GLib.Object {
public sealed class Settings : GLib.Object {
[CCode (has_construct_function = false)]
protected Settings ();
public static unowned Clutter.Settings get_default ();
@ -6924,7 +6970,7 @@ namespace Clutter {
}
[CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_snap_constraint_get_type ()")]
[Version (since = "1.6")]
public class SnapConstraint : Clutter.Constraint {
public sealed class SnapConstraint : Clutter.Constraint {
[CCode (has_construct_function = false, type = "ClutterConstraint*")]
public SnapConstraint (Clutter.Actor? source, Clutter.SnapEdge from_edge, Clutter.SnapEdge to_edge, float offset);
public void get_edges (out Clutter.SnapEdge from_edge, out Clutter.SnapEdge to_edge);
@ -7143,8 +7189,10 @@ namespace Clutter {
public class SwipeAction : Clutter.GestureAction {
[CCode (has_construct_function = false, type = "ClutterAction*")]
public SwipeAction ();
#if !HAS_MUTTER46
[Version (deprecated = true, deprecated_since = "1.14", since = "1.8")]
public virtual signal void swept (Clutter.Actor actor, Clutter.SwipeDirection direction);
#endif
[Version (since = "1.14")]
#if HAS_MUTTER46
public virtual signal bool swipe (Clutter.Actor actor, Clutter.SwipeDirection direction);
@ -7590,7 +7638,7 @@ namespace Clutter {
[CCode (cheader_filename = "clutter/clutter.h", type_id = "clutter_transition_group_get_type ()")]
[Version (since = "1.12")]
#if HAS_MUTTER46
public class TransitionGroup : Clutter.Transition {
public sealed class TransitionGroup : Clutter.Transition {
#else
public class TransitionGroup : Clutter.Transition, Clutter.Scriptable {
#endif
@ -7784,12 +7832,16 @@ namespace Clutter {
public uint8 green;
public uint8 blue;
public uint8 alpha;
#if !HAS_MUTTER46
public Clutter.Color add (Clutter.Color b);
#endif
[Version (since = "1.12")]
public static Clutter.Color? alloc ();
[Version (since = "0.2")]
public Clutter.Color? copy ();
#if !HAS_MUTTER46
public Clutter.Color darken ();
#endif
[Version (since = "0.2")]
public bool equal (Clutter.Color v2);
[Version (since = "0.2")]
@ -7815,8 +7867,10 @@ namespace Clutter {
color.init_from_string (str);
return color;
}
#if !HAS_MUTTER46
[Version (since = "1.6")]
public static unowned Clutter.Color? get_static (Clutter.StaticColor color);
#endif
[Version (since = "1.0")]
public uint hash ();
[Version (since = "1.12")]
@ -7830,11 +7884,15 @@ namespace Clutter {
public bool init_from_string (string str);
[Version (since = "1.6")]
public Clutter.Color interpolate (Clutter.Color final, double progress);
#if !HAS_MUTTER46
public Clutter.Color lighten ();
#endif
[CCode (cname = "clutter_color_from_string")]
public bool parse_string (string str);
#if !HAS_MUTTER46
public Clutter.Color shade (double factor);
public Clutter.Color subtract (Clutter.Color b);
#endif
public void to_hls (out float hue, out float luminance, out float saturation);
public uint32 to_pixel ();
[Version (since = "0.2")]
@ -8221,12 +8279,21 @@ namespace Clutter {
SHADERS_GLSL
}
#endif
#if !HAS_MUTTER46
[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_FLOW_", type_id = "clutter_flow_orientation_get_type ()")]
[Version (since = "1.2")]
public enum FlowOrientation {
HORIZONTAL,
VERTICAL
}
#endif
#if HAS_MUTTER46
[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_FRAME_CLOCK_MODE_", type_id = "clutter_frame_clock_mode_get_type ()")]
public enum FrameClockMode {
FIXED,
VARIABLE
}
#endif
[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_FRAME_INFO_FLAG_", type_id = "clutter_frame_info_flag_get_type ()")]
[Flags]
public enum FrameInfoFlag {
@ -8642,6 +8709,7 @@ namespace Clutter {
BOTTOM,
LEFT
}
#if !HAS_MUTTER46
[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_COLOR_", type_id = "clutter_static_color_get_type ()")]
[Version (since = "1.6")]
public enum StaticColor {
@ -8691,6 +8759,7 @@ namespace Clutter {
ALUMINIUM_6,
TRANSPARENT
}
#endif
[CCode (cheader_filename = "clutter/clutter.h", cprefix = "CLUTTER_STEP_MODE_", type_id = "clutter_step_mode_get_type ()")]
[Version (since = "1.12")]
public enum StepMode {
@ -8785,11 +8854,13 @@ namespace Clutter {
[CCode (cheader_filename = "clutter/clutter.h", instance_pos = 1.9)]
[Version (since = "1.24")]
public delegate Clutter.Actor ActorCreateChildFunc (GLib.Object item);
#if !HAS_MUTTER46
[CCode (cheader_filename = "clutter/clutter.h", instance_pos = 4.9)]
[Version (since = "1.0")]
public delegate bool BindingActionFunc (GLib.Object gobject, string action_name, uint key_val, Clutter.ModifierType modifiers);
[CCode (cheader_filename = "clutter/clutter.h", instance_pos = 1.9)]
public delegate void Callback (Clutter.Actor actor);
#endif
#if HAS_MUTTER43
[CCode (cheader_filename = "clutter/clutter.h", instance_pos = 2.9)]
[Version (since = "1.18")]

View File

@ -2,14 +2,68 @@
[CCode (cprefix = "Cogl", gir_namespace = "Cogl", gir_version = "14", lower_case_cprefix = "cogl_")]
namespace Cogl {
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_atlas_texture_get_type ()")]
public sealed class AtlasTexture : Cogl.Texture {
[CCode (has_construct_function = false)]
protected AtlasTexture ();
[CCode (has_construct_function = false, type = "CoglTexture*")]
public AtlasTexture.from_bitmap (Cogl.Bitmap bmp);
[CCode (has_construct_function = false, type = "CoglTexture*")]
public AtlasTexture.from_data (Cogl.Context ctx, int width, int height, Cogl.PixelFormat format, int rowstride, uint8 data) throws GLib.Error;
[CCode (has_construct_function = false, type = "CoglTexture*")]
public AtlasTexture.with_size (Cogl.Context ctx, int width, int height);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_attribute_get_type ()")]
public class Attribute : GLib.Object {
[CCode (has_construct_function = false)]
public Attribute (Cogl.AttributeBuffer attribute_buffer, string name, size_t stride, size_t offset, int components, Cogl.AttributeType type);
[CCode (has_construct_function = false)]
public Attribute.const_1f (Cogl.Context context, string name, float value);
[CCode (has_construct_function = false)]
public Attribute.const_2f (Cogl.Context context, string name, float component0, float component1);
[CCode (has_construct_function = false)]
public Attribute.const_2fv (Cogl.Context context, string name, float value);
[CCode (has_construct_function = false)]
public Attribute.const_2x2fv (Cogl.Context context, string name, float matrix2x2, bool transpose);
[CCode (has_construct_function = false)]
public Attribute.const_3f (Cogl.Context context, string name, float component0, float component1, float component2);
[CCode (has_construct_function = false)]
public Attribute.const_3fv (Cogl.Context context, string name, float value);
[CCode (has_construct_function = false)]
public Attribute.const_3x3fv (Cogl.Context context, string name, float matrix3x3, bool transpose);
[CCode (has_construct_function = false)]
public Attribute.const_4f (Cogl.Context context, string name, float component0, float component1, float component2, float component3);
[CCode (has_construct_function = false)]
public Attribute.const_4fv (Cogl.Context context, string name, float value);
[CCode (has_construct_function = false)]
public Attribute.const_4x4fv (Cogl.Context context, string name, float matrix4x4, bool transpose);
public unowned Cogl.AttributeBuffer get_buffer ();
public bool get_normalized ();
public void set_buffer (Cogl.AttributeBuffer attribute_buffer);
public void set_normalized (bool normalized);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_attribute_buffer_get_type ()")]
public sealed class AttributeBuffer : Cogl.Buffer {
[CCode (has_construct_function = false)]
public AttributeBuffer (Cogl.Context context, [CCode (array_length_cname = "bytes", array_length_pos = 1.5, array_length_type = "gsize")] uint8[] data);
[CCode (has_construct_function = false)]
public AttributeBuffer.with_size (Cogl.Context context, size_t bytes);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_bitmap_get_type ()")]
public class Bitmap : GLib.Object {
[CCode (has_construct_function = false)]
protected Bitmap ();
[CCode (has_construct_function = false)]
public Bitmap.for_data (Cogl.Context context, int width, int height, Cogl.PixelFormat format, int rowstride, [CCode (array_length = false)] owned uint8[] data);
[CCode (has_construct_function = false)]
public Bitmap.from_buffer (Cogl.Buffer buffer, Cogl.PixelFormat format, int width, int height, int rowstride, int offset);
public unowned Cogl.Buffer? get_buffer ();
public Cogl.PixelFormat get_format ();
public int get_height ();
public int get_rowstride ();
public int get_width ();
[CCode (has_construct_function = false)]
public Bitmap.with_size (Cogl.Context context, uint width, uint height, Cogl.PixelFormat format);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_buffer_get_type ()")]
public abstract class Buffer : GLib.Object {
@ -19,7 +73,7 @@ namespace Cogl {
public Cogl.BufferUpdateHint get_update_hint ();
public void* map (Cogl.BufferAccess access, Cogl.BufferMapHint hints);
public void* map_range (size_t offset, size_t size, Cogl.BufferAccess access, Cogl.BufferMapHint hints) throws GLib.Error;
public bool set_data (size_t offset, void* data, size_t size);
public bool set_data (size_t offset, [CCode (array_length = false)] uint8[] data, size_t size);
public void set_update_hint (Cogl.BufferUpdateHint hint);
public void unmap ();
[NoAccessorMethod]
@ -33,20 +87,56 @@ namespace Cogl {
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_context_get_type ()")]
public class Context : GLib.Object {
[CCode (has_construct_function = false)]
protected Context ();
public Context (Cogl.Display? display) throws GLib.Error;
[CCode (cheader_filename = "cogl/cogl.h", cname = "cogl_foreach_feature")]
public void foreach_feature (Cogl.FeatureCallback callback);
public void free_timestamp_query (owned Cogl.TimestampQuery query);
public unowned Cogl.Display get_display ();
public int64 get_gpu_time_ns ();
[CCode (cheader_filename = "cogl/cogl.h", cname = "cogl_get_graphics_reset_status")]
public Cogl.GraphicsResetStatus get_graphics_reset_status ();
public unowned Cogl.Pipeline get_named_pipeline (Cogl.PipelineKey key);
public unowned Cogl.Renderer get_renderer ();
[CCode (cheader_filename = "cogl/cogl.h", cname = "cogl_has_feature")]
public bool has_feature (Cogl.FeatureID feature);
public bool is_hardware_accelerated ();
public void set_named_pipeline (Cogl.PipelineKey key, Cogl.Pipeline? pipeline);
public int64 timestamp_query_get_time_ns (Cogl.TimestampQuery query);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_display_get_type ()")]
public class Display : GLib.Object {
[CCode (has_construct_function = false)]
public Display (Cogl.Renderer renderer, Cogl.OnscreenTemplate onscreen_template);
public unowned Cogl.Renderer get_renderer ();
public void set_onscreen_template (Cogl.OnscreenTemplate onscreen_template);
public bool setup () throws GLib.Error;
}
[CCode (cheader_filename = "cogl/cogl.h", free_function = "cogl_dma_buf_handle_free", has_type_id = false)]
[Compact]
public class DmaBufHandle {
[DestroysInstance]
public void free ();
public int get_bpp ();
public int get_fd ();
public unowned Cogl.Framebuffer get_framebuffer ();
public int get_height ();
public int get_offset ();
public int get_stride ();
public int get_width ();
public void* mmap () throws GLib.Error;
public bool munmap (void* data) throws GLib.Error;
public bool sync_read_end () throws GLib.Error;
public bool sync_read_start () throws GLib.Error;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Compact]
public class Fence {
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Compact]
public class FenceClosure {
public void* get_user_data ();
}
[CCode (cheader_filename = "cogl/cogl.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "cogl_frame_closure_get_type ()")]
[Compact]
public class FrameClosure {
@ -56,6 +146,7 @@ namespace Cogl {
[CCode (has_construct_function = false)]
protected FrameInfo ();
public int64 get_frame_counter ();
public int64 get_global_frame_counter ();
public bool get_is_symbolic ();
public int64 get_presentation_time_us ();
public float get_refresh_rate ();
@ -70,9 +161,11 @@ namespace Cogl {
public abstract class Framebuffer : GLib.Object {
[CCode (has_construct_function = false)]
protected Framebuffer ();
public unowned Cogl.FenceClosure? add_fence_callback ([CCode (scope = "async")] Cogl.FenceCallback callback);
public virtual bool allocate () throws GLib.Error;
[CCode (cheader_filename = "cogl/cogl.h", cname = "cogl_blit_framebuffer")]
public bool blit (Cogl.Framebuffer dst, int src_x, int src_y, int dst_x, int dst_y, int width, int height) throws GLib.Error;
public void cancel_fence_callback (Cogl.FenceClosure closure);
public void clear (ulong buffers, Cogl.Color color);
public void clear4f (ulong buffers, float red, float green, float blue, float alpha);
public void discard_buffers (ulong buffers);
@ -113,6 +206,7 @@ namespace Cogl {
public void pop_clip ();
public void pop_matrix ();
public void push_matrix ();
public void push_primitive_clip (Cogl.Primitive primitive, float bounds_x1, float bounds_y1, float bounds_x2, float bounds_y2);
public void push_rectangle_clip (float x_1, float y_1, float x_2, float y_2);
public void push_region_clip (Mtk.Region region);
public bool read_pixels (int x, int y, int width, int height, Cogl.PixelFormat format, uint8 pixels);
@ -144,10 +238,57 @@ namespace Cogl {
[Compact]
public class FramebufferDriverConfig {
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_index_buffer_get_type ()")]
public sealed class IndexBuffer : Cogl.Buffer {
[CCode (has_construct_function = false)]
public IndexBuffer (Cogl.Context context, size_t bytes);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_indices_get_type ()")]
public class Indices : GLib.Object {
[CCode (has_construct_function = false)]
public Indices (Cogl.Context context, Cogl.IndicesType type, void* indices_data, int n_indices);
[CCode (has_construct_function = false)]
public Indices.for_buffer (Cogl.IndicesType type, Cogl.IndexBuffer buffer, size_t offset);
public unowned Cogl.IndexBuffer get_buffer ();
public Cogl.IndicesType get_indices_type ();
public size_t get_offset ();
public void set_offset (size_t offset);
}
[CCode (cheader_filename = "cogl/cogl.h", ref_function = "cogl_matrix_entry_ref", type_id = "cogl_matrix_entry_get_type ()", unref_function = "cogl_matrix_entry_unref")]
[Compact]
public class MatrixEntry {
public bool calculate_translation (Cogl.MatrixEntry entry1, out float x, out float y, out float z);
public bool equal (Cogl.MatrixEntry entry1);
public Graphene.Matrix? @get (out Graphene.Matrix matrix);
public bool is_identity ();
public Cogl.MatrixEntry @ref ();
public void unref ();
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_matrix_stack_get_type ()")]
public class MatrixStack : GLib.Object {
[CCode (has_construct_function = false)]
public MatrixStack (Cogl.Context ctx);
public void frustum (float left, float right, float bottom, float top, float z_near, float z_far);
public Graphene.Matrix? @get (out Graphene.Matrix matrix);
public unowned Cogl.MatrixEntry get_entry ();
public bool get_inverse (out Graphene.Matrix inverse);
public void load_identity ();
public void multiply (Graphene.Matrix matrix);
public void orthographic (float x_1, float y_1, float x_2, float y_2, float near, float far);
public void perspective (float fov_y, float aspect, float z_near, float z_far);
public void pop ();
public void push ();
public void rotate (float angle, float x, float y, float z);
public void rotate_euler (Graphene.Euler euler);
public void scale (float x, float y, float z);
public void @set (Graphene.Matrix matrix);
public void translate (float x, float y, float z);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_offscreen_get_type ()")]
public class Offscreen : Cogl.Framebuffer {
[CCode (has_construct_function = false)]
protected Offscreen ();
public unowned Cogl.Texture get_texture ();
[CCode (has_construct_function = false)]
public Offscreen.with_texture (Cogl.Texture texture);
}
@ -157,23 +298,45 @@ namespace Cogl {
protected Onscreen ();
public unowned Cogl.OnscreenDirtyClosure add_dirty_callback (owned Cogl.OnscreenDirtyCallback callback);
public unowned Cogl.FrameClosure add_frame_callback (owned Cogl.FrameCallback callback);
public void add_frame_info (owned Cogl.FrameInfo info);
[NoWrapper]
public virtual void bind ();
public virtual bool direct_scanout (Cogl.Scanout scanout, Cogl.FrameInfo info) throws GLib.Error;
public virtual int get_buffer_age ();
public int64 get_frame_counter ();
public void hide ();
public virtual void queue_damage_region ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.1, type = "const int*")] int[] rectangles);
public virtual void queue_damage_region ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.1)] int[] rectangles);
public void remove_dirty_callback (Cogl.OnscreenDirtyClosure closure);
public void remove_frame_callback (Cogl.FrameClosure closure);
public void show ();
public void swap_buffers (Cogl.FrameInfo frame_info, void* user_data);
public virtual void swap_buffers_with_damage ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.5, type = "const int*")] int[] rectangles, Cogl.FrameInfo info);
public virtual void swap_region ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.5, type = "const int*")] int[] rectangles, Cogl.FrameInfo info);
public virtual void swap_buffers_with_damage ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.5)] int[] rectangles, Cogl.FrameInfo info);
public virtual void swap_region ([CCode (array_length_cname = "n_rectangles", array_length_pos = 1.5)] int[] rectangles, Cogl.FrameInfo info);
}
[CCode (cheader_filename = "cogl/cogl.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "cogl_onscreen_dirty_closure_get_type ()")]
[Compact]
public class OnscreenDirtyClosure {
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_onscreen_template_get_type ()")]
public class OnscreenTemplate : GLib.Object {
[CCode (has_construct_function = false)]
public OnscreenTemplate (Cogl.SwapChain swap_chain);
public void set_samples_per_pixel (int n);
public void set_stereo_enabled (bool enabled);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_output_get_type ()")]
public class Output : GLib.Object {
[CCode (has_construct_function = false)]
protected Output ();
public int get_height ();
public int get_mm_height ();
public int get_mm_width ();
public float get_refresh_rate ();
public Cogl.SubpixelOrder get_subpixel_order ();
public int get_width ();
public int get_x ();
public int get_y ();
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_pipeline_get_type ()")]
public sealed class Pipeline : GLib.Object {
[CCode (has_construct_function = false)]
@ -186,6 +349,7 @@ namespace Cogl {
public float get_alpha_test_reference ();
public Cogl.Color get_color ();
public Cogl.PipelineCullFaceMode get_cull_face_mode ();
public Cogl.DepthState get_depth_state ();
public Cogl.Winding get_front_face_winding ();
public void get_layer_filters (int layer_index, out Cogl.PipelineFilter min_filter, out Cogl.PipelineFilter mag_filter);
public bool get_layer_point_sprite_coords_enabled (int layer_index);
@ -202,9 +366,8 @@ namespace Cogl {
public bool set_blend (string blend_string) throws GLib.Error;
public void set_blend_constant (Cogl.Color constant_color);
public void set_color (Cogl.Color color);
public void set_color4f (float red, float green, float blue, float alpha);
public void set_color4ub (uint8 red, uint8 green, uint8 blue, uint8 alpha);
public void set_cull_face_mode (Cogl.PipelineCullFaceMode cull_face_mode);
public bool set_depth_state (Cogl.DepthState state) throws GLib.Error;
public void set_front_face_winding (Cogl.Winding front_winding);
public bool set_layer_combine (int layer_index, string blend_string) throws GLib.Error;
public void set_layer_combine_constant (int layer_index, Cogl.Color constant);
@ -226,50 +389,46 @@ namespace Cogl {
public void set_uniform_matrix (int uniform_location, int dimensions, int count, bool transpose, float value);
public void set_user_program (Cogl.Program program);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "G_TYPE_STRING")]
[Compact]
public class PipelineKey : string {
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_pixel_buffer_get_type ()")]
public sealed class PixelBuffer : Cogl.Buffer {
[CCode (has_construct_function = false)]
public PixelBuffer (Cogl.Context context, [CCode (array_length_cname = "size", array_length_pos = 1.5, array_length_type = "gsize")] uint8[] data);
}
[CCode (cheader_filename = "cogl/cogl.h")]
public sealed class Primitive : GLib.Object {
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_primitive_get_type ()")]
public class Primitive : GLib.Object {
[CCode (has_construct_function = false)]
public Primitive (Cogl.VerticesMode mode, int n_vertices, ...);
[Version (since = "1.10")]
public Cogl.Primitive copy ();
[Version (since = "1.16")]
public void draw (Cogl.Framebuffer framebuffer, Cogl.Pipeline pipeline);
public void foreach_attribute (Cogl.PrimitiveAttributeCallback callback);
public int get_first_vertex ();
[CCode (array_length = false)]
public unowned Cogl.Indices[]? get_indices ();
public Cogl.VerticesMode get_mode ();
[Version (since = "1.8")]
public int get_n_vertices ();
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2C4[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2t2 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2T2[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p2t2c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP2T2C4[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3C4[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3t2 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3T2[] data);
[CCode (has_construct_function = false)]
[Version (since = "1.6")]
public Primitive.p3t2c4 (Cogl.Context context, Cogl.VerticesMode mode, [CCode (array_length_cname = "n_vertices", array_length_pos = 2.5)] Cogl.VertexP3T2C4[] data);
public void set_first_vertex (int first_vertex);
public void set_indices ([CCode (array_length_cname = "n_indices", array_length_pos = 1.1)] Cogl.Indices[] indices);
public void set_mode (Cogl.VerticesMode mode);
[Version (since = "1.8")]
public void set_n_vertices (int n_vertices);
public static void texture_set_auto_mipmap (Cogl.Texture primitive_texture, bool value);
[CCode (has_construct_function = false)]
public Primitive.with_attributes (Cogl.VerticesMode mode, int n_vertices, [CCode (array_length_cname = "n_attributes", array_length_pos = 3.1)] Cogl.Attribute[] attributes);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_program_get_type ()")]
public class Program : GLib.Object {
@ -295,9 +454,35 @@ namespace Cogl {
[Version (deprecated = true, deprecated_since = "1.16")]
public void set_uniform_matrix (int uniform_location, int dimensions, bool transpose, [CCode (array_length_cname = "count", array_length_pos = 2.5)] float[] value);
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Compact]
public class Scanout {
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_renderer_get_type ()")]
public class Renderer : GLib.Object {
[CCode (has_construct_function = false)]
public Renderer ();
public void add_constraint (Cogl.RendererConstraint constraint);
public void bind_api ();
public bool check_onscreen_template (Cogl.OnscreenTemplate onscreen_template) throws GLib.Error;
public bool connect () throws GLib.Error;
public static uint32 error_quark ();
public void foreach_output (Cogl.OutputCallback callback);
public Cogl.Driver get_driver ();
public Cogl.WinsysID get_winsys_id ();
public bool is_dma_buf_supported ();
public void remove_constraint (Cogl.RendererConstraint constraint);
public void set_driver (Cogl.Driver driver);
public void set_winsys_id (Cogl.WinsysID winsys_id);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_scanout_get_type ()")]
public sealed class Scanout : GLib.Object {
[CCode (has_construct_function = false)]
public Scanout (Cogl.ScanoutBuffer scanout_buffer);
public bool blit_to_framebuffer (Cogl.Framebuffer framebuffer, int x, int y) throws GLib.Error;
public unowned Cogl.ScanoutBuffer get_buffer ();
public void get_dst_rect (Mtk.Rectangle rect);
public void get_src_rect (Graphene.Rect rect);
public void notify_failed (Cogl.Onscreen onscreen);
public void set_dst_rect (Mtk.Rectangle rect);
public void set_src_rect (Graphene.Rect rect);
public signal void scanout_failed (Cogl.Onscreen object);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_shader_get_type ()")]
public class Shader : GLib.Object {
@ -325,6 +510,19 @@ namespace Cogl {
public void set_pre (string pre);
public void set_replace (string replace);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_sub_texture_get_type ()")]
public sealed class SubTexture : Cogl.Texture {
[CCode (has_construct_function = false, type = "CoglTexture*")]
public SubTexture (Cogl.Context ctx, Cogl.Texture parent_texture, int sub_x, int sub_y, int sub_width, int sub_height);
public unowned Cogl.Texture get_parent ();
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_swap_chain_get_type ()")]
public class SwapChain : GLib.Object {
[CCode (has_construct_function = false)]
public SwapChain ();
public void set_has_alpha (bool has_alpha);
public void set_length (int length);
}
[CCode (cheader_filename = "cogl/cogl.h", type_id = "cogl_texture_get_type ()")]
public abstract class Texture : GLib.Object {
[CCode (has_construct_function = false)]
@ -337,6 +535,7 @@ namespace Cogl {
public int get_max_waste ();
public bool get_premultiplied ();
public uint get_width ();
public bool is_get_data_supported ();
public bool is_sliced ();
public void set_components (Cogl.TextureComponents components);
public bool set_data (Cogl.PixelFormat format, int rowstride, [CCode (array_length = false)] uint8[] data, int level) throws GLib.Error;
@ -358,12 +557,15 @@ namespace Cogl {
public sealed class Texture2D : Cogl.Texture {
[CCode (has_construct_function = false)]
protected Texture2D ();
public void egl_image_external_alloc_finish (void* user_data, GLib.DestroyNotify destroy);
public void egl_image_external_bind ();
[CCode (has_construct_function = false, type = "CoglTexture*")]
public Texture2D.from_bitmap (Cogl.Bitmap bitmap);
[CCode (has_construct_function = false, type = "CoglTexture*")]
public Texture2D.from_data (Cogl.Context ctx, int width, int height, Cogl.PixelFormat format, int rowstride, [CCode (array_length = false, type = "const uint8_t*")] uint8[] data) throws GLib.Error;
public Texture2D.from_data (Cogl.Context ctx, int width, int height, Cogl.PixelFormat format, int rowstride, [CCode (array_length = false)] uint8[] data) throws GLib.Error;
[CCode (has_construct_function = false, type = "CoglTexture*")]
[Version (since = "2.0")]
public Texture2D.with_format (Cogl.Context ctx, int width, int height, Cogl.PixelFormat format);
[CCode (has_construct_function = false, type = "CoglTexture*")]
public Texture2D.with_size (Cogl.Context ctx, int width, int height);
}
[CCode (cheader_filename = "cogl/cogl.h", lower_case_csuffix = "texture_2d_sliced", type_id = "cogl_texture_2d_sliced_get_type ()")]
public sealed class Texture2DSliced : Cogl.Texture {
@ -371,19 +573,22 @@ namespace Cogl {
protected Texture2DSliced ();
[CCode (has_construct_function = false, type = "CoglTexture*")]
public Texture2DSliced.from_bitmap (Cogl.Bitmap bmp, int max_waste);
[CCode (has_construct_function = false, type = "CoglTexture*")]
public Texture2DSliced.from_data (Cogl.Context ctx, int width, int height, int max_waste, Cogl.PixelFormat format, int rowstride, [CCode (array_length = false)] uint8[] data) throws GLib.Error;
[CCode (has_construct_function = false, type = "CoglTexture*")]
public Texture2DSliced.with_size (Cogl.Context ctx, int width, int height, int max_waste);
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Compact]
public class TimestampQuery {
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Compact]
public class TraceContext {
[CCode (cheader_filename = "cogl/cogl.h", type_cname = "CoglScanoutBufferInterface", type_id = "cogl_scanout_buffer_get_type ()")]
public interface ScanoutBuffer : GLib.Object {
public abstract int get_height ();
public abstract int get_width ();
}
[CCode (cheader_filename = "cogl/cogl.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "cogl_color_get_type ()")]
public struct Color {
[CCode (has_construct_function = false, type = "CoglColor*")]
public Color ();
public Cogl.Color? copy ();
public bool equal ([CCode (type = "void*")] Cogl.Color v2);
public void free ();
@ -393,43 +598,29 @@ namespace Cogl {
[CCode (cname = "cogl_color_init_from_4fv")]
[Version (since = "1.4")]
public Color.from_4fv (float color_array);
[CCode (cname = "cogl_color_init_from_4ub")]
[Version (since = "1.4")]
public Color.from_4ub (uint8 red, uint8 green, uint8 blue, uint8 alpha);
[CCode (cname = "cogl_color_init_from_hsl")]
[Version (since = "1.16")]
public Color.from_hsl (float hue, float saturation, float luminance);
public float get_alpha ();
public uint8 get_alpha_byte ();
public float get_alpha_float ();
public float get_blue ();
public uint8 get_blue_byte ();
public float get_blue_float ();
public float get_green ();
public uint8 get_green_byte ();
public float get_green_float ();
public float get_red ();
public uint8 get_red_byte ();
public float get_red_float ();
public void init_from_4f (float red, float green, float blue, float alpha);
public void init_from_4fv (float color_array);
public void init_from_4ub (uint8 red, uint8 green, uint8 blue, uint8 alpha);
public void init_from_hsl (float hue, float saturation, float luminance);
public void premultiply ();
public void set_alpha (float alpha);
public void set_alpha_byte (uint8 alpha);
public void set_alpha_float (float alpha);
public void set_blue (float blue);
public void set_blue_byte (uint8 blue);
public void set_blue_float (float blue);
public void set_green (float green);
public void set_green_byte (uint8 green);
public void set_green_float (float green);
public void set_red (float red);
public void set_red_byte (uint8 red);
public void set_red_float (float red);
public void to_hsl (out float hue, out float saturation, out float luminance);
public void unpremultiply ();
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
public struct DepthState {
public void get_range (float near_val, float far_val);
public bool get_test_enabled ();
public Cogl.DepthTestFunction get_test_function ();
public bool get_write_enabled ();
public void init ();
public void set_range (float near_val, float far_val);
public void set_test_enabled (bool enable);
public void set_test_function (Cogl.DepthTestFunction function);
public void set_write_enabled (bool enable);
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
public struct OnscreenDirtyInfo {
@ -438,6 +629,14 @@ namespace Cogl {
public int width;
public int height;
}
[CCode (cheader_filename = "cogl/cogl.h")]
[SimpleType]
public struct PipelineKey : char {
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
public struct PollFD {
public int fd;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
public struct TextureVertex {
public float x;
@ -448,12 +647,6 @@ namespace Cogl {
public Cogl.Color color;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
public struct TraceHead {
public uint64 begin_time;
public weak string name;
public weak string description;
}
[CCode (cheader_filename = "cogl/cogl.h", has_type_id = false)]
[Version (since = "1.6")]
public struct VertexP2 {
public float x;
@ -592,6 +785,13 @@ namespace Cogl {
GEQUAL,
ALWAYS
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_DRIVER_", has_type_id = false)]
public enum Driver {
ANY,
NOP,
GL3,
GLES2
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_EGL_IMAGE_FLAG_", has_type_id = false)]
[Flags]
public enum EglImageFlags {
@ -685,6 +885,7 @@ namespace Cogl {
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_PIXEL_FORMAT_", type_id = "cogl_pixel_format_get_type ()")]
public enum PixelFormat {
CAIRO_ARGB32_COMPAT,
ANY,
A_8,
RGB_565,
@ -743,12 +944,28 @@ namespace Cogl {
public int get_n_planes ();
public unowned string to_string ();
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_POLL_FD_EVENT_", has_type_id = false)]
public enum PollFDEvent {
IN,
PRI,
OUT,
ERR,
HUP,
NVAL
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_READ_PIXELS_COLOR_", has_type_id = false)]
[Flags]
public enum ReadPixelsFlags {
[CCode (cname = "COGL_READ_PIXELS_COLOR_BUFFER")]
READ_PIXELS_COLOR_BUFFER
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_RENDERER_CONSTRAINT_USES_", has_type_id = false)]
[Flags]
public enum RendererConstraint {
X11,
XLIB,
EGL
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_SHADER_TYPE_", has_type_id = false)]
public enum ShaderType {
VERTEX,
@ -772,6 +989,15 @@ namespace Cogl {
LEFT,
RIGHT
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_SUBPIXEL_ORDER_", has_type_id = false)]
public enum SubpixelOrder {
UNKNOWN,
NONE,
HORIZONTAL_RGB,
HORIZONTAL_BGR,
VERTICAL_RGB,
VERTICAL_BGR
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_TEXTURE_COMPONENTS_", has_type_id = false)]
public enum TextureComponents {
A,
@ -808,6 +1034,14 @@ namespace Cogl {
SYNC_AND_COMPLETE_EVENT,
N_FEATURES
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_WINSYS_ID_", has_type_id = false)]
public enum WinsysID {
ANY,
STUB,
GLX,
EGL_XLIB,
CUSTOM
}
[CCode (cheader_filename = "cogl/cogl.h", cprefix = "COGL_BITMAP_ERROR_", has_type_id = false)]
public errordomain BitmapError {
FAILED,
@ -855,14 +1089,20 @@ namespace Cogl {
}
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 1.9)]
public delegate void FeatureCallback (Cogl.FeatureID feature);
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 1.9)]
public delegate void FenceCallback (Cogl.Fence fence);
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 3.9)]
public delegate void FrameCallback (Cogl.Onscreen onscreen, Cogl.FrameEvent event, Cogl.FrameInfo info);
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 3.9)]
public delegate void MetaTextureCallback (Cogl.Texture sub_texture, float sub_texture_coords, float meta_coords);
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 2.9)]
public delegate void OnscreenDirtyCallback (Cogl.Onscreen onscreen, Cogl.OnscreenDirtyInfo info);
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 1.9)]
public delegate void OutputCallback (Cogl.Output output);
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 2.9)]
public delegate bool PipelineLayerCallback (Cogl.Pipeline pipeline, int layer_index);
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 1.9)]
public delegate bool Texture2DEGLImageExternalAlloc (Cogl.Texture2D tex_2d) throws GLib.Error;
[CCode (cheader_filename = "cogl/cogl.h", instance_pos = 2.9)]
public delegate bool PrimitiveAttributeCallback (Cogl.Primitive primitive, Cogl.Attribute attribute);
[CCode (cheader_filename = "cogl/cogl.h", cname = "COGL_AFIRST_BIT")]
public const int AFIRST_BIT;
[CCode (cheader_filename = "cogl/cogl.h", cname = "COGL_A_BIT")]
@ -885,8 +1125,24 @@ namespace Cogl {
[Version (replacement = "Color.init_from_hsl")]
public static void color_init_from_hsl (out Cogl.Color color, float hue, float saturation, float luminance);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void debug_matrix_entry_print (Cogl.MatrixEntry entry);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void flush ();
[CCode (cheader_filename = "cogl/cogl.h")]
public static unowned Cogl.Indices get_rectangle_indices (Cogl.Context context, int n_rectangles);
[CCode (cheader_filename = "cogl/cogl.h")]
public static GLib.Source glib_renderer_source_new (Cogl.Renderer renderer, int priority);
[CCode (cheader_filename = "cogl/cogl.h")]
public static GLib.Source glib_source_new (Cogl.Context context, int priority);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void graphene_matrix_project_point (Graphene.Matrix matrix, ref float x, ref float y, ref float z, ref float w);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void graphene_matrix_project_points (Graphene.Matrix matrix, int n_components, size_t stride_in, void* points_in, size_t stride_out, void* points_out, int n_points);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void graphene_matrix_transform_points (Graphene.Matrix matrix, int n_components, size_t stride_in, void* points_in, size_t stride_out, void* points_out, int n_points);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void meta_texture_foreach_in_region (Cogl.Texture texture, float tx_1, float ty_1, float tx_2, float ty_2, Cogl.PipelineWrapMode wrap_s, Cogl.PipelineWrapMode wrap_t, Cogl.MetaTextureCallback callback);
[CCode (cheader_filename = "cogl/cogl.h")]
[Version (replacement = "PixelFormat.get_bytes_per_pixel")]
public static int pixel_format_get_bytes_per_pixel (Cogl.PixelFormat format, int plane);
[CCode (cheader_filename = "cogl/cogl.h")]
@ -896,19 +1152,17 @@ namespace Cogl {
[Version (replacement = "PixelFormat.to_string")]
public static unowned string pixel_format_to_string (Cogl.PixelFormat format);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void set_tracing_disabled_on_thread (GLib.MainContext main_context);
public static void poll_renderer_dispatch (Cogl.Renderer renderer, Cogl.PollFD poll_fds, int n_poll_fds);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void set_tracing_enabled_on_thread (GLib.MainContext main_context, string group);
public static int poll_renderer_get_info (Cogl.Renderer renderer, Cogl.PollFD poll_fds, int n_poll_fds, int64 timeout);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void set_tracing_disabled_on_thread (void* data);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void set_tracing_enabled_on_thread (void* data, string group);
[CCode (cheader_filename = "cogl/cogl.h")]
public static bool start_tracing_with_fd (int fd) throws GLib.Error;
[CCode (cheader_filename = "cogl/cogl.h")]
public static bool start_tracing_with_path (string filename) throws GLib.Error;
[CCode (cheader_filename = "cogl/cogl.h")]
public static void stop_tracing ();
[CCode (cheader_filename = "cogl/cogl.h")]
public static void trace_describe (Cogl.TraceHead head, string description);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void trace_end (Cogl.TraceHead head);
[CCode (cheader_filename = "cogl/cogl.h")]
public static void trace_mark (string name, string description);
}

View File

@ -1168,3 +1168,4 @@ namespace Cogl {
[CCode (cheader_filename = "cogl/cogl.h")]
public static void trace_end (Cogl.TraceHead head);
}

View File

@ -6,12 +6,14 @@ namespace Mtk {
[CCode (cheader_filename = "mtk/mtk.h", ref_function = "mtk_region_ref", type_id = "mtk_region_get_type ()", unref_function = "mtk_region_unref")]
[Compact]
public class Region {
public Mtk.Region apply_matrix_transform_expand (Graphene.Matrix transform);
public bool contains_point (int x, int y);
public Mtk.RegionOverlap contains_rectangle (Mtk.Rectangle rect);
public Mtk.Region copy ();
public static Mtk.Region create ();
public static Mtk.Region create_rectangle (Mtk.Rectangle rect);
public static Mtk.Region create_rectangles (Mtk.Rectangle rects, int n_rects);
public Mtk.Region crop_and_scale (Graphene.Rect src_rect, int dst_width, int dst_height);
public bool equal (Mtk.Region other);
public Mtk.Rectangle? get_extents ();
public Mtk.Rectangle? get_rectangle (int nth);
@ -20,6 +22,7 @@ namespace Mtk {
public bool is_empty ();
public int num_rectangles ();
public unowned Mtk.Region @ref ();
public Mtk.Region scale (int scale);
public void subtract (Mtk.Region other);
public void subtract_rectangle (Mtk.Rectangle rect);
public void translate (int dx, int dy);
@ -34,23 +37,58 @@ namespace Mtk {
public int y;
public int width;
public int height;
#if HAS_MUTTER46
[CCode (cname = "MTK_RECTANGLE_MAX_STACK_RECTS")]
public const int MAX_STACK_RECTS;
#endif
[CCode (has_construct_function = false, type = "MtkRectangle*")]
public Rectangle (int x, int y, int width, int height);
public int area ();
public bool contains_rect (Mtk.Rectangle inner_rect);
public Mtk.Rectangle? copy ();
public bool could_fit_rect (Mtk.Rectangle inner_rect);
#if HAS_MUTTER46
public void crop_and_scale (Graphene.Rect src_rect, int dst_width, int dst_height, Mtk.Rectangle dest);
#endif
public bool equal (Mtk.Rectangle src2);
public void free ();
public static Mtk.Rectangle from_graphene_rect (Graphene.Rect rect, Mtk.RoundingStrategy rounding_strategy);
public bool horiz_overlap (Mtk.Rectangle rect2);
public bool intersect (Mtk.Rectangle src2, out Mtk.Rectangle dest);
#if HAS_MUTTER46
public bool is_adjacent_to (Mtk.Rectangle other);
#endif
public bool overlap (Mtk.Rectangle rect2);
#if HAS_MUTTER46
public void scale_double (double scale, Mtk.RoundingStrategy rounding_strategy, Mtk.Rectangle dest);
#endif
public Graphene.Rect? to_graphene_rect ();
public Mtk.Rectangle union (Mtk.Rectangle rect2);
public bool vert_overlap (Mtk.Rectangle rect2);
}
#if HAS_MUTTER46
[CCode (cheader_filename = "mtk/mtk.h", has_type_id = false)]
public struct RegionBuilder {
[CCode (array_length_cname = "n_levels")]
public weak Mtk.Region levels[16];
public int n_levels;
[CCode (cname = "MTK_REGION_BUILDER_MAX_LEVELS")]
public const int MAX_LEVELS;
public void add_rectangle (int x, int y, int width, int height);
public Mtk.Region finish ();
public void init ();
}
[CCode (cheader_filename = "mtk/mtk.h", has_type_id = false)]
public struct RegionIterator {
public weak Mtk.Region region;
public Mtk.Rectangle rectangle;
public bool line_start;
public bool line_end;
public int i;
public bool at_end ();
public void init (Mtk.Region region);
public void next ();
}
[CCode (cheader_filename = "mtk/mtk.h", cprefix = "MTK_REGION_OVERLAP_", has_type_id = false)]
public enum RegionOverlap {
OUT,