1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 04:20:27 +01:00

fixed some Bool flags passed to WINgs functions to always set 1 or 0 values internally

This commit is contained in:
dan
2002-03-28 04:20:30 +00:00
parent 208ee16849
commit e4a53ba71e
21 changed files with 36 additions and 27 deletions

View File

@@ -13,6 +13,8 @@ Changes since wmaker 0.80.0:
- Fixed WMGetViewScreenPosition() to consider the window decorations.
- Added ability to enable/disable individual WMTableViewItems.
- Fixed textfields regarding interpretation of special keys with modifiers.
- Fixed some functions that accept a boolean flag as a paramater, to set only
1 or 0 for the flag value, not the flag passed by the user.
Changes since wmaker 0.70.0:

View File

@@ -106,7 +106,7 @@ void WMSetTableColumnConstraints(WMTableColumn *column,
void WMSetTableColumnEditable(WMTableColumn *column, Bool flag)
{
column->editable = flag;
column->editable = ((flag==0) ? 0 : 1);
}

View File

@@ -1650,7 +1650,7 @@ int WMGetTextInsertType(WMText *tPtr);
//int WMGetCurrentTextBlock(WMText *tPtr);
//void WMPrependTextBlock(WMText *tPtr, void *vtb);
void WMPrependTextBlock(WMText *tPtr, void *vtb);
void WMAppendTextBlock(WMText *tPtr, void *vtb);

View File

@@ -925,6 +925,8 @@ WMSetConnectionNonBlocking(WMConnection *cPtr, Bool flag)
{
wassertrv(cPtr!=NULL && cPtr->sock>=0, False);
flag = ((flag==0) ? 0 : 1);
if (cPtr->isNonBlocking == flag)
return True;
@@ -942,7 +944,7 @@ WMSetConnectionCloseOnExec(WMConnection *cPtr, Bool flag)
{
wassertrv(cPtr!=NULL && cPtr->sock>=0, False);
if (fcntl(cPtr->sock, F_SETFD, (flag ? FD_CLOEXEC : 0)) < 0) {
if (fcntl(cPtr->sock, F_SETFD, ((flag==0) ? 0 : FD_CLOEXEC)) < 0) {
return False;
}

View File

@@ -213,7 +213,7 @@ WMReleaseHost(WMHost *hPtr)
void
WMSetHostCacheEnabled(Bool flag)
{
hostCacheEnabled = flag;
hostCacheEnabled = ((flag==0) ? 0 : 1);
}

View File

@@ -120,7 +120,7 @@ WMCreateApplicationIconBlendedPixmap(WMScreen *scr, RColor *color)
void
WMSetApplicationHasAppIcon(WMScreen *scr, Bool flag)
{
scr->aflags.hasAppIcon = flag;
scr->aflags.hasAppIcon = ((flag==0) ? 0 : 1);
}

View File

@@ -151,7 +151,7 @@ WMSetBalloonDelay(WMScreen *scr, int delay)
void
WMSetBalloonEnabled(WMScreen *scr, Bool flag)
{
scr->balloon->flags.enabled = flag;
scr->balloon->flags.enabled = ((flag==0) ? 0 : 1);
W_UnmapView(scr->balloon->view);
}

View File

@@ -156,7 +156,7 @@ WMSetBrowserAllowMultipleSelection(WMBrowser *bPtr, Bool flag)
{
int i;
bPtr->flags.allowMultipleSelection = flag ? 1 : 0;
bPtr->flags.allowMultipleSelection = ((flag==0) ? 0 : 1);
for (i=0; i<bPtr->columnCount; i++) {
WMSetListAllowMultipleSelection(bPtr->columns[i], flag);
}
@@ -168,7 +168,7 @@ WMSetBrowserAllowEmptySelection(WMBrowser *bPtr, Bool flag)
{
int i;
bPtr->flags.allowEmptySelection = flag ? 1 : 0;
bPtr->flags.allowEmptySelection = ((flag==0) ? 0 : 1);
for (i=0; i<bPtr->columnCount; i++) {
WMSetListAllowEmptySelection(bPtr->columns[i], flag);
}
@@ -423,6 +423,8 @@ WMSetBrowserTitled(WMBrowser *bPtr, Bool flag)
int i;
int columnX, columnY;
flag = ((flag==0) ? 0 : 1);
if (bPtr->flags.isTitled == flag)
return;

View File

@@ -453,7 +453,7 @@ WMSetButtonFont(WMButton *bPtr, WMFont *font)
void
WMSetButtonEnabled(WMButton *bPtr, Bool flag)
{
bPtr->flags.enabled = flag ? 1 : 0;
bPtr->flags.enabled = ((flag==0) ? 0 : 1);
if (bPtr->view->flags.mapped) {
paintButton(bPtr);
@@ -560,7 +560,7 @@ WMGroupButtons(WMButton *bPtr, WMButton *newMember)
void
WMSetButtonContinuous(WMButton *bPtr, Bool flag)
{
bPtr->flags.continuous = flag;
bPtr->flags.continuous = ((flag==0) ? 0 : 1);
if (bPtr->timer) {
WMDeleteTimerHandler(bPtr->timer);
bPtr->timer = NULL;

View File

@@ -229,6 +229,7 @@ WMGetColorWellColor(WMColorWell *cPtr)
void
WSetColorWellBordered(WMColorWell *cPtr, Bool flag)
{
flag = ((flag==0) ? 0 : 1);
if (cPtr->flags.bordered != flag) {
cPtr->flags.bordered = flag;
W_ResizeView(cPtr->view, cPtr->view->size.width, cPtr->view->size.height);

View File

@@ -451,20 +451,20 @@ WMSetFilePanelDirectory(WMFilePanel *panel, char *path)
void
WMSetFilePanelCanChooseDirectories(WMFilePanel *panel, Bool flag)
{
panel->flags.canChooseDirectories = flag;
panel->flags.canChooseDirectories = ((flag==0) ? 0 : 1);
}
void
WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag)
{
panel->flags.canChooseFiles = flag;
panel->flags.canChooseFiles = ((flag==0) ? 0 : 1);
}
void
WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag)
{
panel->flags.autoCompletion = flag;
panel->flags.autoCompletion = ((flag==0) ? 0 : 1);
}

View File

@@ -192,6 +192,7 @@ WMSetLabelTextColor(WMLabel *lPtr, WMColor *color)
void
WMSetLabelWraps(WMLabel *lPtr, Bool flag)
{
flag = ((flag==0) ? 0 : 1);
if (lPtr->flags.noWrap != !flag) {
lPtr->flags.noWrap = !flag;
if (lPtr->view->flags.realized)

View File

@@ -145,14 +145,14 @@ WMCreateList(WMWidget *parent)
void
WMSetListAllowMultipleSelection(WMList *lPtr, Bool flag)
{
lPtr->flags.allowMultipleSelection = flag ? 1 : 0;
lPtr->flags.allowMultipleSelection = ((flag==0) ? 0 : 1);
}
void
WMSetListAllowEmptySelection(WMList *lPtr, Bool flag)
{
lPtr->flags.allowEmptySelection = flag ? 1 : 0;
lPtr->flags.allowEmptySelection = ((flag==0) ? 0 : 1);
}

View File

@@ -96,7 +96,7 @@ WMGetMenuItemEnabled(WMMenuItem *item)
void
WMSetMenuItemEnabled(WMMenuItem *item, Bool flag)
{
item->flags.enabled = flag;
item->flags.enabled = ((flag==0) ? 0 : 1);
}

View File

@@ -192,7 +192,7 @@ WMRemovePopUpButtonItem(WMPopUpButton *bPtr, int index)
void
WMSetPopUpButtonEnabled(WMPopUpButton *bPtr, Bool flag)
{
bPtr->flags.enabled = flag;
bPtr->flags.enabled = ((flag==0) ? 0 : 1);
if (bPtr->view->flags.mapped)
paintPopUpButton(bPtr);
}
@@ -252,7 +252,7 @@ WMSetPopUpButtonText(WMPopUpButton *bPtr, char *text)
void
WMSetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index, Bool flag)
{
WMSetMenuItemEnabled(WMGetFromArray(bPtr->items, index), flag);
WMSetMenuItemEnabled(WMGetFromArray(bPtr->items, index), (flag ? 1 : 0));
}
@@ -266,7 +266,7 @@ WMGetPopUpButtonItemEnabled(WMPopUpButton *bPtr, int index)
void
WMSetPopUpButtonPullsDown(WMPopUpButton *bPtr, Bool flag)
{
bPtr->flags.pullsDown = flag;
bPtr->flags.pullsDown = ((flag==0) ? 0 : 1);
if (flag) {
bPtr->selectedItemIndex = -1;
}

View File

@@ -219,7 +219,7 @@ WMSetSliderContinuous(WMSlider *slider, Bool flag)
{
CHECK_CLASS(slider, WC_Slider);
slider->flags.continuous = flag;
slider->flags.continuous = ((flag==0) ? 0 : 1);
}

View File

@@ -837,7 +837,7 @@ WMSetSplitViewVertical(WMSplitView *sPtr, Bool flag)
CHECK_CLASS(sPtr, WC_SplitView);
vertical = (flag) ? 1 : 0;
vertical = ((flag==0) ? 0 : 1);
if (sPtr->flags.vertical == vertical)
return;

View File

@@ -276,7 +276,7 @@ WMAddItemInTabView(WMTabView *tPtr, WMTabViewItem *item)
void
WMSetTabViewEnabled(WMTabView *tPtr, Bool flag)
{
tPtr->flags.enabled = (flag ? 1 : 0);
tPtr->flags.enabled = ((flag==0) ? 0 : 1);
if (W_VIEW_REALIZED(tPtr->view))
paintTabView(tPtr);
}
@@ -969,7 +969,7 @@ WMCreateTabViewItem(int identifier, char *label)
void
WMSetTabViewItemEnabled(WMTabViewItem *tPtr, Bool flag)
{
tPtr->flags.enabled = (flag ? 1 : 0);
tPtr->flags.enabled = ((flag==0) ? 0 : 1);
if (tPtr->tabView && W_VIEW_REALIZED(tPtr->tabView->view))
paintTabView(tPtr->tabView);
}

View File

@@ -527,7 +527,7 @@ WMSetTextFieldBeveled(WMTextField *tPtr, Bool flag)
{
CHECK_CLASS(tPtr, WC_TextField);
tPtr->flags.beveled = flag;
tPtr->flags.beveled = ((flag==0) ? 0 : 1);
if (tPtr->view->flags.realized) {
paintTextField(tPtr);
@@ -541,7 +541,7 @@ WMSetTextFieldSecure(WMTextField *tPtr, Bool flag)
{
CHECK_CLASS(tPtr, WC_TextField);
tPtr->flags.secure = flag;
tPtr->flags.secure = ((flag==0) ? 0 : 1);
if (tPtr->view->flags.realized) {
paintTextField(tPtr);
@@ -563,7 +563,7 @@ WMSetTextFieldEditable(WMTextField *tPtr, Bool flag)
{
CHECK_CLASS(tPtr, WC_TextField);
tPtr->flags.enabled = flag;
tPtr->flags.enabled = ((flag==0) ? 0 : 1);
if (tPtr->view->flags.realized) {
paintTextField(tPtr);

View File

@@ -708,7 +708,7 @@ WMGetViewPosition(WMView *view)
void
WMSetViewNotifySizeChanges(WMView *view, Bool flag)
{
view->flags.notifySizeChanged = flag;
view->flags.notifySizeChanged = ((flag==0) ? 0 : 1);
}

View File

@@ -554,6 +554,7 @@ WMSetWindowLevel(WMWindow *win, int level)
void
WMSetWindowDocumentEdited(WMWindow *win, Bool flag)
{
flag = ((flag==0) ? 0 : 1);
if (win->flags.documentEdited != flag) {
win->flags.documentEdited = flag;
if (win->view->flags.realized)