Skip to content

Commit 24a4fce

Browse files
committed
[GTK] Silence *Chooser APIs deprecations
Deprecated in Gtk 4.10 so will be around till Gtk 5.0 thus better to reduce this noise.
1 parent 2ddc1ad commit 24a4fce

File tree

4 files changed

+66
-4
lines changed

4 files changed

+66
-4
lines changed

bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/gtk4.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,7 @@ JNIEXPORT void JNICALL GTK4_NATIVE(gtk_1expander_1set_1child)
870870
#endif
871871

872872
#ifndef NO_gtk_1file_1chooser_1get_1file
873+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
873874
JNIEXPORT jlong JNICALL GTK4_NATIVE(gtk_1file_1chooser_1get_1file)
874875
(JNIEnv *env, jclass that, jlong arg0)
875876
{
@@ -879,9 +880,11 @@ JNIEXPORT jlong JNICALL GTK4_NATIVE(gtk_1file_1chooser_1get_1file)
879880
GTK4_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1file_FUNC);
880881
return rc;
881882
}
883+
G_GNUC_END_IGNORE_DEPRECATIONS
882884
#endif
883885

884886
#ifndef NO_gtk_1file_1chooser_1get_1files
887+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
885888
JNIEXPORT jlong JNICALL GTK4_NATIVE(gtk_1file_1chooser_1get_1files)
886889
(JNIEnv *env, jclass that, jlong arg0)
887890
{
@@ -891,9 +894,11 @@ JNIEXPORT jlong JNICALL GTK4_NATIVE(gtk_1file_1chooser_1get_1files)
891894
GTK4_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1files_FUNC);
892895
return rc;
893896
}
897+
G_GNUC_END_IGNORE_DEPRECATIONS
894898
#endif
895899

896900
#ifndef NO_gtk_1file_1chooser_1set_1current_1folder
901+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
897902
JNIEXPORT jboolean JNICALL GTK4_NATIVE(gtk_1file_1chooser_1set_1current_1folder)
898903
(JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2)
899904
{
@@ -903,9 +908,11 @@ JNIEXPORT jboolean JNICALL GTK4_NATIVE(gtk_1file_1chooser_1set_1current_1folder)
903908
GTK4_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1current_1folder_FUNC);
904909
return rc;
905910
}
911+
G_GNUC_END_IGNORE_DEPRECATIONS
906912
#endif
907913

908914
#ifndef NO_gtk_1file_1chooser_1set_1file
915+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
909916
JNIEXPORT jboolean JNICALL GTK4_NATIVE(gtk_1file_1chooser_1set_1file)
910917
(JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2)
911918
{
@@ -915,6 +922,7 @@ JNIEXPORT jboolean JNICALL GTK4_NATIVE(gtk_1file_1chooser_1set_1file)
915922
GTK4_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1file_FUNC);
916923
return rc;
917924
}
925+
G_GNUC_END_IGNORE_DEPRECATIONS
918926
#endif
919927

920928
#ifndef NO_gtk_1file_1dialog_1get_1default_1filter

bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4079,16 +4079,19 @@ JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1check_1version)
40794079
#endif
40804080

40814081
#ifndef NO_gtk_1color_1chooser_1add_1palette
4082+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
40824083
JNIEXPORT void JNICALL GTK_NATIVE(gtk_1color_1chooser_1add_1palette)
40834084
(JNIEnv *env, jclass that, jlong arg0, jint arg1, jint arg2, jint arg3, jlong arg4)
40844085
{
40854086
GTK_NATIVE_ENTER(env, that, gtk_1color_1chooser_1add_1palette_FUNC);
40864087
gtk_color_chooser_add_palette((GtkColorChooser *)arg0, (GtkOrientation)arg1, (gint)arg2, (gint)arg3, (GdkRGBA *)arg4);
40874088
GTK_NATIVE_EXIT(env, that, gtk_1color_1chooser_1add_1palette_FUNC);
40884089
}
4090+
G_GNUC_END_IGNORE_DEPRECATIONS
40894091
#endif
40904092

40914093
#ifndef NO_gtk_1color_1chooser_1dialog_1new
4094+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
40924095
JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1color_1chooser_1dialog_1new)
40934096
(JNIEnv *env, jclass that, jbyteArray arg0, jlong arg1)
40944097
{
@@ -4102,9 +4105,11 @@ JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1color_1chooser_1dialog_1new)
41024105
GTK_NATIVE_EXIT(env, that, gtk_1color_1chooser_1dialog_1new_FUNC);
41034106
return rc;
41044107
}
4108+
G_GNUC_END_IGNORE_DEPRECATIONS
41054109
#endif
41064110

