~ubuntu-branches/ubuntu/utopic/mancala/utopic

« back to all changes in this revision

Viewing changes to debian/patches/fix-libforms2-issue.patch

  • Committer: Package Import Robot
  • Author(s): Paul Wise
  • Date: 2013-07-04 18:05:39 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704180539-ikmk1o105k56musi
Tags: 1.0.3-1
* New upstream release
  - All patches merged 
* Use canonical Vcs-Svn URL
* Bump Standards-Version, no changes needed
* Wrap and sort various files
* Use the upstream mancala-text and manual page
* Improve the watch file a bit
* Add a longtitle to the menu file
* Add a freedesktop menu file
* Add an upstream information file
* Switch to priority optional
* Install the NEWS file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: Fix issues with new libforms
2
 
Author: Jens Thoms Toerring <jt@toerring.de>
3
 
Bug-Debian: http://bugs.debian.org/620634
4
 
Bug-Ubuntu: https://bugs.launchpad.net/bugs/904629
5
 
Forwarded: Sverre H. Huseby <shh@thathost.com>
6
 
--- a/xform.fd
7
 
+++ b/xform.fd
8
 
@@ -11,7 +11,7 @@
9
 
 Name: mancala
10
 
 Width: 530
11
 
 Height: 220
12
 
-Number of Objects: 44
13
 
+Number of Objects: 45
14
 
 
15
 
 --------------------
16
 
 class: FL_BOX
17
 
@@ -805,6 +805,24 @@
18
 
 callback: 
19
 
 argument: 
20
 
 
21
 
+--------------------
22
 
+class: FL_BUTTON
23
 
+type: NORMAL_BUTTON
24
 
+box: 0 0 0 0
25
 
+boxtype: FL_UP_BOX
26
 
+colors: FL_COL1 FL_COL1
27
 
+alignment: FL_ALIGN_CENTER
28
 
+style: FL_NORMAL_STYLE
29
 
+size: FL_DEFAULT_SIZE
30
 
+lcol: FL_BLACK
31
 
+label: 
32
 
+shortcut: 
33
 
+resize: FL_RESIZE_NONE
34
 
+gravity: FL_NoGravity FL_NoGravity
35
 
+name: dummyButton
36
 
+callback: 
37
 
+argument: 
38
 
+
39
 
 =============== FORM ===============
40
 
 Name: rules
41
 
 Width: 505
42
 
@@ -852,7 +870,7 @@
43
 
 type: NORMAL_BROWSER
44
 
 box: 10 10 485 255
45
 
 boxtype: FL_DOWN_BOX
46
 
-colors: FL_COL1 FL_YELLOW
47
 
+colors: FL_WHITE FL_YELLOW
48
 
 alignment: FL_ALIGN_BOTTOM
49
 
 style: FL_NORMAL_STYLE
50
 
 size: FL_DEFAULT_SIZE
51
 
--- a/xmain.c
52
 
+++ b/xmain.c
53
 
@@ -46,7 +46,7 @@
54
 
 static FL_OBJECT  *frmMancala[2];
55
 
 static FL_OBJECT  *frmHole[2][MAX_HOLES];
56
 
 static FL_OBJECT  *frmLight[2][MAX_HOLES];
57
 
-static char       playerName[2][20] = { "the human player", "the computer" };
58
 
+static const char *playerName[2] = { "the human player", "the computer" };
59
 
 static int        maxPly[2] = { 0, 4 };
60
 
 static int        rulesDisplayed = 0;
61
 
 static int        stones_pr_hole = STONES_PR_HOLE;
62
 
@@ -236,16 +236,6 @@
63
 
     fl_set_object_label(frm->winT, "");
64
 
 }
65
 
 
66
 
-static void niceDoForms(void)
67
 
-{
68
 
-    FL_OBJECT *obj;
69
 
-    XEvent xev;
70
 
-    
71
 
-    obj = fl_do_forms();
72
 
-    if (obj == FL_EVENT)
73
 
-       fl_XNextEvent(&xev);
74
 
-}
75
 
