1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-06-17 07:55:24 +02:00

changed indentation to use spaces only

This commit is contained in:
dan
2004-10-12 21:28:27 +00:00
parent 5912898b06
commit 6830b05716
240 changed files with 35951 additions and 35773 deletions
+1
View File
@@ -242,3 +242,4 @@ int main(int argc, char **argv)
return 0; return 0;
} }
+9 -4
View File
@@ -19,13 +19,15 @@ static char *options[] = {
}; };
int numberOfRows(WMTableViewDelegate *self, WMTableView *table) int
numberOfRows(WMTableViewDelegate *self, WMTableView *table)
{ {
return 20; return 20;
} }
void *valueForCell(WMTableViewDelegate *self, WMTableColumn *column, int row) void*
valueForCell(WMTableViewDelegate *self, WMTableColumn *column, int row)
{ {
/*WMTableView *table = (WMTableView*)WMGetTableColumnTableView(column);*/ /*WMTableView *table = (WMTableView*)WMGetTableColumnTableView(column);*/
int i; int i;
@@ -46,7 +48,8 @@ void *valueForCell(WMTableViewDelegate *self, WMTableColumn *column, int row)
} }
void setValueForCell(WMTableViewDelegate *self, WMTableColumn *column, int row, void
setValueForCell(WMTableViewDelegate *self, WMTableColumn *column, int row,
void *data) void *data)
{ {
if ((int)WMGetTableColumnId(column) == 1) if ((int)WMGetTableColumnId(column) == 1)
@@ -65,7 +68,8 @@ static WMTableViewDelegate delegate = {
void clickedTable(WMWidget *w, void *self) void
clickedTable(WMWidget *w, void *self)
{ {
int row = WMGetTableViewClickedRow((WMTableView*)self); int row = WMGetTableViewClickedRow((WMTableView*)self);
@@ -133,3 +137,4 @@ main(int argc, char **argv)
return 0; return 0;
} }
+72 -51
View File
@@ -57,9 +57,9 @@ static char *SelectionColor = "#bbbbcc";
static void stringDraw(WMScreen *scr, Drawable d, GC gc, GC sgc, static void
WMColor *textColor, WMFont *font, void *data, stringDraw(WMScreen *scr, Drawable d, GC gc, GC sgc, WMColor *textColor,
WMRect rect, Bool selected) WMFont *font, void *data, WMRect rect, Bool selected)
{ {
int x, y; int x, y;
XRectangle rects[1]; XRectangle rects[1];
@@ -91,8 +91,9 @@ static void stringDraw(WMScreen *scr, Drawable d, GC gc, GC sgc,
static void pixmapDraw(WMScreen *scr, Drawable d, GC gc, GC sgc, static void
WMPixmap *pixmap, WMRect rect, Bool selected) pixmapDraw(WMScreen *scr, Drawable d, GC gc, GC sgc, WMPixmap *pixmap,
WMRect rect, Bool selected)
{ {
int x, y; int x, y;
XRectangle rects[1]; XRectangle rects[1];
@@ -135,8 +136,9 @@ static void pixmapDraw(WMScreen *scr, Drawable d, GC gc, GC sgc,
static void SECellPainter(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row, Drawable d) SECellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
int row, Drawable d)
{ {
StringEditorData *strdata = (StringEditorData*)self->data; StringEditorData *strdata = (StringEditorData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
@@ -149,8 +151,9 @@ static void SECellPainter(WMTableColumnDelegate *self,
} }
static void selectedSECellPainter(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row, Drawable d) selectedSECellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
int row, Drawable d)
{ {
StringEditorData *strdata = (StringEditorData*)self->data; StringEditorData *strdata = (StringEditorData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
@@ -163,8 +166,8 @@ static void selectedSECellPainter(WMTableColumnDelegate *self,
} }
static void beginSECellEdit(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row) beginSECellEdit(WMTableColumnDelegate *self, WMTableColumn *column, int row)
{ {
StringEditorData *strdata = (StringEditorData*)self->data; StringEditorData *strdata = (StringEditorData*)self->data;
WMRect rect = WMTableViewRectForCell(strdata->table, column, row); WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
@@ -178,8 +181,8 @@ static void beginSECellEdit(WMTableColumnDelegate *self,
} }
static void endSECellEdit(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row) endSECellEdit(WMTableColumnDelegate *self, WMTableColumn *column, int row)
{ {
StringEditorData *strdata = (StringEditorData*)self->data; StringEditorData *strdata = (StringEditorData*)self->data;
char *text; char *text;
@@ -191,7 +194,8 @@ static void endSECellEdit(WMTableColumnDelegate *self,
} }
WMTableColumnDelegate *WTCreateStringEditorDelegate(WMTableView *parent) WMTableColumnDelegate*
WTCreateStringEditorDelegate(WMTableView *parent)
{ {
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate)); WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
WMScreen *scr = WMWidgetScreen(parent); WMScreen *scr = WMWidgetScreen(parent);
@@ -221,8 +225,9 @@ WMTableColumnDelegate *WTCreateStringEditorDelegate(WMTableView *parent)
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
static void ESCellPainter(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row, Drawable d) ESCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
int row, Drawable d)
{ {
EnumSelectorData *strdata = (EnumSelectorData*)self->data; EnumSelectorData *strdata = (EnumSelectorData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
@@ -236,8 +241,9 @@ static void ESCellPainter(WMTableColumnDelegate *self,
} }
static void selectedESCellPainter(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row, Drawable d) selectedESCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
int row, Drawable d)
{ {
EnumSelectorData *strdata = (EnumSelectorData*)self->data; EnumSelectorData *strdata = (EnumSelectorData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
@@ -251,8 +257,8 @@ static void selectedESCellPainter(WMTableColumnDelegate *self,
} }
static void beginESCellEdit(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row) beginESCellEdit(WMTableColumnDelegate *self, WMTableColumn *column, int row)
{ {
EnumSelectorData *strdata = (EnumSelectorData*)self->data; EnumSelectorData *strdata = (EnumSelectorData*)self->data;
WMRect rect = WMTableViewRectForCell(strdata->table, column, row); WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
@@ -269,8 +275,8 @@ static void beginESCellEdit(WMTableColumnDelegate *self,
} }
static void endESCellEdit(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row) endESCellEdit(WMTableColumnDelegate *self, WMTableColumn *column, int row)
{ {
EnumSelectorData *strdata = (EnumSelectorData*)self->data; EnumSelectorData *strdata = (EnumSelectorData*)self->data;
int option; int option;
@@ -282,7 +288,8 @@ static void endESCellEdit(WMTableColumnDelegate *self,
} }
WMTableColumnDelegate *WTCreateEnumSelectorDelegate(WMTableView *parent) WMTableColumnDelegate*
WTCreateEnumSelectorDelegate(WMTableView *parent)
{ {
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate)); WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
WMScreen *scr = WMWidgetScreen(parent); WMScreen *scr = WMWidgetScreen(parent);
@@ -310,8 +317,9 @@ WMTableColumnDelegate *WTCreateEnumSelectorDelegate(WMTableView *parent)
} }
void WTSetEnumSelectorOptions(WMTableColumnDelegate *delegate, void
char **options, int count) WTSetEnumSelectorOptions(WMTableColumnDelegate *delegate, char **options,
int count)
{ {
EnumSelectorData *data = (EnumSelectorData*)delegate->data; EnumSelectorData *data = (EnumSelectorData*)delegate->data;
int i; int i;
@@ -334,8 +342,9 @@ void WTSetEnumSelectorOptions(WMTableColumnDelegate *delegate,
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
static void BSCellPainter(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row, Drawable d) BSCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
int row, Drawable d)
{ {
BooleanSwitchData *strdata = (BooleanSwitchData*)self->data; BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
@@ -354,8 +363,9 @@ static void BSCellPainter(WMTableColumnDelegate *self,
} }
static void selectedBSCellPainter(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row, Drawable d) selectedBSCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
int row, Drawable d)
{ {
BooleanSwitchData *strdata = (BooleanSwitchData*)self->data; BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
@@ -375,8 +385,8 @@ static void selectedBSCellPainter(WMTableColumnDelegate *self,
static void beginBSCellEdit(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row) beginBSCellEdit(WMTableColumnDelegate *self, WMTableColumn *column, int row)
{ {
BooleanSwitchData *strdata = (BooleanSwitchData*)self->data; BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
WMRect rect = WMTableViewRectForCell(strdata->table, column, row); WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
@@ -390,8 +400,8 @@ static void beginBSCellEdit(WMTableColumnDelegate *self,
} }
static void endBSCellEdit(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row) endBSCellEdit(WMTableColumnDelegate *self, WMTableColumn *column, int row)
{ {
BooleanSwitchData *strdata = (BooleanSwitchData*)self->data; BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
int value; int value;
@@ -402,7 +412,8 @@ static void endBSCellEdit(WMTableColumnDelegate *self,
} }
WMTableColumnDelegate *WTCreateBooleanSwitchDelegate(WMTableView *parent) WMTableColumnDelegate*
WTCreateBooleanSwitchDelegate(WMTableView *parent)
{ {
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate)); WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
WMScreen *scr = WMWidgetScreen(parent); WMScreen *scr = WMWidgetScreen(parent);
@@ -437,8 +448,9 @@ WMTableColumnDelegate *WTCreateBooleanSwitchDelegate(WMTableView *parent)
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
static void SCellPainter(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row, Drawable d) SCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
int row, Drawable d)
{ {
StringData *strdata = (StringData*)self->data; StringData *strdata = (StringData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
@@ -451,8 +463,9 @@ static void SCellPainter(WMTableColumnDelegate *self,
} }
static void selectedSCellPainter(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row, Drawable d) selectedSCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
int row, Drawable d)
{ {
StringData *strdata = (StringData*)self->data; StringData *strdata = (StringData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
@@ -465,7 +478,8 @@ static void selectedSCellPainter(WMTableColumnDelegate *self,
} }
WMTableColumnDelegate *WTCreateStringDelegate(WMTableView *parent) WMTableColumnDelegate*
WTCreateStringDelegate(WMTableView *parent)
{ {
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate)); WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
WMScreen *scr = WMWidgetScreen(parent); WMScreen *scr = WMWidgetScreen(parent);
@@ -490,8 +504,9 @@ WMTableColumnDelegate *WTCreateStringDelegate(WMTableView *parent)
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
static void PCellPainter(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row, Drawable d) PCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
int row, Drawable d)
{ {
StringData *strdata = (StringData*)self->data; StringData *strdata = (StringData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
@@ -504,8 +519,9 @@ static void PCellPainter(WMTableColumnDelegate *self,
} }
static void selectedPCellPainter(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row, Drawable d) selectedPCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
int row, Drawable d)
{ {
StringData *strdata = (StringData*)self->data; StringData *strdata = (StringData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
@@ -518,7 +534,8 @@ static void selectedPCellPainter(WMTableColumnDelegate *self,
} }
WMTableColumnDelegate *WTCreatePixmapDelegate(WMTableView *table) WMTableColumnDelegate*
WTCreatePixmapDelegate(WMTableView *table)
{ {
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate)); WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
WMScreen *scr = WMWidgetScreen(table); WMScreen *scr = WMWidgetScreen(table);
@@ -541,8 +558,9 @@ WMTableColumnDelegate *WTCreatePixmapDelegate(WMTableView *table)
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
static void drawPSCell(WMTableColumnDelegate *self, Drawable d, static void
WMTableColumn *column, int row, Bool selected) drawPSCell(WMTableColumnDelegate *self, Drawable d, WMTableColumn *column,
int row, Bool selected)
{ {
StringData *strdata = (StringData*)self->data; StringData *strdata = (StringData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column); WMTableView *table = WMGetTableColumnTableView(column);
@@ -579,21 +597,24 @@ static void drawPSCell(WMTableColumnDelegate *self, Drawable d,
} }
static void PSCellPainter(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row, Drawable d) PSCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
int row, Drawable d)
{ {
drawPSCell(self, d, column, row, False); drawPSCell(self, d, column, row, False);
} }
static void selectedPSCellPainter(WMTableColumnDelegate *self, static void
WMTableColumn *column, int row, Drawable d) selectedPSCellPainter(WMTableColumnDelegate *self, WMTableColumn *column,
int row, Drawable d)
{ {
drawPSCell(self, d, column, row, True); drawPSCell(self, d, column, row, True);
} }
WMTableColumnDelegate *WTCreatePixmapStringDelegate(WMTableView *parent) WMTableColumnDelegate*
WTCreatePixmapStringDelegate(WMTableView *parent)
{ {
WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate)); WMTableColumnDelegate *delegate = wmalloc(sizeof(WMTableColumnDelegate));
WMScreen *scr = WMWidgetScreen(parent); WMScreen *scr = WMWidgetScreen(parent);
+105 -56
View File
@@ -33,7 +33,8 @@ static void rearrangeHeader(WMTableView *table);
static WMRange rowsInRect(WMTableView *table, WMRect rect); static WMRange rowsInRect(WMTableView *table, WMRect rect);
WMTableColumn *WMCreateTableColumn(char *title) WMTableColumn*
WMCreateTableColumn(char *title)
{ {
WMTableColumn *col = wmalloc(sizeof(WMTableColumn)); WMTableColumn *col = wmalloc(sizeof(WMTableColumn));
@@ -56,19 +57,22 @@ WMTableColumn *WMCreateTableColumn(char *title)
} }
void WMSetTableColumnId(WMTableColumn *column, void *id) void
WMSetTableColumnId(WMTableColumn *column, void *id)
{ {
column->id = id; column->id = id;
} }
void *WMGetTableColumnId(WMTableColumn *column) void*
WMGetTableColumnId(WMTableColumn *column)
{ {
return column->id; return column->id;
} }
void WMSetTableColumnWidth(WMTableColumn *column, unsigned width) void
WMSetTableColumnWidth(WMTableColumn *column, unsigned width)
{ {
if (column->maxWidth == 0) if (column->maxWidth == 0)
column->width = WMAX(column->minWidth, width); column->width = WMAX(column->minWidth, width);
@@ -81,15 +85,16 @@ void WMSetTableColumnWidth(WMTableColumn *column, unsigned width)
} }
void WMSetTableColumnDelegate(WMTableColumn *column, void
WMTableColumnDelegate *delegate) WMSetTableColumnDelegate(WMTableColumn *column, WMTableColumnDelegate *delegate)
{ {
column->delegate = delegate; column->delegate = delegate;
} }
void WMSetTableColumnConstraints(WMTableColumn *column, void
unsigned minWidth, unsigned maxWidth) WMSetTableColumnConstraints(WMTableColumn *column, unsigned minWidth,
unsigned maxWidth)
{ {
wassertr(maxWidth == 0 || minWidth <= maxWidth); wassertr(maxWidth == 0 || minWidth <= maxWidth);
@@ -103,13 +108,15 @@ void WMSetTableColumnConstraints(WMTableColumn *column,
} }
void WMSetTableColumnEditable(WMTableColumn *column, Bool flag) void
WMSetTableColumnEditable(WMTableColumn *column, Bool flag)
{ {
column->editable = ((flag==0) ? 0 : 1); column->editable = ((flag==0) ? 0 : 1);
} }
WMTableView *WMGetTableColumnTableView(WMTableColumn *column) WMTableView*
WMGetTableColumnTableView(WMTableColumn *column)
{ {
return column->table; return column->table;
} }
@@ -192,7 +199,8 @@ static void handleEvents(XEvent *event, void *data);
static void handleTableEvents(XEvent *event, void *data); static void handleTableEvents(XEvent *event, void *data);
static void repaintTable(WMTableView *table); static void repaintTable(WMTableView *table);
static WMSize getTotalSize(WMTableView *table) static WMSize
getTotalSize(WMTableView *table)
{ {
WMSize size; WMSize size;
int i; int i;
@@ -214,7 +222,8 @@ static WMSize getTotalSize(WMTableView *table)
} }
static WMRect getVisibleRect(WMTableView *table) static WMRect
getVisibleRect(WMTableView *table)
{ {
WMSize size = getTotalSize(table); WMSize size = getTotalSize(table);
WMRect rect; WMRect rect;
@@ -239,7 +248,8 @@ static WMRect getVisibleRect(WMTableView *table)
} }
static void scrollToPoint(WMTableView *table, int x, int y) static void
scrollToPoint(WMTableView *table, int x, int y)
{ {
WMSize size = getTotalSize(table); WMSize size = getTotalSize(table);
int i; int i;
@@ -285,7 +295,8 @@ static void scrollToPoint(WMTableView *table, int x, int y)
} }
static void adjustScrollers(WMTableView *table) static void
adjustScrollers(WMTableView *table)
{ {
WMSize size = getTotalSize(table); WMSize size = getTotalSize(table);
WMSize vsize = WMGetViewSize(table->tableView); WMSize vsize = WMGetViewSize(table->tableView);
@@ -326,7 +337,8 @@ static void adjustScrollers(WMTableView *table)
} }
static void doScroll(WMWidget *self, void *data) static void
doScroll(WMWidget *self, void *data)
{ {
WMTableView *table = (WMTableView*)data; WMTableView *table = (WMTableView*)data;
float value; float value;
@@ -485,13 +497,15 @@ splitterHandler(XEvent *event, void *data)
} }
static void realizeTable(void *data, WMNotification *notif) static void
realizeTable(void *data, WMNotification *notif)
{ {
repaintTable(data); repaintTable(data);
} }
WMTableView *WMCreateTableView(WMWidget *parent) WMTableView*
WMCreateTableView(WMWidget *parent)
{ {
WMTableView *table = wmalloc(sizeof(WMTableView)); WMTableView *table = wmalloc(sizeof(WMTableView));
WMScreen *scr = WMWidgetScreen(parent); WMScreen *scr = WMWidgetScreen(parent);
@@ -605,7 +619,8 @@ WMTableView *WMCreateTableView(WMWidget *parent)
} }
void WMAddTableViewColumn(WMTableView *table, WMTableColumn *column) void
WMAddTableViewColumn(WMTableView *table, WMTableColumn *column)
{ {
WMScreen *scr = WMWidgetScreen(table); WMScreen *scr = WMWidgetScreen(table);
@@ -649,7 +664,8 @@ void WMAddTableViewColumn(WMTableView *table, WMTableColumn *column)
} }
void WMSetTableViewHeaderHeight(WMTableView *table, unsigned height) void
WMSetTableViewHeaderHeight(WMTableView *table, unsigned height)
{ {
table->headerHeight = height; table->headerHeight = height;
@@ -657,13 +673,15 @@ void WMSetTableViewHeaderHeight(WMTableView *table, unsigned height)
} }
void WMSetTableViewDelegate(WMTableView *table, WMTableViewDelegate *delegate) void
WMSetTableViewDelegate(WMTableView *table, WMTableViewDelegate *delegate)
{ {
table->delegate = delegate; table->delegate = delegate;
} }
void WMSetTableViewAction(WMTableView *table, WMAction *action, void *clientData) void
WMSetTableViewAction(WMTableView *table, WMAction *action, void *clientData)
{ {
table->action = action; table->action = action;
@@ -671,46 +689,51 @@ void WMSetTableViewAction(WMTableView *table, WMAction *action, void *clientData
} }
void *WMGetTableViewClickedColumn(WMTableView *table) void*
WMGetTableViewClickedColumn(WMTableView *table)
{ {
return table->clickedColumn; return table->clickedColumn;
} }
int WMGetTableViewClickedRow(WMTableView *table) int
WMGetTableViewClickedRow(WMTableView *table)
{ {
return table->clickedRow; return table->clickedRow;
} }
WMArray *WMGetTableViewSelectedRows(WMTableView *table) WMArray*
WMGetTableViewSelectedRows(WMTableView *table)
{ {
return table->selectedRows; return table->selectedRows;
} }
WMView *WMGetTableViewDocumentView(WMTableView *table) WMView*
WMGetTableViewDocumentView(WMTableView *table)
{ {
return table->tableView; return table->tableView;
} }
void *WMTableViewDataForCell(WMTableView *table, WMTableColumn *column, void*
int row) WMTableViewDataForCell(WMTableView *table, WMTableColumn *column, int row)
{ {
return (*table->delegate->valueForCell)(table->delegate, column, row); return (*table->delegate->valueForCell)(table->delegate, column, row);
} }
void WMSetTableViewDataForCell(WMTableView *table, WMTableColumn *column, void
int row, void *data) WMSetTableViewDataForCell(WMTableView *table, WMTableColumn *column, int row,
void *data)
{ {
(*table->delegate->setValueForCell)(table->delegate, column, row, data); (*table->delegate->setValueForCell)(table->delegate, column, row, data);
} }
WMRect WMTableViewRectForCell(WMTableView *table, WMTableColumn *column, WMRect
int row) WMTableViewRectForCell(WMTableView *table, WMTableColumn *column, int row)
{ {
WMRect rect; WMRect rect;
int i; int i;
@@ -742,20 +765,23 @@ WMRect WMTableViewRectForCell(WMTableView *table, WMTableColumn *column,
} }
void WMSetTableViewDataSource(WMTableView *table, void *source) void
WMSetTableViewDataSource(WMTableView *table, void *source)
{ {
table->dataSource = source; table->dataSource = source;
} }
void *WMGetTableViewDataSource(WMTableView *table) void*
WMGetTableViewDataSource(WMTableView *table)
{ {
return table->dataSource; return table->dataSource;
} }
void WMSetTableViewHasHorizontalScroller(WMTableView *tPtr, Bool flag) void
WMSetTableViewHasHorizontalScroller(WMTableView *tPtr, Bool flag)
{ {
if (flag) { if (flag) {
if (tPtr->hasHScroller) if (tPtr->hasHScroller)
@@ -790,7 +816,8 @@ void WMSetTableViewHasHorizontalScroller(WMTableView *tPtr, Bool flag)
#if 0 #if 0
/* not supported by now */ /* not supported by now */
void WMSetTableViewHasVerticalScroller(WMTableView *tPtr, Bool flag) void
WMSetTableViewHasVerticalScroller(WMTableView *tPtr, Bool flag)
{ {
if (flag) { if (flag) {
if (tPtr->hasVScroller) if (tPtr->hasVScroller)
@@ -824,7 +851,8 @@ void WMSetTableViewHasVerticalScroller(WMTableView *tPtr, Bool flag)
} }
#endif #endif
void WMSetTableViewBackgroundColor(WMTableView *table, WMColor *color) void
WMSetTableViewBackgroundColor(WMTableView *table, WMColor *color)
{ {
W_SetViewBackgroundColor(table->tableView, color); W_SetViewBackgroundColor(table->tableView, color);
@@ -837,7 +865,8 @@ void WMSetTableViewBackgroundColor(WMTableView *table, WMColor *color)
} }
void WMSetTableViewGridColor(WMTableView *table, WMColor *color) void
WMSetTableViewGridColor(WMTableView *table, WMColor *color)
{ {
WMReleaseColor(table->gridColor); WMReleaseColor(table->gridColor);
table->gridColor = WMRetainColor(color); table->gridColor = WMRetainColor(color);
@@ -848,7 +877,8 @@ void WMSetTableViewGridColor(WMTableView *table, WMColor *color)
void WMSetTableViewRowHeight(WMTableView *table, int height) void
WMSetTableViewRowHeight(WMTableView *table, int height)
{ {
table->rowHeight = height; table->rowHeight = height;
@@ -856,7 +886,8 @@ void WMSetTableViewRowHeight(WMTableView *table, int height)
} }
void WMScrollTableViewRowToVisible(WMTableView *table, int row) void
WMScrollTableViewRowToVisible(WMTableView *table, int row)
{ {
WMScroller *scroller; WMScroller *scroller;
WMRange range; WMRange range;
@@ -883,7 +914,8 @@ void WMScrollTableViewRowToVisible(WMTableView *table, int row)
static void drawGrid(WMTableView *table, WMRect rect) static void
drawGrid(WMTableView *table, WMRect rect)
{ {
WMScreen *scr = WMWidgetScreen(table); WMScreen *scr = WMWidgetScreen(table);
Display *dpy = WMScreenDisplay(scr); Display *dpy = WMScreenDisplay(scr);
@@ -934,7 +966,8 @@ static void drawGrid(WMTableView *table, WMRect rect)
} }
static WMRange columnsInRect(WMTableView *table, WMRect rect) static WMRange
columnsInRect(WMTableView *table, WMRect rect)
{ {
WMTableColumn *column; WMTableColumn *column;
int pos; int pos;
@@ -965,7 +998,8 @@ static WMRange columnsInRect(WMTableView *table, WMRect rect)
} }
static WMRange rowsInRect(WMTableView *table, WMRect rect) static WMRange
rowsInRect(WMTableView *table, WMRect rect)
{ {
WMRange range; WMRange range;
int rh = table->rowHeight; int rh = table->rowHeight;
@@ -980,7 +1014,8 @@ static WMRange rowsInRect(WMTableView *table, WMRect rect)
} }
static void drawRow(WMTableView *table, int row, WMRect clipRect) static void
drawRow(WMTableView *table, int row, WMRect clipRect)
{ {
int i; int i;
WMRange cols = columnsInRect(table, clipRect); WMRange cols = columnsInRect(table, clipRect);
@@ -1002,7 +1037,8 @@ static void drawRow(WMTableView *table, int row, WMRect clipRect)
#if 0 #if 0
static void drawFullRow(WMTableView *table, int row) static void
drawFullRow(WMTableView *table, int row)
{ {
int i; int i;
WMTableColumn *column; WMTableColumn *column;
@@ -1023,7 +1059,8 @@ static void drawFullRow(WMTableView *table, int row)
#endif #endif
static void setRowSelected(WMTableView *table, unsigned row, Bool flag) static void
setRowSelected(WMTableView *table, unsigned row, Bool flag)
{ {
int repaint = 0; int repaint = 0;
@@ -1045,7 +1082,8 @@ static void setRowSelected(WMTableView *table, unsigned row, Bool flag)
} }
static void repaintTable(WMTableView *table) static void
repaintTable(WMTableView *table)
{ {
WMRect rect; WMRect rect;
WMRange rows; WMRange rows;
@@ -1089,7 +1127,8 @@ static void repaintTable(WMTableView *table)
} }
static void stopRowEdit(WMTableView *table, int row) static void
stopRowEdit(WMTableView *table, int row)
{ {
int i; int i;
WMTableColumn *column; WMTableColumn *column;
@@ -1105,7 +1144,8 @@ static void stopRowEdit(WMTableView *table, int row)
void WMEditTableViewRow(WMTableView *table, int row) void
WMEditTableViewRow(WMTableView *table, int row)
{ {
int i; int i;
WMTableColumn *column; WMTableColumn *column;
@@ -1128,7 +1168,8 @@ void WMEditTableViewRow(WMTableView *table, int row)
} }
void WMSelectTableViewRow(WMTableView *table, int row) void
WMSelectTableViewRow(WMTableView *table, int row)
{ {
if (table->clickedRow >= 0) if (table->clickedRow >= 0)
setRowSelected(table, table->clickedRow, False); setRowSelected(table, table->clickedRow, False);
@@ -1147,7 +1188,8 @@ void WMSelectTableViewRow(WMTableView *table, int row)
} }
void WMReloadTableView(WMTableView *table) void
WMReloadTableView(WMTableView *table)
{ {
if (table->editingRow >= 0) if (table->editingRow >= 0)
stopRowEdit(table, table->editingRow); stopRowEdit(table, table->editingRow);
@@ -1180,13 +1222,15 @@ void WMReloadTableView(WMTableView *table)
} }
void WMNoteTableViewNumberOfRowsChanged(WMTableView *table) void
WMNoteTableViewNumberOfRowsChanged(WMTableView *table)
{ {
WMReloadTableView(table); WMReloadTableView(table);
} }
static void handleTableEvents(XEvent *event, void *data) static void
handleTableEvents(XEvent *event, void *data)
{ {
WMTableView *table = (WMTableView*)data; WMTableView *table = (WMTableView*)data;
int row; int row;
@@ -1234,7 +1278,8 @@ static void handleTableEvents(XEvent *event, void *data)
} }
static void handleEvents(XEvent *event, void *data) static void
handleEvents(XEvent *event, void *data)
{ {
WMTableView *table = (WMTableView*)data; WMTableView *table = (WMTableView*)data;
WMScreen *scr = WMWidgetScreen(table); WMScreen *scr = WMWidgetScreen(table);
@@ -1249,13 +1294,15 @@ static void handleEvents(XEvent *event, void *data)
} }
static void handleResize(W_ViewDelegate *self, WMView *view) static void
handleResize(W_ViewDelegate *self, WMView *view)
{ {
reorganizeInterior(view->self); reorganizeInterior(view->self);
} }
static void reorganizeInterior(WMTableView *table) static void
reorganizeInterior(WMTableView *table)
{ {
int width; int width;
int height; int height;
@@ -1309,7 +1356,8 @@ static void reorganizeInterior(WMTableView *table)
} }
static void rearrangeHeader(WMTableView *table) static void
rearrangeHeader(WMTableView *table)
{ {
int width; int width;
int count; int count;
@@ -1338,3 +1386,4 @@ static void rearrangeHeader(WMTableView *table)
handleResize(table->view->delegate, table->view); handleResize(table->view->delegate, table->view);
} }
+1
View File
@@ -49,3 +49,4 @@ int main(int argc, char **argv)
return 0; return 0;
} }
+1
View File
@@ -123,3 +123,4 @@ int main(int argc, char **argv)
} }
return 0; return 0;
} }
+5 -2
View File
@@ -23,7 +23,8 @@ wAbort()
char *ProgName; char *ProgName;
void usage(void) void
usage(void)
{ {
fprintf(stderr, fprintf(stderr,
"usage:\n" "usage:\n"
@@ -44,7 +45,8 @@ void usage(void)
exit(0); exit(0);
} }
int main(int argc, char **argv) int
main(int argc, char **argv)
{ {
Display *dpy = XOpenDisplay(""); Display *dpy = XOpenDisplay("");
WMScreen *scr; WMScreen *scr;
@@ -98,3 +100,4 @@ int main(int argc, char **argv)
printf("\n"); printf("\n");
return 0; return 0;
} }
+1
View File
@@ -1071,3 +1071,4 @@ main(int argc, char **argv)
return 0; return 0;
} }
+1
View File
@@ -464,6 +464,7 @@ typedef void WMAction2(void *self, void *clientData);
typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text, typedef void WMListDrawProc(WMList *lPtr, int index, Drawable d, char *text,
int state, WMRect *rect); int state, WMRect *rect);
/* /*
typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr, typedef void WMSplitViewResizeSubviewsProc(WMSplitView *sPtr,
unsigned int oldWidth, unsigned int oldWidth,
+1
View File
@@ -649,3 +649,4 @@ void W_FreeViewXdndPart(WMView *view);
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* _WINGSP_H_ */ #endif /* _WINGSP_H_ */
+4 -2
View File
@@ -65,11 +65,13 @@
#endif #endif
/* Stuff for setting the sockets into non-blocking mode. */ /* Stuff for setting the sockets into non-blocking mode. */
/*#ifdef __POSIX_SOURCE /*
#ifdef __POSIX_SOURCE
# define NONBLOCK_OPT O_NONBLOCK # define NONBLOCK_OPT O_NONBLOCK
#else #else
# define NONBLOCK_OPT FNDELAY # define NONBLOCK_OPT FNDELAY
#endif*/ #endif
*/
#define NONBLOCK_OPT O_NONBLOCK #define NONBLOCK_OPT O_NONBLOCK
+1
View File
@@ -272,3 +272,4 @@ W_FreeViewXdndPart(WMView *view)
if (view->dragImage) if (view->dragImage)
WMReleasePixmap(view->dragImage); WMReleasePixmap(view->dragImage);
} }
+2 -1
View File
@@ -60,7 +60,8 @@ static WMArray *inputHandler=NULL;
static void static void
rightNow(struct timeval *tv) { rightNow(struct timeval *tv)
{
X_GETTIMEOFDAY(tv); X_GETTIMEOFDAY(tv);
} }
+1
View File
@@ -935,3 +935,4 @@ int main (void)
return 0; return 0;
} }
#endif /* SNPRINTF_TEST */ #endif /* SNPRINTF_TEST */
+1
View File
@@ -531,3 +531,4 @@ destroyBalloon(Balloon *bPtr)
wfree(bPtr); wfree(bPtr);
} }
+1
View File
@@ -1261,3 +1261,4 @@ createTruncatedString(WMFont *font, char *text, int *textLen, int width)
} }
return textBuf; return textBuf;
} }
+1
View File
@@ -3784,3 +3784,4 @@ getShift(unsigned char value)
#undef SHAPE_WAS_DEFINED #undef SHAPE_WAS_DEFINED
#define SHAPE #define SHAPE
#endif #endif
+1 -1
View File
@@ -273,7 +273,7 @@ WMCreateFontWithFlags(WMScreen *scrPtr, char *fontName, WMFontFlags flags)
multiByte = False; multiByte = False;
} }
} else if (multiByte) { if (multiByte) {
font = WMCreateFontSet(scrPtr, fontName); font = WMCreateFontSet(scrPtr, fontName);
} else { } else {
font = WMCreateNormalFont(scrPtr, fontName); font = WMCreateNormalFont(scrPtr, fontName);
+1
View File
@@ -275,3 +275,4 @@ destroyFrame(Frame *fPtr)
wfree(fPtr); wfree(fPtr);
} }
+2
View File
@@ -255,3 +255,5 @@ destroyLabel(Label *lPtr)
wfree(lPtr); wfree(lPtr);
} }
+2 -2
View File
@@ -271,7 +271,7 @@ WMGetMenuItemMixedStatePixmap(WMMenuItem *item)
} }
/* #if 0
void void
WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu) WMSetMenuItemSubmenu(WMMenuItem *item, WMMenu *submenu)
{ {
@@ -292,5 +292,5 @@ WMGetMenuItemHasSubmenu(WMMenuItem *item)
{ {
return item->submenu != NULL; return item->submenu != NULL;
} }
#endif
*/
+1
View File
@@ -264,3 +264,4 @@ WMDrawPixmap(WMPixmap *pixmap, Drawable d, int x, int y)
XCopyArea(scr->display, pixmap->pixmap, d, scr->clipGC, 0, 0, XCopyArea(scr->display, pixmap->pixmap, d, scr->clipGC, 0, 0,
pixmap->width, pixmap->height, x, y); pixmap->width, pixmap->height, x, y);
} }
+2
View File
@@ -796,3 +796,5 @@ destroyPopUpButton(PopUpButton *bPtr)
wfree(bPtr); wfree(bPtr);
} }
+1
View File
@@ -598,3 +598,4 @@ WMGetGrabbedRulerMargin(WMRuler * rPtr)
return 0; return 0;
return rPtr->flags.whichMarker; return rPtr->flags.whichMarker;
} }
+1
View File
@@ -869,3 +869,4 @@ WMSetSplitViewResizeSubviewsProc(WMSplitView *sPtr,
sPtr->resizeSubviewsProc = proc; sPtr->resizeSubviewsProc = proc;
} }
#endif #endif
+1
View File
@@ -1042,3 +1042,4 @@ WMDestroyTabViewItem(WMTabViewItem *item)
wfree(item); wfree(item);
} }
+4 -2
View File
@@ -215,8 +215,10 @@ static unsigned char STIPPLE_BITS[] = {
static char *default_bullet[] = { static char *default_bullet[] = {
"6 6 4 1", "6 6 4 1",
" c None s None", ". c black", " c None s None",
"X c white", "o c #808080", ". c black",
"X c white",
"o c #808080",
" ... ", " ... ",
".XX.. ", ".XX.. ",
".XX..o", ".XX..o",
+2 -1
View File
@@ -168,7 +168,6 @@ createImages(WMScreen *scr, RContext *rc, RImage *xis, char *file,
} }
static void static void
createPanel(Panel *p) createPanel(Panel *p)
{ {
@@ -533,3 +532,5 @@ InitConfigurations(WMScreen *scr, WMWidget *parent)
return panel; return panel;
} }
+1
View File
@@ -134,3 +134,4 @@ InitExpert(WMScreen *scr, WMWidget *parent)
return panel; return panel;
} }
+1
View File
@@ -374,3 +374,4 @@ InitFocus(WMScreen *scr, WMWindow *win)
return panel; return panel;
} }
+1
View File
@@ -356,3 +356,4 @@ InitIcons(WMScreen *scr, WMWidget *parent)
return panel; return panel;
} }
+1
View File
@@ -182,3 +182,4 @@ InitKeyboardSettings(WMScreen *scr, WMWidget *parent)
return panel; return panel;
} }
+2 -4
View File
@@ -134,10 +134,7 @@ static char *keyOptions[] = {
/* from Xlib */ /* from Xlib */
static void static void
XConvertCase(sym, lower, upper) XConvertCase(register KeySym sym, KeySym *lower, KeySym *upper)
register KeySym sym;
KeySym *lower;
KeySym *upper;
{ {
*lower = sym; *lower = sym;
*upper = sym; *upper = sym;
@@ -654,3 +651,4 @@ InitKeyboardShortcuts(WMScreen *scr, WMWidget *parent)
return panel; return panel;
} }
+1
View File
@@ -240,3 +240,4 @@ InitMenuPreferences(WMScreen *scr, WMWidget *parent)
return panel; return panel;
} }
+1
View File
@@ -860,3 +860,4 @@ InitMouseSettings(WMScreen *scr, WMWidget *parent)
return panel; return panel;
} }
+1
View File
@@ -348,3 +348,4 @@ InitPaths(WMScreen *scr, WMWidget *parent)
return panel; return panel;
} }
+1
View File
@@ -359,3 +359,4 @@ InitPreferences(WMScreen *scr, WMWidget *parent)
return panel; return panel;
} }
+8 -3
View File
@@ -1619,17 +1619,21 @@ testOKButton(WMWidget *self, void *data)
} }
void testCancelButton(WMWidget *self, void *data){ void
testCancelButton(WMWidget *self, void *data)
{
wwarning("Exiting test...."); wwarning("Exiting test....");
exit(0); exit(0);
} }
void wAbort() void
wAbort()
{ {
exit(1); exit(1);
} }
int main(int argc, char **argv) int
main(int argc, char **argv)
{ {
TexturePanel *panel; TexturePanel *panel;
@@ -1661,3 +1665,4 @@ int main(int argc, char **argv)
return 0; return 0;
} }
#endif #endif
+1
View File
@@ -258,3 +258,4 @@ InitThemes(WMScreen *scr, WMWidget *parent)
return panel; return panel;
} }
+1
View File
@@ -460,3 +460,4 @@ InitWindowHandling(WMScreen *scr, WMWidget *parent)
return panel; return panel;
} }
+1
View File
@@ -375,3 +375,4 @@ InitWorkspace(WMScreen *scr, WMWidget *parent)
return panel; return panel;
} }
+1
View File
@@ -3,3 +3,4 @@ typedef struct W_DoubleTest DoubleTest;
DoubleTest *CreateDoubleTest(WMWidget *parent, char *text); DoubleTest *CreateDoubleTest(WMWidget *parent, char *text);
+1
View File
@@ -185,3 +185,4 @@ main(int argc, char **argv)
WMHandleEvent(&event); WMHandleEvent(&event);
} }
} }
+2
View File
@@ -267,3 +267,5 @@ ModifierFromKey(Display *dpy, char *key)
else else
return -1; return -1;
} }
+1
View File
@@ -110,3 +110,4 @@ typedef struct {
#define WMFHideApplication 12 #define WMFHideApplication 12
#endif #endif
+1
View File
@@ -514,3 +514,4 @@ extern const char *WMNWorkspaceNameChanged;
extern const char *WMNResetStacking; extern const char *WMNResetStacking;
#endif #endif
+1
View File
@@ -70,3 +70,4 @@ void wUnfullscreenWindow(WWindow *wwin);
#endif #endif
+1
View File
@@ -98,3 +98,4 @@ Bool wAppIconChangeImage(WAppIcon *icon, char *file);
void wAppIconMove(WAppIcon *aicon, int x, int y); void wAppIconMove(WAppIcon *aicon, int x, int y);
#endif #endif
+1
View File
@@ -71,3 +71,4 @@ void wApplicationExtractDirPackIcon(WScreen *scr,char *path, char *wm_instance,
#endif #endif
#endif #endif
+1
View File
@@ -136,3 +136,4 @@ wColormapAllowClientInstallation(WScreen *scr, Bool starting)
XSync(dpy, False); XSync(dpy, False);
} }
} }
+2 -2
View File
@@ -318,8 +318,8 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
/* /*
* place window in center of current head * place window in center of current head
*/ */
WMPoint center = wGetPointToCenterRectInHead(scr, WMPoint center =
wGetHeadForPointerLocation(scr), wGetPointToCenterRectInHead(scr, wGetHeadForPointerLocation(scr),
0, 0); 0, 0);
OpenSwitchMenu(scr, center.x, center.y, False); OpenSwitchMenu(scr, center.x, center.y, False);
} }
+4 -3
View File
@@ -67,10 +67,10 @@
extern WPreferences wPreferences; extern WPreferences wPreferences;
static WMPoint getCenter(WScreen *scr, int width, int height) static WMPoint
getCenter(WScreen *scr, int width, int height)
{ {
return wGetPointToCenterRectInHead(scr, return wGetPointToCenterRectInHead(scr, wGetHeadForPointerLocation(scr),
wGetHeadForPointerLocation(scr),
width, height); width, height);
} }
@@ -2012,3 +2012,4 @@ wShowGNUstepPanel(WScreen *scr)
gnustepPanel = panel; gnustepPanel = panel;
} }
+1
View File
@@ -516,3 +516,4 @@ DestroyDockAppSettingsPanel(AppSettingsPanel *panel)
wfree(panel); wfree(panel);
} }
+8 -3
View File
@@ -118,8 +118,10 @@ extern char WDelayedActionSet;
static void saveTimestamp(XEvent *event); static void saveTimestamp(XEvent *event);
static void handleColormapNotify(); static void handleColormapNotify();
static void handleMapNotify(), handleUnmapNotify(); static void handleMapNotify();
static void handleButtonPress(), handleExpose(); static void handleUnmapNotify();
static void handleButtonPress();
static void handleExpose();
static void handleDestroyNotify(); static void handleDestroyNotify();
static void handleConfigureRequest(); static void handleConfigureRequest();
static void handleMapRequest(); static void handleMapRequest();
@@ -1790,7 +1792,8 @@ handleMotionNotify(XEvent *event)
wMenuScroll(menu, event); wMenuScroll(menu, event);
} }
} }
#if 0
#if 0 // what is with this? -Dan
if (event->xmotion.subwindow == None) if (event->xmotion.subwindow == None)
return; return;
@@ -1851,3 +1854,5 @@ handleVisibilityNotify(XEvent *event)
wwin->flags.obscured = wwin->flags.obscured =
(event->xvisibility.state == VisibilityFullyObscured); (event->xvisibility.state == VisibilityFullyObscured);
} }
+1
View File
@@ -728,3 +728,4 @@ wsobserver(void *self, WMNotification *notif)
#endif /* GNOME_STUFF */ #endif /* GNOME_STUFF */
+1 -2
View File
@@ -564,8 +564,7 @@ wIconStore(WIcon *icon)
/* /*
void void wIconChangeIconWindow(WIcon *icon, Window new_window);
wIconChangeIconWindow(WIcon *icon, Window new_window);
*/ */
static void static void
+5 -4
View File
@@ -1846,9 +1846,8 @@ wKWMSelectRootRegion(WScreen *scr, int x, int y, int w, int h, Bool control)
} }
static void
observer(void *self, WMNotification *notif)
static void observer(void *self, WMNotification *notif)
{ {
WScreen *scr = (WScreen*)self; WScreen *scr = (WScreen*)self;
WWindow *wwin = (WWindow*)WMGetNotificationObject(notif); WWindow *wwin = (WWindow*)WMGetNotificationObject(notif);
@@ -1924,7 +1923,8 @@ static void observer(void *self, WMNotification *notif)
} }
static void wsobserver(void *self, WMNotification *notif) static void
wsobserver(void *self, WMNotification *notif)
{ {
WScreen *scr = (WScreen*)WMGetNotificationObject(notif); WScreen *scr = (WScreen*)WMGetNotificationObject(notif);
const char *name = WMGetNotificationName(notif); const char *name = WMGetNotificationName(notif);
@@ -1952,3 +1952,4 @@ static void wsobserver(void *self, WMNotification *notif)
#endif /* KWM_HINTS */ #endif /* KWM_HINTS */
+1
View File
@@ -812,3 +812,4 @@ main(int argc, char **argv)
EventLoop(); EventLoop();
return -1; return -1;
} }
+31 -32
View File
@@ -148,7 +148,8 @@ static char linebuf[LINESIZE];
/* ---------- proplist ---------- */ /* ---------- proplist ---------- */
static WRootMenuData *pl_openMenuFile(WMPropList *pl) static WRootMenuData*
pl_openMenuFile(WMPropList *pl)
{ {
PLRootMenuData *data = wmalloc(sizeof(PLRootMenuData)); PLRootMenuData *data = wmalloc(sizeof(PLRootMenuData));
@@ -165,21 +166,21 @@ static WRootMenuData *pl_openMenuFile(WMPropList *pl)
} }
static Bool pl_hasMoreData(WRootMenuData *data) static Bool
pl_hasMoreData(WRootMenuData *data)
{ {
} }
static Bool pl_nextCommand(WRootMenuData *data, static Bool
char **title, pl_nextCommand(WRootMenuData *data, char **title, char **command,
char **command, char **parameter, char **shortcut)
char **parameter,
char **shortcut)
{ {
} }
static void pl_closeMenuFile(WRootMenuData *data) static void
pl_closeMenuFile(WRootMenuData *data)
{ {
if (data->submenu) if (data->submenu)
wfree(data->submenu); wfree(data->submenu);
@@ -195,7 +196,8 @@ static void pl_closeMenuFile(WRootMenuData *data)
/* ---------- text ---------- */ /* ---------- text ---------- */
static WRootMenuData *text_openMenuFile(char *path) static WRootMenuData*
text_openMenuFile(char *path)
{ {
TextMenuReaderData *data; TextMenuReaderData *data;
@@ -210,21 +212,21 @@ static WRootMenuData *text_openMenuFile(char *path)
} }
static Bool text_hasMoreData(WRootMenuData *data) static Bool
text_hasMoreData(WRootMenuData *data)
{ {
} }
static Bool text_nextCommand(WRootMenuData *data, static Bool
char **title, text_nextCommand(WRootMenuData *data, char **title, char **command,
char **command, char **parameter, char **shortcut)
char **parameter,
char **shortcut)
{ {
} }
static void text_closeMenuFile(WRootMenuData *data) static void
text_closeMenuFile(WRootMenuData *data)
{ {
} }
@@ -232,7 +234,8 @@ static void text_closeMenuFile(WRootMenuData *data)
/* ---------- directory ---------- */ /* ---------- directory ---------- */
static WRootMenuData *dir_openMenuFile(char *paths, time_t *timestamp) static WRootMenuData*
dir_openMenuFile(char *paths, time_t *timestamp)
{ {
DirMenuReaderData *data; DirMenuReaderData *data;
char **dirs; char **dirs;
@@ -292,27 +295,25 @@ static WRootMenuData *dir_openMenuFile(char *paths, time_t *timestamp)
} }
static Bool dir_hasMoreData(WRootMenuData *data) static Bool
dir_hasMoreData(WRootMenuData *data)
{ {
} }
static Bool dir_nextCommand(WRootMenuData *data, static Bool
char **title, dir_nextCommand(WRootMenuData *data, char **title, char **command,
char **command, char **parameter, char **shortcut)
char **parameter,
char **shortcut)
{ {
} }
static void dir_closeMenuFile(WRootMenuData *data) static void
dir_closeMenuFile(WRootMenuData *data)
{ {
} }
WRootMenuData*
OpenMenu(char *path, time_t *menuTime)
WRootMenuData *OpenMenu(char *path, time_t *menuTime)
{ {
proplist pl; proplist pl;
struct stat stat_buf; struct stat stat_buf;
@@ -366,10 +367,8 @@ WRootMenuData *OpenMenu(char *path, time_t *menuTime)
} }
WRootMenuData*
WRootMenuData *ReopenRootMenu(time_t *checkTime, ReopenRootMenu(time_t *checkTime, char **menuPath, time_t *menuTimestamp)
char **menuPath,
time_t *menuTimestamp)
{ {
proplist pl; proplist pl;
struct stat stat_buf; struct stat stat_buf;
+1
View File
@@ -261,3 +261,4 @@ wMWMCheckClientHints(WWindow *wwin)
#endif /* MWM_HINTS */ #endif /* MWM_HINTS */
+1
View File
@@ -2432,3 +2432,4 @@ InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
} }
} }
} }
+1
View File
@@ -269,3 +269,4 @@ wPixmapDestroy(WPixmap *pix)
wfree(pix); wfree(pix);
} }
+1 -2
View File
@@ -56,8 +56,7 @@ extern WPreferences wPreferences;
* interactive window placement is in moveres.c * interactive window placement is in moveres.c
*/ */
extern void extern void InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
InteractivePlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
unsigned width, unsigned height); unsigned width, unsigned height);
+1
View File
@@ -62,3 +62,4 @@ wFreeColor(WScreen *scr, unsigned long pixel)
XFreeColors(dpy, scr->w_colormap, colors, 1, 0); XFreeColors(dpy, scr->w_colormap, colors, 1, 0);
} }
} }
+1
View File
@@ -1888,3 +1888,4 @@ OpenRootMenu(WScreen *scr, int x, int y, int keyboard)
} }
#endif /* !LITE */ #endif /* !LITE */
+1
View File
@@ -1376,3 +1376,4 @@ wSessionIsManaged(void)
} }
#endif /* !XSMP_ENABLED */ #endif /* !XSMP_ENABLED */
+3 -1
View File
@@ -44,7 +44,8 @@ extern XContext wStackContext;
extern WPreferences wPreferences; extern WPreferences wPreferences;
static void notifyStackChange(WCoreWindow *frame, char *detail) static void
notifyStackChange(WCoreWindow *frame, char *detail)
{ {
WWindow *wwin = wWindowFor(frame->window); WWindow *wwin = wWindowFor(frame->window);
@@ -613,3 +614,4 @@ ChangeStackingLevel(WCoreWindow *frame, int new_level)
wLowerFrame(frame); wLowerFrame(frame);
} }
} }
-1
View File
@@ -1175,4 +1175,3 @@ manageAllWindows(WScreen *scr, int crashRecovery)
} }
+1
View File
@@ -454,3 +454,4 @@ wsobserver(void *self, WMNotification *notif)
#endif /* !LITE */ #endif /* !LITE */
+26 -26
View File
@@ -1,4 +1,4 @@
/********************************************************************\ /********************************************************************
* text.c -- a basic text field * * text.c -- a basic text field *
* Copyright (C) 1997 Robin D. Clark * * Copyright (C) 1997 Robin D. Clark *
* * * *
@@ -20,7 +20,7 @@
* Internet: rclark@cs.hmc.edu * * Internet: rclark@cs.hmc.edu *
* Address: 609 8th Street * * Address: 609 8th Street *
* Huntington Beach, CA 92648-4632 * * Huntington Beach, CA 92648-4632 *
\********************************************************************/ ********************************************************************/
#include "wconfig.h" #include "wconfig.h"
@@ -55,9 +55,9 @@
extern Cursor wCursor[WCUR_LAST]; extern Cursor wCursor[WCUR_LAST];
/********************************************************************\ /********************************************************************
* The event handler for the text-field: * * The event handler for the text-field: *
\********************************************************************/ ********************************************************************/
static void textEventHandler( WObjDescriptor *desc, XEvent *event ); static void textEventHandler( WObjDescriptor *desc, XEvent *event );
static void handleExpose( WObjDescriptor *desc, XEvent *event ); static void handleExpose( WObjDescriptor *desc, XEvent *event );
@@ -67,7 +67,7 @@ static void textInsert( WTextInput *wtext, char *txt );
static void blink(void *data); static void blink(void *data);
#endif #endif
/********************************************************************\ /********************************************************************
* handleKeyPress * * handleKeyPress *
* handle cursor keys, regular keys, etc. Inserts characters in * * handle cursor keys, regular keys, etc. Inserts characters in *
* text field, at cursor position, if it is a "Normal" key. If * * text field, at cursor position, if it is a "Normal" key. If *
@@ -80,7 +80,7 @@ static void blink(void *data);
* Return: True, unless the ksym is ignored * * Return: True, unless the ksym is ignored *
* Global: modifier - the bitfield that keeps track of the modifier * * Global: modifier - the bitfield that keeps track of the modifier *
* keys that are down * * keys that are down *
\********************************************************************/ ********************************************************************/
static int static int
handleKeyPress( WTextInput *wtext, XKeyEvent *event ) handleKeyPress( WTextInput *wtext, XKeyEvent *event )
{ {
@@ -169,10 +169,10 @@ handleKeyPress( WTextInput *wtext, XKeyEvent *event )
/********************************************************************\ /********************************************************************
* textXYtoPos * * textXYtoPos *
* given X coord, return position in array * * given X coord, return position in array *
\********************************************************************/ ********************************************************************/
static int static int
textXtoPos( WTextInput *wtext, int x ) textXtoPos( WTextInput *wtext, int x )
{ {
@@ -190,14 +190,14 @@ textXtoPos( WTextInput *wtext, int x )
return pos; return pos;
} }
/********************************************************************\ /********************************************************************
* wTextCreate * * wTextCreate *
* create an instance of a text class * * create an instance of a text class *
* * * *
* Args: * * Args: *
* Return: * * Return: *
* Global: dpy - the display * * Global: dpy - the display *
\********************************************************************/ ********************************************************************/
WTextInput * WTextInput *
wTextCreate( WCoreWindow *core, int x, int y, int width, int height ) wTextCreate( WCoreWindow *core, int x, int y, int width, int height )
{ {
@@ -274,13 +274,13 @@ wTextCreate( WCoreWindow *core, int x, int y, int width, int height )
return wtext; return wtext;
} }
/********************************************************************\ /********************************************************************
* wTextDestroy * * wTextDestroy *
* * * *
* Args: wtext - the text field * * Args: wtext - the text field *
* Return: * * Return: *
* Global: dpy - the display * * Global: dpy - the display *
\********************************************************************/ ********************************************************************/
void void
wTextDestroy( WTextInput *wtext ) wTextDestroy( WTextInput *wtext )
{ {
@@ -311,7 +311,7 @@ wTextDestroy( WTextInput *wtext )
* then call wTextRefresh to redraw the text-box */ * then call wTextRefresh to redraw the text-box */
/********************************************************************\ /********************************************************************
* textRefresh * * textRefresh *
* Redraw the text field. Call this after messing with the text * * Redraw the text field. Call this after messing with the text *
* field. wTextRefresh re-draws the inside of the text field. If * * field. wTextRefresh re-draws the inside of the text field. If *
@@ -321,7 +321,7 @@ wTextDestroy( WTextInput *wtext )
* Args: wtext - the text field * * Args: wtext - the text field *
* Return: none * * Return: none *
* Global: dpy - the display * * Global: dpy - the display *
\********************************************************************/ ********************************************************************/
static void static void
textRefresh(WTextInput *wtext) textRefresh(WTextInput *wtext)
{ {
@@ -383,13 +383,13 @@ textRefresh(WTextInput *wtext)
} }
/********************************************************************\ /********************************************************************
* wTextPaint * * wTextPaint *
* * * *
* Args: wtext - the text field * * Args: wtext - the text field *
* Return: * * Return: *
* Global: dpy - the display * * Global: dpy - the display *
\********************************************************************/ ********************************************************************/
void void
wTextPaint( WTextInput *wtext ) wTextPaint( WTextInput *wtext )
{ {
@@ -406,7 +406,7 @@ wTextPaint( WTextInput *wtext )
} }
/********************************************************************\ /********************************************************************
* wTextGetText * * wTextGetText *
* return the string in the text field wText. DO NOT FREE THE * * return the string in the text field wText. DO NOT FREE THE *
* RETURNED STRING! * * RETURNED STRING! *
@@ -414,7 +414,7 @@ wTextPaint( WTextInput *wtext )
* Args: wtext - the text field * * Args: wtext - the text field *
* Return: the text in the text field (NULL terminated) * * Return: the text in the text field (NULL terminated) *
* Global: * * Global: *
\********************************************************************/ ********************************************************************/
char * char *
wTextGetText( WTextInput *wtext ) wTextGetText( WTextInput *wtext )
{ {
@@ -424,7 +424,7 @@ wTextGetText( WTextInput *wtext )
return NULL; return NULL;
} }
/********************************************************************\ /********************************************************************
* wTextPutText * * wTextPutText *
* Put the string txt in the text field wText. The text field * * Put the string txt in the text field wText. The text field *
* needs to be explicitly refreshed after wTextPutText by calling * * needs to be explicitly refreshed after wTextPutText by calling *
@@ -435,7 +435,7 @@ wTextGetText( WTextInput *wtext )
* txt - the new text string... freed by the text field! * * txt - the new text string... freed by the text field! *
* Return: none * * Return: none *
* Global: * * Global: *
\********************************************************************/ ********************************************************************/
void void
wTextPutText( WTextInput *wtext, char *txt ) wTextPutText( WTextInput *wtext, char *txt )
{ {
@@ -453,7 +453,7 @@ wTextPutText( WTextInput *wtext, char *txt )
wtext->text.endPos = length; wtext->text.endPos = length;
} }
/********************************************************************\ /********************************************************************
* textInsert * * textInsert *
* Insert some text at the cursor. (if startPos != endPos, * * Insert some text at the cursor. (if startPos != endPos, *
* replace the selected text, otherwise insert) * * replace the selected text, otherwise insert) *
@@ -463,7 +463,7 @@ wTextPutText( WTextInput *wtext, char *txt )
* txt - the new text string... freed by the text field! * * txt - the new text string... freed by the text field! *
* Return: none * * Return: none *
* Global: * * Global: *
\********************************************************************/ ********************************************************************/
static void static void
textInsert( WTextInput *wtext, char *txt ) textInsert( WTextInput *wtext, char *txt )
{ {
@@ -512,7 +512,7 @@ textInsert( WTextInput *wtext, char *txt )
wtext->text.length = newLen-1; wtext->text.length = newLen-1;
} }
/********************************************************************\ /********************************************************************
* wTextSelect * * wTextSelect *
* Select some text. If start == end, then the cursor is moved * * Select some text. If start == end, then the cursor is moved *
* to that position. If end == -1, then the text from start to * * to that position. If end == -1, then the text from start to *
@@ -525,7 +525,7 @@ textInsert( WTextInput *wtext, char *txt )
* end - the end of the selected text * * end - the end of the selected text *
* Return: none * * Return: none *
* Global: * * Global: *
\********************************************************************/ ********************************************************************/
void void
wTextSelect( WTextInput *wtext, int start, int end ) wTextSelect( WTextInput *wtext, int start, int end )
{ {
@@ -561,14 +561,14 @@ blink(void *data)
} }
#endif #endif
/********************************************************************\ /********************************************************************
* textEventHandler -- handles and dispatches all the events that * * textEventHandler -- handles and dispatches all the events that *
* the text field class supports * * the text field class supports *
* * * *
* Args: desc - all we need to know about this object * * Args: desc - all we need to know about this object *
* Return: none * * Return: none *
* Global: * * Global: *
\********************************************************************/ ********************************************************************/
static void static void
textEventHandler( WObjDescriptor *desc, XEvent *event ) textEventHandler( WObjDescriptor *desc, XEvent *event )
{ {
+2 -2
View File
@@ -1,4 +1,4 @@
/********************************************************************\ /********************************************************************
* text.h -- a basic text field * * text.h -- a basic text field *
* Copyright (C) 1997 Robin D. Clark * * Copyright (C) 1997 Robin D. Clark *
* * * *
@@ -20,7 +20,7 @@
* Internet: rclark@cs.hmc.edu * * Internet: rclark@cs.hmc.edu *
* Address: 609 8th Street * * Address: 609 8th Street *
* Huntington Beach, CA 92648-4632 * * Huntington Beach, CA 92648-4632 *
\********************************************************************/ ********************************************************************/
#ifndef __TEXT_H__ #ifndef __TEXT_H__
#define __TEXT_H__ #define __TEXT_H__
+1
View File
@@ -374,3 +374,4 @@ wUserMenuGet(WScreen *scr, WWindow *wwin)
} }
#endif /* USER_MENU */ #endif /* USER_MENU */
+2 -4
View File
@@ -596,10 +596,7 @@ getBool(WMPropList *key, WMPropList *value)
} }
/* WARNING: Do not free the value returned by this function!! */
/*
* WARNING: Do not free value returned by this!!
*/
static char* static char*
getString(WMPropList *key, WMPropList *value) getString(WMPropList *key, WMPropList *value)
{ {
@@ -611,3 +608,4 @@ getString(WMPropList *key, WMPropList *value)
return WMGetFromPLString(value); return WMGetFromPLString(value);
} }
+1
View File
@@ -3448,3 +3448,4 @@ windowIconifyClick(WCoreWindow *sender, void *data, XEvent *event)
} }
} }
} }
+9 -3
View File
@@ -39,7 +39,8 @@ Atom _XA_MOTIF_DRAG_AND_DROP_MESSAGE;
Atom atom_support; Atom atom_support;
void wXDNDInitializeAtoms() void
wXDNDInitializeAtoms()
{ {
_XA_XdndAware = XInternAtom(dpy, "XdndAware", False); _XA_XdndAware = XInternAtom(dpy, "XdndAware", False);
@@ -60,7 +61,9 @@ void wXDNDInitializeAtoms()
*/ */
} }
void wXDNDMakeAwareness(Window window) { void
wXDNDMakeAwareness(Window window)
{
long int xdnd_version = 3; long int xdnd_version = 3;
/* /*
MotifDragReceiverInfo info; MotifDragReceiverInfo info;
@@ -85,7 +88,9 @@ void wXDNDMakeAwareness(Window window) {
*/ */
} }
void wXDNDClearAwareness(Window window) { void
wXDNDClearAwareness(Window window)
{
//long int xdnd_version = 3; //long int xdnd_version = 3;
XDeleteProperty (dpy, window, _XA_XdndAware); XDeleteProperty (dpy, window, _XA_XdndAware);
} }
@@ -333,3 +338,4 @@ wXDNDProcessClientMessage(XClientMessageEvent *event)
} }
#endif #endif
+1
View File
@@ -296,3 +296,4 @@ wXModifierInitialize(void)
{ {
x_reset_modifier_mapping(dpy); x_reset_modifier_mapping(dpy);
} }
+1
View File
@@ -194,3 +194,4 @@ FormatXError(Display *dpy, XErrorEvent *error, char *buffer, int size)
sprintf(buffer, " Error serial: %li\n", error->serial); sprintf(buffer, " Error serial: %li\n", error->serial);
return; return;
} }
+2 -1
View File
@@ -33,7 +33,8 @@ hide(void *foo, int item, Time time)
} }
int notify_print( int id, XEvent *event, void *data ) int
notify_print( int id, XEvent *event, void *data )
{ {
printf( "Got notification 0x%x, window 0x%lx, data '%s'\n", printf( "Got notification 0x%x, window 0x%lx, data '%s'\n",
id, event->xclient.data.l[1], (char *) data ); id, event->xclient.data.l[1], (char *) data );
+1
View File
@@ -806,3 +806,4 @@ readBlackBoxStyle(char *path)
} }
} }
#endif #endif
+2 -1
View File
@@ -66,7 +66,8 @@ gethomedir()
void wAbort() void
wAbort()
{ {
exit(0); exit(0);
} }
+21 -12
View File
@@ -88,7 +88,8 @@ wlog(const char *msg, ...)
#endif #endif
void alert(const char *msg, ...) void
alert(const char *msg, ...)
{ {
va_list args; va_list args;
char buffer[2048]; char buffer[2048];
@@ -104,9 +105,8 @@ void alert(const char *msg, ...)
} }
Bool
ask(char *title, char *yes, char *no, const char *msg, ...)
Bool ask(char *title, char *yes, char *no, const char *msg, ...)
{ {
va_list args; va_list args;
char buffer[2048]; char buffer[2048];
@@ -122,7 +122,8 @@ Bool ask(char *title, char *yes, char *no, const char *msg, ...)
} }
char *renameName(char *path) char*
renameName(char *path)
{ {
char *buf = wmalloc(strlen(path)+8); char *buf = wmalloc(strlen(path)+8);
int i; int i;
@@ -148,7 +149,8 @@ char *renameName(char *path)
void showFileError(int error, Bool directory, char *path) void
showFileError(int error, Bool directory, char *path)
{ {
switch (error) { switch (error) {
case EACCESS: case EACCESS:
@@ -181,7 +183,8 @@ void showFileError(int error, Bool directory, char *path)
Bool checkDir(char *path, Bool fatal) Bool
checkDir(char *path, Bool fatal)
{ {
if (access(path, F_OK) < 0) { if (access(path, F_OK) < 0) {
if (mkdir(path, 0775) < 0) { if (mkdir(path, 0775) < 0) {
@@ -242,7 +245,8 @@ Bool checkDir(char *path, Bool fatal)
Bool checkFile(char *path) Bool
checkFile(char *path)
{ {
if (access(path, F_OK|R_OK|W_OK) == 0) { if (access(path, F_OK|R_OK|W_OK) == 0) {
return True; return True;
@@ -255,7 +259,8 @@ Bool checkFile(char *path)
Bool checkCurrentSetup(char *home) Bool
checkCurrentSetup(char *home)
{ {
char path[1024]; char path[1024];
char *p; char *p;
@@ -285,7 +290,8 @@ Bool checkCurrentSetup(char *home)
Bool copyAllFiles(char *gsdir) Bool
copyAllFiles(char *gsdir)
{ {
FILE *f; FILE *f;
char path[2048]; char path[2048];
@@ -338,7 +344,8 @@ Bool copyAllFiles(char *gsdir)
void showFinishSplash(char *gsdir) void
showFinishSplash(char *gsdir)
{ {
#if 0 #if 0
WMWindow *win; WMWindow *win;
@@ -348,7 +355,8 @@ void showFinishSplash(char *gsdir)
} }
int main(int argc, char **argv) int
main(int argc, char **argv)
{ {
Display *dpy; Display *dpy;
char *gsdir; char *gsdir;
@@ -413,3 +421,4 @@ int main(int argc, char **argv)
return 0; return 0;
} }
#endif #endif
+1
View File
@@ -37,3 +37,4 @@ typedef struct _wmAppContext {
} wmAppContext; } wmAppContext;
#endif #endif
+1
View File
@@ -82,3 +82,4 @@ WMSetWindowAttributes(Display *dpy, Window window,
(unsigned char *)attributes, (unsigned char *)attributes,
sizeof(GNUstepWMAttributes)/sizeof(CARD32)); sizeof(GNUstepWMAttributes)/sizeof(CARD32));
} }
+1
View File
@@ -93,3 +93,4 @@ WMProcessEvent(WMAppContext *app, XEvent *event)
} }
return proc; return proc;
} }
+1
View File
@@ -72,3 +72,4 @@ enum {
#endif #endif
+8 -16
View File
@@ -67,8 +67,7 @@ Status XmuGetColormapAllocation(vinfo, property, red_max, green_max, blue_max)
if (vinfo->colormap_size <= 2) if (vinfo->colormap_size <= 2)
return 0; return 0;
switch (property) switch (property) {
{
case XA_RGB_DEFAULT_MAP: case XA_RGB_DEFAULT_MAP:
status = default_allocation(vinfo, red_max, green_max, blue_max); status = default_allocation(vinfo, red_max, green_max, blue_max);
break; break;
@@ -205,8 +204,7 @@ static void best_allocation(vinfo, red, green, blue)
unsigned long *red, *green, *blue; unsigned long *red, *green, *blue;
{ {
if (vinfo->class == DirectColor || vinfo->class == TrueColor) if (vinfo->class == DirectColor || vinfo->class == TrueColor) {
{
*red = vinfo->red_mask; *red = vinfo->red_mask;
while ((*red & 01) == 0) while ((*red & 01) == 0)
*red >>= 1; *red >>= 1;
@@ -216,9 +214,7 @@ static void best_allocation(vinfo, red, green, blue)
*blue = vinfo->blue_mask; *blue = vinfo->blue_mask;
while ((*blue & 01) == 0) while ((*blue & 01) == 0)
*blue >>= 1; *blue >>= 1;
} } else {
else
{
register int bits, n; register int bits, n;
/* Determine n such that n is the least integral power of 2 which is /* Determine n such that n is the least integral power of 2 which is
@@ -226,8 +222,7 @@ static void best_allocation(vinfo, red, green, blue)
*/ */
n = 1; n = 1;
bits = 0; bits = 0;
while (vinfo->colormap_size > n) while (vinfo->colormap_size > n) {
{
n = n << 1; n = n << 1;
bits++; bits++;
} }
@@ -239,8 +234,7 @@ static void best_allocation(vinfo, red, green, blue)
* colormap entries. * colormap entries.
*/ */
if (n == vinfo->colormap_size) if (n == vinfo->colormap_size) {
{
register int r, g, b; register int r, g, b;
b = bits / 3; b = bits / 3;
g = b + ((bits % 3) ? 1 : 0); g = b + ((bits % 3) ? 1 : 0);
@@ -248,9 +242,7 @@ static void best_allocation(vinfo, red, green, blue)
*red = 1 << r; *red = 1 << r;
*green = 1 << g; *green = 1 << g;
*blue = 1 << b; *blue = 1 << b;
} } else {
else
{
*red = icbrt_with_bits(vinfo->colormap_size, bits); *red = icbrt_with_bits(vinfo->colormap_size, bits);
*blue = *red; *blue = *red;
*green = (vinfo->colormap_size / ((*red) * (*blue))); *green = (vinfo->colormap_size / ((*red) * (*blue)));
@@ -274,8 +266,7 @@ static int icbrt(a) /* integer cube root */
register int bits = 0; register int bits = 0;
register unsigned n = a; register unsigned n = a;
while (n) while (n) {
{
bits++; bits++;
n >>= 1; n >>= 1;
} }
@@ -333,3 +324,4 @@ static int icbrt_with_guess(a, guess)
return guess; return guess;
} }
+1
View File
@@ -522,3 +522,4 @@ static Status readonly_map(dpy, vinfo, colormap)
} }
return 1; return 1;
} }
+1 -2
View File
@@ -49,8 +49,7 @@ void XmuDeleteStandardColormap(dpy, screen, property)
int count = 0; int count = 0;
if (XGetRGBColormaps(dpy, RootWindow(dpy, screen), &stdcmaps, &count, if (XGetRGBColormaps(dpy, RootWindow(dpy, screen), &stdcmaps, &count,
property)) property)) {
{
for (s=stdcmaps; count > 0; count--, s++) { for (s=stdcmaps; count > 0; count--, s++) {
if ((s->killid == ReleaseByFreeingColormap) && if ((s->killid == ReleaseByFreeingColormap) &&
(s->colormap != None) && (s->colormap != None) &&
+1
View File
@@ -310,3 +310,4 @@ static Status lookup(dpy, screen, visualid, property, new, replace)
XFree((char *) stdcmaps); XFree((char *) stdcmaps);
return 1; return 1;
} }
+1
View File
@@ -217,3 +217,4 @@ static Status valid_args(vinfo, red_max, green_max, blue_max, property)
} }
return 1; return 1;
} }
+4 -4
View File
@@ -47,16 +47,16 @@ cache_bench(int start)
static int start_cycle; static int start_cycle;
if (start) { if (start) {
asm volatile( asm volatile
"movl $1,%%ecx \n\t" ("movl $1,%%ecx \n\t"
"rdpmc \n\t" "rdpmc \n\t"
"movl %%eax,%0 \n\t" "movl %%eax,%0 \n\t"
: "=m" (start_cycle)); : "=m" (start_cycle));
} else { } else {
int end; int end;
asm volatile( asm volatile
"movl $1,%%ecx \n\t" ("movl $1,%%ecx \n\t"
"rdpmc \n\t" "rdpmc \n\t"
"movl %%eax,%0" "movl %%eax,%0"
: "=m" (end)); : "=m" (end));
+1
View File
@@ -132,3 +132,4 @@ RRGBtoHSV(RColor *rgb, RHSVColor *hsv)
hsv->saturation = s; hsv->saturation = s;
hsv->value = v; hsv->value = v;
} }
+1
View File
@@ -803,3 +803,4 @@ bestContext(Display *dpy, int screen_number, RContext *context)
else else
return True; return True;
} }
+1
View File
@@ -308,3 +308,4 @@ RSmoothImage(RImage *image)
return True; return True;
} }
#endif #endif
+1
View File
@@ -229,3 +229,4 @@ did_not_get_any_errors:
} }
#endif /* USE_GIF */ #endif /* USE_GIF */
+1
View File
@@ -213,3 +213,4 @@ RLoadJPEG(RContext *context, char *file_name, int index)
} }
#endif /* USE_JPEG */ #endif /* USE_JPEG */
+1
View File
@@ -216,3 +216,4 @@ RMessageForError(int errorCode)
return "internal error"; return "internal error";
} }
} }
+1
View File
@@ -238,3 +238,4 @@ RLoadPNG(RContext *context, char *file, int index)
} }
#endif /* USE_PNG */ #endif /* USE_PNG */
+1
View File
@@ -557,3 +557,4 @@ RMakeCenteredImage(RImage *image, unsigned width, unsigned height, RColor *color
return tmp; return tmp;
} }
+1
View File
@@ -386,3 +386,4 @@ rotateImage(RImage *image, float angle)
return img; return img;
} }

Some files were not shown because too many files have changed in this diff Show More