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

(-)svtools/inc/imagemgr.hxx (+4 lines)
Lines 70-75 Link Here
70
#ifndef _IMAGE_HXX
70
#ifndef _IMAGE_HXX
71
#include <vcl/image.hxx>
71
#include <vcl/image.hxx>
72
#endif
72
#endif
73
#include <vcl/bitmapex.hxx>
74
#include <list>
73
75
74
class INetURLObject;
76
class INetURLObject;
75
77
Lines 125-130 public: Link Here
125
	static String	GetDescription( const INetURLObject& rObject );
127
	static String	GetDescription( const INetURLObject& rObject );
126
	static String	GetFileDescription( const INetURLObject& rObject );
128
	static String	GetFileDescription( const INetURLObject& rObject );
127
	static String	GetFolderDescription( const svtools::VolumeInfo& rInfo );
129
	static String	GetFolderDescription( const svtools::VolumeInfo& rInfo );
130
131
	static std::list< BitmapEx > GetIcons( sal_Int16 nIconIndex );
128
};
132
};
129
133
130
#endif
134
#endif
(-)svtools/source/misc/imagemgr.cxx (+42 lines)
Lines 944-946 String SvFileInformationManager::GetFold Link Here
944
    return sDescription;
944
    return sDescription;
945
}
945
}
946
946
947
std::list< BitmapEx > SvFileInformationManager::GetIcons( sal_Int16 nIconIndex )
948
{
949
	USHORT nImageId = IMG_FILE;
950
	switch( nIconIndex )
951
	{
952
#define MAP(a,b) \
953
	case a: nImageId = b; break
954
955
		MAP( ICON_DEFAULT, IMG_FILE );    // ??
956
	    MAP( ICON_SO_DEFAULT, IMG_FILE ); // ??
957
	    MAP( ICON_TEXT_DOCUMENT, IMG_WRITER );
958
	    MAP( ICON_TEXT_TEMPLATE, IMG_WRITERTEMPLATE );
959
	    MAP( ICON_SPREADSHEET_DOCUMENT, IMG_CALC );
960
	    MAP( ICON_SPREADSHEET_TEMPLATE, IMG_CALCTEMPLATE );
961
	    MAP( ICON_DRAWING_DOCUMENT, IMG_DRAW );
962
	    MAP( ICON_DRAWING_TEMPLATE, IMG_DRAWTEMPLATE );
963
	    MAP( ICON_PRESENTATION_DOCUMENT, IMG_IMPRESS );
964
	    MAP( ICON_PRESENTATION_TEMPLATE, IMG_IMPRESSTEMPLATE );
965
	    MAP( ICON_PRESENTATION_COMPRESSED, IMG_IMPRESSPACKED );
966
	    MAP( ICON_GLOBAL_DOCUMENT, IMG_GLOBAL_DOC );
967
	    MAP( ICON_HTML_DOCUMENT, IMG_HTML );
968
	    MAP( ICON_CHART_DOCUMENT, IMG_CHART );
969
	    MAP( ICON_DATABASE_DOCUMENT, IMG_DATABASE );
970
	    MAP( ICON_MATH_DOCUMENT, IMG_MATH );
971
	    MAP( ICON_TEMPLATE, IMG_NEWFROMTEMPLATE );
972
	    MAP( ICON_MACROLIBRARY, IMG_MACROLIB );
973
	    MAP( ICON_PLAYER, IMG_DXF ); // !!
974
	    MAP( ICON_SETUP, IMG_TASK ); // !!
975
	}
976
977
	std::list< BitmapEx > aList;
978
	
979
	BOOL bHighContrast = FALSE; // should be done at the theme level
980
981
	Image aSmall = GetImageFromList_Impl( nImageId, FALSE, bHighContrast );
982
	aList.push_back( aSmall.GetBitmapEx() );
983
984
	Image aLarge = GetImageFromList_Impl( nImageId, TRUE, bHighContrast );
985
	aList.push_back( aLarge.GetBitmapEx() );
986
987
	return aList;
988
}
(-)sfx2/source/view/topfrm.cxx (+8 lines)
Lines 111-116 Link Here
111
#ifndef _SFXRECTITEM_HXX //autogen
111
#ifndef _SFXRECTITEM_HXX //autogen
112
#include <svtools/rectitem.hxx>
112
#include <svtools/rectitem.hxx>
113
#endif
113
#endif
114
#ifndef _SVTOOLS_IMAGEMGR_HXX
115
#include <svtools/imagemgr.hxx>
116
#endif
114
#ifndef _SFXINTITEM_HXX //autogen
117
#ifndef _SFXINTITEM_HXX //autogen
115
#include <svtools/intitem.hxx>
118
#include <svtools/intitem.hxx>
116
#endif
119
#endif
Lines 573-579 SfxTopFrame* SfxTopFrame::Create( SfxObj Link Here
573
            if( SvtModuleOptions::ClassifyFactoryByName( aDocServiceName, eFactory ) )
576
            if( SvtModuleOptions::ClassifyFactoryByName( aDocServiceName, eFactory ) )
574
            {
577
            {
575
                WorkWindow* pWorkWindow = (WorkWindow*)pWindow;
578
                WorkWindow* pWorkWindow = (WorkWindow*)pWindow;
579
//#ifdef UNX
580
                pWorkWindow->SetIcon( SvFileInformationManager::GetIcons(
581
											  (sal_Int16) SvtModuleOptions().GetFactoryIcon( eFactory ) ) );
582
//#else
576
                pWorkWindow->SetIcon( (sal_uInt16) SvtModuleOptions().GetFactoryIcon( eFactory ) );
583
                pWorkWindow->SetIcon( (sal_uInt16) SvtModuleOptions().GetFactoryIcon( eFactory ) );
584
//#endif
577
            }
585
            }
578
        }
