diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-07-30 15:22:17 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-07-30 15:22:17 +0200 |
| commit | 5ad314ba5a386a4f92e3bcbcb7743771a607791e (patch) | |
| tree | 4d4468342f87d5154f2ba3a25af7a8d2e4b70077 /src | |
| parent | c7473dd7c969da6547ace1cd769ebbee5e2b7c34 (diff) | |
| download | box64-5ad314ba5a386a4f92e3bcbcb7743771a607791e.tar.gz box64-5ad314ba5a386a4f92e3bcbcb7743771a607791e.zip | |
Added wrapping of GtkTextViewClass in gtk2
Diffstat (limited to 'src')
| -rwxr-xr-x | src/include/gtkclass.h | 25 | ||||
| -rwxr-xr-x | src/tools/gtkclass.c | 58 | ||||
| -rwxr-xr-x | src/wrapped/wrappedgtkx112.c | 2 |
3 files changed, 85 insertions, 0 deletions
diff --git a/src/include/gtkclass.h b/src/include/gtkclass.h index 0fe6dd30..18fc0150 100755 --- a/src/include/gtkclass.h +++ b/src/include/gtkclass.h @@ -447,6 +447,30 @@ typedef struct my_GtkMenuBar2Class_s { void (*_gtk_reserved4) (void); } my_GtkMenuBar2Class_t; +typedef struct my_GtkTextView2Class_s { + my_GtkContainer2Class_t parent_class; + void (* set_scroll_adjustments) (void* text_view, void* hadjustment, void* vadjustment); + void (* populate_popup) (void* text_view, void* menu); + void (* move_cursor) (void* text_view, int step, int count, int extend_selection); + void (* page_horizontally) (void* text_view, int count, int extend_selection); + void (* set_anchor) (void* text_view); + void (* insert_at_cursor) (void* text_view, void* str); + void (* delete_from_cursor) (void* text_view, int type, int count); + void (* backspace) (void* text_view); + void (* cut_clipboard) (void* text_view); + void (* copy_clipboard) (void* text_view); + void (* paste_clipboard) (void* text_view); + void (* toggle_overwrite) (void* text_view); + void (* move_focus) (void* text_view, int direction); + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); + void (*_gtk_reserved3) (void); + void (*_gtk_reserved4) (void); + void (*_gtk_reserved5) (void); + void (*_gtk_reserved6) (void); + void (*_gtk_reserved7) (void); +} my_GtkTextView2Class_t; + typedef struct my_MetaFrames2Class_s { my_GtkWindow2Class_t parent_class; @@ -584,6 +608,7 @@ GTKCLASS(GtkProgressBar2) \ GTKCLASS(GtkFrame2) \ GTKCLASS(GtkMenuShell2) \ GTKCLASS(GtkMenuBar2) \ +GTKCLASS(GtkTextView2) \ GTKCLASS(MetaFrames2) \ GTKCLASS(GDBusObjectManagerClient) \ GTKCLASS(AtkObject) \ diff --git a/src/tools/gtkclass.c b/src/tools/gtkclass.c index e271f87d..2a8ee921 100755 --- a/src/tools/gtkclass.c +++ b/src/tools/gtkclass.c @@ -1415,6 +1415,64 @@ static void bridgeGtkMenuBar2Class(my_GtkMenuBar2Class_t* class) #undef SUPERGO +// ----- GtkTextView2Class ------ +// wrapper x86 -> natives of callbacks +WRAPPER(GtkTextView2, set_scroll_adjustments, void, (void* text_view, void* hadjustment, void* vadjustment), 3, text_view, hadjustment, vadjustment); +WRAPPER(GtkTextView2, populate_popup, void, (void* text_view, void* menu), 2, text_view, menu); +WRAPPER(GtkTextView2, move_cursor, void, (void* text_view, int step, int count, int extend_selection), 4, text_view, step, count, extend_selection); +WRAPPER(GtkTextView2, page_horizontally, void, (void* text_view, int count, int extend_selection), 3, text_view, count, extend_selection); +WRAPPER(GtkTextView2, set_anchor, void, (void* text_view), 1, text_view); +WRAPPER(GtkTextView2, insert_at_cursor, void, (void* text_view, void* str), 2, text_view, str); +WRAPPER(GtkTextView2, delete_from_cursor, void, (void* text_view, int type, int count), 3, text_view, type, count); +WRAPPER(GtkTextView2, backspace, void, (void* text_view), 1, text_view); +WRAPPER(GtkTextView2, cut_clipboard, void, (void* text_view), 1, text_view); +WRAPPER(GtkTextView2, copy_clipboard, void, (void* text_view), 1, text_view); +WRAPPER(GtkTextView2, paste_clipboard, void, (void* text_view), 1, text_view); +WRAPPER(GtkTextView2, toggle_overwrite, void, (void* text_view), 1, text_view); +WRAPPER(GtkTextView2, move_focus, void, (void* text_view, int direction), 2, text_view, direction); + +#define SUPERGO() \ + GO(set_scroll_adjustments, vFppp); \ + GO(populate_popup, vFpp); \ + GO(move_cursor, vFpiii); \ + GO(page_horizontally, vFpii); \ + GO(set_anchor, vFp); \ + GO(insert_at_cursor, vFpp); \ + GO(delete_from_cursor, vFpii); \ + GO(backspace, vFp); \ + GO(cut_clipboard, vFp); \ + GO(copy_clipboard, vFp); \ + GO(paste_clipboard, vFp); \ + GO(toggle_overwrite, vFp); \ + GO(move_focus, vFpi); \ + +// wrap (so bridge all calls, just in case) +static void wrapGtkTextView2Class(my_GtkTextView2Class_t* class) +{ + wrapGtkContainer2Class(&class->parent_class); + #define GO(A, W) class->A = reverse_##A##_GtkTextView2 (W, class->A) + SUPERGO() + #undef GO +} +// unwrap (and use callback if not a native call anymore) +static void unwrapGtkTextView2Class(my_GtkTextView2Class_t* class) +{ + unwrapGtkContainer2Class(&class->parent_class); + #define GO(A, W) class->A = find_##A##_GtkTextView2 (class->A) + SUPERGO() + #undef GO +} +// autobridge +static void bridgeGtkTextView2Class(my_GtkTextView2Class_t* class) +{ + bridgeGtkContainer2Class(&class->parent_class); + #define GO(A, W) autobridge_##A##_GtkTextView2 (W, class->A) + SUPERGO() + #undef GO +} + +#undef SUPERGO + // ----- AtkObjectClass ------ // wrapper x86 -> natives of callbacks WRAPPER(AtkObject, get_name, void*, (void* accessible), 1, accessible); diff --git a/src/wrapped/wrappedgtkx112.c b/src/wrapped/wrappedgtkx112.c index f787d156..e5f40f74 100755 --- a/src/wrapped/wrappedgtkx112.c +++ b/src/wrapped/wrappedgtkx112.c @@ -62,6 +62,7 @@ typedef unsigned long (*LFpppppi_t)(void*, void*, void*, void*, void*, int); GO(gtk_progress_bar_get_type, LFv_t) \ GO(gtk_menu_shell_get_type, LFv_t) \ GO(gtk_menu_bar_get_type, LFv_t) \ + GO(gtk_text_view_get_type, LFv_t) \ GO(gtk_action_get_type, LFv_t) \ GO(g_type_class_ref, pFL_t) \ GO(g_type_class_unref, vFp_t) \ @@ -1128,6 +1129,7 @@ EXPORT void* my_gtk_link_button_set_uri_hook(x64emu_t* emu, void* f, void* data, SetGtkFrame2ID(my->gtk_frame_get_type()); \ SetGtkMenuShell2ID(my->gtk_menu_shell_get_type()); \ SetGtkMenuBar2ID(my->gtk_menu_bar_get_type()); \ + SetGtkTextView2ID(my->gtk_text_view_get_type()); \ setNeededLibs(lib, 2, "libgdk-x11-2.0.so.0", "libpangocairo-1.0.so.0"); #define CUSTOM_FINI \ |