Replaced manual type macros with G_DECLARE_DERIVABLE_TYPE in GtkXText, CustomList, SexySpellEntry, and RemoteObject declarations while aligning parent instance naming.

Switched GtkXText and CustomList implementations to G_DEFINE_TYPE/G_DEFINE_TYPE_WITH_CODE and preserved parent chaining behavior
Added GTK3/GTK2 conditional type declarations for GtkXText while restoring the legacy macro block for GTK2 builds.
Restored GTK2-friendly typedefs/macros and parent field naming for CustomList alongside GTK3 G_DECLARE_DERIVABLE_TYPE usage.
Restored GTK2-friendly typedefs/macros and parent field naming for SexySpellEntry while keeping GTK3 declarations intact.
Restored legacy RemoteObject typedefs and GType macros in the D-Bus plugin to keep GTK2 builds from seeing incomplete types or missing fields/macros.
This commit is contained in:
2026-01-31 10:45:22 -07:00
parent e1b4e18153
commit 9e46407e89
6 changed files with 58 additions and 127 deletions

View File

@@ -27,6 +27,12 @@
#include <cairo.h>
#include "xtext-color.h"
#if HAVE_GTK3
G_DECLARE_DERIVABLE_TYPE (GtkXText, gtk_xtext, GTK, XTEXT, GtkWidget)
#else
typedef struct _GtkXText GtkXText;
typedef struct _GtkXTextClass GtkXTextClass;
#define GTK_TYPE_XTEXT (gtk_xtext_get_type ())
#define GTK_XTEXT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_XTEXT, GtkXText))
#define GTK_XTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_XTEXT, GtkXTextClass))
@@ -34,6 +40,9 @@
#define GTK_IS_XTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_XTEXT))
#define GTK_XTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_XTEXT, GtkXTextClass))
GType gtk_xtext_get_type (void);
#endif
#define ATTR_BOLD '\002'
#define ATTR_COLOR '\003'
#define ATTR_BLINK '\006'
@@ -55,9 +64,6 @@
#define XTEXT_BG 35
#define XTEXT_MARKER 36 /* for marker line */
#define XTEXT_MAX_COLOR 41
typedef struct _GtkXText GtkXText;
typedef struct _GtkXTextClass GtkXTextClass;
typedef struct textentry textentry;
/*
@@ -300,6 +306,5 @@ xtext_buffer *gtk_xtext_buffer_new (GtkXText *xtext);
void gtk_xtext_buffer_free (xtext_buffer *buf);
void gtk_xtext_buffer_show (GtkXText *xtext, xtext_buffer *buf, int render);
void gtk_xtext_copy_selection (GtkXText *xtext);
GType gtk_xtext_get_type (void);
#endif