-
76
 
 static void formHandler(void)
77
 
 {
78
 
     PMove  move;
79
 
@@ -266,7 +256,7 @@
80
 
            } else {
81
 
                if (!maxPly[player]) {
82
 
                    setMessage("It's %s to move", playerName[player]);
83
 
-                   niceDoForms();
84
 
+                   fl_do_forms();
85
 
                    move = &move2;
86
 
                    if (moveHole >= 0) {
87
 
                        if (movePlayer == player) {
88
 
@@ -293,19 +283,10 @@
89
 
                }
90
 
            }
91
 
        } else
92
 
-           niceDoForms();
93
 
+           fl_do_forms();
94
 
     }
95
 
 }
96
 
 
97
 
-/* Dirty trick to make fl_do_forms() return */
98
 
-static void formWakeup(void)
99
 
-{
100
 
-    XEvent xev;
101
 
-    
102
 
-    xev.type = ClientMessage;
103
 
-    fl_XPutBackEvent(&xev);
104
 
-}
105
 
-
106
 
 /**************************************************************************
107
 
  *                                                                        *
108
 
  *                    P U B L I C    F U N C T I O N S                    *
109
 
@@ -350,7 +331,7 @@
110
 
        movePlayer = player;
111
 
        moveHole = hole;
112
 
     }
113
 
-    formWakeup();
114
 
+    fl_trigger_object(frm->dummyButton);
115
 
 }
116
 
 
117
 
 void doLevel(FL_OBJECT *ob, long arg)
118
 
@@ -367,7 +348,7 @@
119
 
 void doNewGame(FL_OBJECT *ob, long arg)
120
 
 {
121
 
     ourInitGame(arg);
122
 
-    formWakeup();
123
 
+    fl_trigger_object(frm->dummyButton);
124
 
 }
125
 
 
126
 
 void doQuit(FL_OBJECT *ob, long arg)
127
 
--- a/Makefile
128
 
+++ b/Makefile
129
 
@@ -27,15 +27,19 @@
130
 
 OBJS           = minimax.o mancala.o
131
 
 
132
 
 # Object files used by xmancala
133
 
-XOBJS          = xform.o rulestxt.o
134
 
+XSRCS          = xform.c rulestxt.c
135
 
+XOBJS          = $(XSRCS:.c=.o)
136
 
 
137
 
 
138
 
 all: $(TARGETS)
139
 
 
140
 
+%.c %.h: %.fd
141
 
+       fdesign -convert $<
142
 
+
143
 
 mancala: textmain.o $(OBJS)
144
 
        $(CC) $(CCOPT) -o $@ textmain.o $(OBJS) $(LDOPT) $(LIBS)
145
 
 
146
 
-xmancala: xmain.o $(XOBJS) $(OBJS)
147
 
+xmancala: $(XOBJS) xmain.o $(OBJS)
148
 
        $(CC) $(CCOPT) -o $@ xmain.o $(XOBJS) $(OBJS) \
149
 
                $(LDOPT) $(XLIBDIR) $(XLIBS)
150
 
 
151
 
@@ -43,7 +47,7 @@
152
 
        $(CC) -o $@ -c $(CCOPT) $<
153
 
 
154
 
 clean:
155
 
-       rm -f *.o core depend *~
156
 
+       rm -f *.o core depend *~  xform.c xform.h
157
 
 
158
 
 veryclean: clean
159
 
        rm -f $(TARGETS) $(DIST)-$(VERSION).tar.gz
160
 
@@ -63,7 +67,7 @@
161
 
                  Makefile Makefile.bcc \
162
 
                  mancala.c mancala.h minimax.c minimax.h \
163
 
                  textmain.c \
164
 
-                 xform.c xform.h xform.fd xmain.c rulestxt.c
165
 
+                 xform.fd xmain.c rulestxt.c
166
 
 
167
 
 $(LSMFILE): FORCE
168
 
        VER=$(VERSION); \