// Path: src/cn/com/jautoitx/Opt.java
// public static enum CoordMode {
// 	/* relative coords to the active window */
// 	RELATIVE_TO_ACTIVE_WINDOW(0),
// 
// 	/* absolute screen coordinates (default) */
// 	ABSOLUTE_SCREEN_COORDINATES(1),
// 
// 	/* relative coords to the client area of the active window */
// 	RELATIVE_TO_CLIENT_AREA_OF_ACTIVE_WINDOW(2);
// 
// 	private final int coordMode;
// 
// 	private CoordMode(final int coordMode) {
// 		this.coordMode = coordMode;
// 	}
// 
// 	public int getCoordMode() {
// 		return coordMode;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		switch (this) {
// 		case RELATIVE_TO_ACTIVE_WINDOW:
// 			return "relative coords to the active window";
// 		case ABSOLUTE_SCREEN_COORDINATES:
// 			return "absolute screen coordinates";
// 		case RELATIVE_TO_CLIENT_AREA_OF_ACTIVE_WINDOW:
// 			return "relative coords to the client area of the active window";
// 		default:
// 			return "Unknown coord mode";
// 		}
// 	}
// }


import java.io.Closeable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.CharBuffer;
import java.util.logging.Logger;
import org.apache.commons.lang3.StringUtils;
import cn.com.jautoitx.Opt.CoordMode;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Platform;
import com.sun.jna.Pointer;
import com.sun.jna.WString;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.platform.win32.WinDef.POINT;
import com.sun.jna.platform.win32.WinDef.RECT;


	/**
	 * Clears a displaying tooltip
	 */
	public static void tooltip() {
		tooltip(null);
	}

	/**
	 * Creates a tooltip anywhere on the screen.
	 * 
	 * If the x and y coordinates are omitted the, tip is placed near the mouse
	 * cursor. If the coords would cause the tooltip to run off screen, it is
	 * repositioned to visible. Tooltip appears until it is cleared, until
	 * script terminates, or sometimes until it is clicked upon. You may use a
	 * linefeed character to create multi-line tooltips.
	 * 
	 * @param text
	 *            The text of the tooltip. (An empty string clears a displaying
	 *            tooltip).
	 */
	public static void tooltip(final String text) {
		if (StringUtils.isEmpty(text)) {
			// clear tooltip
			tooltip(text, null, null);
		} else {
			// If the x and y coordinates are omitted the, tip is placed near
			// the mouse cursor

			// Fix AutoItX's bug

// Path: src/cn/com/jautoitx/Opt.java
// public static enum CoordMode {
// 	/* relative coords to the active window */
// 	RELATIVE_TO_ACTIVE_WINDOW(0),
// 
// 	/* absolute screen coordinates (default) */
// 	ABSOLUTE_SCREEN_COORDINATES(1),
// 
// 	/* relative coords to the client area of the active window */
// 	RELATIVE_TO_CLIENT_AREA_OF_ACTIVE_WINDOW(2);
// 
// 	private final int coordMode;
// 
// 	private CoordMode(final int coordMode) {
// 		this.coordMode = coordMode;
// 	}
// 
// 	public int getCoordMode() {
// 		return coordMode;
// 	}
// 
// 	@Override
// 	public String toString() {
// 		switch (this) {
// 		case RELATIVE_TO_ACTIVE_WINDOW:
// 			return "relative coords to the active window";
// 		case ABSOLUTE_SCREEN_COORDINATES:
// 			return "absolute screen coordinates";
// 		case RELATIVE_TO_CLIENT_AREA_OF_ACTIVE_WINDOW:
// 			return "relative coords to the client area of the active window";
// 		default:
// 			return "Unknown coord mode";
// 		}
// 	}
// }


// Path: src/cn/com/jautoitx/AutoItX.java
import java.io.Closeable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.CharBuffer;
import java.util.logging.Logger;
import org.apache.commons.lang3.StringUtils;
import cn.com.jautoitx.Opt.CoordMode;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Platform;
import com.sun.jna.Pointer;
import com.sun.jna.WString;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.platform.win32.WinDef.POINT;
import com.sun.jna.platform.win32.WinDef.RECT;


	/**
	 * Clears a displaying tooltip
	 */
	public static void tooltip() {
		tooltip(null);
	}

	/**
	 * Creates a tooltip anywhere on the screen.
	 * 
	 * If the x and y coordinates are omitted the, tip is placed near the mouse
	 * cursor. If the coords would cause the tooltip to run off screen, it is
	 * repositioned to visible. Tooltip appears until it is cleared, until
	 * script terminates, or sometimes until it is clicked upon. You may use a
	 * linefeed character to create multi-line tooltips.
	 * 
	 * @param text
	 *            The text of the tooltip. (An empty string clears a displaying
	 *            tooltip).
	 */
	public static void tooltip(final String text) {
		if (StringUtils.isEmpty(text)) {
			// clear tooltip
			tooltip(text, null, null);
		} else {
			// If the x and y coordinates are omitted the, tip is placed near
			// the mouse cursor

			// Fix AutoItX's bug

			CoordMode newCoodMode = CoordMode.ABSOLUTE_SCREEN_COORDINATES;
