Cleanup: split MetaSide from MetaDirection

The MetaDirection enumeration had META_SIDE_* values in it that
were used in some places where an enum with only four directions
was needed. Split this off into a separate enum called MetaSide
and use that enum name where appropriate.
This commit is contained in:
Owen W. Taylor
2009-03-17 16:53:01 -04:00
parent a47bb96536
commit fb7b820187
5 changed files with 61 additions and 54 deletions

View File

@ -40,7 +40,7 @@ typedef struct _MetaStrut MetaStrut;
struct _MetaStrut
{
MetaRectangle rect;
MetaDirection side;
MetaSide side;
};
#define BOX_LEFT(box) ((box).x) /* Leftmost pixel of rect */
@ -66,7 +66,7 @@ typedef struct _MetaEdge MetaEdge;
struct _MetaEdge
{
MetaRectangle rect; /* width or height should be 1 */
MetaDirection side_type; /* should only have 1 of the 4 directions set */
MetaSide side_type;
MetaEdgeType edge_type;
};

View File

@ -231,13 +231,20 @@ typedef enum
/* A few more definitions using aliases */
META_DIRECTION_HORIZONTAL = META_DIRECTION_LEFT | META_DIRECTION_RIGHT,
META_DIRECTION_VERTICAL = META_DIRECTION_UP | META_DIRECTION_DOWN,
} MetaDirection;
/* And a few more aliases */
/* Sometimes we want to talk about sides instead of directions; note
* that the values must be as follows or meta_window_update_struts()
* won't work. Using these values also is a safety blanket since
* MetaDirection used to be used as a side.
*/
typedef enum
{
META_SIDE_LEFT = META_DIRECTION_LEFT,
META_SIDE_RIGHT = META_DIRECTION_RIGHT,
META_SIDE_TOP = META_DIRECTION_TOP,
META_SIDE_BOTTOM = META_DIRECTION_BOTTOM
} MetaDirection;
} MetaSide;
/* Function a window button can have. Note, you can't add stuff here
* without extending the theme format to draw a new function and