mirror of
https://github.com/gryf/wmaker.git
synced 2026-02-02 14:15:46 +01:00
WINGs: Added 'const' attribute to functions in wpanel, wpopupbutton, wtabview
This makes both the API and local function const-correct on their input parameters.
This commit is contained in:
committed by
Carlos R. Mafra
parent
6616323088
commit
72108875aa
@@ -1380,10 +1380,10 @@ void WMSetPopUpButtonAction(WMPopUpButton *sPtr, WMAction *action,
|
||||
|
||||
void WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag);
|
||||
|
||||
WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, char *title);
|
||||
WMMenuItem* WMAddPopUpButtonItem(WMPopUpButton *bPtr, const char *title);
|
||||
|
||||
WMMenuItem* WMInsertPopUpButtonItem(WMPopUpButton *bPtr, int index,
|
||||
char *title);
|
||||
const char *title);
|
||||
|
||||
void WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index);
|
||||
|
||||
@@ -1395,7 +1395,7 @@ void WMSetPopUpButtonSelectedItem(WMPopUpButton *bPtr, int index);
|
||||
|
||||
int WMGetPopUpButtonSelectedItem(WMPopUpButton *bPtr);
|
||||
|
||||
void WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text);
|
||||
void WMSetPopUpButtonText(WMPopUpButton *bPtr, const char *text);
|
||||
|
||||
/* don't free the returned data */
|
||||
char* WMGetPopUpButtonItem(WMPopUpButton *bPtr, int index);
|
||||
@@ -1702,7 +1702,7 @@ void WMInsertItemInTabView(WMTabView *tPtr, int index, WMTabViewItem *item);
|
||||
void WMRemoveTabViewItem(WMTabView *tPtr, WMTabViewItem *item);
|
||||
|
||||
WMTabViewItem* WMAddTabViewItemWithView(WMTabView *tPtr, WMView *view,
|
||||
int identifier, char *label);
|
||||
int identifier, const char *label);
|
||||
|
||||
WMTabViewItem* WMTabViewItemAtPoint(WMTabView *tPtr, int x, int y);
|
||||
|
||||
@@ -1729,7 +1729,7 @@ void WMSetTabViewItemEnabled(WMTabViewItem *tPtr, Bool flag);
|
||||
|
||||
int WMGetTabViewItemIdentifier(WMTabViewItem *item);
|
||||
|
||||
void WMSetTabViewItemLabel(WMTabViewItem *item, char *label);
|
||||
void WMSetTabViewItemLabel(WMTabViewItem *item, const char *label);
|
||||
|
||||
char* WMGetTabViewItemLabel(WMTabViewItem *item);
|
||||
|
||||
@@ -1758,26 +1758,26 @@ void WMSetBoxHorizontal(WMBox *box, Bool flag);
|
||||
|
||||
/* ---[ WINGs/wpanel.c ]-------------------------------------------------- */
|
||||
|
||||
int WMRunAlertPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
|
||||
char *defaultButton, char *alternateButton,
|
||||
char *otherButton);
|
||||
int WMRunAlertPanel(WMScreen *app, WMWindow *owner, const char *title, const char *msg,
|
||||
const char *defaultButton, const char *alternateButton,
|
||||
const char *otherButton);
|
||||
|
||||
/* you can free the returned string */
|
||||
char* WMRunInputPanel(WMScreen *app, WMWindow *owner, char *title, char *msg,
|
||||
char *defaultText, char *okButton, char *cancelButton);
|
||||
char* WMRunInputPanel(WMScreen *app, WMWindow *owner, const char *title, const char *msg,
|
||||
const char *defaultText, const char *okButton, const char *cancelButton);
|
||||
|
||||
WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, char *title,
|
||||
char *msg, char *defaultButton,
|
||||
char *alternateButton, char *otherButton);
|
||||
WMAlertPanel* WMCreateAlertPanel(WMScreen *app, WMWindow *owner, const char *title,
|
||||
const char *msg, const char *defaultButton,
|
||||
const char *alternateButton, const char *otherButton);
|
||||
|
||||
WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, char *title,
|
||||
char *msg, char *defaultText, char *okButton,
|
||||
char *cancelButton);
|
||||
WMInputPanel* WMCreateInputPanel(WMScreen *app, WMWindow *owner, const char *title,
|
||||
const char *msg, const char *defaultText, const char *okButton,
|
||||
const char *cancelButton);
|
||||
|
||||
|
||||
WMGenericPanel* WMCreateGenericPanel(WMScreen *scrPtr, WMWindow *owner,
|
||||
char *title, char *defaultButton,
|
||||
char *alternateButton);
|
||||
const char *title, const char *defaultButton,
|
||||
const char *alternateButton);
|
||||
|
||||
void WMDestroyAlertPanel(WMAlertPanel *panel);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ static void handleKeyPress(XEvent * event, void *clientData)
|
||||
|
||||
int
|
||||
WMRunAlertPanel(WMScreen * scrPtr, WMWindow * owner,
|
||||
char *title, char *msg, char *defaultButton, char *alternateButton, char *otherButton)
|
||||
const char *title, const char *msg, const char *defaultButton, const char *alternateButton, const char *otherButton)
|
||||
{
|
||||
WMAlertPanel *panel;
|
||||
int tmp;
|
||||
@@ -85,8 +85,8 @@ void WMDestroyAlertPanel(WMAlertPanel * panel)
|
||||
}
|
||||
|
||||
WMAlertPanel *WMCreateAlertPanel(WMScreen * scrPtr, WMWindow * owner,
|
||||
char *title, char *msg, char *defaultButton,
|
||||
char *alternateButton, char *otherButton)
|
||||
const char *title, const char *msg, const char *defaultButton,
|
||||
const char *alternateButton, const char *otherButton)
|
||||
{
|
||||
WMAlertPanel *panel;
|
||||
int dw = 0, aw = 0, ow = 0, w;
|
||||
@@ -262,8 +262,8 @@ static void handleKeyPress2(XEvent * event, void *clientData)
|
||||
}
|
||||
}
|
||||
|
||||
char *WMRunInputPanel(WMScreen * scrPtr, WMWindow * owner, char *title,
|
||||
char *msg, char *defaultText, char *okButton, char *cancelButton)
|
||||
char *WMRunInputPanel(WMScreen * scrPtr, WMWindow * owner, const char *title,
|
||||
const char *msg, const char *defaultText, const char *okButton, const char *cancelButton)
|
||||
{
|
||||
WMInputPanel *panel;
|
||||
char *tmp;
|
||||
@@ -334,8 +334,8 @@ static void endedEditingObserver(void *observerData, WMNotification * notificati
|
||||
}
|
||||
}
|
||||
|
||||
WMInputPanel *WMCreateInputPanel(WMScreen * scrPtr, WMWindow * owner, char *title, char *msg,
|
||||
char *defaultText, char *okButton, char *cancelButton)
|
||||
WMInputPanel *WMCreateInputPanel(WMScreen * scrPtr, WMWindow * owner, const char *title, const char *msg,
|
||||
const char *defaultText, const char *okButton, const char *cancelButton)
|
||||
{
|
||||
WMInputPanel *panel;
|
||||
int x, dw = 0, aw = 0, w;
|
||||
@@ -454,7 +454,7 @@ void WMDestroyGenericPanel(WMGenericPanel * panel)
|
||||
}
|
||||
|
||||
WMGenericPanel *WMCreateGenericPanel(WMScreen * scrPtr, WMWindow * owner,
|
||||
char *title, char *defaultButton, char *alternateButton)
|
||||
const char *title, const char *defaultButton, const char *alternateButton)
|
||||
{
|
||||
WMGenericPanel *panel;
|
||||
int dw = 0, aw = 0, w;
|
||||
|
||||
@@ -101,7 +101,7 @@ void WMSetPopUpButtonAction(WMPopUpButton * bPtr, WMAction * action, void *clien
|
||||
bPtr->clientData = clientData;
|
||||
}
|
||||
|
||||
WMMenuItem *WMAddPopUpButtonItem(WMPopUpButton * bPtr, char *title)
|
||||
WMMenuItem *WMAddPopUpButtonItem(WMPopUpButton * bPtr, const char *title)
|
||||
{
|
||||
WMMenuItem *item;
|
||||
|
||||
@@ -118,7 +118,7 @@ WMMenuItem *WMAddPopUpButtonItem(WMPopUpButton * bPtr, char *title)
|
||||
return item;
|
||||
}
|
||||
|
||||
WMMenuItem *WMInsertPopUpButtonItem(WMPopUpButton * bPtr, int index, char *title)
|
||||
WMMenuItem *WMInsertPopUpButtonItem(WMPopUpButton * bPtr, int index, const char *title)
|
||||
{
|
||||
WMMenuItem *item;
|
||||
|
||||
@@ -198,7 +198,7 @@ int WMGetPopUpButtonSelectedItem(WMPopUpButton * bPtr)
|
||||
return bPtr->selectedItemIndex;
|
||||
}
|
||||
|
||||
void WMSetPopUpButtonText(WMPopUpButton * bPtr, char *text)
|
||||
void WMSetPopUpButtonText(WMPopUpButton * bPtr, const char *text)
|
||||
{
|
||||
if (bPtr->caption)
|
||||
wfree(bPtr->caption);
|
||||
|
||||
@@ -224,7 +224,7 @@ void WMSetTabViewDelegate(WMTabView * tPtr, WMTabViewDelegate * delegate)
|
||||
tPtr->delegate = delegate;
|
||||
}
|
||||
|
||||
WMTabViewItem *WMAddTabViewItemWithView(WMTabView * tPtr, WMView * view, int identifier, char *label)
|
||||
WMTabViewItem *WMAddTabViewItemWithView(WMTabView * tPtr, WMView * view, int identifier, const char *label)
|
||||
{
|
||||
WMTabViewItem *item;
|
||||
|
||||
@@ -823,7 +823,7 @@ WMTabViewItem *WMCreateTabViewItemWithIdentifier(int identifier)
|
||||
return item;
|
||||
}
|
||||
|
||||
WMTabViewItem *WMCreateTabViewItem(int identifier, char *label)
|
||||
WMTabViewItem *WMCreateTabViewItem(int identifier, const char *label)
|
||||
{
|
||||
WMTabViewItem *item;
|
||||
|
||||
@@ -858,7 +858,7 @@ void WMSetTabViewFont(WMTabView * tPtr, WMFont * font)
|
||||
recalcTabWidth(tPtr);
|
||||
}
|
||||
|
||||
void WMSetTabViewItemLabel(WMTabViewItem * item, char *label)
|
||||
void WMSetTabViewItemLabel(WMTabViewItem * item, const char *label)
|
||||
{
|
||||
if (item->label)
|
||||
wfree(item->label);
|
||||
|
||||
Reference in New Issue
Block a user