[Kde-bindings] KDE/kdebindings/ruby/plasma

Richard Dale Richard_Dale at tipitina.demon.co.uk
Thu Oct 30 19:39:05 UTC 2008


SVN commit 877961 by rdale:

* Separated the script engine plugins from the plasma ruby extension and moved
  the script engine code to kdebase with the other script engines

CCMAIL: kde-bindings at kde.org

 M  +4 -0      ChangeLog  
 D             examples/applets/plasma_applet_ruby_clock (directory)  
 D             examples/applets/plasma_applet_ruby_webapplet (directory)  
 D             examples/applets/tiger (directory)  
 M  +0 -8      src/CMakeLists.txt  
 D             src/applet.rb  
 D             src/data_engine.rb  
 M  +0 -179    src/lib/KDE/plasma.rb  
 D             src/package_ruboid.rb  
 D             src/plasma-scriptengine-ruby-applet.desktop  
 D             src/plasma-scriptengine-ruby-dataengine.desktop  
 D             src/plasma-scriptengine-ruby-package.desktop  
 M  +36 -33    src/plasmahandlers.cpp  


--- trunk/KDE/kdebindings/ruby/plasma/ChangeLog #877960:877961
@@ -1,3 +1,7 @@
+2008-10-30  Richard Dale  <richard.j.dale at gmail.com>
+* Separated the script engine plugins from the plasma ruby extension and moved
+  the script engine code to kdebase with the other script engines
+
 2008-10-23  Richard Dale  <richard.j.dale at gmail.com>
 * Converted the webapplet to use the script engine api, and renamed it
   plasma_applet_ruby_webapplet
--- trunk/KDE/kdebindings/ruby/plasma/src/CMakeLists.txt #877960:877961
@@ -20,11 +20,3 @@
 set_target_properties(plasma_applet PROPERTIES PREFIX "")
 install(TARGETS plasma_applet DESTINATION ${CUSTOM_RUBY_SITE_ARCH_DIR})
 
-install(FILES package_ruboid.rb DESTINATION ${DATA_INSTALL_DIR}/plasma_scriptengine_ruby)
-install(FILES applet.rb DESTINATION ${DATA_INSTALL_DIR}/plasma_scriptengine_ruby)
-install(FILES data_engine.rb DESTINATION ${DATA_INSTALL_DIR}/plasma_scriptengine_ruby)
-
-install(FILES plasma-scriptengine-ruby-package.desktop DESTINATION ${SERVICES_INSTALL_DIR})
-install(FILES plasma-scriptengine-ruby-applet.desktop DESTINATION ${SERVICES_INSTALL_DIR})
-install(FILES plasma-scriptengine-ruby-dataengine.desktop DESTINATION ${SERVICES_INSTALL_DIR})
-
--- trunk/KDE/kdebindings/ruby/plasma/src/lib/KDE/plasma.rb #877960:877961
@@ -80,182 +80,3 @@
   end
 
 end