586
        }
579
    }
587
    }
(-)framework/source/services/frame.cxx (+8 lines)
Lines 263-268 Link Here
263
#include <svtools/moduleoptions.hxx>
263
#include <svtools/moduleoptions.hxx>
264
#endif
264
#endif
265
265
266
#ifndef _SVTOOLS_IMAGEMGR_HXX
267
#include <svtools/imagemgr.hxx>
268
#endif
269
266
#ifdef ENABLE_ASSERTIONS
270
#ifdef ENABLE_ASSERTIONS
267
	#ifndef _RTL_STRBUF_HXX_
271
	#ifndef _RTL_STRBUF_HXX_
268
	#include <rtl/strbuf.hxx>
272
	#include <rtl/strbuf.hxx>
Lines 3111-3118 void Frame::implts_setIconOnWindow() Link Here
3111
        )
3115
        )
3112
        {
3116
        {
3113
            WorkWindow* pWorkWindow = (WorkWindow*)pWindow;
3117
            WorkWindow* pWorkWindow = (WorkWindow*)pWindow;
3118
//#ifdef UNX
3119
			pWorkWindow->SetIcon( SvFileInformationManager::GetIcons( (sal_Int16) nIcon ) );
3120
//#else
3114
            pWorkWindow->SetIcon( (sal_uInt16)nIcon );
3121
            pWorkWindow->SetIcon( (sal_uInt16)nIcon );
3122
//#endif
3115
        }
3123
        }
3116
        aSolarGuard.clear();
3124
        aSolarGuard.clear();
3117
        /* UNSAFE AREA --------------------------------------------------------------------------------------------- */
3125
        /* UNSAFE AREA --------------------------------------------------------------------------------------------- */
3118
   }
3126
   }
(-)vcl/inc/syswin.hxx (-2 / +6 lines)
Lines 69-74 Link Here
69
#include <window.hxx>
69
#include <window.hxx>
70
#endif
70
#endif
71
71
72
#include <bitmapex.hxx>
73
#include <list>
74
72
class ModalDialog;
75
class ModalDialog;
73
class MenuBar;
76
class MenuBar;
74
class TaskPaneList;
77
class TaskPaneList;
Lines 242-249 public: Link Here
242
    virtual void    Roll();
245
    virtual void    Roll();
243
    virtual void    Resizing( Size& rSize );
