[Xfce4-commits] <xfc:master> builder succefully added, and does even work
Bo Lorensen
noreply at xfce.org
Sun Nov 15 22:46:01 CET 2009
Updating branch refs/heads/master
to d967ef4d2e0878cb1a8767e85beacf2fcb09a173 (commit)
from 6cebac338aded76d3e7625d26dbadb5263953d36 (commit)
commit d967ef4d2e0878cb1a8767e85beacf2fcb09a173
Author: Bo Lorensen <bl at lue.dk>
Date: Sun Nov 15 22:44:01 2009 +0100
builder succefully added, and does even work
debian/libxfcde-dev.install | 5 ++
debian/libxfcde.install | 1 +
libXFCcore/xfc/glib/slist.hh | 124 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 130 insertions(+), 0 deletions(-)
diff --git a/debian/libxfcde-dev.install b/debian/libxfcde-dev.install
new file mode 100644
index 0000000..298240d
--- /dev/null
+++ b/debian/libxfcde-dev.install
@@ -0,0 +1,5 @@
+debian/tmp/usr/include/xfce4/xfc/de/ui/*.hh
+debian/tmp/usr/include/xfce4/xfc/de/ui/inline/*.inl
+debian/tmp/usr/include/xfce4/xfc/de/utils/*.hh
+debian/tmp/usr/include/xfce4/xfc/de/utils/inline/*.inl
+debian/tmp/usr/lib/pkgconfig/xfcde-*.pc
diff --git a/debian/libxfcde.install b/debian/libxfcde.install
new file mode 100644
index 0000000..afec8e8
--- /dev/null
+++ b/debian/libxfcde.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/libXFCde*.so*
diff --git a/libXFCcore/xfc/glib/slist.hh b/libXFCcore/xfc/glib/slist.hh
new file mode 100644
index 0000000..80e024f
--- /dev/null
+++ b/libXFCcore/xfc/glib/slist.hh
@@ -0,0 +1,124 @@
+#ifndef XFC_SLIST_HH
+#define XFC_SLIST_HH
+
+#include <list>
+
+#ifndef __G_SLIST_H__
+#include <glib/gslist.h>
+#endif
+
+namespace Xfc {
+namespace G {
+
+ /**
+ Template version of glib GSList, holding only a subset of functions
+ that can be contained inside a glist. The template has all of the short
+ commings of the underlaying GSList, and adds only type safty and
+ some simple conversions.
+
+ Also note that the list holds a pointer to the elements inside the
+ list and that these pointers are unmaintained and unreferenced.
+
+ The template are ment as a thin wrapper to be able to handle listed
+ handed over by the underlaying GTK layer as cheap as possible.
+
+ This class in NOT thread safe.
+ */
+ template<class T> class SList {
+ GSList *_list;
+ public:
+ class iterator {
+ GSList *_cur;
+ public:
+ iterator( SList<T> &base ) : _cur( base._list ) {}
+
+ void operator++() {
+ _cur = g_slist_next( _cur );
+ }
+
+ operator T * () { return _cur->data; }
+ };
+
+ SList() {
+ _list = g_slist_alloc();
+ }
+
+ // Please note that this is not typesafe, so you need to know what you are doing
+ SList( GSList *orig ) {
+ _list = orig;
+ }
+
+ ~SList() { g_slist_free( _list ); }
+
+ iterator begin() const {
+ return iterator( _list );
+ }
+
+ iterator end() const {
+ return iterator( g_slist_last( _list ));
+ }
+
+ // The same as push_back in STL
+ void append( T *data ) {
+ _list = g_slist_append( _list, data );
+ }
+
+ void prepend( T *data ) {
+ _list = g_list_prepend( _list, data );
+ }
+
+ void insert( T* data, size_t position) {
+ _list = g_slist_insert( _list, data, position );
+ }
+
+ void remove( const T *data ) {
+ _list = g_slist_remove( _list, data );
+ }
+
+ void remove_all( const T *data) {
+ _list = g_slist_remove_all( _list, data );
+ }
+
+ size_t length() const {
+ return g_slist_length( _list );
+ }
+
+ SList<T> copy() const {
+ return SList<T>( g_slist_copy( _list ));
+ }
+
+ SList<T> reverse() const {
+ return SList<T>( g_slist_reverse( _list ));
+ }
+
+ void concat( SList<T> &list ) {
+ _list = g_slist_concat( _list, list._list );
+ }
+
+ T* nth_data(size_t n) {
+ return g_slist_nth_data( _list, n );
+ }
+
+ size_t index( const T *data ) const {
+ return g_slist_index( _list, data );
+ }
+
+ /**
+ Convert to the nearest STL container, but only on demand.
+ This is a full copy, and perform as that !
+ */
+ operator std::list<T *> &() const {
+ std::list< T* > l;
+
+ for( iterator i = begin(); i != end(); ++i )
+ l.push_back( *i );
+
+ return l;
+ }
+
+ friend class iterator;
+ };
+}
+}
+
+#endif
More information about the Xfce4-commits
mailing list