00001
00011 #ifndef _TEXTFIELD_H_
00012 #define _TEXTFIELD_H_
00013
00014 #include "../jnilib.h"
00015
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif
00019
00021 #define CLS_TEXTFIELD "java/awt/TextField"
00022
00023 struct TextField_;
00024
00025 struct TextFieldCPP_;
00026
00027 #ifdef __cplusplus
00028 typedef TextFieldCPP_ TextField;
00029 #define createTextField createTextFieldCPP
00030 #define deleteTextField deleteTextFieldCPP
00031 #else
00032 typedef struct TextField_ TextField;
00033 #define createTextField createTextFieldC
00034 #define deleteTextField deleteTextFieldC
00035 #endif
00036
00040 typedef struct TextFieldData {
00041 jclass clstextfield;
00042 jobject textfield;
00043 jmethodID msetText;
00044 jmethodID mgetText;
00045 jmethodID mgetColumns;
00046 jmethodID msetColumns;
00047 } TextFieldData;
00048
00052 typedef struct TextField_ {
00053 TextFieldData textfield;
00054 jobject (*getObject)(TextField* textfield);
00055 void (*setText)(TextField* textfield, const char* text);
00056 char* (*getText)(TextField* textfield);
00057 void (*setSize)(TextField* textfield, jint width, jint height);
00058 jint (*getHeight)(TextField* textfield);
00059 jint (*getWidth)(TextField* textfield);
00060 void (*setLocation)(TextField* textfield, jint x, jint y);
00061 jint (*getX)(TextField* textfield);
00062 jint (*getY)(TextField* textfield);
00063 jint (*getColumns)(TextField* textfield);
00064 void (*setColumns)(TextField* textfield, jint columns);
00065 } TextField_;
00066
00070 typedef struct TextFieldCPP_ {
00071 TextFieldData textfield;
00072 struct TextField_ *functions;
00073
00074 #ifdef __cplusplus
00075 jobject getObject() {
00076 return functions->getObject(this);
00077 }
00078
00079 void setText(const char* text) {
00080 functions->setText(this, text);
00081 }
00082
00083 char* getText() {
00084 return functions->getText(this);
00085 }
00086
00087 void setSize(jint width, jint height) {
00088 functions->setSize(this, width, height);
00089 }
00090
00091 jint getHeight() {
00092 return functions->getHeight(this);
00093 }
00094
00095 jint getWidth() {
00096 return functions->getWidth(this);
00097 }
00098
00099 void setLocation(jint x, jint y) {
00100 functions->setLocation(this, x, y);
00101 }
00102
00103 jint getX() {
00104 return functions->getX(this);
00105 }
00106
00107 jint getY() {
00108 return functions->getY(this);
00109 }
00110
00111 jint getColumns() {
00112 return functions->getColumns(this);
00113 }
00114
00115 void setColumns(jint columns) {
00116 functions->setColumns(this, columns);
00117 }
00118
00119 #endif
00120 } TextFieldCPP_;
00121
00122
00123 void createTextFieldC(TextField_* textfield);
00124 void createTextFieldCPP(TextFieldCPP_* textfield);
00125 void deleteTextFieldC(TextField_* textfield);
00126 void deleteTextFieldCPP(TextFieldCPP_* textfield);
00127
00128 #ifdef __cplusplus
00129 }
00130 #endif
00131
00132 #endif
00133
00134