Previous 15994 Revisions Next

r1040 Thursday 27th September, 2007 at 15:02:23 UTC by Nathan Woods
Miscellaneous changes (UNICODE=1, Win64, UNUSED_FUNCTION) [Oliver Stoeneberg]
[src/mess/osd/windows]dialog.c
[src/mess/tools/imgtool]concept.c fat.c mac.c ti99.c ti990hd.c
[src/mess/tools/messtest]core.c testmess.c
[src/osd/winui]m32opts.c properties.c win32ui.c

src/osd/winui/win32ui.c
r1039r1040
29662966   iHeight = rect.bottom - rect.top - 2;
29672967
29682968   // create Edit Control
2969   CreateWindowEx( 0L, TEXT("Edit"), SEARCH_PROMPT, WS_CHILD | WS_BORDER | WS_VISIBLE | ES_LEFT,
2969   win_create_window_ex_utf8( 0L, "Edit", SEARCH_PROMPT, WS_CHILD | WS_BORDER | WS_VISIBLE | ES_LEFT,
29702970               iPosX, iPosY, 200, iHeight, hToolBar, (HMENU)ID_TOOLBAR_EDIT, hInst, NULL );
29712971
29722972   return hToolBar;
r1039r1040
41334133      {
41344134         char buf[256];
41354135
4136         Edit_GetText(hwndCtl, buf, sizeof(buf));
4136         win_get_window_text_utf8(hwndCtl, buf, sizeof(buf));
41374137         switch (codeNotify)
41384138         {
41394139         case EN_CHANGE:
r1039r1040
41514151            break;
41524152         case EN_SETFOCUS:
41534153            if (!_stricmp(buf, SEARCH_PROMPT))
4154               SetWindowText(hwndCtl, "");
4154               win_set_window_text_utf8(hwndCtl, "");
41554155            break;
41564156         case EN_KILLFOCUS:
41574157            if (strlen(buf) == 0)
4158               SetWindowText(hwndCtl, SEARCH_PROMPT);
4158               win_set_window_text_utf8(hwndCtl, SEARCH_PROMPT);
41594159            break;
41604160         }
41614161      }
r1039r1040
50485048                       ILC_COLORDDB | ILC_MASK, icon_count, icon_count + 5000);
50495049
50505050   if (NULL == hSmall || NULL == hLarge) {
5051      MessageBox(hwndList, "Cannot allocate Icon lists", TEXT("Allocation error - Exiting"), IDOK);
5051      win_message_box_utf8(hwndList, "Cannot allocate Icon lists", "Allocation error - Exiting", IDOK);
50525052      PostQuitMessage(0);
50535053   }
50545054
src/osd/winui/m32opts.c
r1039r1040
29602960   WIN32_FIND_DATA findFileData;
29612961   HANDLE hFindFile;
29622962   astring *pathname, *match;
2963   char* utf8_filename;
29632964
29642965   /*
29652966    * Easiest to just open the ini/source folder if it exists,
r1039r1040
29702971   if ((hFindFile = win_find_first_file_utf8(astring_c(match), &findFileData)) != INVALID_HANDLE_VALUE)
29712972   {
29722973      astring_free(match);
2973      match = astring_assemble_3(astring_alloc(), astring_c(pathname), PATH_SEPARATOR, findFileData.cFileName );
2974      utf8_filename = utf8_from_tstring(findFileData.cFileName);
2975      match = astring_assemble_3(astring_alloc(), astring_c(pathname), PATH_SEPARATOR, utf8_filename );
2976      free(utf8_filename);
29742977      osd_rmfile(astring_c(match));
29752978      astring_free(match);
29762979
29772980      while (0 != FindNextFile(hFindFile, &findFileData))
29782981      {
2979         match = astring_assemble_3(astring_alloc(), astring_c(pathname), PATH_SEPARATOR, findFileData.cFileName );
2982         utf8_filename = utf8_from_tstring(findFileData.cFileName);
2983         match = astring_assemble_3(astring_alloc(), astring_c(pathname), PATH_SEPARATOR, utf8_filename );
2984         free(utf8_filename);
29802985         osd_rmfile(astring_c(match));
29812986         astring_free(match);
29822987      }
src/osd/winui/properties.c
r1039r1040
12301230            g_bUseDefaults = options_equal(pCurrentOpts, pDefaultOpts);
12311231
12321232            ResetDataMap(hDlg);
1233            SetWindowLong(hDlg, DWL_MSGRESULT, FALSE);
1233            SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE);
12341234            return 1; 
12351235
12361236         case PSN_RESET:
12371237            // Reset to the original values. Disregard changes
12381238            options_copy(pCurrentOpts, pOrigOpts);
1239            SetWindowLong(hDlg, DWL_MSGRESULT, FALSE);
1239            SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE);
12401240            break;
12411241
12421242         case PSN_HELP:
src/mess/tools/messtest/testmess.c
r1039r1040
11151115}
11161116
11171117
1118
1118#ifdef UNUSED_FUNCTION
11191119static void command_end_handler(const void *buffer, size_t size)
11201120{
11211121   if (!append_command())
r1039r1040
11241124      return;
11251125   }
11261126}
1127#endif
11271128
11281129
1129
11301130static void node_wait(xml_data_node *node)
11311131{
11321132   xml_attribute_node *attr_node;
r1039r1040
14351435}
14361436
14371437
1438
1438#ifdef UNUSED_FUNCTION
14391439static void verify_end_handler(const void *buffer, size_t size)
14401440{
14411441   void *new_buffer;
r1039r1040
14521452      return;
14531453   }
14541454}
1455#endif
14551456
14561457
1457
14581458static void node_trace(xml_data_node *node)
14591459{
14601460   /* <trace> - emit a trace file */
src/mess/tools/messtest/core.c
r1039r1040
436436}
437437
438438
439
439#ifdef UNUSED_FUNCTION
440440static size_t parse_read(void *param, void *buffer, size_t length)
441441{
442442   return fread(buffer, 1, length, (FILE *) param);
r1039r1040
448448{
449449   return feof((FILE *) param);
450450}
451#endif
451452
452453
453
454454static void node_tests(xml_data_node *tests_node, int *test_count, int *failure_count)
455455{
456456   xml_data_node *child_node;
src/mess/tools/imgtool/ti99.c
r1039r1040
36533653   }
36543654}
36553655
3656#ifdef UNUSED_FUNCTION
36563657static void current_date_time(ti99_date_time *reply)
36573658{
36583659   /* All these functions should be ANSI */
r1039r1040
36643665   reply->date_MSB = ((expanded_time.tm_year % 100) << 1) | ((expanded_time.tm_mon+1) >> 3);
36653666   reply->date_LSB = ((expanded_time.tm_mon+1) << 5) | expanded_time.tm_mday;
36663667}
3668#endif
36673669
36683670#if 0
36693671#pragma mark -
r1039r1040
36883690   int cur_pos_in_phys_rec;
36893691} ti99_lvl3_fileref;
36903692
3693#ifdef UNUSED_FUNCTION
36913694/*
36923695   Open a file on level 3.
36933696
r1039r1040
37343737   int errorcode;
37353738   UINT8 physrec_buf[256];
37363739   int reclen;
3737   int flags = get_file_flags(&l3_file->l2_file);
3740   int flags = get_file_flags(&l3_fil e->l2_file);
37383741   int fphysrecs = get_file_fphysrecs(&l3_file->l2_file);
37393742   int fdr_eof = get_file_eof(&l3_file->l2_file);
37403743
r1039r1040
37993802
38003803   return 0;
38013804}
3805#endif
38023806
38033807#if 0
38043808#pragma mark -
src/mess/tools/imgtool/ti990hd.c
r1039r1040
393393static imgtoolerr_t ti990_image_nextenum(imgtool_directory *enumeration, imgtool_dirent *ent);
394394static void ti990_image_closeenum(imgtool_directory *enumeration);
395395static imgtoolerr_t ti990_image_freespace(imgtool_partition *partition, UINT64 *size);
396#ifdef UNUSED_FUNCTION
396397static imgtoolerr_t ti990_image_readfile(imgtool_partition *partition, const char *fpath, imgtool_stream *destf);
397398static imgtoolerr_t ti990_image_writefile(imgtool_partition *partition, const char *fpath, imgtool_stream *sourcef, option_resolution *writeoptions);
398399static imgtoolerr_t ti990_image_deletefile(imgtool_partition *partition, const char *fpath);
400#endif
399401static imgtoolerr_t ti990_image_create(imgtool_image *image, imgtool_stream *f, option_resolution *createoptions);
400402
401403enum
r1039r1040
445447   }
446448}
447449
448
450#ifdef UNUSED_FUNCTION
449451/*
450452   Convert a C string to a 8-character file name (padded with spaces if necessary)
451453*/
r1039r1040
471473      i++;
472474   }
473475}
476#endif
474477
475478/*
476479   Convert a 8-character file name to a C string (removing trailing spaces if necessary)
r1039r1040
547550   return 0;
548551}
549552
553#ifdef UNUSED_FUNCTION
550554/*
551555   Read one sector from a disk image
552556
r1039r1040
559563{
560564   return read_sector_physical_len(file_handle, address, geometry, dest, geometry->bytes_per_sector);
561565}
566#endif
562567
563568/*
564569   Write one sector to a disk image
r1039r1040
596601   return 0;
597602}
598603
604#ifdef UNUSED_FUNCTION
599605/*
600606   Write one sector to a disk image
601607
r1039r1040
608614{
609615   return write_sector_physical_len(file_handle, address, geometry, src, geometry->bytes_per_sector);
610616}
617#endif
611618
612619/*
613620   Convert logical sector address to physical sector address
r1039r1040
639646   return read_sector_physical_len(file_handle, &address, geometry, dest, len);
640647}
641648
649#ifdef UNUSED_FUNCTION
642650/*
643651   Read one sector from a disk image
644652
r1039r1040
651659{
652660   return read_sector_logical_len(file_handle, secnum, geometry, dest, geometry->bytes_per_sector);
653661}
662#endif
654663
655664/*
656665   Write one sector to a disk image
r1039r1040
689698#pragma mark CATALOG FILE ROUTINES
690699#endif
691700
701#ifdef UNUSED_FUNCTION
692702/*
693703   Find the catalog entry and fdr record associated with a file name
694704
r1039r1040
822832
823833   return 0;
824834}
835#endif
825836
826837#if 0
827838/*
r1039r1040
14361447   return IMGTOOLERR_SUCCESS;
14371448}
14381449
1450#ifdef UNUSED_FUNCTION
14391451/*
14401452   Extract a file from a ti990_image.
14411453*/
r1039r1040
17451757
17461758   return 0;
17471759}
1760#endif
17481761
17491762/*
17501763   Create a blank ti990_image.
src/mess/tools/imgtool/mac.c
r1039r1040
582582   memcpy(dest, src, src[0]+1);
583583}
584584
585#ifdef UNUSED_FUNCTION
585586/*
586587   mac_strncpy()
587588
r1039r1040
601602   dest[0] = len;
602603   memcpy(dest+1, src+1, len);
603604}
605#endif
604606
605607/*
606608   disk image reference
r1039r1040
10491051                        /* (DV17 says "disk block number", but it cannot be true) */
10501052} floppy_tag_record;
10511053
1054#ifdef UNUSED_FUNCTION
10521055static void hfs_image_close(mac_l2_imgref *l2_img);
1056#endif
10531057static imgtoolerr_t mfs_file_get_nth_block_address(mac_fileref *fileref, UINT32 block_num, UINT32 *block_address);
10541058static imgtoolerr_t hfs_file_get_nth_block_address(mac_fileref *fileref, UINT32 block_num, UINT32 *block_address);
10551059static imgtoolerr_t mfs_lookup_path(mac_l2_imgref *l2_img, const char *fpath, mac_str255 filename, mac_dirent *cat_info, int create_it);
r1039r1040
10651069}
10661070
10671071
1068
1072#ifdef UNUSED_FUNCTION
10691073/*
10701074   mac_image_close
10711075
r1039r1040
10851089      break;
10861090   }
10871091}
1092#endif
10881093
10891094/*
10901095   mac_lookup_path
r1039r1040
13331338   return IMGTOOLERR_SUCCESS;
13341339}
13351340
1341#ifdef UNUSED_FUNCTION
13361342/*
13371343   mac_file_tell
13381344
r1039r1040
13491355
13501356   return IMGTOOLERR_SUCCESS;
13511357}
1358#endif
13521359
13531360/*
13541361   mac_file_seek
r1039r1040
27112718   return IMGTOOLERR_SUCCESS;
27122719}
27132720
2721#ifdef UNUSED_FUNCTION
27142722/*
27152723   mfs_hashString
27162724
r1039r1040
27462754
27472755   return reply;
27482756}
2757#endif
27492758
27502759#if 0
27512760#pragma mark -
r1039r1040
31143123   return IMGTOOLERR_SUCCESS;
31153124}
31163125
3126#ifdef UNUSED_FUNCTION
31173127/*
31183128   hfs_image_close
31193129
r1039r1040
31283138   BT_close(&l2_img->u.hfs.extents_BT);
31293139   BT_close(&l2_img->u.hfs.cat_BT);
31303140}
3141#endif
31313142
31323143/*
31333144   hfs_get_cat_record_data
r1039r1040
48864897                     /* This is actually part of the type list, which matters for offsets */
48874898} mac_resfileref;
48884899
4889
4900#ifdef UNUSED_FUNCTION
48904901/*
48914902   resfile_open
48924903
r1039r1040
51305141
51315142   return IMGTOOLERR_SUCCESS;
51325143}
5144#endif
51335145
51345146#if 0
51355147#pragma mark -
r1039r1040
51725184      many programs/comments
51735185*/
51745186
5187#ifdef UNUSED_FUNCTION
51755188/*
51765189   get_comment
51775190
r1039r1040
52295242   /* phew, we are done! */
52305243   return IMGTOOLERR_SUCCESS;
52315244}
5245#endif
52325246
52335247#if 0
52345248#pragma mark -
52355249#pragma mark IMGTOOL MODULE IMPLEMENTATION
52365250#endif
52375251
5252#ifdef UNUSED_FUNCTION
52385253static void mac_image_exit(imgtool_image *img);
5254#endif
52395255static void mac_image_info(imgtool_image *img, char *string, size_t len);
52405256static imgtoolerr_t mac_image_beginenum(imgtool_directory *enumeration, const char *path);
52415257static imgtoolerr_t mac_image_nextenum(imgtool_directory *enumeration, imgtool_dirent *ent);
r1039r1040
52435259static imgtoolerr_t mac_image_readfile(imgtool_partition *partition, const char *filename, const char *fork, imgtool_stream *destf);
52445260static imgtoolerr_t mac_image_writefile(imgtool_partition *partition, const char *filename, const char *fork, imgtool_stream *sourcef, option_resolution *writeoptions);
52455261
5262#ifdef UNUSED_FUNCTION
52465263/*
52475264   close a mfs/hfs image
52485265*/
r1039r1040
52525269
52535270   mac_image_close(image);
52545271}
5272#endif
52555273
52565274/*
52575275   get basic information on a mfs/hfs image
r1039r1040
55395557   return IMGTOOLERR_SUCCESS;
55405558}
55415559
5560#ifdef UNUSED_FUNCTION
55425561static imgtoolerr_t mac_get_comment(mac_l2_imgref *image, mac_str255 filename, const mac_dirent *cat_info, mac_str255 comment)
55435562{
55445563   imgtoolerr_t err = IMGTOOLERR_SUCCESS;
r1039r1040
55645583   }
55655584   return err;
55665585}
5586#endif
55675587
55685588
5569
55705589/*
55715590   Extract a file from a disk image.
55725591*/
src/mess/tools/imgtool/fat.c
r1039r1040
366366}
367367
368368
369
369#ifdef UNUSED_FUNCTION
370370static imgtoolerr_t fat_clear_sector(imgtool_partition *partition, UINT32 sector_index, UINT8 data)
371371{
372372   char buf[FAT_SECLEN];
373373   memset(buf, data, sizeof(buf));
374374   return fat_write_sector(partition, sector_index, 0, buf, sizeof(buf));
375375}
376#endif
376377
377378
378
379379static imgtoolerr_t fat_partition_open(imgtool_partition *partition, UINT64 first_block, UINT64 block_count)
380380{
381381   UINT8 header[FAT_SECLEN];
src/mess/tools/imgtool/concept.c
r1039r1040
192192   return 0;
193193}
194194
195#ifdef UNUSED_FUNCTION
195196/*
196197   write_physical_record
197198
r1039r1040
218219
219220   return 0;
220221}
222#endif
221223
222224/*
223225   Search for a file name on a concept_image
src/mess/osd/windows/dialog.c
r1039r1040
2727#include "invokegx.h"
2828#endif
2929
30
3130//============================================================
32//   These defines are necessary because the MinGW headers do
33//   not have the latest definitions
34//============================================================
3531
36#ifndef _WIN64
37#ifndef GetWindowLongPtr
38#define GetWindowLongPtr(hwnd, idx)         ((LONG_PTR) GetWindowLong((hwnd), (idx)))
39#endif
40
41#ifndef SetWindowLongPtr
42#define SetWindowLongPtr(hwnd, idx, val)   ((LONG_PTR) SetWindowLong((hwnd), (idx), (val)))
43#endif
44
45#ifndef GWLP_USERDATA
46#define GWLP_USERDATA                  GWL_USERDATA
47#endif
48
49#ifndef GWLP_WNDPROC
50#define GWLP_WNDPROC                  GWL_WNDPROC
51#endif
52#endif // _WIN64
53
54//============================================================
55
5632enum
5733{
5834   TRIGGER_INITDIALOG   = 1,
r1039r1040
136112#define DIM_SCROLLBAR_WIDTH      10
137113#define DIM_BOX_VERTSKEW      -3
138114
139#define WNDLONG_DIALOG         GWLP_USERDATA
140
141115#define DLGITEM_BUTTON         ((const WCHAR *) dlgitem_button)
142116#define DLGITEM_EDIT         ((const WCHAR *) dlgitem_edit)
143117#define DLGITEM_STATIC         ((const WCHAR *) dlgitem_static)
r1039r1040
262236   struct dialog_info_trigger *trigger;
263237   LONG l;
264238
265   l = GetWindowLongPtr(dlgwnd, WNDLONG_DIALOG);
239   l = GetWindowLongPtr(dlgwnd, GWLP_USERDATA);
266240   di = (struct _dialog_box *) l;
267241   assert(di);
268242   for (trigger = di->trigger_first; trigger; trigger = trigger->next)
r1039r1040
300274
301275   if (LOG_WINMSGS)
302276   {
303      logerror("dialog_proc(): dlgwnd=0x%08x msg=0x%08x wparam=0x%08x lparam=0x%08x\n",
304         (unsigned int) dlgwnd, (unsigned int) msg, (unsigned int) wparam, (unsigned int) lparam);
277      logerror("dialog_proc(): dlgwnd=%p msg=0x%08x wparam=0x%08x lparam=0x%08x\n",
278         dlgwnd, (unsigned int) msg, (unsigned int) wparam, (unsigned int) lparam);
305279   }
306280
307281   switch(msg)
308282   {
309283      case WM_INITDIALOG:
310         SetWindowLongPtr(dlgwnd, WNDLONG_DIALOG, (LONG_PTR) lparam);
284         SetWindowLongPtr(dlgwnd, GWLP_USERDATA, (LONG_PTR) lparam);
311285         dialog_trigger(dlgwnd, TRIGGER_INITDIALOG);
312286         break;
313287
r1039r1040
16651639      ofn = (OPENFILENAME *) lparam;
16661640      dialog = (dialog_box *) ofn->lCustData;
16671641
1668      SetWindowLongPtr(dlgwnd, WNDLONG_DIALOG, (LONG_PTR) dialog);
1642      SetWindowLongPtr(dlgwnd, GWLP_USERDATA, (LONG_PTR) dialog);
16691643      dialog_trigger(dlgwnd, TRIGGER_INITDIALOG);
16701644      rc = 1;
16711645
r1039r1040
16831657      }
16841658
16851659      // hack
1686      l = GetWindowLongPtr(dlgwnd, WNDLONG_DIALOG);
1660      l = GetWindowLongPtr(dlgwnd, GWLP_USERDATA);
16871661      dialog = (dialog_box *) l;
16881662      if (dialog->notify_callback && (notify->code == dialog->notify_code))
16891663         dialog->notify_callback(dialog, dlgwnd, notify, dialog->notify_param);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team