Effect's name in KWIN_EFFECT*() macros must now match effect's internal name in .desktop file,

without kwin4_effect_ prefix, so change the name in those macros to lowercase.
Some modifications to the macros themselves as well.

Effect loading via dcop might work again now.

svn path=/trunk/KDE/kdebase/workspace/; revision=669033
This commit is contained in:
Rivo Laks 2007-05-28 11:16:18 +00:00
parent 2ace94d3c8
commit 041673bf86
33 changed files with 50 additions and 47 deletions

View file

@ -22,8 +22,8 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Blur, BlurEffect )
KWIN_EFFECT_SUPPORTED( Blur, BlurEffect::supported() )
KWIN_EFFECT( blur, BlurEffect )
KWIN_EFFECT_SUPPORTED( blur, BlurEffect::supported() )
BlurEffect::BlurEffect() : Effect()

View file

@ -25,7 +25,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( BoxSwitch, BoxSwitchEffect )
KWIN_EFFECT( boxswitch, BoxSwitchEffect )
BoxSwitchEffect::BoxSwitchEffect()
: mActivated( 0 )

View file

@ -23,8 +23,8 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Demo_Liquid, LiquidEffect )
KWIN_EFFECT_SUPPORTED( Demo_Liquid, LiquidEffect::supported() )
KWIN_EFFECT( demo_liquid, LiquidEffect )
KWIN_EFFECT_SUPPORTED( demo_liquid, LiquidEffect::supported() )
LiquidEffect::LiquidEffect() : Effect()

View file

@ -13,7 +13,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Demo_ShiftWorkspaceUp, ShiftWorkspaceUpEffect )
KWIN_EFFECT( demo_shiftworkspaceup, ShiftWorkspaceUpEffect )
ShiftWorkspaceUpEffect::ShiftWorkspaceUpEffect()
: up( false )

View file

@ -16,7 +16,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Demo_ShowPicture, ShowPictureEffect )
KWIN_EFFECT( demo_showpicture, ShowPictureEffect )
ShowPictureEffect::ShowPictureEffect()
: init( true )

View file

