Atlas - SDL_gtk.h

Home / ext / SDL / src / core / unix Lines: 1 | Size: 4958 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)]
[FILE BEGIN]
1/* 2 Simple DirectMedia Layer 3 Copyright (C) 1997-2025 Sam Lantinga <[email protected]> 4 5 This software is provided 'as-is', without any express or implied 6 warranty. In no event will the authors be held liable for any damages 7 arising from the use of this software. 8 9 Permission is granted to anyone to use this software for any purpose, 10 including commercial applications, and to alter it and redistribute it 11 freely, subject to the following restrictions: 12 13 1. The origin of this software must not be misrepresented; you must not 14 claim that you wrote the original software. If you use this software 15 in a product, an acknowledgment in the product documentation would be 16 appreciated but is not required. 17 2. Altered source versions must be plainly marked as such, and must not be 18 misrepresented as being the original software. 19 3. This notice may not be removed or altered from any source distribution. 20*/ 21 22#include "SDL_internal.h" 23 24#ifndef SDL_gtk_h_ 25#define SDL_gtk_h_ 26 27/* Glib 2.0 */ 28 29typedef unsigned long gulong; 30typedef void *gpointer; 31typedef char gchar; 32typedef int gint; 33typedef unsigned int guint; 34typedef double gdouble; 35typedef gint gboolean; 36typedef void (*GCallback)(void); 37typedef struct _GClosure GClosure; 38typedef void (*GClosureNotify) (gpointer data, GClosure *closure); 39typedef gboolean (*GSourceFunc) (gpointer user_data); 40 41typedef struct _GParamSpec GParamSpec; 42typedef struct _GMainContext GMainContext; 43 44typedef enum SDL_GConnectFlags 45{ 46 SDL_G_CONNECT_DEFAULT = 0, 47 SDL_G_CONNECT_AFTER = 1 << 0, 48 SDL_G_CONNECT_SWAPPED = 1 << 1 49} SDL_GConnectFlags; 50 51#define SDL_G_CALLBACK(f) ((GCallback) (f)) 52#define SDL_G_TYPE_CIC(ip, gt, ct) ((ct*) ip) 53#define SDL_G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (SDL_G_TYPE_CIC ((instance), (g_type), c_type)) 54 55#define GTK_FALSE 0 56#define GTK_TRUE 1 57 58 59/* GTK 3.0 */ 60 61typedef struct _GtkMenu GtkMenu; 62typedef struct _GtkMenuItem GtkMenuItem; 63typedef struct _GtkMenuShell GtkMenuShell; 64typedef struct _GtkWidget GtkWidget; 65typedef struct _GtkCheckMenuItem GtkCheckMenuItem; 66typedef struct _GtkSettings GtkSettings; 67 68#define GTK_MENU_ITEM(obj) (SDL_G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_ITEM, GtkMenuItem)) 69#define GTK_WIDGET(widget) (SDL_G_TYPE_CHECK_INSTANCE_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget)) 70#define GTK_CHECK_MENU_ITEM(obj) (SDL_G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CHECK_MENU_ITEM, GtkCheckMenuItem)) 71#define GTK_MENU(obj) (SDL_G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU, GtkMenu)) 72 73 74typedef struct SDL_GtkContext 75{ 76 /* Glib 2.0 */ 77 struct 78 { 79 gulong (*signal_connect)(gpointer instance, const gchar *detailed_signal, void *c_handler, gpointer data); 80 gulong (*signal_connect_data)(gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer data, GClosureNotify destroy_data, SDL_GConnectFlags connect_flags); 81 void (*object_unref)(gpointer object); 82 gchar *(*mkdtemp)(gchar *template); 83 gchar *(*get_user_cache_dir)(void); 84 gpointer (*object_ref_sink)(gpointer object); 85 gpointer (*object_ref)(gpointer object); 86 void (*object_get)(gpointer object, const gchar *first_property_name, ...); 87 void (*signal_handler_disconnect)(gpointer instance, gulong handler_id); 88 void (*main_context_push_thread_default)(GMainContext *context); 89 void (*main_context_pop_thread_default)(GMainContext *context); 90 GMainContext *(*main_context_new)(void); 91 void (*main_context_unref)(GMainContext *context); 92 gboolean (*main_context_acquire)(GMainContext *context); 93 gboolean (*main_context_iteration)(GMainContext *context, gboolean may_block); 94 } g; 95 96 /* GTK 3.0 */ 97 struct 98 { 99 gboolean (*init_check)(int *argc, char ***argv); 100 GtkWidget *(*menu_new)(void); 101 GtkWidget *(*separator_menu_item_new)(void); 102 GtkWidget *(*menu_item_new_with_label)(const gchar *label); 103 void (*menu_item_set_submenu)(GtkMenuItem *menu_item, GtkWidget *submenu); 104 GtkWidget *(*check_menu_item_new_with_label)(const gchar *label); 105 void (*check_menu_item_set_active)(GtkCheckMenuItem *check_menu_item, gboolean is_active); 106 void (*widget_set_sensitive)(GtkWidget *widget, gboolean sensitive); 107 void (*widget_show)(GtkWidget *widget); 108 void (*menu_shell_append)(GtkMenuShell *menu_shell, GtkWidget *child); 109 void (*menu_shell_insert)(GtkMenuShell *menu_shell, GtkWidget *child, gint position); 110 void (*widget_destroy)(GtkWidget *widget); 111 const gchar *(*menu_item_get_label)(GtkMenuItem *menu_item); 112 void (*menu_item_set_label)(GtkMenuItem *menu_item, const gchar *label); 113 gboolean (*check_menu_item_get_active)(GtkCheckMenuItem *check_menu_item); 114 gboolean (*widget_get_sensitive)(GtkWidget *widget); 115 GtkSettings *(*settings_get_default)(void); 116 } gtk; 117} SDL_GtkContext; 118 119extern bool SDL_Gtk_Init(void); 120extern void SDL_Gtk_Quit(void); 121extern SDL_GtkContext *SDL_Gtk_EnterContext(void); 122extern void SDL_Gtk_ExitContext(SDL_GtkContext *ctx); 123extern void SDL_UpdateGtk(void); 124 125#endif // SDL_gtk_h_ 126
[FILE END]
(C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.