Skip to content

Commit

Permalink
8273387: remove some unreferenced gtk-related functions
Browse files Browse the repository at this point in the history
Backport-of: 6eba443428ff7abe7c0509047ec76432affebe65
  • Loading branch information
MBaesken committed Feb 4, 2022
1 parent c36c1c2 commit bda9cb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 68 deletions.
20 changes: 1 addition & 19 deletions src/java.desktop/unix/native/libawt_xawt/awt/gtk2_interface.c
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -147,10 +147,6 @@ static void (*fp_gtk_paint_arrow)(GtkStyle* style, GdkWindow* window,
GdkRectangle* area, GtkWidget* widget, const gchar* detail,
GtkArrowType arrow_type, gboolean fill, gint x, gint y,
gint width, gint height);
static void (*fp_gtk_paint_diamond)(GtkStyle* style, GdkWindow* window,
GtkStateType state_type, GtkShadowType shadow_type,
GdkRectangle* area, GtkWidget* widget, const gchar* detail,
gint x, gint y, gint width, gint height);
static void (*fp_gtk_paint_box)(GtkStyle* style, GdkWindow* window,
GtkStateType state_type, GtkShadowType shadow_type,
GdkRectangle* area, GtkWidget* widget, const gchar* detail,
Expand Down Expand Up @@ -595,7 +591,6 @@ GtkApi* gtk2_load(JNIEnv *env, const char* lib_name)
fp_gtk_paint_vline = dl_symbol("gtk_paint_vline");
fp_gtk_paint_shadow = dl_symbol("gtk_paint_shadow");
fp_gtk_paint_arrow = dl_symbol("gtk_paint_arrow");
fp_gtk_paint_diamond = dl_symbol("gtk_paint_diamond");
fp_gtk_paint_box = dl_symbol("gtk_paint_box");
fp_gtk_paint_flat_box = dl_symbol("gtk_paint_flat_box");
fp_gtk_paint_check = dl_symbol("gtk_paint_check");
Expand Down Expand Up @@ -1850,19 +1845,6 @@ static void gtk2_paint_check(WidgetType widget_type, gint synth_state,
x, y, width, height);
}

static void gtk2_paint_diamond(WidgetType widget_type, GtkStateType state_type,
GtkShadowType shadow_type, const gchar *detail,
gint x, gint y, gint width, gint height)
{
gtk2_widget = gtk2_get_widget(widget_type);
(*fp_gtk_paint_diamond)(gtk2_widget->style, gtk2_white_pixmap, state_type,
shadow_type, NULL, gtk2_widget, detail,
x, y, width, height);
(*fp_gtk_paint_diamond)(gtk2_widget->style, gtk2_black_pixmap, state_type,
shadow_type, NULL, gtk2_widget, detail,
x, y, width, height);
}

static void gtk2_paint_expander(WidgetType widget_type, GtkStateType state_type,
const gchar *detail, gint x, gint y, gint width, gint height,
GtkExpanderStyle expander_style)
Expand Down
50 changes: 1 addition & 49 deletions src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -58,26 +58,6 @@ static const char ENV_PREFIX[] = "GTK_MODULES=";

static GtkWidget *gtk3_widgets[_GTK_WIDGET_TYPE_SIZE];

static void throw_exception(JNIEnv *env, const char* name, const char* message)
{
jclass class = (*env)->FindClass(env, name);

if (class != NULL)
(*env)->ThrowNew(env, class, message);

(*env)->DeleteLocalRef(env, class);
}

static void gtk3_add_state(GtkWidget *widget, GtkStateType state) {
GtkStateType old_state = fp_gtk_widget_get_state(widget);
fp_gtk_widget_set_state(widget, old_state | state);
}

static void gtk3_remove_state(GtkWidget *widget, GtkStateType state) {
GtkStateType old_state = fp_gtk_widget_get_state(widget);
fp_gtk_widget_set_state(widget, old_state & ~state);
}

/* This is a workaround for the bug:
* http://sourceware.org/bugzilla/show_bug.cgi?id=1814
* (dlsym/dlopen clears dlerror state)
Expand Down Expand Up @@ -838,21 +818,6 @@ static void gtk3_set_direction(GtkWidget *widget, GtkTextDirection dir)
}
}

/* GTK state_type filter */
static GtkStateType get_gtk_state_type(WidgetType widget_type, gint synth_state)
{
GtkStateType result = GTK_STATE_NORMAL;

if ((synth_state & DISABLED) != 0) {
result = GTK_STATE_INSENSITIVE;
} else if ((synth_state & PRESSED) != 0) {
result = GTK_STATE_ACTIVE;
} else if ((synth_state & MOUSE_OVER) != 0) {
result = GTK_STATE_PRELIGHT;
}
return result;
}

static GtkStateFlags get_gtk_state_flags(gint synth_state)
{
GtkStateFlags flags = 0;
Expand Down Expand Up @@ -897,19 +862,6 @@ static GtkStateFlags get_gtk_flags(GtkStateType state_type) {
return flags;
}

/* GTK shadow_type filter */
static GtkShadowType get_gtk_shadow_type(WidgetType widget_type,
gint synth_state)
{
GtkShadowType result = GTK_SHADOW_OUT;

if ((synth_state & SELECTED) != 0) {
result = GTK_SHADOW_IN;
}
return result;
}


static GtkWidget* gtk3_get_arrow(GtkArrowType arrow_type,
GtkShadowType shadow_type)
{
Expand Down

1 comment on commit bda9cb4

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.