24 #include "wine/port.h" 36 #include "wine/unicode.h" 40 #define _MAX_FNAME 256 41 #define _MAX_DIR _MAX_FNAME 42 #define _MAX_EXT _MAX_FNAME 46 #ifdef NONAMELESSUNION 47 #define UNION_MEMBER(x) DUMMYUNIONNAME.x 49 #define UNION_MEMBER(x) x 52 #define DEFAULT_SPLIT_POS 300 56 'W',
'i',
'n',
'e',
'F',
'i',
'l',
'e',
'\0'};
181 *(--
p) =
'0' +
val % 10;
195 #define RS(b, i) load_string(b, sizeof(b)/sizeof(b[0]), i) 310 IShellFolder_Release(
entry->folder);
398 dir->down = first_entry;
412 if (!*
p || *
p ==
'\\' || *
p ==
'/')
417 q =
entry->data.cAlternateFileName;
420 if (!*
p || *
p ==
'\\' || *
p ==
'/')
440 while(*
s && *
s !=
'\\' && *
s !=
'/')
443 while(*
s ==
'\\' || *
s ==
'/')
533 entry->data.nFileSizeLow = st.st_size & 0xFFFFFFFF;
534 entry->data.nFileSizeHigh = st.st_size >> 32;
540 entry->bhfi.nFileIndexLow =
ent->d_ino;
541 entry->bhfi.nFileIndexHigh = 0;
543 entry->bhfi.nNumberOfLinks = st.st_nlink;
547 entry->data.nFileSizeLow = 0;
548 entry->data.nFileSizeHigh = 0;
567 dir->down = first_entry;
580 if (!*
p || *
p ==
'/')
582 }
while(*
p++ == *
q++);
600 while(*
s && *
s !=
'/')
730 }
else if (
entry->pidl)
748 if (!(
flags & GIL_NOTFILENAME)) {
753 flags &= ~GIL_DONTCACHE;
755 HICON hIconLarge = 0;
776 if (
entry->pidl->mkid.cb == pidl->mkid.cb &&
799 entry->pidl = next_pidl;
807 memcpy(next_pidl, pidl, pidl->mkid.cb);
810 hr = IShellFolder_BindToObject(
folder, next_pidl, 0, &IID_IShellFolder, (
void**)&
child);
838 if (!(
attribs & SFGAO_FILESYSTEM) ||
843 STGMEDIUM medium = {0, {0}, 0};
849 hr = IDataObject_GetData(pDataObj, &
fmt, &medium);
851 IDataObject_Release(pDataObj);
877 if (
attribs & (SFGAO_FOLDER|SFGAO_HASSUBFOLDER))
883 if (
attribs & SFGAO_COMPRESSED)
904 hr = IShellFolder_EnumObjects(
folder,
hwnd, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREABLE|SHCONTF_STORAGE, &idlist);
908 #define FETCH_ITEM_COUNT 32 914 memset(pidls, 0,
sizeof(pidls));
923 for(
n=0;
n<cnt; ++
n) {
952 hr = IShellFolder_BindToObject(
folder, pidls[
n], 0, &IID_IShellFolder, (
void**)&
child);
962 if (!
entry->data.cFileName[0])
967 !(
attribs & SFGAO_FILESYSTEM)) {
987 IEnumIDList_Release(idlist);
993 dir->down = first_entry;
1009 if (
name[0] ==
'.') {
1010 if (
name[1] ==
'\0')
1032 return order2==order1? 0: order1<order2? -1: 1;
1045 return lstrcmpiW(fd1->cFileName, fd2->cFileName);
1058 name1 = fd1->cFileName;
1059 name2 = fd2->cFileName;
1090 cmp = fd2->nFileSizeHigh - fd1->nFileSizeHigh;
1097 cmp = fd2->nFileSizeLow - fd1->nFileSizeLow;
1099 return cmp<0? -1:
cmp>0? 1: 0;
1186 read_directory_unix(
dir,
path);
1235 static const WCHAR sSlash[] = {
'/',
'\0'};
1237 static const WCHAR sBackslash[] = {
'\\',
'\0'};
1296 static const WCHAR sAsterics[] = {
'*',
'\0'};
1297 static const WCHAR sTitleFmt[] = {
'%',
's',
' ',
'-',
' ',
'%',
's',
'\0'};
1306 child->left.visible_cols = 0;
1312 child->pos.flags = 0;
1319 child->focus_pane = 0;
1329 if (
path[0] ==
'"' &&
path[pathlen - 1] ==
'"')
1342 root->entry.level = 0;
1408 for(
l=0; *
s && *
s !=
'/' && *
s !=
'\\';
s++)
1472 size=
sizeof(logfont);
1541 prect->
top = new_top;
1546 int parts[] = {300, 500};
1603 mcs.x =
child->pos.rcNormalPosition.left;
1604 mcs.y =
child->pos.rcNormalPosition.top;
1605 mcs.cx =
child->pos.rcNormalPosition.right-
child->pos.rcNormalPosition.left;
1606 mcs.cy =
child->pos.rcNormalPosition.bottom-
child->pos.rcNormalPosition.top;
1630 #define RFF_NODEFAULT 0x02 1634 static const WCHAR shell32_dll[] = {
'S',
'H',
'E',
'L',
'L',
'3',
'2',
'.',
'D',
'L',
'L',0};
1768 static const WCHAR sBackSlash[] = {
'\\',
'\0'};
1769 static const WCHAR sTranslation[] = {
'\\',
'V',
'a',
'r',
'F',
'i',
'l',
'e',
'I',
'n',
'f',
'o',
'\\',
'T',
'r',
'a',
'n',
's',
'l',
'a',
't',
'i',
'o',
'n',
'\0'};
1770 static const WCHAR sStringFileInfo[] = {
'\\',
'S',
't',
'r',
'i',
'n',
'g',
'F',
'i',
'l',
'e',
'I',
'n',
'f',
'o',
'\\',
1771 '%',
'0',
'4',
'x',
'%',
'0',
'4',
'x',
'\\',
'%',
's',
'\0'};
1772 static const WCHAR sFmt[] = {
'%',
'd',
'.',
'%',
'd',
'.',
'%',
'd',
'.',
'%',
'd',
'\0'};
1775 if (dwVersionDataLen) {
1803 for(; pTranslate<pEnd; ++pTranslate) {
1807 WCHAR subblock[200];
1838 static const WCHAR sByteFmt[] = {
'%',
's',
' ',
'B',
'y',
't',
'e',
's',
'\0'};
1987 rt.left =
pos.left-rt.left;
1988 rt.top =
pos.top-rt.top;
2123 }
else switch(
cmd) {
2365 static const WCHAR s1000[] = {
'1',
'0',
'0',
'0',
'\0'};
2401 for(col=0; col<
COLUMNS; col++)
2407 for(cnt=0; cnt<entries; cnt++) {
2432 for(col=0; col<
COLUMNS; col++) {
2453 if (!anyway && !
memcmp(orgWidths, pane->
widths,
sizeof(orgWidths)))
2457 if (!anyway && pane->
widths[0]<orgWidths[0] &&
2458 !
memcmp(orgWidths+1, pane->
widths+1,
sizeof(orgWidths)-
sizeof(
int))) {
2459 pane->
widths[0] = orgWidths[0];
2484 for(cnt=0; cnt<entries; cnt++) {
2595 if (
entry->data.cFileName[1] ==
'\0' ||
2596 (
entry->data.cFileName[1] ==
'.' &&
2597 entry->data.cFileName[2] ==
'\0'))
2649 static const WCHAR sFmtSmall[] = {
'%',
'u', 0};
2650 static const WCHAR sFmtBig[] = {
'%',
'.',
'1',
'f',
' ',
'%',
's',
'\0'};
2659 if (
bytes >= 1073741824)
2664 else if (
bytes >= 1048576)
2704 static const WCHAR sListBox[] = {
'L',
'i',
's',
't',
'B',
'o',
'x',
'\0'};
2778 RECT rt = {0, 0, 0, 0};
2788 RECT rt = {0, 0, 0, 0};
2858 static const WCHAR executable_extensions[][4] = {
2877 for(
p=executable_extensions; (*p)[0];
p++)
2921 attrs =
entry->data.dwFileAttributes;
2924 if (
entry->data.cFileName[0] ==
'.' &&
entry->data.cFileName[1] ==
'.' 2925 &&
entry->data.cFileName[2] ==
'\0')
2927 else if (
entry->data.cFileName[0] ==
'.' &&
entry->data.cFileName[1] ==
'\0')
2949 if (calcWidthCol == -1) {
3001 }
else if (calcWidthCol==col || calcWidthCol==
COLUMNS) {
3013 if (calcWidthCol==col || calcWidthCol==
COLUMNS)
3017 if (calcWidthCol == -1) {
3018 focusRect.
left = img_pos -2;
3023 textcolor =
RGB(0,0,0);
3026 textcolor =
RGB(255,255,255);
3029 bkcolor =
RGB(255,255,255);
3060 if (calcWidthCol == -1)
3062 else if (calcWidthCol==col || calcWidthCol==
COLUMNS)
3071 if (calcWidthCol == -1)
3073 else if (calcWidthCol==col || calcWidthCol==
COLUMNS)
3082 if (calcWidthCol == -1)
3084 else if (calcWidthCol==col || calcWidthCol==
COLUMNS)
3089 if (calcWidthCol == -1)
3091 else if (calcWidthCol==col || calcWidthCol==
COLUMNS)
3096 if (calcWidthCol == -1)
3098 else if (calcWidthCol==col || calcWidthCol==
COLUMNS)
3103 if (
entry->bhfi_valid) {
3105 static const WCHAR fmtlow[] = {
'%',
'X',0};
3106 static const WCHAR fmthigh[] = {
'%',
'X',
'%',
'0',
'8',
'X',0};
3108 if (
entry->bhfi.nFileIndexHigh)
3110 entry->bhfi.nFileIndexHigh,
entry->bhfi.nFileIndexLow );
3114 if (calcWidthCol == -1)
3116 else if (calcWidthCol==col || calcWidthCol==
COLUMNS)
3125 if (calcWidthCol == -1)
3127 else if (calcWidthCol==col || calcWidthCol==
COLUMNS)
3137 static const WCHAR s11Tabs[] = {
' ',
'\t',
' ',
'\t',
' ',
'\t',
' ',
'\t',
' ',
'\t',
' ',
'\t',
' ',
'\t',
' ',
'\t',
' ',
'\t',
' ',
'\t',
' ',
'\t',
' ',
'\0'};
3156 if (calcWidthCol == -1)
3158 else if (calcWidthCol==col || calcWidthCol==
COLUMNS)
3181 item.cxy =
x - scroll_pos;
3194 switch(pnmh->
code) {
3224 if (rt_scr.
left < 0) rt_scr.
left = 0;
3225 if (rt_clip.
left < 0) rt_clip.
left = 0;
3310 if (!
dir ||
dir->expanded || !
dir->down)
3315 if (
p->data.cFileName[0]==
'.' &&
p->data.cFileName[1]==
'\0' &&
p->next) {
3318 if (
p->data.cFileName[0]==
'.' &&
p->data.cFileName[1]==
'.' &&
3319 p->data.cFileName[2]==
'\0' &&
p->next)
3334 if (!
child->header_wdths_ok) {
3395 if (!
entry->scanned)
3459 0, 16, 13, 16, 13,
sizeof(
TBBUTTON));
3470 drivebarBtn.iString++;
3479 drivebarBtn.iString++;
3492 default: drivebarBtn.iBitmap = 2;
3496 drivebarBtn.idCommand++;
3497 drivebarBtn.iString++;
3549 shexinfo.
nShow = nCmdShow;
3578 int scanned_old =
entry->scanned;
3586 if (
entry->data.cFileName[0]==
'.' &&
entry->data.cFileName[1]==
'\0')
3589 if (
entry->data.cFileName[0]==
'.' &&
entry->data.cFileName[1]==
'.' &&
entry->data.cFileName[2]==
'\0') {
3593 }
else if (
entry->expanded)
3598 if (!pane->
treePane) focus_entry: {
3663 if (
child->sortOrder != sortOrder) {
3664 child->sortOrder = sortOrder;
3702 if (
path[0]!=
'/' &&
path[1]!=
':') {
3716 static const WCHAR sAppend[] = {
'%',
's',
'/',
'%',
's',
'%',
's',
'\0'};
3742 if (IContextMenu_QueryInterface(pcm1, &IID_IContextMenu3, (
void**)&pcm) ==
NOERROR)
3744 else if (IContextMenu_QueryInterface(pcm1, &IID_IContextMenu2, (
void**)&pcm) ==
NOERROR)
3748 IContextMenu_Release(pcm1);
3789 CMINVOKECOMMANDINFO cmi;
3791 cmi.cbSize =
sizeof(CMINVOKECOMMANDINFO);
3795 cmi.lpParameters =
NULL;
3796 cmi.lpDirectory =
NULL;
3801 hr = IContextMenu_InvokeCommand(pcm, &cmi);
3808 IContextMenu_Release(pcm);
3829 goto draw_menu_item;