This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demopkg; | |
public class ComplexStruct { | |
int fieldI; | |
byte[] arr; | |
String str; | |
ComplexStruct prior; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demopkg; | |
public interface ICallback { | |
void onPercent(int percent); | |
void onPercentEx(ComplexStruct cs); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package demopkg; | |
public class Process { | |
native void nativeLongOperation(ICallback callback); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
Process process = new Process(); | |
process.nativeLongOperation(new CallbackImpl()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <jni.h> | |
#include "demopkg_Process.h" | |
JNIEXPORT void JNICALL Java_demopkg_Process_nativeLongOperation | |
(JNIEnv *env, jobject owner, jobject param1) | |
{ | |
jclass clsICallback = env->GetObjectClass(param1); | |
jmethodID method1 = env->GetMethodID(clsICallback, "onPercent", "(I)V"); | |
jmethodID method2 = env->GetMethodID(clsICallback, "onPercentEx", "(Ldemopkg/ComplexStruct;)V"); | |
jclass clsComplexStruct = env->FindClass("demopkg/ComplexStruct"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "StdAfx.h" | |
#include "Common/MyInitGuid.h" | |
#include "SevenZipJBinding.h" | |
#include "JNITools.h" | |
#include "net_sf_sevenzipjbinding_SevenZip.h" | |
#include "CPPToJava/CPPToJavaInStream.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CodeBlocks config: | |
Build options->Linker settings: rt xcb | |
Properties->Build targets: GUI application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://stackoverflow.com/questions/5134297/xlib-how-does-this-removing-window-decoration-work | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <iostream> | |
#include <inttypes.h> | |
#include <xcb/xcb.h> | |
#include <xcb/xproto.h> | |
//xcb_event.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
typedef uint64_t CARD64; | |
typedef uint32_t CARD32; | |
typedef uint16_t CARD16; | |
typedef unsigned char CARD8; | |
typedef CARD8 BYTE; | |
typedef CARD8 BOOL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <exception> | |
#include <assert.h> | |
#include "yAllocator.h" | |
#define min(a,b) a<b?a:b | |
#define BITSIZE(a) (sizeof(a)*8) | |
#define ISBITSET(x,k) (x & (1<<k)) |
OlderNewer