-
-module PlasmaScripting
-  class Applet < Qt::Object
-  slots  "setImmutability(Plasma::ImmutabilityType)",
-            :destroy,
-            :showConfigurationInterface,
-            :raise,
-            :lower,
-            :flushPendingConstraintsEvents,
-            :init
-
-    signals :releaseVisualFocus,
-            :geometryChanged,
-            :configNeedsSaving,
-            :activate
-
-    attr_accessor :applet_script
-
-    def initialize(parent, args = nil)
-      super(parent)
-      @applet_script = parent
-      connect(@applet_script.applet, SIGNAL(:releaseVisualFocus), self, SIGNAL(:releaseVisualFocus))
-      connect(@applet_script.applet, SIGNAL(:geometryChanged), self, SIGNAL(:geometryChanged))
-      connect(@applet_script.applet, SIGNAL(:configNeedsSaving), self, SIGNAL(:configNeedsSaving))
-      connect(@applet_script.applet, SIGNAL(:activate), self, SIGNAL(:activate))
-    end
-
-    # If a method is called on a PlasmaScripting::Applet instance is found to be missing
-    # then try calling the method on the underlying Plasma::Applet in the ScriptEngine.
-    def method_missing(method, *args)
-      begin
-        super(method, *args)
-      rescue
-        applet_script.applet.method_missing(method, *args)
-      end
-    end
-
-    def self.const_missing(name)
-      begin
-        super(name)
-      rescue
-        Plasma::Applet.const_missing(name)
-      end
-    end
-
-    def paintInterface(painter, option, contentsRect)
-    end
-
-    def size
-      @applet_script.size
-    end
-
-    def shape
-      @applet_script.shape
-    end
-
-    def constraintsEvent(constraints)
-    end
-
-    def contextualActions
-      return []
-    end
-
-    def createConfigurationInterface(dialog)
-    end
-
-    def showConfigurationInterface
-        dialogId = "#{@applet_script.applet.id}settings#{@applet_script.applet.name}"
-        windowTitle = KDE::i18nc("@title:window", "%s Settings" % @applet_script.applet.name)
-        @nullManager = KDE::ConfigSkeleton.new(nil)
-        @dialog = KDE::ConfigDialog.new(nil, dialogId, @nullManager)
-        @dialog.faceType = KDE::PageDialog::Auto
-        @dialog.windowTitle = windowTitle
-        @dialog.setAttribute(Qt::WA_DeleteOnClose, true)
-        createConfigurationInterface(@dialog)
-        # TODO: would be nice to not show dialog if there are no pages added?
-        # Don't connect to the deleteLater() slot in Ruby as it causes crashes
-        # connect(@dialog, SIGNAL(:finished), @nullManager, SLOT(:deleteLater))
-        # TODO: Apply button does not correctly work for now, so do not show it
-        @dialog.showButton(KDE::Dialog::Apply, false)
-        @dialog.show
-    end
-
-    def dataEngine(engine)
-      @applet_script.dataEngine(engine)
-    end
-
-    def package
-      @applet_script.package
-    end
-
-    def setImmutability(immutabilityType)
-      @applet_script.applet.setImmutability(immutabilityType)
-    end
-
-    def immutability=(immutabilityType)
-      setImmutability(immutabilityType)
-    end
-
-    def destroy
-      @applet_script.applet.destroy
-    end
-
-    def raise
-      @applet_script.applet.raise
-    end
-
-    def lower
-      @applet_script.applet.lower
-    end
-
-    def flushPendingConstraintsEvents
-      @applet_script.applet.flushPendingConstraintsEvents
-    end
-  end
-
-  class DataEngine < Qt::Object
-    signals "sourceAdded(QString)", "sourceRemoved(QString)"
-
-    attr_accessor :data_engine_script
-
-    def initialize(parent, args = nil)
-      super(parent)
-      @data_engine_script = parent
-      connect(@data_engine_script.dataEngine, SIGNAL("sourceAdded(QString)"), self, SIGNAL("sourceAdded(QString)"))
-      connect(@data_engine_script.dataEngine, SIGNAL("sourceRemoved(QString)"), self, SIGNAL("sourceRemoved(QString)"))
-    end
-
-    def sourceRequestEvent(name)
-    end
-
-    def updateSourceEvent(source)
-    end
-
-    def setData(*args)
-      @data_engine_script.setData(*args)
-    end
-
-    def removeAllData(source)
-      @data_engine_script.removeAllData(source)
-    end
-
-    def removeData(source, key)
-      @data_engine_script.removeData(source, key)
-    end
-
-    def setMaxSourceCount(limit)
-      @data_engine_script.setMaxSourceCount(limit)
-    end
-
-    def maxSourceCount=(limit)
-      setMaxSourceCount(limit)
-    end
-
-    def setMinimumPollingInterval(minimumMs)
-      @data_engine_script.setMinimumPollingInterval(minimumMs)
-    end
-
-    def minimumPollingInterval=(minimumMs)
-      setMinimumPollingInterval(minimumMs)
-    end
-
-    def minimumPollingInterval
-      @data_engine_script.minimumPollingInterval
-    end
-
-    def setPollingInterval(frequency)
-      @data_engine_script.setPollingInterval(frequency)
-    end
-
-    def pollingInterval=(frequency)
-      setPollingInterval(frequency)
-    end
-
-    def removeAllSources
-      @data_engine_script.removeAllSources
-    end
-  end
-end
\ No newline at end of file
--- trunk/KDE/kdebindings/ruby/plasma/src/plasmahandlers.cpp #877960:877961
@@ -25,42 +25,45 @@
 #include <plasma/packagestructure.h>
 #include <plasma/containment.h>
 #include <plasma/applet.h>
+#include <plasma/datacontainer.h>
 
 void marshall_PackageStructurePtr(Marshall *m) {
-	switch(m->action()) {
-	case Marshall::FromVALUE: 
-		{
-		}
-		break;
-	case Marshall::ToVALUE: 
-		{
-		KSharedPtr<Plasma::PackageStructure> *ptr = new KSharedPtr<Plasma::PackageStructure>(*(KSharedPtr<Plasma::PackageStructure>*)m->item().s_voidp);
-	    if(ptr == 0) {
-		*(m->var()) = Qnil;
-		break;
-	    }
-	    Plasma::PackageStructure * package = ptr->data();
-	    
-		VALUE obj = getPointerObject(package);
-		if(obj == Qnil) {
-		    smokeruby_object  * o = ALLOC(smokeruby_object);
-		    o->smoke = m->smoke();
-		    o->classId = m->smoke()->idClass("Plasma::PackageStructure").index;
-		    o->ptr = package;
-		    o->allocated = true;
-		    obj = set_obj_info("Plasma::PackageStructure", o);
-		}
+    switch(m->action()) {
+    case Marshall::FromVALUE: 
+    {
+        break;
+    }
 
-	    *(m->var()) = obj;		
-	    
-		if(m->cleanup())
-		;
-		}
-		break;
-	default:
-		m->unsupported();
-		break;
-	}
+    case Marshall::ToVALUE: 
+    {
+        KSharedPtr<Plasma::PackageStructure> *ptr = new KSharedPtr<Plasma::PackageStructure>(*(KSharedPtr<Plasma::PackageStructure>*)m->item().s_voidp);
+        if (ptr == 0) {
+            *(m->var()) = Qnil;
+            break;
+        }
+        Plasma::PackageStructure * package = ptr->data();
+ 
+        VALUE obj = getPointerObject(package);
+        if (obj == Qnil) {
+            smokeruby_object  * o = ALLOC(smokeruby_object);
+            o->smoke = m->smoke();
+            o->classId = m->smoke()->idClass("Plasma::PackageStructure").index;
+            o->ptr = package;
+            o->allocated = true;
+            obj = set_obj_info("Plasma::PackageStructure", o);
+        }
+
+        *(m->var()) = obj;		
+
+        if (m->cleanup()) {
+        }
+        break;
+    }
+
+    default:
+        m->unsupported();
+        break;
+    }
 }
 
 void marshall_QHashQStringQVariant(Marshall *m) {



More information about the Kde-bindings mailing list