~ubuntu-branches/ubuntu/maverick/vice/maverick

« back to all changes in this revision

Viewing changes to src/arch/win32/uifliplist.c

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2005-02-01 11:30:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050201113026-3eyakzsmmheclvjg
Tags: 1.16-1
* New upstream version
* Fixes crash on 64-bit architectures (closes: #287640)
* x128 working again (closes: #286767)
* Works fine with /dev/dsp in use (not in the main changelog, but tested
  on my local machine as working).  Presumably, this also takes care of
  the issue with dsp being held.  I'm not sure if this is because I'm
  testing it on a 2.6 kernel now -- if you are still having problems
  with /dev/dsp, please reopen the bugs. (closes: #152952, #207942)
* Don't kill Makefile.in on clean

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
#include <stdio.h>
30
30
#include <windows.h>
 
31
#include <tchar.h>
31
32
 
 
33
#include "archdep.h"
32
34
#include "fliplist.h"
33
35
#include "lib.h"
 
36
#include "res.h"
 
37
#include "system.h"
34
38
#include "ui.h"
35
39
#include "uilib.h"
36
 
 
37
 
 
38
 
void uifliplist_load_dialog(HWND hwnd)
39
 
{
40
 
    char *s;
41
 
 
42
 
    if ((s = ui_select_file(hwnd, "Load flip list file",
43
 
                            UI_LIB_FILTER_FLIPLIST,
44
 
                            FILE_SELECTOR_DEFAULT_STYLE, NULL)) != NULL) {
45
 
         if (flip_load_list((unsigned int)-1, s, 0) != 0)
46
 
             ui_error("Cannot read flip list file");
47
 
         lib_free(s);
48
 
    }
49
 
}
50
 
 
51
 
void uifliplist_save_dialog(HWND hwnd)
52
 
{
53
 
    char *s;
54
 
 
55
 
    if ((s = ui_select_file(hwnd, "Save flip list file",
56
 
                            UI_LIB_FILTER_FLIPLIST,
57
 
                            FILE_SELECTOR_DEFAULT_STYLE, NULL)) != NULL) {
58
 
         if (flip_save_list((unsigned int)-1, s) != 0)
59
 
             ui_error("Cannot write flip list file");
60
 
         lib_free(s);
 
40
#include "util.h"
 
41
 
 
42
 
 
43
static void uifliplist_load_dialog(HWND hwnd)
 
44
{
 
45
    TCHAR *st_name;
 
46
 
 
47
    if ((st_name = uilib_select_file(hwnd, TEXT("Load flip list file"),
 
48
        UILIB_FILTER_FLIPLIST, UILIB_SELECTOR_TYPE_FILE_LOAD,
 
49
        UILIB_SELECTOR_STYLE_DEFAULT)) != NULL) {
 
50
        char *name;
 
51
 
 
52
        name = system_wcstombs_alloc(st_name);
 
53
        if (fliplist_load_list((unsigned int)-1, name, 0) != 0)
 
54
            ui_error("Cannot read flip list file");
 
55
        system_wcstombs_free(name);
 
56
        lib_free(st_name);
 
57
    }
 
58
}
 
59
 
 
60
static void uifliplist_save_dialog(HWND hwnd)
 
61
{
 
62
    TCHAR *st_name;
 
63
 
 
64
    if ((st_name = uilib_select_file(hwnd, TEXT("Save flip list file"),
 
65
        UILIB_FILTER_FLIPLIST, UILIB_SELECTOR_TYPE_FILE_SAVE,
 
66
        UILIB_SELECTOR_STYLE_DEFAULT)) != NULL) {
 
67
        char *name;
 
68
 
 
69
        name = system_wcstombs_alloc(st_name);
 
70
 
 
71
        util_add_extension(&name, "vfl");
 
72
 
 
73
        if (fliplist_save_list((unsigned int)-1, name) != 0)
 
74
            ui_error("Cannot write flip list file");
 
75
        system_wcstombs_free(name);
 
76
        lib_free(st_name);
 
77
    }
 
78
}
 
79
 
 
80
void uifliplist_save_settings(void)
 
81
{
 
82
    char *fname = archdep_default_fliplist_file_name();
 
83
 
 
84
    fliplist_save_list((unsigned int) -1, fname);
 
85
    lib_free(fname);
 
86
}
 
87
 
 
88
void uifliplist_command(HWND hwnd, WPARAM wparam)
 
89
{
 
90
    switch (wparam) {
 
91
      case IDM_FLIP_ADD | 0x00010000:
 
92
      case IDM_FLIP_ADD:
 
93
        fliplist_add_image(8);
 
94
        break;
 
95
      case IDM_FLIP_REMOVE | 0x00010000:
 
96
      case IDM_FLIP_REMOVE:
 
97
        fliplist_remove(8, NULL);
 
98
        break;
 
99
      case IDM_FLIP_NEXT | 0x00010000:
 
100
      case IDM_FLIP_NEXT:
 
101
        fliplist_attach_head(8, 1);
 
102
        break;
 
103
      case IDM_FLIP_PREVIOUS | 0x00010000:
 
104
      case IDM_FLIP_PREVIOUS:
 
105
        fliplist_attach_head(8, 0);
 
106
        break;
 
107
      case IDM_FLIP_LOAD:
 
108
        uifliplist_load_dialog(hwnd);
 
109
        break;
 
110
      case IDM_FLIP_SAVE:
 
111
        uifliplist_save_dialog(hwnd);
 
112
        break;
61
113
    }
62
114
}
63
115