soc.2012.android: 692b0c86: Added build scripts for C header generat...
michael at soc.pidgin.im
michael at soc.pidgin.im
Wed May 23 06:57:05 EDT 2012
----------------------------------------------------------------------
Revision: 692b0c867c254b2cd1a1e7b1aeff7adf3c9b3204
Parent: 9658ab92f703368529fb545ca2816e0b1e50d464
Author: michael at soc.pidgin.im
Date: 05/23/12 06:50:26
Branch: im.pidgin.soc.2012.android
URL: http://d.pidgin.im/viewmtn/revision/info/692b0c867c254b2cd1a1e7b1aeff7adf3c9b3204
Changelog:
Added build scripts for C header generation and created basic classes.
Changes against parent 9658ab92f703368529fb545ca2816e0b1e50d464
added android/workspace/im.pidgin.libpurple
added android/workspace/im.pidgin.libpurple/assets
added android/workspace/im.pidgin.libpurple/bin
added android/workspace/im.pidgin.libpurple/gen
added android/workspace/im.pidgin.libpurple/native
added android/workspace/im.pidgin.libpurple/res
added android/workspace/im.pidgin.libpurple/res/drawable-hdpi
added android/workspace/im.pidgin.libpurple/res/drawable-ldpi
added android/workspace/im.pidgin.libpurple/res/drawable-mdpi
added android/workspace/im.pidgin.libpurple/res/drawable-xhdpi
added android/workspace/im.pidgin.libpurple/res/layout
added android/workspace/im.pidgin.libpurple/res/values
added android/workspace/im.pidgin.libpurple/src
added android/workspace/im.pidgin.libpurple/src/im
added android/workspace/im.pidgin.libpurple/src/im/pidgin
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/buddy
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/dns
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/glib
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/peering
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/plugin
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/uiops
added android/workspace/im.pidgin.libpurple/AndroidManifest.xml
added android/workspace/im.pidgin.libpurple/native/build.ant
added android/workspace/im.pidgin.libpurple/native/generateheaders.ant
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_account_PurpleAccount.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_account_PurpleAccountList.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_account_PurpleStatus.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_blist_PurpleBlist.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_blist_PurpleBlistNode.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_blist_PurpleContact.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_buddy_PurpleBuddy.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_core_EventLoop.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_core_PurpleInstance.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_core_dns_DnsQueryData.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_core_dns_DnsQueryFailedCallback.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_core_dns_DnsQueryResolvedCallback.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_glib_GHashTable.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_glib_GHashTableSet.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_glib_GList.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_glib_GListIterator.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_glib_GSourceFunctionCall.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_plugin_PurplePlugin.h
added android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_plugin_PurpleProtocolPlugin.h
added android/workspace/im.pidgin.libpurple/proguard-project.txt
added android/workspace/im.pidgin.libpurple/project.properties
added android/workspace/im.pidgin.libpurple/res/values/strings.xml
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleAccount.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleAccountList.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleAccountListListener.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleAccountListener.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleStatus.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlist.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistManager.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistNode.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleContact.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/buddy/PurpleBuddy.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/AbstractPurpleManaged.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/CoreManager.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/EventLoop.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/PeeredPurpleManaged.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/PurpleInstance.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/PurpleLibraryLoader.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/PurpleManaged.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/PurpleThread.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/dns/DnsQueryData.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/dns/DnsQueryFailedCallback.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/dns/DnsQueryResolvedCallback.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/dns/DnsQueryUiOps.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/glib/GHashTable.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/glib/GHashTableSet.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/glib/GList.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/glib/GListIterator.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/glib/GSourceFunctionCall.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/peering/NativeObjectUnavailableException.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/peering/PeerGenerator.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/peering/Peered.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/plugin/PurplePlugin.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/plugin/PurplePluginManager.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/plugin/PurpleProtocolPlugin.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/uiops/CoreUiOps.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/uiops/DebugUiOps.java
added android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/uiops/EventLoopUiOps.java
-------------- next part --------------
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/AndroidManifest.xml 486084a1e33dea4324c579ecedffb4edfea30168
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="im.pidgin.libpurple"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-sdk android:minSdkVersion="10" />
+
+</manifest>
\ No newline at end of file
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/build.ant f08eaf220fb2cc62fe062410286505e62ed49044
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ======================================================================
+ 18.05.2012 19:18:30
+
+ build.nativebindings
+ Builds the native functions that need to exists to interface libpurple with java.
+
+ michaelz
+ ====================================================================== -->
+<project name="build.nativebindings" default="build">
+ <description>
+ Builds the native functions that need to exists to interface libpurple with java.
+ </description>
+
+ <import file="../../im.pidgin.libpurple.build/buildscripts/common.ant" />
+ <import file="generateheaders.ant" />
+
+ <property name="androidMakefile" location="Android.mk" />
+
+ <property name="libpurple.constants.outdir" location="../gen/im/pidgin/libpurple/constants" />
+ <property name="libpurple.constants.package" value="im.pidgin.libpurple.constants" />
+
+ <property name="javah.out" location="." />
+
+
+
+ <!-- =================================
+ target: default
+ ================================= -->
+ <target name="build" depends="ant-contrib.load,extractconstants,headers.create,generate-makefile" description="Builds the native functions that need to exists to interface libpurple with java.">
+
+ </target>
+
+ <!-- - - - - - - - - - - - - - - - - -
+ target: generate-makefile
+ generates the android makefile
+ - - - - - - - - - - - - - - - - - -->
+ <target name="generate-makefile">
+
+ </target>
+
+ <!-- - - - - - - - - - - - - - - - - -
+ target: headers.create
+ - - - - - - - - - - - - - - - - - -->
+ <target name="headers.create">
+ <javah classdefinition="im.pidgin.libpurple.account.PurpleAccount" to="${javah.out}" />
+ <javah classdefinition="im.pidgin.libpurple.account.PurpleAccountList" to="${javah.out}" />
+ <javah classdefinition="im.pidgin.libpurple.account.PurpleStatus" to="${javah.out}" />
+
+ <javah classdefinition="im.pidgin.libpurple.blist.PurpleBlist" to="${javah.out}" />
+ <javah classdefinition="im.pidgin.libpurple.blist.PurpleBlistNode" to="${javah.out}" />
+ <javah classdefinition="im.pidgin.libpurple.blist.PurpleContact" to="${javah.out}" />
+
+ <javah classdefinition="im.pidgin.libpurple.buddy.PurpleBuddy" to="${javah.out}" />
+
+ <javah classdefinition="im.pidgin.libpurple.core.EventLoop" to="${javah.out}" />
+ <javah classdefinition="im.pidgin.libpurple.core.PurpleInstance" to="${javah.out}" />
+
+ <javah classdefinition="im.pidgin.libpurple.core.dns.DnsQueryData" to="${javah.out}" />
+ <javah classdefinition="im.pidgin.libpurple.core.dns.DnsQueryFailedCallback" to="${javah.out}" />
+ <javah classdefinition="im.pidgin.libpurple.core.dns.DnsQueryResolvedCallback" to="${javah.out}" />
+
+ <javah classdefinition="im.pidgin.libpurple.glib.GHashTable" to="${javah.out}" />
+ <javah classdefinition="im.pidgin.libpurple.glib.GHashTableSet" to="${javah.out}" />
+ <javah classdefinition="im.pidgin.libpurple.glib.GList" to="${javah.out}" />
+ <javah classdefinition="im.pidgin.libpurple.glib.GListIterator" to="${javah.out}" />
+ <javah classdefinition="im.pidgin.libpurple.glib.GSourceFunctionCall" to="${javah.out}" />
+
+ <javah classdefinition="im.pidgin.libpurple.plugin.PurplePlugin" to="${javah.out}" />
+ <javah classdefinition="im.pidgin.libpurple.plugin.PurpleProtocolPlugin" to="${javah.out}" />
+ </target>
+
+ <!-- - - - - - - - - - - - - - - - - -
+ target: extractconstants
+ - - - - - - - - - - - - - - - - - -->
+ <target name="extractconstants">
+ <mkdir dir="../gen/im/pidgin/libpurple/constants" />
+
+ <extractconstants input="${pidgin.base}/libpurple/account.h" output="${libpurple.constants.outdir}/AccountConstants.java" package="${libpurple.constants.package}">
+ <enum name="PurpleAccountRequestType" />
+ </extractconstants>
+
+ <extractconstants input="${pidgin.base}/libpurple/plugin.h" output="${libpurple.constants.outdir}/PluginConstants.java" package="${libpurple.constants.package}">
+ <enum name="PurplePluginType" />
+ </extractconstants>
+
+ <extractconstants input="${pidgin.base}/libpurple/connection.h" output="${libpurple.constants.outdir}/ConnectionConstants.java" package="${libpurple.constants.package}">
+ <enum name="PurpleConnectionFlags" />
+ <enum name="PurpleConnectionState" />
+ <enum name="PurpleConnectionError" />
+
+ </extractconstants>
+ </target>
+
+ <target name="constants.extract">
+
+
+ </target>
+
+
+
+</project>
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/generateheaders.ant d999a563bf67e20423e970d94e6ec917d7845edb
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ======================================================================
+ 22.05.2012 12:42:29
+
+ generateheaders
+ Generates header files automatically for jni.
+
+ michaelz
+ ====================================================================== -->
+<project name="generateheaders">
+ <description>
+ Generates header files automatically for jni.
+ </description>
+
+ <property name="javah.src" location="../src"/>
+
+
+
+
+ <!-- = = = = = = = = = = = = = = = = =
+ macrodef: javah
+ = = = = = = = = = = = = = = = = = -->
+ <macrodef name="javah">
+ <attribute name="classdefinition" default="" />
+ <attribute name="to" default="." />
+ <sequential>
+ <antcall target="javah">
+ <param name="classpath" value="@{classdefinition}" />
+ <param name="to" value="@{to}" />
+ </antcall>
+ </sequential>
+ </macrodef>
+
+
+ <!-- - - - - - - - - - - - - - - - - -
+ target: javah
+ - - - - - - - - - - - - - - - - - -->
+ <target name="javah" depends="javah-checkchanges" unless="nochanges">
+ <echo message="generating jni header for ${classpath}" />
+ <propertyregex property="classpath_with_slash" input="${classpath}" regexp="\." replace="/" global="true" />
+
+ <mkdir dir=".javah-tmp" />
+ <javac srcdir="${javah.src}" destdir=".javah-tmp" listfiles="yes" >
+ <include name="${classpath_with_slash}.java"/>
+ </javac>
+ <exec executable="javah" failifexecutionfails="true" failonerror="true">
+ <arg value="-jni" />
+ <arg value="-d" />
+ <arg path="${to}" />
+ <arg value="-classpath" />
+ <arg path=".javah-tmp" />
+ <arg value="${classpath}" />
+ </exec>
+ <delete dir=".javah-tmp" />
+ </target>
+
+ <target name="javah-checkchanges">
+ <propertyregex property="classpath_with_slash" input="${classpath}" regexp="\." replace="/" global="true" />
+ <propertyregex property="classpath_with__" input="${classpath}" regexp="\." replace="_" global="true" />
+ <uptodate property="nochanges" srcfile="../src/${classpath_with_slash}.java" targetfile="${to}/${classpath_with__}.h" />
+ </target>
+
+</project>
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_account_PurpleAccount.h ca1c331cc7a8d44bb8f1f0000f9d30ad329c42d3
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_account_PurpleAccount */
+
+#ifndef _Included_im_pidgin_libpurple_account_PurpleAccount
+#define _Included_im_pidgin_libpurple_account_PurpleAccount
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_account_PurpleAccountList.h fc0df10fa87e2b248be6136f6235670edc69a9f7
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_account_PurpleAccountList */
+
+#ifndef _Included_im_pidgin_libpurple_account_PurpleAccountList
+#define _Included_im_pidgin_libpurple_account_PurpleAccountList
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_account_PurpleStatus.h ae60b9603013c6370b2d57a5371fdbf69a579b78
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_account_PurpleStatus */
+
+#ifndef _Included_im_pidgin_libpurple_account_PurpleStatus
+#define _Included_im_pidgin_libpurple_account_PurpleStatus
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_blist_PurpleBlist.h 2166ba78b228bf3deeeb44ba979a6d7448118d62
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_blist_PurpleBlist */
+
+#ifndef _Included_im_pidgin_libpurple_blist_PurpleBlist
+#define _Included_im_pidgin_libpurple_blist_PurpleBlist
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_blist_PurpleBlistNode.h 4c65ca895b90daba6a02a5b173f51701a11fc2c5
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_blist_PurpleBlistNode */
+
+#ifndef _Included_im_pidgin_libpurple_blist_PurpleBlistNode
+#define _Included_im_pidgin_libpurple_blist_PurpleBlistNode
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_blist_PurpleContact.h 66fc51646a8d8d8f8392968dbc5440b55620b391
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_blist_PurpleContact */
+
+#ifndef _Included_im_pidgin_libpurple_blist_PurpleContact
+#define _Included_im_pidgin_libpurple_blist_PurpleContact
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_buddy_PurpleBuddy.h 44875b9c3215a800033e48d523124f48ae141217
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_buddy_PurpleBuddy */
+
+#ifndef _Included_im_pidgin_libpurple_buddy_PurpleBuddy
+#define _Included_im_pidgin_libpurple_buddy_PurpleBuddy
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_core_EventLoop.h 7f2527d2dcf83cd82b7988a1b5cbc24d3c8fffda
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_core_EventLoop */
+
+#ifndef _Included_im_pidgin_libpurple_core_EventLoop
+#define _Included_im_pidgin_libpurple_core_EventLoop
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_core_PurpleInstance.h 455a8b1708e11964f3897bea77c05ea8b292955b
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_core_PurpleInstance */
+
+#ifndef _Included_im_pidgin_libpurple_core_PurpleInstance
+#define _Included_im_pidgin_libpurple_core_PurpleInstance
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_core_dns_DnsQueryData.h 17adaf8635e5258b108bddd33ce54ffdc6bae6d6
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_core_dns_DnsQueryData */
+
+#ifndef _Included_im_pidgin_libpurple_core_dns_DnsQueryData
+#define _Included_im_pidgin_libpurple_core_dns_DnsQueryData
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_core_dns_DnsQueryFailedCallback.h 169a64202c310df5d6e2a8ad8585e8a3b6905cdc
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_core_dns_DnsQueryFailedCallback */
+
+#ifndef _Included_im_pidgin_libpurple_core_dns_DnsQueryFailedCallback
+#define _Included_im_pidgin_libpurple_core_dns_DnsQueryFailedCallback
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_core_dns_DnsQueryResolvedCallback.h c3d5bfd4bcc719686590cc04aee2548da0734a32
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_core_dns_DnsQueryResolvedCallback */
+
+#ifndef _Included_im_pidgin_libpurple_core_dns_DnsQueryResolvedCallback
+#define _Included_im_pidgin_libpurple_core_dns_DnsQueryResolvedCallback
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_glib_GHashTable.h 8f1e270523b7844869a391b1d76de6ae9e9aadd5
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_glib_GHashTable */
+
+#ifndef _Included_im_pidgin_libpurple_glib_GHashTable
+#define _Included_im_pidgin_libpurple_glib_GHashTable
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_glib_GHashTableSet.h 478bb012ee72af0fa56d2aee91b937f4cc8e6d70
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_glib_GHashTableSet */
+
+#ifndef _Included_im_pidgin_libpurple_glib_GHashTableSet
+#define _Included_im_pidgin_libpurple_glib_GHashTableSet
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_glib_GList.h fa6885de512bfc4f77b3f5434c4c20d69fb21e98
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_glib_GList */
+
+#ifndef _Included_im_pidgin_libpurple_glib_GList
+#define _Included_im_pidgin_libpurple_glib_GList
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_glib_GListIterator.h 2edbc14a1e821c1f6f382f30987a7c2c723caf32
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_glib_GListIterator */
+
+#ifndef _Included_im_pidgin_libpurple_glib_GListIterator
+#define _Included_im_pidgin_libpurple_glib_GListIterator
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_glib_GSourceFunctionCall.h 87dbace54f2ebdcdce8be91f293bbe873d1f38cc
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_glib_GSourceFunctionCall */
+
+#ifndef _Included_im_pidgin_libpurple_glib_GSourceFunctionCall
+#define _Included_im_pidgin_libpurple_glib_GSourceFunctionCall
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_plugin_PurplePlugin.h 2be1eb7aadc8782dd48ba33fbb148d0bd47ddfa7
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_plugin_PurplePlugin */
+
+#ifndef _Included_im_pidgin_libpurple_plugin_PurplePlugin
+#define _Included_im_pidgin_libpurple_plugin_PurplePlugin
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/native/im_pidgin_libpurple_plugin_PurpleProtocolPlugin.h e65f34c2ce9d68e8399f82db023317e086b9d4b2
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class im_pidgin_libpurple_plugin_PurpleProtocolPlugin */
+
+#ifndef _Included_im_pidgin_libpurple_plugin_PurpleProtocolPlugin
+#define _Included_im_pidgin_libpurple_plugin_PurpleProtocolPlugin
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/proguard-project.txt 2669873f891113a8f45506e825d0215306e95405
@@ -0,0 +1,20 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/project.properties a926b50aa1fecfff2ab44d8911f4214ce154d5e5
@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-10
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/res/values/strings.xml 739ef149edb028256d37a6c3e728b792243ffec3
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="app_name">im.pidgin.libpurple</string>
+
+</resources>
\ No newline at end of file
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleAccount.java 5c31302c76f01ac91ff1bd8d5a4e2937fdb65322
@@ -0,0 +1,11 @@
+package im.pidgin.libpurple.account;
+
+/**
+ * This is an account of libpurple.
+ *
+ * @author michaelz
+ *
+ */
+public final class PurpleAccount {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleAccountList.java 23fb321f72557480beb368200afc2f281505f0f7
@@ -0,0 +1,10 @@
+package im.pidgin.libpurple.account;
+
+/**
+ * This class provides access to the account list of libpurple.
+ * @author michaelz
+ *
+ */
+public final class PurpleAccountList {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleAccountListListener.java ed043c616a4ec8861575e1493b501eb13b21e85d
@@ -0,0 +1,17 @@
+package im.pidgin.libpurple.account;
+
+/**
+ * These listeners can be registered on the account list to get notified when an
+ * account was added or removed from the list.
+ *
+ * @author michaelz
+ *
+ */
+public interface PurpleAccountListListener {
+ /**
+ * Called when an account was added to the list.
+ *
+ * @param account The account that was added.
+ */
+ public void accountAdded(PurpleAccount account);
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleAccountListener.java 21207eddae5d3700cc725c2e8439b570f33f0cd7
@@ -0,0 +1,10 @@
+package im.pidgin.libpurple.account;
+
+/**
+ * This listener listens to changes of a given account.
+ * @author michaelz
+ *
+ */
+public interface PurpleAccountListener {
+ void accountStatusChanged(PurpleAccount account);
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/account/PurpleStatus.java dab6665771657c201660dc28f197e4f9f2edcc11
@@ -0,0 +1,10 @@
+package im.pidgin.libpurple.account;
+
+/**
+ * This class represents the status of an account.
+ * @author michaelz
+ *
+ */
+public class PurpleStatus {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlist.java 90958a6ebeb81a7701c250dfe2b34f11ebb64041
@@ -0,0 +1,5 @@
+package im.pidgin.libpurple.blist;
+
+public class PurpleBlist {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistManager.java 4e01b0475f52936c03f001b67bcfb85991f9392c
@@ -0,0 +1,5 @@
+package im.pidgin.libpurple.blist;
+
+public class PurpleBlistManager {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleBlistNode.java 092dd296d7f929ce132090d28f3d69d15f4bd839
@@ -0,0 +1,5 @@
+package im.pidgin.libpurple.blist;
+
+public class PurpleBlistNode {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/blist/PurpleContact.java e0389a35e65ee92677c68af6507b1a76c57e1705
@@ -0,0 +1,5 @@
+package im.pidgin.libpurple.blist;
+
+public class PurpleContact {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/buddy/PurpleBuddy.java bcc74c20b0fb8035cecb4c9e6abd0d1a12db4354
@@ -0,0 +1,5 @@
+package im.pidgin.libpurple.buddy;
+
+public class PurpleBuddy {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/AbstractPurpleManaged.java 057d60c6f99da96e7cacf68e2f3fdd118f552726
@@ -0,0 +1,18 @@
+package im.pidgin.libpurple.core;
+
+/**
+ *
+ * Objects that use this class belong to a purple instance, which is referenced
+ * by the main manager.
+ *
+ * @author michaelz
+ *
+ */
+public class AbstractPurpleManaged implements PurpleManaged {
+
+ private final CoreManager manager;
+
+ public AbstractPurpleManaged(CoreManager manager) {
+ this.manager = manager;
+ }
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/CoreManager.java 02b4f22413e116cecfcb2b1b1ba603ea5e949e5e
@@ -0,0 +1,11 @@
+package im.pidgin.libpurple.core;
+
+/**
+ * This is the core purple manager, that provides access to all functionality.
+ *
+ * @author michaelz
+ *
+ */
+public class CoreManager {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/EventLoop.java ab4b859d0155bf197e00053cf7733f2a095ef357
@@ -0,0 +1,12 @@
+package im.pidgin.libpurple.core;
+
+/**
+ * This is the eventloop implementation that is used to schedule libpruple
+ * events on the purple thread.
+ *
+ * @author michaelz
+ *
+ */
+public class EventLoop {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/PeeredPurpleManaged.java e083ec60d63ddcaf9d9453f9ddae9bd9b4d38e93
@@ -0,0 +1,21 @@
+package im.pidgin.libpurple.core;
+
+import im.pidgin.libpurple.peering.Peered;
+
+/**
+ *
+ * Objects that use this class belong to a purple instance, which is referenced
+ * by the main manager.
+ *
+ * @author michaelz
+ *
+ */
+public class PeeredPurpleManaged extends Peered implements PurpleManaged {
+
+ private final CoreManager manager;
+
+ public PeeredPurpleManaged(long nativePointer, CoreManager manager) {
+ super(nativePointer);
+ this.manager = manager;
+ }
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/PurpleInstance.java ed1a1da5adfdcbdfed90cc182496c39db60407ec
@@ -0,0 +1,22 @@
+package im.pidgin.libpurple.core;
+
+import java.io.File;
+
+/**
+ * This is a instance of libpurple.
+ * <p>
+ * It provides access to the account and buddylist of the currently running
+ * libpurple instance.
+ * <p>
+ * There can only be one instance per process.
+ *
+ * @author michaelz
+ *
+ */
+public class PurpleInstance {
+
+
+ public static PurpleInstance createInstance(File baseDirectory) {
+ return null;
+ }
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/PurpleLibraryLoader.java 1e7151530921cadb555bb4768acd285c4af33ce0
@@ -0,0 +1,37 @@
+package im.pidgin.libpurple.core;
+
+/**
+ * Loads the libraries needed to do any native operation.
+ * <p>
+ * Is called by the core during a libpurple instance creation.
+ *
+ * @author michaelz
+ *
+ */
+public class PurpleLibraryLoader {
+ private static boolean loaded = false;
+ private static Object mutex = new Object();
+
+ public static void load() {
+ synchronized (mutex) {
+ if (!loaded) {
+ System.loadLibrary("ffi");
+ System.loadLibrary("charset");
+ System.loadLibrary("iconv");
+ System.loadLibrary("intl");
+ System.loadLibrary("gettextlib");
+ System.loadLibrary("gettextsrc");
+ System.loadLibrary("gettextpo");
+ System.loadLibrary("xml2");
+ System.loadLibrary("dbus-1");
+ System.loadLibrary("glib-2.0");
+ System.loadLibrary("gthread-2.0");
+ System.loadLibrary("gobject-2.0");
+ System.loadLibrary("gmodule-2.0");
+ System.loadLibrary("gio-2.0");
+ System.loadLibrary("purple");
+ loaded = true;
+ }
+ }
+ }
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/PurpleManaged.java 3f3a74a54a770d722f5fdf2980968150abbe412a
@@ -0,0 +1,5 @@
+package im.pidgin.libpurple.core;
+
+public interface PurpleManaged {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/PurpleThread.java ab51165467a319469e318e32a3f66cf657a56cab
@@ -0,0 +1,13 @@
+package im.pidgin.libpurple.core;
+
+/**
+ * This is the main thread of libpurple. It is used internally to execute
+ * libpurple functions that can be called from everywhere, because libpurple is
+ * not thread safe.
+ *
+ * @author michaelz
+ *
+ */
+public class PurpleThread {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/dns/DnsQueryData.java d5037dcf995e830713ab46eee521f852a19071d6
@@ -0,0 +1,16 @@
+package im.pidgin.libpurple.core.dns;
+
+import im.pidgin.libpurple.peering.Peered;
+
+/**
+ * This is the data of a dns query.
+ * @author michaelz
+ *
+ */
+public class DnsQueryData extends Peered {
+
+ public DnsQueryData(long nativePointer) {
+ super(nativePointer);
+ }
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/dns/DnsQueryFailedCallback.java b2cc9dcd15e5e6c689365d282cc649d9bc8f246b
@@ -0,0 +1,23 @@
+package im.pidgin.libpurple.core.dns;
+
+/**
+ * Contains a pointer to a native function that should be called when the dns
+ * query failed and the {@link #call(String)} method to call that function.
+ *
+ * @author michaelz
+ *
+ */
+public class DnsQueryFailedCallback {
+ private final DnsQueryData data;
+ private final long functionPointer;
+
+ public DnsQueryFailedCallback(DnsQueryData data, long functionPointer) {
+ super();
+ this.data = data;
+ this.functionPointer = functionPointer;
+ }
+
+ public void call(String errorMessage) {
+ // TODO
+ }
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/dns/DnsQueryResolvedCallback.java 192d567e4a400d08403e77070d0ae480ede7f656
@@ -0,0 +1,26 @@
+package im.pidgin.libpurple.core.dns;
+
+import java.util.List;
+
+/**
+ * Contains a callback function that should be called when the dns query as
+ * successful.
+ *
+ * @author michaelz
+ *
+ */
+public class DnsQueryResolvedCallback {
+
+ private final DnsQueryData data;
+ private final long functionPointer;
+
+ public DnsQueryResolvedCallback(DnsQueryData data, long functionPointer) {
+ this.data = data;
+ this.functionPointer = functionPointer;
+ }
+
+ public void call(List<String> hosts) {
+ // TODO
+ }
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/core/dns/DnsQueryUiOps.java bae35bff807f0c50293da1f088f72b2b9a119988
@@ -0,0 +1,27 @@
+package im.pidgin.libpurple.core.dns;
+
+/**
+ * Those are the ui ops for dns querys.
+ * <p>
+ * DNS querys are not provided by android native interface, so they need to be
+ * made with java.
+ *
+ * @author michaelz
+ *
+ */
+public interface DnsQueryUiOps {
+ /**
+ * Starts a nds query.
+ *
+ * @param data
+ * The data that contains information on what to query.
+ * @param resolvedCallback
+ * A callback that should be called on success.
+ * @param failedCallback
+ * A callback that should be called if the query failed.
+ * @return ?
+ */
+ boolean resolveHost(long data, DnsQueryResolvedCallback resolvedCallback,
+ DnsQueryFailedCallback failedCallback);
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/glib/GHashTable.java 4caf1f1e4917aad17ca7312d84ca1a6b752a719c
@@ -0,0 +1,34 @@
+package im.pidgin.libpurple.glib;
+
+import java.util.AbstractMap;
+import java.util.Set;
+
+/**
+ * This is a wrapper for a hashtable from java.
+ * <p>
+ * Only String->Something hashtables are supported.
+ *
+ * @author michaelz
+ *
+ * @param <E>
+ */
+public class GHashTable<E> extends AbstractMap<String, E> {
+
+ @Override
+ public Set<java.util.Map.Entry<String, E>> entrySet() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public E put(String key, E value) {
+ // TODO Auto-generated method stub
+ return super.get(key);
+ };
+
+ @Override
+ public E get(Object key) {
+ // TODO Auto-generated method stub
+ return super.get(key);
+ }
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/glib/GHashTableSet.java f35ea287bd51a62aa5280f7fc8e1880de1f34e90
@@ -0,0 +1,21 @@
+package im.pidgin.libpurple.glib;
+
+import java.util.AbstractSet;
+import java.util.Iterator;
+import java.util.Map.Entry;
+
+public class GHashTableSet<E> extends AbstractSet<Entry<String, E>> {
+
+ @Override
+ public Iterator<Entry<String, E>> iterator() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int size() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/glib/GList.java fc3922a5ed3ee7d818c8beb4a907e35c3c4fbe21
@@ -0,0 +1,19 @@
+package im.pidgin.libpurple.glib;
+
+import java.util.AbstractSequentialList;
+import java.util.ListIterator;
+
+public class GList<E> extends AbstractSequentialList<E>{
+ @Override
+ public ListIterator<E> listIterator(int location) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int size() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/glib/GListIterator.java ef963c908966e064d91c85358d1c0bb4267702cb
@@ -0,0 +1,68 @@
+package im.pidgin.libpurple.glib;
+
+import java.util.ListIterator;
+
+/**
+ * This is an iterator over a glist.
+ *
+ * @author michaelz
+ *
+ * @param <E> The list elemt type.
+ */
+public class GListIterator<E> implements ListIterator<E> {
+
+ @Override
+ public void add(E arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean hasNext() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean hasPrevious() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public E next() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int nextIndex() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public E previous() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public int previousIndex() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public void remove() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void set(E arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/glib/GSourceFunctionCall.java 03fcde9abbac47282f59964fd6e1f44770b81dbe
@@ -0,0 +1,35 @@
+package im.pidgin.libpurple.glib;
+
+/**
+ * This is a call to a GSourceFunction with a given argument.
+ * @author michaelz
+ *
+ */
+public class GSourceFunctionCall {
+
+ final long functionPointer;
+
+ final long argument;
+
+ /**
+ * Constructs a new function call.
+ * @param functionPointer A pointer to the function to call.
+ * @param argument The argument the function should have.
+ */
+ public GSourceFunctionCall(long functionPointer, long argument) {
+ this.functionPointer = functionPointer;
+ this.argument = argument;
+ }
+
+ /**
+ * Executes the function call on the current thread.
+ * @return true if and only if the function should be called again.
+ */
+ boolean call() {
+ // TODO Auto-generated method stub
+
+ return false;
+ }
+
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/peering/NativeObjectUnavailableException.java 90440c650b72b429209c1648262673781342b76e
@@ -0,0 +1,34 @@
+package im.pidgin.libpurple.peering;
+
+/**
+ *
+ * This exception is thrown when a native object is unavailable.
+ *
+ * @author michaelz
+ *
+ */
+public class NativeObjectUnavailableException extends RuntimeException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 8870794468101184L;
+
+ public NativeObjectUnavailableException() {
+ super();
+ }
+
+ public NativeObjectUnavailableException(String detailMessage,
+ Throwable throwable) {
+ super(detailMessage, throwable);
+ }
+
+ public NativeObjectUnavailableException(String detailMessage) {
+ super(detailMessage);
+ }
+
+ public NativeObjectUnavailableException(Throwable throwable) {
+ super(throwable);
+ }
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/peering/PeerGenerator.java 749de8ac2a0876d27d7272c0f9430e5cbacccdd9
@@ -0,0 +1,23 @@
+package im.pidgin.libpurple.peering;
+
+/**
+ * Converts pointers to java objects and the other way around.
+ *
+ * @author michaelz
+ *
+ */
+public interface PeerGenerator<E> {
+ /**
+ * Gets a java object for a pointer to an native object.
+ * @param pointer The pointer to the natie object. It must be a valid pointer, which also means that it may not be NULL.
+ * @return A java object and not null.
+ */
+ E getPeer(long pointer);
+
+ /**
+ * Gets the native pointer for a java object.
+ * @param object The java object
+ * @return A pointer to the native part of the object.
+ */
+ long getPeer(E object);
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/peering/Peered.java fe13fb757133c104556b21f09e88b6401af221f7
@@ -0,0 +1,113 @@
+package im.pidgin.libpurple.peering;
+
+import java.util.Map;
+
+/**
+ * This is a helper class that handles the native peer pointer and makes
+ * handling native references easier.
+ * <p>
+ * When implementing a native object, you should do the following:
+ * <ul>
+ * <li>
+ * Use this class as superclass and store the native pointer with it.</li>
+ * <li>
+ * When you need access to the pointer from native code, use the utility
+ * function (TODO: name) to get a pointer to this object.</li>
+ * <li>
+ * When you need the pointer from java, use {@link #getNativePointer()}</li>
+ * </ul>
+ * If your native peer gets freed by some other component:
+ * <ul>
+ * <li>
+ * When your native peer gets destroyed, call {@link #nativeObjectFreed()}. This
+ * will set the native Pointer to NULL (0).</li>
+ * <li>
+ * Before accessing any native functions, call {@link #ensureNotDestroyed()}
+ * <li>
+ * Ensure that the native object only gets destroyed when it is on a thread that
+ * you synchronize all other access against. This will most likely be the purple
+ * eventloop.
+ * <li>
+ * Add a note to your documentation that this object can be destroyed and how to
+ * ensure that this does not happen while someone accesses it.
+ * </ul>
+ *
+ * You want to free your native peer when your java object gets garbage
+ * collected
+ * <ul>
+ * Just override the {@link #finalize()} method and add your code there.
+ * </ul>
+ *
+ * <h2>Caching</h2>
+ *
+ * You sometimes want to cache a java object, e.g. to only create one java
+ * object per native instance. This can be done in two ways, bur you should only
+ * use one of those.
+ * <ul>
+ * Use a {@link Map} that keeps a reference to java objects that have been
+ * generated and whose references get removed when the objects are freed. If you
+ * want to, you can use weak references for this, but remember to clean the
+ * table once in a while, because a weak reference needs memmory even if the
+ * referenced object was garbage collected.
+ * <li>
+ * In your native code, create a new global reference to your object and add it
+ * to the native object, if it has a ui_handle or similar field.
+ * </ul>
+ *
+ * @author michaelz
+ *
+ */
+public abstract class Peered {
+
+ private long nativePointer;
+
+ /**
+ * Stores the pointer to the native peer.
+ *
+ * @param nativePointer
+ * The native pointer.
+ */
+ protected Peered(long nativePointer) {
+ this.nativePointer = nativePointer;
+ }
+
+ /**
+ * Gets a pointer to the native object
+ *
+ * @throws NativeObjectUnavailableException
+ * If the native object was already be freed.
+ * @return A pointer to the native object.
+ */
+ public long getNativePointer() {
+ return nativePointer;
+ }
+
+ /**
+ * Call this when the native object is freed.
+ */
+ protected void nativeObjectFreed() {
+ nativePointer = 0;
+ }
+
+ /**
+ * Ensures that the native peer was not marked as freed.
+ *
+ * @throws NativeObjectUnavailableException
+ * If the native object was already be freed.
+ */
+ protected void ensureNotDestroyed() {
+ if (isFreed()) {
+ throw new NativeObjectUnavailableException(
+ "Native object was destroyed.");
+ }
+ }
+
+ /**
+ * Checks if this object was freed.
+ *
+ * @return true if it was freed and should not be used any longer.
+ */
+ public boolean isFreed() {
+ return nativePointer == 0;
+ }
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/plugin/PurplePlugin.java 9df7825e41479dd75e05511206fea4859cccd3aa
@@ -0,0 +1,11 @@
+package im.pidgin.libpurple.plugin;
+
+/**
+ * This is a plugin for libpurple.
+ *
+ * @author michaelz
+ *
+ */
+public class PurplePlugin {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/plugin/PurplePluginManager.java 05fbc62aac32f4f4491e7055bf34a61bc8a656c5
@@ -0,0 +1,5 @@
+package im.pidgin.libpurple.plugin;
+
+public class PurplePluginManager {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/plugin/PurpleProtocolPlugin.java 619cd141f085f6c10082373ecdf9d7d4d6dc5045
@@ -0,0 +1,12 @@
+package im.pidgin.libpurple.plugin;
+
+/**
+ * This is a protocol plugin, a special form of a plugin that handles
+ * communication with an im/chat server.
+ *
+ * @author michaelz
+ *
+ */
+public class PurpleProtocolPlugin {
+
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/uiops/CoreUiOps.java 71e592a6922418f6fd5598269c85717cb42510fa
@@ -0,0 +1,16 @@
+package im.pidgin.libpurple.uiops;
+
+import java.util.Map;
+
+import im.pidgin.libpurple.glib.GHashTable;
+
+/**
+ * These are the callbacks that come from core when it was started.
+ *
+ * @author michaelz
+ *
+ */
+public interface CoreUiOps {
+
+ GHashTable<String> getUiInfo();
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/uiops/DebugUiOps.java feb600f3d4f55a34286f37e43a0880ea0a17dc83
@@ -0,0 +1,8 @@
+package im.pidgin.libpurple.uiops;
+
+public interface DebugUiOps {
+
+ void print(int level, String category, String arg);
+
+ boolean isEnabled(int level, String category);
+}
============================================================
--- /dev/null
+++ android/workspace/im.pidgin.libpurple/src/im/pidgin/libpurple/uiops/EventLoopUiOps.java 0770465adbbc3892a4d64599819a78bc5ce36ba3
@@ -0,0 +1,35 @@
+package im.pidgin.libpurple.uiops;
+
+import im.pidgin.libpurple.glib.GSourceFunctionCall;
+
+/**
+ * This interface needs to be implemented by the eventloop.
+ *
+ * @author michaelz
+ *
+ */
+public interface EventLoopUiOps {
+ /**
+ * Creates a callback timer that calls the function every interval
+ * milliseconds.
+ * <p>
+ * Calling ius stopped as soon as the function call returns false or
+ * timeoutRemove is called.
+ *
+ * @param intervall
+ * The interval to call the function in milliseconds.
+ * @param functionCall
+ * The function to call.
+ * @return A handle that can be passed on to timeoutRemove.
+ */
+ int addTimeout(int intervall, GSourceFunctionCall functionCall);
+
+ /**
+ * Removes the timeout if it exists, does nothing if the timeout was already
+ * canceled or never started.
+ *
+ * @param timeout
+ * The timeout to remove.
+ */
+ void timeoutRemove(int timeout);
+}
More information about the Commits
mailing list