1/*
2 * LegacyClonk
3 *
4 * Copyright (c) RedWolf Design
5 * Copyright (c) 2006, Clonk-Karl
6 * Copyright (c) 2017-2020, The LegacyClonk Team and contributors
7 *
8 * Distributed under the terms of the ISC license; see accompanying file
9 * "COPYING" for details.
10 *
11 * "Clonk" is a registered trademark of Matthes Bender, used with permission.
12 * See accompanying file "TRADEMARK" for details.
13 *
14 * To redistribute this file separately, substitute the full license texts
15 * for the above references.
16 */
17
18/* GTK+ version of StdWindow */
19
20#pragma once
21
22#include <StdWindow.h>
23
24#include <gtk/gtk.h>
25
26class CStdGtkWindow : public CStdWindow
27{
28public:
29 virtual ~CStdGtkWindow();
30
31 virtual void Clear() override;
32
33 bool Init(CStdApp *app, const char *title, const C4Rect &bounds = DefaultBounds, CStdWindow *parent = nullptr) override;
34
35 GtkWidget *window{nullptr};
36
37protected:
38 // InitGUI should either return a widget which is used as a
39 // render target or return what the base class returns, in which
40 // case the whole window is used as render target.
41 virtual GtkWidget *InitGUI();
42
43private:
44 static void OnDestroyStatic(GtkWidget *widget, gpointer data);
45 static GdkFilterReturn OnFilter(GdkXEvent *xevent, GdkEvent *event, gpointer user_data);
46 static gboolean OnUpdateKeyMask(GtkWidget *widget, GdkEventKey *event, gpointer user_data);
47
48 gulong handlerDestroy;
49};
50