view native/OpenHaptics/XYPad/Message.h @ 1:46671fc7d649 tip

fixed "window" message bug and brought the message outside the haptic device monitor
author Fiore Martin <f.martin@qmul.ac.uk>
date Fri, 13 Mar 2015 13:02:16 +0000
parents 011caca7515a
children
line wrap: on
line source
/*
XYPad - a haptic xy-pad that uses the jHapticGUI library

Copyright (C) 2015  Queen Mary University of London (http://depic.eecs.qmul.ac.uk/)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once

#include <jni.h>

namespace jhapticgui {

	struct Message {
		static const int MAX_CMD_LEN = 32;
		static const int MAX_ARGS_LEN = 64;

        /**
         * The id identifies the haptic object the command refers to 
         */ 
		jint ID;
        /**
         * the command identifier
         */
		char command[MAX_CMD_LEN];
        /**
         * The command arguments. It's the string encoding of any type of
         * value, e.g. integers, floats, string itself etc. 
         */ 
		char args[MAX_ARGS_LEN];

        /**
         * Empty message constructor. Used for a message from the java thread.
         * The fields of the messae are filled with the value sent by the java
         * thread 
         */
		Message();

        /**
         */ 
		Message(const char* c, const char* a, jint id);
	};

}