~ubuntu-branches/ubuntu/quantal/openmotif/quantal

« back to all changes in this revision

Viewing changes to demos/programs/Ext18List/ext18list.c

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Bauer
  • Date: 2010-06-23 12:12:31 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100623121231-u89gxdp51sg9wjj2
Tags: 2.3.0-1
* New Maintainer (Closes: #379258) 
* Acknowledge NMU changes
* New upstream release (Closes: #494375)
* Get rid of security patches as they are already part of new upstream
  release (00-xpmvuln.openmotif.patch, 342092-CVE-2005-3964.patch)
* Bump Standards to 3.8.4
* Added {misc:Depends} to make the package lintian cleaner
* Fix weak-library-dev-dependency by adding ${binary:Version}) for the
  -dev Package of openmotif
* Let package depend on autotools-dev to use newer autotools-helper-files
* Work around an autoconf-bug (Gentoo-Bug #1475)
* Added Client-side anti-aliased fonts support via XFT
* Added UTF-8 and UTF8_STRING atom support
* Ability to show text and pixmaps in Label, LabelGadget and all
  derived widgets
* Support of PNG/JPEG image formats in the same way as XPM is supported
* Increase FILE_OFFSET_BITS to 64 to show files >2GB in file-selector
  Idea taken from Magne Oestlyngen (Closes: #288537)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 1994, Integrated Computer Solutions, Inc.
 
3
 *
 
4
 * All Rights Reserved.
 
5
 *
 
6
 * Author: Rick Umali
 
7
 *
 
8
 * MultiList.c
 
9
 *
 
10
 */
 
11
 
 
12
/**************************************************************
 
13
 *              INCLUDE FILES
 
14
 **************************************************************/
 
15
#include <stdio.h>
 
16
 
 
17
#include <Xm/Xm.h>
 
18
#include <Xm/Text.h>
 
19
#include <Xm/PushB.h>
 
20
#include <Xm/ToggleB.h>
 
21
#include <Xm/MultiList.h>
 
22
#include "extlist.h"
 
23
#include <pixmaps/crab.xpm>
 
24
#include <pixmaps/stopsign.xpm>
 
25
#include <pixmaps/porsche.xpm>
 
26
#include <pixmaps/clown.xbm>
 
27
 
 
28
/**************************************************************
 
29
 *              GLOBALS
 
30
 **************************************************************/
 
31
Widget G_extlist = NULL;
 
32
Pixmap porsche_pix;
 
33
Pixmap stopsign_pix; 
 
34
Pixmap crab_pix;
 
35
Pixmap clown_pix;
 
36
 
 
37
PlayerData players[] = {
 
38
/*   Name      AB   R    H   RBI   AVG   HR */
 
39
{ PPORSCHE, "Mo Vaughn", 159, 30,  55, 33, 346, 11 },
 
40
{ PCLOWN, "Tim Naehring", 133, 25, 43, 27, 323, 6 },
 
41
{ PSTOP, "Scott Cooper", 139, 24, 43, 30, 309, 9 },
 
42
{ PCLOWN, "John Valentin", 78, 12, 22, 11, 282, 2 },
 
43
{ PSTOP, "Carlos Rodriguez", 39, 2, 11, 4, 282, 1},
 
44
{ PCLOWN, "Otis Nixon", 148, 23, 41, 13, 277, 0},    
 
45
{ PSTOP, "Scott Fletcher", 80, 13, 21, 8, 263, 2},
 
46
{ PCLOWN, "Andre Dawson", 134, 19, 33, 27, 246, 10},
 
47
{ PPORSCHE, "Damon Berryhill", 72, 4, 17, 6, 236, 1},
 
48
{ PPORSCHE, "Billy Hatcher", 139, 23, 32, 15, 230, 1},
 
49
{ PCLOWN, "Mike Greenwell", 151, 31, 35, 25, 232, 7},
 
50
{ PSTOP, "Rich Rowland", 28, 1, 6, 6, 214, 1},
 
51
{ PCLOWN, "Lee Tinsley", 34, 10, 7, 2, 206, 0},
 
52
{ PPORSCHE, "Dave Valle", 72, 5, 11, 4, 153, 1},
 
53
};
 
54
 
 
55
/**************************************************************
 
56
 *              FORWARD DECLARATIONS
 
57
 **************************************************************/
 
58
Widget Createform(Widget, DemoInfo);
 
59
static void QuitCB(Widget, XtPointer, XtPointer);
 
60
 
 
61
/**************************************************************
 
62
 *              DEFINES
 
63
 **************************************************************/
 
64
 
 
65
/**************************************************************
 
66
 *              FALLBACKS
 
67
 **************************************************************/
 
68
static String fallbacks[] = {
 
69
    /*
 
70
     * General fallback resources.
 
71
     */
 
72
    "*background: grey",
 
73
    "*rightPane*background: grey",
 
74
    "*fontList: -*-helvetica-medium-r-*-*-*-140-*-*-*-*-*-*",
 
75
    "*explain_label*fontList: -*-helvetica-bold-r-*-*-*-140-*-*-*-*-*-*",
 
76
    "*explain_label*marginWidth: 10",
 
77
    "*explain_label*marginHeight: 10",
 
78
    "*rem_label.alignment: XmALIGNMENT_BEGINNING",
 
79
    "*rem_label.labelString: Remove Player",
 
80
    "*add_label.labelString: Add Player   ",
 
81
    "*add_label.alignment: XmALIGNMENT_BEGINNING",
 
82
    "*rem_pb.labelString: No Selected Player",
 
83
    "*unsel_pb.labelString: Unselect Current",
 
84
    "*firstRowCol.labelString: Go to Row 2, 1",
 
85
    "*toggleFind.labelString: Toggle Finder",
 
86
    "*quit_pb.labelString: Quit",
 
87
    "*MultiList.title: Red Sox Line Up Card",
 
88
    "*multilistWidget*title: Line Up",
 
89
    "*playerone.labelString: Mo Vaughn",
 
90
    "*playertwo.labelString: Tim Naehring",
 
91
    "*playerthree.labelString: Scott Cooper",
 
92
    "*playerfour.labelString: John Valentin",
 
93
    "*playerfive.labelString: Carlos Rodriguez",
 
94
    "*playersix.labelString: Otis Nixon",
 
95
    "*playerseven.labelString: Scott Fletcher",
 
96
    "*playereight.labelString: Andre Dawon",
 
97
    "*playernine.labelString: Damon Berryhill",
 
98
    "*playerten.labelString: Billy Hatcher",
 
99
    "*playereleven.labelString: Mike Greenwell",
 
100
    "*playertwelve.labelString: Rich Rowland",
 
101
    "*playerthirteen.labelString: Lee Tinsley",
 
102
    "*playerfourteen.labelString: Dave Valle",
 
103
    "*ext18listWidget*background: White",
 
104
    "*list*background: White",
 
105
    NULL,
 
106
};
 
107
 
 
108
/**************************************************************
 
109
 *              CALLBACKS
 
110
 **************************************************************/
 
111
/*
 
112
 * Function Name: InitializeData
 
113
 * Description:   
 
114
 * Arguments:     
 
115
 * Returns:       nothing
 
116
 *
 
117
 */
 
118
void
 
119
InitializeData(shell )
 
120
Widget shell;
 
121
{
 
122
  porsche_pix = XPM_PIXMAP(shell, porsche);
 
123
  crab_pix = XPM_PIXMAP(shell, crab);
 
124
  stopsign_pix = XPM_PIXMAP(shell, stopsign);
 
125
  clown_pix = XCreateBitmapFromData(XtDisplay(shell),
 
126
                                RootWindowOfScreen(XtScreen(shell)),
 
127
                                clown_bits, clown_width, clown_height);
 
128
 
 
129
}
 
130
 
 
131
/**************************************************************
 
132
 *              PUBLIC (GLOBAL) CODE
 
133
 **************************************************************/
 
134
/*
 
135
 * Function Name: main
 
136
 * Description:   
 
137
 * Arguments:     the usual suspects
 
138
 * Returns:       nothing
 
139
 *
 
140
 */
 
141
int
 
142
main(int argc, char **argv)
 
143
{
 
144
    Widget top, demo;
 
145
    XtAppContext app;
 
146
    DemoInfo demo_info = (DemoInfo)XtMalloc( sizeof(DemoStruct));
 
147
 
 
148
    XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); 
 
149
 
 
150
    
 
151
    top = XtOpenApplication(
 
152
            &app, 
 
153
            "MultiList", 
 
154
            NULL, 
 
155
            0,
 
156
            &argc, 
 
157
            argv, 
 
158
            fallbacks,
 
159
            sessionShellWidgetClass,
 
160
            NULL, 0);
 
161
 
 
162
    demo = Createform(top, demo_info);
 
163
 
 
164
    XtManageChild(demo);
 
165
 
 
166
    InitializeData(top);
 
167
 
 
168
    XtRealizeWidget(top);
 
169
 
 
170
    XtAppMainLoop(app);
 
171
    return(0);
 
172
}
 
173