Back to index

im-sdk  12.3.91
fop_test.c
Go to the documentation of this file.
00001 /*
00002  * fop_test_case.c: iml file operation - LE for testing
00003  */
00004 
00005 #include <stdio.h>
00006 #include <stdlib.h>
00007 #include <string.h>
00008 #include <sys/types.h>
00009 
00010 #include "config.h"
00011 
00012 /*
00013  * header files for SunIM library
00014  */
00015 #include <syscfg.h>
00016 #include "SunIM.h"
00017 #include "SunIMMMan.h"
00018 #include "SunIMProt.h"
00019 #include "SunIMMthd.h"
00020 #include "SunIMPriv.h"
00021 #include "SunIMCore.h"
00022 #include "SunIMPub.h"
00023 
00024 #include "fop_test.h"
00025 
00026 /*
00027  * define If method prototype
00028  */
00029 static Bool   if_fop_test_OpenIF(iml_if_t *);
00030 static Bool   if_fop_test_CloseIF(iml_if_t *);
00031 static Bool   if_fop_test_GetIFValues(iml_if_t *, IMArgList, int);
00032 static Bool   if_fop_test_SetIFValues(iml_if_t *, IMArgList, int);
00033 static Bool   if_fop_test_OpenDesktop(iml_desktop_t *, IMArgList, int);
00034 static Bool   if_fop_test_CloseDesktop(iml_desktop_t *);
00035 static Bool   if_fop_test_CreateSC(iml_session_t*, IMArgList, int);
00036 static Bool   if_fop_test_DestroySC(iml_session_t *);
00037 static Bool   if_fop_test_GetSCValues(iml_session_t *, IMArgList, int);
00038 static Bool   if_fop_test_SetSCValues(iml_session_t *, IMArgList, int);
00039 static IMText *      if_fop_test_ResetSC(iml_session_t *);
00040 static void   if_fop_test_SetSCFocus(iml_session_t *);
00041 static void   if_fop_test_UnsetSCFocus(iml_session_t *);
00042 static void   if_fop_test_SendEvent(iml_session_t *, IMInputEvent * ev);
00043 
00044 /*
00045  * define if_methods_t
00046  */
00047 static if_methods_t if_methods = {
00048     if_fop_test_OpenIF,
00049     if_fop_test_CloseIF,
00050     if_fop_test_GetIFValues,
00051     if_fop_test_SetIFValues,
00052     if_fop_test_OpenDesktop,
00053     if_fop_test_CloseDesktop,
00054     if_fop_test_CreateSC,
00055     if_fop_test_DestroySC,
00056     if_fop_test_GetSCValues,
00057     if_fop_test_SetSCValues,
00058     if_fop_test_ResetSC,
00059     if_fop_test_SetSCFocus,
00060     if_fop_test_UnsetSCFocus,
00061     if_fop_test_SendEvent
00062 };
00063 
00064 /*
00065  * define Human Readable Name as UTFCHAR for LE
00066  */
00067 static UTFCHAR lename_string[] = {
00068     0x6551,
00069     0xfa51,
00070     0x9b52,
00071     0x1c69,
00072     0xfb67,
00073     0x0000
00074 };
00075 
00076 /*
00077  * define Human Readable Name as UTFCHAR for language
00078  */
00079 static UTFCHAR jahrn_string[] = {
00080     0x65e5,
00081     0x672c,
00082     0x8a9e,
00083     0x0000
00084 };
00085 
00086 static IMLEName lename = {
00087     "fop_test",                    /* LE id */
00088     lename_string           /* LE HRN */
00089 };
00090 
00091 static IMLocale locales[] = {
00092     {
00093         "ja",               /* locale id */
00094         jahrn_string        /* locale HRN */
00095     },
00096     {
00097        NULL,
00098        NULL
00099     }
00100 };
00101 
00102 #ifdef WIN32
00103 #define EXPORT extern __declspec(dllexport)
00104 
00105 EXPORT
00106 
00107 #endif
00108 
00109 
00110 void
00111 if_GetIfInfo(
00112     IMArgList args,
00113     int              num_args
00114 )
00115 {
00116     int i;
00117 
00118     for (i = 0; i < num_args; i++, args++) {
00119         switch (args->id) {
00120             case IF_VERSION:
00121                 args->value = (IMArgVal) "1.2";
00122                 break;
00123             case IF_METHOD_TABLE:
00124                 args->value = (IMArgVal)(&if_methods);
00125                 break;
00126             case IF_LE_NAME:
00127                 args->value = (IMArgVal)(&lename);
00128                 break;
00129             case IF_SUPPORTED_LOCALES:
00130                 args->value = (IMArgVal)(&locales);
00131                 break;
00132             case IF_SUPPORTED_OBJECTS:
00133                 break;
00134             case IF_NEED_THREAD_LOCK:
00135                 args->value = (IMArgVal)(False);
00136                 break;
00137             default:
00138                 break;
00139             }
00140     }
00141 }
00142 
00143 
00144 static Bool
00145 if_fop_test_OpenIF(
00146     iml_if_t *       If
00147 )
00148 {
00149     return True;
00150 }
00151 
00152 
00153 static Bool
00154 if_fop_test_CloseIF(
00155     iml_if_t *       If
00156 )
00157 {
00158     return True;
00159 }
00160 
00161 
00162 static Bool
00163 if_fop_test_GetIFValues(
00164     iml_if_t *       If,
00165     IMArgList args,
00166     int              num_args
00167 )
00168 {
00169     return True;
00170 }
00171 
00172 
00173 static Bool
00174 if_fop_test_SetIFValues(
00175     iml_if_t *       If,
00176     IMArgList args,
00177     int              num_args
00178 )
00179 {
00180     return True;
00181 }
00182 
00183 
00184 static Bool
00185 if_fop_test_OpenDesktop(
00186     iml_desktop_t *  desktop,
00187     IMArgList        args,
00188     int                     num_args
00189 )
00190 {
00191     int i;
00192 
00193     printf("if_fop_test_OpenDesktop()\n");
00194     printf("  This method is invoked when the user start to use\n");
00195     printf("  the desktop, which means the first connection.\n");
00196     
00197     printf("\n");
00198     printf("  user [%s@%s] is entered\n",
00199         desktop->user_name,
00200         desktop->host_name);
00201     printf("\n");
00202 
00203     printf("  The additional info of IM client are\n");
00204 
00205     for (i = 0; i < num_args; i++, args++) {
00206         switch (args->id) {
00207             case UI_USER_NAME:
00208                 if (args->value) {
00209                     printf("       UI_USER_NAME=%s\n", args->value);
00210                 }
00211                 break;
00212             case UI_HOST_NAME:
00213                 if (args->value) {
00214                     printf("       UI_HOST_NAME=%s\n", args->value);
00215                 }
00216                 break;
00217             case UI_DISPLAY_ID:
00218                 if (args->value) {
00219                     printf("       UI_DISPLAY_ID=%s\n", args->value);
00220                 }
00221                 break;
00222             case UI_PROTOCOL_TYPE:
00223                 if (args->value) {
00224                     printf("       UI_PROTOCOL_TYPE=%s\n", args->value);
00225                 }
00226                 break;
00227             case UI_CLIENT_TYPE:
00228                 if (args->value) {
00229                     printf("       UI_CLIENT_TYPE=%s\n", args->value);
00230                 }
00231                 break;
00232             case UI_XSERVER_VENDOR:
00233                 if (args->value) {
00234                     printf("       UI_XSERVER_VENDOR=%s\n", args->value);
00235                 }
00236                 break;
00237             case UI_OS_NAME:
00238                 if (args->value) {
00239                     printf("       UI_OS_NAME=%s\n", args->value);
00240                 }
00241                 break;
00242             case UI_OS_ARCH:
00243                 if (args->value) {
00244                     printf("       UI_OS_ARCH=%s\n", args->value);
00245                 }
00246                 break;
00247             case UI_OS_VERSION:
00248                 if (args->value) {
00249                     printf("       UI_OS_VERSION=%s\n", args->value);
00250                 }
00251                 break;
00252             }
00253     }
00254     
00255     return True;
00256 }
00257 
00258 
00259 static Bool
00260 if_fop_test_CloseDesktop(
00261     iml_desktop_t *  desktop
00262 )
00263 {
00264     return True;
00265 }
00266 
00267 
00268 static Bool
00269 if_fop_test_CreateSC(
00270     iml_session_t *  s,
00271     IMArgList        args,
00272     int                     num_args
00273 )
00274 {
00275     return True;
00276 }
00277 
00278 
00279 static Bool
00280 if_fop_test_DestroySC(
00281     iml_session_t *  s
00282 )
00283 {
00284     return True;
00285 }
00286 
00287 
00288 static Bool
00289 if_fop_test_GetSCValues(
00290     iml_session_t *  s,
00291     IMArgList        args,
00292     int                     num_args
00293 )
00294 {
00295     return True;
00296 }
00297 
00298 
00299 static Bool
00300 if_fop_test_SetSCValues(
00301     iml_session_t *  s,
00302     IMArgList        args,
00303     int                     num_args
00304 )
00305 {
00306     return True;
00307 }
00308 
00309 
00310 static IMText *
00311 if_fop_test_ResetSC(
00312     iml_session_t *  s
00313 )
00314 {
00315     return (IMText *)NULL;
00316 }
00317 
00318 
00319 static void
00320 if_fop_test_SetSCFocus(
00321     iml_session_t *  s
00322 )
00323 {
00324     fop_test_cases_all(s->desktop, s->If->nsc_get_function);
00325 }
00326 
00327 
00328 static void
00329 if_fop_test_UnsetSCFocus(
00330     iml_session_t *  s
00331 )
00332 {
00333 }
00334 
00335 
00336 static void
00337 if_fop_test_SendEvent(
00338     iml_session_t *  s,
00339     IMInputEvent *   ev
00340 )
00341 {
00342     if (IM_EventKeyList == ev->type) {
00343     }
00344 }
00345 
00346 /* Local Variables: */
00347 /* c-file-style: "iiim-project" */
00348 /* End: */