mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-27 17:13:40 +00:00
Drop unneeded GTK methods
This commit is contained in:
parent
384a71930d
commit
06a4480520
@ -69,19 +69,10 @@ void gtkMessageHandler(
|
||||
bool setupGtkBase(QLibrary &lib_gtk) {
|
||||
if (!load(lib_gtk, "gtk_init_check", gtk_init_check)) return false;
|
||||
if (!load(lib_gtk, "gtk_settings_get_default", gtk_settings_get_default)) return false;
|
||||
if (!load(lib_gtk, "gtk_menu_new", gtk_menu_new)) return false;
|
||||
if (!load(lib_gtk, "gtk_menu_get_type", gtk_menu_get_type)) return false;
|
||||
|
||||
if (!load(lib_gtk, "gtk_menu_item_new_with_label", gtk_menu_item_new_with_label)) return false;
|
||||
if (!load(lib_gtk, "gtk_menu_item_set_label", gtk_menu_item_set_label)) return false;
|
||||
if (!load(lib_gtk, "gtk_menu_shell_append", gtk_menu_shell_append)) return false;
|
||||
if (!load(lib_gtk, "gtk_menu_shell_get_type", gtk_menu_shell_get_type)) return false;
|
||||
if (!load(lib_gtk, "gtk_widget_show", gtk_widget_show)) return false;
|
||||
if (!load(lib_gtk, "gtk_widget_hide", gtk_widget_hide)) return false;
|
||||
if (!load(lib_gtk, "gtk_widget_get_toplevel", gtk_widget_get_toplevel)) return false;
|
||||
if (!load(lib_gtk, "gtk_widget_get_visible", gtk_widget_get_visible)) return false;
|
||||
if (!load(lib_gtk, "gtk_widget_get_window", gtk_widget_get_window)) return false;
|
||||
if (!load(lib_gtk, "gtk_widget_set_sensitive", gtk_widget_set_sensitive)) return false;
|
||||
if (!load(lib_gtk, "gtk_widget_realize", gtk_widget_realize)) return false;
|
||||
if (!load(lib_gtk, "gtk_widget_hide_on_delete", gtk_widget_hide_on_delete)) return false;
|
||||
if (!load(lib_gtk, "gtk_widget_destroy", gtk_widget_destroy)) return false;
|
||||
@ -126,17 +117,11 @@ bool setupGtkBase(QLibrary &lib_gtk) {
|
||||
if (!load(lib_gtk, "g_type_check_instance_cast", g_type_check_instance_cast)) return false;
|
||||
if (!load(lib_gtk, "g_type_check_instance_is_a", g_type_check_instance_is_a)) return false;
|
||||
if (!load(lib_gtk, "g_signal_connect_data", g_signal_connect_data)) return false;
|
||||
if (!load(lib_gtk, "g_signal_handler_disconnect", g_signal_handler_disconnect)) return false;
|
||||
|
||||
if (!load(lib_gtk, "g_object_get", g_object_get)) return false;
|
||||
if (!load(lib_gtk, "g_object_ref_sink", g_object_ref_sink)) return false;
|
||||
if (!load(lib_gtk, "g_object_unref", g_object_unref)) return false;
|
||||
if (!load(lib_gtk, "g_free", g_free)) return false;
|
||||
if (!load(lib_gtk, "g_list_foreach", g_list_foreach)) return false;
|
||||
if (!load(lib_gtk, "g_list_free", g_list_free)) return false;
|
||||
if (!load(lib_gtk, "g_list_free_full", g_list_free_full)) return false;
|
||||
|
||||
if (!load(lib_gtk, "g_error_free", g_error_free)) return false;
|
||||
if (!load(lib_gtk, "g_slist_free", g_slist_free)) return false;
|
||||
|
||||
if (!load(lib_gtk, "g_log_set_handler", g_log_set_handler)) return false;
|
||||
@ -189,18 +174,9 @@ bool setupGtkBase(QLibrary &lib_gtk) {
|
||||
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
|
||||
f_gtk_init_check gtk_init_check = nullptr;
|
||||
f_gtk_settings_get_default gtk_settings_get_default = nullptr;
|
||||
f_gtk_menu_new gtk_menu_new = nullptr;
|
||||
f_gtk_menu_get_type gtk_menu_get_type = nullptr;
|
||||
f_gtk_menu_item_new_with_label gtk_menu_item_new_with_label = nullptr;
|
||||
f_gtk_menu_item_set_label gtk_menu_item_set_label = nullptr;
|
||||
f_gtk_menu_shell_append gtk_menu_shell_append = nullptr;
|
||||
f_gtk_menu_shell_get_type gtk_menu_shell_get_type = nullptr;
|
||||
f_gtk_widget_show gtk_widget_show = nullptr;
|
||||
f_gtk_widget_hide gtk_widget_hide = nullptr;
|
||||
f_gtk_widget_get_toplevel gtk_widget_get_toplevel = nullptr;
|
||||
f_gtk_widget_get_visible gtk_widget_get_visible = nullptr;
|
||||
f_gtk_widget_get_window gtk_widget_get_window = nullptr;
|
||||
f_gtk_widget_set_sensitive gtk_widget_set_sensitive = nullptr;
|
||||
f_gtk_widget_realize gtk_widget_realize = nullptr;
|
||||
f_gtk_widget_hide_on_delete gtk_widget_hide_on_delete = nullptr;
|
||||
f_gtk_widget_destroy gtk_widget_destroy = nullptr;
|
||||
@ -247,38 +223,16 @@ f_gtk_dialog_run gtk_dialog_run = nullptr;
|
||||
f_g_type_check_instance_cast g_type_check_instance_cast = nullptr;
|
||||
f_g_type_check_instance_is_a g_type_check_instance_is_a = nullptr;
|
||||
f_g_signal_connect_data g_signal_connect_data = nullptr;
|
||||
f_g_signal_handler_disconnect g_signal_handler_disconnect = nullptr;
|
||||
f_gdk_init_check gdk_init_check = nullptr;
|
||||
f_gdk_atom_intern gdk_atom_intern = nullptr;
|
||||
f_gdk_pixbuf_new_from_data gdk_pixbuf_new_from_data = nullptr;
|
||||
f_gdk_pixbuf_new_from_file gdk_pixbuf_new_from_file = nullptr;
|
||||
f_gdk_pixbuf_new_from_file_at_size gdk_pixbuf_new_from_file_at_size = nullptr;
|
||||
f_gdk_pixbuf_get_has_alpha gdk_pixbuf_get_has_alpha = nullptr;
|
||||
f_gdk_pixbuf_get_pixels gdk_pixbuf_get_pixels = nullptr;
|
||||
f_gdk_pixbuf_get_width gdk_pixbuf_get_width = nullptr;
|
||||
f_gdk_pixbuf_get_height gdk_pixbuf_get_height = nullptr;
|
||||
f_gdk_pixbuf_get_rowstride gdk_pixbuf_get_rowstride = nullptr;
|
||||
f_gtk_status_icon_new_from_pixbuf gtk_status_icon_new_from_pixbuf = nullptr;
|
||||
f_gtk_status_icon_set_from_pixbuf gtk_status_icon_set_from_pixbuf = nullptr;
|
||||
f_gtk_status_icon_new_from_file gtk_status_icon_new_from_file = nullptr;
|
||||
f_gtk_status_icon_set_from_file gtk_status_icon_set_from_file = nullptr;
|
||||
f_gtk_status_icon_set_title gtk_status_icon_set_title = nullptr;
|
||||
f_gtk_status_icon_set_tooltip_text gtk_status_icon_set_tooltip_text = nullptr;
|
||||
f_gtk_status_icon_set_visible gtk_status_icon_set_visible = nullptr;
|
||||
f_gtk_status_icon_is_embedded gtk_status_icon_is_embedded = nullptr;
|
||||
f_gtk_status_icon_get_geometry gtk_status_icon_get_geometry = nullptr;
|
||||
f_gtk_status_icon_position_menu gtk_status_icon_position_menu = nullptr;
|
||||
f_gtk_menu_popup gtk_menu_popup = nullptr;
|
||||
f_gtk_get_current_event_time gtk_get_current_event_time = nullptr;
|
||||
f_g_object_get g_object_get = nullptr;
|
||||
f_g_object_ref_sink g_object_ref_sink = nullptr;
|
||||
f_g_object_unref g_object_unref = nullptr;
|
||||
f_g_idle_add g_idle_add = nullptr;
|
||||
f_g_free g_free = nullptr;
|
||||
f_g_list_foreach g_list_foreach = nullptr;
|
||||
f_g_list_free g_list_free = nullptr;
|
||||
f_g_list_free_full g_list_free_full = nullptr;
|
||||
f_g_error_free g_error_free = nullptr;
|
||||
f_g_slist_free g_slist_free = nullptr;
|
||||
f_g_log_set_handler g_log_set_handler = nullptr;
|
||||
f_g_log_default_handler g_log_default_handler = nullptr;
|
||||
@ -304,23 +258,7 @@ void start() {
|
||||
}
|
||||
|
||||
if (gtkLoaded) {
|
||||
load(lib_gtk, "gdk_init_check", gdk_init_check);
|
||||
load(lib_gtk, "gdk_pixbuf_new_from_data", gdk_pixbuf_new_from_data);
|
||||
load(lib_gtk, "gdk_pixbuf_new_from_file", gdk_pixbuf_new_from_file);
|
||||
load(lib_gtk, "gdk_pixbuf_new_from_file_at_size", gdk_pixbuf_new_from_file_at_size);
|
||||
load(lib_gtk, "gtk_status_icon_new_from_pixbuf", gtk_status_icon_new_from_pixbuf);
|
||||
load(lib_gtk, "gtk_status_icon_set_from_pixbuf", gtk_status_icon_set_from_pixbuf);
|
||||
load(lib_gtk, "gtk_status_icon_new_from_file", gtk_status_icon_new_from_file);
|
||||
load(lib_gtk, "gtk_status_icon_set_from_file", gtk_status_icon_set_from_file);
|
||||
load(lib_gtk, "gtk_status_icon_set_title", gtk_status_icon_set_title);
|
||||
load(lib_gtk, "gtk_status_icon_set_tooltip_text", gtk_status_icon_set_tooltip_text);
|
||||
load(lib_gtk, "gtk_status_icon_set_visible", gtk_status_icon_set_visible);
|
||||
load(lib_gtk, "gtk_status_icon_is_embedded", gtk_status_icon_is_embedded);
|
||||
load(lib_gtk, "gtk_status_icon_get_geometry", gtk_status_icon_get_geometry);
|
||||
load(lib_gtk, "gtk_status_icon_position_menu", gtk_status_icon_position_menu);
|
||||
load(lib_gtk, "gtk_menu_popup", gtk_menu_popup);
|
||||
load(lib_gtk, "gtk_get_current_event_time", gtk_get_current_event_time);
|
||||
load(lib_gtk, "g_idle_add", g_idle_add);
|
||||
|
||||
internal::GdkHelperLoad(lib_gtk);
|
||||
|
||||
|
@ -47,42 +47,15 @@ extern f_gtk_init_check gtk_init_check;
|
||||
typedef GtkSettings* (*f_gtk_settings_get_default)(void);
|
||||
extern f_gtk_settings_get_default gtk_settings_get_default;
|
||||
|
||||
typedef GtkWidget* (*f_gtk_menu_new)(void);
|
||||
extern f_gtk_menu_new gtk_menu_new;
|
||||
|
||||
typedef GType (*f_gtk_menu_get_type)(void) G_GNUC_CONST;
|
||||
extern f_gtk_menu_get_type gtk_menu_get_type;
|
||||
|
||||
typedef GtkWidget* (*f_gtk_menu_item_new_with_label)(const gchar *label);
|
||||
extern f_gtk_menu_item_new_with_label gtk_menu_item_new_with_label;
|
||||
|
||||
typedef void (*f_gtk_menu_item_set_label)(GtkMenuItem *menu_item, const gchar *label);
|
||||
extern f_gtk_menu_item_set_label gtk_menu_item_set_label;
|
||||
|
||||
typedef void (*f_gtk_menu_shell_append)(GtkMenuShell *menu_shell, GtkWidget *child);
|
||||
extern f_gtk_menu_shell_append gtk_menu_shell_append;
|
||||
|
||||
typedef GType (*f_gtk_menu_shell_get_type)(void) G_GNUC_CONST;
|
||||
extern f_gtk_menu_shell_get_type gtk_menu_shell_get_type;
|
||||
|
||||
typedef void (*f_gtk_widget_show)(GtkWidget *widget);
|
||||
extern f_gtk_widget_show gtk_widget_show;
|
||||
|
||||
typedef void (*f_gtk_widget_hide)(GtkWidget *widget);
|
||||
extern f_gtk_widget_hide gtk_widget_hide;
|
||||
|
||||
typedef GtkWidget* (*f_gtk_widget_get_toplevel)(GtkWidget *widget);
|
||||
extern f_gtk_widget_get_toplevel gtk_widget_get_toplevel;
|
||||
|
||||
typedef gboolean (*f_gtk_widget_get_visible)(GtkWidget *widget);
|
||||
extern f_gtk_widget_get_visible gtk_widget_get_visible;
|
||||
|
||||
typedef GdkWindow* (*f_gtk_widget_get_window)(GtkWidget *widget);
|
||||
extern f_gtk_widget_get_window gtk_widget_get_window;
|
||||
|
||||
typedef void (*f_gtk_widget_set_sensitive)(GtkWidget *widget, gboolean sensitive);
|
||||
extern f_gtk_widget_set_sensitive gtk_widget_set_sensitive;
|
||||
|
||||
typedef void (*f_gtk_widget_realize)(GtkWidget *widget);
|
||||
extern f_gtk_widget_realize gtk_widget_realize;
|
||||
|
||||
@ -202,16 +175,6 @@ inline Result *g_type_cic_helper(Object *instance, GType iface_type) {
|
||||
return reinterpret_cast<Result*>(g_type_check_instance_cast(reinterpret_cast<GTypeInstance*>(instance), iface_type));
|
||||
}
|
||||
|
||||
template <typename Object>
|
||||
inline GtkMenu *gtk_menu_cast(Object *obj) {
|
||||
return g_type_cic_helper<GtkMenu, Object>(obj, gtk_menu_get_type());
|
||||
}
|
||||
|
||||
template <typename Object>
|
||||
inline GtkMenuShell *gtk_menu_shell_cast(Object *obj) {
|
||||
return g_type_cic_helper<GtkMenuShell, Object>(obj, gtk_menu_get_type());
|
||||
}
|
||||
|
||||
typedef GType (*f_gtk_dialog_get_type)(void) G_GNUC_CONST;
|
||||
extern f_gtk_dialog_get_type gtk_dialog_get_type;
|
||||
|
||||
@ -285,21 +248,9 @@ inline gulong g_signal_connect_swapped_helper(gpointer instance, const gchar *de
|
||||
return g_signal_connect_data(instance, detailed_signal, c_handler, data, destroy_data, G_CONNECT_SWAPPED);
|
||||
}
|
||||
|
||||
typedef void (*f_g_signal_handler_disconnect)(gpointer instance, gulong handler_id);
|
||||
extern f_g_signal_handler_disconnect g_signal_handler_disconnect;
|
||||
|
||||
typedef gboolean (*f_gdk_init_check)(gint *argc, gchar ***argv);
|
||||
extern f_gdk_init_check gdk_init_check;
|
||||
|
||||
typedef GdkAtom (*f_gdk_atom_intern)(const gchar *atom_name, gboolean only_if_exists);
|
||||
extern f_gdk_atom_intern gdk_atom_intern;
|
||||
|
||||
typedef GdkPixbuf* (*f_gdk_pixbuf_new_from_data)(const guchar *data, GdkColorspace colorspace, gboolean has_alpha, int bits_per_sample, int width, int height, int rowstride, GdkPixbufDestroyNotify destroy_fn, gpointer destroy_fn_data);
|
||||
extern f_gdk_pixbuf_new_from_data gdk_pixbuf_new_from_data;
|
||||
|
||||
typedef GdkPixbuf* (*f_gdk_pixbuf_new_from_file)(const gchar *filename, GError **error);
|
||||
extern f_gdk_pixbuf_new_from_file gdk_pixbuf_new_from_file;
|
||||
|
||||
typedef GdkPixbuf* (*f_gdk_pixbuf_new_from_file_at_size)(const gchar *filename, int width, int height, GError **error);
|
||||
extern f_gdk_pixbuf_new_from_file_at_size gdk_pixbuf_new_from_file_at_size;
|
||||
|
||||
@ -318,69 +269,15 @@ extern f_gdk_pixbuf_get_height gdk_pixbuf_get_height;
|
||||
typedef int (*f_gdk_pixbuf_get_rowstride)(const GdkPixbuf *pixbuf);
|
||||
extern f_gdk_pixbuf_get_rowstride gdk_pixbuf_get_rowstride;
|
||||
|
||||
typedef GtkStatusIcon* (*f_gtk_status_icon_new_from_pixbuf)(GdkPixbuf *pixbuf);
|
||||
extern f_gtk_status_icon_new_from_pixbuf gtk_status_icon_new_from_pixbuf;
|
||||
|
||||
typedef void (*f_gtk_status_icon_set_from_pixbuf)(GtkStatusIcon *status_icon, GdkPixbuf *pixbuf);
|
||||
extern f_gtk_status_icon_set_from_pixbuf gtk_status_icon_set_from_pixbuf;
|
||||
|
||||
typedef GtkStatusIcon* (*f_gtk_status_icon_new_from_file)(const gchar *filename);
|
||||
extern f_gtk_status_icon_new_from_file gtk_status_icon_new_from_file;
|
||||
|
||||
typedef void (*f_gtk_status_icon_set_from_file)(GtkStatusIcon *status_icon, const gchar *filename);
|
||||
extern f_gtk_status_icon_set_from_file gtk_status_icon_set_from_file;
|
||||
|
||||
typedef void (*f_gtk_status_icon_set_title)(GtkStatusIcon *status_icon, const gchar *title);
|
||||
extern f_gtk_status_icon_set_title gtk_status_icon_set_title;
|
||||
|
||||
typedef void (*f_gtk_status_icon_set_tooltip_text)(GtkStatusIcon *status_icon, const gchar *title);
|
||||
extern f_gtk_status_icon_set_tooltip_text gtk_status_icon_set_tooltip_text;
|
||||
|
||||
typedef void (*f_gtk_status_icon_set_visible)(GtkStatusIcon *status_icon, gboolean visible);
|
||||
extern f_gtk_status_icon_set_visible gtk_status_icon_set_visible;
|
||||
|
||||
typedef gboolean (*f_gtk_status_icon_is_embedded)(GtkStatusIcon *status_icon);
|
||||
extern f_gtk_status_icon_is_embedded gtk_status_icon_is_embedded;
|
||||
|
||||
typedef gboolean (*f_gtk_status_icon_get_geometry)(GtkStatusIcon *status_icon, GdkScreen **screen, GdkRectangle *area, GtkOrientation *orientation);
|
||||
extern f_gtk_status_icon_get_geometry gtk_status_icon_get_geometry;
|
||||
|
||||
typedef void (*f_gtk_status_icon_position_menu)(GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data);
|
||||
extern f_gtk_status_icon_position_menu gtk_status_icon_position_menu;
|
||||
|
||||
typedef void (*f_gtk_menu_popup)(GtkMenu *menu, GtkWidget *parent_menu_shell, GtkWidget *parent_menu_item, GtkMenuPositionFunc func, gpointer data, guint button, guint32 activate_time);
|
||||
extern f_gtk_menu_popup gtk_menu_popup;
|
||||
|
||||
typedef guint32 (*f_gtk_get_current_event_time)(void);
|
||||
extern f_gtk_get_current_event_time gtk_get_current_event_time;
|
||||
|
||||
typedef void (*f_g_object_get)(gpointer object, const gchar *first_property_name, ...) G_GNUC_NULL_TERMINATED;
|
||||
extern f_g_object_get g_object_get;
|
||||
|
||||
typedef gpointer (*f_g_object_ref_sink)(gpointer object);
|
||||
extern f_g_object_ref_sink g_object_ref_sink;
|
||||
|
||||
typedef void (*f_g_object_unref)(gpointer object);
|
||||
extern f_g_object_unref g_object_unref;
|
||||
|
||||
typedef guint (*f_g_idle_add)(GSourceFunc function, gpointer data);
|
||||
extern f_g_idle_add g_idle_add;
|
||||
|
||||
typedef void (*f_g_free)(gpointer mem);
|
||||
extern f_g_free g_free;
|
||||
|
||||
typedef void (*f_g_list_foreach)(GList *list, GFunc func, gpointer user_data);
|
||||
extern f_g_list_foreach g_list_foreach;
|
||||
|
||||
typedef void (*f_g_list_free)(GList *list);
|
||||
extern f_g_list_free g_list_free;
|
||||
|
||||
typedef void (*f_g_list_free_full)(GList *list, GDestroyNotify free_func);
|
||||
extern f_g_list_free_full g_list_free_full;
|
||||
|
||||
typedef void (*f_g_error_free)(GError *error);
|
||||
extern f_g_error_free g_error_free;
|
||||
|
||||
typedef void (*f_g_slist_free)(GSList *list);
|
||||
extern f_g_slist_free g_slist_free;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user