mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0023712: Remove dependency on Aspect_GraphicDevice from Aspect_Window
This commit is contained in:
@@ -70,14 +70,6 @@ is
|
||||
---Purpose: Creates the X Markmap
|
||||
---Category: Classes
|
||||
|
||||
class GraphicDevice;
|
||||
---Purpose: Creates the X Device (Connexion & Visual)
|
||||
---Category: Classes
|
||||
|
||||
class IconBox;
|
||||
---Purpose: Creates the X Icon Box
|
||||
---Category: Classes
|
||||
|
||||
-------------------------
|
||||
-- Category: Enumerations
|
||||
-------------------------
|
||||
|
@@ -307,7 +307,6 @@ fields
|
||||
|
||||
friends
|
||||
|
||||
class GraphicDevice from Xw,
|
||||
class Window from Xw
|
||||
|
||||
end ColorMap;
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <Xw_ColorMap.ixx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#include <Standard_PCharacter.hxx>
|
||||
|
||||
// Routines C a declarer en extern
|
||||
//extern "C" {
|
||||
|
@@ -105,8 +105,4 @@ fields
|
||||
MyExtendedDisplay : Address from Standard;
|
||||
MyExtendedFontMap : Address from Standard;
|
||||
|
||||
friends
|
||||
|
||||
class GraphicDevice from Xw
|
||||
|
||||
end FontMap;
|
||||
|
@@ -1,307 +0,0 @@
|
||||
-- Created on: 1993-10-19
|
||||
-- Created by: Gerard GRAS
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
--
|
||||
-- The content of this file is subject to the Open CASCADE Technology Public
|
||||
-- License Version 6.5 (the "License"). You may not use the content of this file
|
||||
-- except in compliance with the License. Please obtain a copy of the License
|
||||
-- at http://www.opencascade.org and read it completely before using this file.
|
||||
--
|
||||
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
--
|
||||
-- The Original Code and all software distributed under the License is
|
||||
-- distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
-- Initial Developer hereby disclaims all such warranties, including without
|
||||
-- limitation, any warranties of merchantability, fitness for a particular
|
||||
-- purpose or non-infringement. Please see the License for the specific terms
|
||||
-- and conditions governing the rights and limitations under the License.
|
||||
|
||||
-- corrections MFA 21 Oct 94
|
||||
|
||||
class GraphicDevice from Xw inherits GraphicDevice from Aspect
|
||||
|
||||
---Purpose: This class defines an X11 Graphic Device
|
||||
-- Warning: An Graphic Device is defined by :
|
||||
-- - a connection "host:server.screen"
|
||||
-- - a colormap mapping of type Xw_TOM_xxxxx
|
||||
-- - a "UseDefault" flag which permits the use of the
|
||||
-- DefaultColormap if possible.
|
||||
-- The connection can be specified directly
|
||||
-- or extracted from an existing Window.
|
||||
-- All Xw_Windows may share the same Graphic Device if
|
||||
-- you don't want to have any side effects on the stations
|
||||
-- which have only one hardware pseudo-colormap .
|
||||
-- Four kind of mapping are possible :
|
||||
-- 1) Xw_TOM_SIMPLERAMP
|
||||
-- Allocates the number of required colors in the
|
||||
-- colormap.
|
||||
-- The number of user colors depends directly on
|
||||
-- the hardware colormap size if UseDefault is False,
|
||||
-- or on the remainding free colors in the hardware colormap
|
||||
-- if UseDefault is True.
|
||||
-- 2) Xw_TOM_BESTRAMP
|
||||
-- Allocates the number of required colors in the
|
||||
-- colormap but leaves the Odd color indexes free
|
||||
-- if possible for highlight color management.
|
||||
-- (plane 0 is reserved for this usage)
|
||||
-- The number of user colors depends directly on
|
||||
-- the hardware colormap size if UseDefault is False,
|
||||
-- or on the remainding free colors in the hardware colormap
|
||||
-- if UseDefault is True.
|
||||
-- 3) Xw_TOM_COLORCUBE (the default)
|
||||
-- Allocates the maximum available colors in the colormap
|
||||
-- and builds a colorcube at this place.
|
||||
-- Any user color will be approximate and will be chosen as
|
||||
-- the nearest of the set of available colorcube colors.
|
||||
-- In this case the number of user colors can be unlimited.
|
||||
-- 4) Xw_TOM_HARDWARE
|
||||
-- May do serious damage to the color system.
|
||||
-- Must be used for maintenance only.
|
||||
-- 5) Xw_TOM_READONLY
|
||||
-- Allocates the number of required read only colors in the
|
||||
-- default colormap.
|
||||
-- The number of user colors depends directly on
|
||||
-- the hardware colormap size.
|
||||
|
||||
---References:
|
||||
|
||||
uses
|
||||
|
||||
AsciiString from TCollection,
|
||||
Length from Quantity,
|
||||
GraphicDriver from Aspect,
|
||||
ColorMap from Xw,
|
||||
TypeMap from Xw,
|
||||
WidthMap from Xw,
|
||||
FontMap from Xw,
|
||||
MarkMap from Xw,
|
||||
TypeOfVisual from Xw,
|
||||
TypeOfMapping from Xw,
|
||||
Handle from Aspect
|
||||
|
||||
raises
|
||||
|
||||
GraphicDeviceDefinitionError from Aspect,
|
||||
BadAccess from Aspect
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns mutable GraphicDevice from Xw is protected ;
|
||||
|
||||
Create (Connection : CString from Standard ;
|
||||
Mapping : TypeOfMapping from Xw = Xw_TOM_COLORCUBE ;
|
||||
Ncolors : Integer from Standard = 0 ;
|
||||
UseDefault : Boolean from Standard = Standard_True )
|
||||
returns mutable GraphicDevice from Xw
|
||||
---Level: Public
|
||||
---Purpose: Create an Graphic Device on the specified Connection
|
||||
-- by using ALL screen defaults if possible
|
||||
-- (i.e:Default Colormap)
|
||||
-- Warning: Raises if the Device is Badly defined
|
||||
raises GraphicDeviceDefinitionError from Aspect ;
|
||||
|
||||
---------------------------------------------------
|
||||
-- Category: methods to modify the class definition
|
||||
---------------------------------------------------
|
||||
|
||||
Destroy ( me : mutable )
|
||||
---Level: Public
|
||||
---Purpose: Destroies all ressources attached to the GraphicDevice
|
||||
-- (Windows, Colormaps, ....)
|
||||
-- Warning: Raises if the Device is Badly defined
|
||||
raises BadAccess from Aspect is virtual;
|
||||
---C++: alias ~
|
||||
---Category: methods to modify the class definition
|
||||
|
||||
InitMaps ( me : mutable ; Connection : CString from Standard ;
|
||||
Mapping : TypeOfMapping from Xw ;
|
||||
Ncolors : Integer from Standard ;
|
||||
UseDefault: Boolean from Standard )
|
||||
---Level: Public
|
||||
---Purpose: Initializes all ressources attached to the GraphicDevice
|
||||
-- Category: methods to modify the class definition
|
||||
-- Warning: Raises if the Device is Badly defined
|
||||
raises GraphicDeviceDefinitionError from Aspect
|
||||
is static protected ;
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
ColorMap2D ( me )
|
||||
returns ColorMap from Xw is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the 2D oriented Device color map.
|
||||
---Category: Inquire methods
|
||||
|
||||
VisualClass2D ( me )
|
||||
returns TypeOfVisual from Xw is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the 2D oriented Visual Class.
|
||||
---Category: Inquire methods
|
||||
|
||||
OverlayVisualClass2D ( me )
|
||||
returns TypeOfVisual from Xw is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the 2D oriented overlay Visual Class.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedColorMap2D ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns extended data colormap 2D structure pointer.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedOverlayColorMap2D ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns extended data overlay colormap 2D structure pointer.
|
||||
---Category: Inquire methods
|
||||
|
||||
ColorMap3D ( me )
|
||||
returns ColorMap from Xw is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the 3D oriented Device color map.
|
||||
---Category: Inquire methods
|
||||
|
||||
VisualClass3D ( me )
|
||||
returns TypeOfVisual from Xw is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the 3D oriented Visual Class.
|
||||
---Category: Inquire methods
|
||||
|
||||
OverlayVisualClass3D ( me )
|
||||
returns TypeOfVisual from Xw is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the 3D oriented overlay Visual Class.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedColorMap3D ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns extended data colormap 3D structure pointer.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedOverlayColorMap3D ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns extended data overlay colormap 3D structure pointer.
|
||||
---Category: Inquire methods
|
||||
|
||||
TypeMap ( me )
|
||||
returns TypeMap from Xw is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the Device Type map.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedTypeMap ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns extended data typemap structure pointer.
|
||||
---Category: Inquire methods
|
||||
|
||||
WidthMap ( me )
|
||||
returns WidthMap from Xw is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the Device Width map.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedWidthMap ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns extended data widthmap structure pointer.
|
||||
---Category: Inquire methods
|
||||
|
||||
FontMap ( me )
|
||||
returns FontMap from Xw is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the Device Font map.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedFontMap ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns extended data fontmap structure pointer.
|
||||
---Category: Inquire methods
|
||||
|
||||
MarkMap ( me )
|
||||
returns MarkMap from Xw is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the Device Mark map.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedMarkMap ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns extended data markmap structure pointer.
|
||||
---Category: Inquire methods
|
||||
|
||||
Display ( me )
|
||||
returns CString from Standard is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the Device connection string.
|
||||
---Category: Inquire methods
|
||||
|
||||
XDisplay ( me )
|
||||
returns Address from Standard is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the Device Display Address.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedDisplay ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns extended data display structure pointer.
|
||||
---Category: Inquire methods
|
||||
|
||||
DisplaySize ( me ; Width, Height : out Integer from Standard )
|
||||
---Level: Public
|
||||
---Purpose: Returns the Display size in PIXEL
|
||||
-- Warning: Raises if the connection is not defined properly
|
||||
raises BadAccess from Aspect is static;
|
||||
|
||||
DisplaySize ( me ; Width, Height : out Length from Quantity )
|
||||
---Level: Public
|
||||
---Purpose: Returns the Display size in METER
|
||||
-- Warning: Raises if the connection is not defined properly
|
||||
raises BadAccess from Aspect is static;
|
||||
|
||||
PlaneLayer ( me ; aVisualID : Integer from Standard )
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns the plane layer ID from a visual ID
|
||||
-- Warning: Raises if the connection is not defined properly
|
||||
raises BadAccess from Aspect is static;
|
||||
|
||||
GraphicDriver ( me )
|
||||
returns GraphicDriver from Aspect
|
||||
is redefined;
|
||||
|
||||
fields
|
||||
|
||||
MyDisplay : AsciiString from TCollection ;
|
||||
MyColorMap2D : ColorMap from Xw ;
|
||||
MyColorMap3D : ColorMap from Xw ;
|
||||
MyTypeMap : TypeMap from Xw ;
|
||||
MyWidthMap : WidthMap from Xw ;
|
||||
MyFontMap : FontMap from Xw ;
|
||||
MyMarkMap : MarkMap from Xw ;
|
||||
MyExtendedDisplay : Address from Standard is protected ;
|
||||
|
||||
friends
|
||||
|
||||
class Window from Xw
|
||||
|
||||
end GraphicDevice from Xw ;
|
@@ -1,300 +0,0 @@
|
||||
// Created on: 1993-10-14
|
||||
// Created by: GG
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer hereby disclaims all such warranties, including without
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
#define GG001 //GG_300197
|
||||
// Preferer utiliser le visual de la root window en mode
|
||||
// 2D plutot que de prendre un visual PseudoColor alors que la root
|
||||
// est TrueColor.
|
||||
// Ceci corrige notamment les pb de colormap non intallees sur DEC
|
||||
// lorsque la station est bootee en TrueColor.
|
||||
|
||||
|
||||
|
||||
//-Version
|
||||
|
||||
//-Design Creation d'une unite graphique
|
||||
|
||||
//-Warning
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <stdio.h>
|
||||
#include <Xw.hxx>
|
||||
#include <Xw_GraphicDevice.ixx>
|
||||
|
||||
// Routines C a declarer en extern
|
||||
//extern "C" {
|
||||
#include <Xw_Cextern.hxx>
|
||||
//}
|
||||
|
||||
//-Static data definitions
|
||||
|
||||
//static char *ErrorMessag,LocalMessag[80] ;
|
||||
static char LocalMessag[80] ;
|
||||
//static int ErrorNumber ;
|
||||
//static int ErrorGravity ;
|
||||
static XW_STATUS status ;
|
||||
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
//-Constructors
|
||||
|
||||
Xw_GraphicDevice::Xw_GraphicDevice () : Aspect_GraphicDevice() {
|
||||
MyExtendedDisplay = NULL;
|
||||
}
|
||||
|
||||
Xw_GraphicDevice::Xw_GraphicDevice (const Standard_CString Connexion, const Xw_TypeOfMapping Mapping, const Standard_Integer Ncolors, const Standard_Boolean UseDefault) : Aspect_GraphicDevice() {
|
||||
|
||||
InitMaps(Connexion,Mapping,Ncolors,UseDefault) ;
|
||||
}
|
||||
|
||||
void Xw_GraphicDevice::Destroy () {
|
||||
|
||||
if( MyColorMap2D != MyColorMap3D ) {
|
||||
MyColorMap3D.Nullify();
|
||||
MyColorMap2D.Nullify();
|
||||
} else {
|
||||
MyColorMap2D.Nullify();
|
||||
}
|
||||
MyTypeMap.Nullify();
|
||||
MyWidthMap.Nullify();
|
||||
MyFontMap.Nullify();
|
||||
MyMarkMap.Nullify();
|
||||
|
||||
if( MyExtendedDisplay ) {
|
||||
status = Xw_close_display(MyExtendedDisplay) ;
|
||||
|
||||
MyExtendedDisplay = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void Xw_GraphicDevice::InitMaps (const Standard_CString Connexion,const Xw_TypeOfMapping Mapping,const Standard_Integer Ncolors,const Standard_Boolean UseDefault) {
|
||||
#ifdef GG001
|
||||
Xw_TypeOfVisual v2d = Xw_TOV_DEFAULT ;
|
||||
#else
|
||||
Xw_TypeOfVisual v2d = Xw_TOV_PREFERRED_PSEUDOCOLOR ;
|
||||
#endif
|
||||
Xw_TypeOfVisual v3d = Xw_TOV_PREFERRED_TRUECOLOR ;
|
||||
|
||||
Xw_set_trace(Xw::TraceLevel(),Xw::ErrorLevel()) ;
|
||||
|
||||
if( Connexion ) {
|
||||
MyDisplay = TCollection_AsciiString(Connexion) ;
|
||||
} else {
|
||||
MyDisplay = TCollection_AsciiString("") ;
|
||||
}
|
||||
|
||||
MyExtendedDisplay = Xw_open_display((Standard_PCharacter)MyDisplay.ToCString()) ;
|
||||
|
||||
if( !MyExtendedDisplay ) {
|
||||
sprintf(LocalMessag,"Cannot connect to server '%s'",
|
||||
MyDisplay.ToCString());
|
||||
Aspect_GraphicDeviceDefinitionError::Raise (LocalMessag);
|
||||
}
|
||||
|
||||
v2d = Xw_get_display_visual(MyExtendedDisplay,v2d) ;
|
||||
MyColorMap2D = new Xw_ColorMap(MyDisplay.ToCString(),
|
||||
v2d,Mapping,Ncolors,UseDefault) ;
|
||||
|
||||
v3d = Xw_get_display_visual(MyExtendedDisplay,v3d) ;
|
||||
if( v2d != v3d ) {
|
||||
MyColorMap3D = new Xw_ColorMap(MyDisplay.ToCString(),
|
||||
v3d,Mapping,Ncolors,UseDefault) ;
|
||||
} else {
|
||||
MyColorMap3D = MyColorMap2D ;
|
||||
}
|
||||
|
||||
MyTypeMap = new Xw_TypeMap(MyDisplay.ToCString()) ;
|
||||
MyWidthMap = new Xw_WidthMap(MyDisplay.ToCString()) ;
|
||||
MyFontMap = new Xw_FontMap(MyDisplay.ToCString()) ;
|
||||
MyMarkMap = new Xw_MarkMap(MyDisplay.ToCString()) ;
|
||||
|
||||
Standard_Address Bof;
|
||||
Bof = ExtendedColorMap2D();
|
||||
Bof = ExtendedColorMap3D();
|
||||
Bof = ExtendedTypeMap();
|
||||
Bof = ExtendedWidthMap();
|
||||
Bof = ExtendedFontMap();
|
||||
Bof = ExtendedMarkMap();
|
||||
|
||||
if( !ExtendedColorMap2D() ||
|
||||
!ExtendedColorMap3D() ||
|
||||
!ExtendedTypeMap() ||
|
||||
!ExtendedWidthMap() ||
|
||||
!ExtendedFontMap() ||
|
||||
!ExtendedMarkMap() ) {
|
||||
sprintf(LocalMessag,"Bad Graphic Device Attributs on '%s'",
|
||||
Connexion);
|
||||
Aspect_GraphicDeviceDefinitionError::Raise (LocalMessag);
|
||||
}
|
||||
}
|
||||
|
||||
Handle(Xw_ColorMap) Xw_GraphicDevice::ColorMap2D () const {
|
||||
|
||||
return (MyColorMap2D) ;
|
||||
|
||||
}
|
||||
|
||||
Xw_TypeOfVisual Xw_GraphicDevice::VisualClass2D () const {
|
||||
|
||||
return (MyColorMap2D->VisualClass()) ;
|
||||
}
|
||||
|
||||
Xw_TypeOfVisual Xw_GraphicDevice::OverlayVisualClass2D () const {
|
||||
|
||||
return (MyColorMap2D->OverlayVisualClass()) ;
|
||||
}
|
||||
|
||||
Standard_Address Xw_GraphicDevice::ExtendedColorMap2D () const {
|
||||
|
||||
return (MyColorMap2D->ExtendedColorMap());
|
||||
}
|
||||
|
||||
Standard_Address Xw_GraphicDevice::ExtendedOverlayColorMap2D () const {
|
||||
|
||||
return (MyColorMap2D->ExtendedOverlayColorMap());
|
||||
}
|
||||
|
||||
Handle(Xw_ColorMap) Xw_GraphicDevice::ColorMap3D () const {
|
||||
|
||||
return (MyColorMap3D) ;
|
||||
}
|
||||
|
||||
Xw_TypeOfVisual Xw_GraphicDevice::VisualClass3D () const {
|
||||
|
||||
return (MyColorMap3D->VisualClass()) ;
|
||||
}
|
||||
|
||||
Xw_TypeOfVisual Xw_GraphicDevice::OverlayVisualClass3D () const {
|
||||
|
||||
return (MyColorMap3D->OverlayVisualClass()) ;
|
||||
}
|
||||
|
||||
Standard_Address Xw_GraphicDevice::ExtendedColorMap3D () const {
|
||||
|
||||
return (MyColorMap3D->ExtendedColorMap());
|
||||
}
|
||||
|
||||
Standard_Address Xw_GraphicDevice::ExtendedOverlayColorMap3D () const {
|
||||
|
||||
return (MyColorMap3D->ExtendedOverlayColorMap());
|
||||
}
|
||||
|
||||
Handle(Xw_TypeMap) Xw_GraphicDevice::TypeMap () const {
|
||||
|
||||
return (MyTypeMap) ;
|
||||
}
|
||||
|
||||
Standard_Address Xw_GraphicDevice::ExtendedTypeMap () const {
|
||||
|
||||
return (MyTypeMap->ExtendedTypeMap());
|
||||
}
|
||||
|
||||
Handle(Xw_WidthMap) Xw_GraphicDevice::WidthMap () const {
|
||||
|
||||
return (MyWidthMap) ;
|
||||
}
|
||||
|
||||
Standard_Address Xw_GraphicDevice::ExtendedWidthMap () const {
|
||||
|
||||
return (MyWidthMap->ExtendedWidthMap());
|
||||
}
|
||||
|
||||
Handle(Xw_FontMap) Xw_GraphicDevice::FontMap () const {
|
||||
|
||||
return (MyFontMap) ;
|
||||
}
|
||||
|
||||
Standard_Address Xw_GraphicDevice::ExtendedFontMap () const {
|
||||
|
||||
return (MyFontMap->ExtendedFontMap());
|
||||
}
|
||||
|
||||
Handle(Xw_MarkMap) Xw_GraphicDevice::MarkMap () const {
|
||||
|
||||
return (MyMarkMap) ;
|
||||
}
|
||||
|
||||
Standard_Address Xw_GraphicDevice::ExtendedMarkMap () const {
|
||||
|
||||
return (MyMarkMap->ExtendedMarkMap());
|
||||
}
|
||||
|
||||
Standard_CString Xw_GraphicDevice::Display () const {
|
||||
|
||||
return (MyDisplay.ToCString());
|
||||
}
|
||||
|
||||
Standard_Address Xw_GraphicDevice::XDisplay () const {
|
||||
Aspect_Handle *display ;
|
||||
Aspect_Handle root,colormap ;
|
||||
Xw_TypeOfVisual pclass ;
|
||||
int depth ;
|
||||
|
||||
status = Xw_get_display_info(MyExtendedDisplay,&display,
|
||||
&root,&colormap,&pclass,&depth) ;
|
||||
|
||||
return (display);
|
||||
}
|
||||
|
||||
Standard_Address Xw_GraphicDevice::ExtendedDisplay () const {
|
||||
|
||||
return (MyExtendedDisplay);
|
||||
}
|
||||
|
||||
void Xw_GraphicDevice::DisplaySize (Standard_Integer &Width,Standard_Integer &Height) const {
|
||||
int width,height ;
|
||||
|
||||
status = Xw_get_screen_size(MyExtendedDisplay,&width,&height) ;
|
||||
|
||||
Width = width ;
|
||||
Height = height ;
|
||||
}
|
||||
|
||||
void Xw_GraphicDevice::DisplaySize (Quantity_Length &Width,Quantity_Length &Height) const {
|
||||
float width,height ;
|
||||
|
||||
status = Xw_get_mmscreen_size(MyExtendedDisplay,&width,&height) ;
|
||||
|
||||
Width = FROMMILLIMETER(width) ;
|
||||
Height = FROMMILLIMETER(height) ;
|
||||
}
|
||||
|
||||
Standard_Integer Xw_GraphicDevice::PlaneLayer (const Standard_Integer aVisualID) const {
|
||||
|
||||
return Xw_get_plane_layer(MyExtendedDisplay,aVisualID);
|
||||
}
|
||||
|
||||
Handle(Aspect_GraphicDriver) Xw_GraphicDevice::GraphicDriver () const {
|
||||
|
||||
static Handle(Aspect_GraphicDriver) foo;
|
||||
|
||||
cout << "Xw_GraphicDevice::GraphicDriver returns foo\n" << flush;
|
||||
|
||||
return foo;
|
||||
|
||||
}
|
@@ -1,160 +0,0 @@
|
||||
-- Created by: GG
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
--
|
||||
-- The content of this file is subject to the Open CASCADE Technology Public
|
||||
-- License Version 6.5 (the "License"). You may not use the content of this file
|
||||
-- except in compliance with the License. Please obtain a copy of the License
|
||||
-- at http://www.opencascade.org and read it completely before using this file.
|
||||
--
|
||||
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
--
|
||||
-- The Original Code and all software distributed under the License is
|
||||
-- distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
-- Initial Developer hereby disclaims all such warranties, including without
|
||||
-- limitation, any warranties of merchantability, fitness for a particular
|
||||
-- purpose or non-infringement. Please see the License for the specific terms
|
||||
-- and conditions governing the rights and limitations under the License.
|
||||
|
||||
|
||||
class IconBox from Xw inherits Window from Xw
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: This class defines a X11 IconBox
|
||||
-- Warning: The IconBox is not visible at the creation time .
|
||||
-- To show the Icon Box use the method Show () .
|
||||
-- In this case the Icon Box appears at the DSU position
|
||||
-- specified given in [0,1] space .
|
||||
-- The size of the Icon Box grows depending of the number
|
||||
-- of the Icons loaded inside .
|
||||
|
||||
---References:
|
||||
|
||||
uses
|
||||
|
||||
NameOfColor from Quantity,
|
||||
GraphicDevice from Xw,
|
||||
TypeOfVisual from Xw,
|
||||
Handle from Aspect,
|
||||
WindowQuality from Xw
|
||||
|
||||
raises
|
||||
|
||||
WindowDefinitionError from Aspect,
|
||||
WindowError from Aspect
|
||||
|
||||
is
|
||||
|
||||
Create ( Device : GraphicDevice from Xw ;
|
||||
Name : CString from Standard ;
|
||||
Xc : Real from Standard = 0.5 ;
|
||||
Yc : Real from Standard = 0.5 ;
|
||||
BackColor : NameOfColor from Quantity = Quantity_NOC_MATRAGRAY;
|
||||
aQuality : WindowQuality from Xw = Xw_WQ_SAMEQUALITY)
|
||||
returns mutable IconBox from Xw
|
||||
---Level: Public
|
||||
---Purpose: Creates a IconBox n Preferred PseudoColor Visual
|
||||
-- defined by his Center in DSU and connects it to the
|
||||
-- X server at the first call depending of the GraphicDevice
|
||||
-- connexion .
|
||||
-- ALL Icons are loaded from the Icon File Directory Name :
|
||||
-- "[$SYMBOL]xxxxxxx[.ifd]"
|
||||
-- Warning: Raises if the Position is out of the Screen Space
|
||||
-- or the Icon File Directory Name don't exist
|
||||
raises WindowDefinitionError from Aspect ;
|
||||
|
||||
---------------------------------------------------
|
||||
-- Category: Methods to modify the class definition
|
||||
---------------------------------------------------
|
||||
|
||||
LoadIcons ( me : mutable ; Name : CString from Standard )
|
||||
returns Integer from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Loads Icon Box from an Other Icon File Directory Name
|
||||
-- and returns the loaded icons number.
|
||||
-- Warning: The Icons previously loaded are NOT cleared .
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
Show ( me ) is static;
|
||||
---Level: Public
|
||||
---Purpose: Shows Icon Box to the screen
|
||||
-- Warning: The Icon Box is displayed at the centered position
|
||||
-- specified at the creation time and the size depend
|
||||
-- of the Icon number really loaded inside .
|
||||
|
||||
UnloadIcons ( me : mutable ; Name : CString from Standard )
|
||||
returns Integer from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Unloads All previously loaded Icons in the IconBox
|
||||
-- and returns the unloaded icons number.
|
||||
---Category: methods to modify the class definition
|
||||
|
||||
Destroy ( me : mutable) is redefined ;
|
||||
---Level: Public
|
||||
---Purpose: Destroies the IconBox
|
||||
---C++: alias ~
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
AddIcon ( me : mutable ; W : Window from Xw ;
|
||||
Name : CString from Standard;
|
||||
aWidth : Integer from Standard = 0;
|
||||
aHeight : Integer from Standard = 0) is static;
|
||||
---Level: Public
|
||||
---Purpose: Adds an Icon of Size aWidth,aHeight given in PIXEL
|
||||
-- to the Icon Box from a FULL Existing Window
|
||||
-- NOTE that if aWidth or aHeight is 0 the default icon size is taken.
|
||||
---Category: methods to modify the class definition
|
||||
|
||||
SaveIcons ( me ) returns Integer from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Saves all new created Icons as iconname.xwd file in the user
|
||||
-- directory and returns the saved icons number.
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
IconNumber ( me )
|
||||
returns Integer from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Number of Icons loaded in the Icon Box .
|
||||
|
||||
IconName ( me ; Index : Integer from Standard )
|
||||
returns CString from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns the Name of the N ime Icon
|
||||
-- Warning: Raises if Index if out of range depending of the
|
||||
-- Number of Loaded Icons .
|
||||
raises WindowError from Aspect is static;
|
||||
|
||||
IconSize ( me ; Name : CString from Standard ;
|
||||
Width, Height : out Integer from Standard )
|
||||
returns Boolean from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Pixmap Size attached to the Icon Name
|
||||
-- Warning: May return FALSE if Icon doesn't exist in the IconBox .
|
||||
---Category: Inquire methods
|
||||
|
||||
IconPixmap ( me ; Name : CString from Standard )
|
||||
returns Handle from Aspect is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Pixmap attached to the Icon Name
|
||||
-- Warning: May return 0 if Icon doesn't exist in the IconBox .
|
||||
---Category: Inquire methods
|
||||
|
||||
IconPixmap ( me ; Name : CString from Standard ;
|
||||
Width, Height : Integer from Standard )
|
||||
returns Handle from Aspect is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Centered part of the Pixmap of required Size
|
||||
-- attached to the Icon Name
|
||||
-- Warning: May return 0 if Icon doesn't exist in the IconBox .
|
||||
---Category: Inquire methods
|
||||
|
||||
fields
|
||||
|
||||
MyNumberOfIcons : Integer from Standard ;
|
||||
|
||||
end IconBox ;
|
@@ -1,174 +0,0 @@
|
||||
// Created by: GG
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
||||
//
|
||||
// The content of this file is subject to the Open CASCADE Technology Public
|
||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||
// except in compliance with the License. Please obtain a copy of the License
|
||||
// at http://www.opencascade.org and read it completely before using this file.
|
||||
//
|
||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||
//
|
||||
// The Original Code and all software distributed under the License is
|
||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||
// Initial Developer hereby disclaims all such warranties, including without
|
||||
// limitation, any warranties of merchantability, fitness for a particular
|
||||
// purpose or non-infringement. Please see the License for the specific terms
|
||||
// and conditions governing the rights and limitations under the License.
|
||||
|
||||
#define PURIFY //GG_180297
|
||||
// Liberation memoire allouee par les icones.
|
||||
|
||||
|
||||
|
||||
//-Version
|
||||
|
||||
//-Design Creation d'une Icon Box
|
||||
|
||||
//-Warning
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <Xw_IconBox.ixx>
|
||||
|
||||
// Routines C a declarer en extern
|
||||
//extern "C" {
|
||||
#include <Xw_Cextern.hxx>
|
||||
//}
|
||||
|
||||
//-Static data definitions
|
||||
|
||||
static XW_STATUS status ;
|
||||
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
//-Constructors
|
||||
|
||||
Xw_IconBox::Xw_IconBox (const Handle(Xw_GraphicDevice)& Device, const Standard_CString Name, const Standard_Real Xc, const Standard_Real Yc, const Quantity_NameOfColor BackColor,const Xw_WindowQuality aQuality) :
|
||||
Xw_Window(Device,Name,Xc,Yc,0.1,0.1,aQuality,BackColor,0) {
|
||||
|
||||
MyNumberOfIcons = Xw_load_icons(MyExtendedWindow,(Standard_PCharacter)Name) ;
|
||||
|
||||
if( !MyNumberOfIcons ) {
|
||||
PrintError() ;
|
||||
}
|
||||
}
|
||||
|
||||
void Xw_IconBox::Destroy () {
|
||||
|
||||
MyNumberOfIcons = 0 ;
|
||||
#ifdef PURIFY
|
||||
if( MyExtendedWindow ) Xw_clear_icons(MyExtendedWindow,NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
Standard_Integer Xw_IconBox::UnloadIcons ( const Standard_CString Name) {
|
||||
Standard_Integer nicons = 0;
|
||||
|
||||
nicons = Xw_clear_icons (MyExtendedWindow,(Standard_PCharacter)Name);
|
||||
|
||||
if( !nicons ) Xw_print_error() ;
|
||||
|
||||
MyNumberOfIcons -= nicons ;
|
||||
|
||||
return nicons;
|
||||
}
|
||||
|
||||
void Xw_IconBox::Show () const {
|
||||
|
||||
status = Xw_show_icons (MyExtendedWindow);
|
||||
|
||||
if( !status ) Xw_print_error() ;
|
||||
}
|
||||
|
||||
Standard_Integer Xw_IconBox::LoadIcons ( const Standard_CString Name ) {
|
||||
int nicons ;
|
||||
|
||||
nicons = Xw_load_icons(MyExtendedWindow,(Standard_PCharacter)Name) ;
|
||||
|
||||
if( nicons > 0 ) MyNumberOfIcons += nicons ;
|
||||
else Xw_print_error() ;
|
||||
|
||||
return nicons;
|
||||
}
|
||||
|
||||
void Xw_IconBox::AddIcon ( const Handle(Xw_Window)& W,const Standard_CString Name,
|
||||
const Standard_Integer aWidth,const Standard_Integer aHeight ) {
|
||||
status = Xw_put_window_icon(MyExtendedWindow,W->ExtendedWindow(),
|
||||
(Standard_PCharacter)Name,aWidth,aHeight) ;
|
||||
|
||||
if( status ) MyNumberOfIcons++ ;
|
||||
else Xw_print_error() ;
|
||||
}
|
||||
|
||||
Standard_Integer Xw_IconBox::SaveIcons () const {
|
||||
Standard_Integer nicons = 0;
|
||||
|
||||
nicons = Xw_save_icons(MyExtendedWindow) ;
|
||||
|
||||
return nicons;
|
||||
}
|
||||
|
||||
Standard_Integer Xw_IconBox::IconNumber () const {
|
||||
|
||||
return (MyNumberOfIcons);
|
||||
}
|
||||
|
||||
Standard_CString Xw_IconBox::IconName ( const Standard_Integer Index) const {
|
||||
char *Name = NULL ;
|
||||
|
||||
if( Index < 0 || Index > MyNumberOfIcons ) {
|
||||
PrintError() ;
|
||||
}
|
||||
|
||||
Name = Xw_get_icon_name(MyExtendedWindow,(int)Index) ;
|
||||
|
||||
if( !Name ) Xw_print_error() ;
|
||||
|
||||
return (Name);
|
||||
}
|
||||
|
||||
Standard_Boolean Xw_IconBox::IconSize ( const Standard_CString Name, Standard_Integer& Width, Standard_Integer& Height ) const {
|
||||
int width,height ;
|
||||
|
||||
status = Xw_get_icon_size( MyExtendedWindow,(Standard_PCharacter)Name,&width,&height) ;
|
||||
|
||||
if( status ) {
|
||||
Width = width ;
|
||||
Height = height ;
|
||||
} else {
|
||||
Xw_print_error() ;
|
||||
}
|
||||
|
||||
return Standard_Boolean(status);
|
||||
}
|
||||
|
||||
Aspect_Handle Xw_IconBox::IconPixmap ( const Standard_CString Name ) const {
|
||||
Aspect_Handle pixmap = 0 ;
|
||||
|
||||
pixmap = Xw_get_icon_pixmap( MyExtendedWindow,0,0,(Standard_PCharacter)Name) ;
|
||||
|
||||
if( !pixmap ) Xw_print_error() ;
|
||||
|
||||
return (pixmap);
|
||||
}
|
||||
|
||||
Aspect_Handle Xw_IconBox::IconPixmap ( const Standard_CString Name, const Standard_Integer Width,const Standard_Integer Height ) const {
|
||||
Aspect_Handle pixmap = 0 ;
|
||||
|
||||
pixmap = Xw_get_icon_pixmap( MyExtendedWindow,
|
||||
(int)Width,(int)Height,
|
||||
(Standard_PCharacter)Name) ;
|
||||
|
||||
if( !pixmap ) Xw_print_error() ;
|
||||
|
||||
return (pixmap);
|
||||
}
|
@@ -106,8 +106,4 @@ fields
|
||||
MyExtendedDisplay : Address from Standard ;
|
||||
MyExtendedMarkMap : Address from Standard ;
|
||||
|
||||
friends
|
||||
|
||||
class GraphicDevice from Xw
|
||||
|
||||
end MarkMap ;
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include <Aspect_TypeOfMarker.hxx>
|
||||
#include <Aspect_MarkerStyle.hxx>
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#include <Standard_PCharacter.hxx>
|
||||
#include <TShort_Array1OfShortReal.hxx>
|
||||
#include <TColStd_Array1OfBoolean.hxx>
|
||||
|
||||
|
@@ -106,8 +106,4 @@ fields
|
||||
MyExtendedDisplay : Address from Standard ;
|
||||
MyExtendedTypeMap : Address from Standard ;
|
||||
|
||||
friends
|
||||
|
||||
class GraphicDevice from Xw
|
||||
|
||||
end TypeMap ;
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <Aspect_LineStyle.hxx>
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#include <Standard_PCharacter.hxx>
|
||||
#include <TShort_Array1OfShortReal.hxx>
|
||||
#include <TColQuantity_Array1OfLength.hxx>
|
||||
|
||||
|
@@ -104,8 +104,4 @@ fields
|
||||
MyExtendedDisplay : Address from Standard ;
|
||||
MyExtendedWidthMap : Address from Standard ;
|
||||
|
||||
friends
|
||||
|
||||
class GraphicDevice from Xw
|
||||
|
||||
end WidthMap ;
|
||||
|
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <Xw_WidthMap.ixx>
|
||||
#include <Aspect_WidthOfLine.hxx>
|
||||
#include <Standard_PCharacter.hxx>
|
||||
|
||||
// Routines C a declarer en extern
|
||||
//extern "C" {
|
||||
|
@@ -18,50 +18,30 @@
|
||||
-- purpose or non-infringement. Please see the License for the specific terms
|
||||
-- and conditions governing the rights and limitations under the License.
|
||||
|
||||
-- Modified : GG 28/01/00 G004
|
||||
-- Add gamma correction computation just before dumping an image.
|
||||
-- GG 07/03/00 G004 Add MMSize() method
|
||||
-- TCL 26/10/00 G002 SetBackground(aName: CString) method
|
||||
-- SAV 24/11/01 SetBackground(Quantity_Color)
|
||||
-- GG - RIC120302 Add NEW XParentWindow methods.
|
||||
|
||||
class Window from Xw
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: This class defines a X11 window
|
||||
-- Warning: The position and size for the creation of the window
|
||||
-- are defined in Device Screen Unit (DSU)
|
||||
-- floating [0,1] space.
|
||||
|
||||
---References:
|
||||
|
||||
inherits
|
||||
|
||||
Window from Aspect
|
||||
|
||||
uses
|
||||
|
||||
AsciiString from TCollection,
|
||||
Background from Aspect,
|
||||
GradientBackground from Aspect,
|
||||
TypeOfResize from Aspect,
|
||||
Handle from Aspect,
|
||||
FillMethod from Aspect,
|
||||
GradientFillMethod from Aspect,
|
||||
PixMap from Image,
|
||||
NameOfColor from Quantity,
|
||||
Parameter from Quantity,
|
||||
Ratio from Quantity,
|
||||
Color from Quantity,
|
||||
ColorMap from Xw,
|
||||
TypeMap from Xw,
|
||||
WidthMap from Xw,
|
||||
FontMap from Xw,
|
||||
MarkMap from Xw,
|
||||
GraphicDevice from Xw,
|
||||
WindowQuality from Xw,
|
||||
TypeOfVisual from Xw
|
||||
AsciiString from TCollection,
|
||||
Background from Aspect,
|
||||
GradientBackground from Aspect,
|
||||
TypeOfResize from Aspect,
|
||||
Handle from Aspect,
|
||||
FillMethod from Aspect,
|
||||
GradientFillMethod from Aspect,
|
||||
DisplayConnection_Handle from Aspect,
|
||||
PixMap from Image,
|
||||
NameOfColor from Quantity,
|
||||
Parameter from Quantity,
|
||||
Ratio from Quantity,
|
||||
Color from Quantity,
|
||||
ColorMap from Xw,
|
||||
WindowQuality from Xw,
|
||||
TypeOfVisual from Xw
|
||||
|
||||
raises
|
||||
|
||||
@@ -70,14 +50,13 @@ raises
|
||||
|
||||
is
|
||||
|
||||
Create ( Device : GraphicDevice from Xw )
|
||||
Create ( theDisplayConnection : DisplayConnection_Handle from Aspect )
|
||||
returns mutable Window from Xw
|
||||
raises WindowDefinitionError from Aspect;
|
||||
---Level: Public
|
||||
|
||||
Create ( Device : GraphicDevice from Xw ;
|
||||
Create ( theDisplayConnection : DisplayConnection_Handle from Aspect ;
|
||||
aPart1, aPart2 : Integer from Standard ;
|
||||
aQuality : WindowQuality from Xw = Xw_WQ_SAMEQUALITY ;
|
||||
BackColor : NameOfColor from Quantity =
|
||||
Quantity_NOC_MATRAGRAY )
|
||||
returns mutable Window from Xw
|
||||
@@ -90,9 +69,8 @@ is
|
||||
-- or if the Position out of the Screen Space
|
||||
raises WindowDefinitionError from Aspect ;
|
||||
|
||||
Create ( Device : GraphicDevice from Xw ;
|
||||
Create ( theDisplayConnection : DisplayConnection_Handle from Aspect ;
|
||||
aWindow : Handle from Aspect;
|
||||
aQuality : WindowQuality from Xw = Xw_WQ_SAMEQUALITY ;
|
||||
BackColor : NameOfColor from Quantity =
|
||||
Quantity_NOC_MATRAGRAY )
|
||||
returns mutable Window from Xw
|
||||
@@ -104,53 +82,12 @@ is
|
||||
-- or if the Position out of the Screen Space
|
||||
raises WindowDefinitionError from Aspect ;
|
||||
|
||||
Create ( Device : GraphicDevice from Xw ;
|
||||
Title : CString from Standard ;
|
||||
Xc : Parameter from Quantity = 0.5 ;
|
||||
Yc : Parameter from Quantity = 0.5 ;
|
||||
Width : Parameter from Quantity = 0.5 ;
|
||||
Height : Parameter from Quantity = 0.5 ;
|
||||
Quality : WindowQuality from Xw = Xw_WQ_DRAWINGQUALITY ;
|
||||
BackColor : NameOfColor from Quantity = Quantity_NOC_MATRAGRAY ;
|
||||
Parent : Handle from Aspect = 0 )
|
||||
returns mutable Window from Xw
|
||||
---Level: Public
|
||||
---Purpose: Creates a Window defined by his Center and his Size
|
||||
-- in DSU from the Parent Window.
|
||||
-- NOTE than if Parent is 0 the window is created from the
|
||||
-- ROOT Window.
|
||||
-- Connects it to the X server at the first call
|
||||
-- depending of the GraphicDevice Visual and
|
||||
-- Display parameters.
|
||||
-- Quality defined a 2D or 3D Graphics oriented Window and
|
||||
-- must be one of :
|
||||
-- Xw_WQ_DRAWINGQUALITY for 2D Wireframe.
|
||||
-- Xw_WQ_PICTUREQUALITY for Picture.
|
||||
-- Xw_WQ_3DQUALITY for 3D Shading, HiddenLines, Wireframe.
|
||||
--
|
||||
-- Creation of an Xw_Window automatically determines the
|
||||
-- smaller dimension of the screen (usually the height)
|
||||
-- and parametrises it as 1.0.
|
||||
-- The smaller dimension of the window is limited to 1.0
|
||||
-- We can give a value greater than 1.0 to the larger
|
||||
-- dimension.
|
||||
-- No matter how large the values passed in argument, the
|
||||
-- window is automatically limited to the maximum size of
|
||||
-- the screen.
|
||||
-- The ratio of width to height of a conventional screen is
|
||||
-- of the order of 1.3.
|
||||
--
|
||||
-- Trigger: Raises WindowDefinitionError if the connection failed
|
||||
-- or if the Position out of the Screen Space
|
||||
raises WindowDefinitionError from Aspect ;
|
||||
|
||||
Create ( theDevice : GraphicDevice from Xw ;
|
||||
Create ( theDisplayConnection : DisplayConnection_Handle from Aspect ;
|
||||
theTitle : CString from Standard ;
|
||||
thePxLeft : Integer from Standard ;
|
||||
thePxTop : Integer from Standard ;
|
||||
thePxWidth : Integer from Standard ;
|
||||
thePxHeight : Integer from Standard ;
|
||||
theQuality : WindowQuality from Xw = Xw_WQ_DRAWINGQUALITY ;
|
||||
theBackColor : NameOfColor from Quantity = Quantity_NOC_MATRAGRAY ;
|
||||
theParent : Handle from Aspect = 0 )
|
||||
returns mutable Window from Xw
|
||||
@@ -165,83 +102,6 @@ is
|
||||
-- Category: Methods to modify the class definition
|
||||
---------------------------------------------------
|
||||
|
||||
SetBackground ( me : mutable ;
|
||||
Background : Background from Aspect ) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the window background.
|
||||
-- Warning: the background color is ignored when the quality
|
||||
-- of this window is TRANSPARENT.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetBackground ( me : mutable ;
|
||||
BackColor : NameOfColor from Quantity ) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the window background from a Named Color.
|
||||
-- Warning: the background color is ignored when the quality
|
||||
-- of this window is TRANSPARENT.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetBackground ( me : mutable; color : Color from Quantity ) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the window background from a Named Color.
|
||||
-- Warning: the background color is ignored when the quality
|
||||
-- of this window is TRANSPARENT.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetBackground( me: mutable;
|
||||
aPixmap: Handle from Aspect);
|
||||
---Level: Advanced
|
||||
---Purpose: Defines the window background directly from a bitmap.
|
||||
-- Warning: the bitmap and window must have the same depth.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetBackground( me: mutable;
|
||||
aName: CString from Standard;
|
||||
aMethod : FillMethod from Aspect = Aspect_FM_CENTERED)
|
||||
returns Boolean from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Loads the window background from an image file <aName>
|
||||
-- defined with a supported format XWD,GIF or BMP
|
||||
-- and returns TRUE if the operation is successfull.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetBackground ( me : mutable ;
|
||||
Background : GradientBackground from Aspect ) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the window gradient background.
|
||||
-- Warning: the gradient background colours are ignored when the quality
|
||||
-- of this window is TRANSPARENT.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetBackground( me : mutable;
|
||||
aCol1 : Color from Quantity;
|
||||
aCol2 : Color from Quantity;
|
||||
aMethod : GradientFillMethod from Aspect = Aspect_GFM_HOR);
|
||||
---Level: Public
|
||||
---Purpose: Modifies the window gradient background.
|
||||
-- Warning: the gradient background colours are ignored when the quality
|
||||
-- of this window is TRANSPARENT.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetDoubleBuffer ( me : mutable ;
|
||||
DBmode : Boolean from Standard )
|
||||
---Level: Advanced
|
||||
---Purpose: Activates/Deactivates the Double Buffering capability
|
||||
-- for this window.
|
||||
-- Warning: Double Buffering is always DISABLE by default
|
||||
-- If there is not enought ressources to activate the
|
||||
-- double-buffering the DB mode flag can be set to FALSE.
|
||||
---Category: Methods to modify the class definition
|
||||
is virtual;
|
||||
|
||||
Flush ( me )
|
||||
---Level: Advanced
|
||||
---Purpose: Flushs all graphics to the screen and Swap the Double
|
||||
-- buffer if Enable
|
||||
-- Category: Methods to modify the class definition
|
||||
-- Trigger: Raises if Something is WRONG at Drawing Time.
|
||||
raises WindowError from Aspect is virtual;
|
||||
|
||||
Map ( me ) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Opens the window <me>.
|
||||
@@ -274,92 +134,6 @@ is
|
||||
-- Trigger: Raises if Window is not defined properly
|
||||
raises WindowError from Aspect is virtual;
|
||||
|
||||
Clear ( me ) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Clears the Window in the Background color
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
ClearArea ( me ;
|
||||
Xc, Yc : Integer from Standard ;
|
||||
Width, Height : Integer from Standard )
|
||||
---Level: Public
|
||||
---Purpose: Clears the Window Area defined by his center and PIXEL size
|
||||
-- in the Background color
|
||||
-- Category: Methods to modify the class definition
|
||||
-- Trigger: Raises if Window is not defined properly
|
||||
raises WindowError from Aspect is virtual;
|
||||
|
||||
Restore ( me )
|
||||
---Level: Public
|
||||
---Purpose: Restores The Window from the BackingStored Window
|
||||
-- See BackingStore () method.
|
||||
---Category: Methods to modify the class definition
|
||||
raises WindowError from Aspect is virtual;
|
||||
|
||||
RestoreArea ( me ;
|
||||
Xc, Yc : Integer from Standard ;
|
||||
Width, Height : Integer from Standard )
|
||||
---Level: Public
|
||||
---Purpose: Restores The Window Area defined by his center
|
||||
-- and PIXEL size from the BackingStored Window
|
||||
-- See BackingStore () method.
|
||||
---Category: Methods to modify the class definition
|
||||
raises WindowError from Aspect is virtual;
|
||||
|
||||
Dump ( me ; aFilename : CString from Standard;
|
||||
aGammaValue: Real from Standard = 1.0 ) returns Boolean
|
||||
---Level: Advanced
|
||||
---Purpose: Dumps the Window to an XWD,GIF or BMP file with
|
||||
-- an optional gamma correction value according to the graphic system.
|
||||
-- and returns TRUE if the dump occurs normaly.
|
||||
-- Category: Methods to modify the class definition
|
||||
-- Trigger: Raises if Window is not defined properly
|
||||
raises WindowError from Aspect is virtual;
|
||||
|
||||
DumpArea ( me ; aFilename : CString from Standard ;
|
||||
Xc, Yc : Integer from Standard ;
|
||||
Width, Height : Integer from Standard ;
|
||||
aGammaValue: Real from Standard = 1.0 ) returns Boolean
|
||||
---Level: Advanced
|
||||
---Purpose: Dumps the Window Area defined by his center and PIXEL size
|
||||
-- to an XWD,GIF or BMP file with
|
||||
-- an optional gamma correction value according to the graphic system.
|
||||
-- and returns TRUE if the dump occurs normaly.
|
||||
-- Category: Methods to modify the class definition
|
||||
-- Trigger: Raises if Window is not defined properly
|
||||
-- or the area is out of the Window.
|
||||
raises WindowError from Aspect is virtual;
|
||||
|
||||
ToPixMap ( me ; theImage : in out PixMap from Image )
|
||||
returns Boolean
|
||||
---Level : Public
|
||||
---Purpose : dump the full contents of the window to a pixmap.
|
||||
is virtual;
|
||||
|
||||
Load ( me ; aFilename : CString from Standard) returns Boolean
|
||||
---Level: Advanced
|
||||
---Purpose: Loads the XWD file to this Window.
|
||||
-- Returns TRUE if the loading occurs normaly.
|
||||
-- Warning: Note that the Window is enlarged automatically
|
||||
-- when the image size is too large for this window.
|
||||
-- Category: Methods to modify the class definition
|
||||
-- Trigger: Raises if Window is not defined properly
|
||||
raises WindowError from Aspect is virtual;
|
||||
|
||||
LoadArea ( me ; aFilename : CString from Standard ;
|
||||
Xc, Yc : Integer from Standard ;
|
||||
Width, Height : Integer from Standard ) returns Boolean
|
||||
---Level: Advanced
|
||||
---Purpose: Loads the XWD file to Window Area defined by his center
|
||||
-- and PIXEL size.
|
||||
-- Returns TRUE if the loading occurs normaly.
|
||||
-- Warning: Note that the Image is zoomed automatically
|
||||
-- when the image size is too large for this window area.
|
||||
-- Category: Methods to modify the class definition
|
||||
-- Trigger: Raises if Window is not defined properly
|
||||
-- or the area is out of the Window.
|
||||
raises WindowError from Aspect is virtual;
|
||||
|
||||
SetCursor ( me ; anId : Integer from Standard ;
|
||||
aColor : NameOfColor from Quantity
|
||||
= Quantity_NOC_YELLOW ) is virtual ;
|
||||
@@ -374,22 +148,6 @@ is
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
BackingStore ( me )
|
||||
returns Boolean from Standard is virtual;
|
||||
---Level: Advanced
|
||||
---Purpose: Returns the BackingStore capability for this Window.
|
||||
-- If Answer is True Exposure can be recovered by
|
||||
-- Restore RestoreArea methods.
|
||||
-- If Answer is False, Application must Redraw the
|
||||
-- exposed area.
|
||||
---Category: Inquire methods
|
||||
|
||||
DoubleBuffer ( me )
|
||||
returns Boolean from Standard is virtual;
|
||||
---Level: Advanced
|
||||
---Purpose: Returns the DoubleBuffer state.
|
||||
---Category: Inquire methods
|
||||
|
||||
IsMapped ( me )
|
||||
returns Boolean from Standard is virtual;
|
||||
---Level: Public
|
||||
@@ -404,62 +162,18 @@ is
|
||||
-- WIDTH/HEIGHT dimensions
|
||||
---Category: Inquire methods
|
||||
|
||||
Position ( me ;
|
||||
X1, Y1, X2, Y2 : out Parameter from Quantity ) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Returns The Window POSITION in DSU
|
||||
---Category: Inquire methods
|
||||
|
||||
Position ( me ;
|
||||
X1, Y1, X2, Y2 : out Integer from Standard ) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Returns The Window POSITION in PIXEL
|
||||
---Category: Inquire methods
|
||||
|
||||
Size ( me ;
|
||||
Width, Height : out Parameter from Quantity ) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Returns The Window SIZE in DSU
|
||||
---Category: Inquire methods
|
||||
|
||||
Size ( me ;
|
||||
Width, Height : out Integer from Standard ) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Returns The Window SIZE in PIXEL
|
||||
---Category: Inquire methods
|
||||
|
||||
MMSize ( me ;
|
||||
Width, Height : out Real from Standard ) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Returns The Window SIZE in MM
|
||||
---Category: Inquire methods
|
||||
|
||||
Convert ( me ; PV : Integer from Standard )
|
||||
returns Parameter from Quantity is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Returns the DSU value depending of the PIXEL value.
|
||||
---Category: Inquire methods
|
||||
|
||||
Convert ( me ; DV : Parameter from Quantity )
|
||||
returns Integer from Standard is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Returns the PIXEL value depending of the DSU value.
|
||||
---Category: Inquire methods
|
||||
|
||||
Convert ( me ;
|
||||
PX, PY : Integer from Standard ;
|
||||
DX, DY : out Parameter from Quantity ) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Returns the DSU position depending of the PIXEL position.
|
||||
---Category: Inquire methods
|
||||
|
||||
Convert ( me ;
|
||||
DX, DY : Parameter from Quantity ;
|
||||
PX, PY : out Integer from Standard ) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Returns the PIXEL position depending of the DSU position.
|
||||
---Category: Inquire methods
|
||||
|
||||
XWindow ( me )
|
||||
returns Handle from Aspect is static;
|
||||
---Level: Public
|
||||
@@ -496,90 +210,12 @@ is
|
||||
-- and FALSE if the pointer is outside of the window
|
||||
---Category: Inquire methods
|
||||
|
||||
ColorMap ( me )
|
||||
returns ColorMap from Xw is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Colormap attached to this Window
|
||||
|
||||
TypeMap ( me )
|
||||
returns TypeMap from Xw is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Typemap attached to this Window
|
||||
|
||||
WidthMap ( me )
|
||||
returns WidthMap from Xw is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Widthmap attached to this Window
|
||||
|
||||
FontMap ( me )
|
||||
returns FontMap from Xw is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Fontmap attached to this Window
|
||||
|
||||
MarkMap ( me )
|
||||
returns MarkMap from Xw is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Markmap attached to this Window
|
||||
|
||||
XColorMap ( me )
|
||||
returns Handle from Aspect
|
||||
---Level: Internal
|
||||
---Purpose: Returns the Colormap XId attached to this Window
|
||||
-- depending of the HardWare and Visual class
|
||||
-- Trigger: Raises if Window is not defined properly
|
||||
raises WindowError from Aspect is static;
|
||||
|
||||
XVisual ( me )
|
||||
returns Address from Standard
|
||||
---Level: Internal
|
||||
---Purpose: Returns the Visual address attached to this Window
|
||||
-- depending of the HardWare
|
||||
-- Trigger: Raises if Window is not defined properly
|
||||
raises WindowError from Aspect is static;
|
||||
|
||||
VisualClass ( me )
|
||||
returns TypeOfVisual from Xw is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the X window Visual class of the created window <me>
|
||||
---Category: Inquire methods
|
||||
|
||||
VisualDepth ( me )
|
||||
returns Integer from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the X window Visual depth of the created window <me>
|
||||
---Category: Inquire methods
|
||||
|
||||
VisualID ( me )
|
||||
returns Integer from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Visual ID of the Window
|
||||
---Category: Inquire methods
|
||||
|
||||
Quality ( me )
|
||||
returns WindowQuality from Xw is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Quality of this window
|
||||
---Category: Inquire methods
|
||||
|
||||
PixelOfColor ( me ;aColor : NameOfColor from Quantity;
|
||||
aPixel : out Integer from Standard )
|
||||
returns Boolean from Standard is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns FALSE when the returned pixel value <aPixel>
|
||||
-- of an RGB color <aColor> is exact or TRUE
|
||||
-- when the pixel value is approximated.
|
||||
|
||||
PixelOfColor ( me ;aColor : Color from Quantity;
|
||||
aPixel : out Integer from Standard )
|
||||
returns Boolean from Standard is static;
|
||||
---Level: Advanced
|
||||
---Purpose: Returns FALSE when the returned pixel value <aPixel>
|
||||
-- of an RGB color <aColor> is exact or TRUE
|
||||
-- when the pixel value is approximated.
|
||||
-- Warning:
|
||||
-- make becarefull about the number of different pixel
|
||||
-- of colors reserved in the colormap in PseudoColor mode !!!
|
||||
|
||||
BackgroundPixel ( me ; aPixel : out Integer from Standard )
|
||||
returns Boolean from Standard is static;
|
||||
---Level: Public
|
||||
@@ -593,43 +229,7 @@ is
|
||||
---Purpose: Returns the ExtendedWindow address of the created window.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedColorMap ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the ExtendedColorMap address of the created window.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedTypeMap ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the ExtendedTypeMap address of the created window.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedWidthMap ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the ExtendedWidthMap address of the created window.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedFontMap ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the ExtendedFontMap address of the created window.
|
||||
---Category: Inquire methods
|
||||
|
||||
ExtendedMarkMap ( me )
|
||||
returns Address from Standard
|
||||
is static protected ;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the ExtendedMarkMap address of the created window.
|
||||
---Category: Inquire methods
|
||||
|
||||
SetWindow ( me: mutable ; aWindow : Handle from Aspect ;
|
||||
aQuality: WindowQuality from Xw ;
|
||||
BackColor : NameOfColor from Quantity )
|
||||
---Level: Internal
|
||||
---Trigger: Raises if Window is not defined properly
|
||||
@@ -638,7 +238,6 @@ is
|
||||
|
||||
SetWindow ( me: mutable ; Title : CString from Standard ;
|
||||
Xc, Yc, Width, Height: Parameter from Quantity ;
|
||||
Quality : WindowQuality from Xw ;
|
||||
BackColor : NameOfColor from Quantity ;
|
||||
Parent : Handle from Aspect )
|
||||
---Level: Internal
|
||||
@@ -654,28 +253,11 @@ is
|
||||
|
||||
fields
|
||||
|
||||
MyQuality : WindowQuality from Xw is protected ;
|
||||
MyColorMap : ColorMap from Xw is protected ;
|
||||
MyTypeMap : TypeMap from Xw is protected ;
|
||||
MyWidthMap : WidthMap from Xw is protected ;
|
||||
MyFontMap : FontMap from Xw is protected ;
|
||||
MyMarkMap : MarkMap from Xw is protected ;
|
||||
MyXWindow : Handle from Aspect is protected ;
|
||||
MyXParentWindow : Handle from Aspect is protected ;
|
||||
MyXPixmap : Handle from Aspect is protected ;
|
||||
MyVisualClass : TypeOfVisual from Xw is protected ;
|
||||
MyDepth : Integer from Standard is protected ;
|
||||
MyBackgroundIndex : Integer from Standard is protected ;
|
||||
MyExtendedDisplay : Address from Standard is protected ;
|
||||
MyExtendedWindow : Address from Standard is protected ;
|
||||
MyExtendedColorMap : Address from Standard is protected ;
|
||||
MyExtendedTypeMap : Address from Standard is protected ;
|
||||
MyExtendedWidthMap : Address from Standard is protected ;
|
||||
MyExtendedFontMap : Address from Standard is protected ;
|
||||
MyExtendedMarkMap : Address from Standard is protected ;
|
||||
|
||||
friends
|
||||
|
||||
class IconBox from Xw
|
||||
myDisplayConnection : DisplayConnection_Handle from Aspect is protected;
|
||||
|
||||
end Window ;
|
||||
|
1038
src/Xw/Xw_Window.cxx
1038
src/Xw/Xw_Window.cxx
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user