diff options
author | Sam Spilsbury <smspillaz@gmail.com> | 2010-03-24 17:37:19 +0800 |
---|---|---|
committer | Sam Spilsbury <smspillaz@gmail.com> | 2010-03-24 17:37:19 +0800 |
commit | 3e45d4893e102d04f34ab90a8adfed813db60175 (patch) | |
tree | 986dee11d95ed8a5ff0831725169c30f2fd59399 /include | |
parent | 2de5a640661ec50f9c86f78b5664e8ddd24bd549 (diff) | |
download | zcomp-3e45d4893e102d04f34ab90a8adfed813db60175.tar.gz zcomp-3e45d4893e102d04f34ab90a8adfed813db60175.tar.bz2 |
Documentation update for CompIcon, ModifierHandler, CompOutput,
PluginClassStorage, PluginClassIndex, CompPoint, CompRect, CompRegion and
CompSize
Diffstat (limited to 'include')
-rw-r--r-- | include/core/icon.h | 12 | ||||
-rw-r--r-- | include/core/modifierhandler.h | 24 | ||||
-rw-r--r-- | include/core/output.h | 12 | ||||
-rw-r--r-- | include/core/pluginclasses.h | 8 | ||||
-rw-r--r-- | include/core/point.h | 50 | ||||
-rw-r--r-- | include/core/rect.h | 36 | ||||
-rw-r--r-- | include/core/region.h | 88 | ||||
-rw-r--r-- | include/core/size.h | 8 |
8 files changed, 193 insertions, 45 deletions
diff --git a/include/core/icon.h b/include/core/icon.h index 6f7a637..f985a7b 100644 --- a/include/core/icon.h +++ b/include/core/icon.h @@ -32,17 +32,17 @@ class CompScreen; -/// -/// Wraps an application icon pixel map and it's meta information (such as dimensions) -/// +/** + * Wraps an application icon pixel map and it's meta information (such as dimensions) + */ class CompIcon : public CompSize { public: CompIcon (CompScreen *screen, unsigned width, unsigned int height); ~CompIcon (); - /// - /// Gets a pointer to the pixel data for this icon. - /// + /** + * Gets a pointer to the pixel data for this icon. + */ unsigned char* data (); private: diff --git a/include/core/modifierhandler.h b/include/core/modifierhandler.h index 72c4b1e..aa7c3df 100644 --- a/include/core/modifierhandler.h +++ b/include/core/modifierhandler.h @@ -29,7 +29,8 @@ #include <core/core.h> /** - * TODO + * Toplevel class which provides access to display + * level modifier information */ class ModifierHandler { @@ -64,16 +65,37 @@ class ModifierHandler public: + + /** + * Takes an X11 Keycode and returns a bitmask + * with modifiers that have been pressed + */ unsigned int keycodeToModifiers (int keycode); + /** + * Updates X11 Modifier mappings + */ void updateModifierMappings (); + /** + * Takes a virtual modMask and returns a real modifier mask + * by removing unused bits + */ unsigned int virtualToRealModMask (unsigned int modMask); + /** + * Returns a bit modifier mask for a Motifier enum + */ unsigned int modMask (Modifier); + /** + * Returns a const bit modifier mask for what should be ignored + */ unsigned int ignoredModMask (); + /** + * Returns a const XModifierKeymap for compiz + */ const XModifierKeymap * modMap (); friend class CompScreen; diff --git a/include/core/output.h b/include/core/output.h index 093a822..a8ac41f 100644 --- a/include/core/output.h +++ b/include/core/output.h @@ -31,9 +31,11 @@ #include <core/core.h> #include <core/rect.h> -/// -/// Output to a device from Compiz -/// +/** + * Represents a phisically attached screen in Compiz, where this + * phisical screen is part of an X11 screen in a configuration such + * as Xinerama, XRandR, TwinView or MergedFB + */ class CompOutput : public CompRect { public: @@ -43,6 +45,10 @@ class CompOutput : public CompRect { unsigned int id () const; + /** + * Returns a "working area" of the screen, which the geometry + * which is not covered by strut windows (such as panels) + */ const CompRect& workArea () const; void setWorkArea (const CompRect&); diff --git a/include/core/pluginclasses.h b/include/core/pluginclasses.h index ae1a824..1e6a73e 100644 --- a/include/core/pluginclasses.h +++ b/include/core/pluginclasses.h @@ -30,7 +30,9 @@ #include <vector> - +/** + * Represents the index of a plugin's object classes + */ class PluginClassIndex { public: PluginClassIndex () : index ((unsigned)~0), refCount (0), @@ -45,6 +47,10 @@ class PluginClassIndex { unsigned int pcIndex; }; +/** + * Represents some storage of a plugin class on a core object, + * usually some pointer (void *) + */ class PluginClassStorage { public: diff --git a/include/core/point.h b/include/core/point.h index 89f4e68..20e731f 100644 --- a/include/core/point.h +++ b/include/core/point.h @@ -29,48 +29,60 @@ #include <vector> #include <list> -/// -/// A 2D coordinate (likely in screen space) that can only be mutated -/// through set() methods, since it's data members are private. -/// +/** + * A 2D coordinate (likely in screen space) that can only be mutated + * through set() methods, since it's data members are private. + */ class CompPoint { public: CompPoint (); CompPoint (int, int); - /// - /// Get the x coordinate of this point - /// + /** + * Get the x coordinate of this point + */ int x () const; - /// - /// Get the y coordinate of this point - /// + /** + * Get the y coordinate of this point + */ int y () const; - /// - /// Set the x and y coordinate of this point - /// + /** + * Set the x and y coordinate of this point + */ void set (int, int); - /// - /// Set the x coordinate of this point - /// + /** + * Set the x coordinate of this point + */ void setX (int); - /// - /// Set the y coordinate of this point - /// + /** + * Set the y coordinate of this point + */ void setY (int); bool operator== (const CompPoint &) const; bool operator!= (const CompPoint &) const; + /** + * Takes from both co-ordinates + */ CompPoint & operator-= (const CompPoint &); + /** + * Adds to both co-ordinates + */ CompPoint & operator+= (const CompPoint &); + /** + * Retuns an added point + */ CompPoint operator+ (const CompPoint &) const; + /** + * Returns a subtracted point + */ CompPoint operator- (const CompPoint &) const; typedef std::vector<CompPoint> vector; diff --git a/include/core/rect.h b/include/core/rect.h index df03fe6..160c30b 100644 --- a/include/core/rect.h +++ b/include/core/rect.h @@ -26,10 +26,10 @@ #ifndef _COMPRECT_H #define _COMPRECT_H -/// -/// A 2D rectangle, which is likely in screen space. It's data is -/// isolated and can only be mutated with set() methods. -/// +/** + * A 2D rectangle, which is likely in screen space. It's data is + * isolated and can only be mutated with set() methods. + */ class CompRect { public: @@ -59,7 +59,10 @@ class CompRect { CompPoint center () const; int area () const; - + + /** + * Returns an X region handle for the CompRect + */ const Region region () const; void setGeometry (int x, int y, @@ -73,12 +76,33 @@ class CompRect { void setPos (const CompPoint&); void setSize (const CompSize&); - /* Setting an edge past it's opposite edge will result in both edges + /** + * Sets the left edge position + * + * Setting an edge past it's opposite edge will result in both edges * being set to the new value */ void setLeft (int); + /** + * Sets the top edge position + * + * Setting an edge past it's opposite edge will result in both edges + * being set to the new value + */ void setTop (int); + /** + * Sets the right edge position + * + * Setting an edge past it's opposite edge will result in both edges + * being set to the new value + */ void setRight (int); + /** + * Sets the bottom edge position + * + * Setting an edge past it's opposite edge will result in both edges + * being set to the new value + */ void setBottom (int); bool contains (const CompPoint &) const; diff --git a/include/core/region.h b/include/core/region.h index 87c10b6..4d3d1bf 100644 --- a/include/core/region.h +++ b/include/core/region.h @@ -34,10 +34,11 @@ class PrivateRegion; -/// -/// A 2D region with an (x,y) position and (width, height) dimensions similar to an XRegion. -/// It's data membmers are private and must be mutated with set() methods. -/// +/** + * A 2D region with an (x,y) position and arbitrary dimensions similar to + * an XRegion. It's data membmers are private and must be manipulated with + * set() methods. + */ class CompRegion { public: typedef std::vector<CompRegion> List; @@ -52,33 +53,110 @@ class CompRegion { CompRegion (const CompRect &); ~CompRegion (); + /** + * Returns a CompRect which encapsulates a given CompRegion + */ CompRect boundingRect () const; bool isEmpty () const; + + /** + * Returns the number of XRectangles in the XRegion handle + */ int numRects () const; + + /** + * Returns a vector of all the XRectangles in the XRegion handle + */ CompRect::vector rects () const; + + /** + * Returns the internal XRegion handle + */ const Region handle () const; + /** + * Returns true if the specified CompPoint falls within the + * CompRegion + */ bool contains (const CompPoint &) const; + /** + * Returns true if the specified CompRect falls within the + * CompRegion + */ bool contains (const CompRect &) const; + /** + * Returns true if the specified size falls withing the + * CompRegion + */ bool contains (int x, int y, int width, int height) const; + /** + * Returns a CompRegion that is the result of an intersect with + * the specified CompRegion and the region + */ CompRegion intersected (const CompRegion &) const; + /** + * Returns a CompRegion that is the result of an intersect with + * the specified CompRect and the region + */ CompRegion intersected (const CompRect &) const; + /** + * Returns true if a specified CompRegion intersects a region + */ bool intersects (const CompRegion &) const; + /** + * Returns true if a specified CompRect intersects a region + */ bool intersects (const CompRect &) const; + /** + * Returns a CompRegion covering the area of the region + * and not including the area of the specified CompRegion + */ CompRegion subtracted (const CompRegion &) const; + /** + * Returns a CompRegion covering the area of the region + * and not including the area of the specified CompRect + */ CompRegion subtracted (const CompRect &) const; - void translate (int, int); + /** + * Moves a region by x and y amount + */ + void translate (int dx, int dy); + /** + * Moves a region by an amount specified by the co-ordinates of a + * CompPoint + */ void translate (const CompPoint &); + /** + * Returns a CompRegion which is the result of the region being moved + * by dx and dy amount + */ CompRegion translated (int, int) const; + /** + * Returns a CompRegion which is the result of the region being moved + * by an amount specified by the co-ordinates of a CompPoint + */ CompRegion translated (const CompPoint &) const; void shrink (int, int); void shrink (const CompPoint &); CompRegion shrinked (int, int) const; CompRegion shrinked (const CompPoint &) const; + /** + * Returns a CompRegion which is the result of the region joined + * with a specified CompRegion + */ CompRegion united (const CompRegion &) const; + /** + * Returns a CompRegion which is the result of the region joined + * with a specified CompRect + */ CompRegion united (const CompRect &) const; + /** + * Returns a CompRegion which is the result of the region joined + * with a specified CompRegion, excluding the area in which + * both regions intersect + */ CompRegion xored (const CompRegion &) const; bool operator== (const CompRegion &) const; diff --git a/include/core/size.h b/include/core/size.h index 5ed56fc..576c01c 100644 --- a/include/core/size.h +++ b/include/core/size.h @@ -29,10 +29,10 @@ #include <vector> #include <list> -/// -/// A 2D size (likely in screen space) that can only be mutated with set() methods, -/// since it'd data members are private. -/// +/** + * A 2D size (likely in screen space) that can only be mutated with set() methods, + * since it'd data members are private. + */ class CompSize { public: |