View | Details | Raw Unified | Return to issue 61174
Collapse All | Expand All

(-)vcl.org/unx/inc/dtint.hxx (-3 / +4 lines)
Lines 4-12 Link Here
4
 *
4
 *
5
 *  $RCSfile: dtint.hxx,v $
5
 *  $RCSfile: dtint.hxx,v $
6
 *
6
 *
7
 *  $Revision: 1.10 $
7
 *  $Revision: 1.11 $
8
 *
8
 *
9
 *  last change: $Author: rt $ $Date: 2005/09/09 12:39:15 $
9
 *  last change: $Author: mox $ $Date: 2006/01/28 12:39:15 $
10
 *
10
 *
11
 *  The Contents of this file are made available subject to
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
12
 *  the terms of GNU Lesser General Public License Version 2.1.
Lines 71-77 Link Here
71
	DtKDE,
71
	DtKDE,
72
	DtGNOME,
72
	DtGNOME,
73
	DtSCO,
73
	DtSCO,
74
	DtIRIX
74
	DtIRIX,
75
	DtMACOSX
75
};
76
};
76
77
77
class DtIntegrator
78
class DtIntegrator
(-)vcl.org/unx/inc/macosxint.hxx (+57 lines)
Line 0 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile: macosxint.hxx,v $
6
 *
7
 *  $Revision: 1.0 $
8
 *
9
 *  last change: $Author: mox $ $Date: 2006/01/28 12:41:39 $
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
#ifndef _SV_MACOSXINT_HXX
36
#define _SV_MACOSXINT_HXX
37
38
#ifndef _SV_DTINT_HXX
39
#include <dtint.hxx>
40
#endif
41
#ifndef _LIST_HXX
42
#include <tools/list.hxx>
43
#endif
44
45
class MACOSXIntegrator : public DtIntegrator
46
{
47
	friend DtIntegrator* DtIntegrator::CreateDtIntegrator();
48
private:
49
	MACOSXIntegrator();
50
51
public:
52
	virtual ~MACOSXIntegrator();
53
54
	virtual void GetSystemLook( AllSettings& rSettings );
55
};
56
57
#endif
(-)vcl.org/unx/source/gdi/dtint.cxx (-3 / +11 lines)
Lines 4-12 Link Here
4
 *
4
 *
5
 *  $RCSfile: dtint.cxx,v $
5
 *  $RCSfile: dtint.cxx,v $
6
 *
6
 *
7
 *  $Revision: 1.24 $
7
 *  $Revision: 1.25 $
8
 *
8
 *
9
 *  last change: $Author: kz $ $Date: 2005/11/01 10:39:01 $
9
 *  last change: $Author: mox $ $Date: 2005/01/28 10:39:01 $
10
 *
10
 *
11
 *  The Contents of this file are made available subject to
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
12
 *  the terms of GNU Lesser General Public License Version 2.1.
Lines 46-51 Link Here
46
#include <cdeint.hxx>
46
#include <cdeint.hxx>
47
#endif
47
#endif
48
#include <kdeint.hxx>
48
#include <kdeint.hxx>
49
#ifdef MACOSX
50
#include <macosxint.hxx>
51
#endif
49
#include <saldisp.hxx>
52
#include <saldisp.hxx>
50
#include <saldata.hxx>
53
#include <saldata.hxx>
51
#include <wmadaptor.hxx>
54
#include <wmadaptor.hxx>
Lines 105-111 Link Here
105
    /*
108
    /*
106
     *  #i22061# override desktop detection
109
     *  #i22061# override desktop detection
107
     *  if environment variable OOO_FORCE_DESKTOP is set
110
     *  if environment variable OOO_FORCE_DESKTOP is set
108
     *  to one of "cde" "kde" "gnome" then autodetection
111
     *  to one of "cde" "kde" "gnome" "macosx" then autodetection
109
     *  is overridden.
112
     *  is overridden.
110
     */
113
     */
111
    static const char* pOverride = getenv( "OOO_FORCE_DESKTOP" );
114
    static const char* pOverride = getenv( "OOO_FORCE_DESKTOP" );
Lines 118-123 Link Here
118
#endif
121
#endif
119
        if( aOver.equalsIgnoreAsciiCase( "kde" ) )
122
        if( aOver.equalsIgnoreAsciiCase( "kde" ) )
120
            return new KDEIntegrator();
123
            return new KDEIntegrator();
124
        if( aOver.equalsIgnoreAsciiCase( "macosx" ) )
