src/java.desktop/unix/classes/sun/awt/X11/XTaskbarPeer.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 39857 jdk/src/java.desktop/unix/classes/sun/awt/X11/XTaskbarPeer.java@6178820cadaf
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36903
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
     1
/*
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
     2
 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
     4
 *
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    10
 *
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    15
 * accompanied this code).
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    16
 *
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    20
 *
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    23
 * questions.
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    24
 */
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    25
package sun.awt.X11;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    26
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    27
import java.awt.MenuItem;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    28
import java.awt.PopupMenu;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    29
import java.awt.Taskbar.Feature;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    30
import java.awt.peer.TaskbarPeer;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    31
import java.awt.event.ActionEvent;
37711
972001566d66 8145547: [AWT/Swing] Conditional support for GTK 3 on Linux
ssadetsky
parents: 37550
diff changeset
    32
972001566d66 8145547: [AWT/Swing] Conditional support for GTK 3 on Linux
ssadetsky
parents: 37550
diff changeset
    33
import sun.awt.UNIXToolkit;
36903
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    34
import java.security.AccessController;
39857
6178820cadaf 8153512: Taskbar support reported for Xfce4.
azvegint
parents: 39854
diff changeset
    35
import java.security.PrivilegedAction;
36903
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    36
import sun.security.action.GetPropertyAction;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    37
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    38
final class XTaskbarPeer implements TaskbarPeer {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    39
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    40
    private static boolean nativeLibraryLoaded = false;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    41
    private static boolean initExecuted = false;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    42
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    43
    private PopupMenu menu = null;
39857
6178820cadaf 8153512: Taskbar support reported for Xfce4.
azvegint
parents: 39854
diff changeset
    44
    private static boolean isUnity;
6178820cadaf 8153512: Taskbar support reported for Xfce4.
azvegint
parents: 39854
diff changeset
    45
6178820cadaf 8153512: Taskbar support reported for Xfce4.
azvegint
parents: 39854
diff changeset
    46
    static {
6178820cadaf 8153512: Taskbar support reported for Xfce4.
azvegint
parents: 39854
diff changeset
    47
        String de = AccessController.doPrivileged(
6178820cadaf 8153512: Taskbar support reported for Xfce4.
azvegint
parents: 39854
diff changeset
    48
                        (PrivilegedAction<String>) ()
6178820cadaf 8153512: Taskbar support reported for Xfce4.
azvegint
parents: 39854
diff changeset
    49
                                -> System.getenv("XDG_CURRENT_DESKTOP"));
6178820cadaf 8153512: Taskbar support reported for Xfce4.
azvegint
parents: 39854
diff changeset
    50
        isUnity = de != null && de.equals("Unity");
6178820cadaf 8153512: Taskbar support reported for Xfce4.
azvegint
parents: 39854
diff changeset
    51
    }
36903
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    52
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    53
    private static void initWithLock() {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    54
        XToolkit.awtLock();
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    55
        try {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    56
            if (!initExecuted) {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    57
                String dname = AccessController.doPrivileged(
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    58
                                new GetPropertyAction("java.desktop.appName", ""));
37711
972001566d66 8145547: [AWT/Swing] Conditional support for GTK 3 on Linux
ssadetsky
parents: 37550
diff changeset
    59
                nativeLibraryLoaded = init(dname,
972001566d66 8145547: [AWT/Swing] Conditional support for GTK 3 on Linux
ssadetsky
parents: 37550
diff changeset
    60
                        UNIXToolkit.getEnabledGtkVersion().ordinal(),
972001566d66 8145547: [AWT/Swing] Conditional support for GTK 3 on Linux
ssadetsky
parents: 37550
diff changeset
    61
                        UNIXToolkit.isGtkVerbose());
36903
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    62
                if (nativeLibraryLoaded) {
37550
c8252b8fea3d 8147544: Remove sun.misc.ManagedLocalsThread from java.desktop
prr
parents: 36903
diff changeset
    63
                    Thread t = new Thread(null, () -> { runloop(); },
c8252b8fea3d 8147544: Remove sun.misc.ManagedLocalsThread from java.desktop
prr
parents: 36903
diff changeset
    64
                                          "TaskBar", 0, false);
36903
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    65
                    t.setDaemon(true);
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    66
                    t.start();
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    67
                }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    68
            }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    69
        } finally {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    70
            initExecuted = true;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    71
            XToolkit.awtUnlock();
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    72
        }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    73
    }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    74
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    75
    XTaskbarPeer() {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    76
        initWithLock();
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    77
    }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    78
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    79
    static boolean isTaskbarSupported() {
39857
6178820cadaf 8153512: Taskbar support reported for Xfce4.
azvegint
parents: 39854
diff changeset
    80
        if (!isUnity) {
6178820cadaf 8153512: Taskbar support reported for Xfce4.
azvegint
parents: 39854
diff changeset
    81
            return false;
6178820cadaf 8153512: Taskbar support reported for Xfce4.
azvegint
parents: 39854
diff changeset
    82
        }
36903
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    83
        initWithLock();
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    84
        return nativeLibraryLoaded;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    85
    }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    86
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    87
    @Override
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    88
    public boolean isSupported(Feature feature) {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    89
        switch (feature) {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    90
            case ICON_BADGE_NUMBER:
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    91
            case MENU:
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    92
            case PROGRESS_VALUE:
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    93
            case USER_ATTENTION:
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    94
                return true;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    95
            default:
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    96
                return false;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    97
        }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    98
    }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
    99
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   100
    @Override
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   101
    public void setProgressValue(int value) {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   102
        boolean visible
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   103
                = value >= 0
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   104
                && value <= 100;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   105
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   106
        double v = visible
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   107
                ? (double) value / 100
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   108
                : 0d;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   109
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   110
        updateProgress(v, visible);
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   111
    }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   112
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   113
    @Override
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   114
    public void setIconBadge(String badge) {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   115
        boolean visible = false;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   116
        long val = 0;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   117
        if (badge != null) {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   118
            try {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   119
                val = Long.parseLong(badge);
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   120
                visible = true;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   121
            } catch (NumberFormatException e) {
39854
28eb438b1368 8159374: Taskbar.setIconBadge() spec omits mention of exception for ICON_BADGE_TEXT feature
azvegint
parents: 37711
diff changeset
   122
                throw new UnsupportedOperationException("The " + Feature.ICON_BADGE_TEXT
28eb438b1368 8159374: Taskbar.setIconBadge() spec omits mention of exception for ICON_BADGE_TEXT feature
azvegint
parents: 37711
diff changeset
   123
                    + " feature is not supported on the current platform!");
36903
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   124
            }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   125
        }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   126
        setBadge(val, visible);
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   127
    }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   128
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   129
    @Override
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   130
    public PopupMenu getMenu() {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   131
        return menu;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   132
    }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   133
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   134
    @Override
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   135
    public synchronized void setMenu(PopupMenu m) {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   136
        this.menu = m;
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   137
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   138
        if (menu != null && menu.getItemCount() > 0) {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   139
            int msize = menu.getItemCount();
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   140
            MenuItem[] items = new MenuItem[msize];
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   141
            for (int i = 0; i < msize; i++) {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   142
                items[i] = menu.getItem(i);
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   143
            }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   144
            setNativeMenu(items);
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   145
        } else {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   146
            setNativeMenu(null);
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   147
        }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   148
    }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   149
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   150
    @Override
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   151
    public void requestUserAttention(boolean enabled, boolean critical) {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   152
        setUrgent(enabled);
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   153
    }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   154
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   155
    private static void menuItemCallback(MenuItem mi) {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   156
        if (mi != null) {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   157
            ActionEvent ae = new ActionEvent(mi, ActionEvent.ACTION_PERFORMED,
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   158
                    mi.getActionCommand());
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   159
            try {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   160
                XToolkit.awtLock();
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   161
                XToolkit.postEvent(XToolkit.targetToAppContext(ae.getSource()), ae);
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   162
            } finally {
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   163
                XToolkit.awtUnlock();
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   164
            }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   165
        }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   166
    }
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   167
37711
972001566d66 8145547: [AWT/Swing] Conditional support for GTK 3 on Linux
ssadetsky
parents: 37550
diff changeset
   168
    private static native boolean init(String name, int version,
972001566d66 8145547: [AWT/Swing] Conditional support for GTK 3 on Linux
ssadetsky
parents: 37550
diff changeset
   169
                                                               boolean verbose);
36903
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   170
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   171
    private static native void runloop();
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   172
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   173
    private native void setBadge(long value, boolean visible);
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   174
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   175
    private native void updateProgress(double value, boolean visible);
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   176
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   177
    private native void setUrgent(boolean urgent);
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   178
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   179
    private native void setNativeMenu(MenuItem[] items);
addc2e9d4bd4 8143227: Platform-Specific Desktop Features
azvegint
parents:
diff changeset
   180
}