/* * Cvs: $Id: SideP.h,v 1.7 1995/11/07 16:01:45 erikb Exp $ * * HtSide is a widget used for manoeuvring. It is intended to work in * situations where a ScrollBar normally is used. HtSide is typically * used inside some Manager class widget adjacent to the displayed data. * * Copyright (C) 1995. Author: Erik Borälv (Erik.Boralv@cmd.uu.se). * Center for Human-Computer Studies (CMD), Uppsala University. * * Center for Human-Computer Studies * Uppsala University * att: Erik Boralv * Lagerhyddvagen 18 * S-752 37 UPPSALA * SWEDEN * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * IN NO EVENT SHALL CMD BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, * INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS * SOFTWARE AND ITS DOCUMENTATION, EVEN IF CMD HAS BEEN ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * CMD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND CMD * HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, * OR MODIFICATIONS. */ #ifndef _HtSideP_h #define _HtSideP_h #include #include #include #include #ifdef __cplusplus extern "C" { #endif typedef Boolean (*HtSideBoolProc)(); /* * For sub-classes that wish to inherit methods. */ #define HtInheritCreateGC ((XtWidgetProc) _XtInherit) #define HtInheritDestroyGC ((XtWidgetProc) _XtInherit) #define HtInheritDrawMarkers ((XtWidgetProc) _XtInherit) #define HtInheritDrawCurrent ((XtWidgetProc) _XtInherit) #define HtInheritEraseCurrent ((XtWidgetProc) _XtInherit) #define HtInheritGoto ((HtSideBoolProc) _XtInherit) #define HtInheritNext ((HtSideBoolProc) _XtInherit) #define HtInheritPrev ((HtSideBoolProc) _XtInherit) #define HtInheritFirst ((XtWidgetProc) _XtInherit) #define HtInheritLast ((XtWidgetProc) _XtInherit) typedef struct { XtWidgetProc create_gc; XtWidgetProc destroy_gc; XtWidgetProc draw_markers; XtWidgetProc erase_current; XtWidgetProc draw_current; HtSideBoolProc go_to; HtSideBoolProc next; HtSideBoolProc prev; XtWidgetProc first; XtWidgetProc last; XtPointer extension; } HtSideClassPart; /* * Full class record declaration. */ typedef struct _HtSideClassRec { CoreClassPart core_class; XmPrimitiveClassPart primitive_class; HtSideClassPart side_class; } HtSideClassRec; externalref HtSideClassRec htSideClassRec; typedef struct { /* Public widget resources. */ Pixel marker_color; /* color of current marker */ int markers; /* how many markers right now */ int marker_length; /* how long are the markers */ int position; /* which marker is current */ XtCallbackList select; /* the callback on selection */ /* Private variables. */ GC side_GC; /* GC for the current marker */ GC inverse_GC; /* inverse GC for current */ GC marker_GC; /* GC for the normal markers */ XPoint *segments; /* all the markers coord's */ } HtSidePart; /**************************************************************** * * Full instance record declaration. * ****************************************************************/ typedef struct _HtSideRec { CorePart core; XmPrimitivePart primitive; HtSidePart side; } HtSideRec; /* * Internal Function Declarations. */ #ifdef NeedFunctionPrototypes static void ClassPartInitialize(WidgetClass widgetClass), Initialize(Widget rw, Widget nw, ArgList args, Cardinal *num), Destroy(Widget wid), Resize(HtSideWidget wid), Redisplay(Widget w, XEvent *event, Region region), CreateGC(Widget w), DestroyGC(Widget w), DrawMarkers(Widget w), EraseCurrent(Widget w), DrawCurrent(Widget w), htFindMinAndMax(Widget w, int pos, int *min, int *max), First(Widget w), Last(Widget w); static Boolean Next(Widget w), Prev(Widget w), Goto(Widget w, int pos, HtReason reason), WidgetDisplayRect(Widget w, XRectangle *displayrect), SetValues(HtSideWidget cw, HtSideWidget rw, HtSideWidget nw); #else /* NeedFunctionPrototypes */ static void ClassPartInitialize(), Initialize(), Destroy(), Resize(), Redisplay(), CreateGC(), DestroyGC(), DrawMarkers(), EraseCurrent(), DrawCurrent(), First(), Last(), htFindMinAndMax(); static Boolean Next(), Prev(), Goto(), WidgetDisplayRect(), SetValues(); #endif /* Internal Function Declarations. */ #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif #endif /* DON'T ADD ANYTHING AFTER THIS #endif */