Changeset 377


Ignore:
Timestamp:
Jun 5, 2012, 9:51:10 AM (13 years ago)
Author:
dmik
Message:

icedtea-web: Wrap OS/2 HWND in WinOS2 HWND.

Java expects WinOS2 HWNDs while the plugin gets the OS/2 HWND
from the browser.

This commit also includes some source file reorganization (for clarity).

Location:
trunk/icedtea-web/plugin/icedteanp
Files:
2 added
2 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc

    r374 r377  
    4545#include <emx/startup.h>
    4646#include <sys/socket.h>
     47#include "OS_OS2.h"
    4748#endif
    4849
     
    6162#include "IcedTeaScriptablePluginObject.h"
    6263#include "IcedTeaNPPlugin.h"
    63 
    64 #include "OS.h"
    6564
    6665#ifdef __OS2__
     
    777776    }
    778777
     778#ifdef __OS2__
     779  void *wnd = wrap_window_handle (window->window);
     780  if (!wnd)
     781      return NPERR_GENERIC_ERROR;
     782
     783  PLUGIN_DEBUG ("ITNP_SetWindow: wrapped window handle %d (%x) in %d (%x)\n",
     784                window->window, window->window, wnd, wnd);
     785#endif
     786
    779787  if (data->window_handle)
    780788    {
    781789      // The window already exists.
    782       if (data->window_handle == window->window)
     790      if (data->window_handle == wnd)
    783791    {
    784792          // The parent window is the same as in previous calls.
     
    851859
    852860      // Store the window handle and dimensions
    853       data->window_handle = window->window;
     861      data->window_handle = wnd;
    854862      data->window_width = window->width;
    855863      data->window_height = window->height;
     
    22492257    return NPERR_NO_ERROR;
    22502258
     2259#ifdef __OS2__
     2260  // perform OS-specific initialization
     2261  if (!init_os())
     2262    {
     2263      PLUGIN_ERROR ("Failed to perform OS-specific initialization.");
     2264      return NPERR_GENERIC_ERROR;
     2265    }
     2266#endif
     2267
    22512268  // Make sure the plugin data directory exists, creating it if
    22522269  // necessary.
  • trunk/icedtea-web/plugin/icedteanp/Makefile.kmk

    r367 r377  
    1414DLLS               += npicedt
    1515npicedt_TEMPLATE    = Cxx
    16 npicedt_INCS        = $(PATH_ROOT)/extra $(PATH_MOZILLA_INCS) $(PATH_GLIB_INCS)
     16npicedt_INCS        = $(PATH_CURRENT) $(PATH_MOZILLA_INCS) $(PATH_GLIB_INCS)
     17npicedt_INCS.os2    = os2
    1718npicedt_DEFS        = MOZILLA_VERSION_COLLAPSED=$(MOZILLA_VERSION_COLLAPSED) \
    1819                      DETECT_DATA_DIR=$(DETECT_DATA_DIR) \
     
    2829                      -DPLUGIN_BOOTCLASSPATH="$(PLUGIN_BOOTCLASSPATH)"
    2930npicedt_LIBS        = $(PATH_GLIB_LIBS) pthread
     31npicedt_LIBS.os2    = kernel32.lib user32.lib
    3032npicedt_LIBPATH     = $(PATH_GLIB_LIBPATH)
     33npicedt_LIBPATH.os2 = kernel32.lib user32.lib $(SDK_ODIN_LIBPATH)
    3134
    3235npicedt_SOURCES     = \
     
    3538    IcedTeaJavaRequestProcessor.cc \
    3639    IcedTeaPluginRequestProcessor.cc \
    37     IcedTeaPluginUtils.cc \
    38     $(PATH_ROOT)/extra/OS.cc \
     40    IcedTeaPluginUtils.cc
     41
     42npicedt_SOURCES.os2 = \
     43    os2/OS_OS2.cc \
     44    os2/OS_OS2_WinOS2.cc \
    3945    $(PATH_ROOT)/plugin_os2.def
     46
     47os2/OS_OS2_WinOS2.cc_SDKS.os2 += ODIN
    4048
    4149PLUGIN_RC           = $(npicedt_0_OUTDIR)/plugin_os2.rc
  • trunk/icedtea-web/plugin/icedteanp/os2/OS_OS2.cc

    r357 r377  
    1 /* OS.cc
     1/* OS_OS2.cc
    22
    33   Copyright (C) 2009, 2010  Red Hat
     
    3737exception statement from your version. */
    3838
     39#define INCL_DOS
     40#define INCL_PM
     41#include <os2.h>
     42
    3943#include <stdlib.h>
    4044
    41 #include "OS.h"
    42 
    43 #ifdef __OS2__
     45#include "OS_OS2.h"
     46#include "OS_OS2_WinOS2.h"
    4447
    4548const char *icedtea_web_data_dir()
    4649{
    47   const char *home = getenv("ICEDTEA_WEB_DATA");
    48   if (!home)
    49     home = ICEDTEA_WEB_DATA_DIR;
    50   return home;
     50    const char *home = getenv("ICEDTEA_WEB_DATA");
     51    if (!home)
     52        home = ICEDTEA_WEB_DATA_DIR;
     53    return home;
    5154}
    5255
    5356const char *icedtea_web_jre_dir()
    5457{
    55   const char *jre = getenv("ICEDTEA_WEB_JRE");
    56   if (!jre)
    57     jre = ICEDTEA_WEB_JRE_DIR;
    58   return jre;
     58    const char *jre = getenv("ICEDTEA_WEB_JRE");
     59    if (!jre)
     60        jre = ICEDTEA_WEB_JRE_DIR;
     61    return jre;
    5962}
    6063
    61 #endif // __OS2__
     64bool init_os()
     65{
     66    return init_os_winos2();
     67}
  • trunk/icedtea-web/plugin/icedteanp/os2/OS_OS2.h

    r357 r377  
    1 /* OS.h
     1/* OS_OS2.h
    22
    33   Copyright (C) 2009, 2010  Red Hat
     
    3737exception statement from your version. */
    3838
    39 #ifndef __OS_H__
    40 #define __OS_H__
     39#ifndef __OS_OS2_H__
     40#define __OS_OS2_H__
    4141
    42 #ifdef __OS2__
    4342const char *icedtea_web_data_dir();
    4443const char *icedtea_web_jre_dir();
    45 #endif
    4644
    47 #endif // __OS_H__
     45bool init_os();
     46
     47void *wrap_window_handle (void *handle);
     48
     49#endif // __OS_OS2_H__
Note: See TracChangeset for help on using the changeset viewer.