Hello community,
here is the log from the commit of package simple-ccsm-kde
checked in at Fri Oct 17 01:33:29 CEST 2008.
--------
--- KDE/simple-ccsm-kde/simple-ccsm-kde.changes 2008-09-11 12:26:34.000000000 +0200
+++ /mounts/work_src_done/STABLE/simple-ccsm-kde/simple-ccsm-kde.changes 2008-10-16 18:25:21.000000000 +0200
@@ -1,0 +2,5 @@
+Thu Oct 16 18:25:09 CEST 2008 - llunak@suse.cz
+
+- Adjust for animation plugin changes (bnc#428106)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ simple-ccsm-kde.spec ++++++
--- /var/tmp/diff_new_pack.wE6350/_old 2008-10-17 01:33:07.000000000 +0200
+++ /var/tmp/diff_new_pack.wE6350/_new 2008-10-17 01:33:07.000000000 +0200
@@ -26,7 +26,7 @@
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Summary: KDE Simple Settings Manager for Compiz
Version: 1.0
-Release: 1
+Release: 3
Source: simple-ccsm-kde-%{version}.tar.bz2
%description
@@ -64,6 +64,8 @@
%_kde_share_dir/apps/simple-ccsm-kde
%changelog
+* Thu Oct 16 2008 llunak@suse.cz
+- Adjust for animation plugin changes (bnc#428106)
* Thu Sep 11 2008 llunak@suse.cz
- Let's call it feature complete
* Thu Sep 04 2008 llunak@suse.cz
++++++ simple-ccsm-kde-1.0.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/simple-ccsm-kde-1.0/dialog.cpp new/simple-ccsm-kde-1.0/dialog.cpp
--- old/simple-ccsm-kde-1.0/dialog.cpp 2008-09-10 20:42:31.000000000 +0200
+++ new/simple-ccsm-kde-1.0/dialog.cpp 2008-10-16 18:21:19.000000000 +0200
@@ -187,21 +187,20 @@
void Dialog::setupAnimation()
{
ui.animations_enable->setChecked( pluginActive( "animation" ));
- CCSPlugin* animation = plugin( "animation" );
- setupCombo( animation, "open_effects", ui.open_label, ui.open_combo );
- setupCombo( animation, "close_effects", ui.close_label, ui.close_combo );
- setupCombo( animation, "minimize_effects", ui.minimize_label, ui.minimize_combo );
- setupCombo( animation, "focus_effects", ui.focus_label, ui.focus_combo );
+ setupAnimationCombo( "open_effects", ui.open_label, ui.open_combo );
+ setupAnimationCombo( "close_effects", ui.close_label, ui.close_combo );
+ setupAnimationCombo( "minimize_effects", ui.minimize_label, ui.minimize_combo );
+ setupAnimationCombo( "focus_effects", ui.focus_label, ui.focus_combo );
}
void Dialog::saveAnimation()
{
CCSPlugin* animation = plugin( "animation" );
ccsPluginSetActive( animation, ui.animations_enable->isChecked());
- saveCombo( animation, "open_effects", ui.open_combo );
- saveCombo( animation, "close_effects", ui.close_combo );
- saveCombo( animation, "minimize_effects", ui.minimize_combo );
- saveCombo( animation, "focus_effects", ui.focus_combo );
+ saveAnimationCombo( "open_effects", ui.open_combo );
+ saveAnimationCombo( "close_effects", ui.close_combo );
+ saveAnimationCombo( "minimize_effects", ui.minimize_combo );
+ saveAnimationCombo( "focus_effects", ui.focus_combo );
}
void Dialog::setupSwitcher()
@@ -332,8 +331,8 @@
void Dialog::updateDesktop()
{ // cube can't do 2d desktop
- ui.desktop_rows_label->setDisabled( ui.desktop_appearance_combo->currentIndex() == 0 );
- ui.desktop_rows_spinbox->setDisabled( ui.desktop_appearance_combo->currentIndex() == 0 );
+ ui.desktop_rows_label->setDisabled( ui.desktop_appearance_combo->currentIndex() == 1 );
+ ui.desktop_rows_spinbox->setDisabled( ui.desktop_appearance_combo->currentIndex() == 1 );
}
void Dialog::setupAccessibility()
@@ -448,31 +447,34 @@
label->setToolTip( s->longDesc );
combo->setToolTip( s->longDesc );
// kdDebug() << "TYPE:" << s->info.forList.listType;
- int active;
- CCSIntDescList l;
- if( s->type == TypeList )
- {
- assert( s->info.forList.listType == TypeInt );
- active = listIntOption( s );
- l = s->info.forList.listInfo->forInt.desc;
- }
- else if( s->type == TypeInt )
+ if(( s->type == TypeList && s->info.forList.listType == TypeInt )
+ || s->type == TypeInt )
{
- ccsGetInt( s, &active );
- l = s->info.forInt.desc;
+ int active;
+ CCSIntDescList l;
+ if( s->type == TypeList )
+ {
+ active = listIntOption( s );
+ l = s->info.forList.listInfo->forInt.desc;
+ }
+ else // s->type == TypeInt
+ {
+ ccsGetInt( s, &active );
+ l = s->info.forInt.desc;
+ }
+// kdDebug() << "ACT:" << active;
+ for( ;
+ l != NULL;
+ l = l->next )
+ {
+// kdDebug() << "IT:" << l->data->name;
+ combo->addItem( l->data->name, l->data->value );
+ if( l->data->value == active ) // set active
+ combo->setCurrentIndex( combo->count() - 1 );
+ }
}
else
abort();
-// kdDebug() << "ACT:" << active;
- for( ;
- l != NULL;
- l = l->next )
- {
-// kdDebug() << "IT:" << l->data->name;
- combo->addItem( l->data->name, l->data->value );
- if( l->data->value == active ) // set active
- combo->setCurrentIndex( combo->count() - 1 );
- }
}
void Dialog::saveCombo( CCSPlugin* p, const char* option, QComboBox* combo )
@@ -483,13 +485,77 @@
CCSSettingValueList l;
int val[ 1 ] = { combo->itemData( combo->currentIndex()).toInt() };
l = ccsGetValueListFromIntArray( val, 1, s );
- ccsSetList( s, l );
+ if (l)
+ {
+ ccsSetList( s, l );
+ ccsSettingValueListFree( l, TRUE );
+ }
}
else if( s->type == TypeInt )
ccsSetInt( s, combo->itemData( combo->currentIndex()).toInt());
else
abort();
- // leaks?
+ }
+
+void Dialog::setupAnimationCombo( const char* option, QLabel* label, QComboBox* combo )
+ {
+ CCSPlugin* p = plugin( "animation" );
+ CCSSetting* s = setting( p, option );
+ label->setText( s->shortDesc );
+ label->setToolTip( s->longDesc );
+ combo->setToolTip( s->longDesc );
+ assert( s->type == TypeList && s->info.forList.listType == TypeString );
+ QString active = listStringOption( s );
+// kdDebug() << "ACT:" << active;
+ for( CCSPluginList pl = context->plugins;
+ pl != NULL;
+ pl = pl->next )
+ {
+ if( !QString( pl->data->name ).startsWith( "animation" ))
+ continue;
+ CCSPlugin* p = plugin( pl->data->name );
+ for( CCSStrExtensionList el = ccsGetPluginStrExtensions( p );
+ el != NULL;
+ el = el->next )
+ {
+ if( qstrcmp( el->data->basePlugin, "animation" ) == 0 )
+ {
+ for( CCSStrRestrictionList rl = el->data->restriction;
+ rl != NULL;
+ rl = rl->next )
+ {
+// kdDebug() << "IT:" << rl->data->name;
+ combo->addItem( rl->data->name, rl->data->value );
+ if( rl->data->value == active ) // set active
+ combo->setCurrentIndex( combo->count() - 1 );
+ }
+ }
+ }
+ // TODO leaks?
+ }
+ }
+
+void Dialog::saveAnimationCombo( const char* option, QComboBox* combo )
+ {
+ CCSPlugin* p = plugin( "animation" );
+ CCSSetting* s = setting( p, option );
+ assert( s->type == TypeList && s->info.forList.listType == TypeString );
+ {
+ CCSSettingValueList l;
+ QByteArray ba = combo->itemData( combo->currentIndex()).toString().toLocal8Bit();
+ char* val[ 1 ] = { ba.data() };
+ l = ccsGetValueListFromStringArray( val, 1, s );
+ if (l)
+ {
+ ccsSetList( s, l );
+ ccsSettingValueListFree( l, TRUE );
+ }
+ if( ba.indexOf( ':' ) >= 0 )
+ { // activate the needed plugin
+ if( CCSPlugin* p2 = plugin( ba.left( ba.indexOf( ':' ))))
+ ccsPluginSetActive( p2, TRUE );
+ }
+ }
}
void Dialog::setupSpinbox( CCSPlugin* p, const char* option, QLabel* label, QDoubleSpinBox* spinbox )
@@ -568,76 +634,21 @@
CCSSettingButtonValue val;
ccsGetButton( s, &val );
KAcceleratorManager::setNoAccel( button );
- button->setText( buttonToString( val ));
+ char *binding = ccsButtonBindingToString( &val );
+ if (binding)
+ {
+ button->setText( binding );
+ free( binding );
+ }
}
void Dialog::saveKeyButton( CCSPlugin* plugin, const char* option, QPushButton* button )
{
CCSSetting* s = setting( plugin, option );
- ccsSetButton( s, stringToButton( button->text()));
- }
+ CCSSettingButtonValue value;
-// TODO libcompizconfig actually has functions for this, use them
-static const char* const edges[] = { "LeftEdge", "RightEdge", "TopEdge", "BottomEdge",
- "TopLeftEdge", "TopRightEdge", "BottomLeftEdge", "BottomRightEdge", NULL };
-// TODO use Ctrl and Meta to match KDE
-// Shift = ShiftMask = (1<<0) [from X.h]
-// Control = ControlMask = (1<<2) [from X.h]
-// Alt = CompAltMask = (1<<16) [from compiz.h]
-// Super = CompSuperMask = (1<<18) [from compiz.h]
-static const char* const mods[] = { "Shift", "", "Control", "", "", "", "", "", "", "", "", "", "",
- "", "", "", "Alt", "", "Super", NULL };
-
-static QString bitmapToString( unsigned int bitmap, const char* const items[] )
- {
- QString ret;
- for( int i = 0;
- i < 32 && items[ i ] != NULL;
- ++i )
- if( bitmap & ( 1 << i ))
- ret += '<' + QString( items[ i ] ) + '>';
- return ret;
- }
-
-static unsigned int stringToBitmap( const QString& string, const char* const items[] )
- {
- if( !string.contains( '>' ))
- return 0;
- int ret = 0;
- // split for each item in <>
- foreach( QString s, string.mid( 1, string.lastIndexOf( '>' ) - 1 ).split( "><" ))
- {
- for( int i = 0;
- items[ i ] != NULL;
- ++i )
- {
- if( items[ i ] == s )
- {
- ret |= ( 1 << i );
- break;
- }
- }
- }
- return ret;
- }
-
-QString Dialog::buttonToString( const CCSSettingButtonValue& button )
- {
- return bitmapToString( button.edgeMask, edges ) + bitmapToString( button.buttonModMask, mods )
- + ( button.button == 0 ? "Disabled" : QString( "Button%1" ).arg( button.button ));
- }
-
-CCSSettingButtonValue Dialog::stringToButton( const QString& button )
- {
- CCSSettingButtonValue val;
- val.edgeMask = stringToBitmap( button, edges );
- val.buttonModMask = stringToBitmap( button, mods );
- QRegExp reg( ".*Button([0-9])" );
- if( reg.exactMatch( button ))
- val.button = reg.cap( 1 ).toInt();
- else
- val.button = 0;
- return val;
+ if (ccsStringToButtonBinding( button->text().toAscii(), &value ))
+ ccsSetButton( s, value );
}
void Dialog::editScreenZoomIn()
@@ -662,14 +673,22 @@
void Dialog::editButton( QPushButton* button )
{
- CCSSettingButtonValue val = stringToButton( button->text());
+ CCSSettingButtonValue val;
+ if (!ccsStringToButtonBinding( button->text().toAscii(), &val) )
+ return;
ButtonDialog dialog( this, val.edgeMask, val.buttonModMask, val.button );
if( dialog.exec() == KDialog::Accepted )
{
val.edgeMask = dialog.edgeMask();
val.buttonModMask = dialog.buttonModMask();
val.button = dialog.button();
- button->setText( buttonToString( val ));
+
+ char *binding = ccsButtonBindingToString( &val );
+ if (binding)
+ {
+ button->setText( binding );
+ free( binding );
+ }
}
}
@@ -705,10 +724,31 @@
{
CCSSettingValueList l;
ccsGetList( s, &l );
- int num;
+ int num, retval = 0;
int* val = ccsGetIntArrayFromValueList( l, &num );
- return num >= 1 ? val[ 0 ] : 0;
- // leaks? who knows ...
+ if ( l != NULL)
+ {
+ if (num >= 1)
+ retval = val[ 0 ];
+ free( val );
+ }
+ return retval;
+ }
+
+QString Dialog::listStringOption( CCSSetting* s )
+ {
+ CCSSettingValueList l;
+ ccsGetList( s, &l );
+ int num;
+ QString retval;
+ char** val = ccsGetStringArrayFromValueList( l, &num );
+ if ( l != NULL)
+ {
+ if (num >= 1)
+ retval = val[ 0 ];
+ free( val );
+ }
+ return retval;
}
Widget::Widget( QWidget* parent )
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/simple-ccsm-kde-1.0/dialog.h new/simple-ccsm-kde-1.0/dialog.h
--- old/simple-ccsm-kde-1.0/dialog.h 2008-09-10 20:42:31.000000000 +0200
+++ new/simple-ccsm-kde-1.0/dialog.h 2008-10-16 18:21:19.000000000 +0200
@@ -76,6 +76,8 @@
void saveEdges();
void setupCombo( CCSPlugin* plugin, const char* option, QLabel* label, QComboBox* combo );
void saveCombo( CCSPlugin* plugin, const char* option, QComboBox* combo );
+ void setupAnimationCombo( const char* option, QLabel* label, QComboBox* combo );
+ void saveAnimationCombo( const char* option, QComboBox* combo );
void setupSpinbox( CCSPlugin* plugin, const char* option, QLabel* label, QDoubleSpinBox* spinbox );
void saveSpinbox( CCSPlugin* plugin, const char* option, QDoubleSpinBox* spinbox );
void setupCheckbox( CCSPlugin* plugin, const char* option, bool group, QCheckBox* checkbox );
@@ -85,6 +87,7 @@
void setupKeyButton( CCSPlugin* plugin, const char* option, QLabel* label, QPushButton* button );
void saveKeyButton( CCSPlugin* plugin, const char* option, QPushButton* button );
int listIntOption( CCSSetting* s );
+ QString listStringOption( CCSSetting* s );
void addEdge( int edge, CCSPlugin* plugin, const char* option, int index );
void saveEdge( CCSPlugin* plugin, const char* option, unsigned int edges );
QString buttonToString( const CCSSettingButtonValue& button );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/simple-ccsm-kde-1.0/main.cpp new/simple-ccsm-kde-1.0/main.cpp
--- old/simple-ccsm-kde-1.0/main.cpp 2008-09-09 18:51:08.000000000 +0200
+++ new/simple-ccsm-kde-1.0/main.cpp 2008-09-12 10:57:44.000000000 +0200
@@ -16,10 +16,10 @@
*********************************************************************/
#include