Skip to content

Commit abfe6f0

Browse files
trancexpressakurtakov
authored andcommitted
Add WebKitBrowser seach native methods
1 parent d2cb26d commit abfe6f0

File tree

3 files changed

+124
-2
lines changed

3 files changed

+124
-2
lines changed

bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.c

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,88 @@ JNIEXPORT void JNICALL WebKitGTK_NATIVE(webkit_1download_1set_1destination)
965965
}
966966
#endif
967967

968+
#ifndef NO_webkit_1find_1controller_1search
969+
JNIEXPORT void JNICALL WebKitGTK_NATIVE(webkit_1find_1controller_1search)
970+
(JNIEnv *env, jclass that, jlong arg0, jbyteArray arg1, jint arg2, jint arg3)
971+
{
972+
jbyte *lparg1=NULL;
973+
WebKitGTK_NATIVE_ENTER(env, that, webkit_1find_1controller_1search_FUNC);
974+
if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail;
975+
/*
976+
webkit_find_controller_search(arg0, lparg1, arg2, arg3);
977+
*/
978+
{
979+
WebKitGTK_LOAD_FUNCTION(fp, webkit_find_controller_search)
980+
if (fp) {
981+
((void (CALLING_CONVENTION*)(jlong, jbyte *, jint, jint))fp)(arg0, lparg1, arg2, arg3);
982+
}
983+
}
984+
fail:
985+
if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
986+
WebKitGTK_NATIVE_EXIT(env, that, webkit_1find_1controller_1search_FUNC);
987+
}
988+
#endif
989+
990+
#ifndef NO_webkit_1find_1controller_1search_1finish
991+
JNIEXPORT jlong JNICALL WebKitGTK_NATIVE(webkit_1find_1controller_1search_1finish)
992+
(JNIEnv *env, jclass that, jlong arg0)
993+
{
994+
jlong rc = 0;
995+
WebKitGTK_NATIVE_ENTER(env, that, webkit_1find_1controller_1search_1finish_FUNC);
996+
/*
997+
rc = (jlong)webkit_find_controller_search_finish(arg0);
998+
*/
999+
{
1000+
WebKitGTK_LOAD_FUNCTION(fp, webkit_find_controller_search_finish)
1001+
if (fp) {
1002+
rc = (jlong)((jlong (CALLING_CONVENTION*)(jlong))fp)(arg0);
1003+
}
1004+
}
1005+
WebKitGTK_NATIVE_EXIT(env, that, webkit_1find_1controller_1search_1finish_FUNC);
1006+
return rc;
1007+
}
1008+
#endif
1009+
1010+
#ifndef NO_webkit_1find_1controller_1search_1next
1011+
JNIEXPORT jlong JNICALL WebKitGTK_NATIVE(webkit_1find_1controller_1search_1next)
1012+
(JNIEnv *env, jclass that, jlong arg0)
1013+
{
1014+
jlong rc = 0;
1015+
WebKitGTK_NATIVE_ENTER(env, that, webkit_1find_1controller_1search_1next_FUNC);
1016+
/*
1017+
rc = (jlong)webkit_find_controller_search_next(arg0);
1018+
*/
1019+
{
1020+
WebKitGTK_LOAD_FUNCTION(fp, webkit_find_controller_search_next)
1021+
if (fp) {
1022+
rc = (jlong)((jlong (CALLING_CONVENTION*)(jlong))fp)(arg0);
1023+
}
1024+
}
1025+
WebKitGTK_NATIVE_EXIT(env, that, webkit_1find_1controller_1search_1next_FUNC);
1026+
return rc;
1027+
}
1028+
#endif
1029+
1030+
#ifndef NO_webkit_1find_1controller_1search_1previous
1031+
JNIEXPORT jlong JNICALL WebKitGTK_NATIVE(webkit_1find_1controller_1search_1previous)
1032+
(JNIEnv *env, jclass that, jlong arg0)
1033+
{
1034+
jlong rc = 0;
1035+
WebKitGTK_NATIVE_ENTER(env, that, webkit_1find_1controller_1search_1previous_FUNC);
1036+
/*
1037+
rc = (jlong)webkit_find_controller_search_previous(arg0);
1038+
*/
1039+
{
1040+
WebKitGTK_LOAD_FUNCTION(fp, webkit_find_controller_search_previous)
1041+
if (fp) {
1042+
rc = (jlong)((jlong (CALLING_CONVENTION*)(jlong))fp)(arg0);
1043+
}
1044+
}
1045+
WebKitGTK_NATIVE_EXIT(env, that, webkit_1find_1controller_1search_1previous_FUNC);
1046+
return rc;
1047+
}
1048+
#endif
1049+
9681050
#ifndef NO_webkit_1get_1major_1version
9691051
JNIEXPORT jint JNICALL WebKitGTK_NATIVE(webkit_1get_1major_1version)
9701052
(JNIEnv *env, jclass that)
@@ -1836,6 +1918,26 @@ JNIEXPORT jdouble JNICALL WebKitGTK_NATIVE(webkit_1web_1view_1get_1estimated_1lo
18361918
}
18371919
#endif
18381920

