~ubuntu-branches/ubuntu/precise/gcalctool/precise-proposed

« back to all changes in this revision

Viewing changes to src/math-display.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-03-21 15:09:58 UTC
  • mfrom: (1.3.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20110321150958-ye9bm6c1k38r4llu
Tags: 5.91.92-0ubuntu1
* New upstream release
  - Fixes (LP: #736632)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  Copyright (c) 2008-2009 Robert Ancell
2
 
 *
3
 
 *  This program is free software; you can redistribute it and/or modify
4
 
 *  it under the terms of the GNU General Public License as published by
5
 
 *  the Free Software Foundation; either version 2, or (at your option)
6
 
 *  any later version.
7
 
 *
8
 
 *  This program is distributed in the hope that it will be useful, but
9
 
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
 
 *  General Public License for more details.
12
 
 *
13
 
 *  You should have received a copy of the GNU General Public License
14
 
 *  along with this program; if not, write to the Free Software
15
 
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
16
 
 *  02111-1307, USA.
 
1
/*
 
2
 * Copyright (C) 2008-2011 Robert Ancell
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it under
 
5
 * the terms of the GNU General Public License as published by the Free Software
 
6
 * Foundation, either version 2 of the License, or (at your option) any later
 
7
 * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
 
8
 * license.
17
9
 */
18
10
 
19
11
#include <string.h>
211
203
        switch(event->keyval)
212
204
        {
213
205
        case GDK_KEY_0:
 
206
        case GDK_KEY_KP_0:
214
207
            math_equation_insert(display->priv->equation, "⁰");
215
208
            return TRUE;
216
209
        case GDK_KEY_1:
 
210
        case GDK_KEY_KP_1:
217
211
            math_equation_insert(display->priv->equation, "¹");
218
212
            return TRUE;
219
213
        case GDK_KEY_2:
 
214
        case GDK_KEY_KP_2:
220
215
            math_equation_insert(display->priv->equation, "²");
221
216
            return TRUE;
222
217
        case GDK_KEY_3:
 
218
        case GDK_KEY_KP_3:
223
219
            math_equation_insert(display->priv->equation, "³");
224
220
            return TRUE;
225
221
        case GDK_KEY_4:
 
222
        case GDK_KEY_KP_4:
226
223
            math_equation_insert(display->priv->equation, "⁴");
227
224
            return TRUE;
228
225
        case GDK_KEY_5:
 
226
        case GDK_KEY_KP_5:
229
227
            math_equation_insert(display->priv->equation, "⁵");
230
228
            return TRUE;
231
229
        case GDK_KEY_6:
 
230
        case GDK_KEY_KP_6:
232
231
            math_equation_insert(display->priv->equation, "⁶");
233
232
            return TRUE;
234
233
        case GDK_KEY_7:
 
234
        case GDK_KEY_KP_7:
235
235
            math_equation_insert(display->priv->equation, "⁷");
236
236
            return TRUE;
237
237
        case GDK_KEY_8:
 
238
        case GDK_KEY_KP_8:
238
239
            math_equation_insert(display->priv->equation, "⁸");
239
240
            return TRUE;
240
241
        case GDK_KEY_9:
 
242
        case GDK_KEY_KP_9:
241
243
            math_equation_insert(display->priv->equation, "⁹");
242
244
            return TRUE;
243
245
        }
246
248
        switch(event->keyval)
247
249
        {
248
250
        case GDK_KEY_0:
 
251
        case GDK_KEY_KP_0:
249
252
            math_equation_insert(display->priv->equation, "₀");
250
253
            return TRUE;
251
254
        case GDK_KEY_1:
 
255
        case GDK_KEY_KP_1:
252
256
            math_equation_insert(display->priv->equation, "₁");
253
257
            return TRUE;
254
258
        case GDK_KEY_2:
 
259
        case GDK_KEY_KP_2:
255
260
            math_equation_insert(display->priv->equation, "₂");
256
261
            return TRUE;
257
262
        case GDK_KEY_3:
 
263
        case GDK_KEY_KP_3:
258
264
            math_equation_insert(display->priv->equation, "₃");
259
265
            return TRUE;
260
266
        case GDK_KEY_4:
 
267
        case GDK_KEY_KP_4:
261
268
            math_equation_insert(display->priv->equation, "₄");
262
269
            return TRUE;
263
270
        case GDK_KEY_5:
 
271
        case GDK_KEY_KP_5:
264
272
            math_equation_insert(display->priv->equation, "₅");
265
273
            return TRUE;
266
274
        case GDK_KEY_6:
 
275
        case GDK_KEY_KP_6:
267
276
            math_equation_insert(display->priv->equation, "₆");
268
277
            return TRUE;
269
278
        case GDK_KEY_7:
 
279
        case GDK_KEY_KP_7:
270
280
            math_equation_insert(display->priv->equation, "₇");
271
281
            return TRUE;
272
282
        case GDK_KEY_8:
 
283
        case GDK_KEY_KP_8:
273
284
            math_equation_insert(display->priv->equation, "₈");
274
285
            return TRUE;
275
286
        case GDK_KEY_9:
 
287
        case GDK_KEY_KP_9:
276
288
            math_equation_insert(display->priv->equation, "₉");
277
289
            return TRUE;
278
290
        }