Exemplo n.º 1
0
unsigned long _System
_DLL_InitTerm (unsigned long hModule,
               unsigned long termination)
#endif
{
    if (termination) {
        /* Unloading the DLL */
        cairo_os2_fini ();

#ifndef __WATCOMC__
        /* Uninitialize RTL of GCC */
        __ctordtorTerm ();
        _CRT_term ();
#endif
        return 1;
    } else {
        /* Loading the DLL */
#ifndef __WATCOMC__
        /* Initialize RTL of GCC */
        if (_CRT_init () != 0)
            return 0;
        __ctordtorInit ();
#endif

        cairo_os2_init ();
        return 1;
    }
}
Exemplo n.º 2
0
gfxOS2Platform::~gfxOS2Platform()
{
    gfxFontconfigUtils::Shutdown();
    sFontconfigUtils = nullptr;

    // Clean up cairo_os2 sruff.
    cairo_os2_surface_enable_dive(false, false);
    cairo_os2_fini();
}
Exemplo n.º 3
0
void CairoDrawThread(void *pParam)
{
  HWND hwndClientWindow = (HWND) pParam;
  HPS hpsClientWindow;
  SWP swpTemp;

  // Query HPS of HWND
  hpsClientWindow = WinGetPS(hwndClientWindow);
  WinQueryWindowPos(hwndClientWindow, &swpTemp);

  // Set FPU state which might have been changed by some Win* calls!
  // (Workaround for a PM bug)
  DisableFPUException();

  // Initialize cairo support
  cairo_os2_init();

  // Create cairo surface
  pCairoSurface = cairo_os2_surface_create(hpsClientWindow,
                                           swpTemp.cx,
                                           swpTemp.cy);

  // Tell the surface the HWND too, so if the application decides
  // that it wants to draw itself, then it will be able to turn
  // on blit_as_changes.
  cairo_os2_surface_set_hwnd(pCairoSurface, hwndClientWindow);

  // Make sure that the changes will be shown only
  // when we tell so
  cairo_os2_surface_set_manual_window_refresh(pCairoSurface,
                                              TRUE);


  // Create Cairo drawing handle for the surface
  pCairoHandle = cairo_create(pCairoSurface);

  // Do the main drawing loop as long as needed!
  bShutdownDrawing = 0;
  CairoDrawLoop(hwndClientWindow,
                swpTemp.cx, swpTemp.cy,
                pCairoSurface,
                pCairoHandle);

  // Clean up!
  cairo_destroy(pCairoHandle);
  cairo_surface_destroy(pCairoSurface);

  cairo_os2_fini();

  WinReleasePS(hpsClientWindow);

  _endthread();
}
Exemplo n.º 4
0
gfxOS2Platform::~gfxOS2Platform()
{
#ifdef DEBUG_thebes
    printf("gfxOS2Platform::~gfxOS2Platform()\n");
#endif
    gfxFontconfigUtils::Shutdown();
    sFontconfigUtils = nsnull;

    // clean up OS/2 cairo stuff
    cairo_os2_fini();
#ifdef DEBUG_thebes
    printf("  cairo_os2_fini() was called\n");
#endif
}
Exemplo n.º 5
0
// cairo_public void
// cairo_os2_fini (void);
static int l_cairo_os2_fini(lua_State* L)
{
    cairo_os2_fini ();
    return 0;
}