diff options
Diffstat (limited to 'vcl/unx/inc')
-rw-r--r-- | vcl/unx/inc/XIM.h | 171 | ||||
-rw-r--r-- | vcl/unx/inc/cdeint.hxx | 166 | ||||
-rw-r--r-- | vcl/unx/inc/dtint.hxx | 397 | ||||
-rw-r--r-- | vcl/unx/inc/i18n_cb.hxx | 111 | ||||
-rw-r--r-- | vcl/unx/inc/i18n_ic.hxx | 129 | ||||
-rw-r--r-- | vcl/unx/inc/i18n_im.hxx | 99 | ||||
-rw-r--r-- | vcl/unx/inc/i18n_xkb.hxx | 150 | ||||
-rw-r--r-- | vcl/unx/inc/postx.h | 121 | ||||
-rw-r--r-- | vcl/unx/inc/prex.h | 141 | ||||
-rw-r--r-- | vcl/unx/inc/saldata.hxx | 180 | ||||
-rw-r--r-- | vcl/unx/inc/saldisp.hxx | 589 | ||||
-rw-r--r-- | vcl/unx/inc/salfont.h | 228 | ||||
-rw-r--r-- | vcl/unx/inc/salframe.h | 247 | ||||
-rw-r--r-- | vcl/unx/inc/salgdi.h | 320 | ||||
-rw-r--r-- | vcl/unx/inc/salinst.h | 115 | ||||
-rw-r--r-- | vcl/unx/inc/salobj.h | 135 | ||||
-rw-r--r-- | vcl/unx/inc/salprn.h | 133 | ||||
-rw-r--r-- | vcl/unx/inc/salstd.hxx | 127 | ||||
-rw-r--r-- | vcl/unx/inc/salsys.h | 89 | ||||
-rw-r--r-- | vcl/unx/inc/salunx.h | 190 | ||||
-rw-r--r-- | vcl/unx/inc/salvd.h | 135 | ||||
-rw-r--r-- | vcl/unx/inc/sm.hxx | 112 | ||||
-rw-r--r-- | vcl/unx/inc/soicon.hxx | 74 | ||||
-rw-r--r-- | vcl/unx/inc/strhelper.hxx | 77 | ||||
-rw-r--r-- | vcl/unx/inc/svsys.h | 68 | ||||
-rw-r--r-- | vcl/unx/inc/svunx.h | 83 | ||||
-rw-r--r-- | vcl/unx/inc/xfont.hxx | 133 | ||||
-rw-r--r-- | vcl/unx/inc/xsalprn.h | 223 |
28 files changed, 4743 insertions, 0 deletions
diff --git a/vcl/unx/inc/XIM.h b/vcl/unx/inc/XIM.h new file mode 100644 index 000000000000..f77ae54d51df --- /dev/null +++ b/vcl/unx/inc/XIM.h @@ -0,0 +1,171 @@ +/************************************************************************* + * + * $RCSfile: XIM.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:40 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _XIM_h +#define _XIM_h + +#include <X11/Xlib.h> +#include <X11/Xresource.h> + +#ifdef __cplusplus +extern "C" +#endif +XIM XvaOpenIM( Display*, XrmDatabase, char*, char*, ... ); + +extern Status XCloseIM(XIM); + +#ifndef XIMCallback1 +typedef int (*XIMProc1)(XIC, XPointer, XPointer); +typedef struct { + XPointer client_data; + XIMProc1 callback; +} XIMCallback1; +#endif + +typedef struct _XIMAnnotation { + int start_position; + int end_position; + XPointer data; +} XIMAnnotation; + +/* + XIMUText: XIMText extention for UTF16 + */ +typedef struct _XIMUnicodeText { + unsigned short length; + XIMFeedback *feedback; + Bool encoding_is_wchar; + union { + char *multi_byte; + wchar_t *wide_char; + unsigned short *utf16_char; + } string; + unsigned int count_annotations; + XIMAnnotation *annotations; +} XIMUnicodeText; + +/* lookup choice */ +typedef enum { + XIMDrawUpHorizontally = 0 , + XIMDrawUpVertically = 1 +} XIMDrawUpDirection ; + +typedef struct _XIMLookupStartCallbackStruct { + int choice_per_window; /* Number of choices can be display + * in the region + */ + int nrows; + int ncolumns; + XIMDrawUpDirection draw_up_direction; +} XIMLookupStartCallbackStruct; + +typedef struct _XIMUnicodeChoiceObject { + XIMUnicodeText *label; + XIMUnicodeText *value; +} XIMUnicodeChoiceObject; + +typedef struct _XIMLookupDrawCallbackStruct { + XIMUnicodeChoiceObject *choices; /* the lookup choices */ + int n_choices; /* Total number of lookup choices */ + int first_index; + int last_index; + int current_index; + XIMUnicodeText *title; +} XIMLookupDrawCallbackStruct; + +/* Unicode Subset */ +typedef enum { + XIMKatakana, XIMHanzi +} XIMUnicodeCharacterSubsetID; + +typedef struct _XIMUncodeSubset { + XIMUnicodeCharacterSubsetID index; + XIMUnicodeCharacterSubsetID subset_id; + char *name; + Bool is_active; +} XIMUnicodeCharacterSubset; + +typedef struct _XIMUncodeSubsets { + unsigned short count_subsets; + XIMUnicodeCharacterSubset *supported_subsets; +} XIMUnicodeCharacterSubsets; + +typedef struct _XIMSwitchIMNotifyCallbackStruct { + XIMUnicodeCharacterSubset *from; + XIMUnicodeCharacterSubset *to; +} XIMSwitchIMNotifyCallbackStruct; + +/* XIM attributes for multilingual IM extension */ +#define XNMultiLingualInput "multiLingualInput" +#define XNQueryUnicodeCharacterSubset "unicodeCharacterSubset" + +/* XIC attributes for multilingual IM extension */ + +#define XNUnicodeCharacterSubset "UnicodeChararcterSubset" + +#define XNSwitchIMNotifyCallback "switchIMNotifyCallback" +#define XNCommitStringCallback "commitStringCallback" +#define XNForwardEventCallback "forwardEventCallback" + +#define XNLookupStartCallback "lookupStartCallback" +#define XNLookupDrawCallback "lookupDrawCallback" +#define XNLookupDoneCallback "lookupDoneCallback" + +#endif diff --git a/vcl/unx/inc/cdeint.hxx b/vcl/unx/inc/cdeint.hxx new file mode 100644 index 000000000000..4ce7eef4c28b --- /dev/null +++ b/vcl/unx/inc/cdeint.hxx @@ -0,0 +1,166 @@ +/************************************************************************* + * + * $RCSfile: cdeint.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:40 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _SV_CDEINT_HXX +#define _SV_CDEINT_HXX + +#ifndef _SV_DTINT_HXX +#include <dtint.hxx> +#endif + +#include <prex.h> +#define Boolean XLIB_Boolean +#define Window XLIB_Window +#include <X11/Intrinsic.h> +#include <dt/dt.h> +#include <dt/action.h> +#include <dt/wsm.h> +#undef Boolean +#undef Window +#include <postx.h> + +#ifndef _STREAM_HXX +#include <tools/stream.hxx> +#endif +class CDEIntegrator : public DtIntegrator +{ + friend DtIntegrator* DtIntegrator::CreateDtIntegrator( SalFrame* ); +private: + static void* pDtSvcLib; + static void* pXmLib; + static void* pMrmLib; + static void* pXtLib; + static void* pttLib; + static int nRefCount; + static char* pFallbackRes[]; + + // function pointers + // from DtSvc + static XLIB_Boolean (*pDtAppInitialize) + ( XtAppContext, Display*, Widget, char*, char* ); + static void (*pDtDtsLoadDataTypes)(); + static void (*pDtDtsRelease)(); + static char* (*pDtDtsFileToAttributeValue) + (const char*,const char*); + static void (*pDtDtsFreeAttributeValue)( char* ); + static DtActionInvocationID (*pDtActionInvoke) + ( Widget, char*, DtActionArg*, int, char*, char*, char*, int, + DtActionCallbackProc, XtPointer ); + static Status (*pDtWsmGetWorkspaceInfo)( Display*, XLIB_Window, Atom, + DtWsmWorkspaceInfo** ); + static void (*pDtWsmFreeWorkspaceInfo)( DtWsmWorkspaceInfo* ); + static Status (*pDtWsmGetWorkspaceList)( Display*, XLIB_Window, Atom**, + int* ); + static Status (*pDtWsmGetCurrentWorkspace)( Display*, XLIB_Window root, Atom* ); + static Status (*pDtWsmGetWorkspacesOccupied)( Display*, XLIB_Window, Atom**, unsigned long* ); + + // from Mrm + static void (*pMrmInitialize)(); + + // from Xm + static WidgetClass* CDEIntegrator::pxmDrawingAreaWidgetClass; + static WidgetClass* CDEIntegrator::pxmRowColumnWidgetClass; + static WidgetClass* CDEIntegrator::pxmPushButtonWidgetClass; + + // from Xt + static void (*pXtToolkitInitialize)(); + static XtAppContext (*pXtCreateApplicationContext)(); + static Widget (*pXtAppCreateShell)( char*, char*, WidgetClass, + Display*, ArgList, Cardinal ); + static Widget (*pXtVaCreateManagedWidget)( char*, WidgetClass, + Widget, ... ); + static void (*pXtDisplayInitialize)( XtAppContext, Display*, + char*, char*, + XrmOptionDescRec*, Cardinal, + int*, char**); + static Widget (*pXtSetLanguageProc)( XtAppContext, XtLanguageProc, XtPointer ); + static void (*pXtAppSetFallbackResources)( XtAppContext, char** ); + static Widget (*pXtAppInitialize)(XtAppContext*, char*, + XrmOptionDescList, + Cardinal, int*, char**, char**, + ArgList, Cardinal ); + static void (*pXtRealizeWidget)( Widget ); + static void (*pXtUnrealizeWidget)( Widget ); + static XLIB_Boolean (*pXtIsRealized)( Widget ); + static void (*pXtConfigureWidget) + ( Widget, Position, Position, Dimension, Dimension, Dimension ); + static void (*pXtAppProcessEvent)( XtAppContext, XtInputMask ); + static XtInputMask (*pXtAppPending)( XtAppContext ); + static WidgetClass* pAppShellClass; + + + XtAppContext maAppContext; + Widget maAppWidget; + + CDEIntegrator( SalFrame* ); + + void GlobalInit(); + void GlobalDeInit(); + + void InvokeAction( const String&, const String& ); + +public: + virtual ~CDEIntegrator(); + + virtual BOOL StartProcess( String&, String&, const String& rDir = String() ); + virtual BOOL GetSystemLook( SystemLookInfo& rInfo ); +}; + +#endif diff --git a/vcl/unx/inc/dtint.hxx b/vcl/unx/inc/dtint.hxx new file mode 100644 index 000000000000..1eb55abc787a --- /dev/null +++ b/vcl/unx/inc/dtint.hxx @@ -0,0 +1,397 @@ +/************************************************************************* + * + * $RCSfile: dtint.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _SV_DTINT_HXX +#define _SV_DTINT_HXX + +#include <cstdio> +#include <dlfcn.h> + +#ifndef _LIST_HXX +#include <tools/list.hxx> +#endif +#ifndef _LINK_HXX +#include <tools/link.hxx> +#endif +#ifndef _STRING_HXX +#include <tools/string.hxx> +#endif +#include <tools/color.hxx> + +class SalFrame; +class SalBitmap; +class String; +class SalDisplay; +class FastItemInfo; + +#ifndef _XLIB_H_ +// forwards from X +struct Display; +struct XEvent; +#define Atom UINT32 +#define XLIB_Window UINT32 +#endif + +#define XDND_PROTOCOL_VERSION 3 + +// NETBSD has no RTLD_GLOBAL +#ifndef RTLD_GLOBAL +#define DLOPEN_MODE (RTLD_LAZY) +#else +#define DLOPEN_MODE (RTLD_GLOBAL | RTLD_LAZY) +#endif + +class DtIntegrator; + +DECLARE_LIST( DtIntegratorList, DtIntegrator* ); +DECLARE_LIST( DtSalFrameList, SalFrame* ); +DECLARE_LIST( StringList, String* ); + +struct SystemLookInfo +{ + /** system foreground color */ + Color foreground; + /** system background color */ + Color background; + /** system foreground color for a selection */ + Color selectForeground; + /** system background color for a selection */ + Color selectBackground; + + /** gradient for an active window */ + Color windowActiveStart; + Color windowActiveEnd; + /** border color for active window */ + Color activeBorder; + /** text color for active window bar */ + Color activeForeground; + /** gradient of an inactive window */ + Color windowInactiveStart; + Color windowInactiveEnd; + /** border color for inactive window */ + Color inactiveBorder; + /** text color for inactive window bar */ + Color inactiveForeground; + + /** font to use for controls. Empty if not set. */ + String controlFont; + /** font to use for dragbars. Empty if not set. */ + String windowFont; + + SystemLookInfo() + { + foreground.SetColor( COL_TRANSPARENT ); + background.SetColor( COL_TRANSPARENT ); + selectBackground.SetColor( COL_TRANSPARENT ); + selectForeground.SetColor( COL_TRANSPARENT ); + + windowActiveStart.SetColor( COL_TRANSPARENT ); + windowActiveEnd.SetColor( COL_TRANSPARENT ); + activeBorder.SetColor( COL_TRANSPARENT ); + activeForeground.SetColor( COL_TRANSPARENT ); + + windowInactiveStart.SetColor( COL_TRANSPARENT ); + windowInactiveEnd.SetColor( COL_TRANSPARENT ); + inactiveBorder.SetColor( COL_TRANSPARENT ); + inactiveForeground.SetColor( COL_TRANSPARENT ); + } +}; + +enum DtType { + DtGeneric, + DtCDE, + DtKDE, + DtGNOME, + DtSCO, + DtIRIX +}; + +enum DtDataType { + DtTypeUrl, + DtTypeText, + DtTypeKnown +}; + +struct DtData +{ + DtDataType meType; + int mnX, mnY; // used for Drop data + void* mpFrame; // dito + int mnBytes; + unsigned char* mpBytes; + unsigned char* mpType; + + DtData() : meType( DtTypeText ), mnX( -1 ), mnY( -1 ), mpFrame( 0 ), + mnBytes( 0 ), mpBytes( 0 ), mpType( NULL ) {} + ~DtData() + { + if( mpBytes ) + delete mpBytes; + } +}; + +enum DtDropAction +{ + DtDropNone = 0, + DtDropCopy = 1, + DtDropMove = 2, + DtDropLink = 4, + DtDropAny = 7 +}; + +struct DtDropQuery +{ + int m_nX; + int m_nY; + DtDropAction m_eAction; + void* m_pFrame; // really a SalFrame* +}; + +class DtIntegrator +{ +protected: + enum DtDragState { DtDragNone = 0, DtDragging, DtWaitForStatus, + DtWaitForDataRequest }; + + DtType meType; + Display* mpDisplay; + SalDisplay* mpSalDisplay; + SalFrame* mpSalFrame; + int mnRefCount; + + XLIB_Window maSelectionWindow; + Atom maExPropertyAtom; + + Atom mnXdndAware; + Atom mnXdndSelection; + Atom mnXdndEnter; + Atom mnXdndLeave; + Atom mnXdndStatus; + Atom mnXdndTypeList; + Atom mnXdndPosition; + Atom mnXdndDrop; + Atom mnXdndActionCopy; + Atom mnXdndActionMove; + Atom mnXdndActionLink; + Atom mnXdndActionAsk; + Atom mnXdndActionPrivate; + Atom mnXdndActionList; + Atom mnXdndActionDescription; + Atom mnXdndFinished; + + int mnDropDataTime; + int mnLastDropX; + int mnLastDropY; + XLIB_Window maDropSource; + SalFrame* mpDropTarget; + StringList maDropTypes; + + Link maDropFinishHdl; + Link maQueryDropHdl; + Link maBeginDropHdl; + + DtDragState meDragState; + int mnLastDragX; + int mnLastDragY; + int mnLastDragTimestamp; + int mnWaitTimestamp; + Link maQueryDragDataHdl; + XLIB_Window maDragSource; + XLIB_Window maDragTarget; + StringList maDragTypes; + + DtIntegrator( SalFrame* ); + + DtSalFrameList maDropzones; + + Link maClipboardChangedHdl; + Atom mnClipboardAtom; + Atom mnTargetsAtom; + Atom mnCompoundAtom; + DtData* mpLastData; + + virtual void ImplRegisterDropzone( SalFrame* ); + virtual void ImplUnregisterDropzone( SalFrame* ); + virtual void ImplHandleXEvent( XEvent* ); + + BOOL LaunchProcess( const String&, const String& rDirectory = String() ); + + static DtIntegratorList aIntegratorList; + static String aHomeDir; + + // helper functions + XLIB_Window GetXdndAwareWindowBeneathPointer( int& rVersion, XEvent* ); + void SendXdndLeave(); + void SendXdndEnter(); + void SendXdndPosition( XEvent* ); + void CheckXdndTimeout( int ); + +public: + static DtIntegrator* CreateDtIntegrator( SalFrame* ); + + static void HandleXEvent( XEvent* ); + + virtual ~DtIntegrator(); + + virtual BOOL StartProcess( String&, String&, const String& rDir = String() ); + + // functions for Clipboard + inline Link SetClipboardChangedHdl( const Link& ); + const Link& GetClipboardChangedHdl() + { return maClipboardChangedHdl; } + void Copy( DtData* ); // copy to system + DtData* Paste(); // copy from system + BOOL CheckUnxClipboardChanged(); + + // functions for Dnd + void RegisterDropzone( SalFrame* ); + void UnregisterDropzone( SalFrame* ); + DtDropAction ExecuteDrag( const StringList &, SalFrame* pFrame ); + DtData* DropFinish( const String& rType ); + StringList& GetDropTypes() { return maDropTypes; } + + const Link& GetDropFinishHdl() { return maDropFinishHdl; } + Link SetDropFinishHdl( const Link& rNewLink ) + { + Link aRet = maDropFinishHdl; + maDropFinishHdl = rNewLink; + return aRet; + } + const Link& GetQueryDropHdl() { return maDropFinishHdl; } + Link SetQueryDropHdl( const Link& rNewLink ) + { + Link aRet = maQueryDropHdl; + maQueryDropHdl = rNewLink; + return aRet; + } + const Link& GetBeginDropHdl() { return maBeginDropHdl; } + Link SetBeginDropHdl( const Link& rNewLink ) + { + Link aRet = maBeginDropHdl; + maBeginDropHdl = rNewLink; + return aRet; + } + const Link& GetQueryDragDataHdl() { return maQueryDragDataHdl; } + Link SetQueryDragDataHdl( const Link& rNewLink ) + { + Link aRet = maQueryDragDataHdl; + maQueryDragDataHdl = rNewLink; + return aRet; + } + + // SystemLook + virtual BOOL GetSystemLook( SystemLookInfo& rInfo ); + + DtType GetDtType() { return meType; } + SalFrame* GetFrame() { return mpSalFrame; } + SalDisplay* GetSalDisplay() { return mpSalDisplay; } + Display* GetDisplay() { return mpDisplay; } + + void Acquire() { mnRefCount++; } + inline void Release(); +}; + +inline void DtIntegrator::Release() +{ + mnRefCount--; + if( ! mnRefCount ) + { + aIntegratorList.Remove( this ); + delete this; + } +} + +inline Link DtIntegrator::SetClipboardChangedHdl( const Link& rLink ) +{ + Link aOldLink = maClipboardChangedHdl; + maClipboardChangedHdl = rLink; + return aOldLink; +} + +// helper funktions for dynamic loading +extern BOOL bSymbolLoadFailed; + +inline void* _LoadSymbol( void* pLibrary, char* pSymbolname ) +{ + void *pRet = dlsym( pLibrary, pSymbolname ); + if( ! pRet ) + { + fprintf( stderr, "Could not load symbol %s: %s\n", + pSymbolname, dlerror() ); + bSymbolLoadFailed = TRUE; + } + return pRet; +} +inline void* _LoadLibrary( char* pLibname ) +{ + bSymbolLoadFailed = FALSE; + void *pRet = dlopen( pLibname, DLOPEN_MODE ); + if( ! pRet ) + { +#ifdef DEBUG + fprintf( stderr, "%s could not be opened: %s\n", + pLibname, dlerror() ); +#endif + bSymbolLoadFailed = TRUE; + } + return pRet; +} + +#endif diff --git a/vcl/unx/inc/i18n_cb.hxx b/vcl/unx/inc/i18n_cb.hxx new file mode 100644 index 000000000000..a18a2eb4a7c7 --- /dev/null +++ b/vcl/unx/inc/i18n_cb.hxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * $RCSfile: i18n_cb.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _SAL_I18N_CALLBACK_HXX +#define _SAL_I18N_CALLBACK_HXX + +#ifdef __cplusplus +extern "C" { +#endif + +// for iiimp / ml input +int CommitStringCallback( XIC ic, XPointer client_data, XPointer call_data); + +// xim callbacks +void PreeditDoneCallback ( XIC ic, XPointer client_data, XPointer call_data); +int PreeditStartCallback( XIC ic, XPointer client_data, XPointer call_data); +void PreeditDoneCallback ( XIC ic, XPointer client_data, XPointer call_data); +void PreeditDrawCallback ( XIC ic, XPointer client_data, + XIMPreeditDrawCallbackStruct *call_data ); +void PreeditCaretCallback( XIC ic, XPointer client_data, + XIMPreeditCaretCallbackStruct *call_data ); + +/* private hook to prevent from sending further edit events */ +void PreeditCancelCallback( XPointer client_data ); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +typedef struct { + sal_Unicode *pUnicodeBuffer; + XIMFeedback *pCharStyle; + unsigned int nCursorPos; + unsigned int nLength; + unsigned int nSize; +} preedit_text_t; + +class SalFrame; + +typedef enum { + ePreeditStatusDontKnow = 0, + ePreeditStatusActive, + ePreeditStatusActivationRequired, + ePreeditStatusStartPending +} preedit_status_t; + +typedef struct { + SalFrame *pFrame; + Bool bIsMultilingual; + preedit_status_t eState; + preedit_text_t aText; +} preedit_data_t; + +#endif /* _SAL_I18N_CALLBACK_HXX */ diff --git a/vcl/unx/inc/i18n_ic.hxx b/vcl/unx/inc/i18n_ic.hxx new file mode 100644 index 000000000000..4212bee79782 --- /dev/null +++ b/vcl/unx/inc/i18n_ic.hxx @@ -0,0 +1,129 @@ +/************************************************************************* + * + * $RCSfile: i18n_ic.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SAL_I18N_INPUTCONTEXT_HXX +#define _SAL_I18N_INPUTCONTEXT_HXX + +#ifndef _SAL_I18N_CALLBACK_HXX +#include "i18n_cb.hxx" +#endif + +class SalI18N_InputContext +{ + +private: + + Bool mbUseable; // system supports current locale ? + Bool mbMultiLingual; // system supports iiimp ? + XIC maContext; + + XIMStyle mnSupportedStatusStyle; + XIMStyle mnSupportedPreeditStyle; + XIMStyle mnStatusStyle; + XIMStyle mnPreeditStyle; + + preedit_data_t maClientData; + XIMCallback maPreeditStartCallback; + XIMCallback maPreeditDoneCallback; + XIMCallback maPreeditDrawCallback; + XIMCallback maPreeditCaretCallback; + XIMCallback maCommitStringCallback; + + XVaNestedList mpAttributes; + XVaNestedList mpStatusAttributes; + XVaNestedList mpPreeditAttributes; + #ifdef SOLARIS + XFontSet mpFontSet; + Display *mpDisplay; + #endif + + Bool SupportInputMethodStyle( XIMStyles *pIMStyles ); + unsigned int GetWeightingOfIMStyle( XIMStyle n_style ) const ; + Bool IsSupportedIMStyle( XIMStyle n_style ) const ; + +public: + + Bool UseContext() { return mbUseable; } + Bool IsMultiLingual() { return mbMultiLingual; } + XIC GetContext() { return maContext; } + + void ExtendEventMask( XLIB_Window aFocusWindow ); + void SetICFocus(); + void UnsetICFocus(); + int HandleKeyEvent( XKeyEvent *pEvent, SalFrame *pFrame ); // unused + void EndExtTextInput( USHORT nFlags ); // unused + int CommitStringCallback( sal_Unicode* pText, sal_Size nLength ); + + void Map( SalFrame *pFrame ); + void Unmap(); + + SalI18N_InputContext( SalFrame *pFrame ); + ~SalI18N_InputContext(); + +private: + + SalI18N_InputContext(); // do not use this + +}; + +#endif _SAL_I18N_INPUTCONTEXT_HXX + + diff --git a/vcl/unx/inc/i18n_im.hxx b/vcl/unx/inc/i18n_im.hxx new file mode 100644 index 000000000000..a81dc7eba6dd --- /dev/null +++ b/vcl/unx/inc/i18n_im.hxx @@ -0,0 +1,99 @@ +/************************************************************************* + * + * $RCSfile: i18n_im.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SAL_I18N_INPUTMETHOD_HXX +#define _SAL_I18N_INPUTMETHOD_HXX + +extern "C" char* +GetMethodName( XIMStyle nStyle, char *pBuf, int nBufSize); + +#if (1) + #define bUseInputMethodDefault True +#else + #define bUseInputMethodDefault False +#endif + +class SalI18N_InputMethod +{ + Bool mbUseable; // system supports locale as well as status + // and preedit style ? + Bool mbMultiLingual; // system supports iiimp + XIM maMethod; + XIMStyles *mpStyles; + +public: + + Bool IsMultiLingual() { return mbMultiLingual; } + Bool UseMethod() { return mbUseable; } + XIM GetMethod() { return maMethod; } + Bool CreateMethod( Display *pDisplay ); + XIMStyles *GetSupportedStyles() { return mpStyles; } + Bool SetLocale( const char* pLocale = "" ); + Bool FilterEvent( XEvent *pEvent ); + + + SalI18N_InputMethod(); + ~SalI18N_InputMethod(); +}; + +#endif _SAL_I18N_INPUTMETHOD_HXX + + diff --git a/vcl/unx/inc/i18n_xkb.hxx b/vcl/unx/inc/i18n_xkb.hxx new file mode 100644 index 000000000000..5eb59ff0c235 --- /dev/null +++ b/vcl/unx/inc/i18n_xkb.hxx @@ -0,0 +1,150 @@ +/************************************************************************* + * + * $RCSfile: i18n_xkb.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SAL_I18N_XKBDEXTENSION_HXX +#define _SAL_I18N_XKBDEXTENSION_HXX + +#ifndef _SAL_TYPES_H_ +#include <sal/types.h> +#endif + +class SalI18N_KeyboardExtension +{ +private: + + sal_Bool mbUseExtension; + sal_uInt32 mnDefaultGroup; + sal_uInt32 mnGroup; + sal_uInt32 mnEventBase; + sal_uInt32 mnErrorBase; + Display* mpDisplay; + +public: + + SalI18N_KeyboardExtension( Display *pDisplay ); + inline ~SalI18N_KeyboardExtension(); + + inline sal_Bool UseExtension() const ; // server and client support the + // extension + inline void UseExtension( sal_Bool bState );// used to disable the Extension + + void Dispatch( XEvent *pEvent ); // keep track of group changes + + sal_uInt32 LookupKeysymInGroup( sal_uInt32 nKeyCode, + sal_uInt32 nShiftState, + sal_uInt32 nGroup ) const ; + + inline sal_uInt32 LookupKeysymInDefaultGroup( + sal_uInt32 nKeyCode, + sal_uInt32 nShiftState ) const ; + inline sal_uInt32 GetGroup() const ; // the current keyboard group + inline sal_uInt32 GetDefaultGroup() const ; // base group, usually group 1 + inline sal_uInt32 GetEventBase() const ; + +protected: + + SalI18N_KeyboardExtension(); // disabled +}; + +inline +SalI18N_KeyboardExtension::~SalI18N_KeyboardExtension() +{ +} + +inline sal_Bool +SalI18N_KeyboardExtension::UseExtension() const +{ + return mbUseExtension; +} + +inline void +SalI18N_KeyboardExtension::UseExtension( sal_Bool bState ) +{ + mbUseExtension = mbUseExtension && bState; +} + +inline sal_uInt32 +SalI18N_KeyboardExtension::LookupKeysymInDefaultGroup( sal_uInt32 nKeyCode, + sal_uInt32 nShiftState ) const +{ + return LookupKeysymInGroup( nKeyCode, nShiftState, mnDefaultGroup ); +} + +inline sal_uInt32 +SalI18N_KeyboardExtension::GetGroup() const +{ + return mnGroup; +} + +inline sal_uInt32 +SalI18N_KeyboardExtension::GetDefaultGroup() const +{ + return mnDefaultGroup; +} + +inline sal_uInt32 +SalI18N_KeyboardExtension::GetEventBase() const +{ + return mnEventBase; +} + +#endif // _SAL_I18N_XKBDEXTENSION_HXX + diff --git a/vcl/unx/inc/postx.h b/vcl/unx/inc/postx.h new file mode 100644 index 000000000000..db89e7822dcb --- /dev/null +++ b/vcl/unx/inc/postx.h @@ -0,0 +1,121 @@ +/************************************************************************* + * + * $RCSfile: postx.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// +// // +// (C) 1997 Star Division GmbH, Hamburg, Germany // +// // +// $Revision: 1.1.1.1 $ $Author: hr $ $Date: 2000-09-18 17:05:41 $ // +// // +// $Workfile: postx.h $ // +// $Modtime: 08 Aug 1997 10:13:36 $ // +// // +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// + +#ifndef _POSTX_H +#define _POSTX_H + +#if defined __cplusplus && ! defined LINUX +} +#endif + +/* X-Types */ +#undef Window +#undef BYTE +#undef INT8 +#undef BOOL +#undef Font +#undef Cursor +#undef String +#undef KeyCode +#undef Region +#undef Icon +#undef Time +#undef Boolean + +#undef Min +#undef Max +#undef class +#undef new +#undef DestroyAll +#undef Success + +#undef Printer +/* #undef FontInfo */ +#undef Orientation + +#undef GetToken +#undef ReleaseToken +#undef InitializeToken +#undef NextRequest + +/* Network Audio System */ +#undef Sound + +#ifdef KeyPress +#if KeyPress != 2 +Error KeyPress must be Equal 2 +#endif +#undef KeyPress +#endif +#define XLIB_KeyPress 2 + +#endif + diff --git a/vcl/unx/inc/prex.h b/vcl/unx/inc/prex.h new file mode 100644 index 000000000000..2046be74aa81 --- /dev/null +++ b/vcl/unx/inc/prex.h @@ -0,0 +1,141 @@ +/************************************************************************* + * + * $RCSfile: prex.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// +// // +// (C) 1997 Star Division GmbH, Hamburg, Germany // +// // +// $Revision: 1.1.1.1 $ $Author: hr $ $Date: 2000-09-18 17:05:41 $ // +// // +// $Workfile: prex.h $ // +// $Modtime: 08 Aug 1997 10:13:54 $ // +// // +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// + +#ifndef _PREX_H +#define _PREX_H + +#define Window XLIB_Window +#define BYTE XLIB_BYTE +#define INT8 XLIB_INT8 +#define BOOL XLIB_BOOL +#define Font XLIB_Font +#define Cursor XLIB_Cursor +#define String XLIB_String +#define KeyCode XLIB_KeyCode +#define Region XLIB_Region +#define Icon XLIB_Icon +#define class XLIB_class +#define new XLIB_new +#define Time XLIB_Time +#define Region XLIB_Region +#define Boolean XLIB_Boolean + +/* fuer Network Audio System */ +#define Sound XLIB_Sound + +#if defined( MTF12 ) || defined( ALPHA ) +#define XLIB_ILLEGAL_ACCESS +#endif +#if defined( RS6000 ) || defined( ALPHA ) +struct _XDisplay; +#endif + +#if defined __cplusplus && ! defined LINUX +extern "C" { +#endif + +#include <X11/StringDefs.h> +#include <X11/Intrinsic.h> + +#ifdef SOLARIS +#define USE_MOTIF +#else +#define USE_ATHENA +#endif + +#undef DestroyAll +#define DestroyAll XLIB_DestroyAll +#define XLIB_DestroyAll 0 +#undef String +#define String XLIB_String +#include <X11/IntrinsicP.h> +#include <X11/Shell.h> +#ifdef USE_MOTIF +#include <Xm/BulletinB.h> +#define SAL_COMPOSITE_WIDGET xmBulletinBoardWidgetClass +#endif +#ifdef USE_ATHENA +#include <X11/Xaw/Box.h> +#define SAL_COMPOSITE_WIDGET boxWidgetClass +#endif +#undef XtInheritTranslations +#define XtInheritTranslations ((XLIB_String) (&_XtInheritTranslations)) + +#undef KeyCode +#define KeyCode XLIB_KeyCode //undef in intrinsics + +#define __Ol_OlXlibExt_h__ + +#include <salpdecl.h> +#include <salpmacr.h> + +#endif + diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx new file mode 100644 index 000000000000..99273531b565 --- /dev/null +++ b/vcl/unx/inc/saldata.hxx @@ -0,0 +1,180 @@ +/************************************************************************* + * + * $RCSfile: saldata.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SV_SALDATA_HXX +#define _SV_SALDATA_HXX + +// -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#include <signal.h> + +#ifndef _SALSTD_HXX +#include <salstd.hxx> +#endif +#ifndef _SV_SVDATA_HXX +#include <svdata.hxx> +#endif +#ifndef _SV_SALWTYPE_HXX +#include <salwtype.hxx> +#endif + +// -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +class SalXLib; +class SalDisplay; +class SalInstance; +class SalFrame; +class SalPrinter; + +// -=-= typedefs -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#ifndef SIG_PF +typedef void SIG_FUNC_TYP(int); +typedef SIG_FUNC_TYP *SIG_TYP; +#define SIG_PF SIG_TYP +#endif + +DECLARE_LIST( SalDisplays, SalDisplay* ) + +#if defined SCO || defined LINUX || defined NETBSD || defined AIX || defined HPUX || defined FREEBSD +#include <pthread.h> +#else +typedef unsigned int pthread_t; +#endif + +// -=-= SalData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +class SalData +{ + char** argv_; + int argc_; + String aBinaryPath_; + + SALTIMERPROC pTimerProc_; // timer callback proc + + SIG_TYP sig_[30]; + BOOL bNoExceptions_; + + SalXLib *pXLib_; + + SalDisplays SalDisplays_; + SalDisplay *pDefDisp_; + SalDisplay *pCurDisp_; + + pthread_t hMainThread_; +public: + SalInstance *pFirstInstance_; // pointer of first instance + SalFrame *pFirstFrame_; // pointer of first frame + +public: + SalData(); + ~SalData(); + + void Init( int *pArgc, char *ppArgv[] ); + + inline const XubString &GetFileName() const { return aBinaryPath_; } + inline USHORT GetCommandLineParamCount() const + { return argc_; } + XubString GetCommandLineParam( USHORT nParam ) const; + + long ShutDown() const; + long Close() const; + inline void XError( Display *pDisplay, + XErrorEvent *pEvent ) const; + + SalDisplay *GetDisplay( Display *pDisplay ); + inline SalDisplay *GetDisplay( long nDisplay ) const + { return SalDisplays_.GetObject(nDisplay); } + inline SalDisplay *GetDefDisp() const { return pDefDisp_; } + inline SalDisplay *GetCurDisp() const { return pCurDisp_; } + inline void SetDefDisp( SalDisplay *pDisp ) + { pDefDisp_ = pDisp; } + inline void SetCurDisp( SalDisplay *pDisp ) + { pCurDisp_ = pDisp; } + inline void Insert( SalDisplay *pDisplay ); + inline void Remove( SalDisplay *pDisplay ); + + inline SalXLib *GetLib() const { return pXLib_; } + inline pthread_t GetMainThread() const { return hMainThread_; } + + void StartTimer( ULONG nMS ); + inline void StopTimer(); + inline void SetCallback( SALTIMERPROC pProc ) + { pTimerProc_ = pProc; } + void Timeout() const; + +}; + +// -=-= inlines =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +inline void SetSalData( SalData* pData ) +{ ImplGetSVData()->mpSalData = (void*)pData; } + +inline SalData* GetSalData() +{ return (SalData*)ImplGetSVData()->mpSalData; } + +inline void SalData::Insert( SalDisplay *pDisplay ) +{ SalDisplays_.Insert( pDisplay ); } + +inline void SalData::Remove( SalDisplay *pDisplay ) +{ SalDisplays_.Remove( pDisplay ); } + +#ifdef _SV_SALDISP_HXX +inline void SalData::XError( Display *pDisplay, XErrorEvent *pEvent ) const +{ pXLib_->XError( pDisplay, pEvent ); } +#endif +#endif // _SV_SALDATA_HXX + diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx new file mode 100644 index 000000000000..40cafa2f54fd --- /dev/null +++ b/vcl/unx/inc/saldisp.hxx @@ -0,0 +1,589 @@ +/************************************************************************* + * + * $RCSfile: saldisp.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SV_SALDISP_HXX +#define _SV_SALDISP_HXX + +// -=-= exports =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +struct SalAppXResource; +class SalDisplay; +class SalICCCM; +class SalColormap; +class SalColormapRef; +class SalTrueColorConverter; +class SalVisual; +class SalXLib; +class SalImageList; +class SalBitmapList; + +// -=-= #includes =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#ifndef _SALUNX_H +#include <salunx.h> +#endif +#ifndef _SV_SALGTYPE_HXX +#include <salgtype.hxx> +#endif +#ifndef _SV_PTRSTYLE_HXX +#include <ptrstyle.hxx> +#endif + +// -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +class BitmapPalette; +class SalImage; +class SalBitmap; +class SalFrameData; +class ColorMask; +class SalSystemData; + +#ifndef _XSHM_H_ +struct XShmSegmentInfo; +#endif + +// -=-= typedefs -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +typedef struct _oslMutexImpl *oslThreadMutex; + +DECLARE_LIST( SalImageList, SalImage* ) +DECLARE_LIST( SalBitmapList,SalBitmap*) + +// -=-= #defines -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#define PROPERTY_SUPPORT_WM_SetPos 0x00000001 +#define PROPERTY_SUPPORT_WM_Screen 0x00000002 +#define PROPERTY_SUPPORT_WM_Parent_Pixmap_None 0x00000004 +#define PROPERTY_SUPPORT_WM_ClientPos 0x00000008 +#define PROPERTY_SUPPORT_XSetClipMask 0x00000010 // for bitmap ops. +#define PROPERTY_SUPPORT_3ButtonMouse 0x00000020 + +#define PROPERTY_BUG_XA_FAMILY_NAME_nil 0x00001000 +#define PROPERTY_BUG_XCopyArea_GXxor 0x00002000 // from window +#define PROPERTY_BUG_Stipple 0x00004000 // 0/1 inverted +#define PROPERTY_BUG_Tile 0x00008000 // Recreate the + // dither brush each time +#define PROPERTY_BUG_FillPolygon_Tile 0x00010000 // always Toggle Fillstyle +#define PROPERTY_BUG_DrawLine 0x00020000 // a DrawLine is one point to short +#define PROPERTY_BUG_CopyPlane_RevertBWPixel 0x00040000 // revert fg and bg for xcopyplane +#define PROPERTY_BUG_CopyArea_OnlySmallSlices 0x00080000 +#define PROPERTY_BUG_Bitmap_Bit_Order 0x00100000 + +#define PROPERTY_FEATURE_Maximize 0x01000000 +#define PROPERTY_FEATURE_SharedMemory 0x02000000 + +#define PROPERTY_DEFAULT 0x00000FCB + +// ------------------------------------------------------------------------ +// server vendor + +typedef enum { + vendor_none = 0, + vendor_attachmate, + vendor_excursion, + vendor_hp, + vendor_hummingbird, + vendor_ibm, + vendor_sco, + vendor_sgi, + vendor_sun, + vendor_xfree, + vendor_xinside, + vendor_xprinter, + vendor_unknown +} srv_vendor_t; + +extern "C" srv_vendor_t sal_GetServerVendor( Display *p_display ); + +// -=-= SalWM =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +enum SalWM { olwm, // Open Look + mwm, // Motif + kwm, // KDE Desktop Environment + _4Dwm, // SGI + vuewm, // HP + dtwm, // CDE + winmgr, // Oracle NC + twm, + fvwm, // ... + pmwm, // SCO + otherwm }; + +// -=-= SalICCCM =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +class SalICCCM +{ + unknown STDAPI( SalICCCM ) + +public: + Atom aWM_Protocols_; // Window manager + Atom aWM_State_; + Atom aWM_DeleteWindow_; + Atom aWM_SaveYourself_; + Atom aWM_Command_; + + Atom aQuitEvent_; // client message events + Atom aUserEvent_; + + inline int IsQuitEvent( Atom a ) const + { return aQuitEvent_ == a; } + inline int IsUserEvent( Atom a ) const + { return aUserEvent_ == a; } + inline int IsWM_State( Atom a ) const + { return aWM_State_ == a; } + inline int IsWM_DeleteWindow( Atom a ) const + { return aWM_DeleteWindow_ == a; } + inline int IsWM_Protocols( Atom a ) const + { return aWM_Protocols_ == a; } + inline int IsWM_SaveYourself( Atom a ) const + { return aWM_SaveYourself_ == a; } + inline int IsWM_Command( Atom a ) const + { return aWM_Command_ == a; } + + SalICCCM( SalDisplay *pDisplay ); +}; + +// -=-= SalRGB -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +// MSB/Bigendian Sicht (SalColor == RGB, r=0xFF0000, g=0xFF00, b=0xFF) + +enum SalRGB { RGB, RBG, + GBR, GRB, + BGR, BRG, + RGBA, RBGA, + GBRA, GRBA, + BGRA, BRGA, + other }; + +// -=-= SalVisual =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +class SalVisual : public XVisualInfo +{ + unknown STDAPI( SalVisual ) + + SalRGB eRGBMode_; + int nRedShift_; + int nGreenShift_; + int nBlueShift_; +public: + ~SalVisual(); + SalVisual( const XVisualInfo* pXVI ); + + inline VisualID GetVisualId() const { return visualid; } + inline Visual *GetVisual() const { return visual; } + inline int GetClass() const { return c_class; } + inline int GetDepth() const { return depth; } + inline SalRGB GetMode() const { return eRGBMode_; } + + Pixel GetTCPixel( SalColor nColor ) const; + SalColor GetTCColor( Pixel nPixel ) const; + BOOL Convert( int &n0, int &n1, int &n2, int &n3 ); // 32bit + BOOL Convert( int &n0, int &n1, int &n2 ); // 24bit +}; + +// -=-= SalColormap/SalColormapRef=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +class SalColormap : public SvRefBase +{ + unknown STDAPI( SalColormap ) + + SalDisplay *pDisplay_; + Colormap hColormap_; + SalColor *pPalette_; // Pseudocolor + SalVisual *pVisual_; + USHORT *pLookupTable_; // Pseudocolor: 12bit reduction + Pixel nWhitePixel_; + Pixel nBlackPixel_; + Pixel nUsed_; // Pseudocolor + + void GetPalette(); + void GetLookupTable(); +public: + SalColormap( SalDisplay *pSalDisplay, + Colormap hColormap ); + SalColormap( const BitmapPalette &rpPalette ); + SalColormap( USHORT nDepth ); + SalColormap(); + virtual ~SalColormap(); + + inline Colormap GetXColormap() const { return hColormap_; } + inline SalDisplay *GetDisplay() const { return pDisplay_; } + inline Display *GetXDisplay() const; + inline SalVisual *GetVisual() const; + inline Visual *GetXVisual() const; + inline Pixel GetWhitePixel() const { return nWhitePixel_; } + inline Pixel GetBlackPixel() const { return nBlackPixel_; } + inline Pixel GetUsed() const { return nUsed_; } + inline int GetClass() const; + + BOOL GetXPixels( XColor &rColor, + int r, + int g, + int b ) const; + inline BOOL GetXPixel( XColor &rColor, + int r, + int g, + int b ) const; + Pixel GetPixel( SalColor nColor ) const; + SalColor GetColor( Pixel nPixel ) const; + void SetPalette( const BitmapPalette &rPalette ); +}; + +SV_DECL_IMPL_REF( SalColormap ) + +// -=-= SalXLib =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +typedef int(*YieldFunc)(int fd, void* data); +struct YieldEntry; + +class SalXLib +{ + unknown STDAPI( SalXLib ) + + XtAppContext pApplicationContext_; + timeval Timeout_; + ULONG nTimeoutMS_; + int nStateOfYield_; + BOOL bWasXError_; + BOOL bIgnoreXErrors_; + int nFDs_; + fd_set *pReadFDS_; + fd_set *pExceptionFDS_; + YieldEntry *pYieldEntries_; +public: + SalXLib(); + ~SalXLib(); + void Init( int *pArgc, char *ppArgv[] ); + + void Yield( BOOL bWait ); + + void Insert( int fd, void* data, + YieldFunc pending, + YieldFunc queued, + YieldFunc handle ); + void Remove( int fd ); + + void XError( Display *pDisp, XErrorEvent *pEvent ); + inline BOOL WasXError() const { return bWasXError_; } + inline BOOL GetIgnoreXErrors() const { return bIgnoreXErrors_; } + inline void SetIgnoreXErrors( BOOL b ) + { bIgnoreXErrors_ = b; bWasXError_ = FALSE; } + + inline void StartTimer( ULONG nMS ); + inline void StopTimer(); + + inline XtAppContext GetAppContext() const + { return pApplicationContext_; } +}; + +// -=-= SalXEvent =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +struct SalXEvent +{ + SalXEvent *pNext_; // Stack + XEvent event_; +}; + +// -=-= SalDisplay -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +class SalI18N_InputMethod; +class SalI18N_KeyboardExtension; +class XlfdStorage; +class ExtendedFontStruct; +class ExtendedXlfd; +class AttributeProvider; +class SalUnicodeConverter; +class SalConverterCache; + +DECLARE_LIST( SalFontCache, ExtendedFontStruct* ) + +class SalDisplay +{ + unknown STDAPI( SalDisplay ) + + SalXLib *pXLib_; + SalI18N_InputMethod *mpInputMethod; + SalI18N_KeyboardExtension *mpKbdExtension; + + AttributeProvider *mpFactory; + XlfdStorage *mpFontList; + SalConverterCache *mpCvtCache; + + SalSystemData *mpSalSystemData; + // the one to get create and destroy notify events + + SalICCCM *pICCCM_; // Atoms + Display *pDisp_; // X Display + Screen *pScreen_; // XDefaultScreenOfDisplay + int nScreen_; // XDefaultScreen + SalVisual *pRootVisual_; // default visual of screen + XLIB_Window hRootWindow_; + Size aSize_; // Screen Size [pixel] + Pair aResolution_; // [dpi] + ULONG nMaxRequestSize_; // [byte] + + srv_vendor_t meServerVendor; + SalWM eWindowManager_; + ULONG nProperties_; // PROPERTY_SUPPORT, BUG, FEATURE + BOOL bLocal_; // Server==Client? Init + // in SalDisplay::IsLocal() + BOOL mbLocalIsValid; // bLocal_ is valid ? + ULONG nImageDepths_; // Supported Image Depths + ULONG nSharedImages_; // Supports MIT-SHM Extension + // until x bytes + + int nStateOfYield_; + int nStateOfSendEvent_; + oslThreadMutex hEventGuard_; + SalXEvent *pEventQueue_; // threaded user event queue + SalXEvent *pDispatchStack_; // Dispatch/Yield + + // SalFrame + Widget hShell_; // Application Shell Widget + Widget hComposite_; // the composite child of the shell + + XLIB_Cursor aPointerCache_[POINTER_COUNT]; + SalFrameData *pCapture_; + + // GDI + SalVisual *pVisual_; // Visual + XLIB_Window hRefWindow_; + GC pMonoGC_; + GC pCopyGC_; + GC pAndInvertedGC_; + GC pAndGC_; + GC pOrGC_; + GC pStippleGC_; + Pixmap hInvert50_; + SalColormapRef xColor_; + + SalFontCache *pFontCache_; + + int nBeepVolume_; // Sound + + // Keyboard + BOOL bNumLockFromXS_; // Num Lock handled by X Server + int nNumLockIndex_; // modifier index in modmap + int nNumLockMask_; // keyevent state mask for + KeySym nShiftKeySym_; // first shift modifier + KeySym nCtrlKeySym_; // first control modifier + KeySym nMod1KeySym_; // first mod1 modifier + ByteString m_aKeyboardName; + + SalBitmapList Bitmaps_; // to destroy bitmap resources; + + SalImageList SharedImages_; + + void DestroyFontCache(); + long Dispatch( XEvent *pEvent ); + +public: + static SalDisplay *GetSalDisplay( Display* display ); + static BOOL BestVisual( Display *pDisp, + int nScreen, + XVisualInfo &rVI ); + + SalDisplay( Widget w ); + SalDisplay( Display* pDisp, + Visual* pVisual = NULL, + Colormap aColMap = None ); + + ~SalDisplay(); + + void Init( Colormap hXColmap, const XVisualInfo* pXVI ); + + BOOL IsEvent(); + void SendEvent( Atom aEvent, + void *pData, + XLIB_Window hReceiver = 0 ) const; + void SendEvent( Atom aEvent, + UINT32 *pData = 0, + XLIB_Window hReceiver = 0 ) const; + void Yield( BOOL bWait ); + void PrintInfo() const; + + void PrintEvent( const ByteString &rComment, + XEvent *pEvent ) const; + + void AddFontPath( const ByteString &rPath ) const; + XlfdStorage* GetXlfdList(); + ExtendedFontStruct* + GetFont( ExtendedXlfd *pFont, int nPixelSize ); + + void Beep() const; + + void ModifierMapping(); + String GetKeyNameFromKeySym( KeySym keysym ) const; + XubString GetKeyName( USHORT nKeyCode ) const; + USHORT GetKeyCode( KeySym keysym, char*pcPrintable ) const; + KeySym GetKeySym( XKeyEvent *pEvent, + unsigned char *pPrintable, + int *pLen, + Status *pStatus, + XIC = NULL ) const; + + XLIB_Cursor GetPointer( int ePointerStyle ); + int CaptureMouse( SalFrameData *pCapture ); + + BOOL IsLocal(); + inline void Insert( SalBitmap *pBitmap ); + inline void Remove( SalBitmap *pBitmap ); + + inline SalImage *Seek( SalImage *pImage ); + inline void Insert( SalImage *pImage ); + inline void Remove( SalImage *pImage ); + void Remove( XEvent *pEvent ); + + inline XLIB_Window GetWindow() const + { return XtWindow( hComposite_ ); } + inline Widget GetWidget() const { return hComposite_; } + inline XLIB_Window GetShellWindow() const + { return XtWindow( hShell_ ); } + inline Widget GetShellWidget() const { return hShell_; } + + inline XLIB_Window GetRootWindow() const + { return hRootWindow_; } + inline XLIB_Window GetDrawable() const { return hRefWindow_; } + inline Display *GetDisplay() const { return pDisp_; } + inline int GetScreenNumber() const { return nScreen_; } + inline srv_vendor_t GetServerVendor() const { return meServerVendor; } + inline void SetServerVendor() { + meServerVendor = sal_GetServerVendor(pDisp_); } + inline BOOL IsDisplay() const { return !!pXLib_; } + inline SalICCCM &GetICCCM() const { return *pICCCM_; } + inline GC GetMonoGC() const { return pMonoGC_; } + inline GC GetCopyGC() const { return pCopyGC_; } + inline GC GetAndInvertedGC() const { return pAndInvertedGC_; } + inline GC GetAndGC() const { return pAndGC_; } + inline GC GetOrGC() const { return pOrGC_; } + inline GC GetStippleGC() const { return pStippleGC_; } + inline GC GetGC( USHORT nDepth ) const; + inline Pixmap GetInvert50() const { return hInvert50_; } + inline SalColormap &GetColormap() const { return *xColor_; } + inline SalVisual *GetVisual() const { return pVisual_; } + inline SalVisual *GetRootVisual() const { return pRootVisual_; } + inline const Size &GetScreenSize() const { return aSize_; } + inline const Pair &GetResolution() const { return aResolution_; } + inline ULONG GetProperties() const { return nProperties_; } + inline ULONG GetMaxRequestSize() const { return nMaxRequestSize_; } + inline ULONG GetImageDepths() const { return nImageDepths_; } + inline ULONG SupportsShm() const { return nSharedImages_; } + inline void DisableShm() { nSharedImages_ /= 2; } // = 0 + + inline BOOL MouseCaptured( const SalFrameData *pFrameData ) const + { return pCapture_ == pFrameData; } + inline SalXLib* GetXLib() { return pXLib_; } + + inline SalI18N_InputMethod* GetInputMethod() { return mpInputMethod; } + inline SalI18N_KeyboardExtension* GetKbdExtension() { return mpKbdExtension; } + inline void SetInputMethod( SalI18N_InputMethod *pInputMethod ) + { mpInputMethod = pInputMethod; } + inline void SetKbdExtension(SalI18N_KeyboardExtension *pKbdExtension) + { mpKbdExtension = pKbdExtension; } + const char* GetKeyboardName( BOOL bRefresh = FALSE ); + SalConverterCache* GetConverter() { return mpCvtCache; } +}; + +// -=-= inlines =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +inline void SalDisplay::Remove( SalBitmap *pBitmap ) +{ Bitmaps_.Remove( pBitmap ); } + +inline void SalDisplay::Insert( SalBitmap *pBitmap ) +{ Bitmaps_.Insert( pBitmap ); } + +inline SalImage *SalDisplay::Seek( SalImage *pImage ) +{ return SharedImages_.Seek( pImage ); } + +inline void SalDisplay::Remove( SalImage *pImage ) +{ SharedImages_.Remove( pImage ); } + +inline void SalDisplay::Insert( SalImage *pImage ) +{ SharedImages_.Insert( pImage ); } + +inline GC SalDisplay::GetGC( USHORT nDepth ) const +{ return 1 == nDepth + ? pMonoGC_ + : pVisual_->GetDepth() == nDepth + ? pCopyGC_ + : NULL; } + +inline Display *SalColormap::GetXDisplay() const +{ return pDisplay_->GetDisplay(); } + +inline SalVisual *SalColormap::GetVisual() const +{ return pVisual_ ? pVisual_ : pDisplay_->GetVisual(); } + +inline Visual *SalColormap::GetXVisual() const +{ return GetVisual()->GetVisual(); } + +inline int SalColormap::GetClass() const +{ return pVisual_ ? pVisual_->GetClass() : PseudoColor; } + +/*---------------------------------------------------------- + keep track of correct size of the initial window + */ +extern "C" { + +void MarkWindowAsBadPositioned ( unsigned int nWindow ); +void MarkWindowAsGoodPositioned ( unsigned int nWindow ); +Bool WindowNeedGoodPosition ( unsigned int nWindow ); + +} /* extern "C" */ + +// get foreign key names +namespace vcl_sal { + String getKeysymReplacementName( + const char* pKeyboard, + KeySym nSymbol ); +} + + +#endif // _SV_SALDISP_HXX + diff --git a/vcl/unx/inc/salfont.h b/vcl/unx/inc/salfont.h new file mode 100644 index 000000000000..aa6b2583e73c --- /dev/null +++ b/vcl/unx/inc/salfont.h @@ -0,0 +1,228 @@ +/************************************************************************* + * + * $RCSfile: salfont.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// +// // +// (C) 1997 Star Division GmbH, Hamburg, Germany // +// // +// $Revision: 1.1.1.1 $ $Author: hr $ $Date: 2000-09-18 17:05:41 $ // +// // +// $Workfile: salfont.h $ // +// $Modtime: 06 Sep 1997 15:11:06 $ // +// // +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// + +#ifndef _SV_SALFONT_H +#define _SV_SALFONT_H + +// -=-= exports =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +class SalFontCache; +struct SalFontDimension; +class SalFontFamily; +class SalFontFamilyList; +class SalFontStruct; +class SalFontStructList; +class SalFonts; + +// -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#ifndef _SALSTD_HXX +#include <salstd.hxx> +#endif +#ifndef _SV_OUTFONT_HXX +#include <outfont.hxx> +#endif + +// -=-= forwards =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +typedef ULONG XFP_FLAGS; + +class SalDisplay; +class SalFontCacheItem; + +// -=-= SalFontCache -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +DECLARE_LIST( SalFontCache, SalFontCacheItem* ) + +// -=-= SalFontDimension -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +struct SalFontDimension +{ + USHORT nHeight_; // [pixel] + USHORT nPtHeight_; // [point/10] + USHORT nAverage_; // [pixel/10] + USHORT nXRes_; // [dpi] + USHORT nYRes_; // [dpi] + USHORT nSlant_; // [pixel] +// size_t nUnderlineThickness_; // [pixel] +// size_t nUnderlinePosition_; // [pixel] +// size_t nStrikeoutAscent_; // [pixel] +// size_t nStrikeoutDescent_; // [pixel] +// Subscript, Superscript, Capital, Space ... + + inline SalFontDimension( USHORT nA = 0, USHORT nH = 0 ); + + inline BOOL IsScalable() const; + inline USHORT GetWidth() const { return (nAverage_ + 5) / 10; } + inline Size GetSize() const; + inline void SetSize( const Size & rSize ); + inline BOOL operator == ( const SalFontDimension &r ) const; + inline BOOL operator != ( const SalFontDimension &r ) const; + inline BOOL operator >= ( const SalFontDimension &r ) const; +}; + +inline SalFontDimension::SalFontDimension( USHORT nA, USHORT nH ) + : nHeight_( nH ), nAverage_( nA ) +{ nPtHeight_ = nXRes_ = nYRes_ = nSlant_ = 0; } + +inline BOOL SalFontDimension::IsScalable() const +{ return !nHeight_ && !nPtHeight_ && !nAverage_; } + +inline Size SalFontDimension::GetSize() const +{ return Size( (nAverage_ + 5) / 10, nHeight_ ); } + +inline void SalFontDimension::SetSize( const Size & rSize ) +{ nAverage_ = (USHORT)rSize.Width() * 10; nHeight_ = (USHORT)rSize.Height(); } + +inline BOOL SalFontDimension::operator == ( const SalFontDimension &r ) const +{ return nHeight_ == r.nHeight_ && (!r.nAverage_ || nAverage_ == r.nAverage_); } + +inline BOOL SalFontDimension::operator != ( const SalFontDimension &r ) const +{ return !(*this == r); } + +inline BOOL SalFontDimension::operator >= ( const SalFontDimension &r ) const +{ return nHeight_ > r.nHeight_ + || (nHeight_ == r.nHeight_ && nAverage_ >= r.nAverage_); } + +// -=-= SalFontStruct =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +class SalFontStruct : public ImplFontMetricData +{ + friend class SalDisplay; + friend class SalGraphicsData; + + SalFontCacheItem*pCache_; + +#if defined DEBUG || defined DBG_UTIL + ByteString aFontName_; +#endif + USHORT nHeightCount_; // Anzahl der Hoehen-Eintraege + SalFontDimension*pDimensions_; // Hoehen-Array + USHORT nWeight_; + + USHORT nFoundry_; // properties indexies + USHORT nFamily_; + USHORT nWeightName_; + USHORT nSlant_; + USHORT nSetWidthName_; + ByteString aAddStyleName_; + USHORT nSpacing_; + USHORT nCharSet_; + USHORT nFaceName_; + BOOL mbValidFontDescription; // valid xlfd entries + + void Init(); + BOOL Init( SalDisplay* pDisp, + const char* pFontName, + SalFontDimension& rDim ); + + ByteString GetXFontName( const SalFontDimension& ); + + inline void SetFoundry( USHORT n ) + { nFoundry_ = n; } + inline void SetFamily( USHORT n ) + { meFamily = sal_FamilyToSal( nFamily_ = n ); } + inline void SetWeightName( USHORT n ) + { meWeight = sal_WeightToSal( nWeightName_ = n ); } + inline void SetSlant( USHORT n ) + { meItalic = sal_ItalicToSal( nSlant_ = n ); } + inline void SetSetWidthName( USHORT n ) + { nSetWidthName_ = n; } + inline void SetAddStyleName( const ByteString& rAddStyle ) + { aAddStyleName_ = rAddStyle; aAddStyleName_.ToLowerAscii(); } + inline void SetSpacing( USHORT n ) + { mePitch = sal_PitchToSal( nSpacing_ = n ); } + inline void SetAverage( long n ) + { mnWidth = (n + 5) / 10; } + void SetCharSet( USHORT n ); + + SalFontStruct( const SalFontStruct& rFont ); +public: + SalFontStruct( SalDisplay* pDisp, + const char* pFontName, + SalFontDimension& rDim ); + + ~SalFontStruct(); + + inline void Cache( SalFontCacheItem *p ) { pCache_ = p; } + inline SalFontCacheItem*IsCache() const { return pCache_; } + inline BOOL IsScalable() const { return TYPE_SCALABLE==meType; } + inline SalFontDimension*GetDim() const { return pDimensions_; } + inline BOOL IsValid() const { return mbValidFontDescription; } +#ifdef DBG_UTIL + const ByteString& GetName() const { return aFontName_; } +#endif + + ImplFontData *GetDevFontData(); + SalFontCacheItem*Load( SalDisplay *pDisp, const SalFontDimension &rDim ); + CharSet GetCharSet() { return meCharSet; } + +}; + +// -=-= SalFontStructList =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +DECLARE_LIST( SalFontStructList, SalFontStruct* ) + +#endif // _SV_SALFONT_H + diff --git a/vcl/unx/inc/salframe.h b/vcl/unx/inc/salframe.h new file mode 100644 index 000000000000..f9bd325556e6 --- /dev/null +++ b/vcl/unx/inc/salframe.h @@ -0,0 +1,247 @@ +/************************************************************************* + * + * $RCSfile: salframe.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +//-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// +// // +// (C) 1997 Star Division GmbH, Hamburg, Germany // +// // +// $Revision: 1.1.1.1 $ $Author: hr $ $Date: 2000-09-18 17:05:41 $ // +// // +// $Workfile: salframe.h $ // +// $Modtime: 09 Sep 1997 17:29:12 $ // +// // +//-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// + +#ifndef _SV_SALFRAME_H +#define _SV_SALFRAME_H + +// -=-= #includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +#ifndef _SALSTD_HXX +#include <salstd.hxx> +#endif +#ifndef _SV_SALWTYPE_HXX +#include <salwtype.hxx> +#endif +#ifndef _SV_PTRSTYLE_HXX +#include <ptrstyle.hxx> +#endif + +#ifndef _LIST_HXX +#include <tools/list.hxx> +#endif + +#ifndef _SV_SALINST_HXX +#include <salinst.hxx> +#endif + +#ifndef _SV_SYSDATA_HXX +#include <sysdata.hxx> +#endif + +#include <salunx.h> + +// -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +class SalDisplay; +class SalGraphics; +class SalFrame; +class SalColormap; +class SalI18N_InputContext; + +// -=-= SalFrameData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +DECLARE_LIST( SalFrameList, SalFrame *); +class SalFrameData +{ + friend class SalFrame; + friend SalFrame* SalInstance::CreateFrame( SalFrame*, ULONG ); + friend SalFrame* SalInstance::CreateChildFrame( SystemParentData*, ULONG ); + + static Bool checkKeyReleaseForRepeat( Display*, XEvent*, XPointer pSalFrameData ); + + STDAPI( SalFrameData ) + + SalFrame *pNextFrame_; // pointer to next frame + SalFrame *pFrame_; + + SalFrame* mpParent; // pointer to parent frame + // which should never obscur this frame + SalFrameList maChildren; // List of child frames + + SALFRAMEPROC pProc_; // callback proc + void *pInst_; // instance handle for callback + + SalDisplay *pDisplay_; + Widget hShell_; + Widget hComposite_; + XLIB_Window hForeignParent_; + XLIB_Window hForeignTopLevelWindow_; + Widget hNoFullscreenShell_; + Widget hNoFullscreenComposite_; + // window to fall back to when no longer in fullscreen mode + + XLIB_Cursor hCursor_; + int nCaptured_; // is captured + + SalGraphics *pGraphics_; // current frame graphics + SalGraphics *pFreeGraphics_; // first free frame graphics + XLIB_Region pPaintRegion_; + + XLIB_Time nReleaseTime_; // timestamp of last key release + USHORT nKeyCode_; // last key code + USHORT nKeyState_; // last key state + int nCompose_; // compose state + + int nShowState_; // show state + int nLeft_; // left decoration size + int nTop_; // top decoration size + int nRight_; // right decoration size + int nBottom_; // bottom decoration size + int nMaxWidth_; // client max width + int nMaxHeight_; // client max height + int nWidth_; // client width + int nHeight_; // client height + Rectangle aPosSize_; // Shells Pos&Size + Rectangle aRestoreFullScreen_; + Rectangle aRestoreMaximize_; + USHORT nStyle_; + BOOL bAlwaysOnTop_; + BOOL bViewable_; + BOOL bMapped_; + BOOL bDefaultPosition_; // client is centered initially + int nVisibility_; + + int nScreenSaversTimeout_; + + SystemChildData maSystemChildData; + + SalI18N_InputContext *mpInputContext; + + SalGraphics *GetGraphics(); + + void GetPosSize( Rectangle &rPosSize ); + void SetSize ( const Size &rSize ); + void SetPosSize( const Rectangle &rPosSize ); + void Minimize(); + void Maximize(); + void Restore(); + void ShowFullScreen( BOOL bFullScreen ); + + void RepositionFloatChildren(); + + long HandleKeyEvent ( XKeyEvent *pEvent ); + long HandleMouseEvent ( XEvent *pEvent ); + long HandleFocusEvent ( XFocusChangeEvent *pEvent ); + long HandleExposeEvent ( XEvent *pEvent ); + long HandleSizeEvent ( XConfigureEvent *pEvent ); + long HandleColormapEvent ( XColormapEvent *pEvent ); + long HandleMapUnmapEvent ( XEvent *pEvent ); + long HandleStateEvent ( XPropertyEvent *pEvent ); + long HandleReparentEvent ( XReparentEvent *pEvent ); + long HandleClientMessage ( XClientMessageEvent*pEvent ); + + inline void CaptureMouse( BOOL bCapture ); + inline void SetPointer( PointerStyle ePointerStyle ); + + inline SalFrameData( SalFrame *pFrame ); + inline ~SalFrameData(); +public: + long Dispatch( XEvent *pEvent ); + void Init( USHORT nSalFrameStyle, SystemParentData* pParentData = NULL ); + + SalDisplay *GetDisplay() const { return pDisplay_; } + inline Display *GetXDisplay() const; + inline XLIB_Window GetDrawable() const; + inline XLIB_Window GetWindow() const { return XtWindow( hComposite_ ); } + inline Widget GetWidget() const { return hComposite_; } + inline XLIB_Window GetShellWindow() const { return XtWindow( hShell_ ); } + inline Widget GetShellWidget() const { return hShell_; } + inline XLIB_Window GetForeignParent() const { return hForeignParent_; } + inline XLIB_Window GetForeignTopLevelWindow() const { return hForeignTopLevelWindow_; } + inline long ShutDown() const + { return pProc_( pInst_, pFrame_, SALEVENT_SHUTDOWN, 0 ); } + inline long Close() const + { return pProc_( pInst_, pFrame_, SALEVENT_CLOSE, 0 ); } + inline long Call( USHORT nEvent, const void *pEvent ) const + { return pProc_( pInst_, pFrame_, nEvent, pEvent ); } + inline SalFrame *GetNextFrame() const { return pNextFrame_; } + inline XLIB_Cursor GetCursor() const { return hCursor_; } + inline BOOL IsCaptured() const { return nCaptured_ == 1; } + inline BOOL IsWaitingForExpose() const + { return !!pPaintRegion_; } + inline SalColormap &GetColormap() const; +}; + +#ifdef _SV_SALDISP_HXX + +inline void SalFrameData::CaptureMouse( BOOL bCapture ) +{ nCaptured_ = pDisplay_->CaptureMouse( bCapture ? this : NULL ); } + +inline Display *SalFrameData::GetXDisplay() const +{ return pDisplay_->GetDisplay(); } + +inline XLIB_Window SalFrameData::GetDrawable() const +{ return GetWindow(); } + +inline SalColormap &SalFrameData::GetColormap() const +{ return pDisplay_->GetColormap(); } + +#endif + +#endif // _SV_SALFRAME_H + diff --git a/vcl/unx/inc/salgdi.h b/vcl/unx/inc/salgdi.h new file mode 100644 index 000000000000..eaa0651a3cd7 --- /dev/null +++ b/vcl/unx/inc/salgdi.h @@ -0,0 +1,320 @@ +/************************************************************************* + * + * $RCSfile: salgdi.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +// *=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// +// // +// (C) 1997 Star Division GmbH, Hamburg, Germany // +// // +// $Revision: 1.1.1.1 $ $Author: hr $ $Date: 2000-09-18 17:05:41 $ // +// // +// $Workfile: salgdi.h $ // +// $Modtime: 10 Sep 1997 11:55:36 $ // +// // +// *=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// + +#ifndef _SV_SALGDI_H +#define _SV_SALGDI_H + +// -=-= exports -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +class SalFontCacheItem; +class SalGraphicsContext; +class SalGraphicsData; + +// -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#ifndef _SALSTD_HXX +#include <salstd.hxx> +#endif +#ifndef _SV_SALGTYPE_HXX +#include <salgtype.hxx> +#endif +#ifndef _FRACT_HXX +#include <tools/fract.hxx> +#endif + +#include "xfont.hxx" + +// -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +struct ImplFontMetricData; +struct ImplFontSelectData; +class SalBitmap; +class SalColormap; +class SalDisplay; +class SalFrame; +class SalVirtualDevice; +class SalPolyLine; + +#ifndef _SV_SALDISP_HXX +typedef SalColormap *SalColormapRef; +#endif + +// -=-= SalGraphicsData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +class SalGraphicsData +{ + friend class SalGraphics; + + STDAPI( SalGraphicsData ) + + SalColormapRef xColormap_; + Drawable hDrawable_; // use + + XLIB_Region pPaintRegion_; + XLIB_Region pClipRegion_; + + GC pPenGC_; // Pen attributes + SalColor nPenColor_; + Pixel nPenPixel_; + + GC pFontGC_; // Font attributes + ExtendedFontStructRef xFont_; + Fraction aScale_; + SalColor nTextColor_; + Pixel nTextPixel_; + short nFontOrientation_; + + GC pBrushGC_; // Brush attributes + SalColor nBrushColor_; + Pixel nBrushPixel_; + Pixmap hBrush_; // Dither + + GC pMonoGC_; + GC pCopyGC_; + GC pMaskGC_; + GC pInvertGC_; + GC pInvert50GC_; + GC pStippleGC_; + GC pTrackingGC_; + + BOOL bWindow_ : 1; // is Window + BOOL bPrinter_ : 1; // is Printer + BOOL bVirDev_ : 1; // is VirDev + BOOL bPenGC_ : 1; // is Pen GC valid + BOOL bFontGC_ : 1; // is Font GC valid + BOOL bBrushGC_ : 1; // is Brush GC valid + BOOL bMonoGC_ : 1; // is Mono GC valid + BOOL bCopyGC_ : 1; // is Copy GC valid + BOOL bInvertGC_ : 1; // is Invert GC valid + BOOL bInvert50GC_ : 1; // is Invert50 GC valid + BOOL bStippleGC_ : 1; // is Stipple GC valid + BOOL bTrackingGC_ : 1; // is Tracking GC valid + BOOL bXORMode_ : 1; // is ROP XOR Mode set + BOOL bDitherBrush_ : 1; // is solid or tile + + void SetClipRegion( GC pGC, + XLIB_Region pXReg = NULL ) const; + + +#if defined(_SV_SALGDI_CXX) || defined (_SV_SALGDI2_CXX) + GC GetTrackingGC(); + GC GetInvertGC(); + GC GetInvert50GC(); + GC CreateGC( Drawable hDrawable, + unsigned long nMask = GCGraphicsExposures ); +#endif + +#if defined _SV_SALGDI_CXX + GC SelectPen(); + GC SelectBrush(); + void DrawLines( ULONG nPoints, + const SalPolyLine &rPoints, + GC pGC ); + BOOL GetDitherPixmap ( SalColor nSalColor ); +#endif + +#if defined _SV_SALGDI2_CXX + + inline GC GetMonoGC( Pixmap hPixmap ); + inline GC GetCopyGC(); + inline GC GetStippleGC(); + + int Clip ( XLIB_Region pRegion, + int &nX, + int &nY, + unsigned int &nDX, + unsigned int &nDY, + int &nSrcX, + int &nSrcY ) const; + int Clip ( int &nX, + int &nY, + unsigned int &nDX, + unsigned int &nDY, + int &nSrcX, + int &nSrcY ) const; + GC SetMask ( int &nX, + int &nY, + unsigned int &nDX, + unsigned int &nDY, + int &nSrcX, + int &nSrcY, + Pixmap hClipMask ); + void DrawBitmap( const SalTwoRect *pPosAry, + SalGraphics *pThis, + const SalBitmap &rSalBitmap, + const SalBitmap &rTransparentBitmap, + SalColor nTransparentColor ); +#endif + +#if defined _SV_SALGDI3_CXX + GC SelectFont(); + + void SetFont( const ImplFontSelectData* pEntry ); + void DrawText( long nX, + long nY, + const xub_Unicode* pStr, + USHORT nLen, + const long* pDXAry ); + void DrawText( long nX, + long nY, + const xub_Unicode* pStr, + USHORT nLen ); +#endif +public: + SalGraphicsData(); + ~SalGraphicsData(); + + void Init( SalFrame *pFrame ); + void Init( SalVirtualDevice *pVirtualDevice, + SalGraphics *pSalGraphics ); + void Init( class ImplSalPrinterData *pPrinter ); + void DeInit(); + + inline SalDisplay *GetDisplay() const; + inline Display *GetXDisplay() const; + inline Drawable GetDrawable() const { return hDrawable_; } + inline void SetDrawable( Drawable d ) { hDrawable_ = d; } + inline SalColormap &GetColormap() const { return *xColormap_; } + inline BOOL IsCompatible( USHORT nDepth, + SalColormap *pMap ) const; + inline Pixel GetPixel( SalColor nSalColor ) const; +}; + +#ifdef _SV_SALDATA_HXX + +inline SalDisplay *SalGraphicsData::GetDisplay() const +{ return GetColormap().GetDisplay(); } + +inline Display *SalGraphicsData::GetXDisplay() const +{ return GetColormap().GetXDisplay(); } + +inline BOOL SalGraphicsData::IsCompatible( USHORT nDepth, + SalColormap *pMap ) const +{ + return (GetDisplay()->GetImageDepths() & (1 << (nDepth-1))) != 0 + && &xColormap_ == pMap; +} + +inline Pixel SalGraphicsData::GetPixel( SalColor nSalColor ) const +{ return GetColormap().GetPixel( nSalColor ); } + +#endif + +// -=-= Shortcuts =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#if defined _SV_SALGDI_CXX || defined _SV_SALGDI2_CXX || defined _SV_SALGDI3_CXX +#define _GetXDisplay() maGraphicsData.GetXDisplay() +#define _GetDisplay() maGraphicsData.GetDisplay() +#define _GetVisual() maGraphicsData.GetDisplay()->GetVisual() +#define _GetDrawable() maGraphicsData.hDrawable_ +#define _GetColormap() maGraphicsData.GetColormap() +#define _GetClipRegion() maGraphicsData.pClipRegion_ +#define _GetPenPixel() maGraphicsData.nPenPixel_ +#define _GetTextPixel() maGraphicsData.nTextPixel_ +#define _GetBrushPixel() maGraphicsData.nBrushPixel_ +#define _GetPenColor() maGraphicsData.nPenColor_ +#define _GetTextColor() maGraphicsData.nTextColor_ +#define _GetBrushColor() maGraphicsData.nBrushColor_ +#define _GetPixel(n) maGraphicsData.GetPixel( n ) +#define _GetColor(n) maGraphicsData.GetColormap().GetColor( n ) +#define _IsPenGC() maGraphicsData.bPenGC_ +#define _IsFontGC() maGraphicsData.bFontGC_ +#define _IsBrushGC() maGraphicsData.bBrushGC_ +#define _IsMonoGC() maGraphicsData.bMonoGC_ +#define _IsCopyGC() maGraphicsData.bCopyGC_ +#define _IsInvertGC() maGraphicsData.bInvertGC_ +#define _IsInvert50GC() maGraphicsData.bInvert50GC_ +#define _IsStippleGC() maGraphicsData.bStippleGC_ +#define _IsTrackingGC() maGraphicsData.bTrackingGC_ +#define _IsXORMode() maGraphicsData.bXORMode_ +#define _IsWindow() maGraphicsData.bWindow_ +#define _IsPrinter() maGraphicsData.bPrinter_ +#define _IsVirtualDevice() maGraphicsData.bVirDev_ +#define _IsDitherBrush() maGraphicsData.bDitherBrush_ +#define _SelectPen() maGraphicsData.SelectPen() +#define _SelectBrush() maGraphicsData.SelectBrush() +#define _GetTrackingGC() maGraphicsData.GetTrackingGC() +#endif + +#ifdef DBG_UTIL +#define stderr0( s ) fprintf( stderr, s ) +#define stderr1( s, a ) fprintf( stderr, s, a ) +#define stderr2( s, a, b ) fprintf( stderr, s, a, b ) +#define stderr3( s, a, b, c ) fprintf( stderr, s, a, b, c ) +#define stdass0( b ) (void)( !(b) \ + ? fprintf( stderr, "\"%s\" (%s line %d)\n", \ + #b, __FILE__, __LINE__ ) \ + : 0 ) +#else +#define stderr0( s ) nop +#define stderr1( s, a ) nop +#define stderr2( s, a, b ) nop +#define stderr3( s, a, b, c ) nop +#define stdass0( b ) nop +#endif +#endif // _SV_SALGDI_H + diff --git a/vcl/unx/inc/salinst.h b/vcl/unx/inc/salinst.h new file mode 100644 index 000000000000..88d471eeae6d --- /dev/null +++ b/vcl/unx/inc/salinst.h @@ -0,0 +1,115 @@ +/************************************************************************* + * + * $RCSfile: salinst.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// +// // +// (C) 1997 Star Division GmbH, Hamburg, Germany // +// // +// $Revision: 1.1.1.1 $ $Author: hr $ $Date: 2000-09-18 17:05:41 $ // +// // +// $Workfile: salinst.h $ // +// $Modtime: 17 Jul 1997 17:21:10 $ // +// // +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// + +// -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#ifndef _SV_SALINST_H +#define _SV_SALINST_H + +#ifndef _SV_SV_H +#include <sv.h> +#endif +#ifndef _VOS_MUTEX_HXX +#include <vos/mutex.hxx> +#endif +#ifndef _VOS_THREAD_HXX +#include <vos/thread.hxx> +#endif + +class SalYieldMutex : public NAMESPACE_VOS(OMutex) +{ + ULONG mnCount; + NAMESPACE_VOS(OThread)::TThreadIdentifier mnThreadId; + +public: + SalYieldMutex(); + + virtual void acquire(); + virtual void release(); + virtual sal_Bool tryToAcquire(); + + ULONG GetAcquireCount() const { return mnCount; } + NAMESPACE_VOS(OThread)::TThreadIdentifier GetThreadId() const { return mnThreadId; } +}; + +// -=-= SalInstanceData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +class SalInstanceData +{ + friend class SalInstance; + +public: + + void* mpFilterInst; + void* mpFilterCallback; + SalYieldMutex* mpSalYieldMutex; +}; + +#endif // _SV_SALINST_H + diff --git a/vcl/unx/inc/salobj.h b/vcl/unx/inc/salobj.h new file mode 100644 index 000000000000..6e0823261644 --- /dev/null +++ b/vcl/unx/inc/salobj.h @@ -0,0 +1,135 @@ +/************************************************************************* + * + * $RCSfile: salobj.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SV_SALOBJ_H +#define _SV_SALOBJ_H + +#ifndef _SV_SV_H +#include <sv.h> +#endif +#ifndef _SV_SYSDATA_HXX +#include <sysdata.hxx> +#endif +#ifndef _LIST_HXX +#include <tools/list.hxx> +#endif + + +// ----------------- +// - SalObjectData - +// ----------------- + +class SalObject; + +DECLARE_LIST( SalObjectList, SalObject* ); + +class SalClipRegion +{ + +public: + + SalClipRegion(); + ~SalClipRegion(); + + void BeginSetClipRegion( ULONG nRects ); + void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ); + + XRectangle *EndSetClipRegion() { + return ClipRectangleList; } + void ResetClipRegion() { + numClipRectangles = 0; } + USHORT GetClipRegionType() { + return nClipRegionType; } + void SetClipRegionType( USHORT nType ) { + nClipRegionType = nType; } + int GetRectangleCount() { + return numClipRectangles; } + +private: + + XRectangle* ClipRectangleList; + int numClipRectangles; + int maxClipRectangles; + USHORT nClipRegionType; +}; + + +class SalObjectData +{ + friend class SalObject; + friend class SalDisplay; + friend class SalInstance; + + static SalObjectList aAllObjects; + + SystemChildData maSystemChildData; + Widget maPrimary; + Widget maSecondary; + SalClipRegion maClipRegion; + void* mpInst; + SALOBJECTPROC mpProc; + SalObject* mpSalObject; + BOOL mbVisible; + + static long Dispatch( XEvent* pEvent ); +}; + +#endif // _SV_SALOBJ_H diff --git a/vcl/unx/inc/salprn.h b/vcl/unx/inc/salprn.h new file mode 100644 index 000000000000..d51174f52f72 --- /dev/null +++ b/vcl/unx/inc/salprn.h @@ -0,0 +1,133 @@ +/************************************************************************* + * + * $RCSfile: salprn.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SV_SALPRN_H +#define _SV_SALPRN_H + +#ifndef _SALSTD_HXX +#include <salstd.hxx> +#endif + +#ifndef _SV_PRNTYPES_HXX +#include <prntypes.hxx> +#endif + +#include <ppdparser.hxx> + +// forward declarations +class SalInfoPrinter; + +class SalPrinterQueueInfo; +class ImplJobSetup; + +class ImplSalPrinterData; + + +// class declarations + + +class SalInfoPrinterData +{ + friend class SalInfoPrinter; + friend class SalPrinterData; + + ImplSalPrinterData* mpImplData; + + inline SalInfoPrinterData(); + inline ~SalInfoPrinterData(); + +public: + + inline void Init( SalPrinterQueueInfo* pQueueInfo, + ImplJobSetup* pJobSetup); +}; + + +// -=-= SalPrinterData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +class SalPrinterData +{ + friend class SalPrinter; + + ImplSalPrinterData* mpImplData; + + BOOL mbJobStarted; // is job started + BOOL mbPageStarted; // is page started + XubString* mpFileName; // print to file + int mnError; // error code + BOOL mbAbort:1; // is job aborted + BOOL mbFirstPage:1; // false after first startpage + int mnDelTime; // time in h to wait before disposing temp file + + inline SalPrinterData(); + inline ~SalPrinterData(); + +public: + inline void Init( SalInfoPrinter* pInfoPrinter ); +}; + + +// necessary to get changes in Xpdefaults +void StartPrinterListening(); +void StopPrinterListening(); + +#endif // _SV_SALPRN_H + + diff --git a/vcl/unx/inc/salstd.hxx b/vcl/unx/inc/salstd.hxx new file mode 100644 index 000000000000..dea0c8f4fd9b --- /dev/null +++ b/vcl/unx/inc/salstd.hxx @@ -0,0 +1,127 @@ +/************************************************************************* + * + * $RCSfile: salstd.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SALSTD_HXX +#define _SALSTD_HXX + +// -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#ifndef _REF_HXX +#include <tools/ref.hxx> +#endif +#ifndef _STRING_HXX +#include <tools/string.hxx> +#endif +#ifndef _GEN_HXX +#include <tools/gen.hxx> +#endif +#ifndef _SV_SV_H +#include <sv.h> +#endif + +// -=-= #defines -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#ifndef STDAPI +#define STDAPI(Class) int operator != ( const Class& ) const; \ + int operator == ( const Class& ) const; \ + Class &operator = ( const Class& ); \ + Class( const Class& ); +#endif + +// -=-= X-Lib forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#ifndef _SVUNX_H +typedef unsigned long Pixel; +typedef unsigned long XID; +typedef unsigned long XLIB_Time; +typedef unsigned long XtIntervalId; + +typedef XID Colormap; +typedef XID Drawable; +typedef XID Pixmap; +typedef XID XLIB_Cursor; +typedef XID XLIB_Font; +typedef XID XLIB_Window; + +typedef struct _XDisplay Display; +typedef struct _XGC *GC; +typedef struct _XImage XImage; +typedef struct _XRegion *XLIB_Region; + +typedef union _XEvent XEvent; + +typedef struct _XConfigureEvent XConfigureEvent; +typedef struct _XReparentEvent XReparentEvent; +typedef struct _XClientMessageEvent XClientMessageEvent; +typedef struct _XErrorEvent XErrorEvent; + +struct Screen; +struct Visual; +struct XColormapEvent; +struct XFocusChangeEvent; +struct XFontStruct; +struct XKeyEvent; +struct XPropertyEvent; +struct XTextItem; +struct XWindowChanges; + +#define None 0L +#endif + +#endif + diff --git a/vcl/unx/inc/salsys.h b/vcl/unx/inc/salsys.h new file mode 100644 index 000000000000..8c35029d38e7 --- /dev/null +++ b/vcl/unx/inc/salsys.h @@ -0,0 +1,89 @@ +/************************************************************************* + * + * $RCSfile: salsys.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SV_SALSYS_H +#define _SV_SALSYS_H + +class DtIntegrator; +class SalSystemData; +class SalFrame; +class SalDisplay; + +// ----------------- +// - SalSystemData - +// ----------------- + +class SalSystemData +{ + friend class SalSystem; + private: + SalDisplay* m_pSalDisplay; + DtIntegrator* m_pDtIntegrator; + void CreateDtIntegrator( SalFrame* ); + public: + SalSystemData() : m_pSalDisplay( 0 ) {} + ~SalSystemData(); + + void SetSalDisplay( SalDisplay * ); +}; + + +#endif // _SV_SALSYS_H diff --git a/vcl/unx/inc/salunx.h b/vcl/unx/inc/salunx.h new file mode 100644 index 000000000000..14aa26f70945 --- /dev/null +++ b/vcl/unx/inc/salunx.h @@ -0,0 +1,190 @@ +/************************************************************************* + * + * $RCSfile: salunx.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// +// // +// (C) 1997 Star Division GmbH, Hamburg, Germany // +// // +// $Revision: 1.1.1.1 $ $Author: hr $ $Date: 2000-09-18 17:05:41 $ // +// // +// $Workfile: salunx.h $ // +// $Modtime: 14 Aug 1997 13:51:48 $ // +// // +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// + +#ifndef _SALUNX_H +#define _SALUNX_H + +// -=-= #includes =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#if defined SCO || defined LINUX || defined HPUX || defined FREEBSD +#include <sys/time.h> +#elif defined NETBSD +#include <unistd.h> +#elif defined AIX +#include <time.h> +#include <sys/time.h> +#include <strings.h> +#elif defined IRIX +#include <sys/time.h> +#include <unistd.h> +#endif + +#ifndef _SVUNX_H +#include <svunx.h> +#endif +#ifndef _SALSTD_HXX +#include <salstd.hxx> +#endif + +// -=-= #defines -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +#define persist +#define final +#define beta +#define alpha +#define unknown +#define nop ((void*)0) +#define nobreak ((void*)0) + +#define capacityof(a) (sizeof(a)/sizeof(*a)) + +// -=-= inlines =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +inline long Divide( long nDividend, long nDivisor ) +{ return (nDividend + nDivisor/2) / nDivisor; } + +inline long DPI( long pixel, long mm ) +{ return Divide( pixel*254, mm*10 ); } + +// -=-= timeval =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +inline int operator >= ( const timeval &t1, const timeval &t2 ) +{ + if( t1.tv_sec == t2.tv_sec ) + return t1.tv_usec >= t2.tv_usec; + return t1.tv_sec > t2.tv_sec; +} + +inline int operator > ( const timeval &t1, const timeval &t2 ) +{ + if( t1.tv_sec == t2.tv_sec ) + return t1.tv_usec > t2.tv_usec; + return t1.tv_sec > t2.tv_sec; +} + +inline int operator == ( const timeval &t1, const timeval &t2 ) +{ + if( t1.tv_sec == t2.tv_sec ) + return t1.tv_usec == t2.tv_usec; + return FALSE; +} + +inline timeval &operator -= ( timeval &t1, const timeval &t2 ) +{ + if( t1.tv_usec < t2.tv_usec ) + { + t1.tv_sec--; + t1.tv_usec += 1000000; + } + t1.tv_sec -= t2.tv_sec; + t1.tv_usec -= t2.tv_usec; + return t1; +} + +inline timeval &operator += ( timeval &t1, const timeval &t2 ) +{ + t1.tv_sec += t2.tv_sec; + t1.tv_usec += t2.tv_usec; + if( t1.tv_usec > 1000000 ) + { + t1.tv_sec++; + t1.tv_usec -= 1000000; + } + return t1; +} + +inline timeval &operator += ( timeval &t1, ULONG t2 ) +{ + t1.tv_sec += t2 / 1000; + t1.tv_usec += t2 ? (t2 % 1000) * 1000 : 500; + if( t1.tv_usec > 1000000 ) + { + t1.tv_sec++; + t1.tv_usec -= 1000000; + } + return t1; +} + +inline timeval operator + ( const timeval &t1, const timeval &t2 ) +{ + timeval t0 = t1; + return t0 += t2; +} + +inline timeval operator + ( const timeval &t1, ULONG t2 ) +{ + timeval t0 = t1; + return t0 += t2; +} + +inline timeval operator - ( const timeval &t1, const timeval &t2 ) +{ + timeval t0 = t1; + return t0 -= t2; +} +#endif + diff --git a/vcl/unx/inc/salvd.h b/vcl/unx/inc/salvd.h new file mode 100644 index 000000000000..5f51d6009f31 --- /dev/null +++ b/vcl/unx/inc/salvd.h @@ -0,0 +1,135 @@ +/************************************************************************* + * + * $RCSfile: salvd.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// +// // +// (C) 1997 Star Division GmbH, Hamburg, Germany // +// // +// $Revision: 1.1.1.1 $ $Author: hr $ $Date: 2000-09-18 17:05:41 $ // +// // +// $Workfile: salvd.h $ // +// $Modtime: 09 Aug 1997 00:15:48 $ // +// // +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// + +#ifndef _SV_SALVD_H +#define _SV_SALVD_H + +// -=-= #includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +#ifndef _SALSTD_HXX +#include <salstd.hxx> +#endif + +// -=-= forwards -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +class SalDisplay; +class SalGraphics; +class SalVirtualDevice; + +// -=-= SalVirDevData -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +class SalVirDevData +{ + friend class SalVirtualDevice; + + SalDisplay *pDisplay_; + SalGraphics *pGraphics_; // current frame graphics + + Pixmap hDrawable_; + + int nDX_; + int nDY_; + USHORT nDepth_; + BOOL bGraphics_; // is Graphics used + + inline SalVirDevData(); + inline ~SalVirDevData(); + +public: + BOOL Init( SalDisplay *pDisplay, + long nDX, long nDY, + USHORT nBitCount ); + inline void InitGraphics( SalVirtualDevice *pVD, + SalGraphics *pGraphics ); + + inline Display *GetXDisplay() const; + inline SalDisplay *GetDisplay() const; + inline BOOL IsDisplay() const; + inline Pixmap GetDrawable() const { return hDrawable_; } + inline USHORT GetDepth() const { return nDepth_; } +}; + +#ifdef _SV_SALDISP_HXX + +inline void SalVirDevData::InitGraphics( SalVirtualDevice *pVD, + SalGraphics *pGraphics ) +{ pGraphics_->maGraphicsData.Init( pVD, pGraphics ); } + +inline Display *SalVirDevData::GetXDisplay() const +{ return pDisplay_->GetDisplay(); } + +inline SalDisplay *SalVirDevData::GetDisplay() const +{ return pDisplay_; } + +inline BOOL SalVirDevData::IsDisplay() const +{ return pDisplay_->IsDisplay(); } + +#endif + +#endif // _SV_SALVD_H + diff --git a/vcl/unx/inc/sm.hxx b/vcl/unx/inc/sm.hxx new file mode 100644 index 000000000000..aae6fe6311e7 --- /dev/null +++ b/vcl/unx/inc/sm.hxx @@ -0,0 +1,112 @@ +/************************************************************************* + * + * $RCSfile: sm.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _VCL_SM_HXX +#define _VCL_SM_HXX + +#include <salunx.h> +#include <X11/SM/SMlib.h> + +class ICEConnectionObserver +{ + static BOOL bIsWatching; + + static void ICEWatchProc( IceConn connection, IcePointer client_data, + Bool opening, IcePointer* watch_data ); +public: + + // YieldProcs for SalDisplay + static int Pending( int fd, void* data ); + static int Queued( int fd, void* data ); + static int HandleEvents( int fd, void* data ); + + static void activate(); + static void deactivate(); +}; + +class SessionManagerClient +{ + static SmcConn aSmcConnection; + static char* pClientID; + + static void SaveYourselfProc( SmcConn connection, + SmPointer client_data, + int save_type, + Bool shutdown, + int interact_style, + Bool fast ); + static void DieProc( SmcConn connection, + SmPointer client_data ); + static void SaveCompleteProc( SmcConn connection, + SmPointer client_data ); + static void ShutdownCanceledProc( SmcConn connection, + SmPointer client_data ); + + static char* getPreviousSessionID(); + static void setPreviousSessionID( const ByteString& ); +public: + static void open(); + static void close(); + + static String getExecName(); + static char* getSessionID() { return pClientID; } +}; + +#endif diff --git a/vcl/unx/inc/soicon.hxx b/vcl/unx/inc/soicon.hxx new file mode 100644 index 000000000000..d282f5bb5b61 --- /dev/null +++ b/vcl/unx/inc/soicon.hxx @@ -0,0 +1,74 @@ +/************************************************************************* + * + * $RCSfile: soicon.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _SV_SOICON_HXX +#define _SV_SOICON_HXX + +class SalDisplay; +class SalBitmap; +class Bitmap; + +Pixmap GetAppIconPixmap( SalDisplay* ); +Pixmap GetAppIconMask( SalDisplay* ); + +BOOL ReadXPMFile( Display*, const String&, SalBitmap*&, SalBitmap*& ); +BOOL ReadXBMFile( Display*, const String&, SalBitmap*& ); + +#endif diff --git a/vcl/unx/inc/strhelper.hxx b/vcl/unx/inc/strhelper.hxx new file mode 100644 index 000000000000..dbfce8794143 --- /dev/null +++ b/vcl/unx/inc/strhelper.hxx @@ -0,0 +1,77 @@ +/************************************************************************* + * + * $RCSfile: strhelper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _SV_STRHELPER_HXX +#define _SV_STRHELPER_HXX +#ifndef _STRING_HXX +#include <tools/string.hxx> +#endif + +String GetCommandLineToken( int, const String& ); +// gets one token of a unix command line style string +// doublequote, singlequote and singleleftquote protect their respective +// contents + +int GetCommandLineTokenCount( const String& ); +// returns number of tokens (zero if empty or whitespace only) + +String WhitespaceToSpace( const String&, BOOL bProtect = TRUE ); + +#endif diff --git a/vcl/unx/inc/svsys.h b/vcl/unx/inc/svsys.h new file mode 100644 index 000000000000..b20e1b39328f --- /dev/null +++ b/vcl/unx/inc/svsys.h @@ -0,0 +1,68 @@ +/************************************************************************* + * + * $RCSfile: svsys.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _SV_SVSYS_H +#define _SV_SVSYS_H + +#ifndef _SVUNX_H +#include <svunx.h> +#endif + +#endif // _SV_SVSYS_H diff --git a/vcl/unx/inc/svunx.h b/vcl/unx/inc/svunx.h new file mode 100644 index 000000000000..5517045a4d9b --- /dev/null +++ b/vcl/unx/inc/svunx.h @@ -0,0 +1,83 @@ +/************************************************************************* + * + * $RCSfile: svunx.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// +// // +// (C) 1997 Star Division GmbH, Hamburg, Germany // +// // +// $Revision: 1.1.1.1 $ $Author: hr $ $Date: 2000-09-18 17:05:41 $ // +// // +// $Workfile: svunx.h $ // +// $Modtime: 17 Jul 1997 17:20:22 $ // +// // +//*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-*=*-// + +#ifndef _SVUNX_H +#define _SVUNX_H + +#ifndef _PREX_H +#include <prex.h> +#endif +#ifndef _POSTX_H +#include <postx.h> +#endif + +#endif + diff --git a/vcl/unx/inc/xfont.hxx b/vcl/unx/inc/xfont.hxx new file mode 100644 index 000000000000..b89612b57e67 --- /dev/null +++ b/vcl/unx/inc/xfont.hxx @@ -0,0 +1,133 @@ +/************************************************************************* + * + * $RCSfile: xfont.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:41 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef EXTENDED_FONTSTRUCT_HXX +#define EXTENDED_FONTSTRUCT_HXX + +#ifndef _XLIB_H_ +#include <X11/Xlib.h> +#endif +#ifndef _REF_HXX +#include <tools/ref.hxx> +#endif +#ifndef _RTL_TENCINFO_H +#include <rtl/tencinfo.h> +#endif +#ifndef _VCL_VCLENUM_HXX +#include <vclenum.hxx> +#endif + +typedef unsigned short sal_MultiByte; + +class ImplFontMetricData; +class SalConverterCache; +class ExtendedXlfd; + +class ExtendedFontStruct : public SvRefBase +{ + private: + + Display* mpDisplay; + unsigned short mnPixelSize; + ExtendedXlfd* mpXlfd; + XFontStruct** mpXFontStruct; + sal_Size mnDefaultWidth; + + int LoadEncoding( rtl_TextEncoding nEncoding ); + Bool GetFontBoundingBox( XCharStruct *pCharStruct, + int *pAscent, int *pDescent ) ; + + sal_Size GetDefaultWidth( SalConverterCache* pCvt ); + sal_Size GetCharWidth8( sal_Unicode nFrom, sal_Unicode nTo, + long *pWidthArray, + rtl_TextEncoding nEncoding ); + sal_Size GetCharWidthUTF16( + sal_Unicode nFrom, sal_Unicode nTo, + long *pWidthArray ); + sal_Size GetCharWidth16( SalConverterCache *pCvt, + sal_Unicode nFrom, sal_Unicode nTo, + long *pWidthArray ); + + public: + ExtendedFontStruct( Display* pDisplay, + unsigned short nPixelSize, + ExtendedXlfd* pXlfd, + SalConverterCache* pCvt ); + ~ExtendedFontStruct(); + Bool Match( const ExtendedXlfd *pXlfd, + int nPixelSize) const; + XFontStruct* GetFontStruct( rtl_TextEncoding nEncoding ); + Bool GetFontStruct( sal_Unicode nChar, + rtl_TextEncoding *pEncodingInOut, + XFontStruct **pFontInOut, + SalConverterCache *pCvt ); + Bool ToImplFontMetricData( ImplFontMetricData *pMetric ); + rtl_TextEncoding GetAsciiEncoding( int *pAsciiRange = NULL ) const; + sal_Size GetCharWidth( SalConverterCache *pCvt, + sal_Unicode nFrom, sal_Unicode nTo, + long *pWidthArray ); +}; + +// Declaration and Implementation for ExtendedFontStructRef: Add RefCounting +// to ExtendedFontStruct (it's not possible to separate decl and impl into +// a separate source file: all ref member functions are inline +SV_DECL_IMPL_REF( ExtendedFontStruct ); + +#endif /* EXTENDED_FONTSTRUCT_HXX */ diff --git a/vcl/unx/inc/xsalprn.h b/vcl/unx/inc/xsalprn.h new file mode 100644 index 000000000000..f0d0d2951bd8 --- /dev/null +++ b/vcl/unx/inc/xsalprn.h @@ -0,0 +1,223 @@ +/************************************************************************* + * + * $RCSfile: xsalprn.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:05:42 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef __salprint_h +#define __salprint_h + + +class String; + +#ifdef __cplusplus +extern "C" { +#endif + +/* printer interface */ +extern int XSalIsDisplay( const Display * ); +extern int XSalIsPrinter( const Display * ); + +/* error handling */ +typedef int (*XSalPrinterErrorHandler)( XErrorEvent * ); + +extern XSalPrinterErrorHandler XSalSetPrinterErrorHandler( XSalPrinterErrorHandler ); + +/* common callbacks */ +typedef void* XSalPointer; +typedef int (*XSalPrinterCallback)( XSalPointer cb_data, XSalPointer client_data ); + +#ifndef _SV_SV_H +#define _SV_SV_H +#define USHORT unsigned short +#include <prntypes.hxx> +#undef USHORT +#undef _SV_SV_H +#else +#include <prntypes.hxx> +#endif + +typedef enum Orientation Orientation; + +/* initialize before first use */ +extern void XSalPrinterInit( const String& installPath ); + +typedef unsigned short XSalEnum; +typedef unsigned char XSalBool; + +#define COLOR_SPACE_COLOR 1 +#define COLOR_SPACE_GRAY 0 + +typedef struct +{ + unsigned int nMagic; /* internal data */ + unsigned short nVersion; /* internal data */ + unsigned short nFlags; /* internal data */ + XSalEnum eDriver; /* PostScript, PCL, ... */ + unsigned short nCopies; /* number of copies */ + unsigned short nPaperBin; /* paper bin to use */ + XSalEnum ePaper; /* A4, A5, ... */ + unsigned int nPaperWidth; /* paper width if PAPER_USER */ + unsigned int nPaperHeight; /* paper height if PAPER_USER */ + XSalEnum eOrientation; /* portrait / landscape */ + unsigned int nScale; /* [%] ( 100 => 1:1 ) */ + unsigned short nResolutionX; /* [dots per inch] */ + unsigned short nResolutionY; /* [dots per inch] */ + char sCompatCommand[256];/* current shell command */ + char sPort[256]; /* default shell command */ + char cDriverName[32]; /* Druckertreibername */ + unsigned int nTrailingBytes; /* trailing bytes appended to this structure */ +} XSalPrinterSetup; + +#define XSAL_PRINTER_SETUP_MAGIC 0x0000ede1 +#define WRONG_ENDIANESS_MAGIC 0xe1ed0000 + +/* definition for XSalPrinterSetup.nFlags */ +#define XSALPRINTERSETUP_FLAG_LEVEL_DEFAULT 0x0000 +#define XSALPRINTERSETUP_FLAG_LEVEL 0x000f +#define XSALPRINTERSETUP_FLAG_LEVEL_SHIFT 0 +#define XSALPRINTERSETUP_FLAG_COLOR 0x0010 /* colored bitmaps */ +#define XSALPRINTERSETUP_FLAG_COLOR_DEFAULT 0x0020 +#define XSALPRINTERSETUP_FLAG_COMPRESS 0x0040 /* compress bitmaps */ +#define XSALPRINTERSETUP_FLAG_COMPRESS_DEFAULT 0x0080 /* compress bitmaps */ +#define XSALPRINTERSETUP_FLAG_DEPTH_DEFAULT 0x0700 +#define XSALPRINTERSETUP_FLAG_DEPTH 0x0700 /* depth n = depth 2^n, 6 = 24Bit, 7 = default */ +#define XSALPRINTERSETUP_FLAG_DEPTH_SHIFT 8 + +#define XSALPRINTERSETUP_FLAG_DEFAULT\ + (XSALPRINTERSETUP_FLAG_LEVEL_DEFAULT | \ + XSALPRINTERSETUP_FLAG_COMPRESS_DEFAULT | \ + XSALPRINTERSETUP_FLAG_COLOR_DEFAULT | \ + XSALPRINTERSETUP_FLAG_DEPTH_DEFAULT ) + + +/* XSalPrinterSetup access */ +extern unsigned short XSalGetPrinterDriverId( const char* driverName ); +extern const char* XSalGetPrinterDriverName( unsigned short driverId ); + +extern unsigned short XSalGetLanguageLevel( const XSalPrinterSetup* pSetup ); +extern void XSalGetLanguageLevels( + const XSalPrinterSetup* pSetup, + unsigned short* minLevel, + unsigned short* maxLevel ); +extern void XSalSetLanguageLevel( XSalPrinterSetup* pSetup, unsigned short); + +extern unsigned short XSalGetDepth( const XSalPrinterSetup* pSetup ); +extern void XSalSetDepth( XSalPrinterSetup* pSetup, unsigned short depth ); + +extern XSalEnum XSalGetColorSpace( const XSalPrinterSetup* pSetup ); +extern void XSalSetColorSpace( XSalPrinterSetup* pSetup, XSalEnum space ); + +extern XSalBool XSalGetBmpCompression( const XSalPrinterSetup* pSetup ); +extern void XSalSetBmpCompression( XSalPrinterSetup* pSetup, XSalBool compress ); + +extern XSalEnum XSalGetOrientation( const char* string ); +extern const char* XSalGetOrientationName( XSalEnum eOrientation ); + +extern XSalEnum XSalGetPaper( const char* sPaperName ); +extern const char* XSalGetPaperName( XSalEnum ePaper ); + +/* use XSalInitPrinterSetup to initialize internal data */ +extern void XSalInitPrinterSetup( XSalPrinterSetup* ); +extern void XSalCorrectEndianess( XSalPrinterSetup* ); +extern void XSalSetupPrinterSetup( XSalPrinterSetup*, Display* display, XLIB_Window parent); + + +/* the following two functions set defaults of the profile */ +extern void XSalReadPrinterSetup( XSalPrinterSetup*, const String& rPrinter ); +extern void XSalReadPrinterSetupDefaults( XSalPrinterSetup* ); + + +typedef Display XSalPrinter; /* an XSalPrinter is a Display. Draw into RootWindow */ + + +/* open, change setup and close printer */ +extern XSalPrinter* XSalOpenPrinter( const XSalPrinterSetup * pSetup, const String& rPrinterName, const String& rPrintFile ); +/* XSalSetupPrinter() can setup: Orientation, Copies, Page, PaperBin */ +extern void XSalSetupPrinter( XSalPrinter *, const XSalPrinterSetup * pSetup ); +extern void XSalClosePrinter( XSalPrinter * ); + +typedef struct +{ + int nWidth; /* [dots] drawable area */ + int nHeight; /* [dots] drawable area */ + int nMarginLeft; /* [dots] left margin */ + int nMarginTop; /* [dots] top margin */ + int nMarginRight; /* [dots] right margin */ + int nMarginBottom; /* [dots] bottom margin */ + int nResolutionX; /* [dpi] resolution x */ + int nResolutionY; /* [dpi] resolution y */ +} XSalPageInfo; + +extern void XSalGetPageInfo( + const XSalPrinter* printer, + const XSalPrinterSetup* pSetup, + XSalPageInfo* pPageInfo ); + + +/* printer job control */ +extern int XSalStartDoc( XSalPrinter * printer, const String& jobName ); +extern int XSalStartPage( XSalPrinter * printer ); +extern int XSalEndPage( XSalPrinter * printer ); +extern int XSalEndDoc( XSalPrinter * printer ); +extern int XSalAbortDoc( XSalPrinter * printer ); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif |