Print this page


Split Close
Expand all
Collapse all
          --- old/src/solaris/native/sun/awt/awt_LoadLibrary.c
          +++ new/src/solaris/native/sun/awt/awt_LoadLibrary.c
↓ open down ↓ 97 lines elided ↑ open up ↑
  98   98      jvm = vm;
  99   99  
 100  100      /* Get address of this library and the directory containing it. */
 101  101      dladdr((void *)JNI_OnLoad, &dlinfo);
 102  102      realpath((char *)dlinfo.dli_fname, buf);
 103  103      len = strlen(buf);
 104  104      p = strrchr(buf, '/');
 105  105  
 106  106      /*
 107  107       * The code below is responsible for:
 108      -     * 1. Loading appropriate awt library, i.e. xawt/libmawt or headless/libwawt
      108 +     * 1. Loading appropriate awt library, i.e. libawt_xawt or libawt_headless
 109  109       * 2. Setting "awt.toolkit" system property to use the appropriate Java toolkit class,
 110  110       *    (if user has specified the toolkit in env varialble)
 111  111       */
 112  112  
 113  113      propname = (*env)->NewStringUTF(env, "awt.toolkit");
 114  114      /* Check if toolkit is specified in env variable */
 115  115      envvar = getenv("AWT_TOOLKIT");
 116  116      if (envvar) {
 117  117          if (strstr(envvar, "XToolkit")) {
 118  118              toolkit = (*env)->NewStringUTF(env, "sun.awt.X11.XToolkit");
↓ open down ↓ 4 lines elided ↑ open up ↑
 123  123                                          NULL,
 124  124                                          "java/lang/System",
 125  125                                          "setProperty",
 126  126                                          "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;",
 127  127                                          propname,toolkit);
 128  128          }
 129  129      }
 130  130  
 131  131      /* Calculate library name to load */
 132  132      if (AWTIsHeadless()) {
 133      -        strncpy(p, "/headless/libmawt.so", MAXPATHLEN-len-1);
      133 +        strncpy(p, "/libawt_headless.so", MAXPATHLEN-len-1);
 134  134      } else {
 135  135          /* Default AWT Toolkit on Linux and Solaris is XAWT. */
 136      -        strncpy(p, "/xawt/libmawt.so", MAXPATHLEN-len-1);
      136 +        strncpy(p, "/libawt_xawt.so", MAXPATHLEN-len-1);
 137  137      }
 138  138  
 139  139      if (toolkit) {
 140  140          (*env)->DeleteLocalRef(env, toolkit);
 141  141      }
 142  142      if (propname) {
 143  143          (*env)->DeleteLocalRef(env, propname);
 144  144      }
 145  145  
 146  146      JNU_CallStaticMethodByName(env, NULL, "java/lang/System", "load",
↓ open down ↓ 7 lines elided ↑ open up ↑
 154  154  
 155  155  JNIEXPORT jint JNICALL
 156  156  JNI_OnLoad(JavaVM *vm, void *reserved)
 157  157  {
 158  158      return AWT_OnLoad(vm, reserved);
 159  159  }
 160  160  
 161  161  /*
 162  162   * This entry point must remain in libawt.so as part of a contract
 163  163   * with the CDE variant of Java Media Framework. (sdtjmplay)
 164      - * Reflect this call over to the correct libmawt.so.
      164 + * Reflect this call over to the correct libawt_<toolkit>.so.
 165  165   */
 166  166  JNIEXPORT void JNICALL
 167  167  Java_sun_awt_motif_XsessionWMcommand(JNIEnv *env, jobject this,
 168  168                                       jobject frame, jstring jcommand)
 169  169  {
 170  170      /* type of the old backdoor function */
 171  171      typedef JNIEXPORT void JNICALL
 172  172          XsessionWMcommand_type(JNIEnv *env, jobject this,
 173  173                                 jobject frame, jstring jcommand);
 174  174  
↓ open down ↓ 9 lines elided ↑ open up ↑
 184  184      if (XsessionWMcommand == NULL)
 185  185          return;
 186  186  
 187  187      (*XsessionWMcommand)(env, this, frame, jcommand);
 188  188  }
 189  189  
 190  190  
 191  191  /*
 192  192   * This entry point must remain in libawt.so as part of a contract
 193  193   * with the CDE variant of Java Media Framework. (sdtjmplay)
 194      - * Reflect this call over to the correct libmawt.so.
      194 + * Reflect this call over to the correct libawt_<toolkit>.so.
 195  195   */
 196  196  JNIEXPORT void JNICALL
 197  197  Java_sun_awt_motif_XsessionWMcommand_New(JNIEnv *env, jobjectArray jargv)
 198  198  {
 199  199      typedef JNIEXPORT void JNICALL
 200  200          XsessionWMcommand_New_type(JNIEnv *env, jobjectArray jargv);
 201  201  
 202  202      static XsessionWMcommand_New_type *XsessionWMcommand = NULL;
 203  203  
 204  204      if (XsessionWMcommand == NULL && awtHandle == NULL) {
↓ open down ↓ 38 lines elided ↑ open up ↑
 243  243          dlsym(awtHandle, #name);                                        \
 244  244      if (name##_ptr == NULL) {                                           \
 245  245          return NULL;                                                    \
 246  246      }                                                                   \
 247  247      return (*name##_ptr)paramlist;                                      \
 248  248  }
 249  249  
 250  250  
 251  251  /*
 252  252   * These entry point must remain in libawt.so ***for Java Plugin ONLY***
 253      - * Reflect this call over to the correct libmawt.so.
      253 + * Reflect this call over to the correct libawt_<toolkit>.so.
 254  254   */
 255  255  
 256  256  REFLECT_VOID_FUNCTION(getAwtLockFunctions,
 257  257                        (void (**AwtLock)(JNIEnv *), void (**AwtUnlock)(JNIEnv *),
 258  258                         void (**AwtNoFlushUnlock)(JNIEnv *), void *reserved),
 259  259                        (AwtLock, AwtUnlock, AwtNoFlushUnlock, reserved))
 260  260  
 261  261  REFLECT_VOID_FUNCTION(getAwtData,
 262  262                        (int32_t *awt_depth, Colormap *awt_cmap, Visual **awt_visual,
 263  263                         int32_t *awt_num_colors, void *pReserved),
 264  264                        (awt_depth, awt_cmap, awt_visual,
 265  265                         awt_num_colors, pReserved))
 266  266  
 267  267  REFLECT_FUNCTION(Display *, getAwtDisplay, (void), ())
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX