diff --git a/DiscImageChef.Filesystems/AppleCommon/Enums.cs b/DiscImageChef.Filesystems/AppleCommon/Enums.cs index 9e2ba273a..d6a6d43a9 100644 --- a/DiscImageChef.Filesystems/AppleCommon/Enums.cs +++ b/DiscImageChef.Filesystems/AppleCommon/Enums.cs @@ -82,5 +82,18 @@ namespace DiscImageChef.Filesystems { fTrash = -3, fDesktop = -2, fDisk = 0 } + + [Flags] + internal enum ExtendedFinderFlags : ushort + { + /// If set the other extended flags are ignored. + kExtendedFlagsAreInvalid = 0x8000, + /// Set if the file or folder has a badge resource. + kExtendedFlagHasCustomBadge = 0x0100, + /// Set if the object is marked as busy/incomplete. + kExtendedFlagObjectIsBusy = 0x0080, + /// Set if the file contains routing info resource. + kExtendedFlagHasRoutingInfo = 0x0004 + } } } \ No newline at end of file diff --git a/DiscImageChef.Filesystems/AppleCommon/Structs.cs b/DiscImageChef.Filesystems/AppleCommon/Structs.cs index 5b59c04e6..429ab7ee8 100644 --- a/DiscImageChef.Filesystems/AppleCommon/Structs.cs +++ b/DiscImageChef.Filesystems/AppleCommon/Structs.cs @@ -89,6 +89,14 @@ namespace DiscImageChef.Filesystems public readonly uint bbSysHeapFract; } + internal struct Rect + { + public ushort top; + public ushort left; + public ushort bottom; + public ushort right; + } + internal struct Point { public ushort v; @@ -108,5 +116,45 @@ namespace DiscImageChef.Filesystems /// Folder file belongs to (used only in flat filesystems like MFS). public FinderFolder fdFldr; } + + internal struct FXInfo + { + /// Resource fork ID of file icon. + public ushort fdIconID; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] + public byte[] fdUnused; + /// Extended flags. If high-bit is set, most significant byte is script code and least significant byte are flags. + public ExtendedFinderFlags fdXFlags; + /// Resource fork ID of directory comment if high bit is clear. + public ushort fdComment; + /// Put away folder ID. + public uint fdPutAway; + } + + internal struct DInfo + { + /// Position and dimensions of the folder's window. + public Rect frRect; + /// Flags. + public FinderFlags frFlags; + /// Folder's location in the parent folder. + public Point frLocation; + /// Finder view selected for folder. + public ushort frView; + } + + internal struct DXInfo + { + /// Scroll position for icon views. + public Point frScroll; + /// Directory ID chain of open folders. + public uint frOpenChain; + /// Extended flags. If high-bit is set, most significant byte is script code and least significant byte are flags. + public ExtendedFinderFlags frXFlags; + /// Resource fork ID of directory comment if high bit is clear. + public ushort frComment; + /// Put away folder ID. + public uint frPutAway; + } } } \ No newline at end of file diff --git a/DiscImageChef.Filesystems/AppleHFS/Enums.cs b/DiscImageChef.Filesystems/AppleHFS/Enums.cs index bd7d33393..8aef7275f 100644 --- a/DiscImageChef.Filesystems/AppleHFS/Enums.cs +++ b/DiscImageChef.Filesystems/AppleHFS/Enums.cs @@ -30,8 +30,6 @@ // Copyright © 2011-2020 Natalia Portillo // ****************************************************************************/ -using System; - namespace DiscImageChef.Filesystems { public partial class AppleHFS @@ -64,18 +62,5 @@ namespace DiscImageChef.Filesystems { Data = 0, Resource = -1 } - - [Flags] - internal enum ExtendedFinderFlags : ushort - { - /// If set the other extended flags are ignored. - kExtendedFlagsAreInvalid = 0x8000, - /// Set if the file or folder has a badge resource. - kExtendedFlagHasCustomBadge = 0x0100, - /// Set if the object is marked as busy/incomplete. - kExtendedFlagObjectIsBusy = 0x0080, - /// Set if the file contains routing info resource. - kExtendedFlagHasRoutingInfo = 0x0004 - } } } \ No newline at end of file diff --git a/DiscImageChef.Filesystems/AppleHFS/Structs.cs b/DiscImageChef.Filesystems/AppleHFS/Structs.cs index 40e6543c0..b095d74a7 100644 --- a/DiscImageChef.Filesystems/AppleHFS/Structs.cs +++ b/DiscImageChef.Filesystems/AppleHFS/Structs.cs @@ -215,9 +215,9 @@ namespace DiscImageChef.Filesystems /// Date and time of last backup. public readonly uint dirBkDat; /// Finder information. - public readonly DInfo dirUsrInfo; + public readonly AppleCommon.DInfo dirUsrInfo; /// Additional Finder information. - public readonly DXInfo dirFndrInfo; + public readonly AppleCommon.DXInfo dirFndrInfo; /// Reserved [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public readonly uint[] dirResrv; @@ -255,7 +255,7 @@ namespace DiscImageChef.Filesystems /// Date and time of last backup. public readonly uint filBkDat; /// Additional Finder information. - public readonly FXInfo filFndrInfo; + public readonly AppleCommon.FXInfo filFndrInfo; /// File clump size. public readonly ushort filClpSize; /// First data fork extent record. @@ -327,53 +327,5 @@ namespace DiscImageChef.Filesystems /// Starting file allocation block. public readonly ushort xkrFABN; } - - struct Rect - { - public ushort top; - public ushort left; - public ushort bottom; - public ushort right; - } - - struct FXInfo - { - /// Resource fork ID of file icon. - public ushort fdIconID; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] - public byte[] fdUnused; - /// Extended flags. If high-bit is set, most significant byte is script code and least significant byte are flags. - public ExtendedFinderFlags fdXFlags; - /// Resource fork ID of directory comment if high bit is clear. - public ushort fdComment; - /// Put away folder ID. - public uint fdPutAway; - } - - struct DInfo - { - /// Position and dimensions of the folder's window. - public Rect frRect; - /// Flags. - public AppleCommon.FinderFlags frFlags; - /// Folder's location in the parent folder. - public AppleCommon.Point frLocation; - /// Finder view selected for folder. - public ushort frView; - } - - struct DXInfo - { - /// Scroll position for icon views. - public AppleCommon.Point frScroll; - /// Directory ID chain of open folders. - public uint frOpenChain; - /// Extended flags. If high-bit is set, most significant byte is script code and least significant byte are flags. - public ExtendedFinderFlags frXFlags; - /// Resource fork ID of directory comment if high bit is clear. - public ushort frComment; - /// Put away folder ID. - public uint frPutAway; - } } } \ No newline at end of file