Improve const-correctness in betawidget.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5791 4a71c877-e1ca-e34f-864e-861f7616d084
master
Freddie Witherden 2008-08-10 22:51:12 +00:00
parent b752595aae
commit 421335008a
2 changed files with 11 additions and 11 deletions

View File

@ -97,7 +97,7 @@ static bool widgetHasMouse(widget *self, point location)
* @param id The id of the desired event handler.
* @return A pointer to the event handler, or NULL if id is invalid.
*/
static eventTableEntry *widgetGetEventHandlerById(widget *self, int id)
static eventTableEntry *widgetGetEventHandlerById(const widget *self, int id)
{
int i;
eventTableEntry *entry = NULL;
@ -118,7 +118,7 @@ static eventTableEntry *widgetGetEventHandlerById(widget *self, int id)
return entry;
}
bool widgetIsA(widget *self, const classInfo *instanceOf)
bool widgetIsA(const widget *self, const classInfo *instanceOf)
{
const classInfo *widgetClass;
@ -332,7 +332,7 @@ void widgetDrawMask(widget *self)
widgetDoDrawMask(self);
}
point widgetAbsolutePosition(widget *self)
point widgetAbsolutePosition(const widget *self)
{
// Get our own offset
point pos = self->offset;
@ -346,7 +346,7 @@ point widgetAbsolutePosition(widget *self)
return pos;
}
rect widgetAbsoluteBounds(widget *self)
rect widgetAbsoluteBounds(const widget *self)
{
// Get our position
const point p = widgetAbsolutePosition(self);
@ -405,7 +405,7 @@ widget *widgetFindById(widget *self, const char *id)
return NULL;
}
void *widgetGetEventHandlerUserData(widget *self, int id)
void *widgetGetEventHandlerUserData(const widget *self, int id)
{
eventTableEntry *entry = widgetGetEventHandlerById(self, id);
@ -1035,7 +1035,7 @@ bool widgetHandleEventImpl(widget *self, event *evt)
return true;
}
bool widgetPointMasked(widget *self, point loc)
bool widgetPointMasked(const widget *self, point loc)
{
/*
* The format of the mask is CAIRO_FORMAT_A1, where:

View File

@ -402,7 +402,7 @@ void widgetCompositeImpl(widget *self);
* @param instanceOf The class we are interested in.
* @return True if it is legal to cast, false otherwise.
*/
bool widgetIsA(widget *self, const classInfo *instanceOf);
bool widgetIsA(const widget *self, const classInfo *instanceOf);
/*
* Public static, implementation defined methods
@ -468,7 +468,7 @@ widget *widgetFindById(widget *self, const char *id);
* @param self The widget to get the position of.
* @return The absolute position of self.
*/
point widgetAbsolutePosition(widget *self);
point widgetAbsolutePosition(const widget *self);
/**
* Returns the absolute bounding rectangle of the widget.
@ -476,7 +476,7 @@ point widgetAbsolutePosition(widget *self);
* @param self The widget to get the bounds of.
* @return The absolute bounds of self.
*/
rect widgetAbsoluteBounds(widget *self);
rect widgetAbsoluteBounds(const widget *self);
/**
* Transverses up the hierarchy until it finds parent-less widget (known as
@ -562,7 +562,7 @@ void widgetRemoveEventHandler(widget *self, int id);
* @returm The user-data for the event handler, or NULL if the eventId is
* invalid.
*/
void *widgetGetEventHandlerUserData(widget *self, int id);
void *widgetGetEventHandlerUserData(const widget *self, int id);
/**
* Sets the user-data for the event handler with an id of id registered to self
@ -744,6 +744,6 @@ bool widgetFireTimerCallbacks(widget *self, event *evt);
* @param loc The point (x,y) to check the mask status of.
* @return true if loc is masked; false otherwise;
*/
bool widgetPointMasked(widget *self, point loc);
bool widgetPointMasked(const widget *self, point loc);
#endif /*WIDGET_H_*/