libufo-commits Mailing List for UFO: Universal Form Objects (Page 5)
Status: Beta
Brought to you by:
schmidtjf
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(8) |
Sep
(78) |
Oct
(69) |
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Johannes S. <sch...@us...> - 2005-09-30 12:37:08
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4126/include/ufo/widgets Modified Files: uwidget.hpp Log Message: Changed order of inline methods (to mollify MinGw about dllimport linkage warnings). Index: uwidget.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/widgets/uwidget.hpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** uwidget.hpp 16 Sep 2005 12:40:22 -0000 1.29 --- uwidget.hpp 30 Sep 2005 12:37:00 -0000 1.30 *************** *** 1373,1384 **** } ! inline bool ! UWidget::containsRootPoint(int x, int y) const { ! return contains(rootPointToPoint(x, y)); ! } ! ! inline bool ! UWidget::containsRootPoint(const UPoint & p) const { ! return contains(rootPointToPoint(p)); } --- 1373,1379 ---- } ! inline UPoint ! UWidget::pointToRootPoint(const UPoint & p) const { ! return (p + getRootLocation()); } *************** *** 1389,1394 **** inline UPoint ! UWidget::pointToRootPoint(const UPoint & p) const { ! return (p + getRootLocation()); } --- 1384,1389 ---- inline UPoint ! UWidget::rootPointToPoint(const UPoint & p) const { ! return (p - getRootLocation()); } *************** *** 1398,1404 **** } ! inline UPoint ! UWidget::rootPointToPoint(const UPoint & p) const { ! return (p - getRootLocation()); } --- 1393,1404 ---- } ! inline bool ! UWidget::containsRootPoint(int x, int y) const { ! return contains(rootPointToPoint(x, y)); ! } ! ! inline bool ! UWidget::containsRootPoint(const UPoint & p) const { ! return contains(rootPointToPoint(p)); } |
|
From: Johannes S. <sch...@us...> - 2005-09-30 12:36:58
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4063/include/ufo/util Modified Files: udimension.hpp uinsets.hpp upalette.hpp upoint.hpp urectangle.hpp Log Message: Explicitly inlined all inline methods (to mollify MinGw about dllimport linkage warnings). Index: urectangle.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/util/urectangle.hpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** urectangle.hpp 15 Sep 2005 10:10:42 -0000 1.17 --- urectangle.hpp 30 Sep 2005 12:36:48 -0000 1.18 *************** *** 49,77 **** class UFO_EXPORT URectangle { public: ! URectangle(); ! URectangle(int x, int y, int w, int h); ! URectangle(const UPoint & p, const UDimension & d); /** Computes a rectangle between two points. */ ! URectangle(const UPoint & p1, const UPoint & p2); /** Creates a rectangle with locatin 0,0 and the given size. */ ! URectangle(const UDimension & d); ! UPoint getLocation() const; ! UDimension getSize() const; ! void setBounds(int x, int y, int w, int h); ! void setBounds(const URectangle & rect); /** @return True when the given point pos is inside the rectangle * or on the edge of the rectangle */ ! bool contains(const UPoint & pos) const; /** @return True if the width and height are equal to @p invalid * @see invalid */ ! bool isInvalid() const; /** @return True if width or height is equal to 0. */ ! bool isEmpty() const; /** Clamps this URectangle to have at most the dimension of --- 49,81 ---- class UFO_EXPORT URectangle { public: ! inline URectangle(); ! inline URectangle(int x, int y, int w, int h); ! inline URectangle(const UPoint & p, const UDimension & d); /** Computes a rectangle between two points. */ ! inline URectangle(const UPoint & p1, const UPoint & p2); /** Creates a rectangle with locatin 0,0 and the given size. */ ! inline URectangle(const UDimension & d); ! inline UPoint getLocation() const; ! inline UDimension getSize() const; ! inline void setBounds(int x, int y, int w, int h); ! inline void setBounds(const URectangle & rect); /** @return True when the given point pos is inside the rectangle * or on the edge of the rectangle */ ! inline bool contains(const UPoint & pos) const; + /** @return True if both, width and height are not equal to @p invalid + * @see invalid + */ + inline bool isValid() const; /** @return True if the width and height are equal to @p invalid * @see invalid */ ! inline bool isInvalid() const; /** @return True if width or height is equal to 0. */ ! inline bool isEmpty() const; /** Clamps this URectangle to have at most the dimension of *************** *** 79,100 **** * the size of this rectangle. */ ! void clamp(const UDimension & maxDim); /** Expands this URectangle to have at least the dimension of * the given @p minDim. Does nothing if minDim is bigger than * the size of this rectangle. */ ! void expand(const UDimension & minDim); /** Intersects this rectangle with the given rectangle */ ! void intersect(const URectangle & rect); /** Unites this rectangle with the given rectangle. * @see computeUnion */ ! void unite(const URectangle & rect); /** @return The union of this rectangle and the given rectangle */ ! URectangle computeUnion(const URectangle & src) const; /** computes the rectangle that contains both src rectangles and --- 83,104 ---- * the size of this rectangle. */ ! inline void clamp(const UDimension & maxDim); /** Expands this URectangle to have at least the dimension of * the given @p minDim. Does nothing if minDim is bigger than * the size of this rectangle. */ ! inline void expand(const UDimension & minDim); /** Intersects this rectangle with the given rectangle */ ! inline void intersect(const URectangle & rect); /** Unites this rectangle with the given rectangle. * @see computeUnion */ ! inline void unite(const URectangle & rect); /** @return The union of this rectangle and the given rectangle */ ! inline URectangle computeUnion(const URectangle & src) const; /** computes the rectangle that contains both src rectangles and *************** *** 104,113 **** * @return dest */ ! static URectangle * computeUnion(const URectangle & src1, const URectangle & src2, URectangle * dest); public: // Public operators ! bool operator()() const { return !(isEmpty()); } ! bool operator!() const { return isEmpty(); } --- 108,123 ---- * @return dest */ ! inline static URectangle * computeUnion(const URectangle & src1, const URectangle & src2, URectangle * dest); public: // Public operators ! /** @see isValid ! * @return True if width and height have both "valid" values. ! */ ! inline bool operator()() const; ! /** @see isInvalid ! * @return True if width or height is "invalid". ! */ ! inline bool operator!() const; *************** *** 115,148 **** * @return Reference to this rectangle. */ ! URectangle & operator+=(const UPoint & p); /** Moves this rectangle using the coordinates of the given point * @return Reference to this rectangle. */ ! URectangle & operator-=(const UPoint & p); /** Increases this rectangle using the given dimension * @return Reference to this rectangle. */ ! URectangle & operator+=(const UDimension & dim); /** Shrinks this rectangle using the given dimension * @return Reference to this rectangle. */ ! URectangle & operator-=(const UDimension & dim); /** Increases this rectangle using the given insets * @return Reference to this rectangle. */ ! URectangle & operator+=(const UInsets & insets); /** Shrinks this rectangle using the given insets * @return Reference to this rectangle. */ ! URectangle & operator-=(const UInsets & insets); ! friend std::ostream & operator<<(std::ostream & os, const URectangle & o); ! /* ! UObject * clone() const; ! protected: // Protected methods ! std::ostream & paramString(std::ostream & os) const; ! */ public: // Public attributes int x; --- 125,153 ---- * @return Reference to this rectangle. */ ! inline URectangle & operator+=(const UPoint & p); /** Moves this rectangle using the coordinates of the given point * @return Reference to this rectangle. */ ! inline URectangle & operator-=(const UPoint & p); /** Increases this rectangle using the given dimension * @return Reference to this rectangle. */ ! inline URectangle & operator+=(const UDimension & dim); /** Shrinks this rectangle using the given dimension * @return Reference to this rectangle. */ ! inline URectangle & operator-=(const UDimension & dim); /** Increases this rectangle using the given insets * @return Reference to this rectangle. */ ! inline URectangle & operator+=(const UInsets & insets); /** Shrinks this rectangle using the given insets * @return Reference to this rectangle. */ ! inline URectangle & operator-=(const UInsets & insets); ! inline friend std::ostream & operator<<(std::ostream & os, const URectangle & o); public: // Public attributes int x; *************** *** 158,173 **** // public operators // ! UFO_EXPORT URectangle operator+(const URectangle & rect, const UPoint & p); ! UFO_EXPORT URectangle operator-(const URectangle & rect, const UPoint & p); ! UFO_EXPORT URectangle operator+(const URectangle & rect, const UDimension & dim); ! UFO_EXPORT URectangle operator-(const URectangle & rect, const UDimension & dim); ! UFO_EXPORT URectangle operator+(const URectangle & rect, const UInsets & in); ! UFO_EXPORT URectangle operator-(const URectangle & rect, const UInsets & in); /// Equality ! UFO_EXPORT bool operator==(const URectangle & r1,const URectangle & r2); ! UFO_EXPORT bool operator!=(const URectangle & r1,const URectangle & r2); /** wrapper class for URectangle derived from UObject --- 163,178 ---- // public operators // ! inline URectangle operator+(const URectangle & rect, const UPoint & p); ! inline URectangle operator-(const URectangle & rect, const UPoint & p); ! inline URectangle operator+(const URectangle & rect, const UDimension & dim); ! inline URectangle operator-(const URectangle & rect, const UDimension & dim); ! inline URectangle operator+(const URectangle & rect, const UInsets & in); ! inline URectangle operator-(const URectangle & rect, const UInsets & in); /// Equality ! inline bool operator==(const URectangle & r1,const URectangle & r2); ! inline bool operator!=(const URectangle & r1,const URectangle & r2); /** wrapper class for URectangle derived from UObject *************** *** 177,186 **** UFO_DECLARE_DYNAMIC_CLASS(URectangleObject) public: ! URectangleObject(); ! URectangleObject(const URectangle & rect); ! URectangleObject(int x, int y, int w, int h); ! URectangleObject(const UPoint & p, const UDimension & d); /** Computes a rectangle between two points. */ ! URectangleObject(const UPoint & p1, const UPoint & p2); // --- 182,191 ---- UFO_DECLARE_DYNAMIC_CLASS(URectangleObject) public: ! inline URectangleObject(); ! inline URectangleObject(const URectangle & rect); ! inline URectangleObject(int x, int y, int w, int h); ! inline URectangleObject(const UPoint & p, const UDimension & d); /** Computes a rectangle between two points. */ ! inline URectangleObject(const UPoint & p1, const UPoint & p2); // *************** *** 325,328 **** --- 330,341 ---- inline bool + URectangle::isValid() const { + return (x != URectangle::invalid.x && + y != URectangle::invalid.y && + w != URectangle::invalid.w && + h != URectangle::invalid.h); + } + + inline bool URectangle::isEmpty() const { return (!(w && h)); *************** *** 335,338 **** --- 348,361 ---- } + inline bool + URectangle::operator()() const { + return isValid(); + } + + inline bool + URectangle::operator!() const { + return !isValid(); + } + inline URectangle & URectangle::operator+=(const UPoint & p) { Index: upoint.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/util/upoint.hpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** upoint.hpp 21 May 2005 15:17:23 -0000 1.14 --- upoint.hpp 30 Sep 2005 12:36:48 -0000 1.15 *************** *** 44,100 **** class UFO_EXPORT UPoint { public: ! UPoint(); ! UPoint(int x, int y); ! int getX() const; ! void setX(int x); ! int getY() const; ! void setY(int y); /** for convenience */ ! void setLocation(const UPoint & p); /** Returns a copy. For convenience */ ! UPoint getLocation() const; /** This method is for convenience. It adds p to this point.*/ ! void translate(const UPoint & p); /** @return True if the width and height are equal to @p invalid * @see invalid */ ! bool isInvalid() const; /** @return True if both, x and y are exactly 0. */ ! bool isNull() const; /** Adds point p to this point * @return Reference to this point. */ ! UPoint & operator+=(const UPoint & p); /** Subtracts point p from this point * @return Reference to this point. */ ! UPoint & operator-=(const UPoint & p); /** Multiplies c to both x and y coordinate of this point. * @return Reference to this point. */ ! UPoint & operator*=(int c); /** Multiplies c to both x and y coordinate of this point. * Truncates the values to integers. * @return Reference to this point. */ ! UPoint & operator*=(double c); /** Divides both x and y by c. * Truncates the values to integers. * @return Reference to this point. */ ! UPoint & operator/=(int c); /** Divides both x and y by c. * Truncates the values to integers. * @return Reference to this point. */ ! UPoint & operator/=(double c); ! friend std::ostream & operator<<(std::ostream & os, const UPoint & o); public: // Public attributes --- 44,100 ---- class UFO_EXPORT UPoint { public: ! inline UPoint(); ! inline UPoint(int x, int y); ! inline int getX() const; ! inline void setX(int x); ! inline int getY() const; ! inline void setY(int y); /** for convenience */ ! inline void setLocation(const UPoint & p); /** Returns a copy. For convenience */ ! inline UPoint getLocation() const; /** This method is for convenience. It adds p to this point.*/ ! inline void translate(const UPoint & p); /** @return True if the width and height are equal to @p invalid * @see invalid */ ! inline bool isInvalid() const; /** @return True if both, x and y are exactly 0. */ ! inline bool isNull() const; /** Adds point p to this point * @return Reference to this point. */ ! inline UPoint & operator+=(const UPoint & p); /** Subtracts point p from this point * @return Reference to this point. */ ! inline UPoint & operator-=(const UPoint & p); /** Multiplies c to both x and y coordinate of this point. * @return Reference to this point. */ ! inline UPoint & operator*=(int c); /** Multiplies c to both x and y coordinate of this point. * Truncates the values to integers. * @return Reference to this point. */ ! inline UPoint & operator*=(double c); /** Divides both x and y by c. * Truncates the values to integers. * @return Reference to this point. */ ! inline UPoint & operator/=(int c); /** Divides both x and y by c. * Truncates the values to integers. * @return Reference to this point. */ ! inline UPoint & operator/=(double c); ! inline friend std::ostream & operator<<(std::ostream & os, const UPoint & o); public: // Public attributes *************** *** 108,125 **** // public operators // ! UFO_EXPORT UPoint operator+(const UPoint & p1, const UPoint & p2); ! UFO_EXPORT UPoint operator-(const UPoint & p1, const UPoint & p2); // equivalent to UPoint(0, 0) - p. ! UFO_EXPORT UPoint operator-(const UPoint & p); ! UFO_EXPORT UPoint operator*(const UPoint & p, int c); ! UFO_EXPORT UPoint operator*(int c, const UPoint & p); ! UFO_EXPORT UPoint operator*(const UPoint & p, double c); ! UFO_EXPORT UPoint operator*(double c, const UPoint & p); ! UFO_EXPORT UPoint operator/(const UPoint & p, int c); ! UFO_EXPORT UPoint operator/(const UPoint & p, double c); /// Equality ! UFO_EXPORT bool operator==(const UPoint & p1,const UPoint & p2); ! UFO_EXPORT bool operator!=(const UPoint & p1,const UPoint & p2); /** wrapper class for UDimension which is derived from UObject. --- 108,125 ---- // public operators // ! inline UPoint operator+(const UPoint & p1, const UPoint & p2); ! inline UPoint operator-(const UPoint & p1, const UPoint & p2); // equivalent to UPoint(0, 0) - p. ! inline UPoint operator-(const UPoint & p); ! inline UPoint operator*(const UPoint & p, int c); ! inline UPoint operator*(int c, const UPoint & p); ! inline UPoint operator*(const UPoint & p, double c); ! inline UPoint operator*(double c, const UPoint & p); ! inline UPoint operator/(const UPoint & p, int c); ! inline UPoint operator/(const UPoint & p, double c); /// Equality ! inline bool operator==(const UPoint & p1,const UPoint & p2); ! inline bool operator!=(const UPoint & p1,const UPoint & p2); /** wrapper class for UDimension which is derived from UObject. *************** *** 129,135 **** UFO_DECLARE_DYNAMIC_CLASS(UPointObject) public: ! UPointObject(); ! UPointObject(const UPoint & p); ! UPointObject(int w, int h); // --- 129,135 ---- UFO_DECLARE_DYNAMIC_CLASS(UPointObject) public: ! inline UPointObject(); ! inline UPointObject(const UPoint & p); ! inline UPointObject(int w, int h); // Index: uinsets.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/util/uinsets.hpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** uinsets.hpp 21 May 2005 15:17:23 -0000 1.9 --- uinsets.hpp 30 Sep 2005 12:36:48 -0000 1.10 *************** *** 49,53 **** public: /** Creates an empty insets object. */ ! UInsets(); /** Creates an insets object with the given values. * @param top The inset at top --- 49,53 ---- public: /** Creates an empty insets object. */ ! inline UInsets(); /** Creates an insets object with the given values. * @param top The inset at top *************** *** 56,84 **** * @param top The inset at right */ ! UInsets(int top, int left, int bottom, int right); ! int getTop() const; ! int getLeft() const; ! int getBottom() const; ! int getRight() const; /** @return The total insets in horizontal direction, i.e. left + right. */ ! int getHorizontal() const; /** @return The total insets in vertical direction, i.e. top + bottom. */ ! int getVertical() const; /** Increases the insets by the given insets, that means add @p add.top * to this.top etc. */ ! void grow(const UInsets & add); /** @return True if all insets are exactly 0. */ ! bool isEmpty() const; public: // Public operators /** @return True if one of the insets is non-zero. */ ! bool operator()() { return !(isEmpty()); } /** @return True if all insets are exactly 0. */ ! bool operator!() { return isEmpty(); } /** Increases the insets by the given insets, that means add @p add.top --- 56,84 ---- * @param top The inset at right */ ! inline UInsets(int top, int left, int bottom, int right); ! inline int getTop() const; ! inline int getLeft() const; ! inline int getBottom() const; ! inline int getRight() const; /** @return The total insets in horizontal direction, i.e. left + right. */ ! inline int getHorizontal() const; /** @return The total insets in vertical direction, i.e. top + bottom. */ ! inline int getVertical() const; /** Increases the insets by the given insets, that means add @p add.top * to this.top etc. */ ! inline void grow(const UInsets & add); /** @return True if all insets are exactly 0. */ ! inline bool isEmpty() const; public: // Public operators /** @return True if one of the insets is non-zero. */ ! inline bool operator()(); /** @return True if all insets are exactly 0. */ ! inline bool operator!(); /** Increases the insets by the given insets, that means add @p add.top *************** *** 86,90 **** * @return Reference to this insets object. */ ! UInsets & operator+=(const UInsets & in); /** Decreases the insets by the given insets, that means substract --- 86,90 ---- * @return Reference to this insets object. */ ! inline UInsets & operator+=(const UInsets & in); /** Decreases the insets by the given insets, that means substract *************** *** 92,98 **** * @return Reference to this insets object. */ ! UInsets & operator-=(const UInsets & in); ! friend std::ostream & operator<<(std::ostream & os, const UInsets & o); public: // Public attributes --- 92,98 ---- * @return Reference to this insets object. */ ! inline UInsets & operator-=(const UInsets & in); ! inline friend std::ostream & operator<<(std::ostream & os, const UInsets & o); public: // Public attributes *************** *** 107,116 **** // public operators // ! UFO_EXPORT UInsets operator+(const UInsets & in1, const UInsets & in2); ! UFO_EXPORT UInsets operator-(const UInsets & in1, const UInsets & in2); /// Equality ! UFO_EXPORT bool operator==(const UInsets & in1,const UInsets & in2); ! UFO_EXPORT bool operator!=(const UInsets & in1,const UInsets & in2); --- 107,116 ---- // public operators // ! inline UInsets operator+(const UInsets & in1, const UInsets & in2); ! inline UInsets operator-(const UInsets & in1, const UInsets & in2); /// Equality ! inline bool operator==(const UInsets & in1,const UInsets & in2); ! inline bool operator!=(const UInsets & in1,const UInsets & in2); *************** *** 195,198 **** --- 195,208 ---- } + inline bool + UInsets::operator()() { + return !(isEmpty()); + } + + inline bool + UInsets::operator!() { + return isEmpty(); + } + inline UInsets & Index: udimension.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/util/udimension.hpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** udimension.hpp 21 May 2005 15:19:11 -0000 1.11 --- udimension.hpp 30 Sep 2005 12:36:48 -0000 1.12 *************** *** 48,62 **** /** Creates an empty dimension (width == 0 and height == 0). */ ! UDimension(); /** Creates a dimension with the given width and height. * @param w The width * @param h The height */ ! UDimension(int w, int h); /** @return The width of this dimension. */ ! int getWidth() const; /** @return The height of this dimension. */ ! int getHeight() const; --- 48,62 ---- /** Creates an empty dimension (width == 0 and height == 0). */ ! inline UDimension(); /** Creates a dimension with the given width and height. * @param w The width * @param h The height */ ! inline UDimension(int w, int h); /** @return The width of this dimension. */ ! inline int getWidth() const; /** @return The height of this dimension. */ ! inline int getHeight() const; *************** *** 64,74 **** * @see invalid */ ! bool isInvalid() const; /** @return True if both, width and height are not equal to @p invalid * @see invalid */ ! bool isValid() const; /** @return True if width or height is equal to 0. */ ! bool isEmpty() const; /** Clamps this UDimension to have at most the dimension of --- 64,74 ---- * @see invalid */ ! inline bool isInvalid() const; /** @return True if both, width and height are not equal to @p invalid * @see invalid */ ! inline bool isValid() const; /** @return True if width or height is equal to 0. */ ! inline bool isEmpty() const; /** Clamps this UDimension to have at most the dimension of *************** *** 76,85 **** * this UDimension. */ ! void clamp(const UDimension & maxDim); /** Expands this UDimension to have at least the dimension of * the given @p minDim. Does nothing if minDim is bigger than * this UDimension. */ ! void expand(const UDimension & minDim); /** If width resp. height of this dimension is equal to @p invalid, --- 76,85 ---- * this UDimension. */ ! inline void clamp(const UDimension & maxDim); /** Expands this UDimension to have at least the dimension of * the given @p minDim. Does nothing if minDim is bigger than * this UDimension. */ ! inline void expand(const UDimension & minDim); /** If width resp. height of this dimension is equal to @p invalid, *************** *** 88,92 **** * of invalid values */ ! void update(const UDimension & dim); /** If width resp. height of the given dimension is not euqal to * @p invalid, the width resp. height of this dimension is replaced by --- 88,92 ---- * of invalid values */ ! inline void update(const UDimension & dim); /** If width resp. height of the given dimension is not euqal to * @p invalid, the width resp. height of this dimension is replaced by *************** *** 95,99 **** * of this dimension. */ ! void transcribe(const UDimension & dim); /** Sets the size of this dimension to the given values. --- 95,99 ---- * of this dimension. */ ! inline void transcribe(const UDimension & dim); /** Sets the size of this dimension to the given values. *************** *** 101,151 **** * @param h The new height */ ! void setSize(int w, int h); /** This method is for convenience and mimics the API of widget types. * @return A copy of this dimension object. */ ! UDimension getSize() const; public: // Public operators ! /** @return True if width and height are both not zero. */ ! bool operator()() { return !(isEmpty()); } ! /** @return True if width or height is equal to 0. */ ! bool operator!() { return isEmpty(); } /** Adds dimension @p dim to this dimension * @return Reference to this dimension. */ ! UDimension & operator+=(const UDimension & dim); /** Subtracts dimension @p dim from this dimension * @return Reference to this dimension. */ ! UDimension & operator-=(const UDimension & dim); /** Increases this dimension using the given insets * @return Reference to this rectangle. */ ! UDimension & operator+=(const UInsets & insets); /** Shrinks this dimension using the given insets * @return Reference to this rectangle. */ ! UDimension & operator-=(const UInsets & insets); /** Multiplies @p c with both width and height of this dimension. * @return Reference to this dimension. */ ! UDimension & operator*=(int c); /** Multiplies @p c with both width and height of this dimension. * @return Reference to this dimension. */ ! UDimension & operator*=(double c); /** Divides both width and height by @p c. * @return Reference to this dimension. */ ! UDimension & operator/=(int c); /** Divides both width and height by @p c. * @return Reference to this dimension. */ ! UDimension & operator/=(double c); ! friend std::ostream & operator<<(std::ostream & os, const UDimension & o); public: // Public attributes /** The width of this dimension object. */ --- 101,155 ---- * @param h The new height */ ! inline void setSize(int w, int h); /** This method is for convenience and mimics the API of widget types. * @return A copy of this dimension object. */ ! inline UDimension getSize() const; public: // Public operators ! /** @see isValid ! * @return True if width and height have both "valid" values. ! */ ! inline bool operator()() const; ! /** @see isInvalid ! * @return True if width or height is "invalid". ! */ ! inline bool operator!() const; /** Adds dimension @p dim to this dimension * @return Reference to this dimension. */ ! inline UDimension & operator+=(const UDimension & dim); /** Subtracts dimension @p dim from this dimension * @return Reference to this dimension. */ ! inline UDimension & operator-=(const UDimension & dim); /** Increases this dimension using the given insets * @return Reference to this rectangle. */ ! inline UDimension & operator+=(const UInsets & insets); /** Shrinks this dimension using the given insets * @return Reference to this rectangle. */ ! inline UDimension & operator-=(const UInsets & insets); /** Multiplies @p c with both width and height of this dimension. * @return Reference to this dimension. */ ! inline UDimension & operator*=(int c); /** Multiplies @p c with both width and height of this dimension. * @return Reference to this dimension. */ ! inline UDimension & operator*=(double c); /** Divides both width and height by @p c. * @return Reference to this dimension. */ ! inline UDimension & operator/=(int c); /** Divides both width and height by @p c. * @return Reference to this dimension. */ ! inline UDimension & operator/=(double c); ! inline friend std::ostream & operator<<(std::ostream & os, const UDimension & o); public: // Public attributes /** The width of this dimension object. */ *************** *** 161,178 **** // public operators // ! UFO_EXPORT UDimension operator+(const UDimension & dim1, const UDimension & dim2); ! UFO_EXPORT UDimension operator-(const UDimension & dim1, const UDimension & dim2); ! UFO_EXPORT UDimension operator+(const UDimension & dim, const UInsets & in); ! UFO_EXPORT UDimension operator-(const UDimension & dim, const UInsets & in); ! UFO_EXPORT UDimension operator*(const UDimension & dim, int c); ! UFO_EXPORT UDimension operator*(int c, const UDimension & p); ! UFO_EXPORT UDimension operator*(const UDimension & dim, double c); ! UFO_EXPORT UDimension operator*(double c, const UDimension & p); ! UFO_EXPORT UDimension operator/(const UDimension & dim, int c); ! UFO_EXPORT UDimension operator/(const UDimension & dim, double c); /// Equality ! UFO_EXPORT bool operator==(const UDimension & dim1,const UDimension & dim2); ! UFO_EXPORT bool operator!=(const UDimension & dim1,const UDimension & dim2); --- 165,182 ---- // public operators // ! inline UDimension operator+(const UDimension & dim1, const UDimension & dim2); ! inline UDimension operator-(const UDimension & dim1, const UDimension & dim2); ! inline UDimension operator+(const UDimension & dim, const UInsets & in); ! inline UDimension operator-(const UDimension & dim, const UInsets & in); ! inline UDimension operator*(const UDimension & dim, int c); ! inline UDimension operator*(int c, const UDimension & p); ! inline UDimension operator*(const UDimension & dim, double c); ! inline UDimension operator*(double c, const UDimension & p); ! inline UDimension operator/(const UDimension & dim, int c); ! inline UDimension operator/(const UDimension & dim, double c); /// Equality ! inline bool operator==(const UDimension & dim1,const UDimension & dim2); ! inline bool operator!=(const UDimension & dim1,const UDimension & dim2); *************** *** 183,189 **** UFO_DECLARE_DYNAMIC_CLASS(UDimensionObject) public: ! UDimensionObject(); ! UDimensionObject(const UDimension & dim); ! UDimensionObject(int w, int h); // --- 187,193 ---- UFO_DECLARE_DYNAMIC_CLASS(UDimensionObject) public: ! inline UDimensionObject(); ! inline UDimensionObject(const UDimension & dim); ! inline UDimensionObject(int w, int h); // *************** *** 277,280 **** --- 281,293 ---- } + inline bool + UDimension::operator()() const { + return isValid(); + } + + inline bool + UDimension::operator!() const { + return !isValid(); + } Index: upalette.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/util/upalette.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** upalette.hpp 21 May 2005 16:28:44 -0000 1.5 --- upalette.hpp 30 Sep 2005 12:36:48 -0000 1.6 *************** *** 100,105 **** ! void setColor(ColorRole role, const UColor & color); ! const UColor & getColor(ColorRole role) const; /** Every color of @p pal which is no default color of the default --- 100,105 ---- ! inline void setColor(ColorRole role, const UColor & color); ! inline const UColor & getColor(ColorRole role) const; /** Every color of @p pal which is no default color of the default *************** *** 143,147 **** public: // Public operators bool operator==(const UPalette & pal) const; ! bool operator!=(const UPalette & pal) const; protected: // Overrides UObject --- 143,147 ---- public: // Public operators bool operator==(const UPalette & pal) const; ! inline bool operator!=(const UPalette & pal) const; protected: // Overrides UObject |
|
From: Johannes S. <sch...@us...> - 2005-09-30 12:36:46
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo/signals In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4016/include/ufo/signals Modified Files: uobjectslot.hpp Log Message: Fixed compilation on gcc <= 3.2 (be careful with static template members) Index: uobjectslot.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/signals/uobjectslot.hpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** uobjectslot.hpp 15 Sep 2005 10:22:44 -0000 1.12 --- uobjectslot.hpp 30 Sep 2005 12:36:36 -0000 1.13 *************** *** 38,58 **** class UObject; ! ! /** A compile time check whether Base is really a base class of Child ! * This is from GotW #71 resp. from "More exceptional C++" */ ! ! template<class Child, class Base> ! class IsDerivedFrom { ! private: class Yes { char a[1]; }; ! class No { char a[10]; }; ! static Yes Test(Base*); // undefined ! static No Test(...); // undefined public: enum { ! Is = sizeof(Test(static_cast<Child*>(0))) == sizeof(Yes) ? 1 : 0 }; }; --- 38,59 ---- class UObject; ! /** Contains helper functions whether something can be casted to class @p Base. ! * This is in an extra namespace (instead of the template) as gcc < 3.4 ! * has problems with static template instantiation. */ ! namespace internal { class Yes { char a[1]; }; ! class No { char a[5]; }; ! template<class Base> static Yes canCastTo(Base*); ! template<class Base> static No canCastTo(...); ! } + /** This template checks whether @p Child can implicitely be casted to @p Base. */ + template<class Child, class Base> + class ImplicitCast { public: enum { ! Exists = sizeof(internal::canCastTo<Base>(static_cast<Child*>(0))) == sizeof(internal::Yes) ? 1 : 0 }; }; *************** *** 86,91 **** , m_method(method) { ! if (IsDerivedFrom<Obj, UObject>::Is) { ! m_uobject = reinterpret_cast<UObject*>(object); } if (m_uobject) { --- 87,92 ---- , m_method(method) { ! if (ImplicitCast<Obj, UObject>::Exists) { ! m_uobject = static_cast<UObject*>(object); } if (m_uobject) { |
|
From: Johannes S. <sch...@us...> - 2005-09-30 12:36:38
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo/layouts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3955/include/ufo/layouts Modified Files: ulayoutmanager.hpp Log Message: Fixed warnings about unsed parameters. Index: ulayoutmanager.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/layouts/ulayoutmanager.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ulayoutmanager.hpp 21 May 2005 15:17:23 -0000 1.8 --- ulayoutmanager.hpp 30 Sep 2005 12:36:26 -0000 1.9 *************** *** 63,67 **** /** @deprecated */ virtual UDimension ! getMinimumLayoutSize(const UWidget * container) const { return UDimension(); } }; --- 63,67 ---- /** @deprecated */ virtual UDimension ! getMinimumLayoutSize(const UWidget * /* container */) const { return UDimension(); } }; |
|
From: Johannes S. <sch...@us...> - 2005-09-30 12:36:35
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo/signals In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3955/include/ufo/signals Modified Files: uslot.hpp Log Message: Fixed warnings about unsed parameters. Index: uslot.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/signals/uslot.hpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** uslot.hpp 15 Sep 2005 10:22:44 -0000 1.13 --- uslot.hpp 30 Sep 2005 12:36:27 -0000 1.14 *************** *** 50,59 **** // our shut down. If from_child is true, we do not need // to clean up the child links. ! virtual void notify(bool from_child) { m_died = true; } virtual bool died() { return m_died; } ! virtual bool equals(const USlotNode * node) const { return false; } bool connected() { return _proxy != NULL; } --- 50,59 ---- // our shut down. If from_child is true, we do not need // to clean up the child links. ! virtual void notify(bool /* from_child */) { m_died = true; } virtual bool died() { return m_died; } ! virtual bool equals(const USlotNode * /* node */) const { return false; } bool connected() { return _proxy != NULL; } |
|
From: Johannes S. <sch...@us...> - 2005-09-30 12:36:34
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3955/include/ufo Modified Files: ucollectable.hpp ufo_debug.hpp Log Message: Fixed warnings about unsed parameters. Index: ucollectable.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/ucollectable.hpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ucollectable.hpp 21 May 2005 15:17:23 -0000 1.10 --- ucollectable.hpp 30 Sep 2005 12:36:26 -0000 1.11 *************** *** 69,73 **** // hm, evil void * operator new(std::size_t size); ! void operator delete(void * p, std::size_t size); private: mutable unsigned int m_refCount : 31; --- 69,73 ---- // hm, evil void * operator new(std::size_t size); ! void operator delete(void * p, std::size_t /* size */); private: mutable unsigned int m_refCount : 31; *************** *** 104,108 **** inline void ! UCollectable::operator delete(void * p, std::size_t size) { ::operator delete(p); } --- 104,108 ---- inline void ! UCollectable::operator delete(void * p, std::size_t /* size */) { ::operator delete(p); } Index: ufo_debug.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/ufo_debug.hpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ufo_debug.hpp 13 Feb 2005 17:49:31 -0000 1.10 --- ufo_debug.hpp 30 Sep 2005 12:36:26 -0000 1.11 *************** *** 72,82 **** UDebugStream(std::streambuf * buf) : m_stream(new ostream_type(buf)) {} UDebugStream & operator<<(ostream_type & (*pf)(ostream_type &)) { - #ifdef UFO_DEBUG *m_stream << (pf); - #endif return *this; } template<typename T> --- 72,87 ---- UDebugStream(std::streambuf * buf) : m_stream(new ostream_type(buf)) {} + #ifdef UFO_DEBUG UDebugStream & operator<<(ostream_type & (*pf)(ostream_type &)) { *m_stream << (pf); return *this; } + #else + UDebugStream & + operator<<(ostream_type & (*/* pf */)(ostream_type &)) { + return *this; + } + #endif template<typename T> |
|
From: Johannes S. <sch...@us...> - 2005-09-30 12:36:32
|
Update of /cvsroot/libufo/ufo-0.5 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3903 Modified Files: configure.ac Log Message: Bumped version info to 0.8.2. Changed libtool to respect also the micro releases (as we break too often binary compatibility. Index: configure.ac =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/configure.ac,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** configure.ac 4 Sep 2005 13:14:27 -0000 1.32 --- configure.ac 30 Sep 2005 12:36:17 -0000 1.33 *************** *** 21,27 **** UFO_MAJOR_VERSION=0 UFO_MINOR_VERSION=8 ! UFO_MICRO_VERSION=1 ! UFO_INTERFACE_AGE=1 ! UFO_BINARY_AGE=1 UFO_VERSION=$UFO_MAJOR_VERSION.$UFO_MINOR_VERSION.$UFO_MICRO_VERSION VERSION=$UFO_VERSION --- 21,27 ---- UFO_MAJOR_VERSION=0 UFO_MINOR_VERSION=8 ! UFO_MICRO_VERSION=2 ! UFO_INTERFACE_AGE=0 ! UFO_BINARY_AGE=0 UFO_VERSION=$UFO_MAJOR_VERSION.$UFO_MINOR_VERSION.$UFO_MICRO_VERSION VERSION=$UFO_VERSION *************** *** 37,41 **** # libtool versioning ! LT_RELEASE=$UFO_MAJOR_VERSION.$UFO_MINOR_VERSION LT_CURRENT=`expr $UFO_MICRO_VERSION - $UFO_INTERFACE_AGE` LT_REVISION=$UFO_INTERFACE_AGE --- 37,41 ---- # libtool versioning ! LT_RELEASE=$UFO_MAJOR_VERSION.$UFO_MINOR_VERSION.$UFO_MICRO_VERSION LT_CURRENT=`expr $UFO_MICRO_VERSION - $UFO_INTERFACE_AGE` LT_REVISION=$UFO_INTERFACE_AGE |
|
From: Johannes S. <sch...@us...> - 2005-09-16 13:00:06
|
Update of /cvsroot/libufo/ufo-0.5 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3214 Modified Files: README Log Message: Index: README =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/README,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** README 2 Sep 2005 13:29:58 -0000 1.6 --- README 16 Sep 2005 12:59:52 -0000 1.7 *************** *** 5,9 **** (UFO) ! Version 0.8.0 --- --- 5,9 ---- (UFO) ! Version 0.8.1 --- *************** *** 24,27 **** --- 24,30 ---- libUFO widgets into an already existing OpenGL context. + There are two examples how to integrate libUFO in existing OpenGL contexts: + test/sdl.cpp and test/glut.cpp (for use with SDL resp. Glut). + LibUFO itsself depends only on OpenGL (http://www.opengl.org) or equivalent libraries like Mesa3D (http://www.mesa3d.org) *************** *** 36,40 **** and the API documentation at http://libufo.sf.net/api ! If you need help with the library, just email to schmidtjf at users.sourceforge.net --- 39,44 ---- and the API documentation at http://libufo.sf.net/api ! ! If you need help with the library, just email to schmidtjf at users.sourceforge.net |
|
From: Johannes S. <sch...@us...> - 2005-09-16 12:40:33
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32306/include/ufo/widgets Modified Files: uwidget.hpp Log Message: Some docu fixes. Index: uwidget.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/widgets/uwidget.hpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** uwidget.hpp 21 Jun 2005 09:27:52 -0000 1.28 --- uwidget.hpp 16 Sep 2005 12:40:22 -0000 1.29 *************** *** 116,119 **** --- 116,127 ---- * @ingroup widgets * + * Every UFO widget is derived from UWidget. + * All base functionality is provided by this class, i.e. + * input event processing, sizing, container functionality + * (adding other widgets), layouting + * (using layout managers, default is UBoxLayout), + * several widget attributes, ... + * + * @see UBoxLayout * @author Johannes Schmidt */ *************** *** 202,206 **** /** Many attributes of a widget can only be stated when it is ! * within a valid containment hierarchy. * For example, the correct UI object can be determined only if * the top level widget belongs to a UFO context. --- 210,214 ---- /** Many attributes of a widget can only be stated when it is ! * within a valid containment hierarchy (and mapped to screen). * For example, the correct UI object can be determined only if * the top level widget belongs to a UFO context. *************** *** 212,225 **** */ virtual bool isInValidHierarchy() const; ! /** Returns true when this widget has a UI object (responsible for ! * drawing and event handling) and ! * a layout manager has laid out all children. */ bool isValid() const; ! /** relayouts the container and checks whether the ui delegate is valid. ! * If this widget has never been validated ( e.g. after construction ), ! * the ui delegate isn´t valid * - * @see updateUI * @see ULayoutManager */ --- 220,228 ---- */ virtual bool isInValidHierarchy() const; ! /** Returns true if the layout manager has laid out all children. */ bool isValid() const; ! /** Relayouts the container. * * @see ULayoutManager */ *************** *** 227,232 **** virtual void validateSelf(); ! /** Invalidates the specified attributes of this widget. This is called by ! * invalidate. * @see invalidate */ --- 230,236 ---- virtual void validateSelf(); ! /** Invalidates the specified attributes of this widget and forces ! * a relayout of child widgets. ! * This is called by invalidate. * @see invalidate */ *************** *** 737,741 **** /** @return The layout manager used by this widget. */ ULayoutManager * getLayout() const; ! /** Sets the layout manager for this widget. */ void setLayout(ULayoutManager * layout); --- 741,748 ---- /** @return The layout manager used by this widget. */ ULayoutManager * getLayout() const; ! /** Sets the layout manager for this widget. ! * The default layout manager is UBoxLayout ! * @see UBoxLayout ! */ void setLayout(ULayoutManager * layout); |
|
From: Johannes S. <sch...@us...> - 2005-09-16 12:40:18
|
Update of /cvsroot/libufo/ufo-0.5/src/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32279/src/widgets Modified Files: uwidget.cpp Log Message: Made UBoxLayout the default layout manager. Index: uwidget.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/widgets/uwidget.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** uwidget.cpp 16 Aug 2005 12:22:34 -0000 1.47 --- uwidget.cpp 16 Sep 2005 12:40:08 -0000 1.48 *************** *** 60,63 **** --- 60,64 ---- #include "ufo/layouts/ulayoutmanager.hpp" + #include "ufo/layouts/uboxlayout.hpp" //#include "ufo/borders/uborder.hpp" *************** *** 77,80 **** --- 78,83 ---- UWidget * UWidget::sm_dragWidget = NULL; + static UBoxLayout ufo_defaultLayout; + UWidget::UWidget() : m_context(NULL) *************** *** 89,93 **** , m_parent(NULL) , m_children() ! , m_layout(NULL) , m_popupMenu(NULL) , m_cssType("widget") --- 92,96 ---- , m_parent(NULL) , m_children() ! , m_layout(&ufo_defaultLayout) , m_popupMenu(NULL) , m_cssType("widget") |
|
From: Johannes S. <sch...@us...> - 2005-09-16 12:39:41
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31965/include/ufo Modified Files: uobject.hpp Log Message: Fixed MS VC6 warning about struct vs. class. Index: uobject.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/uobject.hpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** uobject.hpp 15 Sep 2005 10:22:44 -0000 1.16 --- uobject.hpp 16 Sep 2005 12:39:16 -0000 1.17 *************** *** 168,172 **** namespace ufo { ! class UObjectSlotNode; /** @short This is the base class for all dynamic UFO objects. --- 168,172 ---- namespace ufo { ! struct UObjectSlotNode; /** @short This is the base class for all dynamic UFO objects. |
|
From: Johannes S. <sch...@us...> - 2005-09-15 16:34:52
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16046/include/ufo/gl Modified Files: ugl_prototypes.hpp Log Message: Added correct cull face to GL attributes. Index: ugl_prototypes.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/gl/ugl_prototypes.hpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ugl_prototypes.hpp 21 May 2005 15:18:53 -0000 1.7 --- ugl_prototypes.hpp 15 Sep 2005 16:34:44 -0000 1.8 *************** *** 92,96 **** UFO_GL_PROC_UNUSED(void,glCopyTexSubImage1D,(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)) UFO_GL_PROC_UNUSED(void,glCopyTexSubImage2D,(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)) ! UFO_GL_PROC_UNUSED(void,glCullFace,(GLenum mode)) UFO_GL_PROC(void,glDeleteLists,(GLuint list, GLsizei range)) UFO_GL_PROC(void,glDeleteTextures,(GLsizei n, const GLuint *textures)) --- 92,96 ---- UFO_GL_PROC_UNUSED(void,glCopyTexSubImage1D,(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)) UFO_GL_PROC_UNUSED(void,glCopyTexSubImage2D,(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)) ! UFO_GL_PROC(void,glCullFace,(GLenum mode)) UFO_GL_PROC(void,glDeleteLists,(GLuint list, GLsizei range)) UFO_GL_PROC(void,glDeleteTextures,(GLsizei n, const GLuint *textures)) |
|
From: Johannes S. <sch...@us...> - 2005-09-15 16:34:52
|
Update of /cvsroot/libufo/ufo-0.5/src/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16046/src/gl Modified Files: ugl_graphics.cpp Log Message: Added correct cull face to GL attributes. Index: ugl_graphics.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/gl/ugl_graphics.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ugl_graphics.cpp 15 Sep 2005 10:26:18 -0000 1.13 --- ugl_graphics.cpp 15 Sep 2005 16:34:44 -0000 1.14 *************** *** 77,80 **** --- 77,81 ---- ugl_driver->glDisable(GL_DEPTH_TEST); ugl_driver->glDisable(GL_LIGHTING); + ugl_driver->glCullFace(GL_FRONT); ugl_driver->glShadeModel(GL_FLAT); |
|
From: Johannes S. <sch...@us...> - 2005-09-15 16:33:25
|
Update of /cvsroot/libufo/ufo-0.5/src/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15676/src/widgets Modified Files: utextwidget.cpp utextedit.cpp Log Message: Fixed horribly b0rkened focusable commit. Index: utextedit.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/widgets/utextedit.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** utextedit.cpp 15 Sep 2005 10:16:33 -0000 1.16 --- utextedit.cpp 15 Sep 2005 16:33:18 -0000 1.17 *************** *** 282,286 **** void UTextEdit::processMouseEvent(UMouseEvent * e) { ! switch (e->getType() && isFocusable()) { case UEvent::MousePressed: { e->consume(); --- 282,287 ---- void UTextEdit::processMouseEvent(UMouseEvent * e) { ! if (isFocusable()) ! switch (e->getType()) { case UEvent::MousePressed: { e->consume(); Index: utextwidget.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/widgets/utextwidget.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** utextwidget.cpp 15 Sep 2005 10:16:33 -0000 1.4 --- utextwidget.cpp 15 Sep 2005 16:33:18 -0000 1.5 *************** *** 320,324 **** void UTextWidget::processMouseEvent(UMouseEvent * e) { ! switch (e->getType() && isFocusable()) { case UEvent::MousePressed: { e->consume(); --- 320,325 ---- void UTextWidget::processMouseEvent(UMouseEvent * e) { ! if (isFocusable()) ! switch (e->getType()) { case UEvent::MousePressed: { e->consume(); |
|
From: Johannes S. <sch...@us...> - 2005-09-15 16:22:12
|
Update of /cvsroot/libufo/ufo-0.5/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12980/test Modified Files: text.cpp Log Message: Beautified layout. Index: text.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/test/text.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** text.cpp 21 May 2005 15:23:48 -0000 1.5 --- text.cpp 15 Sep 2005 16:22:04 -0000 1.6 *************** *** 67,71 **** createContent(UWidget * content) { // we are using the flow layout as layout manager ! content->setLayout(new UFlowLayout()); // --- 67,76 ---- createContent(UWidget * content) { // we are using the flow layout as layout manager ! //content->setLayout(new UFlowLayout()); ! content->setOrientation(Vertical); ! ! UWidget * hbox = new UWidget(); ! hbox->setOrientation(Horizontal); ! content->add(hbox); // *************** *** 73,77 **** // UTextWidget * staticText = new UTextWidget(); ! content->add(staticText); // set the text --- 78,82 ---- // UTextWidget * staticText = new UTextWidget(); ! hbox->add(staticText); // set the text *************** *** 85,89 **** // UTextEdit * text = new UTextEdit(); ! content->add(text); // set some size hints --- 90,94 ---- // UTextEdit * text = new UTextEdit(); ! hbox->add(text); // set some size hints *************** *** 95,98 **** --- 100,110 ---- // + // make new line + // + hbox = new UWidget(); + hbox->setOrientation(Horizontal); + content->add(hbox); + + // // line edit // *************** *** 101,110 **** lineEdit->sigActivated().connect(slot(&print_action_command)); ! ! ULabel * lineEditLabel = new ULabel("&line edit"); ! lineEditLabel->setBuddy(lineEdit); ! ! content->add(lineEditLabel); ! content->add(lineEdit); // --- 113,118 ---- lineEdit->sigActivated().connect(slot(&print_action_command)); ! hbox->add(new ULabel("&line edit", lineEdit)); ! hbox->add(lineEdit); // *************** *** 114,118 **** ULineEdit * intField = new ULineEdit(); ! content->add(intField); intField->setValidator(new UIntValidator()); intField->setText("25234134"); --- 122,127 ---- ULineEdit * intField = new ULineEdit(); ! hbox->add(new ULabel("&integer edit", intField)); ! hbox->add(intField); intField->setValidator(new UIntValidator()); intField->setText("25234134"); *************** *** 126,130 **** ULineEdit * doubleField = new ULineEdit(); ! content->add(doubleField); doubleField->setValidator(new UDoubleValidator()); doubleField->setText("25234.234"); --- 135,140 ---- ULineEdit * doubleField = new ULineEdit(); ! hbox->add(new ULabel("&double edit", doubleField)); ! hbox->add(doubleField); doubleField->setValidator(new UDoubleValidator()); doubleField->setText("25234.234"); |
|
From: Johannes S. <sch...@us...> - 2005-09-15 10:27:24
|
Update of /cvsroot/libufo/ufo-0.5/src/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24840/src/ui Modified Files: ustylemanager.cpp Log Message: Index: ustylemanager.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/ui/ustylemanager.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ustylemanager.cpp 2 Sep 2005 14:34:05 -0000 1.3 --- ustylemanager.cpp 15 Sep 2005 10:27:14 -0000 1.4 *************** *** 242,248 **** // FIXME: we get only UStyleHints * hints = NULL; ! if (m_hints[concat(type, classId, "")]) { ! m_hints[concat(type, classId, "")]->update(m_hints["default"]); ! return m_hints[concat(type, classId, "")]; } else if (m_hints[type]) { hints = m_hints[type]; --- 242,249 ---- // FIXME: we get only UStyleHints * hints = NULL; ! std::string type_class(concat(type, classId, "")); ! if (m_hints[type_class]) { ! m_hints[type_class]->update(m_hints["default"]); ! return m_hints[type_class]; } else if (m_hints[type]) { hints = m_hints[type]; |
|
From: Johannes S. <sch...@us...> - 2005-09-15 10:27:05
|
Update of /cvsroot/libufo/ufo-0.5 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24756 Modified Files: ChangeLog Log Message: Index: ChangeLog =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/ChangeLog,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ChangeLog 12 Jul 2005 13:46:31 -0000 1.34 --- ChangeLog 15 Sep 2005 10:26:57 -0000 1.35 *************** *** 871,872 **** --- 871,887 ---- - Fixed selected button in UButtonGroup when calling UButton::setSelected - Added basic support for translucent list boxes + + 0.8.1 + - Fixed clip bounds (by fixing URectangle::intersect). + - Added automatic disconnection from signals if the object of an object slot + is destroyed (only if object is derived from UObject). + - Implemented USlotNode::notify + - Added label constructor with buddy argument. + - Added action map to UXul to automatically connect slots to + sigActivated signals. + - Fixed setting size via XUL and CSS commands. + - Implemented accesskey attribute of XUL elements. + - Changed UXDisplay to send KeyTyped events only if no Alt or Ctrl modifier + is pressed. + - Added support for keyboard events to UListBox + - New default layout manager for any new widget is now UBoxLayout |
|
From: Johannes S. <sch...@us...> - 2005-09-15 10:26:28
|
Update of /cvsroot/libufo/ufo-0.5/src/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24639/src/gl Modified Files: ugl_graphics.cpp Log Message: Disabled lighting in resetDeviceAttributes. Index: ugl_graphics.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/gl/ugl_graphics.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ugl_graphics.cpp 16 Jul 2005 13:44:59 -0000 1.12 --- ugl_graphics.cpp 15 Sep 2005 10:26:18 -0000 1.13 *************** *** 76,79 **** --- 76,80 ---- ugl_driver->glDisable(GL_TEXTURE_2D); ugl_driver->glDisable(GL_DEPTH_TEST); + ugl_driver->glDisable(GL_LIGHTING); ugl_driver->glShadeModel(GL_FLAT); *************** *** 127,130 **** --- 128,133 ---- ugl_driver->glMatrixMode(GL_MODELVIEW); ugl_driver->glLoadIdentity(); + + ugl_driver->glTranslatef(getTranslationX(), getTranslationY(), 0); } *************** *** 172,177 **** resetDeviceViewMatrix(); ugl_driver->glFlush(); - - ugl_driver->glTranslatef(getTranslationX(), getTranslationY(), 0); } --- 175,178 ---- |
|
From: Johannes S. <sch...@us...> - 2005-09-15 10:22:53
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo/signals In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23786/include/ufo/signals Modified Files: uobjectslot.hpp usignal.hpp uslot.hpp Log Message: Added automatic disconnection from signals if the object of an object slot is destroyed (only if object is derived from UObject). Interesting part is the IsDerivedFrom template (love it :). Implemented USlotNode::notify. Index: usignal.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/signals/usignal.hpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** usignal.hpp 13 Feb 2005 17:49:29 -0000 1.10 --- usignal.hpp 15 Sep 2005 10:22:44 -0000 1.11 *************** *** 65,68 **** --- 65,82 ---- ++iter) { if ((*iter)->equals(slot)) { + (*iter)->node()->notify(false); + ret = true; + break; + } + } + return ret; + } + protected: + bool final_remove(const USlotBase * slot) { + bool ret = false; + for (SlotIterator iter = _slots.begin(); + iter != _slots.end(); + ++iter) { + if ((*iter)->equals(slot)) { // remove garbage delete (*iter); *************** *** 99,107 **** } void emit() { ! for (SlotIterator next_iter = _slots.begin(), iter = _slots.begin(); ! iter != _slots.end(); iter = next_iter) { ! ++next_iter; InSlotType * slot = static_cast<InSlotType*>(*iter); ! (*slot)(); } } --- 113,125 ---- } void emit() { ! for (SlotIterator iter = _slots.begin();iter != _slots.end();) { InSlotType * slot = static_cast<InSlotType*>(*iter); ! if (!slot->node()->died()) { ! (*slot)(); ! } ! ++iter; ! if (slot->node()->died()) { ! final_remove(slot); ! } } } *************** *** 124,132 **** } void emit(typename UTrait<P1>::ref p1) { ! for (SlotIterator next_iter = _slots.begin(), iter = _slots.begin(); ! iter != _slots.end(); iter = next_iter) { ! ++next_iter; InSlotType * slot = static_cast<InSlotType*>(*iter); ! (*slot)(p1); } } --- 142,154 ---- } void emit(typename UTrait<P1>::ref p1) { ! for (SlotIterator iter = _slots.begin();iter != _slots.end();) { InSlotType * slot = static_cast<InSlotType*>(*iter); ! if (!slot->node()->died()) { ! (*slot)(p1); ! } ! ++iter; ! if (slot->node()->died()) { ! final_remove(slot); ! } } } *************** *** 150,158 **** } void emit(typename UTrait<P1>::ref p1, typename UTrait<P2>::ref p2) { ! for (SlotIterator next_iter = _slots.begin(), iter = _slots.begin(); ! iter != _slots.end(); iter = next_iter) { ! ++next_iter; InSlotType * slot = static_cast<InSlotType*>(*iter); ! (*slot)(p1, p2); } } --- 172,184 ---- } void emit(typename UTrait<P1>::ref p1, typename UTrait<P2>::ref p2) { ! for (SlotIterator iter = _slots.begin();iter != _slots.end();) { InSlotType * slot = static_cast<InSlotType*>(*iter); ! if (!slot->node()->died()) { ! (*slot)(p1, p2); ! } ! ++iter; ! if (slot->node()->died()) { ! final_remove(slot); ! } } } *************** *** 178,186 **** void emit(typename UTrait<P1>::ref p1, typename UTrait<P2>::ref p2, typename UTrait<P3>::ref p3) { ! for (SlotIterator next_iter = _slots.begin(), iter = _slots.begin(); ! iter != _slots.end(); iter = next_iter) { ! ++next_iter; InSlotType * slot = static_cast<InSlotType*>(*iter); ! (*slot)(p1, p2, p3); } } --- 204,216 ---- void emit(typename UTrait<P1>::ref p1, typename UTrait<P2>::ref p2, typename UTrait<P3>::ref p3) { ! for (SlotIterator iter = _slots.begin();iter != _slots.end();) { InSlotType * slot = static_cast<InSlotType*>(*iter); ! if (!slot->node()->died()) { ! (*slot)(p1, p2, p3); ! } ! ++iter; ! if (slot->node()->died()) { ! final_remove(slot); ! } } } *************** *** 205,213 **** void emit(typename UTrait<P1>::ref p1, typename UTrait<P2>::ref p2, typename UTrait<P3>::ref p3, typename UTrait<P4>::ref p4) { ! for (SlotIterator next_iter = _slots.begin(), iter = _slots.begin(); ! iter != _slots.end(); iter = next_iter) { ! ++next_iter; InSlotType * slot = static_cast<InSlotType*>(*iter); ! (*slot)(p1, p2, p3, p4); } } --- 235,247 ---- void emit(typename UTrait<P1>::ref p1, typename UTrait<P2>::ref p2, typename UTrait<P3>::ref p3, typename UTrait<P4>::ref p4) { ! for (SlotIterator iter = _slots.begin();iter != _slots.end();) { InSlotType * slot = static_cast<InSlotType*>(*iter); ! if (!slot->node()->died()) { ! (*slot)(p1, p2, p3, p4); ! } ! ++iter; ! if (slot->node()->died()) { ! final_remove(slot); ! } } } Index: uobjectslot.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/signals/uobjectslot.hpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** uobjectslot.hpp 13 Feb 2005 17:49:29 -0000 1.11 --- uobjectslot.hpp 15 Sep 2005 10:22:44 -0000 1.12 *************** *** 38,54 **** class UObject; ! // (internal) struct UObjectSlotNode : public USlotNode { typedef void (UObject::*Method)(void); - //typedef void (*Method)(void); void * m_object; Method m_method; ! UObjectSlotNode(ProxyPtr proxy, void * object, Method method) ! : USlotNode(proxy) { ! m_object = object; ! m_method = method; } virtual bool equals(const USlotNode * node) const { --- 38,109 ---- class UObject; ! ! /** A compile time check whether Base is really a base class of Child ! * This is from GotW #71 resp. from "More exceptional C++" ! */ ! ! template<class Child, class Base> ! class IsDerivedFrom { ! private: ! class Yes { char a[1]; }; ! class No { char a[10]; }; ! ! static Yes Test(Base*); // undefined ! static No Test(...); // undefined ! ! public: ! enum { ! Is = sizeof(Test(static_cast<Child*>(0))) == sizeof(Yes) ? 1 : 0 ! }; ! }; ! ! ! /** The slot node for objects. ! * If it is a UObject, does automatic clean up if the UObject pointer gets ! * invalid. ! * @author Johannes Schmidt ! */ struct UObjectSlotNode : public USlotNode { + /** We could use a generic class, but why not simply UObject to cast to. + */ typedef void (UObject::*Method)(void); + /** The object pointer. */ void * m_object; + /** This pointer is only not NULL if the object is derived from UObject.*/ + UObject * m_uobject; + /** The method to call. */ Method m_method; ! /** We need to make this a template for a compile-time check whether ! * object is derived from UObject. ! */ ! template<typename Obj> ! UObjectSlotNode(ProxyPtr proxy, Obj * object, Method method) ! : USlotNode(proxy) ! , m_object(object) ! , m_uobject(NULL) ! , m_method(method) ! { ! if (IsDerivedFrom<Obj, UObject>::Is) { ! m_uobject = reinterpret_cast<UObject*>(object); ! } ! if (m_uobject) { ! m_uobject->m_objectSlots.push_back(this); ! } } + virtual ~UObjectSlotNode() { + if (m_uobject) { + m_uobject->m_objectSlots.remove(this); + } + } + virtual void notify(bool from_child) { + if (!from_child && m_uobject) { + m_uobject->m_objectSlots.remove(this); + } + m_uobject = NULL; + m_object = NULL; + } + virtual bool died() { return (m_object == NULL); } virtual bool equals(const USlotNode * node) const { *************** *** 61,66 **** } } - - virtual ~UObjectSlotNode() {} }; --- 116,119 ---- Index: uslot.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/signals/uslot.hpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** uslot.hpp 13 Feb 2005 17:49:29 -0000 1.12 --- uslot.hpp 15 Sep 2005 10:22:44 -0000 1.13 *************** *** 43,46 **** --- 43,48 ---- struct UFO_EXPORT USlotNode { + USlotNode() : m_died(false) {} + USlotNode(FuncPtr proxy) : _proxy(proxy), m_died(false) {} virtual ~USlotNode() {} *************** *** 48,52 **** // our shut down. If from_child is true, we do not need // to clean up the child links. ! virtual void notify(bool from_child) {} virtual bool equals(const USlotNode * node) const { return false; } --- 50,57 ---- // our shut down. If from_child is true, we do not need // to clean up the child links. ! virtual void notify(bool from_child) { ! m_died = true; ! } ! virtual bool died() { return m_died; } virtual bool equals(const USlotNode * node) const { return false; } *************** *** 54,61 **** bool connected() { return _proxy != NULL; } ! USlotNode(FuncPtr proxy) : _proxy(proxy) {} ! ! /** A proxy func which does the actual callback calling. */ ProxyPtr _proxy; }; --- 59,69 ---- bool connected() { return _proxy != NULL; } ! public: // Public attributes ! /** A proxy func which does the actual callback calling. ! * FIXME: make this private. ! */ ProxyPtr _proxy; + private: // Private attributes + bool m_died; }; *************** *** 65,69 **** class UFO_EXPORT USlotBase { ! public: USlotBase() : _node(0) {} USlotBase(USlotNode * node) : _node(node) {} --- 73,77 ---- class UFO_EXPORT USlotBase { ! public: USlotBase() : _node(0) {} USlotBase(USlotNode * node) : _node(node) {} *************** *** 101,105 **** typedef void (*Callback)(); typedef void (*Proxy)(void*); ! void operator()() { if (!node()) return; --- 109,113 ---- typedef void (*Callback)(); typedef void (*Proxy)(void*); ! void operator()() { if (!node()) return; *************** *** 115,119 **** public: typedef void (*Proxy)(typename UTrait<P1>::ref, void*); ! void operator ()(typename UTrait<P1>::ref p1) { if (!node()) return; --- 123,127 ---- public: typedef void (*Proxy)(typename UTrait<P1>::ref, void*); ! void operator ()(typename UTrait<P1>::ref p1) { if (!node()) return; *************** *** 129,133 **** public: typedef void (*Proxy)(typename UTrait<P1>::ref, typename UTrait<P2>::ref, void*); ! void operator ()(typename UTrait<P1>::ref p1, typename UTrait<P2>::ref p2) { if (!node()) return; --- 137,141 ---- public: typedef void (*Proxy)(typename UTrait<P1>::ref, typename UTrait<P2>::ref, void*); ! void operator ()(typename UTrait<P1>::ref p1, typename UTrait<P2>::ref p2) { if (!node()) return; |
|
From: Johannes S. <sch...@us...> - 2005-09-15 10:22:53
|
Update of /cvsroot/libufo/ufo-0.5/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23786/src Modified Files: uobject.cpp Log Message: Added automatic disconnection from signals if the object of an object slot is destroyed (only if object is derived from UObject). Interesting part is the IsDerivedFrom template (love it :). Implemented USlotNode::notify. Index: uobject.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/uobject.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** uobject.cpp 31 Aug 2005 15:30:31 -0000 1.14 --- uobject.cpp 15 Sep 2005 10:22:44 -0000 1.15 *************** *** 109,112 **** --- 109,117 ---- } UObject::~UObject() { + for (std::list<UObjectSlotNode*>::iterator iter = m_objectSlots.begin(); + iter != m_objectSlots.end(); + ++iter) { + (*iter)->notify(true); + } m_sigDestroyed(this); releaseAllPointers(); |
|
From: Johannes S. <sch...@us...> - 2005-09-15 10:22:53
|
Update of /cvsroot/libufo/ufo-0.5/include/ufo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23786/include/ufo Modified Files: uobject.hpp Log Message: Added automatic disconnection from signals if the object of an object slot is destroyed (only if object is derived from UObject). Interesting part is the IsDerivedFrom template (love it :). Implemented USlotNode::notify. Index: uobject.hpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/include/ufo/uobject.hpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** uobject.hpp 31 Aug 2005 15:30:31 -0000 1.15 --- uobject.hpp 15 Sep 2005 10:22:44 -0000 1.16 *************** *** 168,171 **** --- 168,173 ---- namespace ufo { + class UObjectSlotNode; + /** @short This is the base class for all dynamic UFO objects. * @ingroup core *************** *** 176,179 **** --- 178,182 ---- class UFO_EXPORT UObject : public virtual UCollectable { UFO_DECLARE_CLASS(UObject) + friend struct UObjectSlotNode; public: UObject(); *************** *** 291,294 **** --- 294,298 ---- std::list<const UCollectable*> m_pointers; + std::list<UObjectSlotNode*> m_objectSlots; public: // Public Signals |
|
From: Johannes S. <sch...@us...> - 2005-09-15 10:18:44
|
Update of /cvsroot/libufo/ufo-0.5/src/ux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22788/src/ux Modified Files: uxdisplay.cpp Log Message: Changed UXDisplay to send KeyTyped events only if no Alt or Ctrl modifier is pressed. Index: uxdisplay.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/ux/uxdisplay.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** uxdisplay.cpp 6 Jul 2005 11:21:51 -0000 1.8 --- uxdisplay.cpp 15 Sep 2005 10:18:28 -0000 1.9 *************** *** 478,482 **** // FIXME: create key type event only if key press wasn't consumed. // How do we check whether key press wasn't consumed? ! if (! /*std::*/iscntrl(keyChar)) { UKeyEvent* e = new UKeyEvent( context->getRootPane(), // source --- 478,483 ---- // FIXME: create key type event only if key press wasn't consumed. // How do we check whether key press wasn't consumed? ! if (! /*std::*/iscntrl(keyChar) && ! !(modifiers & UMod::Ctrl) && !(modifiers & UMod::Alt)) { UKeyEvent* e = new UKeyEvent( context->getRootPane(), // source |
|
From: Johannes S. <sch...@us...> - 2005-09-15 10:18:19
|
Update of /cvsroot/libufo/ufo-0.5/src/layouts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22631/src/layouts Modified Files: uboxlayout.cpp Log Message: Ensure orientation of boxes. Index: uboxlayout.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/layouts/uboxlayout.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** uboxlayout.cpp 21 May 2005 15:22:22 -0000 1.12 --- uboxlayout.cpp 15 Sep 2005 10:18:00 -0000 1.13 *************** *** 161,164 **** --- 161,167 ---- int orientation = (m_orientation != NoOrientation) ? m_orientation : container->getOrientation(); + if (orientation == NoOrientation) { + orientation = Horizontal; + } int addSize = 0; |
|
From: Johannes S. <sch...@us...> - 2005-09-15 10:16:42
|
Update of /cvsroot/libufo/ufo-0.5/src/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22372/src/widgets Modified Files: utextwidget.cpp utextedit.cpp Log Message: Select text only if focusable. Index: utextedit.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/widgets/utextedit.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** utextedit.cpp 21 Jun 2005 09:26:56 -0000 1.15 --- utextedit.cpp 15 Sep 2005 10:16:33 -0000 1.16 *************** *** 282,286 **** void UTextEdit::processMouseEvent(UMouseEvent * e) { ! switch (e->getType()) { case UEvent::MousePressed: { e->consume(); --- 282,286 ---- void UTextEdit::processMouseEvent(UMouseEvent * e) { ! switch (e->getType() && isFocusable()) { case UEvent::MousePressed: { e->consume(); Index: utextwidget.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/widgets/utextwidget.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** utextwidget.cpp 17 Aug 2005 09:09:46 -0000 1.3 --- utextwidget.cpp 15 Sep 2005 10:16:33 -0000 1.4 *************** *** 320,324 **** void UTextWidget::processMouseEvent(UMouseEvent * e) { ! switch (e->getType()) { case UEvent::MousePressed: { e->consume(); --- 320,324 ---- void UTextWidget::processMouseEvent(UMouseEvent * e) { ! switch (e->getType() && isFocusable()) { case UEvent::MousePressed: { e->consume(); |
|
From: Johannes S. <sch...@us...> - 2005-09-15 10:15:32
|
Update of /cvsroot/libufo/ufo-0.5/src/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22137/src/xml Modified Files: uxul.cpp Log Message: Added action map to UXul to automatically connect slots to sigActivated signals. Fixed setting size via XUL and CSS commands. Index: uxul.cpp =================================================================== RCS file: /cvsroot/libufo/ufo-0.5/src/xml/uxul.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** uxul.cpp 3 Sep 2005 10:07:30 -0000 1.6 --- uxul.cpp 15 Sep 2005 10:15:23 -0000 1.7 *************** *** 76,79 **** --- 76,82 ---- : m_doc(NULL) , m_root(NULL) + , m_title() + , m_map() + , m_actionMap() {} *************** *** 81,84 **** --- 84,99 ---- : m_doc(NULL) , m_root(NULL) + , m_title() + , m_map() + , m_actionMap() + { + load(guiFile); + } + UXul::UXul(const std::string & guiFile, std::map<std::string, UActionSlot> map) + : m_doc(NULL) + , m_root(NULL) + , m_title() + , m_map() + , m_actionMap(map) { load(guiFile); *************** *** 154,157 **** --- 169,173 ---- // ugh, very ugly static std::map<std::string, UWidget*> * s_map = NULL; + static std::map<std::string, UActionSlot> * s_actionMap = NULL; void *************** *** 177,182 **** widget->setStyleHints(hints); } ! ! UDimension prefSize(UDimension::invalid); element->QueryIntAttribute("width", &(prefSize.w)); element->QueryIntAttribute("height", &(prefSize.h)); --- 193,198 ---- widget->setStyleHints(hints); } ! /* ! UDimension prefSize;//widget->getPreferredSize()); element->QueryIntAttribute("width", &(prefSize.w)); element->QueryIntAttribute("height", &(prefSize.h)); *************** *** 184,188 **** widget->setPreferredSize(prefSize); } ! if (s_map) { if (element->Attribute("id")) { --- 200,204 ---- widget->setPreferredSize(prefSize); } ! */ if (s_map) { if (element->Attribute("id")) { *************** *** 221,224 **** --- 237,241 ---- button->setAccelerator(accel); } + if (isTrue(element->Attribute("checked"))) { button->setSelected(true); *************** *** 227,230 **** --- 244,260 ---- button->setIcon(new UImageIcon(element->Attribute("image"))); } + + if (element->Attribute("oncommand")) { + std::string command(element->Attribute("oncommand")); + + // search in the action map + for (std::map<std::string, UActionSlot>::iterator iter = s_actionMap->begin(); + iter != s_actionMap->end(); + ++iter) { + if ((*iter).first == command) { + button->sigActivated().connect((*s_actionMap)[command]); + } + } + } } *************** *** 380,385 **** ULabel * label = new ULabel(); genericWidget(widgetElement, label); ! if (widgetElement->Attribute("value")) ! label->setText(widgetElement->Attribute("value")); if (widgetElement->Attribute("control")) { std::string ctrl = widgetElement->Attribute("control"); --- 410,425 ---- ULabel * label = new ULabel(); genericWidget(widgetElement, label); ! char accesskey = 0; ! if (widgetElement->Attribute("accesskey")) { ! accesskey = (widgetElement->Attribute("accesskey"))[0]; ! } ! if (widgetElement->Attribute("value")) { ! std::string text = widgetElement->Attribute("value"); ! std::string::size_type index = text.find(accesskey); ! if (index < text.length()) { ! text.insert(index, 1, '&'); ! } ! label->setText(text); ! } if (widgetElement->Attribute("control")) { std::string ctrl = widgetElement->Attribute("control"); *************** *** 484,487 **** --- 524,532 ---- } + void + UXul::setActionMap(std::map<std::string, UActionSlot> map) { + m_actionMap = map; + } + URootPane * UXul::createRootPane() { *************** *** 547,550 **** --- 592,596 ---- // oops, this is tricky s_map = &m_map; + s_actionMap = &m_actionMap; genericWidget(windowElement, m_root); genericWidget(windowElement, content); |