mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-21 13:10:19 +00:00
Replaced legacy GTK type macro blocks with G_DECLARE_* declarations for GtkXText, CustomList, and SexySpellEntry, and aligned the GtkXText parent field naming across GTK2/GTK3 guards.
Updated RemoteObject to use G_DECLARE_FINAL_TYPE and the parent_instance field naming convention
This commit is contained in:
@@ -40,14 +40,11 @@ static GList *contexts = NULL;
|
|||||||
static GHashTable *clients = NULL;
|
static GHashTable *clients = NULL;
|
||||||
static DBusGConnection *connection;
|
static DBusGConnection *connection;
|
||||||
|
|
||||||
typedef struct _RemoteObject RemoteObject;
|
G_DECLARE_FINAL_TYPE (RemoteObject, remote_object, REMOTE, OBJECT, GObject)
|
||||||
typedef struct _RemoteObjectClass RemoteObjectClass;
|
|
||||||
|
|
||||||
GType remote_object_get_type (void);
|
|
||||||
|
|
||||||
struct _RemoteObject
|
struct _RemoteObject
|
||||||
{
|
{
|
||||||
GObject parent;
|
GObject parent_instance;
|
||||||
|
|
||||||
guint last_hook_id;
|
guint last_hook_id;
|
||||||
guint last_list_id;
|
guint last_list_id;
|
||||||
@@ -59,11 +56,6 @@ struct _RemoteObject
|
|||||||
void *handle;
|
void *handle;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _RemoteObjectClass
|
|
||||||
{
|
|
||||||
GObjectClass parent_class;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
guint id;
|
guint id;
|
||||||
@@ -89,12 +81,6 @@ enum
|
|||||||
|
|
||||||
static guint signals[LAST_SIGNAL] = { 0 };
|
static guint signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
#define REMOTE_TYPE_OBJECT (remote_object_get_type ())
|
|
||||||
#define REMOTE_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REMOTE_TYPE_OBJECT, RemoteObject))
|
|
||||||
#define REMOTE_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), REMOTE_TYPE_OBJECT, RemoteObjectClass))
|
|
||||||
#define REMOTE_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), REMOTE_TYPE_OBJECT))
|
|
||||||
#define REMOTE_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), REMOTE_TYPE_OBJECT))
|
|
||||||
#define REMOTE_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), REMOTE_TYPE_OBJECT, RemoteObjectClass))
|
|
||||||
#define REMOTE_OBJECT_ERROR (remote_object_error_quark ())
|
#define REMOTE_OBJECT_ERROR (remote_object_error_quark ())
|
||||||
#define REMOTE_TYPE_ERROR (remote_object_error_get_type ())
|
#define REMOTE_TYPE_ERROR (remote_object_error_get_type ())
|
||||||
|
|
||||||
@@ -376,7 +362,7 @@ remote_object_connect (RemoteObject *obj,
|
|||||||
}
|
}
|
||||||
g_snprintf(count_buffer, sizeof(count_buffer), "%u", count++);
|
g_snprintf(count_buffer, sizeof(count_buffer), "%u", count++);
|
||||||
path = g_build_filename (DBUS_OBJECT_PATH, count_buffer, NULL);
|
path = g_build_filename (DBUS_OBJECT_PATH, count_buffer, NULL);
|
||||||
remote_object = g_object_new (REMOTE_TYPE_OBJECT, NULL);
|
remote_object = g_object_new (remote_object_get_type (), NULL);
|
||||||
remote_object->dbus_path = path;
|
remote_object->dbus_path = path;
|
||||||
remote_object->filename = g_path_get_basename (filename);
|
remote_object->filename = g_path_get_basename (filename);
|
||||||
remote_object->handle = zoitechat_plugingui_add (ph,
|
remote_object->handle = zoitechat_plugingui_add (ph,
|
||||||
@@ -891,8 +877,8 @@ init_dbus (void)
|
|||||||
guint request_name_result;
|
guint request_name_result;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
dbus_g_object_type_install_info (REMOTE_TYPE_OBJECT,
|
dbus_g_object_type_install_info (remote_object_get_type (),
|
||||||
&dbus_glib_remote_object_object_info);
|
&dbus_glib_remote_object_object_info);
|
||||||
|
|
||||||
connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
|
connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
|
||||||
if (connection == NULL) {
|
if (connection == NULL) {
|
||||||
@@ -930,7 +916,7 @@ init_dbus (void)
|
|||||||
G_CALLBACK (name_owner_changed),
|
G_CALLBACK (name_owner_changed),
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
remote = g_object_new (REMOTE_TYPE_OBJECT, NULL);
|
remote = g_object_new (remote_object_get_type (), NULL);
|
||||||
dbus_g_connection_register_g_object (connection,
|
dbus_g_connection_register_g_object (connection,
|
||||||
DBUS_OBJECT_PATH"/Remote",
|
DBUS_OBJECT_PATH"/Remote",
|
||||||
G_OBJECT (remote));
|
G_OBJECT (remote));
|
||||||
|
|||||||
@@ -22,9 +22,6 @@
|
|||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
#if HAVE_GTK3
|
|
||||||
G_DECLARE_DERIVABLE_TYPE (CustomList, custom_list, CUSTOM, LIST, GObject)
|
|
||||||
#else
|
|
||||||
typedef struct _CustomList CustomList;
|
typedef struct _CustomList CustomList;
|
||||||
typedef struct _CustomListClass CustomListClass;
|
typedef struct _CustomListClass CustomListClass;
|
||||||
|
|
||||||
@@ -39,7 +36,6 @@ GType custom_list_get_type (void);
|
|||||||
#define CUSTOM_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CUSTOM_TYPE_LIST))
|
#define CUSTOM_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CUSTOM_TYPE_LIST))
|
||||||
#define CUSTOM_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CUSTOM_TYPE_LIST))
|
#define CUSTOM_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CUSTOM_TYPE_LIST))
|
||||||
#define CUSTOM_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CUSTOM_TYPE_LIST, CustomListClass))
|
#define CUSTOM_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CUSTOM_TYPE_LIST, CustomListClass))
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The data columns that we export via the tree model interface */
|
/* The data columns that we export via the tree model interface */
|
||||||
|
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ struct _GtkXText
|
|||||||
#if HAVE_GTK3
|
#if HAVE_GTK3
|
||||||
GtkWidget parent_instance;
|
GtkWidget parent_instance;
|
||||||
#else
|
#else
|
||||||
GtkWidget widget;
|
GtkWidget parent;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
xtext_buffer *buffer;
|
xtext_buffer *buffer;
|
||||||
|
|||||||
Reference in New Issue
Block a user