src/osd/winui/win32ui.c
| r1039 | r1040 | |
| 2966 | 2966 | iHeight = rect.bottom - rect.top - 2; |
| 2967 | 2967 | |
| 2968 | 2968 | // 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, |
| 2970 | 2970 | iPosX, iPosY, 200, iHeight, hToolBar, (HMENU)ID_TOOLBAR_EDIT, hInst, NULL ); |
| 2971 | 2971 | |
| 2972 | 2972 | return hToolBar; |
| r1039 | r1040 | |
| 4133 | 4133 | { |
| 4134 | 4134 | char buf[256]; |
| 4135 | 4135 | |
| 4136 | | Edit_GetText(hwndCtl, buf, sizeof(buf)); |
| 4136 | win_get_window_text_utf8(hwndCtl, buf, sizeof(buf)); |
| 4137 | 4137 | switch (codeNotify) |
| 4138 | 4138 | { |
| 4139 | 4139 | case EN_CHANGE: |
| r1039 | r1040 | |
| 4151 | 4151 | break; |
| 4152 | 4152 | case EN_SETFOCUS: |
| 4153 | 4153 | if (!_stricmp(buf, SEARCH_PROMPT)) |
| 4154 | | SetWindowText(hwndCtl, ""); |
| 4154 | win_set_window_text_utf8(hwndCtl, ""); |
| 4155 | 4155 | break; |
| 4156 | 4156 | case EN_KILLFOCUS: |
| 4157 | 4157 | if (strlen(buf) == 0) |
| 4158 | | SetWindowText(hwndCtl, SEARCH_PROMPT); |
| 4158 | win_set_window_text_utf8(hwndCtl, SEARCH_PROMPT); |
| 4159 | 4159 | break; |
| 4160 | 4160 | } |
| 4161 | 4161 | } |
| r1039 | r1040 | |
| 5048 | 5048 | ILC_COLORDDB | ILC_MASK, icon_count, icon_count + 5000); |
| 5049 | 5049 | |
| 5050 | 5050 | 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); |
| 5052 | 5052 | PostQuitMessage(0); |
| 5053 | 5053 | } |
| 5054 | 5054 | |
src/osd/winui/m32opts.c
| r1039 | r1040 | |
| 2960 | 2960 | WIN32_FIND_DATA findFileData; |
| 2961 | 2961 | HANDLE hFindFile; |
| 2962 | 2962 | astring *pathname, *match; |
| 2963 | char* utf8_filename; |
| 2963 | 2964 | |
| 2964 | 2965 | /* |
| 2965 | 2966 | * Easiest to just open the ini/source folder if it exists, |
| r1039 | r1040 | |
| 2970 | 2971 | if ((hFindFile = win_find_first_file_utf8(astring_c(match), &findFileData)) != INVALID_HANDLE_VALUE) |
| 2971 | 2972 | { |
| 2972 | 2973 | 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); |
| 2974 | 2977 | osd_rmfile(astring_c(match)); |
| 2975 | 2978 | astring_free(match); |
| 2976 | 2979 | |
| 2977 | 2980 | while (0 != FindNextFile(hFindFile, &findFileData)) |
| 2978 | 2981 | { |
| 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); |
| 2980 | 2985 | osd_rmfile(astring_c(match)); |
| 2981 | 2986 | astring_free(match); |
| 2982 | 2987 | } |
src/osd/winui/properties.c
| r1039 | r1040 | |
| 1230 | 1230 | g_bUseDefaults = options_equal(pCurrentOpts, pDefaultOpts); |
| 1231 | 1231 | |
| 1232 | 1232 | ResetDataMap(hDlg); |
| 1233 | | SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
| 1233 | SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE); |
| 1234 | 1234 | return 1; |
| 1235 | 1235 | |
| 1236 | 1236 | case PSN_RESET: |
| 1237 | 1237 | // Reset to the original values. Disregard changes |
| 1238 | 1238 | options_copy(pCurrentOpts, pOrigOpts); |
| 1239 | | SetWindowLong(hDlg, DWL_MSGRESULT, FALSE); |
| 1239 | SetWindowLongPtr(hDlg, DWLP_MSGRESULT, FALSE); |
| 1240 | 1240 | break; |
| 1241 | 1241 | |
| 1242 | 1242 | case PSN_HELP: |
src/mess/tools/imgtool/ti990hd.c
| r1039 | r1040 | |
| 393 | 393 | static imgtoolerr_t ti990_image_nextenum(imgtool_directory *enumeration, imgtool_dirent *ent); |
| 394 | 394 | static void ti990_image_closeenum(imgtool_directory *enumeration); |
| 395 | 395 | static imgtoolerr_t ti990_image_freespace(imgtool_partition *partition, UINT64 *size); |
| 396 | #ifdef UNUSED_FUNCTION |
| 396 | 397 | static imgtoolerr_t ti990_image_readfile(imgtool_partition *partition, const char *fpath, imgtool_stream *destf); |
| 397 | 398 | static imgtoolerr_t ti990_image_writefile(imgtool_partition *partition, const char *fpath, imgtool_stream *sourcef, option_resolution *writeoptions); |
| 398 | 399 | static imgtoolerr_t ti990_image_deletefile(imgtool_partition *partition, const char *fpath); |
| 400 | #endif |
| 399 | 401 | static imgtoolerr_t ti990_image_create(imgtool_image *image, imgtool_stream *f, option_resolution *createoptions); |
| 400 | 402 | |
| 401 | 403 | enum |
| r1039 | r1040 | |
| 445 | 447 | } |
| 446 | 448 | } |
| 447 | 449 | |
| 448 | | |
| 450 | #ifdef UNUSED_FUNCTION |
| 449 | 451 | /* |
| 450 | 452 | Convert a C string to a 8-character file name (padded with spaces if necessary) |
| 451 | 453 | */ |
| r1039 | r1040 | |
| 471 | 473 | i++; |
| 472 | 474 | } |
| 473 | 475 | } |
| 476 | #endif |
| 474 | 477 | |
| 475 | 478 | /* |
| 476 | 479 | Convert a 8-character file name to a C string (removing trailing spaces if necessary) |
| r1039 | r1040 | |
| 547 | 550 | return 0; |
| 548 | 551 | } |
| 549 | 552 | |
| 553 | #ifdef UNUSED_FUNCTION |
| 550 | 554 | /* |
| 551 | 555 | Read one sector from a disk image |
| 552 | 556 | |
| r1039 | r1040 | |
| 559 | 563 | { |
| 560 | 564 | return read_sector_physical_len(file_handle, address, geometry, dest, geometry->bytes_per_sector); |
| 561 | 565 | } |
| 566 | #endif |
| 562 | 567 | |
| 563 | 568 | /* |
| 564 | 569 | Write one sector to a disk image |
| r1039 | r1040 | |
| 596 | 601 | return 0; |
| 597 | 602 | } |
| 598 | 603 | |
| 604 | #ifdef UNUSED_FUNCTION |
| 599 | 605 | /* |
| 600 | 606 | Write one sector to a disk image |
| 601 | 607 | |
| r1039 | r1040 | |
| 608 | 614 | { |
| 609 | 615 | return write_sector_physical_len(file_handle, address, geometry, src, geometry->bytes_per_sector); |
| 610 | 616 | } |
| 617 | #endif |
| 611 | 618 | |
| 612 | 619 | /* |
| 613 | 620 | Convert logical sector address to physical sector address |
| r1039 | r1040 | |
| 639 | 646 | return read_sector_physical_len(file_handle, &address, geometry, dest, len); |
| 640 | 647 | } |
| 641 | 648 | |
| 649 | #ifdef UNUSED_FUNCTION |
| 642 | 650 | /* |
| 643 | 651 | Read one sector from a disk image |
| 644 | 652 | |
| r1039 | r1040 | |
| 651 | 659 | { |
| 652 | 660 | return read_sector_logical_len(file_handle, secnum, geometry, dest, geometry->bytes_per_sector); |
| 653 | 661 | } |
| 662 | #endif |
| 654 | 663 | |
| 655 | 664 | /* |
| 656 | 665 | Write one sector to a disk image |
| r1039 | r1040 | |
| 689 | 698 | #pragma mark CATALOG FILE ROUTINES |
| 690 | 699 | #endif |
| 691 | 700 | |
| 701 | #ifdef UNUSED_FUNCTION |
| 692 | 702 | /* |
| 693 | 703 | Find the catalog entry and fdr record associated with a file name |
| 694 | 704 | |
| r1039 | r1040 | |
| 822 | 832 | |
| 823 | 833 | return 0; |
| 824 | 834 | } |
| 835 | #endif |
| 825 | 836 | |
| 826 | 837 | #if 0 |
| 827 | 838 | /* |
| r1039 | r1040 | |
| 1436 | 1447 | return IMGTOOLERR_SUCCESS; |
| 1437 | 1448 | } |
| 1438 | 1449 | |
| 1450 | #ifdef UNUSED_FUNCTION |
| 1439 | 1451 | /* |
| 1440 | 1452 | Extract a file from a ti990_image. |
| 1441 | 1453 | */ |
| r1039 | r1040 | |
| 1745 | 1757 | |
| 1746 | 1758 | return 0; |
| 1747 | 1759 | } |
| 1760 | #endif |
| 1748 | 1761 | |
| 1749 | 1762 | /* |
| 1750 | 1763 | Create a blank ti990_image. |
src/mess/tools/imgtool/mac.c
| r1039 | r1040 | |
| 582 | 582 | memcpy(dest, src, src[0]+1); |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | #ifdef UNUSED_FUNCTION |
| 585 | 586 | /* |
| 586 | 587 | mac_strncpy() |
| 587 | 588 | |
| r1039 | r1040 | |
| 601 | 602 | dest[0] = len; |
| 602 | 603 | memcpy(dest+1, src+1, len); |
| 603 | 604 | } |
| 605 | #endif |
| 604 | 606 | |
| 605 | 607 | /* |
| 606 | 608 | disk image reference |
| r1039 | r1040 | |
| 1049 | 1051 | /* (DV17 says "disk block number", but it cannot be true) */ |
| 1050 | 1052 | } floppy_tag_record; |
| 1051 | 1053 | |
| 1054 | #ifdef UNUSED_FUNCTION |
| 1052 | 1055 | static void hfs_image_close(mac_l2_imgref *l2_img); |
| 1056 | #endif |
| 1053 | 1057 | static imgtoolerr_t mfs_file_get_nth_block_address(mac_fileref *fileref, UINT32 block_num, UINT32 *block_address); |
| 1054 | 1058 | static imgtoolerr_t hfs_file_get_nth_block_address(mac_fileref *fileref, UINT32 block_num, UINT32 *block_address); |
| 1055 | 1059 | static imgtoolerr_t mfs_lookup_path(mac_l2_imgref *l2_img, const char *fpath, mac_str255 filename, mac_dirent *cat_info, int create_it); |
| r1039 | r1040 | |
| 1065 | 1069 | } |
| 1066 | 1070 | |
| 1067 | 1071 | |
| 1068 | | |
| 1072 | #ifdef UNUSED_FUNCTION |
| 1069 | 1073 | /* |
| 1070 | 1074 | mac_image_close |
| 1071 | 1075 | |
| r1039 | r1040 | |
| 1085 | 1089 | break; |
| 1086 | 1090 | } |
| 1087 | 1091 | } |
| 1092 | #endif |
| 1088 | 1093 | |
| 1089 | 1094 | /* |
| 1090 | 1095 | mac_lookup_path |
| r1039 | r1040 | |
| 1333 | 1338 | return IMGTOOLERR_SUCCESS; |
| 1334 | 1339 | } |
| 1335 | 1340 | |
| 1341 | #ifdef UNUSED_FUNCTION |
| 1336 | 1342 | /* |
| 1337 | 1343 | mac_file_tell |
| 1338 | 1344 | |
| r1039 | r1040 | |
| 1349 | 1355 | |
| 1350 | 1356 | return IMGTOOLERR_SUCCESS; |
| 1351 | 1357 | } |
| 1358 | #endif |
| 1352 | 1359 | |
| 1353 | 1360 | /* |
| 1354 | 1361 | mac_file_seek |
| r1039 | r1040 | |
| 2711 | 2718 | return IMGTOOLERR_SUCCESS; |
| 2712 | 2719 | } |
| 2713 | 2720 | |
| 2721 | #ifdef UNUSED_FUNCTION |
| 2714 | 2722 | /* |
| 2715 | 2723 | mfs_hashString |
| 2716 | 2724 | |
| r1039 | r1040 | |
| 2746 | 2754 | |
| 2747 | 2755 | return reply; |
| 2748 | 2756 | } |
| 2757 | #endif |
| 2749 | 2758 | |
| 2750 | 2759 | #if 0 |
| 2751 | 2760 | #pragma mark - |
| r1039 | r1040 | |
| 3114 | 3123 | return IMGTOOLERR_SUCCESS; |
| 3115 | 3124 | } |
| 3116 | 3125 | |
| 3126 | #ifdef UNUSED_FUNCTION |
| 3117 | 3127 | /* |
| 3118 | 3128 | hfs_image_close |
| 3119 | 3129 | |
| r1039 | r1040 | |
| 3128 | 3138 | BT_close(&l2_img->u.hfs.extents_BT); |
| 3129 | 3139 | BT_close(&l2_img->u.hfs.cat_BT); |
| 3130 | 3140 | } |
| 3141 | #endif |
| 3131 | 3142 | |
| 3132 | 3143 | /* |
| 3133 | 3144 | hfs_get_cat_record_data |
| r1039 | r1040 | |
| 4886 | 4897 | /* This is actually part of the type list, which matters for offsets */ |
| 4887 | 4898 | } mac_resfileref; |
| 4888 | 4899 | |
| 4889 | | |
| 4900 | #ifdef UNUSED_FUNCTION |
| 4890 | 4901 | /* |
| 4891 | 4902 | resfile_open |
| 4892 | 4903 | |
| r1039 | r1040 | |
| 5130 | 5141 | |
| 5131 | 5142 | return IMGTOOLERR_SUCCESS; |
| 5132 | 5143 | } |
| 5144 | #endif |
| 5133 | 5145 | |
| 5134 | 5146 | #if 0 |
| 5135 | 5147 | #pragma mark - |
| r1039 | r1040 | |
| 5172 | 5184 | many programs/comments |
| 5173 | 5185 | */ |
| 5174 | 5186 | |
| 5187 | #ifdef UNUSED_FUNCTION |
| 5175 | 5188 | /* |
| 5176 | 5189 | get_comment |
| 5177 | 5190 | |
| r1039 | r1040 | |
| 5229 | 5242 | /* phew, we are done! */ |
| 5230 | 5243 | return IMGTOOLERR_SUCCESS; |
| 5231 | 5244 | } |
| 5245 | #endif |
| 5232 | 5246 | |
| 5233 | 5247 | #if 0 |
| 5234 | 5248 | #pragma mark - |
| 5235 | 5249 | #pragma mark IMGTOOL MODULE IMPLEMENTATION |
| 5236 | 5250 | #endif |
| 5237 | 5251 | |
| 5252 | #ifdef UNUSED_FUNCTION |
| 5238 | 5253 | static void mac_image_exit(imgtool_image *img); |
| 5254 | #endif |
| 5239 | 5255 | static void mac_image_info(imgtool_image *img, char *string, size_t len); |
| 5240 | 5256 | static imgtoolerr_t mac_image_beginenum(imgtool_directory *enumeration, const char *path); |
| 5241 | 5257 | static imgtoolerr_t mac_image_nextenum(imgtool_directory *enumeration, imgtool_dirent *ent); |
| r1039 | r1040 | |
| 5243 | 5259 | static imgtoolerr_t mac_image_readfile(imgtool_partition *partition, const char *filename, const char *fork, imgtool_stream *destf); |
| 5244 | 5260 | static imgtoolerr_t mac_image_writefile(imgtool_partition *partition, const char *filename, const char *fork, imgtool_stream *sourcef, option_resolution *writeoptions); |
| 5245 | 5261 | |
| 5262 | #ifdef UNUSED_FUNCTION |
| 5246 | 5263 | /* |
| 5247 | 5264 | close a mfs/hfs image |
| 5248 | 5265 | */ |
| r1039 | r1040 | |
| 5252 | 5269 | |
| 5253 | 5270 | mac_image_close(image); |
| 5254 | 5271 | } |
| 5272 | #endif |
| 5255 | 5273 | |
| 5256 | 5274 | /* |
| 5257 | 5275 | get basic information on a mfs/hfs image |
| r1039 | r1040 | |
| 5539 | 5557 | return IMGTOOLERR_SUCCESS; |
| 5540 | 5558 | } |
| 5541 | 5559 | |
| 5560 | #ifdef UNUSED_FUNCTION |
| 5542 | 5561 | static imgtoolerr_t mac_get_comment(mac_l2_imgref *image, mac_str255 filename, const mac_dirent *cat_info, mac_str255 comment) |
| 5543 | 5562 | { |
| 5544 | 5563 | imgtoolerr_t err = IMGTOOLERR_SUCCESS; |
| r1039 | r1040 | |
| 5564 | 5583 | } |
| 5565 | 5584 | return err; |
| 5566 | 5585 | } |
| 5586 | #endif |
| 5567 | 5587 | |
| 5568 | 5588 | |
| 5569 | | |
| 5570 | 5589 | /* |
| 5571 | 5590 | Extract a file from a disk image. |
| 5572 | 5591 | */ |
src/mess/osd/windows/dialog.c
| r1039 | r1040 | |
| 27 | 27 | #include "invokegx.h" |
| 28 | 28 | #endif |
| 29 | 29 | |
| 30 | | |
| 31 | 30 | //============================================================ |
| 32 | | // These defines are necessary because the MinGW headers do |
| 33 | | // not have the latest definitions |
| 34 | | //============================================================ |
| 35 | 31 | |
| 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 | | |
| 56 | 32 | enum |
| 57 | 33 | { |
| 58 | 34 | TRIGGER_INITDIALOG = 1, |
| r1039 | r1040 | |
| 136 | 112 | #define DIM_SCROLLBAR_WIDTH 10 |
| 137 | 113 | #define DIM_BOX_VERTSKEW -3 |
| 138 | 114 | |
| 139 | | #define WNDLONG_DIALOG GWLP_USERDATA |
| 140 | | |
| 141 | 115 | #define DLGITEM_BUTTON ((const WCHAR *) dlgitem_button) |
| 142 | 116 | #define DLGITEM_EDIT ((const WCHAR *) dlgitem_edit) |
| 143 | 117 | #define DLGITEM_STATIC ((const WCHAR *) dlgitem_static) |
| r1039 | r1040 | |
| 262 | 236 | struct dialog_info_trigger *trigger; |
| 263 | 237 | LONG l; |
| 264 | 238 | |
| 265 | | l = GetWindowLongPtr(dlgwnd, WNDLONG_DIALOG); |
| 239 | l = GetWindowLongPtr(dlgwnd, GWLP_USERDATA); |
| 266 | 240 | di = (struct _dialog_box *) l; |
| 267 | 241 | assert(di); |
| 268 | 242 | for (trigger = di->trigger_first; trigger; trigger = trigger->next) |
| r1039 | r1040 | |
| 300 | 274 | |
| 301 | 275 | if (LOG_WINMSGS) |
| 302 | 276 | { |
| 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); |
| 305 | 279 | } |
| 306 | 280 | |
| 307 | 281 | switch(msg) |
| 308 | 282 | { |
| 309 | 283 | case WM_INITDIALOG: |
| 310 | | SetWindowLongPtr(dlgwnd, WNDLONG_DIALOG, (LONG_PTR) lparam); |
| 284 | SetWindowLongPtr(dlgwnd, GWLP_USERDATA, (LONG_PTR) lparam); |
| 311 | 285 | dialog_trigger(dlgwnd, TRIGGER_INITDIALOG); |
| 312 | 286 | break; |
| 313 | 287 | |
| r1039 | r1040 | |
| 1665 | 1639 | ofn = (OPENFILENAME *) lparam; |
| 1666 | 1640 | dialog = (dialog_box *) ofn->lCustData; |
| 1667 | 1641 | |
| 1668 | | SetWindowLongPtr(dlgwnd, WNDLONG_DIALOG, (LONG_PTR) dialog); |
| 1642 | SetWindowLongPtr(dlgwnd, GWLP_USERDATA, (LONG_PTR) dialog); |
| 1669 | 1643 | dialog_trigger(dlgwnd, TRIGGER_INITDIALOG); |
| 1670 | 1644 | rc = 1; |
| 1671 | 1645 | |
| r1039 | r1040 | |
| 1683 | 1657 | } |
| 1684 | 1658 | |
| 1685 | 1659 | // hack |
| 1686 | | l = GetWindowLongPtr(dlgwnd, WNDLONG_DIALOG); |
| 1660 | l = GetWindowLongPtr(dlgwnd, GWLP_USERDATA); |
| 1687 | 1661 | dialog = (dialog_box *) l; |
| 1688 | 1662 | if (dialog->notify_callback && (notify->code == dialog->notify_code)) |
| 1689 | 1663 | dialog->notify_callback(dialog, dlgwnd, notify, dialog->notify_param); |