comparison src/gui_at_sb.c @ 7821:81794242a275 v7.4.1207

commit https://github.com/vim/vim/commit/66f948e928d5e0cd3123af902aa8ac1613534c94 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 30 16:39:25 2016 +0100 patch 7.4.1207 Problem: Using old style function declarations. Solution: Change to new style function declarations. (script by Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Sat, 30 Jan 2016 16:45:04 +0100
parents 4635a259ecc0
children 7898da204b98
comparison
equal deleted inserted replaced
7820:38d22ab3d9a0 7821:81794242a275
220 #define PAGE_DELAY 300 220 #define PAGE_DELAY 300
221 #define LINE_REPEAT 50 221 #define LINE_REPEAT 50
222 #define PAGE_REPEAT 250 222 #define PAGE_REPEAT 250
223 223
224 static void 224 static void
225 ClassInitialize() 225 ClassInitialize(void)
226 { 226 {
227 XawInitializeWidgetSet(); 227 XawInitializeWidgetSet();
228 XtAddConverter( XtRString, XtROrientation, XmuCvtStringToOrientation, 228 XtAddConverter( XtRString, XtROrientation, XmuCvtStringToOrientation,
229 (XtConvertArgList)NULL, (Cardinal)0 ); 229 (XtConvertArgList)NULL, (Cardinal)0 );
230 } 230 }
231 231
232 #define MARGIN(sbw) (sbw)->scrollbar.thickness + (sbw)->scrollbar.shadow_width 232 #define MARGIN(sbw) (sbw)->scrollbar.thickness + (sbw)->scrollbar.shadow_width
233 233
234 static void 234 static void
235 FillArea(sbw, top, bottom, fill, draw_shadow) 235 FillArea(
236 ScrollbarWidget sbw; 236 ScrollbarWidget sbw,
237 Position top, bottom; 237 Position top, bottom,
238 int fill; 238 int fill,
239 int draw_shadow; 239 int draw_shadow)
240 { 240 {
241 int tlen = bottom - top; /* length of thumb in pixels */ 241 int tlen = bottom - top; /* length of thumb in pixels */
242 int sw, margin, floor; 242 int sw, margin, floor;
243 int lx, ly, lw, lh; 243 int lx, ly, lw, lh;
244 244
338 sbw->shown. The old area is erased. The painting and 338 sbw->shown. The old area is erased. The painting and
339 erasing is done cleverly so that no flickering will occur. 339 erasing is done cleverly so that no flickering will occur.
340 */ 340 */
341 341
342 static void 342 static void
343 PaintThumb(sbw) 343 PaintThumb(ScrollbarWidget sbw)
344 ScrollbarWidget sbw;
345 { 344 {
346 Position oldtop, oldbot, newtop, newbot; 345 Position oldtop, oldbot, newtop, newbot;
347 Dimension margin, tzl; 346 Dimension margin, tzl;
348 347
349 margin = MARGIN (sbw); 348 margin = MARGIN (sbw);
372 FillArea(sbw, newtop, newbot, 0, 1); 371 FillArea(sbw, newtop, newbot, 0, 1);
373 } 372 }
374 } 373 }
375 374
376 static void 375 static void
377 PaintArrows(sbw) 376 PaintArrows(ScrollbarWidget sbw)
378 ScrollbarWidget sbw;
379 { 377 {
380 XPoint point[6]; 378 XPoint point[6];
381 Dimension thickness = sbw->scrollbar.thickness - 1; 379 Dimension thickness = sbw->scrollbar.thickness - 1;
382 Dimension size; 380 Dimension size;
383 Dimension off; 381 Dimension off;
452 point[5].x, point[5].y); 450 point[5].x, point[5].y);
453 } 451 }
454 } 452 }
455 453
456 static void 454 static void
457 Destroy(w) 455 Destroy(Widget w)
458 Widget w;
459 { 456 {
460 ScrollbarWidget sbw = (ScrollbarWidget) w; 457 ScrollbarWidget sbw = (ScrollbarWidget) w;
461 if (sbw->scrollbar.timer_id != (XtIntervalId) 0) 458 if (sbw->scrollbar.timer_id != (XtIntervalId) 0)
462 XtRemoveTimeOut (sbw->scrollbar.timer_id); 459 XtRemoveTimeOut (sbw->scrollbar.timer_id);
463 XtReleaseGC(w, sbw->scrollbar.gc); 460 XtReleaseGC(w, sbw->scrollbar.gc);
464 XtReleaseGC(w, sbw->scrollbar.top_shadow_GC); 461 XtReleaseGC(w, sbw->scrollbar.top_shadow_GC);
465 XtReleaseGC(w, sbw->scrollbar.bot_shadow_GC); 462 XtReleaseGC(w, sbw->scrollbar.bot_shadow_GC);
466 } 463 }
467 464
468 static void 465 static void
469 CreateGC(w) 466 CreateGC(Widget w)
470 Widget w;
471 { 467 {
472 ScrollbarWidget sbw = (ScrollbarWidget) w; 468 ScrollbarWidget sbw = (ScrollbarWidget) w;
473 XGCValues gcValues; 469 XGCValues gcValues;
474 XtGCMask mask; 470 XtGCMask mask;
475 unsigned int depth = 1; 471 unsigned int depth = 1;
503 /* we now set and clear clip masks on the gc returned */ 499 /* we now set and clear clip masks on the gc returned */
504 sbw->scrollbar.gc = XtGetGC (w, mask, &gcValues); 500 sbw->scrollbar.gc = XtGetGC (w, mask, &gcValues);
505 } 501 }
506 502
507 static void 503 static void
508 SetDimensions(sbw) 504 SetDimensions(ScrollbarWidget sbw)
509 ScrollbarWidget sbw;
510 { 505 {
511 if (sbw->scrollbar.orientation == XtorientVertical) 506 if (sbw->scrollbar.orientation == XtorientVertical)
512 { 507 {
513 sbw->scrollbar.length = sbw->core.height; 508 sbw->scrollbar.length = sbw->core.height;
514 sbw->scrollbar.thickness = sbw->core.width; 509 sbw->scrollbar.thickness = sbw->core.width;
519 sbw->scrollbar.thickness = sbw->core.height; 514 sbw->scrollbar.thickness = sbw->core.height;
520 } 515 }
521 } 516 }
522 517
523 static void 518 static void
524 Initialize(request, new, args, num_args) 519 Initialize(
525 Widget request UNUSED; /* what the client asked for */ 520 Widget request UNUSED, /* what the client asked for */
526 Widget new; /* what we're going to give him */ 521 Widget new, /* what we're going to give him */
527 ArgList args UNUSED; 522 ArgList args UNUSED,
528 Cardinal *num_args UNUSED; 523 Cardinal *num_args UNUSED)
529 { 524 {
530 ScrollbarWidget sbw = (ScrollbarWidget) new; 525 ScrollbarWidget sbw = (ScrollbarWidget) new;
531 526
532 CreateGC(new); 527 CreateGC(new);
533 AllocTopShadowGC(new); 528 AllocTopShadowGC(new);
547 sbw->scrollbar.topLoc = 0; 542 sbw->scrollbar.topLoc = 0;
548 sbw->scrollbar.shownLength = sbw->scrollbar.min_thumb; 543 sbw->scrollbar.shownLength = sbw->scrollbar.min_thumb;
549 } 544 }
550 545
551 static void 546 static void
552 Realize(w, valueMask, attributes) 547 Realize(
553 Widget w; 548 Widget w,
554 Mask *valueMask; 549 Mask *valueMask,
555 XSetWindowAttributes *attributes; 550 XSetWindowAttributes *attributes)
556 { 551 {
557 /* The Simple widget actually stuffs the value in the valuemask. */ 552 /* The Simple widget actually stuffs the value in the valuemask. */
558 (*vim_scrollbarWidgetClass->core_class.superclass->core_class.realize) 553 (*vim_scrollbarWidgetClass->core_class.superclass->core_class.realize)
559 (w, valueMask, attributes); 554 (w, valueMask, attributes);
560 } 555 }
561 556
562 static Boolean 557 static Boolean
563 SetValues(current, request, desired, args, num_args) 558 SetValues(
564 Widget current; /* what I am */ 559 Widget current, /* what I am */
565 Widget request UNUSED; /* what he wants me to be */ 560 Widget request UNUSED, /* what he wants me to be */
566 Widget desired; /* what I will become */ 561 Widget desired, /* what I will become */
567 ArgList args UNUSED; 562 ArgList args UNUSED,
568 Cardinal *num_args UNUSED; 563 Cardinal *num_args UNUSED)
569 { 564 {
570 ScrollbarWidget sbw = (ScrollbarWidget) current; 565 ScrollbarWidget sbw = (ScrollbarWidget) current;
571 ScrollbarWidget dsbw = (ScrollbarWidget) desired; 566 ScrollbarWidget dsbw = (ScrollbarWidget) desired;
572 Boolean redraw = FALSE; 567 Boolean redraw = FALSE;
573 568
599 } 594 }
600 return redraw; 595 return redraw;
601 } 596 }
602 597
603 static void 598 static void
604 Resize(w) 599 Resize(Widget w)
605 Widget w;
606 { 600 {
607 /* ForgetGravity has taken care of background, but thumb may 601 /* ForgetGravity has taken care of background, but thumb may
608 * have to move as a result of the new size. */ 602 * have to move as a result of the new size. */
609 SetDimensions ((ScrollbarWidget) w); 603 SetDimensions ((ScrollbarWidget) w);
610 Redisplay(w, (XEvent*) NULL, (Region)NULL); 604 Redisplay(w, (XEvent*) NULL, (Region)NULL);
611 } 605 }
612 606
613 607
614 static void 608 static void
615 Redisplay(w, event, region) 609 Redisplay(Widget w, XEvent *event, Region region)
616 Widget w;
617 XEvent *event;
618 Region region;
619 { 610 {
620 ScrollbarWidget sbw = (ScrollbarWidget) w; 611 ScrollbarWidget sbw = (ScrollbarWidget) w;
621 int x, y; 612 int x, y;
622 unsigned int width, height; 613 unsigned int width, height;
623 614
648 PaintArrows(sbw); 639 PaintArrows(sbw);
649 } 640 }
650 641
651 642
652 static Boolean 643 static Boolean
653 CompareEvents(oldEvent, newEvent) 644 CompareEvents(XEvent *oldEvent, *newEvent)
654 XEvent *oldEvent, *newEvent;
655 { 645 {
656 #define Check(field) if (newEvent->field != oldEvent->field) return False; 646 #define Check(field) if (newEvent->field != oldEvent->field) return False;
657 647
658 Check(xany.display); 648 Check(xany.display);
659 Check(xany.type); 649 Check(xany.type);
691 XEvent *oldEvent; 681 XEvent *oldEvent;
692 int count; 682 int count;
693 }; 683 };
694 684
695 static Bool 685 static Bool
696 PeekNotifyEvent(dpy, event, args) 686 PeekNotifyEvent(Display *dpy, XEvent *event, char *args)
697 Display *dpy;
698 XEvent *event;
699 char *args;
700 { 687 {
701 struct EventData *eventData = (struct EventData*)args; 688 struct EventData *eventData = (struct EventData*)args;
702 689
703 return ((++eventData->count == QLength(dpy)) /* since PeekIf blocks */ 690 return ((++eventData->count == QLength(dpy)) /* since PeekIf blocks */
704 || CompareEvents(event, eventData->oldEvent)); 691 || CompareEvents(event, eventData->oldEvent));
705 } 692 }
706 693
707 694
708 static Boolean 695 static Boolean
709 LookAhead(w, event) 696 LookAhead(Widget w, XEvent *event)
710 Widget w;
711 XEvent *event;
712 { 697 {
713 XEvent newEvent; 698 XEvent newEvent;
714 struct EventData eventData; 699 struct EventData eventData;
715 700
716 if (QLength (XtDisplay (w)) == 0) 701 if (QLength (XtDisplay (w)) == 0)
724 return CompareEvents (event, &newEvent); 709 return CompareEvents (event, &newEvent);
725 } 710 }
726 711
727 712
728 static void 713 static void
729 ExtractPosition(event, x, y, state) 714 ExtractPosition(
730 XEvent *event; 715 XEvent *event,
731 Position *x, *y; /* RETURN */ 716 Position *x, *y, /* RETURN */
732 unsigned int *state; /* RETURN */ 717 unsigned int *state) /* RETURN */
733 { 718 {
734 switch (event->type) 719 switch (event->type)
735 { 720 {
736 case MotionNotify: 721 case MotionNotify:
737 *x = event->xmotion.x; 722 *x = event->xmotion.x;
766 *state = 0; 751 *state = 0;
767 } 752 }
768 } 753 }
769 754
770 static void 755 static void
771 HandleThumb(w, event, params, num_params) 756 HandleThumb(
772 Widget w; 757 Widget w,
773 XEvent *event; 758 XEvent *event,
774 String *params; 759 String *params,
775 Cardinal *num_params; 760 Cardinal *num_params)
776 { 761 {
777 Position x, y, loc; 762 Position x, y, loc;
778 ScrollbarWidget sbw = (ScrollbarWidget) w; 763 ScrollbarWidget sbw = (ScrollbarWidget) w;
779 764
780 ExtractPosition(event, &x, &y, (unsigned int *)NULL); 765 ExtractPosition(event, &x, &y, (unsigned int *)NULL);
789 XtCallActionProc(w, "NotifyThumb", event, params, *num_params); 774 XtCallActionProc(w, "NotifyThumb", event, params, *num_params);
790 } 775 }
791 } 776 }
792 777
793 static void 778 static void
794 RepeatNotify(client_data, idp) 779 RepeatNotify(XtPointer client_data, XtIntervalId *idp UNUSED)
795 XtPointer client_data;
796 XtIntervalId *idp UNUSED;
797 { 780 {
798 ScrollbarWidget sbw = (ScrollbarWidget) client_data; 781 ScrollbarWidget sbw = (ScrollbarWidget) client_data;
799 int call_data; 782 int call_data;
800 char mode = sbw->scrollbar.scroll_mode; 783 char mode = sbw->scrollbar.scroll_mode;
801 unsigned long rep; 784 unsigned long rep;
831 814
832 /* 815 /*
833 * Same as above, but for floating numbers. 816 * Same as above, but for floating numbers.
834 */ 817 */
835 static float 818 static float
836 FloatInRange(num, small, big) 819 FloatInRange(float num, small, big)
837 float num, small, big;
838 { 820 {
839 return (num < small) ? small : ((num > big) ? big : num); 821 return (num < small) ? small : ((num > big) ? big : num);
840 } 822 }
841 823
842 static void 824 static void
843 ScrollOneLineUp(w, event, params, num_params) 825 ScrollOneLineUp(
844 Widget w; 826 Widget w,
845 XEvent *event; 827 XEvent *event,
846 String *params UNUSED; 828 String *params UNUSED,
847 Cardinal *num_params UNUSED; 829 Cardinal *num_params UNUSED)
848 { 830 {
849 ScrollSome(w, event, -ONE_LINE_DATA); 831 ScrollSome(w, event, -ONE_LINE_DATA);
850 } 832 }
851 833
852 static void 834 static void
853 ScrollOneLineDown(w, event, params, num_params) 835 ScrollOneLineDown(
854 Widget w; 836 Widget w,
855 XEvent *event; 837 XEvent *event,
856 String *params UNUSED; 838 String *params UNUSED,
857 Cardinal *num_params UNUSED; 839 Cardinal *num_params UNUSED)
858 { 840 {
859 ScrollSome(w, event, ONE_LINE_DATA); 841 ScrollSome(w, event, ONE_LINE_DATA);
860 } 842 }
861 843
862 static void 844 static void
863 ScrollPageDown(w, event, params, num_params) 845 ScrollPageDown(
864 Widget w; 846 Widget w,
865 XEvent *event; 847 XEvent *event,
866 String *params UNUSED; 848 String *params UNUSED,
867 Cardinal *num_params UNUSED; 849 Cardinal *num_params UNUSED)
868 { 850 {
869 ScrollSome(w, event, ONE_PAGE_DATA); 851 ScrollSome(w, event, ONE_PAGE_DATA);
870 } 852 }
871 853
872 static void 854 static void
873 ScrollPageUp(w, event, params, num_params) 855 ScrollPageUp(
874 Widget w; 856 Widget w,
875 XEvent *event; 857 XEvent *event,
876 String *params UNUSED; 858 String *params UNUSED,
877 Cardinal *num_params UNUSED; 859 Cardinal *num_params UNUSED)
878 { 860 {
879 ScrollSome(w, event, -ONE_PAGE_DATA); 861 ScrollSome(w, event, -ONE_PAGE_DATA);
880 } 862 }
881 863
882 static void 864 static void
883 ScrollSome(w, event, call_data) 865 ScrollSome(
884 Widget w; 866 Widget w,
885 XEvent *event; 867 XEvent *event,
886 int call_data; 868 int call_data)
887 { 869 {
888 ScrollbarWidget sbw = (ScrollbarWidget) w; 870 ScrollbarWidget sbw = (ScrollbarWidget) w;
889 871
890 if (sbw->scrollbar.scroll_mode == SMODE_CONT) /* if scroll continuous */ 872 if (sbw->scrollbar.scroll_mode == SMODE_CONT) /* if scroll continuous */
891 return; 873 return;
896 sbw->scrollbar.scroll_mode = SMODE_LINE_UP; 878 sbw->scrollbar.scroll_mode = SMODE_LINE_UP;
897 XtCallCallbacks(w, XtNscrollProc, (XtPointer)(long_u)call_data); 879 XtCallCallbacks(w, XtNscrollProc, (XtPointer)(long_u)call_data);
898 } 880 }
899 881
900 static void 882 static void
901 NotifyScroll(w, event, params, num_params) 883 NotifyScroll(
902 Widget w; 884 Widget w,
903 XEvent *event; 885 XEvent *event,
904 String *params UNUSED; 886 String *params UNUSED,
905 Cardinal *num_params UNUSED; 887 Cardinal *num_params UNUSED)
906 { 888 {
907 ScrollbarWidget sbw = (ScrollbarWidget) w; 889 ScrollbarWidget sbw = (ScrollbarWidget) w;
908 Position x, y, loc; 890 Position x, y, loc;
909 Dimension arrow_size; 891 Dimension arrow_size;
910 unsigned long delay = 0; 892 unsigned long delay = 0;
985 XtAppAddTimeOut(XtWidgetToApplicationContext(w), 967 XtAppAddTimeOut(XtWidgetToApplicationContext(w),
986 delay, RepeatNotify, (XtPointer)w); 968 delay, RepeatNotify, (XtPointer)w);
987 } 969 }
988 970
989 static void 971 static void
990 EndScroll(w, event, params, num_params) 972 EndScroll(
991 Widget w; 973 Widget w,
992 XEvent *event UNUSED; 974 XEvent *event UNUSED,
993 String *params UNUSED; 975 String *params UNUSED,
994 Cardinal *num_params UNUSED; 976 Cardinal *num_params UNUSED)
995 { 977 {
996 ScrollbarWidget sbw = (ScrollbarWidget) w; 978 ScrollbarWidget sbw = (ScrollbarWidget) w;
997 979
998 sbw->scrollbar.scroll_mode = SMODE_NONE; 980 sbw->scrollbar.scroll_mode = SMODE_NONE;
999 /* no need to remove any autoscroll timeout; it will no-op */ 981 /* no need to remove any autoscroll timeout; it will no-op */
1000 /* because the scroll_mode is SMODE_NONE */ 982 /* because the scroll_mode is SMODE_NONE */
1001 /* but be sure to remove timeout in destroy proc */ 983 /* but be sure to remove timeout in destroy proc */
1002 } 984 }
1003 985
1004 static float 986 static float
1005 FractionLoc(sbw, x, y) 987 FractionLoc(ScrollbarWidget sbw, int x, y)
1006 ScrollbarWidget sbw;
1007 int x, y;
1008 { 988 {
1009 int margin; 989 int margin;
1010 float height, width; 990 float height, width;
1011 991
1012 margin = MARGIN(sbw); 992 margin = MARGIN(sbw);
1016 width = (float)sbw->core.width - 2 * margin; 996 width = (float)sbw->core.width - 2 * margin;
1017 return PICKLENGTH(sbw, x / width, y / height); 997 return PICKLENGTH(sbw, x / width, y / height);
1018 } 998 }
1019 999
1020 static void 1000 static void
1021 MoveThumb(w, event, params, num_params) 1001 MoveThumb(
1022 Widget w; 1002 Widget w,
1023 XEvent *event; 1003 XEvent *event,
1024 String *params UNUSED; 1004 String *params UNUSED,
1025 Cardinal *num_params UNUSED; 1005 Cardinal *num_params UNUSED)
1026 { 1006 {
1027 ScrollbarWidget sbw = (ScrollbarWidget)w; 1007 ScrollbarWidget sbw = (ScrollbarWidget)w;
1028 Position x, y; 1008 Position x, y;
1029 float top; 1009 float top;
1030 char old_mode = sbw->scrollbar.scroll_mode; 1010 char old_mode = sbw->scrollbar.scroll_mode;
1061 XFlush(XtDisplay(w)); /* re-draw it before Notifying */ 1041 XFlush(XtDisplay(w)); /* re-draw it before Notifying */
1062 } 1042 }
1063 1043
1064 1044
1065 static void 1045 static void
1066 NotifyThumb(w, event, params, num_params) 1046 NotifyThumb(
1067 Widget w; 1047 Widget w,
1068 XEvent *event; 1048 XEvent *event,
1069 String *params UNUSED; 1049 String *params UNUSED,
1070 Cardinal *num_params UNUSED; 1050 Cardinal *num_params UNUSED)
1071 { 1051 {
1072 ScrollbarWidget sbw = (ScrollbarWidget)w; 1052 ScrollbarWidget sbw = (ScrollbarWidget)w;
1073 /* Use a union to avoid a warning for the weird conversion from float to 1053 /* Use a union to avoid a warning for the weird conversion from float to
1074 * XtPointer. Comes from Xaw/Scrollbar.c. */ 1054 * XtPointer. Comes from Xaw/Scrollbar.c. */
1075 union { 1055 union {
1087 XtCallCallbacks(w, XtNthumbProc, xtpf.xtp); 1067 XtCallCallbacks(w, XtNthumbProc, xtpf.xtp);
1088 XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top); 1068 XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top);
1089 } 1069 }
1090 1070
1091 static void 1071 static void
1092 AllocTopShadowGC(w) 1072 AllocTopShadowGC(Widget w)
1093 Widget w;
1094 { 1073 {
1095 ScrollbarWidget sbw = (ScrollbarWidget) w; 1074 ScrollbarWidget sbw = (ScrollbarWidget) w;
1096 XtGCMask valuemask; 1075 XtGCMask valuemask;
1097 XGCValues myXGCV; 1076 XGCValues myXGCV;
1098 1077
1100 myXGCV.foreground = sbw->scrollbar.top_shadow_pixel; 1079 myXGCV.foreground = sbw->scrollbar.top_shadow_pixel;
1101 sbw->scrollbar.top_shadow_GC = XtGetGC(w, valuemask, &myXGCV); 1080 sbw->scrollbar.top_shadow_GC = XtGetGC(w, valuemask, &myXGCV);
1102 } 1081 }
1103 1082
1104 static void 1083 static void
1105 AllocBotShadowGC(w) 1084 AllocBotShadowGC(Widget w)
1106 Widget w;
1107 { 1085 {
1108 ScrollbarWidget sbw = (ScrollbarWidget) w; 1086 ScrollbarWidget sbw = (ScrollbarWidget) w;
1109 XtGCMask valuemask; 1087 XtGCMask valuemask;
1110 XGCValues myXGCV; 1088 XGCValues myXGCV;
1111 1089
1113 myXGCV.foreground = sbw->scrollbar.bot_shadow_pixel; 1091 myXGCV.foreground = sbw->scrollbar.bot_shadow_pixel;
1114 sbw->scrollbar.bot_shadow_GC = XtGetGC(w, valuemask, &myXGCV); 1092 sbw->scrollbar.bot_shadow_GC = XtGetGC(w, valuemask, &myXGCV);
1115 } 1093 }
1116 1094
1117 static void 1095 static void
1118 _Xaw3dDrawShadows(gw, event, region, out) 1096 _Xaw3dDrawShadows(
1119 Widget gw; 1097 Widget gw,
1120 XEvent *event UNUSED; 1098 XEvent *event UNUSED,
1121 Region region; 1099 Region region,
1122 int out; 1100 int out)
1123 { 1101 {
1124 XPoint pt[6]; 1102 XPoint pt[6];
1125 ScrollbarWidget sbw = (ScrollbarWidget) gw; 1103 ScrollbarWidget sbw = (ScrollbarWidget) gw;
1126 Dimension s = sbw->scrollbar.shadow_width; 1104 Dimension s = sbw->scrollbar.shadow_width;
1127 /* 1105 /*
1185 1163
1186 /* 1164 /*
1187 * Set the scroll bar to the given location. 1165 * Set the scroll bar to the given location.
1188 */ 1166 */
1189 void 1167 void
1190 vim_XawScrollbarSetThumb(w, top, shown, max) 1168 vim_XawScrollbarSetThumb(Widget w, double top, shown, max)
1191 Widget w;
1192 double top, shown, max;
1193 { 1169 {
1194 ScrollbarWidget sbw = (ScrollbarWidget) w; 1170 ScrollbarWidget sbw = (ScrollbarWidget) w;
1195 1171
1196 if (sbw->scrollbar.scroll_mode == SMODE_CONT) /* if still thumbing */ 1172 if (sbw->scrollbar.scroll_mode == SMODE_CONT) /* if still thumbing */
1197 return; 1173 return;