246
    virtual void    Resizing( Size& rSize );
244
247
245
    void            SetIcon( USHORT nIcon );
248
	void            SetIcon( USHORT nIcon ); // Deprecated
246
    USHORT          GetIcon() const { return mnIcon; }
249
	USHORT          GetIcon() const { return mnIcon; } // Is this ever used !?
250
	void            SetIcon( std::list< BitmapEx > aIcons );
247
251
248
    void            SetZLevel( BYTE nLevel );
252
    void            SetZLevel( BYTE nLevel );
249
    BYTE            GetZLevel() const;
253
    BYTE            GetZLevel() const;
(-)vcl/inc/salframe.hxx (+1 lines)
Lines 209-214 public: Link Here
209
209
210
    virtual void				SetTitle( const XubString& rTitle ) = 0;
210
    virtual void				SetTitle( const XubString& rTitle ) = 0;
211
    virtual void				SetIcon( USHORT nIcon ) = 0;
211
    virtual void				SetIcon( USHORT nIcon ) = 0;
212
    virtual void				SetIcon( std::list< SalBitmap * > &rIcons ) = 0;
212
    virtual void                    SetMenu( SalMenu *pSalMenu ) = 0;
213
    virtual void                    SetMenu( SalMenu *pSalMenu ) = 0;
213
    virtual void                    DrawMenuBar() = 0;
214
    virtual void                    DrawMenuBar() = 0;
214
215
(-)vcl/source/window/syswin.cxx (+42 lines)
Lines 103-110 Link Here
103
#ifndef _SV_TASKPANELIST_HXX
103
#ifndef _SV_TASKPANELIST_HXX
104
#include <taskpanelist.hxx>
104
#include <taskpanelist.hxx>
105
#endif
105
#endif
106
#ifndef _SV_BITMAP_HXX
107
#include <bitmap.hxx>
108
#endif
109
#ifndef _SV_IMPBMP_HXX
110
#include <impbmp.hxx>
111
#endif
106
#include <unowrap.hxx>
112
#include <unowrap.hxx>
107
113
108
114
109
using namespace ::com::sun::star::uno;
115
using namespace ::com::sun::star::uno;
110
using namespace ::com::sun::star::lang;
116
using namespace ::com::sun::star::lang;
Lines 348-353 void SystemWindow::SetIcon( USHORT nIcon Link Here
348
353
349
        if ( pWindow->mpWindowImpl->mbFrame )
354
        if ( pWindow->mpWindowImpl->mbFrame )
350
            pWindow->mpWindowImpl->mpFrame->SetIcon( nIcon );
355
            pWindow->mpWindowImpl->mpFrame->SetIcon( nIcon );
356
    }
357
}
358
359
// -----------------------------------------------------------------------
360
361
void SystemWindow::SetIcon( std::list< BitmapEx > aIcons )
362
{
363
	std::list< BitmapEx >::iterator it;
364
	std::list< Bitmap > aAllocatedBitmaps;
365
	std::list< SalBitmap * > aSalIcons;
366
	
367
	for( it = aIcons.begin(); it != aIcons.end(); it++)
368
	{
369
		Bitmap aBitmap( it->GetBitmap() );
370
		Bitmap aAlpha( it->GetAlpha().GetBitmap() );
371
		if( !aAlpha )
372
		{
373
			fprintf( stderr, "skipping non-alpha Window icon" );
374
			continue;
375
		}
376
		aBitmap.Convert( BMP_CONVERSION_24BIT );
377
		aAllocatedBitmaps.push_back( aBitmap );
378
		aAllocatedBitmaps.push_back( aAlpha );
379
		aSalIcons.push_back( aBitmap.ImplGetImpBitmap()->ImplGetSalBitmap() );
380
		aSalIcons.push_back( aAlpha.ImplGetImpBitmap()->ImplGetSalBitmap() );
381
	}
382
	
383
    if ( !mbSysChild )
384
    {
385
        const Window* pWindow = this;
386
        while ( pWindow->mpWindowImpl->mpBorderWindow )
387
            pWindow = pWindow->mpWindowImpl->mpBorderWindow;
388
389
        if ( pWindow->mpWindowImpl->mbFrame )
390
            pWindow->mpWindowImpl->mpFrame->SetIcon( aSalIcons );
391
351
    }
392
    }