125
            return new MACOSXIntegrator();
121
        if( aOver.equalsIgnoreAsciiCase( "none" ) )
126
        if( aOver.equalsIgnoreAsciiCase( "none" ) )
122
            return new DtIntegrator();
127
            return new DtIntegrator();
123
    }
128
    }
Lines 138-143 Link Here
138
    if( pSalDisplay->getWMAdaptor()->getWindowManagerName().EqualsAscii( "KWin" ) )
143
    if( pSalDisplay->getWMAdaptor()->getWindowManagerName().EqualsAscii( "KWin" ) )
139
		return new KDEIntegrator();
144
		return new KDEIntegrator();
140
145
146
    if( pSalDisplay->getWMAdaptor()->getWindowManagerName().EqualsAscii( "SystemUIServer.app" ) )
147
		return new MACOSXIntegrator();
148
141
	// default: generic implementation
149
	// default: generic implementation
142
	return new DtIntegrator();
150
	return new DtIntegrator();
143
}
151
}
(-)vcl.org/unx/source/gdi/macosxint.cxx (+184 lines)
Line 0 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile: macosxint.cxx,v $
6
 *
7
 *  $Revision: 1.0 $
8
 *
9
 *  last change: $Author: mox $ $Date: 2006/01/28 10:39:13 $
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
36
#include <macosxint.hxx>
37
#include <tools/config.hxx>
38
#include <settings.hxx>
39
40
#include <osl/thread.h>
41
42
#include <unistd.h>
43
#include <cstdio>
44
45
using namespace rtl;
46
using namespace osl;
47
48
MACOSXIntegrator::MACOSXIntegrator()
49
{
50
	meType = DtMACOSX;
51
}
52
53
MACOSXIntegrator::~MACOSXIntegrator()
54
{
55
}
56
57
static const char* pTryFiles[] =
58
  {
59
	"~/Library/Application Support/OpenOffice.org2/macosxrc"
60
  };
