File: Cell.c

package info (click to toggle)
gridengine 8.1.9%2Bdfsg-10
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 56,880 kB
  • sloc: ansic: 432,689; java: 87,068; cpp: 31,958; sh: 29,429; jsp: 7,757; perl: 6,336; xml: 5,828; makefile: 4,701; csh: 3,928; ruby: 2,221; tcl: 1,676; lisp: 669; yacc: 519; python: 503; lex: 361; javascript: 200
file content (127 lines) | stat: -rw-r--r-- 4,674 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
 * Copyright(C) Q. Frank Xia (qx@math.columbia.edu), 1994. 
 *
 *                       All Rights Reserved
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose and without fee is hereby granted,
 * provided that the above copyright notice appear in all copies and that
 * both that copyright notice and this permission notice appear in
 * supporting documentation, and that the name of Q. Frank Xia not be
 * used in advertising or publicity pertaining to distribution of the
 * software without specific, written prior permission.
 * 
 * This software is provided as-is and without any warranty of any kind.
 *
 * $Id: Cell.c,v 1.1 2001-07-18 11:05:59 root Exp $
 */

/*
 * Cell.c - This widget is derived from Motif TextField widget. 
 *         It overwrites UnhighlightBorder method of Primitive widget.
 *      This widget is used in Matrix widget to replace TextField widget.
 *
 * 7-20-1994:
 *        This file is created.
 */

#include "CellP.h"
#if XmVersion <= 1001
#include <Xm/XmP.h>
#else
#include <Xm/DrawP.h>
#endif

/* Declaration of methods */

#ifdef _NO_PROTO
static void UnhighlightBorder();
#else
static void UnhighlightBorder(Widget w);
#endif /* _NO_PROTO */

XqCellClassRec xqCellClassRec = {
    {
    /* core_class fields         */
    /* superclass                */         (WidgetClass) &xmTextFieldClassRec,
    /* class_name                */         "XqCell",
    /* widget_size               */         sizeof(XqCellRec),
    /* class_initialize              */         NULL,
    /* class_part_initialize    */         NULL,
    /* class_inited                  */         FALSE,
    /* initialize                */         NULL,
    /* initialize_hook               */         NULL,
    /* realize                   */         XtInheritRealize,
    /* actions                   */         NULL,
    /* num_actions               */         0,
    /* resources                 */         NULL,
    /* num_resources                 */         0,
    /* xrm_class                 */         NULLQUARK,
    /* compress_motion               */         TRUE,
    /* compress_exposure             */         XtExposeCompressSeries |
                                                  XtExposeGraphicsExpose |
                                            XtExposeNoExpose,
    /* compress_enterleave           */         TRUE,
    /* visible_interest              */         False,
    /* destroy                   */         NULL,
    /* resize                    */         XtInheritResize,
    /* expose                    */         XtInheritExpose,
    /* set_values                */         NULL,
    /* set_values_hook               */         NULL,
    /* set_values_almost             */         XtInheritSetValuesAlmost,
    /* get_values_hook               */         NULL,
    /* accept_focus              */         XtInheritAcceptFocus,
    /* version                   */         XtVersion,
    /* callback_private              */         NULL,
    /* tm_table                  */         XtInheritTranslations,
    /* query_geometry                */         XtInheritQueryGeometry,
    /* display_accelerator      */         XtInheritDisplayAccelerator,
    /* extension                */         NULL
    },
    {  /* Primitive class         */
    /* border_highlight           */      (XtWidgetProc)_XtInherit,       
#if XmVersion <= 1001
    /* border_unhighlight         */      (XtWidgetProc)_XmUnhighlightBorder,
#else
    /* border_unhighlight         */      (XtWidgetProc)UnhighlightBorder,    
#endif
    /* translations               */      NULL,
    /* arm_and_activate           */      (XtActionProc)_XtInherit,    
    /* syn resources              */      NULL,
    /* num_syn_resources          */      0,
    /* extension                  */      NULL,
    },
    {  /* TextField class */
    /* extension                  */      NULL,
    },
    {  /* Cell class */
    /* extension                */        NULL,
    }
};

WidgetClass xqCellWidgetClass = (WidgetClass) &xqCellClassRec;

#if XmVersion > 1001
static void 
#ifdef NeedFunctionPrototypes
UnhighlightBorder(w)
Widget w ;
#else
UnhighlightBorder(Widget w)
#endif /* _NO_PROTO */
{   
    XmPrimitiveWidget pw = (XmPrimitiveWidget) w ;

    pw->primitive.highlighted = False ;
    pw->primitive.highlight_drawn = False ;

    if(XtWidth( w) == 0 || XtHeight( w) == 0 ||
       pw->primitive.highlight_thickness == 0)
        return ;

    _XmClearBorder( XtDisplay (pw), XtWindow (pw), 0, 0, XtWidth( w),
                   XtHeight( w) , pw->primitive.highlight_thickness) ;
}

#endif