home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / scrollerP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.9 KB  |  98 lines

  1. /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /* 
  19.    scroller.c --- defines a subclass of XmScrolledWindow
  20.    Created: Jamie Zawinski <jwz@netscape.com>, 23-Jul-94.
  21.  */
  22.  
  23.  
  24. #ifndef _FE_SCROLLERP_H_
  25. #define _FE_SCROLLERP_H_
  26.  
  27. #include "scroller.h"
  28.  
  29. #if XmVersion >= 2000
  30.  
  31. /*
  32.  * There is a backward compatibility bug in motif 2.0 that prevents
  33.  * the XmScrolledWindow class from behaving just as the motif 1.2
  34.  * one.  For whatever reasons, the mozilla scrolling code depends on
  35.  * the 1.2 behavior.  Fixing the problem in Mozilla should not be
  36.  * hard.  The logic in scroll.c should probably be updated to work
  37.  * with both motif 1.2 and 2.0.
  38.  *
  39.  * The current hackery solution (yes its disgusting) is to use the
  40.  * XmScrolledWindow code from 1.2.  In defense of Netscape:  The only
  41.  * reason whay such a sickening solution was used, was to make the
  42.  * free mozilla date with building motif 2.0 code.
  43.  *
  44.  * -ramiro
  45.  *
  46.  */
  47. #ifdef FEATURE_MOTIF20_SCROLLED_WINDOW_HACKING
  48. #include <XmPatches/HackedWP.h>
  49. #define SCROLLER_SC_CLASS_PART    XmHackedWindowClassPart
  50. #define SCROLLER_SC_RECORD_PART    XmHackedWindowPart
  51. #else
  52. #include <Xm/ScrolledWP.h>
  53. #define SCROLLER_SC_CLASS_PART    XmScrolledWindowClassPart
  54. #define SCROLLER_SC_RECORD_PART    XmScrolledWindowPart
  55. #endif /* FEATURE_MOTIF20_SCROLLED_WINDOW_HACKING */
  56.  
  57. #else
  58. #include <Xm/ScrolledWP.h>
  59. #define SCROLLER_SC_CLASS_PART    XmScrolledWindowClassPart
  60. #define SCROLLER_SC_RECORD_PART    XmScrolledWindowPart
  61.  
  62. #endif /* XmVersion >= 2000 */
  63.  
  64. typedef struct
  65. {
  66.   int bite_me;
  67. } ScrollerClassPart;
  68.  
  69. typedef struct _ScrollerClassRec
  70. {
  71.   CoreClassPart    core_class;
  72.   CompositeClassPart        composite_class;
  73.   ConstraintClassPart        constraint_class;
  74.   XmManagerClassPart        manager_class;
  75.   SCROLLER_SC_CLASS_PART    swindow_class;
  76.   ScrollerClassPart            scroller_class;
  77. } ScrollerClassRec;
  78.  
  79. extern ScrollerClassRec scrollerClassRec;
  80.  
  81. typedef struct 
  82. {
  83.   void *resize_arg;
  84.   void (*resize_hook) (Widget, void *arg);
  85. } ScrollerPart;
  86.  
  87. typedef struct _ScrollerRec
  88. {
  89.     CorePart                core;
  90.     CompositePart            composite;
  91.     ConstraintPart            constraint;
  92.     XmManagerPart            manager;
  93.     SCROLLER_SC_RECORD_PART    swindow;
  94.     ScrollerPart            scroller;
  95. } ScrollerRec;
  96.  
  97. #endif /* _FE_SCROLLERP_H_ */
  98.