61
62
void MACOSXIntegrator::GetSystemLook( AllSettings& rSettings )
63
{
64
    rtl_TextEncoding aEncoding = osl_getThreadTextEncoding();
65
66
    StyleSettings aStyleSettings( rSettings.GetStyleSettings() );
67
    // #i48001# set a default blink rate
68
    aStyleSettings.SetCursorBlinkTime( 500 );
69
70
	for( unsigned int i = 0; (i < sizeof( pTryFiles )/sizeof(pTryFiles[0])); i++ )
71
    {
72
		String aFile;
73
		if( pTryFiles[i][0] == '~' )
74
        {
75
			aFile = aHomeDir;
76
			aFile += String( pTryFiles[i]+1, aEncoding );
77
        }
78
		else
79
            aFile = String( ByteString( pTryFiles[i] ), aEncoding );
80
        
81
		if( access( ByteString( aFile, aEncoding ).GetBuffer(), R_OK ) )
82
            continue;
83
        
84
        #if OSL_DEBUG_LEVEL > 1
85
		fprintf( stderr, "using %s for style settings\n", ByteString( aFile, aEncoding ).GetBuffer() );
86
        #endif
87
        
88
		Config aConfig( aFile );
89
		ByteString aLine;
90
        
91
		if( aConfig.HasGroup( "General" ) )
92
        {
93
			aConfig.SetGroup( "General" );
94
            
95
			aLine = aConfig.ReadKey( "foreground" );
96
			if( aLine.GetTokenCount( ',' ) >= 3 )
97
            {
98
				Color aFore( aLine.GetToken( 0, ',' ).ToInt32(),
99
                aLine.GetToken( 1, ',' ).ToInt32(),
100
                aLine.GetToken( 2, ',' ).ToInt32() );
101
				aStyleSettings.SetDialogTextColor( aFore );
102
				aStyleSettings.SetMenuTextColor( aFore );
103
				aStyleSettings.SetButtonTextColor( aFore );
104
				aStyleSettings.SetRadioCheckTextColor( aFore );
105
				aStyleSettings.SetGroupTextColor( aFore );
106
				aStyleSettings.SetLabelTextColor( aFore );
107
				aStyleSettings.SetInfoTextColor( aFore );
108
            }
109
            
110
			aLine = aConfig.ReadKey( "background" );
111
			if( aLine.GetTokenCount( ',' ) >= 3 )
112
            {
113
				Color aBack( aLine.GetToken( 0, ',' ).ToInt32(),
114
                aLine.GetToken( 1, ',' ).ToInt32(),
115
                aLine.GetToken( 2, ',' ).ToInt32() );
116
				aStyleSettings.Set3DColors( aBack );
117
				aStyleSettings.SetFaceColor( aBack );
118
				aStyleSettings.SetDialogColor( aBack );
119
				aStyleSettings.SetMenuColor( aBack );
120
				aStyleSettings.SetMenuBarColor( aBack );
121
				if( aBack == COL_LIGHTGRAY )
122
                    aStyleSettings.SetCheckedColor( Color( 0xCC, 0xCC, 0xCC ) );
123
				else
124
                {
125
					Color aColor2 = aStyleSettings.GetLightColor();
126
					aStyleSettings.
127
                    SetCheckedColor( Color( (BYTE)(((USHORT)aBack.GetRed()+(USHORT)aColor2.GetRed())/2),
128
                    (BYTE)(((USHORT)aBack.GetGreen()+(USHORT)aColor2.GetGreen())/2),
129
                    (BYTE)(((USHORT)aBack.GetBlue()+(USHORT)aColor2.GetBlue())/2)
130
                    ) );
131
                }
132
            }
133
            
134
			aLine = aConfig.ReadKey( "selectForeground" );
135
			if( aLine.GetTokenCount( ',' ) >= 3 )
136
                aStyleSettings.
137
            SetHighlightTextColor( Color( aLine.GetToken( 0, ',' ).ToInt32(),
138
            aLine.GetToken( 1, ',' ).ToInt32(),
139
            aLine.GetToken( 2, ',' ).ToInt32() ) );
140
            
141
			aLine = aConfig.ReadKey( "selectBackground" );
142
			if( aLine.GetTokenCount( ',' ) >= 3 )
143
                aStyleSettings.
144
            SetHighlightColor( Color( aLine.GetToken( 0, ',' ).ToInt32(),
145
            aLine.GetToken( 1, ',' ).ToInt32(),
146
            aLine.GetToken( 2, ',' ).ToInt32() ) );
147
            
148
			aLine = aConfig.ReadKey( "font" );
149
			if( aLine.Len() )
150
            {
151
				Font aFont = aStyleSettings.GetAppFont();
152
				String aFontName( aLine, RTL_TEXTENCODING_UTF8 );
153
				if( aFontName.GetTokenCount( ',' ) > 0 )
154
					aFontName = aFontName.GetToken( 0, ',' );
155
				aFont.SetName( aFontName );
156
                
157
				aStyleSettings.SetAppFont( aFont );
158
				aStyleSettings.SetHelpFont( aFont );
159
                aStyleSettings.SetTitleFont( aFont );
160
                aStyleSettings.SetFloatTitleFont( aFont );
161
				aStyleSettings.SetMenuFont( aFont );
162
				aStyleSettings.SetToolFont( aFont );
163
				aStyleSettings.SetLabelFont( aFont );
164
				aStyleSettings.SetInfoFont( aFont );
165
				aStyleSettings.SetRadioCheckFont( aFont );
166
				aStyleSettings.SetPushButtonFont( aFont );
167
				aStyleSettings.SetFieldFont( aFont );
168
				aStyleSettings.SetIconFont( aFont );
169
				aStyleSettings.SetGroupFont( aFont );
170
            }
171
            
172
            aLine = aConfig.ReadKey( "cursorFlashTime" );
173
            if( aLine.Len() )
174
            {
175
                sal_Int32 nTime = aLine.ToInt32() / 2;
176
                if( nTime == 0 )
177
                    nTime = STYLE_CURSOR_NOBLINKTIME;
178
                aStyleSettings.SetCursorBlinkTime( nTime );
179
            }
180
        }
181
    }
182
        
183
    rSettings.SetStyleSettings( aStyleSettings );
184
}
(-)vcl.org/unx/source/gdi/makefile.mk (+1 lines)
Lines 68-73 Link Here
68
		$(SLO)$/xlfd_smpl.obj	\
68
		$(SLO)$/xlfd_smpl.obj	\
69
		$(SLO)$/salgdi3.obj		\
69
		$(SLO)$/salgdi3.obj		\
70
		$(SLO)$/kdeint.obj		\
70
		$(SLO)$/kdeint.obj		\
71
		$(SLO)$/macosxint.obj		\
71
		$(SLO)$/pspgraphics.obj
72
		$(SLO)$/pspgraphics.obj
72
73
73
.IF "$(USE_XPRINT)" == "TRUE"
74
.IF "$(USE_XPRINT)" == "TRUE"

Return to issue 61174