1921+
#ifndef NO_webkit_1web_1view_1get_1find_1controller
1922+
JNIEXPORT jlong JNICALL WebKitGTK_NATIVE(webkit_1web_1view_1get_1find_1controller)
1923+
(JNIEnv *env, jclass that, jlong arg0)
1924+
{
1925+
jlong rc = 0;
1926+
WebKitGTK_NATIVE_ENTER(env, that, webkit_1web_1view_1get_1find_1controller_FUNC);
1927+
/*
1928+
rc = (jlong)webkit_web_view_get_find_controller(arg0);
1929+
*/
1930+
{
1931+
WebKitGTK_LOAD_FUNCTION(fp, webkit_web_view_get_find_controller)
1932+
if (fp) {
1933+
rc = (jlong)((jlong (CALLING_CONVENTION*)(jlong))fp)(arg0);
1934+
}
1935+
}
1936+
WebKitGTK_NATIVE_EXIT(env, that, webkit_1web_1view_1get_1find_1controller_FUNC);
1937+
return rc;
1938+
}
1939+
#endif
1940+
18391941
#ifndef NO_webkit_1web_1view_1get_1main_1resource
18401942
JNIEXPORT jlong JNICALL WebKitGTK_NATIVE(webkit_1web_1view_1get_1main_1resource)
18411943
(JNIEnv *env, jclass that, jlong arg0)

bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk_stats.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ typedef enum {
6969
webkit_1download_1get_1web_1view_FUNC,
7070
webkit_1download_1set_1allow_1overwrite_FUNC,
7171
webkit_1download_1set_1destination_FUNC,
72+
webkit_1find_1controller_1search_FUNC,
73+
webkit_1find_1controller_1search_1finish_FUNC,
74+
webkit_1find_1controller_1search_1next_FUNC,
75+
webkit_1find_1controller_1search_1previous_FUNC,
7276
webkit_1get_1major_1version_FUNC,
7377
webkit_1get_1micro_1version_FUNC,
7478
webkit_1get_1minor_1version_FUNC,
@@ -112,6 +116,7 @@ typedef enum {
112116
webkit_1web_1view_1can_1show_1mime_1type_FUNC,
113117
webkit_1web_1view_1get_1context_FUNC,
114118
webkit_1web_1view_1get_1estimated_1load_1progress_FUNC,
119+
webkit_1web_1view_1get_1find_1controller_FUNC,
115120
webkit_1web_1view_1get_1main_1resource_FUNC,
116121
webkit_1web_1view_1get_1page_1id_FUNC,
117122
webkit_1web_1view_1get_1settings_FUNC,

bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/WebKitGTK.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,6 @@ public class WebKitGTK extends C {
420420
*/
421421
public static final native void webkit_window_properties_get_geometry(long webKitWindowProperties, GdkRectangle rectangle);
422422

423-
424-
425423
/** @method flags=dynamic */
426424
public static final native void webkit_web_view_go_back(long web_view);
427425

@@ -535,6 +533,23 @@ public class WebKitGTK extends C {
535533
/** @method flags=dynamic */
536534
public static final native void webkit_user_script_unref (long user_script);
537535

536+
537+
/** @method flags=dynamic */
538+
public static final native long webkit_web_view_get_find_controller(long webView);
539+
540+
/** @method flags=dynamic */
541+
/* void webkit_find_controller_search (WebKitFindController *find_controller, const gchar *search_text, guint32 find_options, guint max_match_count); **/
542+
public static final native void webkit_find_controller_search(long findController, byte[] textToSearch, int options, int max_match_count);
543+
544+
/** @method flags=dynamic */
545+
public static final native long webkit_find_controller_search_next(long findController);
546+
547+
/** @method flags=dynamic */
548+
public static final native long webkit_find_controller_search_previous(long findController);
549+
550+
/** @method flags=dynamic */
551+
public static final native long webkit_find_controller_search_finish(long findController);
552+
538553
/* --------------------- start SWT natives --------------------- */
539554
public static final native int GdkRectangle_sizeof();
540555

0 commit comments

Comments
 (0)