mirror of https://github.com/sipwise/jitsi.git
Activates an initial implementation of the support for the Address Book of Mac OS X. Neither it, nor the support for the Address Book of Microsoft Outlook implement the SourceContact image property.
parent
8b919ddfb1
commit
72bc56dbb3
Binary file not shown.
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
|
||||
#include "AddrBookContactQuery.h"
|
||||
|
||||
static void Exception_throwNew
|
||||
(JNIEnv *jniEnv, const char *className, const char *message);
|
||||
|
||||
jmethodID
|
||||
AddrBookContactQuery_getPtrCallbackMethodID(JNIEnv *jniEnv, jobject callback)
|
||||
{
|
||||
jclass callbackClass;
|
||||
jmethodID callbackMethodID = 0;
|
||||
|
||||
/*
|
||||
* Make sure that the specified arguments are valid. For example, check
|
||||
* whether callback exists and has the necessary signature.
|
||||
*/
|
||||
if (callback)
|
||||
{
|
||||
callbackClass = (*jniEnv)->GetObjectClass(jniEnv, callback);
|
||||
if (callbackClass)
|
||||
{
|
||||
callbackMethodID
|
||||
= (*jniEnv)->GetMethodID(
|
||||
jniEnv,
|
||||
callbackClass, "callback", "(J)Z");
|
||||
if (!callbackMethodID)
|
||||
{
|
||||
Exception_throwNew(
|
||||
jniEnv, "java/lang/IllegalArgumentException", "callback");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Exception_throwNew(
|
||||
jniEnv, "java/lang/NullPointerException", "callback");
|
||||
}
|
||||
return callbackMethodID;
|
||||
}
|
||||
|
||||
static void
|
||||
Exception_throwNew(JNIEnv *jniEnv, const char *className, const char *message)
|
||||
{
|
||||
jclass clazz;
|
||||
|
||||
clazz = (*jniEnv)->FindClass(jniEnv, className);
|
||||
if (clazz)
|
||||
(*jniEnv)->ThrowNew(jniEnv, clazz, message);
|
||||
}
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
|
||||
#ifndef _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_ADDRBOOK_ADDRBOOKCONTACTQUERY_H_
|
||||
#define _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_ADDRBOOK_ADDRBOOKCONTACTQUERY_H_
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* #ifdef __cplusplus */
|
||||
|
||||
jmethodID AddrBookContactQuery_getPtrCallbackMethodID
|
||||
(JNIEnv *jniEnv, jobject callback);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* #ifdef __cplusplus */
|
||||
|
||||
#endif /* #ifndef _NET_JAVA_SIP_COMMUNICATOR_PLUGIN_ADDRBOOK_ADDRBOOKCONTACTQUERY_H_ */
|
||||
@ -0,0 +1,16 @@
|
||||
CC = cc -O2
|
||||
TARGET_BASENAME = jmacosxaddrbook
|
||||
|
||||
JAVA_HOME = /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/JavaVM.framework/Versions/1.5
|
||||
|
||||
CC := $(CC) -arch i386 -arch ppc -arch x86_64 -mmacosx-version-min=10.4
|
||||
CPPFLAGS = -Wall -Wreturn-type -DJNI_IMPLEMENTATION -I$(JAVA_HOME)/Headers -I..
|
||||
LDFLAGS = -dynamiclib
|
||||
LIBS = -framework AddressBook -framework Foundation
|
||||
TARGET = ../../../../lib/native/mac/lib$(TARGET_BASENAME).jnilib
|
||||
|
||||
$(TARGET): \
|
||||
../AddrBookContactQuery.c \
|
||||
net_java_sip_communicator_plugin_addrbook_macosx_MacOSXAddrBookContactQuery.m
|
||||
$(CC) $(CPPFLAGS) $^ $(LDFLAGS) -o $@ $(LIBS)
|
||||
-strip $(TARGET)
|
||||
Loading…
Reference in new issue