deactivated new languages for the moment...
[xboard.git] / filebrowser / draw.c
index 47efa17..048fa85 100644 (file)
@@ -25,8 +25,8 @@
  */
 
 #include <stdio.h>
-#include "selfile.h"
 #include "xstat.h"
+#include "selfile.h"
 #include <X11/StringDefs.h>
 #include <X11/Xaw/Scrollbar.h>
 #include <X11/Xaw/Cardinals.h>
@@ -59,6 +59,7 @@ static int SFcurrentListY;
 
 static XtIntervalId SFscrollTimerId;
 
+void
 SFinitFont()
 {
        TextData        *data;
@@ -84,8 +85,10 @@ SFinitFont()
        SFcharWidth = (SFfont->max_bounds.width + SFfont->min_bounds.width) / 2;
        SFcharAscent = SFfont->max_bounds.ascent;
        SFcharHeight = SFcharAscent + SFfont->max_bounds.descent;
+       return;
 }
 
+void
 SFcreateGC()
 {
        XGCValues       gcValues;
@@ -149,8 +152,10 @@ SFcreateGC()
                1,
                Unsorted
        );
+       return;
 }
 
+void
 SFclearList(n, doScroll)
        int     n;
        int     doScroll;
@@ -191,9 +196,10 @@ SFclearList(n, doScroll)
                                (float) 1.0);
                }
        }
+       return;
 }
 
-static
+static void
 SFdeleteEntry(dir, entry)
        SFDir   *dir;
        SFEntry *entry;
@@ -242,15 +248,17 @@ SFdeleteEntry(dir, entry)
                (float) (((double) ((dir->nEntries < SFlistSize) ?
                        dir->nEntries : SFlistSize)) / dir->nEntries)
        );
+       return;
 }
 
-static
+static void
 SFwriteStatChar(name, last, statBuf)
        char            *name;
        int             last;
        struct stat     *statBuf;
 {
        name[last] = SFstatChar(statBuf);
+       return;
 }
 
 static int
@@ -320,7 +328,7 @@ SFstatAndCheck(dir, entry)
        return 0;
 }
 
-static
+static void
 SFdrawStrings(w, dir, from, to)
        register Window w;
        register SFDir  *dir;
@@ -395,8 +403,10 @@ SFdrawStrings(w, dir, from, to)
                        );
                }
        }
+       return;
 }
 
+void
 SFdrawList(n, doScroll)
        int     n;
        int     doScroll;
@@ -420,8 +430,10 @@ SFdrawList(n, doScroll)
                );
                SFdrawStrings(w, dir, 0, SFlistSize - 1);
        }
+       return;
 }
 
+void
 SFdrawLists(doScroll)
        int     doScroll;
 {
@@ -430,9 +442,10 @@ SFdrawLists(doScroll)
        for (i = 0; i < NR; i++) {
                SFdrawList(i, doScroll);
        }
+       return;
 }
 
-static
+static void
 SFinvertEntry(n)
        register int    n;
 {
@@ -445,6 +458,7 @@ SFinvertEntry(n)
                SFentryWidth,
                SFentryHeight
        );
+       return;
 }
 
 static unsigned long
@@ -486,7 +500,7 @@ SFscrollTimer(p, id)
        int     save;
        int     n;
 
-        n = (int) p;
+        n = (int)(intptr_t) p;
 
        dir = &(SFdirs[SFdirPtr + n]);
        save = dir->vOrigin;
@@ -516,7 +530,7 @@ SFscrollTimer(p, id)
 
        if (SFbuttonPressed) {
                SFscrollTimerId = XtAppAddTimeOut(SFapp,
-                       SFscrollTimerInterval(), SFscrollTimer, (XtPointer) n);
+                       SFscrollTimerInterval(), SFscrollTimer, (XtPointer)(intptr_t) n);
        }
 }
 
@@ -557,7 +571,7 @@ SFnewInvertEntry(n, event)
                                SFscrollTimerAdded = 1;
                                SFscrollTimerId = XtAppAddTimeOut(SFapp,
                                        SFscrollTimerInterval(), SFscrollTimer,
-                                       (XtPointer) n);
+                                       (XtPointer)(intptr_t) n);
                        }
                }
 
@@ -620,20 +634,7 @@ SFmotionList(w, n, event)
                        SFinvertEntry(n);
                }
        }
-}
-
-/* ARGSUSED */
-void
-SFvFloatSliderMovedCallback(w, n, fnew)
-       Widget  w;
-       int     n;
-       float   *fnew;
-{
-       int     new;
-
-       new = (*fnew) * SFdirs[SFdirPtr + n].nEntries;
-
-       SFvSliderMovedCallback(w, n, new);
+       return;
 }
 
 /* ARGSUSED */
@@ -649,7 +650,10 @@ SFvSliderMovedCallback(w, n, new)
 
        dir = &(SFdirs[SFdirPtr + n]);
 
+
        old = dir->vOrigin;
+       if(new == -1) new = old + 1; else if(new == -2) new = old - 1; // [HGM] indicates scroll direction on mousewheel event
+       if(new < 0 || new > dir->nEntries - SFlistSize) return;
        dir->vOrigin = new;
 
        if (old == new) {
@@ -724,6 +728,21 @@ SFvSliderMovedCallback(w, n, new)
 
 /* ARGSUSED */
 void
+SFvFloatSliderMovedCallback(w, n, fnew)
+       Widget  w;
+       int     n;
+       float   *fnew;
+{
+       int     new;
+
+       new = (*fnew) * SFdirs[SFdirPtr + n].nEntries;
+
+       SFvSliderMovedCallback(w, n, new);
+}
+
+
+/* ARGSUSED */
+void
 SFvAreaSelectedCallback(w, n, pnew)
        Widget  w;
        int     n;