Improve const-correctness in betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5791 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
b752595aae
commit
421335008a
|
@ -97,7 +97,7 @@ static bool widgetHasMouse(widget *self, point location)
|
||||||
* @param id The id of the desired event handler.
|
* @param id The id of the desired event handler.
|
||||||
* @return A pointer to the event handler, or NULL if id is invalid.
|
* @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;
|
int i;
|
||||||
eventTableEntry *entry = NULL;
|
eventTableEntry *entry = NULL;
|
||||||
|
@ -118,7 +118,7 @@ static eventTableEntry *widgetGetEventHandlerById(widget *self, int id)
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool widgetIsA(widget *self, const classInfo *instanceOf)
|
bool widgetIsA(const widget *self, const classInfo *instanceOf)
|
||||||
{
|
{
|
||||||
const classInfo *widgetClass;
|
const classInfo *widgetClass;
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ void widgetDrawMask(widget *self)
|
||||||
widgetDoDrawMask(self);
|
widgetDoDrawMask(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
point widgetAbsolutePosition(widget *self)
|
point widgetAbsolutePosition(const widget *self)
|
||||||
{
|
{
|
||||||
// Get our own offset
|
// Get our own offset
|
||||||
point pos = self->offset;
|
point pos = self->offset;
|
||||||
|
@ -346,7 +346,7 @@ point widgetAbsolutePosition(widget *self)
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
rect widgetAbsoluteBounds(widget *self)
|
rect widgetAbsoluteBounds(const widget *self)
|
||||||
{
|
{
|
||||||
// Get our position
|
// Get our position
|
||||||
const point p = widgetAbsolutePosition(self);
|
const point p = widgetAbsolutePosition(self);
|
||||||
|
@ -405,7 +405,7 @@ widget *widgetFindById(widget *self, const char *id)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *widgetGetEventHandlerUserData(widget *self, int id)
|
void *widgetGetEventHandlerUserData(const widget *self, int id)
|
||||||
{
|
{
|
||||||
eventTableEntry *entry = widgetGetEventHandlerById(self, id);
|
eventTableEntry *entry = widgetGetEventHandlerById(self, id);
|
||||||
|
|
||||||
|
@ -1035,7 +1035,7 @@ bool widgetHandleEventImpl(widget *self, event *evt)
|
||||||
return true;
|
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:
|
* The format of the mask is CAIRO_FORMAT_A1, where:
|
||||||
|
|
|
@ -402,7 +402,7 @@ void widgetCompositeImpl(widget *self);
|
||||||
* @param instanceOf The class we are interested in.
|
* @param instanceOf The class we are interested in.
|
||||||
* @return True if it is legal to cast, false otherwise.
|
* @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
|
* 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.
|
* @param self The widget to get the position of.
|
||||||
* @return The absolute position of self.
|
* @return The absolute position of self.
|
||||||
*/
|
*/
|
||||||
point widgetAbsolutePosition(widget *self);
|
point widgetAbsolutePosition(const widget *self);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the absolute bounding rectangle of the widget.
|
* 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.
|
* @param self The widget to get the bounds of.
|
||||||
* @return The absolute bounds of self.
|
* @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
|
* 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
|
* @returm The user-data for the event handler, or NULL if the eventId is
|
||||||
* invalid.
|
* 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
|
* 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.
|
* @param loc The point (x,y) to check the mask status of.
|
||||||
* @return true if loc is masked; false otherwise;
|
* @return true if loc is masked; false otherwise;
|
||||||
*/
|
*/
|
||||||
bool widgetPointMasked(widget *self, point loc);
|
bool widgetPointMasked(const widget *self, point loc);
|
||||||
|
|
||||||
#endif /*WIDGET_H_*/
|
#endif /*WIDGET_H_*/
|
||||||
|
|
Loading…
Reference in New Issue