summaryrefslogtreecommitdiff
path: root/vcl/os2
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2008-10-17 08:40:10 +0000
committerOliver Bolte <obo@openoffice.org>2008-10-17 08:40:10 +0000
commit98c9f4f4f2506db7385cc3f0fa7bb1b14930a417 (patch)
treee6881eda00d35e22f6ac51732df02db300814385 /vcl/os2
parent52a7bbb9c5d88ee817b4e484696846adbc7b305e (diff)
CWS-TOOLING: integrate CWS aw057
Diffstat (limited to 'vcl/os2')
-rw-r--r--vcl/os2/inc/salinst.h3
-rw-r--r--vcl/os2/inc/salogl.h166
-rw-r--r--vcl/os2/source/app/salinst.cxx10
-rw-r--r--vcl/os2/source/gdi/makefile.mk8
-rw-r--r--vcl/os2/source/gdi/salogl.cxx234
5 files changed, 5 insertions, 416 deletions
diff --git a/vcl/os2/inc/salinst.h b/vcl/os2/inc/salinst.h
index 1183b61f15a6..83d736592a93 100644
--- a/vcl/os2/inc/salinst.h
+++ b/vcl/os2/inc/salinst.h
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: salinst.h,v $
- * $Revision: 1.7 $
+ * $Revision: 1.7.74.1 $
*
* This file is part of OpenOffice.org.
*
@@ -88,7 +88,6 @@ public:
virtual String GetDefaultPrinter();
virtual SalSound* CreateSalSound();
virtual SalTimer* CreateSalTimer();
- virtual SalOpenGL* CreateSalOpenGL( SalGraphics* pGraphics );
virtual SalI18NImeStatus* CreateI18NImeStatus();
virtual SalSystem* CreateSalSystem();
virtual SalBitmap* CreateSalBitmap();
diff --git a/vcl/os2/inc/salogl.h b/vcl/os2/inc/salogl.h
index cee1d25ebe10..e69de29bb2d1 100644
--- a/vcl/os2/inc/salogl.h
+++ b/vcl/os2/inc/salogl.h
@@ -1,166 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: salogl.h,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SV_SALOGL_H
-#define _SV_SALOGL_H
-
-#define _OPENGL_EXT
-
-#include <tools/gen.hxx>
-#include <vcl/sv.h>
-//#ifndef _SV_SALOTYPE_HXX
-//#include <salotype.hxx>
-//#endif
-#include <vcl/salogl.hxx>
-
-// ------------------
-// - OpenGL defines -
-// ------------------
-
-#define PGL_USE_GL 1
-#define PGL_BUFFER_SIZE 2
-#define PGL_LEVEL 3
-#define PGL_RGBA 4
-#define PGL_DOUBLEBUFFER 5
-#define PGL_STEREO 6
-#define PGL_AUX_BUFFERS 7
-#define PGL_RED_SIZE 8
-#define PGL_GREEN_SIZE 9
-#define PGL_BLUE_SIZE 10
-#define PGL_ALPHA_SIZE 11
-#define PGL_DEPTH_SIZE 12
-#define PGL_STENCIL_SIZE 13
-#define PGL_ACCUM_RED_SIZE 14
-#define PGL_ACCUM_GREEN_SIZE 15
-#define PGL_ACCUM_BLUE_SIZE 16
-#define PGL_ACCUM_ALPHA_SIZE 17
-#define PGL_SINGLEBUFFER 18
-
-// -----------------
-// - State defines -
-// -----------------
-
-#define OGL_STATE_UNLOADED (0x00000000)
-#define OGL_STATE_INVALID (0x00000001)
-#define OGL_STATE_VALID (0x00000002)
-
-// ----------
-// - Macros -
-// ----------
-
-#define DECL_OGLFNC( FncName ) static OGLFnc##FncName pFnc##FncName
-
-// -------------------------------
-// - Additional typedefs for init.
-// -------------------------------
-
-typedef struct visualconfig
-{
- unsigned long vid; /*Visual ID*/
- BOOL rgba;
- int redSize, greenSize, blueSize, alphaSize;
- ULONG redMask, greenMask, blueMask;
- int accumRedSize, accumGreenSize, accumBlueSize, accumAlphaSize;
- BOOL doubleBuffer;
- BOOL stereo;
- int bufferSize;
- int depthSize;
- int stencilSize;
- int auxBuffers;
- int level;
- PVOID reserved;
- struct visualconfig *next;
-}
-VISUALCONFIG, *PVISUALCONFIG;
-
-extern "C"
-{
- typedef LHANDLE HGC;
- typedef PVISUALCONFIG* ( *APIENTRY OGLFncQueryConfigs )( HAB hab, ... );
- typedef PVISUALCONFIG ( *APIENTRY OGLFncChooseConfig )( HAB hab, int *attriblist, ... );
- typedef HGC ( *APIENTRY OGLFncCreateContext )( HAB hab, PVISUALCONFIG pVisualConfig, HGC Sharelist, BOOL IsDirect, ... );
- typedef BOOL ( *APIENTRY OGLFncDestroyContext )( HAB hab, HGC hgc, ... );
- typedef HGC ( *APIENTRY OGLFncGetCurrentContext )( HAB hab, ... );
- typedef BOOL ( *APIENTRY OGLFncMakeCurrent )( HAB hab, HGC hgc, HWND hwnd, ... );
- typedef LONG ( *APIENTRY OGLFncQueryCapability)( HAB hab, ... );
-}
-
-// -------------
-// - SalOpenGL -
-// -------------
-
-class SalGraphics;
-class String;
-
-//class SalOpenGL
-class Os2SalOpenGL : public SalOpenGL
-{
-private:
-
- static HMODULE mhOGLLib;
- static HGC mhOGLContext;
- static HDC mhOGLLastDC;
- static ULONG mnOGLState;
-
-#if 0
-private:
-
- DECL_OGLFNC( QueryConfigs );
- DECL_OGLFNC( ChooseConfig );
- DECL_OGLFNC( CreateContext );
- DECL_OGLFNC( DestroyContext );
- DECL_OGLFNC( GetCurrentContext );
- DECL_OGLFNC( MakeCurrent );
- DECL_OGLFNC( QueryCapability );
-#endif
-
-private:
-
- static BOOL ImplInitLib();
- static BOOL ImplInit();
- static void ImplFreeLib();
-
-public:
-
- Os2SalOpenGL( SalGraphics* );
- virtual ~Os2SalOpenGL();
-
- virtual bool IsValid();
- virtual oglFunction GetOGLFnc( const char * );
- virtual void OGLEntry( SalGraphics* pGraphics );
- virtual void OGLExit( SalGraphics* pGraphics );
- virtual void StartScene( SalGraphics* pGraphics );
- virtual void StopScene();
-
- static void Release();
-
-};
-
-#endif // _SV_SALOGL_H
diff --git a/vcl/os2/source/app/salinst.cxx b/vcl/os2/source/app/salinst.cxx
index 4d0c5168bef3..6632daff90ef 100644
--- a/vcl/os2/source/app/salinst.cxx
+++ b/vcl/os2/source/app/salinst.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: salinst.cxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.8.74.1 $
*
* This file is part of OpenOffice.org.
*
@@ -53,7 +53,6 @@
#include <salobj.h>
#include <saltimer.h>
#include <salsound.h>
-#include <salogl.h>
#include <salbmp.h>
#include <vcl/salimestatus.hxx>
#include <vcl/timer.hxx>
@@ -829,13 +828,6 @@ SalSound* Os2SalInstance::CreateSalSound()
// -----------------------------------------------------------------------
-SalOpenGL* Os2SalInstance::CreateSalOpenGL( SalGraphics* pGraphics )
-{
- return new Os2SalOpenGL( pGraphics );
-}
-
-// -----------------------------------------------------------------------
-
SalBitmap* Os2SalInstance::CreateSalBitmap()
{
return new Os2SalBitmap();
diff --git a/vcl/os2/source/gdi/makefile.mk b/vcl/os2/source/gdi/makefile.mk
index 2efd330dd6f4..0f740490898f 100644
--- a/vcl/os2/source/gdi/makefile.mk
+++ b/vcl/os2/source/gdi/makefile.mk
@@ -8,7 +8,7 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.7 $
+# $Revision: 1.7.154.1 $
#
# This file is part of OpenOffice.org.
#
@@ -45,16 +45,14 @@ YD00_CXXFILES= salgdi.cxx \
salgdi3.cxx \
salvd.cxx \
salprn.cxx \
- salbmp.cxx \
- salogl.cxx
-
+ salbmp.cxx
+
SLOFILES= $(SLO)$/salgdi.obj \
$(SLO)$/salgdi2.obj \
$(SLO)$/salgdi3.obj \
$(SLO)$/salvd.obj \
$(SLO)$/salprn.obj \
$(SLO)$/salbmp.obj \
- $(SLO)$/salogl.obj \
$(SLO)$/os2layout.obj
# --- Targets ------------------------------------------------------
diff --git a/vcl/os2/source/gdi/salogl.cxx b/vcl/os2/source/gdi/salogl.cxx
index 351a3ccecae4..e69de29bb2d1 100644
--- a/vcl/os2/source/gdi/salogl.cxx
+++ b/vcl/os2/source/gdi/salogl.cxx
@@ -1,234 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2008 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: salogl.cxx,v $
- * $Revision: 1.5 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <malloc.h>
-#define INCL_DOSMODULEMGR
-#include <svpm.h>
-#define _SV_SALOGL_CXX
-#include <salogl.h>
-#include <salgdi.h>
-#include <saldata.hxx>
-
-// ------------
-// - Typedefs -
-// ------------
-
-typedef VISUALCONFIG* PCFG;
-
-// ------------
-// - Lib-Name -
-// ------------
-
-#define OGL_LIBNAME "OPENGL"
-
-// ----------
-// - Macros -
-// ----------
-
-#define GET_OGLFNC_PGL( FncName ) \
- nResult = DosQueryProcAddr( mhOGLLib, 0, (PSZ) "pgl" #FncName, (PFN*)&pFnc##FncName ); \
-if( nResult != 0 ) \
- bRet = FALSE;
-
-// ------------------------------------------------------------------------
-
-#define GET_OGLFNC_GL( FncName ) \
- nResult = DosQueryProcAddr( mhOGLLib, 0, "gl" #FncName, (PFN*)&pFnc##FncName ); \
-if( nResult != 0 ) \
- bRet = FALSE;
-
-// -----------------
-// - Statics init. -
-// -----------------
-
-// Members
-HMODULE Os2SalOpenGL::mhOGLLib = 0;
-HGC Os2SalOpenGL::mhOGLContext = 0;
-HDC Os2SalOpenGL::mhOGLLastDC = 0;
-ULONG Os2SalOpenGL::mnOGLState = OGL_STATE_UNLOADED;
-
-// Internal use
-#define INIT_OGLFNC( a, FncName ) static OGLFnc##FncName pFnc##FncName = NULL;
-
-INIT_OGLFNC( Os2SalOpenGL, ChooseConfig );
-INIT_OGLFNC( Os2SalOpenGL, QueryConfigs );
-INIT_OGLFNC( Os2SalOpenGL, CreateContext );
-INIT_OGLFNC( Os2SalOpenGL, DestroyContext );
-INIT_OGLFNC( Os2SalOpenGL, GetCurrentContext );
-INIT_OGLFNC( Os2SalOpenGL, MakeCurrent );
-INIT_OGLFNC( Os2SalOpenGL, QueryCapability );
-
-// -------------
-// - Os2SalOpenGL -
-// -------------
-
-Os2SalOpenGL::Os2SalOpenGL( SalGraphics* pGraphics )
-{
- // Set mhOGLLastDC only the first time a
- // Os2SalOpenGL object is created; we need
- // this DC in Os2SalOpenGL::Create();
- if( OGL_STATE_UNLOADED == mnOGLState )
- mhOGLLastDC = static_cast<Os2SalGraphics*>(pGraphics)->mhDC;
-}
-
-// ------------------------------------------------------------------------
-
-Os2SalOpenGL::~Os2SalOpenGL()
-{
-}
-
-// ------------------------------------------------------------------------
-
-bool Os2SalOpenGL::IsValid()
-{
-
- if( OGL_STATE_UNLOADED == mnOGLState )
- {
- if( ImplInitLib() )
- {
- if( ImplInit() )
- {
- HAB hAB = GetSalData()->mhAB;
- VISUALCONFIG aCfg = { PGL_RGBA, PGL_RED_SIZE, 4, PGL_GREEN_SIZE, 4,PGL_BLUE_SIZE, 4, PGL_DOUBLEBUFFER, 0 };
- PCFG* ppCfgs = pFncQueryConfigs( hAB );
-
- if( *ppCfgs )
- {
- if( ( mhOGLContext = pFncCreateContext( hAB, *ppCfgs, NULL, FALSE ) ) != 0 )
- {
- pFncMakeCurrent( hAB, mhOGLContext, WinWindowFromDC( mhOGLLastDC ) );
- mnOGLState = OGL_STATE_VALID;
- }
- }
- }
- else
- {
- ImplFreeLib();
- mnOGLState = OGL_STATE_INVALID;
- }
- }
- else
- mnOGLState = OGL_STATE_INVALID;
- }
-
- return mnOGLState == OGL_STATE_VALID ? TRUE : FALSE;
-}
-
-// ------------------------------------------------------------------------
-
-void Os2SalOpenGL::Release()
-{
- ImplFreeLib();
-}
-
-// ------------------------------------------------------------------------
-
-oglFunction Os2SalOpenGL::GetOGLFnc( const char* rFncName )
-{
- void* pRet;
-
- if( mhOGLLib )
- {
- APIRET rc;
- PFN pFunction;
-
- rc = DosQueryProcAddr( mhOGLLib, 0, (PSZ)rFncName, &pFunction );
- pRet = rc == NULL ? (void*)pFunction : NULL;
- }
- else
- pRet = NULL;
-
- return (oglFunction)pRet;
-}
-
-// ------------------------------------------------------------------------
-
-void Os2SalOpenGL::OGLEntry( SalGraphics* pSGraphics )
-{
- Os2SalGraphics* pGraphics = static_cast<Os2SalGraphics*>(pSGraphics);
- if( pGraphics->mhDC != mhOGLLastDC )
- {
- mhOGLLastDC = pGraphics->mhDC;
- pFncMakeCurrent( GetSalData()->mhAB, mhOGLContext, WinWindowFromDC( mhOGLLastDC ) );
- }
-}
-
-// ------------------------------------------------------------------------
-
-void Os2SalOpenGL::OGLExit( SalGraphics* pGraphics )
-{
-}
-
-// ------------------------------------------------------------------------
-
-void Os2SalOpenGL::StartScene( SalGraphics* pGraphics )
-{
-}
-
-// ------------------------------------------------------------------------
-
-void Os2SalOpenGL::StopScene()
-{
-}
-
-// ------------------------------------------------------------------------
-
-BOOL Os2SalOpenGL::ImplInitLib()
-{
- DosLoadModule ((PSZ)0, 0, (PSZ)OGL_LIBNAME, &mhOGLLib );
- return( mhOGLLib != NULL );
-}
-
-// ------------------------------------------------------------------------
-
-void Os2SalOpenGL::ImplFreeLib()
-{
- if( mhOGLLib )
- DosFreeModule( mhOGLLib );
-}
-
-// ------------------------------------------------------------------------
-
-BOOL Os2SalOpenGL::ImplInit()
-{
- ULONG nResult;
- BOOL bRet = TRUE;
-
- // Internal use
- GET_OGLFNC_PGL( ChooseConfig );
- GET_OGLFNC_PGL( QueryConfigs );
- GET_OGLFNC_PGL( CreateContext );
- GET_OGLFNC_PGL( DestroyContext );
- GET_OGLFNC_PGL( GetCurrentContext );
- GET_OGLFNC_PGL( MakeCurrent );
- GET_OGLFNC_PGL( QueryCapability );
-
- return bRet;
-}