@ -16,7 +16,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Demo_TaskbarThumbnail, TaskbarThumbnailEffect )
KWIN_EFFECT( demo_taskbarthumbnail, TaskbarThumbnailEffect )
TaskbarThumbnailEffect::TaskbarThumbnailEffect()
{

View file

@ -21,7 +21,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( DesktopGrid, DesktopGridEffect )
KWIN_EFFECT( desktopgrid, DesktopGridEffect )
const int PROGRESS_TIME = 500; // ms

View file

@ -13,7 +13,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( DialogParent, DialogParentEffect )
KWIN_EFFECT( dialogparent, DialogParentEffect )
void DialogParentEffect::prePaintWindow( EffectWindow* w, int* mask, QRegion* paint, QRegion* clip, int time )
{

View file

@ -14,7 +14,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( DimInactive, DimInactiveEffect )
KWIN_EFFECT( diminactive, DimInactiveEffect )
DimInactiveEffect::DimInactiveEffect()
{

View file

@ -15,7 +15,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Drunken, DrunkenEffect )
KWIN_EFFECT( drunken, DrunkenEffect )
void DrunkenEffect::prePaintScreen( int* mask, QRegion* region, int time )
{

View file

@ -23,8 +23,8 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Explosion, ExplosionEffect )
KWIN_EFFECT_SUPPORTED( Explosion, ExplosionEffect::supported() )
KWIN_EFFECT( explosion, ExplosionEffect )
KWIN_EFFECT_SUPPORTED( explosion, ExplosionEffect::supported() )
ExplosionEffect::ExplosionEffect() : Effect()
{

View file

@ -13,7 +13,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Fade, FadeEffect )
KWIN_EFFECT( fade, FadeEffect )
FadeEffect::FadeEffect()
: fade_in_speed( 20 )

View file

@ -16,7 +16,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( FallApart, FallApartEffect )
KWIN_EFFECT( fallapart, FallApartEffect )
void FallApartEffect::prePaintScreen( int* mask, QRegion* region, int time )
{

View file

@ -15,7 +15,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Flame, FlameEffect )
KWIN_EFFECT( flame, FlameEffect )
void FlameEffect::prePaintScreen( int* mask, QRegion* region, int time )
{

View file

@ -24,7 +24,7 @@ namespace KWin
{
// This macro creates entry function for the plugin. First argument is name, second is class name.
KWIN_EFFECT( Howto, HowtoEffect )
KWIN_EFFECT( howto, HowtoEffect )
// A pre-paint function that tells the compositing code how this effect will affect
// the painting. During every painting pass this function is called first, before

View file

@ -23,7 +23,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Magnifier, MagnifierEffect )
KWIN_EFFECT( magnifier, MagnifierEffect )
const int FRAME_WIDTH = 5;

View file

@ -13,7 +13,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( MakeTransparent, MakeTransparentEffect )
KWIN_EFFECT( maketransparent, MakeTransparentEffect )
void MakeTransparentEffect::prePaintWindow( EffectWindow* w, int* mask, QRegion* paint, QRegion* clip, int time )
{

View file

@ -14,7 +14,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( MinimizeAnimation, MinimizeAnimationEffect )
KWIN_EFFECT( minimizeanimation, MinimizeAnimationEffect )
MinimizeAnimationEffect::MinimizeAnimationEffect()
{

View file

@ -29,7 +29,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( MouseMark, MouseMarkEffect )
KWIN_EFFECT( mousemark, MouseMarkEffect )
MouseMarkEffect::MouseMarkEffect()
{

View file

@ -25,7 +25,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( PresentWindows, PresentWindowsEffect )
KWIN_EFFECT( presentwindows, PresentWindowsEffect )
PresentWindowsEffect::PresentWindowsEffect()
: mShowWindowsFromAllDesktops ( false )

View file

@ -13,7 +13,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( ScaleIn, ScaleInEffect )
KWIN_EFFECT( scalein, ScaleInEffect )
void ScaleInEffect::prePaintScreen( int* mask, QRegion* region, int time )
{

View file

@ -15,7 +15,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Shadow, ShadowEffect )
KWIN_EFFECT( shadow, ShadowEffect )
ShadowEffect::ShadowEffect()
: shadowXOffset( 10 )

View file

@ -13,7 +13,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( ShakyMove, ShakyMoveEffect )
KWIN_EFFECT( shakymove, ShakyMoveEffect )
ShakyMoveEffect::ShakyMoveEffect()
{

View file

@ -26,7 +26,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( ShowFps, ShowFpsEffect )
KWIN_EFFECT( showfps, ShowFpsEffect )
const int FPS_WIDTH = 10;
const int MAX_TIME = 100;

View file

@ -18,8 +18,8 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Test_FBO, TestFBOEffect )
KWIN_EFFECT_SUPPORTED( Test_FBO, TestFBOEffect::supported() )
KWIN_EFFECT( test_fbo, TestFBOEffect )
KWIN_EFFECT_SUPPORTED( test_fbo, TestFBOEffect::supported() )
TestFBOEffect::TestFBOEffect() : Effect()

View file

@ -29,7 +29,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Test_Input, TestInputEffect )
KWIN_EFFECT( test_input, TestInputEffect )
TestInputEffect::TestInputEffect()
{

View file

@ -20,7 +20,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Test_Thumbnail, TestThumbnailEffect )
KWIN_EFFECT( test_thumbnail, TestThumbnailEffect )
TestThumbnailEffect::TestThumbnailEffect()
: active_window( NULL )

View file

@ -17,7 +17,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( ThumbnailAside, ThumbnailAsideEffect )
KWIN_EFFECT( thumbnailaside, ThumbnailAsideEffect )
ThumbnailAsideEffect::ThumbnailAsideEffect()
{

View file

@ -26,7 +26,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( TrackMouse, TrackMouseEffect )
KWIN_EFFECT( trackmouse, TrackMouseEffect )
const int STARS = 5;
const int DIST = 50;

View file

@ -42,7 +42,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( VideoRecord, VideoRecordEffect )
KWIN_EFFECT( videorecord, VideoRecordEffect )
VideoRecordEffect::VideoRecordEffect()
: client( NULL )

View file

@ -17,7 +17,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( WavyWindows, WavyWindowsEffect )
KWIN_EFFECT( wavywindows, WavyWindowsEffect )
WavyWindowsEffect::WavyWindowsEffect()
{

View file

@ -17,7 +17,7 @@ License. See the file "COPYING" for the exact licensing terms.
namespace KWin
{
KWIN_EFFECT( Zoom, ZoomEffect )
KWIN_EFFECT( zoom, ZoomEffect )
ZoomEffect::ZoomEffect()
: zoom( 1 )

View file

@ -127,31 +127,34 @@ class KWIN_EXPORT Effect
/**
* Defines the class to be used for effect with given name
* E.g. KWIN_EFFECT( Flames, MyFlameEffect )
* Defines the class to be used for effect with given name.
* The name must be same as effect's X-KDE-PluginInfo-Name values in .desktop
* file, but without the "kwin4_effect_" prefix.
* E.g. KWIN_EFFECT( flames, MyFlameEffect )
* In this case object of MyFlameEffect class would be created when effect
* "Flames" is loaded.
* "flames" (which has X-KDE-PluginInfo-Name=kwin4_effect_flames in .desktop
* file) is loaded.
**/
#define KWIN_EFFECT( name, classname ) \
extern "C" { \
KWIN_EXPORT Effect* effect_create_##name() { return new classname; } \
KWIN_EXPORT Effect* effect_create_kwin4_effect_##name() { return new classname; } \
}
/**
* Defines the function used to check whether an effect is supported
* E.g. KWIN_EFFECT_SUPPORTED( Flames, MyFlameEffect::supported() )
* E.g. KWIN_EFFECT_SUPPORTED( flames, MyFlameEffect::supported() )
**/
#define KWIN_EFFECT_SUPPORTED( name, function ) \
extern "C" { \
KWIN_EXPORT bool effect_supported_##name() { return function; } \
KWIN_EXPORT bool effect_supported_kwin4_effect_##name() { return function; } \
}
/**
* Defines the function used to retrieve an effect's config widget
* E.g. KWIN_EFFECT_CONFIG( Flames, MyFlameEffect::configWidget() )
* E.g. KWIN_EFFECT_CONFIG( flames, MyFlameEffectConfig )
**/
#define KWIN_EFFECT_CONFIG( name, function ) \
extern "C" { \
KWIN_EXPORT Effect* effect_config_##name() { return function; } \
}
#define KWIN_EFFECT_CONFIG( name, classname ) \
K_EXPORT_COMPONENT_FACTORY( \
kcm_kwineffect_##name, \
KGenericFactory<classname>( "kcm_kwineffect_" #name ) )
class KWIN_EXPORT EffectsHandler