~ubuntu-branches/ubuntu/wily/sgt-puzzles/wily

« back to all changes in this revision

Viewing changes to gtk.c

  • Committer: Package Import Robot
  • Author(s): Ben Hutchings
  • Date: 2014-10-01 22:10:50 UTC
  • mfrom: (1.2.14)
  • Revision ID: package-import@ubuntu.com-20141001221050-a83g6j14c9dal6ek
Tags: 20140928.r10274-1
* New upstream version
  - Version scheme is now date-based
  - Fix a failure to warn about non-unique rows/columns in non-square Unruly
    grids (Closes: #718354)
* Add Debian menu entries for Range and Signpost
* debian/watch: Delete, as new versions are date-based and there is
  currently no obvious way to find the last date changed
* Disable 304_combine-binaries.diff which no longer applies
* Build using autotools
  - Drop patches 301_fix-install-dirs.diff, 305_no-werror.diff
* Exclude puzzles.chm from orig tarball because it requires non-free tools
  to regenerate from source
* Update policy version to 3.9.6; no changes required

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * gtk.c: GTK front end for my puzzle collection.
3
3
 */
4
4
 
5
 
#define _GNU_SOURCE
 
5
#ifndef _POSIX_C_SOURCE
 
6
#define _POSIX_C_SOURCE 1 /* for PATH_MAX */
 
7
#endif
6
8
 
7
9
#include <stdio.h>
8
10
#include <assert.h>
48
50
 
49
51
/* #undef USE_CAIRO */
50
52
/* #define NO_THICK_LINE */
51
 
 
52
 
#ifdef COMBINED
53
 
static const gameindex *thegameindex;
54
 
#define thegame (*thegameindex->game)
55
 
#define xpm_icons (thegameindex->xpm_icons)
56
 
#define n_xpm_icons (*thegameindex->n_xpm_icons)
57
 
#endif
58
 
 
59
53
#ifdef DEBUGGING
60
54
static FILE *debug_fp = NULL;
61
55
 
2200
2194
    GList *iconlist;
2201
2195
    int x, y, n;
2202
2196
    char errbuf[1024];
 
2197
    extern char *const *const xpm_icons[];
 
2198
    extern const int n_xpm_icons;
2203
2199
 
2204
2200
    fe = snew(frontend);
2205
2201
 
2593
2589
 
2594
2590
int main(int argc, char **argv)
2595
2591
{
2596
 
    char *pname;
2597
 
    int i;
 
2592
    char *pname = argv[0];
2598
2593
    char *error;
2599
2594
    int ngenerate = 0, print = FALSE, px = 1, py = 1;
2600
2595
    int time_generation = FALSE, test_solve = FALSE, list_presets = FALSE;
2610
2605
    char **av = argv;
2611
2606
    char errbuf[500];
2612
2607
 
2613
 
#ifdef COMBINED
2614
 
    pname = strrchr(argv[0], '/');
2615
 
    if (pname)
2616
 
        pname++;
2617
 
    else
2618
 
        pname = argv[0];
2619
 
    if (!strncmp(pname, "sgt-", 4))
2620
 
        pname += 4;
2621
 
    for (i = 0; i < gamecount; i++) {
2622
 
        size_t len = strlen(gamelist[i].name);
2623
 
        if (!strncmp(pname, gamelist[i].name, len) &&
2624
 
            (pname[len] == 0 || !strcmp(pname + len, "game"))) {
2625
 
            thegameindex = &gamelist[i];
2626
 
            break;
2627
 
        }
2628
 
    }
2629
 
    if (!thegameindex) {
2630
 
        fprintf(stderr, "puzzles: unknown puzzle '%s'\n", pname);
2631
 
        exit(2);
2632
 
    }
2633
 
#endif
2634
 
 
2635
2608
    /*
2636
2609
     * Command line parsing in this function is rather fiddly,
2637
2610
     * because GTK wants to have a go at argc/argv _first_ - and