Grip.c

Go to the documentation of this file.
00001 /* $XConsortium: Grip.c,v 1.33 94/04/17 20:12:10 kaleb Exp $ */
00002 
00003 /***********************************************************
00004 
00005 Copyright (c) 1987, 1988, 1994  X Consortium
00006 
00007 Permission is hereby granted, free of charge, to any person obtaining a copy
00008 of this software and associated documentation files (the "Software"), to deal
00009 in the Software without restriction, including without limitation the rights
00010 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00011 copies of the Software, and to permit persons to whom the Software is
00012 furnished to do so, subject to the following conditions:
00013 
00014 The above copyright notice and this permission notice shall be included in
00015 all copies or substantial portions of the Software.
00016 
00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00018 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
00020 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00021 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00022 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00023 
00024 Except as contained in this notice, the name of the X Consortium shall not be
00025 used in advertising or otherwise to promote the sale, use or other dealings
00026 in this Software without prior written authorization from the X Consortium.
00027 
00028 
00029 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
00030 
00031                         All Rights Reserved
00032 
00033 Permission to use, copy, modify, and distribute this software and its 
00034 documentation for any purpose and without fee is hereby granted, 
00035 provided that the above copyright notice appear in all copies and that
00036 both that copyright notice and this permission notice appear in 
00037 supporting documentation, and that the name of Digital not be
00038 used in advertising or publicity pertaining to distribution of the
00039 software without specific, written prior permission.  
00040 
00041 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
00042 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
00043 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
00044 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
00045 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
00046 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
00047 SOFTWARE.
00048 
00049 ******************************************************************/
00050 
00051 /*
00052  * Grip.c - Grip Widget (Used by Paned Widget)
00053  *
00054  */
00055 #include <X11/IntrinsicP.h>
00056 #include <X11/StringDefs.h>
00057 #include <X11/Xaw3d/XawInit.h>
00058 #include <X11/Xaw3d/GripP.h>
00059 
00060 static XtResource resources[] = {
00061    {XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension),
00062       XtOffsetOf(GripRec, core.width), XtRImmediate,
00063       (XtPointer) DEFAULT_GRIP_SIZE},
00064    {XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
00065       XtOffsetOf(GripRec, core.height), XtRImmediate,
00066       (XtPointer) DEFAULT_GRIP_SIZE},
00067    {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
00068       XtOffsetOf(GripRec, core.background_pixel), XtRString,
00069       XtDefaultForeground},
00070    {XtNborderWidth, XtCBorderWidth, XtRDimension, sizeof(Dimension),
00071       XtOffsetOf(GripRec, core.border_width), XtRImmediate, (XtPointer)0},
00072    {XtNcallback, XtCCallback, XtRCallback, sizeof(XtPointer), 
00073       XtOffsetOf(GripRec, grip.grip_action), XtRCallback, NULL},
00074 };
00075 
00076 static void GripAction( /* Widget, XEvent*, String*, Cardinal */ );
00077 
00078 static XtActionsRec actionsList[] =
00079 {
00080   {"GripAction",      GripAction},
00081 };
00082 
00083 #define SuperClass (&threeDClassRec)
00084 
00085 GripClassRec gripClassRec = {
00086    {
00087 /* core class fields */
00088     /* superclass         */   (WidgetClass) SuperClass,
00089     /* class name         */   "Grip",
00090     /* size               */   sizeof(GripRec),
00091     /* class initialize   */   XawInitializeWidgetSet,
00092     /* class_part_init    */   NULL,
00093     /* class_inited       */   FALSE,
00094     /* initialize         */   NULL,
00095     /* initialize_hook    */   NULL,
00096     /* realize            */   XtInheritRealize,
00097     /* actions            */   actionsList,
00098     /* num_actions        */   XtNumber(actionsList),
00099     /* resources          */   resources,
00100     /* resource_count     */   XtNumber(resources),
00101     /* xrm_class          */   NULLQUARK,
00102     /* compress_motion    */   TRUE,
00103     /* compress_exposure  */   TRUE,
00104     /* compress_enterleave*/   TRUE,
00105     /* visible_interest   */   FALSE,
00106     /* destroy            */   NULL,
00107     /* resize             */   NULL,
00108     /* expose             */   XtInheritExpose,
00109     /* set_values         */   NULL,
00110     /* set_values_hook    */   NULL,
00111     /* set_values_almost  */   XtInheritSetValuesAlmost,
00112     /* get_values_hook    */   NULL,
00113     /* accept_focus       */   NULL,
00114     /* version            */   XtVersion,
00115     /* callback_private   */   NULL,
00116     /* tm_table           */   NULL,
00117     /* query_geometry     */   XtInheritQueryGeometry,
00118     /* display_accelerator*/   XtInheritDisplayAccelerator,
00119     /* extension          */   NULL
00120    },
00121 /* Simple class fields initialization */
00122    {
00123     /* change_sensitive   */   XtInheritChangeSensitive
00124    },
00125 /* ThreeD class fields initialization */
00126    {
00127     /* shadowdraw         */   0    /* inherited expose method knows how */
00128    },
00129 /* Grip class fields initialization */
00130    {
00131     /* not used           */   0
00132    }
00133 };
00134 
00135 WidgetClass gripWidgetClass = (WidgetClass) &gripClassRec;
00136 
00137 static void GripAction( widget, event, params, num_params )
00138     Widget widget;
00139     XEvent *event;
00140     String *params;
00141     Cardinal *num_params;
00142 {
00143     XawGripCallDataRec call_data;
00144 
00145     call_data.event = event;
00146     call_data.params = params;
00147     call_data.num_params = *num_params;
00148 
00149     XtCallCallbacks( widget, XtNcallback, (XtPointer)&call_data );
00150 }

Generated on Sun Mar 4 15:03:55 2007 for Scilab [trunk] by  doxygen 1.5.1