| 1035 | } |
| 1036 | |
| 1037 | static bool gtk3(Display* const display, |
| 1038 | const Window winId, |
| 1039 | const int x, |
| 1040 | const int y, |
| 1041 | const uint width, |
| 1042 | const uint height, |
| 1043 | double scaleFactor, |
| 1044 | const char* const url, |
| 1045 | const char* const initialJS, |
| 1046 | WebViewRingBuffer* const shmptr) |
| 1047 | { |
| 1048 | void* lib; |
| 1049 | if ((lib = dlopen("libwebkit2gtk-4.0.so.37", RTLD_NOW|RTLD_GLOBAL)) == nullptr && |
| 1050 | (lib = dlopen("libwebkit2gtk-4.1.so.0", RTLD_NOW|RTLD_GLOBAL)) == nullptr && |
| 1051 | (lib = dlopen("libwebkit2gtk-4.0.so", RTLD_NOW|RTLD_GLOBAL)) == nullptr && |
| 1052 | (lib = dlopen("libwebkit2gtk-4.1.so", RTLD_NOW|RTLD_GLOBAL)) == nullptr) |
| 1053 | { |
| 1054 | d_stdout("WebView gtk3 platform not available: %s", dlerror()); |
| 1055 | return false; |
| 1056 | } |
| 1057 | |
| 1058 | typedef void (*g_main_context_invoke_t)(void*, void*, void*); |
| 1059 | typedef ulong (*g_signal_connect_data_t)(void*, const char*, void*, void*, void*, int); |
| 1060 | typedef void (*gdk_set_allowed_backends_t)(const char*); |
| 1061 | typedef void (*gtk_container_add_t)(GtkContainer*, GtkWidget*); |
| 1062 | typedef gboolean (*gtk_init_check_t)(int*, char***); |
| 1063 | typedef void (*gtk_main_t)(); |
| 1064 | typedef void (*gtk_main_quit_t)(); |
| 1065 | typedef Window (*gtk_plug_get_id_t)(GtkPlug*); |
| 1066 | typedef GtkWidget* (*gtk_plug_new_t)(Window); |
| 1067 | typedef void (*gtk_widget_show_all_t)(GtkWidget*); |
| 1068 | typedef void (*gtk_window_move_t)(GtkWindow*, int, int); |
| 1069 | typedef void (*gtk_window_set_default_size_t)(GtkWindow*, int, int); |
| 1070 | typedef WebKitSettings* (*webkit_settings_new_t)(); |
| 1071 | typedef void (*webkit_settings_set_enable_developer_extras_t)(WebKitSettings*, gboolean); |
| 1072 | typedef void (*webkit_settings_set_enable_write_console_messages_to_stdout_t)(WebKitSettings*, gboolean); |
| 1073 | typedef void (*webkit_settings_set_hardware_acceleration_policy_t)(WebKitSettings*, int); |
| 1074 | typedef void (*webkit_settings_set_javascript_can_access_clipboard_t)(WebKitSettings*, gboolean); |
| 1075 | typedef void (*webkit_user_content_manager_add_script_t)(WebKitUserContentManager*, WebKitUserScript*); |
| 1076 | typedef gboolean (*webkit_user_content_manager_register_script_message_handler_t)(WebKitUserContentManager*, const char*); |
| 1077 | typedef WebKitUserScript* (*webkit_user_script_new_t)(const char*, int, int, const char* const*, const char* const*); |
| 1078 | typedef void* (*webkit_web_view_evaluate_javascript_t)(WebKitWebView*, const char*, ssize_t, const char*, const char*, void*, void*, void*); |
| 1079 | typedef WebKitUserContentManager* (*webkit_web_view_get_user_content_manager_t)(WebKitWebView*); |
| 1080 | typedef void (*webkit_web_view_load_uri_t)(WebKitWebView*, const char*); |
| 1081 | typedef GtkWidget* (*webkit_web_view_new_with_settings_t)(WebKitSettings*); |
| 1082 | typedef void* (*webkit_web_view_run_javascript_t)(WebKitWebView*, const char*, void*, void*, void*); |
| 1083 | typedef void (*webkit_web_view_set_background_color_t)(WebKitWebView*, const double*); |
| 1084 | |
| 1085 | CSYM(g_main_context_invoke_t, g_main_context_invoke) |
| 1086 | CSYM(g_signal_connect_data_t, g_signal_connect_data) |
| 1087 | CSYM(gdk_set_allowed_backends_t, gdk_set_allowed_backends) |
| 1088 | CSYM(gtk_container_add_t, gtk_container_add) |
| 1089 | CSYM(gtk_init_check_t, gtk_init_check) |
| 1090 | CSYM(gtk_main_t, gtk_main) |
| 1091 | CSYM(gtk_main_quit_t, gtk_main_quit) |
| 1092 | CSYM(gtk_plug_get_id_t, gtk_plug_get_id) |
| 1093 | CSYM(gtk_plug_new_t, gtk_plug_new) |
| 1094 | CSYM(gtk_widget_show_all_t, gtk_widget_show_all) |
no test coverage detected