Kaydet (Commit) fee5ca25 authored tarafından Matúš Kukan's avatar Matúš Kukan

remove Java piece from avmedia

üst d39a1d4d
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.IQueryInterface;
import com.sun.star.lang.XInitialization;
import com.sun.star.lang.XEventListener;
import com.sun.star.awt.*;
import com.sun.star.media.*;
import com.sun.star.graphic.*;
// -----------------
// - Player Window -
// -----------------
public class FrameGrabber implements com.sun.star.lang.XServiceInfo,
com.sun.star.media.XFrameGrabber
{
private com.sun.star.lang.XMultiServiceFactory maFactory = null;
private javax.media.Player maPlayer = null;
private javax.media.control.FrameGrabbingControl maFrameGrabbingControl = null;
// -------------------------------------------------------------------------
public FrameGrabber( com.sun.star.lang.XMultiServiceFactory aFactory, String aURL )
{
maFactory = aFactory;
try
{
maPlayer = javax.media.Manager.createRealizedPlayer( new java.net.URL( aURL ) );
}
catch( java.net.MalformedURLException e )
{
}
catch( java.io.IOException e )
{
}
catch( javax.media.NoPlayerException e )
{
}
catch( javax.media.CannotRealizeException e )
{
}
catch( java.lang.Exception e )
{
}
if( maPlayer != null )
{
maFrameGrabbingControl = (javax.media.control.FrameGrabbingControl) maPlayer.getControl(
"javax.media.control.FrameGrabbingControl" );
}
}
// -------------------------------------------------------------------------
public com.sun.star.graphic.XGraphic implImageToXGraphic( java.awt.Image aImage )
{
com.sun.star.graphic.XGraphic aRet = null;
if( maFactory != null && aImage != null )
{
if( aImage instanceof java.awt.image.BufferedImage )
{
java.io.File aTempFile = null;
try
{
aTempFile = java.io.File.createTempFile( "sv0", ".png" );
if( aTempFile.canWrite() )
{
javax.imageio.ImageIO.write( (java.awt.image.BufferedImage) aImage, "png", aTempFile );
com.sun.star.graphic.XGraphicProvider aProvider =
(com.sun.star.graphic.XGraphicProvider) UnoRuntime.queryInterface(
com.sun.star.graphic.XGraphicProvider.class,
maFactory.createInstance("com.sun.star.graphic.GraphicProvider") );
if( aProvider != null )
{
com.sun.star.beans.PropertyValue[] aArgs = new com.sun.star.beans.PropertyValue[ 1 ];
aArgs[ 0 ] = new com.sun.star.beans.PropertyValue();
aArgs[ 0 ].Name = "URL";
aArgs[ 0 ].Value = "file://" + aTempFile.toString();
aRet = aProvider.queryGraphic( aArgs );
}
}
}
catch( java.lang.IllegalArgumentException aExcp )
{
}
catch( java.io.IOException aExcp )
{
}
catch( com.sun.star.uno.Exception aExcp )
{
}
if( aTempFile != null )
aTempFile.delete();
}
}
return aRet;
}
// -----------------
// - XFrameGrabber -
// -----------------
public synchronized com.sun.star.graphic.XGraphic grabFrame( double fMediaTime )
{
com.sun.star.graphic.XGraphic aRet = null;
if( maFrameGrabbingControl != null )
{
if( fMediaTime >= 0.0 && fMediaTime <= maPlayer.getDuration().getSeconds() )
{
maPlayer.setMediaTime( new javax.media.Time( fMediaTime ) );
javax.media.Buffer aBuffer = maFrameGrabbingControl.grabFrame();
if( aBuffer != null && aBuffer.getFormat() instanceof javax.media.format.VideoFormat )
{
aRet = implImageToXGraphic( new javax.media.util.BufferToImage(
(javax.media.format.VideoFormat) aBuffer.getFormat() ).
createImage( aBuffer ) );
}
}
}
return aRet;
}
// ----------------
// - XServiceInfo -
// ----------------
private static final String s_implName = "com.sun.star.comp.FrameGrabber_Java";
private static final String s_serviceName = "com.sun.star.media.FrameGrabber_Java";
public synchronized String getImplementationName()
{
return s_implName;
}
// -------------------------------------------------------------------------
public synchronized String [] getSupportedServiceNames()
{
return new String [] { s_serviceName };
}
// -------------------------------------------------------------------------
public synchronized boolean supportsService( String serviceName )
{
return serviceName.equals( s_serviceName );
}
}
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
// UNO
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.IQueryInterface;
import com.sun.star.lang.XInitialization;
// media
import com.sun.star.media.*;
public class Manager implements com.sun.star.lang.XServiceInfo,
com.sun.star.lang.XTypeProvider,
com.sun.star.media.XManager
{
private com.sun.star.lang.XMultiServiceFactory maFactory;
// -------------------------------------------------------------------------
public Manager( com.sun.star.lang.XMultiServiceFactory aFactory )
{
maFactory = aFactory;
}
// ------------
// - XManager -
// ------------
public com.sun.star.media.XPlayer createPlayer( String aURL )
{
javax.media.Player aPlayer = null;
try
{
aPlayer = javax.media.Manager.createRealizedPlayer( new java.net.URL( aURL ) );
}
catch( java.net.MalformedURLException e )
{
}
catch( java.io.IOException e )
{
}
catch( javax.media.NoPlayerException e )
{
}
catch( javax.media.CannotRealizeException e )
{
}
catch( java.lang.Exception e )
{
}
if( aPlayer != null )
{
return new Player( maFactory, aPlayer, aURL );
}
else
return null;
}
// ----------------
// - XServiceInfo -
// ----------------
private static final String s_implName = "com.sun.star.comp.media.Manager_Java";
private static final String s_serviceName = "com.sun.star.media.Manager_Java";
public synchronized String getImplementationName()
{
return s_implName;
}
// -------------------------------------------------------------------------
public synchronized String [] getSupportedServiceNames()
{
return new String [] { s_serviceName };
}
// -------------------------------------------------------------------------
public synchronized boolean supportsService( String serviceName )
{
return serviceName.equals( s_serviceName );
}
// -----------------
// - XTypeProvider -
// -----------------
protected byte[] maImplementationId;
public com.sun.star.uno.Type[] getTypes()
{
com.sun.star.uno.Type[] retValue = new com.sun.star.uno.Type[ 3 ];
retValue[ 0 ]= new com.sun.star.uno.Type( com.sun.star.lang.XServiceInfo.class );
retValue[ 1 ]= new com.sun.star.uno.Type( com.sun.star.lang.XTypeProvider.class );
retValue[ 2 ]= new com.sun.star.uno.Type( com.sun.star.media.XManager.class );
return retValue;
}
// -------------------------------------------------------------------------
synchronized public byte[] getImplementationId()
{
if( maImplementationId == null)
{
maImplementationId = new byte[ 16 ];
int hash = hashCode();
maImplementationId[ 0 ] = (byte)(hash & 0xff);
maImplementationId[ 1 ] = (byte)((hash >>> 8) & 0xff);
maImplementationId[ 2 ] = (byte)((hash >>> 16) & 0xff);
maImplementationId[ 3 ] = (byte)((hash >>>24) & 0xff);
}
return maImplementationId;
}
}
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
// UNO
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.IQueryInterface;
import com.sun.star.lang.XInitialization;
public class MediaUno
{
private static final String s_implName = "com.sun.star.comp.media.Manager_Java";
private static final String s_serviceName = "com.sun.star.media.Manager_Java";
// -------------------------------------------------------------------------
public MediaUno()
{
}
// -------------------------------------------------------------------------
public static com.sun.star.lang.XSingleServiceFactory __getServiceFactory(
String implName,
com.sun.star.lang.XMultiServiceFactory multiFactory,
com.sun.star.registry.XRegistryKey regKey )
{
if (implName.equals( s_implName ))
{
try
{
return com.sun.star.comp.loader.FactoryHelper.getServiceFactory(
Class.forName( "Manager" ), s_serviceName, multiFactory, regKey );
}
catch( java.lang.ClassNotFoundException exception )
{
}
}
return null;
}
}
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
// UNO
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.IQueryInterface;
import com.sun.star.lang.XInitialization;
// awt
import com.sun.star.awt.*;
// media
import com.sun.star.media.*;
public class Player implements javax.media.ControllerListener,
com.sun.star.lang.XServiceInfo,
com.sun.star.media.XPlayer,
com.sun.star.lang.XComponent
{
private com.sun.star.lang.XMultiServiceFactory maFactory;
private String maURL;
private javax.media.Player maPlayer;
private javax.media.GainControl maGainControl;
private boolean mbStarted = false;
private boolean mbLooping = false;
// -------------------------------------------------------------------------
public Player( com.sun.star.lang.XMultiServiceFactory aFactory,
javax.media.Player aPlayer, String aURL )
{
maFactory = aFactory;
maURL = aURL;
maPlayer = aPlayer;
maPlayer.addControllerListener( this );
maGainControl = maPlayer.getGainControl();
}
// -------------------------------------------------------------------------
public synchronized void controllerUpdate( javax.media.ControllerEvent aEvt )
{
if( aEvt instanceof javax.media.EndOfMediaEvent ||
aEvt instanceof javax.media.StopAtTimeEvent )
{
mbStarted = false;
if( mbLooping )
{
setMediaTime( 0.0 );
start();
}
else if( aEvt instanceof javax.media.EndOfMediaEvent )
setMediaTime( getDuration() );
}
}
// -----------
// - XPlayer -
// -----------
public synchronized void start()
{
if( !mbStarted )
{
maPlayer.start();
mbStarted = true;
}
}
// -------------------------------------------------------------------------
public synchronized void stop()
{
if( mbStarted )
{
maPlayer.stop();
mbStarted = false;
}
}
// -------------------------------------------------------------------------
public synchronized boolean isPlaying()
{
return mbStarted;
}
// -------------------------------------------------------------------------
public synchronized double getDuration()
{
return maPlayer.getDuration().getSeconds();
}
// -------------------------------------------------------------------------
public synchronized void setMediaTime( double fTime )
{
if( fTime >= 0.0 && fTime <= getDuration() )
maPlayer.setMediaTime( new javax.media.Time( fTime ) );
}
// -------------------------------------------------------------------------
public synchronized double getMediaTime()
{
return maPlayer.getMediaTime().getSeconds();
}
// -------------------------------------------------------------------------
public synchronized void setStopTime( double fTime )
{
boolean bOldStarted = mbStarted;
if( mbStarted )
stop();
maPlayer.setStopTime( new javax.media.Time( fTime ) );
if( bOldStarted )
start();
}
// -------------------------------------------------------------------------
public synchronized double getStopTime()
{
return maPlayer.getStopTime().getSeconds();
}
// -------------------------------------------------------------------------
public synchronized void setRate( double fRate )
{
boolean bOldStarted = mbStarted;
if( mbStarted )
stop();
maPlayer.setRate( (float) fRate );
if( bOldStarted )
start();
}
// -------------------------------------------------------------------------
public synchronized double getRate()
{
return (double) maPlayer.getRate();
}
// -------------------------------------------------------------------------
public synchronized void setPlaybackLoop( boolean bSet )
{
mbLooping = bSet;
}
// -------------------------------------------------------------------------
public synchronized boolean isPlaybackLoop()
{
return mbLooping;
}
// -------------------------------------------------------------------------
public synchronized void setVolumeDB( short nVolumeDB )
{
if( maGainControl != null )
maGainControl.setDB( nVolumeDB );
}
// -------------------------------------------------------------------------
public synchronized short getVolumeDB()
{
return( maGainControl != null ? (short) maGainControl.getDB() : 0 );
}
// -------------------------------------------------------------------------
public synchronized void setMute( boolean bSet )
{
if( maGainControl != null )
maGainControl.setMute( bSet );
}
// -------------------------------------------------------------------------
public synchronized boolean isMute()
{
return( maGainControl != null ? maGainControl.getMute() : false );
}
// -------------------------------------------------------------------------
public synchronized com.sun.star.awt.Size getPreferredPlayerWindowSize()
{
java.awt.Component aVisualComponent = maPlayer.getVisualComponent();
com.sun.star.awt.Size aSize = new com.sun.star.awt.Size( 0, 0 );
if( aVisualComponent != null )
{
java.awt.Dimension aDim = aVisualComponent.getPreferredSize();
aSize.Width = Math.max( aDim.width, 0 );
aSize.Height = Math.max( aDim.height, 0 );
}
return aSize;
}
// -------------------------------------------------------------------------
public synchronized com.sun.star.media.XPlayerWindow createPlayerWindow( java.lang.Object[] aArgs )
{
try
{
com.sun.star.media.XPlayerWindow xPlayerWindow = ( ( ( aArgs.length > 1 ) && ( AnyConverter.toInt( aArgs[ 0 ] ) > 0 ) ) ?
new PlayerWindow( maFactory, aArgs, maPlayer ) :
null );
// check if it is a real player window (video window)
if( xPlayerWindow != null && xPlayerWindow.getZoomLevel() == com.sun.star.media.ZoomLevel.NOT_AVAILABLE )
xPlayerWindow = null;
return xPlayerWindow;
}
catch( com.sun.star.lang.IllegalArgumentException e )
{
return null;
}
}
// -------------------------------------------------------------------------
public synchronized com.sun.star.media.XFrameGrabber createFrameGrabber()
{
return( (com.sun.star.media.XFrameGrabber) new FrameGrabber( maFactory, maURL ) );
}
// --------------
// - XComponent -
// --------------
public synchronized void addEventListener( com.sun.star.lang.XEventListener xListener )
{
}
// -------------------------------------------------------------------------
public synchronized void removeEventListener( com.sun.star.lang.XEventListener xListener )
{
}
// -------------------------------------------------------------------------
public synchronized void dispose()
{
if( maPlayer != null )
{
maPlayer.stop();
maPlayer.close();
maPlayer = null;
}
}
// ----------------
// - XServiceInfo -
// ----------------
private static final String s_implName = "com.sun.star.comp.Player_Java";
private static final String s_serviceName = "com.sun.star.media.Player_Java";
public synchronized String getImplementationName()
{
return s_implName;
}
// -------------------------------------------------------------------------
public synchronized String [] getSupportedServiceNames()
{
return new String [] { s_serviceName };
}
// -------------------------------------------------------------------------
public synchronized boolean supportsService( String serviceName )
{
return serviceName.equals( s_serviceName );
}
}
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<!--**********************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
<component loader="com.sun.star.loader.Java2"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.media.Manager_Java">
<service name="com.sun.star.media.Manager_Java"/>
</implementation>
</component>
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License version 3
# only, as published by the Free Software Foundation.
#
# OpenOffice.org is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License version 3 for more details
# (a copy is included in the LICENSE file that accompanied this code).
#
# You should have received a copy of the GNU Lesser General Public License
# version 3 along with OpenOffice.org. If not, see
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
#**************************************************************************
# Builds the Java Canvas implementation.
PRJNAME = avmedia
PRJ = ..$/..
TARGET = avmedia
PACKAGE = avmedia
# --- Settings -----------------------------------------------------
.INCLUDE: settings.mk
.IF "$(GUIBASE)"=="javamedia"
JAVAFILES = \
Manager.java \
Player.java \
PlayerWindow.java \
WindowAdapter.java \
MediaUno.java \
FrameGrabber.java \
x11$/SystemWindowAdapter.java
JARFILES = jurt.jar unoil.jar ridl.jar juh.jar java_uno.jar jmf.jar
JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:s/.java//).class)
JARTARGET = $(TARGET).jar
JARCOMPRESS = TRUE
CUSTOMMANIFESTFILE = manifest
.ENDIF # "$(GUIBASE)"=="javamedia"
# --- Targets ------------------------------------------------------
.INCLUDE: target.mk
ALLTAR : $(MISC)/avmedia.jar.component
$(MISC)/avmedia.jar.component .ERRREMOVE : \
$(SOLARENV)/bin/createcomponent.xslt avmedia.jar.component
$(XSLTPROC) --nonet --stringparam uri \
'$(COMPONENTPREFIX_BASIS_JAVA)avmedia.jar' -o $@ \
$(SOLARENV)/bin/createcomponent.xslt avmedia.jar.component
RegistrationClassName: MediaUno
UNO-Type-Path:
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
import sun.awt.*;
import com.sun.star.awt.*;
public class SystemWindowAdapter
{
static public java.awt.Frame createFrame( int windowHandle )
{
java.awt.Frame aFrame;
// we're initialized with the operating system window handle
// as the parameter. We then generate a dummy Java frame with
// that window as the parent, to fake a root window for the
// Java implementation.
// now, we're getting slightly system dependent here.
String os = (String) System.getProperty( "os.name" );
// create the embedded frame
if( os.startsWith( "Windows" ) )
aFrame = new sun.awt.windows.WEmbeddedFrame( windowHandle );
else
throw new com.sun.star.uno.RuntimeException();
return aFrame;
}
}
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
import java.awt.*;
import java.lang.reflect.*;
public class SystemWindowAdapter
{
static public java.awt.Frame createFrame( int windowHandle )
{
String aOS = (String) System.getProperty( "os.name" );
java.awt.Frame aFrame = null;
if( aOS.startsWith( "SunOS" ) )
{
try
{
Class aClass = Class.forName( "sun.awt.motif.MEmbeddedFrame" );
if( aClass != null )
{
try
{
Constructor aCtor = aClass.getConstructor( new Class[] { long.class, boolean.class } );
if( aCtor != null )
{
aFrame = (java.awt.Frame) aCtor.newInstance( new Object[] { new Long( windowHandle ),
new Boolean( false ) } );
}
}
catch( Exception e )
{
}
if( aFrame == null )
{
try
{
Constructor aCtor = aClass.getConstructor( new Class[] { long.class } );
if( aCtor != null )
{
aFrame = (java.awt.Frame) aCtor.newInstance( new Object[] { new Long( windowHandle ) } );
}
}
catch( Exception e )
{
}
}
}
}
catch( Exception e )
{
}
}
else
{
try
{
Class aClass = Class.forName( "sun.awt.motif.MEmbeddedFrame" );
if( aClass != null )
{
Constructor aCtor = aClass.getConstructor( new Class[] { long.class } );
if( aCtor != null )
{
aFrame = (java.awt.Frame) aCtor.newInstance( new Object[] { new Long( windowHandle ) } );
}
}
}
catch( Exception e )
{
}
if( aFrame == null )
{
try
{
Class aClass = Class.forName( "sun.awt.X11.XEmbeddedFrame" );
if( aClass != null )
{
Constructor aCtor = aClass.getConstructor( new Class[] { long.class } );
if( aCtor != null )
aFrame = (java.awt.Frame) aCtor.newInstance( new Object[] { new Long( windowHandle ) } );
}
}
catch( Exception e )
{
}
}
}
return aFrame;
}
}
......@@ -362,10 +362,6 @@ my_components += evoab
my_components += avmediagstreamer
.END
.IF "$(OS)" != "WNT" && "$(SOLAR_JAVA)" == "TRUE"
my_components += avmedia.jar
.END
my_ooo_components = mailmerge
.INCLUDE: target.mk
......
......@@ -1466,17 +1466,11 @@ STD_LIB_FILE( gid_File_Lib_AVMedia, avmedia )
#ifdef GSTREAMER
SPECIAL_LIB_FILE_PATCH( gid_File_Lib_AVMediaGStreamer, avmediagst )
#else
#if defined UNX
#ifdef SOLAR_JAVA
STD_JAR_FILE( gid_File_Jar_AVmedia, avmedia )
#endif
#elif defined WNT
#ifdef ENABLE_DIRECTX
SPECIAL_LIB_FILE( gid_File_Lib_AVMediaWin, avmediawin )
#endif
#endif
#endif
#ifndef WITHOUT_MOZILLA
File gid_File_Lib_XSec_Framework
......
......@@ -150,7 +150,6 @@ Module gid_Module_Root_Files_3
gid_File_Jar_Xml_Apis,
gid_File_Jar_Bsh,
gid_File_Jar_Classes,
gid_File_Jar_AVmedia,
gid_File_Jar_Xsltfilter,
gid_File_Jar_Xsltvalidate,
gid_File_Jar_Docbook,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment