From f636dd6ad8aef5d8fb84af38ad45c928a24b30ae Mon Sep 17 00:00:00 2001 From: sonic Date: Sun, 3 Feb 2013 20:53:38 +0000 Subject: [PATCH] Moving to main tree, needed by SysExplorer git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@46493 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/classes/zune/nlist/AUTHORS | 49 + workbench/classes/zune/nlist/COPYING | 428 + workbench/classes/zune/nlist/ChangeLog | 2069 ++++ workbench/classes/zune/nlist/Makefile | 78 + workbench/classes/zune/nlist/README | 39 + workbench/classes/zune/nlist/TODO | 26 + .../classes/zune/nlist/aros/s/Package-Shutdown | 1 + .../classes/zune/nlist/aros/s/Package-Startup | 1 + workbench/classes/zune/nlist/aros/s/mmakefile.src | 27 + workbench/classes/zune/nlist/demo/Makefile | 381 + workbench/classes/zune/nlist/demo/NBitmap-Demo.c | 205 + workbench/classes/zune/nlist/demo/NList-Demo.c | 830 ++ workbench/classes/zune/nlist/demo/NList-Demo2.c | 211 + workbench/classes/zune/nlist/demo/NList-Demo2.h | 79 + workbench/classes/zune/nlist/demo/NList-Demo3.c | 262 + workbench/classes/zune/nlist/demo/NList-Demo3.h | 12 + workbench/classes/zune/nlist/demo/NListtree-Demo.c | 1239 +++ workbench/classes/zune/nlist/demo/mmakefile.src | 43 + workbench/classes/zune/nlist/demo/vastubs.c | 44 + workbench/classes/zune/nlist/dist/MCC_NList.info | Bin 0 -> 1904 bytes .../classes/zune/nlist/dist/MCC_NList/AUTHORS.info | Bin 0 -> 2542 bytes .../classes/zune/nlist/dist/MCC_NList/COPYING.info | Bin 0 -> 2542 bytes .../zune/nlist/dist/MCC_NList/ChangeLog.info | Bin 0 -> 2542 bytes .../classes/zune/nlist/dist/MCC_NList/Demos.info | Bin 0 -> 1255 bytes .../classes/zune/nlist/dist/MCC_NList/Install-MCC | 595 ++ .../zune/nlist/dist/MCC_NList/Install-MCC.info | Bin 0 -> 1846 bytes .../classes/zune/nlist/dist/MCC_NList/ReadMe.info | Bin 0 -> 2542 bytes .../classes/zune/nlist/dist/MCC_NList/ReadMe.mui | 27 + .../zune/nlist/dist/MCC_NList/ReadMe.mui.info | Bin 0 -> 2570 bytes workbench/classes/zune/nlist/docs/MCC_NBalance.doc | 43 + .../classes/zune/nlist/docs/MCC_NFloattext.doc | 161 + workbench/classes/zune/nlist/docs/MCC_NList.doc | 3521 ++++++ .../classes/zune/nlist/docs/MCC_NListtree.doc | 2968 ++++++ .../classes/zune/nlist/docs/MCC_NListview.doc | 139 + workbench/classes/zune/nlist/docs/NList_mcc.doc | 1033 ++ workbench/classes/zune/nlist/docs/ReadMe | 93 + .../classes/zune/nlist/include/SDI_compiler.h | 241 + workbench/classes/zune/nlist/include/SDI_hook.h | 246 + workbench/classes/zune/nlist/include/SDI_lib.h | 205 + workbench/classes/zune/nlist/include/SDI_stdarg.h | 105 + workbench/classes/zune/nlist/include/amiga-align.h | 42 + .../zune/nlist/include/clib/mccclass_protos.h | 10 + .../zune/nlist/include/clib/muimaster_protos.h | 70 + .../classes/zune/nlist/include/default-align.h | 42 + .../classes/zune/nlist/include/defines/mccclass.h | 28 + .../classes/zune/nlist/include/inline/mccclass.h | 16 + .../classes/zune/nlist/include/inline/muimaster.h | 139 + .../zune/nlist/include/inline/muimaster_protos.h | 79 + .../classes/zune/nlist/include/inline4/mccclass.h | 27 + .../classes/zune/nlist/include/inline4/muimaster.h | 82 + .../zune/nlist/include/interfaces/mccclass.h | 31 + .../zune/nlist/include/interfaces/mccclass.i | 20 + .../zune/nlist/include/interfaces/muimaster.h | 73 + .../classes/zune/nlist/include/libraries/mui.h | 3561 +++++++ .../classes/zune/nlist/include/libraries/muiaros.h | 4071 +++++++ workbench/classes/zune/nlist/include/mcc_common.h | 64 + .../classes/zune/nlist/include/mccclass_68k.c | 78 + workbench/classes/zune/nlist/include/mccinit.c | 1337 +++ .../classes/zune/nlist/include/mui/Busy_mcc.h | 73 + .../zune/nlist/include/mui/HotkeyString_mcc.h | 40 + .../classes/zune/nlist/include/mui/NBalance_mcc.h | 45 + .../classes/zune/nlist/include/mui/NBitmap_mcc.h | 65 + .../zune/nlist/include/mui/NFloattext_mcc.h | 87 + .../classes/zune/nlist/include/mui/NList_mcc.h | 671 ++ .../classes/zune/nlist/include/mui/NListtree_mcc.h | 760 ++ .../classes/zune/nlist/include/mui/NListview_mcc.h | 78 + workbench/classes/zune/nlist/include/muiextra.h | 93 + workbench/classes/zune/nlist/include/newmouse.h | 37 + .../classes/zune/nlist/include/proto/mccclass.h | 62 + .../classes/zune/nlist/include/proto/muimaster.h | 78 + workbench/classes/zune/nlist/include/timeval.h | 58 + workbench/classes/zune/nlist/mmakefile.src | 21 + workbench/classes/zune/nlist/nbalance_mcc/Debug.c | 413 + workbench/classes/zune/nlist/nbalance_mcc/Debug.h | 139 + .../classes/zune/nlist/nbalance_mcc/Dispatcher.c | 83 + workbench/classes/zune/nlist/nbalance_mcc/Makefile | 425 + .../classes/zune/nlist/nbalance_mcc/Makefile.dep | 30 + .../zune/nlist/nbalance_mcc/NBalance-Test.c | 210 + .../classes/zune/nlist/nbalance_mcc/NBalance.c | 315 + .../classes/zune/nlist/nbalance_mcc/NBalance.h | 57 + .../classes/zune/nlist/nbalance_mcc/Pointer.c | 591 + .../classes/zune/nlist/nbalance_mcc/Pointer.h | 41 + .../classes/zune/nlist/nbalance_mcc/library.c | 88 + .../classes/zune/nlist/nbalance_mcc/mmakefile.src | 32 + .../classes/zune/nlist/nbalance_mcc/private.h | 82 + .../classes/zune/nlist/nbalance_mcc/vastubs.c | 51 + .../classes/zune/nlist/nbalance_mcc/version.h | 79 + .../classes/zune/nlist/nbitmap_mcc/Chunky2Bitmap.c | 99 + .../classes/zune/nlist/nbitmap_mcc/Chunky2Bitmap.h | 35 + workbench/classes/zune/nlist/nbitmap_mcc/Debug.c | 415 + workbench/classes/zune/nlist/nbitmap_mcc/Debug.h | 141 + .../classes/zune/nlist/nbitmap_mcc/DitherImage.c | 249 + .../classes/zune/nlist/nbitmap_mcc/DitherImage.h | 52 + workbench/classes/zune/nlist/nbitmap_mcc/Makefile | 442 + .../classes/zune/nlist/nbitmap_mcc/Makefile.dep | 43 + .../classes/zune/nlist/nbitmap_mcc/NBitmap-Test.c | 247 + workbench/classes/zune/nlist/nbitmap_mcc/NBitmap.c | 1262 +++ workbench/classes/zune/nlist/nbitmap_mcc/NBitmap.h | 58 + .../classes/zune/nlist/nbitmap_mcc/SetPatch.c | 48 + .../classes/zune/nlist/nbitmap_mcc/SetPatch.h | 34 + .../zune/nlist/nbitmap_mcc/WritePixelArray.c | 60 + .../zune/nlist/nbitmap_mcc/WritePixelArrayAlpha.c | 105 + .../classes/zune/nlist/nbitmap_mcc/dispatcher.c | 596 ++ workbench/classes/zune/nlist/nbitmap_mcc/icon.png | Bin 0 -> 26529 bytes workbench/classes/zune/nlist/nbitmap_mcc/library.c | 122 + .../classes/zune/nlist/nbitmap_mcc/mmakefile.src | 29 + workbench/classes/zune/nlist/nbitmap_mcc/private.h | 161 + workbench/classes/zune/nlist/nbitmap_mcc/vastubs.c | 57 + workbench/classes/zune/nlist/nbitmap_mcc/version.h | 80 + .../classes/zune/nlist/nfloattext_mcc/Debug.c | 412 + .../classes/zune/nlist/nfloattext_mcc/Debug.h | 139 + .../classes/zune/nlist/nfloattext_mcc/Makefile | 423 + .../classes/zune/nlist/nfloattext_mcc/Makefile.dep | 15 + .../classes/zune/nlist/nfloattext_mcc/NFloattext.c | 333 + .../classes/zune/nlist/nfloattext_mcc/library.c | 68 + .../zune/nlist/nfloattext_mcc/mmakefile.src | 22 + .../classes/zune/nlist/nfloattext_mcc/private.h | 53 + .../classes/zune/nlist/nfloattext_mcc/version.h | 82 + .../classes/zune/nlist/nlist_mcc/ClipboardServer.c | 364 + workbench/classes/zune/nlist/nlist_mcc/Debug.c | 460 + workbench/classes/zune/nlist/nlist_mcc/Debug.h | 149 + workbench/classes/zune/nlist/nlist_mcc/Makefile | 447 + .../classes/zune/nlist/nlist_mcc/Makefile.dep | 129 + .../classes/zune/nlist/nlist_mcc/NList-Test.c | 1116 ++ workbench/classes/zune/nlist/nlist_mcc/NList.bh | 304 + .../classes/zune/nlist/nlist_mcc/NList_func.c | 2194 ++++ .../classes/zune/nlist/nlist_mcc/NList_func.h | 199 + .../classes/zune/nlist/nlist_mcc/NList_func2.c | 2075 ++++ .../classes/zune/nlist/nlist_mcc/NList_func3.c | 914 ++ .../classes/zune/nlist/nlist_mcc/NList_func4.c | 995 ++ workbench/classes/zune/nlist/nlist_mcc/NList_grp.c | 140 + workbench/classes/zune/nlist/nlist_mcc/NList_grp.h | 34 + workbench/classes/zune/nlist/nlist_mcc/NList_img.c | 111 + workbench/classes/zune/nlist/nlist_mcc/NList_img.h | 36 + .../classes/zune/nlist/nlist_mcc/NList_img2.c | 112 + .../classes/zune/nlist/nlist_mcc/NList_img2.h | 37 + workbench/classes/zune/nlist/nlist_mcc/NList_mcc.c | 1631 +++ .../classes/zune/nlist/nlist_mcc/NList_mcc0.c | 701 ++ .../classes/zune/nlist/nlist_mcc/NList_mcc1.c | 1343 +++ .../classes/zune/nlist/nlist_mcc/NList_mcc2.c | 2185 ++++ .../classes/zune/nlist/nlist_mcc/NList_mcc3.c | 1369 +++ .../classes/zune/nlist/nlist_mcc/NList_mcc4.c | 1753 +++ .../classes/zune/nlist/nlist_mcc/NList_mcc5.c | 1436 +++ .../classes/zune/nlist/nlist_mcc/NList_mcc6.c | 1850 ++++ workbench/classes/zune/nlist/nlist_mcc/Pointer.c | 715 ++ workbench/classes/zune/nlist/nlist_mcc/Pointer.h | 46 + .../zune/nlist/nlist_mcc/extrasrc/AllocVecPooled.c | 48 + .../zune/nlist/nlist_mcc/extrasrc/FreeVecPooled.c | 43 + workbench/classes/zune/nlist/nlist_mcc/library.c | 206 + .../classes/zune/nlist/nlist_mcc/mmakefile.src | 51 + workbench/classes/zune/nlist/nlist_mcc/move.c | 61 + workbench/classes/zune/nlist/nlist_mcc/private.h | 639 ++ workbench/classes/zune/nlist/nlist_mcc/protos.h | 222 + workbench/classes/zune/nlist/nlist_mcc/vastubs.c | 59 + workbench/classes/zune/nlist/nlist_mcc/version.h | 83 + .../zune/nlist/nlisttree_mcc/ClipboardServer.c | 349 + workbench/classes/zune/nlist/nlisttree_mcc/Debug.c | 420 + workbench/classes/zune/nlist/nlisttree_mcc/Debug.h | 149 + .../classes/zune/nlist/nlisttree_mcc/Makefile | 426 + .../classes/zune/nlist/nlisttree_mcc/Makefile.dep | 26 + .../classes/zune/nlist/nlisttree_mcc/NListtree.c | 10639 +++++++++++++++++++ .../classes/zune/nlist/nlisttree_mcc/NListtree.h | 266 + .../classes/zune/nlist/nlisttree_mcc/QuickSort.c | 85 + .../nlisttree_mcc/images/ClosedNode/ClosedNode.c | 222 + .../images/ClosedNode/ClosedNode.image | Bin 0 -> 1772 bytes .../images/ClosedNode/ClosedNode.image.info | Bin 0 -> 831 bytes .../images/ClosedNode/ClosedNode_rev.h | 51 + .../nlisttree_mcc/images/ClosedNode/SCOPTIONS | 23 + .../nlisttree_mcc/images/ClosedNode/SCOPTIONS.in | 22 + .../nlisttree_mcc/images/ClosedNode/SMakefile | 154 + .../images/ClosedNodeWin98/ClosedNodeWin98.c | 200 + .../images/ClosedNodeWin98/ClosedNodeWin98.image | Bin 0 -> 1608 bytes .../ClosedNodeWin98/ClosedNodeWin98.image.info | Bin 0 -> 831 bytes .../images/ClosedNodeWin98/ClosedNodeWin98_rev.h | 51 + .../nlisttree_mcc/images/ClosedNodeWin98/SCOPTIONS | 23 + .../images/ClosedNodeWin98/SCOPTIONS.in | 22 + .../nlisttree_mcc/images/ClosedNodeWin98/SMakefile | 154 + .../nlist/nlisttree_mcc/images/OpenNode/OpenNode.c | 222 + .../nlisttree_mcc/images/OpenNode/OpenNode.image | Bin 0 -> 1772 bytes .../images/OpenNode/OpenNode.image.info | Bin 0 -> 831 bytes .../nlisttree_mcc/images/OpenNode/OpenNode_rev.h | 51 + .../nlist/nlisttree_mcc/images/OpenNode/SCOPTIONS | 23 + .../nlisttree_mcc/images/OpenNode/SCOPTIONS.in | 22 + .../nlist/nlisttree_mcc/images/OpenNode/SMakefile | 154 + .../images/OpenNodeWin98/OpenNodeWin98.c | 197 + .../images/OpenNodeWin98/OpenNodeWin98.image | Bin 0 -> 1556 bytes .../images/OpenNodeWin98/OpenNodeWin98.image.info | Bin 0 -> 831 bytes .../images/OpenNodeWin98/OpenNodeWin98_rev.h | 51 + .../nlisttree_mcc/images/OpenNodeWin98/SCOPTIONS | 23 + .../images/OpenNodeWin98/SCOPTIONS.in | 22 + .../nlisttree_mcc/images/OpenNodeWin98/SMakefile | 154 + .../nlisttree_mcc/images/Samples/AllImages.ilbm | Bin 0 -> 5900 bytes .../images/Samples/Grab_NListtree182.iff | Bin 0 -> 38516 bytes .../nlist/nlisttree_mcc/images/Samples/glowbsp.iff | Bin 0 -> 60288 bytes .../nlisttree_mcc/images/aphaso/ClosedBall.ilbm | Bin 0 -> 208 bytes .../images/aphaso/ClosedDrawerWin98.ilbm | Bin 0 -> 252 bytes .../images/aphaso/GlowDrawerClosed.ilbm | Bin 0 -> 1240 bytes .../images/aphaso/GlowDrawerOpen.ilbm | Bin 0 -> 1730 bytes .../nlisttree_mcc/images/aphaso/OpenBall.ilbm | Bin 0 -> 208 bytes .../images/aphaso/OpenDrawerWin98.ilbm | Bin 0 -> 250 bytes .../classes/zune/nlist/nlisttree_mcc/library.c | 91 + .../classes/zune/nlist/nlisttree_mcc/mmakefile.src | 26 + .../classes/zune/nlist/nlisttree_mcc/private.h | 919 ++ .../classes/zune/nlist/nlisttree_mcc/vastubs.c | 51 + .../classes/zune/nlist/nlisttree_mcc/version.h | 80 + workbench/classes/zune/nlist/nlisttree_mcp/C_c.sd | 84 + workbench/classes/zune/nlist/nlisttree_mcp/C_h.sd | 45 + workbench/classes/zune/nlist/nlisttree_mcp/Debug.c | 410 + workbench/classes/zune/nlist/nlisttree_mcp/Debug.h | 139 + .../classes/zune/nlist/nlisttree_mcp/Makefile | 455 + .../classes/zune/nlist/nlisttree_mcp/Makefile.dep | 25 + .../zune/nlist/nlisttree_mcp/NListtree-Prefs.c | 194 + .../classes/zune/nlist/nlisttree_mcp/NListtree.c | 1017 ++ workbench/classes/zune/nlist/nlisttree_mcp/icon.c | 93 + workbench/classes/zune/nlist/nlisttree_mcp/icon.h | 75 + .../zune/nlist/nlisttree_mcp/images/icon32.png | Bin 0 -> 565 bytes .../zune/nlist/nlisttree_mcp/images/icon8.iff | Bin 0 -> 318 bytes .../classes/zune/nlist/nlisttree_mcp/library.c | 201 + .../nlist/nlisttree_mcp/locale/NListtree_mcp.cd | 256 + .../zune/nlist/nlisttree_mcp/locale/czech.ct | 245 + .../nlist/nlisttree_mcp/locale/english-british.ct | 51 + .../zune/nlist/nlisttree_mcp/locale/french.ct | 260 + .../zune/nlist/nlisttree_mcp/locale/german.ct | 347 + .../zune/nlist/nlisttree_mcp/locale/polish.ct | 364 + .../zune/nlist/nlisttree_mcp/locale/russian.ct | 259 + .../zune/nlist/nlisttree_mcp/locale/swedish.ct | 242 + .../zune/nlist/nlisttree_mcp/locale/turkish.ct | 256 + .../classes/zune/nlist/nlisttree_mcp/mmakefile.src | 72 + .../classes/zune/nlist/nlisttree_mcp/private.h | 67 + .../classes/zune/nlist/nlisttree_mcp/vastubs.c | 45 + .../classes/zune/nlist/nlisttree_mcp/version.h | 80 + workbench/classes/zune/nlist/nlistview_mcc/Debug.c | 412 + workbench/classes/zune/nlist/nlistview_mcc/Debug.h | 139 + .../classes/zune/nlist/nlistview_mcc/Makefile | 426 + .../classes/zune/nlist/nlistview_mcc/Makefile.dep | 18 + .../classes/zune/nlist/nlistview_mcc/NListview.c | 944 ++ .../classes/zune/nlist/nlistview_mcc/library.c | 104 + .../classes/zune/nlist/nlistview_mcc/mmakefile.src | 24 + .../classes/zune/nlist/nlistview_mcc/private.h | 69 + .../classes/zune/nlist/nlistview_mcc/vastubs.c | 47 + .../classes/zune/nlist/nlistview_mcc/version.h | 82 + workbench/classes/zune/nlist/nlistviews_mcp/C_c.sd | 87 + workbench/classes/zune/nlist/nlistviews_mcp/C_h.sd | 48 + .../classes/zune/nlist/nlistviews_mcp/Debug.c | 413 + .../classes/zune/nlist/nlistviews_mcp/Debug.h | 139 + .../classes/zune/nlist/nlistviews_mcp/Makefile | 477 + .../classes/zune/nlist/nlistviews_mcp/Makefile.dep | 30 + .../zune/nlist/nlistviews_mcp/NListviews-Prefs.c | 197 + .../classes/zune/nlist/nlistviews_mcp/NListviews.c | 1967 ++++ .../zune/nlist/nlistviews_mcp/NListviews_mcp.h | 220 + workbench/classes/zune/nlist/nlistviews_mcp/icon.c | 96 + workbench/classes/zune/nlist/nlistviews_mcp/icon.h | 76 + .../zune/nlist/nlistviews_mcp/images/icon32.png | Bin 0 -> 565 bytes .../classes/zune/nlist/nlistviews_mcp/library.c | 245 + .../nlist/nlistviews_mcp/locale/NListviews_mcp.cd | 556 + .../zune/nlist/nlistviews_mcp/locale/czech.ct | 782 ++ .../zune/nlist/nlistviews_mcp/locale/french.ct | 726 ++ .../zune/nlist/nlistviews_mcp/locale/german.ct | 781 ++ .../zune/nlist/nlistviews_mcp/locale/polish.ct | 828 ++ .../zune/nlist/nlistviews_mcp/locale/swedish.ct | 704 ++ .../zune/nlist/nlistviews_mcp/locale/turkish.ct | 822 ++ .../zune/nlist/nlistviews_mcp/mmakefile.src | 70 + .../classes/zune/nlist/nlistviews_mcp/private.h | 111 + .../classes/zune/nlist/nlistviews_mcp/vastubs.c | 48 + .../classes/zune/nlist/nlistviews_mcp/version.h | 83 + workbench/classes/zune/nlist/tools/bumprev.sh | 24 + workbench/classes/zune/nlist/tools/mkrelease.sh | 115 + 267 files changed, 92674 insertions(+) create mode 100644 workbench/classes/zune/nlist/AUTHORS create mode 100644 workbench/classes/zune/nlist/COPYING create mode 100644 workbench/classes/zune/nlist/ChangeLog create mode 100644 workbench/classes/zune/nlist/Makefile create mode 100644 workbench/classes/zune/nlist/README create mode 100644 workbench/classes/zune/nlist/TODO create mode 100644 workbench/classes/zune/nlist/aros/s/Package-Shutdown create mode 100644 workbench/classes/zune/nlist/aros/s/Package-Startup create mode 100644 workbench/classes/zune/nlist/aros/s/mmakefile.src create mode 100644 workbench/classes/zune/nlist/demo/Makefile create mode 100644 workbench/classes/zune/nlist/demo/NBitmap-Demo.c create mode 100644 workbench/classes/zune/nlist/demo/NList-Demo.c create mode 100644 workbench/classes/zune/nlist/demo/NList-Demo2.c create mode 100644 workbench/classes/zune/nlist/demo/NList-Demo2.h create mode 100644 workbench/classes/zune/nlist/demo/NList-Demo3.c create mode 100644 workbench/classes/zune/nlist/demo/NList-Demo3.h create mode 100755 workbench/classes/zune/nlist/demo/NListtree-Demo.c create mode 100644 workbench/classes/zune/nlist/demo/mmakefile.src create mode 100644 workbench/classes/zune/nlist/demo/vastubs.c create mode 100755 workbench/classes/zune/nlist/dist/MCC_NList.info create mode 100755 workbench/classes/zune/nlist/dist/MCC_NList/AUTHORS.info create mode 100755 workbench/classes/zune/nlist/dist/MCC_NList/COPYING.info create mode 100755 workbench/classes/zune/nlist/dist/MCC_NList/ChangeLog.info create mode 100755 workbench/classes/zune/nlist/dist/MCC_NList/Demos.info create mode 100755 workbench/classes/zune/nlist/dist/MCC_NList/Install-MCC create mode 100755 workbench/classes/zune/nlist/dist/MCC_NList/Install-MCC.info create mode 100755 workbench/classes/zune/nlist/dist/MCC_NList/ReadMe.info create mode 100755 workbench/classes/zune/nlist/dist/MCC_NList/ReadMe.mui create mode 100755 workbench/classes/zune/nlist/dist/MCC_NList/ReadMe.mui.info create mode 100644 workbench/classes/zune/nlist/docs/MCC_NBalance.doc create mode 100644 workbench/classes/zune/nlist/docs/MCC_NFloattext.doc create mode 100644 workbench/classes/zune/nlist/docs/MCC_NList.doc create mode 100755 workbench/classes/zune/nlist/docs/MCC_NListtree.doc create mode 100644 workbench/classes/zune/nlist/docs/MCC_NListview.doc create mode 100644 workbench/classes/zune/nlist/docs/NList_mcc.doc create mode 100755 workbench/classes/zune/nlist/docs/ReadMe create mode 100644 workbench/classes/zune/nlist/include/SDI_compiler.h create mode 100644 workbench/classes/zune/nlist/include/SDI_hook.h create mode 100644 workbench/classes/zune/nlist/include/SDI_lib.h create mode 100644 workbench/classes/zune/nlist/include/SDI_stdarg.h create mode 100644 workbench/classes/zune/nlist/include/amiga-align.h create mode 100755 workbench/classes/zune/nlist/include/clib/mccclass_protos.h create mode 100644 workbench/classes/zune/nlist/include/clib/muimaster_protos.h create mode 100644 workbench/classes/zune/nlist/include/default-align.h create mode 100644 workbench/classes/zune/nlist/include/defines/mccclass.h create mode 100644 workbench/classes/zune/nlist/include/inline/mccclass.h create mode 100644 workbench/classes/zune/nlist/include/inline/muimaster.h create mode 100644 workbench/classes/zune/nlist/include/inline/muimaster_protos.h create mode 100644 workbench/classes/zune/nlist/include/inline4/mccclass.h create mode 100644 workbench/classes/zune/nlist/include/inline4/muimaster.h create mode 100644 workbench/classes/zune/nlist/include/interfaces/mccclass.h create mode 100644 workbench/classes/zune/nlist/include/interfaces/mccclass.i create mode 100644 workbench/classes/zune/nlist/include/interfaces/muimaster.h create mode 100644 workbench/classes/zune/nlist/include/libraries/mui.h create mode 100644 workbench/classes/zune/nlist/include/libraries/muiaros.h create mode 100644 workbench/classes/zune/nlist/include/mcc_common.h create mode 100644 workbench/classes/zune/nlist/include/mccclass_68k.c create mode 100644 workbench/classes/zune/nlist/include/mccinit.c create mode 100755 workbench/classes/zune/nlist/include/mui/Busy_mcc.h create mode 100755 workbench/classes/zune/nlist/include/mui/HotkeyString_mcc.h create mode 100644 workbench/classes/zune/nlist/include/mui/NBalance_mcc.h create mode 100644 workbench/classes/zune/nlist/include/mui/NBitmap_mcc.h create mode 100644 workbench/classes/zune/nlist/include/mui/NFloattext_mcc.h create mode 100644 workbench/classes/zune/nlist/include/mui/NList_mcc.h create mode 100644 workbench/classes/zune/nlist/include/mui/NListtree_mcc.h create mode 100644 workbench/classes/zune/nlist/include/mui/NListview_mcc.h create mode 100644 workbench/classes/zune/nlist/include/muiextra.h create mode 100755 workbench/classes/zune/nlist/include/newmouse.h create mode 100644 workbench/classes/zune/nlist/include/proto/mccclass.h create mode 100644 workbench/classes/zune/nlist/include/proto/muimaster.h create mode 100755 workbench/classes/zune/nlist/include/timeval.h create mode 100644 workbench/classes/zune/nlist/mmakefile.src create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/Debug.c create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/Debug.h create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/Dispatcher.c create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/Makefile create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/Makefile.dep create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/NBalance-Test.c create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/NBalance.c create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/NBalance.h create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/Pointer.c create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/Pointer.h create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/library.c create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/mmakefile.src create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/private.h create mode 100755 workbench/classes/zune/nlist/nbalance_mcc/vastubs.c create mode 100644 workbench/classes/zune/nlist/nbalance_mcc/version.h create mode 100755 workbench/classes/zune/nlist/nbitmap_mcc/Chunky2Bitmap.c create mode 100755 workbench/classes/zune/nlist/nbitmap_mcc/Chunky2Bitmap.h create mode 100644 workbench/classes/zune/nlist/nbitmap_mcc/Debug.c create mode 100644 workbench/classes/zune/nlist/nbitmap_mcc/Debug.h create mode 100755 workbench/classes/zune/nlist/nbitmap_mcc/DitherImage.c create mode 100755 workbench/classes/zune/nlist/nbitmap_mcc/DitherImage.h create mode 100644 workbench/classes/zune/nlist/nbitmap_mcc/Makefile create mode 100644 workbench/classes/zune/nlist/nbitmap_mcc/Makefile.dep create mode 100644 workbench/classes/zune/nlist/nbitmap_mcc/NBitmap-Test.c create mode 100644 workbench/classes/zune/nlist/nbitmap_mcc/NBitmap.c create mode 100644 workbench/classes/zune/nlist/nbitmap_mcc/NBitmap.h create mode 100755 workbench/classes/zune/nlist/nbitmap_mcc/SetPatch.c create mode 100755 workbench/classes/zune/nlist/nbitmap_mcc/SetPatch.h create mode 100755 workbench/classes/zune/nlist/nbitmap_mcc/WritePixelArray.c create mode 100644 workbench/classes/zune/nlist/nbitmap_mcc/WritePixelArrayAlpha.c create mode 100644 workbench/classes/zune/nlist/nbitmap_mcc/dispatcher.c create mode 100755 workbench/classes/zune/nlist/nbitmap_mcc/icon.png create mode 100644 workbench/classes/zune/nlist/nbitmap_mcc/library.c create mode 100644 workbench/classes/zune/nlist/nbitmap_mcc/mmakefile.src create mode 100644 workbench/classes/zune/nlist/nbitmap_mcc/private.h create mode 100755 workbench/classes/zune/nlist/nbitmap_mcc/vastubs.c create mode 100644 workbench/classes/zune/nlist/nbitmap_mcc/version.h create mode 100644 workbench/classes/zune/nlist/nfloattext_mcc/Debug.c create mode 100644 workbench/classes/zune/nlist/nfloattext_mcc/Debug.h create mode 100644 workbench/classes/zune/nlist/nfloattext_mcc/Makefile create mode 100644 workbench/classes/zune/nlist/nfloattext_mcc/Makefile.dep create mode 100644 workbench/classes/zune/nlist/nfloattext_mcc/NFloattext.c create mode 100644 workbench/classes/zune/nlist/nfloattext_mcc/library.c create mode 100644 workbench/classes/zune/nlist/nfloattext_mcc/mmakefile.src create mode 100644 workbench/classes/zune/nlist/nfloattext_mcc/private.h create mode 100644 workbench/classes/zune/nlist/nfloattext_mcc/version.h create mode 100755 workbench/classes/zune/nlist/nlist_mcc/ClipboardServer.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/Debug.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/Debug.h create mode 100644 workbench/classes/zune/nlist/nlist_mcc/Makefile create mode 100644 workbench/classes/zune/nlist/nlist_mcc/Makefile.dep create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList-Test.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList.bh create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_func.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_func.h create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_func2.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_func3.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_func4.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_grp.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_grp.h create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_img.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_img.h create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_img2.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_img2.h create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_mcc.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_mcc0.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_mcc1.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_mcc2.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_mcc3.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_mcc4.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_mcc5.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/NList_mcc6.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/Pointer.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/Pointer.h create mode 100755 workbench/classes/zune/nlist/nlist_mcc/extrasrc/AllocVecPooled.c create mode 100755 workbench/classes/zune/nlist/nlist_mcc/extrasrc/FreeVecPooled.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/library.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/mmakefile.src create mode 100644 workbench/classes/zune/nlist/nlist_mcc/move.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/private.h create mode 100644 workbench/classes/zune/nlist/nlist_mcc/protos.h create mode 100755 workbench/classes/zune/nlist/nlist_mcc/vastubs.c create mode 100644 workbench/classes/zune/nlist/nlist_mcc/version.h create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/ClipboardServer.c create mode 100644 workbench/classes/zune/nlist/nlisttree_mcc/Debug.c create mode 100644 workbench/classes/zune/nlist/nlisttree_mcc/Debug.h create mode 100644 workbench/classes/zune/nlist/nlisttree_mcc/Makefile create mode 100644 workbench/classes/zune/nlist/nlisttree_mcc/Makefile.dep create mode 100644 workbench/classes/zune/nlist/nlisttree_mcc/NListtree.c create mode 100644 workbench/classes/zune/nlist/nlisttree_mcc/NListtree.h create mode 100644 workbench/classes/zune/nlist/nlisttree_mcc/QuickSort.c create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode.c create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode.image create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode.image.info create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode_rev.h create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/SCOPTIONS create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/SCOPTIONS.in create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/SMakefile create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98.c create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98.image create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98.image.info create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98_rev.h create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/SCOPTIONS create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/SCOPTIONS.in create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/SMakefile create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode.c create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode.image create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode.image.info create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode_rev.h create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/SCOPTIONS create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/SCOPTIONS.in create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/SMakefile create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98.c create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98.image create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98.image.info create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98_rev.h create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/SCOPTIONS create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/SCOPTIONS.in create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/SMakefile create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/Samples/AllImages.ilbm create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/Samples/Grab_NListtree182.iff create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/Samples/glowbsp.iff create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/ClosedBall.ilbm create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/ClosedDrawerWin98.ilbm create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/GlowDrawerClosed.ilbm create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/GlowDrawerOpen.ilbm create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/OpenBall.ilbm create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/OpenDrawerWin98.ilbm create mode 100644 workbench/classes/zune/nlist/nlisttree_mcc/library.c create mode 100644 workbench/classes/zune/nlist/nlisttree_mcc/mmakefile.src create mode 100644 workbench/classes/zune/nlist/nlisttree_mcc/private.h create mode 100755 workbench/classes/zune/nlist/nlisttree_mcc/vastubs.c create mode 100644 workbench/classes/zune/nlist/nlisttree_mcc/version.h create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/C_c.sd create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/C_h.sd create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/Debug.c create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/Debug.h create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/Makefile create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/Makefile.dep create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/NListtree-Prefs.c create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/NListtree.c create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/icon.c create mode 100755 workbench/classes/zune/nlist/nlisttree_mcp/icon.h create mode 100755 workbench/classes/zune/nlist/nlisttree_mcp/images/icon32.png create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/images/icon8.iff create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/library.c create mode 100755 workbench/classes/zune/nlist/nlisttree_mcp/locale/NListtree_mcp.cd create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/locale/czech.ct create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/locale/english-british.ct create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/locale/french.ct create mode 100755 workbench/classes/zune/nlist/nlisttree_mcp/locale/german.ct create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/locale/polish.ct create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/locale/russian.ct create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/locale/swedish.ct create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/locale/turkish.ct create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/mmakefile.src create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/private.h create mode 100755 workbench/classes/zune/nlist/nlisttree_mcp/vastubs.c create mode 100644 workbench/classes/zune/nlist/nlisttree_mcp/version.h create mode 100644 workbench/classes/zune/nlist/nlistview_mcc/Debug.c create mode 100644 workbench/classes/zune/nlist/nlistview_mcc/Debug.h create mode 100644 workbench/classes/zune/nlist/nlistview_mcc/Makefile create mode 100644 workbench/classes/zune/nlist/nlistview_mcc/Makefile.dep create mode 100644 workbench/classes/zune/nlist/nlistview_mcc/NListview.c create mode 100644 workbench/classes/zune/nlist/nlistview_mcc/library.c create mode 100644 workbench/classes/zune/nlist/nlistview_mcc/mmakefile.src create mode 100644 workbench/classes/zune/nlist/nlistview_mcc/private.h create mode 100755 workbench/classes/zune/nlist/nlistview_mcc/vastubs.c create mode 100644 workbench/classes/zune/nlist/nlistview_mcc/version.h create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/C_c.sd create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/C_h.sd create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/Debug.c create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/Debug.h create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/Makefile create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/Makefile.dep create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/NListviews-Prefs.c create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/NListviews.c create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/NListviews_mcp.h create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/icon.c create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/icon.h create mode 100755 workbench/classes/zune/nlist/nlistviews_mcp/images/icon32.png create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/library.c create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/locale/NListviews_mcp.cd create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/locale/czech.ct create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/locale/french.ct create mode 100755 workbench/classes/zune/nlist/nlistviews_mcp/locale/german.ct create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/locale/polish.ct create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/locale/swedish.ct create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/locale/turkish.ct create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/mmakefile.src create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/private.h create mode 100755 workbench/classes/zune/nlist/nlistviews_mcp/vastubs.c create mode 100644 workbench/classes/zune/nlist/nlistviews_mcp/version.h create mode 100755 workbench/classes/zune/nlist/tools/bumprev.sh create mode 100755 workbench/classes/zune/nlist/tools/mkrelease.sh diff --git a/workbench/classes/zune/nlist/AUTHORS b/workbench/classes/zune/nlist/AUTHORS new file mode 100644 index 0000000000..f4930d0cbe --- /dev/null +++ b/workbench/classes/zune/nlist/AUTHORS @@ -0,0 +1,49 @@ +/*************************************************************************** + + NList MUI custom classes + + Copyright (C) 1996-2001 by Gilles Masson (NList.mcc) + Copyright (C) 1999-2001 by Carsten Scholling (NListtree.mcc) + Copyright (C) 2006 by Daniel Allsopp (NBitmap.mcc) + Copyright (C) 2001-2010 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id: AUTHORS 509 2010-09-08 06:45:38Z mandi78 $ + +***************************************************************************/ + +The NList classes are an Open Source development effort with the code base +and design provided by the following people (alphabetical order): + +Carsten Scholling +Daniel Allsopp +Gilles Masson +Gunther Nikl +Jens Langner +Przemyslaw Grunchala +Richard Poser +Sebastian Bauer +Thore Boeckelmann +Matthias Rustler + +Translations provided and maintained by following people: + +Czech: Vit Sindlar +French: +German: Thore Böckelmann +Polish: Mariusz Danilewicz +Swedish: Pär Boberg + +The development of the NList classes are hosted by +SourceForge http://www.sf.net/ diff --git a/workbench/classes/zune/nlist/COPYING b/workbench/classes/zune/nlist/COPYING new file mode 100644 index 0000000000..1c1b2c6a68 --- /dev/null +++ b/workbench/classes/zune/nlist/COPYING @@ -0,0 +1,428 @@ + GNU Lesser General Public License + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + [This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + + Preamble + +The licenses for most software are designed to take away your freedom to share +and change it. By contrast, the GNU General Public Licenses are intended to +guarantee your freedom to share and change free software--to make sure the +software is free for all its users. + +This license, the Lesser General Public License, applies to some specially +designated software packages--typically libraries--of the Free Software +Foundation and other authors who decide to use it. You can use it too, but we +suggest you first think carefully about whether this license or the ordinary +General Public License is the better strategy to use in any particular case, +based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. +Our General Public Licenses are designed to make sure that you have the +freedom to distribute copies of free software (and charge for this service if +you wish); that you receive source code or can get it if you want it; that you +can change the software and use pieces of it in new free programs; and that +you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors +to deny you these rights or to ask you to surrender these rights. These +restrictions translate to certain responsibilities for you if you distribute +copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a +fee, you must give the recipients all the rights that we gave you. You must +make sure that they, too, receive or can get the source code. If you link +other code with the library, you must provide complete object files to the +recipients, so that they can relink them with the library after making changes +to the library and recompiling it. And you must show them these terms so they +know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, +and (2) we offer you this license, which gives you legal permission to copy, +distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no +warranty for the free library. Also, if the library is modified by someone +else and passed on, the recipients should know that what they have is not the +original version, so that the original author's reputation will not be +affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free +program. We wish to make sure that a company cannot effectively restrict the +users of a free program by obtaining a restrictive license from a patent +holder. Therefore, we insist that any patent license obtained for a version of +the library must be consistent with the full freedom of use specified in this +license. + +Most GNU software, including some libraries, is covered by the ordinary GNU +General Public License. This license, the GNU Lesser General Public License, +applies to certain designated libraries, and is quite different from the +ordinary General Public License. We use this license for certain libraries in +order to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared +library, the combination of the two is legally speaking a combined work, a +derivative of the original library. The ordinary General Public License +therefore permits such linking only if the entire combination fits its +criteria of freedom. The Lesser General Public License permits more lax +criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it does Less +to protect the user's freedom than the ordinary General Public License. It +also provides other free software developers Less of an advantage over +competing non-free programs. These disadvantages are the reason we use the +ordinary General Public License for many libraries. However, the Lesser +license provides advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the +widest possible use of a certain library, so that it becomes a de-facto +standard. To achieve this, non-free programs must be allowed to use the +library. A more frequent case is that a free library does the same job as +widely used non-free libraries. In this case, there is little to gain by +limiting the free library to free software only, so we use the Lesser General +Public License. + +In other cases, permission to use a particular library in non-free programs +enables a greater number of people to use a large body of free software. For +example, permission to use the GNU C Library in non-free programs enables many +more people to use the whole GNU operating system, as well as its variant, the +GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' +freedom, it does ensure that the user of a program that is linked with the +Library has the freedom and the wherewithal to run that program using a +modified version of the Library. + +The precise terms and conditions for copying, distribution and modification +follow. Pay close attention to the difference between a "work based on the +library" and a "work that uses the library". The former contains code derived +from the library, whereas the latter must be combined with the library in +order to run. + + + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License Agreement applies to any software library or other program +which contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Lesser General +Public License (also called "this License"). Each licensee is addressed as +"you". + +A "library" means a collection of software functions and/or data prepared so +as to be conveniently linked with application programs (which use some of +those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has +been distributed under these terms. A "work based on the Library" means +either the Library or any derivative work under copyright law: that is to say, +a work containing the Library or a portion of it, either verbatim or with +modifications and/or translated straightforwardly into another language. +(Hereinafter, translation is included without limitation in the term +"modification".) + +"Source code" for a work means the preferred form of the work for making +modifications to it. For a library, complete source code means all the source +code for all modules it contains, plus any associated interface definition +files, plus the scripts used to control compilation and installation of the +library. + +Activities other than copying, distribution and modification are not covered +by this License; they are outside its scope. The act of running a program +using the Library is not restricted, and output from such a program is covered +only if its contents constitute a work based on the Library (independent of +the use of the Library in a tool for writing it). Whether that is true depends +on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete +source code as you receive it, in any medium, provided that you conspicuously +and appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this License +and to the absence of any warranty; and distribute a copy of this License +along with the Library. + +You may charge a fee for the physical act of transferring a copy, and you may +at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, +thus forming a work based on the Library, and copy and distribute such +modifications or work under the terms of Section 1 above, provided that you +also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices stating + that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no charge to all + third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a table of + data to be supplied by an application program that uses the facility, + other than as an argument passed when the facility is invoked, then you + must make a good faith effort to ensure that, in the event an + application does not supply such function or table, the facility still + operates, and performs whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square roots has a + purpose that is entirely well-defined independent of the application. + Therefore, Subsection 2d requires that any application-supplied function + or table used by this function must be optional: if the application does + not supply it, the square root function must still compute square + roots.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Library, and + can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work based on + the Library, the distribution of the whole must be on the terms of this + License, whose permissions for other licensees extend to the entire + whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is to + exercise the right to control the distribution of derivative or + collective works based on the Library. + + In addition, mere aggregation of another work not based on the Library + with the Library (or with a work based on the Library) on a volume of a + storage or distribution medium does not bring the other work under the + scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License +instead of this License to a given copy of the Library. To do this, you must +alter all the notices that refer to this License, so that they refer to the +ordinary GNU General Public License, version 2, instead of to this License. +(If a newer version than version 2 of the ordinary GNU General Public License +has appeared, then you can specify that version instead if you wish.) Do not +make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so +the ordinary GNU General Public License applies to all subsequent copies and +derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library +into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, +under Section 2) in object code or executable form under the terms of Sections +1 and 2 above provided that you accompany it with the complete corresponding +machine-readable source code, which must be distributed under the terms of +Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a +designated place, then offering equivalent access to copy the source code from +the same place satisfies the requirement to distribute the source code, even +though third parties are not compelled to copy the source along with the +object code. + +5. A program that contains no derivative of any portion of the Library, but is +designed to work with the Library by being compiled or linked with it, is +called a "work that uses the Library". Such a work, in isolation, is not a +derivative work of the Library, and therefore falls outside the scope of +this License. + +However, linking a "work that uses the Library" with the Library creates an +executable that is a derivative of the Library (because it contains portions +of the Library), rather than a "work that uses the library". The executable is +therefore covered by this License. Section 6 states terms for distribution of +such executables. + +When a "work that uses the Library" uses material from a header file that is +part of the Library, the object code for the work may be a derivative work of +the Library even though the source code is not. Whether this is true is +especially significant if the work can be linked without the Library, or if +the work is itself a library. The threshold for this to be true is not +precisely defined by law. + +If such an object file uses only numerical parameters, data structure layouts +and accessors, and small macros and small inline functions (ten lines or less +in length), then the use of the object file is unrestricted, regardless of +whether it is legally a derivative work. (Executables containing this object +code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the +object code for the work under the terms of Section 6. Any executables +containing that work also fall under Section 6, whether or not they are linked +directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work +that uses the Library" with the Library to produce a work containing portions +of the Library, and distribute that work under terms of your choice, provided +that the terms permit modification of the work for the customer's own use and +reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is +used in it and that the Library and its use are covered by this License. You +must supply a copy of this License. If the work during execution displays +copyright notices, you must include the copyright notice for the Library among +them, as well as a reference directing the user to the copy of this License. +Also, you must do one of these things: + + a) Accompany the work with the complete corresponding machine-readable + source code for the Library including whatever changes were used in the + work (which must be distributed under Sections 1 and 2 above); and, if + the work is an executable linked with the Library, with the complete + machine-readable "work that uses the Library", as object code and/or + source code, so that the user can modify the Library and then relink to + produce a modified executable containing the modified Library. (It is + understood that the user who changes the contents of definitions files + in the Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the Library. A + suitable mechanism is one that (1) uses at run time a copy of the + library already present on the user's computer system, rather than + copying library functions into the executable, and (2) will operate + properly with a modified version of the library, if the user installs + one, as long as the modified version is interface-compatible with the + version that the work was made with. + + c) Accompany the work with a written offer, valid for at least three years, + to give the same user the materials specified in Subsection 6a, above, + for a charge no more than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy from a + designated place, offer equivalent access to copy the above specified + materials from the same place. + + e) Verify that the user has already received a copy of these materials or + that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must +include any data and utility programs needed for reproducing the executable +from it. However, as a special exception, the materials to be distributed need +not include anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the operating +system on which the executable runs, unless that component itself accompanies +the executable. + +It may happen that this requirement contradicts the license restrictions of +other proprietary libraries that do not normally accompany the operating +system. Such a contradiction means you cannot use both them and the Library +together in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library +side-by-side in a single library together with other library facilities not +covered by this License, and distribute such a combined library, provided that +the separate distribution of the work based on the Library and of the other +library facilities is otherwise permitted, and provided that you do these two +things: + + a) Accompany the combined library with a copy of the same work based on the + Library, uncombined with any other library facilities. This must be + distributed under the terms of the Sections above. + + b) Give prominent notice with the combined library of the fact that part of + it is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library +except as expressly provided under this License. Any attempt otherwise to +copy, modify, sublicense, link with, or distribute the Library is void, and +will automatically terminate your rights under this License. However, parties +who have received copies, or rights, from you under this License will not have +their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. +However, nothing else grants you permission to modify or distribute the +Library or its derivative works. These actions are prohibited by law if you do +not accept this License. Therefore, by modifying or distributing the Library +(or any work based on the Library), you indicate your acceptance of this +License to do so, and all its terms and conditions for copying, distributing +or modifying the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), +the recipient automatically receives a license from the original licensor to +copy, distribute, link with or modify the Library subject to these terms and +conditions. You may not impose any further restrictions on the recipients' +exercise of the rights granted herein. You are not responsible for enforcing +compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not excuse +you from the conditions of this License. If you cannot distribute so as to +satisfy simultaneously your obligations under this License and any other +pertinent obligations, then as a consequence you may not distribute the +Library at all. For example, if a patent license would not permit royalty-free +redistribution of the Library by all those who receive copies directly or +indirectly through you, then the only way you could satisfy both it and this +License would be to refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, and +the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or +other property right claims or to contest validity of any such claims; this +section has the sole purpose of protecting the integrity of the free software +distribution system which is implemented by public license practices. Many +people have made generous contributions to the wide range of software +distributed through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing to +distribute software through any other system and a licensee cannot impose that +choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain +countries either by patents or by copyrighted interfaces, the original +copyright holder who places the Library under this License may add an explicit +geographical distribution limitation excluding those countries, so that +distribution is permitted only in or among countries not thus excluded. In +such case, this License incorporates the limitation as if written in the body +of this License. + +13. The Free Software Foundation may publish revised and/or new versions of +the Lesser General Public License from time to time. Such new versions will be +similar in spirit to the present version, but may differ in detail to address +new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and "any later +version", you have the option of following the terms and conditions either of +that version or of any later version published by the Free Software +Foundation. If the Library does not specify a license version number, you may +choose any version ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs +whose distribution conditions are incompatible with these, write to the author +to ask for permission. For software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we sometimes make +exceptions for this. Our decision will be guided by the two goals of +preserving the free status of all derivatives of our free software and of +promoting the sharing and reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE +STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE +LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, +YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL +ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE +THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE +OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR +DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR +A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH +HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/workbench/classes/zune/nlist/ChangeLog b/workbench/classes/zune/nlist/ChangeLog new file mode 100644 index 0000000000..0d3b7e4c5b --- /dev/null +++ b/workbench/classes/zune/nlist/ChangeLog @@ -0,0 +1,2069 @@ +--------------------------------- +MUI NList MCC classes - ChangeLog +--------------------------------- + +$Id$ +$URL: https://nlist-classes.svn.sourceforge.net/svnroot/nlist-classes/releases/0.111/ChangeLog $ + +#### v0.111 RELEASE ########################################################### + +2011-12-17 Jens Langner + + * misc: final v0.111 release preparations + +2011-12-15 Thore Böckelmann + + * nlistree_mcc/NListtree.c: fixed a NULL pointer access when invoking the + MUIM_NListtree_CopyToClip method when no tree entry is selected. + +2011-12-15 Jens Langner + + * nlist_mcc/NList_mcc6.c: reimplemented the new PartialColumn text substitution + feature where "..." is showing in a column rather than showing some dotted line + at the end of the column if text doesn't fit. Now the text substitution area can + be specified in MUIA_NList_Format via PCS_LEFT/PCS_RIGHT/PCS_CENTER/PCS_DISABLED. + So application developers can now specify the text alignment by using these + format specs. NList will then replace not fitting text with "..." characters + to signal that text was stripped. Please note, however, that this feature is + still not being perfect and there might be situation where the "..." text might + be added at the wrong position (e.g. if different font styles/objects are using + in one column). + +2011-08-03 Thore Böckelmann + + * Makefile: added definition of __amigaos3__ for all classes for the OS3 + build to make OS3 specific stuff easier to implement. + * nlist_mcc/NList_mcc3.c, nlist_mcc/NList_mcc6.c: fixed offsets when drawing + the background image for the upcoming MUI 3.9 of AmigaOS 4.1 update #3. + +2011-07-14 Mariusz Danilewicz + + * nlisttree_mcp/locale/polish.ct: update to the latest changes. + +2011-07-12 Jens Langner + + * nlisttree_mcc/nlisttree_mcp: now that NList allows to define zero sized + objects we could remove the IndentWidth > 3 enforcement and make NListtree + allow IndentWidths down till 0. However, we do have to enforce that the correct + NList version is installed or the NListtree layout is screwed up. Furthermore, + renamed the "Indent width" to "Additional indent width" as that better + describes what this is all about. In addition, the new default for the + indent width is zero as that ensures a small NListtree object. + * nlist_mcc/NList_mcc4.c: now objects defined with \033O and \033I can have a + minimal width of 0. Previously NList always enforced a minimum of 2 which + caused some pixel alignment problems with e.g. NListtree. + +2011-07-11 Thore Böckelmann + + * nlisttree_mcp/locale: updated german and english-british translations. + * nlisttree_mc[cp]: renamed the "dashed" mode to "dotted", as this is more + appropriate. + +2011-07-10 Jens Langner + + * nlisttree_mcp: forgot to add the new LineType and UseFolderImage config items + to the dataspace. Thus they were never queried by applications using NListtree.mcc. + * nlisttree_mcc, nlisttree_mcp: completly reworked the preferences setup and got + rid of the way NListtree allows to use different "Styles". This was not only + partly nonsense, but was also not completely consistently implemented. Now every + parameter of the previously allowed style parameters can be configured + separately in the MCP. In addition, tree display and how the different parameters + are use should be way more consistent. Also drawing the tree should be more + pixel accurate than before and produce the same layout no matter which line + type is selected in the preferences. In addition, new sensible default parameters + are now in place which should give everyone a nice lookin default tree with + the possibility to tune everything on their own will. Some fine tuning might + still be required to get everything more smoothly implemented, but the whole + tree display and management should be way more consistent and intuitive. + +2011-07-06 Thore Böckelmann + + * demo/NList-Demo.c, demo/NListtree-Demo.c: added list of used classes. + +2011-07-03 Jens Langner + + * nlisttree_mcp/NListtree.c: changed default imagespec settings to use 6:XXX rather + than 1:XXX. This should automatically chose the right image per default based on + the global settings. + * nlist_mcc/NList_mcc6.c: we now add "..." to the end of a string if it doesn't + fit in a column and was stripped accordingly. This should make it more obvious + for the user that there is more to read if he is going to enlarge the column. + +2011-05-04 Thore Böckelmann + + * include/libraries/mui.h: removed the AROS-only STACKED keywords which are + not needed at all, since AROS has its own header file. + * include/mui/NList_mcc.h: added definition of SIPTR for non-AROS systems. + * misc: fixed various (S)IPTR related warnings due to the latest AROS specific + changes. + +2011-04-19 Matthias Rustler + + * misc: backport of AROS fixes. + +#### v0.110 RELEASE ########################################################### + +2011-04-17 Jens Langner + + * misc: final v0.110 release preparations + +2011-02-22 Thore Böckelmann + + * nlist_mcc/NList_func.c: MUIM_NList_GetEntry tries to avoid a possible NULL + pointer access in case no valid pointer to store the entry is given. The + entry pointer itself is returned as the methods return value in any case. + This matches the behavior of List.mui. + * nfloattext_mcc/NFloattext.c, nlistview_mcc/NListview.c: removed an unused + macro. + +2011-02-17 Thore Böckelmann + + * nlist_mcc/NList_func2.c: try to move around entries only if there is really + anything to move. + * nlist_mcc/Debug.c: implemented the STARTCLOCK() and STOPCLOCK() functions to + be able to measure real execution times. + * nlist_mcc/NList_mcc.c: set the entry pool's threshold size to the same value + as the puddle size for the non-OS4 builds. This improves freeing items from + the pool a lot. + * nlist_mcc/NList_func2.c: removed a duplicate setActive() call without any + effect. + +2011-02-07 Thore Böckelmann + + * nlist_mcc/NList_func4.c: readded the pen number check which accidentally got + removed during the recent code cleanup and caused bodychunk object to be not + displayed anymore, because their color depth was calculated as zero. This + closes bug #317905. + +2011-02-05 Jens Langner + + * nlisttree_mcp/locale, nlistviews_mcp/locale: added turkish catalog + translation kindly provided by Alper Sönmez. + +2011-02-04 Thore Böckelmann + + * all/Makefile: fixed the dependency generation to respect the system specific + object file path. + +#### v0.109 RELEASE ########################################################### + +2011-02-03 Jens Langner + + * misc: final v0.109 release preparations + +2011-01-03 Thore Böckelmann + + * nlist_mcc/NList_mcc2.c: fixed a very strange isse which occured when a used + clicked inside a list while the window had MUIA_Window_Sleep set to TRUE. In + this case the click seemed to be cached and be applied again as soon as the + window was woken up again, which is definitely wrong. + It remains to be seen if this change causes any new funny things. + Thanks to Andreas Falkenhahn for the hint! + +2011-01-02 Thore Böckelmann + + * nlist_mcc/NList_mcc5.c: removed a double check for a pending entry click + notification. + +2010-12-20 Thore Böckelmann + + * nlist_mcc/NList_func.c: removed an unneeded function. + * nlist_mcc/NList_mcc5.c: use the class pointer obtained during OM_NEW instead + of getting it each time anew. + * nlist_mcc/NList_mcc6.c: got rid of some V37 graphics.library bug workarounds. + * nlist_mcc/NList_mcc4.c: got rid of some V37 intuition.library limitations. + * include/mccinit.c, #?/library.c: raised the minimum required system version + to OS3.0. + +2010-12-18 Thore Böckelmann + + * nlisttree_mcc/NListtree.c: use Exec functions to navigate within a list on + AmigaOS4 and AROS. + * nlist_mcc/misc: removed some OS2.x compatibility code. + * nbalance_mcc/misc: removed some OS2.x compatibility code. + +2010-12-16 Thore Böckelmann + + * nlist_mcc/all: LOTS of code clean up. For some very obscure reason Gilles + decided to pass a pointer to the object and its instance data to all called + functions, although the instance data already carry a pointer to the object + and many deeply nested function don't need the object pointer at all. This + caused lots of stack space to be wasted for no good reason and made NList + much slower than necessary due to the additional overhead of passing unused + parameters. + +2010-12-10 Thore Böckelmann + + * nlisttree_mcc/NListtree.c: implemented construct, destruct, compare and + display methods which can be overloaded by subclasses. These methods fall + back to the corresponding old hooks in case they are not overloaded. Also + removed some parameters being passed separately although they are globally + available through the instance data which is passed as well and there are + no alternatives to affected the parameters. + * nlist_mcc/misc: heavily cleaned up the memory management by removing all the + wrapper functions and using Alloc/FreeVecPooled directly. For the 68k build + appropriate reimplementations have been added which are still compatible + with OS2.x. This saves lots of additional jumps and passing of unused + parameters. + * nlist_mcc/misc: added a second size optimized pool for the single entries. + For the AmigaOS4 build this is an item pool, for all other builds a pool + with appropriate puddle and threshold sizes is used. This should speed up + entry handling a bit more. + * nlist/misc: dropped custom memory pool implementation. This means that OS2.x + is no longer supported and OS3.0 is the absolute minimum. But then, who does + really still use OS2.x with a monster like NList? + +2010-12-09 Thore Böckelmann + + * nlisttree_mcc/NListtree.c: replaced the NList display hook by a method. This + requires at least NList 20.127. + * nlisttree_mcc/NListtree.c: the version of NList.mcc is now queried directly + instead of the previous indirect method. + +2010-11-16 Thore Böckelmann + + * nbitmap_mcc/NBitmap.c: redraw the background only if we are told to be a + button. Otherwise the truecolor .mcp images will not be drawn correctly. + * nbitmap_mcc/SetPatch.c: replaced the version check of graphics.library by a + more appropriate check of the installed SetPatch command. + +2010-11-15 Thore Böckelmann + + * nbitmap_mcc/Chunky2Bitmap.c: don't use WritePixelLine8() on plain OS3.1 + systems, as this function is broken there and may trash memory. + * demo/NBitmap-Demo.c: added some error messages in case something went wrong. + +2010-10-05 Thore Böckelmann + + * include/mccinit.c: make sure that removing the library during LibClose() + really operates on the correct base. Calling LibExpunge() on MorphOS is + wrong, since that takes no parameter but expects the base to be in A6. We + work around this by using an additional function which gets called from + LibClose() and LibExpunge() with the correct base pointer. + +2010-10-04 Thore Böckelmann + + * nlist_mcc/NList_func2.c: fixed another wrong handling of the special value + MUIV_NList_Move_Next. + * nlist_mcc/NList_func2.c, nlist_mcc/move.c: fixed the wrong behaviour of + MUIM_NList_Move. The destination position was always decremented and the + item was moved to the position ahead of the inteded one. Now NList behaves + exactly like List.mui again. Thanks to Andread Falkenhahn for the hint. + +#### v0.108 RELEASE ########################################################### + +2010-09-23 Jens Langner + + * misc: final v0.108 release preparations + +2010-09-18 Pär Boberg + + * nlisttree_mcp/locale/swedish.ct, nlistviews_mcp/locale/swedish.ct: + new file generated by FlexCat 2.7. + +2010-09-15 Thore Böckelmann + + * nbitmap_mcc: the chunky->bitmap conversion needed for systems using either + native graphics or CyberGraphics is now done using WritePixelLine8() instead + of WritePixelArray() or our own reimplementation. The WPA() reimplementation + also uses WPL8() instead of the dead slow SetAPen/WritePixel combo. + +2010-09-14 Thore Böckelmann + + * nbitmap_mcc/misc: fixed lots of bugs when having to dither raw truecolor + images for a colormapped screen. Additionally the background is now drawn + correctly in case a pattern is used. + +2010-09-10 Thore Böckelmann + + * tools/mkrelease.sh: split up the catalog copying due to the different + translations available. + * nlisttree_mcp/Makefile: removed the utterly outdated russian translation + until it is updated again. + +2010-09-09 Thore Böckelmann + + * nlist_mcc/NList_mcc.c: removed the globally cached muiRenderInfo pointer. + The pointer is now obtained whenever it is needed. + +2010-09-08 Mariusz Danilewicz + + * AUTHORS: added translators section (please check and update missing persons). + +2010-09-06 Thore Böckelmann + + * mccinit.c: added missing #include for memset(). + +2010-09-06 Thore Böckelmann + + * nlist_mcc/NList_mcc4.c: fixed a serious issue when an application wanted to + override the MUIM_NList_Display method. The supplied preparses pointer was + completely wrong and using it caused instant crashes. The internal fallback + to one of the hook functions worked only because NList's internal display + function never used the pointers, but relied on its private knowledge about + the source of the pointers. I can't believe no developer complained about + this bug before! + +2010-09-03 Thore Böckelmann + + * mccinit.c, #?/ClipboardServer.c: updated to the latest version and clear all + embedded semaphore structures before calling InitSemaphore(). + * nbitmap_mcc/NBitmap-Test.c: don't require cybergraphics.library to be avail- + able since everything should work without it. + * nbitmap_mcc/NBitmap-Test.c: close the libraries in exact reverse open order. + +2010-09-02 Thore Böckelmann + + * misc: fixed the definition of DoSuperNew() for all builds except MorphOS. + +2010-09-01 Thore Böckelmann + + * nbitmap_mcc/NBitmap.c: replaced the last occurences of WritePixelArray() by + the WPA() macro which is aware of the minimum required version of CGX. + * nbitmap_mcc/WritePixelArray.c: added missing increase of source pointer. + * nbitmap_mcc/DitherImage.c: clear the mask bitmap, otherwise we will get + trashed graphics. + * nlistview_mcc/NListview.c: if the HandleEvent or HandleInput methods must be + forwarded to the embedded NList object the methods' return code is now + correctly returned to MUI itself. This fixes ticket #200 of YAM. + * nbitmap_mcc/WritePixelArray.c, nbitmap_mcc/NBitmap.c: added a quite dumb but + working reimplementation of WritePixelArray() for OS3 systems without CGX or + P96. This fixes bug #3057361. + * nbitmap_mcc/WritePixelArrayAlpha.c: fixed the final image calculation by + combining the correct RGB values. This makes it possible to correctly + display alpha blended images even with V42 CGX/OS3 systems. + +2010-08-31 Jens Langner + + * nbitmap_mcc: changed the DitherImageA() function to have 2 arguments rather than + a single one. This allowed to get rid of the SLOWSTACK stuff in DitherImage() + and thus have a single unified function. + * misc: checked all varargs function to not use the SLOWSTACK stuff on AROS + as this might be the reason for our recent problems with NList and AROS. With + the SDI stdarg macros all this SLOWSTACK stuff does not seem to be required + anymore. + +2010-08-31 Thore Böckelmann + + * nbitmap_mcc/NBitmap.c: readded the custom implementation of + WritePixelArrayAlpha() for OS3 systems which don't have this function yet. + The alpha channel calculation is not yet perfect, but it works. This fixes + bug #3055632 of TextEditor.mcc. + +2010-08-30 Thore Böckelmann + + * nbitmap_mcc/DitherImage.c: allocate chip RAM for the dithered images + instead of any RAM. This should fix display problems on systems with native + chipset. + +2010-08-30 Jens Langner + + * misc: unified all DoSuperNew() methods to be static and to use the VA_LIST + macros defined in SDI_stdarg.h rather than using the SLOWSTACK stuff on AROS. + * misc: changed all makefiles to use -O2 for the optimization level for AROS + compiles. This should hopefully fix the crashes with the latest versions + released. It seems something prevents to compile NList with -O3 on AROS. + * misc: fixed some AROS related compiler warnings + +2010-08-29 Jens Langner + + * nlistviews_mcp,NListviews_mcp.h: changed the default keybindings to select + entries in the listview with the ALT key rather than the CONTROL key because + the default MUI keybindings are already using the CONTROL key for scrolling + up/down thus clashes with the default NList settings. + +2010-08-27 Thore Böckelmann + + * nlisttree_mcc/NListtree.c: added a similar workaround as for NListview.mcc + for MUI 3.8. The tree object must let the superclass handle certain key + presses. + * nlistview_mcc/NListview.c: added a workaround for MUI 3.8. The embedded list + object does not get the MUIM_HandleEvent method, we must forward it ourself. + This is no issue with MUI 3.9+. + +2010-08-24 Matthias Rustler + + * mmakefile.src: changes of the AROS build system required some fixes + +#### v0.107 RELEASE ########################################################### + +2010-08-18 Jens Langner + + * misc: final v0.107 release preparations + +2010-08-17 Thore Böckelmann + + * nlisttree_mcc/NListtree.c: raised the eventhandler's priority to 2. This + fixes the double click issue to open closed nodes. + +#### v0.106 RELEASE ########################################################### + +2010-08-16 Jens Langner + + * misc: final v0.106 release preparations + +2010-08-16 Thore Böckelmann + + * nlist_mcc/NList_mcc.c: raised the eventhandler's priority to +1. This solves + the problem that the NList object was no longer getting key presses as soon + as a horizontal scrollbar was added due a resized window. + +2010-08-12 Jens Langner + + * nlist_mcc: implemented new MUIM_NList_SetActive method which will replace + the old method of setting an entry active via MUIA_NList_Active. The new + method allows to set the entry active and make it immediately visible via + an internal call to MUIM_NList_Jump. In addition this method allows to + set additional flags and should perform a bit faster instead of executing + a MUIA_NList_Active call together with a Jump call. + * nlist_mcc/NList_func.c: moved the functionality of MUIM_NList_Jump into an + own static function NL_List_Jump() and made NL_List_Active() also utilizing + this new function for jumping to the right entry to make it visible. + +2010-08-11 Jens Langner + + * nlist_mcc: replaced the recently added global MUIA_NList_CenterOnJump + attribute with an additional MUIV_NList_Jump_Active_Center value that can + be supplied to the MUIM_NList_Jump method to perform a centered jump for + the currently active entry. This should be a bit more convienent than having + to set a global attribute. + +2010-07-30 Thore Böckelmann + + * nlist_mcc: added new attribute MUIA_NList_CenterOnJump to make the method + MUIM_NList_Jump not just jump to the given entry but also center the display + on that entry. + * nlistview_mcc/NListview.c: moved some inlined code to separate functions. + * nlist_mcc: the parent NListview object is now determined during MUIM_Setup + to correctly fulfil the "active object on click" feature due to the latest + changes. + * nlistview_mcc/NListview.c: forward any modifications of the key focus + attributes to the NList object. + * docs/MCC_NList.doc: added documentation for new MUIA_NList_CenterOnJump + attribute. + +2010-07-29 Thore Böckelmann + + * nlist_mcc/misc, nlistview_mcc/misc: made the two attributes + MUIA_NList_Active/DefaultObjectOnClick get()able to let the surrounding + NListview object derive the "active border visible" from the embedded list + object. + * nlist_mcc/NList_mcc2.c: the "active object on click" feature must set the + surrounding listview as active object instead of itself. + * doc/MCC_NList.doc: updated Autodocs according to latest changes. + * nlist_mcc/NList_func.c: "moved" the centering of the active entry to the + MUIM_NList_Jump method. + +2010-07-08 Thore Böckelmann + + * nlist_mcc/NList_func.c: setting the active entry will now try to show the + entry centered within the visible lines if it was outside before. Further- + more NList will ensure that the last item is shown on the last line (no + empty space below the last line). + * all/Debug.c: added CleanupDebug() function needed by the latest mccinit.c. + +2010-06-29 Thore Böckelmann + + * mcp/locale/swedish.ct: added ##codeset line. + +2010-06-25 Thore Böckelmann + + * nlist_mcc/NList_mcc2.c: the custom pointers will be shown only if the mouse + is over the respective object instead of just being over the list's window. + Although I could not reproduce the effect with AmigaOS3 this should fix the + problems on MorphOS. + +2010-06-11 Thore Böckelmann + + * Install-MCC: extended the final message that a reboot might be necessary to + be able to use the just installed version. + +2010-06-06 Thore Böckelmann + + * include/SDI_compiler.h: updated to latest version. + * misc: added lots of type casts due to latest AROS changes. + +2010-06-06 Matthias Rustler + + * nbitmap_mcc/private.h: fixed definition of types. You can't assume that + "long" is 32 bit on all systems. + * demo/NBitmap-Demo.c: wrong type caused corrupt images on 64-bit AROS. + * mmakefile.src: fixed copying of png.icon + * some warnings removed, some TODO comments added. + +2010-06-05 Matthias Rustler + + * mmakefile.src: updated to recent changes + * mccinit.c: updated to current version + * some fixes for 64-bit AROS (ULONG -> IPTR) + +2010-05-28 Thore Böckelmann + + * nlist_mcc: cleaned up the config import and export functions. + +2010-05-27 Thore Böckelmann + + * dist/Install-MCC: the supported languages are now collected dynamically + instead of being defined statically. Furthermore the .mcc name must be + specified in the script's icon as application name. This makes it possible + to use the script for arbitrary classes without modification. + * dist/icons: set some reasonable default icon positions. + * nlist_mcc: removed the permanent copy of the exported stuff as this is not + needed at all outside the export function. + +2010-05-26 Thore Böckelmann + + * dist/Install-MCC: added the first version of a generic MCC Installer script. + To use this script for other classes only the name and the set of supported + languages needs to be adapted. + +2010-05-20 Mariusz Danilewicz + + * ChangeLog: updated - missed last time. + +2010-05-20 Mariusz Danilewicz + + * nlistviews_mcp\locale\NListviews_mcp.cd: fixed typo in + MSG_FUNC_DEFALLORDERCOL and updated (c) notice in MSG_EXAMPLE_TEXT + * nlistviews_mcp\locale\polish.ct: added Polish translation + * nlisttree_mcp\locale\polish.ct: added Polish translation + * tools\mkrelease.sh: added generating Polish catalog to release + * nlistviews_mcp\makefile and mmakefile.src: added generating Polish catalog + * nlisttree_mcp\makefile and mmakefile.src: added generating Polish catalog + +2010-05-20 Thore Böckelmann + + * Makefiles: add varargs stubs only for those systems which really need it. + +2010-05-19 Thore Böckelmann + + * demo/NBitmap-Demo.c: replaced the old and complete broken demo application + by our stripped down test application. A few bells and whistles less than + the former demo application, but at least it works without problems and + shows the new handling of raw image data. + * added stuff for automated build of release archives. + +#### v0.105 RELEASE ########################################################### + +2010-05-16 Jens Langner + + * misc: final v0.105 release preparations + +2010-05-11 Thore Böckelmann + + * include/mui/NList_mcc.h: added a comment to skip certain method IDs for + future extensions to avoid clashes with other classes. + * nlist_mcc/NList_mcc6.c: use GetBitMapAttr() to determine a bitmap's depth + of V39+ systems instead of peeking around. + * nlist_mcc: replaced custom stpcpy() function by uses of then overrun-save + functions strlcpy() and snprintf(). + * nlist_mcc: removed now unused function ltoa(). + +2010-05-07 Thore Böckelmann + + * nlist_mcc/NList_mcc2.c: clicks on the list's border are no longer taken as + valid clicks within the list. Before such clicks resulted in the first/last + entry to be selected, which is not very intuitive. This fixes bug #2951808. + * nlist_mcc/NList_mcc4.c: simplified the image spec handling. Specifying + additional dimensions was discouraged anyway and the old scanning algorithm + completely broke the color handling. Effectively this fixes bug #1272693. + * doc/MCC_NList.doc: updated documentation about direct "ESC I[]" image + specs. Only image specs followings the rules are supported from now on. + +2010-05-06 Thore Böckelmann + + * nlist_mcc/NList_mcc.c: the class will now forget that its MUIM_Setup method + has been invoked before deleting possibly added list images. Otherwise the + surrounding group would be told to perform a relayout, which is not a very + good thing to do while everything is being cleaned up. This fixes bug + #2977811. + +2010-05-04 Thore Böckelmann + + * nbitmap_mcc/NBitmap.c: fixed slightly broken handling of RGB24 data. + Additionally the required bitmap for transparent colormapped blits with + CyberGraphics is now created once instead of on every redraw. + +2010-05-03 Thore Böckelmann + + * nbitmap_mcc: implemented a simple dithering to be able to display truecolor + images on colormapped screens. A fixed but colorful palette will be used. + +#### v0.104 RELEASE ########################################################### + +2010-04-30 Jens Langner + + * misc: final v0.104 release preparations + * include/libraries/mui.h: added MORPHOS #ifdef to maskout the Rawimage + definition. + +2010-04-30 Thore Böckelmann + + * mcp/library.c: added version check for NBitmap.mcc. Only version V15.8+ can + handle raw image data. + +2010-04-29 Jens Langner + + * nbitmap_mcc: unified the draw image routines of the raw data and dtobject + functionality so that the raw data can be used equivalently to the file + or dtobject based functionality. However, somehow this new functionality + have to be slightly tested before we can really roll it out. Especially + the shape drawing part have to be evaluated if this still work with raw + data as well. + +2010-04-29 Thore Böckelmann + + * nbitmap_mcc/dispatcher.c: let OM_NEW fail if no valid type is specified. + +2010-04-28 Thore Böckelmann + + * nbitmap_mcc/misc: added some new attributes to handle raw image data. + +2010-04-27 Thore Böckelmann + + * mcp/library: all systems now try to create a truecolor prefs image using + Rawimage.mcc first before falling back to the old 8bit images. + +2010-04-26 Thore Böckelmann + + * mcp/misc: merged all converted image data into one file, moved the image + files to a separate subdirectory, combined the prefs icon generation for + all platform into one function. + +2010-04-24 Thore Böckelmann + + * include/mccinit.c: updated to latest version. This fixes the stack swapping + for AROS. + +2010-04-23 Ilkka Lehtoranta + + * mcp/misc: use bzip2 compressed 32bit prefs image on MorphOS 2. + +2010-04-12 Thore Böckelmann + + * mcp/misc: added 32bit truecolor prefs image done by Martin 'Mason' Merz. + This requires at least MUI3.9 and AmigaOS 4.1. + +2010-03-13 Thore Böckelmann + + * nlisttree_mcc/NListtree.c: added another check if compositing is really + enabled on the object's screen. + +2010-03-11 Thore Böckelmann + + * nlisttree_mcc/NListtree.c: finally it is possible to automatically open + closed nodes during drag'n'drop sessions by simply dragging an object over + a closed node and wait there for at least one second. Since opening the + node might cause bigger graphical updates on the screen this feature + requires a non-locked screen. That means that for example LockLayers() + must *NOT* have been called before. Currently this is only the fact with + the yet unreleased next MUI3.9 for OS4 and only on hi/truecolor screens. + +2010-01-08 Thore Böckelmann + + * nlistview_mcc/NListview.c: reverted the last change as it didn't really + work out and still caused some issues with dynamically added scrollbars. + +2010-01-06 Thore Böckelmann + + * nlistview_mcc/NListview.c: added a workaround to the layout issue when the + dynamically added/removed scrollbars caused a screwed up layout with objects + drawn over the window borders. Also cleaned up the source a lot. + * nlistview_mcc/NListview.c: cleaned up the code even more. Now all added + notifications are removed again when the scrollbars are removed from the + layout. + +2010-01-04 Thore Böckelmann + + * nlist_mcc/private.h: added missing rawkey definitions for PageUp, PageDown, + Pos1 and End keys. OS3 doesn't know these. + +2009-12-30 Thore Böckelmann + + * nlist_mcc/NList_mcc2.c: the PageUp, PageDown, Pos1 and End keys can now be + used to navigate within a list in addition to the standard MUI keys. + * nlist_mcc/NList_mcc2.c: simplified the code keyboard scrolling code a bit. + +2009-11-28 Thore Böckelmann + + * nlist_mcc/ClipboardServer.c, nlisttree_mcc/ClipboardServer.c: decreased the + stack size from 16K to 8K as the server process doesn't really need much + stack. + +2009-10-28 Thore Böckelmann + + * nlisttree_mcc/Debug.c: added the missing DBF_CLIPBOARD class. + +2009-10-26 Pär Boberg + + * nlistviews_mcp/locale/swedish.ct: very minor update. + +#### v0.103 RELEASE ########################################################### + +2009-10-24 Jens Langner + + * misc: final v0.103 release preparations + +2009-10-15 Thore Böckelmann + + * nlist_mcc/NList_func.h: replaced the custom style definitions by official + ones. + * nlist_mcc/NList_func2.c, docs/MCC_NList.doc: MUIM_NList_ReplaceSingle was + broken in several ways. Passing pos==MUIV_NList_Insert_Bottom did nothing + instead of replacing the last entry, pos==MUIV_NList_Insert_Active chose + the correct entry, but due to a missing "break;" statement that entry was + discarded again and caused no replacement at all. Again thanks to Andreas + Falkenhahn for the hint. + * demo/NList-Demo#?.c: removed some unneeded includes. + * nlist_mcc/NList_mcc1.c: get()ting MUIA_Disabled always returned FALSE even + for disabled lists. Thanks to Andreas Falkenhahn for the hint. + +2009-09-19 Thore Böckelmann + + * misc: added a name to all memory pools for OS4. + +2009-09-17 Thore Böckelmann + + * nlistviews_mcp/locale/german.ct, nlistviews_mcp/Makefile: added a german + translation. + * nlisttree_mcp/locale/german.ct: replaced the former german translation with + a completely new one. + +2009-09-16 Thore Böckelmann + + * nlist_mcc/misc: loaded all clipboard access stuff off to a separate process. + Accessing the clipboard via iffparse.library requires 2 user signals for + each instance and thus an application would run out of free signals sooner + or later. + * nlisttree_mcc/misc: applied the same changes as for NList.mcc and clipboard + access. + +2009-08-14 Thore Böckelmann + + * Makefiles: added "-g" to the debug flags. It seems the OS3 GCC 2.95.3 cross + compiler needs this to generate debug infos at all. + +2009-06-16 Thore Böckelmann + + * nlisttree_mcc/NListtree.c: added some APTR typecasts to fix several type pun + warnings. + * nlist_mcc/NList_func.c: replaced the hand crafted message for the embedded + DoMethodA() call by a proper structure. This fixes a type pun warning. + +2009-06-15 Matthias Rustler + + * Renamed francais.ct to french.ct, so that we have only English language names. + * Added catalog creation to AROS metamakefiles + * nlisttree_mcc/NListtree.c: check variable "ln" to avoid a segfault. + This happened in the NListtree demo when the button "GetNr" was pressed + while no list entry was selected. + +2009-06-15 Thore Böckelmann + + * nlist_mcc/NList_func3.c: replaced the hand crafted clipboard accesses by + proper iffparse.library calls. This circumvents the endian conversions and + is much easier to understand. + +2009-06-15 Matthias Rustler + + * Made clipboard functions endiannes aware. + +2009-06-08 Matthias Rustler + + * AROS metamakefiles added. + * Added "ioreq.io_Message.mn_Length = sizeof(ioreq)" because + console.device won't open without this on AROS. + * Some fixes for 64-bit AROS + * Re-added some fixes from previous AROS port. + +2009-06-06 Jens Langner + + * misc: adapted the whole build system to compile all NList classes + finally for AROS. Now everything should compile and link fine with an + AROS cross-compiler and if everything works out fine the next NList + release will come with AROS binaries. + +2009-05-04 Thore Böckelmann + + * include/SDI_lib.h: updated to the latest version. + +2009-05-03 Ilkka Lehtoranta + + * nbitmap_mcc/NBitmap.c: use 16-byte AltiVec alignment to maximise software + blitting performance on Pegasos and Mac Mini. + +2009-05-02 Ilkka Lehtoranta + + * include/mccinit.c: RTF_EXTENDED was not set for the MorphOS build making + revision number ineffective. + +2009-04-30 Thore Böckelmann + + * updated the SDI headers to their latest fixed versions. + +2009-04-21 Thore Böckelmann + + * nlisttree_mcp/Makefile: changed printf command to standard echo. + * nlist_mcc/NList_mcc1.c: adjusted some variable type due to the recent + changes in the OS4 SDK. + +2009-04-20 Jens Langner + + * misc: changed all makefiles to also include the AROS targets. In addition + the whole build environment has been attached to compile all of our mcc + and mcp classes for AROS. Now all NList classes should at least compile + and link fine for AROS. If they properly work has to be tested first. :) + +2009-04-08 Thore Böckelmann + + * updated the SDI headers and mccinit.c to their latest fixed versions. + +2009-03-21 Thore Böckelmann + + * nlisttree_mcp/NListtree.c: added missing MUI_DisposeObject() call for an + Imagedisplay.mui object. + +2009-01-30 Thore Böckelmann + + * nbalance_mcc/Makefile, nbitmap_mcc/Makefile: the OS4 build is now linked + against newlib instead of clib2. + * nlist_mcc/misc: added new tag MUIA_NList_IgnoreSpecialChars. This attribute + accepts a NUL terminated string of characters to be ignored during string + parsing. This is meant to be able to use special characters like 0xA0, which + is used by some fonts (i.e. the Alpha character in some greek fonts). By + default the 0xA0 character is used as a "non breaking space" and will be + treated a such. + * Makefile: removed the printf usage with the ANSI codes and replaced them + by the more intuitive CC/LD echo output. + * nbitmap_mcc/NBitmap.c: completely rewrote the images shading. The class no + longer grabs the already blitted images from the RastPort and applies a hand + crafted alpha shade. Instead precalculated shade arrays are used and alpha + blitted over the normal images. This speeds things up a lot. + * nbitmap.c/misc: removed dependency on cybergraphics.library since everything + is done via graphics.library now. + * nbitmap.c/NBitmap.c, nbitmap_mcc/dispatcher.c: the latest changes didn't + respect a possibly changed border size during AskMinMax. + +2008-12-17 Thore Böckelmann + + * nlist_mcc/Makefile: modified Makefile to include the custom memory pool + functions for OS2.x in the OS3 build only. + * nlisttree_mcc/NListtree.c: replaced some deprecated function calls by new + ones for the the OS4 build. + * nlist_mcc/NList_func3.c, nlist_mcc/cbio.c: replaced some deprecated function + calls by new ones for the the OS4 build. + +2008-07-01 Thore Böckelmann + + * #?/Pointer.c: reverted all AllocMem() calls back to AllocVec(). If chip RAM + really is that precious, then a low chip memory situation will occur even + before MUI is able to open a window with all bells and whistles enabled. + Using AllocVec() instead of AllocMem() is really much more intuitive. Also + made the color management for the pointer images OS2.x compatible by using + GetRGB4() instead of GetRGB32(), which is OS3.x only. Although I really + doubt anybody is still seriously using MUI 3.8+ on an OS2.x system in 2008. + +2008-06-30 Ilkka Lehtoranta + + * #?/Pointer.c: use MorphOS 2.0 system pointers. Also changed AllocVec() + calls by AllocMem() to save precious chip ram. + +2008-06-25 Vit Sindlar + + * nlistviews_mcp/locale/czech.ct: Updated to match the latest .cd file. + +#### v0.102 RELEASE ########################################################### + +2008-06-24 Jens Langner + + * misc: final v0.102 release preparations + * nbalance_mcc/NBalance.c: forgot to return MUIA_Version and + MUIA_Revision for checking the version application-wise. + * nlistviews_mcp: replaced the calloc() and free() usage against AllocVec() + and FreeVec() because the alloc function can't be used in shared libraries. + * Makefile: added a top-level makefile for easily compiling all things in + a row. Also added an "install" target + +2008-06-23 Jens Langner + + * nbalance_mcc: added a new MUIA_NBalance_Pointer attribute to enable/disable + the custom pointer for a NBalance object. + * nbitmap_mcc/dispatcher.c: upon OM_SET our own tags will be set to TAG_IGNORE + which should be more correct for tags parsing. + +2008-06-21 Thore Böckelmann + + * nbalance_mcc/NBalance.c: changed the eventhandler's priority to -2 to make + it called after Balance.mui's eventhandler. According to Jens this one has + a priority of -1 and starts the balancing process after having received an + IDCMP_MOUSEMOVE message. With pri 0 it could happen in some very rare cases + that NBalance's eventhandler was called when the mouse pointer just left the + object by one pixel and restore the standard pointer, but Balance.mui's + eventhandler would start the balancing process from the very same message. + Hence the balance process would happen with the standard mouse pointer + instead of our custom one. + +2008-06-20 Thore Böckelmann + + * include/mui/NBitmap_mcc.h: fixed some strange characters which prevented + a successful build. + +2008-06-19 Jens Langner + + * nbitmap_mcc: unified the global definitions for the attributes and + variables to be taken from the global NBitmap_mcc.h file instead. + * nlist_mcc/Pointer.c: changed the sizepointer image to be the very same as + in the new NBalance class. This should make the whole custom pointer + look&feel more consistent. + * nbalance_mcc/NBalance.c: it seems I finally fixed the custom mouse pointer + handling by using a correct logic of IDCMP_MOUSEBUTTONS|IDCMP_MOUSEMOVE + events. Lets see how this performes in practice. + +2008-06-19 Thore Böckelmann + + * nbalance_mcc/NBalance.c: removed the unneeded mouse button check as MUI + doesn't broadcast any MUIM_HandleEvent messages any more as soon as some + dragging or balancing has begun. + * nbalance_mcc/NBalance.c: fixed the "reappearing normal pointer" problem, at + least most of the time it works. Sometimes the last move event right before + the balancing process starts yields that the mouse is no longer over the + object, while in fact it still is. + +2008-06-14 Jens Langner + + * nbalance_mcc/NBalance.c: modified the mouse pointer show/hide functionality + so that the custom mouse pointer is also shown when the balance object is + being resized. This is, however, still not perfect because as soon as the + resize operation is finished the custom pointer stays, which we need to + solve before we can release a first version of the new NBalance class. + +2008-06-13 Thore Böckelmann + + * nbalance_mcc/Pointer.c: fixed the wrong transparency of the horizontal + pointer image. + * nbalance_mcc: corrected the debug classes and simplified the setting + of the different pointer images a little bit. + +2008-06-12 Jens Langner + + * nbalance_mcc: added sources of new custom class which enhances the standard + mui MUIC_Balance custom class by adding a mouseover identification to show a + different mouse pointer to signal that the mouse is over a balance object. + In future we can even add new styles (look&feel) to this class to make it + look more unique and how a balance object should look today. + +2008-03-17 Thore Böckelmann + + * #?/vastubs.c, #?/Makefile: added vararg stubs for OS3 to be able to link + against clib2 which misses these stubs. Also added Lib#?Pooled() + replacements which are missing in clib2 aswell. + +2008-03-09 Pär Boberg + + * nlistviews_mcp/locale/swedish.ct: Updated according to changes. + +2008-03-08 Jens Langner + + * nbitmap_mcc/NBitmap.c: converted all TABs to spaces and cleanup the + sources a bit. + +2008-03-08 Thore Böckelmann + + * nlistviews_mcp/private.h: added missing variable + +2008-03-07 Thore Böckelmann + + * nlistviews_mcp/Makefile, nlistviews/vastubs.c: added vararg stubs for + certain functions to be able to links against clib2. + * nlistviews_mcp/NListviews.c: the example text is localizable now. This + fulfills feature request #1851580. + +2008-03-04 Thore Böckelmann + + * #?/Makefile: removed -lm from the linker libs as nothing needs floating + point math. Also added dump as target. + * nbitmap_mcc/NBitmap.c: replaced the shading factors by integers to avoid + floating point math. + +2008-02-19 Ilkka Lehtoranta + + * nbitmap_mcc/WritePixelArrayAlpha.c: implemented WritePixelArrayAlpha() for + M68k builds. Not very efficient but does its job. + +2008-02-19 Thore Böckelmann + + * Debug.h: replaced all abort() usages in our ASSERT() macros with the + respective calls to assert(). This should prevent the MorphOS compile + from not linking and be a bit more intuitiv. + +2008-02-02 Jens Langner + + * mccinit.c: updated to latest version available which fixes some + MorphOS specific compiler warnings. + +2008-01-28 Daniel Allsopp + + * nbitmap_mcc: Fixed various layout and redraw errors introduced with 15.4 + and implemented button labels. + +2008-01-03 Thore Böckelmann + + * #?_mcp/locale/#?.ct: changed all .ct file names to english names instead of + translated ones. + +2008-01-02 Vit Sindlar + + * nlisttree_mcp/locale/czech.ct: Updated to match the latest .cd file. + +2007-12-27 Ilkka Lehtoranta + + * nlist_mcc/NList_func4.c: no need to examine WhichLayer() on MorphOS 2.0 + because there custom pointers respect window borders. + +#### v0.101 RELEASE ########################################################### + +2007-12-19 Jens Langner + + * misc: last final release preparations. + +2007-12-18 Jens Langner + + * nlistviews_mcp, nlisttree_mcp: added czech catalog generation to build + makefiles. + +2007-12-14 Thore Böckelmann + + * nlist_mcc/NList_mcc2.c, nlist_mcc/NList_func4.c: the custom pointers will + now only be shown if the mouse pointer is over the object AND over the + object's window. If the window is partly covered by another window the + normal pointer will be shown. + +2007-12-12 Thore Böckelmann + + * nlist_mcc/NList_mcc.c, nlist_mcc/NList_mcc0.c, nlist_mcc/Pointer.c: the + custom pointers will now be set and hidden in the Show/Hide methods. Hiding + them in the Cleanup method is forbidden, because the necessary window is not + existing anymore then. + +2007-12-12 Vit Sindlar + + * nlistviews_mcp, nlisttree_mcp: added czech catalog translation + +2007-12-07 Thore Böckelmann + + * nbitmap_mcc/icon.png: added example picture with alpha channel. + * nbitmap_mcc/NBitmap.c: added some debug output to track down transparency + problems with OS3. + +2007-12-07 David Rey + + * nlisttree_mcp/locale/NListtree_mcp.cd: fixed typo. + * nlisttree_mcp/locale/english-british.ct: added, OS4 only for now. + * nlisttree_mcp/locale/svenska.ct: fixed version string, added the + missing codeset, removed all the Localizer junk, fixed the artificial + typo in MSG_HELP_SPECIAL_IMAGE. + * ChangeLog: minor cleanup. + +2007-12-06 Pär Boberg + + * nlisttree_mcp/locale/svenska.ct: Updated according to changes. + +2007-12-03 David Rey + + * nlisttree_mcp/NListtree.c, nlisttree_mcp/locale/NListtree_mcp.cd: + reworked catalog descriptor from the ground up, now only help bubbles + for the "Expand" and "Collapse" buttons are missing (hint :). + +2007-12-03 Thore Böckelmann + + * nbitmap_mcc/NBitmap.c: fixed some indentations. + * nbitmap_mcc/NBitmap-Test.c: added missing includes and library definitions. + +2007-12-01 Pär Boberg + + * nlisttree_mcp/locale/svenska.ct: Updated according to the new .cd file. + +2007-11-30 Ilkka Lehtoranta + + * nbitmap_mcc/NBitmap-Test.c: added simple test application for nbitmap.mcc. + It requires icon.png file which is not included for copyright reasons. + * nbitmap_mcc/NBitmap.c: fixed rendering bugs caused by my CGX patch. + * nbitmap_mcc/dispatcher.c: removed obsolete MUI_RequestIDCMP()/MUI_RejectIDCMP() + calls. Event handlers are used instead. + +2007-11-22 Thore Böckelmann + + * nbitmap_mcc/NBitmap.c: moved the inclusion of the proto/#?.h files a few + lines further down to avoid unnecessary warnings when compiling for OS3. + The OS3 proto files don't seem to include the necessary stuff to define + Bitmaps, etc, themself. + +2007-11-21 Jens Langner + + * nbitmap_mcc: integrated a patch kindly provided by Ilkka Lehtoranta + which makes the bitmap class compile/link for MorphOS and OS3 as well. + Now cybergraphics.library calls are used for all platforms instead of + forcing the class to P96 only. Please note, however, that we still + need a test application for that new class as currently the only + application using that new class is Epistula and that's unfortunatly + available for OS4 only :(. So we should at least put a NBitmap-Test + app into our repository for testing it directly from here. + +2007-11-03 Jens Langner + + * nlistviews_mcp/NListviews.c: added a copyright crawling object to the + bottom of the mcp to match the Look&Feel to our other classes. + * nlisttree_mcp/NListtree.c: reworked the whole mcp GUI to not fire up a + sub window for the copyright and/or example listtree. In addition, the + locale translation stuff now uses FlexCat instead of the old, obsolete + and properitary Localizer stuff. However, new translation are now + required. + +2007-11-03 Pär Boberg + + * nlisttree_mcp/locale/svenska.ct: Just upped the version number. + +2007-11-02 Thore Böckelmann + + * nlisttree_mcp/NListtree.c: added all buttons to the cycle chain. This fixes + bug #1824550. + * nlisttree_mcp/NListtree.c: added the missing control chars for the style and + space sliders. + +2007-11-02 David Rey + + * nlisttree_mcp/NListtree.c: the URL in the Copyright window no longer + points to an empty homepage (fixes bug #1824552), also updated the + copyright dates and general indentation to make it more readable + * docs/ReadMe: general rework and preparations for next release + +2007-10-14 Thore Böckelmann + + * nlist_mcc/NList_mcc0.c, nlist_mcc/NList_mcc2.c: moved the MUI key handling + to the HandleEvent() function, because this function can signal an "eaten" + key press to MUI. The now empty HandleInput() function has been removed + therefore. This fixes the strange folder listtree behaviour in YAM. + * nlisttree_mcc/Debug.c, nlisttree_mcc/NListtree.c: refined the debugging + flags a lot to get more detailed information. + +#### v0.100 RELEASE ########################################################### + +2007-10-12 Thore Böckelmann + + * nlist_mcc/Pointer.c: for OS4 the normal bitmap data are now used for the + fallback pointers in case the graphic card cannot handle 32bit hardware + sprites as pointer. + +2007-10-11 Thore Böckelmann + + * nist_mcc/Pointer.c: the combinated bitplane is now also declared as constant + data instead of "calculating" it. + +2007-10-10 Thore Böckelmann + + * nlist_mcc/NList_mcc2.c: removed the DefaultObjectOnClick workaround for + MUI3.8/m68k which is no longer necessary, as the corrent return of + MUI_EventHandlerRC_Eat for handled mouse clicks inside the object also + cured the "first click does not select" bug in YAM. + +2007-10-09 Jens Langner + + * nlisttree_mcc/NListtree.c: the MUIKEY_LEFT/RIGHT always ate the keyevent + instead of just eating it in case NListtree itself reacted upon the key + press. This prevented NListtree from being able to be horizontally scrollable + in addition to reacting upon the new KeyLeft/RightFocus attributes. + * nlist_mcc: implemented new MUIA_NList_KeyXXXFocus attributes which can be + set to another object in the same window the NList object resists. In case + the corresponding key action (Up/Down/Left/Right) is processed with no actual + scrolling/changing action being performed, the selected object will become + the new active object of the window. + +2007-10-09 Thore Böckelmann + + * nlist_mcc/NList_mcc6.c: the inactive color is now also used if the list's + window is inactive. That means the list AND the window must be active to + let the list be drawn with its active colors. + +2007-10-08 Jens Langner + + * nlist_mcc/NList_func.c: the new MUIV_NList_Redraw_Selected wasn't updating + list objects which are in MUIV_NList_TypeSelect_Char mode. + +2007-10-08 Thore Böckelmann + + * nlist_mcc/NList_mcc0.c, nlist_mcc/NList_func.c: added new redraw type + MUIV_NList_Redraw_Selected to redraw selected entries only. This new type + is needed by the recently added (in)active highlighting. + * nlist_mcc/NList_mcc2.c: the latest changes revealed another bug in NList + when running under OS3. The HandleEvent method did not signal MUI that a + mouse click was eaten and upon changing the active object MUI issued the + same message again to the same object which in turn thought that the user + did a double click on the listview. Fixed this bug by returning the correct + value in this case. Caution: a similar effect may happen under different + circumstances again! We really need to check when MUI_EventHandlerRC_Eat + must be returned an when it must not! + +2007-10-07 Jens Langner + + * nlist_mcc: implemented a new MUIA_NList_ActiveObjectOnClick method which + will not only make sure that upon clicking into an NList object, this + object will become the currently active object of the window. + * nlist_mcc, nlistview_mcc: the NListview class will now catch the GoActive + and GoInactive methods of MUI and forward them to NList so that NList can + react on the activation/deactivation of the objects and show different + background colors for active and inactive listviews. + +2007-09-23 Pär Boberg + + * nlistviews_mcp/locale: Added swedish translation for the new NListviews.mcp. + * nlistviews_mcp/Makefile: Added swedish to the available translations. + +2007-09-17 Jens Langner + + * nlist_mcc: changed all background and foreground pen relevant sections to + take note of the new upcoming inactive pen color configurable in NListviews.mcp + now. + +2007-09-17 Thore Böckelmann + + * nlist_mcc/Pointer.c: too much data was copied while setting up the bitmaps + for the pointers, which caused crashes with the OS3 build as soon as either + the move or size pointer should be displayed. Also fixed a coloring issue + with the size and move pointers. + +2007-09-16 Jens Langner + + * nlist_mcc: removed all stackchecking functionality regardless if we can compile + them conditionally via DO_STACK_CHECK or not. It was about time to do a cleanup + of NList and this should be a first step. Stack checking shouldn't really be + required on any platform. And if so anything can be restored in one go by + reverting this change via subversion (SVN). + * nlist_mcc/NList_mcc.c: now that our new preferences also allows to enable + disable the new char selection pointer we now check for the settings in NList + as well. + * nlistviews_mcp: reworked the whole preferences GUI and finally got rid of + all the nonsense Misc1-MiscX register tabs. All the various options are now + grouped together based on their purpose. In addition, the preferences GUI + is now fully localized which should allow to generate translations for every + language. All in all the whole preference program should have a more + professional, clear and intuitive look&feel now like it should have been + right from the start. + +2007-09-14 Thore Böckelmann + + * nlist_mcc/NList_mcc2.c: hopefully fixed the "first click does not select" + bug. This occured with MUI3.8/m68k only when two lists within one windows + both have set MUIA_NList_DefaultObjectOnClick to TRUE. In this case the + second, inactive list never gets activated on the first click. OS4 and + MorphOS don't seem to be unaffected by this. + +2007-09-13 Thore Böckelmann + + * docs/MCC_NList.doc: added a note to MUIA_NList_StackCheck that this tag is + a no-op from the next release on. + * misc: removed the complete stack checking mechanism for various reasons. + Fist, stack checking causes serious performance penalties. Compared to + MUI's own List class NList class is quite slow and stack checking just + makes things worse. Second, if the stack size for an application is too + low it will very likely crash in other parts and not just while processing + NList stuff. Third, when you got a warning requester before telling you to + increase the stack size you did so just to get rid of that requester. This + requester was shown if the free stack size dropped below a certain limit. + By increasing the stack size the requester vanished, but there is no + guarantee that the increased stack is really needed. The check is just a + rough estimation without any calculated requirement which will be exceeded. + Nevertheless, stack checking can be enabled again by compiling NList.mcc + with DO_STACK_CHECK #define'd. + +2007-09-13 Jens Langner + + * nlistviews_mcp: added a new 'Inactive' Pen and FrameSpec pop object for the + upcoming inactive cursor color being introduced to e.g. NList itself. In + addition, as the pointer color selections in now fully automatic the config + item to manually select the black color has been removed - minor cleanups + included. + +2007-09-09 Jens Langner + + * nlist_mcc/Pointer.c: fixed an issue where in case some other gadget/process + set the window pointer to something else we might have ended up with the + wrong or no custom pointer at all. + * nlist_mcc/NList_mcc2.c: in case a NList object is in the charwise selection + mode a specialized selection pointer will now be shown instead of just + showing the normal pointer image. This should make the charwise selection + more obvious and intuitive and be in line what TextEditor.mcc now does as + well. + +2007-09-07 Jens Langner + + * nlist_mcc/Pointer.c, misc: reworked the whole mouse pointer setup/cleanup + routines from scratch and adapted them to use 32bit ARGB pointer images in + case NList is compiled for AmigaOS4. In addition to black/white color setup + works now all automatically like previously introduced in TextEditor.mcc. + This whole thing should finally allow to remove the configuration for the + pointer color in the NList configuration as well as showing a specialized + select pointer in case the mouse is above a read-only floattext object. + +2007-09-02 Pär Boberg + + * nlisttree_mcp/locale/svenska.ct: Just bumped the version number to match + v18.13 release of nlisttree.mcp. + +2007-08-19 Jens Langner + + * nlist_mcc/NList_mcc6.c: partly fixed bug #1172351 where due to consequtive + DrawText() calls at the very same position the font display is messed + up if the font is anti-aliased. The problem seems to be that not the entire + background where the new text is drawn will be cleared right before executing + the DrawText() function. However, due to the overlapping of italic text NList + requires to also at least redraw one character before and after the char that + should be initially redrawn. Unfortunately this isn't quite easy to achieve in + the DrawLines() function as there doesn't seem to be a way to check the exact + width of the pre/post-fixed char. Therefore only some additional space is + cleared/redrawn as well (data->spacesize) which in fact isn't quite correct + and ends up in still having a screwed up font display in case the user + quickly selects/deselects over the vers same area if TypeSelect is set to + charwise selection. More work is required here, but due to the ugly source + code it would be hard to find/fix the issues quickly. + +2007-08-18 Jens Langner + + * nlist_mcc: added new MUIA_NList_AutoClip attribute which allows to disable + the default behaviour of an NList object where in read-only (NoInput) mode + when MUIA_NList_TypeSelect is set to select charwise, the content will be + automatically copied to the clipboard. This should allow to set a NList object + to comply with the Amiga styleguide where always Amiga+C should be used to + manually copy the selected content to the clipboard. + * nlist_mcc/NList-Test.c: added the sources of the NList demo as a new test + application which will be directly linked against the NList objects and therefore + allows to more easily/quickly test changes in the NList code. + * include/mccinit.c: updated to latest 1.10 version + +2007-08-16 Thore Böckelmann + + * nlisttree_mcc/NListtree.c: translated a german comment to english and + commented out two further lines which broke the build. + * nlisttree_mcc/NListtree.c: upon MUIM_NListtree_Redraw only visible nodes are + redrawn to avoid unnecessary overhead. + +#### v0.99 RELEASE ############################################################ + +2007-07-25 Thore Böckelmann + + * #?/library.c: now really uses the 3 parameter version of GETINTERFACE() + defined in mccinit.c instead of the old obsolete version in mcc_common.h. + The user definable functions (i.e. ClassInit()) must be declared before + the inclusion of mccinit.c. + * include/mccinit.c: updated to latest 1.8 version which really uses the + GETINTERFACE() macro with 3 parameters. + +2007-07-25 Jens Langner + + * include/mccinit.c: updated to latest 1.7 version + +2007-07-24 Thore Böckelmann + + * include/mccinit.c: updated to latest 1.6 version which fixes an unbalanced + if statement. + +2007-07-23 Jens Langner + + * include/mccinit.c: updated to latest 1.5 version which should take care + of stack issues. + +2007-07-12 Thore Böckelmann + + * nlisttree_mcp/NListtree.c: added platform dependend type definition of + LocaleBase. + +2007-07-05 Jens Langner + + * include/mccinit.c: updated to latest 1.4 version and adapted all our + library.c files to make use out of the new stack enforcing mechanisms. + +2007-07-03 Thore Böckelmann + + * nlisttree_mcc/NListtree.c, nlisttree_mcp/NListtree.c: added some more + typecasts to the image generating functions to please GCC. + * nlisttree_mcc/NListtree.c: added some typecasts to the debug output to + please GCC. + +2007-07-02 Thore Böckelmann + + * nlisttree_mcc/NListtree.c: added some NULL pointer checks to the debug + output. + +2007-06-26 Thore Böckelmann + + * nlist_mcc/NList_func.c: somehow the latest fixes for the bugs #1190788 and + #1720456 didn't make it into the repository. Commited them again. + * misc: removed all trailing "\n" of all debug macros, as these clutter the + debug output. + +2007-06-22 Thore Böckelmann + + * docs/MCC_NList.doc: added the necessary requirements for AutoCopyToClip to + be working. The object must either be the window's active or default object. + +2007-06-21 Thore Böckelmann + + * nlist_mcc/NList_mcc2.c: the Class element of an IntuiMessage was assigned + a non-zero value instead of checking it, which made NList.mcc to start + dragging single items in certain situations. Now a correct check is done. + This fixes bug #1627687. + +2007-06-20 Thore Böckelmann + + * nlist_mcc/NList_func.c: fixed bugs #1190788 and #1720456 by uncommenting a + previously commented out line. If a line is now marked up to the right + border and then copied to the clipboard the beginning of the following line + will no longer be copied as well. Please check and report if this fix has + any other negative side effect. + +2007-06-15 Thore Böckelmann + + * nlistviews_mcp/NListviews.c: the raw key conversion was completely broken + due to the latest changes. Now a separate buffer is used which is appended + to the hotkey string. + * demo/Makefile.#?: fixed wrong include path. + * nbitmap/dispatcher.c, nbitmap/NBitmap.c: replaced SetMem() calls by standard + memset() calls, as SetMem() is OS4-only. + * nbitmap/private.h: added missing declarations of the OS4 specific types + int8/16/32 and uint8/16/32 to make NBitmap.mcc compilable for OS3 and MOS. + * nbitmap/dispatcher.c: moved all variable definitions in front of the ENTER() + macro. + * nlist_mcc/NList_func.c: added some range and NULL pointer checks to the + MUIM_NList_GetSelectInfo method. + +2007-06-14 Thore Böckelmann + + * misc: replaced all remaining occurences of strcpy() by strlcpy(). stpcpy() + has been replaced by strlcat(). + * misc: replaced all remaining occurences of sprintf() by snprintf(). + +2007-06-13 Thore Böckelmann + + * #?/Debug.c: unified the _DPRINTF() functions for all platforms. + * nlisttree_mcc/NListtree.c: replaced all calls to sprintf() and strncat() + by sizeaware calls to snprintf() and strlcat(). This effectively makes + buffer overruns impossible. Additionally the buffer pointer no longer needs + to be passed around to all functions. + +2007-06-10 Jens Langner + + * #?/Makefile: replaced all platform specific makefiles with a single + platform flexible one which can be called by a simple 'make' call and + automatically identify for which platform it should compile the mcc/mcp. + * include/mccinit.c: updated to latest 1.1 version which should fix possible + stack issues during the LibInit() phase. Custom libraries will now be opened + during the LibOpen() phase instead while maintaining an own mutual exclusive + locking variable. + +2007-06-09 Jens Langner + + * include/mccinit.c, mcc/library.c, mcp/library.c: replaced the old obsolete + mccheader.c by the new mccinit.c which should come with a much more clear + interface and documentation on how to use it for a basis of a MUI custom + class. This should significantly reduce the possibility of race conditions + in the mcc/library init code. + +2007-05-29 Thore Böckelmann + + * #?/Debug.c: added some const keywords. + * include/mccheader.c: reworked the LibOpen() and LibClose() functions to + increment/decrement the lib_Open counter before obtaining the semaphore to + prevent a possible race condition with LibExpunge(). + +2007-05-02 Thore Böckelmann + + * nlist_mcc/NList_func2.c: a wrong flag was used to signal a pending + notification for MUIA_NList_DragSortInsert. Using the correct flag should + fix bug #1668322. + +2007-05-01 Thore Böckelmann + + * nlisttree_mcc/NListtree.c: the GetEntry method didn't respect closed lists + when counting then nodes and hence the first node of a closed list was + always returned while the next node was skipped. + +2007-04-24 Thore Böckelmann + + * nbitmap_mcc/NBitmap.c: fixed an aliasing break by replacing a DoMethodA() + call by a varargs DoMethod() call. + +2007-03-23 Thore Böckelmann + + * #?/Debug.c: fixed wrong final output of debug classes and flags. + * #?/Debug.c: disabling a debug flag was not possible due to a check for the + '!' at a wrong index. + +2007-03-11 Jens Langner + + * nlisttree_mcp: added russian catalog translation kindly provided by + Vlad Vinogradov. + +2007-01-20 Thore Böckelmann + + * nbitmap_mcc/misc: reworked some more sources to look a *lot* nicer. + +2007-01-10 Thore Böckelmann + + * nbitmap_mcc/misc: reworked some sources to look a *lot* nicer. Also added + two new debugging classes "datatype" and "draw" to capture possible flaws in + these areas. + +2007-01-06 Jens Langner + + * nbitmap_mcc: added the sources of our new NBitmap.mcc custom class + kindly developed and provided by Daniel Allsopp in 2006. Currently the class + only compiles on AmigaOS4, but future versions should be ported to OS3 and MOS + as well and should also be running on cybergraphics.library systems. This new + class provides general purpose methods for loading/drawing all kind of bitmaps + (either loaded from a file or dtObject) including methods for applying certain + image modifications in advance. This class should also allow to load images + which can contain alpha-channel masking like e.g. 32bit PNG files. All in all + it should be the next generation MUI custom class for dealing with all kind + of images and their operations/display. + +#### v0.98 RELEASE ############################################################ + +2006-12-18 Jens Langner + + * demo: added makefiles and made all our demos compile for all our different + targets like OS3/OS4/MOS. + +2006-12-17 Jens Langner + + * nlisttree_mcc: applied a fix for certain tree open/close related problems + kindly provided by Thomas Igracki. NListtree was previously adding certain + items twice when opening a list tree. In addition if only a few items were + part of a list tree certain items weren't correctly or at all displayed. + +2006-12-16 Jens Langner + + * misc: bumped versions for upcoming release and adapted + makefiles to compile with -Wwrite-strings. + +2006-12-15 Jens Langner + + * nlist_mcc: changed all get() uses to xget() uses and also made sure + that all attribute checking get() are directly using GetAttr(). + * nlist_mcc: minor changes to the makefiles so that the class is always + compiled with function symbols turned on, no matter what. + +2006-11-28 Jens Langner + + * nlisttree_mcp/local/svenska.ct: added swedish catalog translation kindly + provided by PÃr Boberg. + * nlisttree_mcp: moved the "locale" directory to here because each mcp + should have its own directory instead of accessing a global one + +2006-10-07 Jens Langner + + * nlisttree_mcc: transformed all "struct TimeVal" definitions into separate + ULONG values as a real timeval structure is not really required. Also + adapted the HandleEvent method to use the current time supplied by the + intuimessage instead which should be more accurate. + * includes/SDI_hook.h: updated to latest version and adapted our sources + accordingly. + +2006-10-07 Thore Böckelmann + + * #?/Debug.c/h: Ooops. Forgot to check in the debug sources... :( + +2006-10-06 Thore Böckelmann + + * misc: converted some left over old D(bug())'s. + * misc: added new debugging scheme, as known from YAM and TextEditor.mcc. + Therefore the now obsolete file includes/mcc_debug.h is gone. The + debugging facility is far from perfect and yet just covers the absolute + minimum of debugging. That means one cannot yet define precise debugging + classes. + +2006-10-04 Thore Böckelmann + + * includes/mccheader.c, #?/Makefile.os4: switched to newlib compilation and + linkage per default. + +2006-10-03 Thore Böckelmann + + * misc: removed several signedness issues + * nlisttree_mcc/Makefile.os4: added -D__NEW_TIMEVAL_DEFINITION_USED__ to + CFLAGS + * nlisttree_mcc/NListtree.c,h, nlistview_mcc/NListview.c: changed all + usages of "struct timeval" to new "struct TimeVal" and all usages of + "tv_secs" and "tv_micro" to "Seconds" and "Microseconds". + * include/SDI_#?: updated SDI headers to very latest available versions + which should fix compilation issues with VBCC and the VARARGS68K + definition. + * include/#?mui#?: updated MUI heards to very latest available versions + which don't include any directly anymore. + * nlist_mcc/NList_mcc6.c: the code to return the current pixel length of a + line didn't check for -1 as an invalid index and therefore caused crashes + if the list was contained in a virtual group and was scrolled into view + very slowly. -1 is the index of the title bar. This fixes bug #1568047. + +#### v0.97 RELEASE ############################################################ + +2005-07-30 Jens Langner + + * nlist_mcc/NList_mcc.c,NList_mcc2.c: modified wheelmouse aware source + code to take respect of the new AmigaOS4 specific IDCMP_EXTENDEDMOUSE + events supported since intuition.library v51.28+. + +2005-07-02 Jens Langner + + * nlisttree_mcc/QuickSort.c: added removed include + back as the OS4 SDK requires it for resolving CallHook() properly. + +2005-06-24 Gunther Nikl + + * nfloattext_mcc/NFloattext.c: Cleanup #include statements. + (DoSuperNew): use SDI_stdarg.h. + (CopyText, mNFT_GetEntry): Use MEMF_ANY when allocating memory. + (mNFT_Set, mNFT_GetEntry): Remove superfluous casts. + (mNFT_GetEntry): Use CopyMem(). + (CopyText): Use strcpy(). + * nlisttree_mcc/NListtree.c (OpenClipboard/CloseClipboard): Fixed. + (DoSuperNew, MyCallHook): Use SDI_stdarg.h. + (MyCallHookA: Disabled since its unused. + Use stdlib.h + * nlisttree_mcc/NListtree.c, nlisttree_mcc/QuickSort.c: Cleanup + #include statements. + * nlisttree_mcc/NListtree.h: Removed excessive header inclusion. + * nlisttree_mcp/NListtree.c: minor cleanup. + * nlistview_mcc/NListview.c: Cleanup #include statements. + (DoSuperNew): Use SDI_stdarg.h. + * nlistview_mcc/Makefile.os3, nlistview_mcc/Makefile.os4, + nlistview_mcc/Makefile.mos (CFLAGS): Added -I.. to get rid of ".." + in #include statement. + * nlistviews_mcp/NListviews.c: Cleanup #include statements. + +2005-06-23 Gunther Nikl + + * nlisttree_mcc/NListtree.c: Removed LocaleBase and its interface + definition. + (_DisposeP): moved CloseCat() and CloseLocale() inside the + "if (LocaleBase)" block. + * nlisttree_mcc/library.c: Added LocaleBase defintions. + * nfloattext_mcc/private.h, nlist_mcc/private.h, nlisttree_mcc/private.h, + nlisttree_mcp/private.h, nlistview_mcc/private.h, nlistviews_mcp/private.h: + Remove some unnessecary "../includes/". Use "" for private includes. + * nlist_mcc/Makefile.os3, nlist_mcc/Makefile.os4, nlist_mcc/Makefile.mos: + Added -I.. to get rid of ".." in #include statements. + * nlist_mcc/NList_grp.h, nlist_mcc/NList_img.h, nlist_mcc/NList_img2.h: + Minor cleanups. + * nlist_mcc/NList_mcc.c, nlist_mcc/NList_mcc0.c, nlist_mcc/NList_mcc1.c, + nlist_mcc/NList_mcc2.c, nlist_mcc/NList_mcc3.c, nlist_mcc/NList4_mcc.c, + nlist_mcc/NList_mcc5.c, nlist_mcc/NList_mcc6.c, nlist_mcc/NList_func.c, + nlist_mcc/NList_func2.c, nlist_mcc/NList_func3.c, nlist_mcc/NList_func4.c, + nlist_mcc/NList_grp.c, nlist_mcc/NList_img.c, nlist_mcc/NList_img2.c, + nlist_mcc/move.c, nlist_mcc/library.c: Add #include statements for used + headers. + * nlist_mcc/private.h: Removed excessive header inclusion. + * nlist_mcc/NList_mcc3.c (xget): Initialize local variable. Remove unused + MUIA_ #define. + * nlist_mcc/NList_mcc5.c: Removed xget() prototype. + * nlist_mcc/protos.h: Added xget() prototype. + * nlist_mcc/NList_func3.c (MyCallHookPktA): use SDI_stdarg.h. + * nlist_mcc/NList_mcc.c (DoSuperNew): Likewise. + * nlist_mcc/library.c: Make ioreq static. + +2005-06-16 Gunther Nikl + + * nlisttree_mcc/NListtree.c, nlisttree_mcp/NListtree.c: Unify MySPrintf + for OS4 and MOS using SDI_starg.h as done by other projects. + Fix OS3 MySPrintf for GCC 3.4.x or newer (has to use stdarg.h macros!) + Initialize variable passed to GetAttr() with Zero. + Includes cleanup. + Fixed typos. + +2005-06-09 Jens Langner + + * includes/SDI: updated SDI headers to latest incarnation. + +2005-05-25 Jens Langner + + * library.c: added missing USE_UTILITYBASE define which may have caused + problems on OS3 machines. + +2005-04-10 Jens Langner + + * includes/mccclass_68k: replaced the assembler based OS4/68k stub by a + easier manageable C-based variant. + +2005-04-09 Jens Langner + + * all: fixed case sensitive #include statements which broke the + build on systems with a case sensistive filesystem. + * includes/SDI*: updated the common SDI headers with latest + version taken from the YAM repository. + +2005-03-21 Gunther Nikl + + * all: Minor source cleanup. + +2005-03-17 Sebastian Bauer + + * NListtree_mcc: Addressed bug 1095158 by rewritting the + responsible parts. This might introduce other problems and + needs proper testings. + +2005-03-16 Sebastian Bauer + + * NList_mcc: Fixed base page access which happened when no entry + was selected and the keyboard was used (bug 1156362) + +2005-01-01 Nicolas Sallin + + * NList_mcc: Fixed wrong usage of MUI_MAXMAX + +#### v0.96 RELEASE ############################################################ + +2004-12-15 Jens Langner + + * made sure all revisions/dates are bumped of all NList classes + for upcoming new NList release. + +2004-12-15 Sebastian Bauer + + * NList_mcc: On some circumstances MUIA_NList_InsertPositions was not + set correctly if the element has been inserted via + MUIV_NList_Insert_Sorted. Hopfully fixed now. + +2004-12-14 Sebastian Bauer + + * NList_mcc: Fixed insert refresh problem + +2004-12-13 Sebastian Bauer + + * NList_mcc: Fixed offset refresh bug + * NList_mcc, NListviews_mcp: Added new prefs option to disable + the vertical centering of the text lines (can be found on the + misc2 sub page) + * NListviews_mcp: Eliminated a misc sub page. In the future the + rest should be eliminated as well. + +2004-10-24 Jens Langner + + * include/mccclass_68k.S: updated mcc 68k->PPC cross call stubs to + latest version created by fdtrans 51.1 + +2004-10-03 Jens Langner , + Sebastian Bauer + + * mccheader.c: Special Fun of Computing fix. Return value of + PreClassInitFunc() was not evaluated. + +2004-09-12 Jens Langner + + * all: modified all makefiles to use "-W -Wall" as the warning + level and adapted all source files accordingly. Reactivated + the DEBUG options in all morphos makefiles aswell as the + debugging options can be dynamically disabled on the + commandline by "make DEBUG=" anyway. + +2004-08-26 Nicolas Sallin + + * All: More changes for morphos. + +2004-08-25 Sebastian Bauer + + * NList4_func4.c: Fixed wrong disposion of mouse pointer + objects. Bug found by Georg Steger. + +2004-08-25 Nicolas Sallin + + * All: Changes for morphos. + +2004-08-24 Sebastian Bauer + + * NListtree: Fixed alignment problems (the alignment enforcement + surrounding include statements was discarded by subincludes). + The events are now only subscribed between MUIM_Show/MUIM_Hide + rather than MUIM_Setup/MUIM_Cleanup as otherwise MUI sends + them even if the object is not showed (e.g. within a page). + Frozen version 18.20 of NListtree. + +2004-08-07 Jens Langner + + * nlist_mcc: fixed a rather annoying drawing bug where the + NList class wasn't calculating the correct vertical start + position on drawing the listview. This causes a very annoying + "stutterting" when instantly resizing the NList surrounding + group. However, this seems to trigger now another hided minor + drawing bug where not all of the vertical space of the NList + object is used. So this is something we have to look after + aswell. + +2004-07-27 Jens Langner + + * mccheader.c: updated the general mcc source file to the + latest version also used with other .mcc's out there. Also + adapted all library.c files to define the USEDCLASSES stuff + correctly. + +2004-07-16 Jens Langner + + * gcc3: adapted all sources to be more gcc3 compliant. Removed + all remaining warnings in -Wall mode. Please note that at + least for the AmigaOS4 port of the classes gcc 3.4.1 should + be considered the default compiler now. + +2004-07-03 Jens Langner + + * nlisttree_mcp: added the missing mcp class of the nlisttree + class and ported it to native OS4 aswell. + +2004-07-01 Jens Langner + + * all: built some first OS4/PPC native versions of all classes + and added makefiles for it accordingly. + * all: fixed all remaining compiler warnings which occurred + with -Wall. + * all: updated and reorganized all NList classes to use the + SDI_*.h header files to make it way easier to maintain the + source code for different operating systems like OS4 and MOS. + +2003-02-25 Jens Langner + + * NList.mcc: fixed bug in the Draw method were it could have + happened that on a LAYERSREFRESH request the object wasn`t + correctly refreshed. + +2003-02-24 Jens Langner + + * added USEDCLASSES and USEDCLASSESP to all NList related + classes so that the preferences/superclass ordering is + a bit more accurate. + +2003-02-12 Jens Langner + + * NList.mcc: added new MUIV_NList_Insert_Flag_Raw flag to + the MUIM_NList_Insert method. With this special flag the + developer is able to insert a bunch of data into a NList + without recalculating/reordering the columns width. As tests + pointed out the most significant speed loss while inserting + entries to a NList is the recalculating of the width of + each column. So, if a developer is sure that he doesn`t need + to recalculate the columns width each time he inserts something, + he can now specify this flag and those entries will be inserted + with higher performance. + Tests have shown that ~8000 elements can be inserted now within + 1-2 seconds instead of 8-9 seconds. + * NListtree.mcc: replaced Insert/RemoveTreeNodeVisibleSort() + functions by one ReplaceTreeNodeVisibleSort() function + that calls MUIM_NList_ReplaceSingle instead. That speeds up + the sorting of a treenode to a factor of ~170%. + * NListtree.mcc: removed broken flashsort implementation + as it anyway didn`t work correctly and wasn`t also + the best one for that sorting purpose. Replaced it with + a own Quicksort implementation and also use the same + algorithm now for the 68k version. As some test showed + the C implementation is as fast as the former ASM one and + in addition we have more flexibility now. + +2003-02-08 Jens Langner + + * NListview.mcc: implemented similar MUIA_ControlChar support + like the original Listview.mui supports it since ages. + By specifying a MUIA_ControlChar for a NListview object it + is now possible to specify a hotkey to control the active + entry of the corresponding NList. + +2003-01-07 Sebastian Bauer + + * NListtree: No default Compare Hook was set. + +2002-12-31 Jens Langner + + * nlisttree/nlisttree.c: if a own ConstructHook was + set via SetAttributes, the whole flags were deleted. + Instead of a unset bit operation a masking operation + was used which caused that whole flags screwup. Fixed. + +2002-11-21 Jens Langner + + * nlisttree: updated sources to conform better with newest + morphos SDK. + +2002-11-02 Sebastian Bauer + + * NListtree: No longer copies the compare hook, instead + it uses the pointer directly + +2002-10-12 Jens Langner + + * nlist_mcc/nlist_mcc.c: fixed bug in the internal + ConstructHook_String where Sensei forgot to terminate + the copied string with a \0. + +2002-09-13 Sebastian Bauer + + * NListtree: MUIM_NListtree_Remove had problems when no entry + was active. Fixed. + +2002-07-15 Jens Langner + + * nlist_mcc/nlist_mcc2.c: fixed a tiny, but extremly nasty + bug that caused unnecessary refreshs of nlist objects + if we had more than one nlist#? object within a group. + +2002-07-01 Sebastian Bauer + + * The internal pool problem wasn't really fixed. Now it is (I hope) + +2002-06-23 Sebastian Bauer + + * Fixed a bug that the images weren't displayed in single + columned lists + +2002-06-22 Sebastian Bauer + + * Create also an Internal Pool if user pool was specified + as some functions require this + +2002-06-19 Jens Langner + + * obviously turned this ChangeLog upside down because it + makes more sense :) + * removed common/mcc_debug.c as we use dprintf() for MorphOS + now for debugging purposes. + * removed the need of creating own ppc headerfiles with + geninclude.pl, because we can use #pragma pack(2) instead. + * Updated the MorphOS stuff in all classes to use varargs68k + stuff instead of this outdated varargs hacks. + * Did lots of effort to get the whole NList* stuff + up and running under MorphOS again. Somehow the builds + where broken. + * tagged all classes within the CVS with their respect + release version, so that they can be identified later. + +2002-04-02 Richard Poser + + * Minor Modifications for the Include files/CPU I have + * Modified lines 256 and 687 in common/mccheader.h + * Modified lines 52 and 64 in NList_mcc/library.c + * Modified line 49 in NList_mcc/smakefile for CPU=68030 + * Modified line 44 in NListviews_mcp/NListviews.c + * Major Additions/Changes for Special Shorthelp (NList_mcc) + * private.h: + * Added lines 489 and 490 + * Changed line 165 + * NList_mcc.c: + * Added lines 373, 377, 378, 503 and 649 + * NList_mcc1.c + * Added lines 375-379 + * NList_mcc2.c + * Added lines 220-224, 319-326, 986-1035 and 1040 + * NList_mcc4.c + * Added lines 261, 344, 369, 570, 691, 753, 781, 799, 826, 851, 1200 and 1219 + * Changed line 678 + * Special ShortHelp Notes... + * When an Button Image Object is given a ShortHelp and the Mouse is positioned over the button, + the ShortHelp for that object will be shown, otherwise the Default ShortHelp for the full + NList object itself will be shown + * Not really much of a change - but made CPU=68030 in NList_mcc/smakefile due to my own requirements + * Bumped version of NList.mcc to 20.104 + * Obviously added info to ChangeLog :-) + +2002-03-05 Sebastian Bauer + + * Added a define MUIV_NList_UseImage_All for MUIM_NList_UseImage + which stands now for -1 + +2001-12-24 Sebastian Bauer + + * Merged aphaso and sensei changes and commited all files to the + cvs (only tried the SAS compile) + * small smakefile changes + +2001-07-01 sensei + + * Added new methods MUIM_NList_Construct and MUIM_NList_Destruct. Now + every internal method is calling these methods instead of playing + with hooks directly. In NList subclass you can override them to your + own version. + * Fixed IdStrings again... MUI dislikes MCC which haven't $VER: at + the beggining of IdString and AboutMUI wasn't showing such MCC (but + MCC is working correctly!) in the list... + * Fixed global and local SMakefiles (dependency tree was broken (by me) + and "sometimes" project wasn't rebuilded...) In global smakefile + 'all' was missing and it cauesed some troubles with objects/ + directories (this's not my fault). + * Added useful scripts to make and clean objects/ directories. + * Bumped version of NList.mcc to 20.103 + +2001-06-27 sensei + + * Changed memory handling routines in NList_func3.c and NList_mcc.c + * Changed common/mccheader.h to support SAS/C. + * Changed NList_mcc/NList_mcc.c OM_NEW attributes handling, minor speedup. + * Fixed every library.c of each MCC, first function of library based + executable MUST do nothing and return 0. Executing old MCC causes + unexpected crashes. + * Fixed and cleanuped OM_GET method of NList.mcc getting + MUIA_NList_DragColOnly attribute could cause unexpected results! + * Fixed library id string. It's not equal to version string! + * Added missed names of authors in id string. + * Bumped version of NList.mcc to 19.102 + +2001-06-23 aphaso + + * Added MorphOS DoSuperMethod() to NFloattext.c + * Added common/mcc_debug.h for better debugging ;) + * Changed common/mcc_debug.c + * Changed common/mcc_common.h to support GNU/SAS... + * Changed some internal handling and added tree class support + in NList ;-) + * Changed version strings to NList#?.mcc ... + * Bumped version of NList.mcc to 19.101 + * Fixed wrong MorphOS hooks... + +2001-06-20 aphaso + + * Enforcer hit on dispose removed. + * Now omits column width calculation code if numcols == 1. + With only one column, NList is now faster than List. Yeahh! + * Shrink of entries array is now omitted. Same as List does i + think. + +2001-06-18 aphaso + + * Added experimental value MUIV_NList_Redraw_ColsVisible for + width calc of only the visible lines. + +2001-06-16 aphaso + + * Reworked entry manangement to use pointers insted of full + structures. This makes NList much faster (factor 3-4) in + some cases, but slows down a bit when inserting entries at + the bottom. Not much... + +2001-06-14 aphaso + + * Tracked back the floattext wrap bug and fixed it (*_mcc4.c). + All important lines which were changed between 0.89 and 0.89+ + by Gilles and caused the wrap bug are marked with $$$WRAP for + future reference. + +2001-02-27 aphaso + + * Moved Floattext to own directory and added MorphOS changes + +2001-02-18 aphaso + + * Re-added makefiles for m68k ;) + * Added method MUIM_NList_SelectChange + * Automatic conversion of NList_mcc.h in + NList_mcc/makefile.ppc + * Bumped version to 19.98 + +2000-12-17 Gürer + + * initial cvs commit + * mui classes moved to their own directories + * ppc makefiles added + * stack check disabled (wasn't compatible with morphos) + * nlist, nlistview, nlistviews, nfloattext ported to morphos + (varius hook, vararg, etc patches) diff --git a/workbench/classes/zune/nlist/Makefile b/workbench/classes/zune/nlist/Makefile new file mode 100644 index 0000000000..5e2a2f9f9b --- /dev/null +++ b/workbench/classes/zune/nlist/Makefile @@ -0,0 +1,78 @@ +#/*************************************************************************** +# +# NList MUI custom classes +# +# Copyright (C) 1996-2001 by Gilles Masson (NList.mcc) +# Copyright (C) 1999-2001 by Carsten Scholling (NListtree.mcc) +# Copyright (C) 2006 by Daniel Allsopp (NBitmap.mcc) +# Copyright (C) 2001-2008 by NList Open Source Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# NList classes Support Site: http://www.sf.net/projects/nlist-classes +# +# $Id$ +# +#***************************************************************************/ + +SUBDIRS = nbalance_mcc \ + nbitmap_mcc \ + nfloattext_mcc \ + nlist_mcc \ + nlisttree_mcc \ + nlisttree_mcp \ + nlistview_mcc \ + nlistviews_mcp \ + demo + +.PHONY: all +all: $(SUBDIRS) catalogs + +.PHONY: $(SUBDIRS) +$(SUBDIRS): + @$(MAKE) -C $@ + +.PHONY: catalogs +catalogs: + @$(MAKE) -C nlisttree_mcp catalogs + @$(MAKE) -C nlistviews_mcp catalogs + +.PHONY: clean +clean: + @$(MAKE) -C nbalance_mcc clean + @$(MAKE) -C nbitmap_mcc clean + @$(MAKE) -C nfloattext_mcc clean + @$(MAKE) -C nlist_mcc clean + @$(MAKE) -C nlisttree_mcc clean + @$(MAKE) -C nlisttree_mcp clean + @$(MAKE) -C nlistview_mcc clean + @$(MAKE) -C nlistviews_mcp clean + @$(MAKE) -C demo clean + +.PHONY: distclean +distclean: + @$(MAKE) -C nbalance_mcc distclean + @$(MAKE) -C nbitmap_mcc distclean + @$(MAKE) -C nfloattext_mcc distclean + @$(MAKE) -C nlist_mcc distclean + @$(MAKE) -C nlisttree_mcc distclean + @$(MAKE) -C nlisttree_mcp distclean + @$(MAKE) -C nlistview_mcc distclean + @$(MAKE) -C nlistviews_mcp distclean + @$(MAKE) -C demo distclean + +.PHONY: bumprev +bumprev: + @sh tools/bumprev.sh all + +.PHONY: release +release: + @sh tools/mkrelease.sh $(RELEASEREV) diff --git a/workbench/classes/zune/nlist/README b/workbench/classes/zune/nlist/README new file mode 100644 index 0000000000..14c55017b9 --- /dev/null +++ b/workbench/classes/zune/nlist/README @@ -0,0 +1,39 @@ +/*************************************************************************** + + NList MUI custom classes + + Copyright (C) 1996-2001 by Gilles Masson (NList.mcc) + Copyright (C) 1999-2001 by Carsten Scholling (NListtree.mcc) + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id: README 98 2005-07-31 16:51:47Z damato $ + +***************************************************************************/ + +With full permission of the previous authors (Gilles Masson and Carsten Scholling) +the NList#? MUI custom classes are hereby released as free software under the GNU +Lesser General Public License. Please read this license (COPYING) and make sure you +understand the terms and conditions of this license. + +The NList classes are compiled with GCC compilers. All required third party header +files should already be included in the CVS repository. However, please note that +you might need some more third party tools/utilities not included/listed here. + +If you want to contribute to the development of the NList classes please register +with SourceForge.net and notify one of the project admins of the NList classes +project available at http://www.sf.net/projects/nlist-classes + +Sebastian Bauer & Jens Langner +June, 2004 diff --git a/workbench/classes/zune/nlist/TODO b/workbench/classes/zune/nlist/TODO new file mode 100644 index 0000000000..624bf193dd --- /dev/null +++ b/workbench/classes/zune/nlist/TODO @@ -0,0 +1,26 @@ +/*************************************************************************** + + NList MUI custom classes + + Copyright (C) 1996-2001 by Gilles Masson (NList.mcc) + Copyright (C) 1999-2001 by Carsten Scholling (NListtree.mcc) + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +move.c (replacement functions for memory copying): +- change them with memmove, etc diff --git a/workbench/classes/zune/nlist/aros/s/Package-Shutdown b/workbench/classes/zune/nlist/aros/s/Package-Shutdown new file mode 100644 index 0000000000..43954cb391 --- /dev/null +++ b/workbench/classes/zune/nlist/aros/s/Package-Shutdown @@ -0,0 +1 @@ +Assign LIBS: Classes REMOVE diff --git a/workbench/classes/zune/nlist/aros/s/Package-Startup b/workbench/classes/zune/nlist/aros/s/Package-Startup new file mode 100644 index 0000000000..e8c17ff982 --- /dev/null +++ b/workbench/classes/zune/nlist/aros/s/Package-Startup @@ -0,0 +1 @@ +Assign LIBS: Classes ADD diff --git a/workbench/classes/zune/nlist/aros/s/mmakefile.src b/workbench/classes/zune/nlist/aros/s/mmakefile.src new file mode 100644 index 0000000000..60d0ad2a16 --- /dev/null +++ b/workbench/classes/zune/nlist/aros/s/mmakefile.src @@ -0,0 +1,27 @@ +# $Id$ +include $(TOP)/config/make.cfg + +FILES := Package-Startup Package-Shutdown + +#MM- contrib-zune-classes-nlist-startup : workbench-prefs-envarc contrib-zune-classes-nlist-startupfiles \ +#MM contrib-zune-classes-nlist-envpackage + +#MM +contrib-zune-classes-nlist-envpackage : + $(ECHO) "Extras:Zune/MCC_NList" >$(AROS_PACKAGES)/MCC_NList + +#MM- contrib-zune-classes-nlist-class : contrib-zune-classes-nlist-startup + +#MM- contrib-zune-classes-nlistview-class : contrib-zune-classes-nlist-startup + +#MM- contrib-zune-classes-nfloattext-class : contrib-zune-classes-nlist-startup + +#MM- contrib-zune-classes-nlisttree-class : contrib-zune-classes-nlist-startup + + +#MM- contrib-zune-classes-nlistviews-mcp : contrib-zune-classes-nlist-startup + +#MM- contrib-zune-classes-nlisttree-mcp : contrib-zune-classes-nlist-startup + + +%copy_files_q mmake=contrib-zune-classes-nlist-startupfiles dst=$(CONTRIBDIR)/Zune/MCC_NList/s diff --git a/workbench/classes/zune/nlist/demo/Makefile b/workbench/classes/zune/nlist/demo/Makefile new file mode 100644 index 0000000000..2e346d0bc7 --- /dev/null +++ b/workbench/classes/zune/nlist/demo/Makefile @@ -0,0 +1,381 @@ +#/*************************************************************************** +# +# NList classes +# Copyright (C) 2008 by NList Open Source Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# NList classes Support Site: http://www.sf.net/projects/nlist-classes +# +# $Id$ +# +#***************************************************************************/ + +########################################################################### +# This makefile is a very generic one. It tries to identify both, the host +# and the target operating system for which YAM should be compiled. +# However, this auto-detection can be easily overridden by directly +# specifying an option on the commandline while calling 'make'. +# +# Example: +# +# # to explicitly compile for AmigaOS3 +# > make OS=os3 +# +# # to compile for AmigaOS4 but with debugging +# > make OS=os4 DEBUG= +# + +############################################# +# find out the HOST operating system +# on which this makefile is run +HOST ?= $(shell uname) +ifeq ($(HOST), AmigaOS) + ifeq ($(shell uname -m), powerpc) + HOST = AmigaOS4 + endif + ifeq ($(shell uname -m), ppc) + HOST = AmigaOS4 + endif +endif + +# if no host is identifed (no uname tool) +# we assume a AmigaOS build +ifeq ($(HOST),) + HOST = AmigaOS +endif + +############################################# +# now we find out the target OS for +# which we are going to compile YAM in case +# the caller didn't yet define OS himself +ifndef (OS) + ifeq ($(HOST), AmigaOS4) + OS = os4 + else + ifeq ($(HOST), AmigaOS) + OS = os3 + else + ifeq ($(HOST), MorphOS) + OS = mos + else + ifeq ($(HOST), AROS) + # now we find out which CPU system aros will be used + ifeq ($(shell uname -m), powerpc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), ppc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), i386) + OS = aros-i386 + endif + ifeq ($(shell uname -m), i686) + OS = aros-i686 + endif + ifeq ($(shell uname -m), x86_64) + OS = aros-x86_64 + endif + else + OS = os4 + endif + endif + endif + endif +endif + +############################################# +# define common commands we use in this +# makefile. Please note that each of them +# might be overridden on the commandline. + +# common commands +FLEX = flex +FC = flexcat +EXPR = expr +DATE = date +RM = delete force +RMDIR = delete force all +MKDIR = makedir +CHMOD = protect FLAGS=rwed +CP = copy +CC = gcc +STRIP = strip +OBJDUMP = objdump + +# path definitions +CDUP = / +CDTHIS= + +# override some variables for non-native builds (cross-compiler) +ifneq ($(HOST), AmigaOS) +ifneq ($(HOST), AmigaOS4) +ifneq ($(HOST), MorphOS) + + # when we end up here this is either a unix or Aros host + # so lets use unix kind of commands + RM = rm -f + RMDIR = rm -rf + MKDIR = mkdir -p + CHMOD = chmod 755 + CP = cp -f + + CDUP = ../ + CDTHIS= ./ + +endif +endif +endif + +########################################################################### +# CPU and DEBUG can be defined outside, defaults to above +# using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug +# PPC-603e version +# +# OPTFLAGS are disabled by DEBUG normally! +# +# ignored warnings are: +# none - because we want to compile with -Wall all the time + +# Common Directories +PREFIX = $(CDTHIS) +OBJDIR = .obj_$(OS) +BINDIR = bin_$(OS) +VPATH = $(OBJDIR) + +# target definition +NBITMAP_DEMO = $(BINDIR)/NBitmap-Demo +NLIST_DEMO = $(BINDIR)/NList-Demo +NLISTTREE_DEMO = $(BINDIR)/NListtree-Demo + +# Common compiler/linker flags +WARN = -W -Wall -Wwrite-strings -Wpointer-arith -Wsign-compare +OPTFLAGS = -O3 -fomit-frame-pointer -funroll-loops +DEBUG = -DDEBUG -O0 +DEBUGSYM = -g -gstabs +CFLAGS = -I. -I../include $(CPU) $(WARN) $(OPTFLAGS) \ + $(DEBUG) $(DEBUGSYM) $(USER_CFLAGS) -c +LDFLAGS = $(CPU) $(DEBUGSYM) +LDLIBS = + +# different options per target OS +ifeq ($(OS), os4) + + ############################## + # AmigaOS4 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS4) + CC = ppc-amigaos-gcc + STRIP = ppc-amigaos-strip + OBJDUMP = ppc-amigaos-objdump + endif + + # Compiler/Linker flags + CRT = newlib + CPU = -mcpu=powerpc + WARN += -Wdeclaration-after-statement -Wdisabled-optimization + CFLAGS += -mcrt=$(CRT) -D__USE_INLINE__ -D__NEW_TIMEVAL_DEFINITION_USED__ \ + -DNO_PPCINLINE_STDARG -Wa,-mregnames + LDFLAGS += -mcrt=$(CRT) + + # additional object files required + M68KSTUBS = $(OBJDIR)/mccclass_68k.o + +else +ifeq ($(OS), os3) + + ############################## + # AmigaOS3 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS) + CC = m68k-amigaos-gcc + STRIP = m68k-amigaos-strip + OBJDUMP = m68k-amigaos-objdump + endif + + # Compiler/Linker flags + CPU = -m68020-60 -msoft-float + CFLAGS += -noixemul -DNO_INLINE_STDARG + LDFLAGS += -noixemul + LDLIBS += -ldebug -lmui + +else +ifeq ($(OS), mos) + + ############################## + # MorphOS + + # Compiler/link/strip commands + ifneq ($(HOST), MorphOS) + CC = ppc-morphos-gcc + STRIP = ppc-morphos-strip + OBJDUMP = ppc-morphos-objdump + endif + + # Compiler/Linker flags + CPU = -mcpu=powerpc + CFLAGS += -noixemul -DNO_PPCINLINE_STDARG + LDFLAGS += -noixemul + LDLIBS += -ldebug + +else +ifeq ($(OS), aros-i386) + + ############################## + # AROS (i386) + + ifneq ($(HOST), AROS) + CC = i386-aros-gcc + STRIP = i386-aros-strip + OBJDUMP = i386-aros-objdump + endif + + # Compiler/Linker flags + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-ppc) + + ############################## + # AROS (PPC) + + ifneq ($(HOST), AROS) + CC = ppc-aros-gcc + STRIP = ppc-aros-strip + OBJDUMP = ppc-aros-objdump + endif + + # Compiler/Linker flags + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-x86_64) + + ############################## + # AROS (x86_64) + + ifneq ($(HOST), AROS) + CC = x86_64-aros-gcc + STRIP = x86_64-aros-strip + OBJDUMP = x86_64-aros-objdump + endif + + # Compiler/Linker flags + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +endif +endif +endif +endif +endif +endif + +########################################################################### +# Here starts all stuff that is common for all target platforms and +# hosts. + +NBITMAP_OBJS = $(OBJDIR)/NBitmap-Demo.o \ + $(OBJDIR)/vastubs.o + +NLIST_OBJS = $(OBJDIR)/NList-Demo.o \ + $(OBJDIR)/NList-Demo2.o \ + $(OBJDIR)/NList-Demo3.o \ + $(OBJDIR)/vastubs.o + +NLISTTREE_OBJS = $(OBJDIR)/NListtree-Demo.o \ + $(OBJDIR)/vastubs.o + +# main target +.PHONY: all +all: $(BINDIR) $(OBJDIR) $(NBITMAP_DEMO) $(NLIST_DEMO) $(NLISTTREE_DEMO) + +# for making a release we compile ALL target with no debug +release: + @echo " CC $<" + make OS=os4 clean + make OS=os4 DEBUG= + @echo " CC $<" + make OS=os3 clean + make OS=os3 DEBUG= + @echo " CC $<" + make OS=mos clean + make OS=mos DEBUG= + @echo " CC $<" + make OS=aros-i386 clean + make OS=aros-i386 DEBUG= + @echo " CC $<" + make OS=aros-ppc clean + make OS=aros-ppc DEBUG= + @echo " CC $<" + make OS=aros-x86_64 clean + make OS=aros-x86_64 DEBUG= + +# make the object directories +$(OBJDIR): + @echo " MK $@" + @$(MKDIR) $(OBJDIR) + +# make the binary directories +$(BINDIR): + @echo " MK $@" + @$(MKDIR) $(BINDIR) + +# for compiling single .c files +$(OBJDIR)/%.o: %.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +$(OBJDIR)/mccclass_68k.o: ../include/mccclass_68k.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +# for linking the target +$(NBITMAP_DEMO): $(NBITMAP_OBJS) + @echo " LD $@.debug" + @$(CC) $(LDFLAGS) -o $@.debug $(NBITMAP_OBJS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + @$(CHMOD) $@ + +# for linking the target +$(NLIST_DEMO): $(NLIST_OBJS) + @echo " LD $@.debug" + @$(CC) $(LDFLAGS) -o $@.debug $(NLIST_OBJS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + @$(CHMOD) $@ + +# for linking the target +$(NLISTTREE_DEMO): $(NLISTTREE_OBJS) + @echo " LD $@.debug" + @$(CC) $(LDFLAGS) -o $@.debug $(NLISTTREE_OBJS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + @$(CHMOD) $@ + +# + +.PHONY: clean +clean: + -$(RM) $(NBITMAP_DEMO) $(NBITMAP_DEMO).debug $(NBITMAP_DEMO).map + -$(RM) $(NLIST_DEMO) $(NLIST_DEMO).debug $(NLIST_DEMO).map + -$(RM) $(NLISTTREE_DEMO) $(NLISTTREE_DEMO).debug $(NLISTTREE_DEMO).map + -$(RM) $(NBITMAP_OBJS) $(NLIST_OBJS) $(NLISTTREE_OBJS) + +.PHONY: distclean +distclean: clean + -$(RMDIR) $(OBJDIR) + -$(RMDIR) $(BINDIR) diff --git a/workbench/classes/zune/nlist/demo/NBitmap-Demo.c b/workbench/classes/zune/nlist/demo/NBitmap-Demo.c new file mode 100644 index 0000000000..a2640eb8b6 --- /dev/null +++ b/workbench/classes/zune/nlist/demo/NBitmap-Demo.c @@ -0,0 +1,205 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + TextEditor class Support Site: http://www.sf.net/projects/texteditor-mcc + + $Id$ + +***************************************************************************/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#if defined(__amigaos4__) +struct Library *IntuitionBase = NULL; +struct Library *UtilityBase = NULL; +struct Library *MUIMasterBase = NULL; +#else +struct IntuitionBase *IntuitionBase = NULL; +#if defined(__AROS__) +struct UtilityBase *UtilityBase = NULL; +#else +struct Library *UtilityBase = NULL; +#endif +struct Library *MUIMasterBase = NULL; +#endif + +#if defined(__amigaos4__) +struct IntuitionIFace *IIntuition = NULL; +struct UtilityIFace *IUtility = NULL; +struct MUIMasterIFace *IMUIMaster = NULL; + +#define GETINTERFACE(iface, base) (iface = (APTR)GetInterface((struct Library *)(base), "main", 1L, NULL)) +#define DROPINTERFACE(iface) (DropInterface((struct Interface *)iface), iface = NULL) +#else // __amigaos4__ +#define GETINTERFACE(iface, base) TRUE +#define DROPINTERFACE(iface) +#endif // __amigaos4__ + +const ULONG icon32_normal[] = { + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x49da7d7f, 0xebd87e80, 0xffd5856b, 0xc5c3725d, 0x37bb5e4f, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x31e68689, 0xd0df8484, 0xffd37979, 0xffbf6566, 0xffb55a5d, 0xffb96547, 0x38b05341, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x59e0b86a, 0xbcda7b81, 0xffe48b8a, 0xffd37979, 0xffc16767, 0xffae5454, 0xffa44a4d, 0xc5994339, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x6cecdb5c, 0xffe6ce73, 0xffca786b, 0xffd07477, 0xffd27877, 0xffc26868, 0xffb05656, 0xff9b4142, 0xff984336, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x6dffff00, 0xffede049, 0xffe9d876, 0xffd2a861, 0xffb66057, 0xffbf6366, 0xffba6060, 0xffa64c4c, 0xff9b4141, 0xec923839, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x66ffff00, 0xf9ffff00, 0xfff6e829, 0xffe0c657, 0xffdbbf5a, 0xffc5904b, 0xffac5949, 0xffa3474b, 0xff9a4040, 0xd1923838, 0x49892c2e, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x57ffff00, 0xe9ffff00, 0xfffbf117, 0xfffaf127, 0xffefd627, 0xffcea545, 0xffcca03d, 0xffae6d2b, 0xff974033, 0xba903438, 0x308a2a2e, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x45ffff00, 0xdbffff00, 0xfffbf118, 0xfff9f02a, 0xfff9e51c, 0xfff4c904, 0xffd7a40d, 0xffb77c25, 0xffa76522, 0xff994d1c, 0x5b8b3619, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x33ffff04, 0xccfdf821, 0xfff9ee26, 0xfff9f029, 0xfff9e51c, 0xfff4c706, 0xffddaa00, 0xffb38200, 0xff895407, 0xfc874012, 0x6e87310f, 0x05560000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x21ffff0a, 0xbafdfa1f, 0xfff9ef29, 0xfff9ef27, 0xfff9e41b, 0xfff5c804, 0xffddaa00, 0xffb58300, 0xff7e4d00, 0xf5611c00, 0x765c0000, 0x12000000, 0x0f000000, 0x0a000000, 0x05000000, 0x01000000, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x04fff400, 0x89fdf318, 0xfff9ed27, 0xfff8ed27, 0xfff9e51c, 0xfff5c805, 0xffdfad00, 0xffb58300, 0xff7e4c00, 0xec601d00, 0x77550000, 0x23000000, 0x24000000, 0x22000000, 0x1d000000, 0x12000000, 0x06000000, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x3bffd056, 0xe8f6c940, 0xffebc243, 0xfff5d722, 0xfff7cd03, 0xffdfab00, 0xffb58300, 0xff7d4c00, 0xe25f1e00, 0x734a0000, 0x2f000000, 0x30000000, 0x2f000000, 0x2b000000, 0x24000000, 0x16000000, 0x08000000, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x06ffccb8, 0x9df9be82, 0xffe8ab76, 0xffd29658, 0xffdaa61f, 0xffd8a506, 0xffb48201, 0xff7f4f00, 0xd95b1c00, 0x6f3c0000, 0x3c000000, 0x3c000000, 0x39000000, 0x30000000, 0x24000000, 0x18000000, 0x0c000000, 0x04000000, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x3bfabb83, 0xeee9ac71, 0xffd1955a, 0xffb77b40, 0xffa96e2d, 0xffa26c13, 0xff804f02, 0xcf5d2100, 0x6b2d0000, 0x46000000, 0x42000000, 0x3b000000, 0x2f000000, 0x21000000, 0x11000000, 0x06000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x01ffffff, 0xa1f1ac66, 0xffd29558, 0xffb2763a, 0xff9d6427, 0xff90581e, 0xf285510c, 0xad562600, 0x671e0000, 0x4a000000, 0x41000000, 0x34000000, 0x26000000, 0x17000000, 0x0b000000, 0x03000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x44777372, 0xf59e7c5c, 0xffa36d36, 0xff945b1e, 0xf6865015, 0xbf6a3e0e, 0x7f3b2304, 0x55090000, 0x45000000, 0x37000000, 0x27000000, 0x18000000, 0x0b000000, 0x03000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x06000000, 0xb45f6162, 0xff4c4b49, 0xf85e4120, 0xc073420a, 0x7a3b2106, 0x53100701, 0x42000000, 0x35000000, 0x25000000, 0x17000000, 0x0a000000, 0x02000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x09000000, 0xfc494949, 0xc0242427, 0x7607060f, 0x420c0300, 0x2f000000, 0x24000000, 0x1c000000, 0x12000000, 0x06000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x06000000, 0x15000000, 0x20000000, 0x1f000000, 0x15000000, 0x0a000000, 0x02000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, +}; +const ULONG icon32_selected[] = { + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x7320396e, 0xec304e89, 0xff3f5d99, 0xff4664a0, 0xff3f5d99, 0xec304e89, 0x7320396e, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0xac2b4479, 0xff43619d, 0xff5775b1, 0xff617fbb, 0xff5775b1, 0xff43619d, 0xac2b4479, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xcd314b80, 0xff4e6ca8, 0xff6a88c4, 0xff7d9bd7, 0xff6a88c4, 0xff4e6ca8, 0xcd314b80, 0x2a000000, 0x00ff00ff, 0x04000000, 0x64000000, 0x07000000, 0x03000000, 0x48000000, 0x03000000, 0x00ff00ff, 0x03000000, 0x4c000000, 0x03000000, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xe538558d, 0xff516fab, 0xff6f8dc9, 0xff89a7e3, 0xff6f8dc9, 0xff516fab, 0xe538558d, 0x2a000000, 0x00ff00ff, 0x0b000000, 0x84000000, 0x0e000000, 0x09000000, 0x67000000, 0x3d000000, 0x72000000, 0x4c000000, 0xa5000000, 0x5b000000, 0x03000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xfb3e5b98, 0xff4a68a4, 0xff6785c0, 0xff7f9ddb, 0xff6785c0, 0xff4a68a4, 0xfb3e5b98, 0x2a000000, 0x00ff00ff, 0x12000000, 0x88000000, 0x15000000, 0x0f000000, 0x80000000, 0x40000000, 0x87000000, 0x58000000, 0x87000000, 0x17000000, 0x03000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff22417e, 0xff38548c, 0xff687a9e, 0xff97a9ce, 0xff687a9e, 0xff38548c, 0xff22417e, 0x2a000000, 0x00ff00ff, 0x14000000, 0x8b000000, 0x80000000, 0x6d000000, 0x86000000, 0x52000000, 0x71000000, 0x8a000000, 0x74000000, 0x6a000000, 0x08000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff102f6b, 0xff23417c, 0xff334771, 0xff41506d, 0xff334771, 0xff23417c, 0xff102f6b, 0x2a000000, 0x00ff00ff, 0x0d000000, 0x13000000, 0x18000000, 0x17000000, 0x16000000, 0x1d000000, 0x22000000, 0x20000000, 0x19000000, 0x0f000000, 0x04000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0x38000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x38000000, 0x1b000000, 0x00ff00ff, 0x06000000, 0x0c000000, 0x11000000, 0x11000000, 0x0d000000, 0x0e000000, 0x0d000000, 0x10000000, 0x0f000000, 0x09000000, 0x04000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x1b000000, 0x2a000000, 0x2a000000, 0xb9000000, 0x2a000000, 0x2a000000, 0x1b000000, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x7320396e, 0xec304e89, 0xff3f5d99, 0xff4664a0, 0xff3f5d99, 0xec304e89, 0x7320396e, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0xab000000, 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0xac2b4479, 0xff43619d, 0xff5775b1, 0xff617fbb, 0xff5775b1, 0xff43619d, 0xac2b4479, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xcd314b80, 0xff4e6ca8, 0xff6a88c4, 0xff7d9bd7, 0xff6a88c4, 0xff4e6ca8, 0xcd314b80, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0xab000000, 0x00ff00ff, 0xab000000, 0x2a000000, 0xe538558d, 0xff516fab, 0xff6f8dc9, 0xff89a7e3, 0xff6f8dc9, 0xff516fab, 0xe538558d, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xfb3e5b98, 0xff4a68a4, 0xff6785c0, 0xff7f9ddb, 0xff6785c0, 0xff4a68a4, 0xfb3e5b98, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff22417e, 0xff38548c, 0xff687a9e, 0xff97a9ce, 0xff687a9e, 0xff38548c, 0xff22417e, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff102f6b, 0xff23417c, 0xff334771, 0xff41506d, 0xff334771, 0xff23417c, 0xff102f6b, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0x38000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x38000000, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x1b000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x1b000000, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, +}; + +#define ICON32_WIDTH 24 +#define ICON32_HEIGHT 20 +#define ICON32_DEPTH 32 + +int main(void) +{ + if((IntuitionBase = (APTR)OpenLibrary("intuition.library", 36)) && + GETINTERFACE(IIntuition, IntuitionBase)) + { + if((UtilityBase = (APTR)OpenLibrary("utility.library", 36)) && + GETINTERFACE(IUtility, UtilityBase)) + { + if((MUIMasterBase = OpenLibrary("muimaster.library", 19)) && + GETINTERFACE(IMUIMaster, MUIMasterBase)) + { + Object *app, *window; + const char * const classes[] = { "NBitmap.mcc", NULL }; + + app = MUI_NewObject("Application.mui", + MUIA_Application_Author, "NBitmap.mcc Open Source Team", + MUIA_Application_Base, "NBitmap-Test", + MUIA_Application_Copyright, "(c) 2007 NBitmap.mcc Open Source Team", + MUIA_Application_Description, "NBitmap.mcc demo program", + MUIA_Application_Title, "NBitmap-Demo", + MUIA_Application_Version, "$VER: NBitmap-Demo (" __DATE__ ")", + MUIA_Application_UsedClasses, classes, + + MUIA_Application_Window, + window = WindowObject, + MUIA_Window_Title, "NBitmap-Test", + MUIA_Window_ID, MAKE_ID('M','A','I','N'), + MUIA_Window_RootObject, VGroup, + Child, HGroup, + Child, NBitmapObject, + MUIA_NBitmap_Type, MUIV_NBitmap_Type_File, + MUIA_NBitmap_Normal, "PROGDIR:icon.png", + MUIA_NBitmap_Label, "Music", + MUIA_NBitmap_Button, TRUE, + End, + Child, NBitmapObject, + MUIA_NBitmap_Width, ICON32_WIDTH, + MUIA_NBitmap_Height, ICON32_HEIGHT, + MUIA_NBitmap_Type, MUIV_NBitmap_Type_ARGB32, + MUIA_NBitmap_Normal, icon32_normal, + MUIA_NBitmap_Selected, icon32_selected, + MUIA_NBitmap_Label, "raw icon", + MUIA_NBitmap_Button, TRUE, + End, + Child, RectangleObject, End, + End, + Child, RectangleObject, End, + End, + End, + End; + + if(app != NULL) + { + ULONG sigs = 0; + + DoMethod(window, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit); + + set(window, MUIA_Window_Open, TRUE); + + while((LONG)DoMethod(app, MUIM_Application_NewInput, &sigs) != (LONG)MUIV_Application_ReturnID_Quit) + { + if(sigs) + { + sigs = Wait(sigs | SIGBREAKF_CTRL_C); + + if(sigs & SIGBREAKF_CTRL_C) + break; + } + } + + MUI_DisposeObject(app); + } + else + PutStr("Failed to create application\n"); + + DROPINTERFACE(IMUIMaster); + CloseLibrary(MUIMasterBase); + MUIMasterBase = NULL; + } + else + PutStr("Failed to open muimaster.library V19\n"); + + DROPINTERFACE(IUtility); + CloseLibrary((struct Library *)UtilityBase); + UtilityBase = NULL; + } + else + PutStr("Failed to open utility.library V36\n"); + + DROPINTERFACE(IIntuition); + CloseLibrary((struct Library *)IntuitionBase); + IntuitionBase = NULL; + } + else + PutStr("Failed to open intuition.library V36\n"); + + return 0; +} diff --git a/workbench/classes/zune/nlist/demo/NList-Demo.c b/workbench/classes/zune/nlist/demo/NList-Demo.c new file mode 100644 index 0000000000..998673fb08 --- /dev/null +++ b/workbench/classes/zune/nlist/demo/NList-Demo.c @@ -0,0 +1,830 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2006 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(__amigaos4__) +#include +#endif + +struct Library *MUIMasterBase = NULL; +#if defined(__AROS__) +struct UtilityBase *UtilityBase = NULL; +#else +struct Library *UtilityBase = NULL; +#endif + +#if defined(__amigaos4__) +struct Library *IntuitionBase = NULL; +struct Library *GfxBase = NULL; +#else +struct IntuitionBase *IntuitionBase = NULL; +struct GfxBase *GfxBase = NULL; +#endif + +#if defined(__amigaos4__) +struct GraphicsIFace *IGraphics = NULL; +struct IntuitionIFace *IIntuition = NULL; +struct MUIMasterIFace *IMUIMaster = NULL; +struct UtilityIFace *IUtility = NULL; +#endif + +#include +#include + +#include "NList-Demo2.h" +#include "NList-Demo3.h" + +#include "SDI_compiler.h" + +/* *********************************************** */ + + +static APTR APP_Main, + WIN_Main, + WIN_2, + BM_img, + BM_img2, + BT_TitleOn, + BT_TitleOff, + BT_NoMulti, + BT_Multidef, + BT_Multi, + BT_AllMulti, + BT_InputOn, + BT_InputOff, + BT_Sort, + BT_DragSortOn, + BT_DragSortOff, + BT_SelLine, + BT_SelChar, + BT_OpenWin2, + BT_RemAct, + BT_RemSel, + BT_Clear, + BT_Add, + LV_Text, + LI_Text, + LV_Text2, + LI_Text2, + PR_Horiz, + ST_string; + + +/* ************ IMG definitions ************** */ + +const ULONG list_colors[24] = +{ +0xadadadad,0xadadadad,0xadadadad, +0x7b7b7b7b,0x7b7b7b7b,0x7b7b7b7b, +0x3b3b3b3b,0x67676767,0xa2a2a2a2, +0xadadadad,0xadadadad,0xadadadad, +0xadadadad,0xadadadad,0xadadadad, +0xadadadad,0xadadadad,0xadadadad, +0xffffffff,0xffffffff,0xffffffff, +0x00000000,0x00000000,0x00000000, +}; + +const UBYTE list_body[168] = { +0x00,0x00,0x44,0x00,0xff,0xff,0xb8,0x00,0xff,0xff,0xb8,0x00,0x00,0x00,0x00, +0x00,0x80,0x00,0x64,0x00,0xff,0xff,0xb8,0x00,0x3b,0xb8,0x46,0x00,0x80,0x00, +0x64,0x00,0xc4,0x47,0xfc,0x00,0x00,0x00,0x46,0x00,0x80,0x00,0x64,0x00,0xff, +0xff,0xfc,0x00,0x36,0xd8,0x46,0x00,0x80,0x00,0x64,0x00,0xc9,0x27,0xfc,0x00, +0x00,0x00,0x46,0x00,0x80,0x00,0x64,0x00,0xff,0xff,0xfc,0x00,0x3d,0xe8,0x6e, +0x00,0x80,0x00,0x5c,0x00,0xc2,0x17,0xcc,0x00,0x00,0x00,0x46,0x00,0x80,0x00, +0x78,0x00,0xff,0xff,0xf8,0x00,0x00,0x00,0x40,0x00,0x80,0x00,0x64,0x00,0xff, +0xff,0xf8,0x00,0xbf,0xff,0xee,0x00,0x7f,0xff,0xdc,0x00,0x3f,0xff,0xcc,0x00, +0x00,0x44,0x46,0x00,0xff,0xbb,0xb8,0x00,0xff,0xbb,0xb8,0x00,0x00,0x00,0x00, +0x00,0x80,0x66,0x64,0x00,0xff,0xbb,0xb8,0x00,0xbf,0xee,0xee,0x00,0x7f,0xdd, +0xdc,0x00,0x3f,0xcc,0xcc,0x00,0x3f,0xee,0xee,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00, }; + +#define LIST_WIDTH 23 +#define LIST_HEIGHT 14 +#define LIST_DEPTH 3 +#define LIST_COMPRESSION 0 +#define LIST_MASKING 2 + +#define IMG \ + BodychunkObject,\ + MUIA_FixWidth , LIST_WIDTH ,\ + MUIA_FixHeight , LIST_HEIGHT,\ + MUIA_Bitmap_Width , LIST_WIDTH ,\ + MUIA_Bitmap_Height , LIST_HEIGHT,\ + MUIA_Bodychunk_Depth , LIST_DEPTH ,\ + MUIA_Bodychunk_Body , (UBYTE *) list_body,\ + MUIA_Bodychunk_Compression, LIST_COMPRESSION,\ + MUIA_Bodychunk_Masking , LIST_MASKING,\ + MUIA_Bitmap_SourceColors , (ULONG *) list_colors,\ + MUIA_Bitmap_Transparent , 0,\ + End + + +/* ************ IMG2 definitions ************** */ + +const ULONG list2_colors[24] = +{ +0xabababab,0xadadadad,0xc5c5c5c5, +0x7b7b7b7b,0x7b7b7b7b,0x7b7b7b7b, +0x3b3b3b3b,0x67676767,0xa2a2a2a2, +0x00000000,0x00000000,0x00000000, +0xffffffff,0xa9a9a9a9,0x97979797, +0xffffffff,0xffffffff,0xffffffff, +0x00000000,0x00000000,0x00000000, +0xadadadad,0xadadadad,0xadadadad, +}; + +const UBYTE list2_body[156] = { +0x04,0x00,0x04,0x00,0x78,0x00,0x08,0x00,0x30,0x00,0x08,0x00,0x79,0x00,0x02, +0x00,0x8e,0x00,0x1c,0x00,0x3e,0x00,0x1c,0x00,0x7e,0x10,0x04,0x00,0x83,0xe0, +0x08,0x00,0xfe,0x80,0x08,0x00,0x45,0x02,0x00,0x00,0x85,0x9c,0x00,0x00,0xff, +0x70,0x00,0x00,0x7e,0x1c,0x80,0x00,0xc1,0x3b,0x78,0x00,0xfe,0xf9,0x30,0x00, +0x00,0x2f,0xb0,0x00,0xff,0x60,0x4c,0x00,0x7e,0xbf,0x48,0x00,0x7c,0x27,0x68, +0x00,0x03,0xc1,0xa4,0x00,0x01,0x7f,0xb4,0x00,0x01,0x1a,0xd8,0x00,0x03,0xe3, +0xa4,0x00,0x01,0xbf,0xac,0x00,0x00,0x6c,0xaa,0x00,0x04,0x99,0xd4,0x00,0x03, +0x97,0xfc,0x00,0x01,0x76,0x5a,0x00,0x38,0x8d,0xec,0x00,0x1e,0x8b,0x7c,0x00, +0x02,0xeb,0x72,0x00,0x0d,0x04,0xfc,0x00,0x09,0x06,0xf8,0x00,0x01,0x84,0x06, +0x00,0x0e,0x02,0xf8,0x00,0x06,0x01,0xb0,0x00,0x00,0x03,0xfc,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00, }; + +#define LIST2_WIDTH 23 +#define LIST2_HEIGHT 13 +#define LIST2_DEPTH 3 +#define LIST2_COMPRESSION 0 +#define LIST2_MASKING 2 + +#define IMG2 \ + BodychunkObject,\ + MUIA_FixWidth , LIST2_WIDTH ,\ + MUIA_FixHeight , LIST2_HEIGHT,\ + MUIA_Bitmap_Width , LIST2_WIDTH ,\ + MUIA_Bitmap_Height , LIST2_HEIGHT,\ + MUIA_Bodychunk_Depth , LIST2_DEPTH ,\ + MUIA_Bodychunk_Body , (UBYTE *) list2_body,\ + MUIA_Bodychunk_Compression, LIST2_COMPRESSION,\ + MUIA_Bodychunk_Masking , LIST2_MASKING,\ + MUIA_Bitmap_SourceColors , (ULONG *) list2_colors,\ + MUIA_Bitmap_Transparent , 0,\ + End + + +/* *********************************************** */ + + +#define ID_LIST2_ACTIVE 1 + +#define NL "\n" +#define NL2 " " + + +/* *********************************************** */ + +const char MainTextString2[] = +{ + "This new list/listview custom class has its own backgrounds" NL2 + "and pens setables from mui prefs with NListviews.mcp !" NL2 + "It doesn't use the same way to handle multiselection" NL2 + "with mouse and keys than standard List/Listview." NL + "\033C" NL + "You can horizontally scroll with cursor keys," NL2 + "or going on the right and left of the list" NL2 + "while selecting with the mouse." NL2 + "(When there is no immediate draggin stuff active...)" NL2 + "Try just clicking on the left/right borders !" NL + "\033C" NL + "\033r\033uGive some feedback about it ! :-)" NL + "\033r\033bhttp://www.sf.net/projects/nlist-classes/" +}; + +/* *********************************************** */ +const char MainTextString[] = +{ + "\033cNList.mcc \033o[0] NListview.mcc \033o[1] NListviews.mcp" NL + "\033E\033t\033c\033o[2@1]" NL + "\033c\033nThis new list/listview custom class has its own backgrounds" NL + "\033cand pens setables from mui prefs with NListviews.mcp !" NL + "\033E\033t[M7]\033c\033o[3@2]" NL + "" NL + "\033cIt doesn't use the same way to handle multiselection" NL + "\033cwith mouse and keys than standard List/Listview." NL + "" NL + "\033cYou can horizontally scroll with cursor keys," NL + "\033cor going on the right and left of the list" NL + "\033cwhile selecting with the mouse." NL + "\033c(When there is no immediate draggin stuff active...)" NL + "\033cTry just clicking on the left/right borders !" NL + "" NL + "\033r\033uGive some feedback about it ! :-)" NL + "\033r\033bhttp://www.sf.net/projects/nlist-classes/" +}; + +/* *********************************************** */ + +const char *MainTextArray[] = +{ + "\033c\033nThis new list/listview custom class has its own backgrounds", + "\033cand pens setables from mui prefs with NListviews.mcp !", + " ", + "\033cIt doesn't use the same way to handle multiselection", + "\033cwith mouse and keys than standard List/Listview.", + " ", + "\033cYou can horizontally scroll with cursor keys,", + "\033cor going on the right and left of the list", + "\033cwhile selecting with the mouse.", + "\033c(When there is no draggin stuff active...)", + "\033cTry just clicking on the left/right borders !", + "", + "\033r\033uGive some feedback about it ! :-)", + "\033r\033bhttp://www.sf.net/projects/nlist-classes/" + "", + "", + "", + "You can push column titles as real buttons...", + "", + "You can drag column separator bar in", + "the title to adjust column width...", + "(or in upper half of first entry if title is off)", + "", + "If, while dragging the bar, you press the", + "menu button, the width of the column will", + "come back to its default...", + "", + "You can click on columns title to sort the list contents.", + "You can shift-click (or other qualifier if you modify the", + "default one) to add a secondary sorting column.", + "", + "", + "", + "\033cF2 to copy selected lines to printer", + "\033cF3 to copy all lines to file RAM:tmp.txt", + "", + "\033cF4 to copy selected lines to clipboard 0.", + "\033cF5 to copy active line to clipboard 0.", + "\033cF6 to copy all lines to clipboard 0.", + "", + "\033cThe classic RightAmiga+C to copy selected", + "\033clines to clipboard 0 is made builtin.", + " ", + " ", + "\033cYou can sort the entries by dragging.", + "\033cYou start a drag using one of the qualifier", + "\033ckeys which are set in prefs,", + "\033cor going on the left and right of entries.", + "", + "", + "Example of horizontal line in top of entry", + "\033TExample of horizontal line in top of entry", + "Example of horizontal line in top of entry", + "", + "Examples of horizontal line and thick line centered on entry", + "\033C", + "\033C\033t", + "\033C\033t[I7]", + "\033C\033t[M7]", + "\033C\033t[-5]", + "\033C\033t[N]", + "\033C\033t[NI3]", + "\033C\033t[NM7]", + "\033C\033t[N-5]", + "Examples of horizontal line and thick line centered on entry", + "", + "Example of horizontal line in bottom of entry", + "\033BExample of horizontal line in bottom of entry", + "Example of horizontal line in bottom of entry", + "", + "Examples of horizontal line centered on entry visible on left and rigth only", + "\033c\033EExample of left-right horizontal line", + "\033ESame, but left aligned", + "\033r\033ESame, but right aligned", + "\033t\033c\033ELeft-right horizontal thick line", + "\033t[N]\033c\033ELeft-right horizontal thick line", + "Examples of horizontal line centered on entry visible on left and rigth only", + "", + "", + "\033E\033cExamples of bitmap images :", + "\033c\033o[0] \033o[1]", + "which can be used without subclassing the NList class.", + "", + "\033E\033cExamples of custom object images : ", + "\033o[2;9d51ffff;1] (default width/special 1)", + "\033o[2;9d51ffff;0,24] (24 pixel width/special 0)", + "\033o[2;9d51ffff;1,48] (48 pixel width/special 1)", + "\033o[2;9d51ffff;0,96] (96 pixel width/special 0)", + "", + "\033E\033cExamples of custom object images : ", + "\033o[2;9d51ffff;8,30] (default width/special 8)", + "\033o[2;9d51ffff;6,40] (default width/special 6)", + "\033o[2;9d51ffff;7,40] (40 pixel width/special 7)", + "\033o[2;9d51ffff;4,50] (50 pixel width/special 4)", + "\033o[2;9d51ffff;5,50] (50 pixel width/special 5)", + "\033o[2;9d51ffff;2,30] (30 pixel width/special 2)", + "\033o[2;9d51ffff;3,30] (30 pixel width/special 3)", + "", + "\033E\033cExamples of direct ImageSpec :", + "kmel/kmel_arrowdown.image : \033I[3:kmel/kmel_arrowdown.image]", + "WD/11pt/ArrowLeft.mf0 : \033I[3:WD/11pt/ArrowLeft.mf0]", + "", + "\033C", + "", + "ww\tTabulation test", + "w\tTabulation test", + "\033cww\tTabulation test", + "\033cw\tTabulation test", + "\033rww\tTabulation test", + "\033rw\tTabulation test", + "", + "", + "long line for FULLAUTO horizontal scroller test, long line for FullAuto horizontal scroller test, long line for FULLAUTO horizontal scroller test.", + "", + "0 just a little \033bline to test\033n stuffs", + "1 just a little \033bline to test\033n stuffs", + "2 just a little \033bline to test\033n stuffs", + "3 just a little \033bline to test\033n stuffs", + "\033c4 just a little \033uline to test\033n (center)", + "\033c5 just a little \033uline to test\033n (center)", + "\033c6 just a little \033uline to test\033n (center)", + "\033r7 just a little \033uline to test\033n (right)", + "\033r8 just a little \033uline to test\033n (right)", + "\033r9 just a little \033uline to test\033n (right)", + "10 just a little line to test stuffs and bugs", + "11 just a little line to test stuffs and bugs", + "12 just a little line to test stuffs and bugs", + "13 just a little line to test stuffs and bugs", + "14 just a little line to test stuffs and bugs", + "15 just a little \033iline to test stuffs\033n and bugs", + "16 just a little line to test stuffs and bugs", + "17 just a little line to test stuffs and bugs", + "18 just a little line to test stuffs and bugs", + "19 just a little line to test stuffs and bugs", + "\033c20 just a little line to test stuffs and bugs (center)", + "\033c21 just a little line to test stuffs and bugs (center)", + "\033c22 just a little line to test stuffs and bugs (center)", + "\033c23 just a little line to test stuffs and bugs (center)", + "24 just a little line to test stuffs and bugs, just a little line", + "25 just a little line to test stuffs and bugs, just a little line", + "\033r26 just a little line to test stuffs and bugs (right)", + "\033r27 just a little line to test stuffs and bugs (right)", + "\033r28 just a little line to test stuffs and bugs (right)", + "\033r29 just a little line to test stuffs and bugs (right)", + "30 just a little line to test stuffs and bugs, just a little line to test", + "31 just a little line to test stuffs and bugs, just a little line to test", + "32 \0332just a little line to test stuffs and bugs, just a little line to test", + "33 \0333just a little line to test stuffs and bugs, just a little line to test", + "34 \0334just a little line to test stuffs and bugs, just a little line to test", + "35 \0335just a little line to test stuffs and bugs, just a little line to test", + "36 \0336just a little line to test stuffs and bugs, just a little line to test", + "37 \0337just a little line to test stuffs and bugs, just a little line to test", + "38 \0338just a little line to test stuffs and bugs, just a little line to test", + "39 \0339just a little line to test stuffs and bugs, just a little line to test", + "40 \033P[]just a little line to test stuffs and bugs, just a little line to test stuffs ", + "41 \033P[1]just a little line to test\033P[] stuffs and bugs, just a little line to test stuffs ", + "42 \033P[2]just a little line to test\033P[] stuffs and bugs, just a little line to test stuffs ", + "43 \033P[-1]just a little line to test\033P[] stuffs and bugs, just a little line to test stuffs ", + "44 \033P[-3]just a little line to test\033P[] stuffs and bugs, just a little line to test stuffs ", + "45 just a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "46 just a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "47 just a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "48 just a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "49 just a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "50 \033ijust a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "51 \033ujust a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "52 \033bjust a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "53 \033i\033ujust a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "54 \033i\033bjust a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "55 \033b\033ujust a little line to test stuffs and bugs, just a little line to test, just a little line to test, just a little line to test", + "56 \033i\033b\033ujust a little line to test stuffs and bugs, just a little line to test, just a little line to test, just a little line to test", + "57 just a little line to test stuffs and bugs, just a little line to test, just a little line to test, just a little line to test", + "58 just a little line to test stuffs and bugs, just a little line to test, just a little line to test, just a little line to test", + "59 just a little line to test stuffs and bugs, just a little line to test, just a little line to test, just a little line to test", + " ", + " ", + "\033c\033uI find it \033bnice\033n :-)", + NULL +}; + +/* *********************************************** */ + +#if defined(__amigaos4__) +#define GETINTERFACE(iface, base) (iface = (APTR)GetInterface((struct Library *)(base), "main", 1L, NULL)) +#define DROPINTERFACE(iface) (DropInterface((struct Interface *)iface), iface = NULL) +#else +#define GETINTERFACE(iface, base) TRUE +#define DROPINTERFACE(iface) +#endif + +static VOID fail(APTR APP_Main,const char *str) +{ + if (APP_Main) + MUI_DisposeObject(APP_Main); + NLI_Delete(); + + if(MUIMasterBase) + { + DROPINTERFACE(IMUIMaster); + CloseLibrary(MUIMasterBase); + } + + if(IntuitionBase) + { + DROPINTERFACE(IIntuition); + CloseLibrary((struct Library *)IntuitionBase); + } + + if(GfxBase) + { + DROPINTERFACE(IGraphics); + CloseLibrary((struct Library *)GfxBase); + } + + if(UtilityBase) + { + DROPINTERFACE(IUtility); + CloseLibrary((struct Library *)UtilityBase); + } + + if (str) + { puts(str); + exit(20); + } + exit(0); +} + +static VOID init(VOID) +{ + APP_Main = NULL; + + if((UtilityBase = (APTR)OpenLibrary("utility.library", 36)) && + GETINTERFACE(IUtility, UtilityBase)) + { + if((GfxBase = (APTR)OpenLibrary("graphics.library", 36)) && + GETINTERFACE(IGraphics, GfxBase)) + { + if((IntuitionBase = (APTR)OpenLibrary("intuition.library", 36)) && + GETINTERFACE(IIntuition, IntuitionBase)) + { + if((MUIMasterBase = OpenLibrary("muimaster.library", 19)) && + GETINTERFACE(IMUIMaster, MUIMasterBase)) + { + + if(!NLI_Create()) + fail(NULL,"Failed to create NLI class."); + } + else + fail(NULL,"Failed to open muimaster.library."); + } + else + fail(NULL,"Failed to open intuition.library."); + } + else + fail(NULL,"Failed to open graphics.library."); + } + else + fail(NULL,"Failed to open utility.library."); + +} + + +/* *********************************************** */ + + +int main(UNUSED int argc, UNUSED char *argv[]) +{ + LONG win_opened = 0; + LONG result; + static const char *const UsedClasses[] = { + "NList.mcc", + "NListviews.mcc", + NULL + }; + + init(); + + APP_Main = ApplicationObject, + MUIA_Application_Title , "NList-Demo", + MUIA_Application_Version , "$VER: NList-Demo 1.0 (" __DATE__ ")", + MUIA_Application_Copyright , "Copyright (C) 2001-2006 by NList Open Source Team", + MUIA_Application_Author , "NList Open Source Team", + MUIA_Application_Description, "NList-Demo", + MUIA_Application_Base , "NList-Demo", + MUIA_Application_UsedClasses, UsedClasses, + + SubWindow, WIN_Main = WindowObject, + MUIA_Window_Title, "NList-Demo 1996-2006", + MUIA_Window_ID , MAKE_ID('T','W','I','N'), + WindowContents, VGroup, + Child, HGroup, + Child, BT_InputOn = SimpleButtonCycle("InputOn"), + Child, BT_InputOff = SimpleButtonCycle("InputOff"), + Child, BT_SelLine = SimpleButtonCycle("SelLine"), + Child, BT_SelChar = SimpleButtonCycle("SelChar"), + Child, BT_Clear = SimpleButtonCycle("Clear"), + Child, BT_Add = SimpleButtonCycle("Add"), + End, + Child, HGroup, + Child, BT_NoMulti = SimpleButtonCycle("NoMulti"), + Child, BT_Multidef = SimpleButtonCycle("Def"), + Child, BT_Multi = SimpleButtonCycle("Multi"), + Child, BT_AllMulti = SimpleButtonCycle("AllMulti"), + Child, BM_img = IMG, + Child, BT_RemAct = SimpleButtonCycle("RemAct"), + Child, BT_RemSel = SimpleButtonCycle("RemSel"), + End, + Child, HGroup, + Child, BT_DragSortOn = SimpleButtonCycle("DragSortOn"), + Child, BT_DragSortOff = SimpleButtonCycle("DragSortOff"), + Child, BM_img2 = IMG2, + Child, BT_TitleOn = SimpleButtonCycle("TitleOn"), + Child, BT_TitleOff = SimpleButtonCycle("TitleOff"), + Child, BT_Sort = SimpleButtonCycle("Sort"), + Child, BT_OpenWin2 = SimpleButtonCycle("Win2"), + End, + Child, LV_Text = NListviewObject, + MUIA_CycleChain, 1, + + MUIA_NListview_NList, LI_Text = NListObject, + MUIA_ObjectID, MAKE_ID('N','L','0','1'), + MUIA_NList_DefaultObjectOnClick, TRUE, + MUIA_NList_MultiSelect, MUIV_NList_MultiSelect_None, + MUIA_NList_DisplayHook2, &DisplayLI_TextHook, + MUIA_NList_CompareHook2, &CompareLI_TextHook, + MUIA_NList_ConstructHook2, &ConstructLI_TextHook, + MUIA_NList_DestructHook2, &DestructLI_TextHook, + MUIA_NList_Format, "BAR W=-1,BAR W=-1,BAR", + MUIA_NList_SourceArray, MainTextArray, + MUIA_NList_AutoVisible, TRUE, + MUIA_NList_TitleSeparator, TRUE, + MUIA_NList_Title, TRUE, + MUIA_NList_EntryValueDependent, TRUE, + MUIA_NList_MinColSortable, 0, + MUIA_NList_Imports, MUIV_NList_Imports_All, + MUIA_NList_Exports, MUIV_NList_Exports_All, + End, + MUIA_ShortHelp, "The nice multicolumn\ndraggable list\nwith char selection\npossibility :)", + End, + End, + End, + SubWindow, WIN_2 = WindowObject, + MUIA_Window_Title, "NList-Demo 1996-2006 Win 2", + MUIA_Window_ID , MAKE_ID('W','I','N','2'), + MUIA_Window_UseBottomBorderScroller, TRUE, + WindowContents, VGroup, + Child, NFloattext(MainTextString2), + Child, BalanceObject, End, + Child, VGroup, + MUIA_Group_VertSpacing, 1, + Child, LV_Text2 = NListviewObject, + MUIA_CycleChain, 1, + MUIA_NListview_Horiz_ScrollBar, MUIV_NListview_HSB_None, + MUIA_NListview_NList, LI_Text2 = NListObject, + MUIA_NList_DefaultObjectOnClick, TRUE, + MUIA_NList_ConstructHook, MUIV_NList_ConstructHook_String, + MUIA_NList_DestructHook, MUIV_NList_DestructHook_String, + MUIA_NList_SourceString, MainTextString, + End, + MUIA_ShortHelp, "The 2nd list", + End, + Child, ST_string = StringObject, + MUIA_CycleChain, 1, + StringFrame, + End, + Child, PR_Horiz = ScrollbarObject, + MUIA_Group_Horiz, TRUE, + MUIA_Prop_UseWinBorder,MUIV_Prop_UseWinBorder_Bottom, + End, + End, + End, + End, + End; + + if(!APP_Main) fail(APP_Main,"Failed to create Application."); + + + /* ********** MAIN LIST NOTIFIES ********** */ + + DoMethod(LI_Text, MUIM_Notify, MUIA_NList_TitleClick,MUIV_EveryTime, + LI_Text, 4, MUIM_NList_Sort3, MUIV_TriggerValue, MUIV_NList_SortTypeAdd_2Values, MUIV_NList_Sort3_SortType_Both); + DoMethod(LI_Text, MUIM_Notify, MUIA_NList_TitleClick2,MUIV_EveryTime, + LI_Text, 4, MUIM_NList_Sort3, MUIV_TriggerValue, MUIV_NList_SortTypeAdd_2Values, MUIV_NList_Sort3_SortType_2); + DoMethod(LI_Text, MUIM_Notify, MUIA_NList_SortType,MUIV_EveryTime, + LI_Text, 3, MUIM_Set,MUIA_NList_TitleMark,MUIV_TriggerValue); + DoMethod(LI_Text, MUIM_Notify, MUIA_NList_SortType2,MUIV_EveryTime, + LI_Text, 3, MUIM_Set,MUIA_NList_TitleMark2,MUIV_TriggerValue); + + + /* ********** MAIN LIST IMAGES ********** */ + + DoMethod(LI_Text,MUIM_NList_UseImage,BM_img,0,0); + DoMethod(LI_Text,MUIM_NList_UseImage,BM_img2,1,0); + + DoMethod(LI_Text,MUIM_NList_UseImage,NImageObject,2,~0L); + + + /* ********** BUTTONS NOTIFIES ********** */ + + DoMethod(BT_TitleOn, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_Title,"\033cThis is that list title ! :-)"); + DoMethod(BT_TitleOff, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_Title,NULL); + DoMethod(BT_NoMulti, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_MultiSelect,MUIV_NList_MultiSelect_None); + DoMethod(BT_Multidef, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_MultiSelect,MUIV_NList_MultiSelect_Default); + DoMethod(BT_Multi, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_MultiSelect,MUIV_NList_MultiSelect_Shifted); + DoMethod(BT_AllMulti, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_MultiSelect,MUIV_NList_MultiSelect_Always); + DoMethod(BT_InputOn, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_Input,TRUE); + DoMethod(BT_InputOff, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_Input,FALSE); + DoMethod(BT_DragSortOn, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_DragSortable,TRUE); + DoMethod(BT_DragSortOff, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_DragSortable,FALSE); + DoMethod(BT_RemAct, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 2, MUIM_NList_Remove,MUIV_NList_Remove_Active); + DoMethod(BT_RemSel, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 2, MUIM_NList_Remove,MUIV_NList_Remove_Selected); + DoMethod(BT_Clear, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 1, MUIM_NList_Clear); + DoMethod(BT_Add, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 4, MUIM_NList_Insert,MainTextArray,15,MUIV_NList_Insert_Bottom); + DoMethod(BT_Sort, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 1, MUIM_NList_Sort); + DoMethod(BT_SelLine, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_TypeSelect,MUIV_NList_TypeSelect_Line); + DoMethod(BT_SelChar, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_TypeSelect,MUIV_NList_TypeSelect_Char); + DoMethod(BT_OpenWin2, MUIM_Notify, MUIA_Pressed,FALSE, + WIN_2, 3, MUIM_Set,MUIA_Window_Open,TRUE); + + + /* ********** WINDOW1 KEYS NOTIFIES ********** */ + + DoMethod(WIN_Main,MUIM_Notify, MUIA_Window_InputEvent, "f2", + LI_Text, 4,MUIM_NList_CopyTo,MUIV_NList_CopyTo_Selected,"PRT:",&result,NULL); + DoMethod(WIN_Main,MUIM_Notify, MUIA_Window_InputEvent, "f3", + LI_Text, 4,MUIM_NList_CopyTo,MUIV_NList_CopyTo_All,"RAM:tmp.txt",&result,NULL); + DoMethod(WIN_Main,MUIM_Notify, MUIA_Window_InputEvent, "f4", + LI_Text, 4,MUIM_NList_CopyToClip,MUIV_NList_CopyToClip_Selected,0L,NULL,NULL); + DoMethod(WIN_Main,MUIM_Notify, MUIA_Window_InputEvent, "f5", + LI_Text, 4,MUIM_NList_CopyToClip,MUIV_NList_CopyToClip_Active,0L,NULL,NULL); + DoMethod(WIN_Main,MUIM_Notify, MUIA_Window_InputEvent, "f6", + LI_Text, 4,MUIM_NList_CopyToClip,MUIV_NList_CopyToClip_All,0L,NULL,NULL); + + + /* ********** WINDOW2 LIST NOTIFIES ********** */ + + DoMethod(LI_Text2,MUIM_Notify,MUIA_NList_ButtonClick, 1, + APP_Main, 6, MUIM_Application_PushMethod, + WIN_2, 3, MUIM_Set,MUIA_Window_Open,FALSE); + + DoMethod(LI_Text2,MUIM_Notify,MUIA_NList_ButtonClick, 2, + LI_Text, 1, MUIM_NList_Clear); + + + DoMethod(LI_Text2, MUIM_Notify, MUIA_NList_Horiz_Entries,MUIV_EveryTime, + PR_Horiz, 3, MUIM_NoNotifySet,MUIA_Prop_Entries,MUIV_TriggerValue); + DoMethod(LI_Text2, MUIM_Notify, MUIA_NList_Horiz_Visible,MUIV_EveryTime, + PR_Horiz, 3, MUIM_NoNotifySet,MUIA_Prop_Visible,MUIV_TriggerValue); + DoMethod(LI_Text2, MUIM_Notify, MUIA_NList_Horiz_First,MUIV_EveryTime, + PR_Horiz, 3, MUIM_NoNotifySet,MUIA_Prop_First,MUIV_TriggerValue); + DoMethod(PR_Horiz, MUIM_Notify, MUIA_Prop_First,MUIV_EveryTime, + LI_Text2, 3, MUIM_NoNotifySet,MUIA_NList_Horiz_First,MUIV_TriggerValue); + DoMethod(LI_Text2, MUIM_Notify, MUIA_NList_HorizDeltaFactor,MUIV_EveryTime, + PR_Horiz, 3, MUIM_NoNotifySet,MUIA_Prop_DeltaFactor,MUIV_TriggerValue); + + set(ST_string, MUIA_String_AttachedList, LI_Text2); + DoMethod(LI_Text2,MUIM_Notify,MUIA_NList_SelectChange,TRUE,APP_Main,2,MUIM_Application_ReturnID,ID_LIST2_ACTIVE); + DoMethod(LI_Text2,MUIM_Notify,MUIA_NList_Active,MUIV_EveryTime,APP_Main,2,MUIM_Application_ReturnID,ID_LIST2_ACTIVE); + set(LI_Text2, MUIA_NList_Active, 2); + + + /* ********** WINDOW2 LIST IMAGES ********** */ + + DoMethod(LI_Text2,MUIM_NList_UseImage,BM_img,0,0); + DoMethod(LI_Text2,MUIM_NList_UseImage,BM_img2,1,0); + + DoMethod(LI_Text2,MUIM_NList_UseImage,SimpleButtonTiny("Click me to close"),2,~0L); + DoMethod(LI_Text2,MUIM_NList_UseImage,SimpleButtonTiny("Clear main list"),3,~0L); + + + /* ********** WINDOW2 NOTIFIES ********** */ + + DoMethod(WIN_Main,MUIM_Notify,MUIA_Window_CloseRequest,TRUE, + APP_Main, 5, MUIM_Application_PushMethod, + APP_Main,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit); + + DoMethod(WIN_2,MUIM_Notify,MUIA_Window_CloseRequest,TRUE, + APP_Main, 6, MUIM_Application_PushMethod, + WIN_2, 3, MUIM_Set,MUIA_Window_Open,FALSE); + + set(WIN_Main, MUIA_Window_DefaultObject, LV_Text); + set(WIN_Main, MUIA_Window_ActiveObject, LV_Text); + set(WIN_2, MUIA_Window_ActiveObject, ST_string); + set(WIN_2, MUIA_Window_DefaultObject, LV_Text2); + + + /* ************************************** */ + + DoMethod(APP_Main,MUIM_Application_Load,MUIV_Application_Load_ENVARC); + + /* *** If need to be sorted, sort then restore the active and first *** */ + /* *** which were set in the Application_Load *** */ + { + ULONG active = 0,first = 0,sorttype = 0; + get(LI_Text,MUIA_NList_SortType,&sorttype); + if (sorttype != MUIV_NList_SortType_None) + { get(LI_Text,MUIA_NList_Active,&active); + get(LI_Text,MUIA_NList_First,&first); + DoMethod(LI_Text, MUIM_NList_Sort); + set(LI_Text,MUIA_NList_Active,active); + set(LI_Text,MUIA_NList_First,first); + } + } + + set(WIN_2,MUIA_Window_Open,TRUE); + set(WIN_Main,MUIA_Window_Open,TRUE); + + get(WIN_Main,MUIA_Window_Open,&win_opened); + if (win_opened) + { + LONG id; + ULONG sigs = 0; + char *line; + + while ((id = DoMethod(APP_Main,MUIM_Application_NewInput,&sigs)) != (LONG)MUIV_Application_ReturnID_Quit) + { + if (id == ID_LIST2_ACTIVE) + { DoMethod(LI_Text2, MUIM_NList_GetEntry, MUIV_NList_GetEntry_Active, &line); + set(ST_string, MUIA_String_Contents, line); + set(WIN_2, MUIA_Window_ActiveObject, ST_string); + } + if (sigs) + { sigs = Wait(sigs | SIGBREAKF_CTRL_C); + if (sigs & SIGBREAKF_CTRL_C) break; + } + } + } + else + printf("failed to open main window !\n"); + + DoMethod(APP_Main,MUIM_Application_Save,MUIV_Application_Save_ENVARC); + + set(WIN_2,MUIA_Window_Open,FALSE); + set(WIN_Main,MUIA_Window_Open,FALSE); + + DoMethod(LI_Text,MUIM_NList_UseImage,NULL,-1,0); + DoMethod(LI_Text2,MUIM_NList_UseImage,NULL,-1,0); + + fail(APP_Main,NULL); + + return 0; +} + diff --git a/workbench/classes/zune/nlist/demo/NList-Demo2.c b/workbench/classes/zune/nlist/demo/NList-Demo2.c new file mode 100644 index 0000000000..cedadce32f --- /dev/null +++ b/workbench/classes/zune/nlist/demo/NList-Demo2.c @@ -0,0 +1,211 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2006 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if defined(__AROS__) +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +extern struct Library *MUIMasterBase; + +#include +#include + +#include "NList-Demo2.h" + +#include + +#include "SDI_hook.h" + +/* *********************************************** */ + +struct LITD { + LONG num; + char str1[4]; + char *str2; +}; + +/* *********************************************** */ + +HOOKPROTONHNO(ConstructLI_TextFunc, APTR, struct NList_ConstructMessage *ncm) +{ + struct LITD *new_entry = (struct LITD *) AllocVec(sizeof(struct LITD),0); + + if (new_entry) + { + int i = 0, j = 0; + new_entry->num = -1; + new_entry->str2 = (char *) ncm->entry; + while ((j < 3) && new_entry->str2[i]) + { + if ((new_entry->str2[i] > 'A') && (new_entry->str2[i] < 'z')) + new_entry->str1[j++] = new_entry->str2[i]; + if (new_entry->str2[i] == '\033') + i++; + i++; + } + new_entry->str1[j] = '\0'; + + return (new_entry); + } + return (NULL); +} +MakeHook(ConstructLI_TextHook, ConstructLI_TextFunc); + +/* *********************************************** */ + +HOOKPROTONHNO(DestructLI_TextFunc, void, struct NList_DestructMessage *ndm) +{ + if (ndm->entry) + FreeVec((void *) ndm->entry); +} +MakeHook(DestructLI_TextHook, DestructLI_TextFunc); + +/* *********************************************** */ + +static char buf[20]; + +HOOKPROTONHNO(DisplayLI_TextFunc, void, struct NList_DisplayMessage *ndm) +{ + struct LITD *entry = (struct LITD *) ndm->entry; + + if (entry) + { if (entry->num < 0) + entry->num = ndm->entry_pos; + + ndm->preparses[0] = (STRPTR)"\033c"; + ndm->preparses[1] = (STRPTR)"\033c"; + + if (entry->num % 20 == 3) + ndm->strings[0] = (STRPTR)"\033o[0]"; + else if (entry->num % 20 == 13) + ndm->strings[0] = (STRPTR)"\033o[1]"; + else + { + snprintf(buf, sizeof(buf), "%d", (unsigned int)entry->num); + ndm->strings[0] = buf; + } + + ndm->strings[1] = (char *) entry->str1; + ndm->strings[2] = (char *) entry->str2; + } + else + { + ndm->preparses[0] = (STRPTR)"\033c"; + ndm->preparses[1] = (STRPTR)"\033c"; + ndm->preparses[2] = (STRPTR)"\033c"; + ndm->strings[0] = (STRPTR)"Num"; + ndm->strings[1] = (STRPTR)"Short"; + ndm->strings[2] = (STRPTR)"This is the list title !\033n\033b :-)"; + } +} +MakeHook(DisplayLI_TextHook, DisplayLI_TextFunc); + + +/* *********************************************** */ + +HOOKPROTONHNO(CompareLI_TextFunc, LONG, struct NList_CompareMessage *ncm) +{ + struct LITD *entry1 = (struct LITD *) ncm->entry1; + struct LITD *entry2 = (struct LITD *) ncm->entry2; + LONG col1 = ncm->sort_type & MUIV_NList_TitleMark_ColMask; + LONG col2 = ncm->sort_type2 & MUIV_NList_TitleMark2_ColMask; + LONG result = 0; + +/* + LONG st = ncm->sort_type & MUIV_NList_TitleMark_TypeMask; +kprintf("%lx|Compare() %lx / %lx / %lx\n",obj,ncm->sort_type,st,ncm->sort_type2); +*/ + + if(ncm->sort_type == (LONG)MUIV_NList_SortType_None) + return (0); + + if (col1 == 0) + { if (ncm->sort_type & MUIV_NList_TitleMark_TypeMask) + result = entry2->num - entry1->num; + else + result = entry1->num - entry2->num; + } + else if (col1 == 1) + { if (ncm->sort_type & MUIV_NList_TitleMark_TypeMask) + result = (LONG) stricmp(entry2->str1,entry1->str1); + else + result = (LONG) stricmp(entry1->str1,entry2->str1); + } + else if (col1 == 2) + { if (ncm->sort_type & MUIV_NList_TitleMark_TypeMask) + result = (LONG) stricmp(entry2->str2,entry1->str2); + else + result = (LONG) stricmp(entry1->str2,entry2->str2); + } + + if ((result != 0) || (col1 == col2)) + return (result); + + if (col2 == 0) + { if (ncm->sort_type2 & MUIV_NList_TitleMark2_TypeMask) + result = entry2->num - entry1->num; + else + result = entry1->num - entry2->num; + } + else if (col2 == 1) + { if (ncm->sort_type2 & MUIV_NList_TitleMark2_TypeMask) + result = (LONG) stricmp(entry2->str1,entry1->str1); + else + result = (LONG) stricmp(entry1->str1,entry2->str1); + } + else if (col2 == 2) + { if (ncm->sort_type2 & MUIV_NList_TitleMark2_TypeMask) + result = (LONG) stricmp(entry2->str2,entry1->str2); + else + result = (LONG) stricmp(entry1->str2,entry2->str2); + } + + return (result); +} +MakeHook(CompareLI_TextHook, CompareLI_TextFunc); + diff --git a/workbench/classes/zune/nlist/demo/NList-Demo2.h b/workbench/classes/zune/nlist/demo/NList-Demo2.h new file mode 100644 index 0000000000..23d8b5d693 --- /dev/null +++ b/workbench/classes/zune/nlist/demo/NList-Demo2.h @@ -0,0 +1,79 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2006 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +extern struct Hook DisplayLI_TextHook; +extern struct Hook CompareLI_TextHook; +extern struct Hook ConstructLI_TextHook; +extern struct Hook DestructLI_TextHook; + +/* MUI STUFF */ + +#ifndef MAKE_ID +#define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d)) +#endif + +/* *********************************************** */ + +#define SimpleButtonCycle(name) \ + TextObject, \ + ButtonFrame, \ + MUIA_CycleChain, 1, \ + MUIA_Font, MUIV_Font_Button, \ + MUIA_Text_Contents, name, \ + MUIA_Text_PreParse, "\33c", \ + MUIA_InputMode , MUIV_InputMode_RelVerify, \ + MUIA_Background , MUII_ButtonBack, \ + End + +/* *********************************************** */ + +#define SimpleButtonTiny(name) \ + TextObject, \ + ButtonFrame, \ + MUIA_Font, MUIV_Font_Tiny, \ + MUIA_Text_Contents, name, \ + MUIA_Text_PreParse, "\33c", \ + MUIA_InputMode , MUIV_InputMode_RelVerify, \ + MUIA_Background , MUII_ButtonBack, \ + End + +/* *********************************************** */ + +#define NFloattext(ftxt) \ + NListviewObject, \ + MUIA_Weight, 50, \ + MUIA_CycleChain, 1, \ + MUIA_NListview_Horiz_ScrollBar, MUIV_NListview_HSB_None, \ + MUIA_NListview_Vert_ScrollBar, MUIV_NListview_VSB_Always, \ + MUIA_NListview_NList,NFloattextObject, \ + MUIA_NList_DefaultObjectOnClick, TRUE, \ + MUIA_NFloattext_Text, ftxt, \ + MUIA_NFloattext_TabSize, 4, \ + MUIA_NFloattext_Justify, TRUE, \ + End, \ + End + +/* *********************************************** */ + diff --git a/workbench/classes/zune/nlist/demo/NList-Demo3.c b/workbench/classes/zune/nlist/demo/NList-Demo3.c new file mode 100644 index 0000000000..f1f211bdda --- /dev/null +++ b/workbench/classes/zune/nlist/demo/NList-Demo3.c @@ -0,0 +1,262 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2006 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#undef GetOutlinePen + +#if !defined(__amigaos4__) +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +extern struct Library *MUIMasterBase; + +#include +#include + +#include "NList-Demo3.h" + +#include + +#include "SDI_hook.h" + +/* *********************************************** */ + + +struct MUI_CustomClass *NLI_Class = NULL; + + +/* *********************************************** */ + + +struct NLIData +{ + LONG special; + LONG EntryCurrent; + LONG EntryHeight; +}; + + +/* *********************************************** */ + + +IPTR mNLI_Draw(struct IClass *cl,Object *obj,struct MUIP_Draw *msg) +{ + register struct NLIData *data = INST_DATA(cl,obj); + DoSuperMethodA(cl,obj,(Msg) msg); + if ((msg->flags & MADF_DRAWOBJECT) || (msg->flags & MADF_DRAWUPDATE)) + { WORD x1,x2,x3,x4,x5,y1,y2,y3,y4,y5; + y1 = _top(obj); + y2 = _bottom(obj); + x1 = _left(obj); + x2 = _right(obj); + if ((data->special == 0) || (data->special == 1)) + { + y3 = (y1+y2)/2; + x3 = (x1+x2)/2; + SetAPen(_rp(obj),_pens(obj)[MPEN_MARK]); + SetBPen(_rp(obj),_pens(obj)[MPEN_SHADOW]); + SetDrMd(_rp(obj),JAM2); + SetDrPt(_rp(obj),(UWORD) ~0); + if (data->special == 0) + { Move(_rp(obj), x3-2, y1+1); + Draw(_rp(obj), x3-2, y2-1); + Move(_rp(obj), x3, y1+1); + Draw(_rp(obj), x3, y2-1); + Move(_rp(obj), x3+2, y1+1); + Draw(_rp(obj), x3+2, y2-1); + } + else if (data->special == 1) + { Move(_rp(obj), x1, y3-2); + Draw(_rp(obj), x2, y3-2); + Move(_rp(obj), x1, y3); + Draw(_rp(obj), x2, y3); + Move(_rp(obj), x1, y3+2); + Draw(_rp(obj), x2, y3+2); + } + SetAPen(_rp(obj),_pens(obj)[MPEN_SHADOW]); + Move(_rp(obj), x1, y2-1); + Draw(_rp(obj), x1, y1+1); + Draw(_rp(obj), x2, y1+1); + SetAPen(_rp(obj),_pens(obj)[MPEN_SHINE]); + Draw(_rp(obj), x2, y2-1); + Draw(_rp(obj), x1, y2-1); + SetDrMd(_rp(obj),JAM1); + } + else if (((x2 - x1) >= 10) && ((y2 - y1) >= 8)) /* and special==2 to 9 */ + { + y3 = (y1+y2)/2; + x3 = x1 + 1; + x2--; + SetAPen(_rp(obj),_pens(obj)[MPEN_SHADOW]); + SetDrMd(_rp(obj),JAM1); + + y4 = y1; + x4 = x3 + 2; + y5 = y2; + x5 = x2-6; + if ((data->EntryHeight & 1) && (data->EntryCurrent & 1)) + y4++; + if ((y4 & 1) != (y3 & 1)) + x4--; + if (data->special > 5) + x5 = x2; + if (data->special & 1) + y5 = y3; + while (y4 <= y5) + { WritePixel(_rp(obj), x3, y4); + y4 += 2; + } + if (data->special <= 7) + { + while (x4 <= x5) + { WritePixel(_rp(obj), x4, y3); + x4 += 2; + } + } + if (data->special <= 5) + { + Move(_rp(obj), x2-6, y3); + Draw(_rp(obj), x2-6, y3-3); + Draw(_rp(obj), x2, y3-3); + Draw(_rp(obj), x2, y3+3); + Draw(_rp(obj), x2-6, y3+3); + Draw(_rp(obj), x2-6, y3); + Move(_rp(obj), x2-4, y3); + Draw(_rp(obj), x2-2, y3); + if ((data->special == 2) || (data->special == 3)) + { Move(_rp(obj), x2-3, y3-1); + Draw(_rp(obj), x2-3, y3+1); + } + } + } + } + msg->flags = 0; + return(0); +} + + +IPTR mNLI_New(struct IClass *cl,Object *obj,struct opSet *msg) +{ + register struct NLIData *data; + if (!(obj = (Object *)DoSuperMethodA(cl,obj,(Msg) msg))) + return(0); + data = INST_DATA(cl,obj); + data->special = 0; + return((IPTR) obj); +} + + +IPTR mNLI_AskMinMax(struct IClass *cl,Object *obj,struct MUIP_AskMinMax *msg) +{ + DoSuperMethodA(cl,obj,(Msg) msg); + msg->MinMaxInfo->MinWidth += 8; + msg->MinMaxInfo->DefWidth += 18; /* the only width def value really used by NList object */ + msg->MinMaxInfo->MaxWidth += MUI_MAXMAX; + msg->MinMaxInfo->MinHeight += 7; /* the only height def value really used by NList object */ + msg->MinMaxInfo->DefHeight += 12; + msg->MinMaxInfo->MaxHeight += MUI_MAXMAX; + return(0); +} + + +IPTR mNLI_Set(struct IClass *cl,Object *obj,Msg msg) +{ + register struct NLIData *data = INST_DATA(cl,obj); + struct TagItem *tags,*tag; + + for(tags=((struct opSet *)msg)->ops_AttrList; (tag=(struct TagItem *)NextTagItem((APTR)&tags)); ) + { + switch (tag->ti_Tag) + { + case MUIA_NLIMG_EntryCurrent: + data->EntryCurrent = tag->ti_Data; + break; + case MUIA_NLIMG_EntryHeight: + data->EntryHeight = tag->ti_Data; + break; + case MUIA_NLIMG_Spec: + data->special = tag->ti_Data; + break; + } + } + return (0); +} + +DISPATCHER(NLI_Dispatcher) +{ + switch (msg->MethodID) + { + case OM_NEW : return ( mNLI_New(cl,obj,(APTR)msg)); + case OM_SET : return ( mNLI_Set(cl,obj,(APTR)msg)); + case MUIM_AskMinMax : return (mNLI_AskMinMax(cl,obj,(APTR)msg)); + case MUIM_Draw : return ( mNLI_Draw(cl,obj,(APTR)msg)); + } + + return(DoSuperMethodA(cl,obj,msg)); +} + + + + +struct MUI_CustomClass *NLI_Create(void) +{ + NLI_Class = MUI_CreateCustomClass(NULL, (STRPTR)MUIC_Area, NULL, sizeof(struct NLIData), ENTRY(NLI_Dispatcher)); + + return (NLI_Class); +} + + +void NLI_Delete(void) +{ + if (NLI_Class) + MUI_DeleteCustomClass(NLI_Class); + NLI_Class = NULL; +} + + diff --git a/workbench/classes/zune/nlist/demo/NList-Demo3.h b/workbench/classes/zune/nlist/demo/NList-Demo3.h new file mode 100644 index 0000000000..223eefafb8 --- /dev/null +++ b/workbench/classes/zune/nlist/demo/NList-Demo3.h @@ -0,0 +1,12 @@ + +extern struct MUI_CustomClass *NLI_Class; + +extern struct MUI_CustomClass *NLI_Create(void); +extern void NLI_Delete(void); + + +#define MUIA_NLIMG_Spec 0x9d51ffff + + +#define NImageObject NewObject(NLI_Class->mcc_Class,NULL,MUIA_FillArea,FALSE,NoFrame,End + diff --git a/workbench/classes/zune/nlist/demo/NListtree-Demo.c b/workbench/classes/zune/nlist/demo/NListtree-Demo.c new file mode 100755 index 0000000000..28b8c0fa5e --- /dev/null +++ b/workbench/classes/zune/nlist/demo/NListtree-Demo.c @@ -0,0 +1,1239 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2006 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if defined(__AROS__) +#define MUI_OBSOLETE 1 +#endif + +/* +** Includes +*/ +#include +#include +#include +#include + +#if !defined(__amigaos4__) +#include +#endif + +#include +#include + +#include +#include +#include + +#include +#include +#include + +#ifdef MYDEBUG + #define bug kprintf + #define D(x) + void kprintf( UBYTE *fmt, ... ); +#else + #define bug + #define D(x) +#endif + + +#ifndef MAKE_ID +#define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d)) +#endif + +#include "SDI_hook.h" + +#ifndef MUIA_Slider_Level +#define MUIA_Slider_Level 0x8042ae3a /* V4 isg LONG */ +#endif + +/* +** Do not use stack sizes below 8KB!! +*/ +LONG __stack = 16384; + + +/* +** MUI library base. +*/ +struct Library *MUIMasterBase = NULL; + +#if defined(__amigaos4__) +struct Library *IntuitionBase = NULL; +#else +struct IntuitionBase *IntuitionBase = NULL; +#endif + +#if defined(__amigaos4__) +struct IntuitionIFace *IIntuition = NULL; +struct MUIMasterIFace *IMUIMaster = NULL; +#endif + +struct MUI_NListtree_TreeNode *tntest; + +/* +** MUI objects. +*/ +STATIC APTR app, window,lt_nodes, + tx_info1, tx_info2, tx_info3, + sl_treecol, st_string, + bt_open, bt_close, bt_expand, bt_collapse, + bt_insert, bt_remove, bt_exchange,bt_rename, + bt_move, bt_copy, bt_moveks, bt_copyks, + bt_find, bt_parent, bt_sort, bt_getnr, + bt_redraw, bt_selected,bt_showtree,bt_seltogg, + bt_test, bt_test2, bt_test3, bt_test4; + + +/* +** Sample tree structure. +*/ +struct SampleArray +{ + const char *name; + ULONG flags; +}; + +STATIC const struct SampleArray sa[] = +{ + { "comp", TNF_LIST | TNF_OPEN }, + { "sys", TNF_LIST | TNF_OPEN }, + { "amiga", TNF_LIST | TNF_OPEN }, + { "misc", 0x8000 }, + { "mac", TNF_LIST }, + { "system", 0x8000 }, + + {"de", TNF_LIST | TNF_OPEN }, + { "comm", TNF_LIST }, + { "software", TNF_LIST }, + { "ums", 0x8000 }, + { "comp", TNF_LIST | TNF_OPEN }, + { "sys", TNF_LIST | TNF_OPEN }, + { "amiga", TNF_LIST }, + { "misc", 0x8000 }, + { "tech", 0x8000 }, + { "amiga", 0x8000 }, + + {"sort test", TNF_LIST | TNF_OPEN }, + { "a", 0 }, + { "x", TNF_LIST }, + { "v", 0 }, + { "g", TNF_LIST }, + { "h", 0 }, + { "k", TNF_LIST }, + { "u", 0 }, + { "i", TNF_LIST }, + { "t", 0 }, + { "e", TNF_LIST }, + { "q", 0 }, + { "s", TNF_LIST }, + { "c", 0 }, + { "f", TNF_LIST }, + { "p", 0 }, + { "l", TNF_LIST }, + { "z", 0 }, + { "w", TNF_LIST }, + { "b", 0 }, + { "o", TNF_LIST }, + { "d", 0 }, + { "m", TNF_LIST }, + { "r", 0 }, + { "y", TNF_LIST }, + { "n", 0 }, + { "j", TNF_LIST }, + + + {"m", TNF_LIST }, + { "i", TNF_LIST }, + { "c", TNF_LIST }, + { "h", TNF_LIST }, + { "e", TNF_LIST }, + { "l", TNF_LIST }, + { "a", TNF_LIST }, + { "n", TNF_LIST }, + { "g", TNF_LIST }, + { "e", TNF_LIST }, + { "l", TNF_LIST }, + { "o", 0 }, + + {"end", TNF_LIST }, + { "of", TNF_LIST }, + { "tree", 0 }, + + { "Sort Test 2", TNF_LIST }, + + { NULL, 0 } +}; + +/* +** This function draws the sample tree structure. +*/ +STATIC VOID DrawSampleTree( Object *ltobj ) +{ + struct MUI_NListtree_TreeNode *tn1, *tn2, *tn3; + char txt[128]; + WORD i = 0, j; + + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tntest = tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn3 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn3, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn3 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn3 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn3 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + + for( j = 0; j < 26; j++ ) + { + DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + } + + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + + for( j = 0; j < 11; j++ ) + { + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + } + + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + + + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, (IPTR)sa[i].flags, MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + + for( i = 0; i < 2500; i++ ) + { + if ( i % 2 ) snprintf( txt, sizeof(txt), "Sort Entry %d", i + 1 ); + else snprintf( txt, sizeof(txt), "Entry Sort %d", i + 1 ); + + tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, txt, 0, ( i % 5 ) ? tn2 : tn1, MUIV_NListtree_Insert_PrevNode_Tail, ( i % 5 ) ? TNF_LIST : 0 ); + } + + + DoMethod( ltobj, MUIM_NListtree_InsertStruct, "This/is/a/very/long/test/for/Blafasel_InsertStruct", 0, "/", 0 ); + DoMethod( ltobj, MUIM_NListtree_InsertStruct, "This/is/another/very/long/test/for/Blafasel_InsertStruct", 0, "/", 0 ); +} + + + +static struct MUI_NListtree_TreeNode *GetParent( Object *obj, struct MUI_NListtree_TreeNode *tn ) +{ + if ( tn != NULL ) + { + return( (struct MUI_NListtree_TreeNode *)DoMethod( obj, MUIM_NListtree_GetEntry, MUIV_NListtree_GetEntry_ListNode_Root, MUIV_NListtree_GetEntry_Position_Parent, 0 ) ); + } + + return( NULL ); +} + + +static struct MUI_NListtree_TreeNode *GetParentNotRoot( Object *obj, struct MUI_NListtree_TreeNode *tn ) +{ + if((tn = GetParent( obj, tn))) + { + if ( GetParent( obj, tn ) ) + { + return( tn ); + } + } + + return( NULL ); +} + + +struct MUI_NListtree_TreeNode *IsXChildOfY( Object *obj, struct MUI_NListtree_TreeNode *x, struct MUI_NListtree_TreeNode *y ) +{ + do + { + if ( y == x ) + { + return( y ); + } + } + while((y = GetParentNotRoot( obj, y))); + + return( NULL ); +} + + + +/* +** Allocates memory for each entry we create. +*/ +HOOKPROTONHNO(confunc, SIPTR, struct MUIP_NListtree_ConstructMessage *msg) +{ + struct SampleArray *sa; + + /* + ** Allocate needed piece of memory for the new entry. + */ + if((sa = (struct SampleArray *)AllocVec( sizeof( struct SampleArray) + strlen( msg->Name ) + 1, MEMF_CLEAR))) + { + /* + ** Save the user data field right after the + ** array structure. + */ + strcpy( (STRPTR)&sa[1], msg->Name ); + sa->name = (STRPTR)&sa[1]; + + sa->flags = (IPTR)msg->UserData; + } + + return( (SIPTR)sa ); +} +MakeStaticHook(conhook, confunc); + + +/* +** Free memory we just allocated above. +*/ +HOOKPROTONHNO(desfunc, LONG, struct MUIP_NListtree_DestructMessage *msg) +{ + if ( msg->UserData != NULL ) + { + FreeVec( msg->UserData ); + msg->UserData = NULL; + } + + return( 0 ); +} +MakeStaticHook(deshook, desfunc); + + +/* +** Compare hook function. +*/ +HOOKPROTONHNO(compfunc, LONG, struct MUIP_NListtree_CompareMessage *msg) +{ + return( stricmp( msg->TreeNode1->tn_Name, msg->TreeNode2->tn_Name ) ); +} +MakeStaticHook(comphook, compfunc); + + +/* +** MultiTest hook function. +*/ +HOOKPROTONHNO(mtfunc, LONG, struct MUIP_NListtree_MultiTestMessage *msg) +{ + if ( msg->TreeNode->tn_Flags & TNF_LIST ) + return( FALSE ); + + return( TRUE ); +} +MakeStaticHook(mthook, mtfunc); + + +/* +** Format the entry data for displaying. +*/ +HOOKPROTONHNO(dspfunc, LONG, struct MUIP_NListtree_DisplayMessage *msg) +{ + STATIC CONST_STRPTR t1 = "Newsgroups", t2 = "Flags", t3 = "subscribed", t4 = "\0", t5 = "Count"; + STATIC char buf[10]; + + if ( msg->TreeNode != NULL ) + { + /* + ** The user data is a pointer to a SampleArray struct. + */ + struct SampleArray *a = (struct SampleArray *)msg->TreeNode->tn_User; + + snprintf( buf, sizeof(buf), "%3d", (unsigned int)(IPTR)msg->Array[-1] ); + + *msg->Array++ = msg->TreeNode->tn_Name; + *msg->Array++ = (STRPTR)(( a->flags & 0x8000 ) ? t3 : t4); + *msg->Array++ = buf; + } + else + { + *msg->Array++ = (STRPTR)t1; + *msg->Array++ = (STRPTR)t2; + *msg->Array++ = (STRPTR)t5; + + *msg->Preparse++ = (STRPTR)"\033b\033u"; + *msg->Preparse++ = (STRPTR)"\033b\033u"; + *msg->Preparse++ = (STRPTR)"\033b\033u"; + } + + return( 0 ); +} +MakeStaticHook(dsphook, dspfunc); + + +/* +** Insert a new entry which name is given in +** the string gadget. +*/ +HOOKPROTONHNP(insertfunc, LONG, Object *obj) +{ + STRPTR x = NULL; + + /* + ** Get user string. + */ + get( st_string, MUIA_String_Contents, &x ); + + /* + ** Insert the new entry after + ** the active entry. + */ + DoMethod( obj, MUIM_NListtree_Insert, x, 0, MUIV_NListtree_Insert_ListNode_Active, + MUIV_NListtree_Insert_PrevNode_Active, MUIV_NListtree_Insert_Flag_Active ); + + return( 0 ); +} +MakeStaticHook(inserthook, insertfunc); + + +/* +** Exchange two entries. +*/ +HOOKPROTONH(exchangefunc, LONG, Object *obj, ULONG **para) +{ + STATIC struct MUI_NListtree_TreeNode *tn1, *tn2; + STATIC LONG exchcnt = 0; + + if ( ( exchcnt == 0 ) && ( (IPTR)*para == 42 ) ) + { + get( obj, MUIA_NListtree_Active, &tn1 ); + + if ( tn1 != MUIV_NListtree_Active_Off ) + { + nnset( tx_info3, MUIA_Text_Contents, "Select entry to exchange selected entry with." ); + + exchcnt++; + } + } + + else if ( exchcnt == 1 ) + { + get( obj, MUIA_NListtree_Active, &tn2 ); + + if ( ( tn2 != MUIV_NListtree_Active_Off ) && ( tn1 != tn2 ) ) + { + if ( !IsXChildOfY( obj, tn1, tn2 ) && !IsXChildOfY( obj, tn1, tn2 ) ) + { + struct MUI_NListtree_ListNode *ln1; + + if((ln1 = (struct MUI_NListtree_ListNode *)DoMethod( obj, MUIM_NListtree_GetEntry, tn1, MUIV_NListtree_GetEntry_Position_Parent, 0))) + { + DoMethod( obj, MUIM_NListtree_Exchange, ln1, tn1, MUIV_NListtree_Exchange_ListNode2_Active, MUIV_NListtree_Exchange_TreeNode2_Active, 0 ); + + nnset( tx_info3, MUIA_Text_Contents, "Entries successfully exchanged!" ); + } + else + nnset( tx_info3, MUIA_Text_Contents, "Something went wrong! Try again to select." ); + } + else + nnset( tx_info3, MUIA_Text_Contents, "You can not exchange with childs!" ); + } + else + nnset( tx_info3, MUIA_Text_Contents, "You should not exchange an entry with itself!" ); + + exchcnt = 0; + } + + return( 0 ); +} +MakeStaticHook(exchangehook, exchangefunc); + + +/* +** Rename the selected entry with the name is given in +** the string gadget. +*/ +HOOKPROTONHNP(renamefunc, LONG, Object *obj) +{ + struct MUI_NListtree_TreeNode *tn = NULL; + STRPTR x = NULL; + + /* + ** Get user string. + */ + get( st_string, MUIA_String_Contents, &x ); + get( obj, MUIA_NListtree_Active, &tn ); + + /* + ** Insert the new entry sorted (compare hook) + ** into the active list node. + */ + DoMethod( obj, MUIM_NListtree_Rename, tn, + x, 0 ); + + return( 0 ); +} +MakeStaticHook(renamehook, renamefunc); + + +/* +** Insert a new entry which name is given in +** the string gadget. +*/ +HOOKPROTONH(movefunc, LONG, Object *obj, ULONG **para) +{ + STATIC struct MUI_NListtree_TreeNode *tn1, *tn2; + STATIC LONG movecnt = 0; + + if ( ( movecnt == 0 ) && ( (IPTR)*para == 42 ) ) + { + get( obj, MUIA_NListtree_Active, &tn1 ); + + if ( tn1 != MUIV_NListtree_Active_Off ) + { + nnset( tx_info3, MUIA_Text_Contents, "Select entry to insert after by simple click." ); + + movecnt++; + } + } + + else if ( movecnt == 1 ) + { + get( obj, MUIA_NListtree_Active, &tn2 ); + + if ( ( tn2 != MUIV_NListtree_Active_Off ) && ( tn1 != tn2 ) ) + { + if ( !IsXChildOfY( obj, tn1, tn2 ) && !IsXChildOfY( obj, tn1, tn2 ) ) + { + struct MUI_NListtree_ListNode *ln1; + + if((ln1 = (struct MUI_NListtree_ListNode *)DoMethod( obj, MUIM_NListtree_GetEntry, tn1, MUIV_NListtree_GetEntry_Position_Parent, 0))) + { + DoMethod( obj, MUIM_NListtree_Move, ln1, tn1, MUIV_NListtree_Move_NewListNode_Active, tn2, 0 ); + + nnset( tx_info3, MUIA_Text_Contents, "Entry successfully moved!" ); + } + else + nnset( tx_info3, MUIA_Text_Contents, "Something went wrong! Try again to select destination." ); + } + else + nnset( tx_info3, MUIA_Text_Contents, "You can not move childs!" ); + } + else + nnset( tx_info3, MUIA_Text_Contents, "You should not move an entry to itself!" ); + + movecnt = 0; + } + + return( 0 ); +} +MakeStaticHook(movehook, movefunc); + + +/* +** Insert a new entry which name is given in +** the string gadget. +*/ +HOOKPROTONH(copyfunc, LONG, Object *obj, ULONG **para) +{ + STATIC struct MUI_NListtree_TreeNode *tn1, *tn2; + STATIC LONG copycnt = 0; + + if ( ( copycnt == 0 ) && ( (IPTR)*para == 42 ) ) + { + get( obj, MUIA_NListtree_Active, &tn1 ); + + if ( tn1 != MUIV_NListtree_Active_Off ) + { + nnset( tx_info3, MUIA_Text_Contents, "Select entry to insert after by simple click." ); + + copycnt++; + } + } + + else if ( copycnt == 1 ) + { + get( obj, MUIA_NListtree_Active, &tn2 ); + + if ( ( tn2 != MUIV_NListtree_Active_Off ) && ( tn1 != tn2 ) ) + { + struct MUI_NListtree_ListNode *ln1; + + if((ln1 = (struct MUI_NListtree_ListNode *)DoMethod( obj, MUIM_NListtree_GetEntry, tn1, MUIV_NListtree_GetEntry_Position_Parent, 0))) + { + DoMethod( obj, MUIM_NListtree_Copy, ln1, tn1, MUIV_NListtree_Copy_DestListNode_Active, tn2, 0 ); + + nnset( tx_info3, MUIA_Text_Contents, "Entry successfully copied!" ); + } + else + nnset( tx_info3, MUIA_Text_Contents, "Something went wrong! Try again to select destination." ); + } + else + nnset( tx_info3, MUIA_Text_Contents, "You should not copy an entry to itself!" ); + + copycnt = 0; + } + + return( 0 ); +} +MakeStaticHook(copyhook, copyfunc); + + +/* +** Move KeepStructure +*/ +HOOKPROTONH(moveksfunc, LONG, Object *obj, ULONG **para) +{ + STATIC struct MUI_NListtree_TreeNode *tn1, *tn2; + STATIC LONG movekscnt = 0; + + if ( ( movekscnt == 0 ) && ( (IPTR)*para == 42 ) ) + { + get( obj, MUIA_NListtree_Active, &tn1 ); + + if ( tn1 != MUIV_NListtree_Active_Off ) + { + nnset( tx_info3, MUIA_Text_Contents, "Select entry to make KeepStructure move with." ); + + movekscnt++; + } + } + + else if ( movekscnt == 1 ) + { + get( obj, MUIA_NListtree_Active, &tn2 ); + + if ( ( tn2 != MUIV_NListtree_Active_Off ) && ( tn1 != tn2 ) ) + { + struct MUI_NListtree_ListNode *ln1; + + if((ln1 = (struct MUI_NListtree_ListNode *)DoMethod( obj, MUIM_NListtree_GetEntry, tn1, MUIV_NListtree_GetEntry_Position_Parent, 0))) + { + DoMethod( obj, MUIM_NListtree_Move, ln1, tn1, MUIV_NListtree_Move_NewListNode_Active, tn2, MUIV_NListtree_Move_Flag_KeepStructure ); + + nnset( tx_info3, MUIA_Text_Contents, "Entry successfully moved (structure keeped)" ); + } + else + nnset( tx_info3, MUIA_Text_Contents, "Something went wrong! Try again to select destination." ); + } + else + nnset( tx_info3, MUIA_Text_Contents, "You should not move an entry to itself!" ); + + movekscnt = 0; + } + + return( 0 ); +} +MakeStaticHook(movekshook, moveksfunc); + +/* +** Copy KeepStructure +*/ +HOOKPROTONH(copyksfunc, LONG, Object *obj, ULONG **para) +{ + STATIC struct MUI_NListtree_TreeNode *tn1, *tn2; + STATIC LONG copykscnt = 0; + + if ( ( copykscnt == 0 ) && ( (IPTR)*para == 42 ) ) + { + get( obj, MUIA_NListtree_Active, &tn1 ); + + if ( tn1 != MUIV_NListtree_Active_Off ) + { + nnset( tx_info3, MUIA_Text_Contents, "Select entry to make KeepStructure copy with." ); + + copykscnt++; + } + } + + else if ( copykscnt == 1 ) + { + get( obj, MUIA_NListtree_Active, &tn2 ); + + if ( ( tn2 != MUIV_NListtree_Active_Off ) && ( tn1 != tn2 ) ) + { + struct MUI_NListtree_ListNode *ln1; + + if((ln1 = (struct MUI_NListtree_ListNode *)DoMethod( obj, MUIM_NListtree_GetEntry, tn1, MUIV_NListtree_GetEntry_Position_Parent, 0))) + { + DoMethod( obj, MUIM_NListtree_Copy, ln1, tn1, MUIV_NListtree_Copy_DestListNode_Active, tn2, MUIV_NListtree_Copy_Flag_KeepStructure ); + + nnset( tx_info3, MUIA_Text_Contents, "Entry successfully copied (structure keeped)" ); + } + else + nnset( tx_info3, MUIA_Text_Contents, "Something went wrong! Try again to select destination." ); + } + else + nnset( tx_info3, MUIA_Text_Contents, "You should not copy an entry to itself!" ); + + copykscnt = 0; + } + + return( 0 ); +} +MakeStaticHook(copykshook, copyksfunc); + + +HOOKPROTONHNO(fudf, LONG, struct MUIP_NListtree_FindUserDataMessage *msg) +{ + nnset( tx_info1, MUIA_Text_Contents, "FindUserData Hook passed!" ); + return( strncmp( (STRPTR)msg->User, (STRPTR)msg->UserData, strlen( (STRPTR)msg->User ) ) ); +} +MakeStaticHook(fudh, fudf); + +/* +** Find the specified tree node by name. +*/ +HOOKPROTONHNP(findnamefunc, LONG, Object *obj) +{ + struct MUI_NListtree_TreeNode *tn; + STRPTR x = NULL; + + /* + ** Let us see, which string the user wants to search for... + */ + get( st_string, MUIA_String_Contents, &x ); + + /* + ** Is it somewhere in the tree? + */ + if((tn = (struct MUI_NListtree_TreeNode *)DoMethod(obj, MUIM_NListtree_FindUserData, MUIV_NListtree_FindUserData_ListNode_Root, x, MUIV_NListtree_FindUserData_Flag_Activate))) + { + /* + ** Found! Inform the user. + */ + nnset( tx_info3, MUIA_Text_Contents, "Found your node!" ); + } + else + { + /* + ** Not found. Inform the user. + */ + nnset( tx_info3, MUIA_Text_Contents, "NOT found specified node!" ); + } + + return( 0 ); +} +MakeStaticHook(findnamehook, findnamefunc); + + +/* +** Sort the active list. +*/ +HOOKPROTONHNP(sortfunc, LONG, Object *obj) +{ + clock_t start, end; + LONG lastactive = 0; + + get( obj, MUIA_NListtree_Active, &lastactive ); + set( obj, MUIA_NListtree_Active, MUIV_NListtree_Active_Off ); + + start = clock(); + DoMethod( obj, MUIM_NListtree_Sort, lastactive, 0 ); + end = clock(); + + set( obj, MUIA_NListtree_Active, lastactive ); + + DoMethod( tx_info3, MUIM_SetAsString, MUIA_Text_Contents, "Sort took %ld.%03lds", ( end - start ) / CLOCKS_PER_SEC, ( end - start ) % CLOCKS_PER_SEC ); + + return( 0 ); +} +MakeStaticHook(sorthook, sortfunc); + + +/* +** Find the specified tree node by name. +*/ +HOOKPROTONHNP(getnrfunc, LONG, Object *obj) +{ + LONG temp, temp2; + + temp = DoMethod( obj, MUIM_NListtree_GetNr, + MUIV_NListtree_GetNr_TreeNode_Active, MUIV_NListtree_GetNr_Flag_CountLevel ); + + if ( temp == 1 ) + DoMethod( tx_info1, MUIM_SetAsString, MUIA_Text_Contents, "1 entry in parent node." ); + else + DoMethod( tx_info1, MUIM_SetAsString, MUIA_Text_Contents, "%ld entries in parent node.", temp ); + + + temp = DoMethod( obj, MUIM_NListtree_GetNr, + MUIV_NListtree_GetNr_TreeNode_Active, MUIV_NListtree_GetNr_Flag_CountAll ); + + if ( temp == 1 ) + DoMethod( tx_info2, MUIM_SetAsString, MUIA_Text_Contents, "1 entry total." ); + else + DoMethod( tx_info2, MUIM_SetAsString, MUIA_Text_Contents, "%ld entries total.", temp ); + + + temp = DoMethod( obj, MUIM_NListtree_GetNr, + MUIV_NListtree_GetNr_TreeNode_Active, 0 ); + + temp2 = DoMethod( obj, MUIM_NListtree_GetNr, + MUIV_NListtree_GetNr_TreeNode_Active, MUIV_NListtree_GetNr_Flag_Visible ); + + DoMethod( tx_info3, MUIM_SetAsString, MUIA_Text_Contents, "Active entry pos: %ld (visible: %ld).", temp, temp2 ); + + return( 0 ); +} +MakeStaticHook(getnrhook, getnrfunc); + +/* +** Find the specified tree node by name. +*/ +HOOKPROTONHNP(numselfunc, LONG, Object *obj) +{ + LONG temp = 0; + + DoMethod( obj, MUIM_NListtree_Select, MUIV_NListtree_Select_All, + MUIV_NListtree_Select_Ask, 0, &temp ); + + if ( temp == 1 ) + DoMethod( tx_info1, MUIM_SetAsString, MUIA_Text_Contents, "1 node selected." ); + else + DoMethod( tx_info1, MUIM_SetAsString, MUIA_Text_Contents, "%ld nodes selected.", temp ); + + { + struct MUI_NListtree_TreeNode *tn; + + tn = (struct MUI_NListtree_TreeNode *)MUIV_NListtree_NextSelected_Start; + + for (;;) + { + DoMethod( obj, MUIM_NListtree_NextSelected, &tn ); + + if ( (IPTR)tn == (IPTR)MUIV_NListtree_NextSelected_End ) + break; + + D(bug( "Next TreeNode: 0x%08lx - %s\n", tn, tn->tn_Name ) ); + } + + D(bug( "\n" ) ); + + tn = (struct MUI_NListtree_TreeNode *)MUIV_NListtree_PrevSelected_Start; + + for (;;) + { + DoMethod( obj, MUIM_NListtree_PrevSelected, &tn ); + + if ( (IPTR)tn == (IPTR)MUIV_NListtree_PrevSelected_End ) + break; + + D(bug( "Prev TreeNode: 0x%08lx - %s\n", tn, tn->tn_Name ) ); + } + } + + return( 0 ); +} +MakeStaticHook(numselhook, numselfunc); + +/* +** Test func +*/ +HOOKPROTONHNP(testfunc, LONG, Object *obj) +{ + SIPTR id; + ULONG num; + + id = MUIV_NListtree_NextSelected_Start; + + for(;;) + { + DoMethod( obj, MUIM_NListtree_NextSelected, &id ); + + if(id == (SIPTR)MUIV_NListtree_NextSelected_End ) + break; + + //GetAttr( MUIA_List_Entries, obj, &num ); + + num = DoMethod( obj, MUIM_NListtree_GetNr, + MUIV_NListtree_GetNr_TreeNode_Active, MUIV_NListtree_GetNr_Flag_CountAll ); + + if ( num > 1 ) + DoMethod( obj, MUIM_NListtree_Remove, MUIV_NListtree_Remove_ListNode_Active, id, 0 ); + else + break; + } + + return( 0 ); +} +MakeStaticHook(testhook, testfunc); + + +#if defined(__amigaos4__) +#define GETINTERFACE(iface, base) (iface = (APTR)GetInterface((struct Library *)(base), "main", 1L, NULL)) +#define DROPINTERFACE(iface) (DropInterface((struct Interface *)iface), iface = NULL) +#else +#define GETINTERFACE(iface, base) TRUE +#define DROPINTERFACE(iface) +#endif + +/* +** Main +*/ +int main(UNUSED int argc, UNUSED char *argv[]) +{ + ULONG signals; + static const char *const UsedClasses[] = { + "NList.mcc", + "NListtree.mcc", + "NListviews.mcc", + NULL + }; + + /* + ** Is MUI V19 available? + */ + if((IntuitionBase = (APTR)OpenLibrary("intuition.library", 36)) && + GETINTERFACE(IIntuition, IntuitionBase)) + if((MUIMasterBase = OpenLibrary("muimaster.library", 19)) && + GETINTERFACE(IMUIMaster, MUIMasterBase)) + { + /* + ** Create application object. + */ + app = ApplicationObject, + MUIA_Application_Title, "NListtree-Demo", + MUIA_Application_Version, "$VER: NListtree-Demo 1.0 (" __DATE__ ")", + MUIA_Application_Copyright, "Copyright (C) 2001-2006 by NList Open Source Team", + MUIA_Application_Author, "NList Open Source Team", + MUIA_Application_Description, "Demonstration program for MUI class NListtree.mcc", + MUIA_Application_Base, "NLISTTREEDEMO", + MUIA_Application_UsedClasses, UsedClasses, + + /* + ** Build the window. + */ + SubWindow, window = WindowObject, + MUIA_Window_Title, "NListtree-Demo", + MUIA_Window_ID, MAKE_ID( 'N', 'L', 'T', 'R' ), + MUIA_Window_AppWindow, TRUE, + WindowContents, VGroup, + + /* + ** Create a NListview embedded NListtree object + */ + Child, NListviewObject, + MUIA_ShortHelp, "The NListtree object...", + MUIA_NListview_NList, lt_nodes = NListtreeObject, + InputListFrame, + MUIA_CycleChain, TRUE, + MUIA_NList_MinLineHeight, 18, + MUIA_NListtree_MultiSelect, MUIV_NListtree_MultiSelect_Shifted, + MUIA_NListtree_MultiTestHook, &mthook, + MUIA_NListtree_DisplayHook, &dsphook, + MUIA_NListtree_ConstructHook, &conhook, + MUIA_NListtree_DestructHook, &deshook, /* This is the same as MUIV_NListtree_CompareHook_LeavesMixed. */ + MUIA_NListtree_CompareHook, &comphook, + MUIA_NListtree_DoubleClick, MUIV_NListtree_DoubleClick_Tree, + MUIA_NListtree_EmptyNodes, FALSE, + MUIA_NListtree_TreeColumn, 0, + MUIA_NListtree_DragDropSort, TRUE, + MUIA_NListtree_Title, TRUE, + MUIA_NListtree_Format, ",,", + MUIA_NListtree_FindUserDataHook,&fudh, + //MUIA_NListtree_NoRootTree, TRUE, + End, + End, + + /* + ** Build some controls. + */ + Child, tx_info1 = TextObject, + MUIA_Background, MUII_TextBack, + TextFrame, + End, + + Child, tx_info2 = TextObject, + MUIA_Background, MUII_TextBack, + TextFrame, + End, + + Child, tx_info3 = TextObject, + MUIA_Background, MUII_TextBack, + TextFrame, + End, + + Child, ColGroup( 2 ), + Child, FreeKeyLabel( "TreeCol:", 'c' ), + Child, sl_treecol = Slider( 0, 2, 0 ), + End, + + Child, HGroup, + Child, st_string = StringObject, + StringFrame, + MUIA_String_MaxLen, 50, + End, + End, + + + Child, ColGroup( 4 ), + Child, bt_open = KeyButton( "Open", 'o' ), + Child, bt_close = KeyButton( "Close", 'c' ), + Child, bt_expand = KeyButton( "Expand", 'e' ), + Child, bt_collapse = KeyButton( "Collapse", 'a' ), + + Child, bt_insert = KeyButton( "Insert", 'i' ), + Child, bt_remove = KeyButton( "Remove", 'r' ), + Child, bt_exchange = KeyButton( "Exchange", 'x' ), + Child, bt_rename = KeyButton( "Rename", 'r' ), + + Child, bt_move = KeyButton( "Move", 'm' ), + Child, bt_copy = KeyButton( "Copy", 'y' ), + Child, bt_moveks = KeyButton( "Move KS", 'v' ), + Child, bt_copyks = KeyButton( "Copy KS", 'k' ), + + Child, bt_find = KeyButton( "FindName", 'f' ), + Child, bt_parent = KeyButton( "Parent", 'p' ), + Child, bt_sort = KeyButton( "Sort", 's' ), + Child, bt_getnr = KeyButton( "GetNr", 'n' ), + + Child, bt_redraw = KeyButton( "Redraw", 'w' ), + Child, bt_selected = KeyButton( "Selected", 'd' ), + Child, bt_seltogg = KeyButton( "Sel Togg", 't' ), + Child, bt_showtree = KeyButton( "Show tree", 'h' ), + + Child, bt_test = KeyButton( "Test", ' ' ), + Child, bt_test2 = KeyButton( "Test2", ' ' ), + Child, bt_test3 = KeyButton( "Test3", ' ' ), + Child, bt_test4 = KeyButton( "Test4", ' ' ), + End, + + End, + + End, + End; + + + if( app ) + { + /* + ** generate notifications + */ + DoMethod( window, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, + app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit); + + /* + ** open/close/expand/collapse + */ + DoMethod( bt_open, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 4, MUIM_NListtree_Open, MUIV_NListtree_Open_ListNode_Active, MUIV_NListtree_Open_TreeNode_Active, 0 ); + + DoMethod( bt_close, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 4, MUIM_NListtree_Close, MUIV_NListtree_Close_ListNode_Active, MUIV_NListtree_Close_TreeNode_Active, 0 ); + + DoMethod( bt_expand, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 4, MUIM_NListtree_Open, MUIV_NListtree_Open_ListNode_Root, MUIV_NListtree_Open_TreeNode_All, 0 ); + + DoMethod( bt_collapse, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 4, MUIM_NListtree_Close, MUIV_NListtree_Close_ListNode_Root, MUIV_NListtree_Close_TreeNode_All, 0 ); + + + + /* + ** insert/remove/exchange/rename + */ + DoMethod( bt_insert, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 2, MUIM_CallHook, &inserthook ); + + DoMethod( bt_remove, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 4, MUIM_NListtree_Remove, MUIV_NListtree_Remove_ListNode_Root, MUIV_NListtree_Remove_TreeNode_Selected, 0 ); + + DoMethod( bt_exchange, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 3, MUIM_CallHook, &exchangehook, 42 ); + + DoMethod( lt_nodes, MUIM_Notify, MUIA_NListtree_Active, MUIV_EveryTime, + lt_nodes, 3, MUIM_CallHook, &exchangehook, 0 ); + + DoMethod( bt_rename, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 2, MUIM_CallHook, &renamehook ); + + + /* + ** move/copy/moveks/copyks + */ + DoMethod( bt_move, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 3, MUIM_CallHook, &movehook, 42 ); + + DoMethod( lt_nodes, MUIM_Notify, MUIA_NListtree_Active, MUIV_EveryTime, + lt_nodes, 3, MUIM_CallHook, &movehook, 0 ); + + DoMethod( bt_copy, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 3, MUIM_CallHook, ©hook, 42 ); + + DoMethod( lt_nodes, MUIM_Notify, MUIA_NListtree_Active, MUIV_EveryTime, + lt_nodes, 3, MUIM_CallHook, ©hook, 0 ); + + DoMethod( bt_moveks, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 3, MUIM_CallHook, &movekshook, 42 ); + + DoMethod( lt_nodes, MUIM_Notify, MUIA_NListtree_Active, MUIV_EveryTime, + lt_nodes, 3, MUIM_CallHook, &movekshook, 0 ); + + DoMethod( bt_copyks, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 3, MUIM_CallHook, ©kshook, 42 ); + + DoMethod( lt_nodes, MUIM_Notify, MUIA_NListtree_Active, MUIV_EveryTime, + lt_nodes, 3, MUIM_CallHook, ©kshook, 0 ); + + + /* + ** find/parent/sort/getnr + */ + DoMethod( bt_find, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 2, MUIM_CallHook, &findnamehook ); + + DoMethod( bt_parent, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 3, MUIM_Set, MUIA_NListtree_Active, MUIV_NListtree_Active_Parent ); + + DoMethod( bt_sort, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 2, MUIM_CallHook, &sorthook ); + + /* + DoMethod( bt_sort, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 3, MUIM_NListtree_Sort, MUIV_NListtree_Sort_TreeNode_Active, 0 ); + */ + + DoMethod( bt_getnr, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 2, MUIM_CallHook, &getnrhook ); + + + /* + ** redraw/selected/seltogg/showtree + */ + DoMethod( bt_redraw, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 3, MUIM_NListtree_Redraw, MUIV_NListtree_Redraw_All ); + + DoMethod( bt_selected, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 2, MUIM_CallHook, &numselhook ); + + DoMethod( bt_seltogg, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 5, MUIM_NListtree_Select, MUIV_NListtree_Select_All, MUIV_NListtree_Select_Toggle, 0, NULL ); + + DoMethod( bt_showtree, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 3, MUIM_Set, MUIA_NListtree_ShowTree, MUIV_NListtree_ShowTree_Toggle ); + + + /* + ** misc + */ + DoMethod( sl_treecol, MUIM_Notify, MUIA_Slider_Level, MUIV_EveryTime, + lt_nodes, 3, MUIM_Set, MUIA_NListtree_TreeColumn, MUIV_TriggerValue ); + + DoMethod( lt_nodes, MUIM_Notify, MUIA_NListtree_Active, MUIV_EveryTime, + tx_info1, 4, MUIM_SetAsString, MUIA_Text_Contents, "Active node: 0x%08lx", MUIV_TriggerValue ); + + DoMethod( lt_nodes, MUIM_Notify, MUIA_NListtree_ActiveList, MUIV_EveryTime, + tx_info2, 4, MUIM_SetAsString, MUIA_Text_Contents, "Active list: 0x%08lx", MUIV_TriggerValue ); + + DoMethod( lt_nodes, MUIM_Notify, MUIA_NListtree_DoubleClick, MUIV_EveryTime, + tx_info3, 4, MUIM_SetAsString, MUIA_Text_Contents, "Double clicked on node: 0x%08lx", MUIV_TriggerValue ); + + DoMethod( lt_nodes, MUIM_Notify, MUIA_NListtree_SelectChange, TRUE, + tx_info3, 3, MUIM_SetAsString, MUIA_Text_Contents, "Selection state changed" ); + + + /* + ** test + */ + DoMethod( bt_test, MUIM_Notify, MUIA_Pressed, FALSE, + lt_nodes, 2, MUIM_CallHook, &testhook ); + + + + /* + ** Open the window. + ** + */ + set( window, MUIA_Window_Open, TRUE ); + + + /* + ** Set the tree into quiet state. + */ + set( lt_nodes, MUIA_NListtree_Quiet, TRUE ); + + + /* + ** Insert sample nodes. + */ + DrawSampleTree( lt_nodes ); + + + /* + ** Set the tree back to normal state. + */ + set( lt_nodes, MUIA_NListtree_Quiet, FALSE ); + + /* + ** Minimal input loop. + */ + while((LONG)DoMethod( app, MUIM_Application_NewInput, &signals ) != (LONG)MUIV_Application_ReturnID_Quit ) + { + if ( signals ) + { + signals = Wait( signals | SIGBREAKF_CTRL_C ); + + if ( signals & SIGBREAKF_CTRL_C ) + break; + } + } + + /* + ** Clear the list. + */ + DoMethod( lt_nodes, MUIM_NListtree_Clear, NULL, 0 ); + + + /* + ** Close the window. + */ + set( window, MUIA_Window_Open, FALSE ); + + + /* + ** Shutdown + */ + MUI_DisposeObject( app ); + } + else + printf( "Failed to create Application.\n" ); + } + + if(MUIMasterBase) + { + DROPINTERFACE(IMUIMaster); + CloseLibrary(MUIMasterBase); + } + + if(IntuitionBase) + { + DROPINTERFACE(IIntuition); + CloseLibrary((struct Library *)IntuitionBase); + } + + return( 0 ); +} + + diff --git a/workbench/classes/zune/nlist/demo/mmakefile.src b/workbench/classes/zune/nlist/demo/mmakefile.src new file mode 100644 index 0000000000..0524528006 --- /dev/null +++ b/workbench/classes/zune/nlist/demo/mmakefile.src @@ -0,0 +1,43 @@ +# $Id$ + +include $(TOP)/config/make.cfg + +FILES := NList-Demo \ + NList-Demo2 \ + NList-Demo3 + +EXEDIR := $(CONTRIBDIR)/Zune/MCC_NList/Demos + +USER_INCLUDES := -idirafter $(SRCDIR)/$(CURDIR)/../include +USER_CFLAGS := -DNO_INLINE_STDARG +USER_CFLAGS += $(PARANOIA_CFLAGS) + +#MM contrib-zune-classes-nlist-demo : includes linklibs \ +#MM contrib-zune-classes-nlist \ +#MM contrib-zune-classes-nlistview \ +#MM contrib-zune-classes-nfloattext + +#MM contrib-zune-classes-nlisttree-demo : includes linklibs \ +#MM contrib-zune-classes-nlist \ +#MM contrib-zune-classes-nlistview \ +#MM contrib-zune-classes-nfloattext \ +#MM contrib-zune-classes-nlisttree + +#MM contrib-zune-classes-nbitmap-demo : includes linklibs contrib-zune-classes-nbitmap-demo-cpy + +%build_prog mmake=contrib-zune-classes-nlist-demo \ + progname=NList-Demo targetdir=$(EXEDIR) \ + files=$(FILES) uselibs="mui arossupport amiga arosc" + +%build_prog mmake=contrib-zune-classes-nlisttree-demo \ + progname=NListtree-Demo targetdir=$(EXEDIR) \ + files=NListtree-Demo uselibs="mui arossupport amiga arosc" + +%build_prog mmake=contrib-zune-classes-nbitmap-demo \ + progname=NBitmap-Demo targetdir=$(EXEDIR) \ + files=NBitmap-Demo uselibs="mui arossupport amiga arosc" + +%copy_files_q mmake=contrib-zune-classes-nbitmap-demo-cpy \ + files=icon.png src=../nbitmap_mcc dst=$(EXEDIR) + +%common diff --git a/workbench/classes/zune/nlist/demo/vastubs.c b/workbench/classes/zune/nlist/demo/vastubs.c new file mode 100644 index 0000000000..7603560d6e --- /dev/null +++ b/workbench/classes/zune/nlist/demo/vastubs.c @@ -0,0 +1,44 @@ +/*************************************************************************** + + NList classes + Copyright (C) 2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NBalance class Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if !defined(__AROS__) && (defined(__VBCC__) || defined(NO_INLINE_STDARG)) +#if defined(_M68000) || defined(__M68000) || defined(__mc68000) + +#include + +/* FIX V45 breakage... */ +#if INCLUDE_VERSION < 45 +#define MY_CONST_STRPTR CONST_STRPTR +#else +#define MY_CONST_STRPTR CONST STRPTR +#endif + +#include + +APTR NewObject( struct IClass *classPtr, CONST_STRPTR classID, Tag tag1, ... ) +{ return NewObjectA(classPtr, classID, (struct TagItem *)&tag1); } +ULONG SetAttrs( APTR object, ULONG tag1, ... ) +{ return SetAttrsA(object, (struct TagItem *)&tag1); } + +#else + #error "VARGS stubs are only save on m68k systems!" +#endif +#endif diff --git a/workbench/classes/zune/nlist/dist/MCC_NList.info b/workbench/classes/zune/nlist/dist/MCC_NList.info new file mode 100755 index 0000000000000000000000000000000000000000..663446343353b437e7b254bf5043c27d8b9552d4 GIT binary patch literal 1904 zcwV)YZEVv<7{~9Drh>JszH`P#r6zUK0h`21>@-MBqJ-F~`hmXMFcoQ~kh(80QdH!Y zPmD2Oo%j$Kuw_(KU7->|Y!eKm0h?4>v8nI@Z9-@uMym>;iI=_rrKORx=bTkzh_AcI zv7i6{_uM__yIe*%gb`~SQ672^KA8~Xlcxqvb}=Ib%_7jp2w@v~p=H69G0P#e7$FHs z*olkN8Mc+S9q3i91}(OF#s5+9?8s?(gtKm}rWe(GjQP5%2k3um&;R6`HI8rII)+eA zdpI1{4OMS%`|N5$5}xLayS$06h_3Hhla@U0r73brN_6SE@j+T4<2mE0!pEuZ(#b}> zao=E%D3H;dVM|&tl@>VHwfP+JNQo&c!_{KCCsM^XQ^gZ0j&oJK&OFfb#!UBbpyXY{ zTr#i425IJD$DQ-a=sl;I%353Z_3qujzH60@!{t@05po_)q%J242N`(6$u9^!^ zy!Z$ntFpl-l3X@q=Y{F~VGkJoP|+h)Dfrw6vY91$%7$`94-ef7R_Oe2D3^K!UP`;f zSvG`#K41mG9}bmg0o_MG(XSB z5=h8H+Yk7hYcj|22otDNqzemzyrO4L;NMveaf$*TND~_wK{v?6 zzwX>P?kB{@^G=bl+O>0I$UZ|tJRgESBt>2`iqG`%(24-?t4ht5p#_`zd_IZQ4PoyC zY;5Z1r6SRaw#0b-q9ldhmbHX_7fo*JFOrHt=CbsQ)gawQ#^##dk79OR-RGi8pL&1R|jPI@odm!TZCm+Tp6(R~!e_>Y`!jPD>HcAvHp z7neb3;TeaA;CncTsTW>1tS$Kq?SySDKd*?uHh75kGpD@X0oG{RnW{LZs;VT6qpi%^ zJx_s92?>u;9hKxK6$7d&>(#0K+XYDt{r$QV#Kffq{(d^@x(u5GI&mIXgYZHY{~YoItP1z%^=?Br>{kf zW9rq~U*>c$EtWw8wFC1ak;ZyezMO1nk6R)G=SK`x``L)JbqtE`7K_WZI4CmQ-pRNE z;*H2*IRYfqsJHK9q@4z4g1zCep~)b%fkvinK^k}h$8fl@9@cFyfIY%9n?RR$y>vF) zFkOCPGORb&rzuf*jECtFoDUZDOxm~l5dhP(Epef$vD!M0rfUD~~e1?F1LT{H}i r1nM0GIiTD|B&Y8N67WOxic@*TW|X@Eem;V^!8~fNGB21n;6LndcXLYX literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/dist/MCC_NList/AUTHORS.info b/workbench/classes/zune/nlist/dist/MCC_NList/AUTHORS.info new file mode 100755 index 0000000000000000000000000000000000000000..1e185b312eaf3f61e99ab0b943b5745ba6120eac GIT binary patch literal 2542 zcwUWFZERCz6n^j8(RGZmUYH+5>Bk+!4TP?%B8drI+A$UbbI83Vn7DS(bxf0W5n4c# zc7Vq6XGFq`&SV%ON+;oC$p+)cQ0Iu6s0kVq{jmuWjWPT?!ouSGQNp!^F&>rTXD z7Z6t=XG&42=Px6#L0;lTw4FmVQqEwvp2{xd2IPk;X@4{2JmpcuZ(gNJdipywl9)t1 zK_i0{f7I|vS)LBiUPyL0Hr+*@3OkOxeZ{b4xJBD}>?iB+6JiO3pT8~)r9yve* zB1MUTexis5)rTl5Tw>583MUNpNG?8A&}j85H5@%6s#)}ih9A}N@jOqFyk0@{i1eVc z3^{lNxhMm_okDJyfeFzg4D|>@Ju6!(Pb_{G2#N48`70t`P$eI0$a{sCNRZbnE^%_U#St z4MfQ1=IvYIi>s!|-Mnpcy}JRji>jXmB~Fjq-Rfi5Y1e6B?#)S3Th;to(sjh+biM$R_4>sqac`iBk&NpG?%d7+sF`sM zfy!Ao;M1|5bZFe;_P}1W8?kOjg_9=Tbts*s4Rg6Y^w{PTWWe`0>xo35kT%Wc)39qE zD&huwde+k%O!p2E?2>hTofA47^wfpu7G2v$EE-pO?$&YDbkq;#Vgkoum8hJZwI8nI z)a1xqEZn}^HsC8~l_{Htj2uU^-Bpc|=w;D<3B)!~7+Jhj(*C}~!NGPhs}As$1C|X6 z{8jG8`QBmCVnmM8HjvV7JqMYv&bCp>WbJLxG-IiIJ_@rtlf4sU{g6)ROOlohLA5?PQXd>AyM1sNB9q^OOI$I4ZP#f;drAIT}XD|>Bo>uB-U>^(y+fQ4efNO}P zPhF3MBM=gOzo|XEPY0-NMo$0aR zCF&sA(1cpyUlqtH7S6v^ak5iwa9ug2ofUTFuJh5{#cDxNJBZ3yS^xfap&%KZyY%FT zeY~nsZW0}SN)QT~Ly7ZO#kOLo;&VED1If1HKtSNtS=8BX2Vn8Ll##sQL-S)-#FiSh z5!Cn~Er>0pia>z;!Aia}pU?UNa7?CU_1@e-$+2%q>+tgUSycnWS#dZ%xGz4c{*i;J zv9o1-r4Q7x3!h7HAA9R?Hqhw-{5D0XATB1aX zp-aa99Nvd->Obo+hv0ue^z-yK-u?tM4waZVPkd}e@s%Uid17Vn+F7%mG2OK=_sV;w e8Nb%3L`oD-jy6o+Sq?ToMva~Tql3+*YVr@1#`sPE literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/dist/MCC_NList/COPYING.info b/workbench/classes/zune/nlist/dist/MCC_NList/COPYING.info new file mode 100755 index 0000000000000000000000000000000000000000..99ece8af9f2ba7bcefadf43666ccd220538f209b GIT binary patch literal 2542 zcwUWFe{54#6uxh5={m+(AJiX2S=%>=8wg!jMG_Obv|}s=>X7$JFmc_W>zF3%BD8=e z?EsDApAiWoI+J0DC>?|!OEwsZL!2XOq9$le^p8!DApf|LZC$%Q-t(OMUfU-c@h0!< zchC9Gx#zxpYj2klhTt-gCQ?b(kOi=3`paBo`;-b9i1Rxn)&8 zo*}DA0jhL#d%KijmiS7~l1D6k7R#<_cwECL@?49{HGHuw<@K`syM`au@X;JkJ>1PG z%i0c#vKaZqiHpFMv#NMaoE z7>)E({9ePyWqF2>Az9pmJoN`op8kQ55qa(;y@ea`&p6^mxL25z{L5|8XPBzBTqibct`xUW>@)d7UP9r?!8#0JOCJiW0!|A5RZ=qH< zwT>9$mhE=|7eDw8`Orsz8|I!M#)E#z0sNdeL5v3f$JdAv2pj~rd(=CDRkV5U8+&#~ zb_b(mqi^eG_~NRp_xQGKtnt)Bc0t9nfL#6NnmR%XRuYqrVe|ziV(wgIy;T+<%eOLB zNn&2}W1-9I@iYb)cG7(cm}g^>RF(TaO}YXR_dZjPc=%XX~S%87d_T@jPwN_XT8xV6w;=dTpD)1 zfdZ~Cpl7|lP`Z17V3&;h%dF7pq^HisHtCwzW6`M6bEl50prf9ci3=QuRibis#&NKk zQ#vCE?45{T`fFtK>4q~m?3lY{L-RvqBF6P6tc zn#w(Ov)zND)r1_S%^;=Q8V)iMoqfHM$vB#!>Abc2`54UZN_LNtwF5e#CrKL0VFDH> zu)Au6u0~9!x=)+zOD(O(XW@2lmO{$OnT4))w~qD9cMlfX?X^Nzw*&5{w&h`KW!U+u z0vy%;SZmLH!iZINI%s+8{=HMA!O|LAuiF>wES|_DBw4yGjY&tOHmO3Ymx$_?-^fDh zmaAl0n)!nH+nO!0%@O97l}UqnIL4MCHtv>tz($Cf+rpRZa+(QYU9bIY2}L83Lo{4F z+0g@=$bKc~k0p{FLNpY5-3dRrtgF$u47HKAY6itSvn< zxJVr&6CP75npOm}in;SIl^$yO+3S2bbFo4Y)DEIDR;Fohi;$NL&s=)) zgC1VhC^v}>J|zfw&4I-Et75YOs`#u9-$1h25DW^uI*U5noggfJhcc2sa$t7kir7%8 zHiDV}qy@2|ND&B--*4gDa`{Xk2*=DftlXU)C^_;qX&hYIbw<^|a5fx{5AEq1R{zMM z)X14)zHU?RXU?(^%ot=3vbCtjztA g&Pk?8Yg8g74CBMKlXsVb&5ux{C&1`nbE$&-1%d?nHUIzs literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/dist/MCC_NList/ChangeLog.info b/workbench/classes/zune/nlist/dist/MCC_NList/ChangeLog.info new file mode 100755 index 0000000000000000000000000000000000000000..88abb58ef9dfd36f2fbadf33c57d9ebf8e8580cc GIT binary patch literal 2542 zcwUWFZERCz6n^j8(shinUYH+5>Bk+!4TP?%B8drI+HEWfb;!LXn7D4xbxf0O5n4c# zc7Vq6XGCO1XEF>CrIYZnWP|ZzsB=V3)C7%*{@4Tw^2d#A>)Q2lujjn?w!NYe-{d}h z-gBOF-t*o)Yj2hkhTt-gW>QJkkwvg)2F`vX;X^ZRQtV~CsJiOSix^#7JD%PD-t`n8DW?Ua9pXxo8! z^gQA!88SQVOoTogB_|;2PNl$;1MiLW< z$7y7M;`bUpA7OHRqB2 zG$2xx80aU8Xi$A8MTJWYdPL!bp&rS`C-WMuex-(^M?^J?9?|e48a|feDU#DGh#ryd zR~91&k02Li;I~r9jngn8dW4}KVW_7W>Jhlze|Uu6UDnAcf&*b8&dbIanlz6(EzbNS zqToG>QXZEn@qWZL6NuFm*U?t<5sSu@p1X8h1s(Oh*_gm_SS2cFXB>yB zIW;*v8wpN4%X6ly(Xg95HL zl0JDY5{^Jf4E&<@@IM}+l5kcu)A<$#@`_L)o)YclvRx7hXhM(4Xhjf+4zWU36>U$C z4lPj!$#jmZ70s)HS;hRh=Sokss|~Ixr?j%d&g^wQn7vRT2xA3iuYdRc6& zR2xA}0MdfkSfmI9$R8-<+jIF$APC1SG_Ky09Vj{aHE9}J9zUaMU^p8N$A|XDN7O%Z zC^dSfn6Ka5_o>rzUJtJ#ybJ_E!5ber4le0}vW|hwv7dPV+kFF0%Q2LUFA{>mj*knK zhyl7RG(Uy+;T!tSI4zyq^fvy!1T^j}G;`kg=nBK-!?rnMWA8Xvi-R%Wu`+i{ gx~G_Ctx<`TFiecpPTgJ(Ha|*@o&ckR&7}(R7jZ}VxBvhE literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/dist/MCC_NList/Demos.info b/workbench/classes/zune/nlist/dist/MCC_NList/Demos.info new file mode 100755 index 0000000000000000000000000000000000000000..bb7b357225b93853fd24800c0bb37db55c2cb476 GIT binary patch literal 1255 zcwUv1Pe>F|9LK*iy4$Xz`;zwJr7>AbY27Xb6*A+WBoAhUqY=?R5h`L0F;G10Ll0fM zcy5ahGO`5;9W))yQ&C|D_Y&l45O|POa#1O#-+MD_SX%Uhx4-wD_j|wJd%yY2er8Z0 ztOyaDL>PY3%5dtozPb+({MwH59@Rm=Y^&oAwh z=WN0MSw2FtpDhT9ep*iulKmtgWIxvtvRBIrA2ImmJ}&h}*HQd+G1?Q=;F}39m8QNS zlnJEzQuXjn2A29#Z&A!qUN}PWvY$s$kQCW2l4b>#^%A9)u%W*lYEKpt-aEJ}RWUj} z?YJfgCCh_tnuY*!eDv`H;a|wRY`}(KV;+P00I{*b$F3%cjVaRe#KsD@6B%M-0E3AP zu`$I*A=t>npvmYi3b(kMe^&OojpypB@=ormFhl;T+rChS&3NxB;N9c9w~k%B%Z6b{ zHn>r#Nj41anqY$)hDL1k!$@QV8(i#DwOl<{i@IT#UGAm* @language (select #i "deutsch" @language)) + (set #i (+ #i 1)) +) +(if (= #i 2) ; LANGUAGE + (set #language "english") + (set #language @language) +) + +(set #i 0) +(set #defaultLanguages %1000000000000000) +(while (<> #language (select #i "czech" "russian" "türkçe" "greek" "magyar" "suomi" "polski" "svenska" "norsk" "nederlands" "italiano" "dansk" "español" "français" "deutsch" #language)) + ( + (set #i (+ #i 1)) + (set #defaultLanguages (shiftright #defaultLanguages 1)) + ) +) +; always add english as default language +(set #defaultLanguages (bitor #defaultLanguages (shiftleft 1 #lang_english))) + +; scan the Locale/Catalogs directory for supported languages +(set #supportedLanguages %0000000000000000) +(foreach "Locale/Catalogs" "#?" + (set #i 0) + (while (<> @each-name (select #i "english" "german" "french" "spanish" "danish" "italian" "dutch" "norwegian" "swedish" "polish" "finnish" "hungarian" "greek" "turkish" "russian" "czech" @each-name)) + (set #i (+ #i 1)) + ) + (if (<> #lang_maximum #i) + (set #supportedLanguages (bitor #supportedLanguages (shiftleft 1 #i))) + ) +) +; always add english as default supported language +(set #supportedLanguages (bitor #supportedLanguages (shiftleft 1 #lang_english))) + +;---------------------------------------------------------------------------- +; /// ***** English +(if (= #language "english") + ( + (set #acknowledgeOS (cat "Please acknowledge the automatic\n" + "detection of your operating system:")) + (set #lang_catalog (cat "Which catalog file do you want to install?\n" + "(English language is built-in)")) + (set #done (cat "\n" + @app-name " has been successfully installed.\n" + "\n" + "A reboot might be necessary to\n" + "finish this installation!")) + ) +) + +; /// +; /// ***** Deutsch +(if (= #language "deutsch") + ( + (set #acknowledgeOS (cat "Bitte bestätigen Sie die automatische\n" + "Ermittlung Ihres Betriebssystems:")) + (set #lang_catalog (cat "Welche catalog-Datei wollen Sie installieren?\n" + "(Englisch ist eingebaut)")) + (set #done (cat "\n" + @app-name " wurde erfolgreich installiert.\n" + "\n" + "Gegebenenfalls ist ein Neustart des Systems\n" + "nötig, um die Installation abzuschließen!")) + ) +) +; /// + +;---------------------------------------------------------------------------- +; /// Checking environment +(set EXEC_ver (getversion "exec.library" (resident))) +(set NEWLIB_ver (getversion "newlib.library" (resident))) +(set AROS_ver (getversion "aros.library" (resident))) + +; we use newlib.library to check whether we are running on AmigaOS 4.x +(if (>= NEWLIB_ver (* 4 65536)) + (set #detectedSystem 1) + ( + ; we are not running on AmigaOS 4.x + (if (>= AROS_ver (* 40 65536)) + (set #detectedSystem 3) + ( + ; we are not running on AROS + ; now check if we are running on MorphOS (exec.library V50+) or on AmigaOS 3.x + (if (>= EXEC_ver (* 50 65536)) + (set #detectedSystem 2) + (set #detectedSystem 0) + ) + ) + ) + ) +) + +(set #detectedSystem + (askchoice + (prompt #acknowledgeOS) + (help @askchoice-help) + (choices "AmigaOS 3.x" + "AmigaOS 4.x" + "MorphOS 1.x/2.x" + "AROS i386" + "AROS PPC" + "AROS x86_64" + ) + (default #detectedSystem) + ) +) +; finally convert the system number into a string for easier understanding +(set #detectedSystem + (select #detectedSystem "os3" "os4" "mos" "aros-i386" "aros-ppc" "aros-x86_64") +) + +(if (= #detectedSystem "os4") + ; AmigaOS 4.x uses english locale names only + ( + (set #cat_name_english "english") + (set #cat_name_german "german") + (set #cat_name_french "french") + (set #cat_name_spanish "spanish") + (set #cat_name_danish "danish") + (set #cat_name_italian "italian") + (set #cat_name_dutch "dutch") + (set #cat_name_norwegian "norwegian") + (set #cat_name_swedish "swedish") + (set #cat_name_polish "polish") + (set #cat_name_finnish "finnish") + (set #cat_name_hungarian "hungarian") + (set #cat_name_greek "greek") + (set #cat_name_turkish "turkish") + (set #cat_name_russian "russian") + (set #cat_name_czech "czech") + (set #cat_name_english_british "english-british") + ) + ; all other systems use localized locale names + ( + (set #cat_name_english "english") + (set #cat_name_german "deutsch") + (set #cat_name_french "français") + (set #cat_name_spanish "español") + (set #cat_name_danish "dansk") + (set #cat_name_italian "italiano") + (set #cat_name_dutch "nederlands") + (set #cat_name_norwegian "norsk") + (set #cat_name_swedish "svenska") + (set #cat_name_polish "polski") + (set #cat_name_finnish "suomio") + (set #cat_name_hungarian "magyar") + (set #cat_name_greek "greek") + (set #cat_name_turkish "türkçe") + (set #cat_name_russian "russian") + (set #cat_name_czech "czech") + (set #cat_name_english_british "english-british") + ) +) + +; set up the source and destination path +(if (= #detectedSystem "os3") + ( + (set #MCC_source "Libs/MUI/AmigaOS3") + (set #MCC_dest "MUI:libs/mui") + ) +) +(if (= #detectedSystem "os4") + ( + (set #MCC_source "Libs/MUI/AmigaOS4") + (set #MCC_dest "MUI:libs/mui") + ) +) +(if (= #detectedSystem "mos") + ( + (set #MCC_source "Libs/MUI/MorphOS") + (set #MCC_dest "SYS:Classes/MUI") + ) +) +(if (= #detectedSystem "aros-i386") + ( + (set #MCC_source "Libs/MUI/AROS-i386") + (set #MCC_dest "SYS:Classes/Zune") + ) +) +(if (= #detectedSystem "aros-ppc") + ( + (set #MCC_source "Libs/MUI/AROS-ppc") + (set #MCC_dest "SYS:Classes/Zune") + ) +) +(if (= #detectedSystem "aros-x86_64") + ( + (set #MCC_source "Libs/MUI/AROS-x86_64") + (set #MCC_dest "SYS:Classes/Zune") + ) +) + +; /// +; /// Let's ask user for anything +(complete 10) + +(set catalog_lang + (askoptions + (prompt #lang_catalog) + (help @askoptions-help) + (choices + (if (in #supportedLanguages #lang_english) + (cat #prop "English") + ("") + ) + (if (in #supportedLanguages #lang_german) + (cat #prop "Deutsch") + ("") + ) + (if (in #supportedLanguages #lang_french) + (cat #prop "Français") + ("") + ) + (if (in #supportedLanguages #lang_spanish) + (cat #prop "Español") + ("") + ) + (if (in #supportedLanguages #lang_danish) + (cat #prop "Dansk") + ("") + ) + (if (in #supportedLanguages #lang_italian) + (cat #prop "Italiano") + ("") + ) + (if (in #supportedLanguages #lang_dutch) + (cat #prop "Nederlands") + ("") + ) + (if (in #supportedLanguages #lang_norwegian) + (cat #prop "Norsk") + ("") + ) + (if (in #supportedLanguages #lang_swedish) + (cat #prop "Svenska") + ("") + ) + (if (in #supportedLanguages #lang_polish) + (cat #prop "Polski") + ("") + ) + (if (in #supportedLanguages #lang_finnish) + (cat #prop "Suomi") + ("") + ) + (if (in #supportedLanguages #lang_hungarian) + (cat #prop "Magyar") + ("") + ) + (if (in #supportedLanguages #lang_greek) + (cat #prop "ÅëëçíéêÜ") + ("") + ) + (if (in #supportedLanguages #lang_turkish) + (cat #prop "Türkçe") + ("") + ) + (if (in #supportedLanguages #lang_russian) + (cat #prop "Russian") + ("") + ) + (if (in #supportedLanguages #lang_czech) + (cat #prop "Czech") + ("") + ) + (if (and (in #supportedLanguages #lang_english_british) (= #detectedSystem "os4")) + (cat #prop "English (british)") + ("") + ) + ) + (default #defaultLanguages) + ) +) + +; /// +; /// Here we go! +(complete 33) + +; copy the .mcc and .mcp files +(foreach #MCC_source "#?.mc?" + (copylib + (prompt @each-name) + (source (tackon #MCC_source @each-name)) + (dest #MCC_dest) + (confirm) + (help @copylib-help) + ) +) + +(complete 66) + +; check if there were any catalogs selected at all +(if (<> 0 catalog_lang) + ( + ; copy the .cd files for people wanting to translate + (foreach "Locale" "#?_mcp.cd" + (copyfiles + (source (tackon "Locale" @each-name)) + (dest "LOCALE:Catalogs") + (help @copyfiles-help) + ) + ) + + ; german catalog file + (if (in catalog_lang #lang_german) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_german)) + + (foreach "Locale/Catalogs/german" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/german" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_german)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; french catalog file + (if (in catalog_lang #lang_french) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_french)) + + (foreach "Locale/Catalogs/french" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/french" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_french)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; spanish catalog file + (if (in catalog_lang #lang_spanish) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_spanish)) + + (foreach "Locale/Catalogs/spanish" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/spanish" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_spanish)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; danish catalog file + (if (in catalog_lang #lang_danish) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_danish)) + + (foreach "Locale/Catalogs/danish" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/danish" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_danish)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; italian catalog file + (if (in catalog_lang #lang_italian) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_italian)) + + (foreach "Locale/Catalogs/italian" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/italian" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_italian)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; dutch catalog file + (if (in catalog_lang #lang_dutch) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_dutch)) + + (foreach "Locale/Catalogs/dutch" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/dutch" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_dutch)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; norwegian catalog file + (if (in catalog_lang #lang_norwegian) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_norwegian)) + + (foreach "Locale/Catalogs/norwegian" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/norwegian" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_norwegian)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; swedish catalog file + (if (in catalog_lang #lang_swedish) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_swedish)) + + (foreach "Locale/Catalogs/swedish" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/swedish" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_swedish)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; polish catalog file + (if (in catalog_lang #lang_polish) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_polish)) + + (foreach "Locale/Catalogs/polish" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/polish" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_polish)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; finnish catalog file + (if (in catalog_lang #lang_finnish) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_finnish)) + + (foreach "Locale/Catalogs/finnish" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/finnish" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_finnish)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; hungarian catalog file + (if (in catalog_lang #lang_hungarian) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_hungarian)) + + (foreach "Locale/Catalogs/hungarian" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/hungarian" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_hungarian)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; greek catalog file + (if (in catalog_lang #lang_greek) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_greek)) + + (foreach "Locale/Catalogs/greek" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/greek" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_greek)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; turkish catalog file + (if (in catalog_lang #lang_turkish) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_turkish)) + + (foreach "Locale/Catalogs/turkish" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/turkish" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_turkish)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; russian catalog file + (if (in catalog_lang #lang_russian) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_russian)) + + (foreach "Locale/Catalogs/russian" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/russian" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_russian)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; czech catalog file + (if (in catalog_lang #lang_czech) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_czech)) + + (foreach "Locale/Catalogs/czech" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/czech" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_czech)) + (help @copyfiles-help) + ) + ) + ) + ) + + ; english-british catalog file, only AmigaOS4.x can handle this + (if (and (in catalog_lang #lang_english_british) (= #detectedSystem "os4")) + ( + (makedir (tackon "LOCALE:Catalogs" #cat_name_english_british)) + + (foreach "Locale/Catalogs/english-british" "#?_mcp.catalog" + (copyfiles + (source (tackon "Locale/Catalogs/english-british" @each-name)) + (dest (tackon "LOCALE:Catalogs" #cat_name_english_british)) + (help @copyfiles-help) + ) + ) + ) + ) + ) +) + +(complete 100) + +(message #done) + +; /// ******************** +;---------------------------------------------------------------------------- +(exit (QUIET)) diff --git a/workbench/classes/zune/nlist/dist/MCC_NList/Install-MCC.info b/workbench/classes/zune/nlist/dist/MCC_NList/Install-MCC.info new file mode 100755 index 0000000000000000000000000000000000000000..9192498930bff5f908cf98b5648c36f1fa6957f1 GIT binary patch literal 1846 zcwV(rdrVVT82@fd3lp$(&Ihdue>j~kQXJ9Z3#33^NVe$! z=aOYAlz}cW&b3CUPp-7c=AE;%;1WBd*fOu<5=*$2ibYy(cP%9H$Snw7v28;`054l0Funw#K8`RB3{(V$ ziQ9hgj|&_F_7WMW=odDzJtITh)_QOPNs*C}u1HH>xw@dNte|8=S;>xKWz5d}{0aNN zF#ne}>JZ!0H;OM$i5A=6KZg`$V)o#t5$}DQB!2Ukh*v!W7z6+lq1d4JAA-q`7rbbk zEh5`*M@u-0;A{UOKryX38L=VD5b*(YBRMuHENsFyDYdw?Y->?bK?x^u>enYClD=+7 zY1u?5BGOXRKirUctXgk5_Iq;@u4F&^djV=CHx}r#%2J4gX}gQdiho1XVJ;(8GTC+t516HwWpRI z&Og>SKFQvK&_}y?ZXC>CfGmVRsccrTqPuJ+(K~5=H@CO8A(&_&@<8?wLOVtJ15-m3 zm8HK!nE&ID)3Q4qEp-~4pLi6z9@quB2A(p~?prmr!7*Z%)#kdeNOHHH(lU^)uGoT9 z!}wK-Q@I-4Ak@Y1Yesv6<9#=#5tdlNcCT4hLrov;Sh8EMjQ8J|HfG5P>hoS_Y90oT zLDwL7YAHH;6FY`ul@In6@!1Zr*s!=-I;vb?*EA|!tCk1O0iswzA;`I=My2zG#@#&2 z<bieUvbj#r*`<2;tO;bCj z_IW|$Hd32NL>E7LW3tKJyfUC2fdaQFx7fT$kFeTo8pD`simuN)1ox@6<`We!QK#r= z`4AA)bW&DJq2mcAgKJrrqe{+tbkUeOu|#a3v+Wm}jKJhdgBaf}KZq)rD+$34War2X+{~lpPheKHH*bYg4tp)TumNfCv|hzQV9zLw#wWT%otfLenX`Jk=6-QjOHTa3 zl*ldb0PM}aa$fW26NY}n*_M1?qi`->d;s8AV^h;-C7R7ioyR-Rs7`*pJWatwVu8*sIBMr66<%|zU6A3Kqav@^!J`3BtlR1 zaPzt==EFgSrs4KzP*YH>{vNLn)Pi~=H$>V7$q_uk=M*-VUa7bP2eowBkzHo1;fwrnUptr zrmugx+|tftdI;$db`g0m(xZ=$YxFeI<&ILVzgw1QZL#Eq70L|x@ra=EkxWZ3w|TD8 z3C}{i5OqH$vFFa#4))F)BriQh$ZpS(G-VFTkG)3MzR|n$68FfTLS3QkD?`;x%u9EiC0RV&Sir^x>y=TFe3ZLJp2tr}M`20p$a7Q^MkT#!`5)v@ z<-VZ-6?)r<|3(Z-#>AXp$0bDOyE}f_W^tjcmO1W>YgFdgE6?-WD~gm&bPS1yBmI*R z%B^>0k9Nll8=2fq6540mTn7>>wVaiQp?WcSP`OcgJprxNG!)11J3RIPPv zu0uD@Jv!DaD!g-a6#BOoy}N82WG`#`ZSeVu=nal#uRN%-qXYNhZ%7!FM;S NB*Lm!C+RbQzX5>|5|01? literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/dist/MCC_NList/ReadMe.info b/workbench/classes/zune/nlist/dist/MCC_NList/ReadMe.info new file mode 100755 index 0000000000000000000000000000000000000000..2f62f0378e3a94c6e67bc2ed878f31c18db09453 GIT binary patch literal 2542 zcwUWFZERCj7(RFH=sLz&FVqjBtnD4d4TP?%B8drI+A$Ub&5(ObFmdgm>zF3%BD8>- zc7Vq5XGG$R&NvJarIYZnWP|ZzsB=V3)C7%*{@4Tw^2d#A>-urI*Y`d5w!NYePtvE) zdEe)K&wI|EZ8s|jLvR(70I4DC$RgM?gJ-{y@Iy1}$cOZs#0g>aBp)ZBC#0X`mqqz{ zf~+M)sM68x%?gHD_WbK*Dd_2!n_jfbM zvbKYwEJHr^Eak6JoiIfYNGUyEqkLHTEh)}4sQ z&Lgfu&Xl53&tF1bgS^CtXgiB&q@2NS-R4f@2IPm$w0|Y#JmoROuU?=^dionQl9)t1 zK_i0{zt`|dS)LBiUPyK5kMW?(|}2tz%>P){?|BXGO_@Cd!Ttdmg$2f{*JkPUG(X#sUwoc%{c z!Fv>?0xnbH1Bh!T5$hqpQRK1P+4RJ?Kqfm2Tbt^1i*1 zy}>Bi?A^W<{&3YaxxL#q*Si}ayQum}K(1+PeIp@7tBFy^F!~}RF?BDo+^F=EmD`!x zBr&b~vBc?dyIcGWJMB6J%)L2DYOB1TBwa^5PUkZqS+8G=688q07|FP<fLyz^IAOrq~Sx+sgOCl8S6{#RZPTDp5H*Yd>7a zsmYPKc%*H&ZNOj7DpPugj2uU^T~&?I*d@_^5yUo77+Jhj(*Cx?!NGPhs}Asm1C|X6 z0#)wD`QBmCVnmM8R*=$dJqMYH&bCp>WbLicG-IiIItH^llf4sU{g6)ROOoa)n1ICz zY|eV2rv=lg-qS|ga&!AT^KiRYDj?bq9joWmDONBuh7?3F(;BAyrFF5>egq8(B=< za)qo&GoLemTl3}C1;X60FljIk$5^w(%H41cSqU+5+xYT54ih1)^TnUdp=cy>goYcY zyZT@gIjH1(u|%>ufQsKy9QWmmbY@oyI^UbV{k8fqf_xYCC0x00E{Oy*p~qykA_&BWSs|y2b)?6J zm#Bke!xL&nU{x@uSUC4w#XB8pgKNquZLF{>cb)g=E>sJG+Cfyt$_Dng2?fdM+{H)V z>*H08a+BEbV}el797>$KBDNMo6`#}L3nW{MgF%5;XHjRn6@-N@DgpuW2hDs(KA-gm;h0SG>b<#vl4DZm-gho^`v13^&m^o*VWmvli{=V12uPrUD~{y|6OagpZctckFDXoiW|9Fn7zl frPmVTB-(C(jKSqt70HcG=rE2mQ*bn(e literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/dist/MCC_NList/ReadMe.mui b/workbench/classes/zune/nlist/dist/MCC_NList/ReadMe.mui new file mode 100755 index 0000000000..e5feb5fd20 --- /dev/null +++ b/workbench/classes/zune/nlist/dist/MCC_NList/ReadMe.mui @@ -0,0 +1,27 @@ +------------------------------------------------------------------------ + MUI - MagicUserInterface + + Version 3.8 + + (c) Copyright 1992-97, Stefan Stuntz +------------------------------------------------------------------------ + +MUI is an object oriented system to create and maintain graphical user +interfaces. From a programmers point of view, using MUI saves a lot of +time and makes life much easier. Thinking about complicated terms like +window resizing or font sensitivity is simply not neccesary. + +On the other hand, users of MUI based applications have the ability to +customize nearly every pixel of a programs interface according to their +personal taste. + +Please click on the Install-MUI icon to install MUI on your system or to +update from previous versions. Latest news and support can be found on +Internet at www.sasg.com. + + *********** + + Attention + + If you're still not registered for MUI, check the new and unique + shareware lottery and great discounts at www.sasg.com. Give it a try! diff --git a/workbench/classes/zune/nlist/dist/MCC_NList/ReadMe.mui.info b/workbench/classes/zune/nlist/dist/MCC_NList/ReadMe.mui.info new file mode 100755 index 0000000000000000000000000000000000000000..eb1e3a7c5ee6cc97caa2c0e9a138eadd5774216a GIT binary patch literal 2570 zcwUWFZERCz6n^j8(shinUN%37vbJ{+HxRn6iX&pn>zJBt5n4c! zc7TTQXGX$|&NvJarIYZnWP|ZzsB=V3)C7%*{@4Tw^2d#A>)Q2lujjn?cDYzuhT!s%04XPH$s*V@{b#gh8{vt{%G>+DOP1v%zGD3vL~{e>pCMYeAs#)4 zxDq*&he|zv5qUZCTpyzC45Ep02D^0@w;?woKUhrrmr%}A9!31>C90&SzeywUal~UZ z(ogYw4Ih`~8A66+aX0ehA2@mH2SP^VxfApjF2p}$i09#6?WEveZi`OSdc?Bek-an^ zQj{3zCyHoLeLF>kOALBM;e??c$;2nJ8m)eXhNDMBHH#k6@WUEDy1Zf1cWo`HuG_kq5JP#byKYN$mD>xtMP-iza;X34T zI-df`I{jjlxYyIf(7fv!?%d8ksF`vNfXZ3f=hv~GRQssM?SZ{$H(^~vp_3-vl_;I2 z4Kul&^w_#%q|g5#>xo35kTy*(q+wS#ki+%)^{l5Zl4g#8_dgM;m2Rvq9A2P_*D1WMgCv)zND#e^KCO(3P)Dh@JXoo$1XN!y#C z>Aa=#$tcY3OmvTtbptw~Cqe2usN%Qu0~8JyHA;HMa3=0XW@3Q7edOxnT4)4 zmyUJMcMs;-Y+j+O+Ya|r+w!orFzkFq4vuPjprz*yVZ;g>9kjG%-<~N_U)&PipxYbl z%%4cdC0V*5jY&tPR;f&?m5Az=-^gO>mdj*$ius)R+nOz~&JpIig-L;VIL4YLR_?lM zz)Faj+rk&@beIWYoiG1f9Eya)hiKS4+0g@=@IEEyi^dZjLL?M=#Q}fEth3R$9JS%r zOnP{};}izMp_5Ae6zoHxQ1eME6mZ^1>crJZI07Nj|BKqg_h^Vp!Wq$Y`&$^uDnhw< zO0a^!SAU$d$AQ%A`;J-mwWG7tm>PuK7Fsxvyp58vMM5yx_HnKfF+i93z!P{MzP9(Yqof^v17d)uxAFDHp>cbz zne%jwEH_*_WSu2e_O_iZu`}k|7UoVt=Oh!*8kIUVp{3tbg9E=V&m&(Xr Dw>$#o literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/docs/MCC_NBalance.doc b/workbench/classes/zune/nlist/docs/MCC_NBalance.doc new file mode 100644 index 0000000000..f994c3ab7e --- /dev/null +++ b/workbench/classes/zune/nlist/docs/MCC_NBalance.doc @@ -0,0 +1,43 @@ +TABLE OF CONTENTS + +NBalance.mcc/NBalance.mcc +NBalance.mcc/MUIA_NBalance_Pointer + NBalance.mcc/NBalance.mcc + + ******************************************************************* + Copyright (C) 2001-2010 by NList Open Source Team + $Id: MCC_NBalance.doc 401 2010-04-30 17:37:20Z damato $ + + This MCC public custom class is derived from the MUI standard + balance class which handles the dragging/resizing of vertical and + horizontal groups. + + In contrast to the standard MUI balance class, however, it adds + some features such as displaying a mouse pointer as soon as the + mouse is above a dragable NBalance object. + + It is released and distributed under the terms of the GNU Lesser + General Public License (LGPL) and available free of charge. + + Please visit http://www.sf.net/projects/nlist-classes/ for + the very latest version and information regarding NBalance + ******************************************************************* + + NBalance.mcc/MUIA_NBalance_Pointer + + NAME + MUIA_NBalance_Pointer -- [ISG.], LONG + + INPUTS + MUIV_NBalance_Pointer_Off + MUIV_NBalance_Pointer_Standard (default) + + FUNCTION + Allows to set the mouse pointer that should be displayed when + the mouse is found to be above a NBalance object. Per default + a standard horizontal or vertical size pointer is displayed as + soon as the mouse is above a dragable NBalance object. + + SEE ALSO + + diff --git a/workbench/classes/zune/nlist/docs/MCC_NFloattext.doc b/workbench/classes/zune/nlist/docs/MCC_NFloattext.doc new file mode 100644 index 0000000000..fd75685bf8 --- /dev/null +++ b/workbench/classes/zune/nlist/docs/MCC_NFloattext.doc @@ -0,0 +1,161 @@ +TABLE OF CONTENTS + +NFloattext.mcc/NFloattext.mcc +NFloattext.mcc/MUIA_NFloattext_Align +NFloattext.mcc/MUIA_NFloattext_Justify +NFloattext.mcc/MUIA_NFloattext_SkipChars +NFloattext.mcc/MUIA_NFloattext_TabSize +NFloattext.mcc/MUIA_NFloattext_Text +NFloattext.mcc/MUIM_NFloattext_GetEntry + NFloattext.mcc/NFloattext.mcc + + NFloattext class is a subclass of NList class that takes + a big text string as input and splits it up into several + lines to be dislayed. Formatting capabilities include + paragraphs an justified text with word wrap. That MCC + public custom class work near the same way as Floattext. + + All you can do with NFloattext can be done directly using + NList and its word wrap capabilities. NFloattext is here + to give easy use and transition from Floattext. + + Now NList package provide a Floattext.mui replacement + which use directly this class. Unfortunately the + repacement Floattext.mui have to have the same major release + number than original Floattext.mui to be accepted by MUI, + so it will have to be update with each new MUI remease. :( + + By default, MUIA_NList_Input is FALSE and MUIA_NList_TypeSelect + is MUIV_NList_TypeSelect_Char, alowing char selection and copy + to clipboard. If you set MUIA_NList_Input to TRUE, then + MUIA_NList_TypeSelect default to MUIV_NList_TypeSelect_Line as + usual. + + NFloattext don't copy the string text, so it needs to copy + the string line to a buffer when you do a MUIM_NFloattext_GetEntry + or MUIM_List_GetEntry, so the return pointer will be invalid + after next GetEntry call (the new one will be valid of course). + + Using the old MUIA_Floattext_Text from standard Floadtext class + instead of MUIA_NFloattext_Text will make NFloattext copy + the text like in Floattext class. + + Note that MUIM_NList_GetEntry work as describe in NList, so + as NFloattext use word wrap entries, you should use better + MUIM_NFloattext_GetEntry or MUIM_List_GetEntry. Or use + MUIM_NList_GetEntryInfo and MUIM_NList_GetEntry. + + NFloattext.mcc/MUIA_NFloattext_Align + + NAME + MUIA_NFloattext_Align -- [ISG], LONG + + SPECIAL INPUTS + ALIGN_LEFT + ALIGN_CENTER + ALIGN_RIGHT + ALIGN_JUSTIFY + + FUNCTION + Indicate what alignment you want. + It can be done with an escape alignment sequence + in the Format preparse string or in the text string + (for each linefeed separated lines) itself. + + setting it will set MUIA_NFloattext_Justify to + TRUE if ALIGN_JUSTIFY, else to FALSE. + + SEE ALSO + MUIA_NFloattext_Justify, MUIA_NList_Format + NFloattext.mcc/MUIA_NFloattext_Justify + + NAME + MUIA_NFloattext_Justify -- [ISG], BOOL + + FUNCTION + Same as Floattext.mui/MUIA_Floattext_Justify. + + if TRUE, MUIA_NFloattext_Align will be set to + ALIGN_JUSTIFY, else to ALIGN_LEFT. + + SEE ALSO + MUIA_NFloattext_Align, MUIA_NList_Format + NFloattext.mcc/MUIA_NFloattext_SkipChars + + NAME + MUIA_NFloattext_SkipChars -- [ISG], char * + + FUNCTION + Same as NList.mcc/MUIA_NList_SkipChars + and Floattext.mui/MUIA_Floattext_SkipChars. + + SEE ALSO + MUIA_NList_SkipChars, MUIA_Floattext_SkipChars + NFloattext.mcc/MUIA_NFloattext_TabSize + + NAME + MUIA_NFloattext_TabSize -- [ISG], LONG + + FUNCTION + Same as NList.mcc/MUIA_NList_TabSize + and Floattext.mui/MUIA_Floattext_TabSize. + + Tab size defaults to 8. + + SEE ALSO + MUIA_NList_TabSize, MUIA_Floattext_TabSize + NFloattext.mcc/MUIA_NFloattext_Text + + NAME + MUIA_NFloattext_Text -- [ISG], STRPTR + + FUNCTION + Same as Floattext.mui/MUIA_Floattext_Text. + + String of characters to be displayed as floattext. + This string may contain linefeeds or carriage retruns to mark + the end of paragraphs or tab characters for indention. + + NFloattext will automatically format the text according + to the width of the NFloattext object. If a word + won't fit into the current line, it will be wrapped. + + NFloattext don't copies the string into a private buffer + as Floattext do it, so you need to keep your text in + memory, but it uses less memory. + + If you want NFloattext to copy the text, just use + MUIA_Floattext_Text which will do it for compatibility. + + Setting MUIA_NFloattext_Text to NULL means to clear + the current text. + + Please note that justification and word wrap is a + complicated operation and may take a considerable + amount of time, especially with long texts on slow + machines. + + NFloattext.mcc/MUIM_NFloattext_GetEntry + + NAME + MUIM_NFloattext_GetEntry -- + + SYNOPSIS + DoMethod(obj,MUIM_NFloattext_GetEntry,LONG pos, APTR *entry); + + FUNCTION + Same function as List.mui/MUIM_List_GetEntry. + + You'll get pointer to a null terminated string buffer which + is a copy of the asked visible entry. + + Unlike with Floattext, the returned string will be valid only + until next MUIM_NFloattext_GetEntry/MUIM_List_GetEntry call + if the entry was word wrapped. + I'll try to make it stay valid when using MUIM_List_GetEntry + only if someone report me some compatibility problem because + doing that will use more memory. + + SEE ALSO + MUIM_NList_GetEntry, MUIM_NList_GetEntryInfo, MUIM_List_GetEntry + diff --git a/workbench/classes/zune/nlist/docs/MCC_NList.doc b/workbench/classes/zune/nlist/docs/MCC_NList.doc new file mode 100644 index 0000000000..e48f88ff27 --- /dev/null +++ b/workbench/classes/zune/nlist/docs/MCC_NList.doc @@ -0,0 +1,3521 @@ +TABLE OF CONTENTS + +NList.mcc/NList.mcc +NList.mcc/MUIA_NList_Active +NList.mcc/MUIA_NList_ActiveObjectOnClick +NList.mcc/MUIA_NList_AdjustHeight +NList.mcc/MUIA_NList_AdjustWidth +NList.mcc/MUIA_NList_AutoCopyToClip +NList.mcc/MUIA_NList_AutoVisible +NList.mcc/MUIA_NList_ButtonClick +NList.mcc/MUIA_NList_ClickColumn +NList.mcc/MUIA_NList_Columns +NList.mcc/MUIA_NList_CompareHook +NList.mcc/MUIA_NList_CompareHook2 +NList.mcc/MUIA_NList_ConstructHook +NList.mcc/MUIA_NList_ConstructHook2 +NList.mcc/MUIA_NList_CopyColumnToClipHook +NList.mcc/MUIA_NList_CopyColumnToClipHook2 +NList.mcc/MUIA_NList_CopyEntryToClipHook +NList.mcc/MUIA_NList_CopyEntryToClipHook2 +NList.mcc/MUIA_NList_DefaultObjectOnClick +NList.mcc/MUIA_NList_DefClickColumn +NList.mcc/MUIA_NList_DestructHook +NList.mcc/MUIA_NList_DestructHook2 +NList.mcc/MUIA_NList_DisplayHook +NList.mcc/MUIA_NList_DisplayHook2 +NList.mcc/MUIA_NList_DisplayRecall +NList.mcc/MUIA_NList_DoubleClick +NList.mcc/MUIA_NList_DragColOnly +NList.mcc/MUIA_NList_DragSortable +NList.mcc/MUIA_NList_DragSortInsert +NList.mcc/MUIA_NList_DragType +NList.mcc/MUIA_NList_DropMark +NList.mcc/MUIA_NList_DropType +NList.mcc/MUIA_NList_Entries +NList.mcc/MUIA_NList_EntryClick +NList.mcc/MUIA_NList_EntryValueDependent +NList.mcc/MUIA_NList_Exports +NList.mcc/MUIA_NList_First +NList.mcc/MUIA_NList_ForcePen +NList.mcc/MUIA_NList_Format +NList.mcc/MUIA_NList_Horiz_DeltaFactor +NList.mcc/MUIA_NList_Horiz_Entries +NList.mcc/MUIA_NList_Horiz_First +NList.mcc/MUIA_NList_Horiz_Visible +NList.mcc/MUIA_NList_IgnoreSpecialChars +NList.mcc/MUIA_NList_Imports +NList.mcc/MUIA_NList_Input +NList.mcc/MUIA_NList_InsertPosition +NList.mcc/MUIA_NList_KeepActive +NList.mcc/MUIA_NList_KeyUpFocus +NList.mcc/MUIA_NList_KeyDownFocus +NList.mcc/MUIA_NList_KeyLeftFocus +NList.mcc/MUIA_NList_KeyRightFocus +NList.mcc/MUIA_NList_LineHeight +NList.mcc/MUIA_NList_MakeActive +NList.mcc/MUIA_NList_MinColSortable +NList.mcc/MUIA_NList_MinLineHeight +NList.mcc/MUIA_NList_MultiClick +NList.mcc/MUIA_NList_MultiClickAlone +NList.mcc/MUIA_NList_MultiSelect +NList.mcc/MUIA_NList_MultiTestHook +NList.mcc/MUIA_NList_Pool +NList.mcc/MUIA_NList_PoolPuddleSize +NList.mcc/MUIA_NList_PoolThreshSize +NList.mcc/MUIA_NList_PrivateData +NList.mcc/MUIA_NList_Prop_DeltaFactor +NList.mcc/MUIA_NList_Prop_Entries +NList.mcc/MUIA_NList_Prop_First +NList.mcc/MUIA_NList_Prop_Visible +NList.mcc/MUIA_NList_Quiet +NList.mcc/MUIA_NList_SelectChange +NList.mcc/MUIA_NList_ShowDropMarks +NList.mcc/MUIA_NList_SkipChars +NList.mcc/MUIA_NList_SortType +NList.mcc/MUIA_NList_SortType2 +NList.mcc/MUIA_NList_SourceArray +NList.mcc/MUIA_NList_SourceInsert +NList.mcc/MUIA_NList_SourceString +NList.mcc/MUIA_NList_TabSize +NList.mcc/MUIA_NList_Title +NList.mcc/MUIA_NList_TitleClick +NList.mcc/MUIA_NList_TitleClick2 +NList.mcc/MUIA_NList_TitleMark +NList.mcc/MUIA_NList_TitleMark2 +NList.mcc/MUIA_NList_TitleSeparator +NList.mcc/MUIA_NList_TypeSelect +NList.mcc/MUIA_NList_Visible +NList.mcc/MUIA_NList_XXXBackground +NList.mcc/MUIA_NList_XXXPen +NList.mcc/MUIM_NList_Clear +NList.mcc/MUIM_NList_ColWidth +NList.mcc/MUIM_NList_ColToColumn +NList.mcc/MUIM_NList_ColumnToCol +NList.mcc/MUIM_NList_Compare +NList.mcc/MUIM_NList_Construct +NList.mcc/MUIM_NList_ContextMenuBuild +NList.mcc/MUIM_NList_CopyTo +NList.mcc/MUIM_NList_CopyToClip +NList.mcc/MUIM_NList_CreateImage +NList.mcc/MUIM_NList_DeleteImage +NList.mcc/MUIM_NList_Destruct +NList.mcc/MUIM_NList_Display +NList.mcc/MUIM_NList_DoMethod +NList.mcc/MUIM_NList_DropDraw +NList.mcc/MUIM_NList_DropEntryDrawErase +NList.mcc/MUIM_NList_DropType +NList.mcc/MUIM_NList_Exchange +NList.mcc/MUIM_NList_GetEntry +NList.mcc/MUIM_NList_GetEntryInfo +NList.mcc/MUIM_NList_GetPos +NList.mcc/MUIM_NList_GetSelectInfo +NList.mcc/MUIM_NList_Insert +NList.mcc/MUIM_NList_InsertSingle +NList.mcc/MUIM_NList_InsertSingleWrap +NList.mcc/MUIM_NList_InsertWrap +NList.mcc/MUIM_NList_Jump +NList.mcc/MUIM_NList_Move +NList.mcc/MUIM_NList_NextSelected +NList.mcc/MUIM_NList_PrevSelected +NList.mcc/MUIM_NList_Redraw +NList.mcc/MUIM_NList_RedrawEntry +NList.mcc/MUIM_NList_Remove +NList.mcc/MUIM_NList_ReplaceSingle +NList.mcc/MUIM_NList_Select +NList.mcc/MUIM_NList_SelectChange +NList.mcc/MUIM_NList_SetActive +NList.mcc/MUIM_NList_SetColumnCol +NList.mcc/MUIM_NList_Sort +NList.mcc/MUIM_NList_Sort2 +NList.mcc/MUIM_NList_Sort3 +NList.mcc/MUIM_NList_TestPos +NList.mcc/MUIM_NList_UseImage + NList.mcc/NList.mcc + + ******************************************************************* + Copyright (C) 2001-2010 by NList Open Source Team + $Id$ + + This MCC public custom class is very similar to the MUI's list + class. + + It handles directly most attributes which are handled by Listview + in the original couple List/Listview. + + The NListview exist anyway to provide a complete object with + scrollbars, so you should use it as child of NListview. Anyway, + you can use NList without NListview if you don't want any builtin + scrollbar. + + NOTE: NList class will not work with Listview without some + conflicts, and NListview class can't use List as child but + only NList or a NList subclass. + + MUIM_NList_TestPos and MUIM_List_TestPos are similar + but use a different struct to store data. + MUIM_List_TestPos works like with a List object. + + NOTE: Avoid as possible to do many things in MUIM_Show and + MUIM_Hide methods because when an object is in + a virtual group, your object will receive them + for each one of its moves !!! + + + Standard tags with NList special values : + + MUIA_Background has the same meaning than + MUIA_NList_ListBackground + but only at init. + + MUIA_Font is settable only at init. + MUIV_NList_Font, MUIV_NList_Font_Little + and MUIV_NList_Font_Fixed are special + values usable for it (settable in prefs) + but standard values are usable too. + + MUIA_Frame you can override the defaults frames + of the classe by setting it, but it will + be overrided again by defaults if a + set(obj,MUIA_NList_Input,bool) is made after. + if MUIA_NList_Input is TRUE then the + default is MUIV_Frame_InputList, if FALSE + it's MUIV_Frame_ReadList. + + MUIA_ContextMenu + MUIM_ContextMenuBuild + MUIM_ContextMenuChoice + read MUIM_NList_ContextMenuBuild. + + + The gadget was originally written in 1996 by Gilles Masson. In 2001 + it was released under the LGPL license and is now maintained by a + free Open Source Team. + + It is released and distributed under the terms of the GNU Lesser + General Public License (LGPL) and available free of charge. + + Please visit http://www.sf.net/projects/nlist-classes/ for + the very latest version and information regarding NList + ******************************************************************* + + NList.mcc/MUIA_NList_Active + + NAME + MUIA_NList_Active -- [ISGN], LONG + + SPECIAL INPUTS + MUIV_NList_Active_Off + MUIV_NList_Active_Top + MUIV_NList_Active_Bottom + MUIV_NList_Active_Up + MUIV_NList_Active_Down + MUIV_NList_Active_PageUp + MUIV_NList_Active_PageDown + + FUNCTION + Same function as List.mui/MUIA_List_Active. + + SEE ALSO + MUIA_NList_Entries, MUIA_NList_First, MUIA_NList_Visible + NList.mcc/MUIA_NList_ActiveObjectOnClick + + NAME + MUIA_NList_ActiveObjectOnClick -- [ISG], BOOL + + FUNCTION + If set to TRUE, the NList object will become the + MUIA_Window_ActiveObject of its window when you + click on it. In addition, the active selected entries + will switch an inactive color (e.g. grey) in case the + NList object isn't currently active. As soon as the + object is active it will then also receive all user + keys pressed. + + DEFAULT + FALSE + + SEE ALSO + MUIA_NList_DefaultObjectOnClick + MUIA_NList_KeepActive + MUIA_NList_MakeActive + NList.mcc/MUIA_NList_AdjustHeight + + NAME + MUIA_NList_AdjustHeight -- [I..], BOOL + + FUNCTION + Same function as List.mui/MUIA_List_AdjustHeight. + + Will adjust the nlist height if the nlist object is in a virtual + group or if MUIA_NList_SourceInsert, MUIA_NList_SourceString, + MUIA_NList_SourceArray or MUIA_List_SourceArray was used. + + When the object is in a virtual group, a re-layout of this one + will be forced when the entries number of the NList object change, + so all entries should always be visible. + + DEFAULT + FALSE + + SEE ALSO + MUIA_List_AdjustHeight, MUIA_NList_AdjustWidth + NList.mcc/MUIA_NList_AdjustWidth + + NAME + MUIA_NList_AdjustWidth -- [I..], BOOL + + FUNCTION + Same function as List.mui/MUIA_List_AdjustWidth. + + Will adjust the nlist width if the nlist object is in a virtual + group or if MUIA_NList_SourceInsert, MUIA_NList_SourceString, + MUIA_NList_SourceArray or MUIA_List_SourceArray was used. + + DEFAULT + FALSE + + SEE ALSO + MUIA_List_AdjustWidth, MUIA_NList_AdjustHeight + + NList.mcc/MUIA_NList_AutoClip + + NAME + MUIA_NList_AutoClip -- [ISG], BOOL + + FUNCTION + If set to TRUE and the NList object is in read-only (NoInput) mode and + is set to select char-wide rather than by line, the selected content is + immediately copied to the clipboard as soon as it is selected via the + mouse. + + DEFAULT + TRUE + + WARNING + Please note that due to historical reasons this feature is turned + on per default. However, due to violating the Amiga style guides, new + or revised applications are adviced to disable auto clipping as + manually performing the copy operation should be the preferred method. + + SEE ALSO + MUIA_NList_Input + MUIA_NList_TypeSelect + MUIA_NList_AutoCopyToClip + MUIA_NList_CopyColumnToClipHook + MUIA_NList_CopyEntryToClipHook + MUIM_NList_CopyToClip + NList.mcc/MUIA_NList_AutoCopyToClip + + NAME + MUIA_NList_AutoCopyToClip -- [IS.], BOOL + + FUNCTION + If set to TRUE you can copy the selected area to the + clipboard 0 with Amiga-C and Amiga-X (Amiga-X because + i have seen that sometimes Amiga-C is a shortcut !). + (works with both Right-Amiga and Left-Amiga keys) + + MUIA_NList_AutoCopyToClip == TRUE also requires that the NList object + is either the window's active object (see MUIA_Window_ActiveObject) or + the attached list object is window's default object (see + MUIA_Window_DefaultObject). Otherwise nothing will ever be copied! + + DEFAULT + TRUE + + SEE ALSO + MUIA_NList_AutoClip + MUIA_NList_CopyColumnToClipHook + MUIA_NList_CopyEntryToClipHook + MUIM_NList_CopyToClip + NList.mcc/MUIA_NList_AutoVisible + + NAME + MUIA_NList_AutoVisible -- [ISG], BOOL + + FUNCTION + Same function as List.mui/MUIA_List_AutoVisible. + + Seting this to TRUE, the NList object will automatically and + always jump to show the active entry. + + DEFAULT + FALSE + + SEE ALSO + MUIA_List_AutoVisible, MUIA_NList_Active + NList.mcc/MUIA_NList_ButtonClick + + NAME + MUIA_NList_ButtonClick -- [..GN], LONG + + FUNCTION + You'll get a notify on it each time the user + clicks one of the buttons made by ESC O[...@] or ESC o[...@]. + + The returned value is the of the clicked image/object. + (see MUIA_NList_DisplayHook for more). + + If you get that value later, it will still be of the latest + image/object clicked that you'll get. + + SEE ALSO + MUIA_NList_DisplayHook, MUIA_NList_DoubleClick, MUIA_NList_MultiClick, + MUIA_NList_EntryClick, MUIA_NList_TitleClick + NList.mcc/MUIA_NList_ClickColumn + + NAME + MUIA_NList_ClickColumn -- [..G], LONG + + FUNCTION + Same function as Listview.mui/MUIA_Listview_ClickColumn. + + SEE ALSO + MUIA_Listview_ClickColumn, MUIA_NList_DefClickColumn + NList.mcc/MUIA_NList_Columns + + NAME + MUIA_NList_Columns -- [ISGN], BYTE * + + FUNCTION + With this tag you can set/get the visible order of columns (as if changed + by the user). It work for all columns in one time (use MUIM_NList_SetColumnCol + if you want to exchange 2 columns). + + The value is a pointer on an BYTE array, each byte is for a column + (in the visible order) and have the value of the display hook col + which have to be displayed in it. + + The array must be ended with a -1 value. + + NOTE + The returned array is always the same : it's its contents which change. + + You can set your own array or modify the returned one and set it, both + is ok. + + In future it will be possible to have <-1 values for hidden columns + (it's not yet implemented but you should skip those values). + + SEE ALSO + MUIM_NList_SetColumnCol, MUIM_NList_ColToColumn, MUIM_NList_ColumnToCol + NList.mcc/MUIA_NList_CompareHook + + NAME + MUIA_NList_CompareHook -- [IS.], struct Hook * + + FUNCTION + Same function as List.mui/MUIA_List_CompareHook. + + SEE ALSO + MUIA_NList_ConstructHook, MUIA_NList_DestructHook + NList.mcc/MUIA_NList_CompareHook2 + + NAME + MUIA_NList_CompareHook2 -- [IS.], struct Hook * + + FUNCTION + Same function as MUIA_NList_CompareHook but A2 will be the object + and A1 a NList_CompareMessage struct pointer. + + EXAMPLES + See NList-Demo program. + + SEE ALSO + MUIA_NList_CompareHook + NList.mcc/MUIA_NList_ConstructHook + + NAME + MUIA_NList_ConstructHook -- [IS.], struct Hook * + + FUNCTION + Same function as List.mui/MUIA_List_ConstructHook. + + Think to finish lines entries on a \0 , \n and \r. + The list will not display anything which come after + a \n , \r or \0, so finish lines entries on a \0, \r + and \n if you dont want to waste memory. + + SPECIAL INPUTS + MUIV_NList_ConstructHook_String + + It's a builtin hook that copy a string entry. + (so original string can be trash after) + you must set MUIV_NList_DestructHook_String + too if you use it. + + SEE ALSO + MUIA_NList_DestructHook, MUIA_NList_DisplayHook + NList.mcc/MUIA_NList_ConstructHook2 + + NAME + MUIA_NList_ConstructHook2 -- [IS.], struct Hook * + + FUNCTION + Same function as MUIA_NList_ConstructHook but A2 will be the object + and A1 a NList_ConstructMessage struct pointer. + + SEE ALSO + MUIA_NList_ConstructHook + NList.mcc/MUIA_NList_CopyColumnToClipHook + + NAME + MUIA_NList_CopyColumnToClipHook -- [IS.], struct Hook * + + FUNCTION + This hook will be called while a MUIM_NList_CopyToClip + for each column string. You'll certainly get in entry + a string given by your own MUIA_NList_DisplayHook/2, so + you must not use the same buffer for both ! + + You'll get the entry num in -1 element of the given array, + elements 1 and 2 are the positions of the first selected + char and the last+1. + + You must return the pointer of the string to copy to + clipboard in element 0, a the string length in element 1. + + The builtin hook skip all ESC chars plus their next char + (and [...] for ESC-P, ESC-I, ESC-O and ESC-o), and add a + tab char between columns. + + SEE ALSO + MUIM_NList_CopyToClip, MUIA_NList_CopyEntryToClipHook, + MUIA_NList_DisplayHook + NList.mcc/MUIA_NList_CopyColumnToClipHook2 + + NAME + MUIA_NList_CopyColumnToClipHook2 -- [IS.], struct Hook * + + FUNCTION + Same function as MUIA_NList_CopyColumnToClipHook but A2 will be the object + and A1 a NList_CopyColumnToClipMessage struct pointer. + + SEE ALSO + MUIA_NList_CopyColumnToClipHook + NList.mcc/MUIA_NList_CopyEntryToClipHook + + NAME + MUIA_NList_CopyEntryToClipHook -- [IS.], struct Hook * + + FUNCTION + This work near like MUIA_NList_DisplayHook, execpt + that it is not called when the NList object want to + display its lines but when it want to copy them + to clipboard (or other). See MUIM_NList_CopyToClip. + + You can return only one string pointer (only one + column for copy), as element 0 of the array. + + The -1 element is the entry number only when + you don't give a entry pointer to NList_CopyToClip method, + else it's -1. + + Elements 1,2,3 and 4 of the given array are first column/pos + and last column/pos which are selected. + Elements 5 and 6 are 2, 1 or 0 when the 1th and 3rd pos are + in the format preparse string, the special entry preparse string + or in the normal string for that entry/columns. + + For column, -1 is the first and -2 the last, else it's its number. + This is the number of displayed columns and not the corresponding + entry in the array return by DisplayHook. Anyway, positions are + calculated from strings returned by DisplayHook. + + For pos, -1 is left of column and -2 its end. The last pos should + not be included. + + You should use MUIA_NList_CopyColumnToClipHook unless you don't + want to be copied what is seen in the list. + + SEE ALSO + MUIM_NList_CopyToClip, MUIA_NList_CopyColumnToClipHook, + MUIA_NList_DisplayHook + NList.mcc/MUIA_NList_CopyEntryToClipHook2 + + NAME + MUIA_NList_CopyEntryToClipHook2 -- [IS.], struct Hook * + + FUNCTION + Same function as MUIA_NList_CopyEntryToClipHook but A2 will be the object + and A1 a NList_CopyEntryToClipMessage struct pointer. + + SEE ALSO + MUIA_NList_CopyEntryToClipHook + NList.mcc/MUIA_NList_DefaultObjectOnClick + + NAME + MUIA_NList_DefaultObjectOnClick -- [ISG], BOOL + + FUNCTION + If set to TRUE, the NList object will become the + MUIA_Window_DefaultObject of its window when you + click on it, so the user will be able to control + the list with keys. The MUIA_Window_ActiveObject + will be set to None, unless the current active + object is the NList one itself or if it's the + MUIA_NList_KeepActive one. + + There is a special meaning if you use both + DefaultObjectOnClick and MUIA_NList_MakeActive. + (see MUIA_NList_MakeActive) + + DEFAULT + TRUE + + SEE ALSO + MUIA_NList_KeepActive,MUIA_NList_MakeActive + NList.mcc/MUIA_NList_DefClickColumn + + NAME + MUIA_NList_DefClickColumn -- [ISG], LONG + + FUNCTION + Same function as Listview.mui/MUIA_Listview_DefClickColumn. + + SEE ALSO + MUIA_Listview_DefClickColumn, MUIA_NList_ClickColumn + NList.mcc/MUIA_NList_DestructHook + + NAME + MUIA_NList_DestructHook -- [IS.], struct Hook * + + FUNCTION + Same function as List.mui/MUIA_List_DestructHook. + + SPECIAL INPUTS + MUIV_NList_DestructHook_String + + It's a builtin hook that free the string entry + previously allocated and copied by + the MUIV_NList_ConstructHook_String builtin hook. + + SEE ALSO + MUIA_NList_ConstructHook, MUIA_NList_DisplayHook + NList.mcc/MUIA_NList_DestructHook2 + + NAME + MUIA_NList_DestructHook2 -- [IS.], struct Hook * + + FUNCTION + Same function as MUIA_NList_DestructHook but A2 will be the object + and A1 a NList_DestructMessage struct pointer. + + SEE ALSO + MUIA_NList_DestructHook + NList.mcc/MUIA_NList_DisplayHook + + NAME + MUIA_NList_DisplayHook -- [IS.], struct Hook * + + FUNCTION + Same function as List.mui/MUIA_List_DisplayHook. + + Do not modify the buffers you return in the hook anywhere + else than in the hook when called by NList. + (if you do so you MUST set MUIA_NList_DisplayRecall) + + + You should return the same thing if its called another + time with the same inputs ! + The hook will be called with a pointer to the + entry to be displayed in A1 and a pointer to + a string array containing as many entries as + your list may have cols in A2. + You must fill this array with the strings that + you want to display. + The array is DISPLAY_ARRAY_MAX*2 large. + In the DISPLAY_ARRAY_MAX+col element you can set a + preparse string for the corresponding col element. + Using it you'll be able to avoid copying the string in + a buffer to add something in the beginning of the col + string. + + The display hook also gets the position of the current entry + as additional parameter. It is stored in the longword + preceding the col array (don't forget it's a LONG). + (setting that LONG value to -2 is another way to tell the object + to not consider the return string pointeur as valid next time + he will want to use it, and he will recall the hook). + + When the hook function will be called to get the title strings, + you'll get NULL in A1, and -1 as position of current entry. + + + The hook function will be called each time a line (or a part of + it) need to be drawn (and when NList need to compute lenght of + columns contents). + + + Here are the escape sequence known by the parsing of NList : + (If you use C, ESC b can be written "\033b") + + \t Tabulation. Go to the next tab boundary of the col. + tab positions are separated by 8 spaces by default. + ESC - Disable text engine, following chars will be printed + without further parsing. + ESC u Set the soft style to underline. + ESC b Set the soft style to bold. + ESC i Set the soft style to italic. + ESC n Set the soft style back to normal. + ESC Use pen number n (2..9) as front pen. n must be a valid + DrawInfo pen as specified in "intuition/screens.h". + ESC c Center current line. only valid at the beginning. + ESC r Right justify current line. only valid at the beginning. + ESC l Left justify current line. only valid at the beginning. + + These ones are new or modified : + + ESC j Justify left and right current line. only at beginning. + ESC I[] Draw MUI image with specification . + See Image.mui/MUIA_Image_Spec for image spec definition. + ESC O[

] (ESC O[||,]) + Draw the MUIM_NList_CreateImage at adress

. + (

should be an 8 hex digits number). + ESC o[] (ESC o[||,]) + Draw the MUIM_NList_UseImage number . If the UseImage + don't exist or has been set to NULL, no image is drawn. + ESC P[] Use default front pen. + ESC P[] Use pen number . (it's a direct pen number, so you must + make MUI_ObtainPen and MUI_ReleasePen for it yourself, + best to do it is in Setup() and Cleanup() of a subclass). + ESC T Draw horizontal line on top of the entry for the col. + ESC C Draw horizontal line centered in the entry for the col. + ESC B Draw horizontal line on bottom of the entry for the col. + ESC E Draw horizontal line centered in the entry for the col, + but only on the left and right of the line contents. + ESC t , ESC t[] , ESC t[M] , ESC t[I] + Make the ESC C and ESC E horizontal line become thick and filled + with some color : + default is MPEN_FILL. + [] means than is a direct pen color, like for ESC P[] + [M] means that is MUI pen color number (MPEN_xxx ie 0..8) + [I] means that is Intuition dri pen number 0..11 (see + "intuition/screens.h") + ESC t[N], ESC t[N], ESC t[NM], ESC t[NI] + Make the ESC T, ESC C,ESC B, ESC E become a single black line, + or not black when using a , M or I pen color. + ('N' is for Not thick ;) + + with ESC O[] and ESC o[], you can add [...@] which will make the image/object + act as a relverify button. When this "button" is released NList will notify + MUIA_NList_ButtonClick with the value . + + with ESC I[], ESC O[] and ESC o[], you can add [...|] or + [...||] or [...||,] or + [...,] where : + will be the width in pixels of the image/object. + -1 means default image width unless is set. + 0 means default image width. + will be the height in pixels of the image/object. + -1 means default image height (entry height is max). + 0 means entry height. + will be the min width in pixels before the next char/string/image. + when present, default height become entry height and + width become minwidth (if minwdith is bigger than image default + width), unless you set and/or . + and must be a decimal number (%ld). + + SEE ALSO + MUIA_NList_Format, MUIA_Text_Contents, MUIA_List_DisplayHook, + MUIA_NList_DisplayRecall + NList.mcc/MUIA_NList_DisplayHook2 + + NAME + MUIA_NList_DisplayHook2 -- [IS.], struct Hook * + + FUNCTION + Same function as MUIA_NList_DisplayHook but A2 will be the object + and A1 a NList_DisplayMessage struct pointer. + + SEE ALSO + MUIA_NList_DisplayHook + NList.mcc/MUIA_NList_DisplayRecall + + NAME + MUIA_NList_DisplayRecall -- [.S.], BOOL + + FUNCTION + If for some unusual reason you modify one of the buffer that + your DisplayHook function usually return anywhere else than + in the DisplayHook function when called by the NList object, + you must set it to TRUE, so the object will know it. + + SEE ALSO + MUIA_NList_DisplayHook + NList.mcc/MUIA_NList_DoubleClick + + NAME + MUIA_NList_DoubleClick -- [..GN], LONG + + FUNCTION + You'll get a notify on it each time the user double + clicks on an entry in the list, or on the title. + + The value is the entry number, which will be -1 when + it's the title. + + You'll get a notify on it too when you press the 'return' key + and the NList object is active or default. + + If you get() it, you'll get the last click position, which + can be -2 if it was on nothing (ie not entry or title). + + For triple clicks and more, use MUIA_NList_MultiClick. + + NOTE + Disabled for the title when MUIA_NList_TitleClick is used. + + SEE ALSO + MUIA_NList_MultiClick, MUIA_NList_TitleClick, + MUIA_NList_EntryClick, MUIM_NList_TestPos. + NList.mcc/MUIA_NList_DragColOnly + + NAME + MUIA_NList_DragColOnly -- [ISG], LONG + + FUNCTION + When set to a col number (displayhook col number, not the visible + one), only the text of that col for the selected entry will + be dragged instead of the visible part of the entry. + + Set it to -1 to come back to standard/default mode when you have + changed it ! + NList.mcc/MUIA_NList_DragSortable + + NAME + MUIA_NList_DragSortable -- [ISG], BOOL + + FUNCTION + Same function as List.mui/MUIA_List_DragSortable. + + DragType will be MUIV_NList_DragType_Default unless you set it. + + No need for you to set MUIA_Dropable or MUIA_Draggable. + + DEFAULT + FALSE + NList.mcc/MUIA_NList_DragSortInsert + + NAME + MUIA_NList_DragSortInsert -- [..GN], BOOL + + FUNCTION + Same as MUIA_NList_InsertPosition but the notify is made only after + a MUIA_NList_DragSortable move. + NList.mcc/MUIA_NList_DragType + + NAME + MUIA_NList_DragType -- [ISG], LONG + + SPECIAL INPUTS + MUIV_NList_DragType_None no drag + MUIV_NList_DragType_Default as set in prefs. + MUIV_NList_DragType_Immediate drag on borders and with qualifier, and + immediate drag if non-multiselect mode. + MUIV_NList_DragType_Borders drag on borders and with qualifier. + MUIV_NList_DragType_Qualifier drag only using qualifier. + + FUNCTION + Same function as Listview.mui/MUIA_Listview_DragType. + + If you want the user to be able to drag items out of + your list, you must set this. + Don't use MUIA_Draggable with NList or NListview. + NList.mcc/MUIA_NList_DropMark + + NAME + MUIA_NList_DropMark -- [..G], LONG + + FUNCTION + Same function as List.mui/MUIA_List_DropMark. + + After a successfull drop operation, this attribute holds + the position where we should insert the new entry(ies). + + SEE ALSO + MUIA_NList_DropType, MUIM_NList_DropType, MUIM_NList_DropDraw + NList.mcc/MUIA_NList_DropType + + NAME + MUIA_NList_DropType -- [..G], LONG + + FUNCTION + Same function as MUIA_NList_DropMark but will return the + current DropMark type instead of the DropMark entry number. + + After a successfull drop operation, this attribute holds + the type of dropmark which where drawn. + + SEE ALSO + MUIA_NList_DropMark, MUIM_NList_DropType, MUIM_NList_DropDraw + NList.mcc/MUIA_NList_Entries + + NAME + MUIA_NList_Entries -- [..GN], LONG + + FUNCTION + Same function as List.mui/MUIA_List_Entries. + + SEE ALSO + MUIA_NList_First, MUIA_NList_Visible, MUIA_NList_Active + NList.mcc/MUIA_NList_EntryClick + + NAME + MUIA_NList_EntryClick -- [..GN], LONG + + FUNCTION + You'll get a notify on it each time the user click + on an entry in the list (on the title, use + MUIA_NList_TitleClick for that). + + The value is the entry number. + + You'll get a notify on it too when you press the 'return' key + and the NList object is active or default, but only if there + is no notify asked on MUIA_NList_DoubleClick. + + If you get() it, you'll get the last click position, which + can be -1 when on title and -2 if it was on nothing. + + SEE ALSO + MUIA_NList_MultiClick, MUIA_NList_TitleClick, + MUIA_NList_DoubleClick, MUIM_NList_TestPos. + NList.mcc/MUIA_NList_EntryValueDependent + + NAME + MUIA_NList_EntryValueDependent -- [ISG], BOOL + + FUNCTION + If your display hook return different strings when the + entry num value change for a identical entry pointer + then you should set it. + + DEFAULT + FALSE + + SEE ALSO + MUIA_NList_DisplayHook + NList.mcc/MUIA_NList_Exports + + NAME + MUIA_NList_Exports -- [ISG], LONG + + FUNCTION + Tell the NList object what parts of it's state will have to + be saved in MUIM_Export method (which is called by the + MUIM_Application_Save method if the object has a ObjectID). + + SPECIAL INPUTS + MUIV_NList_Exports_Active save active entry number. + MUIV_NList_Exports_Selected save selected entries numbers. + MUIV_NList_Exports_First save first visible entry number. + MUIV_NList_Exports_ColWidth save widths of columns. + MUIV_NList_Exports_ColOrder save order of columns. + MUIV_NList_Exports_Cols save all about columns (width and order actually). + MUIV_NList_Exports_All + + NOTE + MUIV_NList_Exports_Selected can make a very long export (so a big program + .cfg file) if the list has many selected entries. It take one long int + (ie 4 bytes) for each selected entry... + + Active and First are always exported by the MUIM_Export method, + having MUIV_NList_Exports_Active and MUIV_NList_Exports_First set or not. + + DEFAULT + (MUIV_NList_Exports_Active | MUIV_NList_Exports_First | MUIV_NList_Exports_Cols) + + SEE ALSO + MUIA_NList_Imports + NList.mcc/MUIA_NList_First + + NAME + MUIA_NList_First -- [ISGN], LONG + + SPECIAL INPUTS + MUIV_NList_First_Top + MUIV_NList_First_Bottom + MUIV_NList_First_Up + MUIV_NList_First_Down + MUIV_NList_First_PageUp + MUIV_NList_First_PageDown + + FUNCTION + Get the number of the first visible entry. + You can set it to change the first entry you want to be visible. + + SEE ALSO + MUIA_NList_Visible, MUIA_NList_Entries, MUIA_NList_Active + NList.mcc/MUIA_NList_ForcePen + + NAME + MUIA_NList_ForcePen -- [ISG], LONG + + SPECIAL INPUTS + MUIV_NList_ForcePen_On + MUIV_NList_ForcePen_Off + MUIV_NList_ForcePen_Default + + FUNCTION + Set the ForcePen mode, when on it force the 'selected pen' color + in all the selected area. Else the color is forced only at the + beginning of the area and can be changed by text escape sequences. + + The default is set by the user in the pref .mcp class. + + Getting in will give its current value. + NList.mcc/MUIA_NList_Format + + NAME + MUIA_NList_Format -- [ISG], STRPTR + + FUNCTION + NList is able to handle multi column lists. To define + how many columns should be displayed and how they + should be formatted, you specify a format string. + + This format string must contain one entry for each column + you want to see. Entries are seperated by commas, one + entry is parsed via dos.library/ReadArgs(). + + The template for a single entry looks like this: + + DELTA=D/N,PREPARSE=P/K,COL=C/N,BAR/S,TBAR/S,NOBAR=NB/S, + SIMPLEBAR=SBAR/S,NOTITLEBUTTON=NOTB/S, + WEIGHT=W/N,MINWIDTH=MIW/N,MAXWIDTH=MAW/N, + COLWIDTH=CW/N,MINCOLWIDTH=MICW/N,MAXCOLWIDTH=MACW/N, + PIXWIDTH=PW/N,MINPIXWIDTH=MIPW/N,MAXPIXWIDTH=MAPW/N, + PARTCOLSUBST=PCS/K + + First ones are like (or nearly) MUIA_List_Format ones : + + DELTA + Space in pixel between this column and the next. + the last displayed column ignores this setting. + Defaults to 4. + + PREPARSE + A preparse string for this column. + + COL + This value adjusts the col number of the current column. + Defaults to current column number (0,1,...) + You can't use identical COL values for 2 or more columns. + + BAR + Will draw a vertical bar between this and the next column. + + WEIGHT + The weight of the column. As for MUI's group. + + MINWIDTH + Minimum percentage of the list width for the current column. + + MAXWIDTH + Maximum percentage of the list width for the current column. + + TBAR + Will draw a vertical bar between this and the next column + but only in the title (ignored if BAR is set). + THIS IS A DEFAULT ! + + NOBAR + Don't draw a vertical bar between this and the next column at all. + + SIMPLEBAR + Make te vertical bar a simple black one. + + NOTITLEBUTTON + Will prevent the title of the column to act as a relverify + button when you set MUIA_NList_TitleClick (or make a notify + on it). + + COLWIDTH + Wanted number of chars for the current column. + You will get as PIXWIDTH with number*font_with. + Possibly more than number chars will fit in the + column if you use proportional font, anyway you + are sure than number non italic chars will fit. + + MINCOLWIDTH + Minimum number of chars for the current column. + + MAXCOLWIDTH + Maximum number of chars for the current column. + + PIXWIDTH + Wanted number of chars for the current column. + + MINPIXWIDTH + Minimum number of chars for the current column. + + MAXPIXWIDTH + Maximum number of chars for the current column. + + PARTCOLSUBST + If the partial column feature is turned on by the + user (in his configuration) and the application + developer has specified this option for a particular + column, then a "..." text is displayed at the + defined position if not all text fits into the + column rather than showing a dotted vertical line + at the end of the column. Possible values for + this option are: + + DISABLED + explicitly disables this feature for this + column + + LEFT + put "..." on the left side and strip text + left aligned. + + CENTER + put "..." at the center of the column and + strip text on both sides around it. + + RIGHT + put "..." on the right side and strip text + right aligned. + + + Note: You will have as many columns in your list as + entries in the format string (i.e. number of + commas + 1). Empty entries, e.g. with a format + string of ",,,," are perfectly ok. + + MINPIXWIDTH, MAXPIXWIDTH, MINCOLWIDTH, MAXCOLWIDTH, + MINWIDTH and MAXWIDTH will not be used if PIXWIDTH, + or COLWIDTH is used. + + Only one of PIXWIDTH, COLWIDTH and WEIGHT will be + used, the first find in this order. + Biggest of MINPIXWIDTH, MINCOLWIDTH and MINWIDTH. + Smallest of MAXPIXWIDTH, MAXCOLWIDTH and MAXWIDTH. + If the min is bigger than the max the min will be used. + + You should used PIX ones only for columns with images, + and COL ones when you want to be sure to get as many + chars you want. + + All chars/images will be drawn for the last column + always, you should specify some width for it anyway + as it will be used for centered and right aligned texts ! + + Default values : WEIGHT=-1, MINWIDTH=5, MAXWIDTH=10000. + + Use MINWIDTH=0 if you don't use PIXWIDTH or COLWIDTH and + don't want any min value. + + If you want to use WEIGHT values as percentage of the list + width, just choose them to have their total being 100. + + WEIGHT = -1 mean that you want the column to have + the width of the largest entry's column contents. + MINWIDTH = -1 have the same meaning as for WEIGHT but for + the min value. + Default will be 100 for the last column, set it to -1 or + -2 if you want to force it when more than one column, and + to -2 to force it when only one column. + + Be aware that it can take long time to do that when there + are many entries since this need a call to the dislpayhook, + parse and find real length of all entries. + Anyway using such stuff for one or more column has the + same overhead. + + The default list format is an empty string (""), this + means a one column list without special formatting. + + NOTE + Actually MUIA_NList_Format will not try to see if the new + format is similar to previous one. It means that all + column width will be re-computed (and all entries parsed + if WEIGHT or MINWIDTH is -1), same for wrapping + which will be recomputed for all entries. + So, it's better to do it before inserting entries + if you want to do both. + If you want to clear, insert, and set the format, the + best is to set the format after the clear (fastest, no + entry to parse) and before the insert. + + BUGS (FEATURE) + Currently there is a maximum of 64 columns for a list. + + SEE ALSO + MUIA_NList_DisplayHook, MUIA_NList_TitleSeparator. + NList.mcc/MUIA_NList_Horiz_DeltaFactor + + NAME + MUIA_NList_Horiz_DeltaFactor -- [..GN], LONG + + FUNCTION + Used for NListview. You can make a notification on it + if you want to attach your own horizontal scrollbar + and set the increment value of scrollbar's arrows : + + DoMethod(NLobj, MUIM_Notify, MUIA_NList_Horiz_DeltaFactor,MUIV_EveryTime, + SBobj, 3, MUIM_Set,MUIA_Prop_DeltaFactor,MUIV_TriggerValue); + + SEE ALSO + MUIA_NList_Horiz_Entries, MUIA_NList_Horiz_First, MUIA_NList_Horiz_Visible + NList.mcc/MUIA_NList_Horiz_Entries + + NAME + MUIA_NList_Horiz_Entries -- [..GN], LONG + + FUNCTION + Used for NListview. You can make a notification on it + if you want to attach your own horizontal scrollbar : + + DoMethod(NLobj, MUIM_Notify, MUIA_NList_Horiz_Entries,MUIV_EveryTime, + SBobj, 3, MUIM_Set,MUIA_Prop_Entries,MUIV_TriggerValue); + + SEE ALSO + MUIA_NList_Horiz_DeltaFactor, MUIA_NList_Horiz_First, MUIA_NList_Horiz_Visible + NList.mcc/MUIA_NList_Horiz_First + + NAME + MUIA_NList_Horiz_First -- [.SGN], LONG + + FUNCTION + Used for NListview. You can make a notification on it + if you want to attach your own horizontal scrollbar : + + DoMethod(NLobj, MUIM_Notify, MUIA_NList_Horiz_First,MUIV_EveryTime, + SBobj, 3, MUIM_NoNotifySet,MUIA_Prop_First,MUIV_TriggerValue); + DoMethod(SBobj, MUIM_Notify, MUIA_Prop_First,MUIV_EveryTime, + NLobj, 3, MUIM_NoNotifySet,MUIA_NList_Horiz_First,MUIV_TriggerValue); + + SEE ALSO + MUIA_NList_Horiz_DeltaFactor, MUIA_NList_Horiz_Entries, MUIA_NList_Horiz_Visible + NList.mcc/MUIA_NList_Horiz_Visible + + NAME + MUIA_NList_Horiz_Visible -- [..GN], LONG + + FUNCTION + Used for NListview. You can make a notification on it + if you want to attach your own horizontal scrollbar : + + DoMethod(NLobj, MUIM_Notify, MUIA_NList_Horiz_Visible,MUIV_EveryTime, + SBobj, 3, MUIM_NoNotifySet,MUIA_Prop_Visible,MUIV_TriggerValue); + + SEE ALSO + MUIA_NList_Horiz_DeltaFactor, MUIA_NList_Horiz_Entries, MUIA_NList_Horiz_First + NList.mcc/MUIA_NList_IgnoreSpecialChars + + NAME + MUIA_NList_IgnoreSpecialChars -- [ISG], const char * + + FUNCTION + Used to let NList ignore a list of user definable characters during + string parsing. Some greek fonts need the 0xA0 character to display + an Alpha characters. In this case the string "\xa0" should be supplied + to make NList ignore this character and not treat 0xA0 as a "non + breaking space". + This string will *NOT* be copied by NList and must remain valid as long + as the object exists! + + DEFAULT + NULL + NList.mcc/MUIA_NList_Imports + + NAME + MUIA_NList_Imports -- [ISG], LONG + + FUNCTION + Tell the NList object what parts of it's state must be loaded + (and used) in MUIM_Import method (which is called by the + MUIM_Application_Load method if the object has a ObjectID). + + SPECIAL INPUTS + MUIV_NList_Imports_Active load previous active entry number (and make it active). + MUIV_NList_Imports_Selected load previous selected entries numbers (and make them selected). + MUIV_NList_Imports_First load previous first visible entry number (and make it the first visible). + MUIV_NList_Imports_ColWidth load previous widths of columns (and set them). + MUIV_NList_Imports_ColOrder load previous order of columns (and set it). + MUIV_NList_Imports_Cols load all about columns (width and order actually). + MUIV_NList_Imports_All + + DEFAULT + (MUIV_NList_Imports_Active | MUIV_NList_Imports_First | MUIV_NList_Imports_Cols) + + SEE ALSO + MUIA_NList_Exports + NList.mcc/MUIA_NList_Input + + NAME + MUIA_NList_Input -- [ISG], BOOL + + FUNCTION + Same function as NListview.mcc/MUIA_Listview_Input. + + DEFAULT + TRUE + + SEE ALSO + MUIA_NList_MultiSelect + NList.mcc/MUIA_NList_InsertPosition + + NAME + MUIA_NList_InsertPosition -- [..GN], LONG + + FUNCTION + Same function as List.mui/MUIA_List_InsertPosition. + + NList.mcc/MUIA_NList_KeepActive + + NAME + MUIA_NList_KeepActive -- [.S.], Obj * + + FUNCTION + Usefull when MUIA_NList_DefaultObjectOnClick if you + don't want the specified object to be desactivated. + A NListview object set it to it's NList child at + creation time, so you should not have to use that tag. + + SEE ALSO + MUIA_NList_DefaultObjectOnClick,MUIA_NList_MakeActive + NList.mcc/MUIA_NList_KeyUpFocus + + NAME + MUIA_NList_KeyUpFocus -- [ISG], Object * + + FUNCTION + Allows to specify a specific object that will be set as the new + window's active object in case the user pressed the UP cursor key + and the NList object itself doesn't have anything further to + scroll up. + + SEE ALSO + MUIA_NList_KeyDownFocus + MUIA_NList_KeyLeftFocus + MUIA_NList_KeyRightFocus + + NList.mcc/MUIA_NList_KeyDownFocus + + NAME + MUIA_NList_KeyDownFocus -- [ISG], Object * + + FUNCTION + Allows to specify a specific object that will be set as the new + window's active object in case the user pressed the DOWN cursor key + and the NList object itself doesn't have anything further to + scroll down. + + SEE ALSO + MUIA_NList_KeyUpFocus + MUIA_NList_KeyLeftFocus + MUIA_NList_KeyRightFocus + + NList.mcc/MUIA_NList_KeyLeftFocus + + NAME + MUIA_NList_KeyLeftFocus -- [ISG], Object * + + FUNCTION + Allows to specify a specific object that will be set as the new + window's active object in case the user pressed the LEFT cursor key + and the NList object itself doesn't have anything further to + scroll to the left. + + SEE ALSO + MUIA_NList_KeyUpFocus + MUIA_NList_KeyDownFocus + MUIA_NList_KeyRightFocus + + NList.mcc/MUIA_NList_KeyRightFocus + + NAME + MUIA_NList_KeyRightFocus -- [ISG], Object * + + FUNCTION + Allows to specify a specific object that will be set as the new + window's active object in case the user pressed the RIGHT cursor key + and the NList object itself doesn't have anything further to + scroll to the right. + + SEE ALSO + MUIA_NList_KeyUpFocus + MUIA_NList_KeyDownFocus + MUIA_NList_KeyLeftFocus + + NList.mcc/MUIA_NList_LineHeight + + NAME + MUIA_NList_LineHeight -- [..GN], LONG + + FUNCTION + Get the current line height. + NList.mcc/MUIA_NList_MakeActive + + NAME + MUIA_NList_MakeActive -- [.S.], Obj * + + FUNCTION + Use it if you want an object to be activated when you click + in the list object. + If you want to be able to control the list with key, you + should use MUIA_NList_DefaultObjectOnClick instead. + + If you use both MUIA_NList_MakeActive and + MUIA_NList_DefaultObjectOnClick then the specified object + will be activated only if there is already an active one. + + The only object which should be set should be the NListview + parent object of the current NList one. + + SEE ALSO + MUIA_NList_DefaultObjectOnClick,MUIA_NList_KeepActive + NList.mcc/MUIA_NList_MinColSortable + + NAME + MUIA_NList_MinColSortable -- [ISG], LONG + + FUNCTION + Sets the number of the first visible column which + can be sorted, ie exchanged with some other one. + + Default is 1, making the leftmost (0) column not sortable. + + Just set it to a big number (100 for example) to forbid + the columns sorting. + NList.mcc/MUIA_NList_MinLineHeight + + NAME + MUIA_NList_MinLineHeight -- [IS.], LONG + + FUNCTION + Same function as List.mui/MUIA_List_MinLineHeight. + + Sets the minimum line height for lists in pixels. + + If <= 0 then it's absolute value will replace the + 'Leading' value of prefs which is added to the + font height. + + It seems that original MUIA_List_MinLineHeight use + its positive value as a 'leading' one, which is not + logical when i read its doc (!), so i do the + change internally to get it works like with list... + NList.mcc/MUIA_NList_MultiClick + + NAME + MUIA_NList_MultiClick -- [..GN], LONG + + FUNCTION + You'll get a notify on it each time the user + multiclicks more than 2 times on an entry in the + list, or on the title. You'll get the number of + the click (3, 4, 5...) for each. Note that you'll + not get MUIA_NList_MultiClick for a double click; + you must use MUIA_NList_DoubleClick for that. + The time between each click must be less or equal + to the double click time set in Amiga Input prefs. + + You can know on which entry the multiclick was made + getting MUIA_NList_DoubleClick value. + + So you can make a notification on it. + + NOTE + Disabled for the title when MUIA_NList_TitleClick is used. + + SEE ALSO + MUIA_NList_MultiClickAlone, MUIA_NList_DoubleClick, MUIA_NList_TitleClick, + MUIA_NList_EntryClick, MUIM_NList_TestPos. + NList.mcc/MUIA_NList_MultiClickAlone + + NAME + MUIA_NList_MultiClickAlone -- [..GN], LONG + + FUNCTION + You'll get a notify only for the final multiclick number, + so if there are 3 clicks there will be only one multiclickalone + notified, a little (max time between 2 clicks) after the 3rd one. + It is the major change with classic MUIA_NList_DoubleClick and + MUIA_NList_MultiClick which do the notify for all clicks. + + The drawback is the unavoidable delay between the last click + and the notify. + + You can know on which entry the multiclickalone was made + getting MUIA_NList_DoubleClick value. + + You can make a notification on it. + + SEE ALSO + MUIA_NList_MultiClick, MUIA_NList_DoubleClick, MUIA_NList_TitleClick, + MUIA_NList_EntryClick, MUIM_NList_TestPos. + NList.mcc/MUIA_NList_MultiSelect + + NAME + MUIA_NList_MultiSelect -- (V7 ) [I..], LONG + + SPECIAL INPUTS + MUIV_NList_MultiSelect_None + MUIV_NList_MultiSelect_Default + MUIV_NList_MultiSelect_Shifted + MUIV_NList_MultiSelect_Always + + FUNCTION + Same function as Listview.mui/MUIA_Listview_MultiSelect. + + < At the moment MultiSelect_Default is the same + as MultiSelect_Shifted > + + SEE ALSO + MUIA_NList_MultiTestHook + NList.mcc/MUIA_NList_MultiTestHook + + NAME + MUIA_NList_MultiTestHook -- [IS.], struct Hook * + + FUNCTION + Same function as List.mui/MUIA_List_MultiTestHook. + + SEE ALSO + MUIA_NList_ConstructHook, MUIA_NList_DestructHook + NList.mcc/MUIA_NList_Pool + + NAME + MUIA_NList_Pool -- [I..], APTR + + FUNCTION + Same function as List.mui/MUIA_List_Pool. + + SEE ALSO + MUIA_NList_PoolPuddleSize, MUIA_NList_PoolThreshSize + NList.mcc/MUIA_NList_PoolPuddleSize + + NAME + MUIA_NList_PoolPuddleSize -- [I..], ULONG + + FUNCTION + Same function as List.mui/MUIA_List_PoolPuddleSize. + + SEE ALSO + MUIA_NList_PoolThreshSize, MUIA_NList_Pool + NList.mcc/MUIA_NList_PoolThreshSize + + NAME + MUIA_NList_PoolThreshSize -- [I..], ULONG + + FUNCTION + Same function as List.mui/MUIA_List_PoolThreshSize. + + SEE ALSO + MUIA_NList_PoolPuddleSize, MUIA_NList_Pool + NList.mcc/MUIA_NList_PrivateData + + NAME + MUIA_NList_PrivateData -- [ISG], APTR + + FUNCTION + It's a private data of the object that is unused by NList. + You can use it as you want, as for MUIA_UserData. + + SEE ALSO + MUIA_NList_DisplayHook, MUIA_NList_CopyEntryToClipHook, + MUIA_NList_CopyColumnToClipHook + NList.mcc/MUIA_NList_Prop_DeltaFactor + + NAME + MUIA_NList_Prop_DeltaFactor -- [..GN], LONG + + FUNCTION + Used for NListview. You can make a notification on it + if you want to attach your own vertical scrollbar + and set the increment value of scrollbar's arrows : + + DoMethod(NLobj, MUIM_Notify, MUIA_NList_Prop_DeltaFactor,MUIV_EveryTime, + SBobj, 3, MUIM_Set,MUIA_Prop_DeltaFactor,MUIV_TriggerValue); + + SEE ALSO + MUIA_NList_Prop_Entries, MUIA_NList_Prop_First, MUIA_NList_Prop_Visible + NList.mcc/MUIA_NList_Prop_Entries + + NAME + MUIA_NList_Prop_Entries -- [..GN], LONG + + FUNCTION + Used for NListview. You can make a notification on it + if you want to attach your own vertical scrollbar : + + DoMethod(NLobj, MUIM_Notify, MUIA_NList_Prop_Entries,MUIV_EveryTime, + SBobj, 3, MUIM_NoNotifySet,MUIA_Prop_Entries,MUIV_TriggerValue); + + SEE ALSO + MUIA_NList_Prop_DeltaFactor, MUIA_NList_Prop_First, MUIA_NList_Prop_Visible + NList.mcc/MUIA_NList_Prop_First + + NAME + MUIA_NList_Prop_First -- [.SGN], LONG + + FUNCTION + Used for NListview. You can make a notification on it + if you want to attach your own vertical scrollbar : + + DoMethod(NLobj, MUIM_Notify, MUIA_Prop_First,MUIV_EveryTime, + SBobj, 3, MUIM_Set,MUIA_Prop_First,MUIV_TriggerValue); + DoMethod(SBobj, MUIM_Notify, MUIA_Prop_First,MUIV_EveryTime, + NLobj, 3, MUIM_Set,MUIA_Prop_First,MUIV_TriggerValue); + + SEE ALSO + MUIA_NList_Prop_DeltaFactor, MUIA_NList_Prop_Entries, MUIA_NList_Prop_Visible + NList.mcc/MUIA_NList_Prop_Visible + + NAME + MUIA_NList_Prop_Visible -- [..GN], LONG + + FUNCTION + Used for NListview. You can make a notification on it + if you want to attach your own vertical scrollbar : + + DoMethod(NLobj, MUIM_Notify, MUIA_NList_Prop_Visible,MUIV_EveryTime, + SBobj, 3, MUIM_NoNotifySet,MUIA_Prop_Visible,MUIV_TriggerValue); + + SEE ALSO + MUIA_NList_Prop_DeltaFactor, MUIA_NList_Prop_Entries, MUIA_NList_Prop_First + NList.mcc/MUIA_NList_Quiet + + NAME + MUIA_NList_Quiet -- [.S.], BOOL + + FUNCTION + Same function as List.mui/MUIA_List_Quiet. + + Think about using it when you insert/remove several entries + one by one, it will go much faster. + In all cases all changes which can be done later are delayed. + Quiet_Full mean that no notify caused by changes in the list will + be made, while Quiet_Visual will done them (but delayed to after + the Quiet_None). + + SPECIAL INPUTS + MUIV_NList_Quiet_None same as FALSE. + MUIV_NList_Quiet_Full all values but FALSE and MUIV_NList_Quiet_Visual (-2). + MUIV_NList_Quiet_Visual + + SEE ALSO + MUIM_NList_Insert, MUIM_NList_Remove + NList.mcc/MUIA_NList_SelectChange + + NAME + MUIA_NList_SelectChange -- [...N], BOOL + + FUNCTION + Same function as Listview.mui/MUIA_Listview_SelectChange. + + A set(NLobj,MUIA_NList_SelectChange,TRUE) is made by NList + whenever the selection state of one or more items in the + list is changing. + + DEFAULT + FALSE + + SEE ALSO + MUIA_NList_MultiSelect + NList.mcc/MUIA_NList_ShowDropMarks + + NAME + MUIA_NList_ShowDropMarks -- [ISG], BOOL + + FUNCTION + Same function as List.mui/MUIA_List_ShowDropMarks. + + DEFAULT + FALSE + + SEE ALSO + MUIA_NList_DropMark + NList.mcc/MUIA_NList_SkipChars + + NAME + MUIA_NList_SkipChars -- [ISG], char * + + FUNCTION + Same function as Floattext.mui/MUIA_Floattext_SkipChars. + NList.mcc/MUIA_NList_SortType + + NAME + MUIA_NList_SortType -- [ISGN], LONG + + FUNCTION + This value will be set in the NList_CompareMessage struct + of MUIA_NList_CompareHook2 hook function. + + It is set by MUIM_NList_Sort2 and MUIM_NList_Sort3 methods too. + + EXAMPLES + See NList-Demo program. + + SEE ALSO + MUIA_NList_CompareHook2, MUIM_NList_Sort2, MUIM_NList_Sort3, MUIA_NList_SortType2 + NList.mcc/MUIA_NList_SortType2 + + NAME + MUIA_NList_SortType2 -- [ISGN], LONG + + FUNCTION + This value will be set in the NList_CompareMessage struct + of MUIA_NList_CompareHook2 hook function. + + It is set by MUIM_NList_Sort3 method too. + + EXAMPLES + See NList-Demo program. + + SEE ALSO + MUIA_NList_CompareHook2, MUIM_NList_Sort2, MUIM_NList_Sort3, MUIA_NList_SortType + NList.mcc/MUIA_NList_SourceArray + + NAME + MUIA_NList_SourceArray -- [I..], APTR + + FUNCTION + Same function as List.mui/MUIA_List_SourceArray. + NList.mcc/MUIA_NList_SourceInsert + + NAME + MUIA_NList_SourceInsert -- [I..], struct MUIP_NList_InsertWrap * + + FUNCTION + Same as DoMethod(obj,MUIM_NList_InsertWrap,...) + with ... same as the contents of the passed struct, + but at init. + + SEE ALSO + MUIM_NList_InsertWrap + NList.mcc/MUIA_NList_SourceString + + NAME + MUIA_NList_SourceString -- [I..], char * + + FUNCTION + Same as + DoMethod(obj,MUIM_List_Insert,string,-2,MUIV_NList_Insert_Bottom) + but at init. + + SEE ALSO + MUIM_List_Insert + NList.mcc/MUIA_NList_TabSize + + NAME + MUIA_NList_TabSize -- [ISG], ULONG + + FUNCTION + Same function as Floattext.mui/MUIA_Floattext_TabSize. + + Set how many spaces is the tabulation. + + Default is 8. + NList.mcc/MUIA_NList_Title + + NAME + MUIA_NList_Title -- [ISG], char * + + FUNCTION + Same function as List.mui/MUIA_List_Title. + + The title will be redraw each time you set it. + + When you use a display hook, its value is used as a BOOL/LONG + which can have any value (just not NULL if you want to see it). + + The value returned by get() will be the same than the last one + given in the set() or at init. + + SEE ALSO + MUIA_NList_DisplayHook, MUIA_NList_TitleSeparator + NList.mcc/MUIA_NList_TitleClick + + NAME + MUIA_NList_TitleClick -- [ISGN], LONG + + FUNCTION + You'll get a notify on it each time the user + clicks one the title (only if on a column, so not on the + vertical bar column separator which is used to modify the + column width with mouse). + + The returned value is the col number (display hook col number). + + If you get that value later, it will still be the latest + *title* click col that you'll get. + + If you ask for a notify on that tag, or if you set it (with any + value) the title will act as if each of its column titles were + separated buttons, notifying that tag when there are released. + + The (released) look for those title "buttons" will be better + if you use MUIA_NList_TitleSeparator and BAR or TBAR for each + column in the MUIA_NList_Format string. + + There is no shortkeys for these custom buttons and never be, + so think to give another way to access the related stuffs. + + Don't ask for customized frames for them : there are not real + MUI and separated buttons but directly handled by NList, and i + found it nice as is. + + NOTE + When you use MUIA_NList_TitleClick, you'll not receive + MUIA_NList_DoubleClick and MUIA_NList_MultiClick when clicking + on the title any more. + + EXAMPLES + See NList-Demo program. + + SEE ALSO + MUIA_NList_TitleMark, MUIA_NList_TitleMark2, MUIA_NList_SortType, + MUIA_NList_SortType2, MUIM_NList_Sort3, MUIA_NList_TitleClick, + MUIA_NList_TitleClick2. + NList.mcc/MUIA_NList_TitleClick2 + + NAME + MUIA_NList_TitleClick2 -- [ISGN], LONG + + FUNCTION + Works like MUIA_NList_TitleClick but when the qualifier is press while clicking + + EXAMPLES + See NList-Demo program. + + SEE ALSO + MUIA_NList_TitleClick, MUIA_NList_TitleMark, MUIA_NList_TitleMark2 + NList.mcc/MUIA_NList_TitleMark + + NAME + MUIA_NList_TitleMark -- [ISG], LONG + + FUNCTION + Draw a mark on the corresponding display hook column. + + The value give 2 informations : the column and the type of mark. + + Usually set to the MUIA_NList_SortType value (which is set by + MUIM_NList_Sort3, this one called from a MUIA_NList_TitleClick notify). + + SPECIAL INPUTS + MUIV_NList_TitleMark_None + MUIV_NList_TitleMark_Down | col + MUIV_NList_TitleMark_Up | col + MUIV_NList_TitleMark_Box | col + MUIV_NList_TitleMark_Circle | col + + EXAMPLES + See NList-Demo program. + + SEE ALSO + MUIA_NList_TitleMark2, MUIA_NList_SortType, MUIA_NList_SortType2, MUIM_NList_Sort3, + MUIA_NList_TitleClick, MUIA_NList_TitleClick2 + NList.mcc/MUIA_NList_TitleMark2 + + NAME + MUIA_NList_TitleMark2 -- [ISG], LONG + + FUNCTION + Draw a secondary mark on the corresponding display hook column. + + The value give 2 informations : the column and the type of mark. + + Usually set to the MUIA_NList_SortType2 value (which is set by + MUIM_NList_Sort3, this one called from a MUIA_NList_TitleClick/2 notify). + + SPECIAL INPUTS + MUIV_NList_TitleMark2_None + MUIV_NList_TitleMark2_Down | col + MUIV_NList_TitleMark2_Up | col + MUIV_NList_TitleMark2_Box | col + MUIV_NList_TitleMark2_Circle | col + + EXAMPLES + See NList-Demo program. + + SEE ALSO + MUIA_NList_TitleMark, MUIA_NList_SortType, MUIA_NList_SortType2, MUIM_NList_Sort3, + MUIA_NList_TitleClick, MUIA_NList_TitleClick2 + NList.mcc/MUIA_NList_TitleSeparator + + NAME + MUIA_NList_TitleSeparator -- [ISG], BOOL + + FUNCTION + If you set it, you get an horizontal bar between the + title and the first visible entry (only when some title + is visible). + + DEFAULT + TRUE + + SEE ALSO + MUIA_NList_Title + NList.mcc/MUIA_NList_TypeSelect + + NAME + MUIA_NList_TypeSelect -- [IS.], LONG + + SPECIAL INPUTS + MUIV_NList_TypeSelect_Line + MUIV_NList_TypeSelect_Char + + FUNCTION + Setting this tag you can choose between the classic + list selection by line, or using a char precision + selection. + + This should be used only for textviewer like stuff, + and never for standard lists. + Anyway its the only way to make direct copytoclip + of a part of a line... + + Default is MUIV_NList_TypeSelect_Line of course. + + SEE ALSO + MUIM_NList_Select, MUIM_List_Select + NList.mcc/MUIA_NList_Visible + + NAME + MUIA_NList_Visible -- [..G], LONG + + FUNCTION + Same function as List.mui/MUIA_List_Visible. + + SEE ALSO + MUIA_NList_First, MUIA_NList_Entries, MUIA_NList_Active + NList.mcc/MUIA_NList_XXXBackground + + NAME + MUIA_NList_TitleBackground -- [ISG], LONG + MUIA_NList_ListBackground -- [ISG], LONG + MUIA_NList_SelectBackground -- [ISG], LONG + MUIA_NList_CursorBackground -- [ISG], LONG + MUIA_NList_UnselCurBackground -- [ISG], LONG + + FUNCTION + You can set all backgroungs of NList with these attributes, + look at Area.mui/MUIA_Background and Image.mui/MUIA_Image_Spec + to see what kind of value can be used. + Anyway, you can set the defaults with prefs and so should + not set it yourself. + NList.mcc/MUIA_NList_XXXPen + + NAME + MUIA_NList_TitlePen -- [ISG], LONG + MUIA_NList_ListPen -- [ISG], LONG + MUIA_NList_SelectPen -- [ISG], LONG + MUIA_NList_CursorPen -- [ISG], LONG + MUIA_NList_UnselCurPen -- [ISG], LONG + + FUNCTION + You can set all pens of NList with these attributes, their + value must be of the type Pendisplay.mui/MUIA_Pendisplay_Spec. + Look at Pendisplay.mui, Area.mui/MUIA_Background and + Image.mui/MUIA_Image_Spec. + + Anyway, you can set the defaults with prefs and so should + not set it yourself. + NList.mcc/MUIM_NList_Clear + + NAME + MUIM_NList_Clear -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Clear,); + + FUNCTION + Same function as List.mui/MUIM_List_Clear. + + SEE ALSO + MUIM_NList_Insert, MUIA_NList_DestructHook + NList.mcc/MUIM_NList_ColWidth + + NAME + MUIM_NList_ColWidth -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_ColWidth,LONG col,LONG width); + + FUNCTION + Set a width for a col as if changed by the user with mouse, or + reset it to its default size. + Permit to get the user width of a col too. + + INPUTS + col number of the col (numbered as in display hook). + + special value : + MUIV_NList_ColWidth_All will set it for all columns. + + width width to set (4 is the minimum width accepted). + + special values : + MUIV_NList_ColWidth_Default reset to default. + MUIV_NList_ColWidth_Get set nothing, only return current. + + RESULT + When a col is specified (ie not MUIV_NList_ColWidth_All), the current + *user* width of the col will be returned : + o -1 mean that the col has its default width, ie not set by the user + or with this method. + o 0 mean that the specified col is not valid. + When MUIV_NList_ColWidth_All you'll get always 0. + NList.mcc/MUIM_NList_ColToColumn + + NAME + MUIM_NList_ColToColumn -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_ColToColumn,LONG col); + + FUNCTION + converts display hook col number to visible column number. + + INPUTS + col number of the col (numbered as in display hook). + + RESULT + column number, -1 if no column use that col number. + + SEE ALSO + MUIM_NList_ColumnToCol, MUIM_NList_SetColumnCol, MUIA_NList_Columns + NList.mcc/MUIM_NList_ColumnToCol + + NAME + MUIM_NList_ColumnToCol -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_ColumnToCol,LONG column); + + FUNCTION + converts visible column number to display hook col number. + + INPUTS + column number of the column (visible). + + RESULT + col number, -1 if the column is not valid. + + SEE ALSO + MUIM_NList_ColToColumn, MUIM_NList_SetColumnCol, MUIA_NList_Columns + NList.mcc/MUIM_NList_Compare + + NAME + MUIM_NList_Compare -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Compare,APTR entry1,APTR entry2, + ULONG sort_type1,ULONG sort_type2); + + FUNCTION + This method is called ONLY by NList.mcc when application needs to + compare two list entries f.e. when MUIM_NList_Sort, + MUIM_NList_Sort2, MUIM_NList_Sort3 are called. So, this method is + only useful within NList.mcc subclass, function method should + looks like normal MUIA_NList_CompareHook or + MUIA_NList_CompareHook2 hook function. If your subclass will not + override this method NList.mcc implementation will be used, and + it'll call MUIA_NList_CompareHook or MUIA_NList_CompareHook2 hook + in that case. + + When you are overriding this method you probably would like to + override MUIM_NList_Construct, MUIM_NList_Destruct and + MUIM_NList_Display method as well. + + INPUTS + entry1 - First entry to compare. + + entry2 - Second entry to compare. + + sort_type1 - Sort type 1. + + sort_type2 - Sort type 2. + + RESULTS + If entry1 > entry2 1, if entry1 == entry2 0 and if entry1 < + entry2 -1. i.e. the same as MUIA_NList_Compare, + MUIA_NList_CompareHook2 or strcmp() alike functions. + + NOTE + Do not even think about calling it by yourself! Method parameters + structure might grow in the future! Be warned. + + Internal implementation of this method can use internal or passed + arguments, so please do not cheating and if you are not + overriding it, pass the original arguments to super class. + + SEE ALSO + MUIA_NList_CompareHook, MUIA_NList_CompareHook2, + MUIM_NList_Construct, MUIM_NList_Destruct, MUIM_NList_Display + + NList.mcc/MUIM_NList_Construct + + NAME + MUIM_NList_Construct -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Construct,APTR entry,APTR pool); + + FUNCTION + This method is called ONLY by NList.mcc when application is + creating new entry f.e. when MUIM_NList_Insert, + MUIM_NList_InsertSingle or MUIM_NList_Replace is called. So, this + method is only useful within NList.mcc subclass, function method + should looks like normal MUIA_NList_ConstructHook or + MUIA_NList_ConstructHook2 hook function. If your subclass will + not override this method NList.mcc implementation will be used, + and it'll call MUIA_NList_ContructHook or + MUIA_NList_ConstructHook2 hook in that case. + + When you are overriding this method you probably would like to + override MUIM_NList_Destruct, MUIM_NList_Compare and + MUIM_NList_Display method as well. + + INPUTS + entry - original entry pointer passed to f.e. MUIM_NList_Insert + method. Equivalent of A1 register of + MUIA_NList_ConstructHook. + + pool - pool header pointer. Equivalent of A2 register of + MUIA_NList_ConstructHook. + + RESULT + New entry, similar as returned by one of construct hooks. + + NOTE + Do not even think about calling it by yourself! Method parameters + structure might grow in the future! Be warned. + + Internal implementation of this method can use internal or passed + arguments, so please do not cheating and if you are not + overriding it, pass the original arguments to super class. + + SEE ALSO + MUIA_NList_ConstructHook, MUIA_NList_ConstructHook2, + MUIM_NList_Insert, MUIM_NList_InsertSingle, MUIM_NList_Replace, + MUIM_NList_Destruct, MUIM_NList_Compare, MUIM_NList_Display + + NList.mcc/MUIM_NList_ContextMenuBuild + + NAME + MUIM_NList_ContextMenuBuild -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_ContextMenuBuild, LONG mx, LONG my, LONG pos, + LONG column, LONG flags,LONG ontop); + + FUNCTION + Give possibilities to use MUIM_ContextMenuBuild builtin in NList + and a custom context menu for a NList subclass. + + Here is how NList MUIM_ContextMenuBuild work : + + If MUIA_ContextMenu is NULL, NULL is returned (no menu). + + If MUIA_ContextMenu is none of special values, the supermethod is called. + + If MUIA_ContextMenu is MUIV_NList_ContextMenu_Never, MUIA_ContextMenu is + set to NULL and NULL is returned. + + Else (it's a special value) MUIM_NList_ContextMenuBuild is called : + + If MUIM_NList_ContextMenuBuild return -1, NULL will be returned (no menu). + + If MUIM_NList_ContextMenuBuild return NULL, NList will return its own + context menu, depending on prefs (it's the default case). + + If MUIM_NList_ContextMenuBuild return an menu object, NList will + enable/disable its own menu entries in the menu if it found some, + then return thqt object. + + 2 special menuitems are reconized by NList, and are found by : + DoMethod(MenuObj,MUIM_FindUData,MUIV_NList_Menu_Default_This) + and + DoMethod(MenuObj,MUIM_FindUData,MUIV_NList_Menu_Default_All) + + + + MUIA_ContextMenu special values are actuallly used : + + MUIV_NList_ContextMenu_Default replaced by one of followings. + MUIV_NList_ContextMenu_TopOnly only on title/top of list. + MUIV_NList_ContextMenu_Always always. + MUIV_NList_ContextMenu_Never never, repaced by NULL after. + + when using MUIV_NList_ContextMenu_TopOnly NList will set MUIA_ContextMenu + NULL/non-NULL when the mouse move, which should permit to have + the window menu avaible when the contents menu is not visible. + + Anyway actually (MUI 3.8) MUI has a bug/feature which make the + MUIA_ContextMenu being looked at only when the mouse *enter* + within the object bounds. MUIV_NList_ContextMenu_TopOnly stuff + will be nicer when that MUI problem is fixed... + + Of course if you want NList to do what has to be done when a menu item + has been selected, your MUIM_ContextMenuChoice should call the supermethod. + + INPUTS (for MUIM_NList_ContextMenuBuild) + + mx current mouse x. + my current mouse y. + pos entry number returned by NList_TestPos. + column column returned by NList_TestPos. + flags flags returned by NList_TestPos. + ontop TRUE if mouse is on title/top of the list. + + RESULT + NULL, -1 or a menustrip object. + + EXEMPLES + To make a ContextMenu but have the NList one appear when the + mouse in on title/top, just set MUIA_ContextMenu,MUIV_NList_ContextMenu_Always + and make MUIM_NList_ContextMenuBuild return NULL when ontop in TRUE (else + return your menustrip object). Call MUIM_ContextMenuChoice supermethod too. + + To make your own context menu which have the same menuitems as ones + in NList context menu, set MUIA_ContextMenu,MUIV_NList_ContextMenu_Always + and make MUIM_NList_ContextMenuBuild return always your menustrip object. + Make 4 menuitems in your menustrip object which will be like these : + { NM_ITEM , "Default Width: this" , 0 ,0 ,0 ,(APTR) MUIV_NList_Menu_DefWidth_This }, + { NM_ITEM , "Default Width: all" , 0 ,0 ,0 ,(APTR) MUIV_NList_Menu_DefWidth_All }, + { NM_ITEM , "Default Order: this" , 0 ,0 ,0 ,(APTR) MUIV_NList_Menu_DefOrder_This }, + { NM_ITEM , "Default Order: all" , 0 ,0 ,0 ,(APTR) MUIV_NList_Menu_DefOrder_All }, + They will be automatically enabled/disabled as needed by NList :) + Call MUIM_ContextMenuChoice supermethod too. + NList.mcc/MUIM_NList_CopyTo + + NAME + MUIM_NList_CopyTo -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_CopyTo, LONG pos, char *filename, + APTR *result, APTR *entries); + + FUNCTION + Do a copy to clipboard from some list entries or strings. + + INPUTS + pos entry number to be copied. + if MUIA_NList_CopyToClipHook is specified, it's what + it will return which will be copied instead of just + using the entry pointer as a string pointer. + + special values : + + MUIV_NList_CopyTo_Active copy list active entry + MUIV_NList_CopyTo_Selected copy list selected entries + MUIV_NList_CopyTo_All copy all list entries + MUIV_NList_CopyTo_Entries copy specified entries + MUIV_NList_CopyTo_Entry copy specified entry + + a "\n" will be insert after each entry contents. + + filename name of the file to copy to. If NULL then the copy will be + done to a string (strptr). + result LONG pointer which fill be filled with MUIV_NLCT_Success if + no error occured while opening and writing in the file, else + it will be filled with MUIV_NLCT_OpenErr, MUIV_NLCT_WriteErr + or MUIV_NLCT_Failed (failed somewhere when making copy data). + + if filename is NULL, result will be filled with a string pointer + to a string allocated by AllocVec(). Datas will have been copied + in that string. YOU'LL HAVE TO FREE TAHT string pointer YOURSELF, + with a FreeVec(). If the returned string pointer is NULL then + the copy failed. + entries pointer to some entry, string, entries array or string array. + Its use depend on the pos value : + if MUIV_NList_CopyTo_Entry then it's an entry pointer. + if MUIV_NList_CopyTo_Entries then it's an entry pointer + array NULL terminated. + else : not used, set to NULL. + + EXEMPLES + LONG result = 0; + DoMethod(obj,MUIM_NList_CopyTo, 5, "RAM:test.txt", &result, NULL, NULL); + + will copy the 5th entry to file RAM:test.txt, using + MUIA_NList_CopyToClipHook if set. + + + LONG result = 0; + DoMethod(obj,MUIM_NList_CopyTo, MUIV_NList_CopyToClip_Selected, + "PRT:", &result, NULL, NULL); + will copy all selected entries to printer, using + MUIA_NList_CopyToClipHook for each if set. + + + char *strptr = NULL; + DoMethod(obj,MUIM_NList_CopyTo, MUIV_NList_CopyTo_All, + NULL, &strptr, NULL, NULL); + will copy all list entries to the string returned in strptr. + you must make a FreeVec(strptr) by yourself after. + + SEE ALSO + MUIM_NList_CopyToClip, MUIA_NList_CopyToClipHook + NList.mcc/MUIM_NList_CopyToClip + + NAME + MUIM_NList_CopyToClip -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_CopyToClip, LONG pos, ULONG clipnum, + APTR *entries, struct Hook *hook); + + FUNCTION + Do a copy to clipboard from some list entries or strings. + + INPUTS + pos entry number to be copied. + if MUIA_NList_CopyToClipHook is specified, it's what + it will return which will be copied instead of just + using the entry pointer as a string pointer. + + special values : + + MUIV_NList_CopyToClip_Active copy list active entry + MUIV_NList_CopyToClip_Selected copy list selected entries + MUIV_NList_CopyToClip_All copy all list entries + MUIV_NList_CopyToClip_Entries copy specified entries + MUIV_NList_CopyToClip_Entry copy specified entry + MUIV_NList_CopyToClip_Strings copy specified strings using hook + MUIV_NList_CopyToClip_String copy specified string using hook + + a "\n" will be insert after each entry contents, for all but + MUIV_NList_CopyToClip_Strings and MUIV_NList_CopyToClip_String. + + clipnum clipboard number to copy to. + entries pointer to some entry, string, entries array or string array. + Its use depend on the pos value : + if MUIV_NList_CopyToClip_Entry then it's an entry pointer. + if MUIV_NList_CopyToClip_Entries then it's an entry pointer + array NULL terminated. + if MUIV_NList_CopyToClip_String then it's a string pointer. + if MUIV_NList_CopyToClip_Strings then it's an string pointer + array NULL terminated. + else : not used, set to NULL. + hook hook function which will be used (if not NULL) for + MUIV_NList_CopyToClip_Strings and + MUIV_NList_CopyToClip_String + instead of MUIA_NList_CopyToClipHook + Should be NULL most of time. + + EXEMPLES + DoMethod(obj,MUIM_NList_CopyToClip, 5, 0, NULL, NULL); + will copy the 5th entry to clipboard 0, using + MUIA_NList_CopyToClipHook if set. + + DoMethod(obj,MUIM_NList_CopyToClip, MUIV_NList_CopyToClip_Selected, + 0, NULL, NULL); + will copy all selected entries to clipboard 0, using + MUIA_NList_CopyToClipHook for each if set. + + DoMethod(obj,MUIM_NList_CopyToClip, MUIV_NList_CopyToClip_String, + 0, "my string", NULL); + will copy "my string" to clipboard 0. + + NOTE + MUIV_NList_CopyToClip_Strings and MUIV_NList_CopyToClip_String + are here to permit simple text copy to clipboard for non nlist + object related stuff (anyway a NList object must be here to use + them...). They can use their own hook instead of nlist one if + non NULL, anyway look at MUIA_NList_CopyToClipHook to see how + this hook will be used. + + SEE ALSO + MUIA_NList_CopyToClipHook, MUIA_NList_CopyToClip_Key, MUIM_NList_CopyTo + NList.mcc/MUIM_NList_CreateImage + + NAME + MUIM_NList_CreateImage -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_CreateImage,Object *imgobj, ULONG flags); + + FUNCTION + Same function as List.mui/MUIM_List_CreateImage. + + Any transparent color in the source Bitmap/Bodychunk + object will work (except if flags is ~0L). + + You must use MUIM_NList_CreateImage in Setup() or after + and MUIM_NList_DeleteImage in Cleanup() or before, + because the mri of the NList object must be valid. + Setup() and Cleanup() are the best because MUI_ObtainPen() + and MUI_ReleasePen() are used, and then pens will be + released while iconification and will be re-obtained + if the screen change. + + Take a look at MUIM_NList_UseImage which is far easier to + use. + + Standard flags value is 0. + + If flags is ~0L then FillArea will not be set to FALSE on the object + (for any other value, FillArea is set to FALSE) + + If flags is ~0L for a Bitmap/Bodychunk then it will be really the + given object which will be drawn, as for non Bitmap/Bodychunk objects. + + + The imgobj can (nearly) be any object, but take care of that : + + - the object should not test and use user inputs, the object + should just be able to draw itself within the _left(obj), + _top(obj), _width(obj) and height(obj) it will have when its + Draw method is called. + - the object class MUST NOT be Group or subclass of it. + - the given imgobj must not be attached to any group object + anywhere else, because a ADDMEMBER will be done with it. + - Each imgobj can be used with one and only one NList object. + - you can use the return pointer with ESC O[] and ESC o[]. + - the object will receive two tags just before its Draw method will + be called : set(imgobj,MUIA_NLIMG_EntryCurrent,current_entry_number) and + set(imgobj,MUIA_NLIMG_EntryHeight,height_of_each_entry_of_the_list) + which are usefull in some case to draw things (see demo example). + - a new stuff is to use it with ESC O[;;], in that case + a set(imgobj,tag,value) will be done just before drawing it, so + you can make an object which will draw different things when that tag + value is changed. Setting this tag MUST NOT make the object being + redrawn !!! + and must both be in hexadecimal (%lx). + - if you use ;; in one ESC sequence for an imgobj, you should + use it everywhere you use that imgobj because there is no default for it. + - The imgobj height will always be set to the entries height. + - The mindefheight of imgobj will become the min height for entries. + - Think it's still a new testing stuff... + + Note: + Previously the object was disposed by NList at its end, actually a call + to MUIM_NList_DeleteImage will REMMEMBER it, and so you have to dispose + it yourself after ! + + Look the demo program to see a way to use it... + + + RESULT + The result you get is a struct BitMapImage pointer which + will exist between the MUIM_NList_CreateImage and + MUIM_NList_DeleteImage, with a valid bitmap, width and + height for the current screen. + + If you use it for a non Bitmap/Bodychunk object (or with flags + set to ~0L) then the mask and imgbmp fields of the returned + struct BitMapImage are not valid, and obtainpens is a pointer to + the object. + + The only thing you should do with it is to include it in + \33O[%08lx]. The result may be NULL in which case NList + was unable to create the image, but the \33O[] combination + simply draws nothing when receiving a NULL. + + ATTENTION: + The returned pointer doesn't give the same structure than + MUIM_List_CreateImage (in standard List class) would do : + both are not compatible at all ! + + SEE ALSO + MUIM_NList_DeleteImage, MUIM_NList_UseImage + NList.mcc/MUIM_NList_DeleteImage + + NAME + MUIM_NList_DeleteImage -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_DeleteImage,APTR listimg); + + FUNCTION + Same function as List.mui/MUIM_List_DeleteImage. + + Delete the image pointer returned from MUIM_NList_CreateImage. + Read explains in MUIM_NList_CreateImage. + + SEE ALSO + MUIM_NList_CreateImage, MUIM_NList_UseImage + NList.mcc/MUIM_NList_Destruct + + NAME + MUIM_NList_Destruct -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Destruct,APTR entry,APTR pool); + + FUNCTION + This method is called ONLY by NList.mcc when application is + deleting entry f.e. when MUIM_NList_Remove or MUIM_NList_Replace + are called. So, this method is only useful within NList.mcc + subclass, function method should looks like normal + MUIA_NList_DestructHook or MUIA_NList_DestructHook2 hook + function. If your subclass will not override this method + NList.mcc implementation will be used, and it'll call + MUIA_NList_DestructHook or MUIA_NList_DestructHook2 hook in that + case. + + When you are overriding this method you must override + MUIM_NList_Construct and probably MUIM_NList_Compare and + MUIM_NList_Display method as well. + + INPUTS + entry - entry pointer returned by MUIM_NList_Construct method. + + pool - pool header pointer. + + RESULT + Currently undefined. If you are overriding it completely, please + return 0, if not use the value returned by super class! + + NOTE + Do not even think about calling it by yourself! Method parameters + structure might grow in the future! Be warned. + + Internal implementation of this method can use internal or passed + arguments, so please do not cheating and if you are not + overriding it, pass the original arguments to super class. + + SEE ALSO + MUIA_NList_ConstructHook, MUIA_NList_ConstructHook2, + MUIM_NList_Insert, MUIM_NList_InsertSingle, MUIM_NList_Replace, + MUIM_NList_Destruct, MUIM_NList_Compare, MUIM_NList_Display + + NList.mcc/MUIM_NList_Display + + NAME + MUIM_NList_Display -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Display,APTR entry,ULONG entry_pos, + STRPTR *strings,STRPTR *preparses); + + FUNCTION + This method is called ONLY by NList.mcc when application is + displaying entry f.e. when MUI_Redraw(), MUIM_NList_Redraw or + MUIM_NList_RedrawEntry are called. So, this method is only useful + within NList.mcc subclass, function method should looks like + normal MUIA_NList_DisplayHook or MUIA_NList_DisplayHook2 hook + function. If your subclass will not override this method + NList.mcc implementation will be used, and it'll call + MUIA_NList_DisplayHook or MUIA_NList_DisplayHook2 hook in that + case. + + INPUTS + entry - Entry pointer returned by f.e. MUIM_NList_Construct, + MUIA_NList_ConstructHook or MUIA_NList_ConstructHook2 + hooks. + + entry_pos - Entry position. + + strings - Pointer to strings table. + + preparses - Pointer to preparse strings table. + + RESULT + Currently undefined. If you are overriding it completely, please + return 0, if not use the value returned by super class! + + NOTE + Do not even think about calling it by yourself! Method parameters + structure might grow in the future! Be warned. + + Internal implementation of this method can use internal or passed + arguments, so please do not cheating and if you are not + overriding it, pass the original arguments to super class. + + SEE ALSO + MUIA_NList_ConstructHook, MUIA_NList_ConstructHook2, + MUIA_NList_DisplayHook, MUIA_NList_DisplayHook2, + MUIM_NList_Insert, MUIM_NList_InsertSingle, MUIM_NList_Replace, + MUIM_NList_Construct, MUIM_NList_Destruct, MUIM_NList_Compare + + NList.mcc/MUIM_NList_DoMethod + + NAME + MUIM_NList_DoMethod -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_DoMethod,LONG pos, + APTR DestObj,ULONG FollowParams,ULONG method,...); + + FUNCTION + The given method will be executed for each selected entry, the + active entry, all entries, or one specified entry of the NList + object. + + Each DoMethod() can be done on the NList object, its _app object, + a specified object, or the entry pointer if (and only if) it's + an object. + + Following arguments can be automatically adjusted for each call + using special values, like in the MUIM_Notify method (you must + specified the numer of following argument too, as there will be + copied in a temporary buffer - alloced in the stack). + + INPUTS + pos - the entry number for which you want to do the method. + + special values : + MUIV_NList_DoMethod_Active do it for the active entry. + MUIV_NList_DoMethod_Selected do it for all selected entries. + MUIV_NList_DoMethod_All do it + + DestObj - the object on which the method will be done. + + special values : + MUIV_NList_DoMethod_Entry use entry pointer as target object for method. + MUIV_NList_DoMethod_Self use the NList object as target for method. + MUIV_NList_DoMethod_App use the _app(NList object) as target for method. + + FollowParams - the number of following parameters (including "method"). + (maximum 40 to prevent errors and stack overflow) + + method - the method which will be done. + + ... - the method parameters. + + special values : + MUIV_NList_EntryValue replaced by the "current" entry pointer. + MUIV_NList_EntryPosValue replaced by the "current" entry number. + MUIV_NList_SelfValue replaced by the NList object. + MUIV_NList_AppValue replaced by _app(NList object) + + NOTES + Don't use this to do things on the NList object when a specific way + to do it exists (don't use it to remove entries in the nlist object + itself for example). + + When using it in a notification, MUIV_TriggerValue and MUIV_TriggerValue + special values will be replaced by the notify superclass as usual. + + EXAMPLES + Insert all entries from nlist L1 to nlist L2 : + + DoMethod(L1, MUIM_NList_DoMethod, MUIV_NList_DoMethod_All, + L2, 3, + MUIM_NList_InsertSingle, MUIV_NList_EntryValue, MUIV_NList_Insert_Bottom); + + (it would be better to make set(L2,MUIA_NList_Quiet,TRUE) before and + set(L2,MUIA_NList_Quiet,FALSE) after when there are many entries...) + + + If the entries of nlist L1 are objects (and only in that case), you can do + that to call a method (MUIM_Foo,x) for each selected of them : + + DoMethod(L1, MUIM_NList_DoMethod, MUIV_NList_DoMethod_Selected, + MUIV_NList_DoMethod_Entry, 2, + MUIM_Foo,x); + NList.mcc/MUIM_NList_DropDraw + + NAME + MUIM_NList_DropDraw -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_DropDraw, LONG pos, LONG type, + LONG minx,LONG maxx,LONG miny,LONG maxy); + + FUNCTION + This method MUST NOT be called directly ! + + It will be called by NList, and will draw the drop mark previously fixed + (pos and type) by MUIM_NList_DropType within the minx, maxx, miny, maxy + in the _rp(obj) rasport. You must not draw outside of the given box, + because only the corresponding NList entry will be refreshed to erase what + is drawn in that method. + + Calling the supermethod (so the builtin MUIM_NList_DropDraw method) will draw + the standard dropmark specified by (type & MUIV_NList_DropType_Mask), so + MUIV_NList_DropType_None,MUIV_NList_DropType_Above,MUIV_NList_DropType_Below + or MUIV_NList_DropType_Onto. + + You can draw directly in the rastport (or a clone of it) in that method, + because it will be called from the Draw method within the DragReport in + Refresh mode. + + SEE ALSO + MUIM_NList_DropType, MUIA_NList_DropType, MUIA_NList_DropMark, + MUIM_NList_DropEntryDrawErase + NList.mcc/MUIM_NList_DropEntryDrawErase + + NAME + MUIM_NList_DropEntryDrawErase -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_DropEntryDrawErase,LONG type,LONG drawpos,LONG erasepos); + + FUNCTION + This method MUST NOT be called directly ! + + It will be called by NList while the DragReport just before the redraw + which will draw a new mark or erase the old one. + + This method can be used to change something so your displayhook will return + something different for the marked entry, like changing its color or making + it bold or italic. + + Don't call the superclass unless you know that the superclass use it. + + You should return 0. + + INPUTS + type has the same meaning as *type in MUIM_NList_DropType, it will be useless + in most cases (and has no meanning at all for erasepos). + + drawpos is the entry number which will be draw with a dropmark, -1 mean none. + + erasepos is the entry number which is not any more the dropmark one, -1 mean none. + + SEE ALSO + MUIM_NList_DropDraw, MUIA_NList_DropType, MUIA_NList_DropMark + NList.mcc/MUIM_NList_DropType + + NAME + MUIM_NList_DropType -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_DropType, LONG *pos,LONG *type, + LONG minx,LONG maxx,LONG miny,LONG maxy, + LONG mousex,LONG mousey); + + FUNCTION + This method MUST NOT be called directly ! + + It will be called by NList while the DragReport, with default *pos and *type + values depending on the drag pointer position that you can modify as you want. + + Default *type can be MUIV_NList_DropType_Above or MUIV_NList_DropType_Below. + You can change it to any of MUIV_NList_DropType_None,MUIV_NList_DropType_Above, + MUIV_NList_DropType_Below and MUIV_NList_DropType_Onto if you want, using + the mouse position and the entry box. + + You can make you own *type value as soon as you don't set it in + MUIV_NList_DropType_Mask, and so draw what you want depending on that value + in the MUIM_NList_DropDraw method. + + Note that any MUIV_NList_DropType_Below *type will be changed to + MUIV_NList_DropType_Above with a *pos incremented by 1 just after the + return of that method. + + If you change the *pos, the list will be scrolled to see it (if the value is + correct). + + getting MUIA_NList_DropType or MUIA_NList_DropMark will return the same values + as *pos and *type. + + If your subclass is a direct NList subclass, then there is no need to call + the supermethod which done nothing at all ! + + SEE ALSO + MUIM_NList_DropDraw, MUIA_NList_DropType, MUIA_NList_DropMark, + MUIM_NList_DropEntryDrawErase + NList.mcc/MUIM_NList_Exchange + + NAME + MUIM_NList_Exchange -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Exchange,LONG pos1, LONG pos2); + + FUNCTION + Same function as List.mui/MUIM_List_Exchange. + + Exchange two entries in a NList object. + + INPUTS + pos1 - number of the first entry. + pos2 - number of the second entry. + + MUIV_NList_Exchange_Top + MUIV_NList_Exchange_Active + MUIV_NList_Exchange_Bottom + MUIV_NList_Exchange_Next only valid for second parameter + MUIV_NList_Exchange_Previous only valid for second parameter + + SEE ALSO + MUIM_NList_Insert, MUIM_NList_Remove, MUIM_NList_Move + NList.mcc/MUIM_NList_GetEntry + + NAME + MUIM_NList_GetEntry -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_GetEntry,LONG pos, APTR *entry); + + FUNCTION + Same function as List.mui/MUIM_List_GetEntry. + + SPECIAL INPUTS + MUIV_NList_GetEntry_Active give active entry (or NULL if none) + + SEE ALSO + MUIM_NList_Insert, MUIM_NList_Remove, MUIM_NList_GetEntryInfo + NList.mcc/MUIM_NList_GetEntryInfo + + NAME + MUIM_NList_GetEntryInfo -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_GetEntryInfo,struct MUI_NList_GetEntryInfo *res); + + FUNCTION + You get usefull informations about some entry from its number, + or from the real line number which can be different when there + is word wrap in the list. + + INPUTS + res - pointer to a MUI_NList_GetEntryInfo struct : + LONG pos; number of entry you want info about */ + LONG line; real line number */ + LONG entry_pos; entry number of returned entry ptr */ + APTR entry; entry pointer */ + LONG wrapcol; NOWRAP, WRAPCOLx, or WRAPPED|WRAPCOLx */ + LONG charpos; start char number in string (unused if NOWRAP) */ + LONG charlen; string lenght (unused if NOWRAP) */ + + if pos is MUIV_NList_GetEntryInfo_Line then the method will + use the line number to search infos, else line will be set + to its correct number for the value of pos. + entry is the entry ptr, think that if it's a word wrapped + entry then it come from the returned entry_pos entry. + Think too that if wrapcol tell you that it's a WRAPPED entry, + only the WRAPCOLx col is drawn, from the charpos position + in the string returned by DisplayHook for the column and for + entry_pos/entry. + + SEE ALSO + MUIM_NList_GetEntry + NList.mcc/MUIM_NList_GetPos + + NAME + MUIM_NList_GetPos -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_GetPos,APTR entry,LONG *pos); + + FUNCTION + Give the (next) entry number which have the given entry number. + It's the entry ptr which is stored in the list, ie the one returned + by the ConstructHook if any. + + INPUTS + entry - Entry ptr of the entry you want to get the pos. + + pos - a pointer to longword that will hold the next entry number + of the given entry ptr. Must be set to MUIV_NList_GetPos_Start + if you want to search from the beginning of the list. + Is set to MUIV_NList_GetPos_End no more is found. + + + NList.mcc/MUIM_NList_GetSelectInfo + + NAME + MUIM_NList_GetSelectInfo -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_GetSelectInfo,struct MUI_NList_GetSelectInfo *res); + + FUNCTION + You get usefull informations about selected entries state. + + INPUTS + res - pointer to a MUI_NList_GetSelectInfo struct : + LONG start num of first selected *REAL* entry/line (first of wrapped from which start is issued) + LONG end num of last selected *REAL* entry/line (first of wrapped from which start is issued) + LONG num not used + LONG start_column column of start of selection in 'start' entry + LONG end_column column of end of selection in 'end' entry + LONG start_pos char pos of start of selection in 'start_column' entry + LONG end_pos char pos of end of selection in 'end_column' entry + LONG vstart num of first visually selected entry (ie can be the 2nd or 3rd line of a word wrap entry) + LONG vend num of last visually selected entry (ie can be the 2nd or 3rd line of a word wrap entry) + LONG vnum number of visually selected entries + + NOTE + If no entry is selected, then start, end, vstart, vend are -1, vnum is 0. + + When start_column, end_column, start_pos, end_pos are -1 then the whole line/entry/column + is selected. + + start_column, end_columb, start_pos and end_pos have the same meaning than + parameters passed to the MUIA_NList_CopyEntryToClipHook. + + remember than in case of automatically added word wrapped entries, only + the concerned column have any contents. You get that case for 'vstart' + when 'start' is different, and for 'end' when 'vend' is different. + NList.mcc/MUIM_NList_Insert + + NAME + MUIM_NList_Insert -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Insert,APTR *entries, LONG count, LONG pos, LONG flags); + + FUNCTION + Same function as List.mui/MUIM_List_Insert. + + Entry (display) contents will be display until \0 , \n or \r. + + You can insert a multiline string with count==-2. + + INPUTS + entries - pointer to an array of pointers to be inserted. + Warning: This is a pointer to a pointer. + + It's a pointer to string if count==-2. + + count - Number of elements to be inserted. If count==-1, + entries will be inserted until NULL pointer in + the entries array is found. + + If count==-2 then entries must be a string pointer + which can be multiline with \n , \r or \r\n separators. + You'll get as many entries inserted as lines in the string. + The end char is \0. + + pos - New entries will be added in front of this entry. + MUIV_NList_Insert_Top insert as first entry. + MUIV_NList_Insert_Active insert in front of the active entry. + MUIV_NList_Insert_Sorted insert sorted (all entries will be + sorted if necessary). + MUIV_NList_Insert_Bottom insert as last entry. + + flags - Special flags for the insert operation or 0. + MUIV_NList_Insert_Flag_Raw insert the entries without the automatic + reordering of the columns. This could + speed up the insert of entries very + significant but will not automatically + change the width of a column. + + SEE ALSO + MUIM_NList_Remove, MUIA_NList_ConstructHook, MUIM_NList_InsertSingle + MUIM_NList_InsertSingleWrap, MUIM_NList_InsertWrap + NList.mcc/MUIM_NList_InsertSingle + + NAME + MUIM_NList_InsertSingle -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_InsertSingle,APTR entry, LONG pos); + + FUNCTION + Same function as List.mui/MUIM_List_InsertSingle. + + INPUTS + entry - item to insert. + + pos - New entry will be added in front of this entry. + MUIV_NList_Insert_Top insert as first entry. + MUIV_NList_Insert_Active insert in front of the active entry. + MUIV_NList_Insert_Sorted insert sorted (all entries will be + sorted if necessary). + MUIV_NList_Insert_Bottom insert as last entry. + + SEE ALSO + MUIM_NList_Remove, MUIA_NList_ConstructHook, MUIM_NList_Insert, + MUIM_NList_InsertSingleWrap, MUIM_NList_InsertWrap + NList.mcc/MUIM_NList_InsertSingleWrap + + NAME + MUIM_NList_InsertSingleWrap -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_InsertSingleWrap, + APTR entry, LONG pos, LONG wrapcol, LONG align); + + FUNCTION + Same function as MUIM_NList_InsertSingle but permit word wrap + and alignement for the entry. + + INPUTS + entry - item to insert. + + pos - New entry will be added in front of this entry. + MUIV_NList_Insert_Top insert as first entry. + MUIV_NList_Insert_Active insert in front of the active entry. + MUIV_NList_Insert_Sorted insert sorted (all entries will be + sorted if necessary). + MUIV_NList_Insert_Bottom insert as last entry. + + wrapcol - WRAPCOL0 to WRAPCOL6. You can't ask word wrap for an + other col. NOWRAP if you don't want word wrap. + So only one of (display hook) col 0 to 6 can be wrapped. + + align - ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT or ALIGN_JUSTIFY. + be aware that align will be used if there is no escape + align sequence in the preparses or column entry string. + + SEE ALSO + MUIM_NList_Remove, MUIA_NList_ConstructHook, MUIM_NList_Insert, + MUIM_NList_InsertSingle, MUIM_NList_InsertWrap + NList.mcc/MUIM_NList_InsertWrap + + NAME + MUIM_NList_InsertWrap -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_InsertWrap, APTR *entries, + LONG count, LONG pos, LONG wrapcol, LONG align); + + FUNCTION + Same function as MUIM_NList_Insert but permit word wrap and + alignement for the entry. + + INPUTS + entries - pointer to an array of pointers to be inserted. + Warning: This is a pointer to a pointer. + + It's a pointer to string if count==-2. + + count - Number of elements to be inserted. If count==-1, + entries will be inserted until NULL pointer in + the entries array is found. + + If count==-2 then entries must be a string pointer + which can be multiline with \n , \r or \r\n separators. + You'll get as many entries inserted as lines in the string. + The end char is \0. + + pos - New entry will be added in front of this entry. + MUIV_NList_Insert_Top insert as first entry. + MUIV_NList_Insert_Active insert in front of the active entry. + MUIV_NList_Insert_Sorted insert sorted (all entries will be + sorted if necessary). + MUIV_NList_Insert_Bottom insert as last entry. + + wrapcol - WRAPCOL0 to WRAPCOL6. You can't ask word wrap for an + other col. NOWRAP if you don't want word wrap. + So only one of (display hook) col 0 to 6 can be wrapped. + + align - ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT or ALIGN_JUSTIFY. + be aware that align will be used if there is no escape + align sequence in the preparses or column entry string. + + SEE ALSO + MUIM_NList_Remove, MUIA_NList_ConstructHook, MUIM_NList_Insert, + MUIM_NList_InsertSingle, MUIM_NList_InsertSingleWrap + NList.mcc/MUIM_NList_Jump + + NAME + MUIM_NList_Jump -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Jump,LONG pos); + + FUNCTION + Same function as List.mui/MUIM_List_Jump. + + INPUTS + pos - Number of the entry that should be made visible. + Use MUIV_NList_Jump_Active to jump to the active + entry. And use MUIV_NList_Jump_Active_Center to + make the active entry visible centered in the + listview. + + SEE ALSO + MUIA_NList_Active, MUIA_NList_First + NList.mcc/MUIM_NList_Move + + NAME + MUIM_NList_Move -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Move,LONG from, LONG to); + + FUNCTION + Same function as List.mui/MUIM_List_Move. + + INPUTS + pos1 - number of the first entry. + pos2 - number of the second entry. + + Possible special values : + + MUIV_NList_Move_Top + MUIV_NList_Move_Active + MUIV_NList_Move_Bottom + MUIV_NList_Move_Next only valid for second parameter + if first one is not Move_Selected + MUIV_NList_Move_Previous only valid for second parameter + if first one is not Move_Selected + MUIV_NList_Move_Selected only valid for first parameter + + SEE ALSO + MUIM_NList_Insert, MUIM_NList_Remove, MUIM_NList_Exchange + NList.mcc/MUIM_NList_NextSelected + + NAME + MUIM_NList_NextSelected -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_NextSelected,LONG *pos); + + FUNCTION + Same function as List.mui/MUIM_List_NextSelected. + + In TypeSelect_Char mode you'll get all entries of the selected + area, even the first and last which can be very partially selected. + + INPUTS + pos - a pointer to longword that will hold the number + of the returned entry. Must be set to + MUIV_NList_NextSelected_Start at start of iteration. + Is set to MUIV_NList_NextSelected_End when iteration + is finished. + + SEE ALSO + MUIM_NList_Select, MUIM_NList_PrevSelected + NList.mcc/MUIM_NList_PrevSelected + + NAME + MUIM_NList_PrevSelected -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_PrevSelected,LONG *pos); + + FUNCTION + Work like MUIM_NList_NextSelected but give previous selected entry. + + In TypeSelect_Char mode you'll get all entries of the selected + area, even the first and last which can be very partially selected. + + INPUTS + pos - a pointer to longword that will hold the number + of the returned entry. Must be set to + MUIV_NList_PrevSelected_Start at start of iteration. + Is set to MUIV_NList_PrevSelected_End when iteration + is finished. + + SEE ALSO + MUIM_NList_Select, MUIM_NList_NextSelected + NList.mcc/MUIM_NList_Redraw + + NAME + MUIM_NList_Redraw -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Redraw,LONG pos); + + FUNCTION + Same function as List.mui/MUIM_List_Redraw. + Redraw some entry or all. + + INPUTS + pos - Number of the line to redraw. When the line is not + currently visible, nothing will happen. Specials: + MUIV_NList_Redraw_Active redraw the active line (if any), + MUIV_NList_Redraw_All redraw all lines. + MUIV_NList_Redraw_Title redraw the title. + + SEE ALSO + MUIM_NList_RedrawEntry + NList.mcc/MUIM_NList_RedrawEntry + + NAME + MUIM_NList_RedrawEntry -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_RedrawEntry,APTR entry); + + FUNCTION + Redraw some entry, like MUIM_NList_Redraw, but using the entry + pointer instead of the entry number. + + INPUTS + entry - Entry ptr of the entry (entries) you want to be redraw. + + SEE ALSO + MUIM_NList_Redraw + NList.mcc/MUIM_NList_Remove + + NAME + MUIM_NList_Remove -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Remove,LONG pos); + + FUNCTION + Same function as List.mui/MUIM_List_Remove. + + INPUTS + pos - number of the entry to be removed or one of + MUIV_NList_Remove_First + MUIV_NList_Remove_Active + MUIV_NList_Remove_Selected + MUIV_NList_Remove_Last + When the active or a selected entry is removed, + the following entry will become active. + When the active is the removed and is the last, + the new last become active. + + SEE ALSO + MUIM_NList_Insert, MUIA_NList_DestructHook + NList.mcc/MUIM_NList_ReplaceSingle + + NAME + MUIM_NList_ReplaceSingle -- + + FUNCTION + DoMethod(obj,MUIM_NList_ReplaceSingle, + APTR entry, LONG pos, LONG wrapcol, LONG align); + + FUNCTION + Same function as MUIM_NList_InsertSingleWrap but replace an existing + entry rather than inserting. + It's better to do a direct replace than remove then insert it ! + + INPUTS + entry - item to insert. + + pos - position of the entry to be replaced + MUIV_NList_Insert_Top replace the first entry. + MUIV_NList_Insert_Active replace the active entry. + MUIV_NList_Insert_Bottom replace the last entry. + Invalid positions will cause the replacement to fail! + + wrapcol - WRAPCOL0 to WRAPCOL6. You can't ask word wrap for an + other col. NOWRAP if you don't want word wrap. + So only one of (display hook) col 0 to 6 can be wrapped. + + align - ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT or ALIGN_JUSTIFY. + be aware that align will be used if there is no escape + align sequence in the preparses or column entry string. + + SEE ALSO + MUIM_NList_Remove, MUIM_NList_InsertSingleWrap + NList.mcc/MUIM_NList_Select + + NAME + MUIM_NList_Select -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Select,LONG pos, LONG seltype, LONG *state); + + FUNCTION + Same function as List.mui/MUIM_List_Select when in TypeSelect_Line mode. + + In TypeSelect_Char mode, MUIV_NList_Select_Off will clear the selected + area (don't look what is pos). MUIV_NList_Select_On will select the + pos entry only (can be MUIV_NList_Select_Active or MUIV_NList_Select_All). + MUIV_NList_Select_Ask will give the number off entry in the selected area. + + INPUTS + + pos - Number of the entry or + MUIV_NList_Select_Active for the active entry. + MUIV_NList_Select_All for all entries. + + seltype - MUIV_NList_Select_Off unselect entry. + MUIV_NList_Select_On select entry. + MUIV_NList_Select_Toggle toggle entry. + MUIV_NList_Select_Ask just ask about the state. + + state - Pointer to a longword. If not NULL, this will + be filled with the current selection state. + + SEE ALSO + MUIA_NList_TypeSelect, MUIA_NList_MultiTestHook + NList.mcc/MUIM_NList_SelectChange + + NAME + MUIM_NList_SelectChange -- Called on every selection change (V19.98) + + SYNOPSIS + DoMethod(obj,MUIM_NList_SelectChange,LONG pos, LONG state, ULONG flags); + + FUNCTION + This method cannot/should not be called. It's purpose is only to indicate + selection state changes of entries in a more powerfull form than + MUIA_NList_SelectChange does. + It is only called when you are in line mode ie. MUIA_NList_TypeSelect is + set to MUIV_NList_TypeSelect_Line, which is the default. + + pos - The position of the (un)selected entry. Can be + MUIV_NList_Active_Off or something. + state - The resulting state of the entry which can be MUIV_NList_Select_On, + MUIV_NList_Select_Off or MUIV_NList_Select_Active. + flags - Can be MUIV_NList_SelectChange_Flag_Multi for now which means + that the entry was selected while holding down the mouse button. + + INPUTS + + SEE ALSO + MUIA_NList_SelectChange, MUIA_NList_TypeSelect, MUIM_NList_Select + NList.mcc/MUIM_NList_SetActive + + NAME + MUIM_NList_SetActive -- make a specific entry the active one (v20.125) + + SYNOPSIS + DoMethod(obj, MUIM_NList_SetActive, LONG pos, ULONG flags); + + FUNCTION + This method is a replacement function for the old-style way of making an + entry active via a simple set(obj, MUIA_NList_Active, pos) call. While the + old method still works, this new function has the advantage that it allows + to set an entry active together with making it immediately visible in the + listview. + Previously, a developer had to do a combination of a set() call to set + MUIA_NList_Active and then immediately perform a MUIM_NList_Jump function + call so that the entry becomes visible at the specific position. With this + new function both operations are combined, potentially allowing future + enhancements to be added via the additional 'flags' variable. + + INPUTS + The parameter description is as followed: + + pos - The position (int) of the entry which should be made the new + active entry. This can also be MUIV_NList_Active_XXXX values as + explained in the MUIA_NList_Active documentation. Furthermore, + pos might also be perfectly a pointer to the entry directly in + case you have specified the correct flag. + + flags - Can be a combination of the following flags: + + MUIV_NList_SetActive_Entry: + + the parameter 'pos' will be a pointer to the entry rather + than the position (int) of the entry to be made active. If + this flag is set NList will perform an internal GetPos() + operation to first obtain the position and then set + this entry active. + + MUIV_NList_SetActive_Jump_Center: + + Together with making the specified entry the new active one + the listview will also be scrolled so that the new entry + will be shown centered instead of having it simply visible. + + SEE ALSO + MUIA_NList_Active, MUIM_NList_Jump + NList.mcc/MUIM_NList_SetColumnCol + + NAME + MUIM_NList_SetColumnCol -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_SetColumnCol,LONG column,LONG col); + + FUNCTION + set which displayhook col is at the visible column. + + INPUTS + column number of the column (visible). + if MUIV_NList_SetColumnCol_Default then the given (diplayhook) col + will come back to its default/original (from List_Format) position. + + col col number (displayhook one). + if MUIV_NList_SetColumnCol_Default then the given visible column + will come back to its default/original (from List_Format) position. + + + both set to MUIV_NList_SetColumnCol_Default make all columns + come back to their default/original (from List_Format) position. + + RESULT + None. + + NOTE + MUIM_NList_SetColumnCol always exchange the moved column with the column + which was were it move. + + SEE ALSO + MUIM_NList_ColToColumn, MUIM_NList_ColumnToCol, MUIA_NList_Columns + NList.mcc/MUIM_NList_Sort + + NAME + MUIM_NList_Sort -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Sort); + + FUNCTION + Same function as List.mui/MUIM_List_Sort. + + SEE ALSO + MUIA_NList_CompareHook, MUIA_NList_CompareHook2, MUIM_NList_Sort, MUIM_NList_Sort3, + MUIA_NList_SortType, MUIA_NList_SortType2 + NList.mcc/MUIM_NList_Sort2 + + NAME + MUIM_NList_Sort2 -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Sort2,LONG sort_type, LONG sort_type_add); + + FUNCTION + Same function as MUIM_NList_Sort but will set MUIA_NList_SortType + before starting the sort. + + It is really usefull only if you use MUIA_NList_CompareHook2 instead + of classic MUIA_NList_CompareHook so your hook will be able to do + different type of sort when NList_SortType change. + + INPUTS + sort_type - The new MUIA_NList_SortType value (see below). + + sort_type_add - If 0 then sort_type will be the new MUIA_NList_SortType, + else if current MUIA_NList_SortType & MUIV_NList_SortTypeValue_Mask + is same as sort_type then sort_type_add will be added to the + MUIA_NList_SortType value, + else sort_type will be the new MUIA_NList_SortType. + + See examples for special values. + + EXAMPLES + Many times this method will be used to sort multicolumn list in different + ways when the user click on title buttons : + + DoMethod(list,MUIM_Notify,MUIA_NList_TitleClick, MUIV_EveryTime, + list, 3, MUIM_NList_Sort2, MUIV_TriggerValue, MUIV_NList_SortTypeAdd_xxx); + + if MUIV_NList_SortTypeAdd_None then the hook sort_type value will be the column + number. + if MUIV_NList_SortTypeAdd_2Values then the hook sort_type value will be a cycle of + values which change on each click : + o Column number (first time) + o Column number + MUIV_NList_SortTypeAdd_2Values + o back to column number ... + + if MUIV_NList_SortTypeAdd_4Values then the hook sort_type value will be a cycle of + values which change on each click : + o Column number (first time) + o Column number + MUIV_NList_SortTypeAdd_4Values + o Column number + MUIV_NList_SortTypeAdd_4Values*2 + o Column number + MUIV_NList_SortTypeAdd_4Values*3 + o back to column number ... + See NList-Demo program. + + SEE ALSO + MUIA_NList_CompareHook2, MUIM_NList_Sort, MUIM_NList_Sort3, MUIA_NList_SortType, + MUIA_NList_SortType2 + NList.mcc/MUIM_NList_Sort3 + + NAME + MUIM_NList_Sort3 -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_Sort3,LONG sort_type, LONG sort_type_add, LONG which); + + FUNCTION + Same function as MUIM_NList_Sort2 but will set MUIA_NList_SortType, + MUIA_NList_SortType2 or both before starting the sort. + + When using MUIV_NList_Sort3_SortType_Both the method will change + MUIA_NList_SortType exactly the same way as MUIM_NList_Sort2 would do + it, then copy that value to MUIA_NList_SortType2. + + It is really usefull only if you use MUIA_NList_CompareHook2 instead + of classic MUIA_NList_CompareHook so your hook will be able to do + different type of sort when NList_SortType change. + + INPUTS + sort_type - The new MUIA_NList_SortType/2 value. + + sort_type_add - If 0 then sort_type will be the new MUIA_NList_SortType/2, + else if current MUIA_NList_SortType/2 & MUIV_NList_SortTypeValue_Mask + is same as sort_type then sort_type_add will be added to the + MUIA_NList_SortType/2 value, + else sort_type will be the new MUIA_NList_SortType/2. + + which - MUIV_NList_Sort3_SortType_1 set MUIA_NList_SortType value. + MUIV_NList_Sort3_SortType_2 set MUIA_NList_SortType2 value. + MUIV_NList_Sort3_SortType_Both set MUIA_NList_SortType value + then copy it to MUIA_NList_SortType2. + + EXAMPLES + See NList-Demo program. + + SEE ALSO + MUIA_NList_CompareHook2, MUIM_NList_Sort, MUIM_NList_Sort2, MUIA_NList_SortType, + MUIA_NList_SortType2 + NList.mcc/MUIM_NList_TestPos + + NAME + MUIM_NList_TestPos -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_TestPos,LONG x, LONG y, struct MUI_NList_TestPos_Result *res); + + FUNCTION + Find out which informations of a list which is currently + displayed at a certain position. + + You must give a pointer to a valid MUI_NList_TestPos_Result struct. + + Set x AND y to MUI_MAXMAX to get infos about the last click position ! + + See NList_mcc.h to know what values will be set in the struct. + + Preset char_number to -2 in the struct to not get char_number and char_xoffset + informations. It's usefull if you don't need them because it will be + faster for the method without finding them. the -2 value will stay valid + for next call. + + You'll get char number from what you return from the DisplayHook if there is + one, else from the beginning of the string/entry ptr. + + Be aware: if you use MUIM_List_TestPos you have to give a pointer to a + struct MUI_List_TestPos_Result, and you'll get same infos as using a List object. + It wasn't done as is before, makeing enforcer hits when trying to use NList + or NFloattext with a Listview instead of a NListview (avoid it please, it's not + done for it as Listview try to make many things itself, with possible conficts), + because struct MUI_NList_TestPos_Result is bigger !!! + + NOTE + column in the struct MUI_NList_TestPos_Result is the visible column number ! + NList.mcc/MUIM_NList_UseImage + + NAME + MUIM_NList_UseImage -- + + SYNOPSIS + DoMethod(obj,MUIM_NList_UseImage,Object *obj, ULONG imgnum, ULONG flags); + + FUNCTION + If you want to use MUIM_NList_CreateImage/MUIM_NList_DeleteImage + as you should, you must make a NList subclass which call them + from Setup() and Cleanup(), and it's sometime complicated. + + To avoid that, you can use MUIM_NList_UseImage. NList will + store the Bitmap/Bodychunk object you give and will make + CreateImage and DeleteImage itself ! + + MUIM_NList_UseImage can use same object as MUIM_NList_CreateImage ! + + NULL is a valid obj. It will erase any previously UseImage + with the same imgnum. + + The imgnum you give is the number that you will use in + \33o[] sequence as the number. + MUIM_NList_UseImage will accept 0 <= imgnum < 8192, anyway + use small value if you can because an array will be allocated + with the biggest imgnum value as size to store the + Bitmap/Bodychunk objects. + + DoMethod(obj,MUIM_NList_UseImage, NULL, MUIV_NList_UseImage_All, 0) + will set NULL to all stored objects, so you'll be able to dispose your + Bitmap/Bodychunk objects if you want, without waiting the NList + objet dispose. + + flags is the same than for MUIM_NList_CreateImage (0 unless special case). + + RESULT + TRUE if succeeded to store the obj (and allocate the array + if needed), else FALSE. + + There is no way to know if the MUIM_NList_CreateImage + needed to draw will succeed/has succeeded. + + ATTENTION: + The given Bitmap/Bodychunk object MUST be valid until the + NList object is disposed or you set another object (or NULL) + at the same imgnum ! + The Bitmap/Bodychunk object can be shared with other NList + object because NList just use it to get informations, anyway + you mustn't change informations of that object. If you to do + so, do a UseImage,NULL,x , change it then do UseImage,imgobj,x + again. + + SEE ALSO + MUIM_NList_CreateImage, MUIM_NList_DeleteImage + diff --git a/workbench/classes/zune/nlist/docs/MCC_NListtree.doc b/workbench/classes/zune/nlist/docs/MCC_NListtree.doc new file mode 100755 index 0000000000..35c6b3be3f --- /dev/null +++ b/workbench/classes/zune/nlist/docs/MCC_NListtree.doc @@ -0,0 +1,2968 @@ +TABLE OF CONTENTS + +NListtree.mcc/--background-- +NListtree.mcc/MUIA_NListtree_Active +NListtree.mcc/MUIA_NListtree_ActiveList +NListtree.mcc/MUIA_NListtree_AutoVisible +NListtree.mcc/MUIA_NListtree_CloseHook +NListtree.mcc/MUIA_NListtree_CompareHook +NListtree.mcc/MUIA_NListtree_ConstructHook +NListtree.mcc/MUIA_NListtree_CopyToClipHook +NListtree.mcc/MUIA_NListtree_DestructHook +NListtree.mcc/MUIA_NListtree_DisplayHook +NListtree.mcc/MUIA_NListtree_DoubleClick +NListtree.mcc/MUIA_NListtree_DragDropSort +NListtree.mcc/MUIA_NListtree_DropTarget +NListtree.mcc/MUIA_NListtree_DropTargetPos +NListtree.mcc/MUIA_NListtree_DropType +NListtree.mcc/MUIA_NListtree_DupNodeName +NListtree.mcc/MUIA_NListtree_EmptyNodes +NListtree.mcc/MUIA_NListtree_FindNameHook +NListtree.mcc/MUIA_NListtree_FindUserDataHook +NListtree.mcc/MUIA_NListtree_Format +NListtree.mcc/MUIA_NListtree_MultiSelect +NListtree.mcc/MUIA_NListtree_MultiTestHook +NListtree.mcc/MUIA_NListtree_OpenHook +NListtree.mcc/MUIA_NListtree_Quiet +NListtree.mcc/MUIA_NListtree_ShowTree +NListtree.mcc/MUIA_NListtree_Title +NListtree.mcc/MUIA_NListtree_TreeColumn +NListtree.mcc/MUIM_NListtree_Active +NListtree.mcc/MUIM_NListtree_Clear +NListtree.mcc/MUIM_NListtree_Close +NListtree.mcc/MUIM_NListtree_Compare +NListtree.mcc/MUIM_NListtree_Construct +NListtree.mcc/MUIM_NListtree_Copy +NListtree.mcc/MUIM_NListtree_CopyToClip +NListtree.mcc/MUIM_NListtree_Destruct +NListtree.mcc/MUIM_NListtree_Display +NListtree.mcc/MUIM_NListtree_DoubleClick +NListtree.mcc/MUIM_NListtree_DropDraw +NListtree.mcc/MUIM_NListtree_DropType +NListtree.mcc/MUIM_NListtree_Exchange +NListtree.mcc/MUIM_NListtree_FindName +NListtree.mcc/MUIM_NListtree_FindUserData +NListtree.mcc/MUIM_NListtree_GetEntry +NListtree.mcc/MUIM_NListtree_GetNr +NListtree.mcc/MUIM_NListtree_Insert +NListtree.mcc/MUIM_NListtree_InsertStruct +NListtree.mcc/MUIM_NListtree_Move +NListtree.mcc/MUIM_NListtree_MultiTest +NListtree.mcc/MUIM_NListtree_NextSelected +NListtree.mcc/MUIM_NListtree_Open +NListtree.mcc/MUIM_NListtree_PrevSelected +NListtree.mcc/MUIM_NListtree_Redraw +NListtree.mcc/MUIM_NListtree_Remove +NListtree.mcc/MUIM_NListtree_Rename +NListtree.mcc/MUIM_NListtree_Select +NListtree.mcc/MUIM_NListtree_Sort +NListtree.mcc/MUIM_NListtree_TestPos + NListtree.mcc/--background-- NListtree.mcc/--background-- + + There are two possible entry-types in a NListtree class list: + Leaves and nodes. Leaves are simple entries which have no special + features except they are holding some data. Nodes are almost + the same type, holding data too, but having a list attached + where you can simply add other entries which can be again leaves + or nodes. + + Every node is structured as follows: + + struct MUI_NListtree_TreeNode { + + struct MinNode tn_Node; + STRPTR tn_Name; + UWORD tn_Flags; + APTR tn_User; + }; + + It contains a name field tn_Name, flags tn_Flags and a pointer to + user data tn_User. + + The tn_Flags field can hold the following flags: + + TNF_LIST The node contains a list where other nodes + can be inserted. + + TNF_OPEN The list node is open, sub nodes are displayed. + + TNF_FROZEN The node doesn't react on doubleclick or + open/close by the user. + + TNF_NOSIGN The indicator of list nodes isn't shown. + + TNF_SELECTED The entry is currently selected. + + These flags, except TNF_SELECTED, can be used in + MUIM_NListtree_Insert at creation time. They will be passed to + the newly created entry. Also you can do a quick check about the + state and kind of each entry. But - NEVER EVER - modify any flag + yourself or NListtree will crash. Be warned! + + ********************************************************************* + THE ABOVE STRUCT IS READ-ONLY!! NEVER CHANGE ANY ENTRY OF THIS + STRUCTURE DIRECTLY NOR THINK ABOUT THE CONTENTS OF ANY PRIVATE + FIELD OR YOU WILL DIE IN HELL! + ********************************************************************* + + + You can create very complex tree structures. NListtree only uses + one list which holds all information needed and has no extra + display list like other list tree classes ;-) + + The tree nodes can be inserted and removed, sorted, moved, exchanged, + renamed or multi selected. To sort you can also drag&drop them. + Modifications can be made in relation to the whole tree, to only one + level, to a sub-tree or to only one tree node. + + The user can control the listtree by the MUI keys, this means a node + is opened with "Right" and closed with "Left". Check your MUI prefs + for the specified keys. + + You can define which of the columns will react on double-clicking. + The node toggles its status from open or closed and vice versa. + + + Drag&Drop capabilities: + + If you set MUIA_NList_DragSortable to TRUE, the list tree will + become active for Drag&Drop. This means you can drag and drop + entries on the same list tree again. While dragging an indicator + shows where to drop. + + Drag a Drop on Result + + leaf leaf Exchange leaves. + node leaf Nothing happens. + entry closed node Move entry, the compare hook is used. + entry open node Move entry to defined position. + + You can not drop an entry on itself, nor can you drop an opened node on + any of its members. + + To exchange data with other objects, you have to create your own + subclass of NListtree class and react on the drag methods. + + NListtree.mcc/MUIA_NListtree_Active NListtree.mcc/MUIA_NListtree_Active + + NAME + + MUIA_NListtree_Active -- [.SG], struct MUI_NListtree_TreeNode * + + + SPECIAL VALUES + + MUIV_NListtree_Active_Off + MUIV_NListtree_Active_Parent + MUIV_NListtree_Active_First + MUIV_NListtree_Active_FirstVisible + MUIV_NListtree_Active_LastVisible + + + FUNCTION + + Setting this attribute will move the cursor to the defined tree node + if it is visible. If the node is in an opened tree the listview is + scrolling into the visible area. Setting MUIV_NListtree_Active_Off will + vanish the cursor. + + MUIV_NListtree_Active_First/FirstVisible/LastVisible are special values + for activating the lists first or the top/bottom visible entry. + + See MUIA_NListtree_AutoVisible for special activation features. + + If this attribute is read it returns the active tree node. The result + is MUIV_NListtree_Active_Off if there is no active entry. + + + NOTIFICATIONS + + You can create a notification on MUIA_NListtree_Active. The + TriggerValue is the active tree node. + + + SEE ALSO + + MUIA_NListtree_AutoVisible, MUIA_NList_First, MUIA_NList_Visible, + MUIA_NListtree_ActiveList + + NListtree.mcc/MUIA_NListtree_ActiveListListtree.mcc/MUIA_NListtree_ActiveList + + NAME + + MUIA_NListtree_ActiveList -- [..G], struct MUI_NListtree_TreeNode * + + + SPECIAL VALUES + + MUIV_NListtree_ActiveList_Off + + + FUNCTION + + If this attribute is read it returns the active list node. The + active list node is always the parent of the active entry. + The result is MUIV_NListtree_ActiveList_Off if there is no + active list (when there is no active entry). + + + NOTIFICATIONS + + You can create notifications on MUIA_NListtree_ActiveList. The + TriggerValue is the active list node. + + + SEE ALSO + + MUIA_NListtree_Active + + NListtree.mcc/MUIA_NListtree_AutoVisiblesttree.mcc/MUIA_NListtree_AutoVisible + + NAME + + MUIA_NListtree_AutoVisible -- [ISG], struct MUI_NListtree_TreeNode * + + + SPECIAL VALUES + + MUIV_NListtree_AutoVisible_Off + MUIV_NListtree_AutoVisible_Normal + MUIV_NListtree_AutoVisible_FirstOpen + MUIV_NListtree_AutoVisible_Expand + + + FUNCTION + + Set this to make your list automatically jump to the active + entry. + + MUIV_NListtree_AutoVisible_Off: + The display does NOT scroll the active entry into the + visible area. + + MUIV_NListtree_AutoVisible_Normal: + This will scroll the active entry into the visible area + if it is visible (entry is a member of an open node). + This is the default. + + MUIV_NListtree_AutoVisible_FirstOpen: + Nodes are not opened, but the first open parent node of + the active entry is scrolled into the visible area if the + active entry is not visible. + + MUIV_NListtree_AutoVisible_Expand: + All parent nodes are opened until the first open node is + reached and the active entry will be scrolled into the + visible area. + + + NOTIFICATIONS + + + SEE ALSO + + MUIA_NListtree_Active, MUIA_NList_AutoVisible + + NListtree.mcc/MUIA_NListtree_CloseHook NListtree.mcc/MUIA_NListtree_CloseHook + + NAME + + MUIA_NListtree_CloseHook -- [IS.], struct Hook * + + + SPECIAL VALUES + + + FUNCTION + + The close hook is called after a list node is closed, then you can + change the list. + + The close hook will be called with the hook in A0, the object in A2 + and a MUIP_NListtree_CloseMessage struct in A1 (see nlisttree_mcc.h). + + To remove the hook set this to NULL. + + + NOTIFICATION + + + SEE ALSO + + MUIA_NListtree_Open, MUIA_NListtree_CloseHook + + + NListtree.mcc/MUIA_NListtree_CompareHooksttree.mcc/MUIA_NListtree_CompareHook + + NAME + + MUIA_NListtree_CompareHook -- [IS.], struct Hook * + + + SPECIAL VALUES + + MUIV_NListtree_CompareHook_Head + MUIV_NListtree_CompareHook_Tail + MUIV_NListtree_CompareHook_LeavesTop + MUIV_NListtree_CompareHook_LeavesMixed + MUIV_NListtree_CompareHook_LeavesBottom + + + FUNCTION + + Set this attribute to your own hook if you want to sort the entries in + the list tree by your own way. + + When you sort your list or parts of your list via MUIM_NListtree_Sort, + using the insert method with MUIV_NListtree_Insert_Sort or dropping an + entry on a closed node, this compare hook is called. + + There are some builtin compare hooks available, called: + + MUIV_NListtree_CompareHook_Head + Any entry is inserted at head of the list. + + MUIV_NListtree_CompareHook_Tail + Any entry is inserted at tail of the list. + + MUIV_NListtree_CompareHook_LeavesTop + Leaves are inserted at top of the list, nodes at bottom. They are + alphabetically sorted. + + MUIV_NListtree_CompareHook_LeavesMixed + The entries are only alphabetically sorted. + + MUIV_NListtree_CompareHook_LeavesBottom + Leaves are inserted at bottom of the list, nodes at top. They are + alphabetically sorted. This is default. + + The hook will be called with the hook in A0, the object in A2 and + a MUIP_NListtree_CompareMessage struct in A1 (see nlisttree_mcc.h). You + should return something like: + + <0 (TreeNode1 < TreeNode2) + 0 (TreeNode1 == TreeNode2) + >0 (TreeNode1 > TreeNode2) + + + NOTIFICATION + + + SEE ALSO + + MUIA_NListtree_Insert, MUIM_DragDrop, + MUIA_NList_CompareHook + + + NListtree.mcc/MUIA_NListtree_ConstructHookee.mcc/MUIA_NListtree_ConstructHook + + NAME + + MUIA_NListtree_ConstructHook -- [IS.], struct Hook * + + + SPECIAL VALUES + + MUIV_NListtree_ConstructHook_String + + MUIV_NListtree_ConstructHook_Flag_AutoCreate + If using the KeepStructure feature in MUIM_NListtree_Move or + MUIM_NListtree_Copy, this flag will be set when calling your + construct hook. Then you can react if your hook is not simply + allocating memory. + + + FUNCTION + + The construct hook is called whenever you add an entry to your + listtree. The pointer isn't inserted directly, the construct hook is + called and its result code is added. + + When an entry shall be removed the corresponding destruct hook is + called. + + The construct hook will be called with the hook in A0, the object in + A2 and a MUIP_NListtree_ConstructMessage struct in A1 (see + nlisttree_mcc.h). + The message holds a standard kick 3.x memory pool pointer. If you want, + you can use the exec or amiga.lib functions for allocating memory + within this pool, but this is only an option. + + If the construct hook returns NULL, nothing will be added to the list. + + There is a builtin construct hook available called + MUIV_NListtree_ConstructHook_String. This expects that the field + 'tn_User' in the treenode is a string pointer (STRPTR), which's + string is copied. + Of course you have to use MUIV_NListtree_DestructHook_String in + this case! + + To remove the hook set this to NULL. + + NEVER pass a NULL pointer when you have specified the internal string + construct/destruct hooks or NListtree will die! + + + NOTIFICATION + + + SEE ALSO + + MUIA_NList_ConstructHook, MUIA_NListtree_DestructHook, + MUIA_NListtree_DisplayHook + + + NListtree.mcc/MUIA_NListtree_CopyToClipHook.mcc/MUIA_NListtree_CopyToClipHook + + NAME + + MUIA_NListtree_CopyToClipHook -- [IS.], + + + SPECIAL VALUES + + MUIV_NListtree_CopyToClipHook_Default + + + FUNCTION + + This thing works near like MUIA_NListtree_DisplayHook, but is + called when the NListtree object want to make a clipboard copy. + + You can return only one string pointer. If you return NULL, + nothing will be copied. If you return -1, the entry will be + handled as a normal string and the name field is used. + + The builtin hook skips all ESC sequences and adds a tab char + between columns. + + + NOTIFICATION + + + SEE ALSO + + MUIM_NListtree_CopyToClip + + + NListtree.mcc/MUIA_NListtree_DestructHooktree.mcc/MUIA_NListtree_DestructHook + + NAME + + MUIA_NListtree_DestructHook -- [IS.], struct Hook * + + + SPECIAL VALUES + + MUIV_NListtree_DestructHook_String + + + FUNCTION + + Set up a destruct hook for your listtree. The destruct hook is called + whenevere you remove an entry from the listtree. Here you can free memory + which was allocated by the construct hook before. + + The destruct hook will be called with the hook in A0, the object + in A2 and a MUIP_NListtree_DestructMessage struct in A1 (see + nlisttree_mcc.h). + The message holds a standard kick 3.x memory pool pointer. You must + use this pool when you have used it inside the construct hook to + allocate pooled memory. + + There is a builtin destruct hook available called + MUIV_NListtree_DestructHook_String. This expects that the 'User' data + in the treenode is a string and you have used + MUIV_NListtree_ConstructHook_String in the construct hook! + + To remove the hook set this to NULL. + + + NOTIFICATION + + + SEE ALSO + + MUIA_NList_ConstructHook, MUIA_NListtree_ConstructHook, + MUIA_NListtree_DisplayHook + + + NListtree.mcc/MUIA_NListtree_DisplayHooksttree.mcc/MUIA_NListtree_DisplayHook + + NAME + + MUIA_NListtree_DisplayHook -- [IS.], + + + SPECIAL VALUES + + + FUNCTION + + You have to supply a display hook to specify what should be shown in + the listview, otherwise only the name of the nodes is displayed. + + The display hook will be called with the hook in A0, the object in + A2 and a MUIP_NListtree_DisplayMessage struct in A1 (see nlisttree_mcc.h) +. + + The structure holds a pointer to a string array containing as many + entries as your listtree may have columns. You have to fill this + array with the strings you want to display. Check out that the array + pointer of the tree column is set to NULL, if the normal name of the + node should appear. + You can set a preparse string in Preparse for the corresponding col + element. Using it you'll be able to avoid copying the string in a + buffer to add something in the beginning of the col string. + + The display hook also gets the position of the current entry as + additional parameter. It is stored in the longword preceding the col + array (don't forget it's a LONG). + + You can set the array pointer of the tree column to a string, which is + diplayed instead of the node name. You can use this to mark nodes. + + See MUIA_NList_Format for details about column handling. + + To remove the hook and use the internal default display hook set this + to NULL. + + + NOTIFICATION + + + SEE ALSO + + MUIA_NList_Format, MUIA_Text_Contents + + + NListtree.mcc/MUIA_NListtree_DoubleClicksttree.mcc/MUIA_NListtree_DoubleClick + + NAME + + MUIA_NListtree_DoubleClick -- [ISG], ULONG + + + SPECIAL VALUES + + MUIV_NListtree_DoubleClick_Off + MUIV_NListtree_DoubleClick_All + MUIV_NListtree_DoubleClick_Tree + MUIV_NListtree_DoubleClick_NoTrigger + + + FUNCTION + + A doubleclick opens a node if it was closed, it is closed if the node + was open. You have to set the column which should do this. + + Normally only the column number is set here, but there are special + values: + + MUIV_NListtree_DoubleClick_Off: + A doubleclick is not handled. + + MUIV_NListtree_DoubleClick_All: + All columns react on doubleclick. + + MUIV_NListtree_DoubleClick_Tree + Only a doubleclick on the defined tree column is recognized. + + MUIV_NListtree_DoubleClick_NoTrigger: + A doubleclick is not handled and not triggered! + + + NOTIFICATION + + The TriggerValue of the notification is the tree node you have double- + clicked, you can GetAttr() MUIA_NListtree_DoubleClick for the column + number. The struct 'MUI_NListtree_TreeNode *' is used for trigger. + + The notification is done on leaves and on node columns, which are not + set in MUIA_NListtree_DoubleClick. + + SEE ALSO + + + NListtree.mcc/MUIA_NListtree_DragDropSorttree.mcc/MUIA_NListtree_DragDropSort + + NAME + + MUIA_NListtree_DragDropSort -- [IS.], BOOL + + + SPECIAL VALUES + + + FUNCTION + + Setting this attribute to FALSE will disable the ability to sort the + list tree by drag & drop. Defaults to TRUE. + + + NOTIFICATION + + + SEE ALSO + + + + NListtree.mcc/MUIA_NListtree_DropTargetListtree.mcc/MUIA_NListtree_DropTarget + + NAME + + MUIA_NListtree_DropTarget -- [..G], ULONG + + + SPECIAL VALUES + + FUNCTION + + After a successfull drop operation, this value holds the entry where + the entry was dropped. The relative position (above etc.) can be + obtained by reading the attribute MUIA_NListtree_DropType. + + + NOTIFICATION + + + SEE ALSO + + MUIA_NListtree_DropTargetPos, MUIA_NListtree_DropType + + + NListtree.mcc/MUIA_NListtree_DropTargetPosee.mcc/MUIA_NListtree_DropTargetPos + + NAME + + MUIA_NListtree_DropTargetPos -- [..G], ULONG + + + SPECIAL VALUES + + FUNCTION + + After a successfull drop operation, this value holds the integer + position of the entry where the dragged entry was dropped. The + entry itself can be obtained by reading MUIA_NListtree_DropTarget, + the relative position (above etc.) can be obtained by reading the + attribute MUIA_NListtree_DropType. + + + NOTIFICATION + + + SEE ALSO + + MUIA_NListtree_DropTarget, MUIA_NListtree_DropType + + + NListtree.mcc/MUIA_NListtree_DropType NListtree.mcc/MUIA_NListtree_DropType + + NAME + + MUIA_NListtree_DropType -- [..G], ULONG + + + SPECIAL VALUES + + MUIV_NListtree_DropType_None + MUIV_NListtree_DropType_Above + MUIV_NListtree_DropType_Below + MUIV_NListtree_DropType_Onto + + + FUNCTION + + After a successfull drop operation, this value holds the position + relative to the value of MUIA_NListtree_DropTarget/DropTargetPos. + + + NOTIFICATION + + + SEE ALSO + + MUIA_NListtree_DropTarget, MUIA_NListtree_DropTargetPos + + + NListtree.mcc/MUIA_NListtree_DupNodeNamesttree.mcc/MUIA_NListtree_DupNodeName + + NAME + + MUIA_NListtree_DupNodeName -- [IS.], BOOL + + + SPECIAL VALUES + + + FUNCTION + + If this attribute is set to FALSE the names of the node will not be + duplicated, only the string pointers are used. Be careful the strings + have to be valid everytime. + + + NOTIFICATION + + + SEE ALSO + + + + NListtree.mcc/MUIA_NListtree_EmptyNodesListtree.mcc/MUIA_NListtree_EmptyNodes + + NAME + + MUIA_NListtree_EmptyNodes -- [IS.], BOOL + + + SPECIAL VALUES + + + FUNCTION + + Setting this attribute to TRUE will display all empty nodes as leaves, + this means no list indicator is shown. Nevertheless the entry is + handled like a node. + + + NOTIFICATION + + + SEE ALSO + + + + NListtree.mcc/MUIA_NListtree_FindNameHooktree.mcc/MUIA_NListtree_FindNameHook + + NAME + + MUIA_NListtree_FindNameHook -- [IS.], + + + SPECIAL VALUES + + MUIV_NListtree_FindNameHook_CaseSensitive + Search for the complete string, case sensitive. + + MUIV_NListtree_FindNameHook_CaseInsensitive + Search for the complete string, case insensitive. + + MUIV_NListtree_FindNameHook_Part + Search for the first part of the string, case sensitive. + + MUIV_NListtree_FindNameHook_PartCaseInsensitive + Search for the first part of the string, case insensitive. + + MUIV_NListtree_FindNameHook_PointerCompare + Do only a pointer comparision. Note, that this is in fact + a pointer subtraction to fit into the rules. It returns + the difference (~0) of the two fields if no match. + + FUNCTION + + You can install a FindName hook to specify your own search + criteria. + + The find name hook will be called with the hook in A0, the object in + A2 and a MUIP_NListtree_FindNameMessage struct in A1 + (see nlisttree_mcc.h). It should return ~ 0 for entries which are + not matching the pattern and a value of 0 if a match. + + The find name message structure holds a pointer to a string + containing the name to search for and pointers to the name- and user- + field of the node which is currently processed. + + The MUIV_NListtree_FindNameHook_CaseSensitive will be used as default. + + NOTIFICATION + + + SEE ALSO + + + NListtree.mcc/MUIA_NListtree_FindUserDataHook/MUIA_NListtree_FindUserDataHook + + NAME + + MUIA_NListtree_FindUserDataHook -- [IS.], + + + SPECIAL VALUES + + MUIV_NListtree_FindUserDataHook_CaseSensitive + Search for the complete string, case sensitive. + + MUIV_NListtree_FindUserDataHook_CaseInsensitive + Search for the complete string, case insensitive. + + MUIV_NListtree_FindUserDataHook_Part + Search for the first part of the string, case sensitive. + + MUIV_NListtree_FindUserDataHook_PartCaseInsensitive + Search for the first part of the string, case insensitive. + + MUIV_NListtree_FindUserDataHook_PointerCompare + Do only a pointer comparision. Note, that this is in fact + a pointer subtraction to fit into the rules. It returns + the difference (~0) of the two user fields if no match. + + + FUNCTION + + You can install a FindUserData hook to specify your own search + criteria. + + The find user data hook will be called with the hook in A0, the object + in A2 and a MUIP_NListtree_FindUserDataMessage struct in A1 + (see nlisttree_mcc.h). It should return ~ 0 for entries which are + not matching the pattern and a value of 0 if a match. + + The find user data message structure holds a pointer to a string + containing the data to search for and pointers to the user- and name- + field of the node which is currently processed. + + MUIV_NListtree_FindUserDataHook_CaseSensitive will be used as + default. + + NOTIFICATION + + + SEE ALSO + + + NListtree.mcc/MUIA_NListtree_Format NListtree.mcc/MUIA_NListtree_Format + + NAME + + MUIA_NListtree_Format -- [IS.], STRPTR + + + SPECIAL VALUES + + + FUNCTION + + Same as MUIA_NList_Format, but one column is reserved for the tree + indicators and the names of the nodes. + + For further detailed information see MUIA_NList_Format! + + + NOTIFICATION + + + SEE ALSO + + MUIA_NList_Format, MUIA_NListtree_DisplayHook, + MUIA_Text_Contents + + + NListtree.mcc/MUIA_NListtree_MultiSelectsttree.mcc/MUIA_NListtree_MultiSelect + + NAME + + MUIA_NListtree_MultiSelect -- [I..], + + + SPECIAL VALUES + + MUIV_NListtree_MultiSelect_None + MUIV_NListtree_MultiSelect_Default + MUIV_NListtree_MultiSelect_Shifted + MUIV_NListtree_MultiSelect_Always + + + FUNCTION + + Four possibilities exist for a listviews multi select + capabilities: + + MUIV_NListtree_MultiSelect_None: + The list tree cannot multiselect at all. + + MUIV_NListtree_MultiSelect_Default: + The multi select type (with or without shift) + depends on the users preferences setting. + + MUIV_NListtree_MultiSelect_Shifted: + Overrides the users prefs, multi selecting only + together with shift key. + + MUIV_NListtree_MultiSelect_Always: + Overrides the users prefs, multi selecting + without shift key. + + + NOTIFICATION + + NOTES + + SEE ALSO + + MUIA_NListtree_MultiTestHook, MUIM_NListtree_MultiSelect + + + NListtree.mcc/MUIA_NListtree_MultiTestHookee.mcc/MUIA_NListtree_MultiTestHook + + NAME + + MUIA_NListtree_MultiTestHook -- [IS.], struct Hook * + + + SPECIAL VALUES + + + FUNCTION + + If you plan to have a multi selecting list tree but not + all of your entries are actually multi selectable, you + can supply a MUIA_NListtree_MultiTestHook. + + The multi test hook will be called with the hook in A0, the object + in A2 and a MUIP_NListtree_MultiTestMessage struct in A1 (see + nlisttree_mcc.h) and should return TRUE if the entry is multi + selectable, FALSE otherwise. + + To remove the hook set this to NULL. + + + NOTIFICATION + + + SEE ALSO + + MUIA_NListtree_ConstructHook, MUIA_NListtree_DestructHook + + + NListtree.mcc/MUIA_NListtree_OpenHook NListtree.mcc/MUIA_NListtree_OpenHook + + NAME + + MUIA_NListtree_OpenHook -- [IS.], struct Hook * + + + SPECIAL VALUES + + + FUNCTION + + The open hook is called whenever a list node will be opened, so you + can change the list before the node is open. + + The open hook will be called with the hook in A0, the object in A2 + and a MUIP_NListtree_OpenMessage struct in A1 (see nlisttree_mcc.h). + + To remove the hook set this to NULL. + + + NOTIFICATION + + + SEE ALSO + + MUIA_NListtree_Open, MUIA_NListtree_CloseHook + + + NListtree.mcc/MUIA_NListtree_Quiet NListtree.mcc/MUIA_NListtree_Quiet + + NAME + + MUIA_NListtree_Quiet -- [.S.], QUIET + + + SPECIAL VALUES + + + FUNCTION + + If you add/remove lots of entries to/from a listtree, this will cause + lots of screen action and slow down the operation. Setting + MUIA_NListtree_Quiet to TRUE will temporarily prevent the listtree from + being refreshed, this refresh will take place only once when you set + it back to FALSE again. + + MUIA_NListtree_Quiet holds a nesting count to avoid trouble with + multiple setting/unsetting this attribute. You are encoraged to + always use TRUE/FALSE pairs here or you will went in trouble. + + DO NOT USE MUIA_NList_Quiet here! + + + NOTIFICATION + + + SEE ALSO + + MUIM_NListtree_Insert, MUIM_NListtree_Remove + + + NListtree.mcc/MUIA_NListtree_ShowTree NListtree.mcc/MUIA_NListtree_ShowTree + + NAME + + MUIA_NListtree_ShowTree -- [ISG], ULONG + + + SPECIAL VALUES + + FUNCTION + + Specify FALSE here if you want the whole tree to be disappear. + Defaults to TRUE; + + NOTIFICATION + + + SEE ALSO + + + NListtree.mcc/MUIA_NListtree_Title NListtree.mcc/MUIA_NListtree_Title + + NAME + + MUIA_NListtree_Title -- [IS.], BOOL + + + SPECIAL VALUES + + + FUNCTION + + Specify a title for the current listtree. + + For detailed information see MUIA_NList_Title! + + + NOTIFICATION + + + BUGS + + The title should not be a string as for single column listviews. This + attribute can only be set to TRUE or FALSE. + + + SEE ALSO + + + + NListtree.mcc/MUIA_NListtree_TreeColumnListtree.mcc/MUIA_NListtree_TreeColumn + + NAME + + MUIA_NListtree_TreeColumn -- [ISG], ULONG + + + SPECIAL VALUES + + FUNCTION + + Specify the column of the list tree, the node indicator and the name + of the node are displayed in. + + + NOTIFICATION + + + SEE ALSO + + MUIA_NListtree_DisplayHook, MUIA_NListtree_Format + + + NListtree.mcc/MUIM_NListtree_Active NListtree.mcc/MUIM_NListtree_Active + + NAME + + MUIM_NListtree_Active -- Called for every active change. (V1) + + + SYNOPSIS + + DoMethodA(obj, MUIM_NListtree_Active, + struct MUIP_NListtree_Active *activemessage); + + + FUNCTION + + This method must not be called directly. It will be called by + NListtree if the active entry changes. This is an addition to + MUIA_NListtree_Active + + + INPUTS + + RESULT + + EXAMPLE + + NOTES + + BUGS + + SEE ALSO + + MUIA_NListtree_Active + + + NListtree.mcc/MUIM_NListtree_Clear NListtree.mcc/MUIM_NListtree_Clear + + NAME + + MUIM_NListtree_Clear -- Clear the complete listview. (V1) + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Clear, NULL, 0) + + + FUNCTION + + Clear the complete listview, calling destruct hook for each entry. + + + INPUTS + + RESULT + + EXAMPLE + + // Clear the listview! + DoMethod( nlisttree, MUIM_NListtree_Clear, NULL, 0 ); + + + NOTES + + For now, when using this method, you MUST supply NULL for the list + node and 0 for flags for future compatibility. + This will definitely change! + + + BUGS + + SEE ALSO + + MUIM_NListtree_Remove, MUIA_NListtree_DestructHook, + + + NListtree.mcc/MUIM_NListtree_Close NListtree.mcc/MUIM_NListtree_Close + + NAME + + MUIM_NListtree_Close -- Close the specified list node. (V1) + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Close, + struct MUI_NListtree_TreeNode *listnode, + struct MUI_NListtree_TreeNode *treenode, + ULONG flags); + + + FUNCTION + + Close a node or nodes of a listtree. It is checked if the tree node + is a node, not a leaf! + + When the active entry was a child of the closed node, the closed node + will become active. + + + INPUTS + + listnode - Specify the node which list is used to find the entry. The + search is started at the head of this list. + + MUIV_NListtree_Close_ListNode_Root + The root list is used. + + MUIV_NListtree_Close_ListNode_Parent + The list which is the parent of the active list is used. + + MUIV_NListtree_Close_ListNode_Active + The list of the active node is used. + + + treenode - The node which should be closed. If there are children + of the node, they are also closed. + + MUIV_NListtree_Close_TreeNode_Head + The head of the list defined in 'listnode' is closed. + + MUIV_NListtree_Close_TreeNode_Tail: + Closes the tail of the list defined in 'listnode'. + + MUIV_NListtree_Close_TreeNode_Active: + Closes the active node. + + MUIV_NListtree_Close_TreeNode_All: + Closes all nodes of the list which is specified in + 'listnode'. + + + RESULT + + EXAMPLE + + // Close the active list. + DoMethod(obj, MUIM_NListtree_Close, + MUIV_NListtree_Close_ListNode_Active, + MUIV_NListtree_Close_TreeNode_Active, 0); + + + NOTES + + BUGS + + SEE ALSO + MUIM_NListtree_Open + + + NListtree.mcc/MUIM_NListtree_Compare NListtree.mcc/MUIM_NListtree_Compare + + NAME + + MUIM_NListtree_Compare -- Compare two nodes + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Compare, + struct MUI_NListtree_TreeNode *TreeNode1, + struct MUI_NListtree_TreeNode *TreeNode2, + ULONG SortType); + + + FUNCTION + + Compares the two given treenodes. You should return something like: + + <0 (TreeNode1 < TreeNode2) + 0 (TreeNode1 == TreeNode2) + >0 (TreeNode1 > TreeNode2) + + + NOTIFICATION + + + SEE ALSO + + MUIA_NListtree_CompareHook + + + NListtree.mcc/MUIA_NListtree_Construct NListtree.mcc/MUIA_NListtree_Construct + + NAME + + MUIN_NListtree_Construct -- Create a new treenode + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Construct, + STRPTR Name, + APTR UserData, + APTR MemPool, + ULONG Flags); + + + FUNCTION + + This method is called whenever a new treenode is to be added to the + listtree. See MUIA_NListtree_ConstructHook for more details. + + If the method returns NULL, nothing will be added to the list. + + + NOTIFICATION + + + SEE ALSO + + MUIA_NListtree_ConstructHook, MUIA_NListtree_DestructHook + + + NListtree.mcc/MUIM_NListtree_Copy NListtree.mcc/MUIM_NListtree_Copy + + NAME + + MUIM_NListtree_Copy -- Copy an entry (create it) to the spec. pos. (V1) + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Copy, + struct MUI_NListtree_TreeNode *srclistnode, + struct MUI_NListtree_TreeNode *srctreenode, + struct MUI_NListtree_TreeNode *destlistnode, + struct MUI_NListtree_TreeNode *desttreenode, + ULONG flags); + + + FUNCTION + + Copy an entry to the position after a defined node. The complete + child structure will be copied. + + + INPUTS + + srclistnode - Specify the node which list is used to find the + entry. The search is started at the head of this + list. + + MUIV_NListtree_Copy_SourceListNode_Root + The root list is used as the starting point. + + MUIV_NListtree_Copy_SourceListNode_Active + The active list (the list of the active node) is used as + the starting point. + + srctreenode - Specifies the node which should be copied. + + MUIV_NListtree_Copy_SourceTreeNode_Head + The head of the list defined in 'srclistnode' is copied. + + MUIV_NListtree_Copy_SourceTreeNode_Tail + The tail of the list defined in 'srclistnode' is copied. + + MUIV_NListtree_Copy_SourceTreeNode_Active + The active node is copied. + + destlistnode - Specify the node which list is used to find the + entry. The search is started at the head of this + list. + + MUIV_NListtree_Copy_DestListNode_Root + The root list. + + MUIV_NListtree_Copy_DestListNode_Active + The list of the active node. + + desttreenode - This node is the predecessor of the entry which is + inserted. + + MUIV_NListtree_Copy_DestTreeNode_Head + The node is copied to the head of the list defined in + 'destlistnode'. + + MUIV_NListtree_Copy_DestTreeNode_Tail + The node is copied to the tail of the list defined in + 'destlistnode'. + + MUIV_NListtree_Copy_DestTreeNode_Active: + The node is copied to one entry after the active node. + + MUIV_NListtree_Copy_DestTreeNode_Sorted: + The node is copied to the list using the sort hook. + + flags - Some flags to adjust moving. + + MUIV_NListtree_Copy_Flag_KeepStructure + The full tree structure from the selected entry to + the root list is copied (created) at destination. + + + RESULT + + EXAMPLE + + // Copy the active entry to the head of + // another list node. + DoMethod(obj, + MUIV_NListtree_Copy_SourceListNode_Active, + MUIV_NListtree_Copy_SourceTreeNode_Active, + anylistnode, + MUIV_NListtree_Copy_DestTreeNode_Head, + 0); + + + NOTES + + BUGS + + SEE ALSO + + MUIM_NListtree_Insert, MUIM_NListtree_Remove, + MUIM_NListtree_Exchange, MUIA_NListtree_CompareHook, + MUIM_NListtree_Move + + + NListtree.mcc/MUIM_NListtree_CopyToClipListtree.mcc/MUIM_NListtree_CopyToClip + + NAME + + MUIM_NListtree_CopyToClip -- Called for every clipboard copy action. (V1) + + + SYNOPSIS + + DoMethodA(obj, MUIM_NListtree_CopyToClip, + struct MUIP_NListtree_CopyToClip *ctcmessage); + + + FUNCTION + + Do a copy to clipboard from an entry/entry content. + + + INPUTS + + TreeNode - Tree node to copy contents from. Use + MUIV_NListtree_CopyToClip_Active to copy the + active entry. + + Pos - Entry position. + + Unit - Clipboard unit to copy entry contents to. + + + RESULT + + EXAMPLE + + NOTES + + BUGS + + SEE ALSO + + MUIA_NListtree_CopyToClipHook + + + NListtree.mcc/MUIA_NListtree_Destruct NListtree.mcc/MUIA_NListtree_Destruct + + NAME + + MUIN_NListtree_Destruct -- Free a new treenode + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Destruct, + STRPTR Name, + APTR UserData, + APTR MemPool, + ULONG Flags); + + + FUNCTION + + This method is called whenever a new treenode is to be removed from the + listtree. See MUIA_NListtree_DestructHook for more details. + + + NOTIFICATION + + + SEE ALSO + + MUIA_NListtree_ConstructHook, MUIA_NListtree_DestructHook + + NListtree.mcc/MUIM_NListtree_Display NListtree.mcc/MUIA_NListtree_Display + + NAME + + MUIN_NListtree_Display -- Display a treenode + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Dispose, + struct MUI_NListtree_TreeNode *TreeNode, + LONG EntryPos, + STRPTR *Array, + STRPTR *Preparse); + + + FUNCTION + + This method is called whenever a new treenode is to be displayed in the + listtree. See MUIA_NListtree_DisplayHook for more details. + + + NOTIFICATION + + + SEE ALSO + + MUIA_NListtree_DisplayHook + + + NListtree.mcc/MUIM_NListtree_DoubleClicksttree.mcc/MUIM_NListtree_DoubleClick + + NAME + + MUIM_NListtree_DoubleClick -- Called for every double click. (V1) + + + SYNOPSIS + + DoMethodA(obj, MUIM_NListtree_DoubleClick, + struct MUIP_NListtree_DoubleClick *doubleclickmsg); + + + FUNCTION + + This method must not be called directly. It will be called by + NListtree if an double click event occurs. This is an addition to + MUIA_NListtree_DoubleClick + + + INPUTS + + RESULT + + EXAMPLE + + NOTES + + BUGS + + SEE ALSO + + MUIA_NListtree_DoubleClick + + + NListtree.mcc/MUIM_NListtree_DropDraw NListtree.mcc/MUIM_NListtree_DropDraw + + NAME + + MUIM_NListtree_DropDraw -- + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_DropDraw, LONG pos, LONG type, + LONG minx, LONG maxx, LONG miny, LONG maxy); + + + FUNCTION + + This method MUST NOT be called directly! + + It will be called by NListtree, and will draw the drop mark + previously fixed (pos and type) by MUIM_NListtree_DropType + within the minx, maxx, miny, maxy in the _rp(obj) rasport. + + For further information see method MUIM_NList_DropDraw. + + + INPUTS + + RESULT + + EXAMPLE + + NOTES + + BUGS + + SEE ALSO + + MUIM_NList_DropDraw + + + NListtree.mcc/MUIM_NListtree_DropType NListtree.mcc/MUIM_NListtree_DropType + + NAME + + MUIM_NListtree_DropType -- + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_DropType, LONG *pos, LONG *type, + LONG minx, LONG maxx, LONG miny, LONG maxy, + LONG mousex, LONG mousey); + + + FUNCTION + + This method MUST NOT be called directly ! + + It will be called by NListreet while the DragReport, with + default *pos and *type values depending on the drag pointer + position that you can modify as you want. + + For further information see method MUIM_NList_DropDraw. + + + INPUTS + + RESULT + + EXAMPLE + + NOTES + + BUGS + + SEE ALSO + + MUIM_NList_DropType + + + NListtree.mcc/MUIM_NListtree_Exchange NListtree.mcc/MUIM_NListtree_Exchange + + NAME + + MUIM_NListtree_Exchange -- Exchanges two tree nodes. (V1) + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Exchange, + struct MUI_NListtree_TreeNode *listnode1, + struct MUI_NListtree_TreeNode *treenode1, + struct MUI_NListtree_TreeNode *listnode2, + struct MUI_NListtree_TreeNode *treenode2, + ULONG flags); + + + FUNCTION + + Exchange two tree nodes. + + + INPUTS + + listnode1 - Specify the list node of the entry which + should be exchanged. + + MUIV_NListtree_Exchange_ListNode1_Root + The root list is used. + + MUIV_NListtree_Exchange_ListNode1_Active + The active list (the list of the active node) is used. + + treenode1 - Specify the node which should be exchanged. + + MUIV_NListtree_Exchange_TreeNode1_Head + The head of the list defined in 'listnode1' is + exchanged. + + MUIV_NListtree_Exchange_TreeNode1_Tail + The tail of the list defined in 'listnode1' is + exchanged. + + MUIV_NListtree_Exchange_TreeNode1_Active + The active node is exchanged. + + listnode2 - Specify the second list node which is used for exchange. + + MUIV_NListtree_Exchange_ListNode2_Root + The root list. + + MUIV_NListtree_Exchange_ListNode2_Active + The list of the active node. + + treenode2 - This node is the second entry which is exchanged. + + MUIV_NListtree_Exchange_TreeNode2_Head + The node 'treenode1' is exchanged with the head of the + list defined in 'listnode2'. + + MUIV_NListtree_Exchange_TreeNode2_Tail + The node 'treenode1' is exchanged with the tail of the + list defined in 'ln2'. + + MUIV_NListtree_Exchange_TreeNode2_Active: + The node 'treenode1' is exchanged with the active node. + + MUIV_NListtree_Exchange_TreeNode2_Up: + The node 'treenode1' is exchanged with the entry + previous to the one specified in 'treenode1'. + + MUIV_NListtree_Exchange_TreeNode2_Down: + The node 'treenode1' is exchanged with the entry next + (the successor) to the one specified in 'treenode1'. + + + RESULT + + EXAMPLE + + // Exchange the active entry with the successor. + DoMethod(obj, + MUIV_NListtree_Exchange_ListNode1_Active, + MUIV_NListtree_Exchange_TreeNode1_Active, + MUIV_NListtree_Exchange_ListNode2_Active, + MUIV_NListtree_Exchange_TreeNode2_Down, + 0); + + + NOTES + + BUGS + + SEE ALSO + + MUIM_NListtree_Move, MUIM_NListtree_Insert, + MUIM_NListtree_Remove + + + NListtree.mcc/MUIM_NListtree_FindName NListtree.mcc/MUIM_NListtree_FindName + + NAME + + MUIM_NListtree_FindName -- Find node using name match. (V1) + + + SYNOPSIS + + struct MUI_NListtree_TreeNode *treenode = + DoMethod(obj, MUIM_NListtree_FindName, + struct MUI_NListtree_TreeNode *listnode, + STRPTR name, ULONG flags); + + + FUNCTION + + Find a node which name matches the specified one using the list node as + start point.. + + + INPUTS + listnode - Specify the node which list is used to find the name. + + MUIV_NListtree_FindName_ListNode_Root + Use the root list as the base list. + + MUIV_NListtree_FindName_ListNode_Active + Use the list of the active node as the base. + + name - Specify the name of the node to find. But you can search + for anything in tn_Name or tn_User field here by simply + supplying the searched data and handling it in your + own FindNameHook. + + flags: + + MUIV_NListtree_FindName_Flag_SameLevel + Only nodes on the same level are affected. + + MUIV_NListtree_FindName_Flag_Visible + The node is only returned if it is visible (only visible + entries are checked). + + MUIV_NListtree_FindName_Flag_Activate + If found, the entry will be activated. + + MUIV_NListtree_FindName_Flag_Selected + Find only selected nodes. + + MUIV_NListtree_FindName_Flag_StartNode + The specified entry in listnode is the start point for + search and must not be a list node. It can also be a + normal entry. + + RESULT + + Returns the found node if available, NULL otherwise. + + + EXAMPLE + + // Find 2nd node by name. + struct MUI_NListtree_TreeNode *treenode = + DoMethod(obj, MUIM_NListtree_FindName, + listnode, "2nd node", + MUIV_NListtree_FindName_SameLevel| + MUIV_NListtree_FindName_Visible); + + if ( treenode == NULL ) + { + PrintToUser( "No matching entry found." ); + } + + + NOTES + + BUGS + + SEE ALSO + + MUIM_NListtree_FindUserData, MUIM_NListtree_GetEntry, + MUIA_NListtree_FindNameHook + + + NListtree.mcc/MUIM_NListtree_FindUserDatatree.mcc/MUIM_NListtree_FindUserData + + NAME + + MUIM_NListtree_FindUserData -- Find node upon user data. (V1) + + + SYNOPSIS + + struct MUI_NListtree_TreeNode *treenode = + DoMethod(obj, MUIM_NListtree_FindUserData, + struct MUI_NListtree_TreeNode *listnode, + APTR userdata, ULONG flags); + + + FUNCTION + + Find a node which user data matches the specified one using the list + node as start point.. + This method is designed as a second possibility for searching. + Because you are able to search for anything, you may set special + hooks for searching two different fields in two different hooks with + these two methods. + + + INPUTS + listnode - Specify the node which list is used to find the user data. + + MUIV_NListtree_FindUserData_ListNode_Root + Use the root list as the base list. + + MUIV_NListtree_FindUserData_ListNode_Active + Use the list of the active node as the base. + + userdata - Specify the user data of the node to find. You can search + for anything in tn_Name or tn_User field here by simply + supplying the searched data and handling it in your + own FindUserDataHook. + + flags: + + MUIV_NListtree_FindUserData_Flag_SameLevel + Only nodes on the same level are affected. + + MUIV_NListtree_FindUserData_Flag_Visible + The node is only returned if it is visible (only visible + entries are checked). + + MUIV_NListtree_FindUserData_Flag_Activate + If found, the entry will be activated. + + MUIV_NListtree_FindUserData_Flag_Selected + Find only selected nodes. + + MUIV_NListtree_FindUserData_Flag_StartNode + The specified entry in listnode is the start point for + search and must not be a list node. It can also be a + normal entry. + + RESULT + + Returns the found node if available, NULL otherwise. + + + EXAMPLE + + // Find node by user data. + struct MUI_NListtree_TreeNode *treenode = + DoMethod(obj, MUIM_NListtree_FindUserData, + listnode, "my data", + MUIV_NListtree_FindUserData_SameLevel| + MUIV_NListtree_FindUserData_Visible); + + if ( treenode == NULL ) + { + PrintToUser( "No matching entry found." ); + } + + + NOTES + + BUGS + + SEE ALSO + + MUIM_NListtree_FindName, MUIM_NListtree_GetEntry, + MUIA_NListtree_FindUserDataHook + + + NListtree.mcc/MUIM_NListtree_GetEntry NListtree.mcc/MUIM_NListtree_GetEntry + + NAME + + MUIM_NListtree_GetEntry -- Get another node in relation to this. (V1) + + + SYNOPSIS + + struct MUI_NListtree_TreeNode *rettreenode = + DoMethod(obj, MUIM_NListtree_GetEntry, + struct MUI_NListtree_TreeNode *treenode, + LONG pos, ULONG flags); + + + FUNCTION + + Get another node in relation to the specified list or node. + + + INPUTS + + treenode - Define the node which is used to find another one. + This can also be a list node, if the position is + related to a list. + + MUIV_NListtree_GetEntry_ListNode_Root + The root list is used. + + MUIV_NListtree_GetEntry_ListNode_Active: + The list with the active entry is used. + + pos - The relative position of the node 'treenode'. + + MUIV_NListtree_GetEntry_Position_Head + The head of the list is returned. + + MUIV_NListtree_GetEntry_Position_Tail + The tail of the list is returned. + + MUIV_NListtree_GetEntry_Position_Active + The active node is returned. If there is no active entry, + NULL is returned. + + MUIV_NListtree_GetEntry_Position_Next + The node next to the specified node is returned. Returns NULL + if there is no next entry. + + MUIV_NListtree_GetEntry_Position_Previous + The node right before the specified node is returned. + Returns NULL if there is no previous entry (if 'treenode' + is the head of the list. + + MUIV_NListtree_GetEntry_Position_Parent + The list node of the specified 'treenode' is returned. + + flags: + + MUIV_NListtree_GetEntry_Flag_SameLevel: + Only nodes in the same level are affected. + + MUIV_NListtree_GetEntry_Flag_Visible: + The position is counted on visible entries only. + + + RESULT + + Returns the requested node if available, NULL otherwise. + + + EXAMPLE + + // Get the next entry. + struct MUI_NListtree_TreeNode *treenode = + DoMethod(obj, MUIM_NListtree_GetEntry, treenode, + MUIV_NListtree_GetEntry_Position_Next, 0); + + if ( treenode != NULL ) + { + PrintToUser( "Next entry found!" ); + } + + + NOTES + + BUGS + + SEE ALSO + + MUIM_NList_GetEntry + + + NListtree.mcc/MUIM_NListtree_GetNr NListtree.mcc/MUIM_NListtree_GetNr + + NAME + + MUIM_NListtree_GetNr -- Get the position number of a tree node. (V1) + + + SYNOPSIS + + ULONG number = DoMethod(obj, MUIM_NListtree_GetNr, + struct MUI_NListtree_TreeNode *treenode, ULONG flags); + + + FUNCTION + + Get the position number of the specified tree node. + + + INPUTS + + treenode - Specify the node to count the position of. + + MUIV_NListtree_GetNr_TreeNode_Active: + The position is counted related to the active node. + + flags: + + MUIV_NListtree_GetNr_Flag_CountAll + Returns the number of all entries. + + MUIV_NListtree_GetNr_Flag_CountLevel + Returns the number of entries of the list the + specified node is in. + + MUIV_NListtree_GetNr_Flag_CountList + Returns the number of the entries of the active list node + (the specified node is in). + + MUIV_NListtree_GetNr_Flag_ListEmpty + Returns TRUE if the specified list node is empty. + + MUIV_NListtree_GetNr_Flag_Visible + Returns the position number of an visible entry. -1 if the + entry is invisible. The position is counted on visible entries + only. + + + RESULT + + EXAMPLE + + // Check if the active (list) node is empty. + ULONG empty = DoMethod(obj, MUIM_NListtree_GetNr, + MUIV_NListtree_GetNr_TreeNode_Active, + MUIV_NListtree_GetNr_Flag_ListEmpty); + + if ( empty == TRUE ) + { + AddThousandEntries(); + } + + NOTES + + BUGS + + SEE ALSO + + MUIM_NListtree_GetEntry + + NListtree.mcc/MUIM_NListtree_Insert NListtree.mcc/MUIM_NListtree_Insert + + NAME + + MUIM_NListtree_Insert -- Insert an entry at the specified position. (V1) + + + SYNOPSIS + + struct MUI_NListtree_TreeNode *treenode = + DoMethod(obj, MUIM_NListtree_Insert, + STRPTR name, APTR userdata, + struct MUI_NListtree_TreeNode *listnode, + struct MUI_NListtree_TreeNode *prevtreenode, + ULONG flags); + + + FUNCTION + + Insert an entry at the position, which is defined in 'listnode' + and 'prevtreenode'. Name contains the name of the entry as string + which is buffered. The user entry can be used as you like. + + + INPUTS + + name/userdata - What the names say ;-) + + + listnode - Specify the node which list is used to insert + the entry. + + MUIV_NListtree_Insert_ListNode_Root + Use the root list. + + MUIV_NListtree_Insert_ListNode_Active + Use the list of the active node. + + MUIV_NListtree_Insert_ListNode_ActiveFallback + Use the list of the active node. If no list is active, + an automatic fallback to the root list is done. + + MUIV_NListtree_Insert_ListNode_LastInserted + Insert entry in the list the last entry was inserted. + + + prevtreenode - The node which is the predecessor of the node + to insert. + + MUIV_NListtree_Insert_PrevNode_Head + The entry will be inserted at the head of the list. + + MUIV_NListtree_Insert_PrevNode_Tail + The entry will be inserted at the tail of the list. + + MUIV_NListtree_Insert_PrevNode_Active + The entry will be inserted after the active node of + the list. If no entry is active, the entry will be + inserted at the tail. + + MUIV_NListtree_Insert_PrevNode_Sorted: + The entry will be inserted using the defined sort hook. + + flags: + + MUIV_NListtree_Insert_Flag_Active + The inserted entry will be set to active. This means the + cursor is moved to the newly inserted entry. If the entry + was inserted into a closed node, it will be opened. + + MUIV_NListtree_Insert_Flag_NextNode + 'prevtreenode' is the successor, not the predecessor. + + + RESULT + + A pointer to the newly inserted entry. + + + EXAMPLE + + // Insert an entry after the active one and make it active. + DoMethod(obj, MUIM_NListtree_Insert, "Hello", NULL, + MUIV_NListtree_Insert_ListNode_Active, + MUIV_NListtree_Insert_PrevNode_Active, + MUIV_NListtree_Insert_Flag_Active); + + + NOTES + + BUGS + + Not implemented yet: + MUIV_NListtree_Insert_Flag_NextNode + + + SEE ALSO + + MUIA_NListtree_ConstructHook, MUIA_NListtree_CompareHook + + + NListtree.mcc/MUIM_NListtree_InsertStructtree.mcc/MUIM_NListtree_InsertStruct + + NAME + + MUIM_NListtree_InsertStruct -- Insert a structure such as a path + using a delimiter. (V1) + + + SYNOPSIS + + struct MUI_NListtree_TreeNode *treenode = + DoMethod(obj, MUIM_NListtree_InsertStruct, + STRPTR name, APTR userdata, + STRPTR delimiter, ULONG flags); + + + FUNCTION + + Insert a structure into the list such as a path or + something similar (like ListtreeName.mcc does). The name is + splitted using the supplied delimiter. For each name part a + new tree entry is generated. If you have Images/aphaso/Image.mbr, + the structure will be build es follows: + + + Images + + aphaso + - Image.mbr + + If a part of the structure is already present, it will be used to + insert. + + + INPUTS + + name - Data containing (must not) one or more delimiters as + specified in delimiter (Images/aphaso/Image.mbr for + example). + + userdata - Your personal data. + + delimiter - The delimiter(s) used in the name field (":/" or + something). + + flags: + + Use normal insert flags here (see there). + + + RESULT + + A pointer to the last instance of newly inserted entries. + + + EXAMPLE + + // Insert a directory path. + path = MyGetPath( lock ); + + DoMethod(obj, MUIM_NListtree_InsertStruct, + path, NULL, ":/", 0); + + + NOTES + + BUGS + + SEE ALSO + + MUIA_NListtree_Insert + + + NListtree.mcc/MUIM_NListtree_Move NListtree.mcc/MUIM_NListtree_Move + + NAME + + MUIM_NListtree_Move -- Move an entry to the specified position. (V1) + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Move, + struct MUI_NListtree_TreeNode *oldlistnode, + struct MUI_NListtree_TreeNode *oldtreenode, + struct MUI_NListtree_TreeNode *newlistnode, + struct MUI_NListtree_TreeNode *newtreenode, + ULONG flags); + + + FUNCTION + + Move an entry to the position after a defined node. + + + INPUTS + + oldlistnode - Specify the node which list is used to find the + entry. The search is started at the head of this + list. + + MUIV_NListtree_Move_OldListNode_Root + The root list is used as the starting point. + + MUIV_NListtree_Move_OldListNode_Active + The active list (the list of the active node) is used as + the starting point. + + oldtreenode - Specify the node which should be moved. + + MUIV_NListtree_Move_OldTreeNode_Head + The head of the list defined in 'oldlistnode' is moved. + + MUIV_NListtree_Move_OldTreeNode_Tail + The tail of the list defined in 'oldlistnode' is moved. + + MUIV_NListtree_Move_OldTreeNode_Active + The active node is moved. + + newlistnode - Specify the node which list is used to find the + entry. The search is started at the head of this + list. + + MUIV_NListtree_Move_NewListNode_Root + The root list. + + MUIV_NListtree_Move_NewListNode_Active + The list of the active node. + + newtreenode - This node is the predecessor of the entry which is + inserted. + + MUIV_NListtree_Move_NewTreeNode_Head + The node is moved to the head of the list defined in + 'newlistnode'. + + MUIV_NListtree_Move_NewTreeNode_Tail + The node is moved to the tail of the list defined in + 'newlistnode'. + + MUIV_NListtree_Move_NewTreeNode_Active: + The node is moved to one entry after the active node. + + MUIV_NListtree_Move_NewTreeNode_Sorted: + The node is moved to the list using the sort hook. + + flags - Some flags to adjust moving. + + MUIV_NListtree_Move_Flag_KeepStructure + The full tree structure from the selected entry to + the root list is moved (created at destination). + + + RESULT + + EXAMPLE + + // Move an entry to the head of another list-node. + DoMethod(obj, + MUIV_NListtree_Move_OldListNode_Active, + MUIV_NListtree_Move_OldTreeNode_Active, + somelistmode, + MUIV_NListtree_Move_NewTreeNode_Head, + 0); + + + NOTES + + BUGS + + SEE ALSO + + MUIM_NListtree_Insert, MUIM_NListtree_Remove, + MUIM_NListtree_Exchange, MUIA_NListtree_CompareHook, + MUIM_NListtree_Copy + + NListtree.mcc/MUIM_NListtree_MultiTest NListtree.mcc/MUIM_NListtree_MultiTest + + NAME + + MUIM_NListtree_MultiTest -- Called for every selection. (V1) + + + SYNOPSIS + + DoMethodA(obj, MUIM_NListtree_MultiTest, + struct MUIP_NListtree_MultiTest *multimessage); + + + FUNCTION + + This method must not be called directly. It will be called by + NListtree just before multiselection. You can overload it and + return TRUE or FALSE whether you want the entry to be multi- + selectable or not. + + + INPUTS + + RESULT + + EXAMPLE + + NOTES + + BUGS + + SEE ALSO + + MUIM_NListtree_Select, MUIA_NListtree_MultiTest + + + NListtree.mcc/MUIM_NListtree_NextSelectedtree.mcc/MUIM_NListtree_NextSelected + + NAME + + MUIM_NListtree_NextSelected -- Get next selected tree node. (V1) + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_NextSelected, + struct MUI_NListtree_TreeNode **treenode); + + + FUNCTION + + Iterate through the selected entries of a tree. This method steps + through the contents of a (multi select) list tree and returns + every entry that is currently selected. When no entry is selected + but an entry is active, only the active entry will be returned. + + This behaviour will result in not returning the active entry when + you have some other selected entries somewhere in your list. Since + the active entry just acts as some kind of cursor mark, this seems + to be the only sensible possibility to handle multi selection + together with keyboard control. + + + INPUTS + + treenode - A pointer to a pointer of struct MUI_NListtree_TreeNode + that will hold the returned entry. Must be set to + MUIV_NListtree_NextSelected_Start at start of iteration + and is set to MUIV_NListtree_NextSelected_End when + iteration is finished. + + MUIV_NListtree_NextSelected_Start Set this to start iteration. + MUIV_NListtree_NextSelected_End Will be set to this, if + last selected entry reached. + + + RESULT + + EXAMPLE + + // Iterate through a list + struct MUI_NListtree_TreeNode *treenode; + + treenode = MUIV_NListtree_NextSelected_Start; + + for (;;) + { + DoMethod(listtree, MUIM_NListtree_NextSelected, &treenode); + + if (treenode==MUIV_NListtree_NextSelected_End) + break; + + printf("selected: %s\n", treenode->tn_Name); + } + + + NOTES + + BUGS + + SEE ALSO + + MUIM_NListtree_PrevSelected, MUIM_NListtree_Select + + + NListtree.mcc/MUIM_NListtree_Open NListtree.mcc/MUIM_NListtree_Open + + NAME + + MUIM_NListtree_Open -- Open the specified tree node. (V1) + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Open, + struct MUI_NListtree_TreeNode *listnode, + struct MUI_NListtree_TreeNode *treenode, + ULONG flags); + + + FUNCTION + + Opens a node in the listtree. To open a child, which isn't displayed, + use 'MUIV_NListtree_Open_ListNode_Parent' to open all its parents, too. + + Only nodes can be opened. + + + INPUTS + + listnode - Specify the node which list is used to open the node. + + MUIV_NListtree_Open_ListNode_Root + The root list is used. + + MUIV_NListtree_Open_ListNode_Parent + Indicates, that all the parents of the node specified in + 'treenode' should be opened too. + + MUIV_NListtree_Open_ListNode_Active + The list of the active node is used. + + treenode - The node to open. + + MUIV_NListtree_Open_TreeNode_Head + Opens the head node of the list. + + MUIV_NListtree_Open_TreeNode_Tail + Opens the tail node of the list. + + MUIV_NListtree_Open_TreeNode_Active + The active node will be opened. + + MUIV_NListtree_Open_TreeNode_All: + All the nodes of the list are opened. + + + RESULT + + EXAMPLE + // Open the active list. + DoMethod(obj, MUIM_NListtree_Open, + MUIV_NListtree_Open_ListNode_Active, + MUIV_NListtree_Open_TreeNode_Active, 0); + + + NOTES + + BUGS + + SEE ALSO + MUIM_NListtree_Close + + + NListtree.mcc/MUIM_NListtree_PrevSelectedtree.mcc/MUIM_NListtree_PrevSelected + + NAME + + MUIM_NListtree_PrevSelected -- Get previous selected tree node. (V1) + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_PrevSelected, + struct MUI_NListtree_TreeNode **treenode); + + + FUNCTION + + Iterate reverse through the selected entries of a tree. This method + steps through the contents of a (multi select) list tree and returns + every entry that is currently selected. When no entry is selected + but an entry is active, only the active entry will be returned. + + This behaviour will result in not returning the active entry when + you have some other selected entries somewhere in your list. Since + the active entry just acts as some kind of cursor mark, this seems + to be the only sensible possibility to handle multi selection + together with keyboard control. + + + INPUTS + + treenode - A pointer to a pointer of struct MUI_NListtree_TreeNode + that will hold the returned entry. Must be set to + MUIV_NListtree_PrevSelected_Start at start of iteration + an the end and is set to MUIV_NListtree_PrevSelected_End + when first selected entry is reached and iteration is + finished. + + MUIV_NListtree_PrevSelected_Start Set this to start iteration. + MUIV_NListtree_PrevSelected_End Will be set to this, if + last selected entry reached. + + + RESULT + + EXAMPLE + + // Iterate through a list (reverse) + struct MUI_NListtree_TreeNode *treenode; + + treenode = MUIV_NListtree_PrevSelected_Start; + + for (;;) + { + DoMethod(listtree, MUIM_NListtree_PrevSelected, &treenode); + + if (treenode==MUIV_NListtree_PrevSelected_End) + break; + + printf("selected: %s\n", treenode->tn_Name); + } + + + NOTES + + BUGS + + SEE ALSO + + MUIM_NListtree_NextSelected, MUIM_NListtree_Select + + + NListtree.mcc/MUIM_NListtree_Redraw NListtree.mcc/MUIM_NListtree_Redraw + + NAME + + MUIM_NListtree_Redraw -- Redraw the specified tree node. (V1) + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Redraw, + struct MUI_NListtree_TreeNode *treenode, ULONG flags); + + + FUNCTION + + Redraw the specified entry. See special values for completeness. + + + INPUTS + + treenode - The tree node to be redrawn. + + MUIV_NListtree_Redraw_Active + Redraw the active entry. + + MUIV_NListtree_Redraw_All + Redraw the complete visible tree. + + + flags: + + MUIV_NListtree_Redraw_Flag_Nr + The data specified in 'treenode' is the entry number, + not the tree node itself. + + + RESULT + + EXAMPLE + + // Redraw the active entry. + DoMethod(obj, MUIM_NListtree_Redraw, + MUIV_NListtree_Redraw_Active, 0); + + + NOTES + + BUGS + + SEE ALSO + + MUIM_NList_TestPos + + + NListtree.mcc/MUIM_NListtree_Remove NListtree.mcc/MUIM_NListtree_Remove + + NAME + + MUIM_NListtree_Remove -- Remove the specified entry(ies). (V1) + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Remove, + struct MUI_NListtree_TreeNode *listnode, + struct MUI_NListtree_TreeNode *treenode, + ULONG flags); + + + FUNCTION + + Removes a node or nodes from the listtree. When the active entry + is removed, the successor will become active. + + + INPUTS + + listnode - Specify the node which list is used to find the entry + which should be removed. The search is started at the + begin of this list. + + MUIV_NListtree_Remove_ListNode_Root + The root list is used. + + MUIV_NListtree_Remove_ListNode_Active + The list of the active node is used. + + + treenode - The node which should be removed. If there are children + of this node, they are also removed. + + MUIV_NListtree_Remove_TreeNode_Head + The head of the list defined in 'listnode' is removed. + + MUIV_NListtree_Remove_TreeNode_Tail + The tail of the list defined in 'listnode' is removed. + + MUIV_NListtree_Remove_TreeNode_Active + Removes the active node. + + MUIV_NListtree_Remove_TreeNode_All + All nodes of the list which is specified in 'listnode', + are removed. Other nodes of parent lists are not + affected. + + MUIV_NListtree_Remove_TreeNode_Selected + All selected nodes are removed. + + RESULT + + EXAMPLE + + // Remove the active entry if delete is pressed! + DoMethod(bt_delete, MUIM_Notify, MUIA_Pressed, FALSE, + lt_list, 4, MUIM_NListtree_Remove, + MUIV_NListtree_Remove_ListNode_Active, + MUIV_NListtree_Remove_TreeNode_Active, 0); + + + NOTES + + BUGS + + SEE ALSO + + MUIM_NListtree_Insert, MUIA_NListtree_DestructHook, + MUIM_NList_Active + + + NListtree.mcc/MUIM_NListtree_Rename NListtree.mcc/MUIM_NListtree_Rename + + NAME + + MUIM_NListtree_Rename -- Rename the specified node. (V1) + + + SYNOPSIS + + struct MUI_NListtree_TreeNode *treenode = + DoMethod(obj, MUIM_NListtree_Rename, + struct MUI_NListtree_TreeNode *treenode, + STRPTR newname, ULONG flags); + + + FUNCTION + + Rename the specified node. + + If you want to rename the tn_User field (see flags below), the construct + and destruct hooks are used! + If you have not specified these hooks, only the pointers will be copied. + + + INPUTS + + treenode - Specifies the node which should be renamed. + + MUIV_NListtree_Rename_TreeNode_Active: + Rename the active tree node. + + newname - The new name or pointer. + + flags: + + MUIV_NListtree_Rename_Flag_User + The tn_User field is renamed. + + MUIV_NListtree_Rename_Flag_NoRefresh + The list entry will not be refreshed. + + + RESULT + + Returns the pointer of the renamed tree node. + + + EXAMPLE + + // Rename the active tree node. + DoMethod(obj, MUIM_NListtree_Rename, + MUIV_NListtree_Rename_TreeNode_Active, + "Very new name", 0); + + + NOTES + + BUGS + + SEE ALSO + + MUIA_NListtree_ConstructHook, MUIA_NListtree_DestructHook + + + NListtree.mcc/MUIM_NListtree_Select NListtree.mcc/MUIM_NListtree_Select + + NAME + + MUIM_NListtree_Select -- Select the specified tree node. (V1) + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Select, + struct MUI_NListtree_TreeNode *treenode, LONG seltype, + LONG selflags, LONG *state); + + + FUNCTION + + Select or unselect a tree entry or ask an entry about its state. + See special values for completeness. + + + INPUTS + + treenode - The tree node to be selected/unselected/asked. + + MUIV_NListtree_Select_Active For the active entry. + MUIV_NListtree_Select_All For all entries. + MUIV_NListtree_Select_Visible For all visible entries. + + seltype - Type of selection/unselection/ask + + MUIV_NListtree_Select_Off Unselect entry. + MUIV_NListtree_Select_On Select entry. + MUIV_NListtree_Select_Toggle Toggle entries state. + MUIV_NListtree_Select_Ask Just ask about the state. + + selflags - Some kind of specials. + + MUIV_NListtree_Select_Flag_Force + Adding this flag to seltype forces the selection by + bypassing the multi test hook. + + state - Pointer to a longword. If not NULL, it will be filled + with the current selection state of the entry. + + + RESULT + + EXAMPLE + + // Select the active entry. + LONG retstate; + + DoMethod(obj, MUIM_NListtree_Select, + MUIV_NListtree_Select_Active, MUIV_NListtree_Select_On, + 0, &retstate); + + // We must check this, because the multi test hook may + // cancel our selection. + if (retstate == MUIV_NListtree_Select_On) { + ... + } + + + NOTES + + If ( treenode == MUIV_NListtree_Select_All ) and + ( seltype == MUIV_NListtree_Select_Ask ), state will be filled + with the total number of selected entries. + + NEW for final 18.6: + If (treenode == MUIV_NListtree_Select_Active ) and + ( seltype == MUIV_NListtree_Select_Ask ), state will be the + active entry, if any, or NULL. + + If only the active entry is selected, has a cursor mark (see + MUIM_NListtree_NextSelected for that), you will receive 0 as + the number of selected entries. + + + BUGS + + SEE ALSO + + MUIA_NListtree_MultiTestHook + + + NListtree.mcc/MUIM_NListtree_Sort NListtree.mcc/MUIM_NListtree_Sort + + NAME + + MUIM_NListtree_Sort -- Sort the specified list node. (V1) + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_Sort, + struct MUI_NListtree_TreeNode *listnode, + ULONG flags); + + + FUNCTION + + Sort the specified list node using the sort hook. + + + INPUTS + + listnode - List node to sort. + + MUIV_NListtree_Sort_ListNode_Root + Sort the root list. + + MUIV_NListtree_Sort_ListNode_Active + Sort the list node of the active entry. + + MUIV_NListtree_Sort_TreeNode_Active + Sorts the childs of the active entry if a list. + + flags - Control the part where sorting is done. + + MUIV_NListtree_Sort_Flag_RecursiveOpen + Sort the list recursive. All open child nodes of the + node specified in 'listnode' will be sorted too. + + MUIV_NListtree_Sort_Flag_RecursiveAll + Sort the list recursive with ALL child nodes of the + node specified in 'listnode'. + + RESULT + + EXAMPLE + + // Sort the list of the active node. + DoMethod(obj, MUIM_NListtree_Sort, + MUIV_NListtree_Sort_ListNode_Active, 0); + + NOTES + + BUGS + + SEE ALSO + + MUIA_NListtree_SortHook + + NListtree.mcc/MUIM_NListtree_TestPos NListtree.mcc/MUIM_NListtree_TestPos + + NAME + + MUIM_NListtree_TestPos -- Get information about entry at x/y pos. (V1) + + + SYNOPSIS + + DoMethod(obj, MUIM_NListtree_TestPos, LONG xpos, LONG ypos, + struct MUI_NListtree_TestPos_Result *testposresult); + + + FUNCTION + + Find out some information about the currently displayed entry at a + certain position (x/y-pos). + + This is very useful for Drag&Drop operations. + + + INPUTS + + xpos - X-position. + ypos - Y-position. + testposresult - Pointer to a valid MUI_NListtree_TestPos_Result + structure. + + + RESULT + + tpr_TreeNode - The tree node under the requested position or NULL + if there is no entry displayed. + + The tpr_Type field contains detailed information about the relative + position: + + MUIV_NListtree_TestPos_Result_Above + MUIV_NListtree_TestPos_Result_Below + MUIV_NListtree_TestPos_Result_Onto + MUIV_NListtree_TestPos_Result_Sorted + + tpr_Column - The column unter the specified position or -1 if + no valid column. + + + EXAMPLE + + // Entry under the cursor? + struct MUI_NListtree_TestPos_Result tpres; + + DoMethod(obj, MUIM_NListtree_TestPos, msg->imsg->MouseX, + msg->imsg->MouseY, &tpres); + + if ( tpres.tpr_Entry != NULL ) + { + // Do something very special here... + } + + + NOTES + + BUGS + + SEE ALSO + + MUIM_NList_TestPos + + + diff --git a/workbench/classes/zune/nlist/docs/MCC_NListview.doc b/workbench/classes/zune/nlist/docs/MCC_NListview.doc new file mode 100644 index 0000000000..74c79cd96d --- /dev/null +++ b/workbench/classes/zune/nlist/docs/MCC_NListview.doc @@ -0,0 +1,139 @@ +TABLE OF CONTENTS + +NListview.mcc/NListview.mcc +NListview.mcc/MUIA_NListview_Horiz_ScrollBar +NListview.mcc/MUIA_NListview_HSB_Height +NListview.mcc/MUIA_NListview_NList +NListview.mcc/MUIA_NListview_Vert_ScrollBar +NListview.mcc/MUIA_NListview_VSB_Width + NListview.mcc/NListview.mcc + + That MCC public custom class give scrollers for a + NList public custom class to make NList/NListview + work near the same way as List/Listview. + + Most things that were handled by Listview are now + handled by NList, so NListview is quite simple, + anyway it's very easier to use NList with NListview + than without. + + Anyway, use NList without NListview if you don't + want to get attached scrollers (or want to attach + your own scrollers to NList - see Demo). + + Note: NListview class can't use List as child but + only NList, NFloattext, or a NList subclass, + and NList class will not work with Listview + without some conflict. + + NListview.mcc/MUIA_NListview_Horiz_ScrollBar + + NAME + MUIA_NListview_Horiz_ScrollBar -- [ISG], Object * + + SPECIAL INPUTS + MUIV_NListview_HSB_Always 1 + MUIV_NListview_HSB_Auto 2 + MUIV_NListview_HSB_FullAuto 3 + MUIV_NListview_HSB_None 4 + MUIV_NListview_HSB_Default 5 + + SPECIAL SPECIAL INPUTS + MUIV_NListview_HSB_On 0x0300 + MUIV_NListview_HSB_Off 0x0100 + + FUNCTION + With it you can tell if you want the scrollbar to be here + always, never, automatic (not at start and appear forever if + needed) or full automatic (appear and disappear when needed). + + Never is interesting if you want only one scrollbar of both + or if you want to attach your own one only for one scrollbar. + + With Auto and FullAuto modes, scrollbars will not appear at + first draw of the window. If you want it to appear when the + window will be opened, you can set after creation time (not + at init) MUIA_NListview_Horiz_ScrollBar + to (MUIV_NListview_HSB_XXX|MUIV_NListview_HSB_On) where XXX + is Default, FullAuto ... + + MUIV_NListview_HSB_On, MUIV_NListview_HSB_Off are used by the + NList object to make scrollbars appear/disappear. + + The default is set by prefs. When prefs have not been set + it is MUIV_NListview_HSB_Auto. + + SEE ALSO + MUIA_NListview_Vert_ScrollBar + NListview.mcc/MUIA_NListview_HSB_Height + + NAME + MUIA_NListview_HSB_Height -- [..G], LONG + + FUNCTION + Return the height of the horizontal scrollbar. + + Return 0 when no horizontal scrollbar is visible. + + SEE ALSO + MUIA_NListview_VSB_Width + NListview.mcc/MUIA_NListview_NList + + NAME + MUIA_NListview_NList -- [I.G], Object * + + FUNCTION + Same function as Listview.mui/MUIA_Listview_List. + + Every NListview needs a NList (or subclass) object as child. + You should specify it here. + + If you don't specify one, NListview will create a NList object + as child, giving it the same taglist as itself. + It's the only case where NList tags given to NListview will be + taken into account. + + As every other child, it will get disposes when + its parent object is disposed. + + SEE ALSO + NList.mcc + NListview.mcc/MUIA_NListview_Vert_ScrollBar + + NAME + MUIA_NListview_Vert_ScrollBar -- [ISG], Object * + + SPECIAL INPUTS + MUIV_NListview_VSB_Always 1 + MUIV_NListview_VSB_Auto 2 + MUIV_NListview_VSB_FullAuto 3 + MUIV_NListview_VSB_None 4 + MUIV_NListview_VSB_Default 5 + MUIV_NListview_VSB_Left 6 + + SPECIAL SPECIAL INPUTS + MUIV_NListview_VSB_On 0x0030 + MUIV_NListview_VSB_Off 0x0010 + + FUNCTION + Same as MUIA_NListview_Horiz_ScrollBar but for vertical + scrollbar. + + The default is set by prefs. When prefs have not been set + it is MUIV_NListview_VSB_Always. + + SEE ALSO + MUIA_NListview_Horiz_ScrollBar + NListview.mcc/MUIA_NListview_VSB_Width + + NAME + MUIA_NListview_VSB_Width -- [..G], LONG + + FUNCTION + Return the width of the vertical scrollbar. + + Return 0 when no vertical scrollbar is visible. + + SEE ALSO + MUIA_NListview_HSB_Height + diff --git a/workbench/classes/zune/nlist/docs/NList_mcc.doc b/workbench/classes/zune/nlist/docs/NList_mcc.doc new file mode 100644 index 0000000000..80eff4854c --- /dev/null +++ b/workbench/classes/zune/nlist/docs/NList_mcc.doc @@ -0,0 +1,1033 @@ + +NList.mcc/NListview.mcc/NFloattext.mcc/NListviews.mcp - Documentation + +********************************************************************* + + + + +Copyright +********* + + NList.mcc (C) 1996-2001 Gilles Masson + NList.mcc 2001 NList Open Source Team + + This data is freely distributable, but copyrighted by me. This means +you may freely copy them as long as you do not charge more than a +nominal fee for copying. This data may be put on PD disks, especially +on Fred Fish's AmigaLibDisks and Fred's or Aminet CDROMs. If you want to +distribute the data you MUST keep this document with it. All documents, +programms and files must be distributed in their original unmodified +form. + + The authors can not be made responsible for any damage which is +caused by using these programs. + +This class is FreeWare. + +------------------------------------------------------------------------- + The AUTHOR of a program can include the NList.mcc, NListview.mcc, + NFloattext.mcc, NListviews.mcp and Install files in its program archive + as soon as the above is respected. You can install them from you're own + script or use the provided one as you want. +------------------------------------------------------------------------- + + + I'm interesting in who is using my classes in his own (free) programs, +so don't hesitate to contact me. (just a mail telling what you're doing +with NList would be nice :) + + + + Send comments, suggestions or bug reports to: + + NList Open Source Team + + + +What are NList.mcc/NListview.mcc/NFloattext.mcc/NListviews.mcp ? +**************************************************************** + + NList is a Custom Class for the Magic User Interface (c) by Stefan +Stuntz. It's a subclass of area-class which make the same stuffs +than the MUI List/Listview class, and more. + + NList implement horizontal scrolling, built-in copy to clipboard, +classic char precision selection of area, drag and drop and some others. + + NListview give NList scrollbars, vertical as Listview, but horizontal +too. + + NFloattext is like Floattext and do automatic word wrap. The interest +to do it with NList is the builtin copy to clipboard. + + There is a mui pref class NListviews.mcp with it, which permit the +user to choose all default backgrounds, pens and fonts. + + + There is a Floattext.mui replacement which should work with all +programs. It's simply a stub to NFloattext.mcc. +To work that class must have the same major version number than original +have (ie 19.x for MUI 3.8), so it will surely have to be upgraded for next +MUI release and it should currently work only with MUI 3.8. + + + + +What you need ! +*************** + + - MUI 3.6+ + - AmigaOS V37+ (2.x) + + + + +How to install! +*************** + +for all (this is done by the install script) : + + copy MCC_NList/Libs/MUI/NFloattext.mcc MUI:Libs/MUI/ + copy MCC_NList/Libs/MUI/NList.mcc MUI:Libs/MUI/ + copy MCC_NList/Libs/MUI/NListview.mcc MUI:Libs/MUI/ + copy MCC_NList/Libs/MUI/NListviews.mcp MUI:Libs/MUI/ + + start the NList-Demo program ;-) + +and if you want to use the Floattext.mui replacement : + (keep a copy of original before !) + copy MCC_NList/Libs/MUI/Floattext.mui MUI:Libs/MUI/ + + + +for developpers : + + copy MCC_NList/Developer/AutoDocs/MCC_NFloattext.doc AutoDoc: + copy MCC_NList/Developer/AutoDocs/MCC_NList.doc AutoDoc: + copy MCC_NList/Developer/AutoDocs/MCC_NListview.doc AutoDoc: + copy MCC_NList/Developer/Include/MUI/NFloattext_mcc.h Include:MUI/ + copy MCC_NList/Developer/Include/MUI/NList_mcc.h Include:MUI/ + copy MCC_NList/Developer/Include/MUI/NListview_mcc.h Include:MUI/ + + + +NOTE : + The Floattext.mui replacement is just a subclass to NFloattext.mcc and + perhaps it will have compatibility problems with original one. + If you have problem, try again with original, and tell me if it's really + a problem made by the replacement class. Think to try just increasing + the stack of the program which make problems using it !!! + +NOTE2 : + Actually you can try to patch current Listtree.mcc, Dirlist.mui and Volumelist.mui + editing those files and replacing "List.mui\0\0" by "NList.mcc\0". + Of course doing that is at your own risks, but it seems to work in nearly + all cases. Keep a copy of original files before trying that... ;) + I use that for long time now, and the same work with many applications + which use MUI and List.mui/Listview.mui (AmFTP, YAM1.3.4 for example). + + + + + + +Known bugs +********** + +- By default the first column is not sortable. It's a feature, not a bug. Any + program can change that just setting the MUIA_NList_MinColSortable tag. + +- Using *simple refresh mode* for the window can make redraw problems when using + context menu. It is a MUI bug ! + +- When the size of a NListview object can be changed because of a balance object, + there can be strange things when moving that balance object with keys shortcuts + because in that case the window layout don't work correctly when some object + do ADDMEMBER or ADDMEMBER because of those size changes. + This is a Balance object bug ! Which make problems with other objects too, + not only with NListview ones... + +- Miscalaneous problems can come if stack is too low. + Think that when you call the mui prefs from some program the pref window and + all its objects will work in the program context, with the same stack, so + it can happens to have a stack to small only when the mui pref is opened... + It is a bug of you (set the stack bigger, i suggest > 12K) or from the program + (if it extends the stack to a too small value for a NList use). + +- Some users have reported crash when going in NListviews prefs because + of old version of HotkeyString.mcc from Allan Odgaard. + + + + +What is to do in future ? +************************* + +- Make a nice user configuration for title marks. + +- Make NList subclasses. I think about Volumelist, Dirlist. + Tell me if you want to do one of them. +- Pref for the copy to clipboard key. (is there anyone which have a source + to test a rawkey event against a string pref (like 'alt c') ?). +- Pref for the mark/block qualifier key (both for mouse and key handling) +- Fix bugs you will find and inform me. + + + + + +Notes +***** + +Think about a >12Kb (more?) stack to run it. +(i always use 16K stack with MUI programs when NList is used, and so always +because most MUI programs use Floattext.mui...) + + +If the .MCP custom MUI prefs freeze mui prefs with another program, +control its stack value, it could be too small ! + + +Use SegTracker with Enforcer. You will have more information and know +in which .mcc/.mcc/.mui/program the hit happened ! + +If with some program you get enforcer or mungwall hit, tell me, but give +all usefull informations - your config, your commodities/patches/hacks. + + + +Think to update the keybindings when you install a new MCC_NList release. + + + +You can look on ftp://iutsoph.unice.fr/pub/amiga/mui/ +or http://iutsoph.unice.fr/amiga/mui/ for new releases. + + +Email me if you want (beta) releases infos by email, or if you want to +receive (beta) releases by email (uuencoded). + + + +Give me some feedback if you like it, don't like it, need some changes +or adds, please. + + + + +Thanks +****** + +Thanks to Stefan Stuntz for MUI. + +Thanks to Klaus Melchior, + Piotr Pawlow, + Troels Walsted Hansed, + Troy Davis, + Stephane Barbaray, + Allan Odgaard, + Marcin Orlowski, + Stefane Barbaray, + + and all others beta testers for ideas, reports and help to find bugs. + + + + +(C) 1996-2001 Gilles Masson masson@iutsoph.unice.fr + + 2001 NList Open Source Team nlistdev@meanmachine.ch + + + + + + + + +History of NList.mcc +******************** + +* NList.mcc 20.103 23.11.01 Sensei + - added MUIM_NList_Construct, MUIM_NList_Destruct, MUIM_NList_Compare and + MUIM_NList_Display methods. Three first one was added in September, but + I don't remember when exactly. + - bumped version to V20. + +* NList.mcc 19.101 24.06.01 + - Enforcer hit on dispose removed. + - Again some speedups. + +* NList.mcc 19.100 20.06.01 + - Changed memory management, made some other speedups + (internal version only). + +* NList.mcc 19.98 18.02.01 + - added MUIM_NList_SelectChange method + +* NList.mcc 19.97 30.11.98 + - fixed MUIA_NList_SortType default is now MUIV_NList_SortType_None. + +* NList.mcc 19.96 29.11.98 + - added Support of a secondary title mark with MUIA_NList_TitleMark2. + - added Support of qualified titleclick (the qualifier have to be set in the prefs) + with MUIA_NList_TitleClick2. + - added Support of a secondary sort type value with MUIA_NList_SortType2. + Test and look the demo to have an example. + - added MUIM_NList_Sort3 method permit to set/change MUIA_NList_SortType, + MUIA_NList_SortType2 or both before doing the sort. + - fixed Returning NULL in the construct hook just skip the insert of the entry. + - added MUIM_NList_GetPos give the entry number where is the (next) given entry ptr. + +* NList.mcc 19.95 02.11.98 + - fixed There were a redraw out of the bounds of the list in some refresh cases. + - added Maximum visible drag items before 'Dragging xx Items...' pref support. + - fixed A LockLayer/UnLockLayer where forgotten in the refresh process. + - fixed The move/resize pointers could be shown when another window was in front + of the list (with the list's window active). + - fixed The esc-E sequence now make like esc-C when there is no text. + - fixed Setting WEIGHT=-1 in the Fromat string did not worked as not setting it + at all. The autodoc about default W=-1 didn't reflect exactly the way it + worked, it has been corrected and reflect how it works now. + - fixed After a Clear in Quiet mode the titles width were forgotten. + - fixed The Import and Export methods have been rewritten. Previous ones made a + system crash for some users (not for me and some others, i don't know why). + +* NList.mcc 19.94 20.10.98 + - fixed In MUIM_Export a pooled alloc were not freed. + - fixed There were many problems with the qualifiers of keybindings. + - fixed The multiselect qualifier started the drag in some case. + - fixed A little problem in MinLineHeight. + - added Better pointer colors possibilities, setting the wanted color number + for the black in prefs. + - added Support for the new MouseWheel prefs. + + +* NList.mcc 19.93 24.07.98 + - fixed In some cases the last visible column was not resizable. + - fixed Going back to default width of a column didn't worked always. + - added The title marker can now loaded/saved like widths etc. + - added Shortcuts for the default width and order (see in pref to know what they are). + Double clicking on a separator do not default the width anymore, and RMB while + resizing cancel the resize. + - added Full configurable shortcuts and qualifiers. + +* NList.mcc 19.92 15.07.98 + - added Custom pointer colors changed (it appear that i don't use standard pointer + colors on my system). You can ask for previous ones in prefs. + - fixed In some cases column width was not saved for all columns. + - fixed The horiz scrollbar considered the length of the non-visible end of the + last column when the user have reduced its size. + - fixed This time serial mouse and tablet support should be ok, a special pref + has been added to permit D&D support with them (but list scrolling + while dragging can't work correctly) because of a MUI "bug". + - added Support mouse wheel using Alessandro Zummo OptMouse (beta) version. + +* NList.mcc 19.91 21.06.98 + - fixed Again some refresh problems in simple refresh more, should be ok now. + +* NList.mcc 19.90 27.05.98 + - fixed A stupid bug made Auto/FullAuto scrollers "freeze" the object when they + appear the first time the object is drawn. + +* NList.mcc 19.89 25.05.98 + - fixed Now the MUI window refresh is forced before trying to redraw anything else + in the list (this case happen only in simple refresh mode). It was not done, + so in some cases the drawing was clipped by the intuition refresh clipping ! + - fixed There were some other refresh problems with the Redraw method when using + simple refresh mode. + - fixed There were a little drawing bug while (simple) refresh at bottom of list. + - fixed Notifies were always done asynchronously (!), not done any more. + - fixed XEN buttons (and perhaps other ones ?) in NList objects had a little redraw + position problem. + - fixed Having the last column less large than the remaining right space with a + separator bar is now possible (it can avoid the need of an extra empty column). + - fixed Use of graphic tablet instead of mouse should work again (i hope). + - fixed The copy to clipboard shortkeys unselect the area. + - added Read only list in char selection make auto copy to clipboard. + +* NList.mcc 19.88 04.05.98 + - fixed There still were a problem with MUIA_NList_AdjustHeight, should be ok now. + - fixed Now the changed mouse pointer are hires on V39+, no need any more to use a + hires pointer patch for NList when using AGA or CGFX... :) + - fixed Sorted Inserts are now faster. Anyway if you have 1000 sorted entries to + insert it is faster to insert them normally and do a sort after. + - fixed An enforcer hit happened when clicking on NFloattext object border. + - added MUIA_NList_MultiClickAlone which is notified only for the final multiclick + number, so if there are 3 clicks there will be only one multiclickalone + notified, a little (max time between 2 clicks) after the 3rd one. + - fixed There were some strange input problem since last release because of + changed made for tablet, but the fix made an other bug, so actually i + came back to the old code. I will re-make a big part of the eventhandler + later to fix both. + +* NList.mcc 19.87 29.04.98 + - fixed In some cases the image objects shown in NList entries appeared disabled ! + - fixed Selecting entries before the window containing the nlist object is open + didn't worked. + - fixed MUIA_NList_AdjustWidth and MUIA_NList_AdjustHeight didn't worked as expected. + - added MUIA_NList_Columns now work. + +* NList.mcc 19.86 13.04.98 + - fixed MUIA_NList_AdjustWidth didn't worked any more, i don't know in which + release this happened... + - fixed most MUIV_NList_Jump_xxx were not implemented at all ! :( + - fixed MUIV_NList_Move_Next didn't work as it should. + - fixed the rastport softstyle was not always reset to initial state. + - fixed in the builtin comparehook: stricmp() replaced by Stricmp() which (i hope) + make a localized compare. + - fixed setting MUIA_NList_MinLineHeight didn't update and redraw the list in some cases. + - fixed MUIA_Disabled now disable all user input and redraw. + - added all MUIA_NList_Imports and MUIA_NList_Exports values are now usable, so the + NList object can now save/load columns width and order for example. + - added MUIM_NList_SetColumnCol permit to set which displayhook col is at some + visible column. + - fixed The sort algorithm speed has been higly increased using the qsort(). + It was very slow before, 50,000 entries were sorted in more than 8 hours, + but now it take less than 30 seconds ! :) + + +* NList.mcc 19.84 15.12.97 + - fixed the Pointer changes now work ok when using the MCP Hires Pointer patch. + - fixed the background is not drawn any more twice (one by group subclass) when + a complete redraw is made (this was visible with complex background while + a resize of the list). + - fixed most of time, clicking on an image didn't activate the entry (this bug + was introduced in 19.81 by the "relverify button" code) + - added Notify can now be made on MUIA_NList_DragSortInsert to know when + DragSort have been done. + - fixed Notify can now be made on MUIA_NList_InsertPosition. + - added You can now mark one title column with MUIA_NList_TitleMark. + This can be usefull to show on which column a list is sorted for example. + +* NList.mcc 19.83 08.12.97 + - fixed MUI_NLPR_ONTOP flag was never set by TestPos method ! + - added now the pointer is changed at mouse positions where column width is resizable. + - added double click on title column separator bar make the column width go to default. + - fixed RMB while changing a column width make all column width go to default. + - fixed An (not bitmap/bodychunk) image object in the text of a MailText.mcc made + the whole system freeze when set at init. + - added Now the columns can be sorted by the user using his mouse, the tag + MUIA_NList_MinColSortable is here to set the first sortable column (default=1). + - added NList can now save the active entry as List.mui does. Will be able to save more + really soon. + +* NList.mcc 19.82 28.10.97 + - fixed The list should not show empty lines because the window size changed any more. + - fixed MUIA_Font is now settable, the change will take effect after next MUIM_Setup, + so you can set it until the DoSuperMethod call of the MUIM_Setup of a NList + subclass. + - fixed HandleEvent didn't returned MUI_EventHandlerRC_Eat when Amiga-C/Amiga-X where + used to copy to clipboard. + - fixed When MUIA_NList_DefaultObjectOnClick is used and the user click outside the + list then the list is not the default object any more (until next click in + the list of course). + - fixed No notify is made any more on Active, First, Select,... for changes which + happend while in Quiet mode (unless using MUIV_NList_Quiet_Visual instead + of the classic/default MUIV_NList_Quiet_Full). + - added ESC t[N], ESC t[N], ESC t[NM], ESC t[NI] sequences. + (see MUIA_NList_DisplayHook) + - added SIMPLEBAR=SBAR option in Format string to draw BAR as a simple black line. + +* NList.mcc 19.81 15.07.97 + - added some new hooks MUIA_NList_XxxxHook2 which are same as MUIA_NList_XxxxHook ones + but use a more standard way to be called, ie with the object in A2 and a + message in A1 which is a struct. + This give a correct access to the object, and permit the MUIA_NList_CompareHook2 + hook to use the MUIA_NList_SortType value (see below). + - added MUIA_NList_SortType tag which can be set and get, is passed to the + MUIA_NList_CompareHook2 hook and can be directly setted in MUIM_NList_Sort2. + - added MUIM_NList_Sort2 method which set MUIA_NList_SortType value the do same as + MUIM_NList_Sort (its goal is to permit very easy sort using a single notify + on MUIA_NList_TitleClick. + - fixed MUIA_Listview_MultiSelect and MUIA_Listview_Input set on a Listview should + now work for a NList child. + - added MUIA_NList_ButtonClick and ESC O[...@] or ESC o[...@] sequences + to make relverify like buttons and get notifies when they are clicked. + - added MUIM_NList_CreateImage and MUIM_NList_UseImage now use the flags argument : + when ~0L NList don't make set(MUIA_FillArea,FALSE) on the object any more. + +* NList.mcc 19.80 15.07.97 + - fixed use HandleInput for MuiKeys as it seems they are not received by HandleEvent + in some cases. Intuition events are still handled in HandleEvent. + - fixed setting MUIA_NList_Active could make some delayed MUIA_NList_Active notify. + - fixed some horizontal scrollbar in fullauto mode problems should be fixed. + - added new escape sequence ESC t[..] which make ESC C and ESC E horiz bar + being thick (and filled with wanted color). + - fixed setting default to never have the NList context menu show it at the 1st RMB click. + +* NList.mcc 19.79 09.07.97 + - fixed NList didn't cleared entries when disposed, so destruct hook where never called + in that case ! + - fixed handleInput has been replaced by HandleEvent. + - added NList entries strings could be ended by \0 and \n only. + Now NList reconize \r and \r\n too as end of strings. + - fixed no MUIA_NList_Active (MUIA_List_Active) notify were sent when the list is cleared. + - fixed Drag in immediate mode don't start any more immediately but at first mouse move. + - fixed Insertion of entries containing ESC I[] while in quiet mode should be a little faster. + - fixed there were in some cases a problem with MUIA_NList_Active/MUIA_List_Active notify, + and that notify was never done when the list became cleared. + (works better when used in a standard Listview now) + - fixed Notifies on MUIA_Listview_SelectChange and MUIA_Listview_DoubleClick + (when using standard Listview) should now work. + - added MUIM_NList_ContextMenuBuild autodoc. + +* NList.mcc 19.78 30.06.97 + - fixed some improves in NList refreshes when in a virtual group. + - fixed now changes which happen while the list is in quiet mode will have the + notification delayed until the end of quiet mode. + - fixed the stack check will appear only one time now. + - fixed if silly stack values are found while the stack check is made then the + check will be automatically disabled. + +* NList.mcc 19.75 24.06.97 + - fixed with 19.74 custom ContextMenu didn't work for list with only one column. + - fixed In MUIA_NList_Format you can't any more use the same COL number for 2 + visible columns. + - fixed MUIA_NList_DragColumnOnly has been renamed MUIA_NList_DragColOnly and use + displayhook col number. + - fixed MUIM_NList_ColWidth now use (displayhook) col number and not (visible) column number. + - fixed MUIA_NList_TitleClick now give (displayhook) col number and not (visible) column number. + - fixed All wrapcol method parameters are now displayhook col and not visible column + (in MUIP_NList_InsertSingleWrap,MUIP_NList_InsertWrap,MUIP_NList_ReplaceSingle + and struct MUI_NList_GetEntryInfo). + In struct MUI_NList_GetSelectInfo, start_col and end_col are renamed + start_column and end_column. + In struct MUIP_NList_ContextMenuBuild, col is renamed column. + - added MUIM_NList_ColToColumn and MUIM_NList_ColumnToCol methods, which permit + to converts visible column number to display hook col number, and converts + display hook col number to visible column number. + +* NList.mcc 19.74 23.06.97 + - fixed Major version number is now 19. + - fixed now MUIA_Draggable,TRUE do a MUIA_NList_DragType,MUIV_NList_DragType_Default + and MUIA_Draggable,FALSE do a MUIA_NList_DragType,MUIV_NList_DragType_None. + - fixed now NList handle MUIA_Dropable and MUIA_NList_DragSortable separately, + so each can be set/unset without breaking the effect of the other. + MUIA_Dropable defaults to TRUE (so is really handled by Drag_Query method). + - added MUIM_NList_DropEntryDrawErase method for more dropmark customisation + possibilities (see autodocs). + - added now all column default to TBAR (see MUIA_NList_Format) and + MUIA_NList_TitleSeparator defaults to TRUE. (add NOBAR to prevent it) + - fixed all NList shortkeys don't work any more when the mouse is onto the object + but when the object is active or the default one (like standard MUI keys) + - fixed Insert and Replace methods really inserted NULL entry(ies) (directly given + and/or return by the construct hook) ! not done any more. + - added MUIA_NList_StackCheck tag permit application to disable NList stack checking. + - fixed In the Format string, now WIDTH defaults to -1, as in standard List class. + - fixed no more (not visible) active entry when in char select mode. + - fixed Sizes and placement of images drawn with ESC O[] and ESC o[] didn't have + good defaults/values. Should be better now. + See the end of MUIA_NList_DisplayHook autodoc for more infos. + - fixed NList multiselect using keys now defaults to List like mode. + +* NList.mcc 13.73 10.06.97 + - fixed CreateImage and UseImage will not add non bitmap/bodychunk object + with any flag value. For bitmap/bodychunk object, NList will add + the it if flag is ~0, and make a private bitmap for other values. + When adding object, NList do a MUIA_FillArea,FALSE on it + (while the UseImage/CreateImage, you can do a MUIA_FillArea,TRUE + after if you want). + +* NList.mcc 13.72 02.06.97 + - fixed there where an enforcer hit (read one) when calling the Remove method + on an empty list. + - fixed now the context menu is visible even when no column width has been + changed by the user (when 2 or more columns). + - fixed now the column separator bar is drawn on empty/non existing lines. + - fixed there were an error in some cases when recomputing columns width + after reseting them to default. + - fixed shift+space unselected the active entry in non-multiselect mode ! + - fixed setting active entry didn't work as need in multiselect mode + when List like mode is set in prefs. + - added column balancing with shift key will try to change both column width + keeping other column as there were before (like shifted objects balancing). + - added NList now is able to draw partially visible chars on left and right + edges. This is settable in prefs. + - fixed MUIA_NList_VertDeltaFactor replaced by MUIA_NList_Prop_DeltaFactor and + MUIA_NList_HorizDeltaFactor replaced by MUIA_NList_Horiz_DeltaFactor + (for source compatibility old names are still usable). + +* NList.mcc 13.71 30.05.97 + - fixed notify on doubleclick made problems with some applications which + used TRUE as TrigValue instead of MUIV_EveryTime, so now NList + force MUIV_EveryTime for it. + - fixed some little redraw improvment. + the two-stages redraw (odd/even lines) should now be used only when + moving the scrollbar fast. + +* NList.mcc 13.70 26.05.97 + - fixed there were a major slowdown when using wrapping stuff (and so the + Mailtext class by Olaf Peters) since NList0.67. + - added MUIA_NList_First and MUIA_NList_Entries can now be used for notifications. + - fixed the dropmark was not cleared in some cases since 13.67. + - fixed NList didn't worked with original Listview class for some time, it + works again and is handled a little better. + - fixed MUIA_NList_AdjustHeight stuff improved (see autodoc). + +* NList.mcc 13.69 21.05.97 + - added direct visible column width dragging possibility. + - added list like key multiselection possibility with user pref. + - fixed redraw problems when inserting entries containing new images while + the nlist is visible. + - fixed redraw/re-wrap problems when inserting/moving/removing wrap entries. + - fixed MUIA_NList_AdjustHeight and MUIA_NList_AdjustWidth problems. + +* NList.mcc 13.67 14.05.97 + - fixed All ESC I[], ESC O[] and ESC o[] (except bitmap created object) where + not drawn when the NList object was in a virtual group. + - fixed There where in some cases refresh problems while nlist scrolling when + the NList object was in a virtual group which was in a virtual group... + - added MUIM_NList_RedrawEntry method which redraw the line(s) which show the + given entry pointer. + - added MUIM_NList_DoMethod which do the specified method for/on all/active/ + selected entries (thanks to Steve Koren for the idea and partial source). + - added MUIM_NList_ColWidth which permit to restore default column width + (or set it as if changed by user or read the current user width) for all + or a specified column. + - added a default context menu which permit to restore default column width for + one or all columns (appear only if some column width is not default). + - fixed dragging column width separator now scroll the list when going on left + and right of the list. + - fixed MUIA_NList_DoubleClick now give the entry number where the clicks + happened, -1 when on title, -2 when on "nothing" (no notification + is made in that case). + - fixed Autodocs didn't said that double/multi-clicking on title made the + MUIA_NList_DoubleClick and MUIA_NList_MultiClick notifications too... + - added MUIA_NList_EntryClick, which permit notification for a click on an entry. + - added NOTITLEBUTTON=NOTB option in the MUIA_NList_Format string. + +* NList.mcc 13.66 30.04.97 + - fixed there were a general layout problem when using ESC I[] in some cases + when the topaz/8 font is patched. + - fixed dragging column width separator is no longer canceled going out of the + list on left or right. + - added the column width drag bar now defaults to the full list height. You can + change prefs to get it work as before. + +* NList.mcc 13.64 22.04.97 + - fixed Drag problems should be all removed now. MUIM_NList_QueryBeginning is + now obsolete. + +* NList.mcc 13.63 21.04.97 + - fixed The horizontal scrollbar bar width wasn't correctly updated in some cases. + - added The columns width can now be changed by user with the mouse, dragging the bar + (vertical column separator) in the title (or the upper middle of first + visible line when there is no title). This work also when the bar is not + visible (just more difficult to know where to click to drag it) ! + If while dragging a bar you press and release the RMB, the column + width will come back to its default. + - added The column titles now work like buttons (with simple frame as there are not + real buttons but directly handled by the list) if MUIA_NList_TitleClick has + been set or if a notify has been asked on it. + - added TBAR parameter in the Format, drawing the vertical separator bar only in + the title. + - added Two new tags are sent to nlist custom image object before it will be drawn, + MUIA_NLIMG_EntryCurrent and MUIA_NLIMG_EntryHeight (see MUIM_NList_CreateImage, + MUIM_NList_UseImage and demo example). + - added setting MUIA_NList_DragColumnOnly to a column number permit to get the + text of the column/entry in the drag window instead of the full visible + part of the entry. + +* NList.mcc 13.62 16.04.97 + - fixed new images in ESC sequences could be mis-drawn in inserted lines + when the list was already visible, same when (re)setting title. + - fixed a remaining problem in column width update (then refresh) when + removing/replacing entries. + - added now NList will set the h_Data of struct Hook to the NList obj ptr + just before calling hooks if it found it NULL. In that case h_Data + will be reset to NULL when the hook return. Done for ALL hooks. + - fixed the columns width weren't recomputed when the used font is changed + in prefs. + +* NList.mcc 13.61 15.04.97 + - fixed Should finally works with V37+. It seems there is a problem with + LibCreatePool/LibDeletePool/LibAllocPooled/LibFreePooled which come + with ADE and libnix. NList now use those from amiga.lib. + - fixed There still where problems for refreshes when a NList object was in a + virtual group (now only the visible part is scrolled). + Should work now in all cases, in smart AND simple refresh modes. :) + +* NList.mcc 13.60 11.04.97 + - fixed 13.59 add a dead-end bug which came after 2-3 iconify/desiconify (or 2-3 + open/close mui prefs). + - fixed Scroll handling in simple refresh mode has been highly improved. + - fixed Now user inputs (mouse clicks) are disabled while the smooth scrolling is + finishing (more exactly when first entry is partially visible). + +* NList.mcc 13.59 08.04.97 + - fixed The horiz scrollbar didn't go to left pos when the list was cleared. + - added A new tag MUIA_NList_TitleClick usable to give notify when a click is done on + the NList title (see autodoc). + - fixed MUIM_NList_TestPos now set the MUI_NLPR_TITLE flag if the specified position is + on the title. (see autodoc and NList_mcc.h) + +* NList.mcc 13.58 01.04.97 + - fixed minor change in library startup. + - added Two new methods MUIM_NList_DropType, MUIM_NList_DropDraw and a related tag + MUIA_NList_DropType to improve DropMark customisation. + - fixed User inputs (keys and mouse) are now off while the list is in Quiet mode. + - fixed New try to fix problems with V37. + +* NList.mcc 13.57 28.03.97 + - fixed The font of the dragging message "Dragging xxx Items..." was not the same of + the list. + - fixed The dragging message "Dragging xxx Items..." will now appear when using V37 too. + - fixed MUIA_Window_MouseObject didn't give the NList object pointer. + +* NList.mcc 13.56 27.03.97 + - fixed NList had a AllocPool error which freeze the system on V37 with LibFreePooled + but not with V39 FreePooled ??? Perhaps will it fix some erratic problems on + V39 too... + - fixed Using BitmapImages with NList now works for V37. The result pens are the closest + from the asked one without modifying any screen color. + +* NList.mcc 13.55 25.03.97 + - fixed The whole system could freeze when the window needed to be resized because to + it was too small for the minimum width and height of NList. + - fixed Sometimes scrollbars flickered more than needed. + +* NList.mcc 13.54 24.03.97 + - fixed A enforcer hit appeared since 0.52 when using escape sequence to change pen color. + - fixed V37 compatibility (i hope, still can't test it myself), now i have find that + SetABPenDrMd() is V39+, which is not mentioned in autodocs ! :( + +* NList.mcc 13.53 21.03.97 + - fixed There were bugs in columns width handling and refresh when inserting/removing entries. + All should be ok now. Some new improvments come with that fix... + - fixed a little redraw problem when scrolling to top/bottom while the list is a dropzone. + - xxxxx Still not work with V37, i still can't test it ! :( + - fixed Programs made with E don't have a standard stack. Stack check is (i hope) + automatically disable for them now. + - fixed E files are up to date (i finally include them in an archive before there are + obsolete...). Thanks Piotr. + +* NList.mcc 13.52 18.03.97 + - fixed There were a problem in word wrap (so NFloattext) computing. + - fixed Handling of FullAuto scrollbars has been improved. + Some others related things have been improved too and are now faster :) + - fixed First try for V37 compatibility. Should work, but i couldn't test it :( + +* NList.mcc 13.51 17.03.97 + - fixed Smooth scrolling has been highly improved and now react near like + original listview one. + - fixed NList objects with balance objects in show objects mode (ie not show frame) + didn't work (i never used that mode before so didn't see the problem !). + - fixed Auto and FullAuto scrollbars should now appear/disappear before the + NList contents is drawn. + - fixed The way column width are computed has been improved, making insert, + full redraw (after resizing etc.) and others faster. + - fixed The NList title is now always at top of the list area. + - added New keys working in multiselect mode (ctrl+space, ctrl+up/down, + ctrl+shift+up/down and ctrl+alt+up/down) which : toggle state of active + entry, copy state of current to prec/next entry and make it active, + same for page up/page down, and same for top/bottom. + +* NList.mcc 13.50 05.03.97 + - fixed Smooth scrolling has been improved. + - fixed Minimum width returned by the class is now smaller (near list one). + - added A system requester is now opened is there is less than 8K stack at init, + or if the free stack size is less than setted in prefs (none,1K,2K). + - added MUIM_NList_GetSelectInfo method, giving number of selected entries, + num of first and last selected, column and char pos in these ones + when in charselect mode. + - added MUIM_NList_CopyTo method, which permit to copy the contents of + NList entries (like MUIM_NList_CopyToClip) to a string or a file + (and so printer, using 'PRT:' as file name) + - added MUIA_NList_ForcePen which permit to set the same than the corresponding + user pref in the .mcp + - added Now NList object check the stack size at startup and succeed only + if it's 8Kb or more. NList do checks in some points of the code too, + looking for too small remaining free stack. + In both cases a warning (EasyRequest) will show up. + As NList is a subclass, many supermethod calls will of course cause + a biggest use of stack than NList will see. That's why the minimum + free check settable in prefs is 1Kb. Anyway i think that 2K or 3K + is better to prevent problems... + Set 3K if you use NList in a programm you are developping, to be + (nearly) sure users will never see it with the default 2K. + +* NList.mcc 13.49 17.02.97 + - fixed MUIM_NList_QueryBegining replaced by MUIM_NList_QueryBeginning. ;-) + ^ ^^ + - fixed Force Pen defaults now to FALSE. + +* NList.mcc 13.48 09.02.97 + - added ESC-E sequence, like ESC-C but the line is drawn only on the left and right + of the column contents + - fixed [...] after ESC-P, ESC-I, ESC-O and ESC-o sequences are not copied to + clipboard any more by the default hook. + - added Now you can ask NList to force the pen color of cursor/selected area + to be always the ones of prefs. + - added MUIM_NList_QueryBegining method, which must be used in any DragQuery + method in sub classes of NList (Read autodocs). + +* NList.mcc 13.47 18.12.96 + - fixed mow images are drawn when not full visible too. + - fixed some little bug in new stuffs of 13.46, read again MUIA_NList_DisplayHook + and MUIM_NList_CreateImage autodocs... + +* NList.mcc 13.46 18.12.96 + - fixed a little problem when setting Drag&Drog related tags at init. + - added the flags argument of MUIM_NList_CreateImage has now a meaning when its + value is ~0L. It's in test, read the autodoc and use with cautions. + - added MUIM_NList_UseImage has a new argument flags (update your code if you + use that method) with same meaning than flags of MUIM_NList_CreateImage. + - fixed some pooled allocs were not freed. + - added with ESC I[], ESC O[] and ESC o[], you can add a new parameter [...,] + which will be the min width of image (see MUIA_NList_DisplayHook autodoc) + +* NList.mcc 13.45 01.12.96 + - fixed Drag of multiple (non consecutive or not all visible) entries has been + improved, showing the number of entries in the drag. + - fixed MUIV_NList_DragType_xxx value have changed to get default to value 1, + which is better because MUIV_Listview_DragType_Immediate was the only + one other than None and was 1, so it must be the default. + - added using MUIA_List_Format instead of MUIA_NList_Format, you'll get -1 as + WEIGHT default, like in List objects. Avoid it when you create a + program from scratch using NList, please. + +* NList.mcc 13.44 27.11.96 + - fixed a bug in a line length (then also in horiz scrollbar) sometimes when + playing with mouse in CharSel mode. + - fixed there were something wrong when moving selected with wrapped lines. + - added MUIA_NList_Select in CharSel mode now clear the selected zone when + set to MUIV_NList_Select_Off (with any entry number !). + - added MUIA_NList_Select in CharSel mode when set to MUIV_NList_Select_On + select just the given entry (or active or all). + - added MUIM_NList_NextSelected now works in CharSel mode. + +* NList.mcc 13.43 26.11.96 + - fixed There is no need to give the size of the ImageSpec to draw in the + ESC I[] sequence any more :) + - fixed MUIA_List_TestPos was redirected directly to MUIA_NList_TestPos, + which was bad with some programs because both struct used to store + datas hadn't the same size, making some enforcer hits in special cases. + So think that both don't give the same result now... + - added Amiga-X key make the same as Amiga-C now (copy to clipboard) + There should be a pref for it later. For now you'll be able to use + it when there is a shortcut on Amiga-C... + - fixed some bad cycling with FullAuto scrollbars in a special case. + - added MUIA_NList_TitleSeparator, inserting an horiz bar *between* title and list. + + +* NList.mcc 13.42 22.11.96 + - fixed there were an enforcer hit when (re)drawing the list title + when the list is/become empty. + - fixed better way to make the notifies (tracking which one are asked), + so MUIA_NList_ListCompatibility and setting MUIA_NList_DoubleClick + are now obsolete. + - added smooth scrolling for vertical scrollers. + +* NList.mcc 13.41 18.11.96 + - added word wrap capability (which can use justification). + - added a new preparse string possibility settable in the displayhook. + +* NList.mcc 13.39 08.10.96 + - fixed Auto/FullAuto scrollers didn't react when there were + insert/remove/clear and window isn't selected (because the + object don't receive intuiticks in that case). + - fixed Clicking on title don't do anything anymore. + - fixed (i hope) There was a bad selection made with multiselect + when going *very* fast across top or bottom of list. + +* NList.mcc 13.38 06.10.96 + - added MMB as shift multiselect is set in prefs. + - added Now use the drag qualifier which is set in prefs. + +* NList.mcc 13.37 02.10.96 + - fixed NList superclass was MUIC_Group instead of MUIC_Area because of a + mistache, making a empty group :( + - fixed the column width use for COLWIDTH and others in Format is no more + tf_XSize but the wider of bold italic 'w', 'W', 'm' and 'M'. + +* NList.mcc 13.35 26.09.96 + - added needed stuff to handle new NListview FullAuto/Auto stuffs. + - fixed InsertPosition which was wrong after a sort or insert sorted. + - fixed when last entries are removed you won't get blank lines. + +* NList.mcc 13.34 22.09.96 + - added MUIM_NList_UseImage method. + - fixed some bugs. WIDTH=-1 for last column seems to work without making + mungwall hits, anyway the column width layout need some improvments. + +* NList.mcc 13.33 18.09.96 + - improved drag stuff, now MUIV_NList_DragType_Borders exists. + - fixed LMB release isn't received when some string gadget is activated + when a Active or SelectChange notify is made. + +* NList.mcc 13.32 17.09.96 + - fixed setting MUIA_NList_Active before object is shown changed + the first visible entry to the set value + 1. + - added MUIA_NList_AutoVisible stuff + +* NList.mcc 13.31 16.09.96 + - added MUIA_NList_Active notify. + - added MUIV_NList_Remove_Selected stuff. + - fixed a minor bug with MUIV_NList_Active_Off when non-multiselect mode. + + + +History of NListview.mcc +************************ + +* NListview.mcc 19.62 02.11.98 + - added MUIV_NListview_VSB_Left (and MUIV_Listview_ScrollerPos_Left) support. + +* NListview.mcc 19.61 20.10.98 + +* NListview.mcc 19.60 13.04.98 + +* NListview.mcc 19.58 15.07.97 + - added 2 tags used by NList.mcc. + +* NListview.mcc 13.50 22.04.97 + - fixed MUIM_NListview_QueryBeginning is now obsolete and does nothing. + +* NListview.mcc 13.48 08.04.97 + - added little add needed by a NList change. + +* NListview.mcc 13.47 01.04.97 + - fixed minor change in library startup. + +* NListview.mcc 13.44 17.02.97 + - fixed MUIM_NListview_QueryBegining replaced by MUIM_NListview_QueryBeginning. ;-) + ^ ^^ + +* NListview.mcc 13.43 09.02.97 + - fixed When the vert scrollbar appeared at start of the object, it + seems that 2 muigprop object where made (and only one were released + at the end). + - added MUIM_NListview_QueryBegining method, which must be used in any DragQuery + method in sub classes of NListview (Read autodocs). + +* NListview.mcc 13.42 18.12.96 + - fixed a little problem when setting Drag&Drog related tags at init + in the listview object. + +* NListview.mcc 13.34 26.09.96 + - added scrollbars Auto and FullAuto modes. + +* NListview.mcc 13.31 16.09.96 + - added little change to give NList a better handling of DragSortable stuff. + + + +History of NFloattext.mcc +************************* + +* NFloattext.mcc 19.45 09.07.97 + - fixed Now using MUIA_Floattext_Text really copy the supplied buffer like Floattext + and not use ConstructHook_String/DestructHook_String any more. + +* NFloattext.mcc 19.44 23.06.97 + - fixed Major version number is now 19. + - fixed using MUIA_Floattext_Text instead of MUIA_NFloattext_Text will + make NFloattext set MUIA_NList_ConstructHook to MUIV_NList_ConstructHook_String + and MUIA_NList_DestructHook to MUIV_NList_DestructHook_String, so the text + will be copied automatically like in Floattext class. + Should give Floattext compability in all cases. + +* NFloattext.mcc 13.42 01.04.97 + - fixed minor change in library startup. + +* NFloattext.mcc 13.38 18.11.96 + - first release. + + + +History of NListviews.mcp +************************* + +* NListviews.mcp 19.61 29.11.98 + - fixed Some users had a crash bug when going in NListviews prefs. + - added A qualifier key for secondary title mark. + - added Update keys button now permit to add the hotkey of functions + which are not in the keybinding list, so you can add new functions + hotkey without loosing previous changes. + - fixed miscs panels layout updated. + - fixed The Max Visible Drag Items value is now set to the good value. + +* NListviews.mcp 19.60 02.11.98 + - added Maximum visible drag items before 'Dragging xx Items...' pref. + - fixed miscs panels layout remade. + +* NListviews.mcp 19.59 20.10.98 + - added Pref for pointers colors now set the black color number. + - added Prefs (scroll speed and key qualifiers) for Mouse Wheel + (try using NewMouse from aminet) + +* NListviews.mcp 19.58 24.07.98 + - added keybindings panel. + - fixed panels layout remade. + +* NListviews.mcp 19.57 15.07.98 + - fixed the layout as been remade a little differently + (not finished at all in this intermediate release). + - added Pref for cursor colors. + +* NListviews.mcp 19.56 27.05.98 + - fixed There were "Allways" instead of "Always" ! + - added Start of locale support, but actually no catalog... + +* NListviews.mcp 19.55 25.05.98 + - fixed added some info for the smooth scrolling. + +* NListviews.mcp 19.54 13.04.98 + +* NListviews.mcp 19.53 23.06.97 + - fixed Major version number is now 19. + +* NListviews.mcp 13.52 02.06.97 + - added Partial chars draw on left/right edges pref. + +* NListviews.mcp 13.50 21.05.97 + - added pref for visual column width. + - added pref for list like key multiselection. + +* NListviews.mcp 13.49 14.05.97 + - added some prefs. + +* NListviews.mcp 13.48 30.04.97 + - added pref for column width dragbar height. + +* NListviews.mcp 13.46 01.04.97 + - fixed minor change in library startup. + +* NListviews.mcp 13.45 17.03.97 + - fixed The smooth scrolling speed slider has been replaced by a single + checkmark because now the scroll speed is the same as standard + listviews one (so use listviews pref to change the scroll speed). + +* NListviews.mcp 13.44 05.03.97 + - fixed Smooth pref range is no 0 to 9, 0=no smooth, 1 is fastest and 9 slowest. + - added a user pref for the NList stack warning. + +* NListviews.mcp 13.43 17.02.97 + - fixed Force Pen defaults now to FALSE. + - fixed Little changes in the NList text. + +* NListviews.mcp 13.42 09.02.97 + - added Force user pref pen color for cursor/select or not from prefs. + +* NListviews.mcp 13.41 18.12.96 + - fixed my email in the list text (this one is valid while holidays) ;) + +* NListviews.mcp 13.40 26.11.96 + - added now use MUIA_NList_TitleSeparator :) + - fixed my email in the list text ;) + +* NListviews.mcp 13.39 22.11.96 + - added smooth scrolling pref + +* NListviews.mcp 13.36 06.10.96 + - added MMB as shift multiselect pref. + - added Drag qualifier prefs (see help bubble for correct entries). + +* NListviews.mcp 13.33 26.09.96 + - added scrollbars prefs. + +* NListviews.mcp 13.31 18.09.96 + - added new entry in Drag radio gadget for MUIV_NList_DragType_Borders. + diff --git a/workbench/classes/zune/nlist/docs/ReadMe b/workbench/classes/zune/nlist/docs/ReadMe new file mode 100755 index 0000000000..40b9475a27 --- /dev/null +++ b/workbench/classes/zune/nlist/docs/ReadMe @@ -0,0 +1,93 @@ +Short: NList custom classes for MUI, V0.111 +Author: NList Open Source Team +Uploader: Jens Langner +Type: dev/mui +Version: 0.111 +Replaces: dev/mui/MCC_NList-0.110.lha +Requires: AmigaOS V37+, MorphOS or AROS, MUI 3.8+, HotkeyString.mcc +Architecture: ppc-amigaos >= 4.0.0; m68k-amigaos >= 3.0; ppc-morphos >= 1.4.2; i386-aros; ppc-aros; x86_64-aros + +ABOUT NList +*********** + +This is a MUI custom class package containing replacements for the +List/Listtree/Listviews/Floattext/Bitmap/Balance MUI built-in classes. + +Horizontal scrolling is fully supported, as well as smooth scrolling, +word wrap, clipboard support, the classic char selection possibility, +drag & drop and many other features. The user can change the column +width with the mouse, and column titles can act as buttons. + +A NListviews.mcp prefs class is included, allowing the user to change +backgrounds, pens, fonts, scrollbars mode, drag & drop mode, multiselect +mode, keys, qualifiers and more. + +Also included is a Floattext.mui replacement that uses NFloattext.mcc, +enabling copy to clipboard and key moving. + +This package includes: + +NList.mcc 20.130 17.12.2011 +NListview.mcc 19.85 17.12.2011 +NFloattext.mcc 19.66 17.12.2011 +NListviews.mcp 19.81 17.12.2011 +NListtree.mcc 18.37 17.12.2011 +NListtree.mcp 18.25 17.12.2011 +NBitmap.mcc 15.15 17.12.2011 +NBalance.mcc 15.11 17.12.2011 + + +INSTALLATION +************ + +1. Extract the archive to a temporary directory: + + > cd RAM: + > lha x MCC_NList.lha + +2. Go to the "MCC_NList/Libs/MUI/" directory where is the directory + matching the operating system you want to install the NList classes for, + e.g.: + + > cd MCC_NList/Libs/MUI/AmigaOS4 + +3. Copy all the #?.mcc and #?.mcp files found in that directory to the + global "MUI:libs/mui/" directory on your system partition. + + > copy #?.mcc MUI:Libs/mui/ + > copy #?.mcp MUI:Libs/mui/ + +4. Reboot and enjoy the new version ;) + + +LEGALESE +******** + +The NList/NListview/NFloattext classes were originally written in 1996 +and are Copyright (C) 1996-1997 by Gilles Masson, whereas the NListtree +classes were originally written in 1999 and are Copyright (C) 1999-2001 +by Carsten Scholling. Since 2001, both class families are maintained and +Copyright (C) 2001-2010 by the NList Open Source Team. + +The complete NList package is distributed under the GNU Lesser General +Public License (LGPL) and the development is hosted at SourceForge.net: + + http://www.sourceforge.net/projects/nlist-classes/ + +Please consult the included "COPYING" file for more detailed information +about the licensing of the classes and their source code. + + +CHANGES SINCE THE LAST RELEASE +****************************** + +Please refer to the included ChangeLog in the archive for more detailed +information on the changes since the last public release. + + __ + / / + __ / / Only Amiga makes it possible... + \ \/ / + \__/ + +Amiga is a trademark of Amiga, Inc. diff --git a/workbench/classes/zune/nlist/include/SDI_compiler.h b/workbench/classes/zune/nlist/include/SDI_compiler.h new file mode 100644 index 0000000000..ec8565d1f2 --- /dev/null +++ b/workbench/classes/zune/nlist/include/SDI_compiler.h @@ -0,0 +1,241 @@ +#ifndef SDI_COMPILER_H +#define SDI_COMPILER_H + +/* Includeheader + + Name: SDI_compiler.h + Versionstring: $VER: SDI_compiler.h 1.35 (03.03.2011) + Author: Dirk Stoecker & Jens Langner + Distribution: PD + Project page: http://www.sf.net/projects/sditools/ + Description: defines to hide compiler stuff + + 1.1 25.06.98 : created from data made by Gunter Nikl + 1.2 17.11.99 : added VBCC + 1.3 29.02.00 : fixed VBCC REG define + 1.4 30.03.00 : fixed SAVEDS for VBCC + 1.5 29.07.00 : added #undef statements (needed e.g. for AmiTCP together + with vbcc) + 1.6 19.05.01 : added STACKEXT and Dice stuff + 1.7 16.06.01 : added MorphOS specials and VARARGS68K + 1.8 21.09.02 : added MorphOS register stuff + 1.9 26.09.02 : added OFFSET macro. Thanks Frank Wille for suggestion + 1.10 18.10.02 : reverted to old MorphOS-method for GCC + 1.11 09.11.02 : added REGARGS define to MorphOS section + 1.12 18.01.04 : some adaptions for AmigaOS4 compatibility + 1.13 17.02.04 : changed ASM macros to be a simple define and added + INTERRUPT, CHIP and FAR + 1.14 02.03.04 : added UNUSED which can be used to specify a function parameter + or variable as "unused" which will not cause any compiler warning. + 1.15 02.03.04 : added special INLINE define for gcc > 3.0 version + 1.17 07.03.04 : changed INLINE definition of gcc <= 2.95.3 to be static aswell. + 1.18 21.06.04 : added USED and USED_VAR attribute to allow placing a + __attribute__((used)) to a function and a variable, taking care of + different compiler versions. + 1.19 04.07.04 : register specification for variables is not supported on MorphOS, + so we modified the REG() macro accordingly. + 1.20 28.02.05 : correct INLINE for VBCC. + 1.21 28.02.05 : cleanup __GCC__ case. + 1.22 16.05.05 : changed the vbcc/REG() macro. + added missing vbcc/VARARGS68K define. + moved morphos SDI_EmulLib Stuff into compilers.h. I know it's not + compiler specific, (Guido Mersmann) + 1.23 30.04.06 : modified to get it compatible to AROS. (Guido Mersmann) + 1.24 06.05.06 : __linearvarargs is only valid for vbcc and PPC, so I moved VARARGS68K + to prevent problems with 68K and i86 targets. (Guido Mersmann) + 1.25 21.06.07 : added NEAR to be usable for __near specification for SAS/C + 1.26 14.10.07 : added DEPRECATED macro which defaults to __attribute__((deprecated)) + for GCC compiles. + 1.27 20.03.09 : applied some changes and fixes to get the header more usable + for an AROS compilation. (Pavel Fedin) + 1.28 25.03.09 : added missing IPTR definition to make SDI_compiler.h more compatible + to AROS. (Pavel Fedin) + 1.29 25.03.09 : fixed the IPTR definition and also the use of the __M68000__ define. + 1.30 26.03.09 : fixed the IPTR definition by only defining it for non AROS targets. + 1.31 29.03.09 : added VARARGS68K definition for AROS. + 1.32 28.05.09 : added STACKED definition for non-AROS targets. + 1.33 03.06.10 : added missing SIPTR definition to make SDI_compiler.h more compatible + to AROS. + 1.34 26.07.10 : adapted IPTR and SIPTR definitions as the latest MorphOS SDK already + contains them. (tboeckel) + 1.35 03.03.11 : fixed AROS macros for m68k (Jason McMullan) + +*/ + +/* +** This is PD (Public Domain). This means you can do with it whatever you want +** without any restrictions. I only ask you to tell me improvements, so I may +** fix the main line of this files as well. +** +** To keep confusion level low: When changing this file, please note it in +** above history list and indicate that the change was not made by myself +** (e.g. add your name or nick name). +** +** Find the latest version of this file at: +** http://cvs.sourceforge.net/viewcvs.py/sditools/sditools/headers/ +** +** Jens Langner and +** Dirk Stoecker +*/ + +/* Some SDI internal header */ + +#undef ASM +#undef REG +#undef LREG +#undef CONST +#undef SAVEDS +#undef INLINE +#undef REGARGS +#undef STDARGS +#undef OFFSET +#undef INTERRUPT +#undef CHIP +#undef FAR +#undef NEAR +#undef UNUSED +#undef USED +#undef USED_VAR +#undef DEPRECATED + +/* first "exceptions" */ + +#if defined(__MAXON__) + #define STDARGS + #define STACKEXT + #define REGARGS + #define SAVEDS + #define INLINE inline +/*************************************************************************/ +#elif defined(__VBCC__) + #define STDARGS + #define STACKEXT + #define REGARGS + #define INLINE static + #define OFFSET(p,m) __offsetof(struct p,m) + + #if defined(__PPC__) + #define VARARGS68K __linearvarargs + #define REG(reg,arg) arg + #else + #define REG(reg,arg) __reg(#reg) arg + #endif +/*************************************************************************/ +#elif defined(__STORM__) + #define STDARGS + #define STACKEXT + #define REGARGS + #define INLINE inline +/*************************************************************************/ +#elif defined(__SASC) + #define ASM __asm +/*************************************************************************/ +#elif defined(__GNUC__) + #define UNUSED __attribute__((unused)) /* for functions, variables and types */ + #define USED __attribute__((used)) /* for functions only! */ + #define DEPRECATED __attribute__((deprecated)) + #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) + #define USED_VAR USED /* for variables only! */ + #define INLINE static __inline __attribute__((always_inline)) + #endif + /* we have to distinguish between AmigaOS4 and MorphOS */ + #if (defined(_M68000) || defined(__M68000) || defined(__mc68000)) && !defined(__AROS__) + #define REG(reg,arg) arg __asm(#reg) + #define LREG(reg,arg) register REG(reg,arg) + #else + #define REG(reg,arg) arg + #define SAVEDS + #define STDARGS + #define REGARGS + #define STACKEXT + #if defined(__MORPHOS__) + #define VARARGS68K __attribute__((varargs68k)) + #endif + #if defined(__AROS__) + #define VARARGS68K __stackparm + #endif + #define INTERRUPT + #define CHIP + #endif + #define FAR + #define NEAR +#elif defined(_DCC) + #define REG(reg,arg) __##reg arg + #define STACKEXT __stkcheck + #define STDARGS __stkargs + #define INLINE static +#endif + +/* then "common" ones */ + +#if !defined(ASM) + #define ASM +#endif +#if !defined(REG) + #define REG(reg,arg) register __##reg arg +#endif +#if !defined(LREG) + #define LREG(reg,arg) register arg +#endif +#if !defined(CONST) + #define CONST const +#endif +#if !defined(SAVEDS) + #define SAVEDS __saveds +#endif +#if !defined(INLINE) + #define INLINE static __inline +#endif +#if !defined(REGARGS) + #define REGARGS __regargs +#endif +#if !defined(STDARGS) + #define STDARGS __stdargs +#endif +#if !defined(STACKEXT) + #define STACKEXT __stackext +#endif +#if !defined(VARARGS68K) + #define VARARGS68K +#endif +#if !defined(OFFSET) + #define OFFSET(structName, structEntry) \ + ((char *)(&(((struct structName *)0)->structEntry))-(char *)0) +#endif +#if !defined(INTERRUPT) + #define INTERRUPT __interrupt +#endif +#if !defined(CHIP) + #define CHIP __chip +#endif +#if !defined(FAR) + #define FAR __far +#endif +#if !defined(NEAR) + #define NEAR __near +#endif +#if !defined(UNUSED) + #define UNUSED +#endif +#if !defined(USED) + #define USED +#endif +#if !defined(USED_VAR) + #define USED_VAR +#endif +#if !defined(DEPRECATED) + #define DEPRECATED +#endif +#if !defined(__AROS__) && !defined(__MORPHOS__) && !defined(IPTR) + #define IPTR ULONG +#endif +#if !defined(__AROS__) && !defined(__MORPHOS__) && !defined(SIPTR) + #define SIPTR LONG +#endif +#if !defined(__AROS__) && !defined(STACKED) + #define STACKED +#endif + +/*************************************************************************/ + +#endif /* SDI_COMPILER_H */ diff --git a/workbench/classes/zune/nlist/include/SDI_hook.h b/workbench/classes/zune/nlist/include/SDI_hook.h new file mode 100644 index 0000000000..1dd08c89fe --- /dev/null +++ b/workbench/classes/zune/nlist/include/SDI_hook.h @@ -0,0 +1,246 @@ +#ifndef SDI_HOOK_H +#define SDI_HOOK_H + +/* Includeheader + + Name: SDI_hook.h + Versionstring: $VER: SDI_hook.h 1.24 (03.03.2011) + Author: SDI & Jens Langner + Distribution: PD + Project page: http://www.sf.net/projects/sditools/ + Description: defines to hide compiler specific hook stuff + + 1.0 21.06.02 : based on the work made for freeciv and YAM with + additional texts partly taken from YAM_hook.h changes made + by Jens Langner, largely reworked the mechanism + 1.1 07.10.02 : added HOOKPROTONP and HOOKPROTONONP requested by Jens + 1.2 18.10.02 : reverted to old MorphOS-method for GCC + 1.3 08.02.04 : modified to get it compatible to AmigaOS4 + 1.4 17.02.04 : modified to get compatible to latest SDI_compiler.h changes + 1.5 02.03.04 : added UNUSED define to OS4 hook specification so that the + compiler can ignore some warnings. + 1.6 02.03.04 : added (APTR) casts to MorphOS prototype definition to + reduce compiler warnings. + 1.7 04.07.04 : removed static from all DISPATCHERPROTO definitions as there + may be dispatchers that are of course non static. + 1.8 07.04.05 : added MakeHookWithData (Sebastian Bauer) + 1.9 08.04.05 : changed MorphOS hooks to use HookEntry (Ilkka Lehtoranta) + 1.10 16.05.05 : simplified and fixed for vbcc/MorphOS (Frank Wille) + 1.11 17.05.05 : changed cast in DISPATCHERPROTO from (void(*)()) to APTR + cause SDI version of the EmulLibEntry uses APTR for easy + usage. + Added #ifndef SDI_TRAP_LIB to avoid double defines when + combining with SDI_interrupt.h or SDI_misc.h (Guido + Mersmann) + 1.12 18.05.05 : DISPATCHERPROTO wasn't working, because of the missing REG_Ax + definitions. Added include (Guido Mersmann) + 1.13 11.12.05 : fixed a minor typo in the PPC HOOKPROTONP macro. + (Jens Langner) + 1.14 20.04.06 : unified static of MorphOs with non-MorphOS vesion + 1.15 30.04.06 : modified to get it compatible to AROS. (Guido Mersmann) + 1.16 06.10.06 : added new DISPATCHER() macro and separated it from the + DISPATCHERPROTO() definition. Now the DISPATCHERPROTO() should + only be used to get the correct prototype and the plain + DISPATCHER() for defining the dispatcher itself. + 1.17 14.07.08 : added "_" to all UNUSED variable specifications to make sure + a user does not use those definition on accident. + 1.18 20.03.09 : modified macros to be somewhat more compatible for an AROS + usage (Pavel Fedin) + 1.19 25.03.09 : fixed the DISPATCHERPROTO() macros for x86_64 AROS. + 1.20 26.03.09 : fixed m68k define checks. + 1.21 19.05.09 : added SDISPATCHER() to generate a static dispatcher. + 1.22 24.06.10 : fixed AROS macros (Matthias Rustler). + 1.23 12.08.10 : added missing proto/alib.h include for AROS + 1.24 03.03.11 : fixed AROS macros for m68k (Jason McMullan) + +*/ + +/* +** This is PD (Public Domain). This means you can do with it whatever you want +** without any restrictions. I only ask you to tell me improvements, so I may +** fix the main line of this files as well. +** +** To keep confusion level low: When changing this file, please note it in +** above history list and indicate that the change was not made by myself +** (e.g. add your name or nick name). +** +** Find the latest version of this file at: +** http://cvs.sourceforge.net/viewcvs.py/sditools/sditools/headers/ +** +** Jens Langner and +** Dirk Stoecker +*/ + +#include "SDI_compiler.h" + +/* +** Hook macros to handle the creation of Hooks/Dispatchers for different +** Operating System versions. +** Currently AmigaOS, AROS, and MorphOS are supported. +** +** For more information about hooks see include file or +** the relevant descriptions in utility.library autodocs. +** +** Example: +** +** Creates a hook with the name "TestHook" that calls a corresponding +** function "TestFunc" that will be called with a pointer "text" +** (in register A1) and returns a long. +** +** HOOKPROTONHNO(TestFunc, LONG, STRPTR text) +** { +** Printf(text); +** return 0; +** } +** MakeHook(TestHook, TestFunc); +** +** Every function that is created with HOOKPROTO* must have a MakeHook() or +** MakeStaticHook() to create the corresponding hook. Best is to call this +** directly after the hook function. This is required by the GCC macros. +** +** The naming convention for the Hook Prototype macros is as followed: +** +** HOOKPROTO[NH][NO][NP] +** ^^ ^^ ^^ +** NoHook | NoParameter +** NoObject +** +** So a plain HOOKPROTO() creates you a Hook function that requires +** 4 parameters, the "name" of the hookfunction, the "obj" in REG_A2, +** the "param" in REG_A1 and a "hook" in REG_A0. Usually you will always +** use NH, as the hook structure itself is nearly never required. +** +** The DISPATCHERPROTO macro is for MUI dispatcher functions. It gets the +** functionname as argument. To supply this function for use by MUI, use +** The ENTRY macro, which also gets the function name as argument. +*/ + +#if !defined(__AROS__) && (defined(_M68000) || defined(__M68000) || defined(__mc68000)) + #define HOOKPROTO(name, ret, obj, param) static SAVEDS ASM ret \ + name(REG(a0, struct Hook *hook), REG(a2, obj), REG(a1, param)) + #define HOOKPROTONO(name, ret, param) static SAVEDS ASM ret \ + name(REG(a0, struct Hook *hook), REG(a1, param)) + #define HOOKPROTONP(name, ret, obj) static SAVEDS ASM ret \ + name(REG(a0, struct Hook *hook), REG(a2, obj)) + #define HOOKPROTONONP(name, ret) static SAVEDS ASM ret \ + name(REG(a0, struct Hook *hook)) + #define HOOKPROTONH(name, ret, obj, param) static SAVEDS ASM ret \ + name(REG(a2, obj), REG(a1, param)) + #define HOOKPROTONHNO(name, ret, param) static SAVEDS ASM ret \ + name(REG(a1, param)) + #define HOOKPROTONHNP(name, ret, obj) static SAVEDS ASM ret \ + name(REG(a2, obj)) + #define HOOKPROTONHNONP(name, ret) static SAVEDS ret name(void) +#else + /* NOTE: This is fine for AROS, since HookEntry will handle stack params + */ + #define HOOKPROTO(name, ret, obj, param) static SAVEDS ret \ + name(struct Hook *hook, obj, param) + #define HOOKPROTONO(name, ret, param) static SAVEDS ret \ + name(struct Hook *hook, UNUSED APTR _obj, param) + #define HOOKPROTONP(name, ret, obj) static SAVEDS ret \ + name(struct Hook *hook, obj, UNUSED APTR _param) + #define HOOKPROTONONP(name, ret) static SAVEDS ret \ + name(struct Hook *hook, UNUSED APTR _obj, UNUSED APTR _param) + #define HOOKPROTONH(name, ret, obj, param) static SAVEDS ret \ + name(UNUSED struct Hook *_hook, obj, param) + #define HOOKPROTONHNO(name, ret, param) static SAVEDS ret \ + name(UNUSED struct Hook *_hook, UNUSED APTR _obj, param) + #define HOOKPROTONHNP(name, ret, obj) static SAVEDS ret \ + name(UNUSED struct Hook *_hook, obj, UNUSED APTR _param) + #define HOOKPROTONHNONP(name, ret) static SAVEDS ret name(void) +#endif + +#ifdef __MORPHOS__ + + #ifndef SDI_TRAP_LIB /* avoid defining this twice */ + #include + #include + + #define SDI_TRAP_LIB 0xFF00 /* SDI prefix to reduce conflicts */ + + struct SDI_EmulLibEntry + { + UWORD Trap; + UWORD pad; + APTR Func; + }; + #endif + + #define MakeHook(hookname, funcname) struct Hook hookname = {{NULL, NULL}, \ + (HOOKFUNC)HookEntry, (HOOKFUNC)funcname, NULL} + #define MakeHookWithData(hookname, funcname, data) struct Hook hookname = \ + {{NULL, NULL}, (HOOKFUNC)HookEntry, (HOOKFUNC)funcname, (APTR)data} + #define MakeStaticHook(hookname, funcname) static struct Hook hookname = \ + {{NULL, NULL}, (HOOKFUNC)HookEntry, (HOOKFUNC)funcname, NULL} + #define DISPATCHERPROTO(name) ULONG name(struct IClass * cl, Object * obj, \ + Msg msg); \ + extern const struct SDI_EmulLibEntry Gate_##name + #define DISPATCHER(name) \ + struct IClass; \ + ULONG name(struct IClass * cl, Object * obj, Msg msg); \ + static ULONG Trampoline_##name(void) {return name((struct IClass *) \ + REG_A0, (Object *) REG_A2, (Msg) REG_A1);} \ + const struct SDI_EmulLibEntry Gate_##name = {SDI_TRAP_LIB, 0, \ + (APTR) Trampoline_##name}; \ + ULONG name(struct IClass * cl, Object * obj, Msg msg) + #define SDISPATCHER(name) \ + struct IClass; \ + static ULONG name(struct IClass * cl, Object * obj, Msg msg); \ + static ULONG Trampoline_##name(void) {return name((struct IClass *) \ + REG_A0, (Object *) REG_A2, (Msg) REG_A1);} \ + static const struct SDI_EmulLibEntry Gate_##name = {SDI_TRAP_LIB, 0, \ + (APTR) Trampoline_##name}; \ + static ULONG name(struct IClass * cl, Object * obj, Msg msg) + #define ENTRY(func) (APTR)&Gate_##func + +#elif defined(__AROS__) + #include + + #define MakeHook(hookname, funcname) struct Hook hookname = {{NULL, NULL}, \ + (HOOKFUNC)HookEntry, (HOOKFUNC)funcname, NULL} + #define MakeHookWithData(hookname, funcname, data) struct Hook hookname = \ + {{NULL, NULL}, (HOOKFUNC)HookEntry, (HOOKFUNC)funcname, (APTR)data} + #define MakeStaticHook(hookname, funcname) static struct Hook hookname = \ + {{NULL, NULL}, (HOOKFUNC)HookEntry, (HOOKFUNC)funcname, NULL} + #define DISPATCHERPROTO(name) \ + IPTR name(struct IClass * cl, Object * obj, Msg msg); \ + AROS_UFP3(IPTR, Gate_##name, \ + AROS_UFPA(struct IClass *, cl, A0), \ + AROS_UFPA(Object *, obj, A2), \ + AROS_UFPA(Msg, msg, A1)) + #define DISPATCHERx(x,name) \ + x IPTR name(struct IClass * cl, Object * obj, Msg msg); \ + x AROS_UFH3(IPTR, Gate_##name, \ + AROS_UFHA(struct IClass *, cl, A0), \ + AROS_UFHA(Object *, obj, A2), \ + AROS_UFHA(Msg, msg, A1)) \ + { AROS_USERFUNC_INIT \ + return name(cl, obj, msg); \ + AROS_USERFUNC_EXIT \ + } \ + x IPTR name(struct IClass * cl, Object * obj, Msg msg) + #define DISPATCHER(name) DISPATCHERx(,name) + #define SDISPATCHER(name) DISPATCHERx(static,name) + #define ENTRY(func) (APTR)Gate_##func + +#else /* !__MORPHOS__ && !__AROS__*/ + + #define MakeHook(hookname, funcname) struct Hook hookname = {{NULL, NULL}, \ + (HOOKFUNC)funcname, NULL, NULL} + #define MakeHookWithData(hookname, funcname, data) struct Hook hookname = \ + {{NULL, NULL}, (HOOKFUNC)funcname, NULL, (APTR)data} + #define MakeStaticHook(hookname, funcname) static struct Hook hookname = \ + {{NULL, NULL}, (HOOKFUNC)funcname, NULL, NULL} + #define ENTRY(func) (APTR)func + #define DISPATCHERPROTO(name) SAVEDS ASM IPTR name(REG(a0, \ + struct IClass * cl), REG(a2, Object * obj), REG(a1, Msg msg)) + #define DISPATCHER(name) DISPATCHERPROTO(name) + #define SDISPATCHER(name) static DISPATCHERPROTO(name) + +#endif + +#define InitHook(hook, orighook, data) ((hook)->h_Entry = (orighook).h_Entry,\ + (hook)->h_SubEntry = (orighook).h_SubEntry,(hook)->h_Data = (APTR)(data)) + +#endif /* SDI_HOOK_H */ diff --git a/workbench/classes/zune/nlist/include/SDI_lib.h b/workbench/classes/zune/nlist/include/SDI_lib.h new file mode 100644 index 0000000000..930904c863 --- /dev/null +++ b/workbench/classes/zune/nlist/include/SDI_lib.h @@ -0,0 +1,205 @@ +#ifndef SDI_LIB_H +#define SDI_LIB_H + +/* Includeheader + + Name: SDI_lib.h + Versionstring: $VER: SDI_lib.h 1.9 (15.03.2009) + Author: Jens Langner + Distribution: PD + Project page: http://www.sf.net/projects/sditools/ + Description: defines to hide OS specific library function definitions + + 1.0 09.05.04 : initial version which allows to hide OS specific shared + library function definition like it has been introduced with + the new interface based library system in AmigaOS4. + 1.1 13.05.04 : replaced the LIBENTRY() macro with some more sophisticated + LFUNC_ macros which allow to maintain varargs library functions + in a much easier manner. + 1.2 22.05.04 : removed the anyway not required SAVEDS and ASM statements + from the LIBFUNC macro for OS4. Also removed the LIBFUNC + statement in the 68k LIBPROTOVA() macro so that no registers + can be used in there (which should be the default). + 1.3 04.07.04 : added empty LIBFUNC define for MorphOS which was missing. + 1.4 05.10.04 : added missing LIBFUNC call to OS3/MOS interface + 1.5 19.05.05 : fixed some documentation glitches (Guido Mersmann) + 1.6 08.06.05 : swapped LIBFUNC and ret within the prototype, because + c standard says attributes first and vbcc want them like + this. (Guido Mersmann) + changed the documentation to explain that LIBFUNC must be + set first. (Guido Mersmann) + 1.7 11.12.05 : adapted all macros to be somewhat more compatible to also + OS3 and MorphOS. Now in the real use case (codesets.library) + it required a fundamental rework of the macros. (Jens Langner) + 1.8 28.02.06 : removed "##" in front of the OS3 __VARARGS__ usage as they + causing errors on GCC >= 3.x. + 1.9 15.03.09 : fixed some missing function prototype in LIBPROTOVA() + 1.10 30.04.09 : added approriate LIBPROTOVA() definition for OS3 and MorphOS + to at least make the functions known. The same pattern as for + LIBSTUBVA() will be used now (Thore Böckelmann) + 1.11 04.05.09 : reverted the faulty LIBPROTOVA() definition to its previous + version (Thore Böckelmann) + +*/ + +/* +** This is PD (Public Domain). This means you can do with it whatever you want +** without any restrictions. I only ask you to tell me improvements, so I may +** fix the main line of this files as well. +** +** To keep confusion level low: When changing this file, please note it in +** above history list and indicate that the change was not made by myself +** (e.g. add your name or nick name). +** +** Find the latest version of this file at: +** http://cvs.sourceforge.net/viewcvs.py/sditools/sditools/headers/ +** +** Jens Langner and +** Dirk Stöcker +*/ + +#include "SDI_compiler.h" + +/* +** Library function macros to handle the definition/usage for different +** Operating System versions. +** Currently special library function handling for AmigaOS version 4 is +** supported +** +** Example: +** +** Defines a library jump function "TestFunc" with a ULONG return value and +** which is called by the corresponding library vector of a shared library. +** +** LIBFUNC ULONG TestFunc(REG(d0, text)) +** { +** Printf(text); +** return 0; +** } +** +** Please note the use of the LIBFUNC macro which defines this function +** automatically as a function which is directly called from within a shared +** library. Since this macro contains compiler attributes it must be +** called first, even if some compiler allow attributes and result type +** mixed, other do not and we want to keep the stuff compiler independent. +** +** If you now require to have some OS/compiler independent prototype +** definition please use the following statement: +** +** LIBPROTO(TestFunc, ULONG, REG(d0, text)); +** +** This will ensure that you get a proper prototype for the same function +** where this macro will automatically take care that a libstub_* stub +** will also automatically defines as required if you are generating a +** OS4 shared library which should also be backward compatible to OS3. +** +** So if you then want to add this function to a library interface please +** use the LFUNC_* macros to generate your library function vector +** like this example one: +** +** #define libvector LFUNC_FAS(SomeFunc) \ +** LFUNC_FA_(TestFunc) \ +** LFUNC_VA_(VarargsFunc) +** +** This way you can then easily put the "libvector" define in your real +** library function vector of your shared library instead of having to +** specify each function with surrounded "#ifdef" defines. These macros +** will then also take automatically care that the varargs functions +** will only be specified on OS versions where these functions are now +** real functions (like with OS4) +** +** Such stub functions can then also be easily specified as followed +** (in analogy to the above example) +** +** LIBPROTO(TestFunc, ULONG, REG(d0, text)) +** { +** return TestFunc(text); +** } +** +** On AmigaOS4 using this mechanism for the definition of the library functions +** will automatically ensure that the "struct Interface *self" pointer is included +** and can be easily referenced as such in the function. +** +** By using this schema a developer might ensure full source code backward +** compatibility to AmigaOS3 without having to introduce dozens of #ifdef +** statements in his code. +*/ + +#ifdef LIBFUNC +#undef LIBFUNC +#endif + +#if defined(__amigaos4__) + #define LIBFUNC + #if !defined(__cplusplus) && \ + (__STDC_VERSION__ >= 199901L || __GNUC__ >= 3 || \ + (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) + #define LIBPROTO(name, ret, ...) \ + LIBFUNC ret name(__VA_ARGS__); \ + LIBFUNC ret libstub_##name(struct Interface *self UNUSED, \ + ## __VA_ARGS__) + #define LIBPROTOVA(name, ret, ...) \ + /*LIBFUNC ret VARARGS68K name(__VA_ARGS__);*/ \ + LIBFUNC ret VARARGS68K \ + libstub_##name(struct Interface *self UNUSED, ## __VA_ARGS__) + #define LIBSTUB(name, ret, ...) \ + LIBFUNC ret name(__VA_ARGS__); \ + LIBFUNC ret libstub_##name(struct Interface *self UNUSED, \ + ## __VA_ARGS__) + #define LIBSTUBVA(name, ret, ...) \ + LIBFUNC ret VARARGS68K \ + libstub_##name(struct Interface *self UNUSED, ## __VA_ARGS__) + #endif + #define LFUNC_FAS(name) libstub_##name + #define LFUNC_VAS(name) libstub_##name + #define LFUNC_FA_(name) ,libstub_##name + #define LFUNC_VA_(name) ,libstub_##name + #define LFUNC(name) libstub_##name +#elif defined(__MORPHOS__) + #define LIBFUNC + #if !defined(__cplusplus) && \ + (__STDC_VERSION__ >= 199901L || __GNUC__ >= 3 || \ + (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) + #define LIBPROTO(name, ret, ...) \ + LIBFUNC ret name(__VA_ARGS__); \ + LIBFUNC ret libstub_##name(void) + #define LIBPROTOVA(name, ret, ...) \ + LIBFUNC ret VARARGS68K name(__VA_ARGS__); + #define LIBSTUB(name, ret, ...) \ + LIBFUNC ret name(__VA_ARGS__); \ + LIBFUNC ret libstub_##name(void) + #define LIBSTUBVA(name, ret, ...) \ + LIBFUNC UNUSED ret VARARGS68K libstub_##name(void) + #endif + #define LFUNC_FAS(name) libstub_##name + #define LFUNC_VAS(name) + #define LFUNC_FA_(name) ,libstub_##name + #define LFUNC_VA_(name) + #define LFUNC(name) libstub_##name +#else + #define LIBFUNC SAVEDS ASM + #if !defined(__cplusplus) && \ + (__STDC_VERSION__ >= 199901L || __GNUC__ >= 3 || \ + (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) + #define LIBPROTO(name, ret, ...) \ + LIBFUNC ret name(__VA_ARGS__) + #define LIBPROTOVA(name, ret, ...) \ + LIBFUNC ret STDARGS VARARGS68K name(__VA_ARGS__); + #define LIBSTUB(name, ret, ...) \ + LIBFUNC ret name(__VA_ARGS__); \ + LIBFUNC ret libstub_##name(__VA_ARGS__) + #define LIBSTUBVA(name, ret, ...) \ + LIBFUNC UNUSED ret STDARGS VARARGS68K libstub_##name(__VA_ARGS__) + #endif + #define LFUNC_FAS(name) name + #define LFUNC_VAS(name) + #define LFUNC_FA_(name) ,name + #define LFUNC_VA_(name) + #define LFUNC(name) name +#endif + +#if !defined(LIBPROTO) || !defined(LIBPROTOVA) + #error "OS or compiler is not yet supported by SDI_lib.h" +#endif + +#endif /* SDI_LIB_H */ diff --git a/workbench/classes/zune/nlist/include/SDI_stdarg.h b/workbench/classes/zune/nlist/include/SDI_stdarg.h new file mode 100644 index 0000000000..a7243e6ce0 --- /dev/null +++ b/workbench/classes/zune/nlist/include/SDI_stdarg.h @@ -0,0 +1,105 @@ +#ifndef SDI_STDARG_H +#define SDI_STDARG_H + +/* Includeheader + + Name: SDI_stdarg.h + Versionstring: $VER: SDI_stdarg.h 1.0 (05.07.2004) + Author: Jens Langner + Distribution: PD + Project page: http://www.sf.net/projects/sditools/ + Description: defines to hide OS specific variable arguments + function definitions + + 1.0 05.07.04 : initial version + +*/ + +/* +** This is PD (Public Domain). This means you can do with it whatever you want +** without any restrictions. I only ask you to tell me improvements, so I may +** fix the main line of this files as well. +** +** To keep confusion level low: When changing this file, please note it in +** above history list and indicate that the change was not made by myself +** (e.g. add your name or nick name). +** +** Find the latest version of this file at: +** http://cvs.sourceforge.net/viewcvs.py/sditools/sditools/headers/ +** +** Jens Langner and +** Dirk Stöcker +*/ + +#include "SDI_compiler.h" + +/* +** Variable arguments function macros to allow specification of the +** variable arguments typical functions like va_list/va_start/va_end in +** an operating system independent fashion. +** +** With help of the following macro definition a developer might define +** variable arguments functions for different types of operating +** system implementations without having to clutter the sources with +** multiple "#ifdef" defines just because all of these operating systems +** come with different varable arguments support functions. +** +** Example: +** +** Instead of using the standard va_list, va_start and va_end functions +** of , a developer might specify the following sprintf() +** function to make it automatically compatible with AmigaOS3, AmigaOS4 +** and also MorphOS. +** +** int VARARGS68K sprintf(char *buf, char *fmt, ...) +** { +** VA_LIST args; +** +** VA_START(args, fmt); +** RawDoFmt(fmt, VA_ARG(args, void *), NULL, buf); +** VA_END(args); +** +** return(strlen(buf)); +** } +** +** Please note the uppercase letters of the macros in contrast to the +** official varargs functions specified in . +** +** By using this schema a developer might ensure full source code backward +** compatibility to AmigaOS3 without having to introduce dozens of #ifdef +** statements in his code. +*/ + +#include + +#ifdef VA_LIST +#undef VA_LIST +#endif +#ifdef VA_START +#undef VA_START +#endif +#ifdef VA_ARG +#undef VA_ARG +#endif +#ifdef VA_END +#undef VA_END +#endif + +#if defined(__amigaos4__) + #define VA_LIST va_list + #define VA_START(va, start) va_startlinear((va), (start)) + #define VA_ARG(va, type) va_getlinearva((va), type) + #define VA_END(va) va_end((va)) +#elif defined(__MORPHOS__) + #define VA_LIST va_list + #define VA_START(va, start) va_start((va), (start)) + #define VA_ARG(va, type) (va)->overflow_arg_area + #define VA_END(va) va_end((va)) +#else + #define VA_LIST va_list + #define VA_START(va, start) va_start((va), (start)) + #define VA_ARG(va, type) (va) + #define VA_END(va) va_end((va)) +#endif + +#endif /* SDI_STDARG_H */ diff --git a/workbench/classes/zune/nlist/include/amiga-align.h b/workbench/classes/zune/nlist/include/amiga-align.h new file mode 100644 index 0000000000..9e56a258a3 --- /dev/null +++ b/workbench/classes/zune/nlist/include/amiga-align.h @@ -0,0 +1,42 @@ +/*************************************************************************** + + YAM - Yet Another Mailer + Copyright (C) 1995-2000 by Marcel Beck + Copyright (C) 2000-2004 by YAM Open Source Team + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + YAM Official Support Site : http://www.yam.ch + YAM OpenSource project : http://sourceforge.net/projects/yamos/ + + $Id$ + +***************************************************************************/ + +/* +** Special include file for setting a global +** pragma to align structures to 68k +** +** This is needed by AmigaOS4 or MorphOS or every PPC +** because alignment on PPC is different. +*/ +#if defined(__PPC__) + #if defined(__GNUC__) + #pragma pack(2) + #elif defined(__VBCC__) + #pragma amiga-align + #endif +#endif + diff --git a/workbench/classes/zune/nlist/include/clib/mccclass_protos.h b/workbench/classes/zune/nlist/include/clib/mccclass_protos.h new file mode 100755 index 0000000000..be0209d299 --- /dev/null +++ b/workbench/classes/zune/nlist/include/clib/mccclass_protos.h @@ -0,0 +1,10 @@ +#ifndef MCCCLASS_PROTOS_H +#define MCCCLASS_PROTOS_H + +#ifndef EXEC_TYPES_H +#include +#endif + +ULONG MCC_Query(LONG which); + +#endif diff --git a/workbench/classes/zune/nlist/include/clib/muimaster_protos.h b/workbench/classes/zune/nlist/include/clib/muimaster_protos.h new file mode 100644 index 0000000000..9d71421e69 --- /dev/null +++ b/workbench/classes/zune/nlist/include/clib/muimaster_protos.h @@ -0,0 +1,70 @@ +#ifndef CLIB_MUIMASTER_PROTOS_H +#define CLIB_MUIMASTER_PROTOS_H + +#ifndef EXEC_TYPES_H +#include +#endif +#ifndef INTUITION_CLASSES_H +#include +#endif +#ifndef UTILITY_TAGITEM_H +#include +#endif +#ifndef LIBRARIES_MUI_H +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************/ +/* functions to be used in applications */ +/****************************************/ + +Object *MUI_NewObjectA (CONST_STRPTR classname,struct TagItem *tags); +Object *MUI_NewObject (CONST_STRPTR classname,Tag tag1,...); +Object *MUI_MakeObjectA (LONG type,ULONG *params); +Object *MUI_MakeObject (LONG type,...); +VOID MUI_DisposeObject (Object *obj); +LONG MUI_RequestA (APTR app,APTR win,LONGBITS flags,CONST_STRPTR title,CONST_STRPTR gadgets,CONST_STRPTR format,APTR params); +LONG MUI_Request (APTR app,APTR win,LONGBITS flags,CONST_STRPTR title,CONST_STRPTR gadgets,CONST_STRPTR format,...); +LONG MUI_Error (VOID); +APTR MUI_AllocAslRequest (unsigned long reqType, struct TagItem *tagList); +APTR MUI_AllocAslRequestTags(unsigned long reqType, Tag Tag1, ...); +VOID MUI_FreeAslRequest (APTR requester ); +BOOL MUI_AslRequest (APTR requester, struct TagItem *tagList); +BOOL MUI_AslRequestTags (APTR requester, Tag Tag1, ...); + +/******************************************/ +/* functions to be used in custom classes */ +/******************************************/ + +LONG MUI_SetError (LONG num); +struct IClass * MUI_GetClass (CONST_STRPTR classname); +VOID MUI_FreeClass (struct IClass *classptr); +VOID MUI_RequestIDCMP (Object *obj,ULONG flags); +VOID MUI_RejectIDCMP (Object *obj,ULONG flags); +VOID MUI_Redraw (Object *obj,ULONG flags); +APTR MUI_AddClipping (struct MUI_RenderInfo *mri,WORD left,WORD top,WORD width,WORD height); +VOID MUI_RemoveClipping (struct MUI_RenderInfo *mri,APTR handle); +APTR MUI_AddClipRegion (struct MUI_RenderInfo *mri,struct Region *r); +VOID MUI_RemoveClipRegion (struct MUI_RenderInfo *mri,APTR handle); +BOOL MUI_BeginRefresh (struct MUI_RenderInfo *mri,ULONG flags); +VOID MUI_EndRefresh (struct MUI_RenderInfo *mri,ULONG flags); +struct MUI_CustomClass *MUI_CreateCustomClass(struct Library *base,CONST_STRPTR supername,struct MUI_CustomClass *supermcc,int datasize,APTR dispatcher); +BOOL MUI_DeleteCustomClass(struct MUI_CustomClass *mcc); +LONG MUI_ObtainPen (struct MUI_RenderInfo *mri,struct MUI_PenSpec *spec,ULONG flags); +VOID MUI_ReleasePen (struct MUI_RenderInfo *mri,LONG pen); + +/*************************************************************/ +/* layout function, use only in custom layout callback hook! */ +/*************************************************************/ + +BOOL MUI_Layout(Object *obj,LONG left,LONG top,LONG width,LONG height,ULONG flags); + +#ifdef __cplusplus +} +#endif + +#endif /* CLIB_MUIMASTER_PROTOS_H */ diff --git a/workbench/classes/zune/nlist/include/default-align.h b/workbench/classes/zune/nlist/include/default-align.h new file mode 100644 index 0000000000..e7aebbd124 --- /dev/null +++ b/workbench/classes/zune/nlist/include/default-align.h @@ -0,0 +1,42 @@ +/*************************************************************************** + + YAM - Yet Another Mailer + Copyright (C) 1995-2000 by Marcel Beck + Copyright (C) 2000-2004 by YAM Open Source Team + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + YAM Official Support Site : http://www.yam.ch + YAM OpenSource project : http://sourceforge.net/projects/yamos/ + + $Id$ + +***************************************************************************/ + +/* +** Special include file for setting a global +** pragma to unalign structures to 68k +** +** This is needed by AmigaOS4 or MorphOS or every PPC +** because alignment on PPC is different. +*/ +#if defined(__PPC__) + #if defined(__GNUC__) + #pragma pack() + #elif defined(__VBCC__) + #pragma default-align + #endif +#endif + diff --git a/workbench/classes/zune/nlist/include/defines/mccclass.h b/workbench/classes/zune/nlist/include/defines/mccclass.h new file mode 100644 index 0000000000..0ffc2ea09e --- /dev/null +++ b/workbench/classes/zune/nlist/include/defines/mccclass.h @@ -0,0 +1,28 @@ +/* Automatically generated header (sfdc 1.4)! Do not edit! */ + +#ifndef _INLINE_MCCCLASS_H +#define _INLINE_MCCCLASS_H + +#ifndef _SFDC_VARARG_DEFINED +#define _SFDC_VARARG_DEFINED +#ifdef __HAVE_IPTR_ATTR__ +typedef APTR _sfdc_vararg __attribute__((iptr)); +#else +typedef ULONG _sfdc_vararg; +#endif /* __HAVE_IPTR_ATTR__ */ +#endif /* _SFDC_VARARG_DEFINED */ + +#ifndef AROS_LIBCALL_H +#include +#endif /* !AROS_LIBCALL_H */ + +#ifndef MCCCLASS_BASE_NAME +#define MCCCLASS_BASE_NAME MCCClassBase +#endif /* !MCCCLASS_BASE_NAME */ + +#define MCC_Query(___which) \ + AROS_LC1(ULONG, MCC_Query, \ + AROS_LCA(LONG, (___which), D0), \ + struct Library *, MCCCLASS_BASE_NAME, 5, Mccclass) + +#endif /* !_INLINE_MCCCLASS_H */ diff --git a/workbench/classes/zune/nlist/include/inline/mccclass.h b/workbench/classes/zune/nlist/include/inline/mccclass.h new file mode 100644 index 0000000000..a68f4cfc9b --- /dev/null +++ b/workbench/classes/zune/nlist/include/inline/mccclass.h @@ -0,0 +1,16 @@ +#ifndef _INLINE_MCCCLASS_H +#define _INLINE_MCCCLASS_H + +#ifndef __INLINE_MACROS_H +#include +#endif + +#ifndef MCCCLASS_BASE_NAME +#define MCCCLASS_BASE_NAME MCCClassBase +#endif + +#define MCC_Query(which) \ + LP1(0x1e, ULONG, MCC_Query, LONG, which, d0, \ + , MCCCLASS_BASE_NAME) + +#endif /* _INLINE_MCCCLASS_H */ diff --git a/workbench/classes/zune/nlist/include/inline/muimaster.h b/workbench/classes/zune/nlist/include/inline/muimaster.h new file mode 100644 index 0000000000..552ea2e1c1 --- /dev/null +++ b/workbench/classes/zune/nlist/include/inline/muimaster.h @@ -0,0 +1,139 @@ +/* Automatically generated header! Do not edit! */ + +#ifndef _INLINE_MUIMASTER_H +#define _INLINE_MUIMASTER_H + +#ifndef __INLINE_MACROS_H +#include +#endif /* !__INLINE_MACROS_H */ + +#ifndef MUIMASTER_BASE_NAME +#define MUIMASTER_BASE_NAME MUIMasterBase +#endif /* !MUIMASTER_BASE_NAME */ + +#define MUI_AddClipRegion(mri, region) \ + LP2(0xb4, APTR, MUI_AddClipRegion, struct MUI_RenderInfo *, mri, a0, struct Region *, region, a1, \ + , MUIMASTER_BASE_NAME) + +#define MUI_AddClipping(mri, l, t, w, h) \ + LP5(0xa8, APTR, MUI_AddClipping, struct MUI_RenderInfo *, mri, a0, WORD, l, d0, WORD, t, d1, WORD, w, d2, WORD, h, d3, \ + , MUIMASTER_BASE_NAME) + +#define MUI_AllocAslRequest(type, tags) \ + LP2(0x30, APTR, MUI_AllocAslRequest, unsigned long, type, d0, struct TagItem *, tags, a0, \ + , MUIMASTER_BASE_NAME) + +#ifndef NO_INLINE_STDARG +#define MUI_AllocAslRequestTags(a0, tags...) \ + ({ULONG _tags[] = { tags }; MUI_AllocAslRequest((a0), (struct TagItem *)_tags);}) +#endif /* !NO_INLINE_STDARG */ + +#define MUI_AslRequest(req, tags) \ + LP2(0x36, BOOL, MUI_AslRequest, APTR, req, a0, struct TagItem *, tags, a1, \ + , MUIMASTER_BASE_NAME) + +#ifndef NO_INLINE_STDARG +#define MUI_AslRequestTags(a0, tags...) \ + ({ULONG _tags[] = { tags }; MUI_AslRequest((a0), (struct TagItem *)_tags);}) +#endif /* !NO_INLINE_STDARG */ + +#define MUI_BeginRefresh(mri, flags) \ + LP2(0xc0, BOOL, MUI_BeginRefresh, struct MUI_RenderInfo *, mri, a0, ULONG, flags, d0, \ + , MUIMASTER_BASE_NAME) + +#define MUI_CreateCustomClass(base, supername, supermcc, datasize, dispatcher) \ + LP5(0x6c, struct MUI_CustomClass *, MUI_CreateCustomClass, struct Library *, base, a0, CONST_STRPTR , supername, a1, struct MUI_CustomClass *, supermcc, a2, int, datasize, d0, APTR, dispatcher, a3, \ + , MUIMASTER_BASE_NAME) + +#define MUI_DeleteCustomClass(mcc) \ + LP1(0x72, BOOL, MUI_DeleteCustomClass, struct MUI_CustomClass *, mcc, a0, \ + , MUIMASTER_BASE_NAME) + +#define MUI_DisposeObject(obj) \ + LP1NR(0x24, MUI_DisposeObject, Object *, obj, a0, \ + , MUIMASTER_BASE_NAME) + +#define MUI_EndRefresh(mri, flags) \ + LP2NR(0xc6, MUI_EndRefresh, struct MUI_RenderInfo *, mri, a0, ULONG, flags, d0, \ + , MUIMASTER_BASE_NAME) + +#define MUI_Error() \ + LP0(0x42, LONG, MUI_Error, \ + , MUIMASTER_BASE_NAME) + +#define MUI_FreeAslRequest(req) \ + LP1NR(0x3c, MUI_FreeAslRequest, APTR, req, a0, \ + , MUIMASTER_BASE_NAME) + +#define MUI_FreeClass(cl) \ + LP1NR(0x54, MUI_FreeClass, struct IClass *, cl, a0, \ + , MUIMASTER_BASE_NAME) + +#define MUI_GetClass(name) \ + LP1(0x4e, struct IClass *, MUI_GetClass, CONST_STRPTR , name, a0, \ + , MUIMASTER_BASE_NAME) + +#define MUI_Layout(obj, l, t, w, h, flags) \ + LP6(0x7e, BOOL, MUI_Layout, Object *, obj, a0, LONG, l, d0, LONG, t, d1, LONG, w, d2, LONG, h, d3, ULONG, flags, d4, \ + , MUIMASTER_BASE_NAME) + +#define MUI_MakeObjectA(type, params) \ + LP2(0x78, Object *, MUI_MakeObjectA, LONG, type, d0, ULONG *, params, a0, \ + , MUIMASTER_BASE_NAME) + +#ifndef NO_INLINE_STDARG +#define MUI_MakeObject(a0, tags...) \ + ({ULONG _tags[] = { tags }; MUI_MakeObjectA((a0), (ULONG *)_tags);}) +#endif /* !NO_INLINE_STDARG */ + +#define MUI_NewObjectA(class, tags) \ + LP2(0x1e, Object *, MUI_NewObjectA, CONST_STRPTR , class, a0, struct TagItem *, tags, a1, \ + , MUIMASTER_BASE_NAME) + +#ifndef NO_INLINE_STDARG +#define MUI_NewObject(a0, tags...) \ + ({ULONG _tags[] = { tags }; MUI_NewObjectA((a0), (struct TagItem *)_tags);}) +#endif /* !NO_INLINE_STDARG */ + +#define MUI_ObtainPen(mri, spec, flags) \ + LP3(0x9c, LONG, MUI_ObtainPen, struct MUI_RenderInfo *, mri, a0, struct MUI_PenSpec *, spec, a1, ULONG, flags, d0, \ + , MUIMASTER_BASE_NAME) + +#define MUI_Redraw(obj, flags) \ + LP2NR(0x66, MUI_Redraw, Object *, obj, a0, ULONG, flags, d0, \ + , MUIMASTER_BASE_NAME) + +#define MUI_RejectIDCMP(obj, flags) \ + LP2NR(0x60, MUI_RejectIDCMP, Object *, obj, a0, ULONG, flags, d0, \ + , MUIMASTER_BASE_NAME) + +#define MUI_ReleasePen(mri, pen) \ + LP2NR(0xa2, MUI_ReleasePen, struct MUI_RenderInfo *, mri, a0, LONG, pen, d0, \ + , MUIMASTER_BASE_NAME) + +#define MUI_RemoveClipRegion(mri, region) \ + LP2NR(0xba, MUI_RemoveClipRegion, struct MUI_RenderInfo *, mri, a0, APTR, region, a1, \ + , MUIMASTER_BASE_NAME) + +#define MUI_RemoveClipping(mri, h) \ + LP2NR(0xae, MUI_RemoveClipping, struct MUI_RenderInfo *, mri, a0, APTR, h, a1, \ + , MUIMASTER_BASE_NAME) + +#define MUI_RequestA(app, win, flags, title, gadgets, format, params) \ + LP7(0x2a, LONG, MUI_RequestA, APTR, app, d0, APTR, win, d1, LONGBITS, flags, d2, CONST_STRPTR , title, a0, CONST_STRPTR , gadgets, a1, CONST_STRPTR , format, a2, APTR, params, a3, \ + , MUIMASTER_BASE_NAME) + +#ifndef NO_INLINE_STDARG +#define MUI_Request(a0, a1, a2, a3, a4, a5, tags...) \ + ({ULONG _tags[] = { tags }; MUI_RequestA((a0), (a1), (a2), (a3), (a4), (a5), (APTR)_tags);}) +#endif /* !NO_INLINE_STDARG */ + +#define MUI_RequestIDCMP(obj, flags) \ + LP2NR(0x5a, MUI_RequestIDCMP, Object *, obj, a0, ULONG, flags, d0, \ + , MUIMASTER_BASE_NAME) + +#define MUI_SetError(errnum) \ + LP1(0x48, LONG, MUI_SetError, LONG, errnum, d0, \ + , MUIMASTER_BASE_NAME) + +#endif /* !_INLINE_MUIMASTER_H */ diff --git a/workbench/classes/zune/nlist/include/inline/muimaster_protos.h b/workbench/classes/zune/nlist/include/inline/muimaster_protos.h new file mode 100644 index 0000000000..0dd03d8406 --- /dev/null +++ b/workbench/classes/zune/nlist/include/inline/muimaster_protos.h @@ -0,0 +1,79 @@ +#ifndef _VBCCINLINE_MUIMASTER_H +#define _VBCCINLINE_MUIMASTER_H + +Object * __MUI_NewObjectA(__reg("a0") const char * a0arg, __reg("a1") struct TagItem * tags, __reg("a6") void *)="\tjsr\t-30(a6)"; +#define MUI_NewObjectA(a0arg, tags) __MUI_NewObjectA((a0arg), (tags), MUIMasterBase) + +VOID __MUI_DisposeObject(__reg("a0") Object * obj, __reg("a6") void *)="\tjsr\t-36(a6)"; +#define MUI_DisposeObject(obj) __MUI_DisposeObject((obj), MUIMasterBase) + +LONG __MUI_RequestA(__reg("d0") APTR app, __reg("d1") APTR win, __reg("d2") LONGBITS flags, __reg("a0") const char * title, __reg("a1") const char * gadgets, __reg("a2") const char * format, __reg("a3") APTR params, __reg("a6") void *)="\tjsr\t-42(a6)"; +#define MUI_RequestA(app, win, flags, title, gadgets, format, params) __MUI_RequestA((app), (win), (flags), (title), (gadgets), (format), (params), MUIMasterBase) + +APTR __MUI_AllocAslRequest(__reg("d0") unsigned long type, __reg("a0") struct TagItem * tags, __reg("a6") void *)="\tjsr\t-48(a6)"; +#define MUI_AllocAslRequest(type, tags) __MUI_AllocAslRequest((type), (tags), MUIMasterBase) + +BOOL __MUI_AslRequest(__reg("a0") APTR req, __reg("a1") struct TagItem * tags, __reg("a6") void *)="\tjsr\t-54(a6)"; +#define MUI_AslRequest(req, tags) __MUI_AslRequest((req), (tags), MUIMasterBase) + +VOID __MUI_FreeAslRequest(__reg("a0") APTR req, __reg("a6") void *)="\tjsr\t-60(a6)"; +#define MUI_FreeAslRequest(req) __MUI_FreeAslRequest((req), MUIMasterBase) + +LONG __MUI_Error(__reg("a6") void *)="\tjsr\t-66(a6)"; +#define MUI_Error() __MUI_Error(MUIMasterBase) + +LONG __MUI_SetError(__reg("d0") LONG errnum, __reg("a6") void *)="\tjsr\t-72(a6)"; +#define MUI_SetError(errnum) __MUI_SetError((errnum), MUIMasterBase) + +struct IClass * __MUI_GetClass(__reg("a0") const char * name, __reg("a6") void *)="\tjsr\t-78(a6)"; +#define MUI_GetClass(name) __MUI_GetClass((name), MUIMasterBase) + +VOID __MUI_FreeClass(__reg("a0") struct IClass * cl, __reg("a6") void *)="\tjsr\t-84(a6)"; +#define MUI_FreeClass(cl) __MUI_FreeClass((cl), MUIMasterBase) + +VOID __MUI_RequestIDCMP(__reg("a0") Object * obj, __reg("d0") ULONG flags, __reg("a6") void *)="\tjsr\t-90(a6)"; +#define MUI_RequestIDCMP(obj, flags) __MUI_RequestIDCMP((obj), (flags), MUIMasterBase) + +VOID __MUI_RejectIDCMP(__reg("a0") Object * obj, __reg("d0") ULONG flags, __reg("a6") void *)="\tjsr\t-96(a6)"; +#define MUI_RejectIDCMP(obj, flags) __MUI_RejectIDCMP((obj), (flags), MUIMasterBase) + +VOID __MUI_Redraw(__reg("a0") Object * obj, __reg("d0") ULONG flags, __reg("a6") void *)="\tjsr\t-102(a6)"; +#define MUI_Redraw(obj, flags) __MUI_Redraw((obj), (flags), MUIMasterBase) + +struct MUI_CustomClass * __MUI_CreateCustomClass(__reg("a0") struct Library * base, __reg("a1") const char * supername, __reg("a2") struct MUI_CustomClass * supermcc, __reg("d0") int datasize, __reg("a3") APTR dispatcher, __reg("a6") void *)="\tjsr\t-108(a6)"; +#define MUI_CreateCustomClass(base, supername, supermcc, datasize, dispatcher) __MUI_CreateCustomClass((base), (supername), (supermcc), (datasize), (dispatcher), MUIMasterBase) + +BOOL __MUI_DeleteCustomClass(__reg("a0") struct MUI_CustomClass * mcc, __reg("a6") void *)="\tjsr\t-114(a6)"; +#define MUI_DeleteCustomClass(mcc) __MUI_DeleteCustomClass((mcc), MUIMasterBase) + +Object * __MUI_MakeObjectA(__reg("d0") LONG type, __reg("a0") ULONG * params, __reg("a6") void *)="\tjsr\t-120(a6)"; +#define MUI_MakeObjectA(type, params) __MUI_MakeObjectA((type), (params), MUIMasterBase) + +BOOL __MUI_Layout(__reg("a0") Object * obj, __reg("d0") LONG l, __reg("d1") LONG t, __reg("d2") LONG w, __reg("d3") LONG h, __reg("d4") ULONG flags, __reg("a6") void *)="\tjsr\t-126(a6)"; +#define MUI_Layout(obj, l, t, w, h, flags) __MUI_Layout((obj), (l), (t), (w), (h), (flags), MUIMasterBase) + +LONG __MUI_ObtainPen(__reg("a0") struct MUI_RenderInfo * mri, __reg("a1") struct MUI_PenSpec * spec, __reg("d0") ULONG flags, __reg("a6") void *)="\tjsr\t-156(a6)"; +#define MUI_ObtainPen(mri, spec, flags) __MUI_ObtainPen((mri), (spec), (flags), MUIMasterBase) + +VOID __MUI_ReleasePen(__reg("a0") struct MUI_RenderInfo * mri, __reg("d0") LONG pen, __reg("a6") void *)="\tjsr\t-162(a6)"; +#define MUI_ReleasePen(mri, pen) __MUI_ReleasePen((mri), (pen), MUIMasterBase) + +APTR __MUI_AddClipping(__reg("a0") struct MUI_RenderInfo * mri, __reg("d0") WORD l, __reg("d1") WORD t, __reg("d2") WORD w, __reg("d3") WORD h, __reg("a6") void *)="\tjsr\t-168(a6)"; +#define MUI_AddClipping(mri, l, t, w, h) __MUI_AddClipping((mri), (l), (t), (w), (h), MUIMasterBase) + +VOID __MUI_RemoveClipping(__reg("a0") struct MUI_RenderInfo * mri, __reg("a1") APTR h, __reg("a6") void *)="\tjsr\t-174(a6)"; +#define MUI_RemoveClipping(mri, h) __MUI_RemoveClipping((mri), (h), MUIMasterBase) + +APTR __MUI_AddClipRegion(__reg("a0") struct MUI_RenderInfo * mri, __reg("a1") struct Region * region, __reg("a6") void *)="\tjsr\t-180(a6)"; +#define MUI_AddClipRegion(mri, region) __MUI_AddClipRegion((mri), (region), MUIMasterBase) + +VOID __MUI_RemoveClipRegion(__reg("a0") struct MUI_RenderInfo * mri, __reg("a1") APTR region, __reg("a6") void *)="\tjsr\t-186(a6)"; +#define MUI_RemoveClipRegion(mri, region) __MUI_RemoveClipRegion((mri), (region), MUIMasterBase) + +BOOL __MUI_BeginRefresh(__reg("a0") struct MUI_RenderInfo * mri, __reg("d0") ULONG flags, __reg("a6") void *)="\tjsr\t-192(a6)"; +#define MUI_BeginRefresh(mri, flags) __MUI_BeginRefresh((mri), (flags), MUIMasterBase) + +VOID __MUI_EndRefresh(__reg("a0") struct MUI_RenderInfo * mri, __reg("d0") ULONG flags, __reg("a6") void *)="\tjsr\t-198(a6)"; +#define MUI_EndRefresh(mri, flags) __MUI_EndRefresh((mri), (flags), MUIMasterBase) + +#endif /* _VBCCINLINE_MUIMASTER_H */ diff --git a/workbench/classes/zune/nlist/include/inline4/mccclass.h b/workbench/classes/zune/nlist/include/inline4/mccclass.h new file mode 100644 index 0000000000..d0720e44e0 --- /dev/null +++ b/workbench/classes/zune/nlist/include/inline4/mccclass.h @@ -0,0 +1,27 @@ +#ifndef INLINE4_MCCCLASS_H +#define INLINE4_MCCCLASS_H + +/* +** This file was auto generated by idltool 50.10. +** +** It provides compatibility to OS3 style library +** calls by substituting functions. +** +** Do not edit manually. +*/ + +#ifndef EXEC_TYPES_H +#include +#endif +#ifndef EXEC_EXEC_H +#include +#endif +#ifndef EXEC_INTERFACES_H +#include +#endif + + +/* Inline macros for Interface "main" */ +#define MCC_Query(which) IMCCClass->MCC_Query(which) + +#endif /* INLINE4_MCCCLASS_H */ diff --git a/workbench/classes/zune/nlist/include/inline4/muimaster.h b/workbench/classes/zune/nlist/include/inline4/muimaster.h new file mode 100644 index 0000000000..af0b034b00 --- /dev/null +++ b/workbench/classes/zune/nlist/include/inline4/muimaster.h @@ -0,0 +1,82 @@ +#ifndef INLINE4_MUIMASTER_H +#define INLINE4_MUIMASTER_H + +/* +** This file was auto generated by idltool 52.1. +** +** It provides compatibility to OS3 style library +** calls by substituting functions. +** +** Do not edit manually. +*/ + +#ifndef EXEC_TYPES_H +#include +#endif +#ifndef EXEC_EXEC_H +#include +#endif +#ifndef EXEC_INTERFACES_H +#include +#endif + +#ifndef INTUITION_CLASSES_H +#include +#endif +#ifndef UTILITY_TAGITEM_H +#include +#endif +#ifndef LIBRARIES_MUI_H +#include +#endif +#include + +/* Inline macros for Interface "main" */ +#define MUI_NewObjectA(par1, last) IMUIMaster->MUI_NewObjectA((par1), (last)) +#define MUI_NewObject IMUIMaster->MUI_NewObject +#define MUI_DisposeObject(last) IMUIMaster->MUI_DisposeObject((last)) +#define MUI_RequestA(par1, par2, par3, par4, par5, par6, last) IMUIMaster->MUI_RequestA((par1), (par2), (par3), (par4), (par5), (par6), (last)) +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (__GNUC__ >= 3) +#define MUI_Request(par1, par2, par3, par4, par5, ...) IMUIMaster->MUI_Request((par1), (par2), (par3), (par4), (par5), __VA_ARGS__) +#elif (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +#define MUI_Request(par1, par2, par3, par4, par5, vargs...) IMUIMaster->MUI_Request(par1, par2, par3, par4, par5, ## vargs) +#endif +#define MUI_AllocAslRequest(par1, last) IMUIMaster->MUI_AllocAslRequest((par1), (last)) +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (__GNUC__ >= 3) +#define MUI_AllocAslRequestTags(...) IMUIMaster->MUI_AllocAslRequestTags(__VA_ARGS__) +#elif (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +#define MUI_AllocAslRequestTags(vargs...) IMUIMaster->MUI_AllocAslRequestTags(## vargs) +#endif +#define MUI_AslRequest(par1, last) IMUIMaster->MUI_AslRequest((par1), (last)) +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (__GNUC__ >= 3) +#define MUI_AslRequestTags(...) IMUIMaster->MUI_AslRequestTags(__VA_ARGS__) +#elif (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +#define MUI_AslRequestTags(vargs...) IMUIMaster->MUI_AslRequestTags(## vargs) +#endif +#define MUI_FreeAslRequest(last) IMUIMaster->MUI_FreeAslRequest((last)) +#define MUI_Error() IMUIMaster->MUI_Error() +#define MUI_SetError(last) IMUIMaster->MUI_SetError((last)) +#define MUI_GetClass(last) IMUIMaster->MUI_GetClass((last)) +#define MUI_FreeClass(last) IMUIMaster->MUI_FreeClass((last)) +#define MUI_RequestIDCMP(par1, last) IMUIMaster->MUI_RequestIDCMP((par1), (last)) +#define MUI_RejectIDCMP(par1, last) IMUIMaster->MUI_RejectIDCMP((par1), (last)) +#define MUI_Redraw(par1, last) IMUIMaster->MUI_Redraw((par1), (last)) +#define MUI_CreateCustomClass(par1, par2, par3, par4, last) IMUIMaster->MUI_CreateCustomClass((par1), (par2), (par3), (par4), (last)) +#define MUI_DeleteCustomClass(last) IMUIMaster->MUI_DeleteCustomClass((last)) +#define MUI_MakeObjectA(par1, last) IMUIMaster->MUI_MakeObjectA((par1), (last)) +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (__GNUC__ >= 3) +#define MUI_MakeObject(...) IMUIMaster->MUI_MakeObject(__VA_ARGS__) +#elif (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +#define MUI_MakeObject(vargs...) IMUIMaster->MUI_MakeObject(## vargs) +#endif +#define MUI_Layout(par1, par2, par3, par4, par5, last) IMUIMaster->MUI_Layout((par1), (par2), (par3), (par4), (par5), (last)) +#define MUI_ObtainPen(par1, par2, last) IMUIMaster->MUI_ObtainPen((par1), (par2), (last)) +#define MUI_ReleasePen(par1, last) IMUIMaster->MUI_ReleasePen((par1), (last)) +#define MUI_AddClipping(par1, par2, par3, par4, last) IMUIMaster->MUI_AddClipping((par1), (par2), (par3), (par4), (last)) +#define MUI_RemoveClipping(par1, last) IMUIMaster->MUI_RemoveClipping((par1), (last)) +#define MUI_AddClipRegion(par1, last) IMUIMaster->MUI_AddClipRegion((par1), (last)) +#define MUI_RemoveClipRegion(par1, last) IMUIMaster->MUI_RemoveClipRegion((par1), (last)) +#define MUI_BeginRefresh(par1, last) IMUIMaster->MUI_BeginRefresh((par1), (last)) +#define MUI_EndRefresh(par1, last) IMUIMaster->MUI_EndRefresh((par1), (last)) + +#endif /* INLINE4_MUIMASTER_H */ diff --git a/workbench/classes/zune/nlist/include/interfaces/mccclass.h b/workbench/classes/zune/nlist/include/interfaces/mccclass.h new file mode 100644 index 0000000000..829f7e898f --- /dev/null +++ b/workbench/classes/zune/nlist/include/interfaces/mccclass.h @@ -0,0 +1,31 @@ +#ifndef MCCCLASS_INTERFACE_DEF_H +#define MCCCLASS_INTERFACE_DEF_H + +/* +** This file was machine generated by idltool 50.10. +** Do not edit +*/ + +#ifndef EXEC_TYPES_H +#include +#endif +#ifndef EXEC_EXEC_H +#include +#endif +#ifndef EXEC_INTERFACES_H +#include +#endif + + +struct MCCClassIFace +{ + struct InterfaceData Data; + + ULONG APICALL (*Obtain)(struct MCCClassIFace *Self); + ULONG APICALL (*Release)(struct MCCClassIFace *Self); + void APICALL (*Expunge)(struct MCCClassIFace *Self); + struct Interface * APICALL (*Clone)(struct MCCClassIFace *Self); + ULONG APICALL (*MCC_Query)(struct MCCClassIFace *Self, LONG which); +}; + +#endif /* MCCCLASS_INTERFACE_DEF_H */ diff --git a/workbench/classes/zune/nlist/include/interfaces/mccclass.i b/workbench/classes/zune/nlist/include/interfaces/mccclass.i new file mode 100644 index 0000000000..863f365cc8 --- /dev/null +++ b/workbench/classes/zune/nlist/include/interfaces/mccclass.i @@ -0,0 +1,20 @@ +#ifndef MCCCLASS_INTERFACE_DEF_H +#define MCCCLASS_INTERFACE_DEF_H +/* +** This file is machine generated from idltool +** Do not edit +*/ + +#include +#include +#include + +STRUCTURE MCCClassIFace, InterfaceData_SIZE + FPTR IMCCClass_Obtain + FPTR IMCCClass_Release + FPTR IMCCClass_Expunge + FPTR IMCCClass_Clone + FPTR IMCCClass_MCC_Query + LABEL MCCClassIFace_SIZE + +#endif diff --git a/workbench/classes/zune/nlist/include/interfaces/muimaster.h b/workbench/classes/zune/nlist/include/interfaces/muimaster.h new file mode 100644 index 0000000000..f803a488ab --- /dev/null +++ b/workbench/classes/zune/nlist/include/interfaces/muimaster.h @@ -0,0 +1,73 @@ +#ifndef MUIMASTER_INTERFACE_DEF_H +#define MUIMASTER_INTERFACE_DEF_H + +/* +** This file was machine generated by idltool 52.1. +** Do not edit +*/ + +#ifndef EXEC_TYPES_H +#include +#endif +#ifndef EXEC_EXEC_H +#include +#endif +#ifndef EXEC_INTERFACES_H +#include +#endif + +#ifndef INTUITION_CLASSES_H +#include +#endif +#ifndef UTILITY_TAGITEM_H +#include +#endif +#ifndef LIBRARIES_MUI_H +#include +#endif + +struct MUIMasterIFace +{ + struct InterfaceData Data; + + ULONG APICALL (*Obtain)(struct MUIMasterIFace *Self); + ULONG APICALL (*Release)(struct MUIMasterIFace *Self); + void APICALL (*Expunge)(struct MUIMasterIFace *Self); + struct Interface * APICALL (*Clone)(struct MUIMasterIFace *Self); + Object * APICALL (*MUI_NewObjectA)(struct MUIMasterIFace *Self, CONST_STRPTR par1, struct TagItem * last); + Object * APICALL (*MUI_NewObject)(struct MUIMasterIFace *Self, CONST_STRPTR par1, ...); + VOID APICALL (*MUI_DisposeObject)(struct MUIMasterIFace *Self, Object * last); + LONG APICALL (*MUI_RequestA)(struct MUIMasterIFace *Self, APTR par1, APTR par2, LONGBITS par3, CONST_STRPTR par4, CONST_STRPTR par5, CONST_STRPTR par6, APTR last); + LONG APICALL (*MUI_Request)(struct MUIMasterIFace *Self, APTR par1, APTR par2, LONGBITS par3, CONST_STRPTR par4, CONST_STRPTR par5, CONST_STRPTR par6, ...); + APTR APICALL (*MUI_AllocAslRequest)(struct MUIMasterIFace *Self, unsigned long par1, struct TagItem * last); + APTR APICALL (*MUI_AllocAslRequestTags)(struct MUIMasterIFace *Self, unsigned long par1, ...); + BOOL APICALL (*MUI_AslRequest)(struct MUIMasterIFace *Self, APTR par1, struct TagItem * last); + BOOL APICALL (*MUI_AslRequestTags)(struct MUIMasterIFace *Self, APTR par1, ...); + VOID APICALL (*MUI_FreeAslRequest)(struct MUIMasterIFace *Self, APTR last); + LONG APICALL (*MUI_Error)(struct MUIMasterIFace *Self); + LONG APICALL (*MUI_SetError)(struct MUIMasterIFace *Self, LONG last); + struct IClass * APICALL (*MUI_GetClass)(struct MUIMasterIFace *Self, CONST_STRPTR last); + VOID APICALL (*MUI_FreeClass)(struct MUIMasterIFace *Self, struct IClass * last); + VOID APICALL (*MUI_RequestIDCMP)(struct MUIMasterIFace *Self, Object * par1, ULONG last); + VOID APICALL (*MUI_RejectIDCMP)(struct MUIMasterIFace *Self, Object * par1, ULONG last); + VOID APICALL (*MUI_Redraw)(struct MUIMasterIFace *Self, Object * par1, ULONG last); + struct MUI_CustomClass * APICALL (*MUI_CreateCustomClass)(struct MUIMasterIFace *Self, struct Library * par1, CONST_STRPTR par2, struct MUI_CustomClass * par3, int par4, APTR last); + BOOL APICALL (*MUI_DeleteCustomClass)(struct MUIMasterIFace *Self, struct MUI_CustomClass * last); + Object * APICALL (*MUI_MakeObjectA)(struct MUIMasterIFace *Self, LONG par1, ULONG * last); + Object * APICALL (*MUI_MakeObject)(struct MUIMasterIFace *Self, LONG par1, ...); + BOOL APICALL (*MUI_Layout)(struct MUIMasterIFace *Self, Object * par1, LONG par2, LONG par3, LONG par4, LONG par5, ULONG last); + void APICALL (*Reserved1)(struct MUIMasterIFace *Self); + void APICALL (*Reserved2)(struct MUIMasterIFace *Self); + void APICALL (*Reserved3)(struct MUIMasterIFace *Self); + void APICALL (*Reserved4)(struct MUIMasterIFace *Self); + LONG APICALL (*MUI_ObtainPen)(struct MUIMasterIFace *Self, struct MUI_RenderInfo * par1, struct MUI_PenSpec * par2, ULONG last); + VOID APICALL (*MUI_ReleasePen)(struct MUIMasterIFace *Self, struct MUI_RenderInfo * par1, LONG last); + APTR APICALL (*MUI_AddClipping)(struct MUIMasterIFace *Self, struct MUI_RenderInfo * par1, WORD par2, WORD par3, WORD par4, WORD last); + VOID APICALL (*MUI_RemoveClipping)(struct MUIMasterIFace *Self, struct MUI_RenderInfo * par1, APTR last); + APTR APICALL (*MUI_AddClipRegion)(struct MUIMasterIFace *Self, struct MUI_RenderInfo * par1, struct Region * last); + VOID APICALL (*MUI_RemoveClipRegion)(struct MUIMasterIFace *Self, struct MUI_RenderInfo * par1, APTR last); + BOOL APICALL (*MUI_BeginRefresh)(struct MUIMasterIFace *Self, struct MUI_RenderInfo * par1, ULONG last); + VOID APICALL (*MUI_EndRefresh)(struct MUIMasterIFace *Self, struct MUI_RenderInfo * par1, ULONG last); +}; + +#endif /* MUIMASTER_INTERFACE_DEF_H */ diff --git a/workbench/classes/zune/nlist/include/libraries/mui.h b/workbench/classes/zune/nlist/include/libraries/mui.h new file mode 100644 index 0000000000..484d72980e --- /dev/null +++ b/workbench/classes/zune/nlist/include/libraries/mui.h @@ -0,0 +1,3561 @@ +#ifdef __AROS__ +#include "libraries/muiaros.h" +#else + +/*************************************************************************** +** +** MUI - MagicUserInterface +** (c) 1993-2006 Stefan Stuntz +** +** Main Header File +** +**************************************************************************** +** Class Tree +**************************************************************************** +** +** rootclass (BOOPSI's base class) +** +--Notify (implements notification mechanism) +** ! +--Family (handles multiple children) +** ! ! +--Menustrip (describes a complete menu strip) +** ! ! +--Menu (describes a single menu) +** ! ! \--Menuitem (describes a single menu item) +** ! +--Application (main class for all applications) +** ! +--Window (main class for all windows) +** ! ! \--Aboutmui (About window of MUI preferences) +** ! +--Area (base class for all GUI elements) +** ! +--Rectangle (spacing object) +** ! +--Balance (balancing separator bar) +** ! +--Image (image display) +** ! +--Bitmap (draws bitmaps) +** ! ! \--Bodychunk (makes bitmap from ILBM body chunk) +** ! +--Rawimage (draws raw image data) +** ! +--Text (text display) +** ! +--Gadget (base class for intuition gadgets) +** ! ! +--String (string gadget) +** ! ! +--Boopsi (interface to BOOPSI gadgets) +** ! ! \--Prop (proportional gadget) +** ! +--Gauge (fule gauge) +** ! +--Scale (percentage scale) +** ! +--Colorfield (field with changeable color) +** ! +--List (line-oriented list) +** ! ! +--Floattext (special list with floating text) +** ! ! +--Volumelist (special list with volumes) +** ! ! +--Scrmodelist (special list with screen modes) +** ! ! \--Dirlist (special list with files) +** ! +--Numeric (base class for slider gadgets) +** ! ! +--Knob (turning knob) +** ! ! +--Levelmeter (level display) +** ! ! +--Numericbutton (space saving popup slider) +** ! ! \--Slider (traditional slider) +** ! +--Framedisplay (private) +** ! ! \--Popframe (private) +** ! +--Imagedisplay (private) +** ! ! \--Popimage (private) +** ! +--Pendisplay (displays a pen specification) +** ! ! \--Poppen (popup button to adjust a pen spec) +** ! +--Group (groups other GUI elements) +** ! +--Mccprefs (private) +** ! +--Register (handles page groups with titles) +** ! ! \--Penadjust (group to adjust a pen) +** ! +--Settingsgroup (private) +** ! +--Settings (private) +** ! +--Frameadjust (private) +** ! +--Imageadjust (private) +** ! +--Virtgroup (handles virtual groups) +** ! +--Scrollgroup (virtual groups with scrollbars) +** ! +--Scrollbar (traditional scrollbar) +** ! +--Listview (listview) +** ! +--Radio (radio button) +** ! +--Cycle (cycle gadget) +** ! +--Coloradjust (several gadgets to adjust a color) +** ! +--Palette (complete palette gadget) +** ! +--Popstring (base class for popup objects) +** ! +--Popobject (popup aynthing in a separate window) +** ! ! +--Poplist (popup a simple listview) +** ! ! \--Popscreen (popup a list of public screens) +** ! \--Popasl (popup an asl requester) +** +--Semaphore (semaphore equipped objects) +** +--Applist (private) +** +--Dataspace (handles general purpose data spaces) +** \--Configdata (private) +** +**************************************************************************** +** General Header File Information +**************************************************************************** +** +** All macro and structure definitions follow these rules: +** +** Name Meaning +** +** MUIC_ Name of a class +** MUIM__ Method +** MUIP__ Methods parameter structure +** MUIV___ Special method value +** MUIA__ Attribute +** MUIV___ Special attribute value +** MUIE_ Error return code from MUI_Error() +** MUII_ Standard MUI image +** MUIX_ Control codes for text strings +** MUIO_ Object type for MUI_MakeObject() +** +** MUIA_... attribute definitions are followed by a comment +** consisting of the three possible letters I, S and G. +** I: it's possible to specify this attribute at object creation time. +** S: it's possible to change this attribute with SetAttrs(). +** G: it's possible to get this attribute with GetAttr(). +** +** Items marked with "Custom Class" are for use in custom classes only! +*/ + + +#ifndef LIBRARIES_MUI_H +#define LIBRARIES_MUI_H + +#ifndef EXEC_TYPES_H +#include +#endif + +#ifndef DOS_DOS_H +#include +#endif + +#ifndef INTUITION_CLASSES_H +#include +#endif + +#ifndef INTUITION_SCREENS_H +#include +#endif + +#ifndef PROTO_INTUITION_H +#include +#endif + +#if defined(__PPC__) + #if defined(__GNUC__) + #pragma pack(2) + #elif defined(__VBCC__) + #pragma amiga-align + #endif +#endif + + + + +/*************************************************************************** +** Library specification +***************************************************************************/ + +#define MUIMASTER_NAME "muimaster.library" +#define MUIMASTER_VMIN 20 +#define MUIMASTER_VLATEST 20 + +/* +** !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +** Warning, some of the macros in this header file work only with +** up2date versions of muimaster.library. If you recompile your programs, +** be sure to open muimaster.library with MUIMASTER_VMIN as version number. +** !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +*/ + + +#define MUI_OBSOLETE + + +/************************************************************************* +** Config items for MUIM_GetConfigItem +*************************************************************************/ + +#define MUICFG_PublicScreen 36 + + + +/************************************************************************* +** Black box specification structures for images, pens, frames +*************************************************************************/ + +struct MUI_PenSpec +{ + char buf[32]; +}; + + + +/************************************************************************* +** Public Screen Stuff +*************************************************************************/ + +/* +** NOTE: This stuff is only included to allow compilation of the supplied +** public screen manager for educational purposes. Everything +** here is subject to change without notice and I guarantee to +** do that just for fun! +** More info can be found in the screen manager source file. +*/ + +#define PSD_INITIAL_NAME "(unnamed)" +#define PSD_INITIAL_TITLE "MUI Public Screen" +#define PSD_ID_MPUB MAKE_ID('M','P','U','B') + +#define PSD_NAME_FRONTMOST "«Frontmost»" + +#define PSD_FILENAME_SAVE "envarc:mui/PublicScreens.iff" +#define PSD_FILENAME_USE "env:mui/PublicScreens.iff" + +#define PSD_MAXLEN_NAME 32 +#define PSD_MAXLEN_TITLE 128 +#define PSD_MAXLEN_FONT 48 +#define PSD_MAXLEN_BACKGROUND 256 +#define PSD_NUMCOLS 8 +#define PSD_MAXSYSPENS 20 +#define PSD_NUMSYSPENS 12 +#define PSD_MAXMUIPENS 10 +#define PSD_NUMMUIPENS MPEN_COUNT + +struct MUI_RGBcolor +{ + ULONG red; + ULONG green; + ULONG blue; +}; + +struct MUI_PubScreenDesc +{ + LONG Version; + + char Name[PSD_MAXLEN_NAME]; + char Title[PSD_MAXLEN_TITLE]; + char Font[PSD_MAXLEN_FONT]; + char Background[PSD_MAXLEN_BACKGROUND]; + + ULONG DisplayID; + + UWORD DisplayWidth; + UWORD DisplayHeight; + + UBYTE DisplayDepth; + UBYTE OverscanType; + UBYTE AutoScroll; + UBYTE NoDrag; + UBYTE Exclusive; + UBYTE Interleaved; + UBYTE SysDefault; + UBYTE Behind; + UBYTE AutoClose; + UBYTE CloseGadget; + UBYTE DummyWasForeign; + + BYTE SystemPens[PSD_MAXSYSPENS]; + UBYTE psd_Reserved[1+7*4-PSD_MAXSYSPENS]; + + struct MUI_RGBcolor Palette[PSD_NUMCOLS]; + struct MUI_RGBcolor rsvd[PSD_MAXSYSPENS-PSD_NUMCOLS]; + + struct MUI_PenSpec rsvd2[PSD_MAXMUIPENS]; + + LONG Changed; + APTR UserData; +}; + +struct MUIS_InfoClient +{ + struct MinNode node; + struct Task *task; + ULONG sigbit; +}; + + +/*************************************************************************** +** Object Types for MUI_MakeObject() +***************************************************************************/ + +#define MUIO_Label 1 /* STRPTR label, ULONG flags */ +#define MUIO_Button 2 /* STRPTR label */ +#define MUIO_Checkmark 3 /* STRPTR label */ +#define MUIO_Cycle 4 /* STRPTR label, STRPTR *entries */ +#define MUIO_Radio 5 /* STRPTR label, STRPTR *entries */ +#define MUIO_Slider 6 /* STRPTR label, LONG min, LONG max */ +#define MUIO_String 7 /* STRPTR label, LONG maxlen */ +#define MUIO_PopButton 8 /* STRPTR imagespec */ +#define MUIO_HSpace 9 /* LONG space */ +#define MUIO_VSpace 10 /* LONG space */ +#define MUIO_HBar 11 /* LONG space */ +#define MUIO_VBar 12 /* LONG space */ +#define MUIO_MenustripNM 13 /* struct NewMenu *nm, ULONG flags */ +#define MUIO_Menuitem 14 /* STRPTR label, STRPTR shortcut, ULONG flags, ULONG data */ +#define MUIO_BarTitle 15 /* STRPTR label */ +#define MUIO_NumericButton 16 /* STRPTR label, LONG min, LONG max, STRPTR format */ + +#define MUIO_Menuitem_CopyStrings (1<<30) + +#define MUIO_Label_SingleFrame (1<< 8) +#define MUIO_Label_DoubleFrame (1<< 9) +#define MUIO_Label_LeftAligned (1<<10) +#define MUIO_Label_Centered (1<<11) +#define MUIO_Label_FreeVert (1<<12) +#define MUIO_Label_Tiny (1<<13) +#define MUIO_Label_DontCopy (1<<14) + +#define MUIO_MenustripNM_CommandKeyCheck (1<<0) /* check for "localized" menu items such as "O\0Open" */ + + + +/*************************************************************************** +** ARexx Interface +***************************************************************************/ + +struct MUI_Command +{ + char *mc_Name; + char *mc_Template; + LONG mc_Parameters; + struct Hook *mc_Hook; + LONG mc_Reserved[5]; +}; + +#define MC_TEMPLATE_ID ((STRPTR)~0) + +#define MUI_RXERR_BADDEFINITION -1 +#define MUI_RXERR_OUTOFMEMORY -2 +#define MUI_RXERR_UNKNOWNCOMMAND -3 +#define MUI_RXERR_BADSYNTAX -4 + + +/*************************************************************************** +** Return values for MUI_Error() +***************************************************************************/ + +#define MUIE_OK 0 +#define MUIE_OutOfMemory 1 +#define MUIE_OutOfGfxMemory 2 +#define MUIE_InvalidWindowObject 3 +#define MUIE_MissingLibrary 4 +#define MUIE_NoARexx 5 +#define MUIE_SingleTask 6 + + + +/*************************************************************************** +** Standard MUI Images & Backgrounds +***************************************************************************/ + +#define MUII_WindowBack 0 /* These images are configured */ +#define MUII_RequesterBack 1 /* with the preferences program. */ +#define MUII_ButtonBack 2 +#define MUII_ListBack 3 +#define MUII_TextBack 4 +#define MUII_PropBack 5 +#define MUII_PopupBack 6 +#define MUII_SelectedBack 7 +#define MUII_ListCursor 8 +#define MUII_ListSelect 9 +#define MUII_ListSelCur 10 +#define MUII_ArrowUp 11 +#define MUII_ArrowDown 12 +#define MUII_ArrowLeft 13 +#define MUII_ArrowRight 14 +#define MUII_CheckMark 15 +#define MUII_RadioButton 16 +#define MUII_Cycle 17 +#define MUII_PopUp 18 +#define MUII_PopFile 19 +#define MUII_PopDrawer 20 +#define MUII_PropKnob 21 +#define MUII_Drawer 22 +#define MUII_HardDisk 23 +#define MUII_Disk 24 +#define MUII_Chip 25 +#define MUII_Volume 26 +#define MUII_RegisterBack 27 +#define MUII_Network 28 +#define MUII_Assign 29 +#define MUII_TapePlay 30 +#define MUII_TapePlayBack 31 +#define MUII_TapePause 32 +#define MUII_TapeStop 33 +#define MUII_TapeRecord 34 +#define MUII_GroupBack 35 +#define MUII_SliderBack 36 +#define MUII_SliderKnob 37 +#define MUII_TapeUp 38 +#define MUII_TapeDown 39 +#define MUII_PageBack 40 +#define MUII_ReadListBack 41 +#define MUII_PopFont 42 +#define MUII_Count 43 + +#define MUII_BACKGROUND 128 /* These are direct color */ +#define MUII_SHADOW 129 /* combinations and are not */ +#define MUII_SHINE 130 /* affected by users prefs. */ +#define MUII_FILL 131 +#define MUII_SHADOWBACK 132 /* Generally, you should */ +#define MUII_SHADOWFILL 133 /* avoid using them. Better */ +#define MUII_SHADOWSHINE 134 /* use one of the customized */ +#define MUII_FILLBACK 135 /* images above. */ +#define MUII_FILLSHINE 136 +#define MUII_SHINEBACK 137 +#define MUII_FILLBACK2 138 +#define MUII_HSHINEBACK 139 +#define MUII_HSHADOWBACK 140 +#define MUII_HSHINESHINE 141 +#define MUII_HSHADOWSHADOW 142 +#define MUII_MARKSHINE 143 +#define MUII_MARKHALFSHINE 144 +#define MUII_MARKBACKGROUND 145 +#define MUII_BARBLOCK 146 +#define MUII_BARDETAIL 147 + +/*************************************************************************** +** Special values for some methods +***************************************************************************/ + +#define MUIV_TriggerValue 0x49893131 +#define MUIV_NotTriggerValue 0x49893133 +#define MUIV_EveryTime 0x49893131 + +#define MUIV_Notify_Self 1 +#define MUIV_Notify_Window 2 +#define MUIV_Notify_Application 3 +#define MUIV_Notify_Parent 4 + +#define MUIV_Application_Save_ENV ((STRPTR) 0) +#define MUIV_Application_Save_ENVARC ((STRPTR)~0) +#define MUIV_Application_Load_ENV ((STRPTR) 0) +#define MUIV_Application_Load_ENVARC ((STRPTR)~0) + +#define MUIV_Application_ReturnID_Quit -1 + +#define MUIV_List_Insert_Top 0 +#define MUIV_List_Insert_Active -1 +#define MUIV_List_Insert_Sorted -2 +#define MUIV_List_Insert_Bottom -3 + +#define MUIV_List_Remove_First 0 +#define MUIV_List_Remove_Active -1 +#define MUIV_List_Remove_Last -2 +#define MUIV_List_Remove_Selected -3 + +#define MUIV_List_Select_Off 0 +#define MUIV_List_Select_On 1 +#define MUIV_List_Select_Toggle 2 +#define MUIV_List_Select_Ask 3 + +#define MUIV_List_GetEntry_Active -1 +#define MUIV_List_Select_Active -1 +#define MUIV_List_Select_All -2 + +#define MUIV_List_Redraw_Active -1 +#define MUIV_List_Redraw_All -2 + +#define MUIV_List_Move_Top 0 +#define MUIV_List_Move_Active -1 +#define MUIV_List_Move_Bottom -2 +#define MUIV_List_Move_Next -3 /* only valid for second parameter */ +#define MUIV_List_Move_Previous -4 /* only valid for second parameter */ + +#define MUIV_List_Exchange_Top 0 +#define MUIV_List_Exchange_Active -1 +#define MUIV_List_Exchange_Bottom -2 +#define MUIV_List_Exchange_Next -3 /* only valid for second parameter */ +#define MUIV_List_Exchange_Previous -4 /* only valid for second parameter */ + +#define MUIV_List_Jump_Top 0 +#define MUIV_List_Jump_Active -1 +#define MUIV_List_Jump_Bottom -2 +#define MUIV_List_Jump_Up -4 +#define MUIV_List_Jump_Down -3 + +#define MUIV_List_NextSelected_Start -1 +#define MUIV_List_NextSelected_End -1 + +#define MUIV_DragQuery_Refuse 0 +#define MUIV_DragQuery_Accept 1 + +#define MUIV_DragReport_Abort 0 +#define MUIV_DragReport_Continue 1 +#define MUIV_DragReport_Lock 2 +#define MUIV_DragReport_Refresh 3 + +#define MUIV_CreateBubble_DontHidePointer (1<<0) + +#define MUIV_Application_OCW_ScreenPage (1<<1) /* show just the screen page of the config window */ + +#define MUIV_ContextMenuBuild_Default 0xffffffff + +#define MUIV_PushMethod_Delay(millis) (((ULONG)millis)<<8) + + + +/*************************************************************************** +** Control codes for text strings +***************************************************************************/ + +#define MUIX_R "\033r" /* right justified */ +#define MUIX_C "\033c" /* centered */ +#define MUIX_L "\033l" /* left justified */ + +#define MUIX_N "\033n" /* normal */ +#define MUIX_B "\033b" /* bold */ +#define MUIX_I "\033i" /* italic */ +#define MUIX_U "\033u" /* underlined */ + +#define MUIX_PT "\0332" /* text pen */ +#define MUIX_PH "\0338" /* highlight text pen */ + + + +/*************************************************************************** +** Parameter structures for some classes +***************************************************************************/ + +struct MUI_Palette_Entry +{ + LONG mpe_ID; + ULONG mpe_Red; + ULONG mpe_Green; + ULONG mpe_Blue; + LONG mpe_Group; +}; + +#define MUIV_Palette_Entry_End -1 + + +/* Popmenu class item spec and definitions */ + +struct MUIP_Popmenu_Item +{ + ULONG pi_Type; + CONST_STRPTR pi_Key; + CONST_STRPTR pi_Text; + ULONG pi_Flags; + struct MUIP_Popmenu_Item *pi_SubMenu; + APTR pi_UserData; + ULONG pi_MXField; +}; + +/* values for pi_Type */ + +#define PIT_END 0 +#define PIT_TITLE 1 +#define PIT_TEXT 2 +#define PIT_IMAGE 3 +#define PIT_SEPARATOR 4 +#define PIT_SUBTITLE 5 +#define PIT_IGNORE 6 + + +/* values for pi_Flags */ + +#define PIB_TOGGLE 0 +#define PIB_RADIO 1 +#define PIB_DISABLED 2 +#define PIB_SELECTED 3 +#define PIB_RELATIVEMX 4 +#define PIB_READONLY 5 +#define PIB_PRESSED 6 /* Kind of private... */ +#define PIB_CREATESUBMENU 7 +#define PIB_MULTICOLUMNS 8 + +#define PIF_TOGGLE (1<mnd)) +#define muiAreaData(obj) (&(((struct __dummyXFC2__ *)(obj))->mad)) + +#define muiGlobalInfo(obj) (((struct __dummyXFC2__ *)(obj))->mnd.mnd_GlobalInfo) +#define muiUserData(obj) (((struct __dummyXFC2__ *)(obj))->mnd.mnd_UserData) +#define muiRenderInfo(obj) (((struct __dummyXFC2__ *)(obj))->mad.mad_RenderInfo) + + + +/* User configurable keyboard events coming with MUIM_HandleInput */ + +enum +{ + MUIKEY_RELEASE = -2, /* not a real key, faked when MUIKEY_PRESS is released */ + MUIKEY_NONE = -1, + MUIKEY_PRESS, + MUIKEY_TOGGLE, + MUIKEY_UP, + MUIKEY_DOWN, + MUIKEY_PAGEUP, + MUIKEY_PAGEDOWN, + MUIKEY_TOP, + MUIKEY_BOTTOM, + MUIKEY_LEFT, + MUIKEY_RIGHT, + MUIKEY_WORDLEFT, + MUIKEY_WORDRIGHT, + MUIKEY_LINESTART, + MUIKEY_LINEEND, + MUIKEY_GADGET_NEXT, + MUIKEY_GADGET_PREV, + MUIKEY_GADGET_OFF, + MUIKEY_WINDOW_CLOSE, + MUIKEY_WINDOW_NEXT, + MUIKEY_WINDOW_PREV, + MUIKEY_HELP, + MUIKEY_POPUP, + MUIKEY_PRESS2, + MUIKEY_COUNT /* counter */ +}; + +#define MUIKEYF_PRESS (1<mgi_ApplicationObject) /* valid between MUIM_Setup/Cleanup */ +#define _win(obj) (muiRenderInfo(obj)->mri_WindowObject) /* valid between MUIM_Setup/Cleanup */ +#define _dri(obj) (muiRenderInfo(obj)->mri_DrawInfo) /* valid between MUIM_Setup/Cleanup */ +#define _screen(obj) (muiRenderInfo(obj)->mri_Screen) /* valid between MUIM_Setup/Cleanup */ +#define _pens(obj) (muiRenderInfo(obj)->mri_Pens) /* valid between MUIM_Setup/Cleanup */ +#define _window(obj) (muiRenderInfo(obj)->mri_Window) /* valid between MUIM_Show/Hide */ +#define _rp(obj) (muiRenderInfo(obj)->mri_RastPort) /* valid between MUIM_Show/Hide */ +#define _left(obj) (muiAreaData(obj)->mad_Box.Left) /* valid during MUIM_Draw */ +#define _top(obj) (muiAreaData(obj)->mad_Box.Top) /* valid during MUIM_Draw */ +#define _width(obj) (muiAreaData(obj)->mad_Box.Width) /* valid during MUIM_Draw */ +#define _height(obj) (muiAreaData(obj)->mad_Box.Height) /* valid during MUIM_Draw */ +#define _right(obj) (_left(obj)+_width(obj)-1) /* valid during MUIM_Draw */ +#define _bottom(obj) (_top(obj)+_height(obj)-1) /* valid during MUIM_Draw */ +#define _addleft(obj) (muiAreaData(obj)->mad_addleft ) /* valid during MUIM_Draw */ +#define _addtop(obj) (muiAreaData(obj)->mad_addtop ) /* valid during MUIM_Draw */ +#define _subwidth(obj) (muiAreaData(obj)->mad_subwidth ) /* valid during MUIM_Draw */ +#define _subheight(obj) (muiAreaData(obj)->mad_subheight) /* valid during MUIM_Draw */ +#define _mleft(obj) (_left(obj)+_addleft(obj)) /* valid during MUIM_Draw */ +#define _mtop(obj) (_top(obj)+_addtop(obj)) /* valid during MUIM_Draw */ +#define _mwidth(obj) (_width(obj)-_subwidth(obj)) /* valid during MUIM_Draw */ +#define _mheight(obj) (_height(obj)-_subheight(obj)) /* valid during MUIM_Draw */ +#define _mright(obj) (_mleft(obj)+_mwidth(obj)-1) /* valid during MUIM_Draw */ +#define _mbottom(obj) (_mtop(obj)+_mheight(obj)-1) /* valid during MUIM_Draw */ +#define _font(obj) (muiAreaData(obj)->mad_Font) /* valid between MUIM_Setup/Cleanup */ +#define _minwidth(obj) (muiAreaData(obj)->mad_MinMax.MinWidth) /* valid between MUIM_Show/Hide */ +#define _minheight(obj) (muiAreaData(obj)->mad_MinMax.MinHeight) /* valid between MUIM_Show/Hide */ +#define _maxwidth(obj) (muiAreaData(obj)->mad_MinMax.MaxWidth) /* valid between MUIM_Show/Hide */ +#define _maxheight(obj) (muiAreaData(obj)->mad_MinMax.MaxHeight) /* valid between MUIM_Show/Hide */ +#define _defwidth(obj) (muiAreaData(obj)->mad_MinMax.DefWidth) /* valid between MUIM_Show/Hide */ +#define _defheight(obj) (muiAreaData(obj)->mad_MinMax.DefHeight) /* valid between MUIM_Show/Hide */ +#define _flags(obj) (muiAreaData(obj)->mad_Flags) + +#endif + +/* MUI_CustomClass returned by MUI_CreateCustomClass() */ + +struct MUI_CustomClass +{ + APTR mcc_UserData; /* use for whatever you want */ + + struct Library *mcc_UtilityBase; /* MUI has opened these libraries */ + struct Library *mcc_DOSBase; /* for you automatically. You can */ + struct Library *mcc_GfxBase; /* use them or decide to open */ + struct Library *mcc_IntuitionBase; /* your libraries yourself. */ + + struct IClass *mcc_Super; /* pointer to super class */ + struct IClass *mcc_Class; /* pointer to the new class */ + + /* ... private data follows ... */ +}; + + +#if defined(__PPC__) + #if defined(__GNUC__) + #pragma pack() + #elif defined(__VBCC__) + #pragma default-align + #endif +#endif + +#endif /* MUI_H */ + +#endif /* __AROS__ */ diff --git a/workbench/classes/zune/nlist/include/libraries/muiaros.h b/workbench/classes/zune/nlist/include/libraries/muiaros.h new file mode 100644 index 0000000000..9504ab0590 --- /dev/null +++ b/workbench/classes/zune/nlist/include/libraries/muiaros.h @@ -0,0 +1,4071 @@ +/* + Copyright 2002-2010, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#ifndef LIBRARIES_MUI_H +#define LIBRARIES_MUI_H + +#ifndef INTUITION_CLASSES_H +# include +#endif +#ifndef GRAPHICS_GRAPHICS_H +# include +#endif +#ifndef GRAPHICS_RASTPORT_H +# include +#endif +#ifndef LIBRARIES_IFFPARSE_H +# include +#endif + +#ifdef __AROS__ +# ifndef AROS_ASMCALL_H +# include +# endif +# define SAVEDS +#else +/* + Copyright © 2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#ifndef _MUIMASTER_SUPPORT_AMIGAOS_H_ +#define _MUIMASTER_SUPPORT_AMIGAOS_H_ + +#ifdef EXEC_TYPES_H +#include +#endif + +#ifndef INTUITION_CLASSES_H +#include +#endif + +#ifndef AMIGA_COMILER_H +#include +#endif + +#ifndef PROTO_UTILITY_H +#include +#endif + +/* These are the identity function under AmigaOS */ +#define AROS_LONG2BE(x) (x) +#define AROS_BE2LONG(x) (x) + +#define IMSPEC_EXTERNAL_PREFIX "MUI:Images/" + +/* Define all classes as built in...should be moved out to config.h like file */ +#define ZUNE_BUILTIN_ABOUTMUI 1 +#define ZUNE_BUILTIN_BALANCE 1 +#define ZUNE_BUILTIN_BOOPSI 1 +#define ZUNE_BUILTIN_COLORADJUST 1 +#define ZUNE_BUILTIN_COLORFIELD 1 +#define ZUNE_BUILTIN_FRAMEADJUST 1 +#define ZUNE_BUILTIN_FRAMEDISPLAY 1 +#define ZUNE_BUILTIN_GAUGE 1 +#define ZUNE_BUILTIN_ICONLISTVIEW 0 +#define ZUNE_BUILTIN_IMAGEADJUST 1 +#define ZUNE_BUILTIN_IMAGEDISPLAY 1 +#define ZUNE_BUILTIN_PENADJUST 1 +#define ZUNE_BUILTIN_PENDISPLAY 1 +#define ZUNE_BUILTIN_POPASL 1 +#define ZUNE_BUILTIN_POPFRAME 1 +#define ZUNE_BUILTIN_POPIMAGE 1 +#define ZUNE_BUILTIN_POPPEN 1 +#define ZUNE_BUILTIN_RADIO 1 +#define ZUNE_BUILTIN_SCALE 1 +#define ZUNE_BUILTIN_SCROLLGROUP 1 +#define ZUNE_BUILTIN_SETTINGSGROUP 1 +#define ZUNE_BUILTIN_VIRTGROUP 1 + +#ifdef __SASC +#include +#endif + +#ifndef PI +#define PI 3.1415 +#endif + +#ifndef M_PI +#define M_PI PI +#endif + +#define AROS_STACKSIZE 65536 + +char *StrDup(const char *x); +Object *DoSuperNewTagList(struct IClass *cl, Object *obj,void *dummy, struct TagItem *tags); +Object *VARARGS68K DoSuperNewTags(struct IClass *cl, Object *obj, void *dummy, ...); +int VARARGS68K SPrintf(char *buf, const char *fmt, ...); + + + + +/*** HookEntry for OS4 (is only a dummy) ************************************/ +#ifdef __amigaos4__ +ASM ULONG HookEntry(REG(a0, struct Hook *hook),REG(a2, APTR obj), REG(a1, APTR msg)); +#endif + +/*** OS4 Exec Interface support *********************************************/ +#ifdef __amigaos4__ +#define EXEC_INTERFACE_DECLARE(x) x +#define EXEC_INTERFACE_GET_MAIN(interface,libbase) (interface = (void*)GetInterface(libbase,"main",1,NULL)) +#define EXEC_INTERFACE_DROP(interface) DropInterface((struct Interface*)interface) +#define EXEC_INTERFACE_ASSIGN(a,b) (a = b) +#else +#define EXEC_INTERFACE_DECLARE(x) +#define EXEC_INTERFACE_GET_MAIN(interface,libbase) 1 +#define EXEC_INTERFACE_DROP(interface) +#define EXEC_INTERFACE_ASSIGN(a,b) +#endif + +/*** AROS Exec extensions ***************************************************/ +#ifndef __amigaos4__ +APTR AllocVecPooled(APTR pool, ULONG size); +VOID FreeVecPooled(APTR pool, APTR memory); +#endif + +/*** AROS Intuition extensions **********************************************/ +#define DeinitRastPort(rp) +#define CloneRastPort(rp) (rp) +#define FreeRastPort(rp) + +/*** Miscellanous compiler supprot ******************************************/ +#ifndef SAVEDS +# ifdef __MAXON__ +# define __asm +# define __inline +# define SAVEDS +# define const +# else +# define SAVEDS __saveds +# endif +#endif + +#define __stackparm + +/*** Miscellanous AROS macros ***********************************************/ +#define AROS_LIBFUNC_INIT +#define AROS_LIBBASE_EXT_DECL(a, b) extern a b; +#define AROS_LIBFUNC_EXIT +#define AROS_ASMSYMNAME(a) a + +#define LC_BUILDNAME(x) x +#define LIBBASETYPEPTR struct Library * + +/*** AROS types *************************************************************/ +#ifndef __AROS_TYPES_DEFINED__ +# define __AROS_TYPES_DEFINED__ + typedef unsigned long IPTR; + typedef long STACKLONG; + typedef unsigned long STACKULONG; + typedef void (*VOID_FUNC)(); +#define STACKED +#endif /* __AROS_TYPES_DEFINED__ */ + +/*** AROS list macros *******************************************************/ +#define ForeachNode(l,n) \ +for \ +( \ + n=(void *)(((struct List *)(l))->lh_Head); \ + ((struct Node *)(n))->ln_Succ; \ + n=(void *)(((struct Node *)(n))->ln_Succ) \ +) + +/*** AROS register definitions **********************************************/ +#define __REG_D0 __d0 +#define __REG_D1 __d1 +#define __REG_D2 __d2 +#define __REG_D3 __d3 +#define __REG_D4 __d4 +#define __REG_D5 __d5 +#define __REG_D6 __d6 +#define __REG_D7 __d7 +#define __REG_A0 __a0 +#define __REG_A1 __a1 +#define __REG_A2 __a2 +#define __REG_A3 __a3 +#define __REG_A4 __a4 +#define __REG_A5 __a5 +#define __REG_A6 __a6 +#define __REG_A7 __a7 + +/*** AROS library function macros *******************************************/ +#define AROS_LH0(rt, fn, bt, bn, lvo, p) \ + ASM rt LIB_##fn (void) +#define AROS_LH1(rt, fn, a1, bt, bn, lvo, p) \ + ASM rt LIB_##fn (a1) +#define AROS_LH2(rt, fn, a1, a2, bt, bn, lvo, p) \ + ASM rt LIB_##fn (a1, a2) +#define AROS_LH3(rt, fn, a1, a2, a3, bt, bn, lvo, p) \ + ASM rt LIB_##fn (a1, a2, a3) +#define AROS_LH4(rt, fn, a1, a2, a3, a4, bt, bn, lvo, p) \ + ASM rt LIB_##fn (a1, a2, a3, a4) +#define AROS_LH5(rt, fn, a1, a2, a3, a4, a5, bt, bn, lvo, p) \ + ASM rt LIB_##fn (a1, a2, a3, a4, a5) +#define AROS_LH6(rt, fn, a1, a2, a3, a4, a5, a6, bt, bn, lvo, p) \ + ASM rt LIB_##fn (a1, a2, a3, a4, a5, a6) +#define AROS_LH7(rt, fn, a1, a2, a3, a4, a5, a6, a7, bt, bn, lvo, p) \ + ASM rt LIB_##fn (a1, a2, a3, a4, a5, a6, a7) +#define AROS_LH8(rt, fn, a1, a2, a3, a4, a5, a6, a7, a8, bt, bn, lvo, p) \ + ASM rt LIB_##fn (a1, a2, a3, a4, a5, a6, a7, a8) + +#ifdef __SASC +# define AROS_LHA(type, name, reg) register __REG_##reg type name +#else +# define AROS_LHA(type, name, reg) type name +#endif + +/*** AROS user function macros **********************************************/ +#define AROS_USERFUNC_INIT +#define AROS_USERFUNC_EXIT + +#define AROS_UFH0(rt, fn) \ + ASM rt fn (void) +#define AROS_UFH1(rt, fn, a1) \ + ASM rt fn (a1) +#define AROS_UFH2(rt, fn, a1, a2) \ + ASM rt fn (a1, a2) +#define AROS_UFH3(rt, fn, a1, a2, a3) \ + ASM rt fn (a1, a2, a3) +#define AROS_UFH4(rt, fn, a1, a2, a3, a4) \ + ASM rt fn (a1, a2, a3, a4) +#define AROS_UFH5(rt, fn, a1, a2, a3, a4, a5) \ + ASM rt fn (a1, a2, a3, a4, a5) +#define AROS_UFH6(rt, fn, a1, a2, a3, a4, a5, a6) \ + ASM rt fn (a1, a2, a3, a4, a5, a6) +#define AROS_UFH7(rt, fn, a1, a2, a3, a4, a5, a6, a7) \ + ASM rt fn (a1, a2, a3, a4, a5, a6, a7) +#define AROS_UFH8(rt, fn, a1, a2, a3, a4, a5, a6, a7, a8) \ + ASM rt fn (a1, a2, a3, a4, a5, a6, a7, a8) + +#define AROS_UFH0S(rt, fn) \ + ASM static rt fn (void) +#define AROS_UFH1S(rt, fn, a1) \ + ASM static rt fn (a1) +#define AROS_UFH2S(rt, fn, a1, a2) \ + ASM static rt fn (a1, a2) +#define AROS_UFH3S(rt, fn, a1, a2, a3) \ + ASM static rt fn (a1, a2, a3) +#define AROS_UFH4S(rt, fn, a1, a2, a3, a4) \ + ASM static rt fn (a1, a2, a3, a4) +#define AROS_UFH5S(rt, fn, a1, a2, a3, a4, a5) \ + ASM static rt fn (a1, a2, a3, a4, a5) +#define AROS_UFH6S(rt, fn, a1, a2, a3, a4, a5, a6) \ + ASM static rt fn (a1, a2, a3, a4, a5, a6) +#define AROS_UFH7S(rt, fn, a1, a2, a3, a4, a5, a6, a7) \ + ASM static rt fn (a1, a2, a3, a4, a5, a6, a7) +#define AROS_UFH8S(rt, fn, a1, a2, a3, a4, a5, a6, a7, a8) \ + ASM static rt fn (a1, a2, a3, a4, a5, a6, a7, a8) + +#ifdef __SASC +# define AROS_UFHA(type, name, reg) register __REG_##reg type name +#else +# define AROS_UFHA(type, name, reg) type name +#endif + +#define AROS_UFP0 AROS_UFH0 +#define AROS_UFP1 AROS_UFH1 +#define AROS_UFP2 AROS_UFH2 +#define AROS_UFP3 AROS_UFH3 +#define AROS_UFP4 AROS_UFH4 +#define AROS_UFP5 AROS_UFH5 +#define AROS_UFP6 AROS_UFH6 +#define AROS_UFP7 AROS_UFH7 +#define AROS_UFP8 AROS_UFH8 + +#define AROS_UFPA AROS_UFHA + +/* + With the following define a typical dispatcher will looks like this: + BOOPSI_DISPATCHER(IPTR,IconWindow_Dispatcher,cl,obj,msg) +*/ +#define BOOPSI_DISPATCHER(rettype,name,cl,obj,msg) \ + AROS_UFH3(SAVEDS rettype, name,\ + AROS_UFHA(Class *, cl, A0),\ + AROS_UFHA(Object *, obj, A2),\ + AROS_UFHA(Msg , msg, A1)) {AROS_USERFUNC_INIT +#define BOOPSI_DISPATCHER_END AROS_USERFUNC_EXIT} +#define BOOPSI_DISPATCHER_PROTO(rettype,name,cl,obj,msg) \ + AROS_UFP3(SAVEDS rettype, name,\ + AROS_UFPA(Class *, cl, A0),\ + AROS_UFPA(Object *, obj, A2),\ + AROS_UFPA(Msg , msg, A1)) + + +#endif /* _MUIMASTER_SUPPORT_AMIGAOS_H_ */ +#endif + + +#ifndef _MUI_IDENTIFIERS_H +#define _MUI_IDENTIFIERS_H + +/* + Copyright © 2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#include + +#define MUIB_MUI (TAG_USER) /* Base for legacy MUI identifiers */ +#define MUIB_RSVD (MUIB_MUI | 0x10400000) /* Base for AROS reserved range */ +#define MUIB_ZUNE (MUIB_RSVD | 0x00020000) /* Base for Zune core reserved range */ +#define MUIB_AROS (MUIB_RSVD | 0x00070000) /* Base for AROS core reserved range */ + +#endif /* _MUI_IDENTIFIERS_H */ + +#ifndef __AROS__ +#define MUIMASTER_NAME "zunemaster.library" +#define MUIMASTER_VMIN 0 +#define MUIMASTER_VLATEST 0 +#else +#define MUIMASTER_NAME "muimaster.library" +#define MUIMASTER_VMIN 11 +#define MUIMASTER_VLATEST 19 +#endif + + +/* This structure is used for the internal classes */ + +struct __MUIBuiltinClass { + CONST_STRPTR name; + CONST_STRPTR supername; + ULONG datasize; + +#ifndef __AROS__ + ULONG (*dispatcher)(); +#else + AROS_UFP3(IPTR, (*dispatcher), + AROS_UFPA(Class *, cl, A0), + AROS_UFPA(Object *, obj, A2), + AROS_UFPA(Msg , msg, A1)); +#endif +}; + + +#if defined(MUIMASTER_YES_INLINE_STDARG) && \ + !defined(NO_INLINE_STDARG) && \ + !defined(__SASC) + +#define MUIOBJMACRO_START(class) (APTR) \ +({ \ + ClassID __class = (ClassID) class; \ + enum { __ismuiobjmacro = 1 }; \ + IPTR __tags[] = {0 + +#define BOOPSIOBJMACRO_START(class) (APTR) \ +({ \ + Class *__class = (Class *) class; \ + enum { __ismuiobjmacro = 0 }; \ + IPTR __tags[] = {0 + +#define OBJMACRO_END \ + TAG_DONE}; \ + ( \ + __ismuiobjmacro \ + ? MUI_NewObjectA((ClassID)__class, (struct TagItem *)(__tags + 1)) \ + : NewObjectA((Class *)__class, NULL, (struct TagItem *)(__tags + 1)) \ + ); \ +}) + +#else + +#ifdef __amigaos4__ +# define MUIOBJMACRO_START(class) (IZuneMaster->MUI_NewObject)(class +# define BOOPSIOBJMACRO_START(class) (IIntuition->NewObject)(class, NULL +#else +# define MUIOBJMACRO_START(class) MUI_NewObject(class +# define BOOPSIOBJMACRO_START(class) NewObject(class, NULL +#endif + +#define OBJMACRO_END TAG_DONE) + +#endif + +#ifndef _MUI_CLASSES_NOTIFY_H +#ifndef _MUI_CLASSES_NOTIFY_H +#define _MUI_CLASSES_NOTIFY_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +struct MUI_NotifyData +{ + struct MUI_GlobalInfo *mnd_GlobalInfo; + IPTR mnd_UserData; + ULONG mnd_ObjectID; + + /* private starts here */ + struct MinList *mnd_NotifyList; /* priv1 */ + Object *mnd_ParentObject;/* priv2 */ + STRPTR mnd_HelpNode;/* priv3 */ + LONG mnd_HelpLine;/* priv4 */ +}; + +/*** Name *******************************************************************/ +#define MUIC_Notify "Notify.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Notify (MUIB_ZUNE | 0x00001d00) + +/*** Methods ****************************************************************/ +#define MUIM_CallHook (MUIB_MUI|0x0042b96b) /* MUI: V4 */ +#define MUIM_Export (MUIB_MUI|0x00420f1c) /* MUI: V12 */ +#define MUIM_FindUData (MUIB_MUI|0x0042c196) /* MUI: V8 */ +#define MUIM_GetConfigItem (MUIB_MUI|0x00423edb) /* MUI: V11 */ +#define MUIM_GetUData (MUIB_MUI|0x0042ed0c) /* MUI: V8 */ +#define MUIM_Import (MUIB_MUI|0x0042d012) /* MUI: V12 */ +#define MUIM_KillNotify (MUIB_MUI|0x0042d240) /* MUI: V4 */ +#define MUIM_KillNotifyObj (MUIB_MUI|0x0042b145) /* MUI: V16 */ +#define MUIM_MultiSet (MUIB_MUI|0x0042d356) /* MUI: V7 */ +#define MUIM_NoNotifySet (MUIB_MUI|0x0042216f) /* MUI: V9 */ +#define MUIM_Notify (MUIB_MUI|0x0042c9cb) /* MUI: V4 */ +#define MUIM_Set (MUIB_MUI|0x0042549a) /* MUI: V4 */ +#define MUIM_SetAsString (MUIB_MUI|0x00422590) /* MUI: V4 */ +#define MUIM_SetUData (MUIB_MUI|0x0042c920) /* MUI: V8 */ +#define MUIM_SetUDataOnce (MUIB_MUI|0x0042ca19) /* MUI: V11 */ +#define MUIM_WriteLong (MUIB_MUI|0x00428d86) /* MUI: V6 */ +#define MUIM_WriteString (MUIB_MUI|0x00424bf4) /* MUI: V6 */ +struct MUIP_CallHook {STACKED ULONG MethodID; STACKED struct Hook *Hook; STACKED IPTR param1; /* more might follow */}; +struct MUIP_Export {STACKED ULONG MethodID; STACKED Object *dataspace;}; +struct MUIP_FindUData {STACKED ULONG MethodID; STACKED IPTR udata;}; +struct MUIP_GetConfigItem {STACKED ULONG MethodID; STACKED ULONG id; STACKED IPTR *storage;}; +struct MUIP_GetUData {STACKED ULONG MethodID; STACKED ULONG udata; STACKED ULONG attr; STACKED IPTR *storage;}; +struct MUIP_Import {STACKED ULONG MethodID; STACKED Object *dataspace;}; +struct MUIP_KillNotify {STACKED ULONG MethodID; STACKED ULONG TrigAttr;}; +struct MUIP_KillNotifyObj {STACKED ULONG MethodID; STACKED ULONG TrigAttr; STACKED Object *dest;}; +struct MUIP_MultiSet {STACKED ULONG MethodID; STACKED ULONG attr; STACKED IPTR val; STACKED APTR obj; /* more might follow */}; +struct MUIP_NoNotifySet {STACKED ULONG MethodID; STACKED ULONG attr; STACKED IPTR val; /* more might follow */}; +struct MUIP_Notify {STACKED ULONG MethodID; STACKED ULONG TrigAttr; STACKED IPTR TrigVal; STACKED APTR DestObj; STACKED ULONG FollowParams; /* more might follow */}; +struct MUIP_Set {STACKED ULONG MethodID; STACKED ULONG attr; STACKED IPTR val;}; +struct MUIP_SetAsString {STACKED ULONG MethodID; STACKED ULONG attr; STACKED char *format; STACKED IPTR val; /* more might follow */}; +struct MUIP_SetUData {STACKED ULONG MethodID; STACKED IPTR udata; STACKED ULONG attr; STACKED IPTR val;}; +struct MUIP_SetUDataOnce {STACKED ULONG MethodID; STACKED IPTR udata; STACKED ULONG attr; STACKED IPTR val;}; +struct MUIP_WriteLong {STACKED ULONG MethodID; STACKED ULONG val; STACKED ULONG *memory;}; +struct MUIP_WriteString {STACKED ULONG MethodID; STACKED char *str; STACKED char *memory;}; + +#define MUIM_ConnectParent (MUIB_Notify | 0x00000000) /* Zune: V1 */ +#define MUIM_DisconnectParent (MUIB_Notify | 0x00000001) /* Zune: V1 */ +struct MUIP_ConnectParent {STACKED ULONG MethodID; STACKED Object *parent;}; +struct MUIP_DisconnectParent {STACKED ULONG MethodID;}; + +/*** Attributes *************************************************************/ +#define MUIA_ApplicationObject (MUIB_MUI|0x0042d3ee) /* MUI: V4 ..g Object * */ +#define MUIA_AppMessage (MUIB_MUI|0x00421955) /* MUI: V5 ..g struct AppMessage * */ +#define MUIA_HelpLine (MUIB_MUI|0x0042a825) /* MUI: V4 isg LONG */ +#define MUIA_HelpNode (MUIB_MUI|0x00420b85) /* MUI: V4 isg STRPTR */ +#define MUIA_NoNotify (MUIB_MUI|0x004237f9) /* MUI: V7 .s. BOOL */ +#define MUIA_ObjectID (MUIB_MUI|0x0042d76e) /* MUI: V11 isg ULONG */ +#define MUIA_Parent (MUIB_MUI|0x0042e35f) /* MUI: V11 ..g Object * */ +#define MUIA_Revision (MUIB_MUI|0x00427eaa) /* MUI: V4 ..g LONG */ +#define MUIA_UserData (MUIB_MUI|0x00420313) /* MUI: V4 isg ULONG */ +#define MUIA_Version (MUIB_MUI|0x00422301) /* MUI: V4 ..g LONG */ + +/* Special values for MUIM_Notify */ +#define MUIV_TriggerValue 0x49893131UL +#define MUIV_NotTriggerValue 0x49893133UL +#define MUIV_EveryTime 0x49893131UL /* as TrigVal */ + +enum +{ + MUIV_Notify_Self = 1, + MUIV_Notify_Window, + MUIV_Notify_Application, + MUIV_Notify_Parent, +}; + + +/* Private stuff */ + +#define _parent(obj) (muiNotifyData(obj)->mnd_ParentObject) /* Shortcut */ + + +#endif /* _MUI_CLASSES_NOTIFY_H */ +#endif + +#ifndef _MUI_CLASSES_FAMILY_H +#ifndef _CLASSES_FAMILY_H +#define _CLASSES_FAMILY_H + +/* + Copyright © 1999, David Le Corfec. + Copyright © 2002-2003, The AROS Development Team. + All rights reserved. + + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Family "Family.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Family (MUIB_ZUNE | 0x00000c00) + +/*** Methods ****************************************************************/ +#define MUIM_Family_AddHead (MUIB_MUI|0x0042e200) /* MUI: V8 */ +#define MUIM_Family_AddTail (MUIB_MUI|0x0042d752) /* MUI: V8 */ +#define MUIM_Family_Insert (MUIB_MUI|0x00424d34) /* MUI: V8 */ +#define MUIM_Family_Remove (MUIB_MUI|0x0042f8a9) /* MUI: V8 */ +#define MUIM_Family_Sort (MUIB_MUI|0x00421c49) /* MUI: V8 */ +#define MUIM_Family_Transfer (MUIB_MUI|0x0042c14a) /* MUI: V8 */ +struct MUIP_Family_AddHead {STACKED ULONG MethodID; STACKED Object *obj;}; +struct MUIP_Family_AddTail {STACKED ULONG MethodID; STACKED Object *obj;}; +struct MUIP_Family_Insert {STACKED ULONG MethodID; STACKED Object *obj; STACKED Object *pred;}; +struct MUIP_Family_Remove {STACKED ULONG MethodID; STACKED Object *obj;}; +struct MUIP_Family_Sort {STACKED ULONG MethodID; STACKED Object *obj[1];}; +struct MUIP_Family_Transfer {STACKED ULONG MethodID; STACKED Object *family;}; + +/*** Attributes *************************************************************/ +#define MUIA_Family_Child (MUIB_MUI|0x0042c696) /* MUI: V8 i.. Object * */ +#define MUIA_Family_List (MUIB_MUI|0x00424b9e) /* MUI: V8 ..g struct MinList * */ + + + +#endif /* _CLASSES_FAMILY_H */ +#endif + +#ifndef _MUI_CLASSES_APPLICATION_H +/* + Copyright © 1999, David Le Corfec. + Copyright © 2002-2003, The AROS Development Team. + All rights reserved. + + $Id$ +*/ + +#ifndef _MUI_CLASSES_APPLICATION_H +#define _MUI_CLASSES_APPLICATION_H + +#ifndef EXEC_SEMAPHORES_H +#include +#endif + +/*** Name *******************************************************************/ +#define MUIC_Application "Application.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Application (MUIB_ZUNE | 0x00000100) + +/*** Methods ****************************************************************/ +#define MUIM_Application_AboutMUI (MUIB_MUI|0x0042d21d) /* MUI: V14 */ +#define MUIM_Application_AddInputHandler (MUIB_MUI|0x0042f099) /* MUI: V11 */ +#define MUIM_Application_CheckRefresh (MUIB_MUI|0x00424d68) /* MUI: V11 */ +#define MUIM_Application_GetMenuCheck (MUIB_MUI|0x0042c0a7) /* MUI: V4 */ +#define MUIM_Application_GetMenuState (MUIB_MUI|0x0042a58f) /* MUI: V4 */ +#define MUIM_Application_Input (MUIB_MUI|0x0042d0f5) /* MUI: V4 */ +#define MUIM_Application_InputBuffered (MUIB_MUI|0x00427e59) /* MUI: V4 */ +#define MUIM_Application_Load (MUIB_MUI|0x0042f90d) /* MUI: V4 */ +#define MUIM_Application_NewInput (MUIB_MUI|0x00423ba6) /* MUI: V11 */ +#define MUIM_Application_OpenConfigWindow (MUIB_MUI|0x004299ba) /* MUI: V11 */ +#define MUIM_Application_PushMethod (MUIB_MUI|0x00429ef8) /* MUI: V4 */ +#define MUIM_Application_RemInputHandler (MUIB_MUI|0x0042e7af) /* MUI: V11 */ +#define MUIM_Application_ReturnID (MUIB_MUI|0x004276ef) /* MUI: V4 */ +#define MUIM_Application_Save (MUIB_MUI|0x004227ef) /* MUI: V4 */ +#define MUIM_Application_SetConfigItem (MUIB_MUI|0x00424a80) /* MUI: V11 */ +#define MUIM_Application_SetMenuCheck (MUIB_MUI|0x0042a707) /* MUI: V4 */ +#define MUIM_Application_SetMenuState (MUIB_MUI|0x00428bef) /* MUI: V4 */ +#define MUIM_Application_ShowHelp (MUIB_MUI|0x00426479) /* MUI: V4 */ + +#define MUIM_Application_SetConfigdata (MUIB_Application | 0x00000000) /* Zune 20030407 */ +#define MUIM_Application_OpenWindows (MUIB_Application | 0x00000001) /* Zune 20030407 */ +#define MUIM_Application_Iconify (MUIB_Application | 0x00000002) /* Zune: V1 */ +#define MUIM_Application_Execute (MUIB_Application | 0x00000003) +#define MUIM_Application_UpdateMenus (MUIB_Application | 0x00000004) /* Zune 20070712 */ +/* Method Structures */ +struct MUIP_Application_AboutMUI { STACKED ULONG MethodID; STACKED Object *refwindow; }; +struct MUIP_Application_AddInputHandler { STACKED ULONG MethodID; STACKED struct MUI_InputHandlerNode *ihnode; }; +struct MUIP_Application_CheckRefresh { STACKED ULONG MethodID; }; +struct MUIP_Application_GetMenuCheck { STACKED ULONG MethodID; STACKED ULONG MenuID; }; +struct MUIP_Application_GetMenuState { STACKED ULONG MethodID; STACKED ULONG MenuID; }; +struct MUIP_Application_Input { STACKED ULONG MethodID; STACKED ULONG *signal; }; +struct MUIP_Application_InputBuffered { STACKED ULONG MethodID; }; +struct MUIP_Application_Load { STACKED ULONG MethodID; STACKED STRPTR name; }; +struct MUIP_Application_NewInput { STACKED ULONG MethodID; STACKED ULONG *signal; }; +struct MUIP_Application_OpenConfigWindow { STACKED ULONG MethodID; STACKED ULONG flags; }; +struct MUIP_Application_PushMethod { STACKED ULONG MethodID; STACKED Object *dest; STACKED LONG count; /* more elements may follow */ }; +struct MUIP_Application_RemInputHandler { STACKED ULONG MethodID; STACKED struct MUI_InputHandlerNode *ihnode; }; +struct MUIP_Application_ReturnID { STACKED ULONG MethodID; STACKED ULONG retid; }; +struct MUIP_Application_Save { STACKED ULONG MethodID; STACKED STRPTR name; }; +struct MUIP_Application_SetConfigItem { STACKED ULONG MethodID; STACKED ULONG item; STACKED APTR data; }; +struct MUIP_Application_SetMenuCheck { STACKED ULONG MethodID; STACKED ULONG MenuID; STACKED LONG stat; }; +struct MUIP_Application_SetMenuState { STACKED ULONG MethodID; STACKED ULONG MenuID; STACKED LONG stat; }; +struct MUIP_Application_ShowHelp { STACKED ULONG MethodID; STACKED Object *window; STACKED char *name; STACKED char *node; STACKED LONG line; }; +struct MUIP_Application_SetConfigdata { STACKED ULONG MethodID; STACKED APTR configdata; }; +struct MUIP_Application_OpenWindows { STACKED ULONG MethodID; }; +struct MUIP_Application_UpdateMenus { STACKED ULONG MethodID; }; + +/*** Attributes *************************************************************/ +#define MUIA_Application_Active (MUIB_MUI|0x004260ab) /* MUI: V4 isg BOOL */ +#define MUIA_Application_Author (MUIB_MUI|0x00424842) /* MUI: V4 i.g STRPTR */ +#define MUIA_Application_Base (MUIB_MUI|0x0042e07a) /* MUI: V4 i.g STRPTR */ +#define MUIA_Application_Broker (MUIB_MUI|0x0042dbce) /* MUI: V4 ..g Broker * */ +#define MUIA_Application_BrokerHook (MUIB_MUI|0x00428f4b) /* MUI: V4 isg struct Hook * */ +#define MUIA_Application_BrokerPort (MUIB_MUI|0x0042e0ad) /* MUI: V6 ..g struct MsgPort * */ +#define MUIA_Application_BrokerPri (MUIB_MUI|0x0042c8d0) /* MUI: V6 i.g LONG */ +#define MUIA_Application_Commands (MUIB_MUI|0x00428648) /* MUI: V4 isg struct MUI_Command * */ +#define MUIA_Application_Copyright (MUIB_MUI|0x0042ef4d) /* MUI: V4 i.g STRPTR */ +#define MUIA_Application_Description (MUIB_MUI|0x00421fc6) /* MUI: V4 i.g STRPTR */ +#define MUIA_Application_DiskObject (MUIB_MUI|0x004235cb) /* MUI: V4 isg struct DiskObject * */ +#define MUIA_Application_DoubleStart (MUIB_MUI|0x00423bc6) /* MUI: V4 ..g BOOL */ +#define MUIA_Application_DropObject (MUIB_MUI|0x00421266) /* MUI: V5 is. Object * */ +#define MUIA_Application_ForceQuit (MUIB_MUI|0x004257df) /* MUI: V8 ..g BOOL */ +#define MUIA_Application_HelpFile (MUIB_MUI|0x004293f4) /* MUI: V8 isg STRPTR */ +#define MUIA_Application_Iconified (MUIB_MUI|0x0042a07f) /* MUI: V4 .sg BOOL */ +#define MUIA_Application_MenuAction (MUIB_MUI|0x00428961) /* MUI: V4 ..g ULONG */ +#define MUIA_Application_MenuHelp (MUIB_MUI|0x0042540b) /* MUI: V4 ..g ULONG */ +#define MUIA_Application_Menustrip (MUIB_MUI|0x004252d9) /* MUI: V8 i.. Object * */ +#define MUIA_Application_RexxHook (MUIB_MUI|0x00427c42) /* MUI: V7 isg struct Hook * */ +#define MUIA_Application_RexxMsg (MUIB_MUI|0x0042fd88) /* MUI: V4 ..g struct RxMsg * */ +#define MUIA_Application_RexxString (MUIB_MUI|0x0042d711) /* MUI: V4 .s. STRPTR */ +#define MUIA_Application_SingleTask (MUIB_MUI|0x0042a2c8) /* MUI: V4 i.. BOOL */ +#define MUIA_Application_Sleep (MUIB_MUI|0x00425711) /* MUI: V4 .s. BOOL */ +#define MUIA_Application_Title (MUIB_MUI|0x004281b8) /* MUI: V4 i.g STRPTR */ +#define MUIA_Application_UseCommodities (MUIB_MUI|0x00425ee5) /* MUI: V10 i.. BOOL */ +#define MUIA_Application_UsedClasses (MUIB_MUI|0x0042e9a7) /* MUI undoc: V20 i.. STRPTR [] */ +#define MUIA_Application_UseRexx (MUIB_MUI|0x00422387) /* MUI: V10 i.. BOOL */ +#define MUIA_Application_SetWinPos (MUIB_MUI|0x00432387) +#define MUIA_Application_GetWinPos (MUIB_MUI|0x00432388) +#define MUIA_Application_SearchWinId (MUIB_MUI|0x00432389) +#define MUIA_Application_GetWinPosAddr (MUIB_MUI|0x00432390) +#define MUIA_Application_GetWinPosSize (MUIB_MUI|0x00432391) +#define MUIA_Application_CopyWinPosToApp (MUIB_MUI|0x00432392) +#define MAXWINS 300 + +struct windowpos +{ +ULONG id; +WORD x1,y1,w1,h1; +WORD x2,y2,w2,h2; +}; + +/*+ + [I-G] CONST_STRPTR + Standard DOS version string. Example: "$VER: Program 1.3 (14.11.03)". + Zune extension: If unspecified or NULL, it will be automatically + constructed from MUIA_Application_Title, MUIA_Application_Version_Number, + MUIA_Application_Version_Date and MUIA_Application_Version_Extra as + follows: "$VER: <version> (<date>) [<extra>]". ++*/ +#define MUIA_Application_Version (MUIB_MUI|0x0042b33f) + +#define MUIA_Application_Window (MUIB_MUI|0x0042bfe0) /* MUI: V4 i.. Object * */ +#define MUIA_Application_WindowList (MUIB_MUI|0x00429abe) /* MUI: V13 ..g struct List * */ + +#define MUIA_Application_Configdata (MUIB_Application | 0x00000000) /* Zune 20030407 .s. Object * */ + +/*+ + [I-G] CONST_STRPTR + Version number. Examples: "1.5", "2.37.4b". ++*/ +#define MUIA_Application_Version_Number (MUIB_Application | 0x00000001) + +/*+ + [I-G] CONST_STRPTR + Date information on the standard international YYYY-MM-DD format. ++*/ +#define MUIA_Application_Version_Date (MUIB_Application | 0x00000002) + +/*+ + [I-G] CONST_STRPTR + Arbitrary extra version information. Example: "nightly build". ++*/ +#define MUIA_Application_Version_Extra (MUIB_Application | 0x00000003) + + +/* MUI Obsolette tags */ +#ifdef MUI_OBSOLETE +#define MUIA_Application_Menu (MUIB_MUI|0x00420e1f) /* MUI: V4 i.g struct NewMenu * */ +#endif /* MUI_OBSOLETE */ + +/************************************************************************** + Structure used ba MUIM_Application_AddInputHandler/RemInputHandler +**************************************************************************/ +struct MUI_InputHandlerNode +{ + struct MinNode ihn_Node; + Object *ihn_Object; + union + { + ULONG ihn_sigs; + struct + { + UWORD ihn_millis; + UWORD ihn_current; + } ihn_timer; + } + ihn_stuff; + ULONG ihn_Flags; + ULONG ihn_Method; +}; + +/* Easier access to the members */ +#define ihn_Millis ihn_stuff.ihn_timer.ihn_millis +#define ihn_Current ihn_stuff.ihn_timer.ihn_current +#define ihn_Signals ihn_stuff.ihn_sigs + +/* Flags for ihn_Flags */ +#define MUIIHNF_TIMER (1<<0) /* you want to be called every ihn_Millis msecs */ + +/************************************************************************** + Special values for the name field of MUIM_Application_Load/Save +**************************************************************************/ +#define MUIV_Application_Save_ENV ((STRPTR) 0) +#define MUIV_Application_Save_ENVARC ((STRPTR)~0) +#define MUIV_Application_Load_ENV ((STRPTR) 0) +#define MUIV_Application_Load_ENVARC ((STRPTR)~0) + + +/************************************************************************** + Special Values MUIM_Application_ReturnID. Usally programm should leave + the event loop if this is set +**************************************************************************/ +#define MUIV_Application_ReturnID_Quit ((ULONG)-1) + + + + + + +struct MUI_GlobalInfo +{ + ULONG priv0; + Object *mgi_ApplicationObject; + + /* The following data is private only, might be extented! */ +}; + + +#endif /* _MUI_CLASSES_APPLICATION_H */ +#endif + + +/************************************************************************** + Here are the possible Objecttypes for MUI_MakeObject() +**************************************************************************/ +enum +{ + MUIO_Label = 1, /* STRPTR label, ULONG flags */ + MUIO_Button, /* STRPTR label */ + MUIO_Checkmark, /* STRPTR label */ + MUIO_Cycle, /* STRPTR label, STRPTR *entries */ + MUIO_Radio, /* STRPTR label, STRPTR *entries */ + MUIO_Slider, /* STRPTR label, LONG min, LONG max */ + MUIO_String, /* STRPTR label, LONG maxlen */ + MUIO_PopButton, /* STRPTR imagespec */ + MUIO_HSpace, /* LONG space */ + MUIO_VSpace, /* LONG space */ + MUIO_HBar, /* LONG space */ + MUIO_VBar, /* LONG space */ + MUIO_MenustripNM, /* struct NewMenu *nm, ULONG flags */ + MUIO_Menuitem, /* STRPTR label, STRPTR shortcut, ULONG flags, ULONG data */ + MUIO_BarTitle, /* STRPTR label */ + MUIO_NumericButton,/* STRPTR label, LONG min, LONG max, STRPTR format */ + + MUIO_CoolButton = 111, /* STRPTR label, APTR CoolImage, ULONG flags */ + MUIO_ImageButton, /* CONST_STRPTR label, CONST_STRPTR imagePath */ +}; + +/* flag for MUIO_Menuitem */ +#define MUIO_Menuitem_CopyStrings (1<<30) + +/* flags for MUIO_Label type */ +#define MUIO_Label_SingleFrame (1<< 8) +#define MUIO_Label_DoubleFrame (1<< 9) +#define MUIO_Label_LeftAligned (1<<10) +#define MUIO_Label_Centered (1<<11) +#define MUIO_Label_FreeVert (1<<12) + +/* flag for MUIO_MenustripNM */ +#define MUIO_MenustripNM_CommandKeyCheck (1<<0) /* check for "localized" menu items such as "O\0Open" */ + +/* flag for MUI_CoolButton */ +#define MUIO_CoolButton_CoolImageID (1<<0) + +struct MUI_MinMax +{ + WORD MinWidth; + WORD MinHeight; + WORD MaxWidth; + WORD MaxHeight; + WORD DefWidth; + WORD DefHeight; +}; + +/* special maximum dimension in case it is unlimited */ +#define MUI_MAXMAX 10000 + +/* Number of pens, the single definintion is below */ +#define MPEN_COUNT 8 + +/* The mask for pens from MUI_ObtainPen() and a macro */ +#define MUIPEN_MASK 0x0000ffff +#define MUIPEN(pen) ((pen) & MUIPEN_MASK) + +/* These cannot be enums, since they will + * not be passed properly in varadic + * functions by some compilers. + */ +#define MUIV_Font_Inherit ((IPTR)0) +#define MUIV_Font_Normal ((IPTR)-1) +#define MUIV_Font_List ((IPTR)-2) +#define MUIV_Font_Tiny ((IPTR)-3) +#define MUIV_Font_Fixed ((IPTR)-4) +#define MUIV_Font_Title ((IPTR)-5) +#define MUIV_Font_Big ((IPTR)-6) +#define MUIV_Font_Button ((IPTR)-7) +#define MUIV_Font_Knob ((IPTR)-8) +#define MUIV_Font_NegCount ((IPTR)-9) + +/* Possible keyevents (user configurable) */ +enum +{ + MUIKEY_RELEASE = -2, /* this one is faked only, and thereforce not configurable */ + MUIKEY_NONE = -1, + MUIKEY_PRESS = 0, + MUIKEY_TOGGLE = 1, + MUIKEY_UP = 2, + MUIKEY_DOWN = 3, + MUIKEY_PAGEUP = 4, + MUIKEY_PAGEDOWN = 5, + MUIKEY_TOP = 6, + MUIKEY_BOTTOM = 7, + MUIKEY_LEFT = 8, + MUIKEY_RIGHT = 9, + MUIKEY_WORDLEFT = 10, + MUIKEY_WORDRIGHT = 11, + MUIKEY_LINESTART = 12, + MUIKEY_LINEEND = 13, + MUIKEY_GADGET_NEXT = 14, + MUIKEY_GADGET_PREV = 15, + MUIKEY_GADGET_OFF = 16, + MUIKEY_WINDOW_CLOSE = 17, + MUIKEY_WINDOW_NEXT = 18, + MUIKEY_WINDOW_PREV = 19, + MUIKEY_HELP = 20, + MUIKEY_POPUP = 21, + MUIKEY_COUNT = 22 +}; + +/* The mask definitions of the above keys */ +#define MUIKEYF_PRESS (1<<MUIKEY_PRESS) +#define MUIKEYF_TOGGLE (1<<MUIKEY_TOGGLE) +#define MUIKEYF_UP (1<<MUIKEY_UP) +#define MUIKEYF_DOWN (1<<MUIKEY_DOWN) +#define MUIKEYF_PAGEUP (1<<MUIKEY_PAGEUP) +#define MUIKEYF_PAGEDOWN (1<<MUIKEY_PAGEDOWN) +#define MUIKEYF_TOP (1<<MUIKEY_TOP) +#define MUIKEYF_BOTTOM (1<<MUIKEY_BOTTOM) +#define MUIKEYF_LEFT (1<<MUIKEY_LEFT) +#define MUIKEYF_RIGHT (1<<MUIKEY_RIGHT) +#define MUIKEYF_WORDLEFT (1<<MUIKEY_WORDLEFT) +#define MUIKEYF_WORDRIGHT (1<<MUIKEY_WORDRIGHT) +#define MUIKEYF_LINESTART (1<<MUIKEY_LINESTART) +#define MUIKEYF_LINEEND (1<<MUIKEY_LINEEND) +#define MUIKEYF_GADGET_NEXT (1<<MUIKEY_GADGET_NEXT) +#define MUIKEYF_GADGET_PREV (1<<MUIKEY_GADGET_PREV) +#define MUIKEYF_GADGET_OFF (1<<MUIKEY_GADGET_OFF) +#define MUIKEYF_WINDOW_CLOSE (1<<MUIKEY_WINDOW_CLOSE) +#define MUIKEYF_WINDOW_NEXT (1<<MUIKEY_WINDOW_NEXT) +#define MUIKEYF_WINDOW_PREV (1<<MUIKEY_WINDOW_PREV) +#define MUIKEYF_HELP (1<<MUIKEY_HELP) +#define MUIKEYF_POPUP (1<<MUIKEY_POPUP) + +struct MUI_CustomClass +{ + APTR mcc_UserData; /* freely usable */ + + /* Zune/MUI had the following libraries opened for you */ + struct Library *mcc_UtilityBase; + struct Library *mcc_DOSBase; + struct Library *mcc_GfxBase; + struct Library *mcc_IntuitionBase; + + struct IClass *mcc_Super; /* the boopsi class' superclass */ + struct IClass *mcc_Class; /* the boopsi class */ + + /* the following stuff is private */ + + struct Library *mcc_Module; /* non-null if external class */ +}; + +#undef MPEN_COUNT + +typedef enum { + MPEN_SHINE = 0, + MPEN_HALFSHINE = 1, + MPEN_BACKGROUND = 2, + MPEN_HALFSHADOW = 3, + MPEN_SHADOW = 4, + MPEN_TEXT = 5, + MPEN_FILL = 6, + MPEN_MARK = 7, + MPEN_COUNT = 8, +} MPen; + +typedef enum { + PST_MUI = 'm', + PST_CMAP = 'p', + PST_RGB = 'r', + PST_SYS = 's', +} PenSpecType; + +/* MUI_PenSpec is a an ascii spec like this: + + "m5" (mui pen #5) + "p123" (cmap entry #123) + "rFFFFFFFF,00000000,00000000 (rgb #FF0000) + "s3" (system pen #3) + + It needs to be like this, because for example nlist has + default penspecs in it's source encoded like above which + it directly passes to MUI_ObtainBestPen */ + +struct MUI_PenSpec +{ + UBYTE ps_buf[32]; +}; + + +struct MUI_FrameSpec +{ + char buf[32]; +}; + +struct MUI_RGBcolor +{ + ULONG red; + ULONG green; + ULONG blue; +}; + +#ifndef _MUI_CLASSES_NOTIFY_H +#endif + +#ifndef _MUI_CLASSES_WINDOW_H +#ifndef _MUI_CLASSES_WINDOW_H +#define _MUI_CLASSES_WINDOW_H + +/* + Copyright 1999, David Le Corfec. + Copyright 2002-2003, The AROS Development Team. + All rights reserved. + + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Window "Window.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Window (MUIB_ZUNE | 0x00003600) + +/*** Methods ****************************************************************/ +#define MUIM_Window_ActionIconify (MUIB_MUI|0x00422cc0) /* MUI: V18 undoc*/ +#define MUIM_Window_AddEventHandler (MUIB_MUI|0x004203b7) /* MUI: V16 */ +#define MUIM_Window_Cleanup (MUIB_MUI|0x0042ab26) /* MUI: V18 undoc */ /* For custom classes only */ +#define MUIM_Window_RemEventHandler (MUIB_MUI|0x0042679e) /* MUI: V16 */ +#define MUIM_Window_ScreenToBack (MUIB_MUI|0x0042913d) /* MUI: V4 */ +#define MUIM_Window_ScreenToFront (MUIB_MUI|0x004227a4) /* MUI: V4 */ +#define MUIM_Window_Setup (MUIB_MUI|0x0042c34c) /* MUI: V18 undoc */ /* For custom Classes only */ +#define MUIM_Window_Snapshot (MUIB_MUI|0x0042945e) /* MUI: V11 */ +#define MUIM_Window_ToBack (MUIB_MUI|0x0042152e) /* MUI: V4 */ +#define MUIM_Window_ToFront (MUIB_MUI|0x0042554f) /* MUI: V4 */ +struct MUIP_Window_ActionIconify {STACKED ULONG MethodID;}; +struct MUIP_Window_AddEventHandler {STACKED ULONG MethodID; STACKED struct MUI_EventHandlerNode *ehnode;}; +struct MUIP_Window_Cleanup {STACKED ULONG MethodID;}; +struct MUIP_Window_RemEventHandler {STACKED ULONG MethodID; STACKED struct MUI_EventHandlerNode *ehnode;}; +struct MUIP_Window_ScreenToBack {STACKED ULONG MethodID;}; +struct MUIP_Window_ScreenToFront {STACKED ULONG MethodID;}; +struct MUIP_Window_Setup {STACKED ULONG MethodID;}; +struct MUIP_Window_Snapshot {STACKED ULONG MethodID; STACKED LONG flags;}; +struct MUIP_Window_ToBack {STACKED ULONG MethodID;}; +struct MUIP_Window_ToFront {STACKED ULONG MethodID;}; + +#define MUIM_Window_AllocGadgetID (MUIB_Window | 0x00000001) /* Zune: V1 - allocate a GadgetID for BOOPSI gadgets */ +#define MUIM_Window_FreeGadgetID (MUIB_Window | 0x00000004) /* Zune: V1 - free the GadgetID for BOOPSI gadgets */ +struct MUIP_Window_AddControlCharHandler { STACKED ULONG MethodID; STACKED struct MUI_EventHandlerNode *ccnode; }; +struct MUIP_Window_AllocGadgetID { STACKED ULONG MethodID; }; /* Custom Class - returns the Gadget ID */ +struct MUIP_Window_DrawBackground { STACKED ULONG MethodID; STACKED LONG left; STACKED LONG top; STACKED LONG width; STACKED LONG height; STACKED LONG xoffset; STACKED LONG yoffset; STACKED LONG flags;}; +struct MUIP_Window_DragObject { STACKED ULONG MethodID; STACKED Object *obj; STACKED LONG touchx; STACKED LONG touchy; STACKED ULONG flags; }; +struct MUIP_Window_FreeGadgetID { STACKED ULONG MethodID; STACKED LONG gadgetid; }; /* Custom Class */ +struct MUIP_Window_RecalcDisplay { STACKED ULONG MethodID; STACKED Object *originator; }; +struct MUIP_Window_RemControlCharHandler { STACKED ULONG MethodID; STACKED struct MUI_EventHandlerNode *ccnode; }; +struct MUIP_Window_UpdateMenu { STACKED ULONG MethodID; }; + +#ifdef MUI_OBSOLETE +#define MUIM_Window_GetMenuCheck (MUIB_MUI|0x00420414) /* MUI: V4 */ +#define MUIM_Window_GetMenuState (MUIB_MUI|0x00420d2f) /* MUI: V4 */ +#define MUIM_Window_SetCycleChain (MUIB_MUI|0x00426510) /* MUI: V4 */ +#define MUIM_Window_SetMenuCheck (MUIB_MUI|0x00422243) /* MUI: V4 */ +#define MUIM_Window_SetMenuState (MUIB_MUI|0x00422b5e) /* MUI: V4 */ +struct MUIP_Window_GetMenuCheck {STACKULONG MethodID; STACKED ULONG MenuID;}; +struct MUIP_Window_GetMenuState {STACKULONG MethodID; STACKED ULONG MenuID;}; +struct MUIP_Window_SetCycleChain {STACKULONG MethodID; STACKED Object *obj[1];}; +struct MUIP_Window_SetMenuCheck {STACKULONG MethodID; STACKED ULONG MenuID; STACKED LONG stat;}; +struct MUIP_Window_SetMenuState {STACKULONG MethodID; STACKED ULONG MenuID; STACKED LONG stat;}; +#endif /* MUI_OBSOLETE */ + +/*** Attributes *************************************************************/ +#define MUIA_Window_Activate (MUIB_MUI|0x00428d2f) /* MUI: V4 isg BOOL */ +#define MUIA_Window_ActiveObject (MUIB_MUI|0x00427925) /* MUI: V4 .sg Object * */ +#define MUIA_Window_AltHeight (MUIB_MUI|0x0042cce3) /* MUI: V4 i.g LONG */ +#define MUIA_Window_AltLeftEdge (MUIB_MUI|0x00422d65) /* MUI: V4 i.g LONG */ +#define MUIA_Window_AltTopEdge (MUIB_MUI|0x0042e99b) /* MUI: V4 i.g LONG */ +#define MUIA_Window_AltWidth (MUIB_MUI|0x004260f4) /* MUI: V4 i.g LONG */ +#define MUIA_Window_AppWindow (MUIB_MUI|0x004280cf) /* MUI: V5 i.. BOOL */ +#define MUIA_Window_Backdrop (MUIB_MUI|0x0042c0bb) /* MUI: V4 i.. BOOL */ +#define MUIA_Window_Borderless (MUIB_MUI|0x00429b79) /* MUI: V4 i.. BOOL */ +#define MUIA_Window_CloseGadget (MUIB_MUI|0x0042a110) /* MUI: V4 i.. BOOL */ +#define MUIA_Window_CloseRequest (MUIB_MUI|0x0042e86e) /* MUI: V4 ..g BOOL */ +#define MUIA_Window_DefaultObject (MUIB_MUI|0x004294d7) /* MUI: V4 isg Object * */ +#define MUIA_Window_DepthGadget (MUIB_MUI|0x00421923) /* MUI: V4 i.. BOOL */ +#define MUIA_Window_DisableKeys (MUIB_MUI|0x00424c36) /* MUI: V15 isg ULONG */ /* undoc */ +#define MUIA_Window_DragBar (MUIB_MUI|0x0042045d) /* MUI: V4 i.. BOOL */ +#define MUIA_Window_FancyDrawing (MUIB_MUI|0x0042bd0e) /* MUI: V8 isg BOOL */ +#define MUIA_Window_Height (MUIB_MUI|0x00425846) /* MUI: V4 i.g LONG */ +#define MUIA_Window_ID (MUIB_MUI|0x004201bd) /* MUI: V4 isg ULONG */ +#define MUIA_Window_InputEvent (MUIB_MUI|0x004247d8) /* MUI: V4 ..g struct InputEvent * */ +#define MUIA_Window_IsSubWindow (MUIB_MUI|0x0042b5aa) /* MUI: V4 isg BOOL */ +#define MUIA_Window_LeftEdge (MUIB_MUI|0x00426c65) /* MUI: V4 i.g LONG */ +#define MUIA_Window_MenuAction (MUIB_MUI|0x00427521) /* MUI: V8 isg ULONG */ +#define MUIA_Window_Menustrip (MUIB_MUI|0x0042855e) /* MUI: V8 i.g Object * */ +#define MUIA_Window_MouseObject (MUIB_MUI|0x0042bf9b) /* MUI: V10 ..g Object * */ +#define MUIA_Window_NeedsMouseObject (MUIB_MUI|0x0042372a) /* MUI: V10 i.. BOOL */ +#define MUIA_Window_NoMenus (MUIB_MUI|0x00429df5) /* MUI: V4 is. BOOL */ +#define MUIA_Window_Open (MUIB_MUI|0x00428aa0) /* MUI: V4 .sg BOOL */ +#define MUIA_Window_PublicScreen (MUIB_MUI|0x004278e4) /* MUI: V6 isg STRPTR */ +#define MUIA_Window_RefWindow (MUIB_MUI|0x004201f4) /* MUI: V4 is. Object * */ +#define MUIA_Window_RootObject (MUIB_MUI|0x0042cba5) /* MUI: V4 isg Object * */ +#define MUIA_Window_Screen (MUIB_MUI|0x0042df4f) /* MUI: V4 isg struct Screen * */ +#define MUIA_Window_ScreenTitle (MUIB_MUI|0x004234b0) /* MUI: V5 isg STRPTR */ +#define MUIA_Window_SizeGadget (MUIB_MUI|0x0042e33d) /* MUI: V4 i.. BOOL */ +#define MUIA_Window_SizeRight (MUIB_MUI|0x00424780) /* MUI: V4 i.. BOOL */ +#define MUIA_Window_Sleep (MUIB_MUI|0x0042e7db) /* MUI: V4 .sg BOOL */ +#define MUIA_Window_Title (MUIB_MUI|0x0042ad3d) /* MUI: V4 isg STRPTR */ +#define MUIA_Window_TopEdge (MUIB_MUI|0x00427c66) /* MUI: V4 i.g LONG */ +#define MUIA_Window_UseBottomBorderScroller (MUIB_MUI|0x00424e79) /* MUI: V13 isg BOOL */ +#define MUIA_Window_UseLeftBorderScroller (MUIB_MUI|0x0042433e) /* MUI: V13 isg BOOL */ +#define MUIA_Window_UseRightBorderScroller (MUIB_MUI|0x0042c05e) /* MUI: V13 isg BOOL */ +#define MUIA_Window_Width (MUIB_MUI|0x0042dcae) /* MUI: V4 i.g LONG */ +#define MUIA_Window_Window (MUIB_MUI|0x00426a42) /* MUI: V4 ..g struct Window * */ + +#define MUIA_Window_EraseArea (MUIB_Window | 0x00000000) /* Zune only i.. BOOL (default: TRUE) */ +#define MUIA_Window_ZoomGadget (MUIB_Window | 0x00000002) +#define MUIA_Window_ToolBox (MUIB_Window | 0x00000003) + +#define MUIV_Window_ActiveObject_None 0 +#define MUIV_Window_ActiveObject_Next (-1) +#define MUIV_Window_ActiveObject_Prev (-2) +#define MUIV_Window_AltHeight_MinMax(p) (0-(p)) +#define MUIV_Window_AltHeight_Visible(p) (-100-(p)) +#define MUIV_Window_AltHeight_Screen(p) (-200-(p)) +#define MUIV_Window_AltHeight_Scaled (-1000) +#define MUIV_Window_AltLeftEdge_Centered (-1) +#define MUIV_Window_AltLeftEdge_Moused (-2) +#define MUIV_Window_AltLeftEdge_NoChange (-1000) +#define MUIV_Window_AltTopEdge_Centered (-1) +#define MUIV_Window_AltTopEdge_Moused (-2) +#define MUIV_Window_AltTopEdge_Delta(p) (-3-(p)) +#define MUIV_Window_AltTopEdge_NoChange (-1000) +#define MUIV_Window_AltWidth_MinMax(p) (0-(p)) +#define MUIV_Window_AltWidth_Visible(p) (-100-(p)) +#define MUIV_Window_AltWidth_Screen(p) (-200-(p)) +#define MUIV_Window_AltWidth_Scaled (-1000) +#define MUIV_Window_Height_MinMax(p) (0-(p)) +#define MUIV_Window_Height_Visible(p) (-100-(p)) +#define MUIV_Window_Height_Screen(p) (-200-(p)) +#define MUIV_Window_Height_Scaled (-1000) +#define MUIV_Window_Height_Default (-1001) +#define MUIV_Window_LeftEdge_Centered (-1) +#define MUIV_Window_LeftEdge_Moused (-2) +#define MUIV_Window_TopEdge_Centered (-1) +#define MUIV_Window_TopEdge_Moused (-2) +#define MUIV_Window_TopEdge_Delta(p) (-3-(p)) +#define MUIV_Window_Width_MinMax(p) (0-(p)) +#define MUIV_Window_Width_Visible(p) (-100-(p)) +#define MUIV_Window_Width_Screen(p) (-200-(p)) +#define MUIV_Window_Width_Scaled (-1000) +#define MUIV_Window_Width_Default (-1001) + +#define MUIV_Window_Button_MUI 1 +#define MUIV_Window_Button_Snapshot 2 +#define MUIV_Window_Button_Iconify 4 +#define MUIV_Window_Button_Popup 8 + + +#ifdef MUI_OBSOLETE +#define MUIA_Window_Menu (MUIB_MUI|0x0042db94) /* MUI: V4 i.. struct NewMenu * */ +#define MUIV_Window_Menu_NoMenu (-1) +#endif /* MUI_OBSOLETE */ + +/* Forward declaration for application opaque custom frame specification */ +struct dt_frame_image; + +/************************************************************************** + Info about the display environment on which all Area Objects have a + reference to it. +**************************************************************************/ + +#define MRI_RARRAY_SIZE 20 + +struct MUI_RenderInfo +{ + Object *mri_WindowObject; /* accessable inbetween MUIM_Setup/MUIM_Cleanup */ + struct Screen *mri_Screen; /* accessable inbetween MUIM_Setup/MUIM_Cleanup */ + struct DrawInfo *mri_DrawInfo; /* accessable inbetween MUIM_Setup/MUIM_Cleanup */ + UWORD *mri_Pens; /* accessable inbetween MUIM_Setup/MUIM_Cleanup */ + struct Window *mri_Window; /* accessable inbetween MUIM_Show/MUIM_Hide */ + struct RastPort *mri_RastPort; /* accessable inbetween MUIM_Show/MUIM_Hide */ + ULONG mri_Flags; /* accessable inbetween MUIM_Setup/MUIM_Cleanup */ + + /* the following stuff is private */ + struct ColorMap *mri_Colormap; + UWORD mri_ScreenWidth; + UWORD mri_ScreenHeight; + UWORD mri_PensStorage[MPEN_COUNT]; /* storage for pens, mri_Pens point to here */ + + struct TextFont *mri_Fonts[-MUIV_Font_NegCount]; /* Opened text fonts, done by zune_get_font() */ + + /* this is for AddClipping/AddClipRegion */ + struct Region *mri_rArray[MRI_RARRAY_SIZE]; + int mri_rCount; + + struct Rectangle mri_ClipRect; + + UWORD mri_BorderTop; /* The height of the windows top border (the title) */ + UWORD mri_BorderBottom; /* The height of the windows bottom bodder */ + UWORD mri_BorderLeft; /* The width of the windows left border */ + UWORD mri_BorderRight; /* The width of the windows right border */ + + /* Stuff for Borderscrollers */ + Object *mri_LeftImage; /* Valid between MUIM_Setup/MUIM_Cleanup */ + Object *mri_RightImage; + Object *mri_UpImage; + Object *mri_DownImage; + Object *mri_SizeImage; + + Object *mri_VertProp; /* Valid between MUIM_Show/MUIM_Hide */ + Object *mri_HorizProp; + + /* buffering */ + struct RastPort mri_BufferRP; + struct BitMap *mri_BufferBM; + + struct dt_frame_image *mri_FrameImage[16]; +}; + +#define MUIMRI_RECTFILL (1<<0) +#define MUIMRI_TRUECOLOR (1<<1) +#define MUIMRI_THINFRAMES (1<<2) +#define MUIMRI_REFRESHMODE (1<<3) + +/************************************************************************** + MUI_EventHandlerNode as used by + MUIM_Window_AddEventHandler/RemoveEventHandler +**************************************************************************/ + +struct MUI_EventHandlerNode +{ + struct MinNode ehn_Node; /* embedded node structure, private! */ + BYTE ehn_Reserved; /* private! */ + BYTE ehn_Priority; /* sorted by priority. */ + UWORD ehn_Flags; /* some flags, see below */ + Object *ehn_Object; /* object which should receive MUIM_HandleEvent. */ + struct IClass *ehn_Class; /* Class for CoerceMethod(). If NULL DoMethod() is used */ + ULONG ehn_Events; /* the IDCMP flags the handler should be invoked. */ +}; + +/* here are the flags for ehn_Flags */ +#define MUI_EHF_ALWAYSKEYS (1<<0) +#define MUI_EHF_GUIMODE (1<<1) /* handler will not be called if object is not visible or disabled */ + +/* MUIM_HandleEvent must return a bitmask where following bit's can be set (all other must be 0) */ +#define MUI_EventHandlerRC_Eat (1<<0) /* do not invoke more handlers ers */ + + + +#endif /* _MUI_CLASSES_WINDOW_H */ +#endif + +#ifndef _MUI_CLASSES_AREA_H +/* + Copyright © 1999, David Le Corfec. + Copyright © 2002 - 2011, The AROS Development Team. + All rights reserved. + + $Id$ +*/ + +#ifndef _MUI_CLASSES_AREA_H +#define _MUI_CLASSES_AREA_H + +#ifndef INTUITION_INTUITION_H +#include <intuition/intuition.h> +#endif + +#ifndef GRAPHICS_GRAPHICS_H +#include <graphics/gfx.h> +#endif + +#ifndef _MUI_CLASSES_WINDOW_H +#endif + +/*** Name *******************************************************************/ +#define MUIC_Area "Area.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Area (MUIB_ZUNE | 0x00000200) + +/*** Methods ****************************************************************/ +#define MUIM_AskMinMax (MUIB_MUI|0x00423874) /* MUI: V4 */ /* For Custom Classes only */ +#define MUIM_Cleanup (MUIB_MUI|0x0042d985) /* MUI: V4 */ /* For Custom Classes only */ +#define MUIM_ContextMenuBuild (MUIB_MUI|0x00429d2e) /* MUI: V11 */ +#define MUIM_ContextMenuChoice (MUIB_MUI|0x00420f0e) /* MUI: V11 */ +#define MUIM_CreateBubble (MUIB_MUI|0x00421c41) /* MUI: V18 */ +#define MUIM_CreateDragImage (MUIB_MUI|0x0042eb6f) /* MUI: V18 */ /* For Custom Classes only */ /* Undoc */ +#define MUIM_CreateShortHelp (MUIB_MUI|0x00428e93) /* MUI: V11 */ +#define MUIM_CustomBackfill (MUIB_MUI|0x00428d73) /* Undoc */ +#define MUIM_DeleteBubble (MUIB_MUI|0x004211af) /* MUI: V18 */ +#define MUIM_DeleteDragImage (MUIB_MUI|0x00423037) /* MUI: V18 */ /* For Custom Classes only */ /* Undoc */ +#define MUIM_DeleteShortHelp (MUIB_MUI|0x0042d35a) /* MUI: V11 */ +#define MUIM_DoDrag (MUIB_MUI|0x004216bb) /* MUI: V18 */ /* For Custom Classes only */ /* Undoc */ +#define MUIM_DragBegin (MUIB_MUI|0x0042c03a) /* MUI: V11 */ +#define MUIM_DragDrop (MUIB_MUI|0x0042c555) /* MUI: V11 */ +#define MUIM_UnknownDropDestination (MUIB_MUI|0x00425550) /* ZUNE */ +#define MUIM_DragFinish (MUIB_MUI|0x004251f0) /* MUI: V11 */ +#define MUIM_DragQuery (MUIB_MUI|0x00420261) /* MUI: V11 */ +#define MUIM_DragReport (MUIB_MUI|0x0042edad) /* MUI: V11 */ +#define MUIM_Draw (MUIB_MUI|0x00426f3f) /* MUI: V4 */ /* For Custom Classes only */ +#define MUIM_DrawBackground (MUIB_MUI|0x004238ca) /* MUI: V11 */ +#define MUIM_GoActive (MUIB_MUI|0x0042491a) /* Undoc */ +#define MUIM_GoInactive (MUIB_MUI|0x00422c0c) /* Undoc */ +#define MUIM_HandleEvent (MUIB_MUI|0x00426d66) /* MUI: V16 */ /* For Custom Classes only */ +#define MUIM_HandleInput (MUIB_MUI|0x00422a1a) /* MUI: V4 */ /* For Custom Classes only */ +#define MUIM_Hide (MUIB_MUI|0x0042f20f) /* MUI: V4 */ /* For Custom Classes only */ +#define MUIM_Setup (MUIB_MUI|0x00428354) /* MUI: V4 */ /* For Custom Classes only */ +#define MUIM_Show (MUIB_MUI|0x0042cc84) /* MUI: V4 */ /* For Custom Classes only */ +struct MUIP_AskMinMax {STACKED ULONG MethodID; STACKED struct MUI_MinMax *MinMaxInfo;}; +struct MUIP_Cleanup {STACKED ULONG MethodID;}; +struct MUIP_ContextMenuBuild {STACKED ULONG MethodID; STACKED LONG mx; STACKED LONG my;}; +struct MUIP_ContextMenuChoice {STACKED ULONG MethodID; STACKED Object *item;}; +struct MUIP_CreateBubble {STACKED ULONG MethodID; STACKED LONG x; STACKED LONG y; STACKED char *txt; STACKED ULONG flags;}; +struct MUIP_CreateDragImage {STACKED ULONG MethodID; STACKED LONG touchx; STACKED LONG touchy; STACKED ULONG flags;}; +struct MUIP_CreateShortHelp {STACKED ULONG MethodID; STACKED LONG mx; STACKED LONG my;}; +struct MUIP_CustomBackfill {STACKED ULONG MethodID; STACKED LONG left; STACKED LONG top; STACKED LONG right; STACKED LONG bottom; STACKED LONG xoffset; STACKED LONG yoffset;}; +struct MUIP_DeleteBubble {STACKED ULONG MethodID; STACKED APTR bubble;}; +struct MUIP_DeleteDragImage {STACKED ULONG MethodID; STACKED struct MUI_DragImage *di;}; +struct MUIP_DeleteShortHelp {STACKED ULONG MethodID; STACKED STRPTR help; }; +struct MUIP_DoDrag {STACKED ULONG MethodID; STACKED LONG touchx; STACKED LONG touchy; STACKED ULONG flags;}; +struct MUIP_UnknownDropDestination {STACKED ULONG MethodID; STACKED struct IntuiMessage *imsg; }; +struct MUIP_DragBegin {STACKED ULONG MethodID; STACKED Object *obj;}; +struct MUIP_DragDrop {STACKED ULONG MethodID; STACKED Object *obj; STACKED LONG x; STACKED LONG y;}; +struct MUIP_DragFinish {STACKED ULONG MethodID; STACKED Object *obj;}; +struct MUIP_DragQuery {STACKED ULONG MethodID; STACKED Object *obj;}; +struct MUIP_DragReport {STACKED ULONG MethodID; STACKED Object *obj; STACKED LONG x; STACKED LONG y; STACKED LONG update;}; +struct MUIP_Draw {STACKED ULONG MethodID; STACKED ULONG flags;}; +struct MUIP_DrawBackground {STACKED ULONG MethodID; STACKED LONG left; STACKED LONG top; STACKED LONG width; STACKED LONG height; STACKED LONG xoffset; STACKED LONG yoffset; STACKED LONG flags;}; +struct MUIP_DrawBackgroundBuffered {STACKED ULONG MethodID; STACKED struct RastPort *rp; STACKED LONG left; STACKED LONG top; STACKED LONG width; STACKED LONG height; STACKED LONG xoffset; STACKED LONG yoffset; STACKED LONG flags;}; +struct MUIP_GoActive {STACKED ULONG MethodID;}; +struct MUIP_GoInacrive {STACKED ULONG MethodID;}; +struct MUIP_HandleEvent {STACKED ULONG MethodID; STACKED struct IntuiMessage *imsg; STACKED LONG muikey;}; +struct MUIP_HandleInput {STACKED ULONG MethodID; STACKED struct IntuiMessage *imsg; STACKED LONG muikey;}; +struct MUIP_Hide {STACKED ULONG MethodID;}; +struct MUIP_Setup {STACKED ULONG MethodID; STACKED struct MUI_RenderInfo *RenderInfo;}; +struct MUIP_Show {STACKED ULONG MethodID;}; + +#define MUIM_Layout (MUIB_Area | 0x00000000) +#define MUIM_DrawParentBackground (MUIB_Area | 0x00000001) +struct MUIP_Layout {STACKED ULONG MethodID;}; +struct MUIP_DrawParentBackground {STACKED ULONG MethodID; STACKED LONG left; STACKED LONG top; STACKED LONG width; STACKED LONG height; STACKED LONG xoffset; STACKED LONG yoffset; STACKED LONG flags;}; + +struct MUI_DragImage +{ + struct BitMap *bm; + WORD width; /* exact width and height of bitmap */ + WORD height; + WORD touchx; /* position of pointer click relative to bitmap */ + WORD touchy; + ULONG flags; +}; + +// #define MUIF_DRAGIMAGE_HASMASK (1<<0) /* Use provided mask for drawing */ /* Not supported at the moment */ +#define MUIF_DRAGIMAGE_SOURCEALPHA (1<<1) /* Use drag image source alpha information for transparrent drawing */ + +/*** Attributes *************************************************************/ +#define MUIA_Background (MUIB_MUI|0x0042545b) /* MUI: V4 is. LONG */ +#define MUIA_BottomEdge (MUIB_MUI|0x0042e552) /* MUI: V4 ..g LONG */ +#define MUIA_ContextMenu (MUIB_MUI|0x0042b704) /* MUI: V11 isg Object * */ +#define MUIA_ContextMenuTrigger (MUIB_MUI|0x0042a2c1) /* MUI: V11 ..g Object * */ +#define MUIA_ControlChar (MUIB_MUI|0x0042120b) /* MUI: V4 isg char */ +#define MUIA_CustomBackfill (MUIB_MUI|0x00420a63) /* undoc i.. */ +#define MUIA_CycleChain (MUIB_MUI|0x00421ce7) /* MUI: V11 isg LONG */ +#define MUIA_Disabled (MUIB_MUI|0x00423661) /* MUI: V4 isg BOOL */ +#define MUIA_Draggable (MUIB_MUI|0x00420b6e) /* MUI: V11 isg BOOL */ +#define MUIA_Dropable (MUIB_MUI|0x0042fbce) /* MUI: V11 isg BOOL */ +#define MUIA_FillArea (MUIB_MUI|0x004294a3) /* MUI: V4 is. BOOL */ +#define MUIA_FixHeight (MUIB_MUI|0x0042a92b) /* MUI: V4 i.. LONG */ +#define MUIA_FixHeightTxt (MUIB_MUI|0x004276f2) /* MUI: V4 i.. STRPTR */ +#define MUIA_FixWidth (MUIB_MUI|0x0042a3f1) /* MUI: V4 i.. LONG */ +#define MUIA_FixWidthTxt (MUIB_MUI|0x0042d044) /* MUI: V4 i.. STRPTR */ +#define MUIA_Font (MUIB_MUI|0x0042be50) /* MUI: V4 i.g struct TextFont * */ +#define MUIA_Frame (MUIB_MUI|0x0042ac64) /* MUI: V4 i.. LONG */ +#define MUIA_FramePhantomHoriz (MUIB_MUI|0x0042ed76) /* MUI: V4 i.. BOOL */ +#define MUIA_FrameTitle (MUIB_MUI|0x0042d1c7) /* MUI: V4 i.. STRPTR */ +#define MUIA_Height (MUIB_MUI|0x00423237) /* MUI: V4 ..g LONG */ +#define MUIA_HorizDisappear (MUIB_MUI|0x00429615) /* MUI: V11 isg LONG */ +#define MUIA_HorizWeight (MUIB_MUI|0x00426db9) /* MUI: V4 isg WORD */ +#define MUIA_InnerBottom (MUIB_MUI|0x0042f2c0) /* MUI: V4 i.g LONG */ +#define MUIA_InnerLeft (MUIB_MUI|0x004228f8) /* MUI: V4 i.g LONG */ +#define MUIA_InnerRight (MUIB_MUI|0x004297ff) /* MUI: V4 i.g LONG */ +#define MUIA_InnerTop (MUIB_MUI|0x00421eb6) /* MUI: V4 i.g LONG */ +#define MUIA_InputMode (MUIB_MUI|0x0042fb04) /* MUI: V4 i.. LONG */ +#define MUIA_LeftEdge (MUIB_MUI|0x0042bec6) /* MUI: V4 ..g LONG */ +#define MUIA_MaxHeight (MUIB_MUI|0x004293e4) /* MUI: V11 i.. LONG */ +#define MUIA_MaxWidth (MUIB_MUI|0x0042f112) /* MUI: V11 i.. LONG */ +#define MUIA_Pressed (MUIB_MUI|0x00423535) /* MUI: V4 ..g BOOL */ +#define MUIA_RightEdge (MUIB_MUI|0x0042ba82) /* MUI: V4 ..g LONG */ +#define MUIA_Selected (MUIB_MUI|0x0042654b) /* MUI: V4 isg BOOL */ +#define MUIA_ShortHelp (MUIB_MUI|0x00428fe3) /* MUI: V11 isg STRPTR */ +#define MUIA_ShowMe (MUIB_MUI|0x00429ba8) /* MUI: V4 isg BOOL */ +#define MUIA_ShowSelState (MUIB_MUI|0x0042caac) /* MUI: V4 i.. BOOL */ +#define MUIA_Timer (MUIB_MUI|0x00426435) /* MUI: V4 ..g LONG */ +#define MUIA_TopEdge (MUIB_MUI|0x0042509b) /* MUI: V4 ..g LONG */ +#define MUIA_VertDisappear (MUIB_MUI|0x0042d12f) /* MUI: V11 isg LONG */ +#define MUIA_VertWeight (MUIB_MUI|0x004298d0) /* MUI: V4 isg WORD */ +#define MUIA_Weight (MUIB_MUI|0x00421d1f) /* MUI: V4 i.. WORD */ +#define MUIA_Width (MUIB_MUI|0x0042b59c) /* MUI: V4 ..g LONG */ +#define MUIA_Window (MUIB_MUI|0x00421591) /* MUI: V4 ..g struct Window * */ +#define MUIA_WindowObject (MUIB_MUI|0x0042669e) /* MUI: V4 ..g Object * */ + +#define MUIA_NestedDisabled (MUIB_Area | 0x00000000) /* Zune 20030530 isg BOOL */ + +#ifdef MUI_OBSOLETE +#define MUIA_ExportID (MUIB_MUI|0x0042d76e) /* V4 isg ULONG */ +#endif /* MUI_OBSOLETE */ + +struct MUI_ImageSpec_intern; + +struct MUI_AreaData +{ + struct MUI_RenderInfo *mad_RenderInfo; /* RenderInfo for this object */ + struct MUI_ImageSpec_intern *mad_Background; /* bg setting - *private* ! */ + struct TextFont *mad_Font; /* Font which is used to draw */ + struct MUI_MinMax mad_MinMax; /* min/max/default dimensions */ + struct IBox mad_Box; /* coordinates and dim of this object after layouted */ + BYTE mad_addleft; /* left offset (frame & innerspacing) */ + BYTE mad_addtop; /* top offset (frame & innerspacing) */ + BYTE mad_subwidth; /* additional width (frame & innerspacing) */ + BYTE mad_subheight; /* additional height (frame & innerspacing) */ + ULONG mad_Flags; /* some flags; see below */ + ULONG mad_Flags2; +// 40 bytes up to here + + /* The following data is private */ +// offset 40 + UWORD mad_HorizWeight; /* weight values for layout. default 100 */ + UWORD mad_VertWeight; +// offset 44 +// ? +// offset 48 + ULONG mad_IDCMP; /* IDCMP flags this listens to (for HandleInput) */ +// offset 52 + CONST_STRPTR mad_BackgroundSpec; +// offset 56 + IPTR mad_FontPreset; /* MUIV_Font_xxx or pointer to struct TextFont */ +// offset 76 + CONST_STRPTR mad_FrameTitle; /* for groups. Req. mad_Frame > 0 */ +// Inner values at offset 88 in MUI: + BYTE mad_InnerLeft; /* frame or hardcoded */ + BYTE mad_InnerTop; + BYTE mad_InnerRight; + BYTE mad_InnerBottom; +// offset 94 + BYTE mad_FrameOBSOLETE; /* frame setting -- private */ +// offset 95 + BYTE mad_InputMode; /* how to react to events */ +// offset 96 + TEXT mad_ControlChar; /* key shortcut */ + BYTE mad_TitleHeightAdd;/* frame title height = mad_TitleBelow + mad_TitleBaseline */ + BYTE mad_TitleHeightBelow; /* height below frame */ + BYTE mad_TitleHeightAbove; /* height above frame */ +// 100 +// ? + IPTR mad_Frame; + WORD mad_HardHeight; /* if harcoded dim (see flags) */ + WORD mad_HardWidth; /* if harcoded dim (see flags) */ + CONST_STRPTR mad_HardWidthTxt; + CONST_STRPTR mad_HardHeightTxt; +// TODO: move SelBack in RenderInfo as it's common for all objects + struct MUI_ImageSpec_intern *mad_SelBack; /* selected state background */ + CONST_STRPTR mad_ShortHelp; /* bubble help */ +// there's an event handler at 114 + struct MUI_EventHandlerNode mad_ehn; + struct MUI_InputHandlerNode mad_Timer; /* MUIA_Timer */ + ULONG mad_Timeval; /* just to trigger notifications */ + struct MUI_EventHandlerNode mad_ccn; /* gross hack for control char */ + Object *mad_ContextMenu; /* menu strip */ + LONG mad_ClickX; /* x position of the initial SELECTDOWN click */ + LONG mad_ClickY; /* y position of the intiial SELECTDOWN click */ + struct ZMenu *mad_ContextZMenu; + struct MUI_EventHandlerNode mad_hiehn; /* Eventhandler to simulate MUIM_HandleInput */ + + LONG mad_DisableCount; /* counts number of disables */ +// only 148 bytes for the struct in MUI ! +}; + +/* Flags during MUIM_Draw */ +#define MADF_DRAWOBJECT (1<< 0) /* draw object completely */ +#define MADF_DRAWUPDATE (1<< 1) /* update object */ + +#define MADF_DRAWALL (1<< 31) + + +/* mad_Flags, private one */ + + +#define MADF_DRAWFLAGS (MADF_DRAWOBJECT | MADF_DRAWUPDATE | MADF_DRAW_XXX \ + | MADF_DRAWFRAME | MADF_DRAW_XXX_2 | MADF_DRAWALL) + + +// offset 94 (byte) (frame << 1) (lsb is SETUP_DONE flag) +enum { + MUIV_Frame_None = 0, + MUIV_Frame_Button, + MUIV_Frame_ImageButton, + MUIV_Frame_Text, + MUIV_Frame_String, + MUIV_Frame_ReadList, + MUIV_Frame_InputList, + MUIV_Frame_Prop, + MUIV_Frame_Gauge, + MUIV_Frame_Group, + MUIV_Frame_PopUp, + MUIV_Frame_Virtual, + MUIV_Frame_Slider, + MUIV_Frame_Knob, + MUIV_Frame_Drag, + MUIV_Frame_Count, +}; + +// offset 95 +enum { + MUIV_InputMode_None = 0, // 0x00 + MUIV_InputMode_RelVerify, // 0x40 (1<<6) + MUIV_InputMode_Immediate, // 0x80 (1<<7) + MUIV_InputMode_Toggle, // 0xc0 (1<<7 | 1<<6) +}; + + + +enum { + MUIV_DragQuery_Refuse = 0, + MUIV_DragQuery_Accept, +}; + +enum { + MUIV_DragReport_Abort = 0, + MUIV_DragReport_Continue, + MUIV_DragReport_Lock, + MUIV_DragReport_Refresh, +}; + +#define MUIV_CreateBubble_DontHidePointer (1<<0) + +/* A private functions and macros */ +void __area_finish_minmax(Object *obj, struct MUI_MinMax *MinMaxInfo); + +/*#define DRAW_BG_RECURSIVE (1<<1)*/ + + +#endif /* _MUI_CLASSES_AREA_H */ +#endif + +#ifndef _MUI_CLASSES_GROUP_H +#ifndef _MUI_CLASSES_GROUP_H +#define _MUI_CLASSES_GROUP_H + +/* + Copyright © 1999, David Le Corfec. + Copyright © 2002-2003, The AROS Development Team. + All rights reserved. + + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Group "Group.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Group (MUIB_ZUNE | 0x00001000) + +/*** Methods ****************************************************************/ +#define MUIM_Group_ExitChange (MUIB_MUI|0x0042d1cc) /* MUI: V11 */ +#define MUIM_Group_InitChange (MUIB_MUI|0x00420887) /* MUI: V11 */ +#define MUIM_Group_Sort (MUIB_MUI|0x00427417) /* MUI: V4 */ +struct MUIP_Group_ExitChange {STACKED ULONG MethodID;}; +struct MUIP_Group_InitChange {STACKED ULONG MethodID;}; +struct MUIP_Group_Sort {STACKED ULONG MethodID; STACKED Object *obj[1];}; + +#define MUIM_Group_DoMethodNoForward (MUIB_Group | 0x00000000) +struct MUIP_Group_DoMethodNoForward {STACKED ULONG MethodID; STACKED ULONG DoMethodID; }; /* msg stuff follows */ + +/*** Attributes *************************************************************/ +#define MUIA_Group_ActivePage (MUIB_MUI|0x00424199) /* MUI: V5 isg LONG */ +#define MUIA_Group_Child (MUIB_MUI|0x004226e6) /* MUI: V4 i.. Object * */ +#define MUIA_Group_ChildList (MUIB_MUI|0x00424748) /* MUI: V4 ..g struct List * */ +#define MUIA_Group_Columns (MUIB_MUI|0x0042f416) /* MUI: V4 is. LONG */ +#define MUIA_Group_Forward (MUIB_MUI|0x00421422) /* MUI: V11 .s. BOOL */ +#define MUIA_Group_Horiz (MUIB_MUI|0x0042536b) /* MUI: V4 i.. BOOL */ +#define MUIA_Group_HorizSpacing (MUIB_MUI|0x0042c651) /* MUI: V4 isg LONG */ +#define MUIA_Group_LayoutHook (MUIB_MUI|0x0042c3b2) /* MUI: V11 i.. struct Hook * */ +#define MUIA_Group_PageMode (MUIB_MUI|0x00421a5f) /* MUI: V5 i.. BOOL */ +#define MUIA_Group_Rows (MUIB_MUI|0x0042b68f) /* MUI: V4 is. LONG */ +#define MUIA_Group_SameHeight (MUIB_MUI|0x0042037e) /* MUI: V4 i.. BOOL */ +#define MUIA_Group_SameSize (MUIB_MUI|0x00420860) /* MUI: V4 i.. BOOL */ +#define MUIA_Group_SameWidth (MUIB_MUI|0x0042b3ec) /* MUI: V4 i.. BOOL */ +#define MUIA_Group_Spacing (MUIB_MUI|0x0042866d) /* MUI: V4 is. LONG */ +#define MUIA_Group_VertSpacing (MUIB_MUI|0x0042e1bf) /* MUI: V4 isg LONG */ + +#define MUIA_Group_Virtual (MUIB_Group | 0x00000000) /* Zune: V1 i.. BOOL */ + +enum { + MUIV_Group_ActivePage_First = 0, + MUIV_Group_ActivePage_Last = -1, + MUIV_Group_ActivePage_Prev = -2, + MUIV_Group_ActivePage_Next = -3, + MUIV_Group_ActivePage_Advance = -4, +}; + +/* This is the message you get if your custom layout hook is called */ +struct MUI_LayoutMsg +{ + STACKED ULONG lm_Type; /* the message type */ + STACKED struct MinList *lm_Children; /* exec list of the children of this group */ + STACKED struct MUI_MinMax lm_MinMax; /* here you have to place the MUILM_MINMAX results */ + struct + { + STACKED LONG Width; + STACKED LONG Height; + STACKED ULONG priv5; + STACKED ULONG priv6; + } lm_Layout; /* size (and result) for MUILM_LAYOUT */ +}; + +/* lm_Type */ +enum +{ + MUILM_MINMAX = 1, /* Please calc your min & max siizes */ + MUILM_LAYOUT = 2, /* Please layout your children */ +}; + +#define MUILM_UNKNOWN -1 /* should be returned if the hook function doesn't understand lm_Type */ + + + +#endif /* _MUI_CLASSES_GROUP_H */ +#endif + +#ifndef _MUI_CLASSES_RECTANGLE_H +#ifndef _MUI_CLASSES_RECTANGLE_H +#define _MUI_CLASSES_RECTANGLE_H + +/* + Copyright © 1999, David Le Corfec. + Copyright © 2002-2003, The AROS Development Team. + All rights reserved. + + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Rectangle "Rectangle.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Rectangle (MUIB_ZUNE | 0x00002b00) + +/*** Attributes *************************************************************/ +#define MUIA_Rectangle_BarTitle (MUIB_MUI|0x00426689) /* V11 i.g STRPTR */ +#define MUIA_Rectangle_HBar (MUIB_MUI|0x0042c943) /* V7 i.g BOOL */ +#define MUIA_Rectangle_VBar (MUIB_MUI|0x00422204) /* V7 i.g BOOL */ + + +#endif /* _MUI_CLASSES_RECTANGLE_H */ +#endif + +#ifndef _MUI_CLASSES_TEXT_H +#ifndef _MUI_CLASSES_TEXT_H +#define _MUI_CLASSES_TEXT_H + +/* + Copyright © 1999, David Le Corfec. + Copyright © 2002-2003, The AROS Development Team. + All rights reserved. + + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Text "Text.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Text (MUIB_ZUNE | 0x00003500) + +/*** Attributes *************************************************************/ +#define MUIA_Text_Contents (MUIB_MUI|0x0042f8dc) /* MUI: V4 isg STRPTR */ +#define MUIA_Text_HiChar (MUIB_MUI|0x004218ff) /* MUI: V4 i.. char */ +#define MUIA_Text_HiCharIdx (MUIB_MUI|0x004214f5) /* i.. char */ +#define MUIA_Text_PreParse (MUIB_MUI|0x0042566d) /* MUI: V4 isg STRPTR */ +#define MUIA_Text_SetMax (MUIB_MUI|0x00424d0a) /* MUI: V4 i.. BOOL */ +#define MUIA_Text_SetMin (MUIB_MUI|0x00424e10) /* MUI: V4 i.. BOOL */ +#define MUIA_Text_SetVMax (MUIB_MUI|0x00420d8b) /* MUI: V11 i.. BOOL */ + +#define MUIA_Text_Editable (MUIB_Text | 0x00000000) /* DEPRECATED */ +#define MUIA_Text_Multiline (MUIB_Text | 0x00000001) /* DEPRECATED */ + +/* Codes which can be used in text strings */ +#define MUIX_L "\033l" /* justify left */ +#define MUIX_C "\033c" /* justify centered */ +#define MUIX_R "\033r" /* justify right */ + +#define MUIX_N "\033n" /* normal style */ +#define MUIX_B "\033b" /* bold style */ +#define MUIX_I "\033i" /* italic style */ +#define MUIX_U "\033u" /* underlined style */ + +#define MUIX_PT "\0332" /* use text pen */ +#define MUIX_PH "\0338" /* use highlight text pen */ + + + +#endif /* _MUI_CLASSES_TEXT_H */ +#endif + +#ifndef _MUI_CLASSES_NUMERIC_H +#ifndef _MUI_CLASSES_NUMERIC_H +#define _MUI_CLASSES_NUMERIC_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Numeric "Numeric.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Numeric (MUIB_ZUNE | 0x00001e00) + +/*** Methods ****************************************************************/ +#define MUIM_Numeric_Decrease (MUIB_MUI|0x004243a7) /* MUI: V11 */ +#define MUIM_Numeric_Increase (MUIB_MUI|0x00426ecd) /* MUI: V11 */ +#define MUIM_Numeric_ScaleToValue (MUIB_MUI|0x0042032c) /* MUI: V11 */ +#define MUIM_Numeric_SetDefault (MUIB_MUI|0x0042ab0a) /* MUI: V11 */ +#define MUIM_Numeric_Stringify (MUIB_MUI|0x00424891) /* MUI: V11 */ +#define MUIM_Numeric_ValueToScale (MUIB_MUI|0x00423e4f) /* MUI: V11 */ +struct MUIP_Numeric_Decrease {STACKED ULONG MethodID; STACKED LONG amount;}; +struct MUIP_Numeric_Increase {STACKED ULONG MethodID; STACKED LONG amount;}; +struct MUIP_Numeric_ScaleToValue {STACKED ULONG MethodID; STACKED LONG scalemin; STACKED LONG scalemax; STACKED LONG scale;}; +struct MUIP_Numeric_SetDefault {STACKED ULONG MethodID;}; +struct MUIP_Numeric_Stringify {STACKED ULONG MethodID; STACKED LONG value;}; +struct MUIP_Numeric_ValueToScale {STACKED ULONG MethodID; STACKED LONG scalemin; STACKED LONG scalemax;}; + +/*** Attributes *************************************************************/ +#define MUIA_Numeric_CheckAllSizes (MUIB_MUI|0x00421594) /* MUI: V11 isg BOOL */ +#define MUIA_Numeric_Default (MUIB_MUI|0x004263e8) /* MUI: V11 isg LONG */ +#define MUIA_Numeric_Format (MUIB_MUI|0x004263e9) /* MUI: V11 isg STRPTR */ +#define MUIA_Numeric_Max (MUIB_MUI|0x0042d78a) /* MUI: V11 isg LONG */ +#define MUIA_Numeric_Min (MUIB_MUI|0x0042e404) /* MUI: V11 isg LONG */ +#define MUIA_Numeric_Reverse (MUIB_MUI|0x0042f2a0) /* MUI: V11 isg BOOL */ +#define MUIA_Numeric_RevLeftRight (MUIB_MUI|0x004294a7) /* MUI: V11 isg BOOL */ +#define MUIA_Numeric_RevUpDown (MUIB_MUI|0x004252dd) /* MUI: V11 isg BOOL */ +#define MUIA_Numeric_Value (MUIB_MUI|0x0042ae3a) /* MUI: V11 isg LONG */ + +#define MUIM_Numeric_ValueToScaleExt (MUIB_Numeric | 0x00000000) /* ZUNE only */ +struct MUIP_Numeric_ValueToScaleExt {STACKED ULONG MethodID; STACKED LONG value; STACKED LONG scalemin; STACKED LONG scalemax;}; + + +#endif /* _MUI_CLASSES_NUMERIC_H */ +#endif + +#ifndef _MUI_CLASSES_SLIDER_H +#ifndef _MUI_CLASSES_SLIDER_H +#define _MUI_CLASSES_SLIDER_H + +/* + Copyright © 1999, David Le Corfec. + Copyright © 2002-2003, The AROS Development Team. + All rights reserved. + + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Slider "Slider.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Slider (MUIB_ZUNE | 0x00003300) + +/*** Attributes *************************************************************/ +#define MUIA_Slider_Horiz (MUIB_MUI|0x0042fad1) /* V11 isg BOOL */ +#define MUIA_Slider_Quiet (MUIB_MUI|0x00420b26) /* V6 i.. BOOL */ + +#ifdef MUI_OBSOLETE +#define MUIA_Slider_Level (MUIB_MUI|0x0042ae3a) /* V4 isg LONG */ +#define MUIA_Slider_Max (MUIB_MUI|0x0042d78a) /* V4 isg LONG */ +#define MUIA_Slider_Min (MUIB_MUI|0x0042e404) /* V4 isg LONG */ +#define MUIA_Slider_Reverse (MUIB_MUI|0x0042f2a0) /* V4 isg BOOL */ +#endif /* MUI_OBSOLETE */ + + + +#endif /* _MUI_CLASSES_SLIDER_H */ +#endif + +#ifndef _MUI_CLASSES_STRING_H +#ifndef _MUI_CLASSES_STRING_H +#define _MUI_CLASSES_STRING_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_String "String.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_String (MUIB_ZUNE | 0x00003400) + +/*** Attributes *************************************************************/ +#define MUIA_String_Accept (MUIB_MUI|0x0042e3e1) /* V4 isg STRPTR */ +#define MUIA_String_Acknowledge (MUIB_MUI|0x0042026c) /* V4 ..g STRPTR */ +#define MUIA_String_AdvanceOnCR (MUIB_MUI|0x004226de) /* V11 isg BOOL */ +#define MUIA_String_AttachedList (MUIB_MUI|0x00420fd2) /* V4 isg Object * */ +#define MUIA_String_BufferPos (MUIB_MUI|0x00428b6c) /* V4 .sg LONG */ +#define MUIA_String_Contents (MUIB_MUI|0x00428ffd) /* V4 isg STRPTR */ +#define MUIA_String_DisplayPos (MUIB_MUI|0x0042ccbf) /* V4 .sg LONG */ +#define MUIA_String_EditHook (MUIB_MUI|0x00424c33) /* V7 isg struct Hook * */ +#define MUIA_String_Format (MUIB_MUI|0x00427484) /* V4 i.g LONG */ +#define MUIA_String_Integer (MUIB_MUI|0x00426e8a) /* V4 isg ULONG */ +#define MUIA_String_LonelyEditHook (MUIB_MUI|0x00421569) /* V11 isg BOOL */ +#define MUIA_String_MaxLen (MUIB_MUI|0x00424984) /* V4 i.g LONG */ +#define MUIA_String_Reject (MUIB_MUI|0x0042179c) /* V4 isg STRPTR */ +#define MUIA_String_Secret (MUIB_MUI|0x00428769) /* V4 i.g BOOL */ + +enum { + MUIV_String_Format_Left = 0, + MUIV_String_Format_Center, + MUIV_String_Format_Right, +}; + +/* Extended features taken over from Alan Odgaard's BetterString MCC. + Attribute and method IDs match those of BetterString class. */ + +#define MUIA_String_Columns 0xad001005 +#define MUIA_String_NoInput 0xad001007 +#define MUIA_String_SelectSize 0xad001001 +#define MUIA_String_StayActive 0xad001003 +#define MUIA_String_KeyUpFocus 0xad001008 +#define MUIA_String_KeyDownFocus 0xad001009 + +#define MUIM_String_ClearSelected 0xad001004 +#define MUIM_String_FileNameStart 0xad001006 +#define MUIM_String_Insert 0xad001002 + +#define MUIV_String_Insert_StartOfString 0x00000000 +#define MUIV_String_Insert_EndOfString 0xfffffffe +#define MUIV_String_Insert_BufferPos 0xffffffff +#define MUIV_String_BufferPos_End 0xffffffff + +#define MUIR_String_FileNameStart_Volume 0xffffffff + +struct MUIP_String_ClearSelected {STACKED ULONG MethodID;}; +struct MUIP_String_FileNameStart {STACKED ULONG MethodID; STACKED STRPTR buffer; STACKED LONG pos;}; +struct MUIP_String_Insert {STACKED ULONG MethodID; STACKED STRPTR text; STACKED LONG pos;}; + + +#endif /* _MUI_CLASSES_STRING_H */ +#endif + +#ifndef _MUI_CLASSES_BOOPSI_H +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#ifndef _MUI_CLASSES_BOOPSI_H +#define _MUI_CLASSES_BOOPSI_H + +/*** Name *******************************************************************/ +#define MUIC_Boopsi "Boopsi.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Boopsi (MUIB_ZUNE | 0x00000600) + +/*** Attributes *************************************************************/ +#define MUIA_Boopsi_Class (MUIB_MUI|0x00426999) /* V4 isg struct IClass * */ +#define MUIA_Boopsi_ClassID (MUIB_MUI|0x0042bfa3) /* V4 isg char * */ +#define MUIA_Boopsi_MaxHeight (MUIB_MUI|0x0042757f) /* V4 isg ULONG */ +#define MUIA_Boopsi_MaxWidth (MUIB_MUI|0x0042bcb1) /* V4 isg ULONG */ +#define MUIA_Boopsi_MinHeight (MUIB_MUI|0x00422c93) /* V4 isg ULONG */ +#define MUIA_Boopsi_MinWidth (MUIB_MUI|0x00428fb2) /* V4 isg ULONG */ +#define MUIA_Boopsi_Object (MUIB_MUI|0x00420178) /* V4 ..g Object * */ +#define MUIA_Boopsi_Remember (MUIB_MUI|0x0042f4bd) /* V4 i.. ULONG */ +#define MUIA_Boopsi_Smart (MUIB_MUI|0x0042b8d7) /* V9 i.. BOOL */ +#define MUIA_Boopsi_TagDrawInfo (MUIB_MUI|0x0042bae7) /* V4 isg ULONG */ +#define MUIA_Boopsi_TagScreen (MUIB_MUI|0x0042bc71) /* V4 isg ULONG */ +#define MUIA_Boopsi_TagWindow (MUIB_MUI|0x0042e11d) /* V4 isg ULONG */ + + + + +#endif /* _MUI_CLASSES_BOOPSI_H */ +#endif + +#ifndef _MUI_CLASSES_PROP_H +#ifndef _MUI_CLASSES_PROP_H +#define _MUI_CLASSES_PROP_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Prop "Prop.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Prop (MUIB_ZUNE | 0x00002900) + +/*** Methods ****************************************************************/ +#define MUIM_Prop_Decrease (MUIB_MUI|0x00420dd1) /* MUI: V16 */ +#define MUIM_Prop_Increase (MUIB_MUI|0x0042cac0) /* MUI: V16 */ +struct MUIP_Prop_Decrease {STACKED ULONG MethodID; STACKED LONG amount;}; +struct MUIP_Prop_Increase {STACKED ULONG MethodID; STACKED LONG amount;}; + +/*** Attributes *************************************************************/ +#define MUIA_Prop_Entries (MUIB_MUI|0x0042fbdb) /* MUI: V4 isg LONG */ +#define MUIA_Prop_First (MUIB_MUI|0x0042d4b2) /* MUI: V4 isg LONG */ +#define MUIA_Prop_Horiz (MUIB_MUI|0x0042f4f3) /* MUI: V4 i.g BOOL */ +#define MUIA_Prop_Slider (MUIB_MUI|0x00429c3a) /* MUI: V4 isg BOOL */ +#define MUIA_Prop_UseWinBorder (MUIB_MUI|0x0042deee) /* MUI: V13 i.. LONG */ +#define MUIA_Prop_Visible (MUIB_MUI|0x0042fea6) /* MUI: V4 isg LONG */ + + +enum +{ + MUIV_Prop_UseWinBorder_None = 0, + MUIV_Prop_UseWinBorder_Left, + MUIV_Prop_UseWinBorder_Right, + MUIV_Prop_UseWinBorder_Bottom, +}; + +#define MUIA_Prop_DeltaFactor (MUIB_MUI|0x00427c5e) /* MUI: is. LONG */ +#define MUIA_Prop_DoSmooth (MUIB_MUI|0x004236ce) /* MUI: V4 i.. LONG */ + + + +#endif /* _MUI_CLASSES_PROP_H */ +#endif + +#ifndef _MUI_CLASSES_SCROLLBAR_H +#ifndef _MUI_CLASSES_SCROLLBAR_H +#define _MUI_CLASSES_SCROLLBAR_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Scrollbar "Scrollbar.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Scrollbar (MUIB_ZUNE | 0x00002e00) + +/*** Attributes *************************************************************/ +#define MUIA_Scrollbar_Type (MUIB_MUI|0x0042fb6b) /* V11 i.. LONG */ + +enum +{ + MUIV_Scrollbar_Type_Default = 0, + MUIV_Scrollbar_Type_Bottom, + MUIV_Scrollbar_Type_Top, + MUIV_Scrollbar_Type_Sym, +}; + + + +#endif /* _MUI_CLASSES_SCROLLBAR_H */ +#endif + +#ifndef _MUI_CLASSES_REGISTER_H +#ifndef _MUI_CLASSES_REGISTER_H +#define _MUI_CLASSES_REGISTER_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Register "Register.mui" + +/*** Identifier base (for Zune extensions) *********************************/ +#define MUIB_Register (MUIB_ZUNE | 0x00002c00) + +/*** Attributes *************************************************************/ +#define MUIA_Register_Frame (MUIB_MUI|0x0042349b) /* V7 i.g BOOL */ +#define MUIA_Register_Titles (MUIB_MUI|0x004297ec) /* V7 i.g STRPTR * */ + +#define MUIA_Register_Columns (MUIB_Register | 0x0000) /* Zune V1 i.. */ + + + +#endif /* _MUI_CLASSES_REGISTER_H */ +#endif + +#ifndef _MUI_CLASSES_MENUITEM_H +#ifndef _MUI_CLASSES_MENUITEM_H +#define _MUI_CLASSES_MENUITEM_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/****************************************************************************/ +/*** Name *******************************************************************/ +#define MUIC_Menustrip "Menustrip.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Menustrip (MUIB_ZUNE | 0x00001a00) + +/*** Attributes *************************************************************/ +#define MUIA_Menustrip_Enabled (MUIB_MUI|0x0042815b) /* MUI: V8 isg BOOL */ + + + +/****************************************************************************/ +/*** Name *******************************************************************/ +#define MUIC_Menu "Menu.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Menu (MUIB_ZUNE | 0x00001b00) + +/*** Attributes *************************************************************/ +#define MUIA_Menu_Enabled (MUIB_MUI|0x0042ed48) /* MUI: V8 isg BOOL */ +#define MUIA_Menu_Title (MUIB_MUI|0x0042a0e3) /* MUI: V8 isg STRPTR */ + + + +/****************************************************************************/ +/*** Name *******************************************************************/ +#define MUIC_Menuitem "Menuitem.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Menuitem (MUIB_ZUNE | 0x00001c00) + +/*** Attributes *************************************************************/ +#define MUIA_Menuitem_Checked (MUIB_MUI|0x0042562a) /* MUI: V8 isg BOOL */ +#define MUIA_Menuitem_Checkit (MUIB_MUI|0x00425ace) /* MUI: V8 isg BOOL */ +#define MUIA_Menuitem_CommandString (MUIB_MUI|0x0042b9cc) /* MUI: V16 isg BOOL */ +#define MUIA_Menuitem_Enabled (MUIB_MUI|0x0042ae0f) /* MUI: V8 isg BOOL */ +#define MUIA_Menuitem_Exclude (MUIB_MUI|0x00420bc6) /* MUI: V8 isg LONG */ +#define MUIA_Menuitem_Shortcut (MUIB_MUI|0x00422030) /* MUI: V8 isg STRPTR */ +#define MUIA_Menuitem_Title (MUIB_MUI|0x004218be) /* MUI: V8 isg STRPTR */ +#define MUIA_Menuitem_Toggle (MUIB_MUI|0x00424d5c) /* MUI: V8 isg BOOL */ +#define MUIA_Menuitem_Trigger (MUIB_MUI|0x00426f32) /* MUI: V8 ..g struct MenuItem * */ + +#define MUIA_Menuitem_NewMenu (MUIB_Menuitem | 0x00000000) /* Zune: V1 ..g struct NewMenu * */ + + +#define MUIV_Menuitem_Shortcut_Check (-1) + + + +#endif /* _MUI_CLASSES_MENUITEM_H */ +#endif + +#ifndef _MUI_CLASSES_DATASPACE_H +#ifndef _MUI_CLASSES_DATASPACE_H +#define _MUI_CLASSES_DATASPACE_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Dataspace "Dataspace.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Dataspace (MUIB_ZUNE | 0x00000b00) + + +/*** Methods ****************************************************************/ +#define MUIM_Dataspace_Add (MUIB_MUI|0x00423366) /* MUI: V11 */ +#define MUIM_Dataspace_Clear (MUIB_MUI|0x0042b6c9) /* MUI: V11 */ +#define MUIM_Dataspace_Find (MUIB_MUI|0x0042832c) /* MUI: V11 */ +#define MUIM_Dataspace_Merge (MUIB_MUI|0x00423e2b) /* MUI: V11 */ +#define MUIM_Dataspace_ReadIFF (MUIB_MUI|0x00420dfb) /* MUI: V11 */ +#define MUIM_Dataspace_Remove (MUIB_MUI|0x0042dce1) /* MUI: V11 */ +#define MUIM_Dataspace_WriteIFF (MUIB_MUI|0x00425e8e) /* MUI: V11 */ +struct MUIP_Dataspace_Add {STACKED ULONG MethodID; STACKED APTR data; STACKED LONG len; STACKED ULONG id;}; +struct MUIP_Dataspace_Clear {STACKED ULONG MethodID;}; +struct MUIP_Dataspace_Find {STACKED ULONG MethodID; STACKED ULONG id;}; +struct MUIP_Dataspace_Merge {STACKED ULONG MethodID; STACKED Object *dataspace;}; +struct MUIP_Dataspace_ReadIFF {STACKED ULONG MethodID; STACKED struct IFFHandle *handle;}; +struct MUIP_Dataspace_Remove {STACKED ULONG MethodID; STACKED ULONG id;}; +struct MUIP_Dataspace_WriteIFF {STACKED ULONG MethodID; STACKED struct IFFHandle *handle; STACKED ULONG type; STACKED ULONG id;}; + +/*** Attributes *************************************************************/ +#define MUIA_Dataspace_Pool (MUIB_MUI|0x00424cf9) /* MUI: V11 i.. APTR */ + + + +#endif /* _MUI_CLASSES_DATASPACE_H */ +#endif + +#ifndef _MUI_CLASSES_VIRTGROUP_H +#ifndef _MUI_CLASSES_VIRTGROUP_H +#define _MUI_CLASSES_VIRTGROUP_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Virtgroup "Virtgroup.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Virtgroup (MUIB_ZUNE | 0x00003700) + +/*** Attributes *************************************************************/ +#define MUIA_Virtgroup_Height (MUIB_MUI|0x00423038) /* V6 ..g LONG */ +#define MUIA_Virtgroup_Input (MUIB_MUI|0x00427f7e) /* V11 i.. BOOL */ +#define MUIA_Virtgroup_Left (MUIB_MUI|0x00429371) /* V6 isg LONG */ +#define MUIA_Virtgroup_Top (MUIB_MUI|0x00425200) /* V6 isg LONG */ +#define MUIA_Virtgroup_Width (MUIB_MUI|0x00427c49) /* V6 ..g LONG */ + + + + +#endif /* _MUI_CLASSES_VIRTGROUP_H */ +#endif + +#ifndef _MUI_CLASSES_SCROLLGROUP_H +#ifndef _MUI_CLASSES_SCROLLGROUP_H +#define _MUI_CLASSES_SCROLLGROUP_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Scrollgroup "Scrollgroup.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Scrollgroup (MUIB_ZUNE | 0x00002f00) + +/*** Attributes *************************************************************/ +#define MUIA_Scrollgroup_Contents (MUIB_MUI|0x00421261) /* V4 i.g Object * */ +#define MUIA_Scrollgroup_FreeHoriz (MUIB_MUI|0x004292f3) /* V9 i.. BOOL */ +#define MUIA_Scrollgroup_FreeVert (MUIB_MUI|0x004224f2) /* V9 i.. BOOL */ +#define MUIA_Scrollgroup_HorizBar (MUIB_MUI|0x0042b63d) /* V16 ..g Object * */ +#define MUIA_Scrollgroup_UseWinBorder (MUIB_MUI|0x004284c1) /* V13 i.. BOOL */ +#define MUIA_Scrollgroup_VertBar (MUIB_MUI|0x0042cdc0) /* V16 ..g Object * */ + + + +#endif /* _MUI_CLASSES_SCROLLGROUP_H */ +#endif + +#ifndef _MUI_CLASSES_SCROLLBUTTON_H +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#ifndef _MUI_CLASSES_SCROLLBUTTON_H +#define _MUI_CLASSES_SCROLLBUTTON_H + +/*** Name *******************************************************************/ +#define MUIC_Scrollbutton "Scrollbutton.mui" + +/*** Identifier base ********************************************************/ +#define MUIB_Scrollbutton (MUIB_ZUNE | 0x00004100) + +/*** Attributes *************************************************************/ +#define MUIA_Scrollbutton_NewPosition (MUIB_Scrollbutton | 0x00000000) /* --G ULONG (2 x WORD) */ +#define MUIA_Scrollbutton_Horiz (MUIB_Scrollbutton | 0x00000001) /* -SG WORD */ +#define MUIA_Scrollbutton_Vert (MUIB_Scrollbutton | 0x00000002) /* -SG WORD */ +#define MUIA_Scrollbutton_HorizProp (MUIB_Scrollbutton | 0x00000003) /* --G Object * */ +#define MUIA_Scrollbutton_VertProp (MUIB_Scrollbutton | 0x00000004) /* --G Object * */ + +/*** Macros *****************************************************************/ +#define ScrollbuttonObject MUIOBJMACRO_START(MUIC_Scrollbutton) + + +#endif /* _MUI_CLASSES_SCROLLBUTTON_H */ +#endif + +#ifndef _MUI_CLASSES_SEMAPHORE_H +#ifndef _MUI_CLASSES_SEMAPHORE_H +#define _MUI_CLASSES_SEMAPHORE_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Semaphore "Semaphore.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Semaphore (MUIB_ZUNE | 0x00003000) + +/*** Methods ****************************************************************/ +#define MUIM_Semaphore_Attempt (MUIB_MUI|0x00426ce2) /* MUI: V11 */ +#define MUIM_Semaphore_AttemptShared (MUIB_MUI|0x00422551) /* MUI: V11 */ +#define MUIM_Semaphore_Obtain (MUIB_MUI|0x004276f0) /* MUI: V11 */ +#define MUIM_Semaphore_ObtainShared (MUIB_MUI|0x0042ea02) /* MUI: V11 */ +#define MUIM_Semaphore_Release (MUIB_MUI|0x00421f2d) /* MUI: V11 */ +struct MUIP_Semaphore_Attempt {STACKED ULONG MethodID;}; +struct MUIP_Semaphore_AttemptShared {STACKED ULONG MethodID;}; +struct MUIP_Semaphore_Obtain {STACKED ULONG MethodID;}; +struct MUIP_Semaphore_ObtainShared {STACKED ULONG MethodID;}; +struct MUIP_Semaphore_Release {STACKED ULONG MethodID;}; + + + +#endif /* _MUI_CLASSES_SEMAPHORE_H */ +#endif + +#ifndef _MUI_CLASSES_BITMAP_H +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#ifndef _MUI_CLASSES_BITMAP_H +#define _MUI_CLASSES_BITMAP_H + +/*** Name *******************************************************************/ +#define MUIC_Bitmap "Bitmap.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Bitmap (MUIB_ZUNE | 0x00000400) + +/*** Attributes *************************************************************/ +#define MUIA_Bitmap_Bitmap (MUIB_MUI|0x004279bd) /* MUI: V8 isg struct BitMap * */ +#define MUIA_Bitmap_Height (MUIB_MUI|0x00421560) /* MUI: V8 isg LONG */ +#define MUIA_Bitmap_MappingTable (MUIB_MUI|0x0042e23d) /* MUI: V8 isg UBYTE * */ +#define MUIA_Bitmap_Precision (MUIB_MUI|0x00420c74) /* MUI: V11 isg LONG */ +#define MUIA_Bitmap_RemappedBitmap (MUIB_MUI|0x00423a47) /* MUI: V11 ..g struct BitMap * */ +#define MUIA_Bitmap_SourceColors (MUIB_MUI|0x00425360) /* MUI: V8 isg ULONG * */ +#define MUIA_Bitmap_Transparent (MUIB_MUI|0x00422805) /* MUI: V8 isg LONG */ +#define MUIA_Bitmap_UseFriend (MUIB_MUI|0x004239d8) /* MUI: V11 i.. BOOL */ +#define MUIA_Bitmap_Width (MUIB_MUI|0x0042eb3a) /* MUI: V8 isg LONG */ + + +#endif /* _MUI_CLASSES_BITMAP_H */ +#endif + +#ifndef _MUI_CLASSES_BODYCHUNK_H +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#ifndef _MUI_CLASSES_BODYCHUNK_H +#define _MUI_CLASSES_BODYCHUNK_H + +/*** Name *******************************************************************/ +#define MUIC_Bodychunk "Bodychunk.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Bodychunk (MUIB_ZUNE | 0x00000500) + +/*** Attributes *************************************************************/ +#define MUIA_Bodychunk_Body (MUIB_MUI|0x0042ca67) /* V8 isg UBYTE * */ +#define MUIA_Bodychunk_Compression (MUIB_MUI|0x0042de5f) /* V8 isg UBYTE */ +#define MUIA_Bodychunk_Depth (MUIB_MUI|0x0042c392) /* V8 isg LONG */ +#define MUIA_Bodychunk_Masking (MUIB_MUI|0x00423b0e) /* V8 isg UBYTE */ + + + +#endif /* _MUI_CLASSES_BODYCHUNK_H */ +#endif + +#ifndef _MUI_CLASSES_CHUNKYIMAGE_H +#ifndef _MUI_CLASSES_CHUNKYIMAGE_H +#define _MUI_CLASSES_CHUNKYIMAGE_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_ChunkyImage "ChunkyImage.mui" + +/*** Identifier base ********************************************************/ +#define MUIB_ChunkyImage (MUIB_ZUNE | 0x00004000) + +/*** Attributes *************************************************************/ +#define MUIA_ChunkyImage_Pixels (MUIB_ChunkyImage | 0x00000000) /* V8 isg UBYTE * */ +#define MUIA_ChunkyImage_Palette (MUIB_ChunkyImage | 0x00000001) /* V8 isg UBYTE * */ +#define MUIA_ChunkyImage_NumColors (MUIB_ChunkyImage | 0x00000002) /* V8 isg LONG */ +#define MUIA_ChunkyImage_Modulo (MUIB_ChunkyImage | 0x00000003) /* V8 isg LONG */ + + + +#endif /* _MUI_CLASSES_CHUNKYIMAGE_H */ +#endif + +#ifndef _MUI_CLASSES_LISTVIEW_H +#ifndef _CLASSES_LISTVIEW_H +#define _CLASSES_LISTVIEW_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Listview "Listview.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Listview (MUIB_ZUNE | 0x00001900) + +/*** Attributes *************************************************************/ +#define MUIA_Listview_ClickColumn (MUIB_MUI|0x0042d1b3) /* V7 ..g LONG */ +#define MUIA_Listview_DefClickColumn (MUIB_MUI|0x0042b296) /* V7 isg LONG */ +#define MUIA_Listview_DoubleClick (MUIB_MUI|0x00424635) /* V4 i.g BOOL */ +#define MUIA_Listview_DragType (MUIB_MUI|0x00425cd3) /* V11 isg LONG */ +#define MUIA_Listview_Input (MUIB_MUI|0x0042682d) /* V4 i.. BOOL */ +#define MUIA_Listview_List (MUIB_MUI|0x0042bcce) /* V4 i.g Object */ +#define MUIA_Listview_MultiSelect (MUIB_MUI|0x00427e08) /* V7 i.. LONG */ +#define MUIA_Listview_ScrollerPos (MUIB_MUI|0x0042b1b4) /* V10 i.. BOOL */ +#define MUIA_Listview_SelectChange (MUIB_MUI|0x0042178f) /* V4 ..g BOOL */ + +enum +{ + MUIV_Listview_DragType_None = 0, + MUIV_Listview_DragType_Immediate, +}; + +enum +{ + MUIV_Listview_MultiSelect_None = 0, + MUIV_Listview_MultiSelect_Default, + MUIV_Listview_MultiSelect_Shifted, + MUIV_Listview_MultiSelect_Always, +}; + +enum +{ + MUIV_Listview_ScrollerPos_Default = 0, + MUIV_Listview_ScrollerPos_Left, + MUIV_Listview_ScrollerPos_Right, + MUIV_Listview_ScrollerPos_None, +}; + + + +#endif /* _CLASSES_LISTVIEW_H */ +#endif + +#ifndef _MUI_CLASSES_LIST_H +#ifndef _MUI_CLASSES_LIST_H +#define _MUI_CLASSES_LIST_H + +/* + Copyright © 2002-2011, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/****************************************************************************/ +/*** Name *******************************************************************/ +#define MUIC_List "List.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_List (MUIB_ZUNE | 0x00001400) + +/*** Methods ****************************************************************/ +#define MUIM_List_Clear (MUIB_MUI|0x0042ad89) /* MUI: V4 */ +#define MUIM_List_Compare (MUIB_MUI|0x00421b68) /* MUI: V20 */ +#define MUIM_List_Construct (MUIB_MUI|0x0042d662) /* MUI: V20 */ +#define MUIM_List_CreateImage (MUIB_MUI|0x00429804) /* MUI: V11 */ +#define MUIM_List_DeleteImage (MUIB_MUI|0x00420f58) /* MUI: V11 */ +#define MUIM_List_Destruct (MUIB_MUI|0x00427d51) /* MUI: V20 */ +#define MUIM_List_Display (MUIB_MUI|0x00425377) /* MUI: V20 */ +#define MUIM_List_Exchange (MUIB_MUI|0x0042468c) /* MUI: V4 */ +#define MUIM_List_GetEntry (MUIB_MUI|0x004280ec) /* MUI: V4 */ +#define MUIM_List_Insert (MUIB_MUI|0x00426c87) /* MUI: V4 */ +#define MUIM_List_InsertSingle (MUIB_MUI|0x004254d5) /* MUI: V7 */ +#define MUIM_List_Jump (MUIB_MUI|0x0042baab) /* MUI: V4 */ +#define MUIM_List_Move (MUIB_MUI|0x004253c2) /* MUI: V9 */ +#define MUIM_List_NextSelected (MUIB_MUI|0x00425f17) /* MUI: V6 */ +#define MUIM_List_Redraw (MUIB_MUI|0x00427993) /* MUI: V4 */ +#define MUIM_List_Remove (MUIB_MUI|0x0042647e) /* MUI: V4 */ +#define MUIM_List_Select (MUIB_MUI|0x004252d8) /* MUI: V4 */ +#define MUIM_List_Sort (MUIB_MUI|0x00422275) /* MUI: V4 */ +#define MUIM_List_TestPos (MUIB_MUI|0x00425f48) /* MUI: V11 */ +struct MUIP_List_Clear {STACKED ULONG MethodID;}; +struct MUIP_List_Compare {STACKED ULONG MethodID; STACKED APTR entry1; STACKED APTR entry2; STACKED LONG sort_type1; STACKED LONG sort_type2;}; +struct MUIP_List_Construct {STACKED ULONG MethodID; STACKED APTR entry; STACKED APTR pool;}; +struct MUIP_List_CreateImage {STACKED ULONG MethodID; STACKED Object *obj; STACKED ULONG flags;}; +struct MUIP_List_DeleteImage {STACKED ULONG MethodID; STACKED APTR listimg;}; +struct MUIP_List_Destruct {STACKED ULONG MethodID; STACKED APTR entry; STACKED APTR pool;}; +struct MUIP_List_Display {STACKED ULONG MethodID; STACKED APTR entry; STACKED STRPTR *array; STACKED LONG entry_pos; STACKED STRPTR *preparses;}; +struct MUIP_List_Exchange {STACKED ULONG MethodID; STACKED LONG pos1; STACKED LONG pos2;}; +struct MUIP_List_GetEntry {STACKED ULONG MethodID; STACKED LONG pos; STACKED APTR *entry;}; +struct MUIP_List_Insert {STACKED ULONG MethodID; STACKED APTR *entries; STACKED LONG count; STACKED LONG pos;}; +struct MUIP_List_InsertSingle {STACKED ULONG MethodID; STACKED APTR entry; STACKED LONG pos;}; +struct MUIP_List_Jump {STACKED ULONG MethodID; STACKED LONG pos;}; +struct MUIP_List_Move {STACKED ULONG MethodID; STACKED LONG from; STACKED LONG to;}; +struct MUIP_List_NextSelected {STACKED ULONG MethodID; STACKED LONG *pos;}; +struct MUIP_List_Redraw {STACKED ULONG MethodID; STACKED LONG pos;}; +struct MUIP_List_Remove {STACKED ULONG MethodID; STACKED LONG pos;}; +struct MUIP_List_Select {STACKED ULONG MethodID; STACKED LONG pos; STACKED LONG seltype; STACKED LONG *state;}; +struct MUIP_List_Sort {STACKED ULONG MethodID;}; +struct MUIP_List_TestPos {STACKED ULONG MethodID; STACKED LONG x; STACKED LONG y; STACKED struct MUI_List_TestPos_Result *res;}; + +struct MUIP_List_SelectChange {STACKED ULONG MethodID; STACKED LONG pos; STACKED LONG state; STACKED ULONG flags;}; + +/*** Attributes *************************************************************/ +#define MUIA_List_Active (MUIB_MUI|0x0042391c) /* MUI: V4 isg LONG */ +#define MUIA_List_AdjustHeight (MUIB_MUI|0x0042850d) /* MUI: V4 i.. BOOL */ +#define MUIA_List_AdjustWidth (MUIB_MUI|0x0042354a) /* MUI: V4 i.. BOOL */ +#define MUIA_List_AutoVisible (MUIB_MUI|0x0042a445) /* MUI: V11 isg BOOL */ +#define MUIA_List_CompareHook (MUIB_MUI|0x00425c14) /* MUI: V4 is. struct Hook * */ +#define MUIA_List_ConstructHook (MUIB_MUI|0x0042894f) /* MUI: V4 is. struct Hook * */ +#define MUIA_List_DestructHook (MUIB_MUI|0x004297ce) /* MUI: V4 is. struct Hook * */ +#define MUIA_List_DisplayHook (MUIB_MUI|0x0042b4d5) /* MUI: V4 is. struct Hook * */ +#define MUIA_List_DragSortable (MUIB_MUI|0x00426099) /* MUI: V11 isg BOOL */ +#define MUIA_List_DropMark (MUIB_MUI|0x0042aba6) /* MUI: V11 ..g LONG */ +#define MUIA_List_Entries (MUIB_MUI|0x00421654) /* MUI: V4 ..g LONG */ +#define MUIA_List_First (MUIB_MUI|0x004238d4) /* MUI: V4 ..g LONG */ +#define MUIA_List_Format (MUIB_MUI|0x00423c0a) /* MUI: V4 isg STRPTR */ +#define MUIA_List_InsertPosition (MUIB_MUI|0x0042d0cd) /* MUI: V9 ..g LONG */ +#define MUIA_List_MinLineHeight (MUIB_MUI|0x0042d1c3) /* MUI: V4 i.. LONG */ +#define MUIA_List_MultiTestHook (MUIB_MUI|0x0042c2c6) /* MUI: V4 is. struct Hook * */ +#define MUIA_List_Pool (MUIB_MUI|0x00423431) /* MUI: V13 i.. APTR */ +#define MUIA_List_PoolPuddleSize (MUIB_MUI|0x0042a4eb) /* MUI: V13 i.. ULONG */ +#define MUIA_List_PoolThreshSize (MUIB_MUI|0x0042c48c) /* MUI: V13 i.. ULONG */ +#define MUIA_List_Quiet (MUIB_MUI|0x0042d8c7) /* MUI: V4 .s. BOOL */ +#define MUIA_List_ShowDropMarks (MUIB_MUI|0x0042c6f3) /* MUI: V11 isg BOOL */ +#define MUIA_List_SourceArray (MUIB_MUI|0x0042c0a0) /* MUI: V4 i.. APTR */ +#define MUIA_List_Title (MUIB_MUI|0x00423e66) /* MUI: V6 isg char * */ +#define MUIA_List_Visible (MUIB_MUI|0x0042191f) /* MUI: V4 ..g LONG */ + + +/* Structure of the List Position Text (MUIM_List_TestPos) */ +struct MUI_List_TestPos_Result +{ + LONG entry; /* entry number, maybe -1 if testpos is not over valid entry */ + WORD column; /* the number of the column, maybe -1 (unvalid) */ + UWORD flags; /* some flags, see below */ + WORD xoffset; /* x offset (in pixels) of testpos relative to the start of the column */ + WORD yoffset; /* y offset (in pixels) of testpos relative from center of line + ( <0 => testpos was above, >0 => testpos was below center) */ +}; + +#define MUI_LPR_ABOVE (1<<0) +#define MUI_LPR_BELOW (1<<1) +#define MUI_LPR_LEFT (1<<2) +#define MUI_LPR_RIGHT (1<<3) + +enum +{ + MUIV_List_Active_Off = -1, + MUIV_List_Active_Top = -2, + MUIV_List_Active_Bottom = -3, + MUIV_List_Active_Up = -4, + MUIV_List_Active_Down = -5, + MUIV_List_Active_PageUp = -6, + MUIV_List_Active_PageDown = -7, +}; + +#define MUIV_List_ConstructHook_String (IPTR)-1 +#define MUIV_List_CopyHook_String (IPTR)-1 +#define MUIV_List_CursorType_None 0 +#define MUIV_List_CursorType_Bar 1 +#define MUIV_List_CursorType_Rect 2 +#define MUIV_List_DestructHook_String (IPTR)-1 + +enum +{ + MUIV_List_Insert_Top = 0, + MUIV_List_Insert_Active = -1, + MUIV_List_Insert_Sorted = -2, + MUIV_List_Insert_Bottom = -3 +}; + +enum +{ + MUIV_List_Remove_First = 0, + MUIV_List_Remove_Active = -1, + MUIV_List_Remove_Last = -2, + MUIV_List_Remove_Selected = -3, +}; + +enum +{ + MUIV_List_Select_Active = -1, + MUIV_List_Select_All = -2, + + MUIV_List_Select_Off = 0, + MUIV_List_Select_On = 1, + MUIV_List_Select_Toggle = 2, + MUIV_List_Select_Ask = 3, +}; + +enum +{ + MUIV_List_GetEntry_Active = -1, +}; + +enum +{ + MUIV_List_Redraw_Active = -1, + MUIV_List_Redraw_All = -2, +}; + +enum +{ + MUIV_List_Move_Top = 0, + MUIV_List_Move_Active = -1, + MUIV_List_Move_Bottom = -2, + MUIV_List_Move_Next = -3, /* for 2nd parameter only */ + MUIV_List_Move_Previous = -4, /* for 2nd parameter only */ +}; + +enum +{ + MUIV_List_Exchange_Top = 0, + MUIV_List_Exchange_Active = -1, + MUIV_List_Exchange_Bottom = -2, + MUIV_List_Exchange_Next = -3, /* for 2nd parameter only */ + MUIV_List_Exchange_Previous = -4, /* for 2nd parameter only */ +}; + +enum +{ + MUIV_List_Jump_Top = 0, + MUIV_List_Jump_Active = -1, + MUIV_List_Jump_Bottom = -2, + MUIV_List_Jump_Down = -3, + MUIV_List_Jump_Up = -4, +}; + +#define MUIV_List_NextSelected_Start (-1) +#define MUIV_List_NextSelected_End (-1) + + +#define MUIV_NList_SelectChange_Flag_Multi (1 << 0) + + + + + + +/****************************************************************************/ +/*** Name *******************************************************************/ +#define MUIC_Scrmodelist "Scrmodelist.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Scrmodelist (MUIB_ZUNE | 0x00001700) + + + + + +#endif /* _MUI_CLASSES_LIST_H */ +#endif + +#ifndef _MUI_CLASSES_FLOATTEXT_H +#ifndef _MUI_CLASSES_FLOATTEXT_H +#define _MUI_CLASSES_FLOATTEXT_H + +/* + Copyright © 2002-2010, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Floattext "Floattext.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Floattext (MUIB_ZUNE | 0x00001500) + +/*** Attributes *************************************************************/ +#define MUIA_Floattext_Justify (MUIB_MUI|0x0042dc03) /* MUI: V4 isg BOOL */ +#define MUIA_Floattext_SkipChars (MUIB_MUI|0x00425c7d) /* MUI: V4 is. STRPTR */ +#define MUIA_Floattext_TabSize (MUIB_MUI|0x00427d17) /* MUI: V4 is. LONG */ +#define MUIA_Floattext_Text (MUIB_MUI|0x0042d16a) /* MUI: V4 isg STRPTR */ + + +#endif /* _MUI_CLASSES_VOLUMELIST_H */ +#endif + +#ifndef _MUI_CLASSES_POPSTRING_H +#ifndef _MUI_CLASSES_POPSTRING_H +#define _MUI_CLASSES_POPSTRING_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Popstring "Popstring.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Popstring (MUIB_ZUNE | 0x00002800) + +/*** Methods ****************************************************************/ +#define MUIM_Popstring_Close (MUIB_MUI|0x0042dc52) /* MUI: V7 */ +#define MUIM_Popstring_Open (MUIB_MUI|0x004258ba) /* MUI: V7 */ +struct MUIP_Popstring_Close {STACKED ULONG MethodID; STACKED LONG result;}; +struct MUIP_Popstring_Open {STACKED ULONG MethodID; }; + +/*** Attributes *************************************************************/ +#define MUIA_Popstring_Button (MUIB_MUI|0x0042d0b9) /* MUI: V7 i.g Object * */ +#define MUIA_Popstring_CloseHook (MUIB_MUI|0x004256bf) /* MUI: V7 isg struct Hook * */ +#define MUIA_Popstring_OpenHook (MUIB_MUI|0x00429d00) /* MUI: V7 isg struct Hook * */ +#define MUIA_Popstring_String (MUIB_MUI|0x004239ea) /* MUI: V7 i.g Object * */ +#define MUIA_Popstring_Toggle (MUIB_MUI|0x00422b7a) /* MUI: V7 isg BOOL */ + + + +#endif /* _MUI_CLASSES_POPSTRING_H */ +#endif + +#ifndef _MUI_CLASSES_POPOBJECT_H +#ifndef _MUI_CLASSES_POPOBJECT_H +#define _MUI_CLASSES_POPOBJECT_H + +/* + Copyright © 2002-2006, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/****************************************************************************/ +/*** Name *******************************************************************/ +#define MUIC_Popobject "Popobject.mui" + +/*** Identifier base ********************************************************/ +#define MUIB_Popobject (MUIB_ZUNE | 0x00002400) + +/*** Attributes *************************************************************/ +#define MUIA_Popobject_Follow (MUIB_MUI|0x00424cb5) /* MUI: V7 isg BOOL */ +#define MUIA_Popobject_Light (MUIB_MUI|0x0042a5a3) /* MUI: V7 isg BOOL */ +#define MUIA_Popobject_Object (MUIB_MUI|0x004293e3) /* MUI: V7 i.g Object * */ +#define MUIA_Popobject_ObjStrHook (MUIB_MUI|0x0042db44) /* MUI: V7 isg struct Hook * */ +#define MUIA_Popobject_StrObjHook (MUIB_MUI|0x0042fbe1) /* MUI: V7 isg struct Hook * */ +#define MUIA_Popobject_Volatile (MUIB_MUI|0x004252ec) /* MUI: V7 isg BOOL */ +#define MUIA_Popobject_WindowHook (MUIB_MUI|0x0042f194) /* MUI: V9 isg struct Hook * */ + + + +#endif /*_MUI_CLASSES_POPOBJECT_H */ +#endif + +#ifndef _MUI_CLASSES_CYCLE_H +#ifndef _MUI_CLASSES_CYCLE_H +#define _MUI_CLASSES_CYCLE_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Cycle "Cycle.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Cycle (MUIB_ZUNE | 0x00000a00) + +/*** Attributes *************************************************************/ +#define MUIA_Cycle_Active (MUIB_MUI|0x00421788) /* MUI:V4 isg LONG */ +#define MUIA_Cycle_Entries (MUIB_MUI|0x00420629) /* MUI:V4 i.. STRPTR */ + +enum +{ + MUIV_Cycle_Active_Next = -1, + MUIV_Cycle_Active_Prev = -2, +}; + + +#endif /* _MUI_CLASSES_CYCLE_H */ +#endif + +#ifndef _MUI_CLASSES_GAUGE_H +#ifndef _MUI_CLASSES_GAUGE_H +#define _MUI_CLASSES_GAUGE_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Gauge "Gauge.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Gauge (MUIB_ZUNE | 0x00000f00) + +/*** Attributes *************************************************************/ +#define MUIA_Gauge_Current (MUIB_MUI|0x0042f0dd) /* MUI: V4 isg LONG */ +#define MUIA_Gauge_Divide (MUIB_MUI|0x0042d8df) /* MUI: V4 isg LONG */ +#define MUIA_Gauge_Horiz (MUIB_MUI|0x004232dd) /* MUI: V4 i.. BOOL */ +#define MUIA_Gauge_InfoText (MUIB_MUI|0x0042bf15) /* MUI: V7 isg STRPTR */ +#define MUIA_Gauge_Max (MUIB_MUI|0x0042bcdb) /* MUI: V4 isg LONG */ + +#define MUIA_Gauge_DupInfoText (MUIB_Gauge | 0x00000000) /* ZUNE: V1 i.. BOOL - defaults to FALSE */ + + + +#endif /* _MUI_CLASSES_GAUGE_H */ +#endif + +#ifndef _MUI_CLASSES_IMAGE_H +#ifndef _MUI_CLASSES_IMAGE_H +#define _MUI_CLASSES_IMAGE_H + +/* + Copyright 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Image "Image.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Image (MUIB_ZUNE | 0x00001300) + +/*** Attributes *************************************************************/ +#define MUIA_Image_FontMatch (MUIB_MUI|0x0042815d) /* MUI: V4 i.. BOOL */ +#define MUIA_Image_FontMatchHeight (MUIB_MUI|0x00429f26) /* MUI: V4 i.. BOOL */ +#define MUIA_Image_FontMatchWidth (MUIB_MUI|0x004239bf) /* MUI: V4 i.. BOOL */ +#define MUIA_Image_FreeHoriz (MUIB_MUI|0x0042da84) /* MUI: V4 i.. BOOL */ +#define MUIA_Image_FreeVert (MUIB_MUI|0x0042ea28) /* MUI: V4 i.. BOOL */ +#define MUIA_Image_OldImage (MUIB_MUI|0x00424f3d) /* MUI: V4 i.. struct Image * */ +#define MUIA_Image_Spec (MUIB_MUI|0x004233d5) /* MUI: V4 i.. char * */ +#define MUIA_Image_State (MUIB_MUI|0x0042a3ad) /* MUI: V4 is. LONG */ + + + +#endif /* _MUI_CLASSES_IMAGE_H */ +#endif + +#ifndef _MUI_CLASSES_IMAGEDISPLAY_H +#ifndef _MUI_CLASSES_IMAGEDISPLAY_H +#define _MUI_CLASSES_IMAGEDISPLAY_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Imagedisplay "Imagedisplay.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Imagedisplay (MUIB_ZUNE | 0x00001200) + +/*** Attributes *************************************************************/ +#define MUIA_Imagedisplay_Spec (MUIB_MUI|0x0042a547) /* MUI: V11 isg struct MUI_ImageSpec * */ +#define MUIA_Imagedisplay_UseDefSize (MUIB_MUI|0x0042186d) /* MUI: V11 i.. BOOL (undoc) */ + +#define MUIA_Imagedisplay_FreeHoriz (MUIB_Imagedisplay | 0x00000000) /* Zune 20030323 i.. BOOL [TRUE] */ +#define MUIA_Imagedisplay_FreeVert (MUIB_Imagedisplay | 0x00000001) /* Zune 20030323 i.. BOOL [TRUE] */ + + + +#endif /* _MUI_CLASSES_IMAGEDISPLAY_H */ +#endif + +#ifndef _MUI_CLASSES_POPASL_H +#ifndef _MUI_CLASSES_POPASL_H +#define _MUI_CLASSES_POPASL_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Popasl "Popasl.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Popasl (MUIB_ZUNE | 0x00002100) + + +/*** Attributes *************************************************************/ +#define MUIA_Popasl_Active (MUIB_MUI|0x00421b37) /* MUI: V7 ..g BOOL */ +#define MUIA_Popasl_StartHook (MUIB_MUI|0x0042b703) /* MUI: V7 isg struct Hook * */ +#define MUIA_Popasl_StopHook (MUIB_MUI|0x0042d8d2) /* MUI: V7 isg struct Hook * */ +#define MUIA_Popasl_Type (MUIB_MUI|0x0042df3d) /* MUI: V7 i.g ULONG */ + + + +#endif /* _MUI_CLASSES_POPASL_H */ +#endif + +#ifndef _MUI_CLASSES_SETTINGSGROUP_H +#ifndef _MUI_CLASSES_SETTINGSGROUP_H +#define _MUI_CLASSES_SETTINGSGROUP_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Settingsgroup "Settingsgroup.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Settingsgroup (MUIB_ZUNE | 0x00003100) + +/*** Methods ****************************************************************/ +#define MUIM_Settingsgroup_ConfigToGadgets (MUIB_MUI|0x00427043) /* MUI: V11 */ +#define MUIM_Settingsgroup_GadgetsToConfig (MUIB_MUI|0x00425242) /* MUI: V11 */ +struct MUIP_Settingsgroup_ConfigToGadgets {STACKED ULONG MethodID; STACKED Object *configdata; }; +struct MUIP_Settingsgroup_GadgetsToConfig {STACKED ULONG MethodID; STACKED Object *configdata; }; + + + +#endif /* _MUI_CLASSES_SETTINGSGROUP_H */ +#endif + +#ifndef _MUI_CLASSES_SETTINGS_H +#ifndef _MUI_CLASSES_SETTINGS_H +#define _MUI_CLASSES_SETTINGS_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Settings "Settings.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Settings (MUIB_ZUNE | 0x00003200) + + + +#endif /* _MUI_CLASSES_SETTINGS_H */ +#endif + +#ifndef _MUI_CLASSES_ABOUTMUI_H +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#ifndef _MUI_CLASSES_ABOUTMUI_H +#define _MUI_CLASSES_ABOUTMUI_H + +/*** Name *******************************************************************/ +#define MUIC_Aboutmui "Aboutmui.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Aboutmui (MUIB_ZUNE | 0x00000000) + +/*** Attributes *************************************************************/ +#define MUIA_Aboutmui_Application (MUIB_MUI | 0x00422523) /* V11 i.. Object * */ + + + +#endif /* _MUI_CLASSES_ABOUTMUI_H */ +#endif + +#ifndef _MUI_CLASSES_CONFIGDATA_H +/* + Copyright 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#ifndef _MUI_CLASSES_CONFIGDATA_H +#define _MUI_CLASSES_CONFIGDATA_H + +/*** Name *******************************************************************/ +#define MUIC_Configdata "Configdata.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Configdata (MUIB_ZUNE | 0x00000900) + +/* The config items for MUIM_GetConfigItem */ +#define MUICFG_Invalid (-1) +#define MUICFG_Window_Spacing_Left 0x01 /* ULONG, horiz pixels (def=4) */ +#define MUICFG_Window_Spacing_Right 0x02 /* ULONG, horiz pixels (def=4) */ +#define MUICFG_Window_Spacing_Top 0x03 /* ULONG, vert pixels (def=3) */ +#define MUICFG_Window_Spacing_Bottom 0x04 /* ULONG, vert pixels (def=3) */ +#define MUICFG_Radio_HSpacing 0x05 /* ULONG, horiz pixels (def=4) */ +#define MUICFG_Radio_VSpacing 0x06 /* ULONG, vertical pixels (def=1) */ +#define MUICFG_Group_HSpacing 0x07 /* ULONG, horiz pixels (def=6) */ +#define MUICFG_Group_VSpacing 0x08 /* ULONG, vertical pixels (def=3) */ +#define MUICFG_Scrollbar_Arrangement 0x09 /* ULONG, top = 0 (def), middle, bottom */ +#define MUICFG_Listview_Refresh 0x0a /* ULONG, linear, mixed = 1 (def) */ +#define MUICFG_Listview_Font_Leading 0x0b /* ULONG, vertical pixels (def=1) */ +#define MUICFG_Listview_SmoothVal 0x0c /* ULONG, ? (def=0) */ +#define MUICFG_Listview_Multi 0x0d /* ULONG, shifted = 0 (def), always */ +#define MUICFG_GroupTitle_Position 0x0f /* ULONG, 1=centered */ +#define MUICFG_GroupTitle_Color 0x10 /* ULONG, 0=normal */ +#define MUICFG_Cycle_MenuCtrl_Level 0x11 /* ULONG, num of entries (def=2) */ +#define MUICFG_Cycle_MenuCtrl_Position 0x12 /* ULONG, below = 0 (def), on active */ +#define MUICFG_Frame_Drag 0x18 +#define MUICFG_Cycle_Menu_Recessed 0x19 /* ULONG, false = 0 (def), true */ +#define MUICFG_Cycle_MenuCtrl_Speed 0x1a /* ULONG, num of ticks (0..50) (def=0) */ +#define MUICFG_Listview_Smoothed 0x1b /* ULONG, false = 0 (def), true */ +#define MUICFG_Window_Redraw 0x1d /* ULONG, no clear, clear = 1 (def) */ +#define MUICFG_Font_Normal 0x1e +#define MUICFG_Font_List 0x1f +#define MUICFG_Font_Tiny 0x20 +#define MUICFG_Font_Fixed 0x21 +#define MUICFG_Font_Title 0x22 +#define MUICFG_Font_Big 0x23 +#define MUICFG_PublicScreen 0x24 +#define MUICFG_Frame_Button 0x2b +#define MUICFG_Frame_ImageButton 0x2c +#define MUICFG_Frame_Text 0x2d +#define MUICFG_Frame_String 0x2e +#define MUICFG_Frame_ReadList 0x2f +#define MUICFG_Frame_InputList 0x30 +#define MUICFG_Frame_Prop 0x31 +#define MUICFG_Frame_Gauge 0x32 +#define MUICFG_Frame_Group 0x33 +#define MUICFG_Frame_PopUp 0x34 +#define MUICFG_Frame_Virtual 0x35 +#define MUICFG_Frame_Slider 0x36 +#define MUICFG_Background_Window 0x37 +#define MUICFG_Background_Requester 0x38 +#define MUICFG_Background_Button 0x39 +#define MUICFG_Background_List 0x3a +#define MUICFG_Background_Text 0x3b +#define MUICFG_Background_Prop 0x3c +#define MUICFG_Background_PopUp 0x3d +#define MUICFG_Background_Selected 0x3e +#define MUICFG_Background_ListCursor 0x3f +#define MUICFG_Background_ListSelect 0x40 +#define MUICFG_Background_ListSelCur 0x41 +#define MUICFG_Image_ArrowUp 0x42 +#define MUICFG_Image_ArrowDown 0x43 +#define MUICFG_Image_ArrowLeft 0x44 +#define MUICFG_Image_ArrowRight 0x45 +#define MUICFG_Image_CheckMark 0x46 +#define MUICFG_Image_RadioButton 0x47 +#define MUICFG_Image_Cycle 0x48 +#define MUICFG_Image_PopUp 0x49 +#define MUICFG_Image_PopFile 0x4a +#define MUICFG_Image_PopDrawer 0x4b +#define MUICFG_Image_PropKnob 0x4c +#define MUICFG_Image_Drawer 0x4d +#define MUICFG_Image_HardDisk 0x4e +#define MUICFG_Image_Disk 0x4f +#define MUICFG_Image_Chip 0x50 +#define MUICFG_Image_Volume 0x51 +#define MUICFG_Image_Network 0x52 +#define MUICFG_Image_Assign 0x53 +#define MUICFG_Background_Register 0x54 +#define MUICFG_Image_TapePlay 0x55 +#define MUICFG_Image_TapePlayBack 0x56 +#define MUICFG_Image_TapePause 0x57 +#define MUICFG_Image_TapeStop 0x58 +#define MUICFG_Image_TapeRecord 0x59 +#define MUICFG_Background_Framed 0x5a +#define MUICFG_Background_Slider 0x5b +#define MUICFG_Background_SliderKnob 0x5c +#define MUICFG_Image_TapeUp 0x5d +#define MUICFG_Image_TapeDown 0x5e +#define MUICFG_Keyboard_Press 0x5f +#define MUICFG_Keyboard_Toggle 0x60 +#define MUICFG_Keyboard_Up 0x61 +#define MUICFG_Keyboard_Down 0x62 +#define MUICFG_Keyboard_PageUp 0x63 +#define MUICFG_Keyboard_PageDown 0x64 +#define MUICFG_Keyboard_Top 0x65 +#define MUICFG_Keyboard_Bottom 0x66 +#define MUICFG_Keyboard_Left 0x67 +#define MUICFG_Keyboard_Right 0x68 +#define MUICFG_Keyboard_WordLeft 0x69 +#define MUICFG_Keyboard_WordRight 0x6a +#define MUICFG_Keyboard_LineStart 0x6b +#define MUICFG_Keyboard_LineEnd 0x6c +#define MUICFG_Keyboard_NextGadget 0x6d +#define MUICFG_Keyboard_PrevGadget 0x6e +#define MUICFG_Keyboard_GadgetOff 0x6f +#define MUICFG_Keyboard_CloseWindow 0x70 +#define MUICFG_Keyboard_NextWindow 0x71 +#define MUICFG_Keyboard_PrevWindow 0x72 +#define MUICFG_Keyboard_Help 0x73 +#define MUICFG_Keyboard_Popup 0x74 +#define MUICFG_Window_Positions 0x7a +#define MUICFG_Balance_Look 0x7b /* ULONG, frame = 0 (def), object */ +#define MUICFG_Font_Button 0x80 +#define MUICFG_Scrollbar_Type 0x83 /* ULONG, standard = 0 (def), newlook, custom */ +#define MUICFG_String_Background 0x84 +#define MUICFG_String_Text 0x85 +#define MUICFG_String_ActiveBackground 0x86 +#define MUICFG_String_ActiveText 0x87 +#define MUICFG_Font_Knob 0x88 +#define MUICFG_Drag_LeftButton 0x89 /* ULONG, false, true (def) */ +#define MUICFG_Drag_MiddleButton 0x8a /* ULONG, false (def), true */ +#define MUICFG_Drag_LMBModifier 0x8b /* key desc (def = control) */ +#define MUICFG_Drag_MMBModifier 0x8c /* key desc */ +#define MUICFG_Drag_Autostart 0x8d /* ULONG, false = 0, true (def) */ +#define MUICFG_Drag_Autostart_Length 0x8e /* ULONG, pixels (def = 3) */ +#define MUICFG_ActiveObject_Color 0x8f /* penspec */ +#define MUICFG_Frame_Knob 0x90 +#define MUICFG_Dragndrop_Look 0x94 /* ULONG, solid, ghosted on obj (def), ... */ +#define MUICFG_Background_Page 0x95 +#define MUICFG_Background_ReadList 0x96 +#define MUICFG_String_Cursor 0x400 +#define MUICFG_String_MarkedBackground 0x401 +#define MUICFG_String_MarkedText 0x402 +#define MUICFG_Register_TruncateTitles 0x403 +#define MUICFG_Window_Refresh 0x404 +#define MUICFG_Screen_Mode 0x505 +#define MUICFG_Screen_Mode_ID 0x506 +#define MUICFG_Screen_Width 0x507 +#define MUICFG_Screen_Height 0x508 +#define MUICFG_WindowPos 0x509 +#define MUICFG_Window_Buttons 0x50a + +#define MUICFG_CustomFrame_1 0x600 +#define MUICFG_CustomFrame_2 0x601 +#define MUICFG_CustomFrame_3 0x602 +#define MUICFG_CustomFrame_4 0x603 +#define MUICFG_CustomFrame_5 0x604 +#define MUICFG_CustomFrame_6 0x605 +#define MUICFG_CustomFrame_7 0x606 +#define MUICFG_CustomFrame_8 0x607 +#define MUICFG_CustomFrame_9 0x608 +#define MUICFG_CustomFrame_10 0x609 +#define MUICFG_CustomFrame_11 0x60a +#define MUICFG_CustomFrame_12 0x60b +#define MUICFG_CustomFrame_13 0x60c +#define MUICFG_CustomFrame_14 0x60d +#define MUICFG_CustomFrame_15 0x60e +#define MUICFG_CustomFrame_16 0x60f + +#define MUICFG_PublicScreen_PopToFront 0x700 +#define MUICFG_Iconification_Hotkey 0x701 +#define MUICFG_Iconification_ShowIcon 0x702 +#define MUICFG_Iconification_ShowMenu 0x703 +#define MUICFG_Iconification_OnStartup 0x704 +#define MUICFG_Interfaces_EnableARexx 0x705 +#define MUICFG_BubbleHelp_FirstDelay 0x706 +#define MUICFG_BubbleHelp_NextDelay 0x707 + +#define MUIM_Configdata_GetWindowPos (MUIB_Configdata | 0x0000002A) +#define MUIM_Configdata_SetWindowPos (MUIB_Configdata | 0x0000002B) + + +/*** Methods ****************************************************************/ +#define MUIM_Configdata_GetString (MUIB_Configdata | 0x00000000) /* Zune 20030319 */ +#define MUIM_Configdata_GetULong (MUIB_Configdata | 0x00000001) /* Zune 20030319 */ +#define MUIM_Configdata_SetULong (MUIB_Configdata | 0x00000002) /* Zune 20030320 */ +#define MUIM_Configdata_SetImspec (MUIB_Configdata | 0x00000003) /* Zune 20030323 */ +#define MUIM_Configdata_SetFramespec (MUIB_Configdata | 0x00000004) /* Zune 20030331 */ +#define MUIM_Configdata_SetFont (MUIB_Configdata | 0x00000005) /* Zune 20030323 */ +#define MUIM_Configdata_Save (MUIB_Configdata | 0x00000006) /* Zune 20030320 */ +#define MUIM_Configdata_Load (MUIB_Configdata | 0x00000007) /* Zune 20030320 */ +#define MUIM_Configdata_SetPenspec (MUIB_Configdata | 0x00000008) /* Zune 20030714 */ +#define MUIM_Configdata_SetString (MUIB_Configdata | 0x00000009) /* Zune 20030808 */ +struct MUIP_Configdata_GetString {STACKED ULONG MethodID; STACKED ULONG id; }; +struct MUIP_Configdata_GetULong {STACKED ULONG MethodID; STACKED ULONG id; }; +struct MUIP_Configdata_SetULong {STACKED ULONG MethodID; STACKED ULONG id; STACKED ULONG val; }; +struct MUIP_Configdata_SetImspec {STACKED ULONG MethodID; STACKED ULONG id; STACKED CONST_STRPTR imspec; }; +struct MUIP_Configdata_SetFramespec {STACKED ULONG MethodID; STACKED ULONG id; STACKED CONST_STRPTR framespec; }; +struct MUIP_Configdata_SetFont {STACKED ULONG MethodID; STACKED ULONG id; STACKED CONST_STRPTR font; }; +struct MUIP_Configdata_Save {STACKED ULONG MethodID; STACKED CONST_STRPTR filename; }; +struct MUIP_Configdata_Load {STACKED ULONG MethodID; STACKED CONST_STRPTR filename; }; +struct MUIP_Configdata_SetPenspec {STACKED ULONG MethodID; STACKED ULONG id; STACKED CONST_STRPTR penspec; }; +struct MUIP_Configdata_SetString {STACKED ULONG MethodID; STACKED ULONG id; STACKED CONST_STRPTR string; }; + +/*** Attributes *************************************************************/ +#define MUIA_Configdata_Application (MUIB_Configdata | 0x00000000) /* ZV1: i.. Object * */ +#define MUIA_Configdata_ApplicationBase (MUIB_Configdata | 0x00000002) /* ZV1: i.. Object * */ + + + +#endif /* _MUI_CLASSES_CONFIGDATA_H */ +#endif + +#ifndef _MUI_CLASSES_IMAGEADJUST_H +#ifndef _MUI_CLASSES_IMAGEADJUST_H +#define _MUI_CLASSES_IMAGEADJUST_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Imageadjust "Imageadjust.mui" + +/*** Identifier base (for AROS extensions) **********************************/ +#define MUIB_Imageadjust (MUIB_ZUNE | 0x00001100) + +/*** Attributes *************************************************************/ +#define MUIA_Imageadjust_Type (MUIB_MUI|0x00422f2b) /* MUI: V11 i.. LONG */ +#define MUIA_Imageadjust_Spec (MUIB_MUI|0x004279e1) /* MUI: ??? .g. char * */ +#define MUIA_Imageadjust_Originator (MUIB_Imageadjust|0x00000000) /* Zune: i.. Object * */ + +enum +{ + MUIV_Imageadjust_Type_All = 0, + MUIV_Imageadjust_Type_Image, + MUIV_Imageadjust_Type_Background, + MUIV_Imageadjust_Type_Pen, +}; + +/*** Methods ****************************************************************/ + + +#endif /* _MUI_CLASSES_IMAGEADJUST_H */ +#endif + +#ifndef _MUI_CLASSES_POPIMAGE_H +#ifndef _MUI_CLASSES_POPIMAGE_H +#define _MUI_CLASSES_POPIMAGE_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Popimage "Popimage.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Popimage (MUIB_ZUNE | 0x00002300) + +/*** Methods ****************************************************************/ + + + +#endif /* _MUI_CLASSES_POPIMAGE_H */ +#endif + +#ifndef _MUI_CLASSES_SCALE_H +#ifndef _MUI_CLASSES_SCALE_H +#define _MUI_CLASSES_SCALE_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Scale "Scale.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Scale (MUIB_ZUNE | 0x00002d00) + +/*** Attributes *************************************************************/ +#define MUIA_Scale_Horiz (MUIB_MUI|0x0042919a) /* MUI: V4 isg BOOL */ + + + +#endif /* _MUI_CLASSES_SCALE_H */ +#endif + +#ifndef _MUI_CLASSES_RADIO_H +#ifndef _MUI_CLASSES_RADIO_H +#define _MUI_CLASSES_RADIO_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Radio "Radio.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Radio (MUIB_ZUNE | 0x00002a00) + +/*** Attributes *************************************************************/ +#define MUIA_Radio_Active (MUIB_MUI|0x00429b41) /* MUI:V4 isg LONG */ +#define MUIA_Radio_Entries (MUIB_MUI|0x0042b6a1) /* MUI:V4 i.. STRPTR * */ + + + +#endif /* _MUI_CLASSES_RADIO_H */ +#endif + +#ifndef _MUI_CLASSES_BALANCE_H +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#ifndef _MUI_CLASSES_BALANCE_H +#define _MUI_CLASSES_BALANCE_H + +/*** Name *******************************************************************/ +#define MUIC_Balance "Balance.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Balance (MUIB_ZUNE | 0x00000300) + +/*** Attributes *************************************************************/ +#define MUIA_Balance_Quiet (MUIB_Balance | 0x00000000) /* (zune) V20 i LONG */ + + + +#endif /* _MUI_CLASSES_BALANCE_H */ +#endif + +#ifndef _MUI_CLASSES_PENDISPLAY_H +#ifndef _MUI_CLASSES_PENDISPLAY_H +#define _MUI_CLASSES_PENDISPLAY_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Pendisplay "Pendisplay.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Pendisplay (MUIB_ZUNE | 0x00002000) + +/*** Methods ****************************************************************/ +#define MUIM_Pendisplay_SetColormap (MUIB_MUI|0x004243a7) /* MUI: V13 */ +#define MUIM_Pendisplay_SetMUIPen (MUIB_MUI|0x00426ecd) /* MUI: V13 */ +#define MUIM_Pendisplay_SetRGB (MUIB_MUI|0x0042032c) /* MUI: V13 */ +struct MUIP_Pendisplay_SetColormap {STACKED ULONG MethodID; STACKED LONG colormap;}; +struct MUIP_Pendisplay_SetMUIPen {STACKED ULONG MethodID; STACKED LONG muipen;}; +struct MUIP_Pendisplay_SetRGB {STACKED ULONG MethodID; STACKED ULONG r; STACKED ULONG g; STACKED ULONG b;}; + +/*** Attributes *************************************************************/ +#define MUIA_Pendisplay_Pen (MUIB_MUI|0x0042a748) /* MUI: V13 ..g Object * */ +#define MUIA_Pendisplay_Reference (MUIB_MUI|0x0042dc24) /* MUI: V13 isg Object * */ +#define MUIA_Pendisplay_RGBcolor (MUIB_MUI|0x0042a1a9) /* MUI: V11 isg struct MUI_RGBcolor * */ +#define MUIA_Pendisplay_Spec (MUIB_MUI|0x0042a204) /* MUI: V11 isg struct MUI_PenSpec * */ + + + +#endif /* _MUI_CLASSES_PENDISPLAY_H */ +#endif + +#ifndef _MUI_CLASSES_PENADJUST_H +#ifndef _MUI_CLASSES_PENADJUST_H +#define _MUI_CLASSES_PENADJUST_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Penadjust "Penadjust.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Penadjust (MUIB_ZUNE | 0x00001f00) + +/*** Attributes *************************************************************/ +#define MUIA_Penadjust_PSIMode (MUIB_MUI|0x00421cbb) /* MUI: V11 i.. BOOL */ + + + + +#endif /* _MUI_CLASSES_PENADJUST_H */ +#endif + +#ifndef _MUI_CLASSES_POPPEN_H +#ifndef _MUI_CLASSES_POPPEN_H +#define _MUI_CLASSES_POPPEN_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Poppen "Poppen.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Poppen (MUIB_ZUNE | 0x00002700) + +/*** Methods ****************************************************************/ + + + +#endif /* _MUI_CLASSES_POPPEN_H */ +#endif + +#ifndef _MUI_CLASSES_COLORFIELD_H +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#ifndef _MUI_CLASSES_COLORFIELD_H +#define _MUI_CLASSES_COLORFIELD_H + +/*** Name *******************************************************************/ +#define MUIC_Colorfield "Colorfield.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Colorfield (MUIB_ZUNE | 0x00000800) + +/*** Attributes *************************************************************/ +#define MUIA_Colorfield_Pen (MUIB_MUI|0x0042713a) /* ..g ULONG */ +#define MUIA_Colorfield_Red (MUIB_MUI|0x004279f6) /* isg ULONG */ +#define MUIA_Colorfield_Green (MUIB_MUI|0x00424466) /* isg ULONG */ +#define MUIA_Colorfield_Blue (MUIB_MUI|0x0042d3b0) /* isg ULONG */ +#define MUIA_Colorfield_RGB (MUIB_MUI|0x0042677a) /* isg ULONG * */ + + + +#endif /* _MUI_CLASSES_COLORFIELD_H */ +#endif + +#ifndef _MUI_CLASSES_COLORADJUST_H +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#ifndef _MUI_CLASSES_COLORADJUST_H +#define _MUI_CLASSES_COLORADJUST_H + +/*** Name *******************************************************************/ +#define MUIC_Coloradjust "Coloradjust.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Coloradjust (MUIB_ZUNE | 0x00000700) + +/*** Attributes *************************************************************/ +#define MUIA_Coloradjust_Red (MUIB_MUI|0x00420eaa) /* isg ULONG */ +#define MUIA_Coloradjust_Green (MUIB_MUI|0x004285ab) /* isg ULONG */ +#define MUIA_Coloradjust_Blue (MUIB_MUI|0x0042b8a3) /* isg ULONG */ +#define MUIA_Coloradjust_RGB (MUIB_MUI|0x0042f899) /* isg ULONG * */ +#define MUIA_Coloradjust_ModeID (MUIB_MUI|0x0042ec59) /* isg ULONG */ + + + +#endif /* _MUI_CLASSES_COLORADJUST_H */ +#endif + +#ifndef _MUI_CLASSES_MCCPREFS_H +/* + Copyright © 2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +#ifndef _MUI_CLASSES_MCCPREFS_H +#define _MUI_CLASSES_MCCPREFS_H + +#define MUIC_Mccprefs "Mccprefs.mui" + + +#endif +#endif + +#ifndef _MUI_CLASSES_FRAMEADJUST_H +#ifndef _MUI_CLASSES_FRAMEADJUST_H +#define _MUI_CLASSES_FRAMEADJUST_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Frameadjust "Frameadjust.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Frameadjust (MUIB_ZUNE | 0x00000d00) + +/*** Attributes *************************************************************/ +#define MUIA_Frameadjust_Spec (MUIB_Frameadjust | 0x00000000) /* Zune 20030330 ig. CONST_STRPTR */ + + + +#endif /* _MUI_CLASSES_FRAMEADJUST_H */ +#endif + +#ifndef _MUI_CLASSES_FRAMEDISPLAY_H +#ifndef _MUI_CLASSES_FRAMEDISPLAY_H +#define _MUI_CLASSES_FRAMEDISPLAY_H + +/* + Copyright © 2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Framedisplay "Framedisplay.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Framedisplay (MUIB_ZUNE | 0x00000e00) + +/*** Attributes *************************************************************/ +#define MUIA_Framedisplay_Spec (MUIB_MUI|0x00421794) /* MUI: V?? isg struct MUI_FrameSpec * */ + + +#endif /* _MUI_CLASSES_FRAMEDISPLAY_H */ +#endif + +#ifndef _MUI_CLASSES_POPFRAME_H +#ifndef _MUI_CLASSES_POPFRAME_H +#define _MUI_CLASSES_POPFRAME_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Popframe "Popframe.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Popframe (MUIB_ZUNE | 0x00002200) + +/*** Methods ****************************************************************/ + + + +#endif /* _MUI_CLASSES_POPFRAME_H */ +#endif + +#ifndef _MUI_CLASSES_VOLUMELIST_H +#ifndef _MUI_CLASSES_VOLUMELIST_H +#define _MUI_CLASSES_VOLUMELIST_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Volumelist "Volumelist.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Volumelist (MUIB_ZUNE | 0x1600) + + +#endif /* _MUI_CLASSES_VOLUMELIST_H */ +#endif + +#ifndef _MUI_CLASSES_DIRLIST_H +#ifndef _MUI_CLASSES_DIRLIST_H +#define _MUI_CLASSES_DIRLIST_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/****************************************************************************/ +/*** Name *******************************************************************/ +#define MUIC_Dirlist "Dirlist.mui" + +/*** Identifer base (for Zune extensions) ***********************************/ +#define MUIB_Dirlist (MUIB_ZUNE | 0x00001800) + +/*** Methods ****************************************************************/ + +#define MUIM_Dirlist_ReRead (MUIB_MUI|0x00422d71) /* MUI: V4 */ +struct MUIP_Dirlist_ReRead {STACKED ULONG MethodID;}; + +/*** Attributes *************************************************************/ +#define MUIA_Dirlist_AcceptPattern (MUIB_MUI|0x0042760a) /* MUI: V4 is. STRPTR */ +#define MUIA_Dirlist_Directory (MUIB_MUI|0x0042ea41) /* MUI: V4 isg STRPTR */ +#define MUIA_Dirlist_DrawersOnly (MUIB_MUI|0x0042b379) /* MUI: V4 is. BOOL */ +#define MUIA_Dirlist_FilesOnly (MUIB_MUI|0x0042896a) /* MUI: V4 is. BOOL */ +#define MUIA_Dirlist_FilterDrawers (MUIB_MUI|0x00424ad2) /* MUI: V4 is. BOOL */ +#define MUIA_Dirlist_FilterHook (MUIB_MUI|0x0042ae19) /* MUI: V4 is. struct Hook * */ +#define MUIA_Dirlist_MultiSelDirs (MUIB_MUI|0x00428653) /* MUI: V6 is. BOOL */ +#define MUIA_Dirlist_NumBytes (MUIB_MUI|0x00429e26) /* MUI: V4 ..g LONG */ +#define MUIA_Dirlist_NumDrawers (MUIB_MUI|0x00429cb8) /* MUI: V4 ..g LONG */ +#define MUIA_Dirlist_NumFiles (MUIB_MUI|0x0042a6f0) /* MUI: V4 ..g LONG */ +#define MUIA_Dirlist_Path (MUIB_MUI|0x00426176) /* MUI: V4 ..g STRPTR */ +#define MUIA_Dirlist_RejectIcons (MUIB_MUI|0x00424808) /* MUI: V4 is. BOOL */ +#define MUIA_Dirlist_RejectPattern (MUIB_MUI|0x004259c7) /* MUI: V4 is. STRPTR */ +#define MUIA_Dirlist_SortDirs (MUIB_MUI|0x0042bbb9) /* MUI: V4 is. LONG */ +#define MUIA_Dirlist_SortHighLow (MUIB_MUI|0x00421896) /* MUI: V4 is. BOOL */ +#define MUIA_Dirlist_SortType (MUIB_MUI|0x004228bc) /* MUI: V4 is. LONG */ +#define MUIA_Dirlist_Status (MUIB_MUI|0x004240de) /* MUI: V4 ..g LONG */ + +enum { + MUIV_Dirlist_SortDirs_First = 0, + MUIV_Dirlist_SortDirs_Last, + MUIV_Dirlist_SortDirs_Mix, +}; + +enum { + MUIV_Dirlist_SortType_Name = 0, + MUIV_Dirlist_SortType_Date, + MUIV_Dirlist_SortType_Size, +}; + +enum { + MUIV_Dirlist_Status_Invalid = 0, + MUIV_Dirlist_Status_Reading, + MUIV_Dirlist_Status_Valid, +}; + + +#endif /* _MUI_CLASSES_DIRLIST_H */ +#endif + +#ifndef _MUI_CLASSES_NUMERICBUTTON_H +#ifndef _MUI_CLASSES_NUMERICBUTTON_H +#define _MUI_CLASSES_NUMERICBUTTON_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Numericbutton "Numericbutton.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +//#define MUIB_Numericbutton (MUIB_ZUNE | 0x????) + + +#endif /* _MUI_CLASSES_NUMERICBUTTON_H */ +#endif + +#ifndef _MUI_CLASSES_POPLIST_H +#ifndef _MUI_CLASSES_POPLIST_H +#define _MUI_CLASSES_POPLIST_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/****************************************************************************/ +/*** Name *******************************************************************/ +#define MUIC_Poplist "Poplist.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Poplist (MUIB_ZUNE | 0x00002500) + +/*** Attributes *************************************************************/ +#define MUIA_Poplist_Array (MUIB_MUI|0x0042084c) /* MUI: V8 i.. char ** */ + + +#endif /* _MUI_CLASSES_POPLIST_H */ +#endif + +#ifndef _MUI_CLASSES_POPSCREEN_H +#ifndef _MUI_CLASSES_POPSCREEN_H +#define _MUI_CLASSES_POPSCREEN_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/****************************************************************************/ +/*** Name *******************************************************************/ +#define MUIC_Popscreen "Popscreen.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Popscreen (MUIB_ZUNE | 0x00002600) + + + +#endif /* _MUI_CLASSES_POPSCREEN_H */ +#endif + +#ifndef _MUI_CLASSES_CRAWLING_H +#ifndef _MUI_CLASSES_CRAWLING_H +#define _MUI_CLASSES_CRAWLING_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/****************************************************************************/ +/*** Name *******************************************************************/ +#define MUIC_Crawling "Crawling.mcc" + +/*** Identifier base (for Zune extensions) **********************************/ +//#define MUIB_Crawling (MUIB_ZUNE | 0x0000????) + + +#endif /* _MUI_CLASSES_CRAWLING_H */ +#endif + +#ifndef _MUI_CLASSES_LEVELMETER_H +#ifndef _MUI_CLASSES_LEVELMETER_H +#define _MUI_CLASSES_LEVELMETER_H + +/* + Copyright © 2002-2006, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Levelmeter "Levelmeter.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +//#define MUIB_Levelmeter (MUIB_ZUNE | 0x????) + +/*** Attributes *************************************************************/ +#define MUIA_Levelmeter_Label (MUIB_MUI | 0x00420dd5) /* V11 isg STRPTR */ + + + +#endif /* _MUI_CLASSES_LEVELMETER_H */ +#endif + +#ifndef _MUI_CLASSES_KNOB_H +#ifndef _MUI_CLASSES_KNOB_H +#define _MUI_CLASSES_KNOB_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Knob "Knob.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +//#define MUIB_Knob (MUIB_ZUNE | 0x????) + + +#endif /* _MUI_CLASSES_KNOB_H */ +#endif + +#ifndef _MUI_CLASSES_DTPIC_H +#ifndef _MUI_CLASSES_DTPIC_H +#define _MUI_CLASSES_DTPIC_H + +/* + Copyright © 2002-2009, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Dtpic "Dtpic.mui" + +/*** Attributes *************************************************************/ +#define MUIA_Dtpic_Name (MUIB_MUI|0x00423d72) /* MUI: V18 isg STRPTR */ + + +#endif /* _MUI_CLASSES_DTPIC_H */ +#endif + +#ifndef _MUI_CLASSES_PALETTE_H +#ifndef _MUI_CLASSES_PALETTE_H +#define _MUI_CLASSES_PALETTE_H + +/* + Copyright © 2002-2003, The AROS Development Team. All rights reserved. + $Id$ +*/ + +/*** Name *******************************************************************/ +#define MUIC_Palette "Palette.mui" + +/*** Identifier base (for Zune extensions) **********************************/ +#define MUIB_Palette (MUIB_ZUNE | 0x00008a00) + +/*** Attributes *************************************************************/ +#define MUIA_Palette_Entries 0x8042a3d8 /* V6 i.g struct MUI_Palette_Entry * */ +#define MUIA_Palette_Groupable 0x80423e67 /* V6 isg BOOL */ +#define MUIA_Palette_Names 0x8042c3a2 /* V6 isg char ** */ + +#define MUIV_Palette_Entry_End -1 + +struct MUI_Palette_Entry +{ + LONG mpe_ID; + ULONG mpe_Red; + ULONG mpe_Green; + ULONG mpe_Blue; + LONG mpe_Group; +}; + + +#endif /* _MUI_PALETTE_H */ +#endif + +/************************************************************************** + Zune/MUI Image and Background definition +**************************************************************************/ +/* configured by the user within the prefs programm */ +#define MUII_WindowBack 0UL +#define MUII_RequesterBack 1UL +#define MUII_ButtonBack 2UL +#define MUII_ListBack 3UL +#define MUII_TextBack 4UL +#define MUII_PropBack 5UL +#define MUII_PopupBack 6UL +#define MUII_SelectedBack 7UL +#define MUII_ListCursor 8UL +#define MUII_ListSelect 9UL +#define MUII_ListSelCur 10UL +#define MUII_ArrowUp 11UL +#define MUII_ArrowDown 12UL +#define MUII_ArrowLeft 13UL +#define MUII_ArrowRight 14UL +#define MUII_CheckMark 15UL +#define MUII_RadioButton 16UL +#define MUII_Cycle 17UL +#define MUII_PopUp 18UL +#define MUII_PopFile 19UL +#define MUII_PopDrawer 20UL +#define MUII_PropKnob 21UL +#define MUII_Drawer 22UL +#define MUII_HardDisk 23UL +#define MUII_Disk 24UL +#define MUII_Chip 25UL +#define MUII_Volume 26UL +#define MUII_RegisterBack 27UL +#define MUII_Network 28UL +#define MUII_Assign 29UL +#define MUII_TapePlay 30UL +#define MUII_TapePlayBack 31UL +#define MUII_TapePause 32UL +#define MUII_TapeStop 33UL +#define MUII_TapeRecord 34UL +#define MUII_GroupBack 35UL +#define MUII_SliderBack 36UL +#define MUII_SliderKnob 37UL +#define MUII_TapeUp 38UL +#define MUII_TapeDown 39UL +#define MUII_PageBack 40UL +#define MUII_ReadListBack 41UL +#define MUII_Count 42UL + +/* direct color's and combinations */ +#define MUII_BACKGROUND 128UL +#define MUII_SHADOW 129UL +#define MUII_SHINE 130UL +#define MUII_FILL 131UL +#define MUII_SHADOWBACK 132UL +#define MUII_SHADOWFILL 133UL +#define MUII_SHADOWSHINE 134UL +#define MUII_FILLBACK 135UL +#define MUII_FILLSHINE 136UL +#define MUII_SHINEBACK 137UL +#define MUII_FILLBACK2 138UL +#define MUII_HSHINEBACK 139UL +#define MUII_HSHADOWBACK 140UL +#define MUII_HSHINESHINE 141UL +#define MUII_HSHADOWSHADOW 142UL +#define MUII_MARKSHINE 143UL +#define MUII_MARKHALFSHINE 144UL +#define MUII_MARKBACKGROUND 145UL +#define MUII_LASTPAT 146UL + + +/************************************************************************** + For ARexx +**************************************************************************/ +struct MUI_Command +{ + char *mc_Name; + char *mc_Template; + LONG mc_Parameters; + struct Hook *mc_Hook; + LONG mc_Reserved[5]; +}; + +#define MC_TEMPLATE_ID ((STRPTR)~0) + +#define MUI_RXERR_BADDEFINITION -1 +#define MUI_RXERR_OUTOFMEMORY -2 +#define MUI_RXERR_UNKNOWNCOMMAND -3 +#define MUI_RXERR_BADSYNTAX -4 + +#ifndef _MUI_MACROS_H +#ifndef _MUI_MACROS_H +#define _MUI_MACROS_H + +/* + Copyright © 2002-2007, The AROS Development Team. All rights reserved. + $Id$ + + Macros available in original MUI and also some additional ones. +*/ + +/* Some nice macrodefinitions for creating your object tree */ +#define MenustripObject MUIOBJMACRO_START(MUIC_Menustrip) +#define MenuObject MUIOBJMACRO_START(MUIC_Menu) +#define MenuObjectT(name) MUIOBJMACRO_START(MUIC_Menu), MUIA_Menu_Title, name +#define MenuitemObject MUIOBJMACRO_START(MUIC_Menuitem) +#define WindowObject MUIOBJMACRO_START(MUIC_Window) +#define ImageObject MUIOBJMACRO_START(MUIC_Image) +#define ImagedisplayObject MUIOBJMACRO_START(MUIC_Imagedisplay) +#define BitmapObject MUIOBJMACRO_START(MUIC_Bitmap) +#define BodychunkObject MUIOBJMACRO_START(MUIC_Bodychunk) +#define ChunkyImageObject MUIOBJMACRO_START(MUIC_ChunkyImage) +#define NotifyObject MUIOBJMACRO_START(MUIC_Notify) +#define ApplicationObject MUIOBJMACRO_START(MUIC_Application) +#define TextObject MUIOBJMACRO_START(MUIC_Text) +#define RectangleObject MUIOBJMACRO_START(MUIC_Rectangle) +#define BalanceObject MUIOBJMACRO_START(MUIC_Balance) +#define ListObject MUIOBJMACRO_START(MUIC_List) +#define PropObject MUIOBJMACRO_START(MUIC_Prop) +#define StringObject MUIOBJMACRO_START(MUIC_String) +#define ScrollbarObject MUIOBJMACRO_START(MUIC_Scrollbar) +#define ListviewObject MUIOBJMACRO_START(MUIC_Listview) +#define RadioObject MUIOBJMACRO_START(MUIC_Radio) +#define VolumelistObject MUIOBJMACRO_START(MUIC_Volumelist) +#define FloattextObject MUIOBJMACRO_START(MUIC_Floattext) +#define DirlistObject MUIOBJMACRO_START(MUIC_Dirlist) +#define CycleObject MUIOBJMACRO_START(MUIC_Cycle) +#define GaugeObject MUIOBJMACRO_START(MUIC_Gauge) +#define ScaleObject MUIOBJMACRO_START(MUIC_Scale) +#define NumericObject MUIOBJMACRO_START(MUIC_Numeric) +#define SliderObject MUIOBJMACRO_START(MUIC_Slider) +#define NumericbuttonObject MUIOBJMACRO_START(MUIC_Numericbutton) +#define KnobObject MUIOBJMACRO_START(MUIC_Knob) +#define LevelmeterObject MUIOBJMACRO_START(MUIC_Levelmeter) +#define BoopsiObject MUIOBJMACRO_START(MUIC_Boopsi) +#define ColorfieldObject MUIOBJMACRO_START(MUIC_Colorfield) +#define PenadjustObject MUIOBJMACRO_START(MUIC_Penadjust) +#define ColoradjustObject MUIOBJMACRO_START(MUIC_Coloradjust) +#define PaletteObject MUIOBJMACRO_START(MUIC_Palette) +#define GroupObject MUIOBJMACRO_START(MUIC_Group) +#define RegisterObject MUIOBJMACRO_START(MUIC_Register) +#define VirtgroupObject MUIOBJMACRO_START(MUIC_Virtgroup) +#define ScrollgroupObject MUIOBJMACRO_START(MUIC_Scrollgroup) +#define PopstringObject MUIOBJMACRO_START(MUIC_Popstring) +#define PopobjectObject MUIOBJMACRO_START(MUIC_Popobject) +#define PoplistObject MUIOBJMACRO_START(MUIC_Poplist) +#define PopscreenObject MUIOBJMACRO_START(MUIC_Popscreen) +#define PopaslObject MUIOBJMACRO_START(MUIC_Popasl) +#define PendisplayObject MUIOBJMACRO_START(MUIC_Pendisplay) +#define PoppenObject MUIOBJMACRO_START(MUIC_Poppen) +#define CrawlingObject MUIOBJMACRO_START(MUIC_Crawling) +/* The following in zune only */ +#define PopimageObject MUIOBJMACRO_START(MUIC_Popimage) +#define PopframeObject MUIOBJMACRO_START(MUIC_Popframe) +#define AboutmuiObject MUIOBJMACRO_START(MUIC_Aboutmui) +#define ScrmodelistObject MUIOBJMACRO_START(MUIC_Scrmodelist) +#define KeyentryObject MUIOBJMACRO_START(MUIC_Keyentry) +#define VGroup MUIOBJMACRO_START(MUIC_Group) +#define HGroup MUIOBJMACRO_START(MUIC_Group), MUIA_Group_Horiz, TRUE +#define ColGroup(columns) MUIOBJMACRO_START(MUIC_Group), MUIA_Group_Columns, (columns) +#define RowGroup(rows) MUIOBJMACRO_START(MUIC_Group), MUIA_Group_Rows , (rows) +#define PageGroup MUIOBJMACRO_START(MUIC_Group), MUIA_Group_PageMode, TRUE +#define VGroupV MUIOBJMACRO_START(MUIC_Virtgroup) +#define HGroupV MUIOBJMACRO_START(MUIC_Virtgroup), MUIA_Group_Horiz, TRUE +#define ColGroupV(columns) MUIOBJMACRO_START(MUIC_Virtgroup), MUIA_Group_Columns, (columns) +#define RowGroupV(rows) MUIOBJMACRO_START(MUIC_Virtgroup), MUIA_Group_Rows , (rows) +#define PageGroupV MUIOBJMACRO_START(MUIC_Virtgroup), MUIA_Group_PageMode, TRUE +#define RegisterGroup(ts) MUIOBJMACRO_START(MUIC_Register), MUIA_Register_Titles, ((IPTR) (ts)) + +#define End OBJMACRO_END + +#define Child MUIA_Group_Child +#define SubWindow MUIA_Application_Window +#define WindowContents MUIA_Window_RootObject + + +/************************************************************************** + Zune/MUI's differnt frame types. Use one per object +**************************************************************************/ +#define NoFrame MUIA_Frame, MUIV_Frame_None +#define ButtonFrame MUIA_Frame, MUIV_Frame_Button +#define ImageButtonFrame MUIA_Frame, MUIV_Frame_ImageButton +#define TextFrame MUIA_Frame, MUIV_Frame_Text +#define StringFrame MUIA_Frame, MUIV_Frame_String +#define ReadListFrame MUIA_Frame, MUIV_Frame_ReadList +#define InputListFrame MUIA_Frame, MUIV_Frame_InputList +#define PropFrame MUIA_Frame, MUIV_Frame_Prop +#define SliderFrame MUIA_Frame, MUIV_Frame_Slider +#define GaugeFrame MUIA_Frame, MUIV_Frame_Gauge +#define VirtualFrame MUIA_Frame, MUIV_Frame_Virtual +#define GroupFrame MUIA_Frame, MUIV_Frame_Group +#define GroupFrameT(t) MUIA_Frame, MUIV_Frame_Group, MUIA_FrameTitle, ((IPTR) (t)), MUIA_Background, MUII_GroupBack + + +/************************************************************************** + Space objects +**************************************************************************/ +#define HVSpace MUI_NewObject(MUIC_Rectangle,TAG_DONE) +#define HSpace(x) MUI_MakeObject(MUIO_HSpace,x) +#define VSpace(x) MUI_MakeObject(MUIO_VSpace,x) +#define HBar(x) MUI_MakeObject(MUIO_HBar,x) +#define VBar(x) MUI_MakeObject(MUIO_VBar,x) +#define HCenter(obj) (HGroup, GroupSpacing(0), Child, (IPTR)HSpace(0), Child, (IPTR)(obj), Child, (IPTR)HSpace(0), End) +#define VCenter(obj) (VGroup, GroupSpacing(0), Child, (IPTR)VSpace(0), Child, (IPTR)(obj), Child, (IPTR)VSpace(0), End) +#define InnerSpacing(h,v) MUIA_InnerLeft,(h),MUIA_InnerRight,(h),MUIA_InnerTop,(v),MUIA_InnerBottom,(v) +#define GroupSpacing(x) MUIA_Group_Spacing,x + +#ifdef MUI_OBSOLETE +/************************************************************************** + These macros will create a simple string gadget. Don't use this in + new code. Use MUI_MakeObject() instead. +**************************************************************************/ +#define String(contents,maxlen)\ + StringObject,\ + StringFrame,\ + MUIA_String_MaxLen , maxlen,\ + MUIA_String_Contents, contents,\ + End + +#define KeyString(contents,maxlen,controlchar)\ + StringObject,\ + StringFrame,\ + MUIA_ControlChar , controlchar,\ + MUIA_String_MaxLen , maxlen,\ + MUIA_String_Contents, contents,\ + End + +#endif + +#ifdef MUI_OBSOLETE +/************************************************************************** + These macros will create a simple checkmark gadget. Don't use this in + new code. Use MUI_MakeObject() instead. +**************************************************************************/ +#define CheckMark(sel) ImageObject, ImageButtonFrame, MUIA_InputMode, MUIV_InputMode_Toggle, MUIA_Image_Spec, MUII_CheckMark, MUIA_Image_FreeVert, TRUE, MUIA_Background, MUII_ButtonBack, MUIA_ShowSelState, FALSE, MUIA_Selected, sel, End +#define KeyCheckMark(sel,ctrl) ImageObject, ImageButtonFrame, MUIA_InputMode, MUIV_InputMode_Toggle, MUIA_Image_Spec, MUII_CheckMark, MUIA_Image_FreeVert, TRUE, MUIA_Background, MUII_ButtonBack, MUIA_ShowSelState, FALSE, MUIA_Selected, sel, MUIA_ControlChar, ctrl, End +#endif + + +/************************************************************************** + These macros will create a simple button. It's simply calling + MUI_MakeObject() +**************************************************************************/ +#define SimpleButton(label) MUI_MakeObject(MUIO_Button,(IPTR)(label)) +#define ImageButton(label, imagePath) MUI_MakeObject(MUIO_ImageButton, (IPTR) (label), (IPTR) (imagePath)) + +#define CoolImageButton(label,image) MUI_MakeObject(MUIO_CoolButton, (IPTR)(label), (IPTR)(image), 0) +#define CoolImageIDButton(label,imageid) MUI_MakeObject(MUIO_CoolButton, (IPTR)(label), imageid, MUIO_CoolButton_CoolImageID) + +#ifdef MUI_OBSOLETE +/************************************************************************** + A Keybutton macro. The key should be in lower case. + Don't use this in new code. Use MUI_MakeObject() instead. +**************************************************************************/ +#define KeyButton(name,key) TextObject, ButtonFrame, MUIA_Font, MUIV_Font_Button, MUIA_Text_Contents, (IPTR)(name), MUIA_Text_PreParse, "\33c", MUIA_Text_HiChar, (IPTR)(key), MUIA_ControlChar, key, MUIA_InputMode, MUIV_InputMode_RelVerify, MUIA_Background, MUII_ButtonBack, End +#endif + + +#ifdef MUI_OBSOLETE +/************************************************************************** + Obsolette Cycle macros +**************************************************************************/ +#define Cycle(ent) CycleObject, MUIA_Font, MUIV_Font_Button, MUIA_Cycle_Entries, ent, End +#define KeyCycle(ent,key) CycleObject, MUIA_Font, MUIV_Font_Button, MUIA_Cycle_Entries, ent, MUIA_ControlChar, key, End + +/************************************************************************** + Obsolette Radios macros +**************************************************************************/ +#define Radio(name,array) RadioObject, GroupFrameT(name), MUIA_Radio_Entries, (IPTR)(array), End +#define KeyRadio(name,array,key) RadioObject, GroupFrameT(name), MUIA_Radio_Entries, (IPTR)(array), MUIA_ControlChar, (IPTR)(key), End + +/************************************************************************** + Obsolette Slider macros +**************************************************************************/ +#define Slider(min,max,level) SliderObject, MUIA_Numeric_Min, min, MUIA_Numeric_Max, max, MUIA_Numeric_Value, level, End +#define KeySlider(min,max,level,key) SliderObject, MUIA_Numeric_Min, min, MUIA_Numeric_Max, max, MUIA_Numeric_Value, level, MUIA_ControlChar, key, End +#endif + + + +/************************************************************************** + Use this for getting a pop button +**************************************************************************/ +#define PopButton(img) MUI_MakeObject(MUIO_PopButton, img) + + +/************************************************************************** + Macros for Labelobjects + Use them for example in a group containing 2 columns, in the first + columns the label and in the second columns the object. + + These objects should be uses because the user might have set strange + values. + + xxxLabel() is suited for Objects without frame + xxxLabel1() is suited for objects with a single frame, like buttons + xxxLabel2() is suited for objects with with double frames, like string gadgets +**************************************************************************/ + +/* Right aligned */ +#define Label(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), 0) +#define Label1(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_SingleFrame) +#define Label2(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_DoubleFrame) + +/* Left aligned */ +#define LLabel(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_LeftAligned) +#define LLabel1(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_LeftAligned | MUIO_Label_SingleFrame) +#define LLabel2(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_LeftAligned | MUIO_Label_DoubleFrame) + +/* Centered */ +#define CLabel(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_Centered) +#define CLabel1(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_Centered | MUIO_Label_SingleFrame) +#define CLabel2(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_Centered | MUIO_Label_DoubleFrame) + +/* Freevert - Right aligned */ +#define FreeLabel(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert) +#define FreeLabel1(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_SingleFrame) +#define FreeLabel2(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_DoubleFrame) + +/* Freevert - Left aligned */ +#define FreeLLabel(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_LeftAligned) +#define FreeLLabel1(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_LeftAligned | MUIO_Label_SingleFrame) +#define FreeLLabel2(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_LeftAligned | MUIO_Label_DoubleFrame) + +/* Freevert - Centered */ +#define FreeCLabel(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_Centered) +#define FreeCLabel1(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_Centered | MUIO_Label_SingleFrame) +#define FreeCLabel2(label) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_Centered | MUIO_Label_DoubleFrame) + +/* The same as above + keys */ +#define KeyLabel(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), key) +#define KeyLabel1(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_SingleFrame | (key)) +#define KeyLabel2(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_DoubleFrame | (key)) +#define KeyLLabel(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_LeftAligned | (key)) +#define KeyLLabel1(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_LeftAligned | MUIO_Label_SingleFrame|(key)) +#define KeyLLabel2(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_LeftAligned | MUIO_Label_DoubleFrame|(key)) +#define KeyCLabel(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_Centered | (key)) +#define KeyCLabel1(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_Centered | MUIO_Label_SingleFrame|(key)) +#define KeyCLabel2(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_Centered | MUIO_Label_DoubleFrame|(key)) + +#define FreeKeyLabel(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | (key)) +#define FreeKeyLabel1(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_SingleFrame | (key)) +#define FreeKeyLabel2(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_DoubleFrame | (key)) +#define FreeKeyLLabel(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_LeftAligned | (key)) +#define FreeKeyLLabel1(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_LeftAligned | MUIO_Label_SingleFrame | (key)) +#define FreeKeyLLabel2(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_LeftAligned | MUIO_Label_DoubleFrame | (key)) +#define FreeKeyCLabel(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_Centered | (key)) +#define FreeKeyCLabel1(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_Centered | MUIO_Label_SingleFrame | (key)) +#define FreeKeyCLabel2(label,key) MUI_MakeObject(MUIO_Label, (IPTR)(label), MUIO_Label_FreeVert | MUIO_Label_Centered | MUIO_Label_DoubleFrame | (key)) + + +/* Some macros */ +#ifndef __cplusplus + +#ifdef __GNUC__ +#define get(obj, attr, storage) \ +({ \ + union { \ + IPTR __zune_get_storage; \ + typeof(*storage) __zune_val_storage; \ + } __tmp; \ + __tmp.__zune_val_storage = *storage; \ + ULONG __zune_get_ret = GetAttr((attr), (obj), &__tmp.__zune_get_storage); \ + *(storage) = __tmp.__zune_val_storage; \ + __zune_get_ret; \ +}) +#else /* !__GNUC__ */ +#define get(obj,attr,store) GetAttr(attr,obj,(IPTR *)store) +#endif /* !__GNUC__ */ + +#ifdef __GNUC__ +#define XGET(object, attribute) \ +({ \ + IPTR __storage = 0; \ + GetAttr((attribute), (object), &__storage); \ + __storage; \ +}) +#endif /* __GNUC__ */ + +#define set(obj,attr,value) SetAttrs(obj,attr,(IPTR)(value),TAG_DONE) +#define nnset(obj,attr,value) SetAttrs(obj,MUIA_NoNotify,TRUE,attr,(IPTR)(value),TAG_DONE) + +/* Zune */ +#define nfset(obj,attr,value) SetAttrs(obj,MUIA_Group_Forward,FALSE,attr,(IPTR)(value),TAG_DONE) +#define nnfset(obj,attr,value) SetAttrs(obj,MUIA_Group_Forward,FALSE,MUIA_NoNotify,TRUE,attr,(IPTR)(value),TAG_DONE) + +/* Some aliases... */ +#define GET(obj,attr,store) get(obj,attr,store) +#define SET(obj,attr,value) set(obj,attr,value) +#define NNSET(obj,attr,value) nnset(obj,attr,value) +#define NFSET(obj,attr,value) nfset(obj,attr,value) +#define NNFSET(obj,attr,value) nnfset(obj,attr,value) + +#define setmutex(obj,n) set(obj,MUIA_Radio_Active,n) +#define setcycle(obj,n) set(obj,MUIA_Cycle_Active,n) +#define setstring(obj,s) set(obj,MUIA_String_Contents,(IPTR)(s)) +#define setcheckmark(obj,b) set(obj,MUIA_Selected,b) +#define setslider(obj,l) set(obj,MUIA_Numeric_Value,l) + +#endif /* __cplusplus */ + + +/* We need the notify and area Instace Data at least here, but this stuff should be placed at the button anywhy */ +#ifndef _MUI_CLASSES_NOTIFY_H +#endif + +#ifndef _MUI_CLASSES_AREA_H +#endif + +struct __dummyAreaData__ +{ + struct MUI_NotifyData mnd; + struct MUI_AreaData mad; +}; + +#define muiNotifyData(obj) (&(((struct __dummyAreaData__ *)(obj))->mnd)) +#define muiAreaData(obj) (&(((struct __dummyAreaData__ *)(obj))->mad)) + +#define muiGlobalInfo(obj) (((struct __dummyAreaData__ *)(obj))->mnd.mnd_GlobalInfo) +#define muiUserData(obj) (((struct __dummyAreaData__ *)(obj))->mnd.mnd_UserData) +#define muiRenderInfo(obj) (((struct __dummyAreaData__ *)(obj))->mad.mad_RenderInfo) + + +/* the following macros are only valid inbetween MUIM_Setup and MUIM_Cleanup */ +#define _app(obj) (muiGlobalInfo(obj)->mgi_ApplicationObject) +#define _win(obj) (muiRenderInfo(obj)->mri_WindowObject) +#define _dri(obj) (muiRenderInfo(obj)->mri_DrawInfo) +#define _screen(obj) (muiRenderInfo(obj)->mri_Screen) +#define _pens(obj) (muiRenderInfo(obj)->mri_Pens) +#define _font(obj) (muiAreaData(obj)->mad_Font) + +/* the following macros are only valid during MUIM_Draw */ +#define _left(obj) (muiAreaData(obj)->mad_Box.Left) +#define _top(obj) (muiAreaData(obj)->mad_Box.Top) +#define _width(obj) (muiAreaData(obj)->mad_Box.Width) +#define _height(obj) (muiAreaData(obj)->mad_Box.Height) +#define _right(obj) (_left(obj) + _width(obj) - 1) +#define _bottom(obj) (_top(obj) + _height(obj) - 1) +#define _addleft(obj) (muiAreaData(obj)->mad_addleft ) +#define _addtop(obj) (muiAreaData(obj)->mad_addtop ) +#define _subwidth(obj) (muiAreaData(obj)->mad_subwidth ) +#define _subheight(obj) (muiAreaData(obj)->mad_subheight) +#define _mleft(obj) (_left(obj) + _addleft(obj)) +#define _mtop(obj) (_top(obj) + _addtop(obj)) +#define _mwidth(obj) (_width(obj) - _subwidth(obj)) +#define _mheight(obj) (_height(obj) - _subheight(obj)) +#define _mright(obj) (_mleft(obj) + _mwidth(obj) - 1) +#define _mbottom(obj) (_mtop(obj) + _mheight(obj) - 1) + +/* the following macros are only valid inbetween MUIM_Show and MUIM_Hide */ +#define _window(obj) (muiRenderInfo(obj)->mri_Window) +#define _rp(obj) (muiRenderInfo(obj)->mri_RastPort) +#define _minwidth(obj) (muiAreaData(obj)->mad_MinMax.MinWidth) +#define _minheight(obj) (muiAreaData(obj)->mad_MinMax.MinHeight) +#define _maxwidth(obj) (muiAreaData(obj)->mad_MinMax.MaxWidth) +#define _maxheight(obj) (muiAreaData(obj)->mad_MinMax.MaxHeight) +#define _defwidth(obj) (muiAreaData(obj)->mad_MinMax.DefWidth) +#define _defheight(obj) (muiAreaData(obj)->mad_MinMax.DefHeight) +#define _flags(obj) (muiAreaData(obj)->mad_Flags) + + + +#endif /* _MUI_MACROS_H */ +#endif + +#endif /* LIBRARIES_MUI_H */ diff --git a/workbench/classes/zune/nlist/include/mcc_common.h b/workbench/classes/zune/nlist/include/mcc_common.h new file mode 100644 index 0000000000..b1dbd8e6d3 --- /dev/null +++ b/workbench/classes/zune/nlist/include/mcc_common.h @@ -0,0 +1,64 @@ +/*************************************************************************** + + NList MUI custom classes + + Copyright (C) 1996-2001 by Gilles Masson (NList.mcc) + Copyright (C) 1999-2001 by Carsten Scholling (NListtree.mcc) + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include "SDI_compiler.h" +#include "SDI_hook.h" +#include "SDI_lib.h" +#include "SDI_stdarg.h" + +#ifdef __amigaos4__ + +#include <proto/intuition.h> + +/* redefine some defines to allow complexer macro use later on */ +#define DoMethod IDoMethod +#define DoMethodA IDoMethodA +#define DoSuperMethod IDoSuperMethod +#define DoSuperMethodA IDoSuperMethodA +#define SetSuperAttrs ISetSuperAttrs +#define CoerceMethod ICoerceMethod +#define CoerceMethodA ICoerceMethodA +#define CallHookA CallHookPkt + +#ifdef OpenWindowTags +#undef OpenWindowTags +#define OpenWindowTags IIntuition->OpenWindowTags +#endif + +#ifdef NewObject +#undef NewObject +#define NewObject IIntuition->NewObject +#endif + +#define GETINTERFACE(iface, base) (iface = (APTR)GetInterface((struct Library *)(base), "main", 1L, NULL)) +#define DROPINTERFACE(iface) (DropInterface((struct Interface *)iface), iface = NULL) + +#else + +#include <clib/alib_protos.h> + +#define GETINTERFACE(iface, base) TRUE +#define DROPINTERFACE(iface) + +#endif /* ! __amigaos4__ */ diff --git a/workbench/classes/zune/nlist/include/mccclass_68k.c b/workbench/classes/zune/nlist/include/mccclass_68k.c new file mode 100644 index 0000000000..59139145a7 --- /dev/null +++ b/workbench/classes/zune/nlist/include/mccclass_68k.c @@ -0,0 +1,78 @@ +/* +** This file was automatically generated by fdtrans 51.14. +** Do not edit it by hand. Instead, edit the sfd file +** that was used to generate this file +*/ + +#ifdef __USE_INLINE__ +#undef __USE_INLINE__ +#endif +#ifndef __NOGLOBALIFACE__ +#define __NOGLOBALIFACE__ +#endif + +#include <exec/interfaces.h> +#include <exec/libraries.h> +#include <exec/emulation.h> +#include <interfaces/exec.h> +#include <interfaces/mccclass.h> +#include <proto/mccclass.h> + + +static inline int8 convert_int8 (uint32 x) { return x; } +static inline int16 convert_int16(uint32 x) { return x; } + + +STATIC struct Library * stub_OpenPPC(ULONG *regarray) +{ + struct Library *Base = (struct Library *) regarray[REG68K_A6/4]; + struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((ULONG)Base + Base->lib_PosSize); + struct LibraryManagerInterface *Self = (struct LibraryManagerInterface *) ExtLib->ILibrary; + + return Self->Open(0); +} +STATIC CONST struct EmuTrap stub_Open = { TRAPINST, TRAPTYPE, (ULONG (*)(ULONG *))stub_OpenPPC }; + +STATIC APTR stub_ClosePPC(ULONG *regarray) +{ + struct Library *Base = (struct Library *) regarray[REG68K_A6/4]; + struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((ULONG)Base + Base->lib_PosSize); + struct LibraryManagerInterface *Self = (struct LibraryManagerInterface *) ExtLib->ILibrary; + + return Self->Close(); +} +STATIC CONST struct EmuTrap stub_Close = { TRAPINST, TRAPTYPE, (ULONG (*)(ULONG *))stub_ClosePPC }; + +STATIC APTR stub_ExpungePPC(ULONG *regarray __attribute__((unused))) +{ + return NULL; +} +STATIC CONST struct EmuTrap stub_Expunge = { TRAPINST, TRAPTYPE, (ULONG (*)(ULONG *))stub_ExpungePPC }; + +STATIC ULONG stub_ReservedPPC(ULONG *regarray __attribute__((unused))) +{ + return 0UL; +} +STATIC CONST struct EmuTrap stub_Reserved = { TRAPINST, TRAPTYPE, stub_ReservedPPC }; + +static ULONG stub_MCC_QueryPPC(ULONG *regarray) +{ + struct Library *Base = (struct Library *) regarray[REG68K_A6/4]; + struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((ULONG)Base + Base->lib_PosSize); + struct MCCClassIFace *Self = (struct MCCClassIFace *) ExtLib->MainIFace; + + return Self->MCC_Query( + (LONG)regarray[0] + ); +} +STATIC CONST struct EmuTrap stub_MCC_Query = { TRAPINST, TRAPTYPE, (ULONG (*)(ULONG *))stub_MCC_QueryPPC }; + +CONST CONST_APTR VecTable68K[] = +{ + &stub_Open, + &stub_Close, + &stub_Expunge, + &stub_Reserved, + &stub_MCC_Query, + (CONST_APTR)-1 +}; diff --git a/workbench/classes/zune/nlist/include/mccinit.c b/workbench/classes/zune/nlist/include/mccinit.c new file mode 100644 index 0000000000..e8d7a9e9e7 --- /dev/null +++ b/workbench/classes/zune/nlist/include/mccinit.c @@ -0,0 +1,1337 @@ +/******************************************************************************* + + Name: mccinit.c + Versionstring: $VER: mccinit.c 1.25 (20.12.2010) + Author: Jens Langner <Jens.Langner@light-speed.de> + Distribution: PD (public domain) + Description: library init file for easy generation of a MUI + custom classes (MCC/MCP) + History: + + 1.0 09.06.2007 : created based on obsolete mccheader.c (damato) + 1.1 10.06.2007 : modified LibInit/LibOpen/LibExpunge to call the actual + ClassOpen() in LibOpen() rather than in LibInit(). This + should prevent stack issues common on e.g. OS3. (damato) + 1.2 01.07.2007 : adapted library interface initialization to what the + very latest idltool 52.7 produces as well. + 1.3 04.07.2007 : added MIN_STACKSIZE and all required StackSwap() + mechanisms to enforce a large enough stack. + 1.4 04.07.2007 : put the StackSwapStruct structure on the stack to avoid + crashes on OS3/MOS. + 1.5 18.07.2007 : added new inline assember stackswap_call() function which + allows to call a function within a new stack frame + initiated by StackSwap(). This should make the whole + stack swapping mechanism more safe. + 1.6 24.07.2007 : corrected an else-branch which only exists if CLASSINIT + is defined and added an UNUSED extension to the Expunge() + function in case the base parameter is not used. + 1.7 25.07.2007 : adapted GETINTERFACE() and library base definitions so + that mccinit.c can also be used with C++ + 1.8 25.07.2007 : removed the obsolete 2-parameter version of GETINTERFACE() + from mcc_common.h and adapted all calls accordingly. + Also moved the inclusion of mccinit.c in front of all + user definable functions. + 1.9 09.08.2007 : applied a patch kindly provided by Ilkka Lehtoranta which + replaces the assembler code for stack swapping with the + appropriate call to the NewPPCStackSwap() function in + MorphOS. In addition, the stack size will now be properly + checked before a stack swap is attempted. + 1.10 13.08.2007 : the StackSwap structure itself *must* *not* be placed on the + stack which will be swapped later, because swapping it back + will access the wrong place in memory. Hence this structure + is allocated from global memory now. + 1.11 01.02.2008 : fixed some minor compiler warnings when compiled using the + MorphOS SDK. + 1.12 27.03.2009 : integrated some changes which should make mccinit usable + for AROS builds. + 1.13 01.04.2009 : fixed the broken prototype for the assembler stackswap_call + function. + 1.14 02.05.2009 : added RTF_EXTENDED for the MorphOS build as well + 1.15 24.05.2009 : fixed some compiler warnings appear on AROS compile + 1.16 25.05.2009 : fixed some compiler warnings appear on OS3/MOS compile + 1.17 02.06.2009 : more fixes to better comply for AROS compilation + 1.18 24.04.2010 : fixed stack swapping for AROS + 1.19 25.05.2010 : updated for compatibility with AROS V1 API + 1.20 01.06.2010 : added CleanupDebug() call to expunge function. + 1.21 17.08.2010 : the UserLibName and UserLibID strings are now correctly + placed in the .data instead of the .text section. Also made + sure that the _start() function is really the first entry, + otherwise random data will be executed as code, which will + crash for sure. + 1.22 03.09.2010 : the library semaphore is now correctly cleared ahead of the + InitSemaphore() call. + 1.23 07.09.2010 : added missing #include <string.h> for memset(). + 1.24 05.10.2010 : make sure that removing the library during LibClose() really + operates on the correct base. Calling LibExpunge() on MorphOS + is wrong, since that takes no parameter but expects the base + to be in A6. We work around this by using an additional + function which gets called from LibClose() and LibExpunge() + with the correct base pointer. + 1.25 20.12.2010 : minimum required system version is now OS3.0 (V39). + + About: + + The purpose of this source file is to provide a template for the library init + code for a creation of an own MUI custom class (mcc/mcp) for AmigaOS4, + AmigaOS3 and MorphOS. By directly including this file (#include "mccinit.c") + and defining certain preprocessor values, a MUI developer doesn't have to + care about library init stuff which is normally highly system dependent and + various between different Amiga operating systems. + + Usage: + + This file should be included by another source file (e.g. 'library.c') in + your main development branch while certain preprocessor macros right before + the include statement can be defined to change the behaviour of mccinit.c. + These possible macros are: + + USERLIBID (char*) - version string for the mcc/mcp (exluding $VER:) + VERSION (int) - version number (must match USERLIBID) + REVISION (int) - revision number (must match USERLIBID) + CLASS (char*) - class name (including .mcc/.mcp) + MASTERVERSION (int) - the minimun required muimaster version + (default: MUIMASTER_VMIN) + MIN_STACKSIZE (int) - if defined, the specified minimum stack size + will be enforced when calling all user functions + like ClassXXXX() and PreClassXXX(). + + MCC only: + -------- + SUPERCLASS (char*) - superclass ID of MCC (e.g. MUIC_Area) + INSTDATA - name of instance data structure of MCC (e.g. InstData) + USEDCLASSES - name of NULL terminated string array which contains + names of other required custom classes for MCC. + _Dispatcher - name of Dispatcher function for MCC + + MCP only: + ------- + SUPERCLASSP (char*) - superclass ID of MCP (e.g. MUIC_Mccprefs) + INSTDATAP - name of instance data structure of MCP + USEDCLASSESP - name of NULL terminated string array which contains + names of other required custom classes for MCC. + SHORTHELP (char*) - alternative help text for prefs program's listview + PREFSIMAGEOBJECT - pointer to the image object for the MCP + _DispatcherP - name of Dispatcher function for MCP + + In addition, the following defines and functions can be defined or are + required: + + CLASSINIT - if defined, a "BOOL ClassInit(struct Library *base)" + function can be defined in your own code and will be called + right after the general library initialization are + finished. This function should then open own libraries + or do own library initialization tasks as it is only called + once at the very first library/class open. + + CLASSEXPUNGE - if defined a "VOID ClassExpunge(struct Library *base)" + function can be defined in your own code and will be called + as soon as the library will be freed/expunged by the + operating system. In this function you should close/free + stuff you normally opened/allocated in CLASSINIT. + + CLASSOPEN - if defined, a "BOOL ClassOpen(struct Library *base)" + function can be defined in your own code and will be called + right after each single application opens the custom class. + In this function you can then set flags or do library open + specific tasks. + + CLASSCLOSE - if defined a "VOID ClassClose(struct Library *base)" + function can be defined in your own code and will be called + right after the library was successfully flagged as closed + by the CloseLibrary() call of an application. + + + PRECLASSINIT - if defined a "BOOL PreClassInit(struct Library *base)" + function can be defined and will be called right _before_ + and library initialization takes place. + + POSTCLASSEXPUNGE - if defined a "BOOL PostClassExpunge(struct Library *base)" + function can be defined and will be called right _after_ + the custom class was free via MUI_DeleteCustomClass() in + the library expunge phase. + + Warning: + ------- + The above class functions are normally called by the operating system + in a Forbid()/Permit() state. That means you are supposed to make sure that + your operations doesn't break the Forbid() state or otherwise you may run + into a race condition. However, we have added semaphore locking to partly + protect you from that case - but you should still consider doing processor + intensitive tasks in a library's own function instead of using those + class initialization functions. + +*******************************************************************************/ + +/******************************************************************************/ +/* Includes */ +/******************************************************************************/ + +#include <string.h> + +#ifdef __MORPHOS__ +#include <emul/emulinterface.h> +#include <emul/emulregs.h> +#endif + +#include <exec/types.h> +#include <exec/memory.h> +#include <exec/libraries.h> +#include <exec/semaphores.h> +#include <exec/resident.h> +#include <exec/execbase.h> +#include <dos/dos.h> + +#include <proto/exec.h> +#include <proto/muimaster.h> +#include <proto/utility.h> +#include <proto/dos.h> +#include <proto/graphics.h> +#include <proto/intuition.h> + +#ifdef __AROS__ +#include <aros/libcall.h> +#endif + +#include "SDI_compiler.h" + +#if defined(__amigaos4__) +struct Library *MUIMasterBase = NULL; +struct Library *SysBase = NULL; +struct Library *UtilityBase = NULL; +struct Library *DOSBase = NULL; +struct Library *GfxBase = NULL; +struct Library *IntuitionBase = NULL; +struct ExecIFace *IExec = NULL; +struct MUIMasterIFace *IMUIMaster = NULL; +struct UtilityIFace *IUtility = NULL; +struct DOSIFace *IDOS = NULL; +struct GraphicsIFace *IGraphics = NULL; +struct IntuitionIFace *IIntuition = NULL; +#if defined(__NEWLIB__) +struct Library *NewlibBase = NULL; +struct Interface *INewlib = NULL; +#endif +#else +struct Library *MUIMasterBase = NULL; +struct ExecBase *SysBase = NULL; +#if defined(__AROS__) +struct UtilityBase *UtilityBase = NULL; +#else +struct Library *UtilityBase = NULL; +#endif +struct DosLibrary *DOSBase = NULL; +struct GfxBase *GfxBase = NULL; +struct IntuitionBase *IntuitionBase = NULL; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// we place a stack cookie in the binary so that +// newer OS version can directly take the specified +// number for the ramlib process +#if defined(MIN_STACKSIZE) + +// transforms a define into a string +#define STR(x) STR2(x) +#define STR2(x) #x + +#ifdef __amigaos4__ +STATIC const char USED_VAR stack_size[] = "$STACK:" STR(MIN_STACKSIZE) "\n"; +#endif +#endif + +/* The name of the class will also become the name of the library. */ +/* We need a pointer to this string in our ROMTag (see below). */ +STATIC const char UserLibName[] = CLASS; +STATIC const char UserLibID[] = "$VER: " USERLIBID; + +#ifdef SUPERCLASS +STATIC struct MUI_CustomClass *ThisClass = NULL; +DISPATCHERPROTO(_Dispatcher); +#endif + +#ifdef SUPERCLASSP +STATIC struct MUI_CustomClass *ThisClassP = NULL; +DISPATCHERPROTO(_DispatcherP); +#endif + +#ifdef __GNUC__ + + #if !defined(__NEWLIB__) + #if defined(__amigaos4__) + extern struct Library *__UtilityBase; // clib2 + extern struct UtilityIFace* __IUtility; // clib2 + #else + struct Library *__UtilityBase = NULL; // required by libnix & clib2 + #endif + #endif + + /* these one are needed copies for libnix.a */ + #ifdef __libnix__ + #ifdef USE_MATHIEEEDOUBBASBASE + struct Library *__MathIeeeDoubBasBase = NULL; + #endif + #ifdef USE_MATHIEEEDOUBTRANSBASE + struct Library *__MathIeeeDoubTransBase = NULL; + #endif + #endif + +#endif /* __GNUC__ */ + + +// define own macros for the OS4 interfaces +#undef GETINTERFACE +#undef DROPINTERFACE +#if defined(__amigaos4__) +#define GETINTERFACE(iface, type, base) (iface = (type)GetInterface((struct Library *)(base), "main", 1L, NULL)) +#define DROPINTERFACE(iface) (DropInterface((struct Interface *)iface), iface = NULL) +#else +#define GETINTERFACE(iface, type, base) TRUE +#define DROPINTERFACE(iface) +#endif + +// in case the user didn't specify an own minimum +// muimaster version we increase it here. +#ifndef MASTERVERSION +#define MASTERVERSION MUIMASTER_VMIN +#endif + +/* Our library structure, consisting of a struct Library, a segment pointer */ +/* and a semaphore. We need the semaphore to protect init/exit stuff in our */ +/* open/close fuSnctions */ +struct LibraryHeader +{ + struct Library lh_Library; + UWORD lh_Pad1; + BPTR lh_Segment; + struct SignalSemaphore lh_Semaphore; + UWORD lh_Pad2; +}; + +/******************************************************************************/ +/* Local Structures & Prototypes */ +/******************************************************************************/ + +#if defined(__amigaos4__) + +STATIC struct LibraryHeader * LIBFUNC LibInit (struct LibraryHeader *base, BPTR librarySegment, struct ExecIFace *pIExec); +STATIC BPTR LIBFUNC LibExpunge (struct LibraryManagerInterface *Self); +STATIC struct LibraryHeader * LIBFUNC LibOpen (struct LibraryManagerInterface *Self, ULONG version); +STATIC BPTR LIBFUNC LibClose (struct LibraryManagerInterface *Self); +STATIC IPTR LIBFUNC MCC_Query (UNUSED struct Interface *self, REG(d0, LONG which)); + +#elif defined(__MORPHOS__) + +STATIC struct LibraryHeader * LIBFUNC LibInit (struct LibraryHeader *base, BPTR librarySegment, struct ExecBase *sb); +STATIC BPTR LIBFUNC LibExpunge (void); +STATIC struct LibraryHeader * LIBFUNC LibOpen (void); +STATIC BPTR LIBFUNC LibClose (void); +STATIC LONG LIBFUNC LibNull (void); +STATIC IPTR LIBFUNC MCC_Query (void); + +#elif defined(__AROS__) + +AROS_UFP3 (struct LibraryHeader *, LibInit, + AROS_UFPA(struct LibraryHeader *, base, D0), + AROS_UFPA(BPTR, librarySegment, A0), + AROS_UFPA(struct ExecBase *, sb, A6) +); +AROS_LD1(BPTR, LibExpunge, + AROS_LPA(struct LibraryHeader *, base, D0), + struct LibraryHeader *, base, 3, __MCC_ +); +AROS_LD1 (struct LibraryHeader *, LibOpen, + AROS_LHA (ULONG, version, D0), + struct LibraryHeader *, base, 1, __MCC_ +); +AROS_LD0 (BPTR, LibClose, + struct LibraryHeader *, base, 2, __MCC_ +); +AROS_LD1(IPTR, MCC_Query, + AROS_LHA(LONG, what, D0), + struct LibraryHeader *, LIBBASE, 5, __MCC_ +); + +#else + +STATIC struct LibraryHeader * LIBFUNC LibInit (REG(d0, struct LibraryHeader *base), REG(a0, BPTR librarySegment), REG(a6, struct ExecBase *sb)); +STATIC BPTR LIBFUNC LibExpunge (REG(a6, struct LibraryHeader *base)); +STATIC struct LibraryHeader * LIBFUNC LibOpen (REG(d0, ULONG version), REG(a6, struct LibraryHeader *base)); +STATIC BPTR LIBFUNC LibClose (REG(a6, struct LibraryHeader *base)); +STATIC LONG LIBFUNC LibNull (void); +STATIC IPTR LIBFUNC MCC_Query (REG(d0, LONG which)); + +#endif + +/******************************************************************************/ +/* Dummy entry point and LibNull() function all in one */ +/******************************************************************************/ + +/* + * The system (and compiler) rely on a symbol named _start which marks + * the beginning of execution of an ELF file. To prevent others from + * executing this library, and to keep the compiler/linker happy, we + * define an empty _start symbol here. + * + * On the classic system (pre-AmigaOS4) this was usually done by + * moveq #0,d0 + * rts + * + */ + +#if defined(__amigaos4__) && !defined(__AROS__) && !defined(__MORPHOS__) +#if !defined(__mc68000__) +int32 _start(void) +{ + return RETURN_FAIL; +} +#else +asm(".text \n\ + .even \n\ + .globl _start \n\ + _start: \n\ + moveq #0,d0 \n\ + rts"); +#endif +#endif + +#if !defined(__amigaos4__) +STATIC LONG LIBFUNC LibNull(VOID) +{ + return(0); +} +#endif + +/******************************************************************************/ +/* Local data structures */ +/******************************************************************************/ + +#if defined(__amigaos4__) +/* ------------------- OS4 Manager Interface ------------------------ */ +STATIC uint32 _manager_Obtain(struct LibraryManagerInterface *Self) +{ + uint32 res; + __asm__ __volatile__( + "1: lwarx %0,0,%1\n" + "addic %0,%0,1\n" + "stwcx. %0,0,%1\n" + "bne- 1b" + : "=&r" (res) + : "r" (&Self->Data.RefCount) + : "cc", "memory"); + + return res; +} + +STATIC uint32 _manager_Release(struct LibraryManagerInterface *Self) +{ + uint32 res; + __asm__ __volatile__( + "1: lwarx %0,0,%1\n" + "addic %0,%0,-1\n" + "stwcx. %0,0,%1\n" + "bne- 1b" + : "=&r" (res) + : "r" (&Self->Data.RefCount) + : "cc", "memory"); + + return res; +} + +STATIC CONST CONST_APTR lib_manager_vectors[] = +{ + (CONST_APTR)_manager_Obtain, + (CONST_APTR)_manager_Release, + (CONST_APTR)NULL, + (CONST_APTR)NULL, + (CONST_APTR)LibOpen, + (CONST_APTR)LibClose, + (CONST_APTR)LibExpunge, + (CONST_APTR)NULL, + (CONST_APTR)-1 +}; + +STATIC CONST struct TagItem lib_managerTags[] = +{ + { MIT_Name, (Tag)"__library" }, + { MIT_VectorTable, (Tag)lib_manager_vectors }, + { MIT_Version, 1 }, + { TAG_DONE, 0 } +}; + +/* ------------------- Library Interface(s) ------------------------ */ + +ULONG _MCCClass_Obtain(UNUSED struct Interface *Self) +{ + return 0; +} + +ULONG _MCCClass_Release(UNUSED struct Interface *Self) +{ + return 0; +} + +STATIC CONST CONST_APTR main_vectors[] = +{ + (CONST_APTR)_MCCClass_Obtain, + (CONST_APTR)_MCCClass_Release, + (CONST_APTR)NULL, + (CONST_APTR)NULL, + (CONST_APTR)MCC_Query, + (CONST_APTR)-1 +}; + +STATIC CONST struct TagItem mainTags[] = +{ + { MIT_Name, (Tag)"main" }, + { MIT_VectorTable, (Tag)main_vectors }, + { MIT_Version, 1 }, + { TAG_DONE, 0 } +}; + +STATIC CONST CONST_APTR libInterfaces[] = +{ + (CONST_APTR)lib_managerTags, + (CONST_APTR)mainTags, + (CONST_APTR)NULL +}; + +// Our libraries always have to carry a 68k jump table with it, so +// lets define it here as extern, as we are going to link it to +// our binary here. +#ifndef NO_VECTABLE68K +extern CONST APTR VecTable68K[]; +#endif + +STATIC CONST struct TagItem libCreateTags[] = +{ + { CLT_DataSize, sizeof(struct LibraryHeader) }, + { CLT_InitFunc, (Tag)LibInit }, + { CLT_Interfaces, (Tag)libInterfaces }, + #ifndef NO_VECTABLE68K + { CLT_Vector68K, (Tag)VecTable68K }, + #endif + { TAG_DONE, 0 } +}; + +#else + +STATIC CONST CONST_APTR LibVectors[] = +{ + #ifdef __MORPHOS__ + (CONST_APTR)FUNCARRAY_32BIT_NATIVE, + #endif + #ifndef __AROS__ + (CONST_APTR)LibOpen, + (CONST_APTR)LibClose, + (CONST_APTR)LibExpunge, + (CONST_APTR)LibNull, + (CONST_APTR)MCC_Query, + #else + (CONST_APTR)AROS_SLIB_ENTRY(LibOpen, __MCC_, 1), + (CONST_APTR)AROS_SLIB_ENTRY(LibClose, __MCC_, 2), + (CONST_APTR)AROS_SLIB_ENTRY(LibExpunge, __MCC_, 3), + (CONST_APTR)LibNull, + (CONST_APTR)AROS_SLIB_ENTRY(MCC_Query, __MCC_, 5), + #endif + (CONST_APTR)-1 +}; + +STATIC CONST IPTR LibInitTab[] = +{ + sizeof(struct LibraryHeader), + (IPTR)LibVectors, + (IPTR)NULL, + (IPTR)LibInit +}; + +#endif + +/* ------------------- ROM Tag ------------------------ */ +STATIC const USED_VAR struct Resident ROMTag = +{ + RTC_MATCHWORD, + (struct Resident *)&ROMTag, + (struct Resident *)(&ROMTag + 1), + #if defined(__amigaos4__) + RTF_AUTOINIT|RTF_NATIVE, // The Library should be set up according to the given table. + #elif defined(__MORPHOS__) + RTF_AUTOINIT|RTF_EXTENDED|RTF_PPC, + #elif defined(__AROS__) + RTF_AUTOINIT|RTF_EXTENDED, + #else + RTF_AUTOINIT, + #endif + VERSION, + NT_LIBRARY, + 0, + (char *)UserLibName, + (char *)UserLibID+6, // +6 to skip '$VER: ' + #if defined(__amigaos4__) + (APTR)libCreateTags, // This table is for initializing the Library. + #else + (APTR)LibInitTab, + #endif + #if defined(__MORPHOS__) || defined(__AROS__) + REVISION, + 0 + #endif +}; + +#if defined(__MORPHOS__) +/* + * To tell the loader that this is a new emulppc elf and not + * one for the ppc.library. + * ** IMPORTANT ** + */ +const USED_VAR ULONG __abox__ = 1; + +#endif /* __MORPHOS__ */ + +/****************************************************************************/ +/* Stack enforcing function which allows to make sure that a function has */ +/* enough stack space during its execution time */ +/****************************************************************************/ + +#if defined(MIN_STACKSIZE) && !defined(__amigaos4__) + +/* generic StackSwap() function which calls function() surrounded by + StackSwap() calls */ +#if defined(__AROS__) +ULONG stackswap_call(struct StackSwapStruct *stack, + ULONG (*function)(struct LibraryHeader *), + struct LibraryHeader *arg) +{ + struct StackSwapArgs swapargs; + + swapargs.Args[0] = (IPTR)arg; + + return NewStackSwap(stack, function, &swapargs); +} +#elif defined(__MORPHOS__) +ULONG stackswap_call(struct StackSwapStruct *stack, + ULONG (*function)(struct LibraryHeader *), + struct LibraryHeader *arg) +{ + struct PPCStackSwapArgs swapargs; + + swapargs.Args[0] = (ULONG)arg; + + return NewPPCStackSwap(stack, function, &swapargs); +} +#elif defined(__mc68000__) +ULONG stackswap_call(struct StackSwapStruct *stack, + ULONG (*function)(struct LibraryHeader *), + struct LibraryHeader *arg); + +asm(".text \n\ + .even \n\ + .globl _stackswap_call \n\ + _stackswap_call: \n\ + moveml #0x3022,sp@- \n\ + movel sp@(20),d3 \n\ + movel sp@(24),a2 \n\ + movel sp@(28),d2 \n\ + movel _SysBase,a6 \n\ + movel d3,a0 \n\ + jsr a6@(-732:W) \n\ + movel d2,sp@- \n\ + jbsr a2@ \n\ + movel d0,d2 \n\ + addql #4,sp \n\ + movel _SysBase,a6 \n\ + movel d3,a0 \n\ + jsr a6@(-732:W) \n\ + movel d2,d0 \n\ + moveml sp@+,#0x440c \n\ + rts"); +#else +#error Bogus operating system +#endif + +STATIC BOOL callMccFunction(ULONG (*function)(struct LibraryHeader *), struct LibraryHeader *arg) +{ + BOOL success = FALSE; + struct Task *tc; + ULONG stacksize; + + // retrieve the task structure for the + // current task + tc = FindTask(NULL); + + #if defined(__MORPHOS__) + // In MorphOS we have two stacks. One for PPC code and another for 68k code. + // We are only interested in the PPC stack. + NewGetTaskAttrsA(tc, &stacksize, sizeof(ULONG), TASKINFOTYPE_STACKSIZE, NULL); + #else + // on all other systems we query via SPUpper-SPLower calculation + stacksize = (IPTR)tc->tc_SPUpper - (IPTR)tc->tc_SPLower; + #endif + + // Swap stacks only if current stack is insufficient + if(stacksize < MIN_STACKSIZE) + { + struct StackSwapStruct *stack; + + if((stack = AllocVec(sizeof(*stack), MEMF_PUBLIC)) != NULL) + { + if((stack->stk_Lower = AllocVec(MIN_STACKSIZE, MEMF_PUBLIC)) != NULL) + { + // perform the StackSwap + #if defined(__AROS__) + // AROS uses an APTR type for stk_Upper + stack->stk_Upper = (APTR)((IPTR)stack->stk_Lower + MIN_STACKSIZE); + #else + // all other systems use ULONG + stack->stk_Upper = (ULONG)stack->stk_Lower + MIN_STACKSIZE; + #endif + stack->stk_Pointer = (APTR)stack->stk_Upper; + + // call routine but with embedding it into a [NewPPC]StackSwap() + success = stackswap_call(stack, function, arg); + + FreeVec(stack->stk_Lower); + } + FreeVec(stack); + } + } + else + success = function(arg); + + return success; +} +#else // MIN_STACKSIZE && __amigaos4__ +#define callMccFunction(func, arg) func(arg) +#endif // MIN_STACKSIZE && __amigaos4__ + +/******************************************************************************/ +/* Wrapper functions to perform certain tasks in our LibInit/LibOpen etc. */ +/******************************************************************************/ + +/* open and init all necessary library and stuff in the LibInit() phase */ +STATIC ULONG mccLibInit(struct LibraryHeader *base) +{ + // now that this library/class is going to be initialized for the first time + // we go and open all necessary libraries on our own + #if defined(__amigaos4__) + if((DOSBase = OpenLibrary("dos.library", 39)) && + GETINTERFACE(IDOS, struct DOSIFace *, DOSBase)) + if((GfxBase = OpenLibrary("graphics.library", 39)) && + GETINTERFACE(IGraphics, struct GraphicsIFace *, GfxBase)) + if((IntuitionBase = OpenLibrary("intuition.library", 39)) && + GETINTERFACE(IIntuition, struct IntuitionIFace *, IntuitionBase)) + if((UtilityBase = OpenLibrary("utility.library", 39)) && + GETINTERFACE(IUtility, struct UtilityIFace *, UtilityBase)) + #else + if((DOSBase = (struct DosLibrary*)OpenLibrary("dos.library", 39)) && + (GfxBase = (struct GfxBase*)OpenLibrary("graphics.library", 39)) && + (IntuitionBase = (struct IntuitionBase*)OpenLibrary("intuition.library", 39)) && + (UtilityBase = (APTR)OpenLibrary("utility.library", 39))) + #endif + { + // we have to please the internal utilitybase + // pointers of libnix and clib2 + #if !defined(__NEWLIB__) + __UtilityBase = (APTR)UtilityBase; + #if defined(__amigaos4__) + __IUtility = IUtility; + #endif + #endif + + #if defined(DEBUG) + SetupDebug(); + #endif + + if((MUIMasterBase = OpenLibrary(MUIMASTER_NAME, MASTERVERSION)) && + GETINTERFACE(IMUIMaster, struct MUIMasterIFace*, MUIMasterBase)) + { + #if defined(PRECLASSINIT) + if(PreClassInit()) + #endif + { + #ifdef SUPERCLASS + ThisClass = MUI_CreateCustomClass(&base->lh_Library, (STRPTR)SUPERCLASS, NULL, sizeof(struct INSTDATA), ENTRY(_Dispatcher)); + if(ThisClass) + #endif + { + #ifdef SUPERCLASSP + if((ThisClassP = MUI_CreateCustomClass(&base->lh_Library, (STRPTR)SUPERCLASSP, NULL, sizeof(struct INSTDATAP), ENTRY(_DispatcherP)))) + #endif + { + #ifdef SUPERCLASS + #define THISCLASS ThisClass + #else + #define THISCLASS ThisClassP + #endif + + // in case the user defined an own ClassInit() + // function we call it protected by a semaphore as + // this user may be stupid and break the Forbid() state + // of LibInit() + #if defined(CLASSINIT) + if(ClassInit(&base->lh_Library)) + #endif + { + // everything was successfully so lets + // make sure we return TRUE + return TRUE; + } + #if defined(CLASSINIT) + else + E(DBF_STARTUP, "ClassInit(%s) failed", CLASS); + #endif + + // if we pass this point than an error + // occurred and we have to cleanup + #if defined(SUPERCLASSP) + MUI_DeleteCustomClass(ThisClassP); + ThisClassP = NULL; + #endif + } + + #if defined(SUPERCLASS) + MUI_DeleteCustomClass(ThisClass); + ThisClass = NULL; + #endif + } + } + + DROPINTERFACE(IMUIMaster); + CloseLibrary(MUIMasterBase); + MUIMasterBase = NULL; + } + + DROPINTERFACE(IUtility); + CloseLibrary((struct Library *)UtilityBase); + UtilityBase = NULL; + } + + if(IntuitionBase) + { + DROPINTERFACE(IIntuition); + CloseLibrary((struct Library *)IntuitionBase); + IntuitionBase = NULL; + } + + if(GfxBase) + { + DROPINTERFACE(IGraphics); + CloseLibrary((struct Library *)GfxBase); + GfxBase = NULL; + } + + if(DOSBase) + { + DROPINTERFACE(IDOS); + CloseLibrary((struct Library *)DOSBase); + DOSBase = NULL; + } + + E(DBF_STARTUP, "mccLibInit(%s) failed", CLASS); + return FALSE; +} + +/* expunge everything we previously opened and call user definable functions */ +STATIC ULONG mccLibExpunge(UNUSED struct LibraryHeader *base) +{ + // in case the user specified that he has an own class + // expunge function we call it right here, not caring about + // any return value. + #if defined(CLASSEXPUNGE) + ClassExpunge(&base->lh_Library); + #endif + + // now we remove our own stuff here step-by-step + #ifdef SUPERCLASSP + if(ThisClassP) + { + MUI_DeleteCustomClass(ThisClassP); + ThisClassP = NULL; + } + #endif + + #ifdef SUPERCLASS + if(ThisClass) + { + MUI_DeleteCustomClass(ThisClass); + ThisClass = NULL; + } + #endif + + // we inform the user that all main class expunge stuff + // is finished, if he want's to get informed. + #if defined(POSTCLASSEXPUNGE) + PostClassExpunge(); + #endif + + #if defined(DEBUG) + CleanupDebug(); + #endif + + // cleanup the various library bases and such + if(MUIMasterBase) + { + DROPINTERFACE(IMUIMaster); + CloseLibrary(MUIMasterBase); + MUIMasterBase = NULL; + } + + if(UtilityBase) + { + DROPINTERFACE(IUtility); + CloseLibrary((struct Library *)UtilityBase); + UtilityBase = NULL; + } + + if(IntuitionBase) + { + DROPINTERFACE(IIntuition); + CloseLibrary((struct Library *)IntuitionBase); + IntuitionBase = NULL; + } + + if(GfxBase) + { + DROPINTERFACE(IGraphics); + CloseLibrary((struct Library *)GfxBase); + GfxBase = NULL; + } + + if(DOSBase) + { + DROPINTERFACE(IDOS); + CloseLibrary((struct Library *)DOSBase); + DOSBase = NULL; + } + + return TRUE; +} + +/* we call the user definable function here only */ +#if defined(CLASSOPEN) +STATIC ULONG mccLibOpen(struct LibraryHeader *base) +{ + return ClassOpen(&base->lh_Library); +} +#endif + +/* we call the user definable function here only */ +#if defined(CLASSCLOSE) +STATIC ULONG mccLibClose(struct LibraryHeader *base) +{ + ClassClose(&base->lh_Library); + return TRUE; +} +#endif + +/******************************************************************************/ +/* Standard Library Functions, all of them are called in Forbid() state. */ +/******************************************************************************/ + +#if defined(__amigaos4__) +STATIC struct LibraryHeader * LibInit(struct LibraryHeader *base, BPTR librarySegment, struct ExecIFace *pIExec) +{ + struct Library *sb = (struct Library *)pIExec->Data.LibBase; + IExec = pIExec; +#elif defined(__MORPHOS__) +STATIC struct LibraryHeader * LibInit(struct LibraryHeader *base, BPTR librarySegment, struct ExecBase *sb) +{ +#elif defined(__AROS__) +AROS_UFH3 (struct LibraryHeader *, LibInit, + AROS_UFHA(struct LibraryHeader *, base, D0), + AROS_UFHA(BPTR, librarySegment, A0), + AROS_UFHA(struct ExecBase *, sb, A6) +) +{ + AROS_USERFUNC_INIT +#else +STATIC struct LibraryHeader * LIBFUNC LibInit(REG(d0, struct LibraryHeader *base), REG(a0, BPTR librarySegment), REG(a6, struct ExecBase *sb)) +{ +#endif + + SysBase = sb; + + // make sure that this is really a 68020+ machine if optimized for 020+ + #if _M68060 || _M68040 || _M68030 || _M68020 || __mc68020 || __mc68030 || __mc68040 || __mc68060 + if(!(SysBase->AttnFlags & AFF_68020)) + return(NULL); + #endif + + #if defined(__amigaos4__) && defined(__NEWLIB__) + if((NewlibBase = OpenLibrary("newlib.library", 3)) && + GETINTERFACE(INewlib, struct Interface*, NewlibBase)) + #endif + { + BOOL success = FALSE; + + D(DBF_STARTUP, "LibInit(" CLASS ")"); + + // cleanup the library header structure beginning with the + // library base, even if that is done automcatically, we explicitly + // do it here for consistency reasons. + base->lh_Library.lib_Node.ln_Type = NT_LIBRARY; + base->lh_Library.lib_Node.ln_Pri = 0; + base->lh_Library.lib_Node.ln_Name = (char *)UserLibName; + base->lh_Library.lib_Flags = LIBF_CHANGED | LIBF_SUMUSED; + base->lh_Library.lib_IdString = (char *)UserLibID; // here without +6 or otherwise MUI doesn't identify it. + base->lh_Library.lib_Version = VERSION; + base->lh_Library.lib_Revision = REVISION; + + // init our protecting semaphore and the + // initialized flag variable + memset(&base->lh_Semaphore, 0, sizeof(base->lh_Semaphore)); + InitSemaphore(&base->lh_Semaphore); + + // protect mccLibInit() + ObtainSemaphore(&base->lh_Semaphore); + + // If we are not running on AmigaOS4 (no stackswap required) we go and + // do an explicit StackSwap() in case the user wants to make sure we + // have enough stack for his user functions + success = callMccFunction(mccLibInit, base); + + // unprotect + ReleaseSemaphore(&base->lh_Semaphore); + + // check if everything worked out fine + if(success == TRUE) + { + // everything was successfully so lets + // set the initialized value and contiue + // with the class open phase + base->lh_Segment = librarySegment; + + // return the library base as success + return base; + } + + #if defined(__amigaos4__) && defined(__NEWLIB__) + if(NewlibBase) + { + DROPINTERFACE(INewlib); + CloseLibrary(NewlibBase); + NewlibBase = NULL; + } + #endif + } + + return(NULL); +#ifdef __AROS__ + AROS_USERFUNC_EXIT +#endif +} + +/*****************************************************************************************************/ +/*****************************************************************************************************/ + +#ifndef __amigaos4__ +#define DeleteLibrary(LIB) \ + FreeMem((STRPTR)(LIB)-(LIB)->lib_NegSize, (ULONG)((LIB)->lib_NegSize+(LIB)->lib_PosSize)) +#endif + +STATIC BPTR LibDelete(struct LibraryHeader *base) +{ +#if defined(__amigaos4__) + struct ExecIFace *IExec = (struct ExecIFace *)(*(struct ExecBase **)4)->MainInterface; +#endif + BPTR rc; + + // remove the library base from exec's lib list in advance + Remove((struct Node *)base); + + // protect mccLibExpunge() + ObtainSemaphore(&base->lh_Semaphore); + + // make sure we have enough stack here + callMccFunction(mccLibExpunge, base); + + // unprotect + ReleaseSemaphore(&base->lh_Semaphore); + + #if defined(__amigaos4__) && defined(__NEWLIB__) + if(NewlibBase) + { + DROPINTERFACE(INewlib); + CloseLibrary(NewlibBase); + NewlibBase = NULL; + } + #endif + + // make sure the system deletes the library as well. + rc = base->lh_Segment; + DeleteLibrary(&base->lh_Library); + + return rc; +} + +#if defined(__amigaos4__) +STATIC BPTR LibExpunge(struct LibraryManagerInterface *Self) +{ + struct LibraryHeader *base = (struct LibraryHeader *)Self->Data.LibBase; +#elif defined(__MORPHOS__) +STATIC BPTR LibExpunge(void) +{ + struct LibraryHeader *base = (struct LibraryHeader *)REG_A6; +#elif defined(__AROS__) +AROS_LH1 (BPTR, LibExpunge, + AROS_LHA(UNUSED struct LibraryHeader *, extralh, D0), + struct LibraryHeader *, base, 3, __MCC_ +) +{ + AROS_LIBFUNC_INIT +#else +STATIC BPTR LIBFUNC LibExpunge(REG(a6, struct LibraryHeader *base)) +{ +#endif + BPTR rc; + + D(DBF_STARTUP, "LibExpunge(" CLASS "): %ld", base->lh_Library.lib_OpenCnt); + + // in case our open counter is still > 0, we have + // to set the late expunge flag and return immediately + if(base->lh_Library.lib_OpenCnt > 0) + { + base->lh_Library.lib_Flags |= LIBF_DELEXP; + rc = 0; + } + else + { + rc = LibDelete(base); + } + + return(rc); +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif +} + +/*****************************************************************************************************/ +/*****************************************************************************************************/ + +#if defined(__amigaos4__) +STATIC struct LibraryHeader *LibOpen(struct LibraryManagerInterface *Self, ULONG version UNUSED) +{ + struct LibraryHeader *base = (struct LibraryHeader *)Self->Data.LibBase; +#elif defined(__MORPHOS__) +STATIC struct LibraryHeader *LibOpen(void) +{ + struct LibraryHeader *base = (struct LibraryHeader *)REG_A6; +#elif defined(__AROS__) +AROS_LH1 (struct LibraryHeader *, LibOpen, + AROS_LHA (UNUSED ULONG, version, D0), + struct LibraryHeader *, base, 1, __MCC_ +) +{ + AROS_LIBFUNC_INIT +#else +STATIC struct LibraryHeader * LIBFUNC LibOpen(REG(d0, UNUSED ULONG version), REG(a6, struct LibraryHeader *base)) +{ +#endif + struct LibraryHeader *res = NULL; + + D(DBF_STARTUP, "LibOpen(" CLASS "): %ld", base->lh_Library.lib_OpenCnt); + + // LibOpen(), LibClose() and LibExpunge() are called while the system is in + // Forbid() state. That means that these functions should be quick and should + // not break this Forbid()!! Therefore the open counter should be increased + // as the very first instruction during LibOpen(), because a ClassOpen() + // which breaks a Forbid() and another task calling LibExpunge() will cause + // to expunge this library while it is not yet fully initialized. A crash + // is unavoidable then. Even the semaphore does not guarantee 100% protection + // against such a race condition, because waiting for the semaphore to be + // obtained will effectively break the Forbid()! + + // increase the open counter ahead of anything else + base->lh_Library.lib_OpenCnt++; + + // delete the late expunge flag + base->lh_Library.lib_Flags &= ~LIBF_DELEXP; + + // check if the user defined a ClassOpen() function + #if defined(CLASSOPEN) + { + struct ExecIFace *IExec = (struct ExecIFace *)(*(struct ExecBase **)4)->MainInterface; + BOOL success = FALSE; + + // protect + ObtainSemaphore(&base->lh_Semaphore); + + // make sure we have enough stack here + success = callMccFunction(mccLibOpen, base); + + // here we call the user-specific function for LibOpen() where + // he can do whatever he wants because of the semaphore protection. + if(success == TRUE) + res = base; + else + { + E(DBF_STARTUP, "ClassOpen(" CLASS ") failed"); + + // decrease the open counter again + base->lh_Library.lib_OpenCnt--; + } + + // release the semaphore + ReleaseSemaphore(&base->lh_Semaphore); + } + #else + res = base; + #endif + + return res; +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif +} + +/*****************************************************************************************************/ +/*****************************************************************************************************/ + +#if defined(__amigaos4__) +STATIC BPTR LibClose(struct LibraryManagerInterface *Self) +{ + struct LibraryHeader *base = (struct LibraryHeader *)Self->Data.LibBase; +#elif defined(__MORPHOS__) +STATIC BPTR LibClose(void) +{ + struct LibraryHeader *base = (struct LibraryHeader *)REG_A6; +#elif defined(__AROS__) +AROS_LH0 (BPTR, LibClose, + struct LibraryHeader *, base, 2, __MCC_ +) +{ + AROS_LIBFUNC_INIT +#else +STATIC BPTR LIBFUNC LibClose(REG(a6, struct LibraryHeader *base)) +{ +#endif + BPTR rc = 0; + + D(DBF_STARTUP, "LibClose(" CLASS "): %ld", base->lh_Library.lib_OpenCnt); + + // check if the user defined a ClassClose() function + #if defined(CLASSCLOSE) + { + struct ExecIFace *IExec = (struct ExecIFace *)(*(struct ExecBase **)4)->MainInterface; + + // protect + ObtainSemaphore(&base->lh_Semaphore); + + // make sure we have enough stack here + success = callMccFunction(mccLibClose, base); + + // release the semaphore + ReleaseSemaphore(&base->lh_Semaphore); + } + #endif + + // decrease the open counter + base->lh_Library.lib_OpenCnt--; + + // in case the opern counter is <= 0 we can + // make sure that we free everything + if(base->lh_Library.lib_OpenCnt <= 0) + { + // in case the late expunge flag is set we go and + // expunge the library base right now + if(base->lh_Library.lib_Flags & LIBF_DELEXP) + { + rc = LibDelete(base); + } + } + + return rc; +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif +} + +/*****************************************************************************************************/ +/*****************************************************************************************************/ + +#if defined(__amigaos4__) +STATIC IPTR LIBFUNC MCC_Query(UNUSED struct Interface *self, REG(d0, LONG which)) +{ +#elif defined(__MORPHOS__) +STATIC IPTR MCC_Query(void) +{ + LONG which = (LONG)REG_D0; +#elif defined(__AROS__) +AROS_LH1(IPTR, MCC_Query, + AROS_LHA(LONG, which, D0), + UNUSED struct LibraryHeader *, base, 5, __MCC_ +) +{ + AROS_LIBFUNC_INIT +#else +STATIC IPTR LIBFUNC MCC_Query(REG(d0, LONG which)) +{ +#endif + + D(DBF_STARTUP, "MCC_Query(" CLASS "): %ld", which); + + switch (which) + { + #ifdef SUPERCLASS + case 0: return((IPTR)ThisClass); + #endif + + #ifdef SUPERCLASSP + case 1: return((IPTR)ThisClassP); + #endif + + #ifdef PREFSIMAGEOBJECT + case 2: + { + Object *obj = PREFSIMAGEOBJECT; + return((IPTR)obj); + } + #endif + + #ifdef ONLYGLOBAL + case 3: + { + return(TRUE); + } + #endif + + #ifdef INFOCLASS + case 4: + { + return(TRUE); + } + #endif + + #ifdef USEDCLASSES + case 5: + { + return((IPTR)USEDCLASSES); + } + #endif + + #ifdef USEDCLASSESP + case 6: + { + return((IPTR)USEDCLASSESP); + } + #endif + + #ifdef SHORTHELP + case 7: + { + return((IPTR)SHORTHELP); + } + #endif + } + + return(0); +#ifdef __AROS__ + AROS_LIBFUNC_EXIT +#endif +} + +#ifdef __cplusplus +} +#endif diff --git a/workbench/classes/zune/nlist/include/mui/Busy_mcc.h b/workbench/classes/zune/nlist/include/mui/Busy_mcc.h new file mode 100755 index 0000000000..d2be0ea7d0 --- /dev/null +++ b/workbench/classes/zune/nlist/include/mui/Busy_mcc.h @@ -0,0 +1,73 @@ +/* + + MCC_Busy (c) by kMel, Klaus Melchior + + Registered class of the Magic User Interface. + + Busy_mcc.h + +*/ + + +/*** Include stuff ***/ + +#ifndef BUSY_MCC_H +#define BUSY_MCC_H + +#ifndef LIBRARIES_MUI_H +#include "libraries/mui.h" +#endif + + +/*** MUI Defines ***/ + +#define MUIC_Busy "Busy.mcc" +#define BusyObject MUI_NewObject(MUIC_Busy + +#define BusyBar\ + BusyObject,\ + MUIA_Busy_Speed, MUIV_Busy_Speed_User,\ + End + + + +/*** Methods ***/ + +#define MUIM_Busy_Move 0x80020001UL + +/*** Method structs ***/ + +struct MUIP_Busy_Move { + ULONG MethodID; +}; + + +/*** Special method values ***/ + + +/*** Special method flags ***/ + + + +/*** Attributes ***/ + +#define MUIA_Busy_ShowHideIH 0x800200a9UL +#define MUIA_Busy_Speed 0x80020049UL + +/*** Special attribute values ***/ + +#define MUIV_Busy_Speed_Off 0 +#define MUIV_Busy_Speed_User -1 + + + +/*** Structures, Flags & Values ***/ + + + + + +#endif /* BUSY_MCC_H */ + +/* PrMake.rexx 0.10 (16.2.1996) Copyright 1995 kmel, Klaus Melchior */ + diff --git a/workbench/classes/zune/nlist/include/mui/HotkeyString_mcc.h b/workbench/classes/zune/nlist/include/mui/HotkeyString_mcc.h new file mode 100755 index 0000000000..e1ec06b3ea --- /dev/null +++ b/workbench/classes/zune/nlist/include/mui/HotkeyString_mcc.h @@ -0,0 +1,40 @@ +/*************************************************************************** + + BetterString.mcc - A better String gadget MUI Custom Class + Copyright (C) 1997-2000 Allan Odgaard + Copyright (C) 2005-2009 by BetterString.mcc Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + BetterString class Support Site: http://www.sf.net/projects/bstring-mcc/ + + $Id$ + +***************************************************************************/ + +#ifndef HOTKEYSTRING_MCC_H +#define HOTKEYSTRING_MCC_H + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +#define MUIC_HotkeyString "HotkeyString.mcc" +#if defined(__AROS__) && !defined(NO_INLINE_STDARG) +#define HotkeyStringObject MUIOBJMACRO_START(MUIC_HotkeyString) +#else +#define HotkeyStringObject MUI_NewObject(MUIC_HotkeyString +#endif + +#define MUIA_HotkeyString_Snoop 0xad001000UL +#define MUIA_HotkeyString_IX 0xad001002UL /* V12 IS. */ + +#endif /* HOTKEYSTRING_MCC_H */ diff --git a/workbench/classes/zune/nlist/include/mui/NBalance_mcc.h b/workbench/classes/zune/nlist/include/mui/NBalance_mcc.h new file mode 100644 index 0000000000..982a6b68ef --- /dev/null +++ b/workbench/classes/zune/nlist/include/mui/NBalance_mcc.h @@ -0,0 +1,45 @@ +#ifndef NBALANCE_MCC_H +#define NBALANCE_MCC_H + +/*************************************************************************** + + NBalance.mcc - New Balance MUI Custom Class + Copyright (C) 2008-2009 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +#define MUIC_NBalance "NBalance.mcc" +#if defined(__AROS__) && !defined(NO_INLINE_STDARG) +#define NBalanceObject MUIOBJMACRO_START(MUIC_NBalance) +#else +#define NBalanceObject MUI_NewObject(MUIC_NBalance +#endif + +/* attributes */ +#define MUIA_NBalance_Pointer 0xa95f0000UL + +/* attribute values */ +#define MUIV_NBalance_Pointer_Off 0 +#define MUIV_NBalance_Pointer_Standard 1 + +/* methods */ + +#endif /* NBALANCE_MCC_H */ diff --git a/workbench/classes/zune/nlist/include/mui/NBitmap_mcc.h b/workbench/classes/zune/nlist/include/mui/NBitmap_mcc.h new file mode 100644 index 0000000000..bbfe0a10be --- /dev/null +++ b/workbench/classes/zune/nlist/include/mui/NBitmap_mcc.h @@ -0,0 +1,65 @@ +#ifndef NBITMAP_MCC_H +#define NBITMAP_MCC_H + +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007-2009 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +#define MUIC_NBitmap "NBitmap.mcc" +#if defined(__AROS__) && !defined(NO_INLINE_STDARG) +#define NBitmapObject MUIOBJMACRO_START(MUIC_NBitmap) +#else +#define NBitmapObject MUI_NewObject(MUIC_NBitmap +#endif + +/* attributes */ +#define MUIA_NBitmap_Type 0xa94f0000UL +#define MUIA_NBitmap_Label 0xa94f0001UL +#define MUIA_NBitmap_Button 0xa94f0002UL +#define MUIA_NBitmap_Normal 0xa94f0003UL +#define MUIA_NBitmap_Ghosted 0xa94f0004UL +#define MUIA_NBitmap_Selected 0xa94f0005UL +#define MUIA_NBitmap_Width 0xa94f0006UL +#define MUIA_NBitmap_Height 0xa94f0007UL +#define MUIA_NBitmap_MaxWidth 0xa94f0008UL +#define MUIA_NBitmap_MaxHeight 0xa94f0009UL +#define MUIA_NBitmap_CLUT 0xa94f000aUL +#define MUIA_NBitmap_Alpha 0xa94f000bUL + +/* source types */ +#define MUIV_NBitmap_Type_File 0 +#define MUIV_NBitmap_Type_DTObject 1 +#define MUIV_NBitmap_Type_CLUT8 2 +#define MUIV_NBitmap_Type_RGB24 3 +#define MUIV_NBitmap_Type_ARGB32 4 + + +/* macros */ +#define NBitmapFile(filename) NBitmapObject, \ + MUIA_NBitmap_Type, MUIV_NBitmap_Type_File, \ + MUIA_NBitmap_Normal, (filename), \ + End + +#endif /* NBITMAP_MCC_H */ diff --git a/workbench/classes/zune/nlist/include/mui/NFloattext_mcc.h b/workbench/classes/zune/nlist/include/mui/NFloattext_mcc.h new file mode 100644 index 0000000000..dcda3bdebd --- /dev/null +++ b/workbench/classes/zune/nlist/include/mui/NFloattext_mcc.h @@ -0,0 +1,87 @@ +/*************************************************************************** + + NFloattext.mcc - New Floattext MUI Custom Class + Registered MUI class, Serial Number: 1d51 (0x9d5100a1 to 0x9d5100aF) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2009 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef MUI_NFloattext_MCC_H +#define MUI_NFloattext_MCC_H + +#ifndef LIBRARIES_MUI_H +#include <libraries/mui.h> +#endif + +#ifndef MUI_NListview_MCC_H +#include <mui/NListview_mcc.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(__AROS__) && defined(__PPC__) + #if defined(__GNUC__) + #pragma pack(2) + #elif defined(__VBCC__) + #pragma amiga-align + #endif +#endif + +/***********************************************************************/ + +// STACKED ensures proper alignment on AROS 64 bit systems +#if !defined(__AROS__) && !defined(STACKED) +#define STACKED +#endif + +/***********************************************************************/ + +#define MUIC_NFloattext "NFloattext.mcc" +#if defined(__AROS__) && !defined(NO_INLINE_STDARG) +#define NFloattextObject MUIOBJMACRO_START(MUIC_NFloattext) +#else +#define NFloattextObject MUI_NewObject(MUIC_NFloattext +#endif + +/* Attributes */ + +#define MUIA_NFloattext_Text 0x9d5100a1UL /* GM isg STRPTR */ +#define MUIA_NFloattext_SkipChars 0x9d5100a2UL /* GM isg char * */ +#define MUIA_NFloattext_TabSize 0x9d5100a3UL /* GM isg ULONG */ +#define MUIA_NFloattext_Justify 0x9d5100a4UL /* GM isg BOOL */ +#define MUIA_NFloattext_Align 0x9d5100a5UL /* GM isg LONG */ + +#define MUIM_NFloattext_GetEntry 0x9d5100aFUL /* GM */ +struct MUIP_NFloattext_GetEntry { STACKED ULONG MethodID; STACKED LONG pos; STACKED APTR *entry; }; + +#if !defined(__AROS__) && defined(__PPC__) + #if defined(__GNUC__) + #pragma pack() + #elif defined(__VBCC__) + #pragma default-align + #endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* MUI_NFloattext_MCC_H */ diff --git a/workbench/classes/zune/nlist/include/mui/NList_mcc.h b/workbench/classes/zune/nlist/include/mui/NList_mcc.h new file mode 100644 index 0000000000..8c44548e45 --- /dev/null +++ b/workbench/classes/zune/nlist/include/mui/NList_mcc.h @@ -0,0 +1,671 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2009 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef MUI_NList_MCC_H +#define MUI_NList_MCC_H + +#ifndef LIBRARIES_MUI_H +#include <libraries/mui.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(__AROS__) && defined(__PPC__) + #if defined(__GNUC__) + #pragma pack(2) + #elif defined(__VBCC__) + #pragma amiga-align + #endif +#endif + +/***********************************************************************/ + +// STACKED ensures proper alignment on AROS 64 bit systems +#if !defined(__AROS__) && !defined(STACKED) +#define STACKED +#endif +#if !defined(__AROS__) && !defined(SIPTR) +#define SIPTR LONG +#endif + +/***********************************************************************/ + +/* MUI Prop and Scroller classes stuff which is still not in libraries/mui.h (in MUI3.8) */ +/* it gives to the prop object it's increment value */ +#ifndef MUIA_Prop_DeltaFactor +#define MUIA_Prop_DeltaFactor 0x80427C5EUL +#endif + +#define MUIC_NList "NList.mcc" +#if defined(__AROS__) && !defined(NO_INLINE_STDARG) +#define NListObject MUIOBJMACRO_START(MUIC_NList) +#else +#define NListObject MUI_NewObject(MUIC_NList +#endif + +/* Attributes */ + +#define MUIA_NList_TypeSelect 0x9d510030UL /* GM is. LONG */ +#define MUIA_NList_Prop_DeltaFactor 0x9d510031UL /* GM ..gn LONG */ +#define MUIA_NList_Horiz_DeltaFactor 0x9d510032UL /* GM ..gn LONG */ + +#define MUIA_NList_Horiz_First 0x9d510033UL /* GM .sgn LONG */ +#define MUIA_NList_Horiz_Visible 0x9d510034UL /* GM ..gn LONG */ +#define MUIA_NList_Horiz_Entries 0x9d510035UL /* GM ..gn LONG */ + +#define MUIA_NList_Prop_First 0x9d510036UL /* GM .sgn LONG */ +#define MUIA_NList_Prop_Visible 0x9d510037UL /* GM ..gn LONG */ +#define MUIA_NList_Prop_Entries 0x9d510038UL /* GM ..gn LONG */ + +#define MUIA_NList_TitlePen 0x9d510039UL /* GM isg LONG */ +#define MUIA_NList_ListPen 0x9d51003aUL /* GM isg LONG */ +#define MUIA_NList_SelectPen 0x9d51003bUL /* GM isg LONG */ +#define MUIA_NList_CursorPen 0x9d51003cUL /* GM isg LONG */ +#define MUIA_NList_UnselCurPen 0x9d51003dUL /* GM isg LONG */ +#define MUIA_NList_InactivePen 0x9d5100C1UL /* GM isg LONG */ + +#define MUIA_NList_ListBackground 0x9d51003eUL /* GM isg LONG */ +#define MUIA_NList_TitleBackground 0x9d51003fUL /* GM isg LONG */ +#define MUIA_NList_SelectBackground 0x9d510040UL /* GM isg LONG */ +#define MUIA_NList_CursorBackground 0x9d510041UL /* GM isg LONG */ +#define MUIA_NList_UnselCurBackground 0x9d510042UL /* GM isg LONG */ +#define MUIA_NList_InactiveBackground 0x9d5100C2UL /* GM isg LONG */ + +#define MUIA_NList_MultiClick 0x9d510043UL /* GM ..gn LONG */ + +#define MUIA_NList_DefaultObjectOnClick 0x9d510044UL /* GM is. BOOL */ +#define MUIA_NList_ActiveObjectOnClick 0x9d5100C3UL /* GM is. BOOL */ + +#define MUIA_NList_ClickColumn 0x9d510045UL /* GM ..g LONG */ +#define MUIA_NList_DefClickColumn 0x9d510046UL /* GM isg LONG */ +#define MUIA_NList_DoubleClick 0x9d510047UL /* GM ..gn LONG */ +#define MUIA_NList_DragType 0x9d510048UL /* GM isg LONG */ +#define MUIA_NList_Input 0x9d510049UL /* GM isg BOOL */ +#define MUIA_NList_MultiSelect 0x9d51004aUL /* GM is. LONG */ +#define MUIA_NList_SelectChange 0x9d51004bUL /* GM ...n BOOL */ + +#define MUIA_NList_Active 0x9d51004cUL /* GM isgn LONG */ +#define MUIA_NList_AdjustHeight 0x9d51004dUL /* GM i.. BOOL */ +#define MUIA_NList_AdjustWidth 0x9d51004eUL /* GM i.. BOOL */ +#define MUIA_NList_AutoVisible 0x9d51004fUL /* GM isg BOOL */ +#define MUIA_NList_CompareHook 0x9d510050UL /* GM is. struct Hook * */ +#define MUIA_NList_ConstructHook 0x9d510051UL /* GM is. struct Hook * */ +#define MUIA_NList_DestructHook 0x9d510052UL /* GM is. struct Hook * */ +#define MUIA_NList_DisplayHook 0x9d510053UL /* GM is. struct Hook * */ +#define MUIA_NList_DragSortable 0x9d510054UL /* GM isg BOOL */ +#define MUIA_NList_DropMark 0x9d510055UL /* GM ..g LONG */ +#define MUIA_NList_Entries 0x9d510056UL /* GM ..gn LONG */ +#define MUIA_NList_First 0x9d510057UL /* GM isgn LONG */ +#define MUIA_NList_Format 0x9d510058UL /* GM isg STRPTR */ +#define MUIA_NList_InsertPosition 0x9d510059UL /* GM ..gn LONG */ +#define MUIA_NList_MinLineHeight 0x9d51005aUL /* GM is. LONG */ +#define MUIA_NList_MultiTestHook 0x9d51005bUL /* GM is. struct Hook * */ +#define MUIA_NList_Pool 0x9d51005cUL /* GM i.. APTR */ +#define MUIA_NList_PoolPuddleSize 0x9d51005dUL /* GM i.. ULONG */ +#define MUIA_NList_PoolThreshSize 0x9d51005eUL /* GM i.. ULONG */ +#define MUIA_NList_Quiet 0x9d51005fUL /* GM .s. BOOL */ +#define MUIA_NList_ShowDropMarks 0x9d510060UL /* GM isg BOOL */ +#define MUIA_NList_SourceArray 0x9d510061UL /* GM i.. APTR * */ +#define MUIA_NList_Title 0x9d510062UL /* GM isg char * */ +#define MUIA_NList_Visible 0x9d510063UL /* GM ..g LONG */ +#define MUIA_NList_CopyEntryToClipHook 0x9d510064UL /* GM is. struct Hook * */ +#define MUIA_NList_KeepActive 0x9d510065UL /* GM .s. Obj * */ +#define MUIA_NList_MakeActive 0x9d510066UL /* GM .s. Obj * */ +#define MUIA_NList_SourceString 0x9d510067UL /* GM i.. char * */ +#define MUIA_NList_CopyColumnToClipHook 0x9d510068UL /* GM is. struct Hook * */ +#define MUIA_NList_ListCompatibility 0x9d510069UL /* GM ... OBSOLETE */ +#define MUIA_NList_AutoCopyToClip 0x9d51006AUL /* GM is. BOOL */ +#define MUIA_NList_TabSize 0x9d51006BUL /* GM isg ULONG */ +#define MUIA_NList_SkipChars 0x9d51006CUL /* GM isg char * */ +#define MUIA_NList_DisplayRecall 0x9d51006DUL /* GM .g. BOOL */ +#define MUIA_NList_PrivateData 0x9d51006EUL /* GM isg APTR */ +#define MUIA_NList_EntryValueDependent 0x9d51006FUL /* GM isg BOOL */ + +#define MUIA_NList_IgnoreSpecialChars 0x9d510070UL /* GM isg const char * */ + +#define MUIA_NList_StackCheck 0x9d510097UL /* GM i.. BOOL */ +#define MUIA_NList_WordSelectChars 0x9d510098UL /* GM isg char * */ +#define MUIA_NList_EntryClick 0x9d510099UL /* GM ..gn LONG */ +#define MUIA_NList_DragColOnly 0x9d51009AUL /* GM isg LONG */ +#define MUIA_NList_TitleClick 0x9d51009BUL /* GM isgn LONG */ +#define MUIA_NList_DropType 0x9d51009CUL /* GM ..g LONG */ +#define MUIA_NList_ForcePen 0x9d51009DUL /* GM isg LONG */ +#define MUIA_NList_SourceInsert 0x9d51009EUL /* GM i.. struct MUIP_NList_InsertWrap * */ +#define MUIA_NList_TitleSeparator 0x9d51009FUL /* GM isg BOOL */ + +#define MUIA_NList_AutoClip 0x9d5100C0UL /* GM isg BOOL */ + +#define MUIA_NList_SortType2 0x9d5100EDUL /* GM isgn LONG */ +#define MUIA_NList_TitleClick2 0x9d5100EEUL /* GM isgn LONG */ +#define MUIA_NList_TitleMark2 0x9d5100EFUL /* GM isg LONG */ +#define MUIA_NList_MultiClickAlone 0x9d5100F0UL /* GM ..gn LONG */ +#define MUIA_NList_TitleMark 0x9d5100F1UL /* GM isg LONG */ +#define MUIA_NList_DragSortInsert 0x9d5100F2UL /* GM ..gn LONG */ +#define MUIA_NList_MinColSortable 0x9d5100F3UL /* GM isg LONG */ +#define MUIA_NList_Imports 0x9d5100F4UL /* GM isg LONG */ +#define MUIA_NList_Exports 0x9d5100F5UL /* GM isg LONG */ +#define MUIA_NList_Columns 0x9d5100F6UL /* GM isgn BYTE * */ +#define MUIA_NList_LineHeight 0x9d5100F7UL /* GM ..gn LONG */ +#define MUIA_NList_ButtonClick 0x9d5100F8UL /* GM ..gn LONG */ +#define MUIA_NList_CopyEntryToClipHook2 0x9d5100F9UL /* GM is. struct Hook * */ +#define MUIA_NList_CopyColumnToClipHook2 0x9d5100FAUL /* GM is. struct Hook * */ +#define MUIA_NList_CompareHook2 0x9d5100FBUL /* GM is. struct Hook * */ +#define MUIA_NList_ConstructHook2 0x9d5100FCUL /* GM is. struct Hook * */ +#define MUIA_NList_DestructHook2 0x9d5100FDUL /* GM is. struct Hook * */ +#define MUIA_NList_DisplayHook2 0x9d5100FEUL /* GM is. struct Hook * */ +#define MUIA_NList_SortType 0x9d5100FFUL /* GM isgn LONG */ + +#define MUIA_NList_KeyUpFocus 0x9d5100C4UL /* GM isg. Object * */ +#define MUIA_NList_KeyDownFocus 0x9d5100C5UL /* GM isg. Object * */ +#define MUIA_NList_KeyLeftFocus 0x9d5100C6UL /* GM isg. Object * */ +#define MUIA_NList_KeyRightFocus 0x9d5100C7UL /* GM isg. Object * */ + +#define MUIA_NLIMG_EntryCurrent MUIA_NList_First /* LONG (special for nlist custom image object) */ +#define MUIA_NLIMG_EntryHeight MUIA_NList_Visible /* LONG (special for nlist custom image object) */ + +#define MUIA_NList_VertDeltaFactor MUIA_NList_Prop_DeltaFactor /* OBSOLETE NAME */ +#define MUIA_NList_HorizDeltaFactor MUIA_NList_Horiz_DeltaFactor /* OBSOLETE NAME */ + +/* Attributes special datas */ +#define MUIV_NList_TypeSelect_Line 0 +#define MUIV_NList_TypeSelect_Char 1 + +#define MUIV_NList_Font ((IPTR)-20) +#define MUIV_NList_Font_Little ((IPTR)-21) +#define MUIV_NList_Font_Fixed ((IPTR)-22) + +#define MUIV_NList_ConstructHook_String -1 +#define MUIV_NList_DestructHook_String -1 + +#define MUIV_NList_Active_Off -1 +#define MUIV_NList_Active_Top -2 +#define MUIV_NList_Active_Bottom -3 +#define MUIV_NList_Active_Up -4 +#define MUIV_NList_Active_Down -5 +#define MUIV_NList_Active_PageUp -6 +#define MUIV_NList_Active_PageDown -7 + +#define MUIV_NList_First_Top -2 +#define MUIV_NList_First_Bottom -3 +#define MUIV_NList_First_Up -4 +#define MUIV_NList_First_Down -5 +#define MUIV_NList_First_PageUp -6 +#define MUIV_NList_First_PageDown -7 +#define MUIV_NList_First_Up2 -8 +#define MUIV_NList_First_Down2 -9 +#define MUIV_NList_First_Up4 -10 +#define MUIV_NList_First_Down4 -11 + +#define MUIV_NList_Horiz_First_Start -2 +#define MUIV_NList_Horiz_First_End -3 +#define MUIV_NList_Horiz_First_Left -4 +#define MUIV_NList_Horiz_First_Right -5 +#define MUIV_NList_Horiz_First_PageLeft -6 +#define MUIV_NList_Horiz_First_PageRight -7 +#define MUIV_NList_Horiz_First_Left2 -8 +#define MUIV_NList_Horiz_First_Right2 -9 +#define MUIV_NList_Horiz_First_Left4 -10 +#define MUIV_NList_Horiz_First_Right4 -11 + +#define MUIV_NList_MultiSelect_None 0 +#define MUIV_NList_MultiSelect_Default 1 +#define MUIV_NList_MultiSelect_Shifted 2 +#define MUIV_NList_MultiSelect_Always 3 + +#define MUIV_NList_Insert_Top 0 +#define MUIV_NList_Insert_Active -1 +#define MUIV_NList_Insert_Sorted -2 +#define MUIV_NList_Insert_Bottom -3 +#define MUIV_NList_Insert_Flag_Raw (1<<0) + +#define MUIV_NList_Remove_First 0 +#define MUIV_NList_Remove_Active -1 +#define MUIV_NList_Remove_Last -2 +#define MUIV_NList_Remove_Selected -3 + +#define MUIV_NList_Select_Off 0 +#define MUIV_NList_Select_On 1 +#define MUIV_NList_Select_Toggle 2 +#define MUIV_NList_Select_Ask 3 + +#define MUIV_NList_GetEntry_Active -1 +#define MUIV_NList_GetEntryInfo_Line -2 + +#define MUIV_NList_Select_Active -1 +#define MUIV_NList_Select_All -2 + +#define MUIV_NList_Redraw_Active -1 +#define MUIV_NList_Redraw_All -2 +#define MUIV_NList_Redraw_Title -3 +#define MUIV_NList_Redraw_Selected -4 +#define MUIV_NList_Redraw_VisibleCols -5 + +#define MUIV_NList_Move_Top 0 +#define MUIV_NList_Move_Active -1 +#define MUIV_NList_Move_Bottom -2 +#define MUIV_NList_Move_Next -3 /* only valid for second parameter (and not with Move_Selected) */ +#define MUIV_NList_Move_Previous -4 /* only valid for second parameter (and not with Move_Selected) */ +#define MUIV_NList_Move_Selected -5 /* only valid for first parameter */ + +#define MUIV_NList_Exchange_Top 0 +#define MUIV_NList_Exchange_Active -1 +#define MUIV_NList_Exchange_Bottom -2 +#define MUIV_NList_Exchange_Next -3 /* only valid for second parameter */ +#define MUIV_NList_Exchange_Previous -4 /* only valid for second parameter */ + +#define MUIV_NList_Jump_Top 0 +#define MUIV_NList_Jump_Active -1 +#define MUIV_NList_Jump_Bottom -2 +#define MUIV_NList_Jump_Down -3 +#define MUIV_NList_Jump_Up -4 +#define MUIV_NList_Jump_Active_Center -5 + +#define MUIV_NList_NextSelected_Start -1 +#define MUIV_NList_NextSelected_End -1 + +#define MUIV_NList_PrevSelected_Start -1 +#define MUIV_NList_PrevSelected_End -1 + +#define MUIV_NList_DragType_None 0 +#define MUIV_NList_DragType_Default 1 +#define MUIV_NList_DragType_Immediate 2 +#define MUIV_NList_DragType_Borders 3 +#define MUIV_NList_DragType_Qualifier 4 + +#define MUIV_NList_CopyToClip_Active -1 +#define MUIV_NList_CopyToClip_Selected -2 +#define MUIV_NList_CopyToClip_All -3 +#define MUIV_NList_CopyToClip_Entries -4 +#define MUIV_NList_CopyToClip_Entry -5 +#define MUIV_NList_CopyToClip_Strings -6 +#define MUIV_NList_CopyToClip_String -7 + +#define MUIV_NList_CopyTo_Active -1 +#define MUIV_NList_CopyTo_Selected -2 +#define MUIV_NList_CopyTo_All -3 +#define MUIV_NList_CopyTo_Entries -4 +#define MUIV_NList_CopyTo_Entry -5 + +#define MUIV_NLCT_Success 0 +#define MUIV_NLCT_OpenErr 1 +#define MUIV_NLCT_WriteErr 2 +#define MUIV_NLCT_Failed 3 + +#define MUIV_NList_ForcePen_On 1 +#define MUIV_NList_ForcePen_Off 0 +#define MUIV_NList_ForcePen_Default -1 + +#define MUIV_NList_DropType_Mask 0x00FF +#define MUIV_NList_DropType_None 0 +#define MUIV_NList_DropType_Above 1 +#define MUIV_NList_DropType_Below 2 +#define MUIV_NList_DropType_Onto 3 + +#define MUIV_NList_DoMethod_Active -1 +#define MUIV_NList_DoMethod_Selected -2 +#define MUIV_NList_DoMethod_All -3 + +#define MUIV_NList_DoMethod_Entry -1 +#define MUIV_NList_DoMethod_Self -2 +#define MUIV_NList_DoMethod_App -3 + +#define MUIV_NList_EntryValue (MUIV_TriggerValue+0x100) +#define MUIV_NList_EntryPosValue (MUIV_TriggerValue+0x102) +#define MUIV_NList_SelfValue (MUIV_TriggerValue+0x104) +#define MUIV_NList_AppValue (MUIV_TriggerValue+0x106) + +#define MUIV_NList_ColWidth_All -1 +#define MUIV_NList_ColWidth_Default -1 +#define MUIV_NList_ColWidth_Get -2 + +#define MUIV_NList_ContextMenu_Default 0x9d510031 +#define MUIV_NList_ContextMenu_TopOnly 0x9d510033 +#define MUIV_NList_ContextMenu_BarOnly 0x9d510035 +#define MUIV_NList_ContextMenu_Bar_Top 0x9d510037 +#define MUIV_NList_ContextMenu_Always 0x9d510039 +#define MUIV_NList_ContextMenu_Never 0x9d51003b + +#define MUIV_NList_Menu_DefWidth_This 0x9d51003d +#define MUIV_NList_Menu_DefWidth_All 0x9d51003f +#define MUIV_NList_Menu_DefOrder_This 0x9d510041 +#define MUIV_NList_Menu_DefOrder_All 0x9d510043 +#define MUIV_NList_Menu_Default_This MUIV_NList_Menu_DefWidth_This +#define MUIV_NList_Menu_Default_All MUIV_NList_Menu_DefWidth_All + +#define MUIV_NList_SortType_None 0xF0000000 +#define MUIV_NList_SortTypeAdd_None 0x00000000 +#define MUIV_NList_SortTypeAdd_2Values 0x80000000 +#define MUIV_NList_SortTypeAdd_4Values 0x40000000 +#define MUIV_NList_SortTypeAdd_Mask 0xC0000000 +#define MUIV_NList_SortTypeValue_Mask 0x3FFFFFFF + +#define MUIV_NList_Sort3_SortType_Both 0x00000000 +#define MUIV_NList_Sort3_SortType_1 0x00000001 +#define MUIV_NList_Sort3_SortType_2 0x00000002 + +#define MUIV_NList_Quiet_None 0 +#define MUIV_NList_Quiet_Full -1 +#define MUIV_NList_Quiet_Visual -2 + +#define MUIV_NList_Imports_Active (1 << 0) +#define MUIV_NList_Imports_Selected (1 << 1) +#define MUIV_NList_Imports_First (1 << 2) +#define MUIV_NList_Imports_ColWidth (1 << 3) +#define MUIV_NList_Imports_ColOrder (1 << 4) +#define MUIV_NList_Imports_TitleMark (1 << 7) +#define MUIV_NList_Imports_Cols 0x000000F8 +#define MUIV_NList_Imports_All 0x0000FFFF + +#define MUIV_NList_Exports_Active (1 << 0) +#define MUIV_NList_Exports_Selected (1 << 1) +#define MUIV_NList_Exports_First (1 << 2) +#define MUIV_NList_Exports_ColWidth (1 << 3) +#define MUIV_NList_Exports_ColOrder (1 << 4) +#define MUIV_NList_Exports_TitleMark (1 << 7) +#define MUIV_NList_Exports_Cols 0x000000F8 +#define MUIV_NList_Exports_All 0x0000FFFF + +#define MUIV_NList_TitleMark_ColMask 0x000000FF +#define MUIV_NList_TitleMark_TypeMask 0xF0000000 +#define MUIV_NList_TitleMark_None 0xF0000000 +#define MUIV_NList_TitleMark_Down 0x00000000 +#define MUIV_NList_TitleMark_Up 0x80000000 +#define MUIV_NList_TitleMark_Box 0x40000000 +#define MUIV_NList_TitleMark_Circle 0xC0000000 + +#define MUIV_NList_TitleMark2_ColMask 0x000000FF +#define MUIV_NList_TitleMark2_TypeMask 0xF0000000 +#define MUIV_NList_TitleMark2_None 0xF0000000 +#define MUIV_NList_TitleMark2_Down 0x00000000 +#define MUIV_NList_TitleMark2_Up 0x80000000 +#define MUIV_NList_TitleMark2_Box 0x40000000 +#define MUIV_NList_TitleMark2_Circle 0xC0000000 + +#define MUIV_NList_SetColumnCol_Default (-1) + +#define MUIV_NList_GetPos_Start (-1) +#define MUIV_NList_GetPos_End (-1) + +#define MUIV_NList_SelectChange_Flag_Multi (1 << 0) + +#define MUIV_NList_UseImage_All (-1) + +#define MUIV_NList_SetActive_Entry (1 << 0) +#define MUIV_NList_SetActive_Jump_Center (1 << 1) + +/* Structs */ + +struct BitMapImage +{ + ULONG control; /* should be == to MUIM_NList_CreateImage for a valid BitMapImage struct */ + WORD width; /* if control == MUIA_Image_Spec then obtainpens is a pointer to an Object */ + WORD height; + WORD *obtainpens; + PLANEPTR mask; + struct BitMap imgbmp; + LONG flags; +}; + + +struct MUI_NList_TestPos_Result +{ + LONG entry; /* number of entry, -1 if mouse not over valid entry */ + WORD column; /* numer of column, -1 if no valid column */ + UWORD flags; /* not in the list, see below */ + WORD xoffset; /* x offset in column */ + WORD yoffset; /* y offset of mouse click from center of line */ + WORD preparse; /* 2 if in column preparse string, 1 if in entry preparse string, else 0 */ + WORD char_number; /* the number of the clicked char in column, -1 if no valid */ + WORD char_xoffset; /* x offset of mouse clicked from left of char if positive */ +}; /* and left of next char if negative. If there is no char there */ + /* negative if from left of first char else from right of last one */ + +#define MUI_NLPR_ABOVE (1<<0) +#define MUI_NLPR_BELOW (1<<1) +#define MUI_NLPR_LEFT (1<<2) +#define MUI_NLPR_RIGHT (1<<3) +#define MUI_NLPR_BAR (1<<4) /* if between two columns you'll get the left + column number of both, and that flag */ +#define MUI_NLPR_TITLE (1<<5) /* if clicked on title, only column, xoffset and yoffset (and MUI_NLPR_BAR) + are valid (you'll get MUI_NLPR_ABOVE too) */ +#define MUI_NLPR_ONTOP (1<<6) /* it is on title/half of first visible entry */ + + +struct MUI_NList_GetEntryInfo +{ + LONG pos; /* num of entry you want info about */ + LONG line; /* real line number */ + LONG entry_pos; /* entry num of returned entry ptr */ + APTR entry; /* entry pointer */ + LONG wrapcol; /* NOWRAP, WRAPCOLx, or WRAPPED|WRAPCOLx */ + LONG charpos; /* start char number in string (unused if NOWRAP) */ + LONG charlen; /* string lenght (unused if NOWRAP) */ +}; + +#define NOWRAP 0x00 +#define WRAPCOL0 0x01 +#define WRAPCOL1 0x02 +#define WRAPCOL2 0x04 +#define WRAPCOL3 0x08 +#define WRAPCOL4 0x10 +#define WRAPCOL5 0x20 +#define WRAPCOL6 0x40 +#define WRAPPED 0x80 + + +struct MUI_NList_GetSelectInfo +{ + LONG start; /* num of first selected *REAL* entry/line (first of wrapped from which start is issued) */ + LONG end; /* num of last selected *REAL* entry/line (first of wrapped from which start is issued) */ + LONG num; /* not used */ + LONG start_column; /* column of start of selection in 'start' entry */ + LONG end_column; /* column of end of selection in 'end' entry */ + LONG start_pos; /* char pos of start of selection in 'start_column' entry */ + LONG end_pos; /* char pos of end of selection in 'end_column' entry */ + LONG vstart; /* num of first visually selected entry */ + LONG vend; /* num of last visually selected entry */ + LONG vnum; /* number of visually selected entries */ +}; +/* NOTE that vstart==start, vend==end in all cases if no wrapping is used */ + +/* Methods */ + +#define MUIM_NList_Clear 0x9d510070UL /* GM */ +#define MUIM_NList_CreateImage 0x9d510071UL /* GM */ +#define MUIM_NList_DeleteImage 0x9d510072UL /* GM */ +#define MUIM_NList_Exchange 0x9d510073UL /* GM */ +#define MUIM_NList_GetEntry 0x9d510074UL /* GM */ +#define MUIM_NList_Insert 0x9d510075UL /* GM */ +#define MUIM_NList_InsertSingle 0x9d510076UL /* GM */ +#define MUIM_NList_Jump 0x9d510077UL /* GM */ +#define MUIM_NList_Move 0x9d510078UL /* GM */ +#define MUIM_NList_NextSelected 0x9d510079UL /* GM */ +#define MUIM_NList_Redraw 0x9d51007aUL /* GM */ +#define MUIM_NList_Remove 0x9d51007bUL /* GM */ +#define MUIM_NList_Select 0x9d51007cUL /* GM */ +#define MUIM_NList_Sort 0x9d51007dUL /* GM */ +#define MUIM_NList_TestPos 0x9d51007eUL /* GM */ +#define MUIM_NList_CopyToClip 0x9d51007fUL /* GM */ +#define MUIM_NList_UseImage 0x9d510080UL /* GM */ +#define MUIM_NList_ReplaceSingle 0x9d510081UL /* GM */ +#define MUIM_NList_InsertWrap 0x9d510082UL /* GM */ +#define MUIM_NList_InsertSingleWrap 0x9d510083UL /* GM */ +#define MUIM_NList_GetEntryInfo 0x9d510084UL /* GM */ +#define MUIM_NList_QueryBeginning 0x9d510085UL /* Obsolete */ +#define MUIM_NList_GetSelectInfo 0x9d510086UL /* GM */ +#define MUIM_NList_CopyTo 0x9d510087UL /* GM */ +#define MUIM_NList_DropType 0x9d510088UL /* GM */ +#define MUIM_NList_DropDraw 0x9d510089UL /* GM */ +#define MUIM_NList_RedrawEntry 0x9d51008aUL /* GM */ +#define MUIM_NList_DoMethod 0x9d51008bUL /* GM */ +#define MUIM_NList_ColWidth 0x9d51008cUL /* GM */ +#define MUIM_NList_ContextMenuBuild 0x9d51008dUL /* GM */ +#define MUIM_NList_DropEntryDrawErase 0x9d51008eUL /* GM */ +#define MUIM_NList_ColToColumn 0x9d51008fUL /* GM */ +#define MUIM_NList_ColumnToCol 0x9d510091UL /* GM */ +#define MUIM_NList_Sort2 0x9d510092UL /* GM */ +#define MUIM_NList_PrevSelected 0x9d510093UL /* GM */ +#define MUIM_NList_SetColumnCol 0x9d510094UL /* GM */ +#define MUIM_NList_Sort3 0x9d510095UL /* GM */ +#define MUIM_NList_GetPos 0x9d510096UL /* GM */ +#define MUIM_NList_SelectChange 0x9d5100A0UL /* GM */ +#define MUIM_NList_Construct 0x9d5100A1UL /* GM */ +#define MUIM_NList_Destruct 0x9d5100A2UL /* GM */ +#define MUIM_NList_Compare 0x9d5100A3UL /* GM */ +#define MUIM_NList_Display 0x9d5100A4UL /* GM */ +#define MUIM_NList_GoActive 0x9d5100A5UL /* GM */ +#define MUIM_NList_GoInactive 0x9d5100A6UL /* GM */ +#define MUIM_NList_SetActive 0x9d5100A7UL /* GM */ + +/* +for future extensions, skip 0x9d5100AF as method ID, this one is already used by NFloattext +*/ + +struct MUIP_NList_Clear { STACKED ULONG MethodID; }; +struct MUIP_NList_CreateImage { STACKED ULONG MethodID; STACKED Object *obj; STACKED ULONG flags; }; +struct MUIP_NList_DeleteImage { STACKED ULONG MethodID; STACKED APTR listimg; }; +struct MUIP_NList_Exchange { STACKED ULONG MethodID; STACKED LONG pos1; STACKED LONG pos2; }; +struct MUIP_NList_GetEntry { STACKED ULONG MethodID; STACKED LONG pos; STACKED APTR *entry; }; +struct MUIP_NList_Insert { STACKED ULONG MethodID; STACKED APTR *entries; STACKED LONG count; STACKED LONG pos; STACKED ULONG flags; }; +struct MUIP_NList_InsertSingle { STACKED ULONG MethodID; STACKED APTR entry; STACKED LONG pos; }; +struct MUIP_NList_Jump { STACKED ULONG MethodID; STACKED LONG pos; }; +struct MUIP_NList_Move { STACKED ULONG MethodID; STACKED LONG from; STACKED LONG to; }; +struct MUIP_NList_NextSelected { STACKED ULONG MethodID; STACKED LONG *pos; }; +struct MUIP_NList_Redraw { STACKED ULONG MethodID; STACKED LONG pos; }; +struct MUIP_NList_Remove { STACKED ULONG MethodID; STACKED LONG pos; }; +struct MUIP_NList_Select { STACKED ULONG MethodID; STACKED LONG pos; STACKED LONG seltype; STACKED LONG *state; }; +struct MUIP_NList_Sort { STACKED ULONG MethodID; }; +struct MUIP_NList_TestPos { STACKED ULONG MethodID; STACKED LONG x; STACKED LONG y; STACKED struct MUI_NList_TestPos_Result *res; }; +struct MUIP_NList_CopyToClip { STACKED ULONG MethodID; STACKED LONG pos; STACKED ULONG clipnum; STACKED APTR *entries; STACKED struct Hook *hook; }; +struct MUIP_NList_UseImage { STACKED ULONG MethodID; STACKED Object *obj; STACKED LONG imgnum; STACKED ULONG flags; }; +struct MUIP_NList_ReplaceSingle { STACKED ULONG MethodID; STACKED APTR entry; STACKED LONG pos; STACKED LONG wrapcol; STACKED LONG align; }; +struct MUIP_NList_InsertWrap { STACKED ULONG MethodID; STACKED APTR *entries; STACKED LONG count; STACKED LONG pos; STACKED LONG wrapcol; STACKED LONG align; STACKED ULONG flags; }; +struct MUIP_NList_InsertSingleWrap { STACKED ULONG MethodID; STACKED APTR entry; STACKED LONG pos; STACKED LONG wrapcol; STACKED LONG align; }; +struct MUIP_NList_GetEntryInfo { STACKED ULONG MethodID; STACKED struct MUI_NList_GetEntryInfo *res; }; +struct MUIP_NList_QueryBeginning { STACKED ULONG MethodID; }; +struct MUIP_NList_GetSelectInfo { STACKED ULONG MethodID; STACKED struct MUI_NList_GetSelectInfo *res; }; +struct MUIP_NList_CopyTo { STACKED ULONG MethodID; STACKED LONG pos; STACKED char *filename; STACKED APTR *result; STACKED APTR *entries; }; +struct MUIP_NList_DropType { STACKED ULONG MethodID; STACKED LONG *pos; STACKED LONG *type; STACKED LONG minx, maxx, miny, maxy; STACKED LONG mousex, mousey; }; +struct MUIP_NList_DropDraw { STACKED ULONG MethodID; STACKED LONG pos; STACKED LONG type; STACKED LONG minx, maxx, miny, maxy; }; +struct MUIP_NList_RedrawEntry { STACKED ULONG MethodID; STACKED APTR entry; }; +struct MUIP_NList_DoMethod { STACKED ULONG MethodID; STACKED LONG pos; STACKED APTR DestObj; STACKED ULONG FollowParams; /* ... */ }; +struct MUIP_NList_ColWidth { STACKED ULONG MethodID; STACKED LONG col; STACKED LONG width; }; +struct MUIP_NList_ContextMenuBuild { STACKED ULONG MethodID; STACKED LONG mx; STACKED LONG my; STACKED LONG pos; STACKED LONG column; STACKED LONG flags; STACKED LONG ontop; }; +struct MUIP_NList_DropEntryDrawErase { STACKED ULONG MethodID; STACKED LONG type; STACKED LONG drawpos; STACKED LONG erasepos; }; +struct MUIP_NList_ColToColumn { STACKED ULONG MethodID; STACKED LONG col; }; +struct MUIP_NList_ColumnToCol { STACKED ULONG MethodID; STACKED LONG column; }; +struct MUIP_NList_Sort2 { STACKED ULONG MethodID; STACKED LONG sort_type; STACKED LONG sort_type_add; }; +struct MUIP_NList_PrevSelected { STACKED ULONG MethodID; STACKED LONG *pos; }; +struct MUIP_NList_SetColumnCol { STACKED ULONG MethodID; STACKED LONG column; STACKED LONG col; }; +struct MUIP_NList_Sort3 { STACKED ULONG MethodID; STACKED LONG sort_type; STACKED LONG sort_type_add; STACKED LONG which; }; +struct MUIP_NList_GetPos { STACKED ULONG MethodID; STACKED APTR entry; STACKED LONG *pos; }; +struct MUIP_NList_SelectChange { STACKED ULONG MethodID; STACKED LONG pos; STACKED LONG state; STACKED ULONG flags; }; +struct MUIP_NList_Construct { STACKED ULONG MethodID; STACKED APTR entry; STACKED APTR pool; }; +struct MUIP_NList_Destruct { STACKED ULONG MethodID; STACKED APTR entry; STACKED APTR pool; }; +struct MUIP_NList_Compare { STACKED ULONG MethodID; STACKED APTR entry1; STACKED APTR entry2; STACKED LONG sort_type1; STACKED LONG sort_type2; }; +struct MUIP_NList_Display { STACKED ULONG MethodID; STACKED APTR entry; STACKED LONG entry_pos; STACKED STRPTR *strings; STACKED STRPTR *preparses; }; +struct MUIP_NList_GoActive { STACKED ULONG MethodID; }; +struct MUIP_NList_GoInactive { STACKED ULONG MethodID; }; +struct MUIP_NList_SetActive { STACKED ULONG MethodID; STACKED SIPTR pos; STACKED ULONG flags; }; + +#define DISPLAY_ARRAY_MAX 64 + +#define ALIGN_LEFT 0x0000 +#define ALIGN_CENTER 0x0100 +#define ALIGN_RIGHT 0x0200 +#define ALIGN_JUSTIFY 0x0400 + + +/* Be carrefull ! the 'sort_type2' member don't exist in releases before 19.96 + * where MUIM_NList_Sort3, MUIA_NList_SortType2, MUIA_NList_TitleClick2 and + * MUIA_NList_TitleMark2 have appeared ! + * You can safely use get(obj,MUIA_NList_SortType2,&st2) instead if you are not + * sure of the NList.mcc release which is used. + */ +struct NList_CompareMessage +{ + STACKED APTR entry1; + STACKED APTR entry2; + STACKED LONG sort_type; + STACKED LONG sort_type2; +}; + +struct NList_ConstructMessage +{ + STACKED APTR entry; + STACKED APTR pool; +}; + +struct NList_DestructMessage +{ + STACKED APTR entry; + STACKED APTR pool; +}; + +struct NList_DisplayMessage +{ + STACKED APTR entry; + STACKED LONG entry_pos; + STACKED char *strings[DISPLAY_ARRAY_MAX]; + STACKED char *preparses[DISPLAY_ARRAY_MAX]; +}; + +struct NList_CopyEntryToClipMessage +{ + STACKED APTR entry; + STACKED LONG entry_pos; + STACKED char *str_result; + STACKED LONG column1; + STACKED LONG column1_pos; + STACKED LONG column2; + STACKED LONG column2_pos; + STACKED LONG column1_pos_type; + STACKED LONG column2_pos_type; +}; + +struct NList_CopyColumnToClipMessage +{ + STACKED char *string; + STACKED LONG entry_pos; + STACKED char *str_result; + STACKED LONG str_pos1; + STACKED LONG str_pos2; +}; + +#if !defined(__AROS__) && defined(__PPC__) + #if defined(__GNUC__) + #pragma pack() + #elif defined(__VBCC__) + #pragma default-align + #endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* MUI_NList_MCC_H */ diff --git a/workbench/classes/zune/nlist/include/mui/NListtree_mcc.h b/workbench/classes/zune/nlist/include/mui/NListtree_mcc.h new file mode 100644 index 0000000000..ca2852a0ac --- /dev/null +++ b/workbench/classes/zune/nlist/include/mui/NListtree_mcc.h @@ -0,0 +1,760 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2009 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/*** Include stuff ***/ + +#ifndef NLISTTREE_MCC_H +#define NLISTTREE_MCC_H + +#ifndef LIBRARIES_MUI_H +#include "libraries/mui.h" +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(__AROS__) && defined(__PPC__) + #if defined(__GNUC__) + #pragma pack(2) + #elif defined(__VBCC__) + #pragma amiga-align + #endif +#endif + +/***********************************************************************/ + +// STACKED ensures proper alignment on AROS 64 bit systems +#if !defined(__AROS__) && !defined(STACKED) +#define STACKED +#endif + +/***********************************************************************/ + +/*** MUI Defines ***/ + +#define MUIC_NListtree "NListtree.mcc" +#if defined(__AROS__) && !defined(NO_INLINE_STDARG) +#define NListtreeObject MUIOBJMACRO_START(MUIC_NListtree) +#else +#define NListtreeObject MUI_NewObject(MUIC_NListtree +#endif + +/*** Attributes ***/ + +#define MUIA_NListtree_Active 0xfec81201UL // *** [.SGN] +#define MUIA_NListtree_ActiveList 0xfec81202UL // *** [..GN] +#define MUIA_NListtree_CloseHook 0xfec81203UL // *** [IS..] +#define MUIA_NListtree_ConstructHook 0xfec81204UL // *** [IS..] +#define MUIA_NListtree_DestructHook 0xfec81205UL // *** [IS..] +#define MUIA_NListtree_DisplayHook 0xfec81206UL // *** [IS..] +#define MUIA_NListtree_DoubleClick 0xfec81207UL // *** [ISGN] +#define MUIA_NListtree_DragDropSort 0xfec81208UL // *** [IS..] +#define MUIA_NListtree_DupNodeName 0xfec81209UL // *** [IS..] +#define MUIA_NListtree_EmptyNodes 0xfec8120aUL // *** [IS..] +#define MUIA_NListtree_Format 0xfec8120bUL // *** [IS..] +#define MUIA_NListtree_OpenHook 0xfec8120cUL // *** [IS..] +#define MUIA_NListtree_Quiet 0xfec8120dUL // *** [.S..] +#define MUIA_NListtree_CompareHook 0xfec8120eUL // *** [IS..] +#define MUIA_NListtree_Title 0xfec8120fUL // *** [IS..] +#define MUIA_NListtree_TreeColumn 0xfec81210UL // *** [ISG.] +#define MUIA_NListtree_AutoVisible 0xfec81211UL // *** [ISG.] +#define MUIA_NListtree_FindNameHook 0xfec81212UL // *** [IS..] +#define MUIA_NListtree_MultiSelect 0xfec81213UL // *** [I...] +#define MUIA_NListtree_MultiTestHook 0xfec81214UL // *** [IS..] +#define MUIA_NListtree_CopyToClipHook 0xfec81217UL // *** [IS..] +#define MUIA_NListtree_DropType 0xfec81218UL // *** [..G.] +#define MUIA_NListtree_DropTarget 0xfec81219UL // *** [..G.] +#define MUIA_NListtree_DropTargetPos 0xfec8121aUL // *** [..G.] +#define MUIA_NListtree_FindUserDataHook 0xfec8121bUL // *** [IS..] +#define MUIA_NListtree_ShowTree 0xfec8121cUL // *** [ISG.] +#define MUIA_NListtree_SelectChange 0xfec8121dUL // *** [ISGN] + + +/*** Special attribute values ***/ + +#define MUIV_NListtree_Active_Off 0 +#define MUIV_NListtree_Active_Parent -2 +#define MUIV_NListtree_Active_First -3 +#define MUIV_NListtree_Active_FirstVisible -4 +#define MUIV_NListtree_Active_LastVisible -5 + +#define MUIV_NListtree_ActiveList_Off 0 + +#define MUIV_NListtree_AutoVisible_Off 0 +#define MUIV_NListtree_AutoVisible_Normal 1 +#define MUIV_NListtree_AutoVisible_FirstOpen 2 +#define MUIV_NListtree_AutoVisible_Expand 3 + +#define MUIV_NListtree_CompareHook_Head 0 +#define MUIV_NListtree_CompareHook_Tail -1 +#define MUIV_NListtree_CompareHook_LeavesTop -2 +#define MUIV_NListtree_CompareHook_LeavesMixed -3 +#define MUIV_NListtree_CompareHook_LeavesBottom -4 + +#define MUIV_NListtree_ConstructHook_String -1 +#define MUIV_NListtree_ConstructHook_Flag_AutoCreate (1<<15) + +#define MUIV_NListtree_CopyToClipHook_Default 0 + +#define MUIV_NListtree_DestructHook_String -1 + +#define MUIV_NListtree_DisplayHook_Default -1 + +#define MUIV_NListtree_DoubleClick_Off -1 +#define MUIV_NListtree_DoubleClick_All -2 +#define MUIV_NListtree_DoubleClick_Tree -3 +#define MUIV_NListtree_DoubleClick_NoTrigger -4 + +#define MUIV_NListtree_DropType_None 0 +#define MUIV_NListtree_DropType_Above 1 +#define MUIV_NListtree_DropType_Below 2 +#define MUIV_NListtree_DropType_Onto 3 +#define MUIV_NListtree_DropType_Sorted 4 + +#define MUIV_NListtree_FindNameHook_CaseSensitive 0 +#define MUIV_NListtree_FindNameHook_CaseInsensitive -1 +#define MUIV_NListtree_FindNameHook_Part -2 +#define MUIV_NListtree_FindNameHook_PartCaseInsensitive -3 +#define MUIV_NListtree_FindNameHook_PointerCompare -4 + +#define MUIV_NListtree_FindUserDataHook_CaseSensitive 0 +#define MUIV_NListtree_FindUserDataHook_CaseInsensitive -1 +#define MUIV_NListtree_FindUserDataHook_Part -2 +#define MUIV_NListtree_FindUserDataHook_PartCaseInsensitive -3 +#define MUIV_NListtree_FindUserDataHook_PointerCompare -4 + +#define MUIV_NListtree_MultiSelect_None 0 +#define MUIV_NListtree_MultiSelect_Default 1 +#define MUIV_NListtree_MultiSelect_Shifted 2 +#define MUIV_NListtree_MultiSelect_Always 3 + + +#define MUIV_NListtree_ShowTree_Toggle -1 + + +/*** Structures & Flags ***/ + +struct MUI_NListtree_TreeNode { + struct MinNode tn_Node; // *** To make it a node. + STRPTR tn_Name; // *** Simple name field. + UWORD tn_Flags; // *** Used for the flags below. + APTR tn_User; // *** Free for user data. +}; + + +#define TNF_OPEN (1<<0) +#define TNF_LIST (1<<1) +#define TNF_FROZEN (1<<2) +#define TNF_NOSIGN (1<<3) +#define TNF_SELECTED (1<<4) + + + +struct MUI_NListtree_TestPos_Result { + struct MUI_NListtree_TreeNode *tpr_TreeNode; + UWORD tpr_Type; + LONG tpr_ListEntry; + UWORD tpr_ListFlags; + WORD tpr_Column; + +}; + +#define tpr_Flags tpr_Type /* OBSOLETE */ + + +/*** Methods ***/ + +#define MUIM_NListtree_Open 0xfec81101UL +#define MUIM_NListtree_Close 0xfec81102UL +#define MUIM_NListtree_Insert 0xfec81103UL +#define MUIM_NListtree_Remove 0xfec81104UL +#define MUIM_NListtree_Exchange 0xfec81105UL +#define MUIM_NListtree_Move 0xfec81106UL +#define MUIM_NListtree_Rename 0xfec81107UL +#define MUIM_NListtree_FindName 0xfec81108UL +#define MUIM_NListtree_GetEntry 0xfec81109UL +#define MUIM_NListtree_GetNr 0xfec8110aUL +#define MUIM_NListtree_Sort 0xfec8110bUL +#define MUIM_NListtree_TestPos 0xfec8110cUL +#define MUIM_NListtree_Redraw 0xfec8110dUL +#define MUIM_NListtree_NextSelected 0xfec81110UL +#define MUIM_NListtree_MultiTest 0xfec81111UL +#define MUIM_NListtree_Select 0xfec81112UL +#define MUIM_NListtree_Copy 0xfec81113UL +#define MUIM_NListtree_InsertStruct 0xfec81114UL // *** Insert a struct (like a path) into the list. +#define MUIM_NListtree_Active 0xfec81115UL // *** Method which gives the active node/number. +#define MUIM_NListtree_DoubleClick 0xfec81116UL // *** Occurs on every double click. +#define MUIM_NListtree_PrevSelected 0xfec81118UL // *** Like reverse NextSelected. +#define MUIM_NListtree_CopyToClip 0xfec81119UL // *** Copy an entry or part to the clipboard. +#define MUIM_NListtree_FindUserData 0xfec8111aUL // *** Find a node upon user data. +#define MUIM_NListtree_Clear 0xfec8111bUL // *** Clear complete tree. +#define MUIM_NListtree_DropType 0xfec8111eUL // *** +#define MUIM_NListtree_DropDraw 0xfec8111fUL // *** +#define MUIM_NListtree_Construct 0xfec81120UL // *** Construct a treenode +#define MUIM_NListtree_Destruct 0xfec81121UL // *** Destruct a treenode +#define MUIM_NListtree_Display 0xfec81122UL // *** Display a treenode +#define MUIM_NListtree_Compare 0xfec81123UL // *** Compare two treenodes + + +/*** Method structs ***/ + +struct MUIP_NListtree_Open +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_Close +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_Insert +{ + STACKED ULONG MethodID; + STACKED STRPTR Name; + STACKED APTR User; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED struct MUI_NListtree_TreeNode *PrevNode; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_Remove +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_Clear +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_FindName +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED STRPTR Name; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_FindUserData +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED APTR User; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_GetEntry +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *Node; + STACKED LONG Position; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_GetNr +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_Move +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *OldListNode; + STACKED struct MUI_NListtree_TreeNode *OldTreeNode; + STACKED struct MUI_NListtree_TreeNode *NewListNode; + STACKED struct MUI_NListtree_TreeNode *NewTreeNode; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_Exchange +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode1; + STACKED struct MUI_NListtree_TreeNode *TreeNode1; + STACKED struct MUI_NListtree_TreeNode *ListNode2; + STACKED struct MUI_NListtree_TreeNode *TreeNode2; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_Rename +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED STRPTR NewName; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_Sort +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_TestPos +{ + STACKED ULONG MethodID; + STACKED LONG X; + STACKED LONG Y; + STACKED APTR Result; +}; + +struct MUIP_NListtree_Redraw +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_Select +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG SelType; + STACKED LONG SelFlags; + STACKED LONG *State; +}; + +struct MUIP_NListtree_NextSelected +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode **TreeNode; +}; + +struct MUIP_NListtree_MultiTest +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG SelType; + STACKED LONG SelFlags; + STACKED LONG CurrType; +}; + +struct MUIP_NListtree_Copy +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *SourceListNode; + STACKED struct MUI_NListtree_TreeNode *SourceTreeNode; + STACKED struct MUI_NListtree_TreeNode *DestListNode; + STACKED struct MUI_NListtree_TreeNode *DestTreeNode; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_InsertStruct +{ + STACKED ULONG MethodID; + STACKED STRPTR Name; + STACKED APTR User; + STACKED STRPTR Delimiter; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_Active +{ + STACKED ULONG MethodID; + STACKED LONG Pos; + STACKED struct MUI_NListtree_TreeNode *ActiveNode; +}; + +struct MUIP_NListtree_DoubleClick +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG Entry; + STACKED LONG Column; +}; + +struct MUIP_NListtree_PrevSelected +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode **TreeNode; +}; + +struct MUIP_NListtree_CopyToClip +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG Pos; + STACKED LONG Unit; +}; + +struct MUIP_NListtree_DropType +{ + STACKED ULONG MethodID; + STACKED LONG *Pos; + STACKED LONG *Type; + STACKED LONG MinX, MaxX, MinY, MaxY; + STACKED LONG MouseX, MouseY; +}; + +struct MUIP_NListtree_DropDraw +{ + STACKED ULONG MethodID; + STACKED LONG Pos; + STACKED LONG Type; + STACKED LONG MinX, MaxX, MinY, MaxY; +}; + +struct MUIP_NListtree_Construct +{ + STACKED ULONG MethodID; + STACKED STRPTR Name; + STACKED APTR UserData; + STACKED APTR MemPool; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_Destruct +{ + STACKED ULONG MethodID; + STACKED STRPTR Name; + STACKED APTR UserData; + STACKED APTR MemPool; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_Display +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG EntryPos; + STACKED STRPTR *Array; + STACKED STRPTR *Preparse; +}; + +struct MUIP_NListtree_Compare +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode1; + STACKED struct MUI_NListtree_TreeNode *TreeNode2; + STACKED LONG SortType; +}; + +/*** Special method values ***/ + +#define MUIV_NListtree_Close_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_Close_ListNode_Parent ((IPTR)-1) +#define MUIV_NListtree_Close_ListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Close_TreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Close_TreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Close_TreeNode_Active ((IPTR)-2) +#define MUIV_NListtree_Close_TreeNode_All ((IPTR)-3) + + + +#define MUIV_NListtree_Exchange_ListNode1_Root ((IPTR)0) +#define MUIV_NListtree_Exchange_ListNode1_Active ((IPTR)-2) + +#define MUIV_NListtree_Exchange_TreeNode1_Head ((IPTR)0) +#define MUIV_NListtree_Exchange_TreeNode1_Tail ((IPTR)-1) +#define MUIV_NListtree_Exchange_TreeNode1_Active ((IPTR)-2) + +#define MUIV_NListtree_Exchange_ListNode2_Root ((IPTR)0) +#define MUIV_NListtree_Exchange_ListNode2_Active ((IPTR)-2) + +#define MUIV_NListtree_Exchange_TreeNode2_Head ((IPTR)0) +#define MUIV_NListtree_Exchange_TreeNode2_Tail ((IPTR)-1) +#define MUIV_NListtree_Exchange_TreeNode2_Active ((IPTR)-2) +#define MUIV_NListtree_Exchange_TreeNode2_Up ((IPTR)-5) +#define MUIV_NListtree_Exchange_TreeNode2_Down ((IPTR)-6) + + +#define MUIV_NListtree_FindName_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_FindName_ListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_FindName_Flag_SameLevel (1<<15) +#define MUIV_NListtree_FindName_Flag_Visible (1<<14) +#define MUIV_NListtree_FindName_Flag_Activate (1<<13) +#define MUIV_NListtree_FindName_Flag_Selected (1<<11) +#define MUIV_NListtree_FindName_Flag_StartNode (1<<10) +#define MUIV_NListtree_FindName_Flag_Reverse (1<<9) + + +#define MUIV_NListtree_FindUserData_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_FindUserData_ListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_FindUserData_Flag_SameLevel (1<<15) +#define MUIV_NListtree_FindUserData_Flag_Visible (1<<14) +#define MUIV_NListtree_FindUserData_Flag_Activate (1<<13) +#define MUIV_NListtree_FindUserData_Flag_Selected (1<<11) +#define MUIV_NListtree_FindUserData_Flag_StartNode (1<<10) +#define MUIV_NListtree_FindUserData_Flag_Reverse (1<<9) + + +#define MUIV_NListtree_GetEntry_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_GetEntry_ListNode_Active ((IPTR)-2) +#define MUIV_NListtree_GetEntry_TreeNode_Active ((IPTR)-3) + +#define MUIV_NListtree_GetEntry_Position_Head (0) +#define MUIV_NListtree_GetEntry_Position_Tail (-1) +#define MUIV_NListtree_GetEntry_Position_Active (-2) +#define MUIV_NListtree_GetEntry_Position_Next (-3) +#define MUIV_NListtree_GetEntry_Position_Previous (-4) +#define MUIV_NListtree_GetEntry_Position_Parent (-5) + +#define MUIV_NListtree_GetEntry_Flag_SameLevel (1<<15) +#define MUIV_NListtree_GetEntry_Flag_Visible (1<<14) + + +#define MUIV_NListtree_GetNr_TreeNode_Active ((IPTR)-2) + +#define MUIV_NListtree_GetNr_Flag_CountAll (1<<15) +#define MUIV_NListtree_GetNr_Flag_CountLevel (1<<14) +#define MUIV_NListtree_GetNr_Flag_CountList (1<<13) +#define MUIV_NListtree_GetNr_Flag_ListEmpty (1<<12) +#define MUIV_NListtree_GetNr_Flag_Visible (1<<11) + + +#define MUIV_NListtree_Insert_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_Insert_ListNode_Active ((IPTR)-2) +#define MUIV_NListtree_Insert_ListNode_LastInserted ((IPTR)-3) +#define MUIV_NListtree_Insert_ListNode_ActiveFallback ((IPTR)-4) + +#define MUIV_NListtree_Insert_PrevNode_Head ((IPTR)0) +#define MUIV_NListtree_Insert_PrevNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Insert_PrevNode_Active ((IPTR)-2) +#define MUIV_NListtree_Insert_PrevNode_Sorted ((IPTR)-4) + +#define MUIV_NListtree_Insert_Flag_Active (1<<13) +#define MUIV_NListtree_Insert_Flag_NextNode (1<<12) + + +#define MUIV_NListtree_Move_OldListNode_Root ((IPTR)0) +#define MUIV_NListtree_Move_OldListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Move_OldTreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Move_OldTreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Move_OldTreeNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Move_NewListNode_Root ((IPTR)0) +#define MUIV_NListtree_Move_NewListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Move_NewTreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Move_NewTreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Move_NewTreeNode_Active ((IPTR)-2) +#define MUIV_NListtree_Move_NewTreeNode_Sorted ((IPTR)-4) + +#define MUIV_NListtree_Move_Flag_KeepStructure (1<<13) + + +#define MUIV_NListtree_Open_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_Open_ListNode_Parent ((IPTR)-1) +#define MUIV_NListtree_Open_ListNode_Active ((IPTR)-2) +#define MUIV_NListtree_Open_TreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Open_TreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Open_TreeNode_Active ((IPTR)-2) +#define MUIV_NListtree_Open_TreeNode_All ((IPTR)-3) + + + +#define MUIV_NListtree_Remove_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_Remove_ListNode_Active ((IPTR)-2) +#define MUIV_NListtree_Remove_TreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Remove_TreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Remove_TreeNode_Active ((IPTR)-2) +#define MUIV_NListtree_Remove_TreeNode_All ((IPTR)-3) +#define MUIV_NListtree_Remove_TreeNode_Selected ((IPTR)-4) + +#define MUIV_NListtree_Remove_Flag_NoActive (1<<13) + + + + +#define MUIV_NListtree_Rename_TreeNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Rename_Flag_User (1<<8) +#define MUIV_NListtree_Rename_Flag_NoRefresh (1<<9) + + +#define MUIV_NListtree_Sort_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_Sort_ListNode_Active ((IPTR)-2) +#define MUIV_NListtree_Sort_TreeNode_Active ((IPTR)-3) + +#define MUIV_NListtree_Sort_Flag_RecursiveOpen (1<<13) +#define MUIV_NListtree_Sort_Flag_RecursiveAll (1<<12) + + +#define MUIV_NListtree_TestPos_Result_None (0) +#define MUIV_NListtree_TestPos_Result_Above (1) +#define MUIV_NListtree_TestPos_Result_Below (2) +#define MUIV_NListtree_TestPos_Result_Onto (3) +#define MUIV_NListtree_TestPos_Result_Sorted (4) + +#define MUIV_NListtree_Redraw_Active ((IPTR)-1) +#define MUIV_NListtree_Redraw_All ((IPTR)-2) + +#define MUIV_NListtree_Redraw_Flag_Nr (1<<15) + +#define MUIV_NListtree_Select_Active ((IPTR)-1) +#define MUIV_NListtree_Select_All ((IPTR)-2) +#define MUIV_NListtree_Select_Visible ((IPTR)-3) + +#define MUIV_NListtree_Select_Off ((IPTR)0) +#define MUIV_NListtree_Select_On ((IPTR)1) +#define MUIV_NListtree_Select_Toggle ((IPTR)2) +#define MUIV_NListtree_Select_Ask ((IPTR)3) + +#define MUIV_NListtree_Select_Flag_Force (1<<15) + + +#define MUIV_NListtree_NextSelected_Start ((IPTR)-1) +#define MUIV_NListtree_NextSelected_End ((IPTR)-1) + + +#define MUIV_NListtree_Copy_SourceListNode_Root ((IPTR)0) +#define MUIV_NListtree_Copy_SourceListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Copy_SourceTreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Copy_SourceTreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Copy_SourceTreeNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Copy_DestListNode_Root ((IPTR)0) +#define MUIV_NListtree_Copy_DestListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Copy_DestTreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Copy_DestTreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Copy_DestTreeNode_Active ((IPTR)-2) +#define MUIV_NListtree_Copy_DestTreeNode_Sorted ((IPTR)-4) + +#define MUIV_NListtree_Copy_Flag_KeepStructure (1<<13) + + +#define MUIV_NListtree_PrevSelected_Start ((IPTR)-1) +#define MUIV_NListtree_PrevSelected_End ((IPTR)-1) + + +#define MUIV_NListtree_CopyToClip_Active ((IPTR)-1) + + +/*** Hook message structs ***/ + +struct MUIP_NListtree_CloseMessage +{ + STACKED ULONG HookID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; +}; + +struct MUIP_NListtree_CompareMessage +{ + STACKED ULONG HookID; + STACKED struct MUI_NListtree_TreeNode *TreeNode1; + STACKED struct MUI_NListtree_TreeNode *TreeNode2; + STACKED LONG SortType; +}; + +struct MUIP_NListtree_ConstructMessage +{ + STACKED ULONG HookID; + STACKED STRPTR Name; + STACKED APTR UserData; + STACKED APTR MemPool; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_DestructMessage +{ + STACKED ULONG HookID; + STACKED STRPTR Name; + STACKED APTR UserData; + STACKED APTR MemPool; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_DisplayMessage +{ + STACKED ULONG HookID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG EntryPos; + STACKED STRPTR *Array; + STACKED STRPTR *Preparse; +}; + +struct MUIP_NListtree_CopyToClipMessage +{ + STACKED ULONG HookID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG Pos; + STACKED LONG Unit; +}; + +struct MUIP_NListtree_FindNameMessage +{ + STACKED ULONG HookID; + STACKED STRPTR Name; + STACKED STRPTR NodeName; + STACKED APTR UserData; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_FindUserDataMessage +{ + STACKED ULONG HookID; + STACKED APTR User; + STACKED APTR UserData; + STACKED STRPTR NodeName; + STACKED ULONG Flags; +}; + +struct MUIP_NListtree_OpenMessage +{ + STACKED ULONG HookID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; +}; + +struct MUIP_NListtree_MultiTestMessage +{ + STACKED ULONG HookID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG SelType; + STACKED LONG SelFlags; + STACKED LONG CurrType; +}; + +#if !defined(__AROS__) && defined(__PPC__) + #if defined(__GNUC__) + #pragma pack() + #elif defined(__VBCC__) + #pragma default-align + #endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* NLISTTREE_MCC_H */ diff --git a/workbench/classes/zune/nlist/include/mui/NListview_mcc.h b/workbench/classes/zune/nlist/include/mui/NListview_mcc.h new file mode 100644 index 0000000000..cd5c0b6814 --- /dev/null +++ b/workbench/classes/zune/nlist/include/mui/NListview_mcc.h @@ -0,0 +1,78 @@ +/*************************************************************************** + + NListview.mcc - New Listview MUI Custom Class + Registered MUI class, Serial Number: 1d51 (0x9d510020 to 0x9d51002F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2009 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef MUI_NListview_MCC_H +#define MUI_NListview_MCC_H + +#ifndef LIBRARIES_MUI_H +#include <libraries/mui.h> +#endif + +#ifndef MUI_NList_MCC_H +#include <mui/NList_mcc.h> +#endif + +#define MUIC_NListview "NListview.mcc" +#if defined(__AROS__) && !defined(NO_INLINE_STDARG) +#define NListviewObject MUIOBJMACRO_START(MUIC_NListview) +#else +#define NListviewObject MUI_NewObject(MUIC_NListview +#endif + +/* Attributes */ + +#define MUIA_NListview_NList 0x9d510020UL /* GM i.g Object * */ + +#define MUIA_NListview_Vert_ScrollBar 0x9d510021UL /* GM isg LONG */ +#define MUIA_NListview_Horiz_ScrollBar 0x9d510022UL /* GM isg LONG */ +#define MUIA_NListview_VSB_Width 0x9d510023UL /* GM ..g LONG */ +#define MUIA_NListview_HSB_Height 0x9d510024UL /* GM ..g LONG */ + +#define MUIV_Listview_ScrollerPos_Default 0 +#define MUIV_Listview_ScrollerPos_Left 1 +#define MUIV_Listview_ScrollerPos_Right 2 +#define MUIV_Listview_ScrollerPos_None 3 + +#define MUIM_NListview_QueryBeginning MUIM_NList_QueryBeginning /* obsolete */ + +#define MUIV_NListview_VSB_Always 1 +#define MUIV_NListview_VSB_Auto 2 +#define MUIV_NListview_VSB_FullAuto 3 +#define MUIV_NListview_VSB_None 4 +#define MUIV_NListview_VSB_Default 5 +#define MUIV_NListview_VSB_Left 6 + +#define MUIV_NListview_HSB_Always 1 +#define MUIV_NListview_HSB_Auto 2 +#define MUIV_NListview_HSB_FullAuto 3 +#define MUIV_NListview_HSB_None 4 +#define MUIV_NListview_HSB_Default 5 + +#define MUIV_NListview_VSB_On 0x0030 +#define MUIV_NListview_VSB_Off 0x0010 + +#define MUIV_NListview_HSB_On 0x0300 +#define MUIV_NListview_HSB_Off 0x0100 + +#endif /* MUI_NListview_MCC_H */ diff --git a/workbench/classes/zune/nlist/include/muiextra.h b/workbench/classes/zune/nlist/include/muiextra.h new file mode 100644 index 0000000000..9a58ff22a1 --- /dev/null +++ b/workbench/classes/zune/nlist/include/muiextra.h @@ -0,0 +1,93 @@ +#ifndef MUIA_Framedisplay_Spec +#define MUIA_Framedisplay_Spec 0x80421794 // V11 isg struct MUI_FrameSpec +#endif +#ifndef MUIA_Imagedisplay_Spec +#define MUIA_Imagedisplay_Spec 0x8042a547 // V11 isg struct MUI_ImageSpec +#endif +#ifndef MUIA_Imageadjust_Type +#define MUIA_Imageadjust_Type 0x80422f2b // V11 i.. LONG +#endif +#ifndef MUIA_Prop_Release +#define MUIA_Prop_Release 0x80429839 +#endif +#ifndef MUIA_Prop_DeltaFactor +#define MUIA_Prop_DeltaFactor 0x80427C5E +#endif +#ifndef MUIA_Prop_DoSmooth +#define MUIA_Prop_DoSmooth 0x804236ce // V4 i.. LONG +#endif +#ifndef MUIM_GoActive +#define MUIM_GoActive 0x8042491a +#endif +#ifndef MUIM_GoInactive +#define MUIM_GoInactive 0x80422c0c +#endif +#ifndef MUIA_Group_Type +#define MUIA_Group_Type 0x8042e866 /* V11 ..g LONG */ +#endif +#ifndef MUIV_Group_Type_Horiz +#define MUIV_Group_Type_Horiz 1 +#endif +#ifndef MUIM_Mccprefs_RegisterGadget +#define MUIM_Mccprefs_RegisterGadget 0x80424828 // V20 +#endif +#ifndef MBQ_MUI_MAXMAX +#define MBQ_MUI_MAXMAX (10000) /* use this for unlimited MaxWidth/Height */ +#endif +#ifndef PopframeObject +#define PopframeObject MUI_NewObject(MUIC_Popframe +#endif +#ifndef PopimageObject +#define PopimageObject MUI_NewObject("Popimage.mui" +#endif +#ifndef CrawlingObject +#define CrawlingObject MUI_NewObject("Crawling.mcc" +#endif +#ifndef MUIM_CreateDragImage +#define MUIM_CreateDragImage 0x8042eb6f /* V18 */ /* Custom Class */ +#endif +#ifndef MUIM_DeleteDragImage +#define MUIM_DeleteDragImage 0x80423037 /* V18 */ /* Custom Class */ +#endif +#ifndef MUIA_List_Prop_First +#define MUIA_List_Prop_First 0x80429df3 /* V? ??? */ +#endif +#ifndef MUIA_List_Prop_Entries +#define MUIA_List_Prop_Entries 0x8042a8f5 /* V? ??? */ +#endif +#ifndef MUIA_List_Prop_Visible +#define MUIA_List_Prop_Visible 0x804273e9 /* V? ??? */ +#endif +#ifndef MUIA_Prop_TrueFirst +#define MUIA_Prop_TrueFirst 0x804205dc /* V16 ..g LONG */ +#endif +#ifndef MADF_DRAWACTIVE +#define MADF_DRAWACTIVE (1<< 2) +#endif +#ifndef MADF_DRAWOUTER +#define MADF_DRAWOUTER (1<<11) +#endif +#ifndef MADF_VISIBLE +#define MADF_VISIBLE (1<<14) // The object is visible +#endif +#ifndef MADF_DRAWALL +#define MADF_DRAWALL (MADF_DRAWACTIVE | MADF_DRAWOUTER | MADF_DRAWOBJECT) +#endif +#ifndef MUIA_Group_Forward +#define MUIA_Group_Forward 0x80421422 +#endif + +struct MUI_ImageSpec +{ + char buf[64]; +}; + +#if !defined(__AROS__) +struct MUI_FrameSpec +{ + char buf[8]; +}; + +struct MUIP_DeleteDragImage { ULONG MethodID; struct MUI_DragImage *di; }; /* Custom Class */ +struct MUIP_CreateDragImage { ULONG MethodID; LONG touchx; LONG touchy; ULONG flags; }; /* Custom Class */ +#endif diff --git a/workbench/classes/zune/nlist/include/newmouse.h b/workbench/classes/zune/nlist/include/newmouse.h new file mode 100755 index 0000000000..59845b20a3 --- /dev/null +++ b/workbench/classes/zune/nlist/include/newmouse.h @@ -0,0 +1,37 @@ +/* + * Include file for the NewMouse standard way of handling wheeled mice. + * + * Copyright (c) 1999 by Alessandro Zumo. All Rights Reserved. +*/ + +#ifndef NEWMOUSE_H +#define NEWMOUSE_H + +#ifndef IECLASS_NEWMOUSE +#define IECLASS_NEWMOUSE (0x16) /* IECLASS_MAX + 1 as of V40 */ +#endif + +/* These are issued both under IECLASS_NEWMOUSE and IECLASS_RAWKEY */ +/* by the NewMouse driver */ + +#ifndef NM_WHEEL_UP +#define NM_WHEEL_UP (0x7A) +#endif + +#ifndef NM_WHEEL_DOWN +#define NM_WHEEL_DOWN (0x7B) +#endif + +#ifndef NM_WHEEL_LEFT +#define NM_WHEEL_LEFT (0x7C) +#endif + +#ifndef NM_WHEEL_RIGHT +#define NM_WHEEL_RIGHT (0x7D) +#endif + +#ifndef NM_BUTTON_FOURTH +#define NM_BUTTON_FOURTH (0x7E) +#endif + +#endif /* NEWMOUSE_H */ diff --git a/workbench/classes/zune/nlist/include/proto/mccclass.h b/workbench/classes/zune/nlist/include/proto/mccclass.h new file mode 100644 index 0000000000..f53ffd398f --- /dev/null +++ b/workbench/classes/zune/nlist/include/proto/mccclass.h @@ -0,0 +1,62 @@ +#ifndef PROTO_MCCCLASS_H +#define PROTO_MCCCLASS_H + +/* +** $Id$ +** Includes Release 50.1 +** +** Prototype/inline/pragma header file combo +** +** (C) Copyright 2003-2004 Amiga, Inc. +** All Rights Reserved +*/ + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +/****************************************************************************/ + +#ifndef __NOLIBBASE__ +//extern struct Library * MCCClassBase; +#endif /* __NOLIBBASE__ */ + +/****************************************************************************/ + +#ifdef __amigaos4__ + #include <interfaces/mccclass.h> + #ifdef __USE_INLINE__ + #include <inline4/mccclass.h> + #endif /* __USE_INLINE__ */ + #ifndef CLIB_MCCCLASS_PROTOS_H + #define CLIB_MCCCLASS_PROTOS_H 1 + #endif /* CLIB_MCCCLASS_PROTOS_H */ + #ifndef __NOGLOBALIFACE__ +// extern struct MCCClassIFace *IMCCClass; + #endif /* __NOGLOBALIFACE__ */ +#else /* __amigaos4__ */ + #ifndef CLIB_MCCCLASS_PROTOS_H + #include <clib/mccclass_protos.h> + #endif /* CLIB_MCCCLASS_PROTOS_H */ + #if defined(__GNUC__) + #ifdef __AROS__ + #include <defines/muimaster.h> + #else + #ifndef __PPC__ + #include <inline/mccclass.h> + #else + #include <ppcinline/mccclass.h> + #endif /* __PPC__ */ + #endif /* __AROS__ */ + #elif defined(__VBCC__) + #ifndef __PPC__ + #include <inline/mccclass_protos.h> + #endif /* __PPC__ */ + #else + #include <pragmas/mccclass_pragmas.h> + #endif /* __GNUC__ */ +#endif /* __amigaos4__ */ + +/****************************************************************************/ + +#endif /* PROTO_MCCCLASS_H */ diff --git a/workbench/classes/zune/nlist/include/proto/muimaster.h b/workbench/classes/zune/nlist/include/proto/muimaster.h new file mode 100644 index 0000000000..7bd828e37b --- /dev/null +++ b/workbench/classes/zune/nlist/include/proto/muimaster.h @@ -0,0 +1,78 @@ +#ifndef PROTO_MUIMASTER_H +#define PROTO_MUIMASTER_H + +/*************************************************************************** + + Magic User Interface - MUI + Copyright (C) 1992-2008 by Stefan Stuntz <stefan@stuntz.com> + All Rights Reserved. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + IN NO EVENT WILL THE AUTHORS BE LIABLE FOR DIRECT, INDIRECT, INCIDENTAL, + OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY CLAIM ARISING OUT OF THE + INFORMATION PRESENTED HEREIN, EVEN IF IT HAS BEEN ADVISED OF THE + POSSIBILITIES OF SUCH DAMAGES. + +***************************************************************************/ + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif +#ifndef INTUITION_CLASSES_H +#include <intuition/classes.h> +#endif +#ifndef UTILITY_TAGITEM_H +#include <utility/tagitem.h> +#endif +#ifndef LIBRARIES_MUI_H +#include <libraries/mui.h> +#endif + +/****************************************************************************/ + +#ifndef __NOLIBBASE__ +extern struct Library * MUIMasterBase; +#endif /* __NOLIBBASE__ */ + +/****************************************************************************/ + +#ifdef __amigaos4__ + #include <interfaces/muimaster.h> + #ifdef __USE_INLINE__ + #include <inline4/muimaster.h> + #endif /* __USE_INLINE__ */ + #ifndef CLIB_MUIMASTER_PROTOS_H + #define CLIB_MUIMASTER_PROTOS_H 1 + #endif /* CLIB_MUIMASTER_PROTOS_H */ + #ifndef __NOGLOBALIFACE__ + extern struct MUIMasterIFace *IMUIMaster; + #endif /* __NOGLOBALIFACE__ */ +#else /* __amigaos4__ */ + #ifndef CLIB_MUIMASTER_PROTOS_H + #include <clib/muimaster_protos.h> + #endif /* CLIB_MUIMASTER_PROTOS_H */ + #if defined(__GNUC__) + #ifdef __AROS__ + #include <defines/muimaster.h> + #else + #ifndef __PPC__ + #include <inline/muimaster.h> + #else + #include <ppcinline/muimaster.h> + #endif /* __PPC__ */ + #endif /* __AROS__ */ + #elif defined(__VBCC__) + #ifndef __PPC__ + #include <inline/muimaster_protos.h> + #endif /* __PPC__ */ + #else + #include <pragmas/muimaster_pragmas.h> + #endif /* __GNUC__ */ +#endif /* __amigaos4__ */ + +/****************************************************************************/ + +#endif /* PROTO_MUIMASTER_H */ diff --git a/workbench/classes/zune/nlist/include/timeval.h b/workbench/classes/zune/nlist/include/timeval.h new file mode 100755 index 0000000000..35ab3aa6b2 --- /dev/null +++ b/workbench/classes/zune/nlist/include/timeval.h @@ -0,0 +1,58 @@ +#ifndef TIMEVAL_H +#define TIMEVAL_H 1 + +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +// since the Amiga's timeval structure was renamed to +// "struct TimeVal" in OS4 (to prevent clashes with the POSIX one) +// we require to define that slightly compatible structure on our +// own in case we compile YAM for something else than OS4 or in case +// an older SDK is used. +#if !defined(__amigaos4__) || !defined(__NEW_TIMEVAL_DEFINITION_USED__) +#include <exec/io.h> + + +struct TimeVal +{ + ULONG Seconds; + ULONG Microseconds; +}; + +struct TimeRequest +{ + struct IORequest Request; + struct TimeVal Time; +}; + +#define TIMEVAL(x) (APTR)(x) + +#else + +#define TIMEVAL(x) (x) + +#endif + +#endif /* TIMEVAL_H */ diff --git a/workbench/classes/zune/nlist/mmakefile.src b/workbench/classes/zune/nlist/mmakefile.src new file mode 100644 index 0000000000..adce6d4cd0 --- /dev/null +++ b/workbench/classes/zune/nlist/mmakefile.src @@ -0,0 +1,21 @@ +# $Id$ +include $(TOP)/config/make.cfg + +#MM- contrib-zune-classes : contrib-zune-classes-nlist + +#MM- contrib-zune-classes-nlist-demos : \ +#MM contrib-zune-classes-nlist-demo \ +#MM contrib-zune-classes-nlisttree-demo \ +#MM contrib-zune-classes-nbitmap-demo + +#MM- contrib-zune-classes-nlist : \ +#MM contrib-zune-classes-nlist-class \ +#MM contrib-zune-classes-nlistview-class \ +#MM contrib-zune-classes-nfloattext-class \ +#MM contrib-zune-classes-nlisttree-class \ +#MM contrib-zune-classes-nbitmap-class \ +#MM contrib-zune-classes-nbalance-class \ +#MM contrib-zune-classes-nlistviews-mcp \ +#MM contrib-zune-classes-nlisttree-mcp \ +#MM contrib-zune-classes-nlist-demos + diff --git a/workbench/classes/zune/nlist/nbalance_mcc/Debug.c b/workbench/classes/zune/nlist/nbalance_mcc/Debug.c new file mode 100644 index 0000000000..85a9c6f9f2 --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/Debug.c @@ -0,0 +1,413 @@ +/*************************************************************************** + + NBalance.mcc - New Balance MUI Custom Class + Copyright (C) 2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifdef DEBUG + +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> +#include <stdio.h> + +#include <proto/intuition.h> +#include <proto/utility.h> +#include <proto/dos.h> +#include <proto/exec.h> + +#include "SDI_compiler.h" +#include "Debug.h" +#include "version.h" + +// special flagging macros +#define isFlagSet(v,f) (((v) & (f)) == (f)) // return TRUE if the flag is set +#define hasFlag(v,f) (((v) & (f)) != 0) // return TRUE if one of the flags in f is set in v +#define isFlagClear(v,f) (((v) & (f)) == 0) // return TRUE if flag f is not set in v +#define SET_FLAG(v,f) ((v) |= (f)) // set the flag f in v +#define CLEAR_FLAG(v,f) ((v) &= ~(f)) // clear the flag f in v +#define MASK_FLAG(v,f) ((v) &= (f)) // mask the variable v with flag f bitwise + +// our static variables with default values +static int indent_level = 0; +static BOOL ansi_output = FALSE; +static ULONG debug_flags = DBF_ALWAYS | DBF_STARTUP; // default debug flags +static ULONG debug_classes = DBC_ERROR | DBC_DEBUG | DBC_WARNING | DBC_ASSERT | DBC_REPORT; // default debug classes + +/****************************************************************************/ + +void SetupDebug(void) +{ + char var[256]; + + kprintf("** NBalance.mcc v" LIB_REV_STRING " startup ***********************\n"); + kprintf("Initializing runtime debugging:\n"); + + if(GetVar("nbalance.mcc.debug", var, sizeof(var), 0) > 0) + { + char *tok; + char *debug = var; + + // static list of our debugging classes tokens. + // in the yamdebug variable these classes always start with a @ + static struct { const char *token; unsigned long flag; } dbclasses[] = + { + { "ctrace", DBC_CTRACE }, + { "report", DBC_REPORT }, + { "assert", DBC_ASSERT }, + { "timeval", DBC_TIMEVAL }, + { "debug", DBC_DEBUG }, + { "error", DBC_ERROR }, + { "warning", DBC_WARNING }, + { "all", DBC_ALL }, + { NULL, 0 } + }; + + static struct { const char *token; unsigned long flag; } dbflags[] = + { + { "always", DBF_ALWAYS }, + { "startup", DBF_STARTUP }, + { "input", DBF_INPUT }, + { "all", DBF_ALL }, + { NULL, 0 } + }; + + // we parse the env variable token-wise + while((tok = strtok(debug, ", ;")) != NULL) + { + ULONG i; + + // check if the token is class definition or + // just a flag definition + if(tok[0] == '@') + { + // check if this call is a negation or not + if(tok[1] == '!') + { + // search for the token and clear the flag + for(i = 0; dbclasses[i].token != NULL; i++) + { + if(stricmp(tok + 2, dbclasses[i].token) == 0) + { + kprintf("clear '%s' debug class flag.\n", dbclasses[i].token); + CLEAR_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + else + { + // search for the token and set the flag + for(i = 0; dbclasses[i].token != NULL; i++) + { + if(stricmp(tok + 1, dbclasses[i].token) == 0) + { + kprintf("set '%s' debug class flag\n", dbclasses[i].token); + SET_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + } + else + { + // check if this call is a negation or not + if(tok[0] == '!') + { + for(i = 0; dbflags[i].token != NULL; i++) + { + if(stricmp(tok + 1, dbflags[i].token) == 0) + { + kprintf("clear '%s' debug flag\n", dbflags[i].token); + CLEAR_FLAG(debug_flags, dbflags[i].flag); + } + } + } + else + { + // check if the token was "ansi" and if so enable the ANSI color + // output + if(stricmp(tok, "ansi") == 0) + { + kprintf("ansi output enabled\n"); + ansi_output = TRUE; + } + else + { + for(i = 0; dbflags[i].token != NULL; i++) + { + if(stricmp(tok, dbflags[i].token) == 0) + { + kprintf("set '%s' debug flag\n", dbflags[i].token); + SET_FLAG(debug_flags, dbflags[i].flag); + } + } + } + } + } + + debug = NULL; + } + } + + kprintf("set debug classes/flags (env:nbalance.mcc.debug): %08lx/%08lx\n", debug_classes, debug_flags); + kprintf("** Normal processing follows ***************************************\n"); +} + +/****************************************************************************/ + +void CleanupDebug(void) +{ + kprintf("** Cleaned up debugging ********************************************\n"); +} + +/****************************************************************************/ + +// define variables for using ANSI colors in our debugging scheme +#define ANSI_ESC_CLR "\033[0m" +#define ANSI_ESC_BOLD "\033[1m" +#define ANSI_ESC_UNDERLINE "\033[4m" +#define ANSI_ESC_BLINK "\033[5m" +#define ANSI_ESC_REVERSE "\033[7m" +#define ANSI_ESC_INVISIBLE "\033[8m" +#define ANSI_ESC_FG_BLACK "\033[0;30m" +#define ANSI_ESC_FG_RED "\033[0;31m" +#define ANSI_ESC_FG_GREEN "\033[0;32m" +#define ANSI_ESC_FG_BROWN "\033[0;33m" +#define ANSI_ESC_FG_BLUE "\033[0;34m" +#define ANSI_ESC_FG_PURPLE "\033[0;35m" +#define ANSI_ESC_FG_CYAN "\033[0;36m" +#define ANSI_ESC_FG_LGRAY "\033[0;37m" +#define ANSI_ESC_FG_DGRAY "\033[1;30m" +#define ANSI_ESC_FG_LRED "\033[1;31m" +#define ANSI_ESC_FG_LGREEN "\033[1;32m" +#define ANSI_ESC_FG_YELLOW "\033[1;33m" +#define ANSI_ESC_FG_LBLUE "\033[1;34m" +#define ANSI_ESC_FG_LPURPLE "\033[1;35m" +#define ANSI_ESC_FG_LCYAN "\033[1;36m" +#define ANSI_ESC_FG_WHITE "\033[1;37m" +#define ANSI_ESC_BG "\033[0;4" // background esc-squ start with 4x +#define ANSI_ESC_BG_BLACK "\033[0;40m" +#define ANSI_ESC_BG_RED "\033[0;41m" +#define ANSI_ESC_BG_GREEN "\033[0;42m" +#define ANSI_ESC_BG_BROWN "\033[0;43m" +#define ANSI_ESC_BG_BLUE "\033[0;44m" +#define ANSI_ESC_BG_PURPLE "\033[0;45m" +#define ANSI_ESC_BG_CYAN "\033[0;46m" +#define ANSI_ESC_BG_LGRAY "\033[0;47m" + +/****************************************************************************/ + +INLINE void _INDENT(void) +{ + int i; + + for(i = 0; i < indent_level; i++) + kprintf(" "); +} + +/****************************************************************************/ + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function) +{ + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Entering %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Entering %s\n", file, line, function); + } + + indent_level++; +} + +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function) +{ + if(indent_level > 0) + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s\n", file, line, function); + } +} + +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result) +{ + if(indent_level > 0) + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s (result 0x%08lx, %ld)%s\n", ANSI_ESC_FG_BROWN, file, line, function, result, result, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s (result 0x%08lx, %ld)\n", file, line, function, result, result); + } +} + +/****************************************************************************/ + +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + switch(size) + { + case 1: + fmt = "%s:%ld:%s = %ld, 0x%02lx"; + break; + + case 2: + fmt = "%s:%ld:%s = %ld, 0x%04lx"; + break; + + default: + fmt = "%s:%ld:%s = %ld, 0x%08lx"; + break; + } + + _INDENT(); + + if(ansi_output) + kprintf(ANSI_ESC_FG_GREEN); + + kprintf(fmt, file, line, name, value, value); + + if(size == 1 && value < 256) + { + if(value < ' ' || (value >= 127 && value < 160)) + kprintf(", '\\x%02lx'", value); + else + kprintf(", '%lc'", value); + } + + if(ansi_output) + kprintf("%s\n", ANSI_ESC_CLR); + else + kprintf("\n"); + } +} + +/****************************************************************************/ + +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + _INDENT(); + + if(p != NULL) + fmt = "%s:%ld:%s = 0x%08lx\n"; + else + fmt = "%s:%ld:%s = NULL\n"; + + if(ansi_output) + { + kprintf(ANSI_ESC_FG_GREEN); + kprintf(fmt, file, line, name, p); + kprintf(ANSI_ESC_CLR); + } + else + kprintf(fmt, file, line, name, p); + } +} + +/****************************************************************************/ + +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s = 0x%08lx \"%s\"%s\n", ANSI_ESC_FG_GREEN, file, line, name, string, string, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s = 0x%08lx \"%s\"\n", file, line, name, string, string); + } +} + +/****************************************************************************/ + +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s%s\n", ANSI_ESC_FG_GREEN, file, line, msg, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s\n", file, line, msg); + } +} + +/****************************************************************************/ + +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...) +{ + if((isFlagSet(debug_classes, dclass) && isFlagSet(debug_flags, dflags)) || + (isFlagSet(dclass, DBC_ERROR) || isFlagSet(dclass, DBC_WARNING))) + { + va_list args; + static char buf[1024]; + + _INDENT(); + + va_start(args, format); + vsnprintf(buf, 1024, format, args); + va_end(args); + + if(ansi_output) + { + const char *highlight = ANSI_ESC_FG_GREEN; + + switch(dclass) + { + case DBC_CTRACE: highlight = ANSI_ESC_FG_BROWN; break; + case DBC_REPORT: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ASSERT: highlight = ANSI_ESC_FG_RED; break; + case DBC_TIMEVAL: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_DEBUG: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ERROR: highlight = ANSI_ESC_FG_RED; break; + case DBC_WARNING: highlight = ANSI_ESC_FG_PURPLE;break; + } + + kprintf("%s%s:%ld:%s%s\n", highlight, file, line, buf, ANSI_ESC_CLR); + } + else + kprintf("%s:%ld:%s\n", file, line, buf); + } +} + +/****************************************************************************/ + +#endif diff --git a/workbench/classes/zune/nlist/nbalance_mcc/Debug.h b/workbench/classes/zune/nlist/nbalance_mcc/Debug.h new file mode 100644 index 0000000000..70e7c21bf5 --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/Debug.h @@ -0,0 +1,139 @@ +/*************************************************************************** + + NBalance.mcc - New Balance MUI Custom Class + Copyright (C) 2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef DEBUG_H +#define DEBUG_H + +// first we make sure all previously defined symbols are undefined now so +// that no other debug system interferes with ours. +#undef ENTER +#undef LEAVE +#undef RETURN +#undef SHOWVALUE +#undef SHOWPOINTER +#undef SHOWSTRING +#undef SHOWMSG +#undef STARTCLOCK +#undef STOPCLOCK +#undef D +#undef E +#undef W +#undef ASSERT + +#if defined(DEBUG) + +#include <assert.h> + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +#if defined(__amigaos4__) + #include <proto/exec.h> + #ifdef __USE_INLINE__ + #ifdef DebugPrintF + #undef DebugPrintF + #endif + #endif + #ifndef kprintf + #define kprintf(format, args...) ((struct ExecIFace *)((*(struct ExecBase **)4)->MainInterface))->DebugPrintF(format, ## args) + #endif +#elif defined(__MORPHOS__) + #include <exec/rawfmt.h> + #include <proto/exec.h> + #define KPutFmt(format, args) VNewRawDoFmt(format, (APTR)RAWFMTFUNC_SERIAL, NULL, args) +void kprintf(const char *formatString,...); +#else +void kprintf(const char *formatString,...); +#endif + +// debug classes +#define DBC_CTRACE (1<<0) // call tracing (ENTER/LEAVE etc.) +#define DBC_REPORT (1<<1) // reports (SHOWVALUE/SHOWSTRING etc.) +#define DBC_ASSERT (1<<2) // asserts (ASSERT) +#define DBC_TIMEVAL (1<<3) // time evaluations (STARTCLOCK/STOPCLOCK) +#define DBC_DEBUG (1<<4) // debugging output D() +#define DBC_ERROR (1<<5) // error output E() +#define DBC_WARNING (1<<6) // warning output W() +#define DBC_ALL 0xffffffff + +// debug flags +#define DBF_ALWAYS (1<<0) +#define DBF_STARTUP (1<<1) // for startup/shutdown events +#define DBF_INPUT (1<<2) +#define DBF_ALL 0xffffffff + +void SetupDebug(void); +void CleanupDebug(void); + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function); +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function); +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result); +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line); +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line); +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line); +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line); +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...); + +// Core class information class messages +#define ENTER() _ENTER(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define LEAVE() _LEAVE(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define RETURN(r) _RETURN(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__, (long)r) +#define SHOWVALUE(f, v) _SHOWVALUE(DBC_REPORT, f, (long)v, sizeof(v), #v, __FILE__, __LINE__) +#define SHOWPOINTER(f, p) _SHOWPOINTER(DBC_REPORT, f, p, #p, __FILE__, __LINE__) +#define SHOWSTRING(f, s) _SHOWSTRING(DBC_REPORT, f, s, #s, __FILE__, __LINE__) +#define SHOWMSG(f, m) _SHOWMSG(DBC_REPORT, f, m, __FILE__, __LINE__) +#define D(f, s, vargs...) _DPRINTF(DBC_DEBUG, f, __FILE__, __LINE__, s, ## vargs) +#define E(f, s, vargs...) _DPRINTF(DBC_ERROR, f, __FILE__, __LINE__, s, ## vargs) +#define W(f, s, vargs...) _DPRINTF(DBC_WARNING, f, __FILE__, __LINE__, s, ## vargs) +#define ASSERT(expression) \ + ((void) \ + ((expression) ? 0 : \ + ( \ + _DPRINTF(DBC_ASSERT, \ + DBF_ALWAYS, \ + __FILE__, \ + __LINE__, \ + "failed assertion '%s'", \ + #expression), \ + assert(#expression), \ + 0 \ + ) \ + ) \ + ) + +#else // DEBUG + +#define ENTER() ((void)0) +#define LEAVE() ((void)0) +#define RETURN(r) ((void)0) +#define SHOWVALUE(f, v) ((void)0) +#define SHOWPOINTER(f, p) ((void)0) +#define SHOWSTRING(f, s) ((void)0) +#define SHOWMSG(f, m) ((void)0) +#define D(f, s, vargs...) ((void)0) +#define E(f, s, vargs...) ((void)0) +#define W(f, s, vargs...) ((void)0) +#define ASSERT(expression) ((void)0) + +#endif // DEBUG + +#endif // DEBUG_H diff --git a/workbench/classes/zune/nlist/nbalance_mcc/Dispatcher.c b/workbench/classes/zune/nlist/nbalance_mcc/Dispatcher.c new file mode 100644 index 0000000000..1ab919ae0a --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/Dispatcher.c @@ -0,0 +1,83 @@ +/*************************************************************************** + + NBalance.mcc - New Balance MUI Custom Class + Copyright (C) 2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/* ansi includes */ +#include <string.h> + +/* system includes */ +#include <clib/alib_protos.h> +#include <proto/exec.h> +#include <proto/intuition.h> +#include <proto/muimaster.h> +#include <proto/graphics.h> +#include <proto/utility.h> +#include <proto/locale.h> + +/* local includes */ +#include "NBalance.h" +#include "private.h" +#include "Debug.h" + +DISPATCHER(_Dispatcher) +{ + IPTR result; + + ENTER(); + + switch(msg->MethodID) + { + case OM_NEW: + result = mNew(cl, obj, (struct opSet *)msg); + break; + + case OM_SET: + result = mSet(cl, obj, msg); + break; + + case OM_GET: + result = mGet(cl, obj, msg); + break; + + case MUIM_Setup: + result = mSetup(cl, obj, (struct MUI_RenderInfo *)msg); + break; + + case MUIM_Cleanup: + result = mCleanup(cl, obj, msg); + break; + + case MUIM_Hide: + result = mHide(cl, obj, msg); + break; + + case MUIM_HandleEvent: + result = mHandleEvent(cl, obj, (struct MUIP_HandleEvent *)msg); + break; + + default: + result = DoSuperMethodA(cl, obj, msg); + break; + } + + RETURN(result); + return result; +} + diff --git a/workbench/classes/zune/nlist/nbalance_mcc/Makefile b/workbench/classes/zune/nlist/nbalance_mcc/Makefile new file mode 100644 index 0000000000..e92750d50e --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/Makefile @@ -0,0 +1,425 @@ +#/*************************************************************************** +# +# NBalance.mcc - New Balance MUI Custom Class +# Copyright (C) 2008-2009 by NList Open Source Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# NList classes Support Site: http://www.sf.net/projects/nlist-classes +# +# $Id$ +# +#***************************************************************************/ + +########################################################################### +# This makefile is a very generic one. It tries to identify both, the host +# and the target operating system for which YAM should be compiled. +# However, this auto-detection can be easily overridden by directly +# specifying an option on the commandline while calling 'make'. +# +# Example: +# +# # to explicitly compile for AmigaOS3 +# > make OS=os3 +# +# # to compile for AmigaOS4 but with debugging +# > make OS=os4 DEBUG= +# + +############################################# +# find out the HOST operating system +# on which this makefile is run +HOST ?= $(shell uname) +ifeq ($(HOST), AmigaOS) + ifeq ($(shell uname -m), powerpc) + HOST = AmigaOS4 + endif + ifeq ($(shell uname -m), ppc) + HOST = AmigaOS4 + endif +endif + +# if no host is identifed (no uname tool) +# we assume a AmigaOS build +ifeq ($(HOST),) + HOST = AmigaOS +endif + +############################################# +# now we find out the target OS for +# which we are going to compile YAM in case +# the caller didn't yet define OS himself +ifndef (OS) + ifeq ($(HOST), AmigaOS4) + OS = os4 + else + ifeq ($(HOST), AmigaOS) + OS = os3 + else + ifeq ($(HOST), MorphOS) + OS = mos + else + ifeq ($(HOST), AROS) + # now we find out which CPU system aros will be used + ifeq ($(shell uname -m), powerpc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), ppc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), i386) + OS = aros-i386 + endif + ifeq ($(shell uname -m), i686) + OS = aros-i686 + endif + ifeq ($(shell uname -m), x86_64) + OS = aros-x86_64 + endif + else + OS = os4 + endif + endif + endif + endif +endif + +############################################# +# define common commands we use in this +# makefile. Please note that each of them +# might be overridden on the commandline. + +# common commands +FLEX = flex +FC = flexcat +EXPR = expr +DATE = date +RM = delete force +RMDIR = delete force all +MKDIR = makedir +CHMOD = protect FLAGS=rwed +SED = sed +CP = copy +CC = gcc +STRIP = strip +OBJDUMP = objdump + +# path definitions +CDUP = / +CDTHIS= + +# override some variables for non-native builds (cross-compiler) +ifneq ($(HOST), AmigaOS) +ifneq ($(HOST), AmigaOS4) +ifneq ($(HOST), MorphOS) + + # when we end up here this is either a unix or Aros host + # so lets use unix kind of commands + RM = rm -f + RMDIR = rm -rf + MKDIR = mkdir -p + CHMOD = chmod 755 + CP = cp -f + + CDUP = ../ + CDTHIS= ./ + +endif +endif +endif + +########################################################################### +# CPU and DEBUG can be defined outside, defaults to above +# using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug +# PPC-603e version +# +# OPTFLAGS are disabled by DEBUG normally! +# +# ignored warnings are: +# none - because we want to compile with -Wall all the time + +# Common Directories +PREFIX = $(CDTHIS) +OBJDIR = .obj_$(OS) +BINDIR = bin_$(OS) +VPATH = $(OBJDIR) +DEPFILE = Makefile.dep +DESTDIR = MUI:Libs/MUI + +# target definition +TARGET = $(BINDIR)/NBalance.mcc +TESTTARGET= $(BINDIR)/NBalance-Test + +# Common compiler/linker flags +WARN = -W -Wall -Wwrite-strings -Wpointer-arith -Wsign-compare +OPTFLAGS = -O3 -fomit-frame-pointer -funroll-loops +DEBUG = -DDEBUG -O0 +DEBUGSYM = -g -gstabs +CFLAGS = -I. -I../include $(CPU) $(WARN) $(OPTFLAGS) \ + $(DEBUG) $(DEBUGSYM) $(USER_CFLAGS) -c +LDFLAGS = $(CPU) $(DEBUGSYM) +LDLIBS = + +########################################################################### +# object files definition +# + +LOBJS = library.o + +COBJS = Dispatcher.o \ + NBalance.o \ + Pointer.o \ + Debug.o + +TOBJS = NBalance-Test.o + +MCCOBJS = $(addprefix $(OBJDIR)/,$(LOBJS)) $(addprefix $(OBJDIR)/,$(COBJS)) +TESTOBJS = $(addprefix $(OBJDIR)/,$(COBJS)) $(addprefix $(OBJDIR)/,$(TOBJS)) + +# different options per target OS +ifeq ($(OS), os4) + + ############################## + # AmigaOS4 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS4) + CC = ppc-amigaos-gcc + STRIP = ppc-amigaos-strip + OBJDUMP = ppc-amigaos-objdump + endif + + # Compiler/Linker flags + CRT = newlib + CPU = -mcpu=powerpc + WARN += -Wdeclaration-after-statement -Wdisabled-optimization + CFLAGS += -mcrt=$(CRT) -D__USE_INLINE__ -D__NEW_TIMEVAL_DEFINITION_USED__ \ + -DNO_PPCINLINE_STDARG -Wa,-mregnames + LDFLAGS += -mcrt=$(CRT) + + # additional object files required + M68KSTUBS = $(OBJDIR)/mccclass_68k.o + +else +ifeq ($(OS), os3) + + ############################## + # AmigaOS3 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS) + CC = m68k-amigaos-gcc + STRIP = m68k-amigaos-strip + OBJDUMP = m68k-amigaos-objdump + endif + + # Compiler/Linker flags + CPU = -m68020-60 -msoft-float + CFLAGS += -noixemul -DNO_INLINE_STDARG -D__amigaos3__ + LDFLAGS += -noixemul + LDLIBS += -ldebug -lmui + + # additional object files required + COBJS += vastubs.o + +else +ifeq ($(OS), mos) + + ############################## + # MorphOS + + # Compiler/link/strip commands + ifneq ($(HOST), MorphOS) + CC = ppc-morphos-gcc + STRIP = ppc-morphos-strip + OBJDUMP = ppc-morphos-objdump + endif + + # Compiler/Linker flags + CPU = -mcpu=powerpc + CFLAGS += -noixemul -DNO_PPCINLINE_STDARG + LDFLAGS += -noixemul + LDLIBS += -ldebug + +else +ifeq ($(OS), aros-i386) + + ############################## + # AROS (i386) + + ifneq ($(HOST), AROS) + CC = i386-aros-gcc + STRIP = i386-aros-strip + OBJDUMP = i386-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-ppc) + + ############################## + # AROS (PPC) + + ifneq ($(HOST), AROS) + CC = ppc-aros-gcc + STRIP = ppc-aros-strip + OBJDUMP = ppc-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-x86_64) + + ############################## + # AROS (x86_64) + + ifneq ($(HOST), AROS) + CC = x86_64-aros-gcc + STRIP = x86_64-aros-strip + OBJDUMP = x86_64-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +endif +endif +endif +endif +endif +endif + +# main target +.PHONY: all +ifeq ($(wildcard $(DEPFILE)),$(DEPFILE)) +# great, we have a dependecies file, let's make our target +all: $(BINDIR) $(OBJDIR) $(M68KSTUBS) $(TARGET) $(TESTTARGET) +else +# no dependecies, create it and then call make again +all: depend + @make --no-print-directory all +endif + +# for making a release we compile ALL target with no debug +release: + @echo " CC $<" + make OS=os4 clean + make OS=os4 DEBUG= + @echo " CC $<" + make OS=os3 clean + make OS=os3 DEBUG= + @echo " CC $<" + make OS=mos clean + make OS=mos DEBUG= + @echo " CC $<" + make OS=aros-i386 clean + make OS=aros-i386 DEBUG= + @echo " CC $<" + make OS=aros-ppc clean + make OS=aros-ppc DEBUG= + @echo " CC $<" + make OS=aros-x86_64 clean + make OS=aros-x86_64 DEBUG= + +# make the object directories +$(OBJDIR): + @echo " MK $@" + @$(MKDIR) $(OBJDIR) + +# make the binary directories +$(BINDIR): + @echo " MK $@" + @$(MKDIR) $(BINDIR) + +# for compiling single .c files +$(OBJDIR)/%.o: %.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +$(OBJDIR)/mccclass_68k.o: ../include/mccclass_68k.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +# for linking the target +$(TARGET): $(M68KSTUBS) $(MCCOBJS) + @echo " LD $@.debug" + @$(CC) -nostartfiles $(LDFLAGS) -o $@.debug $(MCCOBJS) $(M68KSTUBS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +# for linking the target +$(TESTTARGET): $(TESTOBJS) + @echo " LD $@.debug" + @$(CC) $(LDFLAGS) -o $@.debug $(TESTOBJS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +.PHONY: dump +dump: + -$(OBJDUMP) --section-headers --all-headers --reloc --disassemble-all $(TARGET) >$(TARGET).dump + +.PHONY: clean +clean: + -$(RM) $(TARGET) $(TARGET).debug $(TARGET).map + -$(RM) $(TESTTARGET) $(TESTTARGET).debug $(TESTTARGET).map + -$(RM) $(MCCOBJS) $(TESTOBJS) $(M68KSTUBS) + +.PHONY: distclean +distclean: clean + -$(RMDIR) $(OBJDIR) + -$(RMDIR) $(BINDIR) + +# install +.PHONY: install +install: all + @echo " IN $(TARGET)" + @$(CP) $(TARGET) $(DESTDIR) + +.PHONY: help +help: + @echo "Cleaning targets:" + @echo " clean - Cleanup working directory for clean compile" + @echo " distclean - Also cleanup autogenerated files" + @echo "" + @echo "Other generic targets:" + @echo " all - Build $(TARGET)" + @echo " catalogs - Build all available catalogs" + @echo "" + @echo "Install targets:" + @echo " install - Install $(TARGET) into $(DESTDIR)" + @echo "" + @echo "Parameters:" + @echo " make OS=os3|os4|mos|aros-i386|aros-i686|aros-ppc|aros-x86_64" + @echo " make DEBUG= : build $(TARGET) without debugging information" + @echo "" + +## DEPENDENCY GENERATION ############## + +.PHONY: depend +depend: + @echo " MK $(DEPFILE)" + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >$(DEPFILE) + @$(CC) -MM -MG $(CFLAGS) $(wildcard *.c) >>$(DEPFILE) + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >>$(DEPFILE) + @$(SED) -i 's,^\(.*\)\.o:,$$\(OBJDIR\)/\1.o:,g' $(DEPFILE) + +# include dependencies file +-include $(DEPFILE) diff --git a/workbench/classes/zune/nlist/nbalance_mcc/Makefile.dep b/workbench/classes/zune/nlist/nbalance_mcc/Makefile.dep new file mode 100644 index 0000000000..09497b99bb --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/Makefile.dep @@ -0,0 +1,30 @@ +# AUTOGENERATED! DO NOT EDIT!!! +$(OBJDIR)/Debug.o: Debug.c ../include/SDI_compiler.h Debug.h version.h +$(OBJDIR)/Dispatcher.o: Dispatcher.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h NBalance.h private.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h Debug.h Pointer.h +$(OBJDIR)/library.o: library.c Debug.h private.h ../include/libraries/mui.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h NBalance.h Pointer.h \ + version.h ../include/mccinit.c ../include/proto/muimaster.h \ + ../include/interfaces/muimaster.h ../include/inline4/muimaster.h +$(OBJDIR)/NBalance.o: NBalance.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h ../include/mui/NBalance_mcc.h NBalance.h \ + Pointer.h private.h ../include/mcc_common.h ../include/SDI_compiler.h \ + ../include/SDI_hook.h ../include/SDI_lib.h ../include/SDI_stdarg.h \ + Debug.h version.h ../include/muiextra.h +$(OBJDIR)/NBalance-Test.o: NBalance-Test.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h ../include/mui/NBalance_mcc.h private.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h Debug.h NBalance.h \ + Pointer.h +$(OBJDIR)/Pointer.o: Pointer.c ../include/libraries/mui.h private.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h Debug.h NBalance.h \ + Pointer.h ../include/muiextra.h +$(OBJDIR)/vastubs.o: vastubs.c +# AUTOGENERATED! DO NOT EDIT!!! diff --git a/workbench/classes/zune/nlist/nbalance_mcc/NBalance-Test.c b/workbench/classes/zune/nlist/nbalance_mcc/NBalance-Test.c new file mode 100644 index 0000000000..5c7c2c5820 --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/NBalance-Test.c @@ -0,0 +1,210 @@ +/*************************************************************************** + + NBalance.mcc - New Balance MUI Custom Class + Copyright (C) 2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + TextEditor class Support Site: http://www.sf.net/projects/texteditor-mcc + + $Id$ + +***************************************************************************/ + +#include <libraries/iffparse.h> + +#include <proto/exec.h> +#include <proto/dos.h> +#include <proto/intuition.h> +#include <proto/muimaster.h> +#include <proto/utility.h> +#include <proto/graphics.h> +#include <proto/layers.h> +#include <proto/datatypes.h> + +#include <mui/NBalance_mcc.h> + +#include "private.h" + +#if defined(__amigaos4__) +struct Library *IntuitionBase = NULL; +struct Library *UtilityBase = NULL; +struct Library *GfxBase = NULL; +struct Library *DataTypesBase = NULL; +struct Library *MUIMasterBase = NULL; +struct Library *LayersBase = NULL; +#else +struct IntuitionBase *IntuitionBase = NULL; +#if defined(__AROS__) +struct UtilityBase *UtilityBase = NULL; +#else +struct Library *UtilityBase = NULL; +#endif +struct GfxBase *GfxBase = NULL; +struct Library *DataTypesBase = NULL; +struct Library *MUIMasterBase = NULL; +struct Library *LayersBase = NULL; +#endif + +#if defined(__amigaos4__) +struct IntuitionIFace *IIntuition = NULL; +struct UtilityIFace *IUtility = NULL; +struct GraphicsIFace *IGraphics = NULL; +struct DataTypesIFace *IDataTypes = NULL; +struct MUIMasterIFace *IMUIMaster = NULL; +struct LayersIFace *ILayers = NULL; +#endif + +DISPATCHERPROTO(_Dispatcher); + +int main(void) +{ + if((IntuitionBase = (APTR)OpenLibrary("intuition.library", 36)) && + GETINTERFACE(IIntuition, IntuitionBase)) + { + #if defined(DEBUG) + SetupDebug(); + #endif + + if((UtilityBase = (APTR)OpenLibrary("utility.library", 36)) && + GETINTERFACE(IUtility, UtilityBase)) + { + if((GfxBase = (APTR)OpenLibrary("graphics.library", 36)) && + GETINTERFACE(IGraphics, GfxBase)) + { + if((LayersBase = OpenLibrary("layers.library", 37)) && + GETINTERFACE(ILayers, LayersBase)) + { + if((DataTypesBase = OpenLibrary("datatypes.library", 36)) && + GETINTERFACE(IDataTypes, DataTypesBase)) + { + if((MUIMasterBase = OpenLibrary("muimaster.library", 19)) && + GETINTERFACE(IMUIMaster, MUIMasterBase)) + { + struct MUI_CustomClass *mcc; + + mcc = MUI_CreateCustomClass(NULL, MUIC_Balance, NULL, sizeof(struct InstData), ENTRY(_Dispatcher)); + + if(mcc != NULL) + { + Object *app, *window; + const char * const classes[] = { "NBalance.mcp", NULL }; + + app = MUI_NewObject("Application.mui", + MUIA_Application_Author, "NBalance.mcc Open Source Team", + MUIA_Application_Base, "NBalance-Test", + MUIA_Application_Copyright, "(c) 2008 NBalance.mcc Open Source Team", + MUIA_Application_Description, "NBalance.mcc test program", + MUIA_Application_Title, "NBalance-Test", + MUIA_Application_Version, "$VER: NBalance-Test (" __DATE__ ")", + MUIA_Application_UsedClasses, classes, + + MUIA_Application_Window, + window = WindowObject, + MUIA_Window_Title, "NBalance-Test", + MUIA_Window_ID, MAKE_ID('M','A','I','N'), + MUIA_Window_RootObject, VGroup, + Child, HGroup, + Child, FloattextObject, + MUIA_Floattext_Text, "Left Top", + End, + Child, NewObject(mcc->mcc_Class, NULL, + //Child, BalanceObject, + MUIA_ObjectID, 1, + End, + Child, FloattextObject, + MUIA_Floattext_Text, "Right Top", + End, + End, + Child, NewObject(mcc->mcc_Class, NULL, + //Child, BalanceObject, + MUIA_ObjectID, 2, + //MUIA_NBalance_Pointer, MUIV_NBalance_Pointer_Off, + End, + Child, HGroup, + Child, FloattextObject, + MUIA_Floattext_Text, "Left Bottom", + End, + Child, NewObject(mcc->mcc_Class, NULL, + //Child, BalanceObject, + MUIA_ObjectID, 3, + End, + Child, FloattextObject, + MUIA_Floattext_Text, "Right Bottom", + End, + End, + End, + End, + End; + + if(app != NULL) + { + ULONG sigs = 0; + + DoMethod(window, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit); + + //set(window, MUIA_Window_ActiveObject, editorgad); + set(window, MUIA_Window_Open, TRUE); + + while((LONG)DoMethod(app, MUIM_Application_NewInput, &sigs) != (LONG)MUIV_Application_ReturnID_Quit) + { + if(sigs) + { + sigs = Wait(sigs | SIGBREAKF_CTRL_C); + + if(sigs & SIGBREAKF_CTRL_C) + break; + } + } + + MUI_DisposeObject(app); + } + else + PutStr("Failed to create application\n"); + + MUI_DeleteCustomClass(mcc); + } + + DROPINTERFACE(IDataTypes); + CloseLibrary(DataTypesBase); + DataTypesBase = NULL; + } + + DROPINTERFACE(ILayers); + CloseLibrary(LayersBase); + LayersBase = NULL; + } + + DROPINTERFACE(IGraphics); + CloseLibrary((struct Library *)GfxBase); + GfxBase = NULL; + } + + + DROPINTERFACE(IMUIMaster); + CloseLibrary(MUIMasterBase); + MUIMasterBase = NULL; + } + + DROPINTERFACE(IUtility); + CloseLibrary((struct Library *)UtilityBase); + UtilityBase = NULL; + } + } + + if(IntuitionBase) + { + DROPINTERFACE(IIntuition); + CloseLibrary((struct Library *)IntuitionBase); + } + + return 0; +} diff --git a/workbench/classes/zune/nlist/nbalance_mcc/NBalance.c b/workbench/classes/zune/nlist/nbalance_mcc/NBalance.c new file mode 100644 index 0000000000..203db061cc --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/NBalance.c @@ -0,0 +1,315 @@ +/*************************************************************************** + + NBalance.mcc - New Balance MUI Custom Class + Copyright (C) 2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +// ansi includes +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <math.h> + +// system +#include <proto/exec.h> +#include <proto/layers.h> +#include <proto/muimaster.h> +#include <proto/intuition.h> +#include <proto/utility.h> +#include <libraries/mui.h> +#include <mui/NBalance_mcc.h> + +// local includes +#include "NBalance.h" +#include "Pointer.h" +#include "private.h" +#include "version.h" +#include "Debug.h" +#include "muiextra.h" + +// functions + +// methods +IPTR mNew(struct IClass *cl, Object *obj, struct opSet *msg) +{ + BOOL result = FALSE; + ENTER(); + + if((obj = (Object *)DoSuperMethodA(cl, obj, (Msg)msg)) != NULL) + { + struct InstData *data; + + if((data = INST_DATA(cl, obj)) != NULL) + { + struct TagItem *tags = NULL; + struct TagItem *tag = NULL; + + // set some default values + data->pointerType = MUIV_NBalance_Pointer_Standard; + + for(tags=((struct opSet *)msg)->ops_AttrList;(tag = NextTagItem((APTR)&tags)); ) + { + switch(tag->ti_Tag) + { + case MUIA_NBalance_Pointer: + data->pointerType = tag->ti_Data; + break; + } + } + + result = TRUE; + } + } + + if(result == FALSE) + { + CoerceMethod(cl, obj, OM_DISPOSE); + obj = NULL; + } + + RETURN((IPTR)obj); + return (IPTR)obj; +} + +IPTR mGet(struct IClass *cl, Object *obj, Msg msg) +{ + IPTR result = FALSE; + IPTR *store = ((struct opGet *)msg)->opg_Storage; + struct InstData *data = INST_DATA(cl, obj); + + ENTER(); + + switch(((struct opGet *)msg)->opg_AttrID) + { + case MUIA_NBalance_Pointer: + *store = (LONG)data->pointerType; + result = TRUE; + break; + + case MUIA_Version: + *store = LIB_VERSION; + result = TRUE; + break; + + case MUIA_Revision: + *store = LIB_REVISION; + result = TRUE; + break; + } + + if(result == FALSE) + result = DoSuperMethodA(cl,obj,msg); + + RETURN(result); + return result; +} + +IPTR mSet(struct IClass *cl,Object *obj, Msg msg) +{ + struct InstData *data = INST_DATA(cl, obj); + struct TagItem *tags, *tag; + IPTR result = FALSE; + + ENTER(); + + for(tags=((struct opSet *)msg)->ops_AttrList;(tag = NextTagItem((APTR)&tags)); ) + { + switch(tag->ti_Tag) + { + case MUIA_NBalance_Pointer: + { + data->pointerType = (LONG)tag->ti_Data; + + // hide the mouse pointer if necessary + if(data->pointerType == MUIV_NBalance_Pointer_Off && + data->mouseSelectDown == TRUE) + { + D(DBF_INPUT, "mSet: HIDEPTR %ld", xget(obj, MUIA_ObjectID)); + + data->mouseSelectDown = FALSE; + HideCustomPointer(obj, data); + } + + tag->ti_Tag = TAG_IGNORE; + } + break; + } + } + + result = DoSuperMethodA(cl, obj, msg); + + RETURN(result); + return result; +} + + +IPTR mSetup(struct IClass *cl, Object *obj, struct MUI_RenderInfo *rinfo) +{ + IPTR result = FALSE; + struct InstData *data = INST_DATA(cl, obj); + + ENTER(); + + if(DoSuperMethodA(cl, obj, (Msg)rinfo)) + { + Object *parent = (Object *)xget(obj, MUIA_Parent); + + // find out if the parent object is a horizontal or vertical group + data->groupType = xget(parent, MUIA_Group_Type); + + // setup all pointers + SetupCustomPointers(data); + + // create/add an event handler to the window the object belongs to + data->ehnode.ehn_Priority = -2; + data->ehnode.ehn_Flags = MUI_EHF_GUIMODE; + data->ehnode.ehn_Object = obj; + data->ehnode.ehn_Class = cl; + data->ehnode.ehn_Events = IDCMP_MOUSEBUTTONS | IDCMP_MOUSEMOVE; + DoMethod(_win(obj), MUIM_Window_AddEventHandler, &data->ehnode); + + result = TRUE; + } + + RETURN(result); + return result; +} + +IPTR mCleanup(struct IClass *cl, Object *obj, Msg msg) +{ + IPTR result = 0; + struct InstData *data = INST_DATA(cl, obj); + + ENTER(); + + // cleanup the selection pointer + CleanupCustomPointers(data); + + DoMethod(_win(obj), MUIM_Window_RemEventHandler, &data->ehnode); + + result = DoSuperMethodA(cl, obj, msg); + + RETURN(result); + return result; +} + +IPTR mHide(struct IClass *cl, Object *obj, Msg msg) +{ + struct InstData *data = INST_DATA(cl, obj); + IPTR result; + + ENTER(); + + if(data->mouseSelectDown == TRUE && data->mouseOverObject == FALSE) + { + D(DBF_INPUT, "mHide: HIDEPTR %ld", xget(obj, MUIA_ObjectID)); + + data->mouseSelectDown = FALSE; + HideCustomPointer(obj, data); + } + + result = DoSuperMethodA(cl, obj, msg); + + RETURN(result); + return result; +} + +IPTR mHandleEvent(struct IClass *cl, Object *obj, struct MUIP_HandleEvent *msg) +{ + IPTR result = 0; + struct InstData *data; + + ENTER(); + + if((data = INST_DATA(cl, obj)) != NULL && + msg->imsg != NULL && data->pointerType != MUIV_NBalance_Pointer_Off) + { + struct IntuiMessage *imsg = msg->imsg; + + switch(imsg->Class) + { + case IDCMP_MOUSEMOVE: + { + BOOL isOverObject = FALSE; + + if(_isinobject(imsg->MouseX, imsg->MouseY)) + { + struct Layer_Info *li = &(_screen(obj)->LayerInfo); + struct Layer *layer; + + // get the layer that belongs to the current mouse coordinates + LockLayerInfo(li); + layer = WhichLayer(li, _window(obj)->LeftEdge + imsg->MouseX, _window(obj)->TopEdge + imsg->MouseY); + UnlockLayerInfo(li); + + // if the mouse is currently over the object and over the object's + // window we go and change the pointer to show the selection pointer + if(layer != NULL && layer->Window == _window(obj)) + isOverObject = TRUE; + } + + D(DBF_INPUT, "mouse move object %ld, %ld->%ld", xget(obj, MUIA_ObjectID), data->mouseOverObject, isOverObject); + + if(isOverObject == TRUE && data->mouseOverObject == FALSE) + { + D(DBF_INPUT, "SHOWPTR %ld, %ld->%ld", xget(obj, MUIA_ObjectID), data->mouseOverObject, isOverObject); + + ShowCustomPointer(obj, data); + data->mouseOverObject = TRUE; + } + else if(isOverObject == FALSE && data->mouseOverObject == TRUE) + { + if(data->ignoreNextHidePointer == FALSE) + { + D(DBF_INPUT, "HIDEPTR %ld, %ld->%ld", xget(obj, MUIA_ObjectID), data->mouseOverObject, isOverObject); + HideCustomPointer(obj, data); + data->mouseOverObject = FALSE; + } + else + data->ignoreNextHidePointer = FALSE; + } + } + break; + + case IDCMP_MOUSEBUTTONS: + { + if(imsg->Code == SELECTDOWN) + { + if(_isinobject(imsg->MouseX, imsg->MouseY)) + { + D(DBF_INPUT, "SELECTDOWN %ld, %ld", xget(obj, MUIA_ObjectID), data->mouseOverObject); + data->mouseSelectDown = TRUE; + data->ignoreNextHidePointer = TRUE; + ShowCustomPointer(obj, data); + } + } + else if(data->mouseSelectDown == TRUE) + { + D(DBF_INPUT, "SELECTUP %ld, %ld", xget(obj, MUIA_ObjectID), data->mouseOverObject); + data->mouseSelectDown = FALSE; + HideCustomPointer(obj, data); + } + } + break; + } + } + + RETURN(result); + return result; +} + diff --git a/workbench/classes/zune/nlist/nbalance_mcc/NBalance.h b/workbench/classes/zune/nlist/nbalance_mcc/NBalance.h new file mode 100644 index 0000000000..669cc9a7b1 --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/NBalance.h @@ -0,0 +1,57 @@ +/*************************************************************************** + + NBalance.mcc - New Balance MUI Custom Class + Copyright (C) 2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef NBALANCE_H +#define NBALANCE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(__AROS__) && defined(__PPC__) + #if defined(__GNUC__) + #pragma pack(2) + #elif defined(__VBCC__) + #pragma amiga-align + #endif +#endif + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +#define MUIC_NBalance "NBalance.mcc" +#define NBalanceObject MUI_NewObject(MUIC_NBalance + +#if !defined(__AROS__) && defined(__PPC__) + #if defined(__GNUC__) + #pragma pack() + #elif defined(__VBCC__) + #pragma default-align + #endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* NBALANCE_MCC_H */ + diff --git a/workbench/classes/zune/nlist/nbalance_mcc/Pointer.c b/workbench/classes/zune/nlist/nbalance_mcc/Pointer.c new file mode 100644 index 0000000000..bf2d004ef3 --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/Pointer.c @@ -0,0 +1,591 @@ +/*************************************************************************** + + NBalance.mcc - New Balance MUI Custom Class + Copyright (C) 2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <string.h> + +#include <clib/alib_protos.h> + +#include <intuition/pointerclass.h> + +#include <proto/utility.h> +#include <proto/intuition.h> +#include <proto/exec.h> +#include <proto/graphics.h> +#include <libraries/mui.h> + +#include "private.h" +#include "muiextra.h" + +// the meta data of our pointers +#define horizSizePointerWidth 16 +#define horizSizePointerHeight 16 +#define horizSizePointerXOffset -8 +#define horizSizePointerYOffset -8 + +#define vertSizePointerWidth 16 +#define vertSizePointerHeight 16 +#define vertSizePointerXOffset -8 +#define vertSizePointerYOffset -8 + +#if defined(__amigaos4__) +// a 32bit ARGB pointer image where we can define every color of the pixels +// on our own and put an alpha-channel information in it as well. +static const ULONG horizSizePointer[] = +{ + /* ......++++...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ...++.+##+.++... */ 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + /* ..+#+.+##+.+#+.. */ 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + /* .+##+++##+++##+. */ 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, + /* +##############+ */ 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + /* +##############+ */ 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + /* .+##+++##+++##+. */ 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, + /* ..+#+.+##+.+#+.. */ 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + /* ...++.+##+.++... */ 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......++++...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static const ULONG vertSizePointer[] = +{ + /* .......++....... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* .....+####+..... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ....+######+.... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ....+++##+++.... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* +++++++##+++++++ */ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + /* +##############+ */ 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + /* +##############+ */ 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + /* +++++++##+++++++ */ 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ....+++##+++.... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ....+######+.... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* .....+####+..... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* .......++....... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +#ifndef POINTERA_ImageData +#define POINTERA_ImageData (POINTERA_Dummy + 0x07) // ARGB (width * height * sizeof(ULONG)) +#endif +#ifndef POINTERA_Width +#define POINTERA_Width (POINTERA_Dummy + 0x08) // <= 64 +#endif +#ifndef POINTERA_Height +#define POINTERA_Height (POINTERA_Dummy + 0x09) // <= 64 +#endif + +#else // __amigaos4__ + +#if defined(__MORPHOS__) +#ifndef POINTERTYPE_VERTICALRESIZE +#define POINTERTYPE_VERTICALRESIZE 10 +#define POINTERTYPE_HORIZONTALRESIZE 11 +#endif +#ifndef WA_PointerType +#define WA_PointerType (WA_Dummy + 164) +#endif +#endif + +static const UWORD horizSizePointer[] = +{ +//plane1 plane2 + 0x0000, 0x0000, + + 0x03c0, 0x0000, + 0x0240, 0x0180, + 0x0240, 0x0180, + 0x0240, 0x0180, + 0x1a58, 0x0180, + 0x2a54, 0x1008, + 0x4e72, 0x300c, + 0x8001, 0x7ffe, + 0x8001, 0x7ffe, + 0x4e72, 0x300c, + 0x2a54, 0x0180, + 0x1a58, 0x0180, + 0x0240, 0x0180, + 0x0240, 0x0180, + 0x0240, 0x0180, + 0x03c0, 0x0000, + + 0x0000, 0x0000 +}; + +static const UWORD vertSizePointer[] = +{ +//plane1 plane2 + 0x0000, 0x0000, + + 0x0180, 0x0000, + 0x0240, 0x0180, + 0x0420, 0x03c0, + 0x0810, 0x07e0, + 0x0e70, 0x0180, + 0x0240, 0x0180, + 0xfe7f, 0x0180, + 0x8001, 0x7ffe, + 0x8001, 0x7ffe, + 0xfe7f, 0x0180, + 0x0240, 0x0180, + 0x0e70, 0x0180, + 0x0810, 0x07e0, + 0x0420, 0x03c0, + 0x0240, 0x0180, + 0x0180, 0x0000, + + 0x0000, 0x0000 +}; + +#endif // __amigaos4__ + +// Classic bitmap data for the pointers. These will be used for OS4 aswell, +// if the graphic card cannot handle 32bit pointers. + +// the horizontal size pointer +static const UWORD horizSizePointer_bp0[] = +{ + /* ......++++...... */ 0x03c0, + /* ......+..+...... */ 0x0240, + /* ......+..+...... */ 0x0240, + /* ......+..+...... */ 0x0240, + /* ...++.+..+.++... */ 0x1a58, + /* ..+.+.+..+.+.+.. */ 0x2a54, + /* .+..+++..+++..+. */ 0x4e72, + /* +..............+ */ 0x8001, + /* +..............+ */ 0x8001, + /* .+..+++..+++..+. */ 0x4e72, + /* ..+.+.+..+.+.+.. */ 0x2a54, + /* ...++.+..+.++... */ 0x1a58, + /* ......+..+...... */ 0x0240, + /* ......+..+...... */ 0x0240, + /* ......+..+...... */ 0x0240, + /* ......++++...... */ 0x03c0, +}; + +static const UWORD horizSizePointer_bp1[] = +{ + /* ................ */ 0x0000, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* ...#...##...#... */ 0x1188, + /* ..##...##...##.. */ 0x318c, + /* .##############. */ 0x7ffe, + /* .##############. */ 0x7ffe, + /* ..##...##...##.. */ 0x318c, + /* ...#...##...#... */ 0x1188, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* ................ */ 0x0000, +}; + +static const UWORD horizSizePointer_bp2[] = +{ + /* ......++++...... */ 0x03c0, + /* ......+##+...... */ 0x03c0, + /* ......+##+...... */ 0x03c0, + /* ......+##+...... */ 0x03c0, + /* ...++.+##+.++... */ 0x1bd8, + /* ..+#+.+##+.+#+.. */ 0x3bdc, + /* .+##+++##+++##+. */ 0x7ffe, + /* +##############+ */ 0xffff, + /* +##############+ */ 0xffff, + /* .+##+++##+++##+. */ 0x7ffe, + /* ..+#+.+##+.+#+.. */ 0x3bdc, + /* ...++.+##+.++... */ 0x1bd8, + /* ......+##+...... */ 0x03c0, + /* ......+##+...... */ 0x03c0, + /* ......+##+...... */ 0x03c0, + /* ......++++...... */ 0x03c0, +}; + +static struct BitMap horizSizePointerBitmap = +{ + 2, 16, 0, 2, 0, + { (PLANEPTR)horizSizePointer_bp0, (PLANEPTR)horizSizePointer_bp1, NULL, NULL, NULL, NULL, NULL, NULL } +}; + +// the vertical size pointer +static const UWORD vertSizePointer_bp0[] = +{ + /* .......++....... */ 0x0180, + /* ......+..+...... */ 0x0240, + /* .....+....+..... */ 0x0420, + /* ....+......+.... */ 0x0810, + /* ....+++..+++.... */ 0x0e70, + /* ......+..+...... */ 0x0240, + /* +++++++..+++++++ */ 0xfe7f, + /* +..............+ */ 0x8001, + /* +..............+ */ 0x8001, + /* +++++++..+++++++ */ 0xfe7f, + /* ......+..+...... */ 0x0240, + /* ....+++..+++.... */ 0x0e70, + /* ....+......+.... */ 0x0810, + /* .....+....+..... */ 0x0420, + /* ......+..+...... */ 0x0240, + /* .......++....... */ 0x0180, +}; + +static const UWORD vertSizePointer_bp1[] = +{ + /* ................ */ 0x0000, + /* .......##....... */ 0x0180, + /* ......####...... */ 0x03c0, + /* .....######..... */ 0x07e0, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* .##############. */ 0x7ffe, + /* .##############. */ 0x7ffe, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* .....######..... */ 0x07e0, + /* ......####...... */ 0x03c0, + /* .......##....... */ 0x0180, + /* ................ */ 0x0000, +}; + +static const UWORD vertSizePointer_bp2[] = +{ + /* .......++....... */ 0x0180, + /* ......+##+...... */ 0x03c0, + /* .....+####+..... */ 0x07e0, + /* ....+######+.... */ 0x0ff0, + /* ....+++##+++.... */ 0x0ff0, + /* ......+##+...... */ 0x03c0, + /* +++++++##+++++++ */ 0xffff, + /* +##############+ */ 0xffff, + /* +##############+ */ 0xffff, + /* +++++++##+++++++ */ 0xffff, + /* ......+##+...... */ 0x03c0, + /* ....+++##+++.... */ 0x0ff0, + /* ....+######+.... */ 0x0ff0, + /* .....+####+..... */ 0x07e0, + /* ......+##+...... */ 0x03c0, + /* .......++....... */ 0x0180, +}; + +static struct BitMap vertSizePointerBitmap = +{ + 2, 16, 0, 2, 0, + { (PLANEPTR)vertSizePointer_bp0, (PLANEPTR)vertSizePointer_bp1, NULL, NULL, NULL, NULL, NULL, NULL } +}; + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#endif + +static void IdentifyPointerColors(Object *obj) +{ + ULONG i; + ULONG colors[3*3]; + LONG blackDiff[3]; + LONG whiteDiff[3]; + LONG blackIndex; + LONG whiteIndex; + + ENTER(); + + // get the current screen's pointer colors (17 to 19) + GetRGB32(_window(obj)->WScreen->ViewPort.ColorMap, 17, 3, colors); + + for(i=0; i < 3; i++) + { + LONG dr; + LONG dg; + LONG db; + + // normalize the colors to 8 bit per gun as GetRGB32() returns + // 32bit left aligned values + colors[i*3+0] >>= 24; + colors[i*3+1] >>= 24; + colors[i*3+2] >>= 24; + + // calculate the geometric difference to the color black (=0x00000000) + dr = 0x00000000 - colors[i*3+0]; + dg = 0x00000000 - colors[i*3+1]; + db = 0x00000000 - colors[i*3+2]; + blackDiff[i] = dr * dr + dg * dg + db * db; + + // calculate the geometric difference to the color white (=0x000000ff) + dr = 0x000000ff - colors[i*3+0]; + dg = 0x000000ff - colors[i*3+1]; + db = 0x000000ff - colors[i*3+2]; + whiteDiff[i] = dr * dr + dg * dg + db * db; + } + + // the smallest difference defines the color which is closest to black or + // equal to black + if(blackDiff[0] > blackDiff[1]) + { + if(blackDiff[1] > blackDiff[2]) + blackIndex = 19; + else + blackIndex = 18; + } + else if(blackDiff[0] > blackDiff[2]) + blackIndex = 19; + else + blackIndex = 17; + + // the smallest difference defines the color which is closest to white or + // equal to white + if(whiteDiff[0] > whiteDiff[1]) + { + if(whiteDiff[1] > whiteDiff[2]) + whiteIndex = 19; + else + whiteIndex = 18; + } + else if(whiteDiff[0] > whiteDiff[2]) + whiteIndex = 19; + else + whiteIndex = 17; + + // Here we expect the user to have set up quite "different" colors. That + // means the color closest to white will never be close to black and vice + // versa. According to these differences we spread the required bitplanes. + if(whiteIndex == 17) + { + if(blackIndex == 18) + { + horizSizePointerBitmap.Planes[0] = (PLANEPTR)horizSizePointer_bp0; + horizSizePointerBitmap.Planes[1] = (PLANEPTR)horizSizePointer_bp1; + vertSizePointerBitmap.Planes[0] = (PLANEPTR)vertSizePointer_bp0; + vertSizePointerBitmap.Planes[1] = (PLANEPTR)vertSizePointer_bp1; + } + else // blackIndex == 19 + { + horizSizePointerBitmap.Planes[0] = (PLANEPTR)horizSizePointer_bp2; + horizSizePointerBitmap.Planes[1] = (PLANEPTR)horizSizePointer_bp1; + vertSizePointerBitmap.Planes[0] = (PLANEPTR)vertSizePointer_bp2; + vertSizePointerBitmap.Planes[1] = (PLANEPTR)vertSizePointer_bp1; + } + } + else if(whiteIndex == 18) + { + if(blackIndex == 17) + { + horizSizePointerBitmap.Planes[0] = (PLANEPTR)horizSizePointer_bp1; + horizSizePointerBitmap.Planes[1] = (PLANEPTR)horizSizePointer_bp0; + vertSizePointerBitmap.Planes[0] = (PLANEPTR)vertSizePointer_bp1; + vertSizePointerBitmap.Planes[1] = (PLANEPTR)vertSizePointer_bp0; + } + else // blackIndex == 19 + { + horizSizePointerBitmap.Planes[0] = (PLANEPTR)horizSizePointer_bp1; + horizSizePointerBitmap.Planes[1] = (PLANEPTR)horizSizePointer_bp2; + vertSizePointerBitmap.Planes[0] = (PLANEPTR)vertSizePointer_bp1; + vertSizePointerBitmap.Planes[1] = (PLANEPTR)vertSizePointer_bp2; + } + } + else // whiteIndex == 19 + { + if(blackIndex == 17) + { + horizSizePointerBitmap.Planes[0] = (PLANEPTR)horizSizePointer_bp2; + horizSizePointerBitmap.Planes[1] = (PLANEPTR)horizSizePointer_bp0; + vertSizePointerBitmap.Planes[0] = (PLANEPTR)vertSizePointer_bp2; + vertSizePointerBitmap.Planes[1] = (PLANEPTR)vertSizePointer_bp0; + } + else // blackIndex == 18 + { + horizSizePointerBitmap.Planes[0] = (PLANEPTR)horizSizePointer_bp0; + horizSizePointerBitmap.Planes[1] = (PLANEPTR)horizSizePointer_bp2; + vertSizePointerBitmap.Planes[0] = (PLANEPTR)vertSizePointer_bp0; + vertSizePointerBitmap.Planes[1] = (PLANEPTR)vertSizePointer_bp2; + } + } + + LEAVE(); +} + +void SetupCustomPointers(struct InstData *data) +{ + ENTER(); + + #if defined(__MORPHOS__) + if(((struct Library *)IntuitionBase)->lib_Version >= 51) + { + data->horizSizePointerObj = (APTR)POINTERTYPE_HORIZONTALRESIZE; + data->vertSizePointerObj = (APTR)POINTERTYPE_VERTICALRESIZE; + } + #endif + + if(data->horizSizePointerObj == NULL) + { + #if defined(__amigaos4__) + data->horizSizePointerObj = (Object *)NewObject(NULL, "pointerclass", + POINTERA_ImageData, horizSizePointer, + POINTERA_Width, horizSizePointerWidth, + POINTERA_Height, horizSizePointerHeight, + POINTERA_BitMap, (LONG)&horizSizePointerBitmap, + POINTERA_WordWidth, (ULONG)1, + POINTERA_XResolution, (ULONG)POINTERXRESN_SCREENRES, + POINTERA_YResolution, (ULONG)POINTERYRESN_SCREENRESASPECT, + POINTERA_XOffset, (LONG)horizSizePointerXOffset, + POINTERA_YOffset, (LONG)horizSizePointerYOffset, + TAG_DONE); + #else + data->horizSizePointerObj = (Object *)NewObject(NULL, (STRPTR)"pointerclass", + POINTERA_BitMap, (IPTR)&horizSizePointerBitmap, + POINTERA_WordWidth, (ULONG)1, + POINTERA_XResolution, (ULONG)POINTERXRESN_SCREENRES, + POINTERA_YResolution, (ULONG)POINTERYRESN_SCREENRESASPECT, + POINTERA_XOffset, (LONG)horizSizePointerXOffset, + POINTERA_YOffset, (LONG)horizSizePointerYOffset, + TAG_DONE); + #endif + } + + if(data->vertSizePointerObj == NULL) + { + #if defined(__amigaos4__) + data->vertSizePointerObj = (Object *)NewObject(NULL, "pointerclass", + POINTERA_ImageData, vertSizePointer, + POINTERA_Width, vertSizePointerWidth, + POINTERA_Height, vertSizePointerHeight, + POINTERA_BitMap, (LONG)&vertSizePointerBitmap, + POINTERA_WordWidth, (ULONG)1, + POINTERA_XResolution, (ULONG)POINTERXRESN_SCREENRES, + POINTERA_YResolution, (ULONG)POINTERYRESN_SCREENRESASPECT, + POINTERA_XOffset, (LONG)vertSizePointerXOffset, + POINTERA_YOffset, (LONG)vertSizePointerYOffset, + TAG_DONE); + #else + data->vertSizePointerObj = (Object *)NewObject(NULL, (STRPTR)"pointerclass", + POINTERA_BitMap, (IPTR)&vertSizePointerBitmap, + POINTERA_WordWidth, (ULONG)1, + POINTERA_XResolution, (ULONG)POINTERXRESN_SCREENRES, + POINTERA_YResolution, (ULONG)POINTERYRESN_SCREENRESASPECT, + POINTERA_XOffset, (LONG)vertSizePointerXOffset, + POINTERA_YOffset, (LONG)vertSizePointerYOffset, + TAG_DONE); + #endif + } + + LEAVE(); +} + +void CleanupCustomPointers(struct InstData *data) +{ + ENTER(); + + #if defined(__MORPHOS__) + if(((struct Library *)IntuitionBase)->lib_Version >= 51) + { + data->horizSizePointerObj = NULL; + data->vertSizePointerObj = NULL; + } + #endif + + // dispose the different pointer objects + if(data->horizSizePointerObj != NULL) + { + DisposeObject(data->horizSizePointerObj); + data->horizSizePointerObj = NULL; + } + + if(data->vertSizePointerObj != NULL) + { + DisposeObject(data->vertSizePointerObj); + data->vertSizePointerObj = NULL; + } + + data->activeCustomPointer = PT_NONE; + + LEAVE(); +} + +void ShowCustomPointer(Object *obj, struct InstData *data) +{ + ENTER(); + + // even if it seems to be a waste of performance, but + // we unfortunately have to always set the window pointer + // regardless of the point if it was previously set or not. + // This is required as any other gadget or process might + // reset the window pointer and as such we would end up + // with no custom pointer as well. So we only check the window + // sleep status here :( + if(xget(_win(obj), MUIA_Window_Sleep) == FALSE) + { + enum PointerType type = (data->groupType == MUIV_Group_Type_Horiz) ? PT_HORIZ : PT_VERT; + Object *ptrObject = NULL; + + switch(type) + { + case PT_HORIZ: + ptrObject = data->horizSizePointerObj; + break; + + case PT_VERT: + ptrObject = data->vertSizePointerObj; + break; + + case PT_NONE: + ptrObject = NULL; + break; + } + + if(ptrObject != NULL) + { + // try to identify the black/white colors + // of the current screen colormap + IdentifyPointerColors(obj); + + #if !defined(__MORPHOS__) + SetWindowPointer(_window(obj), WA_Pointer, ptrObject, TAG_DONE); + #else + SetWindowPointer(_window(obj), ((struct Library *)IntuitionBase)->lib_Version >= 51 ? WA_PointerType : WA_Pointer, ptrObject, TAG_DONE); + #endif + + data->activeCustomPointer = type; + } + else + HideCustomPointer(obj, data); + } + + LEAVE(); +} + +void HideCustomPointer(Object *obj, struct InstData *data) +{ + ENTER(); + + if(data->activeCustomPointer != PT_NONE) + { + SetWindowPointer(_window(obj), TAG_DONE); + data->activeCustomPointer = PT_NONE; + } + + LEAVE(); +} diff --git a/workbench/classes/zune/nlist/nbalance_mcc/Pointer.h b/workbench/classes/zune/nlist/nbalance_mcc/Pointer.h new file mode 100644 index 0000000000..432fd86f9f --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/Pointer.h @@ -0,0 +1,41 @@ +#ifndef _POINTER_H_ +#define _POINTER_H_ +/*************************************************************************** + + NBalance.mcc - New Balance MUI Custom Class + Copyright (C) 2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +// forward declarations +struct InstData; + +// enums +enum PointerType +{ + PT_HORIZ=0, // horizontal size pointer + PT_VERT, // vertical size pointer + PT_NONE +}; + +// prototypes +void SetupCustomPointers(struct InstData *data); +void CleanupCustomPointers(struct InstData *data); +void ShowCustomPointer(Object *obj, struct InstData *data); +void HideCustomPointer(Object *obj, struct InstData *data); + +#endif // _POINTER_H_ diff --git a/workbench/classes/zune/nlist/nbalance_mcc/library.c b/workbench/classes/zune/nlist/nbalance_mcc/library.c new file mode 100644 index 0000000000..2fd937bc43 --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/library.c @@ -0,0 +1,88 @@ +/*************************************************************************** + + NBalance.mcc - New Balance MUI Custom Class + Copyright (C) 2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/* system includes */ +#include <proto/exec.h> +#include <proto/intuition.h> +#include <proto/layers.h> + +/* local includes */ +#include "Debug.h" +#include "private.h" +#include "version.h" + +/* mcc initialisation */ +#define VERSION LIB_VERSION +#define REVISION LIB_REVISION + +#define CLASS MUIC_NBalance +#define SUPERCLASS MUIC_Balance + +#define INSTDATA InstData + +#define USERLIBID CLASS " " LIB_REV_STRING " [" SYSTEMSHORT "/" CPU "] (" LIB_DATE ") " LIB_COPYRIGHT +#define MASTERVERSION 19 + +#define CLASSINIT +#define CLASSEXPUNGE +#define MIN_STACKSIZE 16384 + +struct Library *LayersBase = NULL; + +#if defined(__amigaos4__) +struct LayersIFace *ILayers = NULL; +#endif + +/******************************************************************************/ +/* define the functions used by the startup code ahead of including mccinit.c */ +/******************************************************************************/ +static BOOL ClassInit(UNUSED struct Library *base); +static VOID ClassExpunge(UNUSED struct Library *base); + +/******************************************************************************/ +/* include the lib startup code for the mcc/mcp (and muimaster inlines) */ +/******************************************************************************/ +#include "mccinit.c" + +/******************************************************************************/ +/* define all implementations of our user functions */ +/******************************************************************************/ +static BOOL ClassInit(UNUSED struct Library *base) +{ + if((LayersBase = OpenLibrary("layers.library", 39L)) && + GETINTERFACE(ILayers, struct LayersIFace *, LayersBase)) + { + return(TRUE); + } + + return(FALSE); +} + + +static VOID ClassExpunge(UNUSED struct Library *base) +{ + if(LayersBase != NULL) + { + DROPINTERFACE(ILayers); + CloseLibrary(LayersBase); + LayersBase = NULL; + } +} diff --git a/workbench/classes/zune/nlist/nbalance_mcc/mmakefile.src b/workbench/classes/zune/nlist/nbalance_mcc/mmakefile.src new file mode 100644 index 0000000000..f7c1e4b681 --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/mmakefile.src @@ -0,0 +1,32 @@ +# $Id$ +include $(TOP)/config/make.cfg + +#MM contrib-zune-classes-nbalance-class : includes linklibs +#MM contrib-zune-classes-nbalance-test : includes linklibs + +USER_INCLUDES := -idirafter $(SRCDIR)/$(CURDIR)/../include +USER_CFLAGS := -DNO_INLINE_STDARG +USER_CFLAGS += $(PARANOIA_CFLAGS) + +FILES := Dispatcher \ + NBalance \ + Pointer \ + Debug + + +%build_module_simple mmake=contrib-zune-classes-nbalance-class \ + modname=NBalance modtype=mcc moduledir=$(CONTRIBDIR)/Zune/MCC_NList/Classes/Zune \ + files="library $(FILES)" uselibs="mui" + + +%build_prog mmake=contrib-zune-classes-nbalance-test progname=NBalance-Test \ + files="NBalance-Test $(FILES)" targetdir=$(AROS_TESTS)/NList \ + uselibs="mui" + + +#MM includes-copy + +INCLUDE_FILES := ../include/mui/NBalance_mcc.h +%copy_includes path=mui dir=../include/mui + +%common diff --git a/workbench/classes/zune/nlist/nbalance_mcc/private.h b/workbench/classes/zune/nlist/nbalance_mcc/private.h new file mode 100644 index 0000000000..6cdb24adcd --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/private.h @@ -0,0 +1,82 @@ +/*************************************************************************** + + NBalance.mcc - New Balance MUI Custom Class + Copyright (C) 2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef PRIVATE_H +#define PRIVATE_H + +/* system includes */ +#include <dos/exall.h> +#include <exec/types.h> +#include <intuition/classusr.h> +#include <libraries/mui.h> + +/* mcc includes */ +#include <mcc_common.h> + +/* local includes */ +#include "Debug.h" +#include "NBalance.h" +#include "Pointer.h" + +/* private structures */ +struct InstData +{ + ULONG groupType; + BOOL mouseSelectDown; + BOOL mouseOverObject; + BOOL ignoreNextHidePointer; + + LONG pointerType; + + Object *horizSizePointerObj; + Object *vertSizePointerObj; + enum PointerType activeCustomPointer; + + struct MUI_EventHandlerNode ehnode; +}; + +/* macros */ +#define _id(obj) (muiNotifyData(obj)->mnd_ObjectID) +#define _between(a,x,b) ((x)>=(a) && (x)<=(b)) +#define _isinobject(x,y) (_between(_mleft(obj),(x),_mright(obj)) && _between(_mtop(obj),(y),_mbottom(obj))) + +/// xget() +// Gets an attribute value from a MUI object +IPTR xget(Object *obj, const IPTR attr); +#if defined(__GNUC__) + // please note that we do not evaluate the return value of GetAttr() + // as some attributes (e.g. MUIA_Selected) always return FALSE, even + // when they are supported by the object. But setting b=0 right before + // the GetAttr() should catch the case when attr doesn't exist at all + #define xget(OBJ, ATTR) ({IPTR b=0; GetAttr(ATTR, OBJ, &b); b;}) +#endif +/// + +/* prototypes */ +IPTR mNew(struct IClass *cl, Object *obj, struct opSet *set); +IPTR mSet(struct IClass *cl, Object *obj, Msg msg); +IPTR mGet(struct IClass *cl, Object *obj, Msg msg); +IPTR mSetup(struct IClass *cl, Object *obj, struct MUI_RenderInfo *rinfo); +IPTR mCleanup(struct IClass *cl, Object *obj, Msg msg); +IPTR mHide(struct IClass *cl, Object *obj, Msg msg); +IPTR mHandleEvent(struct IClass *cl, Object *obj, struct MUIP_HandleEvent *msg); + +#endif /* PRIVATE_H */ diff --git a/workbench/classes/zune/nlist/nbalance_mcc/vastubs.c b/workbench/classes/zune/nlist/nbalance_mcc/vastubs.c new file mode 100755 index 0000000000..c394cba95f --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/vastubs.c @@ -0,0 +1,51 @@ +/*************************************************************************** + + NBalance.mcc - New Balance MUI Custom Class + Copyright (C) 2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NBalance class Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if !defined(__AROS__) && (defined(__VBCC__) || defined(NO_INLINE_STDARG)) +#if defined(_M68000) || defined(__M68000) || defined(__mc68000) + +#include <exec/types.h> + +/* FIX V45 breakage... */ +#if INCLUDE_VERSION < 45 +#define MY_CONST_STRPTR CONST_STRPTR +#else +#define MY_CONST_STRPTR CONST STRPTR +#endif + +#include <proto/intuition.h> + +APTR NewObject( struct IClass *classPtr, CONST_STRPTR classID, Tag tag1, ... ) +{ return NewObjectA(classPtr, classID, (struct TagItem *)&tag1); } +ULONG SetAttrs( APTR object, ULONG tag1, ... ) +{ return SetAttrsA(object, (struct TagItem *)&tag1); } +VOID SetWindowPointer( struct Window *win, Tag tag1, ... ) +{ SetWindowPointerA(win, (struct TagItem *)&tag1); } + +#include <proto/graphics.h> + +LONG ObtainBestPen( struct ColorMap *cm, ULONG r, ULONG g, ULONG b, Tag tag1Type, ... ) +{ return ObtainBestPenA(cm, r, g, b, (CONST struct TagItem *)&tag1Type); } + +#else + #error "VARGS stubs are only save on m68k systems!" +#endif +#endif diff --git a/workbench/classes/zune/nlist/nbalance_mcc/version.h b/workbench/classes/zune/nlist/nbalance_mcc/version.h new file mode 100644 index 0000000000..87eac49377 --- /dev/null +++ b/workbench/classes/zune/nlist/nbalance_mcc/version.h @@ -0,0 +1,79 @@ +/*************************************************************************** + + NBalance.mcc - New Balance MUI Custom Class + Copyright (C) 2008-2010 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef _VERSION_H_ +#define _VERSION_H_ + +// transforms a define into a string +#define STR(x) STR2(x) +#define STR2(x) #x + +// for setting all necessary version information +#define LIB_VERSION 15 +#define LIB_REVISION 11 +#define LIB_DATE "17.12.2011" +#define LIB_COPYRIGHT "Copyright (C) 2008-2011 NList Open Source Team" + +// set the LIB_REV_STRING +#define LIB_REV_STRING STR(LIB_VERSION) "." STR(LIB_REVISION) + +// identify the system we are compiling for +#if defined(__amigaos4__) + #define SYSTEM "AmigaOS4" + #define SYSTEMSHORT "OS4" +#elif defined(__MORPHOS__) + #define SYSTEM "MorphOS" + #define SYSTEMSHORT "MOS" +#elif defined(__AROS__) + #define SYSTEM "AROS" + #define SYSTEMSHORT SYSTEM +#elif defined(__AMIGA__) + #define SYSTEM "AmigaOS3" + #define SYSTEMSHORT "OS3" +#else + #warning "Unsupported System - check SYSTEM define" + #define SYSTEM "???" + #define SYSTEMSHORT "???" +#endif + +// identify the CPU model +#if defined(__PPC__) || defined(__powerpc__) + #define CPU "PPC" +#elif defined(_M68060) || defined(__M68060) || defined(__mc68060) + #define CPU "m68060" +#elif defined(_M68040) || defined(__M68040) || defined(__mc68040) + #define CPU "m68040" +#elif defined(_M68030) || defined(__M68030) || defined(__mc68030) + #define CPU "m68030" +#elif defined(_M68020) || defined(__M68020) || defined(__mc68020) + #define CPU "m68k" +#elif defined(_M68000) || defined(__M68000) || defined(__mc68000) + #define CPU "m68000" +#elif defined(__i386__) + #define CPU "x86" +#elif defined(__x86_64__) + #define CPU "x86_64" +#else + #warning "Unsupported CPU model - check CPU define" + #define CPU "???" +#endif + +#endif // _VERSION_H_ diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/Chunky2Bitmap.c b/workbench/classes/zune/nlist/nbitmap_mcc/Chunky2Bitmap.c new file mode 100755 index 0000000000..3a6116d4f4 --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/Chunky2Bitmap.c @@ -0,0 +1,99 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007-2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <proto/graphics.h> + +#include "Chunky2Bitmap.h" +#include "SetPatch.h" + +#include "private.h" + +#if defined(__amigaos4__) || defined(__MORPHOS__) || defined(__AROS__) +#define WPL8(rp, xstart, ystart, width, array, tmprp) WritePixelLine8(rp, xstart, ystart, width, array, tmprp) +#else // __amigaos4 || __MORPHOS__ || __AROS__ +// WritePixelLine8() is broken on plain OS3.1 systems, don't use it! +static void _WritePixelLine8(struct RastPort *rp, UWORD xstart, UWORD ystart, UWORD width, const UBYTE *array, UNUSED struct RastPort *tmprp) +{ + UWORD x; + const UBYTE *a = &array[xstart]; + + for(x = 0; x < width; x++) + { + SetAPen(rp, *a++); + WritePixel(rp, x+xstart, ystart); + } +} + +#define WPL8(rp, xstart, ystart, width, array, tmprp) \ +{ \ + if(setPatchVersion >= ((43UL << 16) | 0UL)) \ + WritePixelLine8(rp, xstart, ystart, width, array, tmprp); \ + else \ + _WritePixelLine8(rp, xstart, ystart, width, array, tmprp); \ +} +#endif // __amigaos4 || __MORPHOS__ || __AROS__ + +struct BitMap *Chunky2Bitmap(APTR chunky, ULONG width, ULONG height, ULONG depth) +{ + struct BitMap *bm = NULL; + + ENTER(); + + if(chunky != NULL && width > 0 && height > 0) + { + if((bm = AllocBitMap(width, height, min(8, depth), BMF_CLEAR|BMF_MINPLANES, NULL)) != NULL) + { + struct BitMap *tempBM; + + if((tempBM = AllocBitMap(width, 1, min(8, depth), BMF_CLEAR, NULL)) != NULL) + { + struct RastPort remapRP; + struct RastPort tempRP; + ULONG y; + char *chunkyPtr = chunky; + + InitRastPort(&remapRP); + remapRP.BitMap = bm; + + InitRastPort(&tempRP); + tempRP.BitMap = tempBM; + + for(y = 0; y < height; y++) + { + WPL8(&remapRP, 0, y, width, chunkyPtr, &tempRP); + + chunkyPtr += width; + } + + FreeBitMap(tempBM); + } + else + { + FreeBitMap(bm); + bm = NULL; + } + } + } + + RETURN(bm); + return bm; +} diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/Chunky2Bitmap.h b/workbench/classes/zune/nlist/nbitmap_mcc/Chunky2Bitmap.h new file mode 100755 index 0000000000..1cefbfcaa0 --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/Chunky2Bitmap.h @@ -0,0 +1,35 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef CHUNKY2BITMAP_H +#define CHUNKY2BITMAP_H 1 + +#ifndef EXEC_TYPES_H + #include <exec/types.h> +#endif +#ifndef GRAPHICS_GFX_H + #include <graphics/gfx.h> +#endif + +struct BitMap *Chunky2Bitmap(APTR chunky, ULONG width, ULONG height, ULONG depth); + +#endif /* CHUNKY2BITMAP_H */ diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/Debug.c b/workbench/classes/zune/nlist/nbitmap_mcc/Debug.c new file mode 100644 index 0000000000..140f8395a4 --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/Debug.c @@ -0,0 +1,415 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifdef DEBUG + +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> +#include <stdio.h> + +#include <proto/intuition.h> +#include <proto/utility.h> +#include <proto/dos.h> +#include <proto/exec.h> + +#include "SDI_compiler.h" +#include "Debug.h" +#include "version.h" + +// special flagging macros +#define isFlagSet(v,f) (((v) & (f)) == (f)) // return TRUE if the flag is set +#define hasFlag(v,f) (((v) & (f)) != 0) // return TRUE if one of the flags in f is set in v +#define isFlagClear(v,f) (((v) & (f)) == 0) // return TRUE if flag f is not set in v +#define SET_FLAG(v,f) ((v) |= (f)) // set the flag f in v +#define CLEAR_FLAG(v,f) ((v) &= ~(f)) // clear the flag f in v +#define MASK_FLAG(v,f) ((v) &= (f)) // mask the variable v with flag f bitwise + +// our static variables with default values +static int indent_level = 0; +static BOOL ansi_output = FALSE; +static ULONG debug_flags = DBF_ALWAYS | DBF_STARTUP; // default debug flags +static ULONG debug_classes = DBC_ERROR | DBC_DEBUG | DBC_WARNING | DBC_ASSERT | DBC_REPORT; // default debug classes + +/****************************************************************************/ + +void SetupDebug(void) +{ + char var[256]; + + kprintf("** NBitmap.mcc v" LIB_REV_STRING " startup ***********************\n"); + kprintf("Initializing runtime debugging:\n"); + + if(GetVar("nbitmap.mcc.debug", var, sizeof(var), 0) > 0) + { + char *tok; + char *debug = var; + + // static list of our debugging classes tokens. + // in the yamdebug variable these classes always start with a @ + static struct { const char *token; unsigned long flag; } dbclasses[] = + { + { "ctrace", DBC_CTRACE }, + { "report", DBC_REPORT }, + { "assert", DBC_ASSERT }, + { "timeval", DBC_TIMEVAL }, + { "debug", DBC_DEBUG }, + { "error", DBC_ERROR }, + { "warning", DBC_WARNING }, + { "all", DBC_ALL }, + { NULL, 0 } + }; + + static struct { const char *token; unsigned long flag; } dbflags[] = + { + { "always", DBF_ALWAYS }, + { "startup", DBF_STARTUP }, + { "datatype", DBF_DATATYPE }, + { "draw", DBF_DRAW }, + { "all", DBF_ALL }, + { NULL, 0 } + }; + + // we parse the env variable token-wise + while((tok = strtok(debug, ", ;")) != NULL) + { + ULONG i; + + // check if the token is class definition or + // just a flag definition + if(tok[0] == '@') + { + // check if this call is a negation or not + if(tok[1] == '!') + { + // search for the token and clear the flag + for(i = 0; dbclasses[i].token != NULL; i++) + { + if(stricmp(tok + 2, dbclasses[i].token) == 0) + { + kprintf("clear '%s' debug class flag.\n", dbclasses[i].token); + CLEAR_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + else + { + // search for the token and set the flag + for(i = 0; dbclasses[i].token != NULL; i++) + { + if(stricmp(tok + 1, dbclasses[i].token) == 0) + { + kprintf("set '%s' debug class flag\n", dbclasses[i].token); + SET_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + } + else + { + // check if this call is a negation or not + if(tok[0] == '!') + { + for(i = 0; dbflags[i].token != NULL; i++) + { + if(stricmp(tok + 1, dbflags[i].token) == 0) + { + kprintf("clear '%s' debug flag\n", dbflags[i].token); + CLEAR_FLAG(debug_flags, dbflags[i].flag); + } + } + } + else + { + // check if the token was "ansi" and if so enable the ANSI color + // output + if(stricmp(tok, "ansi") == 0) + { + kprintf("ansi output enabled\n"); + ansi_output = TRUE; + } + else + { + for(i = 0; dbflags[i].token != NULL; i++) + { + if(stricmp(tok, dbflags[i].token) == 0) + { + kprintf("set '%s' debug flag\n", dbflags[i].token); + SET_FLAG(debug_flags, dbflags[i].flag); + } + } + } + } + } + + debug = NULL; + } + } + + kprintf("set debug classes/flags (env:nbitmap.mcc.debug): %08lx/%08lx\n", debug_classes, debug_flags); + kprintf("** Normal processing follows ***************************************\n"); +} + +/****************************************************************************/ + +void CleanupDebug(void) +{ + kprintf("** Cleaned up debugging ********************************************\n"); +} + +/****************************************************************************/ + +// define variables for using ANSI colors in our debugging scheme +#define ANSI_ESC_CLR "\033[0m" +#define ANSI_ESC_BOLD "\033[1m" +#define ANSI_ESC_UNDERLINE "\033[4m" +#define ANSI_ESC_BLINK "\033[5m" +#define ANSI_ESC_REVERSE "\033[7m" +#define ANSI_ESC_INVISIBLE "\033[8m" +#define ANSI_ESC_FG_BLACK "\033[0;30m" +#define ANSI_ESC_FG_RED "\033[0;31m" +#define ANSI_ESC_FG_GREEN "\033[0;32m" +#define ANSI_ESC_FG_BROWN "\033[0;33m" +#define ANSI_ESC_FG_BLUE "\033[0;34m" +#define ANSI_ESC_FG_PURPLE "\033[0;35m" +#define ANSI_ESC_FG_CYAN "\033[0;36m" +#define ANSI_ESC_FG_LGRAY "\033[0;37m" +#define ANSI_ESC_FG_DGRAY "\033[1;30m" +#define ANSI_ESC_FG_LRED "\033[1;31m" +#define ANSI_ESC_FG_LGREEN "\033[1;32m" +#define ANSI_ESC_FG_YELLOW "\033[1;33m" +#define ANSI_ESC_FG_LBLUE "\033[1;34m" +#define ANSI_ESC_FG_LPURPLE "\033[1;35m" +#define ANSI_ESC_FG_LCYAN "\033[1;36m" +#define ANSI_ESC_FG_WHITE "\033[1;37m" +#define ANSI_ESC_BG "\033[0;4" // background esc-squ start with 4x +#define ANSI_ESC_BG_BLACK "\033[0;40m" +#define ANSI_ESC_BG_RED "\033[0;41m" +#define ANSI_ESC_BG_GREEN "\033[0;42m" +#define ANSI_ESC_BG_BROWN "\033[0;43m" +#define ANSI_ESC_BG_BLUE "\033[0;44m" +#define ANSI_ESC_BG_PURPLE "\033[0;45m" +#define ANSI_ESC_BG_CYAN "\033[0;46m" +#define ANSI_ESC_BG_LGRAY "\033[0;47m" + +/****************************************************************************/ + +INLINE void _INDENT(void) +{ + int i; + + for(i = 0; i < indent_level; i++) + kprintf(" "); +} + +/****************************************************************************/ + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function) +{ + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Entering %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Entering %s\n", file, line, function); + } + + indent_level++; +} + +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function) +{ + if(indent_level > 0) + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s\n", file, line, function); + } +} + +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result) +{ + if(indent_level > 0) + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s (result 0x%08lx, %ld)%s\n", ANSI_ESC_FG_BROWN, file, line, function, result, result, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s (result 0x%08lx, %ld)\n", file, line, function, result, result); + } +} + +/****************************************************************************/ + +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + switch(size) + { + case 1: + fmt = "%s:%ld:%s = %ld, 0x%02lx"; + break; + + case 2: + fmt = "%s:%ld:%s = %ld, 0x%04lx"; + break; + + default: + fmt = "%s:%ld:%s = %ld, 0x%08lx"; + break; + } + + _INDENT(); + + if(ansi_output) + kprintf(ANSI_ESC_FG_GREEN); + + kprintf(fmt, file, line, name, value, value); + + if(size == 1 && value < 256) + { + if(value < ' ' || (value >= 127 && value < 160)) + kprintf(", '\\x%02lx'", value); + else + kprintf(", '%lc'", value); + } + + if(ansi_output) + kprintf("%s\n", ANSI_ESC_CLR); + else + kprintf("\n"); + } +} + +/****************************************************************************/ + +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + _INDENT(); + + if(p != NULL) + fmt = "%s:%ld:%s = 0x%08lx\n"; + else + fmt = "%s:%ld:%s = NULL\n"; + + if(ansi_output) + { + kprintf(ANSI_ESC_FG_GREEN); + kprintf(fmt, file, line, name, p); + kprintf(ANSI_ESC_CLR); + } + else + kprintf(fmt, file, line, name, p); + } +} + +/****************************************************************************/ + +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s = 0x%08lx \"%s\"%s\n", ANSI_ESC_FG_GREEN, file, line, name, string, string, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s = 0x%08lx \"%s\"\n", file, line, name, string, string); + } +} + +/****************************************************************************/ + +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s%s\n", ANSI_ESC_FG_GREEN, file, line, msg, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s\n", file, line, msg); + } +} + +/****************************************************************************/ + +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...) +{ + if((isFlagSet(debug_classes, dclass) && isFlagSet(debug_flags, dflags)) || + (isFlagSet(dclass, DBC_ERROR) || isFlagSet(dclass, DBC_WARNING))) + { + va_list args; + static char buf[1024]; + + _INDENT(); + + va_start(args, format); + vsnprintf(buf, 1024, format, args); + va_end(args); + + if(ansi_output) + { + const char *highlight = ANSI_ESC_FG_GREEN; + + switch(dclass) + { + case DBC_CTRACE: highlight = ANSI_ESC_FG_BROWN; break; + case DBC_REPORT: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ASSERT: highlight = ANSI_ESC_FG_RED; break; + case DBC_TIMEVAL: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_DEBUG: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ERROR: highlight = ANSI_ESC_FG_RED; break; + case DBC_WARNING: highlight = ANSI_ESC_FG_PURPLE;break; + } + + kprintf("%s%s:%ld:%s%s\n", highlight, file, line, buf, ANSI_ESC_CLR); + } + else + kprintf("%s:%ld:%s\n", file, line, buf); + } +} + +/****************************************************************************/ + +#endif diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/Debug.h b/workbench/classes/zune/nlist/nbitmap_mcc/Debug.h new file mode 100644 index 0000000000..132ebc5bf0 --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/Debug.h @@ -0,0 +1,141 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef DEBUG_H +#define DEBUG_H + +// first we make sure all previously defined symbols are undefined now so +// that no other debug system interferes with ours. +#undef ENTER +#undef LEAVE +#undef RETURN +#undef SHOWVALUE +#undef SHOWPOINTER +#undef SHOWSTRING +#undef SHOWMSG +#undef STARTCLOCK +#undef STOPCLOCK +#undef D +#undef E +#undef W +#undef ASSERT + +#if defined(DEBUG) + +#include <assert.h> + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +#if defined(__amigaos4__) + #include <proto/exec.h> + #ifdef __USE_INLINE__ + #ifdef DebugPrintF + #undef DebugPrintF + #endif + #endif + #ifndef kprintf + #define kprintf(format, args...) ((struct ExecIFace *)((*(struct ExecBase **)4)->MainInterface))->DebugPrintF(format, ## args) + #endif +#elif defined(__MORPHOS__) + #include <exec/rawfmt.h> + #include <proto/exec.h> + #define KPutFmt(format, args) VNewRawDoFmt(format, (APTR)RAWFMTFUNC_SERIAL, NULL, args) +void kprintf(const char *formatString,...); +#else +void kprintf(const char *formatString,...); +#endif + +// debug classes +#define DBC_CTRACE (1<<0) // call tracing (ENTER/LEAVE etc.) +#define DBC_REPORT (1<<1) // reports (SHOWVALUE/SHOWSTRING etc.) +#define DBC_ASSERT (1<<2) // asserts (ASSERT) +#define DBC_TIMEVAL (1<<3) // time evaluations (STARTCLOCK/STOPCLOCK) +#define DBC_DEBUG (1<<4) // debugging output D() +#define DBC_ERROR (1<<5) // error output E() +#define DBC_WARNING (1<<6) // warning output W() +#define DBC_ALL 0xffffffff + +// debug flags +#define DBF_ALWAYS (1<<0) +#define DBF_STARTUP (1<<1) // for startup/shutdown events +#define DBF_DATATYPE (1<<2) +#define DBF_DRAW (1<<3) +#define DBF_ALL 0xffffffff + +void SetupDebug(void); +void CleanupDebug(void); + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function); +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function); +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result); +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line); +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line); +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line); +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line); +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...); + +// Core class information class messages +#define ENTER() _ENTER(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define LEAVE() _LEAVE(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define RETURN(r) _RETURN(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__, (long)r) +#define SHOWVALUE(f, v) _SHOWVALUE(DBC_REPORT, f, (long)v, sizeof(v), #v, __FILE__, __LINE__) +#define SHOWPOINTER(f, p) _SHOWPOINTER(DBC_REPORT, f, p, #p, __FILE__, __LINE__) +#define SHOWSTRING(f, s) _SHOWSTRING(DBC_REPORT, f, s, #s, __FILE__, __LINE__) +#define SHOWMSG(f, m) _SHOWMSG(DBC_REPORT, f, m, __FILE__, __LINE__) +#define D(f, s, vargs...) _DPRINTF(DBC_DEBUG, f, __FILE__, __LINE__, s, ## vargs) +#define E(f, s, vargs...) _DPRINTF(DBC_ERROR, f, __FILE__, __LINE__, s, ## vargs) +#define W(f, s, vargs...) _DPRINTF(DBC_WARNING, f, __FILE__, __LINE__, s, ## vargs) +#define ASSERT(expression) \ + ((void) \ + ((expression) ? 0 : \ + ( \ + _DPRINTF(DBC_ASSERT, \ + DBF_ALWAYS, \ + __FILE__, \ + __LINE__, \ + "failed assertion '%s'", \ + #expression), \ + assert(#expression), \ + 0 \ + ) \ + ) \ + ) + +#else // DEBUG + +#define ENTER() ((void)0) +#define LEAVE() ((void)0) +#define RETURN(r) ((void)0) +#define SHOWVALUE(f, v) ((void)0) +#define SHOWPOINTER(f, p) ((void)0) +#define SHOWSTRING(f, s) ((void)0) +#define SHOWMSG(f, m) ((void)0) +#define D(f, s, vargs...) ((void)0) +#define E(f, s, vargs...) ((void)0) +#define W(f, s, vargs...) ((void)0) +#define ASSERT(expression) ((void)0) + +#endif // DEBUG + +#endif // DEBUG_H diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/DitherImage.c b/workbench/classes/zune/nlist/nbitmap_mcc/DitherImage.c new file mode 100755 index 0000000000..5fe754432c --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/DitherImage.c @@ -0,0 +1,249 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <proto/exec.h> +#include <proto/utility.h> +#include <mui/NBitmap_mcc.h> + +#include "private.h" +#include "DitherImage.h" +#include "Debug.h" + +#ifndef MEMF_SHARED + #define MEMF_SHARED MEMF_ANY +#endif + +#define RAWIDTH(w) ((((UWORD)(w))+15)>>3 & 0xFFFE) + +APTR DitherImageA(CONST_APTR data, struct TagItem *tags) +{ + struct TagItem *tag; + uint32 width = 0; + uint32 height = 0; + uint32 format = 0; + const uint32 *colorMap = NULL; + const int32 *penMap = NULL; + APTR result = NULL; + uint8 **maskPtr = NULL; + + ENTER(); + + while((tag = NextTagItem((APTR)&tags)) != NULL) + { + switch(tag->ti_Tag) + { + case DITHERA_Width: + width = tag->ti_Data; + break; + + case DITHERA_Height: + height = tag->ti_Data; + break; + + case DITHERA_Format: + format = tag->ti_Data; + break; + + case DITHERA_ColorMap: + colorMap = (uint32 *)tag->ti_Data; + break; + + case DITHERA_PenMap: + penMap = (int32 *)tag->ti_Data; + break; + + case DITHERA_MaskPlane: + maskPtr = (uint8 **)tag->ti_Data; + break; + } + } + + if(data != NULL && colorMap != NULL && width > 0 && height > 0) + { + // the 8bit chunky data don't need to reside in chip memory + if((result = AllocVec(width * height, MEMF_SHARED)) != NULL) + { + uint8 *mask = NULL; + uint8 *mPtr = NULL; + uint32 y; + uint8 *dataPtr = (uint8 *)data; + uint8 *resultPtr = (uint8 *)result; + + // only ARGB raw data contain transparency data, hence we need to + // allocate a mask plane only for these and only if the calling + // function is interested in a mask at all + if(format == MUIV_NBitmap_Type_ARGB32 && maskPtr != NULL) + { + // the mask must reside in chip memory + mask = AllocVec(RAWIDTH(width) * height, MEMF_SHARED|MEMF_CLEAR|MEMF_CHIP); + *maskPtr = mask; + mPtr = mask; + } + + for(y = 0; y < height; y++) + { + uint32 x; + uint8 bitMask = 0x80; + + for(x = 0; x < width; x++) + { + uint8 a, r, g, b; + int32 i; + int32 bestIndex; + uint32 bestError; + + // obtain the pixel's A, R, G and B values from the raw data + switch(format) + { + case MUIV_NBitmap_Type_CLUT8: + a = (colorMap[dataPtr[0]] >> 24) & 0xff; + r = (colorMap[dataPtr[0]] >> 16) & 0xff; + g = (colorMap[dataPtr[0]] >> 8) & 0xff; + b = (colorMap[dataPtr[0]] >> 0) & 0xff; + dataPtr += 1; + break; + + case MUIV_NBitmap_Type_RGB24: + a = 0xff; + r = dataPtr[0]; + g = dataPtr[1]; + b = dataPtr[2]; + dataPtr += 3; + break; + + case MUIV_NBitmap_Type_ARGB32: + a = dataPtr[0]; + r = dataPtr[1]; + g = dataPtr[2]; + b = dataPtr[3]; + dataPtr += 4; + break; + + default: + a = 0x00; + r = 0x00; + g = 0x00; + b = 0x00; + break; + } + + // now calculate the best matching color from the given color map + bestIndex = -1; + bestError = 0xffffffffUL; + + for(i = 0; i < 256; i++) + { + int32 dr, dg, db; + uint32 error; + + // calculate the geometric difference to the current color + dr = (int32)((colorMap[i] >> 16) & 0xff) - (int32)r; + dg = (int32)((colorMap[i] >> 8) & 0xff) - (int32)g; + db = (int32)((colorMap[i] >> 0) & 0xff) - (int32)b; + error = dr * dr + dg * dg + db * db; + + if(bestError > error) + { + // remember this as the best matching color so far + bestError = error; + bestIndex = i; + + // bail out if we found an exact match + if(error == 0x00000000UL) + break; + } + } + + // put the calculated color number into the destination LUT8 image + // using an additional pen map if available + if(bestIndex != -1) + { + if(penMap != NULL) + *resultPtr++ = penMap[bestIndex]; + else + *resultPtr++ = bestIndex; + } + else + { + // no matching color found, use color 0 + // can this happen at all? + *resultPtr++ = 0; + } + + if(mPtr != NULL) + { + // if we have a mask and the alpha value is >= 0x80 the + // pixel is treated as non-transparent + if(a >= 0x80) + mPtr[x/8] |= bitMask; + + bitMask >>= 1; + if(bitMask == 0x00) + bitMask = 0x80; + } + } + + // advance the mask pointer by one line + if(mPtr != NULL) + mPtr += RAWIDTH(width); + } + } + } + + RETURN(result); + return result; +} + +#ifdef __AROS__ +APTR STDARGS VARARGS68K DitherImage(CONST_APTR data, Tag tag1, ...) +{ + AROS_SLOWSTACKTAGS_PRE_AS(tag1, APTR) + retval = DitherImageA(data, AROS_SLOWSTACKTAGS_ARG(tag1)); + AROS_SLOWSTACKTAGS_POST +} +#else +#if !defined(__PPC__) +APTR STDARGS VARARGS68K DitherImage(CONST_APTR data, ...) +{ + APTR ret; + VA_LIST args; + + VA_START(args, data); + ret = DitherImageA(data, (struct TagItem *)VA_ARG(args, IPTR)); + VA_END(args); + + return ret; +} +#endif +#endif + +void FreeDitheredImage(APTR image, APTR mask) +{ + ENTER(); + + if(image != NULL) + FreeVec(image); + if(mask != NULL) + FreeVec(mask); + + LEAVE(); +} diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/DitherImage.h b/workbench/classes/zune/nlist/nbitmap_mcc/DitherImage.h new file mode 100755 index 0000000000..850e89dad0 --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/DitherImage.h @@ -0,0 +1,52 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef DITHERIMAGE_H +#define DITHERIMAGE_H 1 + +#ifndef EXEC_TYPES_H + #include <exec/types.h> +#endif +#ifndef UTILITY_TAGITEM_H + #include <utility/tagitem.h> +#endif + +APTR DitherImageA(CONST_APTR data, struct TagItem *tags); +#if !defined(__AROS__) && defined(__PPC__) +#define DitherImage(data, ...) ({ ULONG _tags[] = { __VA_ARGS__ }; DitherImageA(data, (struct TagItem *)_tags); }) +#else +#ifdef __AROS__ +APTR STDARGS VARARGS68K DitherImage(CONST_APTR data, Tag tag1, ...); +#else +APTR STDARGS VARARGS68K DitherImage(CONST_APTR data, ...); +#endif +#endif +void FreeDitheredImage(APTR image, APTR mask); + +#define DITHERA_Width (TAG_USER+2) +#define DITHERA_Height (TAG_USER+3) +#define DITHERA_Format (TAG_USER+4) +#define DITHERA_ColorMap (TAG_USER+5) +#define DITHERA_PenMap (TAG_USER+6) +#define DITHERA_MaskPlane (TAG_USER+7) + +#endif /* DITHERIMAGE_H */ diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/Makefile b/workbench/classes/zune/nlist/nbitmap_mcc/Makefile new file mode 100644 index 0000000000..2b6505523f --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/Makefile @@ -0,0 +1,442 @@ +#/*************************************************************************** +# +# NBitmap.mcc - New Bitmap MUI Custom Class +# Copyright (C) 2006 by Daniel Allsopp +# Copyright (C) 2007 by NList Open Source Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# NList classes Support Site: http://www.sf.net/projects/nlist-classes +# +# $Id$ +# +#***************************************************************************/ + +########################################################################### +# This makefile is a very generic one. It tries to identify both, the host +# and the target operating system for which YAM should be compiled. +# However, this auto-detection can be easily overridden by directly +# specifying an option on the commandline while calling 'make'. +# +# Example: +# +# # to explicitly compile for AmigaOS3 +# > make OS=os3 +# +# # to compile for AmigaOS4 but with debugging +# > make OS=os4 DEBUG= +# + +############################################# +# find out the HOST operating system +# on which this makefile is run +HOST ?= $(shell uname) +ifeq ($(HOST), AmigaOS) + ifeq ($(shell uname -m), powerpc) + HOST = AmigaOS4 + endif + ifeq ($(shell uname -m), ppc) + HOST = AmigaOS4 + endif +endif + +# if no host is identifed (no uname tool) +# we assume a AmigaOS build +ifeq ($(HOST),) + HOST = AmigaOS +endif + +############################################# +# now we find out the target OS for +# which we are going to compile YAM in case +# the caller didn't yet define OS himself +ifndef (OS) + ifeq ($(HOST), AmigaOS4) + OS = os4 + else + ifeq ($(HOST), AmigaOS) + OS = os3 + else + ifeq ($(HOST), MorphOS) + OS = mos + else + ifeq ($(HOST), AROS) + # now we find out which CPU system aros will be used + ifeq ($(shell uname -m), powerpc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), ppc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), i386) + OS = aros-i386 + endif + ifeq ($(shell uname -m), i686) + OS = aros-i686 + endif + ifeq ($(shell uname -m), x86_64) + OS = aros-x86_64 + endif + else + OS = os4 + endif + endif + endif + endif +endif + +############################################# +# define common commands we use in this +# makefile. Please note that each of them +# might be overridden on the commandline. + +# common commands +FLEX = flex +FC = flexcat +EXPR = expr +DATE = date +RM = delete force +RMDIR = delete force all +MKDIR = makedir +CHMOD = protect FLAGS=rwed +SED = sed +CP = copy +CC = gcc +STRIP = strip +OBJDUMP = objdump + +# path definitions +CDUP = / +CDTHIS= + +# override some variables for non-native builds (cross-compiler) +ifneq ($(HOST), AmigaOS) +ifneq ($(HOST), AmigaOS4) +ifneq ($(HOST), MorphOS) + + # when we end up here this is either a unix or Aros host + # so lets use unix kind of commands + RM = rm -f + RMDIR = rm -rf + MKDIR = mkdir -p + CHMOD = chmod 755 + CP = cp -f + + CDUP = ../ + CDTHIS= ./ + +endif +endif +endif + +########################################################################### +# CPU and DEBUG can be defined outside, defaults to above +# using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug +# PPC-603e version +# +# OPTFLAGS are disabled by DEBUG normally! +# +# ignored warnings are: +# none - because we want to compile with -Wall all the time + +# Common Directories +PREFIX = $(CDTHIS) +OBJDIR = .obj_$(OS) +BINDIR = bin_$(OS) +VPATH = $(OBJDIR) +DEPFILE = Makefile.dep +DESTDIR = MUI:Libs/MUI + +# target definition +TARGET = $(BINDIR)/NBitmap.mcc +TESTTARGET= $(BINDIR)/NBitmap-Test + +# Common compiler/linker flags +WARN = -W -Wall -Wwrite-strings -Wpointer-arith -Wsign-compare +OPTFLAGS = -O3 -fomit-frame-pointer -funroll-loops +DEBUG = -DDEBUG -O0 +DEBUGSYM = -g -gstabs +CFLAGS = -I. -I../include $(CPU) $(WARN) $(OPTFLAGS) \ + $(DEBUG) $(DEBUGSYM) $(USER_CFLAGS) -c +LDFLAGS = $(CPU) $(DEBUGSYM) +LDLIBS = + +########################################################################### +# object files definition +# + +LOBJS = library.o + +COBJS = dispatcher.o \ + NBitmap.o \ + DitherImage.o \ + Debug.o + +TOBJS = NBitmap-Test.o + +MCCOBJS = $(addprefix $(OBJDIR)/,$(LOBJS)) $(addprefix $(OBJDIR)/,$(COBJS)) +TESTOBJS = $(addprefix $(OBJDIR)/,$(COBJS)) $(addprefix $(OBJDIR)/,$(TOBJS)) + +# different options per target OS +ifeq ($(OS), os4) + + ############################## + # AmigaOS4 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS4) + CC = ppc-amigaos-gcc + STRIP = ppc-amigaos-strip + OBJDUMP = ppc-amigaos-objdump + endif + + # Compiler/Linker flags + CRT = newlib + CPU = -mcpu=powerpc + WARN += -Wdeclaration-after-statement -Wdisabled-optimization + CFLAGS += -mcrt=$(CRT) -D__USE_INLINE__ -D__NEW_TIMEVAL_DEFINITION_USED__ \ + -DNO_PPCINLINE_STDARG -Wa,-mregnames + LDFLAGS += -mcrt=$(CRT) + + # additional object files required + M68KSTUBS = $(OBJDIR)/mccclass_68k.o + +else +ifeq ($(OS), os3) + + ############################## + # AmigaOS3 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS) + CC = m68k-amigaos-gcc + STRIP = m68k-amigaos-strip + OBJDUMP = m68k-amigaos-objdump + endif + + # Compiler/Linker flags + CPU = -m68020-60 -msoft-float + CFLAGS += -noixemul -DNO_INLINE_STDARG -D__amigaos3__ + LDFLAGS += -noixemul + LDLIBS += -ldebug -lmui + + # additional object files required + COBJS += Chunky2Bitmap.o \ + SetPatch.o \ + WritePixelArray.o \ + WritePixelArrayAlpha.o \ + vastubs.o + +else +ifeq ($(OS), mos) + + ############################## + # MorphOS + + # Compiler/link/strip commands + ifneq ($(HOST), MorphOS) + CC = ppc-morphos-gcc + STRIP = ppc-morphos-strip + OBJDUMP = ppc-morphos-objdump + endif + + # Compiler/Linker flags + CPU = -mcpu=powerpc + CFLAGS += -noixemul -DNO_PPCINLINE_STDARG + LDFLAGS += -noixemul + LDLIBS += -ldebug + + # additional object files required + COBJS += Chunky2Bitmap.o + +else +ifeq ($(OS), aros-i386) + + ############################## + # AROS (i386) + + ifneq ($(HOST), AROS) + CC = i386-aros-gcc + STRIP = i386-aros-strip + OBJDUMP = i386-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + + # additional object files required + COBJS += Chunky2Bitmap.o + +else +ifeq ($(OS), aros-ppc) + + ############################## + # AROS (PPC) + + ifneq ($(HOST), AROS) + CC = ppc-aros-gcc + STRIP = ppc-aros-strip + OBJDUMP = ppc-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + + # additional object files required + COBJS += Chunky2Bitmap.o + +else +ifeq ($(OS), aros-x86_64) + + ############################## + # AROS (x86_64) + + ifneq ($(HOST), AROS) + CC = x86_64-aros-gcc + STRIP = x86_64-aros-strip + OBJDUMP = x86_64-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + + # additional object files required + COBJS += Chunky2Bitmap.o + +endif +endif +endif +endif +endif +endif + +# main target +.PHONY: all +ifeq ($(wildcard $(DEPFILE)),$(DEPFILE)) +# great, we have a dependecies file, let's make our target +all: $(BINDIR) $(OBJDIR) $(M68KSTUBS) $(TARGET) $(TESTTARGET) +else +# no dependecies, create it and then call make again +all: depend + @make --no-print-directory all +endif + +# for making a release we compile ALL target with no debug +release: + @echo " CC $<" + make OS=os4 clean + make OS=os4 DEBUG= + @echo " CC $<" + make OS=os3 clean + make OS=os3 DEBUG= + @echo " CC $<" + make OS=mos clean + make OS=mos DEBUG= + @echo " CC $<" + make OS=aros-i386 clean + make OS=aros-i386 DEBUG= + @echo " CC $<" + make OS=aros-ppc clean + make OS=aros-ppc DEBUG= + @echo " CC $<" + make OS=aros-x86_64 clean + make OS=aros-x86_64 DEBUG= + +# make the object directories +$(OBJDIR): + @echo " MK $@" + @$(MKDIR) $(OBJDIR) + +# make the binary directories +$(BINDIR): + @echo " MK $@" + @$(MKDIR) $(BINDIR) + +# for compiling single .c files +$(OBJDIR)/%.o: %.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +$(OBJDIR)/mccclass_68k.o: ../include/mccclass_68k.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +# for linking the target +$(TARGET): $(M68KSTUBS) $(MCCOBJS) + @echo " LD $@.debug" + @$(CC) -nostartfiles $(LDFLAGS) -o $@.debug $(MCCOBJS) $(M68KSTUBS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +# for linking the target +$(TESTTARGET): $(TESTOBJS) + @echo " LD $@.debug" + @$(CC) $(LDFLAGS) -o $@.debug $(TESTOBJS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +.PHONY: dump +dump: + -$(OBJDUMP) --section-headers --all-headers --reloc --disassemble-all $(TARGET) >$(TARGET).dump + +.PHONY: clean +clean: + -$(RM) $(TARGET) $(TARGET).debug $(TARGET).map + -$(RM) $(TESTTARGET) $(TESTTARGET).debug $(TESTTARGET).map + -$(RM) $(MCCOBJS) $(TESTOBJS) $(M68KSTUBS) + +.PHONY: distclean +distclean: clean + -$(RMDIR) $(OBJDIR) + -$(RMDIR) $(BINDIR) + +# install +.PHONY: install +install: all + @echo " IN $(TARGET)" + @$(CP) $(TARGET) $(DESTDIR) + +.PHONY: help +help: + @echo "Cleaning targets:" + @echo " clean - Cleanup working directory for clean compile" + @echo " distclean - Also cleanup autogenerated files" + @echo "" + @echo "Other generic targets:" + @echo " all - Build $(TARGET)" + @echo " catalogs - Build all available catalogs" + @echo "" + @echo "Install targets:" + @echo " install - Install $(TARGET) into $(DESTDIR)" + @echo "" + @echo "Parameters:" + @echo " make OS=os3|os4|mos|aros-i386|aros-i686|aros-ppc|aros-x86_64" + @echo " make DEBUG= : build $(TARGET) without debugging information" + @echo "" + +## DEPENDENCY GENERATION ############## + +.PHONY: depend +depend: + @echo " MK $(DEPFILE)" + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >$(DEPFILE) + @$(CC) -MM -MG $(CFLAGS) $(wildcard *.c) >>$(DEPFILE) + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >>$(DEPFILE) + @$(SED) -i 's,^\(.*\)\.o:,$$\(OBJDIR\)/\1.o:,g' $(DEPFILE) + +# include dependencies file +-include $(DEPFILE) diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/Makefile.dep b/workbench/classes/zune/nlist/nbitmap_mcc/Makefile.dep new file mode 100644 index 0000000000..112f206bfa --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/Makefile.dep @@ -0,0 +1,43 @@ +# AUTOGENERATED! DO NOT EDIT!!! +$(OBJDIR)/Chunky2Bitmap.o: Chunky2Bitmap.c Chunky2Bitmap.h SetPatch.h private.h \ + ../include/libraries/mui.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h Debug.h NBitmap.h +$(OBJDIR)/Debug.o: Debug.c ../include/SDI_compiler.h Debug.h version.h +$(OBJDIR)/dispatcher.o: dispatcher.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h ../include/mui/NBitmap_mcc.h NBitmap.h \ + private.h ../include/mcc_common.h ../include/SDI_compiler.h \ + ../include/SDI_hook.h ../include/SDI_lib.h ../include/SDI_stdarg.h \ + Debug.h +$(OBJDIR)/DitherImage.o: DitherImage.c ../include/mui/NBitmap_mcc.h private.h \ + ../include/libraries/mui.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h Debug.h NBitmap.h DitherImage.h +$(OBJDIR)/library.o: library.c Debug.h SetPatch.h private.h \ + ../include/libraries/mui.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h NBitmap.h version.h ../include/mccinit.c \ + ../include/proto/muimaster.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h +$(OBJDIR)/NBitmap.o: NBitmap.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h ../include/mui/NBitmap_mcc.h private.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h Debug.h NBitmap.h \ + Chunky2Bitmap.h DitherImage.h version.h +$(OBJDIR)/NBitmap-Test.o: NBitmap-Test.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h ../include/mui/NBitmap_mcc.h private.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h Debug.h NBitmap.h +$(OBJDIR)/SetPatch.o: SetPatch.c +$(OBJDIR)/vastubs.o: vastubs.c +$(OBJDIR)/WritePixelArrayAlpha.o: WritePixelArrayAlpha.c private.h \ + ../include/libraries/mui.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h Debug.h NBitmap.h +$(OBJDIR)/WritePixelArray.o: WritePixelArray.c private.h ../include/libraries/mui.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h Debug.h NBitmap.h +# AUTOGENERATED! DO NOT EDIT!!! diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/NBitmap-Test.c b/workbench/classes/zune/nlist/nbitmap_mcc/NBitmap-Test.c new file mode 100644 index 0000000000..d04fd7bcf7 --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/NBitmap-Test.c @@ -0,0 +1,247 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2007-2010 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + TextEditor class Support Site: http://www.sf.net/projects/texteditor-mcc + + $Id$ + +***************************************************************************/ + +#include <libraries/iffparse.h> + +#include <proto/exec.h> +#include <proto/dos.h> +#include <proto/intuition.h> +#include <proto/muimaster.h> +#include <proto/utility.h> +#include <proto/graphics.h> +#include <proto/cybergraphics.h> +#include <proto/datatypes.h> +#include <mui/NBitmap_mcc.h> + +#include "private.h" + +#if defined(__amigaos4__) +struct Library *IntuitionBase = NULL; +struct Library *UtilityBase = NULL; +struct Library *GfxBase = NULL; +struct Library *DataTypesBase = NULL; +struct Library *MUIMasterBase = NULL; +#else +struct IntuitionBase *IntuitionBase = NULL; +#if defined(__AROS__) +struct UtilityBase *UtilityBase = NULL; +#else +struct Library *UtilityBase = NULL; +#endif +struct GfxBase *GfxBase = NULL; +struct Library *CyberGfxBase = NULL; +struct Library *DataTypesBase = NULL; +struct Library *MUIMasterBase = NULL; +#endif + +#if defined(__amigaos4__) +struct IntuitionIFace *IIntuition = NULL; +struct UtilityIFace *IUtility = NULL; +struct GraphicsIFace *IGraphics = NULL; +struct DataTypesIFace *IDataTypes = NULL; +struct MUIMasterIFace *IMUIMaster = NULL; +#endif + +const unsigned long icon32_normal[] = { + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x49da7d7f, 0xebd87e80, 0xffd5856b, 0xc5c3725d, 0x37bb5e4f, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x31e68689, 0xd0df8484, 0xffd37979, 0xffbf6566, 0xffb55a5d, 0xffb96547, 0x38b05341, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x59e0b86a, 0xbcda7b81, 0xffe48b8a, 0xffd37979, 0xffc16767, 0xffae5454, 0xffa44a4d, 0xc5994339, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x6cecdb5c, 0xffe6ce73, 0xffca786b, 0xffd07477, 0xffd27877, 0xffc26868, 0xffb05656, 0xff9b4142, 0xff984336, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x6dffff00, 0xffede049, 0xffe9d876, 0xffd2a861, 0xffb66057, 0xffbf6366, 0xffba6060, 0xffa64c4c, 0xff9b4141, 0xec923839, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x66ffff00, 0xf9ffff00, 0xfff6e829, 0xffe0c657, 0xffdbbf5a, 0xffc5904b, 0xffac5949, 0xffa3474b, 0xff9a4040, 0xd1923838, 0x49892c2e, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x57ffff00, 0xe9ffff00, 0xfffbf117, 0xfffaf127, 0xffefd627, 0xffcea545, 0xffcca03d, 0xffae6d2b, 0xff974033, 0xba903438, 0x308a2a2e, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x45ffff00, 0xdbffff00, 0xfffbf118, 0xfff9f02a, 0xfff9e51c, 0xfff4c904, 0xffd7a40d, 0xffb77c25, 0xffa76522, 0xff994d1c, 0x5b8b3619, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x33ffff04, 0xccfdf821, 0xfff9ee26, 0xfff9f029, 0xfff9e51c, 0xfff4c706, 0xffddaa00, 0xffb38200, 0xff895407, 0xfc874012, 0x6e87310f, 0x05560000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x21ffff0a, 0xbafdfa1f, 0xfff9ef29, 0xfff9ef27, 0xfff9e41b, 0xfff5c804, 0xffddaa00, 0xffb58300, 0xff7e4d00, 0xf5611c00, 0x765c0000, 0x12000000, 0x0f000000, 0x0a000000, 0x05000000, 0x01000000, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x04fff400, 0x89fdf318, 0xfff9ed27, 0xfff8ed27, 0xfff9e51c, 0xfff5c805, 0xffdfad00, 0xffb58300, 0xff7e4c00, 0xec601d00, 0x77550000, 0x23000000, 0x24000000, 0x22000000, 0x1d000000, 0x12000000, 0x06000000, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x3bffd056, 0xe8f6c940, 0xffebc243, 0xfff5d722, 0xfff7cd03, 0xffdfab00, 0xffb58300, 0xff7d4c00, 0xe25f1e00, 0x734a0000, 0x2f000000, 0x30000000, 0x2f000000, 0x2b000000, 0x24000000, 0x16000000, 0x08000000, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x06ffccb8, 0x9df9be82, 0xffe8ab76, 0xffd29658, 0xffdaa61f, 0xffd8a506, 0xffb48201, 0xff7f4f00, 0xd95b1c00, 0x6f3c0000, 0x3c000000, 0x3c000000, 0x39000000, 0x30000000, 0x24000000, 0x18000000, 0x0c000000, 0x04000000, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x3bfabb83, 0xeee9ac71, 0xffd1955a, 0xffb77b40, 0xffa96e2d, 0xffa26c13, 0xff804f02, 0xcf5d2100, 0x6b2d0000, 0x46000000, 0x42000000, 0x3b000000, 0x2f000000, 0x21000000, 0x11000000, 0x06000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x01ffffff, 0xa1f1ac66, 0xffd29558, 0xffb2763a, 0xff9d6427, 0xff90581e, 0xf285510c, 0xad562600, 0x671e0000, 0x4a000000, 0x41000000, 0x34000000, 0x26000000, 0x17000000, 0x0b000000, 0x03000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x44777372, 0xf59e7c5c, 0xffa36d36, 0xff945b1e, 0xf6865015, 0xbf6a3e0e, 0x7f3b2304, 0x55090000, 0x45000000, 0x37000000, 0x27000000, 0x18000000, 0x0b000000, 0x03000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x06000000, 0xb45f6162, 0xff4c4b49, 0xf85e4120, 0xc073420a, 0x7a3b2106, 0x53100701, 0x42000000, 0x35000000, 0x25000000, 0x17000000, 0x0a000000, 0x02000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x09000000, 0xfc494949, 0xc0242427, 0x7607060f, 0x420c0300, 0x2f000000, 0x24000000, 0x1c000000, 0x12000000, 0x06000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x06000000, 0x15000000, 0x20000000, 0x1f000000, 0x15000000, 0x0a000000, 0x02000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, +}; +const unsigned long icon32_selected[] = { + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x7320396e, 0xec304e89, 0xff3f5d99, 0xff4664a0, 0xff3f5d99, 0xec304e89, 0x7320396e, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0xac2b4479, 0xff43619d, 0xff5775b1, 0xff617fbb, 0xff5775b1, 0xff43619d, 0xac2b4479, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xcd314b80, 0xff4e6ca8, 0xff6a88c4, 0xff7d9bd7, 0xff6a88c4, 0xff4e6ca8, 0xcd314b80, 0x2a000000, 0x00ff00ff, 0x04000000, 0x64000000, 0x07000000, 0x03000000, 0x48000000, 0x03000000, 0x00ff00ff, 0x03000000, 0x4c000000, 0x03000000, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xe538558d, 0xff516fab, 0xff6f8dc9, 0xff89a7e3, 0xff6f8dc9, 0xff516fab, 0xe538558d, 0x2a000000, 0x00ff00ff, 0x0b000000, 0x84000000, 0x0e000000, 0x09000000, 0x67000000, 0x3d000000, 0x72000000, 0x4c000000, 0xa5000000, 0x5b000000, 0x03000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xfb3e5b98, 0xff4a68a4, 0xff6785c0, 0xff7f9ddb, 0xff6785c0, 0xff4a68a4, 0xfb3e5b98, 0x2a000000, 0x00ff00ff, 0x12000000, 0x88000000, 0x15000000, 0x0f000000, 0x80000000, 0x40000000, 0x87000000, 0x58000000, 0x87000000, 0x17000000, 0x03000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff22417e, 0xff38548c, 0xff687a9e, 0xff97a9ce, 0xff687a9e, 0xff38548c, 0xff22417e, 0x2a000000, 0x00ff00ff, 0x14000000, 0x8b000000, 0x80000000, 0x6d000000, 0x86000000, 0x52000000, 0x71000000, 0x8a000000, 0x74000000, 0x6a000000, 0x08000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff102f6b, 0xff23417c, 0xff334771, 0xff41506d, 0xff334771, 0xff23417c, 0xff102f6b, 0x2a000000, 0x00ff00ff, 0x0d000000, 0x13000000, 0x18000000, 0x17000000, 0x16000000, 0x1d000000, 0x22000000, 0x20000000, 0x19000000, 0x0f000000, 0x04000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0x38000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x38000000, 0x1b000000, 0x00ff00ff, 0x06000000, 0x0c000000, 0x11000000, 0x11000000, 0x0d000000, 0x0e000000, 0x0d000000, 0x10000000, 0x0f000000, 0x09000000, 0x04000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x1b000000, 0x2a000000, 0x2a000000, 0xb9000000, 0x2a000000, 0x2a000000, 0x1b000000, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x7320396e, 0xec304e89, 0xff3f5d99, 0xff4664a0, 0xff3f5d99, 0xec304e89, 0x7320396e, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0xab000000, 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0xac2b4479, 0xff43619d, 0xff5775b1, 0xff617fbb, 0xff5775b1, 0xff43619d, 0xac2b4479, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xcd314b80, 0xff4e6ca8, 0xff6a88c4, 0xff7d9bd7, 0xff6a88c4, 0xff4e6ca8, 0xcd314b80, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0xab000000, 0x00ff00ff, 0xab000000, 0x2a000000, 0xe538558d, 0xff516fab, 0xff6f8dc9, 0xff89a7e3, 0xff6f8dc9, 0xff516fab, 0xe538558d, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xfb3e5b98, 0xff4a68a4, 0xff6785c0, 0xff7f9ddb, 0xff6785c0, 0xff4a68a4, 0xfb3e5b98, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff22417e, 0xff38548c, 0xff687a9e, 0xff97a9ce, 0xff687a9e, 0xff38548c, 0xff22417e, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff102f6b, 0xff23417c, 0xff334771, 0xff41506d, 0xff334771, 0xff23417c, 0xff102f6b, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0x38000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x38000000, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x1b000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x1b000000, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, +}; + +#define ICON32_WIDTH 24 +#define ICON32_HEIGHT 20 +#define ICON32_DEPTH 32 + +DISPATCHERPROTO(_Dispatcher); + +int main(void) +{ + if((IntuitionBase = (APTR)OpenLibrary("intuition.library", 36)) && + GETINTERFACE(IIntuition, IntuitionBase)) + { + #if defined(DEBUG) + SetupDebug(); + #endif + + if((UtilityBase = (APTR)OpenLibrary("utility.library", 36)) && + GETINTERFACE(IUtility, UtilityBase)) + { + if((GfxBase = (APTR)OpenLibrary("graphics.library", 36)) && + GETINTERFACE(IGraphics, GfxBase)) + { + if((DataTypesBase = OpenLibrary("datatypes.library", 36)) && + GETINTERFACE(IDataTypes, DataTypesBase)) + { + if((MUIMasterBase = OpenLibrary("muimaster.library", 19)) && + GETINTERFACE(IMUIMaster, MUIMasterBase)) + { + struct MUI_CustomClass *mcc; + + #if !defined(__amigaos4__) + // don't check for success, we can live without it + CyberGfxBase = OpenLibrary("cybergraphics.library", 40); + #endif + + mcc = MUI_CreateCustomClass(NULL, "Area.mui", NULL, sizeof(struct InstData), ENTRY(_Dispatcher)); + + if(mcc != NULL) + { + Object *app, *window; + const char * const classes[] = { "NBitmap.mcc", NULL }; + + app = MUI_NewObject("Application.mui", + MUIA_Application_Author, "NBitmap.mcc Open Source Team", + MUIA_Application_Base, "NBitmap-Test", + MUIA_Application_Copyright, "(c) 2007-2010 NBitmap.mcc Open Source Team", + MUIA_Application_Description, "NBitmap.mcc test program", + MUIA_Application_Title, "NBitmap-Test", + MUIA_Application_Version, "$VER: NBitmap-Test (" __DATE__ ")", + MUIA_Application_UsedClasses, classes, + + MUIA_Application_Window, + window = WindowObject, + MUIA_Window_Title, "NBitmap-Test", + MUIA_Window_ID, MAKE_ID('M','A','I','N'), + MUIA_Window_RootObject, VGroup, + Child, HGroup, + Child, NewObject(mcc->mcc_Class, NULL, + MUIA_NBitmap_Type, MUIV_NBitmap_Type_File, + MUIA_NBitmap_Normal, "PROGDIR:icon.png", + MUIA_NBitmap_Label, "Music", + MUIA_NBitmap_Button, TRUE, + End, + Child, NewObject(mcc->mcc_Class, NULL, + MUIA_NBitmap_Width, ICON32_WIDTH, + MUIA_NBitmap_Height, ICON32_HEIGHT, + MUIA_NBitmap_Type, MUIV_NBitmap_Type_ARGB32, + MUIA_NBitmap_Normal, icon32_normal, + MUIA_NBitmap_Selected, icon32_selected, + MUIA_NBitmap_Label, "ICON32", + MUIA_NBitmap_Button, TRUE, + End, + Child, RectangleObject, End, + End, + Child, RectangleObject, End, + End, + End, + End; + + if(app != NULL) + { + ULONG sigs = 0; + + DoMethod(window, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit); + + set(window, MUIA_Window_Open, TRUE); + + while((LONG)DoMethod(app, MUIM_Application_NewInput, &sigs) != (LONG)MUIV_Application_ReturnID_Quit) + { + if(sigs) + { + sigs = Wait(sigs | SIGBREAKF_CTRL_C); + + if(sigs & SIGBREAKF_CTRL_C) + break; + } + } + + MUI_DisposeObject(app); + } + else + PutStr("Failed to create application\n"); + + MUI_DeleteCustomClass(mcc); + } + + #if !defined(__amigaos4__) + if(CyberGfxBase != NULL) + { + CloseLibrary(CyberGfxBase); + CyberGfxBase = NULL; + } + #endif + + DROPINTERFACE(IMUIMaster); + CloseLibrary(MUIMasterBase); + MUIMasterBase = NULL; + } + + DROPINTERFACE(IDataTypes); + CloseLibrary(DataTypesBase); + DataTypesBase = NULL; + } + + DROPINTERFACE(IGraphics); + CloseLibrary((struct Library *)GfxBase); + GfxBase = NULL; + } + + DROPINTERFACE(IUtility); + CloseLibrary((struct Library *)UtilityBase); + UtilityBase = NULL; + } + + DROPINTERFACE(IIntuition); + CloseLibrary((struct Library *)IntuitionBase); + IntuitionBase = NULL; + } + + return 0; +} diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/NBitmap.c b/workbench/classes/zune/nlist/nbitmap_mcc/NBitmap.c new file mode 100644 index 0000000000..14b0bfccca --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/NBitmap.c @@ -0,0 +1,1262 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007-2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +// ansi includes +#include <string.h> + +// system includes +#include <proto/exec.h> +#include <proto/datatypes.h> +#include <proto/graphics.h> +#include <proto/muimaster.h> +#include <proto/intuition.h> +#include <mui/NBitmap_mcc.h> + +// system +#include <datatypes/pictureclass.h> + +#if defined(__amigaos4__) +#include <graphics/blitattr.h> +#else +#include <proto/cybergraphics.h> +#include <cybergraphx/cybergraphics.h> +#endif + +#if defined(__MORPHOS__) +#include <exec/execbase.h> +#include <exec/system.h> +#endif + +// libraries +#include <libraries/mui.h> + +// local includes +#include "private.h" +#include "NBitmap.h" +#include "Chunky2Bitmap.h" +#include "DitherImage.h" +#include "version.h" +#include "Debug.h" + +// constant data +/// default color map +const uint32 defaultColorMap[256] = +{ + 0x00000000, 0x00000055, 0x000000aa, 0x000000ff, 0x00002400, 0x00002455, 0x000024aa, 0x000024ff, 0x00004900, 0x00004955, 0x000049aa, 0x000049ff, 0x00006d00, 0x00006d55, 0x00006daa, 0x00006dff, + 0x00009200, 0x00009255, 0x000092aa, 0x000092ff, 0x0000b600, 0x0000b655, 0x0000b6aa, 0x0000b6ff, 0x0000db00, 0x0000db55, 0x0000dbaa, 0x0000dbff, 0x0000ff00, 0x0000ff55, 0x0000ffaa, 0x0000ffff, + 0x00240000, 0x00240055, 0x002400aa, 0x002400ff, 0x00242400, 0x00242455, 0x002424aa, 0x002424ff, 0x00244900, 0x00244955, 0x002449aa, 0x002449ff, 0x00246d00, 0x00246d55, 0x00246daa, 0x00246dff, + 0x00249200, 0x00249255, 0x002492aa, 0x002492ff, 0x0024b600, 0x0024b655, 0x0024b6aa, 0x0024b6ff, 0x0024db00, 0x0024db55, 0x0024dbaa, 0x0024dbff, 0x0024ff00, 0x0024ff55, 0x0024ffaa, 0x0024ffff, + 0x00490000, 0x00490055, 0x004900aa, 0x004900ff, 0x00492400, 0x00492455, 0x004924aa, 0x004924ff, 0x00494900, 0x00494955, 0x004949aa, 0x004949ff, 0x00496d00, 0x00496d55, 0x00496daa, 0x00496dff, + 0x00499200, 0x00499255, 0x004992aa, 0x004992ff, 0x0049b600, 0x0049b655, 0x0049b6aa, 0x0049b6ff, 0x0049db00, 0x0049db55, 0x0049dbaa, 0x0049dbff, 0x0049ff00, 0x0049ff55, 0x0049ffaa, 0x0049ffff, + 0x006d0000, 0x006d0055, 0x006d00aa, 0x006d00ff, 0x006d2400, 0x006d2455, 0x006d24aa, 0x006d24ff, 0x006d4900, 0x006d4955, 0x006d49aa, 0x006d49ff, 0x006d6d00, 0x006d6d55, 0x006d6daa, 0x006d6dff, + 0x006d9200, 0x006d9255, 0x006d92aa, 0x006d92ff, 0x006db600, 0x006db655, 0x006db6aa, 0x006db6ff, 0x006ddb00, 0x006ddb55, 0x006ddbaa, 0x006ddbff, 0x006dff00, 0x006dff55, 0x006dffaa, 0x006dffff, + 0x00920000, 0x00920055, 0x009200aa, 0x009200ff, 0x00922400, 0x00922455, 0x009224aa, 0x009224ff, 0x00924900, 0x00924955, 0x009249aa, 0x009249ff, 0x00926d00, 0x00926d55, 0x00926daa, 0x00926dff, + 0x00929200, 0x00929255, 0x009292aa, 0x009292ff, 0x0092b600, 0x0092b655, 0x0092b6aa, 0x0092b6ff, 0x0092db00, 0x0092db55, 0x0092dbaa, 0x0092dbff, 0x0092ff00, 0x0092ff55, 0x0092ffaa, 0x0092ffff, + 0x00b60000, 0x00b60055, 0x00b600aa, 0x00b600ff, 0x00b62400, 0x00b62455, 0x00b624aa, 0x00b624ff, 0x00b64900, 0x00b64955, 0x00b649aa, 0x00b649ff, 0x00b66d00, 0x00b66d55, 0x00b66daa, 0x00b66dff, + 0x00b69200, 0x00b69255, 0x00b692aa, 0x00b692ff, 0x00b6b600, 0x00b6b655, 0x00b6b6aa, 0x00b6b6ff, 0x00b6db00, 0x00b6db55, 0x00b6dbaa, 0x00b6dbff, 0x00b6ff00, 0x00b6ff55, 0x00b6ffaa, 0x00b6ffff, + 0x00db0000, 0x00db0055, 0x00db00aa, 0x00db00ff, 0x00db2400, 0x00db2455, 0x00db24aa, 0x00db24ff, 0x00db4900, 0x00db4955, 0x00db49aa, 0x00db49ff, 0x00db6d00, 0x00db6d55, 0x00db6daa, 0x00db6dff, + 0x00db9200, 0x00db9255, 0x00db92aa, 0x00db92ff, 0x00dbb600, 0x00dbb655, 0x00dbb6aa, 0x00dbb6ff, 0x00dbdb00, 0x00dbdb55, 0x00dbdbaa, 0x00dbdbff, 0x00dbff00, 0x00dbff55, 0x00dbffaa, 0x00dbffff, + 0x00ff0000, 0x00ff0055, 0x00ff00aa, 0x00ff00ff, 0x00ff2400, 0x00ff2455, 0x00ff24aa, 0x00ff24ff, 0x00ff4900, 0x00ff4955, 0x00ff49aa, 0x00ff49ff, 0x00ff6d00, 0x00ff6d55, 0x00ff6daa, 0x00ff6dff, + 0x00ff9200, 0x00ff9255, 0x00ff92aa, 0x00ff92ff, 0x00ffb600, 0x00ffb655, 0x00ffb6aa, 0x00ffb6ff, 0x00ffdb00, 0x00ffdb55, 0x00ffdbaa, 0x00ffdbff, 0x00ffff00, 0x00ffff55, 0x00ffffaa, 0x00ffffff +}; + +/// + +#if defined(__MORPHOS__) || defined(__AROS__) +// MorphOS and AROS always have working WPA() and WPAA() functions +#define WPA(src, srcx, srcy, srcmod, rp, destx, desty, width, height, fmt) \ + WritePixelArray(src, srcx, srcy, srcmod, rp, destx, desty, width, height, fmt) +#define WPAA(src, srcx, srcy, srcmod, rp, destx, desty, width, height, globalalpha) \ + WritePixelArrayAlpha(src, srcx, srcy, srcmod, rp, destx, desty, width, height, globalalpha) +#elif !defined(__amigaos4__) +// for AmigaOS3 this is only true for CGX V43+ +#define WPA(src, srcx, srcy, srcmod, rp, destx, desty, width, height, fmt) \ +{ \ + if(CyberGfxBase != NULL) \ + WritePixelArray(src, srcx, srcy, srcmod, rp, destx, desty, width, height, fmt); \ + else \ + _WPA(src, srcx, srcy, srcmod, rp, destx, desty, width, height, fmt); \ +} +#define WPAA(src, srcx, srcy, srcmod, rp, destx, desty, width, height, globalalpha) \ +{ \ + if(CyberGfxBase != NULL && CyberGfxBase->lib_Version >= 43) \ + WritePixelArrayAlpha(src, srcx, srcy, srcmod, rp, destx, desty, width, height, globalalpha); \ + else \ + _WPAA(src, srcx, srcy, srcmod, rp, destx, desty, width, height, globalalpha); \ +} +#endif + +// functions +/// GetConfigItem() +// +ULONG GetConfigItem(Object *obj, ULONG configitem, ULONG defaultsetting) +{ + IPTR value; + ULONG result = defaultsetting; + + ENTER(); + + if(DoMethod(obj, MUIM_GetConfigItem, configitem, &value)) + result = *(ULONG *)value; + + /* XXX: On 64-bit AROS I'm getting for the line above the warning "cast to pointer from integer of different size". */ + + RETURN(result); + return result; +} + +/// +/// InitConfig() +// +static void InitConfig(Object *obj, struct InstData *data) +{ + ENTER(); + + if(obj != NULL && data != NULL) + { + data->prefs.show_label = 0; + data->prefs.overlay_type = 0; + data->prefs.overlay_r = 10; + data->prefs.overlay_g = 36; + data->prefs.overlay_b = 106; + data->prefs.overlay_shadeover = 1500; // = 1.5 if divided by 1000 + data->prefs.overlay_shadepress = 2500; // = 2.5 if divided by 1000 + data->prefs.spacing_horiz = 2; + data->prefs.spacing_vert = 2; + } + + LEAVE(); +} + +/// +/// FreeConfig() +// +static void FreeConfig(struct InstData *data) +{ + ENTER(); + + if(data != NULL) + { + // nothing yet + } + + LEAVE(); +} + +/// +/// NBitmap_LoadImage() +// +BOOL NBitmap_LoadImage(STRPTR filename, uint32 item, struct IClass *cl, Object *obj) +{ + BOOL result = FALSE; + struct InstData *data; + + ENTER(); + + SHOWSTRING(DBF_DATATYPE, filename); + + if((data = INST_DATA(cl, obj)) != NULL && filename != NULL) + { + data->dt_obj[item] = NewDTObject(filename, + DTA_GroupID, GID_PICTURE, + OBP_Precision, PRECISION_EXACT, + PDTA_FreeSourceBitMap, TRUE, + PDTA_DestMode, PMODE_V43, + PDTA_UseFriendBitMap, TRUE, + TAG_DONE); + SHOWVALUE(DBF_DATATYPE, data->dt_obj[item]); + if(data->dt_obj[item] != NULL) + result = TRUE; + } + + RETURN(result); + return result; +} + +/// +/// NBitmap_ExamineData() +// +static BOOL NBitmap_ExamineData(Object *dt_obj, uint32 item, struct IClass *cl, Object *obj) +{ + BOOL result = FALSE; + ULONG arraysize; + + struct pdtBlitPixelArray pbpa; + struct InstData *data = INST_DATA(cl, obj); + + if(dt_obj != NULL) + { + /* bitmap header */ + GetDTAttrs(dt_obj, PDTA_BitMapHeader, &data->dt_header[item], TAG_DONE); + D(DBF_DATATYPE, "examine: BMHD dimensions %ldx%ldx%ld", data->dt_header[item]->bmh_Width, data->dt_header[item]->bmh_Height, data->dt_header[item]->bmh_Depth); + data->depth = data->dt_header[item]->bmh_Depth; + + if(data->depth>0 && data->depth<=8) + { + /* colour lookup bitmap */ + data->fmt = PBPAFMT_LUT8; + + /* bitmap header */ + data->width = data->dt_header[0]->bmh_Width; + data->height = data->dt_header[0]->bmh_Height; + + result = TRUE; + D(DBF_DATATYPE, "examine: using LUT8 bitmaps"); + } + else if(data->depth >=24) + { + #if defined(__MORPHOS__) + /* XXX: Check out is this needed in OS 3 and AROS */ + IPTR use_alpha; + + GetDTAttrs(dt_obj, PDTA_AlphaChannel, (IPTR)&use_alpha, TAG_DONE); + + if (use_alpha) + data->depth = 32; + #endif + + /* true colour bitmap */ + if(data->depth == 24) + { + data->fmt = PBPAFMT_RGB; + D(DBF_DATATYPE, "examine: using 24bit RGB data"); + } + else if(data->depth == 32) + { + data->fmt = PBPAFMT_ARGB; + D(DBF_DATATYPE, "examine: using 32bit ARGB data"); + } + + data->width = data->dt_header[0]->bmh_Width; + data->height = data->dt_header[0]->bmh_Height; + data->arraybpp = data->depth/8; + data->arraybpr = data->arraybpp * data->width; + + #if defined(__MORPHOS__) + if (SysBase->LibNode.lib_Version >= 51) + { + ULONG altivec_align = 0; + + NewGetSystemAttrs(&altivec_align, sizeof(altivec_align), SYSTEMINFOTYPE_PPC_ALTIVEC, TAG_DONE); + + if (altivec_align) + data->arraybpr = (data->arraybpr + 15) & ~15; + } + #endif + + arraysize = (data->arraybpr) * data->height; + + /* get array of pixels */ + if((data->arraypixels[item] = AllocVec(arraysize, MEMF_ANY|MEMF_CLEAR)) != NULL) + { + ULONG error; + + memset(&pbpa, 0, sizeof(struct pdtBlitPixelArray)); + + pbpa.MethodID = PDTM_READPIXELARRAY; + pbpa.pbpa_PixelData = data->arraypixels[item]; + pbpa.pbpa_PixelFormat = data->fmt; + pbpa.pbpa_PixelArrayMod = data->arraybpr; + pbpa.pbpa_Left = 0; + pbpa.pbpa_Top = 0; + pbpa.pbpa_Width = data->width; + pbpa.pbpa_Height = data->height; + + error = DoMethodA(dt_obj, (Msg)(VOID*)&pbpa); + (void)error; + D(DBF_DATATYPE, "examine: READPIXELARRAY returned %ld", error); + + result = TRUE; + } + } + } + + return(result); +} + +/// +/// NBitmap_UpdateImage() +// +VOID NBitmap_UpdateImage(uint32 item, STRPTR filename, struct IClass *cl, Object *obj) +{ + struct InstData *data = NULL; + + if((data = INST_DATA(cl, obj)) != NULL) + { + if(filename != NULL) + { + if(data->dt_obj[item] != NULL) + { + /* free old image data */ + if(data->fmt == PBPAFMT_LUT8) + SetDTAttrs(data->dt_obj[item], NULL, NULL, PDTA_Screen, NULL, TAG_DONE); + + DisposeDTObject(data->dt_obj[item]); + data->dt_obj[item] = NULL; + + if(data->arraypixels[item] != NULL) + { + FreeVec(data->arraypixels[item]); + data->arraypixels[item] = NULL; + } + + /* load new image */ + if((NBitmap_LoadImage(filename, item, cl, obj)) != FALSE) + { + /* setup new image */ + if((NBitmap_ExamineData(data->dt_obj[item], item, cl, obj)) != FALSE) + { + if(data->fmt == PBPAFMT_LUT8) + { + /* layout image */ + SetDTAttrs(data->dt_obj[item], NULL, NULL, PDTA_Screen, _screen(obj), TAG_DONE); + if(DoMethod(data->dt_obj[item], DTM_PROCLAYOUT, NULL, 1)) + { + GetDTAttrs(data->dt_obj[item], PDTA_CRegs, &data->dt_colours[item], TAG_DONE); + GetDTAttrs(data->dt_obj[item], PDTA_MaskPlane, &data->dt_mask[item], TAG_DONE); + GetDTAttrs(data->dt_obj[item], PDTA_DestBitMap, &data->dt_bitmap[item], TAG_DONE); + + if(data->dt_bitmap[item] == NULL) GetDTAttrs(data->dt_obj[item], PDTA_BitMap, &data->dt_bitmap[item], TAG_DONE); + } + } + } + } + + } + } + } +} + +/// +/// NBitmap_SetupShades() +// create an ARGB shade +BOOL NBitmap_SetupShades(struct InstData *data) +{ + uint32 pixel, altivec_align; + + ENTER(); + + altivec_align = 0; + + #if defined(__MORPHOS__) + if (SysBase->LibNode.lib_Version >= 51) + { + NewGetSystemAttrs(&altivec_align, sizeof(altivec_align), SYSTEMINFOTYPE_PPC_ALTIVEC, TAG_DONE); + } + #endif + + data->shadeWidth = data->width + data->border_horiz - 2; + data->shadeHeight = data->height + data->border_vert - 2; + data->shadeBytesPerRow = data->shadeWidth * 4; + + if (altivec_align) + data->shadeBytesPerRow = (data->shadeBytesPerRow + 15) & ~15; + + // the shades pixel color + pixel = ((ULONG)data->prefs.overlay_r << 16) | ((ULONG)data->prefs.overlay_g << 8) | (ULONG)data->prefs.overlay_b; + + #if defined(__MORPHOS__) + if((data->pressedShadePixels = AllocVecAligned(data->shadeBytesPerRow * data->shadeHeight, MEMF_ANY, altivec_align ? 16 : 8, 0)) != NULL) + #else + if((data->pressedShadePixels = AllocVec(data->shadeBytesPerRow * data->shadeHeight, MEMF_ANY)) != NULL) + #endif + { + uint32 w, h; + uint32 alpha; + uint32 *p = data->pressedShadePixels; + + // calculate the alpha channel value + alpha = (255L - (((255L * 1000L) / (uint32)data->prefs.overlay_shadepress) & 0xff)) << 24; + + // fill the array with the pixel and alpha channel value + // the border will be the 100% opaque pixel color + for(h = 0; h < data->shadeHeight; h++) + { + for(w = 0; w < data->shadeWidth; w++) + { + if(h == 0 || h == data->shadeHeight-1 || w == 0 || w == data->shadeWidth-1) + *p++ = 0xff000000 | pixel; + else + *p++ = alpha | pixel; + } + + p += (data->shadeBytesPerRow - data->shadeWidth * 4) / 4; + } + } + + #if defined(__MORPHOS__) + if((data->overShadePixels = AllocVecAligned(data->shadeBytesPerRow * data->shadeHeight, MEMF_ANY, altivec_align ? 16 : 8, 0)) != NULL) + #else + if((data->overShadePixels = AllocVec(data->shadeBytesPerRow * data->shadeHeight, MEMF_ANY)) != NULL) + #endif + { + uint32 w, h; + uint32 alpha; + uint32 *p = data->overShadePixels; + + // calculate the alpha channel value + alpha = (255L - (((255L * 1000L) / (uint32)data->prefs.overlay_shadeover) & 0xff)) << 24; + + // fill the array with the pixel and alpha channel value + // the border will be the 100% opaque pixel color + for(h = 0; h < data->shadeHeight; h++) + { + for(w = 0; w < data->shadeWidth; w++) + { + if(h == 0 || h == data->shadeHeight-1 || w == 0 || w == data->shadeWidth-1) + *p++ = 0xff000000 | pixel; + else + *p++ = alpha | pixel; + } + + p += (data->shadeBytesPerRow - data->shadeWidth * 4) / 4; + } + } + + RETURN((data->pressedShadePixels != NULL && data->overShadePixels != NULL)); + return (data->pressedShadePixels != NULL && data->overShadePixels != NULL); +} + +/// +/// CleanupShades() +// delete the ARGB shades +void NBitmap_CleanupShades(struct InstData *data) +{ + ENTER(); + + if(data->pressedShadePixels != NULL) + { + FreeVec(data->pressedShadePixels); + data->pressedShadePixels = NULL; + } + if(data->overShadePixels != NULL) + { + FreeVec(data->overShadePixels); + data->overShadePixels = NULL; + } + + LEAVE(); +} + +/// +/// NBitmap_NewImage() +// +BOOL NBitmap_NewImage(struct IClass *cl, Object *obj) +{ + BOOL result = FALSE; + struct InstData *data; + + ENTER(); + + if((data = INST_DATA(cl, obj)) != NULL) + { + switch(data->type) + { + case MUIV_NBitmap_Type_File: + case MUIV_NBitmap_Type_DTObject: + { + if(data->dt_obj[0] != NULL) + { + ULONG i; + + // assume success for the moment + result = TRUE; + + for(i=0;i<3;i++) + { + if(data->dt_obj[i] != NULL) + result &= NBitmap_ExamineData(data->dt_obj[i], i, cl, obj); + } + } + } + break; + + case MUIV_NBitmap_Type_CLUT8: + case MUIV_NBitmap_Type_RGB24: + case MUIV_NBitmap_Type_ARGB32: + { + // no further requirements, instant success + result = TRUE; + } + break; + } + } + + RETURN(result); + return result; +} + +BOOL NBitmap_OldNewImage(struct IClass *cl, Object *obj) +{ + BOOL result = FALSE; + struct InstData *data; + + /* need at least the normal image */ + if((data = INST_DATA(cl, obj)) !=NULL && data->dt_obj[0] != NULL) + { + ULONG i; + + for(i = 0; i < 3; i++) + { + if(data->dt_obj[i] != NULL) + { + struct FrameInfo fri; + + memset(&fri, 0, sizeof(struct FrameInfo)); + DoMethod(data->dt_obj[0], DTM_FRAMEBOX, NULL, &fri, &fri, sizeof(struct FrameInfo), 0); + data->depth = fri.fri_Dimensions.Depth; + D(DBF_DATATYPE, "new: framebox dimensions %ldx%ldx%ld", fri.fri_Dimensions.Width, fri.fri_Dimensions.Height, fri.fri_Dimensions.Depth); + + if(data->maxwidth == 0 || (data->maxwidth <= data->dt_header[i]->bmh_Width)) + { + if(data->maxheight == 0 || (data->maxheight <= data->dt_header[i]->bmh_Height)) + { + if(data->depth > 0 && data->depth <= 8) + { + /* colour lookup bitmap */ + data->fmt = PBPAFMT_LUT8; + + /* bitmap header */ + GetDTAttrs(data->dt_obj[i], PDTA_BitMapHeader, &data->dt_header[i], TAG_DONE); + data->width = data->dt_header[0]->bmh_Width; + data->height = data->dt_header[0]->bmh_Height; + D(DBF_DATATYPE, "new: using LUT8 bitmaps"); + + result = TRUE; + } + else if(data->depth > 8) + { + ULONG arraysize; + + /* correct read buffer */ + if(data->depth == 24) + { + data->fmt = PBPAFMT_RGB; + D(DBF_DATATYPE, "new: using 24bit RGB data"); + } + else + { + data->fmt = PBPAFMT_ARGB; + D(DBF_DATATYPE, "new: using 32bit ARGB data"); + } + + /* bitmap header */ + GetDTAttrs(data->dt_obj[i], PDTA_BitMapHeader, &data->dt_header[i], TAG_DONE); + data->width = data->dt_header[0]->bmh_Width; + data->height = data->dt_header[0]->bmh_Height; + data->arraybpp = data->depth / 8; + data->arraybpr = data->arraybpp * data->width; + arraysize = (data->arraybpr) * data->height; + + /* get array of pixels */ + if((data->arraypixels[i] = AllocVec(arraysize, MEMF_ANY|MEMF_CLEAR)) != NULL) + { + ULONG error; + + error = DoMethod(data->dt_obj[i], PDTM_READPIXELARRAY, data->arraypixels[i], data->fmt, data->arraybpr, 0, 0, data->width, data->height); + (void)error; + D(DBF_DATATYPE, "new: READPIXELARRAY returned %ld", error); + + // finally create the shades + result = NBitmap_SetupShades(data); + } + } + } + } + } + } + } + + RETURN(result); + return result; +} + +/// +/// NBitmap_DisposeImage() +// +VOID NBitmap_DisposeImage(struct IClass *cl, Object *obj) +{ + struct InstData *data; + + ENTER(); + + if((data = INST_DATA(cl, obj)) != NULL) + { + ULONG i; + + /* free datatype object */ + if(data->type == MUIV_NBitmap_Type_File) + { + for(i =0 ; i < 3; i++) + { + SHOWVALUE(DBF_DATATYPE, data->dt_obj[i]); + if(data->dt_obj[i] != NULL) + { + DisposeDTObject(data->dt_obj[i]); + data->dt_obj[i] = NULL; + } + } + } + + if(data->label != NULL) + { + FreeVec(data->label); + data->label = NULL; + } + + /* free pixel memory */ + for(i = 0; i < 3; i++) + { + if(data->arraypixels[i] != NULL) + { + FreeVec(data->arraypixels[i]); + data->arraypixels[i] = NULL; + } + } + + NBitmap_CleanupShades(data); + } + + LEAVE(); +} + +/// +/// NBitmap_SetupImage() +// +BOOL NBitmap_SetupImage(struct IClass *cl, Object *obj) +{ + struct InstData *data; + BOOL result = FALSE; + + ENTER(); + + if((data = INST_DATA(cl, obj)) != NULL) + { + /* stored config */ + InitConfig(obj, data); + + data->scrdepth = GetBitMapAttr(_screen(obj)->RastPort.BitMap, BMA_DEPTH); + + /* input */ + if(data->button) + { + data->ehnode.ehn_Priority = 0; + data->ehnode.ehn_Flags = MUI_EHF_GUIMODE; + data->ehnode.ehn_Object = obj; + data->ehnode.ehn_Class = cl; + data->ehnode.ehn_Events = IDCMP_MOUSEBUTTONS | IDCMP_MOUSEMOVE; + + DoMethod(_win(obj), MUIM_Window_AddEventHandler, &data->ehnode); + } + + switch(data->type) + { + case MUIV_NBitmap_Type_File: + case MUIV_NBitmap_Type_DTObject: + { + + /* 8-bit data */ + if(data->fmt == PBPAFMT_LUT8 && data->dt_obj[0] != NULL) + { + ULONG i; + + /* layout image */ + for(i = 0; i < 3; i++) + { + // set the new screen for this object + SetDTAttrs(data->dt_obj[i], NULL, NULL, PDTA_Screen, _screen(obj), TAG_DONE); + if(DoMethod(data->dt_obj[i], DTM_PROCLAYOUT, NULL, 1)) + { + GetDTAttrs(data->dt_obj[i], PDTA_CRegs, &data->dt_colours[i], + PDTA_MaskPlane, &data->dt_mask[i], + PDTA_DestBitMap, &data->dt_bitmap[i], + TAG_DONE); + if(data->dt_bitmap[i] == NULL) + GetDTAttrs(data->dt_obj[i], PDTA_BitMap, &data->dt_bitmap[i], TAG_DONE); + SHOWVALUE(DBF_DATATYPE, data->dt_bitmap[i]); + } + } + + result = TRUE; + } + else if(data->depth > 8) + result = NBitmap_SetupShades(data); + } + break; + + case MUIV_NBitmap_Type_CLUT8: + case MUIV_NBitmap_Type_RGB24: + case MUIV_NBitmap_Type_ARGB32: + { + SHOWVALUE(DBF_ALWAYS, data->scrdepth); + // in case we are to be displayed on a colormapped screen we have to create + // dithered copies of the images + #if defined(__amigaos4__) + if(data->scrdepth <= 8) + #else + SHOWVALUE(DBF_ALWAYS, CyberGfxBase); + if(CyberGfxBase != NULL) + SHOWVALUE(DBF_ALWAYS, CyberGfxBase->lib_Version); + if(data->scrdepth <= 8 || CyberGfxBase == NULL) + #endif + { + ULONG i; + const uint32 *colorMap; + + // use a user definable colormap or the default color map + if(data->clut != NULL) + { + D(DBF_ALWAYS, "using user defined color map"); + colorMap = data->clut; + } + else + { + D(DBF_ALWAYS, "using default color map"); + colorMap = defaultColorMap; + } + + D(DBF_ALWAYS, "obtaining pens"); + // allocate all pens + for(i = 0; i < 256; i++) + { + data->ditherPenMap[i] = ObtainBestPen(_screen(obj)->ViewPort.ColorMap, ((colorMap[i] >> 16) & 0x000000ffUL) << 24, + ((colorMap[i] >> 8) & 0x000000ffUL) << 24, + ((colorMap[i] >> 0) & 0x000000ffUL) << 24, + OBP_Precision, PRECISION_IMAGE, + TAG_DONE); + if(data->ditherPenMap[i] == -1) + E(DBF_ALWAYS, "failed to obtain pen %ld RGB=%06lx", i, colorMap[i]); + } + + for(i = 0; i < 3; i++) + { + if(data->data[i] != NULL) + { + D(DBF_ALWAYS, "dithering image %ld", i); + // create a dithered copy of the raw image + data->ditheredImage[i] = DitherImage((CONST_APTR)data->data[i], DITHERA_Width, data->width, + DITHERA_Height, data->height, + DITHERA_Format, data->type, + DITHERA_ColorMap, (IPTR)colorMap, + DITHERA_PenMap, (IPTR)data->ditherPenMap, + DITHERA_MaskPlane, (IPTR)&data->ditheredMask[i], + TAG_DONE); + + #if !defined(__amigaos4__) + // CyberGraphics cannot blit raw data through a mask, thus we have to + // use this ugly workaround and take the detour using a bitmap. + D(DBF_ALWAYS, "setting up dithered bitmap %ld", i); + data->ditheredBitmap[i] = Chunky2Bitmap(data->ditheredImage[i], data->width, data->height, data->scrdepth); + #endif // !__amigaos4__ + } + } + } + // no further requirements, instant success + result = TRUE; + } + break; + } + } + + RETURN(result); + return result; +} + +/// +/// NBitmap_CleanupImage() +// +VOID NBitmap_CleanupImage(struct IClass *cl, Object *obj) +{ + struct InstData *data; + + ENTER(); + + if((data = INST_DATA(cl, obj)) != NULL) + { + // input + if(data->button) + DoMethod(_win(obj), MUIM_Window_RemEventHandler, &data->ehnode); + + switch(data->type) + { + case MUIV_NBitmap_Type_File: + case MUIV_NBitmap_Type_DTObject: + { + if(data->fmt == PBPAFMT_LUT8 && data->dt_obj[0] != NULL) + { + ULONG i; + + /* layout image */ + for(i = 0; i < 3; i++) + { + // reset the screen pointer + SetDTAttrs(data->dt_obj[i], NULL, NULL, PDTA_Screen, NULL, TAG_DONE); + } + } + } + break; + + case MUIV_NBitmap_Type_CLUT8: + case MUIV_NBitmap_Type_RGB24: + case MUIV_NBitmap_Type_ARGB32: + { + // nothing to do + ULONG i; + struct Screen *scr = _screen(obj); + + // free the possibly dithered image copies + for(i = 0; i < 3; i++) + { + #if !defined(__amigaos4__) + if(data->ditheredBitmap[i] != NULL) + { + D(DBF_ALWAYS, "freeing dithered bitmap %ld", i); + FreeBitMap(data->ditheredBitmap[i]); + data->ditheredBitmap[i] = NULL; + } + #endif // !__amigaos4__ + if(data->ditheredImage[i] != NULL) + { + D(DBF_ALWAYS, "freeing dithered image %ld", i); + FreeDitheredImage(data->ditheredImage[i], data->ditheredMask[i]); + data->ditheredImage[i] = NULL; + } + } + + // release all allocated pens + if(data->scrdepth <= 8) + { + D(DBF_ALWAYS, "releasing pens"); + for(i = 0; i < 256; i++) + { + if(data->ditherPenMap[i] != -1) + ReleasePen(scr->ViewPort.ColorMap, data->ditherPenMap[i]); + } + } + } + break; + } + + NBitmap_CleanupShades(data); + + // stored config + FreeConfig(data); + } + + LEAVE(); +} + +/// +/// NBitmap_DrawSimpleFrame() +// +static void NBitmap_DrawSimpleFrame(Object *obj, uint32 x, uint32 y, uint32 w, uint32 h) +{ + ENTER(); + + SetAPen(_rp(obj), _pens(obj)[MPEN_SHADOW]); + Move(_rp(obj), x, y+(h+1)); + Draw(_rp(obj), x, y); + Draw(_rp(obj), x+(w+1), y); + + SetAPen(_rp(obj), _pens(obj)[MPEN_SHINE]); + Draw(_rp(obj), x+(w+1), y+(h+1)); + Draw(_rp(obj), x, y+(h+1)); + + LEAVE(); +} + +/// +/// NBitmap_DrawImage() +// +void NBitmap_DrawImage(struct IClass *cl, Object *obj) +{ + struct InstData *data; + + ENTER(); + + if((data = INST_DATA(cl, obj)) != NULL) + { + LONG item; + ULONG x, y, twidth; + + /* coordinates */ + item = 0; + x = _left(obj); + y = _top(obj); + twidth = (data->width + data->border_horiz) - 2; /* subtract standard 1 pixel border */ + + // clear the background first, otherwise a multiply applied alpha channel + // will become darker and darker every time + if(data->button != FALSE) + DoMethod(obj, MUIM_DrawBackground, _mleft(obj), _mtop(obj), _mwidth(obj), _mheight(obj), _left(obj), _top(obj), 0); + + /* label */ + if(data->label != NULL && data->button != FALSE) + { + uint32 labelx; + + SetFont(_rp(obj), _font(obj)); + SetAPen(_rp(obj), 1); + + labelx = (twidth/2) - (data->labelte.te_Width/2); + + Move(_rp(obj), x + labelx, _bottom(obj) - 3); + Text(_rp(obj), data->label, strlen(data->label)); + } + + /* draw image */ + switch(data->type) + { + case MUIV_NBitmap_Type_File: + case MUIV_NBitmap_Type_DTObject: + { + if(data->dt_obj[0] != NULL) + { + if(data->fmt == PBPAFMT_LUT8) + { + #if defined(__amigaos4__) + uint32 error; + #endif + + /* select bitmap */ + if(data->button && data->pressed && data->overlay && data->dt_bitmap[2]) + item = 2; + + SHOWVALUE(DBF_DRAW, item); + SHOWVALUE(DBF_DRAW, data->dt_bitmap[item]); + SHOWVALUE(DBF_DRAW, data->dt_mask[item]); + + #if defined(__amigaos4__) + error = BltBitMapTags(BLITA_Source, data->dt_bitmap[item], + BLITA_Dest, _rp(obj), + BLITA_SrcX, 0, + BLITA_SrcY, 0, + BLITA_DestX, x + (data->border_horiz / 2), + BLITA_DestY, y + ((data->border_vert / 2) - (data->label_vert/2)), + BLITA_Width, data->width, + BLITA_Height, data->height, + BLITA_SrcType, BLITT_BITMAP, + BLITA_DestType, BLITT_RASTPORT, + BLITA_MaskPlane, data->dt_mask[item], + TAG_DONE); + SHOWVALUE(DBF_DRAW, error); + + #else + + if(data->dt_mask[item] != NULL) + { + BltMaskBitMapRastPort(data->dt_bitmap[item], 0, 0, _rp(obj), + _left(obj) + (data->border_horiz / 2), + _top(obj) + (data->border_vert / 2), + data->width, + data->height, + 0xc0, + (APTR)data->dt_mask[item]); + } + else + { + BltBitMapRastPort(data->dt_bitmap[item], 0, 0, _rp(obj), + _left(obj) + (data->border_horiz / 2), + _top(obj) + (data->border_vert / 2), + data->width, + data->height, + 0xc0); + } + #endif + } + else + { + /* select bitmap */ + if(data->button && data->pressed && data->overlay && data->arraypixels[2] != NULL) + item = 2; + + SHOWVALUE(DBF_DRAW, item); + SHOWVALUE(DBF_DRAW, data->arraypixels[item]); + + if(data->arraypixels[item] != NULL) + { + #if defined(__amigaos4__) + int32 srctype; + uint32 error; + + if(data->depth == 24) + srctype = BLITT_RGB24; + else + srctype = BLITT_ARGB32; + + error = BltBitMapTags(BLITA_Source, data->arraypixels[item], + BLITA_Dest, _rp(obj), + BLITA_SrcX, 0, + BLITA_SrcY, 0, + BLITA_DestX, x + (data->border_horiz / 2), + BLITA_DestY, y + ((data->border_vert / 2) - (data->label_vert/2)), + BLITA_Width, data->width, + BLITA_Height, data->height, + BLITA_SrcType, srctype, + BLITA_DestType, BLITT_RASTPORT, + BLITA_SrcBytesPerRow, data->arraybpr, + BLITA_UseSrcAlpha, TRUE, + TAG_DONE); + + SHOWVALUE(DBF_DRAW, error); + + #else + + if(data->depth == 24) + { + WPA(data->arraypixels[item], 0, 0, data->arraybpr, _rp(obj), _left(obj) + (data->border_horiz / 2), _top(obj) + (data->border_vert / 2), data->width, data->height, RECTFMT_RGB); + } + else + { + WPAA(data->arraypixels[item], 0, 0, data->arraybpr, _rp(obj), _left(obj) + (data->border_horiz / 2), _top(obj) + (data->border_vert / 2), data->width, data->height, 0xffffffff); + } + + #endif + } + } + } + } + break; + + case MUIV_NBitmap_Type_CLUT8: + case MUIV_NBitmap_Type_RGB24: + case MUIV_NBitmap_Type_ARGB32: + { + int w = min((uint32)_mwidth (obj), data->width ); + int h = min((uint32)_mheight(obj), data->height); + + /* select bitmap */ + if(data->button && data->pressed && data->overlay && data->data[2] != NULL) + item = 2; + + SHOWVALUE(DBF_ALWAYS, data->scrdepth); + SHOWVALUE(DBF_ALWAYS, data->ditheredImage[item]); + SHOWVALUE(DBF_ALWAYS, data->ditheredMask[item]); + #if !defined(__amigaos4__) + SHOWVALUE(DBF_ALWAYS, data->ditheredBitmap[item]); + #endif + + if(data->data[item] != NULL) + { + #if defined(__amigaos4__) + if(data->scrdepth <= 8 && data->ditheredImage[item] != NULL) + { + if(data->ditheredMask[item] != NULL) + { + D(DBF_ALWAYS, "drawing remapped/dithered image with mask"); + BltBitMapTags(BLITA_Source, data->ditheredImage[item], + BLITA_Dest, _rp(obj), + BLITA_SrcX, 0, + BLITA_SrcY, 0, + BLITA_DestX, x + (data->border_horiz / 2), + BLITA_DestY, y + ((data->border_vert / 2) - (data->label_vert/2)), + BLITA_Width, w, + BLITA_Height, h, + BLITA_SrcType, BLITT_CHUNKY, + BLITA_DestType, BLITT_RASTPORT, + BLITA_SrcBytesPerRow, data->width, + BLITA_MaskPlane, data->ditheredMask[item], + BLITA_Minterm, (ABC|ABNC|ANBC), + TAG_DONE); + } + else + { + D(DBF_ALWAYS, "drawing remapped/dithered image without mask"); + BltBitMapTags(BLITA_Source, data->ditheredImage[item], + BLITA_Dest, _rp(obj), + BLITA_SrcX, 0, + BLITA_SrcY, 0, + BLITA_DestX, x + (data->border_horiz / 2), + BLITA_DestY, y + ((data->border_vert / 2) - (data->label_vert/2)), + BLITA_Width, w, + BLITA_Height, h, + BLITA_SrcType, BLITT_CHUNKY, + BLITA_DestType, BLITT_RASTPORT, + BLITA_SrcBytesPerRow, data->width, + BLITA_Minterm, (ABC|ABNC), + TAG_DONE); + } + } + #else // __amigaos4__ + if((data->scrdepth <= 8 || CyberGfxBase == NULL) && data->ditheredBitmap[item] != NULL) + { + // CyberGraphics cannot blit raw data through a mask, thus we have to + // take this ugly workaround and take the detour using a bitmap. + if(data->ditheredMask[item] != NULL) + { + D(DBF_ALWAYS, "drawing remapped/dithered image with mask"); + BltMaskBitMapRastPort(data->ditheredBitmap[item], 0, 0, _rp(obj), x + (data->border_horiz / 2), y + ((data->border_vert / 2) - (data->label_vert/2)), w, h, (ABC|ABNC|ANBC), data->ditheredMask[item]); + } + else + { + D(DBF_ALWAYS, "drawing remapped/dithered image without mask"); + BltBitMapRastPort(data->ditheredBitmap[item], 0, 0, _rp(obj), x + (data->border_horiz / 2), y + ((data->border_vert / 2) - (data->label_vert/2)), w, h, (ABC|ABNC)); + } + } + #endif // __amigaos4__ + else + { + #if defined(__amigaos4__) + switch(data->type) + { + case MUIV_NBitmap_Type_CLUT8: + BltBitMapTags(BLITA_Source, data->data[item], + BLITA_Dest, _rp(obj), + BLITA_SrcX, 0, + BLITA_SrcY, 0, + BLITA_DestX, x + (data->border_horiz / 2), + BLITA_DestY, y + ((data->border_vert / 2) - (data->label_vert/2)), + BLITA_Width, w, + BLITA_Height, h, + BLITA_SrcType, BLITT_CHUNKY, + BLITA_DestType, BLITT_RASTPORT, + BLITA_SrcBytesPerRow, data->width, + BLITA_CLUT, data->clut, + TAG_DONE); + break; + + case MUIV_NBitmap_Type_RGB24: + D(DBF_ALWAYS, "drawing RGB image"); + BltBitMapTags(BLITA_Source, data->data[item], + BLITA_Dest, _rp(obj), + BLITA_SrcX, 0, + BLITA_SrcY, 0, + BLITA_DestX, x + (data->border_horiz / 2), + BLITA_DestY, y + ((data->border_vert / 2) - (data->label_vert/2)), + BLITA_Width, w, + BLITA_Height, h, + BLITA_SrcType, BLITT_RGB24, + BLITA_DestType, BLITT_RASTPORT, + BLITA_SrcBytesPerRow, data->width*3, + BLITA_Alpha, data->alpha, + TAG_DONE); + break; + + case MUIV_NBitmap_Type_ARGB32: + D(DBF_ALWAYS, "drawing ARGB image"); + BltBitMapTags(BLITA_Source, data->data[item], + BLITA_Dest, _rp(obj), + BLITA_SrcX, 0, + BLITA_SrcY, 0, + BLITA_DestX, x + (data->border_horiz / 2), + BLITA_DestY, y + ((data->border_vert / 2) - (data->label_vert/2)), + BLITA_Width, w, + BLITA_Height, h, + BLITA_SrcType, BLITT_ARGB32, + BLITA_DestType, BLITT_RASTPORT, + BLITA_SrcBytesPerRow, data->width*4, + BLITA_UseSrcAlpha, TRUE, + BLITA_Alpha, data->alpha, + TAG_DONE); + break; + } + #else // __amigaos4__ + switch(data->type) + { + case MUIV_NBitmap_Type_CLUT8: + WriteLUTPixelArray(data->data[item], 0, 0, data->width, _rp(obj), (APTR)data->clut, x + (data->border_horiz / 2), y + ((data->border_vert / 2) - (data->label_vert/2)), w, h, CTABFMT_XRGB8); + break; + + case MUIV_NBitmap_Type_RGB24: + D(DBF_ALWAYS, "drawing RGB image"); + WPA(data->data[item], 0, 0, data->width*3, _rp(obj), x + (data->border_horiz / 2), y + ((data->border_vert / 2) - (data->label_vert/2)), w, h, RECTFMT_RGB); + break; + + case MUIV_NBitmap_Type_ARGB32: + D(DBF_ALWAYS, "drawing ARGB image"); + WPAA(data->data[item], 0, 0, data->width*4, _rp(obj), x + (data->border_horiz / 2), y + ((data->border_vert / 2) - (data->label_vert/2)), w, h, data->alpha); + break; + } + #endif // __amigaos4__ + } + } + } + break; + } + + /* overlay */ + if(data->button && data->overlay) + { + if(data->prefs.overlay_type == 1 || data->scrdepth <= 8) + { + /* standard overlay */ + if(data->pressed) + NBitmap_DrawSimpleFrame(obj, x + (data->border_horiz / 2), y + ((data->border_vert / 2) - (data->label_vert/2)), data->width, data->height); + else + NBitmap_DrawSimpleFrame(obj, x + (data->border_horiz / 2), y + ((data->border_vert / 2) - (data->label_vert/2)), data->width, data->height); + } + else + { + #if defined(__amigaos4__) + uint32 error; + + if(data->pressed) + error = BltBitMapTags(BLITA_Source, data->pressedShadePixels, + BLITA_Dest, _rp(obj), + BLITA_SrcX, 0, + BLITA_SrcY, 0, + BLITA_DestX, x+1, + BLITA_DestY, y+1, + BLITA_Width, data->shadeWidth, + BLITA_Height, data->shadeHeight, + BLITA_SrcType, BLITT_ARGB32, + BLITA_DestType, BLITT_RASTPORT, + BLITA_SrcBytesPerRow, data->shadeBytesPerRow, + BLITA_UseSrcAlpha, TRUE, + TAG_DONE); + else + error = BltBitMapTags(BLITA_Source, data->overShadePixels, + BLITA_Dest, _rp(obj), + BLITA_SrcX, 0, + BLITA_SrcY, 0, + BLITA_DestX, x+1, + BLITA_DestY, y+1, + BLITA_Width, data->shadeWidth, + BLITA_Height, data->shadeHeight, + BLITA_SrcType, BLITT_ARGB32, + BLITA_DestType, BLITT_RASTPORT, + BLITA_SrcBytesPerRow, data->shadeBytesPerRow, + BLITA_UseSrcAlpha, TRUE, + TAG_DONE); + + SHOWVALUE(DBF_DRAW, error); + + #else + + if(data->pressed) + { + WPAA(data->pressedShadePixels, 0, 0, data->shadeBytesPerRow, _rp(obj), x+1, y+1, data->shadeWidth, data->shadeHeight, 0xffffffff); + } + else + { + WPAA(data->overShadePixels, 0, 0, data->shadeBytesPerRow, _rp(obj), x+1, y+1, data->shadeWidth, data->shadeHeight, 0xffffffff); + } + + #endif + } + } + } + + LEAVE(); +} + +/// diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/NBitmap.h b/workbench/classes/zune/nlist/nbitmap_mcc/NBitmap.h new file mode 100644 index 0000000000..172169187b --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/NBitmap.h @@ -0,0 +1,58 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef NBITMAP_H +#define NBITMAP_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(__AROS__) && defined(__PPC__) + #if defined(__GNUC__) + #pragma pack(2) + #elif defined(__VBCC__) + #pragma amiga-align + #endif +#endif + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +#define MUIC_NBitmap "NBitmap.mcc" +#define NBitmapObject MUI_NewObject(MUIC_NBitmap + +#if !defined(__AROS__) && defined(__PPC__) + #if defined(__GNUC__) + #pragma pack() + #elif defined(__VBCC__) + #pragma default-align + #endif +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* NBITMAP_MCC_H */ + diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/SetPatch.c b/workbench/classes/zune/nlist/nbitmap_mcc/SetPatch.c new file mode 100755 index 0000000000..3d0e3bd88a --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/SetPatch.c @@ -0,0 +1,48 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007-2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if !defined(__amigaos4__) && !defined(__MORPHOS__) && !defined(__AROS__) +#include <proto/exec.h> +#include <exec/types.h> +#include <exec/lists.h> +#include <exec/semaphores.h> + +ULONG setPatchVersion; + +void GetSetPatchVersion(void) +{ + struct SetPatchSemaphore + { + struct SignalSemaphore semaphore; + struct MinList private; + UWORD version; + UWORD revision; + } *sem; + + Forbid(); + if((sem = (struct SetPatchSemaphore *)FindSemaphore((STRPTR)"« SetPatch »")) != NULL) + { + setPatchVersion = ((ULONG)sem->version << 16) | sem->revision; + } + Permit(); +} +#endif diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/SetPatch.h b/workbench/classes/zune/nlist/nbitmap_mcc/SetPatch.h new file mode 100755 index 0000000000..8059c1a5ae --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/SetPatch.h @@ -0,0 +1,34 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007-2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef SETPATCH_H +#define SETPATCH_H 1 + +#if !defined(__amigaos4__) && !defined(__MORPHOS__) && !defined(__AROS__) +extern ULONG setPatchVersion; + +void GetSetPatchVersion(void); +#else +#define GetSetPatchVersion() ((void)0) +#endif + +#endif /* SETPATCH_H */ diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/WritePixelArray.c b/workbench/classes/zune/nlist/nbitmap_mcc/WritePixelArray.c new file mode 100755 index 0000000000..93d1d06256 --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/WritePixelArray.c @@ -0,0 +1,60 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007-2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <proto/graphics.h> +#include <cybergraphx/cybergraphics.h> + +#include "private.h" + +ULONG _WPA(APTR src, UWORD srcx, UWORD srcy, UWORD srcmod, struct RastPort *rp, UWORD destx, UWORD desty, UWORD width, UWORD height, ULONG fmt) +{ + ULONG pixels = 0; + + ENTER(); + + if(width > 0 && height > 0 && fmt == RECTFMT_LUT8) + { + struct BitMap *tempBM; + + if((tempBM = AllocBitMap(width, 1, GetBitMapAttr(rp->BitMap, BMA_DEPTH), BMF_CLEAR, NULL)) != NULL) + { + struct RastPort tempRP; + UBYTE *_src = (UBYTE *)src + srcmod * srcy + srcx; + UWORD y; + + InitRastPort(&tempRP); + tempRP.BitMap = tempBM; + + for(y = 0; y < height; y++) + { + WritePixelLine8(rp, destx, desty+y, width, _src, &tempRP); + _src += srcmod; + pixels += width; + } + + FreeBitMap(tempBM); + } + } + + RETURN(pixels); + return pixels; +} diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/WritePixelArrayAlpha.c b/workbench/classes/zune/nlist/nbitmap_mcc/WritePixelArrayAlpha.c new file mode 100644 index 0000000000..0ab447ab28 --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/WritePixelArrayAlpha.c @@ -0,0 +1,105 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007-2008 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <proto/exec.h> +#include <proto/cybergraphics.h> +#include <proto/graphics.h> +#include <cybergraphx/cybergraphics.h> + +#include "private.h" + +static LONG do_alpha(LONG a, LONG v) +{ + LONG tmp = (a*v); + return ((tmp<<8) + tmp + 32768)>>16; +} + +ULONG _WPAA(APTR src, UWORD srcx, UWORD srcy, UWORD srcmod, struct RastPort *rp, UWORD destx, UWORD desty, UWORD width, UWORD height, ULONG globalalpha) +{ + ULONG pixels = 0; + + ENTER(); + + if(width > 0 && height > 0) + { + ULONG *buf; + + if((buf = AllocVec(width * 4, MEMF_ANY)) != NULL) + { + ULONG x, y; + + // Incorrect but cant bother with alpha channel math for now + globalalpha = 255 - (globalalpha >> 24); + + for(y = 0; y < height; y++) + { + ULONG *spix; + ULONG *dpix; + + ReadPixelArray(buf, 0, 0, width * 4, rp, destx, desty + y, width, 1, RECTFMT_ARGB); + + spix = (ULONG *)((ULONG)src + (srcy + y) * srcmod + srcx * sizeof(ULONG)); + dpix = buf; + + for(x = 0; x < width; x++) + { + ULONG srcpix, dstpix, a, r, g, b; + + srcpix = *spix++; + dstpix = *dpix; + + a = (srcpix >> 24) & 0xff; + r = (srcpix >> 16) & 0xff; + g = (srcpix >> 8) & 0xff; + b = (srcpix >> 0) & 0xff; + + a = a - globalalpha; + + if(a > 0) + { + ULONG dest_r, dest_g, dest_b; + + dest_r = (dstpix >> 16) & 0xff; + dest_g = (dstpix >> 8) & 0xff; + dest_b = (dstpix >> 0) & 0xff; + + dest_r += do_alpha(a, r - dest_r); + dest_g += do_alpha(a, g - dest_g); + dest_b += do_alpha(a, b - dest_b); + + dstpix = 0xff000000 | dest_r << 16 | dest_g << 8 | dest_b; + } + + *dpix++ = dstpix; + pixels++; + } + + WritePixelArray(buf, 0, 0, width * 4, rp, destx, desty + y, width, 1, RECTFMT_ARGB); + } + + FreeVec(buf); + } + } + + RETURN(pixels); + return pixels; +} diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/dispatcher.c b/workbench/classes/zune/nlist/nbitmap_mcc/dispatcher.c new file mode 100644 index 0000000000..3ee146dcf4 --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/dispatcher.c @@ -0,0 +1,596 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/* ansi includes */ +#include <string.h> + +/* system includes */ +#include <clib/alib_protos.h> +#include <proto/exec.h> +#include <proto/intuition.h> +#include <proto/muimaster.h> +#include <proto/graphics.h> +#include <proto/utility.h> +#include <proto/locale.h> +#include <mui/NBitmap_mcc.h> + +/* local includes */ +#include "NBitmap.h" +#include "private.h" + +#include "Debug.h" + +/* Object *DoSuperNew() */ +#if !defined(__MORPHOS__) +#ifdef __AROS__ +static __attribute__ ((noinline)) Object * VARARGS68K DoSuperNew(struct IClass *cl, Object *obj, Tag tag1, ...) +{ + AROS_SLOWSTACKTAGS_PRE_AS(tag1, Object *) + retval = (Object *)DoSuperMethod(cl, obj, OM_NEW, AROS_SLOWSTACKTAGS_ARG(tag1), NULL); + AROS_SLOWSTACKTAGS_POST +} +#else +static Object * VARARGS68K DoSuperNew(struct IClass *cl, Object *obj, ...) +{ + Object *rc; + VA_LIST args; + + ENTER(); + + VA_START(args, obj); + rc = (Object *)DoSuperMethod(cl, obj, OM_NEW, VA_ARG(args, ULONG), NULL); + VA_END(args); + + RETURN(rc); + return rc; +} +#endif +#endif // !__MORPHOS__ + +/* VOID setstr() */ +static VOID setstr(STRPTR *dest, STRPTR str) +{ + ENTER(); + + if(*dest != NULL) + { + FreeVec(*dest); + *dest = NULL; + } + + if(str != NULL) + { + ULONG len; + + len = strlen(str) + 1; + if((*dest = AllocVec(len, MEMF_ANY)) != NULL) + strlcpy(*dest, str, len); + } + + LEAVE(); +} + +/* ULONG NBitmap_New() */ +static IPTR NBitmap_New(struct IClass *cl, Object *obj, struct opSet *msg) +{ + if((obj = (Object *)DoSuperNew(cl, obj, + MUIA_CycleChain, TRUE, + //MUIA_FillArea, FALSE, + MUIA_Font, MUIV_Font_Tiny, + TAG_MORE, msg->ops_AttrList)) != NULL) + { + struct InstData *data = NULL; + + if((data = INST_DATA(cl, obj)) != NULL) + { + // assume a valid data type for the moment + BOOL typeOk = TRUE; + uint32 i; + struct TagItem *tags = NULL, *tag = NULL; + + memset(data, 0, sizeof(struct InstData)); + + data->type = MUIV_NBitmap_Type_File; + data->alpha = 0xffffffffUL; + + // passed tags + for(tags = ((struct opSet *)msg)->ops_AttrList; (tag = NextTagItem((APTR)&tags)) != NULL; ) + { + switch(tag->ti_Tag) + { + case MUIA_NBitmap_Type: + data->type = tag->ti_Data; + break; + + case MUIA_NBitmap_Normal: + data->data[0] = (uint32*)tag->ti_Data; + break; + + case MUIA_NBitmap_Ghosted: + data->data[1] = (uint32*)tag->ti_Data; + break; + + case MUIA_NBitmap_Selected: + data->data[2] = (uint32*)tag->ti_Data; + break; + + case MUIA_NBitmap_Button: + data->button = (BOOL)tag->ti_Data; + break; + + case MUIA_NBitmap_Label: + setstr(&data->label, (STRPTR)tag->ti_Data); + break; + + case MUIA_NBitmap_Width: + data->width = tag->ti_Data; + break; + + case MUIA_NBitmap_Height: + data->height = tag->ti_Data; + break; + + case MUIA_NBitmap_CLUT: + data->clut = (const uint32 *)tag->ti_Data; + break; + + case MUIA_NBitmap_Alpha: + data->alpha = tag->ti_Data; + break; + } + } + + // load files + switch(data->type) + { + case MUIV_NBitmap_Type_File: + { + for(i=0; i<3; i++) + { + if(data->data[i] != NULL) + NBitmap_LoadImage((STRPTR)data->data[i], i, cl, obj); + } + } + break; + + case MUIV_NBitmap_Type_DTObject: + { + for(i=0; i<3; i++) + { + if(data->data[i] != NULL) + data->dt_obj[i] = (Object *)data->data[i]; + } + } + break; + + case MUIV_NBitmap_Type_CLUT8: + case MUIV_NBitmap_Type_RGB24: + case MUIV_NBitmap_Type_ARGB32: + { + // nothing to do here + } + break; + + default: + { + // this is an invalid type + typeOk = FALSE; + } + break; + } + + // setup images + if(typeOk == TRUE && NBitmap_NewImage(cl, obj) == TRUE) + return (IPTR)obj; + } + } + + CoerceMethod(cl, obj, OM_DISPOSE); + return (IPTR)NULL;; +} + +/* ULONG NBitmap_Get() */ +static ULONG NBitmap_Get(struct IClass *cl, Object *obj, struct opGet *msg) +{ + ULONG result = FALSE; + IPTR *store = msg->opg_Storage; + struct InstData *data = INST_DATA(cl, obj); + + ENTER(); + + switch (((struct opGet *)msg)->opg_AttrID) + { + case MUIA_NBitmap_Width: + *store = (LONG) data->width; + result = TRUE; + break; + + case MUIA_NBitmap_Height: + *store = (LONG) data->height; + result = TRUE; + break; + + case MUIA_NBitmap_MaxWidth: + *store = (LONG) data->maxwidth; + result = TRUE; + break; + + case MUIA_NBitmap_MaxHeight: + *store = (LONG) data->maxheight; + result = TRUE; + break; + } + + if(result == FALSE) + result = DoSuperMethodA(cl, obj, (Msg)msg); + + RETURN(result); + return result; +} + +/* ULONG NBitmap_Set() */ +static IPTR NBitmap_Set(struct IClass *cl,Object *obj, struct opSet *msg) +{ + struct InstData *data = INST_DATA(cl, obj); + struct TagItem *tags, *tag; + IPTR result; + + ENTER(); + + for(tags = msg->ops_AttrList; (tag = NextTagItem((APTR)&tags)) != NULL; ) + { + switch(tag->ti_Tag) + { + case MUIA_NBitmap_Normal: + { + if(data->type == MUIV_NBitmap_Type_File) + { + data->data[0] = (uint32*)tag->ti_Data; + NBitmap_UpdateImage(0, (STRPTR)data->data[0], cl, obj); + MUI_Redraw(obj, MADF_DRAWOBJECT); + } + + tag->ti_Tag = TAG_IGNORE; + } + break; + + case MUIA_NBitmap_Ghosted: + { + if(data->type == MUIV_NBitmap_Type_File) + { + data->data[1] = (uint32*)tag->ti_Data; + NBitmap_UpdateImage(1, (STRPTR)data->data[1], cl, obj); + MUI_Redraw(obj, MADF_DRAWOBJECT); + } + + tag->ti_Tag = TAG_IGNORE; + } + break; + + case MUIA_NBitmap_Selected: + { + if(data->type == MUIV_NBitmap_Type_File) + { + data->data[2] = (uint32*)tag->ti_Data; + NBitmap_UpdateImage(2, (STRPTR)data->data[2], cl, obj); + MUI_Redraw(obj, MADF_DRAWOBJECT); + } + + tag->ti_Tag = TAG_IGNORE; + } + break; + + case MUIA_NBitmap_MaxWidth: + data->maxwidth = (uint32)tag->ti_Data; + tag->ti_Tag = TAG_IGNORE; + break; + + case MUIA_NBitmap_MaxHeight: + data->maxheight = (uint32)tag->ti_Data; + tag->ti_Tag = TAG_IGNORE; + break; + } + } + + result = DoSuperMethodA(cl, obj, (Msg)msg); + + RETURN(result); + return result; +} + +/* ULONG NBitmap_Dispose() */ +static IPTR NBitmap_Dispose(struct IClass *cl, Object *obj, Msg msg) +{ + IPTR result; + + ENTER(); + + NBitmap_DisposeImage(cl, obj); + + result = DoSuperMethodA(cl, obj, msg); + + RETURN(result); + return result; +} + +/* ULONG NBitmap_Setup() */ +static IPTR NBitmap_Setup(struct IClass *cl, Object *obj, Msg msg) +{ + IPTR result; + + ENTER(); + + if((result = DoSuperMethodA(cl, obj, msg)) != 0) + { + result = NBitmap_SetupImage(cl, obj); + } + + RETURN(result); + return result; +} + +/* ULONG NBitmap_Cleanup() */ +static IPTR NBitmap_Cleanup(struct IClass *cl, Object *obj, Msg msg) +{ + IPTR result; + + ENTER(); + + NBitmap_CleanupImage(cl, obj); + + result = DoSuperMethodA(cl, obj, msg); + + RETURN(result); + return(result); +} + +/* ULONG NBitmap_HandleEvent() */ +static IPTR NBitmap_HandleEvent(struct IClass *cl, Object *obj, struct MUIP_HandleEvent *msg) +{ + struct InstData *data; + IPTR result; + + //ENTER(); + + result = 0; + + if((data = INST_DATA(cl, obj)) != NULL) + { + if(msg->imsg != NULL) + { + switch(msg->imsg->Class) + { + case IDCMP_MOUSEBUTTONS: + { + if(_isinobject(msg->imsg->MouseX, msg->imsg->MouseY)) + { + if(msg->imsg->Code == SELECTDOWN) + { + if(data->pressed == FALSE) + { + data->pressed = TRUE; + + MUI_Redraw(obj, MADF_DRAWUPDATE); + SetAttrs(obj, MUIA_Pressed, TRUE, TAG_DONE); + } + } + else if(msg->imsg->Code == SELECTUP) + { + if(data->overlay && data->pressed) + { + data->pressed = FALSE; + data->overlay = FALSE; + + MUI_Redraw(obj, MADF_DRAWUPDATE); + SetAttrs(obj, MUIA_Pressed, FALSE, TAG_DONE); + } + } + + result = MUI_EventHandlerRC_Eat; + } + else + { + if(msg->imsg->Code==SELECTUP) + { + data->pressed = FALSE; + } + } + } + break; + + case IDCMP_MOUSEMOVE: + { + if(_isinobject(msg->imsg->MouseX, msg->imsg->MouseY)) + { + if(data->overlay == FALSE) + { + data->overlay = TRUE; + + MUI_Redraw(obj, MADF_DRAWUPDATE); + } + + //result = MUI_EventHandlerRC_Eat; + } + else + { + if(data->overlay) + { + data->overlay = FALSE; + + MUI_Redraw(obj, MADF_DRAWUPDATE); + } + } + } + break; + } + } + } + + if(result == 0) + result = DoSuperMethodA(cl, obj, (Msg)msg); + + //RETURN(result); + return result; +} + +/* ULONG NBitmap_AskMinMax() */ +static IPTR NBitmap_AskMinMax(struct IClass *cl, Object *obj, struct MUIP_AskMinMax *msg) +{ + struct InstData *data; + + ENTER(); + + DoSuperMethodA(cl, obj, (Msg)msg); + + if((data = INST_DATA(cl, obj)) != NULL) + { + uint32 oldBorderHoriz = data->border_horiz; + uint32 oldBorderVert = data->border_vert; + + // spacing + data->border_horiz = 0; + data->border_vert = 0; + + if(data->button) + { + data->border_horiz += 4; + data->border_horiz += data->prefs.spacing_horiz * 2; + + data->border_vert += 4; + data->border_vert += data->prefs.spacing_vert * 2; + } + + /* label */ + data->label_horiz = 0; + data->label_vert = 0; + + if(data->label != NULL && data->button != FALSE) + { + struct RastPort rp; + + memcpy(&rp, &_screen(obj)->RastPort, sizeof(rp)); + + SetFont(&rp, _font(obj)); + TextExtent(&rp, (STRPTR)data->label, strlen(data->label), &data->labelte); + + if(data->width < (uint32)data->labelte.te_Width) + data->border_horiz += (data->labelte.te_Width - data->width); + + data->label_vert = data->labelte.te_Height; + data->border_vert += data->labelte.te_Height; + data->border_vert += 2; + } + + // standard width & height + msg->MinMaxInfo->MinWidth = data->width + data->border_horiz; + msg->MinMaxInfo->DefWidth = data->width + data->border_horiz; + msg->MinMaxInfo->MaxWidth = data->width + data->border_horiz; + + msg->MinMaxInfo->MinHeight = data->height + data->border_vert; + msg->MinMaxInfo->DefHeight = data->height + data->border_vert; + msg->MinMaxInfo->MaxHeight = data->height + data->border_vert; + + if(data->border_horiz != oldBorderHoriz || data->border_vert != oldBorderVert) + { + if(data->depth > 8) { + // the border size has changed and we must recalculate the shade arrays + NBitmap_CleanupShades(data); + NBitmap_SetupShades(data); + } + } + } + + RETURN(0); + return 0; +} + +/* ULONG NBitmap_Draw() */ +static IPTR NBitmap_Draw(struct IClass *cl, Object *obj, struct MUIP_Draw *msg) +{ + IPTR result; + + ENTER(); + + result = DoSuperMethodA(cl, obj, (Msg)msg); + + if((msg->flags & MADF_DRAWUPDATE) || (msg->flags & MADF_DRAWOBJECT)) + { + NBitmap_DrawImage(cl, obj); + } + + RETURN(result); + return result; +} + +/* DISPATCHER() */ +DISPATCHER(_Dispatcher) +{ + IPTR result; + + //ENTER(); + + switch(msg->MethodID) + { + case OM_NEW: + result = NBitmap_New(cl, obj, (struct opSet *)msg); + break; + + case OM_SET: + result = NBitmap_Set(cl, obj, (struct opSet *)msg); + break; + + case OM_GET: + result = NBitmap_Get(cl, obj, (struct opGet *)msg); + break; + + case OM_DISPOSE: + result = NBitmap_Dispose(cl, obj, msg); + break; + + case MUIM_Setup: + result = NBitmap_Setup(cl, obj, msg); + break; + + case MUIM_HandleEvent: + result = NBitmap_HandleEvent(cl, obj, (struct MUIP_HandleEvent *)msg); + break; + + case MUIM_Cleanup: + result = NBitmap_Cleanup(cl, obj, msg); + break; + + case MUIM_AskMinMax: + result = NBitmap_AskMinMax(cl, obj, (struct MUIP_AskMinMax *)msg); + break; + + case MUIM_Draw: + result = NBitmap_Draw(cl, obj, (struct MUIP_Draw *)msg); + break; + + default: + result = DoSuperMethodA(cl, obj, msg); + break; + } + + //RETURN(result); + return result; +} diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/icon.png b/workbench/classes/zune/nlist/nbitmap_mcc/icon.png new file mode 100755 index 0000000000000000000000000000000000000000..eb5885f89c0b30780fa21d823224efe0286c76b2 GIT binary patch literal 26529 zcwX$hRZtu56Zabu+@VNtcbDQ4TuX7MK#Lc5EeTGsK+#g%-DwL2f<tL>ic_Ez*W#8O ze*gFCT%U_`^Il{!`%GrC+1>AVKhGqScwHSe0$gfb002Osp{}eC0HB3FJs7YtpH38G z!{nZx&>a<CC;$LW$)WdpAD&{yH|qK?000kp0KhvI0JvZU0HP)U05@v@VAllzkVyal zXiO?H-KqfqM_vtO1;fBkuOCn-`F>6?Mu`nsV#Ed!02t?7NGFJ^+WX%bR1UxhRmFSI z`#%Rv|DPjFNwAfaEN&$R0O-_;V0e00;>d6mQY10+x&&(e^fIuT1=0Uf(GwH~KmbYY zr)vMp#3l*=1yJ+--{}7pZLOoivFV@sqz@p5@Pdw@{}mkV9b!ack{^uGj{!iRbixb& zUo~-6u>shHQ^5Zl{r?g%X2SdtPwi78P|oB%2k0N;CnhdI%yUUbY;5dqh?t?f=<v4p zurt(ES>8qg=2G302pB<7!2k5Q%4<NRZGx`9V&{ah%^H&>K0gtPA*z(6eu*j)B_u~2 z;u!VD>G~6m{Bf|eONUbRV~Y^{z;tvIyh&k=9k}y$HbT+q%ZlU1V8(HpRbwP>y|P(3 z0L)-ZTo#rQsbZRX-%Ol>E6Y7K92d^eeE&VA$@wJ3-POLAfY)xExg<%dSiAq8LmqJB za=ms{#IYzD6hS;vHbeHxoWRf1-wQwK#Py*XW$;;1k$y<EDrO|8MfRB~)9gwD#4@p8 z{z>Gp^*)TyxA)KD++iTRdt$~pP}MF9^#;m{q3TI}hhq3x4f)BTs#=aJOz&kRAhRSl z=<W#AaNOlKzkNfN2-JVFf~gRE6a!f#?nsaNL%5SSDs_SJj<nG)9K&TOT=Y4ru@Uvg zwxsIK!!UL+3M9mWjl%jGyK%SVoCP)N)e{X1hp9*_^Q99R5($GUv1(7`M|jo8889O0 z&?(1vK$$-i;*A(yHM4@V**lQ^GrTOk<EThn6l&5JSZo`rjv`5?M+OWV*0z`CI6he# zBN_mmxC<}Tl<6)Dtwm6kA3il`!kh!EOS>6^Rzi@)@o%!RxIU$Bp(2^I=_;GV@Um?c zsA!H=RV!t59|XP>p$bUSMw!ZFL}wxgReKpRdoj*~U{jxo!6@p1N+O<DKd?%xsTiXr zD`8LlFIBrHvP2UUE-vN4Yy^Y!|3FF7+dG`Mi=Ku{{b?zP5@X0|j^&_*^gdE*tlHZg zAi2}1z67H${CG@BBH;f7>+<j%!f;qX#U<ik&i~R0!Pz>*w6}~~2^U1B7zYUoE1Cx; z#!;+2c?EG~VMNe36ctJUedwbUh?S2R9U(D}HpER-8i95F4;g`X{#27QlzeS*>@_VF zqk&Ag?Iz-aiO!;lJu2oE&65{#K6w#HvNZB7CuWyl4|Ocn7r_q6-7eflaHSt6S0##t z8$&f67((UrC5FTu(+L|}UlPKDHVHklF3nt#SI!W^#iYUJ&8|R89DAOKqM8GPH=Lsd zZzjM19nd<HjOkyZ<3)v7w{^Y{<vUP0-YFSLYY~7vpeSkLzsAr%c^-sd&xWSGH>Lq# zaXsIdeMXt^F0?LG^y8U8Ya6CV>Z7AFAE3T2?+&-pQ$U-@lz!Ib9>riQ$70FQx_Kin zRVsq5po_Hhvni6n0xP7Uik{V@n4+J*A~tSTrml>`a{fXn<4#m12)UGPogc;)d6tSv zMe^qn#q<V+df|L9_S6;ZC+QYnbJMx<@u+elhoK#5nCV`>UJLyZFhmNZNoCX9i8S$z zMe$WfO|F;up_ppi5d>iuicl{MxF?`t?3T#71Y`ty_2rzw*>){FE~vyt5C&1Uod9u1 zG4X8cWjb!4BSe`n_;;x`aIh8>pzI*kQu3U}QZ!A~L|qkPrjbe}R@>9bA0M7<gc#>( z*%q4L+{9Se+;BfBhAxF_VH*%f#UByJ!oFPCF9uIc!mqE(0XqLxVs|2W_N}pAmc>b! zvT7MwFk%~_2caa+md7$&m_Q$TCeC6PNGQ5U7~g}63VDNKVw1JQ#+qu0oY)g&jPYdr z@D-k6-I%{7U+RlNb4B&EtsrPm((Q~+vD_7AoZ96JB{ogz$KOhfTuDQvuqPA3gNYL1 z3e=wc2_)6m^35Ue=dfS8(hx~hDox0G+rxS}eY51#hle5_7F`e$IY@@qsS|mp2s*ML zggR;>?vn#H6!ns6%%7@AS_rB1Yk|dWIFdSQR}vX}fidL@V1v)hUT!=YTIo|msN*y& zE{rAHjZuD262YVwnH2ihtgZOweuU5a^e$*bf;aF;G{)X!UOR}uu!pGW7j;z|kwqIC z)o^tEPX-JS0gy5JQ55sE-rdwP(s))78GH3ZaND&JX4KU*0cCqMzzn>zjT%IuP^YZ} zaf^Q*CgM!}e_-c#W0ci(wf;MKN@D={lt!g}&KF!q@LJq3zH78Z`<(1TOt1|VrRaM+ zt704;Vnl`Zx=T?5TFoPoSqh5b(?-!9m}<l728B`^KE<NG+4*UVF|;|0g0sjFV+h-s z{yhm--LlV6hNAFA5O<6pWY>p)fecuoT<qUH>3u7SWWw($n;$4mH3Wr2(f^50j?e!$ z6j=Wa#qjBr#dhPb#}_gV>(rgY&)rk(m41cqR#Rg-)ewo*r>rV^@)V?Q0KSL=7E|%Y zPEi|Fbj|o4Pviz6hKp-uq^8>9Hj-{DQp?A>Cf^acWuRhPkEy7<jE^~O>^*)s6b?Pc zm1V61X}itwekmy%0^#H~g#<x~aeg;5lmSui%ByysFoqHMpJwa&hm9fqxOR#=$?FGH z>r3|c3>7jgzIC#80j%z)1-5*wZ$yx>_U{JnTuq1QSDmGG0fq~pDh)*7rXAEH4P=5? z|LHZU5j=@4R|{u%`9lsC6c$B0h<||}M}Z6<ap60iid?r^9=U>X#M#iaK)Z}=Y<tq# z^Z&yq<^L?pYP}?7l>yX#%<#bmv;8dCRY_(<O%n1;1Ep45gi6^>`@{RMp+4sUGkc2Y z(Gju~i1AjX?}*xMg9!a}BCiZsdIu|$<X|O)o7li&jgkF3=7s%|rLJifi_gxf;uK=9 zF44{^P^Y4Uao}+@%Dcq4uXO5VB0d_9PN2&$nI~=wdRn@e-s)I+1mAfrGz39k8HeZh zhu_<-dSaR;<dIy%2}w<fKF5-TmXFJ;Zm|WH9GvbEK6pEJfd14Gfln>rE!|YTTK2X| zd??#z=ZSIgCY}w6Pc!e^Sj-X3rfbazUnCMeVh4REW(rk5!GwRrvAf|r!p~K)`knlw za;hh0fvp5ackAu5Hu|A5)kSQAZ4!Q;KKWFWtqV#BakUCjK_u`9{X_svpmm{nli&Ox z4gg<Sxo5NBku*2vU;Zh;eKZ@}6HNST(p^%Ebl*#c;I-#0`n*aM1`!iq>>ef{!7w5q zPe)0QAcXK7#IQ?g*3m~ix@Mu(+1I1HS@GnYPXBYO`3;tn+EtxWsu8M;?7VhU|7FGc zFf;~#6hrsXKL$Om7KPYqA;AuSGyjMt!>+6voG-J4FH{Qc_X?Fe!imTBVd8>e51-ZZ zn^HhOv-=m=_eZtEgu!-T7H{J>=}j3wZR)44U;S6_*XmfyQzM1H9;HctAliAKElbG# zx&<!0$6dG!xdF?O{OK?;eu=~^^%p@Hha!ycp)Yl4^IFTWPRDXKaCuu27&jgn<oJm! zXozHoz+yjuIknL#pIPWK#h-3I*r2D~tg9q7!WTlkpb<gUDB^1anD-=X|0S;<zz~`~ z9=>UQSqZ3oLj?ClPohz>NQ37#sb^!0Ci7zC4ZCB{a$wE!4g<`^$43Gme@rLq*!ek3 zWl%%TG@ax(G2wt0^pU#<92DX`Op9l%z~L=Iy+W%cM58`nx)}1AcR{@Ku+7IseD_O) zD`Npx6DpfzstowKfeEc2`$$^|v1Jp<V>77DxYq49;~l@0y_F@his9tWWOt1IdMSKi z<N2glE(%3Oq5~^%2E8OcW$K3a-O3VI^fvHDN?smUuSrY}@lF2aAcdrSLB&dgx6$I{ zM!K!Adq)uHUx^b)77G#^=?BjT>55E4n$9u~{y`n8ihN}d`0S-t-<%Y%C4XYIThVS( zU=G!_e3bdjn49;iryq-Rum6VOn0S{w(ew8j`hFJynWRYD_$`%?7vzQRQV?!75%?CW zGllLQ1an8DGrj&=^P`l&%*uWusPF;hqCCP(N-J8u!QwCRPqf*_M=O>8t|*b^e+GlU zhrkUrg@wjM{gUmV5`@;l9TCi!^B{(4*eUcD77tsXso`(Pzjz@o%3uh&MGVKG`jZB6 z5}CE2<me@Mx^3i>?j)v?I5{SEQLWljXe_??@6lw~iwId~VL|hlc10?#M`ndY{tVW$ ziAO(}-b0nVrFW6WFAM9+Jxv6Kd4c3tjJI7aT0KC#M<a;%bHHHg3711etwL<Zeq#-5 zQSSgYodwMP<tf)pVphD@2aj=I$HM$j)e*CEb$b?lhgeEi_?H_LgC6j~QMnW&P6X^r zY(x%HWYU)bQf)$dO}|)8lG2l`3I;Ip57<G?F?k+}oC$m%+3IbzCb?O{)DvJNdi9Za zDcY04Bu2?3$MWi<L_Sw$+9gzMu;k~8|G+FP-ba|)nT5Gb5LG+zqfQ*dCR)=|kD(2n zYG_*Wv%)}Mps*EKfdJDqU9d0DAJ>X#GU;1kYn=B!T|^{x%Ys(umT*Lh<|``i|CAMs z&w%d#!3op#QM5Z#Mi^p(HGYs7#|o6i!}>+YN-BuNqO0D<p6!dD<?ol&wgH=M;<fhS zWS4#|(z%KC#7K{Biv`qUB84CVn)VMwe!QituIP4Pv!OXUG;T}(P`w%PO<5=n053!r zZ3m~Thdfvi4C+TNl5^HnLZgwOtl4}_#+GC>-&<*r>%R+mUkCIlq>67f;uDJaq>si9 zoyVNP#+Jx1H&zrCAp=1XNx6*!e1sRcmCwOUcv$M>XbWwO;t*8{6bsQ$1=m|Fo;D^U z;XmPl1m_HkOehi~g4)@b{MvH{R1*zc1`P*}n(U+3PgXLfFEV_sOK|#%pca9gfbu;e zV`=v>4S*hsP!TlWGtzH;x){v|P>gVH-BK^jx@VcVQ8K!-UY{s;*T9U=e0!i|Adrj_ zGO`S#l$zjee=M3XE7rkyVf8&x%?V0`alR8D9}J6lg-rY(XNS=v&7NRJmdatBregTB z4ns%!vyMwT;j4Q}vCNm>^IEe^UfdCuUMY$%Kvypq65d6|y|#^vOLHldeFfp?aQ#GO z|09QFf;=An8qlo5@a-F%#NP{V;b_vn2tf~0inI^Sqn#>>!&u;G^Iqim+y*%Ea)c&D zv#f4!rB8FE)H_ZbreQ$>M1gbfVB^sb_7GQ{`+J5aDjaWBnJuKvKq>`()Q(PQa|N13 zB+3U|IA+VV0kfkoeX2L!GtAvpjKoR5Gx%xraV|7H0afT0t{x2it%Ko1$xKhhBn16} z0{bUomioqee2egZWiu9*I<srN>mcyyon2JkD7qFFylAKgei|9WvP6p^LjYMhquf-j z&G;T37lJ~meDsLuOhW6Rp-Q7%zZTO13|8!jo}>&=3JgGtul{@+JQ@~;zFWcEau9?D zYvVT_C=}&x+GypbUJu&b0h>ap#XLaE=vb7o)++A_SWfmCngEP|Ad|!y2r=mBV>0y_ z=DzQ2X>n0$Nn8Xo46dl6&`Sj84ASU$U`bIAlIU(57ORkEoz`vCCu5sFs_QyvDoJoe zHlI}oAcdmz$$xalPds0b!9f5aia!)Nzk0rFBbF_s!C05o`)fSv<#ird?$a>J{Si}? zP?#B@f&<?jLjIkJi0J*jnJDi%3hUo)M;e65{&cra20qds`i(p0oqaN3WzEgtC2kn5 zH=6vtw_LHzkT=rKALG%pZ@JxqeK9Iz-ECdng;yN-B^e>!o4Pfqz>>~p-TSKKWyHbP z`^*t=`Y0K<aa)={#P-5vz>nDAjDgO!6K9Phthvs<L#^Zm;#SbC8HZS7fbCi8ic4hH z9=AdMQEz3nWn$Q&cCO@}%8!b5G~9yvV{37fna=a`z`*4z{WON)-_l)kIJfli%YAhV zuRj}Xx+ZcAU)9~G_ZpzfI=^&@dX;T{m}J}6Q+G-Pga;gRVh=#TYgHGx5t&!-DTytJ z7@gj-6t9=GKI1*)ML)xS)vHMI4SH=hd^pb1l4jJ}q)XgS+OnweZ$jMm!^1!AWshCC z_sxX;Vm7-+1>c5tqV*M36~zj=jDw_INx#b%;lER=ZW|XhyOi|LYc2%Facc_c@$1o@ z5+*bC?TnUZOZy9(ni8KTuNNdWD@>I+>Rj+Jn5E<Hbx5UG@lq&JJrr7K&RRVB30$E5 zynE+${hJ9dvq+CrUssr7L!*K^+a=Q9gXr@M$7z_dBqLCVBO}PM!7h$eLy#|+TKqQ6 zRq-Ehc5o;YU6^xuwuEyP_-km-GzFsthcc57S;dtDD$G4(^3I@DVIHv}Uf19yn5xgW z?Me`_=G^$mBs-i_9?b0b{xv9`(f+wGuj-i3p2})u!RY>yr@Zua-D`gao^<TE!q_`3 z>R~e0P!H4&Hiy`r%t*_}v-v0#G4vbHFK5P>B7e$tf$Rk{1;O3`!~Mx5oOpsgRvSBe zh}BI>HMjZ$zBJEJ{BJF9Sg|HPzOu{AK_1=k_}Al>lVgEuUsL-QBnDACeND@8$ki`8 zN_at$sWhkbu1Dv#+}Yxuj;PV0X!Gs+Z=U1QB=P1|@ti-QZWb)lF(R1)ZfO|lRIhhR z0V4qh%AqoJ?ym}B>I5HW7LSTrBoxsz;Cw3WZD_rJW|R+C@{nsTUTwR#ybJ=?<J;HH z^yd+H7Ap*<Zxxd*;~BIpnWWv14-J%Ww)t(L!IeE>C*^&>8g?%=ONQjyzAG^MMMn5H zNXb02XG@abr^}EG<!BW9(Ca9qPb!IO-TueZuco99V|MZq)NEwEw*%FHP=PY^_+R{E z&|e$Tj=xohC~k|HWeiQ6&xN>opZC+*lxeh2JRG^VJp9=nM<Tcw5Wn|zb4rY6gj(Eo z)437^&LO0KShg*%&Mn2rfUT;P#+!2Ps6W^!0|3En=@HtKQ-g9G5W<AKZwe{*M=<0; zY2f#?5B$$=g0UJ&SUIA!YB=7_<M9C6-Kkb=<2B{KaRSsegrNc*F^gl^8nvehCN_)U zD*Pzlxu&lV44?;Z0##+nKI|IS!j{;$=gvTgo~{Y)BQWrAUH*-P-N?GUJ{s;Thqz7B zxIG&T<MAph)b%)jZh|{m<D~rIM@%X27$yu?T+sf5L@V|^*7aie7Y<#-ud2mDManmO zpFGAdP$;IXG(@?mtwG@AsO3VrqbeB7g~-l<LM#=Z)O@DEGumbWf}7f-em;@d7-Y`A za3NUy5JiPzXg7RD{T4s*CVAWeeWDW?slxZ;6YA9b!v+H=w3ov-o|yTv{}&LA&%RGz zx9=DYN)s!pNBBb8GsM;m#2hg@b7sTXjKHF}s)qbDK&Zv{)9CBgpp+;T`#*A_s5VL} zClj1)_VD@{;Cup%B00n#woV7lP#d(SqeRzo+#10N?%8Niz*e3tVV@v=bRLT*CaWsC z2(S7l7<oJ_3C);&V1!_ulNXzvaKKb{nsvf!tii^H(L$MQX$dE&AmI@&#+rZYJj=&a z!{TL=>wSt{{w4{G?z~B!wky}_`v?0FQIETK)}$6{D{;6PrTj$|r>p5zT+7>eANbiC z$JnTz5ym?y{dHBA-9XMnP+bhw{HnpbuDDOOb|a|zH^JFL?ze?s)Msb+ZiYce{6mP( z@#lmO3_T#dXpu@jIiDq*4Yx9J1M(IO93X+I@tIycPv4MDb9RL3_vA2xrE?SI)?E#z zCS7JBjrt@T+&@mo`CwP9{8g4(t38^<m$!%DDAo38h3G!hzMp^l3wejLiL@<2?>{k8 zFGErVjdmw~#kz+bW4Xnj7Nm(5u>5OoLXW5Y-8;}4^-hu2*iD1f?gG8#-7LSDjk|oL z-97Om(!LWHvex#85x;-(hWGIBhwBQE)qj94+tl<cP|Zd;5BwFM_wUpVWu(4dF9H%% zT|F)8x9>PMkrYnSFCVb>cr+$d95FapH+Xg;J6}rA$HYCScI3Ta)w%rgN0;9BWqwng zus9*^y&Xp7Zdk5t4=ygeRXYkuV|U_$&~4^fLZ6@=ee)Aj-KRDjTWN<b<Jsv=Bk9+| z;#Tz!d*0Fw1R*O8x%hW`MrYp7IgNe&SuH>Vy?yKnkJ4zPTLpPzGG)RULu^skr#F7J zFQiM&2DyboN1H>*CUNqum^E7RM-B3y-9&Xege?JEC!gzjW)jnYni~?*+60jm?uK?c zf0xfMb+HtXQUS5RdNpQ|l%$k34VN}&ij|ZeE$+@ypiUr7<Jht~t_O2g5y?Ke?0N~c zp=p65NPP-?B^4TuclA{ko$+MJi#W#CsY}EYKw;zPxPxg4jb8RdPX-NF)3XO5Tb+4W zSt(+wNnJEHV}@HET~O4gzct1^LPEq`!+b@{;4?df$PA%n5{*uQ?aN7qb@K@efn_)u z7at98Q{H#guy=0L6wmj!7`3=0dOzS2fP`Q*lDZJ$5c}KQK{KrYcqOZbV04WNE`*uK z5b(t+;o3{a$|I|)!FV!!U-sG#E11E4^-u|*-R&tRzItc)Cr3l`dopQ(@aaXM<LjA% z#9>CY-_eOPn@3@XG)yAVqt8oxW5*n`hR)sJUJZM+{~Hi29tywI9;6EM&>zSV;`K`W z*rs{FvAFT7%*}~|i>aKEmAR8mnrorq;$zFveKD`k9&3&yrw%mZdC|jc=~O@eYb88C zvq$?Rx9a)V2dRf`tu`Kkr}OwIHb9W0N0cDGl5GvkvqoHUQC9?jmOxfoR~SH$APC~| z0`dgE#Em))P>ZY~>-O0+o#wb5ylv~357W4ABTzYh(2r&5+8kL)W(r^7{;TyWRG}!} zsQ=VV?2Mt2b$@@Z#Nur6lSYwZ?45J@mn-};fjQRxnZ=Tj{QCBvZP%PsT~lR><xbq} z=wusTPe`3V&$Q}nAFMWeB>s74kcZqD%B})Ti{n`9vD*OfAN~0~GO*XJs-q3UQcv@i z-a7pG3s46d+$!-wI!dljq&2xs1Pcihl?KVhJlOyW!ev=kG*OwSd7fo_3|A-5AW2Gh z(Ndc5y17E0ptYO)(3Yk8;g{?#UPnui46?LWQ{Rk3U*t=N0R%KN=2m@dgf+4DU0)_l zmMc8AMv|=ypFX;EVnf!*ml^Q~5ZCCw7qjZKya*s!dTXm7wk(}bBOtO7OOo`#QF@ev zG0G_}N|_{#mZMwRn)mS~S`X&^GG!(gERgcS8Wp8k$7M6>hT4JmEF3ysnt%ABcV!TU zAe)xeNHo|zk`5%_KD|t!<z^DX?s^M`aPZ|nXe8R80WU*2x9>_-A9uj5P6J2pv4wSb z>)8puh?w%3bpC1g%^TbEtfQ3Xpa?rXwJ$^r6J-x#a7@Z%a%ET;w$4;$M$%nv=eJ8X z!k-~J^CqpJe`;Os0WdP#tI<g#T%gLZaMF)~T2UvH8KY)J(jz{8R-f>RT1?Ucktj)~ zrp2(oO*4Ce#f=mkS^oL6n?;bX($0~81`bDBOE_POQcdCg(PTA0MTUgfYw@Vnp~8b? zo`iY$pD;OHJ>v4>BN@?oc5L2k<Kln9kGEhl__(u!PKyp~nyix7|5%#zcsHmMUU%Bl zv>I}_=H;KXFQ4v>zd-amvJAQ!!C*~1sfTagS^TGRMR5+6<51(q{N<CM7<E%1jIWU} zCj{I*8XS`CNRIivS2Io3Xir-P{Lbq=v)u-gE&878%B^YfuWGpNo#R(NsS3LRxyIiP zH^Qo|Uy3|}zLIemN*gtL_^7x;tOck-?dAKkTNex6WaNaujNJ+uv+Az2+;bT=I<GR6 zSw;KLG~tcC>CCNNF1^@f1TK3etHJ{q_s50DNVi#UYE2#=&swR!=Y4caqL-wi?FkWO z9p^$ym3!V8x0%g^0;3iNL@tF69*a}_vXEKG-|i-8Bb}Kn=&y;XtD8W>HCS)YT-ctl zAJ-L8PZn@1v%u@1>XCenzi9g`P=@iLy0?KiO!dA?+`8^0sr=Q*2{AJ2cqgWUfMY2_ zP&8L2>em)oj5XFYhWvefT0eLENRp?L1n;gnW(`eWt5)jdrxCtelNzp2RdCmcJ+>m7 zjMAi$G8y6A&CJn8;F`((Du2ZR>)+!!`6)~kY|ZcQp=GV`U?O^Am=+28!81HajBAHk zfC`Z~e$G+`br9vBHH8}4v=SqZ<NFkn?s^WH1E|PHF3xszj<gHpi|PHwL*ns1Iu-F0 z{9Ltsbh@;>9&MPNiwkX0Yu-LPt-yyJX2D}U-xE~dCtV<MVkkcOdCVoC{*yF|UQKv$ zGtT2G>Mh}a4rSsQ1;GbuJns%&hK1KO(j+ue@iZm%gEI*Nn39tPhC`1j`2!k>7vR<y z4<=Kg+vutsLR-8&`Vo2P7<SZX!ta{|9z@xD)w$-Ed0Djyl^rHtaVB}ksh6V<PT(5h z4wtmosH62z|F)7^mntKPwr-$uTFK#6Y>%VzaSk(ur*M$#y&OLO3m>g546hSeiBe6z zn7Id?xa^@(2;ht~UtqdNNaJ-Fn5v`|jNoOheJE-{qnEkAHYrziuvx*>5qhH|b+qQ) zPwT<???7{Y_8#je^F!fveoq#&LV0+L6A|_NX6NK0?$z{8qhyWJ(CCoLSGfR(Lh2M1 z<CcslIyWYTg}JXHdgbUxqQOpDB*<k7ETq2-`ug@#(tm4D6pfrm5ZK>{jt?0lG!*4k z$cu5VtV(QT>DrmNP1C}0PFwMc*R|U-3!WB`dhkZO{1j^Xg<T&MTqN>p6iYyPDZXth zGWO_Sjso{yFld^<wAQ@Tsbk2AlU9c!y}vr?Q-^1_BxZFl8b^+pY}N4cEnWDT{_c<| znJt2rnv5L}*KXVU!)5AJ2{&d|*}anQ-Thh!!~BeFetvftk#GwALBDiV6kdqpVUdmS z?Jhb|;^v*v)&Pvu1f5Eskw7Da*o_NXe&DM1wX$BTQa`@-*0Q&fPz51QjE3ck;dhK4 z;~G%c_oIn>i*XXNG=8tg{+Pa}I31toH=BV9q%sf+I6!PGSqLA?zBSzM*gz>Kfea07 zJ%`Ml<$BYRqZnqTc7xLu3sxa49+y@h?{g5Bs9_Vpzwy7=wqVTSHFhvRnJRg@63ACs zHW_STuE8#0`$cFYeUwRvX<9Cf7df?YqW6%`IH0xOb*e)s&yPb{;TJ;UtgM>LqmV{> zB`w=P2}pAtD+%cpMb_0=EB*WQ@fDt~kU`{IyTE*bE}4E}Nt&4Jq89B5{tk_5L0S8t zAgaWgf=-=0<l_~*xU}ah*WP1^g-8u9&Fm=REkSz`2T7Oi53?xr^G$1#?g;xhH<nOc z%LIJF>Ee=iYcn)`7emI%8<D3JvBY#adBwVd6XP4s8mC>Jk7qpCc~T`x$b8-{^AG`1 z!xEoup$%LA$7h3F4(I9kx>Fh$Cy;6iTThnaMNp=`Ajz<fT;dkDicmbsj1@V{ihZG! z%-<e##vNSur@^whdrdV!tqnDWQ6~0%AjpQ1+z66_HIEMywpve>w@j-1irFO#1pMET zoXV&AY)=cHaL1#ohc#?8h{dML3gBk59gUVVFZYYg%vLU|?K|Kq`YC@~JpZZvmQb3X z(FaZv`-ePnHk4zbmf-V9|NICVjUZyY-}79N+0|xu*qn!$E6~1kjc%qmZ_GLTU6}t- z)9_kcZ!p&)M7V}`fiC?Mk)W{Gu(aS?$8HQ_>BuZ|+y>&LONTWz5e@^r#IJ{j+Q<<5 zdUk&e(i`Mt^QAWFmdcwrZ;4k)^t9=@WVZ5H&1w^3!KS2935MP5<BA$d4F*3PWpmTU z03YH77jPA0zY4Ok*J<aDN<Lxcn~*0?C#Pk?1}RKO5#cox7F^koWZF<6>-u|)AOkDM zYb2yG4J;zxus=u(^X7JT{h>tbaX9WG)*<+JFq2>+MR(^<<pbUv)BjAO{@T^f`B{Q` z>Dq>I+mz^j2xl^01|h`Mw%GF4Wzftn%tdWkCja^%g#LjPFYOyK9h<BizWs}Tjt3bZ z29fwxHE#1(D#9s}1^l1iyhW;^J=)GQG#uKRHt9GFRxJY^xFpxTj||Ymt$qs?fO*Un zN~?Oopaovv3*h(>Lm}CSS{yqI&f9nt=b$z&mP3_)wrlino`U9k?PaddbQlAcGrDRK z%eS_SaIvHvS-lLyQ=0g{b{jOw34@*qmpH7opT)EjQ~oXc2UVKr%2mEQIrxgAxR3|J z12Dv~`voWIVOSnRwq!Srcmk?>s<jBB9OJ9SEHQ4Q@HiR0vbfTwi7e@BN)Ym)(XGsD z$<g*T_gdI|f?)BVk^$QsIi0i-;rk*8rsD=T27``{Hd??}d|XU2>)mwPSkj}6-oM3t z>RpnC3I`}HdvHOZZJsFGN87OL-`U>kIb7+i8sy64%<BtXi3R4$*5mW{MdFXAUu4A_ zKBM_PYkoHQ=6y50#si%k%&>Ssg_(5ldV@!eoH~v7lCC*hoU}uuMGgB0PssW;>o*T( zT6pig^xxjcdkol;eBw-QKeJE-YND{hQi!-G{}l$8LGA@>zno6SY%4<T)$1(M$|^>3 zRi0mS;(&51rnlo_oMyt*{G>vluV3X*9>Zz??|OSITX4*CO4b{7xulehe(XH`<vkGh zQOp8{Ggi61#p`+h@V1TnQ|VxL6VZAlN}X1SX3)M$rN>2CC*c4OP5~dWF#8MV99M?L zVOUAwi<c%9QrKY@#WNvzo9B9Z$f=8_m)fKVL2MEoymZ<nWm8200yZa^kKH->TA~~M z9l;GRP{HNnysB~Si^d213Cvkc+L1U4#dC5z_Xp9M58scgA>Yli_A=Qee1qIQZvR4X zSzYnv;=6ilj$c2wlW3KzM=piUzF$w}5Y~b8`MqrZNr6gZ`QjBnCb>|V0=vz20bi!I z8TA{8O_CdM4W6w^k@lg#JW{QIEYW`3{KXg^^bLdY1lRk?Tujfg2k>s$t=Cmpv^5UD z&}btFrp83;KK`nG@#)9$ySWXP=C@mGn6UfuiQ|=c8T@eCyVuM&I1^;N<fTjMIq}oD zm(<x@-)ZurUK-TAcmr#-w*{L~C{fVvy;pwgs~zj+clY_ylc00mLOF|zLJAPeE#AO! zAF0Su&E|Zrn4)qi(*QgA_cdvdKC<nVN+cT;*OBXFA<9Kl8Y=nkSLbnaZn3JJG#x$` zx=N%|L0Fn-u;KLREeV?tj{_e0oYHp{umKDs;8-ongSS)KQ5Bs+TUKB%t!WO6O6JT& z;BfAZ6?;E8f4L$r)TJ0eVcu5P`buSw6KA}*opO=V?bSNyV9=t$#sIz#6{)))i9)vj zca44j-##zQz;IfOAm`kpg1vu_w!2qV35Mm9CdZosdiPLnsd%&)YLN-Vp07uz#~jC0 z@BCyQJjh@Q!9HsTGy0Ewa~T)XG9PdH-<t>Z?7!2Sj)%sL4CSy}67jjUdTFer>NCy- zx^>UP6nY=;oOY-0?CWCNu7_|Xo_W(#hU?`1YyWh8Fyq@qC7WMB7EK;t#TS<K369Z; z`;C1c8rt;%?^8u330atoh5OF%>i#K}Nf+tVR;4&Tv4h{dNx!}cd|`Po6OXQbmY=~Q zj8nhG+2C0y!^b4*{npa~nKoss5!v(iF_vNL;DsthesZJwxEtJRwU3_qx0Cd`%dCIB zZq)y%ui0Q8jqYO6!iz1VzHB6g!;^ZY5=6m<;@D-4YJjRG8{Bbg*wW|u(s)s>gqzzY zDQB{%MP{zEWM<7H<PkoK|A`pkPj^~iQNt-s_jJ|`w!qrA8>(TVxHeuqU+>9a@53^Y z7u47Uc%y==*60sYY8Fa`_)ETXI+YRkp?a|l(ut<6HWIy>Q3A~OqJudNU&i`0L^xXy zf@M~AmhDSkS+ILg&xacr`cntvII{d`>Q7DV`oY|Rs2x}?;}|-<X)jPfiA5rBeI5gU zuucvI?3F%};(X^1XEOa%J~^7Ux<?T7U04-ZI6-D;LQvs^qZ0Oo*_cp6wi+y74GAc4 zikhDlS?qG!JX{9U<^E`KRH>?v7r|c}y7sDVUN8OD)RjpGll#tHAI#a*USIN0tW34H zOms7YpPQ$KodA#NeeXC4ig~JJqgn_l*&qJj-dbVA2Q}G=<k$A$CiWIkerP1ybgZ83 zzNuD5;1#J>8(vPa&$oVGl-sdp%1fsvtWQcVU9Zyfsw8W=m_t$$G=_|+g0XqO+9X)x zCcM1*s$CV{bNa=4VxlbkbD4EYy1TTmgHg_0A;AzC8q>uWEmcj@uXzl~6=M~-F0Q%h zO2=Q+Nk0o81z@v3D=vQ*w0xt9UBGk$;Ey$-0W=){(9BXTZP#3o+%wa@edAMVa^daZ zGLt3dI5~`8+i^vuU1r+4Df;uPc`G*8)|*f1v86Qwol5SK``>KR2S^|*D*pmsuPO%u zrhITWd~s-&ooI=DV?K5}nww**4(t{{FLP!jj*7d`*N-)m!BMt_vsU_=OBw`RQT)>y z><qd9jZS73hdvgD2iq7dxki)5rM3ycjiu{-^A86gBhGe0Z_sqVeg5o8sNBuJ4m~3? zJ7%MPD~ZsBfpAb!c$O_%*wnBLtpH{<I@Tz9Rmx`vc+LAbPkHY9pGb~|j);}N!JQ|$ zeRs_pv;BdC>m?&x;FB_O1pJ{rS?(>*vz_Lk2xCszI_;ykceNHh#y$Pl;PT(2X|lro zv5`UrAN=~dT+Yr44c(J4;JH%oH)>mb{!X0JL-jeJp6J|JhWqr`0$ST<K*QE~RA1te zW0&Ii@APHnKosK(cTg7h+A5fJ&M<=XW#jS<j;CyTr{vpP?Ef<m{gC@%S6&36D}weL zRiyj@V-rvl=PXY^PwO82NfK2?Zf(blI)`HdK&0jKaZ`Vzt<Y~-h{zZ^@cIL3B#%W? ztQ^SO60&MV5YBq1Up^>+efFl)O6Pih!v$wj54fb#;c4^D!3;y;4#bfSc-X~uiJq|y zmpKvR`88DE>2Xl?rU|`isBUu+opKh}sB32%yXQEHmq3e?nihxMDMN|{F~S*OlnG#C z-jr+M9`arWXf2TjWmCi??KXm3H7=QI!rQJhpA9;H9$CnQr6rF(`||sr<wfl3xwVgI zNwju~&R-&uz|_OhB*b{_xRV7Pd!-2SUg|*u@UQ*|^NIbr@fx3y6O?<}3w~(9v^brh zuSMY3;k2EEW=vN;Dkv&{f5~&1+TmCb;vY_ODy?_F=_-knFwhK&H2Cu~#-;$fV0{|k zm*=EOLE4u#7gPQEW?v$|;a-ZUE-YpFubIhTLTJ97M+}hC&y{*3O99|*S8DP)spUE7 zIKbp{zOl8Zu?emziQROnzC1m{owgg4tAM;h$sGG|ASEklb0El(m9E3rFR<(T8rMsO zoxdNwrBdyTUyW=qI&w~8oSW)THxl#da~O)oM@_{XS~@Qc7o3<@1fH;oCAHCiXc|J1 zMg%eKf3|aOEhwI76e9jfDWR6zv~%NQEYeZXGAmE-fi}_^K@(*Q<`n3a`UZJTkbl^V zo;a8#WE1_dwYw#c6D<Rav^Z>Q?pJe~&+Gg89_$-gK{{BtM@0&Txk|`#Ua0ZUAi-#n z9aG8FITvd#0N5uj=-sHlbDHAKm3{lk=V6~~H7<+`5Bo2;uo~H7pCX^8VvK187DEjX zBa;uJeNNb&uwu+TdWu}KvPmOo=9QJXT?RrH%j%>y_$0rKb>!LmFp*Lo;Q|nBInIi? zu4m{2Pib>>;af;PcpSgD&xU(kimk*VWKd`9v7e<jL}G(0YG}j)>b(;+-O^I8hUA|3 zo#PL@iD*<Qe=eHEEnEI0Cgaqi)q+TeTSi52q)e1)S}9Hc&1it@V&1E7D1rJ4z?PNt zf8T5*5e>$5_~8F~1&Gh<B4y!NCzVy^&_M{{51uS~%^5c`G6}c6m{WG&v_9OicDQ*9 z$GtqqnKbO9D~jpwPFeOmIu@-Up`awje)FkSu%2#-N~}qr({xL->!#=T5AhYz`x)2N z1f=(F!J|^y?VPrlu(%J9puPpl7-w9>4t6j2Sufj=HPxaT{#k@zTUVkVRug?45h;gL zbbnQDBLB7s4j1*Hp%es`=NJ$h&yC>neJv9bPSR9iaoNSV#cyaUK~DfB^_n{J8s0<u zIud2j&_vYKQ)g0s@uMe-n4}nfY(4(cMUIVKg^CZh^?kulY4MD35cW0YL~zm746G#> zIM{u~S_{OJhFkS-s`Eo0-?sjU1<YD46Fe2im%@fxE)^Vs0nd)A%Z?>tje)4Wy{ElS zt(3>!6{sB0csuTR|Byl$PSEBUo6kV~LvAeY-P+$JN~!}Z6?)Gok2vzP)5yr&1d~Jf zYfr2JySy2C1_k=qbH901OuaMjlq{XVi;8d>*I>;u1IAR}genz<-*&Q8%zv1L@%{=) zj@iDw%Ejkqy0;<3P(G4!b>NjVoD!-~i%^Y-qJHzNsa>pcnm{UxQT$ABYVT@xh=s>I zPg&yUeZs6A->%b(m-2yUl~=+$AE{5kOtnb#M2A0Sy9|W~`yq<IFz0%}ZH*w>DQybJ zS##v7Zs<lZPAJ%@*YB8R>ZfwgVo5rwe%|9Wocq!(-2}kV-KpuFvtXHanu&q^kSDV! zUjO-Ngqld6s?>^`tj7t45$t9|^SQtgeA#irY)V^EZ}!*@NTWM_Y5CKJD2JQ)xCHht z6M*5P3eqiNW3ELl*!ghpo~9|NBU;1rUXC1&A*)x|;dCo{tS!onwT^GxT`CU3xIF^Z zrQ-%`WO%>T%xke<yp44XLw)WOe}i_uWA{@C7J~8n9XfAs=8$!S{Yy^l<MH7?w^s`d zIwK3xd}%6Q%~{{1Q)8~04d&Y}sf~s9&h|sy@HGb6?KC5!XNBzadtJ_%$Se78rb*C& z-m&b*sjNigO`!rl6`?-C#4-B(#E9dCC?(l^%J#TS%r-$PEqk#@%A8GIr=h}c_30e3 zk4yox)~C<EOTgZD=iV5wQgcX+sR;Q{mbLh97hxlt!=6_0|3Tdq1aKB#F@ppQla47Y zdxK+ag8`1gaN;5*dHty6l{RK2<(bOtbvTmzd)gxN$%Ow*nEAU@t)`fvIUv!nTYt2$ z%0_o@fFHWSZ?U4IOu1+$U#!)BRKMq~4HrEk-0`z`$L8aGHW^osGzwWY86GSDarGsC z?Fin{R@Nn`@sWp>m%4)|_#x;hgoO<)pn)nSB=q1q@2J+M8(<+a1b3d@Tw+7;{5zs| z4`deJD|D8krF5EmvDSx&7Yo@l*3AEs<kx!*@296!d)8}e!{+>+;)6icoyfI%yy&7X zF!~?U11in79J2%Go80pa>P+*0_XeaZ7=OLbK9Z$J?~a6swt{>I6@+Rj!=7t=cILIF z0%@f&XQs8mFn@Nx%osgX5JeTp0d)fgCH}iu<7<D5gGH+~oyN;SDFsE&vDxzxeM10{ zFnjxijvnqlP+8H4=|%PC()eHRTeaBV-dAD6YkiliLiT31kBOEM0So?=Ucd^wMzJ6H zUs5HvNOE6pt^YAwAT|k6PVL^F-miWBYhIH~pu?-`uS5C2RsBy$t@f_pweI>J941y= z5~tirpCZf>KXOk==v2q>b7ld(Bt6_St-iO2G19#?DMGiKEeqErTzqbnEmLx-H&pRb zsNWsklv|G&Ph^jNQ9?LWCRf~(?(`fAl{k$1Zb=*qsxf@-R%FeDFZ!{Z8^Wo;)Kq1u z7RzW?-kZ%LMBQBE-X$@%QAy0kUUj}LSl$`+8{8o-H2g-o($>}(70y`yyckf!76N@N zDmcUv#6e<s52U2W0;s=Z$o)%{YX>q|(Y|2V$EC)^?F>e+`ku(^vqyUXUn{>1P2|i0 zqy?c^{P*>7Oo!(qGtH|Z?0>Ou@WjyKcg-Uk1sgrDeAJH-ycdpHJ!lT&evqC}M+kKd zmcU*l?Z;@tU8NXOB#U`=<%b;33;_vx!C(q-{UZ_0NsP`W(<0XLr%2H%{5oyhtG-Rx zZjuQ;{5#DaoPU5-{=!`2X8PqWq2<ViW24{S$q2%iw2**yWbBL5K8wRfT!O!+LZxeD z11OtLFM0x?56$MTJ7<#2w}@;Dm@zkss>p{pvC)<bxN#XSZ7AQTy-=>I9Es&aCBU-6 zHxhekyA+*G7BhSsJ`(eM_dD%w^UGEhpeKr@WpqJL-Vy+LVxLuPTX4*Gj0^l;TryvL z1g_x^h}Ib4p~5in>`D{5Y+rKiwKD&>7ZyQmZfU%H6Q6uo{=*os=Xuqe%7PP7o=N9> zg;7paX7o?1MrR1Zc3EBC)&J-FdeKtfN8Ep=?pNpElqh0;Nwd!Le)ohR#kC5ITsK-) zhA&-0vafoi83Lj`{fmi3v7GgLoTT9y=*eDVq`0jDb5vBHK5KB4M2c+Ay<JVbC<^{f zz^5DuIft-+|GeG#eNydt5~rd|kW*D|2C#Sh(~!>h;;ZRTn6|5su47*cTJLv_xMp=u z6)MS^?qYbQtSl-<n03^e$2syq3C*=_^{13SGElzii3=nDCI6fZ?QLcuk3?~-U&drZ z^LW}@Hu^`3TgpgABJ;)H%n$!zK<|GZ?xSjhmASqU%@^20@TL*{+>`yQY4bFTTMEa` zl$xAIuCf>T7!m_9tnBV}op6O;CL;1Tyr;c`r$92fFKN%zmqcN5W-kp@#^}K3>(P+M z|M|_)IetfVX@IP__bHkvpG!pU9MPpD+T+^<onQpd1#DZLIF@vljCNG*`c|n`gX}t+ zW|}xKnKGYMR^9u6kT}Cj<+7~KqwhG7Sc6LTK_zkay_R`IpC68<bF?aFboJ~zWQDr( zX#`pvr;GKbw^S>g!A6FPIq<A8uL>vP+<1d_sOhvXAhfo#O;IZNGX(k>JC<B3S<^y| zn{Zl#;gu3fjwvGKQbsv${CodzyH~tIz@zZD|B<3U%M&TOBq3N^5khzgp2N74g6LXy z*z7hSO>UONI*!r!{vCa<FB%^tkebaG`42TuBU7Zrv-b9qUVAJeI=@Zws4_r~j=$=C z4R%QQOj`R(@7X2QYGA|+*|>L0Zbf)~gu6?}In9a?`m+Sj2;G)HK5L&^E-YKSUn-*F zCwC(l0xrD_X0=`+^cp`YlH8ns8pM-3h5J0~;??f@dM$B4>XfMJz=Ln-NcS&*Ln<Oi z0Cw#iVcT-o+gUkJU-dg=<wX(QzX8@*AZ~RbF`W0vW_{mC<EHSW@#<4M;Ma31CSCq* zuCE7G<`r>myB!Y*?lq73&lhV#BY9(e<isG3ljnNS!#JDotMGI}Q8{BWOZmY%Ofe4v zH+Kc$x1YxgGGm{nM(96y6vY#;wO3OVJS7s#M??*b4~^pmqJyO6Z5&_Qm9zKB-9z{c z1(~>w^3phUT&xdU&TDWBC{O9M)b?IP5zkMPETQx_?tBoKTU)Fz-uX-mlWc(wHkB@f zviUnz7E{Ku!#D|VUeL+D`nVMA_ojLZ*sfLRuQs}r`@^`TL(V_<wkh;#<2z}g<co4l ze(IM)g!s7lNjHHz^DRdRYqz5x;sq7lV-eNrSJzT}B)lnh1^#c3E<6?g(Prt%nXzw* zx4x*zj1v(hWCo!9IBtF}%HN}TSJ5k|HJ_68vJ!*0$`V$Y;j+CT6i49q#T?(If}uO< z+pmO;D$(U&luSWQOOme9r4Y@p*BB2ca`D(9-|aPFA<r{&Ctw5$d=j-tlhuTk|9-OJ zMvVEo(t}XSG=iD@xrnY125E7{C~kTq78?NpDQTPrsZac4D1~G(;}l~hV+1F|_{6)3 zcejJk-(9dE*6_T6Bkk>GdkPnUdknsvP)-`uU4lHjzZu&XN6)sA3vxy|B##c|f!E5l zOgG(Ej6c;B-E;xD_np77;H(sO5ro3_VczU5f7?fnDsb-3?oG@R4Q&;$45b6>8|*TJ z`5weTeQGGG7FAnAp{RGRO~n4+M4SOmw&Vr{qdWGx4Be(bV_C~dn;Pi1pp)-w(9-y_ ze^oLn6{!En-_}nx47OK5NhU!~)Cxs)9hO^KQ|%A8q>{c}G26UGyiy8Rmr6vtE;RYd zt#hV$l5;3I>T<vCn)Iy9ZvD+>Fs9|l59%L@G*rN+IW=|x$57b<0P=Y(iVULEgc$Bw zN%K^J>SEEQsJI$cjC=Fh6ou1eSLVY$u>C=y)a&FH-21{O?GwXO2^0I|{Nq8{!@oEI z7FWj*D|URieL9NdAbo@HN?MIlly>;-WcVrTuJvy4+ue_D>IXPdych&LH{P;rHbovu zKPy*TGzrm;dg3=<V($Kv&hBLV^JNl<6}){Pz95Gl^K!ZTZ#UDrADjl+w?k_~nJy@d zAVfyQ3X}!_m+`Tz>?5UUm5BxWvdocc8q$-$Zo*q5{t6V^M0;>Y5{R$ITkHnjhMTHj zJEtSEUJLi(`Rs1-_%>5?f5(#xN|+<uk|f(r({4TALiMMZLkxi<xgDqYE$e{Cj9-pW z|DWi>1%e3k8}KdJRLdjLat(B$2TB0xr|%|Y@b@PSHH|}?qu+XdTk_@x0wDgca%utt zO>MhVJOIlKwAN^x-%MK10ov_5u<gE~b6YCHvN`;*-A0iS7*+BhYX@*g%J)3mMelsU zB`jfq`emVH;T!B5;&;%`nT63as6T3yVxL%dbx${UP^Si9TMVMwga?Lp<|vYPC!CdV z18<$9=>dn8<D5Y?=q%rWgyf+UXh0XEc5Vzhdl}<Dl|te#kPR7Ns4c_7u~@Lg{&ypC zh%~r~VaHV0N~>Im;a1Ggf=Df8k?08`W6M+){xZkC!Yq!BoH3aEPVTja?|VS;?Nr75 z>>uSc9D0!sE^>#MW4_<O*u~^gMvDtpzz%haB1xr$?-0Y2lNbpujLc*YYFa;{i+WH_ z4xHG8BVvB9kMX8vsfj$Obl_voFvP|0g~$E0IK>Hex{Ge;Qlr^dF{_t+ZE*uY6E$p* zh`KsOqz;cjv)!UqSXn?WrNYJWN;D0Lf^sagkZLw`8y?hWg}^DH!uUJLTUHx3@*jUs zr&zYeB&bm5KxdwrT}^mMH=5OT5{Y*-eI>>OQP%^3e>g*_8lY1qg=9MxWes~J?c=M* z0&DUFL;0pa(wMaLiGl$_eFV{xkMh%W{zC{w)co3_J-A<`(~+FP>&3wv4414(ijLDx z)zm(4Z;US=y<0*4IlR$_Df;;UpUtq4;<2$^l)o`Vp)ZOS1rK5E&0|nC{X-&&c?!Il z#DCz1=%#`?W5E;>iTHv+yTrr;(Zu$RW0YrYr&Nqek|?I@uD*I)WD2&}$gOtc7O3Zp zLh2t#_77>uT{J^-Oxi3{zopHv()JJAd1|C%)Q=C4AF;f`P!3=-#G~x*+Gg?}HJAg` zIE4x=8lB3vynhquB`wSwUIL8cHkFDVcz#n%b<<YtIl=suY;_|MKRwV6{NMi%yvLBM zy;9@fqM~Y4;|HbDzL)UDAmIIjQkzqx^R%`9?ZN0bB>2sg#Hke*wA)9dE`-HBY@0*f zK}P>>QS9QIfGQzlE@)KGGhC^D*k17vKW0_qC&Cj;-AcZ_@=SaxIm$2$F0ElZ->S$P zy%vnccVt@}SBzFVu)@}MkIG*xyPizKaCvuM0Mo!U7E$1-M@?>`yD%T>{6d{TANmJk zdB51>HDL;~4gk1ZateofaV-L2*f||BWOr~VN3%<8+i6bWSWTgd^n3RaqiVQ!HVn<2 ztwfyt)T26*VE7@Hkh!<o+_V?-jR@r64keg{IM7%9L_jg3$*f#Pz-L8e<3}mV3uzZt zc<~xK=R7hes*+RkxsSB<&P4z_%l8u;ow^QNl=S~;?>wWTTDm^p-9VG0geK>la}sDW zN)Cz=B#Y#n1f-kP<g8?9pizPnl$>)^M2P}T6hShQ5$M5tpLgyvYd*}ZHEY7V)|_wq zOVv5GtM>lys#U*}C4A!pB7SHanKz2<J&M2}R}6@(M7mzhs-UsspFUb4b?fc!iG~Az z(6}ack<a(w;vtJHmLmY{bl1#@iMosuLF`rn*UV|%&wNuBFJ88v5wqWa0?0<%ka>aC z__3dI_X&<O5C=#UXGN9zl>IKk|E<&}iZyrfe0{d~buy}jc&_U5jQI;54w#5-O*OtT ztR}aK*1A;js>%&4o;k@Bt?)tHfFM*$8C%hscn%OzH$ZD+hUt|>UL<MHzgfR#8|zP~ z5e)_hq6c9+LeGY-5wbwp5^<GxoE^@Nk)PtbE~&Jh!1&>EQ9v7kI(L}Avb9YNJv7>j zC6)AD9~qZ;R~p`|+Ouksk5APsh)G0oT;QJp%vF&O;}SdrlwD}m5UD_hE>HcN!N-XP zfaiPy1z5afTz4Z8JE@ohSx&WQs%tc6rx?}A;Daj=7JG{W>7N^Q76c&{uHRoNnQ1dG zZrZ~f^@`_1Q4vS{&pWWneWJ-rRiG}Vuvfz(J@k$>-h?fo*mDCa&L*rUwgwteOu*sb zK^n<Wwi(M53amB~db8>)MB?KsgtR`Z9!%=oT2MO%km0nIHhul#^V_dyS{kDmL_$e# z95=@s@is?5zCvG@r_b->wrW)KxsvNM{6&3O!$xZSiws*b-feM}%!)MXFBsMj`!xlW zs7;&j`tubW;kUe``84oTK1h+EVVm7@O*0J-%`_^yeu(wvX(ZKUO#$mTNb7S1{zHhZ z@B!-#u9!+|N{S4y+BG~2&qcuQn1bcT#ullfUDkBn1Q_?kM{*vl=py@-U}G&y#_p%# zc<eW-XT(r6p(K{<u}v&RsaGE?QNb1n1rYaxFrswKR@kd)5p~JS#O#3|a+Y5+-|xPl zLhr*S<x7UX(nGhEHE9Sz#?>-y)9?mF5xrH)0;!PX3jod{=<z=6e0{k8Qy(dM8HB-v z;p7A}vcm4VlQQ0kN~};Z-#SRbL#bVoI+2HyDqzu^SN&`ULAMlL4FG1-9k><O?RFa7 z{BaATLkBp|HiJ;z6p!{}$Q4sSe$2M^xQnTFurvFb>c@jbOwpJ^xKy47AJ_&<dVBy> zheF(@4pC9?BTxkOBoR>{pTmF))Ion4tr*CSw{rg+Pado7y(5&Ur7NddN52MggSU`j z6Df@-Qok#ZXFcW+X*!r<(C^DpRMP{Fn@b+Xs-MG><Y)QR0yURSA$U`FG>MD6f>(Ke zAZ+>wKPOG2VEy2MSy5NOh9b6?Z{Wdrs8!~i&l)=^Bv3%ApT`*wQc)z9Zv%%*V?2;+ zKkQKzb|z;65*^>Q2wdAR);8l6Ue@g9LEhnUmj40LY5g%&l96Jcxaq_C2^S8bX&Kd( zwiT}|{+$OhaAWgMJS&9bFA6)rbjP7@mG^hqNgLstvV!U@kRv^IAOL&Zz;%UG+w<vT z?q|{hc*fHprazz@fVIs&v4GhLghg9##ggKg5{?;E7104%v6Mu=uM)?!jOa+&iQj2q zB@&Inda~bz$Cw?ibD`2IHq>qhNt6(f^ZqMOQqHU-|DlqAMR{E1orwivl?Q!PXZA6O zo#1m)^mjaT%+NWrR~bE)y`_SdS#{fX0xh*2Yx-v*tzZ=vP2-ZCcQ%pChKVSqmeU(0 zeEPj;{(o2}P)UHm&IR0|l9N3|oX$3#!553+djjuxwB!IrOWxBkNu%p-2i8|Tgh#O& zU)u_fJbOq4^Fa1_SuRtNk1jj;A6^Yy=?^mq$t8lVAFrC^0b{aE^c|wNCj&n`P}$e) z;>mjqe-~m&X}qGz%f5$*-eHC>u@mjfc9DeqCSAHtn49z9{dx^8L_$LTVGseQ05u5@ zY@u>-;p9JK2*G{VWHqmpRt@CO$!8AOIqXG=G#L`W&1~fUZanr);0rO|tn5cgMmA0Q z2x~~)pLV$2{-W=g0CC=F&eGD-2GO!OqM_0Zy`~o`(mo}w!jaX`YtsCNsE-xl!8n_y zmNy7me6(K|0PPyp7I&-^at8V#W(2_iPeK)a|A39C&;MYKKwAI}F!}7$R!q#)-hsnm z!cZROAnNF##1lD)qa5#=0AgO~LF{u`!<f}U>8d8|JTAMb4fD`0PUq)AWx#*1KqkO( z@t~V-eVOpOpGEz$S7bz}L<6F6yYuYj*6)zzH(b^W5+w9sTiCu_G%ctSu<XxP-K+UH z9n(~*mHB;5Gy2ZId6DXXS=60`F&kcRfvr>rbXoxOk;*HO)&@iF4kQOHklVf_!BXM9 zS~jYSs7XnTXvM`&8t<A{CHOb@Q3qnR(-L`6V;|3Qo)0r544K>7ybBzkBj0SgmF0*2 zL}fH9EYC@a#<7&Fap$^8pz7`)?Y=qv#+YfRGF{dRu#?<2w#k?Om-ilYMLOqNb%oRT zJ|#P+(*mFC+9Zts&ZAwSSr&nM?0~FR@Y?B;fMd9Yi*bs_Jp-^1)#<R=AAB*{7~0gC z#a`3Pt^-`;><c+?KN9D5379SawF1g;Z^RWHpv}C5-X4cx=QvwLLua3hp9m!*l`Fnv z>fcv+Wh(}i@(?XvIwEX0+*Jzsq_DH-JkDF6YaZtt_Ene+Ed1Y0eb?-z8`4hiJ0Xnh zJ9BF1IYEyInZKGL7N$n=7K7qtK=9O5@@r3VKX9Mu*8_9|rYL|)yvKh=jLk9(UtkCB z?E;HZNNwyS4!f-cN^oxe0&qE7tGqn%v0nMj&@v0Yz{5V^5&&zQrx3a}3S4=6dAcxr zZ|s(i8QGmj$xxv;CSjM4kO9I_sR!MYz0#)L1UDG1UKyfoc+@q0v>^cZ-@cug1dDKS zACro(K;m47owGhoY0a?Nn7=|09l@f1Df<8%ZNM)B@*S`$>Y)Xs0OFrl2x6RT$4FDY z@nR+uC)n7Om899M-5;KX0_oo);Ab%FuY>m}YaWZx>&bZ%&rp&;-{JW)$2F|-Gw8rd zmG?w|h!0=O7#J{xFWN=Dfpo0~6-FmF@kbwGu)yHgmG9JBvI16<KqCJ(tal71Ul7g8 zIgSIU2e!IYvKb#fjG!^<*_Q-oE?U97&u&BOiu9A0euWNLBUz$1js|eyLp6(vj{x4i zZjcB3Tq@<Trv4Fz&{9DL8~D$<%Ly+&U32X!eheO>#C>(TFdpw41|$p_pNbZ4<^O0^ zyv@5U*NY|aImmi+J2mH|b55IRsi=|}rw{nwp}6wv82_fHk%Rs#)$D(x<r(1CNZ!Xn zHoMK`heBwTAJVnhPK$~#v81xCOLJeebsZeM*iCl4c^i0g5hB~_H_o{JVo))(V+s9& z<Km~$EO@?@w1>I2-*SX|-R^GGHd=45?d6E{ynfz<2-@V!1v#Ol?)1Hn;Y+n%zy+7O zCXT}GAt1QeZIq>%>{pJ0hrAncu7bF}{TS;T+)MmRfgwpdJ&U|G0j$AhgT}RSJ1U`# z9)WFoq0h9R+x_#y#&%vF3K0w*Jxw^~OX-SWF&Z{plU*W?F^=rHhwHb+<H=flzk#~w z)M%ix@c2dNlqQp`wd-==yjAl1(~B5q$D*r=>@RLFT%A%!j*kKqfi7=BO@S39h*y;7 zL9ZUWd>o`RYkyuP1rsCNe?=rkp!(_R@%mg??dcNxslC#{@{^}Jc!dsCc`^(Z6jgm1 z$=KM7)}|j3ANtHsr)JSXTUPK``{dnqWqeFj=seBNS+ewnN2f4wwl$m*rVM$F39Fm8 ziAv!t5B%m3KIEF);1rdA9Ite>F<i?oZxIwG(bTF)SY7qlA-kuXX2HNC&9%Gn*I*E5 z7>`}6y7(|f<{0-H>mCWo#`jhIk~Pm%_e`2WxD?+*Q|(FP1#gS8?XAMgj<t*9w=!+^ zZ*2V*Dw)a@-ga&+$u25{zhL0Tyab&!VY4(6`2%3q5IPKILNBe<X-TUuDjqVyH^Sfh zrnefAA~oRV-&0n*=S}uR3?zBpS1T^l<L|d#oTv9=Mpok0fV{w)YUgzcwl;f_pWW?6 zxK0Jr?=I@97}FP58sl13xkGt1uKNs?0IJR-=4&mQWA#7NUwL;57z2Kdvf#qVBH<WJ zy{XDvk@vwWQ!eoX35O7>b0;L(?qpb=#zd$OIYYBM0+(ERN>|J3X9ZUjEjev|{B||_ z`=9L0G<XkuLLZ(meBzILds$~iQ}^BU?2F%qWIl$N0o^t^d6`x;d)**1-9B*>%6O#- zaQ_Iw1(1RN^ys3xT$UbdSszypI(?w+sNv$*6y%;TN6A5PyskeswNh%q$?n&o7Pn`y zTg#nCk9%*Mv*&)e=k_D+=)?~JvPpH)Cw^xhJ^>6Qj4r6MKy*%Qf_eMq+0<6)Z_W_> zU<yr&>DXko2NBMGE;1d7>;Tz^DOdo!@Jmdke7$Tm)NeCIQ+&c3*?#%;vD_4n=<f`M z@j`PS<nXG2eM;UZH8|k}T2Gs2jCrm|4`_5YT`m&d%LO=6|N0<Zm2RFl_CcqmWi3P6 zC7K-PwPcdJ8&QG2S!<c;gjq}DVtMYf4)6`{U+|H~MCL$v<@$Y{A|0MD<mQLVTmB`L ztQoXk+3}Sph|2YdMRBN9yaB65*)KIy{aqp9B5H|RfT;}YJY1K=>h6lRd>@M50$|Px zUR#S74iOCUUVsVi)RuA@0XjxNxw!|;g>blML02hmwnp`=S9AQFQ}EDj5L?KZCjhYE zsbVnI!7o>S6on(76w}j|&lj6w4k~*Me`JR9$clJzaF^t}rBCYrZnjrX!%CfPjl%9j z(a8lf9!#~+PqfRu)&o7d!wj@x45+Zp30u1tzTjb&3sA~u{kHn3p(;N{mkkTG3tK!X z1fXdg@Vi2rO8|f#5tIEeC+?yQ4qYk+Uy8oY*dSrzLQD53>!jLzw%ptT6Lj|p`n8&G z+#VWt2gSXyrV^Uv`4aiEi2dl}WbgDQHcTtMv70@)yhmlvD&M1C%3-I>L}E}8TB=@G zD0^Vx#em3=iyXik{_^e20Uw$~^&J2RN1kBx1Dx$hu;qP+ja_J`?{{Y^gm86cO(9?j zbHg@K`2(~4Cbbr$9Npb&LA`e=tV&}R3eZf0Tw)fqi*`n{5OaOSz_iIq4>P2t_n_ZS z9%I#!*K11R)mpELX_0|@z{j>7wiQ9@_wz2Va#lQmL!uFk02WB}4aTbV{zRi6149!T z$J1&5qb<@-tWys0d+$GE@9^4`ho*m(u2<h^W$|OF;^PDPu#KoGN<-&x@*^iNG<T=u zpXsmeglJ~3awH9%Rmpj|P-@mq=kK3RwDSSWw3h1Q67*wd+do_yo^74CHeg#1j(7n8 z%2_wJk%9~5q@8VHf25+u+ix0njt^@d6t~fG@4Pphm0-u&18RKFO2jreKvBr6kdORC zU}3q;58JB{mtyvtX|SCZQr6i^<s^8mn$Le2I^xfGXDR;oEZo^PUYi5I>`ja3r|%t) z5~gbBF^?67$YFWn(?AHeN*M+-RTX`(JlC&0K*!(A-y_(5aa8xp_YHHEO9eqzp3<Sr z*+jD*fVZEYTR|ytmxHImMqKHBgZpQ*Ct589X=Q7(uVXSe>Q9aBSevw;c^evG?pRoH zr!QEAtV|@lT%0+s0GEEIW5#{Qjw5IpMr{u8erJt?Bm-Y#td!*Ll4XzWel0@Br4fir zx15kJF?LW8P{Si5V`6(gZyWgJKl4j!Xc0+T$Ok+O<#|Cc(d=g`W}Vlm;1$o{T%DWX zwkm->Ct$9X;sl(XqweYvk$RhX$>TdpSTNg_B{=3P>lX)e6wv&>QwaE;B}xKi#Zzs@ zlv{>rnHLZVEe%^26PuX_qI>s8_G0##l8le}{EPa4{$CAN$)s=4=?Rn6*&@8$R;;gU zPEO&!AEnix+Qt{;bWmb!hlvo5T3s-kjlWysu!yT#V0yd>XZnSSTZ^CHG_my5c`1Ma z*d!W334oH}-C$<&vB_s1v&v11@^`y3249z|-m@6a*hHwAa9W+dVPdL}F?aUu%Zb#+ z|B*<-x&L#uJVxS2Ohrp@!77yP$B(q_4<9yW-LcbPPvyDDjGC(nj4Vs8n(L~je;oBH zQVs3BlVcI38m0^W8nHh}4#iT4CI!t>h=>YG*qUL@iV5?gO})j5bcE#!4YU(Ypn3t> z<0-&$T3}%z9#AEUx4wsoE4unY%#)y1XA5f|td2NhQ+3U_r4&LPBlDf}?|Ah;4uKXg z2C1lL>2x=rkN4&o>}O;>;gb?!Ge2VikimX?-@C1W;hWd`mh;LCp&DcomE&wj>0|Mv zg&f)1Bxq?~ju8l@Z_n`F$hahr*c65Qi7u+U*;Zcp!A{2e!6QpmuCq$T0Z-bX!J)~< z^ftd3uhHX48ZS%HwmoA%DKh`<EIo(n5xr>A`u%C^6XFKI_dL<tSV)A0!MJcM_i%O# zk;viCJ#<ZsjSvnS)e$>*nj{4xc$v|7F95mq!}-c>;=6~f7QXM?QS{uMraA>fu#O$2 zu%$f-%gZlP2M@w{NiMXV(_w2LOU&taA5;`QoQQR8@{<T_-QRMon47e!q?fZwk9Sp} z=y28scz<NTg+ajZ3ryvN89R|{qmj{X7DV?LbB8ZOd2PIrC6!xHZEpU^ObTCXjF0!B zj*>bX3F(<q=+{kc*JB@?x>R*OE<b8|FACN4(QgvAi#ksDs;Ucm3+Z?*0X6F$QNaVo z_LbgbR(A?do#M_fPxG`;CjvjMfK9RylrS4Iyao)$S07#@^FdI7a!atsSwxvTGvqLH z%>7&4E01@DX^e(c3jD?%*bX-fNBPnB51lZmTA(A!G4k7H9r2G>!Er9S30r|oPi7Pl z<ZG0OvbiUO5<|uw^+kEUQqArc;zGbLlVwLqD4}b704jSmTk=r|A$e!L_N}^r;95ie zs0+UtynIq=)l4ysRA{&8U}kh75l1Ksg`GCL$0jQKG#92bbW~tiXlNsUFa$_bUWn=3 zC3K^l=B^MmT#$Gs=2OxC>&*?v0W$CSMtp3}yh~=uE*hS2k{P}Hbj1H@j&ASKbci|G zf>h~J|81WCk#w8qBgTI(&DA>v!qOvL>D=m+x@WB9OmyD08RJihjo5c~3t8}C+s69j zJ?e-sqVr{He6jBYp_LS#x;soNIHBwOX`P_FCedk05^*fk3gPIV`thZqG$em-el`cG zS!8&}Iq4TSFDp$6ea{(H62P`7T_J4K{`0>u%OHk7c%=7HO8-GwPWqo>C;u;6fQws! zBZAj6iwWE578vDlN=aL_$=qFi`-otx){3?|x?QNT`A2rIkZsJGV#22br&bry(NXW! z%Mbe?J@v{SkA{u%It^}*#>}i<&H5J+VGkWAdsg)WGoF~9tsf^;FxmV0`H3Z3Dn{2T zR%U(v_N{_WTo5u5l$((2WP7(mYR7R&5D?&)0D|ISDPu6s%_?}KV_Z_yG&Ldvx(0PV zAs78CGZ}EBLDPdJ#cOV+<Slt)Xhx;-???nP#LW2lSG~L(-Xy5sOLbMhX$B|apDaR$ zrk|4V*Mv;I`rhygvF{oVel*NC&#g)25nADMCaMh|Ym4ka)}uab$*9D}q5@P9E1uK+ zP1pIhTrZr=0l&r=@o&{_(OGA`VEVltpLjQ&bzE#*BF3AG*dT(p6mPdeYt_fo9N3}K z0WIdnmB)c}4aHd@-l)*|&NnAX*}r!M1Oa@ic=F%A_%J*RdDiXjqWg;CB!TKv=EI>k zj4z#JQ7!h#m-8XnEN6y_UTcnC*vmf>yZ{8skmne4%#=iFHQm|)EisU?$YDjYmpfm> zT|lGw`^2iiuWyuUz0P#hvoJ(!HMNQ{5i$E~@soEA_{YZLddMPUbK8UAMs@+cfH>9A zsvy*WrZIYQ;aKU8Osc!>jeOdoSI*mfVw`^L_uO7L8j8RnSvyLYEm`y;W;*O;ietDo zV*er8OSAN*<NmPo+zM^o*U@9jzM^>6bxZ-%5EEk;>`5Wb=SY*_5<X#$5W{=#FdE;T z<PEK6?%<f>z@E1H2KbYM(|4$@{OH|n@BD1NV6&Z%RQW*lsg16emK;1)5cz~c`~G=n zo&IflcEACUMNZwum^aXA-w)b|Hf&qTk(uI|PT!P8dEY!sMM4YpR(a)8Ptm(*(275^ zPu?)d%f9<NN4<=uU*?yG`Hf#csJ(01Nb-$)Fh$H~W$l8#%V~lyH`nx$;4v}3Py!Xp zi}m?=@QM2u=tr-&r=M!XLzYG;V6FTbAOQC5MDwd0#1BVHe$Nw`1vVUCVrAG{*OPid zqF0|bHL?}NsH6#H1eO@;F~n-sa+qACacmUWnP>Ir&V)5)6p2;+WSUak_*vBJsZEPB z)|k7^g(DsTee&HXU@E&^tkFGvp6-Cg51VCw;g9V4<JVS-)nIiR+-xE&<%_!fkdxRT zx}1^I*E`Fvm3f)&9bi-NW^(A`r|3kV1<!Wn176i07%y*o4eKvE?B5$X@MnE<gz}$q z9GTcsll3i$YOX8--g~#Lhi}dhCo9S(Q9k(k!!!F|^5&ovb0J;;jD@Tn^UfSc^<#Co zR5L!G3FXo`-MKT=GCiC0?l<}zIwa+1H?u$~^P%#U*V$cp$Qmqg!lzY9&<?Z+`vH6m ze%LU8FY?ZlXNkmuSjG}F-#WE%^`<XvJw+haJKg0&ePeBa%TW|Da7Z|U0bm1(zQ)X0 zRF06?Xju%ojmJ7UJozPgunYU@6A{;}c1JlPPvYI6#pgWj!#bcuJ3DO(1(9x|ajQ0^ zi9StlEFRz({q2r6j*~+0{#>7JeR(x+kpv+3I?U(W4kl|rFvE@1Kh%3#YVq~zWY*o? z31MG+=nE>;ZNY%VU|K3;<ZzV{{uPW1JmjG(2Oie0c78otYOZO3IEu6vIl0&>p9}&v zGSCHq?s-U``3ZUMRJ*$a2CEA>z^M7SbUyAZ-sUni#PPD^lr(*|){{%<Xra$;V^*}( z=JNwFW_Ju2H#qmgYLXll%&!FmME;pMZ>(eF+I@$#$sX1<tcO2&(Uv2~M*L#1^LkTe zkG9CLiQv9d<8UMnYW@v@zm)qEt@~8$nI}ulx$V4BS+o4jo>Dk*{<?giXeS?TiiWL$ zZ`Ha6dkkMR)12=ms&^QFcG@ZPd%Rj00^Zn<>&&0XlmVr9?8yLnS%}&(<@4o64hl>) z_OY2-7sY^DTJK+LQ!_@*uZ{%p1@T(#QId6<r+y8PATmCqikb)P#_Bqb0UXAOUm`@+ z7e71@!a#BeK*1?K%<SojE$H*9J!d0wRH$#q`hxMtB|Nq}toEI$1n?`%i;-2H8OtbB zz}_dwt&ooX6AjZ@x@S1TF05&~o!OsF_#PxDo9gB71{vAA<^J@1_AV)-D;<>0)UqlS zt2<2%X49QHZB+>>;C%3F;xUD7VMdtQWW#4PFM3-riQT6k)x^uXT`(DAU`ca0l{0qV zOP?9Pp8kokbwM2`4D7r{^*ox5%a{erh=Q(Yk5{OE*39LckHFXGo?u%n<0X{3grm3n zqlyO=g>!$pQDEBF`5xSZDAD)K<NPERUK%{;6=$C1H1;=StgqSBUiCg8U%4-h8lWnN zWrf`1$zQ$CJo}Ngeh~haw2)qd5`f3@+@nq9wT-Kaq(a9-Ng+ik@fbJ8m9NQpo8yF( zA(k$_0Tkvncbwb1k132ITycf`hHhB7BbG-KW}jL75`mUc#R?@?t83~AlhCs`27+>B zL=R(J6{`rM9x2(a-7#i0R3)x$ziTfGq5rmzGC`s)gVboQ0Jp_p00Ybh5_ube4IA+e zMNYmJ6^QkDzpx&<l^yyVPy^M#$|^egj{4{LNc*E)mIvvRV+xwv&SPp2_q;p`Nq6)I zEGhCfDOJr`dhci6IRW1$*%7G=#l}Z^bxl5AO{{F_l&d<8!~sFc;$*s-MVw{@v)<}e zyskvr?*OuJkpoP%e>Li7#=t0-w{b#oQO2bvLMgGuyisp3=ew`or3TVoi^7XPPMmAQ zV+stH;0)ti{h3eIM=ufsqo?rd{{{14=S`G^=kC2U$^7s-$g{Q%T|GLA;_yob>l52h zu#(^N*pP}-TWihE{k=%GFmZ~{@*Ex5ug4wyx5TlgT>ir;AAjSJ6#lm)LH^r;!~Ync z|9{$IdCpky5T~>@zfms^BKZ-j#G69)l+B2-dCSQL7w-yZHOzo6UpFRM2%%p<S&y0> zg?*<13xrs>darLffjNKXL1dr*M3kzNJ!P_%dJm~}HiKwD{&Yfp^Dhxd_Rl8&e=_S> zj;T3O?=<0Gj_d;d*`fXqG0Tqq&mqwNdluOm27|$!BQE*-4<iJdfd4%2{{OB2TNVVc Xt2Q^|Np0B+xP9)a>#0?#Scm@?xZtxX literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/library.c b/workbench/classes/zune/nlist/nbitmap_mcc/library.c new file mode 100644 index 0000000000..8db4eb31b9 --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/library.c @@ -0,0 +1,122 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/* system includes */ +#include <proto/exec.h> +#include <proto/intuition.h> + +/* local includes */ +#include "Debug.h" +#include "SetPatch.h" +#include "private.h" +#include "version.h" + +/* mcc initialisation */ +#define VERSION LIB_VERSION +#define REVISION LIB_REVISION + +#define CLASS MUIC_NBitmap +#define SUPERCLASS MUIC_Area + +#define INSTDATA InstData + +#define USERLIBID CLASS " " LIB_REV_STRING " [" SYSTEMSHORT "/" CPU "] (" LIB_DATE ") " LIB_COPYRIGHT +#define MASTERVERSION 19 + +#define CLASSINIT +#define CLASSEXPUNGE +#define MIN_STACKSIZE 8192 + +// libraries +struct Library *DataTypesBase = NULL; +#if !defined(__amigaos4__) +struct Library *CyberGfxBase = NULL; +#endif + +#if defined(__amigaos4__) +struct DataTypesIFace *IDataTypes = NULL; +#endif + +/******************************************************************************/ +/* define the functions used by the startup code ahead of including mccinit.c */ +/******************************************************************************/ +static BOOL ClassInit(UNUSED struct Library *base); +static VOID ClassExpunge(UNUSED struct Library *base); + +/******************************************************************************/ +/* include the lib startup code for the mcc/mcp (and muimaster inlines) */ +/******************************************************************************/ +#include "mccinit.c" + +/******************************************************************************/ +/* define all implementations of our user functions */ +/******************************************************************************/ +static BOOL ClassInit(UNUSED struct Library *base) +{ + BOOL res = FALSE; + + ENTER(); + + // open library interfaces + if((DataTypesBase = OpenLibrary("datatypes.library", 39L)) != NULL && + GETINTERFACE(IDataTypes, struct DataTypesIFace *, DataTypesBase)) + { + #if !defined(__amigaos4__) + if((CyberGfxBase = OpenLibrary("cybergraphics.library", 40)) != NULL && + GETINTERFACE(ICyberGfx, struct CyberGfxIFace *, CyberGfxBase)) + { + } + #endif + + GetSetPatchVersion(); + + res = TRUE; + } + + RETURN(res); + return res; +} + +static VOID ClassExpunge(UNUSED struct Library *base) +{ + ENTER(); + + /* close libraries */ + + #if !defined(__amigaos4__) + if(CyberGfxBase != NULL) + { + DROPINTERFACE(ICyberGfx); + CloseLibrary(CyberGfxBase); + CyberGfxBase = NULL; + } + #endif + + if(DataTypesBase != NULL) + { + DROPINTERFACE(IDataTypes); + CloseLibrary(DataTypesBase); + DataTypesBase = NULL; + } + + LEAVE(); +} diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/mmakefile.src b/workbench/classes/zune/nlist/nbitmap_mcc/mmakefile.src new file mode 100644 index 0000000000..49a8859b1a --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/mmakefile.src @@ -0,0 +1,29 @@ +# $Id$ +include $(TOP)/config/make.cfg + +#MM contrib-zune-classes-nbitmap-class : includes linklibs +#MM contrib-zune-classes-nbitmap-test : includes linklibs contrib-zune-classes-nbitmap-test-cpy + +USER_INCLUDES := -idirafter $(SRCDIR)/$(CURDIR)/../include +USER_CFLAGS := -DNO_INLINE_STDARG +USER_CFLAGS += $(PARANOIA_CFLAGS) + +FILES := dispatcher Chunky2Bitmap DitherImage NBitmap Debug + +%build_module_simple mmake=contrib-zune-classes-nbitmap-class \ + modname=NBitmap modtype=mcc moduledir=$(CONTRIBDIR)/Zune/MCC_NList/Classes/Zune \ + files="library $(FILES)" uselibs="mui" + + +%build_prog mmake=contrib-zune-classes-nbitmap-test progname=NBitmap-Test \ + files="NBitmap-Test $(FILES)" targetdir=$(AROS_TESTS)/NList \ + uselibs="mui" + + +INCLUDE_FILES := ../include/mui/NBitmap_mcc.h +%copy_includes path=mui dir=../include/mui + + +%copy_files_q mmake=contrib-zune-classes-nbitmap-test-cpy files=icon.png src=. dst=$(AROS_TESTS)/NList + +%common diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/private.h b/workbench/classes/zune/nlist/nbitmap_mcc/private.h new file mode 100644 index 0000000000..65d06d6b7a --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/private.h @@ -0,0 +1,161 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef NBITMAP_MCC_PRIV_H +#define NBITMAP_MCC_PRIV_H + +/* system includes */ +#include <dos/exall.h> +#include <exec/types.h> +#include <intuition/classusr.h> +#include <libraries/mui.h> + +/* mcc includes */ +#include <mcc_common.h> + +/* local includes */ +#include "Debug.h" +#include "NBitmap.h" + +/* private definitions */ +#define MUIV_NBitmap_Normal 0 +#define MUIV_NBitmap_Ghosted 1 +#define MUIV_NBitmap_Selected 2 + +#ifndef uint8 +typedef UBYTE uint8; +#endif +#ifndef int8 +typedef BYTE int8; +#endif +#ifndef uint16 +typedef UWORD uint16; +#endif +#ifndef int16 +typedef WORD int16; +#endif +#ifndef uint32 +typedef ULONG uint32; +#endif +#ifndef int32 +typedef LONG int32; +#endif + +/* private structures */ +struct PrefsData +{ + uint8 show_label; + uint8 overlay_type; + uint8 overlay_r; + uint8 overlay_g; + uint8 overlay_b; + uint16 overlay_shadeover; + uint16 overlay_shadepress; + uint8 spacing_horiz; + uint8 spacing_vert; +}; + +struct InstData +{ + BOOL button; + BOOL overlay; + BOOL pressed; + STRPTR label; + + uint32 scrdepth; + + uint32 *data[3]; + uint32 fmt, type; + uint32 width, height, depth; + uint32 maxwidth, maxheight; + uint32 border_horiz, border_vert; + uint32 label_horiz, label_vert; + uint32 arraybpp, arraybpr, arraysize; + APTR arraypixels[3]; + uint32 shadeWidth; + uint32 shadeHeight; + uint32 shadeBytesPerRow; + APTR overShadePixels; + APTR pressedShadePixels; + + uint32 *dt_colours[3]; + Object *dt_obj[3]; + PLANEPTR *dt_mask[3]; + + struct PrefsData prefs; + struct BitMap *dt_bitmap[3]; + struct BitMapHeader *dt_header[3]; + struct TextExtent labelte; + + uint32 alpha; + const uint32 *clut; + APTR ditheredImage[3]; + APTR ditheredMask[3]; + int32 ditherPenMap[256]; + #if !defined(__amigaos4__) + struct BitMap *ditheredBitmap[3]; + #endif + + struct MUI_EventHandlerNode ehnode; +}; + +/* macros */ +#define _id(obj) (muiNotifyData(obj)->mnd_ObjectID) +#define _between(a,x,b) ((x)>=(a) && (x)<=(b)) +#define _isinobject(x,y) (_between(_mleft(obj),(x),_mright(obj)) && _between(_mtop(obj),(y),_mbottom(obj))) + +#ifndef min +#define min(a, b) (((a) < (b)) ? (a):(b)) +#endif + +#ifndef max +#define max(a, b) (((a) > (b)) ? (a):(b)) +#endif + +#ifndef MUI_EHF_GUIMODE +#define MUI_EHF_GUIMODE (1<<1) /* set this if you dont want your handler to be called when your object is disabled or invisible */ +#endif + +/* prototypes */ +BOOL NBitmap_LoadImage(STRPTR filename, uint32 item, struct IClass *cl, Object *obj); +VOID NBitmap_UpdateImage(uint32 item, STRPTR filename, struct IClass *cl, Object *obj); +//BOOL NBitmap_ExamineData(Object *dt_obj, uint32 item, struct IClass *cl, Object *obj); +//VOID NBitmap_FreeImage(uint32 item, struct IClass *cl, Object *obj); +BOOL NBitmap_NewImage(struct IClass *cl, Object *obj); +VOID NBitmap_DisposeImage(struct IClass *cl, Object *obj); +BOOL NBitmap_SetupImage(struct IClass *cl, Object *obj); +VOID NBitmap_CleanupImage(struct IClass *cl, Object *obj); +VOID NBitmap_DrawImage(struct IClass *cl, Object *obj); +BOOL NBitmap_SetupShades(struct InstData *data); +void NBitmap_CleanupShades(struct InstData *data); + +#if !defined(__amigaos4__) && !defined(__MORPHOS__) && !defined(__AROS__) +ULONG _WPA(APTR src, UWORD srcx, UWORD srcy, UWORD srcmod, struct RastPort *rp, UWORD destx, UWORD desty, UWORD width, UWORD height, ULONG fmt); +ULONG _WPAA(APTR src, UWORD srcx, UWORD srcy, UWORD srcmod, struct RastPort *rp, UWORD destx, UWORD desty, UWORD width, UWORD height, ULONG globalalpha); +#endif + +#ifndef PDTA_AlphaChannel +/* Seems this V43 extension is not in the Amiga SDK */ +#define PDTA_AlphaChannel (DTA_Dummy + 256) +#endif + +#endif /* NBITMAP_MCC_PRIV_H */ diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/vastubs.c b/workbench/classes/zune/nlist/nbitmap_mcc/vastubs.c new file mode 100755 index 0000000000..72d11d6c89 --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/vastubs.c @@ -0,0 +1,57 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + TextEditor class Support Site: http://www.sf.net/projects/texteditor-mcc + + $Id$ + +***************************************************************************/ + +#if !defined(__AROS__) && (defined(__VBCC__) || defined(NO_INLINE_STDARG)) +#if defined(_M68000) || defined(__M68000) || defined(__mc68000) + +#include <exec/types.h> + +/* FIX V45 breakage... */ +#if INCLUDE_VERSION < 45 +#define MY_CONST_STRPTR CONST_STRPTR +#else +#define MY_CONST_STRPTR CONST STRPTR +#endif + +#include <proto/intuition.h> +APTR NewObject( struct IClass *classPtr, CONST_STRPTR classID, Tag tag1, ... ) +{ return NewObjectA(classPtr, classID, (struct TagItem *)&tag1); } +ULONG SetAttrs( APTR object, ULONG tag1, ... ) +{ return SetAttrsA(object, (struct TagItem *)&tag1); } + +#include <proto/graphics.h> +LONG ObtainBestPen( struct ColorMap *cm, ULONG r, ULONG g, ULONG b, Tag tag1, ... ) +{ return ObtainBestPenA(cm, r, g, b, (struct TagItem *)&tag1); } + +#include <proto/datatypes.h> +Object *NewDTObject( APTR name, Tag tag1, ... ) +{ return NewDTObjectA(name, (struct TagItem *)&tag1); } +ULONG SetDTAttrs( Object *o, struct Window *win, struct Requester *req, Tag tag1, ... ) +{ return SetDTAttrsA(o, win, req, (struct TagItem *)&tag1); } +ULONG GetDTAttrs( Object *o, Tag tag1, ... ) +{ return GetDTAttrsA(o, (struct TagItem *)&tag1); } +ULONG DoDTMethod( Object *o, struct Window *win, struct Requester *req, ULONG data, ... ) +{ return DoDTMethodA(o, win, req, (Msg)&data); } + +#else + #error "VARGS stubs are only save on m68k systems!" +#endif +#endif diff --git a/workbench/classes/zune/nlist/nbitmap_mcc/version.h b/workbench/classes/zune/nlist/nbitmap_mcc/version.h new file mode 100644 index 0000000000..65cf4a8f37 --- /dev/null +++ b/workbench/classes/zune/nlist/nbitmap_mcc/version.h @@ -0,0 +1,80 @@ +/*************************************************************************** + + NBitmap.mcc - New Bitmap MUI Custom Class + Copyright (C) 2006 by Daniel Allsopp + Copyright (C) 2007-2010 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef _VERSION_H_ +#define _VERSION_H_ + +// transforms a define into a string +#define STR(x) STR2(x) +#define STR2(x) #x + +// for setting all necessary version information +#define LIB_VERSION 15 +#define LIB_REVISION 15 +#define LIB_DATE "17.12.2011" +#define LIB_COPYRIGHT "Copyright (C) 2007-2011 NList Open Source Team" + +// set the LIB_REV_STRING +#define LIB_REV_STRING STR(LIB_VERSION) "." STR(LIB_REVISION) + +// identify the system we are compiling for +#if defined(__amigaos4__) + #define SYSTEM "AmigaOS4" + #define SYSTEMSHORT "OS4" +#elif defined(__MORPHOS__) + #define SYSTEM "MorphOS" + #define SYSTEMSHORT "MOS" +#elif defined(__AROS__) + #define SYSTEM "AROS" + #define SYSTEMSHORT SYSTEM +#elif defined(__AMIGA__) + #define SYSTEM "AmigaOS3" + #define SYSTEMSHORT "OS3" +#else + #warning "Unsupported System - check SYSTEM define" + #define SYSTEM "???" + #define SYSTEMSHORT "???" +#endif + +// identify the CPU model +#if defined(__PPC__) || defined(__powerpc__) + #define CPU "PPC" +#elif defined(_M68060) || defined(__M68060) || defined(__mc68060) + #define CPU "m68060" +#elif defined(_M68040) || defined(__M68040) || defined(__mc68040) + #define CPU "m68040" +#elif defined(_M68030) || defined(__M68030) || defined(__mc68030) + #define CPU "m68030" +#elif defined(_M68020) || defined(__M68020) || defined(__mc68020) + #define CPU "m68k" +#elif defined(_M68000) || defined(__M68000) || defined(__mc68000) + #define CPU "m68000" +#elif defined(__i386__) + #define CPU "x86" +#elif defined(__x86_64__) + #define CPU "x86_64" +#else + #warning "Unsupported CPU model - check CPU define" + #define CPU "???" +#endif + +#endif // _VERSION_H_ diff --git a/workbench/classes/zune/nlist/nfloattext_mcc/Debug.c b/workbench/classes/zune/nlist/nfloattext_mcc/Debug.c new file mode 100644 index 0000000000..a2223c919c --- /dev/null +++ b/workbench/classes/zune/nlist/nfloattext_mcc/Debug.c @@ -0,0 +1,412 @@ +/*************************************************************************** + + NFloattext.mcc - New Floattext MUI Custom Class + Registered MUI class, Serial Number: 1d51 (0x9d5100a1 to 0x9d5100aF) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifdef DEBUG + +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> +#include <stdio.h> + +#include <proto/intuition.h> +#include <proto/utility.h> +#include <proto/dos.h> +#include <proto/exec.h> + +#include "SDI_compiler.h" +#include "Debug.h" +#include "version.h" + +// special flagging macros +#define isFlagSet(v,f) (((v) & (f)) == (f)) // return TRUE if the flag is set +#define hasFlag(v,f) (((v) & (f)) != 0) // return TRUE if one of the flags in f is set in v +#define isFlagClear(v,f) (((v) & (f)) == 0) // return TRUE if flag f is not set in v +#define SET_FLAG(v,f) ((v) |= (f)) // set the flag f in v +#define CLEAR_FLAG(v,f) ((v) &= ~(f)) // clear the flag f in v +#define MASK_FLAG(v,f) ((v) &= (f)) // mask the variable v with flag f bitwise + +// our static variables with default values +static int indent_level = 0; +static BOOL ansi_output = FALSE; +static ULONG debug_flags = DBF_ALWAYS | DBF_STARTUP; // default debug flags +static ULONG debug_classes = DBC_ERROR | DBC_DEBUG | DBC_WARNING | DBC_ASSERT | DBC_REPORT; // default debug classes + +/****************************************************************************/ + +void SetupDebug(void) +{ + char var[256]; + + kprintf("** NFloattext.mcc v" LIB_REV_STRING " startup ***********************\n"); + kprintf("Initializing runtime debugging:\n"); + + if(GetVar("nfloattext.mcc.debug", var, sizeof(var), 0) > 0) + { + char *tok; + char *debug = var; + + // static list of our debugging classes tokens. + // in the yamdebug variable these classes always start with a @ + static struct { const char *token; unsigned long flag; } dbclasses[] = + { + { "ctrace", DBC_CTRACE }, + { "report", DBC_REPORT }, + { "assert", DBC_ASSERT }, + { "timeval", DBC_TIMEVAL }, + { "debug", DBC_DEBUG }, + { "error", DBC_ERROR }, + { "warning", DBC_WARNING }, + { "all", DBC_ALL }, + { NULL, 0 } + }; + + static struct { const char *token; unsigned long flag; } dbflags[] = + { + { "always", DBF_ALWAYS }, + { "startup", DBF_STARTUP }, + { "all", DBF_ALL }, + { NULL, 0 } + }; + + // we parse the env variable token-wise + while((tok = strtok(debug, ", ;"))) + { + ULONG i; + + // check if the token is class definition or + // just a flag definition + if(tok[0] == '@') + { + // check if this call is a negation or not + if(tok[1] == '!') + { + // search for the token and clear the flag + for(i=0; dbclasses[i].token; i++) + { + if(stricmp(tok+2, dbclasses[i].token) == 0) + { + kprintf("clear '%s' debug class flag.\n", dbclasses[i].token); + CLEAR_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + else + { + // search for the token and set the flag + for(i=0; dbclasses[i].token; i++) + { + if(stricmp(tok+1, dbclasses[i].token) == 0) + { + kprintf("set '%s' debug class flag\n", dbclasses[i].token); + SET_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + } + else + { + // check if this call is a negation or not + if(tok[0] == '!') + { + for(i=0; dbflags[i].token; i++) + { + if(stricmp(tok+1, dbflags[i].token) == 0) + { + kprintf("clear '%s' debug flag\n", dbflags[i].token); + CLEAR_FLAG(debug_flags, dbflags[i].flag); + } + } + } + else + { + // check if the token was "ansi" and if so enable the ANSI color + // output + if(stricmp(tok, "ansi") == 0) + { + kprintf("ansi output enabled\n"); + ansi_output = TRUE; + } + else + { + for(i=0; dbflags[i].token; i++) + { + if(stricmp(tok, dbflags[i].token) == 0) + { + kprintf("set '%s' debug flag\n", dbflags[i].token); + SET_FLAG(debug_flags, dbflags[i].flag); + } + } + } + } + } + + debug = NULL; + } + } + + kprintf("set debug classes/flags (env:nfloattext.mcc.debug): %08lx/%08lx\n", debug_classes, debug_flags); + kprintf("** Normal processing follows ***************************************\n"); +} + +/****************************************************************************/ + +void CleanupDebug(void) +{ + kprintf("** Cleaned up debugging ********************************************\n"); +} + +/****************************************************************************/ + +// define variables for using ANSI colors in our debugging scheme +#define ANSI_ESC_CLR "\033[0m" +#define ANSI_ESC_BOLD "\033[1m" +#define ANSI_ESC_UNDERLINE "\033[4m" +#define ANSI_ESC_BLINK "\033[5m" +#define ANSI_ESC_REVERSE "\033[7m" +#define ANSI_ESC_INVISIBLE "\033[8m" +#define ANSI_ESC_FG_BLACK "\033[0;30m" +#define ANSI_ESC_FG_RED "\033[0;31m" +#define ANSI_ESC_FG_GREEN "\033[0;32m" +#define ANSI_ESC_FG_BROWN "\033[0;33m" +#define ANSI_ESC_FG_BLUE "\033[0;34m" +#define ANSI_ESC_FG_PURPLE "\033[0;35m" +#define ANSI_ESC_FG_CYAN "\033[0;36m" +#define ANSI_ESC_FG_LGRAY "\033[0;37m" +#define ANSI_ESC_FG_DGRAY "\033[1;30m" +#define ANSI_ESC_FG_LRED "\033[1;31m" +#define ANSI_ESC_FG_LGREEN "\033[1;32m" +#define ANSI_ESC_FG_YELLOW "\033[1;33m" +#define ANSI_ESC_FG_LBLUE "\033[1;34m" +#define ANSI_ESC_FG_LPURPLE "\033[1;35m" +#define ANSI_ESC_FG_LCYAN "\033[1;36m" +#define ANSI_ESC_FG_WHITE "\033[1;37m" +#define ANSI_ESC_BG "\033[0;4" // background esc-squ start with 4x +#define ANSI_ESC_BG_BLACK "\033[0;40m" +#define ANSI_ESC_BG_RED "\033[0;41m" +#define ANSI_ESC_BG_GREEN "\033[0;42m" +#define ANSI_ESC_BG_BROWN "\033[0;43m" +#define ANSI_ESC_BG_BLUE "\033[0;44m" +#define ANSI_ESC_BG_PURPLE "\033[0;45m" +#define ANSI_ESC_BG_CYAN "\033[0;46m" +#define ANSI_ESC_BG_LGRAY "\033[0;47m" + +/****************************************************************************/ + +INLINE void _INDENT(void) +{ + int i; + for(i=0; i < indent_level; i++) + kprintf(" "); +} + +/****************************************************************************/ + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function) +{ + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Entering %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Entering %s\n", file, line, function); + } + + indent_level++; +} + +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function) +{ + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s\n", file, line, function); + } +} + +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result) +{ + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s (result 0x%08lx, %ld)%s\n", ANSI_ESC_FG_BROWN, file, line, function, result, result, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s (result 0x%08lx, %ld)\n", file, line, function, result, result); + } +} + +/****************************************************************************/ + +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + switch(size) + { + case 1: + fmt = "%s:%ld:%s = %ld, 0x%02lx"; + break; + + case 2: + fmt = "%s:%ld:%s = %ld, 0x%04lx"; + break; + + default: + fmt = "%s:%ld:%s = %ld, 0x%08lx"; + break; + } + + _INDENT(); + + if(ansi_output) + kprintf(ANSI_ESC_FG_GREEN); + + kprintf(fmt, file, line, name, value, value); + + if(size == 1 && value < 256) + { + if(value < ' ' || (value >= 127 && value < 160)) + kprintf(", '\\x%02lx'", value); + else + kprintf(", '%lc'", value); + } + + if(ansi_output) + kprintf("%s\n", ANSI_ESC_CLR); + else + kprintf("\n"); + } +} + +/****************************************************************************/ + +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + _INDENT(); + + if(p != NULL) + fmt = "%s:%ld:%s = 0x%08lx\n"; + else + fmt = "%s:%ld:%s = NULL\n"; + + if(ansi_output) + { + kprintf(ANSI_ESC_FG_GREEN); + kprintf(fmt, file, line, name, p); + kprintf(ANSI_ESC_CLR); + } + else + kprintf(fmt, file, line, name, p); + } +} + +/****************************************************************************/ + +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s = 0x%08lx \"%s\"%s\n", ANSI_ESC_FG_GREEN, file, line, name, string, string, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s = 0x%08lx \"%s\"\n", file, line, name, string, string); + } +} + +/****************************************************************************/ + +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s%s\n", ANSI_ESC_FG_GREEN, file, line, msg, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s\n", file, line, msg); + } +} + +/****************************************************************************/ + +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...) +{ + if((isFlagSet(debug_classes, dclass) && isFlagSet(debug_flags, dflags)) || + (isFlagSet(dclass, DBC_ERROR) || isFlagSet(dclass, DBC_WARNING))) + { + va_list args; + static char buf[1024]; + + _INDENT(); + + va_start(args, format); + vsnprintf(buf, 1024, format, args); + va_end(args); + + if(ansi_output) + { + const char *highlight = ANSI_ESC_FG_GREEN; + + switch(dclass) + { + case DBC_CTRACE: highlight = ANSI_ESC_FG_BROWN; break; + case DBC_REPORT: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ASSERT: highlight = ANSI_ESC_FG_RED; break; + case DBC_TIMEVAL: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_DEBUG: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ERROR: highlight = ANSI_ESC_FG_RED; break; + case DBC_WARNING: highlight = ANSI_ESC_FG_PURPLE;break; + } + + kprintf("%s%s:%ld:%s%s\n", highlight, file, line, buf, ANSI_ESC_CLR); + } + else + kprintf("%s:%ld:%s\n", file, line, buf); + } +} + +/****************************************************************************/ + +#endif diff --git a/workbench/classes/zune/nlist/nfloattext_mcc/Debug.h b/workbench/classes/zune/nlist/nfloattext_mcc/Debug.h new file mode 100644 index 0000000000..cb91379722 --- /dev/null +++ b/workbench/classes/zune/nlist/nfloattext_mcc/Debug.h @@ -0,0 +1,139 @@ +/*************************************************************************** + + TextEditor.mcc - Textediting MUI Custom Class + Copyright (C) 1997-2000 Allan Odgaard + Copyright (C) 2005 by TextEditor.mcc Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + TextEditor class Support Site: http://www.sf.net/projects/texteditor-mcc + + $Id$ + +***************************************************************************/ + +#ifndef DEBUG_H +#define DEBUG_H + +// first we make sure all previously defined symbols are undefined now so +// that no other debug system interferes with ours. +#undef ENTER +#undef LEAVE +#undef RETURN +#undef SHOWVALUE +#undef SHOWPOINTER +#undef SHOWSTRING +#undef SHOWMSG +#undef STARTCLOCK +#undef STOPCLOCK +#undef D +#undef E +#undef W +#undef ASSERT + +#if defined(DEBUG) + +#include <assert.h> + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +#if defined(__amigaos4__) + #include <proto/exec.h> + #ifdef __USE_INLINE__ + #ifdef DebugPrintF + #undef DebugPrintF + #endif + #endif + #ifndef kprintf + #define kprintf(format, args...) ((struct ExecIFace *)((*(struct ExecBase **)4)->MainInterface))->DebugPrintF(format, ## args) + #endif +#elif defined(__MORPHOS__) + #include <exec/rawfmt.h> + #include <proto/exec.h> + #define KPutFmt(format, args) VNewRawDoFmt(format, (APTR)RAWFMTFUNC_SERIAL, NULL, args) +void kprintf(const char *formatString,...); +#else +void kprintf(const char *formatString,...); +#endif + +// debug classes +#define DBC_CTRACE (1<<0) // call tracing (ENTER/LEAVE etc.) +#define DBC_REPORT (1<<1) // reports (SHOWVALUE/SHOWSTRING etc.) +#define DBC_ASSERT (1<<2) // asserts (ASSERT) +#define DBC_TIMEVAL (1<<3) // time evaluations (STARTCLOCK/STOPCLOCK) +#define DBC_DEBUG (1<<4) // debugging output D() +#define DBC_ERROR (1<<5) // error output E() +#define DBC_WARNING (1<<6) // warning output W() +#define DBC_ALL 0xffffffff + +// debug flags +#define DBF_ALWAYS (1<<0) +#define DBF_STARTUP (1<<1) // for startup/shutdown events (YAM.c) +#define DBF_ALL 0xffffffff + +void SetupDebug(void); +void CleanupDebug(void); + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function); +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function); +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result); +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line); +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line); +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line); +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line); +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...); + +// Core class information class messages +#define ENTER() _ENTER(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define LEAVE() _LEAVE(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define RETURN(r) _RETURN(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__, (long)r) +#define SHOWVALUE(f, v) _SHOWVALUE(DBC_REPORT, f, (long)v, sizeof(v), #v, __FILE__, __LINE__) +#define SHOWPOINTER(f, p) _SHOWPOINTER(DBC_REPORT, f, p, #p, __FILE__, __LINE__) +#define SHOWSTRING(f, s) _SHOWSTRING(DBC_REPORT, f, s, #s, __FILE__, __LINE__) +#define SHOWMSG(f, m) _SHOWMSG(DBC_REPORT, f, m, __FILE__, __LINE__) +#define D(f, s, vargs...) _DPRINTF(DBC_DEBUG, f, __FILE__, __LINE__, s, ## vargs) +#define E(f, s, vargs...) _DPRINTF(DBC_ERROR, f, __FILE__, __LINE__, s, ## vargs) +#define W(f, s, vargs...) _DPRINTF(DBC_WARNING, f, __FILE__, __LINE__, s, ## vargs) +#define ASSERT(expression) \ + ((void) \ + ((expression) ? 0 : \ + ( \ + _DPRINTF(DBC_ASSERT, \ + DBF_ALWAYS, \ + __FILE__, \ + __LINE__, \ + "failed assertion '%s'", \ + #expression), \ + assert(#expression), \ + 0 \ + ) \ + ) \ + ) + +#else // DEBUG + +#define ENTER() ((void)0) +#define LEAVE() ((void)0) +#define RETURN(r) ((void)0) +#define SHOWVALUE(f, v) ((void)0) +#define SHOWPOINTER(f, p) ((void)0) +#define SHOWSTRING(f, s) ((void)0) +#define SHOWMSG(f, m) ((void)0) +#define D(f, s, vargs...) ((void)0) +#define E(f, s, vargs...) ((void)0) +#define W(f, s, vargs...) ((void)0) +#define ASSERT(expression) ((void)0) + +#endif // DEBUG + +#endif // DEBUG_H diff --git a/workbench/classes/zune/nlist/nfloattext_mcc/Makefile b/workbench/classes/zune/nlist/nfloattext_mcc/Makefile new file mode 100644 index 0000000000..d2bb6347ba --- /dev/null +++ b/workbench/classes/zune/nlist/nfloattext_mcc/Makefile @@ -0,0 +1,423 @@ +#/*************************************************************************** +# +# NFloattext.mcc - New Floattext MUI Custom Class +# Registered MUI class, Serial Number: 1d51 (0x9d5100a1 to 0x9d5100aF) +# +# Copyright (C) 1996-2001 by Gilles Masson +# Copyright (C) 2001-2005 by NList Open Source Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# NList classes Support Site: http://www.sf.net/projects/nlist-classes +# +# $Id$ +# +#***************************************************************************/ + +########################################################################### +# This makefile is a very generic one. It tries to identify both, the host +# and the target operating system for which YAM should be compiled. +# However, this auto-detection can be easily overridden by directly +# specifying an option on the commandline while calling 'make'. +# +# Example: +# +# # to explicitly compile for AmigaOS3 +# > make OS=os3 +# +# # to compile for AmigaOS4 but with debugging +# > make OS=os4 DEBUG= +# + +############################################# +# find out the HOST operating system +# on which this makefile is run +HOST ?= $(shell uname) +ifeq ($(HOST), AmigaOS) + ifeq ($(shell uname -m), powerpc) + HOST = AmigaOS4 + endif + ifeq ($(shell uname -m), ppc) + HOST = AmigaOS4 + endif +endif + +# if no host is identifed (no uname tool) +# we assume a AmigaOS build +ifeq ($(HOST),) + HOST = AmigaOS +endif + +############################################# +# now we find out the target OS for +# which we are going to compile YAM in case +# the caller didn't yet define OS himself +ifndef (OS) + ifeq ($(HOST), AmigaOS4) + OS = os4 + else + ifeq ($(HOST), AmigaOS) + OS = os3 + else + ifeq ($(HOST), MorphOS) + OS = mos + else + ifeq ($(HOST), AROS) + # now we find out which CPU system aros will be used + ifeq ($(shell uname -m), powerpc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), ppc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), i386) + OS = aros-i386 + endif + ifeq ($(shell uname -m), i686) + OS = aros-i686 + endif + ifeq ($(shell uname -m), x86_64) + OS = aros-x86_64 + endif + else + OS = os4 + endif + endif + endif + endif +endif + +############################################# +# define common commands we use in this +# makefile. Please note that each of them +# might be overridden on the commandline. + +# common commands +FLEX = flex +FC = flexcat +EXPR = expr +DATE = date +RM = delete force +RMDIR = delete force all +MKDIR = makedir +CHMOD = protect FLAGS=rwed +SED = sed +CP = copy +CC = gcc +STRIP = strip +OBJDUMP = objdump + +# path definitions +CDUP = / +CDTHIS= + +# override some variables for non-native builds (cross-compiler) +ifneq ($(HOST), AmigaOS) +ifneq ($(HOST), AmigaOS4) +ifneq ($(HOST), MorphOS) + + # when we end up here this is either a unix or Aros host + # so lets use unix kind of commands + RM = rm -f + RMDIR = rm -rf + MKDIR = mkdir -p + CHMOD = chmod 755 + CP = cp -f + + CDUP = ../ + CDTHIS= ./ + +endif +endif +endif + +########################################################################### +# CPU and DEBUG can be defined outside, defaults to above +# using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug +# PPC-603e version +# +# OPTFLAGS are disabled by DEBUG normally! +# +# ignored warnings are: +# none - because we want to compile with -Wall all the time + +# Common Directories +PREFIX = $(CDTHIS) +OBJDIR = .obj_$(OS) +BINDIR = bin_$(OS) +VPATH = $(OBJDIR) +DEPFILE = Makefile.dep +DESTDIR = MUI:Libs/MUI + +# target definition +TARGET = $(BINDIR)/NFloattext.mcc +TESTTARGET= $(BINDIR)/NFloattext-Test + +# Common compiler/linker flags +WARN = -W -Wall -Wwrite-strings -Wpointer-arith -Wsign-compare +OPTFLAGS = -O3 -fomit-frame-pointer -funroll-loops +DEBUG = -DDEBUG -O0 +DEBUGSYM = -g -gstabs +CFLAGS = -I. -I../nlistviews_mcp -I../include $(CPU) $(WARN) $(OPTFLAGS) \ + $(DEBUG) $(DEBUGSYM) $(USER_CFLAGS) -c +LDFLAGS = $(CPU) $(DEBUGSYM) +LDLIBS = + +########################################################################### +# object files definition +# + +LOBJS = library.o + +COBJS = NFloattext.o \ + Debug.o + +TOBJS = #NFloattext-Test.o + +MCCOBJS = $(addprefix $(OBJDIR)/,$(LOBJS)) $(addprefix $(OBJDIR)/,$(COBJS)) +TESTOBJS = $(addprefix $(OBJDIR)/,$(COBJS)) $(addprefix $(OBJDIR)/,$(TOBJS)) + +# different options per target OS +ifeq ($(OS), os4) + + ############################## + # AmigaOS4 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS4) + CC = ppc-amigaos-gcc + STRIP = ppc-amigaos-strip + OBJDUMP = ppc-amigaos-objdump + endif + + # Compiler/Linker flags + CRT = newlib + CPU = -mcpu=powerpc + WARN += -Wdeclaration-after-statement -Wdisabled-optimization + CFLAGS += -mcrt=$(CRT) -D__USE_INLINE__ -D__NEW_TIMEVAL_DEFINITION_USED__ \ + -DNO_PPCINLINE_STDARG -Wa,-mregnames + LDFLAGS += -mcrt=$(CRT) + + # additional object files required + M68KSTUBS = $(OBJDIR)/mccclass_68k.o + +else +ifeq ($(OS), os3) + + ############################## + # AmigaOS3 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS) + CC = m68k-amigaos-gcc + STRIP = m68k-amigaos-strip + OBJDUMP = m68k-amigaos-objdump + endif + + # Compiler/Linker flags + CPU = -m68020-60 -msoft-float + CFLAGS += -noixemul -DNO_INLINE_STDARG -D__amigaos3__ + LDFLAGS += -noixemul + LDLIBS += -ldebug -lmui + +else +ifeq ($(OS), mos) + + ############################## + # MorphOS + + # Compiler/link/strip commands + ifneq ($(HOST), MorphOS) + CC = ppc-morphos-gcc + STRIP = ppc-morphos-strip + OBJDUMP = ppc-morphos-objdump + endif + + # Compiler/Linker flags + CPU = -mcpu=powerpc + CFLAGS += -noixemul -DNO_PPCINLINE_STDARG + LDFLAGS += -noixemul + LDLIBS += -ldebug + +else +ifeq ($(OS), aros-i386) + + ############################## + # AROS (i386) + + ifneq ($(HOST), AROS) + CC = i386-aros-gcc + STRIP = i386-aros-strip + OBJDUMP = i386-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-ppc) + + ############################## + # AROS (PPC) + + ifneq ($(HOST), AROS) + CC = ppc-aros-gcc + STRIP = ppc-aros-strip + OBJDUMP = ppc-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-x86_64) + + ############################## + # AROS (x86_64) + + ifneq ($(HOST), AROS) + CC = x86_64-aros-gcc + STRIP = x86_64-aros-strip + OBJDUMP = x86_64-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +endif +endif +endif +endif +endif +endif + +# main target +.PHONY: all +ifeq ($(wildcard $(DEPFILE)),$(DEPFILE)) +# great, we have a dependecies file, let's make our target +all: $(BINDIR) $(OBJDIR) $(M68KSTUBS) $(TARGET) #$(TESTTARGET) +else +# no dependecies, create it and then call make again +all: depend + @make --no-print-directory all +endif + +# for making a release we compile ALL target with no debug +release: + @echo " CC $<" + make OS=os4 clean + make OS=os4 DEBUG= + @echo " CC $<" + make OS=os3 clean + make OS=os3 DEBUG= + @echo " CC $<" + make OS=mos clean + make OS=mos DEBUG= + @echo " CC $<" + make OS=aros-i386 clean + make OS=aros-i386 DEBUG= + @echo " CC $<" + make OS=aros-ppc clean + make OS=aros-ppc DEBUG= + @echo " CC $<" + make OS=aros-x86_64 clean + make OS=aros-x86_64 DEBUG= + +# make the object directories +$(OBJDIR): + @echo " MK $@" + @$(MKDIR) $(OBJDIR) + +# make the binary directories +$(BINDIR): + @echo " MK $@" + @$(MKDIR) $(BINDIR) + +# for compiling single .c files +$(OBJDIR)/%.o: %.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +$(OBJDIR)/mccclass_68k.o: ../include/mccclass_68k.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +# for linking the target +$(TARGET): $(M68KSTUBS) $(MCCOBJS) + @echo " LD $@.debug" + @$(CC) -nostartfiles $(LDFLAGS) -o $@.debug $(MCCOBJS) $(M68KSTUBS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +# for linking the target +$(TESTTARGET): $(TESTOBJS) + @echo " LD $@.debug" + @$(CC) $(LDFLAGS) -o $@.debug $(TESTOBJS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +.PHONY: dump +dump: + -$(OBJDUMP) --section-headers --all-headers --reloc --disassemble-all $(TARGET) >$(TARGET).dump + +.PHONY: clean +clean: + -$(RM) $(TARGET) $(TARGET).debug $(TARGET).map + -$(RM) $(TESTTARGET) $(TESTTARGET).debug $(TESTTARGET).map + -$(RM) $(MCCOBJS) $(TESTOBJS) $(M68KSTUBS) + +.PHONY: distclean +distclean: clean + -$(RMDIR) $(OBJDIR) + -$(RMDIR) $(BINDIR) + +# install +.PHONY: install +install: all + @echo " IN $(TARGET)" + @$(CP) $(TARGET) $(DESTDIR) + +.PHONY: help +help: + @echo "Cleaning targets:" + @echo " clean - Cleanup working directory for clean compile" + @echo " distclean - Also cleanup autogenerated files" + @echo "" + @echo "Other generic targets:" + @echo " all - Build $(TARGET)" + @echo " catalogs - Build all available catalogs" + @echo "" + @echo "Install targets:" + @echo " install - Install $(TARGET) into $(DESTDIR)" + @echo "" + @echo "Parameters:" + @echo " make OS=os3|os4|mos|aros-i386|aros-i686|aros-ppc|aros-x86_64" + @echo " make DEBUG= : build $(TARGET) without debugging information" + @echo "" + +## DEPENDENCY GENERATION ############## + +.PHONY: depend +depend: + @echo " MK $(DEPFILE)" + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >$(DEPFILE) + @$(CC) -MM -MG $(CFLAGS) $(wildcard *.c) >>$(DEPFILE) + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >>$(DEPFILE) + @$(SED) -i 's,^\(.*\)\.o:,$$\(OBJDIR\)/\1.o:,g' $(DEPFILE) + +# include dependencies file +-include $(DEPFILE) diff --git a/workbench/classes/zune/nlist/nfloattext_mcc/Makefile.dep b/workbench/classes/zune/nlist/nfloattext_mcc/Makefile.dep new file mode 100644 index 0000000000..cd0509574e --- /dev/null +++ b/workbench/classes/zune/nlist/nfloattext_mcc/Makefile.dep @@ -0,0 +1,15 @@ +# AUTOGENERATED! DO NOT EDIT!!! +$(OBJDIR)/Debug.o: Debug.c ../include/SDI_compiler.h Debug.h version.h +$(OBJDIR)/library.o: library.c private.h ../include/libraries/mui.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h \ + ../include/mui/NFloattext_mcc.h ../include/mui/NListview_mcc.h \ + ../include/mui/NList_mcc.h Debug.h version.h ../include/mccinit.c \ + ../include/proto/muimaster.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h +$(OBJDIR)/NFloattext.o: NFloattext.c private.h ../include/libraries/mui.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h \ + ../include/mui/NFloattext_mcc.h ../include/mui/NListview_mcc.h \ + ../include/mui/NList_mcc.h Debug.h version.h +# AUTOGENERATED! DO NOT EDIT!!! diff --git a/workbench/classes/zune/nlist/nfloattext_mcc/NFloattext.c b/workbench/classes/zune/nlist/nfloattext_mcc/NFloattext.c new file mode 100644 index 0000000000..7e236f5bbf --- /dev/null +++ b/workbench/classes/zune/nlist/nfloattext_mcc/NFloattext.c @@ -0,0 +1,333 @@ +/*************************************************************************** + + NFloattext.mcc - New Floattext MUI Custom Class + Registered MUI class, Serial Number: 1d51 (0x9d5100a1 to 0x9d5100aF) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <string.h> + +#include <exec/memory.h> +#include <clib/alib_protos.h> +#include <proto/utility.h> +#include <proto/exec.h> + +#include "private.h" +#include "version.h" + +static char *CopyText(char *textin) +{ + char *textout = NULL; + + if (textin) + { + int len = strlen(textin)+2; + + if((textout = AllocVec(len,MEMF_ANY))) + strlcpy(textout, textin, len); + } + + return (textout); +} + +#if !defined(__MORPHOS__) +#ifdef __AROS__ +static __attribute__ ((noinline)) Object * VARARGS68K DoSuperNew(struct IClass *cl, Object *obj, Tag tag1, ...) +{ + AROS_SLOWSTACKTAGS_PRE_AS(tag1, Object *) + retval = (Object *)DoSuperMethod(cl, obj, OM_NEW, AROS_SLOWSTACKTAGS_ARG(tag1), NULL); + AROS_SLOWSTACKTAGS_POST +} +#else +static Object * VARARGS68K DoSuperNew(struct IClass *cl, Object *obj, ...) +{ + Object *rc; + VA_LIST args; + + ENTER(); + + VA_START(args, obj); + rc = (Object *)DoSuperMethod(cl, obj, OM_NEW, VA_ARG(args, ULONG), NULL); + VA_END(args); + + RETURN(rc); + return rc; +} +#endif +#endif // !__MORPHOS__ + +static IPTR mNFT_New(struct IClass *cl,Object *obj,struct opSet *msg) +{ + register struct NFTData *data; + struct TagItem *tag; + LONG Justify = FALSE; + LONG Align = ALIGN_LEFT; + char *Text = NULL; + LONG tagts = MUIA_NList_TypeSelect; + LONG tagip = MUIA_NList_Input; + LONG Copied = FALSE; + + if((tag = FindTagItem(MUIA_NFloattext_SkipChars, msg->ops_AttrList))) + tag->ti_Tag = MUIA_NList_SkipChars; + else if((tag = FindTagItem(MUIA_Floattext_SkipChars, msg->ops_AttrList))) + tag->ti_Tag = MUIA_NList_SkipChars; + + if((tag = FindTagItem(MUIA_NFloattext_TabSize, msg->ops_AttrList))) + tag->ti_Tag = MUIA_NList_TabSize; + else if((tag = FindTagItem(MUIA_Floattext_TabSize, msg->ops_AttrList))) + tag->ti_Tag = MUIA_NList_TabSize; + + if((tag = FindTagItem(MUIA_NFloattext_Text, msg->ops_AttrList))) + { + Text = (char *) tag->ti_Data; + Copied = FALSE; + } + else if((tag = FindTagItem(MUIA_Floattext_Text, msg->ops_AttrList))) + { + Text = (char *) tag->ti_Data; + Copied = TRUE; + } + + if((tag = FindTagItem(MUIA_NList_TypeSelect, msg->ops_AttrList))) + tagts = TAG_IGNORE; + + if((tag = FindTagItem(MUIA_NList_Input, msg->ops_AttrList))) + { + tagip = TAG_IGNORE; + if (tag->ti_Data) + tagts = TAG_IGNORE; + } + + if ((tag = FindTagItem(MUIA_NFloattext_Justify, msg->ops_AttrList)) || + (tag = FindTagItem(MUIA_Floattext_Justify, msg->ops_AttrList))) + { + if (tag->ti_Data) + { + Justify = TRUE; + Align = ALIGN_JUSTIFY; + } + else + { + Justify = FALSE; + Align = ALIGN_LEFT; + } + } + + if((tag = FindTagItem(MUIA_NFloattext_Align, msg->ops_AttrList))) + { + data = INST_DATA(cl,obj); + data->NFloattext_Align = tag->ti_Data & ALIGN_MASK; + + if (Align == ALIGN_JUSTIFY) + Justify = TRUE; + else + Justify = FALSE; + } + + obj = (Object *) DoSuperNew(cl,obj, + tagts, MUIV_NList_TypeSelect_Char, + tagip, FALSE, + TAG_MORE, msg->ops_AttrList + ); + + if (obj) + { + data = INST_DATA(cl,obj); + data->NFloattext_Justify = Justify; + data->NFloattext_Align = Align; + data->NFloattext_entry = NULL; + data->NFloattext_entry_len = 0; + data->NFloattext_Copied = FALSE; + + if (Copied && Text) + { + data->NFloattext_Text = CopyText(Text); + data->NFloattext_Copied = TRUE; + } + else + data->NFloattext_Text = Text; + + if (data->NFloattext_Text) + { + D(DBF_ALWAYS, "inserting text with length %ld '%s'",strlen(data->NFloattext_Text),data->NFloattext_Text); + DoMethod(obj,MUIM_NList_InsertWrap,data->NFloattext_Text,-2,MUIV_NList_Insert_Bottom,1,data->NFloattext_Align); + } + } + + return((IPTR) obj); +} + + +static IPTR mNFT_Dispose(struct IClass *cl,Object *obj,Msg msg) +{ + register struct NFTData *data; + data = INST_DATA(cl,obj); + DoMethod(obj,MUIM_NList_Clear,NULL); + if (data->NFloattext_Copied && data->NFloattext_Text) + FreeVec(data->NFloattext_Text); + data->NFloattext_Text = NULL; + if (data->NFloattext_entry) + FreeVec(data->NFloattext_entry); + data->NFloattext_entry = NULL; + + return(DoSuperMethodA(cl,obj,msg)); +} + + +static IPTR mNFT_Set(struct IClass *cl,Object *obj,Msg msg) +{ + register struct NFTData *data = INST_DATA(cl,obj); + struct TagItem *tags,*tag; + + for (tags=((struct opSet *)msg)->ops_AttrList;(tag=NextTagItem((APTR)&tags));) + { + switch (tag->ti_Tag) + { + case MUIA_Floattext_Text: + case MUIA_NFloattext_Text: + DoMethod(obj,MUIM_NList_Clear,NULL); + if (data->NFloattext_Copied && data->NFloattext_Text) + FreeVec(data->NFloattext_Text); + data->NFloattext_Copied = FALSE; + if (tag->ti_Tag == MUIA_Floattext_Text) + { data->NFloattext_Text = CopyText((char *) tag->ti_Data); + data->NFloattext_Copied = TRUE; + } + else + data->NFloattext_Text = (char *) tag->ti_Data; + if (data->NFloattext_Text) + DoMethod(obj,MUIM_NList_InsertWrap,data->NFloattext_Text,-2,MUIV_NList_Insert_Bottom,1,data->NFloattext_Align); + break; + case MUIA_Floattext_Justify: + case MUIA_NFloattext_Justify: + if (tag->ti_Data) + { data->NFloattext_Justify = TRUE; + data->NFloattext_Align = ALIGN_JUSTIFY; + } + else + { data->NFloattext_Justify = FALSE; + data->NFloattext_Align = ALIGN_LEFT; + } + break; + case MUIA_NFloattext_Align: + data->NFloattext_Align = tag->ti_Data & ALIGN_MASK; + if (data->NFloattext_Align == ALIGN_JUSTIFY) + data->NFloattext_Justify = TRUE; + else + data->NFloattext_Justify = FALSE; + break; + case MUIA_Floattext_SkipChars : + case MUIA_NFloattext_SkipChars : + tag->ti_Tag = MUIA_NList_SkipChars; + break; + case MUIA_Floattext_TabSize : + case MUIA_NFloattext_TabSize : + tag->ti_Tag = MUIA_NList_TabSize; + break; + } + } + return (DoSuperMethodA(cl,obj,msg)); +} + + +static IPTR mNFT_Get(struct IClass *cl,Object *obj,Msg msg) +{ + struct NFTData *data = INST_DATA(cl,obj); + IPTR *store = ((struct opGet *)msg)->opg_Storage; + + switch (((struct opGet *)msg)->opg_AttrID) + { + case MUIA_Floattext_SkipChars: + case MUIA_NFloattext_SkipChars: + ((struct opGet *)msg)->opg_AttrID = MUIA_NList_SkipChars; + break; + case MUIA_Floattext_TabSize: + case MUIA_NFloattext_TabSize: + ((struct opGet *)msg)->opg_AttrID = MUIA_NList_TabSize; + break; + case MUIA_Floattext_Text: + case MUIA_NFloattext_Text: + *store = (IPTR) data->NFloattext_Text; + return(TRUE); + case MUIA_Floattext_Justify: + case MUIA_NFloattext_Justify: + *store = data->NFloattext_Justify; + return(TRUE); + case MUIA_NFloattext_Align: + *store = data->NFloattext_Align; + return(TRUE); + case MUIA_Version: + *store = LIB_VERSION; + return(TRUE); + case MUIA_Revision: + *store = LIB_REVISION; + return(TRUE); + } + return (DoSuperMethodA(cl,obj,msg)); +} + + +static IPTR mNFT_GetEntry(struct IClass *cl,Object *obj,struct MUIP_NFloattext_GetEntry *msg) +{ + register struct NFTData *data = INST_DATA(cl,obj); + struct MUI_NList_GetEntryInfo gei; + gei.pos = msg->pos; + gei.line = 0; + DoMethod(obj, MUIM_NList_GetEntryInfo, &gei); + if ((gei.entry_pos >= 0) && gei.entry) + { if (gei.wrapcol) + { char *entry = gei.entry; + if (!data->NFloattext_entry || (data->NFloattext_entry_len < gei.charlen)) + { if (data->NFloattext_entry) + FreeVec(data->NFloattext_entry); + data->NFloattext_entry_len = gei.charlen+18; + data->NFloattext_entry = (char *) AllocVec(gei.charlen+20,MEMF_ANY); + } + if (data->NFloattext_entry) + { char *nft_entry = data->NFloattext_entry; + CopyMem(&entry[gei.charpos], nft_entry, gei.charlen); + nft_entry[gei.charlen] = '\0'; + *msg->entry = nft_entry; + } + else + *msg->entry = &entry[gei.charpos]; + } + else + *msg->entry = gei.entry; + } + else + *msg->entry = NULL; + return (TRUE); +} + + +DISPATCHER(_Dispatcher) +{ + switch (msg->MethodID) + { + case OM_NEW : return ( mNFT_New(cl,obj,(APTR)msg)); + case OM_DISPOSE : return ( mNFT_Dispose(cl,obj,(APTR)msg)); + case OM_SET : return ( mNFT_Set(cl,obj,(APTR)msg)); + case OM_GET : return ( mNFT_Get(cl,obj,(APTR)msg)); + case MUIM_List_GetEntry : + case MUIM_NFloattext_GetEntry : return ( mNFT_GetEntry(cl,obj,(APTR)msg)); + } + return(DoSuperMethodA(cl,obj,msg)); +} diff --git a/workbench/classes/zune/nlist/nfloattext_mcc/library.c b/workbench/classes/zune/nlist/nfloattext_mcc/library.c new file mode 100644 index 0000000000..584126b6cc --- /dev/null +++ b/workbench/classes/zune/nlist/nfloattext_mcc/library.c @@ -0,0 +1,68 @@ +/*************************************************************************** + + NFloattext.mcc - New Floattext MUI Custom Class + Registered MUI class, Serial Number: 1d51 (0x9d5100a1 to 0x9d5100aF) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <proto/exec.h> + +/******************************************************************************/ +/* */ +/* MCC/MCP name and version */ +/* */ +/* ATTENTION: The FIRST LETTER of NAME MUST be UPPERCASE */ +/* */ +/******************************************************************************/ + +#include "private.h" +#include "version.h" + +#define VERSION LIB_VERSION +#define REVISION LIB_REVISION + +#define CLASS MUIC_NFloattext +#define SUPERCLASS MUIC_NList + +#define INSTDATA NFTData + +#define USERLIBID CLASS " " LIB_REV_STRING " [" SYSTEMSHORT "/" CPU "] (" LIB_DATE ") " LIB_COPYRIGHT +#define MASTERVERSION 19 + +#define USEDCLASSES used_mccs +static const char *used_mccs[] = { "NList.mcc", "NListview.mcc", NULL }; + +#define USEDCLASSESP used_mcps +static const char *used_mcps[] = { "NListviews.mcp", NULL }; + +#define MIN_STACKSIZE 8192 + +/******************************************************************************/ +/* define the functions used by the startup code ahead of including mccinit.c */ +/******************************************************************************/ + +/******************************************************************************/ +/* include the lib startup code for the mcc/mcp (and muimaster inlines) */ +/******************************************************************************/ +#include "mccinit.c" + +/******************************************************************************/ +/* define all implementations of our user functions */ +/******************************************************************************/ diff --git a/workbench/classes/zune/nlist/nfloattext_mcc/mmakefile.src b/workbench/classes/zune/nlist/nfloattext_mcc/mmakefile.src new file mode 100644 index 0000000000..8aeb1bf335 --- /dev/null +++ b/workbench/classes/zune/nlist/nfloattext_mcc/mmakefile.src @@ -0,0 +1,22 @@ +# $Id$ +include $(TOP)/config/make.cfg + +#MM contrib-zune-classes-nfloattext-class : setup includes linklibs contrib-zune-classes-nlist + +USER_INCLUDES = -idirafter $(SRCDIR)/$(CURDIR)/../include +USER_CFLAGS := -DNO_INLINE_STDARG +USER_CFLAGS += $(PARANOIA_CFLAGS) + +FILES := NFloattext Debug + +%build_module_simple mmake=contrib-zune-classes-nfloattext-class \ + modname=NFloattext modtype=mcc moduledir=$(CONTRIBDIR)/Zune/MCC_NList/Classes/Zune \ + files="library $(FILES)" uselibs="mui" + + +#MM includes-copy + +INCLUDE_FILES := ../include/mui/NFloattext_mcc.h +%copy_includes path=mui dir=../include/mui + +%common diff --git a/workbench/classes/zune/nlist/nfloattext_mcc/private.h b/workbench/classes/zune/nlist/nfloattext_mcc/private.h new file mode 100644 index 0000000000..8bb3e60ccd --- /dev/null +++ b/workbench/classes/zune/nlist/nfloattext_mcc/private.h @@ -0,0 +1,53 @@ +#ifndef MUI_NFloattext_priv_MCC_H +#define MUI_NFloattext_priv_MCC_H + +/*************************************************************************** + + NFloattext.mcc - New Floattext MUI Custom Class + Registered MUI class, Serial Number: 1d51 (0x9d5100a1 to 0x9d5100aF) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <dos/exall.h> +#include <exec/types.h> +#include <proto/intuition.h> +#include <intuition/classusr.h> +#include <libraries/mui.h> + +#include <mcc_common.h> + +#include <mui/NFloattext_mcc.h> + +#include "Debug.h" + +#define ALIGN_MASK (0x0700) + +struct NFTData +{ + char *NFloattext_Text; + LONG NFloattext_Align; + LONG NFloattext_entry_len; + char *NFloattext_entry; + BOOL NFloattext_Justify; + BOOL NFloattext_Copied; +}; + +#endif /* MUI_NFloattext_priv_MCC_H */ + diff --git a/workbench/classes/zune/nlist/nfloattext_mcc/version.h b/workbench/classes/zune/nlist/nfloattext_mcc/version.h new file mode 100644 index 0000000000..9a64e4b251 --- /dev/null +++ b/workbench/classes/zune/nlist/nfloattext_mcc/version.h @@ -0,0 +1,82 @@ +/*************************************************************************** + + NFloattext.mcc - New Floattext MUI Custom Class + Registered MUI class, Serial Number: 1d51 (0x9d5100a1 to 0x9d5100aF) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2010 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef _VERSION_H_ +#define _VERSION_H_ + +// transforms a define into a string +#define STR(x) STR2(x) +#define STR2(x) #x + +// for setting all necessary version information +#define LIB_VERSION 19 +#define LIB_REVISION 66 +#define LIB_DATE "17.12.2011" +#define LIB_COPYRIGHT "Copyright (C) 2007-2011 NList Open Source Team" + +// set the LIB_REV_STRING +#define LIB_REV_STRING STR(LIB_VERSION) "." STR(LIB_REVISION) + +// identify the system we are compiling for +#if defined(__amigaos4__) + #define SYSTEM "AmigaOS4" + #define SYSTEMSHORT "OS4" +#elif defined(__MORPHOS__) + #define SYSTEM "MorphOS" + #define SYSTEMSHORT "MOS" +#elif defined(__AROS__) + #define SYSTEM "AROS" + #define SYSTEMSHORT SYSTEM +#elif defined(__AMIGA__) + #define SYSTEM "AmigaOS3" + #define SYSTEMSHORT "OS3" +#else + #warning "Unsupported System - check SYSTEM define" + #define SYSTEM "???" + #define SYSTEMSHORT "???" +#endif + +// identify the CPU model +#if defined(__PPC__) || defined(__powerpc__) + #define CPU "PPC" +#elif defined(_M68060) || defined(__M68060) || defined(__mc68060) + #define CPU "m68060" +#elif defined(_M68040) || defined(__M68040) || defined(__mc68040) + #define CPU "m68040" +#elif defined(_M68030) || defined(__M68030) || defined(__mc68030) + #define CPU "m68030" +#elif defined(_M68020) || defined(__M68020) || defined(__mc68020) + #define CPU "m68k" +#elif defined(_M68000) || defined(__M68000) || defined(__mc68000) + #define CPU "m68000" +#elif defined(__i386__) + #define CPU "x86" +#elif defined(__x86_64__) + #define CPU "x86_64" +#else + #warning "Unsupported CPU model - check CPU define" + #define CPU "???" +#endif + +#endif // _VERSION_H_ diff --git a/workbench/classes/zune/nlist/nlist_mcc/ClipboardServer.c b/workbench/classes/zune/nlist/nlist_mcc/ClipboardServer.c new file mode 100755 index 0000000000..d9641b4504 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/ClipboardServer.c @@ -0,0 +1,364 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <string.h> +#include <stdlib.h> + +#include <proto/dos.h> +#include <proto/exec.h> +#include <proto/intuition.h> +#include <proto/keymap.h> +#include <proto/locale.h> + +#include <dos/dostags.h> +#include <mui/NList_mcc.h> + +// for iffparse.library no global variable definitions are needed +#define __NOLIBBASE__ +#define __NOGLOBALIFACE__ +#include <proto/iffparse.h> + +#include "private.h" + +#include "Debug.h" + +static struct Library *IFFParseBase = NULL; +#if defined(__amigaos4__) +static struct IFFParseIFace *IIFFParse = NULL; +#endif +static struct SignalSemaphore *serverLock = NULL; +static struct Process *serverProcess = NULL; +static struct MsgPort *serverPort = NULL; +static struct MsgPort replyPort; +static struct Message msg; + +struct ServerData +{ + ULONG sd_Command; + ULONG sd_Unit; + STRPTR sd_String; + LONG sd_Result; +}; + +#define SERVER_SHUTDOWN 0xdeadf00d +#define SERVER_WRITE 0x00000001 + +#define ID_FORM MAKE_ID('F','O','R','M') +#define ID_FTXT MAKE_ID('F','T','X','T') +#define ID_CHRS MAKE_ID('C','H','R','S') + +#ifndef MEMF_SHARED +#define MEMF_SHARED MEMF_ANY +#endif + +/// StringToClipboard +// copy a string to the clipboard, public callable function +LONG StringToClipboard(ULONG unit, STRPTR str) +{ + LONG result = MUIV_NLCT_Failed; + + // lock out other tasks + if(AttemptSemaphore(serverLock)) + { + struct ServerData sd; + + // set up the data packet + sd.sd_Command = SERVER_WRITE; + sd.sd_Unit = unit; + sd.sd_String = str; + + if(strlen(str) > 0) + { + // set up the message, send it and wait for a reply + msg.mn_Node.ln_Name = (STRPTR)&sd; + replyPort.mp_SigTask = FindTask(NULL); + + PutMsg(serverPort, &msg); + Remove((struct Node *)WaitPort(&replyPort)); + + result = sd.sd_Result; + } + else + DisplayBeep(0); + + // allow other tasks again + ReleaseSemaphore(serverLock); + } + else + DisplayBeep(0); + + return result; +} + +/// +/// WriteToClipboard +// write a given string via iffparse.library to the clipboard +// non-public server side function +static LONG WriteToClipboard(ULONG unit, STRPTR str) +{ + LONG result = MUIV_NLCT_Failed; + struct IFFHandle *iff; + + if((iff = AllocIFF()) != NULL) + { + if((iff->iff_Stream = (IPTR)OpenClipboard(unit)) != 0) + { + InitIFFasClip(iff); + + if(OpenIFF(iff, IFFF_WRITE) == 0) + { + LONG size = strlen(str); + + PushChunk(iff, ID_FTXT, ID_FORM, IFFSIZE_UNKNOWN); + PushChunk(iff, 0, ID_CHRS, IFFSIZE_UNKNOWN); + if(WriteChunkBytes(iff, str, size) == size) + result = MUIV_NLCT_Success; + else + result = MUIV_NLCT_WriteErr; + PopChunk(iff); + PopChunk(iff); + + CloseIFF(iff); + } + + CloseClipboard((struct ClipboardHandle *)iff->iff_Stream); + } + + FreeIFF(iff); + } + + return result; +} + +/// +/// ClipboardServer +// the clipboard server process +#if defined(__amigaos4__) +static LONG ClipboardServer(UNUSED STRPTR args, UNUSED LONG length, struct ExecBase *SysBase) +#else +static SAVEDS ASM LONG ClipboardServer(UNUSED REG(a0, STRPTR args), UNUSED REG(d0, LONG length)) +#endif +{ + struct Process *me; + struct Message *msg; + #if defined(__amigaos4__) + struct ExecIFace *IExec = (struct ExecIFace *)SysBase->MainInterface; + #endif + + ENTER(); + + D(DBF_CLIPBOARD, "clipboard server starting up"); + + me = (struct Process *)FindTask(NULL); + WaitPort(&me->pr_MsgPort); + msg = GetMsg(&me->pr_MsgPort); + + if((IFFParseBase = OpenLibrary("iffparse.library", 36)) != NULL) + { + #if defined(__amigaos4__) + + if((IIFFParse = (struct IFFParseIFace *)GetInterface(IFFParseBase, "main", 1, NULL)) != NULL) + { + #endif + struct MsgPort *mp; + + #if defined(__amigaos4__) + mp = AllocSysObjectTags(ASOT_PORT, TAG_DONE); + #else + mp = CreateMsgPort(); + #endif + if(mp != NULL) + { + BOOL running = TRUE; + + // return something as a valid reply + msg->mn_Node.ln_Name = (STRPTR)mp; + ReplyMsg(msg); + + D(DBF_CLIPBOARD, "clipboard server main loop"); + do + { + WaitPort(mp); + + while((msg = GetMsg(mp)) != NULL) + { + struct ServerData *sd = (struct ServerData *)msg->mn_Node.ln_Name; + + switch(sd->sd_Command) + { + case SERVER_SHUTDOWN: + { + running = FALSE; + } + break; + + case SERVER_WRITE: + { + sd->sd_Result = WriteToClipboard(sd->sd_Unit, sd->sd_String); + } + break; + } + + ReplyMsg(msg); + } + } + while(running == TRUE); + + #if defined(__amigaos4__) + FreeSysObject(ASOT_PORT, mp); + #else + DeleteMsgPort(mp); + #endif + } + + #if defined(__amigaos4__) + DropInterface((struct Interface *)IIFFParse); + } + #endif + + CloseLibrary(IFFParseBase); + } + + D(DBF_CLIPBOARD, "clipboard server shutting down"); + + Forbid(); + + LEAVE(); + return 0; +} + +/// +/// StartClipboardServer +// launch the clipboard server process +// we must use a separate process, because accessing the clipboard via iffparse.library +// allocates 2 signals for every instance of this class. Hence we will run out of signals +// sooner or later. The separate process avoids this situation. +BOOL StartClipboardServer(void) +{ + BOOL success = FALSE; + + ENTER(); + + // create a semaphore to protect several concurrent tasks + #if defined(__amigaos4__) + serverLock = AllocSysObjectTags(ASOT_SEMAPHORE, TAG_DONE); + #else + serverLock = AllocVec(sizeof(*serverLock), MEMF_CLEAR); + #endif + if(serverLock != NULL) + { + #if defined(__amigaos4__) + uint32 oldStackSize; + #else + InitSemaphore(serverLock); + #endif + + #if defined(__amigaos4__) + // set a minimum stack size of 8K, no matter what the user has set + DosControlTags(DC_MinProcStackR, &oldStackSize, + DC_MinProcStackW, 8192, + TAG_DONE); + #endif + + // create the server process + // this must *NOT* be a child process + serverProcess = CreateNewProcTags(NP_Entry, ClipboardServer, + NP_Name, "NList.mcc clipboard server", + NP_Priority, 1, + NP_StackSize, 8192, + NP_WindowPtr, ~0L, + #if defined(__amigaos4__) + NP_Child, FALSE, + #elif defined(__MORPHOS__) + NP_CodeType, CODETYPE_PPC, + #endif + TAG_DONE); + if(serverProcess != NULL) + { + // we use one global reply port with a static signal bit + replyPort.mp_Node.ln_Type = NT_MSGPORT; + NewList(&replyPort.mp_MsgList); + replyPort.mp_SigBit = SIGB_SINGLE; + replyPort.mp_SigTask = FindTask(NULL); + + msg.mn_ReplyPort = &replyPort; + msg.mn_Node.ln_Name = (STRPTR)NULL; + + // send out the startup message and wait for a reply + PutMsg(&serverProcess->pr_MsgPort, &msg); + Remove((struct Node *)WaitPort(&replyPort)); + + // check whether everything went ok + if((serverPort = (struct MsgPort *)msg.mn_Node.ln_Name) != NULL) + { + success = TRUE; + } + } + + #if defined(__amigaos4__) + // restore the old minimum stack size + DosControlTags(DC_MinProcStackW, oldStackSize, + TAG_DONE); + #endif + } + + RETURN(success); + return success; +} + +/// +/// ShutdownClipboardServer +// shutdown the server process and clean up +void ShutdownClipboardServer(void) +{ + if(serverPort != NULL) + { + struct ServerData sd; + + sd.sd_Command = SERVER_SHUTDOWN; + + msg.mn_Node.ln_Name = (STRPTR)&sd; + replyPort.mp_SigTask = FindTask(NULL); + + PutMsg(serverPort, &msg); + WaitPort(&replyPort); + + serverPort = NULL; + } + + if(serverLock != NULL) + { + #if defined(__amigaos4__) + FreeSysObject(ASOT_SEMAPHORE, serverLock); + #else + FreeVec(serverLock); + #endif + + serverLock = NULL; + } +} + +/// + diff --git a/workbench/classes/zune/nlist/nlist_mcc/Debug.c b/workbench/classes/zune/nlist/nlist_mcc/Debug.c new file mode 100644 index 0000000000..643321af93 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/Debug.c @@ -0,0 +1,460 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifdef DEBUG + +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> +#include <stdio.h> + +#include <proto/exec.h> +#include <proto/dos.h> +#include <proto/intuition.h> +#include <proto/timer.h> +#include <proto/utility.h> + +#include "SDI_compiler.h" +#include "Debug.h" +#include "version.h" +#include "timeval.h" + +// special flagging macros +#define isFlagSet(v,f) (((v) & (f)) == (f)) // return TRUE if the flag is set +#define hasFlag(v,f) (((v) & (f)) != 0) // return TRUE if one of the flags in f is set in v +#define isFlagClear(v,f) (((v) & (f)) == 0) // return TRUE if flag f is not set in v +#define SET_FLAG(v,f) ((v) |= (f)) // set the flag f in v +#define CLEAR_FLAG(v,f) ((v) &= ~(f)) // clear the flag f in v +#define MASK_FLAG(v,f) ((v) &= (f)) // mask the variable v with flag f bitwise + +// our static variables with default values +static int indent_level = 0; +static BOOL ansi_output = FALSE; +static ULONG debug_flags = DBF_ALWAYS | DBF_STARTUP; // default debug flags +static ULONG debug_classes = DBC_ERROR | DBC_DEBUG | DBC_WARNING | DBC_ASSERT | DBC_REPORT; // default debug classes +#define NUMCLOCKS 8 +static int timer_level = -1; +static struct TimeVal startTimes[NUMCLOCKS]; + +/****************************************************************************/ + +void SetupDebug(void) +{ + char var[256]; + + kprintf("** NList.mcc v" LIB_REV_STRING " startup ***********************\n"); + kprintf("Initializing runtime debugging:\n"); + + if(GetVar("nlist.mcc.debug", var, sizeof(var), 0) > 0) + { + char *tok; + char *debug = var; + + // static list of our debugging classes tokens. + // in the yamdebug variable these classes always start with a @ + static struct { const char *token; unsigned long flag; } dbclasses[] = + { + { "ctrace", DBC_CTRACE }, + { "report", DBC_REPORT }, + { "assert", DBC_ASSERT }, + { "timeval", DBC_TIMEVAL }, + { "debug", DBC_DEBUG }, + { "error", DBC_ERROR }, + { "warning", DBC_WARNING }, + { "all", DBC_ALL }, + { NULL, 0 } + }; + + static struct { const char *token; unsigned long flag; } dbflags[] = + { + { "always", DBF_ALWAYS }, + { "startup", DBF_STARTUP }, + { "select", DBF_SELECT }, + { "input", DBF_INPUT }, + { "clipboard", DBF_CLIPBOARD }, + { "draw", DBF_DRAW }, + { "all", DBF_ALL }, + { NULL, 0 } + }; + + // we parse the env variable token-wise + while((tok = strtok(debug, ", ;"))) + { + ULONG i; + + // check if the token is class definition or + // just a flag definition + if(tok[0] == '@') + { + // check if this call is a negation or not + if(tok[1] == '!') + { + // search for the token and clear the flag + for(i=0; dbclasses[i].token; i++) + { + if(stricmp(tok+2, dbclasses[i].token) == 0) + { + kprintf("clear '%s' debug class flag.\n", dbclasses[i].token); + CLEAR_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + else + { + // search for the token and set the flag + for(i=0; dbclasses[i].token; i++) + { + if(stricmp(tok+1, dbclasses[i].token) == 0) + { + kprintf("set '%s' debug class flag\n", dbclasses[i].token); + SET_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + } + else + { + // check if this call is a negation or not + if(tok[0] == '!') + { + for(i=0; dbflags[i].token; i++) + { + if(stricmp(tok+1, dbflags[i].token) == 0) + { + kprintf("clear '%s' debug flag\n", dbflags[i].token); + CLEAR_FLAG(debug_flags, dbflags[i].flag); + } + } + } + else + { + // check if the token was "ansi" and if so enable the ANSI color + // output + if(stricmp(tok, "ansi") == 0) + { + kprintf("ansi output enabled\n"); + ansi_output = TRUE; + } + else + { + for(i=0; dbflags[i].token; i++) + { + if(stricmp(tok, dbflags[i].token) == 0) + { + kprintf("set '%s' debug flag\n", dbflags[i].token); + SET_FLAG(debug_flags, dbflags[i].flag); + } + } + } + } + } + + debug = NULL; + } + } + + kprintf("set debug classes/flags (env:nlist.mcc.debug): %08lx/%08lx\n", debug_classes, debug_flags); + kprintf("** Normal processing follows ***************************************\n"); +} + +/****************************************************************************/ + +void CleanupDebug(void) +{ + kprintf("** Cleaned up debugging ********************************************\n"); +} + +/****************************************************************************/ + +// define variables for using ANSI colors in our debugging scheme +#define ANSI_ESC_CLR "\033[0m" +#define ANSI_ESC_BOLD "\033[1m" +#define ANSI_ESC_UNDERLINE "\033[4m" +#define ANSI_ESC_BLINK "\033[5m" +#define ANSI_ESC_REVERSE "\033[7m" +#define ANSI_ESC_INVISIBLE "\033[8m" +#define ANSI_ESC_FG_BLACK "\033[0;30m" +#define ANSI_ESC_FG_RED "\033[0;31m" +#define ANSI_ESC_FG_GREEN "\033[0;32m" +#define ANSI_ESC_FG_BROWN "\033[0;33m" +#define ANSI_ESC_FG_BLUE "\033[0;34m" +#define ANSI_ESC_FG_PURPLE "\033[0;35m" +#define ANSI_ESC_FG_CYAN "\033[0;36m" +#define ANSI_ESC_FG_LGRAY "\033[0;37m" +#define ANSI_ESC_FG_DGRAY "\033[1;30m" +#define ANSI_ESC_FG_LRED "\033[1;31m" +#define ANSI_ESC_FG_LGREEN "\033[1;32m" +#define ANSI_ESC_FG_YELLOW "\033[1;33m" +#define ANSI_ESC_FG_LBLUE "\033[1;34m" +#define ANSI_ESC_FG_LPURPLE "\033[1;35m" +#define ANSI_ESC_FG_LCYAN "\033[1;36m" +#define ANSI_ESC_FG_WHITE "\033[1;37m" +#define ANSI_ESC_BG "\033[0;4" // background esc-squ start with 4x +#define ANSI_ESC_BG_BLACK "\033[0;40m" +#define ANSI_ESC_BG_RED "\033[0;41m" +#define ANSI_ESC_BG_GREEN "\033[0;42m" +#define ANSI_ESC_BG_BROWN "\033[0;43m" +#define ANSI_ESC_BG_BLUE "\033[0;44m" +#define ANSI_ESC_BG_PURPLE "\033[0;45m" +#define ANSI_ESC_BG_CYAN "\033[0;46m" +#define ANSI_ESC_BG_LGRAY "\033[0;47m" + +/****************************************************************************/ + +INLINE void _INDENT(void) +{ + int i; + for(i=0; i < indent_level; i++) + kprintf(" "); +} + +/****************************************************************************/ + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function) +{ + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Entering %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Entering %s\n", file, line, function); + } + + indent_level++; +} + +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function) +{ + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s\n", file, line, function); + } +} + +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result) +{ + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s (result 0x%08lx, %ld)%s\n", ANSI_ESC_FG_BROWN, file, line, function, result, result, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s (result 0x%08lx, %ld)\n", file, line, function, result, result); + } +} + +/****************************************************************************/ + +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + switch(size) + { + case 1: + fmt = "%s:%ld:%s = %ld, 0x%02lx"; + break; + + case 2: + fmt = "%s:%ld:%s = %ld, 0x%04lx"; + break; + + default: + fmt = "%s:%ld:%s = %ld, 0x%08lx"; + break; + } + + _INDENT(); + + if(ansi_output) + kprintf(ANSI_ESC_FG_GREEN); + + kprintf(fmt, file, line, name, value, value); + + if(size == 1 && value < 256) + { + if(value < ' ' || (value >= 127 && value < 160)) + kprintf(", '\\x%02lx'", value); + else + kprintf(", '%lc'", value); + } + + if(ansi_output) + kprintf("%s\n", ANSI_ESC_CLR); + else + kprintf("\n"); + } +} + +/****************************************************************************/ + +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + _INDENT(); + + if(p != NULL) + fmt = "%s:%ld:%s = 0x%08lx\n"; + else + fmt = "%s:%ld:%s = NULL\n"; + + if(ansi_output) + { + kprintf(ANSI_ESC_FG_GREEN); + kprintf(fmt, file, line, name, p); + kprintf(ANSI_ESC_CLR); + } + else + kprintf(fmt, file, line, name, p); + } +} + +/****************************************************************************/ + +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s = 0x%08lx \"%s\"%s\n", ANSI_ESC_FG_GREEN, file, line, name, string, string, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s = 0x%08lx \"%s\"\n", file, line, name, string, string); + } +} + +/****************************************************************************/ + +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s%s\n", ANSI_ESC_FG_GREEN, file, line, msg, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s\n", file, line, msg); + } +} + +/****************************************************************************/ + +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...) +{ + if((isFlagSet(debug_classes, dclass) && isFlagSet(debug_flags, dflags)) || + (isFlagSet(dclass, DBC_ERROR) || isFlagSet(dclass, DBC_WARNING))) + { + va_list args; + static char buf[1024]; + + _INDENT(); + + va_start(args, format); + vsnprintf(buf, 1024, format, args); + va_end(args); + + if(ansi_output) + { + const char *highlight = ANSI_ESC_FG_GREEN; + + switch(dclass) + { + case DBC_CTRACE: highlight = ANSI_ESC_FG_BROWN; break; + case DBC_REPORT: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ASSERT: highlight = ANSI_ESC_FG_RED; break; + case DBC_TIMEVAL: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_DEBUG: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ERROR: highlight = ANSI_ESC_FG_RED; break; + case DBC_WARNING: highlight = ANSI_ESC_FG_PURPLE;break; + } + + kprintf("%s%s:%ld:%s%s\n", highlight, file, line, buf, ANSI_ESC_CLR); + } + else + kprintf("%s:%ld:%s\n", file, line, buf); + } +} + +/****************************************************************************/ + +void _STARTCLOCK(unsigned long dclass, unsigned long dflags, const char *file, const unsigned long line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + if(timer_level + 1 < NUMCLOCKS) + { + timer_level++; + GetSysTime(TIMEVAL(&startTimes[timer_level])); + } + else + kprintf("%s:%ld: already %ld clocks in use\n", file, line, NUMCLOCKS); + } +} + +/****************************************************************************/ + +void _STOPCLOCK(unsigned long dclass, unsigned long dflags, const char *file, const unsigned long line, const char *msg) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + if(timer_level >= 0) + { + struct TimeVal stopTime; + + GetSysTime(TIMEVAL(&stopTime)); + SubTime(TIMEVAL(&stopTime), TIMEVAL(&startTimes[timer_level])); + kprintf("%s:%ld: operation '%s' took %ld.%06ld seconds\n", file, line, msg, stopTime.Seconds, stopTime.Microseconds); + timer_level--; + } + else + kprintf("%s:%ld: no clocks in use\n", file, line); + } +} + +/****************************************************************************/ + +#endif diff --git a/workbench/classes/zune/nlist/nlist_mcc/Debug.h b/workbench/classes/zune/nlist/nlist_mcc/Debug.h new file mode 100644 index 0000000000..e43aab6eba --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/Debug.h @@ -0,0 +1,149 @@ +/*************************************************************************** + + TextEditor.mcc - Textediting MUI Custom Class + Copyright (C) 1997-2000 Allan Odgaard + Copyright (C) 2005 by TextEditor.mcc Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + TextEditor class Support Site: http://www.sf.net/projects/texteditor-mcc + + $Id$ + +***************************************************************************/ + +#ifndef DEBUG_H +#define DEBUG_H + +// first we make sure all previously defined symbols are undefined now so +// that no other debug system interferes with ours. +#undef ENTER +#undef LEAVE +#undef RETURN +#undef SHOWVALUE +#undef SHOWPOINTER +#undef SHOWSTRING +#undef SHOWMSG +#undef STARTCLOCK +#undef STOPCLOCK +#undef D +#undef E +#undef W +#undef ASSERT + +#if defined(DEBUG) + +#include <assert.h> + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +#if defined(__amigaos4__) + #include <proto/exec.h> + #ifdef __USE_INLINE__ + #ifdef DebugPrintF + #undef DebugPrintF + #endif + #endif + #ifndef kprintf + #define kprintf(format, args...) ((struct ExecIFace *)((*(struct ExecBase **)4)->MainInterface))->DebugPrintF(format, ## args) + #endif +#elif defined(__MORPHOS__) + #include <exec/rawfmt.h> + #include <proto/exec.h> + #define KPutFmt(format, args) VNewRawDoFmt(format, (APTR)RAWFMTFUNC_SERIAL, NULL, args) +void kprintf(const char *formatString,...); +#else +void kprintf(const char *formatString,...); +#endif + +// debug classes +#define DBC_CTRACE (1<<0) // call tracing (ENTER/LEAVE etc.) +#define DBC_REPORT (1<<1) // reports (SHOWVALUE/SHOWSTRING etc.) +#define DBC_ASSERT (1<<2) // asserts (ASSERT) +#define DBC_TIMEVAL (1<<3) // time evaluations (STARTCLOCK/STOPCLOCK) +#define DBC_DEBUG (1<<4) // debugging output D() +#define DBC_ERROR (1<<5) // error output E() +#define DBC_WARNING (1<<6) // warning output W() +#define DBC_ALL 0xffffffff + +// debug flags +#define DBF_ALWAYS (1<<0) +#define DBF_STARTUP (1<<1) // for startup/shutdown events (YAM.c) +#define DBF_SELECT (1<<2) +#define DBF_INPUT (1<<3) +#define DBF_CLIPBOARD (1<<4) +#define DBF_DRAW (1<<5) +#define DBF_ALL 0xffffffff + +void SetupDebug(void); +void CleanupDebug(void); + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function); +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function); +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result); +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line); +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line); +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line); +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line); +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...); +void _STARTCLOCK(unsigned long dclass, unsigned long dflags, const char *file, unsigned long line); +void _STOPCLOCK(unsigned long dclass, unsigned long dflags, const char *file, unsigned long line, const char *msg); + +// Core class information class messages +#define ENTER() _ENTER(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define LEAVE() _LEAVE(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define RETURN(r) _RETURN(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__, (long)r) +#define SHOWVALUE(f, v) _SHOWVALUE(DBC_REPORT, f, (long)v, sizeof(v), #v, __FILE__, __LINE__) +#define SHOWPOINTER(f, p) _SHOWPOINTER(DBC_REPORT, f, p, #p, __FILE__, __LINE__) +#define SHOWSTRING(f, s) _SHOWSTRING(DBC_REPORT, f, s, #s, __FILE__, __LINE__) +#define SHOWMSG(f, m) _SHOWMSG(DBC_REPORT, f, m, __FILE__, __LINE__) +#define STARTCLOCK(f) _STARTCLOCK(DBC_TIMEVAL, f, __FILE__, __LINE__) +#define STOPCLOCK(f, msg) _STOPCLOCK(DBC_TIMEVAL, f, __FILE__, __LINE__, msg) +#define D(f, s, vargs...) _DPRINTF(DBC_DEBUG, f, __FILE__, __LINE__, s, ## vargs) +#define E(f, s, vargs...) _DPRINTF(DBC_ERROR, f, __FILE__, __LINE__, s, ## vargs) +#define W(f, s, vargs...) _DPRINTF(DBC_WARNING, f, __FILE__, __LINE__, s, ## vargs) +#define ASSERT(expression) \ + ((void) \ + ((expression) ? 0 : \ + ( \ + _DPRINTF(DBC_ASSERT, \ + DBF_ALWAYS, \ + __FILE__, \ + __LINE__, \ + "failed assertion '%s'", \ + #expression), \ + assert(#expression), \ + 0 \ + ) \ + ) \ + ) + +#else // DEBUG + +#define ENTER() ((void)0) +#define LEAVE() ((void)0) +#define RETURN(r) ((void)0) +#define SHOWVALUE(f, v) ((void)0) +#define SHOWPOINTER(f, p) ((void)0) +#define SHOWSTRING(f, s) ((void)0) +#define SHOWMSG(f, m) ((void)0) +#define STARTCLOCK(f) ((void)0) +#define STOPCLOCK(f, m) ((void)0) +#define D(f, s, vargs...) ((void)0) +#define E(f, s, vargs...) ((void)0) +#define W(f, s, vargs...) ((void)0) +#define ASSERT(expression) ((void)0) + +#endif // DEBUG + +#endif // DEBUG_H diff --git a/workbench/classes/zune/nlist/nlist_mcc/Makefile b/workbench/classes/zune/nlist/nlist_mcc/Makefile new file mode 100644 index 0000000000..344dfec60e --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/Makefile @@ -0,0 +1,447 @@ +#/*************************************************************************** +# +# NList.mcc - New List MUI Custom Class +# Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 +# 0x9d5100C0 to 0x9d5100FF +# +# Copyright (C) 1996-2001 by Gilles Masson +# Copyright (C) 2001-2005 by NList Open Source Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# NList classes Support Site: http://www.sf.net/projects/nlist-classes +# +# $Id$ +# +#***************************************************************************/ + +########################################################################### +# This makefile is a very generic one. It tries to identify both, the host +# and the target operating system for which YAM should be compiled. +# However, this auto-detection can be easily overridden by directly +# specifying an option on the commandline while calling 'make'. +# +# Example: +# +# # to explicitly compile for AmigaOS3 +# > make OS=os3 +# +# # to compile for AmigaOS4 but with debugging +# > make OS=os4 DEBUG= +# + +############################################# +# find out the HOST operating system +# on which this makefile is run +HOST ?= $(shell uname) +ifeq ($(HOST), AmigaOS) + ifeq ($(shell uname -m), powerpc) + HOST = AmigaOS4 + endif + ifeq ($(shell uname -m), ppc) + HOST = AmigaOS4 + endif +endif + +# if no host is identifed (no uname tool) +# we assume a AmigaOS build +ifeq ($(HOST),) + HOST = AmigaOS +endif + +############################################# +# now we find out the target OS for +# which we are going to compile YAM in case +# the caller didn't yet define OS himself +ifndef (OS) + ifeq ($(HOST), AmigaOS4) + OS = os4 + else + ifeq ($(HOST), AmigaOS) + OS = os3 + else + ifeq ($(HOST), MorphOS) + OS = mos + else + ifeq ($(HOST), AROS) + # now we find out which CPU system aros will be used + ifeq ($(shell uname -m), powerpc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), ppc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), i386) + OS = aros-i386 + endif + ifeq ($(shell uname -m), i686) + OS = aros-i686 + endif + ifeq ($(shell uname -m), x86_64) + OS = aros-x86_64 + endif + else + OS = os4 + endif + endif + endif + endif +endif + +############################################# +# define common commands we use in this +# makefile. Please note that each of them +# might be overridden on the commandline. + +# common commands +FLEX = flex +FC = flexcat +EXPR = expr +DATE = date +RM = delete force +RMDIR = delete force all +MKDIR = makedir +CHMOD = protect FLAGS=rwed +SED = sed +CP = copy +CC = gcc +STRIP = strip +OBJDUMP = objdump + +# path definitions +CDUP = / +CDTHIS= + +# override some variables for non-native builds (cross-compiler) +ifneq ($(HOST), AmigaOS) +ifneq ($(HOST), AmigaOS4) +ifneq ($(HOST), MorphOS) + + # when we end up here this is either a unix or Aros host + # so lets use unix kind of commands + RM = rm -f + RMDIR = rm -rf + MKDIR = mkdir -p + CHMOD = chmod 755 + CP = cp -f + + CDUP = ../ + CDTHIS= ./ + +endif +endif +endif + +########################################################################### +# CPU and DEBUG can be defined outside, defaults to above +# using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug +# PPC-603e version +# +# OPTFLAGS are disabled by DEBUG normally! +# +# ignored warnings are: +# none - because we want to compile with -Wall all the time + +# Common Directories +PREFIX = $(CDTHIS) +OBJDIR = .obj_$(OS) +BINDIR = bin_$(OS) +VPATH = $(OBJDIR) +DEPFILE = Makefile.dep +DESTDIR = MUI:Libs/MUI + +# target definition +TARGET = $(BINDIR)/NList.mcc +TESTTARGET= $(BINDIR)/NList-Test + +# Common compiler/linker flags +WARN = -W -Wall -Wwrite-strings -Wpointer-arith -Wsign-compare +OPTFLAGS = -O3 -fomit-frame-pointer -funroll-loops +DEBUG = -DDEBUG -O0 +DEBUGSYM = -g -gstabs +CFLAGS = -I. -I../nlistview_mcc -I../nlistviews_mcp -I../include $(CPU) $(WARN) \ + $(OPTFLAGS) $(DEBUG) $(DEBUGSYM) $(USER_CFLAGS) -c +LDFLAGS = $(CPU) $(DEBUGSYM) +LDLIBS = + +########################################################################### +# object files definition +# + +LOBJS = library.o + +COBJS = NList_mcc.o \ + NList_mcc0.o \ + NList_mcc1.o \ + NList_mcc2.o \ + NList_mcc3.o \ + NList_mcc4.o \ + NList_mcc5.o \ + NList_mcc6.o \ + move.o \ + NList_func.o \ + NList_func2.o \ + NList_func3.o \ + NList_func4.o \ + NList_grp.o \ + NList_img.o \ + NList_img2.o \ + ClipboardServer.o \ + Pointer.o \ + Debug.o + +TOBJS = NList-Test.o + +# different options per target OS +ifeq ($(OS), os4) + + ############################## + # AmigaOS4 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS4) + CC = ppc-amigaos-gcc + STRIP = ppc-amigaos-strip + OBJDUMP = ppc-amigaos-objdump + endif + + # Compiler/Linker flags + CRT = newlib + CPU = -mcpu=powerpc + WARN += -Wdeclaration-after-statement -Wdisabled-optimization + CFLAGS += -mcrt=$(CRT) -D__USE_INLINE__ -D__NEW_TIMEVAL_DEFINITION_USED__ \ + -DNO_PPCINLINE_STDARG -Wa,-mregnames + LDFLAGS += -mcrt=$(CRT) + + # additional object files required + M68KSTUBS = $(OBJDIR)/mccclass_68k.o + +else +ifeq ($(OS), os3) + + ############################## + # AmigaOS3 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS) + CC = m68k-amigaos-gcc + STRIP = m68k-amigaos-strip + OBJDUMP = m68k-amigaos-objdump + endif + + # Compiler/Linker flags + CPU = -m68020-60 -msoft-float + CFLAGS += -noixemul -DNO_INLINE_STDARG -D__amigaos3__ + LDFLAGS += -noixemul + LDLIBS += -ldebug -lmui + + # additional object files required + COBJS += vastubs.o \ + extrasrc/AllocVecPooled.o \ + extrasrc/FreeVecPooled.o + +else +ifeq ($(OS), mos) + + ############################## + # MorphOS + + # Compiler/link/strip commands + ifneq ($(HOST), MorphOS) + CC = ppc-morphos-gcc + STRIP = ppc-morphos-strip + OBJDUMP = ppc-morphos-objdump + endif + + # Compiler/Linker flags + CPU = -mcpu=powerpc + CFLAGS += -noixemul -DNO_PPCINLINE_STDARG + LDFLAGS += -noixemul + LDLIBS += -ldebug + +else +ifeq ($(OS), aros-i386) + + ############################## + # AROS (i386) + + ifneq ($(HOST), AROS) + CC = i386-aros-gcc + STRIP = i386-aros-strip + OBJDUMP = i386-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-ppc) + + ############################## + # AROS (PPC) + + ifneq ($(HOST), AROS) + CC = ppc-aros-gcc + STRIP = ppc-aros-strip + OBJDUMP = ppc-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-x86_64) + + ############################## + # AROS (x86_64) + + ifneq ($(HOST), AROS) + CC = x86_64-aros-gcc + STRIP = x86_64-aros-strip + OBJDUMP = x86_64-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign + LDLIBS += -larossupport -lrom -lmui + +endif +endif +endif +endif +endif +endif + +MCCOBJS = $(addprefix $(OBJDIR)/,$(LOBJS)) $(addprefix $(OBJDIR)/,$(COBJS)) +TESTOBJS = $(addprefix $(OBJDIR)/,$(COBJS)) $(addprefix $(OBJDIR)/,$(TOBJS)) + +# main target +.PHONY: all +ifeq ($(wildcard $(DEPFILE)),$(DEPFILE)) +# great, we have a dependecies file, let's make our target +all: $(BINDIR) $(OBJDIR) $(M68KSTUBS) $(TARGET) $(TESTTARGET) +else +# no dependecies, create it and then call make again +all: depend + @make --no-print-directory all +endif + +# for making a release we compile ALL target with no debug +release: + @echo " CC $<" + make OS=os4 clean + make OS=os4 DEBUG= + @echo " CC $<" + make OS=os3 clean + make OS=os3 DEBUG= + @echo " CC $<" + make OS=mos clean + make OS=mos DEBUG= + @echo " CC $<" + make OS=aros-i386 clean + make OS=aros-i386 DEBUG= + @echo " CC $<" + make OS=aros-ppc clean + make OS=aros-ppc DEBUG= + @echo " CC $<" + make OS=aros-x86_64 clean + make OS=aros-x86_64 DEBUG= + +# make the object directories +$(OBJDIR): + @echo " MK $@" + @$(MKDIR) $(OBJDIR) + @$(MKDIR) $(OBJDIR)/extrasrc + +# make the binary directories +$(BINDIR): + @echo " MK $@" + @$(MKDIR) $(BINDIR) + +# for compiling single .c files +$(OBJDIR)/%.o: %.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +$(OBJDIR)/mccclass_68k.o: ../include/mccclass_68k.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +# for linking the target +$(TARGET): $(M68KSTUBS) $(MCCOBJS) + @echo " LD $@.debug" + @$(CC) -nostartfiles $(LDFLAGS) -o $@.debug $(MCCOBJS) $(M68KSTUBS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +# for linking the target +$(TESTTARGET): $(TESTOBJS) + @echo " LD $@.debug" + @$(CC) $(LDFLAGS) -o $@.debug $(TESTOBJS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +.PHONY: dump +dump: + -$(OBJDUMP) --section-headers --all-headers --reloc --disassemble-all $(TARGET) >$(TARGET).dump + +.PHONY: clean +clean: + -$(RM) $(TARGET) $(TARGET).debug $(TARGET).map + -$(RM) $(TESTTARGET) $(TESTTARGET).debug $(TESTTARGET).map + -$(RM) $(MCCOBJS) $(TESTOBJS) $(M68KSTUBS) + +.PHONY: distclean +distclean: clean + -$(RMDIR) $(OBJDIR) + -$(RMDIR) $(BINDIR) + +# install +.PHONY: install +install: all + @echo " IN $(TARGET)" + @$(CP) $(TARGET) $(DESTDIR) + +.PHONY: help +help: + @echo "Cleaning targets:" + @echo " clean - Cleanup working directory for clean compile" + @echo " distclean - Also cleanup autogenerated files" + @echo "" + @echo "Other generic targets:" + @echo " all - Build $(TARGET)" + @echo " catalogs - Build all available catalogs" + @echo "" + @echo "Install targets:" + @echo " install - Install $(TARGET) into $(DESTDIR)" + @echo "" + @echo "Parameters:" + @echo " make OS=os3|os4|mos|aros-i386|aros-i686|aros-ppc|aros-x86_64" + @echo " make DEBUG= : build $(TARGET) without debugging information" + @echo "" + +## DEPENDENCY GENERATION ############## + +.PHONY: depend +depend: + @echo " MK $(DEPFILE)" + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >$(DEPFILE) + @$(CC) -MM -MG $(CFLAGS) $(wildcard *.c) >>$(DEPFILE) + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >>$(DEPFILE) + @$(SED) -i 's,^\(.*\)\.o:,$$\(OBJDIR\)/\1.o:,g' $(DEPFILE) + +# include dependencies file +-include $(DEPFILE) diff --git a/workbench/classes/zune/nlist/nlist_mcc/Makefile.dep b/workbench/classes/zune/nlist/nlist_mcc/Makefile.dep new file mode 100644 index 0000000000..dd2dd1be8f --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/Makefile.dep @@ -0,0 +1,129 @@ +# AUTOGENERATED! DO NOT EDIT!!! +$(OBJDIR)/ClipboardServer.o: ClipboardServer.c ../include/mui/NList_mcc.h \ + ../include/libraries/mui.h private.h Debug.h Pointer.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h ../include/muiextra.h \ + ../include/amiga-align.h ../include/default-align.h protos.h +$(OBJDIR)/Debug.o: Debug.c ../include/SDI_compiler.h Debug.h version.h +$(OBJDIR)/library.o: library.c private.h ../include/libraries/mui.h \ + ../include/mui/NList_mcc.h Debug.h Pointer.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h version.h NList_grp.h \ + ../include/mccinit.c ../include/proto/muimaster.h \ + ../include/interfaces/muimaster.h ../include/inline4/muimaster.h +$(OBJDIR)/move.o: move.c private.h ../include/libraries/mui.h \ + ../include/mui/NList_mcc.h Debug.h Pointer.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h +$(OBJDIR)/NList_func2.o: NList_func2.c private.h ../include/libraries/mui.h \ + ../include/mui/NList_mcc.h Debug.h Pointer.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_func.h +$(OBJDIR)/NList_func3.o: NList_func3.c private.h ../include/libraries/mui.h \ + ../include/mui/NList_mcc.h Debug.h Pointer.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_func.h +$(OBJDIR)/NList_func4.o: NList_func4.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/mui/NList_mcc.h \ + Debug.h Pointer.h ../include/mcc_common.h ../include/SDI_compiler.h \ + ../include/SDI_hook.h ../include/SDI_lib.h ../include/SDI_stdarg.h \ + ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_func.h +$(OBJDIR)/NList_func.o: NList_func.c private.h ../include/libraries/mui.h \ + ../include/mui/NList_mcc.h Debug.h Pointer.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_func.h +$(OBJDIR)/NList_grp.o: NList_grp.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/mui/NList_mcc.h \ + Debug.h Pointer.h ../include/mcc_common.h ../include/SDI_compiler.h \ + ../include/SDI_hook.h ../include/SDI_lib.h ../include/SDI_stdarg.h \ + ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_grp.h +$(OBJDIR)/NList_img2.o: NList_img2.c +$(OBJDIR)/NList_img.o: NList_img.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/mui/NList_mcc.h \ + Debug.h Pointer.h ../include/mcc_common.h ../include/SDI_compiler.h \ + ../include/SDI_hook.h ../include/SDI_lib.h ../include/SDI_stdarg.h \ + ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_img.h +$(OBJDIR)/NList_mcc0.o: NList_mcc0.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/mui/NList_mcc.h \ + Debug.h Pointer.h ../include/mcc_common.h ../include/SDI_compiler.h \ + ../include/SDI_hook.h ../include/SDI_lib.h ../include/SDI_stdarg.h \ + ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_func.h +$(OBJDIR)/NList_mcc1.o: NList_mcc1.c private.h ../include/libraries/mui.h \ + ../include/mui/NList_mcc.h Debug.h Pointer.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_func.h version.h \ + ../nlistviews_mcp/NListviews_mcp.h ../include/mui/NListview_mcc.h \ + ../nlistview_mcc/NListview_mcc.h +$(OBJDIR)/NList_mcc2.o: NList_mcc2.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/mui/NList_mcc.h \ + Debug.h Pointer.h ../include/mcc_common.h ../include/SDI_compiler.h \ + ../include/SDI_hook.h ../include/SDI_lib.h ../include/SDI_stdarg.h \ + ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_func.h \ + ../nlistviews_mcp/NListviews_mcp.h ../include/mui/NListview_mcc.h +$(OBJDIR)/NList_mcc3.o: NList_mcc3.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/mui/NList_mcc.h \ + Debug.h Pointer.h ../include/mcc_common.h ../include/SDI_compiler.h \ + ../include/SDI_hook.h ../include/SDI_lib.h ../include/SDI_stdarg.h \ + ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_func.h \ + ../nlistviews_mcp/NListviews_mcp.h ../include/mui/NListview_mcc.h +$(OBJDIR)/NList_mcc4.o: NList_mcc4.c private.h ../include/libraries/mui.h \ + ../include/mui/NList_mcc.h Debug.h Pointer.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_func.h +$(OBJDIR)/NList_mcc5.o: NList_mcc5.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/mui/NList_mcc.h \ + Debug.h Pointer.h ../include/mcc_common.h ../include/SDI_compiler.h \ + ../include/SDI_hook.h ../include/SDI_lib.h ../include/SDI_stdarg.h \ + ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_func.h \ + ../nlistview_mcc/NListview_mcc.h +$(OBJDIR)/NList_mcc6.o: NList_mcc6.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/mui/NList_mcc.h \ + Debug.h Pointer.h ../include/mcc_common.h ../include/SDI_compiler.h \ + ../include/SDI_hook.h ../include/SDI_lib.h ../include/SDI_stdarg.h \ + ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_func.h +$(OBJDIR)/NList_mcc.o: NList_mcc.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/mui/NList_mcc.h \ + Debug.h Pointer.h ../include/mcc_common.h ../include/SDI_compiler.h \ + ../include/SDI_hook.h ../include/SDI_lib.h ../include/SDI_stdarg.h \ + ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h NList_func.h NList_grp.h \ + ../nlistviews_mcp/NListviews_mcp.h ../include/mui/NListview_mcc.h +$(OBJDIR)/NList-Test.o: NList-Test.c ../include/libraries/mui.h \ + ../include/proto/muimaster.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/mui/NList_mcc.h \ + Debug.h Pointer.h ../include/mcc_common.h ../include/SDI_compiler.h \ + ../include/SDI_hook.h ../include/SDI_lib.h ../include/SDI_stdarg.h \ + ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h ../include/mui/NListview_mcc.h \ + ../include/mui/NFloattext_mcc.h NList_grp.h ../include/SDI_compiler.h +$(OBJDIR)/Pointer.o: Pointer.c private.h ../include/libraries/mui.h \ + ../include/mui/NList_mcc.h Debug.h Pointer.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h ../include/muiextra.h ../include/amiga-align.h \ + ../include/default-align.h protos.h +$(OBJDIR)/vastubs.o: vastubs.c +# AUTOGENERATED! DO NOT EDIT!!! diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList-Test.c b/workbench/classes/zune/nlist/nlist_mcc/NList-Test.c new file mode 100644 index 0000000000..a65215e902 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList-Test.c @@ -0,0 +1,1116 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2006 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <dos/dos.h> +#include <exec/types.h> +#include <exec/memory.h> +#include <exec/ports.h> +#include <exec/io.h> +#include <libraries/dos.h> +#include <libraries/dosextens.h> +#include <libraries/gadtools.h> +#include <libraries/asl.h> +#include <libraries/mui.h> +#include <workbench/workbench.h> +#include <intuition/intuition.h> +#include <intuition/classusr.h> + +#include <proto/exec.h> +#include <proto/dos.h> +#include <proto/gadtools.h> +#include <proto/asl.h> +#include <proto/muimaster.h> +#include <proto/graphics.h> +#include <proto/intuition.h> +#include <proto/timer.h> +#include <proto/utility.h> + +#if !defined(__amigaos4__) +#include <clib/alib_protos.h> +#endif + +struct Library *MUIMasterBase = NULL; +#if defined(__AROS__) +struct UtilityBase *UtilityBase = NULL; +#else +struct Library *UtilityBase = NULL; +#endif +struct Library *LayersBase = NULL; +struct Device *ConsoleDevice = NULL; +struct Library *DiskfontBase = NULL; + +#if defined(__amigaos4__) +struct Library *IntuitionBase = NULL; +struct Library *GfxBase = NULL; +#else +struct IntuitionBase *IntuitionBase = NULL; +struct GfxBase *GfxBase = NULL; +#endif + +#if defined(__amigaos4__) +struct DiskfontIFace *IDiskfont = NULL; +struct LayersIFace *ILayers = NULL; +struct ConsoleIFace *IConsole = NULL; +struct GraphicsIFace *IGraphics = NULL; +struct IntuitionIFace *IIntuition = NULL; +struct MUIMasterIFace *IMUIMaster = NULL; +struct UtilityIFace *IUtility = NULL; +#endif + +static struct IOStdReq ioreq; + +#if defined(DEBUG) +#include "timeval.h" +static struct TimeRequest timereq; +#if defined(__MORPHOS__) +struct Library *TimerBase = NULL; +#else +struct Device *TimerBase = NULL; +#endif +#if defined(__amigaos4__) +struct TimerIFace *ITimer = NULL; +#endif +#endif // DEBUG + +#include "private.h" + +#include <mui/NListview_mcc.h> +#include <mui/NFloattext_mcc.h> + +#include "NList_grp.h" + +#include "Debug.h" + +#include "SDI_compiler.h" + +DISPATCHERPROTO(_Dispatcher); + +/* *********************************************** */ + + +static APTR APP_Main = NULL, + WIN_Main = NULL, + WIN_2 = NULL, + BM_img, + BM_img2, + BT_TitleOn, + BT_TitleOff, + BT_NoMulti, + BT_Multidef, + BT_Multi, + BT_AllMulti, + BT_InputOn, + BT_InputOff, + BT_Sort, + BT_DragSortOn, + BT_DragSortOff, + BT_SelLine, + BT_SelChar, + BT_OpenWin2, + BT_RemAct, + BT_RemSel, + BT_Clear, + BT_Add, + LV_Text, + LI_Text, + LV_Text2, + LI_Text2, + PR_Horiz, + ST_string, + ST_string2; + +struct MUI_CustomClass *MCC_Main = NULL; + +/* ************ IMG definitions ************** */ + +const ULONG list_colors[24] = +{ +0xadadadad,0xadadadad,0xadadadad, +0x7b7b7b7b,0x7b7b7b7b,0x7b7b7b7b, +0x3b3b3b3b,0x67676767,0xa2a2a2a2, +0xadadadad,0xadadadad,0xadadadad, +0xadadadad,0xadadadad,0xadadadad, +0xadadadad,0xadadadad,0xadadadad, +0xffffffff,0xffffffff,0xffffffff, +0x00000000,0x00000000,0x00000000, +}; + +const UBYTE list_body[168] = { +0x00,0x00,0x44,0x00,0xff,0xff,0xb8,0x00,0xff,0xff,0xb8,0x00,0x00,0x00,0x00, +0x00,0x80,0x00,0x64,0x00,0xff,0xff,0xb8,0x00,0x3b,0xb8,0x46,0x00,0x80,0x00, +0x64,0x00,0xc4,0x47,0xfc,0x00,0x00,0x00,0x46,0x00,0x80,0x00,0x64,0x00,0xff, +0xff,0xfc,0x00,0x36,0xd8,0x46,0x00,0x80,0x00,0x64,0x00,0xc9,0x27,0xfc,0x00, +0x00,0x00,0x46,0x00,0x80,0x00,0x64,0x00,0xff,0xff,0xfc,0x00,0x3d,0xe8,0x6e, +0x00,0x80,0x00,0x5c,0x00,0xc2,0x17,0xcc,0x00,0x00,0x00,0x46,0x00,0x80,0x00, +0x78,0x00,0xff,0xff,0xf8,0x00,0x00,0x00,0x40,0x00,0x80,0x00,0x64,0x00,0xff, +0xff,0xf8,0x00,0xbf,0xff,0xee,0x00,0x7f,0xff,0xdc,0x00,0x3f,0xff,0xcc,0x00, +0x00,0x44,0x46,0x00,0xff,0xbb,0xb8,0x00,0xff,0xbb,0xb8,0x00,0x00,0x00,0x00, +0x00,0x80,0x66,0x64,0x00,0xff,0xbb,0xb8,0x00,0xbf,0xee,0xee,0x00,0x7f,0xdd, +0xdc,0x00,0x3f,0xcc,0xcc,0x00,0x3f,0xee,0xee,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00, }; + +#define LIST_WIDTH 23 +#define LIST_HEIGHT 14 +#define LIST_DEPTH 3 +#define LIST_COMPRESSION 0 +#define LIST_MASKING 2 + +#define IMG \ + BodychunkObject,\ + MUIA_FixWidth , LIST_WIDTH ,\ + MUIA_FixHeight , LIST_HEIGHT,\ + MUIA_Bitmap_Width , LIST_WIDTH ,\ + MUIA_Bitmap_Height , LIST_HEIGHT,\ + MUIA_Bodychunk_Depth , LIST_DEPTH ,\ + MUIA_Bodychunk_Body , (UBYTE *) list_body,\ + MUIA_Bodychunk_Compression, LIST_COMPRESSION,\ + MUIA_Bodychunk_Masking , LIST_MASKING,\ + MUIA_Bitmap_SourceColors , (ULONG *) list_colors,\ + MUIA_Bitmap_Transparent , 0,\ + End + + +/* ************ IMG2 definitions ************** */ + +const ULONG list2_colors[24] = +{ +0xabababab,0xadadadad,0xc5c5c5c5, +0x7b7b7b7b,0x7b7b7b7b,0x7b7b7b7b, +0x3b3b3b3b,0x67676767,0xa2a2a2a2, +0x00000000,0x00000000,0x00000000, +0xffffffff,0xa9a9a9a9,0x97979797, +0xffffffff,0xffffffff,0xffffffff, +0x00000000,0x00000000,0x00000000, +0xadadadad,0xadadadad,0xadadadad, +}; + +const UBYTE list2_body[156] = { +0x04,0x00,0x04,0x00,0x78,0x00,0x08,0x00,0x30,0x00,0x08,0x00,0x79,0x00,0x02, +0x00,0x8e,0x00,0x1c,0x00,0x3e,0x00,0x1c,0x00,0x7e,0x10,0x04,0x00,0x83,0xe0, +0x08,0x00,0xfe,0x80,0x08,0x00,0x45,0x02,0x00,0x00,0x85,0x9c,0x00,0x00,0xff, +0x70,0x00,0x00,0x7e,0x1c,0x80,0x00,0xc1,0x3b,0x78,0x00,0xfe,0xf9,0x30,0x00, +0x00,0x2f,0xb0,0x00,0xff,0x60,0x4c,0x00,0x7e,0xbf,0x48,0x00,0x7c,0x27,0x68, +0x00,0x03,0xc1,0xa4,0x00,0x01,0x7f,0xb4,0x00,0x01,0x1a,0xd8,0x00,0x03,0xe3, +0xa4,0x00,0x01,0xbf,0xac,0x00,0x00,0x6c,0xaa,0x00,0x04,0x99,0xd4,0x00,0x03, +0x97,0xfc,0x00,0x01,0x76,0x5a,0x00,0x38,0x8d,0xec,0x00,0x1e,0x8b,0x7c,0x00, +0x02,0xeb,0x72,0x00,0x0d,0x04,0xfc,0x00,0x09,0x06,0xf8,0x00,0x01,0x84,0x06, +0x00,0x0e,0x02,0xf8,0x00,0x06,0x01,0xb0,0x00,0x00,0x03,0xfc,0x00,0x00,0x00, +0x00,0x00,0x00,0x00,0x00,0x00, }; + +#define LIST2_WIDTH 23 +#define LIST2_HEIGHT 13 +#define LIST2_DEPTH 3 +#define LIST2_COMPRESSION 0 +#define LIST2_MASKING 2 + +#define IMG2 \ + BodychunkObject,\ + MUIA_FixWidth , LIST2_WIDTH ,\ + MUIA_FixHeight , LIST2_HEIGHT,\ + MUIA_Bitmap_Width , LIST2_WIDTH ,\ + MUIA_Bitmap_Height , LIST2_HEIGHT,\ + MUIA_Bodychunk_Depth , LIST2_DEPTH ,\ + MUIA_Bodychunk_Body , (UBYTE *) list2_body,\ + MUIA_Bodychunk_Compression, LIST2_COMPRESSION,\ + MUIA_Bodychunk_Masking , LIST2_MASKING,\ + MUIA_Bitmap_SourceColors , (ULONG *) list2_colors,\ + MUIA_Bitmap_Transparent , 0,\ + End + + +/* *********************************************** */ + +#ifndef MAKE_ID +#define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d)) +#endif + +/* *********************************************** */ + +#define SimpleButtonCycle(name) \ + TextObject, \ + ButtonFrame, \ + MUIA_CycleChain, 1, \ + MUIA_Font, MUIV_Font_Button, \ + MUIA_Text_Contents, name, \ + MUIA_Text_PreParse, "\33c", \ + MUIA_InputMode , MUIV_InputMode_RelVerify, \ + MUIA_Background , MUII_ButtonBack, \ + End + +/* *********************************************** */ + +#define SimpleButtonTiny(name) \ + TextObject, \ + ButtonFrame, \ + MUIA_Font, MUIV_Font_Tiny, \ + MUIA_Text_Contents, name, \ + MUIA_Text_PreParse, "\33c", \ + MUIA_InputMode , MUIV_InputMode_RelVerify, \ + MUIA_Background , MUII_ButtonBack, \ + End + +/* *********************************************** */ + +#define NFloattext(ftxt) \ + NListviewObject, \ + MUIA_Weight, 50, \ + MUIA_CycleChain, 1, \ + MUIA_NListview_Horiz_ScrollBar, MUIV_NListview_HSB_None, \ + MUIA_NListview_Vert_ScrollBar, MUIV_NListview_VSB_Always, \ + MUIA_NListview_NList,NFloattextObject, \ + MUIA_NList_DefaultObjectOnClick, TRUE, \ + MUIA_NFloattext_Text, ftxt, \ + MUIA_NFloattext_TabSize, 4, \ + MUIA_NFloattext_Justify, TRUE, \ + End, \ + End + +/* *********************************************** */ + + +#define ID_LIST2_ACTIVE 1 + +#define NL "\n" +#define NL2 " " + + +/* *********************************************** */ + +const char MainTextString2[] = +{ + "This new list/listview custom class \033bhas its\033n own backgrounds" NL2 + "and pens setables from mui prefs with NListviews.mcp !" NL2 + "It doesn't use the same way to handle multiselection" NL2 + "with mouse and keys than standard List/Listview." NL + "\033C" NL + "You can horizontally scroll with cursor keys," NL2 + "or going on the right and left of the list" NL2 + "while selecting with the mouse." NL2 + "(When there is no immediate draggin stuff active...)" NL2 + "\033iTry just clicking on the left/right borders !\033n" NL + "\033C" NL + "\033r\033uGive some feedback about it ! :-)" NL + "\033r\033bhttp://www.sf.net/projects/nlist-classes/" +}; + +/* *********************************************** */ +const char MainTextString[] = +{ + "\033cNList.mcc \033o[0] NListview.mcc \033o[1] NListviews.mcp" NL + "\033E\033t\033c\033o[2@1]" NL + "\033c\033nThis new list/listview custom class has its own backgrounds" NL + "\033cand pens setables from mui prefs with NListviews.mcp !" NL + "\033E\033t[M7]\033c\033o[3@2]" NL + "" NL + "\033cIt doesn't use the same way to handle multiselection" NL + "\033cwith mouse and keys than standard List/Listview." NL + "" NL + "\033cYou can horizontally scroll with cursor keys," NL + "\033cor going on the right and left of the list" NL + "\033cwhile selecting with the mouse." NL + "\033c(When there is no immediate draggin stuff active...)" NL + "\033c\033iTry just clicking on the left/right borders !\033n" NL + "" NL + "\033r\033uGive some feedback about it ! :-)" NL + "\033r\033bhttp://www.sf.net/projects/nlist-classes/" +}; + +/* *********************************************** */ + +const char *MainTextArray[] = +{ + "\033c\033nThis new list/listview custom class \033bhas its\033n own backgrounds", + "\033cand pens setables from mui prefs with NListviews.mcp !", + " ", + "\033cIt doesn't use the same way to handle multiselection", + "\033cwith mouse and keys than standard List/Listview.", + " ", + "\033cYou can horizontally scroll with cursor keys,", + "\033cor going on the right and left of the list", + "\033cwhile selecting with the mouse.", + "\033c(When there is no draggin stuff active...)", + "\033c\033iTry just clicking on the left/right borders !\033n", + "", + "\033r\033uGive some feedback about it ! :-)", + "\033r\033bhttp://www.sf.net/projects/nlist-classes/" + "", + "", + "", + "You can push column titles as real buttons...", + "", + "You can drag column separator bar in", + "the title to adjust column width...", + "(or in upper half of first entry if title is off)", + "", + "If, while dragging the bar, you press the", + "menu button, the width of the column will", + "come back to its default...", + "", + "You can click on columns title to sort the list contents.", + "You can shift-click (or other qualifier if you modify the", + "default one) to add a secondary sorting column.", + "", + "", + "", + "\033cF2 to copy selected lines to printer", + "\033cF3 to copy all lines to file RAM:tmp.txt", + "", + "\033cF4 to copy selected lines to clipboard 0.", + "\033cF5 to copy active line to clipboard 0.", + "\033cF6 to copy all lines to clipboard 0.", + "", + "\033cThe classic RightAmiga+C to copy selected", + "\033clines to clipboard 0 is made builtin.", + " ", + " ", + "\033cYou can sort the entries by dragging.", + "\033cYou start a drag using one of the qualifier", + "\033ckeys which are set in prefs,", + "\033cor going on the left and right of entries.", + "", + "", + "Example of horizontal line in top of entry", + "\033TExample of horizontal line in top of entry", + "Example of horizontal line in top of entry", + "", + "Examples of horizontal line and thick line centered on entry", + "\033C", + "\033C\033t", + "\033C\033t[I7]", + "\033C\033t[M7]", + "\033C\033t[-5]", + "\033C\033t[N]", + "\033C\033t[NI3]", + "\033C\033t[NM7]", + "\033C\033t[N-5]", + "Examples of horizontal line and thick line centered on entry", + "", + "Example of horizontal line in bottom of entry", + "\033BExample of horizontal line in bottom of entry", + "Example of horizontal line in bottom of entry", + "", + "Examples of horizontal line centered on entry visible on left and rigth only", + "\033c\033EExample of left-right horizontal line", + "\033ESame, but left aligned", + "\033r\033ESame, but right aligned", + "\033t\033c\033ELeft-right horizontal thick line", + "\033t[N]\033c\033ELeft-right horizontal thick line", + "Examples of horizontal line centered on entry visible on left and rigth only", + "", + "", + "\033E\033cExamples of bitmap images :", + "\033c\033o[0] \033o[1]", + "which can be used without subclassing the NList class.", + "", + "\033E\033cExamples of custom object images : ", + "\033o[2;9d51ffff;1] (default width/special 1)", + "\033o[2;9d51ffff;0,24] (24 pixel width/special 0)", + "\033o[2;9d51ffff;1,48] (48 pixel width/special 1)", + "\033o[2;9d51ffff;0,96] (96 pixel width/special 0)", + "", + "\033E\033cExamples of custom object images : ", + "\033o[2;9d51ffff;8,30] (default width/special 8)", + "\033o[2;9d51ffff;6,40] (default width/special 6)", + "\033o[2;9d51ffff;7,40] (40 pixel width/special 7)", + "\033o[2;9d51ffff;4,50] (50 pixel width/special 4)", + "\033o[2;9d51ffff;5,50] (50 pixel width/special 5)", + "\033o[2;9d51ffff;2,30] (30 pixel width/special 2)", + "\033o[2;9d51ffff;3,30] (30 pixel width/special 3)", + "", + "\033E\033cExamples of direct ImageSpec :", + "kmel/kmel_arrowdown.image : \033I[3:kmel/kmel_arrowdown.image]", + "WD/11pt/ArrowLeft.mf0 : \033I[3:WD/11pt/ArrowLeft.mf0]", + "color red: \033I[2:ffffffff,00000000,00000000]", + "color green: \033I[2:00000000,ffffffff,00000000]", + "color blue: \033I[2:00000000,00000000,ffffffff]", + "color yellow: \033I[2:ffffffff,ffffffff,00000000]", + "", + "\033C", + "", + "ww\tTabulation test", + "w\tTabulation test", + "\033cww\tTabulation test", + "\033cw\tTabulation test", + "\033rww\tTabulation test", + "\033rw\tTabulation test", + "", + "", + "long line for FULLAUTO horizontal scroller test, long line for FullAuto horizontal scroller test, long line for FULLAUTO horizontal scroller test.", + "", + "0 just a little \033bline to test\033n stuffs", + "1 just a little \033bline to test\033n stuffs", + "2 just a little \033bline to test\033n stuffs", + "3 just a little \033bline to test\033n stuffs", + "\033c4 just a little \033uline to test\033n (center)", + "\033c5 just a little \033uline to test\033n (center)", + "\033c6 just a little \033uline to test\033n (center)", + "\033r7 just a little \033uline to test\033n (right)", + "\033r8 just a little \033uline to test\033n (right)", + "\033r9 just a little \033uline to test\033n (right)", + "10 just a little line to test stuffs and bugs", + "11 just a little line to test stuffs and bugs", + "12 just a little line to test stuffs and bugs", + "13 just a little line to test stuffs and bugs", + "14 just a little line to test stuffs and bugs", + "15 just a little \033iline to test stuffs\033n and bugs", + "16 just a little line to test stuffs and bugs", + "17 just a little line to test stuffs and bugs", + "18 just a little line to test stuffs and bugs", + "19 just a little line to test stuffs and bugs", + "\033c20 just a little line to test stuffs and bugs (center)", + "\033c21 just a little line to test stuffs and bugs (center)", + "\033c22 just a little line to test stuffs and bugs (center)", + "\033c23 just a little line to test stuffs and bugs (center)", + "24 just a little line to test stuffs and bugs, just a little line", + "25 just a little line to test stuffs and bugs, just a little line", + "\033r26 just a little line to test stuffs and bugs (right)", + "\033r27 just a little line to test stuffs and bugs (right)", + "\033r28 just a little line to test stuffs and bugs (right)", + "\033r29 just a little line to test stuffs and bugs (right)", + "30 just a little line to test stuffs and bugs, just a little line to test", + "31 just a little line to test stuffs and bugs, just a little line to test", + "32 \0332just a little line to test stuffs and bugs, just a little line to test", + "33 \0333just a little line to test stuffs and bugs, just a little line to test", + "34 \0334just a little line to test stuffs and bugs, just a little line to test", + "35 \0335just a little line to test stuffs and bugs, just a little line to test", + "36 \0336just a little line to test stuffs and bugs, just a little line to test", + "37 \0337just a little line to test stuffs and bugs, just a little line to test", + "38 \0338just a little line to test stuffs and bugs, just a little line to test", + "39 \0339just a little line to test stuffs and bugs, just a little line to test", + "40 \033P[]just a little line to test stuffs and bugs, just a little line to test stuffs ", + "41 \033P[1]just a little line to test\033P[] stuffs and bugs, just a little line to test stuffs ", + "42 \033P[2]just a little line to test\033P[] stuffs and bugs, just a little line to test stuffs ", + "43 \033P[-1]just a little line to test\033P[] stuffs and bugs, just a little line to test stuffs ", + "44 \033P[-3]just a little line to test\033P[] stuffs and bugs, just a little line to test stuffs ", + "45 just a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "46 just a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "47 just a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "48 just a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "49 just a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "50 \033ijust a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "51 \033ujust a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "52 \033bjust a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "53 \033i\033ujust a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "54 \033i\033bjust a little line to test stuffs and bugs, just a little line to test stuffs and bugs", + "55 \033b\033ujust a little line to test stuffs and bugs, just a little line to test, just a little line to test, just a little line to test", + "56 \033i\033b\033ujust a little line to test stuffs and bugs, just a little line to test, just a little line to test, just a little line to test", + "57 just a little line to test stuffs and bugs, just a little line to test, just a little line to test, just a little line to test", + "58 just a little line to test stuffs and bugs, just a little line to test, just a little line to test, just a little line to test", + "59 just a little line to test stuffs and bugs, just a little line to test, just a little line to test, just a little line to test", + " ", + " ", + "\033c\033uI find it \033bnice\033n :-)", + NULL +}; + +/* *********************************************** */ + +struct LITD { + LONG num; + char str1[7]; + char *str2; +}; + +/* *********************************************** */ + +HOOKPROTONHNO(ConstructLI_TextFunc, APTR, struct NList_ConstructMessage *ncm) +{ + struct LITD *new_entry = (struct LITD *) AllocVec(sizeof(struct LITD),0); + + if (new_entry) + { + int i = 0, j = 0; + new_entry->num = -1; + new_entry->str2 = (char *) ncm->entry; + while ((j < 6) && new_entry->str2[i]) + { + if ((new_entry->str2[i] > 'A') && (new_entry->str2[i] < 'z')) + new_entry->str1[j++] = new_entry->str2[i]; + if (new_entry->str2[i] == '\033') + i++; + i++; + } + new_entry->str1[j] = '\0'; + + return (new_entry); + } + return (NULL); +} +MakeStaticHook(ConstructLI_TextHook, ConstructLI_TextFunc); + +/* *********************************************** */ + +HOOKPROTONHNO(DestructLI_TextFunc, void, struct NList_DestructMessage *ndm) +{ + if (ndm->entry) + FreeVec((void *) ndm->entry); +} +MakeStaticHook(DestructLI_TextHook, DestructLI_TextFunc); + +/* *********************************************** */ + +static char buf[20]; + +HOOKPROTONHNO(DisplayLI_TextFunc, void, struct NList_DisplayMessage *ndm) +{ + struct LITD *entry = (struct LITD *) ndm->entry; + + if (entry) + { if (entry->num < 0) + entry->num = ndm->entry_pos; + + ndm->preparses[0] = (STRPTR)"\033c"; + ndm->preparses[1] = (STRPTR)"\033c"; + + if (entry->num % 20 == 3) + ndm->strings[0] = (STRPTR)"\033o[0]"; + else if (entry->num % 20 == 13) + ndm->strings[0] = (STRPTR)"\033o[1]"; + else + { + snprintf(buf, sizeof(buf), "%d", (int)entry->num); + ndm->strings[0] = buf; + } + + ndm->strings[1] = (char *) entry->str1; + ndm->strings[2] = (char *) entry->str2; + } + else + { + ndm->preparses[0] = (STRPTR)"\033c"; + ndm->preparses[1] = (STRPTR)"\033c"; + ndm->preparses[2] = (STRPTR)"\033c"; + ndm->strings[0] = (STRPTR)"Num"; + ndm->strings[1] = (STRPTR)"Short"; + ndm->strings[2] = (STRPTR)"This is the list title !\033n\033b :-)"; + } +} +MakeStaticHook(DisplayLI_TextHook, DisplayLI_TextFunc); + +/* *********************************************** */ + +HOOKPROTONHNO(CompareLI_TextFunc, LONG, struct NList_CompareMessage *ncm) +{ + struct LITD *entry1 = (struct LITD *) ncm->entry1; + struct LITD *entry2 = (struct LITD *) ncm->entry2; + LONG col1 = ncm->sort_type & MUIV_NList_TitleMark_ColMask; + LONG col2 = ncm->sort_type2 & MUIV_NList_TitleMark2_ColMask; + LONG result = 0; + +/* + LONG st = ncm->sort_type & MUIV_NList_TitleMark_TypeMask; +kprintf("%lx|Compare() %lx / %lx / %lx\n",obj,ncm->sort_type,st,ncm->sort_type2); +*/ + + if(ncm->sort_type == (LONG)MUIV_NList_SortType_None) + return (0); + + if (col1 == 0) + { if (ncm->sort_type & MUIV_NList_TitleMark_TypeMask) + result = entry2->num - entry1->num; + else + result = entry1->num - entry2->num; + } + else if (col1 == 1) + { if (ncm->sort_type & MUIV_NList_TitleMark_TypeMask) + result = (LONG) stricmp(entry2->str1,entry1->str1); + else + result = (LONG) stricmp(entry1->str1,entry2->str1); + } + else if (col1 == 2) + { if (ncm->sort_type & MUIV_NList_TitleMark_TypeMask) + result = (LONG) stricmp(entry2->str2,entry1->str2); + else + result = (LONG) stricmp(entry1->str2,entry2->str2); + } + + if ((result != 0) || (col1 == col2)) + return (result); + + if (col2 == 0) + { if (ncm->sort_type2 & MUIV_NList_TitleMark2_TypeMask) + result = entry2->num - entry1->num; + else + result = entry1->num - entry2->num; + } + else if (col2 == 1) + { if (ncm->sort_type2 & MUIV_NList_TitleMark2_TypeMask) + result = (LONG) stricmp(entry2->str1,entry1->str1); + else + result = (LONG) stricmp(entry1->str1,entry2->str1); + } + else if (col2 == 2) + { if (ncm->sort_type2 & MUIV_NList_TitleMark2_TypeMask) + result = (LONG) stricmp(entry2->str2,entry1->str2); + else + result = (LONG) stricmp(entry1->str2,entry2->str2); + } + + return (result); +} +MakeStaticHook(CompareLI_TextHook, CompareLI_TextFunc); + +/* *********************************************** */ + +#if defined(__amigaos4__) +#define GETINTERFACE(iface, base) (iface = (APTR)GetInterface((struct Library *)(base), "main", 1L, NULL)) +#define DROPINTERFACE(iface) (DropInterface((struct Interface *)iface), iface = NULL) +#else +#define GETINTERFACE(iface, base) TRUE +#define DROPINTERFACE(iface) +#endif + +/* *********************************************** */ + +static VOID fail(APTR APP_Main,const char *str) +{ + if (APP_Main) + MUI_DisposeObject(APP_Main); + + if(MCC_Main) + MUI_DeleteCustomClass(MCC_Main); + + ShutdownClipboardServer(); + + NGR_Delete(); + + #if defined(DEBUG) + if(TimerBase) + { + DROPINTERFACE(ITimer); + CloseDevice((struct IORequest *)&timereq); + TimerBase = NULL; + } + #endif // DEBUG + + if(ConsoleDevice) + { + DROPINTERFACE(IConsole); + CloseDevice((struct IORequest *)&ioreq); + ConsoleDevice = NULL; + } + + if(MUIMasterBase) + { + DROPINTERFACE(IMUIMaster); + CloseLibrary(MUIMasterBase); + } + + if(IntuitionBase) + { + DROPINTERFACE(IIntuition); + CloseLibrary((struct Library *)IntuitionBase); + } + + if(LayersBase) + { + DROPINTERFACE(ILayers); + CloseLibrary(LayersBase); + } + + if(GfxBase) + { + DROPINTERFACE(IGraphics); + CloseLibrary((struct Library *)GfxBase); + } + + if(UtilityBase) + { + DROPINTERFACE(IUtility); + CloseLibrary((struct Library *)UtilityBase); + } + + if(DiskfontBase) + { + DROPINTERFACE(IDiskfont); + CloseLibrary(DiskfontBase); + } + + + if (str) + { puts(str); + exit(20); + } + exit(0); +} + +static VOID init(VOID) +{ + APP_Main = NULL; + + if((DiskfontBase = OpenLibrary("diskfont.library", 38)) && + GETINTERFACE(IDiskfont, DiskfontBase)) + if((UtilityBase = (APTR)OpenLibrary("utility.library", 36)) && + GETINTERFACE(IUtility, UtilityBase)) + if((GfxBase = (APTR)OpenLibrary("graphics.library", 36)) && + GETINTERFACE(IGraphics, GfxBase)) + if((LayersBase = OpenLibrary("layers.library", 38)) && + GETINTERFACE(ILayers, LayersBase)) + if((IntuitionBase = (APTR)OpenLibrary("intuition.library", 36)) && + GETINTERFACE(IIntuition, IntuitionBase)) + if((MUIMasterBase = OpenLibrary("muimaster.library", 19)) && + GETINTERFACE(IMUIMaster, MUIMasterBase)) + { + ioreq.io_Message.mn_Length = sizeof(ioreq); + if(!OpenDevice("console.device", -1L, (struct IORequest *)&ioreq, 0L)) + { + ConsoleDevice = (APTR)ioreq.io_Device; + + if(GETINTERFACE(IConsole, ConsoleDevice)) + { + #if defined(DEBUG) + timereq.Request.io_Message.mn_Length = sizeof(timereq); + if(OpenDevice("timer.device", 0, (struct IORequest *)&timereq, 0L) == 0) + { + TimerBase = timereq.Request.io_Device; + if(GETINTERFACE(ITimer, TimerBase)) + { + #endif + if(NGR_Create()) + { + if(StartClipboardServer() == TRUE) + { + #if defined(DEBUG) + SetupDebug(); + #endif + + return; + } + } + #if defined(DEBUG) + } + } + #endif // DEBUG + } + } + } + + fail(NULL,"Failed to open libraries"); +} + + +/* *********************************************** */ + + +int main(UNUSED int argc, UNUSED char *argv[]) +{ + LONG win_opened; + LONG result; + + init(); + + MCC_Main = MUI_CreateCustomClass(NULL, "Group.mui", NULL, sizeof(struct NLData), ENTRY(_Dispatcher)); + + APP_Main = ApplicationObject, + MUIA_Application_Title , "NList-Demo", + MUIA_Application_Version , "$VER: NList-Demo 1.0 (" __DATE__ ")", + MUIA_Application_Copyright , "Copyright (C) 2001-2006 by NList Open Source Team", + MUIA_Application_Author , "NList Open Source Team", + MUIA_Application_Description, "NList-Demo", + MUIA_Application_Base , "NList-Demo", + + SubWindow, WIN_Main = WindowObject, + MUIA_Window_Title, "NList-Demo 1996-2006", + MUIA_Window_ID , MAKE_ID('T','W','I','N'), + WindowContents, VGroup, + Child, HGroup, + Child, BT_InputOn = SimpleButtonCycle("InputOn"), + Child, BT_InputOff = SimpleButtonCycle("InputOff"), + Child, BT_SelLine = SimpleButtonCycle("Sel_Line"), + Child, BT_SelChar = SimpleButtonCycle("Sel_Char"), + Child, BT_Clear = SimpleButtonCycle("Clear"), + Child, BT_Add = SimpleButtonCycle("Add"), + End, + Child, HGroup, + Child, BT_NoMulti = SimpleButtonCycle("NoMulti"), + Child, BT_Multidef = SimpleButtonCycle("Def"), + Child, BT_Multi = SimpleButtonCycle("Multi"), + Child, BT_AllMulti = SimpleButtonCycle("AllMulti"), + Child, BM_img = IMG, + Child, BT_RemAct = SimpleButtonCycle("RemAct"), + Child, BT_RemSel = SimpleButtonCycle("RemSel"), + End, + Child, HGroup, + Child, BT_DragSortOn = SimpleButtonCycle("DragSortOn"), + Child, BT_DragSortOff = SimpleButtonCycle("DragSortOff"), + Child, BM_img2 = IMG2, + Child, BT_TitleOn = SimpleButtonCycle("TitleOn"), + Child, BT_TitleOff = SimpleButtonCycle("TitleOff"), + Child, BT_Sort = SimpleButtonCycle("Sort"), + Child, BT_OpenWin2 = SimpleButtonCycle("Win2"), + End, + Child, LV_Text = NListviewObject, + MUIA_CycleChain, 1, + + MUIA_NListview_NList, LI_Text = NewObject(MCC_Main->mcc_Class, NULL, + MUIA_ObjectID, MAKE_ID('N','L','0','1'), + MUIA_NList_DefaultObjectOnClick, TRUE, + MUIA_NList_ActiveObjectOnClick, TRUE, + MUIA_NList_MultiSelect, MUIV_NList_MultiSelect_None, + MUIA_NList_DisplayHook2, &DisplayLI_TextHook, + MUIA_NList_CompareHook2, &CompareLI_TextHook, + MUIA_NList_ConstructHook2, &ConstructLI_TextHook, + MUIA_NList_DestructHook2, &DestructLI_TextHook, + MUIA_NList_Format, "BAR W=-1,BAR W=-1 PCS=L,BAR PCS=C", + MUIA_NList_SourceArray, MainTextArray, + MUIA_NList_AutoVisible, TRUE, + //MUIA_NList_AutoClip, FALSE, + MUIA_NList_TitleSeparator, TRUE, + MUIA_NList_Title, TRUE, + MUIA_NList_EntryValueDependent, TRUE, + MUIA_NList_MinColSortable, 0, + MUIA_NList_Imports, MUIV_NList_Imports_All, + MUIA_NList_Exports, MUIV_NList_Exports_All, + End, + MUIA_ShortHelp, "The nice multicolumn\ndraggable list\nwith char selection\npossibility :)", + End, + Child, ST_string2 = StringObject, + StringFrame, + End, + End, + End, + SubWindow, WIN_2 = WindowObject, + MUIA_Window_Title, "NList-Demo 1996-2006 Win 2", + MUIA_Window_ID , MAKE_ID('W','I','N','2'), + MUIA_Window_UseBottomBorderScroller, TRUE, + WindowContents, VGroup, + Child, NFloattext(MainTextString2), + Child, BalanceObject, End, + Child, VGroup, + MUIA_Group_VertSpacing, 1, + Child, LV_Text2 = NListviewObject, + MUIA_CycleChain, 1, + MUIA_NListview_Horiz_ScrollBar, MUIV_NListview_HSB_None, + MUIA_NListview_NList, LI_Text2 = NewObject(MCC_Main->mcc_Class, NULL, + MUIA_NList_DefaultObjectOnClick, TRUE, + MUIA_NList_ConstructHook, MUIV_NList_ConstructHook_String, + MUIA_NList_DestructHook, MUIV_NList_DestructHook_String, + MUIA_NList_SourceString, MainTextString, + End, + MUIA_ShortHelp, "The 2nd list", + End, + Child, ST_string = StringObject, + MUIA_CycleChain, 1, + StringFrame, + End, + Child, PR_Horiz = ScrollbarObject, + MUIA_Group_Horiz, TRUE, + MUIA_Prop_UseWinBorder,MUIV_Prop_UseWinBorder_Bottom, + End, + End, + End, + End, + End; + + if(!APP_Main) fail(APP_Main,"Failed to create Application."); + + + /* ********** MAIN LIST NOTIFIES ********** */ + + DoMethod(LI_Text, MUIM_Notify, MUIA_NList_TitleClick,MUIV_EveryTime, + LI_Text, 4, MUIM_NList_Sort3, MUIV_TriggerValue, MUIV_NList_SortTypeAdd_2Values, MUIV_NList_Sort3_SortType_Both); + DoMethod(LI_Text, MUIM_Notify, MUIA_NList_TitleClick2,MUIV_EveryTime, + LI_Text, 4, MUIM_NList_Sort3, MUIV_TriggerValue, MUIV_NList_SortTypeAdd_2Values, MUIV_NList_Sort3_SortType_2); + DoMethod(LI_Text, MUIM_Notify, MUIA_NList_SortType,MUIV_EveryTime, + LI_Text, 3, MUIM_Set,MUIA_NList_TitleMark,MUIV_TriggerValue); + DoMethod(LI_Text, MUIM_Notify, MUIA_NList_SortType2,MUIV_EveryTime, + LI_Text, 3, MUIM_Set,MUIA_NList_TitleMark2,MUIV_TriggerValue); + + + /* ********** MAIN LIST IMAGES ********** */ + + DoMethod(LI_Text,MUIM_NList_UseImage,BM_img,0,0); + DoMethod(LI_Text,MUIM_NList_UseImage,BM_img2,1,0); + +// DoMethod(LI_Text,MUIM_NList_UseImage,NImageObject,2,~0L); + + + /* ********** BUTTONS NOTIFIES ********** */ + + DoMethod(BT_TitleOn, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_Title,"\033cThis is that list title ! :-)"); + DoMethod(BT_TitleOff, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_Title,NULL); + DoMethod(BT_NoMulti, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_MultiSelect,MUIV_NList_MultiSelect_None); + DoMethod(BT_Multidef, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_MultiSelect,MUIV_NList_MultiSelect_Default); + DoMethod(BT_Multi, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_MultiSelect,MUIV_NList_MultiSelect_Shifted); + DoMethod(BT_AllMulti, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_MultiSelect,MUIV_NList_MultiSelect_Always); + DoMethod(BT_InputOn, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_Input,TRUE); + DoMethod(BT_InputOff, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_Input,FALSE); + DoMethod(BT_DragSortOn, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_DragSortable,TRUE); + DoMethod(BT_DragSortOff, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_DragSortable,FALSE); + DoMethod(BT_RemAct, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 2, MUIM_NList_Remove,MUIV_NList_Remove_Active); + DoMethod(BT_RemSel, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 2, MUIM_NList_Remove,MUIV_NList_Remove_Selected); + DoMethod(BT_Clear, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 1, MUIM_NList_Clear); + DoMethod(BT_Add, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 4, MUIM_NList_Insert,MainTextArray,15,MUIV_NList_Insert_Bottom); + DoMethod(BT_Sort, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 1, MUIM_NList_Sort); + DoMethod(BT_SelLine, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_TypeSelect,MUIV_NList_TypeSelect_Line); + DoMethod(BT_SelChar, MUIM_Notify, MUIA_Pressed,FALSE, + LI_Text, 3, MUIM_Set,MUIA_NList_TypeSelect,MUIV_NList_TypeSelect_Char); + DoMethod(BT_OpenWin2, MUIM_Notify, MUIA_Pressed,FALSE, + WIN_2, 3, MUIM_Set,MUIA_Window_Open,TRUE); + + + /* ********** WINDOW1 KEYS NOTIFIES ********** */ + + DoMethod(WIN_Main,MUIM_Notify, MUIA_Window_InputEvent, "f2", + LI_Text, 4,MUIM_NList_CopyTo,MUIV_NList_CopyTo_Selected,"PRT:",&result,NULL); + DoMethod(WIN_Main,MUIM_Notify, MUIA_Window_InputEvent, "f3", + LI_Text, 4,MUIM_NList_CopyTo,MUIV_NList_CopyTo_All,"RAM:tmp.txt",&result,NULL); + DoMethod(WIN_Main,MUIM_Notify, MUIA_Window_InputEvent, "f4", + LI_Text, 4,MUIM_NList_CopyToClip,MUIV_NList_CopyToClip_Selected,0L,NULL,NULL); + DoMethod(WIN_Main,MUIM_Notify, MUIA_Window_InputEvent, "f5", + LI_Text, 4,MUIM_NList_CopyToClip,MUIV_NList_CopyToClip_Active,0L,NULL,NULL); + DoMethod(WIN_Main,MUIM_Notify, MUIA_Window_InputEvent, "f6", + LI_Text, 4,MUIM_NList_CopyToClip,MUIV_NList_CopyToClip_All,0L,NULL,NULL); + + + /* ********** WINDOW2 LIST NOTIFIES ********** */ + + DoMethod(LI_Text2,MUIM_Notify,MUIA_NList_ButtonClick, 1, + APP_Main, 6, MUIM_Application_PushMethod, + WIN_2, 3, MUIM_Set,MUIA_Window_Open,FALSE); + + DoMethod(LI_Text2,MUIM_Notify,MUIA_NList_ButtonClick, 2, + LI_Text, 1, MUIM_NList_Clear); + + + DoMethod(LI_Text2, MUIM_Notify, MUIA_NList_Horiz_Entries,MUIV_EveryTime, + PR_Horiz, 3, MUIM_NoNotifySet,MUIA_Prop_Entries,MUIV_TriggerValue); + DoMethod(LI_Text2, MUIM_Notify, MUIA_NList_Horiz_Visible,MUIV_EveryTime, + PR_Horiz, 3, MUIM_NoNotifySet,MUIA_Prop_Visible,MUIV_TriggerValue); + DoMethod(LI_Text2, MUIM_Notify, MUIA_NList_Horiz_First,MUIV_EveryTime, + PR_Horiz, 3, MUIM_NoNotifySet,MUIA_Prop_First,MUIV_TriggerValue); + DoMethod(PR_Horiz, MUIM_Notify, MUIA_Prop_First,MUIV_EveryTime, + LI_Text2, 3, MUIM_NoNotifySet,MUIA_NList_Horiz_First,MUIV_TriggerValue); + DoMethod(LI_Text2, MUIM_Notify, MUIA_NList_HorizDeltaFactor,MUIV_EveryTime, + PR_Horiz, 3, MUIM_NoNotifySet,MUIA_Prop_DeltaFactor,MUIV_TriggerValue); + + set(ST_string, MUIA_String_AttachedList, LI_Text2); + DoMethod(LI_Text2,MUIM_Notify,MUIA_NList_SelectChange,TRUE,APP_Main,2,MUIM_Application_ReturnID,ID_LIST2_ACTIVE); + DoMethod(LI_Text2,MUIM_Notify,MUIA_NList_Active,MUIV_EveryTime,APP_Main,2,MUIM_Application_ReturnID,ID_LIST2_ACTIVE); + set(LI_Text2, MUIA_NList_Active, 2); + + + /* ********** WINDOW2 LIST IMAGES ********** */ + + DoMethod(LI_Text2,MUIM_NList_UseImage,BM_img,0,0); + DoMethod(LI_Text2,MUIM_NList_UseImage,BM_img2,1,0); + + DoMethod(LI_Text2,MUIM_NList_UseImage,SimpleButtonTiny("Click me to close"),2,~0L); + DoMethod(LI_Text2,MUIM_NList_UseImage,SimpleButtonTiny("Clear main list"),3,~0L); + + + /* ********** WINDOW2 NOTIFIES ********** */ + + DoMethod(WIN_Main,MUIM_Notify,MUIA_Window_CloseRequest,TRUE, + APP_Main, 5, MUIM_Application_PushMethod, + APP_Main,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit); + + DoMethod(WIN_2,MUIM_Notify,MUIA_Window_CloseRequest,TRUE, + APP_Main, 6, MUIM_Application_PushMethod, + WIN_2, 3, MUIM_Set,MUIA_Window_Open,FALSE); + + set(WIN_Main, MUIA_Window_DefaultObject, LI_Text); + set(WIN_Main, MUIA_Window_ActiveObject, LI_Text); + set(WIN_2, MUIA_Window_ActiveObject, ST_string); + set(WIN_2, MUIA_Window_DefaultObject, LV_Text2); + + //set(LI_Text, MUIA_NList_KeyRightFocus, ST_string2); + + /* ************************************** */ + + DoMethod(APP_Main,MUIM_Application_Load,MUIV_Application_Load_ENVARC); + + /* *** If need to be sorted, sort then restore the active and first *** */ + /* *** which were set in the Application_Load *** */ + { + ULONG active,first,sorttype; + get(LI_Text,MUIA_NList_SortType,&sorttype); + if (sorttype != MUIV_NList_SortType_None) + { get(LI_Text,MUIA_NList_Active,&active); + get(LI_Text,MUIA_NList_First,&first); + DoMethod(LI_Text, MUIM_NList_Sort); + set(LI_Text,MUIA_NList_Active,active); + set(LI_Text,MUIA_NList_First,first); + } + } + + set(WIN_2,MUIA_Window_Open,TRUE); + set(WIN_Main,MUIA_Window_Open,TRUE); + + get(WIN_Main,MUIA_Window_Open,&win_opened); + if (win_opened) + { + LONG id; + ULONG sigs = 0; + char *line; + + while ((id = DoMethod(APP_Main,MUIM_Application_NewInput,&sigs)) != (LONG)MUIV_Application_ReturnID_Quit) + { + if (id == ID_LIST2_ACTIVE) + { DoMethod(LI_Text2, MUIM_NList_GetEntry, MUIV_NList_GetEntry_Active, &line); + set(ST_string, MUIA_String_Contents, line); + set(WIN_2, MUIA_Window_ActiveObject, ST_string); + } + if (sigs) + { sigs = Wait(sigs | SIGBREAKF_CTRL_C); + if (sigs & SIGBREAKF_CTRL_C) break; + } + } + } + else + printf("failed to open main window !\n"); + + DoMethod(APP_Main,MUIM_Application_Save,MUIV_Application_Save_ENVARC); + + set(WIN_2,MUIA_Window_Open,FALSE); + set(WIN_Main,MUIA_Window_Open,FALSE); + + DoMethod(LI_Text,MUIM_NList_UseImage,NULL,-1,0); + DoMethod(LI_Text2,MUIM_NList_UseImage,NULL,-1,0); + + fail(APP_Main,NULL); + + return 0; +} + diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList.bh b/workbench/classes/zune/nlist/nlist_mcc/NList.bh new file mode 100644 index 0000000000..105ae7ff1c --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList.bh @@ -0,0 +1,304 @@ +#ifdef USE_NLIST_COLORS +const ULONG NList_colors[768] = +{ + 0xadadadad,0xadadadad,0xadadadad, + 0x00000000,0x00000000,0x00000000, + 0xf0f0f0f0,0xf0f0f0f0,0xf0f0f0f0, + 0x4d4d4d4d,0x88888888,0xc2c2c2c2, + 0x99999999,0x99999999,0x99999999, + 0xbbbbbbbb,0xbbbbbbbb,0xbbbbbbbb, + 0xbbbbbbbb,0xaaaaaaaa,0x99999999, + 0xf0f0f0f0,0xbbbbbbbb,0xaaaaaaaa, + 0x00000000,0x00000000,0xffffffff, + 0xeeeeeeee,0x55555555,0x00000000, + 0x99999999,0xffffffff,0x11111111, + 0xeeeeeeee,0xbbbbbbbb,0x00000000, + 0x55555555,0x55555555,0xffffffff, + 0x99999999,0x22222222,0xffffffff, + 0x00000000,0xffffffff,0x88888888, + 0xcccccccc,0xcccccccc,0xcccccccc, + 0x00000000,0x00000000,0x00000000, + 0xd7d7d7d7,0x34343434,0x28282828, + 0x20202020,0x20202020,0x20202020, + 0x20202020,0x20202020,0x20202020, + 0x44444444,0x44444444,0x44444444, + 0x55555555,0x55555555,0x55555555, + 0x66666666,0x66666666,0x66666666, + 0x77777777,0x77777777,0x77777777, + 0x88888888,0x88888888,0x88888888, + 0x99999999,0x99999999,0x99999999, + 0xaaaaaaaa,0xaaaaaaaa,0xaaaaaaaa, + 0xbbbbbbbb,0xbbbbbbbb,0xbbbbbbbb, + 0xcccccccc,0xcccccccc,0xcccccccc, + 0xdddddddd,0xdddddddd,0xdddddddd, + 0xeeeeeeee,0xeeeeeeee,0xeeeeeeee, + 0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff, + 0x88888888,0x88888888,0x88888888, + 0xffffffff,0xffffffff,0xffffffff, + 0xcccccccc,0xcccccccc,0xcccccccc, + 0x44444444,0x44444444,0x44444444, + 0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff, + 0x88888888,0xffffffff,0xffffffff, + 0x44444444,0x88888888,0x88888888, + 0xcccccccc,0xffffffff,0xffffffff, + 0x66666666,0xcccccccc,0xcccccccc, + 0x22222222,0x44444444,0x44444444, + 0xaaaaaaaa,0xffffffff,0xffffffff, + 0xeeeeeeee,0xffffffff,0xffffffff, + 0xcccccccc,0xffffffff,0xffffffff, + 0x66666666,0x88888888,0x88888888, + 0xffffffff,0xffffffff,0xffffffff, + 0x99999999,0xcccccccc,0xcccccccc, + 0x33333333,0x44444444,0x44444444, + 0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff, + 0x44444444,0xffffffff,0xffffffff, + 0x22222222,0x88888888,0x88888888, + 0x66666666,0xffffffff,0xffffffff, + 0x33333333,0xcccccccc,0xcccccccc, + 0x11111111,0x44444444,0x44444444, + 0x55555555,0xffffffff,0xffffffff, + 0x77777777,0xffffffff,0xffffffff, + 0xffffffff,0x88888888,0xffffffff, + 0x88888888,0x44444444,0x88888888, + 0xffffffff,0xcccccccc,0xffffffff, + 0xcccccccc,0x66666666,0xcccccccc, + 0x44444444,0x22222222,0x44444444, + 0xffffffff,0xaaaaaaaa,0xffffffff, + 0xffffffff,0xeeeeeeee,0xffffffff, + 0x88888888,0x88888888,0xffffffff, + 0x44444444,0x44444444,0x88888888, + 0xcccccccc,0xcccccccc,0xffffffff, + 0x66666666,0x66666666,0xcccccccc, + 0x22222222,0x22222222,0x44444444, + 0xaaaaaaaa,0xaaaaaaaa,0xffffffff, + 0xeeeeeeee,0xeeeeeeee,0xffffffff, + 0xcccccccc,0x88888888,0xffffffff, + 0x66666666,0x44444444,0x88888888, + 0xffffffff,0xcccccccc,0xffffffff, + 0x99999999,0x66666666,0xcccccccc, + 0x33333333,0x22222222,0x44444444, + 0xffffffff,0xaaaaaaaa,0xffffffff, + 0xffffffff,0xeeeeeeee,0xffffffff, + 0x44444444,0x88888888,0xffffffff, + 0x22222222,0x44444444,0x88888888, + 0x66666666,0xcccccccc,0xffffffff, + 0x33333333,0x66666666,0xcccccccc, + 0x11111111,0x22222222,0x44444444, + 0x55555555,0xaaaaaaaa,0xffffffff, + 0x77777777,0xeeeeeeee,0xffffffff, + 0xffffffff,0xcccccccc,0xffffffff, + 0x88888888,0x66666666,0x88888888, + 0xffffffff,0xffffffff,0xffffffff, + 0xcccccccc,0x99999999,0xcccccccc, + 0x44444444,0x33333333,0x44444444, + 0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff, + 0x88888888,0xcccccccc,0xffffffff, + 0x44444444,0x66666666,0x88888888, + 0xcccccccc,0xffffffff,0xffffffff, + 0x66666666,0x99999999,0xcccccccc, + 0x22222222,0x33333333,0x44444444, + 0xaaaaaaaa,0xffffffff,0xffffffff, + 0xeeeeeeee,0xffffffff,0xffffffff, + 0xcccccccc,0xcccccccc,0xffffffff, + 0x66666666,0x66666666,0x88888888, + 0xffffffff,0xffffffff,0xffffffff, + 0x99999999,0x99999999,0xcccccccc, + 0x33333333,0x33333333,0x44444444, + 0xffffffff,0xffffffff,0xffffffff, + 0xffffffff,0xffffffff,0xffffffff, + 0x44444444,0xcccccccc,0xffffffff, + 0x22222222,0x66666666,0x88888888, + 0x66666666,0xffffffff,0xffffffff, + 0x33333333,0x99999999,0xcccccccc, + 0x11111111,0x33333333,0x44444444, + 0x55555555,0xffffffff,0xffffffff, + 0x77777777,0xffffffff,0xffffffff, + 0xffffffff,0x44444444,0xffffffff, + 0x88888888,0x22222222,0x88888888, + 0xffffffff,0x66666666,0xffffffff, + 0xcccccccc,0x33333333,0xcccccccc, + 0x44444444,0x11111111,0x44444444, + 0xffffffff,0x55555555,0xffffffff, + 0xffffffff,0x77777777,0xffffffff, + 0x88888888,0x44444444,0xffffffff, + 0x44444444,0x22222222,0x88888888, + 0xcccccccc,0x66666666,0xffffffff, + 0x66666666,0x33333333,0xcccccccc, + 0x22222222,0x11111111,0x44444444, + 0xaaaaaaaa,0x55555555,0xffffffff, + 0xeeeeeeee,0x77777777,0xffffffff, + 0xcccccccc,0x44444444,0xffffffff, + 0x66666666,0x22222222,0x88888888, + 0xffffffff,0x66666666,0xffffffff, + 0x99999999,0x33333333,0xcccccccc, + 0x33333333,0x11111111,0x44444444, + 0xffffffff,0x55555555,0xffffffff, + 0xffffffff,0x77777777,0xffffffff, + 0x44444444,0x44444444,0xffffffff, + 0x22222222,0x22222222,0x88888888, + 0x66666666,0x66666666,0xffffffff, + 0x33333333,0x33333333,0xcccccccc, + 0x11111111,0x11111111,0x44444444, + 0x55555555,0x55555555,0xffffffff, + 0x77777777,0x77777777,0xffffffff, + 0xffffffff,0xffffffff,0x88888888, + 0x88888888,0x88888888,0x44444444, + 0xffffffff,0xffffffff,0xcccccccc, + 0xcccccccc,0xcccccccc,0x66666666, + 0x44444444,0x44444444,0x22222222, + 0xffffffff,0xffffffff,0xaaaaaaaa, + 0xffffffff,0xffffffff,0xeeeeeeee, + 0x88888888,0xffffffff,0x88888888, + 0x44444444,0x88888888,0x44444444, + 0xcccccccc,0xffffffff,0xcccccccc, + 0x66666666,0xcccccccc,0x66666666, + 0x22222222,0x44444444,0x22222222, + 0xaaaaaaaa,0xffffffff,0xaaaaaaaa, + 0xeeeeeeee,0xffffffff,0xeeeeeeee, + 0xcccccccc,0xffffffff,0x88888888, + 0x66666666,0x88888888,0x44444444, + 0xffffffff,0xffffffff,0xcccccccc, + 0x99999999,0xcccccccc,0x66666666, + 0x33333333,0x44444444,0x22222222, + 0xffffffff,0xffffffff,0xaaaaaaaa, + 0xffffffff,0xffffffff,0xeeeeeeee, + 0x44444444,0xffffffff,0x88888888, + 0x22222222,0x88888888,0x44444444, + 0x66666666,0xffffffff,0xcccccccc, + 0x33333333,0xcccccccc,0x66666666, + 0x11111111,0x44444444,0x22222222, + 0x55555555,0xffffffff,0xaaaaaaaa, + 0x77777777,0xffffffff,0xeeeeeeee, + 0xffffffff,0x88888888,0x88888888, + 0x88888888,0x44444444,0x44444444, + 0xffffffff,0xcccccccc,0xcccccccc, + 0xcccccccc,0x66666666,0x66666666, + 0x44444444,0x22222222,0x22222222, + 0xffffffff,0xaaaaaaaa,0xaaaaaaaa, + 0xffffffff,0xeeeeeeee,0xeeeeeeee, + 0x88888888,0x88888888,0x88888888, + 0x44444444,0x44444444,0x44444444, + 0xcccccccc,0xcccccccc,0xcccccccc, + 0x66666666,0x66666666,0x66666666, + 0x22222222,0x22222222,0x22222222, + 0xaaaaaaaa,0xaaaaaaaa,0xaaaaaaaa, + 0xeeeeeeee,0xeeeeeeee,0xeeeeeeee, + 0xcccccccc,0x88888888,0x88888888, + 0x66666666,0x44444444,0x44444444, + 0xffffffff,0xcccccccc,0xcccccccc, + 0x99999999,0x66666666,0x66666666, + 0x33333333,0x22222222,0x22222222, + 0xffffffff,0xaaaaaaaa,0xaaaaaaaa, + 0xffffffff,0xeeeeeeee,0xeeeeeeee, + 0x44444444,0x88888888,0x88888888, + 0x22222222,0x44444444,0x44444444, + 0x66666666,0xcccccccc,0xcccccccc, + 0x33333333,0x66666666,0x66666666, + 0x11111111,0x22222222,0x22222222, + 0x55555555,0xaaaaaaaa,0xaaaaaaaa, + 0x77777777,0xeeeeeeee,0xeeeeeeee, + 0xffffffff,0xcccccccc,0x88888888, + 0x88888888,0x66666666,0x44444444, + 0xffffffff,0xffffffff,0xcccccccc, + 0xcccccccc,0x99999999,0x66666666, + 0x44444444,0x33333333,0x22222222, + 0xffffffff,0xffffffff,0xaaaaaaaa, + 0xffffffff,0xffffffff,0xeeeeeeee, + 0x88888888,0xcccccccc,0x88888888, + 0x44444444,0x66666666,0x44444444, + 0xcccccccc,0xffffffff,0xcccccccc, + 0x66666666,0x99999999,0x66666666, + 0x22222222,0x33333333,0x22222222, + 0xaaaaaaaa,0xffffffff,0xaaaaaaaa, + 0xeeeeeeee,0xffffffff,0xeeeeeeee, + 0xcccccccc,0xcccccccc,0x88888888, + 0x66666666,0x66666666,0x44444444, + 0xffffffff,0xffffffff,0xcccccccc, + 0x99999999,0x99999999,0x66666666, + 0x33333333,0x33333333,0x22222222, + 0xffffffff,0xffffffff,0xaaaaaaaa, + 0xffffffff,0xffffffff,0xeeeeeeee, + 0x44444444,0xcccccccc,0x88888888, + 0x22222222,0x66666666,0x44444444, + 0x66666666,0xffffffff,0xcccccccc, + 0x33333333,0x99999999,0x66666666, + 0x11111111,0x33333333,0x22222222, + 0x55555555,0xffffffff,0xaaaaaaaa, + 0x77777777,0xffffffff,0xeeeeeeee, + 0xffffffff,0x44444444,0x88888888, + 0x88888888,0x22222222,0x44444444, + 0xffffffff,0x66666666,0xcccccccc, + 0x8b8b8b8b,0x95959595,0x9f9f9f9f, + 0xb1b1b1b1,0xdbdbdbdb,0x67676767, + 0x00000000,0xf0f0f0f0,0xf0f0f0f0, + 0xffffffff,0xffffffff,0xffffffff, + 0x3b3b3b3b,0x67676767,0xa2a2a2a2, + 0x95959595,0x95959595,0x95959595, + 0x00000000,0xffffffff,0x00000000, + 0xa0a0a0a0,0xa0a0a0a0,0xa0a0a0a0, + 0x86868686,0x86868686,0x86868686, + 0x6b6b6b6b,0x6b6b6b6b,0x6b6b6b6b, + 0x50505050,0x50505050,0x50505050, + 0x35353535,0x35353535,0x35353535, + 0x1a1a1a1a,0x1a1a1a1a,0x1a1a1a1a, + 0xffffffff,0xa9a9a9a9,0x97979797, + 0xaaaaaaaa,0x90909090,0x7c7c7c7c, + 0x7b7b7b7b,0x7b7b7b7b,0x7b7b7b7b, + 0xc9c9c9c9,0x7c7c7c7c,0x86868686, + 0xbbbbbbbb,0xb0b0b0b0,0xbbbbbbbb, + 0x99999999,0x90909090,0x99999999, + 0x66666666,0x88888888,0xbbbbbbbb, + 0xaaaaaaaa,0xa0a0a0a0,0xaaaaaaaa, + 0x99999999,0x99999999,0x99999999, + 0xbbbbbbbb,0xbbbbbbbb,0xbbbbbbbb, + 0xbbbbbbbb,0xaaaaaaaa,0x99999999, + 0xf0f0f0f0,0xbbbbbbbb,0xaaaaaaaa, +}; +#endif + +#define NLIST_WIDTH 23 +#define NLIST_HEIGHT 13 +#define NLIST_DEPTH 8 +#define NLIST_COMPRESSION 0 +#define NLIST_MASKING 2 + +#ifdef USE_NLIST_HEADER +const struct BitMapHeader NList_header = +{ 23,13,0,0,8,2,0,0,0,22,22,711,512 }; +#endif + +#ifdef USE_NLIST_BODY +const UBYTE NList_body[416] = { +0x78,0x00,0x00,0x00,0x4c,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x48,0x00,0x00, +0x00,0x04,0x00,0x00,0x00,0x4c,0x00,0x00,0x00,0x4c,0x00,0x00,0x00,0x4c,0x00, +0x00,0x00,0x86,0x00,0x00,0x00,0xf1,0x00,0x00,0x00,0x41,0x00,0x00,0x00,0xb0, +0x00,0x00,0x00,0x41,0x00,0x00,0x00,0xf1,0x00,0x00,0x00,0xf1,0x00,0x00,0x00, +0xf1,0x00,0x00,0x00,0x81,0xe0,0x00,0x00,0x7d,0x70,0x00,0x00,0x00,0x10,0x00, +0x00,0x7d,0x60,0x00,0x00,0x00,0x10,0x00,0x00,0x7d,0x70,0x00,0x00,0x7d,0x70, +0x00,0x00,0x7d,0x70,0x00,0x00,0x84,0x9c,0x00,0x00,0x40,0x8e,0x00,0x00,0x3e, +0x62,0x00,0x00,0x40,0x8c,0x00,0x00,0x3e,0x62,0x00,0x00,0x7e,0xee,0x00,0x00, +0x7e,0xee,0x00,0x00,0x7e,0xee,0x00,0x00,0x81,0x23,0x78,0x00,0x3f,0x06,0xc8, +0x00,0x00,0xc4,0x80,0x00,0x3f,0x02,0x48,0x00,0x00,0xc4,0x80,0x00,0x3f,0xc6, +0xc8,0x00,0x3f,0xc6,0xc8,0x00,0x3f,0xc6,0xc8,0x00,0xff,0x40,0x4c,0x00,0x81, +0x4f,0xbc,0x00,0x00,0x90,0xb0,0x00,0x81,0x4f,0x0c,0x00,0x00,0x90,0xb0,0x00, +0x81,0xdf,0xbc,0x00,0x81,0xdf,0xbc,0x00,0x81,0xdf,0xbc,0x00,0x03,0xc0,0x84, +0x00,0x7e,0xa6,0x40,0x00,0x7c,0x18,0x50,0x00,0x02,0xa6,0x00,0x00,0x7c,0x18, +0x50,0x00,0x7e,0xbe,0x50,0x00,0x7e,0xbe,0x50,0x00,0x7e,0xbe,0x50,0x00,0x02, +0xe3,0x24,0x00,0x02,0x58,0x58,0x00,0x00,0x06,0x50,0x00,0x02,0x58,0x08,0x00, +0x00,0x06,0x50,0x00,0x02,0x5e,0x58,0x00,0x02,0x5e,0x58,0x00,0x02,0x5e,0x58, +0x00,0x04,0x91,0x54,0x00,0x04,0x64,0x2a,0x00,0x03,0x62,0x02,0x00,0x04,0x04, +0x28,0x00,0x03,0x62,0x02,0x00,0x07,0x66,0x2a,0x00,0x07,0x66,0x2a,0x00,0x07, +0x66,0x2a,0x00,0x38,0x89,0xa4,0x00,0x21,0x72,0x92,0x00,0x07,0x70,0x02,0x00, +0x20,0x02,0x90,0x00,0x07,0x70,0x02,0x00,0x27,0x72,0x92,0x00,0x27,0x72,0x92, +0x00,0x27,0x72,0x92,0x00,0x05,0x04,0x8c,0x00,0x0e,0xeb,0x06,0x00,0x0a,0xe9, +0x02,0x00,0x04,0x02,0x04,0x00,0x0a,0xe9,0x02,0x00,0x0e,0xeb,0x06,0x00,0x0e, +0xeb,0x06,0x00,0x0e,0xeb,0x06,0x00,0x0e,0x02,0xf8,0x00,0x09,0x86,0x4e,0x00, +0x01,0x85,0x06,0x00,0x08,0x02,0x48,0x00,0x01,0x85,0x06,0x00,0x09,0x87,0x4e, +0x00,0x09,0x87,0x4e,0x00,0x09,0x87,0x4e,0x00,0x00,0x00,0x00,0x00,0x00,0x03, +0xfc,0x00,0x00,0x03,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xfc,0x00,0x00, +0x03,0xfc,0x00,0x00,0x03,0xfc,0x00,0x00,0x03,0xfc,0x00, }; +#endif diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_func.c b/workbench/classes/zune/nlist/nlist_mcc/NList_func.c new file mode 100644 index 0000000000..346327349b --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_func.c @@ -0,0 +1,2194 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <clib/alib_protos.h> +#include <proto/intuition.h> + +#include "private.h" + +#include "NList_func.h" + +// static functions in this file +static BOOL NL_List_Jump(struct NLData *data, LONG pos); +static BOOL NL_List_GetPos(struct NLData *data, APTR entry, LONG *pos); + +/* Extent the selection between ent1 and ent2. + Make the first_change and last_change optimal for redrawing optimiztion */ +void NL_SegChanged(struct NLData *data,LONG ent1,LONG ent2) +{ +// D(bug("ent1=%ld ent2=%ld\n",ent1,ent2)); +// D(bug("first_change=%ld last_change=%ld\n",data->first_change,data->last_change)); + if (ent1 < data->first_change) + { if (ent1 >= data->NList_First) + { data->first_change = ent1; + if (data->last_change < data->first_change) + data->last_change = data->first_change; + } + else if (ent2 >= data->NList_First) + { data->first_change = data->NList_First; + if (data->last_change < data->first_change) + data->last_change = data->first_change; + } + } + if (ent2 > data->last_change) + { if (ent2 < data->NList_First+data->NList_Visible) + { data->last_change = ent2; + if (data->first_change > data->last_change) + data->first_change = data->last_change; + } + else if (ent1 < data->NList_First+data->NList_Visible) + { data->last_change = data->NList_First+data->NList_Visible; + if (data->first_change > data->last_change) + data->first_change = data->last_change; + } + } +// D(bug("NL_SegChanged: first_change=%ld last_change=%ld\n",data->first_change,data->last_change)); +} + +/* Extent the selection by this entry optimal */ +void NL_Changed(struct NLData *data,LONG ent) +{ +// D(bug("ent=%ld\n",ent)); +// D(bug("first_change=%ld last_change=%ld\n",data->first_change,data->last_change)); + if ((ent < data->first_change) && (ent >= data->NList_First)) + { data->first_change = ent; + if (data->last_change < data->first_change) + data->last_change = data->first_change; + } + if ((ent > data->last_change) && (ent < data->NList_First+data->NList_Visible)) + { data->last_change = ent; + if (data->first_change > data->last_change) + data->first_change = data->last_change; + } +// D(bug("first_change=%ld last_change=%ld\n",data->first_change,data->last_change)); +} + + +void NL_UnSelectAll(struct NLData *data,LONG untouch_ent) +{ + LONG ent; + + DONE_NOTIFY(NTF_Select | NTF_LV_Select); + ent = 0; + while (ent < data->NList_Entries) + { if (ent != untouch_ent) + { SELECT2_CHGE(ent,TE_Select_None); + data->lastselected = MUIV_NList_Active_Off; + data->lastactived = MUIV_NList_Active_Off; + } + ent++; + } + REDRAW; +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ +} + + +void UnSelectCharSel(struct NLData *data,BOOL redraw) +{ + if (data->NList_TypeSelect && !data->UpdatingScrollbars) + { + if ((data->sel_pt[data->min_sel].ent >= 0) && (data->sel_pt[data->max_sel].ent >= 0)) + NL_SegChanged(data,data->sel_pt[data->min_sel].ent,data->sel_pt[data->max_sel].ent); + + data->sel_pt[1].ent = -1; + data->min_sel = 1; + data->max_sel = 1; + if (redraw) + REDRAW; + } +} + + +void SelectFirstPoint(struct NLData *data,WORD x,WORD y) +{ + struct MUI_NList_TestPos_Result res; + LONG e1 = data->sel_pt[data->min_sel].ent; + LONG e1x = data->sel_pt[data->min_sel].xoffset; + LONG e2 = data->sel_pt[data->max_sel].ent; + LONG e2x = data->sel_pt[data->max_sel].xoffset; + res.char_number = 0; + data->last_sel_click_x = x; + data->last_sel_click_y = y; + NL_List_TestPos(data,x,y,&res); + if ((res.column < 0) || (res.column >= data->numcols)) + return; + if ((e1 >= 0) && (e2 >= 0)) + { if ((e2 > e1) && (e2x == PMIN)) + NL_SegChanged(data,e1,e2-1); + else + NL_SegChanged(data,e1,e2); + } + if ((data->NList_TypeSelect == MUIV_NList_TypeSelect_CLine) && (res.entry >= 0)) + { + data->sel_pt[2].column = 0; + data->sel_pt[2].xoffset = PMIN; + data->sel_pt[2].colpos = -1; + data->sel_pt[2].ent = res.entry; + data->sel_pt[3] = data->sel_pt[2]; + data->sel_pt[3].ent = res.entry+1; + data->sel_pt[0] = data->sel_pt[2]; + data->sel_pt[1] = data->sel_pt[3]; + data->min_sel = 0; + data->max_sel = 1; + NL_Changed(data,res.entry); + data->minx_change_entry = res.entry; + data->minx_change_offset = PMIN; + data->maxx_change_entry = res.entry+1; + data->maxx_change_offset = PMIN; + REDRAW; + } +/* + * else if ((data->NList_TypeSelect == MUIV_NList_TypeSelect_CWord) && (res.entry >= 0)) + * { + * data->sel_pt[0].column = res.column; + * data->sel_pt[0].xoffset = res.xoffset; + * data->sel_pt[0].colpos = res.char_number; + * data->sel_pt[0].ent = res.entry; + * data->sel_pt[1] = data->sel_pt[0]; + * data->min_sel = 0; + * data->max_sel = 1; + * if (res.char_number == -1) + * { if (res.char_xoffset < 0) + * { if (res.column == 0) + * { data->sel_pt[0].xoffset = PMIN; + * data->sel_pt[1].xoffset += data->cols[res.column].c->minx - res.char_xoffset; + * data->sel_pt[1].colpos = 0; + * } + * else + * { data->sel_pt[0].xoffset = data->cols[res.column].c->minx; + * data->sel_pt[1].xoffset += data->cols[res.column].c->minx - res.char_xoffset; + * data->sel_pt[1].colpos = 0; + * } + * } + * else if (res.char_xoffset >= 0) + * { if (res.column == data->numcols-1) + * { data->sel_pt[0].xoffset += data->cols[res.column].c->minx - res.char_xoffset; + * data->sel_pt[0].colpos = -2; + * data->sel_pt[1].column = 0; + * data->sel_pt[1].xoffset = PMIN; + * data->sel_pt[1].colpos = -1; + * data->sel_pt[1].ent++; + * } + * else + * { data->sel_pt[0].xoffset += data->cols[res.column].c->minx - res.char_xoffset; + * data->sel_pt[0].colpos = -2; + * data->sel_pt[1].xoffset = data->cols[res.column].c->maxx; + * data->sel_pt[1].colpos = -2; + * } + * } + * } + * else + * { + * data->sel_pt[0].xoffset += data->cols[res.column].c->minx - res.char_xoffset; + * data->sel_pt[1].xoffset = data->sel_pt[0].xoffset + data->hinc; + * if (res.char_xoffset < 0) + * data->sel_pt[0].colpos++; + * data->sel_pt[1].colpos = data->sel_pt[0].colpos + 1; + * } + * data->sel_pt[2] = data->sel_pt[0]; + * data->sel_pt[3] = data->sel_pt[1]; + * + * NL_Changed(data,res.entry); + * data->minx_change_entry = data->sel_pt[0].ent; + * data->minx_change_offset = data->sel_pt[0].xoffset; + * data->maxx_change_entry = data->sel_pt[1].ent; + * data->maxx_change_offset = data->sel_pt[1].xoffset; + * REDRAW; + * } + */ + else + { if (res.char_number == -1) + { if (res.char_xoffset < 0) + { if (res.column == 0) + res.xoffset = PMIN; + else + res.xoffset = data->cols[res.column].c->minx; + } + else if (res.char_xoffset >= 0) + { if (res.column == data->numcols-1) + { res.xoffset = PMAX; /* when on full right, go full left of next line */ + /* + // The last releases had these lines while the one above had been commented out. + // The problem with these 4 lines is, that the beginning of then next line will + // be copied as well if the line is marked until the very right position, which + // is definitely wrong (see bugs #1190788 and #1720456). I hope this fix does + // not have any other negative side effects. + res.column=0; + res.xoffset = PMIN; + res.char_xoffset = PMIN; + res.entry++; + */ + } + else + res.xoffset = data->cols[res.column].c->maxx; + res.char_number = -2; + } + } + else + { res.xoffset += data->cols[res.column].c->minx - res.char_xoffset; + if (res.char_xoffset < 0) + res.char_number++; + } + data->sel_pt[0].column = res.column; + data->sel_pt[0].xoffset = res.xoffset; + data->sel_pt[0].colpos = res.char_number; + data->sel_pt[0].ent = res.entry; + data->sel_pt[1].ent = -1; + data->min_sel = 1; + data->max_sel = 1; + if ((e1 >= 0) && (e2 >= 0)) + { data->minx_change_entry = e1; + data->minx_change_offset = e1x; + data->maxx_change_entry = e2; + data->maxx_change_offset = e2x; + } + REDRAW; + } +} + + +void SelectSecondPoint(struct NLData *data,WORD x,WORD y) +{ + struct MUI_NList_TestPos_Result res; + LONG e1 = data->sel_pt[1].ent; + LONG e1x = data->sel_pt[1].xoffset; + LONG e2,e2x,e3,e3x; + data->last_sel_click_x = x; + data->last_sel_click_y = y; + res.char_number = 0; + NL_List_TestPos(data,x,y,&res); + if ((res.column < 0) || (res.column >= data->numcols)) + return; + if ((data->NList_TypeSelect == MUIV_NList_TypeSelect_CLine) && (res.entry >= 0)) + { data->sel_pt[1].column = 0; + data->sel_pt[1].xoffset = PMIN; + data->sel_pt[1].colpos = -1; + data->min_sel = 0; + data->max_sel = 1; + if (res.entry > data->sel_pt[2].ent) + { e3 = 2; + data->sel_pt[1].ent = res.entry+1; + } + else if (res.entry < data->sel_pt[2].ent) + { e3 = 3; + data->sel_pt[1].ent = res.entry; + data->min_sel = 1; + data->max_sel = 0; + } + else + { e3 = 2; + data->sel_pt[1] = data->sel_pt[3]; + } + data->sel_pt[0] = data->sel_pt[e3]; + e2 = data->sel_pt[1].ent; + if (e1 != e2) + { if (e1 > e2) { e3 = e1; e1 = e2; e2 = e3; } + data->minx_change_entry = e1; + data->minx_change_offset = PMIN; + data->maxx_change_entry = e2; + data->maxx_change_offset = PMIN; + if (e2 > e1) + e2--; + NL_SegChanged(data,e1,e2); + REDRAW; + } + } +/* + * else if ((data->NList_TypeSelect == MUIV_NList_TypeSelect_CWord) && (res.entry >= 0)) + * { + * LONG e0 = data->sel_pt[0].ent; + * LONG e0x = data->sel_pt[0].xoffset; + * data->sel_pt[0].column = res.column; + * data->sel_pt[0].xoffset = res.xoffset; + * data->sel_pt[0].colpos = res.char_number; + * data->sel_pt[0].ent = res.entry; + * data->sel_pt[1] = data->sel_pt[0]; + * data->min_sel = 0; + * data->max_sel = 1; + * if (res.char_number == -1) + * { if (res.char_xoffset < 0) + * { if (res.column == 0) + * { data->sel_pt[0].xoffset = PMIN; + * data->sel_pt[1].xoffset += data->cols[res.column].c->minx - res.char_xoffset; + * data->sel_pt[1].colpos = 0; + * } + * else + * { data->sel_pt[0].xoffset = data->cols[res.column].c->minx; + * data->sel_pt[1].xoffset += data->cols[res.column].c->minx - res.char_xoffset; + * data->sel_pt[1].colpos = 0; + * } + * } + * else if (res.char_xoffset >= 0) + * { if (res.column == data->numcols-1) + * { data->sel_pt[0].xoffset += data->cols[res.column].c->minx - res.char_xoffset; + * data->sel_pt[0].colpos = -2; + * data->sel_pt[1].column = 0; + * data->sel_pt[1].xoffset = PMIN; + * data->sel_pt[1].colpos = -1; + * data->sel_pt[1].ent++; + * } + * else + * { data->sel_pt[0].xoffset += data->cols[res.column].c->minx - res.char_xoffset; + * data->sel_pt[0].colpos = -2; + * data->sel_pt[1].xoffset = data->cols[res.column].c->maxx; + * data->sel_pt[1].colpos = -2; + * } + * } + * } + * else + * { + * data->sel_pt[0].xoffset += data->cols[res.column].c->minx - res.char_xoffset; + * data->sel_pt[1].xoffset = data->sel_pt[0].xoffset + data->hinc; + * if (res.char_xoffset < 0) + * data->sel_pt[0].colpos++; + * data->sel_pt[1].colpos = data->sel_pt[0].colpos + 1; + * } + * + * if ( (data->sel_pt[0].ent > data->sel_pt[2].ent) || + * ( (data->sel_pt[0].ent == data->sel_pt[2].ent) && + * ( (data->sel_pt[0].column > data->sel_pt[2].column) || + * ( (data->sel_pt[0].column == data->sel_pt[2].column) && + * (data->sel_pt[0].xoffset > data->sel_pt[2].xoffset) + * ) + * ) + * ) + * ) + * { data->sel_pt[0] = data->sel_pt[2]; + * if ((e1 < data->sel_pt[1].ent) || (e1x < data->sel_pt[1].xoffset)) + * { data->minx_change_entry = e1; + * data->minx_change_offset = e1x; + * data->maxx_change_entry = data->sel_pt[1].ent; + * data->maxx_change_offset = data->sel_pt[1].xoffset; + * NL_SegChanged(data,e1,data->sel_pt[1].ent); + * } + * else + * { data->minx_change_entry = data->sel_pt[1].ent; + * data->minx_change_offset = data->sel_pt[1].xoffset; + * data->maxx_change_entry = e1; + * data->maxx_change_offset = e1x; + * NL_SegChanged(data,data->sel_pt[1].ent,e1); + * } + * } + * else if ( (data->sel_pt[1].ent < data->sel_pt[3].ent) || + * ( (data->sel_pt[1].ent == data->sel_pt[3].ent) && + * ( (data->sel_pt[1].column < data->sel_pt[3].column) || + * ( (data->sel_pt[1].column == data->sel_pt[3].column) && + * (data->sel_pt[1].xoffset < data->sel_pt[3].xoffset) + * ) + * ) + * ) + * ) + * { data->sel_pt[1] = data->sel_pt[3]; + * if ((e0 < data->sel_pt[0].ent) || (e0x < data->sel_pt[0].xoffset)) + * { data->minx_change_entry = e0; + * data->minx_change_offset = e0x; + * data->maxx_change_entry = data->sel_pt[0].ent; + * data->maxx_change_offset = data->sel_pt[0].xoffset; + * NL_SegChanged(data,e0,data->sel_pt[0].ent); + * } + * else + * { data->minx_change_entry = data->sel_pt[0].ent; + * data->minx_change_offset = data->sel_pt[0].xoffset; + * data->maxx_change_entry = e0; + * data->maxx_change_offset = e0x; + * NL_SegChanged(data,data->sel_pt[0].ent,e0); + * } + * } + * REDRAW; + * } + */ + else if (res.entry >= 0) + { + if (res.char_number == -1) + { if (res.char_xoffset < 0) + { if (res.column == 0) + res.xoffset = PMIN; + else + res.xoffset = data->cols[res.column].c->minx; + } + else if (res.char_xoffset >= 0) + { + if (res.column == data->numcols-1) + { + res.xoffset = PMAX; /* when on full right, go full left of next line */ + /* + // before this part was active while the assignment above was inactive + // see bugs #1190788 and #1720456 + res.column=0; + res.xoffset = PMIN; + res.char_xoffset = PMIN; + res.entry++; + */ + } + else + res.xoffset = data->cols[res.column].c->maxx; + res.char_number = -2; + } + } + else + { + res.xoffset += data->cols[res.column].c->minx - res.char_xoffset; + if (res.char_xoffset < 0) + res.char_number++; + } + if ((data->sel_pt[1].ent != res.entry) || (data->sel_pt[1].column != res.column) || (data->sel_pt[1].xoffset != res.xoffset)) + { + data->sel_pt[1].column = res.column; + data->sel_pt[1].xoffset = res.xoffset; + data->sel_pt[1].colpos = res.char_number; + data->sel_pt[1].ent = res.entry; + data->min_sel = 0; + data->max_sel = 1; + if ( (data->sel_pt[0].ent > data->sel_pt[1].ent) || + ( (data->sel_pt[0].ent == data->sel_pt[1].ent) && + ( (data->sel_pt[0].column > data->sel_pt[1].column) || + ( (data->sel_pt[0].column == data->sel_pt[1].column) && + (data->sel_pt[0].xoffset > data->sel_pt[1].xoffset) + ) + ) + ) + ) + { data->min_sel = 1; + data->max_sel = 0; + } + else if ((data->sel_pt[0].ent == data->sel_pt[1].ent) && + (data->sel_pt[0].column == data->sel_pt[1].column) && + (data->sel_pt[0].xoffset == data->sel_pt[1].xoffset)) + { data->min_sel = 1; + data->max_sel = 1; + data->sel_pt[1].ent = -1; + } + + e2 = data->sel_pt[1].ent; + e2x = data->sel_pt[1].xoffset; + if (e1 < 0) + { e1 = data->sel_pt[0].ent; + e1x = data->sel_pt[0].xoffset; + } + else if (e2 < 0) + { e2 = data->sel_pt[0].ent; + e2x = data->sel_pt[0].xoffset; + } + if ((e2 < e1) || ((e2 == e1) && (e2x < e1x))) + { e3 = e2; e2 = e1; e1 = e3; e3x = e2x; e2x = e1x; e1x = e3x; } + if ((e1 >= 0) && (e2 >= 0)) + { NL_SegChanged(data,e1,e2); + data->minx_change_entry = e1; + data->minx_change_offset = e1x; + data->maxx_change_entry = e2; + data->maxx_change_offset = e2x; + } + REDRAW; + } + } +} + + +BOOL NL_List_First(struct NLData *data,LONG lf,struct TagItem *tag) +{ + struct TagItem ltag; + BOOL scrolled = FALSE; + + ENTER(); + + if (!tag) + tag = <ag; + + if((data->NList_Entries > 0) && (lf != data->NList_First)) + { + switch (lf) + { + case MUIV_NList_First_Top: + lf = 0; + break; + + case MUIV_NList_First_Bottom: + { + lf = data->NList_Entries - data->NList_Visible; + if (lf < 0) + lf = 0; + } + break; + + case MUIV_NList_First_Up: + { + lf = data->NList_First - 1; + if (lf < 0) + lf = 0; + } + break; + + case MUIV_NList_First_Down: + { + lf = data->NList_First + 1; + if (lf + data->NList_Visible >= data->NList_Entries) + lf = data->NList_Entries - data->NList_Visible; + if (lf < 0) + lf = 0; + } + break; + + case MUIV_NList_First_PageUp: + { + lf = data->NList_First - data->NList_Visible + 1; + if (lf < 0) + lf = 0; + } + break; + + case MUIV_NList_First_PageDown: + { + lf = data->NList_First + data->NList_Visible - 1; + if (lf + data->NList_Visible >= data->NList_Entries) + lf = data->NList_Entries - data->NList_Visible; + if (lf < 0) + lf = 0; + } + break; + + case MUIV_NList_First_Up2: + { + lf = data->NList_First - 2; + if (lf < 0) + lf = 0; + } + break; + + case MUIV_NList_First_Down2: + { + lf = data->NList_First + 2; + if (lf + data->NList_Visible >= data->NList_Entries) + lf = data->NList_Entries - data->NList_Visible; + if (lf < 0) + lf = 0; + } + break; + + case MUIV_NList_First_Up4: + { + lf = data->NList_First - 4; + if (lf < 0) + lf = 0; + } + break; + + case MUIV_NList_First_Down4 : + { + lf = data->NList_First + 4; + if (lf + data->NList_Visible >= data->NList_Entries) + lf = data->NList_Entries - data->NList_Visible; + if (lf < 0) + lf = 0; + } + break; + } + + if ((lf >= 0) && (lf < data->NList_Entries)) + { + if (data->NList_First != lf) + { + DO_NOTIFY(NTF_First); + scrolled = TRUE; + } + + data->NList_First = lf; + REDRAW; +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + tag->ti_Data = lf; + } + else + tag->ti_Tag = TAG_IGNORE; + } + else + tag->ti_Tag = TAG_IGNORE; + + RETURN(scrolled); + return scrolled; +} + + +BOOL NL_List_Active(struct NLData *data, LONG la, struct TagItem *tag, LONG newactsel, LONG acceptsame, ULONG flags) +{ + struct TagItem ltag; + struct TagItem *tag2 = tag; + LONG ent; + BOOL changed = FALSE; + + ENTER(); + + //D(DBF_STARTUP, "NL_List_Active: 0x%lx la=%ld newactsel=%ld acceptsame=%ld data->pad1=%ld",obj,la,newactsel,acceptsame,data->pad1); + + if (data->NList_TypeSelect || !data->NList_Input) + { + if (tag2) + tag->ti_Data = MUIV_NList_Active_Off; + + if((la == MUIV_NList_Active_Off) || (data->NList_Entries <= 0)) + { + data->pad1 = MUIV_NList_Active_Off; + + RETURN(TRUE); + return TRUE; + } + else if (la < 0) + { + if(tag2 == NULL) + { + changed = NL_List_First(data,la,tag); + + RETURN(changed); + return changed; + } + else if (data->NList_Entries > 0) + { + switch (la) + { + case MUIV_NList_Active_Top : + case MUIV_NList_Active_UntilTop : + la = 0; + break; + case MUIV_NList_Active_Bottom : + case MUIV_NList_Active_UntilBottom : + la = data->pad1 - 1; + break; + case MUIV_NList_Active_Up : + if (data->NList_Active != MUIV_NList_Active_Off) + la = data->pad1 - 1; + else + la = data->NList_First - 1 + data->NList_Visible; + break; + case MUIV_NList_Active_Down : + if (data->pad1 != MUIV_NList_Active_Off) + la = data->pad1 + 1; + else + la = data->NList_First; + break; + case MUIV_NList_Active_PageUp : + case MUIV_NList_Active_UntilPageUp : + if (data->pad1 == data->NList_First) + la = data->pad1 + 1 - data->NList_Visible; + else + la = data->NList_First; + break; + case MUIV_NList_Active_PageDown : + case MUIV_NList_Active_UntilPageDown : + if (data->pad1 == data->NList_First - 1 + data->NList_Visible) + la = data->pad1 - 1 + data->NList_Visible; + else + la = data->NList_First - 1 + data->NList_Visible; + break; + } + } + } + + if (la < 0) + la = 0; + else if (la >= data->NList_Entries) + la = data->NList_Entries - 1; + + data->pad1 = la; + + // if the SetActive_Jump_Center flag is active we make sure + // the new active entry will be centered + if(isFlagSet(flags, MUIV_NList_SetActive_Jump_Center)) + la = MUIV_NList_Jump_Active_Center; + + // make sure the entry is visible + if(NL_List_Jump(data, la) == TRUE) + { + DO_NOTIFY(NTF_First); + REDRAW; + + changed = TRUE; + } + + RETURN(changed); + return changed; + } + + if (!tag) + tag = <ag; + + if(data->NList_Entries > 0) + { + ent = -2; + + switch (la) + { + case MUIV_NList_Active_Top : + la = 0; + break; + case MUIV_NList_Active_Bottom : + la = data->NList_Entries - 1; + break; + case MUIV_NList_Active_Up : + if (data->NList_Active != MUIV_NList_Active_Off) + la = data->NList_Active - 1; + else + la = data->NList_First - 1 + data->NList_Visible; + if (la < 0) + la = 0; + if (la >= data->NList_Entries) + la = data->NList_Entries - 1; + break; + case MUIV_NList_Active_Down : + if (data->NList_Active != MUIV_NList_Active_Off) + la = data->NList_Active + 1; + else + la = data->NList_First; + if (la >= data->NList_Entries) + la = data->NList_Entries - 1; + break; + case MUIV_NList_Active_PageUp : + if (data->NList_Active == data->NList_First) + la = data->NList_Active + 1 - data->NList_Visible; + else + la = data->NList_First; + if (la < 0) + la = 0; + break; + case MUIV_NList_Active_PageDown : + if (data->NList_Active == data->NList_First - 1 + data->NList_Visible) + la = data->NList_Active - 1 + data->NList_Visible; + else + la = data->NList_First - 1 + data->NList_Visible; + if (la >= data->NList_Entries) + la = data->NList_Entries - 1; + break; + case MUIV_NList_Active_UntilPageUp : + if (data->NList_Active == data->NList_First) + la = data->NList_Active + 1 - data->NList_Visible; + else + la = data->NList_First; + if (la < 0) + la = 0; + ent = data->NList_Active; + break; + case MUIV_NList_Active_UntilPageDown : + if (data->NList_Active == data->NList_First - 1 + data->NList_Visible) + la = data->NList_Active - 1 + data->NList_Visible; + else + la = data->NList_First - 1 + data->NList_Visible; + if (la >= data->NList_Entries) + la = data->NList_Entries - 1; + ent = data->NList_Active; + break; + case MUIV_NList_Active_UntilTop : + la = 0; + ent = data->NList_Active; + break; + case MUIV_NList_Active_UntilBottom : + la = data->NList_Entries - 1; + ent = data->NList_Active; + break; + case MUIV_NList_Active_Off : + la = MUIV_NList_Active_Off; + break; + } + + if ((la != data->NList_Active) || (acceptsame && + !((newactsel == MUIV_NList_Select_On) && (la >= 0) && (la < data->NList_Entries) && + (data->EntriesArray[la]->Select != TE_Select_None)))) + { + if ((la >= 0) && (la < data->NList_Entries)) + { + if ((data->NList_MultiSelect == MUIV_NList_MultiSelect_None) && (la != data->NList_Active)) + { + DO_NOTIFY(NTF_Select | NTF_LV_Select); + + if ((data->NList_Active >= 0) && (data->NList_Active < data->NList_Entries)) + SELECT2(data->NList_Active,TE_Select_None); + } + + if ((data->NList_MultiSelect != MUIV_NList_MultiSelect_None) && (newactsel == MUIV_NList_Select_List)) + { + DO_NOTIFY(NTF_Select | NTF_LV_Select); + if((data->NList_Active >= 0) && (data->NList_Active < data->NList_Entries)) + { + if (data->EntriesArray[data->NList_Active]->Select != TE_Select_None) + SELECT2(data->NList_Active,TE_Select_None); + else + SELECT(data->NList_Active,TE_Select_Line); + + data->lastselected = data->NList_Active; + data->lastactived = data->NList_Active; + } + } + + if((ent < -1) || (data->multiselect == MUIV_NList_MultiSelect_None)) + ent = la; + + if (ent < 0) + ent = 0; + else if (ent >= data->NList_Entries) + ent = data->NList_Entries - 1; + + set_Active(la); + changed = TRUE; + + if (ent < la) + NL_SegChanged(data,ent,la-1); + else if (ent > la) + NL_SegChanged(data,la+1,ent); + + do + { + if (ent < la) + ent++; + else if (ent > la) + ent--; + switch (newactsel) + { case MUIV_NList_Select_Off : + SELECT2(ent,TE_Select_None); + data->lastselected = ent; + data->lastactived = ent; + break; + case MUIV_NList_Select_On : + SELECT(ent,TE_Select_Line); + data->lastselected = ent; + data->lastactived = ent; + break; + case MUIV_NList_Select_Toggle : + if (data->EntriesArray[ent]->Select != TE_Select_None) + { SELECT2(ent,TE_Select_None); + } + else + { SELECT(ent,TE_Select_Line); + } + data->lastselected = ent; + data->lastactived = ent; + break; + + case MUIV_NList_Select_List : + if (data->NList_MultiSelect != MUIV_NList_MultiSelect_None) + { ent = la; + if (data->EntriesArray[ent]->Select != TE_Select_None) + { SELECT2(ent,TE_Select_None); + } + else + { SELECT(ent,TE_Select_Line); + } + data->lastselected = ent; + data->lastactived = ent; + break; + } + + default: + if (data->NList_MultiSelect == MUIV_NList_MultiSelect_None) + { SELECT(ent,TE_Select_Line); + data->lastselected = ent; + data->lastactived = ent; + } + break; + } + } while (ent != la); + + tag->ti_Data = la; + data->do_draw_active = TRUE; + + // if the SetActive_Jump_Center flag is active we make sure + // the new active entry will be centered + if(isFlagSet(flags, MUIV_NList_SetActive_Jump_Center)) + la = MUIV_NList_Jump_Active_Center; + + // make sure the entry is visible + if(NL_List_Jump(data, la) == TRUE) + { + DO_NOTIFY(NTF_First); + } + + // redraw at all means + REDRAW; + } + else if (la == MUIV_NList_Active_Off) + { + if ((data->NList_MultiSelect == MUIV_NList_MultiSelect_None) && (la != data->NList_Active)) + { + DO_NOTIFY(NTF_Select | NTF_LV_Select); + if ((data->NList_Active >= 0) && (data->NList_Active < data->NList_Entries)) + SELECT2(data->NList_Active,TE_Select_None); + } + + set_Active(MUIV_NList_Active_Off); + tag->ti_Data = MUIV_NList_Active_Off; + REDRAW; + + changed = TRUE; + } + else + tag->ti_Tag = TAG_IGNORE; + } + else + tag->ti_Tag = TAG_IGNORE; + } + else + { + set_Active(MUIV_NList_Active_Off); + tag->ti_Data = MUIV_NList_Active_Off; + if (la >= 0) + tag->ti_Tag = TAG_IGNORE; + } +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + + RETURN(changed); + return changed; +} + + +BOOL NL_List_Horiz_First(struct NLData *data,LONG hf,struct TagItem *tag) +{ + BOOL scrolled = FALSE; + + ENTER(); + + if(data->NList_Horiz_First != hf) + { + struct TagItem ltag; + BOOL tagnul = FALSE; + + if(!tag) + { + tag = <ag; + tagnul = TRUE; + } + + switch (hf) + { + case MUIV_NList_Horiz_First_Start : + hf = 0; + break; + + case MUIV_NList_Horiz_First_End : + { + hf = data->NList_Horiz_Entries - data->NList_Horiz_Visible; + if(hf < 0) + hf = 0; + } + break; + + case MUIV_NList_Horiz_First_Left : + { + hf = data->NList_Horiz_First - _font(data->this)->tf_XSize; + if (hf < 0) + hf = 0; + } + break; + + case MUIV_NList_Horiz_First_Right : + { + hf = data->NList_Horiz_First + _font(data->this)->tf_XSize; + if(hf > data->NList_Horiz_Entries - data->NList_Horiz_Visible) + hf = data->NList_Horiz_Entries - data->NList_Horiz_Visible; + } + break; + + case MUIV_NList_Horiz_First_PageLeft : + { + hf = data->NList_Horiz_First - data->NList_Horiz_Visible / 2; + if (hf < 0) + hf = 0; + } + break; + + case MUIV_NList_Horiz_First_PageRight : + { + hf = data->NList_Horiz_First + data->NList_Horiz_Visible / 2; + if (hf > data->NList_Horiz_Entries - data->NList_Horiz_Visible) + hf = data->NList_Horiz_Entries - data->NList_Horiz_Visible; + } + break; + + case MUIV_NList_Horiz_First_Left2 : + { + hf = data->NList_Horiz_First - _font(data->this)->tf_XSize*2; + if (hf < 0) + hf = 0; + } + break; + + case MUIV_NList_Horiz_First_Right2 : + { + hf = data->NList_Horiz_First + _font(data->this)->tf_XSize*2; + if (hf > data->NList_Horiz_Entries - data->NList_Horiz_Visible) + hf = data->NList_Horiz_Entries - data->NList_Horiz_Visible; + } + break; + + case MUIV_NList_Horiz_First_Left4 : + { + hf = data->NList_Horiz_First - _font(data->this)->tf_XSize*4; + if (hf < 0) + hf = 0; + } + break; + + case MUIV_NList_Horiz_First_Right4 : + { + hf = data->NList_Horiz_First + _font(data->this)->tf_XSize*4; + if (hf > data->NList_Horiz_Entries - data->NList_Horiz_Visible) + hf = data->NList_Horiz_Entries - data->NList_Horiz_Visible; + } + break; + } + + if(data->NList_Horiz_First != hf) + { + if((hf >= 0) && (hf < data->NList_Horiz_Entries)) + { + if(hf > data->NList_Horiz_Entries - data->NList_Horiz_Visible) + hf = data->NList_Horiz_Entries - data->NList_Horiz_Visible; + + data->NList_Horiz_First = hf; + REDRAW; + + tag->ti_Data = hf; + if (tagnul /*&& data->Notify_HSB*/) + notdoset(data->this,MUIA_NList_Horiz_First,hf); + + scrolled = TRUE; + } + else + tag->ti_Tag = TAG_IGNORE; + } + else + tag->ti_Tag = TAG_IGNORE; + } + + RETURN(scrolled); + return scrolled; +} + + +ULONG NL_List_SelectChar(struct NLData *data,LONG pos,LONG seltype,LONG *state) +{ + LONG ent,ent2; + + if (seltype == MUIV_NList_Select_None) + return (TRUE); + + if (data->NList_TypeSelect) + { + if (seltype == MUIV_NList_Select_Ask) + { LONG first = data->sel_pt[data->min_sel].ent; + LONG last = data->sel_pt[data->max_sel].ent; + if ((data->sel_pt[data->max_sel].column == 0) && (data->sel_pt[data->max_sel].xoffset == PMIN)) + last--; + if (state) + *state = (LONG) (last - first + 1); + } + else if (seltype == MUIV_NList_Select_Off) + UnSelectCharSel(data,TRUE); + else if ((seltype == MUIV_NList_Select_On) && (data->NList_Entries > 0)) + { + UnSelectCharSel(data,FALSE); + if (pos == MUIV_NList_Select_All) + { ent = 0; + ent2 = data->NList_Entries; + } + else + { if (pos == MUIV_NList_Select_Active) + ent = data->NList_Active; + else + ent = pos; + if (ent < 0) + ent = 0; + else if (ent >= data->NList_Entries) + ent = data->NList_Entries - 1; + ent2 = ent + 1; + } + data->sel_pt[0].column = 0; + data->sel_pt[0].xoffset = PMIN; + data->sel_pt[0].colpos = -1; + data->sel_pt[0].ent = ent; + data->sel_pt[1].column = 0; + data->sel_pt[1].xoffset = PMIN; + data->sel_pt[1].colpos = -1; + data->sel_pt[1].ent = ent2; + data->min_sel = 0; + data->max_sel = 1; + NL_SegChanged(data,ent,ent2); + data->minx_change_entry = ent; + data->minx_change_offset = PMIN; + data->maxx_change_entry = ent2; + data->maxx_change_offset = PMIN; + REDRAW; + } + return (TRUE); + } + + return(FALSE); +} + + +ULONG NL_List_Select(struct NLData *data,LONG pos,LONG pos2,LONG seltype,LONG *state) +{ + LONG ent,ent2,ent3; +/* DONE_NOTIFY(NTF_Select | NTF_LV_Select);*/ + if ((seltype == MUIV_NList_Select_None) || data->NList_TypeSelect || !data->NList_Input) + return (TRUE); + if ((pos == MUIV_NList_Select_All) && data->multiselect && data->NList_Input) + { LONG num = 0; + ent = 0; + switch (seltype) + { case MUIV_NList_Select_Off : + while (ent < data->NList_Entries) + { if ((data->NList_List_Select == MUIV_NList_Select_List) && (ent == data->NList_Active)) + { SELECT2_CHGE(ent,TE_Select_Line); + num++; + } + else + { SELECT2_CHGE(ent,TE_Select_None); + } + ent++; + } + if (state) + *state = num; + REDRAW; + break; + case MUIV_NList_Select_On : + while (ent < data->NList_Entries) + { SELECT_CHGE(ent,TE_Select_Line); + num++; + ent++; + } + if (state) + *state = num; + REDRAW; + break; + case MUIV_NList_Select_Toggle : + while (ent < data->NList_Entries) + { if ((data->NList_List_Select == MUIV_NList_Select_List) && (ent == data->NList_Active)) + { SELECT2_CHGE(ent,TE_Select_Line); + num++; + } + else if (data->EntriesArray[ent]->Select != TE_Select_None) + { SELECT2_CHGE(ent,TE_Select_None); + } + else + { SELECT_CHGE(ent,TE_Select_Line); + num++; + } + ent++; + } + if (state) + *state = num; + REDRAW; + break; + default : /* MUIV_NList_Select_Ask */ + while (ent < data->NList_Entries) + { if (data->EntriesArray[ent]->Select != TE_Select_None) + num++; + ent++; + } + if (state) + *state = num; + break; + } + data->lastselected = MUIV_NList_Active_Off; +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + return (TRUE); + } + else if ((data->multiselect || (seltype == MUIV_NList_Select_Ask)) && data->NList_Input) + { if (pos == MUIV_NList_Select_Active) + ent = data->NList_Active; + else + ent = pos; + if ((ent < 0) || (ent >= data->NList_Entries)) + return (FALSE); + + if (seltype != MUIV_NList_Select_Ask) + data->lastselected = ent; +/* + * if ((data->NList_List_Select == MUIV_NList_Select_List) && (ent == data->NList_Active) && (seltype == MUIV_NList_Select_Ask)) + * seltype = MUIV_NList_Select_On; + */ + ent2 = pos2; + if ((ent2 < 0) || (ent2 >= data->NList_Entries)) + ent2 = ent; + if (ent2 < ent) + { ent3 = ent; + ent = ent2 + 1; + ent2 = ent3 + 1; + } + else if (ent2 == ent) + ent2++; + while (ent < ent2) + { switch (seltype) + { case MUIV_NList_Select_Off : + if (state) *state = MUIV_NList_Select_Off; + SELECT2_CHGE(ent,TE_Select_None); + break; + case MUIV_NList_Select_On : + if (state) *state = MUIV_NList_Select_On; + SELECT_CHGE(ent,TE_Select_Line); + break; + case MUIV_NList_Select_Toggle : + if (data->EntriesArray[ent]->Select == TE_Select_None) + { if (state) *state = MUIV_NList_Select_On; + SELECT_CHGE(ent,TE_Select_Line); + } + else + { if (state) *state = MUIV_NList_Select_Off; + SELECT2_CHGE(ent,TE_Select_None); + } + break; + default : /* MUIV_NList_Select_Ask */ + if (data->EntriesArray[ent]->Select != TE_Select_None) + { if (state) *state = MUIV_NList_Select_On; } + else + { if (state) *state = MUIV_NList_Select_Off; } + break; + } + ent++; + } + if (ASKED_NOTIFY(NTF_Select | NTF_LV_Select)) + { REDRAW; + } +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + return (TRUE); + } + return (FALSE); +} + + +ULONG NL_List_TestPos(struct NLData *data,LONG x,LONG y,struct MUI_NList_TestPos_Result *res) +{ + if ((x == MUI_MAXMAX) && (y == MUI_MAXMAX)) + { + x = data->click_x; + y = data->click_y; + } + else if ((x == MUI_MAXMAX) && (y == 0)) + { + x = data->mouse_x; + y = data->mouse_y; + } + if (res) + { + WORD ly = (y - data->vpos); + WORD lyl = ly / data->vinc; + WORD lx = (x - data->hpos); + res->entry = -1; + res->column = -1; + res->flags = 0; + res->xoffset = 0; + res->yoffset = 0; + res->preparse = 0; + if (res->char_number != -2) + res->char_number = -1; + res->char_xoffset = 0; + if ((lx >= 0) && (lx < data->NList_Horiz_Visible) && + (ly >= 0) && (lyl < data->NList_Visible)) + { LONG line = lyl + data->NList_First; + if (!data->NList_Title && (ly < data->vinc/2)) + res->flags |= MUI_NLPR_ONTOP; + lx += data->NList_Horiz_First; + if ((line >= 0) && ((line < data->NList_First + data->NList_Visible) || (line < data->NList_Entries))) + { if (data->cols) + { res->column = 1; + while (res->column < data->numcols) + { if (data->cols[res->column].c->minx > lx) + break; + res->column++; + } + res->column--; + if ((res->column == data->numcols-1) && (lx > data->cols[res->column].c->maxx+data->cols[res->column].c->delta)) + res->column = -1; + else + { + if ((lx > data->cols[res->column].c->maxx-2) && (res->column < data->numcols-1)) + res->flags |= MUI_NLPR_BAR; + else if ((res->column == data->numcols-1) && IS_BAR(res->column,data->cols[res->column].c) && + (lx > data->cols[res->column].c->maxx-4) && (lx <= data->cols[res->column].c->maxx+data->cols[res->column].c->delta)) + res->flags |= MUI_NLPR_BAR; + else if ((res->column > 0) && (res->column == data->numcols-1) && + (data->NList_Horiz_First + data->NList_Horiz_Visible >= data->NList_Horiz_Entries) && + (x >= data->mright - 2) && (res->flags & MUI_NLPR_ONTOP)) + res->flags |= MUI_NLPR_BAR; + lx -= data->cols[res->column].c->minx; + } + } + else + res->column = -1; + } + if ((res->column >= 0) && (line >= 0) && (line < data->NList_Entries)) + { res->entry = line; + res->xoffset = lx; + res->yoffset = ly - ((lyl * data->vinc) + (data->vinc / 2)); + if (res->char_number != -2) + FindCharInColumn(data,line,res->column,lx,&res->char_xoffset,&res->char_number); + if (res->char_number < -PREPARSE_OFFSET_ENTRY) + { res->char_number += PREPARSE_OFFSET_COL; + res->preparse = 2; + } + else if (res->char_number < -1) + { res->char_number += PREPARSE_OFFSET_ENTRY; + res->preparse = 1; + } + } + else + { if (line < 0) + res->flags |= MUI_NLPR_ABOVE; + if (line >= data->NList_Entries) + res->flags |= MUI_NLPR_BELOW; + } + } + else if (data->NList_Title && (lx >= 0) && (lx < data->NList_Horiz_Visible) && + (ly < 0) && (y >= data->vdtitlepos)) + { res->flags = MUI_NLPR_ABOVE | MUI_NLPR_TITLE | MUI_NLPR_ONTOP; + lx += data->NList_Horiz_First; + if (data->cols) + { res->column = 1; + while (res->column < data->numcols) + { if (data->cols[res->column].c->minx > lx) + break; + res->column++; + } + res->column--; + if ((res->column == data->numcols-1) && (lx > data->cols[res->column].c->maxx+data->cols[res->column].c->delta)) + res->column = -1; + else + { + if ((lx > data->cols[res->column].c->maxx-2) && (res->column < data->numcols-1)) + res->flags |= MUI_NLPR_BAR; + else if ((res->column == data->numcols-1) && IS_BAR(res->column,data->cols[res->column].c) && + (lx > data->cols[res->column].c->maxx-4) && (lx <= data->cols[res->column].c->maxx+data->cols[res->column].c->delta)) + res->flags |= MUI_NLPR_BAR; + else if ((res->column > 0) && (res->column == data->numcols-1) && + (data->NList_Horiz_First + data->NList_Horiz_Visible >= data->NList_Horiz_Entries) && + (x >= data->mright - 2)) + res->flags |= MUI_NLPR_BAR; + lx -= data->cols[res->column].c->minx; + } + } + else + res->column = -1; + res->xoffset = lx; + res->yoffset = y - ((data->vdtitlepos + data->vpos) / 2); + } + else + { if (lx < 0) + res->flags |= MUI_NLPR_LEFT; + else if (lx >= data->NList_Horiz_Visible) + res->flags |= MUI_NLPR_RIGHT; + if (ly < 0) + res->flags |= MUI_NLPR_ABOVE; + else if (lyl >= data->NList_Visible) + res->flags |= MUI_NLPR_BELOW; + } + return (TRUE); + } + return (FALSE); +} + + +ULONG NL_List_TestPosOld(struct NLData *data,LONG x,LONG y,struct MUI_List_TestPos_Result *res) +{ + if (res) + { + WORD ly = (y - data->vpos); + WORD lyl = ly / data->vinc; + WORD lx = (x - data->hpos); + res->entry = -1; + res->column = -1; + res->flags = 0; + res->xoffset = 0; + res->yoffset = 0; + if ((lx >= 0) && (lx < data->NList_Horiz_Visible) && + (ly >= 0) && (lyl < data->NList_Visible)) + { LONG line = lyl + data->NList_First; + if ((line >= 0) && (line < data->NList_Entries)) + { res->entry = line; + lx += data->NList_Horiz_First; + if (data->cols) + { res->column = 1; + while (res->column < data->numcols) + { if (data->cols[res->column].c->minx > lx) + break; + res->column++; + } + res->column--; + lx -= data->cols[res->column].c->minx; + } + else + res->column = 0; + res->xoffset = lx; + res->yoffset = ly - ((lyl * data->vinc) + (data->vinc / 2)); + } + else + { if (line < 0) + res->flags |= MUI_NLPR_ABOVE; + if (line >= data->NList_Entries) + res->flags |= MUI_NLPR_BELOW; + } + } + else + { if (lx < 0) + res->flags |= MUI_NLPR_LEFT; + else if (lx >= data->NList_Horiz_Visible) + res->flags |= MUI_NLPR_RIGHT; + if (ly < 0) + res->flags |= MUI_NLPR_ABOVE; + else if (lyl >= data->NList_Visible) + res->flags |= MUI_NLPR_BELOW; + } + return (TRUE); + } + return (FALSE); +} + + +IPTR mNL_List_GetEntry(struct IClass *cl,Object *obj,struct MUIP_NList_GetEntry *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + LONG ent = msg->pos; + APTR entry = NULL; + + if(ent == MUIV_NList_GetEntry_Active) + ent = data->NList_Active; + + if(ent >= 0 && ent < data->NList_Entries && isFlagSet(data->EntriesArray[ent]->Wrap, TE_Wrap_TmpLine)) + ent -= data->EntriesArray[ent]->dnum; + + if(ent >= 0 && ent < data->NList_Entries) + entry = data->EntriesArray[ent]->Entry; + + // return the entry in the message if we got a valid pointer to store it + if(msg->entry != NULL) + *msg->entry = entry; + + // return the entry as a normal return value in any case + return (IPTR)entry; +} + + +IPTR mNL_List_GetEntryInfo(struct IClass *cl,Object *obj,struct MUIP_NList_GetEntryInfo *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + LONG line,ent2,ent = msg->res->pos; + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + + if (ent == MUIV_NList_GetEntryInfo_Line) + { ent = line = 0; + ent2 = msg->res->line; + while (ent < data->NList_Entries) + { if (!(data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine)) + { if (line == ent2) + break; + line++; + } + ent++; + } + if ((ent >= 0) && (ent < data->NList_Entries)) + { msg->res->entry_pos = ent; + msg->res->entry = data->EntriesArray[ent]->Entry; + msg->res->wrapcol = (LONG) data->EntriesArray[ent]->Wrap; + msg->res->charpos = (LONG) data->EntriesArray[ent]->pos; + msg->res->charlen = (LONG) data->EntriesArray[ent]->len; + } + else + { msg->res->line = -1; + msg->res->entry_pos = -1; + msg->res->entry = NULL; + msg->res->wrapcol = (LONG) 0; + msg->res->charpos = (LONG) 0; + msg->res->charlen = (LONG) 0; + } + } + else + { if (ent == MUIV_NList_GetEntry_Active) + ent = data->NList_Active; + + if (ent == -3 ) /* Magic number to get the last inserted entry <aphaso> */ + { + if ( data->NList_LastInserted == -1 ) + ent = (data->NList_Entries - 1); + else + ent = data->NList_LastInserted; + } + + ent2 = ent; + if ((ent >= 0) && (ent < data->NList_Entries) && (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine)) + ent -= data->EntriesArray[ent]->dnum; + if ((ent >= 0) && (ent < data->NList_Entries)) + { + if (msg->res->line == -2) /* Magic number to receive the NList entry pointer, not the supplied! <aphaso> */ + { + msg->res->entry_pos = ent; + msg->res->entry = data->EntriesArray[ent]; + } + else + { + msg->res->entry_pos = ent; + msg->res->entry = data->EntriesArray[ent]->Entry; + msg->res->wrapcol = (LONG) data->EntriesArray[ent2]->Wrap; + msg->res->charpos = (LONG) data->EntriesArray[ent2]->pos; + msg->res->charlen = (LONG) data->EntriesArray[ent2]->len; + ent2 = line = 0; + while (ent2 < ent) + { if (!(data->EntriesArray[ent2]->Wrap & TE_Wrap_TmpLine)) + line++; + ent2++; + } + msg->res->line = line; + } + } + else + { msg->res->line = -1; + msg->res->entry_pos = -1; + msg->res->entry = NULL; + msg->res->wrapcol = (LONG) 0; + msg->res->charpos = (LONG) 0; + msg->res->charlen = (LONG) 0; + } + } + return (TRUE); +} + +static BOOL NL_List_Jump(struct NLData *data, LONG pos) +{ + BOOL result = FALSE; + ENTER(); + + switch(pos) + { + case MUIV_NList_Jump_Top: + { + pos = 0; + } + break; + + case MUIV_NList_Jump_Bottom: + { + pos = data->NList_Entries - 1; + } + break; + + case MUIV_NList_Jump_Active: + { + pos = data->NList_Active; + } + break; + + case MUIV_NList_Jump_Up: + { + pos = data->NList_First - 1; + } + break; + + case MUIV_NList_Jump_Down: + { + pos = data->NList_First + data->NList_Visible; + } + break; + + case MUIV_NList_Jump_Active_Center: + { + // center the item in the visible area + LONG first = data->NList_Active - data->NList_Visible/2; + + // make sure that the last item is displayed in the last line + while(first + data->NList_Visible > data->NList_Entries) + first--; + + if(first < 0) + first = 0; + + data->NList_First = first; + + result = TRUE; + pos = -1; + } + break; + } + + if(pos >= 0 && pos < data->NList_Entries) + { + // old style jump, just make the requested item visible + if(pos < data->NList_First) + { + data->NList_First = pos; + + result = TRUE; + } + else if(pos >= data->NList_First + data->NList_Visible) + { + data->NList_First = pos - data->NList_Visible + 1; + + // make sure that the last item is displayed in the last line + while(data->NList_First + data->NList_Visible > data->NList_Entries) + data->NList_First--; + + if(data->NList_First < 0) + data->NList_First = 0; + + result = TRUE; + } + } + + RETURN(result); + return result; +} + +IPTR mNL_List_Jump(struct IClass *cl, Object *obj, struct MUIP_NList_Jump *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + + ENTER(); + + if(NL_List_Jump(data, msg->pos) == TRUE) + { + DO_NOTIFY(NTF_First); + REDRAW; + } + +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + + RETURN(TRUE); + return TRUE; +} + +IPTR mNL_List_SetActive(struct IClass *cl, Object *obj, struct MUIP_NList_SetActive *msg) +{ + BOOL result = FALSE; + struct NLData *data = INST_DATA(cl,obj); + LONG pos = (LONG)(SIPTR)msg->pos; + + ENTER(); + + // check if the user used msg->pos for specifying the entry position (integer) + // or by using the entry address + if(isFlagSet(msg->flags, MUIV_NList_SetActive_Entry)) + NL_List_GetPos(data, (APTR)msg->pos, &pos); + + result = NL_List_Active(data, pos, NULL, data->NList_List_Select, FALSE, msg->flags); + if(result == TRUE) + { + DO_NOTIFY(NTF_Active | NTF_L_Active); + } + + RETURN(result); + return result; +} + +IPTR mNL_List_Select(struct IClass *cl,Object *obj,struct MUIP_NList_Select *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + if (data->NList_TypeSelect) + return (NL_List_SelectChar(data,msg->pos,msg->seltype,msg->state)); + else + return (NL_List_Select(data,msg->pos,msg->pos,msg->seltype,msg->state)); + return (0); +} + + +IPTR mNL_List_TestPos(struct IClass *cl,Object *obj,struct MUIP_NList_TestPos *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + return (NL_List_TestPos(data,msg->x,msg->y,msg->res)); +} + + +IPTR mNL_List_TestPosOld(struct IClass *cl,Object *obj,struct MUIP_List_TestPos *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + return (NL_List_TestPosOld(data,msg->x,msg->y,msg->res)); +} + + +IPTR mNL_List_Redraw(struct IClass *cl,Object *obj,struct MUIP_NList_Redraw *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + long ent; + + ENTER(); + + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + ent = msg->pos; + data->display_ptr = NULL; + data->parse_column = -1; + + /*D(bug("%lx|List_Redraw1 pos=%ld Q=%ld D=%ld S=%ld\n",obj,msg->pos,data->NList_Quiet,data->DRAW,data->SETUP));*/ + + if(data->DRAW > 1) + { + // defer the redraw process + /*D(bug("%lx|List_Redraw no! %ld %ld (push it)\n",obj,msg->pos,data->DRAW));*/ + DoMethod(_app(obj), MUIM_Application_PushMethod, obj, 2, msg->MethodID, msg->pos); + } + else + { + if(msg->MethodID == MUIM_List_Redraw && msg->pos == MUIV_NList_Redraw_All) + msg->pos = -6; + + switch(msg->pos) + { + case -6: + { + if(data->DRAW) + { + NL_SetColsAdd(data,-2,TRUE); + DoMethod(_app(obj), MUIM_Application_PushMethod, obj, 2, MUIM_NList_Redraw, MUIV_NList_Redraw_All); + } + } + break; + + case MUIV_NList_Redraw_All: + { + // redraw all entries + if(data->DRAW) + { + NL_SetColsAdd(data,-2,TRUE); + for(ent = 0; ent < data->NList_Entries; ent++) + data->EntriesArray[ent]->PixLen = -1; + } + data->Title_PixLen = -1; + data->do_draw_title = TRUE; + data->do_parse = TRUE; + data->do_setcols = TRUE; + data->do_updatesb = TRUE; + data->force_wwrap = TRUE; + REDRAW_ALL; + } + break; + + case MUIV_NList_Redraw_VisibleCols: + { + // redraw visible columns only + if(data->DRAW) + NL_SetColsAdd(data, -3, TRUE); + } + break; + + case MUIV_NList_Redraw_Selected: + { + // redraw selected entries only + if(data->DRAW) + { + BOOL doDraw = FALSE; + + if(data->NList_TypeSelect == MUIV_NList_TypeSelect_Line) + { + for(ent=0; ent < data->NList_Entries; ent++) + { + // mark the selected entries as "to be redrawn" + if(data->EntriesArray[ent]->Select != TE_Select_None) + { + NL_SetColsAdd(data, ent, TRUE); + data->EntriesArray[ent]->PixLen = -1; + NL_Changed(data, ent); + doDraw = TRUE; + } + } + } + else + { + NL_SegChanged(data,data->sel_pt[data->min_sel].ent,data->sel_pt[data->max_sel].ent); + doDraw = TRUE; + } + + if(doDraw == TRUE) + { + // at least one entry must be redrawn + data->display_ptr = NULL; + data->do_draw = TRUE; + REDRAW; + } + } + } + break; + + case MUIV_NList_Redraw_Title: + { + // redraw title only + if(data->DRAW) + { + NL_SetColsAdd(data, -1, TRUE); + data->Title_PixLen = -1; + } + data->do_draw_title = TRUE; + data->do_setcols = TRUE; + REDRAW; + } + break; + + case MUIV_NList_Redraw_Active: + { + // redraw the active entry only + ent = data->NList_Active; + } + // fall through to the default redraw + + default: + { + // redraw a specific entry + if(ent >= 0 && ent < data->NList_Entries) + { + if(data->DRAW) + { + NL_SetColsAdd(data, ent, TRUE); + data->EntriesArray[ent]->PixLen = -1; + } + NL_Changed(data, ent); + REDRAW; + } + } + break; + } + + /*D(bug("%lx|List_Redraw2 pos=%ld Q=%ld D=%ld S=%ld\n",obj,msg->pos,data->NList_Quiet,data->DRAW,data->SETUP));*/ + } + + RETURN(TRUE); + return TRUE; +} + + +IPTR mNL_List_RedrawEntry(struct IClass *cl,Object *obj,struct MUIP_NList_RedrawEntry *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + LONG ent = 0; + BOOL dodraw = FALSE; + if (!msg->entry) + return (FALSE); + while (ent < data->NList_Entries) + { if (data->EntriesArray[ent]->Entry == msg->entry) + { data->EntriesArray[ent]->PixLen = -1; + NL_Changed(data,ent); + dodraw = TRUE; + } + ent++; + } + if (dodraw) + { + /* sba: This enforces redrawing the entry completly */ + data->display_ptr = NULL; + + data->do_draw = TRUE; + REDRAW; + + return (TRUE); + } + return (FALSE); +} + + +IPTR mNL_List_NextSelected(struct IClass *cl,Object *obj,struct MUIP_NList_NextSelected *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + long ent = *msg->pos; + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + if ((ent == MUIV_NList_NextSelected_Start) || (ent < 0)) + ent = 0; + else + ent++; + if (data->NList_TypeSelect) + { + if (ent < data->sel_pt[data->min_sel].ent) + ent = data->sel_pt[data->min_sel].ent; + else if (ent > data->sel_pt[data->max_sel].ent) + ent = MUIV_NList_NextSelected_End; + else if ((ent == data->sel_pt[data->max_sel].ent) && + (data->sel_pt[data->max_sel].column == 0) && + (data->sel_pt[data->max_sel].xoffset == PMIN)) + ent = MUIV_NList_NextSelected_End; + } + else + { while ((ent < data->NList_Entries) && (data->EntriesArray[ent]->Select == TE_Select_None)) + ent++; + if (ent >= data->NList_Entries) + ent = MUIV_NList_NextSelected_End; + } + *msg->pos = ent; + return (TRUE); +} + + +IPTR mNL_List_PrevSelected(struct IClass *cl,Object *obj,struct MUIP_NList_PrevSelected *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + long ent = *msg->pos; + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + if ((ent == MUIV_NList_PrevSelected_Start) || (ent < 0) || (ent >= data->NList_Entries)) + ent = data->NList_Entries - 1; + else + ent--; + if (data->NList_TypeSelect) + { + if (ent < data->sel_pt[data->min_sel].ent) + ent = MUIV_NList_PrevSelected_End; + else if ((ent == data->sel_pt[data->max_sel].ent) && + (data->sel_pt[data->max_sel].column == 0) && + (data->sel_pt[data->max_sel].xoffset == PMIN)) + ent = data->sel_pt[data->max_sel].ent - 1; + else if (ent > data->sel_pt[data->max_sel].ent) + ent = data->sel_pt[data->max_sel].ent; + } + else + { while ((ent > 0) && (data->EntriesArray[ent]->Select == TE_Select_None)) + ent--; + if (ent < 0) + ent = MUIV_NList_PrevSelected_End; + } + *msg->pos = ent; + return (TRUE); +} + + +IPTR mNL_List_GetSelectInfo(struct IClass *cl,Object *obj,struct MUIP_NList_GetSelectInfo *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + LONG ent; + + msg->res->start = 1; + msg->res->vstart = -1; + msg->res->end = 1; + msg->res->vend = -1; + msg->res->num = -1; + msg->res->vnum = 0; + msg->res->start_column = -1; + msg->res->end_column = -1; + msg->res->start_pos= -1; + msg->res->end_pos = -1; + + if(data->NList_TypeSelect == MUIV_NList_TypeSelect_Line) + { + ent = 0; + + while(ent < data->NList_Entries) + { + if(data->EntriesArray[ent] != NULL && data->EntriesArray[ent]->Select != TE_Select_None) + { + if(msg->res->start == -1) + msg->res->start = ent; + + msg->res->end = ent; + msg->res->vnum++; + } + ent++; + } + msg->res->vstart = msg->res->start; + msg->res->vend = msg->res->end; + } + else + { + msg->res->start_column = data->sel_pt[data->min_sel].column; + msg->res->start_pos = data->sel_pt[data->min_sel].colpos; + msg->res->end_column = data->sel_pt[data->max_sel].column; + msg->res->end_pos = data->sel_pt[data->max_sel].colpos; + msg->res->start = data->sel_pt[data->min_sel].ent; + msg->res->end = data->sel_pt[data->max_sel].ent; + msg->res->vstart = msg->res->start; + msg->res->vend = msg->res->end; + + if((msg->res->vstart >= 0) && (msg->res->vend >= msg->res->vstart)) + msg->res->vnum = msg->res->vend - msg->res->vstart + 1; + } + + if (msg->res->start >= 0 && msg->res->start < data->NList_Entries && data->EntriesArray[msg->res->start] != NULL && data->EntriesArray[msg->res->start]->Wrap) + { + if (data->EntriesArray[msg->res->start]->Wrap & TE_Wrap_TmpLine) + msg->res->start -= data->EntriesArray[msg->res->start]->dnum; + } + + if (msg->res->end >= 0 && msg->res->end < data->NList_Entries && data->EntriesArray[msg->res->end] != NULL && data->EntriesArray[msg->res->end]->Wrap) + { + if (data->EntriesArray[msg->res->end]->Wrap & TE_Wrap_TmpLine) + msg->res->end -= data->EntriesArray[msg->res->end]->dnum; + } + + return (TRUE); +} + + +IPTR mNL_List_DoMethod(struct IClass *cl,Object *obj,struct MUIP_NList_DoMethod *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + LONG ent = msg->pos; + APTR dest = msg->DestObj; + + if((msg->FollowParams >= 1) && (msg->FollowParams < 40) && + ((msg->pos == MUIV_NList_DoMethod_Active) || + (msg->pos == MUIV_NList_DoMethod_Selected) || + (msg->pos == MUIV_NList_DoMethod_All) || + ((msg->pos >= 0) && (msg->pos < data->NList_Entries)))) + { + LONG *table1 = (LONG *)&msg->FollowParams; + struct + { + STACKED ULONG MethodID; + SIPTR params[64]; /* MAXIMUM 40 (see docs) <aphaso> */ + } newMsg; + + if(msg->FollowParams > 63) /* MAXIMUM 40 (see docs) <aphaso> */ + { + msg->FollowParams = 63; + newMsg.params[63] = 0; + } + + if((IPTR)msg->DestObj == (IPTR)MUIV_NList_DoMethod_Self) + dest = (APTR) obj; + else if((IPTR)msg->DestObj == (IPTR)MUIV_NList_DoMethod_App) + { + if(data->SETUP) + dest = (APTR) _app(obj); + else + dest = NULL; + } + if(msg->pos == MUIV_NList_DoMethod_Active) + ent = MUIV_NList_DoMethod_Active; + else if(msg->pos == MUIV_NList_DoMethod_Selected) + { + if(data->NList_TypeSelect) + ent = data->sel_pt[data->min_sel].ent; + else + { + ent = 0; + while((ent < data->NList_Entries) && (data->EntriesArray[ent]->Select == TE_Select_None)) + ent++; + } + } + else if(msg->pos == MUIV_NList_DoMethod_All) + ent = 0; + while((ent >= 0) && (ent < data->NList_Entries)) + { + if((IPTR) msg->DestObj == (IPTR)MUIV_NList_DoMethod_Entry) + dest = data->EntriesArray[ent]->Entry; + if(dest) + { + ULONG num; + + newMsg.MethodID = table1[1]; + + for(num = 1;num < msg->FollowParams;num++) + { + switch(table1[num+1]) + { + case MUIV_NList_EntryValue: + newMsg.params[num] = (SIPTR)data->EntriesArray[ent]->Entry; + break; + case MUIV_NList_EntryPosValue: + newMsg.params[num] = (LONG)ent; + break; + case MUIV_NList_SelfValue: + newMsg.params[num] = (SIPTR)obj; + break; + case MUIV_NList_AppValue: + if (data->SETUP) + newMsg.params[num] = (SIPTR)_app(obj); + else + newMsg.params[num] = 0; + break; + default: + newMsg.params[num] = table1[num+1]; + break; + } + } + + DoMethodA(dest, (Msg)((APTR)&newMsg)); + } + ent++; + if(msg->pos == MUIV_NList_DoMethod_Selected) + { + if(data->NList_TypeSelect) + { + if((ent > data->sel_pt[data->max_sel].ent) || + ((ent == data->sel_pt[data->max_sel].ent) && + (data->sel_pt[data->max_sel].column == 0) && + (data->sel_pt[data->max_sel].xoffset == PMIN))) + break; + } + else + { + while((ent < data->NList_Entries) && (data->EntriesArray[ent]->Select == TE_Select_None)) + ent++; + } + } + else if(msg->pos != MUIV_NList_DoMethod_All) + break; + } + } + return (TRUE); +} + +static BOOL NL_List_GetPos(struct NLData *data, APTR entry, LONG *pos) +{ + BOOL result = FALSE; + + ENTER(); + + if(entry == NULL) + { + *pos = MUIV_NList_GetPos_End; + result = FALSE; + } + else if((IPTR)entry == (IPTR)-2) + { + if(data->NList_LastInserted == -1) + *pos = (data->NList_Entries - 1); + else + *pos = data->NList_LastInserted; + + result = TRUE; + } + else + { + LONG ent = *pos + 1; + + while(ent < data->NList_Entries) + { + if(data->EntriesArray[ent]->Entry == entry) + { + *pos = ent; + + result = TRUE; + break; + } + ent++; + } + + if(result == FALSE) + { + *pos = MUIV_NList_GetPos_End; + result = TRUE; + } + } + + RETURN(result); + return result; +} + +IPTR mNL_List_GetPos(struct IClass *cl,Object *obj,struct MUIP_NList_GetPos *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + BOOL result; + + result = NL_List_GetPos(data, msg->entry, msg->pos); + + return result; +} diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_func.h b/workbench/classes/zune/nlist/nlist_mcc/NList_func.h new file mode 100644 index 0000000000..8f9761025b --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_func.h @@ -0,0 +1,199 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#define PMIN -30000 +#define PMAX 30000 + +#define NTF_SB ((LONG) (1<<0)) +#define NTF_VSB ((LONG) (1<<1)) +#define NTF_HSB ((LONG) (1<<2)) +#define NTF_First ((LONG) (1<<3)) +#define NTF_Entries ((LONG) (1<<4)) +#define NTF_Active ((LONG) (1<<5)) +#define NTF_L_Active ((LONG) (1<<6)) +#define NTF_Select ((LONG) (1<<7)) +#define NTF_LV_Select ((LONG) (1<<8)) +#define NTF_Multiclick ((LONG) (1<<9)) +#define NTF_Doubleclick ((LONG) (1<<10)) +#define NTF_LV_Doubleclick ((LONG) (1<<11)) +#define NTF_TitleClick ((LONG) (1<<12)) +#define NTF_EntryClick ((LONG) (1<<13)) +#define NTF_MinMax ((LONG) (1<<14)) +#define NTF_MinMaxNoDraw ((LONG) (1<<15)) +#define NTF_ButtonClick ((LONG) (1<<16)) +#define NTF_LineHeight ((LONG) (1<<17)) +#define NTF_Insert ((LONG) (1<<18)) +#define NTF_DragSortInsert ((LONG) (1<<19)) +#define NTF_Columns ((LONG) (1<<20)) +#define NTF_MulticlickAlone ((LONG) (1<<21)) +#define NTF_TitleClick2 ((LONG) (1<<22)) + +#define NTF_DragWait ((LONG) (1<<31)) + +#define NTF_AllChanges (NTF_First|NTF_Entries|NTF_Active|NTF_L_Active|NTF_Select|NTF_LV_Select|NTF_LineHeight|NTF_Insert|NTF_DragSortInsert|NTF_Columns) +#define NTF_AllClick (NTF_Multiclick|NTF_MulticlickAlone|NTF_Doubleclick|NTF_LV_Doubleclick|NTF_TitleClick|NTF_TitleClick2|NTF_EntryClick|NTF_ButtonClick) +#define NTF_All (NTF_AllChanges|NTF_AllClick) + +#define NTF_AlwaysDoNotify (NTF_SB|NTF_VSB|NTF_HSB|NTF_MinMax|NTF_MinMaxNoDraw|NTF_LineHeight|NTF_DragSortInsert) + +#define WANT_NOTIFY(ntf) data->Notify |= (ntf) +#define NOWANT_NOTIFY(ntf) data->Notify &= ~(ntf) +#define WANTED_NOTIFY(ntf) (data->Notify & (ntf)) +#define DO_NOTIFY(ntf) if(data->NList_Quiet < 900) data->DoNotify |= (ntf); else data->DoNotify |= ((ntf) & NTF_AlwaysDoNotify) +#define ASKED_NOTIFY(ntf) (data->DoNotify & (ntf)) +#define NEED_NOTIFY(ntf) (data->Notify & data->DoNotify & (ntf)) +#define DONE_NOTIFY(ntf) data->DoNotify &= ~(ntf) +#define NOTIFY_START(ntf) data->Notifying |= (ntf) +#define NOTIFYING(ntf) (data->Notifying & (ntf)) +#define NOTIFY_END(ntf) data->Notifying &= ~(ntf) + +/* mad_Flags |= 0x00004000 to make it think it's visible even if in a virtgroup */ + +#define REDRAW_IF NL_DrawQuietBG(data,0,0) +#define REDRAW_ALL_FORCE NL_DrawQuietBG(data,1,0) +#define REDRAW_ALL NL_DrawQuietBG(data,2,0) +#define REDRAW_FORCE NL_DrawQuietBG(data,3,0) +#define REDRAW NL_DrawQuietBG(data,4,0) + +#define MOREQUIET data->NList_Quiet++ +#define FULLQUIET data->NList_Quiet |= 0x1000 +#define FULLQUIET_END data->NList_Quiet &= 0x0FFF +#define VISUALQUIET data->NList_Quiet = (data->NList_Quiet & 0x0FFF) + 1 +#define ENDQUIET NL_DrawQuietBG(data,5,0) +#define LESSQUIET NL_DrawQuietBG(data,6,0) + +#define SetBackGround(bg) if((bg) != (ULONG)data->actbackground) NL_DrawQuietBG(data, 7, (bg)); +#define SetBackGroundForce(bg) NL_DrawQuietBG(data,8,(bg)) + +#define Make_Active_Visible NL_DrawQuietBG(data,9,0) + +#define ForceMinMax NL_DrawQuietBG(data,10,0) + +#define do_notifies(which) NL_DoNotifies(data,(which)) + + +#define notify_Active NL_DoNotifies(data,NTF_Active) +#define notify_Select NL_DoNotifies(data,(NTF_Select | NTF_LV_Select)) +#define do_notify_Select NL_DoNotifies(data,(NTF_Select | NTF_LV_Select)) + + +#define SELECT(ent,sel) NL_Select(data,0,(ent),(sel)) +#define SELECT2(ent,sel) NL_Select(data,1,(ent),(sel)) +#define SELECT_CHGE(ent,sel) NL_Select(data,2,(ent),(sel)) +#define SELECT2_CHGE(ent,sel) NL_Select(data,3,(ent),(sel)) +#define set_Active(new_act) NL_Select(data,4,(new_act),0) + + + + +#define ReSetFont if(data->rp->Font!=data->font) SetFont(data->rp,data->font); + +#define notdoset(obj,attr,value) SetAttrs(obj,MUIA_Group_Forward,FALSE,MUIA_NList_Visible,0,attr,value,TAG_DONE) + + +#define STYLE_MASK (FSF_UNDERLINED|FSF_BOLD|FSF_ITALIC) +#define SET_STYLE_NORMAL(s) ((s) = (s) & ~STYLE_MASK) +#define SET_STYLE_UNDERLINE(s) ((s) = (s) | FSF_UNDERLINED) +#define SET_STYLE_BOLD(s) ((s) = (s) | FSF_BOLD) +#define SET_STYLE_ITALIC(s) ((s) = (s) | FSF_ITALIC) +#define IS_STYLE_NORMAL(s) (((s) & STYLE_MASK) == FS_NORMAL) +#define IS_STYLE_UNDERLINE(s) ((s) & FSF_UNDERLINED) +#define IS_STYLE_BOLD(s) ((s) & FSF_BOLD) +#define IS_STYLE_ITALIC(s) ((s) & FSF_ITALIC) +#define GET_STYLE(s) ((s) & STYLE_MASK) + +#define STYLE_STRMASK (0x00F0) +#define STYLE_IMAGE (0x0010) +#define STYLE_IMAGE2 (0x0020) +#define STYLE_TAB (0x0040) +#define STYLE_SPACE (0x0050) +#define STYLE_FIXSPACE (0x0060) + +#define ALIGN_MASK (0x0700) +/* already defined in NList_mcc.h +#define ALIGN_LEFT (0x0000) +#define ALIGN_CENTER (0x0100) +#define ALIGN_RIGHT (0x0200) +#define ALIGN_JUSTIFY (0x0400) +*/ +#define SET_ALIGN_LEFT(a) ((a) = ((a) & ~ALIGN_MASK) | ALIGN_LEFT) +#define SET_ALIGN_CENTER(a) ((a) = ((a) & ~ALIGN_MASK) | ALIGN_CENTER) +#define SET_ALIGN_RIGHT(a) ((a) = ((a) & ~ALIGN_MASK) | ALIGN_RIGHT) +#define SET_ALIGN_JUSTIFY(a) ((a) = ((a) & ~ALIGN_MASK) | ALIGN_JUSTIFY) +#define IS_ALIGN_LEFT(a) (((a) & ALIGN_MASK) == ALIGN_LEFT) +#define IS_ALIGN_CENTER(a) (((a) & ALIGN_MASK) == ALIGN_CENTER) +#define IS_ALIGN_RIGHT(a) (((a) & ALIGN_MASK) == ALIGN_RIGHT) +#define IS_ALIGN_JUSTIFY(a) (((a) & ALIGN_MASK) == ALIGN_JUSTIFY) + +#define HLINE_MASK (0x7000) +#define HLINE_T (0x1000) +#define HLINE_C (0x2000) +#define HLINE_B (0x3000) +#define HLINE_E (0x4000) +#define SET_HLINE_T(a) ((a) = ((a) & ~HLINE_MASK) | HLINE_T) +#define SET_HLINE_C(a) ((a) = ((a) & ~HLINE_MASK) | HLINE_C) +#define SET_HLINE_B(a) ((a) = ((a) & ~HLINE_MASK) | HLINE_B) +#define SET_HLINE_E(a) ((a) = ((a) & ~HLINE_MASK) | HLINE_E) +#define IS_HLINE(a) ((a) & HLINE_MASK) +#define IS_HLINE_T(a) (((a) & HLINE_MASK) == HLINE_T) +#define IS_HLINE_C(a) (((a) & HLINE_MASK) == HLINE_C) +#define IS_HLINE_B(a) (((a) & HLINE_MASK) == HLINE_B) +#define IS_HLINE_E(a) (((a) & HLINE_MASK) == HLINE_E) + +#define HLINE_thick_MASK (0x8800) +#define HLINE_thick (0x8000) +#define HLINE_nothick (0x0800) +#define SET_HLINE_thick(a) ((a) = ((a) & ~HLINE_thick_MASK) | HLINE_thick) +#define SET_HLINE_nothick(a) ((a) = ((a) & ~HLINE_thick_MASK) | HLINE_nothick) +#define IS_HLINE_thick(a) (((a) & HLINE_thick_MASK) == HLINE_thick) +#define IS_HLINE_nothick(a) (((a) & HLINE_thick_MASK) == HLINE_nothick) + +#define FIXPEN_MASK (0x0008) +#define SET_FIXPEN(a) ((a) |= FIXPEN_MASK) +#define SET_NOFIXPEN(a) ((a) &= ~FIXPEN_MASK) +#define IS_FIXPEN(a) ((a) & FIXPEN_MASK) +/*data->cols[column].style*/ + + +#if !defined(__amigaos4__) && !defined(__MORPHOS__) && !defined(__AROS__) +// AllocVecPooled.c +APTR AllocVecPooled(APTR, ULONG); +// FreeVecPooled.c +void FreeVecPooled(APTR, APTR); +#endif + +#if defined(__amigaos4__) +#define AllocTypeEntry() ItemPoolAlloc(data->EntryPool) +#define FreeTypeEntry(entry) ItemPoolFree(data->EntryPool, entry) +#else +#define AllocTypeEntry() AllocPooled(data->EntryPool, sizeof(struct TypeEntry)) +#define FreeTypeEntry(entry) FreePooled(data->EntryPool, entry, sizeof(struct TypeEntry)) +#endif + +#define IS_BAR(c,ci) \ + (((c) < data->numcols-1) ||\ + (((c) > 0) &&\ + (((ci)->width < 0) || ((ci)->width_type != CI_PERCENT) || ((ci)->userwidth > 0)))) + diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_func2.c b/workbench/classes/zune/nlist/nlist_mcc/NList_func2.c new file mode 100644 index 0000000000..54c153c9bc --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_func2.c @@ -0,0 +1,2075 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <stdlib.h> + +#include <clib/alib_protos.h> +#include <proto/exec.h> +#include <proto/intuition.h> + +#include "private.h" + +#include "NList_func.h" + +LONG NL_GetSelects(struct NLData *data, LONG ent) +{ + LONG selects = 0L; + + if (data->multiselect && data->EntriesArray[ent]->Wrap && !(data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine)) + { + LONG bitpos = 1L,ent1 = ent + data->EntriesArray[ent]->dnum; + BOOL sel = FALSE; + + while ((ent < data->NList_Entries) && (ent < ent1)) + { + if (data->EntriesArray[ent]->Select != TE_Select_None) + { + selects |= bitpos; + sel = TRUE; + } + else + sel = FALSE; + + bitpos = bitpos << 1; + ent++; + } + + while (sel && (bitpos & 0x0000FFFF)) + { + selects |= bitpos; + bitpos = bitpos << 1; + } + + if (sel) + selects |= 0xFFFF8000; + else + selects &= 0x00007FFF; + } + + return (selects); +} + + +//$$$ARRAY+ +BOOL NL_InsertTmpLine(struct NLData *data,LONG pos) +{ + LONG newpos, ent, ent1, maxent; + + newpos = pos; + maxent = data->NList_Entries + 1; + + if (maxent >= data->LastEntry) + { + struct TypeEntry **newentries = NULL; + LONG le = ((maxent << 1) + 0x00FFL) & ~0x000FL; + + if((newentries = AllocVecPooled(data->Pool, sizeof(struct TypeEntry *) * (le + 1))) != NULL) + { + struct TypeEntry *newentry = NULL; + + if ((data->NList_First >= pos) && (data->NList_First < data->NList_Entries-1)) + data->NList_First++; + + data->LastEntry = le; + ent = 0; + ent1 = 0; + + { LONG de = newpos - ent1; + if ((maxent - ent) < de) + de = maxent - ent; + NL_Move(&newentries[ent],&data->EntriesArray[ent1],de,ent); + ent += de; + ent1 += de; + } + + if((newentry = AllocTypeEntry()) != NULL) + { + newentries[ent] = newentry; + + newentry->Entry = 0; + newentry->Select = 0; + newentry->Wrap = TE_Wrap_TmpLine; + newentry->PixLen = -1; + newentry->pos = 0; + newentry->len = -2; + newentry->style = 0; + newentry->dnum = 1; + newentry->entpos = ent; + ent++; + + { LONG de = data->NList_Entries - ent1; + if ((maxent - ent) < de) + de = maxent - ent; + NL_Move(&newentries[ent],&data->EntriesArray[ent1],de,ent); + ent += de; + } + + newentries[ent] = NULL; + if (data->EntriesArray) + FreeVecPooled(data->Pool, data->EntriesArray); + data->EntriesArray = newentries; + data->NList_Entries = ent; + if ((newpos >= data->NList_AffFirst) || data->NList_EntryValueDependent) + { + NL_SegChanged(data,newpos,data->NList_Entries); + data->do_draw = TRUE; + } + else + { + data->NList_AffFirst += 1; + data->do_draw = TRUE; + } + if ((data->NList_Active >= newpos) && (data->NList_Active < data->NList_Entries)) + { + set_Active(data->NList_Active + 1); + NL_Changed(data,data->NList_Active); + } + UnSelectCharSel(data,FALSE); + return (TRUE); + } + + FreeVecPooled(data->Pool, newentries); + return (FALSE); + } + } + else if (data->EntriesArray) + { + struct TypeEntry *newentry = NULL; + + if ((data->NList_First >= pos) && (data->NList_First < data->NList_Entries-1)) + data->NList_First++; + + ent = data->NList_Entries; + NL_MoveD(&data->EntriesArray[ent+1],&data->EntriesArray[ent],ent-newpos,ent+1); + ent = newpos; + + if((newentry = AllocTypeEntry()) != NULL) + { + data->EntriesArray[ent] = newentry; + + newentry->Entry = 0; + newentry->Select = 0; + newentry->Wrap = TE_Wrap_TmpLine; + newentry->PixLen = -1; + newentry->pos = 0; + newentry->len = -2; + newentry->style = 0; + newentry->dnum = 1; + newentry->entpos = ent; + data->NList_Entries += 1; + + if ((newpos >= data->NList_AffFirst) || data->NList_EntryValueDependent) + { + NL_SegChanged(data,newpos,data->NList_Entries); + data->do_draw = TRUE; + } + else + { + data->NList_AffFirst += 1; + data->do_draw = TRUE; + } + + if ((data->NList_Active >= newpos) && (data->NList_Active < data->NList_Entries)) + { + set_Active(data->NList_Active + 1); + NL_Changed(data,data->NList_Active); + } + + UnSelectCharSel(data,FALSE); + + return (TRUE); + } + } + return (FALSE); +} + + +//$$$ARRAY+ +void NL_DeleteTmpLine(struct NLData *data,LONG pos) +{ + LONG ent = pos; + + if((ent >= 0) && (ent < data->NList_Entries) && data->EntriesArray && (data->LastEntry > 0) && + (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine)) + { + if((data->NList_First >= pos) && (data->NList_First > 0)) + data->NList_First--; + data->NList_Entries -= 1; + + if((ent >= data->NList_AffFirst) || data->NList_EntryValueDependent) + { + NL_SegChanged(data,ent,data->NList_Entries + 1); + data->do_draw = TRUE; + } + else + { + data->NList_AffFirst--; + data->do_draw = TRUE; + } + + if(data->NList_Active == ent) + { + DO_NOTIFY(NTF_Active | NTF_L_Active); + if(data->NList_MultiSelect == MUIV_NList_MultiSelect_None) + { + if(ent+1 <= data->NList_Entries) + { + if(data->EntriesArray[ent+1]->Select == TE_Select_None) + SELECT(ent+1,TE_Select_Line); + data->lastselected = ent; + data->lastactived = ent; + } + else if(ent-1 >= 0) + { + SELECT(ent-1,TE_Select_Line); + data->lastselected = ent-1; + data->lastactived = ent-1; + } + } + } + else if(data->NList_Active > ent) + { + set_Active(data->NList_Active - 1); + } + if(data->NList_Active >= data->NList_Entries) + { + set_Active(data->NList_Entries - 1); + } + + FreeTypeEntry(data->EntriesArray[ent]); + NL_Move(&data->EntriesArray[ent],&data->EntriesArray[ent+1],data->NList_Entries-ent,ent); + ent = data->NList_Entries; + + data->EntriesArray[ent] = NULL; + + UnSelectCharSel(data,FALSE); + } +} + + +struct sort_entry +{ LONG ent; + struct NLData *data; +}; + + +static int NL_SortCompar(struct NLData *data,LONG ent1,LONG ent2) +{ + LONG result = 0; + LONG e1 = ent1; + LONG e2 = ent2; + + if (data->EntriesArray[ent1]->Wrap & TE_Wrap_TmpLine) + ent1 -= data->EntriesArray[ent1]->dnum; + if (data->EntriesArray[ent2]->Wrap & TE_Wrap_TmpLine) + ent2 -= data->EntriesArray[ent2]->dnum; + + if(ent1 != ent2) + { + result = (LONG)DoMethod(data->this, MUIM_NList_Compare, data->EntriesArray[ent1]->Entry, data->EntriesArray[ent2]->Entry, data->NList_SortType, data->NList_SortType2); + if(result == 0) + result = ent1 - ent2; + } + else + result = e1 - e2; + + return (int)result; +} + + +/*int sort_compar(const void *e1, const void *e2)*/ +static int sort_compar(struct sort_entry *e1, struct sort_entry *e2) +{ + return NL_SortCompar(e1->data,e1->ent,e2->ent); +} + + +//$$$ARRAY+ +//fent = first entry +//lent = last entry +static ULONG NL_List_SortPart(struct NLData *data,LONG fent,LONG lent) +{ + LONG ent, ent1, numfollow, numexch, has_changed; + struct sort_entry *entry = NULL; + struct TypeEntry *newentry; + + ENTER(); + + data->display_ptr = NULL; + has_changed = FALSE; + + lent++; + + if((entry = (struct sort_entry *)AllocVecPooled(data->Pool, sizeof(struct sort_entry) * (lent-fent))) != NULL) + { + for (ent = fent; ent < lent; ent++) + { + entry[ent-fent].ent = ent; + entry[ent-fent].data = data; + } + +//D(DBF_ALWAYS, "qsort started."); + qsort(entry, (size_t) (lent-fent), (size_t) sizeof(struct sort_entry), (int (*)()) &sort_compar); +//D(DBF_ALWAYS, "qsort ended."); + + ent1 = numfollow = numexch = 0; + + for (ent = fent; ent < lent; ent++) + { + ent1 = entry[ent-fent].ent; + while (ent1 < ent) /* find a ent1 not already done */ + { + ent1 = entry[ent1-fent].ent; + numfollow++; + if(numfollow > lent) break; + } + + if (ent1 > ent) /* exchange them */ + { + /* DO EXCHANGE */ + newentry = data->EntriesArray[ent]; + data->EntriesArray[ent] = data->EntriesArray[ent1]; + data->EntriesArray[ent1] = newentry; + data->EntriesArray[ent]->entpos = ent; + data->EntriesArray[ent1]->entpos = ent1; + + NL_Changed(data,ent); + NL_Changed(data,ent1); + + if (data->NList_Active == ent) + set_Active(ent1); + else if (data->NList_Active == ent1) + set_Active(ent); + + if (data->NList_LastInserted == ent) + { + /* sba: was data->NList_LastInserted--; */ + data->NList_LastInserted = ent1; + DO_NOTIFY(NTF_Insert); + } else + if (data->NList_LastInserted == ent1) + { + /* sba: was data->NList_LastInserted++; */ + data->NList_LastInserted = ent; + DO_NOTIFY(NTF_Insert); + } + has_changed = TRUE; + data->moves = FALSE; + + entry[ent-fent].ent = ent1; /* redirect old current where it is now */ + numexch++; + } + } + +//D(DBF_ALWAYS, "qsort stat: %ld exchanges, %ld follows.",numexch,numfollow); + + FreeVecPooled(data->Pool, entry); + } + + RETURN(has_changed); + return ((ULONG)has_changed); +} + + +ULONG NL_List_Sort(struct NLData *data) +{ + LONG has_changed; + + has_changed = NL_List_SortPart(data,0,data->NList_Entries-1); + + if (has_changed || data->do_wwrap) + { + data->sorted = TRUE; + Make_Active_Visible; + UnSelectCharSel(data,FALSE); + if (has_changed) + { DO_NOTIFY(NTF_Select | NTF_LV_Select); + } + if (data->do_wwrap) + NL_DoWrapAll(data,TRUE,FALSE); + data->do_updatesb = TRUE; + REDRAW; + } + +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + return ((ULONG)has_changed); +} + + +//$$$ARRAY+ +static ULONG NL_List_SortMore(struct NLData *data,LONG newpos) +{ + LONG has_changed=0,fent,ment,lent; + int comp; + struct TypeEntry *newentry; + + if (newpos < data->NList_Entries-1) + has_changed = NL_List_SortPart(data,newpos,data->NList_Entries-1); + fent = 0; + + while (newpos < data->NList_Entries) + { + lent = newpos; + while (fent < lent) + { ment = (fent+lent)/2; + comp = NL_SortCompar(data,newpos,ment); + if (comp < 0) + lent = ment; + else + fent = ment+1; + } + if (lent < newpos) + { /* move newpos to lent */ + newentry = data->EntriesArray[newpos]; + + NL_MoveD(&data->EntriesArray[newpos+1],&data->EntriesArray[newpos],newpos-lent,newpos+1); + + data->EntriesArray[lent] = newentry; + data->EntriesArray[lent]->entpos = lent; + + + if ((data->NList_Active >= lent) && (data->NList_Active < newpos)) + { + set_Active(data->NList_Active + 1); + } + else if (data->NList_Active == newpos) + { + set_Active(lent); + } + NL_SegChanged(data,lent,newpos); + data->NList_LastInserted = lent; + DO_NOTIFY(NTF_Insert); + } + newpos++; + } + + if (has_changed || data->do_wwrap) + { + data->sorted = TRUE; + Make_Active_Visible; + UnSelectCharSel(data,FALSE); + if (has_changed) + { DO_NOTIFY(NTF_Select | NTF_LV_Select); + } + if (data->do_wwrap) + NL_DoWrapAll(data,TRUE,FALSE); + data->do_updatesb = TRUE; + REDRAW; + } + return ((ULONG)has_changed); +} + + +//$$$ARRAY+ +ULONG NL_List_Insert(struct NLData *data,APTR *entries,LONG count,LONG pos,LONG wrapcol,LONG align,ULONG flags) +{ + BOOL success = FALSE; + LONG newpos,count2; + BOOL is_string = FALSE; + char *string; + + STARTCLOCK(DBF_ALWAYS); + wrapcol &= TE_Wrap_TmpMask; + if (wrapcol) + { + LONG wrapcol2 = 1; + + while (wrapcol2 < TE_Wrap_TmpLine) + { + if (wrapcol & wrapcol2) + break; + wrapcol2 = wrapcol2 << 1; + } + wrapcol = wrapcol2 & TE_Wrap_TmpMask; + } + + if (entries) + { + LONG ent, ent1, ent2, ent3, maxent, nlentries; + + //D(bug( "Inserting %ld entries at position %ld\n", count, pos )); + + data->display_ptr = NULL; + if (count == -1) + { + count = 0; + while (entries[count] != NULL) + count++; + } + else if (count == -2) + { + is_string = TRUE; + count = 1; + string = (char *) entries; + while (string[0] != '\0') + { + if ((string[0] == '\n') || (string[0] == '\r')) count++; + if ((string[0] == '\r') && (string[1] == '\n')) string++; + string++; + } + string = (char *) entries; + } + else if (count > 0) + { + newpos = 0; + while (newpos < count) + { + if (entries[newpos] == NULL) count--; + newpos++; + } + } + + if (count > 0) + { + maxent = count + data->NList_Entries; + count2 = 0; + + switch (pos) + { + case MUIV_NList_Insert_Top: + newpos = 0; + break; + case MUIV_NList_Insert_Bottom: + newpos = data->NList_Entries; + break; + case MUIV_NList_Insert_Active: + if ((data->NList_Active >= 0) && (data->NList_Active < data->NList_Entries)) + newpos = data->NList_Active; + else + newpos = data->NList_Entries; + break; + case MUIV_NList_Insert_Sorted: + default: + if ((pos >= 0) && (pos < data->NList_Entries)) + newpos = pos; + else + newpos = data->NList_Entries; + break; + } + + if ((newpos >= 0) && (newpos < data->NList_Entries) && (data->EntriesArray[newpos]->Wrap & TE_Wrap_TmpLine)) + newpos -= data->EntriesArray[newpos]->dnum; + data->moves = FALSE; + + if (maxent >= data->LastEntry) + { + struct TypeEntry **newentries = NULL,**oldentries = data->EntriesArray; + LONG le = ((maxent << 1) + 0x00FFL) & ~0x000FL; + + if((newentries = AllocVecPooled(data->Pool, sizeof(struct TypeEntry *) * (le + 1))) != NULL) + { + struct TypeEntry *newentry = NULL; + + //D(bug( "Allocating new entry array at 0x%08lx with %ld entries.\n", newentries, le+1 )); + + data->EntriesArray = newentries; + nlentries = data->NList_Entries; + data->NList_Entries += count; + DO_NOTIFY(NTF_Entries|NTF_MinMax); + data->LastEntry = le; + ent = 0; + ent1 = 0; + ent3 = ent2 = 0; + + if (is_string) + entries = (APTR *)(void*)&string; + else + { + while (!entries[ent2]) + ent2++; + } + + { + LONG de = newpos - ent1; + + if ((maxent - ent) < de) + de = maxent - ent; + + if(de != 0) + { + D(DBF_ALWAYS, "Moving %ld old entries to new array (from %ld to %ld)", de, ent1, ent); + NL_Move(&data->EntriesArray[ent], &oldentries[ent1], de, ent); + + ent += de; + ent1 += de; + } + } + + while ((ent < maxent) && (ent3 < count)) + { + if((newentry = AllocTypeEntry()) != NULL) + { + data->EntriesArray[ent] = newentry; + + newentry->Entry = (APTR) DoMethod(data->this, MUIM_NList_Construct, entries[ent2], data->Pool); + + if (newentry->Entry) + { + newentry->Select = TE_Select_None; + newentry->Wrap = wrapcol; + newentry->PixLen = -1; + newentry->pos = 0; + newentry->len = -1; + newentry->style = align; + newentry->dnum = 1; + newentry->entpos = ent; + data->NList_LastInserted = ent; + if(isFlagClear(flags, MUIV_NList_Insert_Flag_Raw)) + NL_SetColsAdd(data,ent,FALSE); + ent++; + } + else + count2++; + + if (is_string) + { + while ((string[0] != '\0') && (string[0] != '\n') && (string[0] != '\r')) + string++; + if ((string[0] == '\r') && (string[1] == '\n')) + { string++; string++; } + else if ((string[0] == '\n') ||(string[0] == '\r')) + string++; + entries = (APTR *)(void*)&string; + } + else + { + ent2++; + while (!entries[ent2]) + ent2++; + } + ent3++; + } + } + + { + LONG de = nlentries - ent1; + + if ((maxent - ent) < de) + de = maxent - ent; + + if(de != 0) + { + D(DBF_ALWAYS, "Moving %ld old entries to new array (from %ld to %ld)", de, ent1, ent); + NL_Move(&data->EntriesArray[ent], &oldentries[ent1], de, ent); + + ent += de; + } + } + + DO_NOTIFY(NTF_Insert); + + //D(bug( "Deleting pointer in entry %ld.\n", ent )); + + data->EntriesArray[ent] = NULL; + if(oldentries != NULL) + FreeVecPooled(data->Pool, oldentries); + + if(data->NList_Entries != ent) + { + DO_NOTIFY(NTF_Entries|NTF_MinMax); + } + + data->NList_Entries = ent; + count -= count2; + + /* TODO: This stuff here can be merged with the stuff below */ + GetNImage_End(data); + GetNImage_Sizes(data); + if (count > 0) + { + if ((newpos >= data->NList_AffFirst) || data->NList_EntryValueDependent) + NL_SegChanged(data,newpos,data->NList_Entries); + else + data->NList_AffFirst += count; + + if ((data->NList_Active >= newpos) && (data->NList_Active < data->NList_Entries)) + { + set_Active(data->NList_Active + count); + NL_Changed(data,data->NList_Active); + } + + UnSelectCharSel(data,FALSE); + if (wrapcol) + data->do_wwrap = TRUE; + if (pos == MUIV_NList_Insert_Sorted) + { + BOOL needs_redraw; + + NL_SetCols(data); + + /* NL_List_SortXXX returns wheather sorting has changed anything + * and redraws the entries. If sorting hasn't changed anything + * we still have to redraw the list, because there are new entries + * in the list */ + if (data->sorted) + needs_redraw = !NL_List_SortMore(data,newpos); + else + needs_redraw = !NL_List_Sort(data); + + if (needs_redraw) + { + REDRAW; + } + } + else + { + Make_Active_Visible; + data->do_updatesb = TRUE; + data->sorted = FALSE; + REDRAW; + } +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + success = TRUE; + } + } + } + else if (data->EntriesArray) + { + struct TypeEntry *newentry = NULL; + + ent = data->NList_Entries; + nlentries = data->NList_Entries; + data->NList_Entries += count; + DO_NOTIFY(NTF_Entries|NTF_MinMax); + + D(DBF_ALWAYS, "Moving %ld entries (from %ld to %ld)", ent-newpos, ent, ent+count); + NL_MoveD(&data->EntriesArray[ent+count], &data->EntriesArray[ent], ent-newpos, ent+count); + + ent = newpos; + ent3 = ent2 = 0; + + if (is_string) + entries = (APTR *)(void*)&string; + else + { + while (!entries[ent2]) + ent2++; + } + + while ((ent < data->LastEntry) && (ent3 < count)) + { + if((newentry = AllocTypeEntry()) != NULL) + { + data->EntriesArray[ent] = newentry; + + newentry->Entry = (APTR) DoMethod(data->this, MUIM_NList_Construct, entries[ent2], data->Pool); + + if (newentry->Entry) + { + newentry->Select = TE_Select_None; + newentry->Wrap = wrapcol; + newentry->PixLen = -1; + newentry->pos = 0; + newentry->len = -1; + newentry->style = align; + newentry->dnum = 1; + newentry->entpos = ent; + data->NList_LastInserted = ent; + if(isFlagClear(flags, MUIV_NList_Insert_Flag_Raw)) + NL_SetColsAdd(data,ent,FALSE); + ent++; + } + else + count2++; + + if (is_string) + { + while ((string[0] != '\0') && (string[0] != '\n') && (string[0] != '\r')) + string++; + if ((string[0] == '\r') && (string[1] == '\n')) + { string++; string++; } + else if ((string[0] == '\n') ||(string[0] == '\r')) + string++; + entries = (APTR *)(void*)&string; + } + else + { + ent2++; + while (!entries[ent2]) + ent2++; + } + ent3++; + } + } + + data->NList_Entries -= count2; + count -= count2; + if (count2) + { + D(DBF_ALWAYS, "Moving %ld entries (from %ld to %ld)", data->NList_Entries-ent, ent+count2, ent); + NL_Move(&data->EntriesArray[ent], &data->EntriesArray[ent+count2], data->NList_Entries-ent, ent); + } + + DO_NOTIFY(NTF_Insert); + + GetNImage_End(data); + GetNImage_Sizes(data); + + if (count > 0) + { + if ((newpos >= data->NList_AffFirst) || data->NList_EntryValueDependent) + NL_SegChanged(data,newpos,data->NList_Entries); + else + data->NList_AffFirst += count; + + if ((data->NList_Active >= newpos) && (data->NList_Active < data->NList_Entries)) + { + set_Active(data->NList_Active + count); + NL_Changed(data,data->NList_Active); + } + UnSelectCharSel(data,FALSE); + if (wrapcol) + data->do_wwrap = TRUE; + + if (pos == MUIV_NList_Insert_Sorted) + { + int needs_redraw; + + NL_SetCols(data); + + /* NL_List_SortXXX returns wheather sorting has changed anything + * and redraws the entries. If sorting hasn't changed anything + * we still have to redraw the list, because there are new entries + * in the list */ + if (data->sorted) + needs_redraw = !NL_List_SortMore(data,newpos); + else + needs_redraw = !NL_List_Sort(data); + + if (needs_redraw) + { + REDRAW; + } + } else + { + Make_Active_Visible; + data->do_updatesb = TRUE; + data->sorted = FALSE; + REDRAW; + } +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + success = TRUE; + } + } + } + } +STOPCLOCK(DBF_ALWAYS, "insert"); + + return success; +} + + +ULONG NL_List_Replace(struct NLData *data,APTR entry,LONG pos,LONG wrapcol,LONG align) +{ + ULONG result = FALSE; + LONG ent; + + ENTER(); + + wrapcol &= TE_Wrap_TmpMask; + if (wrapcol != 0) + { + LONG wrapcol2 = 1; + + while(wrapcol2 < TE_Wrap_TmpLine) + { + if(wrapcol & wrapcol2) + break; + + wrapcol2 = wrapcol2 << 1; + } + wrapcol = wrapcol2 & TE_Wrap_TmpMask; + } + + switch (pos) + { + case MUIV_NList_Insert_Top: + { + ent = 0; + } + break; + + case MUIV_NList_Insert_Bottom: + { + ent = data->NList_Entries-1; + } + break; + + case MUIV_NList_Insert_Active: + { + // make sure there is an active element + if(data->NList_Active >= 0 && data->NList_Active < data->NList_Entries) + { + ent = data->NList_Active; + } + else + { + // let the replacement fail if there is no active element + ent = -1; + } + } + break; + + case MUIV_NList_Insert_Sorted: + default: + { + // make sure the position is valid + if(pos >= 0 && pos < data->NList_Entries) + { + ent = pos; + } + else + { + // let the replacement fail if the position is invalid + ent = -1; + } + } + break; + } + + SHOWVALUE(DBF_ALWAYS, ent); + + if(ent >= 0 && ent < data->NList_Entries && (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine)) + ent -= data->EntriesArray[ent]->dnum; + + if(entry != NULL && ent >= 0 && ent < data->NList_Entries) + { + // duplicate the given entry + entry = (APTR)DoMethod(data->this, MUIM_NList_Construct, entry, data->Pool); + + if(entry != NULL) + { + data->display_ptr = NULL; + NL_SetColsRem(data,ent); + + if(data->EntriesArray[ent]->Wrap && !(data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine) && data->EntriesArray[ent]->len >= 0) + data->EntriesArray[ent]->pos = (WORD) NL_GetSelects(data,ent); + else + data->EntriesArray[ent]->pos = 0; + + /* I don't understand this line but... ;) */ + if(!(data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine)) + DoMethod(data->this, MUIM_NList_Destruct, data->EntriesArray[ent]->Entry, data->Pool); + + data->EntriesArray[ent]->Entry = entry; + data->EntriesArray[ent]->Wrap = wrapcol; + data->EntriesArray[ent]->PixLen = -1; + data->EntriesArray[ent]->len = -1; + data->EntriesArray[ent]->style = align; + data->EntriesArray[ent]->dnum = 1; + data->EntriesArray[ent]->entpos = ent; + data->NList_LastInserted = ent; + DO_NOTIFY(NTF_Insert); + NL_SetColsAdd(data,ent,TRUE); + NL_Changed(data,ent); + UnSelectCharSel(data,FALSE); + + if(wrapcol != 0) + data->do_wwrap = TRUE; + + data->do_updatesb = TRUE; + data->sorted = FALSE; + + REDRAW; + + result = TRUE; + } + else + result = NL_List_Remove(data,ent); + } + + RETURN(result); + return result; +} + + +//$$$ARRAY+ +ULONG NL_List_Clear(struct NLData *data) +{ + LONG ent = data->NList_Entries - 1; + + STARTCLOCK(DBF_ALWAYS); + DONE_NOTIFY(NTF_Select | NTF_LV_Select); + data->display_ptr = NULL; + NL_SetColsRem(data,-2); + + STARTCLOCK(DBF_ALWAYS); + if(data->EntriesArray) + { + struct TypeEntry **entries = data->EntriesArray; + BOOL notifySelect = FALSE; + + while(ent >= 0) + { + struct TypeEntry *entry = *entries; + + if(entry->Select != TE_Select_None) + notifySelect = TRUE; + + if(isFlagClear(entry->Wrap, TE_Wrap_TmpLine)) + DoMethod(data->this, MUIM_NList_Destruct, entry->Entry, data->Pool); + + FreeTypeEntry(entry); + ent--; + entries++; + } + + FreeVecPooled(data->Pool, data->EntriesArray); + + if(notifySelect == TRUE) + { + DO_NOTIFY(NTF_Select | NTF_LV_Select); + } + } + STOPCLOCK(DBF_ALWAYS, "destruct"); + + data->EntriesArray = NULL; + data->LastEntry = 0; + + if(data->NList_Entries != 0) + { + DO_NOTIFY(NTF_Entries|NTF_MinMax); + data->NList_Entries = 0; + } + + if(data->NList_First != 0) + { + DO_NOTIFY(NTF_First); + data->NList_First = 0; + } + + set_Active(MUIV_NList_Active_Off); + data->NList_Horiz_First = 0; + data->NList_Visible = 0; + data->NList_LastInserted = -1; + data->Title_PixLen = -1; + data->NList_DropMark = 0; + data->sorted = FALSE; + + data->lastselected = MUIV_NList_Active_Off; + data->lastactived = MUIV_NList_Active_Off; + UnSelectCharSel(data,FALSE); + NL_SetColsAdd(data,-1,TRUE); + data->do_parse = data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE; + data->moves = FALSE; + REDRAW_ALL; +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + STOPCLOCK(DBF_ALWAYS, "clear"); + + return (TRUE); +} + + +//$$$ARRAY+ +ULONG NL_List_Remove(struct NLData *data,LONG pos) +{ + LONG ent,ent2,skip,nlentries; + if (pos == MUIV_NList_Remove_First) + ent = 0; + else if (pos == MUIV_NList_Remove_Last) + ent = data->NList_Entries - 1; + else if (pos == MUIV_NList_Remove_Active) + ent = data->NList_Active; + else if (pos == MUIV_NList_Remove_Selected) + { ent2 = 0; + while ((ent2 < data->NList_Entries) && (data->EntriesArray[ent2]->Select == TE_Select_None)) + ent2++; + ent = ent2; + } + else + ent = pos; + if ((ent >= 0) && (ent < data->NList_Entries) && (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine)) + ent -= data->EntriesArray[ent]->dnum; + if ((ent >= 0) && (ent < data->NList_Entries) && data->EntriesArray && (data->LastEntry > 0)) + { + BYTE select; + data->display_ptr = NULL; + data->moves = FALSE; + + ent2 = ent + data->EntriesArray[ent]->dnum; + + if (data->NList_Entries <= 1) + return NL_List_Clear(data); + + skip = FALSE; + nlentries = data->NList_Entries; + + do + { nlentries -= 1; + + if (data->EntriesArray[ent]->Wrap) + data->do_wwrap = TRUE; + + NL_SetColsRem(data,ent); + + if (!(data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine)) + DoMethod(data->this, MUIM_NList_Destruct, data->EntriesArray[ent]->Entry, data->Pool); + + DONE_NOTIFY(NTF_Select | NTF_LV_Select); + + select = data->EntriesArray[ent]->Select; + if (data->EntriesArray[ent]->Select != TE_Select_None) + { + DO_NOTIFY(NTF_Select | NTF_LV_Select); + } + + if ((ent >= data->NList_AffFirst) || data->NList_EntryValueDependent) + { + NL_SegChanged(data,ent,nlentries + 1); + } + else + data->NList_AffFirst--; + + if (data->NList_Active == ent) + { + DO_NOTIFY(NTF_Active | NTF_L_Active); + + if (data->NList_MultiSelect == MUIV_NList_MultiSelect_None) + { + if (ent+1 <= nlentries) + { + if (data->EntriesArray[ent+1]->Select == TE_Select_None) + skip = TRUE; + SELECT(ent+1,TE_Select_Line); + data->lastselected = ent; + data->lastactived = ent; + } + else if (ent-1 >= 0) + { SELECT(ent-1,TE_Select_Line); + data->lastselected = ent-1; + data->lastactived = ent-1; + } + } + else + { + if ((ent+1 <= nlentries) && + (select == TE_Select_Line) && + (data->EntriesArray[ent+1]->Select == TE_Select_None)) + { + if (data->EntriesArray[ent+1]->Select == TE_Select_None) + skip = TRUE; + SELECT(ent+1,TE_Select_Line); + data->lastselected = ent; + data->lastactived = ent; + } + else if ((ent-1 >= 0) && + (select == TE_Select_Line) && + (data->EntriesArray[ent-1]->Select == TE_Select_None)) + { + SELECT(ent-1,TE_Select_Line); + data->lastselected = ent-1; + data->lastactived = ent-1; + } + } + } + else if (data->NList_Active > ent) + { + set_Active(data->NList_Active - 1); + } + if (data->NList_Active >= nlentries) + { + set_Active(nlentries - 1); + } + + FreeTypeEntry(data->EntriesArray[ent]); + + NL_Move(&data->EntriesArray[ent],&data->EntriesArray[ent+1],nlentries-ent,ent); + ent = nlentries; + + data->EntriesArray[ent] = NULL; + + if (pos == MUIV_NList_Remove_Selected) + { + if (skip) + ent = ent2; + else + ent = ent2 - 1; + skip = FALSE; + while ((ent < nlentries) && (data->EntriesArray[ent]->Select == TE_Select_None)) + ent++; + if ((ent >= 0) && (ent < nlentries)) + { + if (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine) + ent -= data->EntriesArray[ent]->dnum; + ent2 = ent + data->EntriesArray[ent]->dnum; + } + } + } while ((pos == MUIV_NList_Remove_Selected) && (ent < nlentries)); + + if (data->NList_Entries != nlentries) + { + DO_NOTIFY(NTF_Entries|NTF_MinMax); + } + + data->NList_Entries = nlentries; + if (data->NList_Entries <= 0) + return NL_List_Clear(data); + +/* + if (data->NList_Entries < ((data->LastEntry/2) & ~0x000FL)) + maxent = (data->LastEntry/2) & ~0x000FL; + + if ((maxent > 0) && (newentries = AllocVecPooled(data->Pool, sizeof(struct TypeEntry *) * (maxent + 1)))) + { LONG ent1 = 0; + data->LastEntry = maxent; + maxent = 0; + + NL_Move(&newentries[ent1],&data->EntriesArray[ent1],data->NList_Entries-ent1,ent1); + ent1 = data->NList_Entries; + + newentries[ent1] = NULL; + if (data->EntriesArray) + FreeVecPooled(data->Pool, data->EntriesArray); + data->EntriesArray = newentries; + } +*/ + + if ((data->NList_First > 0) && (data->NList_First + data->NList_Visible >= data->NList_Entries)) + { + data->NList_First = data->NList_Entries - data->NList_Visible; + if (data->NList_First < 0) + data->NList_First = 0; + DO_NOTIFY(NTF_First); + } + UnSelectCharSel(data,FALSE); + Make_Active_Visible; + data->do_updatesb = TRUE; + REDRAW; +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + + return (TRUE); + } + return (FALSE); +} + + +ULONG NL_List_Exchange(struct NLData *data,LONG pos1,LONG pos2) +{ + LONG ent1, ent2; + switch (pos1) + { + case MUIV_NList_Exchange_Top: + ent1 = 0; + break; + case MUIV_NList_Exchange_Bottom: + ent1 = data->NList_Entries - 1; + break; + case MUIV_NList_Exchange_Active: + ent1 = data->NList_Active; + break; + default: + ent1 = pos1; + break; + } + if ((ent1 >= 0) && (ent1 < data->NList_Entries) && (data->EntriesArray[ent1]->Wrap & TE_Wrap_TmpLine)) + ent1 -= data->EntriesArray[ent1]->dnum; + if ((ent1 >= 0) && (ent1 < data->NList_Entries)) + { + switch (pos2) + { + case MUIV_NList_Exchange_Top: + ent2 = 0; + break; + case MUIV_NList_Exchange_Bottom: + ent2 = data->NList_Entries - 1; + break; + case MUIV_NList_Exchange_Active: + ent2 = data->NList_Active; + break; + case MUIV_NList_Exchange_Next: + ent2 = ent1 + 1; + break; + case MUIV_NList_Exchange_Previous: + ent2 = ent1 - 1; + break; + default: + ent2 = pos2; + break; + } + if ((ent2 >= 0) && (ent2 < data->NList_Entries) && (data->EntriesArray[ent2]->Wrap & TE_Wrap_TmpLine)) + ent2 -= data->EntriesArray[ent2]->dnum; + if ((ent2 >= 0) && (ent2 < data->NList_Entries) && (ent1 != ent2)) + { + struct TypeEntry *newentry; + + data->display_ptr = NULL; + + newentry = data->EntriesArray[ent1]; + if (data->EntriesArray[ent1]->Wrap && !(data->EntriesArray[ent1]->Wrap & TE_Wrap_TmpLine) && (data->EntriesArray[ent1]->len >= 0)) + { + newentry->pos = (WORD) NL_GetSelects(data,ent1); + newentry->len = -1; + data->do_wwrap = TRUE; + } + + data->EntriesArray[ent1] = data->EntriesArray[ent2]; + data->EntriesArray[ent1]->entpos = ent1; + if (data->EntriesArray[ent2]->Wrap && !(data->EntriesArray[ent2]->Wrap & TE_Wrap_TmpLine) && (data->EntriesArray[ent2]->len >= 0)) + { + data->EntriesArray[ent1]->pos = (WORD) NL_GetSelects(data,ent2); + data->EntriesArray[ent1]->len = -1; + data->do_wwrap = TRUE; + } + + data->EntriesArray[ent2] = newentry; + data->EntriesArray[ent2]->entpos = ent2; + + if (data->NList_Active == ent1) + { + set_Active(ent2); + } + else if (data->NList_Active == ent2) + { + set_Active(ent1); + } + if ((ent1 >= data->NList_First) && (ent1 < data->NList_First+data->NList_Visible)) + NL_Changed(data,ent1); + if ((ent2 >= data->NList_First) && (ent2 < data->NList_First+data->NList_Visible)) + NL_Changed(data,ent2); + UnSelectCharSel(data,FALSE); + Make_Active_Visible; + NL_DoWrapAll(data,FALSE,FALSE); + data->do_updatesb = TRUE; + data->sorted = FALSE; + REDRAW; +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + return (TRUE); + } + } + return (FALSE); +} + + +//$$$ARRAY+ +ULONG NL_List_Move_Selected(struct NLData *data,LONG to) +{ + LONG num_sel = 0; + long first,last,ent,ent2,ent3,act,act2,dest; + struct TypeEntry **EntriesArray; + + first = last = -1; + if (!data->NList_TypeSelect) + { + ent = 0; + while (ent < data->NList_Entries) + { + if (data->EntriesArray[ent]->Select != TE_Select_None) + { + if (data->EntriesArray[ent]->Wrap) + { + if (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine) + ent -= data->EntriesArray[ent]->dnum; + if (data->EntriesArray[ent]->Wrap && (data->EntriesArray[ent]->len >= 0)) + { + data->EntriesArray[ent]->pos = (WORD) NL_GetSelects(data,ent); + data->EntriesArray[ent]->len = -1; + data->do_wwrap = TRUE; + } + if (first == -1) + first = ent; + ent2 = ent; + last = ent + data->EntriesArray[ent]->dnum; + data->EntriesArray[ent]->Select = TE_Select_Line; + num_sel++; + ent++; + while ((ent < data->NList_Entries) && (ent < last) && (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine)) + { + data->EntriesArray[ent]->Select = TE_Select_Line; + data->EntriesArray[ent]->dnum = ent - ent2; + num_sel++; + ent++; + } + data->EntriesArray[ent2]->dnum = ent - ent2; + last = ent - 1; + } + else + { + if (first == -1) + first = ent; + last = ent; + num_sel++; + ent++; + } + } + else + ent++; + } + } + else + { + first = data->sel_pt[data->min_sel].ent; + last = data->sel_pt[data->max_sel].ent; + if ((data->sel_pt[data->max_sel].column == 0) && (data->sel_pt[data->max_sel].xoffset == PMIN)) + last--; + if ((first >= 0) && (first < data->NList_Entries) && (data->EntriesArray[first]->Wrap & TE_Wrap_TmpLine)) + first -= data->EntriesArray[first]->dnum; + if ((last >= 0) && (last < data->NList_Entries) && (data->EntriesArray[last]->Wrap & TE_Wrap_TmpLine)) + { last -= data->EntriesArray[last]->dnum; + if ((last >= 0) && (last < data->NList_Entries)) + last += data->EntriesArray[last]->dnum - 1; + } + if ((first >= 0) && (first < data->NList_Entries) && (last >= 0) && (last < data->NList_Entries) && (first <= last)) + num_sel = last - first + 1; + } + if (num_sel <= 0) + return (TRUE); + else if (num_sel == 1) + return NL_List_Move(data,last,to); + else + { + switch (to) + { + case MUIV_NList_Move_Top: + dest = 0; + break; + case MUIV_NList_Move_Bottom: + dest = data->NList_Entries; + break; + case MUIV_NList_Move_Active: + dest = data->NList_Active; + break; + default: + dest = to; + if ((dest < 0) || (dest > data->NList_Entries)) + dest = data->NList_Entries; + break; + } + if ((dest >= 0) && (dest < data->NList_Entries) && (data->EntriesArray[dest]->Wrap & TE_Wrap_TmpLine)) + dest -= data->EntriesArray[dest]->dnum; + + if ((last-first+1 == num_sel) && (first <= dest) && (dest <= last+1)) + { + if (data->do_wwrap) + { + NL_DoWrapAll(data,FALSE,FALSE); + REDRAW; + } + return (TRUE); + } + else if((EntriesArray = (struct TypeEntry **)AllocVecPooled(data->Pool, sizeof(struct TypeEntry *)*num_sel)) != NULL) + { + data->display_ptr = NULL; + ent = ent2 = first; + ent3 = 0; + act = data->NList_Active; + act2 = MUIV_NList_Active_Off; + + while (ent < data->NList_Entries) + { + if ((!data->NList_TypeSelect && (data->EntriesArray[ent]->Select != TE_Select_None)) || + (data->NList_TypeSelect && (ent >= first) && (ent <= last))) + { + if (dest > ent2) + dest--; + if (data->NList_Active == ent) + act2 = ent3; + else if (act > ent2) + act--; + EntriesArray[ent3] = data->EntriesArray[ent]; + EntriesArray[ent3]->entpos = ent3; + ent3++; + } + else + { + data->EntriesArray[ent2] = data->EntriesArray[ent]; + data->EntriesArray[ent2]->entpos = ent2; + if (data->EntriesArray[ent]->Wrap && !(data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine) && (data->EntriesArray[ent]->len >= 0)) + { + data->EntriesArray[ent2]->pos = (WORD) NL_GetSelects(data,ent); + data->EntriesArray[ent2]->len = -1; + data->do_wwrap = TRUE; + } + ent2++; + } + ent++; + } + if (act2 >= 0) + { + set_Active(dest + act2); + } + else if (act >= dest) + { + set_Active(act + ent3); + } + else + { + set_Active(act); + } + data->NList_LastInserted = dest; + DO_NOTIFY(NTF_Insert); + ent2--; + while (ent2 >= dest) + { + data->EntriesArray[ent2+ent3] = data->EntriesArray[ent2]; + data->EntriesArray[ent2+ent3]->entpos = ent2+ent3; + if (data->EntriesArray[ent2]->Wrap && !(data->EntriesArray[ent2]->Wrap & TE_Wrap_TmpLine) && (data->EntriesArray[ent2]->len >= 0)) + { + data->EntriesArray[ent2+ent3]->pos = (WORD) NL_GetSelects(data,ent2); + data->EntriesArray[ent2+ent3]->len = -1; + data->do_wwrap = TRUE; + } + ent2--; + } + ent2++; + + NL_Move(&data->EntriesArray[ent2],&EntriesArray[0],ent3,ent2); + FreeVecPooled(data->Pool, EntriesArray); + + if (dest < first) + first = dest; + if (dest+ent3 > last) + last = dest+ent3; + + NL_SegChanged(data,first,last); + UnSelectCharSel(data,FALSE); + Make_Active_Visible; + NL_DoWrapAll(data,FALSE,FALSE); + data->do_updatesb = TRUE; + REDRAW; +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + return (TRUE); + } + else if (data->do_wwrap) + { + NL_DoWrapAll(data,FALSE,FALSE); + REDRAW; + } + } + return (FALSE); +} + + +//$$$ARRAY+ +ULONG NL_List_Move(struct NLData *data,LONG from,LONG to) +{ + LONG ent1, ent2; + + if(from == MUIV_NList_Move_Selected) + return NL_List_Move_Selected(data, to); + + switch(from) + { + case MUIV_NList_Move_Top: + ent1 = 0; + break; + + case MUIV_NList_Move_Bottom: + ent1 = data->NList_Entries - 1; + break; + + case MUIV_NList_Move_Active: + ent1 = data->NList_Active; + break; + + default: + ent1 = from; + break; + } + + if(ent1 >= 0 && ent1 < data->NList_Entries && isFlagSet(data->EntriesArray[ent1]->Wrap, TE_Wrap_TmpLine)) + ent1 -= data->EntriesArray[ent1]->dnum; + + if(ent1 >= 0 && ent1 < data->NList_Entries) + { + switch(to) + { + case MUIV_NList_Move_Top: + ent2 = 0; + break; + + case MUIV_NList_Move_Bottom: + ent2 = data->NList_Entries - 1; + break; + + case MUIV_NList_Move_Active: + ent2 = data->NList_Active; + break; + + case MUIV_NList_Move_Next: + ent2 = ent1 + 1; + break; + + case MUIV_NList_Move_Previous: + ent2 = ent1 - 1; + break; + + default: + ent2 = to; + break; + } + + if(ent2 >= 0 && ent2 < data->NList_Entries && isFlagSet(data->EntriesArray[ent2]->Wrap, TE_Wrap_TmpLine)) + ent2 -= data->EntriesArray[ent2]->dnum; + + if(ent2 >= 0 && ent2 < data->NList_Entries && ent1 != ent2) + { + struct TypeEntry *newentry; + + data->display_ptr = NULL; + + if(ent1 < ent2) + { + if(data->EntriesArray[ent2]->Wrap != 0 && isFlagClear(data->EntriesArray[ent2]->Wrap, TE_Wrap_TmpLine)) + ent2 += (data->EntriesArray[ent2]->dnum - 1); + + newentry = data->EntriesArray[ent1]; + + if(data->EntriesArray[ent1]->Wrap != 0 && isFlagClear(data->EntriesArray[ent1]->Wrap, TE_Wrap_TmpLine) && data->EntriesArray[ent1]->len >= 0) + { + newentry->pos = (WORD)NL_GetSelects(data, ent1); + newentry->len = -1; + data->do_wwrap = TRUE; + } + + NL_Move(&data->EntriesArray[ent1], &data->EntriesArray[ent1+1], ent2-ent1, ent1); + + data->EntriesArray[ent2] = newentry; + data->EntriesArray[ent2]->entpos = ent2; + + if(data->NList_Active > ent1 && data->NList_Active <= ent2) + { + set_Active(data->NList_Active - 1); + } + else if(data->NList_Active == ent1) + { + set_Active(ent2); + } + NL_SegChanged(data, ent1, ent2); + data->NList_LastInserted = ent2; + DO_NOTIFY(NTF_Insert); + } + else + { + newentry = data->EntriesArray[ent1]; + + if(data->EntriesArray[ent1]->Wrap != 0 && isFlagClear(data->EntriesArray[ent1]->Wrap, TE_Wrap_TmpLine) && data->EntriesArray[ent1]->len >= 0) + { + newentry->pos = (WORD)NL_GetSelects(data, ent1); + newentry->len = -1; + data->do_wwrap = TRUE; + } + + NL_MoveD(&data->EntriesArray[ent1+1], &data->EntriesArray[ent1], ent1-ent2, ent1+1); + + data->EntriesArray[ent2] = newentry; + data->EntriesArray[ent2]->entpos = ent2; + + if(data->NList_Active >= ent2 && data->NList_Active < ent1) + { + set_Active(data->NList_Active + 1); + } + else if(data->NList_Active == ent1) + { + set_Active(ent2); + } + NL_SegChanged(data,ent2,ent1); + data->NList_LastInserted = ent2; + DO_NOTIFY(NTF_Insert); + } + data->sorted = FALSE; + UnSelectCharSel(data, FALSE); + Make_Active_Visible; + NL_DoWrapAll(data, FALSE, FALSE); + data->do_updatesb = TRUE; + REDRAW; +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + return (TRUE); + } + } + return (FALSE); +} + + + +IPTR mNL_List_Sort(struct IClass *cl, Object *obj, UNUSED struct MUIP_NList_Sort *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + return (NL_List_Sort(data)); +} + + +IPTR mNL_List_Sort2(struct IClass *cl,Object *obj,struct MUIP_NList_Sort2 *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + if ((msg->sort_type_add) && ((data->NList_SortType & ~MUIV_NList_SortTypeAdd_Mask) == (ULONG)msg->sort_type)) + data->NList_SortType += msg->sort_type_add; + else + data->NList_SortType = msg->sort_type; + set(obj,MUIA_NList_SortType,data->NList_SortType); + return (NL_List_Sort(data)); +} + + +IPTR mNL_List_Sort3(struct IClass *cl,Object *obj,struct MUIP_NList_Sort3 *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + if (msg->which == MUIV_NList_Sort3_SortType_2) + { + if ((msg->sort_type_add) && ((data->NList_SortType2 & ~MUIV_NList_SortTypeAdd_Mask) == (ULONG)msg->sort_type)) + data->NList_SortType2 += msg->sort_type_add; + else + data->NList_SortType2 = msg->sort_type; + set(obj,MUIA_NList_SortType2,data->NList_SortType2); + } + else + { + if ((msg->sort_type_add) && ((data->NList_SortType & ~MUIV_NList_SortTypeAdd_Mask) == (ULONG)msg->sort_type)) + data->NList_SortType += msg->sort_type_add; + else + data->NList_SortType = msg->sort_type; + if (msg->which == MUIV_NList_Sort3_SortType_1) + { set(obj,MUIA_NList_SortType,data->NList_SortType); + } + else + { data->NList_SortType2 = data->NList_SortType; + set(obj,MUIA_NList_SortType,data->NList_SortType); + set(obj,MUIA_NList_SortType2,data->NList_SortType2); + } + } + return (NL_List_Sort(data)); +} + + +IPTR mNL_List_Insert(struct IClass *cl,Object *obj,struct MUIP_NList_Insert *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + return (NL_List_Insert(data,msg->entries,msg->count,msg->pos,NOWRAP,ALIGN_LEFT,msg->flags)); +} + + +IPTR mNL_List_InsertSingle(struct IClass *cl,Object *obj,struct MUIP_NList_InsertSingle *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + if (msg->entry) + return (NL_List_Insert(data,&(msg->entry),1,msg->pos,NOWRAP,ALIGN_LEFT,0)); + return (0); +} + + +IPTR mNL_List_InsertWrap(struct IClass *cl,Object *obj,struct MUIP_NList_InsertWrap *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + return (NL_List_Insert(data,msg->entries,msg->count,msg->pos,msg->wrapcol,msg->align & ALIGN_MASK,msg->flags)); +} + + +IPTR mNL_List_InsertSingleWrap(struct IClass *cl,Object *obj,struct MUIP_NList_InsertSingleWrap *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + if (msg->entry) + return (NL_List_Insert(data,&(msg->entry),1,msg->pos,msg->wrapcol,msg->align & ALIGN_MASK,0)); + return (0); +} + + +IPTR mNL_List_ReplaceSingle(struct IClass *cl,Object *obj,struct MUIP_NList_ReplaceSingle *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + return (NL_List_Replace(data,msg->entry,msg->pos,msg->wrapcol,msg->align & ALIGN_MASK)); +} + + +IPTR mNL_List_Exchange(struct IClass *cl,Object *obj,struct MUIP_NList_Exchange *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + return (NL_List_Exchange(data,msg->pos1,msg->pos2)); +} + + +IPTR mNL_List_Move(struct IClass *cl,Object *obj,struct MUIP_NList_Move *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + return (NL_List_Move(data,msg->from,msg->to)); +} + + +IPTR mNL_List_Clear(struct IClass *cl, Object *obj, UNUSED struct MUIP_NList_Clear *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + return (NL_List_Clear(data)); +} + + +IPTR mNL_List_Remove(struct IClass *cl,Object *obj,struct MUIP_NList_Remove *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + return (NL_List_Remove(data,msg->pos)); +} + + + +#define DROPMARK_NONE -1 +#define DROPMARK_START -2 + + + +IPTR mNL_DragQuery(struct IClass *cl,Object *obj,struct MUIP_DragQuery *msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + if (data->NList_Disabled) + { +/*D(bug("%lx| 1 DragQuery_Refuse\n",obj));*/ + return (MUIV_DragQuery_Refuse); + } + if ((msg->obj==obj) && (data->NList_DragSortable)) + { +/*D(bug("%lx| 3 DragQuery_Accept\n",obj));*/ + return(MUIV_DragQuery_Accept); + } +/*D(bug("%lx| 3 DragQuery_Refuse\n",obj));*/ + return(MUIV_DragQuery_Refuse); +} + + +IPTR mNL_DragBegin(struct IClass *cl,Object *obj,struct MUIP_DragBegin *msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + data->NList_DropMark = DROPMARK_START; + if (data->NList_Disabled) + return (0); + if ((data->NList_ShowDropMarks || (msg->obj==obj)) && (data->NList_Entries > 0)) + return(0); + return(DoSuperMethodA(cl,obj,(Msg) msg)); +} + + +IPTR mNL_DragReport(struct IClass *cl,Object *obj,struct MUIP_DragReport *msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + LONG mdy,type,lyl = DROPMARK_NONE; + + if (data->NList_Disabled) + { +/*D(bug("%lx| 1 DragReport_Abort\n",obj));*/ + return (MUIV_DragReport_Abort); + } + data->dropping = TRUE; + if (msg->update) + { LONG drawnum = -1,erasenum = -1; + if (data->markdraw && (data->markdrawnum >= 0)) + drawnum = data->markdrawnum; + if (data->markerase && (data->markerasenum >= 0) && (data->markerasenum != drawnum)) + erasenum = data->markerasenum; + if ((drawnum >= 0) || (erasenum >= 0)) + { if ((DoMethod(obj,MUIM_NList_DropEntryDrawErase, data->marktype,drawnum, erasenum) != MUIM_NList_DropEntryDrawErase) && + (drawnum >= 0)) + NL_Changed(data,drawnum); + } + data->display_ptr = NULL; + data->parse_column = -1; + REDRAW_FORCE; + if (data->NList_SerMouseFix) + return(MUIV_DragReport_Continue); + else + return(MUIV_DragReport_Lock); + } + else if ((msg->x >= _left(obj)) && (msg->x <= _right(obj))) + { type = MUIV_NList_DropType_Above; + if (data->NList_DropMark == DROPMARK_START) + { data->NList_DropMark = DROPMARK_NONE; + if (data->markdrawnum == (LONG)MUIM_NList_Trigger) + data->markdrawnum = 0; + else if ((msg->x > data->mleft+6) && (msg->x < data->mright-6)) + { if (msg->y < data->vpos+4) + lyl = 0; + else if (msg->y > data->mbottom-4) + lyl = data->NList_Entries; + } + } + if (lyl < 0) + { LONG ly = (msg->y - data->vpos); + /*lyl = (ly + data->vinc/2) / data->vinc + data->NList_First;*/ + lyl = ly / data->vinc + data->NList_First; + if ((ly % data->vinc) >= (data->vinc / 2)) + type = MUIV_NList_DropType_Below; + if (lyl >= data->NList_First + data->NList_Visible) + { if (msg->y > data->mbottom+40) + lyl = data->NList_First + data->NList_Visible + 7; + else if (msg->y > data->mbottom+24) + lyl = data->NList_First + data->NList_Visible + 3; + else if (msg->y > data->mbottom+8) + lyl = data->NList_First + data->NList_Visible + 1; + else + lyl = data->NList_First + data->NList_Visible; + } + if ((ly < 0) || (lyl < data->NList_First)) + { if (msg->y < data->vpos-40) + lyl = data->NList_First - 8; + else if (msg->y < data->vpos-24) + lyl = data->NList_First - 4; + else if (msg->y < data->vpos-8) + lyl = data->NList_First - 2; + else + lyl = data->NList_First - 1; + if (lyl < 0) + lyl = 0; + } + } + if (data->NList_Entries == 0) + { lyl = 0; + type = MUIV_NList_DropType_Above; + } + else if (lyl >= data->NList_Entries) + { lyl = data->NList_Entries - 1; + type = MUIV_NList_DropType_Below; + } + mdy = data->vpos + (data->vinc * (lyl - data->NList_First)); + DoMethod(obj,MUIM_NList_DropType, &lyl,&type, data->mleft,data->mright, + mdy,mdy+data->vinc-1, msg->x,msg->y); + if ((type & MUIV_NList_DropType_Mask) == MUIV_NList_DropType_Below) + { lyl++; + type = (type & ~MUIV_NList_DropType_Mask) | MUIV_NList_DropType_Above; + } + if (data->NList_Entries == 0) + { lyl = 0; + type = (type & ~MUIV_NList_DropType_Mask) | MUIV_NList_DropType_Above; + } + else if (lyl >= data->NList_Entries) + { lyl = data->NList_Entries - 1; + type = (type & ~MUIV_NList_DropType_Mask) | MUIV_NList_DropType_Below; + } + + if ((data->NList_DropMark != lyl) || (type != data->marktype)) + { if (data->NList_DropMark >= 0) + data->markerase = TRUE; + data->markdraw = TRUE; + if (lyl >= -1) + data->NList_DropMark = lyl; + if (data->NList_DropMark >= 0) + { + if (data->NList_DropMark < data->NList_First) + { data->NList_First = data->NList_DropMark; + DO_NOTIFY(NTF_First); + } + if (data->NList_DropMark >= data->NList_First + data->NList_Visible) + { data->NList_First = data->NList_DropMark - data->NList_Visible + 1; + DO_NOTIFY(NTF_First); + } + if (data->NList_First < 0) + { data->NList_First = 0; + DO_NOTIFY(NTF_First); + } + data->markdrawnum = data->NList_DropMark; + data->marktype = type; + if ((data->NList_ShowDropMarks || (msg->obj==obj)) && (data->NList_Entries > 0)) + return(MUIV_DragReport_Refresh); + else + { data->markerase = FALSE; + data->markdraw = FALSE; + if (data->NList_First != data->NList_AffFirst) + return(MUIV_DragReport_Refresh); + } + } + else if (data->markerase) + { data->markdraw = FALSE; + if ((data->NList_ShowDropMarks || (msg->obj==obj)) && (data->NList_Entries > 0)) + return(MUIV_DragReport_Refresh); + } + } + if (data->NList_SerMouseFix) + return(MUIV_DragReport_Continue); + else + return(MUIV_DragReport_Lock); + } +/*D(bug("%lx| 2 DragReport_Abort\n",obj));*/ + return(MUIV_DragReport_Abort); +} + + +IPTR mNL_DragFinish(struct IClass *cl,Object *obj,struct MUIP_DragFinish *msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + if (data->NList_DropMark == DROPMARK_START) + data->NList_DropMark = DROPMARK_NONE; + if (data->NList_Disabled) + return (0); + if ((data->NList_ShowDropMarks || (msg->obj==obj)) && (data->NList_Entries > 0)) + { if (data->NList_DropMark >= 0) + { data->markdraw = FALSE; + data->markerase = TRUE; + if (data->markerase && (data->markerasenum >= 0)) + DoMethod(obj,MUIM_NList_DropEntryDrawErase, 0,-1,data->markerasenum); + data->display_ptr = NULL; + data->parse_column = -1; + REDRAW_FORCE; + } + data->dropping = FALSE; + return(0); + } + data->dropping = FALSE; + return(DoSuperMethodA(cl,obj,(Msg) msg)); +} + + +IPTR mNL_DragDrop(struct IClass *cl,Object *obj,struct MUIP_DragDrop *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + LONG ent = data->NList_DropMark; + + if (data->NList_Disabled) + return (0); + + if (data->NList_DragSortable && (msg->obj==obj) && (ent >= 0) && (data->marktype & MUIV_NList_DropType_Mask)) + { + LONG li,res; + if ((data->marktype & MUIV_NList_DropType_Mask) == MUIV_NList_DropType_Below) + ent++; + li = data->NList_LastInserted; + data->NList_LastInserted = -1; + res = NL_List_Move_Selected(data,ent); + if (data->NList_LastInserted >= 0) + { + DO_NOTIFY(NTF_DragSortInsert); + } + else + data->NList_LastInserted = li; + + return ((ULONG)res); + } + return(0); +} + + +IPTR mNL_DropType(UNUSED struct IClass *cl, UNUSED Object *obj, UNUSED struct MUIP_NList_DropType *msg) +{ + /*register struct NLData *data = INST_DATA(cl,obj);*/ + return(0); +} + +IPTR mNL_DropEntryDrawErase(UNUSED struct IClass *cl, UNUSED Object *obj, UNUSED struct MUIP_NList_DropEntryDrawErase *msg) +{ + /*register struct NLData *data = INST_DATA(cl,obj);*/ + return(MUIM_NList_DropEntryDrawErase); +} diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_func3.c b/workbench/classes/zune/nlist/nlist_mcc/NList_func3.c new file mode 100644 index 0000000000..b175a8bdae --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_func3.c @@ -0,0 +1,914 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <string.h> +#include <ctype.h> + +#include <dos/dos.h> +#include <exec/memory.h> +#include <libraries/iffparse.h> +#include <proto/console.h> +#include <proto/utility.h> +#include <proto/exec.h> +#include <proto/dos.h> +#include <proto/iffparse.h> + +#include "private.h" + +#include "NList_func.h" + +IPTR MyCallHookPkt(Object *obj,BOOL hdata,struct Hook *hook,APTR object,APTR message) +{ + if (hdata) + { IPTR retval; + APTR h_Data = hook->h_Data; + if (!h_Data) + hook->h_Data = obj; + retval = CallHookPkt(hook,object,message); + if (!h_Data) + hook->h_Data = h_Data; + return (retval); + } + else + return (CallHookPkt(hook,object,message)); +} + +#ifdef __AROS__ +/* AROS uses a macro to handle this */ +#else +IPTR STDARGS VARARGS68K MyCallHookPktA(Object *obj, struct Hook *hook, ...) +{ + IPTR ret; + VA_LIST va; + + VA_START(va, hook); + ret = CallHookPkt(hook, obj, VA_ARG(va, APTR)); + VA_END(va); + + return ret; +} +#endif + +LONG DeadKeyConvert(struct NLData *data,struct IntuiMessage *msg,STRPTR buf,LONG bufsize,struct KeyMap *kmap) +{ + int posraw,pos,postext = 0; + STRPTR text = buf; + + if (msg->Class != IDCMP_RAWKEY) + return (-2); + + text[0] = '\0'; +/* + * if (msg->Qualifier) + * { D(bug("Qual:")); + * if (msg->Qualifier & IEQUALIFIER_LSHIFT) D(bug("lshift ")); + * if (msg->Qualifier & IEQUALIFIER_RSHIFT) D(bug("rshift ")); + * if (msg->Qualifier & IEQUALIFIER_CAPSLOCK) D(bug("capslock ")); + * if (msg->Qualifier & IEQUALIFIER_CONTROL) D(bug("ctrl ")); + * if (msg->Qualifier & IEQUALIFIER_LALT) D(bug("lalt ")); + * if (msg->Qualifier & IEQUALIFIER_RALT) D(bug("ralt ")); + * if (msg->Qualifier & IEQUALIFIER_LCOMMAND) D(bug("lcommand ")); + * if (msg->Qualifier & IEQUALIFIER_RCOMMAND) D(bug("rcommand ")); + * if (msg->Qualifier & IEQUALIFIER_NUMERICPAD) D(bug("numpad ")); + * if (msg->Qualifier & IEQUALIFIER_REPEAT) D(bug("repeat ")); + * if (msg->Qualifier & IEQUALIFIER_MIDBUTTON) D(bug("mbutton ")); + * if (msg->Qualifier & IEQUALIFIER_RBUTTON) D(bug("rbutton ")); + * if (msg->Qualifier & IEQUALIFIER_LEFTBUTTON) D(bug("lbutton ")); + * D(bug("\n")); + * } + */ + switch (msg->Code & 0x7F) + { + case 0x41 : strlcpy(text,"bs", bufsize); break; + case 0x42 : strlcpy(text,"tab", bufsize); break; + case 0x43 : strlcpy(text,"enter", bufsize); break; + case 0x44 : strlcpy(text,"return", bufsize); break; + case 0x45 : strlcpy(text,"esc", bufsize); break; + case 0x46 : strlcpy(text,"del", bufsize); break; + case 0x4C : strlcpy(text,"up", bufsize); break; + case 0x4D : strlcpy(text,"down", bufsize); break; + case 0x4E : strlcpy(text,"right", bufsize); break; + case 0x4F : strlcpy(text,"left", bufsize); break; + case 0x50 : strlcpy(text,"f1", bufsize); break; + case 0x51 : strlcpy(text,"f2", bufsize); break; + case 0x52 : strlcpy(text,"f3", bufsize); break; + case 0x53 : strlcpy(text,"f4", bufsize); break; + case 0x54 : strlcpy(text,"f5", bufsize); break; + case 0x55 : strlcpy(text,"f6", bufsize); break; + case 0x56 : strlcpy(text,"f7", bufsize); break; + case 0x57 : strlcpy(text,"f8", bufsize); break; + case 0x58 : strlcpy(text,"f9", bufsize); break; + case 0x59 : strlcpy(text,"f10", bufsize); break; + case 0x5F : strlcpy(text,"help", bufsize); break; + default: + data->ievent.ie_NextEvent = NULL; + data->ievent.ie_Class = IECLASS_RAWKEY; + data->ievent.ie_SubClass = 0; + data->ievent.ie_Code = msg->Code; + data->ievent.ie_Qualifier = 0; + data->ievent.ie_position.ie_addr = *((APTR *) msg->IAddress); + posraw = RawKeyConvert(&data->ievent,text,bufsize-postext-1,kmap); + if (posraw >= 0) + text[posraw+postext] = '\0'; + if (posraw > 0) + { + ULONG realc; + data->rawtext[posraw] = '\0'; + for (pos = 0; pos < posraw; pos++) + { + realc = data->rawtext[pos]; +/*D(bug("RAWKEY KEY=%ld \n",realc));*/ + if ((realc <= 0x1F)||((realc >= 0x80)&&(realc < 0xa0))) + data->rawtext[pos] = 0x7f; + } + } + break; + } + return ((LONG)strlen(buf)); +} + + +/*static char *stpncpy_noesc(char *to,const char *from,int len)*/ +static char *stpncpy_noesc(char *to,char *from,int len) +{ + register char *to2 = to; + + while (*from && (len > 0)) + { if (*from == '\033') + { from++; + len--; + if ((*from == 'P') || (*from == 'I') || (*from == 'O') || (*from == 'o')) + { from++; + len--; + if (*from == '[') + { while ((*from) && (*from != ']')) + { from++; + len--; + } + if (*from == ']') + { from++; + len--; + } + } + } + else if (*from) + { from++; + len--; + } + } + else + { *to2++ = *from++; + len--; + } + } + *to2 = '\0'; + return (to2); +} + +#define FORMAT_TEMPLATE "DELTA=D/N,PREPARSE=P/K,COL=C/N,BAR/S,TBAR/S,NOBAR=NB/S,SIMPLEBAR=SBAR/S,"\ + "NOTITLEBUTTON=NOTB/S,WEIGHT=W/N,MINWIDTH=MIW/N,MAXWIDTH=MAW/N,"\ + "COLWIDTH=CW/N,MINCOLWIDTH=MICW/N,MAXCOLWIDTH=MACW/N,"\ + "PIXWIDTH=PW/N,MINPIXWIDTH=MIPW/N,MAXPIXWIDTH=MAPW/N,"\ + "PARTCOLSUBST=PCS/K\n" + +struct parse_format +{ + LONG *delta; + LONG *preparse; + LONG *col; + LONG bar; + LONG tbar; + LONG nobar; + LONG sbar; + LONG notb; + LONG *weight; + LONG *minwidth; + LONG *maxwidth; + LONG *colwidth; + LONG *mincolwidth; + LONG *maxcolwidth; + LONG *pixwidth; + LONG *minpixwidth; + LONG *maxpixwidth; + LONG *partcolsubst; +}; + + +void NL_Free_Format(struct NLData *data) +{ + if (data->cols) + { WORD column = 0; + while (column < data->numcols) + { + if(data->cols[column].preparse != NULL) + FreeVecPooled(data->Pool, data->cols[column].preparse); + + column++; + } + FreeVecPooled(data->Pool, data->cols); + } + data->cols = NULL; + data->numcols = data->numcols2 = 0; + data->format_chge = 1; +} + + +BOOL NL_Read_Format(struct NLData *data,char *strformat,BOOL oldlist) +{ + LONG column,colmax,pos1,pos2,col = 0; + char *sf = NULL; + struct RDArgs *rdargs,*ptr; + struct parse_format Line; + struct colinfo *tmpcols; + + if (strformat && (sf = AllocVecPooled(data->Pool, strlen(strformat)+4)) != NULL) + { + if((ptr = AllocDosObject(DOS_RDARGS, NULL))) + { + colmax = 1; + pos2 = 0; + while (strformat[pos2] != '\0') + { if (strformat[pos2] == ',') + colmax++; + pos2++; + } + if ((colmax > 0) && (colmax < DISPLAY_ARRAY_MAX) && (tmpcols = AllocVecPooled(data->Pool, (colmax+1)*sizeof(struct colinfo))) != NULL) + { + NL_Free_Format(data); + data->cols = tmpcols; + data->numcols = data->numcols2 = colmax; + column = 0; + while (column < colmax) + { + data->cols[column].c = &(data->cols[column]); + data->cols[column].preparse = NULL; + data->cols[column].colwidthmax = (WORD) -1; + data->cols[column].colwidthbiggest = (WORD) -1; + data->cols[column].colwidthbiggestptr = (LONG) -2; + data->cols[column].delta = (WORD) 4; + data->cols[column].col = (WORD) column; + data->cols[column].userwidth = (WORD) -1; + data->cols[column].titlebutton = (WORD) TRUE; + if ((column == colmax-1) && !(oldlist && (column == 0))) + data->cols[column].width = (WORD) 100; + else + data->cols[column].width = (WORD) -1; + data->cols[column].minwidth = (WORD) 5; + data->cols[column].maxwidth = (WORD) 0; + data->cols[column].mincolwidth = (WORD) 0; + data->cols[column].maxcolwidth = (WORD) 0; + data->cols[column].minpixwidth = (WORD) 6; + data->cols[column].maxpixwidth = (WORD) 0; + data->cols[column].bar = (BYTE) 2; + data->cols[column].width_type = (BYTE) CI_PERCENT; + data->cols[column].partcolsubst = PCS_DISABLED; + column++; + } + column = 0; + pos2 = 0; + while (strformat[pos2] && (column < colmax)) + { pos1 = 0; + while ((strformat[pos2] != ',') && (strformat[pos2] != '\0')) + sf[pos1++] = strformat[pos2++]; + sf[pos1++] = '\n'; + sf[pos1++] = '\0'; + if (strformat[pos2] != '\0') + pos2++; +/*D(bug("col %ld ->%s",column,sf));*/ + + ptr->RDA_Source.CS_Buffer = sf; + ptr->RDA_Source.CS_Length = strlen(sf); + ptr->RDA_Source.CS_CurChr = 0; + ptr->RDA_DAList = 0; + ptr->RDA_Buffer = NULL; + ptr->RDA_BufSiz = 0L; + ptr->RDA_ExtHelp = NULL; + ptr->RDA_Flags = 0L; + + // clear the Line structure + memset(&Line, 0, sizeof(Line)); + + if((rdargs = ReadArgs(FORMAT_TEMPLATE, (APTR)&Line, ptr))) + { + if (Line.delta) data->cols[column].delta = (WORD) *Line.delta; + if (Line.preparse) + { + int len = strlen((char *)Line.preparse)+2; + if((data->cols[column].preparse = AllocVecPooled(data->Pool,len)) != NULL) + strlcpy(data->cols[column].preparse, (char *)Line.preparse, len); + } + if (Line.col) data->cols[column].col = (WORD) *Line.col; + if (Line.tbar) data->cols[column].bar = (WORD) 2; + if (Line.bar) data->cols[column].bar = (WORD) 1; + if (Line.nobar) data->cols[column].bar = (WORD) 0; + if (Line.sbar) data->cols[column].bar |= (WORD) 4; + if (Line.notb) data->cols[column].titlebutton = (WORD) FALSE; + + if (Line.weight) + { + data->cols[column].width = (WORD) *Line.weight; + data->cols[column].width_type = (BYTE) CI_PERCENT; + if ((column == colmax-1) && !(oldlist && (column == 0)) && (data->cols[column].width == -1)) + data->cols[column].width = (WORD) 100; + else if (data->cols[column].width < 0) + data->cols[column].width = (WORD) -1; + } + if (Line.colwidth) + { data->cols[column].width = (WORD) *Line.colwidth; + data->cols[column].width_type = (BYTE) CI_COL; + if (data->cols[column].width < 1) + data->cols[column].width = 1; + } + if (Line.pixwidth) + { data->cols[column].width = (WORD) *Line.pixwidth; + data->cols[column].width_type = (BYTE) CI_PIX; + if (data->cols[column].width < 4) + data->cols[column].width = 4; + } + + if (Line.minwidth) + data->cols[column].minwidth = (WORD) *Line.minwidth; + if (Line.maxwidth) + data->cols[column].maxwidth = (WORD) *Line.maxwidth; + + if (Line.mincolwidth) + data->cols[column].mincolwidth = (WORD) *Line.mincolwidth; + if (Line.maxcolwidth) + data->cols[column].maxcolwidth = (WORD) *Line.maxcolwidth; + + if (Line.minpixwidth) + data->cols[column].minpixwidth = (WORD) *Line.minpixwidth; + if (Line.maxpixwidth) + data->cols[column].maxpixwidth = (WORD) *Line.maxpixwidth; + + if(Line.partcolsubst) + { + char c = toupper(((char *)Line.partcolsubst)[0]); + + switch(c) + { + case 'D': + data->cols[column].partcolsubst = PCS_DISABLED; + break; + + case 'R': + data->cols[column].partcolsubst = PCS_RIGHT; + break; + + case 'L': + data->cols[column].partcolsubst = PCS_LEFT; + break; + + case 'C': + data->cols[column].partcolsubst = PCS_CENTER; + break; + } + } + + data->cols[column].minx = (WORD) -1; + data->cols[column].maxx = (WORD) -1; + data->cols[column].dx = (WORD) 4; + FreeArgs(rdargs); + } + + if (data->cols[column].width < 1) + { +/* + if ((column == colmax-1) && (data->cols[column].width >= -1)) + data->cols[column].width = (WORD) 100; + else +*/ + data->cols[column].width = (WORD) -1; + data->cols[column].width_type = (BYTE) CI_PERCENT; + } + if (data->cols[column].delta < 0) data->cols[column].delta = 0; + if ((data->cols[column].bar != 0) && + (data->cols[column].delta < 2)) data->cols[column].delta += 2; + if (data->cols[column].minwidth < 1) + { +/* + if ((column == colmax-1) && (data->cols[column].minwidth >= -1)) + data->cols[column].minwidth = 5; + else +*/ + data->cols[column].minwidth = -1; + } + if (data->cols[column].maxwidth <= 4) data->cols[column].maxwidth = 1000; + if (data->cols[column].mincolwidth < 0) data->cols[column].mincolwidth = 0; + if (data->cols[column].maxcolwidth <= 0) data->cols[column].maxcolwidth = 5000; + if (data->cols[column].minpixwidth < 6) data->cols[column].minpixwidth = 6; + if (data->cols[column].maxpixwidth <= 5) data->cols[column].maxpixwidth = 20000; + if (data->cols[column].col > col) col = data->cols[column].col; + column++; + } +/* data->cols[colmax-1].width = (WORD) 100;*/ + + FreeDosObject(DOS_RDARGS, ptr); + FreeVecPooled(data->Pool, sf); + + col = colmax; + column = 1; + while (column < data->numcols) + { col = 0; + colmax = 0; + while (colmax < column) + { if (data->cols[column].col == data->cols[colmax].col) + { colmax = 0; + while (colmax < data->numcols) + { if (col == data->cols[colmax].col) + { col++; + if (col >= DISPLAY_ARRAY_MAX) + col = 0; + colmax = 0; + } + else + colmax++; + } + data->cols[column].col = col++; + if (col >= DISPLAY_ARRAY_MAX) + col = 0; + colmax = 0; + } + else + colmax++; + } + column++; + } + + column = 0; + while (column < data->numcols) + { data->column[column] = data->cols[column].col; + data->cols[column].c = &(data->cols[column]); + column++; + } + data->numcols2 = data->numcols; + + data->format_chge = 1; + data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE; + data->display_ptr = NULL; +/*D(bug("%lx|NL_Read_Format >%s<\n",obj,strformat));*/ + if (data->SHOW) + { + if (!data->DRAW) + NL_SetObjInfos(data,TRUE); + NL_SetCols(data); + } + return (TRUE); + } + FreeDosObject(DOS_RDARGS, ptr); + } + FreeVecPooled(data->Pool ,sf); + } + return (FALSE); +} + + + +static BOOL CCB_string(struct NLData *data, char **cbstr, char *str, LONG len, char lc, BOOL skipesc) +{ + char *tmpcb; + char *tmp; + LONG tmpcblen; + + if(str != NULL) + { + tmpcblen = len + 2; + if(*cbstr != NULL) + tmpcblen += strlen(*cbstr); + + if((tmpcb = AllocVecPooled(data->Pool, tmpcblen)) != NULL) + { + tmp = tmpcb; + + if(*cbstr != NULL) + { + tmp += strlcpy(tmp, *cbstr, tmpcblen); + FreeVecPooled(data->Pool, *cbstr); + } + + if(skipesc) + tmp = stpncpy_noesc(tmp,str,len); + else + tmp += strlcpy(tmp, str, len); + + tmp[0] = lc; + tmp[1] = '\0'; + + *cbstr = tmpcb; + + return TRUE; + } + + return FALSE; + } + + return TRUE; +} + + +static BOOL CCB_entry(struct NLData *data,char **cbstr,APTR entptr,SIPTR ent,struct Hook *hook,SIPTR c1,SIPTR p1,SIPTR c2,SIPTR p2) +{ + char **display_array = &data->DisplayArray[2]; + char *str; + SIPTR pos1,pos2,len,prep1,prep2; + char lc; + BOOL ln = FALSE; + WORD colwrap,wrap = 0; + + if ((ent >= 0) && data->EntriesArray[ent]->Wrap) + { + SIPTR ent1 = ent; + + if (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine) + ent1 -= data->EntriesArray[ent]->dnum; + entptr = data->EntriesArray[ent1]->Entry; + wrap = data->EntriesArray[ent]->Wrap; + } + if (p1 < -PREPARSE_OFFSET_ENTRY) /* begin in general column preparse string */ + { + p1 += PREPARSE_OFFSET_COL; + prep1 = 2; + } + else if (p1 < -2) + { + p1 += PREPARSE_OFFSET_ENTRY; /* begin in display hook column preparse string */ + prep1 = 1; + } + else if (p1 == -1) /* begin at beginning of column */ + prep1 = 2; + else + prep1 = 0; + + if (p2 < -PREPARSE_OFFSET_ENTRY) /* end in general column preparse string */ + { p2 += PREPARSE_OFFSET_COL; + prep2 = 2; + } + else if (p2 < -2) + { + p2 += PREPARSE_OFFSET_ENTRY; /* end in display hook column preparse string */ + prep2 = 1; + } + else if (p2 == -1) /* end at beginning of column */ + prep2 = 2; + else + prep2 = 0; + + if (entptr) + { + if (!hook) + hook = data->NList_CopyEntryToClipHook; + if (hook) + { display_array[0] = (char *) entptr; + data->DisplayArray[0] = (char *) data->NList_PrivateData; + data->DisplayArray[1] = (char *) ent; + display_array[1] = (char *) c1; + display_array[2] = (char *) p1; + display_array[3] = (char *) c2; + display_array[4] = (char *) p2; + display_array[5] = (char *) prep1; + display_array[6] = (char *) prep2; + if (c1 <= 0) display_array[1] = (char *) -1; + if (c1 >= data->numcols-1) display_array[1] = (char *) -2; + if (c2 <= 0) display_array[3] = (char *) -1; + if (c2 >= data->numcols-1) display_array[3] = (char *) -2; + if (data->NList_CopyEntryToClipHook2) + { data->DisplayArray[0] = (char *) entptr; + MyCallHookPkt(data->this,FALSE,hook,data->this,data->DisplayArray); + } + else + MyCallHookPkt(data->this,TRUE,hook,display_array,entptr); + data->display_ptr = NULL; + return (CCB_string(data,cbstr,display_array[0],strlen(display_array[0]),'\0',FALSE)); + } + else + { + WORD column,col1,col2; + + NL_GetDisplayArray(data,ent); + + if ((c1 == -2) || (c1 >= data->numcols-1)) + col1 = data->numcols-1; + else if (c1 < 0) + col1 = 0; + else + col1 = c1; + + if ((c2 == -2) || (c2 >= data->numcols-1)) + { + col2 = data->numcols-1; + if (p2==-2) + ln = TRUE; + } + else if (c2 < 0) + col2 = 0; + else + col2 = c2; + for (column = col1;column <= col2;column++) + { + colwrap = (1 << data->cols[column].c->col) & TE_Wrap_TmpMask; + str = display_array[data->cols[column].c->col]; + pos1 = -1; + pos2 = -2; + if (column == col1) + pos1 = p1; + if (column == col2) + pos2 = p2; + if (column == col2) + { if (ln) + lc = '\n'; + else + lc = '\0'; + } + else + lc = '\t'; + if ((wrap & TE_Wrap_TmpLine) && !(wrap & colwrap)) + { if (!CCB_string(data,cbstr,str,0,lc,TRUE)) + return (FALSE); + continue; + } + if (wrap && (wrap & colwrap)) + { if (pos1 < 0) + pos1 = data->EntriesArray[ent]->pos; + if (pos2 < 0) + pos2 = data->EntriesArray[ent]->pos + data->EntriesArray[ent]->len; + } + if (data->NList_CopyColumnToClipHook) + { display_array[0] = (char *) str; + data->DisplayArray[0] = (char *) data->NList_PrivateData; + data->DisplayArray[1] = (char *) ent; + display_array[1] = (char *) pos1; + display_array[2] = (char *) pos2; + if (data->NList_CopyColumnToClipHook2) + { data->DisplayArray[0] = (char *) str; + MyCallHookPkt(data->this,FALSE,data->NList_CopyColumnToClipHook,data->this,data->DisplayArray); + } + else + MyCallHookPkt(data->this,TRUE,data->NList_CopyColumnToClipHook,display_array,(APTR) str); + data->display_ptr = NULL; + len = (SIPTR) display_array[1]; + if (len < 0) + len = 0; + if (!CCB_string(data,cbstr,display_array[0],len,lc,FALSE)) + return (FALSE); + } + else + { len = 0; + while ((str[len] != '\0') && (str[len] != '\n')) + len++; + if (pos2 > len) + pos2 = len; + if (pos1 > len) + { pos1 = len; + len = 0; + } + if (pos1 <= -2) + pos1 = len = 0; + else if (pos1 == -1) + pos1 = 0; + if (pos2 >= pos1) + len = pos2-pos1; + else if (pos2 == -1) + len = 0; + if (!CCB_string(data,cbstr,&str[pos1],len,lc,TRUE /* FALSE */ )) + return (FALSE); + } + } + return (TRUE); + } + return (FALSE); + } + return (TRUE); +} + + +#define CCB_ENTRY_PTR_HOOK(ep,h) \ + ok = CCB_entry(data,&clipstr,ep,-1,h,-1,-1,-2,-2); + +#define CCB_ENTRY_PTR(ep) \ + ok = CCB_entry(data,&clipstr,ep,-1,NULL,-1,-1,-2,-2); + +#define CCB_ENTRY(e) \ + { if ((e >= 0) && (e < data->NList_Entries)) \ + ok = CCB_entry(data,&clipstr,data->EntriesArray[e]->Entry,e,NULL,-1,-1,-2,-2); \ + } + +#define CCB_ENTRY_START_END(e,c1,p1,c2,p2) \ + { if ((e >= 0) && (e < data->NList_Entries)) \ + ok = CCB_entry(data,&clipstr,data->EntriesArray[e]->Entry,e,NULL,c1,p1,c2,p2); \ + } + +static LONG CopyToFile(STRPTR filename, STRPTR buffer) +{ + LONG result = MUIV_NLCT_Failed; + + ENTER(); + + if(buffer != NULL) + { + BPTR file = 0; + + if((file = Open(filename, MODE_NEWFILE)) != 0) + { + LONG pstr = 0; + LONG lstr = strlen(buffer); + LONG ret = 0; + + while(lstr > 0 && (ret = Write(file, &buffer[pstr], lstr)) >= 0) + { + lstr -= ret; + pstr += ret; + } + + if(ret < 0) + result = MUIV_NLCT_WriteErr; + else + result = MUIV_NLCT_Success; + + Close(file); + } + else + result = MUIV_NLCT_OpenErr; + } + + RETURN(result); + return result; +} + +SIPTR NL_CopyTo(struct NLData *data,LONG pos,char *filename,ULONG clipnum,APTR *entries,struct Hook *hook) +{ + char *retstr = NULL; + char *clipstr = NULL; + SIPTR ok = TRUE; + LONG ent; + + ENTER(); + + switch (pos) + { + case MUIV_NList_CopyToClip_Active : + CCB_ENTRY(data->NList_Active); + break; + + case MUIV_NList_CopyToClip_Selected: + { + if(!data->NList_TypeSelect) + { + ent = 0; + while (ok && (ent < data->NList_Entries)) + { + if (data->EntriesArray[ent]->Select != TE_Select_None) + { + CCB_ENTRY(ent); + } + ent++; + } + } + else + { + LONG c1,p1,c2,p2; + c1 = data->sel_pt[data->min_sel].column; + p1 = data->sel_pt[data->min_sel].colpos; + c2 = data->sel_pt[data->max_sel].column; + p2 = data->sel_pt[data->max_sel].colpos; + ent = data->sel_pt[data->min_sel].ent; + D(DBF_STARTUP, "ok=%d ent=%d mincol=%d maxcol=%d minpos=%d maxpos=%d", ok, ent, c1, c2, p1, p2); + if (ok && (ent >= 0) && (ent < data->NList_Entries)) + { + if (ent == data->sel_pt[data->max_sel].ent) + { + CCB_ENTRY_START_END(ent,c1,p1,c2,p2); + break; + } + else + { + CCB_ENTRY_START_END(ent,c1,p1,-2,-2); + ent++; + } + } + while (ok && (ent >= 0) && (ent < data->sel_pt[data->max_sel].ent) && (ent < data->NList_Entries)) + { + CCB_ENTRY(ent); + ent++; + } + if (ok && (ent >= 0) && (ent == data->sel_pt[data->max_sel].ent) && (ent < data->NList_Entries)) + { + CCB_ENTRY_START_END(ent,-1,-1,c2,p2); + ent++; + } + } + } + break; + + case MUIV_NList_CopyToClip_All : + { ent = 0; + while (ok && (ent < data->NList_Entries)) + { + CCB_ENTRY(ent); + ent++; + } + } + break; + case MUIV_NList_CopyToClip_Entries : + { + APTR *array = (APTR *) entries; + ent = 0; + while (ok && array[ent]) + { + CCB_ENTRY_PTR(array[ent]); + ent++; + } + } + break; + case MUIV_NList_CopyToClip_Entry : + CCB_ENTRY_PTR(entries); + break; + + case MUIV_NList_CopyToClip_Strings : + { + APTR *array = (APTR *) entries; + ent = 0; + while (ok && array[ent]) + { + CCB_ENTRY_PTR_HOOK(array[ent],hook); + ent++; + } + } + break; + + case MUIV_NList_CopyToClip_String : + CCB_ENTRY_PTR_HOOK(entries,hook); + break; + + default : + CCB_ENTRY(pos); + break; + } + + if(filename != NULL) + { + ok = CopyToFile(filename, clipstr); + } + else if((LONG)clipnum >= 0) + { + ok = StringToClipboard(clipnum, clipstr); + } + else + { + int len = strlen(clipstr) + 1; + + if((retstr = (char *)AllocVec(len, 0L)) != NULL) + strlcpy(retstr, clipstr, len); + ok = (SIPTR)retstr; + } + + if(clipstr != NULL) + FreeVecPooled(data->Pool, clipstr); + + RETURN(ok); + return ok; +} + + +IPTR mNL_CopyToClip(struct IClass *cl,Object *obj,struct MUIP_NList_CopyToClip *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + + if((LONG)msg->clipnum < 0) + return (0); + + return ((IPTR) NL_CopyTo(data,msg->pos,NULL,msg->clipnum,msg->entries,msg->hook)); +} + + +IPTR mNL_CopyTo(struct IClass *cl,Object *obj,struct MUIP_NList_CopyTo *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + SIPTR res; + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + res = NL_CopyTo(data,msg->pos,msg->filename,-1,msg->entries,NULL); + *msg->result = (APTR) res; + return (IPTR)res; +} diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_func4.c b/workbench/classes/zune/nlist/nlist_mcc/NList_func4.c new file mode 100644 index 0000000000..53bb4ed540 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_func4.c @@ -0,0 +1,995 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <string.h> + +#include <exec/execbase.h> +#include <exec/memory.h> +#include <intuition/pointerclass.h> +#include <datatypes/pictureclass.h> + +#include <proto/exec.h> +#include <proto/graphics.h> +#include <proto/muimaster.h> +#include <proto/intuition.h> +#include <proto/exec.h> +#include <proto/layers.h> + +#include "private.h" + +#include "NList_func.h" + +#if !defined(__amigaos4__) && !defined(__MORPHOS__) && !defined(__AROS__) +LONG ObtainBestPen( struct ColorMap *cm, ULONG r, ULONG g, ULONG b, ULONG tag1Type, ... ); +#endif + +/****************************************************************************************/ +/****************************************************************************************/ +/****************************** **************************************/ +/****************************** NList Class **************************************/ +/****************************** **************************************/ +/****************************************************************************************/ +/****************************************************************************************/ + +BOOL NL_OnWindow(struct NLData *data,LONG x,LONG y) +{ + BOOL onWindow = FALSE; + Object *obj = data->this; + + #if defined(__MORPHOS__) + /* No need for hit test in MorphOS 2.0 */ + if (SysBase->LibNode.lib_Version >= 51) + return TRUE; + #endif + + if (data->SHOW && muiRenderInfo(obj) && _screen(obj) != NULL && _window(obj) != NULL) + { + // first check whether the mouse is over the object itself + if(x >= _mleft(obj) && x <= _mright(obj) && y >= _mtop(obj) && y <= _mbottom(obj)) + { + // now check if the mouse is currently over the object and over the object's window + struct Layer_Info *li = &(_screen(obj)->LayerInfo); + struct Layer *layer; + + // get the layer that belongs to the current mouse coordinates + LockLayerInfo(li); + layer = WhichLayer(li, _window(obj)->LeftEdge + x, _window(obj)->TopEdge + y); + UnlockLayerInfo(li); + + if(layer != NULL && layer->Window == _window(obj)) + onWindow = TRUE; + } +/* + struct Window *win; + struct Layer *wlay,*lay; + ULONG lkib = LockIBase( 0 ); + x += _window(obj)->LeftEdge; + y += _window(obj)->TopEdge; + wlay = _window(obj)->WLayer; + for (lay = wlay->front; wlay && lay; lay = lay->front) + { win = (struct Window *) lay->Window; + for (win = _screen(obj)->FirstWindow; win ; win = win->NextWindow) + { if (win->WLayer == lay) + { if ((x >= win->LeftEdge) && (y >= win->TopEdge) && + (x < win->LeftEdge + win->Width) && (y < win->TopEdge + win->Height)) + { UnlockIBase( lkib ); + return (FALSE); + } + } + } + } + UnlockIBase( lkib ); +*/ + } + return onWindow; +} + + + + +struct NImgList *GetNImage(struct NLData *data,char *ImgName) +{ + struct NImgList *nimg = &data->NImage; + int nameLen = strlen(ImgName)+2; + + while (nimg && nimg->ImgName && strcmp(nimg->ImgName,ImgName)) + nimg = nimg->next; + if (!nimg && (nimg = (struct NImgList *)AllocVecPooled(data->Pool, sizeof(struct NImgList)+nameLen)) != NULL) + { nimg->ImgName = (char *) nimg; + nimg->ImgName = &nimg->ImgName[sizeof(struct NImgList)]; + strlcpy(nimg->ImgName, ImgName, nameLen); + nimg->NImgObj = NULL; + nimg->width = -1; + nimg->height = -1; + nimg->dx = 0; + nimg->dy = 0; + nimg->next = data->NImage.next; + data->NImage.next = nimg; + } + if (nimg && !nimg->NImgObj && data->adding_member && (nimg->width != -1000)) + { if ((data->adding_member == 1) && !data->NList_Quiet && !data->NList_Disabled && data->SETUP && data->SHOW && DoMethod(data->NL_Group,MUIM_Group_InitChange)) + data->adding_member = 2; + if (data->adding_member >= 2) + { + nimg->NImgObj = MUI_NewObject(MUIC_Image, + MUIA_FillArea,FALSE, + MUIA_Image_Spec,nimg->ImgName, +/* + * MUIA_InputMode,MUIV_InputMode_Toggle, + * MUIA_Image_State, IDS_NORMAL, + * MUIA_Selected, FALSE, + * MUIA_Image_FontMatch, TRUE, + * MUIA_Font, Topaz_8, + */ + TAG_DONE); + if (nimg->NImgObj) + { +/*D(bug("%lx|OM_ADDMEMBER,nimg->NImgObj %ld\n",obj,data->adding_member));*/ + DoMethod(data->NL_Group,OM_ADDMEMBER,nimg->NImgObj); + set(nimg->NImgObj, MUIA_Disabled, FALSE); + if (data->SHOW) + { + nimg->width = _defwidth(nimg->NImgObj); + nimg->height = _defheight(nimg->NImgObj); + } + else + data->do_images = TRUE; + } + else + { nimg->width = -1000; + nimg->height = 2; + } + } + else + data->do_images = TRUE; + } + return (nimg); +} + + +void DeleteNImages(struct NLData *data) +{ + struct NImgList *nimg = data->NImage.next; + + while (nimg) + { + data->NImage.next = nimg->next; + FreeVecPooled(data->Pool, nimg); + nimg = data->NImage.next; + } +} + + +struct NImgList *GetNImage2(struct NLData *data,APTR imgobj) +{ + struct NImgList *nimg2 = data->NImage2; + while (nimg2 && (nimg2->NImgObj != imgobj) && (nimg2->ImgName != imgobj)) + nimg2 = nimg2->next; + if (!nimg2 && (nimg2 = (struct NImgList *)AllocVecPooled(data->Pool, sizeof(struct NImgList))) != NULL) + { nimg2->NImgObj = NULL; + nimg2->width = -1000; + nimg2->height = 2; + nimg2->dx = 0; + nimg2->dy = 0; + nimg2->ImgName = imgobj; + nimg2->next = data->NImage2; + data->NImage2 = nimg2; + } + if (nimg2 && nimg2->ImgName && !nimg2->NImgObj && (nimg2->width == -1000) && data->adding_member) + { + if(xget((Object *)nimg2->ImgName, MUIA_Parent)) + { +/* + * D(bug("%lx|GetNImage2 %lx already attached !\n",obj,nimg2->ImgName)); + */ + } + else + { if ((data->adding_member == 1) && !data->NList_Quiet && !data->NList_Disabled && data->SETUP && data->SHOW && DoMethod(data->NL_Group,MUIM_Group_InitChange)) + data->adding_member = 2; + if (data->adding_member >= 2) + { nimg2->NImgObj = (APTR) nimg2->ImgName; + nimg2->ImgName = NULL; +/*D(bug("%lx|OM_ADDMEMBER,nimg2->NImgObj %ld\n",obj,data->adding_member));*/ + DoMethod(data->NL_Group,OM_ADDMEMBER,nimg2->NImgObj); + set(nimg2->NImgObj, MUIA_Disabled, FALSE); + + if (data->SHOW) + { nimg2->width = _defwidth(nimg2->NImgObj); + nimg2->height = _defheight(nimg2->NImgObj); + } + else + { nimg2->width = -1; + nimg2->height = -1; + data->do_images = TRUE; + } + } + else + data->do_images = TRUE; + } + } + return (nimg2); +} + + +void DeleteNImages2(struct NLData *data) +{ + struct NImgList *nimg2 = data->NImage2; + + while (nimg2) + { + data->NImage2 = nimg2->next; + if (nimg2->ImgName && !nimg2->NImgObj) + MUI_DisposeObject((APTR) nimg2->ImgName); + FreeVecPooled(data->Pool, nimg2); + nimg2 = data->NImage2; + } +} + + +void GetNImage_Sizes(struct NLData *data) +{ + if (data->SHOW) + { + struct NImgList *nimg = &data->NImage; + struct NImgList *nimg2 = data->NImage2; + + while (nimg) + { + if (nimg->NImgObj) + { + nimg->width = _defwidth(nimg->NImgObj); + nimg->height = _defheight(nimg->NImgObj); + if (data->MinImageHeight < _minheight(nimg->NImgObj)) + { + if (_minheight(nimg->NImgObj) > 20) + { + if (data->MinImageHeight < 20) + data->MinImageHeight = 20; + } + else + data->MinImageHeight = _minheight(nimg->NImgObj); + } + _left(nimg->NImgObj) = _left(data->NL_Group); + _top(nimg->NImgObj) = _top(data->NL_Group); + } + nimg = nimg->next; + } + + while (nimg2) + { + if (nimg2->NImgObj && (nimg2->width != -1000)) + { + nimg2->width = _defwidth(nimg2->NImgObj); + nimg2->height = _defheight(nimg2->NImgObj); + if (data->MinImageHeight < _minheight(nimg2->NImgObj)) + { + if (_minheight(nimg2->NImgObj) > 30) + { + if (data->MinImageHeight < 30) + data->MinImageHeight = 30; + } + else + data->MinImageHeight = _minheight(nimg2->NImgObj); + } + _left(nimg2->NImgObj) = _left(data->NL_Group); + _top(nimg2->NImgObj) = _top(data->NL_Group); + } + nimg2 = nimg2->next; + } + } + else + data->do_images = TRUE; +} + + +void GetNImage_End(struct NLData *data) +{ + if (data->adding_member == 2) + { + data->adding_member = 0; +/*D(bug("%lx|GNIE Group_ExitChange\n",obj));*/ + data->nodraw++; + DoMethod(data->NL_Group,MUIM_Group_ExitChange); + data->nodraw--; + GetNImage_Sizes(data); + } + data->adding_member = 0; +} + + +void GetImages(struct NLData *data) +{ + if (data->SHOW && data->do_images) + { + struct NImgList *nimg = &data->NImage; + struct NImgList *nimg2 = data->NImage2; + + if (data->adding_member != 2) + data->adding_member = 1; + + while (nimg) + { + if (!nimg->NImgObj) + GetNImage(data,nimg->ImgName); + nimg = nimg->next; + } + + while (nimg2) + { + if (nimg2->ImgName && !nimg2->NImgObj && (nimg2->width == -1000)) + GetNImage2(data,nimg2->ImgName); + nimg2 = nimg2->next; + } + data->do_images = FALSE; + } + GetNImage_End(data); +} + + + + + + +static void disposeBitMap(struct NLData *data,struct BitMap *bitmap, LONG width, LONG height) +{ + if (bitmap) + { WORD ktr; + for (ktr = 0; ktr < bitmap->Depth; ktr++) + { if (bitmap->Planes[ktr]) + { +/*D(bug("FreeRaster(%lx) (dispBM_planes)\n",bitmap->Planes[ktr]));*/ + FreeRaster(bitmap->Planes[ktr], width, height); + } + } + FreeVecPooled(data->Pool, bitmap); + } +} + + +static void disposeBitMapImage(struct NLData *data,struct BitMapImage *bmimg) +{ + if (bmimg && data->SETUP) + { + WORD ktr; + + for (ktr = 0; ktr < bmimg->imgbmp.Depth; ktr++) + { + if (bmimg->imgbmp.Planes[ktr]) + { +/*D(bug("FreeRaster(%lx) (dispBMI_planes)\n",bmimg->imgbmp.Planes[ktr]));*/ + FreeRaster(bmimg->imgbmp.Planes[ktr], bmimg->width, bmimg->height); + } + } + if (bmimg->mask) + { +/*D(bug("FreeRaster(%lx) (dispBMI_mask)\n",bmimg->mask));*/ + FreeRaster(bmimg->mask, bmimg->width, bmimg->height); + } + if (bmimg->obtainpens) + { + ktr = 0; + while (bmimg->obtainpens[ktr] != -3) + { + if ((bmimg->obtainpens[ktr] >= 0) || (bmimg->obtainpens[ktr] < -3)) + ReleasePen(_screen(data->this)->ViewPort.ColorMap, (ULONG) bmimg->obtainpens[ktr]); + ktr++; + } + FreeVecPooled(data->Pool, bmimg->obtainpens); + } + FreeVecPooled(data->Pool, bmimg); + } +} + + +IPTR NL_CreateImage2(struct NLData *data,Object *imgobj,ULONG flags) +{ + struct BitMapImage *bmimg = NULL; + + if (imgobj) + { + if((bmimg = AllocVecPooled(data->Pool ,sizeof(struct BitMapImage))) != NULL) + { + if (GetNImage2(data,imgobj)) + { + bmimg->control = MUIA_Image_Spec; + bmimg->width = 0; + bmimg->height = 0; + bmimg->obtainpens = (APTR) imgobj; + if (flags != (ULONG)~0L) + nnset(imgobj,MUIA_FillArea,FALSE); +/* + * nnset(imgobj,MUIA_Image_FontMatch,FALSE); + * nnset(imgobj,MUIA_Image_FontMatchHeight,FALSE); + * nnset(imgobj,MUIA_Image_FontMatchWidth,FALSE); + * nnset(imgobj,MUIA_Image_State,IDS_SELECTED); + * nnset(imgobj,MUIA_Selected,FALSE); + * nnset(imgobj,MUIA_InputMode,MUIV_InputMode_Toggle); + */ + } + else + { + bmimg->control = 0L; + FreeVecPooled(data->Pool, bmimg); + bmimg = NULL; + } + } + if (!bmimg) + MUI_DisposeObject((APTR) imgobj); + } + return ((IPTR) bmimg); +} + + +IPTR NL_CreateImage(struct NLData *data,Object *imgobj,ULONG flags) +{ + SIPTR CI_BM_Width = 0; + + if (!imgobj) + return(0); + + // check if the Bitmap_Width attribute doesn't exists + if((flags == (ULONG)~0L) || GetAttr(MUIA_Bitmap_Width, imgobj, (IPTR *)&CI_BM_Width) == FALSE) + return (NL_CreateImage2(data,imgobj,flags)); + + if (imgobj && data->SETUP) + { + LONG last_numpen,last_newnumpen; + struct BitMap *CI_BM_Bitmap = NULL; + struct BitMap *bm_src = NULL; + struct BitMapImage *bmimg = NULL; + WORD *obtainpens = NULL; + UBYTE newdepth = 0; + UBYTE *CI_BC_Body = NULL; + LONG CI_BC_Depth = 0; + LONG CI_BC_Compression = 0; + LONG CI_BC_Masking = 0; + LONG CI_BM_Height = 0; + UBYTE *CI_BM_MappingTable = NULL; + ULONG *CI_BM_SourceColors = NULL; + LONG CI_BM_Precision = 0; + LONG CI_BM_Transparent = 0; + + CI_BM_Bitmap = (struct BitMap *)xget(imgobj, MUIA_Bitmap_Bitmap); + CI_BM_Width = xget(imgobj, MUIA_Bitmap_Width); + CI_BM_Height = xget(imgobj, MUIA_Bitmap_Height); + CI_BM_MappingTable = (UBYTE *)xget(imgobj, MUIA_Bitmap_MappingTable); + CI_BM_Transparent = xget(imgobj, MUIA_Bitmap_Transparent); + CI_BM_SourceColors = (ULONG *)xget(imgobj, MUIA_Bitmap_SourceColors); + CI_BM_Precision = xget(imgobj, MUIA_Bitmap_Precision); + + if (!CI_BM_Bitmap) + { + CI_BC_Body = (UBYTE *)xget(imgobj, MUIA_Bodychunk_Body); + CI_BC_Depth = xget(imgobj, MUIA_Bodychunk_Depth); + CI_BC_Compression = xget(imgobj, MUIA_Bodychunk_Compression); + CI_BC_Masking = xget(imgobj, MUIA_Bodychunk_Masking); + + if (CI_BC_Body) + { + if((bm_src = AllocVecPooled(data->Pool, sizeof(struct BitMap))) != NULL) + { + WORD ktr; + BOOL bit_map_failed = FALSE; + + InitBitMap(bm_src,CI_BC_Depth,CI_BM_Width,CI_BM_Height); + + for (ktr = 0; ktr < bm_src->Depth; ktr++) + { + if (!(bm_src->Planes[ktr] = (PLANEPTR) AllocRaster(CI_BM_Width,CI_BM_Height))) + bit_map_failed = TRUE; + } + if (bit_map_failed) + { + disposeBitMap(data,bm_src,CI_BM_Width,CI_BM_Height); + bm_src = NULL; + } + else + { + WORD cptb,cptr,cptd,offr; + WORD num = 0; + UBYTE val = 0; + UBYTE type = 0; + UBYTE *body = CI_BC_Body; + + for (cptr = 0; cptr < bm_src->Rows; cptr++) + { + offr = cptr * bm_src->BytesPerRow; + for (cptd = 0; cptd < bm_src->Depth; cptd++) + { + for (cptb = 0; cptb < bm_src->BytesPerRow; cptb++) + { + if (CI_BC_Compression == cmpByteRun1) + { + if (num > 0) + { + if (type == 0) + bm_src->Planes[cptd][offr+cptb] = val; + else + bm_src->Planes[cptd][offr+cptb] = *body; + num--; + } + else + { + while (*body == 128) + body++; + if (*body < 128) + { + num = (WORD) *body; type = 1; body++; + bm_src->Planes[cptd][offr+cptb] = *body; + } + else + { + num = 256 - ((WORD) *body); type = 0; body++; val = *body; + bm_src->Planes[cptd][offr+cptb] = val; + } + } + } + else + bm_src->Planes[cptd][offr+cptb] = *body; + body++; + } + } + if (CI_BC_Masking == mskHasMask) + { + for (cptb = 0; cptb < bm_src->BytesPerRow; cptb++) + { + if (CI_BC_Compression == cmpByteRun1) + { + if (num > 0) + num--; + else + { + while (*body == 128) + body++; + if (*body < 128) + { + num = (WORD) *body; + type = 1; + body++; + } + else + { + num = 256 - ((WORD) *body); + type = 0; + body++; + val = *body; + } + } + } + body++; + } + } + } + } + } + } + else + bm_src = NULL; + } + else + bm_src = CI_BM_Bitmap; + + if (bm_src != NULL) + { + UBYTE mypen,bit1,bit2; + WORD cptb,cptr,cptd,offr,offr1,cptpen; + + last_numpen = (1 << bm_src->Depth); + last_newnumpen = 0; + newdepth = bm_src->Depth; + + if (CI_BM_MappingTable != NULL) + { + LONG num; + + for (num = 0;num < last_numpen;num++) + { + if (last_newnumpen < CI_BM_MappingTable[num]) + last_newnumpen = CI_BM_MappingTable[num]; + } + newdepth = 0; + while (last_newnumpen) + { + newdepth++; + last_newnumpen = last_newnumpen >> 1; + } + } + else if (CI_BM_SourceColors != NULL) + { + ULONG *mycolor; + + obtainpens = AllocVecPooled(data->Pool, (last_numpen+1)*sizeof(*obtainpens)); + if (obtainpens != NULL) + { + obtainpens[last_numpen] = -3; + for (cptpen = 0; cptpen < last_numpen; cptpen++) + obtainpens[cptpen] = -1; + for (cptr = 0; cptr < bm_src->Rows; cptr++) + { + offr = cptr * bm_src->BytesPerRow; + for (cptb = 0; cptb < bm_src->BytesPerRow; cptb++) + { + bit1 = 0x80; + while (bit1) + { /* get the source dot pen number */ + mypen = 0; + bit2 = 0x01; + for (cptd = 0; cptd < bm_src->Depth; cptd++) + { + if (bm_src->Planes[cptd][offr+cptb] & bit1) + mypen |= bit2; + + bit2 = bit2 << 1; + } + /* map the pen number */ + if (mypen == CI_BM_Transparent) + obtainpens[mypen] = -2; + else if (obtainpens[mypen] == -1) + { + mycolor = &CI_BM_SourceColors[mypen*3]; + + obtainpens[mypen] = (WORD) ObtainBestPen(_screen(data->this)->ViewPort.ColorMap, + mycolor[0],mycolor[1],mycolor[2], + OBP_Precision, CI_BM_Precision, + TAG_END); + if (obtainpens[mypen] == -1) + { + obtainpens[mypen] = (WORD) ObtainBestPen(_screen(data->this)->ViewPort.ColorMap, + mycolor[0],mycolor[1],mycolor[2], + OBP_Precision, PRECISION_GUI, + TAG_END); + } + if(last_newnumpen < obtainpens[mypen]) + last_newnumpen = obtainpens[mypen]; + } + bit1 = bit1 >> 1; + } + } + } + newdepth = 0; + while (last_newnumpen) + { + newdepth++; + last_newnumpen = last_newnumpen >> 1; + } + } + } + if (newdepth > 8) + newdepth = 8; + last_newnumpen = 1 << newdepth; + + if ((newdepth > 0) && (bmimg = AllocVecPooled(data->Pool, sizeof(struct BitMapImage))) != NULL) + { + WORD ktr; + BOOL bmimg_failed = FALSE; + + InitBitMap(&(bmimg->imgbmp),newdepth,CI_BM_Width,CI_BM_Height); + bmimg->control = MUIM_NList_CreateImage; + bmimg->width = CI_BM_Width; + bmimg->height = CI_BM_Height; + bmimg->obtainpens = obtainpens; + for (ktr = 0; ktr < bmimg->imgbmp.Depth; ktr++) + { + if (!(bmimg->imgbmp.Planes[ktr] = (PLANEPTR) AllocRaster(CI_BM_Width,CI_BM_Height))) + bmimg_failed = TRUE; + } + if (!(bmimg->mask = (PLANEPTR) AllocRaster(CI_BM_Width,CI_BM_Height))) + bmimg_failed = TRUE; + if (bmimg_failed) + { + disposeBitMapImage(data,bmimg); + bmimg = NULL; + } + else + { +/* +int kprintf( const char *, ... ); +kprintf( "SrcBitMap Width %ld Height %ld Depth %ld BytesPerRow %ld Rows %ld Depth %ld.\n", +GetBitMapAttr( bm_src, BMA_WIDTH ), +GetBitMapAttr( bm_src, BMA_HEIGHT ), +GetBitMapAttr( bm_src, BMA_DEPTH ), +bm_src->BytesPerRow, +bm_src->Rows, +bm_src->Depth ); +kprintf( "BytesPerRow %ld Rows %ld.\n", bmimg->imgbmp.BytesPerRow, bmimg->imgbmp.Rows ); +*/ + for (cptr = 0; cptr < bmimg->imgbmp.Rows; cptr++) + { + offr = cptr * bmimg->imgbmp.BytesPerRow; + offr1 = cptr * bm_src->BytesPerRow; + for (cptb = 0; cptb < bmimg->imgbmp.BytesPerRow; cptb++) + { + bit1 = 0x80; + while (bit1) + { /* get the source dot pen number */ + mypen = 0; + bit2 = 0x01; + for (cptd = 0; cptd < bm_src->Depth; cptd++) + { + if (bm_src->Planes[cptd][offr1+cptb] & bit1) // here was bug!!! + mypen |= bit2; + bit2 = bit2 << 1; + } + /* map the pen number */ + if (mypen == CI_BM_Transparent) + { + bmimg->mask[offr+cptb] &= ~bit1; + mypen = 0; + } + else + { + bmimg->mask[offr+cptb] |= bit1; + if (CI_BM_MappingTable) + mypen = (UBYTE) CI_BM_MappingTable[mypen]; + else if (CI_BM_SourceColors && obtainpens && ((obtainpens[mypen] >= 0) || (obtainpens[mypen] < -3))) + mypen = (UBYTE) obtainpens[mypen]; + } + /* set the dest dot pen number */ + bit2 = 0x01; + for (cptd = 0; cptd < bmimg->imgbmp.Depth; cptd++) + { + if (mypen & bit2) + bmimg->imgbmp.Planes[cptd][offr+cptb] |= bit1; + else + bmimg->imgbmp.Planes[cptd][offr+cptb] &= ~bit1; + bit2 = bit2 << 1; + } + bit1 = bit1 >> 1; + } + } + } + } + } + } + + if (!bmimg && obtainpens) + FreeVecPooled(data->Pool, obtainpens); + + if (!CI_BM_Bitmap) + { + disposeBitMap(data,bm_src,CI_BM_Width,CI_BM_Height); + bm_src = NULL; + } + if (bmimg && (data->MinImageHeight < bmimg->height) && !flags) + data->MinImageHeight = bmimg->height; + + return ((IPTR) bmimg); + } + + return (0); +} + + +ULONG NL_DeleteImage(struct NLData *data,APTR listimg) +{ + struct BitMapImage *bmimg = (struct BitMapImage *) listimg; + + if (bmimg && (bmimg->control == MUIM_NList_CreateImage)) + { + bmimg->control = 0L; + disposeBitMapImage(data,bmimg); + } + else if (bmimg && (bmimg->control == MUIA_Image_Spec)) + { + APTR imgobj = (APTR) bmimg->obtainpens; + struct NImgList *nimg2 = data->NImage2,*nimgprec = NULL; + + while (nimg2 && (nimg2->NImgObj != imgobj) && (nimg2->ImgName != imgobj)) + { + nimgprec = nimg2; + nimg2 = nimg2->next; + } + bmimg->control = 0L; + if (nimg2) + { + if (nimgprec) + nimgprec->next = nimg2->next; + else + data->NImage2 = nimg2->next; + if (nimg2->NImgObj == imgobj) + { + Object *parent; + + if((parent = (Object *)xget(imgobj, MUIA_Parent)) && (parent == data->NL_Group)) + { + if (data->SETUP && DoMethod(data->NL_Group,MUIM_Group_InitChange)) + { + DoMethod(data->NL_Group,OM_REMMEMBER,imgobj); + DoMethod(data->NL_Group,MUIM_Group_ExitChange); + } + else + DoMethod(data->NL_Group,OM_REMMEMBER,imgobj); + } + } + FreeVecPooled(data->Pool, nimg2); + } + FreeVecPooled(data->Pool, bmimg); + } + return (TRUE); +} + + +ULONG NL_CreateImages(struct NLData *data) +{ + if (data->NList_UseImages && data->SETUP) + { + LONG pos = 0; + + while (pos < data->LastImage) + { + if (data->NList_UseImages[pos].imgobj) + data->NList_UseImages[pos].bmimg = (struct BitMapImage *) + NL_CreateImage(data,data->NList_UseImages[pos].imgobj,data->NList_UseImages[pos].flags); + else + data->NList_UseImages[pos].bmimg = NULL; + pos++; + } + } + + return(0); +} + + +ULONG NL_DeleteImages(struct NLData *data) +{ + if (data->NList_UseImages) + { + LONG pos = 0; + + while (pos < data->LastImage) + { + if (data->NList_UseImages[pos].bmimg) + NL_DeleteImage(data,(APTR) data->NList_UseImages[pos].bmimg); + data->NList_UseImages[pos].bmimg = NULL; + pos++; + } + } + + return(0); +} + + +ULONG NL_UseImage(struct NLData *data,Object *imgobj,LONG imgnum,ULONG flags) +{ + BOOL redraw = FALSE; + LONG retval = FALSE; + + if ((imgnum >= 0) && (imgnum < 8192)) + { + if (imgobj) + { + if (!data->NList_UseImages || (imgnum >= data->LastImage)) + { + LONG last = imgnum + 8; + struct UseImage *useimages = (struct UseImage *)AllocVecPooled(data->Pool, (last+1)*sizeof(struct UseImage)); + + if (useimages) + { + LONG pos = 0; + + while (pos < data->LastImage) + { useimages[pos].bmimg = data->NList_UseImages[pos].bmimg; + useimages[pos].imgobj = data->NList_UseImages[pos].imgobj; + useimages[pos].flags = data->NList_UseImages[pos].flags; + pos++; + } + + while (pos < last) + { + useimages[pos].bmimg = 0; + useimages[pos].imgobj = NULL; + useimages[pos].flags = 0; + pos++; + } + if (data->NList_UseImages) + FreeVecPooled(data->Pool, data->NList_UseImages); + data->NList_UseImages = useimages; + data->LastImage = last; + } + else if (!data->NList_UseImages) + data->LastImage = 0; + } + if (imgnum < data->LastImage) + { + if (data->NList_UseImages[imgnum].bmimg) + { + NL_DeleteImage(data,(APTR) data->NList_UseImages[imgnum].bmimg); + redraw = TRUE; + } + + data->NList_UseImages[imgnum].bmimg = NULL; + data->NList_UseImages[imgnum].imgobj = imgobj; + data->NList_UseImages[imgnum].flags = flags; + if (data->SETUP) + { + data->NList_UseImages[imgnum].bmimg = (struct BitMapImage *) + NL_CreateImage(data,data->NList_UseImages[imgnum].imgobj,data->NList_UseImages[imgnum].flags); + redraw = TRUE; + } + retval = TRUE; + } + } + else if (imgnum < data->LastImage) + { + if (data->NList_UseImages[imgnum].bmimg) + { + NL_DeleteImage(data,(APTR) data->NList_UseImages[imgnum].bmimg); + redraw = TRUE; + } + data->NList_UseImages[imgnum].bmimg = NULL; + data->NList_UseImages[imgnum].imgobj = NULL; + data->NList_UseImages[imgnum].flags = 0; + retval = TRUE; + } + } + else if (!imgobj && (imgnum == MUIV_NList_UseImage_All) && data->NList_UseImages) + { + LONG pos = 0; + + while (pos < data->LastImage) + { + if (data->NList_UseImages[pos].bmimg) + { + NL_DeleteImage(data,(APTR) data->NList_UseImages[pos].bmimg); + redraw = TRUE; + } + data->NList_UseImages[pos].bmimg = NULL; + data->NList_UseImages[pos].imgobj = NULL; + data->NList_UseImages[pos].flags = 0; + pos++; + } + retval = TRUE; + } + if (redraw) + { + data->do_draw_all = data->do_draw_title = data->do_draw = TRUE; + data->do_parse = data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE; + } + return ((ULONG)retval); +} + + +IPTR mNL_CreateImage(struct IClass *cl,Object *obj,struct MUIP_NList_CreateImage *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + return (NL_CreateImage(data,msg->obj,msg->flags)); +} + + +IPTR mNL_DeleteImage(struct IClass *cl,Object *obj,struct MUIP_NList_DeleteImage *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + return (NL_DeleteImage(data,msg->listimg)); +} + + +IPTR mNL_UseImage(struct IClass *cl,Object *obj,struct MUIP_NList_UseImage *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + /*DoSuperMethodA(cl,obj,(Msg) msg);*/ + return (NL_UseImage(data,msg->obj,msg->imgnum,msg->flags)); +} diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_grp.c b/workbench/classes/zune/nlist/nlist_mcc/NList_grp.c new file mode 100644 index 0000000000..7689c22ce9 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_grp.c @@ -0,0 +1,140 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <clib/alib_protos.h> +#include <proto/muimaster.h> +#include <proto/intuition.h> + +#include "private.h" + +#include "NList_grp.h" + +struct MUI_CustomClass *NGR_Class = NULL; + +static IPTR mNGR_New(struct IClass *cl,Object *obj,struct opSet *msg) +{ + register struct NGRData *data; + + if (!(obj = (Object *)DoSuperMethodA(cl,obj,(Msg) msg))) + return(0); + + data = INST_DATA(cl,obj); + data->DoDraw = FALSE; + + return((IPTR) obj); +} + +/* + * static ULONG mNGR_Draw(struct IClass *cl,Object *obj,struct MUIP_Draw *msg) + * { + * register struct NGRData *data = INST_DATA(cl,obj); + * + * D(bug("%lx|group|draw0 %lx %lx \n",obj,msg->flags,muiAreaData(obj)->mad_Flags)); + * + * if (data->DoDraw) + * DoSuperMethodA(cl,obj,(Msg) msg); + * + * D(bug("%lx|group|draw1 %lx %lx \n",obj,msg->flags,muiAreaData(obj)->mad_Flags)); + * + * return(0); + * } + */ + +/* +static ULONG mNGR_Set(struct IClass *cl,Object *obj,Msg msg) +{ + register struct NGRData *data = INST_DATA(cl,obj); + struct TagItem *tags,*tag; + + for(tags = ((struct opSet *)msg)->ops_AttrList;(tag = (struct TagItem *) NextTagItem(&tags));) + { + switch (tag->ti_Tag) + { case MUIA_NList_Visible : + data->DoDraw = tag->ti_Data; + } + } + return (0); +} +*/ + +static IPTR mNGR_AskMinMax(struct IClass *cl,Object *obj,struct MUIP_AskMinMax *msg) +{ +// register struct NLData *data = INST_DATA(cl,obj); +/*D(bug("%lx|grp_AskMinMax() 1 \n",obj));*/ + DoSuperMethodA(cl,obj,(Msg) msg); +/*D(bug("%lx|grp_AskMinMax() 2 \n",obj));*/ + msg->MinMaxInfo->MinWidth = 2; + msg->MinMaxInfo->DefWidth = 20; + msg->MinMaxInfo->MaxWidth = MUI_MAXMAX+100; + msg->MinMaxInfo->MinHeight = 3; + msg->MinMaxInfo->DefHeight = 20+100; + msg->MinMaxInfo->MaxHeight = MUI_MAXMAX+100; +/* + * msg->MinMaxInfo->MinWidth += MUI_MAXMAX; + * msg->MinMaxInfo->DefWidth += MUI_MAXMAX; + * msg->MinMaxInfo->MaxWidth += MUI_MAXMAX; + * msg->MinMaxInfo->MinHeight += MUI_MAXMAX; + * msg->MinMaxInfo->DefHeight += MUI_MAXMAX; + * msg->MinMaxInfo->MaxHeight += MUI_MAXMAX; + * { + * LONG w = (LONG) msg->MinMaxInfo->DefWidth; + * LONG h = (LONG) msg->MinMaxInfo->DefHeight; + * LONG w1 = (LONG) msg->MinMaxInfo->MinWidth; + * LONG h1 = (LONG) msg->MinMaxInfo->MinHeight; + * D(bug("%lx|group|w=%ld h=%ld (%ld,%ld) \n",obj,w,h,w1,h1)); + * } + */ + return(0); +} + +DISPATCHER(NGR_Dispatcher) +{ + switch (msg->MethodID) + { + case OM_NEW : return (mNGR_New(cl,obj,(APTR)msg)); + case MUIM_AskMinMax : return (mNGR_AskMinMax(cl,obj,(APTR)msg)); + case OM_SET : return (0); + case MUIM_Draw : return (0); + case MUIM_HandleInput : return (0); + case MUIM_NoNotifySet : return (0); + } + return(DoSuperMethodA(cl,obj,msg)); +} + +struct MUI_CustomClass *NGR_Create(void) +{ + NGR_Class = MUI_CreateCustomClass(NULL, (STRPTR)MUIC_Group, NULL, sizeof(struct NGRData), ENTRY(NGR_Dispatcher)); + + return (NGR_Class); +} + + +void NGR_Delete(void) +{ + if (NGR_Class) + MUI_DeleteCustomClass(NGR_Class); + NGR_Class = NULL; +} + diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_grp.h b/workbench/classes/zune/nlist/nlist_mcc/NList_grp.h new file mode 100644 index 0000000000..72317fc0a5 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_grp.h @@ -0,0 +1,34 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +struct NGRData +{ + LONG DoDraw; +}; + +extern struct MUI_CustomClass *NGR_Class; + +struct MUI_CustomClass *NGR_Create(void); +void NGR_Delete(void); diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_img.c b/workbench/classes/zune/nlist/nlist_mcc/NList_img.c new file mode 100644 index 0000000000..d29cc3bed4 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_img.c @@ -0,0 +1,111 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <clib/alib_protos.h> +#include <proto/muimaster.h> +#include <proto/utility.h> +#include <proto/intuition.h> + +#include "private.h" + +#include "NList_img.h" + +struct MUI_CustomClass *NLI_Class = NULL; + +static IPTR mNLI_Draw(struct IClass *cl,Object *obj,struct MUIP_Draw *msg) +{ + register struct NLIData *data = INST_DATA(cl,obj); + if (data->DoDraw) + DoSuperMethodA(cl,obj,(Msg) msg); + + return(0); +} + + +static IPTR mNLI_New(struct IClass *cl,Object *obj,struct opSet *msg) +{ + register struct NLIData *data; + + if (!(obj = (Object *)DoSuperMethodA(cl,obj,(Msg) msg))) + return(0); + + data = INST_DATA(cl,obj); + data->DoDraw = FALSE; + + return((IPTR) obj); +} + + +static IPTR mNLI_Set(struct IClass *cl,Object *obj,Msg msg) +{ + register struct NLIData *data = INST_DATA(cl,obj); + struct TagItem *tags,*tag; + + for(tags=((struct opSet *)msg)->ops_AttrList;(tag=(struct TagItem *) NextTagItem((APTR)&tags));) + { + switch (tag->ti_Tag) + { + case MUIA_Image_Spec: + tag->ti_Tag = TAG_IGNORE; + data->DoDraw = TRUE; + MUI_Redraw(obj,MADF_DRAWOBJECT); + data->DoDraw = FALSE; + break; + case MUIA_FillArea: + case MUIA_Font: + case MUIA_Background: + tag->ti_Tag = TAG_IGNORE; + break; + } + } + return (DoSuperMethodA(cl,obj,msg)); +} + +DISPATCHER(NLI_Dispatcher) +{ + switch (msg->MethodID) + { + case OM_NEW : return ( mNLI_New(cl,obj,(APTR)msg)); + case MUIM_HandleInput : return (0); + case OM_SET : return ( mNLI_Set(cl,obj,(APTR)msg)); + case MUIM_Draw : return ( mNLI_Draw(cl,obj,(APTR)msg)); + } + return(DoSuperMethodA(cl,obj,msg)); +} + +struct MUI_CustomClass *NLI_Create(void) +{ + NLI_Class = MUI_CreateCustomClass(NULL, (STRPTR)MUIC_Image, NULL, sizeof(struct NLIData), ENTRY(NLI_Dispatcher)); + return (NLI_Class); +} + + +void NLI_Delete(void) +{ + if (NLI_Class) + MUI_DeleteCustomClass(NLI_Class); + NLI_Class = NULL; +} + diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_img.h b/workbench/classes/zune/nlist/nlist_mcc/NList_img.h new file mode 100644 index 0000000000..7cba53c306 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_img.h @@ -0,0 +1,36 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#define NImageObject NewObject(NLI_Class->mcc_Class,NULL + +struct NLIData +{ + LONG DoDraw; +}; + +extern struct MUI_CustomClass *NLI_Class; + +struct MUI_CustomClass *NLI_Create(void); +void NLI_Delete(void); diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_img2.c b/workbench/classes/zune/nlist/nlist_mcc/NList_img2.c new file mode 100644 index 0000000000..ca036f2f33 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_img2.c @@ -0,0 +1,112 @@ +#if 0 /* unused? */ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <clib/alib_protos.h> +#include <proto/muimaster.h> +#include <proto/utility.h> + +#include "private.h" + +#include "NList_img.h" +#include "NList_img2.h" + +struct MUI_CustomClass *NLI2_Class = NULL; + +static ULONG mNLI2_Draw(struct IClass *cl,Object *obj,struct MUIP_Draw *msg) +{ + register struct NLIData *data = INST_DATA(cl,obj); + if (data->DoDraw) + DoSuperMethodA(cl,obj,(Msg) msg); + + return(0); +} + + +static ULONG mNLI2_New(struct IClass *cl,Object *obj,struct opSet *msg) +{ + register struct NLIData *data; + + if (!(obj = (Object *)DoSuperMethodA(cl,obj,(Msg) msg))) + return(0); + + data = INST_DATA(cl,obj); + data->DoDraw = FALSE; + + return((ULONG) obj); +} + + +static ULONG mNLI2_Set(struct IClass *cl,Object *obj,Msg msg) +{ + register struct NLIData *data = INST_DATA(cl,obj); + struct TagItem *tags,*tag; + + for (tags=((struct opSet *)msg)->ops_AttrList;(tag=(struct TagItem *) NextTagItem(&tags));) + { + switch (tag->ti_Tag) + { + case MUIA_Image_Spec: + tag->ti_Tag = TAG_IGNORE; + data->DoDraw = TRUE; + MUI_Redraw(obj,MADF_DRAWOBJECT); + data->DoDraw = FALSE; + break; + case MUIA_FillArea: + case MUIA_Font: + case MUIA_Background: + tag->ti_Tag = TAG_IGNORE; + break; + } + } + return (DoSuperMethodA(cl,obj,msg)); +} + +DISPATCHER(NLI2_Dispatcher) +{ + switch (msg->MethodID) + { + case OM_NEW : return ( mNLI2_New(cl,obj,(APTR)msg)); + case OM_SET : return ( mNLI2_Set(cl,obj,(APTR)msg)); + case MUIM_Draw : return ( mNLI2_Draw(cl,obj,(APTR)msg)); + } + return(DoSuperMethodA(cl,obj,msg)); +} +extern DISPATCHERPROTO(NLI_Dispatcher); +struct MUI_CustomClass *NLI2_Create(void) +{ + NLI2_Class = MUI_CreateCustomClass(NULL, MUIC_Image, NULL, sizeof(struct NLIData), ENTRY(NLI_Dispatcher)); + //NLI2_Class = MUI_CreateCustomClass(NULL, MUIC_Image, NULL, sizeof(struct NLIData), ENTRY(NLI2_Dispatcher)); + return (NLI2_Class); +} + + +void NLI2_Delete(void) +{ + if (NLI2_Class) + MUI_DeleteCustomClass(NLI2_Class); + NLI2_Class = NULL; +} +#endif /* 0 */ diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_img2.h b/workbench/classes/zune/nlist/nlist_mcc/NList_img2.h new file mode 100644 index 0000000000..a5d3d59cf5 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_img2.h @@ -0,0 +1,37 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#define NImage2Object NewObject(NLI2_Class->mcc_Class,NULL + +struct NLI2Data +{ + APTR obj; + LONG DoDraw; +}; + +extern struct MUI_CustomClass *NLI2_Class; + +struct MUI_CustomClass *NLI2_Create(void); +void NLI2_Delete(void); diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_mcc.c b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc.c new file mode 100644 index 0000000000..2c58caad5c --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc.c @@ -0,0 +1,1631 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <string.h> +#include <stdlib.h> + +#include <dos/dosextens.h> +#include <clib/alib_protos.h> + +#ifndef NO_INLINE_STDARG +#define NO_INLINE_STDARG +#endif + +#include <proto/muimaster.h> +#include <proto/diskfont.h> +#include <proto/graphics.h> +#include <proto/utility.h> +#include <proto/exec.h> +#include <proto/intuition.h> + +#include "private.h" + +#include "NList_func.h" +#include "NList_grp.h" + +#include "NListviews_mcp.h" + +/* IO macros */ +/* + *#define IO_SIGBIT(req) ((LONG)(((struct IORequest *)req)->io_Message.mn_ReplyPort->mp_SigBit)) + *#define IO_SIGMASK(req) ((LONG)(1L<<IO_SIGBIT(req))) + */ + + +DEFAULT_KEYS_ARRAY + +#define INIT_PEN(attr,var_dest,test_init) \ + { \ + var_dest = -1; \ + if((tag = FindTagItem(attr, msg->ops_AttrList))) \ + { \ + test_init = tag->ti_Data; \ + } \ + else \ + test_init = FALSE; \ + } + +#define INIT_BG(attr,var_dest,test_init) \ + { \ + var_dest = -1; \ + if((tag = FindTagItem(attr, msg->ops_AttrList))) \ + { \ + var_dest = tag->ti_Data; \ + test_init = TRUE; \ + } \ + else \ + test_init = FALSE; \ + } + + +#define LOAD_PEN(test,var_dest,cfg_attr,defaultval) \ + { \ + if (!test) \ + { \ + IPTR ptrd; \ + if (DoMethod(obj, MUIM_GetConfigItem, cfg_attr, &ptrd)) \ + obtain_pen(obj, &(var_dest), (struct MUI_PenSpec *)ptrd); \ + else \ + obtain_pen(obj, &(var_dest), (struct MUI_PenSpec *)(defaultval)); \ + } \ + else \ + obtain_pen(obj, &(var_dest), (struct MUI_PenSpec *)(test)); \ + } + +#define LOAD_BG(test,var_dest,cfg_attr,defaultval) \ + { \ + if (!test) \ + { \ + IPTR ptrd; \ + if (DoMethod(obj, MUIM_GetConfigItem, cfg_attr, &ptrd)) \ + var_dest = ptrd; \ + else \ + var_dest = (IPTR)(defaultval); \ + } \ + } + + +HOOKPROTONH(NL_ConstructFunc_String, APTR, APTR pool, char *str) +{ + char *new; + LONG len = 0; + + while(str[len] != '\0' && str[len] != '\n' && str[len] != '\r' ) + { + len++; + } + + if((new = (char *)AllocVecPooled(pool, len+1)) != NULL) + { + memcpy(new, str, len*sizeof(char)); + new[len] = '\0'; // we have to terminate with a \0 + } + + return((APTR)new); +} +MakeHook(NL_ConstructHook_String, NL_ConstructFunc_String); + +HOOKPROTONH(NL_DestructFunc_String, void, APTR pool, char *entry) +{ + FreeVecPooled(pool, entry); +} +MakeHook(NL_DestructHook_String, NL_DestructFunc_String); + +HOOKPROTONHNO(NL_LayoutFuncNList, ULONG, struct MUI_LayoutMsg *lm) +{ + switch (lm->lm_Type) + { + case MUILM_MINMAX: + { + lm->lm_MinMax.MinWidth = 1; + lm->lm_MinMax.DefWidth = 1; + lm->lm_MinMax.MaxWidth = 1; + lm->lm_MinMax.MinHeight = 1; + lm->lm_MinMax.DefHeight = 1; + lm->lm_MinMax.MaxHeight = 1; + + return(0); + //return (MUILM_UNKNOWN); + } + break; + + case MUILM_LAYOUT: + { + Object *cstate = (Object *)lm->lm_Children->mlh_Head; + Object *child; + LONG mw,mh; + + while((child = NextObject(&cstate))) + { + mw = (LONG) _defwidth(child); + mh = (LONG) _defheight(child); + + if(!MUI_Layout(child,lm->lm_Layout.Width+MUI_MAXMAX,lm->lm_Layout.Height+MUI_MAXMAX,mw,mh,0)) + { + /*return(FALSE);*/ + } + } + + return(TRUE); + } + break; + } + + return(MUILM_UNKNOWN); +} +MakeStaticHook(NL_LayoutHookNList, NL_LayoutFuncNList); + +HOOKPROTONHNO(NL_LayoutFuncGroup, ULONG, struct MUI_LayoutMsg *lm) +{ + switch (lm->lm_Type) + { + case MUILM_MINMAX: + { + lm->lm_MinMax.MinWidth = 2; + lm->lm_MinMax.DefWidth = 20; + lm->lm_MinMax.MaxWidth = MUI_MAXMAX+100; + lm->lm_MinMax.MinHeight = 2; + lm->lm_MinMax.DefHeight = 20+100; + lm->lm_MinMax.MaxHeight = MUI_MAXMAX+100; + + return(0); + //return (MUILM_UNKNOWN); + } + break; + + case MUILM_LAYOUT: + { + Object *cstate = (Object *)lm->lm_Children->mlh_Head; + Object *child; + LONG mw,mh; + + while((child = NextObject(&cstate))) + { + mw = (LONG) _defwidth(child); + mh = (LONG) _defheight(child); + + if (!MUI_Layout(child,0,0,mw,mh,0)) + { + /*return(FALSE);*/ + } + } + return(TRUE); + } + break; + } + + return(MUILM_UNKNOWN); +} +MakeStaticHook(NL_LayoutHookGroup, NL_LayoutFuncGroup); + + +void release_pen(Object *obj, ULONG *pen) +{ + if(*pen != (ULONG)-1) + { + MUI_ReleasePen(muiRenderInfo(obj), *pen); + *pen = (ULONG)-1; + } +} + + +void obtain_pen(Object *obj, ULONG *pen, struct MUI_PenSpec *ps) +{ + release_pen(obj, pen); + *pen = MUI_ObtainPen(muiRenderInfo(obj), ps, 0); +} + +#if !defined(__MORPHOS__) +#ifdef __AROS__ +static __attribute__ ((noinline)) Object * VARARGS68K DoSuperNew(struct IClass *cl, Object *obj, Tag tag1, ...) +{ + AROS_SLOWSTACKTAGS_PRE_AS(tag1, Object *) + retval = (Object *)DoSuperMethod(cl, obj, OM_NEW, AROS_SLOWSTACKTAGS_ARG(tag1), NULL); + AROS_SLOWSTACKTAGS_POST +} +#else +static Object * VARARGS68K DoSuperNew(struct IClass *cl, Object *obj, ...) +{ + Object *rc; + VA_LIST args; + + ENTER(); + + VA_START(args, obj); + rc = (Object *)DoSuperMethod(cl, obj, OM_NEW, VA_ARG(args, ULONG), NULL); + VA_END(args); + + RETURN(rc); + return rc; +} +#endif +#endif // !__MORPHOS__ + +IPTR mNL_New(struct IClass *cl,Object *obj,struct opSet *msg) +{ + struct NLData *data; + //$$$$Sensei: msg->ops_AttrList is changed to taglist EVERYWHERE in OM_NEW!!! + // It should speed up a bit. + struct TagItem *tag; + struct TagItem *taglist = msg->ops_AttrList; + LONG DragType = MUIV_NList_DragType_None; + LONG DragSortable = FALSE; /*FALSE*/ + LONG Draggable = FALSE; /*FALSE*/ + LONG Dropable = TRUE; /*TRUE*/ + LONG dropable = TRUE; /*TRUE*/ + STRPTR ShortHelp = NULL; // RHP: Added for Special ShortHelp + APTR img_tr,grp; + const char *img_name = "noimage"; + + if((tag = FindTagItem(MUIA_ShortHelp, taglist))) + ShortHelp = (STRPTR)tag->ti_Data; + + if((tag = FindTagItem(MUIA_FixHeightTxt, taglist))) + tag->ti_Tag = TAG_IGNORE; + + if((tag = FindTagItem(MUIA_FixWidthTxt, taglist))) + tag->ti_Tag = TAG_IGNORE; + + if((tag = FindTagItem(MUIA_Draggable, taglist))) + { + Draggable = tag->ti_Data; + tag->ti_Tag = TAG_IGNORE; + } + + if((tag = FindTagItem(MUIA_Dropable, taglist))) + { + Dropable = dropable = tag->ti_Data; + tag->ti_Tag = TAG_IGNORE; + } + + if((tag = FindTagItem(MUIA_NList_DragSortable, taglist)) || + (tag = FindTagItem(MUIA_List_DragSortable, taglist))) + { + DragSortable = tag->ti_Data; + tag->ti_Tag = TAG_IGNORE; + } + + if((tag = FindTagItem(MUIA_NList_DragType, taglist)) || + (tag = FindTagItem(MUIA_Listview_DragType, taglist))) + { + DragType = tag->ti_Data; + tag->ti_Tag = TAG_IGNORE; + } + + if((DragType != MUIV_NList_DragType_None) || DragSortable) + Draggable = TRUE; + else if (Draggable) + DragType = MUIV_NList_DragType_Default; + else + { + DragType = MUIV_NList_DragType_None; + DragSortable = FALSE; + } + + if(DragSortable) + dropable = TRUE; + + obj = (Object *) DoSuperNew(cl,obj, + MUIA_Group_LayoutHook, &NL_LayoutHookNList, + MUIA_FillArea, FALSE, + MUIA_Dropable, dropable, + NoFrame, + Child, grp = NewObject(NGR_Class->mcc_Class,NULL, + MUIA_Group_LayoutHook, &NL_LayoutHookGroup, + MUIA_FillArea, FALSE, + NoFrame, + Child, img_tr = MUI_NewObject(MUIC_Image, + MUIA_FillArea,FALSE, + MUIA_Image_Spec,img_name, +/* + * MUIA_Image_FontMatch, TRUE, + * MUIA_Font, Topaz_8, + * MUIA_Image_State, IDS_NORMAL, + */ + End, + /*Child, HVSpace,*/ + End, + TAG_MORE, taglist + ); + + + if(obj == NULL || (data = INST_DATA(cl, obj)) == NULL) + return(0); + + data->this = obj; + data->nlistviewobj = NULL; + data->listviewobj = NULL; + data->scrollersobj = NULL; + data->SETUP = FALSE; + data->SHOW = FALSE; + data->DRAW = 0; + data->ncl = cl; + data->ocl = OCLASS(obj); + data->rp = NULL; + data->NL_Group = grp; + + data->NList_Title = NULL; + data->NList_TitleSeparator = TRUE; + data->NList_TitleMark = MUIV_NList_TitleMark_None; + data->NList_TitleMark2 = MUIV_NList_TitleMark2_None; + data->NList_IgnoreSpecialChars = NULL; + data->NList_LastInserted = -1; + data->NList_Quiet = 0; + data->NList_AffActive = MUIV_NList_Active_Off; + data->NList_Active = MUIV_NList_Active_Off; + data->NList_Smooth = DEFAULT_SMOOTHSCROLL; + data->VertPropObject = NULL; + data->NList_AffFirst = 0; + data->NList_AffFirst_Incr = 0; + data->NList_First = 0; + data->NList_First_Incr = 0; + data->NList_Visible = 50000; + data->NList_Entries = 0; + data->NList_Prop_First = 0; + data->NList_Prop_First_Prec = 0; + data->NList_Prop_First_Real = 0; + data->NList_Prop_Add = 0; + data->NList_Prop_Wait = 2; + data->NList_Prop_Visible = 0; + data->NList_Prop_Entries = 0; + data->NList_Horiz_AffFirst = 0; + data->NList_Horiz_First = 0; + data->NList_Horiz_Visible = 0; + data->NList_Horiz_Entries = 0; + data->old_prop_visible = -1; + data->old_prop_entries = -1; + data->old_prop_delta = -1; + data->old_horiz_visible = -1; + data->old_horiz_entries = -1; + data->old_horiz_delta = -1; + data->NList_MultiSelect = MUIV_NList_MultiSelect_None; + data->NList_Input = TRUE; + data->NList_DefaultObjectOnClick = TRUE; + data->NList_ActiveObjectOnClick = FALSE; + data->NList_KeepActive = 0; + data->NList_MakeActive = 0; + data->NList_AutoVisible = FALSE; + data->NList_Font = 0; + data->NList_DragType = DragType; + data->NList_Dropable = Dropable; + data->NList_DragColOnly = -1; + data->NList_DragSortable = DragSortable; + data->NList_DropMark = -1; + data->NList_SortType = MUIV_NList_SortType_None; + data->NList_SortType2 = MUIV_NList_SortType_None; + data->NList_ButtonClick = -1; + data->NList_SerMouseFix = DEFAULT_SERMOUSEFIX; + data->NList_Keys = default_keys; + data->NList_ShortHelp = ShortHelp; // RHP: Added for Special ShortHelp + data->Wheel_Keys = NULL; + data->pushtrigger = 0; + data->marktype = 0; + data->NList_ShowDropMarks = TRUE; + data->NImage2 = NULL; + data->NImage.NImgObj = img_tr; + data->NImage.ImgName = (char *)img_name; + data->NImage.next = NULL; + data->multiselect = MUIV_NList_MultiSelect_None; + data->multisel_qualifier = 0; + data->drag_qualifier = 0; + data->InUseFont = NULL; + data->badrport = FALSE; + data->moves = FALSE; + data->multiclick = 0; + data->multiclickalone = 0; + data->click_line = -2; + data->click_x = 0; + data->click_y = 0; + data->NList_SelectChange = FALSE; + data->EntriesArray = NULL; + data->LastEntry = 0; + data->vpos = 1; + data->voff = 1; + data->vinc = 1; + data->addvinc = 1; + data->hpos = 1; + data->adding_member = 0; + data->format_chge = 1; + data->do_draw_all = TRUE; + data->do_draw_title = TRUE; + data->do_draw_active = TRUE; + data->do_draw = TRUE; + data->do_parse = TRUE; + data->do_setcols = TRUE; + data->do_updatesb = TRUE; + data->do_wwrap = TRUE; + data->force_wwrap = FALSE; + data->do_images = TRUE; + data->nodraw = 1; + data->drawsuper = FALSE; + data->dropping = FALSE; + data->markdraw = FALSE; + data->markerase = FALSE; + data->markdrawnum = -1; + data->markerasenum = -1; + data->NumIntuiTick = 0; + data->sorted = FALSE; + data->selectmode = TE_Select_Line; + data->first_change = LONG_MAX; + data->last_change = LONG_MIN; + data->lastselected = MUIV_NList_Active_Off; + data->lastactived = MUIV_NList_Active_Off; + data->selectskiped = FALSE; + data->NList_ListBackGround = -1; + data->actbackground = -1; + data->NList_CompareHook = NULL; + data->NList_ConstructHook = NULL; + data->NList_DestructHook = NULL; + data->NList_DisplayHook = NULL; + data->NList_MultiTestHook = NULL; + data->NList_CopyEntryToClipHook = NULL; + data->NList_CopyColumnToClipHook = NULL; + data->NList_CompareHook2 = FALSE; + data->NList_ConstructHook2 = FALSE; + data->NList_DestructHook2 = FALSE; + data->NList_DisplayHook2 = FALSE; + data->NList_CopyEntryToClipHook2 = FALSE; + data->NList_CopyColumnToClipHook2 = FALSE; +/* + data->NList_Pool = NULL; + data->NList_PoolPuddleSize = 2008; + data->NList_PoolThreshSize = 1024; +*/ + data->NList_MinLineHeight = 5; + data->MinImageHeight = 5; + data->NList_AdjustHeight = 0; + data->NList_AdjustWidth = 0; + data->NList_SourceArray = 0; + data->NList_DefClickColumn = 0; + data->NList_AutoCopyToClip = TRUE; + data->NList_AutoClip = TRUE; + data->NList_UseImages = NULL; + data->NList_TabSize = 8; + data->NList_SkipChars = NULL; + data->NList_WordSelectChars = NULL; + data->NList_EntryValueDependent = FALSE; + data->NList_DragLines = DEFAULT_DRAGLINES; + data->NList_WheelStep = DEFAULT_WHEELSTEP; + data->NList_WheelFast = DEFAULT_WHEELFAST; + data->NList_WheelMMB = DEFAULT_WHEELMMB; + data->NList_PrivateData = NULL; + data->NList_ContextMenu = data->ContextMenu = data->ContextMenuOn = MUIV_NList_ContextMenu_Default; + data->ListCompatibility = FALSE; + data->NList_Disabled = FALSE; + data->MenuObj = NULL; + data->LastImage = 0; + data->DragRPort = NULL; + data->cols = NULL; + data->Title_PixLen = -1; + data->numcols = 0; + data->numcols2 = 0; + data->column[0] = -1; + data->aff_infos = NULL; + data->numaff_infos = 0; + data->spacesize = 6; + data->tabsize = data->spacesize * data->NList_TabSize; +// data->NList_Pool_Given = FALSE; + data->NList_TypeSelect = MUIV_NList_TypeSelect_Line; + data->min_sel = 1; + data->max_sel = 1; + data->sel_pt[0].ent = -1; + data->sel_pt[1].ent = -1; + data->minx_change_entry = -1; + data->maxx_change_entry = -1; + data->drag_border = FALSE; + data->ScrollBarsPos = -4; + data->ScrollBars = 0; + data->ScrollBarsOld = 0; + data->ScrollBarsTime = 0; + data->display_ptr = NULL; + data->Notify = 0; + data->DoNotify = 0; + data->Notifying = 0; + data->TitleClick = -1; + data->TitleClick2 = -1; + data->NList_ForcePen = MUIV_NList_ForcePen_Default; + data->ForcePen = DEFAULT_FORCEPEN; + data->UpdatingScrollbars = FALSE; + data->UpdateScrollersRedrawn = FALSE; + data->drawall_bits = 0; + data->drawall_dobit = 0; + data->refreshing = FALSE; + data->VirtGroup = NULL; + data->VirtGroup2 = NULL; + data->VirtClass = NULL; + data->NList_ColWidthDrag = DEFAULT_CWD; + data->NList_PartialCol = DEFAULT_PARTIALCOL; + data->NList_PartialChar = DEFAULT_PARTIALCHAR; + data->NList_List_Select = MUIV_NList_Select_List; + data->NList_MinColSortable = 1; + data->NList_Imports = MUIV_NList_Imports_Active | MUIV_NList_Imports_First | MUIV_NList_Imports_Cols; + data->NList_Exports = MUIV_NList_Exports_Active | MUIV_NList_Exports_First | MUIV_NList_Exports_Cols; + data->affover = -1; // RHP: Added for Shorthelp + data->affbutton = -1; + data->affbuttonline = -1; + data->affbuttoncol = -1; + data->affbuttonstate = 0; + data->storebutton = TRUE; + data->SizePointerObj = NULL; + data->MovePointerObj = NULL; + data->NList_SelectPointer = DEFAULT_SELECTPOINTER; + data->SelectPointerObj = NULL; + data->activeCustomPointer = PT_NONE; + data->MOUSE_MOVE = FALSE; + data->pad1 = -1; + data->pad2 = TRUE; + data->isActiveObject = FALSE; + data->NList_KeyUpFocus = NULL; + data->NList_KeyDownFocus = NULL; + data->NList_KeyLeftFocus = NULL; + data->NList_KeyRightFocus = NULL; + +/*D(bug("%lx|NEW 1 \n",obj));*/ + + //$$$Sensei: major rewrite memory handling. PuddleSize and ThreshSize takes memory, nothing else. + /* User pool was specified passed? */ + if(( tag = FindTagItem( MUIA_NList_Pool, taglist ) ) || + ( tag = FindTagItem( MUIA_List_Pool, taglist ) ) ) + { + data->Pool = (APTR)tag->ti_Data; + } + else + { + ULONG puddleSize = GetTagData(MUIA_NList_PoolPuddleSize, GetTagData(MUIA_List_PoolPuddleSize, MUIV_NList_PoolPuddleSize_Default, taglist), taglist); + ULONG threshold = GetTagData(MUIA_NList_PoolThreshSize, GetTagData(MUIA_List_PoolThreshSize, MUIV_NList_PoolThreshSize_Default, taglist), taglist); + + /* Create internal pool using specified parameters or default one. */ + #if defined(__amigaos4__) + data->Pool = AllocSysObjectTags(ASOT_MEMPOOL, ASOPOOL_MFlags, MEMF_SHARED, + ASOPOOL_Puddle, puddleSize, + ASOPOOL_Threshold, threshold, + ASOPOOL_Name, "NList.mcc pool", + TAG_DONE); + #else + data->Pool = CreatePool(MEMF_ANY, puddleSize, threshold); + #endif + + data->PoolInternal = data->Pool; + } + + #if defined(__amigaos4__) + // for OS4 we create an ItemPool + data->EntryPool = AllocSysObjectTags(ASOT_ITEMPOOL, ASOITEM_MFlags, MEMF_SHARED, + ASOITEM_ItemSize, sizeof(struct TypeEntry), + ASOITEM_BatchSize, 1024, + ASOITEM_GCPolicy, ITEMGC_AFTERCOUNT, + TAG_DONE); + #else + // all other systems use a standard pool with puddle size and threshold set appropriately + data->EntryPool = CreatePool(MEMF_ANY, sizeof(struct TypeEntry) * 1024, sizeof(struct TypeEntry) * 1024); + #endif + + // are pools available? + if(data->Pool == NULL || data->EntryPool == NULL) + { + CoerceMethod(cl, obj, OM_DISPOSE); + return(0); + } + + if ((tag = FindTagItem(MUIA_NList_ConstructHook, taglist)) || + (tag = FindTagItem(MUIA_List_ConstructHook, taglist))) + { + if (tag->ti_Data == (ULONG)MUIV_NList_ConstructHook_String) + data->NList_ConstructHook = (struct Hook *) &NL_ConstructHook_String; + else + data->NList_ConstructHook = (struct Hook *) tag->ti_Data; + } + if ((tag = FindTagItem(MUIA_NList_DestructHook, taglist)) || + (tag = FindTagItem(MUIA_List_DestructHook, taglist))) + { + if (tag->ti_Data == (ULONG)MUIV_NList_DestructHook_String) + data->NList_DestructHook = (struct Hook *) &NL_DestructHook_String; + else + data->NList_DestructHook = (struct Hook *) tag->ti_Data; + } + + if((tag = FindTagItem(MUIA_NList_ListCompatibility, taglist))) + data->ListCompatibility = TRUE; + else + data->ListCompatibility = FALSE; + + if((tag = FindTagItem(MUIA_Disabled, taglist))) + data->NList_Disabled = 1; + else + data->NList_Disabled = FALSE; + + if((tag = FindTagItem(MUIA_NList_CompareHook, taglist)) || + (tag = FindTagItem(MUIA_List_CompareHook, taglist))) + { + data->NList_CompareHook = (struct Hook *) tag->ti_Data; + } + + if((tag = FindTagItem(MUIA_NList_DisplayHook, taglist)) || + (tag = FindTagItem(MUIA_List_DisplayHook, taglist))) + { + data->NList_DisplayHook = (struct Hook *) tag->ti_Data; + } + + if((tag = FindTagItem(MUIA_NList_MultiTestHook, taglist)) || + (tag = FindTagItem(MUIA_List_MultiTestHook, taglist))) + { + data->NList_MultiTestHook = (struct Hook *) tag->ti_Data; + } + + if((tag = FindTagItem(MUIA_NList_CopyEntryToClipHook, taglist))) + data->NList_CopyEntryToClipHook = (struct Hook *) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_CopyColumnToClipHook, taglist))) + data->NList_CopyColumnToClipHook = (struct Hook *) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_ConstructHook2, taglist))) + { + data->NList_ConstructHook = (struct Hook *) tag->ti_Data; + data->NList_ConstructHook2 = TRUE; + } + + if((tag = FindTagItem(MUIA_NList_DestructHook2, taglist))) + { + data->NList_DestructHook = (struct Hook *) tag->ti_Data; + data->NList_DestructHook2 = TRUE; + } + + if((tag = FindTagItem(MUIA_NList_CompareHook2, taglist))) + { + data->NList_CompareHook = (struct Hook *) tag->ti_Data; + data->NList_CompareHook2 = TRUE; + } + + if((tag = FindTagItem(MUIA_NList_DisplayHook2, taglist))) + { + data->NList_DisplayHook = (struct Hook *) tag->ti_Data; + data->NList_DisplayHook2 = TRUE; + } + + if((tag = FindTagItem(MUIA_NList_CopyEntryToClipHook2, taglist))) + { + data->NList_CopyEntryToClipHook = (struct Hook *) tag->ti_Data; + data->NList_CopyEntryToClipHook2 = TRUE; + } + + if((tag = FindTagItem(MUIA_NList_CopyColumnToClipHook2, taglist))) + { + data->NList_CopyColumnToClipHook = (struct Hook *) tag->ti_Data; + data->NList_CopyColumnToClipHook2 = TRUE; + } + + if((tag = FindTagItem(MUICFG_NList_ForcePen, taglist))) + data->NList_ForcePen = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_Format, taglist)) || + (tag = FindTagItem(MUIA_List_Format, taglist))) + { + data->NList_Format = (char *) tag->ti_Data; + if (!NL_Read_Format(data,(char *) tag->ti_Data,(tag->ti_Tag == MUIA_List_Format))) + { + CoerceMethod(cl, obj, OM_DISPOSE); + return(0); + } + } + else + { + data->NList_Format = NULL; + if (!NL_Read_Format(data, (char *)"",FALSE)) + { + CoerceMethod(cl, obj, OM_DISPOSE); + return(0); + } + } + + if (!NeedAffInfo(data,AFFINFOS_START_MAX)) + { + CoerceMethod(cl, obj, OM_DISPOSE); + return(0); + } +/*D(bug("%lx|NEW 5 \n",obj));*/ + + if ((tag = FindTagItem(MUIA_NList_Input, taglist)) || + (tag = FindTagItem(MUIA_Listview_Input, taglist))) + data->NList_Input = tag->ti_Data; + + if(!FindTagItem(MUIA_Frame, taglist)) + { + if (data->NList_Input) + { + nnset(obj,MUIA_Frame, MUIV_Frame_InputList); + } + else + { + nnset(obj,MUIA_Frame, MUIV_Frame_ReadList); + } + } + + if((tag = FindTagItem(MUIA_ContextMenu, taglist))) + { + data->NList_ContextMenu = data->ContextMenu = data->ContextMenuOn = tag->ti_Data; + } + else + notdoset(obj,MUIA_ContextMenu,data->ContextMenu); + + if((tag = FindTagItem(MUIA_Font, taglist))) + data->NList_Font = tag->ti_Data; + else if (!data->ListCompatibility) + data->NList_Font = MUIV_NList_Font; + else + data->NList_Font = MUIV_Font_List; + + if((tag = FindTagItem(MUIA_NList_AutoCopyToClip, taglist))) + data->NList_AutoCopyToClip = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_AutoClip, taglist))) + data->NList_AutoClip = (BOOL)tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_TabSize, taglist))) + data->NList_TabSize = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_SkipChars, taglist))) + data->NList_SkipChars = (char *) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_WordSelectChars, taglist))) + data->NList_WordSelectChars = (char *) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_EntryValueDependent, taglist))) + data->NList_EntryValueDependent = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_PrivateData, taglist))) + data->NList_PrivateData = (APTR) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_Title, taglist)) || + (tag = FindTagItem(MUIA_List_Title, taglist))) + { + data->NList_Title = (char *) tag->ti_Data; + } + + if((tag = FindTagItem(MUIA_NList_TitleSeparator, taglist))) + data->NList_TitleSeparator = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_TitleClick, taglist))) + WANT_NOTIFY(NTF_TitleClick); + + if((tag = FindTagItem(MUIA_NList_TitleClick2, taglist))) + WANT_NOTIFY(NTF_TitleClick2); + + if((tag = FindTagItem(MUIA_NList_MultiSelect, taglist)) || + (tag = FindTagItem(MUIA_Listview_MultiSelect, taglist))) + { + data->multiselect = data->NList_MultiSelect = (LONG) tag->ti_Data; + } + + if((tag = FindTagItem(MUIA_NList_DefaultObjectOnClick, taglist))) + data->NList_DefaultObjectOnClick = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_ActiveObjectOnClick, taglist))) + { + data->NList_ActiveObjectOnClick = (BOOL)tag->ti_Data; + if(data->NList_ActiveObjectOnClick) + { + // disable that the object will automatically get a border when + // the ActiveObjectOnClick option is active + _flags(obj) |= (1<<7); + } + } + + if((tag = FindTagItem(MUIA_NList_MinLineHeight, taglist))) + data->NList_MinLineHeight = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_List_MinLineHeight, taglist))) + data->NList_MinLineHeight = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_TypeSelect, taglist))) + data->NList_TypeSelect = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_AutoVisible, taglist)) || + (tag = FindTagItem(MUIA_List_AutoVisible, taglist))) + { + data->NList_AutoVisible = (LONG) tag->ti_Data; + } + + if((tag = FindTagItem(MUIA_NList_DefClickColumn, taglist)) || + (tag = FindTagItem(MUIA_Listview_DefClickColumn, taglist))) + { + data->NList_DefClickColumn = (LONG) tag->ti_Data; + } + + if((tag = FindTagItem(MUIA_NList_ShowDropMarks, taglist)) || + (tag = FindTagItem(MUIA_List_ShowDropMarks, taglist))) + { + data->NList_ShowDropMarks = (LONG) tag->ti_Data; + } + + if((tag = FindTagItem(MUIA_NList_DragColOnly, taglist))) + data->NList_DragColOnly = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_SortType, taglist))) + data->NList_SortType = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_SortType2, taglist))) + data->NList_SortType2 = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_MinColSortable, taglist))) + data->NList_MinColSortable = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_Imports, taglist))) + data->NList_Imports = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_Exports, taglist))) + data->NList_Exports = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_TitleMark, taglist))) + data->NList_TitleMark = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_TitleMark2, taglist))) + data->NList_TitleMark2 = (LONG) tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_Columns, taglist))) + NL_Columns(data,(BYTE *) tag->ti_Data); + + if((tag = FindTagItem(MUIA_NList_KeyUpFocus, taglist))) + data->NList_KeyUpFocus = (Object *)tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_KeyDownFocus, taglist))) + data->NList_KeyDownFocus = (Object *)tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_KeyLeftFocus, taglist))) + data->NList_KeyLeftFocus = (Object *)tag->ti_Data; + + if((tag = FindTagItem(MUIA_NList_KeyRightFocus, taglist))) + data->NList_KeyRightFocus = (Object *)tag->ti_Data; + + if (data->NList_DragSortable) + data->NList_ShowDropMarks = TRUE; + +/*D(bug("%lx|NEW 6 \n",obj));*/ + + INIT_PEN(MUIA_NList_TitlePen, data->NList_TitlePen, data->Pen_Title_init); + INIT_PEN(MUIA_NList_ListPen, data->NList_ListPen, data->Pen_List_init); + INIT_PEN(MUIA_NList_SelectPen, data->NList_SelectPen, data->Pen_Select_init); + INIT_PEN(MUIA_NList_CursorPen, data->NList_CursorPen, data->Pen_Cursor_init); + INIT_PEN(MUIA_NList_UnselCurPen,data->NList_UnselCurPen,data->Pen_UnselCur_init); + INIT_PEN(MUIA_NList_InactivePen,data->NList_InactivePen,data->Pen_Inactive_init); + + INIT_BG(MUIA_NList_TitleBackground, data->NList_TitleBackGround, data->BG_Title_init); + INIT_BG(MUIA_Background, data->NList_ListBackGround, data->BG_List_init); + if (!data->BG_List_init) + INIT_BG(MUIA_NList_ListBackground, data->NList_ListBackGround, data->BG_List_init); + INIT_BG(MUIA_NList_SelectBackground, data->NList_SelectBackground, data->BG_Select_init); + INIT_BG(MUIA_NList_CursorBackground, data->NList_CursorBackground, data->BG_Cursor_init); + INIT_BG(MUIA_NList_UnselCurBackground,data->NList_UnselCurBackground,data->BG_UnselCur_init); + INIT_BG(MUIA_NList_InactiveBackground,data->NList_InactiveBackground,data->BG_Inactive_init); + +/* + * for (tags=((struct opSet *)msg)->ops_AttrList;tag=NextTagItem(&tags);) + * { switch (tag->ti_Tag) + * { case MYATTR_PEN: + * if (tag->ti_Data) + * data->penspec = *((struct MUI_PenSpec *)tag->ti_Data); + * break; + * } + * } + */ + +/*D(bug("%lx|NEW 7 \n",obj));*/ + if((tag = FindTagItem(MUIA_NList_AdjustHeight, taglist))) + { + if (tag->ti_Data) + data->NList_AdjustHeight = -1; + } + + if((tag = FindTagItem(MUIA_NList_AdjustWidth, taglist))) + { + if (tag->ti_Data) + data->NList_AdjustWidth = -1; + } + + if((tag = FindTagItem(MUIA_NList_SourceInsert, taglist)) && tag->ti_Data) + { + struct MUIP_NList_InsertWrap *ins = (struct MUIP_NList_InsertWrap *) tag->ti_Data; + + NL_List_Insert(data,ins->entries,ins->count,ins->pos,ins->wrapcol,ins->align & ALIGN_MASK,0); + + if(data->NList_Entries > 0) + data->NList_SourceArray = 1; + + if((tag = FindTagItem(MUIA_NList_First, taglist))) + NL_List_First(data,(long) tag->ti_Data,tag); + + if((tag = FindTagItem(MUIA_NList_Active, taglist))) + NL_List_Active(data,(long) tag->ti_Data,tag,MUIV_NList_Select_None,FALSE,0); + } + else if((tag = FindTagItem(MUIA_NList_SourceString, taglist)) && tag->ti_Data) + { + NL_List_Insert(data,(APTR *) tag->ti_Data,-2,MUIV_NList_Insert_Bottom,0,0,0); + + if(data->NList_Entries > 0) + data->NList_SourceArray = 1; + + if((tag = FindTagItem(MUIA_NList_First, taglist))) + NL_List_First(data,(long) tag->ti_Data,tag); + + if((tag = FindTagItem(MUIA_NList_Active, taglist))) + NL_List_Active(data,(long) tag->ti_Data,tag,MUIV_NList_Select_None,FALSE,0); + } + else if((tag = FindTagItem(MUIA_NList_SourceArray, taglist)) || + (tag = FindTagItem(MUIA_List_SourceArray, taglist))) + { + NL_List_Insert(data,(APTR *) tag->ti_Data,-1,MUIV_NList_Insert_Bottom,0,0,0); + + if(data->NList_Entries > 0) + data->NList_SourceArray = 1; + + if((tag = FindTagItem(MUIA_NList_First, taglist))) + NL_List_First(data,(long) tag->ti_Data,tag); + + if((tag = FindTagItem(MUIA_NList_Active, taglist))) + NL_List_Active(data,(long) tag->ti_Data,tag,MUIV_NList_Select_None,FALSE,0); + } + + if((tag = FindTagItem(MUIA_NList_IgnoreSpecialChars, taglist))) + data->NList_IgnoreSpecialChars = (const char *)tag->ti_Data; + + data->ihnode.ihn_Object = obj; + data->ihnode.ihn_Millis = 30; + data->ihnode.ihn_Method = MUIM_NList_Trigger; + data->ihnode.ihn_Flags = MUIIHNF_TIMER; + + set(obj,MUIA_FillArea,(LONG) FALSE); + +/*D(bug("%lx|NEW 9 \n",obj));*/ + + return((IPTR)obj); +} + + +IPTR mNL_Dispose(struct IClass *cl,Object *obj,Msg msg) +{ + register struct NLData *data; + data = INST_DATA(cl,obj); + +/*D(bug("%lx|mNL_Dispose() 1 \n",obj));*/ + + data->NList_Quiet = 1; + data->SETUP = 3; + + NL_List_Clear(data); + + data->format_chge = data->do_draw_all = data->do_draw_title = data->do_draw_active = data->do_draw = FALSE; + data->do_parse = data->do_images = data->do_setcols = data->do_updatesb = data->do_wwrap = data->force_wwrap = FALSE; + data->Notify = data->DoNotify = data->Notifying = 0; + + if (data->MenuObj) + { + MUI_DisposeObject(data->MenuObj); + data->MenuObj = NULL; + } + + DeleteNImages2(data); + + DeleteNImages(data); + + if (data->NList_UseImages) + FreeVecPooled(data->Pool, data->NList_UseImages); + + data->NList_UseImages = NULL; + data->LastImage = 0; + + FreeAffInfo(data); + + NL_Free_Format(data); + + if(data->EntryPool != NULL) + { + #if defined(__amigaos4__) + FreeSysObject(ASOT_ITEMPOOL, data->EntryPool); + #else + DeletePool(data->EntryPool); + #endif + } + + if(data->PoolInternal != NULL) + { + #if defined(__amigaos4__) + FreeSysObject(ASOT_MEMPOOL, data->PoolInternal); + #else + DeletePool(data->PoolInternal); + #endif + } + + return(DoSuperMethodA(cl,obj,msg)); + +} + + + +IPTR mNL_Setup(struct IClass *cl,Object *obj,struct MUIP_Setup *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + LONG ent; + Object *o; + +/*D(bug("%lx|mNL_Setup() 1 \n",obj));*/ + + data->DRAW = 0; + data->SETUP = FALSE; + + if (data->NList_Disabled) + data->NList_Disabled = 1; + + if (data->NList_AdjustWidth) + data->NList_AdjustWidth = -1; + + GetImages(data); + + data->SETUP = TRUE; + +/* data->MinImageHeight = 5;*/ + data->display_ptr = NULL; + if (data->NList_Font && !data->InUseFont) + { + char *fontname = NULL; + IPTR fonttmp = data->NList_Font; + + if (data->NList_Font == MUIV_NList_Font) + { + fonttmp = MUIV_Font_List; + DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_Font, &fontname); + } + else if (data->NList_Font == MUIV_NList_Font_Little) + { + fonttmp = MUIV_Font_Tiny; + DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_Font_Little, &fontname); + } + else if (data->NList_Font == MUIV_NList_Font_Fixed) + { + fonttmp = MUIV_Font_Fixed; + DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_Font_Fixed, &fontname); + } + if (fontname && *fontname) + { + struct TextAttr myta; + LONG fsize = 8; + int pp=0; + char fname[32]; + while ((fontname[pp] != '/') && (fontname[pp] != '\0')) + { if (pp < 42) + fname[pp] = fontname[pp]; + pp++; + } + if (fontname[pp] != '\0') + fsize = atol(&fontname[pp+1]); + fname[pp++]='.'; fname[pp++]='f'; fname[pp++]='o'; fname[pp++]='n'; fname[pp++]='t'; fname[pp++]='\0'; + myta.ta_Name = fname; + myta.ta_YSize = fsize; + myta.ta_Style = 0; + myta.ta_Flags = 0; + data->InUseFont = OpenDiskFont(&myta); + } + if (data->InUseFont) + { + notdoset(obj,MUIA_Font,data->InUseFont); + /*_font(obj) = data->InUseFont;*/ + } + else + { + notdoset(obj,MUIA_Font,fonttmp); + } + NL_SetColsRem(data,-2); + } + + if (!(DoSuperMethodA(cl,obj,(Msg) msg))) + { + if (data->InUseFont) + { + notdoset(obj,MUIA_Font,0L); + CloseFont(data->InUseFont); + data->InUseFont = NULL; + } + return(FALSE); + } + + data->rp = NULL; + + data->nodraw = 0; + + if (data->NList_MinLineHeight <= 0) + data->addvinc = -data->NList_MinLineHeight; + else + { + LONG *ptrd; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_VertInc, &ptrd)) + data->addvinc = *ptrd; + else + data->addvinc = DEFAULT_VERT_INC; + } + + { + LONG *ptrd; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_ColWidthDrag, &ptrd)) + data->NList_ColWidthDrag = *ptrd; + else + data->NList_ColWidthDrag = DEFAULT_CWD; + } + + { + LONG *ptrd; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_PartialCol, &ptrd)) + data->NList_PartialCol = *ptrd; + else + data->NList_PartialCol = DEFAULT_PARTIALCOL; + } + + { + LONG *ptrd; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_PartialChar, &ptrd)) + data->NList_PartialChar = *ptrd; + else + data->NList_PartialChar = DEFAULT_PARTIALCHAR; + } + + { + LONG *ptrd; + data->NList_List_Select = MUIV_NList_Select_List; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_List_Select, &ptrd)) + { if (!*ptrd) + data->NList_List_Select = MUIV_NList_Select_None; + } + } + + { + LONG *ptrd; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_SerMouseFix, &ptrd)) + data->NList_SerMouseFix = *ptrd; + else + data->NList_SerMouseFix = DEFAULT_SERMOUSEFIX; + } + + { + LONG *ptrd; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_DragLines, &ptrd)) + data->NList_DragLines = *ptrd + 1; + else + data->NList_DragLines = DEFAULT_DRAGLINES; + } + + { + LONG *ptrd; + if(DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_WheelStep, &ptrd)) + data->NList_WheelStep = *ptrd; + else + data->NList_WheelStep = DEFAULT_WHEELSTEP; + } + + { + LONG *ptrd; + + if(DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_WheelFast, &ptrd)) + data->NList_WheelFast = *ptrd; + else + data->NList_WheelFast = DEFAULT_WHEELFAST; + } + + { + LONG *ptrd; + data->NList_WheelMMB = DEFAULT_WHEELMMB; + + if(DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_WheelMMB, &ptrd)) + { + if(*ptrd != 0) + data->NList_WheelMMB = TRUE; + else + data->NList_WheelMMB = FALSE; + } + } + + { + LONG *ptrd; + data->NList_SelectPointer = DEFAULT_SELECTPOINTER; + if(DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_SelectPointer, &ptrd)) + { + if(*ptrd != 0) + data->NList_SelectPointer = TRUE; + else + data->NList_SelectPointer = FALSE; + } + } + + // determine our parent NListview object + data->nlistviewobj = NULL; + o = obj; + while((o = (Object *)xget(o, MUIA_Parent)) != NULL) + { + // check if the parent object return ourself as its NList object + // this one will be our parent NListview object + if((Object *)xget(o, MUIA_NListview_NList) == obj) + { + data->nlistviewobj = o; + D(DBF_STARTUP, "found parent NListview object %08lx", data->nlistviewobj); + break; + } + } + + // now we try to see if the parent listview object is + // an NListview or a plain Listview.mui object so that we + // can set the listviewobj pointer accordingly + data->listviewobj = NULL; + o = obj; + while((o = (Object *)xget(o, MUIA_Parent))) + { + Object *tagobj; + + if((tagobj = (Object *)xget(o, MUIA_Listview_List)) != NULL) + { + if(tagobj == obj && (Object *)xget(o, MUIA_NListview_NList) == NULL) + { + SIPTR tagval; + + data->listviewobj = o; + WANT_NOTIFY(NTF_LV_Select); + WANT_NOTIFY(NTF_LV_Doubleclick); + WANT_NOTIFY(NTF_L_Active); + WANT_NOTIFY(NTF_Entries); + + // check if we have a DragType attribute or not + if(GetAttr(MUIA_Listview_DragType, data->listviewobj, (IPTR *)&tagval) != FALSE) + data->NList_DragType = tagval; + + // in case this is MUI 3.8 we can query more detailed information + // by directly accessing the raw instance data of the Listview.mui + // object. Puh, what a hack! + if(MUIMasterBase->lib_Version <= 19 && data->pad2) + { + struct IClass *lcl,*lcl1,*lcl2,*lcl3,*lcl4; + UBYTE *ldata = ((UBYTE *) o) + 178; + lcl = lcl1 = lcl2 = lcl3 = lcl4 = OCLASS(o); + + while (lcl->cl_Super) /* when loop is finished : */ + { lcl4 = lcl3; /* Listview */ + lcl3 = lcl2; /* Group */ + lcl2 = lcl1; /* Area */ + lcl1 = lcl; /* Notify */ + lcl = lcl->cl_Super; /* rootclass */ + } + + if (lcl4->cl_InstSize == 68) /* data size of Listview.mui class in 3.8 */ + { + data->multiselect = data->NList_MultiSelect = (LONG) ldata[43]; + data->NList_Input = (LONG) ldata[65]; + ldata[40] = ldata[41] = ldata[42] = ldata[43] = 0; + ldata[64] = ldata[65] = 0; + } + } + } + break; + } + } + + if (data->NList_DragType == MUIV_NList_DragType_Default) + { LONG *ptrd; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_DragType, &ptrd)) + data->drag_type = *ptrd; + else + data->drag_type = MUIV_NList_DragType_Immediate; + } + else + data->drag_type = data->NList_DragType; + + if ((data->NList_DragSortable) && (data->drag_type == MUIV_NList_DragType_None)) + { LONG *ptrd; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_DragType, &ptrd)) + data->drag_type = *ptrd; + else + data->drag_type = MUIV_NList_DragType_Immediate; + } + +/* + { LONG *ptrd; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_DragQualifier, &ptrd)) + data->drag_qualifier = *ptrd; + else + data->drag_qualifier = 0; + } +*/ + + { LONG *ptrd; + + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_Smooth, &ptrd)) + data->NList_Smooth = *ptrd; + else + data->NList_Smooth = DEFAULT_SMOOTHSCROLL; + + if (data->VertPropObject) + { if (data->NList_Smooth) + set(data->VertPropObject,MUIA_Prop_DoSmooth, TRUE); + else + set(data->VertPropObject,MUIA_Prop_DoSmooth, FALSE); + } + } + + { + LONG *ptrd; + + if (data->NList_Keys && (data->NList_Keys != default_keys)) + { + FreeVecPooled(data->Pool, data->NList_Keys); + data->NList_Keys = default_keys; + } + + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_Keys, &ptrd)) + { + struct KeyBinding *keys = (struct KeyBinding *) ptrd; + LONG nk = 0; + + while (keys[nk].kb_KeyTag) + nk++; + + if((data->NList_Keys = AllocVecPooled(data->Pool, sizeof(struct KeyBinding) * (nk + 1))) != NULL) + { + while (nk >= 0) + { + data->NList_Keys[nk] = keys[nk]; + nk--; + } + } + else + data->NList_Keys = default_keys; + } + else + data->NList_Keys = default_keys; + } + + LOAD_PEN(data->Pen_Title_init, data->NList_TitlePen, MUICFG_NList_Pen_Title, DEFAULT_PEN_TITLE); + LOAD_PEN(data->Pen_List_init, data->NList_ListPen, MUICFG_NList_Pen_List, DEFAULT_PEN_LIST); + LOAD_PEN(data->Pen_Select_init, data->NList_SelectPen, MUICFG_NList_Pen_Select, DEFAULT_PEN_SELECT); + LOAD_PEN(data->Pen_Cursor_init, data->NList_CursorPen, MUICFG_NList_Pen_Cursor, DEFAULT_PEN_CURSOR); + LOAD_PEN(data->Pen_UnselCur_init,data->NList_UnselCurPen,MUICFG_NList_Pen_UnselCur,DEFAULT_PEN_UNSELCUR); + LOAD_PEN(data->Pen_Inactive_init,data->NList_InactivePen,MUICFG_NList_Pen_Inactive,DEFAULT_PEN_INACTIVE); + + LOAD_BG(data->BG_Title_init, data->NList_TitleBackGround, MUICFG_NList_BG_Title, DEFAULT_BG_TITLE); + LOAD_BG(data->BG_List_init, data->NList_ListBackGround, MUICFG_NList_BG_List, DEFAULT_BG_LIST); + LOAD_BG(data->BG_Select_init, data->NList_SelectBackground, MUICFG_NList_BG_Select, DEFAULT_BG_SELECT); + LOAD_BG(data->BG_Cursor_init, data->NList_CursorBackground, MUICFG_NList_BG_Cursor, DEFAULT_BG_CURSOR); + LOAD_BG(data->BG_UnselCur_init,data->NList_UnselCurBackground,MUICFG_NList_BG_UnselCur,DEFAULT_BG_UNSELCUR); + LOAD_BG(data->BG_Inactive_init,data->NList_InactiveBackground,MUICFG_NList_BG_Inactive,DEFAULT_BG_INACTIVE); + + if (data->NList_ForcePen == MUIV_NList_ForcePen_Default) + { + LONG *ptrd, fpen = MUIV_NList_ForcePen_Off; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_ForcePen, &ptrd)) + fpen = *ptrd; + data->ForcePen = (LONG) fpen; + } + else + data->ForcePen = data->NList_ForcePen; + + for(ent = 0;ent < data->NList_Entries;ent++) + data->EntriesArray[ent]->PixLen = -1; + + data->actbackground = -1; + + if (data->NList_SourceArray) + data->NList_SourceArray = 2; + + data->multiselect = data->NList_MultiSelect; + data->multisel_qualifier = 0; + { LONG *multisel; + LONG mult = MUIV_NList_MultiSelect_Shifted; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_MultiSelect, &multisel)) + mult = *multisel; + if (data->NList_MultiSelect == MUIV_NList_MultiSelect_Default) + data->multiselect = mult & 0x0007; + if ((mult & MUIV_NList_MultiSelect_MMB_On) == MUIV_NList_MultiSelect_MMB_On) + data->multisel_qualifier = IEQUALIFIER_MIDBUTTON; + } + + if (data->NList_ContextMenu == (LONG)MUIV_NList_ContextMenu_Default) + { + LONG *ptrd; + data->ContextMenu = MUIV_NList_ContextMenu_Always; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_Menu, &ptrd)) + { + switch (*ptrd) + { case MUIV_NList_ContextMenu_TopOnly : + case MUIV_NList_ContextMenu_Always : + case MUIV_NList_ContextMenu_Never : + data->ContextMenu = *ptrd; + break; + } + } + } + + /* Use centered text lines? */ + { + LONG *vert; + + data->NList_VerticalCenteredText = DEFAULT_VCENTERED; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_VCenteredLines, &vert)) + data->NList_VerticalCenteredText = *vert; + } + + if (data->ContextMenu != data->ContextMenuOn) + { + if (/*(((data->ContextMenu & 0x9d510030) == 0x9d510030) && (data->numcols <= 1)) ||*/ /* sba: Contextmenu problem: Disabled */ + (data->ContextMenu == (LONG)MUIV_NList_ContextMenu_Never)) + notdoset(obj,MUIA_ContextMenu,NULL); + else + notdoset(obj,MUIA_ContextMenu,data->ContextMenu); + } + + data->ScrollBarsPos = -2; + data->ScrollBars = 0; + data->ScrollBarsTime = -1; + + NL_CreateImages(data); + + data->drawsuper = NULL; + data->format_chge = 1; + data->do_draw_all = data->do_draw_title = data->do_draw = TRUE; + data->do_parse = data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE; + /*data->force_wwrap = TRUE;*/ + data->badrport = FALSE; + data->refreshing = FALSE; + + data->first_change = LONG_MAX; + data->last_change = LONG_MIN; + + data->adjustbar = -1; + data->adjustbar_old = -1; + + Make_Active_Visible; + + { + Object *o = obj; + + data->VirtGroup = NULL; + data->VirtGroup2 = NULL; + + while((o = (Object *)xget(o, MUIA_Parent))) + { + IPTR val; + + // check if the class "knows" the Virtgroup_Left and + // Virtgroup_Top attributes + if(GetAttr(MUIA_Virtgroup_Left, o, &val) != FALSE && + GetAttr(MUIA_Virtgroup_Top, o, &val) != FALSE) + { + data->VirtGroup = o; + + if (!data->VirtClass) + { + o = MUI_NewObject(MUIC_Virtgroup,Child, MUI_NewObject(MUIC_Rectangle, TAG_DONE), TAG_DONE); + + if (o) + { + data->VirtClass = OCLASS(o); + MUI_DisposeObject(o); + } + } + break; + } + } + data->VirtGroup2 = data->VirtGroup; + } + + // setup our custom selection pointer + SetupCustomPointers(data); + +/* MUI_RequestIDCMP(obj,IDCMP_MOUSEBUTTONS|IDCMP_RAWKEY|IDCMP_INTUITICKS|IDCMP_ACTIVEWINDOW|IDCMP_INACTIVEWINDOW);*/ +/* MUI_RequestIDCMP(obj,IDCMP_MOUSEBUTTONS|IDCMP_RAWKEY|IDCMP_INTUITICKS);*/ + + data->MOUSE_MOVE = FALSE; +/* data->ehnode.ehn_Events = (IDCMP_MOUSEBUTTONS|IDCMP_RAWKEY|IDCMP_INTUITICKS|IDCMP_MOUSEMOVE);*/ + data->ehnode.ehn_Events = (IDCMP_MOUSEBUTTONS|IDCMP_RAWKEY|IDCMP_INTUITICKS|IDCMP_ACTIVEWINDOW|IDCMP_INACTIVEWINDOW); + data->ehnode.ehn_Priority = 1; + data->ehnode.ehn_Flags = MUI_EHF_GUIMODE; + data->ehnode.ehn_Object = obj; + data->ehnode.ehn_Class = cl; + + // add IDCMP_EXTENDEDMOUSE for OS4 wheelmouse support + #if defined(__amigaos4__) + data->ehnode.ehn_Events |= IDCMP_EXTENDEDMOUSE; + #endif + + DoMethod(_win(obj),MUIM_Window_AddEventHandler, &data->ehnode); + + DoMethod(_app(obj),MUIM_Application_AddInputHandler,&data->ihnode); + +/* GetNImage_Sizes(data);*/ + + data->pad2 = FALSE; + +/*D(bug("%lx|mNL_Setup() 2 \n",obj));*/ + + return(TRUE); +} + +IPTR mNL_Cleanup(struct IClass *cl,Object *obj,struct MUIP_Cleanup *msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + IPTR retval; + +/*D(bug("%lx|mNL_Cleanup() 1 \n",obj));*/ + + data = INST_DATA(cl,obj); + + data->nodraw = 1; + data->DRAW = 0; + + // cleanup our custom mouse pointers + CleanupCustomPointers(data); + + DoMethod(_app(obj),MUIM_Application_RemInputHandler,&data->ihnode); + + DoMethod(_win(obj),MUIM_Window_RemEventHandler, &data->ehnode); + +/* MUI_RejectIDCMP(obj,IDCMP_MOUSEBUTTONS|IDCMP_RAWKEY|IDCMP_INTUITICKS|IDCMP_ACTIVEWINDOW|IDCMP_INACTIVEWINDOW);*/ +/* MUI_RejectIDCMP(obj,IDCMP_MOUSEBUTTONS|IDCMP_RAWKEY|IDCMP_INTUITICKS);*/ + + data->NList_Quiet++; + data->VirtGroup = NULL; + + // forget that this object has received a MUIM_Setup + // this must be done before calling NL_DeleteImages(), because that function + // will try to relayout the group data->NL_Group, which is not a very wise + // thing to do while we a cleaning up ourselves. + data->SETUP = FALSE; + + NL_DeleteImages(data); + + if (data->NList_Keys && (data->NList_Keys != default_keys)) + { + FreeVecPooled(data->Pool, data->NList_Keys); + data->NList_Keys = default_keys; + } + + release_pen(obj, &data->NList_TitlePen); + release_pen(obj, &data->NList_ListPen); + release_pen(obj, &data->NList_SelectPen); + release_pen(obj, &data->NList_CursorPen); + release_pen(obj, &data->NList_UnselCurPen); + + retval = DoSuperMethodA(cl,obj,(Msg) msg); + + if (data->InUseFont) + { + notdoset(obj,MUIA_Font,0L); + CloseFont(data->InUseFont); + data->InUseFont = NULL; + } + + data->voff = 1; + + data->rp = NULL; + data->badrport = FALSE; + data->UpdateScrollersRedrawn = FALSE; + + data->NList_Quiet--; + +/*D(bug("%lx|mNL_Cleanup() 2 \n",obj));*/ + + return (retval); +} diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_mcc0.c b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc0.c new file mode 100644 index 0000000000..47d72ed9d6 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc0.c @@ -0,0 +1,701 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <clib/alib_protos.h> +#include <proto/exec.h> +#include <proto/graphics.h> +#include <proto/utility.h> +#include <proto/muimaster.h> +#include <proto/intuition.h> + +#include "private.h" + +#include "NList_func.h" + +#ifndef MAKE_ID +#define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d)) +#endif + +static IPTR mNL_Show(struct IClass *cl,Object *obj,Msg msg) +{ + IPTR retval; + register struct NLData *data = INST_DATA(cl,obj); + + ENTER(); + + data->rp = _rp(obj); + + data->SHOW = TRUE; + data->moves = FALSE; + + if (data->NList_Disabled) + data->NList_Disabled = 1; + + if (data->nodraw) + return (DoSuperMethodA(cl,obj,msg)); + + if (data->do_draw_all) + { data->adjustbar_old = -1; + if (data->adjustbar == -3) + data->adjustbar = -2; + } + + data->refreshing = FALSE; + data->badrport = FALSE; + + data->display_ptr = NULL; + data->drag_border = FALSE; + data->DisplayArray[1] = (char *) -2; + + data->ScrollBarsTime = 1; + + /* GetImages must be done before DoSuperMethodA */ + GetImages(data); + + data->do_updatesb = data->do_images = TRUE; + + retval = DoSuperMethodA(cl,obj,msg); + + if (data->ScrollBarsPos == -3) + { + if (!(LIBVER(GfxBase) >= 39)) + NL_CreateImages(data); + data->ScrollBarsPos = -2; + } + + if (data->VertPropObject) + { if (data->NList_Smooth) + set(data->VertPropObject,MUIA_Prop_DoSmooth, TRUE); + else + set(data->VertPropObject,MUIA_Prop_DoSmooth, FALSE); + } + + GetNImage_Sizes(data); + data->do_images = TRUE; + + RETURN(retval); + return (retval); +} + + +static IPTR mNL_Hide(struct IClass *cl,Object *obj,Msg msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + IPTR retval; + + ENTER(); + + data->badrport = FALSE; + + // remove any custom pointer + HideCustomPointer(data); + + retval = DoSuperMethodA(cl,obj,msg); + + data->rp = NULL; + data->SHOW = FALSE; + data->moves = FALSE; + + RETURN(retval); + return (retval); +} + + + + +#if defined(DEBUG) +static char *getIDStr(ULONG id) +{ + static char idStr[5]; + char c; + + c = (id >> 24) & 0xff; + idStr[0] = (c >= ' ' && c <= 'z') ? c : '?'; + c = (id >> 16) & 0xff; + idStr[1] = (c >= ' ' && c <= 'z') ? c : '?'; + c = (id >> 8) & 0xff; + idStr[2] = (c >= ' ' && c <= 'z') ? c : '?'; + c = (id >> 0) & 0xff; + idStr[3] = (c >= ' ' && c <= 'z') ? c : '?'; + idStr[4] = '\0'; + + return idStr; +} +#endif + +static IPTR mNL_Import(struct IClass *cl,Object *obj,struct MUIP_Import *msg) +{ + struct NLData *data = INST_DATA(cl, obj); + ULONG id; + + ENTER(); + + if((id = muiNotifyData(obj)->mnd_ObjectID) != 0) + { + LONG *nlie; + + D(DBF_STARTUP, "import objID '%s'", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + + if((nlie = (LONG *)DoMethod(msg->dataspace, MUIM_Dataspace_Find, id)) != NULL && + nlie[0] == MAKE_ID('E','X','P','T')) + { + ULONG nliepos = 1; + LONG numcol; + LONG numsel; + LONG num_widt = 0; + LONG num_ordr = 0; + LONG num_sels = 0; + + FULLQUIET; + + while(id != 0) + { + id = nlie[nliepos++]; + + switch(id) + { + case MAKE_ID('A','C','T','V'): + { + D(DBF_STARTUP, "objID '%s', importing ACTV entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + if(isFlagSet(data->NList_Imports, MUIV_NList_Imports_Active)) + NL_List_Active(data, nlie[nliepos], NULL, MUIV_NList_Select_On, TRUE,0); + nliepos++; + data->do_draw = TRUE; + } + break; + + case MAKE_ID('F','R','S','T'): + { + D(DBF_STARTUP, "objID '%s', importing FRST entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + if(isFlagSet(data->NList_Imports, MUIV_NList_Imports_First)) + NL_List_First(data, nlie[nliepos], NULL); + nliepos++; + data->do_draw = TRUE; + } + break; + + case MAKE_ID('T','I','T','L'): + { + D(DBF_STARTUP, "objID '%s', importing TITL entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + if(isFlagSet(data->NList_Imports, MUIV_NList_Imports_TitleMark)) + { + set(obj,MUIA_NList_SortType, nlie[nliepos]); + set(obj,MUIA_NList_TitleMark, nlie[nliepos]); + } + nliepos++; + data->do_draw_all = TRUE; + data->do_draw = TRUE; + } + break; + + case MAKE_ID('T','I','T','2'): + { + D(DBF_STARTUP, "objID '%s', importing TIT2 entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + if(isFlagSet(data->NList_Imports, MUIV_NList_Imports_TitleMark)) + { + set(obj,MUIA_NList_SortType2, nlie[nliepos]); + set(obj,MUIA_NList_TitleMark2, nlie[nliepos]); + } + nliepos++; + data->do_draw_all = TRUE; + data->do_draw = TRUE; + } + break; + + case MAKE_ID('W','I','D','T'): + { + D(DBF_STARTUP, "objID '%s', importing WIDT entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + num_widt = nlie[nliepos++]; + for(numcol = 0; numcol < num_widt; numcol++) + { + if(isFlagSet(data->NList_Imports, MUIV_NList_Imports_ColWidth)) + { + D(DBF_STARTUP, "objID '%s', importing WIDT %ld", getIDStr(muiNotifyData(obj)->mnd_ObjectID), nlie[nliepos]); + NL_ColWidth(data, numcol, nlie[nliepos]); + } + nliepos++; + } + data->do_draw_all = TRUE; + data->do_draw = TRUE; + } + break; + + case MAKE_ID('O','R','D','R'): + { + D(DBF_STARTUP, "objID '%s', importing ORDR entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + num_ordr = nlie[nliepos++]; + for(numcol = 0; numcol < num_ordr; numcol++) + { + if(isFlagSet(data->NList_Imports, MUIV_NList_Imports_ColOrder)) + NL_SetCol(data, numcol, nlie[nliepos]); + nliepos++; + } + data->do_draw_all = TRUE; + data->do_draw = TRUE; + } + break; + + case MAKE_ID('S','E','L','S'): + { + D(DBF_STARTUP, "objID '%s', importing SELS entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + num_sels = nlie[nliepos++]; + for(numsel = 0; numsel < num_sels; numsel++) + { + if(isFlagSet(data->NList_Imports, MUIV_NList_Imports_Selected)) + { + if(nlie[nliepos] >= 0 && nlie[nliepos] < data->NList_Entries) + SELECT2_CHGE(nlie[nliepos], TE_Select_Line); + } + nliepos++; + } + data->do_draw_all = TRUE; + data->do_draw = TRUE; + } + break; + + default: + { + // bail out of the loop in case of an unknown ID + id = 0; + } + break; + } + } + + FULLQUIET_END; + if(data->do_draw == TRUE && _app(obj) != NULL) + DoMethod(_app(obj), MUIM_Application_PushMethod, obj, 1, MUIM_NList_Trigger); + } + } + + LEAVE(); + return 0; +} + + + + +static IPTR mNL_Export(struct IClass *cl,Object *obj,struct MUIP_Export *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + ULONG id; + + ENTER(); + + if((id = muiNotifyData(obj)->mnd_ObjectID) != 0) + { + LONG *buffer; + ULONG nliesize; + LONG pos; + LONG numsel; + LONG numcol; + LONG num_widt; + LONG num_ordr; + LONG num_sels; + LONG n_actv; + LONG n_frst; + LONG n_titr; + LONG n_widt; + LONG n_ordr; + LONG n_sels; + + D(DBF_STARTUP, "export objID '%s'", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + + n_actv = isFlagSet(data->NList_Exports, MUIV_NList_Exports_Active) ? 2 : 0; + n_frst = isFlagSet(data->NList_Exports, MUIV_NList_Exports_First) ? 2 : 0; + n_titr = isFlagSet(data->NList_Exports, MUIV_NList_Exports_TitleMark) ? 4 : 0; + + if(isFlagSet(data->NList_Exports, MUIV_NList_Exports_ColWidth)) + { + num_widt = 0; + for (numcol = 0; numcol < data->numcols; numcol++) + { + if(data->cols[numcol].col >= num_widt) + num_widt = data->cols[numcol].col + 1; + } + n_widt = num_widt + 2; + } + else + { + num_widt = 0; + n_widt = 0; + } + + if(isFlagSet(data->NList_Exports, MUIV_NList_Exports_ColOrder)) + { + num_ordr = data->numcols; + n_ordr = num_ordr + 2; + } + else + { + num_ordr = 0; + n_ordr = 0; + } + + if(isFlagSet(data->NList_Exports, MUIV_NList_Exports_Selected) && data->NList_TypeSelect == MUIV_NList_TypeSelect_Line) + { + NL_List_Select(data, MUIV_NList_Select_All, MUIV_NList_Select_All, MUIV_NList_Select_Ask, &numsel); + + num_sels = 0; + if(numsel > 0) + num_sels = numsel; + n_sels = num_sels + 2; + } + else + { + num_sels = 0; + n_sels = 0; + } + + SHOWVALUE(DBF_STARTUP, n_actv); + SHOWVALUE(DBF_STARTUP, n_frst); + SHOWVALUE(DBF_STARTUP, n_titr); + SHOWVALUE(DBF_STARTUP, n_ordr); + SHOWVALUE(DBF_STARTUP, n_sels); + + nliesize = (n_actv + n_frst + n_titr + n_widt + n_ordr + n_sels + 3) * sizeof(buffer[0]); + + SHOWVALUE(DBF_STARTUP, nliesize); + + if((buffer = (LONG *)AllocVecPooled(data->Pool, nliesize)) != NULL) + { + ULONG nliepos = 0; + + buffer[nliepos++] = MAKE_ID('E','X','P','T'); + + if(isFlagSet(data->NList_Exports, MUIV_NList_Exports_Active)) + { + D(DBF_STARTUP, "objID '%s', exporting ACTV entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + buffer[nliepos++] = MAKE_ID('A','C','T','V'); + buffer[nliepos++] = data->NList_Active; + } + if(isFlagSet(data->NList_Exports, MUIV_NList_Exports_First)) + { + D(DBF_STARTUP, "objID '%s', exporting FRST entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + buffer[nliepos++] = MAKE_ID('F','R','S','T'); + buffer[nliepos++] = data->NList_First; + } + if(isFlagSet(data->NList_Exports, MUIV_NList_Exports_TitleMark)) + { + D(DBF_STARTUP, "objID '%s', exporting TITL entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + buffer[nliepos++] = MAKE_ID('T','I','T','L'); + buffer[nliepos++] = data->NList_TitleMark; + D(DBF_STARTUP, "objID '%s', exporting TIT2 entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + buffer[nliepos++] = MAKE_ID('T','I','T','2'); + buffer[nliepos++] = data->NList_TitleMark2; + } + if(isFlagSet(data->NList_Exports, MUIV_NList_Exports_ColWidth)) + { + D(DBF_STARTUP, "objID '%s', exporting WIDT entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + buffer[nliepos++] = MAKE_ID('W','I','D','T'); + buffer[nliepos++] = num_widt; + for(numcol = 0; numcol < num_widt; numcol++) + buffer[nliepos++] = (LONG)NL_ColWidth(data, numcol, MUIV_NList_ColWidth_Get); + } + if(isFlagSet(data->NList_Exports, MUIV_NList_Exports_ColOrder)) + { + D(DBF_STARTUP, "objID '%s', exporting ORDR entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + buffer[nliepos++] = MAKE_ID('O','R','D','R'); + buffer[nliepos++] = num_ordr; + for(numcol = 0; numcol < num_ordr; numcol++) + buffer[nliepos++] = NL_ColumnToCol(data, numcol); + } + if(isFlagSet(data->NList_Exports, MUIV_NList_Exports_Selected) && data->NList_TypeSelect == MUIV_NList_TypeSelect_Line) + { + struct MUIP_NList_NextSelected nlns; + + D(DBF_STARTUP, "objID '%s', exporting SELS entry", getIDStr(muiNotifyData(obj)->mnd_ObjectID)); + buffer[nliepos++] = MAKE_ID('S','E','L','S'); + buffer[nliepos++] = num_sels; + pos = MUIV_NList_NextSelected_Start; + numsel = 0; + nlns.pos = &pos; + while(numsel < num_sels && mNL_List_NextSelected(cl, obj, &nlns) && pos != MUIV_NList_NextSelected_End) + { + buffer[nliepos++] = pos; + numsel++; + } + while(numsel < num_sels) + { + buffer[nliepos++] = -1; + numsel++; + } + } + buffer[nliepos++] = MAKE_ID('E','N','D','.'); + + if(nliepos * sizeof(buffer[0]) > nliesize) + W(DBF_STARTUP, "object %08lx, possible buffer overrun, %ld > %ld", obj, nliepos * sizeof(buffer[0]), nliesize); + + DoMethod(msg->dataspace, MUIM_Dataspace_Add, buffer, nliesize, id); + + FreeVecPooled(data->Pool, buffer); + } + } + + LEAVE(); + return 0; +} + +//$$$Sensei +static IPTR mNL_List_Construct( struct IClass *cl, Object *obj, struct MUIP_NList_Construct *msg ) +{ + APTR entry = msg->entry; + + if( entry ) + { + struct NLData *data = INST_DATA( cl, obj ); + struct Hook *hook = data->NList_ConstructHook; + + if( hook ) + { + APTR pool = msg->pool; + + if( data->NList_ConstructHook2 ) + entry = (APTR) MyCallHookPktA(obj,hook,entry,pool); + else + entry = (APTR) MyCallHookPkt(obj,TRUE,hook,pool,entry); + } + } + + return( (IPTR) entry ); + +} + +//$$$Sensei +static IPTR mNL_List_Destruct( struct IClass *cl, Object *obj, struct MUIP_NList_Destruct *msg ) +{ + + APTR entry = msg->entry; + + if( entry ) + { + + struct NLData *data = INST_DATA( cl, obj ); + struct Hook *hook = data->NList_DestructHook; + + if( hook ) + { + + APTR pool = msg->pool; + + if( data->NList_DestructHook2 ) + MyCallHookPktA(obj,hook,entry,pool); + else + MyCallHookPkt(obj,TRUE,hook,pool,entry); + + } + + } + + return( 0 ); + +} + +//$$$Sensei +// Function directly stolen from original NList_Compare(). +static IPTR mNL_List_Compare( struct IClass *cl, Object *obj, struct MUIP_NList_Compare *msg ) +{ + struct NLData *data = INST_DATA(cl, obj); + + if(data->NList_CompareHook != NULL) + { + if(data->NList_CompareHook2) + return (IPTR)MyCallHookPktA(obj, data->NList_CompareHook, msg->entry1, msg->entry2, msg->sort_type1, msg->sort_type2); + else + return (IPTR)MyCallHookPkt(obj, TRUE, data->NList_CompareHook, msg->entry2, msg->entry1); + } + else + return (IPTR)Stricmp(msg->entry1, msg->entry2); +} + +//$$$Sensei +static IPTR mNL_List_Display( struct IClass *cl, Object *obj, UNUSED struct MUIP_NList_Display *msg ) +{ + struct NLData *data = INST_DATA( cl, obj ); + + if( data->NList_DisplayHook ) + { + if( data->NList_DisplayHook2 ) + { + // data->DisplayArray[0] = (char *) useptr; + return MyCallHookPkt(obj,FALSE,data->NList_DisplayHook,obj,data->DisplayArray); + } + else + { + APTR useptr = data->DisplayArray[ 0 ]; + + data->DisplayArray[0] = (char *) data->NList_PrivateData; + return MyCallHookPkt(obj,TRUE,data->NList_DisplayHook,&data->DisplayArray[2],useptr); + } + } + + return( 0 ); +} + +static IPTR mNL_GoActive(struct IClass *cl, Object *obj, UNUSED struct MUIP_NList_GoActive *msg) +{ + struct NLData *data = INST_DATA(cl, obj); + + ENTER(); + + data->isActiveObject = TRUE; + + if(data->NList_ActiveObjectOnClick == TRUE) + DoMethod(obj, MUIM_NList_Redraw, MUIV_NList_Redraw_Selected); + + RETURN(TRUE); + return TRUE; +} + +static IPTR mNL_GoInactive(struct IClass *cl, Object *obj, UNUSED struct MUIP_NList_GoActive *msg) +{ + struct NLData *data = INST_DATA(cl, obj); + + ENTER(); + + data->isActiveObject = FALSE; + + if(data->NList_ActiveObjectOnClick == TRUE) + DoMethod(obj, MUIM_NList_Redraw, MUIV_NList_Redraw_Selected); + + RETURN(TRUE); + return TRUE; +} + +#define FS (data = INST_DATA(cl,obj)); (NotNotify = data->DoNotify) + +DISPATCHER(_Dispatcher) +{ + struct NLData *data = NULL; + IPTR retval = 0; + ULONG NotNotify = ~0; + + switch(msg->MethodID) + { + case OM_NEW : retval = mNL_New(cl,obj,(APTR)msg); break; + case OM_DISPOSE : retval = mNL_Dispose(cl,obj,(APTR)msg); break; + case OM_GET : FS; retval = mNL_Get(cl,obj,(APTR)msg); break; + case OM_SET : FS; retval = mNL_Set(cl,obj,(APTR)msg); break; + case MUIM_Setup : retval = mNL_Setup(cl,obj,(APTR)msg); break; + case MUIM_Cleanup : retval = mNL_Cleanup(cl,obj,(APTR)msg); break; + case MUIM_AskMinMax : retval = mNL_AskMinMax(cl,obj,(APTR)msg); break; + case MUIM_Show : retval = mNL_Show(cl,obj,(APTR)msg); break; + case MUIM_Hide : retval = mNL_Hide(cl,obj,(APTR)msg); break; + case MUIM_Draw : retval = mNL_Draw(cl,obj,(APTR)msg); break; + case MUIM_HandleEvent : retval = mNL_HandleEvent(cl,obj,(APTR)msg); break; + case MUIM_Notify : retval = mNL_Notify(cl,obj,(APTR)msg); break; + case MUIM_DragQuery : retval = mNL_DragQuery(cl,obj,(APTR)msg); break; + case MUIM_DragBegin : retval = mNL_DragBegin(cl,obj,(APTR)msg); break; + case MUIM_DragReport : retval = mNL_DragReport(cl,obj,(APTR)msg); break; + case MUIM_DragFinish : retval = mNL_DragFinish(cl,obj,(APTR)msg); break; + case MUIM_DragDrop : retval = mNL_DragDrop(cl,obj,(APTR)msg); break; + case MUIM_CreateDragImage : retval = mNL_CreateDragImage(cl,obj,(APTR)msg); break; + case MUIM_DeleteDragImage : retval = mNL_DeleteDragImage(cl,obj,(APTR)msg); break; + case MUIM_ContextMenuBuild : retval = mNL_ContextMenuBuild(cl,obj,(APTR)msg); break; + case MUIM_ContextMenuChoice : retval = mNL_ContextMenuChoice(cl,obj,(APTR)msg); break; + case MUIM_Import : retval = mNL_Import(cl,obj,(APTR)msg); break; + case MUIM_Export : retval = mNL_Export(cl,obj,(APTR)msg); break; + + case MUIM_NList_ContextMenuBuild : retval = 0; break; + case MUIM_NList_Trigger : retval = mNL_Trigger(cl,obj,(APTR)msg); break; + case MUIM_List_Sort : + case MUIM_NList_Sort : FS; retval = mNL_List_Sort(cl,obj,(APTR)msg); break; + case MUIM_NList_Sort2 : FS; retval = mNL_List_Sort2(cl,obj,(APTR)msg); break; + case MUIM_NList_Sort3 : FS; retval = mNL_List_Sort3(cl,obj,(APTR)msg); break; + case MUIM_List_Insert : + case MUIM_NList_Insert : FS; retval = mNL_List_Insert(cl,obj,(APTR)msg); break; + case MUIM_List_InsertSingle : + case MUIM_NList_InsertSingle : FS; retval = mNL_List_InsertSingle(cl,obj,(APTR)msg); break; + case MUIM_List_GetEntry : + case MUIM_NList_GetEntry : FS; retval = mNL_List_GetEntry(cl,obj,(APTR)msg); break; + case MUIM_List_Clear : + case MUIM_NList_Clear : FS; retval = mNL_List_Clear(cl,obj,(APTR)msg); break; + case MUIM_List_Jump : + case MUIM_NList_Jump : FS; retval = mNL_List_Jump(cl,obj,(APTR)msg); break; + case MUIM_List_Select : + case MUIM_NList_Select : FS; retval = mNL_List_Select(cl,obj,(APTR)msg); break; + case MUIM_NList_SelectChange : retval = 0; break; + case MUIM_List_TestPos : FS; retval = mNL_List_TestPosOld(cl,obj,(APTR)msg); break; + case MUIM_NList_TestPos : FS; retval = mNL_List_TestPos(cl,obj,(APTR)msg); break; + case MUIM_List_Redraw : + case MUIM_NList_Redraw : FS; retval = mNL_List_Redraw(cl,obj,(APTR)msg); break; + case MUIM_List_Exchange : + case MUIM_NList_Exchange : FS; retval = mNL_List_Exchange(cl,obj,(APTR)msg); break; + case MUIM_List_Move : + case MUIM_NList_Move : FS; retval = mNL_List_Move(cl,obj,(APTR)msg); break; + case MUIM_List_NextSelected : + case MUIM_NList_NextSelected : FS; retval = mNL_List_NextSelected(cl,obj,(APTR)msg); break; + case MUIM_NList_PrevSelected : FS; retval = mNL_List_PrevSelected(cl,obj,(APTR)msg); break; + case MUIM_List_Remove : + case MUIM_NList_Remove : FS; retval = mNL_List_Remove(cl,obj,(APTR)msg); break; + case MUIM_List_CreateImage : + case MUIM_NList_CreateImage : FS; retval = mNL_CreateImage(cl,obj,(APTR)msg); break; + case MUIM_List_DeleteImage : + case MUIM_NList_DeleteImage : FS; retval = mNL_DeleteImage(cl,obj,(APTR)msg); break; + case MUIM_NList_CopyToClip : FS; retval = mNL_CopyToClip(cl,obj,(APTR)msg); break; + case MUIM_NList_UseImage : FS; retval = mNL_UseImage(cl,obj,(APTR)msg); break; + case MUIM_NList_ReplaceSingle : FS; retval = mNL_List_ReplaceSingle(cl,obj,(APTR)msg); break; + case MUIM_NList_InsertWrap : FS; retval = mNL_List_InsertWrap(cl,obj,(APTR)msg); break; + case MUIM_NList_InsertSingleWrap : FS; retval = mNL_List_InsertSingleWrap(cl,obj,(APTR)msg); break; + case MUIM_NList_GetEntryInfo : FS; retval = mNL_List_GetEntryInfo(cl,obj,(APTR)msg); break; + case MUIM_NList_GetSelectInfo : FS; retval = mNL_List_GetSelectInfo(cl,obj,(APTR)msg); break; + case MUIM_NList_CopyTo : FS; retval = mNL_CopyTo(cl,obj,(APTR)msg); break; + case MUIM_NList_DropType : FS; retval = mNL_DropType(cl,obj,(APTR)msg); break; + case MUIM_NList_DropDraw : FS; retval = mNL_DropDraw(cl,obj,(APTR)msg); break; + case MUIM_NList_DropEntryDrawErase : FS; retval = mNL_DropEntryDrawErase(cl,obj,(APTR)msg); break; + case MUIM_NList_RedrawEntry : FS; retval = mNL_List_RedrawEntry(cl,obj,(APTR)msg); break; + case MUIM_NList_DoMethod : FS; retval = mNL_List_DoMethod(cl,obj,(APTR)msg); break; + case MUIM_NList_ColWidth : FS; retval = mNL_List_ColWidth(cl,obj,(APTR)msg); break; + case MUIM_NList_ColToColumn : FS; retval = mNL_ColToColumn(cl,obj,(APTR)msg); break; + case MUIM_NList_ColumnToCol : FS; retval = mNL_ColumnToCol(cl,obj,(APTR)msg); break; + case MUIM_NList_SetColumnCol : FS; retval = mNL_SetColumnCol(cl,obj,(APTR)msg); break; + case MUIM_NList_GetPos : retval = mNL_List_GetPos(cl,obj,(APTR)msg); break; + case MUIM_NList_QueryBeginning : retval = 0; break; + case MUIM_NList_Construct : retval = mNL_List_Construct(cl,obj,(APTR)msg); break; + case MUIM_NList_Destruct : retval = mNL_List_Destruct(cl,obj,(APTR)msg); break; + case MUIM_NList_Compare : retval = mNL_List_Compare(cl,obj,(APTR)msg); break; + case MUIM_NList_Display : retval = mNL_List_Display(cl,obj,(APTR)msg); break; + + case MUIM_GoActive : mNL_GoActive(cl,obj,(APTR)msg); return(DoSuperMethodA(cl,obj,msg)); + case MUIM_GoInactive : mNL_GoInactive(cl,obj,(APTR)msg); return(DoSuperMethodA(cl,obj,msg)); + case MUIM_NList_GoActive : retval = mNL_GoActive(cl,obj,(APTR)msg); break; + case MUIM_NList_GoInactive : retval = mNL_GoInactive(cl,obj,(APTR)msg); break; + case MUIM_NList_SetActive : FS; retval = mNL_List_SetActive(cl,obj,(APTR)msg); break; + + default: + return(DoSuperMethodA(cl,obj,msg)); + break; + } + + if(~NotNotify && data) + { + ULONG DoNotify = ~NotNotify & data->DoNotify & data->Notify; + if(data->SETUP && DoNotify) + do_notifies(DoNotify); + } + + return retval; +} + diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_mcc1.c b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc1.c new file mode 100644 index 0000000000..aeceb1b180 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc1.c @@ -0,0 +1,1343 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <stdlib.h> + +#include <clib/alib_protos.h> +#include <proto/graphics.h> +#include <proto/utility.h> +#include <proto/exec.h> +#include <proto/intuition.h> + +#include "private.h" + +#include "NList_func.h" +#include "version.h" +#include "NListviews_mcp.h" +#include "NListview_mcc.h" + +extern const struct Hook NL_ConstructHook_String; +extern const struct Hook NL_DestructHook_String; + +#define SET_PEN(var_dest,test_init) \ + { \ + tag->ti_Tag = TAG_IGNORE; \ + if(data->SETUP == TRUE) \ + { \ + test_init = tag->ti_Data; \ + obtain_pen(obj, &(var_dest), (struct MUI_PenSpec *)tag->ti_Data); \ + REDRAW_ALL; \ + } \ + } + +#define SET_BG(var_dest,test_init) \ + { \ + tag->ti_Tag = TAG_IGNORE; \ + test_init = TRUE; \ + var_dest = tag->ti_Data; \ + REDRAW_ALL; \ + } + + + + +IPTR mNL_AskMinMax(struct IClass *cl,Object *obj,struct MUIP_AskMinMax *msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + LONG vinc = data->vinc; +/* + * if (data->nodraw) + * { + * LONG minwidth = _minwidth(obj); + * LONG minheight = _minheight(obj); + * LONG maxwidth = _maxwidth(obj); + * LONG maxheight = _maxheight(obj); + * LONG defwidth = _defwidth(obj); + * LONG defheight = _defheight(obj); + * + * D(bug("%lx|mNL_AskMinMax() %ld,%ld %ld,%ld %ld,%ld \n",obj,minwidth,minheight,defwidth,defheight,maxwidth,maxheight)); + * DoSuperMethodA(cl,obj,(Msg) msg); + * return (0); + * } + */ + + data->NList_Quiet++; +/*D(bug("%lx|mNL_AskMinMax() 1 \n",obj));*/ + DoSuperMethodA(cl,obj,(Msg) msg); +/*D(bug("%lx|mNL_AskMinMax() 2 \n",obj));*/ + + data->font = _font(obj); + data->vinc = data->font->tf_YSize + data->addvinc; + if (data->NList_MinLineHeight > data->vinc) + data->vinc = data->NList_MinLineHeight; + if (data->MinImageHeight > data->vinc) + data->vinc = data->MinImageHeight; + if (data->vinc < 2) + data->vinc = 2; + + if ((vinc > 1) && (vinc != data->vinc)) + { + DO_NOTIFY(NTF_LineHeight); + } + + if (((data->NList_SourceArray == 2) || data->VirtGroup) && (data->NList_Entries > 0)) + { struct RastPort *tmprp2 = NULL; + if ((data->NList_AdjustWidth == -1) && !data->nodraw && + (tmprp2 = (struct RastPort *) AllocVec(sizeof(struct RastPort),0))) + { struct RastPort *tmprp = data->rp; + struct TextFont *tmpfont; + WORD column,delta; + LONG show; + data->rp = &(_screen(obj)->RastPort); + *tmprp2 = *(data->rp); + data->rp = tmprp2; + tmpfont = data->rp->Font; + data->font = _font(obj); + data->pens = _pens(obj); + data->voff = data->font->tf_Baseline + (data->vinc - data->font->tf_YSize + 1)/2; + { struct TextExtent te; + data->hinc = 0; + SetSoftStyle(data->rp, FSF_BOLD|FSF_ITALIC, STYLE_MASK); + TextExtent(data->rp, "m", 1, &te); + if (data->hinc < te.te_Width) + data->hinc = te.te_Width; + SetSoftStyle(data->rp, FSF_BOLD|FSF_ITALIC, STYLE_MASK); + TextExtent(data->rp, "M", 1, &te); + if (data->hinc < te.te_Width) + data->hinc = te.te_Width; + SetSoftStyle(data->rp, FSF_BOLD|FSF_ITALIC, STYLE_MASK); + TextExtent(data->rp, "w", 1, &te); + if (data->hinc < te.te_Width) + data->hinc = te.te_Width; + SetSoftStyle(data->rp, FSF_BOLD|FSF_ITALIC, STYLE_MASK); + TextExtent(data->rp, "W", 1, &te); + if (data->hinc < te.te_Width) + data->hinc = te.te_Width; + SetSoftStyle(data->rp, 0, STYLE_MASK); + TextExtent(data->rp, " ", 1, &te); + data->spacesize = te.te_Width; + } + data->tabsize = data->spacesize * data->NList_TabSize; + if (data->tabsize < 4) + data->tabsize = 4; + + show = data->SHOW; + data->SHOW = 1; + AllWidthColumns(data); + data->SHOW = show; + data->NList_AdjustWidth = 0; + delta = 0; + for (column = 0;column < data->numcols;column++) + { data->NList_AdjustWidth += data->cols[column].c->colwidthmax; + if (column < data->numcols-1) + delta += data->cols[column].c->delta; + } + if (data->NList_AdjustWidth < 2) + data->NList_AdjustWidth = -1; + else + data->NList_AdjustWidth += delta; + if (data->rp->Font!=tmpfont) + SetFont(data->rp,tmpfont); + data->rp = tmprp; + FreeVec(tmprp2); + } + if (data->NList_AdjustHeight) + { if (data->NList_Title) + data->NList_AdjustHeight = ((data->NList_Entries+1) * data->vinc) + 1; + else + data->NList_AdjustHeight = (data->NList_Entries * data->vinc) + 1; + if (data->NList_AdjustHeight == 0) + data->NList_AdjustHeight = -1; + DONE_NOTIFY(NTF_MinMax); + } + if (data->NList_SourceArray == 2) + data->NList_SourceArray = 1; + } +/* + *D(bug("%lx|AskMinMax1 MiW=%ld DeW=%ld MaW=%ld MiH=%ld DeH=%ld MaH=%ld\n",obj, + * (LONG)msg->MinMaxInfo->MinWidth,(LONG)msg->MinMaxInfo->DefWidth,(LONG)msg->MinMaxInfo->MaxWidth, + * (LONG)msg->MinMaxInfo->MinHeight,(LONG)msg->MinMaxInfo->DefHeight,(LONG)msg->MinMaxInfo->MaxHeight)); + */ + if ((data->NList_AdjustWidth > 0) && + ((data->VirtGroup || (_screen(obj)->Width*3/4 > data->NList_AdjustWidth)) && (30 < data->NList_AdjustWidth))) + { msg->MinMaxInfo->MinWidth += data->NList_AdjustWidth; + msg->MinMaxInfo->DefWidth += data->NList_AdjustWidth; + msg->MinMaxInfo->MaxWidth += data->NList_AdjustWidth; +/*D(bug("%lx|1 AdjustWidth=%ld\n",obj,data->NList_AdjustWidth));*/ + } + else if (data->NList_AdjustWidth > 0) + { if (_screen(obj)->Width*3/4 > data->NList_AdjustWidth) + msg->MinMaxInfo->MinWidth += data->NList_AdjustWidth; + else + msg->MinMaxInfo->MinWidth += 30; + msg->MinMaxInfo->DefWidth += data->NList_AdjustWidth; + if (30 < data->NList_AdjustWidth) + msg->MinMaxInfo->MaxWidth += data->NList_AdjustWidth; + else + msg->MinMaxInfo->MaxWidth += MUI_MAXMAX; +/*D(bug("%lx|2 AdjustWidth=%ld\n",obj,data->NList_AdjustWidth));*/ + } + else + { msg->MinMaxInfo->MinWidth += 30; + msg->MinMaxInfo->DefWidth += 300; + msg->MinMaxInfo->MaxWidth += MUI_MAXMAX; +/*D(bug("%lx|3 AdjustWidth=%ld\n",obj,300));*/ + } + if ((data->NList_AdjustHeight > 0) && + ((data->VirtGroup || (_screen(obj)->Height*3/4 > data->NList_AdjustHeight)) && ((data->vinc * 3) < data->NList_AdjustHeight))) + { msg->MinMaxInfo->MinHeight += data->NList_AdjustHeight; + msg->MinMaxInfo->DefHeight += data->NList_AdjustHeight; + msg->MinMaxInfo->MaxHeight += data->NList_AdjustHeight; +/*D(bug("%lx|1 AdjustHeight=%ld\n",obj,data->NList_AdjustHeight));*/ + } + else if (data->NList_AdjustHeight > 0) + { + if (_screen(obj)->Height*3/4 > data->NList_AdjustHeight) + msg->MinMaxInfo->MinHeight += data->NList_AdjustHeight; + else + msg->MinMaxInfo->MinHeight += (data->vinc * 3); + msg->MinMaxInfo->DefHeight += data->NList_AdjustHeight; + if ((data->vinc * 3) < data->NList_AdjustHeight) + msg->MinMaxInfo->MaxHeight += data->NList_AdjustHeight; + else + msg->MinMaxInfo->MaxHeight += MUI_MAXMAX; +/*D(bug("%lx|2 AdjustHeight=%ld\n",obj,data->NList_AdjustHeight));*/ + } + else + { msg->MinMaxInfo->MinHeight += (data->vinc * 3); + msg->MinMaxInfo->DefHeight += 200; + msg->MinMaxInfo->MaxHeight += MUI_MAXMAX; +/*D(bug("%lx|3 AdjustHeight=%ld\n",obj,200));*/ + } + if (data->NList_TitleSeparator && data->NList_Title) + { msg->MinMaxInfo->MinHeight += 2; + msg->MinMaxInfo->DefHeight += 2; + msg->MinMaxInfo->MaxHeight += 2; + } +/* + *D(bug("%lx|AskMinMax2 MiW=%ld DeW=%ld MaW=%ld MiH=%ld DeH=%ld MaH=%ld\n",obj, + * (LONG)msg->MinMaxInfo->MinWidth,(LONG)msg->MinMaxInfo->DefWidth,(LONG)msg->MinMaxInfo->MaxWidth, + * (LONG)msg->MinMaxInfo->MinHeight,(LONG)msg->MinMaxInfo->DefHeight,(LONG)msg->MinMaxInfo->MaxHeight)); + */ + data->NList_Quiet--; + if (!WANTED_NOTIFY(NTF_MinMaxNoDraw)) + data->do_draw_all = data->do_draw_title = data->do_draw = TRUE; + return(0); +} + + + +IPTR mNL_Notify(struct IClass *cl,Object *obj,struct MUIP_Notify *msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + switch (msg->TrigAttr) + { + case MUIA_NListview_Horiz_ScrollBar : + WANT_NOTIFY(NTF_SB); + data->scrollersobj = msg->DestObj; + break; + case MUIA_NList_Horiz_First : + WANT_NOTIFY(NTF_HSB); + case MUIA_NList_Horiz_Entries : + case MUIA_NList_Horiz_Visible : + case MUIA_NList_HorizDeltaFactor : + break; + case MUIA_NList_Prop_First : + WANT_NOTIFY(NTF_VSB); + if (msg->DestObj && !data->VertPropObject) + { + IPTR val; + + // check if MUIA_Prop_First exists + if(GetAttr(MUIA_Prop_First, msg->DestObj, &val) != FALSE) + data->VertPropObject = msg->DestObj; + } + + if (data->VertPropObject) + { if (data->NList_Smooth) + set(data->VertPropObject,MUIA_Prop_DoSmooth, TRUE); + else + set(data->VertPropObject,MUIA_Prop_DoSmooth, FALSE); + } + case MUIA_NList_VertDeltaFactor : + case MUIA_NList_Prop_Entries : + case MUIA_NList_Prop_Visible : + break; + case MUIA_List_Prop_First : + if (msg->DestObj && !data->VertPropObject) + { + IPTR val; + + // check if there exists a MUIA_Prop_First attribute + if(GetAttr(MUIA_Prop_First, msg->DestObj, &val) != FALSE) + data->VertPropObject = msg->DestObj; + + if (data->VertPropObject) + { + struct List *childlist; + + if((childlist = (struct List *)xget(data->VertPropObject, MUIA_Group_ChildList))) + { + Object *object_state = (Object *)childlist->lh_Head; + Object *child; + + while((child = NextObject(&object_state))) + { + // check if there exists a MUIA_Prop_First attribute + if(GetAttr(MUIA_Prop_First, msg->DestObj, &val) != FALSE) + { + data->VertPropObject = msg->DestObj; + break; + } + } + } + DoMethod(obj, MUIM_Notify, MUIA_NList_Prop_Entries,MUIV_EveryTime, + data->VertPropObject, 3, MUIM_NoNotifySet,MUIA_Prop_Entries,MUIV_TriggerValue); + DoMethod(obj, MUIM_Notify, MUIA_NList_Prop_Visible,MUIV_EveryTime, + data->VertPropObject, 3, MUIM_NoNotifySet,MUIA_Prop_Visible,MUIV_TriggerValue); + DoMethod(obj, MUIM_Notify, MUIA_NList_Prop_First,MUIV_EveryTime, + data->VertPropObject, 3, MUIM_NoNotifySet,MUIA_Prop_First,MUIV_TriggerValue); + DoMethod(data->VertPropObject, MUIM_Notify, MUIA_Prop_First,MUIV_EveryTime, + obj, 3, MUIM_NoNotifySet,MUIA_NList_Prop_First,MUIV_TriggerValue); + DoMethod(obj, MUIM_Notify, MUIA_NList_VertDeltaFactor,MUIV_EveryTime, + data->VertPropObject, 3, MUIM_NoNotifySet,MUIA_Prop_DeltaFactor,MUIV_TriggerValue); + if (data->NList_Smooth) + set(data->VertPropObject,MUIA_Prop_DoSmooth, TRUE); + else + set(data->VertPropObject,MUIA_Prop_DoSmooth, FALSE); + } + } + case MUIA_List_Prop_Entries : + case MUIA_List_Prop_Visible : + return (0); + case MUIA_NList_First : + WANT_NOTIFY(NTF_First); + break; + case MUIA_NList_Entries : + WANT_NOTIFY(NTF_Entries); + break; + case MUIA_NList_Active : + WANT_NOTIFY(NTF_Active); + break; + case MUIA_List_Active : + WANT_NOTIFY(NTF_L_Active); + break; + case MUIA_NList_SelectChange : + WANT_NOTIFY(NTF_Select); + break; + case MUIA_Listview_SelectChange : + WANT_NOTIFY(NTF_LV_Select); + break; + case MUIA_NList_EntryClick : + WANT_NOTIFY(NTF_EntryClick); + break; + case MUIA_NList_MultiClick : + WANT_NOTIFY(NTF_Multiclick); + break; + case MUIA_NList_MultiClickAlone : + WANT_NOTIFY(NTF_MulticlickAlone); + break; + case MUIA_NList_DoubleClick : + msg->TrigVal = MUIV_EveryTime; + WANT_NOTIFY(NTF_Doubleclick); + break; + case MUIA_Listview_DoubleClick : + WANT_NOTIFY(NTF_LV_Doubleclick); + break; + case MUIA_NList_TitleClick : + WANT_NOTIFY(NTF_TitleClick); + break; + case MUIA_NList_TitleClick2 : + WANT_NOTIFY(NTF_TitleClick2); + break; + case MUIA_NList_ButtonClick : + WANT_NOTIFY(NTF_ButtonClick); + break; + case MUIA_NList_LineHeight : + WANT_NOTIFY(NTF_LineHeight); + break; + case MUIA_NList_DragSortInsert : + WANT_NOTIFY(NTF_DragSortInsert); + break; + case MUIA_NList_InsertPosition : + WANT_NOTIFY(NTF_Insert); + break; + case MUIA_NList_Columns : + WANT_NOTIFY(NTF_Columns); + break; +/* + * default: + * D(bug("%lx|NL: Notify(0x%lx,0x%lx) ??? \n",obj,(long) msg->TrigAttr,(long) msg->TrigVal)); + */ + } + return (DoSuperMethodA(cl,obj,(Msg) msg)); +} + + +IPTR mNL_Set(struct IClass *cl,Object *obj,Msg msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + IPTR retval; + LONG do_things = TRUE; + struct TagItem *tags,*tag; + + for(tags = ((struct opSet *)msg)->ops_AttrList; (tag = (struct TagItem *)NextTagItem((APTR)&tags));) + { + switch (tag->ti_Tag) + { + case MUIA_Background : + case MUIA_Group_Forward : + break; + + case MUIA_NList_Visible : + tag->ti_Tag = TAG_IGNORE; + do_things = FALSE; + break; + + case MUIA_ShortHelp : // RHP: Added for Special Shorthelp + if (data->affover<0) + { + data->NList_ShortHelp = (STRPTR)tag->ti_Data; + } + break; + + case MUIA_ContextMenu : + if (do_things) + { + data->NList_ContextMenu = data->ContextMenu = (LONG)tag->ti_Data; + + if (data->SETUP && (data->NList_ContextMenu == (LONG)MUIV_NList_ContextMenu_Default)) + { + LONG *ptrd; + data->ContextMenu = MUIV_NList_ContextMenu_Always; + + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_Menu, &ptrd)) + { + switch (*ptrd) + { + case MUIV_NList_ContextMenu_TopOnly : + case MUIV_NList_ContextMenu_Always : + case MUIV_NList_ContextMenu_Never : + data->ContextMenu = *ptrd; + break; + } + } + } + if ((data->ContextMenu == (LONG)MUIV_NList_ContextMenu_TopOnly) || + (data->ContextMenu == (LONG)MUIV_NList_ContextMenu_Never)) + tag->ti_Data = 0; + else if (data->ContextMenu == (LONG)MUIV_NList_ContextMenu_Always) + tag->ti_Data = MUIV_NList_ContextMenu_Always; + else if (((data->ContextMenu & 0x9d510030) == 0x9d510030) && (data->numcols <= 1)) + tag->ti_Data = 0; + } + data->ContextMenuOn = (LONG) tag->ti_Data; + break; + case MUIA_List_Active : + if (!NOTIFYING(NTF_L_Active)) + NL_List_Active(data,(long) tag->ti_Data,tag,data->NList_List_Select,FALSE,0); + NOTIFY_END(NTF_L_Active); + DONE_NOTIFY(NTF_L_Active); + break; + case MUIA_NList_Active : +// D(DBF_ALWAYS, "MUIA_NList_Active %ld was %ld %ld %ld",tag->ti_Data,data->NList_Active,NOTIFYING(NTF_Active),WANTED_NOTIFY(NTF_Active)); + if (!NOTIFYING(NTF_Active)) + NL_List_Active(data,(long) tag->ti_Data,tag,data->NList_List_Select,FALSE,0); + NOTIFY_END(NTF_Active); + DONE_NOTIFY(NTF_Active); + break; + case MUIA_List_First : + case MUIA_NList_First : + if (do_things) + { + NL_List_First(data,(long) tag->ti_Data,tag); + data->ScrollBarsTime = SCROLLBARSTIME; + } + DONE_NOTIFY(NTF_First); + break; + case MUIA_NListview_Horiz_ScrollBar: break; + case MUIA_List_Visible : break; + case MUIA_List_Entries : break; + case MUIA_NList_Entries : break; + case MUIA_List_Quiet : + case MUIA_NList_Quiet : + data->display_ptr = NULL; + data->parse_column = -1; + if (tag->ti_Data == (ULONG)MUIV_NList_Quiet_Visual) + VISUALQUIET; + else if (tag->ti_Data) + FULLQUIET; + else + ENDQUIET; + tag->ti_Tag = TAG_IGNORE; + break; + case MUIA_List_Prop_Entries : + case MUIA_List_Prop_Visible : + case MUIA_List_Prop_First : + tag->ti_Tag = TAG_IGNORE; + break; + case MUIA_NList_Prop_Entries : + data->old_prop_entries = tag->ti_Data; + break; + case MUIA_NList_Prop_Visible : + data->old_prop_visible = tag->ti_Data; + break; + case MUIA_NList_Prop_First : + if (!WANTED_NOTIFY(NTF_VSB)) + tag->ti_Tag = TAG_IGNORE; + else if (((tag->ti_Data / data->vinc) != (ULONG)(data->NList_Prop_First / data->vinc)) || + (data->NList_Smooth && (tag->ti_Data != (ULONG)data->NList_Prop_First_Prec))) + { LONG dobit = tag->ti_Data - data->old_prop_first; + LONG Prop_FirstReal = -100; + data->old_prop_first = tag->ti_Data; + + dobit = ((dobit >= 0) ? dobit : -dobit) - data->NList_Prop_Visible; + dobit = (dobit >= 0) ? dobit : -dobit; + if ((dobit >= 2) && !data->drawall_dobit) + data->drawall_dobit = 2; + + NOWANT_NOTIFY(NTF_VSB); + + if(data->VertPropObject) + Prop_FirstReal = (LONG)xget(data->VertPropObject, MUIA_Prop_TrueFirst); + + data->NList_Prop_First_Real = tag->ti_Data; + if ((!data->NList_Smooth) || ((!data->NList_First_Incr) && (!data->NList_AffFirst_Incr) && + ((data->NList_Prop_First_Prec - (LONG)tag->ti_Data == data->vinc) || + (data->NList_Prop_First_Prec - (LONG)tag->ti_Data == -data->vinc) || + (Prop_FirstReal == data->NList_Prop_First_Real)))) + { LONG lpfirst; + lpfirst = (data->NList_Prop_First_Real / data->vinc) * data->vinc; + if ((lpfirst > (data->NList_Prop_Entries - data->NList_Prop_Visible)) && + (lpfirst > data->NList_Prop_First_Real)) + lpfirst = data->NList_Prop_Entries - data->NList_Prop_Visible; + if (lpfirst < 0) + lpfirst = 0; + data->NList_Prop_First = (lpfirst / data->vinc) * data->vinc; + data->NList_Prop_First_Real = data->NList_Prop_First; + data->NList_Prop_Add = 0; + lpfirst = data->NList_Prop_First / data->vinc; + + if (data->NList_First != lpfirst) + { + DO_NOTIFY(NTF_First); + } + + data->NList_First = lpfirst; + data->NList_First_Incr = 0; + data->NList_Prop_Wait = 2; + if ((data->NList_Prop_First_Real - data->NList_Prop_First_Prec < -20) || (data->NList_Prop_First_Real - data->NList_Prop_First_Prec > 20)) + data->ScrollBarsTime = SCROLLBARSTIME; + if ((data->NList_First <= 0) || (data->NList_First + data->NList_Visible >= data->NList_Entries)) + data->drawall_dobit = 0; + REDRAW; + } + else + { LONG lfirst,lincr,add,add2; + + add = data->NList_Prop_First_Real - data->NList_Prop_First_Prec; + if ((add < -5) || (add > 5)) + data->ScrollBarsTime = SCROLLBARSTIME; + + if (((data->NList_Prop_First_Real < data->NList_Prop_First_Prec) && + (data->NList_Prop_First_Real < data->NList_Prop_First)) || + ((data->NList_Prop_First_Real > data->NList_Prop_First_Prec) && + (data->NList_Prop_First_Real > data->NList_Prop_First))) + { + add2 = data->NList_Prop_First_Real - data->NList_Prop_First; + if (((add2 > 0) && ((add * 2) < add2)) || + ((add2 < 0) && ((add * 2) > add2))) + data->NList_Prop_First += (add * 2); + else + data->NList_Prop_First = data->NList_Prop_First_Real; + + lfirst = data->NList_Prop_First / data->vinc; + lincr = data->NList_Prop_First % data->vinc; + if (((add < -1) || (add > 1)) && + ((data->NList_First != lfirst) || (data->NList_First_Incr != lincr))) + { data->NList_Prop_Add = add; + data->NList_Prop_Wait = 1; + + if (data->NList_First != lfirst) + { + DO_NOTIFY(NTF_First); + } + + data->NList_First = lfirst; + data->NList_First_Incr = lincr; + REDRAW; + } + else if ((lfirst * data->vinc) == data->NList_Prop_First) + { data->NList_Prop_Add = 0; + data->NList_Prop_Wait = 1; + + if (data->NList_First != lfirst) + { + DO_NOTIFY(NTF_First); + } + + data->NList_First = lfirst; + data->NList_First_Incr = lincr; + REDRAW; + } + else + { if ((add < 0) && (data->NList_Prop_Add > -2)) + data->NList_Prop_Add = -2; + else if ((add > 0) && (data->NList_Prop_Add < 2)) + data->NList_Prop_Add = 2; + } + } + else + data->NList_Prop_Add = add; + } + if (data->drawall_dobit == 2) + data->drawall_dobit = 0; + WANT_NOTIFY(NTF_VSB); + } + data->NList_Prop_First_Prec = tag->ti_Data; + if ((tag->ti_Tag == MUIA_NList_Prop_First) || (tag->ti_Tag == MUIA_List_Prop_First)) + data->old_prop_first = tag->ti_Data; + break; + case MUIA_NList_Horiz_Entries : + data->old_horiz_entries = tag->ti_Data; + break; + case MUIA_NList_Horiz_Visible : + data->old_horiz_visible = tag->ti_Data; + break; + + case MUIA_NList_Horiz_First: + { + if (do_things) + { + data->old_horiz_first = tag->ti_Data; + NL_List_Horiz_First(data,(long) tag->ti_Data,tag); + data->ScrollBarsTime = SCROLLBARSTIME; + } + if (tag->ti_Tag == MUIA_NList_Horiz_First) + data->old_horiz_first = tag->ti_Data; + } + break; + + case MUIA_List_Title : + case MUIA_NList_Title : + data->display_ptr = NULL; + if (tag->ti_Data && !data->NList_Title) + { data->NList_Title = (char *) tag->ti_Data; + NL_SetColsAdd(data,-1,TRUE); + REDRAW_ALL_FORCE; + } + else if (!tag->ti_Data && data->NList_Title) + { NL_SetColsRem(data,-1); + data->NList_Title = NULL; + REDRAW_ALL_FORCE; + } + else if (tag->ti_Data && data->NList_Title) + { NL_SetColsRem(data,-1); + data->NList_Title = (char *) tag->ti_Data; + NL_SetColsAdd(data,-1,TRUE); + REDRAW_FORCE; + } + break; + case MUIA_NList_TitleSeparator : + data->display_ptr = NULL; + data->NList_TitleSeparator = (LONG) tag->ti_Data; + REDRAW_ALL_FORCE; + break; + case 0x8042C53E : /* sent by Listview, has same value as its MUIA_Listview_Input */ + break; + case MUIA_Listview_Input : + case MUIA_NList_Input : + if (tag->ti_Data) + { if (!data->NList_Input) + { data->NList_Input = TRUE; + nnset(obj,MUIA_Frame, MUIV_Frame_InputList); + REDRAW_ALL_FORCE; + } + } + else if (data->NList_Input) + { + data->NList_Input = FALSE; + set_Active(MUIV_NList_Active_Off); + NL_UnSelectAll(data,-1); + nnset(data->this,MUIA_Frame, MUIV_Frame_ReadList); + REDRAW_ALL_FORCE; + } + break; + case MUIA_Listview_MultiSelect : + case MUIA_NList_MultiSelect : + { BOOL reactive = FALSE; + if (data->multiselect == MUIV_NList_MultiSelect_None) + reactive = TRUE; + switch ((LONG) tag->ti_Data) + { case MUIV_NList_MultiSelect_None : + data->multiselect = data->NList_MultiSelect = MUIV_NList_MultiSelect_None; + set_Active(MUIV_NList_Active_Off); + NL_UnSelectAll(data,-1); + break; + case MUIV_NList_MultiSelect_Default : + data->NList_MultiSelect = MUIV_NList_MultiSelect_Default; + { LONG *multisel; + + if (data->SETUP && DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_MultiSelect, (SIPTR) (&multisel))) + data->multiselect = *multisel & 0x0007; + else + data->multiselect = MUIV_NList_MultiSelect_Shifted; + } + break; + case MUIV_NList_MultiSelect_Shifted : + case MUIV_NList_MultiSelect_Always : + data->multiselect = data->NList_MultiSelect = (LONG) tag->ti_Data; + break; + } + if (reactive && (data->multiselect != MUIV_NList_MultiSelect_None) && + (data->NList_Active >= 0) && (data->NList_Active < data->NList_Entries)) + { NL_UnSelectAll(data,data->NList_Active); + data->selectmode = MUIV_NList_Select_On; + NL_List_Active(data,data->NList_Active,NULL,data->selectmode,TRUE,0); + } + } + break; + case MUIA_List_DragSortable : + case MUIA_NList_DragSortable : + data->NList_DragSortable = (LONG) tag->ti_Data; + tag->ti_Tag = TAG_IGNORE; + if (data->NList_DragSortable) + { if (data->drag_type == MUIV_NList_DragType_None) + { LONG *ptrd; + if (data->SETUP && DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_DragType, &ptrd)) + data->drag_type = *ptrd; + else + data->drag_type = MUIV_NList_DragType_Immediate; + } + } + else if (data->NList_DragType == MUIV_NList_DragType_None) + data->drag_type = MUIV_NList_DragType_None; + nnset(obj,MUIA_Dropable,data->NList_Dropable); + break; + case MUIA_Listview_DragType : + case MUIA_NList_DragType : + data->NList_DragType = (LONG) tag->ti_Data; + tag->ti_Tag = TAG_IGNORE; + if (data->NList_DragType == MUIV_NList_DragType_Default) + { LONG *ptrd; + if (data->SETUP && DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_DragType, &ptrd)) + data->drag_type = *ptrd; + else + data->drag_type = MUIV_NList_DragType_Immediate; + } + else + data->drag_type = data->NList_DragType; + break; + case MUIA_NList_DragColOnly : + data->NList_DragColOnly = (LONG) tag->ti_Data; + break; + case MUIA_List_ShowDropMarks : + case MUIA_NList_ShowDropMarks : + data->NList_ShowDropMarks = (LONG) tag->ti_Data; + if (data->NList_DragSortable) + data->NList_ShowDropMarks = TRUE; + tag->ti_Tag = TAG_IGNORE; + break; + case MUIA_Draggable : +/*D(bug("%lx|set(MUIA_Draggable,%lx) \n",obj,tag->ti_Data));*/ + tag->ti_Tag = TAG_IGNORE; + if (tag->ti_Data && (data->drag_type == MUIV_NList_DragType_None)) + { LONG *ptrd; + data->NList_DragType = MUIV_NList_DragType_Default; + if (data->SETUP && DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_DragType, &ptrd)) + data->drag_type = *ptrd; + else + data->drag_type = MUIV_NList_DragType_Immediate; + } + else if (!tag->ti_Data) + data->NList_DragType = data->drag_type = MUIV_NList_DragType_None; + break; + case MUIA_Dropable : + data->NList_Dropable = tag->ti_Data; + if (data->NList_Dropable || data->NList_DragSortable) + tag->ti_Data = TRUE; + else + tag->ti_Data = FALSE; + break; + case MUIA_List_ConstructHook : + case MUIA_NList_ConstructHook : +/*D(bug("%lx|set_ConstructHook=0x%lx \n",obj,tag->ti_Data));*/ + if (tag->ti_Data == (ULONG)MUIV_NList_ConstructHook_String) + data->NList_ConstructHook = (struct Hook *) &NL_ConstructHook_String; + else + data->NList_ConstructHook = (struct Hook *) tag->ti_Data; + data->NList_ConstructHook2 = FALSE; + data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE; + data->display_ptr = NULL; + break; + case MUIA_NList_ConstructHook2 : + data->NList_ConstructHook = (struct Hook *) tag->ti_Data; + data->NList_ConstructHook2 = TRUE; + data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE; + data->display_ptr = NULL; + break; + case MUIA_List_DestructHook : + case MUIA_NList_DestructHook : +/*D(bug("%lx|set_DestructHook=0x%lx \n",obj,tag->ti_Data));*/ + if (tag->ti_Data == (ULONG)MUIV_NList_DestructHook_String) + data->NList_DestructHook = (struct Hook *) &NL_DestructHook_String; + else + data->NList_DestructHook = (struct Hook *) tag->ti_Data; + data->NList_DestructHook2 = FALSE; + data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE; + data->display_ptr = NULL; + break; + case MUIA_NList_DestructHook2 : + data->NList_DestructHook = (struct Hook *) tag->ti_Data; + data->NList_DestructHook2 = TRUE; + data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE; + data->display_ptr = NULL; + break; + case MUIA_List_CompareHook : + case MUIA_NList_CompareHook : +/*D(bug("%lx|set_CompareHook=0x%lx \n",obj,tag->ti_Data));*/ + data->NList_CompareHook = (struct Hook *) tag->ti_Data; + data->NList_CompareHook2 = FALSE; + break; + case MUIA_NList_CompareHook2 : + data->NList_CompareHook = (struct Hook *) tag->ti_Data; + data->NList_CompareHook2 = TRUE; + break; + case MUIA_List_DisplayHook : + case MUIA_NList_DisplayHook : +/*D(bug("%lx|set_DisplayHook=0x%lx \n",obj,tag->ti_Data));*/ + data->NList_DisplayHook = (struct Hook *) tag->ti_Data; + data->NList_DisplayHook2 = FALSE; + data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE; + data->display_ptr = NULL; + break; + case MUIA_NList_DisplayHook2 : + data->NList_DisplayHook = (struct Hook *) tag->ti_Data; + data->NList_DisplayHook2 = TRUE; + data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE; + data->display_ptr = NULL; + break; + case MUIA_List_MultiTestHook : + case MUIA_NList_MultiTestHook : +/*D(bug("%lx|set_MultiTestHook=0x%lx \n",obj,tag->ti_Data));*/ + data->NList_MultiTestHook = (struct Hook *) tag->ti_Data; + break; + case MUIA_NList_CopyEntryToClipHook : + data->NList_CopyEntryToClipHook = (struct Hook *) tag->ti_Data; + data->NList_CopyEntryToClipHook2 = FALSE; + break; + case MUIA_NList_CopyEntryToClipHook2 : + data->NList_CopyEntryToClipHook = (struct Hook *) tag->ti_Data; + data->NList_CopyEntryToClipHook2 = TRUE; + break; + case MUIA_NList_CopyColumnToClipHook : + data->NList_CopyColumnToClipHook = (struct Hook *) tag->ti_Data; + data->NList_CopyColumnToClipHook2 = FALSE; + break; + case MUIA_NList_CopyColumnToClipHook2 : + data->NList_CopyColumnToClipHook = (struct Hook *) tag->ti_Data; + data->NList_CopyColumnToClipHook2 = TRUE; + break; + case MUIA_Listview_DoubleClick: + WANT_NOTIFY(NTF_LV_Doubleclick); + break; + case MUIA_NList_EntryClick : + WANT_NOTIFY(NTF_EntryClick); + break; + case MUIA_NList_MultiClick : + WANT_NOTIFY(NTF_Multiclick); + break; + case MUIA_NList_MultiClickAlone : + WANT_NOTIFY(NTF_MulticlickAlone); + break; + case MUIA_NList_DoubleClick : + WANT_NOTIFY(NTF_Doubleclick); + break; + case MUIA_NList_TitleClick: +/*D(bug("set(%lx,NList_TitleClick,%lx)\n",obj,tag->ti_Data));*/ + WANT_NOTIFY(NTF_TitleClick); + break; + case MUIA_NList_TitleClick2: +/*D(bug("set(%lx,NList_TitleClick2,%lx)\n",obj,tag->ti_Data));*/ + WANT_NOTIFY(NTF_TitleClick2); + break; + case MUIA_Listview_SelectChange: + WANT_NOTIFY(NTF_LV_Select); + break; + case MUIA_NList_SelectChange: + WANT_NOTIFY(NTF_Select); + break; + case MUIA_NList_TitlePen : + SET_PEN(data->NList_TitlePen,data->Pen_Title_init); + break; + case MUIA_NList_ListPen : + SET_PEN(data->NList_ListPen,data->Pen_List_init); + break; + case MUIA_NList_SelectPen : + SET_PEN(data->NList_SelectPen,data->Pen_Select_init); + break; + case MUIA_NList_CursorPen : + SET_PEN(data->NList_CursorPen,data->Pen_Cursor_init); + break; + case MUIA_NList_UnselCurPen : + SET_PEN(data->NList_UnselCurPen,data->Pen_UnselCur_init); + break; + case MUIA_NList_InactivePen : + SET_PEN(data->NList_InactivePen,data->Pen_Inactive_init); + break; + case MUIA_NList_TitleBackground : + SET_BG(data->NList_TitleBackGround,data->BG_Title_init); + break; + case MUIA_NList_ListBackground : + SET_BG(data->NList_ListBackGround,data->BG_List_init); + break; + case MUIA_NList_SelectBackground : + SET_BG(data->NList_SelectBackground,data->BG_Select_init); + break; + case MUIA_NList_CursorBackground : + SET_BG(data->NList_CursorBackground,data->BG_Cursor_init); + break; + case MUIA_NList_UnselCurBackground : + SET_BG(data->NList_UnselCurBackground,data->BG_UnselCur_init); + break; + case MUIA_NList_InactiveBackground : + SET_BG(data->NList_InactiveBackground,data->BG_Inactive_init); + break; + + case MUIA_NList_DefaultObjectOnClick : + data->NList_DefaultObjectOnClick = (LONG) tag->ti_Data; + break; + + case MUIA_NList_ActiveObjectOnClick : + { + data->NList_ActiveObjectOnClick = (BOOL)tag->ti_Data; + if(data->NList_ActiveObjectOnClick) + { + // disable that the object will automatically get a border when + // the ActiveObjectOnClick option is active + _flags(obj) |= (1<<7); + if(data->nlistviewobj != NULL) + _flags(data->nlistviewobj) |= (1<<7); + } + else + { + // enable that the object will automatically get a border when + // the ActiveObjectOnClick option is active + _flags(obj) &= ~(1<<7); + if(data->nlistviewobj != NULL) + _flags(data->nlistviewobj) &= ~(1<<7); + } + } + break; + + case MUIA_List_MinLineHeight : + case MUIA_NList_MinLineHeight : + data->NList_MinLineHeight = (LONG) tag->ti_Data; + if (data->NList_MinLineHeight <= 0) + { data->addvinc = -data->NList_MinLineHeight; + REDRAW_ALL; + } + else if ((data->NList_MinLineHeight != data->vinc) && + (data->NList_MinLineHeight > data->font->tf_YSize) && + (data->NList_MinLineHeight > data->MinImageHeight)) + { data->addvinc = DEFAULT_VERT_INC; + if (data->SETUP) + { LONG *ptrd; + if (DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_VertInc, &ptrd)) + data->addvinc = *ptrd; + } + REDRAW_ALL; + } + break; + case MUIA_NList_ForcePen : + data->NList_ForcePen = (LONG) tag->ti_Data; + tag->ti_Tag = TAG_IGNORE; + if (data->NList_ForcePen == MUIV_NList_ForcePen_Default) + { LONG *ptrd; + if (data->SETUP && DoMethod(obj, MUIM_GetConfigItem, MUICFG_NList_ForcePen, &ptrd)) + data->ForcePen = *ptrd; + else + data->ForcePen = MUIV_NList_ForcePen_Off; + } + else + data->ForcePen = data->NList_ForcePen; + REDRAW_ALL; + break; + case MUIA_List_Format : + case MUIA_NList_Format : + data->NList_Format = (char *) tag->ti_Data; + if (data->NList_Format) + NL_Read_Format(data,data->NList_Format,(tag->ti_Tag == MUIA_List_Format)); + else + NL_Read_Format(data, (char *)"",(tag->ti_Tag == MUIA_List_Format)); + Make_Active_Visible; + REDRAW; + break; + case MUIA_NList_MakeActive : + data->NList_MakeActive = tag->ti_Data; + break; + case MUIA_NList_KeepActive : + data->NList_KeepActive = tag->ti_Data; + break; + case MUIA_NList_TypeSelect : + MOREQUIET; + NL_UnSelectAll(data,FALSE); + UnSelectCharSel(data,FALSE); + data->NList_TypeSelect = (LONG) tag->ti_Data; + NL_UnSelectAll(data,FALSE); + UnSelectCharSel(data,FALSE); + set_Active(MUIV_NList_Active_Off); + REDRAW_ALL; + LESSQUIET; + break; + case MUIA_Listview_DefClickColumn : + case MUIA_NList_DefClickColumn : + data->NList_DefClickColumn = (LONG) tag->ti_Data; + break; + case MUIA_NList_AutoCopyToClip : + data->NList_AutoCopyToClip = (LONG) tag->ti_Data; + break; + case MUIA_NList_AutoClip : + data->NList_AutoClip = (BOOL)tag->ti_Data; + break; + case MUIA_NList_TabSize : + data->NList_TabSize = (LONG) tag->ti_Data; + REDRAW_ALL; + break; + case MUIA_NList_SkipChars : + data->NList_SkipChars = (char *) tag->ti_Data; + REDRAW_ALL; + break; + case MUIA_NList_WordSelectChars : + data->NList_WordSelectChars = (char *) tag->ti_Data; + break; + case MUIA_NList_DisplayRecall : + data->display_ptr = NULL; + break; + case MUIA_List_AutoVisible : + case MUIA_NList_AutoVisible : + data->NList_AutoVisible = (LONG) tag->ti_Data; + break; + case MUIA_NList_EntryValueDependent : + data->NList_EntryValueDependent = (LONG) tag->ti_Data; + break; + case MUIA_NList_SortType : + data->NList_SortType = (LONG) tag->ti_Data; +/*D(bug("set(%lx,NList_SortType,%lx)\n",obj,tag->ti_Data));*/ + break; + case MUIA_NList_SortType2 : + data->NList_SortType2 = (LONG) tag->ti_Data; +/*D(bug("set(%lx,NList_SortType2,%lx)\n",obj,tag->ti_Data));*/ + break; + case MUIA_NList_PrivateData : + data->NList_PrivateData = (APTR) tag->ti_Data; + break; + case MUIA_NList_VertDeltaFactor : + data->old_prop_delta = tag->ti_Data; + break; + case MUIA_NList_HorizDeltaFactor : + data->old_horiz_delta = tag->ti_Data; + break; + case MUIA_NList_MinColSortable : + data->NList_MinColSortable = tag->ti_Data; + break; + case MUIA_NList_Imports : + data->NList_Imports = tag->ti_Data; + break; + case MUIA_NList_Exports : + data->NList_Exports = tag->ti_Data; + break; + case MUIA_NList_TitleMark : + if (data->NList_TitleMark != (LONG)tag->ti_Data) + { if (((data->NList_TitleMark & MUIV_NList_TitleMark_TypeMask) == MUIV_NList_TitleMark_None) && + ((data->NList_TitleMark2 & MUIV_NList_TitleMark2_TypeMask) == MUIV_NList_TitleMark2_None) && + ((tag->ti_Data & MUIV_NList_TitleMark_TypeMask) != MUIV_NList_TitleMark_None)) + { + LONG column; + for (column = 0;column < data->numcols;column++) + { if (data->cols[column].c->userwidth < 0) + data->cols[column].c->colwidthbiggestptr = -2; + } + data->do_setcols = TRUE; +/* NL_SetColsAdd(data,-1,TRUE);*/ +/* data->do_draw = data->do_draw_all = data->do_parse = data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE;*/ + } + data->NList_TitleMark = tag->ti_Data; +/*D(bug("set(%lx,NList_TitleMark,%lx)\n",obj,tag->ti_Data));*/ + data->display_ptr = NULL; + data->do_draw_title = TRUE; + REDRAW_FORCE; + } + break; + case MUIA_NList_TitleMark2 : + if (data->NList_TitleMark2 != (LONG)tag->ti_Data) + { if (((data->NList_TitleMark & MUIV_NList_TitleMark_TypeMask) == MUIV_NList_TitleMark_None) && + ((data->NList_TitleMark2 & MUIV_NList_TitleMark2_TypeMask) == MUIV_NList_TitleMark2_None) && + ((tag->ti_Data & MUIV_NList_TitleMark2_TypeMask) != MUIV_NList_TitleMark2_None)) + { + LONG column; + for (column = 0;column < data->numcols;column++) + { if (data->cols[column].c->userwidth < 0) + data->cols[column].c->colwidthbiggestptr = -2; + } + data->do_setcols = TRUE; +/* NL_SetColsAdd(data,-1,TRUE);*/ +/* data->do_draw = data->do_draw_all = data->do_parse = data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE;*/ + } + data->NList_TitleMark2 = tag->ti_Data; +/*D(bug("set(%lx,NList_TitleMark2,%lx)\n",obj,tag->ti_Data));*/ + data->display_ptr = NULL; + data->do_draw_title = TRUE; + REDRAW_FORCE; + } + break; + case MUIA_NList_Columns : +/*D(bug("set(%lx,MUIA_NList_Columns,%lx)\n",obj,tag->ti_Data));*/ + if (do_things) + { NL_Columns(data,(BYTE *) tag->ti_Data); + DONE_NOTIFY(NTF_Columns); + } + break; + case MUIA_Disabled : + if (tag->ti_Data) + data->NList_Disabled = 1; + else + { if (data->NList_Disabled) + { data->do_draw_all = data->do_draw_title = data->do_draw = TRUE; + } + data->NList_Disabled = FALSE; + } +/*D(bug("%lx|Disabled=%ld\n",obj,data->NList_Disabled));*/ + break; + case MUIA_Font : + if (do_things) + data->NList_Font = tag->ti_Data; + break; + + case MUIA_NList_KeyUpFocus: + data->NList_KeyUpFocus = (Object *)tag->ti_Data; + break; + + case MUIA_NList_KeyDownFocus: + data->NList_KeyDownFocus = (Object *)tag->ti_Data; + break; + + case MUIA_NList_KeyLeftFocus: + data->NList_KeyLeftFocus = (Object *)tag->ti_Data; + break; + + case MUIA_NList_KeyRightFocus: + data->NList_KeyRightFocus = (Object *)tag->ti_Data; + break; + + case MUIA_NList_IgnoreSpecialChars: + data->NList_IgnoreSpecialChars = (char *)tag->ti_Data; + break; + +/* + * case 0x8042AC64 : + * case 0x8042BE50 : + * case 0x8042B704 : + * case 0x804237F9 : + * case 0x8042C53E : + * case MUIA_FillArea : + * break; + * + * case TAG_IGNORE : + * D(bug("NL: Set(TAG_IGNORE,0x%lx) \n",(long) tag->ti_Data)); + * break; + * default: + * D(bug("%lx|NL: Set(0x%lx,0x%lx) ??? \n",obj,(long) tag->ti_Tag,(long) tag->ti_Data)); + */ + } + } + retval = DoSuperMethodA(cl,obj,msg); + +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + return (retval); +} + +//$$$Sensei: major cleanup: return value variable wasn't needed. The same as store. It just takes stack space. +// Some NList attributes (namely MUIA_NList_DragColOnly) wasn't returning TRUE after +// getting so DoSuperMethodA() was called on them, result probably was undefined! +// (It depends on what superclass do in OM_GET, if it clear storage data for undefined +// attributes, it could cause problems... +// Fixed msg type to correct one. +IPTR mNL_Get(struct IClass *cl,Object *obj,struct opGet *msg) +{ + struct NLData *data = INST_DATA( cl, obj ); + + switch (((struct opGet *)msg)->opg_AttrID) + { + case MUIA_Listview_SelectChange: + case MUIA_NList_SelectChange: + case MUIA_Listview_DoubleClick: *msg->opg_Storage = (ULONG) TRUE; return( TRUE ); + case MUIA_NList_DoubleClick: *msg->opg_Storage = (ULONG) data->click_line; return( TRUE ); + case MUIA_NList_MultiClick: *msg->opg_Storage = (ULONG) data->multiclick + 1; return( TRUE ); + case MUIA_NList_MultiClickAlone: *msg->opg_Storage = (ULONG) abs( data->multiclickalone ); return( TRUE ); + case MUIA_NList_EntryClick: *msg->opg_Storage = (ULONG) data->click_line; return( TRUE ); + case MUIA_List_InsertPosition: + case MUIA_NList_InsertPosition: + case MUIA_NList_DragSortInsert: *msg->opg_Storage = (ULONG) data->NList_LastInserted; return( TRUE ); + case MUIA_List_First: + case MUIA_NList_First: *msg->opg_Storage = (ULONG) data->NList_First; return( TRUE ); + case MUIA_List_Visible: + case MUIA_NList_Visible: *msg->opg_Storage = (ULONG) ( data->SHOW ? data->NList_Visible : -1 ); return( TRUE ); + case MUIA_List_Entries: + case MUIA_NList_Entries: *msg->opg_Storage = (ULONG) data->NList_Entries; return( TRUE ); + case MUIA_List_Active: + case MUIA_NList_Active: *msg->opg_Storage = (ULONG) data->NList_Active; return( TRUE ); + case MUIA_NList_Horiz_First: *msg->opg_Storage = (ULONG) data->NList_Horiz_First; return( TRUE ); + case MUIA_NList_Horiz_Visible: *msg->opg_Storage = (ULONG) data->NList_Horiz_Visible; return( TRUE ); + case MUIA_NList_Horiz_Entries: *msg->opg_Storage = (ULONG) data->NList_Horiz_Entries; return( TRUE ); + case MUIA_NList_Prop_First: + case MUIA_List_Prop_First: *msg->opg_Storage = (ULONG) data->NList_Prop_First; return( TRUE ); + case MUIA_NList_Prop_Visible: + case MUIA_List_Prop_Visible: *msg->opg_Storage = (ULONG) data->NList_Prop_Visible; return( TRUE ); + case MUIA_NList_Prop_Entries: + case MUIA_List_Prop_Entries: *msg->opg_Storage = (ULONG) data->NList_Prop_Entries; return( TRUE ); + case MUIA_NList_VertDeltaFactor: *msg->opg_Storage = (ULONG) data->vinc; return( TRUE ); + case MUIA_NList_HorizDeltaFactor: *msg->opg_Storage = (ULONG) data->hinc; return( TRUE ); + case MUIA_NListview_Horiz_ScrollBar: *msg->opg_Storage = (ULONG) 0; return( TRUE ); + case MUIA_NListview_Vert_ScrollBar: *msg->opg_Storage = (ULONG) 0; return( TRUE ); + case MUIA_NList_TitlePen: *msg->opg_Storage = (ULONG) data->NList_TitlePen; return( TRUE ); + case MUIA_NList_ListPen: *msg->opg_Storage = (ULONG) data->NList_ListPen; return( TRUE ); + case MUIA_NList_SelectPen: *msg->opg_Storage = (ULONG) data->NList_SelectPen; return( TRUE ); + case MUIA_NList_CursorPen: *msg->opg_Storage = (ULONG) data->NList_CursorPen; return( TRUE ); + case MUIA_NList_UnselCurPen: *msg->opg_Storage = (ULONG) data->NList_UnselCurPen; return( TRUE ); + case MUIA_NList_InactivePen: *msg->opg_Storage = (ULONG) data->NList_InactivePen; return( TRUE ); + case MUIA_NList_TitleBackground: *msg->opg_Storage = (ULONG) data->NList_TitleBackGround; return( TRUE ); + case MUIA_NList_ListBackground: *msg->opg_Storage = (ULONG) data->NList_ListBackGround; return( TRUE ); + case MUIA_NList_SelectBackground: *msg->opg_Storage = (ULONG) data->NList_SelectBackground; return( TRUE ); + case MUIA_NList_CursorBackground: *msg->opg_Storage = (ULONG) data->NList_CursorBackground; return( TRUE ); + case MUIA_NList_UnselCurBackground: *msg->opg_Storage = (ULONG) data->NList_UnselCurBackground; return( TRUE ); + case MUIA_NList_InactiveBackground: *msg->opg_Storage = (ULONG) data->NList_InactiveBackground; return( TRUE ); + case MUIA_Listview_Input: + case MUIA_NList_Input: *msg->opg_Storage = (ULONG) data->NList_Input; return( TRUE ); + case MUIA_List_Format: + case MUIA_NList_Format: *msg->opg_Storage = (IPTR) data->NList_Format; return( TRUE ); + case MUIA_List_Title: + case MUIA_NList_Title: *msg->opg_Storage = (IPTR) data->NList_Title; return( TRUE ); + case MUIA_NList_TitleSeparator: *msg->opg_Storage = (ULONG) data->NList_TitleSeparator; return( TRUE ); + case MUIA_List_DragSortable: + case MUIA_NList_DragSortable: *msg->opg_Storage = (ULONG) data->NList_DragSortable; return( TRUE ); + case MUIA_Listview_DragType: + case MUIA_NList_DragType: *msg->opg_Storage = (ULONG) data->NList_DragType; return( TRUE ); + case MUIA_NList_DragColOnly: *msg->opg_Storage = (ULONG) data->NList_DragColOnly; return( TRUE ); + case MUIA_List_ShowDropMarks: + case MUIA_NList_ShowDropMarks: *msg->opg_Storage = (ULONG) data->NList_ShowDropMarks; return( TRUE ); + case MUIA_List_DropMark: + case MUIA_NList_DropMark: + if ((data->marktype & MUIV_NList_DropType_Mask) == MUIV_NList_DropType_Below) + *msg->opg_Storage = (LONG) data->NList_DropMark + 1; + else + *msg->opg_Storage = (LONG) data->NList_DropMark; + return( TRUE ); + case MUIA_NList_DropType: + if ((data->marktype & MUIV_NList_DropType_Mask) == MUIV_NList_DropType_Below) + *msg->opg_Storage = (LONG) (data->marktype & ~MUIV_NList_DropType_Mask) | MUIV_NList_DropType_Above; + else + *msg->opg_Storage = (LONG) data->marktype; + return( TRUE ); + case MUIA_Listview_DefClickColumn: + case MUIA_NList_DefClickColumn: *msg->opg_Storage = (ULONG) data->NList_DefClickColumn; return( TRUE ); + case MUIA_Listview_ClickColumn: + case MUIA_NList_ClickColumn: + { struct MUI_NList_TestPos_Result res; + res.char_number = -2; + NL_List_TestPos(data,MUI_MAXMAX,MUI_MAXMAX,&res); + *msg->opg_Storage = (LONG) res.column; + } + return( TRUE ); + case MUIA_NList_TitleClick: *msg->opg_Storage = (ULONG) data->TitleClick; return( TRUE ); + case MUIA_NList_TitleClick2: *msg->opg_Storage = (ULONG) data->TitleClick2; return( TRUE ); + case MUIA_NList_ForcePen: *msg->opg_Storage = (ULONG) data->ForcePen; return( TRUE ); + case MUIA_List_AutoVisible: + case MUIA_NList_AutoVisible: *msg->opg_Storage = (ULONG) data->NList_AutoVisible; return( TRUE ); + case MUIA_NList_TabSize: *msg->opg_Storage = (ULONG) data->NList_TabSize; return( TRUE ); + case MUIA_NList_SkipChars: *msg->opg_Storage = (IPTR) data->NList_SkipChars; return( TRUE ); + case MUIA_NList_WordSelectChars: *msg->opg_Storage = (IPTR) data->NList_WordSelectChars; return( TRUE ); + case MUIA_NList_EntryValueDependent: *msg->opg_Storage = (ULONG) data->NList_EntryValueDependent; return( TRUE ); + case MUIA_NList_SortType: *msg->opg_Storage = (ULONG) data->NList_SortType; return( TRUE ); + case MUIA_NList_SortType2: *msg->opg_Storage = (ULONG) data->NList_SortType2; return( TRUE ); + case MUIA_NList_ButtonClick: *msg->opg_Storage = (ULONG) data->NList_ButtonClick; return( TRUE ); + case MUIA_NList_MinColSortable: *msg->opg_Storage = (ULONG) data->NList_MinColSortable; return( TRUE ); + case MUIA_NList_Columns: *msg->opg_Storage = (IPTR) NL_Columns(data,NULL); return( TRUE ); + case MUIA_NList_Imports: *msg->opg_Storage = (ULONG) data->NList_Imports; return( TRUE ); + case MUIA_NList_Exports: *msg->opg_Storage = (ULONG) data->NList_Exports; return( TRUE ); + case MUIA_NList_TitleMark: *msg->opg_Storage = (ULONG) data->NList_TitleMark; return( TRUE ); + case MUIA_NList_TitleMark2: *msg->opg_Storage = (ULONG) data->NList_TitleMark2; return( TRUE ); + case MUIA_NList_AutoClip: *msg->opg_Storage = (ULONG) data->NList_AutoClip; return(TRUE); + case MUIA_NList_PrivateData: *msg->opg_Storage = (IPTR) data->NList_PrivateData; return(TRUE); + + case MUIA_NList_IgnoreSpecialChars: *msg->opg_Storage = (IPTR)data->NList_IgnoreSpecialChars; return(TRUE); + + case MUIA_NList_DefaultObjectOnClick: *msg->opg_Storage = (IPTR)data->NList_DefaultObjectOnClick; return(TRUE); + case MUIA_NList_ActiveObjectOnClick: *msg->opg_Storage = (IPTR)data->NList_ActiveObjectOnClick; return(TRUE); + + case MUIA_NList_KeyUpFocus: *msg->opg_Storage = (IPTR)data->NList_KeyUpFocus; return(TRUE); + case MUIA_NList_KeyDownFocus: *msg->opg_Storage = (IPTR)data->NList_KeyDownFocus; return(TRUE); + case MUIA_NList_KeyLeftFocus: *msg->opg_Storage = (IPTR)data->NList_KeyLeftFocus; return(TRUE); + case MUIA_NList_KeyRightFocus: *msg->opg_Storage = (IPTR)data->NList_KeyRightFocus; return(TRUE); + + case MUIA_Version: *msg->opg_Storage = (ULONG) LIB_VERSION; return(TRUE); + case MUIA_Revision: *msg->opg_Storage = (ULONG) LIB_REVISION; return(TRUE); + + // Asking the superclass always yields MUIA_Disabled==FALSE even for really disabled lists. + // Hence we return our own internal value, because NList intercepts MUIA_Disabled during + // set() already. + case MUIA_Disabled: *msg->opg_Storage = data->NList_Disabled ? TRUE : FALSE; return(TRUE); + + default: + return(DoSuperMethodA(cl, obj, (Msg)msg)); + + } + +/* Cut-n-pasted from bottom of function. + LONG *store = ((struct opGet *)msg)->opg_Storage; + ULONG retval; + LONG affit = TRUE; + case MUIA_NList_MultiClickAlone: + if (data->multiclickalone < 0) + *store = -data->multiclickalone; + else + *store = data->multiclickalone; + return( TRUE ); + retval = DoSuperMethodA(cl,obj,msg); + + * + * if (affit) + * { + * if (retval) + * D(bug("NL: Get(0x%lx)=0x%lx \n",(long) ((struct opGet *)msg)->opg_AttrID, (long) *store)); + * else + * D(bug("NL: Get(0x%lx)=???? \n",(long) ((struct opGet *)msg)->opg_AttrID)); + * } + * + return(retval); + */ + + return(0); +} diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_mcc2.c b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc2.c new file mode 100644 index 0000000000..c9618580b2 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc2.c @@ -0,0 +1,2185 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <stdlib.h> + +#include <clib/alib_protos.h> +#include <proto/muimaster.h> +#include <proto/intuition.h> + +#include "private.h" + +#if !defined(__amigaos4__) +#include "newmouse.h" +#endif + +#include "NList_func.h" +#include "NListviews_mcp.h" + +#define MAX_INTUITICKS_WAIT 3 + +#define MinColWidth 2 + +#define _between(a,x,b) ((x)>=(a) && (x)<=(b)) +#define _isinobject(x,y) (_between(_mleft(obj),(x),_mright(obj)) && _between(_mtop(obj),(y),_mbottom(obj))) +#define _isinobject2(x,y) (_between(_left(obj),(x),_right(obj)) && _between(_top(obj),(y),_bottom(obj))) + +static LONG NL_TestKey(struct NLData *data,LONG KeyTag,UWORD Code,UWORD Qualifier, BOOL force) +{ + UWORD qual; + LONG i; + Qualifier &= KBQUAL_MASK; + + if (data->NList_Keys && (!(Code & 0x80) || force)) + { + for (i = 0 ; data->NList_Keys[i].kb_KeyTag > 0 ; i++) + { + if ((data->NList_Keys[i].kb_KeyTag == (ULONG)KeyTag) && + ((Code == data->NList_Keys[i].kb_Code) || + ((data->NList_Keys[i].kb_Code == (UWORD)~0) && data->NList_Keys[i].kb_Qualifier))) + { + qual = data->NList_Keys[i].kb_Qualifier; + if (Qualifier == qual) + return (TRUE); + if (!Qualifier || !(qual & KBSYM_MASK)) + continue; + + if ((qual & KBSYM_SHIFT) && !(Qualifier & KBQUALIFIER_SHIFT)) + continue; + else + qual = qual & ~KBQUALIFIER_SHIFT; + + if ((qual & KBSYM_CAPS) && !(Qualifier & KBQUALIFIER_CAPS)) + continue; + else + qual = qual & ~KBQUALIFIER_CAPS; + + if ((qual & KBSYM_ALT) && !(Qualifier & KBQUALIFIER_ALT)) + continue; + else + qual = qual & ~KBQUALIFIER_ALT; + + if ((Qualifier & qual) == qual) + return (TRUE); + } + } + } + return (FALSE); +} + + +static void NL_RequestIDCMP(struct NLData *data,LONG IDCMP_val) +{ + if (IDCMP_val & IDCMP_MOUSEMOVE) + data->MOUSE_MOVE = TRUE; + if (!(data->ehnode.ehn_Events & IDCMP_val)) + { + DoMethod(_win(data->this),MUIM_Window_RemEventHandler, &data->ehnode); + data->ehnode.ehn_Events |= IDCMP_val; + DoMethod(_win(data->this),MUIM_Window_AddEventHandler, &data->ehnode); + } +} + + +static void NL_RejectIDCMP(struct NLData *data,LONG IDCMP_val,BOOL really) +{ + if (IDCMP_val & IDCMP_MOUSEMOVE) + data->MOUSE_MOVE = FALSE; + if ((really || !(IDCMP_val & IDCMP_MOUSEMOVE)) && + (data->ehnode.ehn_Events & IDCMP_val)) + { + DoMethod(_win(data->this),MUIM_Window_RemEventHandler, &data->ehnode); + data->ehnode.ehn_Events &= (~IDCMP_val); + DoMethod(_win(data->this),MUIM_Window_AddEventHandler, &data->ehnode); + } +} + +static BOOL GotoPage(struct IClass *cl, Object *obj, ULONG activePage) +{ + struct NLData *data = INST_DATA(cl, obj); + BOOL changed; + + ENTER(); + + if(data->NList_Input && !data->NList_TypeSelect && data->EntriesArray != NULL) + changed = NL_List_Active(data, activePage, NULL, data->NList_List_Select, FALSE,0); + else + changed = NL_List_First(data, activePage, NULL); + + RETURN(changed); + return changed; +} + +static BOOL Scroll(struct IClass *cl, Object *obj, ULONG direction) +{ + struct NLData *data = INST_DATA(cl, obj); + BOOL scrolled; + + ENTER(); + + scrolled = NL_List_Horiz_First(data, direction, NULL); + + RETURN(scrolled); + return scrolled; +} + +IPTR mNL_HandleEvent(struct IClass *cl, Object *obj, struct MUIP_HandleInput *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + IPTR retval = 0; + ULONG NotNotify = data->DoNotify; + LONG tempbutton; + LONG tempbuttonline; + LONG tempbuttoncol; + LONG tempbuttonstate; + LONG tempstorebutton; +/* + *if (msg->imsg && (data->markdrawnum == MUIM_NList_Trigger)) + *{ + *LONG ab = (LONG) data->adjustbar; + *LONG co = (LONG) msg->imsg->Code; + *LONG qu = (LONG) msg->imsg->Qualifier; + *LONG mx = (LONG) msg->imsg->MouseX; + *LONG my = (LONG) msg->imsg->MouseY; + *kprintf("%lx|1ab %ld stop IntuiMessage :\n",obj,ab); + *if (msg->imsg->Class == IDCMP_INACTIVEWINDOW) + *D(bug(" Class=INACTIVEWINDOW Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else if (msg->imsg->Class == IDCMP_ACTIVEWINDOW) + *D(bug(" Class=ACTIVEWINDOW Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else if (msg->imsg->Class == IDCMP_MOUSEMOVE) + *D(bug(" Class=MOUSEMOVE Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else if (msg->imsg->Class == IDCMP_INTUITICKS) + *D(bug(" Class=INTUITICKS Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else if (msg->imsg->Class == IDCMP_MOUSEBUTTONS) + *D(bug(" Class=MOUSEBUTTONS Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else + *D(bug(" Class=%lx Code=%lx Qualifier=%lx mx=%ld my=%ld\n",msg->imsg->Class,co,qu,mx,my)); + *} +*/ + + if (!data->SHOW || !data->DRAW) + return 0; + if (data->NList_First_Incr || data->NList_AffFirst_Incr) + return (MUI_EventHandlerRC_Eat); + if (data->NList_Disabled) + return 0; + + if ((data->left != _left(obj)) || (data->top != _top(obj)) || + (data->width != _width(obj)) || (data->height != _height(obj))) + NL_SetObjInfos(data,FALSE); + + if(msg->muikey != MUIKEY_NONE && !data->NList_Quiet && !data->NList_Disabled) + { + data->ScrollBarsTime = SCROLLBARSTIME; + + SHOWVALUE(DBF_ALWAYS, msg->muikey); + switch(msg->muikey) + { + case MUIKEY_UP: + { + BOOL changed = GotoPage(cl, obj, MUIV_NList_First_Up); + + // if we have an object that we should make the new active object + // of the window we do so in case this up key action didn't end up in + // a real scrolling + if(changed == FALSE && data->NList_KeyUpFocus != NULL) + set(_win(obj), MUIA_Window_ActiveObject, data->NList_KeyUpFocus); + + retval = MUI_EventHandlerRC_Eat; + } + break; + + case MUIKEY_DOWN: + { + BOOL changed = GotoPage(cl, obj, MUIV_NList_First_Down); + + // if we have an object that we should make the new active object + // of the window we do so in case this down key action didn't end up in + // a real scrolling + if(changed == FALSE && data->NList_KeyDownFocus != NULL) + set(_win(obj), MUIA_Window_ActiveObject, data->NList_KeyDownFocus); + + retval = MUI_EventHandlerRC_Eat; + } + break; + + case MUIKEY_PAGEUP: + { + GotoPage(cl, obj, MUIV_NList_Active_PageUp); + retval = MUI_EventHandlerRC_Eat; + } + break; + + case MUIKEY_PAGEDOWN: + { + GotoPage(cl, obj, MUIV_NList_Active_PageDown); + retval = MUI_EventHandlerRC_Eat; + } + break; + + case MUIKEY_TOP: + { + GotoPage(cl, obj, MUIV_NList_Active_Top); + retval = MUI_EventHandlerRC_Eat; + } + break; + + case MUIKEY_BOTTOM: + { + GotoPage(cl, obj, MUIV_NList_Active_Bottom); + retval = MUI_EventHandlerRC_Eat; + } + break; + + case MUIKEY_PRESS: + { + if (data->NList_Input && !data->NList_TypeSelect && data->NList_Active >= 0) + { + data->click_x = data->hpos - data->NList_Horiz_First; + if ((data->NList_DefClickColumn > 0) && (data->NList_DefClickColumn < data->numcols)) + data->click_x += data->cols[data->NList_DefClickColumn].c->minx; + else + data->click_x += data->cols[0].c->minx; + if (data->click_x < data->hpos) + data->click_x = data->hpos; + if (data->click_x >= data->hpos + data->NList_Horiz_Visible) + data->click_x = data->hpos + data->NList_Horiz_Visible - 1; + data->click_y = data->vpos + ((data->NList_Active-data->NList_First) * data->vinc) + (data->vinc/2); + data->click_line = data->NList_Active; + + DO_NOTIFY(NTF_Doubleclick | NTF_LV_Doubleclick); + + if (WANTED_NOTIFY(NTF_EntryClick) && !WANTED_NOTIFY(NTF_Doubleclick) && !WANTED_NOTIFY(NTF_LV_Doubleclick)) + { + DO_NOTIFY(NTF_EntryClick); + } + + retval = MUI_EventHandlerRC_Eat; + } + } + break; + + case MUIKEY_TOGGLE: + { + if (data->multiselect && data->NList_Input && !data->NList_TypeSelect && data->EntriesArray) + { + MOREQUIET; + NL_List_Select(data,MUIV_NList_Select_Active,MUIV_NList_Active_Off,MUIV_NList_Select_Toggle,NULL); + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->NList_List_Select,FALSE,0); + LESSQUIET; + + retval = MUI_EventHandlerRC_Eat; + } + } + break; + + case MUIKEY_LEFT: + { + BOOL scrolled = Scroll(cl, obj, MUIV_NList_Horiz_First_Left); + + // if we have an object that we should make the new active object + // of the window we do so in case this left key action didn't end up in + // a real scrolling + D(DBF_STARTUP, "KeyLeftFocus: %ld %lx", scrolled, data->NList_KeyLeftFocus); + if(scrolled == FALSE && data->NList_KeyLeftFocus != NULL) + set(_win(obj), MUIA_Window_ActiveObject, data->NList_KeyLeftFocus); + + retval = MUI_EventHandlerRC_Eat; + } + break; + + case MUIKEY_RIGHT: + { + BOOL scrolled = Scroll(cl, obj, MUIV_NList_Horiz_First_Right); + + // if we have an object that we should make the new active object + // of the window we do so in case this right key action didn't end up in + // a real scrolling + D(DBF_STARTUP, "KeyRightFocus: %ld %lx", scrolled, data->NList_KeyRightFocus); + if(scrolled == FALSE && data->NList_KeyRightFocus != NULL) + set(_win(obj), MUIA_Window_ActiveObject, data->NList_KeyRightFocus); + + retval = MUI_EventHandlerRC_Eat; + } + break; + + case MUIKEY_WORDLEFT : + { + Scroll(cl, obj, MUIV_NList_Horiz_First_PageLeft); + retval = MUI_EventHandlerRC_Eat; + } + break; + + case MUIKEY_WORDRIGHT: + { + Scroll(cl, obj, MUIV_NList_Horiz_First_PageRight); + retval = MUI_EventHandlerRC_Eat; + } + break; + + case MUIKEY_LINESTART: + { + Scroll(cl, obj, MUIV_NList_Horiz_First_Start); + retval = MUI_EventHandlerRC_Eat; + } + break; + + case MUIKEY_LINEEND: + { + Scroll(cl, obj, MUIV_NList_Horiz_First_End); + retval = MUI_EventHandlerRC_Eat; + } + break; + } + + // return immediately if a key has been "used" + if(retval != 0) + return retval; + } + + /*D(bug("NL: mNL_HandleEvent() /before \n"));*/ + + if (msg->imsg && !data->NList_Quiet && !data->NList_Disabled) + { SIPTR tagval,tagval2; + LONG drag_ok = FALSE; + WORD hfirst = data->NList_Horiz_AffFirst & ~1; + WORD hfirsthpos = hfirst - data->hpos; + WORD do_draw = FALSE; + LONG WheelFastQual = NL_TestKey(data,KEYTAG_QUALIFIER_WHEEL_FAST,msg->imsg->Code,msg->imsg->Qualifier,TRUE); + LONG WheelHorizQual = NL_TestKey(data,KEYTAG_QUALIFIER_WHEEL_HORIZ,msg->imsg->Code,msg->imsg->Qualifier,TRUE); + LONG BalanceQual = NL_TestKey(data,KEYTAG_QUALIFIER_BALANCE,msg->imsg->Code,msg->imsg->Qualifier,TRUE); + LONG DragQual = NL_TestKey(data,KEYTAG_QUALIFIER_DRAG,msg->imsg->Code,msg->imsg->Qualifier,TRUE); + LONG MultQual = NL_TestKey(data,KEYTAG_QUALIFIER_MULTISELECT,msg->imsg->Code,msg->imsg->Qualifier,TRUE); + LONG Title2Qual = NL_TestKey(data,KEYTAG_QUALIFIER_TITLECLICK2,msg->imsg->Code,msg->imsg->Qualifier,TRUE); + if (data->multisel_qualifier && ((msg->imsg->Qualifier & data->multisel_qualifier) == data->multisel_qualifier)) + MultQual = TRUE; + if (data->NList_WheelMMB && (msg->imsg->Qualifier & IEQUALIFIER_MIDBUTTON)) + WheelFastQual = TRUE; + retval = 0; + + if ((msg->imsg->Class == IDCMP_INTUITICKS) || + (msg->imsg->Class == IDCMP_MOUSEMOVE) || + (msg->imsg->Class == IDCMP_MOUSEBUTTONS)) + { if ((data->multiclickalone > 0) && + !DoubleClick(data->secs,data->micros,msg->imsg->Seconds,msg->imsg->Micros)) + { DO_NOTIFY(NTF_MulticlickAlone); + } + } + switch (msg->imsg->Class) + { + case IDCMP_INACTIVEWINDOW: + case IDCMP_ACTIVEWINDOW: + { +/* + *{ + *LONG ab = (LONG) data->adjustbar; + *LONG co = (LONG) msg->imsg->Code; + *LONG qu = (LONG) msg->imsg->Qualifier; + *LONG mx = (LONG) msg->imsg->MouseX; + *LONG my = (LONG) msg->imsg->MouseY; + *D(bug("%lx|1ab %ld stop IntuiMessage :\n",obj,ab)); + *if (msg->imsg->Class == IDCMP_INACTIVEWINDOW) + *D(bug(" Class=INACTIVEWINDOW Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else if (msg->imsg->Class == IDCMP_ACTIVEWINDOW) + *D(bug(" Class=ACTIVEWINDOW Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else + *D(bug(" Class=%lx Code=%lx Qualifier=%lx mx=%ld my=%ld\n",msg->imsg->Class,co,qu,mx,my)); + *} +*/ + NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,TRUE); + data->selectskiped = FALSE; + data->moves = FALSE; + + if (data->adjustbar != -1) + { data->adjustbar = -1; + do_draw = TRUE; + data->click_line = -2; + } +/* +** Reset the ShortHelp to the Default for Not Being Over Button +*/ + if (data->affover>=0) + { + data->affover = -1; + nnset(obj,MUIA_ShortHelp,data->NList_ShortHelp); + } + if (data->affbutton >= 0) + { + NL_Changed(data,data->affbuttonline); + do_draw = TRUE; + data->affbutton = -1; + data->affbuttonline = -1; + data->affbuttoncol = -1; + data->affbuttonstate = 0; + data->storebutton = FALSE; + } + } + mNL_Trigger(cl,obj,NULL); + return (MUI_EventHandlerRC_Eat); + break; + + case IDCMP_RAWKEY: + { + data->ScrollBarsTime = SCROLLBARSTIME; + + if(msg->imsg->Code == RAWKEY_PAGEUP) + { + GotoPage(cl, obj, MUIV_NList_Active_PageUp); + retval = MUI_EventHandlerRC_Eat; + } + else if(msg->imsg->Code == RAWKEY_PAGEDOWN) + { + GotoPage(cl, obj, MUIV_NList_Active_PageDown); + retval = MUI_EventHandlerRC_Eat; + } + else if(msg->imsg->Code == RAWKEY_HOME) + { + GotoPage(cl, obj, MUIV_NList_Active_Top); + retval = MUI_EventHandlerRC_Eat; + } + else if(msg->imsg->Code == RAWKEY_END) + { + GotoPage(cl, obj, MUIV_NList_Active_Bottom); + retval = MUI_EventHandlerRC_Eat; + } + else + { + #if !defined(__amigaos4__) + // check for wheelmouse events first + if(_isinobject(msg->imsg->MouseX,msg->imsg->MouseY)) + { + if(msg->imsg->Code == NM_WHEEL_UP) /* MOUSE_WHEEL_UP */ + { + if(WheelHorizQual && WheelFastQual) + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Left4,NULL); + else if(WheelHorizQual) + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Left,NULL); + else if(WheelFastQual) + { + int i; + for(i=0; i < data->NList_WheelFast; i++) + NL_List_First(data,MUIV_NList_First_Up,NULL); + } + else + { + int i; + for(i=0; i < data->NList_WheelStep; i++) + NL_List_First(data,MUIV_NList_First_Up,NULL); + } + + retval = MUI_EventHandlerRC_Eat; + } + else if(msg->imsg->Code == NM_WHEEL_DOWN) /* MOUSE_WHEEL_DOWN */ + { + if(WheelHorizQual && WheelFastQual) + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Right4,NULL); + else if(WheelHorizQual) + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Right,NULL); + else if(WheelFastQual) + { + int i; + for(i=0; i < data->NList_WheelFast; i++) + NL_List_First(data,MUIV_NList_First_Down,NULL); + } + else + { + int i; + for(i=0; i < data->NList_WheelStep; i++) + NL_List_First(data,MUIV_NList_First_Down,NULL); + } + + retval = MUI_EventHandlerRC_Eat; + } + else if(msg->imsg->Code == NM_WHEEL_LEFT) /* MOUSE_WHEEL_LEFT */ + { + NL_List_Horiz_First(data, WheelFastQual ? MUIV_NList_Horiz_First_Left4 : MUIV_NList_Horiz_First_Left, NULL); + + retval = MUI_EventHandlerRC_Eat; + } + else if(msg->imsg->Code == NM_WHEEL_RIGHT) /* MOUSE_WHEEL_RIGHT */ + { + NL_List_Horiz_First(data, WheelFastQual ? MUIV_NList_Horiz_First_Right4 : MUIV_NList_Horiz_First_Right, NULL); + + retval = MUI_EventHandlerRC_Eat; + } + } + #endif + + if((tagval = xget(_win(obj), MUIA_Window_ActiveObject)) && + ((tagval == (SIPTR)data->nlistviewobj) || + (tagval && (tagval2 = xget((Object *)tagval, MUIA_Listview_List)) && (tagval2 == (SIPTR)data->nlistviewobj)) || + (!tagval && (tagval2 = xget(_win(obj), MUIA_Window_DefaultObject)) && (tagval2 == (SIPTR)data->nlistviewobj))) + ) + { + if (data->NList_AutoCopyToClip) + { + if (NL_TestKey(data,KEYTAG_COPY_TO_CLIPBOARD,msg->imsg->Code,msg->imsg->Qualifier,FALSE)) + { + NL_CopyTo(data,MUIV_NList_CopyToClip_Selected,NULL,0L,NULL,NULL); + if (data->NList_TypeSelect == MUIV_NList_TypeSelect_Char) + SelectFirstPoint(data,data->click_x,data->click_y); + retval = MUI_EventHandlerRC_Eat; + } + } + if (NL_TestKey(data,KEYTAG_SELECT_TO_TOP,msg->imsg->Code,msg->imsg->Qualifier,FALSE)) + { + if (data->NList_Input && !data->NList_TypeSelect && data->EntriesArray) + { + LONG newactsel = MUIV_NList_Select_On; + + if (data->NList_Active >= 0 && data->EntriesArray[data->NList_Active]->Select == TE_Select_None) + newactsel = MUIV_NList_Select_Off; + NL_List_Active(data,MUIV_NList_Active_UntilTop,NULL,newactsel,FALSE,0); + } + retval = MUI_EventHandlerRC_Eat; + } + else if (NL_TestKey(data,KEYTAG_SELECT_TO_BOTTOM,msg->imsg->Code,msg->imsg->Qualifier,FALSE)) + { + if (data->NList_Input && !data->NList_TypeSelect && data->EntriesArray) + { + LONG newactsel = MUIV_NList_Select_On; + + if (data->NList_Active >= 0 && data->EntriesArray[data->NList_Active]->Select == TE_Select_None) + newactsel = MUIV_NList_Select_Off; + NL_List_Active(data,MUIV_NList_Active_UntilBottom,NULL,newactsel,FALSE,0); + } + retval = MUI_EventHandlerRC_Eat; + } + else if (NL_TestKey(data,KEYTAG_SELECT_TO_PAGE_UP,msg->imsg->Code,msg->imsg->Qualifier,FALSE)) + { + /* Page up key pressed */ + if (data->NList_Input && !data->NList_TypeSelect && data->EntriesArray) + { + LONG newactsel = MUIV_NList_Select_On; + + if (data->NList_Active >= 0 && data->EntriesArray[data->NList_Active]->Select == TE_Select_None) + newactsel = MUIV_NList_Select_Off; + NL_List_Active(data,MUIV_NList_Active_UntilPageUp,NULL,newactsel,FALSE,0); + } + retval = MUI_EventHandlerRC_Eat; + } + else if (NL_TestKey(data,KEYTAG_SELECT_TO_PAGE_DOWN,msg->imsg->Code,msg->imsg->Qualifier,FALSE)) + { + /* Page down key pressed */ + if (data->NList_Input && !data->NList_TypeSelect && data->EntriesArray) + { + LONG newactsel = MUIV_NList_Select_On; + + if (data->NList_Active >= 0 && data->EntriesArray[data->NList_Active]->Select == TE_Select_None) + newactsel = MUIV_NList_Select_Off; + NL_List_Active(data,MUIV_NList_Active_UntilPageDown,NULL,newactsel,FALSE,0); + } + retval = MUI_EventHandlerRC_Eat; + } + else if (NL_TestKey(data,KEYTAG_SELECT_UP,msg->imsg->Code,msg->imsg->Qualifier,FALSE)) + { + /* Up key pressed */ + if (data->NList_Input && !data->NList_TypeSelect && data->EntriesArray) + { + LONG newactsel = MUIV_NList_Select_On; + + if (data->NList_Active >= 0 && data->EntriesArray[data->NList_Active]->Select == TE_Select_None) + newactsel = MUIV_NList_Select_Off; + NL_List_Active(data,MUIV_NList_Active_Up,NULL,newactsel,FALSE,0); + } + retval = MUI_EventHandlerRC_Eat; + } + else if (NL_TestKey(data,KEYTAG_SELECT_DOWN,msg->imsg->Code,msg->imsg->Qualifier,FALSE)) + { + /* Down key pressed */ + if (data->NList_Input && !data->NList_TypeSelect && data->EntriesArray) + { + LONG newactsel = MUIV_NList_Select_On; + + if (data->NList_Active >= 0 && data->EntriesArray[data->NList_Active]->Select == TE_Select_None) + newactsel = MUIV_NList_Select_Off; + NL_List_Active(data,MUIV_NList_Active_Down,NULL,newactsel,FALSE,0); + } + retval = MUI_EventHandlerRC_Eat; + } + else if (NL_TestKey(data,KEYTAG_TOGGLE_ACTIVE,msg->imsg->Code,msg->imsg->Qualifier,FALSE)) + { + if (data->multiselect && data->NList_Input && !data->NList_TypeSelect && data->EntriesArray) + NL_List_Select(data,MUIV_NList_Select_Active,MUIV_NList_Active_Off,MUIV_NList_Select_Toggle,NULL); + retval = MUI_EventHandlerRC_Eat; + } + else if (NL_TestKey(data,KEYTAG_DEFAULT_WIDTH_COLUMN,msg->imsg->Code,msg->imsg->Qualifier,FALSE)) + { + struct MUI_NList_TestPos_Result res; + + res.char_number = -2; + NL_List_TestPos(data,MUI_MAXMAX,0,&res); + if ((res.column >= 0) && (res.column < data->numcols) && !(res.flags & MUI_NLPR_BAR)) + { + NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,TRUE); + data->selectskiped = FALSE; + data->moves = FALSE; + if (data->adjustbar != -1) + { data->adjustbar = -1; + do_draw = TRUE; + data->click_line = -2; + } + NL_ColWidth(data,NL_ColumnToCol(data,res.column),MUIV_NList_ColWidth_Default); + } + } + else if (NL_TestKey(data,KEYTAG_DEFAULT_WIDTH_ALL_COLUMNS,msg->imsg->Code,msg->imsg->Qualifier,FALSE)) + NL_ColWidth(data,MUIV_NList_ColWidth_All,MUIV_NList_ColWidth_Default); + else if (NL_TestKey(data,KEYTAG_DEFAULT_ORDER_COLUMN,msg->imsg->Code,msg->imsg->Qualifier,FALSE)) + { + struct MUI_NList_TestPos_Result res; + + res.char_number = -2; + NL_List_TestPos(data,MUI_MAXMAX,0,&res); + if ((res.column >= 0) && (res.column < data->numcols) && !(res.flags & MUI_NLPR_BAR)) + { + NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,TRUE); + data->selectskiped = FALSE; + data->moves = FALSE; + if (data->adjustbar != -1) + { data->adjustbar = -1; + do_draw = TRUE; + data->click_line = -2; + } + NL_SetCol(data,res.column,MUIV_NList_SetColumnCol_Default); + } + } + else if (NL_TestKey(data,KEYTAG_DEFAULT_ORDER_ALL_COLUMNS,msg->imsg->Code,msg->imsg->Qualifier,FALSE)) + NL_SetCol(data,MUIV_NList_SetColumnCol_Default,MUIV_NList_SetColumnCol_Default); + +/* + * else + * { int posraw; + * posraw = DeadKeyConvert(data,msg->imsg,data->rawtext,MAXRAWBUF,0L); + * if (posraw > 0) + * { + * D(bug("RAWKEY BUF=%s \n",data->rawtext)); + * } + * } + */ + } + } + } + break; + + #if defined(__amigaos4__) + case IDCMP_EXTENDEDMOUSE: + { + if(msg->imsg->Code & IMSGCODE_INTUIWHEELDATA && + _isinobject(msg->imsg->MouseX, msg->imsg->MouseY)) + { + struct IntuiWheelData *iwd = (struct IntuiWheelData *)msg->imsg->IAddress; + + if(iwd->WheelY < 0) // WHEEL_UP + { + if(WheelHorizQual && WheelFastQual) + NL_List_Horiz_First(data, MUIV_NList_Horiz_First_Left4, NULL); + else if(WheelHorizQual) + NL_List_Horiz_First(data, MUIV_NList_Horiz_First_Left, NULL); + else if(WheelFastQual) + { + int i; + for(i=0; i < data->NList_WheelFast; i++) + NL_List_First(data, MUIV_NList_First_Up, NULL); + } + else + { + int i; + for(i=0; i < data->NList_WheelStep; i++) + NL_List_First(data, MUIV_NList_First_Up, NULL); + } + + retval = MUI_EventHandlerRC_Eat; + } + else if(iwd->WheelY > 0) // WHEEL_DOWN + { + if(WheelHorizQual && WheelFastQual) + NL_List_Horiz_First(data, MUIV_NList_Horiz_First_Right4, NULL); + else if(WheelHorizQual) + NL_List_Horiz_First(data, MUIV_NList_Horiz_First_Right, NULL); + else if(WheelFastQual) + { + int i; + for(i=0; i < data->NList_WheelFast; i++) + NL_List_First(data, MUIV_NList_First_Down, NULL); + } + else + { + int i; + for(i=0; i < data->NList_WheelStep; i++) + NL_List_First(data, MUIV_NList_First_Down, NULL); + } + + retval = MUI_EventHandlerRC_Eat; + } + + if(iwd->WheelX < 0) // WHEEL_LEFT + { + NL_List_Horiz_First(data, WheelFastQual ? MUIV_NList_Horiz_First_Left4 : MUIV_NList_Horiz_First_Left, NULL); + + retval = MUI_EventHandlerRC_Eat; + } + else if(iwd->WheelX > 0) // WHEEL_RIGHT + { + NL_List_Horiz_First(data, WheelFastQual ? MUIV_NList_Horiz_First_Right4 : MUIV_NList_Horiz_First_Right, NULL); + + retval = MUI_EventHandlerRC_Eat; + } + } + } + break; + #endif + + case IDCMP_MOUSEBUTTONS: + data->ScrollBarsTime = SCROLLBARSTIME; + { + LONG multi = 0; + LONG isdoubleclick = 0; + if ((data->multiselect != MUIV_NList_MultiSelect_None) && + (MultQual || (data->multiselect == MUIV_NList_MultiSelect_Always))) + multi = 1; + data->selectskiped = FALSE; + // Using _isinobject2() here would also recognize clicks on the list's border + // as clicks inside the list. But clicking on the border above the list's title + // being interpreted like a click the first entry is not very intuitive. Thus + // we restrict ourself to clicks really inside the object here. + if(msg->imsg->Code == SELECTDOWN && _isinobject(msg->imsg->MouseX, msg->imsg->MouseY)) + { + WORD ly = (msg->imsg->MouseY - data->vpos); + WORD ly2 = (msg->imsg->MouseY - data->vdtitlepos); + WORD lyl = ly / data->vinc; + LONG lyl2 = lyl + data->NList_First; + WORD lx = (msg->imsg->MouseX - data->hpos); + BOOL do_else = FALSE; + BOOL mclick = FALSE; + + if (lx < 0) + { + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Left,NULL); + data->selectmode = MUIV_NList_Select_None; + data->NumIntuiTick = MAX_INTUITICKS_WAIT; + data->moves = TRUE; + NL_RequestIDCMP(data,IDCMP_MOUSEMOVE); + } + else if (lx >= data->NList_Horiz_Visible) + { + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Right,NULL); + data->selectmode = MUIV_NList_Select_None; + data->NumIntuiTick = MAX_INTUITICKS_WAIT; + data->moves = TRUE; + NL_RequestIDCMP(data,IDCMP_MOUSEMOVE); + } + else if (ly2 < 0) + { + data->selectmode = data->NList_List_Select; + if (data->NList_Input && !data->NList_TypeSelect) + { if (data->NList_Active > data->NList_First) + NL_List_Active(data,MUIV_NList_Active_PageUp,NULL,data->selectmode,FALSE,0); + else + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + } + else + NL_List_First(data,MUIV_NList_First_Up,NULL); + data->NumIntuiTick = MAX_INTUITICKS_WAIT; + data->moves = TRUE; + NL_RequestIDCMP(data,IDCMP_MOUSEMOVE); + } + else if ((lyl >= data->NList_Visible) || (lyl2 >= data->NList_Entries)) + { + data->selectmode = data->NList_List_Select; + if (data->NList_Input && !data->NList_TypeSelect) + { if (data->NList_Active < data->NList_First - 1 + data->NList_Visible) + NL_List_Active(data,MUIV_NList_Active_PageDown,NULL,data->selectmode,FALSE,0); + else + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + } + else + NL_List_First(data,MUIV_NList_First_Down,NULL); + data->NumIntuiTick = MAX_INTUITICKS_WAIT; + data->moves = TRUE; + NL_RequestIDCMP(data,IDCMP_MOUSEMOVE); + } + else + do_else = TRUE; + + if ((lx < 0) || (lx >= data->NList_Horiz_Visible) || (ly2 < 0) || (lyl >= data->NList_Visible) || (lyl2 >= data->NList_Entries)) + lyl2 = -2; + else if ((ly2 >= 0) && (ly < 0)) + lyl2 = -1; + isdoubleclick = DoubleClick(data->secs,data->micros,msg->imsg->Seconds,msg->imsg->Micros); + if ((data->click_line == lyl2) && (lyl2 >= -1) && + (abs(data->click_x - msg->imsg->MouseX) < 4) && (abs(data->click_y - msg->imsg->MouseY) < 4) && + isdoubleclick) + { + mclick = TRUE; + } + else + { + BOOL modifyActiveObject = FALSE; + BOOL modifyDefaultObject = FALSE; + Object *newActiveObject = (Object *)MUIV_Window_ActiveObject_None; + + data->secs = msg->imsg->Seconds; + data->micros = msg->imsg->Micros; + data->click_line = lyl2; + data->click_x = msg->imsg->MouseX; + data->click_y = msg->imsg->MouseY; + data->mouse_x = msg->imsg->MouseX; + data->mouse_y = msg->imsg->MouseY; + data->multiclick = 0; + data->multiclickalone = 1; + if (data->click_line >= 0) + { + DO_NOTIFY(NTF_EntryClick); + } + + if (data->NList_Title && (lx >= 0) && (lx < data->NList_Horiz_Visible) && (ly2 >= 0) && (ly < 0)) + { + struct MUI_NList_TestPos_Result res; + + res.char_number = -2; + NL_List_TestPos(data,MUI_MAXMAX,MUI_MAXMAX,&res); + if ((res.flags & MUI_NLPR_BAR) && (res.flags & MUI_NLPR_TITLE) && (res.flags & MUI_NLPR_ABOVE) && + (res.column < data->numcols) && (res.column >= 0)) + { + WORD minx = data->cols[res.column].c->minx - hfirsthpos + + ((data->cols[res.column].c->delta-1) / 2) + MinColWidth; + WORD actx = data->cols[res.column].c->maxx - hfirsthpos + + ((data->cols[res.column].c->delta-1) / 2); + if ((actx < data->mleft) || (actx > data->mright)) + actx = msg->imsg->MouseX; + data->adjustcolumn = res.column; + { + if (actx <= minx) + { if (minx >= data->mleft) + { data->adjustbar = minx + hfirsthpos; + data->adjustbar_last = data->cols[data->adjustcolumn].c->userwidth; + do_draw = TRUE; + NL_RequestIDCMP(data,IDCMP_MOUSEMOVE); + } + } + else if (actx > minx) + { data->adjustbar = actx + hfirsthpos; + data->adjustbar_last = data->cols[data->adjustcolumn].c->userwidth; + do_draw = TRUE; + NL_RequestIDCMP(data,IDCMP_MOUSEMOVE); + } + if ((data->adjustbar >= 0) && BalanceQual && + ((res.column < data->numcols-2) || + ((res.column == data->numcols-2) && (data->cols[res.column+1].c->userwidth > 0)))) + { data->adjustbar_last2 = data->cols[res.column+1].c->userwidth; + data->adjustbar2 = data->cols[res.column+1].c->maxx; + } + else + data->adjustbar2 = -1; + } + data->click_line = -2; + data->moves = FALSE; + drag_ok = FALSE; + } + else if ((res.flags & MUI_NLPR_ABOVE) && (res.flags & MUI_NLPR_TITLE) && + (res.column < data->numcols) && (res.column >= 0)) + { + data->adjustcolumn = res.column; + if ((WANTED_NOTIFY(NTF_TitleClick) || WANTED_NOTIFY(NTF_TitleClick2)) && data->cols[res.column].c->titlebutton) + { data->adjustbar = -2; + do_draw = TRUE; + NL_RequestIDCMP(data,IDCMP_MOUSEMOVE); + } + else + { if (WANTED_NOTIFY(NTF_TitleClick2) && (Title2Qual || !WANTED_NOTIFY(NTF_TitleClick))) + data->TitleClick2 = (LONG) data->cols[res.column].c->col; + else + data->TitleClick = (LONG) data->cols[res.column].c->col; + if ((data->adjustcolumn >= data->NList_MinColSortable) && + ((data->numcols - data->NList_MinColSortable) > 1) && + (NL_OnWindow(data,msg->imsg->MouseX,msg->imsg->MouseY))) + { +/* + *{ + *LONG ab = (LONG) data->adjustbar; + *LONG co = (LONG) msg->imsg->Code; + *LONG qu = (LONG) msg->imsg->Qualifier; + *LONG mx = (LONG) msg->imsg->MouseX; + *LONG my = (LONG) msg->imsg->MouseY; + *D(bug("%lx|1ab0 %ld start col sort IntuiMessage :\n",obj,ab)); + *if (msg->imsg->Class == IDCMP_MOUSEMOVE) + *D(bug(" Class=MOUSEMOVE Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else if (msg->imsg->Class == IDCMP_INTUITICKS) + *D(bug(" Class=INTUITICKS Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else if (msg->imsg->Class == IDCMP_MOUSEBUTTONS) + *D(bug(" Class=MOUSEBUTTONS Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else + *D(bug(" Class=%lx Code=%lx Qualifier=%lx mx=%ld my=%ld\n",msg->imsg->Class,co,qu,mx,my)); + *} +*/ + data->adjustbar = -10; + + // set a custom mouse pointer + ShowCustomPointer(data, PT_MOVE); + } + } + data->moves = FALSE; + drag_ok = FALSE; + } + } + else if (!data->NList_Title && (lx >= 0) && (lx < data->NList_Horiz_Visible) && (ly < data->vinc/2) && (ly >= 0)) + { struct MUI_NList_TestPos_Result res; + + res.char_number = -2; + NL_List_TestPos(data,MUI_MAXMAX,MUI_MAXMAX,&res); + if ((res.flags & MUI_NLPR_BAR) && + (res.column < data->numcols) && (res.column >= 0)) + { + WORD minx = data->cols[res.column].c->minx - hfirsthpos + + ((data->cols[res.column].c->delta-1) / 2) + 10; + WORD actx = data->cols[res.column].c->maxx - hfirsthpos + + ((data->cols[res.column].c->delta-1) / 2); + if ((actx < data->mleft) || (actx > data->mright)) + actx = msg->imsg->MouseX; + data->adjustcolumn = res.column; + { + if (actx <= minx) + { if (minx >= data->mleft) + { data->adjustbar = minx + hfirsthpos; + data->adjustbar_last = data->cols[data->adjustcolumn].c->userwidth; + do_draw = TRUE; + NL_RequestIDCMP(data,IDCMP_MOUSEMOVE); + } + } + else if (actx > minx) + { data->adjustbar = actx + hfirsthpos; + data->adjustbar_last = data->cols[data->adjustcolumn].c->userwidth; + do_draw = TRUE; + NL_RequestIDCMP(data,IDCMP_MOUSEMOVE); + } + if ((data->adjustbar >= 0) && BalanceQual && + ((res.column < data->numcols-2) || + ((res.column == data->numcols-2) && (data->cols[res.column+1].c->userwidth > 0)))) + { data->adjustbar_last2 = data->cols[res.column+1].c->userwidth; + data->adjustbar2 = data->cols[res.column+1].c->maxx; + } + else + data->adjustbar2 = -1; + } + data->click_line = -2; + data->moves = FALSE; + drag_ok = FALSE; + } + } + + if(data->NList_DefaultObjectOnClick == TRUE) + { + IPTR tst = xget(_win(obj), MUIA_Window_ActiveObject); + + if(tst != MUIV_Window_ActiveObject_None && tst != data->NList_KeepActive && tst != (IPTR)data->nlistviewobj) + { + if(data->NList_MakeActive != (IPTR)NULL) + newActiveObject = (Object *)data->NList_MakeActive; + else + newActiveObject = (Object *)MUIV_Window_ActiveObject_None; + + modifyActiveObject = TRUE; + } + + modifyDefaultObject = TRUE; + } + else if(data->NList_MakeActive != (IPTR)NULL) + { + newActiveObject = (Object *)data->NList_MakeActive; + modifyActiveObject = TRUE; + } + + // now we check if the user wants to set this object + // as the active one or not. + if(data->NList_ActiveObjectOnClick == TRUE && data->isActiveObject == FALSE) + { + // set our parent NListview object as new active object + newActiveObject = data->nlistviewobj; + modifyActiveObject = TRUE; + } + + // change the window's active object if necessary + if(modifyActiveObject == TRUE) + { + set(_win(obj), MUIA_Window_ActiveObject, newActiveObject); + } + else if(modifyDefaultObject == TRUE) + { + // set our parent NListview object as new default object + set(_win(obj), MUIA_Window_DefaultObject, data->nlistviewobj); + } + + if(data->NList_TypeSelect && (data->adjustbar == -1)) + { + if(MultQual) + SelectSecondPoint(data,data->click_x,data->click_y); + else + { + data->NList_TypeSelect = MUIV_NList_TypeSelect_Char; + SelectFirstPoint(data,data->click_x,data->click_y); + } + } + } + + if (do_else && (data->adjustbar == -1) && (ly >= 0) && (lyl >= 0) && (lyl < data->NList_Visible)) + { + struct MUI_NList_TestPos_Result res; + + data->affbutton = -1; + data->affbuttonline = -1; + data->affbuttoncol = -1; + data->affbuttonstate = 0; + data->storebutton = TRUE; + res.char_number = 0; + NL_List_TestPos(data,msg->imsg->MouseX,msg->imsg->MouseY,&res); + data->storebutton = FALSE; + if ((data->affbutton >= 0) && (data->affbuttonline >= 0)) + { data->affbuttonstate = -2; + NL_Changed(data,data->affbuttonline); + do_draw = TRUE; + data->moves = FALSE; + drag_ok = FALSE; + mclick = FALSE; + } + NL_RequestIDCMP(data,IDCMP_MOUSEMOVE); + } + + if(mclick) + { + data->secs = msg->imsg->Seconds; + data->micros = msg->imsg->Micros; + data->multiclick++; + data->multiclickalone++; + + if (data->multiclick == 1) + { + DO_NOTIFY(NTF_Doubleclick | NTF_LV_Doubleclick); + } + else if (data->multiclick > 1) + { + DO_NOTIFY(NTF_Multiclick); + } + + if (data->NList_TypeSelect && (data->adjustbar == -1)) + { + if (MultQual) + { SelectSecondPoint(data,data->click_x,data->click_y); + do_else = FALSE; + } + else + { + if ((data->multiclick % 3) == 0) + data->NList_TypeSelect = MUIV_NList_TypeSelect_Char; + else if ((data->multiclick % 3) == 1) + data->NList_TypeSelect = MUIV_NList_TypeSelect_CWord; + else if ((data->multiclick % 3) == 2) + data->NList_TypeSelect = MUIV_NList_TypeSelect_CLine; + SelectFirstPoint(data,data->click_x,data->click_y); + do_else = FALSE; + } + } + } + + if (do_else && (data->adjustbar == -1) && (data->affbutton < 0) && (ly >= 0) && (lyl >= 0) && (lyl < data->NList_Visible)) + { + long lactive = lyl + data->NList_First; + if ((lactive >= 0) && (lactive < data->NList_Entries)) + { + if (data->NList_Input && !data->NList_TypeSelect) + { + if (data->multiselect == MUIV_NList_MultiSelect_None) + { + data->selectmode = MUIV_NList_Select_On; + NL_List_Active(data,lactive,NULL,data->selectmode,FALSE,0); + } + else if (!multi) + { + MOREQUIET; + NL_UnSelectAll(data,lactive); + data->selectmode = MUIV_NList_Select_On; + NL_List_Active(data,lactive,NULL,data->selectmode,TRUE,0); + LESSQUIET; + data->selectskiped = TRUE; + } + else + { + if (data->EntriesArray[lactive]->Select == TE_Select_None) + data->selectmode = MUIV_NList_Select_On; + else + data->selectmode = MUIV_NList_Select_Off; + NL_List_Active(data,lactive,NULL,data->selectmode,TRUE,0); + data->selectskiped = TRUE; + } + } + } + data->moves = TRUE; + NL_RequestIDCMP(data,IDCMP_MOUSEMOVE); + + if (data->drag_type != MUIV_NList_DragType_None) + { + if (DragQual) + drag_ok = TRUE; + else if ((data->drag_type == MUIV_NList_DragType_Immediate) || (data->drag_type == MUIV_NList_DragType_Borders)) + data->drag_border = TRUE; + } + } + + // the click happened inside our realm, so signal MUI that we ate that click + retval = MUI_EventHandlerRC_Eat; + } + else + { + if((msg->imsg->Code==SELECTDOWN) && data->NList_DefaultObjectOnClick) + { + /* click was not in _isinobject2() */ + ULONG tst = xget(_win(obj), MUIA_Window_DefaultObject); + + if(tst == (IPTR)obj) + set(_win(obj), MUIA_Window_DefaultObject, NULL); + + // do not return MUI_EventHandlerRC_Eat, because this click happened outside + // of our realm and most probably needs to be handled by another object. + } +/* + if (!(((msg->imsg->Code==MIDDLEDOWN) || (msg->imsg->Code==MIDDLEUP)) && (data->drag_qualifier & IEQUALIFIER_MIDBUTTON)) && + !(((msg->imsg->Code==MENUDOWN) || (msg->imsg->Code==MENUUP)) && (data->drag_qualifier & IEQUALIFIER_RBUTTON))) +*/ + { + NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,FALSE); + data->selectskiped = FALSE; + data->moves = FALSE; + drag_ok = FALSE; + } + } + if (msg->imsg->Code==SELECTUP) + { + data->moves = data->selectskiped = FALSE; +/* + *{ + *LONG ab = (LONG) data->adjustbar; + *LONG co = (LONG) msg->imsg->Code; + *LONG qu = (LONG) msg->imsg->Qualifier; + *LONG mx = (LONG) msg->imsg->MouseX; + *LONG my = (LONG) msg->imsg->MouseY; + *D(bug("18a Class=%lx Code=%lx Qualifier=%lx mx=%ld my=%ld %ld.%ld (%ld)\n",msg->imsg->Class,co,qu,mx,my,msg->imsg->Seconds,msg->imsg->Micros,data->moves)); + *} +*/ + if(data->NList_Input == FALSE && (data->NList_TypeSelect == MUIV_NList_TypeSelect_Char) && + data->NList_AutoClip == TRUE && (data->sel_pt[0].ent >= 0) && (data->sel_pt[1].ent >= 0) && !MultQual) + { + NL_CopyTo(data,MUIV_NList_CopyToClip_Selected,NULL,0L,NULL,NULL); + SelectFirstPoint(data,data->click_x,data->click_y); + } + } + if ((msg->imsg->Code==SELECTUP) && ((data->adjustbar >= 0) || (data->adjustbar_old >= 0))) + { + if ((data->adjustcolumn < data->numcols) && (data->adjustcolumn >= 0)) + { + WORD userwidth = data->adjustbar + - ((data->cols[data->adjustcolumn].c->delta-1) / 2) + - data->cols[data->adjustcolumn].c->minx; + + if (userwidth < MinColWidth) + userwidth = MinColWidth; + if (data->cols[data->adjustcolumn].c->userwidth != userwidth) + { + data->cols[data->adjustcolumn].c->userwidth = userwidth; + if (data->adjustbar2 >= 0) + { + userwidth = data->adjustbar2 - data->cols[data->adjustcolumn].c->minx + - userwidth - data->cols[data->adjustcolumn].c->delta; + if (userwidth < MinColWidth) + userwidth = MinColWidth; + data->cols[data->adjustcolumn+1].c->userwidth = userwidth; + } + data->do_setcols = TRUE; + /*data->ScrollBarsPos = -2;*/ + } + } + data->adjustbar = -1; + do_draw = TRUE; + NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,TRUE); + data->click_line = -2; + data->moves = FALSE; + drag_ok = FALSE; + } + else if (((msg->imsg->Code == MENUDOWN) || (msg->imsg->Code == MENUUP)) && + ((data->adjustbar >= 0) || (data->adjustbar_old >= 0))) + { + if (data->NList_ColWidthDrag == MUIV_NList_ColWidthDrag_Visual) + { + data->cols[data->adjustcolumn].c->userwidth = data->adjustbar_last; + if (data->adjustbar2 > 0) + data->cols[data->adjustcolumn+1].c->userwidth = data->adjustbar_last2; + data->do_setcols = TRUE; + } + data->adjustbar = -1; + data->adjustbar2 = -1; + NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,FALSE); + do_draw = TRUE; + data->click_line = -2; + data->moves = FALSE; + drag_ok = FALSE; + } + if ((msg->imsg->Code==SELECTUP) && (data->adjustbar >= -4) && (data->adjustbar <= -2)) + { NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,TRUE); + data->moves = FALSE; + drag_ok = FALSE; + if ((data->adjustbar > -4) && + (data->adjustcolumn < data->numcols) && (data->adjustcolumn >= 0) && + (msg->imsg->MouseX >= data->mleft) && + (msg->imsg->MouseX <= data->mright) && + (msg->imsg->MouseY >= data->vdtitlepos) && + (msg->imsg->MouseY < data->mbottom)) + { data->click_line = -2; + if (WANTED_NOTIFY(NTF_TitleClick2) && (Title2Qual || !WANTED_NOTIFY(NTF_TitleClick))) + { data->TitleClick2 = (LONG) data->cols[data->adjustcolumn].c->col; + DO_NOTIFY(NTF_TitleClick2); + } + else + { data->TitleClick = (LONG) data->cols[data->adjustcolumn].c->col; + DO_NOTIFY(NTF_TitleClick); + } + } + data->adjustbar = -1; + do_draw = TRUE; + } + else if ((msg->imsg->Code==SELECTUP) && (data->adjustbar == -10)) + { + NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,TRUE); + data->moves = FALSE; + drag_ok = FALSE; + data->adjustbar = -1; + do_draw = TRUE; + HideCustomPointer(data); + } + if (((msg->imsg->Code==SELECTUP) || (msg->imsg->Code==MENUDOWN)) && + (data->affbutton >= 0)) + { + if ((data->affbuttonstate == 2) || (data->affbuttonstate == -2)) + { + data->NList_ButtonClick = data->affbutton; + DO_NOTIFY(NTF_ButtonClick); + } + NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,TRUE); + NL_Changed(data,data->affbuttonline); + do_draw = TRUE; + data->affbutton = -1; + data->affbuttonline = -1; + data->affbuttoncol = -1; + data->affbuttonstate = 0; + data->storebutton = FALSE; + } + } + //retval = MUI_EventHandlerRC_Eat; + break; + case IDCMP_INTUITICKS: + { + struct MUI_NList_TestPos_Result res; +/* +** Store Current Values to Temp Variables +*/ + tempbutton = data->affbutton; + tempbuttonline = data->affbuttonline; + tempbuttoncol = data->affbuttoncol; + tempbuttonstate = data->affbuttonstate; + tempstorebutton = data->storebutton; + data->affimage = -1; + data->affbutton = -1; + data->affbuttonline = -1; + data->affbuttoncol = -1; + data->affbuttonstate = 0; + data->storebutton = TRUE; + res.char_number = 0; + NL_List_TestPos(data,msg->imsg->MouseX,msg->imsg->MouseY,&res); + if (data->affbutton>=0) { + if (data->affover!=data->affbutton) { +/* +** Set the ShortHelp to the Button's for Being Over Button (If ShortHelp Exists) +*/ + data->affover = data->affbutton; + if ((data->affimage >= 0) && (data->affimage < data->LastImage) && data->NList_UseImages) + { + STRPTR shorthelp; + + if((shorthelp = (STRPTR)xget(data->NList_UseImages[data->affimage].imgobj, MUIA_ShortHelp))) + nnset(obj,MUIA_ShortHelp,shorthelp); + } + } + } + else { + if (data->affover!=-1) { +/* +** Reset the ShortHelp to the Default for Not Being Over Button +*/ + data->affover = -1; + nnset(obj,MUIA_ShortHelp,data->NList_ShortHelp); + } + } +/* +** Restore Values from Temp Variables +*/ + data->affbutton = tempbutton; + data->affbuttonline = tempbuttonline; + data->affbuttoncol = tempbuttoncol; + data->affbuttonstate = tempbuttonstate; + data->storebutton = tempstorebutton; + if(data->NumIntuiTick > 0) + { + data->NumIntuiTick--; + break; + } + } + + if(!_isinobject(msg->imsg->MouseX,msg->imsg->MouseY) && data->moves == FALSE) + HideCustomPointer(data); + + // walk through to next case... + + case IDCMP_MOUSEMOVE: + + if((msg->imsg->Class == IDCMP_MOUSEMOVE) && data->MOUSE_MOVE) + data->ScrollBarsTime = SCROLLBARSTIME; + + if((msg->imsg->Class == IDCMP_MOUSEMOVE) && + ((msg->imsg->Qualifier & IEQUALIFIER_LEFTBUTTON) != IEQUALIFIER_LEFTBUTTON) && + ((msg->imsg->Qualifier & (IEQUALIFIER_LALT|IEQUALIFIER_LCOMMAND)) != (IEQUALIFIER_LALT|IEQUALIFIER_LCOMMAND))) + { +/* + *{ + *LONG ab = (LONG) data->adjustbar; + *LONG co = (LONG) msg->imsg->Code; + *LONG qu = (LONG) msg->imsg->Qualifier; + *LONG mx = (LONG) msg->imsg->MouseX; + *LONG my = (LONG) msg->imsg->MouseY; + *D(bug("%lx|1ab %ld stop IntuiMessage :\n",obj,ab)); + *if (msg->imsg->Class == IDCMP_MOUSEMOVE) + *D(bug(" Class=MOUSEMOVE Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else if (msg->imsg->Class == IDCMP_INTUITICKS) + *D(bug(" Class=INTUITICKS Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else + *D(bug(" Class=%lx Code=%lx Qualifier=%lx mx=%ld my=%ld\n",msg->imsg->Class,co,qu,mx,my)); + *} +*/ + NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,TRUE); + data->selectskiped = FALSE; + data->moves = FALSE; + + if (data->adjustbar != -1) + { data->adjustbar = -1; + do_draw = TRUE; + data->click_line = -2; + } + if (data->affbutton >= 0) + { + NL_Changed(data,data->affbuttonline); + do_draw = TRUE; + data->affbutton = -1; + data->affbuttonline = -1; + data->affbuttoncol = -1; + data->affbuttonstate = 0; + data->storebutton = FALSE; + } + } + + if(!data->MOUSE_MOVE && (msg->imsg->Class == IDCMP_MOUSEMOVE)) + break; + + data->mouse_x = msg->imsg->MouseX; + data->mouse_y = msg->imsg->MouseY; + + if ((data->ContextMenu == (LONG)MUIV_NList_ContextMenu_TopOnly) /*&& (data->numcols > 1)*/) /* sba: Contextmenu problem: Disabled */ + { if ((data->NList_Title && (msg->imsg->MouseY >= data->vpos)) || (!data->NList_Title && (msg->imsg->MouseY > data->vpos + data->vinc/3))) + { if (data->ContextMenuOn) + notdoset(obj,MUIA_ContextMenu,NULL); + } + else + { if (!data->ContextMenuOn) + notdoset(obj,MUIA_ContextMenu,MUIV_NList_ContextMenu_TopOnly); + } + } +/* else if (((data->ContextMenu & 0x9d510030) == 0x9d510030) && (data->numcols <= 1) && data->ContextMenuOn) + notdoset(obj,MUIA_ContextMenu,NULL); +*/ /* sba: Contextmenu problem: Disabled */ + if ((data->affbutton >= 0) && (msg->imsg->Class == IDCMP_MOUSEMOVE)) + { + if ((msg->imsg->MouseX >= data->affbuttonpos.Left) && + (msg->imsg->MouseX < data->affbuttonpos.Left+data->affbuttonpos.Width) && + (msg->imsg->MouseY >= data->affbuttonpos.Top) && + (msg->imsg->MouseY < data->affbuttonpos.Top+data->affbuttonpos.Height)) + { if ((data->affbuttonstate != -2) && (data->affbuttonstate != 2)) + { + data->affbuttonstate = -2; + NL_Changed(data,data->affbuttonline); + do_draw = TRUE; + } + } + else + { if ((data->affbuttonstate == -2) || (data->affbuttonstate == 2)) + { + data->affbuttonstate = -1; + NL_Changed(data,data->affbuttonline); + do_draw = TRUE; + } + } + data->moves = FALSE; + drag_ok = FALSE; + } + + if ((data->adjustbar >= 0) && (msg->imsg->Class == IDCMP_MOUSEMOVE)) + { WORD ab = msg->imsg->MouseX; + WORD minx = data->cols[data->adjustcolumn].c->minx - hfirsthpos + + ((data->cols[data->adjustcolumn].c->delta-1) / 2) + MinColWidth; + if (ab <= minx) + ab = minx; + if ((ab + hfirsthpos) != data->adjustbar) + { data->adjustbar = ab + hfirsthpos; + do_draw = TRUE; + if (data->NList_ColWidthDrag == MUIV_NList_ColWidthDrag_Visual) + { if ((data->adjustcolumn < data->numcols) && (data->adjustcolumn >= 0)) + { WORD userwidth = data->adjustbar + - ((data->cols[data->adjustcolumn].c->delta-1) / 2) + - data->cols[data->adjustcolumn].c->minx; + if (userwidth < MinColWidth) + userwidth = MinColWidth; + if (data->cols[data->adjustcolumn].c->userwidth != userwidth) + { data->cols[data->adjustcolumn].c->userwidth = userwidth; + if (data->adjustbar2 >= 0) + { userwidth = data->adjustbar2 - data->cols[data->adjustcolumn].c->minx + - userwidth - data->cols[data->adjustcolumn].c->delta; + if (userwidth < MinColWidth) + userwidth = MinColWidth; + data->cols[data->adjustcolumn+1].c->userwidth = userwidth; + } + data->do_setcols = TRUE; + /*data->ScrollBarsPos = -2;*/ + } + } + } + } + if (msg->imsg->MouseX < data->mleft) + { NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Left,NULL); +/* NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,FALSE);*/ + } + else if (msg->imsg->MouseX >= data->mright) + { NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Right,NULL); +/* NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,FALSE);*/ + } + else + NL_RequestIDCMP(data,IDCMP_MOUSEMOVE); + } + else if ((data->adjustbar >= -4) && (data->adjustbar <= -2) && (msg->imsg->Class == IDCMP_MOUSEMOVE)) + { if ((data->adjustcolumn < data->numcols) && + (data->adjustcolumn >= 0)) + { WORD minx = (data->cols[data->adjustcolumn].c->minx - hfirsthpos); + WORD maxx = (data->cols[data->adjustcolumn].c->maxx - hfirsthpos); + WORD maxy = data->vdtitlepos + data->vdtitleheight; + if (!data->NList_TitleSeparator) + maxy--; + if (data->adjustcolumn > 0) + minx -= (data->cols[data->adjustcolumn-1].c->delta - (((data->cols[data->adjustcolumn-1].c->delta-1) / 2) + 1)); + maxx += ((data->cols[data->adjustcolumn].c->delta-1) / 2); + if ((data->adjustcolumn >= data->NList_MinColSortable) && + ((data->numcols - data->NList_MinColSortable) > 1) && + ((msg->imsg->MouseX < data->click_x - 6) || (msg->imsg->MouseX > data->click_x + 6)) && + (NL_OnWindow(data,msg->imsg->MouseX,msg->imsg->MouseY))) + { +/* + *{ + *LONG ab = (LONG) data->adjustbar; + *LONG co = (LONG) msg->imsg->Code; + *LONG qu = (LONG) msg->imsg->Qualifier; + *LONG mx = (LONG) msg->imsg->MouseX; + *LONG my = (LONG) msg->imsg->MouseY; + *D(bug("%lx|2ab0 %ld start col sort IntuiMessage :\n",obj,ab)); + *if (msg->imsg->Class == IDCMP_MOUSEMOVE) + *D(bug(" Class=MOUSEMOVE Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else if (msg->imsg->Class == IDCMP_INTUITICKS) + *D(bug(" Class=INTUITICKS Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else + *D(bug(" Class=%lx Code=%lx Qualifier=%lx mx=%ld my=%ld\n",msg->imsg->Class,co,qu,mx,my)); + *} +*/ + data->adjustbar = -10; + + // set a custom mouse pointer + ShowCustomPointer(data, PT_MOVE); + + data->moves = FALSE; + drag_ok = FALSE; + do_draw = TRUE; + } + else if ((msg->imsg->MouseX < data->mleft) || + (msg->imsg->MouseX > data->mright) || + (msg->imsg->MouseX < minx) || + (msg->imsg->MouseX > maxx) || + (msg->imsg->MouseY < data->vdtitlepos) || + (msg->imsg->MouseY > maxy)) + { data->adjustbar = -4; + do_draw = TRUE; + data->click_line = -2; + } + else if (data->adjustbar == -4) + { data->adjustbar = -2; + do_draw = TRUE; + data->click_line = -2; + } + } + else + { +/* + *{ + *LONG ab = (LONG) data->adjustbar; + *LONG co = (LONG) msg->imsg->Code; + *LONG qu = (LONG) msg->imsg->Qualifier; + *LONG mx = (LONG) msg->imsg->MouseX; + *LONG my = (LONG) msg->imsg->MouseY; + *D(bug("%lx|3ab %ld stop IntuiMessage :\n",obj,ab)); + *if (msg->imsg->Class == IDCMP_MOUSEMOVE) + *D(bug(" Class=MOUSEMOVE Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else if (msg->imsg->Class == IDCMP_INTUITICKS) + *D(bug(" Class=INTUITICKS Code=%lx Qualifier=%lx mx=%ld my=%ld\n",co,qu,mx,my)); + *else + *D(bug(" Class=%lx Code=%lx Qualifier=%lx mx=%ld my=%ld\n",msg->imsg->Class,co,qu,mx,my)); + *} +*/ + data->adjustbar = -1; + NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,FALSE); + do_draw = TRUE; + data->click_line = -2; + } + } + + { + struct MUI_NList_TestPos_Result res; + + res.char_number = -2; + NL_List_TestPos(data,msg->imsg->MouseX,msg->imsg->MouseY,&res); + + if(data->adjustbar == -10) + { + if ((res.column >= data->NList_MinColSortable) && (data->adjustcolumn >= 0) && + (data->adjustcolumn != res.column) && (res.xoffset > 0) && + (res.xoffset < data->cols[res.column].c->dx) && (res.xoffset < data->cols[data->adjustcolumn].c->dx)) + { struct colinfo *tmpc = data->cols[res.column].c; + data->cols[res.column].c = data->cols[data->adjustcolumn].c; + data->cols[data->adjustcolumn].c = tmpc; + data->adjustcolumn = res.column; + data->do_draw_all = data->do_draw_title = data->do_draw = TRUE; + data->do_parse = data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE; + do_draw = TRUE; + /*data->ScrollBarsPos = -2;*/ + DO_NOTIFY(NTF_Columns); + } + } + else + { + BOOL overObject = _isinobject(msg->imsg->MouseX, msg->imsg->MouseY); + + if (((data->adjustbar >= 0) || + ((!data->moves) && (data->adjustbar >= -1) && + (res.flags & MUI_NLPR_BAR) && (res.flags & MUI_NLPR_ONTOP) && + (res.column < data->numcols) && (res.column >= 0))) && + (overObject == TRUE)) + { + // set a custom mouse pointer + ShowCustomPointer(data, PT_SIZE); + } + else if(data->NList_SelectPointer == TRUE && + data->NList_TypeSelect == MUIV_NList_TypeSelect_Char && + overObject == TRUE) + { + // in case the NList object is in charwise selection mode and the mouse + // is above the object itself we show a specialized selection pointer + ShowCustomPointer(data, PT_SELECT); + } + else + { + HideCustomPointer(data); + } + } + } + + + if (data->moves) + { + WORD ly = (msg->imsg->MouseY - data->vpos); + WORD lyl = ly / data->vinc; + LONG lyl2 = lyl + data->NList_First; + WORD lx = (msg->imsg->MouseX - data->hpos); + WORD sel_x = msg->imsg->MouseX; + WORD sel_y = msg->imsg->MouseY; + + data->NumIntuiTick = 0; + if ((ly >= 0) && (lyl >= 0) && (lyl < data->NList_Visible) && + ((lx < 0) || (lx >= data->NList_Horiz_Visible))) + { if (data->drag_border) + { drag_ok = TRUE; + } + data->drag_border = FALSE; + } + if (drag_ok) + { /* do nothing */ + } + else if (lx < 0) + { if (msg->imsg->Class == IDCMP_MOUSEMOVE) + break; + if (msg->imsg->MouseX < data->mleft-40) + { MOREQUIET; + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Left4,NULL); + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Left4,NULL); + LESSQUIET; + } + else if (msg->imsg->MouseX < data->mleft-24) + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Left4,NULL); + else if (msg->imsg->MouseX < data->mleft-8) + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Left2,NULL); + else + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Left,NULL); + data->selectskiped = FALSE; + if (data->NList_TypeSelect && (data->sel_pt[0].ent >= 0)) + { sel_x = data->hpos; + data->last_sel_click_x = sel_x +1; + } + } + else if (lx >= data->NList_Horiz_Visible) + { if (msg->imsg->Class == IDCMP_MOUSEMOVE) + break; + if (msg->imsg->MouseX > data->mright+40) + { MOREQUIET; + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Right4,NULL); + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Right4,NULL); + LESSQUIET; + } + else if (msg->imsg->MouseX > data->mright+24) + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Right4,NULL); + else if (msg->imsg->MouseX > data->mright+8) + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Right2,NULL); + else + NL_List_Horiz_First(data,MUIV_NList_Horiz_First_Right,NULL); + data->selectskiped = FALSE; + if (data->NList_TypeSelect && (data->sel_pt[0].ent >= 0)) + { sel_x = data->hpos + data->NList_Horiz_Visible - 1; + data->last_sel_click_x = sel_x -1; + } + } + else if (ly < 0) + { + long lactive = data->NList_First - 1; + if (lactive < 0) + lactive = 0; + + if (msg->imsg->Class == IDCMP_MOUSEMOVE) + break; + if (msg->imsg->MouseY < data->vdtpos-40) + { if (data->NList_Input && !data->NList_TypeSelect) + { MOREQUIET; + if (data->multiselect && data->selectskiped && (lactive >= 0) && (lactive != data->lastactived)) + { NL_List_Select(data,lactive,data->lastactived,data->selectmode,NULL); + NL_List_Active(data,lactive,NULL,data->selectmode,FALSE,0); + } + else + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + LESSQUIET; + } + else + { MOREQUIET; + NL_List_First(data,MUIV_NList_First_Up4,NULL); + NL_List_First(data,MUIV_NList_First_Up4,NULL); + LESSQUIET; + } + } + else if (msg->imsg->MouseY < data->vdtpos-24) + { if (data->NList_Input && !data->NList_TypeSelect) + { MOREQUIET; + if (data->multiselect && data->selectskiped && (lactive >= 0) && (lactive != data->lastactived)) + { NL_List_Select(data,lactive,data->lastactived,data->selectmode,NULL); + NL_List_Active(data,lactive,NULL,data->selectmode,FALSE,0); + } + else + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + LESSQUIET; + } + else + NL_List_First(data,MUIV_NList_First_Up4,NULL); + } + else if (msg->imsg->MouseY < data->vdtpos-8) + { if (data->NList_Input && !data->NList_TypeSelect) + { MOREQUIET; + if (data->multiselect && data->selectskiped && (lactive >= 0) && (lactive != data->lastactived)) + { NL_List_Select(data,lactive,data->lastactived,data->selectmode,NULL); + NL_List_Active(data,lactive,NULL,data->selectmode,FALSE,0); + } + else + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + LESSQUIET; + } + else + NL_List_First(data,MUIV_NList_First_Up2,NULL); + } + else + { if (data->NList_Input && !data->NList_TypeSelect) + NL_List_Active(data,MUIV_NList_Active_Up,NULL,data->selectmode,FALSE,0); + else + NL_List_First(data,MUIV_NList_First_Up,NULL); + } + data->selectskiped = FALSE; + if (data->NList_TypeSelect && (data->sel_pt[0].ent >= 0)) + { sel_y = data->vpos; + data->last_sel_click_y = sel_y +1; + } + } + else if ((lyl >= data->NList_Visible) || (lyl2 >= data->NList_Entries)) + { + long lactive = data->NList_First + data->NList_Visible; + if (lactive >= data->NList_Entries) + lactive = data->NList_Entries - 1; + + if (msg->imsg->Class == IDCMP_MOUSEMOVE) + break; + + if (msg->imsg->MouseY > data->vdbpos+40) + { if (data->NList_Input && !data->NList_TypeSelect) + { MOREQUIET; + if (data->multiselect && data->selectskiped && (lactive >= 0) && (lactive != data->lastactived)) + { NL_List_Select(data,lactive,data->lastactived,data->selectmode,NULL); + NL_List_Active(data,lactive,NULL,data->selectmode,FALSE,0); + } + else + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + LESSQUIET; + } + else + { MOREQUIET; + NL_List_First(data,MUIV_NList_First_Down4,NULL); + NL_List_First(data,MUIV_NList_First_Down4,NULL); + LESSQUIET; + } + } + else if (msg->imsg->MouseY > data->vdbpos+24) + { if (data->NList_Input && !data->NList_TypeSelect) + { MOREQUIET; + if (data->multiselect && data->selectskiped && (lactive >= 0) && (lactive != data->lastactived)) + { NL_List_Select(data,lactive,data->lastactived,data->selectmode,NULL); + NL_List_Active(data,lactive,NULL,data->selectmode,FALSE,0); + } + else + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + LESSQUIET; + } + else + NL_List_First(data,MUIV_NList_First_Down4,NULL); + } + else if (msg->imsg->MouseY > data->vdbpos+8) + { if (data->NList_Input && !data->NList_TypeSelect) + { MOREQUIET; + if (data->multiselect && data->selectskiped && (lactive >= 0) && (lactive != data->lastactived)) + { NL_List_Select(data,lactive,data->lastactived,data->selectmode,NULL); + NL_List_Active(data,lactive,NULL,data->selectmode,FALSE,0); + } + else + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + LESSQUIET; + } + else + NL_List_First(data,MUIV_NList_First_Down2,NULL); + } + else + { if (data->NList_Input && !data->NList_TypeSelect) + NL_List_Active(data,MUIV_NList_Active_Down,NULL,data->selectmode,FALSE,0); + else + NL_List_First(data,MUIV_NList_First_Down,NULL); + } + data->selectskiped = FALSE; + if (data->NList_TypeSelect && (data->sel_pt[0].ent >= 0)) + { if (data->NList_First + data->NList_Visible < data->NList_Entries) + sel_y = data->vpos + (data->NList_Visible * data->vinc) - 1; + else + sel_y = data->vpos + ((data->NList_Entries-data->NList_First) * data->vinc) - 1; + data->last_sel_click_y = sel_y -1; + } + } + else if ((lyl >= 0) && (lyl < data->NList_Visible)) + { + if (data->NList_Input && !data->NList_TypeSelect) + { + long lactive = lyl + data->NList_First; + if ((lactive != data->NList_Active) && (lactive >= 0) && (lactive < data->NList_Entries)) + { + if (data->multiselect == MUIV_NList_MultiSelect_None) + { + NL_List_Select(data,data->lastactived,MUIV_NList_Active_Off,MUIV_NList_Select_Off,NULL); + data->selectmode = MUIV_NList_Select_On; + } + if (data->multiselect && data->selectskiped) + { + NL_List_Select(data,lactive,data->lastactived,data->selectmode,NULL); + NL_List_Active(data,lactive,NULL,data->selectmode,FALSE,0); + } + else if (data->multiselect) + { + data->selectskiped = TRUE; + NL_List_Active(data,lactive,NULL,data->selectmode,FALSE,0); + } + else + { + // NL_List_Active(data,lactive,NULL,data->selectmode,FALSE,0); + + // Is this call really required??? + // It causes NList to misbehave if the user clicks in the list while the + // window has MUIA_Window_Sleep set to TRUE. In this case the click seems + // to be "cached" and is applied again as soon as the window is woken up + // again, which is definitely wrong. + // Well's have to see if commenting out this line causes any new misbehaviour. + } + } + } + if (msg->imsg->Class == IDCMP_INTUITICKS) + { + NL_RequestIDCMP(data,IDCMP_MOUSEMOVE); + } + if (data->drag_type != MUIV_NList_DragType_None) + { + if (DragQual) + { + drag_ok = TRUE; + } + else if ((data->drag_type == MUIV_NList_DragType_Immediate) && !data->multiselect && (msg->imsg->Class == IDCMP_MOUSEMOVE)) + { + drag_ok = TRUE; + } + else if ((data->drag_type == MUIV_NList_DragType_Immediate) || (data->drag_type == MUIV_NList_DragType_Borders)) + data->drag_border = TRUE; + } + } + if (data->NList_TypeSelect && (data->sel_pt[0].ent >= 0) && + ((sel_x != data->last_sel_click_x) || (sel_y != data->last_sel_click_y))) + SelectSecondPoint(data,sel_x,sel_y); + } + /*retval = MUI_EventHandlerRC_Eat;*/ + break; + default: + break; + } + + if (do_draw) + { REDRAW; +/* do_notifies(NTF_AllChanges);*/ + } + +/* + * if (NEED_NOTIFY(NTF_AllClick)) + * { //do_notifies(NTF_AllClick); + * //retval = MUI_EventHandlerRC_Eat; + * } + */ + if (drag_ok && (data->drag_type != MUIV_NList_DragType_None) && + ((msg->imsg->Class == IDCMP_MOUSEBUTTONS) || (msg->imsg->Class == IDCMP_MOUSEMOVE)) && + (data->NList_Active >= data->NList_First) && + (data->NList_Active < data->NList_First + data->NList_Visible)) + { + LONG first,last,ent,numlines,lyl; +/*D(bug("%lx| 17 drag_ok=%ld drag should start\n",obj,drag_ok));*/ + if (!data->NList_TypeSelect) + { first = 0; + while ((first < data->NList_Entries) && (data->EntriesArray[first]->Select == TE_Select_None)) + first++; + last = data->NList_Entries - 1; + while ((last > 0) && (data->EntriesArray[last]->Select == TE_Select_None)) + last--; + { ent = first; + numlines = 0; + while (ent <= last) + { if (data->EntriesArray[ent]->Select != TE_Select_None) + numlines++; + ent++; + } + } + } + else + { first = data->sel_pt[data->min_sel].ent; + last = data->sel_pt[data->max_sel].ent; + if ((data->sel_pt[data->max_sel].column == 0) && (data->sel_pt[data->max_sel].xoffset == PMIN)) + last--; + numlines = last - first + 1; + } + if ((first > 0) && (first < data->NList_Entries) && (data->EntriesArray[first]->Wrap & TE_Wrap_TmpLine)) + first -= data->EntriesArray[first]->dnum; + if ((last > 0) && (last < data->NList_Entries) && data->EntriesArray[last]->Wrap) + { if (data->EntriesArray[last]->Wrap & TE_Wrap_TmpLine) + last -= data->EntriesArray[last]->dnum; + if (last > 0) + last += data->EntriesArray[last]->dnum - 1; + } + retval = MUI_EventHandlerRC_Eat; + if ((first >= 0) && (first <= last) && (last < data->NList_Entries)) + { + LONG dragx; + LONG dragy; + + data->DragRPort = NULL; + + if ((first < data->NList_First) || (last >= data->NList_First + data->NList_Visible) || + (numlines != (last - first + 1)) || (data->NList_DragColOnly >= 0) || + (numlines >= data->NList_DragLines)) + { + data->DragEntry = first; + if ((data->NList_Active >= 0) && (data->NList_Active >= data->NList_First) && (last < data->NList_First + data->NList_Visible)) + first = data->NList_Active; + else + first = data->NList_First; + last = first-1; + } + dragx = msg->imsg->MouseX - data->mleft; + dragy = msg->imsg->MouseY - (data->vpos+(data->vinc * (first - data->NList_First))); + + if((data->DragRPort = CreateDragRPort(data,numlines,first,last))) + { + if (dragx < 0) + dragx = 0; + else if (dragx >= data->DragWidth) + dragx = data->DragWidth-1; + dragy = data->DragHeight; + } + else + { + if (first >= data->NList_First + data->NList_Visible) + first = data->NList_First + data->NList_Visible - 1; + if (first < data->NList_First) + first = data->NList_First; + if (last >= data->NList_First + data->NList_Visible) + last = data->NList_First + data->NList_Visible - 1; + if (last < first) + last = first; + lyl = last - first + 1; + _left(obj) = data->mleft; + _top(obj) = data->vpos+(data->vinc * (first - data->NList_First)); + _width(obj) = data->mwidth; + _height(obj) = data->vinc * lyl; + dragx = msg->imsg->MouseX - _left(obj); + dragy = msg->imsg->MouseY - _top(obj); + if (dragx < 0) + dragx = 0; + else if (dragx >= _width(obj)) + dragx = _width(obj)-1; + if (dragy < 0) + dragy = 0; + else if (dragy >= _height(obj)) + dragy = _height(obj)-1; + data->badrport = TRUE; + } +/*D(bug("%lx| 18 drag_ok=%ld drag start now\n",obj,drag_ok));*/ + data->markdrawnum = MUIM_NList_Trigger; + NL_RejectIDCMP(data,IDCMP_INTUITICKS,TRUE); + NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,TRUE); + DoMethod(obj,MUIM_DoDrag,dragx,dragy,0L); + NL_RequestIDCMP(data,IDCMP_INTUITICKS); + data->markdrawnum = 0; + NL_RejectIDCMP(data,IDCMP_MOUSEMOVE,FALSE); + data->selectskiped = FALSE; + data->moves = FALSE; + REDRAW_FORCE; + } + } + } + /*D(bug("NL: mNL_HandleEvent() /after \n"));*/ + { ULONG DoNotify = ~NotNotify & data->DoNotify & data->Notify; + if (data->SETUP && DoNotify && !data->pushtrigger) + { data->pushtrigger = 1; + DoMethod(_app(obj),MUIM_Application_PushMethod,obj,1,MUIM_NList_Trigger); + } + } + + return (retval); +} + + +IPTR mNL_CreateDragImage(struct IClass *cl,Object *obj,struct MUIP_CreateDragImage *msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + IPTR retval; + if (data->DragRPort) + { _rp(obj) = data->DragRPort; + _left(obj) = 0; + _top(obj) = 0; + _width(obj) = data->DragWidth; + _height(obj) = data->DragHeight; + data->badrport = TRUE; + } + retval = DoSuperMethodA(cl,obj,(Msg) msg); + if (data->badrport) + { _left(obj) = data->left; + _top(obj) = data->top; + _width(obj) = data->width; + _height(obj) = data->height; + _rp(obj) = data->rp; + data->badrport = FALSE; + } + return (retval); +} + + +IPTR mNL_DeleteDragImage(struct IClass *cl,Object *obj,struct MUIP_DeleteDragImage *msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + IPTR retval = DoSuperMethodA(cl,obj,(Msg) msg); + + if (data->DragRPort) + DisposeDragRPort(data); + return (retval); +} + + +BOOL NL_Prop_First_Adjust(struct NLData *data) +{ + LONG lfirst,lincr; + lfirst = data->NList_Prop_First / data->vinc; + if ((data->NList_Prop_Wait == 0) && data->drawall_bits) + { + REDRAW; + } + if ((data->NList_Prop_Wait == 0) && ((lfirst * data->vinc) != data->NList_Prop_First) && (data->NList_Prop_Add != 0)) + { + LONG Notify_VSB = WANTED_NOTIFY(NTF_VSB); + + if (data->SHOW && (data->rp->Layer->Flags & LAYERREFRESH)) + return (FALSE); + NOWANT_NOTIFY(NTF_VSB); + if (data->NList_Prop_Add > 0) + { + data->NList_Prop_First += data->NList_Prop_Add; + lincr = data->NList_Prop_First % data->vinc; + if ((data->NList_Prop_First / data->vinc) > lfirst) + { lfirst++; + lincr = 0; + data->NList_Prop_First = lfirst * data->vinc; + data->NList_Prop_Add = 0; + } + } + else + { + data->NList_Prop_First += data->NList_Prop_Add; + lincr = data->NList_Prop_First % data->vinc; + if ((data->NList_Prop_First / data->vinc) < lfirst) + { lincr = 0; + data->NList_Prop_First = lfirst * data->vinc; + data->NList_Prop_Add = 0; + } + } + + data->ScrollBarsTime = SCROLLBARSTIME; + + if ((data->NList_First != lfirst) || (data->NList_First_Incr != lincr)) + { + if (data->NList_First != lfirst) + { + DO_NOTIFY(NTF_First); + } + + data->NList_First = lfirst; + data->NList_First_Incr = lincr; + REDRAW; +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + } + + if (Notify_VSB) + WANT_NOTIFY(NTF_VSB); + } + else if (data->NList_Prop_Wait > 0) + { + data->NList_Prop_Wait--; + } + else + data->NList_Prop_Add = 0; + return (FALSE); +} + + +IPTR mNL_Trigger(struct IClass *cl, UNUSED Object *obj, UNUSED Msg msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + /* attention, can be called with msg = NULL */ + if (data->SHOW && data->DRAW && !data->do_draw_all) + { + NL_Prop_First_Adjust(data); + /*do_notifies(NTF_First|NTF_Entries|NTF_MinMax);*/ + if (data->ScrollBarsTime > 0) + data->ScrollBarsTime--; + else + { + data->ScrollBarsTime = 0; + if (!data->NList_Quiet && !data->NList_Disabled) + NL_UpdateScrollers(data,FALSE); + data->ScrollBarsTime = SCROLLBARSTIME; + } + } + + if (data->SHOW && data->DRAW && !data->NList_Quiet && !data->NList_Disabled) + { data->pushtrigger = 2; + if (data->DRAW > 1) + data->DRAW = 1; + + if(data->do_draw_all || data->do_draw) + { + // JL: here it is important that we force do_draw_all = FALSE or otherwise the following + // REDRAW will result in a flickering if we have more than one NList object in a window. + data->do_draw_all = FALSE; + REDRAW; + } + } + data->pushtrigger = 0; + + if (data->SETUP && (data->DoNotify & data->Notify)) + do_notifies(NTF_All|NTF_MinMax); + + return(TRUE); +} + + diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_mcc3.c b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc3.c new file mode 100644 index 0000000000..b8d05bb7b3 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc3.c @@ -0,0 +1,1369 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <stdlib.h> + +#include <graphics/gfxmacros.h> +#undef GetOutlinePen + +#include <clib/alib_protos.h> +#include <proto/muimaster.h> +#include <proto/graphics.h> +#include <proto/layers.h> +#include <proto/intuition.h> + +#include "private.h" + +#include "NList_func.h" +#include "NListviews_mcp.h" + +void NL_SetObjInfos(struct NLData *data,BOOL setall) +{ + Object *obj = data->this; + WORD vdheight; + + if (data->do_draw_all || data->format_chge || data->do_setcols || (data->rp != _rp(obj)) || + (data->left != _left(obj)) || (data->top != _top(obj)) || (data->MinImageHeight > data->vinc) || + (data->width != _width(obj)) || (data->height != _height(obj))) + { + WORD vpos = data->vpos; + WORD mtop = data->mtop; + WORD mleft = data->mleft; + WORD mheight = data->mheight; + WORD mwidth = data->mwidth; + WORD vtop = data->vtop; + WORD vleft = data->vleft; + WORD vheight = data->vheight; + WORD vwidth = data->vwidth; + WORD vinc = data->vinc; + + data->rp = _rp(obj); + data->font = _font(obj); + data->pens = _pens(obj); + + data->left = _left(obj); + data->top = _top(obj); + data->width = _width(obj); + data->height = _height(obj); + + data->vinc = data->font->tf_YSize + data->addvinc; + if (data->NList_MinLineHeight > data->vinc) + data->vinc = data->NList_MinLineHeight; + if (data->MinImageHeight > data->vinc) + { data->vinc = data->MinImageHeight; + mheight = -1; + } + if (data->vinc < 2) + data->vinc = 2; + if ((vinc > 1) && (vinc != data->vinc)) + { DO_NOTIFY(NTF_MinMax | NTF_LineHeight); + } + + data->voff = data->font->tf_Baseline + (data->vinc - data->font->tf_YSize + 1)/2; + + if (setall) + { + struct TextExtent te; + + ReSetFont; + data->hinc = 0; + SetSoftStyle(data->rp, FSF_BOLD|FSF_ITALIC, STYLE_MASK); + TextExtent(data->rp, "m", 1, &te); + if (data->hinc < te.te_Width) + data->hinc = te.te_Width; + SetSoftStyle(data->rp, FSF_BOLD|FSF_ITALIC, STYLE_MASK); + TextExtent(data->rp, "M", 1, &te); + if (data->hinc < te.te_Width) + data->hinc = te.te_Width; + SetSoftStyle(data->rp, FSF_BOLD|FSF_ITALIC, STYLE_MASK); + TextExtent(data->rp, "w", 1, &te); + if (data->hinc < te.te_Width) + data->hinc = te.te_Width; + SetSoftStyle(data->rp, FSF_BOLD|FSF_ITALIC, STYLE_MASK); + TextExtent(data->rp, "W", 1, &te); + if (data->hinc < te.te_Width) + data->hinc = te.te_Width; + SetSoftStyle(data->rp, 0, STYLE_MASK); + TextExtent(data->rp, " ", 1, &te); + data->spacesize = te.te_Width; + + data->tabsize = data->spacesize * data->NList_TabSize; + if (data->tabsize < 4) + data->tabsize = 4; + } + if (data->NList_PartialChar) + data->NList_PartialChar = (data->hinc > 0) ? data->hinc : 10; + + data->mleft = _mleft(obj); + data->mright = _mright(obj); + data->mwidth = _mwidth(obj); + data->mtop = _mtop(obj); + data->mbottom = _mbottom(obj); + + if (data->VirtGroup) + { + Object *o = data->VirtGroup; + struct IClass *ocl; + + data->vleft = _mleft(o); + data->vright = _mright(o); + data->vtop = _mtop(o); + data->vbottom = _mbottom(o); + + data->vdx = -data->mleft; + data->vdy = -data->mtop; + + /* (mri_Flags & 0x20000000) if in a virtgroup */ + /* (mri_Flags & 0x40000000) if it is a virtgroup */ + o = data->VirtGroup2; + if(o == data->VirtGroup) + o = (Object *)xget(o, MUIA_Parent); + + while(o) + { + ocl = OCLASS(o); + + while (ocl) + { + if (ocl == data->VirtClass) + { + if (data->VirtGroup2 == data->VirtGroup) + data->VirtGroup2 = o; + + if (data->vleft < _mleft(o)) data->vleft = _mleft(o); + if (data->vright > _mright(o)) data->vright = _mright(o); + if (data->vtop < _mtop(o)) data->vtop = _mtop(o); + if (data->vbottom > _mbottom(o)) data->vbottom = _mbottom(o); + ocl = NULL; + } + else + ocl = ocl->cl_Super; + } + + if(o) + o = (Object *)xget(o, MUIA_Parent); + } + + if (data->VirtGroup2 == data->VirtGroup) + data->VirtGroup2 = NULL; + if (data->vleft < data->mleft) data->vleft = data->mleft; + if (data->vright > data->mright) data->vright = data->mright; + if (data->vtop < data->mtop) data->vtop = data->mtop; + if (data->vbottom > data->mbottom) data->vbottom = data->mbottom; + data->vwidth = data->vright - data->vleft + 1; + data->vheight = data->vbottom - data->vtop + 1; + } + else + { + data->vleft = _mleft(obj); + data->vright = _mright(obj); + data->vtop = _mtop(obj); + data->vbottom = _mbottom(obj); + data->vwidth = _mwidth(obj); + data->vheight = _mheight(obj); + data->vdx = 0; + data->vdy = 0; + } + + data->hpos = data->mleft; + data->hvisible = data->mright - data->mleft; + data->mheight = _mheight(obj); + if (data->NList_Title) + { data->mheight -= data->vinc; + if (data->NList_TitleSeparator) + data->mheight -= 2; + } + + data->lvisible = data->mheight / data->vinc; + vdheight = (data->mheight - data->lvisible * data->vinc); + + /* Set vertical delta top, if text should be centered vertically */ + if (data->NList_VerticalCenteredText) + data->vdt = vdheight / 2; + else + data->vdt = 0; + + data->vdb = vdheight - data->vdt; + data->vdtpos = data->mtop; + if (data->NList_Title) + { + data->vdtitlepos = data->vdtpos; + data->vdtitleheight = data->vdt + data->vinc; + } else + { + data->vdtitlepos = data->vdtpos + data->vdt; + data->vdtitleheight = data->vinc / 3; + } + data->vdbpos = data->mbottom + 1 - data->vdb; + + /* calculate the vertical top position of the first line of the list */ + data->vpos = data->mtop + data->vdt; + if (data->NList_Title) + { + data->vpos += data->vinc; + if (data->NList_TitleSeparator) + data->vpos += 2; + } + + data->badrport = FALSE; + data->NList_Visible = data->lvisible; + + if ((mwidth != data->mwidth)) + data->do_wwrap = data->force_wwrap = TRUE; + + if ((mwidth != data->mwidth) || data->format_chge || data->do_draw_all) + { + data->do_draw_all = data->do_draw = data->do_draw_title = data->do_updatesb = TRUE; + data->do_setcols = TRUE; + data->Title_PixLen = -1; + data->ScrollBarsPos = -2; + if (data->NList_AdjustWidth) + data->NList_AdjustWidth = -1; + NOWANT_NOTIFY(NTF_MinMaxNoDraw); + } + else + { + if (WANTED_NOTIFY(NTF_MinMaxNoDraw) && (vpos == data->vpos) && + (mtop == data->mtop) && (mleft == data->mleft) && + (vtop == data->vtop) && (vleft == data->vleft) && + (vheight == data->vheight) && (vwidth == data->vwidth)) + { + } + else if (mheight != data->mheight) + { + data->do_draw_all = data->do_draw = data->do_draw_title = data->do_updatesb = TRUE; + data->Title_PixLen = -1; + data->ScrollBarsPos = -2; + NOWANT_NOTIFY(NTF_MinMaxNoDraw); + } + } + data->drawall_bits = 0; + data->format_chge = 0; + } +} + + +static void DrawAdjustBar(struct NLData *data,WORD draw) +{ + WORD hfirst = data->NList_Horiz_AffFirst & ~1; + WORD hfirsthpos = hfirst - data->hpos; + WORD adjbar; + Object *obj = data->this; + + if (draw) + { + if ((data->adjustbar == -2) || ((data->adjustbar == -3) && (draw == 2))) + { + if (data->NList_Title && (data->adjustcolumn < data->numcols) && (data->adjustcolumn >= 0)) + { + WORD minx = (data->cols[data->adjustcolumn].c->minx - hfirsthpos); + WORD maxx = (data->cols[data->adjustcolumn].c->maxx - hfirsthpos); + WORD maxy = data->vdtitlepos + data->vdtitleheight; + BOOL draw_left = TRUE; + BOOL draw_right = TRUE; + + if (!data->NList_TitleSeparator) + maxy--; + if (data->adjustcolumn > 0) + minx -= (data->cols[data->adjustcolumn-1].c->delta - (((data->cols[data->adjustcolumn-1].c->delta-1) / 2) + 1)); + maxx += ((data->cols[data->adjustcolumn].c->delta-1) / 2); + if (data->adjustcolumn == data->numcols-1) + maxx--; + if (minx < data->mleft) + { + minx = data->mleft; + draw_left = FALSE; + } + if (maxx > data->mright) + { + maxx = data->mright; + if (IS_BAR(data->adjustcolumn,data->cols[data->adjustcolumn].c) || (maxx < (data->Title_PixLen - hfirsthpos))) + draw_right = FALSE; + } + if ((maxx - minx) >= 1) + { + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, minx, maxy); + Draw(data->rp, maxx, maxy); + if (draw_right) + Draw(data->rp, maxx, data->vdtitlepos + 1); + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, maxx, data->vdtitlepos); + Draw(data->rp, minx, data->vdtitlepos); + if (draw_left) + Draw(data->rp, minx, maxy); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + data->adjustbar_old = data->adjustbar; + data->adjustbar = -3; + } + } + } + else if ((data->adjustbar >= 0) && ((data->adjustbar_old == -1) || (draw == 2))) + { + adjbar = data->adjustbar - hfirsthpos; + if ((adjbar < data->mleft) || (adjbar >= data->mright)) + data->adjustbar_old = -1; + else + { + if (data->NList_ColWidthDrag == MUIV_NList_ColWidthDrag_Visual) + { + } + else if (data->NList_ColWidthDrag == MUIV_NList_ColWidthDrag_All) + { + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, adjbar+1, data->vdtitlepos); + Draw(data->rp, adjbar+1, data->vdbpos - 1); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, adjbar, data->vdtitlepos); + Draw(data->rp, adjbar, data->vdbpos - 1); + } + else if (data->NList_Title) + { + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, adjbar+1, data->vdtitlepos); + Draw(data->rp, adjbar+1, data->vdtitlepos + data->vdtitleheight - 1); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, adjbar, data->vdtitlepos); + Draw(data->rp, adjbar, data->vdtitlepos + data->vdtitleheight - 1); + } + else + { + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, adjbar+1, data->vpos); + Draw(data->rp, adjbar+1, data->vpos + data->vinc - 1); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, adjbar, data->vpos); + Draw(data->rp, adjbar, data->vpos + data->vinc - 1); + } + data->adjustbar_old = data->adjustbar; + } + } + } + else + { + APTR clippinghandle = NULL; + + if (data->NList_Title && (data->adjustbar_old <= -2) && ((data->adjustbar == -1) || (data->adjustbar <= -4))) + { + if ((data->adjustcolumn < data->numcols) && (data->adjustcolumn >= 0)) + { + WORD minx = (data->cols[data->adjustcolumn].c->minx - hfirsthpos); + WORD maxx = (data->cols[data->adjustcolumn].c->maxx - hfirsthpos); + + if (data->adjustcolumn > 0) + minx -= (data->cols[data->adjustcolumn-1].c->delta - (((data->cols[data->adjustcolumn-1].c->delta-1) / 2) + 1)); + maxx += ((data->cols[data->adjustcolumn].c->delta-1) / 2); + if (minx < data->mleft) + minx = data->mleft; + if (maxx > data->mright) + maxx = data->mright; + if ((maxx - minx) > 0) + { + WORD height = data->vdtitleheight; + + maxx++; + if (data->NList_TitleSeparator) + height++; + clippinghandle = MUI_AddClipping(muiRenderInfo(obj),(WORD) minx,data->vdtitlepos,(WORD) (maxx-minx),height); + DrawTitle(data,minx,maxx,hfirst); + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); + } + } + data->adjustbar_old = -1; + } + else if (data->adjustbar_old >= 0) + { + adjbar = data->adjustbar_old - hfirsthpos; + if (adjbar < data->mleft) + { + adjbar = data->mleft; + data->adjustbar_old = adjbar + hfirsthpos; + } + else if (adjbar >= data->mright) + { + adjbar = data->mright - 1; + data->adjustbar_old = adjbar + hfirsthpos; + } + if (data->NList_ColWidthDrag == MUIV_NList_ColWidthDrag_Visual) + { + } + else if (data->NList_ColWidthDrag == MUIV_NList_ColWidthDrag_All) + { + clippinghandle = MUI_AddClipping(muiRenderInfo(obj),(WORD) adjbar,data->vdtitlepos,(WORD) 2,(WORD) (data->vdbpos - data->vdtitlepos)); + DrawLines(data,data->NList_AffFirst,data->NList_AffFirst+data->NList_Visible,adjbar,adjbar+2,hfirst,0,1,TRUE,0); + if (data->NList_Title) + DrawTitle(data,adjbar,adjbar+2,hfirst); + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); + } + else if (data->NList_Title) + { + clippinghandle = MUI_AddClipping(muiRenderInfo(obj),(WORD) adjbar,data->vdtitlepos,(WORD) 2,data->vdtitleheight); + DrawTitle(data,adjbar,adjbar+2,hfirst); + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); + } + else + { + clippinghandle = MUI_AddClipping(muiRenderInfo(obj),(WORD) adjbar,data->vpos,(WORD) 2,data->vinc); + DrawLines(data,data->NList_AffFirst,data->NList_AffFirst+1,adjbar,adjbar+2,hfirst,0,1,TRUE,0); + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); + } + data->adjustbar_old = -1; + } + } +} + + +/* + * struct ClipRect *cr; + * struct RegionRectangle *rr; + * struct Region *reg; + * LONG MinX,MinY,MaxX,MaxY; + * LONG mleft,mright,mtop,mbottom; + * + * mleft = data->mleft + ((LONG) _window(obj)->LeftEdge); + * mright = data->mright + ((LONG) _window(obj)->LeftEdge); + * mtop = data->mtop + ((LONG) _window(obj)->TopEdge); + * mbottom = data->mbottom + ((LONG) _window(obj)->TopEdge); + * D(bug("%lx|Object >(%ld,%ld / %ld,%ld)\n",obj,mleft,mtop,mright,mbottom)); + * + * cr = _window(obj)->WLayer->ClipRect; + * while (cr) + * { MinX = (LONG) cr->bounds.MinX;MinY = (LONG) cr->bounds.MinY;MaxX = (LONG) cr->bounds.MaxX;MaxY = (LONG) cr->bounds.MaxY; + * D(bug("%lx|CR %ld %ld,%ld / %ld,%ld\n",obj,one_more,MinX,MinY,MaxX,MaxY)); + * one_more++;cr = cr->Next; + * } + * one_more = 0; + * + * cr = _window(obj)->WLayer->_cliprects; + * while (cr) + * { MinX = (LONG) cr->bounds.MinX;MinY = (LONG) cr->bounds.MinY;MaxX = (LONG) cr->bounds.MaxX;MaxY = (LONG) cr->bounds.MaxY; + * D(bug("%lx|_cr %ld %ld,%ld / %ld,%ld\n",obj,one_more,MinX,MinY,MaxX,MaxY)); + * one_more++;cr = cr->Next; + * } + * one_more = 0; + * + * cr = _window(obj)->WLayer->SuperClipRect; + * while (cr) + * { MinX = (LONG) cr->bounds.MinX;MinY = (LONG) cr->bounds.MinY;MaxX = (LONG) cr->bounds.MaxX;MaxY = (LONG) cr->bounds.MaxY; + * D(bug("%lx|SuperClipRect %ld>%ld,%ld / %ld,%ld\n",obj,one_more,MinX,MinY,MaxX,MaxY)); + * one_more++;cr = cr->Next; + * } + * one_more = 0; + * + * reg = _window(obj)->WLayer->ClipRegion; + * if (reg) + * { MinX = (LONG) reg->bounds.MinX;MinY = (LONG) reg->bounds.MinY;MaxX = (LONG) reg->bounds.MaxX;MaxY = (LONG) reg->bounds.MaxY; + * D(bug("%lx|ClipRegion %ld>%ld,%ld / %ld,%ld\n",obj,one_more,MinX,MinY,MaxX,MaxY)); + * one_more++;rr = reg->RegionRectangle; + * while (rr) + * { MinX = (LONG) rr->bounds.MinX;MinY = (LONG) rr->bounds.MinY;MaxX = (LONG) rr->bounds.MaxX;MaxY = (LONG) rr->bounds.MaxY; + * D(bug("%lx|ClipRegion %ld>%ld,%ld / %ld,%ld\n",obj,one_more,MinX,MinY,MaxX,MaxY)); + * one_more++;rr = rr->Next; + * } + * } + * one_more = 0; + */ + +#define LayerDamaged(l) ((l)->DamageList && (l)->DamageList->RegionRectangle) + +#define LayerCovered(l) ((!(l)->ClipRect) || ((l)->ClipRect->bounds.MaxX != (l)->bounds.MaxX) ||\ + ((l)->ClipRect->bounds.MinX != (l)->bounds.MinX) ||\ + ((l)->ClipRect->bounds.MaxY != (l)->bounds.MaxY) ||\ + ((l)->ClipRect->bounds.MinY != (l)->bounds.MinY)) + + +static ULONG DrawRefresh(struct NLData *data) +{ + Object *obj = data->this; + APTR clippinghandle = NULL; + struct RegionRectangle *rr; + struct Region *reg; + WORD sX,sY,MinX,MinY,MaxX,MaxY; + WORD mleft,mright,mtop,mbottom,mwidth,mheight; + WORD hfirst = data->NList_Horiz_AffFirst & ~1; + +/* + * if ((data->left != _left(obj)) || (data->top != _top(obj)) || + * (data->width != _width(obj)) || (data->height != _height(obj))) + * { + * LONG ml = (LONG) _mleft(obj); + * LONG mt = (LONG) _top(obj); + * D(bug("%lx|ml=%ld (%ld) mt=%ld (%ld)\n",obj,ml,data->mleft,mt,data->top)); + * NL_SetObjInfos(data,FALSE); + * } + */ + + LockLayer( 0, _window(obj)->WLayer ); + reg = _window(obj)->WLayer->DamageList; + if (reg) + { sX = reg->bounds.MinX; + sY = reg->bounds.MinY; + mleft = reg->bounds.MaxX; + mtop = reg->bounds.MaxY; + mright = sX; + mbottom = sY; + rr = reg->RegionRectangle; + while (rr) + { MinX = sX + rr->bounds.MinX; + MinY = sY + rr->bounds.MinY; + MaxX = sX + rr->bounds.MaxX; + MaxY = sY + rr->bounds.MaxY; + if ((MinX < data->mright) || (MaxX > data->mleft) || + (MinY < data->mbottom) || (MaxY > data->mtop)) + { + if (MinX < mleft) mleft = MinX; + if (MinY < mtop) mtop = MinY; + if (MaxX > mright) mright = MaxX; + if (MaxY > mbottom) mbottom = MaxY; + } + rr = rr->Next; + } + UnlockLayer( _window(obj)->WLayer ); + + if ((mleft < data->mright) || (mright > data->mleft) || + (mtop < data->mbottom) || (mbottom > data->mtop)) + { if (mleft < data->mleft) mleft = data->mleft; + if (mtop < data->mtop) mtop = data->mtop; + if (mright > data->mright) mright = data->mright; + if (mbottom > data->mbottom) mbottom = data->mbottom; + + if ((mleft <= mright) && (mtop <= mbottom)) + { + BOOL clipped = FALSE; + WORD ly1, ly2; + WORD lyl1=0; + WORD lyl2=0; + + mright++; + mbottom++; + + mwidth = mright - mleft; + mheight = mbottom - mtop; + + ly1 = (mtop - data->vpos); + ly2 = (mbottom - data->vpos); + if (ly2 > 0) + { + lyl1 = ly1 / data->vinc; + lyl2 = ly2 / data->vinc; + if (data->NList_PartialChar || + ((data->NList_First_Incr) && ((lyl1 <= 0) || (lyl2 >= data->NList_Visible)))) + { clippinghandle = MUI_AddClipping(muiRenderInfo(obj),(WORD) data->mleft,mtop,(WORD) data->mwidth,mheight); + clipped = TRUE; + } + if (lyl1 < 0) lyl1 = 0; + if (lyl2 >= data->NList_Visible) + lyl2 = data->NList_Visible - 1; + if (data->NList_First_Incr) + lyl2++; + lyl2++; + lyl1 += data->NList_First; + lyl2 += data->NList_First; + } + ReSetFont; + SetBackGround(data->NList_ListBackGround) + if ((data->vdt > 0) && !data->NList_Title && (ly1 < 0)) + DrawBackground(obj, mleft, data->vdtpos, mwidth, data->vdt, data->vdx, data->vdy); + if (data->vdb > 0) + DrawBackground(obj, mleft, data->vdbpos, mwidth, data->vdb, data->vdx, data->vdy); + if (data->NList_Title && (ly1 < 0)) + DrawTitle(data,mleft,mright,hfirst); + + + if (ly2 > 0) + DrawLines(data,lyl1,lyl2,mleft,mright,hfirst,0,1,TRUE,0); + + if (clipped) + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); + DrawAdjustBar(data,2); + SetBackGround(data->NList_ListBackGround); + } +/* + * else + * D(bug("%lx|no usable rect\n",obj)); + */ + } + } + else + UnlockLayer( _window(obj)->WLayer ); + + return(0); +} + + +IPTR mNL_Draw(struct IClass *cl,Object *obj,struct MUIP_Draw *msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + + if (data->drawsuper) + { + struct MUIP_Draw mymsg; + mymsg.MethodID = MUIM_Draw; + mymsg.flags = 0; +/*D(bug("%lx|drawsuper1 %lx %lx %lx\n",obj,msg->flags,muiAreaData(obj)->mad_Flags,muiAreaData(data->drawsuper)->mad_Flags));*/ + DoMethodA((Object *)data->drawsuper, (Msg)(void*)&mymsg); +/*D(bug("%lx|drawsuper2 %lx %lx %lx\n",obj,msg->flags,muiAreaData(obj)->mad_Flags,muiAreaData(data->drawsuper)->mad_Flags));*/ + msg->flags = 0; + return(0); + } + + if (data->nodraw || !data->SHOW) + { +/*D(bug("%lx|nodraw \n",obj));*/ + msg->flags = 0; + return(0); + } + + if (WANTED_NOTIFY(NTF_MinMaxNoDraw) && !data->do_draw_all && !data->do_draw) + { + NL_SetObjInfos(data,FALSE); + if (WANTED_NOTIFY(NTF_MinMaxNoDraw)) + { + msg->flags = 0; + return(0); + } + } + +/*D(bug("%lx|draw1=%ld\n",obj,data->DRAW));*/ + if (data->actbackground == -1) + { SetBackGround(data->NList_ListBackGround); + } + + if (data->NList_Disabled) + { data->DRAW = 1; + data->do_draw = FALSE; + data->do_draw_all = FALSE; + data->do_draw_active = FALSE; + data->do_draw_title = FALSE; + data->first_change = LONG_MAX; + data->last_change = LONG_MIN; + data->minx_change_entry = -1; + data->maxx_change_entry = -1; + if ((muiAreaData(obj)->mad_Flags & MADF_DRAWOBJECT) || + (data->NList_Disabled < 2)) + { + NL_SetObjInfos(data,FALSE); + data->NList_Disabled = 2; + DoSuperMethodA(cl,obj,(Msg)msg); + } + + return (0); + } + + if (data->DragRPort && (data->DragText || (data->DragEntry >= 0))) + { + DrawDragText(data,TRUE); + msg->flags = 0; + return (0); + } + + data->DRAW++; + + if(/*(data->refreshing != 2) && (data->DRAW > 1) &&*/ + ((data->refreshing) || + (muiRenderInfo(obj)->mri_Flags & MUIMRI_REFRESHMODE))) +// || (data->rp->Layer->Flags & LAYERREFRESH))) +// ((data->rp->Layer->Flags & LAYERREFRESH) && !(data->do_draw_all && data->do_draw)))) + { +/*D(bug("%lx|Refresh %ld %ld %ld %ld %lx %lx\n",obj,data->DRAW,data->do_draw_all,data->do_draw,(LONG)data->refreshing,(LONG)(muiRenderInfo(obj)->mri_Flags & MUIMRI_REFRESHMODE),(LONG)(data->rp->Layer->Flags & LAYERREFRESH)));*/ + /* Avoid Superclass to draw anything *in* the object */ + if (muiRenderInfo(obj)->mri_Flags & MUIMRI_REFRESHMODE) + { +#ifndef __AROS__ + muiAreaData(obj)->mad_Flags &= ~0x00000001; +#else + /* "AROS: FIXME: No frame drawn if doing: muiAreaData(obj)->mad_Flags &= ~0x00000001;" This is still valid 16.01.2012 */ +#endif + DoSuperMethodA(cl,obj,(Msg) msg); + } + DrawRefresh(data); +/* + * data->do_draw = FALSE; + * data->do_draw_all = FALSE; + * data->do_draw_active = FALSE; + * data->do_draw_title = FALSE; + * data->first_change = LONG_MAX; + * data->last_change = LONG_MIN; + * data->minx_change_entry = -1; + * data->maxx_change_entry = -1; + */ + if (data->DRAW > 1) + data->DRAW--; + return (0); + } +/* + *else if (data->refreshing) + *D(bug("%lx|Refresh rejected %ld %ld %ld %ld %lx %lx\n",obj,data->DRAW,data->do_draw_all,data->do_draw,(LONG)data->refreshing,(LONG)(muiRenderInfo(obj)->mri_Flags & MUIMRI_REFRESHMODE),(LONG)(data->rp->Layer->Flags & LAYERREFRESH))); + */ + + if (muiAreaData(obj)->mad_Flags & MADF_DRAWOBJECT) + data->do_draw_all = TRUE; + + if (NL_UpdateScrollers(data,FALSE)) + { msg->flags = 0; + if (data->DRAW > 1) + data->DRAW--; + return (0); + } + data->UpdateScrollersRedrawn = TRUE; + + + /* Avoid Superclass to draw anything *in* the object */ +#ifndef __AROS__ + muiAreaData(obj)->mad_Flags &= ~0x00000001; +#else + /* "AROS: FIXME: No frame drawn if doing: muiAreaData(obj)->mad_Flags &= ~0x00000001;" This is still valid 16.01.2012 */ +#endif + DoSuperMethodA(cl,obj,(Msg) msg); + +/*D(bug("%lx|Draw %lx %lx\n",obj,msg->flags,muiAreaData(obj)->mad_Flags));*/ + + { + LONG ent, ent2; + APTR fullclippinghandle = NULL; + APTR clippinghandle = NULL; + WORD hmax,linelen,hfirst; + LONG LPFirst,LPVisible,LPEntries; + LONG one_more = 0; +/* + * LONG vfyl,vlyl; + */ + BOOL need_refresh = FALSE; + BOOL draw_all_force; + BOOL fullclipped = FALSE; + + if (data->do_draw_all) + draw_all_force = TRUE; + else + draw_all_force = FALSE; + + if (!(msg->flags & MADF_DRAWOBJECT) && !(msg->flags & MADF_DRAWUPDATE) && !data->do_draw_all) + { if (data->DRAW > 1) + data->DRAW--; + return (0); + } + +/* + * if (muiRenderInfo(obj)->mri_Flags & MUIMRI_REFRESHMODE) + * D(bug("MUIMRI_REFRESHMODE (do_draw_all=%ld)\n",data->do_draw_all)); + */ + + ReSetFont; + + if (data->do_draw_all) + { + /*data->do_draw_all = TRUE;*/ + data->do_draw_title = TRUE; + data->drawall_bits = 0; + data->NList_First_Incr = 0; + data->minx_change_entry = -1; + data->maxx_change_entry = -1; + } + else if ((data->rp->Layer->Flags & LAYERREFRESH) || (msg->flags & MADF_DRAWOBJECT)) + { + data->do_draw_all = TRUE; + data->do_draw_title = TRUE; + data->drawall_bits = 0; + data->minx_change_entry = -1; + data->maxx_change_entry = -1; + } + + if ((data->NList_First_Incr < 0) || (data->NList_First_Incr >= data->vinc)) + data->NList_First_Incr = 0; + + LPFirst = data->NList_First * data->vinc; + LPVisible = data->lvisible * data->vinc; + LPEntries = data->NList_Entries * data->vinc; + if (LPFirst + LPVisible > LPEntries) + LPEntries = LPFirst + LPVisible; + + if (LPEntries != data->NList_Prop_Entries) + data->NList_Prop_Entries = LPEntries; + if (LPVisible != data->NList_Prop_Visible) + data->NList_Prop_Visible = LPVisible; + if (data->NList_First != data->NList_Prop_First / data->vinc) + { data->NList_Prop_First_Real = LPFirst; + data->NList_Prop_First_Prec = LPFirst; + data->NList_Prop_First = LPFirst; + } + + if (data->NList_Horiz_First >= data->NList_Horiz_Entries) + data->NList_Horiz_First = data->NList_Horiz_Entries; + else if (data->NList_Horiz_First < 0) + data->NList_Horiz_First = 0; + hfirst = data->NList_Horiz_First & ~1; + + if (!data->do_draw_all) + { if (data->markerase && (data->markerasenum >= 0)) + { if (data->markerasenum < data->first_change) + data->first_change = data->markerasenum; + if (data->markerasenum > data->last_change) + data->last_change = data->markerasenum; + } + data->last_change += 1; + if (data->first_change < data->last_change) + { if ((data->NList_First != data->NList_AffFirst) || + (data->NList_First_Incr != data->NList_AffFirst_Incr) || + (hfirst != data->NList_Horiz_AffFirst)) + { data->do_draw_all = TRUE; + data->NList_First_Incr = 0; + } + } + else if (((data->NList_First != data->NList_AffFirst) || + (data->NList_First_Incr != data->NList_AffFirst_Incr)) && + (hfirst != data->NList_Horiz_AffFirst)) + { data->do_draw_all = TRUE; + data->NList_First_Incr = 0; + data->do_draw_title = TRUE; + } + else if ((data->NList_First != data->NList_AffFirst) || (data->NList_First_Incr != data->NList_AffFirst_Incr)) + { if (data->NList_Prop_Visible < 180) + hmax = (data->NList_Visible * 7 / 8); + else if (data->NList_Prop_Visible < 360) + hmax = (data->NList_Visible * 6 / 8); + else + hmax = (data->NList_Visible * 5 / 8); + if (abs(data->NList_First - data->NList_AffFirst) > hmax) + { data->do_draw_all = TRUE; + data->NList_First_Incr = 0; + } + } + else if (hfirst != data->NList_Horiz_AffFirst) + { if (data->NList_Horiz_Visible < 180) + hmax = (data->NList_Horiz_Visible * 7 / 8); + else if (data->NList_Horiz_Visible < 360) + hmax = (data->NList_Horiz_Visible * 6 / 8); + else + hmax = (data->NList_Horiz_Visible * 5 / 8); + if (abs(hfirst - data->NList_Horiz_AffFirst) > hmax) + { data->do_draw_all = TRUE; + data->NList_First_Incr = 0; + data->do_draw_title = TRUE; + } + } + } + + if (data->do_draw_all) + { data->NList_First_Incr = 0; + data->first_change = data->NList_First; + data->last_change = data->NList_First + data->NList_Visible; + } + + if (data->NList_First_Incr) + one_more = 1; + + NL_UpdateScrollersValues(data); + +/* + * if (data->first_change < data->last_change) + * D(bug("NL: mNL_Draw(%ld to %ld) \n",data->first_change,data->last_change)); + * if (data->do_draw_all) + * D(bug("NL: mNL_Draw(do_draw_all) \n")); + * else if (data->do_draw_active) + * D(bug("NL: mNL_Draw(do_draw_active) \n")); + * else if (data->do_draw_title) + * D(bug("NL: mNL_Draw(do_draw_title) \n")); + * else if (data->NList_First != data->NList_AffFirst) + * D(bug("NL: mNL_Draw(NList_First) \n")); + * else if (hfirst != data->NList_Horiz_AffFirst) + * D(bug("NL: mNL_Draw(NList_Horiz_First) \n")); + * else + * D(bug("NL: mNL_Draw(redraw???) \n")); + */ + + if (data->NList_PartialChar) + { + fullclipped = TRUE; + fullclippinghandle = MUI_AddClipping(muiRenderInfo(obj),(WORD) data->vleft,(WORD) data->vtop, + (WORD) data->vwidth,(WORD) data->vheight); + } + + if ((data->NList_Active != data->NList_AffActive) && !data->NList_TypeSelect) + { + data->do_draw_active = TRUE; + + if (!(msg->flags & MADF_DRAWOBJECT)) + { + LONG old_one_more = 0; + BOOL clipped = FALSE; + + if(data->NList_AffFirst_Incr) + old_one_more = 1; + + ent = data->NList_AffActive; + if((ent >= data->NList_AffFirst) && (ent < data->NList_AffFirst + data->NList_Visible + old_one_more)) + { + if ((data->NList_AffFirst_Incr) && ((ent <= data->NList_AffFirst) || (ent >= data->NList_AffFirst + data->NList_Visible))) + { + clipped = TRUE; + clippinghandle = MUI_AddClipping(muiRenderInfo(obj), + (WORD) data->mleft, + (WORD) data->vpos, + (WORD) data->mwidth, + (WORD) (data->NList_Visible*data->vinc)); + } + DrawOldLine(data,ent,PMIN,PMAX,hfirst); + + if (clipped) + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); + } + } + } + + if (!data->do_draw_all && data->drawall_bits) + { + LONG tmp_hfirst = hfirst; + LONG tmp_NList_First = data->NList_First; + LONG tmp_NList_First_Incr = data->NList_First_Incr; + + hfirst = data->NList_Horiz_AffFirst & ~1; + data->NList_First = data->NList_AffFirst; + data->NList_First_Incr = data->NList_AffFirst_Incr; + hmax = DrawLines(data,data->NList_First,data->NList_First + data->NList_Visible,PMIN,PMAX,hfirst,0,0,FALSE,data->drawall_bits); + data->drawall_bits = 0; + data->drawall_dobit = 0; + hfirst = tmp_hfirst; + data->NList_First = tmp_NList_First; + data->NList_First_Incr = tmp_NList_First_Incr; + + data->ScrollBarsTime = SCROLLBARSTIME; + if (hmax > data->NList_Horiz_Entries) + data->NList_Horiz_Entries = hmax; + } + +/* + * vfyl = (data->vtop - data->vpos) / data->vinc; + * vlyl = ((data->vbottom - data->vpos) / data->vinc) + 1; + */ + + if (data->do_draw_all && data->do_draw_title && data->NList_Title/* && (vfyl <= 0)*/) + { + data->Title_PixLen = DrawTitle(data,PMIN,PMAX,hfirst); + + if(data->Title_PixLen > data->NList_Horiz_Entries) + data->NList_Horiz_Entries = data->Title_PixLen; + + data->do_draw_title = FALSE; + } +/* + * if (data->first_change < data->last_change) + * { if (vfyl > data->first_change) + * data->first_change = vfyl; + * if (vlyl < data->last_change) + * data->last_change = vlyl; + * } + */ + if (data->first_change < data->last_change) + { + WORD not_all = 0; + BOOL clipped = FALSE; + + data->drawall_bits = 0; + if(data->do_draw_all) + { + SetBackGround(data->NList_ListBackGround) + + if((data->vdt > 0) && !data->NList_Title) + DrawBackground(obj, data->mleft, data->vdtpos, data->mwidth, data->vdt, data->vdx, data->vdy); + if(data->vdb > 0) + DrawBackground(obj, data->mleft, data->vdbpos, data->mwidth, data->vdb, data->vdx, data->vdy); + + if(!data->dropping && !draw_all_force && + ((abs(data->NList_First - data->NList_AffFirst) > (120 / data->vinc)) || + (abs(hfirst - data->NList_Horiz_AffFirst) > 120))) + { + if (data->drawall_dobit == 1) + { + not_all = 2; + data->drawall_dobit = 0; + data->drawall_bits = 1; + } + else if (data->drawall_dobit == 2) + { + not_all = data->drawall_dobit = 1; + data->drawall_bits = 2; + } + } + } + else + { + if (data->first_change < data->NList_First) + data->first_change = data->NList_First; + + if (data->last_change >= data->NList_First + data->NList_Visible + one_more) + data->last_change = data->NList_First + data->NList_Visible + one_more; + } + + if ((data->NList_First_Incr) && ((data->first_change <= data->NList_First) || (data->last_change >= data->NList_First + data->NList_Visible))) + { + clipped = TRUE; + clippinghandle = MUI_AddClipping(muiRenderInfo(obj), + (WORD) data->mleft, + (WORD) data->vpos, + (WORD) data->mwidth, + (WORD) (data->NList_Visible*data->vinc)); + } + + hmax = DrawLines(data,data->first_change,data->last_change,PMIN,PMAX,hfirst,0,0,FALSE,not_all); + + if (clipped) + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); + + if (data->NList_Title && (data->Title_PixLen > hmax)) + hmax = data->Title_PixLen; + if (hfirst + data->hvisible > hmax) + hmax = hfirst + data->hvisible; + if (data->do_draw_all) + { + if ((data->drawall_bits) && (hmax != data->NList_Horiz_Entries)) + { data->NList_Horiz_Entries = hmax; + data->ScrollBarsTime = SCROLLBARSTIME; + } + else if (hmax != data->NList_Horiz_Entries) + data->NList_Horiz_Entries = hmax; + + if (data->hvisible != data->NList_Horiz_Visible) + data->NList_Horiz_Visible = data->hvisible; + } + else + { + if (hmax > data->NList_Horiz_Entries) + data->NList_Horiz_Entries = hmax; + } + + data->NList_Horiz_AffFirst = hfirst; + data->NList_AffFirst = data->NList_First; + data->NList_AffFirst_Incr = data->NList_First_Incr; + } + else if ((data->NList_First != data->NList_AffFirst) || (data->NList_First_Incr != data->NList_AffFirst_Incr)) + { + /*WORD dyl,fyl,lyl,dy,yl1,yl2,vpos;*/ + LONG dyl,fyl,lyl,dy,y1,y2,vpos,vbot; + + dyl = data->NList_First - data->NList_AffFirst; + dy = dyl*data->vinc + (data->NList_First_Incr - data->NList_AffFirst_Incr); + vpos = data->vpos; + vbot = data->vpos + (data->NList_Visible * data->vinc) - 1; + if (data->vtop > vpos) + { + vpos = data->vtop; + y1 = (vpos + data->NList_First_Incr - data->vpos); + fyl = y1 / data->vinc; + } + else + { + y1 = data->NList_First_Incr; + fyl = 0; + } + + if (data->vbottom < vbot) + { + vbot = data->vbottom; + y2 = (vbot + data->NList_First_Incr - data->vpos); + lyl = y2 / data->vinc; + } + else + { + y2 = (vbot + data->NList_First_Incr - data->vpos); + lyl = y2 / data->vinc; + } + + if (dy < 0) + { + lyl = (y1 - dy) / data->vinc; + } + else + { + fyl = (y2 - dy) / data->vinc; + } + lyl++; + fyl += data->NList_First; + lyl += data->NList_First; + + if (fyl <= lyl) + { +/* + * if ((_window(obj)->Flags & WFLG_REFRESHBITS) == WFLG_SIMPLE_REFRESH) + * WaitTOF(); + */ + ScrollVert(data,dy,LPVisible); + need_refresh = TRUE; + + if (data->NList_First_Incr || data->NList_AffFirst_Incr) + { + WORD dy2; + + if (dy < 0) + { + dy2 = -dy; + clippinghandle = MUI_AddClipping(muiRenderInfo(obj), + (WORD) data->mleft, + (WORD) vpos, + (WORD) data->mwidth, + (WORD) dy2); + } + else + { + dy2 = dy; + clippinghandle = MUI_AddClipping(muiRenderInfo(obj), + (WORD) data->mleft, + (WORD) vbot + 1 - dy2, + (WORD) data->mwidth, + (WORD) dy2); + } + DrawLines(data,fyl,lyl,PMIN,PMAX,hfirst,0,2,TRUE,0); + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); + } + else + DrawLines(data,fyl,lyl,PMIN,PMAX,hfirst,0,2,FALSE,0); + + hmax = 0; + ent2 = data->NList_First + data->NList_Visible; + if (ent2 > data->NList_Entries) + ent2 = data->NList_Entries; + ent = data->NList_First; + while (ent < ent2) + { + linelen = data->EntriesArray[ent]->PixLen; + if (linelen > hmax) + hmax = linelen; + ent++; + } + if (data->NList_Title && (data->Title_PixLen > hmax)) + hmax = data->Title_PixLen; + if (hfirst + data->hvisible > hmax) + hmax = hfirst + data->hvisible; + if (hmax != data->NList_Horiz_Entries) + data->NList_Horiz_Entries = hmax; + if (data->hvisible != data->NList_Horiz_Visible) + data->NList_Horiz_Visible = data->hvisible; + data->NList_AffFirst = data->NList_First; + data->NList_AffFirst_Incr = data->NList_First_Incr; + } + } + else if (hfirst != data->NList_Horiz_AffFirst) + { + LONG fyl,lyl; + WORD dx,fx,lx; + BOOL clipped = FALSE; + + dx = hfirst - data->NList_Horiz_AffFirst; + if (dx < 0) + { + fx = data->vleft; + lx = fx - dx; + if (lx > data->vright + 1) lx = data->vright + 1; + } + else + { + lx = data->vright + 1; + fx = lx - dx; + if (fx < data->vleft) fx = data->vleft; + } + + fyl = data->NList_First; + lyl = data->NList_First+data->NList_Visible+one_more; +/* + * if (vfyl > fyl) + * fyl = vfyl; + * if (vlyl < lyl) + * lyl = vlyl; + * if ((fyl < lyl) || ((data->vdtitlepos < data->vbottom) && ((data->vdtitlepos + data->vdtitleheight) > data->vtop))) + */ + { +/* + * if ((_window(obj)->Flags & WFLG_REFRESHBITS) == WFLG_SIMPLE_REFRESH) + * WaitTOF(); + */ + ScrollHoriz(data,dx,LPVisible); + need_refresh = TRUE; + + if (data->NList_Title) + data->Title_PixLen = DrawTitle(data,fx,lx,hfirst); + +/* if (fyl < lyl)*/ + { + if (data->NList_First_Incr) + { + clipped = TRUE; + clippinghandle = MUI_AddClipping(muiRenderInfo(obj), + (WORD) data->mleft, + (WORD) data->vpos, + (WORD) data->mwidth, + (WORD) (data->NList_Visible*data->vinc)); + } + + hmax = DrawLines(data,fyl,lyl,fx,lx,hfirst,0,1,FALSE,0); + + if (clipped) + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); + + if (data->NList_Title && (data->Title_PixLen > hmax)) + hmax = data->Title_PixLen; + if (hfirst + data->hvisible > hmax) + hmax = hfirst + data->hvisible; + if (hmax != data->NList_Horiz_Entries) + data->NList_Horiz_Entries = hmax; + if (data->hvisible != data->NList_Horiz_Visible) + data->NList_Horiz_Visible = data->hvisible; + data->NList_Horiz_AffFirst = hfirst; + } + } + } + + if (!data->NList_TypeSelect && data->do_draw_active) + { + BOOL clipped = FALSE; + + ent = data->NList_Active; + if ((ent >= data->NList_First) && (ent < data->NList_First + data->NList_Visible + one_more)/* && (vfyl <= ent) && (ent <= vlyl)*/) + { + if ((data->NList_First_Incr) && ((ent <= data->NList_First) || (ent >= data->NList_First + data->NList_Visible))) + { + clipped = TRUE; + clippinghandle = MUI_AddClipping(muiRenderInfo(obj), + (WORD) data->mleft, + (WORD) data->vpos, + (WORD) data->mwidth, + (WORD) (data->NList_Visible*data->vinc)); + } + + DrawLines(data,ent,ent+1,PMIN,PMAX,hfirst,0,0,FALSE,0); + + if (clipped) + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); + } + } + if (data->do_draw_title && data->NList_Title/* && (vfyl <= 0)*/) + { + data->Title_PixLen = DrawTitle(data,PMIN,PMAX,hfirst); + if (data->Title_PixLen > data->NList_Horiz_Entries) + data->NList_Horiz_Entries = data->Title_PixLen; + } + + if (fullclipped) + { + MUI_RemoveClipping(muiRenderInfo(obj),fullclippinghandle); + fullclipped = FALSE; + } + + if (data->markdraw) + { + LONG mdy; + + data->markerasenum = -1; + if ((data->markdrawnum >= data->NList_First) && (data->markdrawnum < data->NList_First + data->NList_Visible)) + { + mdy = data->vpos + (data->vinc * (data->markdrawnum - data->NList_First)); + DoMethod(obj,MUIM_NList_DropDraw, data->markdrawnum,data->marktype, + data->mleft,data->mright,mdy,mdy+data->vinc-1); + data->markerasenum = data->markdrawnum; + } + } + data->markdraw = FALSE; + data->markerase = FALSE; + + data->NList_AffFirst = data->NList_First; + data->NList_AffFirst_Incr = data->NList_First_Incr; + data->NList_AffActive = data->NList_Active; + + if (!data->refreshing && need_refresh && (data->rp->Layer->Flags & LAYERREFRESH)) + { + SetBackGround(data->NList_ListBackGround); + if (MUI_BeginRefresh(muiRenderInfo(obj),0)) + { + Object *o = (Object *)xget(_win(obj), MUIA_Window_RootObject); + + if(o) + { + data->refreshing = TRUE; + MUI_Redraw(o,MADF_DRAWOBJECT); /* MADF_DRAWALL */ + data->refreshing = FALSE; + MUI_EndRefresh(muiRenderInfo(obj),0); + } + } + } + DrawAdjustBar(data,0); + DrawAdjustBar(data,1); + + SetBackGround(data->NList_ListBackGround); + + data->do_draw = FALSE; + data->do_draw_all = FALSE; + data->do_draw_active = FALSE; + data->do_draw_title = FALSE; + data->first_change = LONG_MAX; + data->last_change = LONG_MIN; + data->minx_change_entry = -1; + data->maxx_change_entry = -1; + + NL_UpdateScrollersValues(data); + /*do_notifies(NTF_First|NTF_Entries|NTF_MinMax);*/ + + if (data->drawall_dobit != 1) + data->drawall_dobit = 0; + + if (data->DRAW > 1) + data->DRAW--; + else + data->DRAW = 1; + + /*if (msg->flags & MADF_DRAWOBJECT) D(bug("NL: mNL_Draw(MADF_DRAWOBJECT) /after \n"));*/ + } + + return(0); +} + + +IPTR mNL_DropDraw(struct IClass *cl,Object *obj,struct MUIP_NList_DropDraw *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + + SetABPenDrMd(data->rp,data->pens[MPEN_SHINE],data->pens[MPEN_SHADOW],JAM2); + SetDrPt(data->rp,0xF0F0); + if ((msg->type & MUIV_NList_DropType_Mask) == MUIV_NList_DropType_Above) + { Move(data->rp, msg->minx, msg->miny); + Draw(data->rp, msg->maxx, msg->miny); + } + else if ((msg->type & MUIV_NList_DropType_Mask) == MUIV_NList_DropType_Below) + { Move(data->rp, msg->minx, msg->maxy); + Draw(data->rp, msg->maxx, msg->maxy); + } + else if ((msg->type & MUIV_NList_DropType_Mask) == MUIV_NList_DropType_Onto) + { Move(data->rp, msg->minx, msg->miny); + Draw(data->rp, msg->maxx, msg->miny); + Move(data->rp, msg->minx, msg->maxy); + Draw(data->rp, msg->maxx, msg->maxy); + Move(data->rp, msg->minx, msg->miny); + Draw(data->rp, msg->minx, msg->maxy); + Move(data->rp, msg->maxx, msg->miny); + Draw(data->rp, msg->maxx, msg->maxy); + } + SetDrPt(data->rp,(UWORD)~0); + SetABPenDrMd(data->rp,data->pens[MPEN_TEXT],data->pens[MPEN_BACKGROUND],JAM1); + + return(0); +} + diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_mcc4.c b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc4.c new file mode 100644 index 0000000000..8ac5bde616 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc4.c @@ -0,0 +1,1753 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <stdlib.h> +#include <string.h> + +#include <clib/alib_protos.h> +#include <proto/exec.h> +#include <proto/intuition.h> +#include <proto/graphics.h> + +#include "private.h" + +#include "NList_func.h" + +/* DRI's draw pens */ +/* #define DETAILPEN (0x0000) // compatible Intuition rendering pens */ +/* #define BLOCKPEN (0x0001) // compatible Intuition rendering pens */ +/* #define TEXTPEN (0x0002) // text on background */ +/* #define SHINEPEN (0x0003) // bright edge on 3D objects */ +/* #define SHADOWPEN (0x0004) // dark edge on 3D objects */ +/* #define FILLPEN (0x0005) // active-window/selected-gadget fill */ +/* #define FILLTEXTPEN (0x0006) // text over FILLPEN */ +/* #define BACKGROUNDPEN (0x0007) // always color 0 */ +/* #define HIGHLIGHTTEXTPEN (0x0008) // special color text, on background */ +/* V39 only : */ +/* #define BARDETAILPEN (0x0009) // text/detail in screen-bar/menus */ +/* #define BARBLOCKPEN (0x000A) // screen-bar/menus fill */ +/* #define BARTRIMPEN (0x000B) // trim under screen-bar */ + +/* MUI's draw pens */ +/* #define MPEN_SHINE 0 */ +/* #define MPEN_HALFSHINE 1 */ +/* #define MPEN_BACKGROUND 2 */ +/* #define MPEN_HALFSHADOW 3 */ +/* #define MPEN_SHADOW 4 */ +/* #define MPEN_TEXT 5 */ +/* #define MPEN_FILL 6 */ +/* #define MPEN_MARK 7 */ +/* #define MPEN_COUNT 8 */ + + +/* + * SetABPenDrMd is V39+ !!!! + * SetABPenDrMd(data->rp,data->pens[MPEN_TEXT],data->pens[MPEN_BACKGROUND],JAM1); + * SetABPenDrMd(data->rp,_dri(obj)->dri_Pens[TEXTPEN],_dri(obj)->dri_Pens[BACKGROUNDPEN],JAM1); + * replace with for < V39: + * SetAPen(data->rp,data->pens[MPEN_SHINE]); + * SetBPen(data->rp,data->pens[MPEN_SHADOW]); + * SetDrMd(data->rp,JAM2); + */ + + +/* + * \t Tabulation. Go to the next tab boundary of the column. + * tab positions are separated by 8 spaces by default. + * ESC - Disable text engine, following chars will be printed + * without further parsing. + * ESC u Set the soft style to underline. + * ESC b Set the soft style to bold. + * ESC i Set the soft style to italic. + * ESC n Set the soft style back to normal. + * ESC <n> Use pen number n (2..9) as front pen. n must be a valid + * DrawInfo pen as specified in "intuition/screens.h". + * ESC c Center current line. only valid at the beginning. + * ESC r Right justify current line. only valid at the beginning. + * ESC l Left justify current line. only valid at the beginning. + * + * These ones are new or modified : + * + * ESC j Justify left and right current line. only at beginning. + * ESC I[<s>] (ESC I[<s>|<width>|<height>]) + * Draw MUI image with specification <s>. + * See Image.mui/MUIA_Image_Spec for image spec definition. + * <width> and <height> should be omited because NList + * draw the image to its standard size himself now. + * ESC O[<p>] Draw the MUIM_NList_CreateImage at adress <p>. + * (<p> should be an 8 hex digits number). + * ESC o[<n>] Draw the MUIM_NList_UseImage number <n>. If the <n> UseImage + * don't exist or has been set to NULL, no image is drawn. + * ESC P[] Use default front pen. + * ESC P[<n>] Use pen number <n>. (it's a direct pen number, so you must + * make MUI_ObtainPen and MUI_ReleasePen for it yourself, + * best to do it is in Setup() and Cleanup() of a subclass). + * ESC T Draw horizontal line on top of the entry for the column. + * ESC C Draw horizontal line centered in the entry for the column. + * ESC B Draw horizontal line on bottom of the entry for the column + * ESC E Draw horizontal line centered in the entry for the column, + * but only on the left and right of the line contents. + * + * + * + * "0:<x>" where <x> is between MUII_BACKGROUND and + * MUII_FILLBACK2 identifying a builtin pattern. + * + * "1:<x>" where <x> identifies a builtin standard image. + * Don't use this, use "6:<x>" instead. + * + * "2:<r>,<g>,<b>" where <r>, <g> and <b> are 32-bit RGB + * color values specified as 8-digit hex + * string (e.g. 00000000 or ffffffff). + * Kick 2.x users will get an empty image. + * + * "3:<n>" where <n> is the name of an external boopsi + * image class. + * + * "4:<n>" where <n> is the name of an external MUI brush. + * + * "5:<n>" where <n> is the name of an external picture + * file that should be loaded with datatypes. + * Kick 2.x users will get an empty image. + * + * "6:<x>" where <x> is between MUII_WindowBack and + * MUII_Count-1 identifying a preconfigured + * image/background. + */ + + +BOOL DontDoColumn(struct NLData *data,LONG ent,WORD column) +{ + if ((ent >= 0) && (ent < data->NList_Entries) && (column >= 0) && (column < data->numcols) && + (data->cols[column].c->col < 8) && + (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine) && + !(data->EntriesArray[ent]->Wrap & (1 << data->cols[column].c->col))) + return (TRUE); + else + return (FALSE); +} + + +void FreeAffInfo(struct NLData *data) +{ + if(data->aff_infos) + { + FreeVecPooled(data->Pool, data->aff_infos); + data->aff_infos = NULL; + } + data->numaff_infos = 0; +} + + +BOOL NeedAffInfo(struct NLData *data,WORD niask) +{ + struct affinfo *affinfotmp; + WORD ni; + + if (data->numaff_infos-1 < niask) + { LONG num = niask + niask/2; + if (num < 12) + num = 12; + + //D(bug( "Adding %ld aff infos.\n", num )); + + if((affinfotmp = (struct affinfo *)AllocVecPooled(data->Pool, sizeof(struct affinfo)*num)) != NULL) + { + ni = 0; + while (ni < data->numaff_infos) + { affinfotmp[ni].strptr = data->aff_infos[ni].strptr; + affinfotmp[ni].pos = data->aff_infos->pos; + affinfotmp[ni].addchar = data->aff_infos[ni].addchar; + affinfotmp[ni].addinfo = data->aff_infos[ni].addinfo; + affinfotmp[ni].pen = data->aff_infos[ni].pen; + affinfotmp[ni].len = data->aff_infos[ni].len; + affinfotmp[ni].style = data->aff_infos[ni].style; + ni++; + } + while (ni < num) + { affinfotmp[ni].strptr = NULL; + affinfotmp[ni].pos = 0; + affinfotmp[ni].addchar = 0; + affinfotmp[ni].addinfo = 0; + affinfotmp[ni].pen = 0; + affinfotmp[ni].len = 0; + affinfotmp[ni].style = 0; + ni++; + } + FreeAffInfo(data); + data->aff_infos = affinfotmp; + data->numaff_infos = num; + return (TRUE); + } + return (FALSE); + } + return (TRUE); +} + + +void NL_GetDisplayArray(struct NLData *data, SIPTR ent) +{ + char *useptr; + + ENTER(); + + if(ent >= 0 && ent < data->NList_Entries) + { + data->parse_ent = ent; + + if(data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine) + { + if(data->EntriesArray[ent]->len < -1) + { + useptr = NULL; + } + else + { + ent -= data->EntriesArray[data->parse_ent]->dnum; + + if(ent < 0 || ent >= data->NList_Entries) + ent = 0; + + useptr = (char *)data->EntriesArray[ent]->Entry; + } + } + else + { + useptr = (char *)data->EntriesArray[ent]->Entry; + } + } + else + { + useptr = (char *)data->NList_Title; + data->display_ptr = NULL; + data->parse_ent = -1; + ent = -1; + } + + if(data->display_ptr == NULL || useptr != data->display_ptr || ent != (SIPTR)data->DisplayArray[1]) + { + char **display_array = &data->DisplayArray[2]; + WORD column; + + data->display_ptr = useptr; + data->DisplayArray[1] = (char *)ent; + + // set up the string and preparses pointers + for(column = 0; column < data->numcols; column++) + { + display_array[data->cols[column].c->col] = NULL; + display_array[data->cols[column].c->col + DISPLAY_ARRAY_MAX] = NULL; + } + if(useptr != NULL) + { + display_array[0] = useptr; + + if(ent < 0 || ent >= data->NList_Entries) + useptr = NULL; + + // invoke the display method + // if this method is not catched by a subclass our own implementation will + // correctly choose one of the two possible hook functions as default + data->DisplayArray[0] = (char *)useptr; + DoMethod(data->this, MUIM_NList_Display, data->DisplayArray[0], data->DisplayArray[1], &data->DisplayArray[2], &data->DisplayArray[2+DISPLAY_ARRAY_MAX]); + } + data->parse_column = -1; + } + + LEAVE(); +} + + +void ParseColumn(struct NLData *data,WORD column,IPTR mypen) +{ + register struct colinfo *cinfo = data->cols[column].c; + register struct affinfo *afinfo; + char *ptr1,*ptr2,*ptro,*ptrs; + char **display_array = &data->DisplayArray[2]; + IPTR pen; + LONG col,ent = data->parse_ent,maxlen = 300; + WORD ni,style,do_format,prep,dx,there_is_char; + WORD tmppos = 0; + LONG numimg = 0; // RHP: Added for Special ShortHelp + int good = 1; + +/* if (data->parse_column == column) return;*/ + + data->parse_column = column; + col = NL_ColumnToCol(data,column); + + there_is_char = 0; + prep = 2; + + do_format = TRUE; + cinfo->style = 0; + + ni = 0; + afinfo = &data->aff_infos[ni]; + + pen = mypen; + style = 0; + afinfo->len = 0; + + if ((ent >= 0) && data->EntriesArray[ent]->Wrap) + { UBYTE colmask = (UBYTE) ((1 << col) & TE_Wrap_TmpMask); + if (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine) + { prep = 0; + if (data->EntriesArray[ent]->Wrap & colmask) + { tmppos = data->EntriesArray[ent]->pos; + cinfo->style = style = data->EntriesArray[ent]->style; + if (IS_FIXPEN(style)) + pen = (IPTR)data->EntriesArray[ent]->Entry; + if (data->EntriesArray[ent]->len >= 0) + maxlen = data->EntriesArray[ent]->len; + } + else + maxlen = 0; + } + else if (data->EntriesArray[ent]->Wrap & colmask) + { cinfo->style = style = data->EntriesArray[ent]->style; + if (data->EntriesArray[ent]->len >= 0) + maxlen = data->EntriesArray[ent]->len; + } + } + ptrs = ptr1 = display_array[cinfo->col]; + + while ((prep>=0) && NeedAffInfo(data,ni+1)) + { + if ((prep == 1) && !display_array[cinfo->col+DISPLAY_ARRAY_MAX]) + prep = 0; + if (prep == 2) + { ptr1 = cinfo->preparse; + ptrs = ptr1 + PREPARSE_OFFSET_COL; + + //$$$WRAPCHANGE1 + ptr2 = ptr1 + 100; + //ptr2 = ptr1 + 120; + } + else if (prep == 1) + { ptr1 = display_array[cinfo->col+DISPLAY_ARRAY_MAX]; + ptrs = ptr1 + PREPARSE_OFFSET_ENTRY; + + //$$$WRAPCHANGE1 + ptr2 = ptr1 + 100; + //ptr2 = ptr1 + 120; + } + else if ((ent >= 0) && (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine)) + { ptrs = ptr1 = display_array[cinfo->col]; + ptr1 += tmppos; + ptr2 = ptr1 + maxlen; + } + else + { ptrs = ptr1 = display_array[cinfo->col]; + ptr2 = ptr1 + maxlen; + } + + if (afinfo->len > 0) + { ni++; + afinfo = &data->aff_infos[ni]; + } + afinfo->pen = pen; + afinfo->len = 0; + afinfo->addchar = 0; + afinfo->addinfo = 0; + afinfo->button = -1; + afinfo->imgnum = -1; // RHP: Added for Special ShortHelp + afinfo->style = style; + afinfo->strptr = ptr1; + afinfo->pos = (WORD) (ptr1 - ptrs); + + //D(bug( "%ld - Setting aff info %ld: %15.15s - pos: %ld, len: %ld, style: %ld.\n", __LINE__, ni, afinfo->strptr, afinfo->pos, afinfo->len, afinfo->style )); + + while (ptr1 && (ptr1<ptr2) && (ptr1[0] != '\0') && (ptr1[0] != '\n') && (ptr1[0] != '\r') && (good = NeedAffInfo(data,ni+2))) + { + if (data->NList_SkipChars) + { char *sc = data->NList_SkipChars; + while (sc[0] && (sc[0] != ptr1[0])) + sc++; + if (sc[0]) + { + if (afinfo->len > 0) + { ni++; + afinfo = &data->aff_infos[ni]; + } + ptr1++; + afinfo->pen = pen; + afinfo->len = 0; + afinfo->addchar = 0; + afinfo->addinfo = 0; + afinfo->button = -1; + afinfo->imgnum = -1; // RHP: Added for Special ShortHelp + afinfo->style = style; + afinfo->strptr = ptr1; + afinfo->pos = (WORD) (ptr1 - ptrs); + + //D(bug( "%ld - Setting aff info %ld: %15.15s - pos: %ld, len: %ld, style: %ld.\n", __LINE__, ni, afinfo->strptr, afinfo->pos, afinfo->len, afinfo->style )); + + continue; + } + } + if (do_format && (ptr1[0] == '\033')) + { + ptro = ptr1; + ptr1++; + + //$$$WRAPADD1 + //ptr2 += 2; + + if (ptr1[0] == 'c') + { SET_ALIGN_CENTER(cinfo->style); SET_ALIGN_CENTER(style); ptr1++; } + else if (ptr1[0] == 'r') + { SET_ALIGN_RIGHT(cinfo->style); SET_ALIGN_RIGHT(style); ptr1++; } + else if (ptr1[0] == 'l') + { SET_ALIGN_LEFT(cinfo->style); SET_ALIGN_LEFT(style); ptr1++; } + else if (ptr1[0] == 'j') + { SET_ALIGN_JUSTIFY(cinfo->style); SET_ALIGN_JUSTIFY(style); ptr1++; } + else if (ptr1[0] == 'u') + { SET_STYLE_UNDERLINE(style); ptr1++; } + else if (ptr1[0] == 'b') + { SET_STYLE_BOLD(style); ptr1++; } + else if (ptr1[0] == 'i') + { SET_STYLE_ITALIC(style); ptr1++; } + else if (ptr1[0] == 'n') + { SET_STYLE_NORMAL(style); ptr1++; } + else if (ptr1[0] == '-') + { do_format = FALSE; ptr1++; } + else if (ptr1[0] == '2') + { if (data->SHOW) { pen = _dri(data->this)->dri_Pens[2]; SET_FIXPEN(style); } ptr1++; } + else if (ptr1[0] == '3') + { if (data->SHOW) { pen = _dri(data->this)->dri_Pens[3]; SET_FIXPEN(style); } ptr1++; } + else if (ptr1[0] == '4') + { if (data->SHOW) { pen = _dri(data->this)->dri_Pens[4]; SET_FIXPEN(style); } ptr1++; } + else if (ptr1[0] == '5') + { if (data->SHOW) { pen = _dri(data->this)->dri_Pens[5]; SET_FIXPEN(style); } ptr1++; } + else if (ptr1[0] == '6') + { if (data->SHOW) { pen = _dri(data->this)->dri_Pens[6]; SET_FIXPEN(style); } ptr1++; } + else if (ptr1[0] == '7') + { if (data->SHOW) { pen = _dri(data->this)->dri_Pens[7]; SET_FIXPEN(style); } ptr1++; } + else if (ptr1[0] == '8') + { if (data->SHOW) { pen = _dri(data->this)->dri_Pens[8]; SET_FIXPEN(style); } ptr1++; } + else if (ptr1[0] == '9') + { if (data->SHOW) { pen = _dri(data->this)->dri_Pens[9]; SET_FIXPEN(style); } ptr1++; } + else if (ptr1[0] == 'T') + { SET_HLINE_T(cinfo->style); SET_HLINE_T(style); ptr1++; } + else if (ptr1[0] == 'C') + { SET_HLINE_C(cinfo->style); SET_HLINE_C(style); ptr1++; } + else if (ptr1[0] == 'B') + { SET_HLINE_B(cinfo->style); SET_HLINE_B(style); ptr1++; } + else if (ptr1[0] == 'E') + { SET_HLINE_E(cinfo->style); SET_HLINE_E(style); ptr1++; } + else if (ptr1[0] == 't') + { SET_HLINE_thick(cinfo->style); + SET_HLINE_thick(style); + if (muiRenderInfo(data->this) && _pens(data->this)) + data->HLINE_thick_pen = MUIPEN(_pens(data->this)[MPEN_FILL]); + else + data->HLINE_thick_pen = 3; + ptr1++; + if (ptr1[0] == '[') + { long np = 1; + long np2 = 1; + long pnum; + if (ptr1[np] == 'N') + { SET_HLINE_nothick(cinfo->style); + SET_HLINE_nothick(style); + if (muiRenderInfo(data->this) && _pens(data->this)) + data->HLINE_thick_pen = MUIPEN(_pens(data->this)[MPEN_SHADOW]); + else + data->HLINE_thick_pen = 1; + np = np2 = 2; + } + if ((ptr1[np2] == 'M') || (ptr1[np2] == 'I')) + np++; + + while ((ptr1[np] != '\0') && (ptr1[np] != '\n') && (ptr1[np] != '\r') && (ptr1[np] != ']')) + np++; + if (ptr1[np] == ']') + { + if (np == np2) + { + } + else if (ptr1[np2] == 'M') + { + pnum = atol(&ptr1[np2+1]); + if ((pnum >= 0) && (pnum <= 8) && muiRenderInfo(data->this) && _pens(data->this)) + data->HLINE_thick_pen = MUIPEN(_pens(data->this)[pnum]); + } + else if (ptr1[np2] == 'I') + { + pnum = atol(&ptr1[np2+1]); + if ((pnum >= 0) && (pnum <= 11)) + { + if (pnum >= 9) + pnum = 2; + if ((pnum >= 0) && muiRenderInfo(data->this) && _dri(data->this) && _dri(data->this)->dri_Pens) + data->HLINE_thick_pen = _dri(data->this)->dri_Pens[pnum]; + } + } + else if (np < 8) + data->HLINE_thick_pen = atol(&ptr1[np2]); + ptr1 = &ptr1[np+1]; + + //$$$WRAPADD1 + //ptr2 += np+1; + } + } + } + else if (ptr1[0] == 'P') + { + ptr1++; + if (ptr1[0] == '[') + { + long np = 1; + + while ((ptr1[np] != '\0') && (ptr1[np] != '\n') && (ptr1[np] != '\r') && (ptr1[np] != ']')) + np++; + if (ptr1[np] == ']') + { + if (np == 1) + { + pen = mypen; + SET_NOFIXPEN(style); + } + else if (np < 8) + { + pen = atol(&ptr1[1]); + SET_FIXPEN(style); + } + ptr1 = &ptr1[np+1]; + + //$$$WRAPADD1 + //ptr2 += np+1; + } + } + } + else if (ptr1[0] == 'I') + { + ptr1++; + if (ptr1[0] == '[') + { + LONG dx = -1, dy = -1; + LONG minx = -1, button = -1; + ULONG tag=0L, tagval=0L; + size_t np = 1; + + // skip everything until we find the final closing brace + while(ptr1[np] != '\0' && ptr1[np] != ']') + np++; + + if(ptr1[np] == ']') + { + if (afinfo->len > 0) + { ni++; + afinfo = &data->aff_infos[ni]; + } + afinfo->tag = tag; + afinfo->tagval = tagval; + afinfo->button = button; + afinfo->imgnum = -1; // RHP: Added for Special ShortHelp + afinfo->addchar = 0; + afinfo->addinfo = 0; + afinfo->style = STYLE_IMAGE; + strlcpy(data->imagebuf, &ptr1[1], MIN(np, sizeof(data->imagebuf))); + afinfo->pos = (WORD) (ptro - ptrs); + D(DBF_DRAW, "image spec '%s' tag %ld, tagval %ld, button %08lx, dx %ld, dy %ld, minx %ld", data->imagebuf, tag, tagval, button, dx, dy, minx); + if (data->imagebuf[0] == '\0') + afinfo->strptr = NULL; + else + afinfo->strptr = (APTR) GetNImage(data,data->imagebuf); + if (afinfo->strptr) + { if (dx <= 0) + dx = ((struct NImgList *) afinfo->strptr)->width; + if (dy < 0) + dy = ((struct NImgList *) afinfo->strptr)->height; + } + if (dx < 0) + dx = 0; + if (dy <= 0) + dy = data->vinc; + if (minx < dx) + minx = dx; + afinfo->len = minx; + afinfo->pen = ((dy & 0x0000FFFF) << 16) + (dx & 0x0000FFFF); + + //D(bug( "%ld - Setting aff info %ld: %15.15s - pos: %ld, len: %ld, style: %ld.\n", __LINE__, ni, afinfo->strptr, afinfo->pos, afinfo->len, afinfo->style )); + + if (afinfo->strptr || (data->imagebuf[0] == '\0')) { + ptr1 = &ptr1[np+1]; + + //$$$WRAPADD1 + //ptr2 += np+1; + } + } + } + } + else if ((ptr1[0] == 'O') || (ptr1[0] == 'o')) + { + char imgtype = ptr1[0]; + ptr1++; + if (ptr1[0] == '[') + { + LONG dy,dy2 = -2; + LONG minx = -1,minx2 = -1,button = -1; + ULONG tag=0L,tagval=0L; + long np = 1; + + dx = -1; + dy = -1; + while ((ptr1[np] != '\0') && (ptr1[np] != '\n') && (ptr1[np] != '\r') && (ptr1[np] != ']') && (ptr1[np] != ';') && (ptr1[np] != '|') && (ptr1[np] != ',') && (ptr1[np] != '@')) + np++; + if (ptr1[np] == '@') + { np++; + button = atol(&ptr1[np]); + while ((ptr1[np] != '\0') && (ptr1[np] != '\n') && (ptr1[np] != '\r') && (ptr1[np] != ']') && (ptr1[np] != ';') && (ptr1[np] != '|') && (ptr1[np] != ',')) + np++; + } + while (ptr1[np] == ';') + { np++; + if (!tag) + tag = strtoul(&ptr1[np],NULL,16); + else + tagval = strtoul(&ptr1[np],NULL,16); + while ((ptr1[np] != '\0') && (ptr1[np] != '\n') && (ptr1[np] != '\r') && (ptr1[np] != ']') && (ptr1[np] != ';') && (ptr1[np] != ',')) + np++; + } + if (ptr1[np] == ',') + { np++; + minx2 = minx = atol(&ptr1[np]); + while ((ptr1[np] != '\0') && (ptr1[np] != '\n') && (ptr1[np] != '\r') && (ptr1[np] != ']') && (ptr1[np] != '|')) + np++; + } + if (ptr1[np] == '|') + { np++; + if ((ptr1[np] != '\0') && (ptr1[np] != '\n') && (ptr1[np] != '\r') && (ptr1[np] != '|') && (ptr1[np] != ']') && (ptr1[np] != ',')) + dx = atol(&ptr1[np]); + while ((ptr1[np] != '\0') && (ptr1[np] != '\n') && (ptr1[np] != '\r') && (ptr1[np] != '|') && (ptr1[np] != ']') && (ptr1[np] != ',')) + np++; + if (ptr1[np] == '|') + { np++; + if ((ptr1[np] != '\0') && (ptr1[np] != '\n') && (ptr1[np] != '\r') && (ptr1[np] != ']') && (ptr1[np] != ',')) + dy2 = dy = atol(&ptr1[np]); + while ((ptr1[np] != '\0') && (ptr1[np] != '\n') && (ptr1[np] != '\r') && (ptr1[np] != ']') && (ptr1[np] != ',')) + np++; + } + } + if (ptr1[np] == ',') + { + np++; + minx2 = minx = atol(&ptr1[np]); + while ((ptr1[np] != '\0') && (ptr1[np] != '\n') && (ptr1[np] != '\r') && (ptr1[np] != ']')) + np++; + } + if (ptr1[np] == ']') + { + struct BitMapImage *bitmapimage = NULL; + LONG dx2; + + if (imgtype == 'O') + bitmapimage = (struct BitMapImage *) strtoul(&ptr1[1],NULL,16); + else + { + numimg = atol(&ptr1[1]); // RHP: Changed for Special ShortHelp + if ((numimg >= 0) && (numimg < data->LastImage) && data->NList_UseImages) + bitmapimage = data->NList_UseImages[numimg].bmimg; + } + if (bitmapimage != NULL && (bitmapimage->control == MUIA_Image_Spec)) + { + if (afinfo->len > 0) + { + ni++; + afinfo = &data->aff_infos[ni]; + } + afinfo->tag = tag; + afinfo->tagval = tagval; + afinfo->button = button; + afinfo->imgnum = numimg; // RHP: Added for Special ShortHelp + afinfo->addchar = 0; + afinfo->addinfo = 0; + afinfo->style = STYLE_IMAGE; + afinfo->strptr = (APTR) GetNImage2(data,bitmapimage->obtainpens); + afinfo->pos = (WORD) (ptro - ptrs); + if ((afinfo->strptr) && !(((struct NImgList *) afinfo->strptr)->NImgObj)) + afinfo->strptr = NULL; + dx2 = dx; + if (afinfo->strptr) + { + if (dx <= 0) + dx = ((struct NImgList *) afinfo->strptr)->width; + if (dy < 0) + dy = ((struct NImgList *) afinfo->strptr)->height; + } + if (dx < 0) + dx = 0; + if ((dy2 != -1) && ((dy <= 0) || ((minx2 >= 0) && (dx2 == -1)))) + dy = data->vinc; + if (minx < dx) + minx = dx; + if ((dx < minx) && (minx2 >= 0) && (dx2 == -1)) + dx = minx; + afinfo->len = minx; + afinfo->pen = ((dy & 0x0000FFFF) << 16) + (dx & 0x0000FFFF); + + D(DBF_DRAW, "Setting aff info %ld: %15.15s - pos: %ld, len: %ld, style: %ld", ni, afinfo->strptr, afinfo->pos, afinfo->len, afinfo->style); + + ptr1 = &ptr1[np+1]; + + //$$$WRAPADD1 + //ptr2 += np+1; + } + else + { + if (bitmapimage == NULL || (bitmapimage->control != MUIM_NList_CreateImage)) + bitmapimage = NULL; + + if (bitmapimage != NULL || (minx > 0)) + { + if (afinfo->len > 0) + { + ni++; + afinfo = &data->aff_infos[ni]; + } + if (bitmapimage) + { + dx = bitmapimage->width; + if (dx <= 0) + dx = 1; + if ((dy > bitmapimage->height) || (dy < 0)) + dy = bitmapimage->height; + else if (dy == 0) + dy = data->vinc; + } + if (minx < dx) + minx = dx; + afinfo->len = minx; + afinfo->addchar = 0; + afinfo->addinfo = 0; + afinfo->button = -1; + afinfo->imgnum = -1; // RHP: Added for Special ShortHelp + afinfo->pen = ((dy & 0x0000FFFF) << 16) + (dx & 0x0000FFFF); + afinfo->style = STYLE_IMAGE2; + afinfo->strptr = (APTR) bitmapimage; + afinfo->pos = (WORD) (ptro - ptrs); + + //D(bug( "%ld - Setting aff info %ld: %15.15s - pos: %ld, len: %ld, style: %ld.\n", __LINE__, ni, afinfo->strptr, afinfo->pos, afinfo->len, afinfo->style )); + } + ptr1 = &ptr1[np+1]; + + //$$$WRAPADD1 + //ptr2 += np+1; + } + } + } + } + else + ptr1++; + + if (afinfo->len > 0) + { + ni++; + afinfo = &data->aff_infos[ni]; + } + afinfo->pen = pen; + afinfo->len = 0; + afinfo->addchar = 0; + afinfo->addinfo = 0; + afinfo->button = -1; + afinfo->imgnum = -1; // RHP: Added for Special ShortHelp + afinfo->style = style; + afinfo->strptr = ptr1; + afinfo->pos = (WORD) (ptr1 - ptrs); + + //D(bug( "%ld - Setting aff info %ld: %15.15s - pos: %ld, len: %ld, style: %ld.\n", __LINE__, ni, afinfo->strptr, afinfo->pos, afinfo->len, afinfo->style )); + } + else if ((ptr1[0] == '\t' && (data->NList_IgnoreSpecialChars == NULL || strchr(data->NList_IgnoreSpecialChars, '\t') == 0)) || + (((unsigned char)ptr1[0]) == 0xA0 && (data->NList_IgnoreSpecialChars == NULL || strchr(data->NList_IgnoreSpecialChars, 0xa0) == 0))) + { + there_is_char = 1; + if (afinfo->len > 0) + { ni++; + afinfo = &data->aff_infos[ni]; + } + afinfo->pen = pen; + afinfo->addchar = 0; + afinfo->addinfo = 0; + afinfo->button = -1; + afinfo->imgnum = -1; // RHP: Added for Special ShortHelp + afinfo->strptr = ptr1; + afinfo->pos = (WORD) (ptr1 - ptrs); + if (ptr1[0] == '\t') + { afinfo->style = STYLE_TAB; + afinfo->len = 1; + } + else if (((unsigned char)ptr1[0]) == 0xA0) + { afinfo->style = STYLE_FIXSPACE; + afinfo->len = data->spacesize; + } + else + { afinfo->style = STYLE_SPACE; + afinfo->len = data->spacesize; + } + + //D(bug( "%ld - Setting aff info %ld: %15.15s - pos: %ld, len: %ld, style: %ld.\n", __LINE__, ni, afinfo->strptr, afinfo->pos, afinfo->len, afinfo->style )); + + ni++; + afinfo = &data->aff_infos[ni]; + + ptr1++; + afinfo->pen = pen; + afinfo->len = 0; + afinfo->addchar = 0; + afinfo->addinfo = 0; + afinfo->button = -1; + afinfo->imgnum = -1; // RHP: Added for Special ShortHelp + afinfo->style = style; + afinfo->strptr = ptr1; + afinfo->pos = (WORD) (ptr1 - ptrs); + + //D(bug( "%ld - Setting aff info %ld: %15.15s - pos: %ld, len: %ld, style: %ld.\n", __LINE__, ni, afinfo->strptr, afinfo->pos, afinfo->len, afinfo->style )); + } + else + { there_is_char = 1; + afinfo->len += 1; + ptr1++; + } + } + prep--; + } + if (!there_is_char && IS_HLINE_E(style)) + { SET_HLINE_C(cinfo->style); SET_HLINE_C(style); } + cinfo->ninfo = ni; + if (NeedAffInfo(data,ni+1)) + { ni++; + afinfo = &data->aff_infos[ni]; + + afinfo->pen = pen; + afinfo->style = style; + afinfo->button = -1; + afinfo->imgnum = -1; // RHP: Added for Special ShortHelp + afinfo->len = 0; + afinfo->pos = (WORD) (ptr1 - ptrs); + + //D(bug( "%ld - Setting aff info %ld: %15.15s - pos: %ld, len: %ld, style: %ld.\n", __LINE__, ni, afinfo->strptr, afinfo->pos, afinfo->len, afinfo->style )); + } +} + + +static void ParseColumns(struct NLData *data,LONG ent) +{ + WORD column; + + NL_GetDisplayArray(data,ent); + for (column = 0;column < data->numcols;column++) + { if (DontDoColumn(data,ent,column)) + continue; + ParseColumn(data,column,0); + } +} + +/* + * void OneParseColumns(Object *obj,struct NLData *data,LONG ent) + * { + * if ((ent >= -1) && (ent < data->NList_Entries)) + * { + * if (!data->do_parse || data->NList_Quiet || data->NList_Disabled) + * return; + * if (data->SETUP) + * { if (data->adding_member != 2) + * data->adding_member = 1; + * } + * else + * data->adding_member = 3; + * data->parse_column = -1; + * ParseColumns(obj,data,ent); + * data->parse_column = -1; + * GetNImage_End(data); + * data->do_parse = FALSE; + * } + * } + */ + +void AllParseColumns(struct NLData *data) +{ + LONG ent; + if (!data->do_parse || data->NList_Quiet || data->NList_Disabled) + return; + if (data->SETUP) + { if (data->adding_member != 2) + data->adding_member = 1; + } + else + data->adding_member = 3; + data->do_images = TRUE; + data->display_ptr = NULL; + data->parse_column = -1; + if (data->NList_Title) + ParseColumns(data,-1); + for (ent = 0;ent < data->NList_Entries;ent++) + ParseColumns(data,ent); + data->display_ptr = NULL; + data->parse_column = -1; + GetImages(data); + data->do_parse = FALSE; +} + + +static WORD AddSpaceInfos(struct NLData *data,WORD column,WORD ni1) +{ + register struct colinfo *cinfo = data->cols[column].c; + register struct affinfo *afinfo; + WORD curlen,ni,ni2; + WORD numinfo = 0; + char *str; + + if (!data->DRAW || data->do_setcols) + return (numinfo); + + ni2 = cinfo->ninfo; + ni = ni1; afinfo = &data->aff_infos[ni]; + while ((ni <= cinfo->ninfo) && (afinfo->len > 0)) + { if (!(afinfo->style & STYLE_STRMASK)) + { str = (char *) afinfo->strptr; + curlen = 0; + while ((curlen < afinfo->len) && (str[curlen] != ' ')) + curlen++; + curlen++; + if ((curlen < afinfo->len) && NeedAffInfo(data,cinfo->ninfo+1)) + { ni2 = cinfo->ninfo++; + while (ni2 >= ni) + { data->aff_infos[ni2+1].strptr = data->aff_infos[ni2].strptr; + data->aff_infos[ni2+1].pen = data->aff_infos[ni2].pen; + data->aff_infos[ni2+1].len = data->aff_infos[ni2].len; + data->aff_infos[ni2+1].style = data->aff_infos[ni2].style; + data->aff_infos[ni2+1].pos = data->aff_infos[ni2].pos; + data->aff_infos[ni2+1].addchar = data->aff_infos[ni2].addchar; + data->aff_infos[ni2+1].addinfo = data->aff_infos[ni2].addinfo; + ni2--; + } + afinfo->len = curlen; + + ni++; afinfo = &data->aff_infos[ni]; + + afinfo->len -= curlen; + afinfo->strptr = &str[curlen]; + afinfo->pos += curlen; + numinfo++; + } + else + ni++; afinfo = &data->aff_infos[ni]; + } + else + ni++; afinfo = &data->aff_infos[ni]; + } + return (numinfo); +} + + +void WidthColumn(struct NLData *data,WORD column,WORD updinfo) +{ + register struct colinfo *cinfo = data->cols[column].c; + register struct affinfo *afinfo; + WORD curlen,ni,ni1; + WORD numchar = 0; + WORD numinfo = 0; + WORD colwidth; + struct TextExtent te; + BOOL text_last = FALSE; + BOOL is_text = FALSE; + + if (!data->SETUP) + { if (updinfo) + { cinfo->colwidthbiggest = -2; + cinfo->colwidthbiggest2 = -2; + cinfo->colwidthbiggestptr = -2; + cinfo->colwidthbiggestptr2 = -2; + if (cinfo->userwidth == -1) + data->do_setcols = TRUE; + data->do_images = TRUE; + } + return; + } + + ReSetFont; + + curlen = 0; + + ni1 = 0; + ni = 0; + afinfo = &data->aff_infos[ni]; + + while ((ni <= cinfo->ninfo) && (afinfo->len > 0)) + { numinfo++; + text_last = FALSE; + if (afinfo->style == STYLE_IMAGE) + curlen += afinfo->len + 2; + else if (afinfo->style == STYLE_IMAGE2) + curlen += afinfo->len + 2; + else if (afinfo->style == STYLE_TAB) + { curlen = ((((curlen-1) / data->tabsize) + 1) * data->tabsize) + 1; + numchar = 0; + numinfo = 0; + ni1 = ni; + } + else if ((afinfo->style == STYLE_FIXSPACE) || (afinfo->style == STYLE_SPACE)) + { curlen += afinfo->len; + numchar++; + is_text = TRUE; + } + else + { SetSoftStyle(data->rp, GET_STYLE(afinfo->style), STYLE_MASK); + TextExtent(data->rp, afinfo->strptr, afinfo->len, &te); + curlen += te.te_Width; + if ((ni == 0) && (te.te_Extent.MinX < 0)) + curlen -= te.te_Extent.MinX; + numchar += afinfo->len; + text_last = TRUE; + is_text = TRUE; + } + ni++; + afinfo = &data->aff_infos[ni]; + } + if (is_text) + { if (text_last && (te.te_Extent.MaxX > te.te_Width)) + curlen += (te.te_Extent.MaxX - te.te_Width); + curlen += 2; + cinfo->colwidth = curlen; + } + cinfo->colwidth = curlen; + SetSoftStyle(data->rp, 0, STYLE_MASK); + + if (!data->DRAW || data->do_setcols) + cinfo->xoffset = 0; + else if (IS_ALIGN_CENTER(cinfo->style)) + cinfo->xoffset = (cinfo->dx - cinfo->colwidth)/2; + else if (IS_ALIGN_RIGHT(cinfo->style)) + cinfo->xoffset = cinfo->dx - 1 - cinfo->colwidth; + else if (IS_ALIGN_JUSTIFY(cinfo->style)) + { WORD diff = cinfo->dx - 1 - cinfo->colwidth; + cinfo->xoffset = 0; + if (diff > 0) + { UBYTE addchar = 0; + UBYTE addinfo = 0; + BOOL cont = TRUE; + if ((numchar > 0) && (numinfo > 0)) + numinfo += AddSpaceInfos(data,column,ni1); + numinfo--; + while (cont) + { cont = FALSE; + if ((diff > numinfo) && (numinfo > 0)) + { addinfo++; + diff -= numinfo; + cont = TRUE; + } + if ((diff > numinfo) && (numinfo > 0)) + { addinfo++; + diff -= numinfo; + cont = TRUE; + } + if ((diff > numchar) && (numchar > 0) && (addchar < data->hinc/3) && (addchar < data->spacesize)) + { addchar++; + diff -= numchar; + cont = TRUE; + } + if ((diff > numinfo) && (numinfo > 0)) + { addinfo++; + diff -= numinfo; + cont = TRUE; + } + if ((diff > numchar) && (numchar > 0) && (addchar < data->hinc/3) && (addchar < data->spacesize)) + { addchar++; + diff -= numchar; + cont = TRUE; + } + } + if ((addchar > 0) || (addinfo > 0) || (diff > 0)) + { ni = ni1; afinfo = &data->aff_infos[ni]; + while ((ni <= cinfo->ninfo) && (afinfo->len > 0)) + { afinfo->addchar = addchar; + if (ni < cinfo->ninfo) + { afinfo->addinfo = addinfo; + if (diff > 0) + { diff--; + afinfo->addinfo++; + } + } + ni++; afinfo = &data->aff_infos[ni]; + } + } + cinfo->colwidth += (numchar * addchar) + (numinfo * addinfo); + } + } + else + cinfo->xoffset = 0; + if (cinfo->xoffset < 0) + cinfo->xoffset = 0; + colwidth = cinfo->colwidth + 2; + if ((data->parse_ent == -1) && + (((data->NList_TitleMark & MUIV_NList_TitleMark_TypeMask) != MUIV_NList_TitleMark_None) || + ((data->NList_TitleMark2 & MUIV_NList_TitleMark2_TypeMask) != MUIV_NList_TitleMark2_None))) + colwidth += 3; + + if (colwidth > cinfo->colwidthmax) + cinfo->colwidthmax = colwidth; + + if (updinfo) + { + if (updinfo == 1) + { + if ((colwidth > cinfo->colwidthbiggest) && (cinfo->colwidthbiggest >= -1)) + { cinfo->colwidthbiggest2 = cinfo->colwidthbiggest; + cinfo->colwidthbiggestptr2 = cinfo->colwidthbiggestptr; + cinfo->colwidthbiggest = colwidth; + cinfo->colwidthbiggestptr = (IPTR) data->display_ptr; + if (((cinfo->width == -1) || (cinfo->minwidth == -1)) && (cinfo->userwidth == -1)) + data->do_setcols = TRUE; + } + else if ((colwidth > cinfo->colwidthbiggest2) && (cinfo->colwidthbiggest2 >= -1)) + { cinfo->colwidthbiggest2 = colwidth; + cinfo->colwidthbiggestptr2 = (SIPTR) data->display_ptr; + } + } + else + { + if (((colwidth > cinfo->colwidthbiggest) && (cinfo->colwidthbiggest >= -1)) || + (cinfo->colwidthbiggestptr == (SIPTR) data->display_ptr)) + { + cinfo->colwidthbiggestptr = cinfo->colwidthbiggestptr2; + cinfo->colwidthbiggest = cinfo->colwidthbiggest2; + cinfo->colwidthbiggestptr2 = -2; + cinfo->colwidthbiggest2 = -2; + if (((cinfo->width == -1) || (cinfo->minwidth == -1)) && (cinfo->userwidth == -1)) + { if (cinfo->colwidthbiggest < 0) + { cinfo->colwidthbiggestptr = -2; + cinfo->colwidthbiggest = -2; + } + data->do_setcols = TRUE; + } + } + else if ((IPTR)cinfo->colwidthbiggestptr2 == (IPTR) data->display_ptr) + { + cinfo->colwidthbiggest2 = -2; + cinfo->colwidthbiggestptr2 = -2; + } + } + } +} + + +void FindCharInColumn(struct NLData *data,LONG ent,WORD column,WORD xoffset,WORD *charxoffset,WORD *charnum) +{ + register struct colinfo *cinfo = data->cols[column].c; + register struct affinfo *afinfo; + WORD curx,curx2,ni; + struct TextExtent te; + + if (DontDoColumn(data,ent,column) || !data->DRAW || data->do_setcols) + { *charnum = -1; + *charxoffset = xoffset; + return; + } + + NL_GetDisplayArray(data,ent); + ParseColumn(data,column,0); + WidthColumn(data,column,0); + + curx = cinfo->xoffset; + + ni = 0; + afinfo = &data->aff_infos[ni]; + + if (xoffset < curx) + { *charnum = -1; + *charxoffset = xoffset - curx; + return; + } + while ((ni <= cinfo->ninfo) && (afinfo->len > 0)) + { curx2 = curx; + if (afinfo->style == STYLE_IMAGE) + { curx += afinfo->len + afinfo->addinfo + 2; + if (xoffset < curx) + { *charnum = afinfo->pos; + *charxoffset = xoffset - curx2; + if (*charxoffset > afinfo->len/2) + *charxoffset = xoffset - curx; + if (data->storebutton && ((LONG)afinfo->button >= 0)) + { + data->affimage = afinfo->imgnum; // RHP: Added for Special Shorthelp + data->affbutton = afinfo->button; + data->affbuttonline = ent; + data->affbuttoncol = column; + data->affbuttonstate = 0; + data->storebutton = FALSE; + } + return; + } + } + else if (afinfo->style == STYLE_IMAGE2) + { curx += afinfo->len + afinfo->addinfo + 2; + if (xoffset < curx) + { *charnum = afinfo->pos; + *charxoffset = xoffset - curx2; + if (*charxoffset > afinfo->len/2) + *charxoffset = xoffset - curx; + if (data->storebutton && ((LONG)afinfo->button >= 0)) + { + data->affimage = afinfo->imgnum; // RHP: Added for Special Shorthelp + data->affbutton = afinfo->button; + data->affbuttonline = ent; + data->affbuttoncol = column; + data->affbuttonstate = 0; + data->storebutton = FALSE; + } + return; + } + } + else if (afinfo->style == STYLE_TAB) + { curx = ((((curx-cinfo->xoffset) / data->tabsize) + 1) * data->tabsize) + cinfo->xoffset; + if (xoffset < curx) + { *charnum = afinfo->pos; + *charxoffset = xoffset - curx2; + if (*charxoffset > curx - xoffset) + *charxoffset = xoffset - curx; + return; + } + } + else if ((afinfo->style == STYLE_FIXSPACE) || (afinfo->style == STYLE_SPACE)) + { curx += afinfo->len + afinfo->addinfo + afinfo->addchar; + if (xoffset < curx) + { *charnum = afinfo->pos; + *charxoffset = xoffset - curx2; + if (*charxoffset > afinfo->len/2) + *charxoffset = xoffset - curx; + return; + } + } + else + { SetSoftStyle(data->rp, GET_STYLE(afinfo->style), STYLE_MASK); + data->rp->TxSpacing = afinfo->addchar; + TextExtent(data->rp, afinfo->strptr, afinfo->len, &te); + curx += te.te_Width + afinfo->addinfo; + if ((ni == 0) && (te.te_Extent.MinX < 0)) + { curx -= te.te_Extent.MinX; + curx2 -= te.te_Extent.MinX; + } + if (xoffset < curx) + { WORD curx3 = curx2; + char *strptr; + WORD pos = 0; + strptr = (char *) afinfo->strptr; + while (pos < afinfo->len) + { curx2 = curx3; + TextExtent(data->rp, &strptr[pos], 1, &te); + curx3 += te.te_Width; + if (xoffset < curx3) + { *charnum = afinfo->pos + pos; + *charxoffset = xoffset - curx2; + if (*charxoffset > curx3 - xoffset) + *charxoffset = xoffset - curx3; + data->rp->TxSpacing = 0; + return; + } + pos++; + } + *charnum = afinfo->pos + pos; + *charxoffset = xoffset - curx; + data->rp->TxSpacing = 0; + return; + } + data->rp->TxSpacing = 0; + } + ni++; + afinfo = &data->aff_infos[ni]; + } + SetSoftStyle(data->rp, 0, STYLE_MASK); + *charnum = -1; + *charxoffset = xoffset - curx; +} + + +static LONG NL_DoWrapLine(struct NLData *data,LONG ent,BOOL force) +{ + register struct colinfo *cinfo; + register struct affinfo *afinfo; + struct TextExtent te; + LONG ent1 = ent,selects,column,col = 0; + WORD curlen,endpos,ni,colwidth,style; + UWORD dnum = 0; + IPTR pen; + UBYTE colmask; + + if (!data->SHOW) + return (ent+1); + + if ((ent < 0) || !data->EntriesArray[ent]->Wrap || + (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine)) + return (ent+1); + + if ((data->EntriesArray[ent]->len >= 0) && !force && (data->EntriesArray[ent1]->dnum > 0)) + { + ent += data->EntriesArray[ent1]->dnum; + return (ent); + } + + colmask = data->EntriesArray[ent]->Wrap & TE_Wrap_TmpMask; + while((colmask = colmask >> 1)) + col++; + column = NL_ColToColumn(data,col); + + if (data->EntriesArray[ent]->len < 0) + selects = data->EntriesArray[ent]->pos; + else + selects = NL_GetSelects(data,ent); + + data->EntriesArray[ent]->PixLen = -1; + data->EntriesArray[ent]->Wrap &= TE_Wrap_TmpMask; + data->EntriesArray[ent]->pos = (WORD) selects; + data->EntriesArray[ent]->len = -1; + data->EntriesArray[ent]->dnum = 1; + if (((selects & 0x0001) && data->multiselect) || ((ent == data->NList_Active) && (data->multiselect == MUIV_NList_MultiSelect_None))) + data->EntriesArray[ent]->Select = TE_Select_Line; + else + data->EntriesArray[ent]->Select = TE_Select_None; + + if ((column < 0) || (column >= data->numcols)) + return (ent+1); + + data->EntriesArray[ent]->pos = 0; + + cinfo = data->cols[column].c; + /*colwidth = cinfo->colwidth;*/ + colwidth = cinfo->dx - 4; + if (colwidth < 3*data->hinc) + colwidth = 3*data->hinc; + + colmask = data->EntriesArray[ent]->Wrap | TE_Wrap_TmpLine; + + ReSetFont; + + pen = 1; + style = data->EntriesArray[ent]->style; + + while (TRUE) + { + data->EntriesArray[ent]->len = -1; + NL_GetDisplayArray(data,ent); + ParseColumn(data,column,pen); + NL_Changed(data,ent); + ni = 0; + afinfo = &data->aff_infos[ni]; + + curlen = 0; + endpos = -1; + + while ((ni <= cinfo->ninfo) && (afinfo->len > 0)) + { + if (curlen > colwidth) + break; + if (afinfo->style == STYLE_IMAGE) + curlen += afinfo->len + 2; + else if (afinfo->style == STYLE_IMAGE2) + curlen += afinfo->len + 2; + else if (afinfo->style == STYLE_TAB) + { + pen = afinfo->pen; + curlen = ((((curlen-1) / data->tabsize) + 1) * data->tabsize) + 1; + if ((curlen > colwidth) && (ni > 0) && (ni < cinfo->ninfo)) + { + ni++; + afinfo = &data->aff_infos[ni]; + break; + } + } + else if ((afinfo->style == STYLE_FIXSPACE) || (afinfo->style == STYLE_SPACE)) + { + pen = afinfo->pen; + curlen += afinfo->len; + if ((curlen > colwidth) && (ni > 0) && (ni < cinfo->ninfo)) + { + ni++; + afinfo = &data->aff_infos[ni]; + break; + } + } + else + { + WORD clen = afinfo->len; + WORD blanklen = clen; + WORD oldcurlen,difflen; + char *strptr; + + strptr = (char *) afinfo->strptr; + pen = afinfo->pen; + style = afinfo->style; + SetSoftStyle(data->rp, GET_STYLE(style), STYLE_MASK); + TextExtent(data->rp, strptr, clen, &te); + if ((ni == 0) && (te.te_Extent.MinX < 0)) + curlen -= te.te_Extent.MinX; + oldcurlen = curlen; + curlen += te.te_Width; + if (te.te_Extent.MaxX > te.te_Width) + difflen = te.te_Extent.MaxX - te.te_Width; + else + difflen = 0; + if ((clen > 0) && ((curlen + difflen) >= colwidth)) + { + if (afinfo->pos < 0) + { + afinfo->pos = 0; + afinfo->len = 0; + break; + } + curlen += difflen; + while ((clen > 0) && (curlen >= colwidth)) + { + clen--; + while ((clen > 0) && (strptr[clen] != ' ')) + clen--; + if (clen > 0) + blanklen = clen; + else if (clen <= 0) + break; + TextExtent(data->rp, strptr, clen, &te); + if (te.te_Extent.MaxX > te.te_Width) + curlen = oldcurlen + te.te_Extent.MaxX; + else + curlen = oldcurlen + te.te_Width; + } + if ((clen <= 0) && (ni == 0) && (blanklen > 0)) + { + clen = blanklen; + TextExtent(data->rp, strptr, clen, &te); + if (te.te_Extent.MaxX > te.te_Width) + curlen = oldcurlen + te.te_Extent.MaxX; + else + curlen = oldcurlen + te.te_Width; + while ((clen > 0) && (curlen >= colwidth)) + { + clen--; + if (clen <= 0) + break; + TextExtent(data->rp, strptr, clen, &te); + if (te.te_Extent.MaxX > te.te_Width) + curlen = oldcurlen + te.te_Extent.MaxX; + else + curlen = oldcurlen + te.te_Width; + } + afinfo->pos += clen; + } + else + { + endpos = afinfo->pos + clen; + if (clen > 0) + afinfo->pos += (clen + 1); + } + break; + } + } + + if ((curlen > colwidth) && (ni > 0)) + break; + ni++; + afinfo = &data->aff_infos[ni]; + } + + if (afinfo->pos <= 0) + data->EntriesArray[ent]->len = 0; + else if (endpos >= 0) + data->EntriesArray[ent]->len = endpos - data->EntriesArray[ent]->pos; + else + data->EntriesArray[ent]->len = afinfo->pos - data->EntriesArray[ent]->pos; + + dnum++; + + if ((ni > cinfo->ninfo) || (afinfo->len <= 0) || (afinfo->pos < 0)) + { + if (IS_ALIGN_JUSTIFY(data->EntriesArray[ent]->style)) + { + SET_ALIGN_LEFT(data->EntriesArray[ent]->style); + } + ent++; + break; + } + else + ent++; + + if ((ent >= data->NList_Entries) || !(data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine)) + { + if (!NL_InsertTmpLine(data,ent)) + break; + } + + if (dnum <= 15) + selects = selects >> 1; + if (((selects & 0x0001) && data->multiselect) || ((ent == data->NList_Active) && (data->multiselect == MUIV_NList_MultiSelect_None))) + data->EntriesArray[ent]->Select = TE_Select_Line; + else + data->EntriesArray[ent]->Select = TE_Select_None; + data->EntriesArray[ent]->PixLen = -1; + data->EntriesArray[ent]->Wrap = colmask; + data->EntriesArray[ent]->pos = afinfo->pos; + data->EntriesArray[ent]->len = -2; + data->EntriesArray[ent]->style = style; + data->EntriesArray[ent]->Entry = (APTR)pen; + data->EntriesArray[ent]->dnum = dnum; + } + data->EntriesArray[ent1]->dnum = dnum; + SetSoftStyle(data->rp, 0, STYLE_MASK); + while ((ent < data->NList_Entries) && (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine)) + NL_DeleteTmpLine(data,ent); + + return (ent); +} + + +void NL_DoWrapAll(struct NLData *data,BOOL force,BOOL update) +{ + LONG entorig = data->NList_Entries; + LONG ent = 0; + + if (!data->do_wwrap || !data->EntriesArray || data->do_setcols) + return; + else if (!data->SHOW || !data->DRAW || data->NList_Quiet || data->NList_Disabled) + { + LONG len = -1; + + while (ent < data->NList_Entries) + { + if (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine) + { + if (len < 0) + data->EntriesArray[ent]->len = -2; + } + else if (data->EntriesArray[ent]->Wrap) + len = data->EntriesArray[ent]->len; + else + len = 0; + ent++; + } + return; + } + else if (!data->DRAW) + return; + + if (data->force_wwrap) + force = TRUE; + + while (ent < data->NList_Entries) + { + if (data->EntriesArray[ent]->Wrap & TE_Wrap_TmpLine) + { + NL_DeleteTmpLine(data,ent); + NL_SegChanged(data,ent,data->NList_Entries); + data->do_draw = TRUE; + } + else if (data->EntriesArray[ent]->Wrap) + { + if ((data->EntriesArray[ent]->len < 0) || force || (data->EntriesArray[ent]->dnum < 1)) + { + ent = NL_DoWrapLine(data,ent,force); + if (data->NList_Entries != entorig) + NL_SegChanged(data,ent,data->NList_Entries); + data->do_draw = TRUE; + } + else + ent += data->EntriesArray[ent]->dnum; + } + else + ent++; + } + if (data->NList_Entries != entorig) + { + data->do_updatesb = TRUE; + DO_NOTIFY(NTF_Entries|NTF_MinMax); + } + if ((data->NList_First > 0) && (data->NList_First + data->NList_Visible >= data->NList_Entries)) + { + data->NList_First = data->NList_Entries - data->NList_Visible; + if (data->NList_First < 0) + data->NList_First = 0; + DO_NOTIFY(NTF_First); + } + data->do_wwrap = data->force_wwrap = FALSE; + if (update) + { + data->do_updatesb = TRUE; + REDRAW; +/* do_notifies(NTF_AllChanges|NTF_MinMax);*/ + } +} + + +static void WidthColumns(struct NLData *data,LONG ent,WORD updinfo) +{ + WORD column; + +//D(bug( "%ld - Calling NL_GDA() width %ld entries!\n", __LINE__, ent )); + + /* sba: was > 1 but in this case the images weren't parsed */ + if ( data->numcols > 0 ) + { + NL_GetDisplayArray(data,ent); + + for (column = 0;column < data->numcols;column++) /* sba: was (data->numcols-1) */ + { if (DontDoColumn(data,ent,column)) + continue; + if (updinfo != 2) + ParseColumn(data,column,0); + if (data->SHOW) + WidthColumn(data,column,updinfo); + } + } +} + + +void AllWidthColumns(struct NLData *data) +{ + LONG ent; + WORD column; + + /* + ** We must omit this, because floattext will be broken if not. + */ + //if ( data->numcols > 1 ) + { + data->display_ptr = NULL; + data->parse_column = -1; + for (column = 0;column < data->numcols;column++) + //for (column = 0;column < ( data->numcols - 1 );column++) + { data->cols[column].c->colwidthmax = 4; + data->cols[column].c->dx = 4; + } + if (data->NList_Title) + WidthColumns(data,-1,0); + if (data->EntriesArray) + { for (ent = 0;ent < data->NList_Entries;ent++) + WidthColumns(data,ent,0); + } + data->display_ptr = NULL; + data->parse_column = -1; + } +} + + +void NL_SetColsAdd(struct NLData *data,LONG ent,WORD addimages) +{ + WORD column; + + //if ( !data->NList_Pause ) + { + if (data->SETUP) + { if (data->adding_member != 2) + data->adding_member = 1; + } + else + data->adding_member = 3; + + data->display_ptr = NULL; + data->parse_column = -1; + if ((ent == -2) || (ent == -3)) + { for (column = 0;column < data->numcols;column++) + { data->cols[column].c->colwidthbiggest = -1; + data->cols[column].c->colwidthbiggest2 = -1; + data->cols[column].c->colwidthbiggestptr = -2; + data->cols[column].c->colwidthbiggestptr2 = -2; + data->cols[column].c->colwidthmax = 4; + data->cols[column].c->dx = 4; + data->Title_PixLen = -1; + if (((data->cols[column].c->width == -1) || (data->cols[column].c->minwidth == -1)) && (data->cols[column].c->userwidth == -1)) + data->do_setcols = TRUE; + } + + if (data->NList_Title) + WidthColumns(data,-1,1); + + if (data->EntriesArray) + { + if (ent == -2 ) + { + for (ent = 0;ent < data->NList_Entries;ent++) + WidthColumns(data,ent,1); + } + else /* -3 == Recalculate only visible (cs@aphaso.de) */ + { + for (ent = data->NList_First; ent < ( data->NList_First + data->NList_Visible ); ent++ ) + WidthColumns(data,ent,1); + } + } + data->display_ptr = NULL; + data->parse_column = -1; + } + else + { + //D(bug( "%ld - Calling WidthColumns() width entry %ld!\n", __LINE__, ent )); + if (data->SETUP != 3) + WidthColumns(data,ent,1); + } + + if (addimages) + GetNImage_End(data); + else + data->do_images = TRUE; + if (!data->SHOW) + data->do_setcols = TRUE; + } +} + + +void NL_SetColsRem(struct NLData *data,LONG ent) +{ + WORD column; + + //if ( !data->NList_Pause ) + { + if (!data->SHOW || (ent == -2)) + { data->parse_column = -1; + data->display_ptr = NULL; + for (column = 0;column < data->numcols;column++) + { data->cols[column].c->colwidthbiggest = -1; + data->cols[column].c->colwidthbiggest2 = -1; + data->cols[column].c->colwidthbiggestptr = -2; + data->cols[column].c->colwidthbiggestptr2 = -2; + data->cols[column].c->colwidthmax = 4; + data->cols[column].c->dx = 4; + data->Title_PixLen = -1; + if (((data->cols[column].c->width == -1) || (data->cols[column].c->minwidth == -1)) && (data->cols[column].c->userwidth == -1)) + data->do_setcols = TRUE; + } + if (!data->SHOW) + data->do_setcols = TRUE; + } + else + { + //D(bug( "%ld - Calling WidthColumns() width entry %ld!\n", __LINE__, ent )); + + if (data->SETUP != 3) + WidthColumns(data,ent,2); + + if (ent == -1) + data->Title_PixLen = -1; + } + } +} + + diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_mcc5.c b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc5.c new file mode 100644 index 0000000000..c379294115 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc5.c @@ -0,0 +1,1436 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <graphics/gfxmacros.h> +#undef GetOutlinePen + +#include <dos/dosextens.h> + +#include <libraries/gadtools.h> +#include <clib/alib_protos.h> +#include <proto/muimaster.h> +#include <proto/graphics.h> +#include <proto/layers.h> +#include <proto/intuition.h> + +#include "private.h" + +#include "NList_func.h" +#include "NListview_mcc.h" + +/*#define DO_CLIPBLIT TRUE*/ + +static struct NewMenu MenuData[] = +{ + { NM_TITLE, (STRPTR)"Column", 0 ,0 ,0 ,(APTR) MUIV_NList_ContextMenu_Never }, + { NM_ITEM, (STRPTR)"Default Width: this", 0 ,0 ,0 ,(APTR) MUIV_NList_Menu_DefWidth_This }, + { NM_ITEM, (STRPTR)"Default Width: all", 0 ,0 ,0 ,(APTR) MUIV_NList_Menu_DefWidth_All }, + { NM_ITEM, (STRPTR)"Default Order: this", 0 ,0 ,0 ,(APTR) MUIV_NList_Menu_DefOrder_This }, + { NM_ITEM, (STRPTR)"Default Order: all", 0 ,0 ,0 ,(APTR) MUIV_NList_Menu_DefOrder_All }, + + { NM_END,NULL,0,0,0,(APTR)0 }, +}; + + +void NL_SetCols(struct NLData *data) +{ + if (data->do_setcols) + { + if (data->cols) + { + LONG column; + LONG weight,weight_all,weight_num,width,width_all,colx,minwidth,maxwidth,mincolwidth,maxcolwidth; + BOOL do_colwidthmax = FALSE; + + weight_num = 0; + weight_all = 0; + width_all = data->mwidth; + column = 0; + while (column < data->numcols) + { + if (data->cols[column].c->userwidth >= 0) + width_all -= data->cols[column].c->userwidth; + else if (data->cols[column].c->width_type == CI_PIX) + width_all -= data->cols[column].c->width; + else if (data->cols[column].c->width_type == CI_COL) + width_all -= data->cols[column].c->width * data->hinc +1; + else if (data->cols[column].c->width == -1) + { if (!do_colwidthmax) + { if (data->cols[column].c->colwidthbiggestptr == -2) + { + NL_SetColsAdd(data,-2,TRUE); + do_colwidthmax = TRUE; + } + else + { data->cols[column].c->colwidthmax = data->cols[column].c->colwidthbiggest; + } + } + width_all -= data->cols[column].c->colwidthmax; + } + else + { weight_all += data->cols[column].c->width; + weight_num++; + } + if (column < data->numcols-1) + width_all -= data->cols[column].c->delta; + column++; + } + if (weight_all <= (column*5)) + weight_all = (column*5)+1; + colx = 0; + column = 0; + while (column < data->numcols) + { weight = (LONG) data->cols[column].c->width; + if (data->cols[column].c->userwidth >= 0) + width = data->cols[column].c->userwidth; + else if (data->cols[column].c->width_type == CI_PIX) + width = weight; + else if (data->cols[column].c->width_type == CI_COL) + width = weight * data->hinc; + else if (weight == -1) + width = data->cols[column].c->colwidthmax; + else + { + width = (weight * width_all) / weight_all; + minwidth = (LONG) data->cols[column].c->minwidth; + if (minwidth == -1) + { if (!do_colwidthmax && (data->cols[column].c->colwidthbiggestptr == -2)) + { + NL_SetColsAdd(data,-2,TRUE); + do_colwidthmax = TRUE; + } + minwidth = data->cols[column].c->colwidthmax; + } + else + minwidth = (minwidth * ((LONG) data->mwidth)) / 100L; + maxwidth = (LONG) data->cols[column].c->maxwidth; + maxwidth = (maxwidth * ((LONG) data->mwidth)) / 100L; + + mincolwidth = (LONG) data->cols[column].c->mincolwidth; + mincolwidth = mincolwidth * ((LONG) data->hinc) + 1; + maxcolwidth = (LONG) data->cols[column].c->maxcolwidth; + maxcolwidth = maxcolwidth * ((LONG) data->hinc) + 1; + + if (mincolwidth > minwidth) + minwidth = mincolwidth; + if (data->cols[column].c->minpixwidth > minwidth) + minwidth = data->cols[column].c->minpixwidth; + + if (maxcolwidth < maxwidth) + maxwidth = maxcolwidth; + if (data->cols[column].c->maxpixwidth < maxwidth) + maxwidth = data->cols[column].c->maxpixwidth; + + if ((maxwidth > 10) && (width > maxwidth)) + width = maxwidth; + + if (width < minwidth) + width = minwidth; + + if (width < 6) + width = 6; + + width_all -= width; + weight_all -= data->cols[column].c->width; + if (weight_all < 10) + weight_all = 10; + } + if (data->cols[column].c->dx != (WORD) width) + { data->do_wwrap = data->force_wwrap = data->do_draw_all = TRUE; + data->cols[column].c->dx = (WORD) width; + if (data->NList_TypeSelect) + UnSelectCharSel(data,FALSE); + } + if (data->cols[column].c->minx != (WORD) colx) + { data->do_wwrap = data->force_wwrap = data->do_draw_all = TRUE; + data->cols[column].c->minx = (WORD) colx; + if (data->NList_TypeSelect) + UnSelectCharSel(data,FALSE); + } + colx += width; + if (data->cols[column].c->maxx != (WORD) colx) + { if (column < data->numcols-1) + { data->do_wwrap = data->force_wwrap = data->do_draw_all = TRUE; + } + data->cols[column].c->maxx = (WORD) colx; + } + if (column < data->numcols-1) + colx += data->cols[column].c->delta; + else if (data->cols[column].c->userwidth >= 0) + { LONG ent = 0; + while (data->EntriesArray && (ent < data->NList_Entries)) + { data->EntriesArray[ent]->PixLen = -1; + ent++; + } + } + if (!IS_BAR(column,data->cols[column].c)) + data->cols[column].c->maxx = MUI_MAXMAX; + column++; + } + } + data->do_setcols = FALSE; + } +} + + + +LONG NL_DoNotifies(struct NLData *data,LONG which) +{ + if (data->NList_Quiet || data->NList_Disabled) + return (TRUE); + + /* notify ButtonClick */ + if(NEED_NOTIFY(NTF_ButtonClick) & which) + { + DONE_NOTIFY(NTF_ButtonClick); + notdoset(data->this,MUIA_NList_ButtonClick,data->NList_ButtonClick); + } + + /* notify TitleClick */ + if(NEED_NOTIFY(NTF_TitleClick) & which) + { + DONE_NOTIFY(NTF_TitleClick); + notdoset(data->this,MUIA_NList_TitleClick,data->TitleClick); + } + + /* notify TitleClick2 */ + if(NEED_NOTIFY(NTF_TitleClick2) & which) + { + DONE_NOTIFY(NTF_TitleClick2); + notdoset(data->this,MUIA_NList_TitleClick2,data->TitleClick2); + } + + /* notify EntryClick */ + if(NEED_NOTIFY(NTF_EntryClick) & which) + { + DONE_NOTIFY(NTF_EntryClick); + notdoset(data->this,MUIA_NList_EntryClick,data->click_line); + } + + /* notify Doubleclick */ + if(NEED_NOTIFY(NTF_Doubleclick) & which) + { + DONE_NOTIFY(NTF_Doubleclick); + notdoset(data->this,MUIA_NList_DoubleClick,data->click_line); + } + + if(NEED_NOTIFY(NTF_LV_Doubleclick) & which) + { + DONE_NOTIFY(NTF_LV_Doubleclick); + if(data->listviewobj != NULL) + DoMethod(data->listviewobj, MUIM_Set, MUIA_Listview_DoubleClick, (LONG)TRUE); + else + set(data->this,MUIA_Listview_DoubleClick,(LONG) TRUE); + } + + /* notify Multiclick */ + if(NEED_NOTIFY(NTF_Multiclick) & which) + { + DONE_NOTIFY(NTF_Multiclick); + notdoset(data->this,MUIA_NList_MultiClick,data->multiclick + 1); + } + + /* notify Multiclick */ + if(NEED_NOTIFY(NTF_MulticlickAlone) & which) + { + DONE_NOTIFY(NTF_MulticlickAlone); + if (data->multiclickalone > 0) + data->multiclickalone = -data->multiclickalone; + notdoset(data->this,MUIA_NList_MultiClickAlone,-data->multiclickalone); + } + + /* notify_Active */ + if(NEED_NOTIFY(NTF_Active) & which) + { + DONE_NOTIFY(NTF_Active); + NOTIFY_START(NTF_Active); + notdoset(data->this,MUIA_NList_Active,data->NList_Active); + NOTIFY_END(NTF_Active); + } + if(NEED_NOTIFY(NTF_L_Active) & which) + { + DONE_NOTIFY(NTF_L_Active); + NOTIFY_START(NTF_L_Active); + notdoset(data->this,MUIA_List_Active,data->NList_Active); + NOTIFY_END(NTF_L_Active); + } + + /* notify_Select */ + if(NEED_NOTIFY(NTF_Select) & which) + { + DONE_NOTIFY(NTF_Select); + set(data->this,MUIA_NList_SelectChange,(LONG) TRUE); + } + + if(NEED_NOTIFY(NTF_LV_Select) & which) + { + DONE_NOTIFY(NTF_LV_Select); + if(data->listviewobj != NULL) + DoMethod(data->listviewobj, MUIM_Set, MUIA_Listview_SelectChange, (LONG)TRUE); + else + set(data->this,MUIA_Listview_SelectChange,(LONG) TRUE); + } + + /* notify first */ + if(NEED_NOTIFY(NTF_First) & which) + { + DONE_NOTIFY(NTF_First); + notdoset(data->this,MUIA_NList_First,data->NList_First); + } + + /* notify entries */ + if(NEED_NOTIFY(NTF_Entries) & which) + { + DONE_NOTIFY(NTF_Entries); + notdoset(data->this,MUIA_NList_Entries,data->NList_Entries); + notdoset(data->this,MUIA_List_Entries,data->NList_Entries); + } + + /* notify LineHeight */ + if(NEED_NOTIFY(NTF_LineHeight) & which) + { + DONE_NOTIFY(NTF_LineHeight); + notdoset(data->this,MUIA_NList_LineHeight,data->vinc); + } + + /* notify NTF_DragSortInsert */ + if(NEED_NOTIFY(NTF_DragSortInsert) & which) + { + DONE_NOTIFY(NTF_Insert|NTF_DragSortInsert); + notdoset(data->this,MUIA_NList_DragSortInsert,data->vinc); + } + + /* notify Insert */ + if(NEED_NOTIFY(NTF_Insert) & which) + { + DONE_NOTIFY(NTF_Insert); + notdoset(data->this,MUIA_NList_InsertPosition,data->vinc); + } + + /* notify minmax */ + if(!data->do_wwrap && !data->force_wwrap && + (ASKED_NOTIFY(NTF_MinMax) & which)) + { + DONE_NOTIFY(NTF_MinMax); + ForceMinMax; + } + + /* notify columns */ + if(NEED_NOTIFY(NTF_Columns) & which) + { + DONE_NOTIFY(NTF_Columns); + notdoset(data->this,MUIA_NList_Columns,(IPTR) NL_Columns(data,NULL)); + } + + return (TRUE); +} + + +void NL_UpdateScrollersValues(struct NLData *data) +{ + Object *obj = data->this; + + if (((data->NList_Quiet > 0) || data->NList_Disabled) && !data->do_draw_all) + return; + if (WANTED_NOTIFY(NTF_VSB)) + { + LONG entries = data->NList_Prop_First + data->NList_Prop_Visible; + + if (entries < data->NList_Prop_Entries) + entries = data->NList_Prop_Entries; + if (entries != data->old_prop_entries) + set(obj, MUIA_NList_Prop_Entries,entries); + if (data->NList_Prop_Visible != data->old_prop_visible) + set(obj, MUIA_NList_Prop_Visible,data->NList_Prop_Visible); + if (data->NList_Prop_First != data->old_prop_first) + set(obj, MUIA_NList_Prop_First,data->NList_Prop_First); + if (data->vinc != data->old_prop_delta) + set(obj, MUIA_NList_VertDeltaFactor,data->vinc); + } + if (WANTED_NOTIFY(NTF_HSB)) + { + if (data->NList_Horiz_Entries != data->old_horiz_entries) + set(obj, MUIA_NList_Horiz_Entries,data->NList_Horiz_Entries); + if (data->NList_Horiz_Visible != data->old_horiz_visible) + set(obj, MUIA_NList_Horiz_Visible,data->NList_Horiz_Visible); + if (data->NList_Horiz_First != data->old_horiz_first) + notdoset(obj, MUIA_NList_Horiz_First,data->NList_Horiz_First); + if (data->hinc != data->old_horiz_delta) + set(obj, MUIA_NList_HorizDeltaFactor,data->hinc); + } +} + + +ULONG NL_UpdateScrollers(struct NLData *data,BOOL force) +{ + if (!data->SHOW || !data->DRAW) + return (FALSE); + + if (data->UpdatingScrollbars) + { + BOOL lastact = (data->NList_Active == (data->NList_First + data->NList_Visible - 1)); + + NL_SetObjInfos(data,TRUE); + data->NList_Prop_Visible = data->lvisible * data->vinc; + data->NList_Horiz_Visible = data->mright - data->mleft; + data->NList_Prop_Entries = data->NList_Entries * data->vinc; + if (lastact && (data->NList_Active == (data->NList_First + data->NList_Visible))) + data->NList_First++; + NL_SetCols(data); + NL_DoWrapAll(data,FALSE,FALSE); + NL_UpdateScrollersValues(data); + return (FALSE); + } + + if (data->do_draw_all || data->do_parse || data->do_images || data->do_setcols || data->do_updatesb || data->format_chge) + force = TRUE; + if (data->ScrollBarsTime <= 0) + { data->do_updatesb = TRUE; + data->ScrollBarsTime = SCROLLBARSTIME; + } + + if (!data->do_draw_all && !data->do_updatesb && !force && (data->NList_Quiet || data->NList_Disabled)) + { + data->ScrollBarsTime = SCROLLBARSTIME; + return (FALSE); + } + + NL_SetObjInfos(data,TRUE); + if (data->do_images) + { + GetImages(data); + GetNImage_Sizes(data); + } + if (data->do_parse) + { + AllParseColumns(data); + GetNImage_Sizes(data); + } + + NL_SetCols(data); + NL_DoWrapAll(data,FALSE,FALSE); + + if (data->do_draw_all || force) + { + LONG ent,ent2,hmax,linelen,hfirst; + + data->NList_Prop_Visible = data->lvisible * data->vinc; + data->NList_Horiz_Visible = data->mright - data->mleft; + data->NList_Prop_Entries = data->NList_Entries * data->vinc; + hmax = 0; + hfirst = data->NList_Horiz_First & ~1; + ent = data->NList_First; + ent2 = data->NList_First + data->NList_Visible; + if (ent2 > data->NList_Entries) + ent2 = data->NList_Entries; + while (data->EntriesArray && (ent < ent2)) + { + linelen = data->EntriesArray[ent]->PixLen; + if (((linelen < 1) || data->do_draw_all) && (data->numcols > 0) && !DontDoColumn(data,ent,data->numcols-1)) + { + data->display_ptr = NULL; + data->parse_column = -1; + if (data->cols[data->numcols-1].c->userwidth > 0) + linelen = data->cols[data->numcols-1].c->userwidth + data->cols[data->numcols-1].c->minx - 1; + else + { + NL_GetDisplayArray(data,ent); + ParseColumn(data,data->numcols-1,0); + WidthColumn(data,data->numcols-1,0); + linelen = data->cols[data->numcols-1].c->colwidth + data->cols[data->numcols-1].c->minx + data->cols[data->numcols-1].c->xoffset; + if (IS_ALIGN_CENTER(data->cols[data->numcols-1].c->style) && (data->cols[data->numcols-1].c->dx > data->cols[data->numcols-1].c->colwidth)) + linelen = data->cols[data->numcols-1].c->minx + data->cols[data->numcols-1].c->dx - 1; + data->display_ptr = NULL; + data->parse_column = -1; + } + data->EntriesArray[ent]->PixLen = linelen; + } + if (linelen > hmax) + hmax = linelen; + ent++; + } + if (data->NList_Title) + { + if ((data->Title_PixLen < 0) || data->do_draw_all) + { + data->do_draw_title = TRUE; + data->display_ptr = NULL; + data->parse_column = -1; + if (data->cols[data->numcols-1].c->userwidth > 0) + data->Title_PixLen = data->cols[data->numcols-1].c->userwidth + data->cols[data->numcols-1].c->minx - 1; + else + { + NL_GetDisplayArray(data,-1); + ParseColumn(data,data->numcols-1,0); + WidthColumn(data,data->numcols-1,0); + data->Title_PixLen = data->cols[data->numcols-1].c->colwidth + data->cols[data->numcols-1].c->minx + data->cols[data->numcols-1].c->xoffset; + if (IS_ALIGN_CENTER(data->cols[data->numcols-1].c->style) && (data->cols[data->numcols-1].c->dx > data->cols[data->numcols-1].c->colwidth)) + data->Title_PixLen = data->cols[data->numcols-1].minx + data->cols[data->numcols-1].dx - 1; + data->display_ptr = NULL; + data->parse_column = -1; + } + } + if (data->Title_PixLen > hmax) + hmax = data->Title_PixLen; + } + if (hfirst + data->hvisible > hmax) + hmax = hfirst + data->hvisible; + data->NList_Horiz_Entries = hmax; + NL_UpdateScrollersValues(data); + } + + data->ScrollBarsTime = SCROLLBARSTIME; + if (data->do_updatesb && (data->NList_Quiet <= 0) && !data->NList_Disabled && WANTED_NOTIFY(NTF_SB)) + { + data->do_updatesb = FALSE; + data->ScrollBars = (data->ScrollBarsOld & ~MUIV_NListview_HSB_On) | MUIV_NListview_HSB_Off; + + if (data->ScrollBarsPos != data->NList_First) + data->ScrollBars = MUIV_NListview_HSB_Off | MUIV_NListview_VSB_Off; + + if ((data->NList_Prop_Entries > data->NList_Prop_Visible) || (data->NList_First > 0)) + data->ScrollBars |= MUIV_NListview_VSB_On; + + if (data->NList_Horiz_Entries > data->NList_Horiz_Visible) + data->ScrollBars |= MUIV_NListview_HSB_On; + else + { + LONG ent = data->NList_First + data->NList_Visible; + + if ((ent < data->NList_Entries) && data->EntriesArray && + ((data->ScrollBarsOld & MUIV_NListview_HSB_On) == MUIV_NListview_HSB_On)) + { + LONG hsb,lastent,hsbheight,vsbwidth=0; + + // check if we got a HSB_Height attribute + if(data->scrollersobj && GetAttr(MUIA_NListview_HSB_Height, data->scrollersobj, (IPTR *)&hsbheight) != FALSE) + { + hsbheight += data->vdt + data->vdb; + lastent = ent + (hsbheight / data->vinc) + 1; + } + else + lastent = ent+1; + + if(data->scrollersobj) + vsbwidth = xget(data->scrollersobj, MUIA_NListview_VSB_Width); + + hsb = 0; + while ((ent < lastent) && (ent < data->NList_Entries)) + { + if (((data->EntriesArray[ent]->PixLen < 1) || data->do_draw_all) && (data->numcols > 0) && !DontDoColumn(data,ent,data->numcols-1)) + { + data->display_ptr = NULL; + data->parse_column = -1; + if (data->cols[data->numcols-1].c->userwidth > 0) + data->EntriesArray[ent]->PixLen = data->cols[data->numcols-1].c->userwidth + data->cols[data->numcols-1].c->minx - 1; + else + { + NL_GetDisplayArray(data,ent); + ParseColumn(data,data->numcols-1,0); + WidthColumn(data,data->numcols-1,0); + data->EntriesArray[ent]->PixLen = data->cols[data->numcols-1].c->colwidth + data->cols[data->numcols-1].c->minx + data->cols[data->numcols-1].c->xoffset; + if (IS_ALIGN_CENTER(data->cols[data->numcols-1].c->style) && (data->cols[data->numcols-1].c->dx > data->cols[data->numcols-1].c->colwidth)) + data->EntriesArray[ent]->PixLen = data->cols[data->numcols-1].c->minx + data->cols[data->numcols-1].c->dx - 1; + data->display_ptr = NULL; + data->parse_column = -1; + } + } + + if (data->EntriesArray[ent]->PixLen + vsbwidth > data->NList_Horiz_Visible) + { hsb |= MUIV_NListview_HSB_On; + break; + } + ent++; + } + data->ScrollBars |= hsb; + } + } + + if (force || (data->ScrollBars != data->ScrollBarsOld)) + { + data->ScrollBarsOld = data->ScrollBars; + data->ScrollBarsPos = data->NList_First; + + data->UpdatingScrollbars = TRUE; + data->UpdateScrollersRedrawn = FALSE; + set(data->this,MUIA_NListview_Horiz_ScrollBar,data->ScrollBars); + data->UpdatingScrollbars = FALSE; + + NL_UpdateScrollersValues(data); + + if ((data->ScrollBars & MUIV_NListview_VSB_On) != MUIV_NListview_VSB_On) + data->ScrollBarsPos = -2; + + return (data->UpdateScrollersRedrawn); + } + } + data->do_updatesb = FALSE; + return (FALSE); +} + + +static LONG DoRefresh(struct NLData *data) +{ + if (data->SHOW && data->DRAW) + { + Object *obj = data->this; + + if (data->DRAW > 1) + { + data->pushtrigger = 1; + DoMethod(_app(obj),MUIM_Application_PushMethod,obj,1,MUIM_NList_Trigger); + return (FALSE); + } + if (!(muiRenderInfo(obj)->mri_Flags & MUIMRI_REFRESHMODE) && !data->refreshing && + (data->rp->Layer->Flags & LAYERREFRESH)) + /*&& ((_window(obj)->Flags & WFLG_REFRESHBITS) == WFLG_SIMPLE_REFRESH) )*/ + { + SetBackGround(data->NList_ListBackGround); + if (MUI_BeginRefresh(muiRenderInfo(obj),0)) + { + Object *o = (Object *)xget(_win(obj),MUIA_Window_RootObject); + + if(o) + { + data->refreshing = TRUE; +/* + * if (data->do_draw_all && data->do_draw) + * data->refreshing = 2; + */ + MUI_Redraw(o,MADF_DRAWOBJECT); /* MADF_DRAWALL */ + data->refreshing = FALSE; + MUI_EndRefresh(muiRenderInfo(obj),0); + } + } + } + if ((data->pushtrigger == 2) || + (!(data->rp->Layer->Flags & LAYERREFRESH) && + !(muiRenderInfo(obj)->mri_Flags & MUIMRI_REFRESHMODE) && !data->refreshing)) + { + return (TRUE); + } + else if (!data->pushtrigger) + { + data->pushtrigger = 1; + DoMethod(_app(obj),MUIM_Application_PushMethod,obj,1,MUIM_NList_Trigger); + } + } + return (FALSE); +} + +/* + * if (!(data->rp->Layer->Flags & LAYERREFRESH) || (data->pushtrigger == 2)) + * { + * } + * else if (!data->pushtrigger) + * { data->pushtrigger = 1; + * DoMethod(_app(obj),MUIM_Application_PushMethod,obj,1,MUIM_NList_Trigger); + * } + */ + + +LONG NL_DrawQuietBG(struct NLData *data,LONG dowhat,LONG bg) +{ + if (data->do_draw_all) + { if ((dowhat == 0) || (dowhat == 4)) + dowhat = 2; + else if (dowhat == 3) + dowhat = 1; + } + + switch (dowhat) + { + case 0 : /* REDRAW_IF */ + + if (!data->NList_Quiet && !data->NList_Disabled && data->SHOW && data->DRAW) + { + if (DoRefresh(data)) + { + if (data->do_draw_all) + { + ULONG mad_Flags = muiAreaData(data->this)->mad_Flags; + + data->nodraw++; + OCLASS(data->this) = data->ncl; + nnset(data->this,MUIA_Background,(IPTR)"0:128"); + OCLASS(data->this) = data->ocl; + data->nodraw--; + muiAreaData(data->this)->mad_Flags = mad_Flags; + data->actbackground = -1; + MUI_Redraw(data->this,MADF_DRAWUPDATE); + } + else if (data->do_draw) + MUI_Redraw(data->this,MADF_DRAWUPDATE); + } + } + break; + + case 1 : /* REDRAW_ALL_FORCE */ + + data->do_draw = data->do_draw_all = TRUE; + if (data->SHOW && data->DRAW) + { + if (DoRefresh(data)) + { + ULONG mad_Flags = muiAreaData(data->this)->mad_Flags; + + data->nodraw++; + OCLASS(data->this) = data->ncl; + nnset(data->this,MUIA_Background,(IPTR)"0:128"); + OCLASS(data->this) = data->ocl; + data->nodraw--; + muiAreaData(data->this)->mad_Flags = mad_Flags; + data->actbackground = -1; + MUI_Redraw(data->this,MADF_DRAWALL); + } + } + break; + + case 2 : /* REDRAW_ALL */ + + data->do_draw = data->do_draw_all = TRUE; + if (!data->NList_Quiet && !data->NList_Disabled && data->SHOW && data->DRAW) + { + if (DoRefresh(data)) + { + ULONG mad_Flags = muiAreaData(data->this)->mad_Flags; + + data->nodraw++; + OCLASS(data->this) = data->ncl; + nnset(data->this,MUIA_Background,(IPTR)"0:128"); + OCLASS(data->this) = data->ocl; + data->nodraw--; + muiAreaData(data->this)->mad_Flags = mad_Flags; + data->actbackground = -1; + MUI_Redraw(data->this,MADF_DRAWOBJECT); + } + } + break; + + case 3 : /* REDRAW_FORCE */ + + data->do_draw = TRUE; + if (data->SHOW && data->DRAW) + { + if (DoRefresh(data)) + { + if (data->do_draw_all) + { + ULONG mad_Flags = muiAreaData(data->this)->mad_Flags; + + data->nodraw++; + OCLASS(data->this) = data->ncl; + nnset(data->this,MUIA_Background,(IPTR)"0:128"); + OCLASS(data->this) = data->ocl; + data->nodraw--; + muiAreaData(data->this)->mad_Flags = mad_Flags; + data->actbackground = -1; + MUI_Redraw(data->this,MADF_DRAWUPDATE); + } + else + MUI_Redraw(data->this,MADF_DRAWUPDATE); + } + } + break; + + case 4 : /* REDRAW */ + + data->do_draw = TRUE; + if (!data->NList_Quiet && !data->NList_Disabled && data->SHOW && data->DRAW) + { + if (DoRefresh(data)) + { + if (data->do_draw_all) + { + ULONG mad_Flags = muiAreaData(data->this)->mad_Flags; + + data->nodraw++; + OCLASS(data->this) = data->ncl; + nnset(data->this,MUIA_Background,(IPTR)"0:128"); + OCLASS(data->this) = data->ocl; + data->nodraw--; + muiAreaData(data->this)->mad_Flags = mad_Flags; + data->actbackground = -1; + MUI_Redraw(data->this,MADF_DRAWUPDATE); + } + else + MUI_Redraw(data->this,MADF_DRAWUPDATE); + } + } + break; + + case 5 : /* ENDQUIET */ + + data->NList_Quiet = 0; + if (data->SHOW) + { + if (DoRefresh(data)) + { + if (data->do_draw_all) + { + ULONG mad_Flags = muiAreaData(data->this)->mad_Flags; + + data->nodraw++; + OCLASS(data->this) = data->ncl; + nnset(data->this,MUIA_Background,(IPTR)"0:128"); + OCLASS(data->this) = data->ocl; + data->nodraw--; + muiAreaData(data->this)->mad_Flags = mad_Flags; + data->actbackground = -1; + /*MUI_Redraw(data->this,MADF_DRAWOBJECT);*/ + MUI_Redraw(data->this,MADF_DRAWOBJECT); + } + else if (data->do_draw) + MUI_Redraw(data->this,MADF_DRAWUPDATE); + } +/* do_notifies(NTF_All);*/ + } + break; + + case 6 : /* LESSQUIET */ + + if (data->NList_Quiet > 0) + data->NList_Quiet--; + if (!data->NList_Quiet && !data->NList_Disabled && data->SHOW) + { + if (DoRefresh(data)) + { + if (data->do_draw_all) + { + ULONG mad_Flags = muiAreaData(data->this)->mad_Flags; + + data->nodraw++; + OCLASS(data->this) = data->ncl; + nnset(data->this,MUIA_Background,(IPTR)"0:128"); + OCLASS(data->this) = data->ocl; + data->nodraw--; + muiAreaData(data->this)->mad_Flags = mad_Flags; + data->actbackground = -1; + /*MUI_Redraw(data->this,MADF_DRAWOBJECT);*/ + MUI_Redraw(data->this,MADF_DRAWUPDATE); + } + else if (data->do_draw) + MUI_Redraw(data->this,MADF_DRAWUPDATE); + } +/* do_notifies(NTF_All);*/ + } + break; + + case 7 : /* SetBackGround */ + + { + ULONG mad_Flags = muiAreaData(data->this)->mad_Flags; + + data->actbackground = bg; + data->nodraw++; + OCLASS(data->this) = data->ncl; + nnset(data->this,MUIA_Background,bg); + OCLASS(data->this) = data->ocl; + data->nodraw--; + muiAreaData(data->this)->mad_Flags = mad_Flags; + } + + break; + + case 8 : /* SetBackGroundForce */ + + { + ULONG mad_Flags = muiAreaData(data->this)->mad_Flags; + + OCLASS(data->this) = data->ncl; + if (bg == data->actbackground) + { + data->nodraw++; + nnset(data->this,MUIA_Background,(IPTR)"0:128"); + data->nodraw--; + } + data->actbackground = bg; + data->nodraw++; + nnset(data->this,MUIA_Background,bg); + OCLASS(data->this) = data->ocl; + data->nodraw--; + muiAreaData(data->this)->mad_Flags = mad_Flags; + } + break; + + case 9 : /* Make_Active_Visible */ + + if ((data->NList_AutoVisible) && (data->NList_Active >= 0) && (data->NList_Active < data->NList_Entries)) + { + if (data->NList_Active < data->NList_First) + { + data->NList_First = data->NList_Active; + DO_NOTIFY(NTF_First); + } + else if (data->NList_Active >= data->NList_First + data->NList_Visible) + { + data->NList_First = data->NList_Active - data->NList_Visible + 1; + if (data->NList_First < 0) + data->NList_First = 0; + DO_NOTIFY(NTF_First); + } + } + break; + + case 10 : /* ForceMinMax */ + + DONE_NOTIFY(NTF_MinMax); + if (!WANTED_NOTIFY(NTF_MinMax) && data->SHOW && data->DRAW && data->NL_Group && data->VirtGroup && data->NList_AdjustHeight) + { + ULONG mad_Flags = muiAreaData(data->this)->mad_Flags; + + WANT_NOTIFY(NTF_MinMax|NTF_MinMaxNoDraw); + if (DoMethod(data->VirtGroup,MUIM_Group_InitChange)) + { + DoMethod(data->VirtGroup,MUIM_Group_ExitChange); + muiAreaData(data->this)->mad_Flags = mad_Flags; + NL_UpdateScrollersValues(data); + } + } + NOWANT_NOTIFY(NTF_MinMax|NTF_MinMaxNoDraw); + DONE_NOTIFY(NTF_MinMax); + break; + + } + return (0L); +} + + +#define SELECTABLE(ent) \ + ((!data->NList_MultiTestHook) ||\ + (MyCallHookPkt(data->this,FALSE,data->NList_MultiTestHook,data->this,data->EntriesArray[ent]->Entry))) + + +void NL_Select(struct NLData *data,LONG dowhat,LONG ent,BYTE sel) +{ +/* D(bug("%lx dowhat=%ld ent=%ld sel=%ld\n",obj,dowhat,ent,sel));*/ + switch (dowhat) + { + case 0 : /* SELECT(ent,sel) */ + if (!data->NList_TypeSelect && SELECTABLE(ent)) + { if (data->EntriesArray[ent]->Select != sel) + { data->EntriesArray[ent]->Select = sel; + DO_NOTIFY(NTF_Select | NTF_LV_Select); + + DoMethod( data->this, MUIM_NList_SelectChange, ent, MUIV_NList_Select_On, 0 ); + } + } + break; + + case 1 : /* SELECT2(ent,sel) */ + if (!data->NList_TypeSelect && (data->EntriesArray[ent]->Select != sel)) + { data->EntriesArray[ent]->Select = sel; + DO_NOTIFY(NTF_Select | NTF_LV_Select); + + DoMethod( data->this, MUIM_NList_SelectChange, ent, MUIV_NList_Select_Off, 0 ); + } + break; + + case 2 : /* SELECT_CHGE(ent,sel) */ + if (!data->NList_TypeSelect && SELECTABLE(ent)) + { if (data->EntriesArray[ent]->Select != sel) + { data->EntriesArray[ent]->Select = sel; + NL_Changed(data,ent); + DO_NOTIFY(NTF_Select | NTF_LV_Select); + + DoMethod( data->this, MUIM_NList_SelectChange, ent, MUIV_NList_Select_On, MUIV_NList_SelectChange_Flag_Multi ); + } + } + break; + + case 3 : /* SELECT2_CHGE(ent,sel) */ + if (!data->NList_TypeSelect && (data->EntriesArray[ent]->Select != sel)) + { data->EntriesArray[ent]->Select = sel; + NL_Changed(data,ent); + DO_NOTIFY(NTF_Select | NTF_LV_Select); + + DoMethod( data->this, MUIM_NList_SelectChange, ent, MUIV_NList_Select_Off, MUIV_NList_SelectChange_Flag_Multi ); + } + break; + + case 4 : /* set_Active(ent) */ + { if (data->NList_Active != (ent)) + { + data->NList_Active = (ent); + DO_NOTIFY(NTF_Active | NTF_L_Active); + + DoMethod( data->this, MUIM_NList_SelectChange, ent, MUIV_NList_Select_Active, 0 ); + } + } + break; + + } +} + + + + + +/* + * if ((w->Flags & WFLG_REFRESHBITS) == WFLG_SIMPLE_REFRESH) + * { + * struct Layer *lay, *l = w->WLayer; + * WORD mleft,mright,mtop,mbottom; + * mleft = w->LeftEdge + data->mleft; + * mright = w->LeftEdge + data->mright; + * mtop = w->TopEdge + data->mtop; + * mbottom = w->TopEdge + data->mbottom; + * lay = w->WLayer->front; + * while (lay) + * { if ((lay->bounds.MaxX > mleft) && + * (lay->bounds.MinX < mright) && + * (lay->bounds.MaxY > mtop) && + * (lay->bounds.MinY < mbottom)) + * { data->do_draw_all = TRUE; + * data->NList_First_Incr = 0; + * break; + * } + * lay = lay->front; + * } + * } + */ + +#define LayerCovered(l) ((!(l)->ClipRect) || ((l)->ClipRect->bounds.MaxX != (l)->bounds.MaxX) ||\ + ((l)->ClipRect->bounds.MinX != (l)->bounds.MinX) ||\ + ((l)->ClipRect->bounds.MaxY != (l)->bounds.MaxY) ||\ + ((l)->ClipRect->bounds.MinY != (l)->bounds.MinY)) + +#define LayerDamaged(l) ((l)->DamageList && (l)->DamageList->RegionRectangle) + +#define ABS(x) (((x) >= 0) ? (x) : -(x)) + +void ScrollVert(struct NLData *data,WORD dy,LONG LPVisible) +{ + WORD y1 = data->vpos; + WORD y2 = data->vpos + LPVisible - 1; + + if (data->vwidth <= 0) + return; + if (y1 < data->vtop) y1 = data->vtop; + if (y2 > data->vbottom) y2 = data->vbottom; + if ((y2 - y1) <= ABS(dy)) + return; + +#ifndef DO_CLIPBLIT + if (LIBVER(GfxBase) >= 39) + { + struct Hook *oldbackfilhook; + + oldbackfilhook = InstallLayerHook(data->rp->Layer, LAYERS_NOBACKFILL); + ScrollRasterBF(data->rp,0,dy,data->vleft,y1,data->vright,y2); + InstallLayerHook(data->rp->Layer, oldbackfilhook); + } + else +#endif + { + struct Window *w = _window(data->this); + struct Layer *l = w->WLayer; + + if (dy > 0) + ClipBlit(data->rp,data->vleft,y1+dy,data->rp,data->vleft,y1,data->vwidth,y2-y1+1-dy,0xC0); + else + ClipBlit(data->rp,data->vleft,y1,data->rp,data->vleft,y1-dy,data->vwidth,y2-y1+1+dy,0xC0); + if (((w->Flags & WFLG_REFRESHBITS) == WFLG_SIMPLE_REFRESH) && + (LayerCovered(l) || LayerDamaged(l))) + { + UBYTE oldmask = data->rp->Mask; + + SetWrMsk(data->rp,0); + ScrollRaster(data->rp,0,dy,data->vleft,y1,data->vright,y2); + SetWrMsk(data->rp,oldmask); + } + } +} + + +void ScrollHoriz(struct NLData *data,WORD dx,LONG LPVisible) +{ + WORD y1 = data->vpos; + WORD y2 = data->vpos + LPVisible - 1; + + if (data->vwidth <= ABS(dx)) + return; + if (data->NList_Title) + y1 = data->vdtitlepos; + if (y1 < data->vtop) y1 = data->vtop; + if (y2 > data->vbottom) y2 = data->vbottom; + if (y1 > y2) + return; + +#ifndef DO_CLIPBLIT + if (LIBVER(GfxBase) >= 39) + { + struct Hook *oldbackfilhook; + + oldbackfilhook = InstallLayerHook(data->rp->Layer, LAYERS_NOBACKFILL); + ScrollRasterBF(data->rp,dx,0,data->vleft,y1,data->vright,y2); + InstallLayerHook(data->rp->Layer, oldbackfilhook); + } + else +#endif + { + struct Window *w = _window(data->this); + struct Layer *l = w->WLayer; + + if (dx > 0) + ClipBlit(data->rp,data->vleft+dx,y1,data->rp,data->vleft,y1,data->vwidth-dx,y2-y1+1,0xC0); + else + ClipBlit(data->rp,data->vleft,y1,data->rp,data->vleft-dx,y1,data->vwidth+dx,y2-y1+1,0xC0); + if (((w->Flags & WFLG_REFRESHBITS) == WFLG_SIMPLE_REFRESH) && + (LayerCovered(l) || LayerDamaged(l))) + { + UBYTE oldmask = data->rp->Mask; + + SetWrMsk(data->rp,0); + ScrollRaster(data->rp,dx,0,data->vleft,y1,data->vright,y2); + SetWrMsk(data->rp,oldmask); + } + } +} + + +LONG NL_ColToColumn(struct NLData *data,LONG col) +{ + LONG column; + + if ((col >= 0) && (col < DISPLAY_ARRAY_MAX)) + { + for (column = 0; column < data->numcols; column++) + { + if (data->cols[column].c->col == col) + return (column); + } + } + return (-1); +} + + +LONG NL_ColumnToCol(struct NLData *data,LONG column) +{ + if ((column >= 0) && (column < data->numcols)) + return ((LONG) data->cols[column].c->col); + return (-1); +} + + +LONG NL_SetCol(struct NLData *data,LONG column,LONG col) +{ LONG column2d = -1; + if ((column == MUIV_NList_SetColumnCol_Default) && (col == MUIV_NList_SetColumnCol_Default)) + { for (column = 0; column < data->numcols; column++) + { if (data->cols[column].c != &data->cols[column]) + data->do_setcols = TRUE; + data->cols[column].c = &data->cols[column]; + } + if (data->do_setcols) + { DO_NOTIFY(NTF_Columns); + REDRAW_FORCE; + } + return (0); + } + else if ((col == MUIV_NList_SetColumnCol_Default) && + (column >= 0) && (column < data->numcols)) + { for (column2d = 0; column2d < data->numcols; column2d++) + { if (data->cols[column].c == &data->cols[column2d]) + { column = column2d; + break; + } + } + } + else if ((col >= 0) && (col < DISPLAY_ARRAY_MAX)) + { for (column2d = 0; column2d < data->numcols; column2d++) + { if (data->cols[column2d].col == col) + { if (column == MUIV_NList_SetColumnCol_Default) + column = column2d; + break; + } + } + } + + if ((column >= 0) && (column < data->numcols) && + (column2d >= 0) && (column2d < data->numcols) && + (data->cols[column].c != &data->cols[column2d])) + { LONG column2; + for (column2 = 0; column2 < data->numcols; column2++) + { if (data->cols[column2].c == &data->cols[column2d]) + break; + } + if ((column2 >= 0) && (column2 < data->numcols)) + { data->cols[column2].c = data->cols[column].c; + data->cols[column].c = &data->cols[column2d]; +/* + * data->do_draw_all = data->do_draw_title = data->do_draw = TRUE; + * data->do_parse = data->do_setcols = data->do_updatesb = data->do_wwrap = TRUE; + * do_draw = TRUE; + */ + data->do_setcols = TRUE; + DO_NOTIFY(NTF_Columns); + REDRAW_FORCE; + } + } + return (0); +} + + +LONG NL_ColWidth(struct NLData *data,LONG col,LONG width) +{ + LONG column = NL_ColToColumn(data,col); + WORD userwidth = (WORD) width; + + if (userwidth < 4) /* < 4 is considered as MUIV_NList_ColWidth_Default */ + userwidth = -1; + if (userwidth > 2000) + userwidth = 2000; + if (width == MUIV_NList_ColWidth_Get) + { + if ((column >= 0) && (column < data->numcols)) + return ((LONG) data->cols[column].c->userwidth); + } + else if (col == MUIV_NList_ColWidth_All) + { + for (column = 0;column < data->numcols;column++) + { + if (data->cols[column].c->userwidth != userwidth) + { + if (userwidth < 0) + data->cols[column].c->colwidthbiggestptr = -2; + data->cols[column].c->userwidth = userwidth; + data->do_setcols = TRUE; + } + } + if (data->do_setcols) + { + REDRAW_FORCE; + } + } + else if ((column >= 0) && (column < data->numcols) && (data->cols[column].c->userwidth != userwidth)) + { + if (userwidth < 0) + data->cols[column].c->colwidthbiggestptr = -2; + data->cols[column].c->userwidth = userwidth; + data->do_setcols = TRUE; + REDRAW_FORCE; + return (userwidth); + } + return (0); +} + + +BYTE *NL_Columns(struct NLData *data,BYTE *columns) +{ LONG column; + if (columns) + { column = 0; + while ((column < data->numcols) && (columns[column] != -1)) + { + NL_SetCol(data,column,columns[column]); + column++; + } + } + for (column = 0; column < data->numcols; column++) + { data->column[column] = data->cols[column].c->col; + } + data->column[column] = -1; + return (data->column); +} + + +IPTR mNL_ColToColumn(struct IClass *cl,Object *obj,struct MUIP_NList_ColToColumn *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + return ((IPTR) NL_ColToColumn(data,msg->col)); +} + + +IPTR mNL_ColumnToCol(struct IClass *cl,Object *obj,struct MUIP_NList_ColumnToCol *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + return ((IPTR) NL_ColumnToCol(data,msg->column)); +} + + +IPTR mNL_SetColumnCol(struct IClass *cl,Object *obj,struct MUIP_NList_SetColumnCol *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + LONG retval; + retval = NL_SetCol(data,msg->column,msg->col); + DONE_NOTIFY(NTF_Columns); + return ((IPTR) retval); +} + + +IPTR mNL_List_ColWidth(struct IClass *cl,Object *obj,struct MUIP_NList_ColWidth *msg) +{ + struct NLData *data = INST_DATA(cl,obj); + return ((IPTR) NL_ColWidth(data,msg->col,msg->width)); +} + + + +IPTR mNL_ContextMenuBuild(struct IClass *cl,Object *obj,struct MUIP_ContextMenuBuild *msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + Object *MenuObj = NULL; + LONG column; + LONG mo = 0; + BOOL do_it = FALSE; + BOOL order_it = FALSE; + + if (data->NList_Disabled) + return (0); + + if((mo = xget(obj, MUIA_ContextMenu))) + { + if ((mo & 0x9d510030) != 0x9d510030) + { + if (data->MenuObj) + { MUI_DisposeObject(data->MenuObj); + data->MenuObj = NULL; + } + return(DoSuperMethodA(cl,obj,(Msg) msg)); + } + else if (mo == (LONG)MUIV_NList_ContextMenu_Never) + { + data->ContextMenuOn = FALSE; + data->NList_ContextMenu = MUIV_NList_ContextMenu_Never; + nnset(obj,MUIA_ContextMenu,NULL); + } + for (column = 0;column < data->numcols;column++) + { + if (data->cols[column].c->userwidth >= 0) + do_it = TRUE; + if (data->cols[column].c != &data->cols[column]) + order_it = TRUE; + } + + /* sba: Contextmenu problem: Disabled */ +/* if (data->numcols > 1) */ + if (data->numcols > 0) + { Object *mithis = NULL; + struct MUI_NList_TestPos_Result res; + LONG flags,ontop; + + data->click_x = msg->mx; + data->click_y = msg->my; + res.char_number = -2; + NL_List_TestPos(data,MUI_MAXMAX,0,&res); + column = (LONG) res.column; + flags = (LONG) res.flags; + if (res.flags & MUI_NLPR_TITLE) + ontop = TRUE; + else + ontop = FALSE; + + MenuObj = (Object *) DoMethod(obj,MUIM_NList_ContextMenuBuild,msg->mx,msg->my,res.entry,column,flags,ontop); + + if ((IPTR)MenuObj == (IPTR)-1) + return (0); + + if (!MenuObj) + { if (!data->MenuObj) + data->MenuObj = MUI_MakeObject(MUIO_MenustripNM,MenuData,0); + MenuObj = data->MenuObj; + } + + if (MenuObj && (mithis = (Object *) DoMethod(MenuObj,MUIM_FindUData,MUIV_NList_Menu_DefWidth_This))) + { + if ((res.column >= 0) && (res.column < data->numcols) && + !(res.flags & MUI_NLPR_BAR) && (data->cols[res.column].c->userwidth > 0)) + { nnset(mithis,MUIA_Menuitem_Enabled,TRUE); + } + else + { nnset(mithis,MUIA_Menuitem_Enabled,FALSE); + } + } + if (MenuObj && (mithis = (Object *) DoMethod(MenuObj,MUIM_FindUData,MUIV_NList_Menu_DefWidth_All))) + { if (do_it) + { nnset(mithis,MUIA_Menuitem_Enabled,TRUE); + } + else + { nnset(mithis,MUIA_Menuitem_Enabled,FALSE); + } + } + if (MenuObj && (mithis = (Object *) DoMethod(MenuObj,MUIM_FindUData,MUIV_NList_Menu_DefOrder_This))) + { + if ((res.column >= 0) && (res.column < data->numcols) && + !(res.flags & MUI_NLPR_BAR) && (data->cols[res.column].c != &data->cols[res.column])) + { nnset(mithis,MUIA_Menuitem_Enabled,TRUE); + } + else + { nnset(mithis,MUIA_Menuitem_Enabled,FALSE); + } + } + if (MenuObj && (mithis = (Object *) DoMethod(MenuObj,MUIM_FindUData,MUIV_NList_Menu_DefOrder_All))) + { if (order_it) + { nnset(mithis,MUIA_Menuitem_Enabled,TRUE); + } + else + { nnset(mithis,MUIA_Menuitem_Enabled,FALSE); + } + } + return ((IPTR) MenuObj); + } + } + + return (0); +} + + + +IPTR mNL_ContextMenuChoice(struct IClass *cl,Object *obj,struct MUIP_ContextMenuChoice *msg) +{ + register struct NLData *data = INST_DATA(cl,obj); + + if (data->NList_Disabled) + return (0); + + if (msg->item) + { + if (muiUserData(msg->item) == MUIV_NList_Menu_DefWidth_This) + { + struct MUI_NList_TestPos_Result res; + + res.char_number = -2; + NL_List_TestPos(data,MUI_MAXMAX,0,&res); + if ((res.column >= 0) && (res.column < data->numcols) && !(res.flags & MUI_NLPR_BAR)) + NL_ColWidth(data,NL_ColumnToCol(data,res.column),MUIV_NList_ColWidth_Default); + } + else if (muiUserData(msg->item) == MUIV_NList_Menu_DefWidth_All) + NL_ColWidth(data,MUIV_NList_ColWidth_All,MUIV_NList_ColWidth_Default); + else if (muiUserData(msg->item) == MUIV_NList_Menu_DefOrder_This) + { + struct MUI_NList_TestPos_Result res; + + res.char_number = -2; + NL_List_TestPos(data,MUI_MAXMAX,0,&res); + if ((res.column >= 0) && (res.column < data->numcols) && !(res.flags & MUI_NLPR_BAR)) + NL_SetCol(data,res.column,MUIV_NList_SetColumnCol_Default); + } + else if (muiUserData(msg->item) == MUIV_NList_Menu_DefOrder_All) + NL_SetCol(data,MUIV_NList_SetColumnCol_Default,MUIV_NList_SetColumnCol_Default); + else + return(DoSuperMethodA(cl,obj,(Msg) msg)); + } + + return (0); +} diff --git a/workbench/classes/zune/nlist/nlist_mcc/NList_mcc6.c b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc6.c new file mode 100644 index 0000000000..bd5b8ad519 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/NList_mcc6.c @@ -0,0 +1,1850 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <stdio.h> +#include <string.h> + +#include <graphics/gfxmacros.h> +#undef GetOutlinePen + +#include <intuition/imageclass.h> +#include <clib/alib_protos.h> +#include <proto/exec.h> +#include <proto/muimaster.h> +#include <proto/graphics.h> +#include <proto/intuition.h> + +#include "private.h" + +#include "NList_func.h" + +void DrawBackground(Object *obj, LONG left, LONG top, LONG width, LONG height, LONG xoff, LONG yoff) +{ + // MUI 3.9 of AmigaOS 4.1 update #3 and MUI4 treat the offsets as real offsets relative to the given + // coordinates and not as absolute corrdinates. + // Since all offsets are relative now these must be adapted for older versions of MUI. + #if !defined(__MORPHOS__) && !defined(__AROS__) + if(MUIMasterBase->lib_Version < 20 || (MUIMasterBase->lib_Version == 20 && MUIMasterBase->lib_Revision < 2326)) + #endif + { + xoff += left; + yoff += top; + } + DoMethod(obj, MUIM_DrawBackground, left, top, width, height, xoff, yoff, 0); +} + +WORD DrawTitle(struct NLData *data,LONG minx,LONG maxx,WORD hfirst) +{ + Object *obj = data->this; + WORD linelen = 3; +#ifdef DO_CLIPPING + APTR clippinghandle; + clippinghandle = MUI_AddClipping(muiRenderInfo(obj),(WORD) data->mleft,(WORD) _mtop(obj), + (WORD) data->mwidth,(WORD) data->vinc); +#endif + + if (minx < data->vleft) + minx = data->vleft; + if (maxx > data->vright + 1) + maxx = data->vright + 1; + + if (minx < data->mleft) + minx = data->mleft; + if (maxx > data->mleft + data->mwidth) + maxx = data->mleft + data->mwidth; + if (minx >= maxx) + return(0); + + SetBackGround(data->NList_TitleBackGround) + DrawBackground(obj, minx, data->vdtitlepos, maxx-minx, data->vdtitleheight, hfirst + data->vdx, data->vdy); + if (data->NList_TitleSeparator) + { + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, minx, data->vpos - 2); + Draw(data->rp, maxx-1, data->vpos - 2); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, minx, data->vpos - 1); + Draw(data->rp, maxx-1, data->vpos - 1); + } + linelen = DrawText(data,-1,data->hpos - hfirst,data->vdtitlepos + data->voff,minx,maxx,MUIPEN(data->NList_TitlePen),data->hinc,FALSE); + data->do_draw_title = FALSE; +#ifdef DO_CLIPPING + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); +#endif + return (linelen); +} + + +void DrawOldLine(struct NLData *data,LONG ent,LONG minx,LONG maxx,WORD hfirst) +{ + Object *obj = data->this; + ULONG mypen; + BOOL forcepen = FALSE; + BOOL drawtxt; + LONG vert1,vert2,vertd; +#ifdef DO_CLIPPING + APTR clippinghandle; +#endif + + if (minx < data->vleft) + minx = data->vleft; + if (maxx > data->vright + 1) + maxx = data->vright + 1; + + if (minx < data->mleft) + minx = data->mleft; + if (maxx > data->mleft + data->mwidth) + maxx = data->mleft + data->mwidth; + if (minx >= maxx) + return; + +#ifdef DO_CLIPPING + clippinghandle = MUI_AddClipping(muiRenderInfo(obj),(WORD) data->mleft,(WORD) data->mtop, + (WORD) data->mwidth,(WORD) data->mheight); +#endif + drawtxt = TRUE; + vert1 = data->vpos+(data->vinc * (ent - data->NList_AffFirst)); + vert2 = data->vpos + (ent*data->vinc); + vertd = data->vinc; + if (data->NList_First_Incr) + { if (ent == data->NList_First) + { vertd -= data->NList_First_Incr; + vert2 += data->NList_First_Incr; + drawtxt = FALSE; + } + else if (ent == data->NList_First + data->NList_Visible) + { vertd = data->NList_First_Incr; + vert1 -= data->NList_First_Incr; + drawtxt = FALSE; + } + else + { vert1 -= data->NList_First_Incr; + } + } + if ((ent < 0) || (ent >= data->NList_Entries)) + { + SetBackGround(data->NList_ListBackGround); mypen = data->NList_ListPen; + DrawBackground(obj, minx, vert1, maxx-minx, vertd, hfirst+data->vdx, vert2-vert1+data->vdy); + } + else + { + if (data->EntriesArray[ent]->Select == TE_Select_None) + { + SetBackGround(data->NList_ListBackGround); mypen = data->NList_ListPen; forcepen = FALSE; + } + else + { + if(data->NList_ActiveObjectOnClick == TRUE && (data->isActiveObject == FALSE || xget(_win(obj), MUIA_Window_Activate) == FALSE)) + { + SetBackGround(MUII_myListInactive); mypen = data->NList_InactivePen; forcepen = data->ForcePen; + } + else + { + SetBackGround(MUII_myListSelect); mypen = data->NList_SelectPen; forcepen = data->ForcePen; + } + } + + DrawBackground(obj, minx, vert1, maxx-minx, vertd, hfirst+data->vdx, vert2-vert1+data->vdy); + if (drawtxt) + DrawText(data,ent,data->hpos-hfirst,vert1+data->voff,minx,maxx-1,MUIPEN(mypen),data->hinc,forcepen); + } +#ifdef DO_CLIPPING + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); +#endif +} + + +WORD DrawLines(struct NLData *data,LONG e1,LONG e2,LONG minx,LONG maxx,WORD hfirst,WORD hmax,WORD small,BOOL do_extrems,WORD not_all) +{ + Object *obj = data->this; + LONG ent,ent2,ent3,ent4,dent,lim1,lim2,lim3; + WORD cursel,linelen=0; + ULONG mypen; + BOOL forcepen = FALSE; + LONG vert1,vert2,vertd,vert3; + WORD hfx = data->mleft - hfirst; +#ifdef DO_CLIPPING + APTR clippinghandle = NULL; + BOOL doclip = FALSE; +#endif + + //D(bug( "DRAWING LINES FROM %ld - %ld\n", e1, e2 )); + + if (small > 1) + { lim1 = 3; + lim2 = 2; + lim3 = 2; + } + else if (small == 1) + { lim1 = 8; + lim2 = 4; + lim3 = 4; + } + else + { lim1 = 14; + lim2 = 7; + lim3 = 8; + } + + if (minx < data->vleft) + minx = data->vleft; + if (maxx > data->vright + 1) + maxx = data->vright + 1; + + if ((e2 - e1) == 1) + { if ((e1 == data->minx_change_entry) && (minx < hfx + data->minx_change_offset)) + minx = hfx + data->minx_change_offset; + if ((e1 == data->maxx_change_entry) && (maxx > hfx + data->maxx_change_offset)) + maxx = hfx + data->maxx_change_offset; + } + if (minx < data->mleft) + minx = data->mleft; + if (maxx > data->mleft + data->mwidth) + maxx = data->mleft + data->mwidth; + if (minx >= maxx) + return (hmax); + + ent4 = ent2 = e2; + if (ent2 > data->NList_Entries) + ent2 = data->NList_Entries; + ent = e1; + if (ent < 0) + ent = 0; + +#ifdef DO_CLIPPING + if (data->NList_First_Incr && + ((e1 <= data->NList_First) || (e2 >= data->NList_First + data->NList_Visible))) + { doclip = TRUE; + clippinghandle = MUI_AddClipping(muiRenderInfo(obj), + (WORD) data->mleft, + (WORD) data->vpos, + (WORD) data->mwidth, + (WORD) (data->NList_Visible*data->vinc)); + } +#endif + while (ent < ent2) + { + forcepen = FALSE; + if ((ent != data->NList_First) && (ent != (data->NList_First + data->NList_Visible - 1)) && + (((not_all == 1) && ((ent - data->NList_First) & 1L)) || + ((not_all == 2) && !((ent - data->NList_First) & 1L)))) + { ent++; + continue; + } + if (!data->NList_TypeSelect || ((ent != data->sel_pt[data->min_sel].ent) && (ent != data->sel_pt[data->max_sel].ent))) + { + if (data->NList_TypeSelect) + { + if ((ent > data->sel_pt[data->min_sel].ent) && (ent < data->sel_pt[data->max_sel].ent)) + { + ent3 = ent + 1; + if (!not_all) + { + while ((ent3 < ent2) && (ent3 < data->sel_pt[data->max_sel].ent)) + ent3++; + dent = ent3 - ent; + if (dent >= 14) + ent3 = ent + 7; + else if (dent >= 8) + ent3 = ent + (dent / 2); + } + + if(data->NList_ActiveObjectOnClick == TRUE && (data->isActiveObject == FALSE || xget(_win(obj), MUIA_Window_Activate) == FALSE)) + { + SetBackGround(MUII_myListInactive); mypen = data->NList_InactivePen; forcepen = data->ForcePen; + } + else + { + SetBackGround(MUII_myListCursor); mypen = data->NList_CursorPen; forcepen = data->ForcePen; + } + } + else + { + ent3 = ent + 1; + if (!not_all) + { + while ((ent3 < ent2) && ((ent3 > data->sel_pt[data->max_sel].ent) || (ent3 < data->sel_pt[data->min_sel].ent))) + ent3++; + dent = ent3 - ent; + if (dent >= lim1) + ent3 = ent + lim2; + else if (dent >= lim3) + ent3 = ent + (dent / 2); + } + + SetBackGround(data->NList_ListBackGround); mypen = data->NList_ListPen; + } + } + else + { + if(ent == data->NList_Active) + { + ent3 = ent + 1; + + if(data->NList_ActiveObjectOnClick == TRUE && (data->isActiveObject == FALSE || xget(_win(obj), MUIA_Window_Activate) == FALSE)) + { + SetBackGround(MUII_myListInactive); mypen = data->NList_InactivePen; forcepen = data->ForcePen; + } + else if(data->EntriesArray[ent]->Select == TE_Select_None) + { + SetBackGround(MUII_myListUnselCur); mypen = data->NList_UnselCurPen; forcepen = data->ForcePen; + } + else + { + SetBackGround(MUII_myListCursor); mypen = data->NList_CursorPen; forcepen = data->ForcePen; + } + + data->do_draw_active = FALSE; + } + else + { cursel = data->EntriesArray[ent]->Select; + ent3 = ent + 1; + if (!not_all) + { while ((ent3 < ent2) && (data->EntriesArray[ent3]->Select == cursel) && (ent3 != data->NList_Active)) + ent3++; + dent = ent3 - ent; + if (dent >= 14) + ent3 = ent + 7; + else if (dent >= 8) + ent3 = ent + (dent / 2); + } + + if(cursel == TE_Select_None) + { + SetBackGround(data->NList_ListBackGround); mypen = data->NList_ListPen; + } + else if(data->NList_ActiveObjectOnClick == TRUE && (data->isActiveObject == FALSE || xget(_win(obj), MUIA_Window_Activate) == FALSE)) + { + SetBackGround(MUII_myListInactive); mypen = data->NList_InactivePen; forcepen = data->ForcePen; + } + else + { + SetBackGround(MUII_myListSelect); mypen = data->NList_SelectPen; forcepen = data->ForcePen; + } + } + } + + vert3 = vert1 = data->vpos+(data->vinc * (ent - data->NList_First)); + vert2 = data->vpos + (ent*data->vinc); + vertd = data->vinc * (ent3 - ent); + if (data->NList_First_Incr) + { vert1 -= data->NList_First_Incr; + if (ent == data->NList_First) + { vertd -= data->NList_First_Incr; + vert2 += data->NList_First_Incr; + } + else if (ent3-1 >= data->NList_First + data->NList_Visible) + { vertd = vertd - data->vinc + data->NList_First_Incr; + vert3 -= data->NList_First_Incr; + } + else + { vert3 -= data->NList_First_Incr; + } + } + DrawBackground(obj, minx, vert3, maxx-minx, vertd, hfirst+data->vdx, vert2-vert3+data->vdy); + while (ent < ent3) + { +#ifndef DO_CLIPPING + if (!data->NList_First_Incr || do_extrems || ((ent > data->NList_First) && (ent < data->NList_First + data->NList_Visible))) +#endif + { + linelen = DrawText(data,ent,data->hpos-hfirst,vert1+data->voff,minx,maxx-1,MUIPEN(mypen),data->hinc,forcepen); + if(linelen > hmax) + hmax = linelen; + } + vert1 += data->vinc; + ent++; + } + } + else + { + WORD x1,x2,x3,x4; + + x1 = minx; + x4 = maxx; + if ((ent == data->minx_change_entry) && (x1 < hfx + data->minx_change_offset)) + x1 = hfx + data->minx_change_offset; + if ((ent == data->maxx_change_entry) && (x4 > hfx + data->maxx_change_offset)) + x4 = hfx + data->maxx_change_offset; + x2 = hfx + data->sel_pt[data->min_sel].xoffset; + x3 = hfx + data->sel_pt[data->max_sel].xoffset; + if (x2 < x1) x2 = x1; + if (x3 < x1) x3 = x1; + if (x2 > x4) x2 = x4; + if (x3 > x4) x3 = x4; + if (ent != data->sel_pt[data->min_sel].ent) + x2 = x1; + if (ent != data->sel_pt[data->max_sel].ent) + x3 = x4; + + vert3 = vert1 = data->vpos+(data->vinc * (ent - data->NList_First)); + vert2 = data->vpos + (ent*data->vinc); + vertd = data->vinc; + if (data->NList_First_Incr) + { vert1 -= data->NList_First_Incr; + if (ent == data->NList_First) + { vertd -= data->NList_First_Incr; + vert2 += data->NList_First_Incr; + } + else if (ent >= data->NList_First + data->NList_Visible) + { vertd = vertd - data->vinc + data->NList_First_Incr; + vert3 -= data->NList_First_Incr; + } + else + { vert3 -= data->NList_First_Incr; + } + } + + if(x1 < x2) + { + SetBackGround(data->NList_ListBackGround); + DrawBackground(obj, x1, vert3, x2-x1, vertd, hfirst+data->vdx, vert2-vert3+data->vdy); + } + if (x2 < x3) + { + if(data->NList_ActiveObjectOnClick == TRUE && (data->isActiveObject == FALSE || xget(_win(obj), MUIA_Window_Activate) == FALSE)) + { + SetBackGround(MUII_myListInactive); + } + else + { + SetBackGround(MUII_myListCursor); + } + + DrawBackground(obj, x2, vert3, x3-x2, vertd, hfirst+data->vdx, vert2-vert3+data->vdy); + } + if (x3 < x4) + { + SetBackGround(data->NList_ListBackGround); + DrawBackground(obj, x3, vert3, x4-x3, vertd, hfirst+data->vdx, vert2-vert3-data->vdy); + } + + // FIXME: This isn't perfect, but it is the fastest 'solution' + // to fixing the distorted text output when the text is + // italic and anti-aliased. Please note that 'spacesize' isn't entirely + // correct as we should moved back by what the char width really is + // at the 'x1-1' position. However, this seems to be problematic here + // as we don't really have access to this informaton here?!?! + if(data->NList_TypeSelect) + x1 -= data->spacesize; + + x2 = hfx + data->sel_pt[data->min_sel].xoffset; + x3 = hfx + data->sel_pt[data->max_sel].xoffset; + if (x2 < x1) x2 = x1; + if (x3 < x1) x3 = x1; + if (x2 > x4) x2 = x4; + if (x3 > x4) x3 = x4; + if (ent != data->sel_pt[data->min_sel].ent) + x2 = x1; + if (ent != data->sel_pt[data->max_sel].ent) + x3 = x4; +#ifndef DO_CLIPPING + if (!data->NList_First_Incr || do_extrems || ((ent > data->NList_First) && (ent < data->NList_First + data->NList_Visible))) +#endif + { + if (x1 < x2) + { + mypen = data->NList_ListPen; + linelen = DrawText(data,ent,data->hpos-hfirst,vert1+data->voff,x1,x2-1,MUIPEN(mypen),0,FALSE); + } + if (x2 < x3) + { + mypen = data->NList_CursorPen; + linelen = DrawText(data,ent,data->hpos-hfirst,vert1+data->voff,x2,x3-1,MUIPEN(mypen),0,data->ForcePen); + } + if (x3 < x4) + { + mypen = data->NList_ListPen; + linelen = DrawText(data,ent,data->hpos-hfirst,vert1+data->voff,x3,x4-1,MUIPEN(mypen),0,FALSE); + } + if (linelen > hmax) + hmax = linelen; + } + ent++; + } + } + + if (ent < ent4) + { + SetBackGround(data->NList_ListBackGround); + vert3 = data->vpos+(data->vinc * (ent - data->NList_First)); + vert2 = data->vpos + (ent*data->vinc); + vertd = data->vinc * (ent4 - ent); + if (data->NList_First_Incr) + { if (ent == data->NList_First) + { vertd -= data->NList_First_Incr; + vert2 += data->NList_First_Incr; + } + else if (ent4-1 >= data->NList_First + data->NList_Visible) + { vertd = vertd - data->vinc + data->NList_First_Incr; + vert3 -= data->NList_First_Incr; + } + else + { vert3 -= data->NList_First_Incr; + } + } + DrawBackground(obj, minx, vert3, maxx-minx, vertd, hfirst+data->vdx, vert2-vert3+data->vdy); + + { struct colinfo *cinfo; + WORD column,xbar,maxx2; + xbar = data->hpos-hfirst + data->cols[0].c->minx - 8; + for (column = 0;column < data->numcols;column++) + { cinfo = data->cols[column].c; + if (cinfo->maxx >= 0) + maxx2 = data->hpos-hfirst + cinfo->maxx; + else + maxx2 = data->mright; + xbar = maxx2; + vert2 = vert3 + vertd - 1; + if ((column < data->numcols-1) && (cinfo->delta > 0)) + xbar += ((cinfo->delta-1) / 2); + if (IS_BAR(column,cinfo) && + ((cinfo->bar & 1) || ((cinfo->bar & 2) && (ent == -1))) && (cinfo->delta > 0)) + { if ((xbar+1 >= data->mleft) && (xbar <= data->mright) && + (xbar+1 >= minx-1) && (xbar <= maxx+1) && + ((column < data->numcols-1) || + ((data->NList_Horiz_Entries <= data->NList_Horiz_Visible + data->NList_Horiz_First) && + (xbar < data->mright - 1 - data->NList_Horiz_First)))) + { if ((xbar >= data->mleft) && (xbar >= minx-1)) + { SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, xbar, vert3); + Draw(data->rp, xbar, vert2); + } + if (!(cinfo->bar & 4) && (xbar+1 <= data->mright) && (xbar+1 <= maxx+1)) + { SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, xbar+1, vert3); + Draw(data->rp, xbar+1, vert2); + } + } + } + } + } + } +#ifdef DO_CLIPPING + if (doclip) + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); +#endif + return (hmax); +} + + + + +/* +#define MPEN_HALFSHINE 1 +#define MPEN_BACKGROUND 2 +#define MPEN_HALFSHADOW 3 +*/ + +void NL_DrawTitleMark(struct NLData *data, LONG xf, WORD yf) +{ + APTR clippinghandle = NULL; + Object *obj = data->this; + + if (!data->NList_PartialChar) + { + clippinghandle = MUI_AddClipping(muiRenderInfo(obj),(WORD) data->vleft,(WORD) data->vtop, + (WORD) data->vwidth,(WORD) data->vheight); + } + + switch (data->NList_TitleMark & MUIV_NList_TitleMark_TypeMask) + { + case MUIV_NList_TitleMark_Down : + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, xf-1, yf); + Draw(data->rp, xf-6, yf); + Draw(data->rp, xf-6, yf+2); + Draw(data->rp, xf-4, yf+4); + SetAPen(data->rp,data->pens[MPEN_HALFSHADOW]); + Move(data->rp, xf-5, yf+1); + Draw(data->rp, xf-1, yf+1); + Move(data->rp, xf-5, yf+2); + Draw(data->rp, xf-1, yf+2); + Move(data->rp, xf-4, yf+3); + Draw(data->rp, xf-2, yf+3); + Draw(data->rp, xf-3, yf+4); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, xf-3, yf+5); + Draw(data->rp, xf, yf+2); + Draw(data->rp, xf, yf); + break; + case MUIV_NList_TitleMark_Up : + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, xf-3, yf); + Draw(data->rp, xf-6, yf+3); + Draw(data->rp, xf-6, yf+5); + SetAPen(data->rp,data->pens[MPEN_HALFSHADOW]); + Move(data->rp, xf-3, yf+1); + Draw(data->rp, xf-4, yf+2); + Draw(data->rp, xf-2, yf+2); + Move(data->rp, xf-5, yf+3); + Draw(data->rp, xf-1, yf+3); + Move(data->rp, xf-5, yf+4); + Draw(data->rp, xf-1, yf+4); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, xf-5, yf+5); + Draw(data->rp, xf, yf+5); + Draw(data->rp, xf, yf+3); + Draw(data->rp, xf-2, yf+1); + break; + case MUIV_NList_TitleMark_Box : + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, xf-2, yf); + Draw(data->rp, xf-5, yf); + Draw(data->rp, xf-5, yf+4); + SetAPen(data->rp,data->pens[MPEN_HALFSHADOW]); + Move(data->rp, xf-4, yf+1); + Draw(data->rp, xf-2, yf+1); + Move(data->rp, xf-4, yf+2); + Draw(data->rp, xf-2, yf+2); + Move(data->rp, xf-4, yf+3); + Draw(data->rp, xf-2, yf+3); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, xf-4, yf+4); + Draw(data->rp, xf-1, yf+4); + Draw(data->rp, xf-1, yf); + break; + case MUIV_NList_TitleMark_Circle : + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, xf-2, yf); + Draw(data->rp, xf-4, yf); + Draw(data->rp, xf-5, yf+1); + Draw(data->rp, xf-5, yf+3); + SetAPen(data->rp,data->pens[MPEN_HALFSHADOW]); + Move(data->rp, xf-4, yf+1); + Draw(data->rp, xf-2, yf+1); + Move(data->rp, xf-4, yf+2); + Draw(data->rp, xf-2, yf+2); + Move(data->rp, xf-4, yf+3); + Draw(data->rp, xf-2, yf+3); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, xf-4, yf+4); + Draw(data->rp, xf-2, yf+4); + Draw(data->rp, xf-1, yf+3); + Draw(data->rp, xf-1, yf+1); + break; + } + + if (!data->NList_PartialChar) + { + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); + } +} + + +void NL_DrawTitleMark2(struct NLData *data, LONG xf, WORD yf) +{ + Object *obj = data->this; + APTR clippinghandle = NULL; + + if (!data->NList_PartialChar) + { + clippinghandle = MUI_AddClipping(muiRenderInfo(obj),(WORD) data->vleft,(WORD) data->vtop, + (WORD) data->vwidth,(WORD) data->vheight); + } + + switch (data->NList_TitleMark2 & MUIV_NList_TitleMark2_TypeMask) + { + case MUIV_NList_TitleMark2_Down : + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, xf-1, yf); + Draw(data->rp, xf-5, yf); + Move(data->rp, xf-5, yf+1); + Draw(data->rp, xf-3, yf+3); + SetAPen(data->rp,data->pens[MPEN_HALFSHADOW]); + Move(data->rp, xf-4, yf+1); + Draw(data->rp, xf-1, yf+1); + Move(data->rp, xf-3, yf+2); + Draw(data->rp, xf-2, yf+2); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, xf-2, yf+3); + Draw(data->rp, xf, yf+1); + Draw(data->rp, xf, yf); + break; + case MUIV_NList_TitleMark2_Up : + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, xf-3, yf); + Draw(data->rp, xf-5, yf+2); + Draw(data->rp, xf-5, yf+3); + SetAPen(data->rp,data->pens[MPEN_HALFSHADOW]); + Move(data->rp, xf-3, yf+1); + Draw(data->rp, xf-2, yf+1); + Move(data->rp, xf-4, yf+2); + Draw(data->rp, xf-1, yf+2); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, xf-4, yf+3); + Draw(data->rp, xf, yf+3); + Draw(data->rp, xf, yf+2); + Draw(data->rp, xf-2, yf); + break; + case MUIV_NList_TitleMark2_Box : + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, xf-2, yf); + Draw(data->rp, xf-4, yf); + Draw(data->rp, xf-4, yf+3); + SetAPen(data->rp,data->pens[MPEN_HALFSHADOW]); + Move(data->rp, xf-3, yf+1); + Draw(data->rp, xf-2, yf+1); + Move(data->rp, xf-3, yf+2); + Draw(data->rp, xf-2, yf+2); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, xf-3, yf+3); + Draw(data->rp, xf-1, yf+3); + Draw(data->rp, xf-1, yf); + break; + case MUIV_NList_TitleMark2_Circle : + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, xf-2, yf); + Draw(data->rp, xf-3, yf); + Draw(data->rp, xf-4, yf+1); + Draw(data->rp, xf-4, yf+2); + SetAPen(data->rp,data->pens[MPEN_HALFSHADOW]); + Move(data->rp, xf-3, yf+1); + Draw(data->rp, xf-2, yf+1); + Move(data->rp, xf-3, yf+2); + Draw(data->rp, xf-2, yf+2); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, xf-3, yf+3); + Draw(data->rp, xf-2, yf+3); + Draw(data->rp, xf-1, yf+2); + Draw(data->rp, xf-1, yf+1); + break; + } + + if (!data->NList_PartialChar) + { + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); + } +} + + +LONG DrawText(struct NLData *data,LONG ent,LONG x,LONG y,LONG minx,LONG maxx,ULONG mypen,LONG dxpermit,BOOL forcepen) +{ + Object *obj = data->this; + struct colinfo *cinfo; + struct affinfo *afinfo; + LONG linelen, next_x=0, x2, x2s, x2e, minx2, maxx2, minx3, maxx3, cmaxx; + WORD xbar,xbar2,ybar,ybar2; + char *ptr1; + struct TextExtent te; + WORD column, curclen, dcurclen, ni; + + if ((ent < -1) || (ent >= data->NList_Entries)) + return (0); + + if (((y - data->voff + data->vinc) < data->vtop) || ((y - data->voff) > data->vbottom)) + { + if (ent > -1) + { + linelen = (LONG) data->EntriesArray[ent]->PixLen; + return (linelen); + } + } + + SetABPenDrMd(data->rp,mypen,data->pens[MPEN_BACKGROUND],JAM1); + + NL_GetDisplayArray(data,ent); + + xbar = x + data->cols[0].c->minx - 8; + + linelen = 0; + for (column = 0;column < data->numcols;column++) + { + cinfo = data->cols[column].c; + + x2 = x + cinfo->minx; + minx2 = x + cinfo->minx; + if (cinfo->maxx >= 0) + { + maxx2 = x + cinfo->maxx; + cmaxx = maxx2; + } + else + { + maxx2 = data->mright; + cmaxx = 100000; + } + + xbar2 = xbar; + xbar = maxx2; + ybar = y - data->voff; + ybar2 = ybar+data->vinc-1; + if (ent == -1) + ybar2 = ybar+data->vdtitleheight-1; + if ((column < data->numcols-1) && (cinfo->delta > 0)) + xbar += ((cinfo->delta-1) / 2); + if (IS_BAR(column,cinfo) && + ((cinfo->bar & 1) || ((cinfo->bar & 2) && (ent == -1))) && (cinfo->delta > 0)) + { + if ((xbar+1 >= data->mleft) && (xbar <= data->mright) && + (xbar+1 >= minx-1) && (xbar <= maxx+1) && + ((column < data->numcols-1) || + ((data->NList_Horiz_Entries <= data->NList_Horiz_Visible + data->NList_Horiz_First) && + (xbar < data->mright - 1 - data->NList_Horiz_First)))) + { + if ((xbar >= data->mleft) && (xbar >= minx-1)) + { + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, xbar, ybar); + Draw(data->rp, xbar, ybar2); + } + if (!(cinfo->bar & 4) && (xbar+1 <= data->mright) && (xbar+1 <= maxx+1)) + { + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, xbar+1, ybar); + Draw(data->rp, xbar+1, ybar2); + } + } + } +/* + if ((ent == -1) && IS_BAR(column,cinfo) && + ((data->NList_TitleMark & MUIV_NList_TitleMark_ColMask) == cinfo->col)) + { + NL_DrawTitleMark(data,xbar-1,ybar); + } + else if ((ent == -1) && IS_BAR(column,cinfo) && + ((data->NList_TitleMark2 & MUIV_NList_TitleMark2_ColMask) == cinfo->col)) + { + NL_DrawTitleMark2(data,xbar-1,ybar); + } +*/ + if (minx2 < data->mleft - data->NList_PartialChar) + minx2 = data->mleft - data->NList_PartialChar; + if (maxx2 > data->mright + data->NList_PartialChar) + maxx2 = data->mright + data->NList_PartialChar; + + if (column+1 < data->numcols) + { + if (minx2 >= maxx2) + continue; + if (minx > maxx2) + continue; + if (maxx < minx2) + continue; + } + minx3 = minx2; + if (minx > minx3) + minx3 = minx; + maxx3 = maxx2; + if (maxx < maxx3) + maxx3 = maxx; + minx3 -= (data->hinc + 2); + maxx3 += (data->hinc + 2); + + if (DontDoColumn(data,ent,column)) + continue; + + ParseColumn(data,column,mypen); + WidthColumn(data,column,0); + + if (IS_HLINE(cinfo->style)) + { + WORD xb1,xb2,yb1,yb2,thick,nothick,xbe1=0,xbe2=0; + + yb1 = ybar; + nothick = thick = 0; + if (IS_HLINE_thick(cinfo->style) && (IS_HLINE_C(cinfo->style) || IS_HLINE_E(cinfo->style))) + thick = 2; + if (IS_HLINE_C(cinfo->style)) + yb1 += (data->vinc-1)/2; + else if (IS_HLINE_E(cinfo->style)) + { + yb1 += (data->vinc-1)/2; + xbe1 = x2 + cinfo->xoffset - 3; + xbe2 = xbe1 + cinfo->colwidth + 4; + } + else if (IS_HLINE_B(cinfo->style)) + yb1 += data->vinc-2; + yb2 = yb1 + 1; + if (thick) + { + yb1 -= 1; + yb2 += 1; + } + else if (IS_HLINE_nothick(cinfo->style)) + { + nothick = 1; + if (IS_HLINE_B(cinfo->style)) + yb1 = yb2; + } + xb1 = xbar2+1; + xb2 = xbar-1; + if (xb1 < minx-1) + xb1 = minx-1; + if (xb2 > maxx+1) + xb2 = maxx+1; + if (xb1 < data->mleft) + xb1 = data->mleft; + if (xb2 > data->mright) + xb2 = data->mright; + if (xb1 < xb2) + { + if (IS_HLINE_E(cinfo->style)) + { + if (xbe1 > xb2) + xbe1 = xb2; + if (xbe2 < xb1) + xbe2 = xb1; + if (xb1 <= xbe1) + { + if (!nothick) + { + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, xb1, yb1); + Draw(data->rp, xbe1, yb1); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, xb1, yb2); + Draw(data->rp, xbe1, yb2); + if (thick) + { + SetAPen(data->rp,data->HLINE_thick_pen); + RectFill(data->rp, xb1, yb1+1, xbe1, yb1+2); + } + } + else + { + SetAPen(data->rp,data->HLINE_thick_pen); + Move(data->rp, xb1, yb1); + Draw(data->rp, xbe1, yb1); + } + } + if (xbe2 <= xb2) + { + if (!nothick) + { SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, xbe2, yb1); + Draw(data->rp, xb2, yb1); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, xbe2, yb2); + Draw(data->rp, xb2, yb2); + if (thick) + { + SetAPen(data->rp,data->HLINE_thick_pen); + RectFill(data->rp, xbe2, yb1+1, xb2, yb1+2); + } + } + else + { + SetAPen(data->rp,data->HLINE_thick_pen); + Move(data->rp, xbe2, yb1); + Draw(data->rp, xb2, yb1); + } + } + } + else + { + if (!nothick) + { + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + Move(data->rp, xb1, yb1); + Draw(data->rp, xb2, yb1); + SetAPen(data->rp,data->pens[MPEN_SHINE]); + Move(data->rp, xb1, yb2); + Draw(data->rp, xb2, yb2); + if (thick) + { + SetAPen(data->rp,data->HLINE_thick_pen); + RectFill(data->rp, xb1, yb1+1, xb2, yb1+2); + } + } + else + { + SetAPen(data->rp,data->HLINE_thick_pen); + Move(data->rp, xb1, yb1); + Draw(data->rp, xb2, yb1); + } + } + } + } + +/* WidthColumn(data,column,0);*/ + + x2 += cinfo->xoffset; + + if (column+1 == data->numcols) + { + if (cinfo->userwidth > 0) + linelen = cinfo->userwidth + cinfo->minx - 1; + else + { + linelen = cinfo->colwidth + cinfo->minx + cinfo->xoffset; + if (IS_ALIGN_CENTER(cinfo->style) && (cinfo->dx > cinfo->colwidth)) + linelen = cinfo->minx + cinfo->dx - 1; + } + if (data->EntriesArray && (ent >= 0)) + data->EntriesArray[ent]->PixLen = linelen; + } + + if ((x2 >= maxx2) || ((x2 + cinfo->colwidth) <= minx2)) + continue; + + x2s = x2; + +/* +{ +int xy, yx; + +D(bug( "BEFORE ==============================>\n" )); + +for( yx = 0; yx <= cinfo->ninfo; yx++ ) +{ + afinfo = &data->aff_infos[yx]; + + D(bug( "Drawing line len: %ld - '", afinfo->len )); + + for( xy = 0; xy < afinfo->len; xy++ ) + D(bug( "%1.1s", &afinfo->strptr[xy] )); + + D(bug( "'\n" )); +} + +D(bug( "<====================================\n" )); +} +*/ + + ni = 0; + afinfo = &data->aff_infos[ni]; + + while ((ni <= cinfo->ninfo) && (afinfo->len > 0) && (x2 < maxx2)) + { + if (afinfo->style == STYLE_TAB) + next_x = ((((x2-x2s) / data->tabsize) + 1) * data->tabsize) + x2s; + else if ((afinfo->style == STYLE_FIXSPACE) || (afinfo->style == STYLE_SPACE)) + next_x = x2 + afinfo->len + afinfo->addinfo + afinfo->addchar; + else if (afinfo->style == STYLE_IMAGE) + { + LONG dx,dx3,x3,dy,dy2; + struct NImgList *nimg = (struct NImgList *) afinfo->strptr; + + x2 += 1; + dx = afinfo->pen & 0x0000FFFF; + dy = 0; + dy2 = (afinfo->pen >> 16) & 0x0000FFFF; + next_x = x2 + afinfo->len + afinfo->addinfo + 1; + x3 = x2; + dx3 = dx; + if ((x3 + dx3) > maxx2) + dx3 = maxx2 - x3; + if (x3 < minx2) + { + dx3 -= (minx2 - x3); + x3 = minx2; + } + + if (nimg && nimg->NImgObj && (dx3 > 0) && (x2 <= maxx) && (next_x > minx)) + { + struct IClass *realclass = OCLASS(obj); + ULONG mad_Flags; + APTR clippinghandle = NULL; + WORD left,top,width,height,ol,ot; + BOOL doclip = FALSE; +/* + * if (muiRenderInfo(obj) != muiRenderInfo(nimg->NImgObj)) + * { + * D(bug("%lx|MRI=%lx img %lx|MRI=%lx\n",obj,muiRenderInfo(obj),nimg->NImgObj,muiRenderInfo(nimg->NImgObj))); + * D(bug("%lx|MAD=%lx img %lx|MAD=%lx\n",obj,muiAreaData(obj),nimg->NImgObj,muiAreaData(nimg->NImgObj))); + * } + */ + if (data->vinc > dy2) + dy = (data->vinc - dy2 + 1)/2; + left = _left(nimg->NImgObj); + top = _top(nimg->NImgObj); + width = _width(nimg->NImgObj); + height = _height(nimg->NImgObj); + ol = _left(nimg->NImgObj) = (WORD) x2; + ot = _top(nimg->NImgObj) = (WORD) (y-data->voff+dy); + if (dx > 0) + _width(nimg->NImgObj) = dx; + else + _width(nimg->NImgObj) = 1; + if (dy2 > 0) + _height(nimg->NImgObj) = dy2; + else + _height(nimg->NImgObj) = data->vinc; + if ((dy2 > data->vinc) || (dx3 < dx) || (_width(nimg->NImgObj) != nimg->width) || (_height(nimg->NImgObj) != nimg->height)) + { + if (dy2 > data->vinc) + { + dy = 0; + _height(nimg->NImgObj) = data->vinc; + ot = _top(nimg->NImgObj) = (WORD) (y-data->voff+dy); + } + doclip = TRUE; + clippinghandle = MUI_AddClipping(muiRenderInfo(obj),(WORD) x3,(WORD) (y-data->voff+dy), + (WORD) dx3,(WORD) data->vinc); + } + data->drawsuper = nimg->NImgObj; + mad_Flags = muiAreaData(obj)->mad_Flags; + OCLASS(obj) = data->ncl; + if (!nimg->ImgName) + { + LONG vinc = (LONG) data->vinc; + + if (afinfo->tag) + { + SetAttrs(nimg->NImgObj, MUIA_NLIMG_EntryCurrent, ent, + MUIA_NLIMG_EntryHeight, vinc, + afinfo->tag, afinfo->tagval, TAG_DONE); + } + else + { + SetAttrs(nimg->NImgObj, MUIA_NLIMG_EntryCurrent, ent, + MUIA_NLIMG_EntryHeight, vinc, TAG_DONE); + } + } +/* + * SetAttrs(nimg->NImgObj, MUIA_Image_State,IDS_SELECTED, + * MUIA_Selected, TRUE, TAG_DONE); + * SetAttrs(nimg->NImgObj, MUIA_Image_State,IDS_NORMAL, + * MUIA_Selected, FALSE, TAG_DONE); + */ + _left(nimg->NImgObj) += nimg->dx; + _top(nimg->NImgObj) += nimg->dy; + if ((data->affbutton >= 0) && (data->affbutton == (LONG)afinfo->button)) + { + if ((data->affbuttonstate == 2) || (data->affbuttonstate == -2)) + { + muiAreaData(nimg->NImgObj)->mad_Flags &= ~MADF_VISIBLE; + SetAttrs(nimg->NImgObj, MUIA_Image_State,IDS_SELECTED, + MUIA_Selected, TRUE, TAG_DONE); + } + data->affbuttonpos.Left = (WORD) x3; + data->affbuttonpos.Top = _top(nimg->NImgObj); + data->affbuttonpos.Width = (WORD) dx3; + data->affbuttonpos.Height = _height(nimg->NImgObj); + + muiAreaData(nimg->NImgObj)->mad_Flags |= MADF_VISIBLE; + + if(xget(nimg->NImgObj, MUIA_Disabled)) + set(nimg->NImgObj, MUIA_Disabled, FALSE); + + MUI_Redraw(nimg->NImgObj,MADF_DRAWALL); + + if ((data->affbuttonstate == 2) || (data->affbuttonstate == -2)) + { + muiAreaData(nimg->NImgObj)->mad_Flags &= ~MADF_VISIBLE; + SetAttrs(nimg->NImgObj, MUIA_Image_State,IDS_NORMAL, + MUIA_Selected, FALSE, TAG_DONE); + } + } + else + { + muiAreaData(nimg->NImgObj)->mad_Flags |= MADF_VISIBLE; + + if(xget(nimg->NImgObj, MUIA_Disabled)) + set(nimg->NImgObj, MUIA_Disabled, FALSE); + + MUI_Redraw(nimg->NImgObj,MADF_DRAWALL); + } + nimg->dx = _left(nimg->NImgObj) - ol; + nimg->dy = _top(nimg->NImgObj) - ot; + + muiAreaData(obj)->mad_Flags = mad_Flags; + OCLASS(obj) = realclass; + data->drawsuper = NULL; + if (doclip) + { + doclip = FALSE; + MUI_RemoveClipping(muiRenderInfo(obj),clippinghandle); + _width(nimg->NImgObj) = width; + _height(nimg->NImgObj) = height; + } + _left(nimg->NImgObj) = left; + _top(nimg->NImgObj) = top; + } + SetABPenDrMd(data->rp,afinfo->pen,data->pens[MPEN_BACKGROUND],JAM1); + ReSetFont; + } + else if (afinfo->style == STYLE_IMAGE2) + { + LONG dx,dx2,dy,dy2; + + x2 += 1; + dx = afinfo->pen & 0x0000FFFF; + dx2 = 0; + dy = 0; + dy2 = (afinfo->pen >> 16) & 0x0000FFFF; + next_x = x2 + afinfo->len + afinfo->addinfo + 1; + if ((x2 + dx) > maxx2) + dx = maxx2 - x2; + if (x2 < minx2) + { + dx2 = minx2 - x2; + x2 += dx2; + dx -= dx2; + } + if ((dx > 0) && (x2 <= maxx) && (next_x > minx) && afinfo->strptr) + { + struct BitMapImage *bmimg = (struct BitMapImage *) afinfo->strptr; + + if (data->vinc > dy2) + dy = (data->vinc - dy2 + 1)/2; + BltMaskBitMapRastPort(&(bmimg->imgbmp), (WORD) dx2, (WORD) 0, + data->rp, (WORD) x2, (WORD) (y-data->voff+dy), + (WORD) dx, (WORD) dy2, (UBYTE) (ABC|ABNC|ANBC),bmimg->mask); + } + SetABPenDrMd(data->rp,afinfo->pen,data->pens[MPEN_BACKGROUND],JAM1); + SetDrPt(data->rp,(UWORD)~0); + } + else + { + // we are having normal text in afinfo->strptr now, so lets + // go and figure out if all of it fits in the current column or + // if we have to strip it. + + // set foreground pen + if (forcepen) + SetAPen(data->rp,mypen); + else + SetAPen(data->rp,afinfo->pen); + + // set any softstyle in case the user text contains it + SetSoftStyle(data->rp, GET_STYLE(afinfo->style), STYLE_MASK); + + if (afinfo->addchar > 0) + data->rp->TxSpacing = afinfo->addchar; + + // figure out the pixel constraints the current text would require + curclen = afinfo->len; + ptr1 = afinfo->strptr; + TextExtent(data->rp, ptr1, curclen, &te); + if ((ni == 0) && (te.te_Extent.MinX < 0)) + x2 -= te.te_Extent.MinX; + + // save the coordinate of the next column start + next_x = x2 + te.te_Width + afinfo->addinfo; + D(DBF_DRAW, "next_x: %ld cmaxx: %ld"); + + // save the coordinate where the current column ends in x2e + x2e = x2 + te.te_Width; + + ////////////// + // from now on we try to figure out from where to where we are going + // to strip the text in case it doesn't completely fit into the + // current column + + // continue only if the start of the column (x2) does not exceed + // the maximum field of view in x direction + if((x2 < maxx2) && (x2 + te.te_Extent.MaxX > minx2)) + { + int x2diff = 0; + + D(DBF_DRAW, "curclen: %ld ptr1: '%4.4s'", curclen, ptr1); + D(DBF_DRAW, "x2: %ld x2e: %ld maxx: %ld maxx2: %ld maxx3: %ld minx: %ld minx2: %ld minx3: %ld", x2, x2e, maxx, maxx2, maxx3, minx, minx2, minx3); + + // check if the coordinate of the END of the string (x2e) does + // not fit into the available regions (maximum x = maxx3). And + // if so we go and calculate a new curclen + if((curclen > 0) && (x2e > maxx3)) + { + curclen = TextFit(data->rp, ptr1, curclen, &te, NULL, 1, maxx3 - x2, 32767); + if(curclen > 0) + { + // find out the new end position of the string (x2e) + TextExtent(data->rp, ptr1, curclen, &te); + x2e = x2 + te.te_Width; + + D(DBF_DRAW, "RIGHT: x2: %ld x2e: %ld", x2, x2e); + } + } + + // check if the coordinate of the START of the string (x2) does + // not fit into the available minimal x position (minx3). And if so, + // we go and calculate a new curclen + if((curclen > 0) && (x2 < minx3)) + { + dcurclen = TextFit(data->rp, ptr1, curclen, &te, NULL, 1, minx3 - x2, 32767); + curclen -= dcurclen; + + if(curclen > 0) + { + // move the start of the string by the number of characters + // we had to reduce the amount of characters displayed + ptr1 += dcurclen; + x2 += te.te_Width; + x2diff += te.te_Width; + + // find out the new end position of the string (x2e) + TextExtent(data->rp, ptr1, curclen, &te); + x2e = x2 + te.te_Width; + + D(DBF_DRAW, "LEFT: x2: %ld x2e: %ld", x2, x2e); + } + } + + if (curclen > 0) + { + TextExtent(data->rp, &ptr1[curclen-1], 1, &te); + x2e -= te.te_Width; + + /* throw away chars on the right that souldn't be draw because out of list */ + while ((curclen > 0) && ((x2e + te.te_Extent.MaxX) > maxx2)) + { + curclen--; + if (curclen > 0) + { + TextExtent(data->rp, &ptr1[curclen-1], 1, &te); + x2e -= te.te_Width; + } + } + + /* throw away chars on the right that i don't want to draw because out of maxx */ + if (dxpermit) + { + while ((curclen > 0) && ((x2e + te.te_Extent.MinX) > maxx)) + { + curclen--; + if (curclen > 0) + { + TextExtent(data->rp, &ptr1[curclen-1], 1, &te); + x2e -= te.te_Width; + } + } + } + else + { + while ((curclen > 0) && (x2e > maxx)) + { + curclen--; + if (curclen > 0) + { + TextExtent(data->rp, &ptr1[curclen-1], 1, &te); + x2e -= te.te_Width; + } + } + } + } + + if (curclen > 0) + { + TextExtent(data->rp, ptr1, 1, &te); + + /* throw away chars on the left that souldn't be draw because out of list */ + while ((curclen > 0) && ((x2 + te.te_Extent.MinX) < minx2)) + { + x2 += te.te_Width; + x2diff += te.te_Width; + ptr1++; + curclen--; + TextExtent(data->rp, ptr1, 1, &te); + } + + /* throw away chars on the left that i don't want to draw because out of minx */ + if (dxpermit) + { + while ((curclen > 0) && ((x2 + te.te_Extent.MaxX) < minx)) + { + x2 += te.te_Width; + x2diff += te.te_Width; + ptr1++; + curclen--; + TextExtent(data->rp, ptr1, 1, &te); + } + } + else + { + while ((curclen > 0) && ((x2+te.te_Width) <= minx)) + { + x2 += te.te_Width; + x2diff += te.te_Width; + ptr1++; + curclen--; + TextExtent(data->rp, ptr1, 1, &te); + } + } + } + + D(DBF_DRAW, "x2: %ld x2e: %ld cmaxx: %ld next_x: %ld cinfo->minx: %ld cinfo->maxx: %ld ", x2, x2e, cmaxx, next_x, cinfo->minx, cinfo->maxx); + + if(curclen > 0) + { + Move(data->rp, x2, y); + + // before we draw the text we check if it was clipped and if so + // we add "..." at the right position in case the PartialCol + // feature is turned on at all + if(data->NList_PartialCol && cinfo->partcolsubst != PCS_DISABLED && + next_x > cmaxx && (xbar-1 >= data->mleft) && (xbar-1 <= data->mright)) + { + int txtlen; + int clen; // number of pixels the current text has for positioning it + char *txt; + + // first we get the extent of the "..." text we are going to add + TextExtent(data->rp, "...", 3, &te); + + // if this is only a refresh of one/two chars because the user + // is resizing the column we need to use a different clen + clen = cmaxx - (x2 - x2diff); + + // only continue of the column fits the minimum of the three dots + // at all + if(clen >= te.te_Width) + { + int cstart = 0; + + D(DBF_DRAW, "c1: %ld, c2: %ld x2: %ld x2e: %ld cmaxx: %ld minx3: %ld x2diff: %ld | %ld'%s'", cinfo->maxx-cinfo->minx, cmaxx-(x2-x2diff), x2, x2e, cmaxx, minx3, x2diff, next_x, afinfo->strptr); + + D(DBF_DRAW, "clen: %ld afinfo->len: %ld str: %08lx ('%s')", clen, afinfo->len, afinfo->strptr, afinfo->strptr); + + // now that we add "..." at the right, left or center of the string we have to calculate the + // TextExtent() in a kind of iterative process so that we identify at which point we need to + // add our substitution "..." text. + txtlen = strlen(afinfo->strptr); + txt = AllocVecPooled(data->Pool, txtlen+3+1); + txt[0] = '\0'; // NUL terminate string to always use strlcat + + if(cinfo->partcolsubst == PCS_LEFT) + { + snprintf(txt, afinfo->len+3+1, "...%s", afinfo->strptr); + } + else if(cinfo->partcolsubst == PCS_RIGHT) + { + snprintf(txt, afinfo->len+3+1, "%s...", afinfo->strptr); + } + else if(cinfo->partcolsubst == PCS_CENTER) + { + strlcpy(txt, afinfo->strptr, txtlen/2); + strlcat(txt, "...", txtlen/2+3); + strlcat(txt, &afinfo->strptr[txtlen/2], txtlen+3+1); + + cstart = txtlen/2-1; + } + + // get the new string length + txtlen = strlen(txt); + + do + { + TextExtent(data->rp, txt, txtlen, &te); + + D(DBF_DRAW, "te: %ld %ld: '%s'", te.te_Width, clen, txt); + if(te.te_Width <= clen) + break; + + if(cinfo->partcolsubst == PCS_LEFT) + { + // move the text after the first "..." one to the left + // thus, actually moving the text start + memmove(&txt[3], &txt[4], txtlen+1); + } + else if(cinfo->partcolsubst == PCS_RIGHT) + { + // move the "..." text one char to the left + txt[txtlen-1] = '\0'; + txt[txtlen-4] = '.'; + } + else if(cinfo->partcolsubst == PCS_CENTER) + { + // we strip text from the center but alternating + // from the left portion and the from the right + // portion around the "..." text + if(txtlen % 2 == 0) + { + // move all text starting AT "..." one char to the left + D(DBF_DRAW, "cstart: '%s'", &txt[cstart]); + memmove(&txt[cstart-1], &txt[cstart], strlen(&txt[cstart])+1); + cstart--; + } + else + { + // move all text starting AFTER "..." one char to the left + memmove(&txt[cstart+3], &txt[cstart+3+1], strlen(&txt[cstart+3+1])+1); + } + } + + txtlen--; + } + while(TRUE); + + D(DBF_DRAW, "curclen: %ld txtlen: %ld, %ld: '%s' '%s'", curclen, txtlen, ptr1-afinfo->strptr, ptr1, txt); + + // calculate the len diff between afinfo->strptr and txt so that resizing + // a column does redraw the right thing. + if((ptr1-afinfo->strptr) > 0) + { + Text(data->rp, &txt[ptr1-afinfo->strptr], curclen); + D(DBF_DRAW, "argh: %ld %ld '%s'", x2, curclen, &txt[ptr1-afinfo->strptr]); + } + else + Text(data->rp, txt, txtlen); + + FreeVecPooled(data->Pool, txt); + } + } + else + Text(data->rp, ptr1, curclen); + + D(DBF_DRAW, "draw text4: %ld %ld %ld %ld %ld - %ld>%ld '%s'", curclen, x2, next_x, maxx2, cmaxx, ni+1, cinfo->ninfo, ptr1); + +/* +{ +int xy; + +D(bug( "Drawing line len: %ld, x: %ld, y: %ld - '", curclen, x2, y )); + +for( xy = 0; xy < curclen; xy++ ) +{ + D(bug( "%1.1s", &ptr1[xy] )); } + D(bug( "'\n" )); +} + +{ +char txt[100]; + +snprintf( txt, sizeof(txt), "Drawing line len: %ld, x: %ld, y: %ld - '%%%ld.%lds'", curclen, x2, y, curclen, curclen ); +D(bug( txt, ptr1 )); +} +*/ + } + } + + if (afinfo->addchar > 0) + data->rp->TxSpacing = 0; + } + + x2 = next_x; + ni++; + afinfo = &data->aff_infos[ni]; + } + + if(data->NList_PartialCol && cinfo->partcolsubst == PCS_DISABLED && + (x2 > cmaxx) && (xbar-1 >= data->mleft) && (xbar-1 <= data->mright)) + { + WORD yb; + + SetAPen(data->rp,data->pens[MPEN_SHINE]); + for (yb = ybar+1; yb < ybar2; yb += 2) + WritePixel(data->rp, xbar-1, yb); + SetAPen(data->rp,data->pens[MPEN_SHADOW]); + for (yb = ybar+2; yb < ybar2; yb += 2) + WritePixel(data->rp, xbar-1, yb); + } + + if ((ent == -1) && IS_BAR(column,cinfo) && + ((data->NList_TitleMark & MUIV_NList_TitleMark_ColMask) == cinfo->col)) + { + NL_DrawTitleMark(data,xbar-1,ybar); + } + else if ((ent == -1) && IS_BAR(column,cinfo) && + ((data->NList_TitleMark2 & MUIV_NList_TitleMark2_ColMask) == cinfo->col)) + { + NL_DrawTitleMark2(data,xbar-1,ybar); + } + if ((ent == -1) && !IS_BAR(column,cinfo) && + ((data->NList_TitleMark & MUIV_NList_TitleMark_ColMask) == cinfo->col)) + { + NL_DrawTitleMark(data,next_x+6,ybar); + } + else if ((ent == -1) && !IS_BAR(column,cinfo) && + ((data->NList_TitleMark2 & MUIV_NList_TitleMark2_ColMask) == cinfo->col)) + { + NL_DrawTitleMark2(data,next_x+6,ybar); + } + } + SetSoftStyle(data->rp, 0, STYLE_MASK); + + return (linelen); +} + + +static LONG DrawEntryTextOnly(struct NLData *data,struct RastPort *rp,LONG ent,LONG col,UNUSED LONG x,LONG y,LONG minx,LONG maxx,ULONG mypen,BOOL draw) +{ + struct colinfo *cinfo; + struct affinfo *afinfo; + LONG next_x, x2, x2e,column; + STRPTR ptr1; + struct TextExtent te; + WORD curclen, dcurclen, ni; + + NL_GetDisplayArray(data,ent); + + column = NL_ColToColumn(data,col); + if (column < 0) + return (0); + + cinfo = data->cols[column].c; + + if (!DontDoColumn(data,ent,column)) + { + ParseColumn(data,column,mypen); + WidthColumn(data,column,0); + x2 = 1; + + ni = 0; + afinfo = &data->aff_infos[ni]; + + while ((ni <= cinfo->ninfo) && (afinfo->len > 0) && (x2 < maxx)) + { + if ((afinfo->style == STYLE_TAB) || (afinfo->style == STYLE_FIXSPACE) || (afinfo->style == STYLE_SPACE)) + next_x = x2 + data->spacesize; + else if ((afinfo->style == STYLE_IMAGE) || (afinfo->style == STYLE_IMAGE2)) + next_x = x2 + 2; + else + { + SetAPen(rp,afinfo->pen); + SetSoftStyle(rp, GET_STYLE(afinfo->style), STYLE_MASK); + + rp->TxSpacing = 0; + + curclen = afinfo->len; + ptr1 = afinfo->strptr; + + TextExtent(rp, ptr1, curclen, &te); + if ((ni == 0) && (te.te_Extent.MinX < 0)) + x2 -= te.te_Extent.MinX; + next_x = x2 + te.te_Width; + x2e = x2 + te.te_Width; + + if ((x2 < maxx) && (x2 + te.te_Extent.MaxX > minx)) + { /* skip most of unwanted chars on the right */ + if ((curclen > 0) && (x2e > maxx)) + { dcurclen = te.te_Extent.MaxX - te.te_Width - te.te_Extent.MinX +2; + curclen = TextFit(rp, ptr1, curclen, &te, NULL,1,maxx - x2 + dcurclen,32767); + if (curclen > 0) + { TextExtent(rp, ptr1, curclen, &te); + x2e = x2 + te.te_Width; + } + } + if (curclen > 0) + { TextExtent(rp, &ptr1[curclen-1], 1, &te); + x2e -= te.te_Width; + /* throw away chars on the right that souldn't be draw because out of list */ + while ((curclen > 0) && ((x2e + te.te_Extent.MaxX) > maxx)) + { curclen--; + if (curclen > 0) + { TextExtent(rp, &ptr1[curclen-1], 1, &te); + x2e -= te.te_Width; + } + } + } + if((curclen > 0) && draw) + { + Move(rp, x2, y); + Text(rp, ptr1, curclen); + } + } + } + x2 = next_x; + ni++; + afinfo = &data->aff_infos[ni]; + } + SetSoftStyle(rp, 0, STYLE_MASK); + return (x2); + } + return (0); +} + + +LONG DrawDragText(struct NLData *data,BOOL draw) +{ + Object *obj = data->this; + struct TextExtent te; + struct RastPort *rp; + LONG curclen,x,w; + + if (draw) + rp = data->DragRPort; + else + rp = data->rp; + if (rp && data->DragText) + { + char *text = data->DragText; + + x = 0; + if (draw) + { + data->DragText = NULL; + data->DragEntry = -1; + SetBackGround(MUII_myListCursor); + _rp(obj) = data->DragRPort; + _left(obj) = 0; + _top(obj) = 0; + _width(obj) = data->DragWidth; + _height(obj) = data->DragHeight; + DoMethod(obj,MUIM_DrawBackground,(LONG) 0,(LONG) 0, + (LONG) data->DragWidth,(LONG) data->DragHeight, + (LONG) 0,(LONG) 0,(LONG) 0); + _rp(obj) = data->rp; + _left(obj) = data->left; + _top(obj) = data->top; + _width(obj) = data->width; + _height(obj) = data->height; + SetABPenDrMd(data->DragRPort,MUIPEN(data->NList_CursorPen),data->pens[MPEN_BACKGROUND],JAM1); + } + SetSoftStyle(rp, 0, STYLE_MASK); + curclen = strlen(text); + curclen = TextFit(rp, text, curclen, &te, NULL,1,data->DragWidth,32767); + if (te.te_Extent.MinX < 0) + x -= te.te_Extent.MinX; + w = te.te_Extent.MaxX - te.te_Extent.MinX; + if (draw) + { + if (w < data->DragWidth) + x += ((data->DragWidth - w) / 2); + if (curclen > 0) + { + Move(rp, x, data->voff); + Text(rp, text, curclen); + } + } + return (w); + } + else if (rp && (data->DragEntry >= 0) && (data->NList_DragColOnly >= 0)) + { + LONG ent = data->DragEntry; + + if (draw) + { + data->DragText = NULL; + data->DragEntry = -1; + SetBackGround(MUII_myListCursor); + _rp(obj) = data->DragRPort; + _left(obj) = 0; + _top(obj) = 0; + _width(obj) = data->DragWidth; + _height(obj) = data->DragHeight; + DoMethod(obj,MUIM_DrawBackground,(LONG) 0,(LONG) 0, + (LONG) data->DragWidth,(LONG) data->DragHeight, + (LONG) 0,(LONG) 0,(LONG) 0); + _rp(obj) = data->rp; + _left(obj) = data->left; + _top(obj) = data->top; + _width(obj) = data->width; + _height(obj) = data->height; + } + w = DrawEntryTextOnly(data,rp,ent,data->NList_DragColOnly,0,data->voff,0,data->DragWidth,MUIPEN(data->NList_CursorPen),draw); + if (w > data->DragWidth) + w = data->DragWidth; + return (w); + } + else + { data->DragText = NULL; + data->DragEntry = -1; + } + return (4); +} + + +void DisposeDragRPort(struct NLData *data) +{ + if(data->DragRPort != NULL) + { + struct BitMap *bm = data->DragRPort->BitMap; + + FreeVecPooled(data->Pool, data->DragRPort); + data->DragRPort = NULL; + + if(bm != NULL) + { + WaitBlit(); + FreeBitMap(bm); + } + } +} + + +struct RastPort *CreateDragRPort(struct NLData *data,LONG numlines,LONG first,LONG last) +{ + Object *obj = data->this; + + if(last >= first) + { + data->DragWidth = data->mwidth; + data->DragHeight = data->vinc * numlines; + + return NULL; + } + else + { + static char text[40]; + + data->DragHeight = data->vinc; + data->DragWidth = data->mwidth; + + if(data->NList_DragColOnly < 0) + { + if(numlines == 1) + strlcpy(text, "Dragging one item...", sizeof(text)); + else + snprintf(text, sizeof(text), "Dragging %ld items...", (long)numlines); + + data->DragText = text; + data->DragEntry = -1; + } + else + { + if(numlines != 1) + { + snprintf(text, sizeof(text), "%ld items.", (long)numlines); + + data->DragText = text; + data->DragEntry = -1; + } + else if(data->NList_DragLines == 1) + { + strlcpy(text, "1 item.", sizeof(text)); + + data->DragText = text; + data->DragEntry = -1; + } + else + { + data->DragText = NULL; + data->DragEntry = first; + } + + data->DragWidth = DrawDragText(data, FALSE); + } + } + + if(data->DragRPort == NULL && + ((data->DragRPort = (struct RastPort *)AllocVecPooled(data->Pool, sizeof(struct RastPort)))) != NULL) + { + struct BitMap *fbm = _window(obj)->RPort->BitMap; + + InitRastPort(data->DragRPort); + + if((data->DragRPort->BitMap = AllocBitMap((ULONG)data->DragWidth, (ULONG)data->DragHeight, GetBitMapAttr(fbm, BMA_DEPTH), BMF_MINPLANES, fbm)) != NULL) + { + struct IClass *realclass = OCLASS(obj); + + SetFont(data->DragRPort,data->font); + OCLASS(obj) = data->ncl; + REDRAW_FORCE; + OCLASS(obj) = realclass; + + return data->DragRPort; + } + else + { + FreeVecPooled(data->Pool, data->DragRPort); + data->DragRPort = NULL; + } + } + + return NULL; +} + diff --git a/workbench/classes/zune/nlist/nlist_mcc/Pointer.c b/workbench/classes/zune/nlist/nlist_mcc/Pointer.c new file mode 100644 index 0000000000..63bc36873c --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/Pointer.c @@ -0,0 +1,715 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <string.h> + +#include <clib/alib_protos.h> + +#include <exec/execbase.h> +#include <intuition/pointerclass.h> + +#include <proto/utility.h> +#include <proto/intuition.h> +#include <proto/exec.h> +#include <proto/graphics.h> + +#include "private.h" +#include "Debug.h" + +// the meta data of our pointers +#define sizePointerWidth 16 +#define sizePointerHeight 16 +#define sizePointerXOffset -8 +#define sizePointerYOffset -8 + +#define movePointerWidth 14 +#define movePointerHeight 6 +#define movePointerXOffset -7 +#define movePointerYOffset -3 + +#define selectPointerWidth 7 +#define selectPointerHeight 16 +#define selectPointerXOffset -3 +#define selectPointerYOffset -8 + +#if defined(__amigaos4__) +// a 32bit ARGB pointer image where we can define every color of the pixels +// on our own and put an alpha-channel information in it as well. +static const ULONG sizePointer[] = +{ + /* ......++++...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ...++.+##+.++... */ 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + /* ..+#+.+##+.+#+.. */ 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + /* .+##+++##+++##+. */ 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, + /* +##############+ */ 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + /* +##############+ */ 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, + /* .+##+++##+++##+. */ 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, + /* ..+#+.+##+.+#+.. */ 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, + /* ...++.+##+.++... */ 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......+##+...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xff000000, 0xff000000, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + /* ......++++...... */ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static const ULONG movePointer[] = +{ + /* ..#########... */ 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + /* .##+++++++##.. */ 0x00000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xffffffff, 0xffffffff, 0x00000000, 0x00000000, + /* ###+......###. */ 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0x00000000, + /* .##+......##++ */ 0x00000000, 0xffffffff, 0xffffffff, 0xff000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, + /* ..#########++. */ 0x00000000, 0x00000000, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, 0xff000000, 0x00000000, + /* ...+++++++++.. */ 0x00000000, 0x00000000, 0x00000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0xff000000, 0x00000000, 0x00000000, +}; + +static const ULONG selectPointer[] = +{ + 0xff6d6d6d, 0xff000000, 0x00000000, 0x00000000, 0xffbbbbbb, 0xff6d6d6d, 0xff000000, // +# :+# + 0x00000000, 0xffbbbbbb, 0xff000000, 0xffbbbbbb, 0xff000000, 0x00000000, 0x00000000, // :#:# + 0x00000000, 0x00000000, 0xffbbbbbb, 0xff000000, 0x00000000, 0x00000000, 0x00000000, // :# + 0x00000000, 0x00000000, 0xffbbbbbb, 0xff000000, 0x00000000, 0x00000000, 0x00000000, // :# + 0x00000000, 0x00000000, 0xffbbbbbb, 0xff000000, 0x00000000, 0x00000000, 0x00000000, // :# + 0x00000000, 0x00000000, 0xffbbbbbb, 0xff000000, 0x00000000, 0x00000000, 0x00000000, // :# + 0x00000000, 0x00000000, 0xffbbbbbb, 0xff000000, 0x00000000, 0x00000000, 0x00000000, // :# + 0x00000000, 0x00000000, 0xffbbbbbb, 0xff000000, 0x00000000, 0x00000000, 0x00000000, // :# + 0x00000000, 0xffbbbbbb, 0xff000000, 0xff000000, 0xff000000, 0x00000000, 0x00000000, // :### + 0x00000000, 0x00000000, 0xffbbbbbb, 0xff000000, 0x00000000, 0x00000000, 0x00000000, // :# + 0x00000000, 0x00000000, 0xffbbbbbb, 0xff000000, 0x00000000, 0x00000000, 0x00000000, // :# + 0x00000000, 0x00000000, 0xffbbbbbb, 0xff000000, 0x00000000, 0x00000000, 0x00000000, // :# + 0x00000000, 0x00000000, 0xffbbbbbb, 0xff000000, 0x00000000, 0x00000000, 0x00000000, // :# + 0x00000000, 0x00000000, 0xffbbbbbb, 0xff000000, 0x00000000, 0x00000000, 0x00000000, // :# + 0x00000000, 0xffbbbbbb, 0xff000000, 0xffbbbbbb, 0xff000000, 0x00000000, 0x00000000, // :#:# + 0xff6d6d6d, 0xff000000, 0x00000000, 0x00000000, 0xffbbbbbb, 0xff6d6d6d, 0xff000000, // +# :+# +}; + +#ifndef POINTERA_ImageData +#define POINTERA_ImageData (POINTERA_Dummy + 0x07) // ARGB (width * height * sizeof(ULONG)) +#endif +#ifndef POINTERA_Width +#define POINTERA_Width (POINTERA_Dummy + 0x08) // <= 64 +#endif +#ifndef POINTERA_Height +#define POINTERA_Height (POINTERA_Dummy + 0x09) // <= 64 +#endif + +#else // __amigaos4__ + +#if defined(__MORPHOS__) +#ifndef POINTERTYPE_SELECTTEXT +#define POINTERTYPE_SELECTTEXT 7 +#define POINTERTYPE_HORIZONTALRESIZE 11 +#define POINTERTYPE_MOVE 14 +#endif +#ifndef WA_PointerType +#define WA_PointerType (WA_Dummy + 164) +#endif +#endif + +static const UWORD sizePointer[] = +{ +//plane1 plane2 + 0x0000, 0x0000, + + 0x03c0, 0x0000, + 0x0240, 0x0180, + 0x0240, 0x0180, + 0x0240, 0x0180, + 0x1a58, 0x0180, + 0x2a54, 0x1008, + 0x4e72, 0x300c, + 0x8001, 0x7ffe, + 0x8001, 0x7ffe, + 0x4e72, 0x300c, + 0x2a54, 0x0180, + 0x1a58, 0x0180, + 0x0240, 0x0180, + 0x0240, 0x0180, + 0x0240, 0x0180, + 0x03c0, 0x0000, + + 0x0000, 0x0000 +}; + +static const UWORD movePointer[] = +{ +//plane1 plane2 + 0x0000, 0x0000, + + 0x3fe0, 0x0000, + 0x6030, 0x1fc0, + 0xe038, 0x1000, + 0x6030, 0x100c, + 0x3fe0, 0x0018, + 0x0000, 0x1ff0, + + 0x0000, 0x0000 +}; + +static const UWORD selectPointer[] = +{ +//plane1 plane2 + 0x0000, 0x0000, + + 0x8800, 0x4600, + 0x5000, 0x2800, + 0x2000, 0x1000, + 0x2000, 0x1000, + 0x2000, 0x1000, + 0x2000, 0x1000, + 0x2000, 0x1000, + 0x2000, 0x1000, + 0x4000, 0x3800, + 0x2000, 0x1000, + 0x2000, 0x1000, + 0x2000, 0x1000, + 0x2000, 0x1000, + 0x2000, 0x1000, + 0x5000, 0x2800, + 0x8800, 0x4600, + + 0x0000, 0x0000 +}; + +#endif // __amigaos4__ + +// Classic bitmap data for the pointers. These will be used for OS4 aswell, +// if the graphic card cannot handle 32bit pointers. + +// the size pointer +static const UWORD sizePointer_bp0[] = +{ + /* ......++++...... */ 0x03c0, + /* ......+..+...... */ 0x0240, + /* ......+..+...... */ 0x0240, + /* ......+..+...... */ 0x0240, + /* ...++.+..+.++... */ 0x1a58, + /* ..+.+.+..+.+.+.. */ 0x2a54, + /* .+..+++..+++..+. */ 0x4e72, + /* +..............+ */ 0x8001, + /* +..............+ */ 0x8001, + /* .+..+++..+++..+. */ 0x4e72, + /* ..+.+.+..+.+.+.. */ 0x2a54, + /* ...++.+..+.++... */ 0x1a58, + /* ......+..+...... */ 0x0240, + /* ......+..+...... */ 0x0240, + /* ......+..+...... */ 0x0240, + /* ......++++...... */ 0x03c0, +}; + +static const UWORD sizePointer_bp1[] = +{ + /* ................ */ 0x0000, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* ...#...##...#... */ 0x1188, + /* ..##...##...##.. */ 0x318c, + /* .##############. */ 0x7ffe, + /* .##############. */ 0x7ffe, + /* ..##...##...##.. */ 0x318c, + /* ...#...##...#... */ 0x1188, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* .......##....... */ 0x0180, + /* ................ */ 0x0000, +}; + +static const UWORD sizePointer_bp2[] = +{ + /* ......++++...... */ 0x03c0, + /* ......+##+...... */ 0x03c0, + /* ......+##+...... */ 0x03c0, + /* ......+##+...... */ 0x03c0, + /* ...++.+##+.++... */ 0x1bd8, + /* ..+#+.+##+.+#+.. */ 0x3bdc, + /* .+##+++##+++##+. */ 0x7ffe, + /* +##############+ */ 0xffff, + /* +##############+ */ 0xffff, + /* .+##+++##+++##+. */ 0x7ffe, + /* ..+#+.+##+.+#+.. */ 0x3bdc, + /* ...++.+##+.++... */ 0x1bd8, + /* ......+##+...... */ 0x03c0, + /* ......+##+...... */ 0x03c0, + /* ......+##+...... */ 0x03c0, + /* ......++++...... */ 0x03c0, +}; + +static struct BitMap sizePointerBitmap = +{ + 2, 16, 0, 2, 0, + { (PLANEPTR)sizePointer_bp0, (PLANEPTR)sizePointer_bp1, NULL, NULL, NULL, NULL, NULL, NULL } +}; + +// the move pointer +static const UWORD movePointer_bp0[] = +{ + 0x3fe0, // ..#########..... + 0x6030, // .##.......##.... + 0xe038, // ###.......###... + 0x6030, // .##.......##.... + 0x3fe0, // ..#########..... + 0x0000 // ................ +}; + +static const UWORD movePointer_bp1[] = +{ + 0x0000, // ................ + 0x1fc0, // ...#######...... + 0x1000, // ...#............ + 0x100c, // ...#........##.. + 0x0018, // ...........##... + 0x1ff0 // ...#########.... +}; + +static const UWORD movePointer_bp2[] = +{ + 0x3fe0, // ..%%%%%%%%%..... + 0x7ff0, // .%%#######%%.... + 0xf038, // %%%#......%%%... + 0x703c, // .%%#......%%##.. + 0x3ffc, // ..%%%%%%%%%##... + 0x0000 // ...#########.... +}; + +static struct BitMap movePointerBitmap = +{ + 2, 6, 0, 2, 0, + { (PLANEPTR)movePointer_bp0, (PLANEPTR)movePointer_bp1, NULL, NULL, NULL, NULL, NULL, NULL } +}; + + +// the selection pointer +static const UWORD selectPointer_bp0[] = +{ + 0x8800, // #...#........... + 0x5000, // .#.#............ + 0x2000, // ..#............. + 0x2000, // ..#............. + 0x2000, // ..#............. + 0x2000, // ..#............. + 0x2000, // ..#............. + 0x2000, // ..#............. + 0x4000, // .#.............. + 0x2000, // ..#............. + 0x2000, // ..#............. + 0x2000, // ..#............. + 0x2000, // ..#............. + 0x2000, // ..#............. + 0x5000, // .#.#............ + 0x8800, // #...#........... +}; + +static const UWORD selectPointer_bp1[] = +{ + 0x4600, // .#...##......... + 0x2800, // ..#.#........... + 0x1000, // ...#............ + 0x1000, // ...#............ + 0x1000, // ...#............ + 0x1000, // ...#............ + 0x1000, // ...#............ + 0x1000, // ...#............ + 0x3800, // ..###........... + 0x1000, // ...#............ + 0x1000, // ...#............ + 0x1000, // ...#............ + 0x1000, // ...#............ + 0x1000, // ...#............ + 0x2800, // ..#.#........... + 0x4600, // .#...##......... +}; + +static const UWORD selectPointer_bp2[] = +{ + 0xce00, // %#..%##......... + 0x7800, // .%#%#........... + 0x3000, // ..%#............ + 0x3000, // ..%#............ + 0x3000, // ..%#............ + 0x3000, // ..%#............ + 0x3000, // ..%#............ + 0x3000, // ..%#............ + 0x7800, // .%%%#........... + 0x3000, // ..%#............ + 0x3000, // ..%#............ + 0x3000, // ..%#............ + 0x3000, // ..%#............ + 0x3000, // ..%#............ + 0x7800, // .%#%#........... + 0xce00, // %#..%##......... +}; + +static struct BitMap selectPointerBitmap = +{ + 2, 16, 0, 2, 0, + { (PLANEPTR)selectPointer_bp0, (PLANEPTR)selectPointer_bp1, NULL, NULL, NULL, NULL, NULL } +}; + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#endif + +static void IdentifyPointerColors(Object *obj) +{ + ULONG i; + ULONG colors[3*3]; + LONG blackDiff[3]; + LONG whiteDiff[3]; + LONG blackIndex; + LONG whiteIndex; + + ENTER(); + + // get the current screen's pointer colors (17 to 19) + GetRGB32(_window(obj)->WScreen->ViewPort.ColorMap, 17, 3, colors); + + for(i=0; i < 3; i++) + { + LONG dr; + LONG dg; + LONG db; + + // normalize the colors to 8 bit per gun as GetRGB32() returns + // 32bit left aligned values + colors[i*3+0] >>= 24; + colors[i*3+1] >>= 24; + colors[i*3+2] >>= 24; + + // calculate the geometric difference to the color black (=0x00000000) + dr = 0x00000000 - colors[i*3+0]; + dg = 0x00000000 - colors[i*3+1]; + db = 0x00000000 - colors[i*3+2]; + blackDiff[i] = dr * dr + dg * dg + db * db; + + // calculate the geometric difference to the color white (=0x000000ff) + dr = 0x000000ff - colors[i*3+0]; + dg = 0x000000ff - colors[i*3+1]; + db = 0x000000ff - colors[i*3+2]; + whiteDiff[i] = dr * dr + dg * dg + db * db; + } + + // the smallest difference defines the color which is closest to black or + // equal to black + if(blackDiff[0] > blackDiff[1]) + { + if(blackDiff[1] > blackDiff[2]) + blackIndex = 19; + else + blackIndex = 18; + } + else if(blackDiff[0] > blackDiff[2]) + blackIndex = 19; + else + blackIndex = 17; + + // the smallest difference defines the color which is closest to white or + // equal to white + if(whiteDiff[0] > whiteDiff[1]) + { + if(whiteDiff[1] > whiteDiff[2]) + whiteIndex = 19; + else + whiteIndex = 18; + } + else if(whiteDiff[0] > whiteDiff[2]) + whiteIndex = 19; + else + whiteIndex = 17; + + // Here we expect the user to have set up quite "different" colors. That + // means the color closest to white will never be close to black and vice + // versa. According to these differences we spread the required bitplanes. + if(whiteIndex == 17) + { + if(blackIndex == 18) + { + sizePointerBitmap.Planes[0] = (PLANEPTR)sizePointer_bp0; + sizePointerBitmap.Planes[1] = (PLANEPTR)sizePointer_bp1; + movePointerBitmap.Planes[0] = (PLANEPTR)movePointer_bp0; + movePointerBitmap.Planes[1] = (PLANEPTR)movePointer_bp1; + selectPointerBitmap.Planes[0] = (PLANEPTR)selectPointer_bp0; + selectPointerBitmap.Planes[1] = (PLANEPTR)selectPointer_bp1; + } + else // blackIndex == 19 + { + sizePointerBitmap.Planes[0] = (PLANEPTR)sizePointer_bp2; + sizePointerBitmap.Planes[1] = (PLANEPTR)sizePointer_bp1; + movePointerBitmap.Planes[0] = (PLANEPTR)movePointer_bp2; + movePointerBitmap.Planes[1] = (PLANEPTR)movePointer_bp1; + selectPointerBitmap.Planes[0] = (PLANEPTR)selectPointer_bp2; + selectPointerBitmap.Planes[1] = (PLANEPTR)selectPointer_bp1; + } + } + else if(whiteIndex == 18) + { + if(blackIndex == 17) + { + sizePointerBitmap.Planes[0] = (PLANEPTR)sizePointer_bp1; + sizePointerBitmap.Planes[1] = (PLANEPTR)sizePointer_bp0; + movePointerBitmap.Planes[0] = (PLANEPTR)movePointer_bp1; + movePointerBitmap.Planes[1] = (PLANEPTR)movePointer_bp0; + selectPointerBitmap.Planes[0] = (PLANEPTR)selectPointer_bp1; + selectPointerBitmap.Planes[1] = (PLANEPTR)selectPointer_bp0; + } + else // blackIndex == 19 + { + sizePointerBitmap.Planes[0] = (PLANEPTR)sizePointer_bp1; + sizePointerBitmap.Planes[1] = (PLANEPTR)sizePointer_bp2; + movePointerBitmap.Planes[0] = (PLANEPTR)movePointer_bp1; + movePointerBitmap.Planes[1] = (PLANEPTR)movePointer_bp2; + selectPointerBitmap.Planes[0] = (PLANEPTR)selectPointer_bp1; + selectPointerBitmap.Planes[1] = (PLANEPTR)selectPointer_bp2; + } + } + else // whiteIndex == 19 + { + if(blackIndex == 17) + { + sizePointerBitmap.Planes[0] = (PLANEPTR)sizePointer_bp2; + sizePointerBitmap.Planes[1] = (PLANEPTR)sizePointer_bp0; + movePointerBitmap.Planes[0] = (PLANEPTR)movePointer_bp2; + movePointerBitmap.Planes[1] = (PLANEPTR)movePointer_bp0; + selectPointerBitmap.Planes[0] = (PLANEPTR)selectPointer_bp2; + selectPointerBitmap.Planes[1] = (PLANEPTR)selectPointer_bp0; + } + else // blackIndex == 18 + { + sizePointerBitmap.Planes[0] = (PLANEPTR)sizePointer_bp0; + sizePointerBitmap.Planes[1] = (PLANEPTR)sizePointer_bp2; + movePointerBitmap.Planes[0] = (PLANEPTR)movePointer_bp0; + movePointerBitmap.Planes[1] = (PLANEPTR)movePointer_bp2; + selectPointerBitmap.Planes[0] = (PLANEPTR)selectPointer_bp0; + selectPointerBitmap.Planes[1] = (PLANEPTR)selectPointer_bp2; + } + } + + LEAVE(); +} + +void SetupCustomPointers(struct NLData *data) +{ + ENTER(); + + #if defined(__MORPHOS__) + if(((struct Library *)IntuitionBase)->lib_Version >= 51) // Check for V51 Intuition and use built-in pointers + { + data->SizePointerObj = (APTR)POINTERTYPE_HORIZONTALRESIZE; + data->MovePointerObj = (APTR)POINTERTYPE_MOVE; + data->SelectPointerObj = (APTR)POINTERTYPE_SELECTTEXT; + } + #endif + + if(data->SizePointerObj == NULL) + { + #if defined(__amigaos4__) + data->SizePointerObj = (Object *)NewObject(NULL, "pointerclass", + POINTERA_ImageData, sizePointer, + POINTERA_Width, sizePointerWidth, + POINTERA_Height, sizePointerHeight, + POINTERA_BitMap, (LONG)&sizePointerBitmap, + POINTERA_WordWidth, (ULONG)1, + POINTERA_XResolution, (ULONG)POINTERXRESN_SCREENRES, + POINTERA_YResolution, (ULONG)POINTERYRESN_SCREENRESASPECT, + POINTERA_XOffset, (LONG)sizePointerXOffset, + POINTERA_YOffset, (LONG)sizePointerYOffset, + TAG_DONE); + #else + data->SizePointerObj = (Object *)NewObject(NULL, (STRPTR)"pointerclass", + POINTERA_BitMap, (IPTR)&sizePointerBitmap, + POINTERA_WordWidth, (ULONG)1, + POINTERA_XResolution, (ULONG)POINTERXRESN_SCREENRES, + POINTERA_YResolution, (ULONG)POINTERYRESN_SCREENRESASPECT, + POINTERA_XOffset, (LONG)sizePointerXOffset, + POINTERA_YOffset, (LONG)sizePointerYOffset, + TAG_DONE); + #endif + } + + if(data->MovePointerObj == NULL) + { + #if defined(__amigaos4__) + data->MovePointerObj = (Object *)NewObject(NULL, "pointerclass", + POINTERA_ImageData, movePointer, + POINTERA_Width, movePointerWidth, + POINTERA_Height, movePointerHeight, + POINTERA_BitMap, (LONG)&movePointerBitmap, + POINTERA_WordWidth, (ULONG)1, + POINTERA_XResolution, (ULONG)POINTERXRESN_SCREENRES, + POINTERA_YResolution, (ULONG)POINTERYRESN_SCREENRESASPECT, + POINTERA_XOffset, (LONG)movePointerXOffset, + POINTERA_YOffset, (LONG)movePointerYOffset, + TAG_DONE); + #else + data->MovePointerObj = (Object *)NewObject(NULL, (STRPTR)"pointerclass", + POINTERA_BitMap, (IPTR)&movePointerBitmap, + POINTERA_WordWidth, (ULONG)1, + POINTERA_XResolution, (ULONG)POINTERXRESN_SCREENRES, + POINTERA_YResolution, (ULONG)POINTERYRESN_SCREENRESASPECT, + POINTERA_XOffset, (LONG)movePointerXOffset, + POINTERA_YOffset, (LONG)movePointerYOffset, + TAG_DONE); + #endif + } + + if(data->SelectPointerObj == NULL) + { + #if defined(__amigaos4__) + data->SelectPointerObj = (Object *)NewObject(NULL, "pointerclass", + POINTERA_ImageData, selectPointer, + POINTERA_Width, selectPointerWidth, + POINTERA_Height, selectPointerHeight, + POINTERA_BitMap, (LONG)&selectPointerBitmap, + POINTERA_WordWidth, (ULONG)1, + POINTERA_XResolution, (ULONG)POINTERXRESN_SCREENRES, + POINTERA_YResolution, (ULONG)POINTERYRESN_SCREENRESASPECT, + POINTERA_XOffset, (LONG)selectPointerXOffset, + POINTERA_YOffset, (LONG)selectPointerYOffset, + TAG_DONE); + #else + data->SelectPointerObj = (Object *)NewObject(NULL, (STRPTR)"pointerclass", + POINTERA_BitMap, (IPTR)&selectPointerBitmap, + POINTERA_WordWidth, (ULONG)1, + POINTERA_XResolution, (ULONG)POINTERXRESN_SCREENRES, + POINTERA_YResolution, (ULONG)POINTERYRESN_SCREENRESASPECT, + POINTERA_XOffset, (LONG)selectPointerXOffset, + POINTERA_YOffset, (LONG)selectPointerYOffset, + TAG_DONE); + #endif + } + + LEAVE(); +} + +void CleanupCustomPointers(struct NLData *data) +{ + ENTER(); + + #if defined(__MORPHOS__) + if(((struct Library *)IntuitionBase)->lib_Version >= 51) + { + data->SizePointerObj = NULL; + data->MovePointerObj = NULL; + data->SelectPointerObj = NULL; + } + #endif + + // dispose the different pointer objects + if(data->SizePointerObj != NULL) + { + DisposeObject(data->SizePointerObj); + data->SizePointerObj = NULL; + } + + if(data->MovePointerObj != NULL) + { + DisposeObject(data->MovePointerObj); + data->MovePointerObj = NULL; + } + + if(data->SelectPointerObj != NULL) + { + DisposeObject(data->SelectPointerObj); + data->SelectPointerObj = NULL; + } + + data->activeCustomPointer = PT_NONE; + + LEAVE(); +} + +void ShowCustomPointer(struct NLData *data, enum PointerType type) +{ + Object *obj = data->this; + + ENTER(); + + // even if it seems to be a waste of performance, but + // we unfortunately have to always set the window pointer + // regardless of the point if it was previously set or not. + // This is required as any other gadget or process might + // reset the window pointer and as such we would end up + // with no custom pointer as well. So we only check the window + // sleep status here :( + if(xget(_win(obj), MUIA_Window_Sleep) == FALSE) + { + Object *ptrObject = NULL; + + switch(type) + { + case PT_SIZE: + ptrObject = data->SizePointerObj; + break; + + case PT_MOVE: + ptrObject = data->MovePointerObj; + break; + + case PT_SELECT: + ptrObject = data->SelectPointerObj; + break; + + case PT_NONE: + ptrObject = NULL; + break; + } + + if(ptrObject != NULL) + { + // try to identify the black/white colors + // of the current screen colormap + IdentifyPointerColors(obj); + + #if !defined(__MORPHOS__) + SetWindowPointer(_window(obj), WA_Pointer, ptrObject, TAG_DONE); + #else + SetWindowPointer(_window(obj), ((struct Library *)IntuitionBase)->lib_Version >= 51 ? WA_PointerType : WA_Pointer, ptrObject, TAG_DONE); + #endif + + data->activeCustomPointer = type; + } + else + HideCustomPointer(data); + } + + LEAVE(); +} + +void HideCustomPointer(struct NLData *data) +{ + ENTER(); + + if(data->activeCustomPointer != PT_NONE) + { + SetWindowPointer(_window(data->this), TAG_DONE); + data->activeCustomPointer = PT_NONE; + } + + LEAVE(); +} diff --git a/workbench/classes/zune/nlist/nlist_mcc/Pointer.h b/workbench/classes/zune/nlist/nlist_mcc/Pointer.h new file mode 100644 index 0000000000..1bc28269d0 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/Pointer.h @@ -0,0 +1,46 @@ +#if !defined(_POINTER_H_) +#define _POINTER_H_ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +// forward declarations +struct NLData; + +// enums +enum PointerType +{ + PT_NONE=0, // no custom pointer active + PT_SIZE, // sizePointer active + PT_MOVE, // movePointer active + PT_SELECT, // selectPointer active +}; + +// prototypes +void SetupCustomPointers(struct NLData *data); +void CleanupCustomPointers(struct NLData *data); +void ShowCustomPointer(struct NLData *data, enum PointerType type); +void HideCustomPointer(struct NLData *data); + +#endif // _POINTER_H_ diff --git a/workbench/classes/zune/nlist/nlist_mcc/extrasrc/AllocVecPooled.c b/workbench/classes/zune/nlist/nlist_mcc/extrasrc/AllocVecPooled.c new file mode 100755 index 0000000000..b13ed21ece --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/extrasrc/AllocVecPooled.c @@ -0,0 +1,48 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <exec/types.h> +#include <proto/exec.h> + +/// AllocVecPooled +// allocate a vector of <memSize> bytes from the pool specified by <poolHeader> +APTR AllocVecPooled(APTR poolHeader, ULONG memSize) +{ + ULONG *memory; + + // add the number of bytes used to store the size information + memSize += sizeof(ULONG); + + // allocate memory from the pool + if((memory = AllocPooled(poolHeader, memSize)) != NULL) + { + // and finally store the size of the memory block, including the size itself + *memory++ = memSize; + } + + return memory; +} + +/// diff --git a/workbench/classes/zune/nlist/nlist_mcc/extrasrc/FreeVecPooled.c b/workbench/classes/zune/nlist/nlist_mcc/extrasrc/FreeVecPooled.c new file mode 100755 index 0000000000..90013c0b54 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/extrasrc/FreeVecPooled.c @@ -0,0 +1,43 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <exec/types.h> +#include <proto/exec.h> + +/// FreeVecPooled +// return a vector to the pool +void FreeVecPooled(APTR poolHeader, APTR memory) +{ + ULONG *mem = (ULONG *)memory; + ULONG memSize; + + // skip back over the stored size information + memSize = *(--mem); + + // an return the memory block to the pool + FreePooled(poolHeader, mem, memSize); +} + +/// diff --git a/workbench/classes/zune/nlist/nlist_mcc/library.c b/workbench/classes/zune/nlist/nlist_mcc/library.c new file mode 100644 index 0000000000..701417192f --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/library.c @@ -0,0 +1,206 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/******************************************************************************/ +/* */ +/* includes */ +/* */ +/******************************************************************************/ + +#include <proto/exec.h> +#include <proto/intuition.h> + +/******************************************************************************/ +/* */ +/* MCC/MCP name and version */ +/* */ +/* ATTENTION: The FIRST LETTER of NAME MUST be UPPERCASE */ +/* */ +/******************************************************************************/ + +#include "private.h" +#include "version.h" +#include "NList_grp.h" + +#define VERSION LIB_VERSION +#define REVISION LIB_REVISION + +#define CLASS MUIC_NList +#define SUPERCLASS MUIC_Group + +#define INSTDATA NLData + +#define USERLIBID CLASS " " LIB_REV_STRING " [" SYSTEMSHORT "/" CPU "] (" LIB_DATE ") " LIB_COPYRIGHT +#define MASTERVERSION 19 + +#define CLASSINIT +#define CLASSEXPUNGE + +#define USEDCLASSESP used_mcps +static const char *used_mcps[] = { "NListviews.mcp", NULL }; + +#define MIN_STACKSIZE 16384 + +#if defined(__MORPHOS__) +struct Library *LayersBase = NULL; +struct Library *DiskfontBase = NULL; +struct Library *ConsoleDevice = NULL; +#else +struct Library *LayersBase = NULL; +struct Library *DiskfontBase = NULL; +struct Device *ConsoleDevice = NULL; +#endif + +#if defined(__amigaos4__) +struct LayersIFace *ILayers = NULL; +struct DiskfontIFace *IDiskfont = NULL; +struct ConsoleIFace *IConsole = NULL; +#endif + +static struct IOStdReq ioreq; + +#if defined(DEBUG) +#include "timeval.h" +static struct TimeRequest timereq; +#if defined(__MORPHOS__) +struct Library *TimerBase = NULL; +#else +struct Device *TimerBase = NULL; +#endif +#if defined(__amigaos4__) +struct TimerIFace *ITimer = NULL; +#endif +#endif // DEBUG + +/******************************************************************************/ +/* define the functions used by the startup code ahead of including mccinit.c */ +/******************************************************************************/ +static BOOL ClassInit(UNUSED struct Library *base); +static VOID ClassExpunge(UNUSED struct Library *base); + +/******************************************************************************/ +/* include the lib startup code for the mcc/mcp (and muimaster inlines) */ +/******************************************************************************/ +#include "mccinit.c" + +/******************************************************************************/ +/* define all implementations of our user functions */ +/******************************************************************************/ +static BOOL ClassInit(UNUSED struct Library *base) +{ + if((LayersBase = OpenLibrary("layers.library", 39L)) && + GETINTERFACE(ILayers, struct LayersIFace *, LayersBase)) + { + if((DiskfontBase = OpenLibrary("diskfont.library", 39L)) && + GETINTERFACE(IDiskfont, struct DiskfontIFace *, DiskfontBase)) + { + memset(&ioreq, 0, sizeof(ioreq)); + ioreq.io_Message.mn_Length = sizeof(ioreq); + if(OpenDevice("console.device", -1L, (struct IORequest *)&ioreq, 0L) == 0) + { + ConsoleDevice = (APTR)ioreq.io_Device; + if(GETINTERFACE(IConsole, struct ConsoleIFace *, ConsoleDevice)) + { + #if defined(DEBUG) + memset(&timereq, 0, sizeof(timereq)); + timereq.Request.io_Message.mn_Length = sizeof(timereq); + if(OpenDevice("timer.device", 0, (struct IORequest *)&timereq, 0L) == 0) + { + TimerBase = timereq.Request.io_Device; + if(GETINTERFACE(ITimer, struct TimerIFace *, TimerBase)) + { + #endif // DEBUG + if(NGR_Create()) + { + if(StartClipboardServer() == TRUE) + { + return(TRUE); + } + } + + #if defined(DEBUG) + DROPINTERFACE(ITimer); + } + } + #endif // DEBUG + + DROPINTERFACE(IConsole); + } + + CloseDevice((struct IORequest *)&ioreq); + ConsoleDevice = NULL; + } + + DROPINTERFACE(IDiskfont); + CloseLibrary(DiskfontBase); + DiskfontBase = NULL; + } + + DROPINTERFACE(ILayers); + CloseLibrary(LayersBase); + LayersBase = NULL; + } + + return(FALSE); +} + + +static VOID ClassExpunge(UNUSED struct Library *base) +{ + ShutdownClipboardServer(); + + NGR_Delete(); + + #if defined(DEBUG) + if(TimerBase) + { + DROPINTERFACE(ITimer); + CloseDevice((struct IORequest *)&timereq); + TimerBase = NULL; + } + #endif // DEBUG + + if(ConsoleDevice) + { + DROPINTERFACE(IConsole); + CloseDevice((struct IORequest *)&ioreq); + ConsoleDevice = NULL; + } + + if(DiskfontBase) + { + DROPINTERFACE(IDiskfont); + CloseLibrary(DiskfontBase); + DiskfontBase = NULL; + } + + if(LayersBase) + { + DROPINTERFACE(ILayers); + CloseLibrary(LayersBase); + LayersBase = NULL; + } +} + diff --git a/workbench/classes/zune/nlist/nlist_mcc/mmakefile.src b/workbench/classes/zune/nlist/nlist_mcc/mmakefile.src new file mode 100644 index 0000000000..a12c1e3861 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/mmakefile.src @@ -0,0 +1,51 @@ +# $Id$ +include $(TOP)/config/make.cfg + +#MM contrib-zune-classes-nlist-class : includes linklibs + +#MM contrib-zune-classes-nlist-test : includes linklibs + +FILES := \ + NList_mcc \ + NList_mcc0 \ + NList_mcc1 \ + NList_mcc2 \ + NList_mcc3 \ + NList_mcc4 \ + NList_mcc5 \ + NList_mcc6 \ + move \ + NList_func \ + NList_func2 \ + NList_func3 \ + NList_func4 \ + NList_grp \ + NList_img \ + NList_img2 \ + ClipboardServer \ + Pointer \ + Debug + +USER_INCLUDES := -idirafter $(SRCDIR)/$(CURDIR)/../include -I$(SRCDIR)/$(CURDIR)/../nlistviews_mcp \ + -idirafter $(SRCDIR)/$(CURDIR)/../include/mui + +USER_CFLAGS := $(PARANOIA_CFLAGS) +USER_CFLAGS += $(PARANOIA_CFLAGS) + +%build_module_simple mmake=contrib-zune-classes-nlist-class \ + modname=NList modtype=mcc moduledir=$(CONTRIBDIR)/Zune/MCC_NList/Classes/Zune \ + files="library $(FILES)" uselibs="mui" + + + +%build_prog mmake=contrib-zune-classes-nlist-test progname=NList-Test \ + files="NList-Test $(FILES)" targetdir=$(AROS_TESTS)/NList \ + uselibs="mui" + + +#MM includes-copy + +INCLUDE_FILES := ../include/mui/NList_mcc.h +%copy_includes path=mui dir=../include/mui + +%common diff --git a/workbench/classes/zune/nlist/nlist_mcc/move.c b/workbench/classes/zune/nlist/nlist_mcc/move.c new file mode 100644 index 0000000000..e810b4b5e8 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/move.c @@ -0,0 +1,61 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <exec/types.h> + +#define NO_PROTOS +#include "private.h" + +/* + * + * Warning: the number of octets have to be a multiple of 4 + * and to be efficient, src and dest also have to be a multiple of 4 + * + * extern void NL_Move(void *dest,void *src,LONG len); + * + */ + +void NL_Move(struct TypeEntry **dest, struct TypeEntry **src, LONG count, LONG newpos) +{ + LONG i; + + for(i = 0; i < count; i++) + { + (*src)->entpos = newpos++; + *dest++ = *src++; + } +} + + +void NL_MoveD(struct TypeEntry **dest, struct TypeEntry **src, LONG count, LONG newpos) +{ + LONG i; + + for(i = 0; i < count; i++) + { + *--dest = *--src; + (*dest)->entpos = --newpos; + } +} diff --git a/workbench/classes/zune/nlist/nlist_mcc/private.h b/workbench/classes/zune/nlist/nlist_mcc/private.h new file mode 100644 index 0000000000..c894adf391 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/private.h @@ -0,0 +1,639 @@ +#ifndef MUI_NList_priv_MCC_H +#define MUI_NList_priv_MCC_H + +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <libraries/mui.h> + +#include <mui/NList_mcc.h> + +#include "Debug.h" +#include "Pointer.h" +#include "mcc_common.h" +#include "muiextra.h" + +#ifndef LONG_MAX +#define LONG_MAX 0x7fffffff /* max value for a long */ +#endif +#ifndef LONG_MIN +#define LONG_MIN 0x80000000 /* min value for a long */ +#endif +#ifndef ULONG_MAX +#define ULONG_MAX 0xffffffffU /* max value for an unsigned long */ +#endif + +#define MUIM_NList_Trigger 0x9d510090 /* GM */ + +#ifndef MUIA_Prop_DoSmooth +#define MUIA_Prop_DoSmooth 0x804236ce /* V4 i.. LONG */ +#endif + +#define MUIV_NList_CursorType_None 0 +#define MUIV_NList_CursorType_Bar 1 +#define MUIV_NList_CursorType_Rect 2 + +/* +#define MUIV_NList_TypeSelect_Line 0 +#define MUIV_NList_TypeSelect_Char 1 +*/ +#define MUIV_NList_TypeSelect_CWord 2 +#define MUIV_NList_TypeSelect_CLine 3 +#define MUIV_NList_TypeSelect_None 4 + +#define MUIV_NList_Active_UntilPageUp -8 +#define MUIV_NList_Active_UntilPageDown -9 +#define MUIV_NList_Active_UntilTop -10 +#define MUIV_NList_Active_UntilBottom -11 + + + +#define IEQUALIFIER_SHIFT (IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT) +#define IEQUALIFIER_ALT (IEQUALIFIER_LALT|IEQUALIFIER_RALT) +#define IEQUALIFIER_COMMAND (IEQUALIFIER_LCOMMAND|IEQUALIFIER_RCOMMAND) +#define IEQUALIFIER_CTRL_SHIFT (IEQUALIFIER_CONTROL|IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT) +#define IEQUALIFIER_CTRL_LSHIFT (IEQUALIFIER_CONTROL|IEQUALIFIER_LSHIFT) +#define IEQUALIFIER_CTRL_RSHIFT (IEQUALIFIER_CONTROL|IEQUALIFIER_RSHIFT) +#define IEQUALIFIER_CTRL_ALT (IEQUALIFIER_CONTROL|IEQUALIFIER_LALT|IEQUALIFIER_RALT) +#define IEQUALIFIER_CTRL_LALT (IEQUALIFIER_CONTROL|IEQUALIFIER_LALT) +#define IEQUALIFIER_CTRL_RALT (IEQUALIFIER_CONTROL|IEQUALIFIER_RALT) + +#define IEQUALIFIER_MASK (IEQUALIFIER_CONTROL|IEQUALIFIER_SHIFT|IEQUALIFIER_ALT|IEQUALIFIER_COMMAND) + +#ifndef RAWKEY_PAGEUP +#define RAWKEY_PAGEUP 0x48 +#endif +#ifndef RAWKEY_PAGEDOWN +#define RAWKEY_PAGEDOWN 0x49 +#endif +#ifndef RAWKEY_HOME +#define RAWKEY_HOME 0x70 +#endif +#ifndef RAWKEY_END +#define RAWKEY_END 0x71 +#endif + +#define SCROLLBARSTIME 10 + +#define DATA_STRING_MAX 120 + +#define CI_PERCENT 0 +#define CI_COL 1 +#define CI_PIX 2 + +// defines for the different particalcol substitution types +#define PCS_DISABLED 0 +#define PCS_RIGHT 1 +#define PCS_LEFT 2 +#define PCS_CENTER 3 + +struct colinfo +{ + struct colinfo *c; + + char *preparse; + SIPTR colwidthbiggestptr; + SIPTR colwidthbiggestptr2; + WORD colwidthbiggest; + WORD colwidthbiggest2; + WORD minx; + WORD maxx; + WORD dx; + + WORD style; + WORD xoffset; + WORD colwidth; + WORD ninfo; + + WORD colwidthmax; + + WORD userwidth; + WORD titlebutton; + + WORD delta; + WORD col; + WORD width; + WORD minwidth; + WORD maxwidth; + WORD mincolwidth; + WORD maxcolwidth; + WORD minpixwidth; + WORD maxpixwidth; + BYTE bar; + BYTE width_type; + WORD partcolsubst; +}; + + +#define AFFINFOS_START_MAX 40 + +struct affinfo +{ + char *strptr; + ULONG tag,tagval,button,imgnum; // RHP: Changed for Special ShortHelp + IPTR pen; + WORD pos; + WORD len; + WORD style; + UBYTE addchar; + UBYTE addinfo; +}; + + +/* Select values */ +#define TE_Select_None -1 +#define TE_Select_Line -2 + +/* Wrap values */ +#define TE_Wrap_None 0 +#define TE_Wrap_TmpLine 0x80 +#define TE_Wrap_TmpMask 0x7F + +#include "amiga-align.h" + +/* The Type entry is exported to NListtree (sigh), so this have to be amiga + * aligned */ + +struct TypeEntry { + APTR Entry; + BYTE Select; + UBYTE Wrap; + WORD PixLen; + WORD pos; + WORD len; + WORD style; + UWORD dnum; + ULONG entpos; +}; + +#include "default-align.h" + +struct UseImage { + Object *imgobj; + struct BitMapImage *bmimg; + ULONG flags; +}; + + + +#define MUIV_NList_Select_None -10 +#define MUIV_NList_Select_List -11 + +struct SelPoint { + LONG ent; + WORD xoffset; + WORD column; + WORD colxoffset; + WORD colpos; +}; + +#define PREPARSE_OFFSET_COL 2000 +#define PREPARSE_OFFSET_ENTRY 1000 + + +struct NImgList +{ struct NImgList *next; + APTR NImgObj; + WORD width,height; + WORD dx,dy; + char *ImgName; +}; + +#define MAXRAWBUF 40 + +struct NLData +{ + Object *this; // pointer to the own object + Object *nlistviewobj; // pointer to the parent/listview + Object *listviewobj; // pointer to the parent/listview if listview is Listview.mui + Object *scrollersobj; // pointer to the scrollers object + + LONG SETUP; + LONG SHOW; + + LONG pad1; + LONG pad2; + struct MUI_InputHandlerNode ihnode; + LONG pad3; + LONG pad4; + + LONG pad5; + LONG pad6; + struct MUI_EventHandlerNode ehnode; + LONG Seconds; + LONG Micros; + + LONG DRAW; + + char *NList_Format; + char *NList_SkipChars; + char *NList_WordSelectChars; + char *NList_Title; + const char *NList_IgnoreSpecialChars; + LONG NList_TitleSeparator; + LONG NList_TitleMark; + LONG NList_TitleMark2; + LONG NList_LastInserted; + ULONG NList_Quiet; + LONG NList_AffActive; + LONG NList_Active; + LONG NList_Smooth; + LONG NList_AffFirst; + LONG NList_AffFirst_Incr; + LONG NList_First; + LONG NList_First_Incr; + LONG NList_Visible; + LONG NList_Entries; + LONG NList_Prop_First; + LONG NList_Prop_First_Real; + LONG NList_Prop_First_Prec; + LONG NList_Prop_Add; + LONG NList_Prop_Wait; + LONG NList_Prop_Visible; + LONG NList_Prop_Entries; + LONG NList_Horiz_AffFirst; + LONG NList_Horiz_First; + LONG NList_Horiz_Visible; + LONG NList_Horiz_Entries; + LONG NList_MultiSelect; + BOOL NList_DefaultObjectOnClick; + BOOL NList_ActiveObjectOnClick; + LONG NList_MinLineHeight; + LONG NList_Input; + LONG NList_TypeSelect; + LONG NList_SelectChange; + ULONG NList_TitlePen; + ULONG NList_ListPen; + ULONG NList_SelectPen; + ULONG NList_CursorPen; + ULONG NList_UnselCurPen; + ULONG NList_InactivePen; + ULONG NList_TitleBackGround; + ULONG NList_ListBackGround; + ULONG NList_SelectBackground; + ULONG NList_CursorBackground; + ULONG NList_UnselCurBackground; + ULONG NList_InactiveBackground; + LONG NList_DragType; + LONG NList_Dropable; + LONG NList_DragColOnly; + LONG NList_DragSortable; + LONG NList_DropMark; + LONG NList_ShowDropMarks; + LONG NList_ColWidthDrag; + LONG NList_AdjustHeight; + LONG NList_AdjustWidth; + LONG NList_SourceArray; + IPTR NList_KeepActive; + IPTR NList_MakeActive; + LONG NList_DefClickColumn; + LONG NList_AutoCopyToClip; + LONG NList_AutoVisible; + LONG NList_TabSize; + LONG NList_EntryValueDependent; + APTR NList_PrivateData; + LONG NList_ForcePen; + LONG NList_PartialCol; + LONG NList_List_Select; + LONG NList_PartialChar; + LONG NList_ContextMenu; + LONG NList_SortType; + LONG NList_SortType2; + LONG NList_ButtonClick; + LONG NList_MinColSortable; + LONG NList_Imports; + LONG NList_Exports; + LONG NList_Disabled; + LONG NList_SerMouseFix; + LONG NList_DragLines; + LONG NList_WheelStep; + LONG NList_WheelFast; + LONG NList_WheelMMB; + LONG NList_VerticalCenteredText; + BOOL NList_AutoClip; + BOOL NList_SelectPointer; + + // object pointers for forwarding the + // key focus to other objects. + Object *NList_KeyUpFocus; + Object *NList_KeyDownFocus; + Object *NList_KeyLeftFocus; + Object *NList_KeyRightFocus; + + STRPTR NList_ShortHelp; + + LONG ListCompatibility; + struct KeyBinding *NList_Keys; + struct KeyBinding *Wheel_Keys; + UBYTE *NList_Columns; + ULONG HLINE_thick_pen; + LONG ContextMenu; + LONG ContextMenuOn; + struct TypeEntry **EntriesArray; + struct Hook *NList_CompareHook; + struct Hook *NList_ConstructHook; + struct Hook *NList_DestructHook; + struct Hook *NList_DisplayHook; + struct Hook *NList_MultiTestHook; + struct Hook *NList_CopyEntryToClipHook; + struct Hook *NList_CopyColumnToClipHook; + LONG NList_CompareHook2; + LONG NList_ConstructHook2; + LONG NList_DestructHook2; + LONG NList_DisplayHook2; + LONG NList_CopyEntryToClipHook2; + LONG NList_CopyColumnToClipHook2; + APTR Pool; /* Custom or internal pool pointer. */ + APTR PoolInternal; /* Internal pool pointer. */ + APTR EntryPool; + IPTR NList_Font; + LONG MOUSE_MOVE; + + struct IClass *ncl; + struct IClass *ocl; + + APTR VertPropObject; + Object *NL_Group; + Object *VirtGroup; + Object *VirtGroup2; + struct IClass *VirtClass; + Object *MenuObj; + + // for our own mouse pointer management + Object *SizePointerObj; + Object *MovePointerObj; + Object *SelectPointerObj; + enum PointerType activeCustomPointer; + + struct TextFont *InUseFont; + + struct NImgList *NImage2; + struct NImgList NImage; + + struct UseImage *NList_UseImages; + LONG LastImage; + + APTR dispentry; char *DisplayArray[DISPLAY_ARRAY_MAX*2 +2]; + LONG LastEntry; + + LONG ForcePen; + + LONG lvisible; + LONG hvisible; + LONG ScrollBarsPos; + LONG ScrollBars; + LONG ScrollBarsOld; + LONG ScrollBarsTime; + + LONG Notify; + LONG DoNotify; + LONG Notifying; + + LONG TitleClick; + LONG TitleClick2; + + BOOL isActiveObject; // TRUE in case object is active object of window + + LONG MinImageHeight; + + LONG pushtrigger; + LONG parse_column; + LONG parse_ent; + char *display_ptr; + LONG drag_type; + LONG drag_border; + LONG drag_qualifier; + LONG moves; + LONG multiselect; + LONG multisel_qualifier; + LONG multiclick; + LONG multiclickalone; + LONG sorted; + LONG selectmode; + LONG lastselected; + LONG lastactived; + LONG selectskiped; + LONG first_change; + LONG last_change; + LONG minx_change_offset; + LONG minx_change_entry; + LONG maxx_change_offset; + LONG maxx_change_entry; + LONG adding_member; + LONG markdraw; + LONG markerase; + LONG marktype; + LONG markdrawnum; + LONG markerasenum; + LONG actbackground; + LONG NumIntuiTick; + struct RastPort *DragRPort; + char *DragText; + LONG DragEntry; + LONG DragWidth; + LONG DragHeight; + + IPTR Pen_Title_init; + IPTR Pen_List_init; + IPTR Pen_Select_init; + IPTR Pen_Cursor_init; + IPTR Pen_UnselCur_init; + IPTR Pen_Inactive_init; + IPTR BG_Title_init; + IPTR BG_List_init; + IPTR BG_Select_init; + IPTR BG_Cursor_init; + IPTR BG_UnselCur_init; + IPTR BG_Inactive_init; + + LONG old_prop_first; + LONG old_prop_visible; + LONG old_prop_entries; + LONG old_prop_delta; + LONG old_horiz_first; + LONG old_horiz_visible; + LONG old_horiz_entries; + LONG old_horiz_delta; + APTR drawsuper; + + struct RastPort *rp; + struct TextFont *font; + UWORD *pens; + + ULONG secs, micros; + LONG mouse_x; + LONG mouse_y; + LONG click_line; + LONG click_x; + LONG click_y; + + WORD min_sel; + WORD max_sel; + struct SelPoint sel_pt[4]; + LONG last_sel_click_x; + LONG last_sel_click_y; + + LONG affover; // RHP: Added for Special Shorthelp + LONG affimage; // RHP: Added for Special Shorthelp + LONG storebutton; + LONG affbutton; + LONG affbuttonline; + LONG affbuttoncol; + LONG affbuttonstate; + struct IBox affbuttonpos; + + struct affinfo *aff_infos; + struct colinfo *cols; + + WORD numaff_infos; + WORD numcols; + WORD numcols2; + + WORD format_chge; + WORD do_draw_all; + WORD do_draw_title; + WORD do_draw_active; + WORD do_draw; + WORD do_parse; + WORD do_images; + WORD do_setcols; + WORD do_updatesb; + WORD do_wwrap; + WORD force_wwrap; + WORD nodraw; + WORD dropping; + WORD refreshing; + WORD UpdateScrollersRedrawn; + WORD UpdatingScrollbars; + + WORD adjustcolumn; + WORD adjustbar; + WORD adjustbar2; + WORD adjustbar_old; + WORD adjustbar_last; + WORD adjustbar_last2; + + WORD tabsize; + WORD spacesize; + WORD Title_PixLen; + WORD badrport; + + WORD mleft; + WORD mright; + WORD mtop; + WORD mbottom; + WORD mwidth; + WORD mheight; + + WORD vdx; + WORD vdy; + WORD vleft; + WORD vright; + WORD vtop; + WORD vbottom; + WORD vwidth; + WORD vheight; + + WORD drawall_bits; + WORD drawall_dobit; + + WORD vpos; + WORD voff; + WORD vinc; + WORD addvinc; + WORD hpos; + WORD hinc; + WORD vdtitlepos; + WORD vdtitleheight; + WORD vdtpos; + WORD vdt; + WORD vdbpos; + WORD vdb; + + WORD firstselect; + + WORD left; + WORD top; + WORD width; + WORD height; + + BYTE column[DISPLAY_ARRAY_MAX+2]; + + char imagebuf[64+4]; + + struct InputEvent ievent; + char rawtext[MAXRAWBUF]; +}; + + +#define MUII_myListInactive (data->NList_InactiveBackground) +#define MUII_myListUnselCur (data->NList_UnselCurBackground) +#define MUII_myListCursor (data->NList_CursorBackground) +#define MUII_myListSelCur (data->NList_CursorBackground) +#define MUII_myListSelect (data->NList_SelectBackground) + + +/* +extern struct TextFont *Topaz_8; +*/ + +#define LIBVER(lib) ((struct Library *)lib)->lib_Version + + +#ifndef NO_PROTOS +#include "protos.h" +#endif + +#define MUIV_NList_PoolPuddleSize_Default 2048 +#define MUIV_NList_PoolThreshSize_Default 1024 + +/// xget() +// Gets an attribute value from a MUI object +IPTR xget(Object *obj, const IPTR attr); +#if defined(__GNUC__) + // please note that we do not evaluate the return value of GetAttr() + // as some attributes (e.g. MUIA_Selected) always return FALSE, even + // when they are supported by the object. But setting b=0 right before + // the GetAttr() should catch the case when attr doesn't exist at all + #define xget(OBJ, ATTR) ({IPTR b=0; GetAttr(ATTR, OBJ, &b); b;}) +#endif +/// + +#ifndef MIN + #define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#endif +#ifndef MAX + #define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#endif + +// special flagging macros +#define isFlagSet(v,f) (((v) & (f)) == (f)) // return TRUE if the flag is set +#define hasFlag(v,f) (((v) & (f)) != 0) // return TRUE if one of the flags in f is set in v +#define isFlagClear(v,f) (((v) & (f)) == 0) // return TRUE if flag f is not set in v +#define SET_FLAG(v,f) ((v) |= (f)) // set the flag f in v +#define CLEAR_FLAG(v,f) ((v) &= ~(f)) // clear the flag f in v +#define MASK_FLAG(v,f) ((v) &= (f)) // mask the variable v with flag f bitwise + +#endif /* MUI_NList_priv_MCC_H */ diff --git a/workbench/classes/zune/nlist/nlist_mcc/protos.h b/workbench/classes/zune/nlist/nlist_mcc/protos.h new file mode 100644 index 0000000000..10abca5c28 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/protos.h @@ -0,0 +1,222 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/* NList_mcc.c */ + +extern void release_pen(Object *obj, ULONG *pen); +extern void obtain_pen(Object *obj, ULONG *pen, struct MUI_PenSpec *ps); +extern IPTR mNL_New(struct IClass *cl,Object *obj,struct opSet *msg); +extern IPTR mNL_Dispose(struct IClass *cl,Object *obj,Msg msg); +extern IPTR mNL_Setup(struct IClass *cl,Object *obj,struct MUIP_Setup *msg); +extern IPTR mNL_Cleanup(struct IClass *cl,Object *obj,struct MUIP_Cleanup *msg); + +/* NList_mcc0.c */ + +/* +** Dispatcher +*/ + +/* NList_mcc1.c */ + +extern IPTR mNL_AskMinMax(struct IClass *cl,Object *obj,struct MUIP_AskMinMax *msg); +extern IPTR mNL_Notify(struct IClass *cl,Object *obj,struct MUIP_Notify *msg); +extern IPTR mNL_Set(struct IClass *cl,Object *obj,Msg msg); +extern IPTR mNL_Get(struct IClass *cl,Object *obj,struct opGet *msg); + +/* NList_mcc2.c */ + +extern IPTR mNL_HandleEvent(struct IClass *cl,Object *obj,struct MUIP_HandleInput *msg); +extern IPTR mNL_CreateDragImage(struct IClass *cl,Object *obj,struct MUIP_CreateDragImage *msg); +extern IPTR mNL_DeleteDragImage(struct IClass *cl,Object *obj,struct MUIP_DeleteDragImage *msg); +extern BOOL NL_Prop_First_Adjust(struct NLData *data); +extern IPTR mNL_Trigger(struct IClass *cl,Object *obj,Msg msg); + +/* NList_mcc3.c */ + +extern void NL_SetObjInfos(struct NLData *data,BOOL setall); +extern IPTR mNL_Draw(struct IClass *cl,Object *obj,struct MUIP_Draw *msg); +extern IPTR mNL_DropDraw(struct IClass *cl,Object *obj,struct MUIP_NList_DropDraw *msg); + +/* NList_mcc4.c */ + +extern BOOL DontDoColumn(struct NLData *data,LONG ent,WORD column); +extern void ParseColumn(struct NLData *data,WORD column,IPTR mypen); +extern void WidthColumn(struct NLData *data,WORD column,WORD updinfo); +extern void AllParseColumns(struct NLData *data); +extern void FreeAffInfo(struct NLData *data); +extern BOOL NeedAffInfo(struct NLData *data,WORD niask); +extern void NL_GetDisplayArray(struct NLData *data,SIPTR ent); +extern void FindCharInColumn(struct NLData *data,LONG ent,WORD column,WORD xoffset,WORD *charxoffset,WORD *charnum); +extern void NL_DoWrapAll(struct NLData *data,BOOL force,BOOL update); +extern void AllWidthColumns(struct NLData *data); +extern void NL_SetColsAdd(struct NLData *data,LONG ent,WORD addimages); +extern void NL_SetColsRem(struct NLData *data,LONG ent); + +/* NList_mcc5.c */ + +extern void NL_SetCols(struct NLData *data); +extern LONG NL_DoNotifies(struct NLData *data,LONG which); +extern void NL_UpdateScrollersValues(struct NLData *data); +extern ULONG NL_UpdateScrollers(struct NLData *data,BOOL force); +extern LONG NL_DrawQuietBG(struct NLData *data,LONG dowhat,LONG bg); +extern void NL_Select(struct NLData *data,LONG dowhat,LONG ent,BYTE sel); +extern void ScrollVert(struct NLData *data,WORD dy,LONG LPVisible); +extern void ScrollHoriz(struct NLData *data,WORD dx,LONG LPVisible); +extern LONG NL_ColToColumn(struct NLData *data,LONG col); +extern LONG NL_ColumnToCol(struct NLData *data,LONG column); +extern LONG NL_SetCol(struct NLData *data,LONG column,LONG col); +extern LONG NL_ColWidth(struct NLData *data,LONG col,LONG width); +extern BYTE *NL_Columns(struct NLData *data,BYTE *columns); +extern IPTR mNL_ColToColumn(struct IClass *cl,Object *obj,struct MUIP_NList_ColToColumn *msg); +extern IPTR mNL_ColumnToCol(struct IClass *cl,Object *obj,struct MUIP_NList_ColumnToCol *msg); +extern IPTR mNL_SetColumnCol(struct IClass *cl,Object *obj,struct MUIP_NList_SetColumnCol *msg); +extern IPTR mNL_List_ColWidth(struct IClass *cl,Object *obj,struct MUIP_NList_ColWidth *msg); +extern IPTR mNL_ContextMenuBuild(struct IClass *cl,Object *obj,struct MUIP_ContextMenuBuild *msg); +extern IPTR mNL_ContextMenuChoice(struct IClass *cl,Object *obj,struct MUIP_ContextMenuChoice *msg); + +/* NList_mcc6.c */ + +extern void DrawBackground(Object *obj, LONG left, LONG top, LONG width, LONG height, LONG xoff, LONG yoff); +extern WORD DrawTitle(struct NLData *data,LONG minx,LONG maxx,WORD hfirst); +extern void DrawOldLine(struct NLData *data,LONG ent,LONG minx,LONG maxx,WORD hfirst); +extern WORD DrawLines(struct NLData *data,LONG e1,LONG e2,LONG minx,LONG maxx,WORD hfirst,WORD hmax,WORD small,BOOL do_extrems,WORD not_all); +extern LONG DrawText(struct NLData *data,LONG ent,LONG x,LONG y,LONG minx,LONG maxx,ULONG mypen,LONG dxpermit,BOOL forcepen); +extern LONG DrawDragText(struct NLData *data,BOOL draw); +extern void DisposeDragRPort(struct NLData *data); +extern struct RastPort *CreateDragRPort(struct NLData *data,LONG numlines,LONG first,LONG last); + +/* NList_func.c */ + +extern void NL_SegChanged(struct NLData *data,LONG ent1,LONG ent2); +extern void NL_Changed(struct NLData *data,LONG ent); +extern void NL_UnSelectAll(struct NLData *data,LONG untouch_ent); +extern void UnSelectCharSel(struct NLData *data,BOOL redraw); +extern void SelectFirstPoint(struct NLData *data,WORD x,WORD y); +extern void SelectSecondPoint(struct NLData *data,WORD x,WORD y); +extern BOOL NL_List_First(struct NLData *data,LONG lf,struct TagItem *tag); +extern BOOL NL_List_Active(struct NLData *data,LONG la,struct TagItem *tag,LONG newactsel,LONG acceptsame,ULONG flags); +extern BOOL NL_List_Horiz_First(struct NLData *data,LONG hf,struct TagItem *tag); +extern ULONG NL_List_SelectChar(struct NLData *data,LONG pos,LONG seltype,LONG *state); +extern ULONG NL_List_Select(struct NLData *data,LONG pos,LONG pos2,LONG seltype,LONG *state); +extern ULONG NL_List_TestPosOld(struct NLData *data,LONG x,LONG y,struct MUI_List_TestPos_Result *res); +extern ULONG NL_List_TestPos(struct NLData *data,LONG x,LONG y,struct MUI_NList_TestPos_Result *res); + +extern IPTR mNL_List_GetEntry(struct IClass *cl,Object *obj,struct MUIP_NList_GetEntry *msg); +extern IPTR mNL_List_GetEntryInfo(struct IClass *cl,Object *obj,struct MUIP_NList_GetEntryInfo *msg); +extern IPTR mNL_List_Jump(struct IClass *cl,Object *obj,struct MUIP_NList_Jump *msg); +extern IPTR mNL_List_SetActive(struct IClass *cl,Object *obj,struct MUIP_NList_SetActive *msg); +extern IPTR mNL_List_Select(struct IClass *cl,Object *obj,struct MUIP_NList_Select *msg); +extern IPTR mNL_List_TestPos(struct IClass *cl,Object *obj,struct MUIP_NList_TestPos *msg); +extern IPTR mNL_List_TestPosOld(struct IClass *cl,Object *obj,struct MUIP_List_TestPos *msg); +extern IPTR mNL_List_Redraw(struct IClass *cl,Object *obj,struct MUIP_NList_Redraw *msg); +extern IPTR mNL_List_RedrawEntry(struct IClass *cl,Object *obj,struct MUIP_NList_RedrawEntry *msg); +extern IPTR mNL_List_NextSelected(struct IClass *cl,Object *obj,struct MUIP_NList_NextSelected *msg); +extern IPTR mNL_List_PrevSelected(struct IClass *cl,Object *obj,struct MUIP_NList_PrevSelected *msg); +extern IPTR mNL_List_GetSelectInfo(struct IClass *cl,Object *obj,struct MUIP_NList_GetSelectInfo *msg); +extern IPTR mNL_List_DoMethod(struct IClass *cl,Object *obj,struct MUIP_NList_DoMethod *msg); +extern IPTR mNL_List_GetPos(struct IClass *cl,Object *obj,struct MUIP_NList_GetPos *msg); + +/* NList_func2.c */ + +extern LONG NL_GetSelects(struct NLData *data,LONG ent); +extern BOOL NL_InsertTmpLine(struct NLData *data,LONG pos); +extern void NL_DeleteTmpLine(struct NLData *data,LONG pos); +extern ULONG NL_List_Sort(struct NLData *data); +extern ULONG NL_List_Insert(struct NLData *data,APTR *entries,LONG count,LONG pos,LONG wrapcol,LONG align,ULONG flags); +extern ULONG NL_List_Replace(struct NLData *data,APTR entry,LONG pos,LONG wrapcol,LONG align); +extern ULONG NL_List_Clear(struct NLData *data); +extern ULONG NL_List_Remove(struct NLData *data,LONG pos); +extern ULONG NL_List_Exchange(struct NLData *data,LONG pos1,LONG pos2); +extern ULONG NL_List_Move_Selected(struct NLData *data,LONG to); +extern ULONG NL_List_Move(struct NLData *data,LONG from,LONG to); + +extern IPTR mNL_List_Sort(struct IClass *cl,Object *obj,struct MUIP_NList_Sort *msg); +extern IPTR mNL_List_Sort2(struct IClass *cl,Object *obj,struct MUIP_NList_Sort2 *msg); +extern IPTR mNL_List_Sort3(struct IClass *cl,Object *obj,struct MUIP_NList_Sort3 *msg); +extern IPTR mNL_List_Insert(struct IClass *cl,Object *obj,struct MUIP_NList_Insert *msg); +extern IPTR mNL_List_InsertSingle(struct IClass *cl,Object *obj,struct MUIP_NList_InsertSingle *msg); +extern IPTR mNL_List_InsertWrap(struct IClass *cl,Object *obj,struct MUIP_NList_InsertWrap *msg); +extern IPTR mNL_List_InsertSingleWrap(struct IClass *cl,Object *obj,struct MUIP_NList_InsertSingleWrap *msg); +extern IPTR mNL_List_ReplaceSingle(struct IClass *cl,Object *obj,struct MUIP_NList_ReplaceSingle *msg); +extern IPTR mNL_List_Exchange(struct IClass *cl,Object *obj,struct MUIP_NList_Exchange *msg); +extern IPTR mNL_List_Move(struct IClass *cl,Object *obj,struct MUIP_NList_Move *msg); +extern IPTR mNL_List_Clear(struct IClass *cl,Object *obj,struct MUIP_NList_Clear *msg); +extern IPTR mNL_List_Remove(struct IClass *cl,Object *obj,struct MUIP_NList_Remove *msg); +extern IPTR mNL_DragQuery(struct IClass *cl,Object *obj,struct MUIP_DragQuery *msg); +extern IPTR mNL_DragBegin(struct IClass *cl,Object *obj,struct MUIP_DragBegin *msg); +extern IPTR mNL_DragReport(struct IClass *cl,Object *obj,struct MUIP_DragReport *msg); +extern IPTR mNL_DragFinish(struct IClass *cl,Object *obj,struct MUIP_DragFinish *msg); +extern IPTR mNL_DragDrop(struct IClass *cl,Object *obj,struct MUIP_DragDrop *msg); +extern IPTR mNL_DropType(struct IClass *cl,Object *obj,struct MUIP_NList_DropType *msg); +extern IPTR mNL_DropEntryDrawErase(struct IClass *cl,Object *obj,struct MUIP_NList_DropEntryDrawErase *msg); + +/* NList_func3.c */ +extern IPTR MyCallHookPkt(Object *obj,BOOL hdata,struct Hook *hook,APTR object,APTR message); +#ifdef __AROS__ +#define MyCallHookPktA(obj, hook, ...) \ + ({ IPTR __args[] = { AROS_PP_VARIADIC_CAST2IPTR(__VA_ARGS__) }; \ + CallHookPkt(hook, obj, __args); }) +#else +extern IPTR STDARGS VARARGS68K MyCallHookPktA(Object *obj, struct Hook *hook, ...); +#endif +extern LONG DeadKeyConvert(struct NLData *data,struct IntuiMessage *msg,STRPTR buf,LONG bufsize,struct KeyMap *kmap); +extern char *ltoa(ULONG val, char *buffer, int len); + +extern void NL_Free_Format(struct NLData *data); +extern BOOL NL_Read_Format(struct NLData *data,char *strformat,BOOL oldlist); +extern SIPTR NL_CopyTo(struct NLData *data,LONG pos,char *filename,ULONG clipnum,APTR *entries,struct Hook *hook); + +extern IPTR mNL_CopyToClip(struct IClass *cl,Object *obj,struct MUIP_NList_CopyToClip *msg); +extern IPTR mNL_CopyTo(struct IClass *cl,Object *obj,struct MUIP_NList_CopyTo *msg); + +/* NList_func4.c */ + +extern BOOL NL_OnWindow(struct NLData *data,LONG x,LONG y); +extern struct NImgList *GetNImage(struct NLData *data,char *ImgName); +extern void DeleteNImages(struct NLData *data); +extern struct NImgList *GetNImage2(struct NLData *data,APTR imgobj); +extern void DeleteNImages2(struct NLData *data); +extern void GetNImage_Sizes(struct NLData *data); +extern void GetNImage_End(struct NLData *data); +extern void GetImages(struct NLData *data); + +extern IPTR NL_CreateImage(struct NLData *data,Object *imgobj,ULONG flags); +extern ULONG NL_DeleteImage(struct NLData *data,APTR listimg); +extern ULONG NL_CreateImages(struct NLData *data); +extern ULONG NL_DeleteImages(struct NLData *data); +extern ULONG NL_UseImage(struct NLData *data,Object *imgobj,LONG imgnum,ULONG flags); +extern IPTR mNL_CreateImage(struct IClass *cl,Object *obj,struct MUIP_NList_CreateImage *msg); +extern IPTR mNL_DeleteImage(struct IClass *cl,Object *obj,struct MUIP_NList_DeleteImage *msg); +extern IPTR mNL_UseImage(struct IClass *cl,Object *obj,struct MUIP_NList_UseImage *msg); + +/* Move.c */ + +extern void NL_Move(struct TypeEntry **dest, struct TypeEntry **src, LONG count, LONG newpos); +extern void NL_MoveD(struct TypeEntry **dest, struct TypeEntry **src, LONG count, LONG newpos); + +// ClipboardServer.c +BOOL StartClipboardServer(void); +void ShutdownClipboardServer(void); +LONG StringToClipboard(ULONG unit, STRPTR str); diff --git a/workbench/classes/zune/nlist/nlist_mcc/vastubs.c b/workbench/classes/zune/nlist/nlist_mcc/vastubs.c new file mode 100755 index 0000000000..14d0180fdb --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/vastubs.c @@ -0,0 +1,59 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if !defined(__AROS__) && (defined(__VBCC__) || defined(NO_INLINE_STDARG)) +#if defined(_M68000) || defined(__M68000) || defined(__mc68000) + +#include <exec/types.h> + +/* FIX V45 breakage... */ +#if INCLUDE_VERSION < 45 +#define MY_CONST_STRPTR CONST_STRPTR +#else +#define MY_CONST_STRPTR CONST STRPTR +#endif + +#include <proto/intuition.h> + +APTR NewObject( struct IClass *classPtr, CONST_STRPTR classID, Tag tag1, ... ) +{ return NewObjectA(classPtr, classID, (struct TagItem *)&tag1); } +ULONG SetAttrs( APTR object, ULONG tag1, ... ) +{ return SetAttrsA(object, (struct TagItem *)&tag1); } +VOID SetWindowPointer( struct Window *win, Tag tag1, ... ) +{ SetWindowPointerA(win, (struct TagItem *)&tag1); } + +#include <proto/graphics.h> + +LONG ObtainBestPen( struct ColorMap *cm, ULONG r, ULONG g, ULONG b, Tag tag1Type, ... ) +{ return ObtainBestPenA(cm, r, g, b, (CONST struct TagItem *)&tag1Type); } + +#include <proto/dos.h> +struct Process *CreateNewProcTags( ULONG tag1, ... ) +{ return CreateNewProc((struct TagItem *)&tag1); } + +#else + #error "VARGS stubs are only save on m68k systems!" +#endif +#endif diff --git a/workbench/classes/zune/nlist/nlist_mcc/version.h b/workbench/classes/zune/nlist/nlist_mcc/version.h new file mode 100644 index 0000000000..649779f411 --- /dev/null +++ b/workbench/classes/zune/nlist/nlist_mcc/version.h @@ -0,0 +1,83 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2010 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef _VERSION_H_ +#define _VERSION_H_ + +// transforms a define into a string +#define STR(x) STR2(x) +#define STR2(x) #x + +// for setting all necessary version information +#define LIB_VERSION 20 +#define LIB_REVISION 130 +#define LIB_DATE "17.12.2011" +#define LIB_COPYRIGHT "Copyright (C) 2001-2011 NList Open Source Team" + +// set the LIB_REV_STRING +#define LIB_REV_STRING STR(LIB_VERSION) "." STR(LIB_REVISION) + +// identify the system we are compiling for +#if defined(__amigaos4__) + #define SYSTEM "AmigaOS4" + #define SYSTEMSHORT "OS4" +#elif defined(__MORPHOS__) + #define SYSTEM "MorphOS" + #define SYSTEMSHORT "MOS" +#elif defined(__AROS__) + #define SYSTEM "AROS" + #define SYSTEMSHORT SYSTEM +#elif defined(__AMIGA__) + #define SYSTEM "AmigaOS3" + #define SYSTEMSHORT "OS3" +#else + #warning "Unsupported System - check SYSTEM define" + #define SYSTEM "???" + #define SYSTEMSHORT "???" +#endif + +// identify the CPU model +#if defined(__PPC__) || defined(__powerpc__) + #define CPU "PPC" +#elif defined(_M68060) || defined(__M68060) || defined(__mc68060) + #define CPU "m68060" +#elif defined(_M68040) || defined(__M68040) || defined(__mc68040) + #define CPU "m68040" +#elif defined(_M68030) || defined(__M68030) || defined(__mc68030) + #define CPU "m68030" +#elif defined(_M68020) || defined(__M68020) || defined(__mc68020) + #define CPU "m68k" +#elif defined(_M68000) || defined(__M68000) || defined(__mc68000) + #define CPU "m68000" +#elif defined(__i386__) + #define CPU "x86" +#elif defined(__x86_64__) + #define CPU "x86_64" +#else + #warning "Unsupported CPU model - check CPU define" + #define CPU "???" +#endif + +#endif // _VERSION_H_ diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/ClipboardServer.c b/workbench/classes/zune/nlist/nlisttree_mcc/ClipboardServer.c new file mode 100755 index 0000000000..cdc1477d16 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/ClipboardServer.c @@ -0,0 +1,349 @@ +/*************************************************************************** + + NList.mcc - New List MUI Custom Class + Registered MUI class, Serial Number: 1d51 0x9d510030 to 0x9d5100A0 + 0x9d5100C0 to 0x9d5100FF + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <string.h> +#include <stdlib.h> + +#include <proto/dos.h> +#include <proto/exec.h> +#include <proto/intuition.h> +#include <proto/keymap.h> +#include <proto/locale.h> + +#include <dos/dostags.h> +#include <mui/NList_mcc.h> + +// for iffparse.library no global variable definitions are needed +#define __NOLIBBASE__ +#define __NOGLOBALIFACE__ +#include <proto/iffparse.h> + +#include "private.h" + +#include "Debug.h" + +static struct Library *IFFParseBase = NULL; +#if defined(__amigaos4__) +static struct IFFParseIFace *IIFFParse = NULL; +#endif +static struct SignalSemaphore *serverLock = NULL; +static struct Process *serverProcess = NULL; +static struct MsgPort *serverPort = NULL; +static struct MsgPort replyPort; +static struct Message msg; + +struct ServerData +{ + ULONG sd_Command; + ULONG sd_Unit; + STRPTR sd_String; +}; + +#define SERVER_SHUTDOWN 0xdeadf00d +#define SERVER_WRITE 0x00000001 + +#define ID_FORM MAKE_ID('F','O','R','M') +#define ID_FTXT MAKE_ID('F','T','X','T') +#define ID_CHRS MAKE_ID('C','H','R','S') + +#ifndef MEMF_SHARED +#define MEMF_SHARED MEMF_ANY +#endif + +/// StringToClipboard +// copy a string to the clipboard, public callable function +void StringToClipboard(ULONG unit, STRPTR str) +{ + // lock out other tasks + if(AttemptSemaphore(serverLock)) + { + struct ServerData sd; + + // set up the data packet + sd.sd_Command = SERVER_WRITE; + sd.sd_Unit = unit; + sd.sd_String = str; + + if(strlen(str) > 0) + { + // set up the message, send it and wait for a reply + msg.mn_Node.ln_Name = (STRPTR)&sd; + replyPort.mp_SigTask = FindTask(NULL); + + PutMsg(serverPort, &msg); + Remove((struct Node *)WaitPort(&replyPort)); + } + else + DisplayBeep(0); + + // allow other tasks again + ReleaseSemaphore(serverLock); + } + else + DisplayBeep(0); +} + +/// +/// WriteToClipboard +// write a given string via iffparse.library to the clipboard +// non-public server side function +static void WriteToClipboard(ULONG unit, STRPTR str) +{ + struct IFFHandle *iff; + + if((iff = AllocIFF()) != NULL) + { + if((iff->iff_Stream = (IPTR)OpenClipboard(unit)) != 0) + { + InitIFFasClip(iff); + + if(OpenIFF(iff, IFFF_WRITE) == 0) + { + PushChunk(iff, ID_FTXT, ID_FORM, IFFSIZE_UNKNOWN); + PushChunk(iff, 0, ID_CHRS, IFFSIZE_UNKNOWN); + WriteChunkBytes(iff, str, strlen(str)); + PopChunk(iff); + PopChunk(iff); + + CloseIFF(iff); + } + + CloseClipboard((struct ClipboardHandle *)iff->iff_Stream); + } + + FreeIFF(iff); + } +} + +/// +/// ClipboardServer +// the clipboard server process +#if defined(__amigaos4__) +static LONG ClipboardServer(UNUSED STRPTR args, UNUSED LONG length, struct ExecBase *SysBase) +#else +static SAVEDS ASM LONG ClipboardServer(UNUSED REG(a0, STRPTR args), UNUSED REG(d0, LONG length)) +#endif +{ + struct Process *me; + struct Message *msg; + #if defined(__amigaos4__) + struct ExecIFace *IExec = (struct ExecIFace *)SysBase->MainInterface; + #endif + + ENTER(); + + D(DBF_CLIPBOARD, "clipboard server starting up"); + + me = (struct Process *)FindTask(NULL); + WaitPort(&me->pr_MsgPort); + msg = GetMsg(&me->pr_MsgPort); + + if((IFFParseBase = OpenLibrary("iffparse.library", 36)) != NULL) + { + #if defined(__amigaos4__) + + if((IIFFParse = (struct IFFParseIFace *)GetInterface(IFFParseBase, "main", 1, NULL)) != NULL) + { + #endif + struct MsgPort *mp; + + #if defined(__amigaos4__) + mp = AllocSysObjectTags(ASOT_PORT, TAG_DONE); + #else + mp = CreateMsgPort(); + #endif + if(mp != NULL) + { + BOOL running = TRUE; + + // return something as a valid reply + msg->mn_Node.ln_Name = (STRPTR)mp; + ReplyMsg(msg); + + D(DBF_CLIPBOARD, "clipboard server main loop"); + do + { + WaitPort(mp); + + while((msg = GetMsg(mp)) != NULL) + { + struct ServerData *sd = (struct ServerData *)msg->mn_Node.ln_Name; + + switch(sd->sd_Command) + { + case SERVER_SHUTDOWN: + { + running = FALSE; + } + break; + + case SERVER_WRITE: + { + WriteToClipboard(sd->sd_Unit, sd->sd_String); + } + break; + } + + ReplyMsg(msg); + } + } + while(running == TRUE); + + #if defined(__amigaos4__) + FreeSysObject(ASOT_PORT, mp); + #else + DeleteMsgPort(mp); + #endif + } + + #if defined(__amigaos4__) + DropInterface((struct Interface *)IIFFParse); + } + #endif + + CloseLibrary(IFFParseBase); + } + + D(DBF_CLIPBOARD, "clipboard server shutting down"); + + Forbid(); + + LEAVE(); + return 0; +} + +/// +/// StartClipboardServer +// launch the clipboard server process +// we must use a separate process, because accessing the clipboard via iffparse.library +// allocates 2 signals for every instance of this class. Hence we will run out of signals +// sooner or later. The separate process avoids this situation. +BOOL StartClipboardServer(void) +{ + BOOL success = FALSE; + + ENTER(); + + // create a semaphore to protect several concurrent tasks + #if defined(__amigaos4__) + serverLock = AllocSysObjectTags(ASOT_SEMAPHORE, TAG_DONE); + #else + serverLock = AllocVec(sizeof(*serverLock), MEMF_CLEAR); + #endif + if(serverLock != NULL) + { + #if defined(__amigaos4__) + uint32 oldStackSize; + #else + InitSemaphore(serverLock); + #endif + + #if defined(__amigaos4__) + // set a minimum stack size of 8K, no matter what the user has set + DosControlTags(DC_MinProcStackR, &oldStackSize, + DC_MinProcStackW, 8192, + TAG_DONE); + #endif + + // create the server process + // this must *NOT* be a child process + serverProcess = CreateNewProcTags(NP_Entry, ClipboardServer, + NP_Name, "NListtree.mcc clipboard server", + NP_Priority, 1, + NP_StackSize, 8192, + NP_WindowPtr, ~0L, + #if defined(__amigaos4__) + NP_Child, FALSE, + #elif defined(__MORPHOS__) + NP_CodeType, CODETYPE_PPC, + #endif + TAG_DONE); + if(serverProcess != NULL) + { + // we use one global reply port with a static signal bit + replyPort.mp_Node.ln_Type = NT_MSGPORT; + NewList(&replyPort.mp_MsgList); + replyPort.mp_SigBit = SIGB_SINGLE; + replyPort.mp_SigTask = FindTask(NULL); + + msg.mn_ReplyPort = &replyPort; + msg.mn_Node.ln_Name = (STRPTR)NULL; + + // send out the startup message and wait for a reply + PutMsg(&serverProcess->pr_MsgPort, &msg); + Remove((struct Node *)WaitPort(&replyPort)); + + // check whether everything went ok + if((serverPort = (struct MsgPort *)msg.mn_Node.ln_Name) != NULL) + { + success = TRUE; + } + } + + #if defined(__amigaos4__) + // restore the old minimum stack size + DosControlTags(DC_MinProcStackW, oldStackSize, + TAG_DONE); + #endif + } + + RETURN(success); + return success; +} + +/// +/// ShutdownClipboardServer +// shutdown the server process and clean up +void ShutdownClipboardServer(void) +{ + if(serverPort != NULL) + { + struct ServerData sd; + + sd.sd_Command = SERVER_SHUTDOWN; + + msg.mn_Node.ln_Name = (STRPTR)&sd; + replyPort.mp_SigTask = FindTask(NULL); + + PutMsg(serverPort, &msg); + WaitPort(&replyPort); + + serverPort = NULL; + } + + if(serverLock != NULL) + { + #if defined(__amigaos4__) + FreeSysObject(ASOT_SEMAPHORE, serverLock); + #else + FreeVec(serverLock); + #endif + + serverLock = NULL; + } +} + +/// + diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/Debug.c b/workbench/classes/zune/nlist/nlisttree_mcc/Debug.c new file mode 100644 index 0000000000..7967a9f1f1 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/Debug.c @@ -0,0 +1,420 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifdef DEBUG + +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> +#include <stdio.h> + +#include <proto/intuition.h> +#include <proto/utility.h> +#include <proto/dos.h> +#include <proto/exec.h> + +#include "SDI_compiler.h" +#include "Debug.h" +#include "version.h" + +// special flagging macros +#define isFlagSet(v,f) (((v) & (f)) == (f)) // return TRUE if the flag is set +#define hasFlag(v,f) (((v) & (f)) != 0) // return TRUE if one of the flags in f is set in v +#define isFlagClear(v,f) (((v) & (f)) == 0) // return TRUE if flag f is not set in v +#define SET_FLAG(v,f) ((v) |= (f)) // set the flag f in v +#define CLEAR_FLAG(v,f) ((v) &= ~(f)) // clear the flag f in v +#define MASK_FLAG(v,f) ((v) &= (f)) // mask the variable v with flag f bitwise + +// our static variables with default values +static int indent_level = 0; +static BOOL ansi_output = FALSE; +static ULONG debug_flags = DBF_ALWAYS | DBF_STARTUP; // default debug flags +static ULONG debug_classes = DBC_ERROR | DBC_DEBUG | DBC_WARNING | DBC_ASSERT | DBC_REPORT; // default debug classes + +/****************************************************************************/ + +void SetupDebug(void) +{ + char var[256]; + + kprintf("** NListtree.mcc v" LIB_REV_STRING " startup ***********************\n"); + kprintf("Initializing runtime debugging:\n"); + + if(GetVar("nlisttree.mcc.debug", var, sizeof(var), 0) > 0) + { + char *tok; + char *debug = var; + + // static list of our debugging classes tokens. + // in the yamdebug variable these classes always start with a @ + static struct { const char *token; unsigned long flag; } dbclasses[] = + { + { "ctrace", DBC_CTRACE }, + { "report", DBC_REPORT }, + { "assert", DBC_ASSERT }, + { "timeval", DBC_TIMEVAL }, + { "debug", DBC_DEBUG }, + { "error", DBC_ERROR }, + { "warning", DBC_WARNING }, + { "all", DBC_ALL }, + { NULL, 0 } + }; + + static struct { const char *token; unsigned long flag; } dbflags[] = + { + { "always", DBF_ALWAYS }, + { "startup", DBF_STARTUP }, + { "draw", DBF_DRAW }, + { "getset", DBF_GETSET }, + { "memory", DBF_MEMORY }, + { "listtree", DBF_LISTTREE }, + { "setup", DBF_SETUP }, + { "input", DBF_INPUT }, + { "dragdrop", DBF_DRAGDROP }, + { "images", DBF_IMAGES }, + { "notify", DBF_NOTIFY }, + { "clipboard", DBF_CLIPBOARD }, + { "all", DBF_ALL }, + { NULL, 0 } + }; + + // we parse the env variable token-wise + while((tok = strtok(debug, ", ;"))) + { + ULONG i; + + // check if the token is class definition or + // just a flag definition + if(tok[0] == '@') + { + // check if this call is a negation or not + if(tok[1] == '!') + { + // search for the token and clear the flag + for(i=0; dbclasses[i].token; i++) + { + if(stricmp(tok+2, dbclasses[i].token) == 0) + { + kprintf("clear '%s' debug class flag.\n", dbclasses[i].token); + CLEAR_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + else + { + // search for the token and set the flag + for(i=0; dbclasses[i].token; i++) + { + if(stricmp(tok+1, dbclasses[i].token) == 0) + { + kprintf("set '%s' debug class flag\n", dbclasses[i].token); + SET_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + } + else + { + // check if this call is a negation or not + if(tok[0] == '!') + { + for(i=0; dbflags[i].token; i++) + { + if(stricmp(tok+1, dbflags[i].token) == 0) + { + kprintf("clear '%s' debug flag\n", dbflags[i].token); + CLEAR_FLAG(debug_flags, dbflags[i].flag); + } + } + } + else + { + // check if the token was "ansi" and if so enable the ANSI color + // output + if(stricmp(tok, "ansi") == 0) + { + kprintf("ansi output enabled\n"); + ansi_output = TRUE; + } + else + { + for(i=0; dbflags[i].token; i++) + { + if(stricmp(tok, dbflags[i].token) == 0) + { + kprintf("set '%s' debug flag\n", dbflags[i].token); + SET_FLAG(debug_flags, dbflags[i].flag); + } + } + } + } + } + + debug = NULL; + } + } + + kprintf("set debug classes/flags (env:nlisttree.mcc.debug): %08lx/%08lx\n", debug_classes, debug_flags); + kprintf("** Normal processing follows ***************************************\n"); +} + +/****************************************************************************/ + +void CleanupDebug(void) +{ + kprintf("** Cleaned up debugging ********************************************\n"); +} + +/****************************************************************************/ + +// define variables for using ANSI colors in our debugging scheme +#define ANSI_ESC_CLR "\033[0m" +#define ANSI_ESC_BOLD "\033[1m" +#define ANSI_ESC_UNDERLINE "\033[4m" +#define ANSI_ESC_BLINK "\033[5m" +#define ANSI_ESC_REVERSE "\033[7m" +#define ANSI_ESC_INVISIBLE "\033[8m" +#define ANSI_ESC_FG_BLACK "\033[0;30m" +#define ANSI_ESC_FG_RED "\033[0;31m" +#define ANSI_ESC_FG_GREEN "\033[0;32m" +#define ANSI_ESC_FG_BROWN "\033[0;33m" +#define ANSI_ESC_FG_BLUE "\033[0;34m" +#define ANSI_ESC_FG_PURPLE "\033[0;35m" +#define ANSI_ESC_FG_CYAN "\033[0;36m" +#define ANSI_ESC_FG_LGRAY "\033[0;37m" +#define ANSI_ESC_FG_DGRAY "\033[1;30m" +#define ANSI_ESC_FG_LRED "\033[1;31m" +#define ANSI_ESC_FG_LGREEN "\033[1;32m" +#define ANSI_ESC_FG_YELLOW "\033[1;33m" +#define ANSI_ESC_FG_LBLUE "\033[1;34m" +#define ANSI_ESC_FG_LPURPLE "\033[1;35m" +#define ANSI_ESC_FG_LCYAN "\033[1;36m" +#define ANSI_ESC_FG_WHITE "\033[1;37m" +#define ANSI_ESC_BG "\033[0;4" // background esc-squ start with 4x +#define ANSI_ESC_BG_BLACK "\033[0;40m" +#define ANSI_ESC_BG_RED "\033[0;41m" +#define ANSI_ESC_BG_GREEN "\033[0;42m" +#define ANSI_ESC_BG_BROWN "\033[0;43m" +#define ANSI_ESC_BG_BLUE "\033[0;44m" +#define ANSI_ESC_BG_PURPLE "\033[0;45m" +#define ANSI_ESC_BG_CYAN "\033[0;46m" +#define ANSI_ESC_BG_LGRAY "\033[0;47m" + +/****************************************************************************/ + +INLINE void _INDENT(void) +{ + int i; + for(i=0; i < indent_level; i++) + kprintf(" "); +} + +/****************************************************************************/ + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function) +{ + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Entering %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Entering %s\n", file, line, function); + } + + indent_level++; +} + +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function) +{ + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s\n", file, line, function); + } +} + +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result) +{ + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s (result 0x%08lx, %ld)%s\n", ANSI_ESC_FG_BROWN, file, line, function, result, result, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s (result 0x%08lx, %ld)\n", file, line, function, result, result); + } +} + +/****************************************************************************/ + +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + switch(size) + { + case 1: + fmt = "%s:%ld:%s = %ld, 0x%02lx"; + break; + + case 2: + fmt = "%s:%ld:%s = %ld, 0x%04lx"; + break; + + default: + fmt = "%s:%ld:%s = %ld, 0x%08lx"; + break; + } + + _INDENT(); + + if(ansi_output) + kprintf(ANSI_ESC_FG_GREEN); + + kprintf(fmt, file, line, name, value, value); + + if(size == 1 && value < 256) + { + if(value < ' ' || (value >= 127 && value < 160)) + kprintf(", '\\x%02lx'", value); + else + kprintf(", '%lc'", value); + } + + if(ansi_output) + kprintf("%s\n", ANSI_ESC_CLR); + else + kprintf("\n"); + } +} + +/****************************************************************************/ + +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + _INDENT(); + + if(p != NULL) + fmt = "%s:%ld:%s = 0x%08lx\n"; + else + fmt = "%s:%ld:%s = NULL\n"; + + if(ansi_output) + { + kprintf(ANSI_ESC_FG_GREEN); + kprintf(fmt, file, line, name, p); + kprintf(ANSI_ESC_CLR); + } + else + kprintf(fmt, file, line, name, p); + } +} + +/****************************************************************************/ + +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s = 0x%08lx \"%s\"%s\n", ANSI_ESC_FG_GREEN, file, line, name, string, string, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s = 0x%08lx \"%s\"\n", file, line, name, string, string); + } +} + +/****************************************************************************/ + +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s%s\n", ANSI_ESC_FG_GREEN, file, line, msg, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s\n", file, line, msg); + } +} + +/****************************************************************************/ + +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...) +{ + if((isFlagSet(debug_classes, dclass) && isFlagSet(debug_flags, dflags)) || + (isFlagSet(dclass, DBC_ERROR) || isFlagSet(dclass, DBC_WARNING))) + { + va_list args; + static char buf[1024]; + + _INDENT(); + + va_start(args, format); + vsnprintf(buf, 1024, format, args); + va_end(args); + + if(ansi_output) + { + const char *highlight = ANSI_ESC_FG_GREEN; + + switch(dclass) + { + case DBC_CTRACE: highlight = ANSI_ESC_FG_BROWN; break; + case DBC_REPORT: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ASSERT: highlight = ANSI_ESC_FG_RED; break; + case DBC_TIMEVAL: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_DEBUG: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ERROR: highlight = ANSI_ESC_FG_RED; break; + case DBC_WARNING: highlight = ANSI_ESC_FG_PURPLE;break; + } + + kprintf("%s%s:%ld:%s%s\n", highlight, file, line, buf, ANSI_ESC_CLR); + } + else + kprintf("%s:%ld:%s\n", file, line, buf); + } +} + +/****************************************************************************/ + +#endif diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/Debug.h b/workbench/classes/zune/nlist/nlisttree_mcc/Debug.h new file mode 100644 index 0000000000..6d51f8f8cd --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/Debug.h @@ -0,0 +1,149 @@ +/*************************************************************************** + + TextEditor.mcc - Textediting MUI Custom Class + Copyright (C) 1997-2000 Allan Odgaard + Copyright (C) 2005 by TextEditor.mcc Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + TextEditor class Support Site: http://www.sf.net/projects/texteditor-mcc + + $Id$ + +***************************************************************************/ + +#ifndef DEBUG_H +#define DEBUG_H + +// first we make sure all previously defined symbols are undefined now so +// that no other debug system interferes with ours. +#undef ENTER +#undef LEAVE +#undef RETURN +#undef SHOWVALUE +#undef SHOWPOINTER +#undef SHOWSTRING +#undef SHOWMSG +#undef STARTCLOCK +#undef STOPCLOCK +#undef D +#undef E +#undef W +#undef ASSERT + +#if defined(DEBUG) + +#include <assert.h> + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +#if defined(__amigaos4__) + #include <proto/exec.h> + #ifdef __USE_INLINE__ + #ifdef DebugPrintF + #undef DebugPrintF + #endif + #endif + #ifndef kprintf + #define kprintf(format, args...) ((struct ExecIFace *)((*(struct ExecBase **)4)->MainInterface))->DebugPrintF(format, ## args) + #endif +#elif defined(__MORPHOS__) + #include <exec/rawfmt.h> + #include <proto/exec.h> + #define KPutFmt(format, args) VNewRawDoFmt(format, (APTR)RAWFMTFUNC_SERIAL, NULL, args) +void kprintf(const char *formatString,...); +#else +void kprintf(const char *formatString,...); +#endif + +// debug classes +#define DBC_CTRACE (1<<0) // call tracing (ENTER/LEAVE etc.) +#define DBC_REPORT (1<<1) // reports (SHOWVALUE/SHOWSTRING etc.) +#define DBC_ASSERT (1<<2) // asserts (ASSERT) +#define DBC_TIMEVAL (1<<3) // time evaluations (STARTCLOCK/STOPCLOCK) +#define DBC_DEBUG (1<<4) // debugging output D() +#define DBC_ERROR (1<<5) // error output E() +#define DBC_WARNING (1<<6) // warning output W() +#define DBC_ALL 0xffffffff + +// debug flags +#define DBF_ALWAYS (1<<0) +#define DBF_STARTUP (1<<1) // for startup/shutdown events (YAM.c) +#define DBF_DRAW (1<<2) // drawing operations +#define DBF_GETSET (1<<3) // getting/setting attributes +#define DBF_MEMORY (1<<4) // memory handling +#define DBF_LISTTREE (1<<5) // modifications to the listtree +#define DBF_SETUP (1<<6) // MUIM_Setup/Cleanup +#define DBF_INPUT (1<<7) // input handling +#define DBF_DRAGDROP (1<<8) // drag'n'drop handling +#define DBF_IMAGES (1<<9) // image handling +#define DBF_NOTIFY (1<<10) // notification handling +#define DBF_CLIPBOARD (1<<11) // clipboard handling +#define DBF_ALL 0xffffffff + +void SetupDebug(void); +void CleanupDebug(void); + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function); +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function); +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result); +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line); +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line); +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line); +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line); +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...); + +// Core class information class messages +#define ENTER() _ENTER(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define LEAVE() _LEAVE(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define RETURN(r) _RETURN(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__, (long)r) +#define SHOWVALUE(f, v) _SHOWVALUE(DBC_REPORT, f, (long)v, sizeof(v), #v, __FILE__, __LINE__) +#define SHOWPOINTER(f, p) _SHOWPOINTER(DBC_REPORT, f, p, #p, __FILE__, __LINE__) +#define SHOWSTRING(f, s) _SHOWSTRING(DBC_REPORT, f, s, #s, __FILE__, __LINE__) +#define SHOWMSG(f, m) _SHOWMSG(DBC_REPORT, f, m, __FILE__, __LINE__) +#define D(f, s, vargs...) _DPRINTF(DBC_DEBUG, f, __FILE__, __LINE__, s, ## vargs) +#define E(f, s, vargs...) _DPRINTF(DBC_ERROR, f, __FILE__, __LINE__, s, ## vargs) +#define W(f, s, vargs...) _DPRINTF(DBC_WARNING, f, __FILE__, __LINE__, s, ## vargs) +#define ASSERT(expression) \ + ((void) \ + ((expression) ? 0 : \ + ( \ + _DPRINTF(DBC_ASSERT, \ + DBF_ALWAYS, \ + __FILE__, \ + __LINE__, \ + "failed assertion '%s'", \ + #expression), \ + assert(#expression), \ + 0 \ + ) \ + ) \ + ) + +#else // DEBUG + +#define ENTER() ((void)0) +#define LEAVE() ((void)0) +#define RETURN(r) ((void)0) +#define SHOWVALUE(f, v) ((void)0) +#define SHOWPOINTER(f, p) ((void)0) +#define SHOWSTRING(f, s) ((void)0) +#define SHOWMSG(f, m) ((void)0) +#define D(f, s, vargs...) ((void)0) +#define E(f, s, vargs...) ((void)0) +#define W(f, s, vargs...) ((void)0) +#define ASSERT(expression) ((void)0) + +#endif // DEBUG + +#endif // DEBUG_H diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/Makefile b/workbench/classes/zune/nlist/nlisttree_mcc/Makefile new file mode 100644 index 0000000000..f2fc9fedf9 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/Makefile @@ -0,0 +1,426 @@ +#/*************************************************************************** +# +# NListtree.mcc - New Listtree MUI Custom Class +# Copyright (C) 1999-2001 by Carsten Scholling +# Copyright (C) 2001-2005 by NList Open Source Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# NList classes Support Site: http://www.sf.net/projects/nlist-classes +# +# $Id$ +# +#***************************************************************************/ + +########################################################################### +# This makefile is a very generic one. It tries to identify both, the host +# and the target operating system for which YAM should be compiled. +# However, this auto-detection can be easily overridden by directly +# specifying an option on the commandline while calling 'make'. +# +# Example: +# +# # to explicitly compile for AmigaOS3 +# > make OS=os3 +# +# # to compile for AmigaOS4 but with debugging +# > make OS=os4 DEBUG= +# + +############################################# +# find out the HOST operating system +# on which this makefile is run +HOST ?= $(shell uname) +ifeq ($(HOST), AmigaOS) + ifeq ($(shell uname -m), powerpc) + HOST = AmigaOS4 + endif + ifeq ($(shell uname -m), ppc) + HOST = AmigaOS4 + endif +endif + +# if no host is identifed (no uname tool) +# we assume a AmigaOS build +ifeq ($(HOST),) + HOST = AmigaOS +endif + +############################################# +# now we find out the target OS for +# which we are going to compile YAM in case +# the caller didn't yet define OS himself +ifndef (OS) + ifeq ($(HOST), AmigaOS4) + OS = os4 + else + ifeq ($(HOST), AmigaOS) + OS = os3 + else + ifeq ($(HOST), MorphOS) + OS = mos + else + ifeq ($(HOST), AROS) + # now we find out which CPU system aros will be used + ifeq ($(shell uname -m), powerpc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), ppc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), i386) + OS = aros-i386 + endif + ifeq ($(shell uname -m), i686) + OS = aros-i686 + endif + ifeq ($(shell uname -m), x86_64) + OS = aros-x86_64 + endif + else + OS = os4 + endif + endif + endif + endif +endif + +############################################# +# define common commands we use in this +# makefile. Please note that each of them +# might be overridden on the commandline. + +# common commands +FLEX = flex +FC = flexcat +EXPR = expr +DATE = date +RM = delete force +RMDIR = delete force all +MKDIR = makedir +CHMOD = protect FLAGS=rwed +SED = sed +CP = copy +CC = gcc +STRIP = strip +OBJDUMP = objdump + +# path definitions +CDUP = / +CDTHIS= + +# override some variables for non-native builds (cross-compiler) +ifneq ($(HOST), AmigaOS) +ifneq ($(HOST), AmigaOS4) +ifneq ($(HOST), MorphOS) + + # when we end up here this is either a unix or Aros host + # so lets use unix kind of commands + RM = rm -f + RMDIR = rm -rf + MKDIR = mkdir -p + CHMOD = chmod 755 + CP = cp -f + + CDUP = ../ + CDTHIS= ./ + +endif +endif +endif + +########################################################################### +# CPU and DEBUG can be defined outside, defaults to above +# using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug +# PPC-603e version +# +# OPTFLAGS are disabled by DEBUG normally! +# +# ignored warnings are: +# none - because we want to compile with -Wall all the time + +# Common Directories +PREFIX = $(CDTHIS) +OBJDIR = .obj_$(OS) +BINDIR = bin_$(OS) +VPATH = $(OBJDIR) +DEPFILE = Makefile.dep +DESTDIR = MUI:Libs/MUI + +# target definition +TARGET = $(BINDIR)/NListtree.mcc +TESTTARGET= $(BINDIR)/NListtree-Test + +# Common compiler/linker flags +WARN = -W -Wall -Wwrite-strings -Wpointer-arith -Wsign-compare +OPTFLAGS = -O3 -fomit-frame-pointer -funroll-loops +DEBUG = -DDEBUG -O0 +DEBUGSYM = -g -gstabs +CFLAGS = -I. -I../nlisttree_mcp -I../include $(CPU) $(WARN) \ + $(OPTFLAGS) $(DEBUG) $(DEBUGSYM) $(USER_CFLAGS) -c +LDFLAGS = $(CPU) $(DEBUGSYM) +LDLIBS = + +########################################################################### +# object files definition +# + +LOBJS = library.o + +COBJS = NListtree.o \ + ClipboardServer.o \ + QuickSort.o \ + Debug.o + +TOBJS = #NListtree-Test.o + +MCCOBJS = $(addprefix $(OBJDIR)/,$(LOBJS)) $(addprefix $(OBJDIR)/,$(COBJS)) +TESTOBJS = $(addprefix $(OBJDIR)/,$(COBJS)) $(addprefix $(OBJDIR)/,$(TOBJS)) + +# different options per target OS +ifeq ($(OS), os4) + + ############################## + # AmigaOS4 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS4) + CC = ppc-amigaos-gcc + STRIP = ppc-amigaos-strip + OBJDUMP = ppc-amigaos-objdump + endif + + # Compiler/Linker flags + CRT = newlib + CPU = -mcpu=powerpc + WARN += -Wdeclaration-after-statement -Wdisabled-optimization + CFLAGS += -mcrt=$(CRT) -D__USE_INLINE__ -D__NEW_TIMEVAL_DEFINITION_USED__ \ + -DNO_PPCINLINE_STDARG -Wa,-mregnames + LDFLAGS += -mcrt=$(CRT) + + # additional object files required + M68KSTUBS = $(OBJDIR)/mccclass_68k.o + +else +ifeq ($(OS), os3) + + ############################## + # AmigaOS3 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS) + CC = m68k-amigaos-gcc + STRIP = m68k-amigaos-strip + OBJDUMP = m68k-amigaos-objdump + endif + + # Compiler/Linker flags + CPU = -m68020-60 -msoft-float + CFLAGS += -noixemul -DNO_INLINE_STDARG -D__amigaos3__ + LDFLAGS += -noixemul + LDLIBS += -ldebug -lmui + + # additional object files required + COBJS += vastubs.o + +else +ifeq ($(OS), mos) + + ############################## + # MorphOS + + # Compiler/link/strip commands + ifneq ($(HOST), MorphOS) + CC = ppc-morphos-gcc + STRIP = ppc-morphos-strip + OBJDUMP = ppc-morphos-objdump + endif + + # Compiler/Linker flags + CPU = -mcpu=powerpc + CFLAGS += -noixemul -DNO_PPCINLINE_STDARG + LDFLAGS += -noixemul + LDLIBS += -ldebug + +else +ifeq ($(OS), aros-i386) + + ############################## + # AROS (i386) + + ifneq ($(HOST), AROS) + CC = i386-aros-gcc + STRIP = i386-aros-strip + OBJDUMP = i386-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-ppc) + + ############################## + # AROS (PPC) + + ifneq ($(HOST), AROS) + CC = ppc-aros-gcc + STRIP = ppc-aros-strip + OBJDUMP = ppc-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-x86_64) + + ############################## + # AROS (x86_64) + + ifneq ($(HOST), AROS) + CC = x86_64-aros-gcc + STRIP = x86_64-aros-strip + OBJDUMP = x86_64-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +endif +endif +endif +endif +endif +endif + +# main target +.PHONY: all +ifeq ($(wildcard $(DEPFILE)),$(DEPFILE)) +# great, we have a dependecies file, let's make our target +all: $(BINDIR) $(OBJDIR) $(M68KSTUBS) $(TARGET) #$(TESTTARGET) +else +# no dependecies, create it and then call make again +all: depend + @make --no-print-directory all +endif + +# for making a release we compile ALL target with no debug +release: + @echo " CC $<" + make OS=os4 clean + make OS=os4 DEBUG= + @echo " CC $<" + make OS=os3 clean + make OS=os3 DEBUG= + @echo " CC $<" + make OS=mos clean + make OS=mos DEBUG= + @echo " CC $<" + make OS=aros-i386 clean + make OS=aros-i386 DEBUG= + @echo " CC $<" + make OS=aros-ppc clean + make OS=aros-ppc DEBUG= + @echo " CC $<" + make OS=aros-x86_64 clean + make OS=aros-x86_64 DEBUG= + +# make the object directories +$(OBJDIR): + @echo " MK $@" + @$(MKDIR) $(OBJDIR) + +# make the binary directories +$(BINDIR): + @echo " MK $@" + @$(MKDIR) $(BINDIR) + +# for compiling single .c files +$(OBJDIR)/%.o: %.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +$(OBJDIR)/mccclass_68k.o: ../include/mccclass_68k.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +# for linking the target +$(TARGET): $(M68KSTUBS) $(MCCOBJS) + @echo " LD $@.debug" + @$(CC) -nostartfiles $(LDFLAGS) -o $@.debug $(MCCOBJS) $(M68KSTUBS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +# for linking the target +$(TESTTARGET): $(TESTOBJS) + @echo " LD $@.debug" + @$(CC) $(LDFLAGS) -o $@.debug $(TESTOBJS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +.PHONY: dump +dump: + -$(OBJDUMP) --section-headers --all-headers --reloc --disassemble-all $(TARGET) >$(TARGET).dump + +.PHONY: clean +clean: + -$(RM) $(TARGET) $(TARGET).debug $(TARGET).map + -$(RM) $(TESTTARGET) $(TESTTARGET).debug $(TESTTARGET).map + -$(RM) $(MCCOBJS) $(TESTOBJS) $(M68KSTUBS) + +.PHONY: distclean +distclean: clean + -$(RMDIR) $(OBJDIR) + -$(RMDIR) $(BINDIR) + +# install +.PHONY: install +install: all + @echo " IN $(TARGET)" + @$(CP) $(TARGET) $(DESTDIR) + +.PHONY: help +help: + @echo "Cleaning targets:" + @echo " clean - Cleanup working directory for clean compile" + @echo " distclean - Also cleanup autogenerated files" + @echo "" + @echo "Other generic targets:" + @echo " all - Build $(TARGET)" + @echo " catalogs - Build all available catalogs" + @echo "" + @echo "Install targets:" + @echo " install - Install $(TARGET) into $(DESTDIR)" + @echo "" + @echo "Parameters:" + @echo " make OS=os3|os4|mos|aros-i386|aros-i686|aros-ppc|aros-x86_64" + @echo " make DEBUG= : build $(TARGET) without debugging information" + @echo "" + +## DEPENDENCY GENERATION ############## + +.PHONY: depend +depend: + @echo " MK $(DEPFILE)" + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >$(DEPFILE) + @$(CC) -MM -MG $(CFLAGS) $(wildcard *.c) >>$(DEPFILE) + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >>$(DEPFILE) + @$(SED) -i 's,^\(.*\)\.o:,$$\(OBJDIR\)/\1.o:,g' $(DEPFILE) + +# include dependencies file +-include $(DEPFILE) diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/Makefile.dep b/workbench/classes/zune/nlist/nlisttree_mcc/Makefile.dep new file mode 100644 index 0000000000..9aa7455a42 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/Makefile.dep @@ -0,0 +1,26 @@ +# AUTOGENERATED! DO NOT EDIT!!! +$(OBJDIR)/ClipboardServer.o: ClipboardServer.c ../include/mui/NList_mcc.h \ + ../include/libraries/mui.h private.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h Debug.h ../include/amiga-align.h \ + ../include/default-align.h +$(OBJDIR)/Debug.o: Debug.c ../include/SDI_compiler.h Debug.h version.h +$(OBJDIR)/library.o: library.c NListtree.h private.h ../include/libraries/mui.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h ../include/mui/NList_mcc.h \ + Debug.h ../include/amiga-align.h ../include/default-align.h version.h \ + ../include/mccinit.c ../include/proto/muimaster.h \ + ../include/interfaces/muimaster.h ../include/inline4/muimaster.h +$(OBJDIR)/NListtree.o: NListtree.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h ../include/mui/NList_mcc.h Debug.h \ + ../include/amiga-align.h ../include/default-align.h NListtree.h \ + version.h ../include/muiextra.h +$(OBJDIR)/QuickSort.o: QuickSort.c NListtree.h private.h ../include/libraries/mui.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h ../include/mui/NList_mcc.h \ + Debug.h ../include/amiga-align.h ../include/default-align.h +$(OBJDIR)/vastubs.o: vastubs.c +# AUTOGENERATED! DO NOT EDIT!!! diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/NListtree.c b/workbench/classes/zune/nlist/nlisttree_mcc/NListtree.c new file mode 100644 index 0000000000..9c013e0233 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/NListtree.c @@ -0,0 +1,10639 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/****** NListtree.mcc/--background-- ***************************************** +* +* There are two possible entry-types in a NListtree class list: +* Leaves and nodes. Leaves are simple entries which have no special +* features except they are holding some data. Nodes are almost +* the same type, holding data too, but having a list attached +* where you can simply add other entries which can be again leaves +* or nodes. +* +* Every node is structured as follows: +* +* struct MUI_NListtree_TreeNode { +* +* struct MinNode tsn_Node; +* STRPTR tn_Name; +* UWORD tn_Flags; +* APTR tn_User; +* }; +* +* It contains a name field tn_Name, flags tn_Flags and a pointer to +* user data tn_User. +* +* The tn_Flags field can hold the following flags: +* +* TNF_LIST The node contains a list where other nodes +* can be inserted. +* +* TNF_OPEN The list node is open, sub nodes are displayed. +* +* TNF_FROZEN The node doesn't react on doubleclick or +* open/close by the user. +* +* TNF_NOSIGN The indicator of list nodes isn't shown. +* +* TNF_SELECTED The entry is currently selected. +* +* These flags, except TNF_SELECTED, can be used in +* MUIM_NListtree_Insert at creation time. They will be passed to +* the newly created entry. Also you can do a quick check about the +* state and kind of each entry. But - NEVER EVER - modify any flag +* yourself or NListtree will crash. Be warned! +* +* ********************************************************************* +* THE ABOVE STRUCT IS READ-ONLY!! NEVER CHANGE ANY ENTRY OF THIS +* STRUCTURE DIRECTLY NOR THINK ABOUT THE CONTENTS OF ANY PRIVATE +* FIELD OR YOU WILL DIE IN HELL! +* ********************************************************************* +* +* +* You can create very complex tree structures. NListtree only uses +* one list which holds all information needed and has no extra +* display list like other list tree classes ;-) +* +* The tree nodes can be inserted and removed, sorted, moved, exchanged, +* renamed or multi selected. To sort you can also drag&drop them. +* Modifications can be made in relation to the whole tree, to only one +* level, to a sub-tree or to only one tree node. +* +* The user can control the listtree by the MUI keys, this means a node +* is opened with "Right" and closed with "Left". Check your MUI prefs +* for the specified keys. +* +* You can define which of the columns will react on double-clicking. +* The node toggles its status from open or closed and vice versa. +* +* +* Drag&Drop capabilities: +* +* If you set MUIA_NList_DragSortable to TRUE, the list tree will +* become active for Drag&Drop. This means you can drag and drop +* entries on the same list tree again. While dragging an indicator +* shows where to drop. +* +* Drag a Drop on Result +* +* leaf leaf Exchange leaves. +* node leaf Nothing happens. +* entry closed node Move entry, the compare hook is used. +* entry open node Move entry to defined position. +* +* You can not drop an entry on itself, nor can you drop an opened node on +* any of its members. +* +* To exchange data with other objects, you have to create your own +* subclass of NListtree class and react on the drag methods. +* +* +* Author: Carsten Scholling (c)1999-2000 email: cs@aphaso.de +* +****************************************************************************** +* +*/ + +/* +** Includes +*/ +#include <string.h> +#include <stdlib.h> +#include <stdio.h> + +#include <graphics/gfxmacros.h> +#undef GetOutlinePen + +#include <libraries/gadtools.h> +#include <clib/alib_protos.h> +#include <clib/macros.h> +#include <proto/muimaster.h> +#include <proto/intuition.h> +#include <proto/graphics.h> +#include <proto/utility.h> +#include <proto/exec.h> + +#include "private.h" + +#include "NListtree.h" +#include "version.h" +#include "muiextra.h" + +#define DATA_BUF_SIZE 4096 + +/*********************************************************************************************/ + +// stack definition (where is this used!?) +LONG __stack = 16384; + +/* +** Small helpful macros... +*/ +#define DIFF(a,b) (MAX((a),(b))-MIN((a),(b))) +#define LIBVER(lib) ((struct Library *)(lib))->lib_Version +#define CLN(x) ((struct MUI_NListtree_ListNode *)(x)) +#define CTN(x) ((struct MUI_NListtree_TreeNode *)(x)) + +/* +** Type definition for compare function. +*/ + +void qsort2(struct MUI_NListtree_TreeNode **table, ULONG entries, struct NListtree_Data *data); + +/* +** Some prototypes. +*/ +ULONG MultiTestFunc( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, LONG seltype, LONG selflags ); + +struct TreeImage_Data +{ + Object *obj; + LONG spec; +}; + +#if !defined(__MORPHOS__) +#ifdef __AROS__ +static __attribute__ ((noinline)) Object * VARARGS68K DoSuperNew(struct IClass *cl, Object *obj, Tag tag1, ...) +{ + AROS_SLOWSTACKTAGS_PRE_AS(tag1, Object *) + retval = (Object *)DoSuperMethod(cl, obj, OM_NEW, AROS_SLOWSTACKTAGS_ARG(tag1), NULL); + AROS_SLOWSTACKTAGS_POST +} +#else +static Object * VARARGS68K DoSuperNew(struct IClass *cl, Object *obj, ...) +{ + Object *rc; + VA_LIST args; + + ENTER(); + + VA_START(args, obj); + rc = (Object *)DoSuperMethod(cl, obj, OM_NEW, VA_ARG(args, ULONG), NULL); + VA_END(args); + + RETURN(rc); + return rc; +} +#endif // __AROS__ +#endif // !__MORPHOS__ + +/*****************************************************************************\ +******************************************************************************* +** +** Graphic and drawing functions. +** +******************************************************************************* +\*****************************************************************************/ + +/* +** Set A/B-Pen and DrawMode depending on OS version. +*/ +INLINE VOID MySetABPenDrMd( struct RastPort *rp, LONG apen, LONG bpen, UBYTE drmd ) +{ + if ( LIBVER( GfxBase ) >= 39 ) + SetABPenDrMd( rp, apen, bpen, drmd ); + else + { + SetAPen( rp, apen ); + SetBPen( rp, bpen ); + SetDrMd( rp, drmd ); + } +} + + +/* +** Draw a simple line from l/t to r/b. All lines are pure horiz. or vert.! +*/ +INLINE VOID DrawLine( struct RastPort *rp, WORD l, WORD t, WORD r, WORD b ) +{ + Move( rp, l, t ); + Draw( rp, r, b ); +} + + +/* +** Draw windows line l/t to r/b. All +** lines are pure horiz. or vert.! +*/ +INLINE VOID DrawLineDotted( struct RastPort *rp, WORD l, WORD t, WORD r, WORD b ) +{ + if ( l == r ) + { + while( t <= b ) + { + WritePixel( rp, l, t ); + t += 2; + } + } + else + { + while( l <= r ) + { + WritePixel( rp, l, t ); + l += 2; + } + } +} + + + +/* +** Draw a vertical bar. +*/ +INLINE VOID DrawTreeVertBar( struct TreeImage_Data *data, struct MyImage *im, WORD l, WORD t, UNUSED WORD r, WORD b ) +{ + struct RastPort *rp = (struct RastPort *)_rp( data->obj ); + UWORD m = l + ( im->nltdata->MaxImageWidth - 1 ) / 2; + + ENTER(); + + switch(im->nltdata->LineType) + { + case MUICFGV_NListtree_LineType_Disabled: + // nothing + break; + + case MUICFGV_NListtree_LineType_Normal: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLine( rp, m, t, m, b ); + } + break; + + case MUICFGV_NListtree_LineType_Dotted: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLineDotted( rp, m, t, m, b ); + } + break; + + case MUICFGV_NListtree_LineType_Shadow: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Shadow] ) ); + DrawLine( rp, m+1, t, m+1, b ); + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLine( rp, m, t, m, b ); + } + break; + + case MUICFGV_NListtree_LineType_Glow: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Shadow] ) ); + DrawLine( rp, m + 2, t, m + 2, b ); + + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLine( rp, m, t, m, b ); + + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Glow] ) ); + DrawLine( rp, m - 1, t, m - 1, b ); + DrawLine( rp, m+1, t, m+1, b ); + } + break; + } + + LEAVE(); +} + + +/* +** Draw a vertical T bar. +*/ +INLINE VOID DrawTreeVertBarT( struct TreeImage_Data *data, struct MyImage *im, WORD l, WORD t, WORD r, WORD b ) +{ + struct RastPort *rp = (struct RastPort *)_rp( data->obj ); + UWORD m = l + ( im->nltdata->MaxImageWidth - 1 ) / 2; + UWORD h = t + ( b - t ) / 2; + + ENTER(); + + switch(im->nltdata->LineType) + { + case MUICFGV_NListtree_LineType_Disabled: + // nothing + break; + + case MUICFGV_NListtree_LineType_Normal: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLine( rp, m, t, m, b ); + DrawLine( rp, m, h, r, h ); + } + break; + + case MUICFGV_NListtree_LineType_Dotted: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLineDotted( rp, m, t, m, b ); + DrawLineDotted( rp, m, h, m + (im->nltdata->MaxImageWidth-1)/2 + im->nltdata->IndentWidth, h ); + } + break; + + case MUICFGV_NListtree_LineType_Shadow: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Shadow] ) ); + DrawLine( rp, m+1, t, m+1, b ); + DrawLine( rp, m+1, h + 1, r, h + 1 ); + + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLine( rp, m, t, m, b ); + DrawLine( rp, m, h, r, h ); + } + break; + + case MUICFGV_NListtree_LineType_Glow: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Shadow] ) ); + DrawLine( rp, m + 2, t, m + 2, b ); + DrawLine( rp, m + 3, h + 2, r, h + 2 ); + + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Glow] ) ); + DrawLine( rp, m - 1, t, m - 1, b ); + DrawLine( rp, m+1, t, m+1, b ); + + DrawLine( rp, m+1, h - 1, r, h - 1 ); + DrawLine( rp, m+1, h + 1, r, h + 1 ); + + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLine( rp, m, t, m, b ); + DrawLine( rp, m, h, r, h ); + } + break; + } + + LEAVE(); +} + + + +/* +** Draw a vertical end bar. +*/ +INLINE VOID DrawTreeVertBarEnd( struct TreeImage_Data *data, struct MyImage *im, WORD l, WORD t, WORD r, WORD b ) +{ + struct RastPort *rp = (struct RastPort *)_rp( data->obj ); + UWORD m = l + ( im->nltdata->MaxImageWidth - 1 ) / 2; + UWORD h = t + ( b - t ) / 2; + + ENTER(); + + switch(im->nltdata->LineType) + { + case MUICFGV_NListtree_LineType_Disabled: + // nothing + break; + + case MUICFGV_NListtree_LineType_Normal: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLine( rp, m, t, m, h ); + DrawLine( rp, m, h, r, h ); + } + break; + + case MUICFGV_NListtree_LineType_Dotted: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLineDotted( rp, m, t, m, h ); + DrawLineDotted( rp, m, h, m + (im->nltdata->MaxImageWidth-1)/2 + im->nltdata->IndentWidth, h ); + } + break; + + case MUICFGV_NListtree_LineType_Shadow: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Shadow] ) ); + DrawLine( rp, m+1, t, m+1, h ); + DrawLine( rp, m+1, h + 1, r, h + 1 ); + + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLine( rp, m, t, m, h ); + DrawLine( rp, m, h, r, h ); + } + break; + + case MUICFGV_NListtree_LineType_Glow: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Shadow] ) ); + DrawLine( rp, m + 2, t, m + 2, h - 2 ); + DrawLine( rp, m, h + 2, r, h + 2 ); + + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Glow] ) ); + DrawLine( rp, m - 1, t, m - 1, h ); + DrawLine( rp, m+1, h - 1, r, h - 1 ); + + DrawLine( rp, m+1, t, m+1, h ); + DrawLine( rp, m - 1, h + 1, r, h + 1 ); + + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLine( rp, m , t, m, h ); + DrawLine( rp, m, h, r, h ); + } + break; + } + + LEAVE(); +} + + +/* +** Draw a horizontal bar. +*/ +INLINE VOID DrawTreeHorBar( struct TreeImage_Data *data, struct MyImage *im, WORD l, WORD t, WORD r, WORD b ) +{ + struct RastPort *rp = (struct RastPort *)_rp( data->obj ); + UWORD h = t + ( b - t ) / 2; + + ENTER(); + + switch(im->nltdata->LineType) + { + case MUICFGV_NListtree_LineType_Disabled: + // nothing + break; + + case MUICFGV_NListtree_LineType_Normal: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLine( rp, l-1, h, r+1, h ); + } + break; + + case MUICFGV_NListtree_LineType_Dotted: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLineDotted( rp, l-1, h, r+1, h ); + } + break; + + case MUICFGV_NListtree_LineType_Shadow: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Shadow] ) ); + DrawLine( rp, l-1, h + 1, r+1, h + 1 ); + + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLine( rp, l-1, h, r+1, h ); + } + break; + + case MUICFGV_NListtree_LineType_Glow: + { + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Shadow] ) ); + DrawLine( rp, l-1, h + 2, r, h + 2 ); + + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Glow] ) ); + DrawLine( rp, l-1, h - 1, r, h - 1 ); + DrawLine( rp, l-1, h + 1, r, h + 1 ); + + SetAPen( rp, MUIPEN( im->nltdata->Pen[PEN_Line] ) ); + DrawLine( rp, l-1, h, r, h ); + } + break; + } + + LEAVE(); +} + + + +/*****************************************************************************\ +******************************************************************************* +** +** Tree image class functions. +** +******************************************************************************* +\*****************************************************************************/ + +/* +** Draw function for special tree image class. +*/ +IPTR TreeImage_Draw(struct IClass *cl, Object *obj, struct MUIP_Draw *msg) +{ + struct TreeImage_Data *data = INST_DATA( cl, obj ); + + DoSuperMethodA( cl, obj, (Msg)msg); + + if ( ( msg->flags & MADF_DRAWOBJECT ) || ( msg->flags & MADF_DRAWUPDATE ) ) + { + struct MyImage *im; + WORD l, t, r, b; + + D(DBF_DRAW, "DRAW SPEC: %ld - %ld/%ld/%ld/%ld", data->spec, _defwidth(obj), _defheight(obj), _minwidth(obj), _minheight(obj)); + D(DBF_DRAW, "%ld/%ld/%ld/%ld", _left(obj), _top(obj), _right(obj), _bottom(obj)); + + im = (struct MyImage *)xget( obj, MUIA_UserData ); + + l = _left( obj ); + t = _top( obj ); + r = _right( obj ); + b = _bottom( obj ); + + SetDrMd( _rp( obj ), JAM1 ); + + switch( data->spec ) + { + case SPEC_Vert: + DrawTreeVertBar( data, im, l, t, r, b ); + break; + + case SPEC_VertT: + DrawTreeVertBarT( data, im, l, t, r, b ); + break; + + case SPEC_VertEnd: + DrawTreeVertBarEnd( data, im, l, t, r, b ); + break; + + case SPEC_Hor: + DrawTreeHorBar( data, im, l, t, r, b ); + break; + + default: + break; + } + } + + msg->flags = 0; + + return( 0 ); +} + + +/* +** Special tree image class creation. +*/ +IPTR TreeImage_New(struct IClass *cl, Object *obj, struct opSet *msg) +{ + struct TreeImage_Data *data; + + if ( !( obj = (Object *)DoSuperMethodA( cl, obj, (Msg)msg) ) ) + return( 0 ); + + ENTER(); + + data = INST_DATA( cl, obj ); + + data->obj = obj; + data->spec = 0; + + RETURN(obj); + return (IPTR)obj; +} + + +/* +** Attribute setting function for special tree image class. +*/ +ULONG TreeImage_Set(struct IClass *cl, Object *obj, Msg msg) +{ + struct TreeImage_Data *data = INST_DATA( cl, obj ); + struct TagItem *tags, *tag; + + for(tags = ((struct opSet *)msg)->ops_AttrList; (tag = (struct TagItem *)NextTagItem((APTR)&tags));) + { + switch( tag->ti_Tag ) + { + case MUIA_TI_Spec: + data->spec = tag->ti_Data; + break; + } + } + + D(DBF_IMAGES, "SET SPEC: %ld", data->spec); + + return( 0 ); +} + + +/* +** Dispatcher for the special tree image class. +*/ + +DISPATCHER(TreeImage_Dispatcher) +{ + switch( msg->MethodID ) + { + case OM_NEW: return( TreeImage_New( cl, obj, (APTR)msg) ); + case OM_SET: return( TreeImage_Set( cl, obj, (APTR)msg) ); + case MUIM_Draw: return( TreeImage_Draw( cl, obj, (APTR)msg) ); + } + + return( DoSuperMethodA( cl, obj, msg) ); +} + +/* +** Dispatcher for the special tree image class no. 2. +** Get the maximum width of images. +*/ +DISPATCHER(NodeImage_Dispatcher) +{ + if ( msg->MethodID == MUIM_Show ) + { + struct MyImage *im; + UWORD w, h; + + im = (struct MyImage *)xget( obj, MUIA_UserData ); + + w = _defwidth( obj ); + h = _defheight( obj ); + + if ( im->nltdata->MaxImageWidth < w ) + im->nltdata->MaxImageWidth = w; + + if ( im->nltdata->MaxImageHeight < h ) + { + im->nltdata->MaxImageHeight = h; + + if ( xget( obj, MUIA_NList_LineHeight ) < h ) + nnset( im->nltdata->Obj, MUIA_NList_MinLineHeight, h ); + } + + D(DBF_IMAGES, "=====> DefWidth: %ld, DefHeight: %ld, MaxWidth: %ld", w, h, im->nltdata->MaxImageWidth); + } + + return( DoSuperMethodA( cl, obj, (Msg)msg) ); +} + +/*****************************************************************************\ +******************************************************************************* +** +** Helpful handling functions. +** +******************************************************************************* +\*****************************************************************************/ + +/* MorphOS, OS4 and AROS support Alloc/FreeVecPooled internally */ +#if !defined(__MORPHOS__) && !defined(__amigaos4__) && !defined(__AROS__) /* MorphOS and OS4 support Alloc/FreeVecPooled internally */ + +#ifdef MYDEBUG +ULONG totalmem = 0; +#endif + +/* +** Allocate pooled memory. +*/ +INLINE APTR AllocVecPooled( APTR mempool, ULONG size ) +{ + ULONG *mem; + + if((mem = (ULONG *)AllocPooled(mempool, size + 4))) + { +#ifdef MYDEBUG + totalmem += size; + D(DBF_MEMORY, "0x%08lx = AllocPooled( mempool, %ld ) ==> total: %ld", mem, size + 4, totalmem); +#endif + + *mem++ = size; + } + + return( (APTR)mem ); +} + + +/* +** Free previously allocated pool memory. +*/ +INLINE VOID FreeVecPooled( APTR mempool, APTR mem ) +{ + ULONG *m = (ULONG *)mem; + +#ifdef MYDEBUG + totalmem -= m[-1]; + D(DBF_MEMORY, " FreePooled( mempool, 0x%08lx, %ld ) ==> total: %ld", &m[-1], m[-1] + 4, totalmem); +#endif + + FreePooled( mempool, &m[-1], m[-1] + 4 ); +} + +#endif /* !__MORPHOS__ && !__amigaos4__ */ + +#if !defined(__amigaos4__) && !defined(__AROS__) +struct Node *GetSucc(struct Node *node) +{ + struct Node *result = NULL; + + if(node != NULL && node->ln_Succ != NULL && node->ln_Succ->ln_Succ != NULL) + result = node->ln_Succ; + + return result; +} + +struct Node *GetPred(struct Node *node) +{ + struct Node *result = NULL; + + if(node != NULL && node->ln_Pred != NULL && node->ln_Pred->ln_Pred != NULL) + result = node->ln_Pred; + + return result; +} + +struct Node *GetHead(struct List *list) +{ + struct Node *result = NULL; + + if(list != NULL && IsListEmpty(list) == FALSE) + result = list->lh_Head; + + return result; +} + +struct Node *GetTail(struct List *list) +{ + struct Node *result = NULL; + + if(list != NULL && IsListEmpty(list) == FALSE) + result = list->lh_TailPred; + + return result; +} +#endif // !__amigaos4__ && !__AROS__ + +/*****************************************************************************\ +******************************************************************************* +** +** Helpful object related functions. +** +******************************************************************************* +\*****************************************************************************/ + +#if 0 /* unused */ +INLINE ULONG MyCallHookA(struct Hook *hook, struct NListtree_Data *data, struct NListtree_HookMessage *msg) +{ + return(CallHookPkt(hook, data->Obj, msg)); +} +#endif + +#ifdef __AROS__ +#define MyCallHook(hook, data, ...) \ + ({ IPTR __args[] = { AROS_PP_VARIADIC_CAST2IPTR(__VA_ARGS__) }; \ + CallHookPkt(hook, data->Obj, __args); }) +#else +static IPTR STDARGS VARARGS68K MyCallHook(struct Hook *hook, struct NListtree_Data *data, ...) +{ + IPTR ret; + VA_LIST va; + + VA_START(va, data); + ret = CallHookPkt(hook, data->Obj, VA_ARG(va, APTR)); + VA_END(va); + + return ret; +} +#endif + +/* +** Release a pen. +*/ +VOID RelPen( struct MUI_RenderInfo *mri, LONG *pen ) +{ + if ( *pen != -1 ) + { + /* + ** Only valid between Setup/Cleanup! + */ + if ( mri ) + { + MUI_ReleasePen( mri, *pen ); + } + + *pen = -1; + } +} + + +/* +** Relase pen if obtained and obtain a new pen. +*/ +VOID ObtPen( struct MUI_RenderInfo *mri, LONG *pen, struct MUI_PenSpec *ps ) +{ + /* + ** Only valid between Setup/Cleanup! + */ + if ( mri ) + { + RelPen( mri, pen ); + *pen = MUI_ObtainPen( mri, ps, 0 ); + } +} + + +/* +** Fully clear and dispose an image for NList use. +*/ +VOID DisposeImage( struct NListtree_Data *data, ULONG nr ) +{ + if ( data->Image[nr].ListImage ) + { + DoMethod( data->Obj, MUIM_NList_DeleteImage, data->Image[nr].ListImage ); + data->Image[nr].ListImage = NULL; + + if ( data->Image[nr].Image ) + { + MUI_DisposeObject( data->Image[nr].Image ); + data->Image[nr].Image = NULL; + } + } +} + + +/* +** Fully set up an image for NList use. +*/ +VOID SetupImage( struct NListtree_Data *data, struct MUI_ImageSpec *is, ULONG nr ) +{ + ENTER(); + + if ( is ) + { + Object *rim; + + data->Image[nr].nltdata = data; + data->MaxImageWidth = 0; + data->MaxImageHeight = 0; + + if ( nr == IMAGE_Folder ) + { + rim = MUI_NewObject( MUIC_Image, MUIA_Image_Spec, is, MUIA_UserData, &data->Image[nr], TAG_DONE ); + } + else + { + rim = NewObject( data->CL_NodeImage->mcc_Class, NULL, MUIA_Image_Spec, is, + MUIA_Frame, MUIV_Frame_None, + MUIA_InnerBottom, 0, + MUIA_InnerLeft, 0, + MUIA_InnerRight, 0, + MUIA_InnerTop, 0, + MUIA_Weight, 0, + MUIA_UserData, &data->Image[nr], TAG_DONE ); + } + + if ( rim ) + { + data->Image[nr].Image = rim; + data->Image[nr].ListImage = (Object *)DoMethod( data->Obj, MUIM_NList_CreateImage, rim, 0 ); + + LEAVE(); + return; + } + } + + LEAVE(); +} + + +/* +** Activate Active/DoubleClick notification. +*/ +INLINE VOID ActivateNotify( struct NListtree_Data *data ) +{ + D(DBF_NOTIFY, "Activenotify: %lx",data); + if ( !( data->Flags & NLTF_ACTIVENOTIFY ) ) + { + DoMethod( data->Obj, MUIM_Notify, MUIA_NList_Active, MUIV_EveryTime, + data->Obj, 2, MUIM_NListtree_GetListActive, 0 ); + + DoMethod( data->Obj, MUIM_Notify, MUIA_NList_DoubleClick, MUIV_EveryTime, + data->Obj, 2, MUIM_NListtree_GetDoubleClick, MUIV_TriggerValue ); + + data->Flags |= NLTF_ACTIVENOTIFY; + } +} + + +/* +** Deactivate Active/DoubleClick notification. +*/ +INLINE VOID DeactivateNotify( struct NListtree_Data *data ) +{ + D(DBF_NOTIFY, "Deactivenotify: %lx",data); + if ( data->Flags & NLTF_ACTIVENOTIFY ) + { + /* + DoMethod( data->Obj, MUIM_KillNotify, MUIA_NList_Active ); + DoMethod( data->Obj, MUIM_KillNotify, MUIA_NList_DoubleClick ); + data->Flags &= ~NLTF_ACTIVENOTIFY; + */ + + DoMethod( data->Obj, MUIM_KillNotifyObj, MUIA_NList_DoubleClick, data->Obj ); + DoMethod( data->Obj, MUIM_KillNotifyObj, MUIA_NList_Active, data->Obj ); + data->Flags &= ~NLTF_ACTIVENOTIFY; + } +} + + + +/* +#define MakeNotify( data, attr, val ) if ( !( data->Flags & NLTF_QUIET ) ) SetAttrs( data->Obj, MUIA_Group_Forward, FALSE, MUIA_NListtree_OnlyTrigger, TRUE, attr, val, TAG_DONE ) +#define MakeSet( data, attr, val ) if ( !( data->Flags & NLTF_QUIET ) ) set( data->Obj, attr, val ) +*/ + + +INLINE VOID MakeNotify( struct NListtree_Data *data, ULONG tag, APTR val ) +{ + if ( !( data->Flags & NLTF_QUIET ) ) + { + SetAttrs( data->Obj, MUIA_Group_Forward, FALSE, MUIA_NListtree_OnlyTrigger, TRUE, tag, val, TAG_DONE ); + } +} + +INLINE VOID MakeSet( struct NListtree_Data *data, ULONG tag, APTR val ) +{ + if ( !( data->Flags & NLTF_QUIET ) ) + { + set( data->Obj, tag, val ); + } + else + { + data->Flags |= NLTF_SETACTIVE; + } +} + + +/*****************************************************************************\ +******************************************************************************* +** +** List and table handling functions. +** +******************************************************************************* +\*****************************************************************************/ + +/* +** Create a table. +*/ +struct MUI_NListtree_TreeNode **NLCreateTable( struct NListtree_Data *data, struct Table *table, LONG numentrieswanted ) +{ + struct MUI_NListtree_TreeNode **newtable; + LONG oldtablesize; + + /* + ** Don't allocate less than one entry. + */ + if ( numentrieswanted < 1 ) + numentrieswanted = 1; + + /* + ** Round to next multiple of 64. + */ + oldtablesize = table->tb_Size; + table->tb_Size = ( numentrieswanted + 63 ) & ~63; + + /* + ** Allocate the table. + */ + if((newtable = (struct MUI_NListtree_TreeNode **)AllocVecPooled(data->TreePool, sizeof(struct MUI_NListtree_TreeNode *) * table->tb_Size))) + { + /* + ** If there is an old table given, copy it to the new table. + */ + if ( table->tb_Table ) + { + CopyMem( table->tb_Table, newtable, sizeof( struct MUI_NListtree_TreeNode * ) * oldtablesize ); + FreeVecPooled( data->TreePool, table->tb_Table ); + } + else + oldtablesize = 0; + + /* + ** Clear all the unused entries. + */ + memset( &newtable[oldtablesize], 0, ( table->tb_Size - oldtablesize ) * sizeof( struct MUI_NListtree_TreeNode * ) ); + table->tb_Table = newtable; + } + + return( newtable ); +} + + +/* +** Add an entry to a table. +*/ +BOOL NLAddToTable( struct NListtree_Data *data, struct Table *table, struct MUI_NListtree_TreeNode *newentry ) +{ + /* + ** If the table is filled `to the brim', expand it. + */ + if ( ( table->tb_Entries + 1 ) > table->tb_Size ) + { + /* + ** Allocate another list table. + */ + if ( !NLCreateTable( data, table, table->tb_Entries + 1 ) ) + return( FALSE ); + } + + /* + ** Add it to the end of the table. + */ + table->tb_Table[table->tb_Entries++] = newentry; + + return( TRUE ); +} + + +/* +** Find an entry in a table. +*/ +LONG NLFindInTable( struct Table *table, struct MUI_NListtree_TreeNode *entry ) +{ + LONG i; + + for( i = 0; i < table->tb_Entries; i++ ) + { + if ( table->tb_Table[i] == entry ) + { + return( i ); + } + } + + return( -1 ); +} + + + +/* +** Remove an entry from a table. +*/ +VOID NLRemoveFromTable( struct NListtree_Data *data, struct Table *table, struct MUI_NListtree_TreeNode *entry ) +{ + LONG i; + + if ( ( i = NLFindInTable( table, entry ) ) != -1 ) + { + if ( --table->tb_Entries == 0 ) + { + FreeVecPooled( data->TreePool, table->tb_Table ); + table->tb_Table = NULL; + table->tb_Size = 0; + table->tb_Current = -2; + } + else + { + LONG j; + + /* + ** Remove the entry from the table. + */ + for( j = i; j <= table->tb_Entries; j++ ) + table->tb_Table[j] = table->tb_Table[j + 1]; + + /* + ** Clear the last entry and shrink the table. + */ + table->tb_Table[table->tb_Entries] = NULL; + + if ( table->tb_Current >= i ) + table->tb_Current--; + } + } +} + + + +/*****************************************************************************\ +******************************************************************************* +** +** Tree-List handling functions. +** +******************************************************************************* +\*****************************************************************************/ + +/* +** Do a refresh, but only if not frozen. If so, set refresh flag. +*/ +INLINE VOID DoRefresh( struct NListtree_Data *data ) +{ + if ( data->Flags & NLTF_QUIET ) + { + data->Flags |= NLTF_REFRESH; + } + else + { + DoMethod( data->Obj, MUIM_NList_Redraw, MUIV_NList_Redraw_All ); + } +} + + +/* +** Do only one quiet. +*/ +INLINE ULONG DoQuiet( struct NListtree_Data *data, BOOL quiet ) +{ + if ( quiet ) + { + data->Flags |= NLTF_QUIET; + + if ( ++data->QuietCounter == 1 ) + nnset( data->Obj, MUIA_NList_Quiet, TRUE ); + } + else + { + if ( --data->QuietCounter == 0 ) + { + nnset( data->Obj, MUIA_NList_Quiet, FALSE ); + data->Flags &= ~NLTF_QUIET; + + if ( data->Flags & NLTF_SETACTIVE ) + { + set( data->Obj, MUIA_NListtree_Active, data->ActiveNode ); + data->Flags &= ~NLTF_SETACTIVE; + } + } + } + + return( data->QuietCounter ); +} + + +/* +** Get the parent node to a given. +*/ +INLINE struct MUI_NListtree_TreeNode *GetParent( struct MUI_NListtree_TreeNode *tn ) +{ + return( tn ? tn->tn_Parent : NULL ); +} + + +/* +** Get the parent node to a given, but NOT the root list. +*/ +struct MUI_NListtree_TreeNode *GetParentNotRoot( struct MUI_NListtree_TreeNode *tn ) +{ + if((tn = GetParent(tn))) + { + if ( GetParent( tn ) ) + { + return( tn ); + } + } + + return( NULL ); +} + + +/* +** Check, if a given node is a child of another. +*/ +struct MUI_NListtree_TreeNode *IsXChildOfY( struct MUI_NListtree_TreeNode *x, struct MUI_NListtree_TreeNode *y ) +{ + do + { + if ( y == x ) + { + return( y ); + } + } + while((y = GetParentNotRoot(y))); + + return( NULL ); +} + + +/* +** Check, if a given node is a child of a list member. +*/ +struct MUI_NListtree_TreeNode *IsXChildOfListMemberNotSelf( struct MUI_NListtree_TreeNode *entry, struct Table *table ) +{ + LONG i; + + for( i = 0; i < table->tb_Entries; i++ ) + { + if ( entry != table->tb_Table[i] ) + { + if ( IsXChildOfY( table->tb_Table[i], entry ) ) + { + return( table->tb_Table[i] ); + } + } + } + + return( NULL ); +} + + +struct MUI_NListtree_TreeNode *IsXChildOfListMember( struct MUI_NListtree_TreeNode *entry, struct Table *table ) +{ + LONG i; + + for( i = 0; i < table->tb_Entries; i++ ) + { + if ( IsXChildOfY( table->tb_Table[i], entry ) ) + { + return( table->tb_Table[i] ); + } + } + + return( NULL ); +} + + + +/*****************************************************************************\ +******************************************************************************* +** +** Helpful tree handling functions. +** +******************************************************************************* +\*****************************************************************************/ + +INLINE VOID RemoveNListEntry( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, ULONG pos ) +{ + D(DBF_LISTTREE, "Removed entry '%s' from pos %ld.", tn->tn_Name, tn->tn_NListEntry ? tn->tn_NListEntry->entpos : 999999); + + DoMethod( data->Obj, MUIM_NList_Remove, pos ); + tn->tn_NListEntry = NULL; +} + + +INLINE VOID InsertNListEntry( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, ULONG pos ) +{ + struct MUI_NList_GetEntryInfo ei; + + DoMethod( data->Obj, MUIM_NList_InsertSingle, tn, pos ); + + if ( data->Flags & NLTF_NLIST_DIRECT_ENTRY_SUPPORT ) + { + ei.pos = -3; ei.line = -2; + DoMethod( data->Obj, MUIM_NList_GetEntryInfo, &ei ); + tn->tn_NListEntry = (struct NListEntry *)ei.entry; + + D(DBF_LISTTREE, "Inserted entry '%s' at pos %ld.", tn->tn_Name, tn->tn_NListEntry->entpos); + } +} + +INLINE VOID ReplaceNListEntry( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, ULONG pos ) +{ + struct MUI_NList_GetEntryInfo ei; + + DoMethod(data->Obj, MUIM_NList_ReplaceSingle, tn, pos, NOWRAP, ALIGN_LEFT); + + if ( data->Flags & NLTF_NLIST_DIRECT_ENTRY_SUPPORT ) + { + ei.pos = -3; ei.line = -2; + DoMethod( data->Obj, MUIM_NList_GetEntryInfo, &ei ); + tn->tn_NListEntry = (struct NListEntry *)ei.entry; + + D(DBF_LISTTREE, "Replaced entry '%s' at pos %ld.", tn->tn_Name, tn->tn_NListEntry->entpos); + } +} + + +/* +** Iterate through all entries recursive and get specified entry by pos. +*/ +struct MUI_NListtree_TreeNode *GetEntryByTotalPos( struct MUI_NListtree_ListNode *ln, LONG pos, LONG *cpos, ULONG flags ) +{ + struct MUI_NListtree_TreeNode *tn = CTN( (APTR)&ln->ln_List ); + + if ( ln->ln_Flags & TNF_LIST ) + { + if ( !( flags & MUIV_NListtree_GetEntry_Flag_Visible ) || ( ln->ln_Flags & TNF_OPEN ) ) + { + while((tn = CTN(GetSucc((struct Node *)tn)))) + { + struct MUI_NListtree_TreeNode *rettn; + + if ( *cpos == pos ) + return( tn ); + + if ( !( flags & MUIV_NListtree_GetEntry_Flag_Visible ) || ( tn->tn_IFlags & TNIF_VISIBLE ) ) + *cpos += 1; + + if ( !( flags & MUIV_NListtree_GetEntry_Flag_SameLevel ) ) + { + if((rettn = GetEntryByTotalPos(CLN(tn), pos, cpos, flags))) + return( rettn ); + } + } + } + } + + return( NULL ); +} + + +/* +** Iterate through all entries recursive and get the pos of the specified entry. +*/ +BOOL GetEntryPos( struct MUI_NListtree_ListNode *ln, struct MUI_NListtree_TreeNode *stn, LONG *pos ) +{ + struct MUI_NListtree_TreeNode *tn = CTN( (APTR)&ln->ln_List ); + + while((tn = CTN(GetSucc((struct Node *)tn)))) + { + if ( stn == tn ) + return( TRUE ); + + *pos += 1; + + if ( tn->tn_Flags & TNF_LIST ) + { + if ( GetEntryPos( CLN( tn ), stn, pos ) ) + return( TRUE ); + } + } + + return( FALSE ); +} + + +/************************************************************************* + Return the visual position (i.e. the position within the plain list) + of the given TreeNode +**************************************************************************/ +static int GetVisualPos( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn ) +{ + LONG pos = -1; + + if(tn != CTN((APTR)&data->RootList) && tn != NULL) + { + if(data->Flags & NLTF_NLIST_DIRECT_ENTRY_SUPPORT) + { + // respect visible nodes only + if((tn->tn_IFlags & TNIF_VISIBLE) && tn->tn_NListEntry != NULL) + pos = (int)tn->tn_NListEntry->entpos; + } + + // respect visible nodes only + if(pos == -1 && tn->tn_IFlags & TNIF_VISIBLE) + { + // result will be MUIV_NList_GetPos_End (-1) if not found. + pos = MUIV_NList_GetPos_Start; + DoMethod(data->Obj, MUIM_NList_GetPos, tn, &pos); + } + } + + return (int)pos; +} + +/************************************************************************* + Count the number of visual entries in a tree node (excluding the + node itself). A invisible has also 0 entries. Returns also 0 if the + entry is no list. +**************************************************************************/ +static int GetVisualEntries( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn) +{ + /* Easy case */ + if (tn == CTN((APTR)&data->RootList)) + return xget(data->Obj, MUIA_NList_Entries); + + if ((tn->tn_Flags & TNF_LIST) && (tn->tn_Flags & TNF_OPEN) && + (tn->tn_IFlags & TNIF_VISIBLE)) + { + struct MUI_NListtree_TreeNode *tn2; + + tn2 = CTN(GetSucc((struct Node *)tn)); + if (tn2 && (tn2->tn_IFlags & TNIF_VISIBLE)) + { + return GetVisualPos(data,tn2) - GetVisualPos(data,tn) - 1; + } + else + { + /* Number of entries is number of the entries directly in this + ** list and the number of the entries within the open nodes + */ + + struct Table *tb = &CLN( tn )->ln_Table; + int i, entries; + + entries = tb->tb_Entries; + + for( i = 0; i < tb->tb_Entries; i++ ) + { + entries += GetVisualEntries(data, tb->tb_Table[i]); + } + return entries; + } + } + + return 0; +} + +/* +** Count the number of visual entries in a tree node until a maximum of max. +*/ +BOOL GetVisualEntriesMax( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, LONG pos, LONG *ent, LONG max ) +{ + if ( tn->tn_Flags & TNF_OPEN ) + { + struct Table *tb = &CLN( tn )->ln_Table; + LONG i; + + *ent += tb->tb_Entries; + + for( i = 0; ( i < tb->tb_Entries ) && ( *ent <= max ); i++ ) + { + if ( GetVisualEntriesMax( data, tb->tb_Table[i], pos, ent, max ) ) + return( TRUE ); + } + } + + return( FALSE ); +} + + +/************************************************************************* + Determine the visual position a node would have, if inserted after + prevtn inside ln +**************************************************************************/ +static int GetVisualInsertPos( struct NListtree_Data *data, struct MUI_NListtree_ListNode *ln, struct MUI_NListtree_TreeNode *prevtn ) +{ + int ent; + + if ((SIPTR)prevtn == INSERT_POS_HEAD) + ent = GetVisualPos(data, CTN(ln)) + 1; + else if ( (SIPTR)prevtn == INSERT_POS_TAIL ) + ent = GetVisualPos(data, CTN(ln)) + GetVisualEntries(data, CTN(ln)) + 1; + else + ent = GetVisualPos(data, CTN(prevtn)) + GetVisualEntries(data,CTN(prevtn)) + 1; + + return ent; +} + +struct MUI_NListtree_TreeNode *TreeNodeSelectAdd( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn ) +{ + NLAddToTable( data, &data->SelectedTable, tn ); + + D(DBF_LISTTREE, "Node 0x%08lx - %s selected (%ld nodes selected), Current: %ld", tn, tn->tn_Name, data->SelectedTable.tb_Entries, data->SelectedTable.tb_Current); + + return( tn ); +} + + +VOID TreeNodeSelectRemove( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn ) +{ + NLRemoveFromTable( data, &data->SelectedTable, tn ); + + D(DBF_LISTTREE, "Node 0x%08lx - %s DEselected (%ld nodes selected), Current: %ld", tn, tn->tn_Name, data->SelectedTable.tb_Entries, data->SelectedTable.tb_Current); +} + + +/* +** Change the selection state of one entry depending on supplied info. +*/ +LONG TreeNodeSelectOne( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, LONG seltype, LONG selflags, LONG *state ) +{ + BOOL doselect = TRUE; + LONG st, wassel = tn->tn_Flags; + + if ( seltype == MUIV_NListtree_Select_Toggle ) + { + if ( tn->tn_Flags & TNF_SELECTED ) + st = MUIV_NListtree_Select_Off; + else + st = MUIV_NListtree_Select_On; + } + else + st = seltype; + + if ( !( selflags & MUIV_NListtree_Select_Flag_Force ) ) + { + doselect = MultiTestFunc( data, tn, st, selflags ); + } + + if ( doselect ) + { + if ( tn->tn_IFlags & TNIF_VISIBLE ) + { + if ( ( st == MUIV_NListtree_Select_On ) && !( wassel & TNF_SELECTED ) ) + DoMethod( data->Obj, MUIM_NList_Select, GetVisualPos( data, tn ), MUIV_NList_Select_On, NULL ); + + else if ( ( st == MUIV_NListtree_Select_Off ) && ( wassel & TNF_SELECTED ) ) + DoMethod( data->Obj, MUIM_NList_Select, GetVisualPos( data, tn ), MUIV_NList_Select_Off, NULL ); + } + else + { + switch ( st ) + { + case MUIV_NListtree_Select_On: + tn->tn_Flags |= TNF_SELECTED; + break; + + case MUIV_NListtree_Select_Off: + tn->tn_Flags &= ~TNF_SELECTED; + break; + } + } + + if ( state ) + *state = st; + } + + return( st ); +} + + +/* +** Iterate through all entries recursive and let change flags (selected). +*/ +VOID TreeNodeSelectAll( struct NListtree_Data *data, struct MUI_NListtree_ListNode *ln, LONG seltype, LONG selflags, LONG *state ) +{ + LONG i; + struct Table *tb = &ln->ln_Table; + + for( i = 0; i < tb->tb_Entries; i++ ) + { + TreeNodeSelectOne( data, tb->tb_Table[i], seltype, selflags, state ); + + if ( tb->tb_Table[i]->tn_Flags & TNF_LIST ) + { + TreeNodeSelectAll( data, CLN( tb->tb_Table[i] ), seltype, selflags, state ); + } + } +} + + + +/* +** Iterate through all entries recursive and let change flags (selected) of visible entries. +*/ +VOID TreeNodeSelectVisible( struct NListtree_Data *data, struct MUI_NListtree_ListNode *ln, LONG seltype, LONG selflags, LONG *state ) +{ + LONG i; + struct Table *tb = &ln->ln_Table; + + for( i = 0; i < tb->tb_Entries; i++ ) + { + if ( tb->tb_Table[i]->tn_IFlags & TNIF_VISIBLE ) + { + TreeNodeSelectOne( data, tb->tb_Table[i], seltype, selflags, state ); + + if ( tb->tb_Table[i]->tn_Flags & TNF_LIST ) + { + TreeNodeSelectAll( data, CLN( tb->tb_Table[i] ), seltype, selflags, state ); + } + } + } +} + + + +/* +** Change the selection state depending on supplied info. +*/ +LONG TreeNodeSelect( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, LONG seltype, LONG selflags, LONG *state ) +{ + if ( data->Flags & NLTF_AUTOSELECT_CHILDS ) + { + TreeNodeSelectAll( data, CLN( tn ), seltype, selflags, state ); + } + else + { + TreeNodeSelectOne( data, tn, seltype, selflags, state ); + } + + return( state ? *state : 0 ); +} + + + + +struct MUI_NListtree_TreeNode *GetInsertNodeSorted( struct NListtree_Data *data, struct MUI_NListtree_ListNode *li, struct MUI_NListtree_TreeNode *tn ) +{ + struct MUI_NListtree_TreeNode *in, *in2 = NULL; + + if((in = CTN(GetHead((struct List *)&li->ln_List)))) + { + while((LONG)DoMethod(data->Obj, MUIM_NListtree_Compare, in, tn, 0) < 0) + { + in2 = in; + + if ( !( in = CTN(GetSucc( (struct Node *)in ) ) ) ) + { + break; + } + } + } + + if ( !in2 ) + { + in2 = CTN( INSERT_POS_TAIL ); + } + + return( in2 ); +} + + + +VOID RemoveTreeVisible( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, LONG pos ) +{ + if ( ( tn->tn_Flags & TNF_LIST ) && ( tn = CTN( GetHead( (struct List *)&(CLN( tn ))->ln_List ) ) ) ) + { + do + { + if ( tn->tn_IFlags & TNIF_VISIBLE ) + { + D(DBF_LISTTREE, "Visible removing node \"%s\" at pos %ld ( %s | %s )", tn->tn_Name, pos, ( tn->tn_Flags & TNF_SELECTED ) ? "SEL" : "", ( data->Flags & NLTF_QUALIFIER_LSHIFT ) ? "LSHIFT" : ""); + + if ( tn->tn_Flags & TNF_SELECTED ) + { + D(DBF_LISTTREE, "Unselecting node \"%s\" at pos %ld ( %s )", tn->tn_Name, pos, ( data->Flags & NLTF_QUALIFIER_LSHIFT ) ? "LSHIFT" : ""); + + DoMethod( data->Obj, MUIM_NList_Select, pos, MUIV_NList_Select_Off, NULL ); + + if ( data->Flags & NLTF_QUALIFIER_LSHIFT ) + tn->tn_Flags |= TNF_SELECTED; + } + + tn->tn_IFlags &= ~TNIF_VISIBLE; + RemoveNListEntry( data, tn, pos ); + } + + if ( tn->tn_Flags & TNF_OPEN ) + { + RemoveTreeVisible( data, tn, pos ); + } + } + while((tn = CTN(GetSucc((struct Node *)tn)))); + } +} + + +/* +VOID RemoveTreeVisibleSort( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, LONG pos ) +{ + if ( ( tn->tn_Flags & TNF_LIST ) && ( tn = CTN( GetHead( (struct List *)&(CLN( tn ))->ln_List ) ) ) ) + { + do + { + if ( tn->tn_IFlags & TNIF_VISIBLE ) + { + //D(bug( "Visible removing node \"%s\" at pos %ld ( %s | %s )\n", tn->tn_Name, pos, ( tn->tn_Flags & TNF_SELECTED ) ? "SEL" : "", ( data->Flags & NLTF_QUALIFIER_LSHIFT ) ? "LSHIFT" : "" ) ); + + if ( tn->tn_Flags & TNF_SELECTED ) + { + //D(bug( "Unselecting node \"%s\" at pos %ld ( %s )\n", tn->tn_Name, pos, ( data->Flags & NLTF_QUALIFIER_LSHIFT ) ? "LSHIFT" : "" ) ); + + DoMethod( data->Obj, MUIM_NList_Select, pos, MUIV_NList_Select_Off, NULL ); + + if ( data->Flags & NLTF_QUALIFIER_LSHIFT ) + tn->tn_Flags |= TNF_SELECTED; + } + + RemoveNListEntry( data, tn, pos ); + } + + if ( tn->tn_Flags & TNF_OPEN ) + { + RemoveTreeVisibleSort( data, tn, pos ); + } + } + while ( tn = CTN( GetSucc( (struct Node *)tn ) ) ); + } +} +*/ + +VOID ReplaceTreeVisibleSort(struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, LONG *pos) +{ + /* + ** Determine that the node holds a list + ** and the node is not open. + */ + if((tn->tn_Flags & TNF_LIST) && (tn->tn_Flags & TNF_OPEN)) + { + if((tn = CTN(GetHead((struct List *)&(CLN(tn))->ln_List)))) + { + do + { + ReplaceNListEntry(data, tn, *pos); + + if(tn->tn_Flags & TNF_SELECTED) + { + DoMethod(data->Obj, MUIM_NList_Select, *pos, MUIV_NList_Select_On, NULL); + } + + if(*pos >= 0) *pos += 1; + + if(tn->tn_Flags & TNF_OPEN) + { + ReplaceTreeVisibleSort(data, tn, pos); + } + } + while((tn = CTN(GetSucc((struct Node *)tn)))); + } + } +} + + +VOID RemoveTreeNodeVisible( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, LONG *xpos ) +{ + LONG pos; + + if ( tn->tn_IFlags & TNIF_VISIBLE ) + { + pos = GetVisualPos( data, tn ); + + D(DBF_LISTTREE, "Visible removing node \"%s\" at pos %ld ( %s | %s )", tn->tn_Name, pos, ( tn->tn_Flags & TNF_SELECTED ) ? "SEL" : "", ( data->Flags & NLTF_QUALIFIER_LSHIFT ) ? "LSHIFT" : ""); + + if ( tn->tn_Flags & TNF_SELECTED ) + { + D(DBF_LISTTREE, "Unselecting node \"%s\" at pos %ld ( %s )", tn->tn_Name, pos, ( data->Flags & NLTF_QUALIFIER_LSHIFT ) ? "LSHIFT" : ""); + + DoMethod( data->Obj, MUIM_NList_Select, pos, MUIV_NList_Select_Off, NULL ); + + if ( data->Flags & NLTF_QUALIFIER_LSHIFT ) + tn->tn_Flags |= TNF_SELECTED; + } + + tn->tn_IFlags &= ~TNIF_VISIBLE; + RemoveNListEntry( data, tn, pos ); + + if ( xpos ) + *xpos = pos; + + if ( tn->tn_Flags & TNF_OPEN ) + { + RemoveTreeVisible( data, tn, pos ); + } + + if ( pos > 0 ) DoMethod( data->Obj, MUIM_NList_Redraw, pos - 1 ); + } +} + + +VOID InsertTreeVisible( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, LONG *pos ) +{ + /* + ** Determine that the node holds a list + ** and the node is not open. + */ + if(tn->tn_Flags & TNF_LIST) + { + if((tn = CTN(GetHead((struct List *)&(CLN(tn))->ln_List)))) + { + do + { + if ( !( tn->tn_IFlags & TNIF_VISIBLE ) ) + { + D(DBF_LISTTREE, "Visible inserting node \"%s\" at pos %ld ( %s | %s )", tn->tn_Name, pos, ( tn->tn_Flags & TNF_SELECTED ) ? "SEL" : "", ( data->Flags & NLTF_QUALIFIER_LSHIFT ) ? "LSHIFT" : ""); + + tn->tn_IFlags |= TNIF_VISIBLE; + InsertNListEntry( data, tn, *pos ); + + if ( tn->tn_Flags & TNF_SELECTED ) + { + D(DBF_LISTTREE, " Selecting node \"%s\" at pos %ld ( %s )", tn->tn_Name, pos, ( data->Flags & NLTF_QUALIFIER_LSHIFT ) ? "LSHIFT" : ""); + + DoMethod( data->Obj, MUIM_NList_Select, *pos, MUIV_NList_Select_On, NULL ); + } + } + + if ( *pos >= 0 ) *pos += 1; + + if ( tn->tn_Flags & TNF_OPEN ) + { + InsertTreeVisible( data, tn, pos ); + } + } + while((tn = CTN(GetSucc((struct Node *)tn)))); + } + } +} + +/* +VOID InsertTreeVisibleSort( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, LONG *pos ) +{ + if ((tn->tn_Flags & TNF_LIST) && (tn->tn_Flags & TNF_OPEN)) + { + if ( tn = CTN( GetHead( (struct List *)&(CLN( tn ))->ln_List ) ) ) + { + do + { + //D(bug( "Visible inserting node \"%s\" at pos %ld ( %s | %s )\n", tn->tn_Name, pos, ( tn->tn_Flags & TNF_SELECTED ) ? "SEL" : "", ( data->Flags & NLTF_QUALIFIER_LSHIFT ) ? "LSHIFT" : "" ) ); + + InsertNListEntry( data, tn, *pos ); + + if ( tn->tn_Flags & TNF_SELECTED ) + { + //D(bug( "T Selecting node \"%s\" at pos %ld ( %s )\n", tn->tn_Name, pos, ( data->Flags & NLTF_QUALIFIER_LSHIFT ) ? "LSHIFT" : "" ) ); + + DoMethod( data->Obj, MUIM_NList_Select, *pos, MUIV_NList_Select_On, NULL ); + } + + if ( *pos >= 0 ) *pos += 1; + + if ( tn->tn_Flags & TNF_OPEN ) + { + InsertTreeVisibleSort( data, tn, pos ); + } + } + while ( tn = CTN( GetSucc( (struct Node *)tn ) ) ); + } + } +} +*/ + +LONG InsertTreeNodeVisible( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, struct MUI_NListtree_ListNode *ln, struct MUI_NListtree_TreeNode *prevtn ) +{ + LONG pos = 0, temppos; + + if ( ( ln->ln_Flags & TNF_OPEN ) && ( ( pos = GetVisualInsertPos( data, ln, prevtn ) ) != -1 ) ) + { + tn->tn_IFlags |= TNIF_VISIBLE; + + D(DBF_LISTTREE, "Visible inserting node 0x%lx into list 0x%lx after 0x%lx at pos %ld", tn, ln, prevtn, pos); + + InsertNListEntry( data, tn, pos ); + + if ( tn->tn_Flags & TNF_SELECTED ) + { + D(DBF_LISTTREE, " Selecting node \"%s\" at pos %ld ( %s )", tn->tn_Name, pos, ( data->Flags & NLTF_QUALIFIER_LSHIFT ) ? "LSHIFT" : ""); + + DoMethod( data->Obj, MUIM_NList_Select, pos, MUIV_NList_Select_On, NULL ); + } + + temppos = pos + 1; + + if ( tn->tn_Flags & TNF_OPEN ) + { + InsertTreeVisible( data, tn, &temppos ); + } + + if ( pos > 0 ) DoMethod( data->Obj, MUIM_NList_Redraw, pos - 1 ); + } + else + { + tn->tn_IFlags &= ~TNIF_VISIBLE; + } + + return( pos ); +} + + + +VOID ShowTree(struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn) +{ + if(isFlagSet(tn->tn_Flags, TNF_OPEN)) + { + LONG first = xget(data->Obj, MUIA_NList_First); + LONG visible = xget(data->Obj, MUIA_NList_Visible); + LONG max; + LONG pos; + LONG a; + LONG b; + LONG treeentries = 0; + LONG jmp; + + pos = GetVisualPos(data, tn); + GetVisualEntriesMax(data, tn, pos, &treeentries, visible); + + a = pos - first; + b = visible - a - 1; + + max = a + b; + jmp = pos + MIN(max, treeentries); + + D(DBF_LISTTREE, "first: %ld, visible: %ld, pos: %ld, treeentries: %ld, a: %ld, b: %ld, max: %ld, jmp: %ld", + first, visible, pos, treeentries, a, b, max, jmp); + + DoMethod(data->Obj, MUIM_NList_Jump, jmp); + } +} + + + +/* +** +*/ +VOID ExpandTree( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn ) +{ + /* + ** Determine that the node holds a list + */ + if ( tn->tn_Flags & TNF_LIST ) + { + LONG i; + + struct Table *tb = &CLN( tn )->ln_Table; + + for( i = 0; i < tb->tb_Entries; i++ ) + { + if ( ( tb->tb_Table[i]->tn_Flags & TNF_LIST ) && !( tb->tb_Table[i]->tn_Flags & TNF_OPEN ) ) + { + if ( data->OpenHook ) + { + MyCallHook( data->OpenHook, data, MUIA_NListtree_OpenHook, tb->tb_Table[i] ); + } + + D(DBF_LISTTREE, "Expanding node \"%s\"", tb->tb_Table[i]->tn_Name); + + tb->tb_Table[i]->tn_Flags |= TNF_OPEN; + } + + tb->tb_Table[i]->tn_IFlags &= ~TNIF_VISIBLE; + + ExpandTree( data, tb->tb_Table[i] ); + } + } +} + + +VOID OpenTreeNode( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn ) +{ + LONG entries, pos, spos=0; + + if ( !( tn->tn_Flags & TNF_OPEN ) ) + { + tn->tn_Flags |= TNF_OPEN; + + if ( data->OpenHook ) + { + MyCallHook( data->OpenHook, data, MUIA_NListtree_OpenHook, tn ); + } + + if ( tn->tn_IFlags & TNIF_VISIBLE ) + { + spos = pos = GetVisualPos( data, tn ); + entries = xget( data->Obj, MUIA_NList_Entries ); + + pos++; + + if ( pos == entries ) + { + pos = MUIV_NList_Insert_Bottom; + } + + DeactivateNotify( data ); + + /* + if ( tb->tb_Entries > ( data->NumEntries / 4 ) ) + { + i = MUIV_NList_Insert_Bottom; + + DoMethod( data->Obj, MUIM_NList_Clear, 0 ); + + tn->tn_IFlags &= ~TNIF_VISIBLE; + InsertTreeVisible( data, CTN( &data->RootList ), &i ); + } + else + */ + { + InsertTreeVisible( data, tn, &pos ); + } + + ActivateNotify( data ); + + /* sba: the active note could be changed, but the notify calling was disabled */ + DoMethod(data->Obj, MUIM_NListtree_GetListActive, 0); + } + + DoMethod( data->Obj, MUIM_NList_Redraw, spos ); + } +} + + +VOID OpenTreeNodeExpand( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn ) +{ + LONG entries, pos; + + pos = GetVisualPos( data, tn ); + entries = xget( data->Obj, MUIA_NList_Entries ); + + pos++; + + if ( pos == entries ) + { + pos = MUIV_NList_Insert_Bottom; + } + + if ( !( tn->tn_Flags & TNF_OPEN ) ) + { + if ( data->OpenHook ) + { + MyCallHook( data->OpenHook, data, MUIA_NListtree_OpenHook, tn ); + } + + D(DBF_LISTTREE, "Expanding node \"%s\"", tn->tn_Name); + + tn->tn_Flags |= TNF_OPEN; + + ExpandTree( data, tn ); + InsertTreeVisible( data, tn, &pos ); + } +} + + +/* +** +*/ +VOID OpenTreeNodeListExpand( struct NListtree_Data *data, struct MUI_NListtree_ListNode *ln ) +{ + LONG i; + struct Table *tb = &ln->ln_Table; + + if ( ln == &data->RootList ) + { + i = MUIV_NList_Insert_Bottom; + + DoMethod( data->Obj, MUIM_NList_Clear, 0 ); + + ExpandTree( data, CTN( ln ) ); + InsertTreeVisible( data, CTN( ln ), &i ); + } +/* + else if ( tb->tb_Entries > (LONG)( data->NumEntries / 4 ) ) + { + i = MUIV_NList_Insert_Bottom; + + DoMethod( data->Obj, MUIM_NList_Clear, 0 ); + + ExpandTree( data, CTN( ln ) ); + InsertTreeVisible( data, CTN( &data->RootList ), &i ); + } +*/ + else + { + DoMethod(data->Obj, MUIM_NList_Redraw, GetVisualPos(data, tb->tb_Table[0])); + + for( i = 0; i < tb->tb_Entries; i++ ) + { + OpenTreeNodeExpand( data, tb->tb_Table[i] ); + } + } +} + + + +/* +** +*/ +VOID CollapseTree( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, BOOL clearvisible ) +{ + /* + ** Determine that the node holds a list + */ + if ( tn->tn_Flags & TNF_LIST ) + { + LONG i; + + struct Table *tb = &CLN( tn )->ln_Table; + + for( i = 0; i < tb->tb_Entries; i++ ) + { + if ( tb->tb_Table[i]->tn_Flags & TNF_OPEN ) + { + if ( data->CloseHook ) + { + MyCallHook( data->CloseHook, data, MUIA_NListtree_CloseHook, tb->tb_Table[i] ); + } + + D(DBF_LISTTREE, "Collapsing node \"%s\"", tb->tb_Table[i]->tn_Name); + + tb->tb_Table[i]->tn_Flags &= ~TNF_OPEN; + } + + if ( clearvisible ) + tb->tb_Table[i]->tn_IFlags &= ~TNIF_VISIBLE; + + CollapseTree( data, tb->tb_Table[i], clearvisible ); + } + } +} + + + + +VOID CloseTreeNode( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn ) +{ + LONG pos; + + if ( tn->tn_Flags & TNF_OPEN ) + { + pos = GetVisualPos( data, tn ) + 1; + + if ( data->CloseHook ) + { + MyCallHook( data->CloseHook, data, MUIA_NListtree_CloseHook, tn ); + } + + tn->tn_Flags &= ~TNF_OPEN; + + DeactivateNotify( data ); + + /* + if ( tb->tb_Entries > ( data->NumEntries / 4 ) ) + { + i = MUIV_NList_Insert_Bottom; + + DoMethod( data->Obj, MUIM_NList_Clear, 0 ); + + tn->tn_IFlags &= ~TNIF_VISIBLE; + InsertTreeVisible( data, CTN( &data->RootList ), &i ); + } + else + */ + { + RemoveTreeVisible( data, tn, pos ); + } + + ActivateNotify( data ); + + /* sba: the active note could be changed, but the notify calling was disabled */ + DoMethod(data->Obj, MUIM_NListtree_GetListActive, 0); + + DoMethod( data->Obj, MUIM_NList_Redraw, pos - 1 ); + } +} + + +VOID CloseTreeNodeCollapse( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn ) +{ + LONG pos; + + pos = GetVisualPos( data, tn ) + 1; + + if ( tn->tn_Flags & TNF_OPEN ) + { + if ( data->CloseHook ) + { + MyCallHook( data->CloseHook, data, MUIA_NListtree_CloseHook, tn ); + } + + D(DBF_LISTTREE, "Collapsing node \"%s\"", tn->tn_Name); + + tn->tn_Flags &= ~TNF_OPEN; + } + + RemoveTreeVisible( data, tn, pos ); + CollapseTree( data, tn, FALSE ); + + DoMethod( data->Obj, MUIM_NList_Redraw, pos - 1 ); +} + + +/* +** +*/ +VOID CloseTreeNodeListCollapse( struct NListtree_Data *data, struct MUI_NListtree_ListNode *ln ) +{ + LONG i; + struct Table *tb = &ln->ln_Table; + + if ( ln == &data->RootList ) + { + i = MUIV_NList_Insert_Bottom; + + DoMethod( data->Obj, MUIM_NList_Clear, 0 ); + + CollapseTree( data, CTN( ln ), TRUE ); + InsertTreeVisible( data, CTN( ln ), &i ); + } +/* + else if(tb->tb_Entries > (LONG)(data->NumEntries / 4)) + { + i = MUIV_NList_Insert_Bottom; + + DoMethod( data->Obj, MUIM_NList_Clear, 0 ); + + CollapseTree( data, CTN( ln ), TRUE ); + InsertTreeVisible( data, CTN( &data->RootList ), &i ); + } +*/ + else + { + for( i = 0; i < tb->tb_Entries; i++ ) + { + CloseTreeNodeCollapse( data, tb->tb_Table[i] ); + } + } +} + + + +VOID ActivateTreeNode(struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn) +{ + struct MUI_NListtree_TreeNode *tn2 = tn; + ULONG jmppos; + LONG newact; + + if(data->ActiveNode != NULL) + { + switch(data->AutoVisible) + { + case MUIV_NListtree_AutoVisible_Off: + { + // nothing to do + } + break; + + case MUIV_NListtree_AutoVisible_Normal: + { + if(isFlagSet(tn2->tn_IFlags, TNIF_VISIBLE)) + { + jmppos = GetVisualPos(data, tn2); + DoMethod(data->Obj, MUIM_NList_Jump, jmppos); + } + } + break; + + case MUIV_NListtree_AutoVisible_FirstOpen: + { + while(isFlagClear(tn2->tn_IFlags, TNIF_VISIBLE)) + tn2 = tn2->tn_Parent; + + jmppos = GetVisualPos(data, tn2); + DoMethod(data->Obj, MUIM_NList_Jump, jmppos); + } + break; + + case MUIV_NListtree_AutoVisible_Expand: + { + while((tn2 = tn2->tn_Parent) != NULL) + OpenTreeNode(data, tn2); + + jmppos = GetVisualPos(data, tn2); + DoMethod(data->Obj, MUIM_NList_Jump, jmppos); + } + break; + } + } + + if(tn != NULL) + newact = GetVisualPos(data, tn); + else + newact = MUIV_NList_Active_Off; + + /* sba: set the new entry only if it really changes, otherwise we lose some + MUIA_NList_Active notifications */ + + D(DBF_LISTTREE, "ActivateTreeNode: %ld %ld",newact,xget(data->Obj,MUIA_NList_Active)); + if(newact != (LONG)xget(data->Obj,MUIA_NList_Active)) + set(data->Obj, MUIA_NList_Active, newact); +} + + +VOID RemoveNode1( struct NListtree_Data *data, UNUSED struct MUI_NListtree_ListNode *li, struct MUI_NListtree_TreeNode *tn, LONG pos ) +{ + /* + ** If deleted entry is active, then activate the next/previous node. + */ + if ( data->TempActiveNode == tn ) + { + /* + ** Make sure that deleting the last entry in a + ** list node causes the NEW last entry to be active! + */ + if ( !( data->TempActiveNode = CTN( GetSucc( (struct Node *)&tn->tn_Node ) ) ) ) + if ( !( data->TempActiveNode = CTN( GetPred( (struct Node *)&tn->tn_Node ) ) ) ) + data->TempActiveNode = GetParentNotRoot( tn ); + + D(DBF_LISTTREE, "Would set active node to: %s - 0x%08lx", data->TempActiveNode ? data->TempActiveNode->tn_Name : (STRPTR)"NULL", data->TempActiveNode); + } + + D(DBF_LISTTREE, "Removing node: %s - 0x%08lx, pos: %ld", tn->tn_Name, tn, pos); + + /* + ** Prevent calculating positions with practical + ** deleted entries. + */ + if ( tn->tn_IFlags & TNIF_VISIBLE ) + { + tn->tn_IFlags &= ~TNIF_VISIBLE; + + RemoveNListEntry( data, tn, pos ); + } + + /* + ** Remove the node from the selected list. + */ + if ( tn->tn_Flags & TNF_SELECTED ) + { + TreeNodeSelectRemove( data, tn ); + } +} + +VOID RemoveNode2( struct NListtree_Data *data, struct MUI_NListtree_ListNode *li, struct MUI_NListtree_TreeNode *tn ) +{ + Remove( (struct Node *)&tn->tn_Node ); + NLRemoveFromTable( data, &li->ln_Table, tn ); + + /* + ** Call internal/user supplied destruct function. + */ + DoMethod(data->Obj, MUIM_NListtree_Destruct, tn->tn_Name, tn->tn_User, data->TreePool, 0); + + /* + ** Free all allocated memory. + */ + if ( tn->tn_IFlags & TNIF_ALLOCATED ) + { + if ( tn->tn_Name ) + FreeVecPooled( data->TreePool, tn->tn_Name ); + } + + if ( tn->tn_Flags & TNF_LIST ) + { + if ( ( (struct MUI_NListtree_ListNode *)tn )->ln_Table.tb_Table ) + FreeVecPooled( data->TreePool, ( (struct MUI_NListtree_ListNode *)tn )->ln_Table.tb_Table ); + + ( (struct MUI_NListtree_ListNode *)tn )->ln_Table.tb_Table = NULL; + } + + FreeVecPooled( data->TreePool, tn ); + + /* + ** Subtract one from the global number of entries. + */ + data->NumEntries--; +} + + + +VOID RemoveChildNodes( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, LONG pos ) +{ + struct MUI_NListtree_ListNode *ln = CLN( tn ); + + if ( tn->tn_Flags & TNF_LIST ) + { + while((tn = CTN(GetHead((struct List *)&ln->ln_List)))) + { + D(DBF_LISTTREE, "Removing node \"%s\", pos %ld", tn->tn_Name, pos); + + RemoveChildNodes( data, tn, pos + 1 ); + RemoveNode1( data, CLN( GetParent( tn ) ), tn, pos ); + RemoveNode2( data, CLN( GetParent( tn ) ), tn ); + } + } +} + + + +VOID RemoveNodes( struct NListtree_Data *data, struct MUI_NListtree_ListNode *li, struct MUI_NListtree_TreeNode *tn, LONG pos ) +{ + RemoveChildNodes( data, tn, pos + 1 ); + RemoveNode1( data, li, tn, pos ); + RemoveNode2( data, li, tn ); + + if ( pos > 0 ) DoMethod( data->Obj, MUIM_NList_Redraw, pos - 1 ); +} + + + +VOID QuickRemoveNodes( struct NListtree_Data *data, struct MUI_NListtree_ListNode *li ) +{ + struct MUI_NListtree_ListNode *ln = li; + + if ( li->ln_Flags & TNF_LIST ) + { + while((li = CLN(RemHead((struct List *)&ln->ln_List)))) + { + if ( li->ln_Flags & TNF_LIST ) + QuickRemoveNodes( data, li ); + + if ( li->ln_Flags & TNF_SELECTED ) + { + TreeNodeSelectRemove( data, CTN( li ) ); + } + + /* + ** Call internal/user supplied destruct function. + */ + DoMethod(data->Obj, MUIM_NListtree_Destruct, li->ln_Name, li->ln_User, data->TreePool, 0); + } + } +} + + +struct MUI_NListtree_TreeNode *FindTreeNodeByName( struct NListtree_Data *data, struct MUI_NListtree_ListNode *ln, STRPTR name, UWORD flags ) +{ + struct MUI_NListtree_TreeNode *tn2, *tn; + + if ( flags & MUIV_NListtree_FindName_Flag_StartNode ) + tn = CTN( ln ); + else + tn = CTN( GetHead( (struct List *)&ln->ln_List ) ); + + + if ( tn ) + { + do + { + if ( ( tn->tn_IFlags & TNIF_VISIBLE ) || !( flags & MUIV_NListtree_FindName_Flag_Visible ) ) + { + if ( ( tn->tn_Flags & TNF_SELECTED ) || !( flags & MUIV_NListtree_FindName_Flag_Selected ) ) + { + if ( !( (LONG)MyCallHook( data->FindNameHook, data, MUIA_NListtree_FindNameHook, name, tn->tn_Name, tn->tn_User, flags ) ) ) + { + return( tn ); + } + } + } + + if ( ( tn->tn_Flags & TNF_LIST ) && !( flags & MUIV_NListtree_FindName_Flag_SameLevel ) ) + { + if((tn2 = FindTreeNodeByName(data, CLN(tn), name, (flags & ~MUIV_NListtree_FindName_Flag_StartNode)))) + { + return( tn2 ); + } + } + } + while((tn = CTN(GetSucc((struct Node *)&tn->tn_Node)))); + } + + return( NULL ); +} + + + +struct MUI_NListtree_TreeNode *FindTreeNodeByNameRev( struct NListtree_Data *data, struct MUI_NListtree_ListNode *ln, STRPTR name, UWORD flags ) +{ + struct MUI_NListtree_TreeNode *tn; + + do + { + if ( flags & MUIV_NListtree_FindName_Flag_StartNode ) + tn = CTN( ln ); + else + tn = CTN( GetTail( (struct List *)&ln->ln_List ) ); + + if ( tn ) + { + do + { + if ( ( tn->tn_IFlags & TNIF_VISIBLE ) || !( flags & MUIV_NListtree_FindName_Flag_Visible ) ) + { + if ( ( tn->tn_Flags & TNF_SELECTED ) || !( flags & MUIV_NListtree_FindName_Flag_Selected ) ) + { + if ( !( (LONG)MyCallHook( data->FindNameHook, data, MUIA_NListtree_FindNameHook, name, tn->tn_Name, tn->tn_User, flags ) ) ) + { + return( tn ); + } + } + } + } + while((tn = CTN(GetPred((struct Node *)&tn->tn_Node)))); + + if ( !( flags & MUIV_NListtree_FindName_Flag_SameLevel ) ) + { + ln = CLN( GetParent( CTN( ln ) ) ); + flags |= MUIV_NListtree_FindName_Flag_StartNode; + } + else + ln = NULL; + } + } + while ( ln ); + + return( NULL ); +} + + + +struct MUI_NListtree_TreeNode *FindTreeNodeByUserData( struct NListtree_Data *data, struct MUI_NListtree_ListNode *ln, STRPTR userdata, UWORD flags ) +{ + struct MUI_NListtree_TreeNode *tn2, *tn; + + if ( flags & MUIV_NListtree_FindUserData_Flag_StartNode ) + tn = CTN( ln ); + else + tn = CTN( GetHead( (struct List *)&ln->ln_List ) ); + + + if ( tn ) + { + do + { + if ( ( tn->tn_IFlags & TNIF_VISIBLE ) || !( flags & MUIV_NListtree_FindUserData_Flag_Visible ) ) + { + if ( ( tn->tn_Flags & TNF_SELECTED ) || !( flags & MUIV_NListtree_FindUserData_Flag_Selected ) ) + { + if ( !( (LONG)MyCallHook( data->FindUserDataHook, data, MUIA_NListtree_FindUserDataHook, userdata, tn->tn_User, tn->tn_Name, flags ) ) ) + { + return( tn ); + } + } + } + + if ( ( tn->tn_Flags & TNF_LIST ) && !( flags & MUIV_NListtree_FindUserData_Flag_SameLevel ) ) + { + if((tn2 = FindTreeNodeByUserData(data, CLN(tn), userdata, (flags & ~MUIV_NListtree_FindUserData_Flag_StartNode)))) + { + return( tn2 ); + } + } + } + while((tn = CTN(GetSucc((struct Node *)&tn->tn_Node)))); + } + + return( NULL ); +} + + + +struct MUI_NListtree_TreeNode *FindTreeNodeByUserDataRev( struct NListtree_Data *data, struct MUI_NListtree_ListNode *ln, STRPTR userdata, UWORD flags ) +{ + struct MUI_NListtree_TreeNode *tn; + + do + { + if ( flags & MUIV_NListtree_FindUserData_Flag_StartNode ) + tn = CTN( ln ); + else + tn = CTN( GetTail( (struct List *)&ln->ln_List ) ); + + if ( tn ) + { + do + { + if ( ( tn->tn_IFlags & TNIF_VISIBLE ) || !( flags & MUIV_NListtree_FindUserData_Flag_Visible ) ) + { + if ( ( tn->tn_Flags & TNF_SELECTED ) || !( flags & MUIV_NListtree_FindUserData_Flag_Selected ) ) + { + if ( !( (LONG)MyCallHook( data->FindUserDataHook, data, MUIA_NListtree_FindUserDataHook, userdata, tn->tn_User, tn->tn_Name, flags ) ) ) + { + return( tn ); + } + } + } + } + while((tn = CTN(GetPred((struct Node *)&tn->tn_Node)))); + + if ( !( flags & MUIV_NListtree_FindUserData_Flag_SameLevel ) ) + { + ln = CLN( GetParent( CTN( ln ) ) ); + flags |= MUIV_NListtree_FindUserData_Flag_StartNode; + } + else + ln = NULL; + } + } + while ( ln ); + + return( NULL ); +} + + + +VOID InsertTreeNode( struct NListtree_Data *data, struct MUI_NListtree_ListNode *ln, struct MUI_NListtree_TreeNode *tn1, struct MUI_NListtree_TreeNode *tn2 ) +{ + /* + ** Give the entry a parent. + */ + tn1->tn_Parent = CTN( ln ); + + /* + ** Insert entry into list. + */ + if ( (IPTR)tn2 == (IPTR)INSERT_POS_HEAD ) + { + AddHead( (struct List *)&ln->ln_List, (struct Node *)&tn1->tn_Node ); + } + else if ( (IPTR)tn2 == (IPTR)INSERT_POS_TAIL ) + { + AddTail( (struct List *)&ln->ln_List, (struct Node *)&tn1->tn_Node ); + } + else + { + Insert( (struct List *)&ln->ln_List, (struct Node *)&tn1->tn_Node, (struct Node *)&tn2->tn_Node ); + } + + InsertTreeNodeVisible( data, tn1, ln, tn2 ); + NLAddToTable( data, &ln->ln_Table, tn1 ); +} + + + +struct MUI_NListtree_TreeNode *DuplicateNode( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *nodetodup ) +{ + struct MUI_NListtree_ListNode *new; + APTR user = NULL; + + if((new = CLN(AllocVecPooled( data->TreePool, (nodetodup->tn_Flags & TNF_LIST) ? sizeof(struct MUI_NListtree_ListNode ) : sizeof(struct MUI_NListtree_TreeNode))))) + { + if ( nodetodup->tn_Flags & TNF_LIST ) + NewList( (struct List *)&new->ln_List ); + + /* + ** Should we duplicate the supplied node name? + */ + if ( data->Flags & NLTF_DUPNODENAMES ) + { + int len = strlen( nodetodup->tn_Name ) + 1; + + new->ln_Name = (STRPTR)AllocVecPooled( data->TreePool, len ); + strlcpy( new->ln_Name, nodetodup->tn_Name, len ); + new->ln_IFlags |= TNIF_ALLOCATED; + } + else + new->ln_Name = nodetodup->tn_Name; + + /* + ** Create new user dats + */ + user = (APTR)DoMethod(data->Obj, MUIM_NListtree_Construct, nodetodup->tn_Name, nodetodup->tn_User, data->TreePool, MUIV_NListtree_ConstructHook_Flag_AutoCreate); + + if ( !new->ln_Name || !user ) + { + /* + ** Free all previously allocated memory if + ** something failed before. + */ + if ( new->ln_Name && ( new->ln_IFlags & TNIF_ALLOCATED ) ) + FreeVecPooled( data->TreePool, new->ln_Name ); + + DoMethod(data->Obj, MUIM_NListtree_Destruct, new->ln_Name, new->ln_User, data->TreePool, 0); + + FreeVecPooled( data->TreePool, new ); + new = NULL; + } + else + { + new->ln_User = user; + new->ln_Flags = ( nodetodup->tn_Flags & ~TNF_SELECTED ); + + /* + ** Add one to the global number of entries + */ + data->NumEntries++; + } + } + + return(CTN(new)); +} + + + +struct MUI_NListtree_TreeNode *CreateParentStructure( struct NListtree_Data *data, ULONG method, struct MUI_NListtree_ListNode **destlist, struct MUI_NListtree_TreeNode **destentry, struct MUI_NListtree_TreeNode *nodetodup, UWORD cnt ) +{ + struct MUI_NListtree_ListNode *prevnode, *newlist; + + if((prevnode = CLN(GetParentNotRoot(nodetodup)))) + *destlist = CLN( CreateParentStructure( data, method, destlist, destentry, CTN(prevnode), cnt + 1 ) ); + + D(DBF_LISTTREE, "Adding node 0x%08lx - %s to node 0x%08lx - %s", nodetodup, nodetodup->tn_Name, *destlist, (*destlist)->ln_Name); + + /* + ** Allocate memory for the new entry and + ** initialize list structure for use. + */ + if ( ( method == MUIM_NListtree_Copy ) || cnt ) + { + newlist = CLN( DuplicateNode( data, nodetodup ) ); + } + else + { + newlist = CLN(nodetodup); + } + + if ( newlist ) + { + /* + ** Add the new created entry to the specified list. + */ + if ( cnt ) + { + /* + ** Insert entry into list. + */ + InsertTreeNode( data, *destlist, CTN(newlist), *destentry ); + *destentry = CTN( INSERT_POS_TAIL ); + newlist->ln_IFlags |= ( nodetodup->tn_IFlags & TNIF_VISIBLE ); + } + } + + return( CTN( newlist ) ); +} + + + +struct MUI_NListtree_TreeNode *CreateChildStructure( struct NListtree_Data *data, struct MUI_NListtree_ListNode *listnode, struct MUI_NListtree_ListNode *nodetodup, struct MUI_NListtree_ListNode *orignode, ULONG cnt ) +{ + struct MUI_NListtree_ListNode *new; + + if ( cnt > 0 ) + new = CLN(DuplicateNode( data, CTN(nodetodup))); + else + new = nodetodup; + + if ( new ) + { + /* + ** Insert entry into list. + */ + InsertTreeNode( data, listnode, CTN(new), CTN( INSERT_POS_TAIL ) ); + + if ( orignode->ln_Flags & TNF_LIST ) + { + if ( !IsListEmpty( (struct List *)&orignode->ln_List ) ) + { + struct MUI_NListtree_ListNode *ln = CLN( &orignode->ln_List ); + LONG i; + + for ( i = 0; i < orignode->ln_Table.tb_Entries; i++ ) + { + ln = CLN( GetSucc( (struct Node *)ln ) ); + + CreateChildStructure( data, new, ln, ln, cnt + 1 ); + } + } + } + } + + return(CTN(new)); +} + + + +/*****************************************************************************\ +******************************************************************************* +** +** Graphical and render functions. +** +******************************************************************************* +\*****************************************************************************/ + +static void InsertTreeImages( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, struct MUI_NListtree_TreeNode *otn, UWORD cnt ) +{ + struct MUI_NListtree_TreeNode *gp; + + if ( tn ) + { + LONG x1 = -1, x2 = 0; + + // we do a recursive call in case we find a + // parent node for the current one. + if((gp = GetParent(tn))) + InsertTreeImages( data, gp, otn, cnt + 1 ); + + x2 = data->MaxImageWidth; + + if ( GetSucc( (struct Node *)&tn->tn_Node ) ) + { + if(cnt == 0) + { + if ( !( tn->tn_Flags & TNF_LIST ) ) + { + x1 = SPEC_VertT; + } + } + else + { + x1 = SPEC_Vert; + } + } + else + { + if(cnt == 0) + { + if ( !( tn->tn_Flags & TNF_LIST ) ) + { + x1 = SPEC_VertEnd; + } + } + else if ( gp ) + { + x1 = SPEC_Space; + } + } + + if ( ( x1 != -1 ) && x2 ) + { + if ( x1 == SPEC_Space ) + otn->tn_Space += x2 + data->IndentWidth; + + if ( otn->tn_Space > 0 ) + { + snprintf(data->buf, DATA_BUF_SIZE, "%s\033O[%lx;%x;%d,%d]", data->buf, (unsigned long)data->Image[IMAGE_Tree].ListImage, (unsigned int)MUIA_TI_Spec, (int)SPEC_Space, (int)otn->tn_Space ); + + otn->tn_ImagePos += otn->tn_Space; + otn->tn_Space = 0; + } + + if ( x1 != SPEC_Space ) + { + x2 += data->IndentWidth; + + /* + ** Should we draw the root tree? No? Just use space. + */ + if ( ( data->Flags & NLTF_NO_ROOT_TREE ) && !gp->tn_Parent ) + { + snprintf(data->buf, DATA_BUF_SIZE, "%s\033O[%lx;%x;%d,%d]", data->buf, (unsigned long)data->Image[IMAGE_Tree].ListImage, (unsigned int)MUIA_TI_Spec, (int)SPEC_Space, (int)x2 ); + + otn->tn_ImagePos += x2; + } + else + { + // ensures proper text alignment with subnodes in + // case the user selected an additional indentwidth + if(data->IndentWidth > 0) + x2 += 2; + + snprintf(data->buf, DATA_BUF_SIZE, "%s\033O[%lx;%x;%d,%d]", data->buf, (unsigned long)data->Image[IMAGE_Tree].ListImage, (unsigned int)MUIA_TI_Spec, (int)x1, (int)x2 ); + + otn->tn_ImagePos += x2; + } + } + } + } +} + +static void InsertImage( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *otn ) +{ + LONG x1 = -1; + + InsertTreeImages( data, otn, otn, 0 ); + + if ( ( ( otn->tn_Flags & TNF_LIST ) && !( otn->tn_Flags & TNF_NOSIGN ) ) && ( !IsListEmpty( (struct List *)&(CLN( otn ))->ln_List ) || !( data->Flags & NLTF_EMPTYNODES ) ) ) + { + if ( otn->tn_Flags & TNF_OPEN ) + { + x1 = IMAGE_Open; + } + else + { + x1 = IMAGE_Closed; + } + + snprintf(data->buf, DATA_BUF_SIZE, "%s\033O[%lx]", data->buf, (unsigned long)data->Image[x1].ListImage ); + + x1 = SPEC_Hor; + + // add some indent width + if(data->IndentWidth > 0) + snprintf(data->buf, DATA_BUF_SIZE, "%s\033O[%lx;%x;%d,%d]", data->buf, (unsigned long)data->Image[IMAGE_Tree].ListImage, (unsigned int)MUIA_TI_Spec, (int)x1, (unsigned int)data->IndentWidth); + + if(data->UseFolderImage == TRUE) + { + snprintf(data->buf, DATA_BUF_SIZE, "%s\033O[%lx]\033O[%lx;%x;%d,%d]", data->buf, (unsigned long)data->Image[IMAGE_Folder].ListImage, (unsigned long)data->Image[IMAGE_Tree].ListImage, (unsigned int)MUIA_TI_Spec, (unsigned int)SPEC_Space, 3); + } + } +} + + +static void DrawImages( struct MUI_NListtree_TreeNode *otn, struct MUI_NListtree_TreeNode *tn, struct NListtree_Data *data, UWORD cnt ) +{ + if ( tn ) + { + struct MUI_NListtree_TreeNode *gp; + + if((gp = GetParent(tn))) + DrawImages( otn, gp, data, cnt + 1 ); + + if(cnt == 0) + InsertImage( data, otn ); + } +} + + + +/*****************************************************************************\ +******************************************************************************* +** +** General internal class related functions. +** +******************************************************************************* +\*****************************************************************************/ + +ULONG MultiTestFunc( struct NListtree_Data *data, struct MUI_NListtree_TreeNode *tn, LONG seltype, LONG selflags ) +{ + LONG currtype = ( tn->tn_Flags & TNF_SELECTED ) ? MUIV_NListtree_Select_On : MUIV_NListtree_Select_Off; + BOOL doselect = TRUE; + + if ( data->Flags & NLTF_DRAGDROP ) + return( FALSE ); + + if ( data->Flags & NLTF_NLIST_NO_SCM_SUPPORT ) + return( FALSE ); + + if ( currtype != seltype ) + { + if ( data->MultiTestHook ) + { + doselect = (BOOL)MyCallHook( data->MultiTestHook, data, MUIA_NListtree_MultiTestHook, tn, seltype, selflags, currtype ); + } + + if ( doselect ) + { + doselect = DoMethod( data->Obj, MUIM_NListtree_MultiTest, tn, seltype, selflags, currtype ); + } + } + + + /* + if ( doselect ) + D(DBF_ALWAYS, "MULTITEST: 0x%08lx - %s", tn, tn->tn_Name); + */ + + return( doselect ); +} + +HOOKPROTONH(NList_MultiTestFunc, ULONG, Object *obj, struct MUI_NListtree_TreeNode *tn) +{ + struct NListtree_Data *data; + ULONG ret = FALSE; + + data = (struct NListtree_Data *)xget( obj, MUIA_UserData ); + + if ( data->Flags & NLTF_SELECT_METHOD ) + return( TRUE ); + + if ( data->MultiSelect != MUIV_NListtree_MultiSelect_None ) + { + if ( ( data->MultiSelect == MUIV_NListtree_MultiSelect_Default ) || + ( data->MultiSelect == MUIV_NListtree_MultiSelect_Always ) || + ( ( data->MultiSelect == MUIV_NListtree_MultiSelect_Shifted ) && ( data->Flags & NLTF_QUALIFIER_LSHIFT ) ) ) + { + ret = MultiTestFunc( data, tn, MUIV_NListtree_Select_On, 0 ); + } + } + + return( ret ); +} +MakeStaticHook(NList_MultiTestHook, NList_MultiTestFunc); + +HOOKPROTONHNO(_ConstructFunc, APTR, struct MUIP_NListtree_ConstructMessage *msg) +{ + APTR retdata; + + /* + ** Allocate memory for the user field and + ** copy the supplied string to the new + ** allocated piece of memory. + */ + if ( msg->UserData ) + { + int len = strlen((STRPTR)msg->UserData ) + 1; + + if((retdata = AllocVecPooled(msg->MemPool, len))) + { + strlcpy( (STRPTR)retdata, (STRPTR)msg->UserData, len ); + + D(DBF_LISTTREE, "Internal CostructHook ==> Data: '%s'", (STRPTR)msg->UserData); + + return( retdata ); + } + } + + return( NULL ); +} +MakeStaticHook(_ConstructHook, _ConstructFunc); + +HOOKPROTONHNO(_DestructFunc, ULONG, struct MUIP_NListtree_DestructMessage *msg) +{ + D(DBF_LISTTREE, "Internal DestructHook ==> Data: '%s'", (STRPTR)msg->UserData); + + /* + ** Free the string memory. + */ + if ( msg->UserData ) + { + FreeVecPooled( msg->MemPool, msg->UserData ); + } + + return( 0 ); +} +MakeStaticHook(_DestructHook, _DestructFunc); + +/* +** +** The internal compare hook functions. +** +*/ +HOOKPROTONHNONP(_CompareFunc_Head, LONG) //struct MUIP_NListtree_CompareMessage *msg) +{ + return( -1 ); +} +MakeStaticHook(_CompareHook_Head, _CompareFunc_Head); + +HOOKPROTONHNONP(_CompareFunc_Tail, LONG) //struct MUIP_NListtree_CompareMessage *msg) +{ + return( 1 ); +} +MakeStaticHook(_CompareHook_Tail, _CompareFunc_Tail); + +HOOKPROTONHNO(_CompareFunc_LeavesTop, LONG, struct MUIP_NListtree_CompareMessage *msg) +{ + if ( ( msg->TreeNode1->tn_Flags & TNF_LIST ) && ( msg->TreeNode2->tn_Flags & TNF_LIST ) ) + { + return( Stricmp( msg->TreeNode1->tn_Name, msg->TreeNode2->tn_Name ) ); + } + else if ( msg->TreeNode1->tn_Flags & TNF_LIST ) + { + return( 1 ); + } + else if ( msg->TreeNode2->tn_Flags & TNF_LIST ) + { + return( -1 ); + } + else + { + return( Stricmp( msg->TreeNode1->tn_Name, msg->TreeNode2->tn_Name ) ); + } +} +MakeStaticHook(_CompareHook_LeavesTop, _CompareFunc_LeavesTop); + +HOOKPROTONHNO(_CompareFunc_LeavesBottom, LONG, struct MUIP_NListtree_CompareMessage *msg) +{ + if ( ( msg->TreeNode1->tn_Flags & TNF_LIST ) && ( msg->TreeNode2->tn_Flags & TNF_LIST ) ) + { + return( Stricmp( msg->TreeNode1->tn_Name, msg->TreeNode2->tn_Name ) ); + } + else if ( msg->TreeNode1->tn_Flags & TNF_LIST ) + { + return( -1 ); + } + else if ( msg->TreeNode2->tn_Flags & TNF_LIST ) + { + return( 1 ); + } + else + { + return( Stricmp( msg->TreeNode1->tn_Name, msg->TreeNode2->tn_Name ) ); + } +} +MakeStaticHook(_CompareHook_LeavesBottom, _CompareFunc_LeavesBottom); + +HOOKPROTONHNO(_CompareFunc_LeavesMixed, LONG, struct MUIP_NListtree_CompareMessage *msg) +{ + return( Stricmp( msg->TreeNode1->tn_Name, msg->TreeNode2->tn_Name ) ); +} +MakeStaticHook(_CompareHook_LeavesMixed, _CompareFunc_LeavesMixed); + +VOID SortList( struct MUI_NListtree_ListNode *ln, struct NListtree_Data *data ) +{ + if ( ln->ln_Table.tb_Entries > 1 ) + { + struct MUI_NListtree_TreeNode **localtable; + LONG i; + + // let's start the quicksort algorithm to sort our entries. + qsort2(ln->ln_Table.tb_Table, ln->ln_Table.tb_Entries, data); + + localtable = ln->ln_Table.tb_Table; + + NewList( (struct List *)&ln->ln_List ); + + for( i = 0; i < ln->ln_Table.tb_Entries; i++ ) + { + AddTail( (struct List *)&ln->ln_List, (struct Node *)localtable[i] ); + } + } +} + + +struct MUI_NListtree_ListNode *ListNode_Sort( struct MUI_NListtree_ListNode *ln, struct NListtree_Data *data, ULONG flags ) +{ + if ( ( flags & MUIV_NListtree_Sort_Flag_RecursiveAll ) || ( flags & MUIV_NListtree_Sort_Flag_RecursiveOpen ) ) + { + struct MUI_NListtree_ListNode *ln2 = CLN( &ln->ln_List ); + + while((ln2 = CLN(GetSucc((struct Node *)ln2)))) + { + if ( ln->ln_Flags & TNF_LIST ) + { + if ( ( ln->ln_Flags & TNF_OPEN ) || ( flags & MUIV_NListtree_Sort_Flag_RecursiveAll ) ) + ListNode_Sort( ln2, data, flags ); + } + } + } + + if ( ln->ln_Flags & TNF_LIST ) + SortList( ln, data ); + + return( ln ); +} + +HOOKPROTONHNO(_FindNameFunc_CaseSensitive, LONG, struct MUIP_NListtree_FindNameMessage *msg) +{ + return( strcmp( msg->Name, msg->NodeName ) ); +} +MakeStaticHook(_FindNameHook_CaseSensitive, _FindNameFunc_CaseSensitive); + +HOOKPROTONHNO(_FindNameFunc_CaseInsensitive, LONG, struct MUIP_NListtree_FindNameMessage *msg) +{ + return( Stricmp( msg->Name, msg->NodeName ) ); +} +MakeStaticHook(_FindNameHook_CaseInsensitive, _FindNameFunc_CaseInsensitive); + +HOOKPROTONHNO(_FindNameFunc_Part, LONG, struct MUIP_NListtree_FindNameMessage *msg) +{ + return( strncmp( msg->Name, msg->NodeName, strlen( msg->Name ) ) ); +} +MakeStaticHook(_FindNameHook_Part, _FindNameFunc_Part); + +HOOKPROTONHNO(_FindNameFunc_PartCaseInsensitive, LONG, struct MUIP_NListtree_FindNameMessage *msg) +{ + return( Strnicmp( msg->Name, msg->NodeName, strlen( msg->Name ) ) ); +} +MakeStaticHook(_FindNameHook_PartCaseInsensitive, _FindNameFunc_PartCaseInsensitive); + +HOOKPROTONHNO(_FindNameFunc_PointerCompare, LONG, struct MUIP_NListtree_FindNameMessage *msg) +{ + return( (LONG)( (SIPTR)msg->Name - (SIPTR)msg->NodeName ) ); +} +MakeStaticHook(_FindNameHook_PointerCompare, _FindNameFunc_PointerCompare); + +HOOKPROTONHNO(_FindUserDataFunc_CaseSensitive, LONG, struct MUIP_NListtree_FindUserDataMessage *msg) +{ + return( strcmp( (STRPTR)msg->User, (STRPTR)msg->UserData ) ); +} +MakeStaticHook(_FindUserDataHook_CaseSensitive, _FindUserDataFunc_CaseSensitive); + +HOOKPROTONHNO(_FindUserDataFunc_CaseInsensitive, LONG, struct MUIP_NListtree_FindUserDataMessage *msg) +{ + return( Stricmp( (STRPTR)msg->User, (STRPTR)msg->UserData ) ); +} +MakeStaticHook(_FindUserDataHook_CaseInsensitive, _FindUserDataFunc_CaseInsensitive); + +HOOKPROTONHNO(_FindUserDataFunc_Part, LONG, struct MUIP_NListtree_FindUserDataMessage *msg) +{ + return( strncmp( (STRPTR)msg->User, (STRPTR)msg->UserData, strlen( (STRPTR)msg->User ) ) ); +} +MakeStaticHook(_FindUserDataHook_Part, _FindUserDataFunc_Part); + +HOOKPROTONHNO(_FindUserDataFunc_PartCaseInsensitive, LONG, struct MUIP_NListtree_FindUserDataMessage *msg) +{ + return( Strnicmp( (STRPTR)msg->User, (STRPTR)msg->UserData, strlen( (STRPTR)msg->User ) ) ); +} +MakeStaticHook(_FindUserDataHook_PartCaseInsensitive, _FindUserDataFunc_PartCaseInsensitive); + +HOOKPROTONHNO(_FindUserDataFunc_PointerCompare, LONG, struct MUIP_NListtree_FindUserDataMessage *msg) +{ + return( (LONG)( (SIPTR)msg->User - (SIPTR)msg->UserData ) ); +} +MakeStaticHook(_FindUserDataHook_PointerCompare, _FindUserDataFunc_PointerCompare); + + +/*****************************************************************************\ +******************************************************************************* +** +** General internal class related help functions. +** +******************************************************************************* +\*****************************************************************************/ + +/****** NListtree.mcc/MUIA_NListtree_Active ********************************** +* +* NAME +* +* MUIA_NListtree_Active -- [.SG], struct MUI_NListtree_TreeNode * +* +* +* SPECIAL VALUES +* +* MUIV_NListtree_Active_Off +* MUIV_NListtree_Active_Parent +* MUIV_NListtree_Active_First +* MUIV_NListtree_Active_FirstVisible +* MUIV_NListtree_Active_LastVisible +* +* +* FUNCTION +* +* Setting this attribute will move the cursor to the defined tree node +* if it is visible. If the node is in an opened tree the listview is +* scrolling into the visible area. Setting MUIV_NListtree_Active_Off will +* vanish the cursor. +* +* MUIV_NListtree_Active_First/FirstVisible/LastVisible are special values +* for activating the lists first or the top/bottom visible entry. +* +* See MUIA_NListtree_AutoVisible for special activation features. +* +* If this attribute is read it returns the active tree node. The result +* is MUIV_NListtree_Active_Off if there is no active entry. +* +* +* NOTIFICATIONS +* +* You can create a notification on MUIA_NListtree_Active. The +* TriggerValue is the active tree node. +* +* +* SEE ALSO +* +* MUIA_NListtree_AutoVisible, MUIA_NList_First, MUIA_NList_Visible, +* MUIA_NListtree_ActiveList +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_ActiveList ****************************** +* +* NAME +* +* MUIA_NListtree_ActiveList -- [..G], struct MUI_NListtree_TreeNode * +* +* +* SPECIAL VALUES +* +* MUIV_NListtree_ActiveList_Off +* +* +* FUNCTION +* +* If this attribute is read it returns the active list node. The +* active list node is always the parent of the active entry. +* The result is MUIV_NListtree_ActiveList_Off if there is no +* active list (when there is no active entry). +* +* +* NOTIFICATIONS +* +* You can create notifications on MUIA_NListtree_ActiveList. The +* TriggerValue is the active list node. +* +* +* SEE ALSO +* +* MUIA_NListtree_Active +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_AutoVisible ***************************** +* +* NAME +* +* MUIA_NListtree_AutoVisible -- [ISG], struct MUI_NListtree_TreeNode * +* +* +* SPECIAL VALUES +* +* MUIV_NListtree_AutoVisible_Off +* MUIV_NListtree_AutoVisible_Normal +* MUIV_NListtree_AutoVisible_FirstOpen +* MUIV_NListtree_AutoVisible_Expand +* +* +* FUNCTION +* +* Set this to make your list automatically jump to the active +* entry. +* +* MUIV_NListtree_AutoVisible_Off: +* The display does NOT scroll the active entry into the +* visible area. +* +* MUIV_NListtree_AutoVisible_Normal: +* This will scroll the active entry into the visible area +* if it is visible (entry is a member of an open node). +* This is the default. +* +* MUIV_NListtree_AutoVisible_FirstOpen: +* Nodes are not opened, but the first open parent node of +* the active entry is scrolled into the visible area if the +* active entry is not visible. +* +* MUIV_NListtree_AutoVisible_Expand: +* All parent nodes are opened until the first open node is +* reached and the active entry will be scrolled into the +* visible area. +* +* +* NOTIFICATIONS +* +* +* SEE ALSO +* +* MUIA_NListtree_Active, MUIA_NList_AutoVisible +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_CloseHook ******************************* +* +* NAME +* +* MUIA_NListtree_CloseHook -- [IS.], struct Hook * +* +* +* SPECIAL VALUES +* +* +* FUNCTION +* +* The close hook is called after a list node is closed, then you can +* change the list. +* +* The close hook will be called with the hook in A0, the object in A2 +* and a MUIP_NListtree_CloseMessage struct in A1 (see nlisttree_mcc.h). +* +* To remove the hook set this to NULL. +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIA_NListtree_Open, MUIA_NListtree_CloseHook +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_CompareHook ***************************** +* +* NAME +* +* MUIA_NListtree_CompareHook -- [IS.], struct Hook * +* +* +* SPECIAL VALUES +* +* MUIV_NListtree_CompareHook_Head +* MUIV_NListtree_CompareHook_Tail +* MUIV_NListtree_CompareHook_LeavesTop +* MUIV_NListtree_CompareHook_LeavesMixed +* MUIV_NListtree_CompareHook_LeavesBottom +* +* +* FUNCTION +* +* Set this attribute to your own hook if you want to sort the entries in +* the list tree by your own way. +* +* When you sort your list or parts of your list via MUIM_NListtree_Sort, +* using the insert method with MUIV_NListtree_Insert_Sort or dropping an +* entry on a closed node, this compare hook is called. +* +* There are some builtin compare hooks available, called: +* +* MUIV_NListtree_CompareHook_Head +* Any entry is inserted at head of the list. +* +* MUIV_NListtree_CompareHook_Tail +* Any entry is inserted at tail of the list. +* +* MUIV_NListtree_CompareHook_LeavesTop +* Leaves are inserted at top of the list, nodes at bottom. They are +* alphabetically sorted. +* +* MUIV_NListtree_CompareHook_LeavesMixed +* The entries are only alphabetically sorted. +* +* MUIV_NListtree_CompareHook_LeavesBottom +* Leaves are inserted at bottom of the list, nodes at top. They are +* alphabetically sorted. This is default. +* +* The hook will be called with the hook in A0, the object in A2 and +* a MUIP_NListtree_CompareMessage struct in A1 (see nlisttree_mcc.h). You +* should return something like: +* +* <0 (TreeNode1 < TreeNode2) +* 0 (TreeNode1 == TreeNode2) +* >0 (TreeNode1 > TreeNode2) +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIA_NListtree_Insert, MUIM_DragDrop, +* MUIA_NList_CompareHook +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_ConstructHook *************************** +* +* NAME +* +* MUIA_NListtree_ConstructHook -- [IS.], struct Hook * +* +* +* SPECIAL VALUES +* +* MUIV_NListtree_ConstructHook_String +* +* MUIV_NListtree_ConstructHook_Flag_AutoCreate +* If using the KeepStructure feature in MUIM_NListtree_Move or +* MUIM_NListtree_Copy, this flag will be set when calling your +* construct hook. Then you can react if your hook is not simply +* allocating memory. +* +* +* FUNCTION +* +* The construct hook is called whenever you add an entry to your +* listtree. The pointer isn't inserted directly, the construct hook is +* called and its result code is added. +* +* When an entry shall be removed the corresponding destruct hook is +* called. +* +* The construct hook will be called with the hook in A0, the object in +* A2 and a MUIP_NListtree_ConstructMessage struct in A1 (see +* nlisttree_mcc.h). +* The message holds a standard kick 3.x memory pool pointer. If you want, +* you can use the exec or amiga.lib functions for allocating memory +* within this pool, but this is only an option. +* +* If the construct hook returns NULL, nothing will be added to the list. +* +* There is a builtin construct hook available called +* MUIV_NListtree_ConstructHook_String. This expects that the field +* 'tn_User' in the treenode is a string pointer (STRPTR), which's +* string is copied. +* Of course you have to use MUIV_NListtree_DestructHook_String in +* this case! +* +* To remove the hook set this to NULL. +* +* NEVER pass a NULL pointer when you have specified the internal string +* construct/destruct hooks or NListtree will die! +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIA_NList_ConstructHook, MUIA_NListtree_DestructHook, +* MUIA_NListtree_DisplayHook +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_DestructHook **************************** +* +* NAME +* +* MUIA_NListtree_DestructHook -- [IS.], struct Hook * +* +* +* SPECIAL VALUES +* +* MUIV_NListtree_DestructHook_String +* +* +* FUNCTION +* +* Set up a destruct hook for your listtree. The destruct hook is called +* whenevere you remove an entry from the listtree. Here you can free memory +* which was allocated by the construct hook before. +* +* The destruct hook will be called with the hook in A0, the object +* in A2 and a MUIP_NListtree_DestructMessage struct in A1 (see +* nlisttree_mcc.h). +* The message holds a standard kick 3.x memory pool pointer. You must +* use this pool when you have used it inside the construct hook to +* allocate pooled memory. +* +* There is a builtin destruct hook available called +* MUIV_NListtree_DestructHook_String. This expects that the 'User' data +* in the treenode is a string and you have used +* MUIV_NListtree_ConstructHook_String in the construct hook! +* +* To remove the hook set this to NULL. +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIA_NList_ConstructHook, MUIA_NListtree_ConstructHook, +* MUIA_NListtree_DisplayHook +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_DisplayHook ***************************** +* +* NAME +* +* MUIA_NListtree_DisplayHook -- [IS.], +* +* +* SPECIAL VALUES +* +* +* FUNCTION +* +* You have to supply a display hook to specify what should be shown in +* the listview, otherwise only the name of the nodes is displayed. +* +* The display hook will be called with the hook in A0, the object in +* A2 and a MUIP_NListtree_DisplayMessage struct in A1 (see nlisttree_mcc.h). +* +* The structure holds a pointer to a string array containing as many +* entries as your listtree may have columns. You have to fill this +* array with the strings you want to display. Check out that the array +* pointer of the tree column is set to NULL, if the normal name of the +* node should appear. +* You can set a preparse string in Preparse for the corresponding col +* element. Using it you'll be able to avoid copying the string in a +* buffer to add something in the beginning of the col string. +* +* The display hook also gets the position of the current entry as +* additional parameter. It is stored in the longword preceding the col +* array (don't forget it's a LONG). +* +* You can set the array pointer of the tree column to a string, which is +* diplayed instead of the node name. You can use this to mark nodes. +* +* See MUIA_NList_Format for details about column handling. +* +* To remove the hook and use the internal default display hook set this +* to NULL. +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIA_NList_Format, MUIA_Text_Contents +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_CopyToClipHook ************************** +* +* NAME +* +* MUIA_NListtree_CopyToClipHook -- [IS.], +* +* +* SPECIAL VALUES +* +* MUIV_NListtree_CopyToClipHook_Default +* +* +* FUNCTION +* +* This thing works near like MUIA_NListtree_DisplayHook, but is +* called when the NListtree object want to make a clipboard copy. +* +* You can return only one string pointer. If you return NULL, +* nothing will be copied. If you return -1, the entry will be +* handled as a normal string and the name field is used. +* +* The builtin hook skips all ESC sequences and adds a tab char +* between columns. +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIM_NListtree_CopyToClip +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_DoubleClick ***************************** +* +* NAME +* +* MUIA_NListtree_DoubleClick -- [ISG], ULONG +* +* +* SPECIAL VALUES +* +* MUIV_NListtree_DoubleClick_Off +* MUIV_NListtree_DoubleClick_All +* MUIV_NListtree_DoubleClick_Tree +* MUIV_NListtree_DoubleClick_NoTrigger +* +* +* FUNCTION +* +* A doubleclick opens a node if it was closed, it is closed if the node +* was open. You have to set the column which should do this. +* +* Normally only the column number is set here, but there are special +* values: +* +* MUIV_NListtree_DoubleClick_Off: +* A doubleclick is not handled. +* +* MUIV_NListtree_DoubleClick_All: +* All columns react on doubleclick. +* +* MUIV_NListtree_DoubleClick_Tree +* Only a doubleclick on the defined tree column is recognized. +* +* MUIV_NListtree_DoubleClick_NoTrigger: +* A doubleclick is not handled and not triggered! +* +* +* NOTIFICATION +* +* The TriggerValue of the notification is the tree node you have double- +* clicked, you can GetAttr() MUIA_NListtree_DoubleClick for the column +* number. The struct 'MUI_NListtree_TreeNode *' is used for trigger. +* +* The notification is done on leaves and on node columns, which are not +* set in MUIA_NListtree_DoubleClick. +* +* SEE ALSO +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_DragDropSort **************************** +* +* NAME +* +* MUIA_NListtree_DragDropSort -- [IS.], BOOL +* +* +* SPECIAL VALUES +* +* +* FUNCTION +* +* Setting this attribute to FALSE will disable the ability to sort the +* list tree by drag & drop. Defaults to TRUE. +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_DupNodeName ***************************** +* +* NAME +* +* MUIA_NListtree_DupNodeName -- [IS.], BOOL +* +* +* SPECIAL VALUES +* +* +* FUNCTION +* +* If this attribute is set to FALSE the names of the node will not be +* duplicated, only the string pointers are used. Be careful the strings +* have to be valid everytime. +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_EmptyNodes ****************************** +* +* NAME +* +* MUIA_NListtree_EmptyNodes -- [IS.], BOOL +* +* +* SPECIAL VALUES +* +* +* FUNCTION +* +* Setting this attribute to TRUE will display all empty nodes as leaves, +* this means no list indicator is shown. Nevertheless the entry is +* handled like a node. +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_FindNameHook **************************** +* +* NAME +* +* MUIA_NListtree_FindNameHook -- [IS.], +* +* +* SPECIAL VALUES +* +* MUIV_NListtree_FindNameHook_CaseSensitive +* Search for the complete string, case sensitive. +* +* MUIV_NListtree_FindNameHook_CaseInsensitive +* Search for the complete string, case insensitive. +* +* MUIV_NListtree_FindNameHook_Part +* Search for the first part of the string, case sensitive. +* +* MUIV_NListtree_FindNameHook_PartCaseInsensitive +* Search for the first part of the string, case insensitive. +* +* MUIV_NListtree_FindNameHook_PointerCompare +* Do only a pointer comparision. Note, that this is in fact +* a pointer subtraction to fit into the rules. It returns +* the difference of the two fields if no match. +* +* FUNCTION +* +* You can install a FindName hook to specify your own search +* criteria. +* +* The find name hook will be called with the hook in A0, the object in +* A2 and a MUIP_NListtree_FindNameMessage struct in A1 +* (see nlisttree_mcc.h). It should return (ret != 0) for entries which +* are not matching the pattern and a value of 0 if a match. +* +* The find name message structure holds a pointer to a string +* containing the name to search for and pointers to the name- and user- +* field of the node which is currently processed. +* +* The MUIV_NListtree_FindNameHook_CaseSensitive will be used as default. +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIM_NListtree_FindName, MUIM_NListtree_FindUserData, +* MUIA_NListtree_FindUserDataHook +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_FindUserDataHook ************************ +* +* NAME +* +* MUIA_NListtree_FindUserDataHook -- [IS.], +* +* +* SPECIAL VALUES +* +* MUIV_NListtree_FindUserDataHook_CaseSensitive +* Search for the complete string, case sensitive. +* +* MUIV_NListtree_FindUserDataHook_CaseInsensitive +* Search for the complete string, case insensitive. +* +* MUIV_NListtree_FindUserDataHook_Part +* Search for the first part of the string, case sensitive. +* +* MUIV_NListtree_FindUserDataHook_PartCaseInsensitive +* Search for the first part of the string, case insensitive. +* +* MUIV_NListtree_FindUserDataHook_PointerCompare +* Do only a pointer comparision. Note, that this is in fact +* a pointer subtraction to fit into the rules. It returns +* the difference of the two user fields if no match. +* +* +* FUNCTION +* +* You can install a FindUserData hook to specify your own search +* criteria. +* +* The find user data hook will be called with the hook in A0, the object +* in A2 and a MUIP_NListtree_FindUserDataMessage struct in A1 +* (see nlisttree_mcc.h). It should return (ret != 0) for entries which +* are not matching the pattern and a value of 0 if a match. +* +* The find user data message structure holds a pointer to a string +* containing the data to search for and pointers to the user- and name- +* field of the node which is currently processed. +* +* MUIV_NListtree_FindUserDataHook_CaseSensitive will be used as +* default. +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIM_NListtree_FindName, MUIM_NListtree_FindUserData, +* MUIA_NListtree_FindNameHook +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_Format ********************************** +* +* NAME +* +* MUIA_NListtree_Format -- [IS.], STRPTR +* +* +* SPECIAL VALUES +* +* +* FUNCTION +* +* Same as MUIA_NList_Format, but one column is reserved for the tree +* indicators and the names of the nodes. +* +* For further detailed information see MUIA_NList_Format! +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIA_NList_Format, MUIA_NListtree_DisplayHook, +* MUIA_Text_Contents +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_MultiSelect ***************************** +* +* NAME +* +* MUIA_NListtree_MultiSelect -- [I..], +* +* +* SPECIAL VALUES +* +* MUIV_NListtree_MultiSelect_None +* MUIV_NListtree_MultiSelect_Default +* MUIV_NListtree_MultiSelect_Shifted +* MUIV_NListtree_MultiSelect_Always +* +* +* FUNCTION +* +* Four possibilities exist for a listviews multi select +* capabilities: +* +* MUIV_NListtree_MultiSelect_None: +* The list tree cannot multiselect at all. +* +* MUIV_NListtree_MultiSelect_Default: +* The multi select type (with or without shift) +* depends on the users preferences setting. +* +* MUIV_NListtree_MultiSelect_Shifted: +* Overrides the users prefs, multi selecting only +* together with shift key. +* +* MUIV_NListtree_MultiSelect_Always: +* Overrides the users prefs, multi selecting +* without shift key. +* +* +* NOTIFICATION +* +* NOTES +* +* SEE ALSO +* +* MUIA_NListtree_MultiTestHook, MUIM_NListtree_MultiSelect +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_MultiTestHook *************************** +* +* NAME +* +* MUIA_NListtree_MultiTestHook -- [IS.], struct Hook * +* +* +* SPECIAL VALUES +* +* +* FUNCTION +* +* If you plan to have a multi selecting list tree but not +* all of your entries are actually multi selectable, you +* can supply a MUIA_NListtree_MultiTestHook. +* +* The multi test hook will be called with the hook in A0, the object +* in A2 and a MUIP_NListtree_MultiTestMessage struct in A1 (see +* nlisttree_mcc.h) and should return TRUE if the entry is multi +* selectable, FALSE otherwise. +* +* To remove the hook set this to NULL. +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIA_NListtree_ConstructHook, MUIA_NListtree_DestructHook +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_OpenHook ******************************** +* +* NAME +* +* MUIA_NListtree_OpenHook -- [IS.], struct Hook * +* +* +* SPECIAL VALUES +* +* +* FUNCTION +* +* The open hook is called whenever a list node will be opened, so you +* can change the list before the node is open. +* +* The open hook will be called with the hook in A0, the object in A2 +* and a MUIP_NListtree_OpenMessage struct in A1 (see nlisttree_mcc.h). +* +* To remove the hook set this to NULL. +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIA_NListtree_Open, MUIA_NListtree_CloseHook +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_Quiet *********************************** +* +* NAME +* +* MUIA_NListtree_Quiet -- [.S.], QUIET +* +* +* SPECIAL VALUES +* +* +* FUNCTION +* +* If you add/remove lots of entries to/from a listtree, this will cause +* lots of screen action and slow down the operation. Setting +* MUIA_NListtree_Quiet to TRUE will temporarily prevent the listtree from +* being refreshed, this refresh will take place only once when you set +* it back to FALSE again. +* +* MUIA_NListtree_Quiet holds a nesting count to avoid trouble with +* multiple setting/unsetting this attribute. You are encoraged to +* always use TRUE/FALSE pairs here or you will went in trouble. +* +* DO NOT USE MUIA_NList_Quiet here! +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIM_NListtree_Insert, MUIM_NListtree_Remove +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_Title *********************************** +* +* NAME +* +* MUIA_NListtree_Title -- [IS.], BOOL +* +* +* SPECIAL VALUES +* +* +* FUNCTION +* +* Specify a title for the current listtree. +* +* For detailed information see MUIA_NList_Title! +* +* +* NOTIFICATION +* +* +* BUGS +* +* The title should not be a string as for single column listviews. This +* attribute can only be set to TRUE or FALSE. +* +* +* SEE ALSO +* +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_TreeColumn ****************************** +* +* NAME +* +* MUIA_NListtree_TreeColumn -- [ISG], ULONG +* +* +* SPECIAL VALUES +* +* FUNCTION +* +* Specify the column of the list tree, the node indicator and the name +* of the node are displayed in. +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIA_NListtree_DisplayHook, MUIA_NListtree_Format +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_ShowTree ******************************** +* +* NAME +* +* MUIA_NListtree_ShowTree -- [ISG], ULONG +* +* +* SPECIAL VALUES +* +* FUNCTION +* +* Specify FALSE here if you want the whole tree to be disappear. +* Defaults to TRUE; +* +* NOTIFICATION +* +* +* SEE ALSO +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_DropType ******************************** +* +* NAME +* +* MUIA_NListtree_DropType -- [..G], ULONG +* +* +* SPECIAL VALUES +* +* MUIV_NListtree_DropType_None +* MUIV_NListtree_DropType_Above +* MUIV_NListtree_DropType_Below +* MUIV_NListtree_DropType_Onto +* +* +* FUNCTION +* +* After a successfull drop operation, this value holds the position +* relative to the value of MUIA_NListtree_DropTarget/DropTargetPos. +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIA_NListtree_DropTarget, MUIA_NListtree_DropTargetPos +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_DropTarget ****************************** +* +* NAME +* +* MUIA_NListtree_DropTarget -- [..G], ULONG +* +* +* SPECIAL VALUES +* +* FUNCTION +* +* After a successfull drop operation, this value holds the entry where +* the entry was dropped. The relative position (above etc.) can be +* obtained by reading the attribute MUIA_NListtree_DropType. +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIA_NListtree_DropTargetPos, MUIA_NListtree_DropType +* +* +****************************************************************************** +* +*/ + +/****** NListtree.mcc/MUIA_NListtree_DropTargetPos *************************** +* +* NAME +* +* MUIA_NListtree_DropTargetPos -- [..G], ULONG +* +* +* SPECIAL VALUES +* +* FUNCTION +* +* After a successfull drop operation, this value holds the integer +* position of the entry where the dragged entry was dropped. The +* entry itself can be obtained by reading MUIA_NListtree_DropTarget, +* the relative position (above etc.) can be obtained by reading the +* attribute MUIA_NListtree_DropType. +* +* +* NOTIFICATION +* +* +* SEE ALSO +* +* MUIA_NListtree_DropTarget, MUIA_NListtree_DropType +* +* +****************************************************************************** +* +*/ + +static VOID SetAttributes( struct NListtree_Data *data, struct opSet *msg, BOOL initial ) +{ + struct MUI_NListtree_ListNode *actlist; + struct MUI_NListtree_TreeNode *actnode; + struct TagItem *tags, *tag; + struct Hook *orgHook = NULL; + BOOL intfunc, onlytrigger = FALSE; + + for(tags = msg->ops_AttrList; (tag = NextTagItem((APTR)&tags)); ) + { + intfunc = TRUE; + + switch( tag->ti_Tag ) + { + /* + ** Configuration part. + */ + case MUIA_NListtree_IsMCP: + data->Flags |= NLTF_ISMCP; + break; + + case MUICFG_NListtree_ImageSpecClosed: + { + DisposeImage( data, IMAGE_Closed ); + SetupImage( data, (struct MUI_ImageSpec *)tag->ti_Data, IMAGE_Closed ); + DoRefresh( data ); + + D(DBF_GETSET, "SET MUICFG_NListtree_ImageSpecClosed: '%s'", (STRPTR)tag->ti_Data); + } + break; + + case MUICFG_NListtree_ImageSpecOpen: + { + DisposeImage( data, IMAGE_Open ); + SetupImage( data, (struct MUI_ImageSpec *)tag->ti_Data, IMAGE_Open ); + DoRefresh( data ); + + D(DBF_GETSET, "SET MUICFG_NListtree_ImageSpecOpen: '%s'", (STRPTR)tag->ti_Data); + } + break; + + case MUICFG_NListtree_ImageSpecFolder: + { + DisposeImage( data, IMAGE_Folder ); + SetupImage( data, (struct MUI_ImageSpec *)tag->ti_Data, IMAGE_Folder ); + DoRefresh( data ); + + D(DBF_GETSET, "SET MUICFG_NListtree_ImageSpecFolder: '%s'", (STRPTR)tag->ti_Data); + } + break; + + case MUICFG_NListtree_PenSpecLines: + { + if( data->MRI ) + { + ObtPen( data->MRI, &data->Pen[PEN_Line], (struct MUI_PenSpec *)tag->ti_Data ); + DoRefresh( data ); + + D(DBF_GETSET, "SET MUICFG_NListtree_PenSpecLines: %s", (STRPTR)tag->ti_Data); + } + } + break; + + case MUICFG_NListtree_PenSpecShadow: + { + if( data->MRI ) + { + ObtPen( data->MRI, &data->Pen[PEN_Shadow], (struct MUI_PenSpec *)tag->ti_Data ); + DoRefresh( data ); + + D(DBF_GETSET, "SET MUICFG_NListtree_PenSpecShadow: %s", (STRPTR)tag->ti_Data); + } + } + break; + + case MUICFG_NListtree_PenSpecGlow: + { + if( data->MRI ) + { + ObtPen( data->MRI, &data->Pen[PEN_Glow], (struct MUI_PenSpec *)tag->ti_Data ); + DoRefresh( data ); + + D(DBF_GETSET, "SET MUICFG_NListtree_PenSpecGlow: %s", (STRPTR)tag->ti_Data); + } + } + break; + + case MUICFG_NListtree_IndentWidth: + { + data->IndentWidth = (BYTE)tag->ti_Data; + DoRefresh( data ); + + D(DBF_GETSET, "SET MUICFG_NListtree_IndentWidth: %ld", tag->ti_Data); + } + break; + + case MUICFG_NListtree_LineType: + { + data->LineType = (ULONG)tag->ti_Data; + DoRefresh( data ); + + D(DBF_GETSET, "SET MUICFG_NListtree_LineType: %ld", tag->ti_Data); + } + break; + + case MUICFG_NListtree_UseFolderImage: + { + data->UseFolderImage = (BOOL)tag->ti_Data; + DoRefresh(data); + + D(DBF_GETSET, "SET MUICFG_NListtree_UseFolderImage: %ld", tag->ti_Data); + } + break; + + case MUICFG_NListtree_OpenAutoScroll: + { + if ( (BOOL)tag->ti_Data ) + data->Flags |= NLTF_OPENAUTOSCROLL; + else + data->Flags &= ~NLTF_OPENAUTOSCROLL; + + D(DBF_GETSET, "SET MUICFG_NListtree_OpenAutoScroll: %ld", tag->ti_Data); + } + break; + + /* + ** General part. + */ + case MUIA_NListtree_OnlyTrigger: + { + onlytrigger = TRUE; + D(DBF_GETSET, "SET MUIA_NListtree_OnlyTrigger"); + } + break; + + case MUIA_NList_Active: + { + D(DBF_GETSET, "SET MUIA_NList_Active %ld%s",tag->ti_Data,(data->Flags & NLTF_ACTIVENOTIFY)?" notify activation set":"no notify set"); + } + break; + + case MUIA_NListtree_Active: + { + D(DBF_GETSET, "SET MUIA_NListtree_Active"); + if((tag->ti_Data == (ULONG)MUIV_NListtree_Active_Off) || + (tag->ti_Data == (IPTR)&data->RootList) || + ((tag->ti_Data == (ULONG)MUIV_NListtree_Active_Parent) && + (data->ActiveNode == (ULONG)MUIV_NListtree_Active_Off)) + ) + { + actnode = MUIV_NListtree_Active_Off; + actlist = &data->RootList; + } + else + { + struct MUI_NListtree_TreeNode *tn; + + /* + ** Parent of the active node. + */ + if(tag->ti_Data == (ULONG)MUIV_NListtree_Active_Parent) + { + tag->ti_Data = (IPTR)GetParent( data->ActiveNode ); + } + + /* + ** First list entry (visible or not). + */ + if(tag->ti_Data == (ULONG)MUIV_NListtree_Active_First) + tag->ti_Data = (IPTR)GetHead( (struct List *)&data->RootList.ln_List ); + + /* + ** First visible entry. + */ + if(tag->ti_Data == (ULONG)MUIV_NListtree_Active_FirstVisible) + { + LONG firstvisible; + + firstvisible = xget( data->Obj, MUIA_NList_First ); + DoMethod( data->Obj, MUIM_NList_GetEntry, firstvisible, &tn ); + + tag->ti_Data = (IPTR)tn; + } + + /* + ** Last visible entry. + */ + if(tag->ti_Data == (ULONG)MUIV_NListtree_Active_LastVisible) + { + LONG lastvisible; + + lastvisible = xget( data->Obj, MUIA_NList_First ) + xget( data->Obj, MUIA_NList_Visible ) - 1; + DoMethod( data->Obj, MUIM_NList_GetEntry, lastvisible, &tn ); + + tag->ti_Data = (IPTR)tn; + } + + if ( tag->ti_Data != (IPTR)&data->RootList ) + { + actnode = CTN( tag->ti_Data ); + actlist = CLN( GetParent( (CTN( tag->ti_Data) ) ) ); + } else + { + /* Do nothing */ + return; + } + } + + /* + ** With actnode and actlist we avoid ActiveNode ping-pong... + */ + if ( !initial && ( ( actnode != data->ActiveNode ) || ( data->Flags & NLTF_SETACTIVE ) ) ) + { + data->ActiveNode = actnode; + data->ActiveNodeNum = xget( data->Obj, MUIA_NList_Active ); + } + + if (!initial) + { + /* + ** For notification only. + */ + if (data->ActiveList != actlist) + { + data->ActiveList = actlist; + MakeNotify( data, MUIA_NListtree_ActiveList, actlist ); + } + } + + + if ( !onlytrigger ) + { + ActivateTreeNode( data, actnode ); + DoMethod( data->Obj, MUIM_NListtree_Active, data->ActiveNodeNum, data->ActiveNode ); + + D(DBF_GETSET, "SET MUIA_NListtree_Active: %s - 0x%08lx - list: 0x%08lx rootlist: 0x%lx", actnode ? actnode->tn_Name : (STRPTR)"NULL", actnode, data->ActiveList, &data->RootList); + } + else + { + D(DBF_GETSET, "SET MUIA_NListtree_Active: TRIGGER: %s - 0x%08lx", actnode ? actnode->tn_Name : (STRPTR)"NULL", actnode); + } + } + break; + + /* + ** Dummy for notification. + */ + case MUIA_NListtree_ActiveList: + D(DBF_GETSET, "SET MUIA_NListtree_ActiveList (dummy)"); + break; + + case MUIA_NListtree_AutoVisible: + { + data->AutoVisible = (IPTR)tag->ti_Data; + + D(DBF_GETSET, "SET MUIA_NListtree_AutoVisible: %ld", tag->ti_Data); + } + break; + + case MUIA_NListtree_CloseHook: + { + data->CloseHook = (struct Hook *)tag->ti_Data; + + D(DBF_GETSET, "SET MUIA_NListtree_CloseHook: 0x%08lx", tag->ti_Data); + } + break; + + case MUIA_NListtree_CompareHook: + { + switch( tag->ti_Data ) + { + case MUIV_NListtree_CompareHook_Head: + { + orgHook = &_CompareHook_Head; + D(DBF_GETSET, "SET MUIA_NListtree_CompareHook: MUIV_NListtree_CompareHook_Head"); + } + break; + + case MUIV_NListtree_CompareHook_Tail: + { + orgHook = &_CompareHook_Tail; + D(DBF_GETSET, "SET MUIA_NListtree_CompareHook: MUIV_NListtree_CompareHook_Tail"); + } + break; + + case MUIV_NListtree_CompareHook_LeavesTop: + { + orgHook = &_CompareHook_LeavesTop; + D(DBF_GETSET, "SET MUIA_NListtree_CompareHook: MUIV_NListtree_CompareHook_LeavesTop"); + } + break; + + case MUIV_NListtree_CompareHook_LeavesMixed: + { + orgHook = &_CompareHook_LeavesMixed; + D(DBF_GETSET, "SET MUIA_NListtree_CompareHook: MUIV_NListtree_CompareHook_LeavesMixed"); + } + break; + + case MUIV_NListtree_CompareHook_LeavesBottom: + { + orgHook = &_CompareHook_LeavesBottom; + D(DBF_GETSET, "SET MUIA_NListtree_CompareHook: MUIV_NListtree_CompareHook_LeavesBottom"); + } + break; + + default: + { + intfunc = FALSE; + + data->CompareHook = (struct Hook*)tag->ti_Data; + + D(DBF_GETSET, "SET MUIA_NListtree_CompareHook: 0x%08lx", tag->ti_Data); + } + break; + } + + if(intfunc) + { + /* The flags is quiet sensless because nobody asks for it expect in OM_NEW (which should be rewritten anywhy) */ + data->Flags |= NLTF_INT_COMPAREHOOK; + InitHook(&data->IntCompareHook, *orgHook, data); + data->CompareHook = &data->IntCompareHook; + } + else data->Flags &= ~NLTF_INT_COMPAREHOOK; + } + break; + + case MUIA_NListtree_ConstructHook: + { + /* + ** If old hook is internal, remove complete + ** hook with all memory allocated. + */ + if ( data->ConstructHook ) + { + if ( data->ConstructHook->h_Entry == (HOOKFUNC)_ConstructFunc ) + { + FreeVecPooled( data->MemoryPool, data->ConstructHook ); + data->ConstructHook = NULL; + } + } + + if(tag->ti_Data == (ULONG)MUIV_NListtree_ConstructHook_String) + { + D(DBF_GETSET, "SET MUIA_NListtree_ConstructHook: MUIV_NListtree_ConstructHook_String"); + + if((data->ConstructHook = AllocVecPooled(data->MemoryPool, sizeof(struct Hook)))) + { + data->Flags |= NLTF_INT_CONSTRDESTRHOOK; + + InitHook(data->ConstructHook, _ConstructHook, data); + } + else data->Error = TRUE; + } + else + { + data->ConstructHook = (struct Hook *)tag->ti_Data; + + D(DBF_GETSET, "SET MUIA_NListtree_ConstructHook: 0x%08lx", tag->ti_Data); + } + } + break; + + case MUIA_NListtree_DestructHook: + { + /* + ** If old hook is internal, remove complete + ** hook with all memory allocated. + */ + if ( data->DestructHook ) + { + if ( data->DestructHook->h_Entry == (HOOKFUNC)_DestructFunc ) + { + FreeVecPooled( data->MemoryPool, data->DestructHook ); + data->DestructHook = NULL; + } + } + + if(tag->ti_Data == (ULONG)MUIV_NListtree_DestructHook_String) + { + D(DBF_GETSET, "SET MUIA_NListtree_DestructHook: MUIV_NListtree_DestructHook_String"); + + if((data->DestructHook = AllocVecPooled(data->MemoryPool, sizeof(struct Hook)))) + { + data->Flags |= NLTF_INT_CONSTRDESTRHOOK; + + InitHook(data->DestructHook, _DestructHook, data); + } + else data->Error = TRUE; + } + else + { + data->DestructHook = (struct Hook *)tag->ti_Data; + + D(DBF_GETSET, "SET MUIA_NListtree_DestructHook: 0x%08lx", tag->ti_Data); + } + } + break; + + case MUIA_NListtree_DisplayHook: + { + if(tag->ti_Data != (ULONG)MUIV_NListtree_DisplayHook_Default) + { + data->DisplayHook = (struct Hook *)tag->ti_Data; + } + else + data->DisplayHook = NULL; + + D(DBF_GETSET, "SET MUIA_NListtree_DisplayHook: 0x%08lx", tag->ti_Data); + } + break; + + case MUIA_NListtree_CopyToClipHook: + { + if ( tag->ti_Data == MUIV_NListtree_CopyToClipHook_Default ) + { + D(DBF_GETSET, "SET MUIA_NListtree_CopyToClipHook: MUIV_NListtree_CopyToClipHook_Default"); + + data->CopyToClipHook = NULL; + } + else + { + data->CopyToClipHook = (struct Hook *)tag->ti_Data; + + D(DBF_GETSET, "SET MUIA_NListtree_CopyToClipHook: 0x%08lx", tag->ti_Data); + } + } + break; + + case MUIA_NListtree_DoubleClick: + { + if ( !onlytrigger ) + { + data->DoubleClick = (BYTE)tag->ti_Data; + D(DBF_GETSET, "SET MUIA_NListtree_DoubleClick: 0x%08lx", tag->ti_Data); + } + } + break; + + case MUIA_NListtree_DragDropSort: + { + if ( (BOOL)tag->ti_Data ) + data->Flags |= NLTF_DRAGDROPSORT; + else + data->Flags &= ~NLTF_DRAGDROPSORT; + + D(DBF_GETSET, "SET MUIA_NListtree_DragDropSort: %ld", tag->ti_Data); + } + break; + + case MUIA_NListtree_DupNodeName: + { + if ( (BOOL)tag->ti_Data ) + data->Flags |= NLTF_DUPNODENAMES; + else + data->Flags &= ~NLTF_DUPNODENAMES; + + D(DBF_GETSET, "SET MUIA_NListtree_DupNodeName: %ld", tag->ti_Data); + } + break; + + case MUIA_NListtree_EmptyNodes: + { + if ( (BOOL)tag->ti_Data ) + data->Flags |= NLTF_EMPTYNODES; + else + data->Flags &= ~NLTF_EMPTYNODES; + + if ( !initial ) + DoRefresh( data ); + + D(DBF_GETSET, "SET MUIA_NListtree_EmptyNodes: %ld", tag->ti_Data); + } + break; + + case MUIA_NListtree_FindNameHook: + { + /* + ** If old hook is internal, remove complete + ** hook with all memory allocated. + */ + if ( data->FindNameHook ) + { + FreeVecPooled( data->MemoryPool, data->FindNameHook ); + data->FindNameHook = NULL; + } + + data->FindNameHook = AllocVecPooled( data->MemoryPool, sizeof( struct Hook ) ); + + switch( tag->ti_Data ) + { + case MUIV_NListtree_FindNameHook_CaseSensitive: + { + orgHook = &_FindNameHook_CaseSensitive; + D(DBF_GETSET, "SET MUIA_NListtree_FindNameHook: MUIV_NListtree_FindNameHook_CaseSensitive"); + } + break; + + case MUIV_NListtree_FindNameHook_CaseInsensitive: + { + orgHook = &_FindNameHook_CaseInsensitive; + D(DBF_GETSET, "SET MUIA_NListtree_FindNameHook: MUIV_NListtree_FindNameHook_CaseInsensitive"); + } + break; + + case MUIV_NListtree_FindNameHook_Part: + { + orgHook = &_FindNameHook_Part; + D(DBF_GETSET, "SET MUIA_NListtree_FindNameHook: MUIV_NListtree_FindNameHook_Part"); + } + break; + + case MUIV_NListtree_FindNameHook_PartCaseInsensitive: + { + orgHook = &_FindNameHook_PartCaseInsensitive; + D(DBF_GETSET, "SET MUIA_NListtree_FindNameHook: MUIV_NListtree_FindNameHook_PartCaseInsensitive"); + } + break; + + case MUIV_NListtree_FindNameHook_PointerCompare: + { + orgHook = &_FindNameHook_PointerCompare; + D(DBF_GETSET, "SET MUIA_NListtree_FindNameHook: MUIV_NListtree_FindNameHook_PointerCompare"); + } + break; + + default: + { + intfunc = FALSE; + + CopyMem( (APTR)tag->ti_Data, data->FindNameHook, sizeof( struct Hook ) ); + + D(DBF_GETSET, "SET MUIA_NListtree_FindNameHook: 0x%08lx", tag->ti_Data); + } + break; + } + + if(intfunc) + { + InitHook(data->FindNameHook, *orgHook, data); + } + } + break; + + case MUIA_NListtree_FindUserDataHook: + { + /* + ** If old hook is internal, remove complete + ** hook with all memory allocated. + */ + if ( data->FindUserDataHook ) + { + FreeVecPooled( data->MemoryPool, data->FindUserDataHook ); + data->FindUserDataHook = NULL; + } + + data->FindUserDataHook = AllocVecPooled( data->MemoryPool, sizeof( struct Hook ) ); + + switch( tag->ti_Data ) + { + case MUIV_NListtree_FindUserDataHook_CaseSensitive: + { + orgHook = &_FindUserDataHook_CaseSensitive; + D(DBF_GETSET, "SET MUIA_NListtree_FindUserDataHook: MUIV_NListtree_FindUserDataHook_CaseSensitive"); + } + break; + + case MUIV_NListtree_FindUserDataHook_CaseInsensitive: + { + orgHook = &_FindUserDataHook_CaseInsensitive; + D(DBF_GETSET, "SET MUIA_NListtree_FindUserDataHook: MUIV_NListtree_FindUserDataHook_CaseInsensitive"); + } + break; + + case MUIV_NListtree_FindUserDataHook_Part: + { + orgHook = &_FindUserDataHook_Part; + D(DBF_GETSET, "SET MUIA_NListtree_FindUserDataHook: MUIV_NListtree_FindUserDataHook_Part"); + } + break; + + case MUIV_NListtree_FindUserDataHook_PartCaseInsensitive: + { + orgHook = &_FindUserDataHook_PartCaseInsensitive; + D(DBF_GETSET, "SET MUIA_NListtree_FindUserDataHook: MUIV_NListtree_FindUserDataHook_PartCaseInsensitive"); + } + break; + + case MUIV_NListtree_FindUserDataHook_PointerCompare: + { + orgHook = &_FindUserDataHook_PointerCompare; + D(DBF_GETSET, "SET MUIA_NListtree_FindUserDataHook: MUIV_NListtree_FindUserDataHook_PointerCompare"); + } + break; + + default: + { + intfunc = FALSE; + + CopyMem( (APTR)tag->ti_Data, data->FindUserDataHook, sizeof( struct Hook ) ); + + D(DBF_GETSET, "SET MUIA_NListtree_FindUserDataHook: 0x%08lx", tag->ti_Data); + } + break; + } + + if(intfunc) + { + InitHook(data->FindUserDataHook, *orgHook, data); + } + } + break; + + case MUIA_NListtree_Format: + { + int len; + + /* + ** If old data there, remove it. + */ + if ( data->Format ) + { + FreeVecPooled( data->MemoryPool, data->Format ); + data->Format = NULL; + } + + /* + ** Save raw list format. + */ + len = strlen((STRPTR)tag->ti_Data) + 1; + + if((data->Format = AllocVecPooled( data->MemoryPool, len))) + { + strlcpy( data->Format, (STRPTR)tag->ti_Data, len ); + + if ( !initial ) + nnset( data->Obj, MUIA_NList_Format, data->Format ); + + D(DBF_GETSET, "SET MUIA_NListtree_Format: %s", (STRPTR)tag->ti_Data); + } + } + break; + + case MUIA_NListtree_MultiSelect: + { + data->MultiSelect = (UBYTE)( tag->ti_Data & 0x00ff ); + + /* + if ( tag->ti_Data & MUIV_NListtree_MultiSelect_Flag_AutoSelectChilds ) + data->Flags |= NLTF_AUTOSELECT_CHILDS; + */ + + D(DBF_GETSET, "SET MUIA_NListtree_MultiSelect: 0x%08lx", tag->ti_Data); + } + break; + + case MUIA_NListtree_MultiTestHook: + { + data->MultiTestHook = (struct Hook *)tag->ti_Data; + + D(DBF_GETSET, "SET MUIA_NListtree_MultiTestHook: 0x%08lx", tag->ti_Data); + } + break; + + case MUIA_NListtree_OpenHook: + { + data->OpenHook = (struct Hook *)tag->ti_Data; + + D(DBF_GETSET, "SET MUIA_NListtree_OpenHook: 0x%08lx", tag->ti_Data); + } + break; + + case MUIA_NListtree_Quiet: + { + if ( !DoQuiet( data, (BOOL)tag->ti_Data ) ) + { + if ( data->Flags & NLTF_REFRESH ) + { + if ( data->Flags & NLTF_ISMCP ) + DoRefresh( data ); + + data->Flags &= ~NLTF_REFRESH; + } + } + + D(DBF_GETSET, "SET MUIA_NListtree_Quiet: %ld - Counter = %ld", tag->ti_Data, data->QuietCounter); + } + break; + + case MUICFG_NListtree_RememberStatus: + { + if ( (BOOL)tag->ti_Data ) + data->Flags |= NLTF_REMEMBER_STATUS; + else + data->Flags &= ~NLTF_REMEMBER_STATUS; + + D(DBF_GETSET, "SET MUICFG_NListtree_RememberStatus: %ld", tag->ti_Data); + } + break; + + case MUIA_NListtree_Title: + { + if ( tag->ti_Data ) + data->Flags |= NLTF_TITLE; + else + data->Flags &= ~NLTF_TITLE; + + if ( !initial ) + nnset( data->Obj, MUIA_NList_Title, tag->ti_Data ); + + D(DBF_GETSET, "SET MUIA_NListtree_Title: %ld", tag->ti_Data); + } + break; + + case MUIA_NListtree_TreeColumn: + { + data->TreeColumn = (UWORD)( tag->ti_Data & 0x00ff ); + + if ( !initial ) + DoRefresh( data ); + + D(DBF_GETSET, "SET MUIA_NListtree_TreeColumn: 0x%08lx", tag->ti_Data); + } + break; + + case MUIA_NListtree_ShowTree: + { + if(tag->ti_Data == (ULONG)MUIV_NListtree_ShowTree_Toggle) + { + if ( data->Flags & NLTF_NO_TREE ) + data->Flags &= ~NLTF_NO_TREE; + else + data->Flags |= NLTF_NO_TREE; + } + else if ( !tag->ti_Data ) + data->Flags |= NLTF_NO_TREE; + else + data->Flags &= ~NLTF_NO_TREE; + + if ( !initial ) + DoRefresh( data ); + + D(DBF_GETSET, "SET MUIA_NListtree_ShowTree: 0x%08lx", tag->ti_Data); + } + break; + + case MUIA_NListtree_NoRootTree: + { + /* + ** data->MRI is set in _Setup(). This makes sure, this tag is only + ** used in the initial configuration. + */ + if ( tag->ti_Data && !data->MRI ) + { + data->Flags |= NLTF_NO_ROOT_TREE; + } + } + break; + + default: + D(DBF_GETSET, "SET attribute 0x%08lx to 0x%08lx", tag->ti_Tag, tag->ti_Data); + break; + } + } +} + + +static BOOL GetAttributes( struct NListtree_Data *data, Msg msg) +{ + IPTR *store = ( (struct opGet *)msg)->opg_Storage; + + *store = 0; + + switch( ( (struct opGet *)msg)->opg_AttrID ) + { + case MUIA_Version: + *store = LIB_VERSION; + return( TRUE ); + + case MUIA_Revision: + *store = LIB_REVISION; + return( TRUE ); + + case MUIA_NListtree_Active: + + *store = (IPTR)data->ActiveNode; + D(DBF_GETSET, "GET MUIA_NListtree_Active: 0x%08lx", *store); + return( TRUE ); + + case MUIA_NListtree_ActiveList: + + if ( data->ActiveList == &data->RootList ) + *store = (IPTR)MUIV_NListtree_ActiveList_Off; + else + *store = (IPTR)data->ActiveList; + D(DBF_GETSET, "GET MUIA_NListtree_ActiveList: 0x%08lx",*store); + return( TRUE ); + + case MUIA_NListtree_DoubleClick: + + *store = (IPTR)data->LDClickColumn; + D(DBF_GETSET, "GET MUIA_NListtree_DoubleClick: 0x%08lx", *store); + return( TRUE ); + + case MUIA_NListtree_TreeColumn: + + *store = (IPTR)data->TreeColumn; + D(DBF_GETSET, "GET MUIA_NListtree_TreeColumn: 0x%08lx", *store); + return( TRUE ); + + case MUIA_NListtree_ShowTree: + + *store = (IPTR)!( data->Flags & NLTF_NO_TREE ); + D(DBF_GETSET, "GET MUIA_NListtree_ShowTree: 0x%08lx", *store); + return( TRUE ); + + case MUIA_NListtree_AutoVisible: + + *store = (IPTR)data->AutoVisible; + D(DBF_GETSET, "GET MUIA_NListtree_AutoVisible: 0x%08lx", *store); + return( TRUE ); + + case MUIA_NListtree_DropType: + + *store = (IPTR)data->DropType; + return( TRUE ); + + case MUIA_NListtree_DropTarget: + + *store = (IPTR)data->DropTarget; + return( TRUE ); + + case MUIA_NListtree_DropTargetPos: + + *store = (IPTR)data->DropTargetPos; + return( TRUE ); + + case MUIA_NListtree_SelectChange: + + D(DBF_GETSET, "GET MUIA_NListtree_SelectChange"); + return( TRUE ); + + /* + ** We ignore these tags ;-) + */ + case MUIA_NList_CompareHook: + case MUIA_NList_ConstructHook: + case MUIA_NList_DestructHook: + case MUIA_NList_DisplayHook: + case MUIA_NList_DragSortable: + case MUIA_NList_DropMark: + case MUIA_NList_Format: + case MUIA_NList_MinLineHeight: + case MUIA_NList_MultiTestHook: + case MUIA_NList_Pool: + case MUIA_NList_PoolPuddleSize: + case MUIA_NList_PoolThreshSize: + case MUIA_NList_ShowDropMarks: + case MUIA_NList_SourceArray: + case MUIA_NList_Title: + return( FALSE ); + break; + + default: + D(DBF_GETSET, "GET 0x%08lx", ( (struct opGet *)msg)->opg_AttrID); + break; + } + + return( FALSE ); +} + + + +/*****************************************************************************\ +******************************************************************************* +** +** Standard class related functions. +** +******************************************************************************* +\*****************************************************************************/ + +IPTR _New(struct IClass *cl, Object *obj, struct opSet *msg) +{ + struct NListtree_Data ld; + + memset(&ld, 0, sizeof(struct NListtree_Data)); + + /* + ** Create new memory pool. + */ + #if defined(__amigaos4__) + ld.MemoryPool = AllocSysObjectTags(ASOT_MEMPOOL, ASOPOOL_MFlags, MEMF_SHARED|MEMF_CLEAR, + ASOPOOL_Puddle, 16384, + ASOPOOL_Threshold, 8192, + ASOPOOL_Name, "NListtree.mcc pool", + TAG_DONE); + #else + ld.MemoryPool = CreatePool(MEMF_CLEAR, 16384, 8192); + #endif + if(ld.MemoryPool != NULL) + { + #if defined(__amigaos4__) + ld.TreePool = AllocSysObjectTags(ASOT_MEMPOOL, ASOPOOL_MFlags, MEMF_SHARED|MEMF_CLEAR, + ASOPOOL_Puddle, 16384, + ASOPOOL_Threshold, 4096, + ASOPOOL_Name, "NListtree.mcc tree pool", + TAG_DONE); + #else + ld.TreePool = CreatePool(MEMF_CLEAR, 16384, 4096); + #endif + if(ld.TreePool != NULL) + { + ld.Format = NULL; + ld.ActiveNode = CTN( MUIV_NListtree_Active_Off ); + ld.DoubleClick = MUIV_NListtree_DoubleClick_All; + + + /* + ** Default values!!! + */ + ld.Flags |= NLTF_DUPNODENAMES | NLTF_OPENAUTOSCROLL | NLTF_DRAGDROPSORT; + ld.AutoVisible = MUIV_NListtree_AutoVisible_Normal; + + /* data will be set below because we don't have the correct address yet...somebody really should rewrite this */ + InitHook(&ld.IntCompareHook, _CompareHook_LeavesBottom, NULL); + + ld.Flags |= NLTF_INT_COMPAREHOOK; + + SetAttributes( &ld, msg, TRUE ); + + /* + ** If all hooks successfully installed, set up + ** the class for use. + */ + /* + ** Finally create the superclass. + */ + obj = (Object *)DoSuperNew( cl, obj, + //$$$ MUIA_Listview_Input + MUIA_NList_Input, TRUE, + //$$$ MUIA_Listview_MultiSelect + MUIA_NList_MultiSelect, ld.MultiSelect, + ( ld.MultiSelect != 0 ) ? MUIA_NList_MultiTestHook : TAG_IGNORE, &NList_MultiTestHook, + //$$$ MUIA_Listview_DragType + MUIA_NList_DragType, ( ld.Flags & NLTF_DRAGDROPSORT ) ? MUIV_NList_DragType_Default : MUIV_NList_DragType_None, + MUIA_NList_DragSortable, ( ld.Flags & NLTF_DRAGDROPSORT ) ? TRUE : FALSE, + MUIA_NList_ShowDropMarks, ( ld.Flags & NLTF_DRAGDROPSORT ) ? TRUE : FALSE, + //$$$ Remove + MUIA_NList_EntryValueDependent, TRUE, + ( ld.Flags & NLTF_TITLE ) ? MUIA_NList_Title : TAG_IGNORE, TRUE, + ld.Format ? MUIA_NList_Format : TAG_IGNORE, ld.Format, + //$$$ Not implemented + MUIA_ContextMenu, MUIV_NList_ContextMenu_Always, + TAG_MORE, msg->ops_AttrList ); + + if ( obj ) + { + struct NListtree_Data *data = INST_DATA(cl, obj); + struct Task *mytask; + const char *taskname; + IPTR ver=0, rev=0; + + CopyMem( &ld, data, sizeof( struct NListtree_Data ) ); + + data->IntCompareHook.h_Data = data; /* now we have the correct address of data */ + + if(data->Flags & NLTF_INT_COMPAREHOOK) + data->CompareHook = &data->IntCompareHook; /* and now we also have the correct address of the hook */ + + DoSuperMethod(cl, obj, OM_GET, MUIA_Version, &ver); + DoSuperMethod(cl, obj, OM_GET, MUIA_Revision, &rev); + + D(DBF_ALWAYS, "NList version: %ld.%ld", ver, rev); + + mytask = FindTask( NULL ); + + if ( mytask->tc_Node.ln_Name ) + taskname = mytask->tc_Node.ln_Name; + else + taskname = "MUI Application"; + + if ( ( ver < 20 ) || ( ( ver == 20 ) && ( rev < 130 ) ) ) + { + struct EasyStruct es; + + memset(&es,0,sizeof(es)); + es.es_StructSize = sizeof(struct EasyStruct); + es.es_Title = (STRPTR)"Update information..."; + es.es_TextFormat = (STRPTR)"NListtree.mcc has detected that your version of\n" + "NList.mcc which is used by task `%s'\n" + "is outdated (V%ld.%ld). Please update at least to\n" + "version 20.130, which is available at\n\n" + "http://www.sf.net/projects/nlist-classes\n\n" + "NListtree will terminate now to avoid problems...\n"; + es.es_GadgetFormat = (STRPTR)"Terminate"; + + EasyRequest( NULL, &es, NULL, (IPTR)taskname, ver, rev ); + + //CoerceMethod( cl, obj, OM_DISPOSE ); + return( 0 ); + } + + data->Flags |= NLTF_NLIST_DIRECT_ENTRY_SUPPORT; + + /* + ** Save instance data in private NList data field. + */ + set( obj, MUIA_UserData, data ); + + /* + ** Instance data is now valid. Here we set + ** up the default hooks. + */ + if(!data->FindNameHook) + { + data->FindNameHook = AllocVecPooled( data->MemoryPool, sizeof( struct Hook ) ); + + InitHook(data->FindNameHook, _FindNameHook_CaseInsensitive, data); + } + + if ( !data->FindUserDataHook ) + { + data->FindUserDataHook = AllocVecPooled( data->MemoryPool, sizeof( struct Hook ) ); + + InitHook(data->FindUserDataHook, _FindUserDataHook_CaseInsensitive, data); + } + + data->buf = AllocVecPooled( data->MemoryPool, DATA_BUF_SIZE ); + data->Obj = obj; + + /* + ** Here we initialize the root list and setting + ** some important values to it. + */ + NewList( (struct List *)&data->RootList.ln_List ); + + data->RootList.ln_Parent = NULL; + data->RootList.ln_Flags |= TNF_LIST | TNF_OPEN; + data->RootList.ln_IFlags |= TNIF_VISIBLE | TNIF_ROOT; + + /* + ** Initialize Selected-Table. + */ + data->SelectedTable.tb_Current = -2; + + /* + ** Setup spacial image class and tree image. + */ + if((data->CL_TreeImage = MUI_CreateCustomClass(NULL, (STRPTR)MUIC_Area, NULL, sizeof(struct TreeImage_Data ), ENTRY(TreeImage_Dispatcher)))) + { + if((data->CL_NodeImage = MUI_CreateCustomClass(NULL, (STRPTR)MUIC_Image, NULL, sizeof(struct TreeImage_Data), ENTRY(NodeImage_Dispatcher)))) + { + ActivateNotify( data ); + + return( (IPTR)obj ); + } + } + } + } + } + + CoerceMethod( cl, obj, OM_DISPOSE ); + + return( 0 ); +} + + +IPTR _Dispose(struct IClass *cl, Object *obj, Msg msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + ULONG ret; + struct MUI_CustomClass *im1, *im2; + APTR mempool, treepool; + + ENTER(); + + DeactivateNotify( data ); + + /* + ** Clear complete list without setting a new active entry. + */ + DoMethod( obj, MUIM_NListtree_Clear, NULL, 0 ); + + im1 = data->CL_TreeImage; + im2 = data->CL_NodeImage; + mempool = data->MemoryPool; + treepool = data->TreePool; + + ret = DoSuperMethodA(cl, obj, msg); + + if(treepool != NULL) + { + #if defined(__amigaos4__) + FreeSysObject(ASOT_MEMPOOL, treepool); + #else + DeletePool(treepool); + #endif + } + + if(mempool != NULL) + { + #if defined(__amigaos4__) + FreeSysObject(ASOT_MEMPOOL, mempool); + #else + DeletePool(mempool); + #endif + } + + /* + ** Delete special image classes. + */ + if ( im1 ) + MUI_DeleteCustomClass( im1 ); + + if ( im2 ) + MUI_DeleteCustomClass( im2 ); + + RETURN(ret); + return( ret ); +} + + + +IPTR _Set(struct IClass *cl, Object *obj, struct opSet *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + + SetAttributes(data, msg, FALSE); + + return DoSuperMethodA(cl, obj, (Msg)msg); +} + + +IPTR _Get(struct IClass *cl, Object *obj, Msg msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + + if(GetAttributes(data, msg) == TRUE) + return TRUE; + + return DoSuperMethodA(cl, obj, msg); +} + + +IPTR _Setup(struct IClass *cl, Object *obj, struct MUIP_Setup *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + Object *pdobj, *idobj; + SIPTR d; + BOOL x; + + ENTER(); + + if(!(DoSuperMethodA(cl, obj, (Msg)msg))) + { + RETURN(FALSE); + return FALSE; + } + + D(DBF_SETUP, "Before: cl_SubclassCount = %ld, cl_ObjectCount = %ld", cl->cl_SubclassCount, cl->cl_ObjectCount); + + /* + ** Obtain pens (render info is valid after Setup()! + */ + data->MRI = msg->RenderInfo; + + + /* + ** These values are used for drawing the lines. + */ + data->Image[IMAGE_Tree].nltdata = data; + data->Image[IMAGE_Tree].Image = NewObject( data->CL_TreeImage->mcc_Class, NULL, MUIA_FillArea, FALSE, + MUIA_Frame, MUIV_Frame_None, + MUIA_UserData, &data->Image[IMAGE_Tree], + MUIA_InnerBottom, 0, + MUIA_InnerLeft, 0, + MUIA_InnerRight, 0, + MUIA_InnerTop, 0, + MUIA_Weight, 0, + TAG_DONE); + data->Image[IMAGE_Tree].ListImage = (Object *)DoMethod( obj, MUIM_NList_CreateImage, data->Image[IMAGE_Tree].Image, 0L ); + + data->compositingActive = 0; + #if defined(__amigaos4__) + // check whether compositing is enabled on our screen + GetScreenAttrs(_screen(obj), SA_Compositing, &data->compositingActive, TAG_DONE); + #endif + + /* + ** Get and set image config. + */ + if ( !( data->Flags & NLTF_ISMCP ) ) + { + /* + ** Set up temporary objects. + */ + pdobj = MUI_NewObject( MUIC_Pendisplay, TAG_DONE ); + idobj = MUI_NewObject( MUIC_Imagedisplay, TAG_DONE ); + + + if ( DoMethod( obj, MUIM_GetConfigItem, MUICFG_NListtree_ImageSpecClosed, &d ) ) + { + SetupImage( data, (struct MUI_ImageSpec *)d, IMAGE_Closed ); + + D(DBF_SETUP, "C-Closed node image: '%s'", (STRPTR)d); + } + else if ( idobj ) + { + set( idobj, MUIA_Imagedisplay_Spec, MUICFGV_NListtree_ImageSpecClosed_Default ); + d = xget( idobj, MUIA_Imagedisplay_Spec ); + + SetupImage( data, (struct MUI_ImageSpec *)d, IMAGE_Closed ); + + D(DBF_SETUP, "Closed node image: '%s'", (STRPTR)d); + } + + + if ( DoMethod( obj, MUIM_GetConfigItem, MUICFG_NListtree_ImageSpecOpen, &d ) ) + { + SetupImage( data, (struct MUI_ImageSpec *)d, IMAGE_Open ); + + D(DBF_SETUP, "C-Open node image: '%s'", (STRPTR)d); + } + else if ( idobj ) + { + set( idobj, MUIA_Imagedisplay_Spec, MUICFGV_NListtree_ImageSpecOpen_Default ); + d = xget( idobj, MUIA_Imagedisplay_Spec ); + + SetupImage( data, (struct MUI_ImageSpec *)d, IMAGE_Open ); + + D(DBF_SETUP, "Open node image: '%s'", (STRPTR)d); + } + + + if ( DoMethod( obj, MUIM_GetConfigItem, MUICFG_NListtree_ImageSpecFolder, &d ) ) + { + SetupImage( data, (struct MUI_ImageSpec *)d, IMAGE_Folder ); + + D(DBF_SETUP, "C-Folder image: '%s'", (STRPTR)d); + } + else if ( idobj ) + { + set( idobj, MUIA_Imagedisplay_Spec, MUICFGV_NListtree_ImageSpecFolder_Default ); + d = xget( idobj, MUIA_Imagedisplay_Spec ); + + SetupImage( data, (struct MUI_ImageSpec *)d, IMAGE_Folder ); + + D(DBF_SETUP, "Folder image: '%s'", (STRPTR)d); + } + + /* + ** Get and set line, shadow and draw pens + */ + if ( DoMethod( obj, MUIM_GetConfigItem, MUICFG_NListtree_PenSpecLines, &d ) ) + ObtPen( data->MRI, &data->Pen[PEN_Line], (struct MUI_PenSpec *)d ); + else if( pdobj ) + { + DoMethod( pdobj, MUIM_Pendisplay_SetMUIPen, MUICFGV_NListtree_PenSpecLines_Default ); + ObtPen( data->MRI, &data->Pen[PEN_Line], (struct MUI_PenSpec *)xget( pdobj, MUIA_Pendisplay_Spec ) ); + } + + + if ( DoMethod( obj, MUIM_GetConfigItem, MUICFG_NListtree_PenSpecShadow, &d ) ) + ObtPen( data->MRI, &data->Pen[PEN_Shadow], (struct MUI_PenSpec *)d ); + else if( pdobj ) + { + DoMethod( pdobj, MUIM_Pendisplay_SetMUIPen, MUICFGV_NListtree_PenSpecShadow_Default ); + ObtPen( data->MRI, &data->Pen[PEN_Shadow], (struct MUI_PenSpec *)xget( pdobj, MUIA_Pendisplay_Spec ) ); + } + + + if ( DoMethod( obj, MUIM_GetConfigItem, MUICFG_NListtree_PenSpecGlow, &d ) ) + ObtPen( data->MRI, &data->Pen[PEN_Glow], (struct MUI_PenSpec *)d ); + else if( pdobj ) + { + DoMethod( pdobj, MUIM_Pendisplay_SetMUIPen, MUICFGV_NListtree_PenSpecGlow_Default ); + ObtPen( data->MRI, &data->Pen[PEN_Glow], (struct MUI_PenSpec *)xget( pdobj, MUIA_Pendisplay_Spec ) ); + } + + + /* + ** Set values + */ + if ( DoMethod( obj, MUIM_GetConfigItem, MUICFG_NListtree_LineType, &d ) ) + data->LineType = atoi( (STRPTR)d ); + else + data->LineType = MUICFGV_NListtree_LineType_Default; + + + if ( DoMethod( obj, MUIM_GetConfigItem, MUICFG_NListtree_IndentWidth, &d ) ) + data->IndentWidth = atoi( (STRPTR)d ); + else + data->IndentWidth = MUICFGV_NListtree_IndentWidth_Default; + + if ( DoMethod( obj, MUIM_GetConfigItem, MUICFG_NListtree_RememberStatus, &d ) ) + x = atoi( (STRPTR)d ); + else + x = MUICFGV_NListtree_RememberStatus_Default; + + if ( x ) + data->Flags |= NLTF_REMEMBER_STATUS; + else + data->Flags &= ~NLTF_REMEMBER_STATUS; + + + if ( DoMethod( obj, MUIM_GetConfigItem, MUICFG_NListtree_OpenAutoScroll, &d ) ) + x = atoi( (STRPTR)d ); + else + x = MUICFGV_NListtree_OpenAutoScroll_Default; + + if ( x ) + data->Flags |= NLTF_OPENAUTOSCROLL; + else + data->Flags &= ~NLTF_OPENAUTOSCROLL; + + if ( DoMethod( obj, MUIM_GetConfigItem, MUICFG_NListtree_UseFolderImage, &d ) ) + data->UseFolderImage = atoi( (STRPTR)d ); + else + data->UseFolderImage = MUICFGV_NListtree_UseFolderImage_Default; + + + /* + ** Dispose temporary created objects. + */ + if( pdobj ) + MUI_DisposeObject( pdobj ); + + if ( idobj ) + MUI_DisposeObject( idobj ); + } + + + D(DBF_SETUP, "After: cl_SubclassCount = %ld, cl_ObjectCount = %ld", cl->cl_SubclassCount, cl->cl_ObjectCount); + + DoRefresh( data ); + + RETURN(TRUE); + return TRUE; +} + + +IPTR _Cleanup(struct IClass *cl, Object *obj, Msg msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + UBYTE i; + + D(DBF_SETUP, "Before: cl_SubclassCount = %ld, cl_ObjectCount = %ld", cl->cl_SubclassCount, cl->cl_ObjectCount); + + /* + ** Dispose images. + */ + for( i = 0; i < 4; i++ ) + DisposeImage( data, i ); + + RelPen( data->MRI, &data->Pen[PEN_Line] ); + RelPen( data->MRI, &data->Pen[PEN_Shadow] ); + RelPen( data->MRI, &data->Pen[PEN_Glow] ); + + data->MRI = NULL; + + D(DBF_SETUP, "After: cl_SubclassCount = %ld, cl_ObjectCount = %ld", cl->cl_SubclassCount, cl->cl_ObjectCount); + + return( DoSuperMethodA( cl, obj, msg) ); +} + + +IPTR _Show(struct IClass *cl, Object *obj, Msg msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + + if (!DoSuperMethodA( cl, obj, (Msg)msg)) + return 0; + + data->EHNode.ehn_Priority = 2; + data->EHNode.ehn_Flags = 0; + data->EHNode.ehn_Object = obj; + data->EHNode.ehn_Class = cl; + data->EHNode.ehn_Events = IDCMP_MOUSEBUTTONS | IDCMP_RAWKEY; + DoMethod( _win( obj ), MUIM_Window_AddEventHandler, &data->EHNode ); + //ActivateNotify( data ); + + return 1; +} + + +IPTR _Hide(struct IClass *cl, Object *obj, Msg msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + + DoMethod( _win( obj ), MUIM_Window_RemEventHandler, &data->EHNode ); + //DeactivateNotify( data ); + return DoSuperMethodA(cl, obj, msg); +} + + +IPTR _AskMinMax(struct IClass *cl, Object *obj, struct MUIP_AskMinMax *msg) +{ + DoSuperMethodA( cl, obj, (Msg)msg); + + msg->MinMaxInfo->MinWidth += 20; + msg->MinMaxInfo->DefWidth += 50; + msg->MinMaxInfo->MaxWidth += MUI_MAXMAX; + + msg->MinMaxInfo->MinHeight += 20; + msg->MinMaxInfo->DefHeight += 50; + msg->MinMaxInfo->MaxHeight += MUI_MAXMAX; + + return( 0 ); +} + + + +IPTR _Draw(struct IClass *cl, Object *obj, struct MUIP_Draw *msg) +{ + return( DoSuperMethodA( cl, obj, (Msg)msg) ); +} + + +IPTR _HandleEvent(struct IClass *cl, Object *obj, struct MUIP_HandleEvent *msg) +{ + #define _between( a, x, b ) ( ( x ) >= ( a ) && ( x ) <= ( b ) ) + #define _isinobject( x, y ) ( _between( _mleft( obj ), ( x ), _mright( obj ) ) && _between( _mtop( obj ), ( y ), _mbottom( obj ) ) ) + struct NListtree_Data *data = INST_DATA(cl, obj); + IPTR ret = 0; + + if ( msg->muikey ) + { + struct MUI_NListtree_TreeNode *tn; + + switch ( msg->muikey ) + { + case MUIKEY_LEFT: + { + BOOL changed = FALSE; + + if ( data->ActiveNode ) + { + if ( ( data->ActiveNode->tn_Flags & TNF_LIST ) && ( data->ActiveNode->tn_Flags & TNF_OPEN ) ) + { + DoMethod( obj, MUIM_NListtree_Close, MUIV_NListtree_Close_ListNode_Active, MUIV_NListtree_Close_TreeNode_Active, 0 ); + changed = TRUE; + } + else if ( (IPTR)GetParent( data->ActiveNode ) != (IPTR)&data->RootList ) + { + set( obj, MUIA_NListtree_Active, GetParent( data->ActiveNode ) ); + changed = TRUE; + } + } + else + { + set( obj, MUIA_NListtree_Active, MUIV_NListtree_Active_LastVisible ); + changed = TRUE; + } + + if(changed) + ret = MUI_EventHandlerRC_Eat; + } + break; + + case MUIKEY_RIGHT: + { + BOOL changed = FALSE; + + if ( data->ActiveNode ) + { + if ( data->ActiveNode->tn_Flags & TNF_LIST ) + { + if ( !( data->ActiveNode->tn_Flags & TNF_OPEN ) ) + { + DoMethod( obj, MUIM_NListtree_Open, MUIV_NListtree_Open_ListNode_Active, MUIV_NListtree_Open_TreeNode_Active, 0 ); + changed = TRUE; + } + else if((tn = CTN(DoMethod(obj, MUIM_NListtree_GetEntry, data->ActiveNode, MUIV_NListtree_GetEntry_Position_Head, 0)))) + { + if(xget(obj, MUIA_NListtree_Active) != (IPTR)tn) + { + set( obj, MUIA_NListtree_Active, tn ); + changed = TRUE; + } + } + } + } + else + { + set( obj, MUIA_NListtree_Active, MUIV_NListtree_Active_FirstVisible ); + changed = TRUE; + } + + if(changed) + ret = MUI_EventHandlerRC_Eat; + } + break; + + case MUIKEY_UP: + break; + + case MUIKEY_DOWN: + break; + + case MUIKEY_TOGGLE: + break; + } + } + + if ( msg->imsg) + { + WORD mx, my; + + + /* + ** We make this here, because the first act + ** in the list tree may be selection. + */ + if ( msg->imsg->Qualifier & IEQUALIFIER_LSHIFT ) + { + data->Flags |= NLTF_QUALIFIER_LSHIFT; + } + else + { + data->Flags &= ~NLTF_QUALIFIER_LSHIFT; + } + + if ( msg->imsg->Qualifier & IEQUALIFIER_CONTROL ) + { + data->Flags |= NLTF_QUALIFIER_CONTROL; + } + else + { + data->Flags &= ~NLTF_QUALIFIER_CONTROL; + } + + mx = msg->imsg->MouseX; + my = msg->imsg->MouseY; + + switch ( msg->imsg->Class ) + { + case IDCMP_MOUSEBUTTONS: + { + D(DBF_INPUT, "mousebutton"); + if ( _isinobject( mx, my ) ) + { + struct MUI_NListtree_TreeNode *tn; + struct MUI_NList_TestPos_Result tpres; + + D(DBF_INPUT, "inobject"); + + switch( msg->imsg->Code ) + { + case SELECTDOWN: + + /* + ** Get pointer to the selected node. + ** Set active node and list in global + ** data structure. + */ + DoMethod( obj, MUIM_NList_TestPos, mx, my, &tpres ); + + if ( tpres.entry != -1 ) + { + /* + ** When user changed the column positions, + ** we use this to avoid trouble. + */ + //$$$ Remove is List used + tpres.column = DoMethod( obj, MUIM_NList_ColumnToCol, tpres.column ); + + DoMethod( obj, MUIM_NList_GetEntry, tpres.entry, &tn ); + + /* + ** Only react if node is not frozen. + */ + if ( !( tn->tn_Flags & TNF_FROZEN ) ) + { + STATIC UWORD lastclickentry = 0; + + /* + ** If node is a list entry, open or close the node + ** by simple click on the image depending on the + ** current state. + */ + if ( ( tn->tn_Flags & TNF_LIST ) && ( tpres.column == data->TreeColumn ) && + ( ( tpres.xoffset >= tn->tn_ImagePos ) && ( tpres.xoffset <= ( tn->tn_ImagePos + data->MaxImageWidth ) ) ) ) + { + /* + ** Do not start dragging if user clicked on arrow-image. + */ + //data->Flags |= NLTF_OVER_ARROW; + //D(bug( "SETTING OVER_ARROW FLAG\n" ) ); + + data->OpenCloseEntry = tn; + + /* + ** NList should do nothing in case of arrow-click + ** with LSHIFT qualifier.. + */ + if ( data->Flags & NLTF_QUALIFIER_LSHIFT ) + ret = MUI_EventHandlerRC_Eat; + } + + /* + ** We get the click time out of the intuimessage + ** If double click, reset time values, if not, set values to current time. + */ + if(DoubleClick(data->LDClickTimeSecs, data->LDClickTimeMicros, msg->imsg->Seconds, msg->imsg->Micros) && + (tpres.entry == lastclickentry)) + { + /* + ** Do not start dragging if user double clicked on an entry. + */ + //data->Flags |= NLTF_OVER_ARROW; + //D(bug( "SETTING OVER_ARROW FLAG\n" ) ); + + /* + ** Double clicked!! Check what we have to do... + */ + if ( ( data->DoubleClick != MUIV_NListtree_DoubleClick_Off ) && ( data->DoubleClick != MUIV_NListtree_DoubleClick_NoTrigger ) ) + { + //D(bug( "DoubleClick: %ld, TreeColumn: %ld, tpres.column: %ld\n", data->DoubleClick, data->TreeColumn, tpres.column ) ); + + if ( ( ( data->DoubleClick == MUIV_NListtree_DoubleClick_Tree ) && ( tpres.column == data->TreeColumn ) ) || + ( data->DoubleClick == MUIV_NListtree_DoubleClick_All ) ) + { + data->OpenCloseEntry = tn; + + data->LDClickEntry = tpres.entry; + data->LDClickColumn = tpres.column; + + //D(bug( "Double click detected on node 0x%08lx\n", tn ) ); + } + } + else + { + data->LDClickEntry = -1; + data->LDClickColumn = -1; + } + + data->LDClickTimeSecs = 0; + data->LDClickTimeMicros = 0; + } + else + { + data->LDClickTimeSecs = msg->imsg->Seconds; + data->LDClickTimeMicros = msg->imsg->Micros; + } + + lastclickentry = tpres.entry; + } + } + break; + + + case SELECTUP: + + /* + ** Get pointer to the selected node. + ** Set active node and list in global + ** data structure. + */ + DoMethod( obj, MUIM_NList_TestPos, mx, my, &tpres ); + + if ( tpres.entry != -1 ) + { + /* + ** When user changed the column positions, + ** we use this to avoid trouble. + */ + //$$$ Remove + tpres.column = DoMethod( obj, MUIM_NList_ColumnToCol, tpres.column ); + + DoMethod( obj, MUIM_NList_GetEntry, tpres.entry, &tn ); + + D(DBF_INPUT, "Clicked on xoffset = %ld, col: %ld, impos = %ld, arrowwidth = %ld", tpres.xoffset, tpres.column, tn->tn_ImagePos, data->MaxImageWidth); + + if ( data->OpenCloseEntry ) + { + if ( data->OpenCloseEntry->tn_Flags & TNF_OPEN ) + DoMethod( obj, MUIM_NListtree_Close, GetParent( data->OpenCloseEntry ), data->OpenCloseEntry, 0 ); + else + DoMethod( obj, MUIM_NListtree_Open, GetParent( data->OpenCloseEntry ), data->OpenCloseEntry, 0 ); + + data->OpenCloseEntry = NULL; + } + } + + /* + ** Delete over arrow flag when releasing mouse button. + */ + //data->Flags &= ~NLTF_OVER_ARROW; + //D(bug( "RESETTING OVER_ARROW FLAG\n" ) ); + break; + + + /* + case MIDDLEDOWN: + { + struct MUI_NList_TestPos_Result tpres; + struct TimeVal tv; + + DoMethod( obj, MUIM_NList_TestPos, mx, my, &tpres ); + + if ( tpres.entry != -1 ) + { + struct MUI_NListtree_TreeNode *tn; + + DoMethod( obj, MUIM_NList_GetEntry, tpres.entry, &tn ); + + CurrentTime( &tv.Seconds, &tv.Microseconds ); + + if ( DoubleClick( data->MDClickTime.Seconds, data->MDClickTime.Microseconds, tv.Seconds, tv.Microseconds ) && + ( tpres.entry == data->MDClickEntry ) ) + { + data->MDClickTime.Seconds = 0; + data->MDClickTime.Microseconds = 0; + data->MDClickEntry = -1; + data->MDClickColumn = -1; + } + else + { + data->MDClickTime.Seconds = tv.Seconds; + data->MDClickTime.Microseconds = tv.Microseconds; + data->MDClickEntry = tpres.entry; + data->MDClickColumn = tpres.column; + } + } + } + break; + + case MIDDLEUP: + break; + */ + } + } + } + break; + + case IDCMP_MOUSEMOVE: + { + if ( _isinobject( mx, my ) ) + { + } + } + break; + } + } + + #if !defined(__amigaos4__) && !defined(__MORPHOS__) && !defined(__AROS__) + // with MUI 3.8 the superclass get this method, hence we must forward it ourself. + if(ret != MUI_EventHandlerRC_Eat && MUIMasterBase != NULL && MUIMasterBase->lib_Version <= 19) + ret = DoSuperMethodA(cl, obj, (Msg)msg); + #endif + + return( ret ); +} + + + + +IPTR _DragNDrop_DragQuery(struct IClass *cl, Object *obj, Msg msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUIP_DragQuery *d = (struct MUIP_DragQuery *)msg; + ULONG result; + + ENTER(); + + if(d->obj == obj) + { + //if(isFlagSet(data->Flags, NLTF_DRAGDROPSORT) && isFlagClear(data->Flags, NLTF_OVER_ARROW)) + if(isFlagSet(data->Flags, NLTF_DRAGDROPSORT)) + { + RETURN(MUIV_DragQuery_Accept); + return MUIV_DragQuery_Accept; + } + else + { + RETURN(MUIV_DragQuery_Refuse); + return MUIV_DragQuery_Refuse; + } + } + + result = DoSuperMethodA(cl, obj, msg); + + RETURN(result); + return result; +} + + +IPTR _DragNDrop_DragBegin(struct IClass *cl, Object *obj, Msg msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + IPTR result; + + ENTER(); + + /* + ** If active entry is the only selected one, use it + ** for drag&drop. + */ + /* + if ( !data->SelectedTable.tb_Entries ) + { + data->TempSelected = TreeNodeSelectAdd( data, data->ActiveNode ); + } + */ + + data->Flags |= NLTF_DRAGDROP; + data->OldDropTarget = NULL; + + result = DoSuperMethodA(cl, obj, msg); + + RETURN(result); + return result; +} + + +#ifndef _between +#define _between(a, x, b) ((x) >= (a) && (x) <= (b)) +#endif +#ifndef _isinobject +#define _isinobject(x, y) (_between(_mleft(obj), (x), _mright(obj)) && _between(_mtop(obj), (y), _mbottom(obj))) +#endif +IPTR _DragNDrop_DragReport(struct IClass *cl, Object *obj, Msg msg) +{ + struct MUIP_DragReport *d = (struct MUIP_DragReport *)msg; + IPTR result; + + ENTER(); + + if(_isinobject(d->x, d->y)) + result = DoSuperMethodA(cl, obj, msg); + else + result = MUIV_DragReport_Abort; + + RETURN(result); + return result; +} + + +IPTR _DragNDrop_DropType(struct IClass *cl, Object *obj, struct MUIP_NList_DropType *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + + ENTER(); + + DoMethod(obj, MUIM_NList_GetEntry, *msg->pos, &data->DropTarget); + + data->DropTargetPos = *msg->pos; + + if(IsXChildOfListMember(data->DropTarget, &data->SelectedTable) == NULL) + { + if(msg->mousey <= msg->miny + 2) + { + *msg->type = MUIV_NListtree_DropType_Above; + } + else if(msg->mousey >= msg->maxy - 2) + { + *msg->type = MUIV_NListtree_DropType_Below; + *msg->pos -= 1; + } + else + { + *msg->type = MUIV_NListtree_DropType_Onto; + } + } + else + { + *msg->type = MUIV_NListtree_DropType_None; + } + + if(*msg->type == MUIV_NListtree_DropType_Onto && isFlagSet(data->DropTarget->tn_Flags, TNF_LIST)) + data->DropType = MUIV_NListtree_DropType_Sorted; + else + data->DropType = *msg->type; + + DoMethod(obj, MUIM_NListtree_DropType, &data->DropTargetPos, &data->DropType, msg->minx, msg->maxx, msg->miny, msg->maxy, msg->mousex, msg->mousey); + + if(*msg->type == MUIV_NListtree_DropType_Below && data->DropType != MUIV_NListtree_DropType_Below) + *msg->pos += 1; + + if(data->DropType == MUIV_NListtree_DropType_Sorted) + *msg->type = MUIV_NListtree_DropType_Onto; + else + *msg->type = data->DropType; + + D(DBF_DRAGDROP, "OPos: %ld, OType: %ld, Pos: %ld, Type: %ld", *msg->pos, *msg->type, data->DropTargetPos, data->DropType); + + if(isFlagSet(data->DropTarget->tn_Flags, TNF_LIST) && isFlagClear(data->DropTarget->tn_Flags, TNF_OPEN) && *msg->type == MUIV_NListtree_DropType_Onto) + { + // Make sure the screen is currently not locked because of the current DnD action. + // Opening the node now might lead to a deadlock, because the redraw might require + // another lock. However, OS4's MUI is able to perform lockless DnD actions on true + // color screens. + if(data->compositingActive != 0 && _screen(obj)->LayerInfo.Lock.ss_Owner == NULL) + { + // the current possible drop target is a closed list node + if(data->OldDropTarget != data->DropTarget) + { + D(DBF_DRAGDROP, "drop target changed, old='%s', new='%s'", data->OldDropTarget != NULL ? data->OldDropTarget->tn_Name : (STRPTR)"NULL", data->DropTarget ? data->DropTarget->tn_Name : (STRPTR)"NULL"); + // the possible drop target node has changed + // remember the current time + CurrentTime(&data->OpenDropListSecs, &data->OpenDropListMicros); + } + else + { + // no target change and we can drop something on the node + // now check if the desired delay has passed + ULONG secs; + ULONG micros; + ULONG diffSecs; + + // get the current system time + CurrentTime(&secs, µs); + // calculate the difference to the last time + diffSecs = secs - data->OpenDropListSecs; + if(micros < data->OpenDropListMicros) + { + diffSecs--; + } + + // open the node if the user held the mouse for at least one second + // over the closed node + if(diffSecs >= 1) + { + D(DBF_DRAGDROP, "drop target same since one second '%s'", data->DropTarget ? data->DropTarget->tn_Name : (STRPTR)"NULL"); + // the time has passed, now open the list node + DoMethod(obj, MUIM_NListtree_Open, GetParent(data->DropTarget), data->DropTarget, 0); + // reset the start time + data->OpenDropListSecs = secs; + data->OpenDropListMicros = micros; + } + } + } + } + + data->OldDropTarget = data->DropTarget; + + LEAVE(); + return 0; +} + + +IPTR _DragNDrop_NDropDraw(struct IClass *cl, Object *obj, struct MUIP_NListtree_DropDraw *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct RastPort *rp = _rp( obj ); + ULONG apen, bpen; + UWORD *pens = _pens( obj ); + + /* + D(DBF_DRAGDROP, "OPos: %ld, OType: %ld, Pos: %ld, Type: %ld", msg->pos, msg->type, + data->DropTargetPos, data->DropType); + */ + + apen = GetAPen( rp ); + bpen = GetBPen( rp ); + + MySetABPenDrMd( rp, pens[MPEN_SHINE], pens[MPEN_SHADOW], JAM1 ); + SetDrPt( rp, 0xF0F0 ); + + switch ( data->DropType ) + { + case MUIV_NListtree_DropType_Above: + + Move( rp, msg->MinX, msg->MinY ); + Draw( rp, msg->MaxX, msg->MinY ); + + MySetABPenDrMd( rp, MUIPEN( data->Pen[PEN_Shadow] ), MUIPEN( data->Pen[PEN_Shadow] ), JAM1 ); + SetDrPt( rp, 0x0F0F ); + + Move( rp, msg->MinX, msg->MinY ); + Draw( rp, msg->MaxX, msg->MinY ); + + break; + + case MUIV_NListtree_DropType_Below: + Move( rp, msg->MinX, msg->MaxY ); + Draw( rp, msg->MaxX, msg->MaxY ); + + Move( rp, msg->MinX, msg->MaxY ); + Draw( rp, msg->MaxX, msg->MaxY ); + + MySetABPenDrMd( rp, MUIPEN( data->Pen[PEN_Shadow] ), MUIPEN( data->Pen[PEN_Shadow] ), JAM1 ); + SetDrPt( rp, 0x0F0F ); + + Move( rp, msg->MinX, msg->MaxY ); + Draw( rp, msg->MaxX, msg->MaxY ); + + Move( rp, msg->MinX, msg->MaxY ); + Draw( rp, msg->MaxX, msg->MaxY ); + break; + + case MUIV_NListtree_DropType_Onto: + case MUIV_NListtree_DropType_Sorted: + Move( rp, msg->MinX, msg->MinY + 1 ); + Draw( rp, msg->MaxX, msg->MinY + 1 ); + + Move( rp, msg->MinX, msg->MaxY - 1 ); + Draw( rp, msg->MaxX, msg->MaxY - 1 ); + + MySetABPenDrMd( rp, MUIPEN( data->Pen[PEN_Shadow] ), MUIPEN( data->Pen[PEN_Shadow] ), JAM1 ); + SetDrPt( rp, 0x0F0F ); + + Move( rp, msg->MinX, msg->MinY + 1 ); + Draw( rp, msg->MaxX, msg->MinY + 1 ); + + Move( rp, msg->MinX, msg->MaxY - 1 ); + Draw( rp, msg->MaxX, msg->MaxY - 1 ); + break; + } + + SetDrPt( rp, (UWORD)~0 ); + MySetABPenDrMd( rp, apen, bpen, JAM1 ); + + return( 0 ); +} + + +//$$$ +IPTR _DragNDrop_DropDraw(struct IClass *cl, Object *obj, struct MUIP_NList_DropDraw *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_TreeNode *drawtarget; + + D(DBF_DRAGDROP, "DropType: %ld, DropPos: %ld", msg->type, msg->pos); + + DoMethod( obj, MUIM_NList_GetEntry, msg->pos, &drawtarget ); + + DoMethod( obj, MUIM_NListtree_DropDraw, data->DropTargetPos, data->DropType, msg->minx + drawtarget->tn_ImagePos, msg->maxx, msg->miny, msg->maxy ); + + return( 0 ); +} + + +IPTR _DragNDrop_DragFinish(struct IClass *cl, Object *obj, Msg msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + IPTR result; + + ENTER(); + + data->Flags &= ~NLTF_DRAGDROP; + + result = DoSuperMethodA(cl, obj, msg); + + RETURN(result); + return result; +} + + +IPTR _DragNDrop_DragDrop(struct IClass *cl, Object *obj, UNUSED Msg msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_TreeNode *tn, *tn2, *dtn, *nexttn = NULL; + struct MUI_NListtree_ListNode *ln = NULL; + + dtn = data->DropTarget; + + D(DBF_DRAGDROP, "MUIM_DragDrop"); + + if ( data->SelectedTable.tb_Entries > 0 ) + { + struct MUI_NListtree_TreeNode *rettn; + + DoQuiet( data, TRUE ); + DeactivateNotify( data ); + data->IgnoreSelectionChange = 1; + + tn = (struct MUI_NListtree_TreeNode *)MUIV_NListtree_NextSelected_Start; + + for (;;) + { + DoMethod( obj, MUIM_NListtree_NextSelected, &tn ); + + if ( (IPTR)tn == (IPTR)MUIV_NListtree_NextSelected_End ) + break; + + if((rettn = IsXChildOfListMemberNotSelf(tn, &data->SelectedTable))) + { + D(DBF_DRAGDROP, "Entry 0x%08lx - %s already inserted through node 0x%08lx - %s", tn, tn->tn_Name, rettn, rettn->tn_Name); + } + else + { + switch( data->DropType ) + { + case MUIV_NListtree_DropType_Above: + D(DBF_DRAGDROP, "Inserting entry 0x%08lx - %s above L: %s, N: %s", tn, tn->tn_Name, dtn->tn_Parent->tn_Name, dtn->tn_Name); + + ln = CLN( GetParent( dtn ) ); + + if ( !( tn2 = CTN( GetPred( (struct Node *)&dtn->tn_Node ) ) ) ) + tn2 = CTN( MUIV_NListtree_Move_NewTreeNode_Head ); + + DoMethod( obj, MUIM_NListtree_Move, GetParent( tn ), tn, ln, tn2, 0 ); + + break; + + + case MUIV_NListtree_DropType_Below: + D(DBF_DRAGDROP, "Inserting entry 0x%08lx below L: 0x%lx, N: 0x%lx", tn, dtn->tn_Parent, dtn); + + if ( !nexttn ) + { + if ( ( dtn->tn_Flags & TNF_LIST ) && ( dtn->tn_Flags & TNF_OPEN ) ) + { + ln = CLN( dtn ); + tn2 = MUIV_NListtree_Move_NewTreeNode_Head; + } + else + { + ln = CLN( GetParent( dtn ) ); + tn2 = dtn; + } + } + else + { + tn2 = nexttn; + } + + DoMethod( obj, MUIM_NListtree_Move, GetParent( tn ), tn, ln, tn2, 0 ); + + break; + + + case MUIV_NListtree_DropType_Onto: + case MUIV_NListtree_DropType_Sorted: + D(DBF_DRAGDROP, "Inserting entry 0x%08lx onto L: 0x%lx, N: 0x%lx", tn, dtn->tn_Parent, dtn); + + if ( dtn->tn_Flags & TNF_LIST ) + ln = CLN( dtn ); + else + ln = CLN( GetParent( dtn ) ); + + + if ( data->SelectedTable.tb_Entries == 1 ) + { + if ( !( dtn->tn_Flags & TNF_LIST ) && !( tn->tn_Flags & TNF_LIST ) ) + { + tn2 = dtn; + + DoMethod( obj, MUIM_NListtree_Exchange, GetParent( tn ), tn, + ln, tn2, 0 ); + } + } + + if ( dtn->tn_Flags & TNF_LIST ) + { + tn2 = CTN(MUIV_NListtree_Move_NewTreeNode_Sorted); + + DoMethod( obj, MUIM_NListtree_Move, GetParent( tn ), tn, ln, tn2, 0 ); + } + + break; + } + + nexttn = tn; + } + } + + data->IgnoreSelectionChange = 0; + ActivateNotify( data ); + + /* sba: the active node could be changed, but the notify calling was disabled */ +// data->ForceActiveNotify = 1; + DoMethod(data->Obj, MUIM_NListtree_GetListActive, 0); + + DoQuiet( data, FALSE ); + } + + /* + ** If active entry moved, deselect him. + */ + /* + if ( data->TempSelected ) + { + TreeNodeSelectRemove( data, data->TempSelected ); + data->TempSelected = NULL; + } + */ + + data->Flags &= ~NLTF_DRAGDROP; + + return( 0 ); +} + + +IPTR _NList_Display(struct IClass *cl, Object *obj, struct MUIP_NList_Display *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_TreeNode *tn = CTN(msg->entry); + + /* + if ( !strcmp( "comp", tn->tn_Name ) ) + DEBUGBREAK; + */ + + // invoke the display method, this may be overridden by subclassed instances + DoMethod(obj, MUIM_NListtree_Display, tn, msg->entry_pos, msg->strings, msg->preparses); + + if(tn != NULL) + { + D(DBF_DRAW, "render flags=%lx %s %s",tn->tn_Flags,(tn->tn_Flags & TNF_LIST)?" list":"",msg->strings[1]); + + if(msg->strings[data->TreeColumn] == NULL) + { + msg->strings[data->TreeColumn] = tn->tn_Name; + } + + /* + ** Reset image position. Will be updated inside DrawPos(). + */ + tn->tn_ImagePos = 0; + + // NUL terminate the string + data->buf[0] = '\0'; + if(!( data->Flags & NLTF_NO_TREE)) + DrawImages(tn, tn, data, 0); + + if(msg->preparses[data->TreeColumn] != NULL) + strlcat(data->buf, msg->preparses[data->TreeColumn], DATA_BUF_SIZE); + + strlcat(data->buf, msg->strings[data->TreeColumn], DATA_BUF_SIZE); + + D(DBF_DRAW, "%s - %s", (data->Flags & NLTF_QUIET) ? "QUIET" : "RUN", data->buf); + + msg->strings[data->TreeColumn] = data->buf; + } + + return (IPTR)tn; +} + + +IPTR _NListtree_Construct(struct IClass *cl, Object *obj, struct MUIP_NListtree_Construct *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + IPTR result; + + // we just fallback to the construct hook, if any is set + if(data->ConstructHook != NULL) + result = (IPTR)MyCallHook(data->ConstructHook, data, MUIA_NListtree_ConstructHook, msg->Name, msg->UserData, msg->MemPool, msg->Flags); + else + result = (IPTR)msg->UserData; + + return result; +} + + +IPTR _NListtree_Destruct(struct IClass *cl, Object *obj, struct MUIP_NListtree_Destruct *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + + if(data->DestructHook != NULL) + MyCallHook(data->DestructHook, data, MUIA_NListtree_DestructHook, msg->Name, msg->UserData, msg->MemPool, msg->Flags); + + return 0; +} + + +IPTR _NListtree_Display(struct IClass *cl, Object *obj, struct MUIP_NListtree_Display *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + + // we just fallback to the display hook, if any is set + if(data->DisplayHook != NULL) + MyCallHook(data->DisplayHook, data, MUIA_NListtree_DisplayHook, msg->TreeNode, msg->EntryPos, msg->Array, msg->Preparse); + else + msg->Array[data->TreeColumn] = NULL; + + return 0; +} + + +IPTR _NListtree_Compare(struct IClass *cl, Object *obj, struct MUIP_NListtree_Compare *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + LONG cmp; + + // fall back to the compare hook if one is given, otherwise we assume node1 < node2 + if(data->CompareHook != NULL) + cmp = (LONG)MyCallHook(data->CompareHook, data, MUIA_NListtree_CompareHook, msg->TreeNode1, msg->TreeNode2, 0); + else + cmp = -1; + + return cmp; +} + + +//$$$ +IPTR _ContextMenuBuild(struct IClass *cl, Object *obj, struct MUIP_NList_ContextMenuBuild *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + + STATIC struct NewMenu ContextMenu[] = + { + /* + ** Type Label Key Flg MX UserData + ** ======== =============================== === === === ============== + */ + { NM_TITLE, (STRPTR)"NListtree", 0, 0, 0, NULL, }, + + { NM_ITEM, (STRPTR)"Copy to clipboard", 0, 0, 0, NULL, }, + + { NM_SUB, (STRPTR)"Unit 0", 0, 0, 0, (APTR)0, }, + { NM_SUB, (STRPTR)"Unit 1", 0, 0, 0, (APTR)1, }, + { NM_SUB, (STRPTR)"Unit 2", 0, 0, 0, (APTR)2, }, + { NM_SUB, (STRPTR)"Unit 3", 0, 0, 0, (APTR)3, }, + + { NM_END, NULL, 0, 0, 0, NULL, } + }; + + data->MenuChoice.pos = msg->pos; + data->MenuChoice.col = msg->column; + data->MenuChoice.ontop = msg->ontop; + + if ( !msg->ontop ) + return( (IPTR)MUI_MakeObject( MUIO_MenustripNM, ContextMenu, 0 ) ); + + return( DoSuperMethodA( cl, obj, (Msg)msg) ); +} + + +//$$$ +IPTR _ContextMenuChoice(struct IClass *cl, Object *obj, struct MUIP_ContextMenuChoice *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_TreeNode *tn; + + if ( !data->MenuChoice.ontop ) + { + DoMethod( obj, MUIM_NList_GetEntry, data->MenuChoice.pos, &tn ); + DoMethod( obj, MUIM_NListtree_CopyToClip, tn, data->MenuChoice.pos, muiUserData( msg->item ) ); + + return( 0 ); + } + + + return( DoSuperMethodA( cl, obj, (Msg)msg) ); +} + + + +/*****************************************************************************\ +******************************************************************************* +** +** Class methods. +** +******************************************************************************* +\*****************************************************************************/ + +/****** NListtree.mcc/MUIM_NListtree_Open *********************************** +* +* NAME +* +* MUIM_NListtree_Open -- Open the specified tree node. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_Open, +* struct MUI_NListtree_TreeNode *listnode, +* struct MUI_NListtree_TreeNode *treenode, +* ULONG flags); +* +* +* FUNCTION +* +* Opens a node in the listtree. To open a child, which isn't displayed, +* use 'MUIV_NListtree_Open_ListNode_Parent' to open all its parents, too. +* +* Only nodes can be opened. +* +* +* INPUTS +* +* listnode - Specify the node which list is used to open the node. +* +* MUIV_NListtree_Open_ListNode_Root +* The root list is used. +* +* MUIV_NListtree_Open_ListNode_Parent +* Indicates, that all the parents of the node specified in +* 'treenode' should be opened too. +* +* MUIV_NListtree_Open_ListNode_Active +* The list of the active node is used. +* +* treenode - The node to open. +* +* MUIV_NListtree_Open_TreeNode_Head +* Opens the head node of the list. +* +* MUIV_NListtree_Open_TreeNode_Tail +* Opens the tail node of the list. +* +* MUIV_NListtree_Open_TreeNode_Active +* The active node will be opened. +* +* MUIV_NListtree_Open_TreeNode_All: +* All the nodes of the list are opened. +* +* +* RESULT +* +* EXAMPLE +* // Open the active list. +* DoMethod(obj, MUIM_NListtree_Open, +* MUIV_NListtree_Open_ListNode_Active, +* MUIV_NListtree_Open_TreeNode_Active, 0); +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* MUIM_NListtree_Close +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_Open(struct IClass *cl, Object *obj, struct MUIP_NListtree_Open *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_TreeNode *tn, *tn2; + struct MUI_NListtree_ListNode *ln; + BOOL openall = FALSE; + + //D(bug( "Node: 0x%08lx - 0x%08lx", msg->ListNode, msg->TreeNode ) ); + + /* + ** + */ + switch( (IPTR)msg->ListNode ) + { + case MUIV_NListtree_Open_ListNode_Root: + ln = &data->RootList; + break; + + case MUIV_NListtree_Open_ListNode_Parent: + ln = &data->RootList; + break; + + case MUIV_NListtree_Open_ListNode_Active: + ln = data->ActiveList; + break; + + default: + ln = CLN( msg->ListNode ); + break; + } + + /* + ** + */ + switch( (IPTR)msg->TreeNode ) + { + case MUIV_NListtree_Open_TreeNode_Head: + tn = CTN( GetHead( (struct List *)&ln->ln_List ) ); + break; + + case MUIV_NListtree_Open_TreeNode_Tail: + tn = CTN( GetTail( (struct List *)&ln->ln_List ) ); + break; + + case MUIV_NListtree_Open_TreeNode_Active: + tn = data->ActiveNode; + break; + + case MUIV_NListtree_Open_TreeNode_All: + tn = CTN( ln ); // *** Dummy for check below. + openall = TRUE; + break; + + default: + tn = msg->TreeNode; + break; + } + + + /* + ** Determine if the node holds a list + ** and the node is not open. + */ + if ( ln && tn ) + { + if ( !( tn->tn_Flags & TNF_LIST ) ) + tn = GetParentNotRoot( tn ); + + if ( tn ) + { + if ( ( ( tn->tn_Flags & TNF_LIST ) && !( tn->tn_Flags & TNF_OPEN ) ) || openall ) + { + DeactivateNotify( data ); + DoQuiet( data, TRUE ); + + //D(bug( "Node: 0x%08lx - %s%s", tn, tn->tn_Name, openall ? " (expand)" : "" ) ); + + if ( openall ) + OpenTreeNodeListExpand( data, ln ); + else + OpenTreeNode( data, tn ); + + if ((IPTR)msg->ListNode == (IPTR)MUIV_NListtree_Open_ListNode_Parent) + { + tn2 = tn; + + while((tn2 = GetParentNotRoot(tn2))) + { + //D(bug( "Opening node: 0x%08lx - %s", tn2, tn2->tn_Name ) ); + + OpenTreeNode( data, tn2 ); + } + } + + if ( ( data->Flags & NLTF_OPENAUTOSCROLL ) && !openall ) + ShowTree( data, tn ); + + DoQuiet( data, FALSE ); + ActivateNotify( data ); + + /* sba: the active note could be changed, but the notify calling was disabled */ + DoMethod(data->Obj, MUIM_NListtree_GetListActive, 0); + } + } + } + + return( 0 ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_Close *********************************** +* +* NAME +* +* MUIM_NListtree_Close -- Close the specified list node. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_Close, +* struct MUI_NListtree_TreeNode *listnode, +* struct MUI_NListtree_TreeNode *treenode, +* ULONG flags); +* +* +* FUNCTION +* +* Close a node or nodes of a listtree. It is checked if the tree node +* is a node, not a leaf! +* +* When the active entry was a child of the closed node, the closed node +* will become active. +* +* +* INPUTS +* +* listnode - Specify the node which list is used to find the entry. The +* search is started at the head of this list. +* +* MUIV_NListtree_Close_ListNode_Root +* The root list is used. +* +* MUIV_NListtree_Close_ListNode_Parent +* The list which is the parent of the active list is used. +* +* MUIV_NListtree_Close_ListNode_Active +* The list of the active node is used. +* +* +* treenode - The node which should be closed. If there are children +* of the node, they are also closed. +* +* MUIV_NListtree_Close_TreeNode_Head +* The head of the list defined in 'listnode' is closed. +* +* MUIV_NListtree_Close_TreeNode_Tail: +* Closes the tail of the list defined in 'listnode'. +* +* MUIV_NListtree_Close_TreeNode_Active: +* Closes the active node. +* +* MUIV_NListtree_Close_TreeNode_All: +* Closes all nodes of the list which is specified in +* 'listnode'. +* +* +* RESULT +* +* EXAMPLE +* +* // Close the active list. +* DoMethod(obj, MUIM_NListtree_Close, +* MUIV_NListtree_Close_ListNode_Active, +* MUIV_NListtree_Close_TreeNode_Active, 0); +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* MUIM_NListtree_Open +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_Close(struct IClass *cl, Object *obj, struct MUIP_NListtree_Close *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_TreeNode *tn; + struct MUI_NListtree_ListNode *ln; + BOOL closeall = FALSE; + + /* + ** + */ + switch( (IPTR)msg->ListNode ) + { + case MUIV_NListtree_Close_ListNode_Root: + ln = &data->RootList; + break; + + case MUIV_NListtree_Close_ListNode_Parent: + ln = CLN( data->ActiveList->ln_Parent ); + break; + + case MUIV_NListtree_Close_ListNode_Active: + ln = data->ActiveList; + break; + + default: + ln = CLN( msg->ListNode ); + break; + } + + /* + ** + */ + switch( (IPTR)msg->TreeNode ) + { + case MUIV_NListtree_Close_TreeNode_Head: + tn = CTN( GetHead( (struct List *)&ln->ln_List ) ); + break; + + case MUIV_NListtree_Close_TreeNode_Tail: + tn = CTN( GetTail( (struct List *)&ln->ln_List ) ); + break; + + case MUIV_NListtree_Close_TreeNode_Active: + tn = data->ActiveNode; + break; + + case MUIV_NListtree_Close_TreeNode_All: + tn = CTN( ln ); // *** Dummy for check below. + closeall = TRUE; + break; + + default: + tn = msg->TreeNode; + break; + } + + + /* + ** Determine if the node holds a list + ** and the node is not open. + */ + if ( ln && tn ) + { + if ( ( ( tn->tn_Flags & TNF_LIST ) && ( tn->tn_Flags & TNF_OPEN ) ) || closeall ) + { + struct MUI_NListtree_TreeNode *temp = data->ActiveNode; + + DeactivateNotify( data ); + DoQuiet( data, TRUE ); + + //D(bug( "Node: 0x%08lx - %s%s", tn, tn->tn_Name, closeall ? " (collapse)" : "" ) ); + + if ( closeall ) + { + tn = CTN( ln ); + + CloseTreeNodeListCollapse( data, ln ); + } + else + { + if ( data->Flags & NLTF_REMEMBER_STATUS ) + CloseTreeNode( data, tn ); + else + { + CloseTreeNodeCollapse( data, tn ); + } + } + + DoQuiet( data, FALSE ); + ActivateNotify( data ); + + if ( temp ) + { + if ( temp->tn_IFlags & TNIF_VISIBLE ) + set( obj, MUIA_NListtree_Active, temp ); + else + set( obj, MUIA_NListtree_Active, tn ); + } + } + } + + return( 0 ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_Insert ********************************** +* +* NAME +* +* MUIM_NListtree_Insert -- Insert an entry at the specified position. (V1) +* +* +* SYNOPSIS +* +* struct MUI_NListtree_TreeNode *treenode = +* DoMethod(obj, MUIM_NListtree_Insert, +* STRPTR name, APTR userdata, +* struct MUI_NListtree_TreeNode *listnode, +* struct MUI_NListtree_TreeNode *prevtreenode, +* ULONG flags); +* +* +* FUNCTION +* +* Insert an entry at the position, which is defined in 'listnode' +* and 'prevtreenode'. Name contains the name of the entry as string +* which is buffered. The user entry can be used as you like. +* +* +* INPUTS +* +* name/userdata - What the names say ;-) +* +* +* listnode - Specify the node which list is used to insert +* the entry. +* +* MUIV_NListtree_Insert_ListNode_Root +* Use the root list. +* +* MUIV_NListtree_Insert_ListNode_Active +* Use the list of the active node. +* +* MUIV_NListtree_Insert_ListNode_ActiveFallback +* Use the list of the active node. If no list is active, +* an automatic fallback to the root list is done. +* +* MUIV_NListtree_Insert_ListNode_LastInserted +* Insert entry in the list the last entry was inserted. +* +* +* prevtreenode - The node which is the predecessor of the node +* to insert. +* +* MUIV_NListtree_Insert_PrevNode_Head +* The entry will be inserted at the head of the list. +* +* MUIV_NListtree_Insert_PrevNode_Tail +* The entry will be inserted at the tail of the list. +* +* MUIV_NListtree_Insert_PrevNode_Active +* The entry will be inserted after the active node of +* the list. If no entry is active, the entry will be +* inserted at the tail. +* +* MUIV_NListtree_Insert_PrevNode_Sorted: +* The entry will be inserted using the defined sort hook. +* +* flags: +* +* MUIV_NListtree_Insert_Flag_Active +* The inserted entry will be set to active. This means the +* cursor is moved to the newly inserted entry. If the entry +* was inserted into a closed node, it will be opened. +* +* MUIV_NListtree_Insert_Flag_NextNode +* 'prevtreenode' is the successor, not the predecessor. +* +* +* RESULT +* +* A pointer to the newly inserted entry. +* +* +* EXAMPLE +* +* // Insert an entry after the active one and make it active. +* DoMethod(obj, MUIM_NListtree_Insert, "Hello", NULL, +* MUIV_NListtree_Insert_ListNode_Active, +* MUIV_NListtree_Insert_PrevNode_Active, +* MUIV_NListtree_Insert_Flag_Active); +* +* +* NOTES +* +* BUGS +* +* Not implemented yet: +* MUIV_NListtree_Insert_Flag_NextNode +* +* +* SEE ALSO +* +* MUIA_NListtree_ConstructHook, MUIA_NListtree_CompareHook +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_Insert(struct IClass *cl, Object *obj, struct MUIP_NListtree_Insert *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_TreeNode *tn = NULL; + struct MUI_NListtree_ListNode *ln; + APTR user; + static const char *np = "*** NULL POINTER ***"; + + D(DBF_LISTTREE, "MUIM_NListtree_Insert: name=%s flags=0x%lx listnode:0x%lx prevnode:0x%lx %ld",msg->Name,msg->Flags,msg->ListNode,msg->PrevNode,data->NumEntries); + + /* + ** Construct new user data + */ + user = (APTR)DoMethod(obj, MUIM_NListtree_Construct, msg->Name, msg->User, data->TreePool, 0); + + /* + ** Allocate memory for the new entry and, if + ** list, initialize list structure for use. + */ + if ( msg->Flags & TNF_LIST ) + { + if((ln = CLN(AllocVecPooled(data->TreePool, sizeof(struct MUI_NListtree_ListNode))))) + { + tn = CTN( ln ); + + NewList( (struct List *)&ln->ln_List ); + } + } + else + tn = CTN( AllocVecPooled( data->TreePool, sizeof( struct MUI_NListtree_TreeNode ) ) ); + + + /* + ** If allocated memory successfully, set up all fields, + ** get special list and node pointers if needed and add + ** to a list. + */ + if ( tn ) + { + struct MUI_NListtree_ListNode *li; + + if ( !msg->Name ) + msg->Name = (char *)np; + + /* + ** Should we duplicate the supplied node name? + */ + if ( data->Flags & NLTF_DUPNODENAMES ) + { + int len = strlen( msg->Name ) + 1; + tn->tn_Name = (STRPTR)AllocVecPooled( data->TreePool, len ); + strlcpy( tn->tn_Name, msg->Name, len ); + tn->tn_IFlags |= TNIF_ALLOCATED; + } + else + tn->tn_Name = msg->Name; + + if ( tn->tn_Name ) + { + tn->tn_User = user; + tn->tn_Flags = msg->Flags; + + /* + ** Check out which list to use. + */ + switch( (IPTR)msg->ListNode ) + { + case MUIV_NListtree_Insert_ListNode_Root: + li = &data->RootList; + break; + + case MUIV_NListtree_Insert_ListNode_Active: + li = data->ActiveList; + break; + + case MUIV_NListtree_Insert_ListNode_ActiveFallback: + if ( !( li = data->ActiveList ) ) + li = &data->RootList; + break; + + case MUIV_NListtree_Insert_ListNode_LastInserted: + li = data->LastInsertedList; + break; + + default: + li = CLN( msg->ListNode ); + D(DBF_LISTTREE, "li = %p",li); + break; + } + + if ( li ) + { + struct MUI_NListtree_TreeNode *in; + + /* + ** If given list node is not a list, get parent + ** of the given node to avoid trouble. + */ + if ( !( li->ln_Flags & TNF_LIST ) ) + li = CLN( GetParent( CTN( li ) ) ); + + data->LastInsertedList = li; + + tn->tn_Parent = CTN( li ); + + //DoQuiet( data, TRUE ); + //DeactivateNotify( data ); + + /* + ** Add the new created entry to the specified list. + */ + switch( (IPTR)msg->PrevNode ) + { + case MUIV_NListtree_Insert_PrevNode_Head: + AddHead( (struct List *)&li->ln_List, (struct Node *)&tn->tn_Node ); + in = CTN( INSERT_POS_HEAD ); + break; + + case MUIV_NListtree_Insert_PrevNode_Tail: + AddTail( (struct List *)&li->ln_List, (struct Node *)&tn->tn_Node ); + in = CTN( INSERT_POS_TAIL ); + break; + + case MUIV_NListtree_Insert_PrevNode_Active: + if ( data->ActiveNode ) + { + if ( (APTR)li != (APTR)data->ActiveNode ) + { + Insert( (struct List *)&li->ln_List, (struct Node *)&tn->tn_Node, (struct Node *)&data->ActiveNode->tn_Node ); + in = data->ActiveNode; + } + else + { + AddHead( (struct List *)&li->ln_List, (struct Node *)&tn->tn_Node ); + in = CTN( INSERT_POS_HEAD ); + } + } + else + { + AddTail( (struct List *)&li->ln_List, (struct Node *)&tn->tn_Node ); + in = CTN( INSERT_POS_TAIL ); + } + break; + + case MUIV_NListtree_Insert_PrevNode_Sorted: + in = GetInsertNodeSorted( data, li, tn ); + + if ( (IPTR)in == (IPTR)INSERT_POS_TAIL ) + { + AddTail( (struct List *)&li->ln_List, (struct Node *)&tn->tn_Node ); + } + else + { + Insert( (struct List *)&li->ln_List, (struct Node *)&tn->tn_Node, (struct Node *)&in->tn_Node ); + } + break; + + default: + Insert( (struct List *)&li->ln_List, (struct Node *)&tn->tn_Node, (struct Node *)&msg->PrevNode->tn_Node ); + in = msg->PrevNode; + break; + } + + //D(bug( "Inserting entry 0x%08lx into list 0x%08lx (0x%08lx) after node 0x%08lx - '%s' User: 0x%08lx", tn, li, msg->ListNode, msg->PrevNode, ( (LONG)in == INSERT_POS_HEAD ) ? "HEAD" : ( (LONG)in == INSERT_POS_TAIL ) ? "TAIL" : in->tn_Name, msg->User ) ); + + + /* Special AmiTradeCenter Debug (Enforcer Hits!!) + { + UBYTE *x = (UBYTE *)user + 28; + UBYTE *lix = (UBYTE *)li->ln_User + 28; + UBYTE *inx = (UBYTE *)in->tn_User + 28; + + char *name = (char *)x; + char *liname = (char *)lix; + char *inname = (char *)inx; + + D(bug( "Inserting '%s' into list '%s' after node '%s' at pos %ld (%s %s)\n", + name, + ( (LONG)msg->ListNode == MUIV_NListtree_Insert_ListNode_Root ) ? "ROOT" : ( (LONG)msg->ListNode == MUIV_NListtree_Insert_ListNode_Active ) ? "ACTIVE" : liname, + ( (LONG)in == INSERT_POS_HEAD ) ? "HEAD" : ( (LONG)in == INSERT_POS_TAIL ) ? "TAIL" : inname, + ( li->ln_Flags & TNF_OPEN ) ? GetVisualInsertPos( data, li, in ) : -1, ( tn->tn_Flags & TNF_OPEN ) ? "TNF_OPEN" : "", ( tn->tn_Flags & TNF_LIST ) ? "TNF_LIST" : "" ) ); + + D(bug( "Inserting entry 0x%08lx - '%s' into list 0x%08lx (0x%08lx) - '%s' after node 0x%08lx (0x%08lx) - '%s'\n", + tn, tn->tn_Name, li, msg->ListNode, li->ln_Name, in, msg->PrevNode, ( (LONG)in == INSERT_POS_HEAD ) ? "HEAD" : ( (LONG)in == INSERT_POS_TAIL ) ? "TAIL" : in->tn_Name ) ); + } + */ + + InsertTreeNodeVisible( data, tn, li, in ); + NLAddToTable( data, &li->ln_Table, tn ); + + /* + ** Make sure, that the inserted node is visible by opening + ** all parents (if it should be set active). + */ + if ( msg->Flags & MUIV_NListtree_Insert_Flag_Active ) + { + if ( !( tn->tn_IFlags & TNIF_VISIBLE ) ) + DoMethod( obj, MUIM_NListtree_Open, MUIV_NListtree_Open_ListNode_Parent, tn, 0 ); + + set( obj, MUIA_NListtree_Active, tn ); + } + + /* + ** Add one to the global number of entries + ** and the number of entries in list. + */ + data->NumEntries++; + + + if ( tn->tn_IFlags & TNIF_VISIBLE ) + DoRefresh( data ); + + //ActivateNotify( data ); + //DoQuiet( data, FALSE ); + + D(DBF_LISTTREE, "Result: 0x%lx %ld",tn,data->NumEntries); + + return( (IPTR)tn ); + } + + /* + ** Free memory if failed to allocate + ** name space. + */ + FreeVecPooled( data->TreePool, tn ); + } + } + + return(0); +} + + + +/****** NListtree.mcc/MUIM_NListtree_InsertStruct **************************** +* +* NAME +* +* MUIM_NListtree_InsertStruct -- Insert a structure such as a path +* using a delimiter. (V1) +* +* +* SYNOPSIS +* +* struct MUI_NListtree_TreeNode *treenode = +* DoMethod(obj, MUIM_NListtree_InsertStruct, +* STRPTR name, APTR userdata, +* STRPTR delimiter, ULONG flags); +* +* +* FUNCTION +* +* Insert a structure into the list such as a path or +* something similar (like ListtreeName.mcc does). The name is +* splitted using the supplied delimiter. For each name part a +* new tree entry is generated. If you have Images/aphaso/Image.mbr, +* the structure will be build es follows: +* +* + Images +* + aphaso +* - Image.mbr +* +* If a part of the structure is already present, it will be used to +* insert. +* +* +* INPUTS +* +* name - Data containing (must not) one or more delimiters as +* specified in delimiter (Images/aphaso/Image.mbr for +* example). +* +* userdata - Your personal data. +* +* delimiter - The delimiter(s) used in the name field (":/" or +* something). +* +* flags: +* +* Use normal insert flags here (see there). +* +* In addition you can supply +* MUIV_NListtree_InsertStruct_Flag_AllowDuplicates if you want the +* last entry, Image.mbr in the above example, to occur multiple +* times even if the name is the same. +* +* +* RESULT +* +* A pointer to the last instance of newly inserted entries. +* +* +* EXAMPLE +* +* // Insert a directory path. +* path = MyGetPath( lock ); +* +* DoMethod(obj, MUIM_NListtree_InsertStruct, +* path, NULL, ":/", 0); +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIA_NListtree_Insert +* +* +****************************************************************************** +* +*/ +/* +** Returns tokens delimited by delimiter on each call. +*/ +INLINE STRPTR mystrtok( STRPTR string, STRPTR buf, ULONG bufsize, STRPTR delimiter ) +{ + STRPTR str, del; + + str = string; + + while( *str ) + { + del = delimiter; + + while( *del ) + { + if ( *str == *del ) + { + strncpy( buf, string, MIN( (LONG)bufsize - 1, ( str - string ) ) ); + buf[MIN( (LONG)bufsize - 1, ( str - string ) )] = 0; + + return( &str[1] ); + } + + del++; + } + + str++; + } + + strncpy( buf, string, MIN( (LONG)bufsize - 1, ( str - string ) ) ); + buf[MIN( (LONG)bufsize - 1, ( str - string ) )] = 0; + + return( str ); +} + + + +IPTR _NListtree_InsertStruct(struct IClass *cl, Object *obj, struct MUIP_NListtree_InsertStruct *msg) +{ + struct MUI_NListtree_TreeNode *temp, *lasttn = CTN( MUIV_NListtree_Insert_ListNode_Root ); + struct NListtree_Data *data = INST_DATA(cl, obj); + STRPTR p, token; + ULONG len; + static const char *np = "*** NULL POINTER ***"; + + if ( !msg->Name ) + msg->Name = (char *)np; + + if((token = AllocVecPooled(data->MemoryPool, len = (strlen(msg->Name) + 1)))) + { + p = msg->Name; + + while( 1 ) + { + p = mystrtok( p, token, len, msg->Delimiter ); + + if ( ( !*p && ( msg->Flags & MUIV_NListtree_InsertStruct_Flag_AllowDuplicates ) ) || + !( temp = CTN( DoMethod( obj, MUIM_NListtree_FindName, lasttn, token, MUIV_NListtree_FindName_Flag_SameLevel ) ) ) ) + { + lasttn = CTN( DoMethod( obj, MUIM_NListtree_Insert, token, msg->User, + lasttn, MUIV_NListtree_Insert_PrevNode_Tail, *p ? TNF_LIST | msg->Flags : msg->Flags ) ); + } + else + { + lasttn = temp; + } + + if ( !*p ) break; + } + + FreeVecPooled( data->MemoryPool, token ); + } + + return( (IPTR)lasttn ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_Remove ********************************** +* +* NAME +* +* MUIM_NListtree_Remove -- Remove the specified entry(ies). (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_Remove, +* struct MUI_NListtree_TreeNode *listnode, +* struct MUI_NListtree_TreeNode *treenode, +* ULONG flags); +* +* +* FUNCTION +* +* Removes a node or nodes from the listtree. When the active entry +* is removed, the successor will become active. +* +* +* INPUTS +* +* listnode - Specify the node which list is used to find the entry +* which should be removed. The search is started at the +* begin of this list. +* +* MUIV_NListtree_Remove_ListNode_Root +* The root list is used. +* +* MUIV_NListtree_Remove_ListNode_Active +* The list of the active node is used. +* +* +* treenode - The node which should be removed. If there are children +* of this node, they are also removed. +* +* MUIV_NListtree_Remove_TreeNode_Head +* The head of the list defined in 'listnode' is removed. +* +* MUIV_NListtree_Remove_TreeNode_Tail +* The tail of the list defined in 'listnode' is removed. +* +* MUIV_NListtree_Remove_TreeNode_Active +* Removes the active node. +* +* MUIV_NListtree_Remove_TreeNode_All +* All nodes of the list which is specified in 'listnode', +* are removed. Other nodes of parent lists are not +* affected. +* +* MUIV_NListtree_Remove_TreeNode_Selected +* All selected nodes are removed. +* +* RESULT +* +* EXAMPLE +* +* // Remove the active entry if delete is pressed! +* DoMethod(bt_delete, MUIM_Notify, MUIA_Pressed, FALSE, +* lt_list, 4, MUIM_NListtree_Remove, +* MUIV_NListtree_Remove_ListNode_Active, +* MUIV_NListtree_Remove_TreeNode_Active, 0); +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NListtree_Insert, MUIA_NListtree_DestructHook, +* MUIM_NList_Active +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_Remove(struct IClass *cl, Object *obj, struct MUIP_NListtree_Remove *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_ListNode *li; + struct MUI_NListtree_TreeNode *tn; + LONG pos; + + D(DBF_LISTTREE, "NList Remove listnode: 0x%lx treenode: 0x%lx",msg->ListNode,msg->TreeNode); + + DeactivateNotify( data ); + + /* + ** Removed, because of problems when deleting entries in a loop (all selected) + */ + //DoQuiet( data, TRUE ); + + data->TempActiveNode = data->ActiveNode; + + /* + ** + */ + switch( (IPTR)msg->ListNode ) + { + case MUIV_NListtree_Remove_ListNode_Root: + li = &data->RootList; + break; + + case MUIV_NListtree_Remove_ListNode_Active: + li = data->ActiveList; + break; + + default: + li = CLN( msg->ListNode ); + break; + } + + /* + ** + */ + if ( li ) + { + switch( (IPTR)msg->TreeNode ) + { + case MUIV_NListtree_Remove_TreeNode_Head: + tn = CTN( GetHead( (struct List *)&li->ln_List ) ); + break; + + case MUIV_NListtree_Remove_TreeNode_Tail: + tn = CTN( GetTail( (struct List *)&li->ln_List ) ); + break; + + case MUIV_NListtree_Remove_TreeNode_Active: + tn = data->ActiveNode; + break; + + case MUIV_NListtree_Remove_TreeNode_All: + + pos = GetVisualPos( data, CTN( GetHead( (struct List *)&li->ln_List ) ) ); + + while((tn = CTN( GetHead((struct List *)&li->ln_List)))) + { + //D(bug( "Node: 0x%08lx - %s - pos: %ld", tn, tn->tn_Name, pos ) ); + + RemoveNodes( data, li, tn, pos ); + } + + tn = NULL; + break; + + case MUIV_NListtree_Remove_TreeNode_Selected: + + while( data->SelectedTable.tb_Entries ) + { + tn = data->SelectedTable.tb_Table[0]; + + pos = GetVisualPos( data, tn ); + + //D(bug( "Node: 0x%08lx - %s - pos: %ld", tn, tn->tn_Name, pos ) ); + + RemoveNodes( data, CLN( tn->tn_Parent ), tn, pos ); + } + + tn = NULL; + break; + + default: + tn = msg->TreeNode; + break; + } + + if ( tn ) + { + BOOL dorefresh = FALSE; + + pos = GetVisualPos( data, tn ); + + D(DBF_LISTTREE, "Node: 0x%08lx - Name: %s - pos: %ld", tn, tn->tn_Name, pos); + + if ( tn->tn_IFlags & TNIF_VISIBLE ) + dorefresh = TRUE; + + RemoveNodes( data, li, tn, pos ); + + if ( dorefresh ) + DoRefresh( data ); + + D(DBF_LISTTREE, "Activenode: 0x%lx Trmpactivenode: 0x%lx",data->ActiveNode,data->TempActiveNode); + + /* sba: Notification is deactivated so we get not informed if the active node changed, + ** do this by hand now + */ + if (data->TempActiveNode != data->ActiveNode) + { + nnset(data->Obj, MUIA_NListtree_Active, data->TempActiveNode); + data->ForceActiveNotify = 1; + } + } + } + +/* + if ( !( msg->Flags & MUIV_NListtree_Remove_Flag_NoActive ) ) + { + if ( data->TempActiveNode == tn ) + data->TempActiveNode = NULL; + + D(bug( "Set Active node: 0x%8lx\n",data->TempActiveNode) ); + + MakeSet( data, MUIA_NListtree_Active, data->TempActiveNode ); + + if ( data->TempActiveNode && ( data->MultiSelect != MUIV_NListtree_MultiSelect_None ) ) + { + TreeNodeSelect( data, data->TempActiveNode, MUIV_NListtree_Select_On, 0, 0 ); + } + } +*/ + data->TempActiveNode = NULL; + + /* + ** Removed, because of problems when deleting entries in a loop (all selected) + */ + //DoQuiet( data, FALSE ); + ActivateNotify( data ); + + /* sba: the active note could be changed, but the notify calling was disabled */ + DoMethod(data->Obj, MUIM_NListtree_GetListActive, 0); + return( 0 ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_Clear *********************************** +* +* NAME +* +* MUIM_NListtree_Clear -- Clear the complete listview. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_Clear, NULL, 0) +* +* +* FUNCTION +* +* Clear the complete listview, calling destruct hook for each entry. +* +* +* INPUTS +* +* RESULT +* +* EXAMPLE +* +* // Clear the listview! +* DoMethod( nlisttree, MUIM_NListtree_Clear, NULL, 0 ); +* +* +* NOTES +* +* For now, when using this method, you MUST supply NULL for the list +* node and 0 for flags for future compatibility. +* This will definitely change! +* +* +* BUGS +* +* SEE ALSO +* +* MUIM_NListtree_Remove, MUIA_NListtree_DestructHook, +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_Clear(struct IClass *cl, Object *obj, UNUSED struct MUIP_NListtree_Clear *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_ListNode *ln = NULL; + + ENTER(); + + ln = &data->RootList; + + /* + ** + */ + /* + switch( (ULONG)msg->ListNode ) + { + case MUIV_NListtree_Clear_ListNode_Root: + ln = &data->RootList; + break; + + case MUIV_NListtree_Clear_ListNode_Active: + ln = data->ActiveList; + break; + + default: + ln = CLN( msg->ListNode ); + break; + } + */ + + + if ( ln ) + { + /* + ** Quick clear the NList object, call the destruct hook for + ** each entry (QuickRemoveNodes()), delete the tree pool and + ** allocate it new, reset the root list and delete the table + ** memory pointer which refers to the old pool. Then initialize + ** active node and list. + */ + DoMethod( obj, MUIM_NList_Clear, 0 ); + + QuickRemoveNodes( data, ln ); + + if(data->TreePool != NULL) + { + #if defined(__amigaos4__) + FreeSysObject(ASOT_MEMPOOL, data->TreePool); + #else + DeletePool(data->TreePool); + #endif + } + + #if defined(__amigaos4__) + data->TreePool = AllocSysObjectTags(ASOT_MEMPOOL, ASOPOOL_MFlags, MEMF_SHARED|MEMF_CLEAR, + ASOPOOL_Puddle, 16384, + ASOPOOL_Threshold, 4096, + ASOPOOL_Name, "NListtree.mcc tree pool", + TAG_DONE); + #else + data->TreePool = CreatePool(MEMF_CLEAR, 16384, 4096); + #endif + + NewList( (struct List *)&data->RootList.ln_List ); + data->RootList.ln_Table.tb_Table = NULL; + data->RootList.ln_Table.tb_Entries = 0; + data->RootList.ln_Table.tb_Size = 0; + data->NumEntries = 0; + + data->ActiveNode = MUIV_NListtree_Active_Off; + data->ActiveList = &data->RootList; + + } + + RETURN(0); + return( 0 ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_Exchange ******************************** +* +* NAME +* +* MUIM_NListtree_Exchange -- Exchanges two tree nodes. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_Exchange, +* struct MUI_NListtree_TreeNode *listnode1, +* struct MUI_NListtree_TreeNode *treenode1, +* struct MUI_NListtree_TreeNode *listnode2, +* struct MUI_NListtree_TreeNode *treenode2, +* ULONG flags); +* +* +* FUNCTION +* +* Exchange two tree nodes. +* +* +* INPUTS +* +* listnode1 - Specify the list node of the entry which +* should be exchanged. +* +* MUIV_NListtree_Exchange_ListNode1_Root +* The root list is used. +* +* MUIV_NListtree_Exchange_ListNode1_Active +* The active list (the list of the active node) is used. +* +* treenode1 - Specify the node which should be exchanged. +* +* MUIV_NListtree_Exchange_TreeNode1_Head +* The head of the list defined in 'listnode1' is +* exchanged. +* +* MUIV_NListtree_Exchange_TreeNode1_Tail +* The tail of the list defined in 'listnode1' is +* exchanged. +* +* MUIV_NListtree_Exchange_TreeNode1_Active +* The active node is exchanged. +* +* listnode2 - Specify the second list node which is used for exchange. +* +* MUIV_NListtree_Exchange_ListNode2_Root +* The root list. +* +* MUIV_NListtree_Exchange_ListNode2_Active +* The list of the active node. +* +* treenode2 - This node is the second entry which is exchanged. +* +* MUIV_NListtree_Exchange_TreeNode2_Head +* The node 'treenode1' is exchanged with the head of the +* list defined in 'listnode2'. +* +* MUIV_NListtree_Exchange_TreeNode2_Tail +* The node 'treenode1' is exchanged with the tail of the +* list defined in 'ln2'. +* +* MUIV_NListtree_Exchange_TreeNode2_Active: +* The node 'treenode1' is exchanged with the active node. +* +* MUIV_NListtree_Exchange_TreeNode2_Up: +* The node 'treenode1' is exchanged with the entry +* previous to the one specified in 'treenode1'. +* +* MUIV_NListtree_Exchange_TreeNode2_Down: +* The node 'treenode1' is exchanged with the entry next +* (the successor) to the one specified in 'treenode1'. +* +* +* RESULT +* +* EXAMPLE +* +* // Exchange the active entry with the successor. +* DoMethod(obj, +* MUIV_NListtree_Exchange_ListNode1_Active, +* MUIV_NListtree_Exchange_TreeNode1_Active, +* MUIV_NListtree_Exchange_ListNode2_Active, +* MUIV_NListtree_Exchange_TreeNode2_Down, +* 0); +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NListtree_Move, MUIM_NListtree_Insert, +* MUIM_NListtree_Remove +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_Exchange(struct IClass *cl, Object *obj, struct MUIP_NListtree_Exchange *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_ListNode *ln1, *ln2; + struct MUI_NListtree_TreeNode *tn1, *tn2; + struct Node *insnode1, *insnode2; + LONG pos1, pos2; + + /* + ** Handle all special events. + */ + switch( (IPTR)msg->ListNode1 ) + { + case MUIV_NListtree_Exchange_ListNode1_Root: + ln1 = &data->RootList; + break; + + case MUIV_NListtree_Exchange_ListNode1_Active: + ln1 = data->ActiveList; + break; + + default: + ln1 = CLN( msg->ListNode1 ); + break; + } + + switch( (IPTR)msg->TreeNode1 ) + { + case MUIV_NListtree_Exchange_TreeNode1_Head: + tn1 = CTN( GetHead( (struct List *)&ln1->ln_List ) ); + break; + + case MUIV_NListtree_Exchange_TreeNode1_Tail: + tn1 = CTN( GetTail( (struct List *)&ln1->ln_List ) ); + break; + + case MUIV_NListtree_Exchange_TreeNode1_Active: + tn1 = data->ActiveNode; + break; + + default: + tn1 = msg->TreeNode1; + break; + } + + switch( (IPTR)msg->ListNode2 ) + { + case MUIV_NListtree_Exchange_ListNode2_Root: + ln2 = &data->RootList; + break; + + case MUIV_NListtree_Exchange_ListNode2_Active: + ln2 = data->ActiveList; + break; + + default: + ln2 = CLN( msg->ListNode2 ); + break; + } + + switch( (IPTR)msg->TreeNode2 ) + { + case MUIV_NListtree_Exchange_TreeNode2_Head: + tn2 = CTN( GetHead( (struct List *)&ln1->ln_List ) ); + break; + + case MUIV_NListtree_Exchange_TreeNode2_Tail: + tn2 = CTN( GetTail( (struct List *)&ln1->ln_List ) ); + break; + + case MUIV_NListtree_Exchange_TreeNode2_Active: + tn2 = data->ActiveNode; + break; + + case MUIV_NListtree_Exchange_TreeNode2_Up: + if ( !( tn2 = CTN( GetPred( (struct Node *)&tn1->tn_Node ) ) ) ) + tn2 = CTN( tn1->tn_Node.mln_Pred ); + break; + + case MUIV_NListtree_Exchange_TreeNode2_Down: + if ( !( tn2 = CTN( GetSucc( (struct Node *)&tn1->tn_Node ) ) ) ) + tn2 = CTN( tn1->tn_Node.mln_Succ ); + break; + + default: + tn2 = msg->TreeNode2; + break; + } + + + if ( tn1 != tn2 ) + { + DoQuiet( data, TRUE ); + + /* + ** Get the nodes where to re-insert the removed nodes. + ** If no previsous node available, then Insert() assumes + ** AddHead() when "insnodeX" is NULL. + */ + insnode1 = GetPred( (struct Node *)tn1 ); + insnode2 = GetPred( (struct Node *)tn2 ); + + if ( insnode1 == (struct Node *)tn2 ) + insnode1 = GetPred( insnode1 ); + + if ( insnode2 == (struct Node *)tn1 ) + insnode2 = GetPred( insnode2 ); + + //D(bug( "Node1: 0x%08lx - %s, Node2: 0x%08lx - %s", tn1, tn1->tn_Name, tn2, tn2->tn_Name ) ); + + /* + ** Remove entry 1. + */ + NLRemoveFromTable( data, &ln1->ln_Table, tn1 ); + RemoveTreeNodeVisible( data, tn1, &pos1 ); + Remove( (struct Node *)&tn1->tn_Node ); + + /* + ** Remove entry 2. + */ + NLRemoveFromTable( data, &ln2->ln_Table, tn2 ); + RemoveTreeNodeVisible( data, tn2, &pos2 ); + Remove( (struct Node *)&tn2->tn_Node ); + + + /* + ** Set new parent entries and visibility. + */ + tn1->tn_Parent = CTN( ln2 ); + tn2->tn_Parent = CTN( ln1 ); + + /* + ** Insert first entry in the list. + */ + if ( !insnode2 ) + { + AddHead( (struct List *)&ln2->ln_List, (struct Node *)tn1 ); + InsertTreeNodeVisible( data, tn1, ln2, CTN( INSERT_POS_HEAD ) ); + NLAddToTable( data, &ln2->ln_Table, tn1 ); + } + else + { + Insert( (struct List *)&ln2->ln_List, (struct Node *)tn1, insnode2 ); + InsertTreeNodeVisible( data, tn1, ln2, CTN( insnode2 ) ); + NLAddToTable( data, &ln2->ln_Table, tn1 ); + } + + /* + ** Insert second entry in the list. + */ + if ( !insnode1 ) + { + if ( !insnode2 && ( pos1 > pos2 ) ) + { + Insert( (struct List *)&ln1->ln_List, (struct Node *)tn2, (struct Node *)tn1 ); + InsertTreeNodeVisible( data, tn2, ln1, tn1 ); + NLAddToTable( data, &ln1->ln_Table, tn2 ); + } + else + { + AddHead( (struct List *)&ln1->ln_List, (struct Node *)tn2 ); + InsertTreeNodeVisible( data, tn2, ln1, CTN( INSERT_POS_HEAD ) ); + NLAddToTable( data, &ln1->ln_Table, tn2 ); + } + } + else + { + Insert( (struct List *)&ln1->ln_List, (struct Node *)tn2, insnode1 ); + InsertTreeNodeVisible( data, tn2, ln1, CTN( insnode1 ) ); + NLAddToTable( data, &ln1->ln_Table, tn2 ); + } + + DoRefresh( data ); + + if ( tn1 == data->ActiveNode ) + nnset( obj, MUIA_NListtree_Active, tn1 ); + else if ( tn2 == data->ActiveNode ) + nnset( obj, MUIA_NListtree_Active, tn2 ); + + DoQuiet( data, FALSE ); + } + + return( 0 ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_Move ************************************ +* +* NAME +* +* MUIM_NListtree_Move -- Move an entry to the specified position. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_Move, +* struct MUI_NListtree_TreeNode *oldlistnode, +* struct MUI_NListtree_TreeNode *oldtreenode, +* struct MUI_NListtree_TreeNode *newlistnode, +* struct MUI_NListtree_TreeNode *newtreenode, +* ULONG flags); +* +* +* FUNCTION +* +* Move an entry to the position after a defined node. +* +* +* INPUTS +* +* oldlistnode - Specify the node which list is used to find the +* entry. The search is started at the head of this +* list. +* +* MUIV_NListtree_Move_OldListNode_Root +* The root list is used as the starting point. +* +* MUIV_NListtree_Move_OldListNode_Active +* The active list (the list of the active node) is used as +* the starting point. +* +* oldtreenode - Specify the node which should be moved. +* +* MUIV_NListtree_Move_OldTreeNode_Head +* The head of the list defined in 'oldlistnode' is moved. +* +* MUIV_NListtree_Move_OldTreeNode_Tail +* The tail of the list defined in 'oldlistnode' is moved. +* +* MUIV_NListtree_Move_OldTreeNode_Active +* The active node is moved. +* +* newlistnode - Specify the node which list is used to find the +* entry. The search is started at the head of this +* list. +* +* MUIV_NListtree_Move_NewListNode_Root +* The root list. +* +* MUIV_NListtree_Move_NewListNode_Active +* The list of the active node. +* +* newtreenode - This node is the predecessor of the entry which is +* inserted. +* +* MUIV_NListtree_Move_NewTreeNode_Head +* The node is moved to the head of the list defined in +* 'newlistnode'. +* +* MUIV_NListtree_Move_NewTreeNode_Tail +* The node is moved to the tail of the list defined in +* 'newlistnode'. +* +* MUIV_NListtree_Move_NewTreeNode_Active: +* The node is moved to one entry after the active node. +* +* MUIV_NListtree_Move_NewTreeNode_Sorted: +* The node is moved to the list using the sort hook. +* +* flags - Some flags to adjust moving. +* +* MUIV_NListtree_Move_Flag_KeepStructure +* The full tree structure from the selected entry to +* the root list is moved (created at destination). +* +* +* RESULT +* +* EXAMPLE +* +* // Move an entry to the head of another list-node. +* DoMethod(obj, +* MUIV_NListtree_Move_OldListNode_Active, +* MUIV_NListtree_Move_OldTreeNode_Active, +* somelistmode, +* MUIV_NListtree_Move_NewTreeNode_Head, +* 0); +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NListtree_Insert, MUIM_NListtree_Remove, +* MUIM_NListtree_Exchange, MUIA_NListtree_CompareHook, +* MUIM_NListtree_Copy +* +****************************************************************************** +* +*/ +IPTR _NListtree_Move(struct IClass *cl, Object *obj, struct MUIP_NListtree_Move *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_ListNode *ln1, *ln2; + struct MUI_NListtree_TreeNode *tn1, *tn2; + + D(DBF_LISTTREE, "MUIM_NListtree_Move"); + + /* + ** Handle all special events. + */ + switch( (IPTR)msg->OldListNode ) + { + case MUIV_NListtree_Move_OldListNode_Root: + ln1 = &data->RootList; + break; + + case MUIV_NListtree_Move_OldListNode_Active: + ln1 = data->ActiveList; + break; + + default: + ln1 = CLN( msg->OldListNode ); + break; + } + + switch( (IPTR)msg->OldTreeNode ) + { + case MUIV_NListtree_Move_OldTreeNode_Head: + tn1 = CTN( GetHead( (struct List *)&ln1->ln_List ) ); + break; + + case MUIV_NListtree_Move_OldTreeNode_Tail: + tn1 = CTN( GetTail( (struct List *)&ln1->ln_List ) ); + break; + + case MUIV_NListtree_Move_OldTreeNode_Active: + tn1 = data->ActiveNode; + break; + + default: + tn1 = msg->OldTreeNode; + break; + } + + switch( (IPTR)msg->NewListNode ) + { + case MUIV_NListtree_Move_NewListNode_Root: + ln2 = &data->RootList; + break; + + case MUIV_NListtree_Move_NewListNode_Active: + ln2 = data->ActiveList; + break; + + default: + ln2 = CLN( msg->NewListNode ); + break; + } + + switch( (IPTR)msg->NewTreeNode ) + { + case MUIV_NListtree_Move_NewTreeNode_Head: + tn2 = CTN( INSERT_POS_HEAD ); + break; + + case MUIV_NListtree_Move_NewTreeNode_Tail: + tn2 = CTN( INSERT_POS_TAIL ); + break; + + case MUIV_NListtree_Move_NewTreeNode_Active: + tn2 = data->ActiveNode; + break; + + case MUIV_NListtree_Move_NewTreeNode_Sorted: + tn2 = GetInsertNodeSorted( data, ln2, tn1 ); + break; + + default: + tn2 = msg->NewTreeNode; + break; + } + + + if ( tn1 != tn2 ) + { + DoQuiet( data, TRUE ); + + //D(bug( "1: L: %s, N: %s - 2: L: %s, N: %s\n", ln1->ln_Name, tn1->tn_Name, ln2->ln_Name, ( (ULONG)tn2 == INSERT_POS_TAIL ) ? "TAIL" : ( (ULONG)tn2 == INSERT_POS_HEAD ) ? "HEAD" : tn2->tn_Name ) ); + + /* + ** Remove the entry visible and from list. + */ + NLRemoveFromTable( data, &ln1->ln_Table, tn1 ); + RemoveTreeNodeVisible( data, tn1, NULL ); + Remove( (struct Node *)&tn1->tn_Node ); + + + /* + ** Create structure identical to source. + */ + if ( msg->Flags & MUIV_NListtree_Move_Flag_KeepStructure ) + { + tn1 = CTN( CreateParentStructure( data, msg->MethodID, &ln2, &tn2, tn1, 0 ) ); + } + + if ( tn1 ) + { + /* + ** Insert entry into list. + */ + InsertTreeNode( data, ln2, tn1, tn2 ); + } + + DoRefresh( data ); + + if ( tn1 == data->ActiveNode ) + nnset( obj, MUIA_NListtree_Active, tn1 ); + + DoQuiet( data, FALSE ); + } + + D(DBF_LISTTREE, "MUIM_NListtree_Move End"); + + return( 0 ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_Copy ************************************ +* +* NAME +* +* MUIM_NListtree_Copy -- Copy an entry (create it) to the spec. pos. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_Copy, +* struct MUI_NListtree_TreeNode *srclistnode, +* struct MUI_NListtree_TreeNode *srctreenode, +* struct MUI_NListtree_TreeNode *destlistnode, +* struct MUI_NListtree_TreeNode *desttreenode, +* ULONG flags); +* +* +* FUNCTION +* +* Copy an entry to the position after a defined node. The complete +* child structure will be copied. +* +* +* INPUTS +* +* srclistnode - Specify the node which list is used to find the +* entry. The search is started at the head of this +* list. +* +* MUIV_NListtree_Copy_SourceListNode_Root +* The root list is used as the starting point. +* +* MUIV_NListtree_Copy_SourceListNode_Active +* The active list (the list of the active node) is used as +* the starting point. +* +* srctreenode - Specifies the node which should be copied. +* +* MUIV_NListtree_Copy_SourceTreeNode_Head +* The head of the list defined in 'srclistnode' is copied. +* +* MUIV_NListtree_Copy_SourceTreeNode_Tail +* The tail of the list defined in 'srclistnode' is copied. +* +* MUIV_NListtree_Copy_SourceTreeNode_Active +* The active node is copied. +* +* destlistnode - Specify the node which list is used to find the +* entry. The search is started at the head of this +* list. +* +* MUIV_NListtree_Copy_DestListNode_Root +* The root list. +* +* MUIV_NListtree_Copy_DestListNode_Active +* The list of the active node. +* +* desttreenode - This node is the predecessor of the entry which is +* inserted. +* +* MUIV_NListtree_Copy_DestTreeNode_Head +* The node is copied to the head of the list defined in +* 'destlistnode'. +* +* MUIV_NListtree_Copy_DestTreeNode_Tail +* The node is copied to the tail of the list defined in +* 'destlistnode'. +* +* MUIV_NListtree_Copy_DestTreeNode_Active: +* The node is copied to one entry after the active node. +* +* MUIV_NListtree_Copy_DestTreeNode_Sorted: +* The node is copied to the list using the sort hook. +* +* flags - Some flags to adjust moving. +* +* MUIV_NListtree_Copy_Flag_KeepStructure +* The full tree structure from the selected entry to +* the root list is copied (created) at destination. +* +* +* RESULT +* +* EXAMPLE +* +* // Copy the active entry to the head of +* // another list node. +* DoMethod(obj, +* MUIV_NListtree_Copy_SourceListNode_Active, +* MUIV_NListtree_Copy_SourceTreeNode_Active, +* anylistnode, +* MUIV_NListtree_Copy_DestTreeNode_Head, +* 0); +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NListtree_Insert, MUIM_NListtree_Remove, +* MUIM_NListtree_Exchange, MUIA_NListtree_CompareHook, +* MUIM_NListtree_Move +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_Copy(struct IClass *cl, Object *obj, struct MUIP_NListtree_Copy *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_ListNode *ln1, *ln2; + struct MUI_NListtree_TreeNode *tn1, *tn2; + + + /* + ** Handle all special events. + */ + switch( (IPTR)msg->SourceListNode ) + { + case MUIV_NListtree_Copy_SourceListNode_Root: + ln1 = &data->RootList; + break; + + case MUIV_NListtree_Copy_SourceListNode_Active: + ln1 = data->ActiveList; + break; + + default: + ln1 = CLN( msg->SourceListNode ); + break; + } + + switch( (IPTR)msg->SourceTreeNode ) + { + case MUIV_NListtree_Copy_SourceTreeNode_Head: + tn1 = CTN( GetHead( (struct List *)&ln1->ln_List ) ); + break; + + case MUIV_NListtree_Copy_SourceTreeNode_Tail: + tn1 = CTN( GetTail( (struct List *)&ln1->ln_List ) ); + break; + + case MUIV_NListtree_Copy_SourceTreeNode_Active: + tn1 = data->ActiveNode; + break; + + default: + tn1 = msg->SourceTreeNode; + break; + } + + switch( (IPTR)msg->DestListNode ) + { + case MUIV_NListtree_Copy_DestListNode_Root: + ln2 = &data->RootList; + break; + + case MUIV_NListtree_Copy_DestListNode_Active: + ln2 = data->ActiveList; + break; + + default: + ln2 = CLN( msg->DestListNode ); + break; + } + + switch( (IPTR)msg->DestTreeNode ) + { + case MUIV_NListtree_Copy_DestTreeNode_Head: + tn2 = CTN( INSERT_POS_HEAD ); + break; + + case MUIV_NListtree_Copy_DestTreeNode_Tail: + tn2 = CTN( INSERT_POS_TAIL ); + break; + + case MUIV_NListtree_Copy_DestTreeNode_Active: + tn2 = data->ActiveNode; + break; + + case MUIV_NListtree_Copy_DestTreeNode_Sorted: + tn2 = GetInsertNodeSorted( data, ln2, tn1 ); + break; + + default: + tn2 = msg->DestTreeNode; + break; + } + + + if ( tn1 != tn2 ) + { + struct MUI_NListtree_TreeNode *savetn1 = tn1; + + //D(bug( "1: L: %s, N: %s - 2: L: %s, N: %s\n", ln1->ln_Name, tn1->tn_Name, ln2->ln_Name, ( (ULONG)tn2 == INSERT_POS_TAIL ) ? "TAIL" : tn2->tn_Name ) ); + + /* + ** Create structure identical to source. + */ + if ( msg->Flags & MUIV_NListtree_Copy_Flag_KeepStructure ) + { + tn1 = CTN( CreateParentStructure( data, msg->MethodID, &ln2, &tn2, tn1, 0 ) ); + } + else + { + tn1 = DuplicateNode(data, tn1); + } + + tn1 = CreateChildStructure( data, ln2, CLN( tn1 ), CLN( savetn1 ), 0 ); + + DoRefresh( data ); + + /* + if ( tn1 == data->ActiveNode ) + nnset( obj, MUIA_NListtree_Active, tn1 ); + */ + } + + return( 0 ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_Rename ********************************** +* +* NAME +* +* MUIM_NListtree_Rename -- Rename the specified node. (V1) +* +* +* SYNOPSIS +* +* struct MUI_NListtree_TreeNode *treenode = +* DoMethod(obj, MUIM_NListtree_Rename, +* struct MUI_NListtree_TreeNode *treenode, +* STRPTR newname, ULONG flags); +* +* +* FUNCTION +* +* Rename the specified node. +* +* If you want to rename the tn_User field (see flags below), the construct +* and destruct hooks are used! +* If you have not specified these hooks, only the pointers will be copied. +* +* +* INPUTS +* +* treenode - Specifies the node which should be renamed. +* +* MUIV_NListtree_Rename_TreeNode_Active: +* Rename the active tree node. +* +* newname - The new name or pointer. +* +* flags: +* +* MUIV_NListtree_Rename_Flag_User +* The tn_User field is renamed. +* +* MUIV_NListtree_Rename_Flag_NoRefresh +* The list entry will not be refreshed. +* +* +* RESULT +* +* Returns the pointer of the renamed tree node. +* +* +* EXAMPLE +* +* // Rename the active tree node. +* DoMethod(obj, MUIM_NListtree_Rename, +* MUIV_NListtree_Rename_TreeNode_Active, +* "Very new name", 0); +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIA_NListtree_ConstructHook, MUIA_NListtree_DestructHook +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_Rename(struct IClass *cl, Object *obj, struct MUIP_NListtree_Rename *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_TreeNode *tn; + + + /* + ** Handle special events. + */ + if ( (IPTR)msg->TreeNode == (IPTR)MUIV_NListtree_Rename_TreeNode_Active ) + tn = data->ActiveNode; + else + tn = msg->TreeNode; + + /* + ** User wants to rename the user field instead of name field. + */ + if ( msg->Flags & MUIV_NListtree_Rename_Flag_User ) + { + //D(bug( "Node: 0x%08lx - %s - Renaming user field\n", tn, tn->tn_Name ) ); + + DoMethod(obj, MUIM_NListtree_Destruct, tn->tn_Name, tn->tn_User, data->TreePool, 0); + + /* + ** Construct new user data + */ + tn->tn_User = (APTR)DoMethod(obj, MUIM_NListtree_Construct, tn->tn_Name, msg->NewName, data->TreePool, 0); + } + else + { + //D(bug( "Node: 0x%08lx - %s - Renaming name field from \"%s\" to \"%s\"\n", tn, tn->tn_Name, tn->tn_Name, msg->NewName ) ); + + /* + ** Should we duplicate the supplied node name? + */ + if ( data->Flags & NLTF_DUPNODENAMES ) + { + int len = strlen( msg->NewName ) + 1; + + FreeVecPooled( data->TreePool, tn->tn_Name ); + + tn->tn_Name = (STRPTR)AllocVecPooled( data->TreePool, len ); + strlcpy( tn->tn_Name, msg->NewName, len ); + tn->tn_IFlags |= TNIF_ALLOCATED; + } + else + tn->tn_Name = msg->NewName; + } + + if ( !( msg->Flags & MUIV_NListtree_Rename_Flag_NoRefresh ) && ( tn->tn_IFlags & TNIF_VISIBLE ) ) + DoMethod( obj, MUIM_NList_Redraw, GetVisualPos( data, tn ) ); + + return( (IPTR)tn ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_FindName ******************************** +* +* NAME +* +* MUIM_NListtree_FindName -- Find node using name match. (V1) +* +* +* SYNOPSIS +* +* struct MUI_NListtree_TreeNode *treenode = +* DoMethod(obj, MUIM_NListtree_FindName, +* struct MUI_NListtree_TreeNode *listnode, +* STRPTR name, ULONG flags); +* +* +* FUNCTION +* +* Find a node which name matches the specified one using the list node as +* start point.. +* +* +* INPUTS +* listnode - Specify the node which list is used to find the name. +* +* MUIV_NListtree_FindName_ListNode_Root +* Use the root list as the base list. +* +* MUIV_NListtree_FindName_ListNode_Active +* Use the list of the active node as the base. +* +* name - Specify the name of the node to find. But you can search +* for anything in tn_Name or tn_User field here by simply +* supplying the searched data and handling it in your +* own FindNameHook. +* +* flags: +* +* MUIV_NListtree_FindName_Flag_SameLevel +* Only nodes on the same level are affected. +* +* MUIV_NListtree_FindName_Flag_Visible +* The node is only returned if it is visible (only visible +* entries are checked). +* +* MUIV_NListtree_FindName_Flag_Activate +* If found, the entry will be activated. +* +* MUIV_NListtree_FindName_Flag_Selected +* Find only selected nodes. +* +* MUIV_NListtree_FindName_Flag_StartNode +* The specified entry in listnode is the start point for +* search and must not be a list node. It can also be a +* normal entry. +* +* RESULT +* +* Returns the found node if available, NULL otherwise. +* +* +* EXAMPLE +* +* // Find 2nd node by name. +* struct MUI_NListtree_TreeNode *treenode = +* DoMethod(obj, MUIM_NListtree_FindName, +* listnode, "2nd node", +* MUIV_NListtree_FindName_SameLevel| +* MUIV_NListtree_FindName_Visible); +* +* if ( treenode == NULL ) +* { +* PrintToUser( "No matching entry found." ); +* } +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NListtree_FindUserData, MUIM_NListtree_GetEntry, +* MUIA_NListtree_FindNameHook +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_FindName(struct IClass *cl, Object *obj, struct MUIP_NListtree_FindName *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_ListNode *ln; + struct MUI_NListtree_TreeNode *tn; + + + /* + ** Handle special events. + */ + switch( (IPTR)msg->ListNode ) + { + case MUIV_NListtree_FindName_ListNode_Root: + ln = &data->RootList; + break; + + case MUIV_NListtree_FindName_ListNode_Active: + ln = data->ActiveList; + break; + + default: + ln = CLN( msg->ListNode ); + break; + } + + //D(bug( "StartNode: 0x%08lx - %s - Searching for \"%s\"\n", ln, ln->ln_Name, msg->Name ) ); + + if ( msg->Flags & MUIV_NListtree_FindName_Flag_Reverse ) + { + if((tn = FindTreeNodeByNameRev(data, ln, msg->Name, msg->Flags))) + if ( msg->Flags & MUIV_NListtree_FindName_Flag_Activate ) + nnset( obj, MUIA_NListtree_Active, tn ); + } + else + { + if((tn = FindTreeNodeByName(data, ln, msg->Name, msg->Flags))) + if ( msg->Flags & MUIV_NListtree_FindName_Flag_Activate ) + nnset( obj, MUIA_NListtree_Active, tn ); + } + + return( (IPTR)tn ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_FindUserData **************************** +* +* NAME +* +* MUIM_NListtree_FindUserData -- Find node upon user data. (V1) +* +* +* SYNOPSIS +* +* struct MUI_NListtree_TreeNode *treenode = +* DoMethod(obj, MUIM_NListtree_FindUserData, +* struct MUI_NListtree_TreeNode *listnode, +* APTR userdata, ULONG flags); +* +* +* FUNCTION +* +* Find a node which user data matches the specified one using the list +* node as start point.. +* This method is designed as a second possibility for searching. +* Because you are able to search for anything, you may set special +* hooks for searching two different fields in two different hooks with +* these two methods. +* +* +* INPUTS +* listnode - Specify the node which list is used to find the user data. +* +* MUIV_NListtree_FindUserData_ListNode_Root +* Use the root list as the base list. +* +* MUIV_NListtree_FindUserData_ListNode_Active +* Use the list of the active node as the base. +* +* userdata - Specify the user data of the node to find. You can search +* for anything in tn_Name or tn_User field here by simply +* supplying the searched data and handling it in your +* own FindUserDataHook. +* +* flags: +* +* MUIV_NListtree_FindUserData_Flag_SameLevel +* Only nodes on the same level are affected. +* +* MUIV_NListtree_FindUserData_Flag_Visible +* The node is only returned if it is visible (only visible +* entries are checked). +* +* MUIV_NListtree_FindUserData_Flag_Activate +* If found, the entry will be activated. +* +* MUIV_NListtree_FindUserData_Flag_Selected +* Find only selected nodes. +* +* MUIV_NListtree_FindUserData_Flag_StartNode +* The specified entry in listnode is the start point for +* search and must not be a list node. It can also be a +* normal entry. +* +* RESULT +* +* Returns the found node if available, NULL otherwise. +* +* +* EXAMPLE +* +* // Find node by user data. +* struct MUI_NListtree_TreeNode *treenode = +* DoMethod(obj, MUIM_NListtree_FindUserData, +* listnode, "my data", +* MUIV_NListtree_FindUserData_SameLevel| +* MUIV_NListtree_FindUserData_Visible); +* +* if ( treenode == NULL ) +* { +* PrintToUser( "No matching entry found." ); +* } +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NListtree_FindName, MUIM_NListtree_GetEntry, +* MUIA_NListtree_FindUserDataHook +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_FindUserData(struct IClass *cl, Object *obj, struct MUIP_NListtree_FindUserData *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_ListNode *ln; + struct MUI_NListtree_TreeNode *tn; + + + /* + ** Handle special events. + */ + switch( (IPTR)msg->ListNode ) + { + case MUIV_NListtree_FindUserData_ListNode_Root: + ln = &data->RootList; + break; + + case MUIV_NListtree_FindUserData_ListNode_Active: + ln = data->ActiveList; + break; + + default: + ln = CLN( msg->ListNode ); + break; + } + + //D(bug( "StartNode: 0x%08lx - %s - Searching for \"%s\"\n", ln, ln->ln_Name, (STRPTR)msg->User ) ); + + if ( msg->Flags & MUIV_NListtree_FindUserData_Flag_Reverse ) + { + if((tn = FindTreeNodeByUserDataRev(data, ln, msg->User, msg->Flags))) + if ( msg->Flags & MUIV_NListtree_FindUserData_Flag_Activate ) + nnset( obj, MUIA_NListtree_Active, tn ); + } + else + { + if((tn = FindTreeNodeByUserData(data, ln, msg->User, msg->Flags))) + if ( msg->Flags & MUIV_NListtree_FindUserData_Flag_Activate ) + nnset( obj, MUIA_NListtree_Active, tn ); + } + + return( (IPTR)tn ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_GetEntry ******************************** +* +* NAME +* +* MUIM_NListtree_GetEntry -- Get another node in relation to this. (V1) +* +* +* SYNOPSIS +* +* struct MUI_NListtree_TreeNode *rettreenode = +* DoMethod(obj, MUIM_NListtree_GetEntry, +* struct MUI_NListtree_TreeNode *treenode, +* LONG pos, ULONG flags); +* +* +* FUNCTION +* +* Get another node in relation to the specified list or node. +* +* +* INPUTS +* +* treenode - Define the node which is used to find another one. +* This can also be a list node, if the position is +* related to a list. +* +* MUIV_NListtree_GetEntry_ListNode_Root +* The root list is used. +* +* MUIV_NListtree_GetEntry_ListNode_Active: +* The list with the active entry is used. +* +* pos - The relative position of the node 'treenode'. +* +* MUIV_NListtree_GetEntry_Position_Head +* The head of the list is returned. +* +* MUIV_NListtree_GetEntry_Position_Tail +* The tail of the list is returned. +* +* MUIV_NListtree_GetEntry_Position_Active +* The active node is returned. If there is no active entry, +* NULL is returned. +* +* MUIV_NListtree_GetEntry_Position_Next +* The node next to the specified node is returned. Returns NULL +* if there is no next entry. +* +* MUIV_NListtree_GetEntry_Position_Previous +* The node right before the specified node is returned. +* Returns NULL if there is no previous entry (if 'treenode' +* is the head of the list. +* +* MUIV_NListtree_GetEntry_Position_Parent +* The list node of the specified 'treenode' is returned. +* +* flags: +* +* MUIV_NListtree_GetEntry_Flag_SameLevel: +* Only nodes in the same level are affected. +* +* MUIV_NListtree_GetEntry_Flag_Visible: +* The position is counted on visible entries only. +* +* +* RESULT +* +* Returns the requested node if available, NULL otherwise. +* +* +* EXAMPLE +* +* // Get the next entry. +* struct MUI_NListtree_TreeNode *treenode = +* DoMethod(obj, MUIM_NListtree_GetEntry, treenode, +* MUIV_NListtree_GetEntry_Position_Next, 0); +* +* if ( treenode ) +* { +* PrintToUser( "Next entry found!" ); +* } +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NList_GetEntry +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_GetEntry(struct IClass *cl, Object *obj, struct MUIP_NListtree_GetEntry *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_TreeNode *tn = NULL; + struct MUI_NListtree_ListNode *ln; + LONG pos = 0; + + /* + ** Handle special events. + */ + switch( (IPTR)msg->Node ) + { + case MUIV_NListtree_GetEntry_ListNode_Root: + ln = &data->RootList; + break; + + case MUIV_NListtree_GetEntry_ListNode_Active: + ln = data->ActiveList; + break; + + case -1: + ln = data->ActiveList; + break; + + default: + ln = CLN( msg->Node ); + break; + } + + switch( (IPTR)(SIPTR)msg->Position ) + { + case MUIV_NListtree_GetEntry_Position_Head: + + if ( ln->ln_Flags & TNF_LIST ) + tn = CTN( GetHead( (struct List *)&ln->ln_List ) ); + break; + + case MUIV_NListtree_GetEntry_Position_Tail: + + if ( ln->ln_Flags & TNF_LIST ) + tn = CTN( GetTail( (struct List *)&ln->ln_List ) ); + break; + + case MUIV_NListtree_GetEntry_Position_Active: + + tn = data->ActiveNode; + break; + + case MUIV_NListtree_GetEntry_Position_Next: + + tn = CTN( GetSucc( (struct Node *)&ln->ln_Node ) ); + break; + + case MUIV_NListtree_GetEntry_Position_Previous: + + tn = CTN( GetPred( (struct Node *)&ln->ln_Node ) ); + break; + + case MUIV_NListtree_GetEntry_Position_Parent: + + tn = GetParent( CTN( ln ) ); + break; + + case MUIV_NListtree_GetEntry_Position_Root: + + tn = CTN( (APTR)&data->RootList ); + break; + + default: + tn = GetEntryByTotalPos( ln, msg->Position, &pos, msg->Flags ); + break; + } + + //D(bug( "ListNode: 0x%08lx - Pos: 0x%08lx, Flags: 0x%08lx ==> Entry: 0x%08lx\n", msg->Node, msg->Position, msg->Flags, tn ) ); + + return( (IPTR)tn ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_GetNr *********************************** +* +* NAME +* +* MUIM_NListtree_GetNr -- Get the position number of a tree node. (V1) +* +* +* SYNOPSIS +* +* ULONG number = DoMethod(obj, MUIM_NListtree_GetNr, +* struct MUI_NListtree_TreeNode *treenode, ULONG flags); +* +* +* FUNCTION +* +* Get the position number of the specified tree node. +* +* +* INPUTS +* +* treenode - Specify the node to count the position of. +* +* MUIV_NListtree_GetNr_TreeNode_Active: +* The position is counted related to the active node. +* +* MUIV_NListtree_GetNr_TreeNode_Root: +* The position is counted related to the root list. +* +* flags: +* +* MUIV_NListtree_GetNr_Flag_CountAll +* Returns the number of all entries. +* +* MUIV_NListtree_GetNr_Flag_CountLevel +* Returns the number of entries of the list the +* specified node is in. +* +* MUIV_NListtree_GetNr_Flag_CountList +* Returns the number of entries in the specified +* treenode if it holds other entries/is a list. +* +* MUIV_NListtree_GetNr_Flag_ListEmpty +* Returns TRUE if the specified list node is empty. +* +* MUIV_NListtree_GetNr_Flag_Visible +* Returns the position number of an visible entry. -1 if the +* entry is invisible. The position is counted on visible entries +* only. +* +* +* RESULT +* +* EXAMPLE +* +* // Check if the active (list) node is empty. +* ULONG empty = DoMethod(obj, MUIM_NListtree_GetNr, +* MUIV_NListtree_GetNr_TreeNode_Active, +* MUIV_NListtree_GetNr_Flag_ListEmpty); +* +* if ( empty == TRUE ) +* { +* AddThousandEntries(); +* } +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NListtree_GetEntry +* +****************************************************************************** +* +*/ +IPTR _NListtree_GetNr(struct IClass *cl, Object *obj, struct MUIP_NListtree_GetNr *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_TreeNode *tn; + struct MUI_NListtree_ListNode *ln; + IPTR ret = 0; + LONG pos = 0; + + D(DBF_LISTTREE, "GetNr: NListtree entries %ld",data->NumEntries); + + /* + ** Handle special events. + */ + if ( (IPTR)msg->TreeNode == (IPTR)MUIV_NListtree_GetNr_TreeNode_Active ) + tn = data->ActiveNode; + else if ( (IPTR)msg->TreeNode == (IPTR)MUIV_NListtree_GetNr_TreeNode_Root ) + tn = CTN((APTR)&data->RootList); + else + tn = msg->TreeNode; + + ln = CLN( GetParent( tn ) ); + + if ( msg->Flags & MUIV_NListtree_GetNr_Flag_ListEmpty ) + { + if ( tn->tn_Flags & TNF_LIST ) + ret = IsListEmpty( ((struct List *)&CLN(tn)->ln_List) ); + } + + else if ( msg->Flags & MUIV_NListtree_GetNr_Flag_CountList ) + { + if ( tn->tn_Flags & TNF_LIST ) + ret = CLN(tn)->ln_Table.tb_Entries; + } + + else if ( ln && (msg->Flags & MUIV_NListtree_GetNr_Flag_CountLevel) ) + { + ret = ln->ln_Table.tb_Entries; + } + + else if ( msg->Flags & MUIV_NListtree_GetNr_Flag_CountAll ) + { + ret = data->NumEntries; + } + + else if ( msg->Flags & MUIV_NListtree_GetNr_Flag_Visible ) + { + ret = (IPTR)GetVisualPos( data, tn ); + } + + else + { + ret = (IPTR)-1; + + if ( GetEntryPos( &data->RootList, tn, &pos ) ) + ret = pos; + } + + //D(bug( "Node: 0x%08lx - %s - Flags: 0x%08lx ==> Nr: %ld\n", tn, tn->tn_Name, msg->Flags, ret ) ); + + return( (IPTR)ret ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_Sort ************************************ +* +* NAME +* +* MUIM_NListtree_Sort -- Sort the specified list node. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_Sort, +* struct MUI_NListtree_TreeNode *listnode, +* ULONG flags); +* +* +* FUNCTION +* +* Sort the specified list node using the sort hook. +* +* +* INPUTS +* +* listnode - List node to sort. +* +* MUIV_NListtree_Sort_ListNode_Root +* Sort the root list. +* +* MUIV_NListtree_Sort_ListNode_Active +* Sort the list node of the active entry. +* +* MUIV_NListtree_Sort_TreeNode_Active +* Sorts the childs of the active entry if a list. +* +* flags - Control the part where sorting is done. +* +* MUIV_NListtree_Sort_Flag_RecursiveOpen +* Sort the list recursive. All open child nodes of the +* node specified in 'listnode' will be sorted too. +* +* MUIV_NListtree_Sort_Flag_RecursiveAll +* Sort the list recursive with ALL child nodes of the +* node specified in 'listnode'. +* +* RESULT +* +* EXAMPLE +* +* // Sort the list of the active node. +* DoMethod(obj, MUIM_NListtree_Sort, +* MUIV_NListtree_Sort_ListNode_Active, 0); +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIA_NListtree_SortHook +* +****************************************************************************** +* +*/ +IPTR _NListtree_Sort(struct IClass *cl, Object *obj, struct MUIP_NListtree_Sort *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_ListNode *ln; + LONG pos; + + /* + ** Handle special events. + */ + switch( (IPTR)msg->ListNode ) + { + case MUIV_NListtree_Sort_ListNode_Active: + ln = data->ActiveList; + break; + + case MUIV_NListtree_Sort_ListNode_Root: + ln = &data->RootList; + break; + + case MUIV_NListtree_Sort_TreeNode_Active: + ln = data->ActiveList; + + if ( data->ActiveNode ) + { + if ( data->ActiveNode->tn_Flags & TNF_LIST ) + ln = CLN( data->ActiveNode ); + } + break; + + default: + ln = CLN( msg->ListNode ); + break; + } + + pos = GetVisualPos( data, CTN( ln ) ) + 1; + + DoQuiet( data, TRUE ); + DeactivateNotify( data ); + + ListNode_Sort( ln, data, msg->Flags ); + ReplaceTreeVisibleSort( data, CTN( ln ), &pos ); + + ActivateNotify( data ); + DoQuiet( data, FALSE ); + + /* sba: the active note could be changed, but the notify calling was disabled */ + DoMethod(data->Obj, MUIM_NListtree_GetListActive, 0); + +/* nnset( obj, MUIA_NListtree_Active, CTN( data->ActiveNode ) );*/ + + return( 0 ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_TestPos ********************************* +* +* NAME +* +* MUIM_NListtree_TestPos -- Get information about entry at x/y pos. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_TestPos, LONG xpos, LONG ypos, +* struct MUI_NListtree_TestPos_Result *testposresult); +* +* +* FUNCTION +* +* Find out some information about the currently displayed entry at a +* certain position (x/y-pos). +* +* This is very useful for Drag&Drop operations. +* +* +* INPUTS +* +* xpos - X-position. +* ypos - Y-position. +* testposresult - Pointer to a valid MUI_NListtree_TestPos_Result +* structure. +* +* +* RESULT +* +* tpr_TreeNode - The tree node under the requested position or NULL +* if there is no entry displayed. +* +* The tpr_Type field contains detailed information about the relative +* position: +* +* MUIV_NListtree_TestPos_Result_Above +* MUIV_NListtree_TestPos_Result_Below +* MUIV_NListtree_TestPos_Result_Onto +* MUIV_NListtree_TestPos_Result_Sorted +* +* tpr_Column - The column unter the specified position or -1 if +* no valid column. +* +* +* EXAMPLE +* +* // Entry under the cursor? +* struct MUI_NListtree_TestPos_Result tpres; +* +* DoMethod(obj, MUIM_NListtree_TestPos, msg->imsg->MouseX, +* msg->imsg->MouseY, &tpres); +* +* if ( tpres.tpr_Entry != NULL ) +* { +* // Do something very special here... +* } +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NList_TestPos +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_TestPos( UNUSED struct IClass *cl, Object *obj, struct MUIP_NListtree_TestPos *msg) +{ + struct MUI_NListtree_TestPos_Result *res = (struct MUI_NListtree_TestPos_Result *)msg->Result; + struct MUI_NList_TestPos_Result lres; + + lres.char_number = -2; + + DoMethod( obj, MUIM_NList_TestPos, msg->X, msg->Y, &lres ); + + if ( lres.entry != -1 ) + { + DoMethod( obj, MUIM_NList_GetEntry, lres.entry, &res->tpr_TreeNode ); + + if ( lres.yoffset < -3 ) res->tpr_Type = MUIV_NListtree_TestPos_Result_Above; + else if ( lres.yoffset > 3 ) res->tpr_Type = MUIV_NListtree_TestPos_Result_Below; + else res->tpr_Type = MUIV_NListtree_TestPos_Result_Onto; + + res->tpr_ListEntry = lres.entry; + res->tpr_ListFlags = lres.flags; + res->tpr_Column = lres.column; + } + else + { + res->tpr_TreeNode = NULL; + res->tpr_Type = 0; + + res->tpr_ListEntry = -1; + res->tpr_ListFlags = 0; + res->tpr_Column = -1; + } + + //D(bug( "X: %ld, Y: %ld ==> Node: 0x%08lx - %s - YOffset: %ld, Type: 0x%08lx\n", msg->X, msg->Y, res->tpr_TreeNode, res->tpr_TreeNode->tn_Name, lres.yoffset, res->tpr_Type ) ); + + + return( 0 ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_Redraw ********************************** +* +* NAME +* +* MUIM_NListtree_Redraw -- Redraw the specified tree node. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_Redraw, +* struct MUI_NListtree_TreeNode *treenode, ULONG flags); +* +* +* FUNCTION +* +* Redraw the specified entry. See special values for completeness. +* +* +* INPUTS +* +* treenode - The tree node to be redrawn. +* +* MUIV_NListtree_Redraw_Active +* Redraw the active entry. +* +* MUIV_NListtree_Redraw_All +* Redraw the complete visible tree. +* +* +* flags: +* +* MUIV_NListtree_Redraw_Flag_Nr +* The data specified in 'treenode' is the entry number, +* not the tree node itself. +* +* +* RESULT +* +* EXAMPLE +* +* // Redraw the active entry. +* DoMethod(obj, MUIM_NListtree_Redraw, +* MUIV_NListtree_Redraw_Active, 0); +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NList_TestPos +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_Redraw(struct IClass *cl, Object *obj, struct MUIP_NListtree_Redraw *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + + //D(bug( "TreeNode: 0x%08lx (pos: %ld), Flags: 0x%08lx (%s)\n", msg->TreeNode, GetVisualPos( data, msg->TreeNode ), msg->Flags, ( msg->Flags & MUIV_NListtree_Redraw_Flag_Nr ) ? "NR" : "" ) ); + + if(((IPTR)msg->TreeNode != (IPTR)MUIV_NListtree_Redraw_Active) && ((IPTR)msg->TreeNode != (IPTR)MUIV_NListtree_Redraw_All) && !(msg->Flags & MUIV_NListtree_Redraw_Flag_Nr)) + { + LONG pos; + + // redraw the given node only if it is visible + if((pos = GetVisualPos(data, msg->TreeNode)) != -1) + DoMethod(obj, MUIM_NList_Redraw, pos); + } + else + { + D(DBF_DRAW, "EXTERNAL REDRAW REQUESTED!"); + DoMethod( obj, MUIM_NList_Redraw, (IPTR)msg->TreeNode ); + } + + return(0); +} + + + +/****** NListtree.mcc/MUIM_NListtree_Select ********************************** +* +* NAME +* +* MUIM_NListtree_Select -- Select the specified tree node. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_Select, +* struct MUI_NListtree_TreeNode *treenode, LONG seltype, +* LONG selflags, LONG *state); +* +* +* FUNCTION +* +* Select or unselect a tree entry or ask an entry about its state. +* See special values for completeness. +* +* +* INPUTS +* +* treenode - The tree node to be selected/unselected/asked. +* +* MUIV_NListtree_Select_Active For the active entry. +* MUIV_NListtree_Select_All For all entries. +* MUIV_NListtree_Select_Visible For all visible entries. +* +* seltype - Type of selection/unselection/ask +* +* MUIV_NListtree_Select_Off Unselect entry. +* MUIV_NListtree_Select_On Select entry. +* MUIV_NListtree_Select_Toggle Toggle entries state. +* MUIV_NListtree_Select_Ask Just ask about the state. +* +* selflags - Some kind of specials. +* +* MUIV_NListtree_Select_Flag_Force +* Adding this flag to seltype forces the selection by +* bypassing the multi test hook. +* +* state - Pointer to a longword. If not NULL, it will be filled +* with the current selection state of the entry. +* +* +* RESULT +* +* EXAMPLE +* +* // Select the active entry. +* LONG retstate; +* +* DoMethod(obj, MUIM_NListtree_Select, +* MUIV_NListtree_Select_Active, MUIV_NListtree_Select_On, +* 0, &retstate); +* +* // We must check this, because the multi test hook may +* // cancel our selection. +* if (retstate == MUIV_NListtree_Select_On) { +* ... +* } +* +* +* NOTES +* +* If ( treenode == MUIV_NListtree_Select_All ) and +* ( seltype == MUIV_NListtree_Select_Ask ), state will be filled +* with the total number of selected entries. +* +* NEW for final 18.6: +* If (treenode == MUIV_NListtree_Select_Active ) and +* ( seltype == MUIV_NListtree_Select_Ask ), state will be the +* active entry, if any, or NULL. +* +* If only the active entry is selected, has a cursor mark (see +* MUIM_NListtree_NextSelected for that), you will receive 0 as +* the number of selected entries. +* +* +* BUGS +* +* SEE ALSO +* +* MUIA_NListtree_MultiTestHook +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_Select(struct IClass *cl, Object *obj, struct MUIP_NListtree_Select *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + LONG state = 0; + + ENTER(); + + data->Flags |= NLTF_SELECT_METHOD; + + /* + ** Handle special events. + */ + switch( (IPTR)msg->TreeNode ) + { + case MUIV_NListtree_Select_Active: + if ( msg->SelType == MUIV_NListtree_Select_Ask ) + { + state = (LONG)(SIPTR)data->ActiveNode; + } + else + { + if ( data->ActiveNode ) + { + TreeNodeSelect( data, data->ActiveNode, msg->SelType, msg->SelFlags, &state ); + } + } + break; + + case MUIV_NListtree_Select_All: + + if ( msg->SelType == MUIV_NListtree_Select_Ask ) + { + state = data->SelectedTable.tb_Entries; + } + else + { + TreeNodeSelectAll( data, &data->RootList, msg->SelType, msg->SelFlags, &state ); + } + break; + + case MUIV_NListtree_Select_Visible: + TreeNodeSelectVisible( data, &data->RootList, msg->SelType, msg->SelFlags, &state ); + break; + + default: + TreeNodeSelect( data, msg->TreeNode, msg->SelType, msg->SelFlags, &state ); + break; + } + + if ( msg->State ) + { + *msg->State = state; + } + + data->Flags &= ~NLTF_SELECT_METHOD; + + RETURN(state); + return( (IPTR)state ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_NextSelected **************************** +* +* NAME +* +* MUIM_NListtree_NextSelected -- Get next selected tree node. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_NextSelected, +* struct MUI_NListtree_TreeNode **treenode); +* +* +* FUNCTION +* +* Iterate through the selected entries of a tree. This method steps +* through the contents of a (multi select) list tree and returns +* every entry that is currently selected. When no entry is selected +* but an entry is active, only the active entry will be returned. +* +* This behaviour will result in not returning the active entry when +* you have some other selected entries somewhere in your list. Since +* the active entry just acts as some kind of cursor mark, this seems +* to be the only sensible possibility to handle multi selection +* together with keyboard control. +* +* +* INPUTS +* +* treenode - A pointer to a pointer of struct MUI_NListtree_TreeNode +* that will hold the returned entry. Must be set to +* MUIV_NListtree_NextSelected_Start at start of iteration +* and is set to MUIV_NListtree_NextSelected_End when +* iteration is finished. +* +* MUIV_NListtree_NextSelected_Start Set this to start iteration. +* MUIV_NListtree_NextSelected_End Will be set to this, if +* last selected entry reached. +* +* +* RESULT +* +* EXAMPLE +* +* // Iterate through a list +* struct MUI_NListtree_TreeNode *treenode; +* +* treenode = MUIV_NListtree_NextSelected_Start; +* +* for (;;) +* { +* DoMethod(listtree, MUIM_NListtree_NextSelected, &treenode); +* +* if (treenode==MUIV_NListtree_NextSelected_End) +* break; +* +* printf("selected: %s\n", treenode->tn_Name); +* } +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NListtree_PrevSelected, MUIM_NListtree_Select +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_NextSelected(struct IClass *cl, Object *obj, struct MUIP_NListtree_NextSelected *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + LONG curr = data->SelectedTable.tb_Current; + + //D(bug( "TreeNode: 0x%08lx ", *msg->TreeNode ) ); + + if ( (IPTR)*msg->TreeNode == (IPTR)MUIV_NListtree_NextSelected_Start ) + curr = 0; + else + curr++; + + if ( ( curr > -1 ) && data->SelectedTable.tb_Entries ) + { + if ( curr < data->SelectedTable.tb_Entries ) + { + data->SelectedTable.tb_Current = curr; + *msg->TreeNode = data->SelectedTable.tb_Table[curr]; + } + else if(((IPTR)*msg->TreeNode == (IPTR)MUIV_NListtree_NextSelected_Start) && + (data->ActiveNode != MUIV_NListtree_Active_Off)) + { + *msg->TreeNode = data->ActiveNode; + } + else + { + *msg->TreeNode = CTN( MUIV_NListtree_NextSelected_End ); + } + } + else + { + *msg->TreeNode = CTN( MUIV_NListtree_NextSelected_End ); + } + + //D(bugn( "==> Entry: 0x%08lx\n", *msg->TreeNode ) ); + + return( 0 ); +} + + +/****** NListtree.mcc/MUIM_NListtree_PrevSelected **************************** +* +* NAME +* +* MUIM_NListtree_PrevSelected -- Get previous selected tree node. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_PrevSelected, +* struct MUI_NListtree_TreeNode **treenode); +* +* +* FUNCTION +* +* Iterate reverse through the selected entries of a tree. This method +* steps through the contents of a (multi select) list tree and returns +* every entry that is currently selected. When no entry is selected +* but an entry is active, only the active entry will be returned. +* +* This behaviour will result in not returning the active entry when +* you have some other selected entries somewhere in your list. Since +* the active entry just acts as some kind of cursor mark, this seems +* to be the only sensible possibility to handle multi selection +* together with keyboard control. +* +* +* INPUTS +* +* treenode - A pointer to a pointer of struct MUI_NListtree_TreeNode +* that will hold the returned entry. Must be set to +* MUIV_NListtree_PrevSelected_Start at start of iteration +* an the end and is set to MUIV_NListtree_PrevSelected_End +* when first selected entry is reached and iteration is +* finished. +* +* MUIV_NListtree_PrevSelected_Start Set this to start iteration. +* MUIV_NListtree_PrevSelected_End Will be set to this, if +* last selected entry reached. +* +* +* RESULT +* +* EXAMPLE +* +* // Iterate through a list (reverse) +* struct MUI_NListtree_TreeNode *treenode; +* +* treenode = MUIV_NListtree_PrevSelected_Start; +* +* for (;;) +* { +* DoMethod(listtree, MUIM_NListtree_PrevSelected, &treenode); +* +* if (treenode==MUIV_NListtree_PrevSelected_End) +* break; +* +* printf("selected: %s\n", treenode->tn_Name); +* } +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NListtree_NextSelected, MUIM_NListtree_Select +* +* +****************************************************************************** +* +*/ + +IPTR _NListtree_PrevSelected(struct IClass *cl, Object *obj, struct MUIP_NListtree_PrevSelected *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + LONG curr = data->SelectedTable.tb_Current; + + //D(bug( "TreeNode: 0x%08lx ", *msg->TreeNode ) ); + + if((IPTR)*msg->TreeNode == (IPTR)MUIV_NListtree_PrevSelected_Start) + curr = data->SelectedTable.tb_Entries; + + curr--; + + if ( curr < data->SelectedTable.tb_Entries ) + { + if ( curr > -1 ) + { + data->SelectedTable.tb_Current = curr; + *msg->TreeNode = data->SelectedTable.tb_Table[curr]; + } + else if(((IPTR)*msg->TreeNode == (IPTR)MUIV_NListtree_NextSelected_Start) && + (data->ActiveNode != MUIV_NListtree_Active_Off)) + { + *msg->TreeNode = data->ActiveNode; + } + else + { + *msg->TreeNode = CTN( MUIV_NListtree_PrevSelected_End ); + } + } + else + { + *msg->TreeNode = CTN( MUIV_NListtree_PrevSelected_End ); + } + + //D(bugn( "==> Entry: 0x%08lx\n", *msg->TreeNode ) ); + + return( 0 ); +} + + + +/****** NListtree.mcc/MUIM_NListtree_CopyToClip ****************************** +* +* NAME +* +* MUIM_NListtree_CopyToClip -- Called for every clipboard copy action. (V1) +* +* +* SYNOPSIS +* +* DoMethodA(obj, MUIM_NListtree_CopyToClip, +* struct MUIP_NListtree_CopyToClip *ctcmessage); +* +* +* FUNCTION +* +* Do a copy to clipboard from an entry/entry content. +* +* +* INPUTS +* +* TreeNode - Tree node to copy contents from. Use +* MUIV_NListtree_CopyToClip_Active to copy the +* active entry. +* +* Pos - Entry position. +* +* Unit - Clipboard unit to copy entry contents to. +* +* +* RESULT +* +* EXAMPLE +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIA_NListtree_CopyToClipHook +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_CopyToClip(struct IClass *cl, Object *obj, struct MUIP_NListtree_CopyToClip *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + + // make sure anything is selected at all or calling CopyToClip doesn't make + // much sense + if(msg->TreeNode != NULL && msg->TreeNode->tn_Name != NULL) + { + STRPTR string = NULL; + BOOL alloc = FALSE; + + if(data->CopyToClipHook != NULL) + { + if((SIPTR)(string = (STRPTR)MyCallHook(data->CopyToClipHook, data, MUIA_NListtree_CopyToClipHook, msg->TreeNode, msg->Pos, msg->Unit)) == (SIPTR)MUIV_NListtree_CopyToClip_Active) + string = msg->TreeNode->tn_Name; + } + else + { + STRPTR str; + + string = msg->TreeNode->tn_Name; + if((str = AllocVecPooled(data->MemoryPool, strlen(string) + 1)) != NULL) + { + STRPTR s = string; + + alloc = TRUE; + string = str; + + // copy the string and remove all escape sequences + while(*s != '\0') + { + if(*s == 0x1b) + { + s += 2; + + if(*s == '[') + while(++*s != ']'); + + s++; + } + + *str++ = *s++; + } + } + } + + if(string != NULL) + { + //D(bug( "String: %s, Unit: %ld, pos: %ld\n", string, msg->Unit, msg->Pos ) ); + + StringToClipboard(msg->Unit, string); + + if(alloc == TRUE) + FreeVecPooled(data->MemoryPool, string); + } + } + + return(0); +} + + + +/****** NListtree.mcc/MUIM_NListtree_MultiTest ******************************* +* +* NAME +* +* MUIM_NListtree_MultiTest -- Called for every selection. (V1) +* +* +* SYNOPSIS +* +* DoMethodA(obj, MUIM_NListtree_MultiTest, +* struct MUIP_NListtree_MultiTest *multimessage); +* +* +* FUNCTION +* +* This method must not be called directly. It will be called by +* NListtree just before multiselection. You can overload it and +* return TRUE or FALSE whether you want the entry to be multi- +* selectable or not. +* +* +* INPUTS +* +* RESULT +* +* EXAMPLE +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NListtree_Select, MUIA_NListtree_MultiTest +* +* +****************************************************************************** +* +*/ + + +/****** NListtree.mcc/MUIM_NListtree_Active ********************************** +* +* NAME +* +* MUIM_NListtree_Active -- Called for every active change. (V1) +* +* +* SYNOPSIS +* +* DoMethodA(obj, MUIM_NListtree_Active, +* struct MUIP_NListtree_Active *activemessage); +* +* +* FUNCTION +* +* This method must not be called directly. It will be called by +* NListtree if the active entry changes. This is an addition to +* MUIA_NListtree_Active +* +* +* INPUTS +* +* RESULT +* +* EXAMPLE +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIA_NListtree_Active +* +* +****************************************************************************** +* +*/ + + +/****** NListtree.mcc/MUIM_NListtree_DoubleClick ***************************** +* +* NAME +* +* MUIM_NListtree_DoubleClick -- Called for every double click. (V1) +* +* +* SYNOPSIS +* +* DoMethodA(obj, MUIM_NListtree_DoubleClick, +* struct MUIP_NListtree_DoubleClick *doubleclickmsg); +* +* +* FUNCTION +* +* This method must not be called directly. It will be called by +* NListtree if an double click event occurs. This is an addition to +* MUIA_NListtree_DoubleClick +* +* +* INPUTS +* +* RESULT +* +* EXAMPLE +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIA_NListtree_DoubleClick +* +* +****************************************************************************** +* +*/ + + +/****** NListtree.mcc/MUIM_NListtree_DropType ******************************** +* +* NAME +* +* MUIM_NListtree_DropType -- +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_DropType, LONG *pos, LONG *type, +* LONG minx, LONG maxx, LONG miny, LONG maxy, +* LONG mousex, LONG mousey); +* +* +* FUNCTION +* +* This method MUST NOT be called directly ! +* +* It will be called by NListree while the DragReport, with +* default *pos and *type values depending on the drag pointer +* position that you can modify as you want. +* +* For further information see method MUIM_NList_DropDraw. +* +* +* INPUTS +* +* RESULT +* +* EXAMPLE +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NList_DropType +* +* +****************************************************************************** +* +*/ + + +/****** NListtree.mcc/MUIM_NListtree_DropDraw ******************************** +* +* NAME +* +* MUIM_NListtree_DropDraw -- +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_DropDraw, LONG pos, LONG type, +* LONG minx, LONG maxx, LONG miny, LONG maxy); +* +* +* FUNCTION +* +* This method MUST NOT be called directly! +* +* It will be called by NListtree, and will draw the drop mark +* previously fixed (pos and type) by MUIM_NListtree_DropType +* within the minx, maxx, miny, maxy in the _rp(obj) rasport. +* +* For further information see method MUIM_NList_DropDraw. +* +* +* INPUTS +* +* RESULT +* +* EXAMPLE +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +* MUIM_NList_DropDraw +* +* +****************************************************************************** +* +*/ + + + + +/****i* NListtree.mcc/MUIM_NListtree_GetListActive *************************** +* +* NAME +* +* MUIM_NListtree_GetListActive -- Set the active list in data structure. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_GetListActive, 0); +* +* +* FUNCTION +* +* Set current active list in the internal data structure depending on the +* currently active entry. +* +* +* INPUTS +* +* RESULT +* +* data->ActiveList will be set to data->ActiveEntry->tn_Parent. +* +* +* EXAMPLE +* +* DoMethod(obj, MUIM_NListtree_GetListActive, 0); +* +* +* NOTES +* +* Only internal used function for notification of MUIA_NList_Active. +* +* +* BUGS +* +* SEE ALSO +* +* MUIA_NList_Active +* +* +****************************************************************************** +* +*/ +IPTR _NListtree_GetListActive(struct IClass *cl, Object *obj, UNUSED struct MUIP_NListtree_GetListActive *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_TreeNode *tn; + + /* + ** Get pointer to the selected node. + ** Set active node in global + ** data structure. + */ + DoMethod( obj, MUIM_NList_GetEntry, MUIV_NList_GetEntry_Active, &tn ); + + D(DBF_LISTTREE, "Got Active notify from NList 0x%08lx - %s (0x%08lx - Name: %s) force=%ld", tn, (tn != NULL && tn->tn_Name != NULL) ? tn->tn_Name : (STRPTR)"NULL", data->ActiveNode, (data->ActiveNode != NULL && data->ActiveNode->tn_Name != NULL) ? data->ActiveNode->tn_Name : (STRPTR)"NULL", data->ForceActiveNotify); + + if ( tn != data->ActiveNode || data->ForceActiveNotify) + { + //DoMethod( obj, MUIM_NListtree_Active, tn, pos ); + + //MakeNotify( data, MUIA_NListtree_Active, tn ); + MakeSet( data, MUIA_NListtree_Active, tn ); + data->ForceActiveNotify = 0; + } + + return( 0 ); +} + + +IPTR _NListtree_GetDoubleClick(struct IClass *cl, Object *obj, UNUSED struct MUIP_NListtree_GetListActive *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + + ENTER(); + + if ( data->DoubleClick != MUIV_NListtree_DoubleClick_NoTrigger ) + { + struct MUI_NListtree_TreeNode *tn; + + /* + ** Get pointer to the selected node. + */ + DoMethod( obj, MUIM_NList_GetEntry, data->LDClickEntry, &tn ); + + if ( (SIPTR)tn != -1 ) + { + DoMethod( obj, MUIM_NListtree_DoubleClick, tn, data->LDClickEntry, data->LDClickColumn ); + MakeNotify( data, MUIA_NListtree_DoubleClick, tn ); + //DoMethod( obj, MUIM_Set, MUIA_NListtree_DoubleClick, tn ); + } + } + + RETURN(0); + return( 0 ); +} + + + +/****i* NListtree.mcc/MUIM_NListtree_Data ************************************ +* +* NAME +* +* MUIM_NListtree_Data -- Get/Set some internal data. (V1) +* +* +* SYNOPSIS +* +* DoMethod(obj, MUIM_NListtree_Data, dataqual, set); +* +* +* FUNCTION +* +* Get some internal data or set if "set" is != NULL. +* +* +* INPUTS +* +* dataqual: +* MUIV_NListtree_Data_MemPool +* MUIV_NListtree_Data_VersInfo (not implemented) +* MUIV_NListtree_Data_Sample (not implemented) +* +* +* RESULT +* +* The requested data. +* +* +* EXAMPLE +* +* result = DoMethod(obj, MUIM_NListtree_Data, +* MUIV_NListtree_Data_MemPool, NULL); +* +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +****************************************************************************** +* +*/ +IPTR _NListtree_Data(struct IClass *cl, Object *obj, struct MUIP_NListtree_Data *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + + switch( msg->ID ) + { + case MUIV_NListtree_Data_MemPool: + return( (IPTR)data->MemoryPool ); + + case MUIV_NListtree_Data_VersInfo: + case MUIV_NListtree_Data_Sample: + default: + break; + } + + return( 0 ); +} + + + +IPTR _NListtree_SelectChange(struct IClass *cl, Object *obj, struct MUIP_NList_SelectChange *msg) +{ + struct NListtree_Data *data = INST_DATA(cl, obj); + struct MUI_NListtree_TreeNode *tn; + + D(DBF_LISTTREE, "NList selection change: Entry %ld changed to %ld%s", msg->pos, msg->state, + ( msg->flags & MUIV_NList_SelectChange_Flag_Multi ) ? " while holding down mouse button" : ""); + + if (data->IgnoreSelectionChange) + { + D(DBF_LISTTREE, " which is ignored"); + return 0; + } + + DoMethod( obj, MUIM_NList_GetEntry, msg->pos, &tn ); + + if ( msg->state == MUIV_NList_Select_Active ) + { + if ( tn != data->ActiveNode ) + { + /* + ** !! Setting this NOT makes problems with getting the active entry + ** in applications. Handle carefully if changed/removed !! + */ + //MakeNotify( data, MUIA_NListtree_Active, tn ); + //data->ActiveNode = tn; + + /* sba: Changed to not notify, because the new active element is not drawn + ** here (current NList restriction) a MUIA_NList_Active trigger + ** will follow and we will use this for the notification + */ + nnset( obj, MUIA_NListtree_Active, tn ); + + /* sba: the MUIA_NList_Notification only notifies if neccessary, but as the + ** notifications stayed out we set a flag to force it + **/ + data->ForceActiveNotify = 1; + } + } + + else if ( msg->state == MUIV_NList_Select_On ) + { + if ( NLFindInTable( &data->SelectedTable, tn ) == -1 ) + { + TreeNodeSelectAdd( data, tn ); + tn->tn_Flags |= TNF_SELECTED; + + MakeNotify( data, MUIA_NListtree_SelectChange, (APTR)TRUE ); + } + } + + else if ( msg->state == MUIV_NList_Select_Off ) + { + if ( NLFindInTable( &data->SelectedTable, tn ) != -1 ) + { + TreeNodeSelectRemove( data, tn ); + tn->tn_Flags &= ~TNF_SELECTED; + + MakeNotify( data, MUIA_NListtree_SelectChange, (APTR)TRUE ); + } + } + + return( 0 ); +} + + + +/****i* NListtree.mcc/_Dispatcher ****************************************** +* +* NAME +* +* _Dispatcher -- Call methods depending on the supplied MethodID (V1) +* +* +* SYNOPSIS +* +* FUNCTION +* +* INPUTS +* +* RESULT +* +* EXAMPLE +* +* NOTES +* +* BUGS +* +* SEE ALSO +* +****************************************************************************** +* +*/ + +DISPATCHER(_Dispatcher) +{ + switch( msg->MethodID ) + { + /* + ** Base class methods. + */ + case OM_NEW: return( _New ( cl, obj, (APTR)msg) ); + case OM_DISPOSE: return( _Dispose ( cl, obj, (APTR)msg) ); + case OM_SET: return( _Set ( cl, obj, (APTR)msg) ); + case OM_GET: return( _Get ( cl, obj, (APTR)msg) ); + + /* + ** MUI base class methods. + */ + case MUIM_Setup: return( _Setup ( cl, obj, (APTR)msg) ); + case MUIM_Cleanup: return( _Cleanup ( cl, obj, (APTR)msg) ); + case MUIM_Show: return( _Show ( cl, obj, (APTR)msg) ); + case MUIM_Hide: return( _Hide ( cl, obj, (APTR)msg) ); + case MUIM_Draw: return( _Draw ( cl, obj, (APTR)msg) ); + case MUIM_AskMinMax: return( _AskMinMax ( cl, obj, (APTR)msg) ); + case MUIM_HandleEvent: return( _HandleEvent ( cl, obj, (APTR)msg) ); + + /* + ** MUI/NList drag&drop methods. + */ + case MUIM_DragQuery: return( _DragNDrop_DragQuery ( cl, obj, (APTR)msg) ); + case MUIM_DragBegin: return( _DragNDrop_DragBegin ( cl, obj, (APTR)msg) ); + case MUIM_DragReport: return( _DragNDrop_DragReport ( cl, obj, (APTR)msg) ); + case MUIM_DragFinish: return( _DragNDrop_DragFinish ( cl, obj, (APTR)msg) ); + case MUIM_DragDrop: return( _DragNDrop_DragDrop ( cl, obj, (APTR)msg) ); + case MUIM_NList_DropType: return( _DragNDrop_DropType ( cl, obj, (APTR)msg) ); + case MUIM_NList_DropDraw: return( _DragNDrop_DropDraw ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_DropDraw: return( _DragNDrop_NDropDraw ( cl, obj, (APTR)msg) ); + + case MUIM_NList_Display: return( _NList_Display(cl, obj, (APTR)msg) ); + + /* + ** Specials. + */ + case MUIM_NList_ContextMenuBuild: return( _ContextMenuBuild ( cl, obj, (APTR)msg) ); + case MUIM_ContextMenuChoice: return( _ContextMenuChoice ( cl, obj, (APTR)msg) ); + + + /* + ** NListtree methods sorted by kind. + */ + case MUIM_NListtree_Open: return( _NListtree_Open ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_Close: return( _NListtree_Close ( cl, obj, (APTR)msg) ); + + case MUIM_NListtree_Insert: return( _NListtree_Insert ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_InsertStruct: return( _NListtree_InsertStruct ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_Remove: return( _NListtree_Remove ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_Clear: return( _NListtree_Clear ( cl, obj, (APTR)msg) ); + + case MUIM_NListtree_Move: return( _NListtree_Move ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_Copy: return( _NListtree_Copy ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_Rename: return( _NListtree_Rename ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_Exchange: return( _NListtree_Exchange ( cl, obj, (APTR)msg) ); + + case MUIM_NListtree_FindName: return( _NListtree_FindName ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_FindUserData: return( _NListtree_FindUserData ( cl, obj, (APTR)msg) ); + + case MUIM_NListtree_GetEntry: return( _NListtree_GetEntry ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_GetNr: return( _NListtree_GetNr ( cl, obj, (APTR)msg) ); + + case MUIM_NListtree_Sort: return( _NListtree_Sort ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_Redraw: return( _NListtree_Redraw ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_TestPos: return( _NListtree_TestPos ( cl, obj, (APTR)msg) ); + + case MUIM_NListtree_Select: return( _NListtree_Select ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_NextSelected: return( _NListtree_NextSelected ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_PrevSelected: return( _NListtree_PrevSelected ( cl, obj, (APTR)msg) ); + + case MUIM_NListtree_CopyToClip: return( _NListtree_CopyToClip ( cl, obj, (APTR)msg) ); + + case MUIM_NListtree_Construct: return( _NListtree_Construct ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_Destruct: return( _NListtree_Destruct ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_Display: return( _NListtree_Display ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_Compare: return( _NListtree_Compare ( cl, obj, (APTR)msg) ); + + /* + ** Methods, user can use for info or overload + ** to control NListtree. + */ + case MUIM_NListtree_Active: return( TRUE ); + case MUIM_NListtree_DoubleClick: return( TRUE ); + case MUIM_NListtree_MultiTest: return( TRUE ); + case MUIM_NListtree_DropType: return( TRUE ); + + + /* + ** Internal methods. + */ + case MUIM_NListtree_GetListActive: return( _NListtree_GetListActive ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_GetDoubleClick: return( _NListtree_GetDoubleClick ( cl, obj, (APTR)msg) ); + case MUIM_NListtree_Data: return( _NListtree_Data ( cl, obj, (APTR)msg) ); + + case MUIM_NList_SelectChange: return( _NListtree_SelectChange ( cl, obj, (APTR)msg) ); + + #ifdef MYDEBUG + case MUIM_NList_Remove: + { + ULONG rc; + D(DBF_LISTTREE, "MUIM_NList_Remove"); + rc = DoSuperMethodA(cl, obj, msg); + D(DBF_LISTTREE, "MUIM_NList_Remove_End"); + return rc; + } + #endif + + /* + case MUIM_NList_UseImage: + { + ULONG res; + + res = DoSuperMethodA(cl, obj, msg); + + D(bug( "USEIMAGE ==> result: 0x%08lx obj: 0x%08lx, imgnum: %ld, flags: 0x%08lx\n", res, m->obj, m->imgnum, m->flags ) ); + + return( res ); + } + + case MUIM_NList_CreateImage: + { + struct MUIP_NList_UseImage *m = (struct MUIP_NList_UseImage *)msg; + ULONG res; + + res = DoSuperMethodA(cl, obj, msg); + + D(bug( "CREATEIMAGE ==> result: 0x%08lx obj: 0x%08lx, flags: 0x%08lx\n", res, m->obj, m->flags ) ); + + return( res ); + } + */ + } + + return( DoSuperMethodA( cl, obj, msg) ); +} diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/NListtree.h b/workbench/classes/zune/nlist/nlisttree_mcc/NListtree.h new file mode 100644 index 0000000000..da8c685ab2 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/NListtree.h @@ -0,0 +1,266 @@ +#ifndef NLISTTREE_H +#define NLISTTREE_H + +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include "private.h" + +#define MUIA_TI_Spec 0xfedcL +#define MUIA_TI_MaxWidth 0xfedbL +#define MUIA_TI_MaxHeight 0xfedaL +#define MUIA_TI_Style 0xfed9L +#define MUIA_TI_Space 0xfed8L +#define MUIA_TI_Pen 0xfed7L + +struct NListtree_HookMessage +{ + ULONG HookID; +}; + +struct MyImage +{ + Object *Image; // *** Image objects. + Object *ListImage; // *** List image objects (created by ...CreateImage). + + struct NListtree_Data *nltdata; +}; + + +struct MyContextMenuChoice +{ + LONG unit; + LONG pos; + LONG col; + LONG ontop; +}; + + +struct NListtree_Data +{ + /* + ** General object related vars. + */ + APTR MemoryPool; // *** Our global memory pool + APTR TreePool; // *** Our tree memory pool + Object *Obj; // *** The listtree object itself + STRPTR buf; // *** Multi purpose buffer (most image include) + struct MUI_EventHandlerNode EHNode; // *** Event handler node. + + + /* + ** Image custom class stuff. + */ + struct MUI_CustomClass *CL_TreeImage; + struct MUI_CustomClass *CL_NodeImage; + + + /* + ** List handling. + */ + struct MUI_NListtree_ListNode RootList; // *** The head root list. + struct MUI_NListtree_ListNode *ActiveList; // *** The active list node + struct MUI_NListtree_ListNode *LastInsertedList; // *** The list node, the last entry was inserted + + struct MUI_NListtree_TreeNode *ActiveNode; // *** Current active tree node + struct MUI_NListtree_TreeNode *OpenCloseEntry; // *** Entry to open/close in handler. + struct MUI_NListtree_TreeNode *TempActiveNode; // *** New active node after Remove for example. + + struct Table SelectedTable; // *** Table of selected entries. + struct MUI_NListtree_TreeNode *TempSelected; // *** Temporary selected entry. + + ULONG ActiveNodeNum; // *** Number of the active node. + + + /* + ** Rendering information, images etc. + */ + struct MUI_RenderInfo *MRI; // *** MUI render info structure (got in _Setup()) + + struct MyImage Image[4]; // *** My special image structure. + + UWORD MaxImageWidth, // *** Maximum image width. + MaxImageHeight; // *** Maximum image height. + + /* + ** Pen specific stuff. + */ + LONG Pen[3]; // *** Obtained pen for lines/shadow/glow drawing. + + + /* + ** Other configuration stuff. + */ + ULONG LineType; // *** The line type used (see private.h) + ULONG IndentWidth; // *** The width of the indent + BOOL UseFolderImage; // *** boolean for selecting if the folder image should be shown or not + + UBYTE MultiSelect; // *** Multi selection kind and flags. + UWORD MultiSelectFlags; + + struct MyContextMenuChoice MenuChoice; + + /* + ** All hooks used. + */ + struct Hook *OpenHook, // *** Safe place for all hooks the user wants to be called + *CloseHook, + + *ConstructHook, + *DestructHook, + + *MultiTestHook, + + *DisplayHook, + *CopyToClipHook, + + *CompareHook, + *FindNameHook, + *FindUserDataHook; + + struct Hook IntCompareHook; /* The internal compare hook, is no pointer to avoid unnecessary allocations */ + + + /* + ** List format save. + */ + STRPTR Format; // *** Here the list format is saved + + + /* + ** Input handling stuff (double click etc.) + */ + BYTE DoubleClick; // *** Holds specified double click value + UWORD TreeColumn; // *** Holds specified tree column + + ULONG LDClickTimeSecs; // *** Left mouse button click handling + ULONG LDClickTimeMicros; // *** Left mouse button click handling + LONG LDClickEntry; + WORD LDClickColumn; + +#if 0 + ULONG MDClickTimeSecs; // *** Middle mouse button click handling + ULONG MDClickTimeMicros; // *** Middle mouse button click handling + LONG MDClickEntry; + WORD MDClickColumn; +#endif + + /* + ** Auto visualization stuff + */ + UBYTE AutoVisible; // *** Holds information about autovisiblization + + + /* + ** Drag'n Drop stuff. + */ + struct MUI_NListtree_TreeNode *DropTarget; // *** The entry which is currently the drop target. + struct MUI_NListtree_TreeNode *OldDropTarget; // *** The entry which is currently the drop target. + LONG compositingActive; + + ULONG DropTargetPos; // *** Position of target drop entry. + ULONG DropType; // *** The dropping type (above, below, onto...) + ULONG OpenDropListSecs; + ULONG OpenDropListMicros; + + /* + ** Number of entries total. + */ + ULONG NumEntries; // *** Global number of entries in the whole list tree + + + /* + ** Some flags and error var. + */ + ULONG Flags; // *** Some flags (see below) + ULONG QuietCounter; // *** Quiet nesting count. + ULONG ForceActiveNotify; // *** next MUIA_NListtree_Notify notify will be enforced + ULONG IgnoreSelectionChange; /* *** Ignores the next selection change */ + UWORD Error; +}; + + +/* +** Flag values for Flags field +*/ +#define NLTF_EMPTYNODES (1<<0) // *** Display empty nodes as leafs. +#define NLTF_DUPNODENAMES (1<<1) // *** Do not copy "name"-field. Use supplied pointer. +#define NLTF_QUIET (1<<2) // *** NListtree is in quiet state. +#define NLTF_TITLE (1<<3) // *** Show title. +#define NLTF_REFRESH (1<<4) // *** Do an general object refresh. +#define NLTF_REMEMBER_STATUS (1<<5) // *** Config: Remember open/close status of nodes. +#define NLTF_DRAGDROPSORT (1<<6) // *** Enabled drag'n drop sort. +#define NLTF_REDRAW (1<<7) // *** Redraw specified line. +#define NLTF_AUTOVISIBLE (1<<8) // *** Activated entries will always be shown. +#define NLTF_SELECT_METHOD (1<<9) // *** Selection through Select method. +#define NLTF_OVER_ARROW (1<<10) // *** Mouse clicked over arrow. No drag!! +#define NLTF_DRAGDROP (1<<11) // *** Drag&Drop in in progress. +#define NLTF_OPENAUTOSCROLL (1<<12) // *** Config: Auto scroll entries when opening a node with a large list. +#define NLTF_NO_TREE (1<<13) // *** Do not show a tree. +#define NLTF_NLIST_NO_SCM_SUPPORT (1<<14) // *** NList.mcc has no SelectChange method support implemented! +#define NLTF_INT_COMPAREHOOK (1<<15) // *** Internal compare hook used! +#define NLTF_INT_CONSTRDESTRHOOK (1<<16) // *** Internal construct/destruct hooks! +#define NLTF_ACTIVENOTIFY (1<<17) // *** Active notify activated? +#define NLTF_ISMCP (1<<18) // *** MCP is here ;-) +#define NLTF_NLIST_DIRECT_ENTRY_SUPPORT (1<<19) // *** NList version supports direct entry request via backpointer +#define NLTF_NO_ROOT_TREE (1<<20) // *** Do not display root tree gfx. +#define NLTF_SETACTIVE (1<<21) // *** Set the active entry. +#define NLTF_AUTOSELECT_CHILDS (1<<22) // *** Automatically select childs if their parents selected. + +#define NLTF_QUALIFIER_LCOMMAND (1<<28) // *** Rawkey qualifier information. +#define NLTF_QUALIFIER_LALT (1<<29) +#define NLTF_QUALIFIER_CONTROL (1<<30) +#define NLTF_QUALIFIER_LSHIFT (1<<31) + + +#define INSERT_POS_HEAD -1L +#define INSERT_POS_TAIL -2L + + +#define IMAGE_Closed 0L +#define IMAGE_Open 1L +#define IMAGE_Folder 2L +#define IMAGE_Tree 3L + +#define SPEC_Vert 1L +#define SPEC_VertT 2L +#define SPEC_VertEnd 3L +#define SPEC_Space 4L +#define SPEC_Hor 5L + +#define PEN_Shadow 0L +#define PEN_Line 1L +#define PEN_Glow 2L + +/// xget() +// Gets an attribute value from a MUI object +IPTR xget(Object *obj, const IPTR attr); +#if defined(__GNUC__) + // please note that we do not evaluate the return value of GetAttr() + // as some attributes (e.g. MUIA_Selected) always return FALSE, even + // when they are supported by the object. But setting b=0 right before + // the GetAttr() should catch the case when attr doesn't exist at all + #define xget(OBJ, ATTR) ({IPTR b=0; GetAttr(ATTR, OBJ, &b); b;}) +#endif +/// + +#endif /* NLISTTREE_H */ diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/QuickSort.c b/workbench/classes/zune/nlist/nlisttree_mcc/QuickSort.c new file mode 100644 index 0000000000..919207910b --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/QuickSort.c @@ -0,0 +1,85 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/* +** QuickSort algorithm implementation +** +** based on the qsort() implementation of libnix 2.0 +** changed and optimized to use a hook instead of a generic +** compare function +** +** Jens Langner <jens.langner@light-speed.de>, 2003 +*/ + +#include <clib/alib_protos.h> +#include <proto/intuition.h> + +#include "NListtree.h" + +#define SWAP(a,b) temp=(a);(a)=(b);(b)=temp +#define COMPARE(a,b) (LONG)DoMethod(data->Obj, MUIM_NListtree_Compare, (a), (b)) + +void qsort2(struct MUI_NListtree_TreeNode **table, ULONG entries, struct NListtree_Data *data) +{ + struct MUI_NListtree_TreeNode *temp; + ULONG a,b,c; + + while(entries > 1) + { + a = 0; + b = entries-1; + c = (a+b)/2; // Middle element + + for(;;) + { + while(COMPARE(table[c], table[a]) > 0) a++; // Look for one >= middle + while(COMPARE(table[c], table[b]) < 0) b--; // Look for one <= middle + + if(a>=b) break; // We found no pair + + // swap them + SWAP(table[a], table[b]); + + if(c==a) c=b; // Keep track of middle element + else if(c==b) c=a; + + a++; // These two are already sorted + b--; + } + + // a points to first element of right intervall now (b to last of left) + b++; + + // do recursion on smaller intervall and iteration on larger one + if(b < entries-b) + { + qsort2(table, b, data); + table = &table[b]; + entries = entries-b; + } + else + { + qsort2(&table[b], entries-b, data); + entries = b; + } + } +} diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode.c b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode.c new file mode 100755 index 0000000000..2653e7405c --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode.c @@ -0,0 +1,222 @@ +/******************************************************************************\ +******************************************************************************** +*** +*** $Source$ +*** $Revision$ +*** $Date$ +*** +*** $Id$ +*** +*** $Author$ +*** +*** +*** +*** UNLESS OTHERWISE NOTED, ALL FILES ARE +*** COPYRIGHT (C) 2000 BY "APOCALYPSE HARD- UND SOFTWARE CARSTEN SCHOLLING". +*** ALL RIGHTS RESERVED. +*** +*** NO PART OF THIS SOFTWARE MAY BE COPIED, REPRODUCED, TRANSMITTED, REDIST- +*** RIBUTED, DISCLOSED OR DUPLICATED IN ANY FORM OR BY ANY MEANS, WITHOUT +*** THE PRIOR WRITTEN PERMISSION OF "APOCALYPSE HARD- UND SOFTWARE". +*** +*** +*** DISCLAIMER +*** +*** THIS SOFTWARE AND INFORMATION IS PROVIDED "AS IS". NO REPRESENTATIONS OR +*** WARRANTIES ARE MADE WITH RESPECT TO THE ACCURACY, RELIABILITY, PERFOR- +*** MANCE, CURRENTNESS OR OPERATION OF THIS SOFTWARE AND INFORMATION, AND +*** ALL USE IS AT YOUR OWN RISK. NEITHER "APOCALYPSE HARD- UND SOFTWARE" NOR +*** THE AUTHORS ITSELF ASSUME ANY RESPONSIBILITY OR LIABILITY WHATSOEVER +*** WITH RESPECT TO YOUR USE OF THIS SOFTWARE AND INFORMATION. +*** +*** +*** +*** +*** $Log$ +*** Revision 1.1 2004/07/10 20:31:44 damato +*** - inital checkin +*** +*** +*** +******************************************************************************** +\******************************************************************************/ + +#include <intuition/gadgetclass.h> +#include <intuition/imageclass.h> +#include <intuition/intuition.h> +#include <clib/alib_protos.h> +#include <libraries/mui.h> + +#include <compiler.h> +#include <debug.h> + + +#include "ClosedNode_rev.h" + +#define IMAGE "ClosedNode" + + +#define libfunc(x) image_Lib ## x +#define reqfunc muilink_use_image +#define addname(x) image_ ## x + + +/* +** $setver$ +*/ +STATIC const char UserLibID[] = VERSTAG; + + +struct Data { + + struct MUI_RenderInfo *mri; +}; + + +#include <MUI/imageheader.c> + + +STATIC ULONG ASM _BoopsiQuery( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) struct MUI_BoopsiQuery *mbq ) +{ + struct Data *data = INST_DATA( cl, obj ); + + //D(bug( "\n" ) ); + + if ( mbq->mbq_Flags & MBQF_HORIZ ) + { + mbq->mbq_MinWidth = 8; + mbq->mbq_MaxWidth = MBQ_MUI_MAXMAX; + mbq->mbq_DefWidth = 8; + + mbq->mbq_MinHeight = 8; + mbq->mbq_MaxHeight = MBQ_MUI_MAXMAX; + mbq->mbq_DefHeight = 8; + } + else + { + mbq->mbq_MinWidth = 8; + mbq->mbq_MaxWidth = MBQ_MUI_MAXMAX; + mbq->mbq_DefWidth = 8; + + mbq->mbq_MinHeight = 8; + mbq->mbq_MaxHeight = MBQ_MUI_MAXMAX; + mbq->mbq_DefHeight = 8; + } + + data->mri = mbq->mbq_RenderInfo; + + return( MUIM_BoopsiQuery ); +} + + + +STATIC ULONG ASM _Draw( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) struct impDraw *msg ) +{ + #define img ( (struct Image *)obj ) + struct Data *data = INST_DATA( cl, obj ); + struct RastPort *rp = msg->imp_RPort; + + if ( rp != NULL ) + { + ULONG l = img->LeftEdge + msg->imp_Offset.X; + ULONG t = img->TopEdge + msg->imp_Offset.Y; + ULONG w = img->Width; + ULONG h = img->Height; + ULONG r = l + w - 1; + ULONG b = t + h - 1; + BOOL sel = ( msg->imp_State == IDS_SELECTED ) ? TRUE : FALSE; + UBYTE backgroundpen = data->mri ? data->mri->mri_Pens[MPEN_BACKGROUND] : msg->imp_DrInfo->dri_Pens[BACKGROUNDPEN]; + UBYTE halfshinepen = data->mri ? data->mri->mri_Pens[MPEN_HALFSHINE] : msg->imp_DrInfo->dri_Pens[BACKGROUNDPEN]; + UBYTE shadowpen = data->mri ? data->mri->mri_Pens[MPEN_SHADOW] : msg->imp_DrInfo->dri_Pens[SHADOWPEN]; + UBYTE shinepen = data->mri ? data->mri->mri_Pens[MPEN_SHINE] : msg->imp_DrInfo->dri_Pens[SHINEPEN]; + + //D(bug( "\n" ) ); + + SetDrMd( rp, JAM1 ); + + /* + if ( ( w > 2 ) && ( h > 2 ) ) + { + SetAPen( rp, backgroundpen ); + RectFill( rp, l, t, r, b ); + } + */ + + SetAPen( rp, sel ? shadowpen : shinepen ); + + /* + ** ##++++++ + ** #+##++++ + ** #+++##++ + ** #+++++## + ** #+++++++ + ** #+++++++ + ** #+++++++ + ** ++++++++ + */ + Move( rp, l, b - 1 ); + Draw( rp, l, t ); + Draw( rp, r, t + 3 ); + + SetAPen( rp, sel ? shinepen : shadowpen ); + + /* + ** **++++++ + ** *+**++++ + ** *+++**++ + ** *+++++** + ** *+++++## + ** *+++##++ + ** *+##++++ + ** ##++++++ + */ + Move( rp, l, b ); + Draw( rp, r, b - 3 ); + + /* + ** Arrow fill... + */ + SetAPen( rp, halfshinepen ); + + /* + ** **++++++ + ** *#**++++ + ** *###**++ + ** *#####** + ** *#####** + ** *###**++ + ** *#**++++ + ** **++++++ + */ + Move( rp, l + 1, t + 1 ); + Draw( rp, l + 1, b - 1 ); + + Move( rp, l + 2, t + 2 ); + Draw( rp, l + 2, b - 2 ); + + Move( rp, l + 3, t + 2 ); + Draw( rp, l + 3, b - 2 ); + + Move( rp, l + 4, t + 3 ); + Draw( rp, l + 4, b - 3 ); + + Move( rp, l + 5, t + 3 ); + Draw( rp, l + 5, b - 3 ); + } + + return( 0 ); +} + + +ULONG ASM SAVEDS _Dispatcher( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg ) +{ + switch ( msg->MethodID ) + { + case IM_DRAW: return( _Draw( cl, obj, (APTR)msg ) ); + case MUIM_BoopsiQuery: return( _BoopsiQuery( cl, obj, (APTR)msg ) ); + } + + return( DoSuperMethodA( cl, obj, msg ) ); +} + + diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode.image b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode.image new file mode 100755 index 0000000000000000000000000000000000000000..a70d3ed029434486453faa9bad9eb75f72c9bee7 GIT binary patch literal 1772 zcwTK)QA`|F6g{&$EW^0jj14w~koGxUa9Nibx-r-gqPvvpuq@jK5Sk|1g|-Y3V8;cF zHbl3G`e)SI#IJsuSZia5X`+b<^`p^-7;T!^_#vOwDygad*dTb`>=tO_X3xyM_uPB# zn>%l2fZ$&!{{oe>!vFg`t3dEKX?w`cAv$=duU#CREX<rbnJb(;WsOe_yQjo{t5wAI z^Z2yY+S-hVc_}waED^h<_$Ggubs9&A2`Du(_++^oK6Z=4-q`qw8EbNUq&QrB4H%!E zog1GWFHCQRwp);uJx)vx&&&YMEyc35?ti49`6|@rZXkVcvvl^mbJx6qA`+88?$YMP zXev{3+aH@p4K(tH8y)EMLWuO-Ms52#l+G6!H{#zmJ`Xc}8%^cPf3KUF+@+0Kp=VcT zOSw7c*5i?QuG~+sUuFuz)wMMQ5%G|Zo4pB#{Zy+3rrGPEwFSo6<sy<T*foo%aN~>! zkhes2cGX*ydU)o(UK92DsHc4<)zWKRLl0N5lIYES$w_WxQmz{9&4<oi>u1&$e^st+ z9#TtrK<jlJVvfk{R0(`g@vlmaQA2Byy<9EPJB-b!1-Y(y|2h#bD|yQ2)66`5@ZQEz zITNpu)i;|{P~8#62Dg08eJ;%$#`2uK>d#&ycZ^)vtxr=e@TWP6@ID8c=&rB>dBK=g zp7zE_=S67r)rzfp2&X(HyE@=sAM^*-)Fl#B-YrrUtqwtTp4(U%Ca1X(GqqEhG4-LC zD%For-40jo>Z59@)cNv|TdS7d`1-w1N9$}|PA=Fcj^`W7c2$D5Vb|EYt@-}1hwmU9 zJD!_6zm7WR*0XK#Zaaexvw)7KDX6xC1L6@E%1ZAVwAMY&@}VD-_0E;+B}<WB*-j{} z_0Dp<`sY&rThfY!ZkGBN?JgvX%F_9vE3^1e5#2>l^+2*2BI?z_)ZMU{K$tr$hCn_d zreK(3;Pjah*_%e9sgm&u+G5bQGw3%%`+`rUt4p4H)!1g~H6ye)g_zmHY0>Ar&SyH^ zkOw1}*9{x7B6dM2CU?`uh5kjeM^u}<Z<~g1g=pz!Xz+}khQ&yg^jWX5p0#;Z>Xd8! zd>cu>mggZ^6T4r-?8MGa(dxbhGt_s6e4x@T;P=&|)dLFyZ~MONZZuKrg*SaaSmp;8 zw%MKWqYKQnwjxH{_WK7+e+9?h@mCn!x;8)RA-g)c{tNGSZqC#8r67o~*#SIZ>`SAL zsAa?;8aT}uMB^ujY7iZAcX7Yz(E@j*&ZmfbM@($4=d-q+y;B80niZPskTJv<>hj4Q zOp=TxnS4X`PLS_VyMQo{dbFEtEm?y*M05Bat@_^PJ?Hum<=zwpsFGo(!_3=$&zt|F z@dGthWTxNy@{Zn@$t=mJ-65Y9r+`{%DZzt3Ij5=YcazV8>?bpVfAC=VUl>$<LqAT` z6A``*`dE2`c$Xx<7Z@R4A_j>*DNl3}DMI$EhX0)k{7rmB@av&`MNAWW$XzP;3Em}s JNBLWJ_difl!xI1i literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode.image.info b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode.image.info new file mode 100755 index 0000000000000000000000000000000000000000..4aee820b2d5d4c3e91f904fef8ce7da7ab09b763 GIT binary patch literal 831 zcwTjqu}cDR6vyAC9SWi55DFqn&f(CIQ$a&sK?Ks&kS-13ASEt={-l=BL2q(wXuKi+ zgPV%}3rTTqED)}H@B6ckz{mag+<o5T9rxv?2{MT5f-Y&7w#f9KjYub*^N&ma%Ls)d z*QF8PDt-Pc2k@3PGIyRrfnFlWFEDO`jTGosg+^DUgjB7A>Av*Ut9Yu7UxcapL};cp zLoRrWeP(3^d*H^S3b5mGeUiYNkZl$GOVP7!g>5TG?}fp4!9MVP`~!af0lsaCFMIZ; zcyD$izEhgXd^U#pqx+=z;XEupzldUgAA5!l_U9e_UPt>T{B{feu*G{61xjaLBxJt) zhUJWs%$b}yvylbeJE75?f^?;sL0`RrwXrMY%$a6dfg$ucb75r#dmv{WWUvyHl*|WI zkj#r@N#<w1k5Aw^bN20w__8;G_a^Y2J<MlgQSqEP`{5iuztH>pnCHyJJK8(iH{m&R S_MCa~_aE_V{rLR!gnj_}9=9_9 literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode_rev.h b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode_rev.h new file mode 100755 index 0000000000..d2e202dc24 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/ClosedNode_rev.h @@ -0,0 +1,51 @@ +/*****************************************************************************\ +** +** ClosedNode_rev.h - built automatically by Revisor 1.5 +** +** +** Copyright ©1998-99 by Apocalypse Hard- und Software Carsten Scholling +** All rights reserved. +** +** +** DO NOT EDIT BY HAND!!! +** +\*****************************************************************************/ +#ifndef CLOSEDNODE_REV_H +#define CLOSEDNODE_REV_H + + +#define PROJECT_ID ((unsigned long) ('X')<<24 | (unsigned long) ('E')<<16 | (unsigned long) ('N')<<8 | (unsigned long) ('B')) + +#define PROJECTNAME "ClosedNode.image" +#define NAME "ClosedNode.image" +#define DESCRIPTION "MUI bar image" +#define FULLNAME "ClosedNode.image - MUI image" +#define AUTHOR "Carsten Scholling" +#define COPYRIGHT "Copyright ©2000 Apocalypse Hard- und Software" + +#define PROJECTVERSION 0 +#define PROJECTREVISION 0 +#define VERSION 1 +#define REVISION 0 +#define ALPHAVERSION 0 +#define BETAVERSION 0 + +#define DATE "11.07.00" +#define TIME "21:41:56" +#define DAY "Dienstag" + +#define VERSION_STRING "1.0" +#define FULLVERSION_STRING "1.0 (11.07.00)" + +#define PVERSION_STRING "0.0" +#define PFULLVERSION_STRING "0.0 (11.07.00)" + +#define VERS "ClosedNode.image 1.0" +#define VSTRING "ClosedNode.image 1.0 (11.07.00)\r\n" +#define VERSTAG "\0$VER: ClosedNode.image 1.0 (11.07.00)" + +#define CATALOG_NAME "ClosedNode.image.catalog" +#define CATALOG_VERSION 1 + +#endif /* CLOSEDNODE_REV_H */ + diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/SCOPTIONS b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/SCOPTIONS new file mode 100755 index 0000000000..996478a944 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/SCOPTIONS @@ -0,0 +1,23 @@ +CODE=FAR +NOSTACKCHECK +STRINGMERGE +UNSIGNEDCHARS +NOCHECKABORT +COMMENTNEST +NOMULTIPLEINCLUDES +STRUCTUREEQUIVALENCE +OPTIMIZERINLINELOCAL +SMALLCODE +SMALLDATA +NOVERSION +NOICONS +BATCH +OPTIMIZERTIME +NOERRORLISTING +INCLUDEDIR=//include/ +INCLUDEDIR=Src:Support +INCLUDEDIR=SC:Include +INCLUDEDIR=Prog:Compiler/misc-include +INCLUDEDIR=Prog:Compiler/my-include +DEFINE __APHASO__ +MAXIMUMWARNINGS=50 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/SCOPTIONS.in b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/SCOPTIONS.in new file mode 100755 index 0000000000..05c1e21775 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/SCOPTIONS.in @@ -0,0 +1,22 @@ +CODE=FAR +NOSTACKCHECK +STRINGMERGE +UNSIGNEDCHARS +NOCHECKABORT +COMMENTNEST +NOMULTIPLEINCLUDES +STRUCTUREEQUIVALENCE +OPTIMIZERINLINELOCAL +SMALLCODE +SMALLDATA +NOVERSION +NOICONS +BATCH +OPTIMIZERTIME +NOERRORLISTING +INCLUDEDIR=Src:Support +INCLUDEDIR=SC:Include +INCLUDEDIR=Prog:Compiler/misc-include +INCLUDEDIR=Prog:Compiler/my-include +DEFINE __APHASO__ +MAXIMUMWARNINGS=50 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/SMakefile b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/SMakefile new file mode 100755 index 0000000000..bc2b2705a2 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNode/SMakefile @@ -0,0 +1,154 @@ +###############################################################################\ +################################################################################ +### +### $Source$ +### $Revision: 2 $ +### $Date: 2004-07-10 22:31:44 +0200 (Sa, 10. Jul 2004) $ +### +### $Id: SMakefile 2 2004-07-10 20:31:44Z damato $ +### +### $Author: damato $ +### +### +### +### UNLESS OTHERWISE NOTED, ALL FILES ARE +### COPYRIGHT (C) 1998 BY "APOCALYPSE HARD- UND SOFTWARE CARSTEN SCHOLLING". +### ALL RIGHTS RESERVED. +### +### NO PART OF THIS SOFTWARE MAY BE COPIED, REPRODUCED, TRANSMITTED, REDIST- +### RIBUTED, DISCLOSED OR DUPLICATED IN ANY FORM OR BY ANY MEANS, WITHOUT +### THE PRIOR WRITTEN PERMISSION OF "APOCALYPSE HARD- UND SOFTWARE". +### +### +### DISCLAIMER +### +### THIS SOFTWARE AND INFORMATION IS PROVIDED "AS IS". NO REPRESENTATIONS OR +### WARRANTIES ARE MADE WITH RESPECT TO THE ACCURACY, RELIABILITY, PERFOR- +### MANCE, CURRENTNESS OR OPERATION OF THIS SOFTWARE AND INFORMATION, AND +### ALL USE IS AT YOUR OWN RISK. NEITHER "APOCALYPSE HARD- UND SOFTWARE" NOR +### THE AUTHORS ITSELF ASSUME ANY RESPONSIBILITY OR LIABILITY WHATSOEVER +### WITH RESPECT TO YOUR USE OF THIS SOFTWARE AND INFORMATION. +### +### +### +### +### $Log$ +### Revision 1.1 2004/07/10 20:31:44 damato +### - inital checkin +### +### +### +################################################################################ +###############################################################################/ + + +############################################################################# +## Configurable Parameters + +PROJECT = NListtree +VERSION = 18.7 + +BASEDIR = Src:NListtree + +CLASS = ClosedNode.image +CLASSOBJ = ClosedNode.o + +# + +GSTFILE = //$(PROJECT).gst + +CC = sc +AC = asm +LD = slink +BRUSH2C = brush2c +REVB = Revisor + +# + +#CFLAGS = GST=$(GSTFILE) IDLEN=65 +CFLAGS = GST=$(GSTFILE) IDLEN=65 OPTMIZE + +AFLAGS = -d + +#LDFLAGS = SC SD BATCH NOICONS +LDFLAGS = SC SD BATCH NOICONS NODEBUG + +#DEBUGFLAGS = DEBUG=FULL DEFINE MYDEBUG +#DEBUGFLAGS = DEBUG=FULL +#DEBUGFLAGS = DEFINE MYDEBUG +DEBUGFLAGS = + +# + +STARTUP = LIB:c.o +LIB = LIB:sc.lib LIB:small.lib +DEBUG_LIB = LIB:debug.lib + + +############################################################################# +## RULEZ + +.c.o: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCompiling *e[32m$@*e[0m" + @$(CC) $(CFLAGS) $(DEBUGFLAGS) $*.c + +.cpp.o: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCompiling *e[32m$@*e[0m" + @$(CC) $(CFLAGS) $(DEBUGFLAGS) $*.cpp + +.s.o: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCompiling *e[32m$@*e[0m" + @$(AC) $(AFLAGS) $*.s + +.ilbm.c: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCreating image source *e[32m$@*e[0m" + @$(BRUSH2C) $*.ilbm > $*.c + + +############################################################################# +## COMMAND LINE OPTIONS + + +############################################################################# +## Main program + + +all: $(CLASS) + +$(CLASS): $(CLASSOBJ) + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mLinking *e[32m$@*e[0m" + $(LD) FROM $(CLASSOBJ) TO $@ LIB $(LIB) $(DEBUG_LIB) $(LDFLAGS) + + +############################################################################# +## +## + +#Revisor FILE "ClosedNode" APPL $(CLASS) PRO $(PROJECT) VER 1 REV 1 DESC "MUI list tree class image" AUT "Carsten Scholling" COPY "Copyright ©1999-2001 Apocalypse Hard- und Software" C NOCPPC + +bump: + @echo "*e[32m*e[1m$(CLASS).mcc: *e[22m*e[33mBumping revision*e[0m" + $(REVB) FILE "ClosedNode" BUMPREV + + +install: + @echo "*e[32mInstalling class $(CLASS) locally...*e[0m" + @copy clone $(CLASS) MUI:Images/aphaso + #@avail flush + + +installdist: + @echo "*e[32mInstalling class $(CLASS)...*e[0m" + @copy clone $(CLASS) $(BASEDIR)/MCC_$(PROJECT)/Images/aphaso + +installcat: + @echo "*e[32mInstalling catalog files for class $(CLASS)...*e[0m" + #@copy clone all catalogs $(BASEDIR)/MCC_$(PROJECT)/locale + + +clean: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mDeleting trash of $(CLASS)...*e[0m" + @echo "Trash" >Trash.o + @list pat (\#?.o|\#?oPPC|\#?.obj|\#?.bak|\#?.lnk|\#?.mcc|\#?.mcp|\#?.0?0|\#?.elf) lformat "delete %p%n" >pipe:$(PROJECT)_delete + @execute pipe:$(PROJECT)_delete + diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98.c b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98.c new file mode 100755 index 0000000000..a3b5c215b9 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98.c @@ -0,0 +1,200 @@ +/******************************************************************************\ +******************************************************************************** +*** +*** $Source$ +*** $Revision$ +*** $Date$ +*** +*** $Id$ +*** +*** $Author$ +*** +*** +*** +*** UNLESS OTHERWISE NOTED, ALL FILES ARE +*** COPYRIGHT (C) 2000 BY "APOCALYPSE HARD- UND SOFTWARE CARSTEN SCHOLLING". +*** ALL RIGHTS RESERVED. +*** +*** NO PART OF THIS SOFTWARE MAY BE COPIED, REPRODUCED, TRANSMITTED, REDIST- +*** RIBUTED, DISCLOSED OR DUPLICATED IN ANY FORM OR BY ANY MEANS, WITHOUT +*** THE PRIOR WRITTEN PERMISSION OF "APOCALYPSE HARD- UND SOFTWARE". +*** +*** +*** DISCLAIMER +*** +*** THIS SOFTWARE AND INFORMATION IS PROVIDED "AS IS". NO REPRESENTATIONS OR +*** WARRANTIES ARE MADE WITH RESPECT TO THE ACCURACY, RELIABILITY, PERFOR- +*** MANCE, CURRENTNESS OR OPERATION OF THIS SOFTWARE AND INFORMATION, AND +*** ALL USE IS AT YOUR OWN RISK. NEITHER "APOCALYPSE HARD- UND SOFTWARE" NOR +*** THE AUTHORS ITSELF ASSUME ANY RESPONSIBILITY OR LIABILITY WHATSOEVER +*** WITH RESPECT TO YOUR USE OF THIS SOFTWARE AND INFORMATION. +*** +*** +*** +*** +*** $Log$ +*** Revision 1.1 2004/07/10 20:31:44 damato +*** - inital checkin +*** +*** +*** +******************************************************************************** +\******************************************************************************/ + +#include <intuition/gadgetclass.h> +#include <intuition/imageclass.h> +#include <intuition/intuition.h> +#include <clib/alib_protos.h> +#include <libraries/mui.h> + +#include <compiler.h> +#include <debug.h> + + +#include "ClosedNodeWin98_rev.h" + +#define IMAGE "ClosedNodeWin98" + + +#define libfunc(x) image_Lib ## x +#define reqfunc muilink_use_image +#define addname(x) image_ ## x + + +/* +** $setver$ +*/ +STATIC const char UserLibID[] = VERSTAG; + + +struct Data { + + struct MUI_RenderInfo *mri; +}; + + +#include <MUI/imageheader.c> + + +STATIC ULONG ASM _BoopsiQuery( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) struct MUI_BoopsiQuery *mbq ) +{ + struct Data *data = INST_DATA( cl, obj ); + + //D(bug( "\n" ) ); + + if ( mbq->mbq_Flags & MBQF_HORIZ ) + { + mbq->mbq_MinWidth = 9; + mbq->mbq_MaxWidth = MBQ_MUI_MAXMAX; + mbq->mbq_DefWidth = 9; + + mbq->mbq_MinHeight = 9; + mbq->mbq_MaxHeight = MBQ_MUI_MAXMAX; + mbq->mbq_DefHeight = 9; + } + else + { + mbq->mbq_MinWidth = 9; + mbq->mbq_MaxWidth = MBQ_MUI_MAXMAX; + mbq->mbq_DefWidth = 9; + + mbq->mbq_MinHeight = 9; + mbq->mbq_MaxHeight = MBQ_MUI_MAXMAX; + mbq->mbq_DefHeight = 9; + } + + data->mri = mbq->mbq_RenderInfo; + + return( MUIM_BoopsiQuery ); +} + + + +STATIC ULONG ASM _Draw( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) struct impDraw *msg ) +{ + #define img ( (struct Image *)obj ) + struct Data *data = INST_DATA( cl, obj ); + struct RastPort *rp = msg->imp_RPort; + + if ( rp != NULL ) + { + ULONG l = img->LeftEdge + msg->imp_Offset.X; + ULONG t = img->TopEdge + msg->imp_Offset.Y; + ULONG w = img->Width; + ULONG h = img->Height; + ULONG r = l + w - 1; + ULONG b = t + h - 1; + BOOL sel = ( msg->imp_State == IDS_SELECTED ) ? TRUE : FALSE; + UBYTE backgroundpen = data->mri ? data->mri->mri_Pens[MPEN_BACKGROUND] : msg->imp_DrInfo->dri_Pens[BACKGROUNDPEN]; + UBYTE halfshinepen = data->mri ? data->mri->mri_Pens[MPEN_HALFSHINE] : msg->imp_DrInfo->dri_Pens[SHINEPEN]; + UBYTE halfshadowpen = data->mri ? data->mri->mri_Pens[MPEN_HALFSHADOW] : msg->imp_DrInfo->dri_Pens[SHADOWPEN]; + UBYTE shadowpen = data->mri ? data->mri->mri_Pens[MPEN_SHADOW] : msg->imp_DrInfo->dri_Pens[SHADOWPEN]; + UBYTE shinepen = data->mri ? data->mri->mri_Pens[MPEN_SHINE] : msg->imp_DrInfo->dri_Pens[SHINEPEN]; + + //D(bug( "\n" ) ); + + SetDrMd( rp, JAM1 ); + + /* + if ( ( w > 2 ) && ( h > 2 ) ) + { + SetAPen( rp, backgroundpen ); + RectFill( rp, l, t, r, b ); + } + */ + + SetAPen( rp, halfshadowpen ); + + /* + ** ######### + ** #+++++++# + ** #+++++++# + ** #+++++++# + ** #+++++++# + ** #+++++++# + ** #+++++++# + ** #+++++++# + ** ######### + */ + Move( rp, l, t ); + Draw( rp, r, t ); + Draw( rp, r, b ); + Draw( rp, l, b ); + Draw( rp, l, t ); + + SetAPen( rp, shadowpen ); + + /* + ** ********* + ** *+++++++* + ** *+++#+++* + ** *+++#+++* + ** *+#####+* + ** *+++#+++* + ** *+++#+++* + ** *+++++++* + ** ********* + */ + Move( rp, l + 4, t + 2 ); + Draw( rp, l + 4, b - 2 ); + + Move( rp, l + 2, t + 4 ); + Draw( rp, r - 2, t + 4 ); + } + + return( 0 ); +} + + +ULONG ASM SAVEDS _Dispatcher( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg ) +{ + switch ( msg->MethodID ) + { + case IM_DRAW: return( _Draw( cl, obj, (APTR)msg ) ); + case MUIM_BoopsiQuery: return( _BoopsiQuery( cl, obj, (APTR)msg ) ); + } + + return( DoSuperMethodA( cl, obj, msg ) ); +} + + diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98.image b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98.image new file mode 100755 index 0000000000000000000000000000000000000000..8f355a49374ecf8e8759523b9ce87ac8d47c748f GIT binary patch literal 1608 zcwTK)Z)h8J7=A9fHrF$hvs5Xg)SuUDO+%W?ip*JxB>m?#O`^1&8$(&zt-EHV&6%d4 zqi8Bq{3willi?>pokNBU1cmx#%&`wz1pCQ?Uy9XHn0|58*5`N0YCCr1xqILDdGC3D zd4KQS0l~jeI|B8q!rvUPDiHi#+8%OCuwEOP=odr9(&Fs7T<P5G$-=^m$K!?hX?Io} zjVDCpD9<m%6Nw%?Hc1Lsh*iRpW%hWacW9g@Do~naFj1?Euif&rH&-~j7%vuP%G2ey zfx<#%sZc4D7WPAr)PY~;Y;k&V5pXt@cw8I%M~a$nLG2j>QV;f)FaL1mjyF|CtO(?; z?_IN!>8jiR)H0f&kss}Hpwnwa^Y|88`*)xWzQK4Pdb{gon5ivv*Y5mx%}nR6?^cAK z*{D==OU~xA&Cy(~o?yN7JcO%j_Yg$0hkVq`#vImD<GnD=tcOG|jLWNK^!1{pg6Hw` ziU^R8i%@36yCn7S(nGy&>P=8j`%<c<?r{y{T*2K~Hunv;Eu2oes+G+*Ub!>LtbP8L zT-!3FmU2kz9gHwXqz|clQul93jq`@qD{Hx0EIW-oD-OA?W&eL7T2u0ruNIhjap=MB zl<bMu#k<#gl2F|l#wPZC%^giKhp{|+ull{$$ekt^c8{c}7T7h52zNTr#8{o3$_vJ{ zTDNy+2CqS*uhwnVLpbRvnT;v`|3N>rreP7I^3x(&*BTI1=k*xx43pE`W;1zEnKAW| zm@3s@rMexi@9L9kwL19bNw-z4zWd!rUz~5Vb=kS#usD-%ui5H{v<<t-)@@Dt4a2W& zBOE!CTe`Xf!`ZZtMaS$k5@rdB?s=%TgP3^2g>r=RpgF7ApZYqS@7Jnvg}&~r*1VXK z=x|oe&{{RBOujE;k;e6v$xC9a3@XL?dLS&X4fY7SP2CNP3kY+vB52Gvi+LF49N2Yc zY0so!S@jG~T?E?y8T6T9j<W~sF1v8muwj+a0->0kjNQ-8aS<{bIi&`z2H(<sORZa> z1D4NvFaouEt<b6W%*Lq|asgjKJ@L@iMQEye>H~AUrY&rApQzS7Dr7c_fB(wv<(9mr z&Ljj8HV1&`jLsC=h*m}nqMc7w1fuIRSQ^BD+$-*$Zk4#dI%kqQAujCg<TJLO*=~Rz z%?QnP$QWV{ZTY?fOdpxJWb*Bq?I5?-E+NdbZjF&`C2O$vn!`6!L)2y`xjtCjX;FeI z8D=`n-12L#KStw6YTT8Xe(jqFYTqPtLq_cZIeAVAt<qA0L%%o|sq9yilO^lPjNqR< z8SsyW4*JK52+_`GE6+QBBR-Z72*DYLe7`e}*NF)tN2G~SA_V^%5ajnD@F~$k_cpOi S#K?VHs}sCW{DInc;{Jbsl$fXh literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98.image.info b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98.image.info new file mode 100755 index 0000000000000000000000000000000000000000..4aee820b2d5d4c3e91f904fef8ce7da7ab09b763 GIT binary patch literal 831 zcwTjqu}cDR6vyAC9SWi55DFqn&f(CIQ$a&sK?Ks&kS-13ASEt={-l=BL2q(wXuKi+ zgPV%}3rTTqED)}H@B6ckz{mag+<o5T9rxv?2{MT5f-Y&7w#f9KjYub*^N&ma%Ls)d z*QF8PDt-Pc2k@3PGIyRrfnFlWFEDO`jTGosg+^DUgjB7A>Av*Ut9Yu7UxcapL};cp zLoRrWeP(3^d*H^S3b5mGeUiYNkZl$GOVP7!g>5TG?}fp4!9MVP`~!af0lsaCFMIZ; zcyD$izEhgXd^U#pqx+=z;XEupzldUgAA5!l_U9e_UPt>T{B{feu*G{61xjaLBxJt) zhUJWs%$b}yvylbeJE75?f^?;sL0`RrwXrMY%$a6dfg$ucb75r#dmv{WWUvyHl*|WI zkj#r@N#<w1k5Aw^bN20w__8;G_a^Y2J<MlgQSqEP`{5iuztH>pnCHyJJK8(iH{m&R S_MCa~_aE_V{rLR!gnj_}9=9_9 literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98_rev.h b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98_rev.h new file mode 100755 index 0000000000..f180ae6642 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/ClosedNodeWin98_rev.h @@ -0,0 +1,51 @@ +/*****************************************************************************\ +** +** ClosedNodeWin98_rev.h - built automatically by Revisor 1.5 +** +** +** Copyright ©1998-99 by Apocalypse Hard- und Software Carsten Scholling +** All rights reserved. +** +** +** DO NOT EDIT BY HAND!!! +** +\*****************************************************************************/ +#ifndef CLOSEDNODEWIN98_REV_H +#define CLOSEDNODEWIN98_REV_H + + +#define PROJECT_ID ((unsigned long) ('X')<<24 | (unsigned long) ('E')<<16 | (unsigned long) ('N')<<8 | (unsigned long) ('B')) + +#define PROJECTNAME "ClosedNodeWin98.image" +#define NAME "ClosedNodeWin98.image" +#define DESCRIPTION "MUI bar image" +#define FULLNAME "ClosedNodeWin98.image - MUI image" +#define AUTHOR "Carsten Scholling" +#define COPYRIGHT "Copyright ©2000 Apocalypse Hard- und Software" + +#define PROJECTVERSION 0 +#define PROJECTREVISION 0 +#define VERSION 1 +#define REVISION 0 +#define ALPHAVERSION 0 +#define BETAVERSION 0 + +#define DATE "11.07.00" +#define TIME "21:41:56" +#define DAY "Dienstag" + +#define VERSION_STRING "1.0" +#define FULLVERSION_STRING "1.0 (11.07.00)" + +#define PVERSION_STRING "0.0" +#define PFULLVERSION_STRING "0.0 (11.07.00)" + +#define VERS "ClosedNodeWin98.image 1.0" +#define VSTRING "ClosedNodeWin98.image 1.0 (11.07.00)\r\n" +#define VERSTAG "\0$VER: ClosedNodeWin98.image 1.0 (11.07.00)" + +#define CATALOG_NAME "ClosedNodeWin98.image.catalog" +#define CATALOG_VERSION 1 + +#endif /* CLOSEDNODEWIN98_REV_H */ + diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/SCOPTIONS b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/SCOPTIONS new file mode 100755 index 0000000000..996478a944 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/SCOPTIONS @@ -0,0 +1,23 @@ +CODE=FAR +NOSTACKCHECK +STRINGMERGE +UNSIGNEDCHARS +NOCHECKABORT +COMMENTNEST +NOMULTIPLEINCLUDES +STRUCTUREEQUIVALENCE +OPTIMIZERINLINELOCAL +SMALLCODE +SMALLDATA +NOVERSION +NOICONS +BATCH +OPTIMIZERTIME +NOERRORLISTING +INCLUDEDIR=//include/ +INCLUDEDIR=Src:Support +INCLUDEDIR=SC:Include +INCLUDEDIR=Prog:Compiler/misc-include +INCLUDEDIR=Prog:Compiler/my-include +DEFINE __APHASO__ +MAXIMUMWARNINGS=50 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/SCOPTIONS.in b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/SCOPTIONS.in new file mode 100755 index 0000000000..05c1e21775 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/SCOPTIONS.in @@ -0,0 +1,22 @@ +CODE=FAR +NOSTACKCHECK +STRINGMERGE +UNSIGNEDCHARS +NOCHECKABORT +COMMENTNEST +NOMULTIPLEINCLUDES +STRUCTUREEQUIVALENCE +OPTIMIZERINLINELOCAL +SMALLCODE +SMALLDATA +NOVERSION +NOICONS +BATCH +OPTIMIZERTIME +NOERRORLISTING +INCLUDEDIR=Src:Support +INCLUDEDIR=SC:Include +INCLUDEDIR=Prog:Compiler/misc-include +INCLUDEDIR=Prog:Compiler/my-include +DEFINE __APHASO__ +MAXIMUMWARNINGS=50 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/SMakefile b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/SMakefile new file mode 100755 index 0000000000..5ea0199e9d --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/ClosedNodeWin98/SMakefile @@ -0,0 +1,154 @@ +###############################################################################\ +################################################################################ +### +### $Source$ +### $Revision: 2 $ +### $Date: 2004-07-10 22:31:44 +0200 (Sa, 10. Jul 2004) $ +### +### $Id: SMakefile 2 2004-07-10 20:31:44Z damato $ +### +### $Author: damato $ +### +### +### +### UNLESS OTHERWISE NOTED, ALL FILES ARE +### COPYRIGHT (C) 1998 BY "APOCALYPSE HARD- UND SOFTWARE CARSTEN SCHOLLING". +### ALL RIGHTS RESERVED. +### +### NO PART OF THIS SOFTWARE MAY BE COPIED, REPRODUCED, TRANSMITTED, REDIST- +### RIBUTED, DISCLOSED OR DUPLICATED IN ANY FORM OR BY ANY MEANS, WITHOUT +### THE PRIOR WRITTEN PERMISSION OF "APOCALYPSE HARD- UND SOFTWARE". +### +### +### DISCLAIMER +### +### THIS SOFTWARE AND INFORMATION IS PROVIDED "AS IS". NO REPRESENTATIONS OR +### WARRANTIES ARE MADE WITH RESPECT TO THE ACCURACY, RELIABILITY, PERFOR- +### MANCE, CURRENTNESS OR OPERATION OF THIS SOFTWARE AND INFORMATION, AND +### ALL USE IS AT YOUR OWN RISK. NEITHER "APOCALYPSE HARD- UND SOFTWARE" NOR +### THE AUTHORS ITSELF ASSUME ANY RESPONSIBILITY OR LIABILITY WHATSOEVER +### WITH RESPECT TO YOUR USE OF THIS SOFTWARE AND INFORMATION. +### +### +### +### +### $Log$ +### Revision 1.1 2004/07/10 20:31:44 damato +### - inital checkin +### +### +### +################################################################################ +###############################################################################/ + + +############################################################################# +## Configurable Parameters + +PROJECT = NListtree +VERSION = 18.7 + +BASEDIR = Src:NListtree + +CLASS = ClosedNodeWin98.image +CLASSOBJ = ClosedNodeWin98.o + +# + +GSTFILE = //$(PROJECT).gst + +CC = sc +AC = asm +LD = slink +BRUSH2C = brush2c +REVB = Revisor + +# + +#CFLAGS = GST=$(GSTFILE) IDLEN=65 +CFLAGS = GST=$(GSTFILE) IDLEN=65 OPTMIZE + +AFLAGS = -d + +#LDFLAGS = SC SD BATCH NOICONS +LDFLAGS = SC SD BATCH NOICONS NODEBUG + +#DEBUGFLAGS = DEBUG=FULL DEFINE MYDEBUG +#DEBUGFLAGS = DEBUG=FULL +#DEBUGFLAGS = DEFINE MYDEBUG +DEBUGFLAGS = + +# + +STARTUP = LIB:c.o +LIB = LIB:sc.lib LIB:small.lib +DEBUG_LIB = LIB:debug.lib + + +############################################################################# +## RULEZ + +.c.o: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCompiling *e[32m$@*e[0m" + @$(CC) $(CFLAGS) $(DEBUGFLAGS) $*.c + +.cpp.o: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCompiling *e[32m$@*e[0m" + @$(CC) $(CFLAGS) $(DEBUGFLAGS) $*.cpp + +.s.o: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCompiling *e[32m$@*e[0m" + @$(AC) $(AFLAGS) $*.s + +.ilbm.c: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCreating image source *e[32m$@*e[0m" + @$(BRUSH2C) $*.ilbm > $*.c + + +############################################################################# +## COMMAND LINE OPTIONS + + +############################################################################# +## Main program + + +all: $(CLASS) + +$(CLASS): $(CLASSOBJ) + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mLinking *e[32m$@*e[0m" + $(LD) FROM $(CLASSOBJ) TO $@ LIB $(LIB) $(DEBUG_LIB) $(LDFLAGS) + + +############################################################################# +## +## + +#Revisor FILE "ClosedNodeWin98" APPL $(CLASS) PRO $(PROJECT) VER 1 REV 1 DESC "MUI list tree class image" AUT "Carsten Scholling" COPY "Copyright ©1999-2001 Apocalypse Hard- und Software" C NOCPPC + +bump: + @echo "*e[32m*e[1m$(CLASS).mcc: *e[22m*e[33mBumping revision*e[0m" + $(REVB) FILE "ClosedNodeWin98" BUMPREV + + +install: + @echo "*e[32mInstalling class $(CLASS) locally...*e[0m" + @copy clone $(CLASS) MUI:Images/aphaso + #@avail flush + + +installdist: + @echo "*e[32mInstalling class $(CLASS)...*e[0m" + @copy clone $(CLASS) $(BASEDIR)/MCC_$(PROJECT)/Images/aphaso + +installcat: + @echo "*e[32mInstalling catalog files for class $(CLASS)...*e[0m" + #@copy clone all catalogs $(BASEDIR)/MCC_$(PROJECT)/locale + + +clean: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mDeleting trash of $(CLASS)...*e[0m" + @echo "Trash" >Trash.o + @list pat (\#?.o|\#?oPPC|\#?.obj|\#?.bak|\#?.lnk|\#?.mcc|\#?.mcp|\#?.0?0|\#?.elf) lformat "delete %p%n" >pipe:$(PROJECT)_delete + @execute pipe:$(PROJECT)_delete + diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode.c b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode.c new file mode 100755 index 0000000000..50bea043b6 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode.c @@ -0,0 +1,222 @@ +/******************************************************************************\ +******************************************************************************** +*** +*** $Source$ +*** $Revision$ +*** $Date$ +*** +*** $Id$ +*** +*** $Author$ +*** +*** +*** +*** UNLESS OTHERWISE NOTED, ALL FILES ARE +*** COPYRIGHT (C) 2000 BY "APOCALYPSE HARD- UND SOFTWARE CARSTEN SCHOLLING". +*** ALL RIGHTS RESERVED. +*** +*** NO PART OF THIS SOFTWARE MAY BE COPIED, REPRODUCED, TRANSMITTED, REDIST- +*** RIBUTED, DISCLOSED OR DUPLICATED IN ANY FORM OR BY ANY MEANS, WITHOUT +*** THE PRIOR WRITTEN PERMISSION OF "APOCALYPSE HARD- UND SOFTWARE". +*** +*** +*** DISCLAIMER +*** +*** THIS SOFTWARE AND INFORMATION IS PROVIDED "AS IS". NO REPRESENTATIONS OR +*** WARRANTIES ARE MADE WITH RESPECT TO THE ACCURACY, RELIABILITY, PERFOR- +*** MANCE, CURRENTNESS OR OPERATION OF THIS SOFTWARE AND INFORMATION, AND +*** ALL USE IS AT YOUR OWN RISK. NEITHER "APOCALYPSE HARD- UND SOFTWARE" NOR +*** THE AUTHORS ITSELF ASSUME ANY RESPONSIBILITY OR LIABILITY WHATSOEVER +*** WITH RESPECT TO YOUR USE OF THIS SOFTWARE AND INFORMATION. +*** +*** +*** +*** +*** $Log$ +*** Revision 1.1 2004/07/10 20:31:44 damato +*** - inital checkin +*** +*** +*** +******************************************************************************** +\******************************************************************************/ + +#include <intuition/gadgetclass.h> +#include <intuition/imageclass.h> +#include <intuition/intuition.h> +#include <clib/alib_protos.h> +#include <libraries/mui.h> + +#include <compiler.h> +#include <debug.h> + + +#include "OpenNode_rev.h" + +#define IMAGE "OpenNode" + + +#define libfunc(x) image_Lib ## x +#define reqfunc muilink_use_image +#define addname(x) image_ ## x + + +/* +** $setver$ +*/ +STATIC const char UserLibID[] = VERSTAG; + + +struct Data { + + struct MUI_RenderInfo *mri; +}; + + +#include <MUI/imageheader.c> + + +STATIC ULONG ASM _BoopsiQuery( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) struct MUI_BoopsiQuery *mbq ) +{ + struct Data *data = INST_DATA( cl, obj ); + + //D(bug( "\n" ) ); + + if ( mbq->mbq_Flags & MBQF_HORIZ ) + { + mbq->mbq_MinWidth = 8; + mbq->mbq_MaxWidth = MBQ_MUI_MAXMAX; + mbq->mbq_DefWidth = 8; + + mbq->mbq_MinHeight = 8; + mbq->mbq_MaxHeight = MBQ_MUI_MAXMAX; + mbq->mbq_DefHeight = 8; + } + else + { + mbq->mbq_MinWidth = 8; + mbq->mbq_MaxWidth = MBQ_MUI_MAXMAX; + mbq->mbq_DefWidth = 8; + + mbq->mbq_MinHeight = 8; + mbq->mbq_MaxHeight = MBQ_MUI_MAXMAX; + mbq->mbq_DefHeight = 8; + } + + data->mri = mbq->mbq_RenderInfo; + + return( MUIM_BoopsiQuery ); +} + + + +STATIC ULONG ASM _Draw( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) struct impDraw *msg ) +{ + #define img ( (struct Image *)obj ) + struct Data *data = INST_DATA( cl, obj ); + struct RastPort *rp = msg->imp_RPort; + + if ( rp != NULL ) + { + ULONG l = img->LeftEdge + msg->imp_Offset.X; + ULONG t = img->TopEdge + msg->imp_Offset.Y; + ULONG w = img->Width; + ULONG h = img->Height; + ULONG r = l + w - 1; + ULONG b = t + h - 1; + BOOL sel = ( msg->imp_State == IDS_SELECTED ) ? TRUE : FALSE; + UBYTE backgroundpen = data->mri ? data->mri->mri_Pens[MPEN_BACKGROUND] : msg->imp_DrInfo->dri_Pens[BACKGROUNDPEN]; + UBYTE halfshinepen = data->mri ? data->mri->mri_Pens[MPEN_HALFSHINE] : msg->imp_DrInfo->dri_Pens[BACKGROUNDPEN]; + UBYTE shadowpen = data->mri ? data->mri->mri_Pens[MPEN_SHADOW] : msg->imp_DrInfo->dri_Pens[SHADOWPEN]; + UBYTE shinepen = data->mri ? data->mri->mri_Pens[MPEN_SHINE] : msg->imp_DrInfo->dri_Pens[SHINEPEN]; + + //D(bug( "\n" ) ); + + SetDrMd( rp, JAM1 ); + + /* + if ( ( w > 2 ) && ( h > 2 ) ) + { + SetAPen( rp, backgroundpen ); + RectFill( rp, l, t, r, b ); + } + */ + + SetAPen( rp, sel ? shadowpen : shinepen ); + + /* + ** *******+ + ** *+++++++ + ** +*++++++ + ** +*++++++ + ** ++*+++++ + ** ++*+++++ + ** +++*++++ + ** +++*++++ + */ + Move( rp, r - 1, t ); + Draw( rp, l, t ); + Draw( rp, l + 3, b ); + + SetAPen( rp, sel ? shinepen : shadowpen ); + + /* + ** *******# + ** *++++++# + ** +*++++#+ + ** +*++++#+ + ** ++*++#++ + ** ++*++#++ + ** +++*#+++ + ** +++*#+++ + */ + Move( rp, r, t ); + Draw( rp, r - 3, b ); + + /* + ** Arrow fill... + */ + SetAPen( rp, halfshinepen ); + + /* + ** ******** + ** *######* + ** +*####*+ + ** +*####*+ + ** ++*##*++ + ** ++*##*++ + ** +++**+++ + ** +++**+++ + */ + Move( rp, l + 1, t + 1 ); + Draw( rp, r - 1, t + 1 ); + + Move( rp, l + 2, t + 2 ); + Draw( rp, r - 2, t + 2 ); + + Move( rp, l + 2, t + 3 ); + Draw( rp, r - 2, t + 3 ); + + Move( rp, l + 3, t + 4 ); + Draw( rp, r - 3, t + 4 ); + + Move( rp, l + 3, t + 5 ); + Draw( rp, r - 3, t + 5 ); + } + + return( 0 ); +} + + +ULONG ASM SAVEDS _Dispatcher( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg ) +{ + switch ( msg->MethodID ) + { + case IM_DRAW: return( _Draw( cl, obj, (APTR)msg ) ); + case MUIM_BoopsiQuery: return( _BoopsiQuery( cl, obj, (APTR)msg ) ); + } + + return( DoSuperMethodA( cl, obj, msg ) ); +} + + diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode.image b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode.image new file mode 100755 index 0000000000000000000000000000000000000000..474b07adb0b7857cfc5f8850d49cb4483bd14849 GIT binary patch literal 1772 zcwTK)QA`_k82_$4+T(1RbE!*1i2HjSwQb5>*BB&(Xv>BkrE~@m77|@y!qEljtx%&2 z(GEBD!3TBjb@5RrE@oMl_+Y|(SaeyINlfHP9#IrY=8G-}{{DA`6=T!i-S>UJ@B4lK z`|f{tMBYEi{dsC<0soJ17KyySa@(eSg|y+GflhY9o|w&-UYpR1Gh@~SJE|vH^eB$c z>d9n`4zgUT04xCt7v9A$yA2};Op?&ZgE6-geQK4*?5X1EIeoe~ULGsINmQJjuN3Et zrP=+^UITEv!|Ca<xj7<pUC?!@_irwzzCmKFmnidack$Bqm+#m^WlBsF<*)57Y3Xd$ z>U?5>8c6~_*lLmt&qu+&4GMK`lhFMN;)mnkwZ2GdW`iPb<v%NGHh*nrp2@kj`D(sm zu0Iuw=iPn`{jxK}ELqwlF9mHX#MS<UiGHHqMylFxQ?iYeOUq?Swb7w@dWL>H&phCD z=FhF!7q}ihx2G3@-T?HZFS%M~6Km+h3hpNQ^Iv0*e`V8_sPz|om+uTBYoEW(*S0`h zOE{qQ7WE*9W$RTuAJqKYTw_v^+ITNZO7xG>uBH=T*Mf7M6nB+u;j39>o;&t%XOz#x zZbkKKEKQ;{j@Ze4U$S1vAP2DmW-mIkm%xpJ3s_AVsChQjX$rKMB(dHaJ5*qZN$#|F z#=DnDf-lx=(WXG!7IJGt&h?ReU`@wa0?LP3x~A2|ppJ7pDg)poE2yUHl@SyF6BD`m zOHelgwY&PbSgm%S9kD`U_3dvy{9-a}$b53%Bs*1TcI}2ZY{h6aWJ7ZNUruaMAbKia zxw1`RbN%`Dc(0MAF118mkr@&VlRDUA776$JH%Ur9X)gEtkZLk-tyFb^d#;@jl1=8a z>R+kGg~5xgfk&gh)$@ZFj5MXn!u2a7x8~^+f%TRN${nc~G0hH>Dq8_|h631SQSuam zY=#tdif{*z5j>KiM5LDSI<-ehdXxb_M$!#DmzK<V>{sOx3ok~#BWa4NeV7=0%<M|G z+w$3@cnh*(P_#^khzTlo)Xvqxi)tThP<`0n3M{{4$;>}o#rk!%PZhb3dI|NYEr?vl ztwp{;DYuqeBfKWMSA*<CeJAE0sA|4}Mev?lw+6?Ohu+hCLyJy#hlxPz<#*tFU0(AI z*RgeRgY<~+B+vAyUd}}g-k*t%Co|9JyXdxeZK8W^Hs#i)w|~Yx&sS`zB~1(ns9i)) zD=irc10h5dpc&JQ5^MdOG>KRj-(mSm{;VNuCG1NX&k}YJJF~l8$Qg2OtAU(oj!BjY zMqyJFE~M(16d0W|h34Fr7w=J{L;)OStru(vtb#ovnRu5r+%s_3u|m?YLs^ML&LGo7 z=7!UA^?x+(L*p*bbb8;c>wOc<bsjak_!DE6D8wznd+aCk9F(1I{E6WGc!u|P9Gvd} zR`V@<4F~}e-U;|32={>ZL5>5j0;9kHkOz(fX@K|Y0Q}^9r#ycEAH&=MZU9q27~E%W OAMXR;H*&va5B>$IFTxf8 literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode.image.info b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode.image.info new file mode 100755 index 0000000000000000000000000000000000000000..4aee820b2d5d4c3e91f904fef8ce7da7ab09b763 GIT binary patch literal 831 zcwTjqu}cDR6vyAC9SWi55DFqn&f(CIQ$a&sK?Ks&kS-13ASEt={-l=BL2q(wXuKi+ zgPV%}3rTTqED)}H@B6ckz{mag+<o5T9rxv?2{MT5f-Y&7w#f9KjYub*^N&ma%Ls)d z*QF8PDt-Pc2k@3PGIyRrfnFlWFEDO`jTGosg+^DUgjB7A>Av*Ut9Yu7UxcapL};cp zLoRrWeP(3^d*H^S3b5mGeUiYNkZl$GOVP7!g>5TG?}fp4!9MVP`~!af0lsaCFMIZ; zcyD$izEhgXd^U#pqx+=z;XEupzldUgAA5!l_U9e_UPt>T{B{feu*G{61xjaLBxJt) zhUJWs%$b}yvylbeJE75?f^?;sL0`RrwXrMY%$a6dfg$ucb75r#dmv{WWUvyHl*|WI zkj#r@N#<w1k5Aw^bN20w__8;G_a^Y2J<MlgQSqEP`{5iuztH>pnCHyJJK8(iH{m&R S_MCa~_aE_V{rLR!gnj_}9=9_9 literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode_rev.h b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode_rev.h new file mode 100755 index 0000000000..0cf8765c75 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/OpenNode_rev.h @@ -0,0 +1,51 @@ +/*****************************************************************************\ +** +** OpenNode_rev.h - built automatically by Revisor 1.5 +** +** +** Copyright ©1998-99 by Apocalypse Hard- und Software Carsten Scholling +** All rights reserved. +** +** +** DO NOT EDIT BY HAND!!! +** +\*****************************************************************************/ +#ifndef OPENNODE_REV_H +#define OPENNODE_REV_H + + +#define PROJECT_ID ((unsigned long) ('X')<<24 | (unsigned long) ('E')<<16 | (unsigned long) ('N')<<8 | (unsigned long) ('B')) + +#define PROJECTNAME "OpenNode.image" +#define NAME "OpenNode.image" +#define DESCRIPTION "MUI bar image" +#define FULLNAME "OpenNode.image - MUI image" +#define AUTHOR "Carsten Scholling" +#define COPYRIGHT "Copyright ©2000 Apocalypse Hard- und Software" + +#define PROJECTVERSION 0 +#define PROJECTREVISION 0 +#define VERSION 1 +#define REVISION 0 +#define ALPHAVERSION 0 +#define BETAVERSION 0 + +#define DATE "11.07.00" +#define TIME "21:41:56" +#define DAY "Dienstag" + +#define VERSION_STRING "1.0" +#define FULLVERSION_STRING "1.0 (11.07.00)" + +#define PVERSION_STRING "0.0" +#define PFULLVERSION_STRING "0.0 (11.07.00)" + +#define VERS "OpenNode.image 1.0" +#define VSTRING "OpenNode.image 1.0 (11.07.00)\r\n" +#define VERSTAG "\0$VER: OpenNode.image 1.0 (11.07.00)" + +#define CATALOG_NAME "OpenNode.image.catalog" +#define CATALOG_VERSION 1 + +#endif /* OPENNODE_REV_H */ + diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/SCOPTIONS b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/SCOPTIONS new file mode 100755 index 0000000000..996478a944 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/SCOPTIONS @@ -0,0 +1,23 @@ +CODE=FAR +NOSTACKCHECK +STRINGMERGE +UNSIGNEDCHARS +NOCHECKABORT +COMMENTNEST +NOMULTIPLEINCLUDES +STRUCTUREEQUIVALENCE +OPTIMIZERINLINELOCAL +SMALLCODE +SMALLDATA +NOVERSION +NOICONS +BATCH +OPTIMIZERTIME +NOERRORLISTING +INCLUDEDIR=//include/ +INCLUDEDIR=Src:Support +INCLUDEDIR=SC:Include +INCLUDEDIR=Prog:Compiler/misc-include +INCLUDEDIR=Prog:Compiler/my-include +DEFINE __APHASO__ +MAXIMUMWARNINGS=50 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/SCOPTIONS.in b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/SCOPTIONS.in new file mode 100755 index 0000000000..05c1e21775 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/SCOPTIONS.in @@ -0,0 +1,22 @@ +CODE=FAR +NOSTACKCHECK +STRINGMERGE +UNSIGNEDCHARS +NOCHECKABORT +COMMENTNEST +NOMULTIPLEINCLUDES +STRUCTUREEQUIVALENCE +OPTIMIZERINLINELOCAL +SMALLCODE +SMALLDATA +NOVERSION +NOICONS +BATCH +OPTIMIZERTIME +NOERRORLISTING +INCLUDEDIR=Src:Support +INCLUDEDIR=SC:Include +INCLUDEDIR=Prog:Compiler/misc-include +INCLUDEDIR=Prog:Compiler/my-include +DEFINE __APHASO__ +MAXIMUMWARNINGS=50 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/SMakefile b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/SMakefile new file mode 100755 index 0000000000..6c5348b37d --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNode/SMakefile @@ -0,0 +1,154 @@ +###############################################################################\ +################################################################################ +### +### $Source$ +### $Revision: 2 $ +### $Date: 2004-07-10 22:31:44 +0200 (Sa, 10. Jul 2004) $ +### +### $Id: SMakefile 2 2004-07-10 20:31:44Z damato $ +### +### $Author: damato $ +### +### +### +### UNLESS OTHERWISE NOTED, ALL FILES ARE +### COPYRIGHT (C) 1998 BY "APOCALYPSE HARD- UND SOFTWARE CARSTEN SCHOLLING". +### ALL RIGHTS RESERVED. +### +### NO PART OF THIS SOFTWARE MAY BE COPIED, REPRODUCED, TRANSMITTED, REDIST- +### RIBUTED, DISCLOSED OR DUPLICATED IN ANY FORM OR BY ANY MEANS, WITHOUT +### THE PRIOR WRITTEN PERMISSION OF "APOCALYPSE HARD- UND SOFTWARE". +### +### +### DISCLAIMER +### +### THIS SOFTWARE AND INFORMATION IS PROVIDED "AS IS". NO REPRESENTATIONS OR +### WARRANTIES ARE MADE WITH RESPECT TO THE ACCURACY, RELIABILITY, PERFOR- +### MANCE, CURRENTNESS OR OPERATION OF THIS SOFTWARE AND INFORMATION, AND +### ALL USE IS AT YOUR OWN RISK. NEITHER "APOCALYPSE HARD- UND SOFTWARE" NOR +### THE AUTHORS ITSELF ASSUME ANY RESPONSIBILITY OR LIABILITY WHATSOEVER +### WITH RESPECT TO YOUR USE OF THIS SOFTWARE AND INFORMATION. +### +### +### +### +### $Log$ +### Revision 1.1 2004/07/10 20:31:44 damato +### - inital checkin +### +### +### +################################################################################ +###############################################################################/ + + +############################################################################# +## Configurable Parameters + +PROJECT = NListtree +VERSION = 18.7 + +BASEDIR = Src:NListtree + +CLASS = OpenNode.image +CLASSOBJ = OpenNode.o + +# + +GSTFILE = //$(PROJECT).gst + +CC = sc +AC = asm +LD = slink +BRUSH2C = brush2c +REVB = Revisor + +# + +#CFLAGS = GST=$(GSTFILE) IDLEN=65 +CFLAGS = GST=$(GSTFILE) IDLEN=65 OPTMIZE + +AFLAGS = -d + +#LDFLAGS = SC SD BATCH NOICONS +LDFLAGS = SC SD BATCH NOICONS NODEBUG + +#DEBUGFLAGS = DEBUG=FULL DEFINE MYDEBUG +#DEBUGFLAGS = DEBUG=FULL +#DEBUGFLAGS = DEFINE MYDEBUG +DEBUGFLAGS = + +# + +STARTUP = LIB:c.o +LIB = LIB:sc.lib LIB:small.lib +DEBUG_LIB = LIB:debug.lib + + +############################################################################# +## RULEZ + +.c.o: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCompiling *e[32m$@*e[0m" + @$(CC) $(CFLAGS) $(DEBUGFLAGS) $*.c + +.cpp.o: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCompiling *e[32m$@*e[0m" + @$(CC) $(CFLAGS) $(DEBUGFLAGS) $*.cpp + +.s.o: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCompiling *e[32m$@*e[0m" + @$(AC) $(AFLAGS) $*.s + +.ilbm.c: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCreating image source *e[32m$@*e[0m" + @$(BRUSH2C) $*.ilbm > $*.c + + +############################################################################# +## COMMAND LINE OPTIONS + + +############################################################################# +## Main program + + +all: $(CLASS) + +$(CLASS): $(CLASSOBJ) + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mLinking *e[32m$@*e[0m" + $(LD) FROM $(CLASSOBJ) TO $@ LIB $(LIB) $(DEBUG_LIB) $(LDFLAGS) + + +############################################################################# +## +## + +#Revisor FILE "OpenNode" APPL $(CLASS) PRO $(PROJECT) VER 1 REV 1 DESC "MUI list tree class image" AUT "Carsten Scholling" COPY "Copyright ©1999-2001 Apocalypse Hard- und Software" C NOCPPC + +bump: + @echo "*e[32m*e[1m$(CLASS).mcc: *e[22m*e[33mBumping revision*e[0m" + $(REVB) FILE "OpenNode" BUMPREV + + +install: + @echo "*e[32mInstalling class $(CLASS) locally...*e[0m" + @copy clone $(CLASS) MUI:Images/aphaso + #@avail flush + + +installdist: + @echo "*e[32mInstalling class $(CLASS)...*e[0m" + @copy clone $(CLASS) $(BASEDIR)/MCC_$(PROJECT)/Images/aphaso + +installcat: + @echo "*e[32mInstalling catalog files for class $(CLASS)...*e[0m" + #@copy clone all catalogs $(BASEDIR)/MCC_$(PROJECT)/locale + + +clean: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mDeleting trash of $(CLASS)...*e[0m" + @echo "Trash" >Trash.o + @list pat (\#?.o|\#?oPPC|\#?.obj|\#?.bak|\#?.lnk|\#?.mcc|\#?.mcp|\#?.0?0|\#?.elf) lformat "delete %p%n" >pipe:$(PROJECT)_delete + @execute pipe:$(PROJECT)_delete + diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98.c b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98.c new file mode 100755 index 0000000000..40227633fb --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98.c @@ -0,0 +1,197 @@ +/******************************************************************************\ +******************************************************************************** +*** +*** $Source$ +*** $Revision$ +*** $Date$ +*** +*** $Id$ +*** +*** $Author$ +*** +*** +*** +*** UNLESS OTHERWISE NOTED, ALL FILES ARE +*** COPYRIGHT (C) 2000 BY "APOCALYPSE HARD- UND SOFTWARE CARSTEN SCHOLLING". +*** ALL RIGHTS RESERVED. +*** +*** NO PART OF THIS SOFTWARE MAY BE COPIED, REPRODUCED, TRANSMITTED, REDIST- +*** RIBUTED, DISCLOSED OR DUPLICATED IN ANY FORM OR BY ANY MEANS, WITHOUT +*** THE PRIOR WRITTEN PERMISSION OF "APOCALYPSE HARD- UND SOFTWARE". +*** +*** +*** DISCLAIMER +*** +*** THIS SOFTWARE AND INFORMATION IS PROVIDED "AS IS". NO REPRESENTATIONS OR +*** WARRANTIES ARE MADE WITH RESPECT TO THE ACCURACY, RELIABILITY, PERFOR- +*** MANCE, CURRENTNESS OR OPERATION OF THIS SOFTWARE AND INFORMATION, AND +*** ALL USE IS AT YOUR OWN RISK. NEITHER "APOCALYPSE HARD- UND SOFTWARE" NOR +*** THE AUTHORS ITSELF ASSUME ANY RESPONSIBILITY OR LIABILITY WHATSOEVER +*** WITH RESPECT TO YOUR USE OF THIS SOFTWARE AND INFORMATION. +*** +*** +*** +*** +*** $Log$ +*** Revision 1.1 2004/07/10 20:31:44 damato +*** - inital checkin +*** +*** +*** +******************************************************************************** +\******************************************************************************/ + +#include <intuition/gadgetclass.h> +#include <intuition/imageclass.h> +#include <intuition/intuition.h> +#include <clib/alib_protos.h> +#include <libraries/mui.h> + +#include <compiler.h> +#include <debug.h> + + +#include "OpenNodeWin98_rev.h" + +#define IMAGE "OpenNodeWin98" + + +#define libfunc(x) image_Lib ## x +#define reqfunc muilink_use_image +#define addname(x) image_ ## x + + +/* +** $setver$ +*/ +STATIC const char UserLibID[] = VERSTAG; + + +struct Data { + + struct MUI_RenderInfo *mri; +}; + + +#include <MUI/imageheader.c> + + +STATIC ULONG ASM _BoopsiQuery( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) struct MUI_BoopsiQuery *mbq ) +{ + struct Data *data = INST_DATA( cl, obj ); + + //D(bug( "\n" ) ); + + if ( mbq->mbq_Flags & MBQF_HORIZ ) + { + mbq->mbq_MinWidth = 9; + mbq->mbq_MaxWidth = MBQ_MUI_MAXMAX; + mbq->mbq_DefWidth = 9; + + mbq->mbq_MinHeight = 9; + mbq->mbq_MaxHeight = MBQ_MUI_MAXMAX; + mbq->mbq_DefHeight = 9; + } + else + { + mbq->mbq_MinWidth = 9; + mbq->mbq_MaxWidth = MBQ_MUI_MAXMAX; + mbq->mbq_DefWidth = 9; + + mbq->mbq_MinHeight = 9; + mbq->mbq_MaxHeight = MBQ_MUI_MAXMAX; + mbq->mbq_DefHeight = 9; + } + + data->mri = mbq->mbq_RenderInfo; + + return( MUIM_BoopsiQuery ); +} + + + +STATIC ULONG ASM _Draw( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) struct impDraw *msg ) +{ + #define img ( (struct Image *)obj ) + struct Data *data = INST_DATA( cl, obj ); + struct RastPort *rp = msg->imp_RPort; + + if ( rp != NULL ) + { + ULONG l = img->LeftEdge + msg->imp_Offset.X; + ULONG t = img->TopEdge + msg->imp_Offset.Y; + ULONG w = img->Width; + ULONG h = img->Height; + ULONG r = l + w - 1; + ULONG b = t + h - 1; + BOOL sel = ( msg->imp_State == IDS_SELECTED ) ? TRUE : FALSE; + UBYTE backgroundpen = data->mri ? data->mri->mri_Pens[MPEN_BACKGROUND] : msg->imp_DrInfo->dri_Pens[BACKGROUNDPEN]; + UBYTE halfshinepen = data->mri ? data->mri->mri_Pens[MPEN_HALFSHINE] : msg->imp_DrInfo->dri_Pens[SHINEPEN]; + UBYTE halfshadowpen = data->mri ? data->mri->mri_Pens[MPEN_HALFSHADOW] : msg->imp_DrInfo->dri_Pens[SHADOWPEN]; + UBYTE shadowpen = data->mri ? data->mri->mri_Pens[MPEN_SHADOW] : msg->imp_DrInfo->dri_Pens[SHADOWPEN]; + UBYTE shinepen = data->mri ? data->mri->mri_Pens[MPEN_SHINE] : msg->imp_DrInfo->dri_Pens[SHINEPEN]; + + //D(bug( "\n" ) ); + + SetDrMd( rp, JAM1 ); + + /* + if ( ( w > 2 ) && ( h > 2 ) ) + { + SetAPen( rp, backgroundpen ); + RectFill( rp, l, t, r, b ); + } + */ + + SetAPen( rp, halfshadowpen ); + + /* + ** ######### + ** #+++++++# + ** #+++++++# + ** #+++++++# + ** #+++++++# + ** #+++++++# + ** #+++++++# + ** #+++++++# + ** ######### + */ + Move( rp, l, t ); + Draw( rp, r, t ); + Draw( rp, r, b ); + Draw( rp, l, b ); + Draw( rp, l, t ); + + SetAPen( rp, shadowpen ); + + /* + ** ********* + ** *+++++++* + ** *+++++++* + ** *+++++++* + ** *+#####+* + ** *+++++++* + ** *+++++++* + ** *+++++++* + ** ********* + */ + Move( rp, l + 2, t + 4 ); + Draw( rp, r - 2, t + 4 ); + } + + return( 0 ); +} + + +ULONG ASM SAVEDS _Dispatcher( REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg ) +{ + switch ( msg->MethodID ) + { + case IM_DRAW: return( _Draw( cl, obj, (APTR)msg ) ); + case MUIM_BoopsiQuery: return( _BoopsiQuery( cl, obj, (APTR)msg ) ); + } + + return( DoSuperMethodA( cl, obj, msg ) ); +} + + diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98.image b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98.image new file mode 100755 index 0000000000000000000000000000000000000000..0a0e32160b4b38d888a5210cebbeaed7a1018c3f GIT binary patch literal 1556 zcwTK(QD|FL82*ynHn*2huA`13r5<n7n#T0rE{v(AjHGk(_AW{18oM!-rQN#QxGuR% z8_`i_3e#s{%m*LDS9KQgp`akxJq#UtP#IW6=wq=u3ROf$ZT-$otgS5MyZ8V9??2yv z&VSB5K<GErf5FB(!2e5pD?sRHX?w_35gj{vazKoDlcikw{N$-(>Dgz@;-ztSQXDY* zMeG2dPn-Syy?9896fF^75S_BbHh<10jWNPQphX7FdQB|2m2q#Xcy7j=E>2X&D{lbB z(rmRjTP&A$LVK#fuX1jBd}ao)R|BT04*w-3jn|>{4g={2+gGoDbK{PeuOKlE<QBGX zMpI7B9e8vOEl|lj-8M9O&1gNohPHuC1cqK=T#bL-{XC5H8hYv@|Nh=^atm9tLd&eo z)^b&Q^@-Mau3k^Do^uJp)zte4q18hnZe$ZS>nUa*3?u8IzYqHLuPR9PVc#qc;@-Rn zk~c*-v*KNodN};AUJvz7QcwLvs-^F94#zozyNPV>b8c9(lX8`4w$Oaz&M32X_}g-B zbC6nrJz7_BlsUrLqw-$Ezb!Q`=xU#=<*JG7IJToE<h<tmbs}C@@&cchn0e*MgRL>y z6R(@2mwQuC+zH0=JHF~3OEZVD0(-Ccy;sSdAs2BUOH(cQr!kF4mkm`6H`shZFs9bK zy)`j(6DobBVJjXYDKC&&$@}Yrwr5Vyi3FARi&R5vP*9!kLmU|)r@F01YPT|D%Ku`D zR6jv=E7I82N0eG^=<+GIO{u;4<vSl=Xty-kxzJ&8w$M?xl{{_TYOyp+m41^xvW`gX zY_9skh`nkZ>KTsPmV=m4Moe6UB2*XHNInJCUdn!Vu+zSEZ{7^j*X*Ubmk1_1?WK75 z$NAB>q!nvko*%vDpBo`Ax5H4~h%to-BfV%Yv>F$oCyHQ~lP1*1(}+eJ89ZgZQ2)!I z&x~lwaJXvrlk0w8w-BvhA4I@E-5(i_2pi2jmpZK`-_m?bX;|T1md|?7gY~f@oUfgJ z+i>dRMbnG5hRvMJ%JlCiMsiiJr7HzNM2tb;NxdtLcA||Do#^0q5`*ae5K$FkP<EgD zp+(EwF^#8;y%n!+Zx%9^mRWCtAI-3*HW^(^p}mmY#U#m?k|}g#)<fJZtBeSrT6CCf z8(E$EqT0M^ls~K(PfpcClzS)2P$a`lo0)5V&E<z^d`peHGSjcUxU2Rena^a@8kA?r zE~8CafzXj3>?>6EtI4w>>&cAJuYBnKO$=p?ev&YV{rp<aaO6+KyCivHF-4pwUM5Zx oIl>{15ko{6{(T<gT^sy>h|s-7yhikpTdda!Z4kepe&=ue11|B5F#rGn literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98.image.info b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98.image.info new file mode 100755 index 0000000000000000000000000000000000000000..4aee820b2d5d4c3e91f904fef8ce7da7ab09b763 GIT binary patch literal 831 zcwTjqu}cDR6vyAC9SWi55DFqn&f(CIQ$a&sK?Ks&kS-13ASEt={-l=BL2q(wXuKi+ zgPV%}3rTTqED)}H@B6ckz{mag+<o5T9rxv?2{MT5f-Y&7w#f9KjYub*^N&ma%Ls)d z*QF8PDt-Pc2k@3PGIyRrfnFlWFEDO`jTGosg+^DUgjB7A>Av*Ut9Yu7UxcapL};cp zLoRrWeP(3^d*H^S3b5mGeUiYNkZl$GOVP7!g>5TG?}fp4!9MVP`~!af0lsaCFMIZ; zcyD$izEhgXd^U#pqx+=z;XEupzldUgAA5!l_U9e_UPt>T{B{feu*G{61xjaLBxJt) zhUJWs%$b}yvylbeJE75?f^?;sL0`RrwXrMY%$a6dfg$ucb75r#dmv{WWUvyHl*|WI zkj#r@N#<w1k5Aw^bN20w__8;G_a^Y2J<MlgQSqEP`{5iuztH>pnCHyJJK8(iH{m&R S_MCa~_aE_V{rLR!gnj_}9=9_9 literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98_rev.h b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98_rev.h new file mode 100755 index 0000000000..2abf0c8377 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/OpenNodeWin98_rev.h @@ -0,0 +1,51 @@ +/*****************************************************************************\ +** +** OpenNodeWin98_rev.h - built automatically by Revisor 1.5 +** +** +** Copyright ©1998-99 by Apocalypse Hard- und Software Carsten Scholling +** All rights reserved. +** +** +** DO NOT EDIT BY HAND!!! +** +\*****************************************************************************/ +#ifndef OPENNODEWIN98_REV_H +#define OPENNODEWIN98_REV_H + + +#define PROJECT_ID ((unsigned long) ('X')<<24 | (unsigned long) ('E')<<16 | (unsigned long) ('N')<<8 | (unsigned long) ('B')) + +#define PROJECTNAME "OpenNodeWin98.image" +#define NAME "OpenNodeWin98.image" +#define DESCRIPTION "MUI bar image" +#define FULLNAME "OpenNodeWin98.image - MUI image" +#define AUTHOR "Carsten Scholling" +#define COPYRIGHT "Copyright ©2000 Apocalypse Hard- und Software" + +#define PROJECTVERSION 0 +#define PROJECTREVISION 0 +#define VERSION 1 +#define REVISION 0 +#define ALPHAVERSION 0 +#define BETAVERSION 0 + +#define DATE "11.07.00" +#define TIME "21:41:56" +#define DAY "Dienstag" + +#define VERSION_STRING "1.0" +#define FULLVERSION_STRING "1.0 (11.07.00)" + +#define PVERSION_STRING "0.0" +#define PFULLVERSION_STRING "0.0 (11.07.00)" + +#define VERS "OpenNodeWin98.image 1.0" +#define VSTRING "OpenNodeWin98.image 1.0 (11.07.00)\r\n" +#define VERSTAG "\0$VER: OpenNodeWin98.image 1.0 (11.07.00)" + +#define CATALOG_NAME "OpenNodeWin98.image.catalog" +#define CATALOG_VERSION 1 + +#endif /* OPENNODEWIN98_REV_H */ + diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/SCOPTIONS b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/SCOPTIONS new file mode 100755 index 0000000000..996478a944 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/SCOPTIONS @@ -0,0 +1,23 @@ +CODE=FAR +NOSTACKCHECK +STRINGMERGE +UNSIGNEDCHARS +NOCHECKABORT +COMMENTNEST +NOMULTIPLEINCLUDES +STRUCTUREEQUIVALENCE +OPTIMIZERINLINELOCAL +SMALLCODE +SMALLDATA +NOVERSION +NOICONS +BATCH +OPTIMIZERTIME +NOERRORLISTING +INCLUDEDIR=//include/ +INCLUDEDIR=Src:Support +INCLUDEDIR=SC:Include +INCLUDEDIR=Prog:Compiler/misc-include +INCLUDEDIR=Prog:Compiler/my-include +DEFINE __APHASO__ +MAXIMUMWARNINGS=50 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/SCOPTIONS.in b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/SCOPTIONS.in new file mode 100755 index 0000000000..05c1e21775 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/SCOPTIONS.in @@ -0,0 +1,22 @@ +CODE=FAR +NOSTACKCHECK +STRINGMERGE +UNSIGNEDCHARS +NOCHECKABORT +COMMENTNEST +NOMULTIPLEINCLUDES +STRUCTUREEQUIVALENCE +OPTIMIZERINLINELOCAL +SMALLCODE +SMALLDATA +NOVERSION +NOICONS +BATCH +OPTIMIZERTIME +NOERRORLISTING +INCLUDEDIR=Src:Support +INCLUDEDIR=SC:Include +INCLUDEDIR=Prog:Compiler/misc-include +INCLUDEDIR=Prog:Compiler/my-include +DEFINE __APHASO__ +MAXIMUMWARNINGS=50 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/SMakefile b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/SMakefile new file mode 100755 index 0000000000..2d4c2f01f7 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/images/OpenNodeWin98/SMakefile @@ -0,0 +1,154 @@ +###############################################################################\ +################################################################################ +### +### $Source$ +### $Revision: 2 $ +### $Date: 2004-07-10 22:31:44 +0200 (Sa, 10. Jul 2004) $ +### +### $Id: SMakefile 2 2004-07-10 20:31:44Z damato $ +### +### $Author: damato $ +### +### +### +### UNLESS OTHERWISE NOTED, ALL FILES ARE +### COPYRIGHT (C) 1998 BY "APOCALYPSE HARD- UND SOFTWARE CARSTEN SCHOLLING". +### ALL RIGHTS RESERVED. +### +### NO PART OF THIS SOFTWARE MAY BE COPIED, REPRODUCED, TRANSMITTED, REDIST- +### RIBUTED, DISCLOSED OR DUPLICATED IN ANY FORM OR BY ANY MEANS, WITHOUT +### THE PRIOR WRITTEN PERMISSION OF "APOCALYPSE HARD- UND SOFTWARE". +### +### +### DISCLAIMER +### +### THIS SOFTWARE AND INFORMATION IS PROVIDED "AS IS". NO REPRESENTATIONS OR +### WARRANTIES ARE MADE WITH RESPECT TO THE ACCURACY, RELIABILITY, PERFOR- +### MANCE, CURRENTNESS OR OPERATION OF THIS SOFTWARE AND INFORMATION, AND +### ALL USE IS AT YOUR OWN RISK. NEITHER "APOCALYPSE HARD- UND SOFTWARE" NOR +### THE AUTHORS ITSELF ASSUME ANY RESPONSIBILITY OR LIABILITY WHATSOEVER +### WITH RESPECT TO YOUR USE OF THIS SOFTWARE AND INFORMATION. +### +### +### +### +### $Log$ +### Revision 1.1 2004/07/10 20:31:44 damato +### - inital checkin +### +### +### +################################################################################ +###############################################################################/ + + +############################################################################# +## Configurable Parameters + +PROJECT = NListtree +VERSION = 18.7 + +BASEDIR = Src:NListtree + +CLASS = OpenNodeWin98.image +CLASSOBJ = OpenNodeWin98.o + +# + +GSTFILE = //$(PROJECT).gst + +CC = sc +AC = asm +LD = slink +BRUSH2C = brush2c +REVB = Revisor + +# + +#CFLAGS = GST=$(GSTFILE) IDLEN=65 +CFLAGS = GST=$(GSTFILE) IDLEN=65 OPTMIZE + +AFLAGS = -d + +#LDFLAGS = SC SD BATCH NOICONS +LDFLAGS = SC SD BATCH NOICONS NODEBUG + +#DEBUGFLAGS = DEBUG=FULL DEFINE MYDEBUG +#DEBUGFLAGS = DEBUG=FULL +#DEBUGFLAGS = DEFINE MYDEBUG +DEBUGFLAGS = + +# + +STARTUP = LIB:c.o +LIB = LIB:sc.lib LIB:small.lib +DEBUG_LIB = LIB:debug.lib + + +############################################################################# +## RULEZ + +.c.o: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCompiling *e[32m$@*e[0m" + @$(CC) $(CFLAGS) $(DEBUGFLAGS) $*.c + +.cpp.o: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCompiling *e[32m$@*e[0m" + @$(CC) $(CFLAGS) $(DEBUGFLAGS) $*.cpp + +.s.o: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCompiling *e[32m$@*e[0m" + @$(AC) $(AFLAGS) $*.s + +.ilbm.c: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mCreating image source *e[32m$@*e[0m" + @$(BRUSH2C) $*.ilbm > $*.c + + +############################################################################# +## COMMAND LINE OPTIONS + + +############################################################################# +## Main program + + +all: $(CLASS) + +$(CLASS): $(CLASSOBJ) + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mLinking *e[32m$@*e[0m" + $(LD) FROM $(CLASSOBJ) TO $@ LIB $(LIB) $(DEBUG_LIB) $(LDFLAGS) + + +############################################################################# +## +## + +#Revisor FILE "OpenNodeWin98" APPL $(CLASS) PRO $(PROJECT) VER 1 REV 1 DESC "MUI list tree class image" AUT "Carsten Scholling" COPY "Copyright ©1999-2001 Apocalypse Hard- und Software" C NOCPPC + +bump: + @echo "*e[32m*e[1m$(CLASS).mcc: *e[22m*e[33mBumping revision*e[0m" + $(REVB) FILE "OpenNodeWin98" BUMPREV + + +install: + @echo "*e[32mInstalling class $(CLASS) locally...*e[0m" + @copy clone $(CLASS) MUI:Images/aphaso + #@avail flush + + +installdist: + @echo "*e[32mInstalling class $(CLASS)...*e[0m" + @copy clone $(CLASS) $(BASEDIR)/MCC_$(PROJECT)/Images/aphaso + +installcat: + @echo "*e[32mInstalling catalog files for class $(CLASS)...*e[0m" + #@copy clone all catalogs $(BASEDIR)/MCC_$(PROJECT)/locale + + +clean: + @echo "*e[32m*e[1m$(CLASS): *e[22m*e[33mDeleting trash of $(CLASS)...*e[0m" + @echo "Trash" >Trash.o + @list pat (\#?.o|\#?oPPC|\#?.obj|\#?.bak|\#?.lnk|\#?.mcc|\#?.mcp|\#?.0?0|\#?.elf) lformat "delete %p%n" >pipe:$(PROJECT)_delete + @execute pipe:$(PROJECT)_delete + diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/Samples/AllImages.ilbm b/workbench/classes/zune/nlist/nlisttree_mcc/images/Samples/AllImages.ilbm new file mode 100755 index 0000000000000000000000000000000000000000..1b707aba11cacacaa45973ac641c52348c9e3562 GIT binary patch literal 5900 zcwX&Q&r2M46o22D@9xen%Q`|gH3`%)gdC&?b1-;FaokunqBto#!RC^^2qBkv@gPK; zra6@0L3)rLrFbx7YZY=3!7{ollpc!59QO|h#8NP}U3dE4`_Ar;X+8ANLt%M`@4ojw zpZDwg=DQ<PpG^XMDDO@bCJU2e!vOGs=7}nvAVGK_ayioPOb$6{>RVY^!6OXAPiDTI zpP%2{-1NU*2>q4tmwV<MxVu01&&<KxE`0jp?TZ(?u6t)_a+E?jx(UP1U5mr!AXk_g z{v6=a(l-1%IRjYyGlbgSKmH<rs?hVi2W&@@BQ<>O`B1R9tQ6aNF2FWr3}`<*Y5})O zW(#OPT#f^0r<Pm5B_{@)or*^kPg}s+!k2O2(>SoUusCWqBMNU!DH#Tim=d5H;Iz!} z496WMV?Ky8Y7B{3v&`!Ege=2v0GXh{oGp-}*Ms$PlRRw7GY|wlgB-VO6X<bG+o)EM zuIB-qa-*kUgmV=cO?+VVU`^<Vjv^?Vt!YKG0>_}T3G6gXAvg09{B^<#oJ*KMiv{9< zblXyhabNSdD7VZP!L<pi6?(isP<H_g)`zd54i>eh*%tZS`>F7VS($b8#8{XS9<^Ay z1$tO+5yyQAoKED6`|(_&IM!lm7H9|YY>8rDBb)D?&!+lo^29+rndTp<xnghSbFI0L zE~L5lHP^W)UGF#Nngj1#bE0?k@3Z_JbOF%S;O(>sgLMe;Dz{r1y6dob{62E0iP-s1 zJ$T6<1x;@qqzLd~3f@CS_Wq!`?-5!n;l4M}b=-4ruSrRh^YO7>O$CR<%eQz!_TfHi ztK}v$t>ddVh|5giW(0}TwvFVE#_dD+6{FisSPaRRp2m<xz_mVX8IxVK?s{F`ju{P% z;!aDEE>Inb%qoE99l|?EcP(K%Yohq<C8<U-OKc5fg`FmTD(eY1<1;PqfG>(n>y(_@ z_Y$Ngvyy2C<TA%N*G6}pNP1>f;J1wSD^Vsd%@JgjsiUgu=u@f8OU$BF%*q-n(HAb) zry243va>2x`a#r|C~B)5E@?(>eXrUw<23rqdA}`(a6-56MzI%9kJLRl0R!)S@Knc# z;}F+`_-N=p6`@{dlnC}N{13q^)2sBd;<uj)_8U5Om<pt+9J*1WJs_J$HvE!|Qs#%C z(zx&wNMXgDTf)INM=3c+c6j{JnO54d8A?I0SAmnf@mlj&sn;ZFm%HQv@vv;m%J@-W zm(d!o%gh^o&E7$Rv@6+t4ue@rW_O6O-{L^XZOHF%aIZjc=#<2v_REeM$I<aR?J-je zDm)`2I|49TN!;VONxH=WX&f*ziO7Mxqsq|unhoO_z=O3$(Z<IB*QI2*)BuL2GaIT$ zwM#|@qd%Dtu7YQ=YBQ_g8b&W|rCmE7J&9L(>nrd}45u%|FnC!Ffu5VQlHR-4OmwXF zDmGVAGugst%v3W$hpeVTFKSXO17t0oUb7RBB~l2NAiIvYy-nsSebM`k1vmkyUc4^N zJ&BIUVwCn{N6On*=FTnFO^c756Pa(kCOuTv%UzLm<_+s5lMlLNHjlqz-5%qkUq<H9 ziZT!IG0-qSSYv%?nvd%Z^OFe`JF2G<`_@ma-|XXhjL3RbRUoT;&}7-1RrTtsdD5E0 ai2Z0wTiVi=wzQ=!ZD~te+R~Q)oBRc3V|l>< literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/Samples/Grab_NListtree182.iff b/workbench/classes/zune/nlist/nlisttree_mcc/images/Samples/Grab_NListtree182.iff new file mode 100755 index 0000000000000000000000000000000000000000..405bb66940fa64ec695644d0e8336a6ba31caf33 GIT binary patch literal 38516 zcwX&&4R}=5x$fF~_9T;#hfE|^w2@4rM^g{2vDBy7LNbA&S_(=mX>ISZgu}y6J-r(2 z(NIBV6R^Z+G1}S+muqs;b3B;#D7Dw;AW<?XEtE#U`hP?+{7CqnnGnd&{H^<~zrEMq zvnK@Go_o*poc1v@v(~rPdf)f^)>_|Qd(ZH-JMNr|(9eJH^*J-<&X{{!03lSYejW|O zEAk)({$BPO@_A;>+*{#;=D!SSGw0UKL&$|XJ3FBWW4xrfYvsz7FTVI<XX`5b{4bW2 zqevavh>Id!sICrgEXN2p_w@7-<A5LjhQogd1Ojz+bxW2kX>4q4Zf@SVaU=BB)zt-N zAAkIDBoe{&e^3Q~p%CnO3C4lu<{lWdr>8s+=)@RI$wz9rv8QK>u!NWL=H?|BPwD9? zg5fZ3r0tsn&CsA{Nl&0WfN6VZ8VCSFyktpFd3m6-6T|pD&3Fm5+_<D?im-%&@<8*F z9z119Pf>ZGt`j%X;hUFGoEv)rQv}W)99TkeZtN+aB5;x+D9(*NQ-o!p2bV9QI5+kb zO%XT)xVan<;GQWx4}5fQ?RS>X^7-)Iy%_J^u^erBpss28!rmP%buWGAg%_d^x4d4v z_~+NwEPmkbS>KuN`{;q1nx-b-td^S>@AWNi>3w0=+}f`{*V*Zt<-2*7udZpw#Jg|0 zdGF$iiVFPMvhVyYUc7j5OH0f4?c4WmdZ1=ITHLZ79QKmuNBFs>*ufvf+FLQc8+Ubn zb!kUKL&LwUT-V;--nF&ssl}dsH{BF{uAp;c<GvYR`B_=nqS>?m?eWLgePss1sJ*qJ zvcA2uy>s)rm2;onFl9++SLepxe6;k?x|Ku6k8f<<_}we7-2C0|?pw47#bTRheC7N9 z^Xv8c*5jKumw7yoJ>B;B<BxZDcW<iey!nAnh_iyD=;oH2KiW`Jun?ogo0=BR{qalF zuf6-)&sRMA+;h+MZlCqh;#+!eCjXl|ckW)I62kLuBXRZ1tq04li}n@o-TM}P0lkh; zeSJOt5CEckR{d;x?cETBw=aHV+qP|o4<FvWdw0*q#>W=l()YJhnh=Ucqf3`AT~<2> zVh>^)BK+y6pN>EveO!kEA4fK#8FvJ}gV0ZJ>_V?%G~9*E|Eswl{KsB2PG7B{�(E zgSn*s`|~3aq^(8;g$2V1FG3R|Xq^8Iqz9GUr0Vk_)xUmM1Z!*XKx|+b<ISiqg2z>( zbWl$YyGBB#G1ZSsG7VOzgFBLm#7J*%OfBpU{{iI#w`$}{A_RRF_I>~*s}ZU~u3=Of z8e2&LnoZD8RL~bxbeEPJ0`&M~1Su|*o;Zxu#zhqTY8kxpP6R7SobDUOYV&3aZ4Jl1 z8=(1>l8pM-IP?#ITLB6)5C-%Dg}|C7!x}?L34;zR*CZ8f(=-sin?QHDs;X9|tMcxx zuBt{8(cO%}G^9UF7+jM?YHb=AxRN_}u1oLCdor{$g!^y@1NsIhvda|%vyyCP9|=BS zR-gc%oN0_t3aMA83DSuiX$cxz$uzW=v#C;*6`DKgQJ=tvBglL2l0_32Em^dveo;NJ z`3J^kBGOk9HsvZ(YtjcJ*!$$h&3&6UZr<FsxeZ|cjKS;^Y?K(7m5gFW*?gFasnZA> zf{b|w`k$Wu;P)t(0=+tUv5%7tr&Ot`PHD8^??(`>_uMz}zWVzX)!$c@Hs%CE`U6UC zn$q|>aSCqpwDz^OwQg=}-I+E5A5$8NNh7Nn&{#uhOjg1G3pk`HhtCU?Iz>6^N0?OK zB^(q5`Bh~b<<NzfM^G9Zkgm^LRA27`Pb^}dz-TR2a(8i0^h9vF4fUnl@;0}%B|+iM zoB7;cg)EM6v{KTm{K-TYC7@A1z^)ubu3eOao5l>3_>pTH#XW`+ATygSPl~R(wrNU| z%o6I5@l_M6>Z=x2SFI*&swkVas3}C)OrmV4L&opy+u62rb7<!p0(7UKQ%&fEO@}y{ ztxiAOP52xJK8W%OA|*ulltBMVnk`0(POvJ;F_i!xI#2xI9TiREd=BqLxx^D8#r1kx zMRZQ=6*!a1NRr{)D=;OekECpvUZ)yM<DqGG1ldYhz+gR3fgaF!j%m4p2`#6XW}qGe z6V@rF8Hi%i)2pFq1I46Zwy?WG2rZ|WR0QLxI#Sa}8&468p#&}H#yADZU3)jeFnSl- z0mzf+H3T5pTlp{YzDANj{WTIf_3*cn{S~|1|NHtVI)Ih1N6~}lv6{x|eOWCBkfy-; zqaT1C72Q7oi_AWxcpa@ZuYwyJhM-0D2y3C~Gf=ZWC>m+?#9*h?5QAVv-Vie1K_@8S zC!P2d(TN{VsT_n5(e|@mT&QOce7=0%KHAke@fP|3OXvfUK1i?P9V6nCiJ09X+_eq5 z%im&j$KG01aBM6MF1;OV!!e9_92%aH8jqlSSC~d}g$Fea!IecEsVjWi(50YBz^WEQ z<SM0DLp9Ke2RfPRRR=8tk@(M1k*fk30|orjKv~g)3s>XVkTDoi(#Qo-RD7O|RF3#a zHG-1r**x%iiMqwJeD`OThvIZFci`x*sRJA0+(*!(;c}&388F@><u&4Fs1G5_2hFP@ z-N#|9N#Oi2np3;8Kq=OyE?isrMgprbk1L5`<6qb@@%!sblUN-_9=GmK2M-hu39)}y z-dSF*F7xP36I*;7*^i0??&5hInX2d&PSKMB!9xgkOuZX4VXvT!t2;C#xgor!u1Hac z8wxaUoa*DAoL{as`@jL79NoXl@Ac@zu$uxc;BZ8(>MXAU=QlKY6GsULjdG|xADDi{ zKFWd4GgtSCEHh*kfrSxlVcm4v(Knz~@)Zj(R64(?6o6IMcpi>%V7}q<tHvEC!1DAN zE&#UqrHYOOQ>s99`+oJh50H79yiFrasIR+r1<otNg-MEusiV}Z1LC~~Q=foxL0AJ8 z*o$5h??JFtTMb-sh!j*8hVH=0o?!|q$EUQb%SatTRpa`a*VFNbS;YzAzZ07~l@j&F zb+H<+8Cl^O(<VGCV6A%PgkxlZ;7SgKr7&2^YvMhTtKBclb^i7`v_ZMz^%cJ6sbMZx zc|+Nxy!}G1JG_PE%}pK(48mW92?zjPkS2vkgg{%f3sjh0AQK5lLMFBc`h{({VVG;O zpw(0UDA(i|40~2EZ(o*`d1-4_=4J$o)rp5g`Cc9l@*tnW>n_*>LW3D&_=CvnDS0V# z3<cqA(XM1pLYEg_?7ip0CKCkd^buR%0LbGsy~$n^jM@8kT)2}C-6}ym>;(BDI{;k< zPGWZyhc#51!YF(mIj+Y?poa+W4>lj~S^n4T_aqU*YwsGlJpd9-Pt_s6+4be~J_fS^ z6Do9{4<@$_m_v}y{&UhhGL)MRRXu=F?+AAN6t_bBBW=JkCRoB^$Hsjq)v0XBO<^Ub zq~K~1Wl+=dx4_jD^w&0mkq&F@S4ayDB!*>%VL6-4U}UtaOtep-R+~B;X&&}#=t8Pa znKwQO*Y<jnyA<;+3be|BPN8Gi^*HRy=UIn-8Jd4fg$rB_>1k%?fSp*)Q$aFV-bSfH zUWh*LkQILp!4J5}H5<A1Opuh8CQ~>(DD%n5L%`?64QUXg1T1qCVpbuqCGy=w`|*%6 zDy@Zaib7dNTNOYn7n7gudJyDU?MA50xlt`NFKWbL8zDC(q=06s0$H}wKqeL;)J$+% z97G7c0|L#T3MS(PpGHC){PRAH0cwOeE8-f8<)`}@7BrtUtpHH2{3NwwtYFGF;*iPC zW)DN<k8q=NqnQA^+fcoY-8jZ>5~MsT;i#b7;IE(N0RM_x3q=mVD2}5PJKLK)zAcr| zYk}Z+7pk}TY#i}f&Ws;TRPyxQahQU8>YqqbNI5sq*4`xD6X}AMi(4tn+mN5I%)My4 z5pI2MOt!%L?lL>?D;e+0A)x}d7T$Gq4GIKqpB(nnRIKSxt2&fP{2l+i8uxr3@xLJc za9O=&Jsn5fs!qIZX3oN<2>`0~j)LnMDEEBYnk-#uq-<i8?=EAMM{9A88=kwE84$ha z+u4Xhng&FR78k>nNuc&7xbX6LbpO*^TGf(&ua7%8xwC1DZ;OR1be`#CkK&pze&LUA zr4A_I4shQ<TMsb*UcQBqz31DE>}XBSal>;LGXt{USe%V4WPgP0tO4TH1->vN`+qjI zs^z;{9mu}pFH+`P9SfajI<}zH^#(xtA%XNpL7$;NY0b%giF@`Niy7I`nw;Z?=PqUj zWM|holXX1}IVB0<S*QlxHlx+&Wn^FOY*nk)Ig#CRLxyLe^Gwf<zw*bojbEseVEgIo zJ`rpcH%Oknxs#EdUB}3d*5n*FJa;iOAUh*qCrh`*6e<eC5*1q$=v#vt%Ep%o#{yTM zBiDE9>MpOdIkwKhvEyg1FD)!UY#EuxV=Y~$LSx}qPIX3rQ_bGu9Jf1n5i20-&sdNt z(FC~yM<vNYKR?ICf(QUK>Y^a!kSoW?|^JEynORiL?nmbge=b4m4*i!+~x{bt2)) zYQ6~j$s&9zyZJe86dlcEG-mW<%gU?7iI<Xut;>Oz>A8HG-C#T%#C;=JZNrBX6h*QQ z&39sT7Ug8I7NpLNVga0j8Oec>twBDZ+wuX*LQQmDfU9MmdxtH4u_u*@PJ-Il^n+~E zw_2RzHRm$Q0Uvh87eT6rB1BFIUC}yq9#1607JaSRBP4VRF%<}{S));#rBwAI{er-D z%7!aQGFW~gz*LKNs_kCCTCeEmGp;a59d&My9JgRdMR!2@PfO{ixA}X^HOFPfcr>rp z$Y6j&d(>1Q^BC)>L761UZy99FcVvuwItKC~9Mq#3Bju5ikQXIBgi4v5F*DU<wf>$w zRY}1qPO}T<qT=$u!(L8uYNyCmps-<i__84r2(;%w;-COrUi#u@2viOlnEH+jOs)h> zHun(M0lHg3BLT1sUul991*gdb77bA4Nf7-Vl3w2yMT&ME#j0I*%3{Q;2{mhL61R%3 zOX!C;n&`<H9`Z}*8wQbwqwftyEP}#CzoNGfat*_}O;jilqNeCsG?kTHtLreHGVw}^ zd*YQRjZk7WD&P@H16H-hFJV2}Dl6@JY{g*%tD=WZrC$w7N~h;5?&3I~b)-YCwep7k zt}HctW+EC5D0ClD`D+BaqSip9`Ml8V6n#ByGdFAiXGR^6(K=+|ckf!W`>T`BnS74T zsq->E`MTe=GgPQ6RrzrFBUr8Ysu9!iP9?u%Soi_@<$h4s?|N5u1AIP-3}ed2Pt?DG z^3lp8WF2OF;PsSbYSi!EWi5AkQC{7kpi!M{`$JR3Kfff=$lX&HGic=gQdg1U^8gLH z;y^AQ{&K|djW&PY<;cyP<En>_FYvH0-D8^vP{1TLn@~C=n0#NNbUeio2uXzomad$# zTMHAl?GKq<5n7jZ44U3)d!@<q&m9si%~Pi^TH|zo;R2+VJl1|s-{cgZAf?Ihtzv?V zbRzB?;B;BX1wJK8x7p?h6r4iBm|UlzJYe7p5H{o($0T#oG~;z@+beQo5?+53@Jiv; z_Cp&1SM&U^L15Ajq?XrC+jQI3lo4Oy4brT^^VK@#a%0;3O`t(6QKif6u366YG}}-z zmk~0}bkh6i3ZScuj(W;&ZrG@8Kg{fmCgfY%C35?AOF<VAq^5rlsa0jZmfPA*Qp=~? zHUc0s`}vqyw>G?C^T~!cjCBhr<N$@DN=m`+YX=H`jZ*My(z-=!)P1{+bqiwY=>{p5 z-Yi_R``TaI(LVGFaIUqYy+2{NK;#MN=?6nX`k&<5q=$mj#;(cZ=duu;4Z0uR`#lV< z=ajLB@+$SsLbEA3V7}oKd2u>ct;5o1hkRikM9rhVO)})Jp$vhQ8=_)CQg;>F1cm}h zU~+sp?rlW6^3kbWNdfyRg}$OjJ!b6E<aoO7-{gHEj2+O{oSLDlCCxkTx!z}@?cSdu zuv+(;*b>xGwN2nqwN+qH4iyl*D)Nz))E8oSL#Du@P6br5!f=fbAzUCZD=0US?3W>H z`pkFh0LnOy73sN$diw3b3%yWnVJhbyPJUo&%L>jInGD&xAXmQXJ=6z(Pjl@^DXbna z_8CJ>rLJzC71?1x<|fEcZa;P<88|w!1g`o^{p=LZH4k_wEUSgCsF(yzsOJMyOjZDk zn!>D6CBV|&BY?bTkWyCpKH!8G$%59MrL^Qy3ivK7;9Wfeum)BdO$TQTNN95s!yK*p zE1-0ais{1ie4c5iX*Mx64dmMb-4Q+esFEpqOs|CYP_UsrrU9)YSa<bEg(P8>VV10u zVHSw2)r9FjniQgb6JYk6iE<n%IVJDQdctSGqSS)j2$fSQ2N6$@Q^j@S^{i<?N&tXd zLf{pe@N%lIEqD|z0Y*jW+Ii3}q^X%!<+F+i1t7=sU>K(&Dm&*<Xe!dgt65J90E1Lu z1&EKO=Ump}cLeBW0Mo!x*_K7Z5y(FRQb^Lzk{*>O5LQq-1*Rd7c(rM$rRUf+%;6Bz z$gQP%3TiK+A?{PBX3-EJrFKaY($A8D#H*^$j?gM0K(I&%%U1D_1!H2fI?t35+!P!M zB^Xkg_7@MzdTRfesVDU58RQx!9zRBV7`7;zc$}&P*QFzIp{}ZEez?lZ86>l%_$<Nh zeP7HRjix+GZ5*qRS0<RcP*+0g5}R$kF<u@Eubc;`T~==4wR(x*m9N)ed;(HxA2|^* z*|{D)W4MC%&fJlvGVmyVummWsUTRVl#YE^hR?<u3Mub1A9|Ne*3<_Sb8@w<0s&q+y z-k=z7Hz)#lTW3zL%UQOnpiGx3{^%JC#q*GEBOAqE95fs#y0>|ekXbhE80}4RBP-@! zQAVEOj>HIK6b7_EKMIS`(m|7*|9z9SKdU!^guPGOG}3a*l8DS|gXYTPf+p<j&wud; zkbeJa@?&~R;_2>v)o>+roxCzG)_HViKo`Eu@vS1^dYtlvs+A9hr7GeA2!rF?otWHC zBP-NhM-aMlkYsycf0is0I+=XrHN&C8NCgts{%kC9u4-rbtmMpJz5D~n(I>z3sO(I4 zdX?<V<U;ODU^0KUE}WU8B#+VFILRPCYhqPG{KT_{LpjZQaHzI$kezykiCxZnKoefh zWH?jU;9Qi^qlIV+!G2ub8<wN?q16)6&VTtk$lEJAOrp?4Lsf(I=Ourp)|mdRn+>T5 zy;E7eKZRWb7#9v;a^yui7M!CoCz}+TWbxG&7r%)V_Zr4K8as*5fe+C!_#1KXEf~P% zGVqC7dvf4hNI6dwGc_%7eyZc|Ap6hYe9K7td3mlXrhES;KseJwLg1qf;B-##JR=P~ zbJAZv9&<EGi}{wexEz@Jj>8;QD0OHI%#=L+KhP)iHRj}WW(C}0wmxkF<akikb@k*a zF!yDZP7(xh60RmHUfO7t;LE)sB7w%;P9+dKq~Xq-0X*!h#;HLr05+B_M-%3BG%~_` z4j&2i1IJ-6x&T~p4)Xs8e~sE*4pIP*sHF#fz-saK)MGy4ZJ(ezVlG&ILbarM%deN2 z3l`;iV=0M{yaM6wT<&hQ9+5>}@?$JqDx7WZv<?Q`(Rjr4GYn4LTBP>@!9jXx3tO>A z^HDd$tCO3l4N!_%`?LAj<3Ts|`+oS+j{uUiCG`pFkoUwP#1a<Llg3lh6NQ6IogC~L zz=!)wAD{c<>S0d1FVn?VBR;c7`uNNSayj`xTFIF>NSJyNW9%hodYMiJB2jA(cCv-| z`g8U9vzvVuvTfPOCP2XakYzdt<7Pr?IL{M9yU$f$c)77xP;JZfu+_+z&TZVypCHAP zPiAsGrRrnxOkOjc3+2EgX6qu;v)4!JADaDW*dXhWZi7E_@zf$g(vr=ZUIOTm>PKFF zu#`YQnc+lBb;`_j38$hDZFHh$W=nWP>ZO8A1_#3}vs-)@VW6R@*O;qrzmtas@a}`b z2VQ=l*TTTLIxSsL5DMj-g3c+hRkh#r#lf&#l0jn1Z^D~qKU9BF5+!%kkM4#6d~_>b z{PH7h&Tg<&Tiu||AsiI1!e1g5Cjh|FoG@i(_@3E$?RNZ{K9k-7vryO(&h!I0B^tDd zeY6HY{qo>~Y`&1HZNAX9G6E`piCR4YNM%oGUZvCH9g^7OdeAL}VT788I2m`pI31ah zLFNl7K}KcA0qm|{u)&&@^t;j+H4Zts#8PYZh#LBko{pS?04tzuJOz?hSd|K3CC|9L zO77G_E1jv;K&L^_F%NrY#A)^<Z&d?^Z=~a%^|w?=z5&3oLIC{4kdtdHwZt>xAPC;S ze&7@U{D3@Q={*T#DjBEBsA<OQRDc{qmeU}`6PCT?@*t8`ODAi2`i%5YC0zWK>(W-_ z(qOe7u%BJ7?J=KZ<(GQWP0(rVZZT3UH$j!R&9k&``2C}U@#r(2>)r~NY2|TeEaolZ zkNoDNyZn;Oyh#dZuDzPwZ}*V<?dEM#R`MQ_&K_%#1yv3~g~&C?IJjDL0|sOQ%-3hW zh%4a&t7CIh(ix&D*V||`xhCJuZmxR?KvOXC`CaoS-`e&}$r2Qql7TF>U@Ke{m3KUq z1(_+{8||ZuH|_3L@?bBlqq26iz#`o>u8@rGaw^?dubYZ;W-TgtdC^Z8K-l?n$>p@T z^EGo{vH>n?ig(P<CSjrzZAo{cj<}HW#-k2W%2wvH00*q)8J_|6L_Gs`aQNEi11N9S z&pLkhvu_I6nn#ym58(#5E-7x8VIwVO7x&6g#<SQKasR#)aFW||vbN;2McU%4EEtg| zg}m23=Lcmc_#V09EdkN(>3H;an<25{7!%<JxNz`vR9G(@Q1$S6LtA%;r~HQUmV^+u zWPzi&k{QFTvw+pE(nC~L*??EPYcD4EsXO&dCjaC|$}DgDBgI9g*c~m`8Dh`Ky%2-T zg67Q?j$#kjq1q84c)Zh5aA8BiyX$Chyd{_0KDoRurH<|ac`{NG7ITX`9x0Z>qT{h+ z9I2-J)172HXghDi2tsQe9$&r@#L&Bkef8@tB-c@VNfe`BH&E)jskTxzD}KjT2*T!Y zVJ&c<gUNUE(UM1w{=^KC=kC-zJVac&U#Yu*+^rds#_QBtw;?J@cMdbKe*%%rIs%r0 z1k5l#3t_36m%nE#<(ZFxG-lj;&AqB@m&UYYX<G&|5Yn}!z2$}xahu15byG*9N<4=z z7ui2%g`pI}Y#Rjwc`9Yz<>IN7*9>8dV)MZqv&jC@IyyN7NkZOWe@w?19HwnG4vT3k z9@ROHRA}}QMZn%i`JQqNBIQFW0oy%3k!u|WpHhF3!INTe<FO<%;1p@_DUfc6l?{gP z`Oxxk(kE7nObF9@tPp74J3MGbF~vy&XlbB;_d)^<k=s^~-MOZ~C51%_(~3+Tq<e>~ zSf&qTVhNtGVyP;yDFVR=J&_}y0TU0rH&r2bJpCR>+X^Tkt2mM&eQ2&NCWC?$bo&1K zGs{Ev6x5^7L<>EIx~j*m@G2d$YSJqJgq{q5@IGqZy<-T$M6KkS8Mo*@vDp%kuRm)A zS%{}s*FTl-8<MVJGzN0o(mg7YK*9=C70S4Z0f^8ifmkg;tge?5SqWnZFhW+T?f@yx zM3<DDu(u*;|5u*RM4Ld`G+h7GLxZ-<tvr3^wfCM-OYZ;89}|+GxwsmI?U#*!7WxDv z(32T~Si00U!MYFytEdWD(~WBlT5{6Xih%vz)AKUGwm5*D_Ru!9yk*bige0s9RTdU{ zq)@{WRQWp2z)G$!VC7cbG~qL^^H|v_dpm;ms;jojXx-D2;iooP!a!*Iz+C|M(GwQ9 zE+=K7OEQ$SyiH4n9hAkc4=J+z_K;OrQgq7JiePo+*AuK|j|!{<;itYIa=<$6z7v48 zrNV->&`H{v|GR;VG$3IeaFkYY6?`a#tf?#wS!*M@G^un~zlQ6oPTOy}I}q#^XKDa< z(%&}|xXTFK0E24@T5@aPjCpH7XX@+^_aSw4DL+U%PD}Xl9zAg6Qcq&&;c{~iAZ#C` zQpd5nrd>K2<V{B~>W&+i(#S{BsB(irwS@tUY%rJs62Zjl-$EGd5`tq>@HoZ;D3}nk zE4Z6170@G4SXCfVs5Z{rlLc|R2ST5~g~=e{p-vcNZU7=p6QpB5sRJs4IB&}55svVH z9+g<Enq%G;X1iA2lj{fpgfTG`4p5`r-3f8zbQ-D9%@L$F`27qzD>=oKjroHKAwSv3 z$OAQpnf7}SE<g|%+y{>rbaNk^k~&b5bEMN*19|dI3-aZA{N}0b0Lo*5&iM(|l|$9W zc`RT|?g!M$LYOifG!&fXG9C_b87pbH0ATeR0$BBW;M!G)-RcQ)u}@iA_wNzq1oJq7 zdEh497n49QI^qaAxnI^=dG+eJBsKH_pl2R2Ktlmn`i&zzh6(0^eSo>(a*EkU4g<Kz z?I>u9Y_>gmL=;;P54~wce8;hn6XM}1vdn7iv)u_vXZ$9Kj>2P7bi8Ru^~5nQ6?xA2 zi-6gC6~*i)fgyAbp>9)Wv$3-OSlmJ8q3LV>)dKpU3HpxnIDc56e!~*ev1=?bJv5!7 zK1fk3^@Zm#8jjOqF4+?YgQnb`*9r7;6S{(Ei!ifg1c<!6T<%HPe^83>0!E`cc|O&& zOz)R@ykgGIJ21X)2y2u|8mS4F)d9B#6Vh>NYZR&HQ<Tm&e&etJp~4}C18RhxPi%`D zK|f9<i~@9l@hgK!L!!-L;T1(JHD;Z)zx}Vojic3M>DD1Z4yHn?=|&5=rHf2*x4Xi3 z3<*D#CX+79eAxD^vG^;g1zUmJ0OfY;!c1;Z!!_Q$(76ArsO=G$8-$;SJ+{&MCQ^K= z%#r)8T@~8`t!m5Ywr^2fY{*Law;@v)Co!y$qj1T3iQvau-XAgpF=_Fh^2)=;O<<*b zK?Na*3Bj+eH3{YlB-jx9_iN2tfOFfy=cpizl)U;unw-t+0g4)@m@B)nU6b6X&U5Jb z_<GZgDAy;ualjU%_m@g6@vwzup~a0KCrmf0>wzWgiG=0f=Tep)#`48rV}jx#wOsQf zxrQs%&#wTYm~1F+orbD+;vn)Mxh;2P>qOy7Yqh28bET#`m2nn#?x%~&1Z=sbaeMr{ zg(CT8h}&b$sucH))Q9`&qo#rv=7W>+(^7^7oMs;YPD%lN3|Ub;-3DOR=CG7nL5<?c z-Wzq8%Qs|hn*$Uf`H29T1zu%g!S;F_lJi(aTT5B62WImri-8xHls|Jc#Ye8DBK8}u z`G-}MM(7>5{>n#I`><h|QDyInawwBI#IPfW@BKpJ!15Ijw3a=Ao?iwWpuNfA!i)do z!N$A!z%gw11^yP9NQG~cRl*nIV9hqNFKFHMqx46z$j(KB_U!8l9J3Iqd#2Ay<P1_R zo`^4<7^Ml4$zt%ur4Pnx_^3Q}GCkpbMkiSp{hEPq2Pa`Ru{y&yT5rS|>FUZMdmiQ` zp=jP5yIs-u%N!`rLL9c-N=gSSqcm$WXcP|JxbnfFUOsR#V`8wc61ghrx1qe;8&abT zZ<LPGA)zwAj>Z-FVJnuNiMYy@s300wx}2L4D)LRfG$wHc?M;siK^zQ;IAA^J;;?x_ zLFgblLH5042`;nYC)OrBz%J6U$dVP2zeOSJJYM4f==KR)`XoLybJGfk!qQp)nQu=N z&&NZqB~kjPrQ3&Lj;h0=E=mp*!qRPk30p{{ebJoqq77jq*=E$nGy7wYLsrr?n6sI_ zc5BQ^=Z*y4FVlHL&@msN*T{GB*mn^i<$6y_5!7K(N(Sx&5ygp{k|65`WOX9c%*@~u z*_4%+@-5Te5nZ~F&tO1vy4whY0+YcUjDJBgIbF)+w88<&AufcL35P&(WiZGc60U$! zKCs~mjA?X@Q{O>E8WLaT*8hoY4CVPGuCU17EM1AzS`kT&9seD)E%yLV)+m0{0~miG zJTM^e7t&_j0|RW(j|>lx3mBC|k%kI6wohaOsXU(9+!=F@mmJMcMY@-NuZv#|h?&iR zkA&&>)MnMy&6*#tlfJl`q$$yR;$na+KY+#1irk7YAm1D5LOkF9#K{Pm7X#V)u~8Y2 zsRYOkQ$a=gE-X#7C=>g4VM(TA`F0K|AmhF!DUS<?@bAi{aM_h%X+yT3A#)LA?wX?; zyoWV$b7m$kxnP2;rr?rPW?by5omE_$u<N|v_N|<O{bFpz(uijBx!wrNmJHA~BYLHq ztq1FRNz)_FLc687)>{-eNIW5tz=8z1tJ^eaRaqoSmI5;RYS2#D({C3wM?`}3uDzOq zc4%hBOH(127t^~=?kf&>`{Twze{RV9f-Gi$Q9TXrd4BgS%^uu5E3y=j(RCJ*MjNWR zON-E~hyl+qA>gw$w-TVK0sYCUI8tUEOBW%{xb2$^h6{C6SP)9ud64Zl-ih*uY{K)L z$Wp-f6eR2^{sRA5nh-JkmTG?Zl+ldiMv9sCaNO=&TpK(wo#D;{<*P#~SU;ISd2LB# zBtR54kv}lMw$3f&KW(Hy;=R}eWlJWyFT%1P1GUwLA3`~{=SK@1J){jtg?xdep5&{d zu#ODJh3vRnS4-|c(4`aE5#m|T8Kh|HP$yF3T=UaL!ebsoiFz8`^dfuTJM`|0QDK}q znI#Na5Q~I`A|nZ9#1OO;spaFmPY$CTDQCf9^B&%5BULfam(0CTagpChqgjc0uj-W5 zjKUy0ut#S{NPoPlpE=ls0SQjkL)5Q0jiht~ODpYZBg+u)MI?!bWYGAtEVD3!Pb{(- z=Ca#p_AvQ5Cse)`g33iunJI)#AD%hTxe-j8NrRlfA=g=!GIXJSV$~<tvm%Fv6eI-E z8uFBvHjr9-qJw}`WRL)>d=ryywVWrUt<nwHLGrC#G4zAL3PnVAV1P904UqPRc92aT z0O=+xy^-v5oF(@Z77;O5Q!&}u4BfB9wF^UPE|++<NCezutu}7(k-*a<JP+sxvp%Z< zEpu!t!0seq@qpS?@tgpw#R6hON?!n!RSadJKnWL$U9Ok7p7MTAhGLtzn{MLfg$OD* z%Qt-iQmW@59a>sIY6JV%?Ab&>LT&<Af<>+p2bA>ifu>k@_D5WY4K1bp{^1>Bzo&zN zA`#a~GdS5k-%srNtQM@$v9Un9kRVn05l9X_J_xwx$T**6II+NKQPZ-ov!Q5LH1T{M z47W@18M5G%EKHmkjjcHOF-L)<C;QPth7#sIMLA$sQ{Ko|9ugZl9mr7g6yLr3iAkTe zk`+3(698`_PkS<GLP8F0AN{pSn*N*8y=KB8WA#aLb;%&43g<%W@E%DS@pQ3)V8|j1 zd6aagK+zcC{Tgy`6d4uHh2lA3O(`5Pk!T|Uv?|WT5RV7DVmSsH^;aWZXl<Nn!X6AZ z5Um*B$FJg_=SEB$cJ0}p#eh~1W~<~+|FR$YKFQBD+#^Nk>9~-LJ@iYrjg$O*=FX7_ zx+l(LV~_h9AjwKghf(HnBO)DrmY4ous<&IL#~D_%`a-r!@kB3&irqu>L@XXq7JQ8h z>ZT9$k_RqdO&|rQkI^Hsc$d=timB+@o)Z$-BjiMv8*Fd4Kg`?jU_z_TJ5`9sd^MV; z94EV)J6@!e{*+6ZM<4Np%mH;A1Z1u|;}IqN15?J2{L2`!KOse#Co0*pW`C&HYG6Fu zYbzFy_|jkSVTg!ef0yQhjib->dL}RbeaHQwltr>%DyC#_BQDunj4`d_YT2IUwbUEW z^jb^Bv%SodhE7*b;5xDAd2_$m^0`;XB?Ty|*6}l@T5q&3ll*v;Q>PYOGWk*7ekUVV zIp|m=9`ThxQt3pjv1fTvN8&`sLrJT0Qn1~4)FIe@DS}Nrx7+Vf>0BtD;007gXw3zz z4Ch|Ju2`mkL%6}y0oh9n!4`28@XC;htznXrfYRf-{Z2NtZqTttJjP4c;WaR+J=z6C zGZQjl)24`taD(Timd|x;O43ys0jIDFIEDDkmBO%OfeE-VB4(cyi<ZZ9`yGsU<)BlQ zcwE;&Jdq%-G&c|SWNt1@mRIk|0Bh_b?4ewNQ(Jimq2M6-O=B>#Br4*$-2SXaqgC-I zc4->0CWTxLh&+-8m?5NH;Wz~@Hr*Whpf2(a)1&~Uu<Hqods75^8Y@Y1Gb?0n#PZX+ zf<W465>rGIX?wOk#M?inR?Pas*lfikzk)Anjx(}I9kDnmhdktqB(A72&WNJah|N*v zgTBD?;T;qOH75|Lxy50YXMg)I+Jc)7Ufj^gkb#)iQt|ULNJJ<(x0?Hz{@+2CCwr5p zP*sGS_Q3n!Kh&0H1l_6OljFZal(cx$d}i2WX|yA7%yyDXS*|l?`%AL5@qMOD=X^ES zo@Y9*OIaLhqr3D_kki$YUtU`GVanoDGl|5ju|UI`5Hv=UjHGU?=9gk>TuPGp*;3J3 z#^<M|7PkKCm|)2+Dmly5bap=Q{(Xn|?9@`R`{sX^k~HolWs(#vC=$^k!<l2Wz647v z!^K{cp~u^)F^0L03^zqhhC|W11aqT#=`0v(!8Aw0S}-KMg>(_k!*y)dmte^mDwN^! z4sVgcFxUJ1F8EL>KSEA&WI}Jl-O-3aZ#ep`ucojXGEXov$Z>lHg4>71QHG7$Xtrav zQ@qs!*acZC+vif`O8^Oz4ALWPYa<<0CkS}sjEI4ch+Rooh*KW%OZLvSqtuX}c{8@% zOe7Z^6f{6wu*r4Sp~AV4{s7$?Qa<d4abm`>ZzClu=L^~BUT|W1A(JFa+tipxiPC>} zh78C5b%<>LW)u5ogvhU~W-(H{!8pv?5%Sw37d7=K$bDs<{Uz3lPMnb>PyM0f{?Qw{ zXhYZN4VC&*C{L4bmm~5|Owm3RBo)4y@zK)znm>U+f6e}F=*hp6@F)5&=wu84e-TAv zAH=B0QfM8J{+LnGFrxojMa@X&@Mp1_z>#493!dDO$POmM&>5P8*_cecHHo4uu>A~n zRU!g_SCI#tZGCiGVNU|XG@3@f{@`F}z`mH-m`p(JauaqMRVYWFob38};MnbxwQr%{ zKD*+`K6GyU<ljCyIXpgq3a7%~fqhdCkH0IN<i7aWB$dV$>5_ZjPJX}Zv%h&e@jRZh zaQ)Rc;r#x$=iK{tX@3`v?S{VvH|?I(|F5NKo2NcDfnH)ak{|z^PW}QNfS3VwrYYw2 zN^xza_MKVuFACMpnxHA(qRL&hH=&{cDw>77Q01>FTAbiocB!wLT3(+%{lfmlbKB`( zT>ZlKGl_IGvj3|u?8A{R9NCVeP}RL7vMFVgvP<1zlDL#!BqjfhKK}gnpkuSTRu0PI zT3_y4vo34%X|-rAya63cee2)yg^7-<!sBNZFPK_W6flCaQC%em<>?oChrh7>Y<+Ly z1-uI0!0_ST6<_ErCBv^R?caX7efN$?S4L1as;lL2xP)#bDgT^K{sJ9X7bYU+v2Xgc zqR$n1ecD@S-S>V(#Ps^sP4Ib(=Aa_KSD7<#Km#$o$;@SojQ`nR_a-9mMWVflFW{B` z^kXu9w0Gs1-e}~vIMN+W|F+=91dJa|XJ6DVu^Z<l?~*(D3v`gVT)KYZb3N%jJl^Mm z$UNXbqN3P%-`by)g~xvh72Xn_^d;}@D|{PfWm_(j_xC36jZW(CO@cFT?7ljM3;TOl z-G8XG|BpEK`_jXIjQ(bQ@AB;zTP`o5o9xTwC3W%_=)k^Ql7Cx){Ig3?0SV?&eaLB5 zL}^G&QVFa?yQ5es366}m_&FG7TjLx}$82U@u_7qn<I~A+8~E7I+}hWq2+kks4PxAl zd*M$k`>K;+=)A5tn2pKAp0sELwVp!A7ja5iG}1vZg;8&8w1mZCmMvYe8I8ffI`?8I z|It0ozV%hg?$4AhMGbm1bArWi{)1m`>|L=lJ@w?FXYdoj{_L~J$<}$QI9ra@${O@B zRM1k<>}y`9Ry<SIta~DvAs@p954_*l+qg3I{?bE@!6AFJNa5*V>KyKlhGR6chB^>< z>_oHgiDuUcZ&{(f!Xen9pMSifvA3Zyc}4V4EVzD@aCb0u4tPhyF&bHe9^&ZEJn(>5 z^|Y3GP&1DsOXPzu|7{SIh^B__J2ZqFZE<7?Tqj%SIpAzLRxA5#C@A~=I`6G88@xri z$Z&&YG87!TWo2|51Y{Jh0y5lSiQNp-Y*WF(aEwOQiEtn@@a-3tQfOK)EbSFp3ax>A zATv<y14^M}9nfBprO*;+{KDT7SATL2BUEKxn@fdnW_+~7fN`?GeU7HtuKYjF>|H8+ zGvnib;<?3t_b&IoAdVIC^=PL<sZZ4*Kjhj+JA?Ht_!d@Tj)zqj|CiAJyZ*0P556M5 zwKoDjg4fUp`5`7u{=H*VI!sPlM{7yGO-ovmS90X!gIDs8Vta?7l0@hTgu^iHahUc; ztqY;wP_`aNkfMk#L%hp+-eu*Ox`cSO*U_GG!6qz%H@n3}YBiV^2rjKCO1B>cYBcgI zJYe94%zK#p!V$rn<3&mc(I3jI^k{lD#-&LL++B^kb|j)H7{OhNaV{Q8(P455aT=`1 zjVeJzs|N#^SJaX<B9`t#(F_L7$u*iWZW_9@MxUYqD4=+`0vagbC;vPz7r-Y8p!#G1 z(orUW1_E>^lAM39#6Q)W$v+(>$h1<{MgZ%TfQeQn{Yz+b$@b$2dDoMHBOyfS=L7x2 zn)m2qRDgUST(-Mpc|BEN94PR&lbhFn2B>)Qi2})cyRL?pVU!0NOiDyc{t?5#`5?og zsYf@oVGKQv10CLZyK%)yjD-&QL<iQEnTxgrK%vnX0F28u8Z$Za(WhzpX`79sbE9_F z1Z0R)qZMg$3~|aUJdf%^9M_qbnwy^y;^5L3wx7X5oE?cs;<rMakKZ49Fet=HPMF)+ zxYQIUmrfFBo90M)Q;w9kWk^L^rcEyT6fHkxE2_+dw`QG_mGSoNp~~cdGS~EZM$$&u zRCF{y(P}7j<_p{NC1s)$zf6?L0UQS>4&|h2#FDUi|L(?y`)taPwkA^Alub6#miv&m zm6W;EmY=c}olwQ!{G4i0rr2XBQ;wR~$jUs^>@_CT>0iH>l9f3<B$W9WH?EeIS=t!2 zDnr{!NJ&$Ul(#jI(zd2Dm)!DGwxTg}^iA&(Lz$_*ro5xghB9UQwdJxh%WgH4!6jde zUM-Z_-TUxhNuyBaP-S9+tjsUA*_5GeIa1M-Bjs%kq_nLRGnd-(Q?~jqkS6?>fVhB{ zFW}`j^2G0ojKuG+jU+hy=~B>(CAa^d)IaeWMln?XDkA@hx>sq-Zu00Y5bwrn6vxD? zgN@GX8pLa+jpAo@=}Pemb$<9ym;U?f+7@AE8$p%gHLLAqh}oXuwr7~_4x}nrm;Xw= ahwQymi_oW1^v|+ELGbA?Vbdl3AN^mmbq5y! literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/Samples/glowbsp.iff b/workbench/classes/zune/nlist/nlisttree_mcc/images/Samples/glowbsp.iff new file mode 100755 index 0000000000000000000000000000000000000000..3d48511f934b3aa9f71590f67cb93d8a51bba65b GIT binary patch literal 60288 zcwVf%4R}=5weY{s%t>Z4$&&<&RSTL(xh?he18b{T&;)^^_Zq?0)cUFyyw=jUH6-{! zz<itmR1hSgy|)zwg?ihn5fUs))Fe!-S`?K~sUkNCGZ-{rG9O7GGm|;z?EhMO@AEN} z!Q4FjpL;DibJpJbx7S{K?X~wgv*yPOeo{h6--?@VzM<rXk{jm|LMA#Yq-xSF{V>xZ zc?rqQm5GzgDVe<x?zOM~!*hS_ypM##lv239?!M<68yo-dhd-=bxw7GRHMHRm@OfWf z-~Rpk-+c4UhK7b`o_S{d`t_?<uU@un*?srjS6W&+Z{EBg{_uy>rcEm>EIdEo4V5%D zhHKXU?biGLFm?8Q=U;ix!<}WNf4$?{_4CfZ`$}>h+28owbB`~3`0jakTvtfx`f%?= z|C{snKXae|;n{Tme!9MH|9$tZhe`_zJMX*J|HB`yCgfJEvk__r7$5{TAmn)Se=_?9 zxFJh3$lf`#OXlO>#UB%C?!uc2@o$n#a&K5L_YOk7y7yH|bo_5O;r|Cc_WzA$`ziHN zs!*L$)!`-ie<RuXgh1(HLO@>*g@!>26l4mXv3M>Nm!yjeXJgB<RCpk{s$8f_*N^)5 zQktL%-GAWgtKCcTs>wwWNp)ehYoJ<<I7Zj%!dk1LR*gFT7nM?4L-i<C^F*anCg1VS zt^>=yy`clDEeaHp{MoTWuY=@?YP);>GIPO|bzKj2K*j9^ej48E@++FC*rB?3#XhV! zYF0cCDxUHmQ{SKZ#MGNR2+hwTSTQjxeiJJ0ezx=K&gGrEJ17ljQLLESD%L2kSg}>? z78Tzx^$GcjsW&3A+o+fZ@|38kxUF+}VtHpX5=V`S$wkQ(>(r>Yi&gx+iwh@CnR9&I zJMr(nhZW1DP-PW+39I<iqyE0`)=8B!Ge5fqD^5_qlU1yw64Sj2TH{Kt_y&31)Kyd6 zSg`}@993~!qO!BLGl~^MHOkjiOwEcXTwLfzRZJDCfWh<T7n8!ZqT<j|e-u^GDO3T2 zr-XgfzhYFyeqJ$!idV&;;)@F1lV`uP?r+P!y$&lbB)noIu604h$NbTry)!GXtLv)7 ziv5&VY!Vyh7AV-eMpSIfEL&a1%sOLn!&<3#vTb70$ZQ(06$fJ{d3#Agn&SU|&Fk?L zC*D{2f68m7uPF(?ru!@OnN@rLmRK_!)+W`T&9z!GF7dIhBPGgs#K*c0mE?^_e5~t0 z3Hev4uwHuS(b?C@)mizD;}vIf%?6`I+ZzrIN3T7d*qa;u(Mb8(T*F|DM|`Yn7>x0V zk97@$F&^=;u3<3dI%elj$a4SPBhMaiznih?Y_4%IdS7>b<UcqZS{r)iIz6;+<nY;C zt0im4BR<x3q@;2@;$vQyxW*+u#&w{?JzxEP;T2gER!q3>Z_<Pr8Pm?@8VBR#%;wYn zy(QgmgzrD9=jxNLJ)7&vB~Oe;e5~vIl9l5TAM?5-Yh2=ET$7T_cW(3)&i?C^ALsw) z#nOOu{O@OT9e~03D$x>ruBN5?)AEZBwCh^$$k|-0CF{o{KGt=l<dN}+k98d?@r*}& ztm{BYhCKJ2dsfe#^1V&Rt}K!q=bzOz%nYf=8zGWo#eO1XsL~qiB0?SvQ%SGdPbDoR zIn5hVfaHYXpGV<u2UgJMi%=;Mf1i?B(gySI=~7iY6v<0K`NZW?HkNnBpp3JS$RXH8 zybpUcC>`96H!?s<ZIw1+@ga7xORDk1Mbrfsu|~;*<+HKScH)5ItfpdY9m_kg#cJOA zApTt;RblC2*7{Q3x`&lnOk||Tn!LM-vu8Vz2jTiOcC*^K#z&(nbp({~2$crdhZW8T z{WLL1rPEQkj4$P?$U23pSj<%6aHA@)wy>=>U3J#;+QQVVO^-MgTWupDDbK9U5eSL8 z&|?{OIbVbB7*)}*<HtYxsR}y6PtCfb&Dc#*SN5ye%|MWl8{flvP83F1J@bxH68(yj zt<H5tSeG0g4j%ak>oV?aa;{jE$LgC8pCtOA&N||T4rb5AD!r1+8z$s+(A;9Ew{N=_ z>vhDjG{~ye&JDgHtT?bT*x9Y(NEo*&oK^lRta&&Qr5^osI0T_*kzdz`p`8&Z;nV4& zC=B#cN48fUz_G$s#89!uvBg5xqI2ai^^8QL5SJE(siH)o5vU`wh$>A`Uzc-35yJ?_ z`zImB(AUc!bXF~5Y|$!Ydzb>729dA97N(pnalnyHkS!Z$fwNtbQ5%l}XCbg1=h~1S zgHms5FwkM0644Zi!r$1G>U@-I2vnayw1KY`k2oLVT06a#k@dgx)5$fT9r?@OIhiZ` z(ueon{?o^QFoJ{ckeTAL9%Z9Xve7PAFazl0hUCyd4UY^DUHhEUAB-+xjm2qZclfH8 zTRylxj&vJ*Yq*h>@$nn0L<EL40f1x}1ohYYmLBM9z2;}nyvh08$NsXX`}UHD4=D)- zC`MN0fH1T~+J}5W#^;b~Vlk4P_eivPN%Uw@Q%TL@7;)r9)dX=z4pr5@{Fj!KyHpUP zUCxb+Qx23bp9!3ff&XpEgU%ZN8m3SM75Yhk=&1X;gLk~SS^$R|54?5z-4C6|fDbr4 z-fGlnH5+c?K#h9Ea0d(d<ZNRaik8b4ow%%fwirNn^l<s&mmA;A_CY;bt8*jFH)wR| ze<8ffS+fYIv?J=nKIMK9UV1d49X|Tz-T?L~fqe=$4*PGv`{8H>_9@;-JUByJ(QRx8 zKu~KjIur1X&d_!nWwg1xM(+#PEV3G|Du20gBq1p4d^XCj7vANp6^_S;di<hq>CwKn z!`8ru8~1eo?C!@7qaNdpQZ92#oRCN%3sCAWjEMPM74?Oq{&3UXHNwnXhpY6a#t-^9 zo%Cc;M9k!`m)s>)FNzp*`P8M+MU$&%m@~#5XzaN6j=P7i;b6>pv)K%qbF$fNfU#AD zfj#ogs;0W@C*ObQUPBd;+n2nuqcJfF+f&7&GxWa@6>CzoDnyCzGyt8Vq%w|9kFQVJ zE4a@KaSn8OQqOjvibDZE6o^8B1QgI<olg6CM0zj)70C%(3-xd#4(s=}2&FM=`F6_2 z@*QR?^D0|i`*<7m>2E}c0w1jrD@0tZI!-UE8&;iaQSrpjT~$8i{|)sW(K_`nzghms zAY9jo6+xdoarM{T&Y$=|n%jzKbR>78Bh78z@<dPU(PHl(awdMqF;%+Y<fg~iHKPNl z;OkLeZFh8SSCwBIZVC<Kwb^Rx#EoBfd)LI8G`CHt#)+OZw;9y-iH`a1;#E`JE57|` zp(AVIgsgMmnn9tpg_STRMl;%7Qhn0(LZS>1XFhQmEyZskc{qgCth_|fa=ok>sOy9> zNS$GtFc$S{X<f=E71D|#_#{fHxy&zR%e<2<^NX!z9xRab4p3)5nY0rNgQxc=FtQ<Q zZJ(lQB2uMqkjhYJQ|t@kEG7lGECj$qDG=khn1$?MF%EHqeJ>P24y!##JA=om(?`SD zz*lO6gQ~m*+ns*u@T;PgVd#G13+jYL8e7>0NHNjKxBCH`w~>#XK?DC1`Y#8`ogdLJ zN;7tm@+gfaC<()VzgJ5g3uu@0IBEzQ`v?p>8lz4W>c_b4ptQUQ8>Hcm1Pn<cMl-Nc z8dHfxBltgjsUVrCz7Kg^kcH}-&KC;urA9MjMZ;9TP=ggKsBCGY;Rf=TcthsP%@j}) zfB|b6(Gv|0AMGNK+vS02OPgRqX^0KLli+`jUSwm+piMr5?K4u8puHf`0snC_DHGK) zr}c9f&9B%xmW2-3pwnq)G~pknS}=iho7+%FuSx*c3ju(?L&Xs<b=<DbB9Gf;foyXM z8CVAX=ZLD)<>jq}xK1P74im1E0yhfzu)7em#4eXJy@a@jh*aE)KqL#bSj@Dzn|Myv z5|WqbT72)HV}E|(DV=HW4pV!t=>XXT)h$X;_x6T{7aJO0pm%wmfI{cl3ZV+`FhF$% z3d+gq7@#yrX_PLMR$j-oc&7=fr+_AIVPtcD-UA`aNkjy#!WjPvcOw8A(y`6XJ>AdM zJiBEH2fY9kIf*g)W4{SQOy!IEeDKfQ($aaQrMJ^+Pn{0!+e#tn1)Ovel7hQt1t~8W z!ao7HLauFtKbdlyCM7YWZ72rwQoiiYIp2U@%$DBcd|CtZbaGy7=ALffvu!PvjCu3J zLb<tIxirzj+t+ATxMB4=@9JqU=qhl3LZh~lXbKN=ZclScIU08Tee1iAUmMjUfPGqE z@2ET@_DIN)>-9j?Rs4|P29F`3S*#N-1IW+yo|pLS>bHDBlf2B-Hch;I>HovVUwY*Q z8oo7u_Po;DZr70de?Z$-DWon-(sok8fj56s_VA}s4YB<OcKI2x<A_~|*!K%;Nnmdh ztD)x@H<Dq0n~A;ULZR@<LgBGrfA9h#{H1XV+-Z36#X|QBz`lxGidhsb<-%l3u@}_e z><>P40kSW%ET!OU*d>Ws%47>Y7c3=UkcSOJ#pc0KGl0B?P7Iey(zzq1+8a(>fdq}) zTfoTk=b_s5yGXrGv+QLv0lkJkrwo9fkcvi3-P=ot-VB#LtVi{QveE_~fb%P7Hkn&^ z1Tv@Eu$bZ?Uk@dmoM8=IQEXP#y?ZZeYk3L@kbeCo0}YP9TyjaG;TwjrH}r)WLK7h9 z4H?tCtI?m-tEt7Y19hweMfMKZN{8O;D|_ry^esx;;287?pkHmLcQShJS)`Bxfh%kW zJwfG}d#F5nf<*G?N*U2o=ehX{XRDU-KWJjDH$v;T&YfF&+l1TcR;kV`O`-JT_gwYu z)%hQ;sgJ=rT{NTOUe$uP6(9I}|LNgtqjZy0%a^{!d(RACM{>c)Z&+-wd$}n|TlpCQ zIR=4aCBxtREM4uM;+`_ay>3dZLH^4nQwrUhsr=Y)E-eRwNaHI&pf$)-z?WB(RYqwF zr60ffs;nvBx%r9jGW@Hi-lWoVn$r}fawU36X&GM}cWnDQ7s+Ugw^}X|yW?CeLLZnq zXuv@K^iG-&Mx8%*?u2te`O>-aJhjyM8edN^k_c<1at69}Qg0NZQ0R9z|8Bwee|huM zMF{OI`pyE?T!nZkD%Uewh12eA`Z`)>=CgO0w0K;!kh4MvIY?a$bRAi(PjR@{t!HYU zHf0Lv^JP0KL>l17A;=sQl$(oxcP~;3%lOW{DU`UVLxiUkjm0<;Vu7iN=m<b?ipO(C zyvH!n8ZM*x^T@5J&v|If6XaV{^a(-7PxUSX667~8@UBG2UOxWcSveXqp&v9LcU+Mc zQbWiC46^uA1G1e%Iu9ZwMn$0kWZd!*UFTl6F2!QGDu;N$_7a3ebtp_hc<ap{zCY!c zH`)!90YV_Dsnexe5v&=3q>NzdDMFkq6cVfThX{27V<B9ur;AX?AnK+QXV0BY78VN^ zkPj|EW;3Y2RH9oAmTvmoJs<Y0t_X;^zB&J18w<{C!Q!{GX#F^$1xJ@TqZvq{n9m^% zSc{@;@zSV9WCvKE1GPhlgJ=yIOgnlIRD(FCH09Fg5VFY`!vLN*iqj*}Ga{)rq}Lcu zW=O>d(a(9VrCO<TLTTx_r%K7(giSAMW*x{Cpd7B8*FwWrQMxV4wkuyMc8-Y2F>@40 zNN~(BI08&H@8B7mJD?WcT9D{`qb-gs&%8^u2IuOAhV{_~=U*BcwyQ~+QQcnE(<H<J z>6v$dVJ$<#U0EbyCz30C|0H}7Z`?N;%1ONcM;`<q{Emf%<}J-&Tw%4i5JOYJRReJn zS4_N=+%`-crF62pUOjh_kU^LlTeKXbL><PLDe`5-_af=#7|JM&TshBsJH<%;26G)F z;GQI0$O6bwU3e>mo6VhZvCZItkI+iIfxHBL*I%O5?)qv^laNf>WN;b{#WV<lm7?1O zj=96&IB}SoQQ~yc#8NqrysY!>h3PZJTrcKs)7{VY^9JX7y3N#2tQ57QZgoG&wetq& zc{&Y`s;QggYEwNs)9_HIMq_nyj!@EU#?wcfIDLo{4;I<32W;Bi1C|8s?d>&)MrjJb zUec=FYruwt;2FWR3i&}WpRWgtFO{8OL@8j#vki7uhpIZEurToIC<lAjRFztqxp3aO zrQjvvpfbJMy{^WTM6!2nWC=PU67*^KUdb9QfiIwFdWF2=dSkn|b6*Oh6J-1&h&i&9 zxOKi=oc)f8=~&D+{*D>wy^*t*vWV@CFy}mytiVJ=#w86ean_eK)xFk|M%E)qtXbi5 z#@f@SX-u6FxzcB%cAgP69+F*N2uu+5GfSfZcFN+IYMi`<6kNC%<`%m;={(s~r=~&} z$HmZjrRXyJF5~Oot0ivfc>w{9sIBSDij0R?m^0@c8yTn$HncMY842Qko`d}`S$}Fn z=JPK;|B}ng6sXT48@VXL{V*ABDA<f}8o*uMy#)q(x>O^)>oud`Vu~2$%lV_eIX|$5 zxR5>Zdk+V=Jqd1ek`dkpMksTw(N-JR<`ku=Xn@;%L%_AXyG7OLE`w{wXr(3moGT$7 zK^8NuonoT{Y|icMxqx#9_>*E_>l;Wq<gtuyTEk16?ImE_Fpzw-!@`*SGKPifTK*Qt zs!BQFNsE=u4|r0sWO2-6qk1FN#)P&YiV;L_q?i{+Li1Yg2P6n%45XGbBE`hR-Z`%) zArb!AcdilA1P!K9ntI-tp0tZ>JOfv=rWW|R+l&!BXj;~2E^4UifUvA&E_||sT;fEG zV{N`N$-9-B(~-^+NSm)r@oJ}ih}5%2owU3MkxXOXan&d!wLl;VV=tbLNT+e}=1hg$ zsy^h;$Vm{N5Ef_<+;#h48iU$Sr!EUlQ)$&?qY%#$;&jXDq{YFB({cnI8tgm_#YNBP zFJR}v6?e*<lCV=krMdYk3VY&!M71yjqz0h1l2Su?)tMU&$t)rHb!^TWUqCu_wshzA zX#pvm(0|lDYsI_WuMYN9mML2vOTVnr>WLdhNz*NlrCVEpugc_Gn|^6EUOkxes2vXH z!3qJ_tM+Og3GK+Goy|)-ci-O)aO^b89)$qa+EHTW@zp4*N?*WvD(S##G!<Jj`C*ko z#hw6cGO?Cu^$D%B%-<Y(xp`^#9ta*UORqD%3+Pg%=`)w5&|w&<A9PgudWKjKc|{Ui zj6%#N(UAk3?1oGEgurNzINBMTWbDrX?z>tZHrI6xYpwy7`S(XfwwelDse<(B_eX`d zurrC6TsuEV4Q}J&(ZcNatn)Fpj{iWcmgk0z?sqnaD>=`W*OHZmalgKGV*Mydy5%(+ z5QhBvCWj(mnwnE#M(V_2*Q>_v)r&8Bpk@{$Ni~>>7VNygv$?#o`Tp*1cG&eL$&ifQ zkXC(e{U{;Igk*^$fIcc5N|8WN5?|PKv6O8t%)=^avF+&-*v-Tc&K~`unPszn9<6MC zpa%g~9;dQx^E0t-lng}~+n&c!>+9vMS0xaB)E;a_@*eC_-0P4KtoUH$c)SpYPQd>! z>Z7)8AgMD1s7)Ys^Op(pCXt|t-qBmXVtnl5*#4E(HhYlz9_hu8JM08oGFSsA@&p0S zmKV{)*}mB1u!)%liBiUn7+{)QDKN%<SO%E$A_k0?DT2K<(~F-2O}|O=jK-ST_l2Pk z@GBJk3VG5*vB{WoR)@*tz(t}OSUfOkDX>6XThM27#OwqE{4scy95#1V04o|Xz!u~F zhDh&$k@Vu{9V{HdGd14ewpbs{U@CfXgsoyyoWfjDF(kp`DVr2xQGjyk7*@jG0SdgV z=@Ax`0NzfH7jX3@dpw<vgt#A`jch9l1e=4uh2nT052t$ZMhAN$nQdxprLOb~m5r1_ zz*Ior0y=Ol_;@ngR9fvtASUn<R7N%}UW$H&J+QPixAxd5G{e21+GsEF_Su~bkrG65 z1^$7Krk6MZF7H7=R@fE<D4#xt&Fj74qJEmsb@<}67d`8rZ+Ph&j1)pBx!w?`LOgaJ zigQ|Z#mQTa_V~0Rp-g%ZX1+4SwAsUu3u2>?69*i5#5(}$3}|4i+v4p4+9{6G9FsxK z1+jy$?w<ewuhb6MA-!PRT8@1LIkatuwjuW8z)^bZx$`E@gD}g(6-+0~b%r<<;(^Oh zy!mma<mM$;2fLfKAnKVNPt@*R<ZA|Twl4#2U13AlxhDxcSI%9vz4%79F9UR^q6Yx| zCU#uGX0u}|kSjWn2Y?(t3>+k$pz7RKkT{W@P+)X{f6FHblu-U$kNnS}+8ds~WXkjF z8eZ~Dn$6AEvoX046@|QaV4>#ccrVJA4|V&r;G}9{$#P9=i+>U8M$=*JhDt|RH-?j~ zS@x`%Teuy%G3TGqjZCUW`b?9?&}SMxnpXdTb`9OgBqVZ>WCc}nQBfkia!46ry?70Q zhAQvq#a`^iQCOHi@3vcK!zkR(MnPAzHYSy!qRhHiuuL<S(PGn~6K_E$?q@@Reelgc z>f?QA=6x70z&?DL+6V9J7Z+n6UWGp7(%6dRKHP|Xh#7szg^=kW$q8yQp~zDk{Ch}a z#`I^V*GKvv#BS{2gV8YM#q}^4tQ!!Z<ZMhWMn$p5W)GP?NkqfTgMRFZa4ZKQ0R8>7 zr<hT_z<Y8u4|`IV)RO~FkN4Mq9|W8F6B~^F$<UG6>|~k0H1>0qIOs9&#~8lw;g}3v z>8mM>EJ=hP>8lOC2~2t5bnal<eQ3i4`|6q(MEI2EbK^Fc8{c5IRjPI6Y)CCiMbQmU z9uY-_Giols`Y6nkp-DB&A03pdihdm}XM@vtC+||?yZxhl(g8V}{NB9@&+~rH24_vK z;g|5eM|{NdC+yUt?a(PlAs?Sy=+u|ms>qU99+I_`u}(exd#31LU$~`Z`M+HgG5nN! zS_AV_1q%05TXP;yElNev-{;;bin30rlUIb9&!UR(S)1hLKL22p&;F-aue4zAs9q)N z<V<g&haDjO7aOSyJ~SMcmp$Qk{0ciYsr?_Yit>TVfj))QoIqY8Ty>{%_nK1Pr;nJn zfAY(xeaky5BVvWnO37@k)WLgHs^67Ums*gDf;%s`gBN5gtxCxp9piF^&!C0i%z{Bb z?@kBr&QqhiGja<!vvbZV#O{2^25HFwV+Iv-XEq(Xqu>}x+pRGQSKsVf%dvcb<%Irp zYt)tacFPu9cXX|RT%ubmveueYpIVUef?ad(Ozw`tx+9hpZI`SR-T#zu&i(|Aky)yL zbbsQFavu55Uoq$0#fHac43D&3tSg1sp<4VFtfSaAKw5jA3%FX8ww4w)KwG+@b#m1W z(QE7j#CD<*8=P4=b*Y7@DAeX|PSYDKh=Vg-uJs)bFW~OY&j*Kg7@Y~Rfw^4H^-jy* zg|4lO4Gi6E3``+^oPyoBfH{PAJ}&1&Hv;P0TdzSPSKB_(jW^f?aGk!YWqIc{5i68@ zc^F4T&GDudp`wWPl_=sgWBQ0(u{Y7phoPy3lj|M!VSrr|9$k`E@)R6}Ij^%(D41-8 zBzbsJf_}Mxg(Rjklf&wH?aFD!d>=D$&xC9C)pah2SOK`M%Jqg66;hfiq^#XfL{|3t zKUO&A5{~(tiHTdFkes)w@G>tF{(`A@<N4;w0h^)CsN5hkdSWWq8CD-Wc8W!IESgB1 z_f7W3wV_kCHK}&i3n?n3)QLjM+9gyt6<=kLEeee+(oj{cz=oGt>df=5I|m=he8%*b zIo)tF_`p`e0D~@p0K?0*Hyz-5)%d_ED>54T&G-E_IJSGKcCHmdA|4u2ulJ8;tK6%d zK4nEgs!EHJ*<7m}o<R}*<kIUGn{4828tIAz9jI>cLH<S|D(+frHs1VR`Dn$lcMMT& zT;|!=%SWNHmkv>BGg)|cw{Ke#7;FB989?PKidh=tv9a_HzDOAN{)2P5nASw3{xsXl zsnl_e5vj*ZowpH^5i6C{Y7wUkp)UqN$T(=i7dztkY_@_0>8P^=i+D4%1va#pI4qeR z!+>$yAe+i3@I_swFxZ7TiiXhIoQMVs30NC@%#9(|V=UmVsVna{=dSZ5N(bX?C(NF1 zV^qb(Rz6;C(SiGn#`&&P;fiZo%jnibw^?%*cV7iD+@bP)`J)(*zq`)VUx07VR{*4^ z9`+6xjkh!9g}Cxw!ItUuSNi)cA4$m<pgY=ykCRb%LgoU05?wE&JIJ=FsJq>a?yaLm zb~;MKG4>WB+p^Bax9}r{%;ts&$&cZVfv;3I<Iehe+%Uj4CxT{&&zebMm{IOz1ohNs zs8MamyriMwB|7|hTs(z0gsEMa;o@e|MHTibgBB0tv)QW*2pu6x5_AlqjYsmccK~#? z#I`u6z!dYN?CCs0FJx!gz3es&dWh-;2JuGL+#%e9xOo&;dhWSuse_)l4|IzUbxdJu z7Z$`>+ln}GY)PE?ZbpoovU*0WO7<N%jUsSdoKnnw5`eFuUYnN1%V>^@{bC~tw+|9` zNDt+P6S2OB;<o*GjP%hgrsRf(_0wL|F9C!7_&-q1+E#a+o*ObtP+JL;d&bG7KT^PI zIk$O=!M5hTcILivWUhmyGC%@DVr%ZAUvV|dn-JUUkVs&F@6a8KbwUIEDAPf*j%n&f znuz{lH|$F+cCEC}2%2HHJ`W=2Qo5ZPb9L4#b)#mLptceQdt>vGyN@($G{8+8Um?;f zPp7B<nA!DGSz1*gRT%V+20`y(roGsaD^(ypo_$c_kd{^SqY&VSHPr)kmNj$yXI60- zKcz2+go*17?&mL=2D_N%TbYqV7wT1yW|gAJrL10*U)Sl==vziF6rT>EF`hxJVYZ_e z*==X-pG8mdRz;);2K-)?$gmuc+h8q~P7}wC-x9qcQUvz=QuX_yI|Gq^A^9=%s0Mo! zV{Dl)AQu9dN+k_ug)t)M=Fgir;oMU1ZX6NVTh>=&cZ?#`Uc~6kYrD#4P4a1Ptzn&E z?;wfJ>?}yr8TxP784M64-kI5xp)*o3ap*xlGC#n+I06o`3j5*+u=kS8&M-;nOhDH! z0$X8ZxiCCshN5GtFD!O24Gr6$Z*YSXdhfeze4s;K{UY5eMpKHJeQFNho$zV>^Nl`L z`1CLzpmNbCN}VBFw+5dQ-6CSH+;G22GC=b#S{&kol<_Oku{@kGlC+6+jL#S$d5Ez0 z&46#W7^5IlxMPSGgv~*kaPGW$Fl_>PeA<wDdl8yc#OP2<b9q^3vo_pev$z62NMWNx zDzSGceg!u=@kU!e^afO)=M0G6WFF)uhcCG0zt2t%g}@<PTOl5g&Di;B9LENOcCO@b zQAgOCJ1;g|a!JEW0|jF4z*1`~MQx?t?y&Xb_3+Y}J}t4$><KKrxkjLm{fMYVVOvMk zMZ6<?_3h%LGFgp?emJ)Ce(+VeFh+=ai1!A?NaT=s2LQiS2VHrKE4NGQ4V$Y5!Brz( z#7Bd_3c#ePA?<hcnjMfx0rpBNGWcr+|Jw$C4-TBcPj$&B_}L2q?R*@rqBBB#wiF9| z_Hw|iIQ&fynWHhC%s9j!#z)ymY`)OY>F$vS!?t)wRro5cvS;#4m|DWE8N0()T%jv` ziH@-6l7PO$nCG;EcGy)<6}C!;#1quXT=(U)OR#%!p$_opsDU_f<k9v|@R*M)AJh-< zeIussH*#&3pL!)cDiTu3h7nWkLa-wHN*lHj4)LRC)Ofvty^StN!sZc?IFFw5Bv-kg zJ{PhDMFIARumY$HsP_=z`feu|9b#waX!V9`(U<nkvg;aFn>c^@Zo>dGbW?EIH)q*^ zMeIvAnZTy+*`~j30LL(MR$h!fbl|+)@koA}$4wjrA~AM;g2bD^L<-PE7BekFsF`<& zJyOpM-m_&HQ=GH>?mBa0lN70MM6qLrSjCIi8~cakSe@HNu<1dQH}RIi%foe#cYrv~ znNy*XOjND52CbKe?0ByDB&t=Nj>Z6%oXIrn^!}5OF9+y^;F2vnP1XMP-fO!%29q9M zk;hS}*AiN`Yzq^zJx0QBzewN!bBDF2Cd&+dVWWic=ikeL;4%~S8M&uDY{cyB8#)V- zGO`&5Ka*)vYX2vZztSD6wn0b|EZ>6XmpXNQ^>W#q-OIb12W@-BE_pqTT^~lduqF4v zA3tDn7U@Cxkv2*dB#k${V3M}A+DVPKCjNx#EWOR&bFJ4PZ6_H(`g0`hS@BO6yQ2uO zf;!!OwIqLSBAQU*ps_N3E`i&eU*CM_nr>f`TD#mElv9nphH%&te)zxt4->XSS6!D- zDiOMeA7fCRNZbCZCPB;DME1H*5l8-<*HOg^_4mh36^rj~&qeZZOpt>N*RuOdy^!E$ zOJS~I^OejZGk#I|;L6Spo1V2U_v5rZx7U!QhGf;c4NTHHdpRgC2Te0*d>_Ps-eQN2 zAF#d-H64{rh(8)PlnoZZz8&=;V}9=wJWJ|jLR{URU@ZaY==AT^gU6fzF5;x2!(aXT zmwI2+u5i88vr%#Utk)8!mU!hKzsba{Bbi-t&2^`nIDJ!}N$-o>=tml55AiHS`Z*`i zNnrM<p%906Z0BE0p2$oEr=C>Y%Vc2c9U`7SitNLkOO}W2?0Un?i}k-O@3R}X*6P`y ze=oDwlBSll()ME}Z7F`2T-A0S<xxCC2iLvLcf_vtMmZaH?gluw@g7s{{6#7b9zd-Z z8%B;k!_!ymAoCN$iE?DgWUob1O{1CmJvV$O9!+*0K(0tXaaq#TlvaF?Gil4r0sK0D zSZqJ`3Gm%^@C1O9!u)mYeaI2m*!u_mTj<-logdOWW+1orI#_t|7i{a#w5=49Xd*hZ zJTs3mKf?oW`9D7IrqKbrAMtFc{p1~+C^bZt)z6}6@~o_ipT}?;3m7ilM*cf>PClB+ z-VvS*SpLA@L$>LNr#!e!7xV{kJ|4%nJ~9uHtbUyoZc9Wv%WGN8`pizIu?)TJmv_?e zK$36HdXhf$v#=>kO<84aC(7Dgbah*0rNU{O4BFl#2kp%9u3LwvcsrPGdp|U21MG!e zi8<(A2uQhNa}M$E0fI4fn#S-CuC1%%9_mk4Y@PmMgUb@7hUitzOw_K}+SZ1bg&iE? zcJM*-P_klkSC!tz?BF0k_0mjJv3%QqDGPt53%v$VuO84ViN>zEt_kNqvUW27$F{(a z!*)+G+4E$wBsC<r?)^^K<|Ojv>elbx$}Ip-`4KeWd&%x1a^;*=pEa`QFI|B2p#D?C zKM?*BG`=O~(pR8=2momXnycIc?XxwHpN>Mc9j|;8ws{0qUIQZarx~0fGX0~l%?(84 z2iu~wfWviixJa#Ci}8@`^t#Dn_GlO|X1ro(QG8+EF%>?QUWuR&AOJT5)hLI-bM0er zTSUvff1hbrAkftV-C9Ox%Dg=@nNIOh8s$z((8Xr%OQy>cYr`C*yGYJ4>0oC&6+*E2 z?FQLJXpC}50b}H3pYT=(Xf#=Eb%qE{60w8T7I6{rJQ_rF*y|*L<w6knI(rn2X6Bt? zg7Iy`wEY4LZoz)%q%z2uUgHgpC>?ff(XG-GOn@c{SkqyXw6ci57K4wL6IAjR*=Q1V z{END;0!apq7}LPZzpi^Dz8rI$-2srVILPLe6yMo^os&&Bv{hQqG3>W(&RKedQ|zcp zB)^=)vvCx!fB~Ta%Nu8)e{*84nBpG115xqG0p`y%UVnoxNe!*!i2>%qY`5)e!%7}u zW{MX}k_e<M{yGUDlop!^_ziXT77hZG79X<3k_Lp_Lg{J6w$|#^Rv<}Jgsh2QVMLJz z4Qx^Og>2Jayr79h^8JKhc+O}2Vv>PS@8d~dkGS_K$?i1*N2*0t%D=BkVJ{+WFG>nx z)a<oJ)F>pWUD6_q$dx=~%w+GgjV27qE({mZh^ql|8X=3?4ak7xHr{ZPNRPM)lwl)C zq^h7?W-6%QDFEF=jOSk2^+uQ|WNC`5a}Tkee(^vNQ6FTe@;*ufI4u7|OkC3$RB)Zr z6PSC58jrx9G+@~+25SU|7gjRZXYe2gc2v6312tp514F0v)Cdf@C`}SIQX_Cu78K&J zhfPv%0n~?I^*2d*P<TT>Q>+xI9wbCQfuQ&_EZ<Tq+`_>(L%|>?Wy=jymDU><tU|48 z%|MXLQk!gSWio7~83wY&iNWdxYoS6+nqXLg2n1($F||6kJvRso62-&`4)M}w;c1w8 z-p@?^I=vSG^+_`f3^rTTptQuc)+GH-&VIs-0l6qOMFV%)k@Mx1Rsd)st8BbX<Xkz+ z2m!m8elwL`3z_guCSz6t$Q)pr&Ll2i{)!r5pyx1WewJx3qlFGDw<trVs;Qd2UN_=E zE=w)hsCN&@n%rsx+<_4Z?%ZZ@$7$Tg9mAJ@cq}-3Ym8*vPdqf?9b(`o@zf>*RlRr^ zb2i03!&93c6v_c@A12v7W=N=U@Ml&s4LXDRABu)-+Sb(UHD*Z2WvL+>l73laVv7jD z3<;|Y>>+y6h8+(%ogyd%2cI#GOrk^WLx#G|ym)}^q>;~X0D4gBeBx{e>^?I(4EAz| z5obDdwa|~cmu#c@Y0J3jtn3YDgviCIC4OMaJ|=D|olcjl%qX!b!RRxP{xcj#13z)O zoGk*yIWea7ne<q|<Tvv2G5o+`*jO^9&wz;u^g%NUyimBi459SCS32xUS6j0;rpQu5 zHgvA5!)`0Eu{2{w_MWT2UQuMjj=|1SgpG4#q4r%Brm={0fQ<Taw3T9^bW(Ac$bDw; z_zYKH7HIq9OP5@@^oxB_o4%{%4Q32!NglZTDj{j9x&n5TMkv{6Q+59~yQ-JMrjkdK zHwabhIWsI(8=38pTK@*<+ADNTW&m`L8B{)fnxkl?WiKvY+W&_mEm6CDSF^~M$Cj4p z(%Y^TqLz8%_W+F$b7$0~jyBt=*%txDH|$OU^(75k)Fsm`12?iABDGqM29DU5G;Ahh z`e7am&ribk(T{F=W=U{QcOq(c+;Y7kNiE3(uihsllhzoY5q}!g?c}QAMRsbo$nX%9 zQJ2$%w$0MD$f}6U8WnyUWMWL!Bs^e7qjBo$uM3rX_H@5(S29&e{eT&ff>3zb1R-P@ zMTC8U-wI2Sa!5(Ch>-E(J|Gs7NjkL@%ab)S!uY3%SBT~dDrK);Am2PwpV?hUK}#)m z+uh3EzCc1#?7*ohLd;^^#NNO_#`z{=l-g&S$o4pAE+8rp$?1zNL?ihl8~a~^<`(y$ z5U6qSVRkBQn_{1o-e2&~1HnDX)~Z(HnY3+weNtK;eNl*6J^|*Jk7fO^&95+6Y9h%e zi0{>~$%STGZ8-#(TQDi|hm859R-;!iEfu_ivro}qKE)Kv!~3i#{cze`|G9g<c-OAj zF6RbCD?P<jYYKKmBSO$pExuM+`*N83u_}{!xGG7zcmPsUiqG%ntQaQFnfecG`fZnG zn0omT9P#y|8MIn>j5ud71$&NDtrV-(d^LQ#{utwN1L$3M!pzo&lT6n0DAixK$x}-{ z9Qi4iw^^_Jkgukc<L_K+;t!olT0KHQSo<=2R1b*GN$UCSHVY=%Lg|hb%#gQ!N`M~B z7?wUyAJBy3LqKyKKXK9wnvZsTpitU9Y}2~x*#MojiBn6wBa-0aHh5>1uNFts+<nN% zt_~)lXM4HkZ%|S5YTRo_XQ?Ppqp7Hj8kRhWGjf8oo#e%b>NdY{_r6MvX}!h(`O<$e zXt5_r>s>h;Q%g`=iRH(537gqCYJ9#Srgg>8dVIN_q;+xpKD!#YC)0pU<?Rj!DaMD` zUKS^PDGX*ZQ@IpWbm|)ETVA&1?iLQerHzMdQ97i${Z@E~*%ddYN>iKkQ}6igkrFK0 zMaBee@)_Lfd8h5hF49uYX$9<DWxr+U(stS59hiWIUJPL=?Z9QE_!xiL43r+CpRKD0 zl3+_&B9%Kne624jzH7~?qkBVPySNQJ{^bR}Wbj(wtrH4T!1cVNN)ou7>%IDyxN<Xi z*Eb7oA>MWedl8kPUwyrS?qVv>=~rG~SD&~OSRQ`6Nwc{ZU{PcHlq8ksJgFQFh3(SR zF1<uaCa*5K(jc!gjGVew3?_l+ke_jIbT7{KRbD%|(~IDb0=PS7fIHinq4!bs!w!zp zk_0YCsa~WHCOPq(4XM&JMLOA+x3u_Dx!WcCUI0`6P9NaZ4k_XqG#$Atleu$?2aR-? z$Jp&p3F*O?j#~g=Ws9HTZjKuObb)=3sHtR4iY!f$P1*sN3(t;(2@62>9RSb%TpR;E z`gC)vB?UnF6DFYl6Nxngc>hxfnCLn%ik7-iOU=7Sxo%gP00F06x0;$$PeWi7Hffq7 zZO2u76AYVJ!w)sWAv-FBMZe_s;Kfa=YNIvNbO!Lor$qi-0ZbOVZK*LEJbk-;zdc!A ztpFVh+fsz=yVeJaOe$qG73^3YL{L=&mFGqKcGY8^v;+cp55R)-!w)-B!J<mirn*($ zXh_i%DT@r;mSu~a%n8FA8?eEN@Az{vuSEtvOIRXL*@<x8Px)(}78!|#Y^HY?d%M#j z!n@Y!Eo85joEb%=_(T$tF<=f{u|3&m0B(Jf8Y7NYk9a%RiVsKWM!cMBg@&m#;`Q7) zbCdPrw5JLcI>EPck!I&;mGHEo$gwk3BkVn>N)bXgr5_yeJ-InMl2nqEP?T%L*$e&S z;a%_yI#ErOV0x9P5oe{3)dE1_v_P?t)8!@ZK|t!a>E&c{{!yV8=a-7X^wDU|h!mvA z^U-M4(1Xt9MFvYp`T;tCuaYyC50liBl#Uc4w28-=iacLZ`aY&wqS0u=w#cTj9+r|c z!xE(_qDh!O`qnAi@|q6QORh%D))Z5+<s}s=%lZ=2UB<Ct_ULbO+i1mMT2hV5rVzCW zS!2oakxq1R&z_zvb~%!v0*hNM1)juLeX~T;8IhROQeqBEP&yL2X8C{o;kiZJx8K2< z&t$s6=NCB%ipRcwYAN)toF{6D+hs3DN0rOAmt)#pD6hPZM#UcE&h+ZN#hE3n;O8mo zEoSc)VAREumI@W;u*{_+!NU*lSzfk{_uvAdK+Kq}Q@6puPf2p>bRs1cpeY4hNzj<A z)QlA;ox!&_bG<}D=<}0Jcd;xHss{!|(o#OT0r^LcrxInIWy8ZkvHCyE2+n898|m&S zp!C`QS=saQf{PYeYS&d@|CTeUBo!skJ5xz<2vOTM-BHi2r}7NG$>>AzLn%u~06Nj3 z;(8}CnCcj@e_`tXhpWy@?D$sWa<emKLY+FD*zm?>d!VJVBYV2HTpiqIj)R7MnZEY0 zy&$y}{6@Nh#sj^!bG;(QDNn!hgdhMWnGp0!#rNZzrKQETBTneeS1a%<XCkp_fC)eh zc}yoTEIUV<_82|cav=k9p>k=WY_Co|HJ#0Vh{bHP0lKnEC(fjjbacs_q>`d5%i4$- zmZkzDnx`>RV2|cQPDvQoWax{B2JC&wB~)EJXk<DS1A{`)pRi8%MiU=(cLSA}8OAz} zKSo$~0J`&R=Nka!u_lOqS57@kmTD_UN0rM-D#vVWp{%r;^F%pAXGU&u=6T8NK@k?n z)*1+5fn-EZ7#7H%VBkr%yAq-6jy^IRT4e8lq1ItcQrWo|NVH`4RIigjQb{_xWKL2^ z?x37X8}*&~+Abtm7m7s}9C^0!a6%^>VUhY2+|u^r?EYcm3@Q48I3?Vwp1H@I>>~{= zWz5W<-qYP;pC2ssX;hS;qQrS;D!~uOoV7)I9zR96cXZgAsDu5fv<pxE7pKgL<eaC* zd~hD4n8rrZ#H@bSw1ICV%Fxd|_kUORv?O^bOn4eKN>E#gbJCRH-qpFxCp5leTN>!4 zX#A+`;;qLmuWHM2ifV2q=mC&bFXD$BX+k%A5j<*0(5KVHZ|r+<0%m7ZS{O0%vv=5F zQd5|wX<xW+Bb-jxxJXWVhNjJ|q{l6<JSs0~#URNn!@Q)U`Yy7NX0j}#qnkcxG`-`B zG))`1My;mXQ?iZ9p&?4asG#-K(2$3!vq+szN%`qBg@+K{)LPD?V>CnzzmG}?ew%yF zhsUkJ#-3qR4h>4h2RTJ|n(^N%*HN`VKy;@W{!Os5=svN%@~59cUWv{8E^GX~_Uxj- z@VlQEa|SJqCg|3zI=aiXBoRz#J{IlS#F9zMqs^RzrXxXhxY_e0H3{W41LI?_z_>Pz zDpa62=vopFQiI~!G!(efUZx0&nQ16+nRW1Y4rW*s0V}7d92k7%QqJ+ryXn-SW_#%_ z=aP|NV)Mj(_5A7PyJ=A>+WxJRqcrYIi$c8eRQ8nq9XpDZM^p|E{udD}X*Roba&|qq zP(&%)-6CEa7`5$nur#7=zY$t#OmjTI5{dFRF>a`~Q0%Eh<?sW<UC2;UcLc(XX4fm^ zVppOpQPV6~((MW`hv;>*ve~{XNby*59wF=So6yCrHkXy0K~(M^tRQ^)KAmoZvNiij zy8hlJiJggOo7cGbv-5O&ludGVTT@~!KZ8$0!?K4il+VZG_f~Tfrz8)Rdmx%wm=;Dn zFw9;<^`dg12{!wbGtltIg|L?U&PWqqir;i)-rQ16YQ|9c!~-z5InBGHRijsDuTyR- zbtOJZlo<o{bQ=4`{GivBmhyqxnZ|xcmdb9@(7+N0SoS+AF{s=N$`K=VB%N~bg%U!R zB>E>kcUa6Po1p#Vt+MqSFN&e+OndU?TGf9$8>-JN?WAP?ltT{~W3`3%8gu`y9k8EX z%5|{A6i(Na(Om;cFtyhusPMaKl!L!az<#xC&O5^Z5wp&c0{s2F8SLZ30xCFQ4B3_+ znhj<T*jM6N@<x?q6hbOfDCQin4cT<L2Fyx$ziZMA+2yilH6bj^zz+bxrCPzP$o9!T z1uRVYDFq{Zc{Y_0`=(7%6b}Fi`7T4UWCFy7MDhHO%dkA3qo;eL?D10i8BTXpRROhj zqDGQW_VK4Ir>4}$k*w2@z_jFplUDJ#(~@X+C7qY>{GQfn31PVg?9Z*t<et!QQ4$Z! z?m0{xMbvxP%<+ja{u@SPpU+opr?))CC(@V#?H42+cuhBHTGG>4c|C13ERbM%Jvq#0 zBAf_Ps<WeF?<BLqV~bKwmSEIIOSS(o`A|u&F@hWK6=xtz9Dt!CQvNC8P~K*Ay6pgr zr}s2<g&|iEzrFxf_LK9kWbI~xzRr8Nb;T*0QOz>(>|*V2F)<5}n>v4SsQ;=n0A9|{ z1e_8CTq$@)rcaX(wC4%3*YzOGp|D0m^ON{n60raJ;+KEDvspQvwBC6((g_#!rWJ4Z zexHfkSG}6H2?gv;A(F>mslcZkdXXJ>Dd;m4aGwTZ+H)#}SR~g(V7>h?KbVm|A#MhZ zQBmB+02=Fi;A(%fU9r_}RBUe=(e`>KnoKKRhx~e405WM&k%Q@QY4KsUX6N8rL2EH? zYFXB@TVo9Pd^`^JSGK(Cno~*Y&DlVwKG&O8y8XGUQQFR1)i!mT;N?%!<p3GQo9*pf zEO_y0e^DZdm!$_y;_Vf@Wi3lvb~1wV`DssPgoLlYx-(h5Icrh9XAp0XF>yO`rK#c^ zJQ9k*KF^oT>oWBlxF5kn#dcnvIF#9g*Rlr&Js+d6mZhELjN)6DF|}pr7wzdxHe$UC zpxyuON-O?W;OfpKBi0WBvwIO|&b=ZH^T+{Uj&5Jam_NUiv02P!LQ&3)F9j9apnEY` zJG}Ul2N}f$@AI+Nes*=&&ux0vRIcZ=!hiGbLE)sB0kq7Hpo!;$G{h`rI3edV;$!cn z5SuASO=3KHW5oDs?=}qR4wrvY!>yCQsN@(~>`Qt~wl$|79a>u1ch?r#AC_%muOTbk zj+@gd81s-0G7Ek+d2!+iNtyY!qh=v2%?a0_DL|YTUK$GWc57I>(ig+_fTudAz8XS{ zbdrw$dD2=JScD4EyWtrWPN>>_ZXCjQ2gL7unpG!5nt4mjRSN^woDkJRy%_(6mxYFS z>-=?5Y2=7K2BK<C-5EuLf3=4l5w<z!1D{s~oFEY%w4Z<DMo^l-2fhd9y_9DKLq>j6 z7I=KZqDEbMS}a|0-rn#Z?V%9Fj6fDnl8By6A!?)iO;?hW;6x~4Ba(9Y*al)4h5a)L z2PeCXlp~x+BXj4o)+X_nJSA;klB%}Kbs}7}iS*imHZdSElr9d05=lGu)nuI*N^D%( zWHIqG1SEBy_>}M9`>6r-Ej%HJQBq*nQMLSJIsv;+toCsM@Gq1Z7puYM5_7z?<#p~} zY=;OU+36|RseZ~_Hw(+aFJLRZ_Q}Zdn_745M_D`$!&jo&H#@9jEQr6@upF~mOiE$O ze^1fqRIlAvvB#a}4VzyQPhEL8d+q)Rwoij8{WFr1zR!0H{KO9Wa4e;FR2-R^w`}p8 zI4&cep5z7-2T0xk>s`Ror<qUmeHOT3)*`I*NOJe+WK30L-LRcEi2O6e)0xs*u3_WH ztSy?E1C*aMu(a#=`!yc0T$a6)XB4&#V&+D=isX%!u@7erC&)WIYB)W@gZ`7H74EZ* zDa+xB`&J{haAr``=|21k8;@|>BDt`k1ID5&y`x2JEVu>oUSoOnBpisMBqNG?mE{&r zCA!fd!t}z~L48%bE7A2(xV&6ZvCRwq%-UpGhHWc*_C~r|*>?s(`<h<kqrStKH-vcj zm(f|CVcU|9Vcs;pK>ms47`6b7Oq)npDDn(@`V<EccJ5w2Je<IGzjX&|7jp?)Q=`kX zLD5(4OD|?k6nw=~dxPWU-pTM-o?&yo;M<)fljD8<bCzb<#IurS;^x0lq#E{oNmsYK zVl$gp#^VW^4SHeuE=AH|n+NqgPW6g?qXk*oVY?q)?$h=N4YD+tJm0X*jb?gDmeAmT z@pQxeHa}{lz?58pgDi&wPdMxeQPg9?Y93FaMcQG@0Ppg^%CmU>XgQW|*c#}Ca;;Bm zx}9UP^p-rwusP7T;Q4I+iyZSqkzv^6bQGJpEu{jM9(KE#W7rc`Rx?sIlt|Ex1U%EQ z?WCvGQ?GE;6hW3_*cx=qT&bZ=W&<i7Y8z>V%~5Y8dAezoT_UBh$!gDADJeSUOe{9j z3cG|_ckAW&+hhPSi9ztZ!ZQBoEz|2P7w8ox&}c!HOW62zT%MZJpv_~nB73my)Fs!P zLOop~b1=)`YNVwUS%cfntijm<UH7^Ys+hew&^T_@S>E78kYgIhXI`oorxRWG3W^F) zo{7@8s{K3;+QLCuieNvbMlejgr04_(eO;sn{+J}Cpo|$QD05kAU{_cpUKgd&7;E`H zrlCjrA4JIQuzBQ8(p8VCPg0~Fn>~blC?)(PM!!+c$5T+!qj@J`1_@7@x7yrq{z9bu zMJ<}yCwZ=4D?O$wtb0YP=wFU7tvs~hf)DCLHVx8hSA80}4No3HIdh!x;Cio@rSt|@ z)XDK!65n=`XM`tts}vgJzUVWN!1pUc^1l+#+%O9zX7BxnndmVW6Ds0KCu^E5q%3Lg z?#dAA?+W8F;M!D~-{;<mGB!MsPLZ#<Mk-!oXxVR1h=o_=;QiR#MLMRM`FFi$dRO*> z8>-`4rjDQd^63_2YN8!U@3&bJJ1@ASg%focL_GH-$(_lGp5jD)K}6gv@c4X&$f66H zDrB0nWuK%<s<PNGU|$f&m!rPjvZcj^OyLfG+Ey)oAe-OrntLbScKX5`NVQayu+rh` zer{heOG7b{1{Z-&CZ(L@NpPK(mgKO)e(Tl4PbYZt+ZF|(dJRRXa(${$o4Xl>oW9-; zV|Sp;V&`qy;snFUZ|grS)D>bbFJByAnE7obH`7_b$~Z|c@E){fU=8V|(NoNDSVBq6 zYRinP>2Qa52@bX{4fqzSC8K?H6*sP^z&prZC@SC{c{j&nNo@T-fp-9W990%`kGxA{ zur)@s-O4se3q*Q)K1DqtJ$CMQ)gowi4T}OUU@3kuk1d;}O>cJ?&tqYoQ!aIl7S+^i z_(UBN!we3&E#qUcd^B-bmde)O!eQBy+11|@%f}8gnXM!j@+Y(iyU@&M>$H*u1Mb^V zR|000*2WjGjZ9(ZeKQR8H*M$;aX+vY&+Hv7r%nvx(vj#eJaTQ@b#6h*QdfzrwtmHL zcw``bN02@#659&3n&~B3YFk@o;OUs0Szq`3lElc0fiK$jEzlT(#?<wj?_<)@rd2|( z+E&<8&-vVyPE@@fbC3Gsf)+Q7Wp@i&%4u1iTYrt9#YeoqGnQr5Omzzj9pZY~+cJ&> zrn*Ji#b&PCoMZHN&o5Eq%}bB8wG`P9FzqeUW^@>bY^(Iy&%4q|KKnYRarJ42^O2Xe zR^NTQ4OYLK<-R>?`X5<ZwT8TC!D0qn(+A<}8pt{-|7}i~7O!4HXErbGUXxH5!M9jO zNRbP-iI@&Dr(Rz(#g$H!XT<fXCaltWy~Z`0%hN^jY`8~t6E<(vTSBv+d(D)%5Otet zOEpi4D`1^0BW_Mu=~BN-J9jPaZhM;(TyP;0h~&79js;?c&Z(~*D%h7!lIO?u=?lzN zde)WBr?_GZ7%R_>+f5gl3$>IR_!U>|WRV&d6uX^mX+&ri;JI;)1zTe2adQInvBfVW zI-A4YZ7o7!c!X-C%H2U07+b&`ufBEr{IsGhV{R)kc`I6fUBG#BdA2p4E!W0NR!wN< zyr19CbLB!T=@7vDdHg1pDfb_IC&p9df+cKx<b}i$W{W~)L59Fn<~EWAhSk>Vzb%}9 zMoH&h0m}^Gm(K|0@+^)#OYTv!$TEcU=LzNZ^BlST_(i1ch9MZK8+m%%oNz56OVl61 z>|XOOZ<>d(Jn=0==XsX7);b#2o>A1fO9X02IV)q)d2B1eBVL{v_aG@SA*GS+B983h zd2##Mdu4om=Xn_gCQFK&8LDwo7ftY8^joY|OmHiEMGQ%+GwT2^jfm50an%-SrBS}o zew%N!tpJGR>Sp-Z&XV5tv6Tpcc&0@T#4_Dx25Dx)TG80~Y$C9vwN}`u;?5s~+EFrQ zOs3+_-$mE*Grs~3WJHVX%lI*}f}ihCW_fI3^~pbJrBB>XSmH#MyEd~A;sym9gZO6B z#^bi=P|e(sa?gqiBXX4w?%^+IlDvBSO(|0$`0YF=^>T$^>Ix(OA^TOQJ{Cw#Dm!iu z`B-{G@v#->Z4$puNb<^g1Hxz383$)Q_kS+js>oN!Up&GLg;?1#Y(qCgxQ*tg;B?H$ ztwuEQAU4rO{6@@X9OhK?pffyaW*fx*cy|-$moyeW#VXu+9Q~aclsO-_-!Yq_5$Ez& z*U%}}SQ9qZZS)6|2lB>t82u4R15snnuPCkL_5JxcUj}%1<y>#SVLAPS&PQ5Fj5qWG zHe@>c17@%O)ML1Kk@Sxr$a(q{H9;c<l&*b0!D@a3o0N^t;o-_?0bA2@)hwr4#I2$w zxowg?z_))^(-KeH$J@^Mk`DQ(u2ZS1nN@xMmB)EJ!OwLv9#3=M3L*~5%Uko>3s}=R zS224rqK5;9ego5cjF`blzsC-6@DZ(|`l%ip_*irDex1a|pAa2q3HC+{h}QYHk!Cpq zqT_w`)<+tNhj;vh(YTpD4^Ov>QR|d0qIz`c0j=5A_}ilAt)2~O?u)RL=frCz0ma_7 zh)3g%=1jrHW!7_%0S`M~%tt&7b=Mvhbzkr<wtdJLaZGYITEL8n=`JUXc!U|7XP>?8 zM57q+WA7METWRdxXYV*b+XIy9kqV>gZ(Vqt?{Bz)L(`-0TU(oh&~z?gP3IP{rVpps z+UJvdjD3umlTH|VKZI4#tB_gs&f`g2E6<Z@1Z>+XXLYMnwB3}{c1X$*=j=Po#*Gwn zIGsHqN{etX{mhKRH2x3a3Pq>u(%iRv;z4I^D|w6S`%scs6iNA|gN6?go1;su9xG_T zi`I&IyN}yeX-o{4M!;N~^?dB{s#Ew%hvvtIjYWARm;X+j)OFlgiOu|PXyAd}#L+{C zhA3tUI->S~kl4&P*4RIm^2FZ7`Cw~~G)N__^SJ#8iGNd5`s_GgT+K9YXvm;fN0_QZ zh@Cicj7r8CmZRSGDKQ#QTAdO&&IoaK9uucPagoo#^%-NvBy6H$XGoz%Abo;le}Xl0 zc4r;`6l(s&R&(tv92|V}>#$Wbe?$A9tYXQQL~S=upXThNL$8_4B4rv>j2{wXCB!so zP;Io?s8-}g%YKzDNVbe<yLm1&XI~<+(%=;d(41lRnW&U!J)=?SRFzpN|C+aZ#eR~K z=4>~SPwMO-LGFtWYWP#wd66L;OW`NvC&cZr?Y1NWs9o~Pz3i?ddU`luHYR7mt|f8` zLSm1~TC}p7VK4BT%6+E?wZssW!qFk>5GSbB@_L<}d&ptUx-0R>1oM~eWk(8fG&~HW zPoyHiaTIZ5g@t_;bc(g-uqQ0rO)`6HDeZ_9M4{ElP|XP9pR&5BtC?$S*O4ojKv*5B z!G=4c?0@)%z)^X9CD?N`6je0%*bf2@u?U1Dmoxy;bT+2TDjei9G&vU;tbk$t1X-XD zL;If(Ewi=HcTySkI)r9;JFE{a8{N9HcLBEUk3Kl6bw}Q+`~fhQilo-f%woHVJFNTf zTcF2I-WiA10}lj8_ugHvubz8_5DDuK1QRNin%*Bl0-a{4MbRLwS1lf=viI&5^cVi+ z;dDTS0JOe83CPMIhQIr+e|7r;J-Xyykm#*t-J|s3UaNaSA6z0#mv!T-TFnMe!XFLO zO4U9(d+{s#QQv8Qn$ba{$m&X>5edQ!o|Cm7fQF*wWysThW%nozO?E#~%Yc|jm|ocp z8j{yKp2Hu|U{H9N9^6-XVUccP<vUhh&#_(`g_SF1Nq}`z5|)_+O!!v!SNi_a1$u;Y zd4KzCvYx2wUeDAN5mdi@7OATClpXOIRBB>(S<CW%ze%M=9FK5iDW7ahp~4L9sI2d8 zHK<Nn8NP55qpo`Nzs&_*g&7k$XJx9cG}XO^4;~W<gGd51yJ~xaog7P}nKPqhEw=;> zD!wx8T^>S{Qa-Ip!NOc#tFk6Q6W&W!*z{#)@e&@_-KVz`a~Qqfh^Lqpo#o!3+eQ&2 z1X=$ildLmZwr07<(iffXsN(wao|i}gOI$8xuY#$s^u=sgMslwA*$aa1AcKlAW%Ltg zMykHlR`*6mWr-O2N|?i#04(2f%{Gj?95oE<6mhvyhp`cc5#kglO~|%^6xp|M9MR?X zfuHR-jqkiUMkxwYYypzE%Z<tyJx0@9hTrhBlvH6TiRz=2v=o#CG;ZQZ(vp!^OT3%k zV=OT=etMKiVe%}oD!^?v_4b5jT1GyrvTWai3vK39Aw9SkRv575XsR(Sm7Hkf8K>-) zWTeYNOF|la2!u2zNY?35&WUA-HCVwhNvbP>EsszlB`l{TDTn|eRVo7bq&!5B><A+F zmGDTI>`KPiAypMT#TBN_c`ap?5Q(j13?x#AKm<V9ui6KIWwOGsl|8kA)^^WJwF926 z3R>GeFSRwEqDqdEYv!l6##2-M+gy8NMoucRiwEN)evCJ~e~pit5Y=P@+<t*6_^<Jl zhFPK#Zn;rqIMvu<_`)V3)1gX_X>DwS&y8(A-{H%B{NV~X`>R%_cDhU6py<j1*1UDs z2zT)10!p`G^S<UPeF&3sK-mIwcLKIi2p|003JK5x&LK+J0hZVhKPujiISyvK4ffjo zd7X-ii{O=yCB<EMI;UnoO0~UyOA6MV(NdTZN>^Ze>V$P>EkuBcKFTvdL8t}7H?fQ? z0g{adz5>TP8}_6MtWz{d{ZOqFVgl`bO4RHPG|}y|K8HX6KWE25*DDy{`Io;h4uOal zf7EZi%IjuXnf5`|IYFxLRlt?a)Bo?4hcu}B^JO(q2j*Lf_StWQb#?=Pw>5SbhSmOu zmHnter^hSdw}79(tS3(KvWS<fEhngGx4{N#c~IN3v;(V;47EWitu<$(0uiC@4n%S6 z&Ms$7QRF3TAQbiO$9=QY13~E!25hZ3+r);QeG{gby;wN%(l$N1vftCW)Q?S^GMcEP z{$RcBj@g7<>pS+-ZKrK*$hlrwUVO@Gggvx3+vrzLS2XF7l|hZw1Y!5k%GigPiwlzt z`990D-3y!dFtyO%{?df)oQ_uQ7kPx-Sqm}B&R)Sg<78H5G}K4GYA@2G!=oBv$$^wz z_Iub+;sfwzIKv*hsYtZ*0a!hoR{2-A^M>AM^C@KH`hjM8=qH5~msL<cYlcSRoLS8Q z&;71qyBCIg2^f!B*pi;6c+5x&hCz!E0r)(xu?^O#1UAZ2cozQaAZ9_@Z?5(tXOD1^ zuv)GX4Kcrn*VqS*J3}X|j%#>b{2f?W5_!%VGpi1`zt4*!P(ux?N1rUM=9gHFo-aM1 zu+14&u$qxv;uyfC%*hMev*7F|=LTPo`f9tQYrCra+Hg~77_UXOt><n`cat@;Yhq2B zd%VHMiJmm~SnJy-I_A5JS50xR`1YfPj;w_fvd)2Pp7jP`!b_q`?NL`%_x$dj)3=90 zez@i^+Fj??r@P4%w{W78<{pEI-!d^T&An>Y;zY99?Ok<o?9nN&Pnqm_al(W`xaP@k zV60BWVE)FT?RkuVR+Dw+CyD(O*6S5YoRV;ilKI#aKIrEHl5;Lv89v{Sv!C4IDQsZa zdVNshDa^*Zlj~TO)><Di%|@ikb}023RFl`l^cfQMV8uK3^Q{0j6f^SDV8z=(0#nF4 zgM6-tioXjL4+Ys2fr|a`$#3v|+%TIVqGBj2W%s|&63fImFHbH5^?nK6VLwmd{D^Cz zOM1KrYB>+<{Rq`?P+GnSKDZOB?O=L1Kr&<e$9l3qWd2af!e)?nI`@gvmx%iVthUXp z7ICk^YTHD$NLz)~`gpal(|}UDu-;bgXU&{0MwJs|MB+87vv`dN8fjw+n9i$2(o?L; z*yX%RM0K}fJtWH*L7t5T>OF~<6N^Tu!+8g1y-RwcXrx>6GacN4unVP?rVj38u(z<9 zm=5rzL1!^<33b3Sq(H?X)cX%u#TN(*lj?jUEs~FE;R0@BwWby(aU+v*O)Z?ytc<zo z<HEqKO3A~9g+Zm2l7f{+9u_8M)_ST^n3!3s`yp;(>`m--hJD%UEfda5s@n_Y!mQph z;lQkV%Y_TG>b;*kL{{%6!;c-alyIR@?<yZ^mnq>wQSUNS3k9NH$<)GRUT<#5$g}~~ zhOyeItXkpB?vm=6ZrOz3K5U_+m=l6~u3Nz48WV!~tKul14?Oinx{4{Q81ySDX4a5W zZz8o`r&+II3#O4d?%~yLmFliX^`emt-h<U{l4=bj8@`uSTSsz*k$Kow*UPnnb@6l& zNeU*<8dhd0IPxsFGE={&wh1dU_3Pfst;|a6V5ouBD(y6Ctv79VU?;CtF={>CBx=nw zYR%fgYE8<|P?%CDCS@oxOn1QWj>@8>N-_IF%vNWb+zW-qkde!Hy<Jj0(=85J<T6(8 zL0&J8*{Lg7y$4vm*iZMRSZ_PjYj|NJxdNXS+&O$?xScwm=^Q>1ey7&(JKRIE-+ql7 zE|U2jNjP*PVS?Q|bek4od53Oc5$3$`bBnNfhc0Fk_6!KTQf|GPty05!HCv^i2@>6J ztCJb8D(b`~!e^_KtKeE*r{Nix3a-UEBQ_1pWS}9N2Jjoy_|*@g0+yXX3K;#D9PeVF zFL@24l?L&Hh*Tl^?ik*uLc6$QBu3{w@9;XU6a&`Gl^htvPqzGlG>9MMTeEhUMfJJX zr1h{#OQL-EjZ^{5vd9krxedz01SsMwm=wY53d>SYVStUl;wTK&-O9s*q;L95{oDDP zC`lNht6QZf#fm5mun#s#)#iM{3S)Irjyauh^-B4+zSNUcp;j%eNvcq*kRD8`5RVzG z3in$_48}L^r4xlljqifIUM;ONx;(%>fRM<Xo%{CV@ivPnScNzuqrNoH;}%xq5k!Kh zCHVsgS_1GvHGGiKxu1V;WE(WG8=8poXCukqdnX~BML0?Ku?k6D(luD35~k$uSTe-i zC%g9!tBF4hnIUQ_3HmRi*F<06yZe)#mg_I?i)&|dJ*#Bnc*MuLo?cQj9`P}+OFZKe zALF{P#8LP$dCxt6_RW_}p8M86CT5=1bvq8m;GuQ<PE=m|+D`xL{ylxCH=fOPYst98 z$GYBCQZpX$v923SJmV1`>w0^M!*glnjPut0{a=4lIKS|wiJk|}=DHXLqc3>4d2d0Y z^0J-2<^Dav&~MJ>y0v7(c*MuL-c?dH9`UiR8%wgsBR<yk_7eG=X*bRe$m>4-N%0ef zH=Q%#zs}~G4Mz9_<qet$g*?^0{g-wYbe_%itdb4m5g+S%dP&uI#K*e6yd--(;$vMG zmdN=(@cx*{6DAC<IsY4nrUs^-%{6mV{x|P^Lp|^4QSHHPot^(fyU*sj3)YNrh>vxB z5Y~)wh>vxB0M?9gh>vyM4r|7|tv`02xcFknlZ&TL{TDLjY_1F0VC>%d{Y3AT{+i0_ z!!w`n?LM1pT)@X6KGroZ;NuV<>lzpEafpv~jSKkA_kJXwf1q&nx;4|@x%>PnXLHSF zMt?aS9ywfov~N$(H8s!v&xL1mU0t$qJmO<rSCrI@M|`a7r6r#6h>vx>xWw^|O(ZL0 z+NO&q-Zc5W)&KD?pP$XO7YC#Js4~2D-~E65^oQYVs#=a{XLAjMF&^=;u3<37BR<wO z490lG$GV2Wm~yc<>)sjv`S0J`pa0&YbH8&|*Ekq`Eq~no_)`Cai(dKY=)TIeU5T@~ zt}fXy9`UiRD@v-yBR<yk(vs})h>vx>xI~`&?>DdfZQ+yKZ~6YkGuEy6_E}xyVDvVZ z?<iZU$NgoU*VCo*w|w_(uB%Jdjz@f~>xz=f@raLkUE&&-_!!rVOWZeZ`swd}D`gh` zZt7d)x3B-=v$MHogV9m`>&u?ghG+C&w^u*<dR6n;Tz8eM9gp}}*9S`~$0I)0^??%C zc*MuLZZC09-}L*B?{Q@9`^Mj9OBc_7^v1Kf#%QXyr@ZWgTeN7RTl?!k&_7&xHrHy& z+VO~wbsZ@gm-txMp%T}4#K*c0l(;8v`rQv+ak%9vj*{GS3bWRo%{4pC^hSv%cjI*% z!&~ova8E^Gm}KF<Jx?WC688@i&w2Q72=9ZS<k%|JkFUTcq6|}yZpw$FaAg)KgL{X~ z0zORLj0u~@)q?jl@kkH+?ScGz|MSV4>hqzjgnvx_l{{De9f(hZfB$m=3KT~P%kw0K zF%e3zTCMUcJ(V@|FkET)hyPbg_9SiwrWfJglFLwF5irH^NOpWBDkKG3^IT_^_zbRG zW{DEuI$@Sr3|yY2Bo99Hm<0}EM{G?%N6Z4eBN9PHIo3EIE%Z)ax0)1!qS(JrZN5qV zD=G^A{g~a4ii6kCb|{jqYKfyXoL5C(jgo8$|JWM}zgzVqtnYICqYov3Kyu<!Kj`cS zW|3yNid#jX>sARrbbScV=s~8_EYT9B*$K16Oa*Q(HH&~fNKrh*ho=9JS!5SnW!M@a zo<_4oJ78r8hy)+XPKSIk$&WmWIVQ94-`NxLfAr`(aDo56I}z`nB1XTRgF}hEk%GGt zy$|76G2!2u(8(iht*qPlM-K|vyZyFVq7trRRuSyBS;F4!LuQF8==T3t+SLU&bsga= zA={G5VA*6CriCCILJ~X$H_gPM5F;C?-3&4`FD)Syr<wjeV3{<rLgc?-0wN@~n}?<? z4Q5&beMy0Fh#h2Ea!YGkVjBih3brH@($X0$%aB@%EnBzyoqM&{iKnBg9%k6x+5Prt zzkAM}bEPYJk`Z1}HbZ8Xy__M{WEo}*LS-{zM%nYt^9?20!@o5w23!YaU(TYHrKPBw z<i;fk(CW^9V}M3Hu`ufw|Hk!(GJW)K%e<3--w!2%2vPX2vzmSKO<8UTP0N-62F7GL z3*T6vYp=l*vfkg2n35N1IYP1=@ioXY$xmAqMnaq<j)}nVI2idJBLySP3L|S6GKPtu zjY!2GWrSd)5q}ZS_<W(E#Ik+lvmcF1CJ6nr4-c0bh>kpx85X$5l~0*Q1R;Av2fHHQ z9hE&VfDkBqFZaeb?#JLcq`caK2ti2gyw`nlFd=@W-!i~Jr!2cvLNquL5|=@UmV=16 zmL#NFS1SnNB$y&`hQA6zzRgHMNR@8BAcP^9A{p9<M99w=Aqc6I<`D@8tS@b}oXn9n zH4+Js2Ub6B=z5t9A*<mZS3WMf14hiT&IVVc>FsHS5h%`6p%*uFiqWAwjR-KJpDH-) zlS5Z}_gv|HvO)eUBSA^?+n2MJZjdLm1PR#?zxCmBClm4_Ee}{ZS@G7ME3$lVOy>eC zH#m=Ag%f-LRve53D^dKy7`?7l3=ynoW8!BF7y(wy!}xo_<_u$5<9<u+_w|AnNcT4D zYyNMdd5|o72mUBO2}4OucRJ*<kf&Sj5WGNfb_~5M*I@i2D8EDmc+pK29Q4Vz`#e>B zp0z&tFN_2)HM<9+BO!T0O8{O1?+1<$FIpbr#dG8_XH}mp-^F7#RQh$!BY5EiPVnMn zBzPIeb2#+69%hK(MH`bS=wJkRF%9DvN6ne{l}nx0O(jw}c!6}6FMmpMlVK!z=!ft} zlaEALv4woJW|QyHuX}H`pp`;8_bxxwQ-R^vLfL@;3l`8&K?_ZYfX5N=xP0<O1`;h< zHQ~Y0a7g}4OCV_J4tR(bEzdHd#Zwb=1ZWZA19ogLoJaIoPOufU>}BK{ETVp~wH7c! zv{`LPs`3K{P?cZuD?6)U)g_PZ;)kV6szsZH;yy4`Q+yhXkvwx80sg4+*pTS7Sqp;a zf_M7f`TGVjU7)z?ea=8PG8B{IyNw9ZSe6t}r%eQ!9Dyd{rI(SIE}7xMpqZwNmH@o; z^!I=lEe}nXrX(*GrQ2TPJYu?V0v~v(XQXH@3zTmAAVb7-(Z-}YyBQ&xizN0R<K4W? zdG|f?^n-p(7s&mu*xdQpgLROL;U8B%+75%31*6l^a40Z%twL--P-1mH-$!ESeS#Ek z5D{v3d4u|Gz~>0~h?agv(hlUR4-a-v6D?W-&=QJ<K#P`#XsJ_aq3%)#T7sNMY(kts zY|C|wRJ)5=oCp{qHX&_HV!+D?wY%t1dyd|eYt3Kr&>3pL5XOBr+bV3zddNJulg&k; zC9<1F@P<0h2wI@f2t@_YD6|w6>?}sa3|gqUh*i|jNYGLfK2lFbPiP6$=AzJ&%mZ4E zJQl5*Nekx@v~Yr*3N1<G=V)PwphX)~(2_*Vq{Z?k(NbzHuOM0=h?Waie<Nri*#r0I zX}Q)OTk7@poTxu9Xd$J4x^rywhM)yX0uimCWeBv~q`fH63tAZ2OU<QubZ6F5(83AC zUNrEWpoR0a5iKVxCiZ}qODZj#=c1q`nP5=R!pKvgrC+6mA$~y%j|o~B(Fj`npvA0v zXp8aV($eDXuM`p$kYCf6W#_CQ7vuxNZ;PqV2i-x_)m>QE<f?tPdwbwfih_J1{=PGC z4&$#Q#d8+{+khD|9Ns{Oj!D_v!=NG@VKo#TVKoqLTJB!bL7Fc!VjWs5BRr_y#SjN} zoPG&EyphL<LiEiUV@PHX15k_!Uj@K5E;?Vkzv*bniG0wdgYpN%x7_)gaH@wC0iX-t zV%Pl>^CG(~-cS<{dEa_hEEg#8t{P|i%SgDM6xRSElw+*nfKRD^fKf5rxo9Y=UjvCF ze5<ZToX;2`76l_*sK1sW>VY*Aqpx9zSQIk`k<49;@GA#a6CGG94ULBk*3ut8MQZ}W zu<?+43mrX7^B@c19#1|N1-f=c<%-+Bx`FmjP&$;`yTYCtae`k)O1v8pqEkF$XjV(_ zXVh(!uA!)O4TRF~ZBurSAS3RebVi7?`Ywiueo&$89;+ELjM8TeBAMG5A^L$$>>j#f zCh5##+rGjr7OEF=@v+=Zhj3cALYBZEO+F@xd2c=)o$@(41EKb-s2)l%)OT()Dyk<X z=0${<_+84adLKh@t3IJYP&y;TtUs+BC<2TaMCpu(iP9M&X8rHQf#R!-z`c6Lj4`Nk z28daIOubj%YMN(jEz7rV!M!?Up7oK<IXHp|Sqi_H^tR-c*RM0*>K<|y1kS!kQIKas zUg!OzqI4+FBS2jE^}6OX5rw*XT(n$9bP>OLhKToub}@vewk~tEZb2In@-ai&iLEJZ z6tLCCkO5+A(kd>y`TV^lCClAc^PjX~#Y3sEmb!0Z5<up>fdE{0Kc3pd&>68$L)!+U zv2(jC0fFM^S|2MOiAwT%W2`tljsU+nd&_A8#-wVR3gZlLL}e4lhsl^)pNz*BG)9#R zn8pCZ%KJIS`PNe_OvcS`wo;u!Zv3OMCl@OnQux)AwLQ}Ny8MHmICo5p1jEr-Bsee^ zd&=IDPIxMN%-)brcq)6;o}Es3Dtp*2J^oYaS3h?j&s><7Ycg8$3g=>rixF}qZaAF< z(XRvp5y$9;hPl|a_Lg+QQ`yz_w8B%_Rrc(3!c*CmcFDS5_ki1d)$~bTzNIzC-#8ar ze14ON^;}PM>^K}h9c*)iuXoJFuC*UbCp?v1ZFi;<p31JWXQdOK%C58<b;jbAy7J>M z7`EnBw&t!ZpNox)@vn?n_u8@VeEG#`M<C=JT-iAnyVmYbCp?v1ZGS19@Kkn{-Iz{z zD!bC2HEAsQbN284@tVFh-|Aj*y=*SFSQ!(sx=C|nWq4v&V8r>2NYPwuS{dntr?P2f zq!XUXrj?OScq*G#My7FJ#y!jR+{|P73*CRRT$qd9h;L<{m8B`EMf_iVR+9AX68^mh zyRk#k8zf0;=n!ub{|}xa)nijV-LpK6s;B;o9-W#kF)N#1^-O=kBdf1Kj!UyJMimpA h<*}%q$SjXl^@L`5Y^ukndd|wa#wGs;J^#fc{Rd-HA`t)p literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/ClosedBall.ilbm b/workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/ClosedBall.ilbm new file mode 100755 index 0000000000000000000000000000000000000000..69766c2a6c70b05c5e3cc5978a236bc3d3b2319c GIT binary patch literal 208 zcwTe!5AtPTU^wCF<K*k)>)`@qi!g8jArP=Ifk+)4Mh8X)XJ5wvAje?F@^zaRZeBHW z)x?t4|2O_Wn|bDJ`OK}cAcd<Y)cjvLo#8)&b^4<9>(@`6I<>mG+C9k831k!lD+8;u zqpv%d%_P9!<nIy*WCP8#V~_zdBpA{e>VdRM!{G)H?d#Bd;C}-HLnK3c1CVwwW;hR~ d*?}Zb-a*cx-T_EAD1r4eHV85Z0(J2*007$6IF<ka literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/ClosedDrawerWin98.ilbm b/workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/ClosedDrawerWin98.ilbm new file mode 100755 index 0000000000000000000000000000000000000000..59db66cdd5e412bc9e4733e647cbbdbd41285bdc GIT binary patch literal 252 zcwTe!5AtPTVEE$c<K*k)>)`@qi!ksoa4|_RoM2&MY+zsz6Ju&%VsQ3#3;@a*bWfeX z@pd}HhY$b%{|EA|(-*B@zkce}snylht0vU^UpbxOKLZmCeYlh39^~i*RL8==#=z?A z=<5z*2e1e*x&(MCfW^fa#GL$HB7yAu{|q3=Si``m0VaWH^#R6u5CRG}C@_XPfOz&7 d7^fyMW;H<Bs}>L=4mO!VfU*7om}L*77yv8nO$Gn} literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/GlowDrawerClosed.ilbm b/workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/GlowDrawerClosed.ilbm new file mode 100755 index 0000000000000000000000000000000000000000..f69be952838d3518e32f0d8ebdf22104214f2009 GIT binary patch literal 1240 zcwX(0F=!J}7{|Zw5}PO)f)oi7$Qv9o+TnzPK`+f&3m#1ifdnlm^eu`*hJaCv;b=wQ z;2?Oy4WT$5ctgR#;N(<paukE4n@YfB5vtTazk7F*wvMj--k<M1ethr${=6%T%N9WL z!@{+)Rkp5H0AL!ja2l_}*R+NmfJ`RAwECQ7Q~?qoobFbi!)PR>q}dXG<@>(lIPG@Z zd%h+;hxl+f41%E7>v^8%x~>qyw(VxK$vLmpYNl!Gx?U_68DqI@noN9uv?ks!ap#=D zb2GPE{kyfT#;h=ND>G1n!0&b+H(M)aqr{{Xqc78go*B4&&@yBYNbxM-T#zYaeLg$T zbsJzQ^z_M@!caoWMhT;Ma9qdrA2q*hlxa&s8cxm`)_i!bp2$L_y1*3AK&HG{X#n5@ zoB|1$+KD6~T$p3j3gbvIyIH69XfIOCI-3Z2lzWk4_%x5OdK7LvL~UJ>-3feh0~5)k z@P&&SC_?&$kW}>bHfk3Y+MkSmeuLUQ1;3;G9m97YF|iZgly48*-@T8ij-o#g&>wX? zrTs&{*?1<eC?(sEZC`%E+vib^55YUDcwrkak;aoxIorX)rcxCPe}6Ou;rpbi%hV$X Fe*mcK5ZnL& literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/GlowDrawerOpen.ilbm b/workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/GlowDrawerOpen.ilbm new file mode 100755 index 0000000000000000000000000000000000000000..a685fe6f5f9973f3545e8ae1d18ccf1341c8baea GIT binary patch literal 1730 zcwX(3OK1~O6oyZ7v?&rAMHi9Q8c?(r!Bk8i)>2a&A7E^K6xxNT$Ota94N|b6>9m5v zC@us;DN?I0ge(HqjRqI-fkL3vf{T_&6W@y#lPK6!JH7tXI|JRj^$z^!a_66K&bjy8 zy)8$AL`Crf2b+RT!Trrdw1!Hl)OM6!7u#(rk<-Z@d;6ZCzm<qdiwupV6v}3W5b!oA z_hYeGBogWA>51ODETR#tPft%LlgW5I9*sr^2M0Ax>+kOmg+hv=w6(Pb0s)`TS5Z;n z@p#-TivfwnvX`|Nhn2`izv8Ys)tx%mHque21>DE0sDYBPp`ojx?&E=u29FS0_S>3t zJdhkz(%pWMObYF0Qc*NOJ)V?Om-hMki4Ggg7|2Kl86r1iDAS|=<Nx@FvG0h#31Jzn zpcQ-k!F|TOb@@taZav^xTz8VQsinCCcjb&uI&MrQNztt!AGY<96x|AjBTS}n-!McB z8>=!HKB1aYL|w#=zMQctgE6_AfqZ}zhuy>_;fp4$gf2=)NjOLB>ch9I#0}!L;*QC4 zQ<-$E)oY2%?GwbC#aH4Q@f}D3q?byhqvm%zaqaQ};ui6cxKoS)DH6md$z?jahv2wg zPCO<~shkzpR5<XL3^`Qkh`oX1*m^MZOoBTXo+sF~;5HbxgmmnGq;l<(Q5B4llbkJh zGwdoHG#HdwbX4D)RJpG8i^?riQ@gn{e+P{GGlM~r;oEdp<(=cV!I%t#@#_*8v-3+B z+v}gI-0&&@#^?eVf9AoM{k(*+W7`Gd`nT6nOM2d@We&CE2MmTy*5d6wO58a00JWrN zP)j~<<dIuai}&7YIMOe{n4AHlFb>AT`z4I3(0MqX9|B`+9DABOjXnL<WiVLoY4zi+ zaJ-x$F=qQgoc)QzasA90j3VhMy>u1Fmx3s%IpPcAig9wtw98_+avRVBCy<Qy#5?Sr z*rKAhcHtzfJRB3iItI?5AsTy#%i6)9i2`O8gFj))AJ8|>bsvGW7vaqY^oPsJgG9j; r2krwq5@n0zgxO%!m@&nkz=7Lg)U9A%4eHHF(XC*;s2rA}TS2G483l|K literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/OpenBall.ilbm b/workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/OpenBall.ilbm new file mode 100755 index 0000000000000000000000000000000000000000..b2fb2ca27b18a5d48060e4d241b34ced513dfae1 GIT binary patch literal 208 zcwTe!5AtPTU^wCF<K*k)>)`@qi!g8jArP=Ifk+)4Mh8X)XJ5wvAje?F@^zaRZeBHW z)x?t4|2O_Wn|bDJ`OK}cAcd<Y)cjvLo#8)&b^4<9>(@`6I<>mG+C9k831k!lD+8;u zqpv%d%_P9!<nIy*WCP8#V~_zdI2g(ql7X~Z!@&lSX>tw+4{T^)V2E#MXjss|;9v(7 g2hsLG+L3|5f!m?n0jRz~53HZDL6AWZsEdyQ0Ke}y=Kufz literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/OpenDrawerWin98.ilbm b/workbench/classes/zune/nlist/nlisttree_mcc/images/aphaso/OpenDrawerWin98.ilbm new file mode 100755 index 0000000000000000000000000000000000000000..889636dfbf72c00046650fcd6d9650c4c04bdc5d GIT binary patch literal 250 zcwTe!5AtPTVEE+e<K*k)>)`@qi!g98a51SdoM2&MY+zsz6Ju&%VsQ3#3;@a*bWfeX z@pd}HhY$b%{|EA|(-*B@zkce}snylht0vU^UpbxOKLZmCeYlh39^~i*RL8==#=z?A z=<5z*2e1e*x&(MCfW^fa#GL$HB7y9@{|q3=Xa_|=rsD%f(+7<94;bYb7()aYwHAQb z@-G;@HUK3V6c`ya82?{jtY-ir1`o!D4UDD?jP?zT@+%la0~oa$80`;$l}`X0%pd{O L4ra-J_|E_UJ$^<8 literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/library.c b/workbench/classes/zune/nlist/nlisttree_mcc/library.c new file mode 100644 index 0000000000..3e18174485 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/library.c @@ -0,0 +1,91 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/******************************************************************************/ +/* */ +/* includes */ +/* */ +/******************************************************************************/ + +#include <proto/exec.h> +#include <proto/intuition.h> + +/******************************************************************************/ +/* */ +/* MCC/MCP name and version */ +/* */ +/* ATTENTION: The FIRST LETTER of NAME MUST be UPPERCASE */ +/* */ +/******************************************************************************/ + +#include "NListtree.h" +#include "private.h" +#include "version.h" + +#define VERSION LIB_VERSION +#define REVISION LIB_REVISION + +#define CLASS MUIC_NListtree +#define SUPERCLASS MUIC_NList + +#define INSTDATA NListtree_Data + +#define USERLIBID CLASS " " LIB_REV_STRING " [" SYSTEMSHORT "/" CPU "] (" LIB_DATE ") " LIB_COPYRIGHT +#define MASTERVERSION 19 + +#define CLASSINIT +#define CLASSEXPUNGE + +#define USEDCLASSESP used_mcps +static const char *used_mcps[] = { "NListtree.mcp", "NListviews.mcp", NULL }; + +#define MIN_STACKSIZE 8192 + +/******************************************************************************/ +/* define the functions used by the startup code ahead of including mccinit.c */ +/******************************************************************************/ +static BOOL ClassInit(UNUSED struct Library *base); +static VOID ClassExpunge(UNUSED struct Library *base); + +/******************************************************************************/ +/* include the lib startup code for the mcc/mcp (and muimaster inlines) */ +/******************************************************************************/ +#include "mccinit.c" + +/******************************************************************************/ +/* define all implementations of our user functions */ +/******************************************************************************/ +static BOOL ClassInit(UNUSED struct Library *base) +{ + if(StartClipboardServer() == TRUE) + { + return(TRUE); + } + + return(FALSE); +} + + +static VOID ClassExpunge(UNUSED struct Library *base) +{ + ShutdownClipboardServer(); +} diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/mmakefile.src b/workbench/classes/zune/nlist/nlisttree_mcc/mmakefile.src new file mode 100644 index 0000000000..f54cff0ff5 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/mmakefile.src @@ -0,0 +1,26 @@ +# $Id$ +include $(TOP)/config/make.cfg + +#MM contrib-zune-classes-nlisttree-class : includes linklibs + +USER_INCLUDES = -idirafter $(SRCDIR)/$(CURDIR)/../include +USER_CFLAGS := -DNO_INLINE_STDARG +USER_CFLAGS += $(PARANOIA_CFLAGS) + +FILES := library \ + ClipboardServer \ + NListtree \ + QuickSort \ + Debug + +%build_module_simple mmake=contrib-zune-classes-nlisttree-class \ + modname=NListtree modtype=mcc moduledir=$(CONTRIBDIR)/Zune/MCC_NList/Classes/Zune \ + files=$(FILES) uselibs="mui" + + +#MM includes-copy + +INCLUDE_FILES := ../include/mui/NListtree_mcc.h +%copy_includes path=mui dir=../include/mui + +%common diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/private.h b/workbench/classes/zune/nlist/nlisttree_mcc/private.h new file mode 100644 index 0000000000..4858336168 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/private.h @@ -0,0 +1,919 @@ +#ifndef NLISTTREE_MCC_PRIVATE_H +#define NLISTTREE_MCC_PRIVATE_H + +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2011 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/*** Include stuff ***/ + +#ifndef LIBRARIES_MUI_H +#include <libraries/mui.h> +#endif + +#include <mcc_common.h> +#include "mui/NList_mcc.h" + +//#include "NListtree.h" +#include "Debug.h" + +#include "amiga-align.h" + +/*** MUI Defines ***/ + +#define MUIC_NListtree "NListtree.mcc" +#define NListtreeObject MUI_NewObject(MUIC_NListtree + +#define MUIC_NListtreeP "NListtree.mcp" /*i*/ +#define NListtreePObject MUI_NewObject(MUIC_NListtreeP /*i*/ + +#define SERNR_CASI 0x7ec8 // *** My serial number. *ic* +#define CLASS_TAGBASE ( TAG_USER | (SERNR_CASI<<16) | 0x1000 ) // *** Start of class tags. *ic* +#define MUIM_TB ( CLASS_TAGBASE + 0x0100 ) // *** Start of method tags. *ic* +#define MUIA_TB ( CLASS_TAGBASE + 0x0200 ) // *** Start of attribute tags. *ic* +#define MUICFG_TB ( CLASS_TAGBASE + 0x0000 ) // *** Start of config value tags. *ic* + +/*** Attributes ***/ + +#define MUIA_NListtree_Active ( MUIA_TB | 0x0001 ) // *** [.SGN] +#define MUIA_NListtree_ActiveList ( MUIA_TB | 0x0002 ) // *** [..GN] +#define MUIA_NListtree_CloseHook ( MUIA_TB | 0x0003 ) // *** [IS..] +#define MUIA_NListtree_ConstructHook ( MUIA_TB | 0x0004 ) // *** [IS..] +#define MUIA_NListtree_DestructHook ( MUIA_TB | 0x0005 ) // *** [IS..] +#define MUIA_NListtree_DisplayHook ( MUIA_TB | 0x0006 ) // *** [IS..] +#define MUIA_NListtree_DoubleClick ( MUIA_TB | 0x0007 ) // *** [ISGN] +#define MUIA_NListtree_DragDropSort ( MUIA_TB | 0x0008 ) // *** [IS..] +#define MUIA_NListtree_DupNodeName ( MUIA_TB | 0x0009 ) // *** [IS..] +#define MUIA_NListtree_EmptyNodes ( MUIA_TB | 0x000a ) // *** [IS..] +#define MUIA_NListtree_Format ( MUIA_TB | 0x000b ) // *** [IS..] +#define MUIA_NListtree_OpenHook ( MUIA_TB | 0x000c ) // *** [IS..] +#define MUIA_NListtree_Quiet ( MUIA_TB | 0x000d ) // *** [.S..] +#define MUIA_NListtree_CompareHook ( MUIA_TB | 0x000e ) // *** [IS..] +#define MUIA_NListtree_Title ( MUIA_TB | 0x000f ) // *** [IS..] +#define MUIA_NListtree_TreeColumn ( MUIA_TB | 0x0010 ) // *** [ISG.] +#define MUIA_NListtree_AutoVisible ( MUIA_TB | 0x0011 ) // *** [ISG.] +#define MUIA_NListtree_FindNameHook ( MUIA_TB | 0x0012 ) // *** [IS..] +#define MUIA_NListtree_MultiSelect ( MUIA_TB | 0x0013 ) // *** [I...] +#define MUIA_NListtree_MultiTestHook ( MUIA_TB | 0x0014 ) // *** [IS..] +#define MUIA_NListtree_CopyToClipHook ( MUIA_TB | 0x0017 ) // *** [IS..] +#define MUIA_NListtree_DropType ( MUIA_TB | 0x0018 ) // *** [..G.] +#define MUIA_NListtree_DropTarget ( MUIA_TB | 0x0019 ) // *** [..G.] +#define MUIA_NListtree_DropTargetPos ( MUIA_TB | 0x001a ) // *** [..G.] +#define MUIA_NListtree_FindUserDataHook ( MUIA_TB | 0x001b ) // *** [IS..] +#define MUIA_NListtree_ShowTree ( MUIA_TB | 0x001c ) // *** [ISG.] +#define MUIA_NListtree_SelectChange ( MUIA_TB | 0x001d ) // *** [ISGN] +#define MUIA_NListtree_NoRootTree ( MUIA_TB | 0x001e ) // *** [I...] + +/*i* Private attributes & configs ***/ + +#define MUIA_NListtree_OnlyTrigger ( MUIA_TB | 0x0015 ) // *** $$$ Was ListtreeCompatibility before! +#define MUIA_NListtree_IsMCP ( MUIA_TB | 0x0016 ) + +#define MUICFG_NListtree_ImageSpecClosed ( MUICFG_TB | 0x0001 ) +#define MUICFG_NListtree_ImageSpecOpen ( MUICFG_TB | 0x0002 ) +#define MUICFG_NListtree_ImageSpecFolder ( MUICFG_TB | 0x0003 ) + +#define MUICFG_NListtree_PenSpecLines ( MUICFG_TB | 0x0004 ) +#define MUICFG_NListtree_PenSpecShadow ( MUICFG_TB | 0x0005 ) +#define MUICFG_NListtree_PenSpecGlow ( MUICFG_TB | 0x0006 ) + +#define MUICFG_NListtree_RememberStatus ( MUICFG_TB | 0x0007 ) +#define MUICFG_NListtree_IndentWidth ( MUICFG_TB | 0x0008 ) +#define MUICFG_NListtree_OpenAutoScroll ( MUICFG_TB | 0x000a ) +#define MUICFG_NListtree_LineType ( MUICFG_TB | 0x000b ) +#define MUICFG_NListtree_UseFolderImage ( MUICFG_TB | 0x000c ) + +/*i* Private attribute & config values ***/ + +#define MUICFGV_NListtree_LineType_Disabled 0 +#define MUICFGV_NListtree_LineType_Normal 1 +#define MUICFGV_NListtree_LineType_Dotted 2 +#define MUICFGV_NListtree_LineType_Shadow 3 +#define MUICFGV_NListtree_LineType_Glow 4 + +#define MUICFGV_NListtree_ImageSpecClosed_Default "6:30" // MUII_TapePlay +#define MUICFGV_NListtree_ImageSpecOpen_Default "6:39" // MUII_TapeDown +#define MUICFGV_NListtree_ImageSpecFolder_Default "6:22" // MUII_Drawer +#define MUICFGV_NListtree_PenSpecLines_Default MPEN_SHINE +#define MUICFGV_NListtree_PenSpecShadow_Default MPEN_SHADOW +#define MUICFGV_NListtree_PenSpecGlow_Default MPEN_HALFSHADOW +#define MUICFGV_NListtree_RememberStatus_Default TRUE +#define MUICFGV_NListtree_IndentWidth_Default 0 +#define MUICFGV_NListtree_OpenAutoScroll_Default TRUE +#define MUICFGV_NListtree_LineType_Default MUICFGV_NListtree_LineType_Disabled +#define MUICFGV_NListtree_UseFolderImage_Default FALSE + +/*** Special attribute values ***/ + +#define MUIV_NListtree_Active_Off 0 +#define MUIV_NListtree_Active_Parent -2 +#define MUIV_NListtree_Active_First -3 +#define MUIV_NListtree_Active_FirstVisible -4 +#define MUIV_NListtree_Active_LastVisible -5 + +#define MUIV_NListtree_ActiveList_Off 0 + +#define MUIV_NListtree_AutoVisible_Off 0 +#define MUIV_NListtree_AutoVisible_Normal 1 +#define MUIV_NListtree_AutoVisible_FirstOpen 2 +#define MUIV_NListtree_AutoVisible_Expand 3 + +#define MUIV_NListtree_CompareHook_Head 0 +#define MUIV_NListtree_CompareHook_Tail -1 +#define MUIV_NListtree_CompareHook_LeavesTop -2 +#define MUIV_NListtree_CompareHook_LeavesMixed -3 +#define MUIV_NListtree_CompareHook_LeavesBottom -4 + +#define MUIV_NListtree_ConstructHook_String -1 +#define MUIV_NListtree_ConstructHook_Flag_AutoCreate (1<<15) + +#define MUIV_NListtree_CopyToClipHook_Default 0 + +#define MUIV_NListtree_DestructHook_String -1 + +#define MUIV_NListtree_DisplayHook_Default -1 + +#define MUIV_NListtree_DoubleClick_Off -1 +#define MUIV_NListtree_DoubleClick_All -2 +#define MUIV_NListtree_DoubleClick_Tree -3 +#define MUIV_NListtree_DoubleClick_NoTrigger -4 + +#define MUIV_NListtree_DropType_None 0 +#define MUIV_NListtree_DropType_Above 1 +#define MUIV_NListtree_DropType_Below 2 +#define MUIV_NListtree_DropType_Onto 3 +#define MUIV_NListtree_DropType_Sorted 4 + +#define MUIV_NListtree_FindNameHook_CaseSensitive 0 +#define MUIV_NListtree_FindNameHook_CaseInsensitive -1 +#define MUIV_NListtree_FindNameHook_PartCaseSensitive -2 +#define MUIV_NListtree_FindNameHook_PartCaseInsensitive -3 +#define MUIV_NListtree_FindNameHook_PointerCompare -4 +#define MUIV_NListtree_FindNameHook_Part MUIV_NListtree_FindNameHook_PartCaseSensitive /* obsolete */ + +#define MUIV_NListtree_FindUserDataHook_CaseSensitive 0 +#define MUIV_NListtree_FindUserDataHook_CaseInsensitive -1 +#define MUIV_NListtree_FindUserDataHook_Part -2 +#define MUIV_NListtree_FindUserDataHook_PartCaseInsensitive -3 +#define MUIV_NListtree_FindUserDataHook_PointerCompare -4 + +#define MUIV_NListtree_MultiSelect_None 0 +#define MUIV_NListtree_MultiSelect_Default 1 +#define MUIV_NListtree_MultiSelect_Shifted 2 +#define MUIV_NListtree_MultiSelect_Always 3 + +#define MUIV_NListtree_MultiSelect_Flag_AutoSelectChilds (1<<31) /*i*/ + +#define MUIV_NListtree_ShowTree_Toggle -1 + + + + +/*** Structures & Flags ***/ + +struct MUI_NListtree_TreeNode { + struct MinNode tn_Node; // *** To make it a node. + STRPTR tn_Name; // *** Simple name field. + UWORD tn_Flags; // *** Used for the flags below. + APTR tn_User; // *** Free for user data. + UWORD tn_Space; // *** For counting pixel and saving string space in InsertTreeImages(). *i* + UWORD tn_IFlags; // *** Internal flags *i* + UWORD tn_ImagePos; // *** Internal: Open/closed image position *i* + struct MUI_NListtree_TreeNode *tn_Parent; // *** Parent node *i* + struct NListEntry *tn_NListEntry; // *** NList TypeEntry *i* +}; + + +#define TNF_OPEN (1<<0) +#define TNF_LIST (1<<1) +#define TNF_FROZEN (1<<2) +#define TNF_NOSIGN (1<<3) +#define TNF_SELECTED (1<<4) + + + +struct MUI_NListtree_TestPos_Result { + struct MUI_NListtree_TreeNode *tpr_TreeNode; + UWORD tpr_Type; + LONG tpr_ListEntry; + UWORD tpr_ListFlags; + WORD tpr_Column; + +}; + +#define tpr_Flags tpr_Type /* OBSOLETE */ + + +/*i* Private Structures & Flags ***/ + +/* +** NList TypeEntry for entry position +*/ +struct NListEntry { + APTR Entry; + BYTE Select; + UBYTE Wrap; + WORD PixLen; + WORD pos; + WORD len; + WORD style; + UWORD dnum; + ULONG entpos; +}; + + +struct Table { + struct MUI_NListtree_TreeNode **tb_Table; // *** Table of entries. + LONG tb_Entries, // *** Number of entries in this list. + tb_Size, // *** Size of the list. + tb_Current; // *** Current entry (not used everytime) +}; + +struct MUI_NListtree_ListNode { + struct MinNode ln_Node; // *** To make it a node. + STRPTR ln_Name; // *** Simple name field. + UWORD ln_Flags; // *** Used for some flags. + APTR ln_User; // *** Free for user data. + UWORD tn_Space; // *** For saving string space in InertTreeImages(). + UWORD ln_IFlags; // *** Internal flags. + UWORD ln_ImagePos; // *** Internal: Open/closed image position. + struct MUI_NListtree_TreeNode *ln_Parent; // *** Parent node. + struct NListEntry *tn_NListEntry; // *** NList TypeEntry + struct MinList ln_List; // *** List which holds all the child entries. + struct Table ln_Table; // *** Table of entries. +}; + + +#define TNIF_COLLAPSED (1<<0) /* Entry is collapsed. */ +#define TNIF_VISIBLE (1<<1) /* Entry is currently visible. */ +#define TNIF_TEMPFLAG (1<<2) /* Multi purpose flag for signalling we have to do something with this node */ +#define TNIF_ALLOCATED (1<<3) /* Indicates, that memory was previsously allocated for tn_Name field. */ +#define TNIF_xxx (1<<4) /* */ +#define TNIF_FREE3 (1<<5) +#define TNIF_ROOT (1<<6) /* This entry is the root list. */ + + + +/*** Methods ***/ + +#define MUIM_NListtree_Open ( MUIM_TB | 0x0001 ) +#define MUIM_NListtree_Close ( MUIM_TB | 0x0002 ) +#define MUIM_NListtree_Insert ( MUIM_TB | 0x0003 ) +#define MUIM_NListtree_Remove ( MUIM_TB | 0x0004 ) +#define MUIM_NListtree_Exchange ( MUIM_TB | 0x0005 ) +#define MUIM_NListtree_Move ( MUIM_TB | 0x0006 ) +#define MUIM_NListtree_Rename ( MUIM_TB | 0x0007 ) +#define MUIM_NListtree_FindName ( MUIM_TB | 0x0008 ) +#define MUIM_NListtree_GetEntry ( MUIM_TB | 0x0009 ) +#define MUIM_NListtree_GetNr ( MUIM_TB | 0x000a ) +#define MUIM_NListtree_Sort ( MUIM_TB | 0x000b ) +#define MUIM_NListtree_TestPos ( MUIM_TB | 0x000c ) +#define MUIM_NListtree_Redraw ( MUIM_TB | 0x000d ) +#define MUIM_NListtree_NextSelected ( MUIM_TB | 0x0010 ) +#define MUIM_NListtree_MultiTest ( MUIM_TB | 0x0011 ) +#define MUIM_NListtree_Select ( MUIM_TB | 0x0012 ) +#define MUIM_NListtree_Copy ( MUIM_TB | 0x0013 ) +#define MUIM_NListtree_InsertStruct ( MUIM_TB | 0x0014 ) // *** Insert a struct (like a path) into the list. +#define MUIM_NListtree_Active ( MUIM_TB | 0x0015 ) // *** Method which gives the active node/number. +#define MUIM_NListtree_DoubleClick ( MUIM_TB | 0x0016 ) // *** Occurs on every double click. +#define MUIM_NListtree_PrevSelected ( MUIM_TB | 0x0018 ) // *** Like reverse NextSelected. +#define MUIM_NListtree_CopyToClip ( MUIM_TB | 0x0019 ) // *** Copy an entry or part to the clipboard. +#define MUIM_NListtree_FindUserData ( MUIM_TB | 0x001a ) // *** Find a node upon user data. +#define MUIM_NListtree_Clear ( MUIM_TB | 0x001b ) // *** Clear complete tree. +#define MUIM_NListtree_DropType ( MUIM_TB | 0x001e ) // *** +#define MUIM_NListtree_DropDraw ( MUIM_TB | 0x001f ) // *** +#define MUIM_NListtree_Construct ( MUIM_TB | 0x0020 ) // *** Construct a treenode +#define MUIM_NListtree_Destruct ( MUIM_TB | 0x0021 ) // *** Destruct a treenode +#define MUIM_NListtree_Display ( MUIM_TB | 0x0022 ) // *** Display a treenode +#define MUIM_NListtree_Compare ( MUIM_TB | 0x0023 ) // *** Compare two treenodes + + +/*i* Private Methods ***/ + +#define MUIM_NListtree_GetListActive ( MUIM_TB | 0x000e ) // *** NEW: Internal! Get MUIA_NList_Active +#define MUIM_NListtree_Data ( MUIM_TB | 0x000f ) // *** Get or set some internal data. +#define MUIM_NListtree_GetDoubleClick ( MUIM_TB | 0x0017 ) // *** NEW: Internal! Get MUIA_NList_DoubleClick + + +/*** Method structs ***/ + +struct MUIP_NListtree_Open { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_Close { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_Insert { + STACKED ULONG MethodID; + STACKED STRPTR Name; + STACKED APTR User; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED struct MUI_NListtree_TreeNode *PrevNode; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_Remove { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_Clear { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_FindName { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED STRPTR Name; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_FindUserData { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED APTR User; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_GetEntry { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *Node; + STACKED LONG Position; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_GetNr { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_Move { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *OldListNode; + STACKED struct MUI_NListtree_TreeNode *OldTreeNode; + STACKED struct MUI_NListtree_TreeNode *NewListNode; + STACKED struct MUI_NListtree_TreeNode *NewTreeNode; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_Exchange { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode1; + STACKED struct MUI_NListtree_TreeNode *TreeNode1; + STACKED struct MUI_NListtree_TreeNode *ListNode2; + STACKED struct MUI_NListtree_TreeNode *TreeNode2; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_Rename { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED STRPTR NewName; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_Sort { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *ListNode; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_TestPos { + STACKED ULONG MethodID; + STACKED LONG X; + STACKED LONG Y; + STACKED APTR Result; +}; + + +struct MUIP_NListtree_Redraw { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_Select { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG SelType; + STACKED LONG SelFlags; + STACKED LONG *State; +}; + + +struct MUIP_NListtree_NextSelected { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode **TreeNode; +}; + + +struct MUIP_NListtree_MultiTest { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG SelType; + STACKED LONG SelFlags; + STACKED LONG CurrType; +}; + + +struct MUIP_NListtree_Copy { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *SourceListNode; + STACKED struct MUI_NListtree_TreeNode *SourceTreeNode; + STACKED struct MUI_NListtree_TreeNode *DestListNode; + STACKED struct MUI_NListtree_TreeNode *DestTreeNode; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_InsertStruct { + STACKED ULONG MethodID; + STACKED STRPTR Name; + STACKED APTR User; + STACKED STRPTR Delimiter; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_Active { + STACKED ULONG MethodID; + STACKED LONG Pos; + STACKED struct MUI_NListtree_TreeNode *ActiveNode; +}; + + +struct MUIP_NListtree_DoubleClick { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG Entry; + STACKED LONG Column; +}; + + +struct MUIP_NListtree_PrevSelected { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode **TreeNode; +}; + + +struct MUIP_NListtree_CopyToClip { + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG Pos; + STACKED LONG Unit; +}; + + +struct MUIP_NListtree_DropType { + STACKED ULONG MethodID; + STACKED LONG *Pos; + STACKED LONG *Type; + STACKED LONG MinX, MaxX, MinY, MaxY; + STACKED LONG MouseX, MouseY; +}; + + +struct MUIP_NListtree_DropDraw { + STACKED ULONG MethodID; + STACKED LONG Pos; + STACKED LONG Type; + STACKED LONG MinX, MaxX, MinY, MaxY; +}; + + +struct MUIP_NListtree_Construct +{ + STACKED ULONG MethodID; + STACKED STRPTR Name; + STACKED APTR UserData; + STACKED APTR MemPool; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_Destruct +{ + STACKED ULONG MethodID; + STACKED STRPTR Name; + STACKED APTR UserData; + STACKED APTR MemPool; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_Display +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG EntryPos; + STACKED STRPTR *Array; + STACKED STRPTR *Preparse; +}; + + +struct MUIP_NListtree_Compare +{ + STACKED ULONG MethodID; + STACKED struct MUI_NListtree_TreeNode *TreeNode1; + STACKED struct MUI_NListtree_TreeNode *TreeNode2; + STACKED LONG SortType; +}; + + +/*i* Private method structs ***/ + +struct MUIP_NListtree_GetListActive { + STACKED ULONG MethodID; +}; + + +struct MUIP_NListtree_Data { + STACKED ULONG MethodID; + STACKED LONG ID; + STACKED LONG Set; +}; + + + +/*** Special method values ***/ + +#define MUIV_NListtree_Close_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_Close_ListNode_Parent ((IPTR)-1) +#define MUIV_NListtree_Close_ListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Close_TreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Close_TreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Close_TreeNode_Active ((IPTR)-2) +#define MUIV_NListtree_Close_TreeNode_All ((IPTR)-3) + +#define MUIV_NListtree_Close_Flag_Nr (1<<15) /*i*/ +#define MUIV_NListtree_Close_Flag_Visible (1<<14) /*i*/ + + +#define MUIV_NListtree_Exchange_ListNode1_Root ((IPTR)0) +#define MUIV_NListtree_Exchange_ListNode1_Active ((IPTR)-2) + +#define MUIV_NListtree_Exchange_TreeNode1_Head ((IPTR)0) +#define MUIV_NListtree_Exchange_TreeNode1_Tail ((IPTR)-1) +#define MUIV_NListtree_Exchange_TreeNode1_Active ((IPTR)-2) + +#define MUIV_NListtree_Exchange_ListNode2_Root ((IPTR)0) +#define MUIV_NListtree_Exchange_ListNode2_Active ((IPTR)-2) + +#define MUIV_NListtree_Exchange_TreeNode2_Head ((IPTR)0) +#define MUIV_NListtree_Exchange_TreeNode2_Tail ((IPTR)-1) +#define MUIV_NListtree_Exchange_TreeNode2_Active ((IPTR)-2) +#define MUIV_NListtree_Exchange_TreeNode2_Up ((IPTR)-5) +#define MUIV_NListtree_Exchange_TreeNode2_Down ((IPTR)-6) + + +#define MUIV_NListtree_FindName_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_FindName_ListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_FindName_Flag_SameLevel (1<<15) +#define MUIV_NListtree_FindName_Flag_Visible (1<<14) +#define MUIV_NListtree_FindName_Flag_Activate (1<<13) +#define MUIV_NListtree_FindName_Flag_FindPart (1<<12) /*i*/ +#define MUIV_NListtree_FindName_Flag_Selected (1<<11) +#define MUIV_NListtree_FindName_Flag_StartNode (1<<10) +#define MUIV_NListtree_FindName_Flag_Reverse (1<<9) + + +#define MUIV_NListtree_FindUserData_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_FindUserData_ListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_FindUserData_Flag_SameLevel (1<<15) +#define MUIV_NListtree_FindUserData_Flag_Visible (1<<14) +#define MUIV_NListtree_FindUserData_Flag_Activate (1<<13) +#define MUIV_NListtree_FindUserData_Flag_FindPart (1<<12) /*i*/ +#define MUIV_NListtree_FindUserData_Flag_Selected (1<<11) +#define MUIV_NListtree_FindUserData_Flag_StartNode (1<<10) +#define MUIV_NListtree_FindUserData_Flag_Reverse (1<<9) + + +#define MUIV_NListtree_GetEntry_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_GetEntry_ListNode_Active ((IPTR)-2) +#define MUIV_NListtree_GetEntry_TreeNode_Active ((IPTR)-3) + +#define MUIV_NListtree_GetEntry_Position_Head 0 +#define MUIV_NListtree_GetEntry_Position_Tail -1 +#define MUIV_NListtree_GetEntry_Position_Active -2 +#define MUIV_NListtree_GetEntry_Position_Next -3 +#define MUIV_NListtree_GetEntry_Position_Previous -4 +#define MUIV_NListtree_GetEntry_Position_Parent -5 +#define MUIV_NListtree_GetEntry_Position_Root -15 /*i*/ + +#define MUIV_NListtree_GetEntry_Flag_SameLevel (1<<15) +#define MUIV_NListtree_GetEntry_Flag_Visible (1<<14) + + +#define MUIV_NListtree_GetNr_TreeNode_Root ((IPTR)0) +#define MUIV_NListtree_GetNr_TreeNode_Active ((IPTR)-2) + +#define MUIV_NListtree_GetNr_Flag_CountAll (1<<15) +#define MUIV_NListtree_GetNr_Flag_CountLevel (1<<14) +#define MUIV_NListtree_GetNr_Flag_CountList (1<<13) +#define MUIV_NListtree_GetNr_Flag_ListEmpty (1<<12) +#define MUIV_NListtree_GetNr_Flag_Visible (1<<11) + + +#define MUIV_NListtree_Insert_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_Insert_ListNode_Active ((IPTR)-2) +#define MUIV_NListtree_Insert_ListNode_LastInserted ((IPTR)-3) +#define MUIV_NListtree_Insert_ListNode_ActiveFallback ((IPTR)-4) + +#define MUIV_NListtree_Insert_PrevNode_Head ((IPTR)0) +#define MUIV_NListtree_Insert_PrevNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Insert_PrevNode_Active ((IPTR)-2) +#define MUIV_NListtree_Insert_PrevNode_Sorted ((IPTR)-4) + +#define MUIV_NListtree_Insert_Flag_Nr (1<<15) /*i*/ +#define MUIV_NListtree_Insert_Flag_Visible (1<<14) /*i*/ +#define MUIV_NListtree_Insert_Flag_Active (1<<13) +#define MUIV_NListtree_Insert_Flag_NextNode (1<<12) + + +#define MUIV_NListtree_Move_OldListNode_Root ((IPTR)0) +#define MUIV_NListtree_Move_OldListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Move_OldTreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Move_OldTreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Move_OldTreeNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Move_NewListNode_Root ((IPTR)0) +#define MUIV_NListtree_Move_NewListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Move_NewTreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Move_NewTreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Move_NewTreeNode_Active ((IPTR)-2) +#define MUIV_NListtree_Move_NewTreeNode_Sorted ((IPTR)-4) + +#define MUIV_NListtree_Move_Flag_Nr (1<<15) /*i*/ +#define MUIV_NListtree_Move_Flag_Visible (1<<14) /*i*/ +#define MUIV_NListtree_Move_Flag_KeepStructure (1<<13) + + +#define MUIV_NListtree_Open_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_Open_ListNode_Parent ((IPTR)-1) +#define MUIV_NListtree_Open_ListNode_Active ((IPTR)-2) +#define MUIV_NListtree_Open_TreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Open_TreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Open_TreeNode_Active ((IPTR)-2) +#define MUIV_NListtree_Open_TreeNode_All ((IPTR)-3) + +#define MUIV_NListtree_Open_Flag_Nr (1<<15) /*i*/ +#define MUIV_NListtree_Open_Flag_Visible (1<<14) /*i*/ + + +#define MUIV_NListtree_Remove_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_Remove_ListNode_Active ((IPTR)-2) +#define MUIV_NListtree_Remove_TreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Remove_TreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Remove_TreeNode_Active ((IPTR)-2) +#define MUIV_NListtree_Remove_TreeNode_All ((IPTR)-3) +#define MUIV_NListtree_Remove_TreeNode_Selected ((IPTR)-4) + +#define MUIV_NListtree_Remove_Flag_Nr (1<<15) /*i*/ +#define MUIV_NListtree_Remove_Flag_Visible (1<<14) /*i*/ +#define MUIV_NListtree_Remove_Flag_NoActive (1<<13) + + +#define MUIV_NListtree_Clear_TreeNode_Root 0 /*i*/ +#define MUIV_NListtree_Clear_TreeNode_Active -2 /*i*/ + + +#define MUIV_NListtree_Rename_TreeNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Rename_Flag_User (1<<8) +#define MUIV_NListtree_Rename_Flag_NoRefresh (1<<9) + + +#define MUIV_NListtree_Sort_ListNode_Root ((IPTR)0) +#define MUIV_NListtree_Sort_ListNode_Active ((IPTR)-2) +#define MUIV_NListtree_Sort_TreeNode_Active ((IPTR)-3) + +#define MUIV_NListtree_Sort_Flag_Nr (1<<15) /*i*/ +#define MUIV_NListtree_Sort_Flag_Visible (1<<14) /*i*/ +#define MUIV_NListtree_Sort_Flag_RecursiveOpen (1<<13) +#define MUIV_NListtree_Sort_Flag_RecursiveAll (1<<12) + + +#define MUIV_NListtree_TestPos_Result_None 0 +#define MUIV_NListtree_TestPos_Result_Above 1 +#define MUIV_NListtree_TestPos_Result_Below 2 +#define MUIV_NListtree_TestPos_Result_Onto 3 +#define MUIV_NListtree_TestPos_Result_Sorted 4 + +#define MUIV_NListtree_Redraw_Active ((IPTR)-1) +#define MUIV_NListtree_Redraw_All ((IPTR)-2) + +#define MUIV_NListtree_Redraw_Flag_Nr (1<<15) + +#define MUIV_NListtree_Select_Active -1 +#define MUIV_NListtree_Select_All -2 +#define MUIV_NListtree_Select_Visible -3 + +#define MUIV_NListtree_Select_Off 0 +#define MUIV_NListtree_Select_On 1 +#define MUIV_NListtree_Select_Toggle 2 +#define MUIV_NListtree_Select_Ask 3 + +#define MUIV_NListtree_Select_Flag_Force (1<<15) + + +#define MUIV_NListtree_NextSelected_Start ((IPTR)-1) +#define MUIV_NListtree_NextSelected_End ((IPTR)-1) + + +#define MUIV_NListtree_Copy_SourceListNode_Root ((IPTR)0) +#define MUIV_NListtree_Copy_SourceListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Copy_SourceTreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Copy_SourceTreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Copy_SourceTreeNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Copy_DestListNode_Root ((IPTR)0) +#define MUIV_NListtree_Copy_DestListNode_Active ((IPTR)-2) + +#define MUIV_NListtree_Copy_DestTreeNode_Head ((IPTR)0) +#define MUIV_NListtree_Copy_DestTreeNode_Tail ((IPTR)-1) +#define MUIV_NListtree_Copy_DestTreeNode_Active ((IPTR)-2) +#define MUIV_NListtree_Copy_DestTreeNode_Sorted ((IPTR)-4) + +#define MUIV_NListtree_Copy_Flag_Nr (1<<15) /*i*/ +#define MUIV_NListtree_Copy_Flag_Visible (1<<14) /*i*/ +#define MUIV_NListtree_Copy_Flag_KeepStructure (1<<13) + + +#define MUIV_NListtree_InsertStruct_Flag_AllowDuplicates (1<<11) + + +#define MUIV_NListtree_PrevSelected_Start ((IPTR)-1) +#define MUIV_NListtree_PrevSelected_End ((IPTR)-1) + + +#define MUIV_NListtree_CopyToClip_Active ((IPTR)-1) + + +/*i* Private method values ***/ + +#define MUIV_NListtree_Data_MemPool 1 +#define MUIV_NListtree_Data_VersInfo 2 +#define MUIV_NListtree_Data_Sample 3 + + + +/*** Hook message structs ***/ + +struct MUIP_NListtree_CloseMessage +{ + STACKED ULONG HookID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; +}; + + +struct MUIP_NListtree_CompareMessage +{ + STACKED ULONG HookID; + STACKED struct MUI_NListtree_TreeNode *TreeNode1; + STACKED struct MUI_NListtree_TreeNode *TreeNode2; + STACKED LONG SortType; +}; + + +struct MUIP_NListtree_ConstructMessage +{ + STACKED ULONG HookID; + STACKED STRPTR Name; + STACKED APTR UserData; + STACKED APTR MemPool; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_DestructMessage +{ + STACKED ULONG HookID; + STACKED STRPTR Name; + STACKED APTR UserData; + STACKED APTR MemPool; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_DisplayMessage +{ + STACKED ULONG HookID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG EntryPos; + STACKED STRPTR *Array; + STACKED STRPTR *Preparse; +}; + + +struct MUIP_NListtree_CopyToClipMessage +{ + STACKED ULONG HookID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG Pos; + STACKED LONG Unit; +}; + + +struct MUIP_NListtree_FindNameMessage +{ + STACKED ULONG HookID; + STACKED STRPTR Name; + STACKED STRPTR NodeName; + STACKED APTR UserData; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_FindUserDataMessage +{ + STACKED ULONG HookID; + STACKED APTR User; + STACKED APTR UserData; + STACKED STRPTR NodeName; + STACKED ULONG Flags; +}; + + +struct MUIP_NListtree_OpenMessage +{ + STACKED ULONG HookID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; +}; + + +struct MUIP_NListtree_MultiTestMessage +{ + STACKED ULONG HookID; + STACKED struct MUI_NListtree_TreeNode *TreeNode; + STACKED LONG SelType; + STACKED LONG SelFlag; + STACKED LONG CurrType; +}; + +// ClipboardServer.c +BOOL StartClipboardServer(void); +void ShutdownClipboardServer(void); +void StringToClipboard(ULONG unit, STRPTR str); + +#include "default-align.h" + +// special flagging macros +#define isFlagSet(v,f) (((v) & (f)) == (f)) // return TRUE if the flag is set +#define hasFlag(v,f) (((v) & (f)) != 0) // return TRUE if one of the flags in f is set in v +#define isFlagClear(v,f) (((v) & (f)) == 0) // return TRUE if flag f is not set in v +#define SET_FLAG(v,f) ((v) |= (f)) // set the flag f in v +#define CLEAR_FLAG(v,f) ((v) &= ~(f)) // clear the flag f in v +#define MASK_FLAG(v,f) ((v) &= (f)) // mask the variable v with flag f bitwise + +#endif /* NLISTTREE_MCC_PRIVATE_H */ diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/vastubs.c b/workbench/classes/zune/nlist/nlisttree_mcc/vastubs.c new file mode 100755 index 0000000000..8532a7be5c --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/vastubs.c @@ -0,0 +1,51 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if !defined(__AROS__) && (defined(__VBCC__) || defined(NO_INLINE_STDARG)) +#if defined(_M68000) || defined(__M68000) || defined(__mc68000) + +#include <exec/types.h> + +/* FIX V45 breakage... */ +#if INCLUDE_VERSION < 45 +#define MY_CONST_STRPTR CONST_STRPTR +#else +#define MY_CONST_STRPTR CONST STRPTR +#endif + +#include <proto/intuition.h> + +APTR NewObject( struct IClass *classPtr, CONST_STRPTR classID, Tag tag1, ... ) +{ return NewObjectA(classPtr, classID, (struct TagItem *)&tag1); } +ULONG SetAttrs( APTR object, ULONG tag1, ... ) +{ return SetAttrsA(object, (struct TagItem *)&tag1); } +LONG EasyRequest( struct Window *window, CONST struct EasyStruct *easyStruct, ULONG *idcmpPtr, ... ) +{ return EasyRequestArgs(window, easyStruct, idcmpPtr, (const APTR) ((ULONG) &idcmpPtr + sizeof(ULONG *))); } + +#include <proto/dos.h> +struct Process *CreateNewProcTags( ULONG tag1, ... ) +{ return CreateNewProc((struct TagItem *)&tag1); } + +#else + #error "VARGS stubs are only save on m68k systems!" +#endif +#endif diff --git a/workbench/classes/zune/nlist/nlisttree_mcc/version.h b/workbench/classes/zune/nlist/nlisttree_mcc/version.h new file mode 100644 index 0000000000..047c7bee63 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcc/version.h @@ -0,0 +1,80 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2010 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef _VERSION_H_ +#define _VERSION_H_ + +// transforms a define into a string +#define STR(x) STR2(x) +#define STR2(x) #x + +// for setting all necessary version information +#define LIB_VERSION 18 +#define LIB_REVISION 37 +#define LIB_DATE "17.12.2011" +#define LIB_COPYRIGHT "Copyright (C) 2001-2011 NList Open Source Team" + +// set the LIB_REV_STRING +#define LIB_REV_STRING STR(LIB_VERSION) "." STR(LIB_REVISION) + +// identify the system we are compiling for +#if defined(__amigaos4__) + #define SYSTEM "AmigaOS4" + #define SYSTEMSHORT "OS4" +#elif defined(__MORPHOS__) + #define SYSTEM "MorphOS" + #define SYSTEMSHORT "MOS" +#elif defined(__AROS__) + #define SYSTEM "AROS" + #define SYSTEMSHORT SYSTEM +#elif defined(__AMIGA__) + #define SYSTEM "AmigaOS3" + #define SYSTEMSHORT "OS3" +#else + #warning "Unsupported System - check SYSTEM define" + #define SYSTEM "???" + #define SYSTEMSHORT "???" +#endif + +// identify the CPU model +#if defined(__PPC__) || defined(__powerpc__) + #define CPU "PPC" +#elif defined(_M68060) || defined(__M68060) || defined(__mc68060) + #define CPU "m68060" +#elif defined(_M68040) || defined(__M68040) || defined(__mc68040) + #define CPU "m68040" +#elif defined(_M68030) || defined(__M68030) || defined(__mc68030) + #define CPU "m68030" +#elif defined(_M68020) || defined(__M68020) || defined(__mc68020) + #define CPU "m68k" +#elif defined(_M68000) || defined(__M68000) || defined(__mc68000) + #define CPU "m68000" +#elif defined(__i386__) + #define CPU "x86" +#elif defined(__x86_64__) + #define CPU "x86_64" +#else + #warning "Unsupported CPU model - check CPU define" + #define CPU "???" +#endif + +#endif // _VERSION_H_ diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/C_c.sd b/workbench/classes/zune/nlist/nlisttree_mcp/C_c.sd new file mode 100644 index 0000000000..8bc96e3de3 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/C_c.sd @@ -0,0 +1,84 @@ +##stringtype C +##shortstrings +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id: C_c.sd 326 2009-04-19 22:38:26Z damato $ + +***************************************************************************/ + + /* + * If this file is named 'locale.c' it is automatically + * generated by 'FlexCat' from C_c.sd. PLEASE DO NOT EDIT!!! + */ + +#include <proto/locale.h> + +#include <SDI/SDI_compiler.h> +#include "Debug.h" + +struct FC_Type { const long ID; const char * const Str; }; + +const struct FC_Type _%i = { %d, %s }; + +static struct Catalog *NL_Catalog = NULL; + +/*** Catalog functions ***/ +/// tr() +const char *tr(const void *fcstr) +{ + const char *defaultstr = ((struct FC_Type *)fcstr)->Str; + + if(LocaleBase) + return (const char *)GetCatalogStr(NL_Catalog, ((struct FC_Type *)fcstr)->ID, (STRPTR)defaultstr); + + return defaultstr; +} +/// +/// CloseCat() +void CloseCat(void) +{ + ENTER(); + + if(NL_Catalog) + { + CloseCatalog(NL_Catalog); + NL_Catalog = NULL; + } + + LEAVE(); +} +/// +/// OpenCat(void) +BOOL OpenCat(void) +{ + static const struct TagItem tags[] = { + { OC_BuiltInLanguage, (IPTR)%l }, + { OC_Version, %v }, + { TAG_DONE, 0 } + }; + + ENTER(); + + if(LocaleBase && NL_Catalog == NULL) + NL_Catalog = OpenCatalogA(NULL, (STRPTR)"%b.catalog", (struct TagItem *)&tags[0]); + + RETURN((BOOL)(NL_Catalog != NULL)); + return (BOOL)(NL_Catalog != NULL); +} +/// diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/C_h.sd b/workbench/classes/zune/nlist/nlisttree_mcp/C_h.sd new file mode 100644 index 0000000000..6124dd467c --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/C_h.sd @@ -0,0 +1,45 @@ +##stringtype C +##shortstrings +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id: C_h.sd 251 2007-11-03 15:34:52Z damato $ + +***************************************************************************/ + + /* + * If this file is named 'locale.h' it is automatically + * generated by 'FlexCat' from C_h.sd. PLEASE DO NOT EDIT!!! + */ + +#ifndef %b_LOCALE_H +#define %b_LOCALE_H + +// catalog translation functions +extern const char *tr(const void *); +extern BOOL OpenCat(void); +extern void CloseCat(void); + +// const pointers to internal strings +extern const void* const _%i; + +// substiting defines to directly use MSG_XXXXX strings +#define MSG_Space ((const void* const)1) +#define %i ((const void* const)&_%i) + +#endif /* %b_LOCALE_H */ diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/Debug.c b/workbench/classes/zune/nlist/nlisttree_mcp/Debug.c new file mode 100644 index 0000000000..d5daf2d3a3 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/Debug.c @@ -0,0 +1,410 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifdef DEBUG + +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> +#include <stdio.h> + +#include <proto/intuition.h> +#include <proto/utility.h> +#include <proto/dos.h> +#include <proto/exec.h> + +#include "SDI_compiler.h" +#include "Debug.h" +#include "version.h" + +// special flagging macros +#define isFlagSet(v,f) (((v) & (f)) == (f)) // return TRUE if the flag is set +#define hasFlag(v,f) (((v) & (f)) != 0) // return TRUE if one of the flags in f is set in v +#define isFlagClear(v,f) (((v) & (f)) == 0) // return TRUE if flag f is not set in v +#define SET_FLAG(v,f) ((v) |= (f)) // set the flag f in v +#define CLEAR_FLAG(v,f) ((v) &= ~(f)) // clear the flag f in v +#define MASK_FLAG(v,f) ((v) &= (f)) // mask the variable v with flag f bitwise + +// our static variables with default values +static int indent_level = 0; +static BOOL ansi_output = FALSE; +static ULONG debug_flags = DBF_ALWAYS | DBF_STARTUP; // default debug flags +static ULONG debug_classes = DBC_ERROR | DBC_DEBUG | DBC_WARNING | DBC_ASSERT | DBC_REPORT; // default debug classes + +/****************************************************************************/ + +void SetupDebug(void) +{ + char var[256]; + + kprintf("** NListtree.mcp v" LIB_REV_STRING " startup ***********************\n"); + kprintf("Initializing runtime debugging:\n"); + + if(GetVar("nlisttree.mcp.debug", var, sizeof(var), 0) > 0) + { + char *tok; + char *debug = var; + + // static list of our debugging classes tokens. + // in the yamdebug variable these classes always start with a @ + static struct { const char *token; unsigned long flag; } dbclasses[] = + { + { "ctrace", DBC_CTRACE }, + { "report", DBC_REPORT }, + { "assert", DBC_ASSERT }, + { "timeval", DBC_TIMEVAL }, + { "debug", DBC_DEBUG }, + { "error", DBC_ERROR }, + { "warning", DBC_WARNING }, + { "all", DBC_ALL }, + { NULL, 0 } + }; + + static struct { const char *token; unsigned long flag; } dbflags[] = + { + { "always", DBF_ALWAYS }, + { "startup", DBF_STARTUP }, + { "all", DBF_ALL }, + { NULL, 0 } + }; + + // we parse the env variable token-wise + while((tok = strtok(debug, ", ;"))) + { + ULONG i; + + // check if the token is class definition or + // just a flag definition + if(tok[0] == '@') + { + // check if this call is a negation or not + if(tok[1] == '!') + { + // search for the token and clear the flag + for(i=0; dbclasses[i].token; i++) + { + if(stricmp(tok+2, dbclasses[i].token) == 0) + { + kprintf("clear '%s' debug class flag.\n", dbclasses[i].token); + CLEAR_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + else + { + // search for the token and set the flag + for(i=0; dbclasses[i].token; i++) + { + if(stricmp(tok+1, dbclasses[i].token) == 0) + { + kprintf("set '%s' debug class flag\n", dbclasses[i].token); + SET_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + } + else + { + // check if this call is a negation or not + if(tok[0] == '!') + { + for(i=0; dbflags[i].token; i++) + { + if(stricmp(tok+1, dbflags[i].token) == 0) + { + kprintf("clear '%s' debug flag\n", dbflags[i].token); + CLEAR_FLAG(debug_flags, dbflags[i].flag); + } + } + } + else + { + // check if the token was "ansi" and if so enable the ANSI color + // output + if(stricmp(tok, "ansi") == 0) + { + kprintf("ansi output enabled\n"); + ansi_output = TRUE; + } + else + { + for(i=0; dbflags[i].token; i++) + { + if(stricmp(tok, dbflags[i].token) == 0) + { + kprintf("set '%s' debug flag\n", dbflags[i].token); + SET_FLAG(debug_flags, dbflags[i].flag); + } + } + } + } + } + + debug = NULL; + } + } + + kprintf("set debug classes/flags (env:nlisttree.mcp.debug): %08lx/%08lx\n", debug_classes, debug_flags); + kprintf("** Normal processing follows ***************************************\n"); +} + +/****************************************************************************/ + +void CleanupDebug(void) +{ + kprintf("** Cleaned up debugging ********************************************\n"); +} + +/****************************************************************************/ + +// define variables for using ANSI colors in our debugging scheme +#define ANSI_ESC_CLR "\033[0m" +#define ANSI_ESC_BOLD "\033[1m" +#define ANSI_ESC_UNDERLINE "\033[4m" +#define ANSI_ESC_BLINK "\033[5m" +#define ANSI_ESC_REVERSE "\033[7m" +#define ANSI_ESC_INVISIBLE "\033[8m" +#define ANSI_ESC_FG_BLACK "\033[0;30m" +#define ANSI_ESC_FG_RED "\033[0;31m" +#define ANSI_ESC_FG_GREEN "\033[0;32m" +#define ANSI_ESC_FG_BROWN "\033[0;33m" +#define ANSI_ESC_FG_BLUE "\033[0;34m" +#define ANSI_ESC_FG_PURPLE "\033[0;35m" +#define ANSI_ESC_FG_CYAN "\033[0;36m" +#define ANSI_ESC_FG_LGRAY "\033[0;37m" +#define ANSI_ESC_FG_DGRAY "\033[1;30m" +#define ANSI_ESC_FG_LRED "\033[1;31m" +#define ANSI_ESC_FG_LGREEN "\033[1;32m" +#define ANSI_ESC_FG_YELLOW "\033[1;33m" +#define ANSI_ESC_FG_LBLUE "\033[1;34m" +#define ANSI_ESC_FG_LPURPLE "\033[1;35m" +#define ANSI_ESC_FG_LCYAN "\033[1;36m" +#define ANSI_ESC_FG_WHITE "\033[1;37m" +#define ANSI_ESC_BG "\033[0;4" // background esc-squ start with 4x +#define ANSI_ESC_BG_BLACK "\033[0;40m" +#define ANSI_ESC_BG_RED "\033[0;41m" +#define ANSI_ESC_BG_GREEN "\033[0;42m" +#define ANSI_ESC_BG_BROWN "\033[0;43m" +#define ANSI_ESC_BG_BLUE "\033[0;44m" +#define ANSI_ESC_BG_PURPLE "\033[0;45m" +#define ANSI_ESC_BG_CYAN "\033[0;46m" +#define ANSI_ESC_BG_LGRAY "\033[0;47m" + +/****************************************************************************/ + +INLINE void _INDENT(void) +{ + int i; + for(i=0; i < indent_level; i++) + kprintf(" "); +} + +/****************************************************************************/ + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function) +{ + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Entering %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Entering %s\n", file, line, function); + } + + indent_level++; +} + +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function) +{ + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s\n", file, line, function); + } +} + +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result) +{ + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s (result 0x%08lx, %ld)%s\n", ANSI_ESC_FG_BROWN, file, line, function, result, result, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s (result 0x%08lx, %ld)\n", file, line, function, result, result); + } +} + +/****************************************************************************/ + +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + switch(size) + { + case 1: + fmt = "%s:%ld:%s = %ld, 0x%02lx"; + break; + + case 2: + fmt = "%s:%ld:%s = %ld, 0x%04lx"; + break; + + default: + fmt = "%s:%ld:%s = %ld, 0x%08lx"; + break; + } + + _INDENT(); + + if(ansi_output) + kprintf(ANSI_ESC_FG_GREEN); + + kprintf(fmt, file, line, name, value, value); + + if(size == 1 && value < 256) + { + if(value < ' ' || (value >= 127 && value < 160)) + kprintf(", '\\x%02lx'", value); + else + kprintf(", '%lc'", value); + } + + if(ansi_output) + kprintf("%s\n", ANSI_ESC_CLR); + else + kprintf("\n"); + } +} + +/****************************************************************************/ + +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + _INDENT(); + + if(p != NULL) + fmt = "%s:%ld:%s = 0x%08lx\n"; + else + fmt = "%s:%ld:%s = NULL\n"; + + if(ansi_output) + { + kprintf(ANSI_ESC_FG_GREEN); + kprintf(fmt, file, line, name, p); + kprintf(ANSI_ESC_CLR); + } + else + kprintf(fmt, file, line, name, p); + } +} + +/****************************************************************************/ + +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s = 0x%08lx \"%s\"%s\n", ANSI_ESC_FG_GREEN, file, line, name, string, string, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s = 0x%08lx \"%s\"\n", file, line, name, string, string); + } +} + +/****************************************************************************/ + +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s%s\n", ANSI_ESC_FG_GREEN, file, line, msg, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s\n", file, line, msg); + } +} + +/****************************************************************************/ + +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...) +{ + if((isFlagSet(debug_classes, dclass) && isFlagSet(debug_flags, dflags)) || + (isFlagSet(dclass, DBC_ERROR) || isFlagSet(dclass, DBC_WARNING))) + { + va_list args; + static char buf[1024]; + + _INDENT(); + + va_start(args, format); + vsnprintf(buf, 1024, format, args); + va_end(args); + + if(ansi_output) + { + const char *highlight = ANSI_ESC_FG_GREEN; + + switch(dclass) + { + case DBC_CTRACE: highlight = ANSI_ESC_FG_BROWN; break; + case DBC_REPORT: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ASSERT: highlight = ANSI_ESC_FG_RED; break; + case DBC_TIMEVAL: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_DEBUG: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ERROR: highlight = ANSI_ESC_FG_RED; break; + case DBC_WARNING: highlight = ANSI_ESC_FG_PURPLE;break; + } + + kprintf("%s%s:%ld:%s%s\n", highlight, file, line, buf, ANSI_ESC_CLR); + } + else + kprintf("%s:%ld:%s\n", file, line, buf); + } +} + +/****************************************************************************/ + +#endif diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/Debug.h b/workbench/classes/zune/nlist/nlisttree_mcp/Debug.h new file mode 100644 index 0000000000..9b202b02b5 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/Debug.h @@ -0,0 +1,139 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef DEBUG_H +#define DEBUG_H + +// first we make sure all previously defined symbols are undefined now so +// that no other debug system interferes with ours. +#undef ENTER +#undef LEAVE +#undef RETURN +#undef SHOWVALUE +#undef SHOWPOINTER +#undef SHOWSTRING +#undef SHOWMSG +#undef STARTCLOCK +#undef STOPCLOCK +#undef D +#undef E +#undef W +#undef ASSERT + +#if defined(DEBUG) + +#include <assert.h> + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +#if defined(__amigaos4__) + #include <proto/exec.h> + #ifdef __USE_INLINE__ + #ifdef DebugPrintF + #undef DebugPrintF + #endif + #endif + #ifndef kprintf + #define kprintf(format, args...) ((struct ExecIFace *)((*(struct ExecBase **)4)->MainInterface))->DebugPrintF(format, ## args) + #endif +#elif defined(__MORPHOS__) + #include <exec/rawfmt.h> + #include <proto/exec.h> + #define KPutFmt(format, args) VNewRawDoFmt(format, (APTR)RAWFMTFUNC_SERIAL, NULL, args) +void kprintf(const char *formatString,...); +#else +void kprintf(const char *formatString,...); +#endif + +// debug classes +#define DBC_CTRACE (1<<0) // call tracing (ENTER/LEAVE etc.) +#define DBC_REPORT (1<<1) // reports (SHOWVALUE/SHOWSTRING etc.) +#define DBC_ASSERT (1<<2) // asserts (ASSERT) +#define DBC_TIMEVAL (1<<3) // time evaluations (STARTCLOCK/STOPCLOCK) +#define DBC_DEBUG (1<<4) // debugging output D() +#define DBC_ERROR (1<<5) // error output E() +#define DBC_WARNING (1<<6) // warning output W() +#define DBC_ALL 0xffffffff + +// debug flags +#define DBF_ALWAYS (1<<0) +#define DBF_STARTUP (1<<1) // for startup/shutdown events (YAM.c) +#define DBF_ALL 0xffffffff + +void SetupDebug(void); +void CleanupDebug(void); + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function); +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function); +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result); +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line); +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line); +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line); +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line); +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...); + +// Core class information class messages +#define ENTER() _ENTER(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define LEAVE() _LEAVE(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define RETURN(r) _RETURN(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__, (long)r) +#define SHOWVALUE(f, v) _SHOWVALUE(DBC_REPORT, f, (long)v, sizeof(v), #v, __FILE__, __LINE__) +#define SHOWPOINTER(f, p) _SHOWPOINTER(DBC_REPORT, f, p, #p, __FILE__, __LINE__) +#define SHOWSTRING(f, s) _SHOWSTRING(DBC_REPORT, f, s, #s, __FILE__, __LINE__) +#define SHOWMSG(f, m) _SHOWMSG(DBC_REPORT, f, m, __FILE__, __LINE__) +#define D(f, s, vargs...) _DPRINTF(DBC_DEBUG, f, __FILE__, __LINE__, s, ## vargs) +#define E(f, s, vargs...) _DPRINTF(DBC_ERROR, f, __FILE__, __LINE__, s, ## vargs) +#define W(f, s, vargs...) _DPRINTF(DBC_WARNING, f, __FILE__, __LINE__, s, ## vargs) +#define ASSERT(expression) \ + ((void) \ + ((expression) ? 0 : \ + ( \ + _DPRINTF(DBC_ASSERT, \ + DBF_ALWAYS, \ + __FILE__, \ + __LINE__, \ + "failed assertion '%s'", \ + #expression), \ + assert(#expression), \ + 0 \ + ) \ + ) \ + ) + +#else // DEBUG + +#define ENTER() ((void)0) +#define LEAVE() ((void)0) +#define RETURN(r) ((void)0) +#define SHOWVALUE(f, v) ((void)0) +#define SHOWPOINTER(f, p) ((void)0) +#define SHOWSTRING(f, s) ((void)0) +#define SHOWMSG(f, m) ((void)0) +#define D(f, s, vargs...) ((void)0) +#define E(f, s, vargs...) ((void)0) +#define W(f, s, vargs...) ((void)0) +#define ASSERT(expression) ((void)0) + +#endif // DEBUG + +#endif // DEBUG_H diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/Makefile b/workbench/classes/zune/nlist/nlisttree_mcp/Makefile new file mode 100644 index 0000000000..01fbf56547 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/Makefile @@ -0,0 +1,455 @@ +#/*************************************************************************** +# +# NListtree.mcc - New Listtree MUI Custom Class +# Copyright (C) 1999-2001 by Carsten Scholling +# Copyright (C) 2001-2005 by NList Open Source Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# NList classes Support Site: http://www.sf.net/projects/nlist-classes +# +# $Id$ +# +#***************************************************************************/ + +########################################################################### +# This makefile is a very generic one. It tries to identify both, the host +# and the target operating system for which YAM should be compiled. +# However, this auto-detection can be easily overridden by directly +# specifying an option on the commandline while calling 'make'. +# +# Example: +# +# # to explicitly compile for AmigaOS3 +# > make OS=os3 +# +# # to compile for AmigaOS4 but with debugging +# > make OS=os4 DEBUG= +# + +############################################# +# find out the HOST operating system +# on which this makefile is run +HOST ?= $(shell uname) +ifeq ($(HOST), AmigaOS) + ifeq ($(shell uname -m), powerpc) + HOST = AmigaOS4 + endif + ifeq ($(shell uname -m), ppc) + HOST = AmigaOS4 + endif +endif + +# if no host is identifed (no uname tool) +# we assume a AmigaOS build +ifeq ($(HOST),) + HOST = AmigaOS +endif + +############################################# +# now we find out the target OS for +# which we are going to compile YAM in case +# the caller didn't yet define OS himself +ifndef (OS) + ifeq ($(HOST), AmigaOS4) + OS = os4 + else + ifeq ($(HOST), AmigaOS) + OS = os3 + else + ifeq ($(HOST), MorphOS) + OS = mos + else + ifeq ($(HOST), AROS) + # now we find out which CPU system aros will be used + ifeq ($(shell uname -m), powerpc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), ppc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), i386) + OS = aros-i386 + endif + ifeq ($(shell uname -m), i686) + OS = aros-i686 + endif + ifeq ($(shell uname -m), x86_64) + OS = aros-x86_64 + endif + else + OS = os4 + endif + endif + endif + endif +endif + +############################################# +# define common commands we use in this +# makefile. Please note that each of them +# might be overridden on the commandline. + +# common commands +FLEX = flex +FC = flexcat +EXPR = expr +DATE = date +RM = delete force +RMDIR = delete force all +MKDIR = makedir +CHMOD = protect FLAGS=rwed +SED = sed +CP = copy +CC = gcc +STRIP = strip +OBJDUMP = objdump + +# path definitions +CDUP = / +CDTHIS= + +# override some variables for non-native builds (cross-compiler) +ifneq ($(HOST), AmigaOS) +ifneq ($(HOST), AmigaOS4) +ifneq ($(HOST), MorphOS) + + # when we end up here this is either a unix or Aros host + # so lets use unix kind of commands + RM = rm -f + RMDIR = rm -rf + MKDIR = mkdir -p + CHMOD = chmod 755 + CP = cp -f + + CDUP = ../ + CDTHIS= ./ + +endif +endif +endif + +########################################################################### +# CPU and DEBUG can be defined outside, defaults to above +# using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug +# PPC-603e version +# +# OPTFLAGS are disabled by DEBUG normally! +# +# ignored warnings are: +# none - because we want to compile with -Wall all the time + +# Common Directories +PREFIX = $(CDTHIS) +OBJDIR = .obj_$(OS) +BINDIR = bin_$(OS) +LOCALE = locale +VPATH = $(OBJDIR) +DEPFILE = Makefile.dep +DESTDIR = MUI:Libs/MUI + +# target definition +TARGET = $(BINDIR)/NListtree.mcp +TESTTARGET= $(BINDIR)/NListtree-Prefs + +# Common compiler/linker flags +WARN = -W -Wall -Wwrite-strings -Wpointer-arith -Wsign-compare +OPTFLAGS = -O3 -fomit-frame-pointer -funroll-loops +DEBUG = -DDEBUG -O0 +DEBUGSYM = -g -gstabs +CFLAGS = -I. -I../nlisttree_mcp -I../include $(CPU) $(WARN) \ + $(OPTFLAGS) $(DEBUG) $(DEBUGSYM) $(USER_CFLAGS) -c +LDFLAGS = $(CPU) $(DEBUGSYM) +LDLIBS = + +########################################################################### +# object files definition +# + +LOBJS = library.o + +COBJS = locale.o \ + NListtree.o \ + Debug.o \ + icon.o + +TOBJS = NListtree-Prefs.o + +# available catalog translations +CATALOGS = \ + $(LOCALE)/czech.catalog \ + $(LOCALE)/english-british.catalog \ + $(LOCALE)/german.catalog \ + $(LOCALE)/french.catalog \ + $(LOCALE)/polish.catalog \ + $(LOCALE)/swedish.catalog \ + $(LOCALE)/turkish.catalog \ + # $(LOCALE)/russian.catalog + +MCCOBJS = $(addprefix $(OBJDIR)/,$(LOBJS)) $(addprefix $(OBJDIR)/,$(COBJS)) +TESTOBJS = $(addprefix $(OBJDIR)/,$(COBJS)) $(addprefix $(OBJDIR)/,$(TOBJS)) + +# different options per target OS +ifeq ($(OS), os4) + + ############################## + # AmigaOS4 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS4) + CC = ppc-amigaos-gcc + STRIP = ppc-amigaos-strip + OBJDUMP = ppc-amigaos-objdump + endif + + # Compiler/Linker flags + CRT = newlib + CPU = -mcpu=powerpc + WARN += -Wdeclaration-after-statement -Wdisabled-optimization + CFLAGS += -mcrt=$(CRT) -D__USE_INLINE__ -D__NEW_TIMEVAL_DEFINITION_USED__ \ + -DNO_PPCINLINE_STDARG -Wa,-mregnames + LDFLAGS += -mcrt=$(CRT) + + # additional object files required + M68KSTUBS = $(OBJDIR)/mccclass_68k.o + +else +ifeq ($(OS), os3) + + ############################## + # AmigaOS3 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS) + CC = m68k-amigaos-gcc + STRIP = m68k-amigaos-strip + OBJDUMP = m68k-amigaos-objdump + endif + + # Compiler/Linker flags + CPU = -m68020-60 -msoft-float + CFLAGS += -noixemul -DNO_INLINE_STDARG -D__amigaos3__ + LDFLAGS += -noixemul + LDLIBS += -ldebug -lmui + + # additional object files required + COBJS += vastubs.o + +else +ifeq ($(OS), mos) + + ############################## + # MorphOS + + # Compiler/link/strip commands + ifneq ($(HOST), MorphOS) + CC = ppc-morphos-gcc + STRIP = ppc-morphos-strip + OBJDUMP = ppc-morphos-objdump + endif + + # Compiler/Linker flags + CPU = -mcpu=powerpc + CFLAGS += -noixemul -DNO_PPCINLINE_STDARG + LDFLAGS += -noixemul + LDLIBS += -ldebug + +else +ifeq ($(OS), aros-i386) + + ############################## + # AROS (i386) + + ifneq ($(HOST), AROS) + CC = i386-aros-gcc + STRIP = i386-aros-strip + OBJDUMP = i386-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-ppc) + + ############################## + # AROS (PPC) + + ifneq ($(HOST), AROS) + CC = ppc-aros-gcc + STRIP = ppc-aros-strip + OBJDUMP = ppc-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-x86_64) + + ############################## + # AROS (x86_64) + + ifneq ($(HOST), AROS) + CC = x86_64-aros-gcc + STRIP = x86_64-aros-strip + OBJDUMP = x86_64-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +endif +endif +endif +endif +endif +endif + +# main target +.PHONY: all +ifeq ($(wildcard $(DEPFILE)),$(DEPFILE)) +# great, we have a dependecies file, let's make our target +all: $(BINDIR) $(OBJDIR) $(M68KSTUBS) locale.c $(TARGET) $(TESTTARGET) +else +# no dependecies, create it and then call make again +all: depend + @make --no-print-directory all +endif + +# for making a release we compile ALL target with no debug +release: + @echo " CC $<" + make OS=os4 clean + make OS=os4 DEBUG= + @echo " CC $<" + make OS=os3 clean + make OS=os3 DEBUG= + @echo " CC $<" + make OS=mos clean + make OS=mos DEBUG= + @echo " CC $<" + make OS=aros-i386 clean + make OS=aros-i386 DEBUG= + @echo " CC $<" + make OS=aros-ppc clean + make OS=aros-ppc DEBUG= + @echo " CC $<" + make OS=aros-x86_64 clean + make OS=aros-x86_64 DEBUG= + +# make the object directories +$(OBJDIR): + @echo " MK $@" + @$(MKDIR) $(OBJDIR) + +# make the binary directories +$(BINDIR): + @echo " MK $@" + @$(MKDIR) $(BINDIR) + +# for compiling single .c files +$(OBJDIR)/%.o: %.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +$(OBJDIR)/mccclass_68k.o: ../include/mccclass_68k.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +# for linking the target +$(TARGET): $(M68KSTUBS) $(MCCOBJS) + @echo " LD $@.debug" + @$(CC) -nostartfiles $(LDFLAGS) -o $@.debug $(MCCOBJS) $(M68KSTUBS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +# for linking the target +$(TESTTARGET): $(TESTOBJS) + @echo " LD $@.debug" + @$(CC) $(LDFLAGS) -o $@.debug $(TESTOBJS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +locale.h: locale.c +locale.c: $(LOCALE)/NListtree_mcp.cd C_h.sd C_c.sd + @echo " FC $@" + @$(FC) $(LOCALE)/NListtree_mcp.cd locale.h=C_h.sd locale.c=C_c.sd + +## CATALOG GENERATION ################# + +$(LOCALE)/%.catalog: $(LOCALE)/%.ct $(LOCALE)/NListtree_mcp.cd + @echo " FC $@" + @$(FC) $(LOCALE)/NListtree_mcp.cd $< CATALOG $@ + +.IGNORE: $(CATALOGS) + +catalogs: $(CATALOGS) + +.PHONY: dump +dump: + -$(OBJDUMP) --section-headers --all-headers --reloc --disassemble-all $(TARGET) >$(TARGET).dump + +.PHONY: clean +clean: + -$(RM) $(TARGET) $(TARGET).debug $(TARGET).map + -$(RM) $(TESTTARGET) $(TESTTARGET).debug $(TESTTARGET).map + -$(RM) $(MCCOBJS) $(TESTOBJS) $(M68KSTUBS) + +.PHONY: distclean +distclean: clean + -$(RM) locale.? + -$(RM) $(LOCALE)/*.catalog + -$(RMDIR) $(OBJDIR) + -$(RMDIR) $(BINDIR) + +# install +.PHONY: install +install: all + @echo " IN $(TARGET)" + @$(CP) $(TARGET) $(DESTDIR) + +.PHONY: help +help: + @echo "Cleaning targets:" + @echo " clean - Cleanup working directory for clean compile" + @echo " distclean - Also cleanup autogenerated files" + @echo "" + @echo "Other generic targets:" + @echo " all - Build $(TARGET)" + @echo " catalogs - Build all available catalogs" + @echo "" + @echo "Install targets:" + @echo " install - Install $(TARGET) into $(DESTDIR)" + @echo "" + @echo "Parameters:" + @echo " make OS=os3|os4|mos|aros-i386|aros-i686|aros-ppc|aros-x86_64" + @echo " make DEBUG= : build $(TARGET) without debugging information" + @echo "" + +## DEPENDENCY GENERATION ############## + +.PHONY: depend +depend: + @echo " MK $(DEPFILE)" + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >$(DEPFILE) + @$(CC) -MM -MG $(CFLAGS) $(wildcard *.c) >>$(DEPFILE) + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >>$(DEPFILE) + @$(SED) -i 's,^\(.*\)\.o:,$$\(OBJDIR\)/\1.o:,g' $(DEPFILE) + +# include dependencies file +-include $(DEPFILE) diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/Makefile.dep b/workbench/classes/zune/nlist/nlisttree_mcp/Makefile.dep new file mode 100644 index 0000000000..b5fd5c9245 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/Makefile.dep @@ -0,0 +1,25 @@ +# AUTOGENERATED! DO NOT EDIT!!! +$(OBJDIR)/Debug.o: Debug.c ../include/SDI_compiler.h Debug.h version.h +$(OBJDIR)/icon.o: icon.c +$(OBJDIR)/library.o: library.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/amiga-align.h \ + ../nlisttree_mcc/private.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h ../include/mui/NList_mcc.h \ + ../nlisttree_mcc/Debug.h ../include/amiga-align.h \ + ../include/default-align.h ../include/default-align.h Debug.h version.h \ + locale.h icon.h ../include/mui/NBitmap_mcc.h ../include/mccinit.c +$(OBJDIR)/locale.o: locale.c ../include/SDI_compiler.h Debug.h +$(OBJDIR)/NListtree.o: NListtree.c ../include/libraries/mui.h \ + ../include/proto/muimaster.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h ../include/mui/NFloattext_mcc.h \ + ../include/mui/NListview_mcc.h ../include/mui/NList_mcc.h private.h \ + ../include/amiga-align.h ../nlisttree_mcc/private.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h ../nlisttree_mcc/Debug.h \ + ../include/amiga-align.h ../include/default-align.h \ + ../include/default-align.h Debug.h version.h locale.h \ + ../include/muiextra.h +$(OBJDIR)/vastubs.o: vastubs.c +# AUTOGENERATED! DO NOT EDIT!!! diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/NListtree-Prefs.c b/workbench/classes/zune/nlist/nlisttree_mcp/NListtree-Prefs.c new file mode 100644 index 0000000000..a2815d6164 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/NListtree-Prefs.c @@ -0,0 +1,194 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <stdio.h> + +#include <exec/tasks.h> +#include <exec/memory.h> +#include <libraries/mui.h> +#include <proto/dos.h> +#include <proto/exec.h> +#include <proto/locale.h> +#include <proto/muimaster.h> +#include <proto/intuition.h> + +#include "locale.h" +#include "private.h" + +#include "SDI_hook.h" + +#if defined(__amigaos4__) +struct Library *IntuitionBase = NULL; +struct Library *MUIMasterBase = NULL; +struct Library *LocaleBase = NULL; +struct Library *UtilityBase = NULL; +#elif defined(__MORPHOS__) +struct IntuitionBase *IntuitionBase = NULL; +struct Library *MUIMasterBase = NULL; +struct Library *LocaleBase = NULL; +struct Library *UtilityBase = NULL; +#else +struct IntuitionBase *IntuitionBase = NULL; +struct Library *MUIMasterBase = NULL; +struct LocaleBase *LocaleBase = NULL; +struct Library *UtilityBase = NULL; +#endif + +struct Library *CxBase = NULL; +struct Device *ConsoleDevice = NULL; + +#if defined(__amigaos4__) +struct CommoditiesIFace *ICommodities = NULL; +struct ConsoleIFace *IConsole = NULL; +struct IntuitionIFace *IIntuition = NULL; +struct MUIMasterIFace *IMUIMaster = NULL; +struct LocaleIFace *ILocale = NULL; +struct UtilityIFace *IUtility = NULL; +#endif + +struct IOStdReq ioreq; + +extern DISPATCHERPROTO(_DispatcherP); + +int main(void) +{ + ioreq.io_Message.mn_Length = sizeof(ioreq); + if((UtilityBase = OpenLibrary("utility.library", 38)) && + GETINTERFACE(IUtility, UtilityBase)) + if((IntuitionBase = (APTR)OpenLibrary("intuition.library", 38)) && + GETINTERFACE(IIntuition, IntuitionBase)) + if((CxBase = OpenLibrary("commodities.library", 37L)) && + GETINTERFACE(ICommodities, CxBase)) + if(!OpenDevice("console.device", -1L, (struct IORequest *)&ioreq, 0L)) + { + ConsoleDevice = (struct Device *)ioreq.io_Device; + if(ConsoleDevice != NULL && + GETINTERFACE(IConsole, ConsoleDevice)) + if((LocaleBase = (APTR)OpenLibrary("locale.library", 38)) && + GETINTERFACE(ILocale, LocaleBase)) + { + OpenCat(); + + #if defined(DEBUG) + SetupDebug(); + #endif + + if((MUIMasterBase = OpenLibrary(MUIMASTER_NAME, MUIMASTER_VMIN)) && + GETINTERFACE(IMUIMaster, MUIMasterBase)) + { + Object *app = NULL; + Object *window = NULL; + struct MUI_CustomClass *mcc = NULL; + + mcc = MUI_CreateCustomClass(NULL, (STRPTR)"Group.mui", NULL, sizeof(struct NListtreeP_Data), ENTRY(_DispatcherP)); + if(mcc) + { + app = MUI_NewObject("Application.mui", + MUIA_Application_Author, "NList Open Source Team", + MUIA_Application_Base, "NListtree-Prefs", + MUIA_Application_Copyright, "(c) 2001-2011 NList Open Source Team", + MUIA_Application_Description, "Preference for NListtree classes", + MUIA_Application_Title, "NListtree-Prefs", + MUIA_Application_Version, "$VER: NListtree-Prefs V1.0 (05.07.2011)", + + MUIA_Application_Window, + window = MUI_NewObject("Window.mui", + MUIA_Window_Title, "NListtree-Prefs", + MUIA_Window_RootObject, + MUI_NewObject("Group.mui", + MUIA_Background, MUII_PageBack, + MUIA_Frame, MUIV_Frame_Text, + MUIA_InnerBottom, 11, + MUIA_InnerLeft, 6, + MUIA_InnerRight, 6, + MUIA_InnerTop, 11, + +// Child, RectangleObject, End, + Child, NewObject(mcc->mcc_Class, NULL, TAG_DONE), + + TAG_DONE ), + TAG_DONE ), + TAG_DONE ); + } + + if(app) + { + unsigned long sigs; + + DoMethod(window, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit); + set(window, MUIA_Window_Open, TRUE); + + while((LONG)DoMethod(app, MUIM_Application_NewInput, &sigs) != (LONG)MUIV_Application_ReturnID_Quit) + { + if(sigs) + { + sigs = Wait(sigs | SIGBREAKF_CTRL_C); + if(sigs & SIGBREAKF_CTRL_C) + break; + } + } + + MUI_DisposeObject(app); + + if(mcc) + MUI_DeleteCustomClass(mcc); + } + + DROPINTERFACE(IMUIMaster); + CloseLibrary(MUIMasterBase); + } + + CloseCat(); + + DROPINTERFACE(ILocale); + CloseLibrary((struct Library *)LocaleBase); + } + + if(ConsoleDevice) + { + DROPINTERFACE(IConsole); + CloseDevice((struct IORequest *)&ioreq); + ConsoleDevice = NULL; + } + } + + if(CxBase) + { + DROPINTERFACE(ICommodities); + CloseLibrary(CxBase); + CxBase = NULL; + } + + if(IntuitionBase) + { + DROPINTERFACE(IIntuition); + CloseLibrary((struct Library *)IntuitionBase); + } + + if(UtilityBase) + { + DROPINTERFACE(IUtility); + CloseLibrary(UtilityBase); + } + + return 0; +} diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/NListtree.c b/workbench/classes/zune/nlist/nlisttree_mcp/NListtree.c new file mode 100644 index 0000000000..5a583ad5d8 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/NListtree.c @@ -0,0 +1,1017 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if defined(__AROS__) +#define MUI_OBSOLETE 1 +#endif + +/* +** Includes +*/ +#include <stdlib.h> +#include <string.h> +#include <stdio.h> + +#include <libraries/mui.h> +#include <utility/hooks.h> +#include <clib/alib_protos.h> +#include <proto/muimaster.h> +#include <proto/intuition.h> +#include <proto/locale.h> +#include <proto/exec.h> + +#include <mui/NFloattext_mcc.h> +#include <mui/NListview_mcc.h> +#include <mui/NList_mcc.h> + +#include "private.h" +#include "version.h" + +#include "locale.h" + +#include "muiextra.h" + +// some undocumented MUI tags we are going to use +#ifndef MUIA_Imagedisplay_UseDefSize +#define MUIA_Imagedisplay_UseDefSize 0x8042186dUL /* V11 i.. BOOL */ +#endif +#ifndef MUIA_Slider_Level +#define MUIA_Slider_Level 0x8042ae3aUL /* V4 isg LONG */ +#endif +#ifndef MUIA_Slider_Min +#define MUIA_Slider_Min 0x8042e404UL /* V4 isg LONG */ +#endif +#ifndef MUIA_Slider_Max +#define MUIA_Slider_Max 0x8042d78aUL /* V4 isg LONG */ +#endif + +struct SampleArray +{ + const char *name; + UWORD flags; +}; + +/* +** Sample +*/ +static const struct SampleArray sa[] = +{ + { "root1", 0 }, + + { "comp", TNF_LIST | TNF_OPEN }, + { "sys", TNF_LIST | TNF_OPEN }, + { "amiga", TNF_LIST | TNF_OPEN }, + { "misc", 0x8000 }, + { "mac", TNF_LIST }, + { "system", 0x8000 }, + + { "root2", 0 }, + + { "de", TNF_LIST | TNF_OPEN }, + { "comm", TNF_LIST }, + { "software", TNF_LIST }, + { "ums", 0x8000 }, + { "comp", TNF_LIST | TNF_OPEN }, + { "sys", TNF_LIST | TNF_OPEN }, + { "amiga", TNF_LIST }, + { "misc", 0x8000 }, + { "tech", 0x8000 }, + { "amiga", 0x8000 }, + + { "m", TNF_LIST }, + { "i", TNF_LIST }, + { "c", TNF_LIST }, + { "h", TNF_LIST }, + { "e", TNF_LIST }, + { "l", TNF_LIST }, + { "a", TNF_LIST }, + { "n", TNF_LIST }, + { "g", TNF_LIST }, + { "e", TNF_LIST }, + { "l", TNF_LIST }, + { "o", 0 }, + + { "end", TNF_LIST }, + { "of", TNF_LIST }, + { "tree", 0 }, + + { NULL, 0 } +}; + +/*****************************************************************************\ +******************************************************************************* +** +** Helpful object related functions. +** +******************************************************************************* +\*****************************************************************************/ + +static VOID DrawSampleTree( Object *ltobj ) +{ + struct MUI_NListtree_TreeNode *tn1, *tn2, *tn3; + WORD i = 0; + + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn3 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn3, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn2 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn3 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn3 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn2, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn3 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], MUIV_NListtree_Insert_ListNode_Root, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; + tn1 = (struct MUI_NListtree_TreeNode *)DoMethod( ltobj, MUIM_NListtree_Insert, sa[i].name, &sa[i], tn1, MUIV_NListtree_Insert_PrevNode_Tail, sa[i].flags ); i++; +} + + +STATIC VOID TransferValues(struct NListtreeP_Data *data) +{ + nnset(data->NLT_Sample, MUIA_NListtree_Quiet, TRUE); + + SetAttrs(data->NLT_Sample, MUICFG_NListtree_ImageSpecClosed, xget(data->PI_ImageClosed, MUIA_Imagedisplay_Spec), + MUICFG_NListtree_ImageSpecOpen, xget(data->PI_ImageOpen, MUIA_Imagedisplay_Spec), + MUICFG_NListtree_ImageSpecFolder, xget(data->PI_ImageFolder, MUIA_Imagedisplay_Spec), + MUICFG_NListtree_PenSpecLines, xget(data->PP_LinePen, MUIA_Pendisplay_Spec), + MUICFG_NListtree_PenSpecShadow, xget(data->PP_ShadowPen, MUIA_Pendisplay_Spec), + MUICFG_NListtree_PenSpecGlow, xget(data->PP_GlowPen, MUIA_Pendisplay_Spec), + MUICFG_NListtree_RememberStatus, xget(data->CH_RememberStatus, MUIA_Selected), + MUICFG_NListtree_IndentWidth, xget(data->SL_IndentWidth, MUIA_Slider_Level), + MUICFG_NListtree_OpenAutoScroll, xget(data->CH_OpenAutoScroll, MUIA_Selected), + MUICFG_NListtree_LineType, xget(data->CY_LineType, MUIA_Cycle_Active), + MUICFG_NListtree_UseFolderImage, xget(data->CH_UseFolderImage, MUIA_Selected), + TAG_DONE); + + nnset(data->NLT_Sample, MUIA_NListtree_Quiet, FALSE); + + return; +} + + + +/*****************************************************************************\ +******************************************************************************* +** +** Standard class related functions. +** +******************************************************************************* +\*****************************************************************************/ + +HOOKPROTONHNO(dspfunc, LONG, struct MUIP_NListtree_DisplayMessage *msg) +{ + static const char *t1 = "\033bNewsgroups"; + static const char *t2 = "\033bFlags"; + static const char *t3 = "subscribed"; + static const char *t4 = "\0"; + static const char *t5 = "\033bCnt"; + static char buf[10]; + + if ( msg->TreeNode != NULL ) + { + /* + ** The user data is a pointer to a SampleArray struct. + */ + struct SampleArray *a = (struct SampleArray *)msg->TreeNode->tn_User; + + snprintf(buf, sizeof(buf), "%3ld", (unsigned long)msg->Array[-1]); + + *msg->Array++ = (STRPTR)a->name; + *msg->Array++ = (STRPTR)((a->flags & 0x8000) ? t3 : t4); + *msg->Array++ = buf; + } + else + { + *msg->Array++ = (STRPTR)t1; + *msg->Array++ = (STRPTR)t2; + *msg->Array++ = (STRPTR)t5; + } + + return( 0 ); +} +MakeStaticHook(dsphook, dspfunc); + +static VOID ValuesChanged(struct NListtreeP_Data *data) +{ + nnset(data->PP_LinePen, MUIA_Disabled, xget(data->CY_LineType, MUIA_Cycle_Active) == MUICFGV_NListtree_LineType_Disabled); + nnset(data->PP_ShadowPen, MUIA_Disabled, xget(data->CY_LineType, MUIA_Cycle_Active) != MUICFGV_NListtree_LineType_Shadow && xget(data->CY_LineType, MUIA_Cycle_Active) != MUICFGV_NListtree_LineType_Glow); + nnset(data->PP_GlowPen, MUIA_Disabled, xget(data->CY_LineType, MUIA_Cycle_Active) != MUICFGV_NListtree_LineType_Glow); + + nnset(data->PI_ImageFolder, MUIA_Disabled, xget(data->CH_UseFolderImage, MUIA_Selected) == FALSE); + + return; +} + +HOOKPROTONHNO(ValuesChangedFunc, VOID, IPTR *para) +{ + ValuesChanged((struct NListtreeP_Data *)para[0]); +} +MakeStaticHook(ValuesChangedHook, ValuesChangedFunc); + +static IPTR _NewP( struct IClass *cl, Object *obj, Msg msg ) +{ + struct NListtreeP_Data *data; + static const char *CY_LineTypes_Entries[6]; + static const char infotext[] = "\033bNListtree.mcp " LIB_REV_STRING "\033n (" LIB_DATE ")\n" + "Copyright (c) 1999-2001 Carsten Scholling\n" + LIB_COPYRIGHT "\n\n" + "Distributed under the terms of the LGPL2.\n\n" + "For the latest version, check out:\n" + "http://www.sf.net/projects/nlist-classes/\n\n"; + + static unsigned char msg_closed_key; + static unsigned char msg_open_key; + static unsigned char msg_lines_key; + static unsigned char msg_shadow_key; + static unsigned char msg_glow_key; + static unsigned char msg_linetypes_key; + static unsigned char msg_indentwidth_key; + static unsigned char msg_remember_status_key; + static unsigned char msg_open_autoscroll_key; + static unsigned char msg_bt_expand_key; + static unsigned char msg_bt_collapse_key; + static unsigned char msg_folder_key; + static unsigned char msg_folderimage_key; + + ENTER(); + + if( !( obj = (Object *)DoSuperMethodA( cl, obj, msg ) ) ) + { + RETURN(0); + return( 0 ); + } + + /* + ** Init data. + */ + data = INST_DATA( cl, obj ); + + CY_LineTypes_Entries[0] = tr(MSG_LINETYPE_DISABLED); + CY_LineTypes_Entries[1] = tr(MSG_LINETYPE_NORMAL); + CY_LineTypes_Entries[2] = tr(MSG_LINETYPE_DOTTED); + CY_LineTypes_Entries[3] = tr(MSG_LINETYPE_SHADOW); + CY_LineTypes_Entries[4] = tr(MSG_LINETYPE_GLOW); + CY_LineTypes_Entries[5] = NULL; + + msg_closed_key = tr(MSG_BUTTON_SHORTCUT_CLOSED)[0]; + msg_open_key = tr(MSG_BUTTON_SHORTCUT_OPEN)[0]; + msg_lines_key = tr(MSG_BUTTON_SHORTCUT_LINES)[0]; + msg_shadow_key = tr(MSG_BUTTON_SHORTCUT_SHADOW)[0]; + msg_glow_key = tr(MSG_BUTTON_SHORTCUT_GLOW)[0]; + msg_linetypes_key = tr(MSG_BUTTON_SHORTCUT_LINETYPES)[0]; + msg_indentwidth_key = tr(MSG_BUTTON_SHORTCUT_INDENTWIDTH)[0]; + msg_remember_status_key = tr(MSG_BUTTON_SHORTCUT_REMEMBER)[0]; + msg_open_autoscroll_key = tr(MSG_BUTTON_SHORTCUT_AUTOSCROLL)[0]; + msg_bt_expand_key = tr(MSG_BUTTON_SHORTCUT_EXPAND)[0]; + msg_bt_collapse_key = tr(MSG_BUTTON_SHORTCUT_COLLAPSE)[0]; + msg_folder_key = tr(MSG_BUTTON_SHORTCUT_FOLDER)[0]; + msg_folderimage_key = tr(MSG_BUTTON_SHORTCUT_FOLDERIMAGE)[0]; + + /* + ** Preferences group. + */ + data->GR_Prefs = VGroup, + MUIA_Group_VertSpacing, 5, + + Child, HGroup, + + /* + ** Images and Lines + */ + Child, VGroup, + + Child, HGroup, GroupFrameT(tr(MSG_GROUP_IMAGES_COLORS)), + MUIA_HorizWeight, 1, + + Child, VGroup, + + Child, FreeKeyCLabel(tr(MSG_BUTTON_LABEL_CLOSED), msg_closed_key), + Child, data->PI_ImageClosed = PopimageObject, + MUIA_Imagedisplay_UseDefSize, TRUE, + MUIA_Imageadjust_Type, MUIV_Imageadjust_Type_Image, + MUIA_ControlChar, msg_closed_key, + MUIA_CycleChain, TRUE, + MUIA_Draggable, TRUE, + MUIA_Window_Title, tr(MSG_WIN_TITLE_CLOSED_IMAGE), + MUIA_ShortHelp, tr(MSG_HELP_CLOSED_IMAGE), + End, + + + Child, FreeKeyCLabel(tr(MSG_BUTTON_LABEL_OPEN), msg_open_key), + Child, data->PI_ImageOpen = PopimageObject, + MUIA_Imagedisplay_UseDefSize, TRUE, + MUIA_Imageadjust_Type, MUIV_Imageadjust_Type_Image, + MUIA_ControlChar, msg_open_key, + MUIA_CycleChain, TRUE, + MUIA_Draggable, TRUE, + MUIA_Window_Title, tr(MSG_WIN_TITLE_OPEN_IMAGE), + MUIA_ShortHelp, tr(MSG_HELP_OPEN_IMAGE), + End, + + Child, FreeKeyCLabel(tr(MSG_BUTTON_LABEL_FOLDER), msg_folder_key), + Child, data->PI_ImageFolder = PopimageObject, + MUIA_Imagedisplay_UseDefSize, TRUE, + MUIA_Imageadjust_Type, MUIV_Imageadjust_Type_Image, + MUIA_ControlChar, msg_folder_key, + MUIA_CycleChain, TRUE, + MUIA_Draggable, TRUE, + MUIA_Disabled, MUICFGV_NListtree_UseFolderImage_Default == FALSE, + MUIA_Window_Title, tr(MSG_WIN_TITLE_FOLDER_IMAGE), + MUIA_ShortHelp, tr(MSG_HELP_FOLDER_IMAGE), + End, + + End, + + + Child, VGroup, + + Child, FreeKeyCLabel(tr(MSG_BUTTON_LABEL_LINES), msg_lines_key), + Child, data->PP_LinePen = PoppenObject, + MUIA_Disabled, MUICFGV_NListtree_LineType_Default == MUICFGV_NListtree_LineType_Disabled, + MUIA_ControlChar, msg_lines_key, + MUIA_CycleChain, TRUE, + MUIA_Window_Title, tr(MSG_WIN_TITLE_LINES_COLOR), + MUIA_ShortHelp, tr(MSG_HELP_LINES_COLOR), + End, + + Child, FreeKeyCLabel(tr(MSG_BUTTON_LABEL_SHADOW), msg_shadow_key), + Child, data->PP_ShadowPen = PoppenObject, + MUIA_Disabled, MUICFGV_NListtree_LineType_Default != MUICFGV_NListtree_LineType_Shadow, + MUIA_ControlChar, msg_shadow_key, + MUIA_CycleChain, TRUE, + MUIA_Window_Title, tr(MSG_WIN_TITLE_SHADOW_COLOR), + MUIA_ShortHelp, tr(MSG_HELP_SHADOW_COLOR), + End, + + Child, FreeKeyCLabel(tr(MSG_BUTTON_LABEL_GLOW), msg_glow_key), + Child, data->PP_GlowPen = MUI_NewObject( MUIC_Poppen, + MUIA_Disabled, MUICFGV_NListtree_LineType_Default != MUICFGV_NListtree_LineType_Glow, + MUIA_ControlChar, msg_glow_key, + MUIA_CycleChain, TRUE, + MUIA_Window_Title, tr(MSG_WIN_TITLE_GLOW_COLOR), + MUIA_ShortHelp, tr(MSG_HELP_GLOW_COLOR), + End, + + End, + + End, + + Child, HGroup, GroupFrameT(tr(MSG_GROUP_STYLE)), + + Child, ColGroup( 2 ), + + Child, KeyLabel(tr(MSG_BUTTON_LABEL_LINETYPES), msg_linetypes_key), + Child, data->CY_LineType = CycleObject, + MUIA_Cycle_Entries, CY_LineTypes_Entries, + MUIA_Cycle_Active, MUICFGV_NListtree_LineType_Default, + MUIA_CycleChain, TRUE, + MUIA_ControlChar, msg_linetypes_key, + MUIA_ShortHelp, tr(MSG_HELP_LINETYPES), + End, + + Child, KeyLabel(tr(MSG_BUTTON_LABEL_FOLDERIMAGE), msg_folderimage_key), + Child, HGroup, + Child, data->CH_UseFolderImage = ImageObject, + ImageButtonFrame, + MUIA_Image_Spec, MUII_CheckMark, + MUIA_InputMode, MUIV_InputMode_Toggle, + MUIA_Selected, MUICFGV_NListtree_UseFolderImage_Default, + MUIA_ShowSelState, FALSE, + MUIA_ControlChar, msg_folderimage_key, + MUIA_Background, MUII_ButtonBack, + MUIA_CycleChain, TRUE, + MUIA_ShortHelp, tr(MSG_HELP_FOLDERIMAGE), + End, + Child, HVSpace, + End, + + Child, KeyLabel(tr(MSG_BUTTON_LABEL_INDENTWIDTH), msg_indentwidth_key), + Child, data->SL_IndentWidth = SliderObject, + MUIA_Group_Horiz, TRUE, + MUIA_Slider_Min, 0, + MUIA_Slider_Max, 16, + MUIA_Slider_Level, MUICFGV_NListtree_IndentWidth_Default, + MUIA_Numeric_Format, "%ldpx", + MUIA_CycleChain, TRUE, + MUIA_ControlChar, msg_indentwidth_key, + MUIA_ShortHelp, tr(MSG_HELP_INDENTWIDTH), + End, + + Child, KeyLabel(tr(MSG_BUTTON_LABEL_REMEMBER), msg_remember_status_key), + Child, HGroup, + Child, data->CH_RememberStatus = ImageObject, + ImageButtonFrame, + MUIA_Image_Spec, MUII_CheckMark, + MUIA_InputMode, MUIV_InputMode_Toggle, + MUIA_Selected, MUICFGV_NListtree_RememberStatus_Default, + MUIA_ShowSelState, FALSE, + MUIA_ControlChar, msg_remember_status_key, + MUIA_Background, MUII_ButtonBack, + MUIA_CycleChain, TRUE, + MUIA_ShortHelp, tr(MSG_HELP_REMEMBER), + End, + Child, HVSpace, + End, + + Child, KeyLabel(tr(MSG_BUTTON_LABEL_AUTOSCROLL), msg_open_autoscroll_key), + Child, HGroup, + Child, data->CH_OpenAutoScroll = ImageObject, + ImageButtonFrame, + MUIA_Image_Spec, MUII_CheckMark, + MUIA_InputMode, MUIV_InputMode_Toggle, + MUIA_Selected, MUICFGV_NListtree_OpenAutoScroll_Default, + MUIA_ShowSelState, FALSE, + MUIA_ControlChar, msg_open_autoscroll_key, + MUIA_Background, MUII_ButtonBack, + MUIA_CycleChain, TRUE, + MUIA_ShortHelp, tr(MSG_HELP_AUTOSCROLL), + End, + Child, HVSpace, + End, + + End, + + End, + + End, + + + /* + ** Example + */ + Child, VGroup, GroupFrameT(tr(MSG_TAB_EXAMPLE)), + MUIA_HorizWeight, 99, + + Child, NListviewObject, + MUIA_ShortHelp, tr(MSG_HELP_LISTVIEW_EXAMPLE), + MUIA_NListview_NList, data->NLT_Sample = NListtreeObject, + MUIA_Frame, MUIV_Frame_InputList, + MUIA_CycleChain, TRUE, + MUIA_NListtree_IsMCP, TRUE, + MUIA_NListtree_DisplayHook, &dsphook, + MUIA_NListtree_CompareHook, MUIV_NListtree_CompareHook_LeavesTop, + MUIA_NListtree_DoubleClick, MUIV_NListtree_DoubleClick_All, + MUIA_NListtree_EmptyNodes, FALSE, + MUIA_NListtree_TreeColumn, 0, + MUIA_NListtree_Title, TRUE, + MUIA_NListtree_Format, ",", + End, + End, + + Child, HGroup, + Child, data->BT_Sample_Expand = KeyButton(tr(MSG_BUTTON_LABEL_EXPAND), msg_bt_expand_key), + Child, data->BT_Sample_Collapse = KeyButton(tr(MSG_BUTTON_LABEL_COLLAPSE), msg_bt_collapse_key), + End, + + End, + + End, + + Child, CrawlingObject, + TextFrame, + MUIA_FixHeightTxt, "\n\n", + MUIA_Background, "m1", + + Child, TextObject, + MUIA_Text_PreParse, "\033c", + MUIA_Text_Contents, infotext, + End, + + Child, TextObject, + MUIA_Text_PreParse, "\033c", + MUIA_Text_Contents, infotext, + End, + End, + + End; + + if ( data->GR_Prefs == NULL ) + { + CoerceMethod( cl, obj, OM_DISPOSE ); + return( 0 ); + } + + DrawSampleTree( data->NLT_Sample ); + + DoMethod( obj, OM_ADDMEMBER, data->GR_Prefs ); + + + /* + ** Open/close all nodes + */ + + DoMethod( data->BT_Sample_Expand, MUIM_Notify, MUIA_Pressed, FALSE, + data->NLT_Sample, 4, MUIM_NListtree_Open, MUIV_NListtree_Open_ListNode_Root, MUIV_NListtree_Open_TreeNode_All, 0 ); + + DoMethod( data->BT_Sample_Collapse, MUIM_Notify, MUIA_Pressed, FALSE, + data->NLT_Sample, 4, MUIM_NListtree_Close, MUIV_NListtree_Close_ListNode_Root, MUIV_NListtree_Close_TreeNode_All, 0 ); + + /* + ** Open/closed node and special images + */ + DoMethod( data->PI_ImageClosed, MUIM_Notify, MUIA_Imagedisplay_Spec, MUIV_EveryTime, + data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_ImageSpecClosed, MUIV_TriggerValue ); + + DoMethod( data->PI_ImageOpen, MUIM_Notify, MUIA_Imagedisplay_Spec, MUIV_EveryTime, + data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_ImageSpecOpen, MUIV_TriggerValue ); + + DoMethod( data->PI_ImageFolder, MUIM_Notify, MUIA_Imagedisplay_Spec, MUIV_EveryTime, + data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_ImageSpecFolder, MUIV_TriggerValue ); + + /* + ** Colors + */ + + DoMethod( data->PP_LinePen, MUIM_Notify, MUIA_Pendisplay_Spec, MUIV_EveryTime, + data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_PenSpecLines, MUIV_TriggerValue ); + + DoMethod( data->PP_ShadowPen, MUIM_Notify, MUIA_Pendisplay_Spec, MUIV_EveryTime, + data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_PenSpecShadow, MUIV_TriggerValue ); + + DoMethod( data->PP_GlowPen, MUIM_Notify, MUIA_Pendisplay_Spec, MUIV_EveryTime, + data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_PenSpecGlow, MUIV_TriggerValue ); + + /* + ** Values + */ + DoMethod( data->CH_RememberStatus, MUIM_Notify, MUIA_Selected, MUIV_EveryTime, + data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_RememberStatus, MUIV_TriggerValue ); + + DoMethod( data->SL_IndentWidth, MUIM_Notify, MUIA_Slider_Level, MUIV_EveryTime, + data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_IndentWidth, MUIV_TriggerValue ); + + DoMethod( data->CH_OpenAutoScroll, MUIM_Notify, MUIA_Selected, MUIV_EveryTime, + data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_OpenAutoScroll, MUIV_TriggerValue ); + + DoMethod( data->CY_LineType, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, + data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_LineType, MUIV_TriggerValue ); + + DoMethod( data->CH_UseFolderImage, MUIM_Notify, MUIA_Selected, MUIV_EveryTime, + data->NLT_Sample, 3, MUIM_Set, MUICFG_NListtree_UseFolderImage, MUIV_TriggerValue ); + + // connect some values to the changedhook so that disabled status things + // get updated + DoMethod(data->CH_UseFolderImage, MUIM_Notify, MUIA_Selected, MUIV_EveryTime, + data->NLT_Sample, 4, MUIM_CallHook, &ValuesChangedHook, data); + DoMethod( data->CY_LineType, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime, + data->NLT_Sample, 4, MUIM_CallHook, &ValuesChangedHook, data); + + // in case we are running for a newer MUI version we can register + // our mcc gadgets accordingly + if(MUIMasterBase->lib_Version >= 20) + { + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->PI_ImageClosed, MUICFG_NListtree_ImageSpecClosed, 1, ""); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->PI_ImageOpen, MUICFG_NListtree_ImageSpecOpen, 1, ""); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->PI_ImageFolder, MUICFG_NListtree_ImageSpecFolder, 1, ""); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->PP_LinePen, MUICFG_NListtree_PenSpecLines, 1, ""); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->PP_ShadowPen, MUICFG_NListtree_PenSpecShadow, 1, ""); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->PP_GlowPen, MUICFG_NListtree_PenSpecGlow, 1, ""); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->CH_RememberStatus,MUICFG_NListtree_RememberStatus, 1, ""); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->SL_IndentWidth, MUICFG_NListtree_IndentWidth, 1, ""); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->CH_OpenAutoScroll,MUICFG_NListtree_OpenAutoScroll, 1, ""); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->CY_LineType, MUICFG_NListtree_LineType, 1, ""); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->CH_UseFolderImage,MUICFG_NListtree_UseFolderImage, 1, ""); + } + + return((IPTR)obj); +} + + +static IPTR _DisposeP( struct IClass *cl, Object *obj, Msg msg ) +{ + struct NListtreeP_Data *data = INST_DATA( cl, obj ); + ULONG result; + + ENTER(); + + DoMethod( obj, OM_REMMEMBER, data->GR_Prefs ); + + if ( data->GR_Prefs ) + MUI_DisposeObject( data->GR_Prefs ); + + result = DoSuperMethodA( cl, obj, msg ); + + RETURN(result); + return result; +} + + +static IPTR _SetupP( struct IClass *cl, Object *obj, struct MUIP_Setup *msg ) +{ + struct NListtreeP_Data *data = INST_DATA( cl, obj ); + + ENTER(); + + if(!DoSuperMethodA(cl, obj, (Msg)msg)) + { + RETURN(FALSE); + return( FALSE ); + } + + /* + ** Values + ** We set the values here directly to the NL, because + ** notification is only done, if values != old values. + */ + TransferValues( data ); + + RETURN(TRUE); + return( TRUE ); +} + +static IPTR _ConfigToGadgets( struct IClass *cl, Object *obj, struct MUIP_Settingsgroup_ConfigToGadgets *msg ) +{ + struct NListtreeP_Data *data = INST_DATA(cl, obj); + Object *pdobj, *idobj; + struct MUI_ImageSpec *is; + struct MUI_PenSpec *pen = NULL; + IPTR d; + + ENTER(); + + /* + ** Create objects + */ + pdobj = MUI_NewObject( MUIC_Pendisplay, TAG_DONE ); + idobj = MUI_NewObject( MUIC_Imagedisplay, TAG_DONE ); + + D(DBF_ALWAYS, "pdobj: 0x%08lx, idobj: 0x%08lx", pdobj, idobj); + + + /* + ** Set images + */ + if((is = (struct MUI_ImageSpec *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_ImageSpecClosed))) + { + set( data->PI_ImageClosed, MUIA_Imagedisplay_Spec, is ); + + D(DBF_ALWAYS, "Closed node image: '%s'", (STRPTR)is); + } + else + { + if ( idobj ) + { + DoMethod( idobj, MUIM_Set, MUIA_Imagedisplay_Spec, MUICFGV_NListtree_ImageSpecClosed_Default ); + + get( idobj, MUIA_Imagedisplay_Spec, &is ); + set( data->PI_ImageClosed, MUIA_Imagedisplay_Spec, is ); + + D(DBF_ALWAYS, "Closed node image: '%s'", (STRPTR)is); + } + } + + + if((is = (struct MUI_ImageSpec *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_ImageSpecOpen))) + { + set( data->PI_ImageOpen, MUIA_Imagedisplay_Spec, is ); + + D(DBF_ALWAYS, "Open node image: '%s'", (STRPTR)is); + } + else + { + if ( idobj ) + { + DoMethod( idobj, MUIM_Set, MUIA_Imagedisplay_Spec, MUICFGV_NListtree_ImageSpecOpen_Default ); + + get( idobj, MUIA_Imagedisplay_Spec, &is ); + set( data->PI_ImageOpen, MUIA_Imagedisplay_Spec, is ); + + D(DBF_ALWAYS, "Open node image: '%s'", (STRPTR)is); + } + } + + + if((is = (struct MUI_ImageSpec *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_ImageSpecFolder))) + { + set( data->PI_ImageFolder, MUIA_Imagedisplay_Spec, is ); + + D(DBF_ALWAYS, "folder node image: '%s'", (STRPTR)is); + } + else + { + if ( idobj ) + { + DoMethod( idobj, MUIM_Set, MUIA_Imagedisplay_Spec, MUICFGV_NListtree_ImageSpecFolder_Default ); + + get( idobj, MUIA_Imagedisplay_Spec, &is ); + set( data->PI_ImageFolder, MUIA_Imagedisplay_Spec, is ); + + D(DBF_ALWAYS, "folder node image: '%s'", (STRPTR)is); + } + } + + + /* + ** Set colors + */ + if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_PenSpecLines))) + { + set( data->PP_LinePen, MUIA_Pendisplay_Spec, d ); + + D(DBF_ALWAYS, "Line color: '%s'", (STRPTR)d); + } + else + { + if( pdobj ) + { + DoMethod( pdobj, MUIM_Pendisplay_SetMUIPen, MUICFGV_NListtree_PenSpecLines_Default ); + + get( pdobj, MUIA_Pendisplay_Spec, &pen ); + set( data->PP_LinePen, MUIA_Pendisplay_Spec, pen ); + + D(DBF_ALWAYS, "Line color: '%s'", pen); + } + } + + if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_PenSpecShadow))) + { + set( data->PP_ShadowPen, MUIA_Pendisplay_Spec, d ); + + D(DBF_ALWAYS, "Shadow color: '%s'", (STRPTR)d); + } + else + { + if( pdobj ) + { + DoMethod( pdobj, MUIM_Pendisplay_SetMUIPen, MUICFGV_NListtree_PenSpecShadow_Default ); + + get( pdobj, MUIA_Pendisplay_Spec, &pen ); + set( data->PP_ShadowPen, MUIA_Pendisplay_Spec, pen ); + + D(DBF_ALWAYS, "Shadow color: '%s'", pen); + } + } + + if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_PenSpecGlow))) + { + set( data->PP_GlowPen, MUIA_Pendisplay_Spec, d ); + + D(DBF_ALWAYS, "Glow color: '%s'", (STRPTR)d); + } + else + { + if( pdobj ) + { + DoMethod( pdobj, MUIM_Pendisplay_SetMUIPen, MUICFGV_NListtree_PenSpecGlow_Default ); + + get( pdobj, MUIA_Pendisplay_Spec, &pen ); + set( data->PP_GlowPen, MUIA_Pendisplay_Spec, pen ); + + D(DBF_ALWAYS, "Glow color: '%s'", pen); + } + } + + /* + ** Set values + */ + if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_LineType))) + { + set( data->CY_LineType, MUIA_Cycle_Active, atoi( (STRPTR)d ) ); + ValuesChanged(data); + + D(DBF_ALWAYS, "LineType: %ld", atoi( (STRPTR)d )); + } + else + { + set( data->CY_LineType, MUIA_Cycle_Active, MUICFGV_NListtree_LineType_Default ); + ValuesChanged(data); + + D(DBF_ALWAYS, "Style: %ld", 0); + } + + if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_IndentWidth))) + { + set( data->SL_IndentWidth, MUIA_Slider_Level, atoi( (STRPTR)d ) ); + + D(DBF_ALWAYS, "IndentWidth: %ld", atoi( (STRPTR)d )); + } + else + { + set( data->SL_IndentWidth, MUIA_Slider_Level, MUICFGV_NListtree_IndentWidth_Default ); + + D(DBF_ALWAYS, "IndentWidth: %ld", MUICFGV_NListtree_IndentWidth_Default); + } + + if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_RememberStatus))) + { + set( data->CH_RememberStatus, MUIA_Selected, atoi( (STRPTR)d ) ); + + D(DBF_ALWAYS, "RememberStatus: %ld", atoi( (STRPTR)d )); + } + else + { + set( data->CH_RememberStatus, MUIA_Selected, MUICFGV_NListtree_RememberStatus_Default ); + + D(DBF_ALWAYS, "RememberStatus: %ld", MUICFGV_NListtree_RememberStatus_Default); + } + + if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_OpenAutoScroll))) + { + set( data->CH_OpenAutoScroll, MUIA_Selected, atoi( (STRPTR)d ) ); + + D(DBF_ALWAYS, "OpenAutoScroll: %ld", atoi( (STRPTR)d )); + } + else + { + set( data->CH_OpenAutoScroll, MUIA_Selected, MUICFGV_NListtree_OpenAutoScroll_Default ); + + D(DBF_ALWAYS, "OpenAutoScroll: %ld", MUICFGV_NListtree_OpenAutoScroll_Default); + } + + if((d = DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListtree_UseFolderImage))) + { + set( data->CH_UseFolderImage, MUIA_Selected, atoi( (STRPTR)d ) ); + + D(DBF_ALWAYS, "UseFolderImage: %ld", atoi( (STRPTR)d )); + } + else + { + set( data->CH_UseFolderImage, MUIA_Selected, MUICFGV_NListtree_UseFolderImage_Default ); + + D(DBF_ALWAYS, "UseFolderImage: %ld", MUICFGV_NListtree_UseFolderImage_Default); + } + + /* + ** Dispose created objects + */ + if( pdobj ) + MUI_DisposeObject( pdobj ); + if( idobj ) + MUI_DisposeObject( idobj ); + + RETURN(0); + return( 0 ); +} + + +static IPTR _GadgetsToConfig( struct IClass *cl, Object *obj, struct MUIP_Settingsgroup_GadgetsToConfig *msg ) +{ + struct NListtreeP_Data *data = INST_DATA( cl, obj ); + char buf[8]; + ULONG d=0; + + ENTER(); + + /* + ** Images + */ + get( data->PI_ImageClosed, MUIA_Imagedisplay_Spec, &d ); + if( d != 0) + DoMethod( msg->configdata, MUIM_Dataspace_Add, d, sizeof( struct MUI_ImageSpec ), MUICFG_NListtree_ImageSpecClosed ); + + D(DBF_ALWAYS, "Image closed: '%s'", (STRPTR)d); + + + get( data->PI_ImageOpen, MUIA_Imagedisplay_Spec, &d ); + if(d != 0) + DoMethod( msg->configdata, MUIM_Dataspace_Add, d, sizeof( struct MUI_ImageSpec ), MUICFG_NListtree_ImageSpecOpen ); + + D(DBF_ALWAYS, "Image open: '%s'", (STRPTR)d); + + + get( data->PI_ImageFolder, MUIA_Imagedisplay_Spec, &d ); + if(d != 0) + DoMethod( msg->configdata, MUIM_Dataspace_Add, d, sizeof( struct MUI_ImageSpec ), MUICFG_NListtree_ImageSpecFolder ); + + D(DBF_ALWAYS, "Image folder: '%s'", (STRPTR)d); + + + /* + ** Colors + */ + get( data->PP_LinePen, MUIA_Pendisplay_Spec, &d ); + if(d != 0) + DoMethod( msg->configdata, MUIM_Dataspace_Add, d, sizeof( struct MUI_PenSpec ), MUICFG_NListtree_PenSpecLines ); + + D(DBF_ALWAYS, "Line color: '%s'", (STRPTR)d); + + + get( data->PP_ShadowPen, MUIA_Pendisplay_Spec, &d ); + if(d != 0) + DoMethod( msg->configdata, MUIM_Dataspace_Add, d, sizeof( struct MUI_PenSpec ), MUICFG_NListtree_PenSpecShadow ); + + D(DBF_ALWAYS, "Shadow color: '%s'", (STRPTR)d); + + + get( data->PP_GlowPen, MUIA_Pendisplay_Spec, &d ); + if(d != 0) + DoMethod( msg->configdata, MUIM_Dataspace_Add, d, sizeof( struct MUI_PenSpec ), MUICFG_NListtree_PenSpecGlow ); + + D(DBF_ALWAYS, "Glow color: '%s'", (STRPTR)d); + + /* + ** Values + */ + + + get( data->CH_RememberStatus, MUIA_Selected, &d ); + snprintf(buf, sizeof(buf), "%d", (int)d); + DoMethod( msg->configdata, MUIM_Dataspace_Add, buf, 5, MUICFG_NListtree_RememberStatus ); + + D(DBF_ALWAYS, "RememberStatus: %ld", d); + + + get( data->SL_IndentWidth, MUIA_Slider_Level, &d ); + snprintf(buf, sizeof(buf), "%d", (int)d); + DoMethod( msg->configdata, MUIM_Dataspace_Add, buf, 5, MUICFG_NListtree_IndentWidth ); + + D(DBF_ALWAYS, "IndentWidth: %ld", d); + + get( data->CH_OpenAutoScroll, MUIA_Selected, &d ); + snprintf(buf, sizeof(buf), "%d", (int)d); + DoMethod( msg->configdata, MUIM_Dataspace_Add, buf, 5, MUICFG_NListtree_OpenAutoScroll ); + + D(DBF_ALWAYS, "OpenAutoScroll: %ld", d); + + get( data->CY_LineType, MUIA_Cycle_Active, &d ); + snprintf(buf, sizeof(buf), "%d", (int)d); + DoMethod( msg->configdata, MUIM_Dataspace_Add, buf, 5, MUICFG_NListtree_LineType ); + + D(DBF_ALWAYS, "LineType: %ld", d); + + get( data->CH_UseFolderImage, MUIA_Selected, &d ); + snprintf(buf, sizeof(buf), "%d", (int)d); + DoMethod( msg->configdata, MUIM_Dataspace_Add, buf, 5, MUICFG_NListtree_UseFolderImage ); + + D(DBF_ALWAYS, "UseFolderImage: %ld", d); + + RETURN(0); + return( 0 ); +} + + +static IPTR _HandleInputP( struct IClass *cl, Object *obj, struct MUIP_HandleInput *msg ) +{ + if( msg->imsg ) + { + switch( msg->imsg->Class ) + { + case IDCMP_INTUITICKS: + break; + } + } + + return( DoSuperMethodA( cl, obj, (Msg)msg ) ); +} + +DISPATCHER(_DispatcherP) +{ + switch(msg->MethodID) + { + case OM_NEW: return(_NewP(cl, obj, (APTR)msg)); + case OM_DISPOSE: return(_DisposeP(cl, obj, (APTR)msg)); + + case MUIM_Setup: return(_SetupP(cl, obj, (APTR)msg)); + case MUIM_HandleInput: return(_HandleInputP(cl, obj, (APTR)msg)); + + case MUIM_Settingsgroup_ConfigToGadgets: return(_ConfigToGadgets(cl, obj, (APTR)msg)); + case MUIM_Settingsgroup_GadgetsToConfig: return(_GadgetsToConfig(cl, obj, (APTR)msg)); + } + + return( DoSuperMethodA( cl, obj, msg ) ); +} diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/icon.c b/workbench/classes/zune/nlist/nlisttree_mcp/icon.c new file mode 100644 index 0000000000..834061cf28 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/icon.c @@ -0,0 +1,93 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if !defined(__MORPHOS__) +const unsigned long icon32[] = { + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x7320396e, 0xec304e89, 0xff3f5d99, 0xff4664a0, 0xff3f5d99, 0xec304e89, 0x7320396e, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0xac2b4479, 0xff43619d, 0xff5775b1, 0xff617fbb, 0xff5775b1, 0xff43619d, 0xac2b4479, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xcd314b80, 0xff4e6ca8, 0xff6a88c4, 0xff7d9bd7, 0xff6a88c4, 0xff4e6ca8, 0xcd314b80, 0x2a000000, 0x00ff00ff, 0x04000000, 0x64000000, 0x07000000, 0x03000000, 0x48000000, 0x03000000, 0x00ff00ff, 0x03000000, 0x4c000000, 0x03000000, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xe538558d, 0xff516fab, 0xff6f8dc9, 0xff89a7e3, 0xff6f8dc9, 0xff516fab, 0xe538558d, 0x2a000000, 0x00ff00ff, 0x0b000000, 0x84000000, 0x0e000000, 0x09000000, 0x67000000, 0x3d000000, 0x72000000, 0x4c000000, 0xa5000000, 0x5b000000, 0x03000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xfb3e5b98, 0xff4a68a4, 0xff6785c0, 0xff7f9ddb, 0xff6785c0, 0xff4a68a4, 0xfb3e5b98, 0x2a000000, 0x00ff00ff, 0x12000000, 0x88000000, 0x15000000, 0x0f000000, 0x80000000, 0x40000000, 0x87000000, 0x58000000, 0x87000000, 0x17000000, 0x03000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff22417e, 0xff38548c, 0xff687a9e, 0xff97a9ce, 0xff687a9e, 0xff38548c, 0xff22417e, 0x2a000000, 0x00ff00ff, 0x14000000, 0x8b000000, 0x80000000, 0x6d000000, 0x86000000, 0x52000000, 0x71000000, 0x8a000000, 0x74000000, 0x6a000000, 0x08000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff102f6b, 0xff23417c, 0xff334771, 0xff41506d, 0xff334771, 0xff23417c, 0xff102f6b, 0x2a000000, 0x00ff00ff, 0x0d000000, 0x13000000, 0x18000000, 0x17000000, 0x16000000, 0x1d000000, 0x22000000, 0x20000000, 0x19000000, 0x0f000000, 0x04000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0x38000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x38000000, 0x1b000000, 0x00ff00ff, 0x06000000, 0x0c000000, 0x11000000, 0x11000000, 0x0d000000, 0x0e000000, 0x0d000000, 0x10000000, 0x0f000000, 0x09000000, 0x04000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x1b000000, 0x2a000000, 0x2a000000, 0xb9000000, 0x2a000000, 0x2a000000, 0x1b000000, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x7320396e, 0xec304e89, 0xff3f5d99, 0xff4664a0, 0xff3f5d99, 0xec304e89, 0x7320396e, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0xab000000, 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0xac2b4479, 0xff43619d, 0xff5775b1, 0xff617fbb, 0xff5775b1, 0xff43619d, 0xac2b4479, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xcd314b80, 0xff4e6ca8, 0xff6a88c4, 0xff7d9bd7, 0xff6a88c4, 0xff4e6ca8, 0xcd314b80, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0xab000000, 0x00ff00ff, 0xab000000, 0x2a000000, 0xe538558d, 0xff516fab, 0xff6f8dc9, 0xff89a7e3, 0xff6f8dc9, 0xff516fab, 0xe538558d, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xfb3e5b98, 0xff4a68a4, 0xff6785c0, 0xff7f9ddb, 0xff6785c0, 0xff4a68a4, 0xfb3e5b98, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff22417e, 0xff38548c, 0xff687a9e, 0xff97a9ce, 0xff687a9e, 0xff38548c, 0xff22417e, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff102f6b, 0xff23417c, 0xff334771, 0xff41506d, 0xff334771, 0xff23417c, 0xff102f6b, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0x38000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x38000000, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x1b000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x1b000000, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, +}; +#else // !__MORPHOS__ +const unsigned char icon32[] = +{ +#if defined(__PPC__) + 0x00, 0x00, 0x00, 0x18, + 0x00, 0x00, 0x00, 0x14, + 'B', 'Z', '2', '\0', + 0x00, 0x00, 0x01, 0xef, +#else + 0x18, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, + 'B', 'Z', '2', '\0', + 0xef, 0x01, 0x00, 0x00, +#endif + + 0x42, 0x5A, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0x6F, 0x0B, 0xC4, 0x06, 0x00, 0x00, + 0xD6, 0x7F, 0xFF, 0xCD, 0xEF, 0xFF, 0xEA, 0x58, 0x18, 0xE8, 0x63, 0xED, 0xDD, 0x76, 0xCA, 0x24, + 0xDF, 0xBE, 0x37, 0xC7, 0xFE, 0x00, 0xEB, 0x46, 0xEC, 0x20, 0x28, 0x44, 0x23, 0x00, 0x88, 0x0A, + 0x04, 0x00, 0x08, 0xC0, 0x01, 0xD0, 0x38, 0x01, 0xC0, 0x00, 0x68, 0x00, 0x06, 0x40, 0x00, 0x00, + 0x19, 0x0D, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x52, 0x29, 0xEA, 0x04, 0xDA, + 0x1A, 0x68, 0x13, 0x04, 0xDA, 0x69, 0x34, 0xC0, 0x01, 0x0C, 0x68, 0x09, 0xA0, 0x61, 0x18, 0x00, + 0x00, 0x9A, 0x60, 0x10, 0x68, 0xC1, 0xC0, 0x00, 0x68, 0x00, 0x06, 0x40, 0x00, 0x00, 0x19, 0x0D, + 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x50, 0x93, 0x4A, 0x68, 0x7A, 0x9E, 0xA0, + 0x64, 0xD3, 0x20, 0xD1, 0xA0, 0x64, 0x69, 0x84, 0xC8, 0x01, 0xA3, 0x03, 0x48, 0xC8, 0x63, 0x44, + 0xD3, 0xD1, 0x1A, 0x69, 0x80, 0x26, 0xD4, 0x69, 0xA3, 0xD2, 0x51, 0x95, 0x96, 0x10, 0x81, 0x05, + 0x07, 0x1D, 0x00, 0xE8, 0x9F, 0x43, 0x8E, 0x46, 0x11, 0x50, 0xA4, 0x2C, 0x0C, 0x6A, 0xEB, 0xFA, + 0x69, 0x52, 0xE7, 0xE5, 0xC2, 0x64, 0xB9, 0x45, 0x64, 0x5A, 0xB3, 0x2C, 0xEB, 0xAC, 0x62, 0x92, + 0xBE, 0x1B, 0x35, 0x3B, 0x3E, 0xAB, 0x39, 0xB7, 0x45, 0x81, 0x44, 0x4D, 0x9D, 0x3A, 0x35, 0xD6, + 0xC9, 0x83, 0xB4, 0x9E, 0x44, 0x67, 0x6C, 0x5B, 0x1A, 0x3B, 0x52, 0x01, 0x28, 0x97, 0xCF, 0xEC, + 0x9B, 0xF7, 0xA4, 0xCE, 0xC5, 0xAB, 0x37, 0x67, 0x6F, 0x5F, 0x69, 0xFD, 0x27, 0xE1, 0x6A, 0x62, + 0x61, 0x7A, 0x4B, 0x14, 0xB0, 0xD2, 0x13, 0x06, 0x02, 0x12, 0xF2, 0x04, 0x03, 0x62, 0x13, 0x63, + 0x49, 0x82, 0x49, 0x8D, 0x21, 0x24, 0x36, 0x90, 0x36, 0x9B, 0x43, 0x6D, 0xB6, 0x21, 0x36, 0x92, + 0x4D, 0x0C, 0x18, 0xD2, 0x4D, 0xA0, 0x63, 0x13, 0x18, 0x26, 0x86, 0xC6, 0x30, 0x6D, 0x6A, 0x0C, + 0x82, 0x18, 0x98, 0x31, 0xB6, 0xD2, 0xD8, 0x1A, 0x20, 0x0C, 0xD7, 0x07, 0x00, 0x35, 0x78, 0x77, + 0x78, 0xEB, 0xC8, 0xA3, 0x8A, 0x39, 0x10, 0x48, 0x37, 0x08, 0x6F, 0x18, 0x25, 0x83, 0x84, 0xA0, + 0x4E, 0x44, 0xB0, 0x5F, 0x13, 0x71, 0x94, 0x09, 0x45, 0x8A, 0x5F, 0x92, 0x31, 0x88, 0xAA, 0x13, + 0xC8, 0xA8, 0x49, 0x22, 0xA1, 0x96, 0x91, 0x34, 0x20, 0xF0, 0x89, 0x12, 0x7B, 0xCC, 0xB2, 0x66, + 0x61, 0x43, 0xE2, 0x8C, 0xC3, 0x34, 0x94, 0x8F, 0x81, 0x9E, 0x4D, 0x55, 0x9A, 0x4E, 0x68, 0x14, + 0x2A, 0x91, 0xD7, 0x46, 0x1A, 0x46, 0x89, 0xA6, 0x74, 0x0B, 0x24, 0x48, 0xB4, 0xD4, 0x5F, 0x42, + 0x38, 0xC4, 0x4A, 0xA7, 0x35, 0x45, 0x14, 0xCC, 0x42, 0xB3, 0xEA, 0x45, 0x3A, 0xB1, 0xA8, 0x6B, + 0x29, 0x3F, 0x08, 0xB5, 0x8D, 0x47, 0x3C, 0xA5, 0x66, 0xFB, 0x9B, 0x2A, 0x50, 0xA6, 0x6E, 0x28, + 0xB5, 0xC8, 0xD2, 0x6C, 0x95, 0x8F, 0x21, 0xC0, 0x9D, 0x5D, 0xBC, 0xE4, 0xAB, 0xB4, 0x93, 0xB7, + 0xDE, 0xD5, 0x74, 0xC8, 0x40, 0x84, 0x21, 0xBE, 0x88, 0xFC, 0xA2, 0xCA, 0x62, 0x25, 0x03, 0x31, + 0x3B, 0x81, 0x8A, 0xAE, 0xEA, 0x2C, 0x9F, 0xA6, 0x52, 0x9B, 0x85, 0x51, 0xFC, 0x7B, 0x9C, 0x4B, + 0x77, 0x13, 0xA6, 0xE5, 0x2C, 0x3A, 0x4F, 0xF2, 0xD5, 0x61, 0xD7, 0x71, 0xBA, 0xAA, 0x6E, 0x72, + 0x9A, 0xD5, 0x6F, 0x0F, 0xF8, 0xBB, 0x92, 0x29, 0xC2, 0x84, 0x83, 0x78, 0x5E, 0x20, 0x30, +}; +#endif // !__MORPHOS__ diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/icon.h b/workbench/classes/zune/nlist/nlisttree_mcp/icon.h new file mode 100755 index 0000000000..f3692304ef --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/icon.h @@ -0,0 +1,75 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if !defined(__MORPHOS__) +// uncompressed ARGB data +extern const unsigned long icon32[]; +#define ICON32_WIDTH 24 +#define ICON32_HEIGHT 20 +#define ICON32_DEPTH 32 +#else +// bzip2 compressed ARGB data +extern const unsigned char icon32[]; +#endif + +#ifdef USE_ICON8_COLORS +const ULONG icon8_colors[24] = +{ + 0x96969696,0x96969696,0x96969696, + 0x00000000,0x00000000,0x00000000, + 0xffffffff,0xffffffff,0xffffffff, + 0x3d3d3d3d,0x65656565,0xa2a2a2a2, + 0x79797979,0x79797979,0x79797979, + 0xaeaeaeae,0xaeaeaeae,0xaeaeaeae, + 0xaaaaaaaa,0x92929292,0x7d7d7d7d, + 0x79797979,0x79797979,0x79797979, +}; +#endif + +#define ICON8_WIDTH 24 +#define ICON8_HEIGHT 14 +#define ICON8_DEPTH 3 +#define ICON8_COMPRESSION 1 +#define ICON8_MASKING 2 + +#ifdef USE_ICON8_HEADER +const struct BitMapHeader icon8_header = +{ 23,14,0,0,3,2,1,0,0,22,22,640,480 }; +#endif + +#ifdef USE_ICON8_BODY +const UBYTE icon8_body[201] = { +0xfd,0x00,0xff,0xff,0x01,0xd8,0x00,0xff,0x00,0x01,0x24,0x00,0x03,0x7f,0xaf, +0xec,0x00,0x03,0x80,0x50,0x34,0x00,0x03,0x7f,0x57,0xc8,0x00,0x03,0x5b,0xfd, +0xec,0x00,0x03,0xa4,0x96,0x10,0x00,0x03,0x48,0x03,0xca,0x00,0x03,0x4b,0x5f, +0xec,0x00,0x03,0xb4,0xa0,0x10,0x00,0x03,0x40,0xa1,0xca,0x00,0x03,0x52,0xf6, +0xec,0x00,0x03,0xac,0x4b,0x10,0x00,0x03,0x41,0x09,0xca,0x00,0x03,0x5a,0xdf, +0xec,0x00,0x03,0xa5,0x00,0x10,0x00,0x03,0x41,0x20,0xca,0x00,0x03,0x7f,0xdd, +0xec,0x00,0x03,0x80,0x02,0x08,0x00,0x03,0x40,0x2a,0x52,0x00,0x03,0x6b,0xfe, +0xe0,0x00,0x03,0x9c,0x00,0x18,0x00,0x03,0x76,0x99,0xc6,0x00,0x03,0x7f,0xef, +0xec,0x00,0x03,0x80,0x00,0x14,0x00,0x03,0x7f,0x9f,0xc8,0x00,0xff,0x55,0x01, +0x6c,0x00,0x03,0x80,0x00,0x08,0x00,0x03,0x7f,0xbf,0xd2,0x00,0x03,0x04,0xea, +0x20,0x00,0x03,0x80,0x00,0x18,0x00,0x03,0x7b,0x15,0xc6,0x00,0x03,0x7e,0xff, +0xec,0x00,0x03,0x80,0x00,0x14,0x00,0x03,0x01,0x00,0x08,0x00,0x03,0x7f,0xff, +0xec,0x00,0x03,0x40,0x00,0x08,0x00,0x03,0x80,0x00,0x12,0x00,0xfd,0x00,0xfd, +0x00,0x03,0x3f,0xff,0xf6,0x00, }; +#endif diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/images/icon32.png b/workbench/classes/zune/nlist/nlisttree_mcp/images/icon32.png new file mode 100755 index 0000000000000000000000000000000000000000..090792cc9f047ddf11ac59dd01e24caea342cf83 GIT binary patch literal 565 zcwPZD0?Pe~P)<h;3K|Lk000e1NJLTq000;O000yS1^@s6m$m(a00009a7bBm000id z000id0mpBsWB>pG=Sf6CRCt`Vl)X#CU=YTyCT*apt@yU0D1NMN3J!G_aTW(RCl^6* zbaGT&1i{6@#iigM;GnyMh`I<mh-h1|nwmyT+WJwSD{m#O7GtCbKdyI|-1FWWu4;uU z)JjuZ+TAS>pg{Xza&f*R(YqXrbqGz<s8lLZp<o*3LuU2nXmcCWKKmAcMRi?I3K19a zc$~uFFxj?Es;Y`t+f1UK0{;?-g*0slA|!;UVi*QFjzgU1I>=yBerFEsf;TV$4lvz2 zY6^Z&fqjk}1xO3GcPolQ!C;UgkqB9qMI3Y9{TLXOz6}h3aWo%;zXG#-7{n<SsS^l= z^e(>lV$s3%6sw+N&Nm3C(g#2fxC9B11-Ibvrz@g#Hmi1tDD`)isXG#-`<H9VKjtZC zSnlWe)O-~Sz~FO%PLKnm(ocgOP(MLFZ{SEDbbOMb%ZpR89F@$nj{KARu@YDVK~RzK zG-u#L)@}KH>Lw_d=UYjWsE@u|n(Hosifl%*QBmd;>B~P|kp=FgXWIZvHSt;=AFk|f z@SA-J$R%PjGBsJN)s}E1vHs^JZ2DJ$rh9m4MuxtZu&IEnIh&^?^fdu{gexAG@b42y zkztQZ=v|=EJT9Ss0gp@QTfplQ`W9$h!aDIL`Ko;a;HdlKofvdx00000NkvXXu0mjf D2buTP literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/images/icon8.iff b/workbench/classes/zune/nlist/nlisttree_mcp/images/icon8.iff new file mode 100644 index 0000000000000000000000000000000000000000..4855008514e3424eacd1fbe5837f8b7491cc1d35 GIT binary patch literal 318 zcwRM+ze~eF7>3`=S5Oh8h{lc?oSel?Y|>y`>d_DoQ3od{orNHp{0$BPLGTB45s8bt zTWKAgT*S^IxOI!?dj+}Sd!O%p?%+1Nu?Eyydn?d^ZiN6Au!K2Ih@&#Vb)8I&8rqMz zs^xjkVT@Tnyi1a#D2j)RGlpjD2P`U>#Z<%BO`9XBB8=MJWbeWay5TPKu;hL94g<9e zNuRzUS+vTuGl1-u#9m&7wB!}iIUqjY5bL+Zcuaik5d9hA-Y4-M7CmD6VV`oQDX+wk zqu&wa3N^^dWuNVjZTUM%uLm&O>ewRX^yLjw`SL7MK3$}IZvJI8Q7qPN$}o?TM>fnD F_ygFXRA2xA literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/library.c b/workbench/classes/zune/nlist/nlisttree_mcp/library.c new file mode 100644 index 0000000000..5ae0b0823c --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/library.c @@ -0,0 +1,201 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/******************************************************************************/ +/* */ +/* includes */ +/* */ +/******************************************************************************/ + +#include <proto/exec.h> +#include <proto/intuition.h> +#include <proto/muimaster.h> + +/******************************************************************************/ +/* */ +/* MCC/MCP name and version */ +/* */ +/* ATTENTION: The FIRST LETTER of NAME MUST be UPPERCASE */ +/* */ +/******************************************************************************/ + +#include "private.h" +#include "version.h" + +#define VERSION LIB_VERSION +#define REVISION LIB_REVISION + +#define CLASS MUIC_NListtreeP +#define SUPERCLASSP MUIC_Mccprefs + +#define INSTDATAP NListtreeP_Data + +#define USERLIBID CLASS " " LIB_REV_STRING " [" SYSTEMSHORT "/" CPU "] (" LIB_DATE ") " LIB_COPYRIGHT +#define MASTERVERSION 19 + +#define CLASSINIT +#define CLASSEXPUNGE + +#define USEDCLASSES used_mccs +static const char *used_mccs[] = { "NList.mcc", "NListview.mcc", "NListtree.mcc", NULL }; + +#define USEDCLASSESP used_mcps +static const char *used_mcps[] = { "NListviews.mcp", NULL }; + +#define MIN_STACKSIZE 8192 + +#include "locale.h" + +struct Library *LocaleBase = NULL; + +#if defined(__amigaos4__) +struct LocaleIFace *ILocale = NULL; +#endif + +#if !defined(__MORPHOS__) +static BOOL nbitmapCanHandleRawData; +#endif + +/******************************************************************************/ +/* define the functions used by the startup code ahead of including mccinit.c */ +/******************************************************************************/ +static BOOL ClassInit(UNUSED struct Library *base); +static VOID ClassExpunge(UNUSED struct Library *base); + +/******************************************************************************/ +/* include the lib startup code for the mcc/mcp (and muimaster inlines) */ +/******************************************************************************/ +#define USE_ICON8_COLORS +#define USE_ICON8_BODY + +#include "icon.h" + +#if defined(__MORPHOS__) +#include <mui/Rawimage_mcc.h> +#else +#include <mui/NBitmap_mcc.h> +#endif + +static Object *get_prefs_image(void) +{ + Object *obj; + + #if !defined(__MORPHOS__) + if(nbitmapCanHandleRawData == TRUE) + { + obj = NBitmapObject, + MUIA_FixWidth, ICON32_WIDTH, + MUIA_FixHeight, ICON32_HEIGHT, + MUIA_NBitmap_Type, MUIV_NBitmap_Type_ARGB32, + MUIA_NBitmap_Normal, icon32, + MUIA_NBitmap_Width, ICON32_WIDTH, + MUIA_NBitmap_Height, ICON32_HEIGHT, + End; + } + else + { + obj = NULL; + } + #else + obj = RawimageObject, + MUIA_Rawimage_Data, icon32, + End; + #endif + + // if the 32bit image data couldn't be loaded + // we fall back to the 8bit icon + if(obj == NULL) + { + obj = BodychunkObject,\ + MUIA_FixWidth, ICON8_WIDTH,\ + MUIA_FixHeight, ICON8_HEIGHT,\ + MUIA_Bitmap_Width, ICON8_WIDTH ,\ + MUIA_Bitmap_Height, ICON8_HEIGHT,\ + MUIA_Bodychunk_Depth, ICON8_DEPTH,\ + MUIA_Bodychunk_Body, (UBYTE *)icon8_body,\ + MUIA_Bodychunk_Compression, ICON8_COMPRESSION,\ + MUIA_Bodychunk_Masking, ICON8_MASKING,\ + MUIA_Bitmap_SourceColors, (ULONG *)icon8_colors,\ + MUIA_Bitmap_Transparent, 0,\ + End; + } + + return obj; +} + +#define PREFSIMAGEOBJECT get_prefs_image() + +#include "mccinit.c" + +/******************************************************************************/ +/* define all implementations of our user functions */ +/******************************************************************************/ + +static BOOL ClassInit(UNUSED struct Library *base) +{ + if((LocaleBase = OpenLibrary("locale.library", 38)) && + GETINTERFACE(ILocale, struct LocaleIFace *, LocaleBase)) + { + // open the NListtree_mcp catalog + OpenCat(); + + #if !defined(__MORPHOS__) + { + struct Library *nbitmapMcc; + + nbitmapCanHandleRawData = FALSE; + + // we need at least NBitmap.mcc V15.8 to be able to let it handle raw image data + if((nbitmapMcc = OpenLibrary("mui/NBitmap.mcc", 0)) != NULL) + { + SHOWVALUE(DBF_ALWAYS, nbitmapMcc->lib_Version); + SHOWVALUE(DBF_ALWAYS, nbitmapMcc->lib_Revision); + + if(nbitmapMcc->lib_Version > 15 || (nbitmapMcc->lib_Version == 15 && nbitmapMcc->lib_Revision >= 8)) + nbitmapCanHandleRawData = TRUE; + + CloseLibrary(nbitmapMcc); + } + + SHOWVALUE(DBF_ALWAYS, nbitmapCanHandleRawData); + } + #endif + + return TRUE; + } + + return FALSE; +} + + +static VOID ClassExpunge(UNUSED struct Library *base) +{ + // close the catalog + CloseCat(); + + if(LocaleBase != NULL) + { + DROPINTERFACE(ILocale); + CloseLibrary(LocaleBase); + LocaleBase = NULL; + } +} diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/locale/NListtree_mcp.cd b/workbench/classes/zune/nlist/nlisttree_mcp/locale/NListtree_mcp.cd new file mode 100755 index 0000000000..ffc30c7bb9 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/locale/NListtree_mcp.cd @@ -0,0 +1,256 @@ +; +; NListtree_mcp.cd - NListtree MUI custom prefs catalog description file +; $Id$ +; +#version 2 +#language english +; +; +MSG_TAB_LAYOUT (1//) +Layout +; +MSG_GROUP_IMAGES_COLORS (2//) +Images/Colors +; +MSG_BUTTON_LABEL_CLOSED (3//) +Closed +; +MSG_BUTTON_SHORTCUT_CLOSED (4//) +c +; +MSG_HELP_CLOSED_IMAGE (5//) +Image to use for closed nodes. +; +MSG_WIN_TITLE_CLOSED_IMAGE (6//) +Adjust image for closed nodes +; +MSG_BUTTON_LABEL_LINES (7//) +Lines +; +MSG_BUTTON_SHORTCUT_LINES (8//) +l +; +MSG_HELP_LINES_COLOR (9//) +Color to use for lines. +; +MSG_WIN_TITLE_LINES_COLOR (10//) +Adjust lines color +; +MSG_BUTTON_LABEL_OPEN (11//) +Open +; +MSG_BUTTON_SHORTCUT_OPEN (12//) +o +; +MSG_HELP_OPEN_IMAGE (13//) +Image to use for open nodes. +; +MSG_WIN_TITLE_OPEN_IMAGE (14//) +Adjust image for open nodes +; +MSG_BUTTON_LABEL_SHADOW (15//) +Shadow +; +MSG_BUTTON_SHORTCUT_SHADOW (16//) +w +; +MSG_HELP_SHADOW_COLOR (17//) +Color to use to cast\n\ +shadows after lines. +; +MSG_WIN_TITLE_SHADOW_COLOR (18//) +Adjust shadow color +; +MSG_BUTTON_LABEL_SPECIAL (19//) +Special +; +MSG_BUTTON_SHORTCUT_SPECIAL (20//) +i +; +MSG_HELP_SPECIAL_IMAGE (21//) +A special image to be\n\ +displayed after every node. +; +MSG_WIN_TITLE_SPECIAL_IMAGE (22//) +Adjust special image +; +MSG_BUTTON_LABEL_DRAW (23//) +Draw +; +MSG_BUTTON_SHORTCUT_DRAW (24//) +d +; +MSG_HELP_DRAW_COLOR (25//) +A draw color to be combined\n\ +with the lines color. +; +MSG_WIN_TITLE_DRAW_COLOR (26//) +Adjust draw color +; +MSG_GROUP_STYLE (27//) +Style +; +MSG_CYCLE_LABEL_STYLE (28//) +Style +; +MSG_CYCLE_SHORTCUT_STYLE (29//) +s +; +MSG_HELP_STYLE (30//) +Select here the global style of the tree.\n\ +\n\ +Depending on your choice, some of the\n\ +options above may become (un)available. +; +MSG_CYCLE_ITEM_STYLE_NORMAL (31//) +Normal +; +MSG_CYCLE_ITEM_STYLE_INSERTED (32//) +Inserted +; +MSG_CYCLE_ITEM_STYLE_LINES (33//) +Lines +; +MSG_CYCLE_ITEM_STYLE_WIN98 (34//) +Win98 +; +MSG_CYCLE_ITEM_STYLE_MAC (35//) +Mac +; +MSG_CYCLE_ITEM_STYLE_LINES3D (36//) +Lines 3D +; +MSG_CYCLE_ITEM_STYLE_WIN98PLUS (37//) +Win98+ +; +MSG_CYCLE_ITEM_STYLE_GLOW (38//) +Glow +; +MSG_BUTTON_LABEL_SPACE (39//) +Spacing +; +MSG_BUTTON_SHORTCUT_SPACE (40//) +p +; +MSG_HELP_SPACE (41//) +The more spacing, the wider\n\ +the listtree will be. +; +MSG_BUTTON_LABEL_REMEMBER (42//) +Remember status? +; +MSG_BUTTON_SHORTCUT_REMEMBER (43//) +r +; +MSG_HELP_REMEMBER (44//) +If enabled, the open/closed status of nodes\n\ +will be 'remembered' after the listtree is closed\n\ +the next time it is opened again.\n\ +\n\ +Please note, however, that an application\n\ +can override your choice here. +; +MSG_BUTTON_LABEL_AUTOSCROLL (45//) +Autoscroll? +; +MSG_BUTTON_SHORTCUT_AUTOSCROLL (46//) +a +; +MSG_HELP_AUTOSCROLL (47//) +If enabled, the listview will auto-scroll its\n\ +contents when opening nodes to try and fit the\n\ +visible area. +; +MSG_TAB_EXAMPLE (48//) +Example +; +MSG_HELP_LISTVIEW_EXAMPLE (49//) +This NListtree object reacts in real time to\n\ +the changes you apply under the 'Layout' tab.\n\ +\n\ +Give it a try! :) +; +MSG_BUTTON_LABEL_EXPAND (50//) +Expand +; +MSG_BUTTON_SHORTCUT_EXPAND (51//) +n +; +MSG_BUTTON_LABEL_COLLAPSE (52//) +Collapse +; +MSG_BUTTON_SHORTCUT_COLLAPSE (53//) +e +; +MSG_BUTTON_LABEL_LINETYPES (54//) +Line type +; +MSG_BUTTON_SHORTCUT_LINETYPES (55//) +l +; +MSG_LINETYPE_DISABLED (56//) +Disabled +; +MSG_LINETYPE_NORMAL (57//) +Normal +; +MSG_LINETYPE_DOTTED (58//) +Dotted +; +MSG_LINETYPE_SHADOW (59//) +Shadow +; +MSG_LINETYPE_GLOW (60//) +Glow +; +MSG_HELP_LINETYPES (61//) +Select the line type used for drawing\n\ +the individual levels in the listtree. +; +MSG_BUTTON_LABEL_FOLDER (62//) +Folder image +; +MSG_BUTTON_SHORTCUT_FOLDER (63//) +f +; +MSG_WIN_TITLE_FOLDER_IMAGE (64//) +Adjust folder image +; +MSG_HELP_FOLDER_IMAGE (65//) +An image displayed in front of every\n\ +node containing subnodes. +; +MSG_BUTTON_LABEL_FOLDERIMAGE (66//) +Use folder image +; +MSG_BUTTON_SHORTCUT_FOLDERIMAGE (67//) +i +; +MSG_HELP_FOLDERIMAGE (68//) +Select if you want a folder image to\n\ +appear in front of every node containing\n\ +subnodes. +; +MSG_BUTTON_LABEL_INDENTWIDTH (69//) +Additional indent width +; +MSG_BUTTON_SHORTCUT_INDENTWIDTH (70//) +w +; +MSG_HELP_INDENTWIDTH (71//) +Specify an additional indent\n\ +width applied to each subnode. +; +MSG_BUTTON_LABEL_GLOW (72//) +Glow color +; +MSG_BUTTON_SHORTCUT_GLOW (73//) +g +; +MSG_WIN_TITLE_GLOW_COLOR (74//) +Set glow line color +; +MSG_HELP_GLOW_COLOR (75//) +Allows to set the color for the glow\n\ +line type +; diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/locale/czech.ct b/workbench/classes/zune/nlist/nlisttree_mcp/locale/czech.ct new file mode 100644 index 0000000000..9d4a45a98b --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/locale/czech.ct @@ -0,0 +1,245 @@ +## version $VER: NListtree_mcp.catalog 2.2 (2.1.2008) +## language czech +## codeset 5 +; +; +; NListtree_mcp.cd - NListtree MUI custom prefs catalog description file +; $Id$ +; +;#version 2 +;#language english +; +; +MSG_TAB_LAYOUT +Rozvr¾ení +; Layout +; +MSG_GROUP_IMAGES_COLORS +Obrázky a barvy +; Images/Colors +; +MSG_BUTTON_LABEL_CLOSED +Sbalená vìtev +; Closed +; +MSG_BUTTON_SHORTCUT_CLOSED +b +; c +; +MSG_HELP_CLOSED_IMAGE +Obrázek pro sbalenou èást seznamu. +; Image to use for closed nodes. +; +MSG_WIN_TITLE_CLOSED_IMAGE +Vyberte obrázek pro sbalenou vìtev +; Adjust image for closed nodes +; +MSG_BUTTON_LABEL_LINES +Barva linek +; Lines +; +MSG_BUTTON_SHORTCUT_LINES +l +; l +; +MSG_HELP_LINES_COLOR +Definuje barvu jednotlivých linek. +; Color to use for lines. +; +MSG_WIN_TITLE_LINES_COLOR +Vyberte barvu linek +; Adjust lines color +; +MSG_BUTTON_LABEL_OPEN +Rozbalená vìtev +; Open +; +MSG_BUTTON_SHORTCUT_OPEN +o +; o +; +MSG_HELP_OPEN_IMAGE +Obrázek pro rozbalenou èást seznamu. +; Image to use for open nodes. +; +MSG_WIN_TITLE_OPEN_IMAGE +Vyberte obrázek pro rozbalenou vìtev +; Adjust image for open nodes +; +MSG_BUTTON_LABEL_SHADOW +Barva stínu +; Shadow +; +MSG_BUTTON_SHORTCUT_SHADOW +s +; w +; +MSG_HELP_SHADOW_COLOR +Definuje barvu stínu linek. +; Color to use to cast\n\ +; shadows after lines. +; +MSG_WIN_TITLE_SHADOW_COLOR +Vyberte barvu stínu linek +; Adjust shadow color +; +MSG_BUTTON_LABEL_SPECIAL +Speciální obrázek +; Special +; +MSG_BUTTON_SHORTCUT_SPECIAL +p +; i +; +MSG_HELP_SPECIAL_IMAGE +Symbol pro koncovou èást ka¾dé vìtve. +; A special image to be\n\ +; displayed after every node. +; +MSG_WIN_TITLE_SPECIAL_IMAGE +Vyberte speciální obrázek +; Adjust special image +; +MSG_BUTTON_LABEL_DRAW +Doplòková barva +; Draw +; +MSG_BUTTON_SHORTCUT_DRAW +d +; d +; +MSG_HELP_DRAW_COLOR +Definuje doplòkovou barvu. +; A draw color to be combined\n\ +; with the lines color. +; +MSG_WIN_TITLE_DRAW_COLOR +Vyberte doplòkovou barvu +; Adjust draw color +; +MSG_GROUP_STYLE +Styl +; Style +; +MSG_CYCLE_LABEL_STYLE +Styl +; Style +; +MSG_CYCLE_SHORTCUT_STYLE +y +; s +; +MSG_HELP_STYLE +Globálnì definuje styl celého stromu. +; Select here the global style of the tree.\n\ +; \n\ +; Depending on your choice, some of the\n\ +; options above may become (un)available. +; +MSG_CYCLE_ITEM_STYLE_NORMAL +Základní +; Normal +; +MSG_CYCLE_ITEM_STYLE_INSERTED +Odsazené polo¾ky +; Inserted +; +MSG_CYCLE_ITEM_STYLE_LINES +Linky +; Lines +; +MSG_CYCLE_ITEM_STYLE_WIN98 +Windows 98 +; Win98 +; +MSG_CYCLE_ITEM_STYLE_MAC +Mac Classic +; Mac +; +MSG_CYCLE_ITEM_STYLE_LINES3D +Linky plastické +; Lines 3D +; +MSG_CYCLE_ITEM_STYLE_WIN98PLUS +Windows 98+ +; Win98+ +; +MSG_CYCLE_ITEM_STYLE_GLOW +Glow +; Glow +; +MSG_BUTTON_LABEL_SPACE +Rozestup +; Spacing +; +MSG_BUTTON_SHORTCUT_SPACE +o +; p +; +MSG_HELP_SPACE +Poèet bodù mezi polo¾kami (vodorovnì). +; The more spacing, the wider\n\ +; the listtree will be. +; +MSG_BUTTON_LABEL_REMEMBER +Pamatovat stav +; Remember status? +; +MSG_BUTTON_SHORTCUT_REMEMBER +m +; r +; +MSG_HELP_REMEMBER +Ulo¾í naposledy platný stav. +; If enabled, the open/closed status of nodes\n\ +; will be 'remembered' after the listtree is closed\n\ +; the next time it is opened again.\n\ +; \n\ +; Please note, however, that an application\n\ +; can override your choice here. +; +MSG_BUTTON_LABEL_AUTOSCROLL +Vyplnit prostor +; Autoscroll? +; +MSG_BUTTON_SHORTCUT_AUTOSCROLL +s +; a +; +MSG_HELP_AUTOSCROLL +Automaticky posune a optimálnì vyplní prostor\n\ +pøi otevøení vìtve stromu. +; If enabled, the listview will auto-scroll its\n\ +; contents when opening nodes to try and fit the\n\ +; visible area. +; +MSG_TAB_EXAMPLE +Ukázka vzhledu +; Example +; +MSG_HELP_LISTVIEW_EXAMPLE +Tento prvek reaguje okam¾itì na zmìny provedené\n\ +na panelu 'Rozvr¾ení'.\n\ +\n\ +Vyzkou¹ejte! :) +; This NListtree object reacts in real time to\n\ +; the changes you apply under the 'Layout' tab.\n\ +; \n\ +; Give it a try! :) +; +MSG_BUTTON_LABEL_EXPAND +Rozbalit +; Expand +; +MSG_BUTTON_SHORTCUT_EXPAND +r +; n +; +MSG_BUTTON_LABEL_COLLAPSE +Sbalit +; Collapse +; +MSG_BUTTON_SHORTCUT_COLLAPSE +s +; e +; diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/locale/english-british.ct b/workbench/classes/zune/nlist/nlisttree_mcp/locale/english-british.ct new file mode 100644 index 0000000000..38174e65cd --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/locale/english-british.ct @@ -0,0 +1,51 @@ +## chunk AUTH Thore Böckelmann, Jens Langner +## version $VER: NListtree_mcp.catalog 2.2 (11.7.2011) +## language english-british +## codeset 4 +; +MSG_GROUP_IMAGES_COLORS +Images/Colours +; Images/Colors +; +MSG_HELP_LINES_COLOR +Colour to use for lines. +; Color to use for lines. +; +MSG_WIN_TITLE_LINES_COLOR +Adjust lines colour +; Adjust lines color +; +MSG_HELP_SHADOW_COLOR +Colour to use to cast\n\ +shadows after lines. +; Color to use to cast\n\ +; shadows after lines. +; +MSG_WIN_TITLE_SHADOW_COLOR +Adjust shadow colour +; Adjust shadow color +; +MSG_HELP_DRAW_COLOR +A draw colour to be combined\n\ +with the lines colour. +; A draw color to be combined\n\ +; with the lines color. +; +MSG_WIN_TITLE_DRAW_COLOR +Adjust draw colour +; Adjust draw color +; +MSG_BUTTON_LABEL_GLOW +Glow colour +; Glow color +; +MSG_WIN_TITLE_GLOW_COLOR +Set glow line colour +; Set glow line color +; +MSG_HELP_GLOW_COLOR +Allows to set the colour for the glow\n\ +line type +; Allows to set the color for the glow\n\ +; line type +; diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/locale/french.ct b/workbench/classes/zune/nlist/nlisttree_mcp/locale/french.ct new file mode 100644 index 0000000000..11070e1c20 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/locale/french.ct @@ -0,0 +1,260 @@ +## version $VER: Nlisttree.ct 2.64 (13.04.08) by mrodfr@gmail.com +## language français +## codeset 0 +; +; +; NListtree_mcp.cd - NListtree MUI custom prefs catalog description file +; $Id$ +; +;#version 2 +;#language français +; +; +MSG_TAB_LAYOUT +Mise en page +; Layout +; +MSG_GROUP_IMAGES_COLORS +Images/Couleurs +; Images/Colors +; +MSG_BUTTON_LABEL_CLOSED +Fermé +; Closed +; +MSG_BUTTON_SHORTCUT_CLOSED +f +; c +; +MSG_HELP_CLOSED_IMAGE +Image a utiliser pour nodes fermés. +; Image to use for closed nodes. +; +MSG_WIN_TITLE_CLOSED_IMAGE +Ajuster image pour nodes fermés +; Adjust image for closed nodes +; +MSG_BUTTON_LABEL_LINES +Lignes +; Lines +; +MSG_BUTTON_SHORTCUT_LINES +l +; l +; +MSG_HELP_LINES_COLOR +Couleurs a utiliser pour les lignes +; Color to use for lines. +; +MSG_WIN_TITLE_LINES_COLOR +Ajuster la couleur des lignes +; Adjust lines color +; +MSG_BUTTON_LABEL_OPEN +Ouvert +; Open +; +MSG_BUTTON_SHORTCUT_OPEN +o +; o +; +MSG_HELP_OPEN_IMAGE +Image a utiliser pour nodes ouverts. +; Image to use for open nodes. +; +MSG_WIN_TITLE_OPEN_IMAGE +Ajuster images pour nodes ouverts +; Adjust image for open nodes +; +MSG_BUTTON_LABEL_SHADOW +Ombre +; Shadow +; +MSG_BUTTON_SHORTCUT_SHADOW +m +; w +; +MSG_HELP_SHADOW_COLOR +Couleur a utiliser pour\n\ +l'ombre des lignes. +; Color to use to cast\n\ +; shadows after lines. +; +MSG_WIN_TITLE_SHADOW_COLOR +Ajuster couleur de l'ombre +; Adjust shadow color +; +MSG_BUTTON_LABEL_SPECIAL +Spécial +; Special +; +MSG_BUTTON_SHORTCUT_SPECIAL +i +; i +; +MSG_HELP_SPECIAL_IMAGE +Une image spéciale qui sera\n\ +montrée après chaque node. +; A special image to be\n\ +; displayed after every node. +; +MSG_WIN_TITLE_SPECIAL_IMAGE +Ajuster l'image spéciale +; Adjust special image +; +MSG_BUTTON_LABEL_DRAW +Dessin +; Draw +; +MSG_BUTTON_SHORTCUT_DRAW +d +; d +; +MSG_HELP_DRAW_COLOR +Une couleur supplémentaire qui sera\n\ +combinée avec les 2 couleurs de la ligne. +; A draw color to be combined\n\ +; with the lines color. +; +MSG_WIN_TITLE_DRAW_COLOR +Ajuster la couleur de dessin +; Adjust draw color +; +MSG_GROUP_STYLE +Style +; Style +; +MSG_CYCLE_LABEL_STYLE +Style +; Style +; +MSG_CYCLE_SHORTCUT_STYLE +s +; s +; +MSG_HELP_STYLE +Sélectionner ici le style global de\n\ +l'arborescence.\n\ +\n\ +Selon votre choix, certaines options\n\ +pourront ne pas être disponible. +; Select here the global style of the tree.\n\ +; \n\ +; Depending on your choice, some of the\n\ +; options above may become (un)available. +; +MSG_CYCLE_ITEM_STYLE_NORMAL +Normal +; Normal +; +MSG_CYCLE_ITEM_STYLE_INSERTED +Inséré +; Inserted +; +MSG_CYCLE_ITEM_STYLE_LINES +Lignes +; Lines +; +MSG_CYCLE_ITEM_STYLE_WIN98 +Win98 +; Win98 +; +MSG_CYCLE_ITEM_STYLE_MAC +Mac +; Mac +; +MSG_CYCLE_ITEM_STYLE_LINES3D +Lignes 3D +; Lines 3D +; +MSG_CYCLE_ITEM_STYLE_WIN98PLUS +Win 98+ +; Win98+ +; +MSG_CYCLE_ITEM_STYLE_GLOW +Glow +; Glow +; +MSG_BUTTON_LABEL_SPACE +Espaces +; Spacing +; +MSG_BUTTON_SHORTCUT_SPACE +p +; p +; +MSG_HELP_SPACE +Avec plus d'espaces, la\n\ +listtree sera plus grande. +; The more spacing, the wider\n\ +; the listtree will be. +; +MSG_BUTTON_LABEL_REMEMBER +Rappel des statuts? +; Remember status? +; +MSG_BUTTON_SHORTCUT_REMEMBER +r +; r +; +MSG_HELP_REMEMBER +Si sélectionné, le statut ouvert/fermé des nodes\n\ +sera 'retenu' après la fermeture du listtree\n\ +et ceci pour toutes les prochaines ouvertures.\n\ +\n\ +Noter toutefois qu'une application pourra\n\ +remplacer elle-même ce choix . +; If enabled, the open/closed status of nodes\n\ +; will be 'remembered' after the listtree is closed\n\ +; the next time it is opened again.\n\ +; \n\ +; Please note, however, that an application\n\ +; can override your choice here. +; +MSG_BUTTON_LABEL_AUTOSCROLL +Déplacement auto.? +; Autoscroll? +; +MSG_BUTTON_SHORTCUT_AUTOSCROLL +a +; a +; +MSG_HELP_AUTOSCROLL +Si sélectionné, le listview déplacera automatiquement\n\ +son contenu lors de l'ouverture des nodes et essayera\n\ +de montrer un maximum de contenu dans la zone visible. +; If enabled, the listview will auto-scroll its\n\ +; contents when opening nodes to try and fit the\n\ +; visible area. +; +MSG_TAB_EXAMPLE +Exemple +; Example +; +MSG_HELP_LISTVIEW_EXAMPLE +Les objets Nlisttree réagiront en temps\n\ +réel aux changements que vous aller\n\ +faire dans la zone 'Mise en page'.\n\ +\n\ +Essayez-donc:! :-) +; This NListtree object reacts in real time to\n\ +; the changes you apply under the 'Layout' tab.\n\ +; \n\ +; Give it a try! :) +; +MSG_BUTTON_LABEL_EXPAND +Étendre +; Expand +; +MSG_BUTTON_SHORTCUT_EXPAND +n +; n +; +MSG_BUTTON_LABEL_COLLAPSE +Réduire +; Collapse +; +MSG_BUTTON_SHORTCUT_COLLAPSE +e +; e +; diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/locale/german.ct b/workbench/classes/zune/nlist/nlisttree_mcp/locale/german.ct new file mode 100755 index 0000000000..b72957cc7d --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/locale/german.ct @@ -0,0 +1,347 @@ +## chunk AUTH Thore Böckelmann, Jens Langner +## version $VER: NListtree_mcp.catalog 2.4 (11.7.2011) +## language deutsch +## codeset 0 +; +; $Id$ +; +MSG_TAB_LAYOUT +Layout +; Layout +; +MSG_GROUP_IMAGES_COLORS +Bilder/Farben +; Images/Colors +; +MSG_BUTTON_LABEL_CLOSED +Geschlossen +; Closed +; +MSG_BUTTON_SHORTCUT_CLOSED +g +; c +; +MSG_HELP_CLOSED_IMAGE +Bild für geschlossene Knoten +; Image to use for closed nodes. +; +MSG_WIN_TITLE_CLOSED_IMAGE +Bild für geschlossene Knoten ändern +; Adjust image for closed nodes +; +MSG_BUTTON_LABEL_LINES +Linien +; Lines +; +MSG_BUTTON_SHORTCUT_LINES +l +; l +; +MSG_HELP_LINES_COLOR +Farbe für Linien +; Color to use for lines. +; +MSG_WIN_TITLE_LINES_COLOR +Farbe für Linien ändern +; Adjust lines color +; +MSG_BUTTON_LABEL_OPEN +Geöffnet +; Open +; +MSG_BUTTON_SHORTCUT_OPEN +ö +; o +; +MSG_HELP_OPEN_IMAGE +Bild für geöffnete Knoten +; Image to use for open nodes. +; +MSG_WIN_TITLE_OPEN_IMAGE +Bild für geöffnete Knoten ändern +; Adjust image for open nodes +; +MSG_BUTTON_LABEL_SHADOW +Schatten +; Shadow +; +MSG_BUTTON_SHORTCUT_SHADOW +s +; w +; +MSG_HELP_SHADOW_COLOR +Farbe um Schatten unter Linien zu malen +; Color to use to cast\n\ +; shadows after lines. +; +MSG_WIN_TITLE_SHADOW_COLOR +Schattenfarbe ändern +; Adjust shadow color +; +MSG_BUTTON_LABEL_SPECIAL +Speziell +; Special +; +MSG_BUTTON_SHORTCUT_SPECIAL +p +; i +; +MSG_HELP_SPECIAL_IMAGE +Spezielles Bild, das hinter jedem Knoten angezeigt wird +; A special image to be\n\ +; displayed after every node. +; +MSG_WIN_TITLE_SPECIAL_IMAGE +Spezielles Bild ändern +; Adjust special image +; +MSG_BUTTON_LABEL_DRAW +Zeichnen +; Draw +; +MSG_BUTTON_SHORTCUT_DRAW +z +; d +; +MSG_HELP_DRAW_COLOR +Zeichenfarbe, die mit der Linienfarbe kombiniert wird +; A draw color to be combined\n\ +; with the lines color. +; +MSG_WIN_TITLE_DRAW_COLOR +Zeichenfarbe ändern +; Adjust draw color +; +MSG_GROUP_STYLE +Stil +; Style +; +MSG_CYCLE_LABEL_STYLE +Stil +; Style +; +MSG_CYCLE_SHORTCUT_STYLE +i +; s +; +MSG_HELP_STYLE +Wählen Sie hier den globalen Stil des Baums.\n\ +\n\ +Abhängig von Ihrer Wahl können einige Optionen von oben (in)aktiv werden. +; Select here the global style of the tree.\n\ +; \n\ +; Depending on your choice, some of the\n\ +; options above may become (un)available. +; +MSG_CYCLE_ITEM_STYLE_NORMAL +Normal +; Normal +; +MSG_CYCLE_ITEM_STYLE_INSERTED +Eingerückt +; Inserted +; +MSG_CYCLE_ITEM_STYLE_LINES +Linien +; Lines +; +MSG_CYCLE_ITEM_STYLE_WIN98 +Win98 +; Win98 +; +MSG_CYCLE_ITEM_STYLE_MAC +Mac +; Mac +; +MSG_CYCLE_ITEM_STYLE_LINES3D +3D-Linien +; Lines 3D +; +MSG_CYCLE_ITEM_STYLE_WIN98PLUS +Win98+ +; Win98+ +; +MSG_CYCLE_ITEM_STYLE_GLOW +Glow +; Glow +; +MSG_BUTTON_LABEL_SPACE +Abstand +; Spacing +; +MSG_BUTTON_SHORTCUT_SPACE +a +; p +; +MSG_HELP_SPACE +Je mehr Abstand um so breiter wird der Baum werden. +; The more spacing, the wider\n\ +; the listtree will be. +; +MSG_BUTTON_LABEL_REMEMBER +Zustand merken? +; Remember status? +; +MSG_BUTTON_SHORTCUT_REMEMBER +m +; r +; +MSG_HELP_REMEMBER +Fall aktiv merkt sich der Baum den geöffnet/geschlossen\n\ +Zustand der Knoten und stellt diesen beim nächsten Darstellen\n\ +wieder her.\n\ +\n\ +Hinweis: ein Programm kann diese Option ignorieren. +; If enabled, the open/closed status of nodes\n\ +; will be 'remembered' after the listtree is closed\n\ +; the next time it is opened again.\n\ +; \n\ +; Please note, however, that an application\n\ +; can override your choice here. +; +MSG_BUTTON_LABEL_AUTOSCROLL +Automatisch scrollen? +; Autoscroll? +; +MSG_BUTTON_SHORTCUT_AUTOSCROLL +c +; a +; +MSG_HELP_AUTOSCROLL +Fall aktiv wird der Baum seinen Inhalt entsprechend\n\ +anpassen, um geöffnete Knoten möglichst komplett\n\ +darzustellen. +; If enabled, the listview will auto-scroll its\n\ +; contents when opening nodes to try and fit the\n\ +; visible area. +; +MSG_TAB_EXAMPLE +Beispiel +; Example +; +MSG_HELP_LISTVIEW_EXAMPLE +Der Baum reagiert in Echtzeit auf Änderungen auf\n\ +der Layout-Seite.\n\ +\n\ +Probieren Sie es aus! :) +; This NListtree object reacts in real time to\n\ +; the changes you apply under the 'Layout' tab.\n\ +; \n\ +; Give it a try! :) +; +MSG_BUTTON_LABEL_EXPAND +Alle öffnen +; Expand +; +MSG_BUTTON_SHORTCUT_EXPAND +f +; n +; +MSG_BUTTON_LABEL_COLLAPSE +Alle schließen +; Collapse +; +MSG_BUTTON_SHORTCUT_COLLAPSE +e +; e +; +MSG_BUTTON_LABEL_LINETYPES +Linienstil +; Line type +; +MSG_BUTTON_SHORTCUT_LINETYPES +n +; l +; +MSG_LINETYPE_DISABLED +keine +; Disabled +; +MSG_LINETYPE_NORMAL +normal +; Normal +; +MSG_LINETYPE_DOTTED +gepunktet +; Dotted +; +MSG_LINETYPE_SHADOW +schattiert +; Shadow +; +MSG_LINETYPE_GLOW +glühend +; Glow +; +MSG_HELP_LINETYPES +Wählen Sie hier den Stil zum Zeichen der Linien\n\ +für die unterschiedlichen Ebenen des Baumes. +; Select the line type used for drawing\n\ +; the individual levels in the listtree. +; +MSG_BUTTON_LABEL_FOLDER +Verzeichnisbild +; Folder image +; +MSG_BUTTON_SHORTCUT_FOLDER +V +; f +; +MSG_WIN_TITLE_FOLDER_IMAGE +Verzeichnisbild ändern +; Adjust folder image +; +MSG_HELP_FOLDER_IMAGE +Vor jedem Eintrag mit weiteren Untereinträgen\n\ +wird dieses Bild angezeigt. +; An image displayed in front of every\n\ +; node containing subnodes. +; +MSG_BUTTON_LABEL_FOLDERIMAGE +Verzeichnisbild benutzen +; Use folder image +; +MSG_BUTTON_SHORTCUT_FOLDERIMAGE +b +; i +; +MSG_HELP_FOLDERIMAGE +Wählen Sie hier, ob vor jedem Eintrag mit\n\ +weiteren Untereinträgen ein Verzeichnisbild\n\ +angezeigt werden soll. +; Select if you want a folder image to\n\ +; appear in front of every node containing\n\ +; subnodes. +; +MSG_BUTTON_LABEL_INDENTWIDTH +Zusätzl. Einzugsbreite +; Indent width +; +MSG_BUTTON_SHORTCUT_INDENTWIDTH +E +; w +; +MSG_HELP_INDENTWIDTH +Legt eine zusätzliche Einzugsbreite\n\ +für jeden Untereintrag fest. +; Specify the width of indentation for\n\ +; every subnode +; +MSG_BUTTON_LABEL_GLOW +Glühfarbe +; Glow color +; +MSG_BUTTON_SHORTCUT_GLOW +G +; g +; +MSG_WIN_TITLE_GLOW_COLOR +Legt die Linienfarbe für das Glühen fest +; Set glow line color +; +MSG_HELP_GLOW_COLOR +Wählen Sie hier die Farbe für den Glüheffekt\n\ +der Linien. +; Allows to set the color for the glow\n\ +; line type +; diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/locale/polish.ct b/workbench/classes/zune/nlist/nlisttree_mcp/locale/polish.ct new file mode 100644 index 0000000000..375a0b865a --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/locale/polish.ct @@ -0,0 +1,364 @@ +## version $VER: nlisttree_mcp.catalog 2.1 (14.07.2011) +## language polski +## codeset 5 +; +## chunk AUTH Mariusz Danilewicz <mandi@interia.pl> +; +; NListtree_mcp.ct - NListtree MUI custom prefs catalog Polish translation file +; $Id$ +; in sync with .cd in revision 595; +; +;#version 2 +;#language english +; +; +MSG_TAB_LAYOUT +Uk³ad +; Layout +; +MSG_GROUP_IMAGES_COLORS +Obrazki/Kolory +; Images/Colors +; +MSG_BUTTON_LABEL_CLOSED +Zamkniêty +; Closed +; +MSG_BUTTON_SHORTCUT_CLOSED +Z +; c +; +MSG_HELP_CLOSED_IMAGE +Obrazek u¿ywany do wy¶wietlania\n\ +zamkniêtych wêz³ów. +; Image to use for closed nodes. +; +MSG_WIN_TITLE_CLOSED_IMAGE +Wybierz obrazek dla zamkniêtych wêz³ów +; Adjust image for closed nodes +; +MSG_BUTTON_LABEL_LINES +Linie +; Lines +; +MSG_BUTTON_SHORTCUT_LINES +L +; l +; +MSG_HELP_LINES_COLOR +Kolor u¿ywany do rysowania\n\ +linii ³±cz±cych. +; Color to use for lines. +; +MSG_WIN_TITLE_LINES_COLOR +Wybierz kolor linii +; Adjust lines color +; +MSG_BUTTON_LABEL_OPEN +Otwarty +; Open +; +MSG_BUTTON_SHORTCUT_OPEN +O +; o +; +MSG_HELP_OPEN_IMAGE +Obrazek u¿ywany do wy¶wietlania\n\ +otwartych wêz³ów. +; Image to use for open nodes. +; +MSG_WIN_TITLE_OPEN_IMAGE +Wybierz obrazek dla otwartych wêz³ów +; Adjust image for open nodes +; +MSG_BUTTON_LABEL_SHADOW +Cienie +; Shadow +; +MSG_BUTTON_SHORTCUT_SHADOW +C +; w +; +MSG_HELP_SHADOW_COLOR +Kolor u¿ywany do rysowania\n\ +cienia rzucanego przez linie. +; Color to use to cast\n\ +; shadows after lines. +; +MSG_WIN_TITLE_SHADOW_COLOR +Wybierz kolor cienia +; Adjust shadow color +; +MSG_BUTTON_LABEL_SPECIAL +Specjalny +; Special +; +MSG_BUTTON_SHORTCUT_SPECIAL +j +; i +; +MSG_HELP_SPECIAL_IMAGE +Specjalny obrazek wy¶wietlany\n\ +za ka¿dym wêz³em. +; A special image to be\n\ +; displayed after every node. +; +MSG_WIN_TITLE_SPECIAL_IMAGE +Wybierz obrazek specjalny +; Adjust special image +; +MSG_BUTTON_LABEL_DRAW +Rysowanie +; Draw +; +MSG_BUTTON_SHORTCUT_DRAW +R +; d +; +MSG_HELP_DRAW_COLOR +Kolor rysowania u¿ywany\n\ +w po³±czeniu z kolorem linii. +; A draw color to be combined\n\ +; with the lines color. +; +MSG_WIN_TITLE_DRAW_COLOR +Wybierz kolor rysowania +; Adjust draw color +; +MSG_GROUP_STYLE +Styl +; Style +; +MSG_CYCLE_LABEL_STYLE +Styl +; Style +; +MSG_CYCLE_SHORTCUT_STYLE +S +; s +; +MSG_HELP_STYLE +Wybiera globalne ustawienia stylu drzewa.\n\ +\n\ +W zale¿no¶ci od wybranego stylu niektóre opcje\n\ +powy¿ej mog± byæ (nie)dostêpne. +; Select here the global style of the tree.\n\ +; \n\ +; Depending on your choice, some of the\n\ +; options above may become (un)available. +; +MSG_CYCLE_ITEM_STYLE_NORMAL +normalny +; Normal +; +MSG_CYCLE_ITEM_STYLE_INSERTED +z wciêciami +; Inserted +; +MSG_CYCLE_ITEM_STYLE_LINES +linie +; Lines +; +MSG_CYCLE_ITEM_STYLE_WIN98 +Win98 +; Win98 +; +MSG_CYCLE_ITEM_STYLE_MAC +Mac +; Mac +; +MSG_CYCLE_ITEM_STYLE_LINES3D +linie 3D +; Lines 3D +; +MSG_CYCLE_ITEM_STYLE_WIN98PLUS +Win98+ +; Win98+ +; +MSG_CYCLE_ITEM_STYLE_GLOW +styl Glow +; Glow +; +MSG_BUTTON_LABEL_SPACE +Odstêpy +; Spacing +; +MSG_BUTTON_SHORTCUT_SPACE +p +; p +; +MSG_HELP_SPACE +Im wiêksze odstêpy zostan± ustawione,\n\ +tym obszerniejsze bêdzie wy¶wietlane drzewo. +; The more spacing, the wider\n\ +; the listtree will be. +; +MSG_BUTTON_LABEL_REMEMBER +Pamiêtaj stan +; Remember status? +; +MSG_BUTTON_SHORTCUT_REMEMBER +P +; r +; +MSG_HELP_REMEMBER +Je¶li ta opcja jest w³±czona, stan wêz³ów\n\ +bêdzie \"zapamiêtywany\" po zamkniêciu widoku\n\ +drzewa i przywracany po jego ponownym otworzeniu.\n\ +\n\ +Pamiêtaj jednak, i¿ aplikacja mo¿e zastosowaæ\n\ +inne ustawienia, ni¿ wybrane tutaj przez Ciebie. +; If enabled, the open/closed status of nodes\n\ +; will be 'remembered' after the listtree is closed\n\ +; the next time it is opened again.\n\ +; \n\ +; Please note, however, that an application\n\ +; can override your choice here. +; +MSG_BUTTON_LABEL_AUTOSCROLL +Autoprzewijanie +; Autoscroll? +; +MSG_BUTTON_SHORTCUT_AUTOSCROLL +A +; a +; +MSG_HELP_AUTOSCROLL +Je¶li ta opcja jest w³±czona, lista wy¶wietlania\n\ +bêdzie automatycznie przewija³a zawarto¶æ podczas\n\ +otwierania wêz³ów tak, by spróbowaæ wy¶wietliæ\n\ +zawarto¶æ w widocznym obszarze. +; If enabled, the listview will auto-scroll its\n\ +; contents when opening nodes to try and fit the\n\ +; visible area. +; +MSG_TAB_EXAMPLE +Przyk³ad +; Example +; +MSG_HELP_LISTVIEW_EXAMPLE +Ten obiekt NListtree reaguje w czasie rzeczywistym\n\ +na zmiany wprowadzane w zak³adce \"Uk³ad\".\n\ +\n\ +Wypróbuj go! :) +; This NListtree object reacts in real time to\n\ +; the changes you apply under the 'Layout' tab.\n\ +; \n\ +; Give it a try! :) +; +MSG_BUTTON_LABEL_EXPAND +Rozwiñ +; Expand +; +MSG_BUTTON_SHORTCUT_EXPAND +R +; n +; +MSG_BUTTON_LABEL_COLLAPSE +Zwiñ +; Collapse +; +MSG_BUTTON_SHORTCUT_COLLAPSE +Z +; e +; +MSG_BUTTON_LABEL_LINETYPES +Linie +; Line type +; +MSG_BUTTON_SHORTCUT_LINETYPES +l +; l +; +MSG_LINETYPE_DISABLED +wy³±czone +; Disabled +; +MSG_LINETYPE_NORMAL +normalne +; Normal +; +MSG_LINETYPE_DOTTED +kropkowane +; Dotted +; +MSG_LINETYPE_SHADOW +cieniowane +; Shadow +; +MSG_LINETYPE_GLOW +z po¶wiat± +; Glow +; +MSG_HELP_LINETYPES +Wybiera rodzaj linii u¿ywany do rysowania\n\ +poszczególnych poziomów zagnie¿dd¿enia drzewa. +; Select the line type used for drawing\n\ +; the individual levels in the listtree. +; +MSG_BUTTON_LABEL_FOLDER +Obrazek folderu +; Folder image +; +MSG_BUTTON_SHORTCUT_FOLDER +f +; f +; +MSG_WIN_TITLE_FOLDER_IMAGE +Ustala folder obrazków +; Adjust folder image +; +MSG_HELP_FOLDER_IMAGE +Obrazek wy¶wietlany przed ka¿dym\n\ +wêz³em zawieraj±cym podwêz³y. +; An image displayed in front of every\n\ +; node containing subnodes. +; +MSG_BUTTON_LABEL_FOLDERIMAGE +U¿ywaj obrazka folderu +; Use folder image +; +MSG_BUTTON_SHORTCUT_FOLDERIMAGE +o +; i +; +MSG_HELP_FOLDERIMAGE +Zaznacz tê opcjê, je¶li chcesz aby obrazek\n\ +folderu by³ wy¶wietlany przed ka¿dym wêz³em\n\ +zawieraj±cym podwêz³y. +; Select if you want a folder image to\n\ +; appear in front of every node containing\n\ +; subnodes. +; +MSG_BUTTON_LABEL_INDENTWIDTH +Szeroko¶æ dodatkowego wciêcia +; Additional indent width +; +MSG_BUTTON_SHORTCUT_INDENTWIDTH +w +; w +; +MSG_HELP_INDENTWIDTH +Okre¶la dodatkowe wciêcie\n\ +dla ka¿dego podwêz³a. +; Specify an additional indent\n\ +; width applied to each subnode. +; +MSG_BUTTON_LABEL_GLOW +Kolor po¶wiaty +; Glow color +; +MSG_BUTTON_SHORTCUT_GLOW +k +; g +; +MSG_WIN_TITLE_GLOW_COLOR +Ustaw koloro po¶wiaty linii +; Set glow line color +; +MSG_HELP_GLOW_COLOR +Pozwala na ustawienie koloru po¶wiaty\n\ +linii. +; Allows to set the color for the glow\n\ +; line type +; \ No newline at end of file diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/locale/russian.ct b/workbench/classes/zune/nlist/nlisttree_mcp/locale/russian.ct new file mode 100644 index 0000000000..f30ee1ef3b --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/locale/russian.ct @@ -0,0 +1,259 @@ +## version $VER: NListtree.mcp.catalog 18.0 (12.03.2007) (Amiga-1251) +## language russian +## codeset 2104 +## chunk AUTH Translated by ATO-RUS: Vlad Vinogradov <vinnny@aport.ru> +;----------------------------------------------------------------------------- +; +; CATALOG TRANSLATION REVISION HISTORY +; +; 18.0 (12.03.2007) <vvinogradov> +; - first build (NListtree.mcp v18.12) +; +;----------------------------------------------------------------------------- +; +MSG_BT_COLLAPSE +Ñâåðíóòü +; Collapse +; +MSG_BT_COLLAPSE_KEY +ñ +; e +; +MSG_BT_EXPAND +Ðàçâåðíóòü +; Expand +; +MSG_BT_EXPAND_KEY +ð +; n +; +MSG_BT_OPENCOPYRIGHT +Àâòîðñêèå ïðàâà +; Copyright +; +MSG_BT_OPENCOPYRIGHT_KEY +à +; r +; +MSG_BT_OPENSAMPLE +Ïðèìåð +; Sample (b) +; +MSG_BT_OPENSAMPLE_KEY +ï +; b +; +MSG_CLOSED +Çàêðûòûé: +; Closed: +; +MSG_CLOSED_KEY +ç +; c +; +MSG_COPYRIGHT +Àâòîðñêèå ïðàâà +; Copyright +; +MSG_COPYRIGHTTEXT +\ec\ebNListtree.mcc %s\en\n\ecÀâòîðñêèå ïðàâà ©1999-2000 ïðèíàäëåæàò Carsten Scholling\nÂñå ïðàâà çàùèùåíû.\n\n\nÏî âîïðîñàì ðàçðàáîòêè, íàéäåííûõ îøèáêàõ è ïðåäëîæåíèÿõ îáðàùàéòåñü íà e­mail:\n\n\ec\ebcs@aphaso.de\en\n\nÒàêæå ïðîâåðüòå ìîþ äîìàøíþþ ñòðàíè÷êó:\n\ebhttp://www.aphaso.de\n +; \033c\033bNListtree.mcc %s\033n\n\033cCopyright ©1999-2000 by Carsten Scholling\nAll rights reserved.\n\n\nFor developer information, bug reports and suggestions please send an email to:\n\n\033c\033bcs@aphaso.de\033n\n\nAlso check out my homepage:\n\033bhttp://www.aphaso.de\n +; +MSG_DRAW +Êîíòóð: +; Draw: +; +MSG_DRAW_KEY +ê +; d +; +MSG_LINES +Ëèíèè: +; Lines: +; +MSG_LINES_KEY +ë +; l +; +MSG_LV_SHORTHELP +Ýòîò NListtree-îáúåêò ðåàãèðóåò\níà èçìåíåíèå íàñòðîåê. +; This NListtree object reacts on\nthe preferences changes. +; +MSG_OPEN +Îòêðûòûé: +; Open: +; +MSG_OPEN_AUTOSCROLL +Ñäâèãàòü: +; Open scroll: +; +MSG_OPEN_AUTOSCROLL_KEY +â +; s +; +MSG_OPEN_KEY +î +; o +; +MSG_PREFS +Íàñòðîéêè +; Preferences +; +MSG_REMEMBER_STATUS +Çàïîìèíàòü: +; Remember: +; +MSG_REMEMBER_STATUS_KEY +ç +; m +; +MSG_SAMPLE +NListtree ïðèìåð +; NListtree sample +; +MSG_SHADOW +Òåíü: +; Shadow: +; +MSG_SHADOW_KEY +ò +; w +; +MSG_SHORTHELP_CLOSED_IMAGE +Èçîáðàæåíèå äëÿ çàêðûòîãî ðàçäåëà. +; Image for a closed node. +; +MSG_SHORTHELP_DRAWPEN +Öâåò äëÿ êîíòóðíûõ ëèíèé. +; Custom draw color. +; +MSG_SHORTHELP_LINEPEN +Öâåò äëÿ ëèíèé +; Custom line color. +; +MSG_SHORTHELP_OPEN_AUTOSCROLL +Àâòîìàòè÷åñêè ñäâèãàòü ñïèñîê ïðè\nîòêðûòèè ðàçäåëà, åñëè åãî ñîäåðæèìîå\níå óìåùàåòñÿ â âèäèìîé ÷àñòè îêíà. +; Auto scroll listview when opening\nnodes to fit in visible area. +; +MSG_SHORTHELP_OPEN_IMAGE +Èçîáðàæåíèå äëÿ îòêðûòîãî ðàçäåëà. +; Image for an opened node. +; +MSG_SHORTHELP_REMEMBER_STATUS +Çàïîìèíàòü ðàñïîëîæåíèå\nðàçäåëîâ ïîñëå çàêðûòèÿ. +; Remember status of nodes\nafter closing. +; +MSG_SHORTHELP_SHADOWPEN +Öâåò äëÿ òåíè. +; Custom shadow color. +; +MSG_SHORTHELP_SPACE +Êîëè÷åñòâî ïèêñåëåé äëÿ îòñòóïà. +; Number of space pixels. +; +MSG_SHORTHELP_SPECIAL_IMAGE +Îñîáîå èçîáðàæåíèå. +; Special image. +; +MSG_SHORTHELP_STYLE +Îáùèé ñòèëü îôîðìëåíèÿ äåðåâà. +; Global style of the tree. +; +MSG_SPACE +Ðàññòîÿíèå: +; Space: +; +MSG_SPACE_KEY +ð +; p +; +MSG_SPECIAL +Îñîáûé: +; Special: +; +MSG_SPECIAL_KEY +ñ +; a +; +MSG_STR_PREFS_IMAGESLINES +Èçîáðàæåíèÿ/Ëèíèè +; Images/Lines +; +MSG_STR_PREFS_STYLE +Ñòèëü +; Style +; +MSG_STYLE +Ñòèëü: +; Style: +; +MSG_STYLE_INSERTED +Âëîæåííûé +; Inserted +; +MSG_STYLE_KEY +ñ +; y +; +MSG_STYLE_LINES +Ëèíèè +; Lines +; +MSG_STYLE_LINES3D +3D-ëèíèè +; Lines 3D +; +MSG_STYLE_MAC +Mac +; Mac +; +MSG_STYLE_NORMAL +Îáû÷íûé +; Normal +; +MSG_STYLE_WIN98 +Win98 +; Win98 +; +MSG_STYLE_WIN98PLUS +Win98+ +; Win98+ +; +MSG_WIN_TITLE_CLOSED_IMAGE +Èçîáðàæåíèå äëÿ 'çàêðûòîãî ðàçäåëà' +; Adjust 'closed node' image +; +MSG_WIN_TITLE_DRAWPEN +Öâåò äëÿ 'êîíòóðíûõ ëèíèé' +; Adjust `Draw' pen +; +MSG_WIN_TITLE_LINEPEN +Öâåò äëÿ 'ëèíèé' +; Adjust `Lines' pen +; +MSG_WIN_TITLE_OPEN_IMAGE +Èçîáðàæåíèå äëÿ 'îòêðûòîãî ðàçäåëà' +; Adjust 'opened node' image +; +MSG_WIN_TITLE_SHADOWPEN +Öâåò äëÿ 'òåíè' +; Adjust `Shadow' pen +; +MSG_WIN_TITLE_SPECIAL_IMAGE +Îñîáîå èçîáðàæåíèå ðàçäåëà +; Adjust special image +; +MSG_BT_CLOSE +Çàêðûòü +; Close +; +MSG_BT_CLOSE_KEY +ç +; c +; +MSG_STYLE_GLOW +Glow +; Glow +; +MSG_DUMMY + diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/locale/swedish.ct b/workbench/classes/zune/nlist/nlisttree_mcp/locale/swedish.ct new file mode 100644 index 0000000000..c97ef5a54d --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/locale/swedish.ct @@ -0,0 +1,242 @@ +## version $VER: NListtree_mcp.catalog 2.1 (18.09.2010) +## language svenska +## codeset 0 +; +## chunk AUTH Pär Boberg +; +; NListtree_mcp.ct - NListtree MUI custom prefs catalog translation file +; $Id$ +; +;#version 2 +;#language english +; +; +MSG_TAB_LAYOUT +Layout +; Layout +; +MSG_GROUP_IMAGES_COLORS +Bilder/färger +; Images/Colors +; +MSG_BUTTON_LABEL_CLOSED +Stängd +; Closed +; +MSG_BUTTON_SHORTCUT_CLOSED +c +; c +; +MSG_HELP_CLOSED_IMAGE +Bild att använda för stängda noder. +; Image to use for closed nodes. +; +MSG_WIN_TITLE_CLOSED_IMAGE +Justera bild för stängda noder +; Adjust image for closed nodes +; +MSG_BUTTON_LABEL_LINES +Linjer +; Lines +; +MSG_BUTTON_SHORTCUT_LINES +l +; l +; +MSG_HELP_LINES_COLOR +Färg att använda för linjer. +; Color to use for lines. +; +MSG_WIN_TITLE_LINES_COLOR +Justera linje färg +; Adjust lines color +; +MSG_BUTTON_LABEL_OPEN +Öppen +; Open +; +MSG_BUTTON_SHORTCUT_OPEN +o +; o +; +MSG_HELP_OPEN_IMAGE +Bild att använda för öppna noder. +; Image to use for open nodes. +; +MSG_WIN_TITLE_OPEN_IMAGE +Justera bild för öppna noder +; Adjust image for open nodes +; +MSG_BUTTON_LABEL_SHADOW +Skugga +; Shadow +; +MSG_BUTTON_SHORTCUT_SHADOW +w +; w +; +MSG_HELP_SHADOW_COLOR +Färg att använda för\natt kasta skugga efter linjer. +; Color to use to cast\n\ +; shadows after lines. +; +MSG_WIN_TITLE_SHADOW_COLOR +Justera skugg färg +; Adjust shadow color +; +MSG_BUTTON_LABEL_SPECIAL +Special +; Special +; +MSG_BUTTON_SHORTCUT_SPECIAL +i +; i +; +MSG_HELP_SPECIAL_IMAGE +En speciell bild att visa\nefter varje nod. +; A special image to be\n\ +; displayed after every node. +; +MSG_WIN_TITLE_SPECIAL_IMAGE +Justera special bild +; Adjust special image +; +MSG_BUTTON_LABEL_DRAW +Rita +; Draw +; +MSG_BUTTON_SHORTCUT_DRAW +d +; d +; +MSG_HELP_DRAW_COLOR +En rit färg att kombinera\nmed linje färgen. +; A draw color to be combined\n\ +; with the lines color. +; +MSG_WIN_TITLE_DRAW_COLOR +Justera rit färg +; Adjust draw color +; +MSG_GROUP_STYLE +Stil +; Style +; +MSG_CYCLE_LABEL_STYLE +Stil +; Style +; +MSG_CYCLE_SHORTCUT_STYLE +s +; s +; +MSG_HELP_STYLE +Välj här global stil för trädet.\n\nBeroende på ditt val, så kan\nvissa av alternativen ovan\nbli otillgängliga. +; Select here the global style of the tree.\n\ +; \n\ +; Depending on your choice, some of the\n\ +; options above may become (un)available. +; +MSG_CYCLE_ITEM_STYLE_NORMAL +Normal +; Normal +; +MSG_CYCLE_ITEM_STYLE_INSERTED +Inmatad +; Inserted +; +MSG_CYCLE_ITEM_STYLE_LINES +Linjer +; Lines +; +MSG_CYCLE_ITEM_STYLE_WIN98 +Win98 +; Win98 +; +MSG_CYCLE_ITEM_STYLE_MAC +Mac +; Mac +; +MSG_CYCLE_ITEM_STYLE_LINES3D +Linjer 3D +; Lines 3D +; +MSG_CYCLE_ITEM_STYLE_WIN98PLUS +Win98+ +; Win98+ +; +MSG_CYCLE_ITEM_STYLE_GLOW +Glöd +; Glow +; +MSG_BUTTON_LABEL_SPACE +Mellanrum +; Spacing +; +MSG_BUTTON_SHORTCUT_SPACE +p +; p +; +MSG_HELP_SPACE +Ju mer mellanrum, desto\nvidare blir listträdet. +; The more spacing, the wider\n\ +; the listtree will be. +; +MSG_BUTTON_LABEL_REMEMBER +Kom ihåg status? +; Remember status? +; +MSG_BUTTON_SHORTCUT_REMEMBER +r +; r +; +MSG_HELP_REMEMBER +Om vald, kommer öppen/stängd statusen\nför noder att 'kommas-ihåg' efter att listträdet\nstängs nästa gång det öppnas igen.\n\nVar god notera att, en applikation kan\nåsidosätta ditt val här. +; If enabled, the open/closed status of nodes\n\ +; will be 'remembered' after the listtree is closed\n\ +; the next time it is opened again.\n\ +; \n\ +; Please note, however, that an application\n\ +; can override your choice here. +; +MSG_BUTTON_LABEL_AUTOSCROLL +Autorulla? +; Autoscroll? +; +MSG_BUTTON_SHORTCUT_AUTOSCROLL +a +; a +; +MSG_HELP_AUTOSCROLL +Om vald, kommer listvyn att autorulla\ndess innehåll vid öppning av noder\nför att försöka passa i det synliga området. +; If enabled, the listview will auto-scroll its\n\ +; contents when opening nodes to try and fit the\n\ +; visible area. +; +MSG_TAB_EXAMPLE +Exempel +; Example +; +MSG_HELP_LISTVIEW_EXAMPLE +Detta NListtree objekt, reagerar i realtid\ntill ändringarna som du gör under 'Layout' fliken.\n\nPröva så får du se! :) +; This NListtree object reacts in real time to\n\ +; the changes you apply under the 'Layout' tab.\n\ +; \n\ +; Give it a try! :) +; +MSG_BUTTON_LABEL_EXPAND +Expandera +; Expand +; +MSG_BUTTON_SHORTCUT_EXPAND +n +; n +; +MSG_BUTTON_LABEL_COLLAPSE +Kollapsa +; Collapse +; +MSG_BUTTON_SHORTCUT_COLLAPSE +e +; e +; diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/locale/turkish.ct b/workbench/classes/zune/nlist/nlisttree_mcp/locale/turkish.ct new file mode 100644 index 0000000000..4096360be5 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/locale/turkish.ct @@ -0,0 +1,256 @@ +## version $VER: NListtree_mcp.catalog 2.0 (07.11.2010) +## language türkçe +## codeset 0 +; +; +; NListtree_mcp.cd - NListtree MUI custom prefs catalog description file +; $Id$ +; +;#version 2 +;#language english +; +; +MSG_TAB_LAYOUT +Dizilim +; Layout +; +MSG_GROUP_IMAGES_COLORS +Simgeler/Renkler +; Images/Colors +; +MSG_BUTTON_LABEL_CLOSED +Kapalý +; Closed +; +MSG_BUTTON_SHORTCUT_CLOSED +k +; c +; +MSG_HELP_CLOSED_IMAGE +Kapalý çizgeler için kullanýlacak simge. +; Image to use for closed nodes. +; +MSG_WIN_TITLE_CLOSED_IMAGE +Kapalý çizgeler için kullanýlacak simgeyi belirleyin. +; Adjust image for closed nodes +; +MSG_BUTTON_LABEL_LINES +Çizgiler +; Lines +; +MSG_BUTTON_SHORTCUT_LINES +ç +; l +; +MSG_HELP_LINES_COLOR +Çizgiler için kullanýlacak renk. +; Color to use for lines. +; +MSG_WIN_TITLE_LINES_COLOR +Çizgi rengini belirleyin +; Adjust lines color +; +MSG_BUTTON_LABEL_OPEN +Açýk +; Open +; +MSG_BUTTON_SHORTCUT_OPEN +a +; o +; +MSG_HELP_OPEN_IMAGE +Açýk çizgeler için kullanýlacak simge. +; Image to use for open nodes. +; +MSG_WIN_TITLE_OPEN_IMAGE +Açýk çizgeler için kullanýlacak simgeyi seçin +; Adjust image for open nodes +; +MSG_BUTTON_LABEL_SHADOW +Gölge +; Shadow +; +MSG_BUTTON_SHORTCUT_SHADOW +g +; w +; +MSG_HELP_SHADOW_COLOR +Çizgilerin düþüreceði\n\ +gölge için kullanýlacak renk. +; Color to use to cast\n\ +; shadows after lines. +; +MSG_WIN_TITLE_SHADOW_COLOR +Gölge rengini belirleyin +; Adjust shadow color +; +MSG_BUTTON_LABEL_SPECIAL +Özel +; Special +; +MSG_BUTTON_SHORTCUT_SPECIAL +ö +; i +; +MSG_HELP_SPECIAL_IMAGE +Her çizgeden sonra\n\ +görüntülenecek özel bir simge. +; A special image to be\n\ +; displayed after every node. +; +MSG_WIN_TITLE_SPECIAL_IMAGE +Özel simgeyi seçin +; Adjust special image +; +MSG_BUTTON_LABEL_DRAW +Boya +; Draw +; +MSG_BUTTON_SHORTCUT_DRAW +b +; d +; +MSG_HELP_DRAW_COLOR +Çizgi rengi ile birlikte\n\ +kullanýlacak boyama rengi. +; A draw color to be combined\n\ +; with the lines color. +; +MSG_WIN_TITLE_DRAW_COLOR +Boyama rengini seçin +; Adjust draw color +; +MSG_GROUP_STYLE +Biçem +; Style +; +MSG_CYCLE_LABEL_STYLE +Biçem +; Style +; +MSG_CYCLE_SHORTCUT_STYLE +i +; s +; +MSG_HELP_STYLE +Aðaç görünümünün genel biçemini seçin\n\ +\n\ +Seçiminize baðlý olarak, yukarýdaki bazý\n\ +seçenekler devre dýþý kalabilir. +; Select here the global style of the tree.\n\ +; \n\ +; Depending on your choice, some of the\n\ +; options above may become (un)available. +; +MSG_CYCLE_ITEM_STYLE_NORMAL +Normal +; Normal +; +MSG_CYCLE_ITEM_STYLE_INSERTED +Girinti +; Inserted +; +MSG_CYCLE_ITEM_STYLE_LINES +Çizgiler +; Lines +; +MSG_CYCLE_ITEM_STYLE_WIN98 +Win98 +; Win98 +; +MSG_CYCLE_ITEM_STYLE_MAC +Mac +; Mac +; +MSG_CYCLE_ITEM_STYLE_LINES3D +3B Çizgiler +; Lines 3D +; +MSG_CYCLE_ITEM_STYLE_WIN98PLUS +Win98+ +; Win98+ +; +MSG_CYCLE_ITEM_STYLE_GLOW +Parýltýlý +; Glow +; +MSG_BUTTON_LABEL_SPACE +Boþluklar +; Spacing +; +MSG_BUTTON_SHORTCUT_SPACE +þ +; p +; +MSG_HELP_SPACE +Daha fazla boþluklama ile aðaç\n\ +görünümü daha büyük görüntülenir. +; The more spacing, the wider\n\ +; the listtree will be. +; +MSG_BUTTON_LABEL_REMEMBER +Durumu anýmsa? +; Remember status? +; +MSG_BUTTON_SHORTCUT_REMEMBER +d +; r +; +MSG_HELP_REMEMBER +Etkinleþtirilirse, çizgelerin açýk/kapalý durumlarý\n\ +listeaðacý kapatýldýktan sonra hafýzada tutulacaktýr.\n\ +\n\ +Lütfen unutmayýnýz ki, uygulamalar bu\n\ +seçiminizi yoksayabilir. +; If enabled, the open/closed status of nodes\n\ +; will be 'remembered' after the listtree is closed\n\ +; the next time it is opened again.\n\ +; \n\ +; Please note, however, that an application\n\ +; can override your choice here. +; +MSG_BUTTON_LABEL_AUTOSCROLL +Otomatik kaydýrma? +; Autoscroll? +; +MSG_BUTTON_SHORTCUT_AUTOSCROLL +o +; a +; +MSG_HELP_AUTOSCROLL +Etkinleþtirildiðinde, çizgeler açýlýrken görünür\n\ +alana göre içerik kaydýrýlacaktýr. +; If enabled, the listview will auto-scroll its\n\ +; contents when opening nodes to try and fit the\n\ +; visible area. +; +MSG_TAB_EXAMPLE +Örnek +; Example +; +MSG_HELP_LISTVIEW_EXAMPLE +Bu NListtree nesnesi 'Dizilim' sayfasýnda\n\ +yaptýðýnýz seçimlere ayak uyduracaktýr.\n\ +\n\ +Lütfen deneyin! :) +; This NListtree object reacts in real time to\n\ +; the changes you apply under the 'Layout' tab.\n\ +; \n\ +; Give it a try! :) +; +MSG_BUTTON_LABEL_EXPAND +Tümünü Aç +; Expand +; +MSG_BUTTON_SHORTCUT_EXPAND +a +; n +; +MSG_BUTTON_LABEL_COLLAPSE +Tümünü Kapat +; Collapse +; +MSG_BUTTON_SHORTCUT_COLLAPSE +k +; e +; diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/mmakefile.src b/workbench/classes/zune/nlist/nlisttree_mcp/mmakefile.src new file mode 100644 index 0000000000..f2e7d365bb --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/mmakefile.src @@ -0,0 +1,72 @@ +# $Id$ +include $(TOP)/config/make.cfg + +#MM contrib-zune-classes-nlisttree-mcp : includes linklibs contrib-zune-classes-nlisttree-mcp-catalogs + +USER_INCLUDES = -idirafter $(SRCDIR)/$(CURDIR)/../include +USER_CFLAGS := -DNO_INLINE_STDARG +USER_CFLAGS += $(PARANOIA_CFLAGS) + +FILES := library NListtree icon locale + +%build_module_simple mmake=contrib-zune-classes-nlisttree-mcp \ + modname=NListtree modtype=mcp moduledir=$(CONTRIBDIR)/Zune/MCC_NList/Classes/Zune \ + files=$(FILES) uselibs="mui" + +TARGETDIR := $(AROS_CONTRIB)/Zune/MCC_NList/Locale/Catalogs + +# CTs which aren't uptodate: +# $(TARGETDIR)/russian/NListtree_mcp.catalog \ + + +#MM +contrib-zune-classes-nlisttree-mcp-catalogs : locale.c locale.h \ + $(TARGETDIR)/english-british/NListtree_mcp.catalog \ + $(TARGETDIR)/czech/NListtree_mcp.catalog \ + $(TARGETDIR)/svenska/NListtree_mcp.catalog \ + $(TARGETDIR)/français/NListtree_mcp.catalog \ + $(TARGETDIR)/deutsch/NListtree_mcp.catalog \ + $(TARGETDIR)/polish/NListtree_mcp.catalog \ + $(TARGETDIR)/türkçe/NListtree_mcp.catalog + + +locale.h: locale/NListtree_mcp.cd C_h.sd + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListtree_mcp.cd locale.h=$(SRCDIR)/$(CURDIR)/C_h.sd + +locale.c: locale/NListtree_mcp.cd C_c.sd + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListtree_mcp.cd locale.c=$(SRCDIR)/$(CURDIR)/C_c.sd + + +$(TARGETDIR)/deutsch/NListtree_mcp.catalog: locale/german.ct + @$(MKDIR) $(TARGETDIR)/deutsch + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListtree_mcp.cd $< CATALOG $@ + +$(TARGETDIR)/czech/NListtree_mcp.catalog: locale/czech.ct + @$(MKDIR) $(TARGETDIR)/czech + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListtree_mcp.cd $< CATALOG $@ + +$(TARGETDIR)/français/NListtree_mcp.catalog: locale/french.ct + @$(MKDIR) $(TARGETDIR)/français + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListtree_mcp.cd $< CATALOG $@ + +$(TARGETDIR)/svenska/NListtree_mcp.catalog: locale/swedish.ct + @$(MKDIR) $(TARGETDIR)/svenska + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListtree_mcp.cd $< CATALOG $@ + +$(TARGETDIR)/english-british/NListtree_mcp.catalog: locale/english-british.ct + @$(MKDIR) $(TARGETDIR)/english-british + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListtree_mcp.cd $< CATALOG $@ + +$(TARGETDIR)/russian/NListtree_mcp.catalog: locale/russian.ct + @$(MKDIR) $(TARGETDIR)/russian + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListtree_mcp.cd $< CATALOG $@ + +$(TARGETDIR)/polish/NListtree_mcp.catalog: locale/polish.ct + @$(MKDIR) $(TARGETDIR)/polish + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListtree_mcp.cd $< CATALOG $@ + +$(TARGETDIR)/türkçe/NListtree_mcp.catalog: locale/turkish.ct + @$(MKDIR) $(TARGETDIR)/türkçe + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListtree_mcp.cd $< CATALOG $@ + +%common diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/private.h b/workbench/classes/zune/nlist/nlisttree_mcp/private.h new file mode 100644 index 0000000000..e9b5325907 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/private.h @@ -0,0 +1,67 @@ +#ifndef MUI_NLISTTREE_priv_MCP_H +#define MUI_NLISTTREE_priv_MCP_H + +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include "amiga-align.h" +#include "../nlisttree_mcc/private.h" +#include "default-align.h" + +#include "Debug.h" + +#include <mcc_common.h> + +#define MCPMAXRAWBUF 64 + +struct NListtreeP_Data +{ + Object *NLT_Sample; + Object *BT_Sample_Expand; + Object *BT_Sample_Collapse; + Object *GR_Prefs; + Object *PI_ImageClosed; + Object *PI_ImageOpen; + Object *PI_ImageFolder; + Object *PP_LinePen; + Object *PP_ShadowPen; + Object *PP_GlowPen; + Object *CY_LineType; + Object *SL_IndentWidth; + Object *CH_RememberStatus; + Object *CH_OpenAutoScroll; + Object *CH_UseFolderImage; +}; + +/// xget() +// Gets an attribute value from a MUI object +IPTR xget(Object *obj, const IPTR attr); +#if defined(__GNUC__) + // please note that we do not evaluate the return value of GetAttr() + // as some attributes (e.g. MUIA_Selected) always return FALSE, even + // when they are supported by the object. But setting b=0 right before + // the GetAttr() should catch the case when attr doesn't exist at all + #define xget(OBJ, ATTR) ({IPTR b=0; GetAttr(ATTR, OBJ, &b); b;}) +#endif +/// + +#endif /* MUI_NLISTTREE_priv_MCP_H */ diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/vastubs.c b/workbench/classes/zune/nlist/nlisttree_mcp/vastubs.c new file mode 100755 index 0000000000..6f4d38ea97 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/vastubs.c @@ -0,0 +1,45 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if !defined(__AROS__) && (defined(__VBCC__) || defined(NO_INLINE_STDARG)) +#if defined(_M68000) || defined(__M68000) || defined(__mc68000) + +#include <exec/types.h> + +/* FIX V45 breakage... */ +#if INCLUDE_VERSION < 45 +#define MY_CONST_STRPTR CONST_STRPTR +#else +#define MY_CONST_STRPTR CONST STRPTR +#endif + +#include <proto/intuition.h> + +APTR NewObject( struct IClass *classPtr, CONST_STRPTR classID, Tag tag1, ... ) +{ return NewObjectA(classPtr, classID, (struct TagItem *)&tag1); } +ULONG SetAttrs( APTR object, ULONG tag1, ... ) +{ return SetAttrsA(object, (struct TagItem *)&tag1); } + +#else + #error "VARGS stubs are only save on m68k systems!" +#endif +#endif diff --git a/workbench/classes/zune/nlist/nlisttree_mcp/version.h b/workbench/classes/zune/nlist/nlisttree_mcp/version.h new file mode 100644 index 0000000000..9311214669 --- /dev/null +++ b/workbench/classes/zune/nlist/nlisttree_mcp/version.h @@ -0,0 +1,80 @@ +/*************************************************************************** + + NListtree.mcc - New Listtree MUI Custom Class + Copyright (C) 1999-2001 by Carsten Scholling + Copyright (C) 2001-2010 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef _VERSION_H_ +#define _VERSION_H_ + +// transforms a define into a string +#define STR(x) STR2(x) +#define STR2(x) #x + +// for setting all necessary version information +#define LIB_VERSION 18 +#define LIB_REVISION 25 +#define LIB_DATE "17.12.2011" +#define LIB_COPYRIGHT "Copyright (C) 2001-2011 NList Open Source Team" + +// set the LIB_REV_STRING +#define LIB_REV_STRING STR(LIB_VERSION) "." STR(LIB_REVISION) + +// identify the system we are compiling for +#if defined(__amigaos4__) + #define SYSTEM "AmigaOS4" + #define SYSTEMSHORT "OS4" +#elif defined(__MORPHOS__) + #define SYSTEM "MorphOS" + #define SYSTEMSHORT "MOS" +#elif defined(__AROS__) + #define SYSTEM "AROS" + #define SYSTEMSHORT SYSTEM +#elif defined(__AMIGA__) + #define SYSTEM "AmigaOS3" + #define SYSTEMSHORT "OS3" +#else + #warning "Unsupported System - check SYSTEM define" + #define SYSTEM "???" + #define SYSTEMSHORT "???" +#endif + +// identify the CPU model +#if defined(__PPC__) || defined(__powerpc__) + #define CPU "PPC" +#elif defined(_M68060) || defined(__M68060) || defined(__mc68060) + #define CPU "m68060" +#elif defined(_M68040) || defined(__M68040) || defined(__mc68040) + #define CPU "m68040" +#elif defined(_M68030) || defined(__M68030) || defined(__mc68030) + #define CPU "m68030" +#elif defined(_M68020) || defined(__M68020) || defined(__mc68020) + #define CPU "m68k" +#elif defined(_M68000) || defined(__M68000) || defined(__mc68000) + #define CPU "m68000" +#elif defined(__i386__) + #define CPU "x86" +#elif defined(__x86_64__) + #define CPU "x86_64" +#else + #warning "Unsupported CPU model - check CPU define" + #define CPU "???" +#endif + +#endif // _VERSION_H_ diff --git a/workbench/classes/zune/nlist/nlistview_mcc/Debug.c b/workbench/classes/zune/nlist/nlistview_mcc/Debug.c new file mode 100644 index 0000000000..a1a4837db5 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistview_mcc/Debug.c @@ -0,0 +1,412 @@ +/*************************************************************************** + + NListview.mcc - New Listview MUI Custom Class + Registered MUI class, Serial Number: 1d51 (0x9d510020 to 0x9d51002F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifdef DEBUG + +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> +#include <stdio.h> + +#include <proto/intuition.h> +#include <proto/utility.h> +#include <proto/dos.h> +#include <proto/exec.h> + +#include "SDI_compiler.h" +#include "Debug.h" +#include "version.h" + +// special flagging macros +#define isFlagSet(v,f) (((v) & (f)) == (f)) // return TRUE if the flag is set +#define hasFlag(v,f) (((v) & (f)) != 0) // return TRUE if one of the flags in f is set in v +#define isFlagClear(v,f) (((v) & (f)) == 0) // return TRUE if flag f is not set in v +#define SET_FLAG(v,f) ((v) |= (f)) // set the flag f in v +#define CLEAR_FLAG(v,f) ((v) &= ~(f)) // clear the flag f in v +#define MASK_FLAG(v,f) ((v) &= (f)) // mask the variable v with flag f bitwise + +// our static variables with default values +static int indent_level = 0; +static BOOL ansi_output = FALSE; +static ULONG debug_flags = DBF_ALWAYS | DBF_STARTUP; // default debug flags +static ULONG debug_classes = DBC_ERROR | DBC_DEBUG | DBC_WARNING | DBC_ASSERT | DBC_REPORT; // default debug classes + +/****************************************************************************/ + +void SetupDebug(void) +{ + char var[256]; + + kprintf("** NListview.mcc v" LIB_REV_STRING " startup ***********************\n"); + kprintf("Initializing runtime debugging:\n"); + + if(GetVar("nlistview.mcc.debug", var, sizeof(var), 0) > 0) + { + char *tok; + char *debug = var; + + // static list of our debugging classes tokens. + // in the yamdebug variable these classes always start with a @ + static struct { const char *token; unsigned long flag; } dbclasses[] = + { + { "ctrace", DBC_CTRACE }, + { "report", DBC_REPORT }, + { "assert", DBC_ASSERT }, + { "timeval", DBC_TIMEVAL }, + { "debug", DBC_DEBUG }, + { "error", DBC_ERROR }, + { "warning", DBC_WARNING }, + { "all", DBC_ALL }, + { NULL, 0 } + }; + + static struct { const char *token; unsigned long flag; } dbflags[] = + { + { "always", DBF_ALWAYS }, + { "startup", DBF_STARTUP }, + { "all", DBF_ALL }, + { NULL, 0 } + }; + + // we parse the env variable token-wise + while((tok = strtok(debug, ", ;"))) + { + ULONG i; + + // check if the token is class definition or + // just a flag definition + if(tok[0] == '@') + { + // check if this call is a negation or not + if(tok[1] == '!') + { + // search for the token and clear the flag + for(i=0; dbclasses[i].token; i++) + { + if(stricmp(tok+2, dbclasses[i].token) == 0) + { + kprintf("clear '%s' debug class flag.\n", dbclasses[i].token); + CLEAR_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + else + { + // search for the token and set the flag + for(i=0; dbclasses[i].token; i++) + { + if(stricmp(tok+1, dbclasses[i].token) == 0) + { + kprintf("set '%s' debug class flag\n", dbclasses[i].token); + SET_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + } + else + { + // check if this call is a negation or not + if(tok[0] == '!') + { + for(i=0; dbflags[i].token; i++) + { + if(stricmp(tok+1, dbflags[i].token) == 0) + { + kprintf("clear '%s' debug flag\n", dbflags[i].token); + CLEAR_FLAG(debug_flags, dbflags[i].flag); + } + } + } + else + { + // check if the token was "ansi" and if so enable the ANSI color + // output + if(stricmp(tok, "ansi") == 0) + { + kprintf("ansi output enabled\n"); + ansi_output = TRUE; + } + else + { + for(i=0; dbflags[i].token; i++) + { + if(stricmp(tok, dbflags[i].token) == 0) + { + kprintf("set '%s' debug flag\n", dbflags[i].token); + SET_FLAG(debug_flags, dbflags[i].flag); + } + } + } + } + } + + debug = NULL; + } + } + + kprintf("set debug classes/flags (env:nlistview.mcc.debug): %08lx/%08lx\n", debug_classes, debug_flags); + kprintf("** Normal processing follows ***************************************\n"); +} + +/****************************************************************************/ + +void CleanupDebug(void) +{ + kprintf("** Cleaned up debugging ********************************************\n"); +} + +/****************************************************************************/ + +// define variables for using ANSI colors in our debugging scheme +#define ANSI_ESC_CLR "\033[0m" +#define ANSI_ESC_BOLD "\033[1m" +#define ANSI_ESC_UNDERLINE "\033[4m" +#define ANSI_ESC_BLINK "\033[5m" +#define ANSI_ESC_REVERSE "\033[7m" +#define ANSI_ESC_INVISIBLE "\033[8m" +#define ANSI_ESC_FG_BLACK "\033[0;30m" +#define ANSI_ESC_FG_RED "\033[0;31m" +#define ANSI_ESC_FG_GREEN "\033[0;32m" +#define ANSI_ESC_FG_BROWN "\033[0;33m" +#define ANSI_ESC_FG_BLUE "\033[0;34m" +#define ANSI_ESC_FG_PURPLE "\033[0;35m" +#define ANSI_ESC_FG_CYAN "\033[0;36m" +#define ANSI_ESC_FG_LGRAY "\033[0;37m" +#define ANSI_ESC_FG_DGRAY "\033[1;30m" +#define ANSI_ESC_FG_LRED "\033[1;31m" +#define ANSI_ESC_FG_LGREEN "\033[1;32m" +#define ANSI_ESC_FG_YELLOW "\033[1;33m" +#define ANSI_ESC_FG_LBLUE "\033[1;34m" +#define ANSI_ESC_FG_LPURPLE "\033[1;35m" +#define ANSI_ESC_FG_LCYAN "\033[1;36m" +#define ANSI_ESC_FG_WHITE "\033[1;37m" +#define ANSI_ESC_BG "\033[0;4" // background esc-squ start with 4x +#define ANSI_ESC_BG_BLACK "\033[0;40m" +#define ANSI_ESC_BG_RED "\033[0;41m" +#define ANSI_ESC_BG_GREEN "\033[0;42m" +#define ANSI_ESC_BG_BROWN "\033[0;43m" +#define ANSI_ESC_BG_BLUE "\033[0;44m" +#define ANSI_ESC_BG_PURPLE "\033[0;45m" +#define ANSI_ESC_BG_CYAN "\033[0;46m" +#define ANSI_ESC_BG_LGRAY "\033[0;47m" + +/****************************************************************************/ + +INLINE void _INDENT(void) +{ + int i; + for(i=0; i < indent_level; i++) + kprintf(" "); +} + +/****************************************************************************/ + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function) +{ + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Entering %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Entering %s\n", file, line, function); + } + + indent_level++; +} + +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function) +{ + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s\n", file, line, function); + } +} + +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result) +{ + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s (result 0x%08lx, %ld)%s\n", ANSI_ESC_FG_BROWN, file, line, function, result, result, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s (result 0x%08lx, %ld)\n", file, line, function, result, result); + } +} + +/****************************************************************************/ + +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + switch(size) + { + case 1: + fmt = "%s:%ld:%s = %ld, 0x%02lx"; + break; + + case 2: + fmt = "%s:%ld:%s = %ld, 0x%04lx"; + break; + + default: + fmt = "%s:%ld:%s = %ld, 0x%08lx"; + break; + } + + _INDENT(); + + if(ansi_output) + kprintf(ANSI_ESC_FG_GREEN); + + kprintf(fmt, file, line, name, value, value); + + if(size == 1 && value < 256) + { + if(value < ' ' || (value >= 127 && value < 160)) + kprintf(", '\\x%02lx'", value); + else + kprintf(", '%lc'", value); + } + + if(ansi_output) + kprintf("%s\n", ANSI_ESC_CLR); + else + kprintf("\n"); + } +} + +/****************************************************************************/ + +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + _INDENT(); + + if(p != NULL) + fmt = "%s:%ld:%s = 0x%08lx\n"; + else + fmt = "%s:%ld:%s = NULL\n"; + + if(ansi_output) + { + kprintf(ANSI_ESC_FG_GREEN); + kprintf(fmt, file, line, name, p); + kprintf(ANSI_ESC_CLR); + } + else + kprintf(fmt, file, line, name, p); + } +} + +/****************************************************************************/ + +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s = 0x%08lx \"%s\"%s\n", ANSI_ESC_FG_GREEN, file, line, name, string, string, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s = 0x%08lx \"%s\"\n", file, line, name, string, string); + } +} + +/****************************************************************************/ + +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s%s\n", ANSI_ESC_FG_GREEN, file, line, msg, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s\n", file, line, msg); + } +} + +/****************************************************************************/ + +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...) +{ + if((isFlagSet(debug_classes, dclass) && isFlagSet(debug_flags, dflags)) || + (isFlagSet(dclass, DBC_ERROR) || isFlagSet(dclass, DBC_WARNING))) + { + va_list args; + static char buf[1024]; + + _INDENT(); + + va_start(args, format); + vsnprintf(buf, 1024, format, args); + va_end(args); + + if(ansi_output) + { + const char *highlight = ANSI_ESC_FG_GREEN; + + switch(dclass) + { + case DBC_CTRACE: highlight = ANSI_ESC_FG_BROWN; break; + case DBC_REPORT: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ASSERT: highlight = ANSI_ESC_FG_RED; break; + case DBC_TIMEVAL: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_DEBUG: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ERROR: highlight = ANSI_ESC_FG_RED; break; + case DBC_WARNING: highlight = ANSI_ESC_FG_PURPLE;break; + } + + kprintf("%s%s:%ld:%s%s\n", highlight, file, line, buf, ANSI_ESC_CLR); + } + else + kprintf("%s:%ld:%s\n", file, line, buf); + } +} + +/****************************************************************************/ + +#endif diff --git a/workbench/classes/zune/nlist/nlistview_mcc/Debug.h b/workbench/classes/zune/nlist/nlistview_mcc/Debug.h new file mode 100644 index 0000000000..cb91379722 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistview_mcc/Debug.h @@ -0,0 +1,139 @@ +/*************************************************************************** + + TextEditor.mcc - Textediting MUI Custom Class + Copyright (C) 1997-2000 Allan Odgaard + Copyright (C) 2005 by TextEditor.mcc Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + TextEditor class Support Site: http://www.sf.net/projects/texteditor-mcc + + $Id$ + +***************************************************************************/ + +#ifndef DEBUG_H +#define DEBUG_H + +// first we make sure all previously defined symbols are undefined now so +// that no other debug system interferes with ours. +#undef ENTER +#undef LEAVE +#undef RETURN +#undef SHOWVALUE +#undef SHOWPOINTER +#undef SHOWSTRING +#undef SHOWMSG +#undef STARTCLOCK +#undef STOPCLOCK +#undef D +#undef E +#undef W +#undef ASSERT + +#if defined(DEBUG) + +#include <assert.h> + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +#if defined(__amigaos4__) + #include <proto/exec.h> + #ifdef __USE_INLINE__ + #ifdef DebugPrintF + #undef DebugPrintF + #endif + #endif + #ifndef kprintf + #define kprintf(format, args...) ((struct ExecIFace *)((*(struct ExecBase **)4)->MainInterface))->DebugPrintF(format, ## args) + #endif +#elif defined(__MORPHOS__) + #include <exec/rawfmt.h> + #include <proto/exec.h> + #define KPutFmt(format, args) VNewRawDoFmt(format, (APTR)RAWFMTFUNC_SERIAL, NULL, args) +void kprintf(const char *formatString,...); +#else +void kprintf(const char *formatString,...); +#endif + +// debug classes +#define DBC_CTRACE (1<<0) // call tracing (ENTER/LEAVE etc.) +#define DBC_REPORT (1<<1) // reports (SHOWVALUE/SHOWSTRING etc.) +#define DBC_ASSERT (1<<2) // asserts (ASSERT) +#define DBC_TIMEVAL (1<<3) // time evaluations (STARTCLOCK/STOPCLOCK) +#define DBC_DEBUG (1<<4) // debugging output D() +#define DBC_ERROR (1<<5) // error output E() +#define DBC_WARNING (1<<6) // warning output W() +#define DBC_ALL 0xffffffff + +// debug flags +#define DBF_ALWAYS (1<<0) +#define DBF_STARTUP (1<<1) // for startup/shutdown events (YAM.c) +#define DBF_ALL 0xffffffff + +void SetupDebug(void); +void CleanupDebug(void); + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function); +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function); +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result); +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line); +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line); +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line); +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line); +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...); + +// Core class information class messages +#define ENTER() _ENTER(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define LEAVE() _LEAVE(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define RETURN(r) _RETURN(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__, (long)r) +#define SHOWVALUE(f, v) _SHOWVALUE(DBC_REPORT, f, (long)v, sizeof(v), #v, __FILE__, __LINE__) +#define SHOWPOINTER(f, p) _SHOWPOINTER(DBC_REPORT, f, p, #p, __FILE__, __LINE__) +#define SHOWSTRING(f, s) _SHOWSTRING(DBC_REPORT, f, s, #s, __FILE__, __LINE__) +#define SHOWMSG(f, m) _SHOWMSG(DBC_REPORT, f, m, __FILE__, __LINE__) +#define D(f, s, vargs...) _DPRINTF(DBC_DEBUG, f, __FILE__, __LINE__, s, ## vargs) +#define E(f, s, vargs...) _DPRINTF(DBC_ERROR, f, __FILE__, __LINE__, s, ## vargs) +#define W(f, s, vargs...) _DPRINTF(DBC_WARNING, f, __FILE__, __LINE__, s, ## vargs) +#define ASSERT(expression) \ + ((void) \ + ((expression) ? 0 : \ + ( \ + _DPRINTF(DBC_ASSERT, \ + DBF_ALWAYS, \ + __FILE__, \ + __LINE__, \ + "failed assertion '%s'", \ + #expression), \ + assert(#expression), \ + 0 \ + ) \ + ) \ + ) + +#else // DEBUG + +#define ENTER() ((void)0) +#define LEAVE() ((void)0) +#define RETURN(r) ((void)0) +#define SHOWVALUE(f, v) ((void)0) +#define SHOWPOINTER(f, p) ((void)0) +#define SHOWSTRING(f, s) ((void)0) +#define SHOWMSG(f, m) ((void)0) +#define D(f, s, vargs...) ((void)0) +#define E(f, s, vargs...) ((void)0) +#define W(f, s, vargs...) ((void)0) +#define ASSERT(expression) ((void)0) + +#endif // DEBUG + +#endif // DEBUG_H diff --git a/workbench/classes/zune/nlist/nlistview_mcc/Makefile b/workbench/classes/zune/nlist/nlistview_mcc/Makefile new file mode 100644 index 0000000000..a02eda5316 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistview_mcc/Makefile @@ -0,0 +1,426 @@ +#/*************************************************************************** +# +# NListview.mcc - New Listview MUI Custom Class +# Registered MUI class, Serial Number: 1d51 (0x9d510020 to 0x9d51002F) +# +# Copyright (C) 1996-2001 by Gilles Masson +# Copyright (C) 2001-2005 by NList Open Source Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# NList classes Support Site: http://www.sf.net/projects/nlist-classes +# +# $Id$ +# +#***************************************************************************/ + +########################################################################### +# This makefile is a very generic one. It tries to identify both, the host +# and the target operating system for which YAM should be compiled. +# However, this auto-detection can be easily overridden by directly +# specifying an option on the commandline while calling 'make'. +# +# Example: +# +# # to explicitly compile for AmigaOS3 +# > make OS=os3 +# +# # to compile for AmigaOS4 but with debugging +# > make OS=os4 DEBUG= +# + +############################################# +# find out the HOST operating system +# on which this makefile is run +HOST ?= $(shell uname) +ifeq ($(HOST), AmigaOS) + ifeq ($(shell uname -m), powerpc) + HOST = AmigaOS4 + endif + ifeq ($(shell uname -m), ppc) + HOST = AmigaOS4 + endif +endif + +# if no host is identifed (no uname tool) +# we assume a AmigaOS build +ifeq ($(HOST),) + HOST = AmigaOS +endif + +############################################# +# now we find out the target OS for +# which we are going to compile YAM in case +# the caller didn't yet define OS himself +ifndef (OS) + ifeq ($(HOST), AmigaOS4) + OS = os4 + else + ifeq ($(HOST), AmigaOS) + OS = os3 + else + ifeq ($(HOST), MorphOS) + OS = mos + else + ifeq ($(HOST), AROS) + # now we find out which CPU system aros will be used + ifeq ($(shell uname -m), powerpc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), ppc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), i386) + OS = aros-i386 + endif + ifeq ($(shell uname -m), i686) + OS = aros-i686 + endif + ifeq ($(shell uname -m), x86_64) + OS = aros-x86_64 + endif + else + OS = os4 + endif + endif + endif + endif +endif + +############################################# +# define common commands we use in this +# makefile. Please note that each of them +# might be overridden on the commandline. + +# common commands +FLEX = flex +FC = flexcat +EXPR = expr +DATE = date +RM = rm -f #delete force +RMDIR = rm -rf #delete force all +MKDIR = mkdir -p #makedir force +CHMOD = protect FLAGS=rwed +SED = sed +CP = copy +CC = gcc +STRIP = strip +OBJDUMP = objdump + +# path definitions +CDUP = / +CDTHIS= + +# override some variables for non-native builds (cross-compiler) +ifneq ($(HOST), AmigaOS) +ifneq ($(HOST), AmigaOS4) +ifneq ($(HOST), MorphOS) + + # when we end up here this is either a unix or Aros host + # so lets use unix kind of commands + RM = rm -f + RMDIR = rm -rf + MKDIR = mkdir -p + CHMOD = chmod 755 + CP = cp -f + + CDUP = ../ + CDTHIS= ./ + +endif +endif +endif + +########################################################################### +# CPU and DEBUG can be defined outside, defaults to above +# using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug +# PPC-603e version +# +# OPTFLAGS are disabled by DEBUG normally! +# +# ignored warnings are: +# none - because we want to compile with -Wall all the time + +# Common Directories +PREFIX = $(CDTHIS) +OBJDIR = .obj_$(OS) +BINDIR = bin_$(OS) +VPATH = $(OBJDIR) +DEPFILE = Makefile.dep +DESTDIR = MUI:Libs/MUI + +# target definition +TARGET = $(BINDIR)/NListview.mcc +TESTTARGET= $(BINDIR)/NListview-Test + +# Common compiler/linker flags +WARN = -W -Wall -Wwrite-strings -Wpointer-arith -Wsign-compare +OPTFLAGS = -O3 -fomit-frame-pointer -funroll-loops +DEBUG = -DDEBUG -O0 +DEBUGSYM = -g -gstabs +CFLAGS = -I. -I../nlistviews_mcp -I../include $(CPU) $(WARN) \ + $(OPTFLAGS) $(DEBUG) $(DEBUGSYM) $(USER_CFLAGS) -c +LDFLAGS = $(CPU) $(DEBUGSYM) +LDLIBS = + +########################################################################### +# object files definition +# + +LOBJS = library.o + +COBJS = NListview.o \ + Debug.o + +TOBJS = #NListview-Test.o + +MCCOBJS = $(addprefix $(OBJDIR)/,$(LOBJS)) $(addprefix $(OBJDIR)/,$(COBJS)) +TESTOBJS = $(addprefix $(OBJDIR)/,$(COBJS)) $(addprefix $(OBJDIR)/,$(TOBJS)) + +# different options per target OS +ifeq ($(OS), os4) + + ############################## + # AmigaOS4 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS4) + CC = ppc-amigaos-gcc + STRIP = ppc-amigaos-strip + OBJDUMP = ppc-amigaos-objdump + endif + + # Compiler/Linker flags + CRT = newlib + CPU = -mcpu=powerpc + WARN += -Wdeclaration-after-statement -Wdisabled-optimization + CFLAGS += -mcrt=$(CRT) -D__USE_INLINE__ -D__NEW_TIMEVAL_DEFINITION_USED__ \ + -DNO_PPCINLINE_STDARG -Wa,-mregnames + LDFLAGS += -mcrt=$(CRT) + + # additional object files required + M68KSTUBS = $(OBJDIR)/mccclass_68k.o + +else +ifeq ($(OS), os3) + + ############################## + # AmigaOS3 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS) + CC = m68k-amigaos-gcc + STRIP = m68k-amigaos-strip + OBJDUMP = m68k-amigaos-objdump + endif + + # Compiler/Linker flags + CPU = -m68020-60 -msoft-float + CFLAGS += -noixemul -DNO_INLINE_STDARG -D__amigaos3__ + LDFLAGS += -noixemul + LDLIBS += -ldebug -lmui + + # additional object files required + COBJS += vastubs.o + +else +ifeq ($(OS), mos) + + ############################## + # MorphOS + + # Compiler/link/strip commands + ifneq ($(HOST), MorphOS) + CC = ppc-morphos-gcc + STRIP = ppc-morphos-strip + OBJDUMP = ppc-morphos-objdump + endif + + # Compiler/Linker flags + CPU = -mcpu=powerpc + CFLAGS += -noixemul -DNO_PPCINLINE_STDARG + LDFLAGS += -noixemul + LDLIBS += -ldebug + +else +ifeq ($(OS), aros-i386) + + ############################## + # AROS (i386) + + ifneq ($(HOST), AROS) + CC = i386-aros-gcc + STRIP = i386-aros-strip + OBJDUMP = i386-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-ppc) + + ############################## + # AROS (PPC) + + ifneq ($(HOST), AROS) + CC = ppc-aros-gcc + STRIP = ppc-aros-strip + OBJDUMP = ppc-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-x86_64) + + ############################## + # AROS (x86_64) + + ifneq ($(HOST), AROS) + CC = x86_64-aros-gcc + STRIP = x86_64-aros-strip + OBJDUMP = x86_64-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign + LDLIBS += -larossupport -lrom -lmui + +endif +endif +endif +endif +endif +endif + +# main target +.PHONY: all +ifeq ($(wildcard $(DEPFILE)),$(DEPFILE)) +# great, we have a dependecies file, let's make our target +all: $(BINDIR) $(OBJDIR) $(M68KSTUBS) $(TARGET) #$(TESTTARGET) +else +# no dependecies, create it and then call make again +all: depend + @make --no-print-directory all +endif + +# for making a release we compile ALL target with no debug +release: + @echo " CC $<" + make OS=os4 clean + make OS=os4 DEBUG= + @echo " CC $<" + make OS=os3 clean + make OS=os3 DEBUG= + @echo " CC $<" + make OS=mos clean + make OS=mos DEBUG= + @echo " CC $<" + make OS=aros-i386 clean + make OS=aros-i386 DEBUG= + @echo " CC $<" + make OS=aros-ppc clean + make OS=aros-ppc DEBUG= + @echo " CC $<" + make OS=aros-x86_64 clean + make OS=aros-x86_64 DEBUG= + +# make the object directories +$(OBJDIR): + @echo " MK $@" + @$(MKDIR) $(OBJDIR) + +# make the binary directories +$(BINDIR): + @echo " MK $@" + @$(MKDIR) $(BINDIR) + +# for compiling single .c files +$(OBJDIR)/%.o: %.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +$(OBJDIR)/mccclass_68k.o: ../include/mccclass_68k.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +# for linking the target +$(TARGET): $(M68KSTUBS) $(MCCOBJS) + @echo " LD $@.debug" + @$(CC) -nostartfiles $(LDFLAGS) -o $@.debug $(MCCOBJS) $(M68KSTUBS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +# for linking the target +$(TESTTARGET): $(TESTOBJS) + @echo " LD $@.debug" + @$(CC) $(LDFLAGS) -o $@.debug $(TESTOBJS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +.PHONY: dump +dump: + -$(OBJDUMP) --section-headers --all-headers --reloc --disassemble-all $(TARGET) >$(TARGET).dump + +.PHONY: clean +clean: + -$(RM) $(TARGET) $(TARGET).debug $(TARGET).map + -$(RM) $(TESTTARGET) $(TESTTARGET).debug $(TESTTARGET).map + -$(RM) $(MCCOBJS) $(TESTOBJS) $(M68KSTUBS) + +.PHONY: distclean +distclean: clean + -$(RMDIR) $(OBJDIR) + -$(RMDIR) $(BINDIR) + +# install +.PHONY: install +install: all + @echo " IN $(TARGET)" + @$(CP) $(TARGET) $(DESTDIR) + +.PHONY: help +help: + @echo "Cleaning targets:" + @echo " clean - Cleanup working directory for clean compile" + @echo " distclean - Also cleanup autogenerated files" + @echo "" + @echo "Other generic targets:" + @echo " all - Build $(TARGET)" + @echo " catalogs - Build all available catalogs" + @echo "" + @echo "Install targets:" + @echo " install - Install $(TARGET) into $(DESTDIR)" + @echo "" + @echo "Parameters:" + @echo " make OS=os3|os4|mos|aros-i386|aros-i686|aros-ppc|aros-x86_64" + @echo " make DEBUG= : build $(TARGET) without debugging information" + @echo "" + +## DEPENDENCY GENERATION ############## + +.PHONY: depend +depend: + @echo " MK $(DEPFILE)" + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >$(DEPFILE) + @$(CC) -MM -MG $(CFLAGS) $(wildcard *.c) >>$(DEPFILE) + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >>$(DEPFILE) + @$(SED) -i 's,^\(.*\)\.o:,$$\(OBJDIR\)/\1.o:,g' $(DEPFILE) + +# include dependencies file +-include $(DEPFILE) diff --git a/workbench/classes/zune/nlist/nlistview_mcc/Makefile.dep b/workbench/classes/zune/nlist/nlistview_mcc/Makefile.dep new file mode 100644 index 0000000000..12fb68383f --- /dev/null +++ b/workbench/classes/zune/nlist/nlistview_mcc/Makefile.dep @@ -0,0 +1,18 @@ +# AUTOGENERATED! DO NOT EDIT!!! +$(OBJDIR)/Debug.o: Debug.c ../include/SDI_compiler.h Debug.h version.h +$(OBJDIR)/library.o: library.c private.h ../include/amiga-align.h NListview_mcc.h \ + ../include/libraries/mui.h ../include/mui/NList_mcc.h \ + ../include/default-align.h Debug.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h version.h ../include/mccinit.c \ + ../include/proto/muimaster.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h +$(OBJDIR)/NListview.o: NListview.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/amiga-align.h \ + NListview_mcc.h ../include/mui/NList_mcc.h ../include/default-align.h \ + Debug.h ../include/mcc_common.h ../include/SDI_compiler.h \ + ../include/SDI_hook.h ../include/SDI_lib.h ../include/SDI_stdarg.h \ + version.h ../nlistviews_mcp/NListviews_mcp.h ../include/muiextra.h +$(OBJDIR)/vastubs.o: vastubs.c +# AUTOGENERATED! DO NOT EDIT!!! diff --git a/workbench/classes/zune/nlist/nlistview_mcc/NListview.c b/workbench/classes/zune/nlist/nlistview_mcc/NListview.c new file mode 100644 index 0000000000..c9a80059ba --- /dev/null +++ b/workbench/classes/zune/nlist/nlistview_mcc/NListview.c @@ -0,0 +1,944 @@ +/*************************************************************************** + + NListview.mcc - New Listview MUI Custom Class + Registered MUI class, Serial Number: 1d51 (0x9d510020 to 0x9d51002F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <string.h> + +#include <clib/alib_protos.h> +#include <proto/muimaster.h> +#include <proto/intuition.h> +#include <proto/utility.h> +#include <proto/keymap.h> + +#include "private.h" +#include "version.h" + +#include "NListviews_mcp.h" + +#include "muiextra.h" + +#include "Debug.h" + +#ifndef MUI_EHF_GUIMODE +#define MUI_EHF_GUIMODE (1<<1) /* set this if you dont want your handler to be called */ + /* when your object is disabled or invisible */ +#endif + +static LONG IMsgToChar(struct IntuiMessage *imsg, ULONG dccode, ULONG dcquali) +{ + struct InputEvent ie; + LONG key = -1; + + ENTER(); + + memset(&ie, 0, sizeof(struct InputEvent)); + ie.ie_Class = IECLASS_RAWKEY; + + if(imsg->Class == IDCMP_RAWKEY) + { + TEXT buf[4]; + + ie.ie_Code = imsg->Code & ~dccode; + ie.ie_Qualifier = imsg->Qualifier & ~dcquali; + ie.ie_EventAddress = (APTR *)*((IPTR *)imsg->IAddress); + + #if defined(__amigaos4__) + ie.ie_TimeStamp.Seconds = imsg->Seconds; + ie.ie_TimeStamp.Microseconds = imsg->Micros; + #else + ie.ie_TimeStamp.tv_secs = imsg->Seconds; + ie.ie_TimeStamp.tv_micro = imsg->Micros; + #endif + + if(MapRawKey(&ie, buf , 3, 0) > 0) + key = (LONG)buf[0]; + } + + RETURN(key); + return key; +} + +static IPTR mNLV_HandleEvent(struct IClass *cl, Object *obj, struct MUIP_HandleEvent *msg) +{ + struct NLVData *data = INST_DATA(cl, obj); + struct IntuiMessage *imsg = msg->imsg; + IPTR result = 0; + + ENTER(); + + if(data->LI_NList != NULL) + { + #if !defined(__amigaos4__) && !defined(__MORPHOS__) && !defined(__AROS__) + // with MUI 3.8 the embedded list object doesn't get this method, + // hence we must forward it ourself. + if(MUIMasterBase != NULL && MUIMasterBase->lib_Version <= 19 && msg->muikey != MUIKEY_NONE) + { + result = DoMethodA(data->LI_NList, (Msg)msg); + } + #endif + if(imsg != NULL) + { + switch(imsg->Class) + { + case IDCMP_RAWKEY: + { + if(data->ControlChar != '\0' && IMsgToChar(imsg, 0, (IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT)) == data->ControlChar) + { + set(data->LI_NList, MUIA_NList_Active, imsg->Qualifier & (IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT) ? MUIV_NList_Active_Up: MUIV_NList_Active_Down); + } + } + break; + } + } + } + + RETURN(result); + return result; +} + +static IPTR mNLV_HandleInput(struct IClass *cl, Object *obj, struct MUIP_HandleInput *msg) +{ + struct NLVData *data = INST_DATA(cl, obj); + IPTR result = 0; + + ENTER(); + + if(data->LI_NList != NULL && msg->muikey != MUIKEY_NONE) + result = DoMethodA(data->LI_NList, (Msg)msg); + else + result = DoSuperMethodA(cl, obj, (Msg)msg); + + RETURN(result); + return result; +} + +static void AddVerticalScroller(Object *obj, struct NLVData *data) +{ + ENTER(); + + if(data->Vert_Attached == FALSE) + { + D(DBF_STARTUP, "adding vertical scrollbar"); + + DoMethod(obj, OM_ADDMEMBER, data->PR_Vert); + + // add notifications + DoMethod(data->LI_NList, MUIM_Notify, MUIA_NList_Prop_Entries, MUIV_EveryTime, data->PR_Vert, 3, MUIM_NoNotifySet, MUIA_Prop_Entries, MUIV_TriggerValue); + DoMethod(data->LI_NList, MUIM_Notify, MUIA_NList_Prop_Visible, MUIV_EveryTime, data->PR_Vert, 3, MUIM_NoNotifySet, MUIA_Prop_Visible, MUIV_TriggerValue); + DoMethod(data->LI_NList, MUIM_Notify, MUIA_NList_Prop_First, MUIV_EveryTime, data->PR_Vert, 3, MUIM_NoNotifySet, MUIA_Prop_First, MUIV_TriggerValue); + DoMethod(data->PR_Vert, MUIM_Notify, MUIA_Prop_First, MUIV_EveryTime, data->LI_NList, 3, MUIM_NoNotifySet, MUIA_NList_Prop_First, MUIV_TriggerValue); + DoMethod(data->LI_NList, MUIM_Notify, MUIA_NList_VertDeltaFactor, MUIV_EveryTime, data->PR_Vert, 3, MUIM_NoNotifySet, MUIA_Prop_DeltaFactor, MUIV_TriggerValue); + + data->Vert_Attached = TRUE; + + D(DBF_STARTUP, "vertical scrollbar added"); + } + + LEAVE(); +} + +static void RemoveVerticalScroller(Object *obj, struct NLVData *data) +{ + ENTER(); + + if(data->Vert_Attached == TRUE) + { + D(DBF_STARTUP, "removing vertical scrollbar"); + +/* + // remove notifications + DoMethod(data->LI_NList, MUIM_KillNotifyObj, MUIA_NList_Prop_Entries, data->PR_Vert); + DoMethod(data->LI_NList, MUIM_KillNotifyObj, MUIA_NList_Prop_Visible, data->PR_Vert); + DoMethod(data->LI_NList, MUIM_KillNotifyObj, MUIA_NList_Prop_First, data->PR_Vert); +*/ + DoMethod(data->PR_Vert, MUIM_KillNotifyObj, MUIA_Prop_First, data->LI_NList); +/* + DoMethod(data->LI_NList, MUIM_KillNotifyObj, MUIA_NList_VertDeltaFactor, data->PR_Vert); +*/ + + DoMethod(obj, OM_REMMEMBER, data->PR_Vert); + + data->Vert_Attached = FALSE; + + D(DBF_STARTUP, "vertical scrollbar removed"); + } + + LEAVE(); +} + +static void AddHorizontalScroller(Object *obj, struct NLVData *data) +{ + ENTER(); + + if(data->Horiz_Attached == FALSE) + { + D(DBF_STARTUP, "adding horizontal scrollbar"); + + DoMethod(obj, OM_ADDMEMBER, data->PR_Horiz); + + // add notifications + DoMethod(data->LI_NList, MUIM_Notify, MUIA_NList_Horiz_Entries, MUIV_EveryTime, data->PR_Horiz, 3, MUIM_NoNotifySet, MUIA_Prop_Entries, MUIV_TriggerValue); + DoMethod(data->LI_NList, MUIM_Notify, MUIA_NList_Horiz_Visible, MUIV_EveryTime, data->PR_Horiz, 3, MUIM_NoNotifySet, MUIA_Prop_Visible, MUIV_TriggerValue); + DoMethod(data->LI_NList, MUIM_Notify, MUIA_NList_Horiz_First, MUIV_EveryTime, data->PR_Horiz, 3, MUIM_NoNotifySet, MUIA_Prop_First, MUIV_TriggerValue); + DoMethod(data->PR_Horiz, MUIM_Notify, MUIA_Prop_First, MUIV_EveryTime, data->LI_NList, 3, MUIM_NoNotifySet, MUIA_NList_Horiz_First, MUIV_TriggerValue); + DoMethod(data->LI_NList, MUIM_Notify, MUIA_NList_HorizDeltaFactor, MUIV_EveryTime, data->PR_Horiz, 3, MUIM_NoNotifySet, MUIA_Prop_DeltaFactor, MUIV_TriggerValue); + + data->Horiz_Attached = TRUE; + + D(DBF_STARTUP, "horizontal scrollbar added"); + } + + LEAVE(); +} + +static void RemoveHorizontalScroller(Object *obj, struct NLVData *data) +{ + ENTER(); + + if(data->Horiz_Attached == TRUE) + { + D(DBF_STARTUP, "removing horizontal scrollbar"); + +/* + // remove notifications + DoMethod(data->LI_NList, MUIM_KillNotifyObj, MUIA_NList_Horiz_Entries, data->PR_Horiz); + DoMethod(data->LI_NList, MUIM_KillNotifyObj, MUIA_NList_Horiz_Visible, data->PR_Horiz); + DoMethod(data->LI_NList, MUIM_KillNotifyObj, MUIA_NList_Horiz_First, data->PR_Horiz); +*/ + DoMethod(data->PR_Horiz, MUIM_KillNotifyObj, MUIA_Prop_First, data->LI_NList); +/* + DoMethod(data->LI_NList, MUIM_KillNotifyObj, MUIA_NList_HorizDeltaFactor, data->PR_Horiz); +*/ + + DoMethod(obj, OM_REMMEMBER, data->PR_Horiz); + + data->Horiz_Attached = FALSE; + + D(DBF_STARTUP, "horizontal scrollbar removed"); + } + + LEAVE(); +} + +static void NLV_Scrollers(Object *obj, struct NLVData *data, LONG vert, LONG horiz) +{ + LONG scrollers = 0; + + ENTER(); + + if(vert & 0x0F) + { + data->Vert_ScrollBar = vert & 0x0F; + + if(data->Vert_ScrollBar == MUIV_NListview_VSB_Default) + { + LONG *scrollbar; + + if(DoMethod(obj, MUIM_GetConfigItem, MUICFG_NListview_VSB, (IPTR)&scrollbar)) + data->VertSB = *scrollbar; + else + data->VertSB = MUIV_NListview_VSB_Always; + } + else + data->VertSB = data->Vert_ScrollBar; + + switch(data->VertSB) + { + case MUIV_NListview_VSB_Always: + case MUIV_NListview_VSB_Left: + { + scrollers |= MUIV_NListview_VSB_On; + } + break; + + case MUIV_NListview_VSB_Auto: + case MUIV_NListview_VSB_FullAuto: + { + // nothing + } + break; + + case MUIV_NListview_VSB_None: + { + scrollers |= MUIV_NListview_VSB_Off; + } + break; + } + } + + if(horiz & 0x0F) + { + data->Horiz_ScrollBar = horiz & 0x0F; + + if(data->Horiz_ScrollBar == MUIV_NListview_HSB_Default) + { + LONG *scrollbar; + + if(DoMethod(obj, MUIM_GetConfigItem, MUICFG_NListview_HSB, (IPTR)&scrollbar)) + data->HorizSB = *scrollbar; + else + data->HorizSB = DEFAULT_HSB; + } + else + data->HorizSB = data->Horiz_ScrollBar; + + switch (data->HorizSB) + { + case MUIV_NListview_HSB_Always: + { + scrollers |= MUIV_NListview_HSB_On; + } + break; + + case MUIV_NListview_HSB_Auto: + case MUIV_NListview_HSB_FullAuto: + { + // nothing + } + break; + + case MUIV_NListview_HSB_None: + { + scrollers |= MUIV_NListview_HSB_Off; + } + break; + } + } + + scrollers |= ((vert | horiz) & (MUIV_NListview_VSB_On | MUIV_NListview_HSB_On)); + + if(((data->VertSB == MUIV_NListview_VSB_Auto || data->VertSB == MUIV_NListview_VSB_Always) && (scrollers & MUIV_NListview_VSB_On) == MUIV_NListview_VSB_Off) || + (data->VertSB == MUIV_NListview_VSB_None && (scrollers & MUIV_NListview_VSB_On) == MUIV_NListview_VSB_On) || + (data->Vert_Attached == TRUE && (scrollers & MUIV_NListview_VSB_On) == MUIV_NListview_VSB_On) || + (data->Vert_Attached == FALSE && (scrollers & MUIV_NListview_VSB_On) == MUIV_NListview_VSB_Off)) + { + scrollers &= ~MUIV_NListview_VSB_On; + } + + if(((data->HorizSB == MUIV_NListview_HSB_Auto || data->HorizSB == MUIV_NListview_HSB_Always) && (scrollers & MUIV_NListview_HSB_On) == MUIV_NListview_HSB_Off) || + (data->HorizSB == MUIV_NListview_HSB_None && (scrollers & MUIV_NListview_HSB_On) == MUIV_NListview_HSB_On) || + (data->Horiz_Attached == TRUE && (scrollers & MUIV_NListview_HSB_On) == MUIV_NListview_HSB_On) || + (data->Horiz_Attached == FALSE && (scrollers & MUIV_NListview_HSB_On) == MUIV_NListview_HSB_Off)) + { + scrollers &= ~MUIV_NListview_HSB_On; + } + + if(scrollers & MUIV_NListview_VSB_On) + { + if(data->SETUP == FALSE || DoMethod(obj, MUIM_Group_InitChange)) + { + if((scrollers & MUIV_NListview_VSB_On) == MUIV_NListview_VSB_On) + { + AddVerticalScroller(obj, data); + if(data->VertSB == MUIV_NListview_VSB_Left) + DoMethod(obj, MUIM_Group_Sort, data->PR_Vert, data->Group, NULL); + } + else + { + RemoveVerticalScroller(obj, data); + } + + if(scrollers & MUIV_NListview_HSB_On) + { + if(data->SETUP == FALSE || DoMethod(data->Group, MUIM_Group_InitChange)) + { + if((scrollers & MUIV_NListview_HSB_On) == MUIV_NListview_HSB_On) + AddHorizontalScroller(data->Group, data); + else + RemoveHorizontalScroller(data->Group, data); + + if(data->SETUP == TRUE) + DoMethod(data->Group, MUIM_Group_ExitChange); + } + } + + if(data->SETUP == TRUE) + DoMethod(obj, MUIM_Group_ExitChange); + } + } + else if(scrollers & MUIV_NListview_HSB_On) + { + if(data->SETUP == FALSE || DoMethod(data->Group, MUIM_Group_InitChange)) + { + if((scrollers & MUIV_NListview_HSB_On) == MUIV_NListview_HSB_On) + AddHorizontalScroller(data->Group, data); + else + RemoveHorizontalScroller(data->Group, data); + + if(data->SETUP == TRUE) + DoMethod(data->Group, MUIM_Group_ExitChange); + } + } + + LEAVE(); +} + +#if !defined(__MORPHOS__) +#ifdef __AROS__ +static __attribute__ ((noinline)) Object * VARARGS68K DoSuperNew(struct IClass *cl, Object *obj, Tag tag1, ...) +{ + AROS_SLOWSTACKTAGS_PRE_AS(tag1, Object *) + retval = (Object *)DoSuperMethod(cl, obj, OM_NEW, AROS_SLOWSTACKTAGS_ARG(tag1), NULL); + AROS_SLOWSTACKTAGS_POST +} +#else +static Object * VARARGS68K DoSuperNew(struct IClass *cl, Object *obj, ...) +{ + Object *rc; + VA_LIST args; + + ENTER(); + + VA_START(args, obj); + rc = (Object *)DoSuperMethod(cl, obj, OM_NEW, VA_ARG(args, ULONG), NULL); + VA_END(args); + + RETURN(rc); + return rc; +} +#endif +#endif // !__MORPHOS__ + +/* static ULONG mNLV_New(struct IClass *cl,Object *obj,Msg msg) */ +static IPTR mNLV_New(struct IClass *cl, Object *obj, struct opSet *msg) +{ + struct NLVData *data; + struct TagItem *tag; + Object *nlist = NULL; + Object *vgroup = NULL; + BOOL cyclechain = FALSE; + BOOL dropable = FALSE; + + ENTER(); + + if((tag = FindTagItem(MUIA_Draggable, msg->ops_AttrList)) != NULL) + tag->ti_Tag = TAG_IGNORE; + + if((tag = FindTagItem(MUIA_Dropable, msg->ops_AttrList)) != NULL) + { + tag->ti_Tag = TAG_IGNORE; + dropable = tag->ti_Data; + } + + if((tag = FindTagItem(MUIA_CycleChain, msg->ops_AttrList)) != NULL) + { + tag->ti_Tag = TAG_IGNORE; + cyclechain = tag->ti_Data; + } + + if((tag = FindTagItem(MUIA_NListview_NList, msg->ops_AttrList)) != NULL || + (tag = FindTagItem(MUIA_Listview_List, msg->ops_AttrList)) != NULL) + { + nlist = (Object *) tag->ti_Data; + + if(nlist != NULL) + { + if(dropable) + { + nnset(nlist,MUIA_Dropable, dropable); + } + + if((tag = FindTagItem(MUIA_NList_DragType, msg->ops_AttrList)) != NULL || + (tag = FindTagItem(MUIA_Listview_DragType, msg->ops_AttrList)) != NULL) + { + nnset(nlist,tag->ti_Tag,tag->ti_Data); + } + + if((tag = FindTagItem(MUIA_Listview_Input, msg->ops_AttrList)) != NULL || + (tag = FindTagItem(MUIA_NList_Input, msg->ops_AttrList)) != NULL) + { + nnset(nlist,tag->ti_Tag,tag->ti_Data); + } + + if((tag = FindTagItem(MUIA_Listview_MultiSelect, msg->ops_AttrList)) != NULL || + (tag = FindTagItem(MUIA_NList_MultiSelect, msg->ops_AttrList)) != NULL) + { + nnset(nlist,tag->ti_Tag,tag->ti_Data); + } + + if((tag = FindTagItem(MUIA_Listview_DoubleClick, msg->ops_AttrList)) != NULL || + (tag = FindTagItem(MUIA_NList_DoubleClick, msg->ops_AttrList)) != NULL) + { + nnset(nlist,tag->ti_Tag,tag->ti_Data); + } + + if((tag = FindTagItem(MUIA_Listview_DefClickColumn, msg->ops_AttrList)) != NULL || + (tag = FindTagItem(MUIA_NList_DefClickColumn, msg->ops_AttrList)) != NULL) + { + nnset(nlist,tag->ti_Tag,tag->ti_Data); + } + } + else + { + obj = NULL; + RETURN(obj); + return((IPTR)obj); + } + } + else + { + nlist = MUI_NewObject(MUIC_NList, MUIA_Dropable, dropable, TAG_MORE, msg->ops_AttrList); + } + + obj = (Object *)DoSuperNew(cl, obj, + MUIA_Group_Horiz, TRUE, + MUIA_Group_Spacing, 0, + MUIA_CycleChain, cyclechain, + NoFrame, + Child, vgroup = VGroup, + MUIA_Group_Spacing, 0, + Child, nlist, + TAG_DONE), + TAG_MORE, msg->ops_AttrList + ); + + if(obj) + { + data = INST_DATA(cl,obj); + data->sem = FALSE; + data->SETUP = FALSE; + data->LI_NList = nlist; + data->Group = vgroup; + data->Vert_Attached = FALSE; + data->Horiz_Attached = FALSE; + data->Vert_ScrollBar = MUIV_NListview_VSB_Default; + data->Horiz_ScrollBar = MUIV_NListview_HSB_Default; + if((tag = FindTagItem(MUIA_Listview_ScrollerPos, msg->ops_AttrList)) != NULL) + { + if(tag->ti_Data == MUIV_Listview_ScrollerPos_None) + { + data->Vert_ScrollBar = MUIV_NListview_VSB_None; + data->Horiz_ScrollBar = MUIV_NListview_HSB_None; + } + else if(tag->ti_Data == MUIV_Listview_ScrollerPos_Left) + { + data->Vert_ScrollBar = MUIV_NListview_VSB_Left; + } + else if(tag->ti_Data == MUIV_Listview_ScrollerPos_Right) + { + data->Vert_ScrollBar = MUIV_NListview_VSB_Always; + } + } + + if((tag = FindTagItem(MUIA_NListview_Vert_ScrollBar, msg->ops_AttrList)) != NULL) + data->Vert_ScrollBar = tag->ti_Data; + + if((tag = FindTagItem(MUIA_NListview_Horiz_ScrollBar, msg->ops_AttrList)) != NULL) + data->Horiz_ScrollBar = tag->ti_Data; + + if((tag = FindTagItem(MUIA_ControlChar, msg->ops_AttrList)) != NULL) + data->ControlChar = tag->ti_Data; + + data->VertSB = data->Vert_ScrollBar; + data->HorizSB = data->Horiz_ScrollBar; + + // create the two scrollbar objects + data->PR_Vert = ScrollbarObject, + MUIA_Group_Horiz, FALSE, + End; + + data->PR_Horiz = ScrollbarObject, + MUIA_Group_Horiz, TRUE, + End; + + DoMethod(data->LI_NList, MUIM_Notify, MUIA_NListview_Horiz_ScrollBar, MUIV_EveryTime, obj, 3, MUIM_Set, MUIA_NListview_Horiz_ScrollBar, MUIV_TriggerValue); + + set(data->LI_NList, MUIA_NList_KeepActive, (IPTR)obj); + + // derive the "active border visible" setting from the embedded list + if(xget(data->LI_NList, MUIA_NList_ActiveObjectOnClick) == TRUE) + _flags(obj) |= (1<<7); + } + + RETURN(obj); + return((IPTR)obj); +} + + +static IPTR mNLV_Dispose(struct IClass *cl,Object *obj,Msg msg) +{ + struct NLVData *data = INST_DATA(cl, obj); + + ENTER(); + + // dispose the scrollbars if they are not currently part of the layout + if(data->PR_Vert != NULL && data->Vert_Attached == FALSE) + { + MUI_DisposeObject(data->PR_Vert); + data->PR_Vert = NULL; + } + if(data->PR_Horiz != NULL && data->Horiz_Attached == FALSE) + { + MUI_DisposeObject(data->PR_Horiz); + data->PR_Horiz = NULL; + } + + LEAVE(); + return DoSuperMethodA(cl,obj,msg); +} + +static IPTR mNLV_Setup(struct IClass *cl, Object *obj, struct MUIP_Setup *msg) +{ + struct NLVData *data = INST_DATA(cl, obj); + IPTR result = FALSE; + + ENTER(); + + data->SETUP = FALSE; + + if(data->sem == FALSE) + { + data->sem = TRUE; + NLV_Scrollers(obj, data, data->Vert_ScrollBar, data->Horiz_ScrollBar); + data->sem = FALSE; + } + + // Add the event handler for RAWKEY now + data->eh.ehn_Class = cl; + data->eh.ehn_Object = obj; + data->eh.ehn_Events = IDCMP_RAWKEY; + data->eh.ehn_Flags = MUI_EHF_GUIMODE; + data->eh.ehn_Priority = -1; + if(_win(obj) != NULL) + DoMethod(_win(obj), MUIM_Window_AddEventHandler, (IPTR)&data->eh); + + if(DoSuperMethodA(cl, obj, (Msg)msg)) + { + result = TRUE; + data->SETUP = TRUE; + } + + RETURN(result); + return result; +} + + +static IPTR mNLV_Cleanup(struct IClass *cl, Object *obj, struct MUIP_Cleanup *msg) +{ + struct NLVData *data = INST_DATA(cl, obj); + + ENTER(); + + if(_win(obj) != NULL) + DoMethod(_win(obj), MUIM_Window_RemEventHandler, (IPTR)&data->eh); + + data->SETUP = FALSE; + + LEAVE(); + return DoSuperMethodA(cl, obj, (Msg)msg); +} + + +static IPTR mNLV_Notify(struct IClass *cl, Object *obj, struct MUIP_Notify *msg) +{ + struct NLVData *data = INST_DATA(cl, obj); + + switch(msg->TrigAttr) + { + case MUIA_List_Prop_Entries: + case MUIA_List_Prop_Visible: + case MUIA_List_Prop_First: + case MUIA_NList_Horiz_Entries: + case MUIA_NList_Horiz_Visible: + case MUIA_NList_Horiz_First: + case MUIA_NList_HorizDeltaFactor: + case MUIA_NList_Prop_Entries: + case MUIA_NList_Prop_Visible: + case MUIA_NList_Prop_First: + case MUIA_NList_VertDeltaFactor: + case MUIA_NList_SelectChange: + case MUIA_NList_MultiClick: + case MUIA_NList_DoubleClick: + case MUIA_NList_EntryClick: + case MUIA_NList_Active: + case MUIA_NList_First: + case MUIA_NList_Entries: + case MUIA_NList_TitleClick: + case MUIA_List_Active: + case MUIA_Listview_SelectChange: + case MUIA_Listview_DoubleClick: + { + return DoMethodA(data->LI_NList, (Msg)msg); + } + + default: + return DoSuperMethodA(cl, obj, (Msg)msg); + } +} + + + +static IPTR mNLV_Set(struct IClass *cl,Object *obj,Msg msg) +{ + struct NLVData *data = INST_DATA(cl, obj); + struct TagItem *tags, *tag; + + ENTER(); + + tags = ((struct opSet *)msg)->ops_AttrList; + while((tag = NextTagItem((APTR)&tags)) != NULL) + { + switch (tag->ti_Tag) + { + case MUIA_Listview_ScrollerPos: + { + if(tag->ti_Data == MUIV_Listview_ScrollerPos_None) + tag->ti_Data = MUIV_NListview_VSB_None; + else if(tag->ti_Data == MUIV_Listview_ScrollerPos_Left) + tag->ti_Data = MUIV_NListview_VSB_Left; + else if(tag->ti_Data == MUIV_Listview_ScrollerPos_Right) + tag->ti_Data = MUIV_NListview_VSB_Always; + else + tag->ti_Data = MUIV_NListview_VSB_Default; + } + // fall through... + + case MUIA_NListview_Vert_ScrollBar: + { + tag->ti_Tag = TAG_IGNORE; + if(data->sem == FALSE) + { + data->sem = TRUE; + NLV_Scrollers(obj, data, tag->ti_Data, 0); + data->sem = FALSE; + } + } + break; + + case MUIA_NListview_Horiz_ScrollBar: + { + tag->ti_Tag = TAG_IGNORE; + if(data->sem == FALSE) + { + data->sem = TRUE; + NLV_Scrollers(obj, data, 0, tag->ti_Data); + data->sem = FALSE; + } + } + break; + + case MUIA_NList_KeyUpFocus: + case MUIA_NList_KeyDownFocus: + case MUIA_NList_KeyLeftFocus: + case MUIA_NList_KeyRightFocus: + { + // forward these to the embedded list object + if(data->LI_NList != NULL) + set(data->LI_NList, tag->ti_Tag, tag->ti_Data); + } + break; + } + } + + LEAVE(); + return DoSuperMethodA(cl, obj, msg); +} + + +static IPTR mNLV_Get(struct IClass *cl,Object *obj,Msg msg) +{ + struct NLVData *data = INST_DATA(cl, obj); + IPTR *store = ((struct opGet *)msg)->opg_Storage; + IPTR result = FALSE; + + ENTER(); + + switch(((struct opGet *)msg)->opg_AttrID) + { + case MUIA_Listview_List: + case MUIA_NListview_NList: + { + *store = (IPTR)data->LI_NList; + result = TRUE; + } + break; + + case MUIA_NListview_Vert_ScrollBar: + { + *store = (IPTR)data->VertSB; + result = TRUE; + } + break; + + case MUIA_NListview_Horiz_ScrollBar: + { + *store = (IPTR)data->HorizSB; + result = TRUE; + } + break; + + case MUIA_NListview_VSB_Width: + { + if(data->Vert_Attached == TRUE) + *store = (IPTR)_width(data->PR_Vert); + else + *store = (IPTR)0; + + result = TRUE; + } + break; + + case MUIA_NListview_HSB_Height: + { + if(data->Horiz_Attached == TRUE) + *store = (IPTR)_height(data->PR_Horiz); + else + *store = (IPTR)0; + + result = TRUE; + } + break; + + case MUIA_Version: + { + *store = LIB_VERSION; + result = TRUE; + } + break; + + case MUIA_Revision: + { + *store = LIB_REVISION; + result = TRUE; + } + break; + + default: + { + result = DoSuperMethodA(cl, obj, msg); + } + break; + } + + RETURN(result); + return result; +} + +static IPTR mNLV_GoActive(struct IClass *cl, Object *obj, Msg msg) +{ + struct NLVData *data = INST_DATA(cl, obj); + + // forward the method to the NList object + D(DBF_ALWAYS, "go active %08lx", obj); + if(data->LI_NList != NULL) + DoMethod(data->LI_NList, MUIM_NList_GoActive); + + return DoSuperMethodA(cl, obj, msg); +} + +static IPTR mNLV_GoInactive(struct IClass *cl, Object *obj, Msg msg) +{ + struct NLVData *data = INST_DATA(cl, obj); + + D(DBF_ALWAYS, "go inactive %08lx", obj); + // forward the method to the NList object + if(data->LI_NList != NULL) + DoMethod(data->LI_NList, MUIM_NList_GoInactive); + + return DoSuperMethodA(cl, obj, msg); +} + +DISPATCHER(_Dispatcher) +{ + switch(msg->MethodID) + { + case OM_NEW : return(mNLV_New(cl,obj,(APTR)msg)); + case OM_DISPOSE : return(mNLV_Dispose(cl,obj,(APTR)msg)); + case OM_GET : return(mNLV_Get(cl,obj,(APTR)msg)); + case OM_SET : return(mNLV_Set(cl,obj,(APTR)msg)); + case MUIM_Setup : return(mNLV_Setup(cl,obj,(APTR)msg)); + case MUIM_Cleanup : return(mNLV_Cleanup(cl,obj,(APTR)msg)); + case MUIM_HandleInput : return(mNLV_HandleInput(cl,obj,(APTR)msg)); + case MUIM_HandleEvent : return(mNLV_HandleEvent(cl,obj,(APTR)msg)); + case MUIM_NList_QueryBeginning : return(0); + case MUIM_DragQuery : return(MUIV_DragQuery_Refuse); + + // we catch all notify relevant method + // calls in one function + case MUIM_KillNotify : + case MUIM_KillNotifyObj : + case MUIM_Notify : return (mNLV_Notify(cl,obj,(APTR)msg)); + + case MUIM_GoActive : return mNLV_GoActive(cl, obj, msg); + case MUIM_GoInactive : return mNLV_GoInactive(cl, obj, msg); + + // the following method calls are all forwarded + // to the corresponding NList object + case MUIM_List_Sort : + case MUIM_List_Insert : + case MUIM_List_InsertSingle : + case MUIM_List_GetEntry : + case MUIM_List_Clear : + case MUIM_List_Jump : + case MUIM_List_Select : + case MUIM_List_TestPos : + case MUIM_List_Redraw : + case MUIM_List_Exchange : + case MUIM_List_Move : + case MUIM_List_NextSelected : + case MUIM_List_Remove : + case MUIM_List_CreateImage : + case MUIM_List_DeleteImage : + case MUIM_NList_Sort : + case MUIM_NList_Sort2 : + case MUIM_NList_Insert : + case MUIM_NList_InsertSingle : + case MUIM_NList_GetEntry : + case MUIM_NList_Clear : + case MUIM_NList_Jump : + case MUIM_NList_Select : + case MUIM_NList_TestPos : + case MUIM_NList_Redraw : + case MUIM_NList_RedrawEntry : + case MUIM_NList_Exchange : + case MUIM_NList_Move : + case MUIM_NList_NextSelected : + case MUIM_NList_Remove : + case MUIM_NList_CreateImage : + case MUIM_NList_DeleteImage : + case MUIM_NList_CopyToClip : + case MUIM_NList_UseImage : + case MUIM_NList_ReplaceSingle : + case MUIM_NList_InsertWrap : + case MUIM_NList_InsertSingleWrap: + case MUIM_NList_GetEntryInfo : + case MUIM_NList_GetSelectInfo : + case MUIM_NList_CopyTo : + case MUIM_NList_DropType : + case MUIM_NList_DropDraw : + case MUIM_NList_DoMethod : + case MUIM_NList_ColWidth : + case MUIM_NList_ColToColumn : + case MUIM_NList_ColumnToCol : + { + struct NLVData *data = INST_DATA(cl, obj); + + if(data->LI_NList != NULL) + return DoMethodA(data->LI_NList, msg); + else + return 0; + } + + default: return DoSuperMethodA(cl, obj, msg); + } +} diff --git a/workbench/classes/zune/nlist/nlistview_mcc/library.c b/workbench/classes/zune/nlist/nlistview_mcc/library.c new file mode 100644 index 0000000000..9ed21fbb87 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistview_mcc/library.c @@ -0,0 +1,104 @@ +/*************************************************************************** + + NListview.mcc - New Listview MUI Custom Class + Registered MUI class, Serial Number: 1d51 (0x9d510020 to 0x9d51002F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/******************************************************************************/ +/* */ +/* includes */ +/* */ +/******************************************************************************/ + +#include <proto/exec.h> +#include <proto/intuition.h> + +/******************************************************************************/ +/* */ +/* MCC/MCP name and version */ +/* */ +/* ATTENTION: The FIRST LETTER of NAME MUST be UPPERCASE */ +/* */ +/******************************************************************************/ + +#include "private.h" +#include "version.h" + +#define VERSION LIB_VERSION +#define REVISION LIB_REVISION + +#define CLASS MUIC_NListview +#define SUPERCLASS MUIC_Group + +#define INSTDATA NLVData + +#define USERLIBID CLASS " " LIB_REV_STRING " [" SYSTEMSHORT "/" CPU "] (" LIB_DATE ") " LIB_COPYRIGHT +#define MASTERVERSION 19 + +#define CLASSINIT +#define CLASSEXPUNGE + +#define USEDCLASSESP used_mcps +static const char *used_mcps[] = { "NListviews.mcp", NULL }; + +#define MIN_STACKSIZE 8192 + +struct Library *KeymapBase = NULL; +#if defined(__amigaos4__) +struct KeymapIFace *IKeymap = NULL; +#endif + +/******************************************************************************/ +/* define the functions used by the startup code ahead of including mccinit.c */ +/******************************************************************************/ +static BOOL ClassInit(UNUSED struct Library *base); +static VOID ClassExpunge(UNUSED struct Library *base); + +/******************************************************************************/ +/* include the lib startup code for the mcc/mcp (and muimaster inlines) */ +/******************************************************************************/ +#include "mccinit.c" + +/******************************************************************************/ +/* define all implementations of our user functions */ +/******************************************************************************/ +static BOOL ClassInit(UNUSED struct Library *base) +{ + if((KeymapBase = OpenLibrary("keymap.library", 36L)) && + GETINTERFACE(IKeymap, struct KeymapIFace *, KeymapBase)) + { + return TRUE; + } + + return FALSE; +} + + +static VOID ClassExpunge(UNUSED struct Library *base) +{ + if(KeymapBase != NULL) + { + DROPINTERFACE(IKeymap); + CloseLibrary(KeymapBase); + KeymapBase = NULL; + } +} + diff --git a/workbench/classes/zune/nlist/nlistview_mcc/mmakefile.src b/workbench/classes/zune/nlist/nlistview_mcc/mmakefile.src new file mode 100644 index 0000000000..1dba79759b --- /dev/null +++ b/workbench/classes/zune/nlist/nlistview_mcc/mmakefile.src @@ -0,0 +1,24 @@ +# $Id$ +include $(TOP)/config/make.cfg + +#MM contrib-zune-classes-nlistview-class : includes linklibs + +USER_INCLUDES := -idirafter $(SRCDIR)/$(CURDIR)/../include -idirafter $(SRCDIR)/$(CURDIR)/../include/mui -I$(SRCDIR)/$(CURDIR)/../nlistviews_mcp +USER_CFLAGS := $(PARANOIA_CFLAGS) +USER_CFLAGS += $(PARANOIA_CFLAGS) + +FILES := library \ + NListview \ + Debug + +%build_module_simple mmake=contrib-zune-classes-nlistview-class \ + modname=NListview modtype=mcc moduledir=$(CONTRIBDIR)/Zune/MCC_NList/Classes/Zune \ + files=$(FILES) uselibs="mui" + + +#MM includes-copy + +INCLUDE_FILES := ../include/mui/NListview_mcc.h +%copy_includes path=mui dir=../include/mui + +%common diff --git a/workbench/classes/zune/nlist/nlistview_mcc/private.h b/workbench/classes/zune/nlist/nlistview_mcc/private.h new file mode 100644 index 0000000000..3f6502322e --- /dev/null +++ b/workbench/classes/zune/nlist/nlistview_mcc/private.h @@ -0,0 +1,69 @@ +#ifndef MUI_NListview_priv_MCC_H +#define MUI_NListview_priv_MCC_H + +/*************************************************************************** + + NListview.mcc - New Listview MUI Custom Class + Registered MUI class, Serial Number: 1d51 (0x9d510020 to 0x9d51002F) + + Copyright (C) 1996-2004 by Gilles Masson, + Carsten Scholling <aphaso@aphaso.de>, + Przemyslaw Grunchala, + Sebastian Bauer <sebauer@t-online.de>, + Jens Langner <Jens.Langner@light-speed.de> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include "amiga-align.h" +#include "NListview_mcc.h" +#include "default-align.h" + +#include "Debug.h" + +#include <mcc_common.h> + +struct NLVData +{ + Object *LI_NList; + Object *PR_Vert; + Object *PR_Horiz; + Object *Group; + BOOL Vert_Attached; + BOOL Horiz_Attached; + LONG VertSB; + LONG HorizSB; + LONG Vert_ScrollBar; + LONG Horiz_ScrollBar; + BOOL sem; + BOOL SETUP; + UBYTE ControlChar; + struct MUI_EventHandlerNode eh; +}; + +/// xget() +// Gets an attribute value from a MUI object +IPTR xget(Object *obj, const IPTR attr); +#if defined(__GNUC__) + // please note that we do not evaluate the return value of GetAttr() + // as some attributes (e.g. MUIA_Selected) always return FALSE, even + // when they are supported by the object. But setting b=0 right before + // the GetAttr() should catch the case when attr doesn't exist at all + #define xget(OBJ, ATTR) ({IPTR b=0; GetAttr(ATTR, OBJ, &b); b;}) +#endif +/// + +#endif /* MUI_NListview_priv_MCC_H */ diff --git a/workbench/classes/zune/nlist/nlistview_mcc/vastubs.c b/workbench/classes/zune/nlist/nlistview_mcc/vastubs.c new file mode 100755 index 0000000000..cbde8b0530 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistview_mcc/vastubs.c @@ -0,0 +1,47 @@ +/*************************************************************************** + + NListview.mcc - New Listview MUI Custom Class + Registered MUI class, Serial Number: 1d51 (0x9d510020 to 0x9d51002F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if !defined(__AROS__) && (defined(__VBCC__) || defined(NO_INLINE_STDARG)) +#if defined(_M68000) || defined(__M68000) || defined(__mc68000) + +#include <exec/types.h> + +/* FIX V45 breakage... */ +#if INCLUDE_VERSION < 45 +#define MY_CONST_STRPTR CONST_STRPTR +#else +#define MY_CONST_STRPTR CONST STRPTR +#endif + +#include <proto/intuition.h> + +APTR NewObject( struct IClass *classPtr, CONST_STRPTR classID, Tag tag1, ... ) +{ return NewObjectA(classPtr, classID, (struct TagItem *)&tag1); } +ULONG SetAttrs( APTR object, ULONG tag1, ... ) +{ return SetAttrsA(object, (struct TagItem *)&tag1); } + +#else + #error "VARGS stubs are only save on m68k systems!" +#endif +#endif diff --git a/workbench/classes/zune/nlist/nlistview_mcc/version.h b/workbench/classes/zune/nlist/nlistview_mcc/version.h new file mode 100644 index 0000000000..42c7bd73cd --- /dev/null +++ b/workbench/classes/zune/nlist/nlistview_mcc/version.h @@ -0,0 +1,82 @@ +/*************************************************************************** + + NListview.mcc - New Listview MUI Custom Class + Registered MUI class, Serial Number: 1d51 (0x9d510020 to 0x9d51002F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2010 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef _VERSION_H_ +#define _VERSION_H_ + +// transforms a define into a string +#define STR(x) STR2(x) +#define STR2(x) #x + +// for setting all necessary version information +#define LIB_VERSION 19 +#define LIB_REVISION 85 +#define LIB_DATE "17.12.2011" +#define LIB_COPYRIGHT "Copyright (C) 2001-2011 NList Open Source Team" + +// set the LIB_REV_STRING +#define LIB_REV_STRING STR(LIB_VERSION) "." STR(LIB_REVISION) + +// identify the system we are compiling for +#if defined(__amigaos4__) + #define SYSTEM "AmigaOS4" + #define SYSTEMSHORT "OS4" +#elif defined(__MORPHOS__) + #define SYSTEM "MorphOS" + #define SYSTEMSHORT "MOS" +#elif defined(__AROS__) + #define SYSTEM "AROS" + #define SYSTEMSHORT SYSTEM +#elif defined(__AMIGA__) + #define SYSTEM "AmigaOS3" + #define SYSTEMSHORT "OS3" +#else + #warning "Unsupported System - check SYSTEM define" + #define SYSTEM "???" + #define SYSTEMSHORT "???" +#endif + +// identify the CPU model +#if defined(__PPC__) || defined(__powerpc__) + #define CPU "PPC" +#elif defined(_M68060) || defined(__M68060) || defined(__mc68060) + #define CPU "m68060" +#elif defined(_M68040) || defined(__M68040) || defined(__mc68040) + #define CPU "m68040" +#elif defined(_M68030) || defined(__M68030) || defined(__mc68030) + #define CPU "m68030" +#elif defined(_M68020) || defined(__M68020) || defined(__mc68020) + #define CPU "m68k" +#elif defined(_M68000) || defined(__M68000) || defined(__mc68000) + #define CPU "m68000" +#elif defined(__i386__) + #define CPU "x86" +#elif defined(__x86_64__) + #define CPU "x86_64" +#else + #warning "Unsupported CPU model - check CPU define" + #define CPU "???" +#endif + +#endif // _VERSION_H_ diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/C_c.sd b/workbench/classes/zune/nlist/nlistviews_mcp/C_c.sd new file mode 100644 index 0000000000..bb7d5b5121 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/C_c.sd @@ -0,0 +1,87 @@ +##stringtype C +##shortstrings +/*************************************************************************** + + NListviews.mcp - New Listview MUI Custom Class Preferences + Registered MUI class, Serial Number: 1d51 (0x9d510001 to 0x9d51001F + and 0x9d510101 to 0x9d51013F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id: C_c.sd 326 2009-04-19 22:38:26Z damato $ + +***************************************************************************/ + + /* + * If this file is named 'locale.c' it is automatically + * generated by 'FlexCat' from C_c.sd. PLEASE DO NOT EDIT!!! + */ + +#include <proto/locale.h> + +#include <SDI/SDI_compiler.h> +#include "Debug.h" + +struct FC_Type { const long ID; const char * const Str; }; + +const struct FC_Type _%i = { %d, %s }; + +static struct Catalog *NL_Catalog = NULL; + +/*** Catalog functions ***/ +/// tr() +const char *tr(const void *fcstr) +{ + const char *defaultstr = ((struct FC_Type *)fcstr)->Str; + + if(LocaleBase) + return (const char *)GetCatalogStr(NL_Catalog, ((struct FC_Type *)fcstr)->ID, (STRPTR)defaultstr); + + return defaultstr; +} +/// +/// CloseCat() +void CloseCat(void) +{ + ENTER(); + + if(NL_Catalog) + { + CloseCatalog(NL_Catalog); + NL_Catalog = NULL; + } + + LEAVE(); +} +/// +/// OpenCat(void) +BOOL OpenCat(void) +{ + static const struct TagItem tags[] = { + { OC_BuiltInLanguage, (IPTR)%l }, + { OC_Version, %v }, + { TAG_DONE, 0 } + }; + + ENTER(); + + if(LocaleBase && NL_Catalog == NULL) + NL_Catalog = OpenCatalogA(NULL, (STRPTR)"%b.catalog", (struct TagItem *)&tags[0]); + + RETURN((BOOL)(NL_Catalog != NULL)); + return (BOOL)(NL_Catalog != NULL); +} +/// diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/C_h.sd b/workbench/classes/zune/nlist/nlistviews_mcp/C_h.sd new file mode 100644 index 0000000000..e3ebf46f04 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/C_h.sd @@ -0,0 +1,48 @@ +##stringtype C +##shortstrings +/*************************************************************************** + + NListviews.mcp - New Listview MUI Custom Class Preferences + Registered MUI class, Serial Number: 1d51 (0x9d510001 to 0x9d51001F + and 0x9d510101 to 0x9d51013F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id: C_h.sd 218 2007-09-16 10:02:20Z damato $ + +***************************************************************************/ + + /* + * If this file is named 'locale.h' it is automatically + * generated by 'FlexCat' from C_h.sd. PLEASE DO NOT EDIT!!! + */ + +#ifndef %b_LOCALE_H +#define %b_LOCALE_H + +// catalog translation functions +extern const char *tr(const void *); +extern BOOL OpenCat(void); +extern void CloseCat(void); + +// const pointers to internal strings +extern const void* const _%i; + +// substiting defines to directly use MSG_XXXXX strings +#define MSG_Space ((const void* const)1) +#define %i ((const void* const)&_%i) + +#endif /* %b_LOCALE_H */ diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/Debug.c b/workbench/classes/zune/nlist/nlistviews_mcp/Debug.c new file mode 100644 index 0000000000..67e8332c30 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/Debug.c @@ -0,0 +1,413 @@ +/*************************************************************************** + + NListviews.mcp - New Listview MUI Custom Class Preferences + Registered MUI class, Serial Number: 1d51 (0x9d510001 to 0x9d51001F + and 0x9d510101 to 0x9d51013F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifdef DEBUG + +#include <stdlib.h> +#include <string.h> +#include <stdarg.h> +#include <stdio.h> + +#include <proto/intuition.h> +#include <proto/utility.h> +#include <proto/dos.h> +#include <proto/exec.h> + +#include "SDI_compiler.h" +#include "Debug.h" +#include "version.h" + +// special flagging macros +#define isFlagSet(v,f) (((v) & (f)) == (f)) // return TRUE if the flag is set +#define hasFlag(v,f) (((v) & (f)) != 0) // return TRUE if one of the flags in f is set in v +#define isFlagClear(v,f) (((v) & (f)) == 0) // return TRUE if flag f is not set in v +#define SET_FLAG(v,f) ((v) |= (f)) // set the flag f in v +#define CLEAR_FLAG(v,f) ((v) &= ~(f)) // clear the flag f in v +#define MASK_FLAG(v,f) ((v) &= (f)) // mask the variable v with flag f bitwise + +// our static variables with default values +static int indent_level = 0; +static BOOL ansi_output = FALSE; +static ULONG debug_flags = DBF_ALWAYS | DBF_STARTUP; // default debug flags +static ULONG debug_classes = DBC_ERROR | DBC_DEBUG | DBC_WARNING | DBC_ASSERT | DBC_REPORT; // default debug classes + +/****************************************************************************/ + +void SetupDebug(void) +{ + char var[256]; + + kprintf("** NListviews.mcp v" LIB_REV_STRING " startup ***********************\n"); + kprintf("Initializing runtime debugging:\n"); + + if(GetVar("nlistviews.mcp.debug", var, sizeof(var), 0) > 0) + { + char *tok; + char *debug = var; + + // static list of our debugging classes tokens. + // in the yamdebug variable these classes always start with a @ + static struct { const char *token; unsigned long flag; } dbclasses[] = + { + { "ctrace", DBC_CTRACE }, + { "report", DBC_REPORT }, + { "assert", DBC_ASSERT }, + { "timeval", DBC_TIMEVAL }, + { "debug", DBC_DEBUG }, + { "error", DBC_ERROR }, + { "warning", DBC_WARNING }, + { "all", DBC_ALL }, + { NULL, 0 } + }; + + static struct { const char *token; unsigned long flag; } dbflags[] = + { + { "always", DBF_ALWAYS }, + { "startup", DBF_STARTUP }, + { "all", DBF_ALL }, + { NULL, 0 } + }; + + // we parse the env variable token-wise + while((tok = strtok(debug, ", ;"))) + { + ULONG i; + + // check if the token is class definition or + // just a flag definition + if(tok[0] == '@') + { + // check if this call is a negation or not + if(tok[1] == '!') + { + // search for the token and clear the flag + for(i=0; dbclasses[i].token; i++) + { + if(stricmp(tok+2, dbclasses[i].token) == 0) + { + kprintf("clear '%s' debug class flag.\n", dbclasses[i].token); + CLEAR_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + else + { + // search for the token and set the flag + for(i=0; dbclasses[i].token; i++) + { + if(stricmp(tok+1, dbclasses[i].token) == 0) + { + kprintf("set '%s' debug class flag\n", dbclasses[i].token); + SET_FLAG(debug_classes, dbclasses[i].flag); + } + } + } + } + else + { + // check if this call is a negation or not + if(tok[0] == '!') + { + for(i=0; dbflags[i].token; i++) + { + if(stricmp(tok+1, dbflags[i].token) == 0) + { + kprintf("clear '%s' debug flag\n", dbflags[i].token); + CLEAR_FLAG(debug_flags, dbflags[i].flag); + } + } + } + else + { + // check if the token was "ansi" and if so enable the ANSI color + // output + if(stricmp(tok, "ansi") == 0) + { + kprintf("ansi output enabled\n"); + ansi_output = TRUE; + } + else + { + for(i=0; dbflags[i].token; i++) + { + if(stricmp(tok, dbflags[i].token) == 0) + { + kprintf("set '%s' debug flag\n", dbflags[i].token); + SET_FLAG(debug_flags, dbflags[i].flag); + } + } + } + } + } + + debug = NULL; + } + } + + kprintf("set debug classes/flags (env:nlistviews.mcp.debug): %08lx/%08lx\n", debug_classes, debug_flags); + kprintf("** Normal processing follows ***************************************\n"); +} + +/****************************************************************************/ + +void CleanupDebug(void) +{ + kprintf("** Cleaned up debugging ********************************************\n"); +} + +/****************************************************************************/ + +// define variables for using ANSI colors in our debugging scheme +#define ANSI_ESC_CLR "\033[0m" +#define ANSI_ESC_BOLD "\033[1m" +#define ANSI_ESC_UNDERLINE "\033[4m" +#define ANSI_ESC_BLINK "\033[5m" +#define ANSI_ESC_REVERSE "\033[7m" +#define ANSI_ESC_INVISIBLE "\033[8m" +#define ANSI_ESC_FG_BLACK "\033[0;30m" +#define ANSI_ESC_FG_RED "\033[0;31m" +#define ANSI_ESC_FG_GREEN "\033[0;32m" +#define ANSI_ESC_FG_BROWN "\033[0;33m" +#define ANSI_ESC_FG_BLUE "\033[0;34m" +#define ANSI_ESC_FG_PURPLE "\033[0;35m" +#define ANSI_ESC_FG_CYAN "\033[0;36m" +#define ANSI_ESC_FG_LGRAY "\033[0;37m" +#define ANSI_ESC_FG_DGRAY "\033[1;30m" +#define ANSI_ESC_FG_LRED "\033[1;31m" +#define ANSI_ESC_FG_LGREEN "\033[1;32m" +#define ANSI_ESC_FG_YELLOW "\033[1;33m" +#define ANSI_ESC_FG_LBLUE "\033[1;34m" +#define ANSI_ESC_FG_LPURPLE "\033[1;35m" +#define ANSI_ESC_FG_LCYAN "\033[1;36m" +#define ANSI_ESC_FG_WHITE "\033[1;37m" +#define ANSI_ESC_BG "\033[0;4" // background esc-squ start with 4x +#define ANSI_ESC_BG_BLACK "\033[0;40m" +#define ANSI_ESC_BG_RED "\033[0;41m" +#define ANSI_ESC_BG_GREEN "\033[0;42m" +#define ANSI_ESC_BG_BROWN "\033[0;43m" +#define ANSI_ESC_BG_BLUE "\033[0;44m" +#define ANSI_ESC_BG_PURPLE "\033[0;45m" +#define ANSI_ESC_BG_CYAN "\033[0;46m" +#define ANSI_ESC_BG_LGRAY "\033[0;47m" + +/****************************************************************************/ + +INLINE void _INDENT(void) +{ + int i; + for(i=0; i < indent_level; i++) + kprintf(" "); +} + +/****************************************************************************/ + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function) +{ + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Entering %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Entering %s\n", file, line, function); + } + + indent_level++; +} + +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function) +{ + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s%s\n", ANSI_ESC_FG_BROWN, file, line, function, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s\n", file, line, function); + } +} + +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result) +{ + indent_level--; + + if(isFlagSet(debug_classes, dclass)) + { + _INDENT(); + if(ansi_output) + kprintf("%s%s:%ld:Leaving %s (result 0x%08lx, %ld)%s\n", ANSI_ESC_FG_BROWN, file, line, function, result, result, ANSI_ESC_CLR); + else + kprintf("%s:%ld:Leaving %s (result 0x%08lx, %ld)\n", file, line, function, result, result); + } +} + +/****************************************************************************/ + +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + switch(size) + { + case 1: + fmt = "%s:%ld:%s = %ld, 0x%02lx"; + break; + + case 2: + fmt = "%s:%ld:%s = %ld, 0x%04lx"; + break; + + default: + fmt = "%s:%ld:%s = %ld, 0x%08lx"; + break; + } + + _INDENT(); + + if(ansi_output) + kprintf(ANSI_ESC_FG_GREEN); + + kprintf(fmt, file, line, name, value, value); + + if(size == 1 && value < 256) + { + if(value < ' ' || (value >= 127 && value < 160)) + kprintf(", '\\x%02lx'", value); + else + kprintf(", '%lc'", value); + } + + if(ansi_output) + kprintf("%s\n", ANSI_ESC_CLR); + else + kprintf("\n"); + } +} + +/****************************************************************************/ + +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + const char *fmt; + + _INDENT(); + + if(p != NULL) + fmt = "%s:%ld:%s = 0x%08lx\n"; + else + fmt = "%s:%ld:%s = NULL\n"; + + if(ansi_output) + { + kprintf(ANSI_ESC_FG_GREEN); + kprintf(fmt, file, line, name, p); + kprintf(ANSI_ESC_CLR); + } + else + kprintf(fmt, file, line, name, p); + } +} + +/****************************************************************************/ + +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s = 0x%08lx \"%s\"%s\n", ANSI_ESC_FG_GREEN, file, line, name, string, string, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s = 0x%08lx \"%s\"\n", file, line, name, string, string); + } +} + +/****************************************************************************/ + +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line) +{ + if(isFlagSet(debug_classes, dclass) && + isFlagSet(debug_flags, dflags)) + { + _INDENT(); + + if(ansi_output) + kprintf("%s%s:%ld:%s%s\n", ANSI_ESC_FG_GREEN, file, line, msg, ANSI_ESC_CLR); + else + kprintf("%s:%ld:%s\n", file, line, msg); + } +} + +/****************************************************************************/ + +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...) +{ + if((isFlagSet(debug_classes, dclass) && isFlagSet(debug_flags, dflags)) || + (isFlagSet(dclass, DBC_ERROR) || isFlagSet(dclass, DBC_WARNING))) + { + va_list args; + static char buf[1024]; + + _INDENT(); + + va_start(args, format); + vsnprintf(buf, 1024, format, args); + va_end(args); + + if(ansi_output) + { + const char *highlight = ANSI_ESC_FG_GREEN; + + switch(dclass) + { + case DBC_CTRACE: highlight = ANSI_ESC_FG_BROWN; break; + case DBC_REPORT: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ASSERT: highlight = ANSI_ESC_FG_RED; break; + case DBC_TIMEVAL: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_DEBUG: highlight = ANSI_ESC_FG_GREEN; break; + case DBC_ERROR: highlight = ANSI_ESC_FG_RED; break; + case DBC_WARNING: highlight = ANSI_ESC_FG_PURPLE;break; + } + + kprintf("%s%s:%ld:%s%s\n", highlight, file, line, buf, ANSI_ESC_CLR); + } + else + kprintf("%s:%ld:%s\n", file, line, buf); + } +} + +/****************************************************************************/ + +#endif diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/Debug.h b/workbench/classes/zune/nlist/nlistviews_mcp/Debug.h new file mode 100644 index 0000000000..cb91379722 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/Debug.h @@ -0,0 +1,139 @@ +/*************************************************************************** + + TextEditor.mcc - Textediting MUI Custom Class + Copyright (C) 1997-2000 Allan Odgaard + Copyright (C) 2005 by TextEditor.mcc Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + TextEditor class Support Site: http://www.sf.net/projects/texteditor-mcc + + $Id$ + +***************************************************************************/ + +#ifndef DEBUG_H +#define DEBUG_H + +// first we make sure all previously defined symbols are undefined now so +// that no other debug system interferes with ours. +#undef ENTER +#undef LEAVE +#undef RETURN +#undef SHOWVALUE +#undef SHOWPOINTER +#undef SHOWSTRING +#undef SHOWMSG +#undef STARTCLOCK +#undef STOPCLOCK +#undef D +#undef E +#undef W +#undef ASSERT + +#if defined(DEBUG) + +#include <assert.h> + +#ifndef EXEC_TYPES_H +#include <exec/types.h> +#endif + +#if defined(__amigaos4__) + #include <proto/exec.h> + #ifdef __USE_INLINE__ + #ifdef DebugPrintF + #undef DebugPrintF + #endif + #endif + #ifndef kprintf + #define kprintf(format, args...) ((struct ExecIFace *)((*(struct ExecBase **)4)->MainInterface))->DebugPrintF(format, ## args) + #endif +#elif defined(__MORPHOS__) + #include <exec/rawfmt.h> + #include <proto/exec.h> + #define KPutFmt(format, args) VNewRawDoFmt(format, (APTR)RAWFMTFUNC_SERIAL, NULL, args) +void kprintf(const char *formatString,...); +#else +void kprintf(const char *formatString,...); +#endif + +// debug classes +#define DBC_CTRACE (1<<0) // call tracing (ENTER/LEAVE etc.) +#define DBC_REPORT (1<<1) // reports (SHOWVALUE/SHOWSTRING etc.) +#define DBC_ASSERT (1<<2) // asserts (ASSERT) +#define DBC_TIMEVAL (1<<3) // time evaluations (STARTCLOCK/STOPCLOCK) +#define DBC_DEBUG (1<<4) // debugging output D() +#define DBC_ERROR (1<<5) // error output E() +#define DBC_WARNING (1<<6) // warning output W() +#define DBC_ALL 0xffffffff + +// debug flags +#define DBF_ALWAYS (1<<0) +#define DBF_STARTUP (1<<1) // for startup/shutdown events (YAM.c) +#define DBF_ALL 0xffffffff + +void SetupDebug(void); +void CleanupDebug(void); + +void _ENTER(unsigned long dclass, const char *file, int line, const char *function); +void _LEAVE(unsigned long dclass, const char *file, int line, const char *function); +void _RETURN(unsigned long dclass, const char *file, int line, const char *function, unsigned long result); +void _SHOWVALUE(unsigned long dclass, unsigned long dflags, unsigned long value, int size, const char *name, const char *file, int line); +void _SHOWPOINTER(unsigned long dclass, unsigned long dflags, const void *p, const char *name, const char *file, int line); +void _SHOWSTRING(unsigned long dclass, unsigned long dflags, const char *string, const char *name, const char *file, int line); +void _SHOWMSG(unsigned long dclass, unsigned long dflags, const char *msg, const char *file, int line); +void _DPRINTF(unsigned long dclass, unsigned long dflags, const char *file, int line, const char *format, ...); + +// Core class information class messages +#define ENTER() _ENTER(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define LEAVE() _LEAVE(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__) +#define RETURN(r) _RETURN(DBC_CTRACE, __FILE__, __LINE__, __FUNCTION__, (long)r) +#define SHOWVALUE(f, v) _SHOWVALUE(DBC_REPORT, f, (long)v, sizeof(v), #v, __FILE__, __LINE__) +#define SHOWPOINTER(f, p) _SHOWPOINTER(DBC_REPORT, f, p, #p, __FILE__, __LINE__) +#define SHOWSTRING(f, s) _SHOWSTRING(DBC_REPORT, f, s, #s, __FILE__, __LINE__) +#define SHOWMSG(f, m) _SHOWMSG(DBC_REPORT, f, m, __FILE__, __LINE__) +#define D(f, s, vargs...) _DPRINTF(DBC_DEBUG, f, __FILE__, __LINE__, s, ## vargs) +#define E(f, s, vargs...) _DPRINTF(DBC_ERROR, f, __FILE__, __LINE__, s, ## vargs) +#define W(f, s, vargs...) _DPRINTF(DBC_WARNING, f, __FILE__, __LINE__, s, ## vargs) +#define ASSERT(expression) \ + ((void) \ + ((expression) ? 0 : \ + ( \ + _DPRINTF(DBC_ASSERT, \ + DBF_ALWAYS, \ + __FILE__, \ + __LINE__, \ + "failed assertion '%s'", \ + #expression), \ + assert(#expression), \ + 0 \ + ) \ + ) \ + ) + +#else // DEBUG + +#define ENTER() ((void)0) +#define LEAVE() ((void)0) +#define RETURN(r) ((void)0) +#define SHOWVALUE(f, v) ((void)0) +#define SHOWPOINTER(f, p) ((void)0) +#define SHOWSTRING(f, s) ((void)0) +#define SHOWMSG(f, m) ((void)0) +#define D(f, s, vargs...) ((void)0) +#define E(f, s, vargs...) ((void)0) +#define W(f, s, vargs...) ((void)0) +#define ASSERT(expression) ((void)0) + +#endif // DEBUG + +#endif // DEBUG_H diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/Makefile b/workbench/classes/zune/nlist/nlistviews_mcp/Makefile new file mode 100644 index 0000000000..9bd5fdaac0 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/Makefile @@ -0,0 +1,477 @@ +#/*************************************************************************** +# +# NListview.mcc - New Listview MUI Custom Class +# Registered MUI class, Serial Number: 1d51 (0x9d510020 to 0x9d51002F) +# +# Copyright (C) 1996-2001 by Gilles Masson +# Copyright (C) 2001-2005 by NList Open Source Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# NList classes Support Site: http://www.sf.net/projects/nlist-classes +# +# $Id$ +# +#***************************************************************************/ + +########################################################################### +# This makefile is a very generic one. It tries to identify both, the host +# and the target operating system for which YAM should be compiled. +# However, this auto-detection can be easily overridden by directly +# specifying an option on the commandline while calling 'make'. +# +# Example: +# +# # to explicitly compile for AmigaOS3 +# > make OS=os3 +# +# # to compile for AmigaOS4 but with debugging +# > make OS=os4 DEBUG= +# + +############################################# +# find out the HOST operating system +# on which this makefile is run +HOST ?= $(shell uname) +ifeq ($(HOST), AmigaOS) + ifeq ($(shell uname -m), powerpc) + HOST = AmigaOS4 + endif + ifeq ($(shell uname -m), ppc) + HOST = AmigaOS4 + endif +endif + +# if no host is identifed (no uname tool) +# we assume a AmigaOS build +ifeq ($(HOST),) + HOST = AmigaOS +endif + +############################################# +# now we find out the target OS for +# which we are going to compile YAM in case +# the caller didn't yet define OS himself +ifndef (OS) + ifeq ($(HOST), AmigaOS4) + OS = os4 + else + ifeq ($(HOST), AmigaOS) + OS = os3 + else + ifeq ($(HOST), MorphOS) + OS = mos + else + ifeq ($(HOST), AROS) + # now we find out which CPU system aros will be used + ifeq ($(shell uname -m), powerpc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), ppc) + OS = aros-ppc + endif + ifeq ($(shell uname -m), i386) + OS = aros-i386 + endif + ifeq ($(shell uname -m), i686) + OS = aros-i686 + endif + ifeq ($(shell uname -m), x86_64) + OS = aros-x86_64 + endif + else + OS = os4 + endif + endif + endif + endif +endif + +############################################# +# define common commands we use in this +# makefile. Please note that each of them +# might be overridden on the commandline. + +# common commands +FLEX = flex +FC = flexcat +EXPR = expr +DATE = date +RM = delete force +RMDIR = delete force all +MKDIR = makedir +CHMOD = protect FLAGS=rwed +SED = sed +CP = copy +CC = gcc +STRIP = strip +OBJDUMP = objdump + +# override commands for native builds +ifeq ($(HOST), AmigaOS4) + # AmigaOS4 host +# RM = delete force +# RMDIR = delete force all +# MKDIR = makedir + DATE = gdate +else +ifeq ($(HOST), AmigaOS) + # AmigaOS3 host + RM = delete force + RMDIR = delete force all + MKDIR = makedir +else +ifeq ($(HOST), MorphOS) + # MorphOS host + RM = delete force + RMDIR = delete force all + MKDIR = makedir +endif +endif +endif + +# path definitions +CDUP = / +CDTHIS= + +# override some variables for non-native builds (cross-compiler) +ifneq ($(HOST), AmigaOS) +ifneq ($(HOST), AmigaOS4) +ifneq ($(HOST), MorphOS) + + # when we end up here this is either a unix or Aros host + # so lets use unix kind of commands + RM = rm -f + RMDIR = rm -rf + MKDIR = mkdir -p + CHMOD = chmod 755 + CP = cp -f + + CDUP = ../ + CDTHIS= ./ + +endif +endif +endif + +########################################################################### +# CPU and DEBUG can be defined outside, defaults to above +# using e.g. "make DEBUG= CPU=-mcpu=603e" produces optimized non-debug +# PPC-603e version +# +# OPTFLAGS are disabled by DEBUG normally! +# +# ignored warnings are: +# none - because we want to compile with -Wall all the time + +# Common Directories +PREFIX = $(CDTHIS) +OBJDIR = .obj_$(OS) +BINDIR = bin_$(OS) +LOCALE = locale +VPATH = $(OBJDIR) +DEPFILE = Makefile.dep +DESTDIR = MUI:Libs/MUI + +# target definition +TARGET = $(BINDIR)/NListviews.mcp +TESTTARGET= $(BINDIR)/NListviews-Prefs + +# Common compiler/linker flags +WARN = -W -Wall -Wwrite-strings -Wpointer-arith -Wsign-compare +OPTFLAGS = -O3 -fomit-frame-pointer -funroll-loops +DEBUG = -DDEBUG -O0 +DEBUGSYM = -g -gstabs +CFLAGS = -I. -I../nlistviews_mcp -I../include $(CPU) $(WARN) \ + $(OPTFLAGS) $(DEBUG) $(DEBUGSYM) $(USER_CFLAGS) -c +LDFLAGS = $(CPU) $(DEBUGSYM) +LDLIBS = + +########################################################################### +# object files definition +# + +LOBJS = library.o + +COBJS = locale.o \ + NListviews.o \ + icon.o \ + Debug.o + +TOBJS = NListviews-Prefs.o + +MCCOBJS = $(addprefix $(OBJDIR)/,$(LOBJS)) $(addprefix $(OBJDIR)/,$(COBJS)) +TESTOBJS = $(addprefix $(OBJDIR)/,$(COBJS)) $(addprefix $(OBJDIR)/,$(TOBJS)) + +# available catalog translations +CATALOGS = $(LOCALE)/czech.catalog \ + $(LOCALE)/french.catalog \ + $(LOCALE)/german.catalog \ + $(LOCALE)/swedish.catalog \ + $(LOCALE)/polish.catalog \ + $(LOCALE)/turkish.catalog + +# different options per target OS +ifeq ($(OS), os4) + + ############################## + # AmigaOS4 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS4) + CC = ppc-amigaos-gcc + STRIP = ppc-amigaos-strip + OBJDUMP = ppc-amigaos-objdump + endif + + # Compiler/Linker flags + CRT = newlib + CPU = -mcpu=powerpc + WARN += -Wdeclaration-after-statement -Wdisabled-optimization + CFLAGS += -mcrt=$(CRT) -D__USE_INLINE__ -D__NEW_TIMEVAL_DEFINITION_USED__ \ + -DNO_PPCINLINE_STDARG -Wa,-mregnames + LDFLAGS += -mcrt=$(CRT) + + # additional object files required + M68KSTUBS = $(OBJDIR)/mccclass_68k.o + +else +ifeq ($(OS), os3) + + ############################## + # AmigaOS3 + + # Compiler/link/strip commands + ifneq ($(HOST), AmigaOS) + CC = m68k-amigaos-gcc + STRIP = m68k-amigaos-strip + OBJDUMP = m68k-amigaos-objdump + endif + + # Compiler/Linker flags + CPU = -m68020-60 -msoft-float + CFLAGS += -noixemul -DNO_INLINE_STDARG -D__amigaos3__ + LDFLAGS += -noixemul + LDLIBS += -ldebug -lmui + + # additional object files required + COBJS += vastubs.o + +else +ifeq ($(OS), mos) + + ############################## + # MorphOS + + # Compiler/link/strip commands + ifneq ($(HOST), MorphOS) + CC = ppc-morphos-gcc + STRIP = ppc-morphos-strip + OBJDUMP = ppc-morphos-objdump + endif + + # Compiler/Linker flags + CPU = -mcpu=powerpc + CFLAGS += -noixemul -DNO_PPCINLINE_STDARG + LDFLAGS += -noixemul + LDLIBS += -ldebug + +else +ifeq ($(OS), aros-i386) + + ############################## + # AROS (i386) + + ifneq ($(HOST), AROS) + CC = i386-aros-gcc + STRIP = i386-aros-strip + OBJDUMP = i386-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-ppc) + + ############################## + # AROS (PPC) + + ifneq ($(HOST), AROS) + CC = ppc-aros-gcc + STRIP = ppc-aros-strip + OBJDUMP = ppc-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +else +ifeq ($(OS), aros-x86_64) + + ############################## + # AROS (x86_64) + + ifneq ($(HOST), AROS) + CC = x86_64-aros-gcc + STRIP = x86_64-aros-strip + OBJDUMP = x86_64-aros-objdump + endif + + # Compiler/Linker flags + OPTFLAGS = -O2 -fomit-frame-pointer -funroll-loops + CFLAGS += -Wno-pointer-sign -DNO_INLINE_STDARG + LDLIBS += -larossupport -lrom -lmui + +endif +endif +endif +endif +endif +endif + +# main target +.PHONY: all +ifeq ($(wildcard $(DEPFILE)),$(DEPFILE)) +# great, we have a dependecies file, let's make our target +all: $(BINDIR) $(OBJDIR) $(M68KSTUBS) locale.c $(TARGET) $(TESTTARGET) +else +# no dependecies, create it and then call make again +all: depend + @make --no-print-directory all +endif + +# for making a release we compile ALL target with no debug +release: + @echo " CC $<" + make OS=os4 clean + make OS=os4 DEBUG= + @echo " CC $<" + make OS=os3 clean + make OS=os3 DEBUG= + @echo " CC $<" + make OS=mos clean + make OS=mos DEBUG= + @echo " CC $<" + make OS=aros-i386 clean + make OS=aros-i386 DEBUG= + @echo " CC $<" + make OS=aros-ppc clean + make OS=aros-ppc DEBUG= + @echo " CC $<" + make OS=aros-x86_64 clean + make OS=aros-x86_64 DEBUG= + +# make the object directories +$(OBJDIR): + @echo " MK $@" + @$(MKDIR) $(OBJDIR) + +# make the binary directories +$(BINDIR): + @echo " MK $@" + @$(MKDIR) $(BINDIR) + +# for compiling single .c files +$(OBJDIR)/%.o: %.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +$(OBJDIR)/mccclass_68k.o: ../include/mccclass_68k.c + @echo " CC $<" + @$(CC) $(CFLAGS) $< -o $@ + +# for linking the target +$(TARGET): $(M68KSTUBS) $(MCCOBJS) + @echo " LD $@.debug" + @$(CC) -nostartfiles $(LDFLAGS) -o $@.debug $(MCCOBJS) $(M68KSTUBS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +# for linking the target +$(TESTTARGET): $(TESTOBJS) + @echo " LD $@.debug" + @$(CC) $(LDFLAGS) -o $@.debug $(TESTOBJS) $(LDLIBS) -Wl,--cref,-M,-Map=$@.map + @echo " LD $@" + @$(STRIP) --preserve-dates -R.comment -R.sdata2 -S -o $@ $@.debug + +locale.h: locale.c +locale.c: $(LOCALE)/NListviews_mcp.cd C_h.sd C_c.sd + @echo " FC $@" + @$(FC) $(LOCALE)/NListviews_mcp.cd locale.h=C_h.sd locale.c=C_c.sd + +## CATALOG GENERATION ################# + +$(LOCALE)/%.catalog: $(LOCALE)/%.ct $(LOCALE)/NListviews_mcp.cd + @echo " FC $@" + @$(FC) $(LOCALE)/NListviews_mcp.cd $< CATALOG $@ + +.IGNORE: $(CATALOGS) + +catalogs: $(CATALOGS) + +.PHONY: dump +dump: + -$(OBJDUMP) --section-headers --all-headers --reloc --disassemble-all $(TARGET) >$(TARGET).dump + +.PHONY: clean +clean: + -$(RM) $(TARGET) $(TARGET).debug $(TARGET).map + -$(RM) $(TESTTARGET) $(TESTTARGET).debug $(TESTTARGET).map + -$(RM) $(MCCOBJS) $(TESTOBJS) $(M68KSTUBS) + +.PHONY: distclean +distclean: clean + -$(RM) locale.? + -$(RM) $(LOCALE)/*.catalog + -$(RMDIR) $(OBJDIR) + -$(RMDIR) $(BINDIR) + +# install +.PHONY: install +install: all + @echo " IN $(TARGET)" + @$(CP) $(TARGET) $(DESTDIR) + +.PHONY: help +help: + @echo "Cleaning targets:" + @echo " clean - Cleanup working directory for clean compile" + @echo " distclean - Also cleanup autogenerated files" + @echo "" + @echo "Other generic targets:" + @echo " all - Build $(TARGET)" + @echo " catalogs - Build all available catalogs" + @echo "" + @echo "Install targets:" + @echo " install - Install $(TARGET) into $(DESTDIR)" + @echo "" + @echo "Parameters:" + @echo " make OS=os3|os4|mos|aros-i386|aros-i686|aros-ppc|aros-x86_64" + @echo " make DEBUG= : build $(TARGET) without debugging information" + @echo "" + +## DEPENDENCY GENERATION ############## + +.PHONY: depend +depend: + @echo " MK $(DEPFILE)" + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >$(DEPFILE) + @$(CC) -MM -MG $(CFLAGS) $(wildcard *.c) >>$(DEPFILE) + @echo "# AUTOGENERATED! DO NOT EDIT!!!" >>$(DEPFILE) + @$(SED) -i 's,^\(.*\)\.o:,$$\(OBJDIR\)/\1.o:,g' $(DEPFILE) + +# include dependencies file +-include $(DEPFILE) diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/Makefile.dep b/workbench/classes/zune/nlist/nlistviews_mcp/Makefile.dep new file mode 100644 index 0000000000..f10ad1d99b --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/Makefile.dep @@ -0,0 +1,30 @@ +# AUTOGENERATED! DO NOT EDIT!!! +$(OBJDIR)/Debug.o: Debug.c ../include/SDI_compiler.h Debug.h version.h +$(OBJDIR)/icon.o: icon.c +$(OBJDIR)/library.o: library.c ../include/proto/muimaster.h \ + ../include/libraries/mui.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h private.h ../include/amiga-align.h \ + NListviews_mcp.h ../include/mui/NListview_mcc.h \ + ../include/mui/NList_mcc.h ../include/default-align.h Debug.h \ + ../include/mcc_common.h ../include/SDI_compiler.h ../include/SDI_hook.h \ + ../include/SDI_lib.h ../include/SDI_stdarg.h version.h locale.h icon.h \ + ../include/mui/NBitmap_mcc.h ../include/mccinit.c +$(OBJDIR)/locale.o: locale.c ../include/SDI_compiler.h Debug.h +$(OBJDIR)/NListviews.o: NListviews.c ../include/mui/HotkeyString_mcc.h \ + ../include/proto/muimaster.h ../include/libraries/mui.h \ + ../include/interfaces/muimaster.h ../include/inline4/muimaster.h \ + private.h ../include/amiga-align.h NListviews_mcp.h \ + ../include/mui/NListview_mcc.h ../include/mui/NList_mcc.h \ + ../include/default-align.h Debug.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h version.h locale.h ../include/muiextra.h +$(OBJDIR)/NListviews-Prefs.o: NListviews-Prefs.c ../include/libraries/mui.h \ + ../include/proto/muimaster.h ../include/interfaces/muimaster.h \ + ../include/inline4/muimaster.h locale.h private.h \ + ../include/amiga-align.h NListviews_mcp.h \ + ../include/mui/NListview_mcc.h ../include/mui/NList_mcc.h \ + ../include/default-align.h Debug.h ../include/mcc_common.h \ + ../include/SDI_compiler.h ../include/SDI_hook.h ../include/SDI_lib.h \ + ../include/SDI_stdarg.h ../include/SDI_hook.h +$(OBJDIR)/vastubs.o: vastubs.c +# AUTOGENERATED! DO NOT EDIT!!! diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/NListviews-Prefs.c b/workbench/classes/zune/nlist/nlistviews_mcp/NListviews-Prefs.c new file mode 100644 index 0000000000..84f0fa8de8 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/NListviews-Prefs.c @@ -0,0 +1,197 @@ +/*************************************************************************** + + NListviews.mcp - New Listview MUI Custom Class Preferences + Registered MUI class, Serial Number: 1d51 (0x9d510001 to 0x9d51001F + and 0x9d510101 to 0x9d51013F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <stdio.h> + +#include <exec/tasks.h> +#include <exec/memory.h> +#include <libraries/mui.h> +#include <proto/dos.h> +#include <proto/exec.h> +#include <proto/locale.h> +#include <proto/muimaster.h> +#include <proto/intuition.h> + +#include "locale.h" +#include "private.h" + +#include "SDI_hook.h" + +#if defined(__amigaos4__) +struct Library *IntuitionBase = NULL; +struct Library *MUIMasterBase = NULL; +struct Library *LocaleBase = NULL; +struct Library *UtilityBase = NULL; +#elif defined(__MORPHOS__) +struct IntuitionBase *IntuitionBase = NULL; +struct Library *MUIMasterBase = NULL; +struct Library *LocaleBase = NULL; +struct Library *UtilityBase = NULL; +#else +struct IntuitionBase *IntuitionBase = NULL; +struct Library *MUIMasterBase = NULL; +struct LocaleBase *LocaleBase = NULL; +struct Library *UtilityBase = NULL; +#endif + +struct Library *CxBase = NULL; +struct Device *ConsoleDevice = NULL; + +#if defined(__amigaos4__) +struct CommoditiesIFace *ICommodities = NULL; +struct ConsoleIFace *IConsole = NULL; +struct IntuitionIFace *IIntuition = NULL; +struct MUIMasterIFace *IMUIMaster = NULL; +struct LocaleIFace *ILocale = NULL; +struct UtilityIFace *IUtility = NULL; +#endif + +struct IOStdReq ioreq; + +extern DISPATCHERPROTO(_DispatcherP); + +int main(void) +{ + ioreq.io_Message.mn_Length = sizeof(ioreq); + if((UtilityBase = OpenLibrary("utility.library", 38)) && + GETINTERFACE(IUtility, UtilityBase)) + if((IntuitionBase = (APTR)OpenLibrary("intuition.library", 38)) && + GETINTERFACE(IIntuition, IntuitionBase)) + if((CxBase = OpenLibrary("commodities.library", 37L)) && + GETINTERFACE(ICommodities, CxBase)) + if(!OpenDevice("console.device", -1L, (struct IORequest *)&ioreq, 0L)) + { + ConsoleDevice = (struct Device *)ioreq.io_Device; + if(ConsoleDevice != NULL && + GETINTERFACE(IConsole, ConsoleDevice)) + if((LocaleBase = (APTR)OpenLibrary("locale.library", 38)) && + GETINTERFACE(ILocale, LocaleBase)) + { + OpenCat(); + + #if defined(DEBUG) + SetupDebug(); + #endif + + if((MUIMasterBase = OpenLibrary(MUIMASTER_NAME, MUIMASTER_VMIN)) && + GETINTERFACE(IMUIMaster, MUIMasterBase)) + { + Object *app = NULL; + Object *window = NULL; + struct MUI_CustomClass *mcc = NULL; + + mcc = MUI_CreateCustomClass(NULL, (STRPTR)"Group.mui", NULL, sizeof(struct NListviews_MCP_Data), ENTRY(_DispatcherP)); + if(mcc) + { + app = MUI_NewObject("Application.mui", + MUIA_Application_Author, "NList Open Source Team", + MUIA_Application_Base, "NListviews-Prefs", + MUIA_Application_Copyright, "(c) 2001-2007 NList Open Source Team", + MUIA_Application_Description, "Preference for NList classes", + MUIA_Application_Title, "NListviews-Prefs", + MUIA_Application_Version, "$VER: NListviews-Prefs V1.0 (15.09.2007)", + + MUIA_Application_Window, + window = MUI_NewObject("Window.mui", + MUIA_Window_Title, "NListviews-Prefs", + MUIA_Window_RootObject, + MUI_NewObject("Group.mui", + MUIA_Background, MUII_PageBack, + MUIA_Frame, MUIV_Frame_Text, + MUIA_InnerBottom, 11, + MUIA_InnerLeft, 6, + MUIA_InnerRight, 6, + MUIA_InnerTop, 11, + +// Child, RectangleObject, End, + Child, NewObject(mcc->mcc_Class, NULL, TAG_DONE), + + TAG_DONE ), + TAG_DONE ), + TAG_DONE ); + } + + if(app) + { + unsigned long sigs; + + DoMethod(window, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit); + set(window, MUIA_Window_Open, TRUE); + + while((LONG)DoMethod(app, MUIM_Application_NewInput, &sigs) != (LONG)MUIV_Application_ReturnID_Quit) + { + if(sigs) + { + sigs = Wait(sigs | SIGBREAKF_CTRL_C); + if(sigs & SIGBREAKF_CTRL_C) + break; + } + } + + MUI_DisposeObject(app); + + if(mcc) + MUI_DeleteCustomClass(mcc); + } + + DROPINTERFACE(IMUIMaster); + CloseLibrary(MUIMasterBase); + } + + CloseCat(); + + DROPINTERFACE(ILocale); + CloseLibrary((struct Library *)LocaleBase); + } + + if(ConsoleDevice) + { + DROPINTERFACE(IConsole); + CloseDevice((struct IORequest *)&ioreq); + ConsoleDevice = NULL; + } + } + + if(CxBase) + { + DROPINTERFACE(ICommodities); + CloseLibrary(CxBase); + CxBase = NULL; + } + + if(IntuitionBase) + { + DROPINTERFACE(IIntuition); + CloseLibrary((struct Library *)IntuitionBase); + } + + if(UtilityBase) + { + DROPINTERFACE(IUtility); + CloseLibrary(UtilityBase); + } + + return 0; +} diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/NListviews.c b/workbench/classes/zune/nlist/nlistviews_mcp/NListviews.c new file mode 100644 index 0000000000..b175609151 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/NListviews.c @@ -0,0 +1,1967 @@ +/*************************************************************************** + + NListviews.mcp - New Listview MUI Custom Class Preferences + Registered MUI class, Serial Number: 1d51 (0x9d510001 to 0x9d51001F + and 0x9d510101 to 0x9d51013F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include <string.h> +#include <stdlib.h> + +#include <devices/inputevent.h> +#include <libraries/asl.h> +#include <libraries/locale.h> +#include <libraries/commodities.h> +#include <mui/HotkeyString_mcc.h> + +#include <clib/alib_protos.h> +#include <proto/commodities.h> +#include <proto/muimaster.h> +#include <proto/intuition.h> +#include <proto/console.h> +#include <proto/locale.h> +#include <proto/exec.h> + +#include "private.h" +#include "version.h" + +#include "locale.h" + +#include "muiextra.h" + +#define INTUIBASEMIN 39 + + +#define SimpleButtonCycle(name,helpstring) \ + (void *)TextObject, \ + ButtonFrame, \ + MUIA_CycleChain, 1, \ + MUIA_Font, MUIV_Font_Button, \ + MUIA_Text_Contents, name, \ + MUIA_Text_PreParse, "\33c", \ + MUIA_InputMode , MUIV_InputMode_RelVerify, \ + MUIA_Background , MUII_ButtonBack, \ + MUIA_ShortHelp, helpstring, \ + End + + +#define ToggleButtonCycle(name,selected,disable,helpstring) \ + (void *)TextObject, \ + ButtonFrame, \ + MUIA_CycleChain, 1, \ + MUIA_Font, MUIV_Font_Button, \ + MUIA_Text_Contents, name, \ + MUIA_Text_PreParse, "\33c", \ + MUIA_Text_SetMax, TRUE, \ + MUIA_InputMode , MUIV_InputMode_Toggle, \ + MUIA_Selected , selected,\ + MUIA_Background , MUII_ButtonBack, \ + MUIA_Disabled , disable,\ + MUIA_ShortHelp, helpstring, \ + End + +/* + MUIA_ShowSelState , FALSE,\ +*/ +struct QualifierDef { + char *qualstr; + LONG qualval; +}; + +/* +static struct QualifierDef QualTab[] = +{ + { "SHIFT", (IEQUALIFIER_LSHIFT|IEQUALIFIER_RSHIFT) }, + { "LSHIFT", IEQUALIFIER_LSHIFT }, + { "RSHIFT", IEQUALIFIER_RSHIFT }, + { "CONTROL", IEQUALIFIER_CONTROL }, + { "ALT", (IEQUALIFIER_LALT|IEQUALIFIER_RALT) }, + { "LALT", IEQUALIFIER_LALT }, + { "RALT", IEQUALIFIER_RALT }, + { "COMMAND", (IEQUALIFIER_LCOMMAND|IEQUALIFIER_RCOMMAND) }, + { "LCOMMAND", IEQUALIFIER_LCOMMAND }, + { "RCOMMAND", IEQUALIFIER_RCOMMAND }, + { "MIDBUTTON", IEQUALIFIER_MIDBUTTON }, + { "RBUTTON", IEQUALIFIER_RBUTTON }, + { "LEFTBUTTON", IEQUALIFIER_LEFTBUTTON }, + { NULL, 0 } +}; +*/ + +Object *MakeCheck(STRPTR label, STRPTR help, ULONG check) +{ + Object *obj = MUI_MakeObject(MUIO_Checkmark, label); + if (obj) + { + SetAttrs(obj, MUIA_CycleChain, 1, + MUIA_Selected, check, + MUIA_ShortHelp, help, + TAG_DONE); + } + + return (obj); +} + +#define String2(contents,maxlen)\ + (void *)StringObject,\ + StringFrame,\ + MUIA_CycleChain, 1,\ + MUIA_String_MaxLen , maxlen,\ + MUIA_String_Contents, contents,\ + End + +#define LOAD_DATALONG(obj,attr,cfg_attr,defaultval) \ + { \ + LONG *ptrd; \ + if((ptrd = (LONG *) DoMethod(msg->configdata, MUIM_Dataspace_Find, cfg_attr))) \ + set(obj, attr, *ptrd); \ + else \ + set(obj, attr, defaultval); \ + } + +#define SAVE_DATALONG(obj,attr,cfg_attr) \ + { \ + LONG ptrd=0; \ + get(obj, attr, &ptrd); \ + DoMethod(msg->configdata, MUIM_Dataspace_Add, &ptrd, 8, cfg_attr); \ + } + +#define LOAD_DATASPEC(obj,attr,cfg_attr,defaultval) \ + { \ + LONG ptrd; \ + if((ptrd = DoMethod(msg->configdata, MUIM_Dataspace_Find, cfg_attr))) \ + set(obj, attr, ptrd); \ + else \ + set(obj, attr, defaultval); \ + } + +#define SAVE_DATASPEC(obj,attr,cfg_attr) \ + { \ + LONG ptrd=0; \ + get(obj, attr, &ptrd); \ + if (ptrd) \ + DoMethod(msg->configdata, MUIM_Dataspace_Add, ptrd, sizeof(struct MUI_PenSpec), cfg_attr); \ + } + +#define SAVE_DATASPEC2(obj,attr,cfg_attr) \ + { \ + LONG ptrd=0; \ + get(obj, attr, &ptrd); \ + if (ptrd) \ + DoMethod(msg->configdata, MUIM_Dataspace_Add, ptrd, sizeof(struct MUI_ImageSpec), cfg_attr); \ + } + +#define LOAD_DATAFONT(obj,cfg_attr) \ + { \ + LONG ptrd; \ + if((ptrd = DoMethod(msg->configdata, MUIM_Dataspace_Find, cfg_attr))) \ + set(obj, MUIA_String_Contents, ptrd); \ + else \ + set(obj, MUIA_String_Contents, ""); \ + } + +#define SAVE_DATAFONT(obj,cfg_attr) \ + { \ + IPTR ptrd=0; \ + get(obj, MUIA_String_Contents, &ptrd); \ + if (ptrd) \ + { \ + LONG dlen = strlen((char *) ptrd) + 1; \ + if (dlen > 2) \ + DoMethod(msg->configdata, MUIM_Dataspace_Add, ptrd, dlen, cfg_attr); \ + else \ + DoMethod(msg->configdata, MUIM_Dataspace_Remove, cfg_attr); \ + } \ + } + +/* *********************************************************************** */ + +static DEFAULT_KEYS_ARRAY + +static ULONG keytags[] = +{ + KEYTAG_QUALIFIER_MULTISELECT , + KEYTAG_QUALIFIER_DRAG , + KEYTAG_QUALIFIER_BALANCE , + KEYTAG_COPY_TO_CLIPBOARD , + KEYTAG_DEFAULT_WIDTH_COLUMN , + KEYTAG_DEFAULT_WIDTH_ALL_COLUMNS, + KEYTAG_DEFAULT_ORDER_COLUMN , + KEYTAG_DEFAULT_ORDER_ALL_COLUMNS, + KEYTAG_SELECT_TO_TOP , + KEYTAG_SELECT_TO_BOTTOM , + KEYTAG_SELECT_TO_PAGE_UP , + KEYTAG_SELECT_TO_PAGE_DOWN , + KEYTAG_SELECT_UP , + KEYTAG_SELECT_DOWN , + KEYTAG_TOGGLE_ACTIVE , + KEYTAG_QUALIFIER_WHEEL_FAST , + KEYTAG_QUALIFIER_WHEEL_HORIZ , + KEYTAG_QUALIFIER_TITLECLICK2 , + 0 +}; + + + +static struct KeyBinding empty_key = { 0, (UWORD)-1, 0 }; + +/* *********************************************************************** */ + +/* +static const char *MainTextArray[] = +{ + "If you have problems, try to increase the stack value,", + "in the icon infos if you launch the program from icon,", + "stack of CLI if you start it from CLI/Shell,", + "and if you launch it from some utility read its docs", + "to see how to increase it.", + "A stack of 12Kb, 16Kb or 20Kb is most of time a good idea.", + " ", + "If you still have problems, try to see if they happen with the Demo prog, then tell me.", + "\033C", + "Latest public release can be found on aminet (dev/mui).", + "All releases are available on", + "http://www.sourceforge.net/projects/nlist-classes/", + "\033C", + "\033r\0333(C) 2001-2007 by NList Open Source Team", + "\033r\0333(C) 1996-1998 by Gilles Masson", + "\033r\0333http://www.sourceforge.net/projects/nlist-classes/", + "\033C", + "\033cThis new list/listview custom class", + "\033chandles its own configurable backgrounds,", + "\033cpens, fonts, scrollbars, keys and qualifiers", + "\033C", + "\033cThe way used to handle cursor with multiselection", + "\033cis not exactly as the listview one !", + "\033cDrag&Drop is supported, both scrollbars", + "\033ccan be configured to disappear automatically", + "\033cwhen not needed because all is visible.", + "\033cJust try it...", + "\033C", + "\033cYou can horizontaly scroll with cursor keys,", + "\033cor going on the right and left of the list", + "\033cwhile selecting with the mouse.", + "\033cTry just clicking on the left/right borders !", + "\033C", + "\033cYou can change columns widths just dragging", + "\033cthe vertical separator between columns titles", + "\033c(try it using the balancing qualifier too).", + "\033C", + "\033cYou can change columns order just dragging", + "\033cthe column titles.", + "\033C", + "\033cThere is builtin copy to clipboard stuff", + "\033cand classic char selection capability.", + "\033C", + "\033cTry the Demo program to test all that...", + " ", + " ", + "\033r\033bGive some feedback about it ! :-)", + "\033C", + "**************************************************************************************************", + NULL +}; +*/ + +// static arrays which we fill up later on +static const char *Pages[6]; +static const char *RS_ColWidthDrag[4]; +static const char *RS_VSB[4]; +static const char *RS_HSB[5]; +static const char *RS_Menu[4]; +static const char *RS_MultiSelects[3]; +static const char *RS_DragTypes[4]; +static const char *functions_names[20]; + +static LONG DeadKeyConvert(struct NListviews_MCP_Data *data,struct KeyBinding *key) +{ + char *text = data->rawtext; + char keystr[8]; + UWORD qual = key->kb_Qualifier & KBQUAL_MASK; + UWORD same = key->kb_Qualifier & KBSYM_MASK; + int posraw; + + text[0] = '\0'; + + if (qual) + { if ((qual & KBQUALIFIER_CAPS) && (same & KBSYM_CAPS)) + strlcat(text, (char *)"caps ", sizeof(data->rawtext)); + else if ((qual & KBQUALIFIER_SHIFT) && (same & KBSYM_SHIFT)) + { strlcat(text, (char *)"shift ", sizeof(data->rawtext)); + if (qual & IEQUALIFIER_CAPSLOCK) strlcat(text, (char *)"capslock ", sizeof(data->rawtext)); + } + else + { if (qual & IEQUALIFIER_LSHIFT) strlcat(text, (char *)"lshift ", sizeof(data->rawtext)); + if (qual & IEQUALIFIER_RSHIFT) strlcat(text, (char *)"rshift ", sizeof(data->rawtext)); + if (qual & IEQUALIFIER_CAPSLOCK) strlcat(text, (char *)"capslock ", sizeof(data->rawtext)); + } + if (qual & IEQUALIFIER_CONTROL) strlcat(text, (char *)"control ", sizeof(data->rawtext)); + if ((qual & KBQUALIFIER_ALT) && (same & KBSYM_ALT)) + strlcat(text, (char *)"alt ", sizeof(data->rawtext)); + else + { if (qual & IEQUALIFIER_LALT) strlcat(text, (char *)"lalt ", sizeof(data->rawtext)); + if (qual & IEQUALIFIER_RALT) strlcat(text, (char *)"ralt ", sizeof(data->rawtext)); + } + if (qual & IEQUALIFIER_LCOMMAND) strlcat(text, (char *)"lcommand ", sizeof(data->rawtext)); + if (qual & IEQUALIFIER_RCOMMAND) strlcat(text, (char *)"rcommand ", sizeof(data->rawtext)); + if (qual & IEQUALIFIER_NUMERICPAD) strlcat(text, (char *)"numpad ", sizeof(data->rawtext)); + } + + if (!(key->kb_KeyTag & 0x00004000) && (key->kb_Code != (UWORD)~0)) + { + switch (key->kb_Code & 0x7F) + { + case 0x40 : strlcat(text,"space", sizeof(data->rawtext)); break; + case 0x41 : strlcat(text,"backspace", sizeof(data->rawtext)); break; + case 0x42 : strlcat(text,"tab", sizeof(data->rawtext)); break; + case 0x43 : strlcat(text,"enter", sizeof(data->rawtext)); break; + case 0x44 : strlcat(text,"return", sizeof(data->rawtext)); break; + case 0x45 : strlcat(text,"esc", sizeof(data->rawtext)); break; + case 0x46 : strlcat(text,"del", sizeof(data->rawtext)); break; + case 0x4C : strlcat(text,"up", sizeof(data->rawtext)); break; + case 0x4D : strlcat(text,"down", sizeof(data->rawtext)); break; + case 0x4E : strlcat(text,"right", sizeof(data->rawtext)); break; + case 0x4F : strlcat(text,"left", sizeof(data->rawtext)); break; + case 0x50 : strlcat(text,"f1", sizeof(data->rawtext)); break; + case 0x51 : strlcat(text,"f2", sizeof(data->rawtext)); break; + case 0x52 : strlcat(text,"f3", sizeof(data->rawtext)); break; + case 0x53 : strlcat(text,"f4", sizeof(data->rawtext)); break; + case 0x54 : strlcat(text,"f5", sizeof(data->rawtext)); break; + case 0x55 : strlcat(text,"f6", sizeof(data->rawtext)); break; + case 0x56 : strlcat(text,"f7", sizeof(data->rawtext)); break; + case 0x57 : strlcat(text,"f8", sizeof(data->rawtext)); break; + case 0x58 : strlcat(text,"f9", sizeof(data->rawtext)); break; + case 0x59 : strlcat(text,"f10", sizeof(data->rawtext)); break; + case 0x5F : strlcat(text,"help", sizeof(data->rawtext)); break; + default: + data->ievent.ie_NextEvent = NULL; + data->ievent.ie_Class = IECLASS_RAWKEY; + data->ievent.ie_SubClass = 0; + data->ievent.ie_Code = key->kb_Code; + data->ievent.ie_Qualifier = 0; + data->ievent.ie_position.ie_addr = (APTR) &data->ievent; + posraw = RawKeyConvert(&data->ievent, keystr, sizeof(keystr), 0L); + + if (posraw > 0) + { + keystr[posraw] = '\0'; + strlcat(text, keystr, sizeof(data->rawtext)); + } + break; + } + } + + return ((LONG)strlen(data->rawtext)); +} + + +static LONG NL_SaveKeys(struct NListviews_MCP_Data *data) +{ + LONG pos,ne = 0; + struct KeyBinding *key; + get(data->mcp_listkeys, MUIA_NList_Entries, &ne); + ne++; + data->nlkeys_size = ne*sizeof(struct KeyBinding); + + if((data->nlkeys = (struct KeyBinding *) AllocMem(data->nlkeys_size+4,0L))) + { + pos = 0; + + while (pos < ne) + { + DoMethod(data->mcp_listkeys,MUIM_NList_GetEntry,pos, &key); + if (key) + { + data->nlkeys[pos] = *key; + if (data->nlkeys[pos].kb_KeyTag & 0x00004000) + data->nlkeys[pos].kb_Code = (UWORD)~0; + } + else + break; + pos++; + } + + data->nlkeys[pos].kb_KeyTag = 0L; + data->nlkeys[pos].kb_Code = (UWORD)~0; + data->nlkeys[pos].kb_Qualifier = 0; + pos++; + ne = ((pos * sizeof(struct KeyBinding)) + 3) & 0xFFFFFFFC; + + return (ne); + } + + return (0); +} + + +static void NL_LoadKeys(Object *list,struct KeyBinding *keys) +{ + int i = 0; + set(list, MUIA_NList_Quiet, TRUE); + DoMethod(list,MUIM_NList_Clear); + while (keys[i].kb_KeyTag) + { DoMethod(list,MUIM_NList_InsertSingle,&keys[i], MUIV_NList_Insert_Bottom); + i++; + } + set(list, MUIA_NList_Quiet, FALSE); +} + + +static void NL_UpdateKeys(Object *list,struct KeyBinding *keys) +{ + int i; + LONG pos,posmax = -1; + struct KeyBinding *key; + set(list, MUIA_NList_Quiet, TRUE); + get(list,MUIA_NList_Entries,&posmax); + for (i = 0; keys[i].kb_KeyTag; i++) + { + for (pos = 0; pos < posmax; pos++) + { + DoMethod(list,MUIM_NList_GetEntry, pos, &key); + if (key && (key->kb_KeyTag == keys[i].kb_KeyTag)) + break; +/* +{ +LONG k1 = (LONG) key->kb_KeyTag; +LONG k2 = (LONG) keys[i].kb_KeyTag; +kprintf("%lx|pos=%ld key=%lx kt=%lx (== %lx)\n",list,pos,key,k1,k2); +} +else +{ +LONG k1 = (LONG) key->kb_KeyTag; +LONG k2 = (LONG) keys[i].kb_KeyTag; +kprintf("%lx|pos=%ld key=%lx kt=%lx (!= %lx)\n",list,pos,key,k1,k2); +} +*/ + } + if (pos >= posmax) + DoMethod(list,MUIM_NList_InsertSingle,&keys[i], MUIV_NList_Insert_Bottom); + } + set(list, MUIA_NList_Quiet, FALSE); +} + +HOOKPROTONH(StrObjFunc, LONG, Object *pop, Object *str) +{ + LONG i = 0; + + get(str,MUIA_UserData,&i); + if (i >= 0) + set(pop,MUIA_List_Active,i); + else + set(pop,MUIA_List_Active,MUIV_List_Active_Off); + return(TRUE); +} +MakeStaticHook(StrObjHook, StrObjFunc); + +HOOKPROTONH(ObjStrFunc, VOID, Object *pop, Object *str) +{ + LONG i = -1; + get(pop,MUIA_List_Active,&i); + if (i >= 0) + { + set(str,MUIA_UserData,i); + set(str,MUIA_Text_Contents,functions_names[i]); + } + else + { i = -1; + set(str,MUIA_UserData,i); + set(str,MUIA_Text_Contents,""); + } +} +MakeStaticHook(ObjStrHook, ObjStrFunc); + + +HOOKPROTONH(WindowFunc, VOID, Object *pop, Object *win) +{ + set(win,MUIA_Window_DefaultObject,pop); +} +MakeStaticHook(WindowHook, WindowFunc); + + +HOOKPROTONH(TxtFctFunc, VOID, Object *list, long *val) +{ + Object *txtfct = (Object *) val[0]; + struct KeyBinding *key = NULL; + LONG i = -1; + get(txtfct,MUIA_UserData,&i); + DoMethod(list,MUIM_NList_GetEntry,MUIV_NList_GetEntry_Active, &key); + if (key && (i >= 0)) + { key->kb_KeyTag = keytags[i]; + DoMethod(list,MUIM_NList_Redraw,MUIV_NList_Redraw_Active); + get(list,MUIA_NList_Active,&i); + set(list,MUIA_NList_Active,i); + } +} +MakeStaticHook(TxtFctHook, TxtFctFunc); + +HOOKPROTONH(AckFunc, VOID, Object *list, long *val) +{ + Object *stringkey = (Object *) val[0]; + struct KeyBinding *key = NULL; + char *ackstr = NULL; + get(stringkey,MUIA_String_Contents, &ackstr); + DoMethod(list,MUIM_NList_GetEntry,MUIV_NList_GetEntry_Active, &key); + if (ackstr && key) + { + IX ix; + ix.ix_Version = IX_VERSION; + ParseIX(ackstr,&ix); + key->kb_Qualifier = (ix.ix_Qualifier & KBQUAL_MASK) | ((ix.ix_QualSame << 12) & KBSYM_MASK); + key->kb_Code = ix.ix_Code; + DoMethod(list,MUIM_NList_Redraw,MUIV_NList_Redraw_Active); + } +} +MakeStaticHook(AckHook, AckFunc); + +HOOKPROTONH(ActiveFunc, VOID, Object *list, long *val) +{ + struct NListviews_MCP_Data *data = (struct NListviews_MCP_Data *) (val[0]); +/* Object *win = NULL;*/ + ULONG active = (ULONG) (val[1]); + struct KeyBinding *key = NULL; + if((LONG)active >= 0) + { + DoMethod(list,MUIM_NList_GetEntry,MUIV_NList_GetEntry_Active, &key); + + if (key) + { LONG i; + i = 0; + while ((keytags[i] > 0) && (keytags[i] != key->kb_KeyTag)) + i++; + if (keytags[i] == key->kb_KeyTag) + { nnset(data->mcp_stringkey,MUIA_HotkeyString_Snoop, FALSE); + nnset(data->mcp_stringkey,MUIA_Disabled, FALSE); + nnset(data->mcp_snoopkey,MUIA_Disabled, FALSE); + nnset(data->mcp_txtfct,MUIA_UserData,i); + nnset(data->mcp_txtfct,MUIA_Text_Contents,functions_names[i]); + + DeadKeyConvert(data,key); + nnset(data->mcp_stringkey,MUIA_String_Contents, data->rawtext); +/* + get(list, MUIA_WindowObject, &win); + if (win) + set(win, MUIA_Window_ActiveObject, data->mcp_stringkey); +*/ + } + else + key = NULL; + } + } + if (!key) + { nnset(data->mcp_txtfct,MUIA_UserData,-1); + nnset(data->mcp_txtfct,MUIA_Text_Contents,""); + nnset(data->mcp_stringkey,MUIA_String_Contents, ""); + nnset(data->mcp_stringkey,MUIA_Disabled, TRUE); + nnset(data->mcp_snoopkey,MUIA_Disabled, TRUE); + } +} +MakeStaticHook(ActiveHook, ActiveFunc); + + +HOOKPROTONHNP(DefaultFunc, VOID, Object *list) +{ + if (list) + NL_LoadKeys(list,default_keys); +} +MakeStaticHook(DefaultHook, DefaultFunc); + +HOOKPROTONHNP(UpdateFunc, VOID, Object *list) +{ + if (list) + NL_UpdateKeys(list,default_keys); +} +MakeStaticHook(UpdateHook, UpdateFunc); + +HOOKPROTONHNP(InsertFunc, VOID, Object *list) +{ + if (list) + { struct KeyBinding *key; + LONG pos = 0; + DoMethod(list,MUIM_NList_GetEntry,MUIV_NList_GetEntry_Active, &key); + if (!key) + { empty_key.kb_KeyTag = keytags[0]; + key = &empty_key; + } + set(list,MUIA_NList_Quiet,TRUE); + DoMethod(list,MUIM_NList_InsertSingle,key, MUIV_NList_Insert_Active); + get(list,MUIA_NList_InsertPosition,&pos); + set(list,MUIA_NList_Active,pos); + set(list,MUIA_NList_Quiet,FALSE); + } +} +MakeStaticHook(InsertHook, InsertFunc); + +HOOKPROTONH(DisplayFunc, VOID, Object *obj, struct NList_DisplayMessage *ndm) +{ + struct KeyBinding *key = (struct KeyBinding *) ndm->entry; + struct NListviews_MCP_Data *data = NULL; + get(obj,MUIA_UserData,&data); + + if (key && data) + { + LONG i; + + ndm->preparses[0] = (STRPTR)"\033r"; + + DeadKeyConvert(data,key); + ndm->strings[0] = data->rawtext; + + ndm->strings[1] = (STRPTR)"\033c="; + + i = 0; + while ((keytags[i] > 0) && (keytags[i] != key->kb_KeyTag)) + i++; + ndm->strings[2] = (STRPTR)functions_names[i]; + } + else + { + ndm->preparses[0] = (STRPTR)"\033r"; + ndm->strings[0] = (STRPTR)tr(MSG_HOTKEYS_KEY); + ndm->strings[1] = (STRPTR)""; + ndm->strings[2] = (STRPTR)tr(MSG_HOTKEYS_ACTION); + } +} +MakeStaticHook(DisplayHook, DisplayFunc); + +HOOKPROTONHNO(ConstructFunc, APTR, struct NList_ConstructMessage *ncm) +{ + struct KeyBinding *key = (struct KeyBinding *) ncm->entry; + + struct KeyBinding *key2 = (struct KeyBinding *) AllocMem(sizeof(struct KeyBinding),0L); + if (key2) + *key2 = *key; + + return ((APTR) key2); +} +MakeStaticHook(ConstructHook, ConstructFunc); + +HOOKPROTONHNO(DestructFunc, VOID, struct NList_DestructMessage *ndm) +{ + struct KeyBinding *key = (struct KeyBinding *) ndm->entry; + + FreeMem((void *) key,sizeof(struct KeyBinding)); +} +MakeStaticHook(DestructHook, DestructFunc); + +static IPTR mNL_MCP_New(struct IClass *cl,Object *obj,struct opSet *msg) +{ + struct NListviews_MCP_Data *data; + APTR group1, group2, group3, group4, group5; + char *exampleText; + + static const char infotext[] = "\033bNListviews.mcp " LIB_REV_STRING "\033n (" LIB_DATE ")\n" + "Copyright (c) 1996-2001 Gilles Masson\n" + LIB_COPYRIGHT "\n\n" + "Distributed under the terms of the LGPL2.\n\n" + "For the latest version, check out:\n" + "http://www.sf.net/projects/nlist-classes/\n\n"; + + if(!(obj = (Object *)DoSuperMethodA(cl, obj,(Msg) msg))) + return(0); + + data = INST_DATA(cl,obj); + + group1 = group2 = group3 = group4 = group5 = NULL; + + data->mcp_group = NULL; + data->mcp_list1 = NULL; + data->mcp_list2 = NULL; + data->mcp_PenTitle = NULL; + data->mcp_PenList = NULL; + data->mcp_PenSelect = NULL; + data->mcp_PenCursor = NULL; + data->mcp_PenUnselCur = NULL; + data->mcp_PenInactive = NULL; + data->mcp_BG_Title = NULL; + data->mcp_BG_List = NULL; + data->mcp_BG_Select = NULL; + data->mcp_BG_Cursor = NULL; + data->mcp_BG_UnselCur = NULL; + data->mcp_BG_Inactive = NULL; + data->mcp_R_Multi = NULL; + data->mcp_B_MultiMMB = NULL; + data->mcp_R_Drag = NULL; + data->mcp_SL_VertInc = NULL; + data->mcp_R_HSB = NULL; + data->mcp_R_VSB = NULL; + data->mcp_B_Smooth = NULL; + data->mcp_Font = NULL; + data->mcp_Font_Little = NULL; + data->mcp_Font_Fixed = NULL; + data->mcp_ForcePen = NULL; + data->mcp_ColWidthDrag = NULL; + data->mcp_PartialCol = NULL; + data->mcp_List_Select = NULL; + data->mcp_NList_Menu = NULL; + data->mcp_PartialChar = NULL; + data->mcp_SerMouseFix = NULL; + data->mcp_DragLines = NULL; + data->mcp_WheelStep = NULL; + data->mcp_WheelFast = NULL; + data->mcp_WheelMMB = NULL; + data->mcp_listkeys = NULL; + data->mcp_stringkey = NULL; + data->mcp_snoopkey = NULL; + data->mcp_insertkey = NULL; + data->mcp_removekey = NULL; + data->mcp_defaultkeys = NULL; + data->mcp_updatekeys = NULL; + data->mcp_txtfct = NULL; + data->mcp_popstrfct = NULL; + data->mcp_poplistfct = NULL; + data->nlkeys = NULL; + + data->mcp_stringkey = HotkeyStringObject, + StringFrame, MUIA_CycleChain, 1, + MUIA_HotkeyString_Snoop, FALSE, + MUIA_Disabled,TRUE, + End; + + if(data->mcp_stringkey == NULL) + { + data->mcp_stringkey = StringObject, + StringFrame, MUIA_CycleChain, 1, + End; + } + + // create a duplicate of the translated text + if((exampleText = AllocVec((strlen(tr(MSG_EXAMPLE_TEXT))+1)*sizeof(char), MEMF_ANY)) != NULL) + { + char *p; + LONG numLines = 0; + + // copy the text + strcpy(exampleText, tr(MSG_EXAMPLE_TEXT)); + + // count the number of lines + p = exampleText; + while((p = strchr(p, '\n')) != NULL) + { + numLines++; + p++; + } + + // finally split the text into separate lines + if((data->exampleText = AllocVec((numLines+2)*sizeof(char *), MEMF_ANY|MEMF_CLEAR)) != NULL) + { + LONG line; + + p = exampleText; + for(line = 0; line < numLines; line++) + { + char *q; + + q = strchr(p, '\n'); + *q++ = '\0'; + data->exampleText[line] = AllocVec((strlen(p)+1)*sizeof(char), MEMF_ANY); + strcpy(data->exampleText[line], p); + p = q; + } + } + + FreeVec(exampleText); + } + + group1 = GroupObject, + + Child, VGroup, + GroupFrameT(tr(MSG_GROUP_EXAMPLE)), + + Child, data->mcp_list1 = NListviewObject, + MUIA_CycleChain, 1, + MUIA_NList_Title,"\033cNList / NListview", + MUIA_NList_TitleSeparator, TRUE, + MUIA_NListview_Vert_ScrollBar, MUIV_NListview_VSB_Default, + MUIA_NListview_Horiz_ScrollBar, MUIV_NListview_HSB_Default, + MUIA_NList_DefaultObjectOnClick, TRUE, + MUIA_NList_SourceArray, data->exampleText/*MainTextArray*/, + End, + End, + + Child, GroupObject, + GroupFrameT(tr(MSG_FONTS)), + GroupSpacing(2), + MUIA_Group_Columns, 2, + + MUIA_Weight,(ULONG)30, + Child, Label(tr(MSG_NORMAL_FONT)), + Child, data->mcp_Font = PopaslObject, + MUIA_Popstring_String, String2(0,80), + MUIA_Popstring_Button, PopButton(MUII_PopUp), + MUIA_Popasl_Type, ASL_FontRequest, + MUIA_ShortHelp, tr(MSG_NORMAL_FONT_HELP), + ASLFO_TitleText, tr(MSG_NORMAL_FONT_ASL), + End, + + Child, Label(tr(MSG_SMALL_FONT)), + Child, data->mcp_Font_Little = PopaslObject, + MUIA_Popstring_String, String2(0,80), + MUIA_Popstring_Button, PopButton(MUII_PopUp), + MUIA_Popasl_Type, ASL_FontRequest, + MUIA_ShortHelp, tr(MSG_SMALL_FONT_HELP), + ASLFO_TitleText, tr(MSG_SMALL_FONT_ASL), + End, + + Child, Label(tr(MSG_FIXED_FONT)), + Child, data->mcp_Font_Fixed = PopaslObject, + MUIA_Popstring_String, String2(0,80), + MUIA_Popstring_Button, PopButton(MUII_PopUp), + MUIA_Popasl_Type, ASL_FontRequest, + MUIA_ShortHelp, tr(MSG_FIXED_FONT_HELP), + ASLFO_TitleText, tr(MSG_FIXED_FONT_ASL), + ASLFO_FixedWidthOnly, TRUE, + End, + + Child, Label(tr(MSG_FONT_MARGIN)), + Child, data->mcp_SL_VertInc = SliderObject, + MUIA_CycleChain, 1, + MUIA_Numeric_Min, 0, + MUIA_Numeric_Max, 9, + MUIA_Numeric_Value, 1, + MUIA_ShortHelp, tr(MSG_FONT_MARGIN_HELP), + End, + + End, + End; + + group2 = VGroup, + Child, VGroup, + GroupFrameT(tr(MSG_COLORS)), + GroupSpacing(2), + MUIA_VertWeight, 85, + MUIA_Group_Columns, 3, + + Child, RectangleObject, + MUIA_VertWeight, 0, + MUIA_Rectangle_HBar, TRUE, + MUIA_Rectangle_BarTitle, tr(MSG_TEXTCOLOR), + End, + Child, HSpace(0), + Child, RectangleObject, + MUIA_VertWeight, 0, + MUIA_Rectangle_HBar, TRUE, + MUIA_Rectangle_BarTitle, tr(MSG_BACKGROUNDCOLOR), + End, + + Child, data->mcp_PenTitle = PoppenObject, + MUIA_CycleChain, 1, + MUIA_Window_Title, tr(MSG_TITLE_PEN_WIN), + MUIA_Draggable, TRUE, + MUIA_ShortHelp, tr(MSG_TITLE_PEN_HELP), + End, + Child, VCenter(Label(tr(MSG_PBG_TITLE))), + Child, data->mcp_BG_Title = PopimageObject, + MUIA_CycleChain, 1, + MUIA_Imageadjust_Type, MUIV_Imageadjust_Type_Background, + MUIA_Window_Title, tr(MSG_TITLE_BG_WIN), + MUIA_Draggable, TRUE, + MUIA_ShortHelp, tr(MSG_TITLE_BG_HELP), + End, + + Child, data->mcp_PenList = PoppenObject, + MUIA_CycleChain, 1, + MUIA_Window_Title, tr(MSG_LIST_PEN_WIN), + MUIA_Draggable, TRUE, + MUIA_ShortHelp, tr(MSG_LIST_PEN_HELP), + End, + Child, VCenter(Label(tr(MSG_PBG_LIST))), + Child, data->mcp_BG_List = PopimageObject, + MUIA_CycleChain, 1, + MUIA_Imageadjust_Type, MUIV_Imageadjust_Type_Background, + MUIA_Window_Title, tr(MSG_LIST_BG_WIN), + MUIA_Draggable, TRUE, + MUIA_ShortHelp, tr(MSG_LIST_BG_HELP), + End, + + Child, data->mcp_PenSelect = PoppenObject, + MUIA_CycleChain, 1, + MUIA_Window_Title, tr(MSG_SELECT_PEN_WIN), + MUIA_Draggable, TRUE, + MUIA_ShortHelp, tr(MSG_SELECT_PEN_HELP), + End, + Child, VCenter(Label(tr(MSG_PBG_SELECT))), + Child, data->mcp_BG_Select = PopimageObject, + MUIA_CycleChain, 1, + MUIA_Imageadjust_Type, MUIV_Imageadjust_Type_Background, + MUIA_Window_Title, tr(MSG_SELECT_BG_WIN), + MUIA_Draggable, TRUE, + MUIA_ShortHelp, tr(MSG_SELECT_BG_HELP), + End, + + Child, data->mcp_PenCursor = PoppenObject, + MUIA_CycleChain, 1, + MUIA_Window_Title, tr(MSG_CURSOR_PEN_WIN), + MUIA_Draggable, TRUE, + MUIA_ShortHelp, tr(MSG_CURSOR_PEN_HELP), + End, + Child, VCenter(Label(tr(MSG_PBG_CURSOR))), + Child, data->mcp_BG_Cursor = PopimageObject, + MUIA_CycleChain, 1, + MUIA_Imageadjust_Type, MUIV_Imageadjust_Type_Background, + MUIA_Window_Title, tr(MSG_CURSOR_BG_WIN), + MUIA_Draggable, TRUE, + MUIA_ShortHelp, tr(MSG_CURSOR_BG_HELP), + End, + + Child, data->mcp_PenUnselCur = PoppenObject, + MUIA_CycleChain, 1, + MUIA_Window_Title, tr(MSG_UNSEL_PEN_WIN), + MUIA_Draggable, TRUE, + MUIA_ShortHelp, tr(MSG_UNSEL_PEN_HELP), + End, + Child, VCenter(Label(tr(MSG_PBG_UNSEL))), + Child, data->mcp_BG_UnselCur = PopimageObject, + MUIA_CycleChain, 1, + MUIA_Imageadjust_Type, MUIV_Imageadjust_Type_Background, + MUIA_Window_Title, tr(MSG_UNSEL_BG_WIN), + MUIA_Draggable, TRUE, + MUIA_ShortHelp, tr(MSG_UNSEL_BG_HELP), + End, + + Child, data->mcp_PenInactive = PoppenObject, + MUIA_CycleChain, 1, + MUIA_Window_Title, tr(MSG_INACT_PEN_WIN), + MUIA_Draggable, TRUE, + MUIA_ShortHelp, tr(MSG_INACT_PEN_HELP), + End, + Child, VCenter(Label(tr(MSG_PBG_INACT))), + Child, data->mcp_BG_Inactive = PopimageObject, + MUIA_CycleChain, 1, + MUIA_Imageadjust_Type, MUIV_Imageadjust_Type_Background, + MUIA_Window_Title, tr(MSG_INACT_BG_WIN), + MUIA_Draggable, TRUE, + MUIA_ShortHelp, tr(MSG_INACT_BG_HELP), + End, + + End, + + Child, VGroup, + GroupFrameT(tr(MSG_COLOR_OPTIONS)), + MUIA_VertWeight, 15, + + Child, VSpace(0), + Child, HGroup, + Child, HSpace(0), + Child, data->mcp_ForcePen = ImageObject, + ImageButtonFrame, + MUIA_InputMode, MUIV_InputMode_Toggle, + MUIA_Image_Spec, MUII_CheckMark, + MUIA_Image_FreeVert, TRUE, + MUIA_Background, MUII_ButtonBack, + MUIA_ShowSelState, FALSE, + End, + Child, Label(tr(MSG_FORCE_SELECT_PEN)), + MUIA_ShortHelp, tr(MSG_FORCE_SELECT_PEN_HELP), + Child, HSpace(0), + End, + Child, VSpace(0), + End, + End; + + RS_VSB[0] = tr(MSG_VSB_ALWAYS); + RS_VSB[1] = tr(MSG_VSB_AUTO); + RS_VSB[2] = tr(MSG_VSB_FULLAUTO); + RS_VSB[3] = NULL; + + RS_HSB[0] = tr(MSG_HSB_ALWAYS); + RS_HSB[1] = tr(MSG_HSB_AUTO); + RS_HSB[2] = tr(MSG_HSB_FULLAUTO); + RS_HSB[3] = tr(MSG_HSB_NONE); + RS_HSB[4] = NULL; + + group3 = VGroup, + + Child, HGroup, + Child, HGroup, + GroupFrameT(tr(MSG_SB_HORIZONTAL)), + Child, HSpace(0), + Child, VGroup, + Child, VSpace(0), + Child, data->mcp_R_HSB = RadioObject, + MUIA_Radio_Entries, RS_HSB, + End, + MUIA_ShortHelp, tr(MSG_SB_HORIZONTAL_HELP), + Child, VSpace(0), + End, + Child, HSpace(0), + End, + + Child, HGroup, + GroupFrameT(tr(MSG_SB_VERTICAL)), + Child, HSpace(0), + Child, VGroup, + Child, VSpace(0), + Child, data->mcp_R_VSB = RadioObject, + MUIA_Radio_Entries,RS_VSB, + End, + MUIA_ShortHelp, tr(MSG_SB_VERTICAL_HELP), + Child, VSpace(0), + End, + Child, HSpace(0), + End, + Child, VSpace(0), + End, + + Child, VGroup, + GroupFrameT(tr(MSG_SCROLLCONTROL)), + Child, VSpace(0), + + Child, ColGroup(2), + Child, HSpace(0), + Child, HGroup, + Child, data->mcp_B_Smooth = ImageObject, + ImageButtonFrame, + MUIA_InputMode, MUIV_InputMode_Toggle, + MUIA_Image_Spec, MUII_CheckMark, + MUIA_Image_FreeVert, TRUE, + MUIA_Background, MUII_ButtonBack, + MUIA_ShowSelState, FALSE, + End, + Child, Label(tr(MSG_SMOOTH_SCROLLING)), + MUIA_ShortHelp, tr(MSG_SMOOTH_SCROLLING_HELP), + Child, HSpace(0), + End, + + Child, HSpace(0), + Child, HGroup, + Child, data->mcp_WheelMMB = ImageObject, + ImageButtonFrame, + MUIA_InputMode, MUIV_InputMode_Toggle, + MUIA_Image_Spec, MUII_CheckMark, + MUIA_Image_FreeVert, TRUE, + MUIA_Background, MUII_ButtonBack, + MUIA_ShowSelState, FALSE, + End, + Child, Label(tr(MSG_MMB_FASTWHEEL)), + MUIA_ShortHelp, tr(MSG_MMB_FASTWHEEL_HELP), + Child, HSpace(0), + End, + + Child, Label(tr(MSG_WHEEL_STEP)), + Child, data->mcp_WheelStep = SliderObject, + MUIA_CycleChain, 1, + MUIA_Numeric_Min, 1, + MUIA_Numeric_Max, 10, + MUIA_Numeric_Value, DEFAULT_WHEELSTEP, + MUIA_ShortHelp, tr(MSG_WHEEL_STEP_HELP), + End, + + Child, Label(tr(MSG_WHEEL_FAST)), + Child, data->mcp_WheelFast = SliderObject, + MUIA_CycleChain, 1, + MUIA_Numeric_Min, 1, + MUIA_Numeric_Max, 10, + MUIA_Numeric_Value, DEFAULT_WHEELFAST, + MUIA_ShortHelp, tr(MSG_WHEEL_FAST_HELP), + End, + End, + + Child, VSpace(0), + End, + + + End; + + + RS_MultiSelects[0] = tr(MSG_MULTISELECT_QUAL); + RS_MultiSelects[1] = tr(MSG_MULTISELECT_ALWAYS); + RS_MultiSelects[2] = NULL; + + RS_DragTypes[0] = tr(MSG_DRAGTYPE_IMMEDIATE); + RS_DragTypes[1] = tr(MSG_DRAGTYPE_BORDERS); + RS_DragTypes[2] = tr(MSG_DRAGTYPE_QUALIFIER); + RS_DragTypes[3] = NULL; + + RS_ColWidthDrag[0] = tr(MSG_COLWIDTHDRAG_TITLE); + RS_ColWidthDrag[1] = tr(MSG_COLWIDTHDRAG_FULLBAR); + RS_ColWidthDrag[2] = tr(MSG_COLWIDTHDRAG_VISIBLE); + RS_ColWidthDrag[3] = NULL; + + RS_Menu[0] = tr(MSG_CMENU_ALWAYS); + RS_Menu[1] = tr(MSG_CMENU_TOPONLY); + RS_Menu[2] = tr(MSG_CMENU_NEVER); + RS_Menu[3] = NULL; + + group4 = VGroup, + + Child, HGroup, + Child, VGroup, + Child, HGroup, + GroupFrameT(tr(MSG_MULTISELECT)), + + Child, HSpace(0), + Child, VGroup, + Child, VSpace(0), + + Child, HGroup, + Child, data->mcp_R_Multi = RadioObject, + MUIA_Radio_Entries, RS_MultiSelects, + MUIA_ShortHelp, tr(MSG_MULTISELECT_HELP), + End, + Child, HSpace(0), + End, + + Child, RectangleObject, + MUIA_VertWeight, 0, + MUIA_Rectangle_HBar, TRUE, + End, + + Child, HGroup, + Child, data->mcp_List_Select = ImageObject, + ImageButtonFrame, + MUIA_InputMode, MUIV_InputMode_Toggle, + MUIA_Image_Spec, MUII_CheckMark, + MUIA_Image_FreeVert, TRUE, + MUIA_Background, MUII_ButtonBack, + MUIA_ShowSelState, FALSE, + MUIA_Selected, TRUE, + End, + Child, Label(tr(MSG_MULTISEL_MOVEACTIVE)), + MUIA_ShortHelp, tr(MSG_MULTISEL_MOVEACTIVE_HELP), + Child, HSpace(0), + End, + + Child, HGroup, + Child, data->mcp_B_MultiMMB = ImageObject, + ImageButtonFrame, + MUIA_InputMode, MUIV_InputMode_Toggle, + MUIA_Image_Spec, MUII_CheckMark, + MUIA_Background, MUII_ButtonBack, + MUIA_ShowSelState, FALSE, + MUIA_Image_FreeVert,TRUE, + End, + Child, Label(tr(MSG_MMB_MULTISEL)), + MUIA_ShortHelp, tr(MSG_MMB_MULTISEL_HELP), + Child, HSpace(0), + End, + + Child, VSpace(0), + End, + Child, HSpace(0), + End, + + Child, HGroup, + GroupFrameT(tr(MSG_LAYOUT)), + Child, HSpace(0), + Child, VGroup, + Child, VSpace(0), + Child, HGroup, + Child, data->mcp_PartialCol = ImageObject, + ImageButtonFrame, + MUIA_InputMode, MUIV_InputMode_Toggle, + MUIA_Image_Spec, MUII_CheckMark, + MUIA_Image_FreeVert, TRUE, + MUIA_Background, MUII_ButtonBack, + MUIA_ShowSelState, FALSE, + MUIA_Selected, TRUE, + End, + Child, Label(tr(MSG_PARTIAL_COL_MARK)), + MUIA_ShortHelp, tr(MSG_PARTIAL_COL_MARK_HELP), + Child, HSpace(0), + End, + + Child, HGroup, + Child, data->mcp_PartialChar = ImageObject, + ImageButtonFrame, + MUIA_InputMode, MUIV_InputMode_Toggle, + MUIA_Image_Spec, MUII_CheckMark, + MUIA_Image_FreeVert, TRUE, + MUIA_Background, MUII_ButtonBack, + MUIA_ShowSelState, FALSE, + MUIA_Selected, FALSE, + End, + Child, Label(tr(MSG_PARTIAL_CHARS_DRAWN)), + MUIA_ShortHelp, tr(MSG_PARTIAL_CHARS_DRAWN_HELP), + Child, HSpace(0), + End, + + Child, HGroup, + Child, data->mcp_VerticalCenteredLines = ImageObject, + ImageButtonFrame, + MUIA_InputMode, MUIV_InputMode_Toggle, + MUIA_Image_Spec, MUII_CheckMark, + MUIA_Image_FreeVert, TRUE, + MUIA_Background, MUII_ButtonBack, + MUIA_ShowSelState, FALSE, + MUIA_Selected, FALSE, + End, + Child, Label(tr(MSG_VERT_CENTERED)), + MUIA_ShortHelp, tr(MSG_VERT_CENTERED_HELP), + Child, HSpace(0), + End, + + Child, VSpace(0), + End, + Child, HSpace(0), + End, + + End, + + Child, VGroup, + + Child, HGroup, + GroupFrameT(tr(MSG_DRAGDROP)), + + Child, VGroup, + Child, VSpace(0), + + Child, HGroup, + Child, HSpace(0), + Child, data->mcp_R_Drag = RadioObject, + MUIA_Radio_Entries, RS_DragTypes, + MUIA_ShortHelp, tr(MSG_DRAGTYPE_HELP), + End, + Child, HSpace(0), + End, + + Child, RectangleObject, + MUIA_VertWeight, 0, + MUIA_Rectangle_HBar, TRUE, + End, + + Child, ColGroup(2), + + Child, Label(tr(MSG_DRAG_LINES)), + Child, data->mcp_DragLines = SliderObject, + MUIA_ShortHelp, tr(MSG_DRAG_LINES_HELP), + MUIA_CycleChain, 1, + MUIA_Numeric_Min, 0, + MUIA_Numeric_Max, 20, + MUIA_Numeric_Value, DEFAULT_DRAGLINES, + End, + + Child, HSpace(0), + Child, HGroup, + Child, data->mcp_SerMouseFix = ImageObject, + ImageButtonFrame, + MUIA_InputMode, MUIV_InputMode_Toggle, + MUIA_Image_Spec, MUII_CheckMark, + MUIA_Image_FreeVert, TRUE, + MUIA_Background, MUII_ButtonBack, + MUIA_ShowSelState, FALSE, + End, + Child, Label(tr(MSG_SERMOUSE_FIX)), + MUIA_ShortHelp, tr(MSG_SERMOUSE_FIX_HELP), + Child, HSpace(0), + End, + End, + + Child, VSpace(0), + End, + + End, + + Child, HGroup, + GroupFrameT(tr(MSG_BALANCING_COLS)), + Child, HSpace(0), + Child, VGroup, + Child, VSpace(0), + Child, data->mcp_ColWidthDrag = RadioObject, + MUIA_Radio_Entries, RS_ColWidthDrag, + End, + MUIA_ShortHelp, tr(MSG_BALANCING_COLS_HELP), + Child, VSpace(0), + End, + Child, HSpace(0), + End, + + End, + End, + + Child, VGroup, + GroupFrameT(tr(MSG_GROUP_MISC)), + MUIA_VertWeight, 10, + + Child, VSpace(0), + Child, HGroup, + + Child, HSpace(0), + Child, VGroup, + + Child, HGroup, + Child, data->mcp_SelectPointer = ImageObject, + ImageButtonFrame, + MUIA_InputMode, MUIV_InputMode_Toggle, + MUIA_Image_Spec, MUII_CheckMark, + MUIA_Image_FreeVert, TRUE, + MUIA_Background, MUII_ButtonBack, + MUIA_ShowSelState, FALSE, + End, + Child, Label(tr(MSG_SELECT_POINTER)), + MUIA_ShortHelp, tr(MSG_SELECT_POINTER_HELP), + Child, HSpace(0), + End, + + End, + + Child, HGroup, + Child, VGroup, + Child, VSpace(0), + Child, RectangleObject, + MUIA_VertWeight, 0, + MUIA_Rectangle_HBar, TRUE, + MUIA_Rectangle_BarTitle, tr(MSG_BAR_CONTEXTMENU), + End, + Child, data->mcp_NList_Menu = RadioObject, + MUIA_Radio_Entries,RS_Menu, + MUIA_ShortHelp, tr(MSG_DEFAULT_CONTEXT_MENU_HELP), + End, + Child, VSpace(0), + End, + End, + + Child, HSpace(0), + End, + Child, VSpace(0), + End, + + End; + + functions_names[0] = tr(MSG_FUNC_MULTISELQUAL); + functions_names[1] = tr(MSG_FUNC_DRAGQUAL); + functions_names[2] = tr(MSG_FUNC_BALANCEQUAL); + functions_names[3] = tr(MSG_FUNC_COPYCLIP); + functions_names[4] = tr(MSG_FUNC_DEFCOLWIDTH); + functions_names[5] = tr(MSG_FUNC_DEFALLCOLWIDTH); + functions_names[6] = tr(MSG_FUNC_DEFORDERCOL); + functions_names[7] = tr(MSG_FUNC_DEFALLORDERCOL); + functions_names[8] = tr(MSG_FUNC_SELECTTOP); + functions_names[9] = tr(MSG_FUNC_SELECTBOTTOM); + functions_names[10]= tr(MSG_FUNC_SELECTPAGEUP); + functions_names[11]= tr(MSG_FUNC_SELECTPAGEDOWN); + functions_names[12]= tr(MSG_FUNC_SELECTUP); + functions_names[13]= tr(MSG_FUNC_SELECTDOWN); + functions_names[14]= tr(MSG_FUNC_TOGGLEACTIVE); + functions_names[15]= tr(MSG_FUNC_FASTWHEELQUAL); + functions_names[16]= tr(MSG_FUNC_HORIZWHEELQUAL); + functions_names[17]= tr(MSG_FUNC_TITLECLICKQUAL); + functions_names[18]= ""; + functions_names[19]= NULL; + + group5 = GroupObject, + Child, NListviewObject, + MUIA_CycleChain, 1, + MUIA_NListview_Vert_ScrollBar, MUIV_NListview_VSB_Always, + MUIA_NListview_Horiz_ScrollBar, MUIV_NListview_HSB_None, + MUIA_NListview_NList, data->mcp_listkeys = NListObject, + MUIA_NList_Title,TRUE, + MUIA_NList_DragSortable, TRUE, + MUIA_NList_Format, "W=100 NOBAR,NOBAR,W=100 NOBAR", + MUIA_NList_DisplayHook2, &DisplayHook, + MUIA_NList_ConstructHook2, &ConstructHook, + MUIA_NList_DestructHook2, &DestructHook, + MUIA_NList_MinColSortable, 10, + End, + End, + + Child, GroupObject,MUIA_Group_Horiz,TRUE, + + Child, GroupObject,MUIA_Group_Horiz,TRUE, + Child, data->mcp_stringkey, + Child, data->mcp_snoopkey = ToggleButtonCycle(tr(MSG_SNOOP), FALSE, TRUE, tr(MSG_SNOOP_KEY)), + End, + + Child, BalanceObject, End, + + Child, GroupObject,MUIA_Group_Horiz,TRUE, + Child, TextObject, MUIA_Text_Contents, "=", MUIA_Text_SetMax, TRUE, End, + Child, data->mcp_popstrfct = PopobjectObject, + MUIA_InputMode, MUIV_InputMode_None, + MUIA_Popstring_String, data->mcp_txtfct = TextObject, + TextFrame, + MUIA_Background, MUII_TextBack, + MUIA_Text_Contents, " ", + MUIA_UserData, -1, + End, + MUIA_Popstring_Button, PopButton(MUII_PopUp), + MUIA_Popobject_StrObjHook, &StrObjHook, + MUIA_Popobject_ObjStrHook, &ObjStrHook, + MUIA_Popobject_WindowHook, &WindowHook, + MUIA_Popobject_Object, data->mcp_poplistfct = ListviewObject, + MUIA_Listview_List, ListObject, + InputListFrame, + MUIA_List_SourceArray, functions_names, + End, + End, + End, + End, + + End, + + Child, GroupObject,MUIA_Group_Horiz,TRUE, + Child, data->mcp_insertkey = SimpleButtonCycle(tr(MSG_BUTTON_INSERT), tr(MSG_BUTTON_INSERT_HELP)), + Child, data->mcp_removekey = SimpleButtonCycle(tr(MSG_BUTTON_REMOVE), tr(MSG_BUTTON_REMOVE_HELP)), + Child, data->mcp_updatekeys = SimpleButtonCycle(tr(MSG_BUTTON_UPDATEKEYS), tr(MSG_BUTTON_UPDATEKEYS_HELP)), + Child, data->mcp_defaultkeys = SimpleButtonCycle(tr(MSG_BUTTON_DEFAULTKEYS), tr(MSG_BUTTON_DEFAULTKEYS_HELP)), + End, + + End; + + Pages[0] = tr(MSG_PAGE_FONTS); + Pages[1] = tr(MSG_PAGE_COLORS); + Pages[2] = tr(MSG_PAGE_SCROLLING); + Pages[3] = tr(MSG_PAGE_OPTIONS); + Pages[4] = tr(MSG_PAGE_KEYBINDINGS); + + data->mcp_group = VGroup, + + Child, RegisterObject, + MUIA_Register_Titles, Pages, + MUIA_Register_Frame, TRUE, + Child, group1, + Child, group2, + Child, group3, + Child, group4, + Child, group5, + End, + + Child, CrawlingObject, + TextFrame, + MUIA_FixHeightTxt, "\n\n", + MUIA_Background, "m1", + + Child, TextObject, + MUIA_Text_PreParse, "\033c", + MUIA_Text_Contents, infotext, + End, + + Child, TextObject, + MUIA_Text_PreParse, "\033c", + MUIA_Text_Contents, infotext, + End, + End, + + End; + + if(!data->mcp_group) + { + CoerceMethod(cl, obj, OM_DISPOSE); + return(0); + } + + DoMethod(obj, OM_ADDMEMBER, data->mcp_group); + + set(data->mcp_stringkey,MUIA_String_AttachedList,data->mcp_listkeys); + set(data->mcp_listkeys,MUIA_UserData,data); + + DoMethod(data->mcp_listkeys,MUIM_Notify,MUIA_NList_Active, MUIV_EveryTime, + data->mcp_listkeys, 3, MUIM_CallHook, &ActiveHook,data,MUIV_TriggerValue); + + DoMethod(data->mcp_listkeys,MUIM_Notify,MUIA_NList_DoubleClick, MUIV_EveryTime, + MUIV_Notify_Window, 3, MUIM_Set, MUIA_Window_ActiveObject, data->mcp_stringkey); + + DoMethod(data->mcp_poplistfct,MUIM_Notify,MUIA_Listview_DoubleClick,TRUE, + data->mcp_popstrfct,2,MUIM_Popstring_Close,TRUE); + + DoMethod(data->mcp_txtfct, MUIM_Notify, MUIA_Text_Contents, MUIV_EveryTime, + data->mcp_listkeys, 3, MUIM_CallHook, &TxtFctHook,data->mcp_txtfct); + + DoMethod(data->mcp_snoopkey, MUIM_Notify, MUIA_Selected, TRUE, + MUIV_Notify_Window, 3, MUIM_Set, MUIA_Window_ActiveObject, data->mcp_stringkey); + + DoMethod(data->mcp_snoopkey, MUIM_Notify, MUIA_Selected, MUIV_EveryTime, + data->mcp_stringkey, 3, MUIM_Set, MUIA_HotkeyString_Snoop, MUIV_TriggerValue); + + DoMethod(data->mcp_stringkey, MUIM_Notify, MUIA_String_Contents, MUIV_EveryTime, + data->mcp_snoopkey, 3, MUIM_Set, MUIA_Selected, FALSE); + + DoMethod(data->mcp_stringkey, MUIM_Notify, MUIA_String_Acknowledge, MUIV_EveryTime, + data->mcp_listkeys, 3, MUIM_CallHook, &AckHook,data->mcp_stringkey); + + DoMethod(data->mcp_insertkey,MUIM_Notify, MUIA_Pressed, FALSE, + data->mcp_listkeys, 3, MUIM_CallHook, &InsertHook); + + DoMethod(data->mcp_removekey,MUIM_Notify, MUIA_Pressed, FALSE, + data->mcp_listkeys, 2,MUIM_NList_Remove,MUIV_NList_Remove_Active); + + DoMethod(data->mcp_defaultkeys,MUIM_Notify, MUIA_Pressed, FALSE, + data->mcp_listkeys, 3, MUIM_CallHook, &DefaultHook); + + DoMethod(data->mcp_updatekeys,MUIM_Notify, MUIA_Pressed, FALSE, + data->mcp_listkeys, 3, MUIM_CallHook, &UpdateHook); + + // in case we are running for a newer MUI version we can register + // our mcc gadgets accordingly + if(MUIMasterBase->lib_Version >= 20) + { + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_PenTitle, MUICFG_NList_Pen_Title, 1, tr(MSG_TITLE_PEN_WIN)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_PenList, MUICFG_NList_Pen_List, 1, tr(MSG_LIST_PEN_WIN)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_PenSelect, MUICFG_NList_Pen_Select, 1, tr(MSG_SELECT_PEN_WIN)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_PenCursor, MUICFG_NList_Pen_Cursor, 1, tr(MSG_CURSOR_PEN_WIN)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_PenUnselCur, MUICFG_NList_Pen_UnselCur, 1, tr(MSG_UNSEL_PEN_WIN)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_PenInactive, MUICFG_NList_Pen_Inactive, 1, tr(MSG_INACT_PEN_WIN)); + + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_BG_Title, MUICFG_NList_BG_Title, 1, tr(MSG_TITLE_BG_WIN)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_BG_List, MUICFG_NList_BG_List, 1, tr(MSG_LIST_BG_WIN)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_BG_Select, MUICFG_NList_BG_Select, 1, tr(MSG_SELECT_BG_WIN)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_BG_Cursor, MUICFG_NList_BG_Cursor, 1, tr(MSG_CURSOR_BG_WIN)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_BG_UnselCur, MUICFG_NList_BG_UnselCur, 1, tr(MSG_UNSEL_BG_WIN)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_BG_Inactive, MUICFG_NList_BG_Inactive, 1, tr(MSG_INACT_BG_WIN)); + + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_Font, MUICFG_NList_Font, 1, tr(MSG_NORMAL_FONT)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_Font_Little, MUICFG_NList_Font_Little, 1, tr(MSG_SMALL_FONT)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_Font_Fixed, MUICFG_NList_Font_Fixed, 1, tr(MSG_FIXED_FONT)); + + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_SL_VertInc, MUICFG_NList_VertInc, 1, tr(MSG_FONT_MARGIN)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_R_Drag, MUICFG_NList_DragType, 1, tr(MSG_DRAGDROP)); + + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_R_Multi, MUICFG_NList_MultiSelect, 1, tr(MSG_MULTISELECT)); + + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_R_VSB, MUICFG_NListview_VSB, 1, tr(MSG_SB_VERTICAL)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_R_HSB, MUICFG_NListview_HSB, 1, tr(MSG_SB_HORIZONTAL)); + + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_B_Smooth, MUICFG_NList_Smooth, 1, tr(MSG_SMOOTH_SCROLLING)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_ForcePen, MUICFG_NList_ForcePen, 1, tr(MSG_FORCE_SELECT_PEN)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_ColWidthDrag, MUICFG_NList_ColWidthDrag, 1, tr(MSG_BALANCING_COLS)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_PartialCol, MUICFG_NList_PartialCol, 1, tr(MSG_PARTIAL_COL_MARK)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_List_Select, MUICFG_NList_List_Select, 1, tr(MSG_MULTISEL_MOVEACTIVE)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_NList_Menu, MUICFG_NList_Menu, 1, tr(MSG_BAR_CONTEXTMENU)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_PartialChar, MUICFG_NList_PartialChar, 1, tr(MSG_PARTIAL_CHARS_DRAWN)); + + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_SerMouseFix, MUICFG_NList_SerMouseFix, 1, tr(MSG_SERMOUSE_FIX)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_listkeys, MUICFG_NList_Keys, 1, tr(MSG_PAGE_KEYBINDINGS)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_DragLines, MUICFG_NList_DragLines, 1, tr(MSG_DRAG_LINES)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_VerticalCenteredLines, MUICFG_NList_VCenteredLines, 1, tr(MSG_VERT_CENTERED)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_SelectPointer,MUICFG_NList_SelectPointer, 1, tr(MSG_SELECT_POINTER)); + + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_WheelStep, MUICFG_NList_WheelStep, 1, tr(MSG_WHEEL_STEP)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_WheelFast, MUICFG_NList_WheelFast, 1, tr(MSG_WHEEL_FAST)); + DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->mcp_WheelMMB, MUICFG_NList_WheelMMB, 1, tr(MSG_MMB_FASTWHEEL)); + } + + return ((IPTR)obj); +} + +static IPTR mNL_MCP_Dispose(struct IClass *cl, Object *obj, Msg msg) +{ + struct NListviews_MCP_Data *data = INST_DATA(cl, obj); + + if(data->exampleText != NULL) + { + LONG i = 0; + + while(data->exampleText[i] != NULL) + { + FreeVec(data->exampleText[i]); + i++; + } + + FreeVec(data->exampleText); + } + + return DoSuperMethodA(cl, obj, msg); +} + +IPTR mNL_MCP_ConfigToGadgets(struct IClass *cl,Object *obj,struct MUIP_Settingsgroup_ConfigToGadgets *msg) +{ + struct NListviews_MCP_Data *data = INST_DATA(cl, obj); + + D(DBF_STARTUP, "configToGadgets"); + + LOAD_DATASPEC(data->mcp_PenTitle, MUIA_Pendisplay_Spec, MUICFG_NList_Pen_Title, DEFAULT_PEN_TITLE); + LOAD_DATASPEC(data->mcp_PenList, MUIA_Pendisplay_Spec, MUICFG_NList_Pen_List, DEFAULT_PEN_LIST); + LOAD_DATASPEC(data->mcp_PenSelect, MUIA_Pendisplay_Spec, MUICFG_NList_Pen_Select, DEFAULT_PEN_SELECT); + LOAD_DATASPEC(data->mcp_PenCursor, MUIA_Pendisplay_Spec, MUICFG_NList_Pen_Cursor, DEFAULT_PEN_CURSOR); + LOAD_DATASPEC(data->mcp_PenUnselCur,MUIA_Pendisplay_Spec, MUICFG_NList_Pen_UnselCur,DEFAULT_PEN_UNSELCUR); + LOAD_DATASPEC(data->mcp_PenInactive,MUIA_Pendisplay_Spec, MUICFG_NList_Pen_Inactive,DEFAULT_PEN_INACTIVE); + + LOAD_DATASPEC(data->mcp_BG_Title, MUIA_Imagedisplay_Spec,MUICFG_NList_BG_Title, DEFAULT_BG_TITLE); + LOAD_DATASPEC(data->mcp_BG_List, MUIA_Imagedisplay_Spec,MUICFG_NList_BG_List, DEFAULT_BG_LIST); + LOAD_DATASPEC(data->mcp_BG_Select, MUIA_Imagedisplay_Spec,MUICFG_NList_BG_Select, DEFAULT_BG_SELECT); + LOAD_DATASPEC(data->mcp_BG_Cursor, MUIA_Imagedisplay_Spec,MUICFG_NList_BG_Cursor, DEFAULT_BG_CURSOR); + LOAD_DATASPEC(data->mcp_BG_UnselCur,MUIA_Imagedisplay_Spec,MUICFG_NList_BG_UnselCur, DEFAULT_BG_UNSELCUR); + LOAD_DATASPEC(data->mcp_BG_Inactive,MUIA_Imagedisplay_Spec,MUICFG_NList_BG_Inactive, DEFAULT_BG_INACTIVE); + + LOAD_DATALONG(data->mcp_SL_VertInc, MUIA_Numeric_Value, MUICFG_NList_VertInc, DEFAULT_VERT_INC); + + LOAD_DATALONG(data->mcp_B_Smooth, MUIA_Selected, MUICFG_NList_Smooth, DEFAULT_SMOOTHSCROLL); + + LOAD_DATAFONT(data->mcp_Font, MUICFG_NList_Font); + LOAD_DATAFONT(data->mcp_Font_Little,MUICFG_NList_Font_Little); + LOAD_DATAFONT(data->mcp_Font_Fixed, MUICFG_NList_Font_Fixed); + + { + LONG *ptrd; + LONG num = DEFAULT_DRAGTYPE; + if((ptrd = (LONG *) DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NList_DragType))) + { + if (*ptrd == MUIV_NList_DragType_Qualifier) + num = 2; + else if (*ptrd == MUIV_NList_DragType_Borders) + num = 1; + else + num = 0; + } + set(data->mcp_R_Drag,MUIA_Radio_Active, num); + + } + + { + LONG *ptrd; + LONG num = DEFAULT_CWD; + if((ptrd = (LONG *) DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NList_ColWidthDrag))) + { + if (*ptrd <= 0) + num = 0; + else if (*ptrd == 2) + num = 2; + else + num = 1; + } + set(data->mcp_ColWidthDrag,MUIA_Radio_Active, num); + } + + { + LONG *ptrd; + LONG num = DEFAULT_MULTISELECT; + + if((ptrd = (LONG *) DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NList_MultiSelect))) + num = *ptrd; + + if ((num & MUIV_NList_MultiSelect_MMB_On) == MUIV_NList_MultiSelect_MMB_On) + { + set(data->mcp_B_MultiMMB, MUIA_Selected, TRUE); + } + else + { + set(data->mcp_B_MultiMMB, MUIA_Selected, FALSE); + } + num &= 0x0007; + if (num == MUIV_NList_MultiSelect_Always) + num = 1; + else + num = 0; + set(data->mcp_R_Multi,MUIA_Radio_Active, num); + } + + { + LONG *ptrd; + LONG num = DEFAULT_HSB; + + if((ptrd = (LONG *) DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListview_HSB))) + num = *ptrd; + + if ((num < 1) || (num > 4)) + num = DEFAULT_HSB; + num--; + + set(data->mcp_R_HSB,MUIA_Radio_Active, num); + } + + { + LONG *ptrd; + LONG num = DEFAULT_VSB; + + if((ptrd = (LONG *) DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NListview_VSB))) + num = *ptrd; + + if ((num < 1) || (num > 3)) + num = 1; + num--; + set(data->mcp_R_VSB,MUIA_Radio_Active, num); + } + + { + LONG *ptrd; + LONG num = DEFAULT_FORCEPEN; + if((ptrd = (LONG *) DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NList_ForcePen))) + { + if (*ptrd) + num = TRUE; + else + num = FALSE; + } + set(data->mcp_ForcePen, MUIA_Selected, num); + } + + LOAD_DATALONG(data->mcp_DragLines, MUIA_Numeric_Value, MUICFG_NList_DragLines, DEFAULT_DRAGLINES); + LOAD_DATALONG(data->mcp_VerticalCenteredLines, MUIA_Selected, MUICFG_NList_VCenteredLines, DEFAULT_VCENTERED); + LOAD_DATALONG(data->mcp_SelectPointer, MUIA_Selected, MUICFG_NList_SelectPointer, DEFAULT_SELECTPOINTER); + LOAD_DATALONG(data->mcp_WheelStep, MUIA_Numeric_Value, MUICFG_NList_WheelStep, DEFAULT_WHEELSTEP); + LOAD_DATALONG(data->mcp_WheelFast, MUIA_Numeric_Value, MUICFG_NList_WheelFast, DEFAULT_WHEELFAST); + LOAD_DATALONG(data->mcp_WheelMMB, MUIA_Selected, MUICFG_NList_WheelMMB, DEFAULT_WHEELMMB); + + { + LONG *ptrd; + LONG num = DEFAULT_SERMOUSEFIX; + if((ptrd = (LONG *) DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NList_SerMouseFix))) + { + if (*ptrd) + num = TRUE; + else + num = FALSE; + } + set(data->mcp_SerMouseFix, MUIA_Selected, num); + } + + { + LONG *ptrd; + LONG num = DEFAULT_LIST_SELECT; + if((ptrd = (LONG *) DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NList_List_Select))) + { + if (*ptrd) + num = TRUE; + else + num = FALSE; + } + set(data->mcp_List_Select, MUIA_Selected, num); + } + + { + LONG *ptrd; + LONG num = DEFAULT_PARTIALCOL; + if((ptrd = (LONG *) DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NList_PartialCol))) + { + if (*ptrd) + num = TRUE; + else + num = FALSE; + } + set(data->mcp_PartialCol, MUIA_Selected, num); + } + + { + LONG *ptrd; + LONG num = DEFAULT_PARTIALCHAR; + if((ptrd = (LONG *) DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NList_PartialChar))) + { + if (*ptrd) + num = TRUE; + else + num = FALSE; + } + set(data->mcp_PartialChar, MUIA_Selected, num); + } + + { + LONG *ptrd; + LONG num = DEFAULT_CMENU; + if((ptrd = (LONG *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NList_Menu)) != NULL) + { + if(*ptrd == (LONG)MUIV_NList_ContextMenu_TopOnly) + num = 1; + else if(*ptrd == (LONG)MUIV_NList_ContextMenu_Never) + num = 2; + } + set(data->mcp_NList_Menu, MUIA_Radio_Active, num); + } + + { + LONG *ptrd; + struct KeyBinding *keys = default_keys; + + if((ptrd = (LONG *) DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_NList_Keys))) + keys = (struct KeyBinding *) ptrd; + + NL_LoadKeys(data->mcp_listkeys,keys); + } + + return(0); +} + + +IPTR mNL_MCP_GadgetsToConfig(struct IClass *cl,Object *obj,struct MUIP_Settingsgroup_GadgetsToConfig *msg) +{ + struct NListviews_MCP_Data *data = INST_DATA(cl, obj); + + D(DBF_STARTUP, "GadgetsToConfig"); + + SAVE_DATASPEC(data->mcp_PenTitle, MUIA_Pendisplay_Spec, MUICFG_NList_Pen_Title); + SAVE_DATASPEC(data->mcp_PenList, MUIA_Pendisplay_Spec, MUICFG_NList_Pen_List); + SAVE_DATASPEC(data->mcp_PenSelect, MUIA_Pendisplay_Spec, MUICFG_NList_Pen_Select); + SAVE_DATASPEC(data->mcp_PenCursor, MUIA_Pendisplay_Spec, MUICFG_NList_Pen_Cursor); + SAVE_DATASPEC(data->mcp_PenUnselCur,MUIA_Pendisplay_Spec, MUICFG_NList_Pen_UnselCur); + SAVE_DATASPEC(data->mcp_PenInactive,MUIA_Pendisplay_Spec, MUICFG_NList_Pen_Inactive); + + SAVE_DATASPEC2(data->mcp_BG_Title, MUIA_Imagedisplay_Spec,MUICFG_NList_BG_Title); + SAVE_DATASPEC2(data->mcp_BG_List, MUIA_Imagedisplay_Spec,MUICFG_NList_BG_List); + SAVE_DATASPEC2(data->mcp_BG_Select, MUIA_Imagedisplay_Spec,MUICFG_NList_BG_Select); + SAVE_DATASPEC2(data->mcp_BG_Cursor, MUIA_Imagedisplay_Spec,MUICFG_NList_BG_Cursor); + SAVE_DATASPEC2(data->mcp_BG_UnselCur,MUIA_Imagedisplay_Spec,MUICFG_NList_BG_UnselCur); + SAVE_DATASPEC2(data->mcp_BG_Inactive,MUIA_Imagedisplay_Spec,MUICFG_NList_BG_Inactive); + + SAVE_DATALONG(data->mcp_SL_VertInc, MUIA_Numeric_Value, MUICFG_NList_VertInc); + + SAVE_DATALONG(data->mcp_B_Smooth, MUIA_Selected, MUICFG_NList_Smooth); + + SAVE_DATAFONT(data->mcp_Font, MUICFG_NList_Font); + SAVE_DATAFONT(data->mcp_Font_Little,MUICFG_NList_Font_Little); + SAVE_DATAFONT(data->mcp_Font_Fixed, MUICFG_NList_Font_Fixed); + + { + LONG ptrd=0,num; + get(data->mcp_R_Drag, MUIA_Radio_Active, &ptrd); + if (ptrd == 2) + num = MUIV_NList_DragType_Qualifier; + else if (ptrd == 1) + num = MUIV_NList_DragType_Borders; + else + num = MUIV_NList_DragType_Immediate; + DoMethod(msg->configdata, MUIM_Dataspace_Add, &num, 8, MUICFG_NList_DragType); + } + + { + LONG ptrd=0,num; + get(data->mcp_ColWidthDrag, MUIA_Radio_Active, &ptrd); + num = ptrd; + DoMethod(msg->configdata, MUIM_Dataspace_Add, &num, 8, MUICFG_NList_ColWidthDrag); + } + + { + LONG ptrd=0,num; + get(data->mcp_R_Multi, MUIA_Radio_Active, &ptrd); + if (ptrd == 1) + num = MUIV_NList_MultiSelect_Always; + else + num = MUIV_NList_MultiSelect_Shifted; + get(data->mcp_B_MultiMMB, MUIA_Selected, &ptrd); + if (ptrd) + num |= MUIV_NList_MultiSelect_MMB_On; + else + num |= MUIV_NList_MultiSelect_MMB_Off; + DoMethod(msg->configdata, MUIM_Dataspace_Add, &num, 8, MUICFG_NList_MultiSelect); + } + + { + LONG ptrd=0,num; + get(data->mcp_R_HSB, MUIA_Radio_Active, &ptrd); + num = ptrd+1; + DoMethod(msg->configdata, MUIM_Dataspace_Add, &num, 8, MUICFG_NListview_HSB); + } + { + LONG ptrd=0,num; + get(data->mcp_R_VSB, MUIA_Radio_Active, &ptrd); + num = ptrd+1; + DoMethod(msg->configdata, MUIM_Dataspace_Add, &num, 8, MUICFG_NListview_VSB); + } + + { + LONG ptrd=0,num; + get(data->mcp_ForcePen, MUIA_Selected, &ptrd); + if (ptrd) + num = TRUE; + else + num = FALSE; + DoMethod(msg->configdata, MUIM_Dataspace_Add, &num, 8, MUICFG_NList_ForcePen); + } + + SAVE_DATALONG(data->mcp_DragLines, MUIA_Numeric_Value, MUICFG_NList_DragLines); + SAVE_DATALONG(data->mcp_VerticalCenteredLines, MUIA_Selected, MUICFG_NList_VCenteredLines); + SAVE_DATALONG(data->mcp_SelectPointer,MUIA_Selected, MUICFG_NList_SelectPointer); + SAVE_DATALONG(data->mcp_WheelStep, MUIA_Numeric_Value, MUICFG_NList_WheelStep); + SAVE_DATALONG(data->mcp_WheelFast, MUIA_Numeric_Value, MUICFG_NList_WheelFast); + SAVE_DATALONG(data->mcp_WheelMMB, MUIA_Selected, MUICFG_NList_WheelMMB); + + { + LONG ptrd=0,num; + get(data->mcp_SerMouseFix, MUIA_Selected, &ptrd); + if (ptrd) + num = TRUE; + else + num = FALSE; + DoMethod(msg->configdata, MUIM_Dataspace_Add, &num, 8, MUICFG_NList_SerMouseFix); + } + + { + LONG ptrd=0,num; + get(data->mcp_List_Select, MUIA_Selected, &ptrd); + if (ptrd) + num = TRUE; + else + num = FALSE; + DoMethod(msg->configdata, MUIM_Dataspace_Add, &num, 8, MUICFG_NList_List_Select); + } + + { + LONG ptrd=0,num; + get(data->mcp_PartialCol, MUIA_Selected, &ptrd); + if (ptrd) + num = TRUE; + else + num = FALSE; + DoMethod(msg->configdata, MUIM_Dataspace_Add, &num, 8, MUICFG_NList_PartialCol); + } + + { + LONG ptrd=0,num; + get(data->mcp_PartialChar, MUIA_Selected, &ptrd); + if (ptrd) + num = TRUE; + else + num = FALSE; + DoMethod(msg->configdata, MUIM_Dataspace_Add, &num, 8, MUICFG_NList_PartialChar); + } + + { + LONG ptrd=0,num = MUIV_NList_ContextMenu_Always; + get(data->mcp_NList_Menu, MUIA_Radio_Active, &ptrd); + if (ptrd == 1) + num = MUIV_NList_ContextMenu_TopOnly; + else if (ptrd == 2) + num = MUIV_NList_ContextMenu_Never; + DoMethod(msg->configdata, MUIM_Dataspace_Add, &num, 8, MUICFG_NList_Menu); + } + + { + LONG sk = NL_SaveKeys(data); + if (sk > 0) + { DoMethod(msg->configdata, MUIM_Dataspace_Add, data->nlkeys, sk, MUICFG_NList_Keys); + FreeMem((void *) data->nlkeys,data->nlkeys_size+4); + data->nlkeys = NULL; + } + } + + return(0); +} + + +static IPTR mNL_MCP_Get(struct IClass *cl,Object *obj,Msg msg) +{ + IPTR *store = ((struct opGet *)msg)->opg_Storage; + + switch (((struct opGet *)msg)->opg_AttrID) + { + case MUIA_Version: + *store = LIB_VERSION; + return(TRUE); + break; + case MUIA_Revision: + *store = LIB_REVISION; + return(TRUE); + break; + } + return (DoSuperMethodA(cl,obj,msg)); +} + +DISPATCHER(_DispatcherP) +{ + switch (msg->MethodID) + { + case OM_NEW: return(mNL_MCP_New(cl,obj,(APTR)msg)); + case OM_DISPOSE: return(mNL_MCP_Dispose(cl,obj,(APTR)msg)); + case OM_GET: return(mNL_MCP_Get(cl,obj,(APTR)msg)); + case MUIM_Settingsgroup_ConfigToGadgets: return(mNL_MCP_ConfigToGadgets(cl,obj,(APTR)msg)); + case MUIM_Settingsgroup_GadgetsToConfig: return(mNL_MCP_GadgetsToConfig(cl,obj,(APTR)msg)); + } + + return(DoSuperMethodA(cl,obj,msg)); +} diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/NListviews_mcp.h b/workbench/classes/zune/nlist/nlistviews_mcp/NListviews_mcp.h new file mode 100644 index 0000000000..26a589aff3 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/NListviews_mcp.h @@ -0,0 +1,220 @@ +#ifndef MUI_NLISTVIEWS_MCP_H +#define MUI_NLISTVIEWS_MCP_H + +/*************************************************************************** + + NListviews.mcp - New Listview MUI Custom Class Preferences + Registered MUI class, Serial Number: 1d51 (0x9d510001 to 0x9d51001F + and 0x9d510101 to 0x9d51013F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef LIBRARIES_MUI_H +#include <libraries/mui.h> +#endif + +#ifndef MUI_NListview_MCC_H +#include <mui/NListview_mcc.h> +#endif + +#include <devices/inputevent.h> + +#if !defined(__AROS__) && defined(__PPC__) + #if defined(__GNUC__) + #pragma pack(2) + #elif defined(__VBCC__) + #pragma amiga-align + #endif +#endif + +#define MUIC_NListviews_mcp "NListviews.mcp" +#define NListviewsMcpObject MUI_NewObject(MUIC_NListviews_mcp + +#define MUICFG_NList_Pen_Title 0x9d510001UL +#define MUICFG_NList_Pen_List 0x9d510002UL +#define MUICFG_NList_Pen_Select 0x9d510003UL +#define MUICFG_NList_Pen_Cursor 0x9d510004UL +#define MUICFG_NList_Pen_UnselCur 0x9d510005UL +#define MUICFG_NList_Pen_Inactive 0x9d510104UL + +#define MUICFG_NList_BG_Title 0x9d510006UL +#define MUICFG_NList_BG_List 0x9d510007UL +#define MUICFG_NList_BG_Select 0x9d510008UL +#define MUICFG_NList_BG_Cursor 0x9d510009UL +#define MUICFG_NList_BG_UnselCur 0x9d51000aUL +#define MUICFG_NList_BG_Inactive 0x9d510105UL + +#define MUICFG_NList_Font 0x9d51000bUL +#define MUICFG_NList_Font_Little 0x9d51000cUL +#define MUICFG_NList_Font_Fixed 0x9d51000dUL + +#define MUICFG_NList_VertInc 0x9d51000eUL +#define MUICFG_NList_DragType 0x9d51000fUL +#define MUICFG_NList_MultiSelect 0x9d510010UL + +#define MUICFG_NListview_VSB 0x9d510011UL +#define MUICFG_NListview_HSB 0x9d510012UL + +#define MUICFG_NList_DragQualifier 0x9d510013UL /* OBSOLETE */ +#define MUICFG_NList_Smooth 0x9d510014UL +#define MUICFG_NList_ForcePen 0x9d510015UL +#define MUICFG_NList_StackCheck 0x9d510016UL /* OBSOLETE */ +#define MUICFG_NList_ColWidthDrag 0x9d510017UL +#define MUICFG_NList_PartialCol 0x9d510018UL +#define MUICFG_NList_List_Select 0x9d510019UL +#define MUICFG_NList_Menu 0x9d51001AUL +#define MUICFG_NList_PartialChar 0x9d51001BUL +#define MUICFG_NList_PointerColor 0x9d51001CUL /* OBSOLETE */ +#define MUICFG_NList_SerMouseFix 0x9d51001DUL +#define MUICFG_NList_Keys 0x9d51001EUL +#define MUICFG_NList_DragLines 0x9d51001FUL +#define MUICFG_NList_VCenteredLines 0x9d510020UL +#define MUICFG_NList_SelectPointer 0x9d510106UL + +#define MUICFG_NList_WheelStep 0x9d510101UL +#define MUICFG_NList_WheelFast 0x9d510102UL +#define MUICFG_NList_WheelMMB 0x9d510103UL + +#define MUIV_NList_MultiSelect_MMB_On 0x0300 +#define MUIV_NList_MultiSelect_MMB_Off 0x0100 + +#define MUIV_NList_ColWidthDrag_One 0 +#define MUIV_NList_ColWidthDrag_All 1 +#define MUIV_NList_ColWidthDrag_Visual 2 + + +// default values for the above MUICFG values +#define DEFAULT_PEN_TITLE "m5" +#define DEFAULT_PEN_LIST "m5" +#define DEFAULT_PEN_SELECT "m5" +#define DEFAULT_PEN_CURSOR "m5" +#define DEFAULT_PEN_UNSELCUR "m5" +#define DEFAULT_PEN_INACTIVE "m5" +#define DEFAULT_BG_TITLE "0:140" +#define DEFAULT_BG_LIST "2:m2" +#define DEFAULT_BG_SELECT "0:135" +#define DEFAULT_BG_CURSOR "0:131" +#define DEFAULT_BG_UNSELCUR "2:m3" +#define DEFAULT_BG_INACTIVE "2:m3" +#define DEFAULT_VERT_INC 0 +#define DEFAULT_HSB MUIV_NListview_HSB_Auto +#define DEFAULT_VSB MUIV_NListview_VSB_Auto +#define DEFAULT_CWD MUIV_NList_ColWidthDrag_All +#define DEFAULT_CMENU 1 +#define DEFAULT_MULTISELECT 0 +#define DEFAULT_DRAGTYPE 0 +#define DEFAULT_DRAGLINES 10 +#define DEFAULT_WHEELSTEP 3 +#define DEFAULT_WHEELFAST 5 +#define DEFAULT_WHEELMMB FALSE +#define DEFAULT_VCENTERED FALSE +#define DEFAULT_SMOOTHSCROLL TRUE +#define DEFAULT_SELECTPOINTER TRUE +#define DEFAULT_PARTIALCHAR FALSE +#define DEFAULT_PARTIALCOL TRUE +#define DEFAULT_SERMOUSEFIX FALSE +#define DEFAULT_LIST_SELECT TRUE +#define DEFAULT_FORCEPEN FALSE + +#define KEYTAG_QUALIFIER_MULTISELECT 0x9d51C001UL +#define KEYTAG_QUALIFIER_DRAG 0x9d51C002UL +#define KEYTAG_QUALIFIER_BALANCE 0x9d51C003UL +#define KEYTAG_COPY_TO_CLIPBOARD 0x9d518001UL +#define KEYTAG_DEFAULT_WIDTH_COLUMN 0x9d518002UL +#define KEYTAG_DEFAULT_WIDTH_ALL_COLUMNS 0x9d518003UL +#define KEYTAG_DEFAULT_ORDER_COLUMN 0x9d518004UL +#define KEYTAG_DEFAULT_ORDER_ALL_COLUMNS 0x9d518005UL +#define KEYTAG_SELECT_TO_TOP 0x9d518006UL +#define KEYTAG_SELECT_TO_BOTTOM 0x9d518007UL +#define KEYTAG_SELECT_TO_PAGE_UP 0x9d518008UL +#define KEYTAG_SELECT_TO_PAGE_DOWN 0x9d518009UL +#define KEYTAG_SELECT_UP 0x9d51800AUL +#define KEYTAG_SELECT_DOWN 0x9d51800BUL +#define KEYTAG_TOGGLE_ACTIVE 0x9d51800CUL +#define KEYTAG_QUALIFIER_WHEEL_FAST 0x9d51800DUL +#define KEYTAG_QUALIFIER_WHEEL_HORIZ 0x9d51800EUL +#define KEYTAG_QUALIFIER_TITLECLICK2 0x9d51800FUL + +struct KeyBinding { + ULONG kb_KeyTag; + UWORD kb_Code; + UWORD kb_Qualifier; +}; + +#define KBQUAL_MASK 0x01FF /* only qualifier keys bits are used in kb_Qualifier */ +#define KBSYM_MASK 0x7000 /* upper kb_Qualifier bits are use for synonyms */ + +#define KBSYM_SHIFT 0x1000 /* left- and right- shift are equivalent */ +#define KBSYM_CAPS 0x2000 /* either shift or caps lock are equivalent */ +#define KBSYM_ALT 0x4000 /* left- and right- alt are equivalent */ + +#define KBQUALIFIER_SHIFT (KBSYM_SHIFT | IEQUALIFIER_LSHIFT | IEQUALIFIER_RSHIFT) /* 'shift' */ +#define KBQUALIFIER_CAPS (KBSYM_CAPS | KBQUALIFIER_SHIFT | IEQUALIFIER_CAPSLOCK) /* 'caps' */ +#define KBQUALIFIER_ALT (KBSYM_ALT | IEQUALIFIER_LALT | IEQUALIFIER_RALT) /* 'alt' */ + +#define DEFAULT_KEYS_ARRAY \ + struct KeyBinding default_keys[] = \ + { \ + { KEYTAG_QUALIFIER_MULTISELECT , (UWORD)~0 , KBQUALIFIER_SHIFT }, \ + { KEYTAG_QUALIFIER_DRAG , (UWORD)~0 , IEQUALIFIER_CONTROL }, \ + { KEYTAG_QUALIFIER_DRAG , (UWORD)~0 , IEQUALIFIER_CONTROL|KBQUALIFIER_SHIFT }, \ + { KEYTAG_QUALIFIER_BALANCE , (UWORD)~0 , KBQUALIFIER_SHIFT }, \ + { KEYTAG_COPY_TO_CLIPBOARD , 0x33, IEQUALIFIER_RCOMMAND }, \ + { KEYTAG_COPY_TO_CLIPBOARD , 0x33, IEQUALIFIER_LCOMMAND }, \ + { KEYTAG_COPY_TO_CLIPBOARD , 0x32, IEQUALIFIER_RCOMMAND }, \ + { KEYTAG_COPY_TO_CLIPBOARD , 0x32, IEQUALIFIER_LCOMMAND }, \ + { KEYTAG_DEFAULT_WIDTH_COLUMN , 0x1D, IEQUALIFIER_RCOMMAND|IEQUALIFIER_NUMERICPAD }, \ + { KEYTAG_DEFAULT_WIDTH_ALL_COLUMNS, 0x1E, IEQUALIFIER_RCOMMAND|IEQUALIFIER_NUMERICPAD }, \ + { KEYTAG_DEFAULT_ORDER_COLUMN , 0x1F, IEQUALIFIER_RCOMMAND|IEQUALIFIER_NUMERICPAD }, \ + { KEYTAG_DEFAULT_ORDER_ALL_COLUMNS, 0x2D, IEQUALIFIER_RCOMMAND|IEQUALIFIER_NUMERICPAD }, \ + { KEYTAG_SELECT_TO_TOP , 0x4C, KBQUALIFIER_ALT|IEQUALIFIER_CONTROL }, \ + { KEYTAG_SELECT_TO_BOTTOM , 0x4D, KBQUALIFIER_ALT|IEQUALIFIER_CONTROL }, \ + { KEYTAG_SELECT_TO_PAGE_UP , 0x4C, KBQUALIFIER_ALT|KBQUALIFIER_SHIFT }, \ + { KEYTAG_SELECT_TO_PAGE_DOWN , 0x4D, KBQUALIFIER_ALT|KBQUALIFIER_SHIFT }, \ + { KEYTAG_SELECT_UP , 0x4C, KBQUALIFIER_ALT }, \ + { KEYTAG_SELECT_DOWN , 0x4D, KBQUALIFIER_ALT }, \ + { KEYTAG_TOGGLE_ACTIVE , 0x40, KBQUALIFIER_ALT }, \ + { KEYTAG_QUALIFIER_WHEEL_FAST , (UWORD)~0 , KBQUALIFIER_SHIFT }, \ + { KEYTAG_QUALIFIER_WHEEL_HORIZ , (UWORD)~0 , KBQUALIFIER_ALT }, \ + { KEYTAG_QUALIFIER_TITLECLICK2 , (UWORD)~0 , KBQUALIFIER_SHIFT }, \ + { 0L, (UWORD)~0, 0 } \ + }; + +/* + * #define IEQUALIFIER_LSHIFT 0x0001 'lshift' + * #define IEQUALIFIER_RSHIFT 0x0002 'rshift' + * #define IEQUALIFIER_CAPSLOCK 0x0004 'capslock' + * #define IEQUALIFIER_CONTROL 0x0008 'control' + * #define IEQUALIFIER_LALT 0x0010 'lalt' + * #define IEQUALIFIER_RALT 0x0020 'ralt' + * #define IEQUALIFIER_LCOMMAND 0x0040 'lcommand' + * #define IEQUALIFIER_RCOMMAND 0x0080 'rcommand' + * #define IEQUALIFIER_NUMERICPAD 0x0100 'numpad' + */ + +#if !defined(__AROS__) && defined(__PPC__) + #if defined(__GNUC__) + #pragma pack() + #elif defined(__VBCC__) + #pragma default-align + #endif +#endif + +#endif /* MUI_NLISTVIEWS_MCP_H */ diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/icon.c b/workbench/classes/zune/nlist/nlistviews_mcp/icon.c new file mode 100644 index 0000000000..3db3e6f854 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/icon.c @@ -0,0 +1,96 @@ +/*************************************************************************** + + NListviews.mcp - New Listview MUI Custom Class Preferences + Registered MUI class, Serial Number: 1d51 (0x9d510001 to 0x9d51001F + and 0x9d510101 to 0x9d51013F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if !defined(__MORPHOS__) +const unsigned long icon32[] = { + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x7320396e, 0xec304e89, 0xff3f5d99, 0xff4664a0, 0xff3f5d99, 0xec304e89, 0x7320396e, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0xac2b4479, 0xff43619d, 0xff5775b1, 0xff617fbb, 0xff5775b1, 0xff43619d, 0xac2b4479, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xcd314b80, 0xff4e6ca8, 0xff6a88c4, 0xff7d9bd7, 0xff6a88c4, 0xff4e6ca8, 0xcd314b80, 0x2a000000, 0x00ff00ff, 0x04000000, 0x64000000, 0x07000000, 0x03000000, 0x48000000, 0x03000000, 0x00ff00ff, 0x03000000, 0x4c000000, 0x03000000, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xe538558d, 0xff516fab, 0xff6f8dc9, 0xff89a7e3, 0xff6f8dc9, 0xff516fab, 0xe538558d, 0x2a000000, 0x00ff00ff, 0x0b000000, 0x84000000, 0x0e000000, 0x09000000, 0x67000000, 0x3d000000, 0x72000000, 0x4c000000, 0xa5000000, 0x5b000000, 0x03000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xfb3e5b98, 0xff4a68a4, 0xff6785c0, 0xff7f9ddb, 0xff6785c0, 0xff4a68a4, 0xfb3e5b98, 0x2a000000, 0x00ff00ff, 0x12000000, 0x88000000, 0x15000000, 0x0f000000, 0x80000000, 0x40000000, 0x87000000, 0x58000000, 0x87000000, 0x17000000, 0x03000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff22417e, 0xff38548c, 0xff687a9e, 0xff97a9ce, 0xff687a9e, 0xff38548c, 0xff22417e, 0x2a000000, 0x00ff00ff, 0x14000000, 0x8b000000, 0x80000000, 0x6d000000, 0x86000000, 0x52000000, 0x71000000, 0x8a000000, 0x74000000, 0x6a000000, 0x08000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff102f6b, 0xff23417c, 0xff334771, 0xff41506d, 0xff334771, 0xff23417c, 0xff102f6b, 0x2a000000, 0x00ff00ff, 0x0d000000, 0x13000000, 0x18000000, 0x17000000, 0x16000000, 0x1d000000, 0x22000000, 0x20000000, 0x19000000, 0x0f000000, 0x04000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0x38000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x38000000, 0x1b000000, 0x00ff00ff, 0x06000000, 0x0c000000, 0x11000000, 0x11000000, 0x0d000000, 0x0e000000, 0x0d000000, 0x10000000, 0x0f000000, 0x09000000, 0x04000000, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x1b000000, 0x2a000000, 0x2a000000, 0xb9000000, 0x2a000000, 0x2a000000, 0x1b000000, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x7320396e, 0xec304e89, 0xff3f5d99, 0xff4664a0, 0xff3f5d99, 0xec304e89, 0x7320396e, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0xab000000, 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0xac2b4479, 0xff43619d, 0xff5775b1, 0xff617fbb, 0xff5775b1, 0xff43619d, 0xac2b4479, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xcd314b80, 0xff4e6ca8, 0xff6a88c4, 0xff7d9bd7, 0xff6a88c4, 0xff4e6ca8, 0xcd314b80, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0xab000000, 0x00ff00ff, 0xab000000, 0x2a000000, 0xe538558d, 0xff516fab, 0xff6f8dc9, 0xff89a7e3, 0xff6f8dc9, 0xff516fab, 0xe538558d, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xfb3e5b98, 0xff4a68a4, 0xff6785c0, 0xff7f9ddb, 0xff6785c0, 0xff4a68a4, 0xfb3e5b98, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff22417e, 0xff38548c, 0xff687a9e, 0xff97a9ce, 0xff687a9e, 0xff38548c, 0xff22417e, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x2a000000, 0xff102f6b, 0xff23417c, 0xff334771, 0xff41506d, 0xff334771, 0xff23417c, 0xff102f6b, 0x2a000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x1b000000, 0x38000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x54000000, 0x38000000, 0x1b000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, + 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x0d000000, 0x1b000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x2a000000, 0x1b000000, 0x0d000000, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, +}; +#else // !__MORPHOS__ +const unsigned char icon32[] = +{ +#if defined(__PPC__) + 0x00, 0x00, 0x00, 0x18, + 0x00, 0x00, 0x00, 0x14, + 'B', 'Z', '2', '\0', + 0x00, 0x00, 0x01, 0xf1, +#else + 0x18, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, + 'B', 'Z', '2', '\0', + 0xf1, 0x01, 0x00, 0x00, +#endif + + 0x42, 0x5A, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0x6F, 0x0B, 0xC4, 0x06, 0x00, 0x00, + 0xD6, 0x7F, 0xFF, 0xCD, 0xEF, 0xFF, 0xEA, 0x58, 0x18, 0xE8, 0x63, 0xED, 0xDD, 0x76, 0xCA, 0x24, + 0xDF, 0xBE, 0x37, 0xC7, 0xFE, 0x00, 0xEB, 0x46, 0xEC, 0x20, 0x28, 0x44, 0x23, 0x00, 0x88, 0x0A, + 0x04, 0x00, 0x08, 0xC0, 0x01, 0xD0, 0x38, 0x01, 0xC0, 0x00, 0x68, 0x00, 0x06, 0x40, 0x00, 0x00, + 0x19, 0x0D, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x52, 0x29, 0xEA, 0x04, 0xDA, + 0x1A, 0x68, 0x13, 0x04, 0xDA, 0x69, 0x34, 0xC0, 0x01, 0x0C, 0x68, 0x09, 0xA0, 0x61, 0x18, 0x00, + 0x00, 0x9A, 0x60, 0x10, 0x68, 0xC1, 0xC0, 0x00, 0x68, 0x00, 0x06, 0x40, 0x00, 0x00, 0x19, 0x0D, + 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x50, 0x93, 0x4A, 0x68, 0x7A, 0x9E, 0xA0, + 0x64, 0xD3, 0x20, 0xD1, 0xA0, 0x64, 0x69, 0x84, 0xC8, 0x01, 0xA3, 0x03, 0x48, 0xC8, 0x63, 0x44, + 0xD3, 0xD1, 0x1A, 0x69, 0x80, 0x26, 0xD4, 0x69, 0xA3, 0xD2, 0x51, 0x95, 0x96, 0x10, 0x81, 0x05, + 0x07, 0x1D, 0x00, 0xE8, 0x9F, 0x43, 0x8E, 0x46, 0x11, 0x50, 0xA4, 0x2C, 0x0C, 0x6A, 0xEB, 0xFA, + 0x69, 0x52, 0xE7, 0xE5, 0xC2, 0x64, 0xB9, 0x45, 0x64, 0x5A, 0xB3, 0x2C, 0xEB, 0xAC, 0x62, 0x92, + 0xBE, 0x1B, 0x35, 0x3B, 0x3E, 0xAB, 0x39, 0xB7, 0x45, 0x81, 0x44, 0x4D, 0x9D, 0x3A, 0x35, 0xD6, + 0xC9, 0x83, 0xB4, 0x9E, 0x44, 0x67, 0x6C, 0x5B, 0x1A, 0x3B, 0x52, 0x01, 0x28, 0x97, 0xCF, 0xEC, + 0x9B, 0xF7, 0xA4, 0xCE, 0xC5, 0xAB, 0x37, 0x67, 0x6F, 0x5F, 0x69, 0xFD, 0x27, 0xE1, 0x6A, 0x62, + 0x61, 0x7A, 0x4B, 0x14, 0xB0, 0xD2, 0x13, 0x06, 0x02, 0x12, 0xF2, 0x04, 0x03, 0x62, 0x13, 0x63, + 0x49, 0x82, 0x49, 0x8D, 0x21, 0x24, 0x36, 0x90, 0x36, 0x9B, 0x43, 0x6D, 0xB6, 0x21, 0x36, 0x92, + 0x4D, 0x0C, 0x18, 0xD2, 0x4D, 0xA0, 0x63, 0x13, 0x18, 0x26, 0x86, 0xC6, 0x30, 0x6D, 0x6A, 0x0C, + 0x82, 0x18, 0x98, 0x31, 0xB6, 0xD2, 0xD8, 0x1A, 0x20, 0x0C, 0xD7, 0x07, 0x00, 0x35, 0x78, 0x77, + 0x78, 0xEB, 0xC8, 0xA3, 0x8A, 0x39, 0x10, 0x48, 0x37, 0x08, 0x6F, 0x18, 0x25, 0x83, 0x84, 0xA0, + 0x4E, 0x44, 0xB0, 0x5F, 0x13, 0x71, 0x94, 0x09, 0x45, 0x8A, 0x5F, 0x92, 0x31, 0x88, 0xAA, 0x13, + 0xC8, 0xA8, 0x49, 0x22, 0xA1, 0x96, 0x91, 0x34, 0x20, 0xF0, 0x89, 0x12, 0x7B, 0xCC, 0xB2, 0x66, + 0x61, 0x43, 0xE2, 0x8C, 0xC3, 0x34, 0x94, 0x8F, 0x81, 0x9E, 0x4D, 0x55, 0x9A, 0x4E, 0x68, 0x14, + 0x2A, 0x91, 0xD7, 0x46, 0x1A, 0x46, 0x89, 0xA6, 0x74, 0x0B, 0x24, 0x48, 0xB4, 0xD4, 0x5F, 0x42, + 0x38, 0xC4, 0x4A, 0xA7, 0x35, 0x45, 0x14, 0xCC, 0x42, 0xB3, 0xEA, 0x45, 0x3A, 0xB1, 0xA8, 0x6B, + 0x29, 0x3F, 0x08, 0xB5, 0x8D, 0x47, 0x3C, 0xA5, 0x66, 0xFB, 0x9B, 0x2A, 0x50, 0xA6, 0x6E, 0x28, + 0xB5, 0xC8, 0xD2, 0x6C, 0x95, 0x8F, 0x21, 0xC0, 0x9D, 0x5D, 0xBC, 0xE4, 0xAB, 0xB4, 0x93, 0xB7, + 0xDE, 0xD5, 0x74, 0xC8, 0x40, 0x84, 0x21, 0xBE, 0x88, 0xFC, 0xA2, 0xCA, 0x62, 0x25, 0x03, 0x31, + 0x3B, 0x81, 0x8A, 0xAE, 0xEA, 0x2C, 0x9F, 0xA6, 0x52, 0x9B, 0x85, 0x51, 0xFC, 0x7B, 0x9C, 0x4B, + 0x77, 0x13, 0xA6, 0xE5, 0x2C, 0x3A, 0x4F, 0xF2, 0xD5, 0x61, 0xD7, 0x71, 0xBA, 0xAA, 0x6E, 0x72, + 0x9A, 0xD5, 0x6F, 0x0F, 0xF8, 0xBB, 0x92, 0x29, 0xC2, 0x84, 0x83, 0x78, 0x5E, 0x20, 0x30, +}; +#endif // !__MORPHOS__ diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/icon.h b/workbench/classes/zune/nlist/nlistviews_mcp/icon.h new file mode 100644 index 0000000000..62327f5bbd --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/icon.h @@ -0,0 +1,76 @@ +/*************************************************************************** + + NListviews.mcp - New Listview MUI Custom Class Preferences + Registered MUI class, Serial Number: 1d51 (0x9d510001 to 0x9d51001F + and 0x9d510101 to 0x9d51013F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if !defined(__MORPHOS__) +// uncompressed ARGB data +extern const unsigned long icon32[]; +#define ICON32_WIDTH 24 +#define ICON32_HEIGHT 20 +#define ICON32_DEPTH 32 +#else +// bzip2 compressed ARGB data +extern const unsigned char icon32[]; +#endif + +#ifdef USE_ICON8_COLORS +const ULONG icon8_colors[24] = +{ + 0xadadadad,0xadadadad,0xadadadad, + 0x7b7b7b7b,0x7b7b7b7b,0x7b7b7b7b, + 0x3b3b3b3b,0x67676767,0xa2a2a2a2, + 0xadadadad,0xadadadad,0xadadadad, + 0xadadadad,0xadadadad,0xadadadad, + 0xadadadad,0xadadadad,0xadadadad, + 0xffffffff,0xffffffff,0xffffffff, + 0x00000000,0x00000000,0x00000000, +}; +#endif + +#define ICON8_WIDTH 24 +#define ICON8_HEIGHT 14 +#define ICON8_DEPTH 3 +#define ICON8_COMPRESSION 0 +#define ICON8_MASKING 2 + +#ifdef USE_ICON8_HEADER +const struct BitMapHeader icon8_header = +{ 23,14,0,0,3,2,0,0,0,44,44,320,256 }; +#endif + +#ifdef USE_ICON8_BODY +const UBYTE icon8_body[168] = { +0x00,0x00,0x44,0x00,0xff,0xff,0xb8,0x00,0xff,0xff,0xb8,0x00,0x00,0x00,0x00, +0x00,0x80,0x00,0x64,0x00,0xff,0xff,0xb8,0x00,0x3b,0xb8,0x46,0x00,0x80,0x00, +0x64,0x00,0xc4,0x47,0xfc,0x00,0x00,0x00,0x46,0x00,0x80,0x00,0x64,0x00,0xff, +0xff,0xfc,0x00,0x36,0xd8,0x46,0x00,0x80,0x00,0x64,0x00,0xc9,0x27,0xfc,0x00, +0x00,0x00,0x46,0x00,0x80,0x00,0x64,0x00,0xff,0xff,0xfc,0x00,0x3d,0xe8,0x6e, +0x00,0x80,0x00,0x5c,0x00,0xc2,0x17,0xcc,0x00,0x00,0x00,0x46,0x00,0x80,0x00, +0x78,0x00,0xff,0xff,0xf8,0x00,0x00,0x00,0x40,0x00,0x80,0x00,0x64,0x00,0xff, +0xff,0xf8,0x00,0xbf,0xff,0xee,0x00,0x7f,0xff,0xdc,0x00,0x3f,0xff,0xcc,0x00, +0x00,0x44,0x46,0x00,0xff,0xbb,0xb8,0x00,0xff,0xbb,0xb8,0x00,0x00,0x00,0x00, +0x00,0x80,0x66,0x64,0x00,0xff,0xbb,0xb8,0x00,0xbf,0xee,0xee,0x00,0x7f,0xdd, +0xdc,0x00,0x3f,0xcc,0xcc,0x00,0x3f,0xee,0xee,0x00,0x00,0x00,0x00,0x00,0x00, +0x00,0x00,0x00, }; +#endif diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/images/icon32.png b/workbench/classes/zune/nlist/nlistviews_mcp/images/icon32.png new file mode 100755 index 0000000000000000000000000000000000000000..090792cc9f047ddf11ac59dd01e24caea342cf83 GIT binary patch literal 565 zcwPZD0?Pe~P)<h;3K|Lk000e1NJLTq000;O000yS1^@s6m$m(a00009a7bBm000id z000id0mpBsWB>pG=Sf6CRCt`Vl)X#CU=YTyCT*apt@yU0D1NMN3J!G_aTW(RCl^6* zbaGT&1i{6@#iigM;GnyMh`I<mh-h1|nwmyT+WJwSD{m#O7GtCbKdyI|-1FWWu4;uU z)JjuZ+TAS>pg{Xza&f*R(YqXrbqGz<s8lLZp<o*3LuU2nXmcCWKKmAcMRi?I3K19a zc$~uFFxj?Es;Y`t+f1UK0{;?-g*0slA|!;UVi*QFjzgU1I>=yBerFEsf;TV$4lvz2 zY6^Z&fqjk}1xO3GcPolQ!C;UgkqB9qMI3Y9{TLXOz6}h3aWo%;zXG#-7{n<SsS^l= z^e(>lV$s3%6sw+N&Nm3C(g#2fxC9B11-Ibvrz@g#Hmi1tDD`)isXG#-`<H9VKjtZC zSnlWe)O-~Sz~FO%PLKnm(ocgOP(MLFZ{SEDbbOMb%ZpR89F@$nj{KARu@YDVK~RzK zG-u#L)@}KH>Lw_d=UYjWsE@u|n(Hosifl%*QBmd;>B~P|kp=FgXWIZvHSt;=AFk|f z@SA-J$R%PjGBsJN)s}E1vHs^JZ2DJ$rh9m4MuxtZu&IEnIh&^?^fdu{gexAG@b42y zkztQZ=v|=EJT9Ss0gp@QTfplQ`W9$h!aDIL`Ko;a;HdlKofvdx00000NkvXXu0mjf D2buTP literal 0 HcwPel00001 diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/library.c b/workbench/classes/zune/nlist/nlistviews_mcp/library.c new file mode 100644 index 0000000000..dbdaed34ba --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/library.c @@ -0,0 +1,245 @@ +/*************************************************************************** + + NListviews.mcp - New Listview MUI Custom Class Preferences + Registered MUI class, Serial Number: 1d51 (0x9d510001 to 0x9d51001F + and 0x9d510101 to 0x9d51013F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +/******************************************************************************/ +/* */ +/* includes */ +/* */ +/******************************************************************************/ + +#include <proto/exec.h> +#include <proto/intuition.h> +#include <proto/muimaster.h> + +/******************************************************************************/ +/* */ +/* MCC/MCP name and version */ +/* */ +/* ATTENTION: The FIRST LETTER of NAME MUST be UPPERCASE */ +/* */ +/******************************************************************************/ + +#include "private.h" +#include "version.h" + +#define VERSION LIB_VERSION +#define REVISION LIB_REVISION + +#define CLASS MUIC_NListviews_mcp +#define SUPERCLASSP MUIC_Mccprefs + +#define INSTDATAP NListviews_MCP_Data + +#define USERLIBID CLASS " " LIB_REV_STRING " [" SYSTEMSHORT "/" CPU "] (" LIB_DATE ") " LIB_COPYRIGHT +#define MASTERVERSION 19 + +#define CLASSINIT +#define CLASSEXPUNGE + +#define USEDCLASSES used_mccs +static const char *used_mccs[] = { "NList.mcc", "NListview.mcc", NULL }; + +#define USEDCLASSESP used_mcps +static const char *used_mcps[] = { "NListviews.mcp", NULL }; + +#define MIN_STACKSIZE 8192 + +#include "locale.h" + +struct Library *CxBase = NULL; +struct Library *LocaleBase = NULL; +struct Device *ConsoleDevice = NULL; +//struct Catalog *catalog = NULL; + +#if defined(__amigaos4__) +struct CommoditiesIFace *ICommodities = NULL; +struct LocaleIFace *ILocale = NULL; +struct ConsoleIFace *IConsole = NULL; +#endif + +static struct IOStdReq ioreq; + +#if !defined(__MORPHOS__) +static BOOL nbitmapCanHandleRawData; +#endif + +/******************************************************************************/ +/* define the functions used by the startup code ahead of including mccinit.c */ +/******************************************************************************/ +static BOOL ClassInit(UNUSED struct Library *base); +static VOID ClassExpunge(UNUSED struct Library *base); + +/******************************************************************************/ +/* include the lib startup code for the mcc/mcp (and muimaster inlines) */ +/******************************************************************************/ +#define USE_ICON8_COLORS +#define USE_ICON8_BODY + +#include "icon.h" + +#if defined(__MORPHOS__) +#include <mui/Rawimage_mcc.h> +#else +#include <mui/NBitmap_mcc.h> +#endif + +static Object *get_prefs_image(void) +{ + Object *obj; + + #if !defined(__MORPHOS__) + if(nbitmapCanHandleRawData == TRUE) + { + obj = NBitmapObject, + MUIA_FixWidth, ICON32_WIDTH, + MUIA_FixHeight, ICON32_HEIGHT, + MUIA_NBitmap_Type, MUIV_NBitmap_Type_ARGB32, + MUIA_NBitmap_Normal, icon32, + MUIA_NBitmap_Width, ICON32_WIDTH, + MUIA_NBitmap_Height, ICON32_HEIGHT, + End; + } + else + { + obj = NULL; + } + #else + obj = RawimageObject, + MUIA_Rawimage_Data, icon32, + End; + #endif + + // if the 32bit image data couldn't be loaded + // we fall back to the 8bit icon + if(obj == NULL) + { + obj = BodychunkObject,\ + MUIA_FixWidth, ICON8_WIDTH,\ + MUIA_FixHeight, ICON8_HEIGHT,\ + MUIA_Bitmap_Width, ICON8_WIDTH ,\ + MUIA_Bitmap_Height, ICON8_HEIGHT,\ + MUIA_Bodychunk_Depth, ICON8_DEPTH,\ + MUIA_Bodychunk_Body, (UBYTE *)icon8_body,\ + MUIA_Bodychunk_Compression, ICON8_COMPRESSION,\ + MUIA_Bodychunk_Masking, ICON8_MASKING,\ + MUIA_Bitmap_SourceColors, (ULONG *)icon8_colors,\ + MUIA_Bitmap_Transparent, 0,\ + End; + } + + return obj; +} + +#define PREFSIMAGEOBJECT get_prefs_image() + +#include "mccinit.c" + +/******************************************************************************/ +/* define all implementations of our user functions */ +/******************************************************************************/ +static BOOL ClassInit(UNUSED struct Library *base) +{ + if((CxBase = OpenLibrary("commodities.library", 37L)) != NULL && + GETINTERFACE(ICommodities, struct CommoditiesIFace *, CxBase)) + { + ioreq.io_Message.mn_Length = sizeof(ioreq); + if(OpenDevice("console.device", -1L, (struct IORequest *)&ioreq, 0L) == 0) + { + ConsoleDevice = (struct Device *)ioreq.io_Device; + if(GETINTERFACE(IConsole, struct ConsoleIFace *, ConsoleDevice)) + { + if((LocaleBase = OpenLibrary( "locale.library", 38)) != NULL && + GETINTERFACE(ILocale, struct LocaleIFace *, LocaleBase)) + { + // open the NListviews_mcp catalog + OpenCat(); + + #if !defined(__MORPHOS__) + { + struct Library *nbitmapMcc; + + nbitmapCanHandleRawData = FALSE; + + // we need at least NBitmap.mcc V15.8 to be able to let it handle raw image data + if((nbitmapMcc = OpenLibrary("mui/NBitmap.mcc", 0)) != NULL) + { + SHOWVALUE(DBF_ALWAYS, nbitmapMcc->lib_Version); + SHOWVALUE(DBF_ALWAYS, nbitmapMcc->lib_Revision); + + if(nbitmapMcc->lib_Version > 15 || (nbitmapMcc->lib_Version == 15 && nbitmapMcc->lib_Revision >= 8)) + nbitmapCanHandleRawData = TRUE; + + CloseLibrary(nbitmapMcc); + } + + SHOWVALUE(DBF_ALWAYS, nbitmapCanHandleRawData); + } + #endif + + return TRUE; + } + + DROPINTERFACE(IConsole); + } + + CloseDevice((struct IORequest *)&ioreq); + } + + DROPINTERFACE(ICommodities); + CloseLibrary(CxBase); + CxBase = NULL; + } + + return FALSE; +} + + +static VOID ClassExpunge(UNUSED struct Library *base) +{ + // close the catalog + CloseCat(); + + if(LocaleBase != NULL) + { + DROPINTERFACE(ILocale); + CloseLibrary(LocaleBase); + LocaleBase = NULL; + } + + if(ConsoleDevice != NULL) + { + DROPINTERFACE(IConsole); + CloseDevice((struct IORequest *)&ioreq); + ConsoleDevice = NULL; + } + + if(CxBase != NULL) + { + DROPINTERFACE(ICommodities); + CloseLibrary(CxBase); + CxBase = NULL; + } +} + diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/locale/NListviews_mcp.cd b/workbench/classes/zune/nlist/nlistviews_mcp/locale/NListviews_mcp.cd new file mode 100644 index 0000000000..56a829152c --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/locale/NListviews_mcp.cd @@ -0,0 +1,556 @@ +; +; NListviews_mcp.cd - NList MUI custom prefs catalog description file +; $Id$ +; +#version 2 +#language english +; +; +MSG_FONTS (0//) +Fonts +; +MSG_NORMAL_FONT (1//) +Normal Font: +; +MSG_NORMAL_FONT_HELP (2//) +Choose the normal NList font. +; +MSG_NORMAL_FONT_ASL (3//) +Please select the normal font... +; +MSG_SMALL_FONT (4//) +Small Font: +; +MSG_SMALL_FONT_HELP (5//) +Choose the small NList font. +; +MSG_SMALL_FONT_ASL (6//) +Please select a small font... +; +MSG_FIXED_FONT (7//) +Fixed Font: +; +MSG_FIXED_FONT_HELP (8//) +Choose the fixed NList font. +; +MSG_FIXED_FONT_ASL (9//) +Please select a fixed font... +; +MSG_FONT_MARGIN (10//) +Font Margin: +; +MSG_FONT_MARGIN_HELP (11//) +Allows to set a vertical margin\n\ +which will be added to the font\n\ +height and result in the default\n\ +line height in an NList object. +; +MSG_COLORS (12//) +Colors +; +MSG_TEXTCOLOR (13//) +Text Pen +; +MSG_BACKGROUNDCOLOR (14//) +Background +; +MSG_TITLE_PEN_WIN (15//) +Title Pen +; +MSG_TITLE_PEN_HELP (16//) +For adjusting the pen color of\n\ +a title. +; +MSG_PBG_TITLE (17//) +\ecTitle +; +MSG_TITLE_BG_WIN (18//) +Title Background +; +MSG_TITLE_BG_HELP (19//) +For adjusting the background color\n\ +of a title. +; +MSG_LIST_PEN_WIN (20//) +List Pen +; +MSG_LIST_PEN_HELP (21//) +For adjusting the pen color of\n\ +a list. +; +MSG_PBG_LIST (22//) +\ecList +; +MSG_LIST_BG_WIN (23//) +List Background +; +MSG_LIST_BG_HELP (24//) +For adjusting the background color\n\ +of a list. +; +MSG_SELECT_PEN_WIN (25//) +Selected Entry +; +MSG_SELECT_PEN_HELP (26//) +For adjusting the pen color of\n\ +selected entries. +; +MSG_PBG_SELECT (27//) +\ecSelected +; +MSG_SELECT_BG_WIN (28//) +Selected Entry +; +MSG_SELECT_BG_HELP (29//) +For adjusting the background color\n\ +of selected entries. +; +MSG_CURSOR_PEN_WIN (30//) +Selected Cursor +; +MSG_CURSOR_PEN_HELP (31//) +For adjusting the pen color of\n\ +a selected cursor. +; +MSG_PBG_CURSOR (32//) +\ecCursor +; +MSG_CURSOR_BG_WIN (33//) +Selected Cursor +; +MSG_CURSOR_BG_HELP (34//) +For adjusting the background color\n\ +of a selected cursor. +; +MSG_UNSEL_PEN_WIN (35//) +Unselected Cursor +; +MSG_UNSEL_PEN_HELP (36//) +For adjusting the pen color of\n\ +an unselected cursor. +; +MSG_PBG_UNSEL (37//) +\ecUnselected +; +MSG_UNSEL_BG_WIN (38//) +Unselected Cursor +; +MSG_UNSEL_BG_HELP (39//) +For adjusting the background color\n\ +of an unselected cursor. +; +MSG_INACT_PEN_WIN (40//) +Inactive Cursor +; +MSG_INACT_PEN_HELP (41//) +For adjusting the pen color of\n\ +an inactive cursor. +; +MSG_PBG_INACT (42//) +\ecInactive +; +MSG_INACT_BG_WIN (43//) +Inactive Cursor +; +MSG_INACT_BG_HELP (44//) +For adjusting the background color\n\ +of an inactive cursor. +; +MSG_MULTISELECT (45//) +MultiSelection +; +MSG_MULTISELECT_QUAL (46//) +via Qualifier +; +MSG_MULTISELECT_ALWAYS (47//) +Always +; +MSG_MULTISELECT_HELP (48//) +Allows to specify the default\n\ +multiselection mode. +; +MSG_MMB_MULTISEL (49//) +MMB multiselection +; +MSG_MMB_MULTISEL_HELP (50//) +Set it if you want to use the middle\n\ +mouse button (MMB) as a multiselection\n\ +qualifier. +; +MSG_DRAGDROP (51//) +Drag&Drop +; +MSG_DRAGTYPE_IMMEDIATE (52//) +Immediate +; +MSG_DRAGTYPE_BORDERS (53//) +at Borders +; +MSG_DRAGTYPE_QUALIFIER (54//) +via Qualifier +; +MSG_DRAGTYPE_HELP (55//) +Set the drag mode. 'Immediate' will start\n\ +drag&drop as soon as you drag an object.\n\ +'at Borders' for showing a drag operation\n\ +as soon as you passed the left/right borders\n\ +and 'via Qualifier' for only allowing to\n\ +drag&drop via a qualifier key (see 'Keys').\n\ +\n\ +'Immediate' is used only when in no-multiselect\n\ +mode. +; +MSG_DRAG_LINES (56//) +Visible lines +; +MSG_DRAG_LINES_HELP (57//) +Give the max. number of lines\n\ +which will be shown when\n\ +doing drag&drop. If more lines\n\ +are selected, you'll get a message\n\ +similar to: 'Dragging xx Items...'. +; +MSG_PAGE_FONTS (58//) +Fonts +; +MSG_PAGE_COLORS (59//) +Colors +; +MSG_PAGE_OPTIONS (60//) +Options +; +MSG_PAGE_SCROLLING (61//) +Scrolling +; +MSG_PAGE_KEYBINDINGS (62//) +Keybindings +; +MSG_SB_HORIZONTAL (63//) +Horizontal Scrollbar +; +MSG_SB_HORIZONTAL_HELP (64//) +Set the default mode\n\ +for the horizontal scrollbar.\n\ +(may be overwritten by an\n\ +application) +; +MSG_SB_VERTICAL (65//) +Vertical Scrollbar +; +MSG_SB_VERTICAL_HELP (66//) +Set the default mode\n\ +for the vertical scrollbar.\n\ +(may be overwritten by an\n\ +application) +; +MSG_SCROLLCONTROL (67//) +Scolling Control +; +MSG_SMOOTH_SCROLLING (68//) +Smooth Scrolling +; +MSG_SMOOTH_SCROLLING_HELP (69//) +If enabled, smoothing scrolling\n\ +will be used for NList objects.\n\ +In addition, by using the 'smooth'\n\ +slider in the normal MUI 'Listview'\n\ +configuration page the speed of\n\ +the smooth scrolling can be controled. +; +MSG_MMB_FASTWHEEL (70//) +MMB Fast Wheel +; +MSG_MMB_FASTWHEEL_HELP (71//) +If enabled, the middle mouse button\n\ +can be used as a qualifier to perform\n\ +a fast scroll wheel action.\n\ +(See 'Keybindings' page as well for\n\ +more wheel qualifiers) +; +MSG_WHEEL_STEP (72//) +Mouse Wheel Step +; +MSG_WHEEL_STEP_HELP (73//) +Allows to specify the amount of lines\n\ +that should be scrolled when using a\n\ +wheel mouse. +; +MSG_WHEEL_FAST (74//) +Mouse Wheel Fast Step +; +MSG_WHEEL_FAST_HELP (75//) +Allows to specify the amount of lines\n\ +that should be scrolled when using a\n\ +wheel mouse and when the fast wheel\n\ +qualifier is pressed. +; +MSG_LAYOUT (76//) +Layout +; +MSG_PARTIAL_COL_MARK (77//) +Partial column mark +; +MSG_PARTIAL_COL_MARK_HELP (78//) +If enabled, a special mark will be drawn\n\ +at the right side of a column in case the\n\ +text didn't completly fit into it. +; +MSG_PARTIAL_CHARS_DRAWN (79//) +Partial chars drawn +; +MSG_PARTIAL_CHARS_DRAWN_HELP (80//) +If enabled, characters that are not fully\n\ +visible at the left and right corner of\n\ +an NList object will not be drawn partially. +; +MSG_VERT_CENTERED (81//) +Vertical centered lines +; +MSG_VERT_CENTERED_HELP (82//) +If activated, the text lines are centered\n\ +vertically in a NList object. +; +MSG_BALANCING_COLS (83//) +Balancing Columns +; +MSG_BALANCING_COLS_HELP (84//) +NList permits to change the column width\n\ +via mouse dragging the column separator in\n\ +the title bar. The moved bar can be visible\n\ +either only in the title, throughout the\n\ +whole lines or the column width changes can\n\ +be made visible instantly. +; +MSG_COLWIDTHDRAG_TITLE (85//) +Title Bar +; +MSG_COLWIDTHDRAG_FULLBAR (86//) +Full Bar +; +MSG_COLWIDTHDRAG_VISIBLE (87//) +Visible +; +MSG_COLOR_OPTIONS (88//) +Options +; +MSG_FORCE_SELECT_PEN (89//) +Force select pen +; +MSG_FORCE_SELECT_PEN_HELP (90//) +If enabled, NList will make sure that\n\ +the 'Selected', 'Cursor' and 'Unselected'\n\ +color will be forced. +; +MSG_MULTISEL_MOVEACTIVE (91//) +Keyboard moves cursor +; +MSG_MULTISEL_MOVEACTIVE_HELP (92//) +If enabled, a keyboard use in an NList\n\ +object will move the active cursor\n\ +rather than the unselected one. +; +MSG_GROUP_MISC (93//) +Miscellaneous +; +MSG_GROUP_EXAMPLE (94//) +Example +; +MSG_SERMOUSE_FIX (95//) +Serial Mouse Fix +; +MSG_SERMOUSE_FIX_HELP (96//) +If enabled, NList tries to fix common\n\ +drag&drop issues that are related to using\n\ +a serial mouse. +; +MSG_SELECT_POINTER (97//) +Custom Select Pointer +; +MSG_SELECT_POINTER_HELP (98//) +If enabled, and an NList object is in\n\ +charwise selection mode a custom select\n\ +pointer will be displayed instead of the\n\ +default workbench mouse pointer image. +; +MSG_BAR_CONTEXTMENU (99//) +Context Menu +; +MSG_DEFAULT_CONTEXT_MENU_HELP (100//) +NList permits to have its default\n\ +context menu being disabled or enabled\n\ +or only in case the mouse is at the top\n\ +of the NList object. +; +MSG_SNOOP (101//) +Snoop +; +MSG_SNOOP_KEY (102//) +Start the grab of a hotkey. +; +MSG_BUTTON_INSERT (103//) +Insert +; +MSG_BUTTON_INSERT_HELP (104//) +Allows to insert a new hotkey. +; +MSG_BUTTON_REMOVE (105//) +Remove +; +MSG_BUTTON_REMOVE_HELP (106//) +Allows to remove an existing hotkey. +; +MSG_BUTTON_UPDATEKEYS (107//) +Update keys +; +MSG_BUTTON_UPDATEKEYS_HELP (108//) +Add the default hotkeys for\n\ +the functions which are not\n\ +currently in the list. +; +MSG_BUTTON_DEFAULTKEYS (109//) +Default keys +; +MSG_BUTTON_DEFAULTKEYS_HELP (110//) +Resets all hotkeys to default ones. +; +MSG_FUNC_MULTISELQUAL (111//) +Multiselect/Block Qualifier +; +MSG_FUNC_DRAGQUAL (112//) +Drag&Drop Qualifier +; +MSG_FUNC_BALANCEQUAL (113//) +Balance Qualifier +; +MSG_FUNC_COPYCLIP (114//) +Copy to clipboard +; +MSG_FUNC_DEFCOLWIDTH (115//) +Default width column +; +MSG_FUNC_DEFALLCOLWIDTH (116//) +Default width all columns +; +MSG_FUNC_DEFORDERCOL (117//) +Default order column +; +MSG_FUNC_DEFALLORDERCOL (118//) +Default order all columns +; +MSG_FUNC_SELECTTOP (119//) +Select to top +; +MSG_FUNC_SELECTBOTTOM (120//) +Select to bottom +; +MSG_FUNC_SELECTPAGEUP (121//) +Select to page up +; +MSG_FUNC_SELECTPAGEDOWN (122//) +Select to page down +; +MSG_FUNC_SELECTUP (123//) +Select up +; +MSG_FUNC_SELECTDOWN (124//) +Select down +; +MSG_FUNC_TOGGLEACTIVE (125//) +Toggle active +; +MSG_FUNC_FASTWHEELQUAL (126//) +Fast MouseWheel Qualifier +; +MSG_FUNC_HORIZWHEELQUAL (127//) +Horiz MouseWheel Qualifier +; +MSG_FUNC_TITLECLICKQUAL (128//) +Title Click Qualifier +; +MSG_VSB_ALWAYS (129//) +Always +; +MSG_VSB_AUTO (130//) +Auto +; +MSG_VSB_FULLAUTO (131//) +FullAuto +; +MSG_HSB_ALWAYS (132//) +Always +; +MSG_HSB_AUTO (133//) +Auto +; +MSG_HSB_FULLAUTO (134//) +FullAuto +; +MSG_HSB_NONE (135//) +None +; +MSG_CMENU_ALWAYS (136//) +Always +; +MSG_CMENU_TOPONLY (137//) +TopOnly +; +MSG_CMENU_NEVER (138//) +Never +; +MSG_HOTKEYS_KEY (139//) +Key +; +MSG_HOTKEYS_ACTION (140//) +Action +; +MSG_EXAMPLE_TEXT (141//) +If you have problems, try to increase the stack value,\n\ +in the icon infos if you launch the program from icon,\n\ +stack of CLI if you start it from CLI/Shell,\n\ +and if you launch it from some utility read its docs\n\ +to see how to increase it.\n\ +A stack of 12Kb, 16Kb or 20Kb is most of time a good idea.\n\ +\n\ +If you still have problems, try to see if they happen with the Demo prog, then tell me.\n\ +\033C\n\ +Latest public release can be found on aminet (dev/mui).\n\ +All releases are available on\n\ +http://www.sourceforge.net/projects/nlist-classes/\n\ +\033C\n\ +\033r\0333(C) 2001-2010 by NList Open Source Team\n\ +\033r\0333(C) 1996-1998 by Gilles Masson\n\ +\033r\0333http://www.sourceforge.net/projects/nlist-classes/\n\ +\033C\n\ +\033cThis new list/listview custom class\n\ +\033chandles its own configurable backgrounds,\n\ +\033cpens, fonts, scrollbars, keys and qualifiers\n\ +\033C\n\ +\033cThe way used to handle cursor with multiselection\n\ +\033cis not exactly as the listview one !\n\ +\033cDrag&Drop is supported, both scrollbars\n\ +\033ccan be configured to disappear automatically\n\ +\033cwhen not needed because all is visible.\n\ +\033cJust try it...\n\ +\033C\n\ +\033cYou can horizontaly scroll with cursor keys,\n\ +\033cor going on the right and left of the list\n\ +\033cwhile selecting with the mouse.\n\ +\033cTry just clicking on the left/right borders !\n\ +\033C\n\ +\033cYou can change columns widths just dragging\n\ +\033cthe vertical separator between columns titles\n\ +\033c(try it using the balancing qualifier too).\n\ +\033C\n\ +\033cYou can change columns order just dragging\n\ +\033cthe column titles.\n\ +\033C\n\ +\033cThere is builtin copy to clipboard stuff\n\ +\033cand classic char selection capability.\n\ +\033C\n\ +\033cTry the Demo program to test all that...\n\ +\n\ +\n\ +\033r\033bGive some feedback about it ! :-)\n\ +\033C\n\ +**************************************************************************************************\n +; \ No newline at end of file diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/locale/czech.ct b/workbench/classes/zune/nlist/nlistviews_mcp/locale/czech.ct new file mode 100644 index 0000000000..eaf22a1cbd --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/locale/czech.ct @@ -0,0 +1,782 @@ +## version $VER: NListviews_mcp.catalog 2.6 (24.6.2008) +## language czech +## codeset 5 +; +; +; NListviews_mcp.cd - NList MUI custom prefs catalog description file +; $Id$ +; +;#version 2 +;#language english +; +; +MSG_FONTS +Písma +; Fonts +; +MSG_NORMAL_FONT +Standardní písmo: +; Normal Font: +; +MSG_NORMAL_FONT_HELP +Umo¾ní definovat standardní písmo. +; Choose the normal NList font. +; +MSG_NORMAL_FONT_ASL +Vyberte po¾adované standardní písmo +; Please select the normal font... +; +MSG_SMALL_FONT +Drobné písmo: +; Small Font: +; +MSG_SMALL_FONT_HELP +Umo¾ní definovat drobné písmo. +; Choose the small NList font. +; +MSG_SMALL_FONT_ASL +Vyberte po¾adované drobné písmo +; Please select a small font... +; +MSG_FIXED_FONT +Fixní písmo: +; Fixed Font: +; +MSG_FIXED_FONT_HELP +Umo¾ní definovat fixní písmo. +; Choose the fixed NList font. +; +MSG_FIXED_FONT_ASL +Vyberte po¾adované fixní písmo +; Please select a fixed font... +; +MSG_FONT_MARGIN +Svislé odsazení +; Font Margin +; +MSG_FONT_MARGIN_HELP +Definice vý¹ky øádku v rámci objektu tøídy NList. +; Allows to set a vertical margin\n\ +; which will be added to the font\n\ +; height and result in the default\n\ +; line height in an NList object. +; +MSG_COLORS +Barvy +; Colors +; +MSG_TEXTCOLOR +Barva textu +; Text Pen +; +MSG_BACKGROUNDCOLOR +Barva pozadí +; Background +; +MSG_TITLE_PEN_WIN +Barva záhlaví +; Title Pen +; +MSG_TITLE_PEN_HELP +Definuje barvu textu v záhlaví. +; For adjusting the pen color of\n\ +; a title. +; +MSG_PBG_TITLE +\ecZáhlaví +; \ecTitle +; +MSG_TITLE_BG_WIN +Barva pozadí záhlaví +; Title Background +; +MSG_TITLE_BG_HELP +Definuje barvu pozadí záhlaví. +; For adjusting the background color\n\ +; of a title. +; +MSG_LIST_PEN_WIN +Barva textu v seznamu +; List Pen +; +MSG_LIST_PEN_HELP +Definuje barvu textu v seznamu. +; For adjusting the pen color of\n\ +; a list. +; +MSG_PBG_LIST +\ecSeznam +; \ecList +; +MSG_LIST_BG_WIN +Barva pozadí seznamu +; List Background +; +MSG_LIST_BG_HELP +Definuje barvu pozadí seznamu. +; For adjusting the background color\n\ +; of a list. +; +MSG_SELECT_PEN_WIN +Barva vybrané polo¾ky +; Selected Entry +; +MSG_SELECT_PEN_HELP +Definuje barvu vybraných polo¾ek v seznamu. +; For adjusting the pen color of\n\ +; selected entries. +; +MSG_PBG_SELECT +\ecVybraná polo¾ka +; \ecSelected +; +MSG_SELECT_BG_WIN +Vybraná polo¾ka +; Selected Entry +; +MSG_SELECT_BG_HELP +Definuje barvu pozadí vybraných polo¾ek. +; For adjusting the background color\n\ +; of selected entries. +; +MSG_CURSOR_PEN_WIN +Oznaèený kurzor +; Selected Cursor +; +MSG_CURSOR_PEN_HELP +Definuje barvu oznaèeného kurzoru. +; For adjusting the pen color of\n\ +; a selected cursor. +; +MSG_PBG_CURSOR +\ecKurzor +; \ecCursor +; +MSG_CURSOR_BG_WIN +Oznaèený kurzor +; Selected Cursor +; +MSG_CURSOR_BG_HELP +Definuje barvu pozadí oznaèeného kurzoru. +; For adjusting the background color\n\ +; of a selected cursor. +; +MSG_UNSEL_PEN_WIN +Neoznaèený kurzor +; Unselected Cursor +; +MSG_UNSEL_PEN_HELP +Definuje barvu neoznaèeného kurzoru. +; For adjusting the pen color of\n\ +; an unselected cursor. +; +MSG_PBG_UNSEL +\ecNeoznaèený kurzor +; \ecUnselected +; +MSG_UNSEL_BG_WIN +Neoznaèený kurzor +; Unselected Cursor +; +MSG_UNSEL_BG_HELP +Definuje barvu pozadí neoznaèeného kurzoru. +; For adjusting the background color\n\ +; of an unselected cursor. +; +MSG_INACT_PEN_WIN +Neaktivní kurzor +; Inactive Cursor +; +MSG_INACT_PEN_HELP +Definuje barvu neoznaèeného kurzoru. +; For adjusting the pen color of\n\ +; an inactive cursor. +; +MSG_PBG_INACT +\ecNeaktivní kurzor +; \ecInactive +; +MSG_INACT_BG_WIN +Neaktivní kurzor +; Inactive Cursor +; +MSG_INACT_BG_HELP +Definuje barvu pozadí neoznaèeného kurzoru. +; For adjusting the background color\n\ +; of an inactive cursor. +; +MSG_MULTISELECT +Vícenásobný výbìr +; MultiSelection +; +MSG_MULTISELECT_QUAL +Pomocí klávesy +; via Qualifier +; +MSG_MULTISELECT_ALWAYS +Standardnì zapnuto +; Always +; +MSG_MULTISELECT_HELP +Definuje zpùsob výbìru více polo¾ek najednou. +; Allows to specify the default\n\ +; multiselection mode. +; +MSG_MMB_MULTISEL +Prostøedním tlaèítkem my¹i +; MMB multiselection +; +MSG_MMB_MULTISEL_HELP +Aktivuje vícenásobný výbìr polo¾ek prostøedním\n\ +tlaèítkem my¹i. +; Set it if you want to use the middle\n\ +; mouse button (MMB) as a multiselection\n\ +; qualifier. +; +MSG_DRAGDROP +Táhnout a pustit +; Drag&Drop +; +MSG_DRAGTYPE_IMMEDIATE +Bez zpo¾dìní +; Immediate +; +MSG_DRAGTYPE_BORDERS +Na okrajích +; at Borders +; +MSG_DRAGTYPE_QUALIFIER +Pomocí klávesy +; via Qualifier +; +MSG_DRAGTYPE_HELP +Definuje re¾im metody 'Táhnout a pustit'. V re¾imu\n\ +'Bez zpo¾dìní' lze vybraný objekt pøetáhnout okam¾itì\n\ +po vybrání. 'Na okrajích' znamená, ¾e objekty lze táhnout\n\ +pouze z jejich levého nebo pravého okraje. Vyberete-li\n\ +'Pomocí klávesy', bude mo¾né vybrané objekty táhnout\n\ +pouze za souèasného dr¾ení vybrané klávesy.\n\ +\n\ +Pozn.: 'Bez zpo¾dìní' lze pou¾ít jen tehdy, pokud není\n\ +aktivní re¾im vícenásobného výbìru polo¾ek. +; Set the drag mode. 'Immediate' will start\n\ +; drag&drop as soon as you drag an object.\n\ +; 'at Borders' for showing a drag operation\n\ +; as soon as you passed the left/right borders\n\ +; and 'via Qualifier' for only allowing to\n\ +; drag&drop via a qualifier key (see 'Keys').\n\ +; \n\ +; 'Immediate' is used only when in no-multiselect\n\ +; mode. +; +MSG_DRAG_LINES +Viditelné øádky +; Visible lines +; +MSG_DRAG_LINES_HELP +Definuje max. poèet øádkù viditelných bìhem táhnutí\n\ +objektu. Vyberete-li více øádkù, NList zobrazí text\n\ +"Poèet táhnutých polo¾ek: xy". +; Give the max. number of lines\n\ +; which will be shown when\n\ +; doing drag&drop. If more lines\n\ +; are selected, you'll get a message\n\ +; similar to: 'Dragging xx Items...'. +; +MSG_PAGE_FONTS +Písma +; Fonts +; +MSG_PAGE_COLORS +Barvy +; Colors +; +MSG_PAGE_OPTIONS +Mo¾nosti +; Options +; +MSG_PAGE_SCROLLING +Posouvání +; Scrolling +; +MSG_PAGE_KEYBINDINGS +Klávesové zkratky +; Keybindings +; +MSG_SB_HORIZONTAL +Vodorovný posuvník +; Horizontal Scrollbar +; +MSG_SB_HORIZONTAL_HELP +Definuje zpùsob chování vodorovného posuvníku.\n\ +Pozn.: Programy mohou toto nastavení zmìnit. +; Set the default mode\n\ +; for the horizontal scrollbar.\n\ +; (may be overwritten by an\n\ +; application) +; +MSG_SB_VERTICAL +Svislý posuvník +; Vertical Scrollbar +; +MSG_SB_VERTICAL_HELP +Definuje zpùsob chování svislého posuvníku.\n\ +Pozn.: Programy mohou toto nastavení zmìnit. +; Set the default mode\n\ +; for the vertical scrollbar.\n\ +; (may be overwritten by an\n\ +; application) +; +MSG_SCROLLCONTROL +Mo¾nosti posouvání +; Scolling Control +; +MSG_SMOOTH_SCROLLING +Zapnout plynulé posouvání +; Smooth Scrolling +; +MSG_SMOOTH_SCROLLING_HELP +Aktivuje plynulé posouvání obsahu objektù NList.\n\ +Rychlost posouvání lze mìnit ¹oupátkem "Plynulé"\n\ +v konfiguraci MUI, v sekci Seznamy/Ovládání. +; If enabled, smoothing scrolling\n\ +; will be used for NList objects.\n\ +; In addition, by using the 'smooth'\n\ +; slider in the normal MUI 'Listview'\n\ +; configuration page the speed of\n\ +; the smooth scrolling can be controled. +; +MSG_MMB_FASTWHEEL +Zrychlit prostøedním tlaèítkem my¹i +; MMB Fast Wheel +; +MSG_MMB_FASTWHEEL_HELP +Aktivuje zrychlené posouvání pøi souèasnì zmáèknutém\n\ +prostøedním tlaèítku my¹i.\n\ +Na panelu "Klávesové zkratky" najdete pøehled v¹ech\n\ +pøepínaèù pro práci s koleèkem my¹i. +; If enabled, the middle mouse button\n\ +; can be used as a qualifier to perform\n\ +; a fast scroll wheel action.\n\ +; (See 'Keybindings' page as well for\n\ +; more wheel qualifiers) +; +MSG_WHEEL_STEP +Otoèení koleèka o 1 krok +; Mouse Wheel Step +; +MSG_WHEEL_STEP_HELP +Definuje poèet øádkù, o které se posune obsah\n\ +objektu NList, pøi otoèení koleèka o jeden krok. +; Allows to specify the amount of lines\n\ +; that should be scrolled when using a\n\ +; wheel mouse. +; +MSG_WHEEL_FAST +Otoèení koleèka o 1 krok (pøi zrychlení) +; Mouse Wheel Fast Step +; +MSG_WHEEL_FAST_HELP +Definuje poèet øádkù, o které se posune obsah\n\ +objektu NList, pøi otoèení koleèka o jeden krok\n\ +a souèasnì zmáèknutém prostøedním tlaèítku my¹i. +; Allows to specify the amount of lines\n\ +; that should be scrolled when using a\n\ +; wheel mouse and when the fast wheel\n\ +; qualifier is pressed. +; +MSG_LAYOUT +Vzhled +; Layout +; +MSG_PARTIAL_COL_MARK +Indikovat zú¾ený sloupec +; Partial column mark +; +MSG_PARTIAL_COL_MARK_HELP +Aktivuje zobrazení indikátoru stavu, kdy je ¹íøka\n\ +sloupce men¹í ne¾ nejdel¹í polo¾ka, kterou obsahuje. +; If enabled, a special mark will be drawn\n\ +; at the right side of a column in case the\n\ +; text didn't completly fit into it. +; +MSG_PARTIAL_CHARS_DRAWN +Zapnout plné vykreslování znakù +; Partial chars drawn +; +MSG_PARTIAL_CHARS_DRAWN_HELP +Vypne èásteèné vykreslování znakù. To znamená,\n\ +¾e je-li sloupec zú¾ený a nepojme tak celý text,\n\ +zakryté znaky na rozhraní nejsou viditelné. +; If enabled, characters that are not fully\n\ +; visible at the left and right corner of\n\ +; an NList object will not be drawn partially. +; +MSG_VERT_CENTERED +Svisle vystøedit øádky +; Vertical centered lines +; +MSG_VERT_CENTERED_HELP +Aktivuje svislé støedìní textových øádkù v rámci\n\ +objektu NList. +; If activated, the text lines are centered\n\ +; vertically in a NList object. +; +MSG_BALANCING_COLS +Vyvá¾ení ¹íøky sloupcù +; Balancing Columns +; +MSG_BALANCING_COLS_HELP +Definuje zpùsob zobrazení sloupcù pøi zmìnì ¹íøky\n\ +na po¾adovanou. Na výbìr jsou tøi mo¾nosti: buï\n\ +se dìlicí linka vykreslí pouze v rámci textu záhlaví,\n\ +nebo v rámci celého sloupce anebo se pøi posunutí\n\ +zobrazí i obsah sloupcù. +; NList permits to change the column width\n\ +; via mouse dragging the column separator in\n\ +; the title bar. The moved bar can be visible\n\ +; either only in the title, throughout the\n\ +; whole lines or the column width changes can\n\ +; be made visible instantly. +; +MSG_COLWIDTHDRAG_TITLE +Pouze v záhlaví +; Title Bar +; +MSG_COLWIDTHDRAG_FULLBAR +Pøes celý sloupec +; Full Bar +; +MSG_COLWIDTHDRAG_VISIBLE +V¹e vèetnì obsahu sloupcù +; Visible +; +MSG_COLOR_OPTIONS +Mo¾nosti +; Options +; +MSG_FORCE_SELECT_PEN +Vynutit definovat barvy +; Force select pen +; +MSG_FORCE_SELECT_PEN_HELP +Zajistí pou¾ití barev definovaných pro kurzor\n\ +a oznaèené i neoznaèené polo¾ky. +; If enabled, NList will make sure that\n\ +; the 'Selected', 'Cursor' and 'Unselected'\n\ +; color will be forced. +; +MSG_MULTISEL_MOVEACTIVE +Klávesnicí posouvat i kurzor +; Keyboard moves cursor +; +MSG_MULTISEL_MOVEACTIVE_HELP +Zpùsobí, ¾e pøi ovládání z klávesnice se bude\n\ +posouvat i kurzor. +; If enabled, a keyboard use in an NList\n\ +; object will move the active cursor\n\ +; rather than the unselected one. +; +MSG_GROUP_MISC +Ostatní +; Miscellaneous +; +MSG_GROUP_EXAMPLE +Ukázka +; Example +; +MSG_SERMOUSE_FIX +Opravit chyby my¹i pøes sériový port +; Serial Mouse Fix +; +MSG_SERMOUSE_FIX_HELP +Opravuje chyby my¹i pøipojené pøes sériový port. +; If enabled, NList tries to fix common\n\ +; drag&drop issues that are related to using\n\ +; a serial mouse. +; +MSG_SELECT_POINTER +Pou¾ít vlastní ukazatel my¹i +; Custom Select Pointer +; +MSG_SELECT_POINTER_HELP +Pøi posunutí my¹i na oblast urèenou k zmìnì ¹íøky\n\ +sloupcù zmìní NList vzhled ukazatele my¹i. +; If enabled, and an NList object is in\n\ +; charwise selection mode a custom select\n\ +; pointer will be displayed instead of the\n\ +; default workbench mouse pointer image. +; +MSG_BAR_CONTEXTMENU +Lokální menu +; Context Menu +; +MSG_DEFAULT_CONTEXT_MENU_HELP +Definuje pøípady, za jakých okolností zobrazit\n\ +lokální menu, nebo ho umo¾ní i vypnout. +; NList permits to have its default\n\ +; context menu being disabled or enabled\n\ +; or only in case the mouse is at the top\n\ +; of the NList object. +; +MSG_SNOOP +Zachytit +; Snoop +; +MSG_SNOOP_KEY +Zapne re¾im záznamu zmáèknutých kláves. +; Start the grab of a hotkey. +; +MSG_BUTTON_INSERT +Vlo¾it +; Insert +; +MSG_BUTTON_INSERT_HELP +Umo¾ní zadat novou klávesovou zkratku. +; Allows to insert a new hotkey. +; +MSG_BUTTON_REMOVE +Odebrat +; Remove +; +MSG_BUTTON_REMOVE_HELP +Umo¾ní odstranit vybranou klávesovou zkratku. +; Allows to remove an existing hotkey. +; +MSG_BUTTON_UPDATEKEYS +Aktualizovat +; Update keys +; +MSG_BUTTON_UPDATEKEYS_HELP +Pøidá výchozí klávesové zkratky tìm funkcím, které\n\ +novì pøibyly. +; Add the default hotkeys for\n\ +; the functions which are not\n\ +; currently in the list. +; +MSG_BUTTON_DEFAULTKEYS +Výchozí stav +; Default keys +; +MSG_BUTTON_DEFAULTKEYS_HELP +Obnoví výchozí nastavení klávesových zkratek. +; Resets all hotkeys to default ones. +; +MSG_FUNC_MULTISELQUAL +Pøepínaè pro vícenásobný výbìr +; Multiselect/Block Qualifier +; +MSG_FUNC_DRAGQUAL +Pøepínaè pro 'Táhnout a pustit' +; Drag&Drop Qualifier +; +MSG_FUNC_BALANCEQUAL +Pøepínaè vyvá¾ení ¹íøky sloupcù +; Balance Qualifier +; +MSG_FUNC_COPYCLIP +Kopírování do achránky +; Copy to clipboard +; +MSG_FUNC_DEFCOLWIDTH +Výchozí ¹íøka sloupce +; Default width column +; +MSG_FUNC_DEFALLCOLWIDTH +Výchozí ¹íøka pro v¹echny sloupce +; Default width all columns +; +MSG_FUNC_DEFORDERCOL +Výchozí øazení +; Default order column +; +MSG_FUNC_DEFALLORDERCOL +Výchozí øazení pro v¹echny sloupce +; Fefault order all columns +; +MSG_FUNC_SELECTTOP +Výbìr od aktuální pozice po horní +; Select to top +; +MSG_FUNC_SELECTBOTTOM +Výbìr od aktuální pozice po dolní +; Select to bottom +; +MSG_FUNC_SELECTPAGEUP +Výbìr jedné stránky smìrem nahoru +; Select to page up +; +MSG_FUNC_SELECTPAGEDOWN +Výbìr jedné stránky smìrem dolù +; Select to page down +; +MSG_FUNC_SELECTUP +Výbìr smìrem nahoru +; Select up +; +MSG_FUNC_SELECTDOWN +Výbìr smìrem dolù +; Select down +; +MSG_FUNC_TOGGLEACTIVE +Aktivace dal¹ího +; Toggle active +; +MSG_FUNC_FASTWHEELQUAL +Pøepínaè zrychlení posouvání koleèkem +; Fast MouseWheel Qualifier +; +MSG_FUNC_HORIZWHEELQUAL +Pøepínaè posouvání koleèkem ve vodorovném smìru +; Horiz MouseWheel Qualifier +; +MSG_FUNC_TITLECLICKQUAL +Pøepínaè pro aktivaci lokálního menu +; Title Click Qualifier +; +MSG_VSB_ALWAYS +Zobrazit v¾dy +; Always +; +MSG_VSB_AUTO +Automaticky +; Auto +; +MSG_VSB_FULLAUTO +Plnì automaticky +; FullAuto +; +MSG_HSB_ALWAYS +Zobrazit v¾dy +; Always +; +MSG_HSB_AUTO +Automaticky +; Auto +; +MSG_HSB_FULLAUTO +Plnì automaticky +; FullAuto +; +MSG_HSB_NONE +Nezobrazovat +; None +; +MSG_CMENU_ALWAYS +Kdekoli v rámci objektu +; Always +; +MSG_CMENU_TOPONLY +Pouze v záhlaví sloupce +; TopOnly +; +MSG_CMENU_NEVER +Vypnout +; Never +; +MSG_HOTKEYS_KEY +Klávesa +; Key +; +MSG_HOTKEYS_ACTION +Akce +; Action +; +MSG_EXAMPLE_TEXT +Pokud zaznamenáte problémy týkající se této tøídy MUI,\n\ +jedním z mo¾ných øe¹ení je zvìt¹ení velikosti zásobníku.\n\ +Tu lze definovat v ikonì programu (spou¹títe-li program\n\ +z prostøedí Workbench) nebo v ikonì CLI (pøi spu¹tìní\n\ +z pøíkazového øádku). Doporuèená velikost je 16 KB.\n\ +\n\ +Jestli¾e problémy neustanou, zkuste je zreprodukovat pomocí\n\ +pøilo¾eného demonstraèního programu a teprve poté nahla¹te\n\ +chybu.\n\ +Aktuální verzi najdete na Aminetu v adresáøi dev/mui nebo\n\ +na stránkách http://www.sourceforge.net/projects/nlist-classes/\n\ +\n\ +\033r\033b(C) 2001-2008 NList Open Source Team\n\ +\033r\033b(C) 1996-1998 Gilles Masson\n\ +\033r\033bhttp://www.sourceforge.net/projects/nlist-classes/\n\ +\n\ +Tato tøída je koncipovaná jako náhrada tøíd list a listview\n\ +systému MUI, pøièem¾ nabízí lep¹í funkce a vìt¹í mo¾nosti\n\ +konfigurace.\n\ +\n\ +Na rozdíl od standardního chování MUI je jinak øe¹en zpùsob\n\ +práce s kurzorem pøi výbìru více polo¾ek. Navíc je pøidaná\n\ +mo¾nost 'táhnout a pustit', vodorovný i svislý posuvník lze\n\ +nechat automaticky skrýt a jiné. Zkuste...\n\ +\n\ +Kurzorové ¹ipky mù¾ete vyu¾ít k posunu obsahu seznamu\n\ +ve vodorovném smìru. Posouvat seznamem vpravo i vlevo lze\n\ +i pøi výbìru textu my¹í. Zkuste kliknout na levý nebo pravý\n\ +okraj!\n\ +\n\ +Chcete zmìnit ¹íøku sloupcù? ®ádný problém. Najeïte ¹ipkou\n\ +my¹i na dìlicí linku mezi sloupci a pøetáhnìte v ¾ádaném\n\ +smìru (a nezapomeòte na pøepínaè vyvá¾ení ¹íøky sloupcù).\n\ +\n\ +A nechcete zmìnit poøadí sloupcù? Ani to není problém.\n\ +Dosáhnete toho zpùsobem podobným tomu, který je popsaný\n\ +vý¹e.\n\ +\n\ +Tøída NList obsahuje i vlastní funkci pro kopírování textu\n\ +do schránky a standardní zpùsob výbìru textu.\n\ +\n\ +V¹e si mù¾ete vyzkou¹et v pøilo¾eném demonstraèním programu.\n\ +\n\ +\n\ +\033r\033bNapi¹te nám! Nenechávejte si pøipomínky pro sebe :-)\n\ +\n\ +**************************************************************************************************\n +; If you have problems, try to increase the stack value,\n\ +; in the icon infos if you launch the program from icon,\n\ +; stack of CLI if you start it from CLI/Shell,\n\ +; and if you launch it from some utility read its docs\n\ +; to see how to increase it.\n\ +; A stack of 12Kb, 16Kb or 20Kb is most of time a good idea.\n\ +; \n\ +; If you still have problems, try to see if they happen with the Demo prog, then tell me.\n\ +; \033C\n\ +; Latest public release can be found on aminet (dev/mui).\n\ +; All releases are available on\n\ +; http://www.sourceforge.net/projects/nlist-classes/\n\ +; \033C\n\ +; \033r\0333(C) 2001-2007 by NList Open Source Team\n\ +; \033r\0333(C) 1996-1998 by Gilles Masson\n\ +; \033r\0333http://www.sourceforge.net/projects/nlist-classes/\n\ +; \033C\n\ +; \033cThis new list/listview custom class\n\ +; \033chandles its own configurable backgrounds,\n\ +; \033cpens, fonts, scrollbars, keys and qualifiers\n\ +; \033C\n\ +; \033cThe way used to handle cursor with multiselection\n\ +; \033cis not exactly as the listview one !\n\ +; \033cDrag&Drop is supported, both scrollbars\n\ +; \033ccan be configured to disappear automatically\n\ +; \033cwhen not needed because all is visible.\n\ +; \033cJust try it...\n\ +; \033C\n\ +; \033cYou can horizontaly scroll with cursor keys,\n\ +; \033cor going on the right and left of the list\n\ +; \033cwhile selecting with the mouse.\n\ +; \033cTry just clicking on the left/right borders !\n\ +; \033C\n\ +; \033cYou can change columns widths just dragging\n\ +; \033cthe vertical separator between columns titles\n\ +; \033c(try it using the balancing qualifier too).\n\ +; \033C\n\ +; \033cYou can change columns order just dragging\n\ +; \033cthe column titles.\n\ +; \033C\n\ +; \033cThere is builtin copy to clipboard stuff\n\ +; \033cand classic char selection capability.\n\ +; \033C\n\ +; \033cTry the Demo program to test all that...\n\ +; \n\ +; \n\ +; \033r\033bGive some feedback about it ! :-)\n\ +; \033C\n\ +; **************************************************************************************************\n +; diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/locale/french.ct b/workbench/classes/zune/nlist/nlistviews_mcp/locale/french.ct new file mode 100644 index 0000000000..aa6539bcf6 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/locale/french.ct @@ -0,0 +1,726 @@ +## version $VER: Nlistviews_mcp.ct 2.94 (13.04.08) by mrodfr@gmail.com +## language français +## codeset 0 +; +; +; NListviews_mcp.cd - NList MUI custom prefs catalog description file +; $Id$ +; +;#version 2 +;#language français +; +; +MSG_FONTS +Polices +; Fonts +; +MSG_NORMAL_FONT +Police normale: +; Normal Font: +; +MSG_NORMAL_FONT_HELP +Choisissez une police normale pour Nlist. +; Choose the normal NList font. +; +MSG_NORMAL_FONT_ASL +SVP, choisissez une police normale... +; Please select the normal font... +; +MSG_SMALL_FONT +Petite police: +; Small Font: +; +MSG_SMALL_FONT_HELP +Choisissez une petite police pour Nlist. +; Choose the small NList font. +; +MSG_SMALL_FONT_ASL +SVP, choisissez une petite police... +; Please select a small font... +; +MSG_FIXED_FONT +Police fixe: +; Fixed Font: +; +MSG_FIXED_FONT_HELP +Choisissez une police fixe pour Nlist. +; Choose the fixed NList font. +; +MSG_FIXED_FONT_ASL +SVP, choisissez une police fixe... +; Please select a fixed font... +; +MSG_FONT_MARGIN +Marge +; Font Margin +; +MSG_FONT_MARGIN_HELP +Permet de choisir une marge verticale.\n\ +Celle-ci sera ajoutée à la hauteur de la\n\ +police et le résultat sera la hauteur\n\ +par défaut d'une ligne dans un objet Nlist. +; Allows to set a vertical margin\n\ +; which will be added to the font\n\ +; height and result in the default\n\ +; line height in an NList object. +; +MSG_COLORS +Couleurs +; Colors +; +MSG_TEXTCOLOR +Couleur du texte +; Text Pen +; +MSG_BACKGROUNDCOLOR +Couleur du fond +; Background +; +MSG_TITLE_PEN_WIN +Couleur du titre +; Title Pen +; +MSG_TITLE_PEN_HELP +Pour ajuster la couleur du texte\n\ +dans un titre. +; For adjusting the pen color of\n\ +; a title. +; +MSG_PBG_TITLE +\ecTitre +; \ecTitle +; +MSG_TITLE_BG_WIN +Couleur du fond +; Title Background +; +MSG_TITLE_BG_HELP +Pour ajuster la couleur du fond\n\ +dans un titre. +; For adjusting the background color\n\ +; of a title. +; +MSG_LIST_PEN_WIN +Couleur de liste +; List Pen +; +MSG_LIST_PEN_HELP +Pour ajuster la couleur du texte\n\ +dans une liste. +; For adjusting the pen color of\n\ +; a list. +; +MSG_PBG_LIST +\ecListe +; \ecList +; +MSG_LIST_BG_WIN +Couleur du fond +; List Background +; +MSG_LIST_BG_HELP +Pour ajuster la couleur du fond\n\ +dans une liste. +; For adjusting the background color\n\ +; of a list. +; +MSG_SELECT_PEN_WIN +Entrée sélectionnée +; Selected Entry +; +MSG_SELECT_PEN_HELP +Pour ajuster la couleur du texte\n\ +pour les entrées sélectionnées. +; For adjusting the pen color of\n\ +; selected entries. +; +MSG_PBG_SELECT +\ecSélectionnée +; \ecSelected +; +MSG_SELECT_BG_WIN +Entrée sélectionnée +; Selected Entry +; +MSG_SELECT_BG_HELP +Pour ajuster la couleur du fond\n\ +pour les entrées sélectionnées. +; For adjusting the background color\n\ +; of selected entries. +; +MSG_CURSOR_PEN_WIN +Curseur sélectionnée +; Selected Cursor +; +MSG_CURSOR_PEN_HELP +Pour ajuster la couleur pour\n\ +le curseur sélectionné. +; For adjusting the pen color of\n\ +; a selected cursor. +; +MSG_PBG_CURSOR +\ecCurseur +; \ecCursor +; +MSG_CURSOR_BG_WIN +Couleur de fond +; Selected Cursor +; +MSG_CURSOR_BG_HELP +Pour ajuster la couleur du fond\n\ +pour le curseur sélectionné. +; For adjusting the background color\n\ +; of a selected cursor. +; +MSG_UNSEL_PEN_WIN +Curseur non sélectionné +; Unselected Cursor +; +MSG_UNSEL_PEN_HELP +Pour ajuster la couleur du texte\n\ +pour le curseur non sélectionné. +; For adjusting the pen color of\n\ +; an unselected cursor. +; +MSG_PBG_UNSEL +\ecNon sélectionné +; \ecUnselected +; +MSG_UNSEL_BG_WIN +Couleur de fond +; Unselected Cursor +; +MSG_UNSEL_BG_HELP +Pour ajuster la couleur du fond pour\n\ +le curseur non sélectionné. +; For adjusting the background color\n\ +; of an unselected cursor. +; +MSG_INACT_PEN_WIN +Curseur inactif +; Inactive Cursor +; +MSG_INACT_PEN_HELP +Pour ajuster la couleur pour\n\ +pour le curseur inactif. +; For adjusting the pen color of\n\ +; an inactive cursor. +; +MSG_PBG_INACT +\ecInactif +; \ecInactive +; +MSG_INACT_BG_WIN +Curseur du fond +; Inactive Cursor +; +MSG_INACT_BG_HELP +Pour ajuster la couleur du fond pour\n\ +pour le curseur inactif. +; For adjusting the background color\n\ +; of an inactive cursor. +; +MSG_MULTISELECT +Sélection multiple +; MultiSelection +; +MSG_MULTISELECT_QUAL +Avec touches +; via Qualifier +; +MSG_MULTISELECT_ALWAYS +Toujours +; Always +; +MSG_MULTISELECT_HELP +Permet de spécifier le mode de\n\ +sélection multiple par défaut. +; Allows to specify the default\n\ +; multiselection mode. +; +MSG_MMB_MULTISEL +Sélection multiple avec MMB +; MMB multiselection +; +MSG_MMB_MULTISEL_HELP +Permet de choisir le bouton du milieu\n\ +(MMB) comme mode de sélection multiple. +; Set it if you want to use the middle\n\ +; mouse button (MMB) as a multiselection\n\ +; qualifier. +; +MSG_DRAGDROP +Glisser & Déposer +; Drag&Drop +; +MSG_DRAGTYPE_IMMEDIATE +Immédiat +; Immediate +; +MSG_DRAGTYPE_BORDERS +Avec bordures +; at Borders +; +MSG_DRAGTYPE_QUALIFIER +Avec touches +; via Qualifier +; +MSG_DRAGTYPE_HELP +Défini le fonctionnement du Glisser & Déposer.\n\ +'Immédiat' démarre le Glisser & Déposer avec la\n\ +saisie d'un objet.\n\ +'Avec bordures' démarre le Glisser & Déposer\n\ +lors du passage sur les bordures\n\ +'Avec touches' démarre le Glisser & Déposer\n\ +avec des touches (Voir 'Touches').\n\ +\n\ +'Immédiat' est utilisé seulement lorsqu'il n'y\n\ +à pas de mode sélection multiple actif. +; Set the drag mode. 'Immediate' will start\n\ +; drag&drop as soon as you drag an object.\n\ +; 'at Borders' for showing a drag operation\n\ +; as soon as you passed the left/right borders\n\ +; and 'via Qualifier' for only allowing to\n\ +; drag&drop via a qualifier key (see 'Keys').\n\ +; \n\ +; 'Immediate' is used only when in no-multiselect\n\ +; mode. +; +MSG_DRAG_LINES +Lignes visibles +; Visible lines +; +MSG_DRAG_LINES_HELP +Règle le nombre maxi. de lignes\n\ +qui seront montrées pendant un\n\ +Glisser & Déposer. Si plus de lignes\n\ +sont sélectionnées, vous verrez un\n\ +message: Glisse & Dépose xx lignes...'. +; Give the max. number of lines\n\ +; which will be shown when\n\ +; doing drag&drop. If more lines\n\ +; are selected, you'll get a message\n\ +; similar to: 'Dragging xx Items...'. +; +MSG_PAGE_FONTS +Polices +; Fonts +; +MSG_PAGE_COLORS +Couleurs +; Colors +; +MSG_PAGE_OPTIONS +Options +; Options +; +MSG_PAGE_SCROLLING +Défilement +; Scrolling +; +MSG_PAGE_KEYBINDINGS +Touches +; Keybindings +; +MSG_SB_HORIZONTAL +Déplacement horizontal +; Horizontal Scrollbar +; +MSG_SB_HORIZONTAL_HELP +Règle le mode par défaut pour\n\ +un déplacement horizontal.\n\ +(Peut être remplacé par\n\ +l'application en elle-même). +; Set the default mode\n\ +; for the horizontal scrollbar.\n\ +; (may be overwritten by an\n\ +; application) +; +MSG_SB_VERTICAL +Déplacement vertical +; Vertical Scrollbar +; +MSG_SB_VERTICAL_HELP +Règle le mode par défaut pour\n\ +un déplacement vertical.\n\ +(Peut être remplacé par\n\ +l'application en elle-même). +; Set the default mode\n\ +; for the vertical scrollbar.\n\ +; (may be overwritten by an\n\ +; application) +; +MSG_SCROLLCONTROL +Réglages des déplacements +; Scolling Control +; +MSG_SMOOTH_SCROLLING +Déplacement fluide +; Smooth Scrolling +; +MSG_SMOOTH_SCROLLING_HELP +Si sélectionné, un déplacement fluide\n\ +sera utilisé pour les objets Nlist.\n\ +De plus, en utilisant le gadget 'fluidité'\n\ +dans le menu MUI 'Listes -> Contrôle'\n\ +dans les configurations de MUI, la vitesse\n\ +du déplacement fluide sera contrôlable. +; If enabled, smoothing scrolling\n\ +; will be used for NList objects.\n\ +; In addition, by using the 'smooth'\n\ +; slider in the normal MUI 'Listview'\n\ +; configuration page the speed of\n\ +; the smooth scrolling can be controled. +; +MSG_MMB_FASTWHEEL +MMB molette rapide +; MMB Fast Wheel +; +MSG_MMB_FASTWHEEL_HELP +Si sélectionné, le bouton du milieu\n\ +pourra être utilisé comme action de\n\ +déplacement rapide avec une molette.\n\ +(Voir la page 'Touches' pour les autres\n\ +réglages possible avec la molette). +; If enabled, the middle mouse button\n\ +; can be used as a qualifier to perform\n\ +; a fast scroll wheel action.\n\ +; (See 'Keybindings' page as well for\n\ +; more wheel qualifiers) +; +MSG_WHEEL_STEP +Pas (dépl. molette normal) +; Mouse Wheel Step +; +MSG_WHEEL_STEP_HELP +Permet de spécifier le nombre de lignes à\n\ +déplacer en une fois pour une utilisation\n\ +normale avec la molette de la souris. +; Allows to specify the amount of lines\n\ +; that should be scrolled when using a\n\ +; wheel mouse. +; +MSG_WHEEL_FAST +Pas (dépl. molette rapide) +; Mouse Wheel Fast Step +; +MSG_WHEEL_FAST_HELP +Permet de spécifier le nombre de lignes à\n\ +déplacer en une fois pour une utilisation\n\ +rapide avec la molette de la souris. +; Allows to specify the amount of lines\n\ +; that should be scrolled when using a\n\ +; wheel mouse and when the fast wheel\n\ +; qualifier is pressed. +; +MSG_LAYOUT +Mise en page +; Layout +; +MSG_PARTIAL_COL_MARK +Marquage partiel colonne +; Partial column mark +; +MSG_PARTIAL_COL_MARK_HELP +Si sélectionné, un signe spécial sera utilisé\n\ +du coté droit de la colonne lorsque le texte\n\ +ne pourra pas être complètement utilisé. +; If enabled, a special mark will be drawn\n\ +; at the right side of a column in case the\n\ +; text didn't completly fit into it. +; +MSG_PARTIAL_CHARS_DRAWN +Caractères partiel dessiné +; Partial chars drawn +; +MSG_PARTIAL_CHARS_DRAWN_HELP +Si sélectionné, les caractères non visible\n\ +complètement à droite ou à gauche d'un objet\n\ +Nlist ne seront pas dessinés partiellement. +; If enabled, characters that are not fully\n\ +; visible at the left and right corner of\n\ +; an NList object will not be drawn partially. +; +MSG_VERT_CENTERED +Lignes verticales centrés +; Vertical centered lines +; +MSG_VERT_CENTERED_HELP +Si sélectionné, les lignes de texte seront\n\ +centrés verticalement dans les objets Nlist. +; If activated, the text lines are centered\n\ +; vertically in a NList object. +; +MSG_BALANCING_COLS +Déplacement colonnes +; Balancing Columns +; +MSG_BALANCING_COLS_HELP +Nlist permet de changer la largeur des colonnes par\n\ +déplacement du séparateur de colonne, dans la barre\n\ +de titre, avec la souris.\n\ +Ce déplacement peut être visible seulement dans le\n\ +titre, ou alors à travers toutes les lignes ou le\n\ +changement de largeur de la colonne peut aussi\n\ +simplement être visible constamment. +; NList permits to change the column width\n\ +; via mouse dragging the column separator in\n\ +; the title bar. The moved bar can be visible\n\ +; either only in the title, throughout the\n\ +; whole lines or the column width changes can\n\ +; be made visible instantly. +; +MSG_COLWIDTHDRAG_TITLE +Barre de titre +; Title Bar +; +MSG_COLWIDTHDRAG_FULLBAR +Barre complète +; Full Bar +; +MSG_COLWIDTHDRAG_VISIBLE +Visible +; Visible +; +MSG_COLOR_OPTIONS +Options +; Options +; +MSG_FORCE_SELECT_PEN +Forcer couleur sélectionnée +; Force select pen +; +MSG_FORCE_SELECT_PEN_HELP +Si sélectionné, Nlist vérifiera bien que la\n\ +couleur dans 'Sélectionné', 'Curseur' et\n\ +(Non sélectionné' sera bien forcé. +; If enabled, NList will make sure that\n\ +; the 'Selected', 'Cursor' and 'Unselected'\n\ +; color will be forced. +; +MSG_MULTISEL_MOVEACTIVE +Clavier déplace le curseur +; Keyboard moves cursor +; +MSG_MULTISEL_MOVEACTIVE_HELP +Si sélectionné, un déplacement au clavier\n\ +dans un objet Nlist déplacera le curseur\n\ +actif plutôt que le curseur non sélectionné. +; If enabled, a keyboard use in an NList\n\ +; object will move the active cursor\n\ +; rather than the unselected one. +; +MSG_GROUP_MISC +Divers +; Miscellaneous +; +MSG_GROUP_EXAMPLE +Exemple +; Example +; +MSG_SERMOUSE_FIX +Fix souris (port série) +; Serial Mouse Fix +; +MSG_SERMOUSE_FIX_HELP +Si sélectionné, Nlist tentera de fixer\n\ +les problèmes connus de Glisser&Déposer\n\ +en relation avec l'utilisation d'une\n\ +souris sur le port série. +; If enabled, NList tries to fix common\n\ +; drag&drop issues that are related to using\n\ +; a serial mouse. +; +MSG_SELECT_POINTER +Pointeur de sélection perso. +; Custom Select Pointer +; +MSG_SELECT_POINTER_HELP +Si sélectionné et si un objet Nlist est\n\ +en mode de sélection, un pointeur de\n\ +sélection personnalisé sera utilisé\n\ +plutôt que le pointeur par défaut du\n\ +workbench. +; If enabled, and an NList object is in\n\ +; charwise selection mode a custom select\n\ +; pointer will be displayed instead of the\n\ +; default workbench mouse pointer image. +; +MSG_BAR_CONTEXTMENU +Contexte Menu +; Context Menu +; +MSG_DEFAULT_CONTEXT_MENU_HELP +Nlist utilisera son contexte menu par défaut en\n\ +mode actif ou non actif ou juste dans le cas\n\ +ou la souris sera positionné sur un objet Nlist. +; NList permits to have its default\n\ +; context menu being disabled or enabled\n\ +; or only in case the mouse is at the top\n\ +; of the NList object. +; +MSG_SNOOP +Analyse +; Snoop +; +MSG_SNOOP_KEY +Démarre la capture d'un raccourci clavier +; Start the grab of a hotkey. +; +MSG_BUTTON_INSERT +Insérer +; Insert +; +MSG_BUTTON_INSERT_HELP +Permet d'insérer un nouveau raccourci clavier +; Allows to insert a new hotkey. +; +MSG_BUTTON_REMOVE +Supprimer +; Remove +; +MSG_BUTTON_REMOVE_HELP +Permet de supprimer un raccourci clavier existant +; Allows to remove an existing hotkey. +; +MSG_BUTTON_UPDATEKEYS +Mise à jour +; Update keys +; +MSG_BUTTON_UPDATEKEYS_HELP +Ajoute les raccourcis par défaut\n\ +pour les fonctions qui ne sont pas\n\ +actuellement dans la liste. +; Add the default hotkeys for\n\ +; the functions which are not\n\ +; currently in the list. +; +MSG_BUTTON_DEFAULTKEYS +Touches par défaut +; Default keys +; +MSG_BUTTON_DEFAULTKEYS_HELP +Remplace tous les raccourcis\n\ +par ceux par défaut. +; Resets all hotkeys to default ones. +; +MSG_FUNC_MULTISELQUAL +Sélection multiple/Block +; Multiselect/Block Qualifier +; +MSG_FUNC_DRAGQUAL +Glisser & Déposer +; Drag&Drop Qualifier +; +MSG_FUNC_BALANCEQUAL +Déplacement +; Balance Qualifier +; +MSG_FUNC_COPYCLIP +Copier dans presse-papiers +; Copy to clipboard +; +MSG_FUNC_DEFCOLWIDTH +Largeur de la colonne par défaut +; Default width column +; +MSG_FUNC_DEFALLCOLWIDTH +Largeur des colonnes par défaut +; Default width all columns +; +MSG_FUNC_DEFORDERCOL +Ordre de la colonne par défaut +; Default order column +; +MSG_FUNC_DEFALLORDERCOL +Ordre des colonnes par défaut +; Fefault order all columns +; +MSG_FUNC_SELECTTOP +Haut maxi +; Select to top +; +MSG_FUNC_SELECTBOTTOM +Bas maxi +; Select to bottom +; +MSG_FUNC_SELECTPAGEUP +1 page haut +; Select to page up +; +MSG_FUNC_SELECTPAGEDOWN +1 page bas +; Select to page down +; +MSG_FUNC_SELECTUP +Haut +; Select up +; +MSG_FUNC_SELECTDOWN +Bas +; Select down +; +MSG_FUNC_TOGGLEACTIVE +Actif on/off +; Toggle active +; +MSG_FUNC_FASTWHEELQUAL +Touche molette rapide +; Fast MouseWheel Qualifier +; +MSG_FUNC_HORIZWHEELQUAL +Touche molette horizontale +; Horiz MouseWheel Qualifier +; +MSG_FUNC_TITLECLICKQUAL +Touche title Click +; Title Click Qualifier +; +MSG_VSB_ALWAYS +Toujours +; Always +; +MSG_VSB_AUTO +Automatique +; Auto +; +MSG_VSB_FULLAUTO +Auto. complet +; FullAuto +; +MSG_HSB_ALWAYS +Toujours +; Always +; +MSG_HSB_AUTO +Automatique +; Auto +; +MSG_HSB_FULLAUTO +Auto. complet +; FullAuto +; +MSG_HSB_NONE +Non +; None +; +MSG_CMENU_ALWAYS +Toujours +; Always +; +MSG_CMENU_TOPONLY +Haut seul +; TopOnly +; +MSG_CMENU_NEVER +Jamais +; Never +; +MSG_HOTKEYS_KEY +Touche +; Key +; +MSG_HOTKEYS_ACTION +Action +; Action +; diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/locale/german.ct b/workbench/classes/zune/nlist/nlistviews_mcp/locale/german.ct new file mode 100755 index 0000000000..2a1bd02d51 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/locale/german.ct @@ -0,0 +1,781 @@ +## chunk AUTH Thore Böckelmann +## version $VER: NListviews_mcp.catalog 2.1 (17.09.2009) +## language deutsch +## codeset 0 +; +; $Id$ +; +MSG_FONTS +Schriftarten +; Fonts +; +MSG_NORMAL_FONT +Normal: +; Normal Font: +; +MSG_NORMAL_FONT_HELP +Wählen Sie die normale Schriftart für NList-Objekte +; Choose the normal NList font. +; +MSG_NORMAL_FONT_ASL +Bitte wählen Sie die normale Schriftart... +; Please select the normal font... +; +MSG_SMALL_FONT +Klein: +; Small Font: +; +MSG_SMALL_FONT_HELP +Wählen Sie die kleine Schriftart für NList-Objekte +; Choose the small NList font. +; +MSG_SMALL_FONT_ASL +Bitte wählen Sie die kleine Schriftart... +; Please select a small font... +; +MSG_FIXED_FONT +Fest: +; Fixed Font: +; +MSG_FIXED_FONT_HELP +Währen Sie die Schriftart mit fester Breite für NList-Objekte +; Choose the fixed NList font. +; +MSG_FIXED_FONT_ASL +Bitte wählen Sie die Schriftart mit fester Breite... +; Please select a fixed font... +; +MSG_FONT_MARGIN +Rand: +; Font Margin +; +MSG_FONT_MARGIN_HELP +Erlaubt das Setzen eines vertikalen Rands,\n\ +der zur Schrifthöhe hinzuaddiert wird und\n\ +den Standardhöhe eines Eintrags in einem\n\ +NList-Objekt ergibt. +; Allows to set a vertical margin\n\ +; which will be added to the font\n\ +; height and result in the default\n\ +; line height in an NList object. +; +MSG_COLORS +Farben +; Colors +; +MSG_TEXTCOLOR +Text +; Text Pen +; +MSG_BACKGROUNDCOLOR +Hintergrund +; Background +; +MSG_TITLE_PEN_WIN +Titel +; Title Pen +; +MSG_TITLE_PEN_HELP +Ändert die Schriftfarbe der Titelzeile. +; For adjusting the pen color of\n\ +; a title. +; +MSG_PBG_TITLE +\ecTitel +; \ecTitle +; +MSG_TITLE_BG_WIN +Titelhintergrund +; Title Background +; +MSG_TITLE_BG_HELP +Ändert die Hintergrundfarbe der Titelzeile. +; For adjusting the background color\n\ +; of a title. +; +MSG_LIST_PEN_WIN +Liste +; List Pen +; +MSG_LIST_PEN_HELP +Ändert die Schriftfarbe der Liste. +; For adjusting the pen color of\n\ +; a list. +; +MSG_PBG_LIST +\ecListe +; \ecList +; +MSG_LIST_BG_WIN +Listenhintergrund +; List Background +; +MSG_LIST_BG_HELP +Ändert die Hintergrundfarbe der Liste. +; For adjusting the background color\n\ +; of a list. +; +MSG_SELECT_PEN_WIN +Ausgewählter Eintrag +; Selected Entry +; +MSG_SELECT_PEN_HELP +Ändert die Schriftfarbe eines ausgewählten Eintrags. +; For adjusting the pen color of\n\ +; selected entries. +; +MSG_PBG_SELECT +\ecausgewählt +; \ecSelected +; +MSG_SELECT_BG_WIN +Hintergrund des ausgewählten Eintrags +; Selected Entry +; +MSG_SELECT_BG_HELP +Ändert die Hintergrundfarbe des ausgewählten Eintrags. +; For adjusting the background color\n\ +; of selected entries. +; +MSG_CURSOR_PEN_WIN +Cursor +; Selected Cursor +; +MSG_CURSOR_PEN_HELP +Ändert die Schriftfarbe des Cursors. +; For adjusting the pen color of\n\ +; a selected cursor. +; +MSG_PBG_CURSOR +\ecCursor +; \ecCursor +; +MSG_CURSOR_BG_WIN +Hintergrund des ausgewählten Cursors +; Selected Cursor +; +MSG_CURSOR_BG_HELP +Ändert die Hintergrundfarbe des ausgewählten Cursors. +; For adjusting the background color\n\ +; of a selected cursor. +; +MSG_UNSEL_PEN_WIN +nicht ausgewählter Cursor +; Unselected Cursor +; +MSG_UNSEL_PEN_HELP +Ändert die Schriftfarbe des nicht ausgewählten Cursors. +; For adjusting the pen color of\n\ +; an unselected cursor. +; +MSG_PBG_UNSEL +\ecnicht ausgewählt +; \ecUnselected +; +MSG_UNSEL_BG_WIN +nicht ausgewählter Cursor +; Unselected Cursor +; +MSG_UNSEL_BG_HELP +Ändert die Hintergrundfarbe des nicht ausgewählten Cursors. +; For adjusting the background color\n\ +; of an unselected cursor. +; +MSG_INACT_PEN_WIN +Inaktiver Cursor +; Inactive Cursor +; +MSG_INACT_PEN_HELP +Ändert die Schriftfarbe des inaktiven Cursors. +; For adjusting the pen color of\n\ +; an inactive cursor. +; +MSG_PBG_INACT +\ecinaktiv +; \ecInactive +; +MSG_INACT_BG_WIN +Inaktiver Cursor +; Inactive Cursor +; +MSG_INACT_BG_HELP +Ändert die Hintergrundfarbe des inaktiven Cursors. +; For adjusting the background color\n\ +; of an inactive cursor. +; +MSG_MULTISELECT +Mehrfachauswahl +; MultiSelection +; +MSG_MULTISELECT_QUAL +mittels Tastenkombination +; via Qualifier +; +MSG_MULTISELECT_ALWAYS +immer +; Always +; +MSG_MULTISELECT_HELP +Legt das Standardverhalten für Mehrfachauswahl fest. +; Allows to specify the default\n\ +; multiselection mode. +; +MSG_MMB_MULTISEL +MMB Mehrfachauswahl +; MMB multiselection +; +MSG_MMB_MULTISEL_HELP +Falls aktiv wird die mittlere Maustaste als\n\ +Tastenkombination für die Mehrfachauswahl\n\ +genutzt. +; Set it if you want to use the middle\n\ +; mouse button (MMB) as a multiselection\n\ +; qualifier. +; +MSG_DRAGDROP +Drag&Drop +; Drag&Drop +; +MSG_DRAGTYPE_IMMEDIATE +sofort +; Immediate +; +MSG_DRAGTYPE_BORDERS +am Rand +; at Borders +; +MSG_DRAGTYPE_QUALIFIER +mittels Tastenkombination +; via Qualifier +; +MSG_DRAGTYPE_HELP +Legt den Drag&Drop-Modus fest.\n\ +; Set the drag mode. 'Immediate' will start\n\ +; drag&drop as soon as you drag an object.\n\ +; 'at Borders' for showing a drag operation\n\ +; as soon as you passed the left/right borders\n\ +; and 'via Qualifier' for only allowing to\n\ +; drag&drop via a qualifier key (see 'Keys').\n\ +; \n\ +; 'Immediate' is used only when in no-multiselect\n\ +; mode. +; +MSG_DRAG_LINES +sichtbare Zeilen +; Visible lines +; +MSG_DRAG_LINES_HELP +Legt die maximal sichtbaren Zeilen während\n\ +einer Drag&Drop-Aktion fest. Falls mehr Zeilen\n\ +ausgewählt sind wird statt dessen der Text\n\ +'Dragging <x> items...' angezeigt. +; Give the max. number of lines\n\ +; which will be shown when\n\ +; doing drag&drop. If more lines\n\ +; are selected, you'll get a message\n\ +; similar to: 'Dragging xx Items...'. +; +MSG_PAGE_FONTS +Schriftarten +; Fonts +; +MSG_PAGE_COLORS +Farben +; Colors +; +MSG_PAGE_OPTIONS +Optionen +; Options +; +MSG_PAGE_SCROLLING +Rollen +; Scrolling +; +MSG_PAGE_KEYBINDINGS +Tasten +; Keybindings +; +MSG_SB_HORIZONTAL +Horizontaler Rollbalken +; Horizontal Scrollbar +; +MSG_SB_HORIZONTAL_HELP +Legt des Standardmodus für den horizontalen\n\ +Rollbalken fest (kann von der Applikation\n\ +ignoriert werden). +; Set the default mode\n\ +; for the horizontal scrollbar.\n\ +; (may be overwritten by an\n\ +; application) +; +MSG_SB_VERTICAL +Vertikaler Rollbalken +; Vertical Scrollbar +; +MSG_SB_VERTICAL_HELP +Legt des Standardmodus für den vertikalen\n\ +Rollbalken fest (kann von der Applikation\n\ +ignoriert werden). +; Set the default mode\n\ +; for the vertical scrollbar.\n\ +; (may be overwritten by an\n\ +; application) +; +MSG_SCROLLCONTROL +Kontrolle +; Scolling Control +; +MSG_SMOOTH_SCROLLING +sanftes Rollen +; Smooth Scrolling +; +MSG_SMOOTH_SCROLLING_HELP +Falls aktiv werden die Listen sanft\n\ +gerollt. +; If enabled, smoothing scrolling\n\ +; will be used for NList objects.\n\ +; In addition, by using the 'smooth'\n\ +; slider in the normal MUI 'Listview'\n\ +; configuration page the speed of\n\ +; the smooth scrolling can be controled. +; +MSG_MMB_FASTWHEEL +schnelles Mausrad +; MMB Fast Wheel +; +MSG_MMB_FASTWHEEL_HELP +Falls aktiv kann die mittlere Maustaste\n\ +genutzt werden um das Rollen zu beschleunigen. +; If enabled, the middle mouse button\n\ +; can be used as a qualifier to perform\n\ +; a fast scroll wheel action.\n\ +; (See 'Keybindings' page as well for\n\ +; more wheel qualifiers) +; +MSG_WHEEL_STEP +Mausrad-Schritte +; Mouse Wheel Step +; +MSG_WHEEL_STEP_HELP +Gibt an um wie viele Zeilen bei Betätigung\n\ +des Mausrades gerollt wird. +; Allows to specify the amount of lines\n\ +; that should be scrolled when using a\n\ +; wheel mouse. +; +MSG_WHEEL_FAST +schnelle Mausrad-Schritte +; Mouse Wheel Fast Step +; +MSG_WHEEL_FAST_HELP +Gibt an um wie viele Zeilen bei Betätigung\n\ +des Mausrades und der Tastenkombination für\n\ +das schnelle Mausrad gerollt wird. +; Allows to specify the amount of lines\n\ +; that should be scrolled when using a\n\ +; wheel mouse and when the fast wheel\n\ +; qualifier is pressed. +; +MSG_LAYOUT +Layout +; Layout +; +MSG_PARTIAL_COL_MARK +Partielle Spalten markieren +; Partial column mark +; +MSG_PARTIAL_COL_MARK_HELP +Falls aktiv wird eine Markierung auf der rechten\n\ +Seite einer Spalte dargestellt, falls der Text nicht\n\ +komplett dargestellt werden kann. +; If enabled, a special mark will be drawn\n\ +; at the right side of a column in case the\n\ +; text didn't completly fit into it. +; +MSG_PARTIAL_CHARS_DRAWN +Partielle Zeichen darstellen +; Partial chars drawn +; +MSG_PARTIAL_CHARS_DRAWN_HELP +Falls aktiv werden Zeichen, die nicht komplett\n\ +dargestellt werden können zumindest noch teilweise\n\ +dargestellt. +; If enabled, characters that are not fully\n\ +; visible at the left and right corner of\n\ +; an NList object will not be drawn partially. +; +MSG_VERT_CENTERED +vertikal zentrierte Zeilen +; Vertical centered lines +; +MSG_VERT_CENTERED_HELP +Falls aktiv werden die Textzeilen vertikal zentriert. +; If activated, the text lines are centered\n\ +; vertically in a NList object. +; +MSG_BALANCING_COLS +Balancing Spalten +; Balancing Columns +; +MSG_BALANCING_COLS_HELP +NList erlaubt das Ändern der Spaltenbreite mit\n\ +der Maus durch Bewegen der Spaltenmarkierung in\n\ +der Titelzeile. Während des Bewegens kann die\n\ +Markierung entweder nur in der Titelzeile ange-\n\ +zeigt werden, in allen Zeilen, oder die Änderungen\n\ +werden sofort dargestellt. +; NList permits to change the column width\n\ +; via mouse dragging the column separator in\n\ +; the title bar. The moved bar can be visible\n\ +; either only in the title, throughout the\n\ +; whole lines or the column width changes can\n\ +; be made visible instantly. +; +MSG_COLWIDTHDRAG_TITLE +Titelzeile +; Title Bar +; +MSG_COLWIDTHDRAG_FULLBAR +alle Zeilen +; Full Bar +; +MSG_COLWIDTHDRAG_VISIBLE +sichtbar +; Visible +; +MSG_COLOR_OPTIONS +Optionen +; Options +; +MSG_FORCE_SELECT_PEN +Force select pen +; Force select pen +; +MSG_FORCE_SELECT_PEN_HELP +If enabled, NList will make sure that\n\ +the 'Selected', 'Cursor' and 'Unselected'\n\ +color will be forced. +; If enabled, NList will make sure that\n\ +; the 'Selected', 'Cursor' and 'Unselected'\n\ +; color will be forced. +; +MSG_MULTISEL_MOVEACTIVE +Tastatur bewegt Cursor +; Keyboard moves cursor +; +MSG_MULTISEL_MOVEACTIVE_HELP +Fall aktiv wird über die Tastatur der aktive\n\ +Cursor anstatt dem inaktiven bewegt. +; If enabled, a keyboard use in an NList\n\ +; object will move the active cursor\n\ +; rather than the unselected one. +; +MSG_GROUP_MISC +Verschiedenens +; Miscellaneous +; +MSG_GROUP_EXAMPLE +Beispiel +; Example +; +MSG_SERMOUSE_FIX +Fix für serielle Maus +; Serial Mouse Fix +; +MSG_SERMOUSE_FIX_HELP +Fall aktiv versucht NList bekannte Probleme\n\ +im Zusammenspiel mit seriellen Mäusen zu umgehen. +; If enabled, NList tries to fix common\n\ +; drag&drop issues that are related to using\n\ +; a serial mouse. +; +MSG_SELECT_POINTER +Auswahl-Mauszeiger +; Custom Select Pointer +; +MSG_SELECT_POINTER_HELP +Falls aktiv und das NList-Objekt zeichenweises\n\ +Markieren ermöglicht wird der Mauszeiger in einen\n\ +Auswahlzeiger anstatt dem normalen Bild geändert. +; If enabled, and an NList object is in\n\ +; charwise selection mode a custom select\n\ +; pointer will be displayed instead of the\n\ +; default workbench mouse pointer image. +; +MSG_BAR_CONTEXTMENU +Kontextmenü +; Context Menu +; +MSG_DEFAULT_CONTEXT_MENU_HELP +Falls aktiv haben NList-Objekte ein Standard-\n\ +kontextmenü. Ansonsten ist dieses Menü nur bei\n\ +einem Klick in der Titelzeile verfügbar. +; NList permits to have its default\n\ +; context menu being disabled or enabled\n\ +; or only in case the mouse is at the top\n\ +; of the NList object. +; +MSG_SNOOP +Lauschen +; Snoop +; +MSG_SNOOP_KEY +Startet das Lauschen einer Tastenkombination +; Start the grab of a hotkey. +; +MSG_BUTTON_INSERT +Einfügen +; Insert +; +MSG_BUTTON_INSERT_HELP +Fügt eine neue Tastenkombination ein +; Allows to insert a new hotkey. +; +MSG_BUTTON_REMOVE +Entfernen +; Remove +; +MSG_BUTTON_REMOVE_HELP +Entfernt eine Tastenkombination +; Allows to remove an existing hotkey. +; +MSG_BUTTON_UPDATEKEYS +Ergänzen +; Update keys +; +MSG_BUTTON_UPDATEKEYS_HELP +Fügt alle Standardtastenkombinationen hinzu,\n\ +für die noch keine eigenen Kombination fest-\n\ +gelegt wurde. +; Add the default hotkeys for\n\ +; the functions which are not\n\ +; currently in the list. +; +MSG_BUTTON_DEFAULTKEYS +Standardtasten +; Default keys +; +MSG_BUTTON_DEFAULTKEYS_HELP +Stellt alle Tastenkombinationen auf Standard zurück. +; Resets all hotkeys to default ones. +; +MSG_FUNC_MULTISELQUAL +Mehrfachauswahl/Block +; Multiselect/Block Qualifier +; +MSG_FUNC_DRAGQUAL +Drag&Drop +; Drag&Drop Qualifier +; +MSG_FUNC_BALANCEQUAL +Balance +; Balance Qualifier +; +MSG_FUNC_COPYCLIP +Kopieren ins Clipboard +; Copy to clipboard +; +MSG_FUNC_DEFCOLWIDTH +Standard Spaltenbreite +; Default width column +; +MSG_FUNC_DEFALLCOLWIDTH +Standard Spaltenbreite (alle) +; Default width all columns +; +MSG_FUNC_DEFORDERCOL +Standard Spaltenreihenfolge +; Default order column +; +MSG_FUNC_DEFALLORDERCOL +Standard Spaltenreihenfolge (alle) +; Fefault order all columns +; +MSG_FUNC_SELECTTOP +bis zum Anfang auswählen +; Select to top +; +MSG_FUNC_SELECTBOTTOM +bis zum Ende auswählen +; Select to bottom +; +MSG_FUNC_SELECTPAGEUP +Seite aufwärts auswählen +; Select to page up +; +MSG_FUNC_SELECTPAGEDOWN +Seite abwärts auswählen +; Select to page down +; +MSG_FUNC_SELECTUP +aufwärts auswählen +; Select up +; +MSG_FUNC_SELECTDOWN +abwärts auswählen +; Select down +; +MSG_FUNC_TOGGLEACTIVE +Auswahl umschalten +; Toggle active +; +MSG_FUNC_FASTWHEELQUAL +schnelles Mausrad +; Fast MouseWheel Qualifier +; +MSG_FUNC_HORIZWHEELQUAL +horizontales Mausrad +; Horiz MouseWheel Qualifier +; +MSG_FUNC_TITLECLICKQUAL +Titelklick +; Title Click Qualifier +; +MSG_VSB_ALWAYS +immer +; Always +; +MSG_VSB_AUTO +automatisch +; Auto +; +MSG_VSB_FULLAUTO +vollautomatisch +; FullAuto +; +MSG_HSB_ALWAYS +immer +; Always +; +MSG_HSB_AUTO +automatisch +; Auto +; +MSG_HSB_FULLAUTO +vollautomatisch +; FullAuto +; +MSG_HSB_NONE +keine +; None +; +MSG_CMENU_ALWAYS +immer +; Always +; +MSG_CMENU_TOPONLY +nur Titelzeile +; TopOnly +; +MSG_CMENU_NEVER +nie +; Never +; +MSG_HOTKEYS_KEY +Tastenkombination +; Key +; +MSG_HOTKEYS_ACTION +Aktion +; Action +; +MSG_EXAMPLE_TEXT +If you have problems, try to increase the stack value,\n\ +in the icon infos if you launch the program from icon,\n\ +stack of CLI if you start it from CLI/Shell,\n\ +and if you launch it from some utility read its docs\n\ +to see how to increase it.\n\ +A stack of 12Kb, 16Kb or 20Kb is most of time a good idea.\n\ +\n\ +If you still have problems, try to see if they happen with the Demo prog, then tell me.\n\ +\033C\n\ +Latest public release can be found on aminet (dev/mui).\n\ +All releases are available on\n\ +http://www.sourceforge.net/projects/nlist-classes/\n\ +\033C\n\ +\033r\0333(C) 2001-2007 by NList Open Source Team\n\ +\033r\0333(C) 1996-1998 by Gilles Masson\n\ +\033r\0333http://www.sourceforge.net/projects/nlist-classes/\n\ +\033C\n\ +\033cThis new list/listview custom class\n\ +\033chandles its own configurable backgrounds,\n\ +\033cpens, fonts, scrollbars, keys and qualifiers\n\ +\033C\n\ +\033cThe way used to handle cursor with multiselection\n\ +\033cis not exactly as the listview one !\n\ +\033cDrag&Drop is supported, both scrollbars\n\ +\033ccan be configured to disappear automatically\n\ +\033cwhen not needed because all is visible.\n\ +\033cJust try it...\n\ +\033C\n\ +\033cYou can horizontaly scroll with cursor keys,\n\ +\033cor going on the right and left of the list\n\ +\033cwhile selecting with the mouse.\n\ +\033cTry just clicking on the left/right borders !\n\ +\033C\n\ +\033cYou can change columns widths just dragging\n\ +\033cthe vertical separator between columns titles\n\ +\033c(try it using the balancing qualifier too).\n\ +\033C\n\ +\033cYou can change columns order just dragging\n\ +\033cthe column titles.\n\ +\033C\n\ +\033cThere is builtin copy to clipboard stuff\n\ +\033cand classic char selection capability.\n\ +\033C\n\ +\033cTry the Demo program to test all that...\n\ +\n\ +\n\ +\033r\033bGive some feedback about it ! :-)\n\ +\033C\n\ +**************************************************************************************************\n +; If you have problems, try to increase the stack value,\n\ +; in the icon infos if you launch the program from icon,\n\ +; stack of CLI if you start it from CLI/Shell,\n\ +; and if you launch it from some utility read its docs\n\ +; to see how to increase it.\n\ +; A stack of 12Kb, 16Kb or 20Kb is most of time a good idea.\n\ +; \n\ +; If you still have problems, try to see if they happen with the Demo prog, then tell me.\n\ +; \033C\n\ +; Latest public release can be found on aminet (dev/mui).\n\ +; All releases are available on\n\ +; http://www.sourceforge.net/projects/nlist-classes/\n\ +; \033C\n\ +; \033r\0333(C) 2001-2007 by NList Open Source Team\n\ +; \033r\0333(C) 1996-1998 by Gilles Masson\n\ +; \033r\0333http://www.sourceforge.net/projects/nlist-classes/\n\ +; \033C\n\ +; \033cThis new list/listview custom class\n\ +; \033chandles its own configurable backgrounds,\n\ +; \033cpens, fonts, scrollbars, keys and qualifiers\n\ +; \033C\n\ +; \033cThe way used to handle cursor with multiselection\n\ +; \033cis not exactly as the listview one !\n\ +; \033cDrag&Drop is supported, both scrollbars\n\ +; \033ccan be configured to disappear automatically\n\ +; \033cwhen not needed because all is visible.\n\ +; \033cJust try it...\n\ +; \033C\n\ +; \033cYou can horizontaly scroll with cursor keys,\n\ +; \033cor going on the right and left of the list\n\ +; \033cwhile selecting with the mouse.\n\ +; \033cTry just clicking on the left/right borders !\n\ +; \033C\n\ +; \033cYou can change columns widths just dragging\n\ +; \033cthe vertical separator between columns titles\n\ +; \033c(try it using the balancing qualifier too).\n\ +; \033C\n\ +; \033cYou can change columns order just dragging\n\ +; \033cthe column titles.\n\ +; \033C\n\ +; \033cThere is builtin copy to clipboard stuff\n\ +; \033cand classic char selection capability.\n\ +; \033C\n\ +; \033cTry the Demo program to test all that...\n\ +; \n\ +; \n\ +; \033r\033bGive some feedback about it ! :-)\n\ +; \033C\n\ +; **************************************************************************************************\n +; diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/locale/polish.ct b/workbench/classes/zune/nlist/nlistviews_mcp/locale/polish.ct new file mode 100644 index 0000000000..de5fb1377d --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/locale/polish.ct @@ -0,0 +1,828 @@ +## version $VER: nlistviews_mcp.catalog 2.0 (20.05.2010) +## language polski +## codeset 5 +## chunk AUTH Mariusz Danilewicz <mandi@interia.pl> +; +; NListviews_mcp.ct - NList MUI custom prefs catalog Polish translation file +; $Id$ +; +; +MSG_FONTS +Czcionki +; Fonts +; +MSG_NORMAL_FONT +Normalna: +; Normal Font: +; +MSG_NORMAL_FONT_HELP +Wybiera normaln± czcionkê dla elementów NList. +; Choose the normal NList font. +; +MSG_NORMAL_FONT_ASL +Proszê wybraæ normaln± czcionkê... +; Please select the normal font... +; +MSG_SMALL_FONT +Ma³a: +; Small Font: +; +MSG_SMALL_FONT_HELP +Wybiera ma³± czcionkê dla elementów NList. +; Choose the small NList font. +; +MSG_SMALL_FONT_ASL +Proszê wybraæ ma³± czcionkê... +; Please select a small font... +; +MSG_FIXED_FONT +Nieproporcjonalna: +; Fixed Font: +; +MSG_FIXED_FONT_HELP +Wybiera nieproporcjonaln± czcionkê dla elementów NList. +; Choose the fixed NList font. +; +MSG_FIXED_FONT_ASL +Proszê wybraæ nieproporcjonaln± czcionkê... +; Please select a fixed font... +; +MSG_FONT_MARGIN +Odstêpy: +; Font Margin: +; +MSG_FONT_MARGIN_HELP +Pozwala okre¶liæ pionowe odstêpy,\n\ +które zostan± dodane do wysoko¶ci\n\ +czcionki i w wyniku dadz± wysoko¶æ\n\ +linii tekstu obiektó NList. +; Allows to set a vertical margin\n\ +; which will be added to the font\n\ +; height and result in the default\n\ +; line height in an NList object. +; +MSG_COLORS +Kolory +; Colors +; +MSG_TEXTCOLOR +Pisak tekstu +; Text Pen +; +MSG_BACKGROUNDCOLOR +T³o +; Background +; +MSG_TITLE_PEN_WIN +Pisak tytu³ów +; Title Pen +; +MSG_TITLE_PEN_HELP +Ustawia kolor pisaka\n\ +tytu³ów. +; For adjusting the pen color of\n\ +; a title. +; +MSG_PBG_TITLE +\ecTytu³ +; \ecTitle +; +MSG_TITLE_BG_WIN +T³o tytu³u +; Title Background +; +MSG_TITLE_BG_HELP +Ustawia kolor t³a\n\ +tytu³ów. +; For adjusting the background color\n\ +; of a title. +; +MSG_LIST_PEN_WIN +Pisak listy +; List Pen +; +MSG_LIST_PEN_HELP +Ustawia kolor pisaka\n\ +listy. +; For adjusting the pen color of\n\ +; a list. +; +MSG_PBG_LIST +\ecLista +; \ecList +; +MSG_LIST_BG_WIN +T³o listy +; List Background +; +MSG_LIST_BG_HELP +Ustawia kolor t³a\n\ +listy. +; For adjusting the background color\n\ +; of a list. +; +MSG_SELECT_PEN_WIN +Zaznaczony element +; Selected Entry +; +MSG_SELECT_PEN_HELP +Ustawia kolor pisaka\n\ +zaznaczonych elementów. +; For adjusting the pen color of\n\ +; selected entries. +; +MSG_PBG_SELECT +\ecZaznaczony +; \ecSelected +; +MSG_SELECT_BG_WIN +Zaznaczony element +; Selected Entry +; +MSG_SELECT_BG_HELP +Ustawia kolor t³a\n\ +zaznaczonych elementów. +; For adjusting the background color\n\ +; of selected entries. +; +MSG_CURSOR_PEN_WIN +Zaznaczony kursor +; Selected Cursor +; +MSG_CURSOR_PEN_HELP +Ustawia kolor pisaka\n\ +zaznaczonego kursora. +; For adjusting the pen color of\n\ +; a selected cursor. +; +MSG_PBG_CURSOR +\ecKursor +; \ecCursor +; +MSG_CURSOR_BG_WIN +Zaznaczony kursor +; Selected Cursor +; +MSG_CURSOR_BG_HELP +Ustawia kolor t³a\n\ +zaznaczonego kursora. +; For adjusting the background color\n\ +; of a selected cursor. +; +MSG_UNSEL_PEN_WIN +Odznaczony kursor +; Unselected Cursor +; +MSG_UNSEL_PEN_HELP +Ustawia kolor pisaka\n\ +odznaczonego kursora. +; For adjusting the pen color of\n\ +; an unselected cursor. +; +MSG_PBG_UNSEL +\ecOdznaczony +; \ecUnselected +; +MSG_UNSEL_BG_WIN +Odznaczony kursor +; Unselected Cursor +; +MSG_UNSEL_BG_HELP +Ustawia kolor t³a\n\ +odznaczonego kursora. +; For adjusting the background color\n\ +; of an unselected cursor. +; +MSG_INACT_PEN_WIN +Nieaktywny kursor +; Inactive Cursor +; +MSG_INACT_PEN_HELP +Ustawia kolor pisaka\n\ +nieaktywnego kursora. +; For adjusting the pen color of\n\ +; an inactive cursor. +; +MSG_PBG_INACT +\ecNieaktywny +; \ecInactive +; +MSG_INACT_BG_WIN +Nieaktywny kursor +; Inactive Cursor +; +MSG_INACT_BG_HELP +Ustawia kolor t³a\n\ +nieaktywnego kursora. +; For adjusting the background color\n\ +; of an inactive cursor. +; +MSG_MULTISELECT +Wybór wielu elementów +; MultiSelection +; +MSG_MULTISELECT_QUAL +z klawiszem wywo³uj±cym +; via Qualifier +; +MSG_MULTISELECT_ALWAYS +zawsze +; Always +; +MSG_MULTISELECT_HELP +Pozwala na okre¶lenie domy¶lnego\n\ +trybu zaznaczania wielu elementów. +; Allows to specify the default\n\ +; multiselection mode. +; +MSG_MMB_MULTISEL +Zaznaczanie ¦PM +; MMB multiselection +; +MSG_MMB_MULTISEL_HELP +W³±cz tê opcjê je¶li chcesz u¿ywaæ\n\ +¶rodkowego przycisku myszki (¦PM) jako\n\ +klawisz wywo³uj±cy zaznaczania wielu\n\ +elementów. +; Set it if you want to use the middle\n\ +; mouse button (MMB) as a multiselection\n\ +; qualifier. +; +MSG_DRAGDROP +Przeci±gnij i upu¶æ +; Drag&Drop +; +MSG_DRAGTYPE_IMMEDIATE +natychmiast +; Immediate +; +MSG_DRAGTYPE_BORDERS +przy krawêdziach +; at Borders +; +MSG_DRAGTYPE_QUALIFIER +z klawiszem wywo³uj±cym +; via Qualifier +; +MSG_DRAGTYPE_HELP +Ustawia tryb przeci±gania. "\Natychmiast\"\n\ +powoduje rozpocz±ecie przeci±gania w momencie\n\ +poci±gniêcia obiektu. \"Przy krawêdziach\"\n\ +pokazuje operacjê przeci±gania w chwili\n\ +przekroczenia lewej/prawej krawêdzi,\n\ +a \"z klawiszem wywo³uj±cym\" pozwala\n\ +na przeci±ganie jedynie po u¿yciu klawisza\n\ +wywo³uj±cego (zobacz zak³adkê \"klawisze\").\n\ +\n\ +\"Natychmiast\" jest u¿ywane tylko w trybie\n\ +pojedynczego zaznaczenia. +; Set the drag mode. 'Immediate' will start\n\ +; drag&drop as soon as you drag an object.\n\ +; 'at Borders' for showing a drag operation\n\ +; as soon as you passed the left/right borders\n\ +; and 'via Qualifier' for only allowing to\n\ +; drag&drop via a qualifier key (see 'Keys').\n\ +; \n\ +; 'Immediate' is used only when in no-multiselect\n\ +; mode. +; +MSG_DRAG_LINES +Widoczne linie +; Visible lines +; +MSG_DRAG_LINES_HELP +Okre¶l maksymaln± liczbê linii,\n\ +które bêd± wy¶wietlane podczas\n\ +operacji przeci±gania. Je¶li zostanie\n\ +zaznaczona wiêksza liczba linii\n\ +ujrzysz komunikat podobny do:\n\ +\"Przeci±ganie xx elementów...\". +; Give the max. number of lines\n\ +; which will be shown when\n\ +; doing drag&drop. If more lines\n\ +; are selected, you'll get a message\n\ +; similar to: 'Dragging xx Items...'. +; +MSG_PAGE_FONTS +Czcionki +; Fonts +; +MSG_PAGE_COLORS +Kolory +; Colors +; +MSG_PAGE_OPTIONS +Opcje +; Options +; +MSG_PAGE_SCROLLING +Przewijanie +; Scrolling +; +MSG_PAGE_KEYBINDINGS +Przypisanie klawiszy +; Keybindings +; +MSG_SB_HORIZONTAL +Suwak poziomy +; Horizontal Scrollbar +; +MSG_SB_HORIZONTAL_HELP +Ustawia domy¶ly tryb pracy\n\ +suwaka poziomego.\n\ +(ustawienie to mo¿e byæ\n\ +zmienione przez aplikacje) +; Set the default mode\n\ +; for the horizontal scrollbar.\n\ +; (may be overwritten by an\n\ +; application) +; +MSG_SB_VERTICAL +Suwak pionowy +; Vertical Scrollbar +; +MSG_SB_VERTICAL_HELP +Ustawia domy¶ly tryb pracy\n\ +suwaka pionowego.\n\ +(ustawienie to mo¿e byæ\n\ +zmienione przez aplikacje) +; Set the default mode\n\ +; for the vertical scrollbar.\n\ +; (may be overwritten by an\n\ +; application) +; +MSG_SCROLLCONTROL +Kontrola przewijania +; Scolling Control +; +MSG_SMOOTH_SCROLLING +P³ynne przewijanie +; Smooth Scrolling +; +MSG_SMOOTH_SCROLLING_HELP +Je¶li ta opcja jest w³±czona, u¿ywane\n\ +bêdzie p³ynne przewijanie obiektów klasy NList.\n\ +Dodatkowo, u¿ywaj±c suwaka \"p³ynno¶æ\"\n\ +na stronie ustawieñ \"Listy wy¶wietlania\" MUI\n\ +mo¿na kontrolowaæ szybko¶æ p³ynnego przewijania. +; If enabled, smoothing scrolling\n\ +; will be used for NList objects.\n\ +; In addition, by using the 'smooth'\n\ +; slider in the normal MUI 'Listview'\n\ +; configuration page the speed of\n\ +; the smooth scrolling can be controled. +; +MSG_MMB_FASTWHEEL +Szybkie przewijanie z ¦PM +; MMB Fast Wheel +; +MSG_MMB_FASTWHEEL_HELP +Je¶li ta opcja jest w³±czona, ¶rodkowy\n\ +przycisk myszki mo¿e byæ u¿ywany jako\n\ +klawisz wywo³uj±cy szybkie przewijanie\n\ +zawarto¶ci kó³kiem myszki.\n\ +(Zobacz zak³adkê \"Przypisanie klawiszy\"\n\ +by zobaczyæ pozosta³e klawisze wywo³uj±ce) +; If enabled, the middle mouse button\n\ +; can be used as a qualifier to perform\n\ +; a fast scroll wheel action.\n\ +; (See 'Keybindings' page as well for\n\ +; more wheel qualifiers) +; +MSG_WHEEL_STEP +Krok przewijania kó³kiem +; Mouse Wheel Step +; +MSG_WHEEL_STEP_HELP +Pozwala na okre¶lenie liczby linii\n\ +przewijanych przy u¿yciu przewijania\n\ +kó³kiem myszki. +; Allows to specify the amount of lines\n\ +; that should be scrolled when using a\n\ +; wheel mouse. +; +MSG_WHEEL_FAST +Szybki krok przewijania kó³kiem +; Mouse Wheel Fast Step +; +MSG_WHEEL_FAST_HELP +Pozwala na okre¶lenie liczby linii\n\ +przewijanych przy u¿yciu przewijania\n\ +kó³kiem myszki z wci¶niêtym klawiszem\n\ +wywo³uj±cym szybkiego przewijania. +; Allows to specify the amount of lines\n\ +; that should be scrolled when using a\n\ +; wheel mouse and when the fast wheel\n\ +; qualifier is pressed. +; +MSG_LAYOUT +Uk³ad +; Layout +; +MSG_PARTIAL_COL_MARK +Znacznik czê¶ciowych kolumn +; Partial column mark +; +MSG_PARTIAL_COL_MARK_HELP +Je¶li ta opcja jest w³±czona, zpecjalny znacznik\n\ +bêdzie rysowany po prawej stronie kolumny w przypadku,\n\ +gdy tekst nie zmie¶ci siê w calo¶ci w kolumnie. +; If enabled, a special mark will be drawn\n\ +; at the right side of a column in case the\n\ +; text didn't completly fit into it. +; +MSG_PARTIAL_CHARS_DRAWN +Wy¶wietlaj czê¶ciowo znaki +; Partial chars drawn +; +MSG_PARTIAL_CHARS_DRAWN_HELP +Je¶li ta opcja jest w³±czona, znaki, które\n\ +nie s± w pe³ni widoczne przy lewej i prawej\n\ +krawêdzi obiektu NList, bêd± wy¶wietlane\n\ +czê¶ciowo. +; If enabled, characters that are not fully\n\ +; visible at the left and right corner of\n\ +; an NList object will not be drawn partially. +; +MSG_VERT_CENTERED +Linie wycentrowane w pionie +; Vertical centered lines +; +MSG_VERT_CENTERED_HELP +Je¶li ta opcja jest w³±czona, linie tekstowe\n\ +bêd± centrowane w pionie w obiektach klasy NList. +; If activated, the text lines are centered\n\ +; vertically in a NList object. +; +MSG_BALANCING_COLS +Balans kolumn +; Balancing Columns +; +MSG_BALANCING_COLS_HELP +Klasa NList pozwala na zmianê szeroko¶ci kolumn\n\ +przez przeci±ganie myszk± separatora kolum\n\ +na belce tytu³owej. Przeci±gana belka mo¿e byæ\n\ +widoczna w belce tytu³owej, jako linia widoczna\n\ +na ca³ej wysoko¶ci kolumny, lub te¿ zmiany mog±\n\ +byæ widoczne od razu. +; NList permits to change the column width\n\ +; via mouse dragging the column separator in\n\ +; the title bar. The moved bar can be visible\n\ +; either only in the title, throughout the\n\ +; whole lines or the column width changes can\n\ +; be made visible instantly. +; +MSG_COLWIDTHDRAG_TITLE +belka tytu³owa +; Title Bar +; +MSG_COLWIDTHDRAG_FULLBAR +kolumna +; Full Bar +; +MSG_COLWIDTHDRAG_VISIBLE +widoczny +; Visible +; +MSG_COLOR_OPTIONS +Opcje +; Options +; +MSG_FORCE_SELECT_PEN +Wymu¶ wybrane pisaki +; Force select pen +; +MSG_FORCE_SELECT_PEN_HELP +Je¶li ta opcja jest w³±czona, klasa NList\n\ +wymusi u¿ywania kolorów wybranych dla elementów:\n\ +\"zaznaczone\", \"kursor\" i \"odznaczone\". +; If enabled, NList will make sure that\n\ +; the 'Selected', 'Cursor' and 'Unselected'\n\ +; color will be forced. +; +MSG_MULTISEL_MOVEACTIVE +Klawisze przesuwaj± kursor +; Keyboard moves cursor +; +MSG_MULTISEL_MOVEACTIVE_HELP +Je¶li ta opcja jest w³±czona, klawisze u¿ywane\n\ +w obiekcie klasy NList bêd± przesuwa³y aktywny\n\ +kursor zamiast odznaczonego. +; If enabled, a keyboard use in an NList\n\ +; object will move the active cursor\n\ +; rather than the unselected one. +; +MSG_GROUP_MISC +Ró¿ne +; Miscellaneous +; +MSG_GROUP_EXAMPLE +Przyk³ad +; Example +; +MSG_SERMOUSE_FIX +Poprawka na myszkê szeregow± +; Serial Mouse Fix +; +MSG_SERMOUSE_FIX_HELP +Je¶li ta opcja jest w³±czona, klasa NList\n\ +spróbuje obej¶æ najczêstsze problemy wystêpuj±ce\n\ +podczas przeci±gania elementów zwi±zane z u¿ywaniem\n\ +myszki szeregowej. +; If enabled, NList tries to fix common\n\ +; drag&drop issues that are related to using\n\ +; a serial mouse. +; +MSG_SELECT_POINTER +W³asny kursor zaznaczania +; Custom Select Pointer +; +MSG_SELECT_POINTER_HELP +Je¶li ta opcja jest w³±czona i obiekt klasy NList\n\ +jest w trybie zaznaczania znaków, bêdzie u¿ywany\n\ +w³asny kursor zaznaczania zamiast domy¶lnego,\n\ +systemowego wska¼nika myszki. +; If enabled, and an NList object is in\n\ +; charwise selection mode a custom select\n\ +; pointer will be displayed instead of the\n\ +; default workbench mouse pointer image. +; +MSG_BAR_CONTEXTMENU +Menu kontekstowe +; Context Menu +; +MSG_DEFAULT_CONTEXT_MENU_HELP +Klasa NList pozwala na w³±czenie lub wy³±czenie\n\ +jej domy¶lnego menu podrêcznego, lub w³±czenie\n\ +go tylko w przypadku, gdy wska¼nik myszki znajduje\n\ +siê na górze obiektu NList. +; NList permits to have its default\n\ +; context menu being disabled or enabled\n\ +; or only in case the mouse is at the top\n\ +; of the NList object. +; +MSG_SNOOP +Przechwyæ +; Snoop +; +MSG_SNOOP_KEY +Rozpoczyna przechwytywanie klawisza wywo³uj±cego. +; Start the grab of a hotkey. +; +MSG_BUTTON_INSERT +Wstaw +; Insert +; +MSG_BUTTON_INSERT_HELP +Pozwala na dodanie nowego klawisza wywo³uj±cego. +; Allows to insert a new hotkey. +; +MSG_BUTTON_REMOVE +Usuñ +; Remove +; +MSG_BUTTON_REMOVE_HELP +Pozwala na usuniêcie istniej±cego klawisza wywo³uj±cego. +; Allows to remove an existing hotkey. +; +MSG_BUTTON_UPDATEKEYS +Aktualizuj klawisze +; Update keys +; +MSG_BUTTON_UPDATEKEYS_HELP +Dodaje domy¶lne klawisze wywo³uj±ce\n\ +do funkcji, które obecnie nie znajduj±\n\ +siê na li¶cie. +; Add the default hotkeys for\n\ +; the functions which are not\n\ +; currently in the list. +; +MSG_BUTTON_DEFAULTKEYS +Klawisze domy¶lne +; Default keys +; +MSG_BUTTON_DEFAULTKEYS_HELP +Przywraca ustawienia wszystich klawiszy wywo³uj±cych do warto¶ci domy¶lnych. +; Resets all hotkeys to default ones. +; +MSG_FUNC_MULTISELQUAL +Klawisz wywo³uj±cy zaznaczanie wielu/bloku +; Multiselect/Block Qualifier +; +MSG_FUNC_DRAGQUAL +Klawisz wywo³uj±cy przeci±ganie +; Drag&Drop Qualifier +; +MSG_FUNC_BALANCEQUAL +Klawisz wywo³uj±cy balans obiektów +; Balance Qualifier +; +MSG_FUNC_COPYCLIP +Skopiuj do schowka +; Copy to clipboard +; +MSG_FUNC_DEFCOLWIDTH +Domy¶lna szeroko¶æ kolumny +; Default width column +; +MSG_FUNC_DEFALLCOLWIDTH +Domy¶lna szeroko¶æ wszystkich kolumn +; Default width all columns +; +MSG_FUNC_DEFORDERCOL +Domy¶lna kolejno¶æ kolumny +; Default order column +; +MSG_FUNC_DEFALLORDERCOL +Domy¶lna kolejno¶æ wszystkich kolumn +; Default order all columns +; +MSG_FUNC_SELECTTOP +Zaznacz do pocz±tku +; Select to top +; +MSG_FUNC_SELECTBOTTOM +Zaznacz do koñca +; Select to bottom +; +MSG_FUNC_SELECTPAGEUP +Zaznacz stronê w górê +; Select to page up +; +MSG_FUNC_SELECTPAGEDOWN +Zaznacz stronê w dó³ +; Select to page down +; +MSG_FUNC_SELECTUP +Zaznacz w górê +; Select up +; +MSG_FUNC_SELECTDOWN +Zaznacz w dó³ +; Select down +; +MSG_FUNC_TOGGLEACTIVE +Prze³±cz aktywny element +; Toggle active +; +MSG_FUNC_FASTWHEELQUAL +Klawisz wywo³uj±cy szybkie przewijanie kó³kiem +; Fast MouseWheel Qualifier +; +MSG_FUNC_HORIZWHEELQUAL +Klawisz wywo³uj±cy przewijanie kó³kiem w poziomie +; Horiz MouseWheel Qualifier +; +MSG_FUNC_TITLECLICKQUAL +Klawisz wywo³uj±cy wci¶niêcie tytu³u +; Title Click Qualifier +; +MSG_VSB_ALWAYS +zawsze +; Always +; +MSG_VSB_AUTO +automatycznie +; Auto +; +MSG_VSB_FULLAUTO +w pe³ni automatycznie +; FullAuto +; +MSG_HSB_ALWAYS +zawsze +; Always +; +MSG_HSB_AUTO +autmatycznie +; Auto +; +MSG_HSB_FULLAUTO +w pe³ni automatycznie +; FullAuto +; +MSG_HSB_NONE +brak +; None +; +MSG_CMENU_ALWAYS +zawsze +; Always +; +MSG_CMENU_TOPONLY +tylko górne +; TopOnly +; +MSG_CMENU_NEVER +nigdy +; Never +; +MSG_HOTKEYS_KEY +Klawisz +; Key +; +MSG_HOTKEYS_ACTION +Dzia³anie +; Action +; +MSG_EXAMPLE_TEXT +Je¶li masz jakie¶ problemy z dzia³aniem klasy, spróbuj\n\ +zwiêkszyæ wielko¶æ stosu w ikonce programu (w przypadku\n\ +uruchamiania programu z ikonki) lub wielko¶æ stosu w linii\n\ +poleceñ (w przypadku uruchamiania programu z CLI/shella),\n\ +je¶li za¶ uruchamiasz obiekty klasy NList z poziomu innego\n\ +programu, przeczytaj jego dokumentacjê by dowiedzieæ siê jak\n\ +zwiêkszyæ dla niegowielko¶æ stosu.\n\ +Stos o wielko¶ci 12kb, 16kb lub 20kb w wiêkszo¶ci przypadków\n\ +jest wystarczaj±cy.\n\ +\n\ +Je¶li nadal masz jakie¶ problemy, spróbuj sprawdziæ, czy wystêpuj± one z programami demonstracyjnymi, je¶li tak, zg³o¶ je do mnie.\n\ +\033C\n\ +Najnowsz± publicznie dostêpn± wersjê mo¿na znale¼æ na Aminecie (dev/mui).\n\ +Wszystkie udostêpnione wersje dostêpne s± pod adresem:\n\ +http://www.sourceforge.net/projects/nlist-classes/\n\ +\033C\n\ +\033r\0333(C) 2001-2010 by NList Open Source Team\n\ +\033r\0333(C) 1996-1998 by Gilles Masson\n\ +\033r\0333http://www.sourceforge.net/projects/nlist-classes/\n\ +\033C\n\ +\033cTa nowa klasa w³asna MUI list/list wy¶wietlania\n\ +\033cobs³uguje w³asne konfigurowalne t³a, pisaki,\n\ +\033cczcionki, suwaki, klawisze i klawisze wywo³uj±ce\n\ +\033C\n\ +\033cSposób obs³ugi kursora w trybie zaznaczania wielu\n\ +\033celementów nie jest dok³adnie taki sam jak w li¶cie wy¶wietlania!\n\ +\033cObs³ugiwane jest przeci±ganie i upuszczanie elementów, oba suwaki\n\ +\033cmog± zostaæ skonfigurowane do automatycznego znikania\n\ +\033cgdy nie s± potrzebne, gdy¿ ca³y wy¶wietlany tekst jest widoczy.\n\ +\033cPo prostu wypróbuj nowe funkcje...\n\ +\033C\n\ +\033cMo¿esz przewijaæ tekst w poziomie przy u¿yciu klawiszy kursora,\n\ +\033club przesuwaj±c myszkê w lewo i prawo w trakcie zaznaczania myszk±.\n\ +\033cSpróbuj po prostu klikn±æ na lewej/prawej krawêdzi!\n\ +\033C\n\ +\033cMo¿esz zmieniaæ szeroko¶æ kolumn po prostu przeci±gaj±c\n\ +\033cpionowy separator pomiêdzy tytu³ami kolum\n\ +\033c(spróbuj te¿ u¿yæ klawiszy wywo³uj±cych balans obiektów).\n\ +\033C\n\ +\033cMo¿esz zmieniaæ kolejno¶æ kolumn przeci±gaj±c nazwy kolumn.\n\ +\033C\n\ +\033cWbudowana jest tak¿e obs³uga kopiowania tekstu do schowka\n\ +\033coraz mo¿liwo¶æ klasycznego zaznaczania znaków.\n\ +\033C\n\ +\033cWypróbuj programy demonstracyjne, by poznaæ wszystkie mo¿liwo¶ci...\n\ +\n\ +\n\ +\033r\033bDaj nam znaæ je¶li co¶ jest nie tak! :-)\n\ +\033C\n\ +**************************************************************************************************\n +; If you have problems, try to increase the stack value,\n\ +; in the icon infos if you launch the program from icon,\n\ +; stack of CLI if you start it from CLI/Shell,\n\ +; and if you launch it from some utility read its docs\n\ +; to see how to increase it.\n\ +; A stack of 12Kb, 16Kb or 20Kb is most of time a good idea.\n\ +; \n\ +; If you still have problems, try to see if they happen with the Demo prog, then tell me.\n\ +; \033C\n\ +; Latest public release can be found on aminet (dev/mui).\n\ +; All releases are available on\n\ +; http://www.sourceforge.net/projects/nlist-classes/\n\ +; \033C\n\ +; \033r\0333(C) 2001-2010 by NList Open Source Team\n\ +; \033r\0333(C) 1996-1998 by Gilles Masson\n\ +; \033r\0333http://www.sourceforge.net/projects/nlist-classes/\n\ +; \033C\n\ +; \033cThis new list/listview custom class\n\ +; \033chandles its own configurable backgrounds,\n\ +; \033cpens, fonts, scrollbars, keys and qualifiers\n\ +; \033C\n\ +; \033cThe way used to handle cursor with multiselection\n\ +; \033cis not exactly as the listview one !\n\ +; \033cDrag&Drop is supported, both scrollbars\n\ +; \033ccan be configured to disappear automatically\n\ +; \033cwhen not needed because all is visible.\n\ +; \033cJust try it...\n\ +; \033C\n\ +; \033cYou can horizontaly scroll with cursor keys,\n\ +; \033cor going on the right and left of the list\n\ +; \033cwhile selecting with the mouse.\n\ +; \033cTry just clicking on the left/right borders !\n\ +; \033C\n\ +; \033cYou can change columns widths just dragging\n\ +; \033cthe vertical separator between columns titles\n\ +; \033c(try it using the balancing qualifier too).\n\ +; \033C\n\ +; \033cYou can change columns order just dragging\n\ +; \033cthe column titles.\n\ +; \033C\n\ +; \033cThere is builtin copy to clipboard stuff\n\ +; \033cand classic char selection capability.\n\ +; \033C\n\ +; \033cTry the Demo program to test all that...\n\ +; \n\ +; \n\ +; \033r\033bGive some feedback about it ! :-)\n\ +; \033C\n\ +; **************************************************************************************************\n +; diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/locale/swedish.ct b/workbench/classes/zune/nlist/nlistviews_mcp/locale/swedish.ct new file mode 100644 index 0000000000..4f94149490 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/locale/swedish.ct @@ -0,0 +1,704 @@ +## version $VER: NListviews_mcp.ct 2.1 (18.09.2010) +## language svenska +## codeset 0 +; +## chunk AUTH Pär Boberg +; +; NListviews_mcp.ct - NList MUI custom prefs catalog translation file +; $Id$ +; +;#version 2 +;#language english +; +; +MSG_FONTS +Typsnitt +; Fonts +; +MSG_NORMAL_FONT +Normalt typsnitt: +; Normal Font: +; +MSG_NORMAL_FONT_HELP +Välj normalt NList typsnitt. +; Choose the normal NList font. +; +MSG_NORMAL_FONT_ASL +Var god välj normalt typsnitt... +; Please select the normal font... +; +MSG_SMALL_FONT +Litet typsnitt: +; Small Font: +; +MSG_SMALL_FONT_HELP +Välj litet NList typsnitt. +; Choose the small NList font. +; +MSG_SMALL_FONT_ASL +Var god välj litet typsnitt... +; Please select a small font... +; +MSG_FIXED_FONT +Fast typsnitt: +; Fixed Font: +; +MSG_FIXED_FONT_HELP +Välj fast NList typsnitt. +; Choose the fixed NList font. +; +MSG_FIXED_FONT_ASL +Var god välj ett fast typsnitt... +; Please select a fixed font... +; +MSG_FONT_MARGIN +Typsnittsmarginal: +; Font Margin: +; +MSG_FONT_MARGIN_HELP +Tillåter att sätta en vertikal marginal\nsom läggs till på typsnitts\nhöjden och resulterar i den förvalda\nlinjehöjden i ett NList objekt. +; Allows to set a vertical margin\n\ +; which will be added to the font\n\ +; height and result in the default\n\ +; line height in an NList object. +; +MSG_COLORS +Färger +; Colors +; +MSG_TEXTCOLOR +Text penna +; Text Pen +; +MSG_BACKGROUNDCOLOR +Bakgrund +; Background +; +MSG_TITLE_PEN_WIN +Titel penna +; Title Pen +; +MSG_TITLE_PEN_HELP +För justering av pennfärgen för\nen titel. +; For adjusting the pen color of\n\ +; a title. +; +MSG_PBG_TITLE +\ecTitel +; \ecTitle +; +MSG_TITLE_BG_WIN +Titelbakgrund +; Title Background +; +MSG_TITLE_BG_HELP +För justering av bakgrundsfärgen\nför en titel. +; For adjusting the background color\n\ +; of a title. +; +MSG_LIST_PEN_WIN +List penna +; List Pen +; +MSG_LIST_PEN_HELP +För justering av pennfärgen\nför en lista. +; For adjusting the pen color of\n\ +; a list. +; +MSG_PBG_LIST +\ecLista +; \ecList +; +MSG_LIST_BG_WIN +Listbakgrund +; List Background +; +MSG_LIST_BG_HELP +För justering av bakgrundsfärgen\nför en lista. +; For adjusting the background color\n\ +; of a list. +; +MSG_SELECT_PEN_WIN +Vald post +; Selected Entry +; +MSG_SELECT_PEN_HELP +För justering av pennfärgen\nför valda poster. +; For adjusting the pen color of\n\ +; selected entries. +; +MSG_PBG_SELECT +\ecVald +; \ecSelected +; +MSG_SELECT_BG_WIN +Vald post +; Selected Entry +; +MSG_SELECT_BG_HELP +För justering av bakgrundsfärgen\nför valda poster. +; For adjusting the background color\n\ +; of selected entries. +; +MSG_CURSOR_PEN_WIN +Vald markör +; Selected Cursor +; +MSG_CURSOR_PEN_HELP +För justering av pennfärgen\nför vald markör. +; For adjusting the pen color of\n\ +; a selected cursor. +; +MSG_PBG_CURSOR +\ecMarkör +; \ecCursor +; +MSG_CURSOR_BG_WIN +Vald markör +; Selected Cursor +; +MSG_CURSOR_BG_HELP +För justering av bakgrundsfärgen\nför vald markör. +; For adjusting the background color\n\ +; of a selected cursor. +; +MSG_UNSEL_PEN_WIN +Ovald markör +; Unselected Cursor +; +MSG_UNSEL_PEN_HELP +För justering av pennfärgen\nför en ovald markör. +; For adjusting the pen color of\n\ +; an unselected cursor. +; +MSG_PBG_UNSEL +\ecOvald +; \ecUnselected +; +MSG_UNSEL_BG_WIN +Ovald markör +; Unselected Cursor +; +MSG_UNSEL_BG_HELP +För justering av bakgrundsfärgen\nför en ovald markör. +; For adjusting the background color\n\ +; of an unselected cursor. +; +MSG_INACT_PEN_WIN +Inaktiv markör +; Inactive Cursor +; +MSG_INACT_PEN_HELP +För justering av pennfärgen\nför en inaktiv markör. +; For adjusting the pen color of\n\ +; an inactive cursor. +; +MSG_PBG_INACT +\ecInaktiv +; \ecInactive +; +MSG_INACT_BG_WIN +Inaktiv markör +; Inactive Cursor +; +MSG_INACT_BG_HELP +För justering av bakgrundsfärgen\nför en inaktiv markör. +; For adjusting the background color\n\ +; of an inactive cursor. +; +MSG_MULTISELECT +Flerval +; MultiSelection +; +MSG_MULTISELECT_QUAL +via kvalificering +; via Qualifier +; +MSG_MULTISELECT_ALWAYS +Alltid +; Always +; +MSG_MULTISELECT_HELP +Tillåter att specifiera förvalt\nflervalsläge. +; Allows to specify the default\n\ +; multiselection mode. +; +MSG_MMB_MULTISEL +MMK flerval +; MMB multiselection +; +MSG_MMB_MULTISEL_HELP +Välj om du vill använda mittenmusknappen\n(MMK) som flervalskvalificerare. +; Set it if you want to use the middle\n\ +; mouse button (MMB) as a multiselection\n\ +; qualifier. +; +MSG_DRAGDROP +Dra&släpp +; Drag&Drop +; +MSG_DRAGTYPE_IMMEDIATE +Omeddelbar +; Immediate +; +MSG_DRAGTYPE_BORDERS +vid kanter +; at Borders +; +MSG_DRAGTYPE_QUALIFIER +via kvalificerare +; via Qualifier +; +MSG_DRAGTYPE_HELP +Välj dragläge. 'Omeddelbar' startar\ndra&släpp så fort du drar ett objekt.\n'vid kanter' för att visa en dra-operation\nså snart du passerat vänster/höger kanter\noch 'via kvalificerare' för att endast tillåta\ndra&släpp via en kvalificeringstangent\n(se 'Tangenter').\n\n'Omeddelbar' används endast i icke-flervalsläge. +; Set the drag mode. 'Immediate' will start\n\ +; drag&drop as soon as you drag an object.\n\ +; 'at Borders' for showing a drag operation\n\ +; as soon as you passed the left/right borders\n\ +; and 'via Qualifier' for only allowing to\n\ +; drag&drop via a qualifier key (see 'Keys').\n\ +; \n\ +; 'Immediate' is used only when in no-multiselect\n\ +; mode. +; +MSG_DRAG_LINES +Synliga linjer +; Visible lines +; +MSG_DRAG_LINES_HELP +Ange max antal linjer som\nkommer att visas vid dra&släpp.\nOm fler linjer är valda, kommer\ndu att se ett meddelande\nliknande: 'Drar xx objekt...'. +; Give the max. number of lines\n\ +; which will be shown when\n\ +; doing drag&drop. If more lines\n\ +; are selected, you'll get a message\n\ +; similar to: 'Dragging xx Items...'. +; +MSG_PAGE_FONTS +Typsnitt +; Fonts +; +MSG_PAGE_COLORS +Färger +; Colors +; +MSG_PAGE_OPTIONS +Alternativ +; Options +; +MSG_PAGE_SCROLLING +Skrollning +; Scrolling +; +MSG_PAGE_KEYBINDINGS +Tangentbindningar +; Keybindings +; +MSG_SB_HORIZONTAL +Horisontellt dragreglage +; Horizontal Scrollbar +; +MSG_SB_HORIZONTAL_HELP +Välj förvalt läge\nför horisontellt dragreglage.\n(kan ändras av ett program) +; Set the default mode\n\ +; for the horizontal scrollbar.\n\ +; (may be overwritten by an\n\ +; application) +; +MSG_SB_VERTICAL +Vertikalt dragreglage +; Vertical Scrollbar +; +MSG_SB_VERTICAL_HELP +Välj förvalt läge\nför vertikalt dragreglage.\n(kan ändras av ett program) +; Set the default mode\n\ +; for the vertical scrollbar.\n\ +; (may be overwritten by an\n\ +; application) +; +MSG_SCROLLCONTROL +Skrollkontroll +; Scolling Control +; +MSG_SMOOTH_SCROLLING +Mjuk skrollning +; Smooth Scrolling +; +MSG_SMOOTH_SCROLLING_HELP +Om vald, kommer mjuk skrollning\natt användas för NList objekt.\nSom tillägg, vid användning av\n'mjuk' reglaget i normala MUI 'Listview'\nkonfigurationssidan kan hastigheten\nkontrolleras. +; If enabled, smoothing scrolling\n\ +; will be used for NList objects.\n\ +; In addition, by using the 'smooth'\n\ +; slider in the normal MUI 'Listview'\n\ +; configuration page the speed of\n\ +; the smooth scrolling can be controled. +; +MSG_MMB_FASTWHEEL +MMK Snabbhjul +; MMB Fast Wheel +; +MSG_MMB_FASTWHEEL_HELP +Om vald, kommer mittenmusknappen\natt användas som en kvalificerare för\natt utföra en snabb hjulskroll.\n(Se 'tangentbindningar' sidan också\nför fler hjulkvalificerare) +; If enabled, the middle mouse button\n\ +; can be used as a qualifier to perform\n\ +; a fast scroll wheel action.\n\ +; (See 'Keybindings' page as well for\n\ +; more wheel qualifiers) +; +MSG_WHEEL_STEP +Mushjul steg +; Mouse Wheel Step +; +MSG_WHEEL_STEP_HELP +Tillåter att specifiera antal linjer\nsom skrollas vid användning\nav en mus med skrollhjul. +; Allows to specify the amount of lines\n\ +; that should be scrolled when using a\n\ +; wheel mouse. +; +MSG_WHEEL_FAST +Mushjul snabbsteg +; Mouse Wheel Fast Step +; +MSG_WHEEL_FAST_HELP +Tillåter att specifiera antal linjer\nsom skrollas vid användning\nav en mus med skrollhjul och\nnär snabbhjulskvalificeraren\när nedtryckt. +; Allows to specify the amount of lines\n\ +; that should be scrolled when using a\n\ +; wheel mouse and when the fast wheel\n\ +; qualifier is pressed. +; +MSG_LAYOUT +Layout +; Layout +; +MSG_PARTIAL_COL_MARK +Delvis kolumnmarkering +; Partial column mark +; +MSG_PARTIAL_COL_MARK_HELP +Om vald, kommer en speciell markering\natt visas på höger sida av en\nkolumn, ifall texten inte ryms. +; If enabled, a special mark will be drawn\n\ +; at the right side of a column in case the\n\ +; text didn't completly fit into it. +; +MSG_PARTIAL_CHARS_DRAWN +Tecken delvis ritade +; Partial chars drawn +; +MSG_PARTIAL_CHARS_DRAWN_HELP +Om vald, så kommer tecken som inte är\nfullt synliga vid vänster och höger\nhörn av ett NList objekt att inte ritas delvis. +; If enabled, characters that are not fully\n\ +; visible at the left and right corner of\n\ +; an NList object will not be drawn partially. +; +MSG_VERT_CENTERED +Vertikalt centrerade linjer +; Vertical centered lines +; +MSG_VERT_CENTERED_HELP +Om aktiverat, så kommer textlinjer att\ncentreras vertikalt i ett NList objekt. +; If activated, the text lines are centered\n\ +; vertically in a NList object. +; +MSG_BALANCING_COLS +Balancerade kolumner +; Balancing Columns +; +MSG_BALANCING_COLS_HELP +NList tillåter att ändra kolumnbredden\nvia mus, genom att dra i kolumnseparatorn\ni titelraden. Den flyttade raden kan visas\nantingen endast i titeln, genom hela linjer\neller så kan ändringarna visas direkt. +; NList permits to change the column width\n\ +; via mouse dragging the column separator in\n\ +; the title bar. The moved bar can be visible\n\ +; either only in the title, throughout the\n\ +; whole lines or the column width changes can\n\ +; be made visible instantly. +; +MSG_COLWIDTHDRAG_TITLE +Titelrad +; Title Bar +; +MSG_COLWIDTHDRAG_FULLBAR +Full rad +; Full Bar +; +MSG_COLWIDTHDRAG_VISIBLE +Synlig +; Visible +; +MSG_COLOR_OPTIONS +Alternativ +; Options +; +MSG_FORCE_SELECT_PEN +Tvinga vald penna +; Force select pen +; +MSG_FORCE_SELECT_PEN_HELP +Om vald, kommer NList att kontrollera\natt 'vald', 'markör' och 'ovald'\nfärg tvingas. +; If enabled, NList will make sure that\n\ +; the 'Selected', 'Cursor' and 'Unselected'\n\ +; color will be forced. +; +MSG_MULTISEL_MOVEACTIVE +Tangentbord flyttar markör +; Keyboard moves cursor +; +MSG_MULTISEL_MOVEACTIVE_HELP +Om vald, kommer tangentbordet som\nanvänds i ett NList objekt att\nflytta den aktiva markören, istället\nför den ovalda. +; If enabled, a keyboard use in an NList\n\ +; object will move the active cursor\n\ +; rather than the unselected one. +; +MSG_GROUP_MISC +Övrigt +; Miscellaneous +; +MSG_GROUP_EXAMPLE +Exempel +; Example +; +MSG_SERMOUSE_FIX +Seriell musfix +; Serial Mouse Fix +; +MSG_SERMOUSE_FIX_HELP +Om vald, försöker NList att fixa vanliga\ndra&släpp problem som är vanligt vid\nanvändning av en seriell mus. +; If enabled, NList tries to fix common\n\ +; drag&drop issues that are related to using\n\ +; a serial mouse. +; +MSG_SELECT_POINTER +Specialpekare för val +; Custom Select Pointer +; +MSG_SELECT_POINTER_HELP +Om vald och ett NList objekt är i\nteckenvist väljläge, kommer en speciell\npekare för val att visas, istället för\nworkbench standard pekare. +; If enabled, and an NList object is in\n\ +; charwise selection mode a custom select\n\ +; pointer will be displayed instead of the\n\ +; default workbench mouse pointer image. +; +MSG_BAR_CONTEXTMENU +Kontextmeny +; Context Menu +; +MSG_DEFAULT_CONTEXT_MENU_HELP +NList tillåter att dess förvalda\nkontextmeny, slås av eller på,\neller endast när muspekaren\när vid toppen av NList objektet. +; NList permits to have its default\n\ +; context menu being disabled or enabled\n\ +; or only in case the mouse is at the top\n\ +; of the NList object. +; +MSG_SNOOP +Läs av +; Snoop +; +MSG_SNOOP_KEY +Börja avläsning av snabbtangent. +; Start the grab of a hotkey. +; +MSG_BUTTON_INSERT +Sätt in +; Insert +; +MSG_BUTTON_INSERT_HELP +Tillåter insättning av en ny snabbtangent. +; Allows to insert a new hotkey. +; +MSG_BUTTON_REMOVE +Ta bort +; Remove +; +MSG_BUTTON_REMOVE_HELP +Tillåter borttagning av en existerande snabbtangent. +; Allows to remove an existing hotkey. +; +MSG_BUTTON_UPDATEKEYS +Uppdatera tangenter +; Update keys +; +MSG_BUTTON_UPDATEKEYS_HELP +Lägg till förvalda snabbtangenter\nför de funktioner som förnärvarande\ninte finns i listan. +; Add the default hotkeys for\n\ +; the functions which are not\n\ +; currently in the list. +; +MSG_BUTTON_DEFAULTKEYS +Förvalda tangenter +; Default keys +; +MSG_BUTTON_DEFAULTKEYS_HELP +Återställer alla snabbtangenter till de förvalda. +; Resets all hotkeys to default ones. +; +MSG_FUNC_MULTISELQUAL +Flerval/block kvalificerare +; Multiselect/Block Qualifier +; +MSG_FUNC_DRAGQUAL +Dra&släpp kvalificerare +; Drag&Drop Qualifier +; +MSG_FUNC_BALANCEQUAL +Balans kvalificerare +; Balance Qualifier +; +MSG_FUNC_COPYCLIP +Kopiera till klippbordet +; Copy to clipboard +; +MSG_FUNC_DEFCOLWIDTH +Förvald kolumnbredd +; Default width column +; +MSG_FUNC_DEFALLCOLWIDTH +Förvald bredd alla kolumner +; Default width all columns +; +MSG_FUNC_DEFORDERCOL +Förvald kolumnordning +; Default order column +; +MSG_FUNC_DEFALLORDERCOL +Förvald ordning alla kolumner +; Default order all columns +; +MSG_FUNC_SELECTTOP +Välj för överst +; Select to top +; +MSG_FUNC_SELECTBOTTOM +Välj för nederst +; Select to bottom +; +MSG_FUNC_SELECTPAGEUP +Välj för sida upp +; Select to page up +; +MSG_FUNC_SELECTPAGEDOWN +Välj för sida ned +; Select to page down +; +MSG_FUNC_SELECTUP +Välj upp +; Select up +; +MSG_FUNC_SELECTDOWN +Välj ned +; Select down +; +MSG_FUNC_TOGGLEACTIVE +Växla aktiv +; Toggle active +; +MSG_FUNC_FASTWHEELQUAL +Snabb mushjulkvalificerare +; Fast MouseWheel Qualifier +; +MSG_FUNC_HORIZWHEELQUAL +Horisontell mushjulkvalificerare +; Horiz MouseWheel Qualifier +; +MSG_FUNC_TITLECLICKQUAL +Titelklick kvalificerare +; Title Click Qualifier +; +MSG_VSB_ALWAYS +Alltid +; Always +; +MSG_VSB_AUTO +Auto +; Auto +; +MSG_VSB_FULLAUTO +Fullauto +; FullAuto +; +MSG_HSB_ALWAYS +Alltid +; Always +; +MSG_HSB_AUTO +Auto +; Auto +; +MSG_HSB_FULLAUTO +Fullauto +; FullAuto +; +MSG_HSB_NONE +Ingen +; None +; +MSG_CMENU_ALWAYS +Alltid +; Always +; +MSG_CMENU_TOPONLY +Endast topp +; TopOnly +; +MSG_CMENU_NEVER +Aldrig +; Never +; +MSG_HOTKEYS_KEY +Tangent +; Key +; +MSG_HOTKEYS_ACTION +Händelse +; Action +; +MSG_EXAMPLE_TEXT +Om du har problem, försök öka stackvärdet\ni ikon informationen om du startar programmet\nvia ikonen. Stacken för CLI om du startar det\nfrån CLI Shell och om du startar det från något\nannat verktyg, läs dess dokumentation hur du\nökar stackstorleken.\nEn stack på 12kb, 16kb eller 20kb räcker vanligtvis.\n\nOm du fortfarande har problem, se om de händer\nmed demo programmet, kontakta mig sedan.\n\033C\nSenaste release kan hittas på Aminet (dev/mui).\nAlla releaser finns på\nhttp://www.sourceforge.net/projects/nlist-classes/\n\033C\n\033r\0333(C) 2001-2008 av NList Open Source Team\n\033r\0333(C)1996-1998 av Gilles Masson\n\033r\0333http://www.sourceforge.net/projects/nlist-classes/\n\033C\n\033cDenna nya list/listvy specialklass\n\033chanterar sin egen konfigurerbara bakgrunder,\n\033cpennor, typsnitt, rullister, tangenter och kvalifiserare\n\033C\n\033CTidigare sätt att hantera markör med flerval\n\033cär inte exakt samma som listvyn !\n\033cDra&släpp stöds, båda rullisterna kan\ + konfigureras\n\033catt försvinna automatiskt när de inte behövs\n\033ceftersom allt är synligt. Prova det...\n\033C\n\033cDu kan rulla horisontellt med tangenterna\n\033celler gå till höger och vänster om listen\n\033coch samtidigt välja med musen.\n\033cProva klicka på vänster/höger ramar !\n\033C\n\033cDu kan ändra kolumnernas bredd med att dra\n\033ci den vertikala separatorn mellan kolumntitlarna\n\033c(prova med att använda balanskvalifiseraren också).\n\033C\n\033cDu kan ändra kolumnernas ordning genom att dra i kolumntitlarna.\n\033C\n\033cDet finns inbyggt kopiera till klippbordet\n\033coch klassisk tecken val kapacitet.\n\033C\n\033cProva demo programmet för att testa allt det...\n\n\n\033r\033bGe feedback om det ! :-)\n\033C\n**************************************************************************************************\n +; If you have problems, try to increase the stack value,\n\ +; in the icon infos if you launch the program from icon,\n\ +; stack of CLI if you start it from CLI/Shell,\n\ +; and if you launch it from some utility read its docs\n\ +; to see how to increase it.\n\ +; A stack of 12Kb, 16Kb or 20Kb is most of time a good idea.\n\ +; \n\ +; If you still have problems, try to see if they happen with the Demo prog, then tell me.\n\ +; \033C\n\ +; Latest public release can be found on aminet (dev/mui).\n\ +; All releases are available on\n\ +; http://www.sourceforge.net/projects/nlist-classes/\n\ +; \033C\n\ +; \033r\0333(C) 2001-2010 by NList Open Source Team\n\ +; \033r\0333(C) 1996-1998 by Gilles Masson\n\ +; \033r\0333http://www.sourceforge.net/projects/nlist-classes/\n\ +; \033C\n\ +; \033cThis new list/listview custom class\n\ +; \033chandles its own configurable backgrounds,\n\ +; \033cpens, fonts, scrollbars, keys and qualifiers\n\ +; \033C\n\ +; \033cThe way used to handle cursor with multiselection\n\ +; \033cis not exactly as the listview one !\n\ +; \033cDrag&Drop is supported, both scrollbars\n\ +; \033ccan be configured to disappear automatically\n\ +; \033cwhen not needed because all is visible.\n\ +; \033cJust try it...\n\ +; \033C\n\ +; \033cYou can horizontaly scroll with cursor keys,\n\ +; \033cor going on the right and left of the list\n\ +; \033cwhile selecting with the mouse.\n\ +; \033cTry just clicking on the left/right borders !\n\ +; \033C\n\ +; \033cYou can change columns widths just dragging\n\ +; \033cthe vertical separator between columns titles\n\ +; \033c(try it using the balancing qualifier too).\n\ +; \033C\n\ +; \033cYou can change columns order just dragging\n\ +; \033cthe column titles.\n\ +; \033C\n\ +; \033cThere is builtin copy to clipboard stuff\n\ +; \033cand classic char selection capability.\n\ +; \033C\n\ +; \033cTry the Demo program to test all that...\n\ +; \n\ +; \n\ +; \033r\033bGive some feedback about it ! :-)\n\ +; \033C\n\ +; **************************************************************************************************\n +; diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/locale/turkish.ct b/workbench/classes/zune/nlist/nlistviews_mcp/locale/turkish.ct new file mode 100644 index 0000000000..81a1e176f1 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/locale/turkish.ct @@ -0,0 +1,822 @@ +## version $VER: NListviews_mcp.catalog 2.0 (07.11.2010) +## language türkçe +## codeset 0 +; +; +; NListviews_mcp.cd - NList MUI custom prefs catalog description file +; $Id$ +; +;#version 2 +;#language english +; +; +MSG_FONTS +Yazýtipi +; Fonts +; +MSG_NORMAL_FONT +Normal Yazýtipi: +; Normal Font: +; +MSG_NORMAL_FONT_HELP +Normal NList yazýtipini seçin. +; Choose the normal NList font. +; +MSG_NORMAL_FONT_ASL +Normal yazýtipini seçin... +; Please select the normal font... +; +MSG_SMALL_FONT +Küçük Yazýtipi: +; Small Font: +; +MSG_SMALL_FONT_HELP +Küçük NList yazýtipini seçin. +; Choose the small NList font. +; +MSG_SMALL_FONT_ASL +Lütfen küçük yazýtipi seçiniz... +; Please select a small font... +; +MSG_FIXED_FONT +Sabit geniþlikli: +; Fixed Font: +; +MSG_FIXED_FONT_HELP +Sabit geniþlikli NList yazýtipini seçin. +; Choose the fixed NList font. +; +MSG_FIXED_FONT_ASL +Lütfen sabit geniþlikli bir yazýtipi seçin... +; Please select a fixed font... +; +MSG_FONT_MARGIN +Yazýtipi sýnýrý: +; Font Margin: +; +MSG_FONT_MARGIN_HELP +Gireceðiniz deðere yazýtipinin\n\ +yüksekliði de eklenir ve NList\n\ +nesnelerinin varsayýlan satýr\n\ +yüksekliðini olarak kullanýlýr. +; Allows to set a vertical margin\n\ +; which will be added to the font\n\ +; height and result in the default\n\ +; line height in an NList object. +; +MSG_COLORS +Renkler +; Colors +; +MSG_TEXTCOLOR +Metin Rengi +; Text Pen +; +MSG_BACKGROUNDCOLOR +Art alan +; Background +; +MSG_TITLE_PEN_WIN +Baþlýk Rengi +; Title Pen +; +MSG_TITLE_PEN_HELP +Baþlýklarýn yazýlacaðý rengi\n\ +ayarlamak için kullanýlýr. +; For adjusting the pen color of\n\ +; a title. +; +MSG_PBG_TITLE +\ecBaþlýk +; \ecTitle +; +MSG_TITLE_BG_WIN +Baþlýk Art Alaný +; Title Background +; +MSG_TITLE_BG_HELP +Baþlýklarýn art alan rengini\n\ +ayarlamak için kullanýlýr. +; For adjusting the background color\n\ +; of a title. +; +MSG_LIST_PEN_WIN +Liste Rengi +; List Pen +; +MSG_LIST_PEN_HELP +Bir listelerin yazýlacaðý rengi\n\ +ayarlamak için kullanýlýr. +; For adjusting the pen color of\n\ +; a list. +; +MSG_PBG_LIST +\ecListe +; \ecList +; +MSG_LIST_BG_WIN +Liste Art Alaný +; List Background +; +MSG_LIST_BG_HELP +Bir listenin art alan rengini\n\ +ayarlamak için kullanýlýr. +; For adjusting the background color\n\ +; of a list. +; +MSG_SELECT_PEN_WIN +Seçilmiþ Girdi +; Selected Entry +; +MSG_SELECT_PEN_HELP +Seçilmiþ girdilerin rengini\n\ +ayarlamak için kullanýlýr. +; For adjusting the pen color of\n\ +; selected entries. +; +MSG_PBG_SELECT +\ecSeçilmiþ +; \ecSelected +; +MSG_SELECT_BG_WIN +Seçilmiþ Girdi +; Selected Entry +; +MSG_SELECT_BG_HELP +Seçilmiþ girdilerin art alan\n\ +rengini ayarlamak için kullanýlýr. +; For adjusting the background color\n\ +; of selected entries. +; +MSG_CURSOR_PEN_WIN +Seçilmiþ Ýmleç +; Selected Cursor +; +MSG_CURSOR_PEN_HELP +Seçilmiþ bir imlecin renginin\n\ +ayarlanmasý için kullanýlýr. +; For adjusting the pen color of\n\ +; a selected cursor. +; +MSG_PBG_CURSOR +\ecÝmleç +; \ecCursor +; +MSG_CURSOR_BG_WIN +Seçilmiþ Ýmleç +; Selected Cursor +; +MSG_CURSOR_BG_HELP +Seçilmiþ bir imlecin art alan\n\ +rengini ayarlamak için kullanýlýr. +; For adjusting the background color\n\ +; of a selected cursor. +; +MSG_UNSEL_PEN_WIN +Seçilmemiþ Ýmleç +; Unselected Cursor +; +MSG_UNSEL_PEN_HELP +Seçilmemiþ bir imlecin rengini\n\ +ayarlamak için kullanýlýr. +; For adjusting the pen color of\n\ +; an unselected cursor. +; +MSG_PBG_UNSEL +\ecSeçilmemiþ +; \ecUnselected +; +MSG_UNSEL_BG_WIN +Seçilmemiþ Ýmleç +; Unselected Cursor +; +MSG_UNSEL_BG_HELP +Seçilmemiþ bir imlecin art alan\n\ +rengini ayarlamak için kullanýlýr. +; For adjusting the background color\n\ +; of an unselected cursor. +; +MSG_INACT_PEN_WIN +Etkin Olmayan Ýmleç +; Inactive Cursor +; +MSG_INACT_PEN_HELP +Etkin olmayan bir imlecin rengini\n\ +ayarlamak için kullanýlýr. +; For adjusting the pen color of\n\ +; an inactive cursor. +; +MSG_PBG_INACT +\ecEtkin olmayan +; \ecInactive +; +MSG_INACT_BG_WIN +Etkin Olmayan Ýmleç +; Inactive Cursor +; +MSG_INACT_BG_HELP +Etkin olmayan bir imlecin art alan\n\ +rengini ayarlamak için kullanýlýr. +; For adjusting the background color\n\ +; of an inactive cursor. +; +MSG_MULTISELECT +Çoklu seçim +; MultiSelection +; +MSG_MULTISELECT_QUAL +Kýsýtlayýcý ile +; via Qualifier +; +MSG_MULTISELECT_ALWAYS +Her zaman +; Always +; +MSG_MULTISELECT_HELP +Varsayýlan çoklu seçim\n\ +kipini seçmeyi saðlar. +; Allows to specify the default\n\ +; multiselection mode. +; +MSG_MMB_MULTISEL +OFT çoklu seçim +; MMB multiselection +; +MSG_MMB_MULTISEL_HELP +Çoklu seçim kýsýtlayýcýsý olarak\n\ +Orta Fare Tuþu (OFT) kullanmak\n\ +istiyorsanýz etkinleþtiriniz. +; Set it if you want to use the middle\n\ +; mouse button (MMB) as a multiselection\n\ +; qualifier. +; +MSG_DRAGDROP +Sürükle&Býrak +; Drag&Drop +; +MSG_DRAGTYPE_IMMEDIATE +Anýnda +; Immediate +; +MSG_DRAGTYPE_BORDERS +Kenarlarda +; at Borders +; +MSG_DRAGTYPE_QUALIFIER +Kýsýtlayýcý ile +; via Qualifier +; +MSG_DRAGTYPE_HELP +'Anýnda' kipi, sürükle&býrak eylemini, bir nesneyi\n\ +sürüklediðiniz anda baþlatacaktýr.\n\ +'Kenarlarda' kipi nesneyi liste kenarlýklarýndan\n\ +öteye sürüklediðinizde baþlatacaktýr.\n\ +'Kýsýtlayýcý ile' kipi ise yalnýzca kýsýtlayýcý\n\ +tuþ basýldýðýnda baþlatacaktýr.\n\ +\n\ +'Anýnda' yalnýzca çoklu seçimin etkin olmadýðý\n\ +listelerde kullanýlabilir. +; Set the drag mode. 'Immediate' will start\n\ +; drag&drop as soon as you drag an object.\n\ +; 'at Borders' for showing a drag operation\n\ +; as soon as you passed the left/right borders\n\ +; and 'via Qualifier' for only allowing to\n\ +; drag&drop via a qualifier key (see 'Keys').\n\ +; \n\ +; 'Immediate' is used only when in no-multiselect\n\ +; mode. +; +MSG_DRAG_LINES +Görünen satýrlar +; Visible lines +; +MSG_DRAG_LINES_HELP +Sürükle&býrak eylemi sýrasýnda\n\ +görüntülenecek satýrlarýn azami\n\ +sayýsýný giriniz. Eðer bundan daha fazla\n\ +satýr seçili ise 'xx nesne sürükleniyor'\n\ +þeklinde bir ileti görüntülenecektir. +; Give the max. number of lines\n\ +; which will be shown when\n\ +; doing drag&drop. If more lines\n\ +; are selected, you'll get a message\n\ +; similar to: 'Dragging xx Items...'. +; +MSG_PAGE_FONTS +Yazýtipleri +; Fonts +; +MSG_PAGE_COLORS +Renkler +; Colors +; +MSG_PAGE_OPTIONS +Seçenekler +; Options +; +MSG_PAGE_SCROLLING +Kaydýrma +; Scrolling +; +MSG_PAGE_KEYBINDINGS +Kýsayol tuþlarý +; Keybindings +; +MSG_SB_HORIZONTAL +Yatay Kaydýrma Çubuðu +; Horizontal Scrollbar +; +MSG_SB_HORIZONTAL_HELP +Yatay kaydýrma çubuðu için\n\ +varsayýlan kipi seçiniz.\n\ +(uygulama tarafýndan\n\ +geçersiz kýlýnabilir) +; Set the default mode\n\ +; for the horizontal scrollbar.\n\ +; (may be overwritten by an\n\ +; application) +; +MSG_SB_VERTICAL +Dikey Kaydýrma Çubuðu +; Vertical Scrollbar +; +MSG_SB_VERTICAL_HELP +Dikey kaydýrma çubuðu için\n\ +varsayýlan kipi seçiniz.\n\ +(uygulama tarafýndan\n\ +geçersiz kýlýnabilir) +; Set the default mode\n\ +; for the vertical scrollbar.\n\ +; (may be overwritten by an\n\ +; application) +; +MSG_SCROLLCONTROL +Kaydýrma Yöntemi +; Scolling Control +; +MSG_SMOOTH_SCROLLING +Akýcý Kaydýrma +; Smooth Scrolling +; +MSG_SMOOTH_SCROLLING_HELP +Etkinleþtirildiðinde, NList nesneleri\n\ +için akýcý kaydýrma kullanýlacaktýr.\n\ +Akýcý kaydýrma hýzý, normal MUI\n\ +'Listeler' ayarlarýndaki sürgü ile\n\ +ayarlanabilir. +; If enabled, smoothing scrolling\n\ +; will be used for NList objects.\n\ +; In addition, by using the 'smooth'\n\ +; slider in the normal MUI 'Listview'\n\ +; configuration page the speed of\n\ +; the smooth scrolling can be controled. +; +MSG_MMB_FASTWHEEL +OFT Hýzlý Kaydýrma +; MMB Fast Wheel +; +MSG_MMB_FASTWHEEL_HELP +Etkinleþtirildiðinde, orta fare tuþu\n\ +hýzlý kaydýrma eylemi için bir kýsýtlayýcý\n\ +tuþ olarak kullanýlabilir.\n\ +(Diðer kaydýrma kýsýtlayýcýlarý için\n\ +'Kýsayol Tuþlarý' sayfasýna bakýnýz) +; If enabled, the middle mouse button\n\ +; can be used as a qualifier to perform\n\ +; a fast scroll wheel action.\n\ +; (See 'Keybindings' page as well for\n\ +; more wheel qualifiers) +; +MSG_WHEEL_STEP +Fare Tekerlek Adýmý +; Mouse Wheel Step +; +MSG_WHEEL_STEP_HELP +Fare tekerleði ile kaydýrma yapýldýðýnda\n\ +her defada kaç satýr kaydýrýlacaðýný belirler. +; Allows to specify the amount of lines\n\ +; that should be scrolled when using a\n\ +; wheel mouse. +; +MSG_WHEEL_FAST +Fare Hýzlý Tekerlek Adýmý +; Mouse Wheel Fast Step +; +MSG_WHEEL_FAST_HELP +Hýzlý Kaydýrma Kýsýtlayýcý tuþu ve\n\ +fare tekerleði ile kaydýrma yapýldýðýnda\n\ +her defada kaç satýr kaydýrýlacaðýný belirler. +; Allows to specify the amount of lines\n\ +; that should be scrolled when using a\n\ +; wheel mouse and when the fast wheel\n\ +; qualifier is pressed. +; +MSG_LAYOUT +Dizilim +; Layout +; +MSG_PARTIAL_COL_MARK +Sýðmayan sütun imi +; Partial column mark +; +MSG_PARTIAL_COL_MARK_HELP +Etkinleþtirildiðinde, metin sütuna tam\n\ +olarak sýðmadýðýnda sütunun\n\ +sað tarafýna bir belirteç çizilir. +; If enabled, a special mark will be drawn\n\ +; at the right side of a column in case the\n\ +; text didn't completly fit into it. +; +MSG_PARTIAL_CHARS_DRAWN +Sýðmayan harfleri çizme +; Partial chars drawn +; +MSG_PARTIAL_CHARS_DRAWN_HELP +Etkinleþtirildiðinde, NList nesnesinin sað\n\ +ve sol kenarlarýna bütün olarak sýðmayan\n\ +harflerin, görünen kýsýmlarý da çizilmez. +; If enabled, characters that are not fully\n\ +; visible at the left and right corner of\n\ +; an NList object will not be drawn partially. +; +MSG_VERT_CENTERED +Dikey ortalanmýþ satýrlar +; Vertical centered lines +; +MSG_VERT_CENTERED_HELP +Etkinleþtirildiðinde, metin satýrlarý NList\n\ +nesnesi içinde dikey ortalanýr. +; If activated, the text lines are centered\n\ +; vertically in a NList object. +; +MSG_BALANCING_COLS +Boyutlandýrýlabilir Sütunlar +; Balancing Columns +; +MSG_BALANCING_COLS_HELP +NList, sütun geniþliklerini, baþlýk çubuðundaki\n\ +sütun ayýraçlarýndan fare ile çekiþtirerek\n\ +deðiþtirmeye izin verir. Boyutlandýrma sýrasýnda\n\ +deðiþiklikler, çubuðun yalnýzca baþlýk kýsmýna,\n\ +tüm çizgilere veya listenin bütününe eþ\n\ +zamanlý olarak uygulanabilir. +; NList permits to change the column width\n\ +; via mouse dragging the column separator in\n\ +; the title bar. The moved bar can be visible\n\ +; either only in the title, throughout the\n\ +; whole lines or the column width changes can\n\ +; be made visible instantly. +; +MSG_COLWIDTHDRAG_TITLE +Baþlýk Çubuðu +; Title Bar +; +MSG_COLWIDTHDRAG_FULLBAR +Tüm Çizgiler +; Full Bar +; +MSG_COLWIDTHDRAG_VISIBLE +Tüm Liste +; Visible +; +MSG_COLOR_OPTIONS +Seçenekler +; Options +; +MSG_FORCE_SELECT_PEN +Seçim rengine zorla +; Force select pen +; +MSG_FORCE_SELECT_PEN_HELP +Etkinleþtirildiðinde, NList uygulamayý\n\ +ayarlanmýþ 'Seçilmiþ', 'Ýmleç' ve\n\ +'Seçilmemiþ' renklerine zorlar. +; If enabled, NList will make sure that\n\ +; the 'Selected', 'Cursor' and 'Unselected'\n\ +; color will be forced. +; +MSG_MULTISEL_MOVEACTIVE +Klavye imleci hareket ettirir +; Keyboard moves cursor +; +MSG_MULTISEL_MOVEACTIVE_HELP +Etkinleþtirildiðinde, bir NList nesnesinde\n\ +yapýlan klavye hareketleri, seçilmemiþ yerine,\n\ +etkin imleci hareket ettirecektir. +; If enabled, a keyboard use in an NList\n\ +; object will move the active cursor\n\ +; rather than the unselected one. +; +MSG_GROUP_MISC +Çeþitli +; Miscellaneous +; +MSG_GROUP_EXAMPLE +Örnek +; Example +; +MSG_SERMOUSE_FIX +Seri Fare Yamasý +; Serial Mouse Fix +; +MSG_SERMOUSE_FIX_HELP +Etkinleþtirildiðinde, NList, seri fare\n\ +kullanýldýðýnda ortaya çýktýðý bilinen\n\ +sürükle&býrak sorunlarýný gidermeye\n\ +çalýþýr. +; If enabled, NList tries to fix common\n\ +; drag&drop issues that are related to using\n\ +; a serial mouse. +; +MSG_SELECT_POINTER +Özel Seçim Ýþaretçisi +; Custom Select Pointer +; +MSG_SELECT_POINTER_HELP +Etkinleþtirilirse, ve bir NList nesnesi harf seçim\n\ +kipinde olduðunda, Workbench'in varsayýlan\n\ +fare iþaretçisi yerine özel bir seçim iþaretçisi\n\ +görüntülenecektir. +; If enabled, and an NList object is in\n\ +; charwise selection mode a custom select\n\ +; pointer will be displayed instead of the\n\ +; default workbench mouse pointer image. +; +MSG_BAR_CONTEXTMENU +Ýçerik Menüsü +; Context Menu +; +MSG_DEFAULT_CONTEXT_MENU_HELP +NList varsayýlan içerik menüsünün devre\n\ +dýþý býrakýlabilmesini, etkinleþtirilebilmesini\n\ +veya yalnýzca fare NList nesnesinin en\n\ +yukarýsýnda olduðunda etkin olmasýný saðlar. +; NList permits to have its default\n\ +; context menu being disabled or enabled\n\ +; or only in case the mouse is at the top\n\ +; of the NList object. +; +MSG_SNOOP +Algýla +; Snoop +; +MSG_SNOOP_KEY +Kýsa yol tuþu algýlamayý baþlatýr. +; Start the grab of a hotkey. +; +MSG_BUTTON_INSERT +Ekle +; Insert +; +MSG_BUTTON_INSERT_HELP +Listeye yeni kýsayol tuþu ekler. +; Allows to insert a new hotkey. +; +MSG_BUTTON_REMOVE +Sil +; Remove +; +MSG_BUTTON_REMOVE_HELP +Varolan bir kýsayolu kaldýrýr. +; Allows to remove an existing hotkey. +; +MSG_BUTTON_UPDATEKEYS +Tuþlarý güncelle +; Update keys +; +MSG_BUTTON_UPDATEKEYS_HELP +Listede bulunmayan fonksiyonlarý,\n\ +varsayýlan kýsayol tuþlarý ile ekler. +; Add the default hotkeys for\n\ +; the functions which are not\n\ +; currently in the list. +; +MSG_BUTTON_DEFAULTKEYS +Varsayýlan tuþlar +; Default keys +; +MSG_BUTTON_DEFAULTKEYS_HELP +Tüm kýsayollarý varsayýlanlarýna döndürür. +; Resets all hotkeys to default ones. +; +MSG_FUNC_MULTISELQUAL +Çoklu/Blok Seçim Kýsýtlayýcýsý +; Multiselect/Block Qualifier +; +MSG_FUNC_DRAGQUAL +Sürükle&Býrak Kýsýtlayýcýsý +; Drag&Drop Qualifier +; +MSG_FUNC_BALANCEQUAL +Boyutlandýrma Kýsýtlayýcýsý +; Balance Qualifier +; +MSG_FUNC_COPYCLIP +Panoya kopyala +; Copy to clipboard +; +MSG_FUNC_DEFCOLWIDTH +Varsayýlan sütun geniþliði +; Default width column +; +MSG_FUNC_DEFALLCOLWIDTH +Tüm sütunlarda varsayýlan geniþlik +; Default width all columns +; +MSG_FUNC_DEFORDERCOL +Sütunda varsayýlan sýralama +; Default order column +; +MSG_FUNC_DEFALLORDERCOL +Tüm sütunlarda varsayýlan sýralama +; Default order all columns +; +MSG_FUNC_SELECTTOP +En üste kadar seç +; Select to top +; +MSG_FUNC_SELECTBOTTOM +En alta kadar seç +; Select to bottom +; +MSG_FUNC_SELECTPAGEUP +Sayfa baþýna kadar seç +; Select to page up +; +MSG_FUNC_SELECTPAGEDOWN +Sayfa sonuna kadar seç +; Select to page down +; +MSG_FUNC_SELECTUP +Yukarý seç +; Select up +; +MSG_FUNC_SELECTDOWN +Aþaðý seç +; Select down +; +MSG_FUNC_TOGGLEACTIVE +Etkinleþtir +; Toggle active +; +MSG_FUNC_FASTWHEELQUAL +Hýzlý FareTekerleði Kýsýtlayýcýsý +; Fast MouseWheel Qualifier +; +MSG_FUNC_HORIZWHEELQUAL +Yatay FareTekerleði Kýsýtlayýcýsý +; Horiz MouseWheel Qualifier +; +MSG_FUNC_TITLECLICKQUAL +Baþlýk Týklama Kýsýtlayýcýsý +; Title Click Qualifier +; +MSG_VSB_ALWAYS +Her zaman +; Always +; +MSG_VSB_AUTO +Otomatik +; Auto +; +MSG_VSB_FULLAUTO +TamOtomatik +; FullAuto +; +MSG_HSB_ALWAYS +Her zaman +; Always +; +MSG_HSB_AUTO +Otomatik +; Auto +; +MSG_HSB_FULLAUTO +TamOtomatik +; FullAuto +; +MSG_HSB_NONE +Yok +; None +; +MSG_CMENU_ALWAYS +Her zaman +; Always +; +MSG_CMENU_TOPONLY +Yalnýzca En Yukarýda +; TopOnly +; +MSG_CMENU_NEVER +Hiçbir zaman +; Never +; +MSG_HOTKEYS_KEY +Tuþ +; Key +; +MSG_HOTKEYS_ACTION +Eylem +; Action +; +MSG_EXAMPLE_TEXT +Eðer sorunlarla karþýlaþýrsanýz, simge bilgisinden yýðýn boyutunu\n\ +arttýrmayý deneyin. Eðer programý komut satýrýndan çaðýrýyorsanýz\n\ +CLI yýðýn deðerini arttýrýn.\n\ +Eðer baþka bir uygulama ile çaðýrýyorsanýz, yýðýn boyutunu\n\ +arttýrmak için uygulamanýn dökümanlarýna baþvurun.\n\ +12Kb, 16Kb veya 20Kb'lýk yýðýnlar çoðu zaman iþe yarar.\n\ +\n\ +Hala sorunlar yaþýyorsanýz, bu sorunlarýn Demo uygulamasýnda\n\ +da ortaya çýkýp çýkmadýðýný deneyin ve sonucu bana bildirin.\n\ +\033C\n\ +En güncel halka açýk sürüm Aminet (dev/mui)'den temin edilebilir.\n\ +Tüm sürümler için:\n\ +http://www.sourceforge.net/projects/nlist-classes/\n\ +\033C\n\ +\033r\0333(C) 2001-2010 NList Açýk Kaynak Takýmý\n\ +\033r\0333(C) 1996-1998 Gilles Masson\n\ +\033r\0333http://www.sourceforge.net/projects/nlist-classes/\n\ +\033C\n\ +\033cBu yeni liste/liste görünümü özel sýnýfý\n\ +\033ckendi ayarlanabilir art alan, renk, yazýtipi,\n\ +\033ckaydýrma çubuklarý, kýsayol ve kýsýtlayýcý\n\ +\033ctuþlarýna sahiptir.\n\ +\033C\n\ +\033cÝmleç ile çoklu seçim için kullanýlan yöntem,\n\ +\033clistegörünümü þeklinde olanla tamamen ayný deðildir!\n\ +\033cSürükle&Býrak desteklenmekte ve her iki kaydýrma\n\ +\033cçubuðu da gerekli olmadýklarýnda otomatik olarak\n\ +\033ckaybolacak þekilde ayarlanabilmektedir.\n\ +\033cLütfen deneyin...\n\ +\033C\n\ +\033cFare ile seçim yaparken, yön tuþlarý ile yatay kaydýrma\n\ +\033cyapabilir ya da listede saða/sola hareket edebilirsiniz.\n\ +\033cSað/Sol kenarlýklara týklamayý deneyiniz!\n\ +\033C\n\ +\033cSütün baþlýklarý arasýndaki dikey ayýraçlarý çekiþtirerek\n\ +\033csütun geniþliklerini deðiþtirebilirsiniz\n\ +\033c(boyutlandýrma kýsýtlayýcýsýný da deneyiniz).\n\ +\033C\n\ +\033cSütun baþlýklarýný sürükleyerek sütun\n\ +\033csýralamalarýný da deðiþtirebilirsiniz.\n\ +\033C\n\ +\033cPanoya kopyalama ve klasik harf harf seçim\n\ +\033cyapabilme özellikleri dahili olarak desteklenir.\n\ +\033C\n\ +\033cTümünü sýnamak için Demo uygulamasýný deneyin...\n\ +\n\ +\n\ +\033r\033bYorumlarýnýzý bekliyorum! :-)\n\ +\033C\n\ +**************************************************************************************************\n +; If you have problems, try to increase the stack value,\n\ +; in the icon infos if you launch the program from icon,\n\ +; stack of CLI if you start it from CLI/Shell,\n\ +; and if you launch it from some utility read its docs\n\ +; to see how to increase it.\n\ +; A stack of 12Kb, 16Kb or 20Kb is most of time a good idea.\n\ +; \n\ +; If you still have problems, try to see if they happen with the Demo prog, then tell me.\n\ +; \033C\n\ +; Latest public release can be found on aminet (dev/mui).\n\ +; All releases are available on\n\ +; http://www.sourceforge.net/projects/nlist-classes/\n\ +; \033C\n\ +; \033r\0333(C) 2001-2010 by NList Open Source Team\n\ +; \033r\0333(C) 1996-1998 by Gilles Masson\n\ +; \033r\0333http://www.sourceforge.net/projects/nlist-classes/\n\ +; \033C\n\ +; \033cThis new list/listview custom class\n\ +; \033chandles its own configurable backgrounds,\n\ +; \033cpens, fonts, scrollbars, keys and qualifiers\n\ +; \033C\n\ +; \033cThe way used to handle cursor with multiselection\n\ +; \033cis not exactly as the listview one !\n\ +; \033cDrag&Drop is supported, both scrollbars\n\ +; \033ccan be configured to disappear automatically\n\ +; \033cwhen not needed because all is visible.\n\ +; \033cJust try it...\n\ +; \033C\n\ +; \033cYou can horizontaly scroll with cursor keys,\n\ +; \033cor going on the right and left of the list\n\ +; \033cwhile selecting with the mouse.\n\ +; \033cTry just clicking on the left/right borders !\n\ +; \033C\n\ +; \033cYou can change columns widths just dragging\n\ +; \033cthe vertical separator between columns titles\n\ +; \033c(try it using the balancing qualifier too).\n\ +; \033C\n\ +; \033cYou can change columns order just dragging\n\ +; \033cthe column titles.\n\ +; \033C\n\ +; \033cThere is builtin copy to clipboard stuff\n\ +; \033cand classic char selection capability.\n\ +; \033C\n\ +; \033cTry the Demo program to test all that...\n\ +; \n\ +; \n\ +; \033r\033bGive some feedback about it ! :-)\n\ +; \033C\n\ +; **************************************************************************************************\n +; diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/mmakefile.src b/workbench/classes/zune/nlist/nlistviews_mcp/mmakefile.src new file mode 100644 index 0000000000..84407c7032 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/mmakefile.src @@ -0,0 +1,70 @@ +# $Id$ +include $(TOP)/config/make.cfg + +#MM contrib-zune-classes-nlistviews-mcp : includes linklibs contrib-zune-classes-nlistviews-mcp-catalogs +#MM contrib-zune-classes-nlistviews-mcp-test : includes linklibs + +USER_INCLUDES := -idirafter $(SRCDIR)/$(CURDIR)/../include -I$(SRCDIR)/$(CURDIR)/../nlistview_mcc +USER_CFLAGS := -DNO_INLINE_STDARG +USER_CFLAGS += $(PARANOIA_CFLAGS) + +FILES := locale NListviews icon Debug + +%build_module_simple mmake=contrib-zune-classes-nlistviews-mcp \ + modname=NListviews modtype=mcp moduledir=$(CONTRIBDIR)/Zune/MCC_NList/Classes/Zune \ + files="library $(FILES)" uselibs="mui" + + +%build_prog mmake=contrib-zune-classes-nlistviews-mcp-test progname=NListviews-Prefs \ + files="NListviews-Prefs $(FILES)" targetdir=$(AROS_TESTS)/NList \ + uselibs="mui" + + +#MM includes-copy + +INCLUDE_FILES := NListviews_mcp.h +%copy_includes path=mui + + +TARGETDIR := $(AROS_CONTRIB)/Zune/MCC_NList/Locale/Catalogs + +#MM +contrib-zune-classes-nlistviews-mcp-catalogs : locale.h locale.c \ + $(TARGETDIR)/czech/NListviews_mcp.catalog \ + $(TARGETDIR)/svenska/NListviews_mcp.catalog \ + $(TARGETDIR)/français/NListviews_mcp.catalog \ + $(TARGETDIR)/deutsch/NListviews_mcp.catalog \ + $(TARGETDIR)/polish/NListviews_mcp.catalog \ + $(TARGETDIR)/türkçe/NListviews_mcp.catalog + +locale.h : locale/NListviews_mcp.cd $(SRCDIR)/$(CURDIR)/C_h.sd + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListviews_mcp.cd locale.h=$(SRCDIR)/$(CURDIR)/C_h.sd + +locale.c : locale/NListviews_mcp.cd $(SRCDIR)/$(CURDIR)/C_h.sd + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListviews_mcp.cd locale.c=$(SRCDIR)/$(CURDIR)/C_c.sd + +$(TARGETDIR)/czech/NListviews_mcp.catalog: locale/czech.ct + @$(MKDIR) $(TARGETDIR)/czech + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListviews_mcp.cd $< CATALOG $@ + +$(TARGETDIR)/français/NListviews_mcp.catalog: locale/french.ct + @$(MKDIR) $(TARGETDIR)/français + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListviews_mcp.cd $< CATALOG $@ + +$(TARGETDIR)/svenska/NListviews_mcp.catalog: locale/swedish.ct + @$(MKDIR) $(TARGETDIR)/svenska + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListviews_mcp.cd $< CATALOG $@ + +$(TARGETDIR)/deutsch/NListviews_mcp.catalog: locale/german.ct + @$(MKDIR) $(TARGETDIR)/deutsch + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListviews_mcp.cd $< CATALOG $@ + +$(TARGETDIR)/polish/NListviews_mcp.catalog: locale/polish.ct + @$(MKDIR) $(TARGETDIR)/polish + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListviews_mcp.cd $< CATALOG $@ + +$(TARGETDIR)/türkçe/NListviews_mcp.catalog: locale/turkish.ct + @$(MKDIR) $(TARGETDIR)/türkçe + @$(FLEXCAT) $(SRCDIR)/$(CURDIR)/locale/NListviews_mcp.cd $< CATALOG $@ + +%common diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/private.h b/workbench/classes/zune/nlist/nlistviews_mcp/private.h new file mode 100644 index 0000000000..cf431f5b86 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/private.h @@ -0,0 +1,111 @@ +#ifndef MUI_NLISTVIEWS_priv_MCP_H +#define MUI_NLISTVIEWS_priv_MCP_H + +/*************************************************************************** + + NListviews.mcp - New Listview MUI Custom Class Preferences + Registered MUI class, Serial Number: 1d51 (0x9d510001 to 0x9d51001F + and 0x9d510101 to 0x9d51013F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2005 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#include "amiga-align.h" +#include "NListviews_mcp.h" +#include "default-align.h" + +#include "Debug.h" + +#include <mcc_common.h> + +#define MCPMAXRAWBUF 64 + +struct NListviews_MCP_Data +{ + Object *mcp_group; + + Object *mcp_list1; + Object *mcp_list2; + + Object *mcp_PenTitle; + Object *mcp_PenList; + Object *mcp_PenSelect; + Object *mcp_PenCursor; + Object *mcp_PenUnselCur; + Object *mcp_PenInactive; + Object *mcp_BG_Title; + Object *mcp_BG_List; + Object *mcp_BG_Select; + Object *mcp_BG_Cursor; + Object *mcp_BG_UnselCur; + Object *mcp_BG_Inactive; + + Object *mcp_R_Multi; + Object *mcp_B_MultiMMB; + Object *mcp_R_Drag; + Object *mcp_SL_VertInc; + Object *mcp_R_HSB; + Object *mcp_R_VSB; + Object *mcp_B_Smooth; + + Object *mcp_Font; + Object *mcp_Font_Little; + Object *mcp_Font_Fixed; + Object *mcp_ForcePen; + + Object *mcp_ColWidthDrag; + Object *mcp_PartialCol; + Object *mcp_List_Select; + Object *mcp_NList_Menu; + Object *mcp_PartialChar; + Object *mcp_SerMouseFix; + Object *mcp_DragLines; + Object *mcp_VerticalCenteredLines; + Object *mcp_SelectPointer; + + Object *mcp_WheelStep; + Object *mcp_WheelFast; + Object *mcp_WheelMMB; + + Object *mcp_listkeys; + Object *mcp_stringkey; + Object *mcp_snoopkey; + Object *mcp_insertkey; + Object *mcp_removekey; + Object *mcp_updatekeys; + Object *mcp_defaultkeys; + Object *mcp_txtfct; + Object *mcp_popstrfct; + Object *mcp_poplistfct; + + struct KeyBinding *nlkeys; + LONG nlkeys_size; + char QualifierString[192]; + + char rawtext[MCPMAXRAWBUF]; + char **exampleText; + + struct InputEvent ievent; + + WORD pad1,pad2; +}; + +#define LIBVER(lib) ((struct Library *)lib)->lib_Version + +#endif /* MUI_NLISTVIEWS_priv_MCP_H */ diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/vastubs.c b/workbench/classes/zune/nlist/nlistviews_mcp/vastubs.c new file mode 100755 index 0000000000..f14c8909ce --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/vastubs.c @@ -0,0 +1,48 @@ +/*************************************************************************** + + NListviews.mcp - New Listview MUI Custom Class Preferences + Registered MUI class, Serial Number: 1d51 (0x9d510001 to 0x9d51001F + and 0x9d510101 to 0x9d51013F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2007 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#if !defined(__AROS__) && (defined(__VBCC__) || defined(NO_INLINE_STDARG)) +#if defined(_M68000) || defined(__M68000) || defined(__mc68000) + +#include <exec/types.h> + +/* FIX V45 breakage... */ +#if INCLUDE_VERSION < 45 +#define MY_CONST_STRPTR CONST_STRPTR +#else +#define MY_CONST_STRPTR CONST STRPTR +#endif + +#include <proto/intuition.h> + +APTR NewObject( struct IClass *classPtr, CONST_STRPTR classID, Tag tag1, ... ) +{ return NewObjectA(classPtr, classID, (struct TagItem *)&tag1); } +ULONG SetAttrs( APTR object, ULONG tag1, ... ) +{ return SetAttrsA(object, (struct TagItem *)&tag1); } + +#else + #error "VARGS stubs are only save on m68k systems!" +#endif +#endif diff --git a/workbench/classes/zune/nlist/nlistviews_mcp/version.h b/workbench/classes/zune/nlist/nlistviews_mcp/version.h new file mode 100644 index 0000000000..cbb6f22c00 --- /dev/null +++ b/workbench/classes/zune/nlist/nlistviews_mcp/version.h @@ -0,0 +1,83 @@ +/*************************************************************************** + + NListviews.mcp - New Listview MUI Custom Class Preferences + Registered MUI class, Serial Number: 1d51 (0x9d510001 to 0x9d51001F + and 0x9d510101 to 0x9d51013F) + + Copyright (C) 1996-2001 by Gilles Masson + Copyright (C) 2001-2010 by NList Open Source Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + NList classes Support Site: http://www.sf.net/projects/nlist-classes + + $Id$ + +***************************************************************************/ + +#ifndef _VERSION_H_ +#define _VERSION_H_ + +// transforms a define into a string +#define STR(x) STR2(x) +#define STR2(x) #x + +// for setting all necessary version information +#define LIB_VERSION 19 +#define LIB_REVISION 81 +#define LIB_DATE "17.12.2011" +#define LIB_COPYRIGHT "Copyright (C) 2001-2011 NList Open Source Team" + +// set the LIB_REV_STRING +#define LIB_REV_STRING STR(LIB_VERSION) "." STR(LIB_REVISION) + +// identify the system we are compiling for +#if defined(__amigaos4__) + #define SYSTEM "AmigaOS4" + #define SYSTEMSHORT "OS4" +#elif defined(__MORPHOS__) + #define SYSTEM "MorphOS" + #define SYSTEMSHORT "MOS" +#elif defined(__AROS__) + #define SYSTEM "AROS" + #define SYSTEMSHORT SYSTEM +#elif defined(__AMIGA__) + #define SYSTEM "AmigaOS3" + #define SYSTEMSHORT "OS3" +#else + #warning "Unsupported System - check SYSTEM define" + #define SYSTEM "???" + #define SYSTEMSHORT "???" +#endif + +// identify the CPU model +#if defined(__PPC__) || defined(__powerpc__) + #define CPU "PPC" +#elif defined(_M68060) || defined(__M68060) || defined(__mc68060) + #define CPU "m68060" +#elif defined(_M68040) || defined(__M68040) || defined(__mc68040) + #define CPU "m68040" +#elif defined(_M68030) || defined(__M68030) || defined(__mc68030) + #define CPU "m68030" +#elif defined(_M68020) || defined(__M68020) || defined(__mc68020) + #define CPU "m68k" +#elif defined(_M68000) || defined(__M68000) || defined(__mc68000) + #define CPU "m68000" +#elif defined(__i386__) + #define CPU "x86" +#elif defined(__x86_64__) + #define CPU "x86_64" +#else + #warning "Unsupported CPU model - check CPU define" + #define CPU "???" +#endif + +#endif // _VERSION_H_ diff --git a/workbench/classes/zune/nlist/tools/bumprev.sh b/workbench/classes/zune/nlist/tools/bumprev.sh new file mode 100755 index 0000000000..b3ab757a8b --- /dev/null +++ b/workbench/classes/zune/nlist/tools/bumprev.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# +# a simple shell script which allows to bump the LIB_REVISION and LIB_DATE information +# found in a specified source code file +# + +if [ "$1" = "all" ]; then + find . -maxdepth 2 -name "version.h" -exec $0 {} \; +else + if [ -e $1 ]; then + foundrev=`grep "#define LIB_REVISION " $1` + if [ $? -eq 0 ]; then + founddate=`grep "#define LIB_DATE " $1` + if [ $? -eq 0 ]; then + newrev=`echo $foundrev | awk '{ print $1" "$2" "$3+1 }'` + curdate=`date +%d.%m.%Y` + newdate=`echo "#define LIB_DATE \"${curdate}\""` + sed -i "s/${foundrev}/${newrev}/g" $1 + sed -i "s/${founddate}/${newdate}/g" $1 + echo "bumped $1" + fi + fi + fi +fi diff --git a/workbench/classes/zune/nlist/tools/mkrelease.sh b/workbench/classes/zune/nlist/tools/mkrelease.sh new file mode 100755 index 0000000000..f59ebf09b4 --- /dev/null +++ b/workbench/classes/zune/nlist/tools/mkrelease.sh @@ -0,0 +1,115 @@ +#!/bin/sh + +############################################################################ +# +# NList MUI custom classes +# +# Copyright (C) 1996-2001 by Gilles Masson (NList.mcc) +# Copyright (C) 1999-2001 by Carsten Scholling (NListtree.mcc) +# Copyright (C) 2006 by Daniel Allsopp (NBitmap.mcc) +# Copyright (C) 2001-2008 by NList Open Source Team +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# NList classes Support Site: http://www.sf.net/projects/nlist-classes +# +# $Id: mkrelease.sh 513 2010-09-10 06:47:11Z thboeckel $ +# +############################################################################ + +# NList classes release build script +# invoke this script as "./mkrelease.sh <revision>" to build the release archives + +if [ "$1" = "" ]; then + echo "no release revision specified" + exit +fi + +rm -rf "release" +mkdir -p "release" +mkdir -p "release/MCC_NList" +mkdir -p "release/MCC_NList/Demos" +mkdir -p "release/MCC_NList/Developer" +mkdir -p "release/MCC_NList/Developer/Autodocs" +mkdir -p "release/MCC_NList/Developer/C" +mkdir -p "release/MCC_NList/Developer/C/Examples" +mkdir -p "release/MCC_NList/Developer/C/include" +mkdir -p "release/MCC_NList/Developer/C/include/mui" +mkdir -p "release/MCC_NList/Libs" +mkdir -p "release/MCC_NList/Libs/MUI" +mkdir -p "release/MCC_NList/Locale" +mkdir -p "release/MCC_NList/Locale/Catalogs" + +make -C nbalance_mcc release +make -C nbitmap_mcc release +make -C nfloattext_mcc release +make -C nlist_mcc release +make -C nlisttree_mcc release +make -C nlistview_mcc release +make -C nlisttree_mcp release +make -C nlistviews_mcp release +make -C demo release + +for os in os3 os4 mos aros-i386 aros-ppc aros-x86_64; do + case $os in + os3) fullsys="AmigaOS3";; + os4) fullsys="AmigaOS4";; + mos) fullsys="MorphOS";; + aros-i386) fullsys="AROS-i386";; + aros-ppc) fullsys="AROS-ppc";; + aros-x86_64) fullsys="AROS-x86_64";; + esac + mkdir -p "release/MCC_NList/Demos/$fullsys" + mkdir -p "release/MCC_NList/Libs/MUI/$fullsys" + cp -a demo/bin_$os/NBitmap-Demo "release/MCC_NList/Demos/$fullsys/" + cp -a nbitmap_mcc/icon.png "release/MCC_NList/Demos/$fullsys/" + cp -a demo/bin_$os/NList-Demo "release/MCC_NList/Demos/$fullsys/" + cp -a demo/bin_$os/NListtree-Demo "release/MCC_NList/Demos/$fullsys/" + cp -a nbalance_mcc/bin_$os/NBalance.mcc "release/MCC_NList/Libs/MUI/$fullsys/" + cp -a nbitmap_mcc/bin_$os/NBitmap.mcc "release/MCC_NList/Libs/MUI/$fullsys/" + cp -a nfloattext_mcc/bin_$os/NFloattext.mcc "release/MCC_NList/Libs/MUI/$fullsys/" + cp -a nlist_mcc/bin_$os/NList.mcc "release/MCC_NList/Libs/MUI/$fullsys/" + cp -a nlisttree_mcc/bin_$os/NListtree.mcc "release/MCC_NList/Libs/MUI/$fullsys/" + cp -a nlistview_mcc/bin_$os/NListview.mcc "release/MCC_NList/Libs/MUI/$fullsys/" + cp -a nlisttree_mcp/bin_$os/NListtree.mcp -a "release/MCC_NList/Libs/MUI/$fullsys/" + cp -a nlistviews_mcp/bin_$os/NListviews.mcp -a "release/MCC_NList/Libs/MUI/$fullsys/" +done + +make -C nlisttree_mcp catalogs +for language in czech english-british french german polish swedish turkish; do + mkdir -p "release/MCC_NList/Locale/Catalogs/$language" + cp -a nlisttree_mcp/locale/$language.catalog "release/MCC_NList/Locale/Catalogs/$language/NListtree_mcp.catalog" +done +make -C nlistviews_mcp catalogs +for language in czech french german swedish polish turkish; do + mkdir -p "release/MCC_NList/Locale/Catalogs/$language" + cp -a nlistviews_mcp/locale/$language.catalog "release/MCC_NList/Locale/Catalogs/$language/NListviews_mcp.catalog" +done + +cp -a -R dist/* "release/" +cp -a AUTHORS ChangeLog COPYING "release/MCC_NList/" +cp -a docs/ReadMe "release/MCC_NList/ReadMe" +cp -a docs/*.doc "release/MCC_NList/Developer/Autodocs/" +cp -a demo/*.c "release/MCC_NList/Developer/C/Examples/" +cp -a demo/Makefile "release/MCC_NList/Developer/C/Examples/" +cp -a include/mui/NBalance_mcc.h "release/MCC_NList/Developer/C/include/mui/" +cp -a include/mui/NBitmap_mcc.h "release/MCC_NList/Developer/C/include/mui/" +cp -a include/mui/NFloattext_mcc.h "release/MCC_NList/Developer/C/include/mui/" +cp -a include/mui/NList_mcc.h "release/MCC_NList/Developer/C/include/mui/" +cp -a include/mui/NListtree_mcc.h "release/MCC_NList/Developer/C/include/mui/" +cp -a include/mui/NListview_mcc.h "release/MCC_NList/Developer/C/include/mui/" +cp -a nlisttree_mcp/locale/NListtree_mcp.cd "release/MCC_NList/Locale/" +cp -a nlistviews_mcp/locale/NListviews_mcp.cd "release/MCC_NList/Locale/" + +echo " MK MCC_NList-0.$1.lha" +find release -nowarn -name ".svn" -exec rm -rf {} \; 2>/dev/null +cd release +lha -ao5q ../MCC_NList-0.$1.lha * -- 2.11.4.GIT