Convert zoom and videorecord to plugins.

svn path=/branches/work/kwin_composite/; revision=652616
This commit is contained in:
Luboš Luňák 2007-04-11 15:22:36 +00:00
parent ef0fee3633
commit 8973e88245
8 changed files with 36 additions and 29 deletions

View file

@ -17,13 +17,6 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/effects
)
include(UsePkgConfig)
PKGCONFIG(libcaptury CAPTURY_INCLUDES CAPTURY_LINK_DIR CAPTURY_LDFLAGS CAPTURY_CFLAGS)
if( CAPTURY_LDFLAGS )
SET( CAPTURY_FOUND TRUE )
endif( CAPTURY_LDFLAGS )
macro_bool_to_01( CAPTURY_FOUND HAVE_CAPTURY )
configure_file(config-kwin.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kwin.h )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
@ -93,10 +86,6 @@ endif (X11_Xrender_FOUND)
if (X11_Xfixes_FOUND)
target_link_libraries(kdeinit_kwin ${X11_Xfixes_LIB})
endif (X11_Xfixes_FOUND)
if( HAVE_CAPTURY )
target_link_libraries(kdeinit_kwin ${CAPTURY_LDFLAGS})
endif( HAVE_CAPTURY )
install(TARGETS kdeinit_kwin DESTINATION ${LIB_INSTALL_DIR} )

View file

@ -12,7 +12,6 @@ macro(KWIN4_ADD_EFFECT name)
install(TARGETS kwin4_effect_${name} DESTINATION ${PLUGIN_INSTALL_DIR})
endmacro(KWIN4_ADD_EFFECT)
include_directories(
${CMAKE_SOURCE_DIR}/workspace/kwin/lib
)
@ -20,17 +19,30 @@ include_directories(
SET(kwin4_effect_builtins_sources
presentwindows.cpp
diminactive.cpp
zoom.cpp
)
if(OPENGL_FOUND)
SET(kwin4_effect_builtins_sources ${kwin4_effect_builtins_sources}
shadow.cpp
showfps.cpp
)
install( FILES
shadow.desktop
showfps.desktop
DESTINATION ${DATA_INSTALL_DIR}/kwin/effects )
SET(kwin4_effect_builtins_sources ${kwin4_effect_builtins_sources}
shadow.cpp
showfps.cpp
)
install( FILES
shadow.desktop
showfps.desktop
DESTINATION ${DATA_INSTALL_DIR}/kwin/effects )
include(UsePkgConfig)
PKGCONFIG(libcaptury CAPTURY_INCLUDES CAPTURY_LINK_DIR CAPTURY_LDFLAGS CAPTURY_CFLAGS)
if( CAPTURY_LDFLAGS )
SET( CAPTURY_FOUND TRUE )
endif( CAPTURY_LDFLAGS )
macro_bool_to_01( CAPTURY_FOUND HAVE_CAPTURY )
if( HAVE_CAPTURY )
KWIN4_ADD_EFFECT(videorecord videorecord.cpp)
target_link_libraries(kwin4_effect_videorecord ${CAPTURY_LDFLAGS})
install( FILES videorecord.desktop DESTINATION ${DATA_INSTALL_DIR}/kwin/effects )
endif( HAVE_CAPTURY )
endif(OPENGL_FOUND)
if (X11_Xrender_FOUND)
@ -41,4 +53,6 @@ KWIN4_ADD_EFFECT(builtins ${kwin4_effect_builtins_sources})
install( FILES
presentwindows.desktop
diminactive.desktop
zoom.desktop
DESTINATION ${DATA_INSTALL_DIR}/kwin/effects )

View file

@ -39,8 +39,6 @@ License. See the file "COPYING" for the exact licensing terms.
#include <kactioncollection.h>
#include <klocale.h>
#include <workspace.h>
#include <GL/gl.h>
namespace KWin
@ -117,7 +115,7 @@ void VideoRecordEffect::startRecording()
kDebug( 1212 ) << "Video recording file open failed" << endl;
return;
}
workspace()->addRepaintFull(); // trigger reading initial screen contents into buffer
effects->addRepaintFull(); // trigger reading initial screen contents into buffer
kDebug( 1212 ) << "Video recording start" << endl;
}

View file

@ -0,0 +1,4 @@
[Desktop Entry]
Encoding=UTF-8
Name=Videorecord
X-KDE-Library=kwin4_effect_videorecord

View file

@ -11,7 +11,7 @@ License. See the file "COPYING" for the exact licensing terms.
#ifndef KWIN_VIDEO_H
#define KWIN_VIDEO_H
#include <effects.h>
#include <kwineffects.h>
#include <captury/captury.h>

View file

@ -10,8 +10,6 @@ License. See the file "COPYING" for the exact licensing terms.
#include "zoom.h"
#include <workspace.h>
namespace KWin
{
@ -32,7 +30,7 @@ void ZoomEffect::prePaintScreen( int* mask, QRegion* region, int time )
zoom = qMax( zoom - diff, target_zoom );
}
if( zoom != 1.0 )
*mask |= Scene::PAINT_SCREEN_TRANSFORMED;
*mask |= PAINT_SCREEN_TRANSFORMED;
effects->prePaintScreen( mask, region, time );
}
@ -53,7 +51,7 @@ void ZoomEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
void ZoomEffect::postPaintScreen()
{
if( zoom != target_zoom )
workspace()->addRepaintFull();
effects->addRepaintFull();
effects->postPaintScreen();
}

4
effects/zoom.desktop Normal file
View file

@ -0,0 +1,4 @@
[Desktop Entry]
Encoding=UTF-8
Name=Zoom
X-KDE-Library=kwin4_effect_builtins

View file

@ -11,7 +11,7 @@ License. See the file "COPYING" for the exact licensing terms.
#ifndef KWIN_ZOOM_H
#define KWIN_ZOOM_H
#include <effects.h>
#include <kwineffects.h>
namespace KWin
{