diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-10-27 19:36:11 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-10-27 19:36:11 +0200 |
| commit | 3564f41c48304c61138c943dc22265dc1331003f (patch) | |
| tree | e734b0b91935fc461cae87bb6a843fa03e61c9b0 /src | |
| parent | 72314a33ab15710ba0986543a807ccc290482143 (diff) | |
| download | box64-3564f41c48304c61138c943dc22265dc1331003f.tar.gz box64-3564f41c48304c61138c943dc22265dc1331003f.zip | |
Wrapping of GtkTextView and GtkContainer classes for Gtk3
Diffstat (limited to 'src')
| -rwxr-xr-x | src/include/gtkclass.h | 48 | ||||
| -rwxr-xr-x | src/tools/gtkclass.c | 112 | ||||
| -rwxr-xr-x | src/wrapped/wrappedgtk3.c | 3 |
3 files changed, 163 insertions, 0 deletions
diff --git a/src/include/gtkclass.h b/src/include/gtkclass.h index 04c1fd5e..376f2173 100755 --- a/src/include/gtkclass.h +++ b/src/include/gtkclass.h @@ -248,6 +248,30 @@ typedef struct my_GtkContainer2Class_s void (*_gtk_reserved4) (void); } my_GtkContainer2Class_t; +typedef struct my_GtkContainer3Class_s +{ + my_GtkWidget3Class_t parent_class; + void (*add) (void* container, void* widget); + void (*remove) (void* container, void* widget); + void (*check_resize) (void* container); + void (*forall) (void* container, int include_internals, void* callback, void* callback_data); + void (*set_focus_child) (void* container, void* widget); + int (*child_type) (void* container); + void* (*composite_name) (void* container, void* child); + void (*set_child_property) (void* container, void* child, uint32_t property_id, void* value, void* pspec); + void (*get_child_property) (void* container, void* child, uint32_t property_id, void* value, void* pspec); + void* (*get_path_for_child) (void* container, void* child); + unsigned int _handle_border_width : 1; + 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); + void (*_gtk_reserved8) (void); +} my_GtkContainer3Class_t; + typedef struct my_GtkActionClass_s { my_GObjectClass_t parent_class; @@ -471,6 +495,28 @@ typedef struct my_GtkTextView2Class_s { void (*_gtk_reserved7) (void); } my_GtkTextView2Class_t; +typedef struct my_GtkTextView3Class_s { + my_GtkContainer3Class_t parent_class; + void (* populate_popup) (void* text_view, void* menu); + void (* move_cursor) (void* text_view, int step, 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*(* create_buffer) (void* text_view); + void (* draw_layer) (void* text_view, int layer, void* cr); + int (* extend_selection) (void* text_view, int granularity, void* location, void* start, void* end); + void (* insert_emoji) (void* text_view); + void (*_gtk_reserved1) (void); + void (*_gtk_reserved2) (void); + void (*_gtk_reserved3) (void); + void (*_gtk_reserved4) (void); +} my_GtkTextView3Class_t; + typedef struct my_MetaFrames2Class_s { my_GtkWindow2Class_t parent_class; @@ -601,6 +647,7 @@ GTKCLASS(GtkObject) \ GTKCLASS(GtkWidget2) \ GTKCLASS(GtkWidget3) \ GTKCLASS(GtkContainer2) \ +GTKCLASS(GtkContainer3) \ GTKCLASS(GtkAction) \ GTKCLASS(GtkLabel2) \ GTKCLASS(GtkMisc2) \ @@ -621,6 +668,7 @@ GTKCLASS(GtkFrame2) \ GTKCLASS(GtkMenuShell2) \ GTKCLASS(GtkMenuBar2) \ GTKCLASS(GtkTextView2) \ +GTKCLASS(GtkTextView3) \ GTKCLASS(MetaFrames2) \ GTKCLASS(GDBusObjectManagerClient) \ GTKCLASS(AtkObject) \ diff --git a/src/tools/gtkclass.c b/src/tools/gtkclass.c index 35e6c7fd..e57e54a9 100755 --- a/src/tools/gtkclass.c +++ b/src/tools/gtkclass.c @@ -664,6 +664,58 @@ static void bridgeGtkContainer2Class(my_GtkContainer2Class_t* class) #undef SUPERGO +// ----- GtkContainer3Class ------ +// wrapper x86 -> natives of callbacks +WRAPPER(GtkContainer3, add, void, (void* container, void* widget), 2, container, widget); +WRAPPER(GtkContainer3, remove, void, (void* container, void* widget), 2, container, widget); +WRAPPER(GtkContainer3, check_resize, void, (void* container), 1, container); +WRAPPER(GtkContainer3, forall, void, (void* container, int include_internals, void* callback, void* callback_data), 4, container, include_internals, AddCheckBridge(my_bridge, vFpp, callback, 0, NULL), callback_data); +WRAPPER(GtkContainer3, set_focus_child, void, (void* container, void* widget), 2, container, widget); +WRAPPER(GtkContainer3, child_type, int, (void* container), 1, container); +WRAPPER(GtkContainer3, composite_name, void*, (void* container, void* child), 2, container, child); +WRAPPER(GtkContainer3, set_child_property, void, (void* container, void* child, uint32_t property_id, void* value, void* pspec), 5, container, child, property_id, value, pspec); +WRAPPER(GtkContainer3, get_child_property, void, (void* container, void* child, uint32_t property_id, void* value, void* pspec), 5, container, child, property_id, value, pspec); +WRAPPER(GtkContainer3, get_path_for_child, void*, (void* container, void* child), 2, container, child); + +#define SUPERGO() \ + GO(add, vFpp); \ + GO(remove, vFpp); \ + GO(check_resize, vFp); \ + GO(forall, vFpipp); \ + GO(set_focus_child, vFpp); \ + GO(child_type, iFp); \ + GO(composite_name, pFpp); \ + GO(set_child_property, vFppupp);\ + GO(get_child_property, vFppupp);\ + GO(get_path_for_child, pFpp); \ + +// wrap (so bridge all calls, just in case) +static void wrapGtkContainer3Class(my_GtkContainer3Class_t* class) +{ + wrapGtkWidget3Class(&class->parent_class); + #define GO(A, W) class->A = reverse_##A##_GtkContainer3 (W, class->A) + SUPERGO() + #undef GO +} +// unwrap (and use callback if not a native call anymore) +static void unwrapGtkContainer3Class(my_GtkContainer3Class_t* class) +{ + unwrapGtkWidget3Class(&class->parent_class); + #define GO(A, W) class->A = find_##A##_GtkContainer3 (class->A) + SUPERGO() + #undef GO +} +// autobridge +static void bridgeGtkContainer3Class(my_GtkContainer3Class_t* class) +{ + bridgeGtkWidget3Class(&class->parent_class); + #define GO(A, W) autobridge_##A##_GtkContainer3 (W, class->A) + SUPERGO() + #undef GO +} + +#undef SUPERGO + // ----- GtkActionClass ------ // wrapper x86 -> natives of callbacks WRAPPER(GtkAction, activate, void, (void* action), 1, action); @@ -1474,6 +1526,66 @@ static void bridgeGtkTextView2Class(my_GtkTextView2Class_t* class) #undef SUPERGO +// ----- GtkTextView3Class ------ +// wrapper x86 -> natives of callbacks +WRAPPER(GtkTextView3, populate_popup, void, (void* text_view, void* menu), 2, text_view, menu); +WRAPPER(GtkTextView3, move_cursor, void, (void* text_view, int step, int count, int extend_selection), 4, text_view, step, count, extend_selection); +WRAPPER(GtkTextView3, set_anchor, void, (void* text_view), 1, text_view); +WRAPPER(GtkTextView3, insert_at_cursor, void, (void* text_view, void* str), 2, text_view, str); +WRAPPER(GtkTextView3, delete_from_cursor, void, (void* text_view, int type, int count), 3, text_view, type, count); +WRAPPER(GtkTextView3, backspace, void, (void* text_view), 1, text_view); +WRAPPER(GtkTextView3, cut_clipboard, void, (void* text_view), 1, text_view); +WRAPPER(GtkTextView3, copy_clipboard, void, (void* text_view), 1, text_view); +WRAPPER(GtkTextView3, paste_clipboard, void, (void* text_view), 1, text_view); +WRAPPER(GtkTextView3, toggle_overwrite, void, (void* text_view), 1, text_view); +WRAPPER(GtkTextView3, create_buffer, void*, (void* text_view), 1, text_view); +WRAPPER(GtkTextView3, draw_layer, void, (void* text_view, int layer, void* cr), 3, text_view, layer, cr); +WRAPPER(GtkTextView3, extend_selection, int, (void* text_view, int granularity, void* location, void* start, void* end), 5, text_view, granularity, location, start, end); +WRAPPER(GtkTextView3, insert_emoji, void, (void* text_view), 1, text_view); + +#define SUPERGO() \ + GO(populate_popup, vFpp); \ + GO(move_cursor, vFpiii); \ + 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(create_buffer, pFp); \ + GO(draw_layer, vFpip); \ + GO(extend_selection, iFpippp); \ + GO(insert_emoji, vFp); \ + +// wrap (so bridge all calls, just in case) +static void wrapGtkTextView3Class(my_GtkTextView3Class_t* class) +{ + wrapGtkContainer3Class(&class->parent_class); + #define GO(A, W) class->A = reverse_##A##_GtkTextView3 (W, class->A) + SUPERGO() + #undef GO +} +// unwrap (and use callback if not a native call anymore) +static void unwrapGtkTextView3Class(my_GtkTextView3Class_t* class) +{ + unwrapGtkContainer3Class(&class->parent_class); + #define GO(A, W) class->A = find_##A##_GtkTextView3 (class->A) + SUPERGO() + #undef GO +} +// autobridge +static void bridgeGtkTextView3Class(my_GtkTextView3Class_t* class) +{ + bridgeGtkContainer3Class(&class->parent_class); + #define GO(A, W) autobridge_##A##_GtkTextView3 (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/wrappedgtk3.c b/src/wrapped/wrappedgtk3.c index 8fe61d10..b3842e13 100755 --- a/src/wrapped/wrappedgtk3.c +++ b/src/wrapped/wrappedgtk3.c @@ -52,6 +52,7 @@ GO(gtk_fixed_get_type, LFv_t) \ GO(gtk_combo_box_get_type, LFv_t) \ GO(gtk_toggle_button_get_type, LFv_t) \ GO(gtk_check_button_get_type, LFv_t) \ +GO(gtk_text_view_get_type, LFv_t) \ GO(gtk_frame_get_type, LFv_t) \ GO(gtk_entry_get_type, LFv_t) \ GO(gtk_spin_button_get_type, LFv_t) \ @@ -729,6 +730,8 @@ EXPORT void my3_gtk_container_foreach(x64emu_t* emu, void* container, void* cb, SETALT(my3_); \ SetGInitiallyUnownedID(my->g_initially_unowned_get_type()); \ SetGtkWidget3ID(my->gtk_widget_get_type()); \ + SetGtkContainer3ID(my->gtk_container_get_type()); \ + SetGtkTextView3ID(my->gtk_text_view_get_type()); \ SetGtkActionID(my->gtk_action_get_type()); \ setNeededLibs(lib, 2, "libgdk-3.so.0", "libpangocairo-1.0.so.0"); |