352
}
393
}
353
394
(-)vcl/unx/inc/salframe.h (+1 lines)
Lines 240-245 public: Link Here
240
240
241
    virtual void				SetTitle( const XubString& rTitle );
241
    virtual void				SetTitle( const XubString& rTitle );
242
    virtual void				SetIcon( USHORT nIcon );
242
    virtual void				SetIcon( USHORT nIcon );
243
	virtual void                SetIcon( std::list< SalBitmap * > &rIcons );
243
    virtual void				SetMenu( SalMenu* pMenu );
244
    virtual void				SetMenu( SalMenu* pMenu );
244
    virtual void                                DrawMenuBar();
245
    virtual void                                DrawMenuBar();
245
246
(-)vcl/unx/gtk/window/gtkframe.cxx (+79 lines)
Lines 74-79 Link Here
74
74
75
#include <dlfcn.h>
75
#include <dlfcn.h>
76
#include <soicon.hxx>
76
#include <soicon.hxx>
77
#include <salbtype.hxx>
78
79
#include <svapp.hxx>
77
80
78
#if OSL_DEBUG_LEVEL > 1
81
#if OSL_DEBUG_LEVEL > 1
79
#include <cstdio>
82
#include <cstdio>
Lines 519-524 Link Here
519
522
520
void GtkSalFrame::SetIcon( USHORT nIcon )
523
void GtkSalFrame::SetIcon( USHORT nIcon )
521
{
524
{
525
#if 0
522
    if( m_nStyle & SAL_FRAME_STYLE_CHILD || ! m_pWindow )
526
    if( m_nStyle & SAL_FRAME_STYLE_CHILD || ! m_pWindow )
523
        return;
527
        return;
524
528
Lines 549-554 Link Here
549
553
550
       g_list_foreach( pPixbufs, (GFunc) g_object_unref, NULL );
554
       g_list_foreach( pPixbufs, (GFunc) g_object_unref, NULL );
551
       g_list_free( pPixbufs );
555
       g_list_free( pPixbufs );
556
#endif
557
}
558
559
static inline BYTE *
560
getRow( BitmapBuffer *pBuffer, ULONG nRow )
561
{
562
	if( BMP_SCANLINE_ADJUSTMENT( pBuffer->mnFormat ) == BMP_FORMAT_TOP_DOWN )
563
		return pBuffer->mpBits + nRow * pBuffer->mnScanlineSize;
564
	else
565
		return pBuffer->mpBits + ( pBuffer->mnHeight - nRow - 1 ) * pBuffer->mnScanlineSize;
566
}
567
568
static GdkPixbuf *
569
bitmapToPixbuf( SalBitmap *pSalBitmap, SalBitmap *pSalAlpha )
570
{
571
	g_return_val_if_fail( pSalBitmap != NULL, NULL );
572
	g_return_val_if_fail( pSalAlpha != NULL, NULL );
573
574
	BitmapBuffer *pBitmap = pSalBitmap->AcquireBuffer( TRUE );
575
	g_return_val_if_fail( pBitmap != NULL, NULL );
576
	g_return_val_if_fail( pBitmap->mnBitCount == 24, NULL );
577
578
	BitmapBuffer *pAlpha = pSalAlpha->AcquireBuffer( TRUE );
579
	g_return_val_if_fail( pAlpha != NULL, NULL );
580
	g_return_val_if_fail( pAlpha->mnBitCount == 8, NULL );
581
582
	Size aSize = pSalBitmap->GetSize();
583
	g_return_val_if_fail( pSalAlpha->GetSize() == aSize, NULL );
584
585
	ULONG nX, nY;
586
	guchar *pPixbufData = (guchar *)g_malloc (4 * aSize.Width() * aSize.Height() );
587
	guchar *pDestData = pPixbufData;
588
589
	for( nY = 0; nY < pBitmap->mnHeight; nY++ )
590
	{
591
		BYTE *pData = getRow( pBitmap, nY );
592
		BYTE *pAlphaData = getRow( pAlpha, nY );
593
594
		for( nX = 0; nX < pBitmap->mnWidth; nX++ )
595
		{
596
			*pDestData++ = *pData++;
597
			*pDestData++ = *pData++;
598
			*pDestData++ = *pData++;
599
			*pDestData++ = 255 - *pAlphaData++;
600
		}
601
	}
602
603
	pSalBitmap->ReleaseBuffer( pBitmap, TRUE );
604
	pSalAlpha->ReleaseBuffer( pAlpha, TRUE );
605
606
	return gdk_pixbuf_new_from_data( pPixbufData,
607
									 GDK_COLORSPACE_RGB, TRUE, 8,
608
									 aSize.Width(), aSize.Height(),
609
									 aSize.Width() * 4,
610
									 (GdkPixbufDestroyNotify) g_free,
611
									 NULL );
612
}
613
614
void GtkSalFrame::SetIcon( std::list< SalBitmap * > &rIcons )
615
{
616
	std::list< SalBitmap * >::iterator it;
617
	GdkPixbuf *pBuf;
618
	GList *pIcons = NULL;
619
620
	for( it = rIcons.begin(); it != rIcons.end(); it++)
621
	{
622
		SalBitmap *pBitmap = *it;
623
		it++;
624
		SalBitmap *pAlpha = *it;
625
626
		if( ( pBuf = bitmapToPixbuf( pBitmap, pAlpha ) ) )
627
			pIcons = g_list_prepend( pIcons, pBuf );
628
	}
629
630
	gtk_window_set_icon_list( m_pWindow, pIcons );
552
}
631
}
553
632
554
void GtkSalFrame::SetMenu( SalMenu* pSalMenu )
633
void GtkSalFrame::SetMenu( SalMenu* pSalMenu )
(-)vcl/unx/inc/plugins/gtk/gtkframe.hxx (+2 lines)
Lines 212-217 class GtkSalFrame : public SalFrame Link Here
212
    void			SetDefaultSize();
