Author: mlandres Date: Wed Dec 5 17:06:40 2007 New Revision: 8036 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8036&view=rev Log: missing resolvable types added Added: trunk/libzypp-bindings/swig/Atom.i trunk/libzypp-bindings/swig/Language.i trunk/libzypp-bindings/swig/Message.i trunk/libzypp-bindings/swig/Pattern.i trunk/libzypp-bindings/swig/Product.i trunk/libzypp-bindings/swig/Script.i trunk/libzypp-bindings/swig/SrcPackage.i Modified: trunk/libzypp-bindings/swig/PoolItem.i trunk/libzypp-bindings/swig/ResObject.i trunk/libzypp-bindings/swig/ResStatus.i trunk/libzypp-bindings/swig/ResTraits.i trunk/libzypp-bindings/swig/zypp.i Added: trunk/libzypp-bindings/swig/Atom.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Atom.i?rev=8036&view=auto ============================================================================== --- trunk/libzypp-bindings/swig/Atom.i (added) +++ trunk/libzypp-bindings/swig/Atom.i Wed Dec 5 17:06:40 2007 @@ -0,0 +1,20 @@ + class Atom : public ResObject + { + public: + typedef detail::AtomImplIf Impl; + typedef Atom Self; + typedef ResTraits<Self> TraitsType; + typedef TraitsType::PtrType Ptr; + typedef TraitsType::constPtrType constPtr; + + protected: + Atom( const NVRAD & nvrad_r ); + /** Dtor */ + virtual ~Atom(); + + private: + /** Access implementation */ + virtual Impl & pimpl() = 0; + /** Access implementation */ + virtual const Impl & pimpl() const = 0; + }; Added: trunk/libzypp-bindings/swig/Language.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Language.i?rev=8036&view=auto ============================================================================== --- trunk/libzypp-bindings/swig/Language.i (added) +++ trunk/libzypp-bindings/swig/Language.i Wed Dec 5 17:06:40 2007 @@ -0,0 +1,26 @@ + class Language : public ResObject + { + public: + typedef detail::LanguageImplIf Impl; + typedef Language Self; + typedef ResTraits<Self> TraitsType; + typedef TraitsType::PtrType Ptr; + typedef TraitsType::constPtrType constPtr; + + /** Installed Language instance. */ + static Ptr installedInstance( const Locale & locale_r ); + /** Available Language instance. */ + static Ptr availableInstance( const Locale & locale_r ); + + protected: + /** Ctor */ + Language( const NVRAD & nvrad_r ); + /** Dtor */ + virtual ~Language(); + + private: + /** Access implementation */ + virtual Impl & pimpl() = 0; + /** Access implementation */ + virtual const Impl & pimpl() const = 0; + }; Added: trunk/libzypp-bindings/swig/Message.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Message.i?rev=8036&view=auto ============================================================================== --- trunk/libzypp-bindings/swig/Message.i (added) +++ trunk/libzypp-bindings/swig/Message.i Wed Dec 5 17:06:40 2007 @@ -0,0 +1,26 @@ + class Message : public ResObject + { + public: + typedef detail::MessageImplIf Impl; + typedef Message Self; + typedef ResTraits<Self> TraitsType; + typedef TraitsType::PtrType Ptr; + typedef TraitsType::constPtrType constPtr; + + public: + /** Get the text of the message */ + TranslatedText text() const; + /** Patch the message belongs to - if any */ + Patch::constPtr patch() const; + + protected: + Message( const NVRAD & nvrad_r ); + /** Dtor */ + virtual ~Message(); + + private: + /** Access implementation */ + virtual Impl & pimpl() = 0; + /** Access implementation */ + virtual const Impl & pimpl() const = 0; + }; Added: trunk/libzypp-bindings/swig/Pattern.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Pattern.i?rev=8036&view=auto ============================================================================== --- trunk/libzypp-bindings/swig/Pattern.i (added) +++ trunk/libzypp-bindings/swig/Pattern.i Wed Dec 5 17:06:40 2007 @@ -0,0 +1,43 @@ + class Pattern : public ResObject + { + public: + typedef detail::PatternImplIf Impl; + typedef Pattern Self; + typedef ResTraits<Self> TraitsType; + typedef TraitsType::PtrType Ptr; + typedef TraitsType::constPtrType constPtr; + + public: + /** */ + bool isDefault() const; + /** */ + bool userVisible() const; + /** */ + std::string category() const; + /** */ + Pathname icon() const; + /** */ + Pathname script() const; + /** */ + Label order() const; + + /** \deprecated AFAIK unused old Selection interface method. */ + std::setstd::string install_packages( const Locale & lang = Locale("") ) const; + + /** Ui hint. */ + const CapSet & includes() const; + /** Ui hint. */ + const CapSet & extends() const; + + protected: + /** Ctor */ + Pattern( const NVRAD & nvrad_r ); + /** Dtor */ + virtual ~Pattern(); + + private: + /** Access implementation */ + virtual Impl & pimpl() = 0; + /** Access implementation */ + virtual const Impl & pimpl() const = 0; + }; Modified: trunk/libzypp-bindings/swig/PoolItem.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/PoolItem.i?rev=8036&r1=8035&r2=8036&view=diff ============================================================================== --- trunk/libzypp-bindings/swig/PoolItem.i (original) +++ trunk/libzypp-bindings/swig/PoolItem.i Wed Dec 5 17:06:40 2007 @@ -56,3 +56,12 @@ typedef PoolItem_Ref PoolItem; +%extend PoolItem_Ref +{ + std::string asString() const + { + std::ostringstream str; + str << *self; + return str.str(); + } +} \ No newline at end of file Added: trunk/libzypp-bindings/swig/Product.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Product.i?rev=8036&view=auto ============================================================================== --- trunk/libzypp-bindings/swig/Product.i (added) +++ trunk/libzypp-bindings/swig/Product.i Wed Dec 5 17:06:40 2007 @@ -0,0 +1,68 @@ + class Product : public ResObject + { + public: + typedef detail::ProductImplIf Impl; + typedef Product Self; + typedef ResTraits<Self> TraitsType; + typedef TraitsType::PtrType Ptr; + typedef TraitsType::constPtrType constPtr; + + public: + /** Get the product type (base, add-on) */ + std::string type() const; + /** \deprecated Use \ref type. */ + std::string category() const + { return type(); } + + /** Get the vendor of the product */ + Label vendor() const; + + /** The URL to download the release notes for this product */ + Url releaseNotesUrl() const; + + /** + * Online updates for the product. + * They are complementary, not alternatives. #163192 + */ + std::list<Url> updateUrls() const; + + /** + * Additional software for the product + * They are complementary, not alternatives. + */ + std::list<Url> extraUrls() const; + + /** + * Optional software for the product + * (for example. Non OSS repositories) + * They are complementary, not alternatives. + */ + std::list<Url> optionalUrls() const; + + /** The product flags */ + std::liststd::string flags() const; + + /** */ + Label shortName() const; + + /** */ + Label longName() const; + + /** Vendor specific distribution id. */ + std::string distributionName() const; + + /** Vendor specific distribution version. */ + Edition distributionEdition() const; + + protected: + /** Ctor */ + Product( const NVRAD & nvrad_r ); + /** Dtor */ + virtual ~Product(); + + private: + /** Access implementation */ + virtual Impl & pimpl() = 0; + /** Access implementation */ + virtual const Impl & pimpl() const = 0; + }; Modified: trunk/libzypp-bindings/swig/ResObject.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ResObject.i?rev=8036&r1=8035&r2=8036&view=diff ============================================================================== --- trunk/libzypp-bindings/swig/ResObject.i (original) +++ trunk/libzypp-bindings/swig/ResObject.i Wed Dec 5 17:06:40 2007 @@ -1,6 +1,4 @@ -%template(ResObject_constPtr) intrusive_ptr<const ResObject>; - class ResObject : public Resolvable { public: @@ -29,30 +27,3 @@ const NVRAD & nvrad_r ); virtual ~ResObject(); }; - - -#if 0 -%extend intrusive_ptr<const ResObject> -{ - // FIXME: this is just a workaround, see Kind.i - const char* kindToS() - { - if (isKind<Package>(*self)) - return "package"; - else if (isKind<Patch>(*self)) - return "patch"; - else if (isKind<Product>(*self)) - return "product"; - else if (isKind<Pattern>(*self)) - return "pattern"; - else if (isKind<Language>(*self)) - return "language"; - return "unknown"; - } - - int __cmp__(intrusive_ptr<const ResObject>& other) - { - return compareByNVRA(*self, other); - } -} -#endif Modified: trunk/libzypp-bindings/swig/ResStatus.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ResStatus.i?rev=8036&r1=8035&r2=8036&view=diff ============================================================================== --- trunk/libzypp-bindings/swig/ResStatus.i (original) +++ trunk/libzypp-bindings/swig/ResStatus.i Wed Dec 5 17:06:40 2007 @@ -374,11 +374,11 @@ #ifdef SWIGPERL5 %extend ResStatus { - + bool setToBeInstalledUser() - { + { return self->setToBeInstalled(ResStatus::USER); - } + } bool resetTransactUser() { @@ -386,3 +386,13 @@ } }; #endif + +%extend ResStatus +{ + std::string asString() const + { + std::ostringstream str; + str << *self; + return str.str(); + } +} \ No newline at end of file Modified: trunk/libzypp-bindings/swig/ResTraits.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ResTraits.i?rev=8036&r1=8035&r2=8036&view=diff ============================================================================== --- trunk/libzypp-bindings/swig/ResTraits.i (original) +++ trunk/libzypp-bindings/swig/ResTraits.i Wed Dec 5 17:06:40 2007 @@ -15,25 +15,49 @@ %template(ResTraitsResolvable) ResTraits<Resolvable>; -#ifdef SWIGPYTHON -%pythoncode %{ -def KindOfPackage(): - return KindOfResolvable( "package" ) -def KindOfSrcPackage(): - return KindOfResolvable( "srcpackage" ) -def KindOfPatch(): - return KindOfResolvable( "patch" ) -def KindOfPattern(): - return KindOfResolvable( "pattern" ) -def KindOfProduct(): - return KindOfResolvable( "product" ) -def KindOfAtom(): - return KindOfResolvable( "atom" ) -def KindOfScript(): - return KindOfResolvable( "script" ) -def KindOfMessage(): - return KindOfResolvable( "message" ) -def KindOfLanguage(): - return KindOfResolvable( "language" ) -%} +%template(ResObject_constPtr) intrusive_ptr<const ResObject>; +%template(ResObject_Ptr) intrusive_ptr<ResObject>; + +%define %STUFF(X) +typedef intrusive_ptr<const X> X##_constPtr; +typedef intrusive_ptr<X> X##_Ptr; + +%template(X##_constPtr) intrusive_ptr<const X>; +%template(X##_Ptr) intrusive_ptr<X>; + +bool isKind##X( const Resolvable::constPtr & p ); +bool isKind##X( const PoolItem & p ); + +X##_constPtr asKind##X( const Resolvable::constPtr & p ); +X##_constPtr asKind##X( const PoolItem & p ); + +%header +{ + inline bool isKind##X( const Resolvable::constPtr & p ) + { return isKind<X>( p ); } + inline bool isKind##X( const PoolItem & p ) + { return isKind<X>( p.resolvable() ); } + + inline X::constPtr asKind##X( const Resolvable::constPtr & p ) + { return asKind<X>( p ); } + inline X::constPtr asKind##X( const PoolItem & p ) + { return asKind<X>( p.resolvable() ); } +} +#if defined(SWIGPYTHON) +%pythoncode +{ + def KindOf##X(): + return KindOfResolvable( #X ) +} #endif +%enddef + +%STUFF(Package) +%STUFF(Patch) +%STUFF(SrcPackage) +%STUFF(Pattern) +%STUFF(Product) +%STUFF(Atom) +%STUFF(Script) +%STUFF(Message) +%STUFF(Language) Added: trunk/libzypp-bindings/swig/Script.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Script.i?rev=8036&view=auto ============================================================================== (empty) Added: trunk/libzypp-bindings/swig/SrcPackage.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/SrcPackage.i?rev=8036&view=auto ============================================================================== --- trunk/libzypp-bindings/swig/SrcPackage.i (added) +++ trunk/libzypp-bindings/swig/SrcPackage.i Wed Dec 5 17:06:40 2007 @@ -0,0 +1,25 @@ + class SrcPackage : public ResObject + { + + public: + typedef detail::SrcPackageImplIf Impl; + typedef SrcPackage Self; + typedef ResTraits<Self> TraitsType; + typedef TraitsType::PtrType Ptr; + typedef TraitsType::constPtrType constPtr; + + public: + /** location of resolvable in repo */ + OnMediaLocation location() const; + + protected: + SrcPackage( const NVRAD & nvrad_r ); + /** Dtor */ + virtual ~SrcPackage(); + + private: + /** Access implementation */ + virtual Impl & pimpl() = 0; + /** Access implementation */ + virtual const Impl & pimpl() const = 0; + }; Modified: trunk/libzypp-bindings/swig/zypp.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/zypp.i?rev=8036&r1=8035&r2=8036&view=diff ============================================================================== --- trunk/libzypp-bindings/swig/zypp.i (original) +++ trunk/libzypp-bindings/swig/zypp.i Wed Dec 5 17:06:40 2007 @@ -12,6 +12,7 @@ %{ /* Includes the header in the wrapper code */ +#include <sstream> #include "zypp/base/PtrTypes.h" #include "zypp/Edition.h" #include "zypp/ResTraits.h" @@ -28,6 +29,14 @@ #include "zypp/TranslatedText.h" #include "zypp/CapFactory.h" #include "zypp/Package.h" +#include "zypp/Patch.h" +#include "zypp/Atom.h" +#include "zypp/SrcPackage.h" +#include "zypp/Script.h" +#include "zypp/Message.h" +#include "zypp/Pattern.h" +#include "zypp/Language.h" +#include "zypp/Product.h" #include "zypp/ResFilters.h" #include "zypp/OnMediaLocation.h" #include "zypp/Repository.h" @@ -113,6 +122,13 @@ %include "NVRAD.i" %include "Package.i" %include "Patch.i" +%include "Atom.i" +%include "SrcPackage.i" +%include "Script.i" +%include "Message.i" +%include "Pattern.i" +%include "Language.i" +%include "Product.i" %include "PublicKey.i" %include "KeyRing.i" %include "Target.i" @@ -172,6 +188,14 @@ Arch architecture() const; void setArchitecture( const Arch & arch ); + /** + * \short Apply persistant locks to current pool. + * Call this before solving + * + * \returns Number of items locked + */ + int applyLocks(); + protected: virtual ~ZYpp(); private: -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org