41074111
#ifndef NO_gtk_1color_1chooser_1get_1rgba
4112+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
41084113
JNIEXPORT void JNICALL GTK_NATIVE(gtk_1color_1chooser_1get_1rgba)
41094114
(JNIEnv *env, jclass that, jlong arg0, jobject arg1)
41104115
{
@@ -4116,9 +4121,11 @@ JNIEXPORT void JNICALL GTK_NATIVE(gtk_1color_1chooser_1get_1rgba)
41164121
if (arg1 && lparg1) setGdkRGBAFields(env, arg1, lparg1);
41174122
GTK_NATIVE_EXIT(env, that, gtk_1color_1chooser_1get_1rgba_FUNC);
41184123
}
4124+
G_GNUC_END_IGNORE_DEPRECATIONS
41194125
#endif
41204126

41214127
#ifndef NO_gtk_1color_1chooser_1get_1use_1alpha
4128+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
41224129
JNIEXPORT jboolean JNICALL GTK_NATIVE(gtk_1color_1chooser_1get_1use_1alpha)
41234130
(JNIEnv *env, jclass that, jlong arg0)
41244131
{
@@ -4128,9 +4135,11 @@ JNIEXPORT jboolean JNICALL GTK_NATIVE(gtk_1color_1chooser_1get_1use_1alpha)
41284135
GTK_NATIVE_EXIT(env, that, gtk_1color_1chooser_1get_1use_1alpha_FUNC);
41294136
return rc;
41304137
}
4138+
G_GNUC_END_IGNORE_DEPRECATIONS
41314139
#endif
41324140

41334141
#ifndef NO_gtk_1color_1chooser_1set_1rgba
4142+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
41344143
JNIEXPORT void JNICALL GTK_NATIVE(gtk_1color_1chooser_1set_1rgba)
41354144
(JNIEnv *env, jclass that, jlong arg0, jobject arg1)
41364145
{
@@ -4142,16 +4151,19 @@ JNIEXPORT void JNICALL GTK_NATIVE(gtk_1color_1chooser_1set_1rgba)
41424151
if (arg1 && lparg1) setGdkRGBAFields(env, arg1, lparg1);
41434152
GTK_NATIVE_EXIT(env, that, gtk_1color_1chooser_1set_1rgba_FUNC);
41444153
}
4154+
G_GNUC_END_IGNORE_DEPRECATIONS
41454155
#endif
41464156

41474157
#ifndef NO_gtk_1color_1chooser_1set_1use_1alpha
4158+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
41484159
JNIEXPORT void JNICALL GTK_NATIVE(gtk_1color_1chooser_1set_1use_1alpha)
41494160
(JNIEnv *env, jclass that, jlong arg0, jboolean arg1)
41504161
{
41514162
GTK_NATIVE_ENTER(env, that, gtk_1color_1chooser_1set_1use_1alpha_FUNC);
41524163
gtk_color_chooser_set_use_alpha((GtkColorChooser *)arg0, (gboolean)arg1);
41534164
GTK_NATIVE_EXIT(env, that, gtk_1color_1chooser_1set_1use_1alpha_FUNC);
41544165
}
4166+
G_GNUC_END_IGNORE_DEPRECATIONS
41554167
#endif
41564168

41574169
#ifndef NO_gtk_1combo_1box_1get_1active
@@ -4730,16 +4742,19 @@ JNIEXPORT void JNICALL GTK_NATIVE(gtk_1expander_1set_1label_1widget)
47304742
#endif
47314743

47324744
#ifndef NO_gtk_1file_1chooser_1add_1filter
4745+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
47334746
JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1add_1filter)
47344747
(JNIEnv *env, jclass that, jlong arg0, jlong arg1)
47354748
{
47364749
GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1add_1filter_FUNC);
47374750
gtk_file_chooser_add_filter((GtkFileChooser *)arg0, (GtkFileFilter *)arg1);
47384751
GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1add_1filter_FUNC);
47394752
}
4753+
G_GNUC_END_IGNORE_DEPRECATIONS
47404754
#endif
47414755

47424756
#ifndef NO_gtk_1file_1chooser_1get_1filter
4757+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
47434758
JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1file_1chooser_1get_1filter)
47444759
(JNIEnv *env, jclass that, jlong arg0)
47454760
{
@@ -4749,6 +4764,7 @@ JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1file_1chooser_1get_1filter)
47494764
GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1get_1filter_FUNC);
47504765
return rc;
47514766
}
4767+
G_GNUC_END_IGNORE_DEPRECATIONS
47524768
#endif
47534769

47544770
#ifndef NO_gtk_1file_1chooser_1native_1new
@@ -4782,6 +4798,7 @@ JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1file_1chooser_1native_1new)
47824798
#endif
47834799

47844800
#ifndef NO_gtk_1file_1chooser_1set_1current_1name
4801+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
47854802
JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1current_1name)
47864803
(JNIEnv *env, jclass that, jlong arg0, jbyteArray arg1)
47874804
{
@@ -4793,26 +4810,31 @@ JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1current_1name)
47934810
if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
47944811
GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1current_1name_FUNC);
47954812
}
4813+
G_GNUC_END_IGNORE_DEPRECATIONS
47964814
#endif
47974815

47984816
#ifndef NO_gtk_1file_1chooser_1set_1filter
4817+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
47994818
JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1filter)
48004819
(JNIEnv *env, jclass that, jlong arg0, jlong arg1)
48014820
{
48024821
GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1filter_FUNC);
48034822
gtk_file_chooser_set_filter((GtkFileChooser *)arg0, (GtkFileFilter *)arg1);
48044823
GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1filter_FUNC);
48054824
}
4825+
G_GNUC_END_IGNORE_DEPRECATIONS
48064826
#endif
48074827

48084828
#ifndef NO_gtk_1file_1chooser_1set_1select_1multiple
4829+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
48094830
JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1chooser_1set_1select_1multiple)
48104831
(JNIEnv *env, jclass that, jlong arg0, jboolean arg1)
48114832
{
48124833
GTK_NATIVE_ENTER(env, that, gtk_1file_1chooser_1set_1select_1multiple_FUNC);
48134834
gtk_file_chooser_set_select_multiple((GtkFileChooser *)arg0, (gboolean)arg1);
48144835
GTK_NATIVE_EXIT(env, that, gtk_1file_1chooser_1set_1select_1multiple_FUNC);
48154836
}
4837+
G_GNUC_END_IGNORE_DEPRECATIONS
48164838
#endif
48174839

48184840
#ifndef NO_gtk_1file_1filter_1add_1pattern
@@ -4868,6 +4890,7 @@ JNIEXPORT void JNICALL GTK_NATIVE(gtk_1file_1filter_1set_1name)
48684890
#endif
48694891

48704892
#ifndef NO_gtk_1font_1chooser_1dialog_1new
4893+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
48714894
JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1font_1chooser_1dialog_1new)
48724895
(JNIEnv *env, jclass that, jbyteArray arg0, jlong arg1)
48734896
{
@@ -4881,9 +4904,11 @@ JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1font_1chooser_1dialog_1new)
48814904
GTK_NATIVE_EXIT(env, that, gtk_1font_1chooser_1dialog_1new_FUNC);
48824905
return rc;
48834906
}
4907+
G_GNUC_END_IGNORE_DEPRECATIONS
48844908
#endif
48854909

48864910
#ifndef NO_gtk_1font_1chooser_1get_1font
4911+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
48874912
JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1font_1chooser_1get_1font)
48884913
(JNIEnv *env, jclass that, jlong arg0)
48894914
{
@@ -4893,9 +4918,11 @@ JNIEXPORT jlong JNICALL GTK_NATIVE(gtk_1font_1chooser_1get_1font)
48934918
GTK_NATIVE_EXIT(env, that, gtk_1font_1chooser_1get_1font_FUNC);
48944919
return rc;
48954920
}
4921+
G_GNUC_END_IGNORE_DEPRECATIONS
48964922
#endif
48974923

48984924
#ifndef NO_gtk_1font_1chooser_1set_1font
4925+
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
48994926
JNIEXPORT void JNICALL GTK_NATIVE(gtk_1font_1chooser_1set_1font)
49004927
(JNIEnv *env, jclass that, jlong arg0, jbyteArray arg1)
49014928
{
@@ -4907,6 +4934,7 @@ JNIEXPORT void JNICALL GTK_NATIVE(gtk_1font_1chooser_1set_1font)
49074934
if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0);
49084935
GTK_NATIVE_EXIT(env, that, gtk_1font_1chooser_1set_1font_FUNC);
49094936
}
4937+
G_GNUC_END_IGNORE_DEPRECATIONS
49104938
#endif
49114939

49124940
#ifndef NO_gtk_1frame_1get_1label_1widget

bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ public class GTK extends OS {
474474

475475
/* GtkColorChooser Interface */
476476
/**
477+
* @method flags=ignore_deprecations
477478
* @param chooser cast=(GtkColorChooser *)
478479
* @param orientation cast=(GtkOrientation)
479480
* @param colors_per_line cast=(gint)
@@ -482,25 +483,30 @@ public class GTK extends OS {
482483
*/
483484
public static final native void gtk_color_chooser_add_palette(long chooser, int orientation, int colors_per_line, int n_colors, long colors);
484485
/**
486+
* @method flags=ignore_deprecations
485487
* @param chooser cast=(GtkColorChooser *)
486488
* @param use_alpha cast=(gboolean)
487489
*/
488490
public static final native void gtk_color_chooser_set_use_alpha(long chooser, boolean use_alpha);
489491
/**
492+
* @method flags=ignore_deprecations
490493
* @param chooser cast=(GtkColorChooser *)
491494
*/
492495
public static final native boolean gtk_color_chooser_get_use_alpha(long chooser);
493496
/**
497+
* @method flags=ignore_deprecations
494498
* @param chooser cast=(GtkColorChooser *)
495499
* @param color cast=(GdkRGBA *)
496500
*/
497501
public static final native void gtk_color_chooser_set_rgba(long chooser, GdkRGBA color);
498502
/**
503+
* @method flags=ignore_deprecations
499504
* @param chooser cast=(GtkColorChooser *)
500505
* @param color cast=(GdkRGBA *)
501506
*/
502507
public static final native void gtk_color_chooser_get_rgba(long chooser, GdkRGBA color);
503508
/**
509+
* @method flags=ignore_deprecations
504510
* @param title cast=(const gchar *)
505511
* @param parent cast=(GtkWindow *)
506512
*/
@@ -703,23 +709,30 @@ public class GTK extends OS {
703709

704710
/* GtkFileChooser */
705711
/**
712+
* @method flags=ignore_deprecations
706713
* @param chooser cast=(GtkFileChooser *)
707714
* @param filter cast=(GtkFileFilter *)
708715
*/
709716
public static final native void gtk_file_chooser_add_filter(long chooser, long filter);
710-
/** @param chooser cast=(GtkFileChooser *) */
717+
/**
718+
* @method flags=ignore_deprecations
719+
* @param chooser cast=(GtkFileChooser *)
720+
*/
711721
public static final native long gtk_file_chooser_get_filter(long chooser);
712722
/**
723+
* @method flags=ignore_deprecations
713724
* @param chooser cast=(GtkFileChooser *)
714725
* @param name cast=(const gchar *)
715726
*/
716727
public static final native void gtk_file_chooser_set_current_name(long chooser, byte[] name);
717728
/**
729+
* @method flags=ignore_deprecations
718730
* @param chooser cast=(GtkFileChooser *)
719731
* @param filter cast=(GtkFileFilter *)
720732
*/
721733
public static final native void gtk_file_chooser_set_filter(long chooser, long filter);
722734
/**
735+
* @method flags=ignore_deprecations
723736
* @param chooser cast=(GtkFileChooser *)
724737
* @param select_multiple cast=(gboolean)
725738
*/
@@ -812,15 +825,20 @@ public class GTK extends OS {
812825

813826
/* GtkFontChooserDialog */
814827
/**
828+
* @method flags=ignore_deprecations
815829
* @param title cast=(const gchar *)
816830
* @param parent cast=(GtkWindow *)
817831
*/
818832
public static final native long gtk_font_chooser_dialog_new(byte[] title, long parent);
819833

820834
/* GtkFontChooser Interface */
821-
/** @param fontchooser cast=(GtkFontChooser *) */
835+
/**
836+
* @method flags=ignore_deprecations
837+
* @param fontchooser cast=(GtkFontChooser *)
838+
*/
822839
public static final native long gtk_font_chooser_get_font(long fontchooser);
823840
/**
841+
* @method flags=ignore_deprecations
824842
* @param fsd cast=(GtkFontChooser *)
825843
* @param fontname cast=(const gchar *)
826844
*/

bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk4/GTK4.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,25 @@ public class GTK4 {
196196
public static final native long gdk_content_formats_builder_free_to_formats(long builder);
197197

198198
/* GtkFileChooser */
199-
/** @param chooser cast=(GtkFileChooser *) */
199+
/**
200+
* @method flags=ignore_deprecations
201+
* @param chooser cast=(GtkFileChooser *)
202+
*/
200203
public static final native long gtk_file_chooser_get_files(long chooser);
201-
/** @param chooser cast=(GtkFileChooser *) */
204+
/**
205+
* @method flags=ignore_deprecations
206+
* @param chooser cast=(GtkFileChooser *)
207+
*/
202208
public static final native long gtk_file_chooser_get_file(long chooser);
203209
/**
210+
* @method flags=ignore_deprecations
204211
* @param chooser cast=(GtkFileChooser *)
205212
* @param file cast=(GFile *)
206213
* @param error cast=(GError **)
207214
*/
208215
public static final native boolean gtk_file_chooser_set_current_folder(long chooser, long file, long error);
209216
/**
217+
* @method flags=ignore_deprecations
210218
* @param chooser cast=(GtkFileChooser *)
211219
* @param file cast=(GFile *)
212220
* @param error cast=(GError **)

0 commit comments

Comments
 (0)