212
    void			SetDefaultSize();
213
	void			setAutoLock( bool bLock );
213
	void			setAutoLock( bool bLock );
214
	void			setScreenSaverTimeout( int nTimeout );
214
	void			setScreenSaverTimeout( int nTimeout );
215
	void            hardIMReset();
215
216
216
    GdkNativeWindow findTopLevelSystemWindow( GdkNativeWindow aWindow );
217
    GdkNativeWindow findTopLevelSystemWindow( GdkNativeWindow aWindow );
217
218
Lines 261-266 public: Link Here
261
262
262
    virtual void                SetTitle( const XubString& rTitle );
263
    virtual void                SetTitle( const XubString& rTitle );
263
    virtual void                SetIcon( USHORT nIcon );
264
    virtual void                SetIcon( USHORT nIcon );
265
	virtual void                SetIcon( std::list< SalBitmap * > &rIcons );
264
    virtual void                SetMenu( SalMenu *pSalMenu );
266
    virtual void                SetMenu( SalMenu *pSalMenu );
265
    virtual void                DrawMenuBar();
267
    virtual void                DrawMenuBar();
266
268
(-)vcl/unx/source/window/salframe.cxx (+5 lines)
Lines 878-883 void X11SalFrame::Enable( BOOL bEnable ) Link Here
878
878
879
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
879
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
880
880
881
void X11SalFrame::SetIcon( std::list< SalBitmap * > &rIcons ) 
882
{
883
	// Dummy
884
}
885
881
void X11SalFrame::SetIcon( USHORT nIcon )
886
void X11SalFrame::SetIcon( USHORT nIcon )
882
{
887
{
883
    if ( !( nStyle_ & (SAL_FRAME_STYLE_CHILD|SAL_FRAME_STYLE_FLOAT) ) )
888
    if ( !( nStyle_ & (SAL_FRAME_STYLE_CHILD|SAL_FRAME_STYLE_FLOAT) ) )

Return to issue 41225