File: scrollbar.h

package info (click to toggle)
xball 3.0-16
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,004 kB
  • ctags: 1,358
  • sloc: ansic: 4,612; sh: 3,415; makefile: 522
file content (56 lines) | stat: -rw-r--r-- 1,715 bytes parent folder | download | duplicates (7)
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
/**********************************************************************
 * scrollbar.h - declares scrollbar object
 *
 * Copyright 1993, David Nedde
 *
 * Permission to use, copy, modify, and distribute this software
 * and its documentation for any purpose and without fee is granted
 * provided that the above copyright notice appears in all copies.
 * It is provided "as is" without express or implied warranty.
 **********************************************************************/

#ifndef __SCROLLBAR_H__
#define __SCROLLBAR_H__

#include <X11/Intrinsic.h>

#include "list.h"

typedef struct {
    Widget    form;
    Widget    label;
    Widget    scale;
#ifdef ATHENA
    Widget    feedback;   /* Used to display value like Motif scale widget */
#endif

    int       value;      /* Current value of the scrollbar */
    list_type callbacks;  /* List of callbacks on this scrollbar */
} scrollbar_struct, *scrollbar_type;


/* We need to make the callbacks ourself, because the callback data is
   so different between Motif and Athena */
typedef struct {
    int      reason;
    XEvent * event;
    int      value;
    int      pixel;
} scrollbarCallbackStruct;


typedef void (*scrollbarCallbackProc)(/* Widget, caddr_t closure,
                                         scrollbarCallbackStruct call_data */);


/* Inline functions */
#define         scrollbar__get_value( scrollbar) ((scrollbar)->value)

/* Regular functions */
scrollbar_type  scrollbar__create(/* Widget w */);
void            scrollbar__destroy(/* scrollbar_type scrollbar */);
void            scrollbar__set_value(/* scrollbar_type *, int value */);
void            scrollbar__add_callback(/* scrollbar, proc, closure*/);


#endif