Search in sources :

Example 1 with ID

use of com.intellij.ui.mac.foundation.ID in project intellij-community by JetBrains.

the class NSScrollerHelper method updateBehaviorPreferences.

private static void updateBehaviorPreferences() {
    if (!SystemInfo.isMac)
        return;
    Foundation.NSAutoreleasePool pool = new Foundation.NSAutoreleasePool();
    try {
        ID defaults = invoke("NSUserDefaults", "standardUserDefaults");
        invoke(defaults, "synchronize");
        ourClickBehavior = invoke(defaults, "boolForKey:", Foundation.nsString("AppleScrollerPagingBehavior")).intValue() == 1 ? ClickBehavior.JumpToSpot : ClickBehavior.NextPage;
    } finally {
        pool.drain();
    }
}
Also used : Foundation(com.intellij.ui.mac.foundation.Foundation) ID(com.intellij.ui.mac.foundation.ID)

Example 2 with ID

use of com.intellij.ui.mac.foundation.ID in project intellij-community by JetBrains.

the class MountainLionNotifications method notify.

@Override
public void notify(@NotNull String name, @NotNull String title, @NotNull String description) {
    final ID notification = invoke(Foundation.getObjcClass("NSUserNotification"), "new");
    invoke(notification, "setTitle:", nsString(StringUtil.stripHtml(title, true).replace("%", "%%")));
    invoke(notification, "setInformativeText:", nsString(StringUtil.stripHtml(description, true).replace("%", "%%")));
    final ID center = invoke(Foundation.getObjcClass("NSUserNotificationCenter"), "defaultUserNotificationCenter");
    invoke(center, "deliverNotification:", notification);
}
Also used : ID(com.intellij.ui.mac.foundation.ID)

Example 3 with ID

use of com.intellij.ui.mac.foundation.ID in project intellij-community by JetBrains.

the class MountainLionNotifications method cleanupDeliveredNotifications.

private static void cleanupDeliveredNotifications() {
    final ID center = invoke(Foundation.getObjcClass("NSUserNotificationCenter"), "defaultUserNotificationCenter");
    invoke(center, "removeAllDeliveredNotifications");
}
Also used : ID(com.intellij.ui.mac.foundation.ID)

Example 4 with ID

use of com.intellij.ui.mac.foundation.ID in project intellij-community by JetBrains.

the class Growl method notifyGrowlOf.

public void notifyGrowlOf(final String notification, final String title, final String description) {
    final ID autoReleasePool = createAutoReleasePool();
    final ID dict = Foundation.createDict(new String[] { GROWL_NOTIFICATION_NAME, GROWL_NOTIFICATION_TITLE, GROWL_NOTIFICATION_DESCRIPTION, GROWL_APP_NAME }, new Object[] { notification, title, description, myProductName });
    final ID center = invoke("NSDistributedNotificationCenter", "defaultCenter");
    final Object notificationName = Foundation.nsString(GROWL_NOTIFICATION);
    invoke(center, "postNotificationName:object:userInfo:deliverImmediately:", notificationName, null, dict, true);
    invoke(autoReleasePool, "release");
}
Also used : ID(com.intellij.ui.mac.foundation.ID)

Example 5 with ID

use of com.intellij.ui.mac.foundation.ID in project intellij-community by JetBrains.

the class Growl method register.

public void register() {
    final ID autoReleasePool = createAutoReleasePool();
    final ID applicationIcon = getApplicationIcon();
    final ID defaultNotifications = Foundation.fillArray(myDefaultNotification);
    final ID allNotifications = Foundation.fillArray(myAllNotifications);
    final ID userDict = Foundation.createDict(new String[] { GROWL_APP_NAME, GROWL_APP_ICON, GROWL_DEFAULT_NOTIFICATIONS, GROWL_ALL_NOTIFICATIONS }, new Object[] { myProductName, applicationIcon, defaultNotifications, allNotifications });
    final ID center = invoke("NSDistributedNotificationCenter", "defaultCenter");
    final Object notificationName = Foundation.nsString(GROWL_APPLICATION_REGISTRATION_NOTIFICATION);
    invoke(center, "postNotificationName:object:userInfo:deliverImmediately:", notificationName, null, userDict, true);
    invoke(autoReleasePool, "release");
}
Also used : ID(com.intellij.ui.mac.foundation.ID)

Aggregations

ID (com.intellij.ui.mac.foundation.ID)13 Foundation (com.intellij.ui.mac.foundation.Foundation)3 ApplicationInfoEx (com.intellij.openapi.application.ex.ApplicationInfoEx)1 BuildNumber (com.intellij.openapi.util.BuildNumber)1 CustomProtocolHandler (com.intellij.ui.CustomProtocolHandler)1 Pointer (com.sun.jna.Pointer)1 ColorSpace (java.awt.color.ColorSpace)1 BufferedImage (java.awt.image.BufferedImage)1 ColorConvertOp (java.awt.image.ColorConvertOp)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteBuffer (java.nio.ByteBuffer)1 Nullable (org.jetbrains.annotations.Nullable)1